@logicflow/core 2.0.0-beta.4 → 2.0.0-beta.6

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 (246) hide show
  1. package/.turbo/turbo-build$colon$dev.log +2 -2
  2. package/.turbo/turbo-build.log +9 -15
  3. package/__tests__/bugs/1545-spec.test.ts +19 -15
  4. package/__tests__/util/edge.test.ts +57 -57
  5. package/dist/index.min.js +4 -4
  6. package/es/LogicFlow.d.ts +32 -6
  7. package/es/LogicFlow.js +15 -12
  8. package/es/LogicFlow.js.map +1 -1
  9. package/es/algorithm/edge.js.map +1 -1
  10. package/es/algorithm/index.d.ts +2 -0
  11. package/es/algorithm/index.js +2 -0
  12. package/es/algorithm/index.js.map +1 -1
  13. package/es/algorithm/outline.d.ts +1 -1
  14. package/es/common/drag.d.ts +2 -2
  15. package/es/common/drag.js.map +1 -1
  16. package/es/constant/index.d.ts +37 -1
  17. package/es/constant/index.js +40 -1
  18. package/es/constant/index.js.map +1 -1
  19. package/es/event/eventArgs.d.ts +88 -25
  20. package/es/index.d.ts +4 -0
  21. package/es/index.js +4 -0
  22. package/es/index.js.map +1 -1
  23. package/es/keyboard/shortcut.d.ts +4 -0
  24. package/es/keyboard/shortcut.js +9 -8
  25. package/es/keyboard/shortcut.js.map +1 -1
  26. package/es/model/BaseModel.d.ts +12 -16
  27. package/es/model/EditConfigModel.d.ts +97 -36
  28. package/es/model/EditConfigModel.js +166 -79
  29. package/es/model/EditConfigModel.js.map +1 -1
  30. package/es/model/GraphModel.d.ts +12 -1
  31. package/es/model/GraphModel.js +40 -9
  32. package/es/model/GraphModel.js.map +1 -1
  33. package/es/model/TransformModel.js +1 -1
  34. package/es/model/TransformModel.js.map +1 -1
  35. package/es/model/edge/BaseEdgeModel.d.ts +7 -1
  36. package/es/model/edge/BaseEdgeModel.js +33 -17
  37. package/es/model/edge/BaseEdgeModel.js.map +1 -1
  38. package/es/model/edge/BezierEdgeModel.d.ts +1 -1
  39. package/es/model/edge/BezierEdgeModel.js +5 -2
  40. package/es/model/edge/BezierEdgeModel.js.map +1 -1
  41. package/es/model/edge/PolylineEdgeModel.d.ts +3 -3
  42. package/es/model/edge/PolylineEdgeModel.js +20 -14
  43. package/es/model/edge/PolylineEdgeModel.js.map +1 -1
  44. package/es/model/node/BaseNodeModel.d.ts +7 -1
  45. package/es/model/node/BaseNodeModel.js +22 -11
  46. package/es/model/node/BaseNodeModel.js.map +1 -1
  47. package/es/model/node/CircleNodeModel.js.map +1 -1
  48. package/es/model/node/DiamondNodeModel.js.map +1 -1
  49. package/es/model/node/EllipseNodeModel.js.map +1 -1
  50. package/es/options.d.ts +4 -1
  51. package/es/options.js.map +1 -1
  52. package/es/tool/MultipleSelectTool.d.ts +1 -1
  53. package/es/tool/MultipleSelectTool.js +5 -5
  54. package/es/tool/MultipleSelectTool.js.map +1 -1
  55. package/es/tool/TextEditTool.d.ts +3 -3
  56. package/es/tool/TextEditTool.js +2 -2
  57. package/es/tool/TextEditTool.js.map +1 -1
  58. package/es/tool/index.d.ts +24 -2
  59. package/es/tool/index.js +82 -2
  60. package/es/tool/index.js.map +1 -1
  61. package/es/util/drag.d.ts +5 -5
  62. package/es/util/drag.js +3 -1
  63. package/es/util/drag.js.map +1 -1
  64. package/es/util/edge.d.ts +2 -1
  65. package/es/util/edge.js +9 -12
  66. package/es/util/edge.js.map +1 -1
  67. package/es/util/node.d.ts +2 -5
  68. package/es/util/node.js +1 -0
  69. package/es/util/node.js.map +1 -1
  70. package/es/view/Anchor.d.ts +1 -3
  71. package/es/view/Anchor.js +3 -0
  72. package/es/view/Anchor.js.map +1 -1
  73. package/es/view/Control.d.ts +1 -1
  74. package/es/view/Control.js +7 -7
  75. package/es/view/Control.js.map +1 -1
  76. package/es/view/Graph.d.ts +1 -1
  77. package/es/view/Rotate.js +2 -1
  78. package/es/view/Rotate.js.map +1 -1
  79. package/es/view/behavior/index.d.ts +2 -0
  80. package/es/view/behavior/index.js +3 -0
  81. package/es/view/behavior/index.js.map +1 -0
  82. package/es/view/behavior/snapline.d.ts +3 -0
  83. package/es/{tool → view/behavior}/snapline.js +0 -1
  84. package/es/view/behavior/snapline.js.map +1 -0
  85. package/es/view/edge/AdjustPoint.js +9 -20
  86. package/es/view/edge/AdjustPoint.js.map +1 -1
  87. package/es/view/edge/BaseEdge.js +25 -17
  88. package/es/view/edge/BaseEdge.js.map +1 -1
  89. package/es/view/node/BaseNode.js +14 -9
  90. package/es/view/node/BaseNode.js.map +1 -1
  91. package/es/view/node/HtmlNode.js +2 -2
  92. package/es/view/node/HtmlNode.js.map +1 -1
  93. package/es/view/overlay/CanvasOverlay.js +1 -0
  94. package/es/view/overlay/CanvasOverlay.js.map +1 -1
  95. package/es/view/overlay/ToolOverlay.d.ts +1 -1
  96. package/es/view/overlay/ToolOverlay.js +1 -1
  97. package/es/view/overlay/ToolOverlay.js.map +1 -1
  98. package/es/view/text/BaseText.js +7 -3
  99. package/es/view/text/BaseText.js.map +1 -1
  100. package/lib/LogicFlow.d.ts +32 -6
  101. package/lib/LogicFlow.js +17 -14
  102. package/lib/LogicFlow.js.map +1 -1
  103. package/lib/algorithm/edge.js.map +1 -1
  104. package/lib/algorithm/index.d.ts +2 -0
  105. package/lib/algorithm/index.js +17 -1
  106. package/lib/algorithm/index.js.map +1 -1
  107. package/lib/algorithm/outline.d.ts +1 -1
  108. package/lib/common/drag.d.ts +2 -2
  109. package/lib/common/drag.js.map +1 -1
  110. package/lib/constant/index.d.ts +37 -1
  111. package/lib/constant/index.js +41 -2
  112. package/lib/constant/index.js.map +1 -1
  113. package/lib/event/eventArgs.d.ts +88 -25
  114. package/lib/index.d.ts +4 -0
  115. package/lib/index.js +4 -0
  116. package/lib/index.js.map +1 -1
  117. package/lib/keyboard/shortcut.d.ts +4 -0
  118. package/lib/keyboard/shortcut.js +12 -9
  119. package/lib/keyboard/shortcut.js.map +1 -1
  120. package/lib/model/BaseModel.d.ts +12 -16
  121. package/lib/model/EditConfigModel.d.ts +97 -36
  122. package/lib/model/EditConfigModel.js +165 -78
  123. package/lib/model/EditConfigModel.js.map +1 -1
  124. package/lib/model/GraphModel.d.ts +12 -1
  125. package/lib/model/GraphModel.js +38 -7
  126. package/lib/model/GraphModel.js.map +1 -1
  127. package/lib/model/TransformModel.js +1 -1
  128. package/lib/model/TransformModel.js.map +1 -1
  129. package/lib/model/edge/BaseEdgeModel.d.ts +7 -1
  130. package/lib/model/edge/BaseEdgeModel.js +31 -15
  131. package/lib/model/edge/BaseEdgeModel.js.map +1 -1
  132. package/lib/model/edge/BezierEdgeModel.d.ts +1 -1
  133. package/lib/model/edge/BezierEdgeModel.js +4 -1
  134. package/lib/model/edge/BezierEdgeModel.js.map +1 -1
  135. package/lib/model/edge/PolylineEdgeModel.d.ts +3 -3
  136. package/lib/model/edge/PolylineEdgeModel.js +19 -13
  137. package/lib/model/edge/PolylineEdgeModel.js.map +1 -1
  138. package/lib/model/node/BaseNodeModel.d.ts +7 -1
  139. package/lib/model/node/BaseNodeModel.js +20 -9
  140. package/lib/model/node/BaseNodeModel.js.map +1 -1
  141. package/lib/model/node/CircleNodeModel.js.map +1 -1
  142. package/lib/model/node/DiamondNodeModel.js.map +1 -1
  143. package/lib/model/node/EllipseNodeModel.js.map +1 -1
  144. package/lib/options.d.ts +4 -1
  145. package/lib/options.js.map +1 -1
  146. package/lib/tool/MultipleSelectTool.d.ts +1 -1
  147. package/lib/tool/MultipleSelectTool.js +5 -5
  148. package/lib/tool/MultipleSelectTool.js.map +1 -1
  149. package/lib/tool/TextEditTool.d.ts +3 -3
  150. package/lib/tool/TextEditTool.js +4 -4
  151. package/lib/tool/TextEditTool.js.map +1 -1
  152. package/lib/tool/index.d.ts +24 -2
  153. package/lib/tool/index.js +85 -15
  154. package/lib/tool/index.js.map +1 -1
  155. package/lib/util/drag.d.ts +5 -5
  156. package/lib/util/drag.js +3 -1
  157. package/lib/util/drag.js.map +1 -1
  158. package/lib/util/edge.d.ts +2 -1
  159. package/lib/util/edge.js +11 -14
  160. package/lib/util/edge.js.map +1 -1
  161. package/lib/util/node.d.ts +2 -5
  162. package/lib/util/node.js +1 -0
  163. package/lib/util/node.js.map +1 -1
  164. package/lib/view/Anchor.d.ts +1 -3
  165. package/lib/view/Anchor.js +3 -0
  166. package/lib/view/Anchor.js.map +1 -1
  167. package/lib/view/Control.d.ts +1 -1
  168. package/lib/view/Control.js +7 -7
  169. package/lib/view/Control.js.map +1 -1
  170. package/lib/view/Graph.d.ts +1 -1
  171. package/lib/view/Rotate.js +2 -1
  172. package/lib/view/Rotate.js.map +1 -1
  173. package/lib/view/behavior/index.d.ts +2 -0
  174. package/lib/view/behavior/index.js +19 -0
  175. package/lib/view/behavior/index.js.map +1 -0
  176. package/lib/view/behavior/snapline.d.ts +3 -0
  177. package/lib/{tool → view/behavior}/snapline.js +0 -1
  178. package/lib/view/behavior/snapline.js.map +1 -0
  179. package/lib/view/edge/AdjustPoint.js +9 -20
  180. package/lib/view/edge/AdjustPoint.js.map +1 -1
  181. package/lib/view/edge/BaseEdge.js +24 -16
  182. package/lib/view/edge/BaseEdge.js.map +1 -1
  183. package/lib/view/node/BaseNode.js +13 -8
  184. package/lib/view/node/BaseNode.js.map +1 -1
  185. package/lib/view/node/HtmlNode.js +2 -2
  186. package/lib/view/node/HtmlNode.js.map +1 -1
  187. package/lib/view/overlay/CanvasOverlay.js +1 -0
  188. package/lib/view/overlay/CanvasOverlay.js.map +1 -1
  189. package/lib/view/overlay/ToolOverlay.d.ts +1 -1
  190. package/lib/view/overlay/ToolOverlay.js +1 -1
  191. package/lib/view/overlay/ToolOverlay.js.map +1 -1
  192. package/lib/view/text/BaseText.js +6 -2
  193. package/lib/view/text/BaseText.js.map +1 -1
  194. package/package.json +1 -1
  195. package/src/LogicFlow.tsx +52 -14
  196. package/src/algorithm/edge.ts +1 -0
  197. package/src/algorithm/index.ts +2 -0
  198. package/src/algorithm/outline.ts +2 -2
  199. package/src/common/drag.ts +16 -2
  200. package/src/constant/index.ts +42 -1
  201. package/src/event/eventArgs.ts +155 -34
  202. package/src/index.ts +4 -0
  203. package/src/keyboard/shortcut.ts +12 -8
  204. package/src/model/BaseModel.ts +15 -17
  205. package/src/model/EditConfigModel.ts +206 -94
  206. package/src/model/GraphModel.ts +43 -8
  207. package/src/model/TransformModel.ts +1 -1
  208. package/src/model/edge/BaseEdgeModel.ts +27 -18
  209. package/src/model/edge/BezierEdgeModel.ts +5 -6
  210. package/src/model/edge/PolylineEdgeModel.ts +22 -18
  211. package/src/model/node/BaseNodeModel.ts +19 -13
  212. package/src/model/node/CircleNodeModel.ts +0 -1
  213. package/src/model/node/DiamondNodeModel.ts +0 -1
  214. package/src/model/node/EllipseNodeModel.ts +0 -1
  215. package/src/options.ts +6 -1
  216. package/src/tool/MultipleSelectTool.tsx +6 -6
  217. package/src/tool/TextEditTool.tsx +3 -3
  218. package/src/tool/index.ts +96 -2
  219. package/src/util/drag.ts +22 -6
  220. package/src/util/edge.ts +14 -13
  221. package/src/util/node.ts +3 -5
  222. package/src/view/Anchor.tsx +3 -1
  223. package/src/view/Control.tsx +16 -7
  224. package/src/view/Graph.tsx +1 -1
  225. package/src/view/Rotate.tsx +2 -1
  226. package/src/view/behavior/index.ts +2 -0
  227. package/src/{tool → view/behavior}/snapline.ts +3 -4
  228. package/src/view/edge/AdjustPoint.tsx +32 -46
  229. package/src/view/edge/BaseEdge.tsx +58 -38
  230. package/src/view/node/BaseNode.tsx +24 -10
  231. package/src/view/node/HtmlNode.tsx +2 -2
  232. package/src/view/overlay/CanvasOverlay.tsx +1 -0
  233. package/src/view/overlay/ToolOverlay.tsx +1 -1
  234. package/src/view/text/BaseText.tsx +11 -3
  235. package/tsconfig.json +1 -1
  236. package/es/tool/snapline.d.ts +0 -3
  237. package/es/tool/snapline.js.map +0 -1
  238. package/es/tool/tool.d.ts +0 -22
  239. package/es/tool/tool.js +0 -43
  240. package/es/tool/tool.js.map +0 -1
  241. package/lib/tool/snapline.d.ts +0 -3
  242. package/lib/tool/snapline.js.map +0 -1
  243. package/lib/tool/tool.d.ts +0 -22
  244. package/lib/tool/tool.js +0 -49
  245. package/lib/tool/tool.js.map +0 -1
  246. package/src/tool/tool.ts +0 -66
package/dist/index.min.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Core={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var n=function t(){if(this instanceof t){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(e,n))}return e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}var r,o={},i={};var a="An invariant failed, however the error is obfuscated because this is a production build.",s=[];Object.freeze(s);var u={};function l(){return++kt.mobxGuid}function c(t){throw p(!1,t),"X"}function p(t,e){if(!t)throw new Error("[mobx] "+(e||a))}function d(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}Object.freeze(u);var f=function(){};function h(t){return null!==t&&"object"==typeof t}function y(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function v(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function g(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return h(t)&&!0===t[n]}}function _(t){return t instanceof Map}function m(t){return t instanceof Set}function b(t){var e=new Set;for(var n in t)e.add(n);return Object.getOwnPropertySymbols(t).forEach((function(n){Object.getOwnPropertyDescriptor(t,n).enumerable&&e.add(n)})),Array.from(e)}function E(t){return t&&t.toString?t.toString():new String(t).toString()}function x(t){return null===t?null:"object"==typeof t?""+t:t}var w="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,S=Symbol("mobx administration"),M=function(){function t(t){void 0===t&&(t="Atom@"+l()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Q.NOT_TRACKING}return t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.reportObserved=function(){return Ut(this)},t.prototype.reportChanged=function(){zt(),function(t){if(t.lowestObserverState===Q.STALE)return;t.lowestObserverState=Q.STALE,t.observers.forEach((function(e){e.dependenciesState===Q.UP_TO_DATE&&(e.isTracing!==tt.NONE&&Xt(e,t),e.onBecomeStale()),e.dependenciesState=Q.STALE}))}(this),Ht()},t.prototype.toString=function(){return this.name},t}(),A=g("Atom",M);function T(t,e,n){void 0===e&&(e=f),void 0===n&&(n=f);var r=new M(t);return e!==f&&se(r,e),n!==f&&ue(r,n),r}var O={identity:function(t,e){return t===e},structural:function(t,e){return _n(t,e)},default:function(t,e){return Object.is(t,e)},shallow:function(t,e){return _n(t,e,1)}},N=function(t,e){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},N(t,e)};
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Core={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var n=function t(){if(this instanceof t){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(e,n))}return e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}var r,o={},i={};var a="An invariant failed, however the error is obfuscated because this is a production build.",s=[];Object.freeze(s);var u={};function l(){return++jt.mobxGuid}function c(t){throw p(!1,t),"X"}function p(t,e){if(!t)throw new Error("[mobx] "+(e||a))}function d(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}Object.freeze(u);var f=function(){};function h(t){return null!==t&&"object"==typeof t}function v(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function y(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function g(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return h(t)&&!0===t[n]}}function _(t){return t instanceof Map}function m(t){return t instanceof Set}function b(t){var e=new Set;for(var n in t)e.add(n);return Object.getOwnPropertySymbols(t).forEach((function(n){Object.getOwnPropertyDescriptor(t,n).enumerable&&e.add(n)})),Array.from(e)}function E(t){return t&&t.toString?t.toString():new String(t).toString()}function x(t){return null===t?null:"object"==typeof t?""+t:t}var M="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,w=Symbol("mobx administration"),S=function(){function t(t){void 0===t&&(t="Atom@"+l()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Q.NOT_TRACKING}return t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.reportObserved=function(){return Xt(this)},t.prototype.reportChanged=function(){zt(),function(t){if(t.lowestObserverState===Q.STALE)return;t.lowestObserverState=Q.STALE,t.observers.forEach((function(e){e.dependenciesState===Q.UP_TO_DATE&&(e.isTracing!==tt.NONE&&Ht(e,t),e.onBecomeStale()),e.dependenciesState=Q.STALE}))}(this),Ut()},t.prototype.toString=function(){return this.name},t}(),T=g("Atom",S);function A(t,e,n){void 0===e&&(e=f),void 0===n&&(n=f);var r=new S(t);return e!==f&&se(r,e),n!==f&&ue(r,n),r}var O={identity:function(t,e){return t===e},structural:function(t,e){return _n(t,e)},default:function(t,e){return Object.is(t,e)},shallow:function(t,e){return _n(t,e,1)}},D=function(t,e){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},D(t,e)};
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -12,7 +12,7 @@
12
12
 
13
13
  See the Apache Version 2.0 License for specific language governing permissions
14
14
  and limitations under the License.
15
- ***************************************************************************** */var D=function(){return D=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},D.apply(this,arguments)};function P(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function C(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function I(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(C(arguments[e]));return t}var j=Symbol("mobx did run lazy initializers"),k=Symbol("mobx pending decorators"),R={},L={};function B(t){var e,n;if(!0!==t[j]){var r=t[k];if(r){v(t,j,!0);var o=I(Object.getOwnPropertySymbols(r),Object.keys(r));try{for(var i=P(o),a=i.next();!a.done;a=i.next()){var s=r[a.value];s.propertyCreator(t,s.prop,s.descriptor,s.decoratorTarget,s.decoratorArguments)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}}}function z(t,e){return function(){var n,r,o=function(r,o,i,a){if(!0===a)return e(r,o,i,r,n),null;if(!Object.prototype.hasOwnProperty.call(r,k)){var s=r[k];v(r,k,D({},s))}return r[k][o]={prop:o,propertyCreator:e,descriptor:i,decoratorTarget:r,decoratorArguments:n},function(t,e){var n=e?R:L;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return B(this),this[t]},set:function(e){B(this),this[t]=e}})}(o,t)};return(2===(r=arguments).length||3===r.length)&&("string"==typeof r[1]||"symbol"==typeof r[1])||4===r.length&&!0===r[3]?(n=s,o.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),o)}}function H(t,e,n){return Se(t)?t:Array.isArray(t)?$.array(t,{name:n}):y(t)?$.object(t,void 0,{name:n}):_(t)?$.map(t,{name:n}):m(t)?$.set(t,{name:n}):t}function U(t){return t}function X(t){p(t);var e=z(!0,(function(e,n,r,o,i){var a=r?r.initializer?r.initializer.call(e):r.value:void 0;un(e).addObservableProp(n,a,t)})),n=("undefined"!=typeof process&&process.env,e);return n.enhancer=t,n}var G={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function W(t){return null==t?G:"string"==typeof t?{name:t,deep:!0,proxy:!0}:t}Object.freeze(G);var Y=X(H),V=X((function(t,e,n){return null==t||fn(t)||Je(t)||nn(t)||an(t)?t:Array.isArray(t)?$.array(t,{name:n,deep:!1}):y(t)?$.object(t,void 0,{name:n,deep:!1}):_(t)?$.map(t,{name:n,deep:!1}):m(t)?$.set(t,{name:n,deep:!1}):c(!1)})),F=X(U),K=X((function(t,e,n){return _n(t,e)?e:t}));function q(t){return t.defaultDecorator?t.defaultDecorator.enhancer:!1===t.deep?U:H}var Z={box:function(t,e){arguments.length>2&&J("box");var n=W(e);return new Mt(t,q(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&J("array");var n=W(e);return function(t,e,n,r){void 0===n&&(n="ObservableArray@"+l());void 0===r&&(r=!1);var o=new Ke(n,e,r);!function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}(o.values,S,o);var i=new Proxy(o.values,Fe);if(o.proxy=i,t&&t.length){var a=wt(!0);o.spliceWithArray(0,0,t),St(a)}return i}(t,q(n),n.name)},map:function(t,e){arguments.length>2&&J("map");var n=W(e);return new en(t,q(n),n.name)},set:function(t,e){arguments.length>2&&J("set");var n=W(e);return new on(t,q(n),n.name)},object:function(t,e,n){"string"==typeof arguments[1]&&J("object");var r=W(n);if(!1===r.proxy)return pe({},t,e,r);var o=de(r),i=function(t){var e=new Proxy(t,He);return t[S].proxy=e,e}(pe({},void 0,void 0,r));return fe(i,t,e,o),i},ref:F,shallow:V,deep:Y,struct:K},$=function(t,e,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return Y.apply(null,arguments);if(Se(t))return t;var r=y(t)?$.object(t,e,n):Array.isArray(t)?$.array(t,e):_(t)?$.map(t,e):m(t)?$.set(t,e):t;if(r!==t)return r;c(!1)};function J(t){c("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}Object.keys(Z).forEach((function(t){return $[t]=Z[t]}));var Q,tt,et=z(!1,(function(t,e,n,r,o){var i=n.get,a=n.set,s=o[0]||{};un(t).addComputedProp(t,e,D({get:i,set:a,context:t},s))})),nt=et({equals:O.structural}),rt=function(t,e,n){if("string"==typeof e)return et.apply(null,arguments);if(null!==t&&"object"==typeof t&&1===arguments.length)return et.apply(null,arguments);var r="object"==typeof e?e:{};return r.get=t,r.set="function"==typeof e?e:r.set,r.name=r.name||t.name||"",new Tt(r)};rt.struct=nt,function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"}(Q||(Q={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(tt||(tt={}));var ot=function(t){this.cause=t};function it(t){return t instanceof ot}function at(t){switch(t.dependenciesState){case Q.UP_TO_DATE:return!1;case Q.NOT_TRACKING:case Q.STALE:return!0;case Q.POSSIBLY_STALE:for(var e=ft(!0),n=pt(),r=t.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(Ot(a)){if(kt.disableErrorBoundaries)a.get();else try{a.get()}catch(t){return dt(n),ht(e),!0}if(t.dependenciesState===Q.STALE)return dt(n),ht(e),!0}}return yt(t),dt(n),ht(e),!1}}function st(t){var e=t.observers.size>0;kt.computationDepth>0&&e&&c(!1),kt.allowStateChanges||!e&&"strict"!==kt.enforceActions||c(!1)}function ut(t,e,n){var r=ft(!0);yt(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++kt.runId;var o,i=kt.trackingDerivation;if(kt.trackingDerivation=t,!0===kt.disableErrorBoundaries)o=e.call(n);else try{o=e.call(n)}catch(t){o=new ot(t)}return kt.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,r=Q.UP_TO_DATE,o=0,i=t.unboundDepsCount,a=0;a<i;a++){0===(s=n[a]).diffValue&&(s.diffValue=1,o!==a&&(n[o]=s),o++),s.dependenciesState>r&&(r=s.dependenciesState)}n.length=o,t.newObserving=null,i=e.length;for(;i--;){0===(s=e[i]).diffValue&&Lt(s,t),s.diffValue=0}for(;o--;){var s;1===(s=n[o]).diffValue&&(s.diffValue=0,Rt(s,t))}r!==Q.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}(t),ht(r),o}function lt(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)Lt(e[n],t);t.dependenciesState=Q.NOT_TRACKING}function ct(t){var e=pt();try{return t()}finally{dt(e)}}function pt(){var t=kt.trackingDerivation;return kt.trackingDerivation=null,t}function dt(t){kt.trackingDerivation=t}function ft(t){var e=kt.allowStateReads;return kt.allowStateReads=t,e}function ht(t){kt.allowStateReads=t}function yt(t){if(t.dependenciesState!==Q.UP_TO_DATE){t.dependenciesState=Q.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Q.UP_TO_DATE}}var vt=0,gt=1,_t=Object.getOwnPropertyDescriptor((function(){}),"name");function mt(t,e,n){var r=function(){return bt(t,e,n||this,arguments)};return r.isMobxAction=!0,r}function bt(t,e,n,r){var o=Et();try{return e.apply(n,r)}catch(t){throw o.error=t,t}finally{xt(o)}}function Et(t,e,n){var r=pt();zt();var o={prevDerivation:r,prevAllowStateChanges:wt(!0),prevAllowStateReads:ft(!0),notifySpy:false,startTime:0,actionId:gt++,parentActionId:vt};return vt=o.actionId,o}function xt(t){vt!==t.actionId&&c("invalid action stack. did you forget to finish an action?"),vt=t.parentActionId,void 0!==t.error&&(kt.suppressReactionErrors=!0),St(t.prevAllowStateChanges),ht(t.prevAllowStateReads),Ht(),dt(t.prevDerivation),t.notifySpy,kt.suppressReactionErrors=!1}function wt(t){var e=kt.allowStateChanges;return kt.allowStateChanges=t,e}function St(t){kt.allowStateChanges=t}_t&&_t.configurable;var Mt=function(t){function e(e,n,r,o,i){void 0===r&&(r="ObservableValue@"+l()),void 0===o&&(o=!0),void 0===i&&(i=O.default);var a=t.call(this,r)||this;return a.enhancer=n,a.name=r,a.equals=i,a.hasUnreportedChange=!1,a.value=n(e,void 0,r),a}return function(t,e){function n(){this.constructor=t}N(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.prototype.set=function(t){this.value;if((t=this.prepareNewValue(t))!==kt.UNCHANGED){false,this.setNewValue(t)}},e.prototype.prepareNewValue=function(t){if(st(this),Ue(this)){var e=Ge(this,{object:this,type:"update",newValue:t});if(!e)return kt.UNCHANGED;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.equals(this.value,t)?kt.UNCHANGED:t},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),We(this)&&Ve(this,{type:"update",object:this,newValue:t,oldValue:e})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return Xe(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),Ye(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return x(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(M),At=g("ObservableValue",Mt),Tt=function(){function t(t){this.dependenciesState=Q.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Q.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+l(),this.value=new ot(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=tt.NONE,p(t.get,"missing option for computed: get"),this.derivation=t.get,this.name=t.name||"ComputedValue@"+l(),t.set&&(this.setter=mt(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?O.structural:O.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==Q.UP_TO_DATE)return;t.lowestObserverState=Q.POSSIBLY_STALE,t.observers.forEach((function(e){e.dependenciesState===Q.UP_TO_DATE&&(e.dependenciesState=Q.POSSIBLY_STALE,e.isTracing!==tt.NONE&&Xt(e,t),e.onBecomeStale())}))}(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.get=function(){this.isComputing&&c("Cycle detected in computation "+this.name+": "+this.derivation),0!==kt.inBatch||0!==this.observers.size||this.keepAlive?(Ut(this),at(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===Q.STALE)return;t.lowestObserverState=Q.STALE,t.observers.forEach((function(e){e.dependenciesState===Q.POSSIBLY_STALE?e.dependenciesState=Q.STALE:e.dependenciesState===Q.UP_TO_DATE&&(t.lowestObserverState=Q.UP_TO_DATE)}))}(this)):at(this)&&(this.warnAboutUntrackedRead(),zt(),this.value=this.computeValue(!1),Ht());var t=this.value;if(it(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(it(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){p(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,t)}finally{this.isRunningSetter=!1}}else p(!1,!1)},t.prototype.trackAndCompute=function(){var t=this.value,e=this.dependenciesState===Q.NOT_TRACKING,n=this.computeValue(!0),r=e||it(t)||it(n)||!this.equals(t,n);return r&&(this.value=n),r},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,kt.computationDepth++,t)e=ut(this,this.derivation,this.scope);else if(!0===kt.disableErrorBoundaries)e=this.derivation.call(this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new ot(t)}return kt.computationDepth--,this.isComputing=!1,e},t.prototype.suspend=function(){this.keepAlive||(lt(this),this.value=void 0)},t.prototype.observe=function(t,e){var n=this,r=!0,o=void 0;return re((function(){var i=n.get();if(!r||e){var a=pt();t({type:"update",object:n,newValue:i,oldValue:o}),dt(a)}r=!1,o=i}))},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return x(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),Ot=g("ComputedValue",Tt),Nt=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],Dt=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},Pt={};function Ct(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:Pt}var It=!0,jt=!1,kt=function(){var t=Ct();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(It=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new Dt).version&&(It=!1),It?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Dt):(setTimeout((function(){jt||c("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Dt)}();function Rt(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function Lt(t,e){t.observers.delete(e),0===t.observers.size&&Bt(t)}function Bt(t){!1===t.isPendingUnobservation&&(t.isPendingUnobservation=!0,kt.pendingUnobservations.push(t))}function zt(){kt.inBatch++}function Ht(){if(0==--kt.inBatch){Ft();for(var t=kt.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.size&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Tt&&n.suspend())}kt.pendingUnobservations=[]}}function Ut(t){var e=kt.trackingDerivation;return null!==e?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(0===t.observers.size&&kt.inBatch>0&&Bt(t),!1)}function Xt(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===tt.BREAK){var n=[];Gt(he(t),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(t instanceof Tt?t.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function Gt(t,e,n){e.length>=1e3?e.push("(and many more)"):(e.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return Gt(t,e,n+1)})))}var Wt=function(){function t(t,e,n,r){void 0===t&&(t="Reaction@"+l()),void 0===r&&(r=!1),this.name=t,this.onInvalidate=e,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=Q.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+l(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=tt.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,kt.pendingReactions.push(this),Ft())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(zt(),this._isScheduled=!1,at(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(t){this.reportExceptionInDerivation(t)}}Ht()}},t.prototype.track=function(t){if(!this.isDisposed){zt(),this._isRunning=!0;var e=ut(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&lt(this),it(e)&&this.reportExceptionInDerivation(e.cause),Ht()}},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{if(kt.disableErrorBoundaries)throw t;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";kt.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,t),kt.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(zt(),lt(this),Ht()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t[S]=this,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(t){void 0===t&&(t=!1),ke(this,t)},t}();var Yt=100,Vt=function(t){return t()};function Ft(){kt.inBatch>0||kt.isRunningReactions||Vt(Kt)}function Kt(){kt.isRunningReactions=!0;for(var t=kt.pendingReactions,e=0;t.length>0;){++e===Yt&&(console.error("Reaction doesn't converge to a stable state after "+Yt+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}kt.isRunningReactions=!1}var qt=g("Reaction",Wt);function Zt(t){var e=Vt;Vt=function(n){return t((function(){return e(n)}))}}function $t(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}function Jt(){c(!1)}function Qt(t){return function(e,n,r){if(r){if(r.value)return{value:mt(t,r.value),enumerable:!1,configurable:!0,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return mt(t,o.call(this))}}}return function(t){return function(e,n,r){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(e){v(this,n,te(t,e))}})}}(t).apply(this,arguments)}}var te=function(t,e,n,r){return 1===arguments.length&&"function"==typeof t?mt(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?mt(t,e):1===arguments.length&&"string"==typeof t?Qt(t):!0!==r?Qt(e).apply(null,arguments):void v(t,e,mt(t.name||e,n.value,this))};function ee(t,e){"string"==typeof t||t.name;return bt(0,"function"==typeof t?t:e,this,void 0)}function ne(t,e,n){v(t,e,mt(e,n.bind(t)))}function re(t,e){void 0===e&&(e=u);var n,r=e&&e.name||t.name||"Autorun@"+l();if(!e.scheduler&&!e.delay)n=new Wt(r,(function(){this.track(a)}),e.onError,e.requiresObservable);else{var o=ie(e),i=!1;n=new Wt(r,(function(){i||(i=!0,o((function(){i=!1,n.isDisposed||n.track(a)})))}),e.onError,e.requiresObservable)}function a(){t(n)}return n.schedule(),n.getDisposer()}te.bound=function(t,e,n,r){return!0===r?(ne(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return ne(this,e,n.value||n.initializer.call(this)),this[e]},set:Jt}:{enumerable:!1,configurable:!0,set:function(t){ne(this,e,t)},get:function(){}}};var oe=function(t){return t()};function ie(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:oe}function ae(t,e,n){void 0===n&&(n=u);var r,o,i,a=n.name||"Reaction@"+l(),s=te(a,n.onError?(r=n.onError,o=e,function(){try{return o.apply(this,arguments)}catch(t){r.call(this,t)}}):e),c=!n.scheduler&&!n.delay,p=ie(n),d=!0,f=!1,h=n.compareStructural?O.structural:n.equals||O.default,y=new Wt(a,(function(){d||c?v():f||(f=!0,p(v))}),n.onError,n.requiresObservable);function v(){if(f=!1,!y.isDisposed){var e=!1;y.track((function(){var n=t(y);e=d||!h(i,n),i=n})),d&&n.fireImmediately&&s(i,y),d||!0!==e||s(i,y),d&&(d=!1)}}return y.schedule(),y.getDisposer()}function se(t,e,n){return le("onBecomeObserved",t,e,n)}function ue(t,e,n){return le("onBecomeUnobserved",t,e,n)}function le(t,e,n,r){var o="function"==typeof r?hn(e,n):hn(e),i="function"==typeof r?r:n,a=t+"Listeners";return o[a]?o[a].add(i):o[a]=new Set([i]),"function"!=typeof o[t]?c(!1):function(){var t=o[a];t&&(t.delete(i),0===t.size&&delete o[a])}}function ce(t){var e=t.enforceActions,n=t.computedRequiresReaction,r=t.computedConfigurable,o=t.disableErrorBoundaries,i=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(!0===t.isolateGlobalState&&((kt.pendingReactions.length||kt.inBatch||kt.isRunningReactions)&&c("isolateGlobalState should be called before MobX is running any reactions"),jt=!0,It&&(0==--Ct().__mobxInstanceCount&&(Ct().__mobxGlobals=void 0),kt=new Dt)),void 0!==e){var u=void 0;switch(e){case!0:case"observed":u=!0;break;case!1:case"never":u=!1;break;case"strict":case"always":u="strict";break;default:c("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}kt.enforceActions=u,kt.allowStateChanges=!0!==u&&"strict"!==u}void 0!==n&&(kt.computedRequiresReaction=!!n),void 0!==a&&(kt.reactionRequiresObservable=!!a),void 0!==s&&(kt.observableRequiresReaction=!!s,kt.allowStateReads=!kt.observableRequiresReaction),void 0!==r&&(kt.computedConfigurable=!!r),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),kt.disableErrorBoundaries=!!o),i&&Zt(i)}function pe(t,e,n,r){var o=de(r=W(r));return B(t),un(t,r.name,o.enhancer),e&&fe(t,e,n,o),t}function de(t){return t.defaultDecorator||(!1===t.deep?F:Y)}function fe(t,e,n,r){var o,i;zt();try{var a=w(e);try{for(var s=P(a),u=s.next();!u.done;u=s.next()){var l=u.value,c=Object.getOwnPropertyDescriptor(e,l);0;var p=n&&l in n?n[l]:c.get?et:r;0;var d=p(t,l,c,!0);d&&Object.defineProperty(t,l,d)}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}finally{Ht()}}function he(t,e){return ye(hn(t,e))}function ye(t){var e,n,r={name:t.name};return t.observing&&t.observing.length>0&&(r.dependencies=(e=t.observing,n=[],e.forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n).map(ye)),r}function ve(t){var e={name:t.name};return function(t){return t.observers&&t.observers.size>0}(t)&&(e.observers=Array.from(function(t){return t.observers}(t)).map(ve)),e}var ge=0;function _e(){this.message="FLOW_CANCELLED"}function me(t){"function"==typeof t.cancel&&t.cancel()}function be(t,e){if(null==t)return!1;if(void 0!==e){if(!1===fn(t))return!1;if(!t[S].values.has(e))return!1;var n=hn(t,e);return Ot(n)}return Ot(t)}function Ee(t){return arguments.length>1?c(!1):be(t)}function xe(t,e){return"string"!=typeof e?c(!1):be(t,e)}function we(t,e){return null!=t&&(void 0!==e?!!fn(t)&&t[S].values.has(e):fn(t)||!!t[S]||A(t)||qt(t)||Ot(t))}function Se(t){return 1!==arguments.length&&c(!1),we(t)}function Me(t){return fn(t)?t[S].getKeys():nn(t)||an(t)?Array.from(t.keys()):Je(t)?t.map((function(t,e){return e})):c(!1)}function Ae(t){return fn(t)?Me(t).map((function(e){return t[e]})):nn(t)?Me(t).map((function(e){return t.get(e)})):an(t)?Array.from(t.values()):Je(t)?t.slice():c(!1)}function Te(t){return fn(t)?Me(t).map((function(e){return[e,t[e]]})):nn(t)?Me(t).map((function(e){return[e,t.get(e)]})):an(t)?Array.from(t.entries()):Je(t)?t.map((function(t,e){return[e,t]})):c(!1)}function Oe(t,e,n){if(2!==arguments.length||an(t))if(fn(t)){var r=t[S];r.values.get(e)?r.write(e,n):r.addObservableProp(e,n,r.defaultEnhancer)}else if(nn(t))t.set(e,n);else if(an(t))t.add(e);else{if(!Je(t))return c(!1);"number"!=typeof e&&(e=parseInt(e,10)),p(e>=0,"Not a valid index: '"+e+"'"),zt(),e>=t.length&&(t.length=e+1),t[e]=n,Ht()}else{zt();var o=e;try{for(var i in o)Oe(t,i,o[i])}finally{Ht()}}}function Ne(t,e){return fn(t)?yn(t).has(e):nn(t)||an(t)?t.has(e):Je(t)?e>=0&&e<t.length:c(!1)}function De(t,e,n,r){return"function"==typeof n?function(t,e,n,r){return yn(t,e).observe(n,r)}(t,e,n,r):function(t,e,n){return yn(t).observe(e,n)}(t,e,n)}_e.prototype=Object.create(Error.prototype);var Pe={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Ce(t,e,n,r){return r.detectCycles&&t.set(e,n),n}function Ie(t,e,n){if(!e.recurseEverything&&!Se(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(At(t))return Ie(t.get(),e,n);if(Se(t)&&Me(t),!0===e.detectCycles&&null!==t&&n.has(t))return n.get(t);if(Je(t)||Array.isArray(t)){var r=Ce(n,t,[],e),o=t.map((function(t){return Ie(t,e,n)}));r.length=o.length;for(var i=0,a=o.length;i<a;i++)r[i]=o[i];return r}if(an(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===e.exportMapsAsObjects){var s=Ce(n,t,new Set,e);return t.forEach((function(t){s.add(Ie(t,e,n))})),s}var u=Ce(n,t,[],e);return t.forEach((function(t){u.push(Ie(t,e,n))})),u}if(nn(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===e.exportMapsAsObjects){var l=Ce(n,t,new Map,e);return t.forEach((function(t,r){l.set(r,Ie(t,e,n))})),l}var c=Ce(n,t,{},e);return t.forEach((function(t,r){c[r]=Ie(t,e,n)})),c}var p=Ce(n,t,{},e);return b(t).forEach((function(r){p[r]=Ie(t[r],e,n)})),p}function je(t,e){var n;return"boolean"==typeof e&&(e={detectCycles:e}),e||(e=Pe),e.detectCycles=void 0===e.detectCycles?!0===e.recurseEverything:!0===e.detectCycles,e.detectCycles&&(n=new Map),Ie(t,e,n)}function ke(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;"boolean"==typeof t[t.length-1]&&(n=t.pop());var r=function(t){switch(t.length){case 0:return kt.trackingDerivation;case 1:return hn(t[0]);case 2:return hn(t[0],t[1])}}(t);if(!r)return c(!1);r.isTracing===tt.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?tt.BREAK:tt.LOG}function Re(t,e){void 0===e&&(e=void 0),zt();try{return t.apply(e)}finally{Ht()}}function Le(t,e,n){var r;"number"==typeof n.timeout&&(r=setTimeout((function(){if(!i[S].isDisposed){i();var t=new Error("WHEN_TIMEOUT");if(!n.onError)throw t;n.onError(t)}}),n.timeout)),n.name=n.name||"When@"+l();var o=mt(n.name+"-effect",e),i=re((function(e){t()&&(e.dispose(),r&&clearTimeout(r),o())}),n);return i}function Be(t){return t[S]}function ze(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t}var He={has:function(t,e){if(e===S||"constructor"===e||e===j)return!0;var n=Be(t);return ze(e)?n.has(e):e in t},get:function(t,e){if(e===S||"constructor"===e||e===j)return t[e];var n=Be(t),r=n.values.get(e);if(r instanceof M){var o=r.get();return void 0===o&&n.has(e),o}return ze(e)&&n.has(e),t[e]},set:function(t,e,n){return!!ze(e)&&(Oe(t,e,n),!0)},deleteProperty:function(t,e){return!!ze(e)&&(Be(t).remove(e),!0)},ownKeys:function(t){return Be(t).keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return c("Dynamic observable objects cannot be frozen"),!1}};function Ue(t){return void 0!==t.interceptors&&t.interceptors.length>0}function Xe(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),d((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Ge(t,e){var n=pt();try{for(var r=I(t.interceptors||[]),o=0,i=r.length;o<i&&(p(!(e=r[o](e))||e.type,"Intercept handlers should return nothing or a change object"),e);o++);return e}finally{dt(n)}}function We(t){return void 0!==t.changeListeners&&t.changeListeners.length>0}function Ye(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),d((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Ve(t,e){var n=pt(),r=t.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o<i;o++)r[o](e);dt(n)}}var Fe={get:function(t,e){return e===S?t[S]:"length"===e?t[S].getArrayLength():"number"==typeof e?qe.get.call(t,e):"string"!=typeof e||isNaN(e)?qe.hasOwnProperty(e)?qe[e]:t[e]:qe.get.call(t,parseInt(e))},set:function(t,e,n){return"length"===e&&t[S].setArrayLength(n),"number"==typeof e&&qe.set.call(t,e,n),"symbol"==typeof e||isNaN(e)?t[e]=n:qe.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return c("Observable arrays cannot be frozen"),!1}};var Ke=function(){function t(t,e,n){this.owned=n,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new M(t||"ObservableArray@"+l()),this.enhancer=function(n,r){return e(n,r,t+"[..]")}}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.dehanceValues=function(t){return void 0!==this.dehancer&&t.length>0?t.map(this.dehancer):t},t.prototype.intercept=function(t){return Xe(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Ye(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),r=0;r<t-e;r++)n[r]=void 0;this.spliceWithArray(e,0,n)}else this.spliceWithArray(t,e-t)},t.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=e},t.prototype.spliceWithArray=function(t,e,n){var r=this;st(this.atom);var o=this.values.length;if(void 0===t?t=0:t>o?t=o:t<0&&(t=Math.max(0,o+t)),e=1===arguments.length?o-t:null==e?0:Math.max(0,Math.min(e,o-t)),void 0===n&&(n=s),Ue(this)){var i=Ge(this,{object:this.proxy,type:"splice",index:t,removedCount:e,added:n});if(!i)return s;e=i.removedCount,n=i.added}n=0===n.length?n:n.map((function(t){return r.enhancer(t,void 0)}));var a=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,a),this.dehanceValues(a)},t.prototype.spliceItemsIntoValues=function(t,e,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,I([t,e],n));var o=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),o},t.prototype.notifyArrayChildUpdate=function(t,e,n){var r=!this.owned&&!1,o=We(this),i=o||r?{object:this.proxy,type:"update",index:t,newValue:e,oldValue:n}:null;this.atom.reportChanged(),o&&Ve(this,i)},t.prototype.notifyArraySplice=function(t,e,n){var r=!this.owned&&!1,o=We(this),i=o||r?{object:this.proxy,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;this.atom.reportChanged(),o&&Ve(this,i)},t}(),qe={intercept:function(t){return this[S].intercept(t)},observe:function(t,e){return void 0===e&&(e=!1),this[S].observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[S];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this[S];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray(t);case 2:return o.spliceWithArray(t,e)}return o.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){return this[S].spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[S];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[S].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[S];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[S],n=e.dehanceValues(e.values).indexOf(t);return n>-1&&(this.splice(n,1),!0)},get:function(t){var e=this[S];if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(t,e){var n=this[S],r=n.values;if(t<r.length){st(n.atom);var o=r[t];if(Ue(n)){var i=Ge(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!i)return;e=i.newValue}(e=n.enhancer(e,o))!==o&&(r[t]=e,n.notifyArrayChildUpdate(t,e,o))}else{if(t!==r.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length);n.spliceWithArray(t,0,[e])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(t){"function"==typeof Array.prototype[t]&&(qe[t]=function(){var e=this[S];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(t){"function"==typeof Array.prototype[t]&&(qe[t]=function(e,n){var r=this,o=this[S];return o.atom.reportObserved(),o.dehanceValues(o.values)[t]((function(t,o){return e.call(n,t,o,r)}),n)})})),["reduce","reduceRight"].forEach((function(t){qe[t]=function(){var e=this,n=this[S];n.atom.reportObserved();var r=arguments[0];return arguments[0]=function(t,o,i){return o=n.dehanceValue(o),r(t,o,i,e)},n.values[t].apply(n.values,arguments)}}));var Ze,$e=g("ObservableArrayAdministration",Ke);function Je(t){return h(t)&&$e(t[S])}var Qe,tn={},en=function(){function t(t,e,n){if(void 0===e&&(e=H),void 0===n&&(n="ObservableMap@"+l()),this.enhancer=e,this.name=n,this[Ze]=tn,this._keysAtom=T(this.name+".keys()"),this[Symbol.toStringTag]="Map","function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(t)}return t.prototype._has=function(t){return this._data.has(t)},t.prototype.has=function(t){var e=this;if(!kt.trackingDerivation)return this._has(t);var n=this._hasMap.get(t);if(!n){var r=n=new Mt(this._has(t),U,this.name+"."+E(t)+"?",!1);this._hasMap.set(t,r),ue(r,(function(){return e._hasMap.delete(t)}))}return n.get()},t.prototype.set=function(t,e){var n=this._has(t);if(Ue(this)){var r=Ge(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!r)return this;e=r.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if((st(this._keysAtom),Ue(this))&&!(r=Ge(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=We(this),r=n?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return Re((function(){e._keysAtom.reportChanged(),e._updateHasMapEntry(t,!1),e._data.get(t).setNewValue(void 0),e._data.delete(t)})),n&&Ve(this,r),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap.get(t);n&&n.setNewValue(e)},t.prototype._updateValue=function(t,e){var n=this._data.get(t);if((e=n.prepareNewValue(e))!==kt.UNCHANGED){var r=We(this),o=r?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;false,n.setNewValue(e),r&&Ve(this,o)}},t.prototype._addValue=function(t,e){var n=this;st(this._keysAtom),Re((function(){var r=new Mt(e,n.enhancer,n.name+"."+E(t),!1);n._data.set(t,r),e=r.value,n._updateHasMapEntry(t,!0),n._keysAtom.reportChanged()}));var r=We(this);r&&Ve(this,r?{type:"add",object:this,name:t,newValue:e}:null)},t.prototype.get=function(t){return this.has(t)?this.dehanceValue(this._data.get(t).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var t=this,e=this.keys();return xn({next:function(){var n=e.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:t.get(o)}}})},t.prototype.entries=function(){var t=this,e=this.keys();return xn({next:function(){var n=e.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:[o,t.get(o)]}}})},t.prototype[(Ze=S,Symbol.iterator)]=function(){return this.entries()},t.prototype.forEach=function(t,e){var n,r;try{for(var o=P(this),i=o.next();!i.done;i=o.next()){var a=C(i.value,2),s=a[0],u=a[1];t.call(e,u,s,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t.prototype.merge=function(t){var e=this;return nn(t)&&(t=t.toJS()),Re((function(){var n=wt(!0);try{y(t)?b(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=C(t,2),r=n[0],o=n[1];return e.set(r,o)})):_(t)?(t.constructor!==Map&&c("Cannot initialize from classes that inherit from Map: "+t.constructor.name),t.forEach((function(t,n){return e.set(n,t)}))):null!=t&&c("Cannot initialize map from "+t)}finally{St(n)}})),this},t.prototype.clear=function(){var t=this;Re((function(){ct((function(){var e,n;try{for(var r=P(t.keys()),o=r.next();!o.done;o=r.next()){var i=o.value;t.delete(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}))}))},t.prototype.replace=function(t){var e=this;return Re((function(){var n,r,o,i,a=function(t){if(_(t)||nn(t))return t;if(Array.isArray(t))return new Map(t);if(y(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}return c("Cannot convert to map from '"+t+"'")}(t),s=new Map,u=!1;try{for(var l=P(e._data.keys()),p=l.next();!p.done;p=l.next()){var d=p.value;if(!a.has(d))if(e.delete(d))u=!0;else{var f=e._data.get(d);s.set(d,f)}}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}try{for(var h=P(a.entries()),v=h.next();!v.done;v=h.next()){var g=C(v.value,2),m=(d=g[0],f=g[1],e._data.has(d));if(e.set(d,f),e._data.has(d)){var b=e._data.get(d);s.set(d,b),m||(u=!0)}}}catch(t){o={error:t}}finally{try{v&&!v.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}if(!u)if(e._data.size!==s.size)e._keysAtom.reportChanged();else for(var E=e._data.keys(),x=s.keys(),w=E.next(),S=x.next();!w.done;){if(w.value!==S.value){e._keysAtom.reportChanged();break}w=E.next(),S=x.next()}e._data=s})),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var t,e,n={};try{for(var r=P(this),o=r.next();!o.done;o=r.next()){var i=C(o.value,2),a=i[0],s=i[1];n["symbol"==typeof a?a:E(a)]=s}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var t=this;return this.name+"[{ "+Array.from(this.keys()).map((function(e){return E(e)+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return Xe(this,t)},t}(),nn=g("ObservableMap",en),rn={},on=function(){function t(t,e,n){if(void 0===e&&(e=H),void 0===n&&(n="ObservableSet@"+l()),this.name=n,this[Qe]=rn,this._data=new Set,this._atom=T(this.name),this[Symbol.toStringTag]="Set","function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(t,r){return e(t,r,n)},t&&this.replace(t)}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.clear=function(){var t=this;Re((function(){ct((function(){var e,n;try{for(var r=P(t._data.values()),o=r.next();!o.done;o=r.next()){var i=o.value;t.delete(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}))}))},t.prototype.forEach=function(t,e){var n,r;try{for(var o=P(this),i=o.next();!i.done;i=o.next()){var a=i.value;t.call(e,a,a,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this;if((st(this._atom),Ue(this))&&!(r=Ge(this,{type:"add",object:this,newValue:t})))return this;if(!this.has(t)){Re((function(){e._data.add(e.enhancer(t,void 0)),e._atom.reportChanged()}));var n=We(this),r=n?{type:"add",object:this,newValue:t}:null;n&&Ve(this,r)}return this},t.prototype.delete=function(t){var e=this;if(Ue(this)&&!(r=Ge(this,{type:"delete",object:this,oldValue:t})))return!1;if(this.has(t)){var n=We(this),r=n?{type:"delete",object:this,oldValue:t}:null;return Re((function(){e._atom.reportChanged(),e._data.delete(t)})),n&&Ve(this,r),!0}return!1},t.prototype.has=function(t){return this._atom.reportObserved(),this._data.has(this.dehanceValue(t))},t.prototype.entries=function(){var t=0,e=Array.from(this.keys()),n=Array.from(this.values());return xn({next:function(){var r=t;return t+=1,r<n.length?{value:[e[r],n[r]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var t=this,e=0,n=Array.from(this._data.values());return xn({next:function(){return e<n.length?{value:t.dehanceValue(n[e++]),done:!1}:{done:!0}}})},t.prototype.replace=function(t){var e=this;return an(t)&&(t=t.toJS()),Re((function(){var n=wt(!0);try{Array.isArray(t)||m(t)?(e.clear(),t.forEach((function(t){return e.add(t)}))):null!=t&&c("Cannot initialize set from "+t)}finally{St(n)}})),this},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return Xe(this,t)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[(Qe=S,Symbol.iterator)]=function(){return this.values()},t}(),an=g("ObservableSet",on),sn=function(){function t(t,e,n,r){void 0===e&&(e=new Map),this.target=t,this.values=e,this.name=n,this.defaultEnhancer=r,this.keysAtom=new M(n+".keys")}return t.prototype.read=function(t){return this.values.get(t).get()},t.prototype.write=function(t,e){var n=this.target,r=this.values.get(t);if(r instanceof Tt)r.set(e);else{if(Ue(this)){if(!(i=Ge(this,{type:"update",object:this.proxy||n,name:t,newValue:e})))return;e=i.newValue}if((e=r.prepareNewValue(e))!==kt.UNCHANGED){var o=We(this),i=o?{type:"update",object:this.proxy||n,oldValue:r.value,name:t,newValue:e}:null;false,r.setNewValue(e),o&&Ve(this,i)}}},t.prototype.has=function(t){var e=this.pendingKeys||(this.pendingKeys=new Map),n=e.get(t);if(n)return n.get();var r=!!this.values.get(t);return n=new Mt(r,U,this.name+"."+E(t)+"?",!1),e.set(t,n),n.get()},t.prototype.addObservableProp=function(t,e,n){void 0===n&&(n=this.defaultEnhancer);var r=this.target;if(Ue(this)){var o=Ge(this,{object:this.proxy||r,name:t,type:"add",newValue:e});if(!o)return;e=o.newValue}var i=new Mt(e,n,this.name+"."+E(t),!1);this.values.set(t,i),e=i.value,Object.defineProperty(r,t,function(t){return ln[t]||(ln[t]={configurable:!0,enumerable:!0,get:function(){return this[S].read(t)},set:function(e){this[S].write(t,e)}})}(t)),this.notifyPropertyAddition(t,e)},t.prototype.addComputedProp=function(t,e,n){var r=this.target;n.name=n.name||this.name+"."+E(e),this.values.set(e,new Tt(n)),(t===r||function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}(t,e))&&Object.defineProperty(t,e,function(t){return cn[t]||(cn[t]={configurable:kt.computedConfigurable,enumerable:!1,get:function(){return pn(this).read(t)},set:function(e){pn(this).write(t,e)}})}(e))},t.prototype.remove=function(t){if(this.values.has(t)){var e=this.target;if(Ue(this))if(!(s=Ge(this,{object:this.proxy||e,name:t,type:"remove"})))return;try{zt();var n=We(this),r=!1,o=this.values.get(t),i=o&&o.get();if(o&&o.set(void 0),this.keysAtom.reportChanged(),this.values.delete(t),this.pendingKeys){var a=this.pendingKeys.get(t);a&&a.set(!1)}delete this.target[t];var s=n?{type:"remove",object:this.proxy||e,oldValue:i,name:t}:null;r,n&&Ve(this,s)}finally{Ht()}}},t.prototype.illegalAccess=function(t,e){console.warn("Property '"+e+"' of '"+t+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return Xe(this,t)},t.prototype.notifyPropertyAddition=function(t,e){var n=We(this),r=n?{type:"add",object:this.proxy||this.target,name:t,newValue:e}:null;if(n&&Ve(this,r),this.pendingKeys){var o=this.pendingKeys.get(t);o&&o.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var t,e;this.keysAtom.reportObserved();var n=[];try{for(var r=P(this.values),o=r.next();!o.done;o=r.next()){var i=C(o.value,2),a=i[0];i[1]instanceof Mt&&n.push(a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t}();function un(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n=H),Object.prototype.hasOwnProperty.call(t,S))return t[S];y(t)||(e=(t.constructor.name||"ObservableObject")+"@"+l()),e||(e="ObservableObject@"+l());var r=new sn(t,new Map,E(e),n);return v(t,S,r),r}var ln=Object.create(null),cn=Object.create(null);function pn(t){var e=t[S];return e||(B(t),t[S])}var dn=g("ObservableObjectAdministration",sn);function fn(t){return!!h(t)&&(B(t),dn(t[S]))}function hn(t,e){if("object"==typeof t&&null!==t){if(Je(t))return void 0!==e&&c(!1),t[S].atom;if(an(t))return t[S];if(nn(t)){var n=t;return void 0===e?n._keysAtom:((r=n._data.get(e)||n._hasMap.get(e))||c(!1),r)}var r;if(B(t),e&&!t[S]&&t[e],fn(t))return e?((r=t[S].values.get(e))||c(!1),r):c(!1);if(A(t)||Ot(t)||qt(t))return t}else if("function"==typeof t&&qt(t[S]))return t[S];return c(!1)}function yn(t,e){return t||c("Expecting some object"),void 0!==e?yn(hn(t,e)):A(t)||Ot(t)||qt(t)||nn(t)||an(t)?t:(B(t),t[S]?t[S]:void c(!1))}function vn(t,e){return(void 0!==e?hn(t,e):fn(t)||nn(t)||an(t)?yn(t):hn(t)).name}var gn=Object.prototype.toString;function _n(t,e,n){return void 0===n&&(n=-1),mn(t,e,n)}function mn(t,e,n,r,o){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;if("function"!==i&&"object"!==i&&"object"!=typeof e)return!1;var a=gn.call(t);if(a!==gn.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++}t=bn(t),e=bn(e);var s="[object Array]"===a;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,l=e.constructor;if(u!==l&&!("function"==typeof u&&u instanceof u&&"function"==typeof l&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}if(0===n)return!1;n<0&&(n=-1),o=o||[];for(var c=(r=r||[]).length;c--;)if(r[c]===t)return o[c]===e;if(r.push(t),o.push(e),s){if((c=t.length)!==e.length)return!1;for(;c--;)if(!mn(t[c],e[c],n-1,r,o))return!1}else{var p=Object.keys(t),d=void 0;if(c=p.length,Object.keys(e).length!==c)return!1;for(;c--;)if(!En(e,d=p[c])||!mn(t[d],e[d],n-1,r,o))return!1}return r.pop(),o.pop(),!0}function bn(t){return Je(t)?t.slice():_(t)||nn(t)||m(t)||an(t)?Array.from(t.entries()):t}function En(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function xn(t){return t[Symbol.iterator]=wn,t}function wn(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:$t,extras:{getDebugName:vn},$mobx:S});var Sn=Object.freeze({__proto__:null,$mobx:S,FlowCancellationError:_e,get IDerivationState(){return Q},ObservableMap:en,ObservableSet:on,Reaction:Wt,_allowStateChanges:function(t,e){var n,r=wt(t);try{n=e()}finally{St(r)}return n},_allowStateChangesInsideComputed:function(t){var e,n=kt.computationDepth;kt.computationDepth=0;try{e=t()}finally{kt.computationDepth=n}return e},_allowStateReadsEnd:ht,_allowStateReadsStart:ft,_endAction:xt,_getAdministration:yn,_getGlobalState:function(){return kt},_interceptReads:function(t,e,n){var r;if(nn(t)||Je(t)||At(t))r=yn(t);else{if(!fn(t))return c(!1);if("string"!=typeof e)return c(!1);r=yn(t,e)}return void 0!==r.dehancer?c(!1):(r.dehancer="function"==typeof e?e:n,function(){r.dehancer=void 0})},_isComputingDerivation:function(){return null!==kt.trackingDerivation},_resetGlobalState:function(){var t=new Dt;for(var e in t)-1===Nt.indexOf(e)&&(kt[e]=t[e]);kt.allowStateChanges=!kt.enforceActions},_startAction:Et,action:te,autorun:re,comparer:O,computed:rt,configure:ce,createAtom:T,decorate:function(t,e){var n="function"==typeof t?t.prototype:t,r=function(t){var r=e[t];Array.isArray(r)||(r=[r]);var o=Object.getOwnPropertyDescriptor(n,t),i=r.reduce((function(e,r){return r(n,t,e)}),o);i&&Object.defineProperty(n,t,i)};for(var o in e)r(o);return t},entries:Te,extendObservable:pe,flow:function(t){1!==arguments.length&&c("Flow expects 1 argument and cannot be used as decorator");var e=t.name||"<unnamed flow>";return function(){var n,r=arguments,o=++ge,i=te(e+" - runid: "+o+" - init",t).apply(this,r),a=void 0,s=new Promise((function(t,r){var s=0;function u(t){var n;a=void 0;try{n=te(e+" - runid: "+o+" - yield "+s++,i.next).call(i,t)}catch(t){return r(t)}c(n)}function l(t){var n;a=void 0;try{n=te(e+" - runid: "+o+" - yield "+s++,i.throw).call(i,t)}catch(t){return r(t)}c(n)}function c(e){if(!e||"function"!=typeof e.then)return e.done?t(e.value):(a=Promise.resolve(e.value)).then(u,l);e.then(c,r)}n=r,u(void 0)}));return s.cancel=te(e+" - runid: "+o+" - cancel",(function(){try{a&&me(a);var t=i.return(void 0),e=Promise.resolve(t.value);e.then(f,f),me(e),n(new _e)}catch(t){n(t)}})),s}},get:function(t,e){if(Ne(t,e))return fn(t)?t[e]:nn(t)?t.get(e):Je(t)?t[e]:c(!1)},getAtom:hn,getDebugName:vn,getDependencyTree:he,getObserverTree:function(t,e){return ve(hn(t,e))},has:Ne,intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return yn(t,e).intercept(n)}(t,e,n):function(t,e){return yn(t).intercept(e)}(t,e)},isAction:function(t){return"function"==typeof t&&!0===t.isMobxAction},isArrayLike:function(t){return Array.isArray(t)||Je(t)},isBoxedObservable:At,isComputed:Ee,isComputedProp:xe,isFlowCancellationError:function(t){return t instanceof _e},isObservable:Se,isObservableArray:Je,isObservableMap:nn,isObservableObject:fn,isObservableProp:function(t,e){return"string"!=typeof e?c(!1):we(t,e)},isObservableSet:an,keys:Me,observable:$,observe:De,onBecomeObserved:se,onBecomeUnobserved:ue,onReactionError:function(t){return kt.globalReactionErrorHandlers.push(t),function(){var e=kt.globalReactionErrorHandlers.indexOf(t);e>=0&&kt.globalReactionErrorHandlers.splice(e,1)}},reaction:ae,remove:function(t,e){if(fn(t))t[S].remove(e);else if(nn(t))t.delete(e);else if(an(t))t.delete(e);else{if(!Je(t))return c(!1);"number"!=typeof e&&(e=parseInt(e,10)),p(e>=0,"Not a valid index: '"+e+"'"),t.splice(e,1)}},runInAction:ee,set:Oe,spy:$t,toJS:je,trace:ke,transaction:Re,untracked:ct,values:Ae,when:function(t,e,n){return 1===arguments.length||e&&"object"==typeof e?function(t,e){var n,r=new Promise((function(r,o){var i=Le(t,r,D(D({},e),{onError:o}));n=function(){i(),o("WHEN_CANCELLED")}}));return r.cancel=n,r}(t,e):Le(t,e,n||{})}}),Mn=n(Sn);!function(t,n){!function(t,n,r){function o(t){return!(t.prototype&&t.prototype.render||n.Component.isPrototypeOf(t))}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.prefix,r=void 0===n?"":n,o=e.suffix,i=void 0===o?"":o;return r+(t.displayName||t.name||t.constructor&&t.constructor.name||"<component>")+i}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},c=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},p=!1,d=console;function f(t){p=t}function h(t){var e=r._getGlobalState().allowStateChanges;return r._getGlobalState().allowStateChanges=t,e}function y(t){r._getGlobalState().allowStateChanges=t}function v(t,e,n,r,o){var i=h(t),a=void 0;try{a=e(n,r,o)}finally{y(i)}return a}function g(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t[e],o=m[e],i=r?!0===n?function(){o.apply(this,arguments),r.apply(this,arguments)}:function(){r.apply(this,arguments),o.apply(this,arguments)}:o;t[e]=i}function _(t,e){if(null==t||null==e||"object"!==(void 0===t?"undefined":a(t))||"object"!==(void 0===e?"undefined":a(e)))return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var r=void 0,o=n.length-1;r=n[o];o--)if(e[r]!==t[r])return!0;return!1}var m={componentWillMount:function(){var t=this;if(!0!==p){var e=i(this),o=!1,a=!1;f.call(this,"props"),f.call(this,"state");var s=this.render.bind(this),u=null,l=!1,c=function(){return(u=new r.Reaction(e+".render()",(function(){if(!l&&(l=!0,"function"==typeof t.componentWillReact&&t.componentWillReact(),!0!==t.__$mobxIsUnmounted)){var e=!0;try{a=!0,o||n.Component.prototype.forceUpdate.call(t),e=!1}finally{a=!1,e&&u.dispose()}}}))).reactComponent=t,d.$mobx=u,t.render=d,d(t.props,t.state,t.context)},d=function(t,e,n){l=!1;var r=void 0,o=void 0;if(u.track((function(){try{o=v(!1,s,t,e,n)}catch(t){r=t}})),r)throw r;return o};this.render=c}function f(t){var e=this[t],n=r.createAtom("reactive "+t);Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:function(){return n.reportObserved(),e},set:function(t){!a&&_(e,t)?(e=t,o=!0,n.reportChanged(),o=!1):e=t}})}},componentWillUnmount:function(){!0!==p&&(this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0)},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(t,e){return p&&d.warn("[mobx-preact] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==e||_(this.props,t)}};function b(t){var e,r;if(arguments.length>1&&d.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),!0===t.isMobxInjector&&d.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),o(t))return b((r=e=function(e){function n(){return s(this,n),c(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return l(n,e),u(n,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),n}(n.Component),e.displayName=i(t),r));if(!t)throw new Error("Please pass a valid component to 'observer'");return E(t.prototype||t),t.isMobXReactObserver=!0,t}function E(t){g(t,"componentWillMount",!0),g(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=m.shouldComponentUpdate)}var x=b((function(t){return t.children[0]()}));function w(t,e){return t(e={exports:{}},e.exports),e.exports}x.displayName="Observer","undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;var S=w((function(t,e){!function(e,n){t.exports=n()}(0,(function(){var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n=Object.defineProperty,r=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,i=Object.getOwnPropertyDescriptor,a=Object.getPrototypeOf,s=a&&a(Object);return function u(l,c,p){if("string"!=typeof c){if(s){var d=a(c);d&&d!==s&&u(l,d,p)}var f=r(c);o&&(f=f.concat(o(c)));for(var h=0;h<f.length;++h){var y=f[h];if(!(t[y]||e[y]||p&&p[y])){var v=i(c,y);try{n(l,y,v)}catch(t){}}}return l}return l}}))})),M={isMobxInjector:{value:!0,writable:!0,configurable:!0,enumerable:!0}};function A(t,e,r){var o,a,p=i(e,{prefix:"inject-",suffix:r?"-with-"+r:""}),d=(a=o=function(r){function o(){return s(this,o),c(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return l(o,r),u(o,[{key:"render",value:function(){var r={};for(var o in this.props)this.props.hasOwnProperty(o)&&(r[o]=this.props[o]);var i=t(this.context.mobxStores||{},r,this.context)||{};for(var a in i)r[a]=i[a];return n.h(e,r)}}]),o}(n.Component),o.displayName=p,a);return S(d,e),d.wrappedComponent=e,Object.defineProperties(d,M),d}function T(t){return function(e,n){return t.forEach((function(t){if(!(t in n)){if(!(t in e))throw new Error("MobX injector: Store '"+t+"' is not available! Make sure it is provided by some Provider");n[t]=e[t]}})),n}}function O(){var t=void 0;if("function"==typeof arguments[0])return t=arguments[0],function(e){var n=A(t,e);return n.isMobxInjector=!1,(n=b(n)).isMobxInjector=!0,n};for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t=T(e),function(n){return A(t,n,e.join("-"))}}function N(t,e){if("string"==typeof t)throw new Error("Store names should be provided as array");return Array.isArray(t)?e?O.apply(null,t)(N(e)):function(e){return N(t,e)}:b(t)}var D={children:!0,key:!0,ref:!0},P=console,C=function(t){function e(){return s(this,e),c(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return l(e,t),u(e,[{key:"render",value:function(t){var e=t.children;return e.length>1?n.h("div",null," ",e," "):e[0]}},{key:"getChildContext",value:function(){var t={},e=this.context.mobxStores;if(e)for(var n in e)t[n]=e[n];for(var r in this.props)D[r]||"suppressChangedStoreWarning"===r||(t[r]=this.props[r]);return{mobxStores:t}}},{key:"componentWillReceiveProps",value:function(t){if(Object.keys(t).length!==Object.keys(this.props).length&&P.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!t.suppressChangedStoreWarning)for(var e in t)D[e]||this.props[e]===t[e]||P.warn("MobX Provider: Provided store '"+e+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e}(n.Component);if(!n.Component)throw new Error("mobx-preact requires Preact to be available");t.observer=b,t.Observer=x,t.useStaticRendering=f,t.connect=N,t.inject=O,t.Provider=C,Object.defineProperty(t,"__esModule",{value:!0})}(n,function(){if(r)return i;r=1;var t,e,n,o,a,s,u,l,c,p,d,f,h={},y=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function _(t,e){for(var n in e)t[n]=e[n];return t}function m(t){var e=t.parentNode;e&&e.removeChild(t)}function b(e,n,r){var o,i,a,s={};for(a in n)"key"==a?o=n[a]:"ref"==a?i=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return E(e,s,o,i,null)}function E(t,r,o,i,a){var s={type:t,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++n:a,__i:-1,__u:0};return null==a&&null!=e.vnode&&e.vnode(s),s}function x(t){return t.children}function w(t,e){this.props=t,this.context=e}function S(t,e){if(null==e)return t.__?S(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?S(t):null}function M(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return M(t)}}function A(t){(!t.__d&&(t.__d=!0)&&a.push(t)&&!T.__r++||s!==e.debounceRendering)&&((s=e.debounceRendering)||u)(T)}function T(){var t,n,r,o,i,s,u,c;for(a.sort(l);t=a.shift();)t.__d&&(n=a.length,o=void 0,s=(i=(r=t).__v).__e,u=[],c=[],r.__P&&((o=_({},i)).__v=i.__v+1,e.vnode&&e.vnode(o),k(r.__P,o,i,r.__n,r.__P.namespaceURI,32&i.__u?[s]:null,u,null==s?S(i):s,!!(32&i.__u),c),o.__v=i.__v,o.__.__k[o.__i]=o,R(u,o,c),o.__e!=s&&M(o)),a.length>n&&a.sort(l));T.__r=0}function O(t,e,n,r,o,i,a,s,u,l,c){var p,d,f,v,g,_=r&&r.__k||y,m=e.length;for(n.__d=u,N(n,e,_),u=n.__d,p=0;p<m;p++)null!=(f=n.__k[p])&&"boolean"!=typeof f&&"function"!=typeof f&&(d=-1===f.__i?h:_[f.__i]||h,f.__i=p,k(t,f,d,o,i,a,s,u,l,c),v=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&B(d.ref,null,f),c.push(f.ref,f.__c||v,f)),null==g&&null!=v&&(g=v),65536&f.__u||d.__k===f.__k?(u&&!u.isConnected&&(u=S(d)),u=D(f,u,t)):"function"==typeof f.type&&void 0!==f.__d?u=f.__d:v&&(u=v.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=u,n.__e=g}function N(t,e,n){var r,o,i,a,s,u=e.length,l=n.length,c=l,p=0;for(t.__k=[],r=0;r<u;r++)a=r+p,null!=(o=t.__k[r]=null==(o=e[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?E(null,o,null,null,null):g(o)?E(x,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?E(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=t,o.__b=t.__b+1,s=P(o,n,a,c),o.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&p--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?p++:s>a?c>u-a?p+=s-a:p--:s<a?s==a-1&&(p=s-a):p=0,s!==r+p&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=S(i)),z(i,i,!1),n[a]=null,c--);if(c)for(r=0;r<l;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=S(i)),z(i,i))}function D(t,e,n){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=D(r[o],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function P(t,e,n,r){var o=t.key,i=t.type,a=n-1,s=n+1,u=e[n];if(null===u||u&&o==u.key&&i===u.type&&0==(131072&u.__u))return n;if(r>(null!=u&&0==(131072&u.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((u=e[a])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return a;a--}if(s<e.length){if((u=e[s])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return s;s++}}return-1}function C(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||v.test(e)?n:n+"px"}function I(t,e,n,r,o){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||C(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||C(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])i=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.t=r.t:(n.t=c,t.addEventListener(e,i?d:p,i)):t.removeEventListener(e,i?d:p,i);else{if("http://www.w3.org/2000/svg"==o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function j(t){return function(n){if(this.l){var r=this.l[n.type+t];if(null==n.u)n.u=c++;else if(n.u<r.t)return;return r(e.event?e.event(n):n)}}}function k(t,n,r,o,i,a,s,u,l,c){var p,d,f,h,y,v,m,b,E,S,M,A,T,N,D,P=n.type;if(void 0!==n.constructor)return null;128&r.__u&&(l=!!(32&r.__u),a=[u=n.__e=r.__e]),(p=e.__b)&&p(n);t:if("function"==typeof P)try{if(b=n.props,E=(p=P.contextType)&&o[p.__c],S=p?E?E.props.value:p.__:o,r.__c?m=(d=n.__c=r.__c).__=d.__E:("prototype"in P&&P.prototype.render?n.__c=d=new P(b,S):(n.__c=d=new w(b,S),d.constructor=P,d.render=H),E&&E.sub(d),d.props=b,d.state||(d.state={}),d.context=S,d.__n=o,f=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=P.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=_({},d.__s)),_(d.__s,P.getDerivedStateFromProps(b,d.__s))),h=d.props,y=d.state,d.__v=n,f)null==P.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==P.getDerivedStateFromProps&&b!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(b,S),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(b,d.__s,S)||n.__v===r.__v)){for(n.__v!==r.__v&&(d.props=b,d.state=d.__s,d.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.forEach((function(t){t&&(t.__=n)})),M=0;M<d._sb.length;M++)d.__h.push(d._sb[M]);d._sb=[],d.__h.length&&s.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(b,d.__s,S),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(h,y,v)}))}if(d.context=S,d.props=b,d.__P=t,d.__e=!1,A=e.__r,T=0,"prototype"in P&&P.prototype.render){for(d.state=d.__s,d.__d=!1,A&&A(n),p=d.render(d.props,d.state,d.context),N=0;N<d._sb.length;N++)d.__h.push(d._sb[N]);d._sb=[]}else do{d.__d=!1,A&&A(n),p=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++T<25);d.state=d.__s,null!=d.getChildContext&&(o=_(_({},o),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(v=d.getSnapshotBeforeUpdate(h,y)),O(t,g(D=null!=p&&p.type===x&&null==p.key?p.props.children:p)?D:[D],n,r,o,i,a,s,u,l,c),d.base=n.__e,n.__u&=-161,d.__h.length&&s.push(d),m&&(d.__E=d.__=null)}catch(t){n.__v=null,l||null!=a?(n.__e=u,n.__u|=l?160:32,a[a.indexOf(u)]=null):(n.__e=r.__e,n.__k=r.__k),e.__e(t,n,r)}else null==a&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=L(r.__e,n,r,o,i,a,s,l,c);(p=e.diffed)&&p(n)}function R(t,n,r){n.__d=void 0;for(var o=0;o<r.length;o++)B(r[o],r[++o],r[++o]);e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function L(e,n,r,o,i,a,s,u,l){var c,p,d,f,y,v,_,b=r.props,E=n.props,x=n.type;if("svg"===x?i="http://www.w3.org/2000/svg":"math"===x?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(c=0;c<a.length;c++)if((y=a[c])&&"setAttribute"in y==!!x&&(x?y.localName===x:3===y.nodeType)){e=y,a[c]=null;break}if(null==e){if(null===x)return document.createTextNode(E);e=document.createElementNS(i,x,E.is&&E),a=null,u=!1}if(null===x)b===E||u&&e.data===E||(e.data=E);else{if(a=a&&t.call(e.childNodes),b=r.props||h,!u&&null!=a)for(b={},c=0;c<e.attributes.length;c++)b[(y=e.attributes[c]).name]=y.value;for(c in b)if(y=b[c],"children"==c);else if("dangerouslySetInnerHTML"==c)d=y;else if("key"!==c&&!(c in E)){if("value"==c&&"defaultValue"in E||"checked"==c&&"defaultChecked"in E)continue;I(e,c,null,y,i)}for(c in E)y=E[c],"children"==c?f=y:"dangerouslySetInnerHTML"==c?p=y:"value"==c?v=y:"checked"==c?_=y:"key"===c||u&&"function"!=typeof y||b[c]===y||I(e,c,y,b[c],i);if(p)u||d&&(p.__html===d.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),n.__k=[];else if(d&&(e.innerHTML=""),O(e,g(f)?f:[f],n,r,o,"foreignObject"===x?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:r.__k&&S(r,0),u,l),null!=a)for(c=a.length;c--;)null!=a[c]&&m(a[c]);u||(c="value",void 0!==v&&(v!==e[c]||"progress"===x&&!v||"option"===x&&v!==b[c])&&I(e,c,v,b[c],i),c="checked",void 0!==_&&_!==e[c]&&I(e,c,_,b[c],i))}return e}function B(t,n,r){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,r)}}function z(t,n,r){var o,i;if(e.unmount&&e.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||B(o,null,n)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){e.__e(t,n)}o.base=o.__P=null}if(o=t.__k)for(i=0;i<o.length;i++)o[i]&&z(o[i],n,r||"function"!=typeof t.type);r||null==t.__e||m(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function H(t,e,n){return this.constructor(t,n)}function U(n,r,o){var i,a,s,u;e.__&&e.__(n,r),a=(i="function"==typeof o)?null:o&&o.__k||r.__k,s=[],u=[],k(r,n=(!i&&o||r).__k=b(x,null,[n]),a||h,h,r.namespaceURI,!i&&o?[o]:a?null:r.firstChild?t.call(r.childNodes):null,s,!i&&o?o:a?a.__e:r.firstChild,i,u),R(s,n,u)}return t=y.slice,e={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},n=0,o=function(t){return null!=t&&null==t.constructor},w.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof t&&(t=t(_({},n),this.props)),t&&_(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),A(this))},w.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),A(this))},w.prototype.render=x,a=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(t,e){return t.__v.__b-e.__v.__b},T.__r=0,c=0,p=j(!1),d=j(!0),f=0,i.Component=w,i.Fragment=x,i.cloneElement=function(e,n,r){var o,i,a,s,u=_({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)"key"==a?o=n[a]:"ref"==a?i=n[a]:u[a]=void 0===n[a]&&void 0!==s?s[a]:n[a];return arguments.length>2&&(u.children=arguments.length>3?t.call(arguments,2):r),E(e.type,u,o||e.key,i||e.ref,null)},i.createContext=function(t,e){var n={__c:e="__cC"+f++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,r;return this.getChildContext||(n=[],(r={})[e]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,A(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n},i.createElement=b,i.createRef=function(){return{current:null}},i.h=b,i.hydrate=function t(e,n){U(e,n,t)},i.isValidElement=o,i.options=e,i.render=U,i.toChildArray=function t(e,n){return n=n||[],null==e||"boolean"==typeof e||(g(e)?e.some((function(e){t(e,n)})):n.push(e)),n},i}(),Mn)}(0,o);var An,Tn,On,Nn,Dn,Pn,Cn,In,jn,kn,Rn={},Ln=[],Bn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zn=Array.isArray;function Hn(t,e){for(var n in e)t[n]=e[n];return t}function Un(t){var e=t.parentNode;e&&e.removeChild(t)}function Xn(t,e,n){var r,o,i,a={};for(i in e)"key"==i?r=e[i]:"ref"==i?o=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?An.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===a[i]&&(a[i]=t.defaultProps[i]);return Gn(t,a,r,o,null)}function Gn(t,e,n,r,o){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++On:o,__i:-1,__u:0};return null==o&&null!=Tn.vnode&&Tn.vnode(i),i}function Wn(){return{current:null}}function Yn(t){return t.children}function Vn(t,e){this.props=t,this.context=e}function Fn(t,e){if(null==e)return t.__?Fn(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?Fn(t):null}function Kn(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return Kn(t)}}function qn(t){(!t.__d&&(t.__d=!0)&&Nn.push(t)&&!Zn.__r++||Dn!==Tn.debounceRendering)&&((Dn=Tn.debounceRendering)||Pn)(Zn)}function Zn(){var t,e,n,r,o,i,a,s;for(Nn.sort(Cn);t=Nn.shift();)t.__d&&(e=Nn.length,r=void 0,i=(o=(n=t).__v).__e,a=[],s=[],n.__P&&((r=Hn({},o)).__v=o.__v+1,Tn.vnode&&Tn.vnode(r),ir(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,a,null==i?Fn(o):i,!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,ar(a,r,s),r.__e!=i&&Kn(r)),Nn.length>e&&Nn.sort(Cn));Zn.__r=0}function $n(t,e,n,r,o,i,a,s,u,l,c){var p,d,f,h,y,v=r&&r.__k||Ln,g=e.length;for(n.__d=u,Jn(n,e,v),u=n.__d,p=0;p<g;p++)null!=(f=n.__k[p])&&"boolean"!=typeof f&&"function"!=typeof f&&(d=-1===f.__i?Rn:v[f.__i]||Rn,f.__i=p,ir(t,f,d,o,i,a,s,u,l,c),h=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&ur(d.ref,null,f),c.push(f.ref,f.__c||h,f)),null==y&&null!=h&&(y=h),65536&f.__u||d.__k===f.__k?(u&&!u.isConnected&&(u=Fn(d)),u=Qn(f,u,t)):"function"==typeof f.type&&void 0!==f.__d?u=f.__d:h&&(u=h.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=u,n.__e=y}function Jn(t,e,n){var r,o,i,a,s,u=e.length,l=n.length,c=l,p=0;for(t.__k=[],r=0;r<u;r++)a=r+p,null!=(o=t.__k[r]=null==(o=e[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?Gn(null,o,null,null,null):zn(o)?Gn(Yn,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?Gn(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=t,o.__b=t.__b+1,s=er(o,n,a,c),o.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&p--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?p++:s>a?c>u-a?p+=s-a:p--:s<a?s==a-1&&(p=s-a):p=0,s!==r+p&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=Fn(i)),lr(i,i,!1),n[a]=null,c--);if(c)for(r=0;r<l;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=Fn(i)),lr(i,i))}function Qn(t,e,n){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=Qn(r[o],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function tr(t,e){return e=e||[],null==t||"boolean"==typeof t||(zn(t)?t.some((function(t){tr(t,e)})):e.push(t)),e}function er(t,e,n,r){var o=t.key,i=t.type,a=n-1,s=n+1,u=e[n];if(null===u||u&&o==u.key&&i===u.type&&0==(131072&u.__u))return n;if(r>(null!=u&&0==(131072&u.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((u=e[a])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return a;a--}if(s<e.length){if((u=e[s])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return s;s++}}return-1}function nr(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||Bn.test(e)?n:n+"px"}function rr(t,e,n,r,o){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||nr(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||nr(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])i=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=In,t.addEventListener(e,i?kn:jn,i)):t.removeEventListener(e,i?kn:jn,i);else{if("http://www.w3.org/2000/svg"==o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function or(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e.t)e.t=In++;else if(e.t<n.u)return;return n(Tn.event?Tn.event(e):e)}}}function ir(t,e,n,r,o,i,a,s,u,l){var c,p,d,f,h,y,v,g,_,m,b,E,x,w,S,M=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=e.__e=n.__e]),(c=Tn.__b)&&c(e);t:if("function"==typeof M)try{if(g=e.props,_=(c=M.contextType)&&r[c.__c],m=c?_?_.props.value:c.__:r,n.__c?v=(p=e.__c=n.__c).__=p.__E:("prototype"in M&&M.prototype.render?e.__c=p=new M(g,m):(e.__c=p=new Vn(g,m),p.constructor=M,p.render=cr),_&&_.sub(p),p.props=g,p.state||(p.state={}),p.context=m,p.__n=r,d=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=M.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=Hn({},p.__s)),Hn(p.__s,M.getDerivedStateFromProps(g,p.__s))),f=p.props,h=p.state,p.__v=e,d)null==M.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==M.getDerivedStateFromProps&&g!==f&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(g,m),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(g,p.__s,m)||e.__v===n.__v)){for(e.__v!==n.__v&&(p.props=g,p.state=p.__s,p.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),b=0;b<p._sb.length;b++)p.__h.push(p._sb[b]);p._sb=[],p.__h.length&&a.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(g,p.__s,m),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(f,h,y)}))}if(p.context=m,p.props=g,p.__P=t,p.__e=!1,E=Tn.__r,x=0,"prototype"in M&&M.prototype.render){for(p.state=p.__s,p.__d=!1,E&&E(e),c=p.render(p.props,p.state,p.context),w=0;w<p._sb.length;w++)p.__h.push(p._sb[w]);p._sb=[]}else do{p.__d=!1,E&&E(e),c=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++x<25);p.state=p.__s,null!=p.getChildContext&&(r=Hn(Hn({},r),p.getChildContext())),d||null==p.getSnapshotBeforeUpdate||(y=p.getSnapshotBeforeUpdate(f,h)),$n(t,zn(S=null!=c&&c.type===Yn&&null==c.key?c.props.children:c)?S:[S],e,n,r,o,i,a,s,u,l),p.base=e.__e,e.__u&=-161,p.__h.length&&a.push(p),v&&(p.__E=p.__=null)}catch(t){e.__v=null,u||null!=i?(e.__e=s,e.__u|=u?160:32,i[i.indexOf(s)]=null):(e.__e=n.__e,e.__k=n.__k),Tn.__e(t,e,n)}else null==i&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=sr(n.__e,e,n,r,o,i,a,u,l);(c=Tn.diffed)&&c(e)}function ar(t,e,n){e.__d=void 0;for(var r=0;r<n.length;r++)ur(n[r],n[++r],n[++r]);Tn.__c&&Tn.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Tn.__e(t,e.__v)}}))}function sr(t,e,n,r,o,i,a,s,u){var l,c,p,d,f,h,y,v=n.props,g=e.props,_=e.type;if("svg"===_?o="http://www.w3.org/2000/svg":"math"===_?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=i)for(l=0;l<i.length;l++)if((f=i[l])&&"setAttribute"in f==!!_&&(_?f.localName===_:3===f.nodeType)){t=f,i[l]=null;break}if(null==t){if(null===_)return document.createTextNode(g);t=document.createElementNS(o,_,g.is&&g),i=null,s=!1}if(null===_)v===g||s&&t.data===g||(t.data=g);else{if(i=i&&An.call(t.childNodes),v=n.props||Rn,!s&&null!=i)for(v={},l=0;l<t.attributes.length;l++)v[(f=t.attributes[l]).name]=f.value;for(l in v)if(f=v[l],"children"==l);else if("dangerouslySetInnerHTML"==l)p=f;else if("key"!==l&&!(l in g)){if("value"==l&&"defaultValue"in g||"checked"==l&&"defaultChecked"in g)continue;rr(t,l,null,f,o)}for(l in g)f=g[l],"children"==l?d=f:"dangerouslySetInnerHTML"==l?c=f:"value"==l?h=f:"checked"==l?y=f:"key"===l||s&&"function"!=typeof f||v[l]===f||rr(t,l,f,v[l],o);if(c)s||p&&(c.__html===p.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(p&&(t.innerHTML=""),$n(t,zn(d)?d:[d],e,n,r,"foreignObject"===_?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&Fn(n,0),s,u),null!=i)for(l=i.length;l--;)null!=i[l]&&Un(i[l]);s||(l="value",void 0!==h&&(h!==t[l]||"progress"===_&&!h||"option"===_&&h!==v[l])&&rr(t,l,h,v[l],o),l="checked",void 0!==y&&y!==t[l]&&rr(t,l,y,v[l],o))}return t}function ur(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){Tn.__e(t,n)}}function lr(t,e,n){var r,o;if(Tn.unmount&&Tn.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||ur(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Tn.__e(t,e)}r.base=r.__P=null}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&lr(r[o],e,n||"function"!=typeof t.type);n||null==t.__e||Un(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function cr(t,e,n){return this.constructor(t,n)}function pr(t,e,n){var r,o,i,a;Tn.__&&Tn.__(t,e),o=(r="function"==typeof n)?null:n&&n.__k||e.__k,i=[],a=[],ir(e,t=(!r&&n||e).__k=Xn(Yn,null,[t]),o||Rn,Rn,e.namespaceURI,!r&&n?[n]:o?null:e.firstChild?An.call(e.childNodes):null,i,!r&&n?n:o?o.__e:e.firstChild,r,a),ar(i,t,a)}An=Ln.slice,Tn={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},On=0,Vn.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Hn({},this.state),"function"==typeof t&&(t=t(Hn({},n),this.props)),t&&Hn(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),qn(this))},Vn.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),qn(this))},Vn.prototype.render=Yn,Nn=[],Pn="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Cn=function(t,e){return t.__v.__b-e.__v.__b},Zn.__r=0,In=0,jn=or(!1),kn=or(!0);var dr,fr,hr,yr=[],vr=[],gr=Tn,_r=gr.__b,mr=gr.__r,br=gr.diffed,Er=gr.__c,xr=gr.unmount,wr=gr.__;function Sr(){for(var t;t=yr.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Tr),t.__H.__h.forEach(Or),t.__H.__h=[]}catch(e){t.__H.__h=[],gr.__e(e,t.__v)}}gr.__b=function(t){dr=null,_r&&_r(t)},gr.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),wr&&wr(t,e)},gr.__r=function(t){mr&&mr(t);var e=(dr=t.__c).__H;e&&(fr===dr?(e.__h=[],dr.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=vr,t.__N=t.i=void 0}))):(e.__h.forEach(Tr),e.__h.forEach(Or),e.__h=[])),fr=dr},gr.diffed=function(t){br&&br(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==yr.push(e)&&hr===gr.requestAnimationFrame||((hr=gr.requestAnimationFrame)||Ar)(Sr)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==vr&&(t.__=t.__V),t.i=void 0,t.__V=vr}))),fr=dr=null},gr.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Tr),t.__h=t.__h.filter((function(t){return!t.__||Or(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],gr.__e(n,t.__v)}})),Er&&Er(t,e)},gr.unmount=function(t){xr&&xr(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{Tr(t)}catch(t){e=t}})),n.__H=void 0,e&&gr.__e(e,n.__v))};var Mr="function"==typeof requestAnimationFrame;function Ar(t){var e,n=function(){clearTimeout(r),Mr&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);Mr&&(e=requestAnimationFrame(n))}function Tr(t){var e=dr,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),dr=e}function Or(t){var e=dr;t.__c=t.__(),dr=e}function Nr(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var r in e)if("__source"!==r&&t[r]!==e[r])return!0;return!1}function Dr(t,e){this.props=t,this.context=e}(Dr.prototype=new Vn).isPureReactComponent=!0,Dr.prototype.shouldComponentUpdate=function(t,e){return Nr(this.props,t)||Nr(this.state,e)};var Pr=Tn.__b;Tn.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Pr&&Pr(t)};var Cr=Tn.__e;Tn.__e=function(t,e,n,r){if(t.then)for(var o,i=e;i=i.__;)if((o=i.__c)&&o.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),o.__c(t,e);Cr(t,e,n,r)};var Ir=Tn.unmount;function jr(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=function(t,e){for(var n in e)t[n]=e[n];return t}({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return jr(t,e,n)}))),t}function kr(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return kr(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function Rr(){this.__u=0,this.t=null,this.__b=null}function Lr(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Br(){this.u=null,this.o=null}Tn.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Ir&&Ir(t)},(Rr.prototype=new Vn).__c=function(t,e){var n=e.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Lr(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(! --r.__u){if(r.state.__a){var t=r.state.__a;r.__v.__k[0]=kr(t,t.__c.__P,t.__c.__O)}var e;for(r.setState({__a:r.__b=null});e=r.t.pop();)e.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(a,a)},Rr.prototype.componentWillUnmount=function(){this.t=[]},Rr.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=jr(this.__b,n,r.__O=r.__P)}this.__b=null}var o=e.__a&&Xn(Yn,null,t.fallback);return o&&(o.__u&=-33),[Xn(Yn,null,e.__a?null:t.children),o]};var zr=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};(Br.prototype=new Vn).__a=function(t){var e=this,n=Lr(e.__v),r=e.o.get(t);return r[0]++,function(o){var i=function(){e.props.revealOrder?(r.push(o),zr(e,t,r)):o()};n?n(i):i()}},Br.prototype.render=function(t){this.u=null,this.o=new Map;var e=tr(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Br.prototype.componentDidUpdate=Br.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){zr(t,n,e)}))};var Hr="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ur=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Xr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Gr=/[A-Z0-9]/g,Wr="undefined"!=typeof document,Yr=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};Vn.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(Vn.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Vr=Tn.event;function Fr(){}function Kr(){return this.cancelBubble}function qr(){return this.defaultPrevented}Tn.event=function(t){return Vr&&(t=Vr(t)),t.persist=Fr,t.isPropagationStopped=Kr,t.isDefaultPrevented=qr,t.nativeEvent=t};var Zr={enumerable:!1,configurable:!0,get:function(){return this.class}},$r=Tn.vnode;Tn.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,r={};for(var o in e){var i=e[o];if(!("value"===o&&"defaultValue"in e&&null==i||Wr&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in e&&null==e.value?o="value":"download"===o&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Yr(e.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":Xr.test(o)?o=a:-1===n.indexOf("-")&&Ur.test(o)?o=o.replace(Gr,"-$&").toLowerCase():null===i&&(i=void 0):a=o="oninput","oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=i}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=tr(e.children).forEach((function(t){t.props.selected=-1!=r.value.indexOf(t.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=tr(e.children).forEach((function(t){t.props.selected=r.multiple?-1!=r.defaultValue.indexOf(t.props.value):r.defaultValue==t.props.value}))),e.class&&!e.className?(r.class=e.class,Object.defineProperty(r,"className",Zr)):(e.className&&!e.class||e.class&&e.className)&&(r.class=r.className=e.className),t.props=r}(t),t.$$typeof=Hr,$r&&$r(t)};var Jr=Tn.__r;Tn.__r=function(t){Jr&&Jr(t),t.__c};var Qr=Tn.diffed;Tn.diffed=function(t){Qr&&Qr(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value)};var to=function(t,e){return to=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},to(t,e)};function eo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}to(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var no=function(){return no=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},no.apply(this,arguments)};function ro(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function oo(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function io(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function ao(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var so=0;function uo(t,e,n,r,o,i){e||(e={});var a,s,u=e;if("ref"in u)for(s in u={},e)"ref"==s?a=e[s]:u[s]=e[s];var l={type:t,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--so,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof t&&(a=t.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return Tn.vnode&&Tn.vnode(l),l}var lo="object"==typeof global&&global&&global.Object===Object&&global,co="object"==typeof self&&self&&self.Object===Object&&self,po=lo||co||Function("return this")(),fo=po.Symbol,ho=Object.prototype,yo=ho.hasOwnProperty,vo=ho.toString,go=fo?fo.toStringTag:void 0;var _o=Object.prototype.toString;var mo="[object Null]",bo="[object Undefined]",Eo=fo?fo.toStringTag:void 0;function xo(t){return null==t?void 0===t?bo:mo:Eo&&Eo in Object(t)?function(t){var e=yo.call(t,go),n=t[go];try{t[go]=void 0;var r=!0}catch(t){}var o=vo.call(t);return r&&(e?t[go]=n:delete t[go]),o}(t):function(t){return _o.call(t)}(t)}function wo(t){return null!=t&&"object"==typeof t}var So="[object Symbol]";function Mo(t){return"symbol"==typeof t||wo(t)&&xo(t)==So}var Ao=NaN;function To(t){return"number"==typeof t?t:Mo(t)?Ao:+t}function Oo(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}var No=Array.isArray,Do=1/0,Po=fo?fo.prototype:void 0,Co=Po?Po.toString:void 0;function Io(t){if("string"==typeof t)return t;if(No(t))return Oo(t,Io)+"";if(Mo(t))return Co?Co.call(t):"";var e=t+"";return"0"==e&&1/t==-Do?"-0":e}function jo(t,e){return function(n,r){var o;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=Io(n),r=Io(r)):(n=To(n),r=To(r)),o=t(n,r)}return o}}var ko=jo((function(t,e){return t+e}),0),Ro=/\s/;function Lo(t){for(var e=t.length;e--&&Ro.test(t.charAt(e)););return e}var Bo=/^\s+/;function zo(t){return t?t.slice(0,Lo(t)+1).replace(Bo,""):t}function Ho(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Uo=NaN,Xo=/^[-+]0x[0-9a-f]+$/i,Go=/^0b[01]+$/i,Wo=/^0o[0-7]+$/i,Yo=parseInt;function Vo(t){if("number"==typeof t)return t;if(Mo(t))return Uo;if(Ho(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ho(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=zo(t);var n=Go.test(t);return n||Wo.test(t)?Yo(t.slice(2),n?2:8):Xo.test(t)?Uo:+t}var Fo=1/0,Ko=17976931348623157e292;function qo(t){return t?(t=Vo(t))===Fo||t===-Fo?(t<0?-1:1)*Ko:t==t?t:0:0===t?t:0}function Zo(t){var e=qo(t),n=e%1;return e==e?n?e-n:e:0}function $o(t){return t}var Jo="[object AsyncFunction]",Qo="[object Function]",ti="[object GeneratorFunction]",ei="[object Proxy]";function ni(t){if(!Ho(t))return!1;var e=xo(t);return e==Qo||e==ti||e==Jo||e==ei}var ri,oi=po["__core-js_shared__"],ii=(ri=/[^.]+$/.exec(oi&&oi.keys&&oi.keys.IE_PROTO||""))?"Symbol(src)_1."+ri:"";var ai=Function.prototype.toString;function si(t){if(null!=t){try{return ai.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var ui=/^\[object .+?Constructor\]$/,li=Function.prototype,ci=Object.prototype,pi=li.toString,di=ci.hasOwnProperty,fi=RegExp("^"+pi.call(di).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hi(t){return!(!Ho(t)||function(t){return!!ii&&ii in t}(t))&&(ni(t)?fi:ui).test(si(t))}function yi(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return hi(n)?n:void 0}var vi=yi(po,"WeakMap"),gi=vi&&new vi,_i=gi?function(t,e){return gi.set(t,e),t}:$o,mi=Object.create,bi=function(){function t(){}return function(e){if(!Ho(e))return{};if(mi)return mi(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Ei(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=bi(t.prototype),r=t.apply(n,e);return Ho(r)?r:n}}var xi=1;function wi(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Si=Math.max;function Mi(t,e,n,r){for(var o=-1,i=t.length,a=n.length,s=-1,u=e.length,l=Si(i-a,0),c=Array(u+l),p=!r;++s<u;)c[s]=e[s];for(;++o<a;)(p||o<i)&&(c[n[o]]=t[o]);for(;l--;)c[s++]=t[o++];return c}var Ai=Math.max;function Ti(t,e,n,r){for(var o=-1,i=t.length,a=-1,s=n.length,u=-1,l=e.length,c=Ai(i-s,0),p=Array(c+l),d=!r;++o<c;)p[o]=t[o];for(var f=o;++u<l;)p[f+u]=e[u];for(;++a<s;)(d||o<i)&&(p[f+n[a]]=t[o++]);return p}function Oi(){}var Ni=4294967295;function Di(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ni,this.__views__=[]}function Pi(){}Di.prototype=bi(Oi.prototype),Di.prototype.constructor=Di;var Ci=gi?function(t){return gi.get(t)}:Pi,Ii={},ji=Object.prototype.hasOwnProperty;function ki(t){for(var e=t.name+"",n=Ii[e],r=ji.call(Ii,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function Ri(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Li(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function Bi(t){if(t instanceof Di)return t.clone();var e=new Ri(t.__wrapped__,t.__chain__);return e.__actions__=Li(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}Ri.prototype=bi(Oi.prototype),Ri.prototype.constructor=Ri;var zi=Object.prototype.hasOwnProperty;function Hi(t){if(wo(t)&&!No(t)&&!(t instanceof Di)){if(t instanceof Ri)return t;if(zi.call(t,"__wrapped__"))return Bi(t)}return new Ri(t)}function Ui(t){var e=ki(t),n=Hi[e];if("function"!=typeof n||!(e in Di.prototype))return!1;if(t===n)return!0;var r=Ci(n);return!!r&&t===r[0]}Hi.prototype=Oi.prototype,Hi.prototype.constructor=Hi;var Xi=Date.now;function Gi(t){var e=0,n=0;return function(){var r=Xi(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Wi=Gi(_i),Yi=/\{\n\/\* \[wrapped with (.+)\] \*/,Vi=/,? & /;var Fi=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function Ki(t){return function(){return t}}var qi=function(){try{var t=yi(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Zi=qi?function(t,e){return qi(t,"toString",{configurable:!0,enumerable:!1,value:Ki(e),writable:!0})}:$o,$i=Gi(Zi);function Ji(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Qi(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function ta(t){return t!=t}function ea(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):Qi(t,ta,n)}function na(t,e){return!!(null==t?0:t.length)&&ea(t,e,0)>-1}var ra=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function oa(t,e,n){var r=e+"";return $i(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Fi,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ji(ra,(function(n){var r="_."+n[0];e&n[1]&&!na(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(Yi);return e?e[1].split(Vi):[]}(r),n)))}var ia=1,aa=2,sa=4,ua=8,la=32,ca=64;function pa(t,e,n,r,o,i,a,s,u,l){var c=e&ua;e|=c?la:ca,(e&=~(c?ca:la))&sa||(e&=~(ia|aa));var p=[t,e,o,c?i:void 0,c?a:void 0,c?void 0:i,c?void 0:a,s,u,l],d=n.apply(void 0,p);return Ui(t)&&Wi(d,p),d.placeholder=r,oa(d,t,e)}function da(t){return t.placeholder}var fa=9007199254740991,ha=/^(?:0|[1-9]\d*)$/;function ya(t,e){var n=typeof t;return!!(e=null==e?fa:e)&&("number"==n||"symbol"!=n&&ha.test(t))&&t>-1&&t%1==0&&t<e}var va=Math.min;var ga="__lodash_placeholder__";function _a(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n];a!==e&&a!==ga||(t[n]=ga,i[o++]=n)}return i}var ma=1,ba=2,Ea=8,xa=16,wa=128,Sa=512;function Ma(t,e,n,r,o,i,a,s,u,l){var c=e&wa,p=e&ma,d=e&ba,f=e&(Ea|xa),h=e&Sa,y=d?void 0:Ei(t);return function v(){for(var g=arguments.length,_=Array(g),m=g;m--;)_[m]=arguments[m];if(f)var b=da(v),E=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(_,b);if(r&&(_=Mi(_,r,o,f)),i&&(_=Ti(_,i,a,f)),g-=E,f&&g<l){var x=_a(_,b);return pa(t,e,Ma,v.placeholder,n,_,x,s,u,l-g)}var w=p?n:this,S=d?w[t]:t;return g=_.length,s?_=function(t,e){for(var n=t.length,r=va(e.length,n),o=Li(t);r--;){var i=e[r];t[r]=ya(i,n)?o[i]:void 0}return t}(_,s):h&&g>1&&_.reverse(),c&&u<g&&(_.length=u),this&&this!==po&&this instanceof v&&(S=y||Ei(S)),S.apply(w,_)}}var Aa=1;var Ta="__lodash_placeholder__",Oa=1,Na=2,Da=4,Pa=8,Ca=128,Ia=256,ja=Math.min;var ka="Expected a function",Ra=1,La=2,Ba=8,za=16,Ha=32,Ua=64,Xa=Math.max;function Ga(t,e,n,r,o,i,a,s){var u=e&La;if(!u&&"function"!=typeof t)throw new TypeError(ka);var l=r?r.length:0;if(l||(e&=~(Ha|Ua),r=o=void 0),a=void 0===a?a:Xa(Zo(a),0),s=void 0===s?s:Zo(s),l-=o?o.length:0,e&Ua){var c=r,p=o;r=o=void 0}var d=u?void 0:Ci(t),f=[t,e,n,r,o,c,p,i,a,s];if(d&&function(t,e){var n=t[1],r=e[1],o=n|r,i=o<(Oa|Na|Ca),a=r==Ca&&n==Pa||r==Ca&&n==Ia&&t[7].length<=e[8]||r==(Ca|Ia)&&e[7].length<=e[8]&&n==Pa;if(!i&&!a)return t;r&Oa&&(t[2]=e[2],o|=n&Oa?0:Da);var s=e[3];if(s){var u=t[3];t[3]=u?Mi(u,s,e[4]):s,t[4]=u?_a(t[3],Ta):e[4]}(s=e[5])&&(u=t[5],t[5]=u?Ti(u,s,e[6]):s,t[6]=u?_a(t[5],Ta):e[6]),(s=e[7])&&(t[7]=s),r&Ca&&(t[8]=null==t[8]?e[8]:ja(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(f,d),t=f[0],e=f[1],n=f[2],r=f[3],o=f[4],!(s=f[9]=void 0===f[9]?u?0:t.length:Xa(f[9]-l,0))&&e&(Ba|za)&&(e&=~(Ba|za)),e&&e!=Ra)h=e==Ba||e==za?function(t,e,n){var r=Ei(t);return function o(){for(var i=arguments.length,a=Array(i),s=i,u=da(o);s--;)a[s]=arguments[s];var l=i<3&&a[0]!==u&&a[i-1]!==u?[]:_a(a,u);return(i-=l.length)<n?pa(t,e,Ma,o.placeholder,void 0,a,l,void 0,void 0,n-i):wi(this&&this!==po&&this instanceof o?r:t,this,a)}}(t,e,s):e!=Ha&&e!=(Ra|Ha)||o.length?Ma.apply(void 0,f):function(t,e,n,r){var o=e&Aa,i=Ei(t);return function e(){for(var a=-1,s=arguments.length,u=-1,l=r.length,c=Array(l+s),p=this&&this!==po&&this instanceof e?i:t;++u<l;)c[u]=r[u];for(;s--;)c[u++]=arguments[++a];return wi(p,o?n:this,c)}}(t,e,n,r);else var h=function(t,e,n){var r=e&xi,o=Ei(t);return function e(){return(this&&this!==po&&this instanceof e?o:t).apply(r?n:this,arguments)}}(t,e,n);return oa((d?_i:Wi)(h,f),t,e)}var Wa=128;function Ya(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,Ga(t,Wa,void 0,void 0,void 0,void 0,e)}function Va(t,e,n){"__proto__"==e&&qi?qi(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Fa(t,e){return t===e||t!=t&&e!=e}var Ka=Object.prototype.hasOwnProperty;function qa(t,e,n){var r=t[e];Ka.call(t,e)&&Fa(r,n)&&(void 0!==n||e in t)||Va(t,e,n)}function Za(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],u=r?r(n[s],t[s],s,n,t):void 0;void 0===u&&(u=t[s]),o?Va(n,s,u):qa(n,s,u)}return n}var $a=Math.max;function Ja(t,e,n){return e=$a(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=$a(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=r[o];return s[e]=n(a),wi(t,this,s)}}function Qa(t,e){return $i(Ja(t,e,$o),t+"")}var ts=9007199254740991;function es(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=ts}function ns(t){return null!=t&&es(t.length)&&!ni(t)}function rs(t,e,n){if(!Ho(n))return!1;var r=typeof e;return!!("number"==r?ns(n)&&ya(e,n.length):"string"==r&&e in n)&&Fa(n[e],t)}function os(t){return Qa((function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,a&&rs(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++r<o;){var s=n[r];s&&t(e,s,r,i)}return e}))}var is=Object.prototype;function as(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||is)}function ss(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function us(t){return wo(t)&&"[object Arguments]"==xo(t)}var ls=Object.prototype,cs=ls.hasOwnProperty,ps=ls.propertyIsEnumerable,ds=us(function(){return arguments}())?us:function(t){return wo(t)&&cs.call(t,"callee")&&!ps.call(t,"callee")};function fs(){return!1}var hs="object"==typeof t&&t&&!t.nodeType&&t,ys=hs&&"object"==typeof module&&module&&!module.nodeType&&module,vs=ys&&ys.exports===hs?po.Buffer:void 0,gs=(vs?vs.isBuffer:void 0)||fs,_s={};function ms(t){return function(e){return t(e)}}_s["[object Float32Array]"]=_s["[object Float64Array]"]=_s["[object Int8Array]"]=_s["[object Int16Array]"]=_s["[object Int32Array]"]=_s["[object Uint8Array]"]=_s["[object Uint8ClampedArray]"]=_s["[object Uint16Array]"]=_s["[object Uint32Array]"]=!0,_s["[object Arguments]"]=_s["[object Array]"]=_s["[object ArrayBuffer]"]=_s["[object Boolean]"]=_s["[object DataView]"]=_s["[object Date]"]=_s["[object Error]"]=_s["[object Function]"]=_s["[object Map]"]=_s["[object Number]"]=_s["[object Object]"]=_s["[object RegExp]"]=_s["[object Set]"]=_s["[object String]"]=_s["[object WeakMap]"]=!1;var bs="object"==typeof t&&t&&!t.nodeType&&t,Es=bs&&"object"==typeof module&&module&&!module.nodeType&&module,xs=Es&&Es.exports===bs&&lo.process,ws=function(){try{var t=Es&&Es.require&&Es.require("util").types;return t||xs&&xs.binding&&xs.binding("util")}catch(t){}}(),Ss=ws&&ws.isTypedArray,Ms=Ss?ms(Ss):function(t){return wo(t)&&es(t.length)&&!!_s[xo(t)]},As=Object.prototype.hasOwnProperty;function Ts(t,e){var n=No(t),r=!n&&ds(t),o=!n&&!r&&gs(t),i=!n&&!r&&!o&&Ms(t),a=n||r||o||i,s=a?ss(t.length,String):[],u=s.length;for(var l in t)!e&&!As.call(t,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ya(l,u))||s.push(l);return s}function Os(t,e){return function(n){return t(e(n))}}var Ns=Os(Object.keys,Object),Ds=Object.prototype.hasOwnProperty;function Ps(t){if(!as(t))return Ns(t);var e=[];for(var n in Object(t))Ds.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Cs(t){return ns(t)?Ts(t):Ps(t)}var Is=Object.prototype.hasOwnProperty,js=os((function(t,e){if(as(e)||ns(e))Za(e,Cs(e),t);else for(var n in e)Is.call(e,n)&&qa(t,n,e[n])}));var ks=Object.prototype.hasOwnProperty;function Rs(t){if(!Ho(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=as(t),n=[];for(var r in t)("constructor"!=r||!e&&ks.call(t,r))&&n.push(r);return n}function Ls(t){return ns(t)?Ts(t,!0):Rs(t)}var Bs=os((function(t,e){Za(e,Ls(e),t)})),zs=os((function(t,e,n,r){Za(e,Ls(e),t,r)})),Hs=os((function(t,e,n,r){Za(e,Cs(e),t,r)})),Us=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xs=/^\w*$/;function Gs(t,e){if(No(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Mo(t))||(Xs.test(t)||!Us.test(t)||null!=e&&t in Object(e))}var Ws=yi(Object,"create");var Ys=Object.prototype.hasOwnProperty;var Vs=Object.prototype.hasOwnProperty;function Fs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ks(t,e){for(var n=t.length;n--;)if(Fa(t[n][0],e))return n;return-1}Fs.prototype.clear=function(){this.__data__=Ws?Ws(null):{},this.size=0},Fs.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Fs.prototype.get=function(t){var e=this.__data__;if(Ws){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Ys.call(e,t)?e[t]:void 0},Fs.prototype.has=function(t){var e=this.__data__;return Ws?void 0!==e[t]:Vs.call(e,t)},Fs.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ws&&void 0===e?"__lodash_hash_undefined__":e,this};var qs=Array.prototype.splice;function Zs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Zs.prototype.clear=function(){this.__data__=[],this.size=0},Zs.prototype.delete=function(t){var e=this.__data__,n=Ks(e,t);return!(n<0)&&(n==e.length-1?e.pop():qs.call(e,n,1),--this.size,!0)},Zs.prototype.get=function(t){var e=this.__data__,n=Ks(e,t);return n<0?void 0:e[n][1]},Zs.prototype.has=function(t){return Ks(this.__data__,t)>-1},Zs.prototype.set=function(t,e){var n=this.__data__,r=Ks(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var $s=yi(po,"Map");function Js(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function Qs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Qs.prototype.clear=function(){this.size=0,this.__data__={hash:new Fs,map:new($s||Zs),string:new Fs}},Qs.prototype.delete=function(t){var e=Js(this,t).delete(t);return this.size-=e?1:0,e},Qs.prototype.get=function(t){return Js(this,t).get(t)},Qs.prototype.has=function(t){return Js(this,t).has(t)},Qs.prototype.set=function(t,e){var n=Js(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var tu="Expected a function";function eu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(tu);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(eu.Cache||Qs),n}eu.Cache=Qs;var nu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ru=/\\(\\)?/g,ou=function(t){var e=eu(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(nu,(function(t,n,r,o){e.push(r?o.replace(ru,"$1"):n||t)})),e}));function iu(t){return null==t?"":Io(t)}function au(t,e){return No(t)?t:Gs(t,e)?[t]:ou(iu(t))}var su=1/0;function uu(t){if("string"==typeof t||Mo(t))return t;var e=t+"";return"0"==e&&1/t==-su?"-0":e}function lu(t,e){for(var n=0,r=(e=au(e,t)).length;null!=t&&n<r;)t=t[uu(e[n++])];return n&&n==r?t:void 0}function cu(t,e,n){var r=null==t?void 0:lu(t,e);return void 0===r?n:r}function pu(t,e){for(var n=-1,r=e.length,o=Array(r),i=null==t;++n<r;)o[n]=i?void 0:cu(t,e[n]);return o}function du(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var fu=fo?fo.isConcatSpreadable:void 0;function hu(t){return No(t)||ds(t)||!!(fu&&t&&t[fu])}function yu(t,e,n,r,o){var i=-1,a=t.length;for(n||(n=hu),o||(o=[]);++i<a;){var s=t[i];e>0&&n(s)?e>1?yu(s,e-1,n,r,o):du(o,s):r||(o[o.length]=s)}return o}function vu(t){return(null==t?0:t.length)?yu(t,1):[]}function gu(t){return $i(Ja(t,void 0,vu),t+"")}var _u=gu(pu),mu=Os(Object.getPrototypeOf,Object),bu="[object Object]",Eu=Function.prototype,xu=Object.prototype,wu=Eu.toString,Su=xu.hasOwnProperty,Mu=wu.call(Object);function Au(t){if(!wo(t)||xo(t)!=bu)return!1;var e=mu(t);if(null===e)return!0;var n=Su.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&wu.call(n)==Mu}var Tu="[object DOMException]",Ou="[object Error]";function Nu(t){if(!wo(t))return!1;var e=xo(t);return e==Ou||e==Tu||"string"==typeof t.message&&"string"==typeof t.name&&!Au(t)}var Du=Qa((function(t,e){try{return wi(t,void 0,e)}catch(t){return Nu(t)?t:new Error(t)}})),Pu="Expected a function";function Cu(t,e){var n;if("function"!=typeof e)throw new TypeError(Pu);return t=Zo(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var Iu=Qa((function(t,e,n){var r=1;if(n.length){var o=_a(n,da(Iu));r|=32}return Ga(t,r,e,n,o)}));Iu.placeholder={};var ju=gu((function(t,e){return Ji(e,(function(e){e=uu(e),Va(t,e,Iu(t[e],t))})),t})),ku=Qa((function(t,e,n){var r=3;if(n.length){var o=_a(n,da(ku));r|=32}return Ga(e,r,t,n,o)}));function Ru(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i}function Lu(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:Ru(t,e,n)}ku.placeholder={};var Bu=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function zu(t){return Bu.test(t)}var Hu="\\ud800-\\udfff",Uu="["+Hu+"]",Xu="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Gu="\\ud83c[\\udffb-\\udfff]",Wu="[^"+Hu+"]",Yu="(?:\\ud83c[\\udde6-\\uddff]){2}",Vu="[\\ud800-\\udbff][\\udc00-\\udfff]",Fu="(?:"+Xu+"|"+Gu+")"+"?",Ku="[\\ufe0e\\ufe0f]?",qu=Ku+Fu+("(?:\\u200d(?:"+[Wu,Yu,Vu].join("|")+")"+Ku+Fu+")*"),Zu="(?:"+[Wu+Xu+"?",Xu,Yu,Vu,Uu].join("|")+")",$u=RegExp(Gu+"(?="+Gu+")|"+Zu+qu,"g");function Ju(t){return zu(t)?function(t){return t.match($u)||[]}(t):function(t){return t.split("")}(t)}function Qu(t){return function(e){var n=zu(e=iu(e))?Ju(e):void 0,r=n?n[0]:e.charAt(0),o=n?Lu(n,1).join(""):e.slice(1);return r[t]()+o}}var tl=Qu("toUpperCase");function el(t){return tl(iu(t).toLowerCase())}function nl(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function rl(t){return function(e){return null==t?void 0:t[e]}}var ol=rl({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),il=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,al=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function sl(t){return(t=iu(t))&&t.replace(il,ol).replace(al,"")}var ul=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var ll=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var cl="\\ud800-\\udfff",pl="\\u2700-\\u27bf",dl="a-z\\xdf-\\xf6\\xf8-\\xff",fl="A-Z\\xc0-\\xd6\\xd8-\\xde",hl="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",yl="["+hl+"]",vl="\\d+",gl="["+pl+"]",_l="["+dl+"]",ml="[^"+cl+hl+vl+pl+dl+fl+"]",bl="(?:\\ud83c[\\udde6-\\uddff]){2}",El="[\\ud800-\\udbff][\\udc00-\\udfff]",xl="["+fl+"]",wl="(?:"+_l+"|"+ml+")",Sl="(?:"+xl+"|"+ml+")",Ml="(?:['’](?:d|ll|m|re|s|t|ve))?",Al="(?:['’](?:D|LL|M|RE|S|T|VE))?",Tl="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Ol="[\\ufe0e\\ufe0f]?",Nl=Ol+Tl+("(?:\\u200d(?:"+["[^"+cl+"]",bl,El].join("|")+")"+Ol+Tl+")*"),Dl="(?:"+[gl,bl,El].join("|")+")"+Nl,Pl=RegExp([xl+"?"+_l+"+"+Ml+"(?="+[yl,xl,"$"].join("|")+")",Sl+"+"+Al+"(?="+[yl,xl+wl,"$"].join("|")+")",xl+"?"+wl+"+"+Ml,xl+"+"+Al,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vl,Dl].join("|"),"g");function Cl(t,e,n){return t=iu(t),void 0===(e=n?void 0:e)?function(t){return ll.test(t)}(t)?function(t){return t.match(Pl)||[]}(t):function(t){return t.match(ul)||[]}(t):t.match(e)||[]}var Il=RegExp("['’]","g");function jl(t){return function(e){return nl(Cl(sl(e).replace(Il,"")),t,"")}}var kl=jl((function(t,e,n){return e=e.toLowerCase(),t+(n?el(e):e)}));var Rl=po.isFinite,Ll=Math.min;function Bl(t){var e=Math[t];return function(t,n){if(t=Vo(t),(n=null==n?0:Ll(Zo(n),292))&&Rl(t)){var r=(iu(t)+"e").split("e");return+((r=(iu(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var zl=Bl("ceil");function Hl(t){var e=Hi(t);return e.__chain__=!0,e}var Ul=Math.ceil,Xl=Math.max;function Gl(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function Wl(t){var e=this.__data__=new Zs(t);this.size=e.size}function Yl(t,e){return t&&Za(e,Cs(e),t)}Wl.prototype.clear=function(){this.__data__=new Zs,this.size=0},Wl.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Wl.prototype.get=function(t){return this.__data__.get(t)},Wl.prototype.has=function(t){return this.__data__.has(t)},Wl.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Zs){var r=n.__data__;if(!$s||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Qs(r)}return n.set(t,e),this.size=n.size,this};var Vl="object"==typeof t&&t&&!t.nodeType&&t,Fl=Vl&&"object"==typeof module&&module&&!module.nodeType&&module,Kl=Fl&&Fl.exports===Vl?po.Buffer:void 0,ql=Kl?Kl.allocUnsafe:void 0;function Zl(t,e){if(e)return t.slice();var n=t.length,r=ql?ql(n):new t.constructor(n);return t.copy(r),r}function $l(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}function Jl(){return[]}var Ql=Object.prototype.propertyIsEnumerable,tc=Object.getOwnPropertySymbols,ec=tc?function(t){return null==t?[]:(t=Object(t),$l(tc(t),(function(e){return Ql.call(t,e)})))}:Jl;var nc=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)du(e,ec(t)),t=mu(t);return e}:Jl;function rc(t,e,n){var r=e(t);return No(t)?r:du(r,n(t))}function oc(t){return rc(t,Cs,ec)}function ic(t){return rc(t,Ls,nc)}var ac=yi(po,"DataView"),sc=yi(po,"Promise"),uc=yi(po,"Set"),lc="[object Map]",cc="[object Promise]",pc="[object Set]",dc="[object WeakMap]",fc="[object DataView]",hc=si(ac),yc=si($s),vc=si(sc),gc=si(uc),_c=si(vi),mc=xo;(ac&&mc(new ac(new ArrayBuffer(1)))!=fc||$s&&mc(new $s)!=lc||sc&&mc(sc.resolve())!=cc||uc&&mc(new uc)!=pc||vi&&mc(new vi)!=dc)&&(mc=function(t){var e=xo(t),n="[object Object]"==e?t.constructor:void 0,r=n?si(n):"";if(r)switch(r){case hc:return fc;case yc:return lc;case vc:return cc;case gc:return pc;case _c:return dc}return e});var bc=mc,Ec=Object.prototype.hasOwnProperty;var xc=po.Uint8Array;function wc(t){var e=new t.constructor(t.byteLength);return new xc(e).set(new xc(t)),e}var Sc=/\w*$/;var Mc=fo?fo.prototype:void 0,Ac=Mc?Mc.valueOf:void 0;function Tc(t,e){var n=e?wc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var Oc="[object Boolean]",Nc="[object Date]",Dc="[object Map]",Pc="[object Number]",Cc="[object RegExp]",Ic="[object Set]",jc="[object String]",kc="[object Symbol]",Rc="[object ArrayBuffer]",Lc="[object DataView]",Bc="[object Float32Array]",zc="[object Float64Array]",Hc="[object Int8Array]",Uc="[object Int16Array]",Xc="[object Int32Array]",Gc="[object Uint8Array]",Wc="[object Uint8ClampedArray]",Yc="[object Uint16Array]",Vc="[object Uint32Array]";function Fc(t,e,n){var r,o=t.constructor;switch(e){case Rc:return wc(t);case Oc:case Nc:return new o(+t);case Lc:return function(t,e){var n=e?wc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case Bc:case zc:case Hc:case Uc:case Xc:case Gc:case Wc:case Yc:case Vc:return Tc(t,n);case Dc:return new o;case Pc:case jc:return new o(t);case Cc:return function(t){var e=new t.constructor(t.source,Sc.exec(t));return e.lastIndex=t.lastIndex,e}(t);case Ic:return new o;case kc:return r=t,Ac?Object(Ac.call(r)):{}}}function Kc(t){return"function"!=typeof t.constructor||as(t)?{}:bi(mu(t))}var qc=ws&&ws.isMap,Zc=qc?ms(qc):function(t){return wo(t)&&"[object Map]"==bc(t)};var $c=ws&&ws.isSet,Jc=$c?ms($c):function(t){return wo(t)&&"[object Set]"==bc(t)},Qc=1,tp=2,ep=4,np="[object Arguments]",rp="[object Function]",op="[object GeneratorFunction]",ip="[object Object]",ap={};function sp(t,e,n,r,o,i){var a,s=e&Qc,u=e&tp,l=e&ep;if(n&&(a=o?n(t,r,o,i):n(t)),void 0!==a)return a;if(!Ho(t))return t;var c=No(t);if(c){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ec.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return Li(t,a)}else{var p=bc(t),d=p==rp||p==op;if(gs(t))return Zl(t,s);if(p==ip||p==np||d&&!o){if(a=u||d?{}:Kc(t),!s)return u?function(t,e){return Za(t,nc(t),e)}(t,function(t,e){return t&&Za(e,Ls(e),t)}(a,t)):function(t,e){return Za(t,ec(t),e)}(t,Yl(a,t))}else{if(!ap[p])return o?t:{};a=Fc(t,p,s)}}i||(i=new Wl);var f=i.get(t);if(f)return f;i.set(t,a),Jc(t)?t.forEach((function(r){a.add(sp(r,e,n,r,t,i))})):Zc(t)&&t.forEach((function(r,o){a.set(o,sp(r,e,n,o,t,i))}));var h=c?void 0:(l?u?ic:oc:u?Ls:Cs)(t);return Ji(h||t,(function(r,o){h&&(r=t[o=r]),qa(a,o,sp(r,e,n,o,t,i))})),a}ap[np]=ap["[object Array]"]=ap["[object ArrayBuffer]"]=ap["[object DataView]"]=ap["[object Boolean]"]=ap["[object Date]"]=ap["[object Float32Array]"]=ap["[object Float64Array]"]=ap["[object Int8Array]"]=ap["[object Int16Array]"]=ap["[object Int32Array]"]=ap["[object Map]"]=ap["[object Number]"]=ap[ip]=ap["[object RegExp]"]=ap["[object Set]"]=ap["[object String]"]=ap["[object Symbol]"]=ap["[object Uint8Array]"]=ap["[object Uint8ClampedArray]"]=ap["[object Uint16Array]"]=ap["[object Uint32Array]"]=!0,ap["[object Error]"]=ap[rp]=ap["[object WeakMap]"]=!1;function up(t){return sp(t,5)}function lp(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Qs;++e<n;)this.add(t[e])}function cp(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function pp(t,e){return t.has(e)}lp.prototype.add=lp.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},lp.prototype.has=function(t){return this.__data__.has(t)};var dp=1,fp=2;function hp(t,e,n,r,o,i){var a=n&dp,s=t.length,u=e.length;if(s!=u&&!(a&&u>s))return!1;var l=i.get(t),c=i.get(e);if(l&&c)return l==e&&c==t;var p=-1,d=!0,f=n&fp?new lp:void 0;for(i.set(t,e),i.set(e,t);++p<s;){var h=t[p],y=e[p];if(r)var v=a?r(y,h,p,e,t,i):r(h,y,p,t,e,i);if(void 0!==v){if(v)continue;d=!1;break}if(f){if(!cp(e,(function(t,e){if(!pp(f,e)&&(h===t||o(h,t,n,r,i)))return f.push(e)}))){d=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){d=!1;break}}return i.delete(t),i.delete(e),d}function yp(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function vp(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var gp=1,_p=2,mp="[object Boolean]",bp="[object Date]",Ep="[object Error]",xp="[object Map]",wp="[object Number]",Sp="[object RegExp]",Mp="[object Set]",Ap="[object String]",Tp="[object Symbol]",Op="[object ArrayBuffer]",Np="[object DataView]",Dp=fo?fo.prototype:void 0,Pp=Dp?Dp.valueOf:void 0;var Cp=1,Ip=Object.prototype.hasOwnProperty;var jp=1,kp="[object Arguments]",Rp="[object Array]",Lp="[object Object]",Bp=Object.prototype.hasOwnProperty;function zp(t,e,n,r,o,i){var a=No(t),s=No(e),u=a?Rp:bc(t),l=s?Rp:bc(e),c=(u=u==kp?Lp:u)==Lp,p=(l=l==kp?Lp:l)==Lp,d=u==l;if(d&&gs(t)){if(!gs(e))return!1;a=!0,c=!1}if(d&&!c)return i||(i=new Wl),a||Ms(t)?hp(t,e,n,r,o,i):function(t,e,n,r,o,i,a){switch(n){case Np:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Op:return!(t.byteLength!=e.byteLength||!i(new xc(t),new xc(e)));case mp:case bp:case wp:return Fa(+t,+e);case Ep:return t.name==e.name&&t.message==e.message;case Sp:case Ap:return t==e+"";case xp:var s=yp;case Mp:var u=r&gp;if(s||(s=vp),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=_p,a.set(t,e);var c=hp(s(t),s(e),r,o,i,a);return a.delete(t),c;case Tp:if(Pp)return Pp.call(t)==Pp.call(e)}return!1}(t,e,u,n,r,o,i);if(!(n&jp)){var f=c&&Bp.call(t,"__wrapped__"),h=p&&Bp.call(e,"__wrapped__");if(f||h){var y=f?t.value():t,v=h?e.value():e;return i||(i=new Wl),o(y,v,n,r,i)}}return!!d&&(i||(i=new Wl),function(t,e,n,r,o,i){var a=n&Cp,s=oc(t),u=s.length;if(u!=oc(e).length&&!a)return!1;for(var l=u;l--;){var c=s[l];if(!(a?c in e:Ip.call(e,c)))return!1}var p=i.get(t),d=i.get(e);if(p&&d)return p==e&&d==t;var f=!0;i.set(t,e),i.set(e,t);for(var h=a;++l<u;){var y=t[c=s[l]],v=e[c];if(r)var g=a?r(v,y,c,e,t,i):r(y,v,c,t,e,i);if(!(void 0===g?y===v||o(y,v,n,r,i):g)){f=!1;break}h||(h="constructor"==c)}if(f&&!h){var _=t.constructor,m=e.constructor;_==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof m&&m instanceof m||(f=!1)}return i.delete(t),i.delete(e),f}(t,e,n,r,o,i))}function Hp(t,e,n,r,o){return t===e||(null==t||null==e||!wo(t)&&!wo(e)?t!=t&&e!=e:zp(t,e,n,r,Hp,o))}var Up=1,Xp=2;function Gp(t,e,n,r){var o=n.length,i=o,a=!r;if(null==t)return!i;for(t=Object(t);o--;){var s=n[o];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){var u=(s=n[o])[0],l=t[u],c=s[1];if(a&&s[2]){if(void 0===l&&!(u in t))return!1}else{var p=new Wl;if(r)var d=r(l,c,u,t,e,p);if(!(void 0===d?Hp(c,l,Up|Xp,r,p):d))return!1}}return!0}function Wp(t){return t==t&&!Ho(t)}function Yp(t){for(var e=Cs(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Wp(o)]}return e}function Vp(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function Fp(t){var e=Yp(t);return 1==e.length&&e[0][2]?Vp(e[0][0],e[0][1]):function(n){return n===t||Gp(n,t,e)}}function Kp(t,e){return null!=t&&e in Object(t)}function qp(t,e,n){for(var r=-1,o=(e=au(e,t)).length,i=!1;++r<o;){var a=uu(e[r]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&es(o)&&ya(a,o)&&(No(t)||ds(t))}function Zp(t,e){return null!=t&&qp(t,e,Kp)}var $p=1,Jp=2;function Qp(t,e){return Gs(t)&&Wp(e)?Vp(uu(t),e):function(n){var r=cu(n,t);return void 0===r&&r===e?Zp(n,t):Hp(e,r,$p|Jp)}}function td(t){return function(e){return null==e?void 0:e[t]}}function ed(t){return Gs(t)?td(uu(t)):function(t){return function(e){return lu(e,t)}}(t)}function nd(t){return"function"==typeof t?t:null==t?$o:"object"==typeof t?No(t)?Qp(t[0],t[1]):Fp(t):ed(t)}function rd(t,e,n){var r=n.length;if(null==t)return!r;for(t=Object(t);r--;){var o=n[r],i=e[o],a=t[o];if(void 0===a&&!(o in t)||!i(a))return!1}return!0}function od(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var a=t[o];e(r,a,n(a),t)}return r}function id(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++o];if(!1===n(i[u],u,i))break}return e}}var ad=id();function sd(t,e){return t&&ad(t,e,Cs)}function ud(t,e){return function(n,r){if(null==n)return n;if(!ns(n))return t(n,r);for(var o=n.length,i=e?o:-1,a=Object(n);(e?i--:++i<o)&&!1!==r(a[i],i,a););return n}}var ld=ud(sd);function cd(t,e,n,r){return ld(t,(function(t,o,i){e(r,t,n(t),i)})),r}function pd(t,e){return function(n,r){var o=No(n)?od:cd,i=e?e():{};return o(n,t,nd(r),i)}}var dd=Object.prototype.hasOwnProperty,fd=pd((function(t,e,n){dd.call(t,n)?++t[n]:Va(t,n,1)}));function hd(t,e,n){var r=Ga(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=hd.placeholder,r}hd.placeholder={};function yd(t,e,n){var r=Ga(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=yd.placeholder,r}yd.placeholder={};var vd=function(){return po.Date.now()},gd="Expected a function",_d=Math.max,md=Math.min;function bd(t,e,n){var r,o,i,a,s,u,l=0,c=!1,p=!1,d=!0;if("function"!=typeof t)throw new TypeError(gd);function f(e){var n=r,i=o;return r=o=void 0,l=e,a=t.apply(i,n)}function h(t){var n=t-u;return void 0===u||n>=e||n<0||p&&t-l>=i}function y(){var t=vd();if(h(t))return v(t);s=setTimeout(y,function(t){var n=e-(t-u);return p?md(n,i-(t-l)):n}(t))}function v(t){return s=void 0,d&&r?f(t):(r=o=void 0,a)}function g(){var t=vd(),n=h(t);if(r=arguments,o=this,u=t,n){if(void 0===s)return function(t){return l=t,s=setTimeout(y,e),c?f(t):a}(u);if(p)return clearTimeout(s),s=setTimeout(y,e),f(u)}return void 0===s&&(s=setTimeout(y,e)),a}return e=Vo(e)||0,Ho(n)&&(c=!!n.leading,i=(p="maxWait"in n)?_d(Vo(n.maxWait)||0,e):i,d="trailing"in n?!!n.trailing:d),g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=o=s=void 0},g.flush=function(){return void 0===s?a:v(vd())},g}var Ed=Object.prototype,xd=Ed.hasOwnProperty,wd=Qa((function(t,e){t=Object(t);var n=-1,r=e.length,o=r>2?e[2]:void 0;for(o&&rs(e[0],e[1],o)&&(r=1);++n<r;)for(var i=e[n],a=Ls(i),s=-1,u=a.length;++s<u;){var l=a[s],c=t[l];(void 0===c||Fa(c,Ed[l])&&!xd.call(t,l))&&(t[l]=i[l])}return t}));function Sd(t,e,n){(void 0!==n&&!Fa(t[e],n)||void 0===n&&!(e in t))&&Va(t,e,n)}function Md(t){return wo(t)&&ns(t)}function Ad(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Td(t){return Za(t,Ls(t))}function Od(t,e,n,r,o){t!==e&&ad(e,(function(i,a){if(o||(o=new Wl),Ho(i))!function(t,e,n,r,o,i,a){var s=Ad(t,n),u=Ad(e,n),l=a.get(u);if(l)Sd(t,n,l);else{var c=i?i(s,u,n+"",t,e,a):void 0,p=void 0===c;if(p){var d=No(u),f=!d&&gs(u),h=!d&&!f&&Ms(u);c=u,d||f||h?No(s)?c=s:Md(s)?c=Li(s):f?(p=!1,c=Zl(u,!0)):h?(p=!1,c=Tc(u,!0)):c=[]:Au(u)||ds(u)?(c=s,ds(s)?c=Td(s):Ho(s)&&!ni(s)||(c=Kc(u))):p=!1}p&&(a.set(u,c),o(c,u,r,i,a),a.delete(u)),Sd(t,n,c)}}(t,e,a,n,Od,r,o);else{var s=r?r(Ad(t,a),i,a+"",t,e,o):void 0;void 0===s&&(s=i),Sd(t,a,s)}}),Ls)}function Nd(t,e,n,r,o,i){return Ho(t)&&Ho(e)&&(i.set(e,t),Od(t,e,void 0,Nd,i),i.delete(e)),t}var Dd=os((function(t,e,n,r){Od(t,e,n,r)})),Pd=Qa((function(t){return t.push(void 0,Nd),wi(Dd,void 0,t)}));function Cd(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}var Id=Qa((function(t,e){return Cd(t,1,e)})),jd=Qa((function(t,e,n){return Cd(t,Vo(e)||0,n)}));function kd(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}var Rd=200;function Ld(t,e,n,r){var o=-1,i=na,a=!0,s=t.length,u=[],l=e.length;if(!s)return u;n&&(e=Oo(e,ms(n))),r?(i=kd,a=!1):e.length>=Rd&&(i=pp,a=!1,e=new lp(e));t:for(;++o<s;){var c=t[o],p=null==n?c:n(c);if(c=r||0!==c?c:0,a&&p==p){for(var d=l;d--;)if(e[d]===p)continue t;u.push(c)}else i(e,p,r)||u.push(c)}return u}var Bd=Qa((function(t,e){return Md(t)?Ld(t,yu(e,1,Md,!0)):[]}));function zd(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var Hd=Qa((function(t,e){var n=zd(e);return Md(n)&&(n=void 0),Md(t)?Ld(t,yu(e,1,Md,!0),nd(n)):[]})),Ud=Qa((function(t,e){var n=zd(e);return Md(n)&&(n=void 0),Md(t)?Ld(t,yu(e,1,Md,!0),void 0,n):[]})),Xd=jo((function(t,e){return t/e}),1);function Gd(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?Ru(t,r?0:i,r?i+1:o):Ru(t,r?i+1:0,r?o:i)}function Wd(t){return"function"==typeof t?t:$o}function Yd(t,e){return(No(t)?Ji:ld)(t,Wd(e))}function Vd(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}var Fd=id(!0);function Kd(t,e){return t&&Fd(t,e,Cs)}var qd=ud(Kd,!0);function Zd(t,e){return(No(t)?Vd:qd)(t,Wd(e))}function $d(t){return function(e){var n=bc(e);return"[object Map]"==n?yp(e):"[object Set]"==n?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return Oo(e,(function(e){return[e,t[e]]}))}(e,t(e))}}var Jd=$d(Cs),Qd=$d(Ls),tf=rl({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),ef=/[&<>"']/g,nf=RegExp(ef.source);function rf(t){return(t=iu(t))&&nf.test(t)?t.replace(ef,tf):t}var of=/[\\^$.*+?()[\]{}|]/g,af=RegExp(of.source);function sf(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function uf(t,e){var n=!0;return ld(t,(function(t,r,o){return n=!!e(t,r,o)})),n}var lf=4294967295;function cf(t){return t?Gl(Zo(t),0,lf):0}function pf(t,e){var n=[];return ld(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function df(t){return function(e,n,r){var o=Object(e);if(!ns(e)){var i=nd(n);e=Cs(e),n=function(t){return i(o[t],t,o)}}var a=t(e,n,r);return a>-1?o[i?e[a]:a]:void 0}}var ff=Math.max;function hf(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:Zo(n);return o<0&&(o=ff(r+o,0)),Qi(t,nd(e),o)}var yf=df(hf);function vf(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}var gf=Math.max,_f=Math.min;function mf(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=Zo(n),o=n<0?gf(r+o,0):_f(o,r-1)),Qi(t,nd(e),o,!0)}var bf=df(mf);function Ef(t){return t&&t.length?t[0]:void 0}function xf(t,e){var n=-1,r=ns(t)?Array(t.length):[];return ld(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function wf(t,e){return(No(t)?Oo:xf)(t,nd(e))}var Sf=Bl("floor");function Mf(t){return gu((function(e){var n=e.length,r=n,o=Ri.prototype.thru;for(t&&e.reverse();r--;){var i=e[r];if("function"!=typeof i)throw new TypeError("Expected a function");if(o&&!a&&"wrapper"==ki(i))var a=new Ri([],!0)}for(r=a?r:n;++r<n;){var s=ki(i=e[r]),u="wrapper"==s?Ci(i):void 0;a=u&&Ui(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?a[ki(u[0])].apply(a,u[3]):1==i.length&&Ui(i)?a[s]():a.thru(i)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&No(r))return a.plant(r).value();for(var o=0,i=n?e[o].apply(this,t):r;++o<n;)i=e[o].call(this,i);return i}}))}var Af=Mf(),Tf=Mf(!0);function Of(t,e){return $l(e,(function(e){return ni(t[e])}))}var Nf=Object.prototype.hasOwnProperty,Df=pd((function(t,e,n){Nf.call(t,n)?t[n].push(e):Va(t,n,[e])}));function Pf(t,e){return t>e}function Cf(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=Vo(e),n=Vo(n)),t(e,n)}}var If=Cf(Pf),jf=Cf((function(t,e){return t>=e})),kf=Object.prototype.hasOwnProperty;function Rf(t,e){return null!=t&&kf.call(t,e)}function Lf(t,e){return null!=t&&qp(t,e,Rf)}var Bf=Math.max,zf=Math.min;var Hf="[object String]";function Uf(t){return"string"==typeof t||!No(t)&&wo(t)&&xo(t)==Hf}function Xf(t,e){return Oo(e,(function(e){return t[e]}))}function Gf(t){return null==t?[]:Xf(t,Cs(t))}var Wf=Math.max;var Yf=Math.max;function Vf(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:Zo(n);return o<0&&(o=Yf(r+o,0)),ea(t,e,o)}var Ff=Math.min;function Kf(t,e,n){for(var r=n?kd:na,o=t[0].length,i=t.length,a=i,s=Array(i),u=1/0,l=[];a--;){var c=t[a];a&&e&&(c=Oo(c,ms(e))),u=Ff(c.length,u),s[a]=!n&&(e||o>=120&&c.length>=120)?new lp(a&&c):void 0}c=t[0];var p=-1,d=s[0];t:for(;++p<o&&l.length<u;){var f=c[p],h=e?e(f):f;if(f=n||0!==f?f:0,!(d?pp(d,h):r(l,h,n))){for(a=i;--a;){var y=s[a];if(!(y?pp(y,h):r(t[a],h,n)))continue t}d&&d.push(h),l.push(f)}}return l}function qf(t){return Md(t)?t:[]}var Zf=Qa((function(t){var e=Oo(t,qf);return e.length&&e[0]===t[0]?Kf(e):[]})),$f=Qa((function(t){var e=zd(t),n=Oo(t,qf);return e===zd(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?Kf(n,nd(e)):[]})),Jf=Qa((function(t){var e=zd(t),n=Oo(t,qf);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?Kf(n,void 0,e):[]}));function Qf(t,e){return function(n,r){return function(t,e,n,r){return sd(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}var th=Object.prototype.toString,eh=Qf((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=th.call(e)),t[e]=n}),Ki($o)),nh=Object.prototype,rh=nh.hasOwnProperty,oh=nh.toString,ih=Qf((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=oh.call(e)),rh.call(t,e)?t[e].push(n):t[e]=[n]}),nd);function ah(t,e){return e.length<2?t:lu(t,Ru(e,0,-1))}function sh(t,e,n){var r=null==(t=ah(t,e=au(e,t)))?t:t[uu(zd(e))];return null==r?void 0:wi(r,t,n)}var uh=Qa(sh),lh=Qa((function(t,e,n){var r=-1,o="function"==typeof e,i=ns(t)?Array(t.length):[];return ld(t,(function(t){i[++r]=o?wi(e,t,n):sh(t,e,n)})),i}));var ch=ws&&ws.isArrayBuffer,ph=ch?ms(ch):function(t){return wo(t)&&"[object ArrayBuffer]"==xo(t)};var dh=ws&&ws.isDate,fh=dh?ms(dh):function(t){return wo(t)&&"[object Date]"==xo(t)};var hh=Object.prototype.hasOwnProperty;function yh(t,e){return Hp(t,e)}var vh=po.isFinite;function gh(t){return"number"==typeof t&&t==Zo(t)}var _h="[object Number]";function mh(t){return"number"==typeof t||wo(t)&&xo(t)==_h}var bh=oi?ni:fs;function Eh(t){return null==t}var xh=ws&&ws.isRegExp,wh=xh?ms(xh):function(t){return wo(t)&&"[object RegExp]"==xo(t)},Sh=9007199254740991;function Mh(t){return void 0===t}var Ah=Array.prototype.join;var Th=jl((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Oh=pd((function(t,e,n){Va(t,n,e)}));var Nh=Math.max,Dh=Math.min;var Ph=jl((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ch=Qu("toLowerCase");function Ih(t,e){return t<e}var jh=Cf(Ih),kh=Cf((function(t,e){return t<=e}));function Rh(t,e){var n={};return e=nd(e),sd(t,(function(t,r,o){Va(n,e(t,r,o),t)})),n}function Lh(t,e,n){for(var r=-1,o=t.length;++r<o;){var i=t[r],a=e(i);if(null!=a&&(void 0===s?a==a&&!Mo(a):n(a,s)))var s=a,u=i}return u}function Bh(t,e){for(var n,r=-1,o=t.length;++r<o;){var i=e(t[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}var zh=NaN;function Hh(t,e){var n=null==t?0:t.length;return n?Bh(t,e)/n:zh}var Uh=os((function(t,e,n){Od(t,e,n)})),Xh=Qa((function(t,e){return function(n){return sh(n,t,e)}})),Gh=Qa((function(t,e){return function(n){return sh(t,n,e)}}));function Wh(t,e,n){var r=Cs(e),o=Of(e,r),i=!(Ho(n)&&"chain"in n&&!n.chain),a=ni(t);return Ji(o,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=Li(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,du([this.value()],arguments))})})),t}var Yh=jo((function(t,e){return t*e}),1),Vh="Expected a function";function Fh(t){if("function"!=typeof t)throw new TypeError(Vh);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var Kh="[object Map]",qh="[object Set]",Zh=fo?fo.iterator:void 0;function $h(t){if(!t)return[];if(ns(t))return Uf(t)?Ju(t):Li(t);if(Zh&&t[Zh])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Zh]());var e=bc(t);return(e==Kh?yp:e==qh?vp:Gf)(t)}function Jh(t,e){var n=t.length;if(n)return ya(e+=e<0?n:0,n)?t[e]:void 0}function Qh(t,e){return null==(t=ah(t,e=au(e,t)))||delete t[uu(zd(e))]}function ty(t){return Au(t)?void 0:t}var ey=gu((function(t,e){var n={};if(null==t)return n;var r=!1;e=Oo(e,(function(e){return e=au(e,t),r||(r=e.length>1),e})),Za(t,ic(t),n),r&&(n=sp(n,7,ty));for(var o=e.length;o--;)Qh(n,e[o]);return n}));function ny(t,e,n,r){if(!Ho(t))return t;for(var o=-1,i=(e=au(e,t)).length,a=i-1,s=t;null!=s&&++o<i;){var u=uu(e[o]),l=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var c=s[u];void 0===(l=r?r(c,u,s):void 0)&&(l=Ho(c)?c:ya(e[o+1])?[]:{})}qa(s,u,l),s=s[u]}return t}function ry(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var a=e[r],s=lu(t,a);n(s,a)&&ny(i,au(a,t),s)}return i}function oy(t,e){if(null==t)return{};var n=Oo(ic(t),(function(t){return[t]}));return e=nd(e),ry(t,n,(function(t,n){return e(t,n[0])}))}function iy(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t==t,i=Mo(t),a=void 0!==e,s=null===e,u=e==e,l=Mo(e);if(!s&&!l&&!i&&t>e||i&&a&&u&&!s&&!l||r&&a&&u||!n&&u||!o)return 1;if(!r&&!i&&!l&&t<e||l&&n&&o&&!r&&!i||s&&n&&o||!a&&o||!u)return-1}return 0}function ay(t,e,n){e=e.length?Oo(e,(function(t){return No(t)?function(e){return lu(e,1===t.length?t[0]:t)}:t})):[$o];var r=-1;e=Oo(e,ms(nd));var o=xf(t,(function(t,n,o){var i=Oo(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,a=o.length,s=n.length;++r<a;){var u=iy(o[r],i[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function sy(t){return gu((function(e){return e=Oo(e,ms(nd)),Qa((function(n){var r=this;return t(e,(function(t){return wi(t,r,n)}))}))}))}var uy=sy(Oo),ly=Qa,cy=Math.min,py=ly((function(t,e){var n=(e=1==e.length&&No(e[0])?Oo(e[0],ms(nd)):Oo(yu(e,1),ms(nd))).length;return Qa((function(r){for(var o=-1,i=cy(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return wi(t,this,r)}))})),dy=sy(sf),fy=sy(cp),hy=9007199254740991,yy=Math.floor;function vy(t,e){var n="";if(!t||e<1||e>hy)return n;do{e%2&&(n+=t),(e=yy(e/2))&&(t+=t)}while(e);return n}var gy=td("length"),_y="\\ud800-\\udfff",my="["+_y+"]",by="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ey="\\ud83c[\\udffb-\\udfff]",xy="[^"+_y+"]",wy="(?:\\ud83c[\\udde6-\\uddff]){2}",Sy="[\\ud800-\\udbff][\\udc00-\\udfff]",My="(?:"+by+"|"+Ey+")"+"?",Ay="[\\ufe0e\\ufe0f]?",Ty=Ay+My+("(?:\\u200d(?:"+[xy,wy,Sy].join("|")+")"+Ay+My+")*"),Oy="(?:"+[xy+by+"?",by,wy,Sy,my].join("|")+")",Ny=RegExp(Ey+"(?="+Ey+")|"+Oy+Ty,"g");function Dy(t){return zu(t)?function(t){for(var e=Ny.lastIndex=0;Ny.test(t);)++e;return e}(t):gy(t)}var Py=Math.ceil;function Cy(t,e){var n=(e=void 0===e?" ":Io(e)).length;if(n<2)return n?vy(e,t):e;var r=vy(e,Py(t/Dy(e)));return zu(e)?Lu(Ju(r),0,t).join(""):r.slice(0,t)}var Iy=Math.ceil,jy=Math.floor;var ky=/^\s+/,Ry=po.parseInt;var Ly=Qa((function(t,e){return Ga(t,32,void 0,e,_a(e,da(Ly)))}));Ly.placeholder={};var By=Qa((function(t,e){return Ga(t,64,void 0,e,_a(e,da(By)))}));By.placeholder={};var zy=pd((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Hy=gu((function(t,e){return null==t?{}:function(t,e){return ry(t,e,(function(e,n){return Zp(t,n)}))}(t,e)}));function Uy(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}var Xy=Array.prototype.splice;function Gy(t,e,n,r){var o=r?Uy:ea,i=-1,a=e.length,s=t;for(t===e&&(e=Li(e)),n&&(s=Oo(t,ms(n)));++i<a;)for(var u=0,l=e[i],c=n?n(l):l;(u=o(s,c,u,r))>-1;)s!==t&&Xy.call(s,u,1),Xy.call(t,u,1);return t}function Wy(t,e){return t&&t.length&&e&&e.length?Gy(t,e):t}var Yy=Qa(Wy);var Vy=Array.prototype.splice;function Fy(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;ya(o)?Vy.call(t,o,1):Qh(t,o)}}return t}var Ky=gu((function(t,e){var n=null==t?0:t.length,r=pu(t,e);return Fy(t,Oo(e,(function(t){return ya(t,n)?+t:t})).sort(iy)),r})),qy=Math.floor,Zy=Math.random;function $y(t,e){return t+qy(Zy()*(e-t+1))}var Jy=parseFloat,Qy=Math.min,tv=Math.random;var ev=Math.ceil,nv=Math.max;function rv(t){return function(e,n,r){return r&&"number"!=typeof r&&rs(e,n,r)&&(n=r=void 0),e=qo(e),void 0===n?(n=e,e=0):n=qo(n),function(t,e,n,r){for(var o=-1,i=nv(ev((e-t)/(n||1)),0),a=Array(i);i--;)a[r?i:++o]=t,t+=n;return a}(e,n,r=void 0===r?e<n?1:-1:qo(r),t)}}var ov=rv(),iv=rv(!0),av=gu((function(t,e){return Ga(t,256,void 0,void 0,void 0,e)}));function sv(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function uv(t,e,n){var r=No(t)?nl:sv,o=arguments.length<3;return r(t,nd(e),n,o,ld)}function lv(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}var cv=Array.prototype.reverse;function pv(t){return null==t?t:cv.call(t)}var dv=Bl("round");function fv(t){var e=t.length;return e?t[$y(0,e-1)]:void 0}function hv(t){return fv(Gf(t))}function yv(t,e){var n=-1,r=t.length,o=r-1;for(e=void 0===e?r:e;++n<e;){var i=$y(n,o),a=t[i];t[i]=t[n],t[n]=a}return t.length=e,t}function vv(t,e){return yv(Li(t),Gl(e,0,t.length))}function gv(t,e){var n=Gf(t);return yv(n,Gl(e,0,n.length))}function _v(t){return yv(Li(t))}function mv(t){return yv(Gf(t))}var bv=jl((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function Ev(t,e){var n;return ld(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}var xv=Qa((function(t,e){if(null==t)return[];var n=e.length;return n>1&&rs(t,e[0],e[1])?e=[]:n>2&&rs(e[0],e[1],e[2])&&(e=[e[0]]),ay(t,yu(e,1),[])})),wv=4294967294,Sv=Math.floor,Mv=Math.min;function Av(t,e,n,r){var o=0,i=null==t?0:t.length;if(0===i)return 0;for(var a=(e=n(e))!=e,s=null===e,u=Mo(e),l=void 0===e;o<i;){var c=Sv((o+i)/2),p=n(t[c]),d=void 0!==p,f=null===p,h=p==p,y=Mo(p);if(a)var v=r||h;else v=l?h&&(r||d):s?h&&d&&(r||!f):u?h&&d&&!f&&(r||!y):!f&&!y&&(r?p<=e:p<e);v?o=c+1:i=c}return Mv(i,wv)}var Tv=2147483647;function Ov(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=Tv){for(;r<o;){var i=r+o>>>1,a=t[i];null!==a&&!Mo(a)&&(n?a<=e:a<e)?r=i+1:o=i}return o}return Av(t,e,$o,n)}function Nv(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Fa(s,u)){var u=s;i[o++]=0===a?0:a}}return i}var Dv=Math.max;var Pv=jl((function(t,e,n){return t+(n?" ":"")+tl(e)}));var Cv=jo((function(t,e){return t-e}),0);var Iv=Object.prototype,jv=Iv.hasOwnProperty;function kv(t,e,n,r){return void 0===t||Fa(t,Iv[n])&&!jv.call(r,n)?e:t}var Rv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Lv(t){return"\\"+Rv[t]}var Bv=/<%=([\s\S]+?)%>/g,zv={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:Bv,variable:"",imports:{_:{escape:rf}}},Hv=/\b__p \+= '';/g,Uv=/\b(__p \+=) '' \+/g,Xv=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Gv=/[()=,{}\[\]\/\s]/,Wv=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Yv=/($^)/,Vv=/['\n\r\u2028\u2029\\]/g,Fv=Object.prototype.hasOwnProperty;function Kv(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return Ho(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),bd(t,e,{leading:r,maxWait:e,trailing:o})}function qv(t,e){return e(t)}var Zv=4294967295,$v=Math.min;function Jv(t,e){var n=t;return n instanceof Di&&(n=n.value()),nl(e,(function(t,e){return e.func.apply(e.thisArg,du([t],e.args))}),n)}function Qv(){return Jv(this.__wrapped__,this.__actions__)}var tg=9007199254740991;function eg(t,e){for(var n=t.length;n--&&ea(e,t[n],0)>-1;);return n}function ng(t,e){for(var n=-1,r=t.length;++n<r&&ea(e,t[n],0)>-1;);return n}var rg=/^\s+/;var og=/\w*$/;var ig=rl({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),ag=/&(?:amp|lt|gt|quot|#39);/g,sg=RegExp(ag.source);var ug=uc&&1/vp(new uc([,-0]))[1]==1/0?function(t){return new uc(t)}:Pi,lg=200;function cg(t,e,n){var r=-1,o=na,i=t.length,a=!0,s=[],u=s;if(n)a=!1,o=kd;else if(i>=lg){var l=e?null:ug(t);if(l)return vp(l);a=!1,o=pp,u=new lp}else u=e?[]:s;t:for(;++r<i;){var c=t[r],p=e?e(c):c;if(c=n||0!==c?c:0,a&&p==p){for(var d=u.length;d--;)if(u[d]===p)continue t;e&&u.push(p),s.push(c)}else o(u,p,n)||(u!==s&&u.push(p),s.push(c))}return s}var pg=Qa((function(t){return cg(yu(t,1,Md,!0))})),dg=Qa((function(t){var e=zd(t);return Md(e)&&(e=void 0),cg(yu(t,1,Md,!0),nd(e))})),fg=Qa((function(t){var e=zd(t);return e="function"==typeof e?e:void 0,cg(yu(t,1,Md,!0),void 0,e)}));var hg=0;var yg=Math.max;function vg(t){if(!t||!t.length)return[];var e=0;return t=$l(t,(function(t){if(Md(t))return e=yg(t.length,e),!0})),ss(e,(function(e){return Oo(t,td(e))}))}function gg(t,e){if(!t||!t.length)return[];var n=vg(t);return null==e?n:Oo(n,(function(t){return wi(e,void 0,t)}))}function _g(t,e,n,r){return ny(t,e,n(lu(t,e)),r)}var mg=jl((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}));var bg=Qa((function(t,e){return Md(t)?Ld(t,e):[]}));var Eg=gu((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return pu(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Di&&ya(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:qv,args:[o],thisArg:void 0}),new Ri(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(o)}));function xg(t,e,n){var r=t.length;if(r<2)return r?cg(t[0]):[];for(var o=-1,i=Array(r);++o<r;)for(var a=t[o],s=-1;++s<r;)s!=o&&(i[o]=Ld(i[o]||a,t[s],e,n));return cg(yu(i,1),e,n)}var wg=Qa((function(t){return xg($l(t,Md))})),Sg=Qa((function(t){var e=zd(t);return Md(e)&&(e=void 0),xg($l(t,Md),nd(e))})),Mg=Qa((function(t){var e=zd(t);return e="function"==typeof e?e:void 0,xg($l(t,Md),void 0,e)})),Ag=Qa(vg);function Tg(t,e,n){for(var r=-1,o=t.length,i=e.length,a={};++r<o;){var s=r<i?e[r]:void 0;n(a,t[r],s)}return a}var Og=Qa((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,gg(t,n)})),Ng={chunk:function(t,e,n){e=(n?rs(t,e,n):void 0===e)?1:Xl(Zo(e),0);var r=null==t?0:t.length;if(!r||e<1)return[];for(var o=0,i=0,a=Array(Ul(r/e));o<r;)a[i++]=Ru(t,o,o+=e);return a},compact:function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},concat:function(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return du(No(n)?Li(n):[n],yu(e,1))},difference:Bd,differenceBy:Hd,differenceWith:Ud,drop:function(t,e,n){var r=null==t?0:t.length;return r?Ru(t,(e=n||void 0===e?1:Zo(e))<0?0:e,r):[]},dropRight:function(t,e,n){var r=null==t?0:t.length;return r?Ru(t,0,(e=r-(e=n||void 0===e?1:Zo(e)))<0?0:e):[]},dropRightWhile:function(t,e){return t&&t.length?Gd(t,nd(e),!0,!0):[]},dropWhile:function(t,e){return t&&t.length?Gd(t,nd(e),!0):[]},fill:function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&rs(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=Zo(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:Zo(r))<0&&(r+=o),r=n>r?0:cf(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},findIndex:hf,findLastIndex:mf,first:Ef,flatten:vu,flattenDeep:function(t){return(null==t?0:t.length)?yu(t,Infinity):[]},flattenDepth:function(t,e){return(null==t?0:t.length)?yu(t,e=void 0===e?1:Zo(e)):[]},fromPairs:function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},head:Ef,indexOf:Vf,initial:function(t){return(null==t?0:t.length)?Ru(t,0,-1):[]},intersection:Zf,intersectionBy:$f,intersectionWith:Jf,join:function(t,e){return null==t?"":Ah.call(t,e)},last:zd,lastIndexOf:function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=Zo(n))<0?Nh(r+o,0):Dh(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Qi(t,ta,o,!0)},nth:function(t,e){return t&&t.length?Jh(t,Zo(e)):void 0},pull:Yy,pullAll:Wy,pullAllBy:function(t,e,n){return t&&t.length&&e&&e.length?Gy(t,e,nd(n)):t},pullAllWith:function(t,e,n){return t&&t.length&&e&&e.length?Gy(t,e,void 0,n):t},pullAt:Ky,remove:function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=nd(e);++r<i;){var a=t[r];e(a,r,t)&&(n.push(a),o.push(r))}return Fy(t,o),n},reverse:pv,slice:function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&rs(t,e,n)?(e=0,n=r):(e=null==e?0:Zo(e),n=void 0===n?r:Zo(n)),Ru(t,e,n)):[]},sortedIndex:function(t,e){return Ov(t,e)},sortedIndexBy:function(t,e,n){return Av(t,e,nd(n))},sortedIndexOf:function(t,e){var n=null==t?0:t.length;if(n){var r=Ov(t,e);if(r<n&&Fa(t[r],e))return r}return-1},sortedLastIndex:function(t,e){return Ov(t,e,!0)},sortedLastIndexBy:function(t,e,n){return Av(t,e,nd(n),!0)},sortedLastIndexOf:function(t,e){if(null==t?0:t.length){var n=Ov(t,e,!0)-1;if(Fa(t[n],e))return n}return-1},sortedUniq:function(t){return t&&t.length?Nv(t):[]},sortedUniqBy:function(t,e){return t&&t.length?Nv(t,nd(e)):[]},tail:function(t){var e=null==t?0:t.length;return e?Ru(t,1,e):[]},take:function(t,e,n){return t&&t.length?Ru(t,0,(e=n||void 0===e?1:Zo(e))<0?0:e):[]},takeRight:function(t,e,n){var r=null==t?0:t.length;return r?Ru(t,(e=r-(e=n||void 0===e?1:Zo(e)))<0?0:e,r):[]},takeRightWhile:function(t,e){return t&&t.length?Gd(t,nd(e),!1,!0):[]},takeWhile:function(t,e){return t&&t.length?Gd(t,nd(e)):[]},union:pg,unionBy:dg,unionWith:fg,uniq:function(t){return t&&t.length?cg(t):[]},uniqBy:function(t,e){return t&&t.length?cg(t,nd(e)):[]},uniqWith:function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?cg(t,void 0,e):[]},unzip:vg,unzipWith:gg,without:bg,xor:wg,xorBy:Sg,xorWith:Mg,zip:Ag,zipObject:function(t,e){return Tg(t||[],e||[],qa)},zipObjectDeep:function(t,e){return Tg(t||[],e||[],ny)},zipWith:Og},Dg={countBy:fd,each:Yd,eachRight:Zd,every:function(t,e,n){var r=No(t)?sf:uf;return n&&rs(t,e,n)&&(e=void 0),r(t,nd(e))},filter:function(t,e){return(No(t)?$l:pf)(t,nd(e))},find:yf,findLast:bf,flatMap:function(t,e){return yu(wf(t,e),1)},flatMapDeep:function(t,e){return yu(wf(t,e),Infinity)},flatMapDepth:function(t,e,n){return n=void 0===n?1:Zo(n),yu(wf(t,e),n)},forEach:Yd,forEachRight:Zd,groupBy:Df,includes:function(t,e,n,r){t=ns(t)?t:Gf(t),n=n&&!r?Zo(n):0;var o=t.length;return n<0&&(n=Wf(o+n,0)),Uf(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&ea(t,e,n)>-1},invokeMap:lh,keyBy:Oh,map:wf,orderBy:function(t,e,n,r){return null==t?[]:(No(e)||(e=null==e?[]:[e]),No(n=r?void 0:n)||(n=null==n?[]:[n]),ay(t,e,n))},partition:zy,reduce:uv,reduceRight:function(t,e,n){var r=No(t)?lv:sv,o=arguments.length<3;return r(t,nd(e),n,o,qd)},reject:function(t,e){return(No(t)?$l:pf)(t,Fh(nd(e)))},sample:function(t){return(No(t)?fv:hv)(t)},sampleSize:function(t,e,n){return e=(n?rs(t,e,n):void 0===e)?1:Zo(e),(No(t)?vv:gv)(t,e)},shuffle:function(t){return(No(t)?_v:mv)(t)},size:function(t){if(null==t)return 0;if(ns(t))return Uf(t)?Dy(t):t.length;var e=bc(t);return"[object Map]"==e||"[object Set]"==e?t.size:Ps(t).length},some:function(t,e,n){var r=No(t)?cp:Ev;return n&&rs(t,e,n)&&(e=void 0),r(t,nd(e))},sortBy:xv},Pg=vd,Cg={after:function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=Zo(t),function(){if(--t<1)return e.apply(this,arguments)}},ary:Ya,before:Cu,bind:Iu,bindKey:ku,curry:hd,curryRight:yd,debounce:bd,defer:Id,delay:jd,flip:function(t){return Ga(t,512)},memoize:eu,negate:Fh,once:function(t){return Cu(2,t)},overArgs:py,partial:Ly,partialRight:By,rearg:av,rest:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return Qa(t,e=void 0===e?e:Zo(e))},spread:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:Dv(Zo(e),0),Qa((function(n){var r=n[e],o=Lu(n,0,e);return r&&du(o,r),wi(t,this,o)}))},throttle:Kv,unary:function(t){return Ya(t,1)},wrap:function(t,e){return Ly(Wd(e),t)}},Ig={castArray:function(){if(!arguments.length)return[];var t=arguments[0];return No(t)?t:[t]},clone:function(t){return sp(t,4)},cloneDeep:up,cloneDeepWith:function(t,e){return sp(t,5,e="function"==typeof e?e:void 0)},cloneWith:function(t,e){return sp(t,4,e="function"==typeof e?e:void 0)},conformsTo:function(t,e){return null==e||rd(t,e,Cs(e))},eq:Fa,gt:If,gte:jf,isArguments:ds,isArray:No,isArrayBuffer:ph,isArrayLike:ns,isArrayLikeObject:Md,isBoolean:function(t){return!0===t||!1===t||wo(t)&&"[object Boolean]"==xo(t)},isBuffer:gs,isDate:fh,isElement:function(t){return wo(t)&&1===t.nodeType&&!Au(t)},isEmpty:function(t){if(null==t)return!0;if(ns(t)&&(No(t)||"string"==typeof t||"function"==typeof t.splice||gs(t)||Ms(t)||ds(t)))return!t.length;var e=bc(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(as(t))return!Ps(t).length;for(var n in t)if(hh.call(t,n))return!1;return!0},isEqual:yh,isEqualWith:function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?Hp(t,e,void 0,n):!!r},isError:Nu,isFinite:function(t){return"number"==typeof t&&vh(t)},isFunction:ni,isInteger:gh,isLength:es,isMap:Zc,isMatch:function(t,e){return t===e||Gp(t,e,Yp(e))},isMatchWith:function(t,e,n){return n="function"==typeof n?n:void 0,Gp(t,e,Yp(e),n)},isNaN:function(t){return mh(t)&&t!=+t},isNative:function(t){if(bh(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return hi(t)},isNil:Eh,isNull:function(t){return null===t},isNumber:mh,isObject:Ho,isObjectLike:wo,isPlainObject:Au,isRegExp:wh,isSafeInteger:function(t){return gh(t)&&t>=-9007199254740991&&t<=Sh},isSet:Jc,isString:Uf,isSymbol:Mo,isTypedArray:Ms,isUndefined:Mh,isWeakMap:function(t){return wo(t)&&"[object WeakMap]"==bc(t)},isWeakSet:function(t){return wo(t)&&"[object WeakSet]"==xo(t)},lt:jh,lte:kh,toArray:$h,toFinite:qo,toInteger:Zo,toLength:cf,toNumber:Vo,toPlainObject:Td,toSafeInteger:function(t){return t?Gl(Zo(t),-9007199254740991,tg):0===t?t:0},toString:iu},jg={add:ko,ceil:zl,divide:Xd,floor:Sf,max:function(t){return t&&t.length?Lh(t,$o,Pf):void 0},maxBy:function(t,e){return t&&t.length?Lh(t,nd(e),Pf):void 0},mean:function(t){return Hh(t,$o)},meanBy:function(t,e){return Hh(t,nd(e))},min:function(t){return t&&t.length?Lh(t,$o,Ih):void 0},minBy:function(t,e){return t&&t.length?Lh(t,nd(e),Ih):void 0},multiply:Yh,round:dv,subtract:Cv,sum:function(t){return t&&t.length?Bh(t,$o):0},sumBy:function(t,e){return t&&t.length?Bh(t,nd(e)):0}},kg=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=Vo(n))==n?n:0),void 0!==e&&(e=(e=Vo(e))==e?e:0),Gl(Vo(t),e,n)},Rg=function(t,e,n){return e=qo(e),void 0===n?(n=e,e=0):n=qo(n),function(t,e,n){return t>=zf(e,n)&&t<Bf(e,n)}(t=Vo(t),e,n)},Lg=function(t,e,n){if(n&&"boolean"!=typeof n&&rs(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=qo(t),void 0===e?(e=t,t=0):e=qo(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=tv();return Qy(t+o*(e-t+Jy("1e-"+((o+"").length-1))),e)}return $y(t,e)},Bg={assign:js,assignIn:Bs,assignInWith:zs,assignWith:Hs,at:_u,create:function(t,e){var n=bi(t);return null==e?n:Yl(n,e)},defaults:wd,defaultsDeep:Pd,entries:Jd,entriesIn:Qd,extend:Bs,extendWith:zs,findKey:function(t,e){return vf(t,nd(e),sd)},findLastKey:function(t,e){return vf(t,nd(e),Kd)},forIn:function(t,e){return null==t?t:ad(t,Wd(e),Ls)},forInRight:function(t,e){return null==t?t:Fd(t,Wd(e),Ls)},forOwn:function(t,e){return t&&sd(t,Wd(e))},forOwnRight:function(t,e){return t&&Kd(t,Wd(e))},functions:function(t){return null==t?[]:Of(t,Cs(t))},functionsIn:function(t){return null==t?[]:Of(t,Ls(t))},get:cu,has:Lf,hasIn:Zp,invert:eh,invertBy:ih,invoke:uh,keys:Cs,keysIn:Ls,mapKeys:Rh,mapValues:function(t,e){var n={};return e=nd(e),sd(t,(function(t,r,o){Va(n,r,e(t,r,o))})),n},merge:Uh,mergeWith:Dd,omit:ey,omitBy:function(t,e){return oy(t,Fh(nd(e)))},pick:Hy,pickBy:oy,result:function(t,e,n){var r=-1,o=(e=au(e,t)).length;for(o||(o=1,t=void 0);++r<o;){var i=null==t?void 0:t[uu(e[r])];void 0===i&&(r=o,i=n),t=ni(i)?i.call(t):i}return t},set:function(t,e,n){return null==t?t:ny(t,e,n)},setWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:ny(t,e,n,r)},toPairs:Jd,toPairsIn:Qd,transform:function(t,e,n){var r=No(t),o=r||gs(t)||Ms(t);if(e=nd(e),null==n){var i=t&&t.constructor;n=o?r?new i:[]:Ho(t)&&ni(i)?bi(mu(t)):{}}return(o?Ji:sd)(t,(function(t,r,o){return e(n,t,r,o)})),n},unset:function(t,e){return null==t||Qh(t,e)},update:function(t,e,n){return null==t?t:_g(t,e,Wd(n))},updateWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:_g(t,e,Wd(n),r)},values:Gf,valuesIn:function(t){return null==t?[]:Xf(t,Ls(t))}},zg={at:Eg,chain:Hl,commit:function(){return new Ri(this.value(),this.__chain__)},lodash:Hi,next:function(){void 0===this.__values__&&(this.__values__=$h(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},plant:function(t){for(var e,n=this;n instanceof Oi;){var r=Bi(n);r.__index__=0,r.__values__=void 0,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},reverse:function(){var t=this.__wrapped__;if(t instanceof Di){var e=t;return this.__actions__.length&&(e=new Di(this)),(e=e.reverse()).__actions__.push({func:qv,args:[pv],thisArg:void 0}),new Ri(e,this.__chain__)}return this.thru(pv)},tap:function(t,e){return e(t),t},thru:qv,toIterator:function(){return this},toJSON:Qv,value:Qv,valueOf:Qv,wrapperChain:function(){return Hl(this)}},Hg={camelCase:kl,capitalize:el,deburr:sl,endsWith:function(t,e,n){t=iu(t),e=Io(e);var r=t.length,o=n=void 0===n?r:Gl(Zo(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},escape:rf,escapeRegExp:function(t){return(t=iu(t))&&af.test(t)?t.replace(of,"\\$&"):t},kebabCase:Th,lowerCase:Ph,lowerFirst:Ch,pad:function(t,e,n){t=iu(t);var r=(e=Zo(e))?Dy(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return Cy(jy(o),n)+t+Cy(Iy(o),n)},padEnd:function(t,e,n){t=iu(t);var r=(e=Zo(e))?Dy(t):0;return e&&r<e?t+Cy(e-r,n):t},padStart:function(t,e,n){t=iu(t);var r=(e=Zo(e))?Dy(t):0;return e&&r<e?Cy(e-r,n)+t:t},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),Ry(iu(t).replace(ky,""),e||0)},repeat:function(t,e,n){return e=(n?rs(t,e,n):void 0===e)?1:Zo(e),vy(iu(t),e)},replace:function(){var t=arguments,e=iu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},snakeCase:bv,split:function(t,e,n){return n&&"number"!=typeof n&&rs(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=iu(t))&&("string"==typeof e||null!=e&&!wh(e))&&!(e=Io(e))&&zu(t)?Lu(Ju(t),0,n):t.split(e,n):[]},startCase:Pv,startsWith:function(t,e,n){return t=iu(t),n=null==n?0:Gl(Zo(n),0,t.length),e=Io(e),t.slice(n,n+e.length)==e},template:function(t,e,n){var r=zv.imports._.templateSettings||zv;n&&rs(t,e,n)&&(e=void 0),t=iu(t),e=zs({},e,r,kv);var o,i,a=zs({},e.imports,r.imports,kv),s=Cs(a),u=Xf(a,s),l=0,c=e.interpolate||Yv,p="__p += '",d=RegExp((e.escape||Yv).source+"|"+c.source+"|"+(c===Bv?Wv:Yv).source+"|"+(e.evaluate||Yv).source+"|$","g"),f=Fv.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(d,(function(e,n,r,a,s,u){return r||(r=a),p+=t.slice(l,u).replace(Vv,Lv),n&&(o=!0,p+="' +\n__e("+n+") +\n'"),s&&(i=!0,p+="';\n"+s+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),p+="';\n";var h=Fv.call(e,"variable")&&e.variable;if(h){if(Gv.test(h))throw new Error("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(i?p.replace(Hv,""):p).replace(Uv,"$1").replace(Xv,"$1;"),p="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var y=Du((function(){return Function(s,f+"return "+p).apply(void 0,u)}));if(y.source=p,Nu(y))throw y;return y},templateSettings:zv,toLower:function(t){return iu(t).toLowerCase()},toUpper:function(t){return iu(t).toUpperCase()},trim:function(t,e,n){if((t=iu(t))&&(n||void 0===e))return zo(t);if(!t||!(e=Io(e)))return t;var r=Ju(t),o=Ju(e);return Lu(r,ng(r,o),eg(r,o)+1).join("")},trimEnd:function(t,e,n){if((t=iu(t))&&(n||void 0===e))return t.slice(0,Lo(t)+1);if(!t||!(e=Io(e)))return t;var r=Ju(t);return Lu(r,0,eg(r,Ju(e))+1).join("")},trimStart:function(t,e,n){if((t=iu(t))&&(n||void 0===e))return t.replace(rg,"");if(!t||!(e=Io(e)))return t;var r=Ju(t);return Lu(r,ng(r,Ju(e))).join("")},truncate:function(t,e){var n=30,r="...";if(Ho(e)){var o="separator"in e?e.separator:o;n="length"in e?Zo(e.length):n,r="omission"in e?Io(e.omission):r}var i=(t=iu(t)).length;if(zu(t)){var a=Ju(t);i=a.length}if(n>=i)return t;var s=n-Dy(r);if(s<1)return r;var u=a?Lu(a,0,s).join(""):t.slice(0,s);if(void 0===o)return u+r;if(a&&(s+=u.length-s),wh(o)){if(t.slice(s).search(o)){var l,c=u;for(o.global||(o=RegExp(o.source,iu(og.exec(o))+"g")),o.lastIndex=0;l=o.exec(c);)var p=l.index;u=u.slice(0,void 0===p?s:p)}}else if(t.indexOf(Io(o),s)!=s){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+r},unescape:function(t){return(t=iu(t))&&sg.test(t)?t.replace(ag,ig):t},upperCase:mg,upperFirst:tl,words:Cl},Ug={attempt:Du,bindAll:ju,cond:function(t){var e=null==t?0:t.length,n=nd;return t=e?Oo(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],Qa((function(n){for(var r=-1;++r<e;){var o=t[r];if(wi(o[0],this,n))return wi(o[1],this,n)}}))},conforms:function(t){return function(t){var e=Cs(t);return function(n){return rd(n,t,e)}}(sp(t,1))},constant:Ki,defaultTo:function(t,e){return null==t||t!=t?e:t},flow:Af,flowRight:Tf,identity:$o,iteratee:function(t){return nd("function"==typeof t?t:sp(t,1))},matches:function(t){return Fp(sp(t,1))},matchesProperty:function(t,e){return Qp(t,sp(e,1))},method:Xh,methodOf:Gh,mixin:Wh,noop:Pi,nthArg:function(t){return t=Zo(t),Qa((function(e){return Jh(e,t)}))},over:uy,overEvery:dy,overSome:fy,property:ed,propertyOf:function(t){return function(e){return null==t?void 0:lu(t,e)}},range:ov,rangeRight:iv,stubArray:Jl,stubFalse:fs,stubObject:function(){return{}},stubString:function(){return""},stubTrue:function(){return!0},times:function(t,e){if((t=Zo(t))<1||t>9007199254740991)return[];var n=Zv,r=$v(t,Zv);e=Wd(e),t-=Zv;for(var o=ss(r,e);++n<t;)e(n);return o},toPath:function(t){return No(t)?Oo(t,uu):Mo(t)?[t]:Li(ou(iu(t)))},uniqueId:function(t){var e=++hg;return iu(t)+e}};var Xg=Math.max,Gg=Math.min;var Wg=Math.min;
15
+ ***************************************************************************** */var N=function(){return N=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},N.apply(this,arguments)};function P(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function C(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function I(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(C(arguments[e]));return t}var L=Symbol("mobx did run lazy initializers"),j=Symbol("mobx pending decorators"),k={},R={};function B(t){var e,n;if(!0!==t[L]){var r=t[j];if(r){y(t,L,!0);var o=I(Object.getOwnPropertySymbols(r),Object.keys(r));try{for(var i=P(o),a=i.next();!a.done;a=i.next()){var s=r[a.value];s.propertyCreator(t,s.prop,s.descriptor,s.decoratorTarget,s.decoratorArguments)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}}}function z(t,e){return function(){var n,r,o=function(r,o,i,a){if(!0===a)return e(r,o,i,r,n),null;if(!Object.prototype.hasOwnProperty.call(r,j)){var s=r[j];y(r,j,N({},s))}return r[j][o]={prop:o,propertyCreator:e,descriptor:i,decoratorTarget:r,decoratorArguments:n},function(t,e){var n=e?k:R;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return B(this),this[t]},set:function(e){B(this),this[t]=e}})}(o,t)};return(2===(r=arguments).length||3===r.length)&&("string"==typeof r[1]||"symbol"==typeof r[1])||4===r.length&&!0===r[3]?(n=s,o.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),o)}}function U(t,e,n){return we(t)?t:Array.isArray(t)?$.array(t,{name:n}):v(t)?$.object(t,void 0,{name:n}):_(t)?$.map(t,{name:n}):m(t)?$.set(t,{name:n}):t}function X(t){return t}function H(t){p(t);var e=z(!0,(function(e,n,r,o,i){var a=r?r.initializer?r.initializer.call(e):r.value:void 0;un(e).addObservableProp(n,a,t)})),n=("undefined"!=typeof process&&process.env,e);return n.enhancer=t,n}var W={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function G(t){return null==t?W:"string"==typeof t?{name:t,deep:!0,proxy:!0}:t}Object.freeze(W);var Y=H(U),V=H((function(t,e,n){return null==t||fn(t)||Je(t)||nn(t)||an(t)?t:Array.isArray(t)?$.array(t,{name:n,deep:!1}):v(t)?$.object(t,void 0,{name:n,deep:!1}):_(t)?$.map(t,{name:n,deep:!1}):m(t)?$.set(t,{name:n,deep:!1}):c(!1)})),F=H(X),K=H((function(t,e,n){return _n(t,e)?e:t}));function q(t){return t.defaultDecorator?t.defaultDecorator.enhancer:!1===t.deep?X:U}var Z={box:function(t,e){arguments.length>2&&J("box");var n=G(e);return new St(t,q(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&J("array");var n=G(e);return function(t,e,n,r){void 0===n&&(n="ObservableArray@"+l());void 0===r&&(r=!1);var o=new Ke(n,e,r);!function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}(o.values,w,o);var i=new Proxy(o.values,Fe);if(o.proxy=i,t&&t.length){var a=Mt(!0);o.spliceWithArray(0,0,t),wt(a)}return i}(t,q(n),n.name)},map:function(t,e){arguments.length>2&&J("map");var n=G(e);return new en(t,q(n),n.name)},set:function(t,e){arguments.length>2&&J("set");var n=G(e);return new on(t,q(n),n.name)},object:function(t,e,n){"string"==typeof arguments[1]&&J("object");var r=G(n);if(!1===r.proxy)return pe({},t,e,r);var o=de(r),i=function(t){var e=new Proxy(t,Ue);return t[w].proxy=e,e}(pe({},void 0,void 0,r));return fe(i,t,e,o),i},ref:F,shallow:V,deep:Y,struct:K},$=function(t,e,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return Y.apply(null,arguments);if(we(t))return t;var r=v(t)?$.object(t,e,n):Array.isArray(t)?$.array(t,e):_(t)?$.map(t,e):m(t)?$.set(t,e):t;if(r!==t)return r;c(!1)};function J(t){c("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}Object.keys(Z).forEach((function(t){return $[t]=Z[t]}));var Q,tt,et=z(!1,(function(t,e,n,r,o){var i=n.get,a=n.set,s=o[0]||{};un(t).addComputedProp(t,e,N({get:i,set:a,context:t},s))})),nt=et({equals:O.structural}),rt=function(t,e,n){if("string"==typeof e)return et.apply(null,arguments);if(null!==t&&"object"==typeof t&&1===arguments.length)return et.apply(null,arguments);var r="object"==typeof e?e:{};return r.get=t,r.set="function"==typeof e?e:r.set,r.name=r.name||t.name||"",new At(r)};rt.struct=nt,function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"}(Q||(Q={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(tt||(tt={}));var ot=function(t){this.cause=t};function it(t){return t instanceof ot}function at(t){switch(t.dependenciesState){case Q.UP_TO_DATE:return!1;case Q.NOT_TRACKING:case Q.STALE:return!0;case Q.POSSIBLY_STALE:for(var e=ft(!0),n=pt(),r=t.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(Ot(a)){if(jt.disableErrorBoundaries)a.get();else try{a.get()}catch(t){return dt(n),ht(e),!0}if(t.dependenciesState===Q.STALE)return dt(n),ht(e),!0}}return vt(t),dt(n),ht(e),!1}}function st(t){var e=t.observers.size>0;jt.computationDepth>0&&e&&c(!1),jt.allowStateChanges||!e&&"strict"!==jt.enforceActions||c(!1)}function ut(t,e,n){var r=ft(!0);vt(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++jt.runId;var o,i=jt.trackingDerivation;if(jt.trackingDerivation=t,!0===jt.disableErrorBoundaries)o=e.call(n);else try{o=e.call(n)}catch(t){o=new ot(t)}return jt.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,r=Q.UP_TO_DATE,o=0,i=t.unboundDepsCount,a=0;a<i;a++){0===(s=n[a]).diffValue&&(s.diffValue=1,o!==a&&(n[o]=s),o++),s.dependenciesState>r&&(r=s.dependenciesState)}n.length=o,t.newObserving=null,i=e.length;for(;i--;){0===(s=e[i]).diffValue&&Rt(s,t),s.diffValue=0}for(;o--;){var s;1===(s=n[o]).diffValue&&(s.diffValue=0,kt(s,t))}r!==Q.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}(t),ht(r),o}function lt(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)Rt(e[n],t);t.dependenciesState=Q.NOT_TRACKING}function ct(t){var e=pt();try{return t()}finally{dt(e)}}function pt(){var t=jt.trackingDerivation;return jt.trackingDerivation=null,t}function dt(t){jt.trackingDerivation=t}function ft(t){var e=jt.allowStateReads;return jt.allowStateReads=t,e}function ht(t){jt.allowStateReads=t}function vt(t){if(t.dependenciesState!==Q.UP_TO_DATE){t.dependenciesState=Q.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Q.UP_TO_DATE}}var yt=0,gt=1,_t=Object.getOwnPropertyDescriptor((function(){}),"name");function mt(t,e,n){var r=function(){return bt(t,e,n||this,arguments)};return r.isMobxAction=!0,r}function bt(t,e,n,r){var o=Et();try{return e.apply(n,r)}catch(t){throw o.error=t,t}finally{xt(o)}}function Et(t,e,n){var r=pt();zt();var o={prevDerivation:r,prevAllowStateChanges:Mt(!0),prevAllowStateReads:ft(!0),notifySpy:false,startTime:0,actionId:gt++,parentActionId:yt};return yt=o.actionId,o}function xt(t){yt!==t.actionId&&c("invalid action stack. did you forget to finish an action?"),yt=t.parentActionId,void 0!==t.error&&(jt.suppressReactionErrors=!0),wt(t.prevAllowStateChanges),ht(t.prevAllowStateReads),Ut(),dt(t.prevDerivation),t.notifySpy,jt.suppressReactionErrors=!1}function Mt(t){var e=jt.allowStateChanges;return jt.allowStateChanges=t,e}function wt(t){jt.allowStateChanges=t}_t&&_t.configurable;var St=function(t){function e(e,n,r,o,i){void 0===r&&(r="ObservableValue@"+l()),void 0===o&&(o=!0),void 0===i&&(i=O.default);var a=t.call(this,r)||this;return a.enhancer=n,a.name=r,a.equals=i,a.hasUnreportedChange=!1,a.value=n(e,void 0,r),a}return function(t,e){function n(){this.constructor=t}D(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.prototype.set=function(t){this.value;if((t=this.prepareNewValue(t))!==jt.UNCHANGED){false,this.setNewValue(t)}},e.prototype.prepareNewValue=function(t){if(st(this),Xe(this)){var e=We(this,{object:this,type:"update",newValue:t});if(!e)return jt.UNCHANGED;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.equals(this.value,t)?jt.UNCHANGED:t},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),Ge(this)&&Ve(this,{type:"update",object:this,newValue:t,oldValue:e})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return He(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),Ye(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return x(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(S),Tt=g("ObservableValue",St),At=function(){function t(t){this.dependenciesState=Q.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Q.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+l(),this.value=new ot(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=tt.NONE,p(t.get,"missing option for computed: get"),this.derivation=t.get,this.name=t.name||"ComputedValue@"+l(),t.set&&(this.setter=mt(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?O.structural:O.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==Q.UP_TO_DATE)return;t.lowestObserverState=Q.POSSIBLY_STALE,t.observers.forEach((function(e){e.dependenciesState===Q.UP_TO_DATE&&(e.dependenciesState=Q.POSSIBLY_STALE,e.isTracing!==tt.NONE&&Ht(e,t),e.onBecomeStale())}))}(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.get=function(){this.isComputing&&c("Cycle detected in computation "+this.name+": "+this.derivation),0!==jt.inBatch||0!==this.observers.size||this.keepAlive?(Xt(this),at(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===Q.STALE)return;t.lowestObserverState=Q.STALE,t.observers.forEach((function(e){e.dependenciesState===Q.POSSIBLY_STALE?e.dependenciesState=Q.STALE:e.dependenciesState===Q.UP_TO_DATE&&(t.lowestObserverState=Q.UP_TO_DATE)}))}(this)):at(this)&&(this.warnAboutUntrackedRead(),zt(),this.value=this.computeValue(!1),Ut());var t=this.value;if(it(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(it(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){p(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,t)}finally{this.isRunningSetter=!1}}else p(!1,!1)},t.prototype.trackAndCompute=function(){var t=this.value,e=this.dependenciesState===Q.NOT_TRACKING,n=this.computeValue(!0),r=e||it(t)||it(n)||!this.equals(t,n);return r&&(this.value=n),r},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,jt.computationDepth++,t)e=ut(this,this.derivation,this.scope);else if(!0===jt.disableErrorBoundaries)e=this.derivation.call(this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new ot(t)}return jt.computationDepth--,this.isComputing=!1,e},t.prototype.suspend=function(){this.keepAlive||(lt(this),this.value=void 0)},t.prototype.observe=function(t,e){var n=this,r=!0,o=void 0;return re((function(){var i=n.get();if(!r||e){var a=pt();t({type:"update",object:n,newValue:i,oldValue:o}),dt(a)}r=!1,o=i}))},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return x(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),Ot=g("ComputedValue",At),Dt=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],Nt=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},Pt={};function Ct(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:Pt}var It=!0,Lt=!1,jt=function(){var t=Ct();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(It=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new Nt).version&&(It=!1),It?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Nt):(setTimeout((function(){Lt||c("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Nt)}();function kt(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function Rt(t,e){t.observers.delete(e),0===t.observers.size&&Bt(t)}function Bt(t){!1===t.isPendingUnobservation&&(t.isPendingUnobservation=!0,jt.pendingUnobservations.push(t))}function zt(){jt.inBatch++}function Ut(){if(0==--jt.inBatch){Ft();for(var t=jt.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.size&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof At&&n.suspend())}jt.pendingUnobservations=[]}}function Xt(t){var e=jt.trackingDerivation;return null!==e?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(0===t.observers.size&&jt.inBatch>0&&Bt(t),!1)}function Ht(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===tt.BREAK){var n=[];Wt(he(t),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(t instanceof At?t.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function Wt(t,e,n){e.length>=1e3?e.push("(and many more)"):(e.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return Wt(t,e,n+1)})))}var Gt=function(){function t(t,e,n,r){void 0===t&&(t="Reaction@"+l()),void 0===r&&(r=!1),this.name=t,this.onInvalidate=e,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=Q.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+l(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=tt.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,jt.pendingReactions.push(this),Ft())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(zt(),this._isScheduled=!1,at(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(t){this.reportExceptionInDerivation(t)}}Ut()}},t.prototype.track=function(t){if(!this.isDisposed){zt(),this._isRunning=!0;var e=ut(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&lt(this),it(e)&&this.reportExceptionInDerivation(e.cause),Ut()}},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{if(jt.disableErrorBoundaries)throw t;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";jt.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,t),jt.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(zt(),lt(this),Ut()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t[w]=this,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(t){void 0===t&&(t=!1),je(this,t)},t}();var Yt=100,Vt=function(t){return t()};function Ft(){jt.inBatch>0||jt.isRunningReactions||Vt(Kt)}function Kt(){jt.isRunningReactions=!0;for(var t=jt.pendingReactions,e=0;t.length>0;){++e===Yt&&(console.error("Reaction doesn't converge to a stable state after "+Yt+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}jt.isRunningReactions=!1}var qt=g("Reaction",Gt);function Zt(t){var e=Vt;Vt=function(n){return t((function(){return e(n)}))}}function $t(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}function Jt(){c(!1)}function Qt(t){return function(e,n,r){if(r){if(r.value)return{value:mt(t,r.value),enumerable:!1,configurable:!0,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return mt(t,o.call(this))}}}return function(t){return function(e,n,r){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(e){y(this,n,te(t,e))}})}}(t).apply(this,arguments)}}var te=function(t,e,n,r){return 1===arguments.length&&"function"==typeof t?mt(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?mt(t,e):1===arguments.length&&"string"==typeof t?Qt(t):!0!==r?Qt(e).apply(null,arguments):void y(t,e,mt(t.name||e,n.value,this))};function ee(t,e){"string"==typeof t||t.name;return bt(0,"function"==typeof t?t:e,this,void 0)}function ne(t,e,n){y(t,e,mt(e,n.bind(t)))}function re(t,e){void 0===e&&(e=u);var n,r=e&&e.name||t.name||"Autorun@"+l();if(!e.scheduler&&!e.delay)n=new Gt(r,(function(){this.track(a)}),e.onError,e.requiresObservable);else{var o=ie(e),i=!1;n=new Gt(r,(function(){i||(i=!0,o((function(){i=!1,n.isDisposed||n.track(a)})))}),e.onError,e.requiresObservable)}function a(){t(n)}return n.schedule(),n.getDisposer()}te.bound=function(t,e,n,r){return!0===r?(ne(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return ne(this,e,n.value||n.initializer.call(this)),this[e]},set:Jt}:{enumerable:!1,configurable:!0,set:function(t){ne(this,e,t)},get:function(){}}};var oe=function(t){return t()};function ie(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:oe}function ae(t,e,n){void 0===n&&(n=u);var r,o,i,a=n.name||"Reaction@"+l(),s=te(a,n.onError?(r=n.onError,o=e,function(){try{return o.apply(this,arguments)}catch(t){r.call(this,t)}}):e),c=!n.scheduler&&!n.delay,p=ie(n),d=!0,f=!1,h=n.compareStructural?O.structural:n.equals||O.default,v=new Gt(a,(function(){d||c?y():f||(f=!0,p(y))}),n.onError,n.requiresObservable);function y(){if(f=!1,!v.isDisposed){var e=!1;v.track((function(){var n=t(v);e=d||!h(i,n),i=n})),d&&n.fireImmediately&&s(i,v),d||!0!==e||s(i,v),d&&(d=!1)}}return v.schedule(),v.getDisposer()}function se(t,e,n){return le("onBecomeObserved",t,e,n)}function ue(t,e,n){return le("onBecomeUnobserved",t,e,n)}function le(t,e,n,r){var o="function"==typeof r?hn(e,n):hn(e),i="function"==typeof r?r:n,a=t+"Listeners";return o[a]?o[a].add(i):o[a]=new Set([i]),"function"!=typeof o[t]?c(!1):function(){var t=o[a];t&&(t.delete(i),0===t.size&&delete o[a])}}function ce(t){var e=t.enforceActions,n=t.computedRequiresReaction,r=t.computedConfigurable,o=t.disableErrorBoundaries,i=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(!0===t.isolateGlobalState&&((jt.pendingReactions.length||jt.inBatch||jt.isRunningReactions)&&c("isolateGlobalState should be called before MobX is running any reactions"),Lt=!0,It&&(0==--Ct().__mobxInstanceCount&&(Ct().__mobxGlobals=void 0),jt=new Nt)),void 0!==e){var u=void 0;switch(e){case!0:case"observed":u=!0;break;case!1:case"never":u=!1;break;case"strict":case"always":u="strict";break;default:c("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}jt.enforceActions=u,jt.allowStateChanges=!0!==u&&"strict"!==u}void 0!==n&&(jt.computedRequiresReaction=!!n),void 0!==a&&(jt.reactionRequiresObservable=!!a),void 0!==s&&(jt.observableRequiresReaction=!!s,jt.allowStateReads=!jt.observableRequiresReaction),void 0!==r&&(jt.computedConfigurable=!!r),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),jt.disableErrorBoundaries=!!o),i&&Zt(i)}function pe(t,e,n,r){var o=de(r=G(r));return B(t),un(t,r.name,o.enhancer),e&&fe(t,e,n,o),t}function de(t){return t.defaultDecorator||(!1===t.deep?F:Y)}function fe(t,e,n,r){var o,i;zt();try{var a=M(e);try{for(var s=P(a),u=s.next();!u.done;u=s.next()){var l=u.value,c=Object.getOwnPropertyDescriptor(e,l);0;var p=n&&l in n?n[l]:c.get?et:r;0;var d=p(t,l,c,!0);d&&Object.defineProperty(t,l,d)}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}finally{Ut()}}function he(t,e){return ve(hn(t,e))}function ve(t){var e,n,r={name:t.name};return t.observing&&t.observing.length>0&&(r.dependencies=(e=t.observing,n=[],e.forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n).map(ve)),r}function ye(t){var e={name:t.name};return function(t){return t.observers&&t.observers.size>0}(t)&&(e.observers=Array.from(function(t){return t.observers}(t)).map(ye)),e}var ge=0;function _e(){this.message="FLOW_CANCELLED"}function me(t){"function"==typeof t.cancel&&t.cancel()}function be(t,e){if(null==t)return!1;if(void 0!==e){if(!1===fn(t))return!1;if(!t[w].values.has(e))return!1;var n=hn(t,e);return Ot(n)}return Ot(t)}function Ee(t){return arguments.length>1?c(!1):be(t)}function xe(t,e){return"string"!=typeof e?c(!1):be(t,e)}function Me(t,e){return null!=t&&(void 0!==e?!!fn(t)&&t[w].values.has(e):fn(t)||!!t[w]||T(t)||qt(t)||Ot(t))}function we(t){return 1!==arguments.length&&c(!1),Me(t)}function Se(t){return fn(t)?t[w].getKeys():nn(t)||an(t)?Array.from(t.keys()):Je(t)?t.map((function(t,e){return e})):c(!1)}function Te(t){return fn(t)?Se(t).map((function(e){return t[e]})):nn(t)?Se(t).map((function(e){return t.get(e)})):an(t)?Array.from(t.values()):Je(t)?t.slice():c(!1)}function Ae(t){return fn(t)?Se(t).map((function(e){return[e,t[e]]})):nn(t)?Se(t).map((function(e){return[e,t.get(e)]})):an(t)?Array.from(t.entries()):Je(t)?t.map((function(t,e){return[e,t]})):c(!1)}function Oe(t,e,n){if(2!==arguments.length||an(t))if(fn(t)){var r=t[w];r.values.get(e)?r.write(e,n):r.addObservableProp(e,n,r.defaultEnhancer)}else if(nn(t))t.set(e,n);else if(an(t))t.add(e);else{if(!Je(t))return c(!1);"number"!=typeof e&&(e=parseInt(e,10)),p(e>=0,"Not a valid index: '"+e+"'"),zt(),e>=t.length&&(t.length=e+1),t[e]=n,Ut()}else{zt();var o=e;try{for(var i in o)Oe(t,i,o[i])}finally{Ut()}}}function De(t,e){return fn(t)?vn(t).has(e):nn(t)||an(t)?t.has(e):Je(t)?e>=0&&e<t.length:c(!1)}function Ne(t,e,n,r){return"function"==typeof n?function(t,e,n,r){return vn(t,e).observe(n,r)}(t,e,n,r):function(t,e,n){return vn(t).observe(e,n)}(t,e,n)}_e.prototype=Object.create(Error.prototype);var Pe={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Ce(t,e,n,r){return r.detectCycles&&t.set(e,n),n}function Ie(t,e,n){if(!e.recurseEverything&&!we(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(Tt(t))return Ie(t.get(),e,n);if(we(t)&&Se(t),!0===e.detectCycles&&null!==t&&n.has(t))return n.get(t);if(Je(t)||Array.isArray(t)){var r=Ce(n,t,[],e),o=t.map((function(t){return Ie(t,e,n)}));r.length=o.length;for(var i=0,a=o.length;i<a;i++)r[i]=o[i];return r}if(an(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===e.exportMapsAsObjects){var s=Ce(n,t,new Set,e);return t.forEach((function(t){s.add(Ie(t,e,n))})),s}var u=Ce(n,t,[],e);return t.forEach((function(t){u.push(Ie(t,e,n))})),u}if(nn(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===e.exportMapsAsObjects){var l=Ce(n,t,new Map,e);return t.forEach((function(t,r){l.set(r,Ie(t,e,n))})),l}var c=Ce(n,t,{},e);return t.forEach((function(t,r){c[r]=Ie(t,e,n)})),c}var p=Ce(n,t,{},e);return b(t).forEach((function(r){p[r]=Ie(t[r],e,n)})),p}function Le(t,e){var n;return"boolean"==typeof e&&(e={detectCycles:e}),e||(e=Pe),e.detectCycles=void 0===e.detectCycles?!0===e.recurseEverything:!0===e.detectCycles,e.detectCycles&&(n=new Map),Ie(t,e,n)}function je(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;"boolean"==typeof t[t.length-1]&&(n=t.pop());var r=function(t){switch(t.length){case 0:return jt.trackingDerivation;case 1:return hn(t[0]);case 2:return hn(t[0],t[1])}}(t);if(!r)return c(!1);r.isTracing===tt.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?tt.BREAK:tt.LOG}function ke(t,e){void 0===e&&(e=void 0),zt();try{return t.apply(e)}finally{Ut()}}function Re(t,e,n){var r;"number"==typeof n.timeout&&(r=setTimeout((function(){if(!i[w].isDisposed){i();var t=new Error("WHEN_TIMEOUT");if(!n.onError)throw t;n.onError(t)}}),n.timeout)),n.name=n.name||"When@"+l();var o=mt(n.name+"-effect",e),i=re((function(e){t()&&(e.dispose(),r&&clearTimeout(r),o())}),n);return i}function Be(t){return t[w]}function ze(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t}var Ue={has:function(t,e){if(e===w||"constructor"===e||e===L)return!0;var n=Be(t);return ze(e)?n.has(e):e in t},get:function(t,e){if(e===w||"constructor"===e||e===L)return t[e];var n=Be(t),r=n.values.get(e);if(r instanceof S){var o=r.get();return void 0===o&&n.has(e),o}return ze(e)&&n.has(e),t[e]},set:function(t,e,n){return!!ze(e)&&(Oe(t,e,n),!0)},deleteProperty:function(t,e){return!!ze(e)&&(Be(t).remove(e),!0)},ownKeys:function(t){return Be(t).keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return c("Dynamic observable objects cannot be frozen"),!1}};function Xe(t){return void 0!==t.interceptors&&t.interceptors.length>0}function He(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),d((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function We(t,e){var n=pt();try{for(var r=I(t.interceptors||[]),o=0,i=r.length;o<i&&(p(!(e=r[o](e))||e.type,"Intercept handlers should return nothing or a change object"),e);o++);return e}finally{dt(n)}}function Ge(t){return void 0!==t.changeListeners&&t.changeListeners.length>0}function Ye(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),d((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Ve(t,e){var n=pt(),r=t.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o<i;o++)r[o](e);dt(n)}}var Fe={get:function(t,e){return e===w?t[w]:"length"===e?t[w].getArrayLength():"number"==typeof e?qe.get.call(t,e):"string"!=typeof e||isNaN(e)?qe.hasOwnProperty(e)?qe[e]:t[e]:qe.get.call(t,parseInt(e))},set:function(t,e,n){return"length"===e&&t[w].setArrayLength(n),"number"==typeof e&&qe.set.call(t,e,n),"symbol"==typeof e||isNaN(e)?t[e]=n:qe.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return c("Observable arrays cannot be frozen"),!1}};var Ke=function(){function t(t,e,n){this.owned=n,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new S(t||"ObservableArray@"+l()),this.enhancer=function(n,r){return e(n,r,t+"[..]")}}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.dehanceValues=function(t){return void 0!==this.dehancer&&t.length>0?t.map(this.dehancer):t},t.prototype.intercept=function(t){return He(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Ye(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),r=0;r<t-e;r++)n[r]=void 0;this.spliceWithArray(e,0,n)}else this.spliceWithArray(t,e-t)},t.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=e},t.prototype.spliceWithArray=function(t,e,n){var r=this;st(this.atom);var o=this.values.length;if(void 0===t?t=0:t>o?t=o:t<0&&(t=Math.max(0,o+t)),e=1===arguments.length?o-t:null==e?0:Math.max(0,Math.min(e,o-t)),void 0===n&&(n=s),Xe(this)){var i=We(this,{object:this.proxy,type:"splice",index:t,removedCount:e,added:n});if(!i)return s;e=i.removedCount,n=i.added}n=0===n.length?n:n.map((function(t){return r.enhancer(t,void 0)}));var a=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,a),this.dehanceValues(a)},t.prototype.spliceItemsIntoValues=function(t,e,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,I([t,e],n));var o=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),o},t.prototype.notifyArrayChildUpdate=function(t,e,n){var r=!this.owned&&!1,o=Ge(this),i=o||r?{object:this.proxy,type:"update",index:t,newValue:e,oldValue:n}:null;this.atom.reportChanged(),o&&Ve(this,i)},t.prototype.notifyArraySplice=function(t,e,n){var r=!this.owned&&!1,o=Ge(this),i=o||r?{object:this.proxy,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;this.atom.reportChanged(),o&&Ve(this,i)},t}(),qe={intercept:function(t){return this[w].intercept(t)},observe:function(t,e){return void 0===e&&(e=!1),this[w].observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[w];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this[w];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray(t);case 2:return o.spliceWithArray(t,e)}return o.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){return this[w].spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[w];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[w].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[w];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[w],n=e.dehanceValues(e.values).indexOf(t);return n>-1&&(this.splice(n,1),!0)},get:function(t){var e=this[w];if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(t,e){var n=this[w],r=n.values;if(t<r.length){st(n.atom);var o=r[t];if(Xe(n)){var i=We(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!i)return;e=i.newValue}(e=n.enhancer(e,o))!==o&&(r[t]=e,n.notifyArrayChildUpdate(t,e,o))}else{if(t!==r.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length);n.spliceWithArray(t,0,[e])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(t){"function"==typeof Array.prototype[t]&&(qe[t]=function(){var e=this[w];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(t){"function"==typeof Array.prototype[t]&&(qe[t]=function(e,n){var r=this,o=this[w];return o.atom.reportObserved(),o.dehanceValues(o.values)[t]((function(t,o){return e.call(n,t,o,r)}),n)})})),["reduce","reduceRight"].forEach((function(t){qe[t]=function(){var e=this,n=this[w];n.atom.reportObserved();var r=arguments[0];return arguments[0]=function(t,o,i){return o=n.dehanceValue(o),r(t,o,i,e)},n.values[t].apply(n.values,arguments)}}));var Ze,$e=g("ObservableArrayAdministration",Ke);function Je(t){return h(t)&&$e(t[w])}var Qe,tn={},en=function(){function t(t,e,n){if(void 0===e&&(e=U),void 0===n&&(n="ObservableMap@"+l()),this.enhancer=e,this.name=n,this[Ze]=tn,this._keysAtom=A(this.name+".keys()"),this[Symbol.toStringTag]="Map","function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(t)}return t.prototype._has=function(t){return this._data.has(t)},t.prototype.has=function(t){var e=this;if(!jt.trackingDerivation)return this._has(t);var n=this._hasMap.get(t);if(!n){var r=n=new St(this._has(t),X,this.name+"."+E(t)+"?",!1);this._hasMap.set(t,r),ue(r,(function(){return e._hasMap.delete(t)}))}return n.get()},t.prototype.set=function(t,e){var n=this._has(t);if(Xe(this)){var r=We(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!r)return this;e=r.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if((st(this._keysAtom),Xe(this))&&!(r=We(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=Ge(this),r=n?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return ke((function(){e._keysAtom.reportChanged(),e._updateHasMapEntry(t,!1),e._data.get(t).setNewValue(void 0),e._data.delete(t)})),n&&Ve(this,r),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap.get(t);n&&n.setNewValue(e)},t.prototype._updateValue=function(t,e){var n=this._data.get(t);if((e=n.prepareNewValue(e))!==jt.UNCHANGED){var r=Ge(this),o=r?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;false,n.setNewValue(e),r&&Ve(this,o)}},t.prototype._addValue=function(t,e){var n=this;st(this._keysAtom),ke((function(){var r=new St(e,n.enhancer,n.name+"."+E(t),!1);n._data.set(t,r),e=r.value,n._updateHasMapEntry(t,!0),n._keysAtom.reportChanged()}));var r=Ge(this);r&&Ve(this,r?{type:"add",object:this,name:t,newValue:e}:null)},t.prototype.get=function(t){return this.has(t)?this.dehanceValue(this._data.get(t).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var t=this,e=this.keys();return xn({next:function(){var n=e.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:t.get(o)}}})},t.prototype.entries=function(){var t=this,e=this.keys();return xn({next:function(){var n=e.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:[o,t.get(o)]}}})},t.prototype[(Ze=w,Symbol.iterator)]=function(){return this.entries()},t.prototype.forEach=function(t,e){var n,r;try{for(var o=P(this),i=o.next();!i.done;i=o.next()){var a=C(i.value,2),s=a[0],u=a[1];t.call(e,u,s,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t.prototype.merge=function(t){var e=this;return nn(t)&&(t=t.toJS()),ke((function(){var n=Mt(!0);try{v(t)?b(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=C(t,2),r=n[0],o=n[1];return e.set(r,o)})):_(t)?(t.constructor!==Map&&c("Cannot initialize from classes that inherit from Map: "+t.constructor.name),t.forEach((function(t,n){return e.set(n,t)}))):null!=t&&c("Cannot initialize map from "+t)}finally{wt(n)}})),this},t.prototype.clear=function(){var t=this;ke((function(){ct((function(){var e,n;try{for(var r=P(t.keys()),o=r.next();!o.done;o=r.next()){var i=o.value;t.delete(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}))}))},t.prototype.replace=function(t){var e=this;return ke((function(){var n,r,o,i,a=function(t){if(_(t)||nn(t))return t;if(Array.isArray(t))return new Map(t);if(v(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}return c("Cannot convert to map from '"+t+"'")}(t),s=new Map,u=!1;try{for(var l=P(e._data.keys()),p=l.next();!p.done;p=l.next()){var d=p.value;if(!a.has(d))if(e.delete(d))u=!0;else{var f=e._data.get(d);s.set(d,f)}}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}try{for(var h=P(a.entries()),y=h.next();!y.done;y=h.next()){var g=C(y.value,2),m=(d=g[0],f=g[1],e._data.has(d));if(e.set(d,f),e._data.has(d)){var b=e._data.get(d);s.set(d,b),m||(u=!0)}}}catch(t){o={error:t}}finally{try{y&&!y.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}if(!u)if(e._data.size!==s.size)e._keysAtom.reportChanged();else for(var E=e._data.keys(),x=s.keys(),M=E.next(),w=x.next();!M.done;){if(M.value!==w.value){e._keysAtom.reportChanged();break}M=E.next(),w=x.next()}e._data=s})),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var t,e,n={};try{for(var r=P(this),o=r.next();!o.done;o=r.next()){var i=C(o.value,2),a=i[0],s=i[1];n["symbol"==typeof a?a:E(a)]=s}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var t=this;return this.name+"[{ "+Array.from(this.keys()).map((function(e){return E(e)+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return He(this,t)},t}(),nn=g("ObservableMap",en),rn={},on=function(){function t(t,e,n){if(void 0===e&&(e=U),void 0===n&&(n="ObservableSet@"+l()),this.name=n,this[Qe]=rn,this._data=new Set,this._atom=A(this.name),this[Symbol.toStringTag]="Set","function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(t,r){return e(t,r,n)},t&&this.replace(t)}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.clear=function(){var t=this;ke((function(){ct((function(){var e,n;try{for(var r=P(t._data.values()),o=r.next();!o.done;o=r.next()){var i=o.value;t.delete(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}))}))},t.prototype.forEach=function(t,e){var n,r;try{for(var o=P(this),i=o.next();!i.done;i=o.next()){var a=i.value;t.call(e,a,a,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this;if((st(this._atom),Xe(this))&&!(r=We(this,{type:"add",object:this,newValue:t})))return this;if(!this.has(t)){ke((function(){e._data.add(e.enhancer(t,void 0)),e._atom.reportChanged()}));var n=Ge(this),r=n?{type:"add",object:this,newValue:t}:null;n&&Ve(this,r)}return this},t.prototype.delete=function(t){var e=this;if(Xe(this)&&!(r=We(this,{type:"delete",object:this,oldValue:t})))return!1;if(this.has(t)){var n=Ge(this),r=n?{type:"delete",object:this,oldValue:t}:null;return ke((function(){e._atom.reportChanged(),e._data.delete(t)})),n&&Ve(this,r),!0}return!1},t.prototype.has=function(t){return this._atom.reportObserved(),this._data.has(this.dehanceValue(t))},t.prototype.entries=function(){var t=0,e=Array.from(this.keys()),n=Array.from(this.values());return xn({next:function(){var r=t;return t+=1,r<n.length?{value:[e[r],n[r]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var t=this,e=0,n=Array.from(this._data.values());return xn({next:function(){return e<n.length?{value:t.dehanceValue(n[e++]),done:!1}:{done:!0}}})},t.prototype.replace=function(t){var e=this;return an(t)&&(t=t.toJS()),ke((function(){var n=Mt(!0);try{Array.isArray(t)||m(t)?(e.clear(),t.forEach((function(t){return e.add(t)}))):null!=t&&c("Cannot initialize set from "+t)}finally{wt(n)}})),this},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return He(this,t)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[(Qe=w,Symbol.iterator)]=function(){return this.values()},t}(),an=g("ObservableSet",on),sn=function(){function t(t,e,n,r){void 0===e&&(e=new Map),this.target=t,this.values=e,this.name=n,this.defaultEnhancer=r,this.keysAtom=new S(n+".keys")}return t.prototype.read=function(t){return this.values.get(t).get()},t.prototype.write=function(t,e){var n=this.target,r=this.values.get(t);if(r instanceof At)r.set(e);else{if(Xe(this)){if(!(i=We(this,{type:"update",object:this.proxy||n,name:t,newValue:e})))return;e=i.newValue}if((e=r.prepareNewValue(e))!==jt.UNCHANGED){var o=Ge(this),i=o?{type:"update",object:this.proxy||n,oldValue:r.value,name:t,newValue:e}:null;false,r.setNewValue(e),o&&Ve(this,i)}}},t.prototype.has=function(t){var e=this.pendingKeys||(this.pendingKeys=new Map),n=e.get(t);if(n)return n.get();var r=!!this.values.get(t);return n=new St(r,X,this.name+"."+E(t)+"?",!1),e.set(t,n),n.get()},t.prototype.addObservableProp=function(t,e,n){void 0===n&&(n=this.defaultEnhancer);var r=this.target;if(Xe(this)){var o=We(this,{object:this.proxy||r,name:t,type:"add",newValue:e});if(!o)return;e=o.newValue}var i=new St(e,n,this.name+"."+E(t),!1);this.values.set(t,i),e=i.value,Object.defineProperty(r,t,function(t){return ln[t]||(ln[t]={configurable:!0,enumerable:!0,get:function(){return this[w].read(t)},set:function(e){this[w].write(t,e)}})}(t)),this.notifyPropertyAddition(t,e)},t.prototype.addComputedProp=function(t,e,n){var r=this.target;n.name=n.name||this.name+"."+E(e),this.values.set(e,new At(n)),(t===r||function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}(t,e))&&Object.defineProperty(t,e,function(t){return cn[t]||(cn[t]={configurable:jt.computedConfigurable,enumerable:!1,get:function(){return pn(this).read(t)},set:function(e){pn(this).write(t,e)}})}(e))},t.prototype.remove=function(t){if(this.values.has(t)){var e=this.target;if(Xe(this))if(!(s=We(this,{object:this.proxy||e,name:t,type:"remove"})))return;try{zt();var n=Ge(this),r=!1,o=this.values.get(t),i=o&&o.get();if(o&&o.set(void 0),this.keysAtom.reportChanged(),this.values.delete(t),this.pendingKeys){var a=this.pendingKeys.get(t);a&&a.set(!1)}delete this.target[t];var s=n?{type:"remove",object:this.proxy||e,oldValue:i,name:t}:null;r,n&&Ve(this,s)}finally{Ut()}}},t.prototype.illegalAccess=function(t,e){console.warn("Property '"+e+"' of '"+t+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return He(this,t)},t.prototype.notifyPropertyAddition=function(t,e){var n=Ge(this),r=n?{type:"add",object:this.proxy||this.target,name:t,newValue:e}:null;if(n&&Ve(this,r),this.pendingKeys){var o=this.pendingKeys.get(t);o&&o.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var t,e;this.keysAtom.reportObserved();var n=[];try{for(var r=P(this.values),o=r.next();!o.done;o=r.next()){var i=C(o.value,2),a=i[0];i[1]instanceof St&&n.push(a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t}();function un(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n=U),Object.prototype.hasOwnProperty.call(t,w))return t[w];v(t)||(e=(t.constructor.name||"ObservableObject")+"@"+l()),e||(e="ObservableObject@"+l());var r=new sn(t,new Map,E(e),n);return y(t,w,r),r}var ln=Object.create(null),cn=Object.create(null);function pn(t){var e=t[w];return e||(B(t),t[w])}var dn=g("ObservableObjectAdministration",sn);function fn(t){return!!h(t)&&(B(t),dn(t[w]))}function hn(t,e){if("object"==typeof t&&null!==t){if(Je(t))return void 0!==e&&c(!1),t[w].atom;if(an(t))return t[w];if(nn(t)){var n=t;return void 0===e?n._keysAtom:((r=n._data.get(e)||n._hasMap.get(e))||c(!1),r)}var r;if(B(t),e&&!t[w]&&t[e],fn(t))return e?((r=t[w].values.get(e))||c(!1),r):c(!1);if(T(t)||Ot(t)||qt(t))return t}else if("function"==typeof t&&qt(t[w]))return t[w];return c(!1)}function vn(t,e){return t||c("Expecting some object"),void 0!==e?vn(hn(t,e)):T(t)||Ot(t)||qt(t)||nn(t)||an(t)?t:(B(t),t[w]?t[w]:void c(!1))}function yn(t,e){return(void 0!==e?hn(t,e):fn(t)||nn(t)||an(t)?vn(t):hn(t)).name}var gn=Object.prototype.toString;function _n(t,e,n){return void 0===n&&(n=-1),mn(t,e,n)}function mn(t,e,n,r,o){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;if("function"!==i&&"object"!==i&&"object"!=typeof e)return!1;var a=gn.call(t);if(a!==gn.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++}t=bn(t),e=bn(e);var s="[object Array]"===a;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,l=e.constructor;if(u!==l&&!("function"==typeof u&&u instanceof u&&"function"==typeof l&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}if(0===n)return!1;n<0&&(n=-1),o=o||[];for(var c=(r=r||[]).length;c--;)if(r[c]===t)return o[c]===e;if(r.push(t),o.push(e),s){if((c=t.length)!==e.length)return!1;for(;c--;)if(!mn(t[c],e[c],n-1,r,o))return!1}else{var p=Object.keys(t),d=void 0;if(c=p.length,Object.keys(e).length!==c)return!1;for(;c--;)if(!En(e,d=p[c])||!mn(t[d],e[d],n-1,r,o))return!1}return r.pop(),o.pop(),!0}function bn(t){return Je(t)?t.slice():_(t)||nn(t)||m(t)||an(t)?Array.from(t.entries()):t}function En(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function xn(t){return t[Symbol.iterator]=Mn,t}function Mn(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:$t,extras:{getDebugName:yn},$mobx:w});var wn=Object.freeze({__proto__:null,$mobx:w,FlowCancellationError:_e,get IDerivationState(){return Q},ObservableMap:en,ObservableSet:on,Reaction:Gt,_allowStateChanges:function(t,e){var n,r=Mt(t);try{n=e()}finally{wt(r)}return n},_allowStateChangesInsideComputed:function(t){var e,n=jt.computationDepth;jt.computationDepth=0;try{e=t()}finally{jt.computationDepth=n}return e},_allowStateReadsEnd:ht,_allowStateReadsStart:ft,_endAction:xt,_getAdministration:vn,_getGlobalState:function(){return jt},_interceptReads:function(t,e,n){var r;if(nn(t)||Je(t)||Tt(t))r=vn(t);else{if(!fn(t))return c(!1);if("string"!=typeof e)return c(!1);r=vn(t,e)}return void 0!==r.dehancer?c(!1):(r.dehancer="function"==typeof e?e:n,function(){r.dehancer=void 0})},_isComputingDerivation:function(){return null!==jt.trackingDerivation},_resetGlobalState:function(){var t=new Nt;for(var e in t)-1===Dt.indexOf(e)&&(jt[e]=t[e]);jt.allowStateChanges=!jt.enforceActions},_startAction:Et,action:te,autorun:re,comparer:O,computed:rt,configure:ce,createAtom:A,decorate:function(t,e){var n="function"==typeof t?t.prototype:t,r=function(t){var r=e[t];Array.isArray(r)||(r=[r]);var o=Object.getOwnPropertyDescriptor(n,t),i=r.reduce((function(e,r){return r(n,t,e)}),o);i&&Object.defineProperty(n,t,i)};for(var o in e)r(o);return t},entries:Ae,extendObservable:pe,flow:function(t){1!==arguments.length&&c("Flow expects 1 argument and cannot be used as decorator");var e=t.name||"<unnamed flow>";return function(){var n,r=arguments,o=++ge,i=te(e+" - runid: "+o+" - init",t).apply(this,r),a=void 0,s=new Promise((function(t,r){var s=0;function u(t){var n;a=void 0;try{n=te(e+" - runid: "+o+" - yield "+s++,i.next).call(i,t)}catch(t){return r(t)}c(n)}function l(t){var n;a=void 0;try{n=te(e+" - runid: "+o+" - yield "+s++,i.throw).call(i,t)}catch(t){return r(t)}c(n)}function c(e){if(!e||"function"!=typeof e.then)return e.done?t(e.value):(a=Promise.resolve(e.value)).then(u,l);e.then(c,r)}n=r,u(void 0)}));return s.cancel=te(e+" - runid: "+o+" - cancel",(function(){try{a&&me(a);var t=i.return(void 0),e=Promise.resolve(t.value);e.then(f,f),me(e),n(new _e)}catch(t){n(t)}})),s}},get:function(t,e){if(De(t,e))return fn(t)?t[e]:nn(t)?t.get(e):Je(t)?t[e]:c(!1)},getAtom:hn,getDebugName:yn,getDependencyTree:he,getObserverTree:function(t,e){return ye(hn(t,e))},has:De,intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return vn(t,e).intercept(n)}(t,e,n):function(t,e){return vn(t).intercept(e)}(t,e)},isAction:function(t){return"function"==typeof t&&!0===t.isMobxAction},isArrayLike:function(t){return Array.isArray(t)||Je(t)},isBoxedObservable:Tt,isComputed:Ee,isComputedProp:xe,isFlowCancellationError:function(t){return t instanceof _e},isObservable:we,isObservableArray:Je,isObservableMap:nn,isObservableObject:fn,isObservableProp:function(t,e){return"string"!=typeof e?c(!1):Me(t,e)},isObservableSet:an,keys:Se,observable:$,observe:Ne,onBecomeObserved:se,onBecomeUnobserved:ue,onReactionError:function(t){return jt.globalReactionErrorHandlers.push(t),function(){var e=jt.globalReactionErrorHandlers.indexOf(t);e>=0&&jt.globalReactionErrorHandlers.splice(e,1)}},reaction:ae,remove:function(t,e){if(fn(t))t[w].remove(e);else if(nn(t))t.delete(e);else if(an(t))t.delete(e);else{if(!Je(t))return c(!1);"number"!=typeof e&&(e=parseInt(e,10)),p(e>=0,"Not a valid index: '"+e+"'"),t.splice(e,1)}},runInAction:ee,set:Oe,spy:$t,toJS:Le,trace:je,transaction:ke,untracked:ct,values:Te,when:function(t,e,n){return 1===arguments.length||e&&"object"==typeof e?function(t,e){var n,r=new Promise((function(r,o){var i=Re(t,r,N(N({},e),{onError:o}));n=function(){i(),o("WHEN_CANCELLED")}}));return r.cancel=n,r}(t,e):Re(t,e,n||{})}}),Sn=n(wn);!function(t,n){!function(t,n,r){function o(t){return!(t.prototype&&t.prototype.render||n.Component.isPrototypeOf(t))}function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.prefix,r=void 0===n?"":n,o=e.suffix,i=void 0===o?"":o;return r+(t.displayName||t.name||t.constructor&&t.constructor.name||"<component>")+i}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),l=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},c=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},p=!1,d=console;function f(t){p=t}function h(t){var e=r._getGlobalState().allowStateChanges;return r._getGlobalState().allowStateChanges=t,e}function v(t){r._getGlobalState().allowStateChanges=t}function y(t,e,n,r,o){var i=h(t),a=void 0;try{a=e(n,r,o)}finally{v(i)}return a}function g(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t[e],o=m[e],i=r?!0===n?function(){o.apply(this,arguments),r.apply(this,arguments)}:function(){r.apply(this,arguments),o.apply(this,arguments)}:o;t[e]=i}function _(t,e){if(null==t||null==e||"object"!==(void 0===t?"undefined":a(t))||"object"!==(void 0===e?"undefined":a(e)))return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var r=void 0,o=n.length-1;r=n[o];o--)if(e[r]!==t[r])return!0;return!1}var m={componentWillMount:function(){var t=this;if(!0!==p){var e=i(this),o=!1,a=!1;f.call(this,"props"),f.call(this,"state");var s=this.render.bind(this),u=null,l=!1,c=function(){return(u=new r.Reaction(e+".render()",(function(){if(!l&&(l=!0,"function"==typeof t.componentWillReact&&t.componentWillReact(),!0!==t.__$mobxIsUnmounted)){var e=!0;try{a=!0,o||n.Component.prototype.forceUpdate.call(t),e=!1}finally{a=!1,e&&u.dispose()}}}))).reactComponent=t,d.$mobx=u,t.render=d,d(t.props,t.state,t.context)},d=function(t,e,n){l=!1;var r=void 0,o=void 0;if(u.track((function(){try{o=y(!1,s,t,e,n)}catch(t){r=t}})),r)throw r;return o};this.render=c}function f(t){var e=this[t],n=r.createAtom("reactive "+t);Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:function(){return n.reportObserved(),e},set:function(t){!a&&_(e,t)?(e=t,o=!0,n.reportChanged(),o=!1):e=t}})}},componentWillUnmount:function(){!0!==p&&(this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0)},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(t,e){return p&&d.warn("[mobx-preact] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==e||_(this.props,t)}};function b(t){var e,r;if(arguments.length>1&&d.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),!0===t.isMobxInjector&&d.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),o(t))return b((r=e=function(e){function n(){return s(this,n),c(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return l(n,e),u(n,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),n}(n.Component),e.displayName=i(t),r));if(!t)throw new Error("Please pass a valid component to 'observer'");return E(t.prototype||t),t.isMobXReactObserver=!0,t}function E(t){g(t,"componentWillMount",!0),g(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=m.shouldComponentUpdate)}var x=b((function(t){return t.children[0]()}));function M(t,e){return t(e={exports:{}},e.exports),e.exports}x.displayName="Observer","undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;var w=M((function(t,e){!function(e,n){t.exports=n()}(0,(function(){var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n=Object.defineProperty,r=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,i=Object.getOwnPropertyDescriptor,a=Object.getPrototypeOf,s=a&&a(Object);return function u(l,c,p){if("string"!=typeof c){if(s){var d=a(c);d&&d!==s&&u(l,d,p)}var f=r(c);o&&(f=f.concat(o(c)));for(var h=0;h<f.length;++h){var v=f[h];if(!(t[v]||e[v]||p&&p[v])){var y=i(c,v);try{n(l,v,y)}catch(t){}}}return l}return l}}))})),S={isMobxInjector:{value:!0,writable:!0,configurable:!0,enumerable:!0}};function T(t,e,r){var o,a,p=i(e,{prefix:"inject-",suffix:r?"-with-"+r:""}),d=(a=o=function(r){function o(){return s(this,o),c(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return l(o,r),u(o,[{key:"render",value:function(){var r={};for(var o in this.props)this.props.hasOwnProperty(o)&&(r[o]=this.props[o]);var i=t(this.context.mobxStores||{},r,this.context)||{};for(var a in i)r[a]=i[a];return n.h(e,r)}}]),o}(n.Component),o.displayName=p,a);return w(d,e),d.wrappedComponent=e,Object.defineProperties(d,S),d}function A(t){return function(e,n){return t.forEach((function(t){if(!(t in n)){if(!(t in e))throw new Error("MobX injector: Store '"+t+"' is not available! Make sure it is provided by some Provider");n[t]=e[t]}})),n}}function O(){var t=void 0;if("function"==typeof arguments[0])return t=arguments[0],function(e){var n=T(t,e);return n.isMobxInjector=!1,(n=b(n)).isMobxInjector=!0,n};for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t=A(e),function(n){return T(t,n,e.join("-"))}}function D(t,e){if("string"==typeof t)throw new Error("Store names should be provided as array");return Array.isArray(t)?e?O.apply(null,t)(D(e)):function(e){return D(t,e)}:b(t)}var N={children:!0,key:!0,ref:!0},P=console,C=function(t){function e(){return s(this,e),c(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return l(e,t),u(e,[{key:"render",value:function(t){var e=t.children;return e.length>1?n.h("div",null," ",e," "):e[0]}},{key:"getChildContext",value:function(){var t={},e=this.context.mobxStores;if(e)for(var n in e)t[n]=e[n];for(var r in this.props)N[r]||"suppressChangedStoreWarning"===r||(t[r]=this.props[r]);return{mobxStores:t}}},{key:"componentWillReceiveProps",value:function(t){if(Object.keys(t).length!==Object.keys(this.props).length&&P.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!t.suppressChangedStoreWarning)for(var e in t)N[e]||this.props[e]===t[e]||P.warn("MobX Provider: Provided store '"+e+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e}(n.Component);if(!n.Component)throw new Error("mobx-preact requires Preact to be available");t.observer=b,t.Observer=x,t.useStaticRendering=f,t.connect=D,t.inject=O,t.Provider=C,Object.defineProperty(t,"__esModule",{value:!0})}(n,function(){if(r)return i;r=1;var t,e,n,o,a,s,u,l,c,p,d,f,h={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function _(t,e){for(var n in e)t[n]=e[n];return t}function m(t){var e=t.parentNode;e&&e.removeChild(t)}function b(e,n,r){var o,i,a,s={};for(a in n)"key"==a?o=n[a]:"ref"==a?i=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return E(e,s,o,i,null)}function E(t,r,o,i,a){var s={type:t,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++n:a,__i:-1,__u:0};return null==a&&null!=e.vnode&&e.vnode(s),s}function x(t){return t.children}function M(t,e){this.props=t,this.context=e}function w(t,e){if(null==e)return t.__?w(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?w(t):null}function S(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return S(t)}}function T(t){(!t.__d&&(t.__d=!0)&&a.push(t)&&!A.__r++||s!==e.debounceRendering)&&((s=e.debounceRendering)||u)(A)}function A(){var t,n,r,o,i,s,u,c;for(a.sort(l);t=a.shift();)t.__d&&(n=a.length,o=void 0,s=(i=(r=t).__v).__e,u=[],c=[],r.__P&&((o=_({},i)).__v=i.__v+1,e.vnode&&e.vnode(o),j(r.__P,o,i,r.__n,r.__P.namespaceURI,32&i.__u?[s]:null,u,null==s?w(i):s,!!(32&i.__u),c),o.__v=i.__v,o.__.__k[o.__i]=o,k(u,o,c),o.__e!=s&&S(o)),a.length>n&&a.sort(l));A.__r=0}function O(t,e,n,r,o,i,a,s,u,l,c){var p,d,f,y,g,_=r&&r.__k||v,m=e.length;for(n.__d=u,D(n,e,_),u=n.__d,p=0;p<m;p++)null!=(f=n.__k[p])&&"boolean"!=typeof f&&"function"!=typeof f&&(d=-1===f.__i?h:_[f.__i]||h,f.__i=p,j(t,f,d,o,i,a,s,u,l,c),y=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&B(d.ref,null,f),c.push(f.ref,f.__c||y,f)),null==g&&null!=y&&(g=y),65536&f.__u||d.__k===f.__k?(u&&!u.isConnected&&(u=w(d)),u=N(f,u,t)):"function"==typeof f.type&&void 0!==f.__d?u=f.__d:y&&(u=y.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=u,n.__e=g}function D(t,e,n){var r,o,i,a,s,u=e.length,l=n.length,c=l,p=0;for(t.__k=[],r=0;r<u;r++)a=r+p,null!=(o=t.__k[r]=null==(o=e[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?E(null,o,null,null,null):g(o)?E(x,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?E(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=t,o.__b=t.__b+1,s=P(o,n,a,c),o.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&p--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?p++:s>a?c>u-a?p+=s-a:p--:s<a?s==a-1&&(p=s-a):p=0,s!==r+p&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=w(i)),z(i,i,!1),n[a]=null,c--);if(c)for(r=0;r<l;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=w(i)),z(i,i))}function N(t,e,n){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=N(r[o],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function P(t,e,n,r){var o=t.key,i=t.type,a=n-1,s=n+1,u=e[n];if(null===u||u&&o==u.key&&i===u.type&&0==(131072&u.__u))return n;if(r>(null!=u&&0==(131072&u.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((u=e[a])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return a;a--}if(s<e.length){if((u=e[s])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return s;s++}}return-1}function C(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||y.test(e)?n:n+"px"}function I(t,e,n,r,o){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||C(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||C(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])i=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.t=r.t:(n.t=c,t.addEventListener(e,i?d:p,i)):t.removeEventListener(e,i?d:p,i);else{if("http://www.w3.org/2000/svg"==o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function L(t){return function(n){if(this.l){var r=this.l[n.type+t];if(null==n.u)n.u=c++;else if(n.u<r.t)return;return r(e.event?e.event(n):n)}}}function j(t,n,r,o,i,a,s,u,l,c){var p,d,f,h,v,y,m,b,E,w,S,T,A,D,N,P=n.type;if(void 0!==n.constructor)return null;128&r.__u&&(l=!!(32&r.__u),a=[u=n.__e=r.__e]),(p=e.__b)&&p(n);t:if("function"==typeof P)try{if(b=n.props,E=(p=P.contextType)&&o[p.__c],w=p?E?E.props.value:p.__:o,r.__c?m=(d=n.__c=r.__c).__=d.__E:("prototype"in P&&P.prototype.render?n.__c=d=new P(b,w):(n.__c=d=new M(b,w),d.constructor=P,d.render=U),E&&E.sub(d),d.props=b,d.state||(d.state={}),d.context=w,d.__n=o,f=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=P.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=_({},d.__s)),_(d.__s,P.getDerivedStateFromProps(b,d.__s))),h=d.props,v=d.state,d.__v=n,f)null==P.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==P.getDerivedStateFromProps&&b!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(b,w),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(b,d.__s,w)||n.__v===r.__v)){for(n.__v!==r.__v&&(d.props=b,d.state=d.__s,d.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.forEach((function(t){t&&(t.__=n)})),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[],d.__h.length&&s.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(b,d.__s,w),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(h,v,y)}))}if(d.context=w,d.props=b,d.__P=t,d.__e=!1,T=e.__r,A=0,"prototype"in P&&P.prototype.render){for(d.state=d.__s,d.__d=!1,T&&T(n),p=d.render(d.props,d.state,d.context),D=0;D<d._sb.length;D++)d.__h.push(d._sb[D]);d._sb=[]}else do{d.__d=!1,T&&T(n),p=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++A<25);d.state=d.__s,null!=d.getChildContext&&(o=_(_({},o),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(y=d.getSnapshotBeforeUpdate(h,v)),O(t,g(N=null!=p&&p.type===x&&null==p.key?p.props.children:p)?N:[N],n,r,o,i,a,s,u,l,c),d.base=n.__e,n.__u&=-161,d.__h.length&&s.push(d),m&&(d.__E=d.__=null)}catch(t){n.__v=null,l||null!=a?(n.__e=u,n.__u|=l?160:32,a[a.indexOf(u)]=null):(n.__e=r.__e,n.__k=r.__k),e.__e(t,n,r)}else null==a&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=R(r.__e,n,r,o,i,a,s,l,c);(p=e.diffed)&&p(n)}function k(t,n,r){n.__d=void 0;for(var o=0;o<r.length;o++)B(r[o],r[++o],r[++o]);e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function R(e,n,r,o,i,a,s,u,l){var c,p,d,f,v,y,_,b=r.props,E=n.props,x=n.type;if("svg"===x?i="http://www.w3.org/2000/svg":"math"===x?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(c=0;c<a.length;c++)if((v=a[c])&&"setAttribute"in v==!!x&&(x?v.localName===x:3===v.nodeType)){e=v,a[c]=null;break}if(null==e){if(null===x)return document.createTextNode(E);e=document.createElementNS(i,x,E.is&&E),a=null,u=!1}if(null===x)b===E||u&&e.data===E||(e.data=E);else{if(a=a&&t.call(e.childNodes),b=r.props||h,!u&&null!=a)for(b={},c=0;c<e.attributes.length;c++)b[(v=e.attributes[c]).name]=v.value;for(c in b)if(v=b[c],"children"==c);else if("dangerouslySetInnerHTML"==c)d=v;else if("key"!==c&&!(c in E)){if("value"==c&&"defaultValue"in E||"checked"==c&&"defaultChecked"in E)continue;I(e,c,null,v,i)}for(c in E)v=E[c],"children"==c?f=v:"dangerouslySetInnerHTML"==c?p=v:"value"==c?y=v:"checked"==c?_=v:"key"===c||u&&"function"!=typeof v||b[c]===v||I(e,c,v,b[c],i);if(p)u||d&&(p.__html===d.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),n.__k=[];else if(d&&(e.innerHTML=""),O(e,g(f)?f:[f],n,r,o,"foreignObject"===x?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:r.__k&&w(r,0),u,l),null!=a)for(c=a.length;c--;)null!=a[c]&&m(a[c]);u||(c="value",void 0!==y&&(y!==e[c]||"progress"===x&&!y||"option"===x&&y!==b[c])&&I(e,c,y,b[c],i),c="checked",void 0!==_&&_!==e[c]&&I(e,c,_,b[c],i))}return e}function B(t,n,r){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,r)}}function z(t,n,r){var o,i;if(e.unmount&&e.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||B(o,null,n)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){e.__e(t,n)}o.base=o.__P=null}if(o=t.__k)for(i=0;i<o.length;i++)o[i]&&z(o[i],n,r||"function"!=typeof t.type);r||null==t.__e||m(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function U(t,e,n){return this.constructor(t,n)}function X(n,r,o){var i,a,s,u;e.__&&e.__(n,r),a=(i="function"==typeof o)?null:o&&o.__k||r.__k,s=[],u=[],j(r,n=(!i&&o||r).__k=b(x,null,[n]),a||h,h,r.namespaceURI,!i&&o?[o]:a?null:r.firstChild?t.call(r.childNodes):null,s,!i&&o?o:a?a.__e:r.firstChild,i,u),k(s,n,u)}return t=v.slice,e={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},n=0,o=function(t){return null!=t&&null==t.constructor},M.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof t&&(t=t(_({},n),this.props)),t&&_(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),T(this))},M.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),T(this))},M.prototype.render=x,a=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(t,e){return t.__v.__b-e.__v.__b},A.__r=0,c=0,p=L(!1),d=L(!0),f=0,i.Component=M,i.Fragment=x,i.cloneElement=function(e,n,r){var o,i,a,s,u=_({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)"key"==a?o=n[a]:"ref"==a?i=n[a]:u[a]=void 0===n[a]&&void 0!==s?s[a]:n[a];return arguments.length>2&&(u.children=arguments.length>3?t.call(arguments,2):r),E(e.type,u,o||e.key,i||e.ref,null)},i.createContext=function(t,e){var n={__c:e="__cC"+f++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,r;return this.getChildContext||(n=[],(r={})[e]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,T(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n},i.createElement=b,i.createRef=function(){return{current:null}},i.h=b,i.hydrate=function t(e,n){X(e,n,t)},i.isValidElement=o,i.options=e,i.render=X,i.toChildArray=function t(e,n){return n=n||[],null==e||"boolean"==typeof e||(g(e)?e.some((function(e){t(e,n)})):n.push(e)),n},i}(),Sn)}(0,o);var Tn,An,On,Dn,Nn,Pn,Cn,In,Ln,jn,kn={},Rn=[],Bn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zn=Array.isArray;function Un(t,e){for(var n in e)t[n]=e[n];return t}function Xn(t){var e=t.parentNode;e&&e.removeChild(t)}function Hn(t,e,n){var r,o,i,a={};for(i in e)"key"==i?r=e[i]:"ref"==i?o=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?Tn.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===a[i]&&(a[i]=t.defaultProps[i]);return Wn(t,a,r,o,null)}function Wn(t,e,n,r,o){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++On:o,__i:-1,__u:0};return null==o&&null!=An.vnode&&An.vnode(i),i}function Gn(){return{current:null}}function Yn(t){return t.children}function Vn(t,e){this.props=t,this.context=e}function Fn(t,e){if(null==e)return t.__?Fn(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?Fn(t):null}function Kn(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return Kn(t)}}function qn(t){(!t.__d&&(t.__d=!0)&&Dn.push(t)&&!Zn.__r++||Nn!==An.debounceRendering)&&((Nn=An.debounceRendering)||Pn)(Zn)}function Zn(){var t,e,n,r,o,i,a,s;for(Dn.sort(Cn);t=Dn.shift();)t.__d&&(e=Dn.length,r=void 0,i=(o=(n=t).__v).__e,a=[],s=[],n.__P&&((r=Un({},o)).__v=o.__v+1,An.vnode&&An.vnode(r),ir(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,a,null==i?Fn(o):i,!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,ar(a,r,s),r.__e!=i&&Kn(r)),Dn.length>e&&Dn.sort(Cn));Zn.__r=0}function $n(t,e,n,r,o,i,a,s,u,l,c){var p,d,f,h,v,y=r&&r.__k||Rn,g=e.length;for(n.__d=u,Jn(n,e,y),u=n.__d,p=0;p<g;p++)null!=(f=n.__k[p])&&"boolean"!=typeof f&&"function"!=typeof f&&(d=-1===f.__i?kn:y[f.__i]||kn,f.__i=p,ir(t,f,d,o,i,a,s,u,l,c),h=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&ur(d.ref,null,f),c.push(f.ref,f.__c||h,f)),null==v&&null!=h&&(v=h),65536&f.__u||d.__k===f.__k?(u&&!u.isConnected&&(u=Fn(d)),u=Qn(f,u,t)):"function"==typeof f.type&&void 0!==f.__d?u=f.__d:h&&(u=h.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=u,n.__e=v}function Jn(t,e,n){var r,o,i,a,s,u=e.length,l=n.length,c=l,p=0;for(t.__k=[],r=0;r<u;r++)a=r+p,null!=(o=t.__k[r]=null==(o=e[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?Wn(null,o,null,null,null):zn(o)?Wn(Yn,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?Wn(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=t,o.__b=t.__b+1,s=er(o,n,a,c),o.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&p--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?p++:s>a?c>u-a?p+=s-a:p--:s<a?s==a-1&&(p=s-a):p=0,s!==r+p&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=Fn(i)),lr(i,i,!1),n[a]=null,c--);if(c)for(r=0;r<l;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=Fn(i)),lr(i,i))}function Qn(t,e,n){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=Qn(r[o],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function tr(t,e){return e=e||[],null==t||"boolean"==typeof t||(zn(t)?t.some((function(t){tr(t,e)})):e.push(t)),e}function er(t,e,n,r){var o=t.key,i=t.type,a=n-1,s=n+1,u=e[n];if(null===u||u&&o==u.key&&i===u.type&&0==(131072&u.__u))return n;if(r>(null!=u&&0==(131072&u.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((u=e[a])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return a;a--}if(s<e.length){if((u=e[s])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return s;s++}}return-1}function nr(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||Bn.test(e)?n:n+"px"}function rr(t,e,n,r,o){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||nr(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||nr(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])i=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=In,t.addEventListener(e,i?jn:Ln,i)):t.removeEventListener(e,i?jn:Ln,i);else{if("http://www.w3.org/2000/svg"==o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function or(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e.t)e.t=In++;else if(e.t<n.u)return;return n(An.event?An.event(e):e)}}}function ir(t,e,n,r,o,i,a,s,u,l){var c,p,d,f,h,v,y,g,_,m,b,E,x,M,w,S=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=e.__e=n.__e]),(c=An.__b)&&c(e);t:if("function"==typeof S)try{if(g=e.props,_=(c=S.contextType)&&r[c.__c],m=c?_?_.props.value:c.__:r,n.__c?y=(p=e.__c=n.__c).__=p.__E:("prototype"in S&&S.prototype.render?e.__c=p=new S(g,m):(e.__c=p=new Vn(g,m),p.constructor=S,p.render=cr),_&&_.sub(p),p.props=g,p.state||(p.state={}),p.context=m,p.__n=r,d=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=S.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=Un({},p.__s)),Un(p.__s,S.getDerivedStateFromProps(g,p.__s))),f=p.props,h=p.state,p.__v=e,d)null==S.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==S.getDerivedStateFromProps&&g!==f&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(g,m),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(g,p.__s,m)||e.__v===n.__v)){for(e.__v!==n.__v&&(p.props=g,p.state=p.__s,p.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),b=0;b<p._sb.length;b++)p.__h.push(p._sb[b]);p._sb=[],p.__h.length&&a.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(g,p.__s,m),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(f,h,v)}))}if(p.context=m,p.props=g,p.__P=t,p.__e=!1,E=An.__r,x=0,"prototype"in S&&S.prototype.render){for(p.state=p.__s,p.__d=!1,E&&E(e),c=p.render(p.props,p.state,p.context),M=0;M<p._sb.length;M++)p.__h.push(p._sb[M]);p._sb=[]}else do{p.__d=!1,E&&E(e),c=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++x<25);p.state=p.__s,null!=p.getChildContext&&(r=Un(Un({},r),p.getChildContext())),d||null==p.getSnapshotBeforeUpdate||(v=p.getSnapshotBeforeUpdate(f,h)),$n(t,zn(w=null!=c&&c.type===Yn&&null==c.key?c.props.children:c)?w:[w],e,n,r,o,i,a,s,u,l),p.base=e.__e,e.__u&=-161,p.__h.length&&a.push(p),y&&(p.__E=p.__=null)}catch(t){e.__v=null,u||null!=i?(e.__e=s,e.__u|=u?160:32,i[i.indexOf(s)]=null):(e.__e=n.__e,e.__k=n.__k),An.__e(t,e,n)}else null==i&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=sr(n.__e,e,n,r,o,i,a,u,l);(c=An.diffed)&&c(e)}function ar(t,e,n){e.__d=void 0;for(var r=0;r<n.length;r++)ur(n[r],n[++r],n[++r]);An.__c&&An.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){An.__e(t,e.__v)}}))}function sr(t,e,n,r,o,i,a,s,u){var l,c,p,d,f,h,v,y=n.props,g=e.props,_=e.type;if("svg"===_?o="http://www.w3.org/2000/svg":"math"===_?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=i)for(l=0;l<i.length;l++)if((f=i[l])&&"setAttribute"in f==!!_&&(_?f.localName===_:3===f.nodeType)){t=f,i[l]=null;break}if(null==t){if(null===_)return document.createTextNode(g);t=document.createElementNS(o,_,g.is&&g),i=null,s=!1}if(null===_)y===g||s&&t.data===g||(t.data=g);else{if(i=i&&Tn.call(t.childNodes),y=n.props||kn,!s&&null!=i)for(y={},l=0;l<t.attributes.length;l++)y[(f=t.attributes[l]).name]=f.value;for(l in y)if(f=y[l],"children"==l);else if("dangerouslySetInnerHTML"==l)p=f;else if("key"!==l&&!(l in g)){if("value"==l&&"defaultValue"in g||"checked"==l&&"defaultChecked"in g)continue;rr(t,l,null,f,o)}for(l in g)f=g[l],"children"==l?d=f:"dangerouslySetInnerHTML"==l?c=f:"value"==l?h=f:"checked"==l?v=f:"key"===l||s&&"function"!=typeof f||y[l]===f||rr(t,l,f,y[l],o);if(c)s||p&&(c.__html===p.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(p&&(t.innerHTML=""),$n(t,zn(d)?d:[d],e,n,r,"foreignObject"===_?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&Fn(n,0),s,u),null!=i)for(l=i.length;l--;)null!=i[l]&&Xn(i[l]);s||(l="value",void 0!==h&&(h!==t[l]||"progress"===_&&!h||"option"===_&&h!==y[l])&&rr(t,l,h,y[l],o),l="checked",void 0!==v&&v!==t[l]&&rr(t,l,v,y[l],o))}return t}function ur(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){An.__e(t,n)}}function lr(t,e,n){var r,o;if(An.unmount&&An.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||ur(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){An.__e(t,e)}r.base=r.__P=null}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&lr(r[o],e,n||"function"!=typeof t.type);n||null==t.__e||Xn(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function cr(t,e,n){return this.constructor(t,n)}function pr(t,e,n){var r,o,i,a;An.__&&An.__(t,e),o=(r="function"==typeof n)?null:n&&n.__k||e.__k,i=[],a=[],ir(e,t=(!r&&n||e).__k=Hn(Yn,null,[t]),o||kn,kn,e.namespaceURI,!r&&n?[n]:o?null:e.firstChild?Tn.call(e.childNodes):null,i,!r&&n?n:o?o.__e:e.firstChild,r,a),ar(i,t,a)}Tn=Rn.slice,An={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},On=0,Vn.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Un({},this.state),"function"==typeof t&&(t=t(Un({},n),this.props)),t&&Un(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),qn(this))},Vn.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),qn(this))},Vn.prototype.render=Yn,Dn=[],Pn="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Cn=function(t,e){return t.__v.__b-e.__v.__b},Zn.__r=0,In=0,Ln=or(!1),jn=or(!0);var dr,fr,hr,vr=[],yr=[],gr=An,_r=gr.__b,mr=gr.__r,br=gr.diffed,Er=gr.__c,xr=gr.unmount,Mr=gr.__;function wr(){for(var t;t=vr.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Ar),t.__H.__h.forEach(Or),t.__H.__h=[]}catch(e){t.__H.__h=[],gr.__e(e,t.__v)}}gr.__b=function(t){dr=null,_r&&_r(t)},gr.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Mr&&Mr(t,e)},gr.__r=function(t){mr&&mr(t);var e=(dr=t.__c).__H;e&&(fr===dr?(e.__h=[],dr.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=yr,t.__N=t.i=void 0}))):(e.__h.forEach(Ar),e.__h.forEach(Or),e.__h=[])),fr=dr},gr.diffed=function(t){br&&br(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==vr.push(e)&&hr===gr.requestAnimationFrame||((hr=gr.requestAnimationFrame)||Tr)(wr)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==yr&&(t.__=t.__V),t.i=void 0,t.__V=yr}))),fr=dr=null},gr.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Ar),t.__h=t.__h.filter((function(t){return!t.__||Or(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],gr.__e(n,t.__v)}})),Er&&Er(t,e)},gr.unmount=function(t){xr&&xr(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{Ar(t)}catch(t){e=t}})),n.__H=void 0,e&&gr.__e(e,n.__v))};var Sr="function"==typeof requestAnimationFrame;function Tr(t){var e,n=function(){clearTimeout(r),Sr&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);Sr&&(e=requestAnimationFrame(n))}function Ar(t){var e=dr,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),dr=e}function Or(t){var e=dr;t.__c=t.__(),dr=e}function Dr(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var r in e)if("__source"!==r&&t[r]!==e[r])return!0;return!1}function Nr(t,e){this.props=t,this.context=e}(Nr.prototype=new Vn).isPureReactComponent=!0,Nr.prototype.shouldComponentUpdate=function(t,e){return Dr(this.props,t)||Dr(this.state,e)};var Pr=An.__b;An.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Pr&&Pr(t)};var Cr=An.__e;An.__e=function(t,e,n,r){if(t.then)for(var o,i=e;i=i.__;)if((o=i.__c)&&o.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),o.__c(t,e);Cr(t,e,n,r)};var Ir=An.unmount;function Lr(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=function(t,e){for(var n in e)t[n]=e[n];return t}({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return Lr(t,e,n)}))),t}function jr(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return jr(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function kr(){this.__u=0,this.t=null,this.__b=null}function Rr(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function Br(){this.u=null,this.o=null}An.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Ir&&Ir(t)},(kr.prototype=new Vn).__c=function(t,e){var n=e.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Rr(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(! --r.__u){if(r.state.__a){var t=r.state.__a;r.__v.__k[0]=jr(t,t.__c.__P,t.__c.__O)}var e;for(r.setState({__a:r.__b=null});e=r.t.pop();)e.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(a,a)},kr.prototype.componentWillUnmount=function(){this.t=[]},kr.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Lr(this.__b,n,r.__O=r.__P)}this.__b=null}var o=e.__a&&Hn(Yn,null,t.fallback);return o&&(o.__u&=-33),[Hn(Yn,null,e.__a?null:t.children),o]};var zr=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};(Br.prototype=new Vn).__a=function(t){var e=this,n=Rr(e.__v),r=e.o.get(t);return r[0]++,function(o){var i=function(){e.props.revealOrder?(r.push(o),zr(e,t,r)):o()};n?n(i):i()}},Br.prototype.render=function(t){this.u=null,this.o=new Map;var e=tr(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},Br.prototype.componentDidUpdate=Br.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){zr(t,n,e)}))};var Ur="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Xr=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Hr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Wr=/[A-Z0-9]/g,Gr="undefined"!=typeof document,Yr=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};Vn.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(Vn.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var Vr=An.event;function Fr(){}function Kr(){return this.cancelBubble}function qr(){return this.defaultPrevented}An.event=function(t){return Vr&&(t=Vr(t)),t.persist=Fr,t.isPropagationStopped=Kr,t.isDefaultPrevented=qr,t.nativeEvent=t};var Zr={enumerable:!1,configurable:!0,get:function(){return this.class}},$r=An.vnode;An.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,r={};for(var o in e){var i=e[o];if(!("value"===o&&"defaultValue"in e&&null==i||Gr&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in e&&null==e.value?o="value":"download"===o&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Yr(e.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":Hr.test(o)?o=a:-1===n.indexOf("-")&&Xr.test(o)?o=o.replace(Wr,"-$&").toLowerCase():null===i&&(i=void 0):a=o="oninput","oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=i}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=tr(e.children).forEach((function(t){t.props.selected=-1!=r.value.indexOf(t.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=tr(e.children).forEach((function(t){t.props.selected=r.multiple?-1!=r.defaultValue.indexOf(t.props.value):r.defaultValue==t.props.value}))),e.class&&!e.className?(r.class=e.class,Object.defineProperty(r,"className",Zr)):(e.className&&!e.class||e.class&&e.className)&&(r.class=r.className=e.className),t.props=r}(t),t.$$typeof=Ur,$r&&$r(t)};var Jr=An.__r;An.__r=function(t){Jr&&Jr(t),t.__c};var Qr=An.diffed;An.diffed=function(t){Qr&&Qr(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value)};var to=function(t,e){return to=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},to(t,e)};function eo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}to(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var no=function(){return no=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},no.apply(this,arguments)};function ro(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function oo(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function io(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function ao(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var so=0;function uo(t,e,n,r,o,i){e||(e={});var a,s,u=e;if("ref"in u)for(s in u={},e)"ref"==s?a=e[s]:u[s]=e[s];var l={type:t,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--so,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof t&&(a=t.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return An.vnode&&An.vnode(l),l}var lo="object"==typeof global&&global&&global.Object===Object&&global,co="object"==typeof self&&self&&self.Object===Object&&self,po=lo||co||Function("return this")(),fo=po.Symbol,ho=Object.prototype,vo=ho.hasOwnProperty,yo=ho.toString,go=fo?fo.toStringTag:void 0;var _o=Object.prototype.toString;var mo="[object Null]",bo="[object Undefined]",Eo=fo?fo.toStringTag:void 0;function xo(t){return null==t?void 0===t?bo:mo:Eo&&Eo in Object(t)?function(t){var e=vo.call(t,go),n=t[go];try{t[go]=void 0;var r=!0}catch(t){}var o=yo.call(t);return r&&(e?t[go]=n:delete t[go]),o}(t):function(t){return _o.call(t)}(t)}function Mo(t){return null!=t&&"object"==typeof t}var wo="[object Symbol]";function So(t){return"symbol"==typeof t||Mo(t)&&xo(t)==wo}var To=NaN;function Ao(t){return"number"==typeof t?t:So(t)?To:+t}function Oo(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}var Do=Array.isArray,No=1/0,Po=fo?fo.prototype:void 0,Co=Po?Po.toString:void 0;function Io(t){if("string"==typeof t)return t;if(Do(t))return Oo(t,Io)+"";if(So(t))return Co?Co.call(t):"";var e=t+"";return"0"==e&&1/t==-No?"-0":e}function Lo(t,e){return function(n,r){var o;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=Io(n),r=Io(r)):(n=Ao(n),r=Ao(r)),o=t(n,r)}return o}}var jo=Lo((function(t,e){return t+e}),0),ko=/\s/;function Ro(t){for(var e=t.length;e--&&ko.test(t.charAt(e)););return e}var Bo=/^\s+/;function zo(t){return t?t.slice(0,Ro(t)+1).replace(Bo,""):t}function Uo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Xo=NaN,Ho=/^[-+]0x[0-9a-f]+$/i,Wo=/^0b[01]+$/i,Go=/^0o[0-7]+$/i,Yo=parseInt;function Vo(t){if("number"==typeof t)return t;if(So(t))return Xo;if(Uo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Uo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=zo(t);var n=Wo.test(t);return n||Go.test(t)?Yo(t.slice(2),n?2:8):Ho.test(t)?Xo:+t}var Fo=1/0,Ko=17976931348623157e292;function qo(t){return t?(t=Vo(t))===Fo||t===-Fo?(t<0?-1:1)*Ko:t==t?t:0:0===t?t:0}function Zo(t){var e=qo(t),n=e%1;return e==e?n?e-n:e:0}function $o(t){return t}var Jo="[object AsyncFunction]",Qo="[object Function]",ti="[object GeneratorFunction]",ei="[object Proxy]";function ni(t){if(!Uo(t))return!1;var e=xo(t);return e==Qo||e==ti||e==Jo||e==ei}var ri,oi=po["__core-js_shared__"],ii=(ri=/[^.]+$/.exec(oi&&oi.keys&&oi.keys.IE_PROTO||""))?"Symbol(src)_1."+ri:"";var ai=Function.prototype.toString;function si(t){if(null!=t){try{return ai.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var ui=/^\[object .+?Constructor\]$/,li=Function.prototype,ci=Object.prototype,pi=li.toString,di=ci.hasOwnProperty,fi=RegExp("^"+pi.call(di).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hi(t){return!(!Uo(t)||function(t){return!!ii&&ii in t}(t))&&(ni(t)?fi:ui).test(si(t))}function vi(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return hi(n)?n:void 0}var yi=vi(po,"WeakMap"),gi=yi&&new yi,_i=gi?function(t,e){return gi.set(t,e),t}:$o,mi=Object.create,bi=function(){function t(){}return function(e){if(!Uo(e))return{};if(mi)return mi(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Ei(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=bi(t.prototype),r=t.apply(n,e);return Uo(r)?r:n}}var xi=1;function Mi(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var wi=Math.max;function Si(t,e,n,r){for(var o=-1,i=t.length,a=n.length,s=-1,u=e.length,l=wi(i-a,0),c=Array(u+l),p=!r;++s<u;)c[s]=e[s];for(;++o<a;)(p||o<i)&&(c[n[o]]=t[o]);for(;l--;)c[s++]=t[o++];return c}var Ti=Math.max;function Ai(t,e,n,r){for(var o=-1,i=t.length,a=-1,s=n.length,u=-1,l=e.length,c=Ti(i-s,0),p=Array(c+l),d=!r;++o<c;)p[o]=t[o];for(var f=o;++u<l;)p[f+u]=e[u];for(;++a<s;)(d||o<i)&&(p[f+n[a]]=t[o++]);return p}function Oi(){}var Di=4294967295;function Ni(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Di,this.__views__=[]}function Pi(){}Ni.prototype=bi(Oi.prototype),Ni.prototype.constructor=Ni;var Ci=gi?function(t){return gi.get(t)}:Pi,Ii={},Li=Object.prototype.hasOwnProperty;function ji(t){for(var e=t.name+"",n=Ii[e],r=Li.call(Ii,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function ki(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Ri(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function Bi(t){if(t instanceof Ni)return t.clone();var e=new ki(t.__wrapped__,t.__chain__);return e.__actions__=Ri(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}ki.prototype=bi(Oi.prototype),ki.prototype.constructor=ki;var zi=Object.prototype.hasOwnProperty;function Ui(t){if(Mo(t)&&!Do(t)&&!(t instanceof Ni)){if(t instanceof ki)return t;if(zi.call(t,"__wrapped__"))return Bi(t)}return new ki(t)}function Xi(t){var e=ji(t),n=Ui[e];if("function"!=typeof n||!(e in Ni.prototype))return!1;if(t===n)return!0;var r=Ci(n);return!!r&&t===r[0]}Ui.prototype=Oi.prototype,Ui.prototype.constructor=Ui;var Hi=Date.now;function Wi(t){var e=0,n=0;return function(){var r=Hi(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Gi=Wi(_i),Yi=/\{\n\/\* \[wrapped with (.+)\] \*/,Vi=/,? & /;var Fi=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function Ki(t){return function(){return t}}var qi=function(){try{var t=vi(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Zi=qi?function(t,e){return qi(t,"toString",{configurable:!0,enumerable:!1,value:Ki(e),writable:!0})}:$o,$i=Wi(Zi);function Ji(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Qi(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function ta(t){return t!=t}function ea(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):Qi(t,ta,n)}function na(t,e){return!!(null==t?0:t.length)&&ea(t,e,0)>-1}var ra=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function oa(t,e,n){var r=e+"";return $i(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Fi,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ji(ra,(function(n){var r="_."+n[0];e&n[1]&&!na(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(Yi);return e?e[1].split(Vi):[]}(r),n)))}var ia=1,aa=2,sa=4,ua=8,la=32,ca=64;function pa(t,e,n,r,o,i,a,s,u,l){var c=e&ua;e|=c?la:ca,(e&=~(c?ca:la))&sa||(e&=~(ia|aa));var p=[t,e,o,c?i:void 0,c?a:void 0,c?void 0:i,c?void 0:a,s,u,l],d=n.apply(void 0,p);return Xi(t)&&Gi(d,p),d.placeholder=r,oa(d,t,e)}function da(t){return t.placeholder}var fa=9007199254740991,ha=/^(?:0|[1-9]\d*)$/;function va(t,e){var n=typeof t;return!!(e=null==e?fa:e)&&("number"==n||"symbol"!=n&&ha.test(t))&&t>-1&&t%1==0&&t<e}var ya=Math.min;var ga="__lodash_placeholder__";function _a(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n];a!==e&&a!==ga||(t[n]=ga,i[o++]=n)}return i}var ma=1,ba=2,Ea=8,xa=16,Ma=128,wa=512;function Sa(t,e,n,r,o,i,a,s,u,l){var c=e&Ma,p=e&ma,d=e&ba,f=e&(Ea|xa),h=e&wa,v=d?void 0:Ei(t);return function y(){for(var g=arguments.length,_=Array(g),m=g;m--;)_[m]=arguments[m];if(f)var b=da(y),E=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(_,b);if(r&&(_=Si(_,r,o,f)),i&&(_=Ai(_,i,a,f)),g-=E,f&&g<l){var x=_a(_,b);return pa(t,e,Sa,y.placeholder,n,_,x,s,u,l-g)}var M=p?n:this,w=d?M[t]:t;return g=_.length,s?_=function(t,e){for(var n=t.length,r=ya(e.length,n),o=Ri(t);r--;){var i=e[r];t[r]=va(i,n)?o[i]:void 0}return t}(_,s):h&&g>1&&_.reverse(),c&&u<g&&(_.length=u),this&&this!==po&&this instanceof y&&(w=v||Ei(w)),w.apply(M,_)}}var Ta=1;var Aa="__lodash_placeholder__",Oa=1,Da=2,Na=4,Pa=8,Ca=128,Ia=256,La=Math.min;var ja="Expected a function",ka=1,Ra=2,Ba=8,za=16,Ua=32,Xa=64,Ha=Math.max;function Wa(t,e,n,r,o,i,a,s){var u=e&Ra;if(!u&&"function"!=typeof t)throw new TypeError(ja);var l=r?r.length:0;if(l||(e&=~(Ua|Xa),r=o=void 0),a=void 0===a?a:Ha(Zo(a),0),s=void 0===s?s:Zo(s),l-=o?o.length:0,e&Xa){var c=r,p=o;r=o=void 0}var d=u?void 0:Ci(t),f=[t,e,n,r,o,c,p,i,a,s];if(d&&function(t,e){var n=t[1],r=e[1],o=n|r,i=o<(Oa|Da|Ca),a=r==Ca&&n==Pa||r==Ca&&n==Ia&&t[7].length<=e[8]||r==(Ca|Ia)&&e[7].length<=e[8]&&n==Pa;if(!i&&!a)return t;r&Oa&&(t[2]=e[2],o|=n&Oa?0:Na);var s=e[3];if(s){var u=t[3];t[3]=u?Si(u,s,e[4]):s,t[4]=u?_a(t[3],Aa):e[4]}(s=e[5])&&(u=t[5],t[5]=u?Ai(u,s,e[6]):s,t[6]=u?_a(t[5],Aa):e[6]),(s=e[7])&&(t[7]=s),r&Ca&&(t[8]=null==t[8]?e[8]:La(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(f,d),t=f[0],e=f[1],n=f[2],r=f[3],o=f[4],!(s=f[9]=void 0===f[9]?u?0:t.length:Ha(f[9]-l,0))&&e&(Ba|za)&&(e&=~(Ba|za)),e&&e!=ka)h=e==Ba||e==za?function(t,e,n){var r=Ei(t);return function o(){for(var i=arguments.length,a=Array(i),s=i,u=da(o);s--;)a[s]=arguments[s];var l=i<3&&a[0]!==u&&a[i-1]!==u?[]:_a(a,u);return(i-=l.length)<n?pa(t,e,Sa,o.placeholder,void 0,a,l,void 0,void 0,n-i):Mi(this&&this!==po&&this instanceof o?r:t,this,a)}}(t,e,s):e!=Ua&&e!=(ka|Ua)||o.length?Sa.apply(void 0,f):function(t,e,n,r){var o=e&Ta,i=Ei(t);return function e(){for(var a=-1,s=arguments.length,u=-1,l=r.length,c=Array(l+s),p=this&&this!==po&&this instanceof e?i:t;++u<l;)c[u]=r[u];for(;s--;)c[u++]=arguments[++a];return Mi(p,o?n:this,c)}}(t,e,n,r);else var h=function(t,e,n){var r=e&xi,o=Ei(t);return function e(){return(this&&this!==po&&this instanceof e?o:t).apply(r?n:this,arguments)}}(t,e,n);return oa((d?_i:Gi)(h,f),t,e)}var Ga=128;function Ya(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,Wa(t,Ga,void 0,void 0,void 0,void 0,e)}function Va(t,e,n){"__proto__"==e&&qi?qi(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Fa(t,e){return t===e||t!=t&&e!=e}var Ka=Object.prototype.hasOwnProperty;function qa(t,e,n){var r=t[e];Ka.call(t,e)&&Fa(r,n)&&(void 0!==n||e in t)||Va(t,e,n)}function Za(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],u=r?r(n[s],t[s],s,n,t):void 0;void 0===u&&(u=t[s]),o?Va(n,s,u):qa(n,s,u)}return n}var $a=Math.max;function Ja(t,e,n){return e=$a(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=$a(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=r[o];return s[e]=n(a),Mi(t,this,s)}}function Qa(t,e){return $i(Ja(t,e,$o),t+"")}var ts=9007199254740991;function es(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=ts}function ns(t){return null!=t&&es(t.length)&&!ni(t)}function rs(t,e,n){if(!Uo(n))return!1;var r=typeof e;return!!("number"==r?ns(n)&&va(e,n.length):"string"==r&&e in n)&&Fa(n[e],t)}function os(t){return Qa((function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,a&&rs(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++r<o;){var s=n[r];s&&t(e,s,r,i)}return e}))}var is=Object.prototype;function as(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||is)}function ss(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function us(t){return Mo(t)&&"[object Arguments]"==xo(t)}var ls=Object.prototype,cs=ls.hasOwnProperty,ps=ls.propertyIsEnumerable,ds=us(function(){return arguments}())?us:function(t){return Mo(t)&&cs.call(t,"callee")&&!ps.call(t,"callee")};function fs(){return!1}var hs="object"==typeof t&&t&&!t.nodeType&&t,vs=hs&&"object"==typeof module&&module&&!module.nodeType&&module,ys=vs&&vs.exports===hs?po.Buffer:void 0,gs=(ys?ys.isBuffer:void 0)||fs,_s={};function ms(t){return function(e){return t(e)}}_s["[object Float32Array]"]=_s["[object Float64Array]"]=_s["[object Int8Array]"]=_s["[object Int16Array]"]=_s["[object Int32Array]"]=_s["[object Uint8Array]"]=_s["[object Uint8ClampedArray]"]=_s["[object Uint16Array]"]=_s["[object Uint32Array]"]=!0,_s["[object Arguments]"]=_s["[object Array]"]=_s["[object ArrayBuffer]"]=_s["[object Boolean]"]=_s["[object DataView]"]=_s["[object Date]"]=_s["[object Error]"]=_s["[object Function]"]=_s["[object Map]"]=_s["[object Number]"]=_s["[object Object]"]=_s["[object RegExp]"]=_s["[object Set]"]=_s["[object String]"]=_s["[object WeakMap]"]=!1;var bs="object"==typeof t&&t&&!t.nodeType&&t,Es=bs&&"object"==typeof module&&module&&!module.nodeType&&module,xs=Es&&Es.exports===bs&&lo.process,Ms=function(){try{var t=Es&&Es.require&&Es.require("util").types;return t||xs&&xs.binding&&xs.binding("util")}catch(t){}}(),ws=Ms&&Ms.isTypedArray,Ss=ws?ms(ws):function(t){return Mo(t)&&es(t.length)&&!!_s[xo(t)]},Ts=Object.prototype.hasOwnProperty;function As(t,e){var n=Do(t),r=!n&&ds(t),o=!n&&!r&&gs(t),i=!n&&!r&&!o&&Ss(t),a=n||r||o||i,s=a?ss(t.length,String):[],u=s.length;for(var l in t)!e&&!Ts.call(t,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||va(l,u))||s.push(l);return s}function Os(t,e){return function(n){return t(e(n))}}var Ds=Os(Object.keys,Object),Ns=Object.prototype.hasOwnProperty;function Ps(t){if(!as(t))return Ds(t);var e=[];for(var n in Object(t))Ns.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Cs(t){return ns(t)?As(t):Ps(t)}var Is=Object.prototype.hasOwnProperty,Ls=os((function(t,e){if(as(e)||ns(e))Za(e,Cs(e),t);else for(var n in e)Is.call(e,n)&&qa(t,n,e[n])}));var js=Object.prototype.hasOwnProperty;function ks(t){if(!Uo(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=as(t),n=[];for(var r in t)("constructor"!=r||!e&&js.call(t,r))&&n.push(r);return n}function Rs(t){return ns(t)?As(t,!0):ks(t)}var Bs=os((function(t,e){Za(e,Rs(e),t)})),zs=os((function(t,e,n,r){Za(e,Rs(e),t,r)})),Us=os((function(t,e,n,r){Za(e,Cs(e),t,r)})),Xs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hs=/^\w*$/;function Ws(t,e){if(Do(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!So(t))||(Hs.test(t)||!Xs.test(t)||null!=e&&t in Object(e))}var Gs=vi(Object,"create");var Ys=Object.prototype.hasOwnProperty;var Vs=Object.prototype.hasOwnProperty;function Fs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ks(t,e){for(var n=t.length;n--;)if(Fa(t[n][0],e))return n;return-1}Fs.prototype.clear=function(){this.__data__=Gs?Gs(null):{},this.size=0},Fs.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Fs.prototype.get=function(t){var e=this.__data__;if(Gs){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Ys.call(e,t)?e[t]:void 0},Fs.prototype.has=function(t){var e=this.__data__;return Gs?void 0!==e[t]:Vs.call(e,t)},Fs.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Gs&&void 0===e?"__lodash_hash_undefined__":e,this};var qs=Array.prototype.splice;function Zs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Zs.prototype.clear=function(){this.__data__=[],this.size=0},Zs.prototype.delete=function(t){var e=this.__data__,n=Ks(e,t);return!(n<0)&&(n==e.length-1?e.pop():qs.call(e,n,1),--this.size,!0)},Zs.prototype.get=function(t){var e=this.__data__,n=Ks(e,t);return n<0?void 0:e[n][1]},Zs.prototype.has=function(t){return Ks(this.__data__,t)>-1},Zs.prototype.set=function(t,e){var n=this.__data__,r=Ks(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var $s=vi(po,"Map");function Js(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function Qs(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Qs.prototype.clear=function(){this.size=0,this.__data__={hash:new Fs,map:new($s||Zs),string:new Fs}},Qs.prototype.delete=function(t){var e=Js(this,t).delete(t);return this.size-=e?1:0,e},Qs.prototype.get=function(t){return Js(this,t).get(t)},Qs.prototype.has=function(t){return Js(this,t).has(t)},Qs.prototype.set=function(t,e){var n=Js(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var tu="Expected a function";function eu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(tu);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(eu.Cache||Qs),n}eu.Cache=Qs;var nu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ru=/\\(\\)?/g,ou=function(t){var e=eu(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(nu,(function(t,n,r,o){e.push(r?o.replace(ru,"$1"):n||t)})),e}));function iu(t){return null==t?"":Io(t)}function au(t,e){return Do(t)?t:Ws(t,e)?[t]:ou(iu(t))}var su=1/0;function uu(t){if("string"==typeof t||So(t))return t;var e=t+"";return"0"==e&&1/t==-su?"-0":e}function lu(t,e){for(var n=0,r=(e=au(e,t)).length;null!=t&&n<r;)t=t[uu(e[n++])];return n&&n==r?t:void 0}function cu(t,e,n){var r=null==t?void 0:lu(t,e);return void 0===r?n:r}function pu(t,e){for(var n=-1,r=e.length,o=Array(r),i=null==t;++n<r;)o[n]=i?void 0:cu(t,e[n]);return o}function du(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var fu=fo?fo.isConcatSpreadable:void 0;function hu(t){return Do(t)||ds(t)||!!(fu&&t&&t[fu])}function vu(t,e,n,r,o){var i=-1,a=t.length;for(n||(n=hu),o||(o=[]);++i<a;){var s=t[i];e>0&&n(s)?e>1?vu(s,e-1,n,r,o):du(o,s):r||(o[o.length]=s)}return o}function yu(t){return(null==t?0:t.length)?vu(t,1):[]}function gu(t){return $i(Ja(t,void 0,yu),t+"")}var _u=gu(pu),mu=Os(Object.getPrototypeOf,Object),bu="[object Object]",Eu=Function.prototype,xu=Object.prototype,Mu=Eu.toString,wu=xu.hasOwnProperty,Su=Mu.call(Object);function Tu(t){if(!Mo(t)||xo(t)!=bu)return!1;var e=mu(t);if(null===e)return!0;var n=wu.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Mu.call(n)==Su}var Au="[object DOMException]",Ou="[object Error]";function Du(t){if(!Mo(t))return!1;var e=xo(t);return e==Ou||e==Au||"string"==typeof t.message&&"string"==typeof t.name&&!Tu(t)}var Nu=Qa((function(t,e){try{return Mi(t,void 0,e)}catch(t){return Du(t)?t:new Error(t)}})),Pu="Expected a function";function Cu(t,e){var n;if("function"!=typeof e)throw new TypeError(Pu);return t=Zo(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var Iu=Qa((function(t,e,n){var r=1;if(n.length){var o=_a(n,da(Iu));r|=32}return Wa(t,r,e,n,o)}));Iu.placeholder={};var Lu=gu((function(t,e){return Ji(e,(function(e){e=uu(e),Va(t,e,Iu(t[e],t))})),t})),ju=Qa((function(t,e,n){var r=3;if(n.length){var o=_a(n,da(ju));r|=32}return Wa(e,r,t,n,o)}));function ku(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i}function Ru(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:ku(t,e,n)}ju.placeholder={};var Bu=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function zu(t){return Bu.test(t)}var Uu="\\ud800-\\udfff",Xu="["+Uu+"]",Hu="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Wu="\\ud83c[\\udffb-\\udfff]",Gu="[^"+Uu+"]",Yu="(?:\\ud83c[\\udde6-\\uddff]){2}",Vu="[\\ud800-\\udbff][\\udc00-\\udfff]",Fu="(?:"+Hu+"|"+Wu+")"+"?",Ku="[\\ufe0e\\ufe0f]?",qu=Ku+Fu+("(?:\\u200d(?:"+[Gu,Yu,Vu].join("|")+")"+Ku+Fu+")*"),Zu="(?:"+[Gu+Hu+"?",Hu,Yu,Vu,Xu].join("|")+")",$u=RegExp(Wu+"(?="+Wu+")|"+Zu+qu,"g");function Ju(t){return zu(t)?function(t){return t.match($u)||[]}(t):function(t){return t.split("")}(t)}function Qu(t){return function(e){var n=zu(e=iu(e))?Ju(e):void 0,r=n?n[0]:e.charAt(0),o=n?Ru(n,1).join(""):e.slice(1);return r[t]()+o}}var tl=Qu("toUpperCase");function el(t){return tl(iu(t).toLowerCase())}function nl(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function rl(t){return function(e){return null==t?void 0:t[e]}}var ol=rl({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),il=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,al=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function sl(t){return(t=iu(t))&&t.replace(il,ol).replace(al,"")}var ul=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var ll=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var cl="\\ud800-\\udfff",pl="\\u2700-\\u27bf",dl="a-z\\xdf-\\xf6\\xf8-\\xff",fl="A-Z\\xc0-\\xd6\\xd8-\\xde",hl="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",vl="["+hl+"]",yl="\\d+",gl="["+pl+"]",_l="["+dl+"]",ml="[^"+cl+hl+yl+pl+dl+fl+"]",bl="(?:\\ud83c[\\udde6-\\uddff]){2}",El="[\\ud800-\\udbff][\\udc00-\\udfff]",xl="["+fl+"]",Ml="(?:"+_l+"|"+ml+")",wl="(?:"+xl+"|"+ml+")",Sl="(?:['’](?:d|ll|m|re|s|t|ve))?",Tl="(?:['’](?:D|LL|M|RE|S|T|VE))?",Al="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Ol="[\\ufe0e\\ufe0f]?",Dl=Ol+Al+("(?:\\u200d(?:"+["[^"+cl+"]",bl,El].join("|")+")"+Ol+Al+")*"),Nl="(?:"+[gl,bl,El].join("|")+")"+Dl,Pl=RegExp([xl+"?"+_l+"+"+Sl+"(?="+[vl,xl,"$"].join("|")+")",wl+"+"+Tl+"(?="+[vl,xl+Ml,"$"].join("|")+")",xl+"?"+Ml+"+"+Sl,xl+"+"+Tl,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yl,Nl].join("|"),"g");function Cl(t,e,n){return t=iu(t),void 0===(e=n?void 0:e)?function(t){return ll.test(t)}(t)?function(t){return t.match(Pl)||[]}(t):function(t){return t.match(ul)||[]}(t):t.match(e)||[]}var Il=RegExp("['’]","g");function Ll(t){return function(e){return nl(Cl(sl(e).replace(Il,"")),t,"")}}var jl=Ll((function(t,e,n){return e=e.toLowerCase(),t+(n?el(e):e)}));var kl=po.isFinite,Rl=Math.min;function Bl(t){var e=Math[t];return function(t,n){if(t=Vo(t),(n=null==n?0:Rl(Zo(n),292))&&kl(t)){var r=(iu(t)+"e").split("e");return+((r=(iu(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var zl=Bl("ceil");function Ul(t){var e=Ui(t);return e.__chain__=!0,e}var Xl=Math.ceil,Hl=Math.max;function Wl(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function Gl(t){var e=this.__data__=new Zs(t);this.size=e.size}function Yl(t,e){return t&&Za(e,Cs(e),t)}Gl.prototype.clear=function(){this.__data__=new Zs,this.size=0},Gl.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Gl.prototype.get=function(t){return this.__data__.get(t)},Gl.prototype.has=function(t){return this.__data__.has(t)},Gl.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Zs){var r=n.__data__;if(!$s||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Qs(r)}return n.set(t,e),this.size=n.size,this};var Vl="object"==typeof t&&t&&!t.nodeType&&t,Fl=Vl&&"object"==typeof module&&module&&!module.nodeType&&module,Kl=Fl&&Fl.exports===Vl?po.Buffer:void 0,ql=Kl?Kl.allocUnsafe:void 0;function Zl(t,e){if(e)return t.slice();var n=t.length,r=ql?ql(n):new t.constructor(n);return t.copy(r),r}function $l(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}function Jl(){return[]}var Ql=Object.prototype.propertyIsEnumerable,tc=Object.getOwnPropertySymbols,ec=tc?function(t){return null==t?[]:(t=Object(t),$l(tc(t),(function(e){return Ql.call(t,e)})))}:Jl;var nc=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)du(e,ec(t)),t=mu(t);return e}:Jl;function rc(t,e,n){var r=e(t);return Do(t)?r:du(r,n(t))}function oc(t){return rc(t,Cs,ec)}function ic(t){return rc(t,Rs,nc)}var ac=vi(po,"DataView"),sc=vi(po,"Promise"),uc=vi(po,"Set"),lc="[object Map]",cc="[object Promise]",pc="[object Set]",dc="[object WeakMap]",fc="[object DataView]",hc=si(ac),vc=si($s),yc=si(sc),gc=si(uc),_c=si(yi),mc=xo;(ac&&mc(new ac(new ArrayBuffer(1)))!=fc||$s&&mc(new $s)!=lc||sc&&mc(sc.resolve())!=cc||uc&&mc(new uc)!=pc||yi&&mc(new yi)!=dc)&&(mc=function(t){var e=xo(t),n="[object Object]"==e?t.constructor:void 0,r=n?si(n):"";if(r)switch(r){case hc:return fc;case vc:return lc;case yc:return cc;case gc:return pc;case _c:return dc}return e});var bc=mc,Ec=Object.prototype.hasOwnProperty;var xc=po.Uint8Array;function Mc(t){var e=new t.constructor(t.byteLength);return new xc(e).set(new xc(t)),e}var wc=/\w*$/;var Sc=fo?fo.prototype:void 0,Tc=Sc?Sc.valueOf:void 0;function Ac(t,e){var n=e?Mc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var Oc="[object Boolean]",Dc="[object Date]",Nc="[object Map]",Pc="[object Number]",Cc="[object RegExp]",Ic="[object Set]",Lc="[object String]",jc="[object Symbol]",kc="[object ArrayBuffer]",Rc="[object DataView]",Bc="[object Float32Array]",zc="[object Float64Array]",Uc="[object Int8Array]",Xc="[object Int16Array]",Hc="[object Int32Array]",Wc="[object Uint8Array]",Gc="[object Uint8ClampedArray]",Yc="[object Uint16Array]",Vc="[object Uint32Array]";function Fc(t,e,n){var r,o=t.constructor;switch(e){case kc:return Mc(t);case Oc:case Dc:return new o(+t);case Rc:return function(t,e){var n=e?Mc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case Bc:case zc:case Uc:case Xc:case Hc:case Wc:case Gc:case Yc:case Vc:return Ac(t,n);case Nc:return new o;case Pc:case Lc:return new o(t);case Cc:return function(t){var e=new t.constructor(t.source,wc.exec(t));return e.lastIndex=t.lastIndex,e}(t);case Ic:return new o;case jc:return r=t,Tc?Object(Tc.call(r)):{}}}function Kc(t){return"function"!=typeof t.constructor||as(t)?{}:bi(mu(t))}var qc=Ms&&Ms.isMap,Zc=qc?ms(qc):function(t){return Mo(t)&&"[object Map]"==bc(t)};var $c=Ms&&Ms.isSet,Jc=$c?ms($c):function(t){return Mo(t)&&"[object Set]"==bc(t)},Qc=1,tp=2,ep=4,np="[object Arguments]",rp="[object Function]",op="[object GeneratorFunction]",ip="[object Object]",ap={};function sp(t,e,n,r,o,i){var a,s=e&Qc,u=e&tp,l=e&ep;if(n&&(a=o?n(t,r,o,i):n(t)),void 0!==a)return a;if(!Uo(t))return t;var c=Do(t);if(c){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ec.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return Ri(t,a)}else{var p=bc(t),d=p==rp||p==op;if(gs(t))return Zl(t,s);if(p==ip||p==np||d&&!o){if(a=u||d?{}:Kc(t),!s)return u?function(t,e){return Za(t,nc(t),e)}(t,function(t,e){return t&&Za(e,Rs(e),t)}(a,t)):function(t,e){return Za(t,ec(t),e)}(t,Yl(a,t))}else{if(!ap[p])return o?t:{};a=Fc(t,p,s)}}i||(i=new Gl);var f=i.get(t);if(f)return f;i.set(t,a),Jc(t)?t.forEach((function(r){a.add(sp(r,e,n,r,t,i))})):Zc(t)&&t.forEach((function(r,o){a.set(o,sp(r,e,n,o,t,i))}));var h=c?void 0:(l?u?ic:oc:u?Rs:Cs)(t);return Ji(h||t,(function(r,o){h&&(r=t[o=r]),qa(a,o,sp(r,e,n,o,t,i))})),a}ap[np]=ap["[object Array]"]=ap["[object ArrayBuffer]"]=ap["[object DataView]"]=ap["[object Boolean]"]=ap["[object Date]"]=ap["[object Float32Array]"]=ap["[object Float64Array]"]=ap["[object Int8Array]"]=ap["[object Int16Array]"]=ap["[object Int32Array]"]=ap["[object Map]"]=ap["[object Number]"]=ap[ip]=ap["[object RegExp]"]=ap["[object Set]"]=ap["[object String]"]=ap["[object Symbol]"]=ap["[object Uint8Array]"]=ap["[object Uint8ClampedArray]"]=ap["[object Uint16Array]"]=ap["[object Uint32Array]"]=!0,ap["[object Error]"]=ap[rp]=ap["[object WeakMap]"]=!1;function up(t){return sp(t,5)}function lp(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Qs;++e<n;)this.add(t[e])}function cp(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function pp(t,e){return t.has(e)}lp.prototype.add=lp.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},lp.prototype.has=function(t){return this.__data__.has(t)};var dp=1,fp=2;function hp(t,e,n,r,o,i){var a=n&dp,s=t.length,u=e.length;if(s!=u&&!(a&&u>s))return!1;var l=i.get(t),c=i.get(e);if(l&&c)return l==e&&c==t;var p=-1,d=!0,f=n&fp?new lp:void 0;for(i.set(t,e),i.set(e,t);++p<s;){var h=t[p],v=e[p];if(r)var y=a?r(v,h,p,e,t,i):r(h,v,p,t,e,i);if(void 0!==y){if(y)continue;d=!1;break}if(f){if(!cp(e,(function(t,e){if(!pp(f,e)&&(h===t||o(h,t,n,r,i)))return f.push(e)}))){d=!1;break}}else if(h!==v&&!o(h,v,n,r,i)){d=!1;break}}return i.delete(t),i.delete(e),d}function vp(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function yp(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var gp=1,_p=2,mp="[object Boolean]",bp="[object Date]",Ep="[object Error]",xp="[object Map]",Mp="[object Number]",wp="[object RegExp]",Sp="[object Set]",Tp="[object String]",Ap="[object Symbol]",Op="[object ArrayBuffer]",Dp="[object DataView]",Np=fo?fo.prototype:void 0,Pp=Np?Np.valueOf:void 0;var Cp=1,Ip=Object.prototype.hasOwnProperty;var Lp=1,jp="[object Arguments]",kp="[object Array]",Rp="[object Object]",Bp=Object.prototype.hasOwnProperty;function zp(t,e,n,r,o,i){var a=Do(t),s=Do(e),u=a?kp:bc(t),l=s?kp:bc(e),c=(u=u==jp?Rp:u)==Rp,p=(l=l==jp?Rp:l)==Rp,d=u==l;if(d&&gs(t)){if(!gs(e))return!1;a=!0,c=!1}if(d&&!c)return i||(i=new Gl),a||Ss(t)?hp(t,e,n,r,o,i):function(t,e,n,r,o,i,a){switch(n){case Dp:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Op:return!(t.byteLength!=e.byteLength||!i(new xc(t),new xc(e)));case mp:case bp:case Mp:return Fa(+t,+e);case Ep:return t.name==e.name&&t.message==e.message;case wp:case Tp:return t==e+"";case xp:var s=vp;case Sp:var u=r&gp;if(s||(s=yp),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=_p,a.set(t,e);var c=hp(s(t),s(e),r,o,i,a);return a.delete(t),c;case Ap:if(Pp)return Pp.call(t)==Pp.call(e)}return!1}(t,e,u,n,r,o,i);if(!(n&Lp)){var f=c&&Bp.call(t,"__wrapped__"),h=p&&Bp.call(e,"__wrapped__");if(f||h){var v=f?t.value():t,y=h?e.value():e;return i||(i=new Gl),o(v,y,n,r,i)}}return!!d&&(i||(i=new Gl),function(t,e,n,r,o,i){var a=n&Cp,s=oc(t),u=s.length;if(u!=oc(e).length&&!a)return!1;for(var l=u;l--;){var c=s[l];if(!(a?c in e:Ip.call(e,c)))return!1}var p=i.get(t),d=i.get(e);if(p&&d)return p==e&&d==t;var f=!0;i.set(t,e),i.set(e,t);for(var h=a;++l<u;){var v=t[c=s[l]],y=e[c];if(r)var g=a?r(y,v,c,e,t,i):r(v,y,c,t,e,i);if(!(void 0===g?v===y||o(v,y,n,r,i):g)){f=!1;break}h||(h="constructor"==c)}if(f&&!h){var _=t.constructor,m=e.constructor;_==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof _&&_ instanceof _&&"function"==typeof m&&m instanceof m||(f=!1)}return i.delete(t),i.delete(e),f}(t,e,n,r,o,i))}function Up(t,e,n,r,o){return t===e||(null==t||null==e||!Mo(t)&&!Mo(e)?t!=t&&e!=e:zp(t,e,n,r,Up,o))}var Xp=1,Hp=2;function Wp(t,e,n,r){var o=n.length,i=o,a=!r;if(null==t)return!i;for(t=Object(t);o--;){var s=n[o];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){var u=(s=n[o])[0],l=t[u],c=s[1];if(a&&s[2]){if(void 0===l&&!(u in t))return!1}else{var p=new Gl;if(r)var d=r(l,c,u,t,e,p);if(!(void 0===d?Up(c,l,Xp|Hp,r,p):d))return!1}}return!0}function Gp(t){return t==t&&!Uo(t)}function Yp(t){for(var e=Cs(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Gp(o)]}return e}function Vp(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function Fp(t){var e=Yp(t);return 1==e.length&&e[0][2]?Vp(e[0][0],e[0][1]):function(n){return n===t||Wp(n,t,e)}}function Kp(t,e){return null!=t&&e in Object(t)}function qp(t,e,n){for(var r=-1,o=(e=au(e,t)).length,i=!1;++r<o;){var a=uu(e[r]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&es(o)&&va(a,o)&&(Do(t)||ds(t))}function Zp(t,e){return null!=t&&qp(t,e,Kp)}var $p=1,Jp=2;function Qp(t,e){return Ws(t)&&Gp(e)?Vp(uu(t),e):function(n){var r=cu(n,t);return void 0===r&&r===e?Zp(n,t):Up(e,r,$p|Jp)}}function td(t){return function(e){return null==e?void 0:e[t]}}function ed(t){return Ws(t)?td(uu(t)):function(t){return function(e){return lu(e,t)}}(t)}function nd(t){return"function"==typeof t?t:null==t?$o:"object"==typeof t?Do(t)?Qp(t[0],t[1]):Fp(t):ed(t)}function rd(t,e,n){var r=n.length;if(null==t)return!r;for(t=Object(t);r--;){var o=n[r],i=e[o],a=t[o];if(void 0===a&&!(o in t)||!i(a))return!1}return!0}function od(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var a=t[o];e(r,a,n(a),t)}return r}function id(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++o];if(!1===n(i[u],u,i))break}return e}}var ad=id();function sd(t,e){return t&&ad(t,e,Cs)}function ud(t,e){return function(n,r){if(null==n)return n;if(!ns(n))return t(n,r);for(var o=n.length,i=e?o:-1,a=Object(n);(e?i--:++i<o)&&!1!==r(a[i],i,a););return n}}var ld=ud(sd);function cd(t,e,n,r){return ld(t,(function(t,o,i){e(r,t,n(t),i)})),r}function pd(t,e){return function(n,r){var o=Do(n)?od:cd,i=e?e():{};return o(n,t,nd(r),i)}}var dd=Object.prototype.hasOwnProperty,fd=pd((function(t,e,n){dd.call(t,n)?++t[n]:Va(t,n,1)}));function hd(t,e,n){var r=Wa(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=hd.placeholder,r}hd.placeholder={};function vd(t,e,n){var r=Wa(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=vd.placeholder,r}vd.placeholder={};var yd=function(){return po.Date.now()},gd="Expected a function",_d=Math.max,md=Math.min;function bd(t,e,n){var r,o,i,a,s,u,l=0,c=!1,p=!1,d=!0;if("function"!=typeof t)throw new TypeError(gd);function f(e){var n=r,i=o;return r=o=void 0,l=e,a=t.apply(i,n)}function h(t){var n=t-u;return void 0===u||n>=e||n<0||p&&t-l>=i}function v(){var t=yd();if(h(t))return y(t);s=setTimeout(v,function(t){var n=e-(t-u);return p?md(n,i-(t-l)):n}(t))}function y(t){return s=void 0,d&&r?f(t):(r=o=void 0,a)}function g(){var t=yd(),n=h(t);if(r=arguments,o=this,u=t,n){if(void 0===s)return function(t){return l=t,s=setTimeout(v,e),c?f(t):a}(u);if(p)return clearTimeout(s),s=setTimeout(v,e),f(u)}return void 0===s&&(s=setTimeout(v,e)),a}return e=Vo(e)||0,Uo(n)&&(c=!!n.leading,i=(p="maxWait"in n)?_d(Vo(n.maxWait)||0,e):i,d="trailing"in n?!!n.trailing:d),g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=o=s=void 0},g.flush=function(){return void 0===s?a:y(yd())},g}var Ed=Object.prototype,xd=Ed.hasOwnProperty,Md=Qa((function(t,e){t=Object(t);var n=-1,r=e.length,o=r>2?e[2]:void 0;for(o&&rs(e[0],e[1],o)&&(r=1);++n<r;)for(var i=e[n],a=Rs(i),s=-1,u=a.length;++s<u;){var l=a[s],c=t[l];(void 0===c||Fa(c,Ed[l])&&!xd.call(t,l))&&(t[l]=i[l])}return t}));function wd(t,e,n){(void 0!==n&&!Fa(t[e],n)||void 0===n&&!(e in t))&&Va(t,e,n)}function Sd(t){return Mo(t)&&ns(t)}function Td(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Ad(t){return Za(t,Rs(t))}function Od(t,e,n,r,o){t!==e&&ad(e,(function(i,a){if(o||(o=new Gl),Uo(i))!function(t,e,n,r,o,i,a){var s=Td(t,n),u=Td(e,n),l=a.get(u);if(l)wd(t,n,l);else{var c=i?i(s,u,n+"",t,e,a):void 0,p=void 0===c;if(p){var d=Do(u),f=!d&&gs(u),h=!d&&!f&&Ss(u);c=u,d||f||h?Do(s)?c=s:Sd(s)?c=Ri(s):f?(p=!1,c=Zl(u,!0)):h?(p=!1,c=Ac(u,!0)):c=[]:Tu(u)||ds(u)?(c=s,ds(s)?c=Ad(s):Uo(s)&&!ni(s)||(c=Kc(u))):p=!1}p&&(a.set(u,c),o(c,u,r,i,a),a.delete(u)),wd(t,n,c)}}(t,e,a,n,Od,r,o);else{var s=r?r(Td(t,a),i,a+"",t,e,o):void 0;void 0===s&&(s=i),wd(t,a,s)}}),Rs)}function Dd(t,e,n,r,o,i){return Uo(t)&&Uo(e)&&(i.set(e,t),Od(t,e,void 0,Dd,i),i.delete(e)),t}var Nd=os((function(t,e,n,r){Od(t,e,n,r)})),Pd=Qa((function(t){return t.push(void 0,Dd),Mi(Nd,void 0,t)}));function Cd(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}var Id=Qa((function(t,e){return Cd(t,1,e)})),Ld=Qa((function(t,e,n){return Cd(t,Vo(e)||0,n)}));function jd(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}var kd=200;function Rd(t,e,n,r){var o=-1,i=na,a=!0,s=t.length,u=[],l=e.length;if(!s)return u;n&&(e=Oo(e,ms(n))),r?(i=jd,a=!1):e.length>=kd&&(i=pp,a=!1,e=new lp(e));t:for(;++o<s;){var c=t[o],p=null==n?c:n(c);if(c=r||0!==c?c:0,a&&p==p){for(var d=l;d--;)if(e[d]===p)continue t;u.push(c)}else i(e,p,r)||u.push(c)}return u}var Bd=Qa((function(t,e){return Sd(t)?Rd(t,vu(e,1,Sd,!0)):[]}));function zd(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var Ud=Qa((function(t,e){var n=zd(e);return Sd(n)&&(n=void 0),Sd(t)?Rd(t,vu(e,1,Sd,!0),nd(n)):[]})),Xd=Qa((function(t,e){var n=zd(e);return Sd(n)&&(n=void 0),Sd(t)?Rd(t,vu(e,1,Sd,!0),void 0,n):[]})),Hd=Lo((function(t,e){return t/e}),1);function Wd(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?ku(t,r?0:i,r?i+1:o):ku(t,r?i+1:0,r?o:i)}function Gd(t){return"function"==typeof t?t:$o}function Yd(t,e){return(Do(t)?Ji:ld)(t,Gd(e))}function Vd(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}var Fd=id(!0);function Kd(t,e){return t&&Fd(t,e,Cs)}var qd=ud(Kd,!0);function Zd(t,e){return(Do(t)?Vd:qd)(t,Gd(e))}function $d(t){return function(e){var n=bc(e);return"[object Map]"==n?vp(e):"[object Set]"==n?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return Oo(e,(function(e){return[e,t[e]]}))}(e,t(e))}}var Jd=$d(Cs),Qd=$d(Rs),tf=rl({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),ef=/[&<>"']/g,nf=RegExp(ef.source);function rf(t){return(t=iu(t))&&nf.test(t)?t.replace(ef,tf):t}var of=/[\\^$.*+?()[\]{}|]/g,af=RegExp(of.source);function sf(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function uf(t,e){var n=!0;return ld(t,(function(t,r,o){return n=!!e(t,r,o)})),n}var lf=4294967295;function cf(t){return t?Wl(Zo(t),0,lf):0}function pf(t,e){var n=[];return ld(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function df(t){return function(e,n,r){var o=Object(e);if(!ns(e)){var i=nd(n);e=Cs(e),n=function(t){return i(o[t],t,o)}}var a=t(e,n,r);return a>-1?o[i?e[a]:a]:void 0}}var ff=Math.max;function hf(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:Zo(n);return o<0&&(o=ff(r+o,0)),Qi(t,nd(e),o)}var vf=df(hf);function yf(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}var gf=Math.max,_f=Math.min;function mf(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=Zo(n),o=n<0?gf(r+o,0):_f(o,r-1)),Qi(t,nd(e),o,!0)}var bf=df(mf);function Ef(t){return t&&t.length?t[0]:void 0}function xf(t,e){var n=-1,r=ns(t)?Array(t.length):[];return ld(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function Mf(t,e){return(Do(t)?Oo:xf)(t,nd(e))}var wf=Bl("floor");function Sf(t){return gu((function(e){var n=e.length,r=n,o=ki.prototype.thru;for(t&&e.reverse();r--;){var i=e[r];if("function"!=typeof i)throw new TypeError("Expected a function");if(o&&!a&&"wrapper"==ji(i))var a=new ki([],!0)}for(r=a?r:n;++r<n;){var s=ji(i=e[r]),u="wrapper"==s?Ci(i):void 0;a=u&&Xi(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?a[ji(u[0])].apply(a,u[3]):1==i.length&&Xi(i)?a[s]():a.thru(i)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&Do(r))return a.plant(r).value();for(var o=0,i=n?e[o].apply(this,t):r;++o<n;)i=e[o].call(this,i);return i}}))}var Tf=Sf(),Af=Sf(!0);function Of(t,e){return $l(e,(function(e){return ni(t[e])}))}var Df=Object.prototype.hasOwnProperty,Nf=pd((function(t,e,n){Df.call(t,n)?t[n].push(e):Va(t,n,[e])}));function Pf(t,e){return t>e}function Cf(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=Vo(e),n=Vo(n)),t(e,n)}}var If=Cf(Pf),Lf=Cf((function(t,e){return t>=e})),jf=Object.prototype.hasOwnProperty;function kf(t,e){return null!=t&&jf.call(t,e)}function Rf(t,e){return null!=t&&qp(t,e,kf)}var Bf=Math.max,zf=Math.min;var Uf="[object String]";function Xf(t){return"string"==typeof t||!Do(t)&&Mo(t)&&xo(t)==Uf}function Hf(t,e){return Oo(e,(function(e){return t[e]}))}function Wf(t){return null==t?[]:Hf(t,Cs(t))}var Gf=Math.max;var Yf=Math.max;function Vf(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:Zo(n);return o<0&&(o=Yf(r+o,0)),ea(t,e,o)}var Ff=Math.min;function Kf(t,e,n){for(var r=n?jd:na,o=t[0].length,i=t.length,a=i,s=Array(i),u=1/0,l=[];a--;){var c=t[a];a&&e&&(c=Oo(c,ms(e))),u=Ff(c.length,u),s[a]=!n&&(e||o>=120&&c.length>=120)?new lp(a&&c):void 0}c=t[0];var p=-1,d=s[0];t:for(;++p<o&&l.length<u;){var f=c[p],h=e?e(f):f;if(f=n||0!==f?f:0,!(d?pp(d,h):r(l,h,n))){for(a=i;--a;){var v=s[a];if(!(v?pp(v,h):r(t[a],h,n)))continue t}d&&d.push(h),l.push(f)}}return l}function qf(t){return Sd(t)?t:[]}var Zf=Qa((function(t){var e=Oo(t,qf);return e.length&&e[0]===t[0]?Kf(e):[]})),$f=Qa((function(t){var e=zd(t),n=Oo(t,qf);return e===zd(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?Kf(n,nd(e)):[]})),Jf=Qa((function(t){var e=zd(t),n=Oo(t,qf);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?Kf(n,void 0,e):[]}));function Qf(t,e){return function(n,r){return function(t,e,n,r){return sd(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}var th=Object.prototype.toString,eh=Qf((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=th.call(e)),t[e]=n}),Ki($o)),nh=Object.prototype,rh=nh.hasOwnProperty,oh=nh.toString,ih=Qf((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=oh.call(e)),rh.call(t,e)?t[e].push(n):t[e]=[n]}),nd);function ah(t,e){return e.length<2?t:lu(t,ku(e,0,-1))}function sh(t,e,n){var r=null==(t=ah(t,e=au(e,t)))?t:t[uu(zd(e))];return null==r?void 0:Mi(r,t,n)}var uh=Qa(sh),lh=Qa((function(t,e,n){var r=-1,o="function"==typeof e,i=ns(t)?Array(t.length):[];return ld(t,(function(t){i[++r]=o?Mi(e,t,n):sh(t,e,n)})),i}));var ch=Ms&&Ms.isArrayBuffer,ph=ch?ms(ch):function(t){return Mo(t)&&"[object ArrayBuffer]"==xo(t)};function dh(t){return!0===t||!1===t||Mo(t)&&"[object Boolean]"==xo(t)}var fh=Ms&&Ms.isDate,hh=fh?ms(fh):function(t){return Mo(t)&&"[object Date]"==xo(t)};var vh="[object Map]",yh="[object Set]",gh=Object.prototype.hasOwnProperty;function _h(t){if(null==t)return!0;if(ns(t)&&(Do(t)||"string"==typeof t||"function"==typeof t.splice||gs(t)||Ss(t)||ds(t)))return!t.length;var e=bc(t);if(e==vh||e==yh)return!t.size;if(as(t))return!Ps(t).length;for(var n in t)if(gh.call(t,n))return!1;return!0}function mh(t,e){return Up(t,e)}var bh=po.isFinite;function Eh(t){return"number"==typeof t&&t==Zo(t)}var xh="[object Number]";function Mh(t){return"number"==typeof t||Mo(t)&&xo(t)==xh}var wh=oi?ni:fs;function Sh(t){return null==t}var Th=Ms&&Ms.isRegExp,Ah=Th?ms(Th):function(t){return Mo(t)&&"[object RegExp]"==xo(t)},Oh=9007199254740991;function Dh(t){return void 0===t}var Nh=Array.prototype.join;var Ph=Ll((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ch=pd((function(t,e,n){Va(t,n,e)}));var Ih=Math.max,Lh=Math.min;var jh=Ll((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),kh=Qu("toLowerCase");function Rh(t,e){return t<e}var Bh=Cf(Rh),zh=Cf((function(t,e){return t<=e}));function Uh(t,e){var n={};return e=nd(e),sd(t,(function(t,r,o){Va(n,e(t,r,o),t)})),n}function Xh(t,e,n){for(var r=-1,o=t.length;++r<o;){var i=t[r],a=e(i);if(null!=a&&(void 0===s?a==a&&!So(a):n(a,s)))var s=a,u=i}return u}function Hh(t,e){for(var n,r=-1,o=t.length;++r<o;){var i=e(t[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}var Wh=NaN;function Gh(t,e){var n=null==t?0:t.length;return n?Hh(t,e)/n:Wh}var Yh=os((function(t,e,n){Od(t,e,n)})),Vh=Qa((function(t,e){return function(n){return sh(n,t,e)}})),Fh=Qa((function(t,e){return function(n){return sh(t,n,e)}}));function Kh(t,e,n){var r=Cs(e),o=Of(e,r),i=!(Uo(n)&&"chain"in n&&!n.chain),a=ni(t);return Ji(o,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=Ri(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,du([this.value()],arguments))})})),t}var qh=Lo((function(t,e){return t*e}),1),Zh="Expected a function";function $h(t){if("function"!=typeof t)throw new TypeError(Zh);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var Jh="[object Map]",Qh="[object Set]",tv=fo?fo.iterator:void 0;function ev(t){if(!t)return[];if(ns(t))return Xf(t)?Ju(t):Ri(t);if(tv&&t[tv])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[tv]());var e=bc(t);return(e==Jh?vp:e==Qh?yp:Wf)(t)}function nv(t,e){var n=t.length;if(n)return va(e+=e<0?n:0,n)?t[e]:void 0}function rv(t,e){return null==(t=ah(t,e=au(e,t)))||delete t[uu(zd(e))]}function ov(t){return Tu(t)?void 0:t}var iv=gu((function(t,e){var n={};if(null==t)return n;var r=!1;e=Oo(e,(function(e){return e=au(e,t),r||(r=e.length>1),e})),Za(t,ic(t),n),r&&(n=sp(n,7,ov));for(var o=e.length;o--;)rv(n,e[o]);return n}));function av(t,e,n,r){if(!Uo(t))return t;for(var o=-1,i=(e=au(e,t)).length,a=i-1,s=t;null!=s&&++o<i;){var u=uu(e[o]),l=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var c=s[u];void 0===(l=r?r(c,u,s):void 0)&&(l=Uo(c)?c:va(e[o+1])?[]:{})}qa(s,u,l),s=s[u]}return t}function sv(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var a=e[r],s=lu(t,a);n(s,a)&&av(i,au(a,t),s)}return i}function uv(t,e){if(null==t)return{};var n=Oo(ic(t),(function(t){return[t]}));return e=nd(e),sv(t,n,(function(t,n){return e(t,n[0])}))}function lv(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t==t,i=So(t),a=void 0!==e,s=null===e,u=e==e,l=So(e);if(!s&&!l&&!i&&t>e||i&&a&&u&&!s&&!l||r&&a&&u||!n&&u||!o)return 1;if(!r&&!i&&!l&&t<e||l&&n&&o&&!r&&!i||s&&n&&o||!a&&o||!u)return-1}return 0}function cv(t,e,n){e=e.length?Oo(e,(function(t){return Do(t)?function(e){return lu(e,1===t.length?t[0]:t)}:t})):[$o];var r=-1;e=Oo(e,ms(nd));var o=xf(t,(function(t,n,o){var i=Oo(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,a=o.length,s=n.length;++r<a;){var u=lv(o[r],i[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function pv(t){return gu((function(e){return e=Oo(e,ms(nd)),Qa((function(n){var r=this;return t(e,(function(t){return Mi(t,r,n)}))}))}))}var dv=pv(Oo),fv=Qa,hv=Math.min,vv=fv((function(t,e){var n=(e=1==e.length&&Do(e[0])?Oo(e[0],ms(nd)):Oo(vu(e,1),ms(nd))).length;return Qa((function(r){for(var o=-1,i=hv(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return Mi(t,this,r)}))})),yv=pv(sf),gv=pv(cp),_v=9007199254740991,mv=Math.floor;function bv(t,e){var n="";if(!t||e<1||e>_v)return n;do{e%2&&(n+=t),(e=mv(e/2))&&(t+=t)}while(e);return n}var Ev=td("length"),xv="\\ud800-\\udfff",Mv="["+xv+"]",wv="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Sv="\\ud83c[\\udffb-\\udfff]",Tv="[^"+xv+"]",Av="(?:\\ud83c[\\udde6-\\uddff]){2}",Ov="[\\ud800-\\udbff][\\udc00-\\udfff]",Dv="(?:"+wv+"|"+Sv+")"+"?",Nv="[\\ufe0e\\ufe0f]?",Pv=Nv+Dv+("(?:\\u200d(?:"+[Tv,Av,Ov].join("|")+")"+Nv+Dv+")*"),Cv="(?:"+[Tv+wv+"?",wv,Av,Ov,Mv].join("|")+")",Iv=RegExp(Sv+"(?="+Sv+")|"+Cv+Pv,"g");function Lv(t){return zu(t)?function(t){for(var e=Iv.lastIndex=0;Iv.test(t);)++e;return e}(t):Ev(t)}var jv=Math.ceil;function kv(t,e){var n=(e=void 0===e?" ":Io(e)).length;if(n<2)return n?bv(e,t):e;var r=bv(e,jv(t/Lv(e)));return zu(e)?Ru(Ju(r),0,t).join(""):r.slice(0,t)}var Rv=Math.ceil,Bv=Math.floor;var zv=/^\s+/,Uv=po.parseInt;var Xv=Qa((function(t,e){return Wa(t,32,void 0,e,_a(e,da(Xv)))}));Xv.placeholder={};var Hv=Qa((function(t,e){return Wa(t,64,void 0,e,_a(e,da(Hv)))}));Hv.placeholder={};var Wv=pd((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Gv=gu((function(t,e){return null==t?{}:function(t,e){return sv(t,e,(function(e,n){return Zp(t,n)}))}(t,e)}));function Yv(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}var Vv=Array.prototype.splice;function Fv(t,e,n,r){var o=r?Yv:ea,i=-1,a=e.length,s=t;for(t===e&&(e=Ri(e)),n&&(s=Oo(t,ms(n)));++i<a;)for(var u=0,l=e[i],c=n?n(l):l;(u=o(s,c,u,r))>-1;)s!==t&&Vv.call(s,u,1),Vv.call(t,u,1);return t}function Kv(t,e){return t&&t.length&&e&&e.length?Fv(t,e):t}var qv=Qa(Kv);var Zv=Array.prototype.splice;function $v(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;va(o)?Zv.call(t,o,1):rv(t,o)}}return t}var Jv=gu((function(t,e){var n=null==t?0:t.length,r=pu(t,e);return $v(t,Oo(e,(function(t){return va(t,n)?+t:t})).sort(lv)),r})),Qv=Math.floor,ty=Math.random;function ey(t,e){return t+Qv(ty()*(e-t+1))}var ny=parseFloat,ry=Math.min,oy=Math.random;var iy=Math.ceil,ay=Math.max;function sy(t){return function(e,n,r){return r&&"number"!=typeof r&&rs(e,n,r)&&(n=r=void 0),e=qo(e),void 0===n?(n=e,e=0):n=qo(n),function(t,e,n,r){for(var o=-1,i=ay(iy((e-t)/(n||1)),0),a=Array(i);i--;)a[r?i:++o]=t,t+=n;return a}(e,n,r=void 0===r?e<n?1:-1:qo(r),t)}}var uy=sy(),ly=sy(!0),cy=gu((function(t,e){return Wa(t,256,void 0,void 0,void 0,e)}));function py(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function dy(t,e,n){var r=Do(t)?nl:py,o=arguments.length<3;return r(t,nd(e),n,o,ld)}function fy(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}var hy=Array.prototype.reverse;function vy(t){return null==t?t:hy.call(t)}var yy=Bl("round");function gy(t){var e=t.length;return e?t[ey(0,e-1)]:void 0}function _y(t){return gy(Wf(t))}function my(t,e){var n=-1,r=t.length,o=r-1;for(e=void 0===e?r:e;++n<e;){var i=ey(n,o),a=t[i];t[i]=t[n],t[n]=a}return t.length=e,t}function by(t,e){return my(Ri(t),Wl(e,0,t.length))}function Ey(t,e){var n=Wf(t);return my(n,Wl(e,0,n.length))}function xy(t){return my(Ri(t))}function My(t){return my(Wf(t))}var wy=Ll((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function Sy(t,e){var n;return ld(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}var Ty=Qa((function(t,e){if(null==t)return[];var n=e.length;return n>1&&rs(t,e[0],e[1])?e=[]:n>2&&rs(e[0],e[1],e[2])&&(e=[e[0]]),cv(t,vu(e,1),[])})),Ay=4294967294,Oy=Math.floor,Dy=Math.min;function Ny(t,e,n,r){var o=0,i=null==t?0:t.length;if(0===i)return 0;for(var a=(e=n(e))!=e,s=null===e,u=So(e),l=void 0===e;o<i;){var c=Oy((o+i)/2),p=n(t[c]),d=void 0!==p,f=null===p,h=p==p,v=So(p);if(a)var y=r||h;else y=l?h&&(r||d):s?h&&d&&(r||!f):u?h&&d&&!f&&(r||!v):!f&&!v&&(r?p<=e:p<e);y?o=c+1:i=c}return Dy(i,Ay)}var Py=2147483647;function Cy(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=Py){for(;r<o;){var i=r+o>>>1,a=t[i];null!==a&&!So(a)&&(n?a<=e:a<e)?r=i+1:o=i}return o}return Ny(t,e,$o,n)}function Iy(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!Fa(s,u)){var u=s;i[o++]=0===a?0:a}}return i}var Ly=Math.max;var jy=Ll((function(t,e,n){return t+(n?" ":"")+tl(e)}));var ky=Lo((function(t,e){return t-e}),0);var Ry=Object.prototype,By=Ry.hasOwnProperty;function zy(t,e,n,r){return void 0===t||Fa(t,Ry[n])&&!By.call(r,n)?e:t}var Uy={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Xy(t){return"\\"+Uy[t]}var Hy=/<%=([\s\S]+?)%>/g,Wy={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:Hy,variable:"",imports:{_:{escape:rf}}},Gy=/\b__p \+= '';/g,Yy=/\b(__p \+=) '' \+/g,Vy=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Fy=/[()=,{}\[\]\/\s]/,Ky=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qy=/($^)/,Zy=/['\n\r\u2028\u2029\\]/g,$y=Object.prototype.hasOwnProperty;function Jy(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return Uo(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),bd(t,e,{leading:r,maxWait:e,trailing:o})}function Qy(t,e){return e(t)}var tg=4294967295,eg=Math.min;function ng(t,e){var n=t;return n instanceof Ni&&(n=n.value()),nl(e,(function(t,e){return e.func.apply(e.thisArg,du([t],e.args))}),n)}function rg(){return ng(this.__wrapped__,this.__actions__)}var og=9007199254740991;function ig(t,e){for(var n=t.length;n--&&ea(e,t[n],0)>-1;);return n}function ag(t,e){for(var n=-1,r=t.length;++n<r&&ea(e,t[n],0)>-1;);return n}var sg=/^\s+/;var ug=/\w*$/;var lg=rl({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),cg=/&(?:amp|lt|gt|quot|#39);/g,pg=RegExp(cg.source);var dg=uc&&1/yp(new uc([,-0]))[1]==1/0?function(t){return new uc(t)}:Pi,fg=200;function hg(t,e,n){var r=-1,o=na,i=t.length,a=!0,s=[],u=s;if(n)a=!1,o=jd;else if(i>=fg){var l=e?null:dg(t);if(l)return yp(l);a=!1,o=pp,u=new lp}else u=e?[]:s;t:for(;++r<i;){var c=t[r],p=e?e(c):c;if(c=n||0!==c?c:0,a&&p==p){for(var d=u.length;d--;)if(u[d]===p)continue t;e&&u.push(p),s.push(c)}else o(u,p,n)||(u!==s&&u.push(p),s.push(c))}return s}var vg=Qa((function(t){return hg(vu(t,1,Sd,!0))})),yg=Qa((function(t){var e=zd(t);return Sd(e)&&(e=void 0),hg(vu(t,1,Sd,!0),nd(e))})),gg=Qa((function(t){var e=zd(t);return e="function"==typeof e?e:void 0,hg(vu(t,1,Sd,!0),void 0,e)}));var _g=0;var mg=Math.max;function bg(t){if(!t||!t.length)return[];var e=0;return t=$l(t,(function(t){if(Sd(t))return e=mg(t.length,e),!0})),ss(e,(function(e){return Oo(t,td(e))}))}function Eg(t,e){if(!t||!t.length)return[];var n=bg(t);return null==e?n:Oo(n,(function(t){return Mi(e,void 0,t)}))}function xg(t,e,n,r){return av(t,e,n(lu(t,e)),r)}var Mg=Ll((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}));var wg=Qa((function(t,e){return Sd(t)?Rd(t,e):[]}));var Sg=gu((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return pu(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Ni&&va(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:Qy,args:[o],thisArg:void 0}),new ki(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(o)}));function Tg(t,e,n){var r=t.length;if(r<2)return r?hg(t[0]):[];for(var o=-1,i=Array(r);++o<r;)for(var a=t[o],s=-1;++s<r;)s!=o&&(i[o]=Rd(i[o]||a,t[s],e,n));return hg(vu(i,1),e,n)}var Ag=Qa((function(t){return Tg($l(t,Sd))})),Og=Qa((function(t){var e=zd(t);return Sd(e)&&(e=void 0),Tg($l(t,Sd),nd(e))})),Dg=Qa((function(t){var e=zd(t);return e="function"==typeof e?e:void 0,Tg($l(t,Sd),void 0,e)})),Ng=Qa(bg);function Pg(t,e,n){for(var r=-1,o=t.length,i=e.length,a={};++r<o;){var s=r<i?e[r]:void 0;n(a,t[r],s)}return a}var Cg=Qa((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Eg(t,n)})),Ig={chunk:function(t,e,n){e=(n?rs(t,e,n):void 0===e)?1:Hl(Zo(e),0);var r=null==t?0:t.length;if(!r||e<1)return[];for(var o=0,i=0,a=Array(Xl(r/e));o<r;)a[i++]=ku(t,o,o+=e);return a},compact:function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},concat:function(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return du(Do(n)?Ri(n):[n],vu(e,1))},difference:Bd,differenceBy:Ud,differenceWith:Xd,drop:function(t,e,n){var r=null==t?0:t.length;return r?ku(t,(e=n||void 0===e?1:Zo(e))<0?0:e,r):[]},dropRight:function(t,e,n){var r=null==t?0:t.length;return r?ku(t,0,(e=r-(e=n||void 0===e?1:Zo(e)))<0?0:e):[]},dropRightWhile:function(t,e){return t&&t.length?Wd(t,nd(e),!0,!0):[]},dropWhile:function(t,e){return t&&t.length?Wd(t,nd(e),!0):[]},fill:function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&rs(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=Zo(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:Zo(r))<0&&(r+=o),r=n>r?0:cf(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},findIndex:hf,findLastIndex:mf,first:Ef,flatten:yu,flattenDeep:function(t){return(null==t?0:t.length)?vu(t,Infinity):[]},flattenDepth:function(t,e){return(null==t?0:t.length)?vu(t,e=void 0===e?1:Zo(e)):[]},fromPairs:function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},head:Ef,indexOf:Vf,initial:function(t){return(null==t?0:t.length)?ku(t,0,-1):[]},intersection:Zf,intersectionBy:$f,intersectionWith:Jf,join:function(t,e){return null==t?"":Nh.call(t,e)},last:zd,lastIndexOf:function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=Zo(n))<0?Ih(r+o,0):Lh(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):Qi(t,ta,o,!0)},nth:function(t,e){return t&&t.length?nv(t,Zo(e)):void 0},pull:qv,pullAll:Kv,pullAllBy:function(t,e,n){return t&&t.length&&e&&e.length?Fv(t,e,nd(n)):t},pullAllWith:function(t,e,n){return t&&t.length&&e&&e.length?Fv(t,e,void 0,n):t},pullAt:Jv,remove:function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=nd(e);++r<i;){var a=t[r];e(a,r,t)&&(n.push(a),o.push(r))}return $v(t,o),n},reverse:vy,slice:function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&rs(t,e,n)?(e=0,n=r):(e=null==e?0:Zo(e),n=void 0===n?r:Zo(n)),ku(t,e,n)):[]},sortedIndex:function(t,e){return Cy(t,e)},sortedIndexBy:function(t,e,n){return Ny(t,e,nd(n))},sortedIndexOf:function(t,e){var n=null==t?0:t.length;if(n){var r=Cy(t,e);if(r<n&&Fa(t[r],e))return r}return-1},sortedLastIndex:function(t,e){return Cy(t,e,!0)},sortedLastIndexBy:function(t,e,n){return Ny(t,e,nd(n),!0)},sortedLastIndexOf:function(t,e){if(null==t?0:t.length){var n=Cy(t,e,!0)-1;if(Fa(t[n],e))return n}return-1},sortedUniq:function(t){return t&&t.length?Iy(t):[]},sortedUniqBy:function(t,e){return t&&t.length?Iy(t,nd(e)):[]},tail:function(t){var e=null==t?0:t.length;return e?ku(t,1,e):[]},take:function(t,e,n){return t&&t.length?ku(t,0,(e=n||void 0===e?1:Zo(e))<0?0:e):[]},takeRight:function(t,e,n){var r=null==t?0:t.length;return r?ku(t,(e=r-(e=n||void 0===e?1:Zo(e)))<0?0:e,r):[]},takeRightWhile:function(t,e){return t&&t.length?Wd(t,nd(e),!1,!0):[]},takeWhile:function(t,e){return t&&t.length?Wd(t,nd(e)):[]},union:vg,unionBy:yg,unionWith:gg,uniq:function(t){return t&&t.length?hg(t):[]},uniqBy:function(t,e){return t&&t.length?hg(t,nd(e)):[]},uniqWith:function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?hg(t,void 0,e):[]},unzip:bg,unzipWith:Eg,without:wg,xor:Ag,xorBy:Og,xorWith:Dg,zip:Ng,zipObject:function(t,e){return Pg(t||[],e||[],qa)},zipObjectDeep:function(t,e){return Pg(t||[],e||[],av)},zipWith:Cg},Lg={countBy:fd,each:Yd,eachRight:Zd,every:function(t,e,n){var r=Do(t)?sf:uf;return n&&rs(t,e,n)&&(e=void 0),r(t,nd(e))},filter:function(t,e){return(Do(t)?$l:pf)(t,nd(e))},find:vf,findLast:bf,flatMap:function(t,e){return vu(Mf(t,e),1)},flatMapDeep:function(t,e){return vu(Mf(t,e),Infinity)},flatMapDepth:function(t,e,n){return n=void 0===n?1:Zo(n),vu(Mf(t,e),n)},forEach:Yd,forEachRight:Zd,groupBy:Nf,includes:function(t,e,n,r){t=ns(t)?t:Wf(t),n=n&&!r?Zo(n):0;var o=t.length;return n<0&&(n=Gf(o+n,0)),Xf(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&ea(t,e,n)>-1},invokeMap:lh,keyBy:Ch,map:Mf,orderBy:function(t,e,n,r){return null==t?[]:(Do(e)||(e=null==e?[]:[e]),Do(n=r?void 0:n)||(n=null==n?[]:[n]),cv(t,e,n))},partition:Wv,reduce:dy,reduceRight:function(t,e,n){var r=Do(t)?fy:py,o=arguments.length<3;return r(t,nd(e),n,o,qd)},reject:function(t,e){return(Do(t)?$l:pf)(t,$h(nd(e)))},sample:function(t){return(Do(t)?gy:_y)(t)},sampleSize:function(t,e,n){return e=(n?rs(t,e,n):void 0===e)?1:Zo(e),(Do(t)?by:Ey)(t,e)},shuffle:function(t){return(Do(t)?xy:My)(t)},size:function(t){if(null==t)return 0;if(ns(t))return Xf(t)?Lv(t):t.length;var e=bc(t);return"[object Map]"==e||"[object Set]"==e?t.size:Ps(t).length},some:function(t,e,n){var r=Do(t)?cp:Sy;return n&&rs(t,e,n)&&(e=void 0),r(t,nd(e))},sortBy:Ty},jg=yd,kg={after:function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=Zo(t),function(){if(--t<1)return e.apply(this,arguments)}},ary:Ya,before:Cu,bind:Iu,bindKey:ju,curry:hd,curryRight:vd,debounce:bd,defer:Id,delay:Ld,flip:function(t){return Wa(t,512)},memoize:eu,negate:$h,once:function(t){return Cu(2,t)},overArgs:vv,partial:Xv,partialRight:Hv,rearg:cy,rest:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return Qa(t,e=void 0===e?e:Zo(e))},spread:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:Ly(Zo(e),0),Qa((function(n){var r=n[e],o=Ru(n,0,e);return r&&du(o,r),Mi(t,this,o)}))},throttle:Jy,unary:function(t){return Ya(t,1)},wrap:function(t,e){return Xv(Gd(e),t)}},Rg={castArray:function(){if(!arguments.length)return[];var t=arguments[0];return Do(t)?t:[t]},clone:function(t){return sp(t,4)},cloneDeep:up,cloneDeepWith:function(t,e){return sp(t,5,e="function"==typeof e?e:void 0)},cloneWith:function(t,e){return sp(t,4,e="function"==typeof e?e:void 0)},conformsTo:function(t,e){return null==e||rd(t,e,Cs(e))},eq:Fa,gt:If,gte:Lf,isArguments:ds,isArray:Do,isArrayBuffer:ph,isArrayLike:ns,isArrayLikeObject:Sd,isBoolean:dh,isBuffer:gs,isDate:hh,isElement:function(t){return Mo(t)&&1===t.nodeType&&!Tu(t)},isEmpty:_h,isEqual:mh,isEqualWith:function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?Up(t,e,void 0,n):!!r},isError:Du,isFinite:function(t){return"number"==typeof t&&bh(t)},isFunction:ni,isInteger:Eh,isLength:es,isMap:Zc,isMatch:function(t,e){return t===e||Wp(t,e,Yp(e))},isMatchWith:function(t,e,n){return n="function"==typeof n?n:void 0,Wp(t,e,Yp(e),n)},isNaN:function(t){return Mh(t)&&t!=+t},isNative:function(t){if(wh(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return hi(t)},isNil:Sh,isNull:function(t){return null===t},isNumber:Mh,isObject:Uo,isObjectLike:Mo,isPlainObject:Tu,isRegExp:Ah,isSafeInteger:function(t){return Eh(t)&&t>=-9007199254740991&&t<=Oh},isSet:Jc,isString:Xf,isSymbol:So,isTypedArray:Ss,isUndefined:Dh,isWeakMap:function(t){return Mo(t)&&"[object WeakMap]"==bc(t)},isWeakSet:function(t){return Mo(t)&&"[object WeakSet]"==xo(t)},lt:Bh,lte:zh,toArray:ev,toFinite:qo,toInteger:Zo,toLength:cf,toNumber:Vo,toPlainObject:Ad,toSafeInteger:function(t){return t?Wl(Zo(t),-9007199254740991,og):0===t?t:0},toString:iu},Bg={add:jo,ceil:zl,divide:Hd,floor:wf,max:function(t){return t&&t.length?Xh(t,$o,Pf):void 0},maxBy:function(t,e){return t&&t.length?Xh(t,nd(e),Pf):void 0},mean:function(t){return Gh(t,$o)},meanBy:function(t,e){return Gh(t,nd(e))},min:function(t){return t&&t.length?Xh(t,$o,Rh):void 0},minBy:function(t,e){return t&&t.length?Xh(t,nd(e),Rh):void 0},multiply:qh,round:yy,subtract:ky,sum:function(t){return t&&t.length?Hh(t,$o):0},sumBy:function(t,e){return t&&t.length?Hh(t,nd(e)):0}},zg=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=Vo(n))==n?n:0),void 0!==e&&(e=(e=Vo(e))==e?e:0),Wl(Vo(t),e,n)},Ug=function(t,e,n){return e=qo(e),void 0===n?(n=e,e=0):n=qo(n),function(t,e,n){return t>=zf(e,n)&&t<Bf(e,n)}(t=Vo(t),e,n)},Xg=function(t,e,n){if(n&&"boolean"!=typeof n&&rs(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=qo(t),void 0===e?(e=t,t=0):e=qo(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=oy();return ry(t+o*(e-t+ny("1e-"+((o+"").length-1))),e)}return ey(t,e)},Hg={assign:Ls,assignIn:Bs,assignInWith:zs,assignWith:Us,at:_u,create:function(t,e){var n=bi(t);return null==e?n:Yl(n,e)},defaults:Md,defaultsDeep:Pd,entries:Jd,entriesIn:Qd,extend:Bs,extendWith:zs,findKey:function(t,e){return yf(t,nd(e),sd)},findLastKey:function(t,e){return yf(t,nd(e),Kd)},forIn:function(t,e){return null==t?t:ad(t,Gd(e),Rs)},forInRight:function(t,e){return null==t?t:Fd(t,Gd(e),Rs)},forOwn:function(t,e){return t&&sd(t,Gd(e))},forOwnRight:function(t,e){return t&&Kd(t,Gd(e))},functions:function(t){return null==t?[]:Of(t,Cs(t))},functionsIn:function(t){return null==t?[]:Of(t,Rs(t))},get:cu,has:Rf,hasIn:Zp,invert:eh,invertBy:ih,invoke:uh,keys:Cs,keysIn:Rs,mapKeys:Uh,mapValues:function(t,e){var n={};return e=nd(e),sd(t,(function(t,r,o){Va(n,r,e(t,r,o))})),n},merge:Yh,mergeWith:Nd,omit:iv,omitBy:function(t,e){return uv(t,$h(nd(e)))},pick:Gv,pickBy:uv,result:function(t,e,n){var r=-1,o=(e=au(e,t)).length;for(o||(o=1,t=void 0);++r<o;){var i=null==t?void 0:t[uu(e[r])];void 0===i&&(r=o,i=n),t=ni(i)?i.call(t):i}return t},set:function(t,e,n){return null==t?t:av(t,e,n)},setWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:av(t,e,n,r)},toPairs:Jd,toPairsIn:Qd,transform:function(t,e,n){var r=Do(t),o=r||gs(t)||Ss(t);if(e=nd(e),null==n){var i=t&&t.constructor;n=o?r?new i:[]:Uo(t)&&ni(i)?bi(mu(t)):{}}return(o?Ji:sd)(t,(function(t,r,o){return e(n,t,r,o)})),n},unset:function(t,e){return null==t||rv(t,e)},update:function(t,e,n){return null==t?t:xg(t,e,Gd(n))},updateWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:xg(t,e,Gd(n),r)},values:Wf,valuesIn:function(t){return null==t?[]:Hf(t,Rs(t))}},Wg={at:Sg,chain:Ul,commit:function(){return new ki(this.value(),this.__chain__)},lodash:Ui,next:function(){void 0===this.__values__&&(this.__values__=ev(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},plant:function(t){for(var e,n=this;n instanceof Oi;){var r=Bi(n);r.__index__=0,r.__values__=void 0,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},reverse:function(){var t=this.__wrapped__;if(t instanceof Ni){var e=t;return this.__actions__.length&&(e=new Ni(this)),(e=e.reverse()).__actions__.push({func:Qy,args:[vy],thisArg:void 0}),new ki(e,this.__chain__)}return this.thru(vy)},tap:function(t,e){return e(t),t},thru:Qy,toIterator:function(){return this},toJSON:rg,value:rg,valueOf:rg,wrapperChain:function(){return Ul(this)}},Gg={camelCase:jl,capitalize:el,deburr:sl,endsWith:function(t,e,n){t=iu(t),e=Io(e);var r=t.length,o=n=void 0===n?r:Wl(Zo(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},escape:rf,escapeRegExp:function(t){return(t=iu(t))&&af.test(t)?t.replace(of,"\\$&"):t},kebabCase:Ph,lowerCase:jh,lowerFirst:kh,pad:function(t,e,n){t=iu(t);var r=(e=Zo(e))?Lv(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return kv(Bv(o),n)+t+kv(Rv(o),n)},padEnd:function(t,e,n){t=iu(t);var r=(e=Zo(e))?Lv(t):0;return e&&r<e?t+kv(e-r,n):t},padStart:function(t,e,n){t=iu(t);var r=(e=Zo(e))?Lv(t):0;return e&&r<e?kv(e-r,n)+t:t},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),Uv(iu(t).replace(zv,""),e||0)},repeat:function(t,e,n){return e=(n?rs(t,e,n):void 0===e)?1:Zo(e),bv(iu(t),e)},replace:function(){var t=arguments,e=iu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},snakeCase:wy,split:function(t,e,n){return n&&"number"!=typeof n&&rs(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=iu(t))&&("string"==typeof e||null!=e&&!Ah(e))&&!(e=Io(e))&&zu(t)?Ru(Ju(t),0,n):t.split(e,n):[]},startCase:jy,startsWith:function(t,e,n){return t=iu(t),n=null==n?0:Wl(Zo(n),0,t.length),e=Io(e),t.slice(n,n+e.length)==e},template:function(t,e,n){var r=Wy.imports._.templateSettings||Wy;n&&rs(t,e,n)&&(e=void 0),t=iu(t),e=zs({},e,r,zy);var o,i,a=zs({},e.imports,r.imports,zy),s=Cs(a),u=Hf(a,s),l=0,c=e.interpolate||qy,p="__p += '",d=RegExp((e.escape||qy).source+"|"+c.source+"|"+(c===Hy?Ky:qy).source+"|"+(e.evaluate||qy).source+"|$","g"),f=$y.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(d,(function(e,n,r,a,s,u){return r||(r=a),p+=t.slice(l,u).replace(Zy,Xy),n&&(o=!0,p+="' +\n__e("+n+") +\n'"),s&&(i=!0,p+="';\n"+s+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),p+="';\n";var h=$y.call(e,"variable")&&e.variable;if(h){if(Fy.test(h))throw new Error("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(i?p.replace(Gy,""):p).replace(Yy,"$1").replace(Vy,"$1;"),p="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var v=Nu((function(){return Function(s,f+"return "+p).apply(void 0,u)}));if(v.source=p,Du(v))throw v;return v},templateSettings:Wy,toLower:function(t){return iu(t).toLowerCase()},toUpper:function(t){return iu(t).toUpperCase()},trim:function(t,e,n){if((t=iu(t))&&(n||void 0===e))return zo(t);if(!t||!(e=Io(e)))return t;var r=Ju(t),o=Ju(e);return Ru(r,ag(r,o),ig(r,o)+1).join("")},trimEnd:function(t,e,n){if((t=iu(t))&&(n||void 0===e))return t.slice(0,Ro(t)+1);if(!t||!(e=Io(e)))return t;var r=Ju(t);return Ru(r,0,ig(r,Ju(e))+1).join("")},trimStart:function(t,e,n){if((t=iu(t))&&(n||void 0===e))return t.replace(sg,"");if(!t||!(e=Io(e)))return t;var r=Ju(t);return Ru(r,ag(r,Ju(e))).join("")},truncate:function(t,e){var n=30,r="...";if(Uo(e)){var o="separator"in e?e.separator:o;n="length"in e?Zo(e.length):n,r="omission"in e?Io(e.omission):r}var i=(t=iu(t)).length;if(zu(t)){var a=Ju(t);i=a.length}if(n>=i)return t;var s=n-Lv(r);if(s<1)return r;var u=a?Ru(a,0,s).join(""):t.slice(0,s);if(void 0===o)return u+r;if(a&&(s+=u.length-s),Ah(o)){if(t.slice(s).search(o)){var l,c=u;for(o.global||(o=RegExp(o.source,iu(ug.exec(o))+"g")),o.lastIndex=0;l=o.exec(c);)var p=l.index;u=u.slice(0,void 0===p?s:p)}}else if(t.indexOf(Io(o),s)!=s){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+r},unescape:function(t){return(t=iu(t))&&pg.test(t)?t.replace(cg,lg):t},upperCase:Mg,upperFirst:tl,words:Cl},Yg={attempt:Nu,bindAll:Lu,cond:function(t){var e=null==t?0:t.length,n=nd;return t=e?Oo(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],Qa((function(n){for(var r=-1;++r<e;){var o=t[r];if(Mi(o[0],this,n))return Mi(o[1],this,n)}}))},conforms:function(t){return function(t){var e=Cs(t);return function(n){return rd(n,t,e)}}(sp(t,1))},constant:Ki,defaultTo:function(t,e){return null==t||t!=t?e:t},flow:Tf,flowRight:Af,identity:$o,iteratee:function(t){return nd("function"==typeof t?t:sp(t,1))},matches:function(t){return Fp(sp(t,1))},matchesProperty:function(t,e){return Qp(t,sp(e,1))},method:Vh,methodOf:Fh,mixin:Kh,noop:Pi,nthArg:function(t){return t=Zo(t),Qa((function(e){return nv(e,t)}))},over:dv,overEvery:yv,overSome:gv,property:ed,propertyOf:function(t){return function(e){return null==t?void 0:lu(t,e)}},range:uy,rangeRight:ly,stubArray:Jl,stubFalse:fs,stubObject:function(){return{}},stubString:function(){return""},stubTrue:function(){return!0},times:function(t,e){if((t=Zo(t))<1||t>9007199254740991)return[];var n=tg,r=eg(t,tg);e=Gd(e),t-=tg;for(var o=ss(r,e);++n<t;)e(n);return o},toPath:function(t){return Do(t)?Oo(t,uu):So(t)?[t]:Ri(ou(iu(t)))},uniqueId:function(t){var e=++_g;return iu(t)+e}};var Vg=Math.max,Fg=Math.min;var Kg=Math.min;
16
16
  /**
17
17
  * @license
18
18
  * Lodash (Custom Build) <https://lodash.com/>
@@ -22,11 +22,11 @@
22
22
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
23
23
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
24
24
  */
25
- var Yg,Vg,Fg=4294967295,Kg=Array.prototype,qg=Object.prototype.hasOwnProperty,Zg=fo?fo.iterator:void 0,$g=Math.max,Jg=Math.min,Qg=function(t){return function(e,n,r){if(null==r){var o=Ho(n),i=o&&Cs(n),a=i&&i.length&&Of(n,i);(a?a.length:o)||(r=n,n=e,e=this)}return t(e,n,r)}}(Wh);Hi.after=Cg.after,Hi.ary=Cg.ary,Hi.assign=Bg.assign,Hi.assignIn=Bg.assignIn,Hi.assignInWith=Bg.assignInWith,Hi.assignWith=Bg.assignWith,Hi.at=Bg.at,Hi.before=Cg.before,Hi.bind=Cg.bind,Hi.bindAll=Ug.bindAll,Hi.bindKey=Cg.bindKey,Hi.castArray=Ig.castArray,Hi.chain=zg.chain,Hi.chunk=Ng.chunk,Hi.compact=Ng.compact,Hi.concat=Ng.concat,Hi.cond=Ug.cond,Hi.conforms=Ug.conforms,Hi.constant=Ug.constant,Hi.countBy=Dg.countBy,Hi.create=Bg.create,Hi.curry=Cg.curry,Hi.curryRight=Cg.curryRight,Hi.debounce=Cg.debounce,Hi.defaults=Bg.defaults,Hi.defaultsDeep=Bg.defaultsDeep,Hi.defer=Cg.defer,Hi.delay=Cg.delay,Hi.difference=Ng.difference,Hi.differenceBy=Ng.differenceBy,Hi.differenceWith=Ng.differenceWith,Hi.drop=Ng.drop,Hi.dropRight=Ng.dropRight,Hi.dropRightWhile=Ng.dropRightWhile,Hi.dropWhile=Ng.dropWhile,Hi.fill=Ng.fill,Hi.filter=Dg.filter,Hi.flatMap=Dg.flatMap,Hi.flatMapDeep=Dg.flatMapDeep,Hi.flatMapDepth=Dg.flatMapDepth,Hi.flatten=Ng.flatten,Hi.flattenDeep=Ng.flattenDeep,Hi.flattenDepth=Ng.flattenDepth,Hi.flip=Cg.flip,Hi.flow=Ug.flow,Hi.flowRight=Ug.flowRight,Hi.fromPairs=Ng.fromPairs,Hi.functions=Bg.functions,Hi.functionsIn=Bg.functionsIn,Hi.groupBy=Dg.groupBy,Hi.initial=Ng.initial,Hi.intersection=Ng.intersection,Hi.intersectionBy=Ng.intersectionBy,Hi.intersectionWith=Ng.intersectionWith,Hi.invert=Bg.invert,Hi.invertBy=Bg.invertBy,Hi.invokeMap=Dg.invokeMap,Hi.iteratee=Ug.iteratee,Hi.keyBy=Dg.keyBy,Hi.keys=Cs,Hi.keysIn=Bg.keysIn,Hi.map=Dg.map,Hi.mapKeys=Bg.mapKeys,Hi.mapValues=Bg.mapValues,Hi.matches=Ug.matches,Hi.matchesProperty=Ug.matchesProperty,Hi.memoize=Cg.memoize,Hi.merge=Bg.merge,Hi.mergeWith=Bg.mergeWith,Hi.method=Ug.method,Hi.methodOf=Ug.methodOf,Hi.mixin=Qg,Hi.negate=Fh,Hi.nthArg=Ug.nthArg,Hi.omit=Bg.omit,Hi.omitBy=Bg.omitBy,Hi.once=Cg.once,Hi.orderBy=Dg.orderBy,Hi.over=Ug.over,Hi.overArgs=Cg.overArgs,Hi.overEvery=Ug.overEvery,Hi.overSome=Ug.overSome,Hi.partial=Cg.partial,Hi.partialRight=Cg.partialRight,Hi.partition=Dg.partition,Hi.pick=Bg.pick,Hi.pickBy=Bg.pickBy,Hi.property=Ug.property,Hi.propertyOf=Ug.propertyOf,Hi.pull=Ng.pull,Hi.pullAll=Ng.pullAll,Hi.pullAllBy=Ng.pullAllBy,Hi.pullAllWith=Ng.pullAllWith,Hi.pullAt=Ng.pullAt,Hi.range=Ug.range,Hi.rangeRight=Ug.rangeRight,Hi.rearg=Cg.rearg,Hi.reject=Dg.reject,Hi.remove=Ng.remove,Hi.rest=Cg.rest,Hi.reverse=Ng.reverse,Hi.sampleSize=Dg.sampleSize,Hi.set=Bg.set,Hi.setWith=Bg.setWith,Hi.shuffle=Dg.shuffle,Hi.slice=Ng.slice,Hi.sortBy=Dg.sortBy,Hi.sortedUniq=Ng.sortedUniq,Hi.sortedUniqBy=Ng.sortedUniqBy,Hi.split=Hg.split,Hi.spread=Cg.spread,Hi.tail=Ng.tail,Hi.take=Ng.take,Hi.takeRight=Ng.takeRight,Hi.takeRightWhile=Ng.takeRightWhile,Hi.takeWhile=Ng.takeWhile,Hi.tap=zg.tap,Hi.throttle=Cg.throttle,Hi.thru=qv,Hi.toArray=Ig.toArray,Hi.toPairs=Bg.toPairs,Hi.toPairsIn=Bg.toPairsIn,Hi.toPath=Ug.toPath,Hi.toPlainObject=Ig.toPlainObject,Hi.transform=Bg.transform,Hi.unary=Cg.unary,Hi.union=Ng.union,Hi.unionBy=Ng.unionBy,Hi.unionWith=Ng.unionWith,Hi.uniq=Ng.uniq,Hi.uniqBy=Ng.uniqBy,Hi.uniqWith=Ng.uniqWith,Hi.unset=Bg.unset,Hi.unzip=Ng.unzip,Hi.unzipWith=Ng.unzipWith,Hi.update=Bg.update,Hi.updateWith=Bg.updateWith,Hi.values=Bg.values,Hi.valuesIn=Bg.valuesIn,Hi.without=Ng.without,Hi.words=Hg.words,Hi.wrap=Cg.wrap,Hi.xor=Ng.xor,Hi.xorBy=Ng.xorBy,Hi.xorWith=Ng.xorWith,Hi.zip=Ng.zip,Hi.zipObject=Ng.zipObject,Hi.zipObjectDeep=Ng.zipObjectDeep,Hi.zipWith=Ng.zipWith,Hi.entries=Bg.toPairs,Hi.entriesIn=Bg.toPairsIn,Hi.extend=Bg.assignIn,Hi.extendWith=Bg.assignInWith,Qg(Hi,Hi),Hi.add=jg.add,Hi.attempt=Ug.attempt,Hi.camelCase=Hg.camelCase,Hi.capitalize=Hg.capitalize,Hi.ceil=jg.ceil,Hi.clamp=kg,Hi.clone=Ig.clone,Hi.cloneDeep=Ig.cloneDeep,Hi.cloneDeepWith=Ig.cloneDeepWith,Hi.cloneWith=Ig.cloneWith,Hi.conformsTo=Ig.conformsTo,Hi.deburr=Hg.deburr,Hi.defaultTo=Ug.defaultTo,Hi.divide=jg.divide,Hi.endsWith=Hg.endsWith,Hi.eq=Ig.eq,Hi.escape=Hg.escape,Hi.escapeRegExp=Hg.escapeRegExp,Hi.every=Dg.every,Hi.find=Dg.find,Hi.findIndex=Ng.findIndex,Hi.findKey=Bg.findKey,Hi.findLast=Dg.findLast,Hi.findLastIndex=Ng.findLastIndex,Hi.findLastKey=Bg.findLastKey,Hi.floor=jg.floor,Hi.forEach=Dg.forEach,Hi.forEachRight=Dg.forEachRight,Hi.forIn=Bg.forIn,Hi.forInRight=Bg.forInRight,Hi.forOwn=Bg.forOwn,Hi.forOwnRight=Bg.forOwnRight,Hi.get=Bg.get,Hi.gt=Ig.gt,Hi.gte=Ig.gte,Hi.has=Bg.has,Hi.hasIn=Bg.hasIn,Hi.head=Ng.head,Hi.identity=$o,Hi.includes=Dg.includes,Hi.indexOf=Ng.indexOf,Hi.inRange=Rg,Hi.invoke=Bg.invoke,Hi.isArguments=Ig.isArguments,Hi.isArray=No,Hi.isArrayBuffer=Ig.isArrayBuffer,Hi.isArrayLike=Ig.isArrayLike,Hi.isArrayLikeObject=Ig.isArrayLikeObject,Hi.isBoolean=Ig.isBoolean,Hi.isBuffer=Ig.isBuffer,Hi.isDate=Ig.isDate,Hi.isElement=Ig.isElement,Hi.isEmpty=Ig.isEmpty,Hi.isEqual=Ig.isEqual,Hi.isEqualWith=Ig.isEqualWith,Hi.isError=Ig.isError,Hi.isFinite=Ig.isFinite,Hi.isFunction=Ig.isFunction,Hi.isInteger=Ig.isInteger,Hi.isLength=Ig.isLength,Hi.isMap=Ig.isMap,Hi.isMatch=Ig.isMatch,Hi.isMatchWith=Ig.isMatchWith,Hi.isNaN=Ig.isNaN,Hi.isNative=Ig.isNative,Hi.isNil=Ig.isNil,Hi.isNull=Ig.isNull,Hi.isNumber=Ig.isNumber,Hi.isObject=Ho,Hi.isObjectLike=Ig.isObjectLike,Hi.isPlainObject=Ig.isPlainObject,Hi.isRegExp=Ig.isRegExp,Hi.isSafeInteger=Ig.isSafeInteger,Hi.isSet=Ig.isSet,Hi.isString=Ig.isString,Hi.isSymbol=Ig.isSymbol,Hi.isTypedArray=Ig.isTypedArray,Hi.isUndefined=Ig.isUndefined,Hi.isWeakMap=Ig.isWeakMap,Hi.isWeakSet=Ig.isWeakSet,Hi.join=Ng.join,Hi.kebabCase=Hg.kebabCase,Hi.last=zd,Hi.lastIndexOf=Ng.lastIndexOf,Hi.lowerCase=Hg.lowerCase,Hi.lowerFirst=Hg.lowerFirst,Hi.lt=Ig.lt,Hi.lte=Ig.lte,Hi.max=jg.max,Hi.maxBy=jg.maxBy,Hi.mean=jg.mean,Hi.meanBy=jg.meanBy,Hi.min=jg.min,Hi.minBy=jg.minBy,Hi.stubArray=Ug.stubArray,Hi.stubFalse=Ug.stubFalse,Hi.stubObject=Ug.stubObject,Hi.stubString=Ug.stubString,Hi.stubTrue=Ug.stubTrue,Hi.multiply=jg.multiply,Hi.nth=Ng.nth,Hi.noop=Ug.noop,Hi.now=Pg,Hi.pad=Hg.pad,Hi.padEnd=Hg.padEnd,Hi.padStart=Hg.padStart,Hi.parseInt=Hg.parseInt,Hi.random=Lg,Hi.reduce=Dg.reduce,Hi.reduceRight=Dg.reduceRight,Hi.repeat=Hg.repeat,Hi.replace=Hg.replace,Hi.result=Bg.result,Hi.round=jg.round,Hi.sample=Dg.sample,Hi.size=Dg.size,Hi.snakeCase=Hg.snakeCase,Hi.some=Dg.some,Hi.sortedIndex=Ng.sortedIndex,Hi.sortedIndexBy=Ng.sortedIndexBy,Hi.sortedIndexOf=Ng.sortedIndexOf,Hi.sortedLastIndex=Ng.sortedLastIndex,Hi.sortedLastIndexBy=Ng.sortedLastIndexBy,Hi.sortedLastIndexOf=Ng.sortedLastIndexOf,Hi.startCase=Hg.startCase,Hi.startsWith=Hg.startsWith,Hi.subtract=jg.subtract,Hi.sum=jg.sum,Hi.sumBy=jg.sumBy,Hi.template=Hg.template,Hi.times=Ug.times,Hi.toFinite=Ig.toFinite,Hi.toInteger=Zo,Hi.toLength=Ig.toLength,Hi.toLower=Hg.toLower,Hi.toNumber=Ig.toNumber,Hi.toSafeInteger=Ig.toSafeInteger,Hi.toString=Ig.toString,Hi.toUpper=Hg.toUpper,Hi.trim=Hg.trim,Hi.trimEnd=Hg.trimEnd,Hi.trimStart=Hg.trimStart,Hi.truncate=Hg.truncate,Hi.unescape=Hg.unescape,Hi.uniqueId=Ug.uniqueId,Hi.upperCase=Hg.upperCase,Hi.upperFirst=Hg.upperFirst,Hi.each=Dg.forEach,Hi.eachRight=Dg.forEachRight,Hi.first=Ng.head,Qg(Hi,(Yg={},sd(Hi,(function(t,e){qg.call(Hi.prototype,e)||(Yg[e]=t)})),Yg),{chain:!1}),Hi.VERSION="4.17.21",(Hi.templateSettings=Hg.templateSettings).imports._=Hi,Ji(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hi[t].placeholder=Hi})),Ji(["drop","take"],(function(t,e){Di.prototype[t]=function(n){n=void 0===n?1:$g(Zo(n),0);var r=this.__filtered__&&!e?new Di(this):this.clone();return r.__filtered__?r.__takeCount__=Jg(n,r.__takeCount__):r.__views__.push({size:Jg(n,Fg),type:t+(r.__dir__<0?"Right":"")}),r},Di.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ji(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Di.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:nd(t),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ji(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Di.prototype[t]=function(){return this[n](1).value()[0]}})),Ji(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Di.prototype[t]=function(){return this.__filtered__?new Di(this):this[n](1)}})),Di.prototype.compact=function(){return this.filter($o)},Di.prototype.find=function(t){return this.filter(t).head()},Di.prototype.findLast=function(t){return this.reverse().find(t)},Di.prototype.invokeMap=Qa((function(t,e){return"function"==typeof t?new Di(this):this.map((function(n){return sh(n,t,e)}))})),Di.prototype.reject=function(t){return this.filter(Fh(nd(t)))},Di.prototype.slice=function(t,e){t=Zo(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Di(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=Zo(e))<0?n.dropRight(-e):n.take(e-t)),n)},Di.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Di.prototype.toArray=function(){return this.take(Fg)},sd(Di.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Hi[r?"take"+("last"==e?"Right":""):e],i=r||/^find/.test(e);o&&(Hi.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,s=e instanceof Di,u=a[0],l=s||No(e),c=function(t){var e=o.apply(Hi,du([t],a));return r&&p?e[0]:e};l&&n&&"function"==typeof u&&1!=u.length&&(s=l=!1);var p=this.__chain__,d=!!this.__actions__.length,f=i&&!p,h=s&&!d;if(!i&&l){e=h?e:new Di(this);var y=t.apply(e,a);return y.__actions__.push({func:qv,args:[c],thisArg:void 0}),new Ri(y,p)}return f&&h?t.apply(this,a):(y=this.thru(c),f?r?y.value()[0]:y.value():y)})})),Ji(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Kg[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Hi.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(No(o)?o:[],t)}return this[n]((function(n){return e.apply(No(n)?n:[],t)}))}})),sd(Di.prototype,(function(t,e){var n=Hi[e];if(n){var r=n.name+"";qg.call(Ii,r)||(Ii[r]=[]),Ii[r].push({name:e,func:n})}})),Ii[Ma(void 0,2).name]=[{name:"wrapper",func:void 0}],Di.prototype.clone=function(){var t=new Di(this.__wrapped__);return t.__actions__=Li(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Li(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Li(this.__views__),t},Di.prototype.reverse=function(){if(this.__filtered__){var t=new Di(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Di.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=No(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=Gg(e,t+a);break;case"takeRight":t=Xg(t,e-a)}}return{start:t,end:e}}(0,o,this.__views__),a=i.start,s=i.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,p=c.length,d=0,f=Wg(u,this.__takeCount__);if(!n||!r&&o==u&&f==u)return Jv(t,this.__actions__);var h=[];t:for(;u--&&d<f;){for(var y=-1,v=t[l+=e];++y<p;){var g=c[y],_=g.iteratee,m=g.type,b=_(v);if(2==m)v=b;else if(!b){if(1==m)continue t;break t}}h[d++]=v}return h},Hi.prototype.at=zg.at,Hi.prototype.chain=zg.wrapperChain,Hi.prototype.commit=zg.commit,Hi.prototype.next=zg.next,Hi.prototype.plant=zg.plant,Hi.prototype.reverse=zg.reverse,Hi.prototype.toJSON=Hi.prototype.valueOf=Hi.prototype.value=zg.value,Hi.prototype.first=Hi.prototype.head,Zg&&(Hi.prototype[Zg]=zg.toIterator),t.Options=void 0,(Vg=t.Options||(t.Options={})).get=function(t){var e=ro(t,[]);if(!t.container)throw new Error("Ensure the container of LogicFlow is specified and valid.");return js({},Vg.defaults,e)},function(t){t.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}}(t.Options||(t.Options={}));var t_={node:!1,edge:!1},e_={node:!0,edge:!0},n_=function(t){return t&&"boolean"!=typeof t?Uh(up(t_),t):up(!0===t?e_:t_)},r_=n_,o_=null!==cu(window,"navigator.userAgent","").match(/MSIE|Trident/);function i_(t){try{return JSON.parse(JSON.stringify(t))}catch(e){return t}}var a_,s_,u_,l_,c_,p_,d_=200;t.ElementState=void 0,(a_=t.ElementState||(t.ElementState={}))[a_.DEFAULT=1]="DEFAULT",a_[a_.TEXT_EDIT=2]="TEXT_EDIT",a_[a_.SHOW_MENU=3]="SHOW_MENU",a_[a_.ALLOW_CONNECT=4]="ALLOW_CONNECT",a_[a_.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT",t.ElementType=void 0,(s_=t.ElementType||(t.ElementType={})).NODE="node",s_.EDGE="edge",s_.GRAPH="graph",t.ModelType=void 0,(u_=t.ModelType||(t.ModelType={})).NODE="node",u_.CIRCLE_NODE="circle-node",u_.POLYGON_NODE="polygon-node",u_.RECT_NODE="rect-node",u_.TEXT_NODE="text-node",u_.ELLIPSE_NODE="ellipse-node",u_.DIAMOND_NODE="diamond-node",u_.HTML_NODE="html-node",u_.CUSTOM_HTML_NODE="custom-html-node",u_.EDGE="edge",u_.LINE_EDGE="line-edge",u_.POLYLINE_EDGE="polyline-edge",u_.BEZIER_EDGE="bezier-edge",u_.GRAPH="graph",t.EventType=void 0,(l_=t.EventType||(t.EventType={})).ELEMENT_CLICK="element:click",l_.NODE_ADD="node:add",l_.NODE_DELETE="node:delete",l_.NODE_CLICK="node:click",l_.NODE_DBCLICK="node:dbclick",l_.NODE_GROUP_COPY="node:group-copy-add",l_.NODE_DND_ADD="node:dnd-add",l_.NODE_DND_DRAG="node:dnd-drag",l_.NODE_MOUSEDOWN="node:mousedown",l_.NODE_DRAGSTART="node:dragstart",l_.NODE_DRAG="node:drag",l_.NODE_DROP="node:drop",l_.NODE_MOUSEUP="node:mouseup",l_.NODE_MOUSEMOVE="node:mousemove",l_.NODE_MOUSEENTER="node:mouseenter",l_.NODE_MOUSELEAVE="node:mouseleave",l_.NODE_CONTEXTMENU="node:contextmenu",l_.NODE_ROTATE="node:rotate",l_.NODE_RESIZE="node:resize",l_.NODE_PROPERTIES_CHANGE="node:properties-change",l_.NODE_PROPERTIES_DELETE="node:properties-delete",l_.EDGE_ADD="edge:add",l_.EDGE_DELETE="edge:delete",l_.EDGE_CLICK="edge:click",l_.EDGE_DBCLICK="edge:dbclick",l_.EDGE_MOUSEENTER="edge:mouseenter",l_.EDGE_MOUSELEAVE="edge:mouseleave",l_.EDGE_CONTEXTMENU="edge:contextmenu",l_.EDGE_ADJUST="edge:adjust",l_.EDGE_EXCHANGE_NODE="edge:exchange-node",l_.ANCHOR_DRAGSTART="anchor:dragstart",l_.ANCHOR_DRAG="anchor:drag",l_.ANCHOR_DROP="anchor:drop",l_.ANCHOR_DRAGEND="anchor:dragend",l_.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",l_.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",l_.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",l_.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",l_.ADJUST_POINT_DRAG="adjustPoint:drag",l_.ADJUST_POINT_DROP="adjustPoint:drop",l_.ADJUST_POINT_DRAGEND="adjustPoint:dragend",l_.BLANK_MOUSEDOWN="blank:mousedown",l_.BLANK_DRAGSTART="blank:dragstart",l_.BLANK_DRAG="blank:drag",l_.BLANK_DROP="blank:drop",l_.BLANK_MOUSEMOVE="blank:mousemove",l_.BLANK_MOUSEUP="blank:mouseup",l_.BLANK_CLICK="blank:click",l_.BLANK_CONTEXTMENU="blank:contextmenu",l_.SELECTION_MOUSEDOWN="selection:mousedown",l_.SELECTION_DRAGSTART="selection:dragstart",l_.SELECTION_DRAG="selection:drag",l_.SELECTION_DROP="selection:drop",l_.SELECTION_MOUSEMOVE="selection:mousemove",l_.SELECTION_MOUSEUP="selection:mouseup",l_.SELECTION_CONTEXTMENU="selection:contextmenu",l_.CONNECTION_NOT_ALLOWED="connection:not-allowed",l_.HISTORY_CHANGE="history:change",l_.TEXT_UPDATE="text:update",l_.GRAPH_TRANSFORM="graph:transform",l_.GRAPH_RENDERED="graph:rendered",l_.GRAPH_UPDATED="graph:updated",function(t){t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE"}(c_||(c_={})),function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(p_||(p_={}));var f_=function(){function e(e){var n=e.onDragStart,r=void 0===n?Pi:n,o=e.onDragging,i=void 0===o?Pi:o,a=e.onDragEnd,s=void 0===a?Pi:a,u=e.eventType,l=void 0===u?"":u,c=e.eventCenter,p=e.step,d=void 0===p?1:p,f=e.isStopPropagation,h=void 0===f||f,y=e.model,v=e.data,g=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(e){var n,r,o=null===window||void 0===window?void 0:window.document;if(0===e.button){g.isStopPropagation&&e.stopPropagation(),g.isStartDragging=!0,g.startX=e.clientX,g.startY=e.clientY,o.addEventListener("mousemove",g.handleMouseMove,!1),o.addEventListener("mouseup",g.handleMouseUp,!1);var i=null===(n=g.model)||void 0===n?void 0:n.getData();null===(r=g.eventCenter)||void 0===r||r.emit(t.EventType["".concat(g.eventType,"_MOUSEDOWN")],{e:e,data:g.data||i}),g.startTime=(new Date).getTime()}},this.handleMouseMove=function(e){var n,r;if(g.isStopPropagation&&e.stopPropagation(),g.isStartDragging&&(g.sumDeltaX+=e.clientX-g.startX,g.sumDeltaY+=e.clientY-g.startY,g.startX=e.clientX,g.startY=e.clientY,g.step<=1||Math.abs(g.sumDeltaX)>g.step||Math.abs(g.sumDeltaY)>g.step)){var o=g.sumDeltaX%g.step,i=g.sumDeltaY%g.step,a=g.sumDeltaX-o,s=g.sumDeltaY-i;g.sumDeltaX=o,g.sumDeltaY=i;var u=null===(n=g.model)||void 0===n?void 0:n.getData();g.isDragging||(null===(r=g.eventCenter)||void 0===r||r.emit(t.EventType["".concat(g.eventType,"_DRAGSTART")],{e:e,data:g.data||u}),g.onDragStart({event:e})),g.isDragging=!0,Promise.resolve().then((function(){var n,r;g.onDragging({deltaX:a,deltaY:s,event:e}),null===(n=g.eventCenter)||void 0===n||n.emit(t.EventType["".concat(g.eventType,"_MOUSEMOVE")],{e:e,data:g.data||u}),null===(r=g.eventCenter)||void 0===r||r.emit(t.EventType["".concat(g.eventType,"_DRAG")],{e:e,data:g.data||u})}))}},this.handleMouseUp=function(e){var n=window.document;g.isStartDragging=!1,g.isStopPropagation&&e.stopPropagation(),Promise.resolve().then((function(){var r,o,i;n.removeEventListener("mousemove",g.handleMouseMove,!1),n.removeEventListener("mouseup",g.handleMouseUp,!1);var a=null===(r=g.model)||void 0===r?void 0:r.getData();null===(o=g.eventCenter)||void 0===o||o.emit(t.EventType["".concat(g.eventType,"_MOUSEUP")],{e:e,data:g.data||a}),g.isDragging&&(g.isDragging=!1,g.onDragEnd({event:e}),null===(i=g.eventCenter)||void 0===i||i.emit(t.EventType["".concat(g.eventType,"_DROP")],{e:e,data:g.data||a}))}))},this.cancelDrag=function(){var t=null===window||void 0===window?void 0:window.document;t.removeEventListener("mousemove",g.handleMouseMove,!1),t.removeEventListener("mouseup",g.handleMouseUp,!1),g.onDragEnd({event:null}),g.isDragging=!1},this.onDragStart=r,this.onDragging=i,this.onDragEnd=s,this.step=d,this.isStopPropagation=h,this.eventType=l,this.eventCenter=c,this.model=y,this.data=v}return e.prototype.setStep=function(t){this.step=t},e.prototype.setModel=function(t){this.model=t},e}(),h_=function(t){var e=t.start,n=t.end,r=t.offset,o=t.verticalLength,i=t.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((n.y-e.y)/(n.x-e.x)),u=Math.atan(r/o),l=Math.sqrt(o*o+r*r);return"start"===i?n.x>=e.x?(a.leftX=e.x+l*Math.sin(s+u),a.leftY=e.y-l*Math.cos(s+u),a.rightX=e.x-l*Math.sin(s-u),a.rightY=e.y+l*Math.cos(s-u)):(a.leftX=e.x-l*Math.sin(s+u),a.leftY=e.y+l*Math.cos(s+u),a.rightX=e.x+l*Math.sin(s-u),a.rightY=e.y-l*Math.cos(s-u)):"end"===i&&(n.x>=e.x?(a.leftX=n.x+l*Math.sin(s-u),a.leftY=n.y-l*Math.cos(s-u),a.rightX=n.x-l*Math.sin(s+u),a.rightY=n.y+l*Math.cos(s+u)):(a.leftX=n.x-l*Math.sin(s-u),a.leftY=n.y+l*Math.cos(s-u),a.rightX=n.x+l*Math.sin(s+u),a.rightY=n.y-l*Math.cos(s+u))),a},y_=function(t,e,n){var r=t.x,o=t.y,i=e.x,a=e.y,s=n.x,u=n.y,l=(u-a)/(s-i),c=a-l*i;return r>=i&&r<=s&&o>=a&&o<=u&&Math.abs(o-l*r+c)<Number.EPSILON},v_=function(t,e){return 2*Math.abs(t.centerX-e.centerX)<t.width+e.width&&2*Math.abs(t.centerY-e.centerY)<t.height+e.height},g_=function(t){var e=[],n={};return t.forEach((function(t){var e="".concat(t.x,"-").concat(t.y);t.id=e,n[e]=t})),Object.keys(n).forEach((function(t){e.push(n[t])})),e},__=function(t,e){return 0===t.width&&0===t.height?t:{x:t.x,y:t.y,centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},m_=function(t,e){var n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return n/e.width>r/e.height?p_.HORIZONTAL:p_.VERTICAL},b_=function(t,e,n){return m_(n,e)===p_.HORIZONTAL?{x:n.x>t.centerX?t.maxX:t.minX,y:n.y}:{x:n.x,y:n.y>t.centerY?t.maxY:t.minY}},E_=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),o=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{x:(n+o)/2,y:(r+i)/2,centerX:(n+o)/2,centerY:(r+i)/2,minX:n,minY:r,maxX:o,maxY:i,height:i-r,width:o-n}},x_=function(t,e){void 0===t&&(t=[]);var n=[],r=[];t.forEach((function(t){n.push(t.x),r.push(t.y)}));var o=Math.min.apply(Math,ao([],io(n),!1)),i=Math.max.apply(Math,ao([],io(n),!1)),a=Math.min.apply(Math,ao([],io(r),!1)),s=Math.max.apply(Math,ao([],io(r),!1)),u=i-o,l=s-a;return e&&(u+=e,l+=e),{centerX:(o+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:o,minY:a,x:(o+i)/2,y:(a+s)/2,height:l,width:u}},w_=function(t){var e=t.minX,n=t.minY,r=t.maxX,o=t.maxY;return[{x:e,y:n},{x:r,y:n},{x:r,y:o},{x:e,y:o}]},S_=function(t,e){var n=t.x,r=t.y;return n<e.minX||n>e.maxX||r<e.minY||r>e.maxY},M_=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},A_=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},T_=function(t,e){return ao(ao([],io(M_(t,e.x)),!1),io(A_(t,e.y)),!1)},O_=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},N_=function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n},D_=function(t,e,n,r,o){return O_(t,e)+O_(t,n)+N_(t,[e,n,r,o])},P_=function(t,e,n,r,o){o||(o=0),t.unshift(e[r]),n[r]&&n[r]!==r&&o<=100&&P_(t,e,n,n[r],o+1)},C_=function(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)},I_=function(t,e,n,r){var o=e.x-t.x,i=e.y-t.y,a=r.x-n.x,s=r.y-n.y,u=(-i*(t.x-n.x)+o*(t.y-n.y))/(-a*i+o*s),l=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*i+o*s);return u>=0&&u<=1&&l>=0&&l<=1},j_=function(t,e,n){if(0===n.width&&0===n.height)return!1;var r=io(w_(n),4),o=r[0],i=r[1],a=r[2],s=r[3];return I_(t,e,o,i)||I_(t,e,o,s)||I_(t,e,i,a)||I_(t,e,a,s)},k_=function(t,e,n,r){var o=[];return t.forEach((function(t){t!==e&&(t.x!==e.x&&t.y!==e.y||j_(t,e,n)||j_(t,e,r)||o.push(t))})),g_(o)},R_=function(t,e,n,r,o,i,a){var s=[],u=[e],l={},c={},p={};e.id&&(c[e.id]=0,p[e.id]=D_(e,n,e));var d={};t.forEach((function(t){t.id&&(d[t.id]=t)}));for(var f=function(){var f,h=1/0;if(u.forEach((function(t){t.id&&p[t.id]<h&&(h=p[t.id],f=t)})),f===n&&n.id){var y=[];return P_(y,d,l,n.id),{value:y}}if(!f)return{value:[e,n]};C_(u,f),s.push(f),k_(t,f,r,o).forEach((function(t){if(-1===s.indexOf(t)&&(-1===u.indexOf(t)&&u.push(t),(null==f?void 0:f.id)&&(null==t?void 0:t.id))){var r=p[f.id]+O_(f,t);if(c[t.id]&&r>=c[t.id])return;l[t.id]=f.id,c[t.id]=r,p[t.id]=c[t.id]+D_(t,n,e,i,a)}}))};u.length;){var h=f();if("object"==typeof h)return h.value}return[e,n]},L_=function(t){return Mm(t)},B_=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],r=t[e],o=t[e+1];n.x===r.x&&r.x===o.x||n.y===r.y&&r.y===o.y?t.splice(e,1):e++}return t},z_=function(t,e,n,r,o){var i=L_(n),a=L_(r),s=__(i,o),u=__(a,o),l=b_(s,i,t),c=b_(u,a,e);if(v_(s,u))return ao(ao([t,l],io(V_(t,e,l,c)),!1),[c,e],!1);var p=x_([l,c]),d=E_(s,p),f=E_(u,p),h=[];h=(h=h.concat(w_(d))).concat(w_(f));var y={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[p,d,f].forEach((function(t){h=h.concat(T_(t,y).filter((function(t){return S_(t,s)&&S_(t,u)})))})),[{x:l.x,y:c.y},{x:c.x,y:l.y}].forEach((function(t){S_(t,s)&&S_(t,u)&&h.push(t)})),h.unshift(l),h.push(c),h=g_(h);var v=R_(h,l,c,i,a,t,e);return v.unshift(t),v.push(e),v.length>2&&(v=B_(v)),g_(v)},H_=function(t){var e;if(1===t.length)e=[t[0],t[0]];else if(t.length>=2){for(var n=t[0],r=t[1],o=xm(n.x,n.y,r.x,r.y),i=1;i<t.length-1;i++){var a=t[i],s=t[i+1],u=xm(a.x,a.y,s.x,s.y);u>o&&(o=u,n=a,r=s)}e=[n,r]}return e},U_=function(t,e,n){var r=wm(t,n),o=wm(e,n);return r&&o},X_=function(t,e,n){var r=wm(t,n),o=wm(e,n);return!(r&&o)&&(r||o)},G_=function(t,e,n){for(var r,o=void 0,i=Mm(n),a=w_(i),s=0;s<a.length;s++){I_(t,e,a[s],a[(s+1)%a.length])&&(o=[a[s],a[(s+1)%a.length]])}return o&&(r=function(t,e,n,r){var o=(e.y-t.y)*(r.x-n.x)-(t.x-e.x)*(n.y-r.y);if(0===o)return!1;var i=((e.x-t.x)*(r.x-n.x)*(n.y-t.y)+(e.y-t.y)*(r.x-n.x)*t.x-(r.y-n.y)*(e.x-t.x)*n.x)/o,a=-((e.y-t.y)*(r.y-n.y)*(n.x-t.x)+(e.x-t.x)*(r.y-n.y)*t.y-(r.x-n.x)*(e.y-t.y)*n.y)/o;return(i-t.x)*(i-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(i-n.x)*(i-r.x)<=0&&(a-n.y)*(a-r.y)<=0&&{x:i,y:a}}(t,e,o[0],o[1])),r},W_=function(t,e){var n=void 0;return t.x===e.x?n=p_.VERTICAL:t.y===e.y&&(n=p_.HORIZONTAL),n},Y_=function(t){var e=t.split(" "),n=[];return e&&e.forEach((function(t){var e=io(t.split(","),2),r=e[0],o=e[1];n.push({x:Number(r),y:Number(o)})})),n},V_=function(t,e,n,r){var o=[];if(W_(t,n)===W_(e,r))t.y===n.y?(o.push({x:n.x,y:(n.y+r.y)/2}),o.push({x:r.x,y:(n.y+r.y)/2})):(o.push({x:(n.x+r.x)/2,y:n.y}),o.push({x:(n.x+r.x)/2,y:r.y}));else{var i={x:n.x,y:r.y},a=y_(i,t,n),s=y_(i,e,r);if(a||s)i={x:r.x,y:n.y};else{var u=F_(i,t,n),l=F_(i,e,r);u&&l&&(i={x:r.x,y:n.y})}o.push(i)}return o},F_=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},K_=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:e+=r>=1&&r<=126||r>=65376&&r<=65439?1:2}return e},q_=void 0,Z_=function(t){var e,n=t.start,r=t.end;if(n.x===r.x&&n.y===r.y)e="";else{var o={start:n,end:r,offset:10,verticalLength:5},i=h_(no(no({},o),{type:"start"})),a=h_(no(no({},o),{type:"end"}));e="M".concat(i.leftX," ").concat(i.leftY,"\n L").concat(i.rightX," ").concat(i.rightY,"\n L").concat(a.rightX," ").concat(a.rightY,"\n L").concat(a.leftX," ").concat(a.leftY," z")}return{d:e,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},$_=function(t){var e=t.start,n=t.end,r=t.sourceNode,o=t.targetNode,i=t.offset,a=Mm(r),s=Mm(o),u=__(a,i),l=__(s,i);return{sNext:b_(u,a,e),ePre:b_(l,s,n)}},J_=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(",");return[Q_(e[0]),Q_(e[1]),Q_(e[2]),Q_(e[3])]},Q_=function(t){var e=io(t.replace(/(^\s*)/g,"").split(" "),2);return{x:+e[0],y:+e[1]}},tm=function(t,e){var n=io(t,4);return[ub(n[0],n[1],n[2],n[3],e),t[3]]},em=function(t,e){for(var n,r=t.x,o=t.y,i=Y_(e),a=Number.MAX_SAFE_INTEGER,s=[],u=0;u<i.length;u++)s.push({start:i[u],end:i[(u+1)%i.length]});if(s.forEach((function(t){var e=t.start,i=t.end;if(e.x===i.x){var s={x:e.x,y:o};if(y_(s,e,i))(u=Math.abs(e.x-r))<a&&(a=u,n=s)}else if(e.y===i.y){var u;s={x:r,y:e.y};if(y_(s,e,i))(u=Math.abs(e.y-o))<a&&(a=u,n=s)}})),!n){var l=s[0],c=l.start,p=l.end;n={x:c.x+(p.x-c.x)/2,y:c.y+(p.y-c.y)/2}}return n},nm=function(t){return Hy(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},rm=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function om(t,e){return"function"!=typeof e?function(e,n,r){return Object.assign({type:t.edgeType},r)}:function(n,r,o){var i=e(n,r,o);return i?"string"==typeof i?Object.assign({},o,{type:i}):Object.assign({type:i},o):{type:t.edgeType}}}var im=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,o=0;return Yd(e,(function(t){var e=K_(t);o=e>o?e:o})),{width:Math.ceil(o/2)*r+r/4,height:n*(r+2)+r/4}};function am(t,e){return e*Math.round(t/e)||t}function sm(t,e,n){if(!t)return[];var r=Math.min.apply(Math,ao([],io(t.map((function(t){return t[0]}))),!1)),o=Math.max.apply(Math,ao([],io(t.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,ao([],io(t.map((function(t){return t[1]}))),!1)),a=Math.max.apply(Math,ao([],io(t.map((function(t){return t[1]}))),!1)),s=-r,u=-i,l=t.map((function(t){var e=io(t,2),n=e[0],r=e[1];return[n+s,r+u]})),c=e?e/(o-r):1,p=n?n/(a-i):1,d=Math.min(c,p);return l.map((function(t){var e=io(t,2),n=e[0],r=e[1];return[n*d,r*d]}))}var um=function(t,e,n){var r=io(t,2),o=r[0],i=r[1],a=io(e,2),s=a[0],u=a[1],l=io(n,2),c=l[0],p=l[1];return o>s&&o<c&&i>u&&i<p},lm=function(t,e){var n=!1;switch(e.multipleSelectKey){case"meta":n=t.metaKey;break;case"alt":n=t.altKey;break;case"shift":n=t.shiftKey;break;case"ctrl":n=t.ctrlKey;break;default:n=!1}return n};function cm(t,e){return!!(t instanceof dm&&e instanceof dm)}var pm=function(t){function e(n,r,o){var i=t.call(this,3)||this;return i[0]=n,i[1]=r,i[2]=o,i.x=n,i.y=r,i.z=o,Object.setPrototypeOf(i,e.prototype),i}return eo(e,t),e.prototype.add=function(t){if(cm(this,t))return new dm(this.x+t.x,this.y+t.y);var e=this.z+t.z;return new fm((this.x+t.x)/e,(this.y+t.y)/e)},e.prototype.subtract=function(t){if(cm(this,t))return new dm(this.x-t.x,this.y-t.y);var e=this.z-t.z;return 0===e?new dm(this.x-t.x,this.y-t.y):new fm((this.x-t.x)/e,(this.y-t.y)/e)},e}(Array),dm=function(t){function e(n,r,o){var i=t.call(this,n,r,null!=o?o:0)||this;return Object.setPrototypeOf(i,e.prototype),i}return eo(e,t),e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(t){var e=this;return t.reduce((function(t,n,r){return t+n*e[r]}))},e.prototype.cross=function(t){return new e(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var t=this.getLength();return new e(this.x/t,this.y/t)},e.prototype.crossZ=function(t){return this.x*t.y-this.y*t.x},e.prototype.angle=function(t){var e=this.crossZ(t),n=Math.acos(this.normalize().dot(t.normalize()));return e>=0?n:-n},e}(pm),fm=function(t){function e(n,r){var o=t.call(this,n,r,1)||this;return Object.setPrototypeOf(o,e.prototype),o}return eo(e,t),e.prototype.toString=function(){return"Point"},e}(pm),hm=function(t){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.call(this,n.length)||this;return o.fill(new Array(3)),n.forEach((function(t,e){o[e]=t})),o.columns=n[0].length,o.rows=n.length,Object.setPrototypeOf(o,e.prototype),o}return eo(e,t),e.prototype.getRow=function(t){return this[t]},e.prototype.getColumn=function(t){return ao([],io(this.map((function(e){return e[t]}))),!1)},e.prototype.transpose=function(){for(var t=[],n=0;n<this.columns;n++)t.push(this.getColumn(n));return new(e.bind.apply(e,ao([void 0],io(t),!1)))},e.prototype.cross=function(t){var n=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===t.rows)for(var r=0;r<this.rows;r++)for(var o=this.getRow(r),i=function(e){var i=t.getColumn(e);n[r][e]=o.reduce((function(t,e,n){return t+e*i[n]}),0)},a=0;a<t.columns;a++)i(a);return new(e.bind.apply(e,ao([void 0],io(n),!1)))},e.prototype.to2D=function(){return this.map((function(t){return[t[0],t[1]]}))},e.prototype.toPoints=function(){return this.map((function(t){return new fm(t[0],t[1])}))},e.prototype.toString=function(){var t=io(this[0],2),e=t[0],n=t[1],r=io(this[1],2),o=r[0],i=r[1],a=io(this[2],2),s=a[0],u=a[1];return"matrix(".concat(e," ").concat(n," ").concat(o," ").concat(i," ").concat(s," ").concat(u,")")},e.prototype.translate=function(t,e){return this.cross(new gm(t,e))},e.prototype.rotate=function(t){return this.cross(new ym(t))},e.prototype.scale=function(t,e){return this.cross(new vm(t,e))},e}(Array),ym=function(t){function e(n){var r=t.call(this,new dm(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new dm(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new dm(0,0,1))||this;return Object.setPrototypeOf(r,e.prototype),r}return eo(e,t),e.prototype.inverse=function(){return this.transpose()},e}(hm),vm=function(t){function e(n,r){var o=t.call(this,new dm(n,0,0),new dm(0,r,0),new dm(0,0,1))||this;return o.sx=n,o.sy=r,Object.setPrototypeOf(o,e.prototype),o}return eo(e,t),e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(hm),gm=function(t){function e(n,r){var o=t.call(this,new dm(1,0,0),new dm(0,1,0),new dm(n,r,1))||this;return o.tx=n,o.ty=r,Object.setPrototypeOf(o,e.prototype),o}return eo(e,t),e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(hm);ce({isolateGlobalState:!0});var _m=function(t){return t.anchors},mm=function(t,e){for(var n,r=e.nodes,o=r.length-1;o>=0;o--){var i=r[o];if(Sm(t,i)){var a=i.getTargetAnchor(t);if(a){var s={node:i,anchorIndex:a.index,anchor:a.anchor};n&&!bm(i,n.node,e)||(n=s)}}}return n},bm=function(t,e,n){return t.zIndex>e.zIndex||n.nodesMap[t.id].index>n.nodesMap[e.id].index},Em=function(t,e){for(var n,r=_m(e),o=Number.MAX_SAFE_INTEGER,i=0;i<r.length;i++){var a=xm(t.x,t.y,r[i].x,r[i].y);a<o&&(o=a,n={index:i,anchor:no(no({},r[i]),{x:r[i].x,y:r[i].y,id:r[i].id})})}return n},xm=function(t,e,n,r){return Math.hypot(t-n,e-r)},wm=function(t,e){var n=!1,r=Mm(e);return t.x>=r.minX-0&&t.x<=r.maxX+0&&t.y>=r.minY-0&&t.y<=r.maxY+0&&(n=!0),n},Sm=function(t,e){var n=!1,r=Mm(e);return t.x>=r.minX-5&&t.x<=r.maxX+5&&t.y>=r.minY-5&&t.y<=r.maxY+5&&(n=!0),n},Mm=function(t){var e=t.x,n=t.y,r=t.width,o=t.height;return{minX:e-r/2,minY:n-o/2,maxX:e+r/2,maxY:n+o/2,x:e,y:n,width:r,height:o,centerX:e,centerY:n}},Am=function(t){var e=t,n=e.x,r=e.y,o=e.width,i=e.height,a=e.radius;return[{x:n-o/2+a,y:r-i/2+a,r:a},{x:n+o/2-a,y:r-i/2+a,r:a},{x:n-o/2+a,y:r+i/2-a,r:a},{x:n+o/2-a,y:r+i/2-a,r:a}]},Tm=function(t,e,n){var r,o=Am(n),i=Number.MAX_SAFE_INTEGER;return o.forEach((function(e){var n=xm(t.x,t.y,e.x,e.y);n<i&&(i=n,r=e)})),Om(t,e,r)},Om=function(t,e,n){var r,o=n.x,i=n.y,a=n.r;if(e===p_.HORIZONTAL){var s=o-Math.sqrt(a*a-(t.y-i)*(t.y-i)),u=o+Math.sqrt(a*a-(t.y-i)*(t.y-i));r={x:Math.abs(s-t.x)<Math.abs(u-t.x)?s:u,y:t.y}}else if(e===p_.VERTICAL){var l=i-Math.sqrt(a*a-(t.x-o)*(t.x-o)),c=i+Math.sqrt(a*a-(t.x-o)*(t.x-o)),p=Math.abs(l-t.y)<Math.abs(c-t.y)?l:c;r={x:t.x,y:p}}return r},Nm=function(t,e){var n=e,r=!1,o=n.x,i=n.y,a=n.width,s=n.height,u=n.radius,l=o-a/2+u,c=o+a/2-u,p=i-s/2+u,d=i+s/2-u;return t.y===i+s/2||t.y===i-s/2?r=t.x>l&&t.x<c:t.x!==o+a/2&&t.x!==o-a/2||(r=t.y>p&&t.y<d),r},Dm=function(t,e,n){var r,o=n,i=o.x,a=o.y,s=o.rx,u=o.ry;if(e===p_.HORIZONTAL){var l=i-Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(u*u)),c=i+Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(u*u));r={x:Math.abs(l-t.x)<Math.abs(c-t.x)?l:c,y:t.y}}else if(e===p_.VERTICAL){var p=a-Math.sqrt(u*u-(t.x-i)*(t.x-i)*u*u/(s*s)),d=a+Math.sqrt(u*u-(t.x-i)*(t.x-i)*u*u/(s*s)),f=Math.abs(p-t.y)<Math.abs(d-t.y)?p:d;r={x:t.x,y:f}}return r},Pm=function(t,e,n){for(var r,o=n.pointsPosition,i=Number.MAX_SAFE_INTEGER,a=[],s=0;s<o.length;s++)a.push({start:o[s],end:o[(s+1)%o.length]});return a.forEach((function(n){var o=n.start,a=n.end,s=o,u=a;o.x>a.x&&(s=a,u=o);var l={x:t.x,y:t.y};if(s.x===u.x&&e===p_.HORIZONTAL&&(l={x:s.x,y:t.y}),s.y===u.y&&e===p_.VERTICAL&&(l={x:t.x,y:s.y}),s.x!==u.x&&s.y!==u.y){var c=(u.y-s.y)/(u.x-s.x),p=(s.x*u.y-u.x*s.y)/(s.x-u.x);e===p_.HORIZONTAL?l={x:(t.y-p)/c,y:t.y}:e===p_.VERTICAL&&(l={x:t.x,y:c*t.x+p})}if(y_(l,o,a)){var d=xm(l.x,l.y,t.x,t.y);d<i&&(i=d,r=l)}})),r},Cm=function(t){return Hy(t,["id","type","x","y","text","properties","virtual","rotate"])},Im=function(t,e,n,r){var o=t.x,i=t.y;return e.x>t.x?o=t.x+n/2:e.x<t.x&&(o=t.x-n/2),e.y>t.y?i=t.y+r/2:e.y<t.y&&(i=t.y-r/2),{x:o,y:i}},jm=function(t){var e=t.rows,n=t.style,r=t.rowsLength,o=t.className,i=document.createElement("div");i.className=o,i.style.fontSize="".concat(n.fontSize),i.style.width="".concat(n.width),i.style.lineHeight="".concat(n.lineHeight),i.style.padding="".concat(n.padding),n.fontFamily&&(i.style.fontFamily="".concat(n.fontFamily)),r>1?e.forEach((function(t){var e=document.createElement("div");e.textContent=t,i.appendChild(e)})):i.textContent=e[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},km=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,o=0;return e&&e.forEach((function(t){var e=K_(t);o=e>o?e:o})),{width:Math.ceil(o/2)*r+r/4,height:n*(r+2)+r/4}},Rm=function(t){return"object"!=typeof t?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let Lm;const Bm=new Uint8Array(16);function zm(){if(!Lm&&(Lm="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Lm))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Lm(Bm)}var Hm=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const Um=[];for(let t=0;t<256;++t)Um.push((t+256).toString(16).slice(1));function Xm(t,e=0){return Um[t[e+0]]+Um[t[e+1]]+Um[t[e+2]]+Um[t[e+3]]+"-"+Um[t[e+4]]+Um[t[e+5]]+"-"+Um[t[e+6]]+Um[t[e+7]]+"-"+Um[t[e+8]]+Um[t[e+9]]+"-"+Um[t[e+10]]+Um[t[e+11]]+Um[t[e+12]]+Um[t[e+13]]+Um[t[e+14]]+Um[t[e+15]]}function Gm(t){if(!function(t){return"string"==typeof t&&Hm.test(t)}(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}function Wm(t,e,n){function r(t,r,o,i){var a;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof r&&(r=Gm(r)),16!==(null===(a=r)||void 0===a?void 0:a.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+t.length);if(s.set(r),s.set(t,r.length),s=n(s),s[6]=15&s[6]|e,s[8]=63&s[8]|128,o){i=i||0;for(let t=0;t<16;++t)o[i+t]=s[t];return o}return Xm(s)}try{r.name=t}catch(t){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function Ym(t){return 14+(t+64>>>9<<4)+1}function Vm(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function Fm(t,e,n,r,o,i){return Vm((a=Vm(Vm(e,t),Vm(r,i)))<<(s=o)|a>>>32-s,n);var a,s}function Km(t,e,n,r,o,i,a){return Fm(e&n|~e&r,t,e,o,i,a)}function qm(t,e,n,r,o,i,a){return Fm(e&r|n&~r,t,e,o,i,a)}function Zm(t,e,n,r,o,i,a){return Fm(e^n^r,t,e,o,i,a)}function $m(t,e,n,r,o,i,a){return Fm(n^(e|~r),t,e,o,i,a)}Wm("v3",48,(function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return function(t){const e=[],n=32*t.length,r="0123456789abcdef";for(let o=0;o<n;o+=8){const n=t[o>>5]>>>o%32&255,i=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);e.push(i)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[Ym(e)-1]=e;let n=1732584193,r=-271733879,o=-1732584194,i=271733878;for(let e=0;e<t.length;e+=16){const a=n,s=r,u=o,l=i;n=Km(n,r,o,i,t[e],7,-680876936),i=Km(i,n,r,o,t[e+1],12,-389564586),o=Km(o,i,n,r,t[e+2],17,606105819),r=Km(r,o,i,n,t[e+3],22,-1044525330),n=Km(n,r,o,i,t[e+4],7,-176418897),i=Km(i,n,r,o,t[e+5],12,1200080426),o=Km(o,i,n,r,t[e+6],17,-1473231341),r=Km(r,o,i,n,t[e+7],22,-45705983),n=Km(n,r,o,i,t[e+8],7,1770035416),i=Km(i,n,r,o,t[e+9],12,-1958414417),o=Km(o,i,n,r,t[e+10],17,-42063),r=Km(r,o,i,n,t[e+11],22,-1990404162),n=Km(n,r,o,i,t[e+12],7,1804603682),i=Km(i,n,r,o,t[e+13],12,-40341101),o=Km(o,i,n,r,t[e+14],17,-1502002290),r=Km(r,o,i,n,t[e+15],22,1236535329),n=qm(n,r,o,i,t[e+1],5,-165796510),i=qm(i,n,r,o,t[e+6],9,-1069501632),o=qm(o,i,n,r,t[e+11],14,643717713),r=qm(r,o,i,n,t[e],20,-373897302),n=qm(n,r,o,i,t[e+5],5,-701558691),i=qm(i,n,r,o,t[e+10],9,38016083),o=qm(o,i,n,r,t[e+15],14,-660478335),r=qm(r,o,i,n,t[e+4],20,-405537848),n=qm(n,r,o,i,t[e+9],5,568446438),i=qm(i,n,r,o,t[e+14],9,-1019803690),o=qm(o,i,n,r,t[e+3],14,-187363961),r=qm(r,o,i,n,t[e+8],20,1163531501),n=qm(n,r,o,i,t[e+13],5,-1444681467),i=qm(i,n,r,o,t[e+2],9,-51403784),o=qm(o,i,n,r,t[e+7],14,1735328473),r=qm(r,o,i,n,t[e+12],20,-1926607734),n=Zm(n,r,o,i,t[e+5],4,-378558),i=Zm(i,n,r,o,t[e+8],11,-2022574463),o=Zm(o,i,n,r,t[e+11],16,1839030562),r=Zm(r,o,i,n,t[e+14],23,-35309556),n=Zm(n,r,o,i,t[e+1],4,-1530992060),i=Zm(i,n,r,o,t[e+4],11,1272893353),o=Zm(o,i,n,r,t[e+7],16,-155497632),r=Zm(r,o,i,n,t[e+10],23,-1094730640),n=Zm(n,r,o,i,t[e+13],4,681279174),i=Zm(i,n,r,o,t[e],11,-358537222),o=Zm(o,i,n,r,t[e+3],16,-722521979),r=Zm(r,o,i,n,t[e+6],23,76029189),n=Zm(n,r,o,i,t[e+9],4,-640364487),i=Zm(i,n,r,o,t[e+12],11,-421815835),o=Zm(o,i,n,r,t[e+15],16,530742520),r=Zm(r,o,i,n,t[e+2],23,-995338651),n=$m(n,r,o,i,t[e],6,-198630844),i=$m(i,n,r,o,t[e+7],10,1126891415),o=$m(o,i,n,r,t[e+14],15,-1416354905),r=$m(r,o,i,n,t[e+5],21,-57434055),n=$m(n,r,o,i,t[e+12],6,1700485571),i=$m(i,n,r,o,t[e+3],10,-1894986606),o=$m(o,i,n,r,t[e+10],15,-1051523),r=$m(r,o,i,n,t[e+1],21,-2054922799),n=$m(n,r,o,i,t[e+8],6,1873313359),i=$m(i,n,r,o,t[e+15],10,-30611744),o=$m(o,i,n,r,t[e+6],15,-1560198380),r=$m(r,o,i,n,t[e+13],21,1309151649),n=$m(n,r,o,i,t[e+4],6,-145523070),i=$m(i,n,r,o,t[e+11],10,-1120210379),o=$m(o,i,n,r,t[e+2],15,718787259),r=$m(r,o,i,n,t[e+9],21,-343485551),n=Vm(n,a),r=Vm(r,s),o=Vm(o,u),i=Vm(i,l)}return[n,r,o,i]}(function(t){if(0===t.length)return[];const e=8*t.length,n=new Uint32Array(Ym(e));for(let r=0;r<e;r+=8)n[r>>5]|=(255&t[r/8])<<r%32;return n}(t),8*t.length))}));var Jm={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Qm(t,e,n){if(Jm.randomUUID&&!e&&!t)return Jm.randomUUID();const r=(t=t||{}).random||(t.rng||zm)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return Xm(r)}function tb(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function eb(t,e){return t<<e|t>>>32-e}Wm("v5",80,(function(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const r=t.length/4+2,o=Math.ceil(r/16),i=new Array(o);for(let e=0;e<o;++e){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=t[64*e+4*r]<<24|t[64*e+4*r+1]<<16|t[64*e+4*r+2]<<8|t[64*e+4*r+3];i[e]=n}i[o-1][14]=8*(t.length-1)/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<o;++t){const r=new Uint32Array(80);for(let e=0;e<16;++e)r[e]=i[t][e];for(let t=16;t<80;++t)r[t]=eb(r[t-3]^r[t-8]^r[t-14]^r[t-16],1);let o=n[0],a=n[1],s=n[2],u=n[3],l=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),i=eb(o,5)+tb(n,a,s,u)+l+e[n]+r[t]>>>0;l=u,u=s,s=eb(a,30)>>>0,a=o,o=i}n[0]=n[0]+o>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+u>>>0,n[4]=n[4]+l>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var nb=function(){return Qm()},rb=new Map,ob=function(t){var e=nb();var n=window.requestAnimationFrame((function n(){if(t(),rb.get(e)){var r=window.requestAnimationFrame(n);rb.set(e,r)}}));return rb.set(e,n),e},ib=function(t){var e=rb.get(t);e&&(window.cancelAnimationFrame(e),rb.delete(t))},ab=100,sb={x:1,y:0,z:0};function ub(t,e,n,r,o){for(var i=function(o){if(o<0||o>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-o,3)+3*e.x*o*Math.pow(1-o,2)+3*n.x*Math.pow(o,2)*(1-o)+r.x*Math.pow(o,3),y:t.y*Math.pow(1-o,3)+3*e.y*o*Math.pow(1-o,2)+3*n.y*Math.pow(o,2)*(1-o)+r.y*Math.pow(o,3)}},a=0,s=2,u=r.x,l=r.y,c=r;a<o&&s<50;){var p=(c=i(1-s/ab)).x,d=c.y;a=xm(u,l,p,d),s++}return c}function lb(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function cb(t){return function(t,e){var n=function(t,e){return t.x*e.y-t.y*e.x}(t,e),r=Math.acos(function(t,e){var n=[t.x,t.y,t.z];return[e.x,e.y,e.z].reduce((function(t,e,r){return t+e*n[r]}))}(lb(t),lb(e)));return n>=0?r:-r}(sb,t)}function pb(t){return t*(180/Math.PI)}var db={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},fb=function(t){var e=up(db);return t&&(e=Uh(e,t)),e},hb=fb,yb=1e3,vb=999,gb=function(){return++yb},_b=function(){return--vb},mb=Object.freeze({__proto__:null,Matrix:hm,Point:fm,RotateMatrix:ym,ScaleMatrix:vm,StepDrag:f_,TranslateMatrix:gm,Vector:dm,action:te,cancelRaf:ib,computed:rt,configure:ce,costByPoints:N_,createEdgeGenerator:om,createRaf:ob,createUuid:nb,defaultAnimationOffConfig:t_,defaultAnimationOnConfig:e_,defaultTheme:db,degrees:pb,distance:xm,estimateDistance:O_,filterRepeatPoints:g_,formatAnchorConnectValidateData:Rm,formatData:i_,getAnchors:_m,getAppendAttributes:Z_,getBBoxCrossPointsByPoint:T_,getBBoxOfPoints:x_,getBBoxXCrossPoints:M_,getBBoxYCrossPoints:A_,getBezierControlPoints:$_,getBezierPoints:J_,getBoxByOriginNode:L_,getBytesLength:K_,getClosestAnchor:Em,getClosestPointOfPolyline:em,getClosestRadiusCenter:Tm,getCrossPointInRect:G_,getCrossPointWithCircle:Om,getCrossPointWithEllipse:Dm,getCrossPointWithPolygon:Pm,getEndTangent:tm,getExpandedBBox:__,getExpandedBBoxPoint:b_,getGridOffset:function(t,e){return t%e},getHtmlTextHeight:jm,getLongestEdge:H_,getMinIndex:_b,getNextNeighborPoints:k_,getNodeAnchorPosition:Im,getNodeBBox:Mm,getPointsFromBBox:w_,getPolylinePoints:z_,getRectRadiusCircle:Am,getSimplePoints:V_,getSimplePolyline:function(t,e){var n=[t,{x:t.x,y:e.y},e];return g_(n)},getSvgTextSize:im,getSvgTextWidthHeight:km,getTextWidth:function(t,e){q_||(q_=document.createElement("canvas"));var n=q_.getContext("2d");return n.font=e,n.measureText(t).width},getThetaOfVector:cb,getZIndex:gb,heuristicCostEstimate:D_,inStraightLineOfRect:Nm,isBboxOverLapping:v_,isIe:o_,isInNode:wm,isInNodeBbox:Sm,isMultipleSelect:lm,isObservable:Se,isPointInArea:um,isPointOutsideBBox:S_,isSegmentCrossingBBox:j_,isSegmentsCrossNode:X_,isSegmentsInNode:U_,isSegmentsIntersected:I_,mergeBBox:E_,normalizePolygon:sm,observable:$,pathFinder:R_,pickEdgeConfig:nm,pickNodeConfig:Cm,pointDirection:m_,pointEdgeDirection:function(t,e){var n=Math.abs(t.x-e.x),r=Math.abs(t.y-e.y);return n/e.width>r/e.height?p_.VERTICAL:p_.HORIZONTAL},pointFilter:B_,points2PointsList:Y_,reaction:ae,rebuildPath:P_,refreshGraphId:function(t,e){void 0===e&&(e="");var n=t.nodes.reduce((function(t,n){return t[n.id]=e+Qm(),n.id=t[n.id],t}),{});return t.edges.forEach((function(t){t.id=e+Qm(),t.sourceNodeId=n[t.sourceNodeId],t.targetNodeId=n[t.targetNodeId]})),t},removeClosePointFromOpenList:C_,sampleCubic:ub,segmentDirection:W_,setupAnimation:n_,setupEdgeModel:function(t,e){var n;switch(t.type){case"line":default:n=new xb(t,e);break;case"polyline":n=new wb(t,e)}return n},setupTheme:fb,snapToGrid:am,targetNodeInfo:mm,toJS:je,twoPointDistance:rm,updateAnimation:r_,updateTheme:hb}),bb=function(){function e(e,n){this.BaseType=t.ElementType.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.properties={},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=t.ElementState.DEFAULT,this.modelType=t.ModelType.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=n,this.initEdgeData(e),this.setAttributes()}return e.prototype.initEdgeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),r=this.createId();t.id=r||n||nb()}this.arrowConfig.markerEnd="url(#marker-end-".concat(t.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(t.id,")");var o=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=o,js(this,nm(t)),this.graphModel.overlapMode===c_.INCREASE&&(this.zIndex=t.zIndex||gb()),this.setAnchors(),this.initPoints(),this.formatText(t)},e.prototype.setAttributes=function(){},e.prototype.createId=function(){return null},e.prototype.getEdgeStyle=function(){return no(no({},this.graphModel.theme.baseEdge),this.style)},e.prototype.getAdjustPointStyle=function(){return no({},this.graphModel.theme.edgeAdjust)},e.prototype.getTextStyle=function(){return up(this.graphModel.theme.edgeText)},e.prototype.getEdgeAnimationStyle=function(){return up(this.graphModel.theme.edgeAnimation)},e.prototype.getArrowStyle=function(){var t=this.getEdgeStyle(),e=this.getEdgeAnimationStyle(),n=this.graphModel.theme.arrow,r=this.isAnimation?e.stroke:t.stroke;return no(no(no({},t),{fill:r,stroke:r}),n)},e.prototype.getOutlineStyle=function(){return up(this.graphModel.theme.outline)},e.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(e.prototype,"sourceNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.sourceNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.targetNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),e.prototype.getBeginAnchor=function(t,e,n){var r,o,i=_m(t);if(n){if(r=yf(i,(function(t){return t.id===n})))return r;console.warn("未在节点上找到指定的起点锚点".concat(n,",已使用默认锚点作为起点"))}return i.forEach((function(t){var n=rm(t,e);(void 0===o||n<o)&&(o=n,r=t)})),r},e.prototype.getEndAnchor=function(t,e){var n,r,o=this,i=_m(t);if(e){if(n=yf(i,(function(t){return t.id===e})))return n;console.warn("未在节点上找到指定的终点锚点".concat(e,",已使用默认锚点作为终点"))}return i.forEach((function(t){if(o.startPoint){var e=rm(t,o.startPoint);(void 0===r||e<r)&&(r=e,n=t)}})),n},e.prototype.getProperties=function(){return je(this.properties)},e.prototype.getData=function(){var t=this.text,e=t.x,n=t.y,r=t.value,o={id:this.id,type:this.type,sourceNodeId:this.sourceNode.id,targetNodeId:this.targetNode.id,startPoint:js({},this.startPoint),endPoint:js({},this.endPoint),properties:je(this.properties)};return r&&(o.text={x:e,y:n,value:r}),this.graphModel.overlapMode===c_.INCREASE&&(o.zIndex=this.zIndex),o},e.prototype.getHistoryData=function(){return this.getData()},e.prototype.setProperty=function(t,e){this.properties[t]=i_(e),this.setAttributes()},e.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},e.prototype.setProperties=function(t){this.properties=no(no({},je(this.properties)),i_(t)),this.setAttributes()},e.prototype.changeEdgeId=function(t){var e=this.arrowConfig,n=e.markerEnd,r=e.markerStart;r&&r==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(t,")")),n&&n==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(t,")")),this.id=t},e.prototype.setStyle=function(t,e){var n;this.style=no(no({},this.style),((n={})[t]=i_(e),n))},e.prototype.setStyles=function(t){this.style=no(no({},this.style),i_(t))},e.prototype.updateStyles=function(t){this.style=no({},i_(t))},e.prototype.formatText=function(t){var e,n,r,o=this.textPosition,i=o.x,a=o.y,s=t.text,u={value:"",x:i,y:a,draggable:!1,editable:!0};s&&("string"==typeof s?u=no(no({},u),{value:s}):(u=no(no({},u),{x:null!==(e=s.x)&&void 0!==e?e:i,y:null!==(n=s.y)&&void 0!==n?n:a,value:null!==(r=s.value)&&void 0!==r?r:""}),Mh(s.draggable)||(u.draggable=s.draggable),Mh(s.editable)||(u.editable=s.editable))),this.text=u},e.prototype.resetTextPosition=function(){var t=this.textPosition,e=t.x,n=t.y;this.text.x=e,this.text.y=n},e.prototype.moveText=function(t,e){if(this.text){var n=this.text,r=n.x,o=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,draggable:a,x:r+t,y:o+e,editable:s}}},e.prototype.setText=function(t){t&&js(this.text,t)},e.prototype.updateText=function(t){this.text=no(no({},je(this.text)),{value:t})},e.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){if(!(t=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId)))throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:t.x,y:t.y}),this.sourceAnchorId||(this.sourceAnchorId=t.id)}if(!this.targetAnchorId||!this.endPoint){var t;if(!(t=this.getEndAnchor(this.targetNode,this.targetAnchorId)))throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:t.x,y:t.y}),this.targetAnchorId||(this.targetAnchorId=t.id)}},e.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},e.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t},e.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},e.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},e.prototype.openEdgeAnimation=function(){this.isAnimation=!0},e.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},e.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},e.prototype.updateStartPoint=function(t){this.startPoint=t},e.prototype.moveStartPoint=function(t,e){this.startPoint&&(this.startPoint.x+=t,this.startPoint.y+=e)},e.prototype.updateEndPoint=function(t){this.endPoint=t},e.prototype.moveEndPoint=function(t,e){this.endPoint&&(this.endPoint.x+=t,this.endPoint.y+=e)},e.prototype.setZIndex=function(t){void 0===t&&(t=0),this.zIndex=t},e.prototype.initPoints=function(){},e.prototype.updateAttributes=function(t){js(this,t)},e.prototype.getAdjustStart=function(){return this.startPoint},e.prototype.getAdjustEnd=function(){return this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint;this.updateStartPoint({x:e.x,y:e.y}),this.updateEndPoint({x:n.x,y:n.y})},e.BaseType=t.ElementType.EDGE,oo([$],e.prototype,"type",void 0),oo([$],e.prototype,"sourceNodeId",void 0),oo([$],e.prototype,"targetNodeId",void 0),oo([$],e.prototype,"startPoint",void 0),oo([$],e.prototype,"endPoint",void 0),oo([$],e.prototype,"text",void 0),oo([$],e.prototype,"properties",void 0),oo([$],e.prototype,"points",void 0),oo([$],e.prototype,"pointsList",void 0),oo([$],e.prototype,"isSelected",void 0),oo([$],e.prototype,"isHovered",void 0),oo([$],e.prototype,"isHitable",void 0),oo([$],e.prototype,"isHittable",void 0),oo([$],e.prototype,"draggable",void 0),oo([$],e.prototype,"visible",void 0),oo([$],e.prototype,"isAnimation",void 0),oo([$],e.prototype,"isShowAdjustPoint",void 0),oo([$],e.prototype,"zIndex",void 0),oo([$],e.prototype,"state",void 0),oo([$],e.prototype,"style",void 0),oo([$],e.prototype,"arrowConfig",void 0),oo([rt],e.prototype,"sourceNode",null),oo([rt],e.prototype,"targetNode",null),oo([rt],e.prototype,"textPosition",null),oo([te],e.prototype,"setProperty",null),oo([te],e.prototype,"deleteProperty",null),oo([te],e.prototype,"setProperties",null),oo([te],e.prototype,"changeEdgeId",null),oo([te],e.prototype,"setStyle",null),oo([te],e.prototype,"setStyles",null),oo([te],e.prototype,"updateStyles",null),oo([te],e.prototype,"formatText",null),oo([te],e.prototype,"resetTextPosition",null),oo([te],e.prototype,"moveText",null),oo([te],e.prototype,"setText",null),oo([te],e.prototype,"updateText",null),oo([te],e.prototype,"setAnchors",null),oo([te],e.prototype,"setSelected",null),oo([te],e.prototype,"setHovered",null),oo([te],e.prototype,"setHitable",null),oo([te],e.prototype,"setHittable",null),oo([te],e.prototype,"openEdgeAnimation",null),oo([te],e.prototype,"closeEdgeAnimation",null),oo([te],e.prototype,"setElementState",null),oo([te],e.prototype,"updateStartPoint",null),oo([te],e.prototype,"moveStartPoint",null),oo([te],e.prototype,"updateEndPoint",null),oo([te],e.prototype,"moveEndPoint",null),oo([te],e.prototype,"setZIndex",null),oo([te],e.prototype,"initPoints",null),oo([te],e.prototype,"updateAttributes",null),oo([te],e.prototype,"getAdjustStart",null),oo([te],e.prototype,"getAdjustEnd",null),oo([te],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(),Eb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.BEZIER_EDGE,o.path="",o.initEdgeData(n),o.setAttributes(),o}return eo(n,e),n.prototype.initEdgeData=function(t){this.offset=100,e.prototype.initEdgeData.call(this,t)},n.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.bezier,n=e.prototype.getEdgeStyle.call(this);return no(no({},n),up(t))},n.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var t=0,e=0;return this.pointsList.forEach((function(n){var r=n.x,o=n.y;t+=r,e+=o})),{x:t/this.pointsList.length,y:e/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},n.prototype.getData=function(){var t=e.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return no(no({},t),{pointsList:n})},n.prototype.getControls=function(){var t=this.startPoint,e=this.endPoint;return $_({start:t,end:e,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})},n.prototype.getPath=function(t){var e=io(t,4),n=e[0],r=e[1],o=e[2],i=e[3];return"M ".concat(n.x," ").concat(n.y,"\n C ").concat(r.x," ").concat(r.y,",\n ").concat(o.x," ").concat(o.y,",\n ").concat(i.x," ").concat(i.y)},n.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},n.prototype.updatePoints=function(){var t=this.getControls(),e=t.sNext,n=t.ePre;this.updatePath(e,n)},n.prototype.updatePath=function(t,e){t=up(t),e=up(e);var n={x:this.startPoint.x,y:this.startPoint.y},r={x:this.endPoint.x,y:this.endPoint.y};if(!t||!e){var o=this.getControls();t=o.sNext,e=o.ePre}this.pointsList=[n,t,e,r],this.path=this.getPath(this.pointsList)},n.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},n.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},n.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e;var n=io(this.pointsList,3),r=n[1],o=n[2];r.x+=t,r.y+=e,this.updatePath(r,o)},n.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e;var n=io(this.pointsList,3),r=n[1],o=n[2];o.x+=t,o.y+=e,this.updatePath(r,o)},n.prototype.updateAdjustAnchor=function(t,e){"sNext"===e?this.pointsList[1]=t:"ePre"===e&&(this.pointsList[2]=t),this.path=this.getPath(this.pointsList),this.setText(Object.assign({},this.text,this.textPosition))},n.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},n.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},n.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,r=t.sourceNode,o=t.targetNode,i=$_({start:e,end:n,sourceNode:r,targetNode:o,offset:this.offset}),a=i.sNext,s=i.ePre;this.pointsList=[e,a,s,n],this.initPoints()},oo([$],n.prototype,"path",void 0),oo([te],n.prototype,"initPoints",null),oo([te],n.prototype,"updatePoints",null),oo([te],n.prototype,"updateStartPoint",null),oo([te],n.prototype,"updateEndPoint",null),oo([te],n.prototype,"moveStartPoint",null),oo([te],n.prototype,"moveEndPoint",null),oo([te],n.prototype,"updateAdjustAnchor",null),oo([te],n.prototype,"getAdjustStart",null),oo([te],n.prototype,"getAdjustEnd",null),oo([te],n.prototype,"updateAfterAdjustStartAndEnd",null),n}(bb),xb=function(e){function n(){var n=e.apply(this,ao([],io(arguments),!1))||this;return n.modelType=t.ModelType.LINE_EDGE,n}return eo(n,e),n.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.line,n=e.prototype.getEdgeStyle.call(this);return no(no({},n),up(t))},n.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},n}(bb),wb=function(e){function n(){var n=e.apply(this,ao([],io(arguments),!1))||this;return n.modelType=t.ModelType.POLYLINE_EDGE,n.draggingPointList=[],n}return eo(n,e),n.prototype.initEdgeData=function(t){this.offset=30,e.prototype.initEdgeData.call(this,t)},n.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.polyline,n=e.prototype.getEdgeStyle.call(this);return no(no({},n),up(t))},n.prototype.getTextPosition=function(){var t,e=null===(t=this.text)||void 0===t?void 0:t.value;if(this.dbClickPosition&&!e){var n=this.dbClickPosition;return{x:n.x,y:n.y}}var r=Y_(this.points),o=io(H_(r),2),i=o[0],a=o[1];return{x:(i.x+a.x)/2,y:(i.y+a.y)/2}},n.prototype.getAfterAnchor=function(t,e,n){var r,o;return n.forEach((function(n){var i;t===p_.HORIZONTAL?i=Math.abs(e.y-n.y):t===p_.VERTICAL&&(i=Math.abs(e.x-n.x)),(!o||o>i)&&(o=i,r=n)})),r},n.prototype.getCrossPoint=function(t,e,n){var r;return t===p_.HORIZONTAL?r={x:n.x,y:e.y}:t===p_.VERTICAL&&(r={x:e.x,y:n.y}),r},n.prototype.removeCrossPoints=function(t,e,n){var r=n.map((function(t){return t}));if(1===t){var o=r[t],i=r[e],a=r[t-1];if(U_(a,o,this.sourceNode)){if(X_(o,i,this.sourceNode))(s=G_(o,i,this.sourceNode))&&(r[t]=s,r.splice(t-1,1),t--,e--)}else this.sourceNode.anchors.forEach((function(e){(e.x===a.x&&e.x===o.x||e.y===a.y&&e.y===o.y)&&(xm(e.x,e.y,o.x,o.y)<xm(a.x,a.y,o.x,o.y)&&(r[t-1]=e))}))}if(e===n.length-2){var s,u=r[t],l=r[e],c=r[e+1];if(U_(l,c,this.targetNode)){if(X_(u,l,this.targetNode))(s=G_(u,l,this.targetNode))&&(r[e]=s,r.splice(e+1,1))}else this.targetNode.anchors.forEach((function(t){(t.x===c.x&&t.x===l.x||t.y===c.y&&t.y===l.y)&&(xm(t.x,t.y,l.x,l.y)<xm(c.x,c.y,l.x,l.y)&&(r[e+1]=t))}))}return r},n.prototype.getDraggingPoints=function(t,e,n,r,o){var i=o.map((function(t){return t})),a=this.getAfterAnchor(t,n,r),s=this.getCrossPoint(t,n,a);return"start"===e?(i.unshift(s),i.unshift(a)):(i.push(s),i.push(a)),i},n.prototype.updateCrossPoints=function(e){var n=e.map((function(t){return t})),r=e[0],o=e[1],i=e[n.length-2],a=e[n.length-1],s=this.sourceNode,u=this.targetNode,l=s.modelType,c=u.modelType,p=W_(r,o),d=n[0];switch(l){case t.ModelType.RECT_NODE:if(0!==s.radius)Nm(r,s)||(d=Tm(r,p,s));break;case t.ModelType.CIRCLE_NODE:d=Om(r,p,s);break;case t.ModelType.ELLIPSE_NODE:d=Dm(r,p,s);break;case t.ModelType.DIAMOND_NODE:case t.ModelType.POLYGON_NODE:d=Pm(r,p,s)}d&&(n[0]=d);var f=W_(i,a),h=n[n.length-1];switch(c){case t.ModelType.RECT_NODE:if(0!==u.radius)Nm(a,u)||(h=Tm(a,f,u));break;case t.ModelType.CIRCLE_NODE:h=Om(a,f,u);break;case t.ModelType.ELLIPSE_NODE:h=Dm(a,f,u);break;case t.ModelType.DIAMOND_NODE:case t.ModelType.POLYGON_NODE:h=Pm(a,f,u)}return h&&(n[n.length-1]=h),n},n.prototype.getData=function(){var t=e.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return Object.assign({},t,{pointsList:n})},n.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.pointsList.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" "):this.updatePoints()},n.prototype.updatePoints=function(){var t=z_({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=t,this.points=t.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},n.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},n.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e,this.updatePoints()},n.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},n.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e,this.updatePoints()},n.prototype.updatePointsList=function(t,e){this.pointsList.forEach((function(n){n.x+=t,n.y+=e}));var n=this.pointsList[0];this.startPoint=Object.assign({},n);var r=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},r),this.initPoints()},n.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map((function(t){return t}))},n.prototype.dragAppendSimple=function(t,e){this.isDragging=!0;var n=t.start,r=t.end,o=t.startIndex,i=t.endIndex,a=t.direction,s=this.pointsList,u=s;return a===p_.HORIZONTAL?(s[o]={x:n.x,y:n.y+e.y},s[i]={x:r.x,y:r.y+e.y},u=this.pointsList.map((function(t){return t}))):a===p_.VERTICAL&&(s[o]={x:n.x+e.x,y:n.y},s[i]={x:r.x+e.x,y:r.y},u=this.pointsList.map((function(t){return t}))),this.updatePointsAfterDrag(u),this.draggingPointList=u,this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},s[o]),end:Object.assign({},s[i]),startIndex:o,endIndex:i,direction:a}},n.prototype.dragAppend=function(t,e){this.isDragging=!0;var n=t.start,r=t.end,o=t.startIndex,i=t.endIndex,a=t.direction,s=this.pointsList;if(a===p_.HORIZONTAL){s[o]={x:n.x,y:n.y+e.y},s[i]={x:r.x,y:r.y+e.y};var u=this.pointsList.map((function(t){return t}));if(0!==o&&i!==this.pointsList.length-1&&(u=this.removeCrossPoints(o,i,u)),0===o){var l={x:n.x,y:n.y+e.y};if(!wm(l,this.sourceNode)){var c=this.sourceNode.anchors;u=this.getDraggingPoints(a,"start",l,c,u)}}if(i===this.pointsList.length-1){var p={x:r.x,y:r.y+e.y};if(!wm(p,this.targetNode)){c=this.targetNode.anchors;u=this.getDraggingPoints(a,"end",p,c,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}else if(a===p_.VERTICAL){s[o]={x:n.x+e.x,y:n.y},s[i]={x:r.x+e.x,y:r.y};u=this.pointsList.map((function(t){return t}));if(0!==o&&i!==this.pointsList.length-1&&(u=this.removeCrossPoints(o,i,u)),0===o){l={x:n.x+e.x,y:n.y};if(!wm(l,this.sourceNode)){c=this.sourceNode.anchors;u=this.getDraggingPoints(a,"start",l,c,u)}}if(i===this.pointsList.length-1){p={x:r.x+e.x,y:r.y};if(!wm(p,this.targetNode)){c=this.targetNode.anchors;u=this.getDraggingPoints(a,"end",p,c,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}return this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},s[o]),end:Object.assign({},s[i]),startIndex:o,endIndex:i,direction:a}},n.prototype.dragAppendEnd=function(){if(this.draggingPointList){var t=B_(Y_(this.points));this.pointsList=t.map((function(t){return t})),this.draggingPointList=[];var e=t[0];this.startPoint=Object.assign({},e);var n=t[t.length-1];this.endPoint=Object.assign({},n)}this.isDragging=!1},n.prototype.updatePointsAfterDrag=function(t){var e=this.updateCrossPoints(t);this.points=e.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},n.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},n.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},n.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,r=t.sourceNode,o=t.targetNode;this.pointsList=z_({x:e.x,y:e.y},{x:n.x,y:n.y},r,o,this.offset||0),this.initPoints()},oo([$],n.prototype,"dbClickPosition",void 0),oo([te],n.prototype,"initPoints",null),oo([te],n.prototype,"updatePoints",null),oo([te],n.prototype,"updateStartPoint",null),oo([te],n.prototype,"moveStartPoint",null),oo([te],n.prototype,"updateEndPoint",null),oo([te],n.prototype,"moveEndPoint",null),oo([te],n.prototype,"updatePointsList",null),oo([te],n.prototype,"dragAppendStart",null),oo([te],n.prototype,"dragAppendSimple",null),oo([te],n.prototype,"dragAppend",null),oo([te],n.prototype,"dragAppendEnd",null),oo([te],n.prototype,"updatePointsAfterDrag",null),oo([te],n.prototype,"getAdjustStart",null),oo([te],n.prototype,"getAdjustEnd",null),oo([te],n.prototype,"updateAfterAdjustStartAndEnd",null),n}(bb),Sb=function(){function e(e,n){this.BaseType=t.ElementType.NODE,this.id="",this.type="",this.x=0,this.y=0,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.properties={},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.enableRotate=!0,this.enableResize=!0,this.zIndex=1,this.state=t.ElementState.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=t.ModelType.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=n,this.properties=e.properties||{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t;var e=this.x,n=void 0===e?0:e,r=this.y,o=void 0===r?0:r;this.transform=new gm(-n,-o).rotate(t).translate(n,o).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),e.prototype.initNodeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),r=this.createId();t.id=r||n||nb()}this.formatText(t),js(this,Cm(t)),this.graphModel.overlapMode===c_.INCREASE&&(this.zIndex=t.zIndex||gb())},e.prototype.setAttributes=function(){},e.prototype.createId=function(){return null},e.prototype.formatText=function(t){var e,n,r,o=t.x,i=t.y,a=t.text,s={value:"",x:o,y:i,draggable:!1,editable:!0};a&&("string"==typeof a?s.value=a:(s=no(no({},s),{x:null!==(e=a.x)&&void 0!==e?e:o,y:null!==(n=a.y)&&void 0!==n?n:i,value:null!==(r=a.value)&&void 0!==r?r:""}),Mh(a.draggable)||(s.draggable=a.draggable),Mh(a.editable)||(s.draggable=a.draggable))),t.text=s},e.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.width=e,this.height=n,this.setProperties({width:e,height:n}),this.getData()},e.prototype.proportionalResize=function(){},e.prototype.getData=function(){var t=this.text,e=t.x,n=t.y,r=t.value,o=this.properties;Se(o)&&(o=je(o));var i={id:this.id,type:this.type,x:this.x,y:this.y,properties:o};return this.rotate&&(i.rotate=this.rotate),this.graphModel.overlapMode===c_.INCREASE&&(i.zIndex=this.zIndex),r&&(i.text={x:e,y:n,value:r}),i},e.prototype.getHistoryData=function(){return this.getData()},e.prototype.getProperties=function(){return je(this.properties)},e.prototype.getOuterGAttributes=function(){return{className:""}},e.prototype.getNodeStyle=function(){return no(no({},this.graphModel.theme.baseNode),this.style)},e.prototype.getTextStyle=function(){return up(this.graphModel.theme.nodeText)},e.prototype.getRotateControlStyle=function(){return up(this.graphModel.theme.rotateControl)},e.prototype.getResizeControlStyle=function(){return up(this.graphModel.theme.resizeControl)},e.prototype.getResizeOutlineStyle=function(){return up(this.graphModel.theme.resizeOutline)},e.prototype.getAnchorStyle=function(t){return up(this.graphModel.theme.anchor)},e.prototype.getAnchorLineStyle=function(t){return up(this.graphModel.theme.anchorLine)},e.prototype.getOutlineStyle=function(){return up(this.graphModel.theme.outline)},e.prototype.isAllowConnectedAsSource=function(t,e,n,r){var o=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var i=!0,a="",s=0;s<o.length;s++){var u=o[s];if(!u.validate.call(this,this,t,e,n,r)){i=!1,a=u.message;break}}return{isAllPass:i,msg:a}},e.prototype.getConnectedSourceRules=function(){return this.sourceRules},e.prototype.isAllowConnectedAsTarget=function(t,e,n,r){var o=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var i=!0,a="",s=0;s<o.length;s++){var u=o[s];if(!u.validate.call(this,t,this,e,n,r)){i=!1,a=u.message;break}}return{isAllPass:i,msg:a}},e.prototype.isAllowMoveNode=function(t,e){var n,r,o=!0,i=!0,a=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),u=s.next();!u.done;u=s.next()){var l=(0,u.value)(this,t,e);if(!l)return!1;if("object"==typeof l){var c=l;if(!c.x&&!c.y)return!1;o=o&&c.x,i=i&&c.y}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return{x:o,y:i}},e.prototype.getConnectedTargetRules=function(){return this.targetRules},e.prototype.getAnchorsByOffset=function(){var t=this,e=t.anchorsOffset,n=t.id,r=t.x,o=t.y;return e&&e.length>0?e.map((function(t,e){return t.length?{id:"".concat(n,"_").concat(e),x:r+t[0],y:o+t[1]}:no(no({},t),{x:r+t.x,y:o+t.y,id:t.id||"".concat(n,"_").concat(e)})})):this.getDefaultAnchor()},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.getTargetAnchor=function(t){return Em(t,this)},e.prototype.getBounds=function(){return{x1:this.x-this.width/2,y1:this.y-this.height/2,x2:this.x+this.width/2,y2:this.y+this.height/2}},Object.defineProperty(e.prototype,"anchors",{get:function(){var t=this.getAnchorsByOffset(),e=this,n=e.x,r=e.y,o=e.rotate;return t.forEach((function(t){var e=t.x,i=t.y,a=io(new hm([e,i,1]).translate(-n,-r).rotate(o).translate(n,r)[0],2),s=a[0],u=a[1];t.x=s,t.y=u})),t},enumerable:!1,configurable:!0}),e.prototype.getAnchorInfo=function(t){if(!Eh(t))for(var e=0;e<this.anchors.length;e++){var n=this.anchors[e];if(n.id===t)return n}},e.prototype.addNodeMoveRules=function(t){this.moveRules.includes(t)||this.moveRules.push(t)},e.prototype.isAllowMoveByXORY=function(t,e,n){var r,o;if(n)r=!0,o=!0;else{var i=this.isAllowMoveNode(t,e);"boolean"==typeof i?(r=i,o=i):(r=i.x,o=i.y)}return{isAllowMoveX:r,isAllowMoveY:o}},e.prototype.move=function(t,e,n){void 0===n&&(n=!1);var r=this.isAllowMoveByXORY(t,e,n),o=r.isAllowMoveX,i=r.isAllowMoveY;return o&&(this.x=this.x+t,this.text&&this.moveText(t,0)),i&&(this.y=this.y+e,this.text&&this.moveText(0,e)),o||i},e.prototype.getMoveDistance=function(t,e,n){void 0===n&&(n=!1);var r=this.isAllowMoveByXORY(t,e,n),o=r.isAllowMoveX,i=r.isAllowMoveY,a=0,s=0;return o&&t&&(this.x=this.x+t,this.text&&this.moveText(t,0),a=t),i&&e&&(this.y=this.y+e,this.text&&this.moveText(0,e),s=e),[a,s]},e.prototype.moveTo=function(t,e,n){void 0===n&&(n=!1);var r=t-this.x,o=e-this.y;return!(!n&&!this.isAllowMoveNode(r,o))&&(this.text&&this.text&&this.moveText(r,o),this.x=t,this.y=e,!0)},e.prototype.moveText=function(t,e){var n=this.text,r=n.x,o=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,editable:s,draggable:a,x:r+t,y:o+e}},e.prototype.updateText=function(t){this.text=no(no({},je(this.text)),{value:t})},e.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},e.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t,this.setIsShowAnchor(t)},e.prototype.setIsShowAnchor=function(t){void 0===t&&(t=!0),this.isShowAnchor=t},e.prototype.setEnableRotate=function(t){void 0===t&&(t=!0),this.enableRotate=t},e.prototype.setEnableResize=function(t){void 0===t&&(t=!0),this.enableResize=t},e.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},e.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},e.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},e.prototype.setProperty=function(e,n){var r,o=je(this.properties),i=no(no({},o),((r={})[e]=i_(n),r));this.properties=i,this.setAttributes(),this.graphModel.eventCenter.emit(t.EventType.NODE_PROPERTIES_CHANGE,{id:this.id,keys:[e],preProperties:o,properties:i})},e.prototype.setProperties=function(e){var n=je(this.properties),r=no(no({},n),i_(e));this.properties=r,this.setAttributes();var o=[];Rh(e,(function(t,e){(Lf(n,e)&&n[e]!==t||!Lf(n,e))&&o.push(e)})),this.graphModel.eventCenter.emit(t.EventType.NODE_PROPERTIES_CHANGE,{id:this.id,keys:o,preProperties:n,properties:r})},e.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},e.prototype.setStyle=function(t,e){var n;this.style=no(no({},this.style),((n={})[t]=i_(e),n))},e.prototype.setStyles=function(t){this.style=no(no({},this.style),i_(t))},e.prototype.updateStyles=function(t){this.style=no({},i_(t))},e.prototype.setZIndex=function(t){void 0===t&&(t=1),this.zIndex=t},e.prototype.updateAttributes=function(t){js(this,t)},e.BaseType=t.ElementType.NODE,oo([$],e.prototype,"type",void 0),oo([$],e.prototype,"x",void 0),oo([$],e.prototype,"y",void 0),oo([$],e.prototype,"text",void 0),oo([$],e.prototype,"properties",void 0),oo([$],e.prototype,"_width",void 0),oo([$],e.prototype,"_height",void 0),oo([$],e.prototype,"anchorsOffset",void 0),oo([$],e.prototype,"isSelected",void 0),oo([$],e.prototype,"isHovered",void 0),oo([$],e.prototype,"isShowAnchor",void 0),oo([$],e.prototype,"isDragging",void 0),oo([$],e.prototype,"isHitable",void 0),oo([$],e.prototype,"isHittable",void 0),oo([$],e.prototype,"draggable",void 0),oo([$],e.prototype,"visible",void 0),oo([$],e.prototype,"enableRotate",void 0),oo([$],e.prototype,"enableResize",void 0),oo([$],e.prototype,"zIndex",void 0),oo([$],e.prototype,"state",void 0),oo([$],e.prototype,"autoToFront",void 0),oo([$],e.prototype,"style",void 0),oo([$],e.prototype,"transform",void 0),oo([$],e.prototype,"_rotate",void 0),oo([rt],e.prototype,"incoming",null),oo([rt],e.prototype,"outgoing",null),oo([te],e.prototype,"addNodeMoveRules",null),oo([te],e.prototype,"move",null),oo([te],e.prototype,"getMoveDistance",null),oo([te],e.prototype,"moveTo",null),oo([te],e.prototype,"moveText",null),oo([te],e.prototype,"updateText",null),oo([te],e.prototype,"setSelected",null),oo([te],e.prototype,"setHovered",null),oo([te],e.prototype,"setIsShowAnchor",null),oo([te],e.prototype,"setEnableRotate",null),oo([te],e.prototype,"setEnableResize",null),oo([te],e.prototype,"setHitable",null),oo([te],e.prototype,"setHittable",null),oo([te],e.prototype,"setElementState",null),oo([te],e.prototype,"setProperty",null),oo([te],e.prototype,"setProperties",null),oo([te],e.prototype,"deleteProperty",null),oo([te],e.prototype,"setStyle",null),oo([te],e.prototype,"setStyles",null),oo([te],e.prototype,"updateStyles",null),oo([te],e.prototype,"setZIndex",null),oo([te],e.prototype,"updateAttributes",null),e}(),Mb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.CIRCLE_NODE,o.properties={},o.r=50,o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),Object.defineProperty(n.prototype,"width",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties.r;t&&(this.r=t)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.circle,r=this.properties.style,o=void 0===r?{}:r;return no(no(no({},t),up(n)),up(o))},n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.r;return[{x:e,y:n-r,id:"".concat(this.id,"_0")},{x:e+r,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+r,id:"".concat(this.id,"_2")},{x:e-r,y:n,id:"".concat(this.id,"_3")}]},n.prototype.resize=function(t){var e=t.width,n=t.deltaX,r=t.deltaY;return this.move(n/2,r/2),this.r=e,this.setProperties({r:e}),this.getData()},oo([$],n.prototype,"properties",void 0),oo([$],n.prototype,"r",void 0),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(Sb),Ab=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.DIAMOND_NODE,o.rx=30,o.ry=50,o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.rx,r=t.ry;n&&(this.rx=n),r&&(this.ry=r)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.diamond,r=this.properties.style,o=void 0===r?{}:r;return no(no(no({},t),up(n)),up(o))},Object.defineProperty(n.prototype,"points",{get:function(){var t=this,e=t.x,n=t.y,r=t.rx,o=t.ry;return[[e,n-o],[e+r,n],[e,n+o],[e-r,n]]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pointsPosition",{get:function(){return wf(this.points,(function(t){var e=io(t,2);return{x:e[0],y:e[1]}}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return Yd(this.points,(function(n){var r=io(n,1)[0];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return Yd(this.points,(function(n){var r=io(n,2)[1];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),n.prototype.getDefaultAnchor=function(){var t=this;return wf(this.points,(function(e,n){var r=io(e,2);return{x:r[0],y:r[1],id:"".concat(t.id,"_").concat(n)}}))},n.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},oo([$],n.prototype,"rx",void 0),oo([$],n.prototype,"ry",void 0),oo([$],n.prototype,"properties",void 0),oo([rt],n.prototype,"points",null),oo([rt],n.prototype,"pointsPosition",null),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(Sb),Tb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.ELLIPSE_NODE,o.rx=30,o.ry=45,o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.rx,r=t.ry;n&&(this.rx=n),r&&(this.ry=r)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.ellipse,r=this.properties.style,o=void 0===r?{}:r;return no(no(no({},t),up(n)),up(o))},Object.defineProperty(n.prototype,"width",{get:function(){return 2*this.rx},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return 2*this.ry},enumerable:!1,configurable:!0}),n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.rx,o=t.ry;return[{x:e,y:n-o,id:"".concat(this.id,"_0")},{x:e+r,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o,id:"".concat(this.id,"_2")},{x:e-r,y:n,id:"".concat(this.id,"_3")}]},n.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},oo([$],n.prototype,"rx",void 0),oo([$],n.prototype,"ry",void 0),oo([$],n.prototype,"properties",void 0),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(Sb),Ob=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.POLYGON_NODE,o.points=[[50,0],[100,50],[50,100],[0,50]],o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.points,r=t.width,o=t.height,i=n||this.points;this.points=sm(i,r,o)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.polygon,r=this.properties.style,o=void 0===r?{}:r;return no(no(no({},t),up(n)),up(o))},Object.defineProperty(n.prototype,"pointsPosition",{get:function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return this.points.map((function(t){return{x:t[0]+e-r/2,y:t[1]+n-o/2}}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var r=io(n,1)[0];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var r=io(n,2)[1];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),n.prototype.getDefaultAnchor=function(){var t=this,e=this,n=e.x,r=e.y,o=e.width,i=e.height;return e.points.map((function(e,a){var s=io(e,2),u=s[0],l=s[1];return{x:n+u-o/2,y:r+l-i/2,id:"".concat(t.id,"_").concat(a)}}))},n.prototype.resize=function(t){var e=this,n=t.width,r=t.height,o=t.deltaX,i=t.deltaY;this.move(o/2,i/2);var a=wf(this.points,(function(t){var o=io(t,2),i=o[0],a=o[1];return[i*n/e.width,a*r/e.height]}));return this.points=a,this.properties.points=a,this.getData()},oo([$],n.prototype,"points",void 0),oo([$],n.prototype,"properties",void 0),oo([rt],n.prototype,"pointsPosition",null),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(Sb),Nb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.RECT_NODE,o.radius=0,o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.width,r=t.height,o=t.radius;n&&(this.width=n),r&&(this.height=r),o&&(this.radius=o)},n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return[{x:e,y:n-o/2,id:"".concat(this.id,"_0")},{x:e+r/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o/2,id:"".concat(this.id,"_2")},{x:e-r/2,y:n,id:"".concat(this.id,"_3")}]},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.rect,r=this.properties.style,o=void 0===r?{}:r;return no(no(no({},t),up(n)),up(o))},oo([$],n.prototype,"radius",void 0),oo([$],n.prototype,"properties",void 0),n}(Sb),Db=function(e){function n(){var n=e.apply(this,ao([],io(arguments),!1))||this;return n.modelType=t.ModelType.TEXT_NODE,n}return eo(n,e),n.prototype.getTextStyle=function(){var t=e.prototype.getTextStyle.call(this),n=this.graphModel.theme.text;return no(no({},t),up(n))},Object.defineProperty(n.prototype,"width",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return km({rows:t,fontSize:e,rowsLength:t.length}).width},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return km({rows:t,fontSize:e,rowsLength:t.length}).height},enumerable:!1,configurable:!0}),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(Sb),Pb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.HTML_NODE,o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.width,r=t.height;n&&(this.width=n),r&&(this.height=r)},n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return[{x:e,y:n-o/2,id:"".concat(this.id,"_0")},{x:e+r/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o/2,id:"".concat(this.id,"_2")},{x:e-r/2,y:n,id:"".concat(this.id,"_3")}]},oo([$],n.prototype,"properties",void 0),n}(Sb),Cb={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,nodeTextEdit:!1,edgeTextEdit:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},Ib=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","nodeTextEdit","edgeTextEdit","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","autoExpand"],jb=function(){function t(t){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopScrollGraph=!1,this.stopMoveGraph=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustNodePosition=!0,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.edgeSelectedOutline=!0,this.nodeTextEdit=!0,this.edgeTextEdit=!0,this.nodeTextDraggable=!1,this.edgeTextDraggable=!1,this.autoExpand=!1,this.multipleSelectKey="",this.defaultConfig={},js(this,this.getConfigDetail(t))}return t.prototype.updateEditConfig=function(t){var e=this.getConfigDetail(t);js(this,e)},t.prototype.getConfigDetail=function(t){var e=t.isSilentMode,n=t.textEdit,r={};if(!1===e&&js(r,this.defaultConfig),!0===e&&e!==this.isSilentMode){var o=Hy(Cb,Ib);this.defaultConfig={stopZoomGraph:this.stopZoomGraph,stopScrollGraph:this.stopScrollGraph,stopMoveGraph:this.stopMoveGraph,adjustEdge:this.adjustEdge,adjustEdgeMiddle:this.adjustEdgeMiddle,adjustEdgeStartAndEnd:this.adjustEdgeStartAndEnd,adjustNodePosition:this.adjustNodePosition,hideAnchors:this.hideAnchors,allowRotate:this.allowRotate,allowResize:this.allowResize,hoverOutline:this.hoverOutline,nodeSelectedOutline:this.nodeSelectedOutline,edgeSelectedOutline:this.edgeSelectedOutline,nodeTextEdit:this.nodeTextEdit,edgeTextEdit:this.edgeTextEdit,nodeTextDraggable:this.nodeTextDraggable,edgeTextDraggable:this.edgeTextDraggable,autoExpand:this.autoExpand},js(r,o)}!1===n&&js(r,{nodeTextEdit:!1,edgeTextEdit:!1});var i=Hy(t,Ib);return js(r,i)},t.prototype.getConfig=function(){return Hy(this,Ib)},oo([$],t.prototype,"isSilentMode",void 0),oo([$],t.prototype,"stopZoomGraph",void 0),oo([$],t.prototype,"stopScrollGraph",void 0),oo([$],t.prototype,"stopMoveGraph",void 0),oo([$],t.prototype,"adjustEdge",void 0),oo([$],t.prototype,"adjustEdgeMiddle",void 0),oo([$],t.prototype,"adjustEdgeStartAndEnd",void 0),oo([$],t.prototype,"adjustNodePosition",void 0),oo([$],t.prototype,"hideAnchors",void 0),oo([$],t.prototype,"allowRotate",void 0),oo([$],t.prototype,"allowResize",void 0),oo([$],t.prototype,"hoverOutline",void 0),oo([$],t.prototype,"nodeSelectedOutline",void 0),oo([$],t.prototype,"edgeSelectedOutline",void 0),oo([$],t.prototype,"nodeTextEdit",void 0),oo([$],t.prototype,"edgeTextEdit",void 0),oo([$],t.prototype,"nodeTextDraggable",void 0),oo([$],t.prototype,"edgeTextDraggable",void 0),oo([$],t.prototype,"autoExpand",void 0),oo([te],t.prototype,"updateEditConfig",null),t}(),kb=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){var r=this;null==t||t.split(",").forEach((function(t){t=t.trim(),r._events[t]||(r._events[t]=[]),r._events[t].push({callback:e,once:!!n})}))},t.prototype.once=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){t=t.trim(),n.on(t,e,!0)}))},t.prototype.emit=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){var r=n._events[t]||[],o=n._events["*"]||[],i=function(r){for(var o=r.length,i=0;i<o;i++)if(r[i]){var a=r[i],s=a.callback;a.once&&(r.splice(i,1),0===r.length&&delete n._events[t],o--,i--),s.apply(n,[e])}};i(r),i(o)}))},t.prototype.off=function(t,e){var n=this;t||(this._events={}),t.split(",").forEach((function(t){if(e){for(var r=n._events[t]||[],o=r.length,i=0;i<o;i++)r[i].callback===e&&(r.splice(i,1),o--,i--);0===r.length&&delete n._events[t]}else delete n._events[t]}))},t.prototype.getEvents=function(){return this._events},t}(),Rb=function(){function e(t){this.modelMap=new Map,this.nodeMoveRules=[],this.nodes=[],this.edges=[],this.overlapMode=c_.DEFAULT,this.gridSize=1,this.partial=!1;var e=t.container,n=t.partial,r=t.background,o=void 0===r?{}:r,i=t.grid,a=t.idGenerator,s=t.edgeGenerator,u=t.animation,l=t.customTrajectory;this.rootEl=e,this.partial=!!n,this.background=o,"object"==typeof i&&(this.gridSize=i.size||1),this.theme=fb(t.style),this.edgeType=t.edgeType||"polyline",this.animation=n_(u),this.overlapMode=t.overlapMode||c_.DEFAULT,this.width=t.width||this.rootEl.getBoundingClientRect().width,this.height=t.height||this.rootEl.getBoundingClientRect().height,this.eventCenter=new kb,this.editConfigModel=new jb(t),this.transformModel=new zb(this.eventCenter,t),this.flowId=nb(),this.idGenerator=a,this.edgeGenerator=om(this,s),this.customTrajectory=l}return Object.defineProperty(e.prototype,"nodesMap",{get:function(){return this.nodes.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"edgesMap",{get:function(){return this.edges.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"modelsMap",{get:function(){return ao(ao([],io(this.nodes),!1),io(this.edges),!1).reduce((function(t,e){return t[e.id]=e,t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sortElements",{get:function(){for(var t=ao(ao([],io(this.nodes),!1),io(this.edges),!1).sort((function(t,e){return t.zIndex-e.zIndex})),e=[],n=[-200,-200],r=[this.width+d_,this.height+d_],o=0;o<t.length;o++){var i=t[o];i.visible&&(!this.partial||i.isSelected||this.isElementInArea(i,n,r,!1,!1))&&e.push(i)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textEditElement",{get:function(){var e=this.nodes.find((function(e){return e.state===t.ElementState.TEXT_EDIT})),n=this.edges.find((function(e){return e.state===t.ElementState.TEXT_EDIT}));return e||n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectElements",{get:function(){var t=new Map;return this.nodes.forEach((function(e){e.isSelected&&t.set(e.id,e)})),this.edges.forEach((function(e){e.isSelected&&t.set(e.id,e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectNodes",{get:function(){var t=[];return this.nodes.forEach((function(e){e.isSelected&&t.push(e)})),t},enumerable:!1,configurable:!0}),e.prototype.getAreaElement=function(t,e,n,r,o){var i=this;void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[];return Yd(ao(ao([],io(this.nodes),!1),io(this.edges),!1),(function(s){var u=i.isElementInArea(s,t,e,n,r);o&&!s.visible||!u||a.push(s)})),a},e.prototype.getModel=function(t){return this.modelMap.get(t)},e.prototype.getNodeModelById=function(t){var e;return this.fakeNode&&t===this.fakeNode.id?this.fakeNode:null===(e=this.nodesMap[t])||void 0===e?void 0:e.model},e.prototype.getPointByClient=function(t){var e=t.x,n=t.y,r=this.rootEl.getBoundingClientRect(),o={x:e-r.left,y:n-r.top},i=io(this.transformModel.HtmlPointToCanvasPoint([o.x,o.y]),2);return{domOverlayPosition:o,canvasOverlayPosition:{x:i[0],y:i[1]}}},e.prototype.isElementInArea=function(e,n,r,o,i){var a;if(void 0===o&&(o=!0),void 0===i&&(i=!0),e.BaseType===t.ElementType.NODE){for(var s=Mm(e),u=s.minX,l=s.minY,c=s.maxX,p=s.maxY,d=[{x:u,y:l},{x:c,y:l},{x:c,y:p},{x:u,y:p}],f=i,h=0;h<d.length;h++){var y=d[h],v=y.x,g=y.y;if(v=(a=io(this.transformModel.CanvasPointToHtmlPoint([v,g]),2))[0],g=a[1],um([v,g],n,r)!==i){f=!i;break}}return f}if(e.BaseType===t.ElementType.EDGE){var _=e.startPoint,m=e.endPoint,b=this.transformModel.CanvasPointToHtmlPoint([_.x,_.y]),E=this.transformModel.CanvasPointToHtmlPoint([m.x,m.y]),x=um(b,n,r),w=um(E,n,r);return o?x&&w:x||w}return!1},e.prototype.graphDataToModel=function(t){var e=this;if(this.width&&this.height||this.resize(),!t)return this.nodes=[],void(this.edges=[]);if(t.nodes?this.nodes=wf(t.nodes,(function(t){return e.getModelAfterSnapToGrid(t)})):this.nodes=[],t.edges){var n=this.edgeType;this.edges=wf(t.edges,(function(t){var r,o=e.getModel(null!==(r=t.type)&&void 0!==r?r:n);if(!o)throw new Error("找不到".concat(t.type,"对应的边。"));return new o(t,e)}))}else this.edges=[]},e.prototype.modelToGraphData=function(){var t=[];this.edges.forEach((function(e){var n=e.getData();n&&!e.virtual&&t.push(n)}));var e=[];return this.nodes.forEach((function(t){var n=t.getData();n&&!t.virtual&&e.push(n)})),{nodes:e,edges:t}},e.prototype.modelToHistoryData=function(){for(var t=!1,e=[],n=0;n<this.nodes.length;n++){var r=this.nodes[n];if(r.isDragging){t=!0;break}e.push(r.getHistoryData())}if(t)return!1;for(var o=!1,i=[],a=0;a<this.edges.length;a++){var s=this.edges[a];if(s.isDragging){o=!0;break}i.push(s.getHistoryData())}return!o&&{nodes:e,edges:i}},e.prototype.getEdgeModelById=function(t){var e;return null===(e=this.edgesMap[t])||void 0===e?void 0:e.model},e.prototype.getElement=function(t){return this.modelsMap[t]},e.prototype.getNodeEdges=function(t){for(var e=[],n=0;n<this.edges.length;n++){var r=this.edges[n],o=r.sourceNodeId===t,i=r.targetNodeId===t;(o||i)&&e.push(r)}return e},e.prototype.getSelectElements=function(e){void 0===e&&(e=!0);var n=this.selectElements,r={nodes:[],edges:[]};return n.forEach((function(o){if(o.BaseType===t.ElementType.NODE&&r.nodes.push(o.getData()),o.BaseType===t.ElementType.EDGE){var i=o.getData(),a=n.get(i.sourceNodeId)&&n.get(i.targetNodeId);(e||a)&&r.edges.push(i)}})),r},e.prototype.updateAttributes=function(t,e){var n=this.getElement(t);null==n||n.updateAttributes(e)},e.prototype.changeNodeId=function(t,e){return e||(e=nb()),this.nodesMap[e]?(console.warn("当前流程图已存在节点".concat(e,", 修改失败")),""):this.nodesMap[t]?(this.edges.forEach((function(n){n.sourceNodeId===t&&(n.sourceNodeId=e),n.targetNodeId===t&&(n.targetNodeId=e)})),this.nodesMap[t].model.id=e,this.nodesMap[e]=this.nodesMap[t],e):(console.warn("当前流程图找不到节点".concat(t,", 修改失败")),"")},e.prototype.changeEdgeId=function(t,e){return e||(e=nb()),this.edgesMap[e]?(console.warn("当前流程图已存在边: ".concat(e,", 修改失败")),""):this.edgesMap[t]?(this.edges.forEach((function(n){n.id===t&&n.changeEdgeId(e)})),e):(console.warn("当前流程图找不到边: ".concat(e,", 修改失败")),"")},e.prototype.setFakeNode=function(t){this.fakeNode=t},e.prototype.removeFakeNode=function(){this.fakeNode=null},e.prototype.setModel=function(t,e){return this.modelMap.set(t,e)},e.prototype.toFront=function(t){var e,n,r,o=(null===(e=this.nodesMap[t])||void 0===e?void 0:e.model)||(null===(n=this.edgesMap[t])||void 0===n?void 0:n.model);o&&(this.overlapMode===c_.DEFAULT&&(null===(r=this.topElement)||void 0===r||r.setZIndex(),o.setZIndex(9999),this.topElement=o),this.overlapMode===c_.INCREASE&&this.setElementZIndex(t,"top"))},e.prototype.setElementZIndex=function(t,e){var n,r,o=(null===(n=this.nodesMap[t])||void 0===n?void 0:n.model)||(null===(r=this.edgesMap[t])||void 0===r?void 0:r.model);if(o){var i=void 0;"number"==typeof e?i=e:("top"===e&&(i=gb()),"bottom"===e&&(i=_b())),o.setZIndex(i)}},e.prototype.deleteNode=function(e){var n=this.nodesMap[e].model.getData();this.deleteEdgeBySource(e),this.deleteEdgeByTarget(e),this.nodes.splice(this.nodesMap[e].index,1),this.eventCenter.emit(t.EventType.NODE_DELETE,{data:n})},e.prototype.addNode=function(e,n,r){void 0===n&&(n=t.EventType.NODE_ADD);var o=i_(e),i=o.id;i&&this.nodesMap[i]&&delete o.id;var a=this.getModelAfterSnapToGrid(o);this.nodes.push(a);var s={data:a.getData()};return r&&(s.e=r),this.eventCenter.emit(n,s),a},e.prototype.getModelAfterSnapToGrid=function(t){var e=this.getModel(t.type);if(!e)throw new Error("找不到".concat(t.type,"对应的节点,请确认是否已注册此类型节点。"));var n=t.x,r=t.y;return n&&r&&(t.x=am(n,this.gridSize),t.y=am(r,this.gridSize),"object"==typeof t.text&&(t.text.x+=t.x-n,t.text.y+=t.y-r)),new e(t,this)},e.prototype.cloneNode=function(t){var e=this.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){n.x+=30,n.y+=30,n.id="",n.text&&(n.text.x+=30,n.text.y+=30);var r=this.addNode(n);return r.setSelected(!0),null==e||e.setSelected(!1),r.getData()}},e.prototype.moveNode=function(t,e,n,r){var o;void 0===r&&(r=!1);var i=this.nodesMap[t];i?(e=(o=io(i.model.getMoveDistance(e,n,r),2))[0],n=o[1],this.moveEdge(t,e,n)):console.warn("不存在id为".concat(t,"的节点"))},e.prototype.moveNode2Coordinate=function(t,e,n,r){void 0===r&&(r=!1);var o=this.nodesMap[t];if(o){var i=o.model,a=e-i.x,s=n-i.y;this.moveNode(t,a,s,r)}else console.warn("不存在id为".concat(t,"的节点"))},e.prototype.editText=function(e){this.setElementStateById(e,t.ElementState.TEXT_EDIT)},e.prototype.addEdge=function(e){var n=i_(e),r=n.type;r||(r=this.edgeType),n.id&&this.edgesMap[n.id]&&delete n.id;var o=this.getModel(r);if(!o)throw new Error("找不到".concat(r,"对应的边,请确认是否已注册此类型边。"));var i=new o(no(no({},n),{type:r}),this),a=i.getData();return this.edges.push(i),this.eventCenter.emit(t.EventType.EDGE_ADD,{data:a}),i},e.prototype.moveEdge=function(t,e,n){for(var r=0;r<this.edges.length;r++){var o=this.edges[r],i=o.textPosition,a=i.x,s=i.y,u=this.edges[r].sourceNodeId===t,l=this.edges[r].targetNodeId===t;u&&o.moveStartPoint(e,n),l&&o.moveEndPoint(e,n),(u||l)&&this.handleEdgeTextMove(o,a,s)}},e.prototype.handleEdgeTextMove=function(e,n,r){var o;if(e.customTextPosition)e.resetTextPosition();else if(e.modelType===t.ModelType.POLYLINE_EDGE&&(null===(o=e.text)||void 0===o?void 0:o.value)){var i=e.text,a=em(i,e.points);e.moveText(a.x-i.x,a.y-i.y)}else{var s=e.textPosition,u=s.x,l=s.y;e.moveText(u-n,l-r)}},e.prototype.deleteEdgeBySourceAndTarget=function(e,n){for(var r=0;r<this.edges.length;r++)if(this.edges[r].sourceNodeId===e&&this.edges[r].targetNodeId===n){var o=this.edges[r].getData();this.edges.splice(r,1),r--,this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:o})}},e.prototype.deleteEdgeById=function(e){if(this.edgesMap[e]){var n=this.edgesMap[e].index,r=this.edgesMap[e].model.getData();this.edges.splice(n,1),this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:r})}},e.prototype.deleteEdgeBySource=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:r})}},e.prototype.deleteEdgeByTarget=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].targetNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:r})}},e.prototype.setElementStateById=function(e,n,r){this.nodes.forEach((function(o){o.id===e?o.setElementState(n,r):o.setElementState(t.ElementState.DEFAULT)})),this.edges.forEach((function(o){o.id===e?o.setElementState(n,r):o.setElementState(t.ElementState.DEFAULT)}))},e.prototype.updateText=function(t,e){var n=yf(ao(ao([],io(this.nodes),!1),io(this.edges),!1),(function(e){return e.id===t}));null==n||n.updateText(e)},e.prototype.selectNodeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var r=null===(n=this.nodesMap[t])||void 0===n?void 0:n.model;null==r||r.setSelected(!0)},e.prototype.selectEdgeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var r=null===(n=this.edgesMap[t])||void 0===n?void 0:n.model;null==r||r.setSelected(!0)},e.prototype.selectElementById=function(t,e){void 0===e&&(e=!1),e||this.clearSelectElements();var n=this.getElement(t);null==n||n.setSelected(!0)},e.prototype.clearSelectElements=function(){var t;this.selectElements.forEach((function(t){null==t||t.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===c_.DEFAULT&&(null===(t=this.topElement)||void 0===t||t.setZIndex())},e.prototype.moveNodes=function(e,n,r,o){var i,a,s,u=this;void 0===o&&(o=!1);for(var l=e.reduce((function(t,e){var i=u.nodesMap[e].model;return t[e]=i.getMoveDistance(n,r,o),t}),{}),c=0;c<this.edges.length;c++){var p=this.edges[c],d=p.textPosition,f=d.x,h=d.y,y=l[p.sourceNodeId],v=l[p.targetNodeId],g=void 0,_=void 0;y&&v&&p.modelType===t.ModelType.POLYLINE_EDGE?(g=(i=io(y,2))[0],_=i[1],p.updatePointsList(g,_)):(y&&(g=(a=io(y,2))[0],_=a[1],p.moveStartPoint(g,_)),v&&(g=(s=io(v,2))[0],_=s[1],p.moveEndPoint(g,_))),(y||v)&&this.handleEdgeTextMove(p,f,h)}},e.prototype.addNodeMoveRules=function(t){this.nodeMoveRules.includes(t)||this.nodeMoveRules.push(t)},e.prototype.setDefaultEdgeType=function(t){this.edgeType=t},e.prototype.changeNodeType=function(t,e){var n=this.getNodeModelById(t);if(n){var r=n.getData();r.type=e;var o=this.getModel(e);if(!o)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));var i=new o(r,this);this.nodes.splice(this.nodesMap[t].index,1,i),this.getNodeEdges(t).forEach((function(e){if(e.sourceNodeId===t){var n=Im(i,e.startPoint,i.width,i.height);e.updateStartPoint(n)}if(e.targetNodeId===t){n=Im(i,e.endPoint,i.width,i.height);e.updateEndPoint(n)}}))}else console.warn("找不到id为".concat(t,"的节点"))},e.prototype.changeEdgeType=function(t,e){var n=this.getEdgeModelById(t);if(n){if(n.type!==e){var r=n.getData();r.type=e;var o=this.getModel(e);if(!o)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));delete r.pointsList;var i=new o(r,this);this.edges.splice(this.edgesMap[t].index,1,i)}}else console.warn("找不到id为".concat(t,"的边"))},e.prototype.getNodeIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetNodeId===t&&e.push(n)})),e},e.prototype.getNodeOutgoingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceNodeId===t&&e.push(n)})),e},e.prototype.getAnchorIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetAnchorId===t&&e.push(n)})),e},e.prototype.getAnchorOutcomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceAnchorId===t&&e.push(n)})),e},e.prototype.getNodeIncomingNode=function(t){var e=this,n=[];return this.edges.forEach((function(r){var o;r.targetNodeId===t&&n.push(null===(o=e.nodesMap[r.sourceNodeId])||void 0===o?void 0:o.model)})),n},e.prototype.getNodeOutgoingNode=function(t){var e=this,n=[];return this.edges.forEach((function(r){r.sourceNodeId===t&&n.push(e.nodesMap[r.targetNodeId].model)})),n},e.prototype.setTheme=function(t){this.theme=hb(no(no({},this.theme),t))},e.prototype.resize=function(t,e){this.width=t||this.rootEl.getBoundingClientRect().width,this.height=e||this.rootEl.getBoundingClientRect().height,this.width&&this.height||console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")},e.prototype.clearData=function(){this.nodes=[],this.edges=[]},e.prototype.getVirtualRectSize=function(){var t=this.nodes,e=[],n=[];t.forEach((function(t){var r=t.x,o=t.y,i=t.width,a=t.height,s=t.getNodeStyle().strokeWidth,u=void 0===s?0:s,l=r+i/2+u,c=r-i/2-u,p=o+a/2+u,d=o-a/2-u;e=e.concat([l,c].filter((function(t){return!Number.isNaN(t)}))),n=n.concat([p,d].filter((function(t){return!Number.isNaN(t)})))}));var r=Math.min.apply(Math,ao([],io(e),!1)),o=Math.max.apply(Math,ao([],io(e),!1)),i=Math.min.apply(Math,ao([],io(n),!1)),a=o-r||0,s=Math.max.apply(Math,ao([],io(n),!1))-i||0;return{width:a,height:s,x:r+a/2,y:i+s/2}},e.prototype.translateCenter=function(){var t=this,e=t.nodes,n=t.width,r=t.height,o=t.rootEl,i=t.transformModel;if(e.length){var a=n||o.clientWidth,s=r||o.clientHeight,u=this.getVirtualRectSize(),l=u.x,c=u.y;i.focusOn(l,c,a,s)}},e.prototype.fitView=function(t,e){void 0===t&&(t=20),void 0===e&&(e=20);var n=this,r=n.nodes,o=n.width,i=n.height,a=n.rootEl,s=n.transformModel;if(r.length){var u=o||a.clientWidth,l=i||a.clientHeight,c=this.getVirtualRectSize(),p=c.width,d=c.height,f=c.x,h=c.y,y=(p+e)/u,v=(d+t)/l,g=1/Math.max(y,v),_=[u/2,l/2];s.zoom(g,_),s.focusOn(f,h,u,l)}},e.prototype.openEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.openEdgeAnimation()},e.prototype.closeEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.closeEdgeAnimation()},e.prototype.getPartial=function(){return this.partial},e.prototype.setPartial=function(t){this.partial=t},oo([$],e.prototype,"width",void 0),oo([$],e.prototype,"height",void 0),oo([$],e.prototype,"edgeType",void 0),oo([$],e.prototype,"nodes",void 0),oo([$],e.prototype,"edges",void 0),oo([$],e.prototype,"fakeNode",void 0),oo([$],e.prototype,"overlapMode",void 0),oo([$],e.prototype,"background",void 0),oo([$],e.prototype,"gridSize",void 0),oo([$],e.prototype,"transformModel",void 0),oo([$],e.prototype,"editConfigModel",void 0),oo([$],e.prototype,"partial",void 0),oo([rt],e.prototype,"nodesMap",null),oo([rt],e.prototype,"edgesMap",null),oo([rt],e.prototype,"modelsMap",null),oo([rt],e.prototype,"sortElements",null),oo([rt],e.prototype,"textEditElement",null),oo([rt],e.prototype,"selectElements",null),oo([rt],e.prototype,"selectNodes",null),oo([te],e.prototype,"setFakeNode",null),oo([te],e.prototype,"removeFakeNode",null),oo([te],e.prototype,"setModel",null),oo([te],e.prototype,"toFront",null),oo([te],e.prototype,"setElementZIndex",null),oo([te],e.prototype,"deleteNode",null),oo([te],e.prototype,"addNode",null),oo([te],e.prototype,"cloneNode",null),oo([te],e.prototype,"moveNode",null),oo([te],e.prototype,"moveNode2Coordinate",null),oo([te],e.prototype,"editText",null),oo([te],e.prototype,"addEdge",null),oo([te],e.prototype,"moveEdge",null),oo([te],e.prototype,"deleteEdgeBySourceAndTarget",null),oo([te],e.prototype,"deleteEdgeById",null),oo([te],e.prototype,"deleteEdgeBySource",null),oo([te],e.prototype,"deleteEdgeByTarget",null),oo([te],e.prototype,"setElementStateById",null),oo([te],e.prototype,"updateText",null),oo([te],e.prototype,"selectNodeById",null),oo([te],e.prototype,"selectEdgeById",null),oo([te],e.prototype,"selectElementById",null),oo([te],e.prototype,"clearSelectElements",null),oo([te],e.prototype,"moveNodes",null),oo([te],e.prototype,"setDefaultEdgeType",null),oo([te],e.prototype,"changeNodeType",null),oo([te],e.prototype,"changeEdgeType",null),oo([te],e.prototype,"getNodeIncomingEdge",null),oo([te],e.prototype,"getNodeOutgoingEdge",null),oo([te],e.prototype,"getAnchorIncomingEdge",null),oo([te],e.prototype,"getAnchorOutcomingEdge",null),oo([te],e.prototype,"getNodeIncomingNode",null),oo([te],e.prototype,"getNodeOutgoingNode",null),oo([te],e.prototype,"setTheme",null),oo([te],e.prototype,"resize",null),oo([te],e.prototype,"clearData",null),oo([te],e.prototype,"translateCenter",null),oo([te],e.prototype,"fitView",null),oo([te],e.prototype,"openEdgeAnimation",null),oo([te],e.prototype,"closeEdgeAnimation",null),oo([te],e.prototype,"setPartial",null),e}(),Lb=function(){function t(t){this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=t}return t.prototype.getStyle=function(){return no({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(t,e){for(var n=t.x,r=t.y,o=!1,i=!1,a=0;a<e.length;a++){var s=e[a];if(s.id!==t.id&&(n===s.x&&(o=!0),r===s.y&&(i=!0),o&&i))break}return{isShowVertical:o,isShowHorizontal:i,position:{x:n,y:r}}},t.prototype.getHorizontalSnapline=function(t,e){var n,r=!1,o=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=Mm(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=Mm(s))}}for(var u=0;u<e.length;u++){var l=e[u];if(l.id!==t.id){var c=Mm(l);if(c.minY===(null==n?void 0:n.minY)||c.maxY===(null==n?void 0:n.minY)){r=!0,o=n.minY;break}if(c.minY===(null==n?void 0:n.maxY)||c.maxY===(null==n?void 0:n.maxY)){r=!0,o=n.maxY;break}}}return{isShowHorizontal:r,isShowVertical:this.isShowVertical,position:no(no({},this.position),{y:o})}},t.prototype.getVerticalSnapline=function(t,e){var n,r=!1,o=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=Mm(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=Mm(s))}}for(var u=0;u<e.length;u++){var l=e[u];if(l.id!==t.id){var c=Mm(l);if(c.minX===(null==n?void 0:n.minX)||c.maxX===(null==n?void 0:n.minX)){r=!0,o=n.minX;break}if(c.minX===(null==n?void 0:n.maxX)||c.maxX===(null==n?void 0:n.maxX)){r=!0,o=n.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:r,position:no(no({},this.position),{x:o})}},t.prototype.getSnapLinePosition=function(t,e){var n=this.getCenterSnapLine(t,e),r=n.isShowHorizontal,o=n.isShowVertical;if(!r){var i=this.getHorizontalSnapline(t,e);i.isShowHorizontal&&(n.isShowHorizontal=i.isShowHorizontal,n.position.y=i.position.y)}if(!o){var a=this.getVerticalSnapline(t,e);a.isShowVertical&&(n.isShowVertical=a.isShowVertical,n.position.x=a.position.x)}return n},t.prototype.setSnaplineInfo=function(t){var e=t.isShowHorizontal,n=t.isShowVertical,r=t.position;this.position=r,this.isShowHorizontal=e,this.isShowVertical=n},t.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},t.prototype.setNodeSnapLine=function(t){var e=this.graphModel.nodes,n=this.getSnapLinePosition(t,e);this.setSnaplineInfo(n)},oo([$],t.prototype,"isShowHorizontal",void 0),oo([$],t.prototype,"isShowVertical",void 0),oo([$],t.prototype,"position",void 0),oo([te],t.prototype,"clearSnapline",null),oo([te],t.prototype,"setNodeSnapLine",null),t}(),Bb={false:[-1/0,-1/0,1/0,1/0],true:[0,0,0,0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},zb=function(){function e(t,e){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=t;var n=e.stopMoveGraph,r=void 0!==n&&n;this.updateTranslateLimits(r)}return e.prototype.setZoomMiniSize=function(t){this.MINI_SCALE_SIZE=t},e.prototype.setZoomMaxSize=function(t){this.MAX_SCALE_SIZE=t},e.prototype.HtmlPointToCanvasPoint=function(t){var e=io(t,2),n=e[0],r=e[1];return[(n-this.TRANSLATE_X)/this.SCALE_X,(r-this.TRANSLATE_Y)/this.SCALE_Y]},e.prototype.CanvasPointToHtmlPoint=function(t){var e=io(t,2),n=e[0],r=e[1];return[n*this.SCALE_X+this.TRANSLATE_X,r*this.SCALE_Y+this.TRANSLATE_Y]},e.prototype.moveCanvasPointByHtml=function(t,e,n){var r=io(t,2),o=r[0],i=r[1];return[o+e/this.SCALE_X,i+n/this.SCALE_Y]},e.prototype.fixDeltaXY=function(t,e){return[t/this.SCALE_X,e/this.SCALE_Y]},e.prototype.getTransformStyle=function(){var t=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(t,")")}},e.prototype.zoom=function(t,e){void 0===t&&(t=!1);var n=this.SCALE_X,r=this.SCALE_Y;return"number"==typeof t?(n=t,r=t):t?(n+=this.ZOOM_SIZE,r+=this.ZOOM_SIZE):(n-=this.ZOOM_SIZE,r-=this.ZOOM_SIZE),n<this.MINI_SCALE_SIZE||n>this.MAX_SCALE_SIZE||(e&&(this.TRANSLATE_X-=(n-this.SCALE_X)*e[0],this.TRANSLATE_Y-=(r-this.SCALE_Y)*e[1]),this.SCALE_X=n,this.SCALE_Y=r,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")},e.prototype.emitGraphTransform=function(e){this.eventCenter.emit(t.EventType.GRAPH_TRANSFORM,{type:e,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},e.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},e.prototype.translate=function(t,e){this.TRANSLATE_X+t<=this.translateLimitMaxX&&this.TRANSLATE_X+t>=this.translateLimitMinX&&(this.TRANSLATE_X+=t),this.TRANSLATE_Y+e<=this.translateLimitMaxY&&this.TRANSLATE_Y+e>=this.translateLimitMinY&&(this.TRANSLATE_Y+=e),this.emitGraphTransform("translate")},e.prototype.focusOn=function(t,e,n,r){var o=io(this.CanvasPointToHtmlPoint([t,e]),2),i=io([n/2-o[0],r/2-o[1]],2),a=i[0],s=i[1];this.TRANSLATE_X+=a,this.TRANSLATE_Y+=s,this.emitGraphTransform("focusOn")},e.prototype.updateTranslateLimits=function(t){var e;e=io(Array.isArray(t)&&4===t.length?t:Bb[t.toString()],4),this.translateLimitMinX=e[0],this.translateLimitMinY=e[1],this.translateLimitMaxX=e[2],this.translateLimitMaxY=e[3]},oo([$],e.prototype,"SCALE_X",void 0),oo([$],e.prototype,"SKEW_Y",void 0),oo([$],e.prototype,"SKEW_X",void 0),oo([$],e.prototype,"SCALE_Y",void 0),oo([$],e.prototype,"TRANSLATE_X",void 0),oo([$],e.prototype,"TRANSLATE_Y",void 0),oo([$],e.prototype,"ZOOM_SIZE",void 0),oo([te],e.prototype,"zoom",null),oo([te],e.prototype,"resetZoom",null),oo([te],e.prototype,"translate",null),oo([te],e.prototype,"focusOn",null),e}(),Hb=function(e){function n(n){var r=e.call(this)||this;r.stepScrollX=0,r.stepScrollY=0,r.onDragging=function(t){var e=t.deltaX,n=t.deltaY;r.setState({isDragging:!0});var o=r.props.graphModel,i=o.transformModel;!0!==o.editConfigModel.stopMoveGraph&&i.translate(e,n)},r.onDragEnd=function(){r.setState({isDragging:!1})},r.zoomHandler=function(t){var e=r.props,n=e.graphModel,o=n.editConfigModel,i=n.transformModel,a=n.gridSize,s=e.graphModel,u=t.deltaX,l=t.deltaY;if(o.stopScrollGraph||!0===t.ctrlKey){if(!o.stopZoomGraph){t.preventDefault();var c=s.getPointByClient({x:t.clientX,y:t.clientY}).canvasOverlayPosition,p=c.x,d=c.y;i.zoom(t.deltaY<0,[p,d])}}else{if(t.preventDefault(),r.stepScrollX+=u,r.stepScrollY+=l,Math.abs(r.stepScrollX)>=a){var f=r.stepScrollX%a,h=r.stepScrollX-f;i.translate(-h*i.SCALE_X,0),r.stepScrollX=f}if(Math.abs(r.stepScrollY)>=a){var y=r.stepScrollY%a,v=r.stepScrollY-y;i.translate(0,-v*i.SCALE_Y),r.stepScrollY=y}}},r.clickHandler=function(e){if("canvas-overlay"===e.target.getAttribute("name")){var n=r.props.graphModel;n.selectElements.size>0&&n.clearSelectElements(),n.eventCenter.emit(t.EventType.BLANK_CLICK,{e:e})}},r.handleContextMenu=function(e){if("canvas-overlay"===e.target.getAttribute("name")){e.preventDefault();var n=r.props.graphModel,o=n.getPointByClient({x:e.clientX,y:e.clientY});n.eventCenter.emit(t.EventType.BLANK_CONTEXTMENU,{e:e,position:o})}},r.mouseDownHandler=function(e){var n=r.props.graphModel,o=n.eventCenter,i=n.editConfigModel,a=n.transformModel.SCALE_X,s=n.gridSize,u=e.target,l=!i.adjustEdge&&!i.adjustNodePosition;("canvas-overlay"===u.getAttribute("name")||l)&&(!0!==i.stopMoveGraph?(r.stepDrag.setStep(s*a),r.stepDrag.handleMouseDown(e)):o.emit(t.EventType.BLANK_MOUSEDOWN,{e:e}),r.clickHandler(e))};var o=n.graphModel,i=o.gridSize,a=o.eventCenter;return r.stepDrag=new f_({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:i,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),r.state={isDragging:!1},r}return eo(n,e),n.prototype.render=function(){var t=this.props.graphModel.transformModel.getTransformStyle().transform,e=this.props,n=e.children,r=e.dnd,o=this.state.isDragging;return uo("svg",no({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:o?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},r.eventMap(),{children:uo("g",{transform:t,children:n})}))},n=oo([cx],n)}(Vn);function Ub(e){var n=e.x,r=void 0===n?0:n,o=e.y,i=void 0===o?0:o,a=e.value,s=e.fontSize,u=void 0===s?12:s,l=e.fill,c=void 0===l?"currentColor":l,p=e.overflowMode,d=void 0===p?"default":p,f=e.textWidth,h=void 0===f?void 0:f,y=e.model,v={x:r,y:i,fill:c,fontSize:u,textAnchor:"middle",dominantBaseline:"central"};if(Yd(Jd(e),(function(t){var e=io(t,2),n=e[0],r=e[1];"object"!=typeof r&&(v[n]=r)})),a){var g=String(a).split(/[\r\n]/g),_=g.length;if("default"!==d){var m=y.BaseType,b=y.modelType;if(m===t.ElementType.NODE&&b!==t.ModelType.TEXT_NODE||m===t.ElementType.EDGE&&h)return Xb(e)}if(_>1){var E=g.map((function(t,e){return uo("tspan",{className:"lf-text-tspan",x:r,y:i+(e-(_-1)/2)*(u+2),children:t})}));return uo("text",no({},v,{children:E}))}return uo("text",no({},v,{children:a}))}return null}function Xb(t){var e=t.x,n=t.y,r=t.value,o=t.model,i=t.textWidth,a=t.fontSize,s=void 0===a?12:a,u=t.lineHeight,l=t.fontFamily,c=void 0===l?"":l,p=t.wrapPadding,d=void 0===p?"0, 0":p,f=t.overflowMode,h=o.width,y=o.height,v=o.textHeight,g=i||h,_=String(r).split(/[\r\n]/g),m=_.length,b=jm({rows:_,style:{fontSize:"".concat(s,"px"),width:"".concat(g,"px"),fontFamily:c,lineHeight:u,padding:d},rowsLength:m,className:"lf-get-text-height"}),E=y>b?y:b;v&&(E=v);var x="ellipsis"===f;return x&&(E=s+2),uo("g",{children:uo("foreignObject",{width:g,height:E,x:e-g/2,y:n-E/2,style:{overflow:"visible",textAlign:"left"},children:uo("div",{className:"lf-node-text-auto-wrap",style:{minHeight:E,width:g,padding:d},children:uo("div",{className:x?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:x?_.join(""):"",style:no({},t),children:_.map((function(t){return uo("div",{className:"lf-node-text--auto-wrap-inner",children:t})}))})})})})}function Gb(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return Yd(Jd(t),(function(t){var n=io(t,2),r=n[0],o=n[1];("style"===r||"object"!=typeof o)&&(e[r]=o)})),uo("line",no({},e))}function Wb(t){var e=t.x,n=t.y,r=t.width,o=t.height,i=t.className,a=t.strokeWidth,s=t.radius,u=void 0===s?0:s,l=e-r/2,c=n-o/2,p={};return p["stroke-width"]=a,Yd(Jd(t),(function(t){var e=io(t,2),n=e[0],r=e[1];"object"!=typeof r&&(p[n]=r)})),p.className=i?"lf-basic-shape ".concat(i):"lf-basic-shape",u&&(p.rx=u,p.ry=u),p.x=l,p.y=c,uo("rect",no({},p))}function Yb(t){var e={d:""};return Yd(Jd(t),(function(t){var n=io(t,2),r=n[0],o=n[1];"style"!==r&&"object"==typeof o||(e[r]=o)})),uo("path",no({},e))}function Vb(t){var e=t.x,n=void 0===e?0:e,r=t.y,o=void 0===r?0:r,i=t.r,a=void 0===i?4:i,s=t.className,u={cx:n,cy:o,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return Yd(Jd(t),(function(t){var e=io(t,2),n=e[0],r=e[1];"object"!=typeof r&&(u[n]=r)})),u.className=s?"lf-basic-shape ".concat(s):"lf-basic-shape",uo("circle",no({},u))}function Fb(t){var e=t.x,n=void 0===e?0:e,r=t.y,o=void 0===r?0:r,i=t.rx,a=void 0===i?4:i,s=t.ry,u=void 0===s?4:s,l=t.className,c={cx:n,cy:o,rx:a,ry:u,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return Yd(Jd(t),(function(t){var e=io(t,2),n=e[0],r=e[1];"object"!=typeof r&&(c[n]=r)})),c.className=l?"lf-basic-shape ".concat(l):"lf-basic-shape",uo("ellipse",no({},c))}function Kb(t){var e=t.points,n=void 0===e?[]:e,r=t.className,o={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};return Yd(Jd(t),(function(t){var e=io(t,2),n=e[0],r=e[1];"object"!=typeof r&&(o[n]=r)})),r?o.classNmae="lf-basic-shape ".concat(r):o.className="lf-basic-shape",o.points=n.map((function(t){return t.join(",")})).join(" "),uo("polygon",no({},o))}function qb(t){var e=t.className,n={points:"",fill:"none"};return Yd(Jd(t),(function(t){var e=io(t,2),r=e[0],o=e[1];("style"===r||"object"!=typeof o)&&(n[r]=o)})),e&&(n.className="".concat(e)),uo("polyline",no({},n))}var Zb=function(e){function n(){var n=e.call(this)||this;return n.onDragging=function(e){var r=e.event,o=n.props,i=o.graphModel,a=o.bezierModel,s=o.type,u=i.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,l=u.x,c=u.y;a.updateAdjustAnchor({x:l,y:c},s),i.eventCenter.emit(t.EventType.EDGE_ADJUST,{data:a.getData()})},n.onDragEnd=function(){n.props.bezierModel.isDragging=!1},n.dragHandler=new f_({onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return eo(n,e),n.prototype.render=function(){var t=this,e=this.props.position,n=e.x,r=e.y,o=this.props.bezierModel.getEdgeStyle().adjustAnchor;return uo(Vb,no({className:"lf-bezier-adjust-anchor",x:n,y:r},o,{onMouseDown:function(e){t.dragHandler.handleMouseDown(e)}}))},n}(Vn),$b=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return eo(n,e),n.prototype.getBezierAdjust=function(t,e){var n=t.path,r=t.id,o=io(J_(n),4),i=o[0],a=o[1],s=o[2],u=o[3],l=t.getEdgeStyle().adjustLine,c=[];return c.push(uo(Gb,no({x1:i.x,y1:i.y,x2:a.x,y2:a.y},l))),c.push(uo(Zb,{position:a,bezierModel:t,graphModel:e,type:"sNext"},"".concat(r,"_ePre"))),c.push(uo(Gb,no({x1:u.x,y1:u.y,x2:s.x,y2:s.y},l))),c.push(uo(Zb,{position:s,bezierModel:t,graphModel:e,type:"ePre"},"".concat(r,"_sNext"))),c},n.prototype.selectedBezierEdge=function(){for(var e=this.props.graphModel,n=e.edges,r=[],o=0;o<n.length;o++){var i=n[o];i.isSelected&&i.modelType===t.ModelType.BEZIER_EDGE&&i.draggable&&r.push(this.getBezierAdjust(i,e))}return r},n.prototype.render=function(){return uo("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},n=oo([cx],n)}(Vn),Jb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.render=function(){return uo("div",{className:"lf-background",children:uo("div",{style:this.props.background,className:"lf-background-area"})})},e}(Vn),Qb=function(t){function e(){var e=t.apply(this,ao([],io(arguments),!1))||this;return e.id=nb(),e}return eo(e,t),e.prototype.renderDot=function(){var t=this.props,e=t.config,n=t.size,r=void 0===n?1:n,o=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,u=void 0===s?2:s,l=Math.min(Math.max(2,u),r/4);return uo("g",{fill:a,opacity:o?1:0,children:[uo("circle",{cx:0,cy:0,r:l/2}),uo("circle",{cx:0,cy:r,r:l/2}),uo("circle",{cx:r,cy:0,r:l/2}),uo("circle",{cx:r,cy:r,r:l/2})]})},e.prototype.renderMesh=function(){var t=this.props,e=t.config,n=t.size,r=void 0===n?1:n,o=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,u=void 0===s?1:s,l=Math.min(Math.max(1,u),r/2);return uo("path",{d:"M 0 0 H ".concat(r," V ").concat(r," H 0 Z"),stroke:a,strokeWidth:l,opacity:o?1:0,fill:"transparent"})},e.prototype.render=function(){var t=this.props,e=t.type,n=t.size,r=void 0===n?1:n,o=t.graphModel.transformModel,i=[o.SCALE_X,o.SKEW_Y,o.SKEW_X,o.SCALE_Y,o.TRANSLATE_X,o.TRANSLATE_Y].join(","),a="matrix(".concat(i,")");return uo("div",{className:"lf-grid",children:uo("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[uo("defs",{children:uo("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:a,x:"0",y:"0",width:r,height:r,children:["dot"===e&&this.renderDot(),"mesh"===e&&this.renderMesh()]})}),uo("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=oo([cx],e)}(Vn);!function(t){t.defaultProps={size:10,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}},t.getGridOptions=function(e){var n=up(t.defaultProps);return js(n,"number"==typeof e?{size:e}:"boolean"==typeof e?{visible:e}:e)}}(Qb||(Qb={}));var tE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.render=function(){return uo("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:uo("g",{transform:this.props.graphModel.transformModel.getTransformStyle().transform,children:this.props.children})})},e=oo([cx],e)}(Vn),eE=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return eo(n,e),n.prototype.getNodesOutline=function(){var t=this.props.graphModel,e=t.nodes,n=t.editConfigModel,r=n.hoverOutline,o=n.nodeSelectedOutline,i=[];return e.forEach((function(t){if(t.isHovered||t.isSelected){var e=t.isHovered,n=t.isSelected,a=t.x,s=t.y,u=t.width,l=t.height;if(o&&n||r&&e){var c=t.getOutlineStyle(),p={};if(Object.keys(c).forEach((function(t){"hover"!==t&&(p[t]=c[t])})),e){var d=c.hover;p=no(no({},p),d)}i.push(uo(Wb,no({transform:t.transform,className:"lf-outline-node",x:a,y:s,width:u+10,height:l+10},p)))}}})),i},n.prototype.getEdgeOutline=function(){for(var e=this.props.graphModel,n=e.edges,r=e.editConfigModel,o=r.edgeSelectedOutline,i=r.hoverOutline,a=[],s=0;s<n.length;s++){var u=n[s];(o&&u.isSelected||i&&u.isHovered)&&(u.modelType===t.ModelType.LINE_EDGE?a.push(this.getLineOutline(u)):u.modelType===t.ModelType.POLYLINE_EDGE?a.push(this.getPolylineOutline(u)):u.modelType===t.ModelType.BEZIER_EDGE&&a.push(this.getBezierOutline(u)))}return a},n.prototype.getLineOutline=function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,o=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10,s=t.getOutlineStyle();return uo(Wb,no({className:"lf-outline-edge",x:r,y:o,width:i,height:a},s))},n.prototype.getPolylineOutline=function(t){var e=t.points,n=Y_(e),r=x_(n,8),o=r.x,i=r.y,a=r.width,s=r.height,u=t.getOutlineStyle();return uo(Wb,no({className:"lf-outline",x:o,y:i,width:a,height:s},u))},n.prototype.getBezierOutline=function(t){var e=t.path,n=J_(e),r=x_(n,8),o=r.x,i=r.y,a=r.width,s=r.height,u=t.getOutlineStyle();return uo(Wb,no({className:"lf-outline",x:o,y:i,width:a,height:s},u))},n.prototype.render=function(){return uo("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},n=oo([cx],n)}(Vn),nE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.render=function(){var t=this.props.snaplineModel,e=null!=t?t:{},n=e.position,r=e.isShowHorizontal,o=e.isShowVertical,i=null==t?void 0:t.getStyle(),a=null!=n?n:{},s=a.x,u=void 0===s?0:s,l=a.y,c=void 0===l?0:l,p=no(no({x1:-1e5,y1:c,x2:1e5,y2:c},i),{stroke:r?null==i?void 0:i.stroke:"none"}),d=no(no({x1:u,y1:-1e5,x2:u,y2:1e5},i),{stroke:o?null==i?void 0:i.stroke:"none"});return uo("g",{className:"lf-snapline",children:[uo(Gb,no({},p)),uo(Gb,no({},d))]})},e=oo([cx],e)}(Vn),rE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var t=this.props,e=t.tool,n=t.graphModel,r=n.textEditElement,o=e.getTools().map((function(t){return Xn(t,{textEditElement:r,graphModel:n,logicFlow:e.instance})}));return e.components=o,o},e.prototype.triggerToolRender=function(){var t=this.props,e=t.tool,n=t.graphModel,r=document.querySelector("#ToolOverlay_".concat(n.flowId)),o=e.getInstance();o.components.forEach((function(t){return t(o,r)})),o.components=[]},e.prototype.render=function(){var t=this.props.graphModel;return uo("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(t.flowId),children:this.getTools()})},e=oo([cx],e)}(Vn),oE=function(e){function n(){var t=e.apply(this,ao([],io(arguments),!1))||this;return t.handleResize=function(){t.props.graphModel.resize()},t}return eo(n,e),n.prototype.componentDidMount=function(){window.addEventListener("resize",Kv(this.handleResize,200))},n.prototype.componentDidUpdate=function(){this.props.graphModel.eventCenter.emit(t.EventType.GRAPH_UPDATED,{})},n.prototype.componentWillUnmount=function(){window.removeEventListener("resize",Kv(this.handleResize,200))},n.prototype.getComponent=function(t,e,n){void 0===n&&(n="canvas-overlay");var r=(0,this.props.getView)(t.type);return r?uo(r,{model:t,graphModel:e,overlay:n},t.id):null},n.prototype.render=function(){var t=this,e=this.props,n=e.graphModel,r=e.tool,o=e.options,i=e.dnd,a=e.snaplineModel;o.width&&"".concat(n.width,"px"),o.height&&"".concat(n.height,"px");var s=o.grid&&Qb.getGridOptions(o.grid),u=n.fakeNode,l=n.editConfigModel.adjustEdge;return uo("div",{className:"lf-graph","flow-id":n.flowId,children:[uo(Hb,{graphModel:n,dnd:i,children:[uo("g",{className:"lf-base",children:wf(n.sortElements,(function(e){return t.getComponent(e,n)}))}),u?this.getComponent(u,n):""]}),uo(tE,{graphModel:n,children:[uo(eE,{graphModel:n}),l?uo($b,{graphModel:n}):"",!1!==o.snapline?uo(nE,{snaplineModel:a}):""]}),uo(rE,{graphModel:n,tool:r}),o.background&&uo(Jb,{background:o.background}),s&&uo(Qb,no({},s,{graphModel:n}))]})},n=oo([cx],n)}(Vn),iE=function(e){function n(){var n=e.call(this)||this;return n.onDragStart=function(e){var r=e.event,o=n.props,i=o.anchorData,a=o.nodeModel,s=o.graphModel;s.selectNodeById(a.id),a.autoToFront&&s.toFront(a.id),s.eventCenter.emit(t.EventType.ANCHOR_DRAGSTART,{data:i,e:r,nodeModel:a}),n.setState({startX:i.x,startY:i.y,endX:i.x,endY:i.y})},n.onDragging=function(e){var r=e.event,o=n.props,i=o.graphModel,a=o.nodeModel,s=o.anchorData,u=i.transformModel,l=i.eventCenter,c=i.width,p=i.height,d=i.editConfigModel,f=d.autoExpand,h=d.stopMoveGraph,y=r.clientX,v=r.clientY,g=i.getPointByClient({x:y,y:v}),_=g.domOverlayPosition,m=_.x,b=_.y,E=g.canvasOverlayPosition,x=E.x,w=E.y;n.t&&ib(n.t);var S=[];m<10?S=[10,0]:m+10>c?S=[-10,0]:b<10?S=[0,10]:b+10>p&&(S=[0,-10]),n.setState({endX:x,endY:w,dragging:!0}),n.moveAnchorEnd(x,w),S.length>0&&!h&&f&&(n.t=ob((function(){var t=io(S,2),e=t[0],r=t[1];u.translate(e,r);var o=n.state,i=o.endX,a=o.endY;n.setState({endX:i-e,endY:a-r}),n.moveAnchorEnd(i-e,a-r)}))),l.emit(t.EventType.ANCHOR_DRAG,{data:s,e:r,nodeModel:a})},n.onDragEnd=function(e){var r=e.event;n.t&&ib(n.t);var o=n.checkEnd(r);n.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),n.sourceRuleResults.clear(),n.targetRuleResults.clear();var i=n.props,a=i.graphModel,s=i.nodeModel,u=i.anchorData;o&&a.eventCenter.emit(t.EventType.ANCHOR_DRAGEND,{data:u,e:r,nodeModel:s,edgeModel:o})},n.checkEnd=function(e){var r,o=n.props,i=o.graphModel,a=o.nodeModel,s=o.anchorData,u=s.x,l=s.y,c=s.id,p=n.state,d=p.endX,f=p.endY,h=p.dragging,y=mm({x:d,y:f},i);if(n.preTargetNode&&n.preTargetNode.state!==t.ElementState.DEFAULT&&n.preTargetNode.setElementState(t.ElementState.DEFAULT),h&&y&&y.node){var v=y.node,g=y.anchor.id,_="".concat(a.id,"_").concat(v.id,"_").concat(g,"_").concat(c),m=n.sourceRuleResults.get(_)||{},b=m.isAllPass,E=m.msg,x=n.targetRuleResults.get(_)||{},w=x.isAllPass,S=x.msg;if(b&&w){v.setElementState(t.ElementState.DEFAULT);var M=i.getNodeModelById(y.node.id),A=null===(r=i.edgeGenerator)||void 0===r?void 0:r.call(i,a.getData(),null==M?void 0:M.getData()),T=i.addEdge(no(no({},A),{sourceNodeId:a.id,sourceAnchorId:c,startPoint:{x:u,y:l},targetNodeId:y.node.id,targetAnchorId:y.anchor.id,endPoint:{x:y.anchor.x,y:y.anchor.y}})),O=n.props.anchorData;return i.eventCenter.emit(t.EventType.ANCHOR_DROP,{data:O,e:e,nodeModel:a,edgeModel:T}),T}var N=v.getData();return i.eventCenter.emit(t.EventType.CONNECTION_NOT_ALLOWED,{data:N,msg:S||E||"不允许添加连线"}),null}},n.sourceRuleResults=new Map,n.targetRuleResults=new Map,n.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},n.dragHandler=new f_({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return eo(n,e),n.prototype.getAnchorShape=function(){var t=this.props,e=t.anchorData,n=t.style,r=t.node.getAnchorShape(e);if(r)return r;var o=e.x,i=e.y,a=no(no({},n),null==n?void 0:n.hover);return uo("g",{children:[uo(Vb,no({className:"lf-node-anchor-hover"},a,{x:o,y:i})),uo(Vb,no({className:"lf-node-anchor"},n,{x:o,y:i}))]})},Object.defineProperty(n.prototype,"customTrajectory",{get:function(){return this.props.graphModel.customTrajectory},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"relateEdges",{get:function(){var t=this.props,e=t.graphModel,n=e.getAnchorIncomingEdge,r=e.getAnchorOutcomingEdge,o=t.anchorData.id;return{incomingEdgeList:n(o),outcomingEdgeList:r(o)}},enumerable:!1,configurable:!0}),n.prototype.moveAnchorEnd=function(e,n){var r,o,i=this.props,a=i.graphModel,s=i.nodeModel,u=i.anchorData,l=mm({x:e,y:n},a);if(l){var c=l.node,p=l.anchor.id;if(this.preTargetNode&&this.preTargetNode!==l.node&&this.preTargetNode.setElementState(t.ElementState.DEFAULT),u.id===p)return;this.preTargetNode=c;var d="".concat(s.id,"_").concat(c.id,"_").concat(p,"_").concat(u.id);if(!this.targetRuleResults.has(d)){var f=l.anchor,h=s.isAllowConnectedAsSource(c,u,f),y=c.isAllowConnectedAsTarget(s,u,f);this.sourceRuleResults.set(d,Rm(h)),this.targetRuleResults.set(d,Rm(y))}var v=(null!==(r=this.sourceRuleResults.get(d))&&void 0!==r?r:{}).isAllPass,g=(null!==(o=this.targetRuleResults.get(d))&&void 0!==o?o:{}).isAllPass;v&&g?c.setElementState(t.ElementState.ALLOW_CONNECT):c.setElementState(t.ElementState.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==t.ElementState.DEFAULT&&this.preTargetNode.setElementState(t.ElementState.DEFAULT)},n.prototype.isShowLine=function(){var t=this.state,e=t.startX,n=t.startY,r=t.endX,o=t.endY;return xm(e,n,r,o)>10},n.prototype.render=function(){var t=this,e=this.state,n=e.startX,r=e.startY,o=e.endX,i=e.endY,a=this.props,s=a.anchorData.edgeAddable,u=a.edgeStyle;return uo("g",{className:"lf-anchor",children:[uo("g",{onMouseDown:function(e){!1!==s&&t.dragHandler.handleMouseDown(e)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(no({sourcePoint:{x:n,y:r},targetPoint:{x:o,y:i}},u)):uo(Gb,no({x1:n,y1:r,x2:o,y2:i},u,{"pointer-events":"none"})))]})},n}(Vn),aE=function(e){function n(n){var r=e.call(this,n)||this;return r.style={},r.onDragging=function(e){var n,o=e.event,i=r.props,a=i.graphModel,s=i.nodeModel,u=i.eventCenter,l=a.selectNodes,c=s.x,p=s.y,d=o.clientX,f=o.clientY,h=a.getPointByClient({x:d,y:f}).canvasOverlayPosition,y=h.x,v=h.y,g=new dm(y-c,v-p),_=(null===(n=r.normal)||void 0===n?void 0:n.angle(g))-r.defaultAngle,m=new gm(-c,-p).rotate(_).translate(c,p).toString();s.transform=m,s.rotate=_;var b=wf(l,(function(t){return t.id}));-1===b.indexOf(s.id)&&(b=[s.id]);var E=uv(b,(function(t,e){var n=a.getNodeModelById(e);return t[e]=null==n?void 0:n.getMoveDistance(0,0,!1),t}),{});b.forEach((function(t){a.getNodeEdges(t).forEach((function(t){if(E[t.sourceNodeId]){var e=a.getNodeModelById(t.sourceNodeId).anchors.find((function(e){return e.id===t.sourceAnchorId}));t.updateStartPoint(e)}if(E[t.targetNodeId]){e=a.getNodeModelById(t.targetNodeId).anchors.find((function(e){return e.id===t.targetAnchorId}));t.updateEndPoint(e)}}))})),u.emit(t.EventType.NODE_ROTATE,{e:o,nodeModel:s})},r.style=n.style,r.stepperDrag=new f_({onDragging:r.onDragging}),r}return eo(n,e),n.prototype.render=function(){var t=this,e=this.props.nodeModel,n=e.x,r=e.y,o=n+e.width/2+20,i=r-e.height/2-20;return this.normal=new dm(1,0),this.defaultAngle=this.normal.angle(new dm(o-n,i-r)),e.defaultAngle=this.defaultAngle,uo("g",{className:"lf-rotate-control",children:uo("g",{onMouseDown:function(e){t.stepperDrag.handleMouseDown(e)},children:uo(Vb,no({},this.style,{cx:o,cy:i}))})})},n}(Vn),sE={},uE={get exports(){return sE},set exports(t){sE=t}};
25
+ var qg,Zg,$g=4294967295,Jg=Array.prototype,Qg=Object.prototype.hasOwnProperty,t_=fo?fo.iterator:void 0,e_=Math.max,n_=Math.min,r_=function(t){return function(e,n,r){if(null==r){var o=Uo(n),i=o&&Cs(n),a=i&&i.length&&Of(n,i);(a?a.length:o)||(r=n,n=e,e=this)}return t(e,n,r)}}(Kh);Ui.after=kg.after,Ui.ary=kg.ary,Ui.assign=Hg.assign,Ui.assignIn=Hg.assignIn,Ui.assignInWith=Hg.assignInWith,Ui.assignWith=Hg.assignWith,Ui.at=Hg.at,Ui.before=kg.before,Ui.bind=kg.bind,Ui.bindAll=Yg.bindAll,Ui.bindKey=kg.bindKey,Ui.castArray=Rg.castArray,Ui.chain=Wg.chain,Ui.chunk=Ig.chunk,Ui.compact=Ig.compact,Ui.concat=Ig.concat,Ui.cond=Yg.cond,Ui.conforms=Yg.conforms,Ui.constant=Yg.constant,Ui.countBy=Lg.countBy,Ui.create=Hg.create,Ui.curry=kg.curry,Ui.curryRight=kg.curryRight,Ui.debounce=kg.debounce,Ui.defaults=Hg.defaults,Ui.defaultsDeep=Hg.defaultsDeep,Ui.defer=kg.defer,Ui.delay=kg.delay,Ui.difference=Ig.difference,Ui.differenceBy=Ig.differenceBy,Ui.differenceWith=Ig.differenceWith,Ui.drop=Ig.drop,Ui.dropRight=Ig.dropRight,Ui.dropRightWhile=Ig.dropRightWhile,Ui.dropWhile=Ig.dropWhile,Ui.fill=Ig.fill,Ui.filter=Lg.filter,Ui.flatMap=Lg.flatMap,Ui.flatMapDeep=Lg.flatMapDeep,Ui.flatMapDepth=Lg.flatMapDepth,Ui.flatten=Ig.flatten,Ui.flattenDeep=Ig.flattenDeep,Ui.flattenDepth=Ig.flattenDepth,Ui.flip=kg.flip,Ui.flow=Yg.flow,Ui.flowRight=Yg.flowRight,Ui.fromPairs=Ig.fromPairs,Ui.functions=Hg.functions,Ui.functionsIn=Hg.functionsIn,Ui.groupBy=Lg.groupBy,Ui.initial=Ig.initial,Ui.intersection=Ig.intersection,Ui.intersectionBy=Ig.intersectionBy,Ui.intersectionWith=Ig.intersectionWith,Ui.invert=Hg.invert,Ui.invertBy=Hg.invertBy,Ui.invokeMap=Lg.invokeMap,Ui.iteratee=Yg.iteratee,Ui.keyBy=Lg.keyBy,Ui.keys=Cs,Ui.keysIn=Hg.keysIn,Ui.map=Lg.map,Ui.mapKeys=Hg.mapKeys,Ui.mapValues=Hg.mapValues,Ui.matches=Yg.matches,Ui.matchesProperty=Yg.matchesProperty,Ui.memoize=kg.memoize,Ui.merge=Hg.merge,Ui.mergeWith=Hg.mergeWith,Ui.method=Yg.method,Ui.methodOf=Yg.methodOf,Ui.mixin=r_,Ui.negate=$h,Ui.nthArg=Yg.nthArg,Ui.omit=Hg.omit,Ui.omitBy=Hg.omitBy,Ui.once=kg.once,Ui.orderBy=Lg.orderBy,Ui.over=Yg.over,Ui.overArgs=kg.overArgs,Ui.overEvery=Yg.overEvery,Ui.overSome=Yg.overSome,Ui.partial=kg.partial,Ui.partialRight=kg.partialRight,Ui.partition=Lg.partition,Ui.pick=Hg.pick,Ui.pickBy=Hg.pickBy,Ui.property=Yg.property,Ui.propertyOf=Yg.propertyOf,Ui.pull=Ig.pull,Ui.pullAll=Ig.pullAll,Ui.pullAllBy=Ig.pullAllBy,Ui.pullAllWith=Ig.pullAllWith,Ui.pullAt=Ig.pullAt,Ui.range=Yg.range,Ui.rangeRight=Yg.rangeRight,Ui.rearg=kg.rearg,Ui.reject=Lg.reject,Ui.remove=Ig.remove,Ui.rest=kg.rest,Ui.reverse=Ig.reverse,Ui.sampleSize=Lg.sampleSize,Ui.set=Hg.set,Ui.setWith=Hg.setWith,Ui.shuffle=Lg.shuffle,Ui.slice=Ig.slice,Ui.sortBy=Lg.sortBy,Ui.sortedUniq=Ig.sortedUniq,Ui.sortedUniqBy=Ig.sortedUniqBy,Ui.split=Gg.split,Ui.spread=kg.spread,Ui.tail=Ig.tail,Ui.take=Ig.take,Ui.takeRight=Ig.takeRight,Ui.takeRightWhile=Ig.takeRightWhile,Ui.takeWhile=Ig.takeWhile,Ui.tap=Wg.tap,Ui.throttle=kg.throttle,Ui.thru=Qy,Ui.toArray=Rg.toArray,Ui.toPairs=Hg.toPairs,Ui.toPairsIn=Hg.toPairsIn,Ui.toPath=Yg.toPath,Ui.toPlainObject=Rg.toPlainObject,Ui.transform=Hg.transform,Ui.unary=kg.unary,Ui.union=Ig.union,Ui.unionBy=Ig.unionBy,Ui.unionWith=Ig.unionWith,Ui.uniq=Ig.uniq,Ui.uniqBy=Ig.uniqBy,Ui.uniqWith=Ig.uniqWith,Ui.unset=Hg.unset,Ui.unzip=Ig.unzip,Ui.unzipWith=Ig.unzipWith,Ui.update=Hg.update,Ui.updateWith=Hg.updateWith,Ui.values=Hg.values,Ui.valuesIn=Hg.valuesIn,Ui.without=Ig.without,Ui.words=Gg.words,Ui.wrap=kg.wrap,Ui.xor=Ig.xor,Ui.xorBy=Ig.xorBy,Ui.xorWith=Ig.xorWith,Ui.zip=Ig.zip,Ui.zipObject=Ig.zipObject,Ui.zipObjectDeep=Ig.zipObjectDeep,Ui.zipWith=Ig.zipWith,Ui.entries=Hg.toPairs,Ui.entriesIn=Hg.toPairsIn,Ui.extend=Hg.assignIn,Ui.extendWith=Hg.assignInWith,r_(Ui,Ui),Ui.add=Bg.add,Ui.attempt=Yg.attempt,Ui.camelCase=Gg.camelCase,Ui.capitalize=Gg.capitalize,Ui.ceil=Bg.ceil,Ui.clamp=zg,Ui.clone=Rg.clone,Ui.cloneDeep=Rg.cloneDeep,Ui.cloneDeepWith=Rg.cloneDeepWith,Ui.cloneWith=Rg.cloneWith,Ui.conformsTo=Rg.conformsTo,Ui.deburr=Gg.deburr,Ui.defaultTo=Yg.defaultTo,Ui.divide=Bg.divide,Ui.endsWith=Gg.endsWith,Ui.eq=Rg.eq,Ui.escape=Gg.escape,Ui.escapeRegExp=Gg.escapeRegExp,Ui.every=Lg.every,Ui.find=Lg.find,Ui.findIndex=Ig.findIndex,Ui.findKey=Hg.findKey,Ui.findLast=Lg.findLast,Ui.findLastIndex=Ig.findLastIndex,Ui.findLastKey=Hg.findLastKey,Ui.floor=Bg.floor,Ui.forEach=Lg.forEach,Ui.forEachRight=Lg.forEachRight,Ui.forIn=Hg.forIn,Ui.forInRight=Hg.forInRight,Ui.forOwn=Hg.forOwn,Ui.forOwnRight=Hg.forOwnRight,Ui.get=Hg.get,Ui.gt=Rg.gt,Ui.gte=Rg.gte,Ui.has=Hg.has,Ui.hasIn=Hg.hasIn,Ui.head=Ig.head,Ui.identity=$o,Ui.includes=Lg.includes,Ui.indexOf=Ig.indexOf,Ui.inRange=Ug,Ui.invoke=Hg.invoke,Ui.isArguments=Rg.isArguments,Ui.isArray=Do,Ui.isArrayBuffer=Rg.isArrayBuffer,Ui.isArrayLike=Rg.isArrayLike,Ui.isArrayLikeObject=Rg.isArrayLikeObject,Ui.isBoolean=Rg.isBoolean,Ui.isBuffer=Rg.isBuffer,Ui.isDate=Rg.isDate,Ui.isElement=Rg.isElement,Ui.isEmpty=Rg.isEmpty,Ui.isEqual=Rg.isEqual,Ui.isEqualWith=Rg.isEqualWith,Ui.isError=Rg.isError,Ui.isFinite=Rg.isFinite,Ui.isFunction=Rg.isFunction,Ui.isInteger=Rg.isInteger,Ui.isLength=Rg.isLength,Ui.isMap=Rg.isMap,Ui.isMatch=Rg.isMatch,Ui.isMatchWith=Rg.isMatchWith,Ui.isNaN=Rg.isNaN,Ui.isNative=Rg.isNative,Ui.isNil=Rg.isNil,Ui.isNull=Rg.isNull,Ui.isNumber=Rg.isNumber,Ui.isObject=Uo,Ui.isObjectLike=Rg.isObjectLike,Ui.isPlainObject=Rg.isPlainObject,Ui.isRegExp=Rg.isRegExp,Ui.isSafeInteger=Rg.isSafeInteger,Ui.isSet=Rg.isSet,Ui.isString=Rg.isString,Ui.isSymbol=Rg.isSymbol,Ui.isTypedArray=Rg.isTypedArray,Ui.isUndefined=Rg.isUndefined,Ui.isWeakMap=Rg.isWeakMap,Ui.isWeakSet=Rg.isWeakSet,Ui.join=Ig.join,Ui.kebabCase=Gg.kebabCase,Ui.last=zd,Ui.lastIndexOf=Ig.lastIndexOf,Ui.lowerCase=Gg.lowerCase,Ui.lowerFirst=Gg.lowerFirst,Ui.lt=Rg.lt,Ui.lte=Rg.lte,Ui.max=Bg.max,Ui.maxBy=Bg.maxBy,Ui.mean=Bg.mean,Ui.meanBy=Bg.meanBy,Ui.min=Bg.min,Ui.minBy=Bg.minBy,Ui.stubArray=Yg.stubArray,Ui.stubFalse=Yg.stubFalse,Ui.stubObject=Yg.stubObject,Ui.stubString=Yg.stubString,Ui.stubTrue=Yg.stubTrue,Ui.multiply=Bg.multiply,Ui.nth=Ig.nth,Ui.noop=Yg.noop,Ui.now=jg,Ui.pad=Gg.pad,Ui.padEnd=Gg.padEnd,Ui.padStart=Gg.padStart,Ui.parseInt=Gg.parseInt,Ui.random=Xg,Ui.reduce=Lg.reduce,Ui.reduceRight=Lg.reduceRight,Ui.repeat=Gg.repeat,Ui.replace=Gg.replace,Ui.result=Hg.result,Ui.round=Bg.round,Ui.sample=Lg.sample,Ui.size=Lg.size,Ui.snakeCase=Gg.snakeCase,Ui.some=Lg.some,Ui.sortedIndex=Ig.sortedIndex,Ui.sortedIndexBy=Ig.sortedIndexBy,Ui.sortedIndexOf=Ig.sortedIndexOf,Ui.sortedLastIndex=Ig.sortedLastIndex,Ui.sortedLastIndexBy=Ig.sortedLastIndexBy,Ui.sortedLastIndexOf=Ig.sortedLastIndexOf,Ui.startCase=Gg.startCase,Ui.startsWith=Gg.startsWith,Ui.subtract=Bg.subtract,Ui.sum=Bg.sum,Ui.sumBy=Bg.sumBy,Ui.template=Gg.template,Ui.times=Yg.times,Ui.toFinite=Rg.toFinite,Ui.toInteger=Zo,Ui.toLength=Rg.toLength,Ui.toLower=Gg.toLower,Ui.toNumber=Rg.toNumber,Ui.toSafeInteger=Rg.toSafeInteger,Ui.toString=Rg.toString,Ui.toUpper=Gg.toUpper,Ui.trim=Gg.trim,Ui.trimEnd=Gg.trimEnd,Ui.trimStart=Gg.trimStart,Ui.truncate=Gg.truncate,Ui.unescape=Gg.unescape,Ui.uniqueId=Yg.uniqueId,Ui.upperCase=Gg.upperCase,Ui.upperFirst=Gg.upperFirst,Ui.each=Lg.forEach,Ui.eachRight=Lg.forEachRight,Ui.first=Ig.head,r_(Ui,(qg={},sd(Ui,(function(t,e){Qg.call(Ui.prototype,e)||(qg[e]=t)})),qg),{chain:!1}),Ui.VERSION="4.17.21",(Ui.templateSettings=Gg.templateSettings).imports._=Ui,Ji(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Ui[t].placeholder=Ui})),Ji(["drop","take"],(function(t,e){Ni.prototype[t]=function(n){n=void 0===n?1:e_(Zo(n),0);var r=this.__filtered__&&!e?new Ni(this):this.clone();return r.__filtered__?r.__takeCount__=n_(n,r.__takeCount__):r.__views__.push({size:n_(n,$g),type:t+(r.__dir__<0?"Right":"")}),r},Ni.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ji(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Ni.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:nd(t),type:n}),e.__filtered__=e.__filtered__||r,e}})),Ji(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Ni.prototype[t]=function(){return this[n](1).value()[0]}})),Ji(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Ni.prototype[t]=function(){return this.__filtered__?new Ni(this):this[n](1)}})),Ni.prototype.compact=function(){return this.filter($o)},Ni.prototype.find=function(t){return this.filter(t).head()},Ni.prototype.findLast=function(t){return this.reverse().find(t)},Ni.prototype.invokeMap=Qa((function(t,e){return"function"==typeof t?new Ni(this):this.map((function(n){return sh(n,t,e)}))})),Ni.prototype.reject=function(t){return this.filter($h(nd(t)))},Ni.prototype.slice=function(t,e){t=Zo(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Ni(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=Zo(e))<0?n.dropRight(-e):n.take(e-t)),n)},Ni.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Ni.prototype.toArray=function(){return this.take($g)},sd(Ni.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Ui[r?"take"+("last"==e?"Right":""):e],i=r||/^find/.test(e);o&&(Ui.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,s=e instanceof Ni,u=a[0],l=s||Do(e),c=function(t){var e=o.apply(Ui,du([t],a));return r&&p?e[0]:e};l&&n&&"function"==typeof u&&1!=u.length&&(s=l=!1);var p=this.__chain__,d=!!this.__actions__.length,f=i&&!p,h=s&&!d;if(!i&&l){e=h?e:new Ni(this);var v=t.apply(e,a);return v.__actions__.push({func:Qy,args:[c],thisArg:void 0}),new ki(v,p)}return f&&h?t.apply(this,a):(v=this.thru(c),f?r?v.value()[0]:v.value():v)})})),Ji(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Jg[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Ui.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(Do(o)?o:[],t)}return this[n]((function(n){return e.apply(Do(n)?n:[],t)}))}})),sd(Ni.prototype,(function(t,e){var n=Ui[e];if(n){var r=n.name+"";Qg.call(Ii,r)||(Ii[r]=[]),Ii[r].push({name:e,func:n})}})),Ii[Sa(void 0,2).name]=[{name:"wrapper",func:void 0}],Ni.prototype.clone=function(){var t=new Ni(this.__wrapped__);return t.__actions__=Ri(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ri(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ri(this.__views__),t},Ni.prototype.reverse=function(){if(this.__filtered__){var t=new Ni(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Ni.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Do(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=Fg(e,t+a);break;case"takeRight":t=Vg(t,e-a)}}return{start:t,end:e}}(0,o,this.__views__),a=i.start,s=i.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,p=c.length,d=0,f=Kg(u,this.__takeCount__);if(!n||!r&&o==u&&f==u)return ng(t,this.__actions__);var h=[];t:for(;u--&&d<f;){for(var v=-1,y=t[l+=e];++v<p;){var g=c[v],_=g.iteratee,m=g.type,b=_(y);if(2==m)y=b;else if(!b){if(1==m)continue t;break t}}h[d++]=y}return h},Ui.prototype.at=Wg.at,Ui.prototype.chain=Wg.wrapperChain,Ui.prototype.commit=Wg.commit,Ui.prototype.next=Wg.next,Ui.prototype.plant=Wg.plant,Ui.prototype.reverse=Wg.reverse,Ui.prototype.toJSON=Ui.prototype.valueOf=Ui.prototype.value=Wg.value,Ui.prototype.first=Ui.prototype.head,t_&&(Ui.prototype[t_]=Wg.toIterator),t.Options=void 0,(Zg=t.Options||(t.Options={})).get=function(t){var e=ro(t,[]);if(!t.container)throw new Error("Ensure the container of LogicFlow is specified and valid.");return Ls({},Zg.defaults,e)},function(t){t.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}}(t.Options||(t.Options={}));var o_={node:!1,edge:!1},i_={node:!0,edge:!0},a_=function(t){return t&&"boolean"!=typeof t?Yh(up(o_),t):up(!0===t?i_:o_)},s_=a_,u_=null!==cu(window,"navigator.userAgent","").match(/MSIE|Trident/);function l_(t){try{return JSON.parse(JSON.stringify(t))}catch(e){return t}}var c_,p_,d_,f_,h_,v_,y_,g_=200;t.ElementState=void 0,(c_=t.ElementState||(t.ElementState={}))[c_.DEFAULT=1]="DEFAULT",c_[c_.TEXT_EDIT=2]="TEXT_EDIT",c_[c_.SHOW_MENU=3]="SHOW_MENU",c_[c_.ALLOW_CONNECT=4]="ALLOW_CONNECT",c_[c_.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT",t.ElementType=void 0,(p_=t.ElementType||(t.ElementType={})).NODE="node",p_.EDGE="edge",p_.GRAPH="graph",t.ModelType=void 0,(d_=t.ModelType||(t.ModelType={})).NODE="node",d_.CIRCLE_NODE="circle-node",d_.POLYGON_NODE="polygon-node",d_.RECT_NODE="rect-node",d_.TEXT_NODE="text-node",d_.ELLIPSE_NODE="ellipse-node",d_.DIAMOND_NODE="diamond-node",d_.HTML_NODE="html-node",d_.CUSTOM_HTML_NODE="custom-html-node",d_.EDGE="edge",d_.LINE_EDGE="line-edge",d_.POLYLINE_EDGE="polyline-edge",d_.BEZIER_EDGE="bezier-edge",d_.GRAPH="graph",t.EventType=void 0,(f_=t.EventType||(t.EventType={})).ELEMENT_CLICK="element:click",f_.NODE_ADD="node:add",f_.NODE_DELETE="node:delete",f_.NODE_CLICK="node:click",f_.NODE_DBCLICK="node:dbclick",f_.NODE_GROUP_COPY="node:group-copy-add",f_.NODE_DND_ADD="node:dnd-add",f_.NODE_DND_DRAG="node:dnd-drag",f_.NODE_MOUSEDOWN="node:mousedown",f_.NODE_DRAGSTART="node:dragstart",f_.NODE_DRAG="node:drag",f_.NODE_DROP="node:drop",f_.NODE_MOUSEUP="node:mouseup",f_.NODE_MOUSEMOVE="node:mousemove",f_.NODE_MOUSEENTER="node:mouseenter",f_.NODE_MOUSELEAVE="node:mouseleave",f_.NODE_CONTEXTMENU="node:contextmenu",f_.NODE_ROTATE="node:rotate",f_.NODE_RESIZE="node:resize",f_.NODE_PROPERTIES_CHANGE="node:properties-change",f_.NODE_PROPERTIES_DELETE="node:properties-delete",f_.EDGE_ADD="edge:add",f_.EDGE_DELETE="edge:delete",f_.EDGE_CLICK="edge:click",f_.EDGE_DBCLICK="edge:dbclick",f_.EDGE_MOUSEENTER="edge:mouseenter",f_.EDGE_MOUSELEAVE="edge:mouseleave",f_.EDGE_CONTEXTMENU="edge:contextmenu",f_.EDGE_ADJUST="edge:adjust",f_.EDGE_EXCHANGE_NODE="edge:exchange-node",f_.ANCHOR_DRAGSTART="anchor:dragstart",f_.ANCHOR_DRAG="anchor:drag",f_.ANCHOR_DROP="anchor:drop",f_.ANCHOR_DRAGEND="anchor:dragend",f_.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",f_.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",f_.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",f_.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",f_.ADJUST_POINT_DRAG="adjustPoint:drag",f_.ADJUST_POINT_DROP="adjustPoint:drop",f_.ADJUST_POINT_DRAGEND="adjustPoint:dragend",f_.BLANK_MOUSEDOWN="blank:mousedown",f_.BLANK_DRAGSTART="blank:dragstart",f_.BLANK_DRAG="blank:drag",f_.BLANK_DROP="blank:drop",f_.BLANK_MOUSEMOVE="blank:mousemove",f_.BLANK_MOUSEUP="blank:mouseup",f_.BLANK_CLICK="blank:click",f_.BLANK_CONTEXTMENU="blank:contextmenu",f_.SELECTION_MOUSEDOWN="selection:mousedown",f_.SELECTION_DRAGSTART="selection:dragstart",f_.SELECTION_DRAG="selection:drag",f_.SELECTION_DROP="selection:drop",f_.SELECTION_MOUSEMOVE="selection:mousemove",f_.SELECTION_MOUSEUP="selection:mouseup",f_.SELECTION_CONTEXTMENU="selection:contextmenu",f_.CONNECTION_NOT_ALLOWED="connection:not-allowed",f_.TEXT_MOUSEDOWN="text:mousedown",f_.TEXT_DRAGSTART="text:dragstart",f_.TEXT_DRAG="text:drag",f_.TEXT_DROP="text:drop",f_.TEXT_CLICK="text:click",f_.TEXT_DBCLICK="text:dbclick",f_.TEXT_BLUR="text:blur",f_.TEXT_MOUSEMOVE="text:mousemove",f_.TEXT_MOUSEUP="text:mouseup",f_.TEXT_FOCUS="text:focus",f_.TEXT_ADD="text:add",f_.TEXT_UPDATE="text:update",f_.TEXT_CLEAR="text:clear",f_.LABEL_MOUSEDOWN="label:mousedown",f_.LABEL_DRAGSTART="label:dragstart",f_.LABEL_DRAG="label:drag",f_.LABEL_DROP="label:drop",f_.LABEL_CLICK="label:click",f_.LABEL_DBCLICK="label:dbclick",f_.LABEL_BLUR="label:blur",f_.LABEL_MOUSEMOVE="label:mousemove",f_.LABEL_MOUSEUP="label:mouseup",f_.LABEL_FOCUS="label:focus",f_.LABEL_ADD="label:add",f_.LABEL_UPDATE="label:update",f_.LABEL_CLEAR="label:clear",f_.LABEL_DELETE="label:delete",f_.LABEL_SHOULD_ADD="label:should-add",f_.LABEL_BATCH_ADD="label:batch-add",f_.LABEL_SHOULD_UPDATE="label:should-update",f_.LABEL_SHOULD_DELETE="label:should-delete",f_.LABEL_BATCH_DELETE="label:batch-delete",f_.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",f_.HISTORY_CHANGE="history:change",f_.GRAPH_TRANSFORM="graph:transform",f_.GRAPH_RENDERED="graph:rendered",f_.GRAPH_UPDATED="graph:updated",t.OverlapMode=void 0,(h_=t.OverlapMode||(t.OverlapMode={}))[h_.DEFAULT=0]="DEFAULT",h_[h_.INCREASE=1]="INCREASE",t.SegmentDirection=void 0,(v_=t.SegmentDirection||(t.SegmentDirection={})).HORIZONTAL="horizontal",v_.VERTICAL="vertical",t.TextMode=void 0,(y_=t.TextMode||(t.TextMode={})).TEXT="text",y_.LABEL="label";var __=function(){function e(e){var n=e.onDragStart,r=void 0===n?Pi:n,o=e.onDragging,i=void 0===o?Pi:o,a=e.onDragEnd,s=void 0===a?Pi:a,u=e.eventType,l=void 0===u?"":u,c=e.eventCenter,p=e.step,d=void 0===p?1:p,f=e.isStopPropagation,h=void 0===f||f,v=e.model,y=e.data,g=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(e){var n,r,o=null===window||void 0===window?void 0:window.document;if(0===e.button){g.isStopPropagation&&e.stopPropagation(),g.isStartDragging=!0,g.startX=e.clientX,g.startY=e.clientY,o.addEventListener("mousemove",g.handleMouseMove,!1),o.addEventListener("mouseup",g.handleMouseUp,!1);var i=null===(n=g.model)||void 0===n?void 0:n.getData();null===(r=g.eventCenter)||void 0===r||r.emit(t.EventType["".concat(g.eventType,"_MOUSEDOWN")],{e:e,data:g.data||i}),g.startTime=(new Date).getTime()}},this.handleMouseMove=function(e){var n,r;if(g.isStopPropagation&&e.stopPropagation(),g.isStartDragging&&(g.sumDeltaX+=e.clientX-g.startX,g.sumDeltaY+=e.clientY-g.startY,g.startX=e.clientX,g.startY=e.clientY,g.step<=1||Math.abs(g.sumDeltaX)>g.step||Math.abs(g.sumDeltaY)>g.step)){var o=g.sumDeltaX%g.step,i=g.sumDeltaY%g.step,a=g.sumDeltaX-o,s=g.sumDeltaY-i;g.sumDeltaX=o,g.sumDeltaY=i;var u=null===(n=g.model)||void 0===n?void 0:n.getData();g.isDragging||(null===(r=g.eventCenter)||void 0===r||r.emit(t.EventType["".concat(g.eventType,"_DRAGSTART")],{e:e,data:g.data||u}),g.onDragStart({event:e})),g.isDragging=!0,Promise.resolve().then((function(){var n,r;g.onDragging({deltaX:a,deltaY:s,event:e}),null===(n=g.eventCenter)||void 0===n||n.emit(t.EventType["".concat(g.eventType,"_MOUSEMOVE")],{deltaX:a,deltaY:s,e:e,data:g.data||u}),null===(r=g.eventCenter)||void 0===r||r.emit(t.EventType["".concat(g.eventType,"_DRAG")],{e:e,data:g.data||u})}))}},this.handleMouseUp=function(e){var n=window.document;g.isStartDragging=!1,g.isStopPropagation&&e.stopPropagation(),Promise.resolve().then((function(){var r,o,i;n.removeEventListener("mousemove",g.handleMouseMove,!1),n.removeEventListener("mouseup",g.handleMouseUp,!1);var a=null===(r=g.model)||void 0===r?void 0:r.getData();null===(o=g.eventCenter)||void 0===o||o.emit(t.EventType["".concat(g.eventType,"_MOUSEUP")],{e:e,data:g.data||a}),g.isDragging&&(g.isDragging=!1,g.onDragEnd({event:e}),null===(i=g.eventCenter)||void 0===i||i.emit(t.EventType["".concat(g.eventType,"_DROP")],{e:e,data:g.data||a}))}))},this.cancelDrag=function(){var t=null===window||void 0===window?void 0:window.document;t.removeEventListener("mousemove",g.handleMouseMove,!1),t.removeEventListener("mouseup",g.handleMouseUp,!1),g.onDragEnd({event:void 0}),g.isDragging=!1},this.onDragStart=r,this.onDragging=i,this.onDragEnd=s,this.step=d,this.isStopPropagation=h,this.eventType=l,this.eventCenter=c,this.model=v,this.data=y}return e.prototype.setStep=function(t){this.step=t},e.prototype.setModel=function(t){this.model=t},e}(),m_=function(t){var e=t.x,n=t.y,r=t.width,o=t.height;return{x:e-r/2,y:n-o/2,x1:e+r/2,y1:n+o/2}},b_=function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,o=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:r-i/2,y:o-a/2,x1:r+i/2,y1:o+a/2}},E_=function(t){var e=t.points,n=om(e),r=j_(n,8),o=r.x,i=r.y,a=r.width,s=r.height;return{x:o-a/2,y:i-s/2,x1:o+a/2,y1:i+s/2}},x_=function(t){var e=t.path,n=dm(e),r=j_(n,8),o=r.x,i=r.y,a=r.width,s=r.height;return{x:o-a/2,y:i-s/2,x1:o+a/2,y1:i+s/2}},M_=function(e){return e.modelType===t.ModelType.LINE_EDGE?b_(e):e.modelType===t.ModelType.POLYLINE_EDGE?E_(e):e.modelType===t.ModelType.BEZIER_EDGE?x_(e):void 0},w_=function(t,e,n,r){var o=(e.y-t.y)*(r.x-n.x)-(t.x-e.x)*(n.y-r.y);if(0===o)return!1;var i=((e.x-t.x)*(r.x-n.x)*(n.y-t.y)+(e.y-t.y)*(r.x-n.x)*t.x-(r.y-n.y)*(e.x-t.x)*n.x)/o,a=-((e.y-t.y)*(r.y-n.y)*(n.x-t.x)+(e.x-t.x)*(r.y-n.y)*t.y-(r.x-n.x)*(e.y-t.y)*n.y)/o;return(i-t.x)*(i-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(i-n.x)*(i-r.x)<=0&&(a-n.y)*(a-r.y)<=0&&{x:i,y:a}},S_=function(t,e,n){var r=t.x,o=t.y,i=e.x,a=e.y,s=n.x,u=n.y,l=(u-a)/(s-i),c=a-l*i;return r>=i&&r<=s&&o>=a&&o<=u&&Math.abs(o-l*r+c)<Number.EPSILON},T_=function(t){var e=t.start,n=t.end,r=t.offset,o=t.verticalLength,i=t.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((n.y-e.y)/(n.x-e.x)),u=Math.atan(r/o),l=Math.sqrt(o*o+r*r);return"start"===i?n.x>=e.x?(a.leftX=e.x+l*Math.sin(s+u),a.leftY=e.y-l*Math.cos(s+u),a.rightX=e.x-l*Math.sin(s-u),a.rightY=e.y+l*Math.cos(s-u)):(a.leftX=e.x-l*Math.sin(s+u),a.leftY=e.y+l*Math.cos(s+u),a.rightX=e.x+l*Math.sin(s-u),a.rightY=e.y-l*Math.cos(s-u)):"end"===i&&(n.x>=e.x?(a.leftX=n.x+l*Math.sin(s-u),a.leftY=n.y-l*Math.cos(s-u),a.rightX=n.x-l*Math.sin(s+u),a.rightY=n.y+l*Math.cos(s+u)):(a.leftX=n.x-l*Math.sin(s-u),a.leftY=n.y+l*Math.cos(s-u),a.rightX=n.x+l*Math.sin(s+u),a.rightY=n.y-l*Math.cos(s+u))),a},A_=function(t,e){var n;switch(t.type){case"line":default:n=new zb(t,e);break;case"polyline":n=new Ub(t,e)}return n},O_=function(t,e){return 2*Math.abs(t.centerX-e.centerX)<t.width+e.width&&2*Math.abs(t.centerY-e.centerY)<t.height+e.height},D_=function(t){var e=[],n={};return t.forEach((function(t){var e="".concat(t.x,"-").concat(t.y);t.id=e,n[e]=t})),Object.keys(n).forEach((function(t){e.push(n[t])})),e},N_=function(t,e){var n=[t,{x:t.x,y:e.y},e];return D_(n)},P_=function(t,e){return 0===t.width&&0===t.height?t:{x:t.x,y:t.y,centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},C_=function(e,n){var r=Math.abs(e.x-n.centerX),o=Math.abs(e.y-n.centerY);return r/n.width>o/n.height?t.SegmentDirection.HORIZONTAL:t.SegmentDirection.VERTICAL},I_=function(e,n,r){return C_(r,n)===t.SegmentDirection.HORIZONTAL?{x:r.x>e.centerX?e.maxX:e.minX,y:r.y}:{x:r.x,y:r.y>e.centerY?e.maxY:e.minY}},L_=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),o=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{x:(n+o)/2,y:(r+i)/2,centerX:(n+o)/2,centerY:(r+i)/2,minX:n,minY:r,maxX:o,maxY:i,height:i-r,width:o-n}},j_=function(t,e){void 0===t&&(t=[]);var n=[],r=[];t.forEach((function(t){n.push(t.x),r.push(t.y)}));var o=Math.min.apply(Math,ao([],io(n),!1)),i=Math.max.apply(Math,ao([],io(n),!1)),a=Math.min.apply(Math,ao([],io(r),!1)),s=Math.max.apply(Math,ao([],io(r),!1)),u=i-o,l=s-a;return e&&(u+=e,l+=e),{centerX:(o+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:o,minY:a,x:(o+i)/2,y:(a+s)/2,height:l,width:u}},k_=function(t){var e=t.minX,n=t.minY,r=t.maxX,o=t.maxY;return[{x:e,y:n},{x:r,y:n},{x:r,y:o},{x:e,y:o}]},R_=function(t,e){var n=t.x,r=t.y;return n<e.minX||n>e.maxX||r<e.minY||r>e.maxY},B_=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},z_=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},U_=function(t,e){return ao(ao([],io(B_(t,e.x)),!1),io(z_(t,e.y)),!1)},X_=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},H_=function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n},W_=function(t,e,n,r,o){return X_(t,e)+X_(t,n)+H_(t,[e,n,r,o])},G_=function(t,e,n,r,o){o||(o=0),t.unshift(e[r]),n[r]&&n[r]!==r&&o<=100&&G_(t,e,n,n[r],o+1)},Y_=function(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)},V_=function(t,e,n,r){var o=e.x-t.x,i=e.y-t.y,a=r.x-n.x,s=r.y-n.y,u=(-i*(t.x-n.x)+o*(t.y-n.y))/(-a*i+o*s),l=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*i+o*s);return u>=0&&u<=1&&l>=0&&l<=1},F_=function(t,e,n){if(0===n.width&&0===n.height)return!1;var r=io(k_(n),4),o=r[0],i=r[1],a=r[2],s=r[3];return V_(t,e,o,i)||V_(t,e,o,s)||V_(t,e,i,a)||V_(t,e,a,s)},K_=function(t,e,n,r){var o=[];return t.forEach((function(t){t!==e&&(t.x!==e.x&&t.y!==e.y||F_(t,e,n)||F_(t,e,r)||o.push(t))})),D_(o)},q_=function(t,e,n,r,o,i,a){var s=[],u=[e],l={},c={},p={};e.id&&(c[e.id]=0,p[e.id]=W_(e,n,e));var d={};t.forEach((function(t){t.id&&(d[t.id]=t)}));for(var f=function(){var f,h=1/0;if(u.forEach((function(t){t.id&&p[t.id]<h&&(h=p[t.id],f=t)})),f===n&&n.id){var v=[];return G_(v,d,l,n.id),{value:v}}if(!f)return{value:[e,n]};Y_(u,f),s.push(f),K_(t,f,r,o).forEach((function(t){if(-1===s.indexOf(t)&&(-1===u.indexOf(t)&&u.push(t),(null==f?void 0:f.id)&&(null==t?void 0:t.id))){var r=p[f.id]+X_(f,t);if(c[t.id]&&r>=c[t.id])return;l[t.id]=f.id,c[t.id]=r,p[t.id]=c[t.id]+W_(t,n,e,i,a)}}))};u.length;){var h=f();if("object"==typeof h)return h.value}return[e,n]},Z_=function(t){return Um(t)},$_=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],r=t[e],o=t[e+1];n.x===r.x&&r.x===o.x||n.y===r.y&&r.y===o.y?t.splice(e,1):e++}return t},J_=function(t,e,n,r,o){var i=Z_(n),a=Z_(r),s=P_(i,o),u=P_(a,o),l=I_(s,i,t),c=I_(u,a,e);if(O_(s,u))return ao(ao([t,l],io(im(t,e,l,c)),!1),[c,e],!1);var p=j_([l,c]),d=L_(s,p),f=L_(u,p),h=[];h=(h=h.concat(k_(d))).concat(k_(f));var v={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[p,d,f].forEach((function(t){h=h.concat(U_(t,v).filter((function(t){return R_(t,s)&&R_(t,u)})))})),[{x:l.x,y:c.y},{x:c.x,y:l.y}].forEach((function(t){R_(t,s)&&R_(t,u)&&h.push(t)})),h.unshift(l),h.push(c),h=D_(h);var y=q_(h,l,c,i,a,t,e);return y.unshift(t),y.push(e),y.length>2&&(y=$_(y)),D_(y)},Q_=function(t){if(1===t.length){var e=io(t,1)[0];return[e,e]}for(var n=t[0],r=t[1],o=Rm(n.x,n.y,r.x,r.y),i=1;i<t.length-1;i++){var a=t[i],s=t[i+1],u=Rm(a.x,a.y,s.x,s.y);u>o&&(o=u,n=a,r=s)}return[n,r]},tm=function(t,e,n){var r=Bm(t,n),o=Bm(e,n);return r&&o},em=function(t,e,n){var r=Bm(t,n),o=Bm(e,n);return!(r&&o)&&(r||o)},nm=function(t,e,n){for(var r=void 0,o=Um(n),i=k_(o),a=0;a<i.length;a++){V_(t,e,i[a],i[(a+1)%i.length])&&(r=[i[a],i[(a+1)%i.length]])}if(r)return w_(t,e,r[0],r[1])},rm=function(e,n){var r=void 0;return e.x===n.x?r=t.SegmentDirection.VERTICAL:e.y===n.y&&(r=t.SegmentDirection.HORIZONTAL),r},om=function(t){var e=t.split(" "),n=[];return e&&e.forEach((function(t){var e=io(t.split(","),2),r=e[0],o=e[1];n.push({x:Number(r),y:Number(o)})})),n},im=function(t,e,n,r){var o=[];if(rm(t,n)===rm(e,r))t.y===n.y?(o.push({x:n.x,y:(n.y+r.y)/2}),o.push({x:r.x,y:(n.y+r.y)/2})):(o.push({x:(n.x+r.x)/2,y:n.y}),o.push({x:(n.x+r.x)/2,y:r.y}));else{var i={x:n.x,y:r.y},a=S_(i,t,n),s=S_(i,e,r);if(a||s)i={x:r.x,y:n.y};else{var u=am(i,t,n),l=am(i,e,r);u&&l&&(i={x:r.x,y:n.y})}o.push(i)}return o},am=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},sm=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:e+=r>=1&&r<=126||r>=65376&&r<=65439?1:2}return e},um=void 0,lm=function(t,e){um||(um=document.createElement("canvas"));var n=um.getContext("2d");return n.font=e,n.measureText(t).width},cm=function(t){var e,n=t.start,r=t.end;if(n.x===r.x&&n.y===r.y)e="";else{var o={start:n,end:r,offset:10,verticalLength:5},i=T_(no(no({},o),{type:"start"})),a=T_(no(no({},o),{type:"end"}));e="M".concat(i.leftX," ").concat(i.leftY,"\n L").concat(i.rightX," ").concat(i.rightY,"\n L").concat(a.rightX," ").concat(a.rightY,"\n L").concat(a.leftX," ").concat(a.leftY," z")}return{d:e,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},pm=function(t){var e=t.start,n=t.end,r=t.sourceNode,o=t.targetNode,i=t.offset,a=Um(r),s=Um(o),u=P_(a,i),l=P_(s,i);return{sNext:I_(u,a,e),ePre:I_(l,s,n)}},dm=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(",");return[fm(e[0]),fm(e[1]),fm(e[2]),fm(e[3])]},fm=function(t){var e=io(t.replace(/(^\s*)/g,"").split(" "),2);return{x:+e[0],y:+e[1]}},hm=function(t,e){var n=io(t,4);return[Sb(n[0],n[1],n[2],n[3],e),t[3]]},vm=function(t,e){for(var n,r=t.x,o=t.y,i=om(e),a=Number.MAX_SAFE_INTEGER,s=[],u=0;u<i.length;u++)s.push({start:i[u],end:i[(u+1)%i.length]});if(s.forEach((function(t){var e=t.start,i=t.end;if(e.x===i.x){var s={x:e.x,y:o};if(S_(s,e,i))(u=Math.abs(e.x-r))<a&&(a=u,n=s)}else if(e.y===i.y){var u;s={x:r,y:e.y};if(S_(s,e,i))(u=Math.abs(e.y-o))<a&&(a=u,n=s)}})),!n){var l=s[0],c=l.start,p=l.end;n={x:c.x+(p.x-c.x)/2,y:c.y+(p.y-c.y)/2}}return n},ym=function(t){return Gv(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},gm=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function _m(t,e){return"function"!=typeof e?function(e,n,r){return Object.assign({type:t.edgeType},r)}:function(n,r,o){var i=e(n,r,o);return i?"string"==typeof i?Object.assign({},o,{type:i}):Object.assign({type:i},o):{type:t.edgeType}}}var mm=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,o=0;return Yd(e,(function(t){var e=sm(t);o=e>o?e:o})),{width:Math.ceil(o/2)*r+r/4,height:n*(r+2)+r/4}};function bm(t,e){return e*Math.round(t/e)||t}function Em(t,e){return t%e}function xm(t,e,n){if(!t)return[];var r=Math.min.apply(Math,ao([],io(t.map((function(t){return t[0]}))),!1)),o=Math.max.apply(Math,ao([],io(t.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,ao([],io(t.map((function(t){return t[1]}))),!1)),a=Math.max.apply(Math,ao([],io(t.map((function(t){return t[1]}))),!1)),s=-r,u=-i,l=t.map((function(t){var e=io(t,2),n=e[0],r=e[1];return[n+s,r+u]})),c=e?e/(o-r):1,p=n?n/(a-i):1,d=Math.min(c,p);return l.map((function(t){var e=io(t,2),n=e[0],r=e[1];return[n*d,r*d]}))}var Mm=function(t,e,n){var r=io(t,2),o=r[0],i=r[1],a=io(e,2),s=a[0],u=a[1],l=io(n,2),c=l[0],p=l[1];return o>s&&o<c&&i>u&&i<p},wm=function(t,e){var n=!1;switch(e.multipleSelectKey){case"meta":n=t.metaKey;break;case"alt":n=t.altKey;break;case"shift":n=t.shiftKey;break;case"ctrl":n=t.ctrlKey;break;default:n=!1}return n};function Sm(t,e){return!!(t instanceof Am&&e instanceof Am)}var Tm=function(t){function e(n,r,o){var i=t.call(this,3)||this;return i[0]=n,i[1]=r,i[2]=o,i.x=n,i.y=r,i.z=o,Object.setPrototypeOf(i,e.prototype),i}return eo(e,t),e.prototype.add=function(t){if(Sm(this,t))return new Am(this.x+t.x,this.y+t.y);var e=this.z+t.z;return new Om((this.x+t.x)/e,(this.y+t.y)/e)},e.prototype.subtract=function(t){if(Sm(this,t))return new Am(this.x-t.x,this.y-t.y);var e=this.z-t.z;return 0===e?new Am(this.x-t.x,this.y-t.y):new Om((this.x-t.x)/e,(this.y-t.y)/e)},e}(Array),Am=function(t){function e(n,r,o){var i=t.call(this,n,r,null!=o?o:0)||this;return Object.setPrototypeOf(i,e.prototype),i}return eo(e,t),e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(t){var e=this;return t.reduce((function(t,n,r){return t+n*e[r]}))},e.prototype.cross=function(t){return new e(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var t=this.getLength();return new e(this.x/t,this.y/t)},e.prototype.crossZ=function(t){return this.x*t.y-this.y*t.x},e.prototype.angle=function(t){var e=this.crossZ(t),n=Math.acos(this.normalize().dot(t.normalize()));return e>=0?n:-n},e}(Tm),Om=function(t){function e(n,r){var o=t.call(this,n,r,1)||this;return Object.setPrototypeOf(o,e.prototype),o}return eo(e,t),e.prototype.toString=function(){return"Point"},e}(Tm),Dm=function(t){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.call(this,n.length)||this;return o.fill(new Array(3)),n.forEach((function(t,e){o[e]=t})),o.columns=n[0].length,o.rows=n.length,Object.setPrototypeOf(o,e.prototype),o}return eo(e,t),e.prototype.getRow=function(t){return this[t]},e.prototype.getColumn=function(t){return ao([],io(this.map((function(e){return e[t]}))),!1)},e.prototype.transpose=function(){for(var t=[],n=0;n<this.columns;n++)t.push(this.getColumn(n));return new(e.bind.apply(e,ao([void 0],io(t),!1)))},e.prototype.cross=function(t){var n=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===t.rows)for(var r=0;r<this.rows;r++)for(var o=this.getRow(r),i=function(e){var i=t.getColumn(e);n[r][e]=o.reduce((function(t,e,n){return t+e*i[n]}),0)},a=0;a<t.columns;a++)i(a);return new(e.bind.apply(e,ao([void 0],io(n),!1)))},e.prototype.to2D=function(){return this.map((function(t){return[t[0],t[1]]}))},e.prototype.toPoints=function(){return this.map((function(t){return new Om(t[0],t[1])}))},e.prototype.toString=function(){var t=io(this[0],2),e=t[0],n=t[1],r=io(this[1],2),o=r[0],i=r[1],a=io(this[2],2),s=a[0],u=a[1];return"matrix(".concat(e," ").concat(n," ").concat(o," ").concat(i," ").concat(s," ").concat(u,")")},e.prototype.translate=function(t,e){return this.cross(new Cm(t,e))},e.prototype.rotate=function(t){return this.cross(new Nm(t))},e.prototype.scale=function(t,e){return this.cross(new Pm(t,e))},e}(Array),Nm=function(t){function e(n){var r=t.call(this,new Am(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new Am(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new Am(0,0,1))||this;return Object.setPrototypeOf(r,e.prototype),r}return eo(e,t),e.prototype.inverse=function(){return this.transpose()},e}(Dm),Pm=function(t){function e(n,r){var o=t.call(this,new Am(n,0,0),new Am(0,r,0),new Am(0,0,1))||this;return o.sx=n,o.sy=r,Object.setPrototypeOf(o,e.prototype),o}return eo(e,t),e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(Dm),Cm=function(t){function e(n,r){var o=t.call(this,new Am(1,0,0),new Am(0,1,0),new Am(n,r,1))||this;return o.tx=n,o.ty=r,Object.setPrototypeOf(o,e.prototype),o}return eo(e,t),e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(Dm);ce({isolateGlobalState:!0});var Im=function(t){return t.anchors},Lm=function(t,e){for(var n,r=e.nodes,o=r.length-1;o>=0;o--){var i=r[o];if(zm(t,i)){var a=i.getTargetAnchor(t);if(a){var s={node:i,anchorIndex:a.index,anchor:a.anchor};n&&!jm(i,n.node,e)||(n=s)}}}return n},jm=function(t,e,n){return t.zIndex>e.zIndex||n.nodesMap[t.id].index>n.nodesMap[e.id].index},km=function(t,e){for(var n,r=Im(e),o=Number.MAX_SAFE_INTEGER,i=0;i<r.length;i++){var a=Rm(t.x,t.y,r[i].x,r[i].y);a<o&&(o=a,n={index:i,anchor:no(no({},r[i]),{x:r[i].x,y:r[i].y,id:r[i].id})})}return n},Rm=function(t,e,n,r){return Math.hypot(t-n,e-r)},Bm=function(t,e){var n=!1,r=Um(e);return t.x>=r.minX-0&&t.x<=r.maxX+0&&t.y>=r.minY-0&&t.y<=r.maxY+0&&(n=!0),n},zm=function(t,e){var n=!1,r=Um(e);return t.x>=r.minX-5&&t.x<=r.maxX+5&&t.y>=r.minY-5&&t.y<=r.maxY+5&&(n=!0),n},Um=function(t){var e=t.x,n=t.y,r=t.width,o=t.height;return{minX:e-r/2,minY:n-o/2,maxX:e+r/2,maxY:n+o/2,x:e,y:n,width:r,height:o,centerX:e,centerY:n}},Xm=function(t){var e=t,n=e.x,r=e.y,o=e.width,i=e.height,a=e.radius;return[{x:n-o/2+a,y:r-i/2+a,r:a},{x:n+o/2-a,y:r-i/2+a,r:a},{x:n-o/2+a,y:r+i/2-a,r:a},{x:n+o/2-a,y:r+i/2-a,r:a}]},Hm=function(t,e,n){var r,o=Xm(n),i=Number.MAX_SAFE_INTEGER;return o.forEach((function(e){var n=Rm(t.x,t.y,e.x,e.y);n<i&&(i=n,r=e)})),Wm(t,e,r)},Wm=function(e,n,r){var o,i=r.x,a=r.y,s=r.r;if(n===t.SegmentDirection.HORIZONTAL){var u=i-Math.sqrt(s*s-(e.y-a)*(e.y-a)),l=i+Math.sqrt(s*s-(e.y-a)*(e.y-a));o={x:Math.abs(u-e.x)<Math.abs(l-e.x)?u:l,y:e.y}}else if(n===t.SegmentDirection.VERTICAL){var c=a-Math.sqrt(s*s-(e.x-i)*(e.x-i)),p=a+Math.sqrt(s*s-(e.x-i)*(e.x-i)),d=Math.abs(c-e.y)<Math.abs(p-e.y)?c:p;o={x:e.x,y:d}}return o},Gm=function(e,n){var r=Math.abs(e.x-n.x),o=Math.abs(e.y-n.y);return r/n.width>o/n.height?t.SegmentDirection.VERTICAL:t.SegmentDirection.HORIZONTAL},Ym=function(t,e){var n=e,r=!1,o=n.x,i=n.y,a=n.width,s=n.height,u=n.radius,l=o-a/2+u,c=o+a/2-u,p=i-s/2+u,d=i+s/2-u;return t.y===i+s/2||t.y===i-s/2?r=t.x>l&&t.x<c:t.x!==o+a/2&&t.x!==o-a/2||(r=t.y>p&&t.y<d),r},Vm=function(e,n,r){var o,i=r,a=i.x,s=i.y,u=i.rx,l=i.ry;if(n===t.SegmentDirection.HORIZONTAL){var c=a-Math.sqrt(u*u-(e.y-s)*(e.y-s)*u*u/(l*l)),p=a+Math.sqrt(u*u-(e.y-s)*(e.y-s)*u*u/(l*l));o={x:Math.abs(c-e.x)<Math.abs(p-e.x)?c:p,y:e.y}}else if(n===t.SegmentDirection.VERTICAL){var d=s-Math.sqrt(l*l-(e.x-a)*(e.x-a)*l*l/(u*u)),f=s+Math.sqrt(l*l-(e.x-a)*(e.x-a)*l*l/(u*u)),h=Math.abs(d-e.y)<Math.abs(f-e.y)?d:f;o={x:e.x,y:h}}return o},Fm=function(e,n,r){for(var o,i=r.pointsPosition,a=Number.MAX_SAFE_INTEGER,s=[],u=0;u<i.length;u++)s.push({start:i[u],end:i[(u+1)%i.length]});return s.forEach((function(r){var i=r.start,s=r.end,u=i,l=s;i.x>s.x&&(u=s,l=i);var c={x:e.x,y:e.y};if(u.x===l.x&&n===t.SegmentDirection.HORIZONTAL&&(c={x:u.x,y:e.y}),u.y===l.y&&n===t.SegmentDirection.VERTICAL&&(c={x:e.x,y:u.y}),u.x!==l.x&&u.y!==l.y){var p=(l.y-u.y)/(l.x-u.x),d=(u.x*l.y-l.x*u.y)/(u.x-l.x);n===t.SegmentDirection.HORIZONTAL?c={x:(e.y-d)/p,y:e.y}:n===t.SegmentDirection.VERTICAL&&(c={x:e.x,y:p*e.x+d})}if(S_(c,i,s)){var f=Rm(c.x,c.y,e.x,e.y);f<a&&(a=f,o=c)}})),o},Km=function(t){return Gv(t,["id","type","x","y","text","label","properties","virtual","rotate"])},qm=function(t,e,n,r){var o=t.x,i=t.y;return e.x>t.x?o=t.x+n/2:e.x<t.x&&(o=t.x-n/2),e.y>t.y?i=t.y+r/2:e.y<t.y&&(i=t.y-r/2),{x:o,y:i}},Zm=function(t){var e=t.rows,n=t.style,r=t.rowsLength,o=t.className,i=document.createElement("div");i.className=o,i.style.fontSize="".concat(n.fontSize),i.style.width="".concat(n.width),i.style.lineHeight="".concat(n.lineHeight),i.style.padding="".concat(n.padding),n.fontFamily&&(i.style.fontFamily="".concat(n.fontFamily)),r>1?e.forEach((function(t){var e=document.createElement("div");e.textContent=t,i.appendChild(e)})):i.textContent=e[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},$m=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,o=0;return e&&e.forEach((function(t){var e=sm(t);o=e>o?e:o})),{width:Math.ceil(o/2)*r+r/4,height:n*(r+2)+r/4}},Jm=function(t){return"object"!=typeof t?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let Qm;const tb=new Uint8Array(16);function eb(){if(!Qm&&(Qm="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qm))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qm(tb)}var nb=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const rb=[];for(let t=0;t<256;++t)rb.push((t+256).toString(16).slice(1));function ob(t,e=0){return rb[t[e+0]]+rb[t[e+1]]+rb[t[e+2]]+rb[t[e+3]]+"-"+rb[t[e+4]]+rb[t[e+5]]+"-"+rb[t[e+6]]+rb[t[e+7]]+"-"+rb[t[e+8]]+rb[t[e+9]]+"-"+rb[t[e+10]]+rb[t[e+11]]+rb[t[e+12]]+rb[t[e+13]]+rb[t[e+14]]+rb[t[e+15]]}function ib(t){if(!function(t){return"string"==typeof t&&nb.test(t)}(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}function ab(t,e,n){function r(t,r,o,i){var a;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof r&&(r=ib(r)),16!==(null===(a=r)||void 0===a?void 0:a.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+t.length);if(s.set(r),s.set(t,r.length),s=n(s),s[6]=15&s[6]|e,s[8]=63&s[8]|128,o){i=i||0;for(let t=0;t<16;++t)o[i+t]=s[t];return o}return ob(s)}try{r.name=t}catch(t){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function sb(t){return 14+(t+64>>>9<<4)+1}function ub(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function lb(t,e,n,r,o,i){return ub((a=ub(ub(e,t),ub(r,i)))<<(s=o)|a>>>32-s,n);var a,s}function cb(t,e,n,r,o,i,a){return lb(e&n|~e&r,t,e,o,i,a)}function pb(t,e,n,r,o,i,a){return lb(e&r|n&~r,t,e,o,i,a)}function db(t,e,n,r,o,i,a){return lb(e^n^r,t,e,o,i,a)}function fb(t,e,n,r,o,i,a){return lb(n^(e|~r),t,e,o,i,a)}ab("v3",48,(function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return function(t){const e=[],n=32*t.length,r="0123456789abcdef";for(let o=0;o<n;o+=8){const n=t[o>>5]>>>o%32&255,i=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);e.push(i)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[sb(e)-1]=e;let n=1732584193,r=-271733879,o=-1732584194,i=271733878;for(let e=0;e<t.length;e+=16){const a=n,s=r,u=o,l=i;n=cb(n,r,o,i,t[e],7,-680876936),i=cb(i,n,r,o,t[e+1],12,-389564586),o=cb(o,i,n,r,t[e+2],17,606105819),r=cb(r,o,i,n,t[e+3],22,-1044525330),n=cb(n,r,o,i,t[e+4],7,-176418897),i=cb(i,n,r,o,t[e+5],12,1200080426),o=cb(o,i,n,r,t[e+6],17,-1473231341),r=cb(r,o,i,n,t[e+7],22,-45705983),n=cb(n,r,o,i,t[e+8],7,1770035416),i=cb(i,n,r,o,t[e+9],12,-1958414417),o=cb(o,i,n,r,t[e+10],17,-42063),r=cb(r,o,i,n,t[e+11],22,-1990404162),n=cb(n,r,o,i,t[e+12],7,1804603682),i=cb(i,n,r,o,t[e+13],12,-40341101),o=cb(o,i,n,r,t[e+14],17,-1502002290),r=cb(r,o,i,n,t[e+15],22,1236535329),n=pb(n,r,o,i,t[e+1],5,-165796510),i=pb(i,n,r,o,t[e+6],9,-1069501632),o=pb(o,i,n,r,t[e+11],14,643717713),r=pb(r,o,i,n,t[e],20,-373897302),n=pb(n,r,o,i,t[e+5],5,-701558691),i=pb(i,n,r,o,t[e+10],9,38016083),o=pb(o,i,n,r,t[e+15],14,-660478335),r=pb(r,o,i,n,t[e+4],20,-405537848),n=pb(n,r,o,i,t[e+9],5,568446438),i=pb(i,n,r,o,t[e+14],9,-1019803690),o=pb(o,i,n,r,t[e+3],14,-187363961),r=pb(r,o,i,n,t[e+8],20,1163531501),n=pb(n,r,o,i,t[e+13],5,-1444681467),i=pb(i,n,r,o,t[e+2],9,-51403784),o=pb(o,i,n,r,t[e+7],14,1735328473),r=pb(r,o,i,n,t[e+12],20,-1926607734),n=db(n,r,o,i,t[e+5],4,-378558),i=db(i,n,r,o,t[e+8],11,-2022574463),o=db(o,i,n,r,t[e+11],16,1839030562),r=db(r,o,i,n,t[e+14],23,-35309556),n=db(n,r,o,i,t[e+1],4,-1530992060),i=db(i,n,r,o,t[e+4],11,1272893353),o=db(o,i,n,r,t[e+7],16,-155497632),r=db(r,o,i,n,t[e+10],23,-1094730640),n=db(n,r,o,i,t[e+13],4,681279174),i=db(i,n,r,o,t[e],11,-358537222),o=db(o,i,n,r,t[e+3],16,-722521979),r=db(r,o,i,n,t[e+6],23,76029189),n=db(n,r,o,i,t[e+9],4,-640364487),i=db(i,n,r,o,t[e+12],11,-421815835),o=db(o,i,n,r,t[e+15],16,530742520),r=db(r,o,i,n,t[e+2],23,-995338651),n=fb(n,r,o,i,t[e],6,-198630844),i=fb(i,n,r,o,t[e+7],10,1126891415),o=fb(o,i,n,r,t[e+14],15,-1416354905),r=fb(r,o,i,n,t[e+5],21,-57434055),n=fb(n,r,o,i,t[e+12],6,1700485571),i=fb(i,n,r,o,t[e+3],10,-1894986606),o=fb(o,i,n,r,t[e+10],15,-1051523),r=fb(r,o,i,n,t[e+1],21,-2054922799),n=fb(n,r,o,i,t[e+8],6,1873313359),i=fb(i,n,r,o,t[e+15],10,-30611744),o=fb(o,i,n,r,t[e+6],15,-1560198380),r=fb(r,o,i,n,t[e+13],21,1309151649),n=fb(n,r,o,i,t[e+4],6,-145523070),i=fb(i,n,r,o,t[e+11],10,-1120210379),o=fb(o,i,n,r,t[e+2],15,718787259),r=fb(r,o,i,n,t[e+9],21,-343485551),n=ub(n,a),r=ub(r,s),o=ub(o,u),i=ub(i,l)}return[n,r,o,i]}(function(t){if(0===t.length)return[];const e=8*t.length,n=new Uint32Array(sb(e));for(let r=0;r<e;r+=8)n[r>>5]|=(255&t[r/8])<<r%32;return n}(t),8*t.length))}));var hb={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function vb(t,e,n){if(hb.randomUUID&&!e&&!t)return hb.randomUUID();const r=(t=t||{}).random||(t.rng||eb)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return ob(r)}function yb(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function gb(t,e){return t<<e|t>>>32-e}ab("v5",80,(function(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const r=t.length/4+2,o=Math.ceil(r/16),i=new Array(o);for(let e=0;e<o;++e){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=t[64*e+4*r]<<24|t[64*e+4*r+1]<<16|t[64*e+4*r+2]<<8|t[64*e+4*r+3];i[e]=n}i[o-1][14]=8*(t.length-1)/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<o;++t){const r=new Uint32Array(80);for(let e=0;e<16;++e)r[e]=i[t][e];for(let t=16;t<80;++t)r[t]=gb(r[t-3]^r[t-8]^r[t-14]^r[t-16],1);let o=n[0],a=n[1],s=n[2],u=n[3],l=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),i=gb(o,5)+yb(n,a,s,u)+l+e[n]+r[t]>>>0;l=u,u=s,s=gb(a,30)>>>0,a=o,o=i}n[0]=n[0]+o>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+u>>>0,n[4]=n[4]+l>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var _b=function(){return vb()},mb=function(t,e){void 0===e&&(e="");var n=t.nodes.reduce((function(t,n){return t[n.id]=e+vb(),n.id=t[n.id],t}),{});return t.edges.forEach((function(t){t.id=e+vb(),t.sourceNodeId=n[t.sourceNodeId],t.targetNodeId=n[t.targetNodeId]})),t},bb=new Map,Eb=function(t){var e=_b();var n=window.requestAnimationFrame((function n(){if(t(),bb.get(e)){var r=window.requestAnimationFrame(n);bb.set(e,r)}}));return bb.set(e,n),e},xb=function(t){var e=bb.get(t);e&&(window.cancelAnimationFrame(e),bb.delete(t))},Mb=100,wb={x:1,y:0,z:0};function Sb(t,e,n,r,o){for(var i=function(o){if(o<0||o>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-o,3)+3*e.x*o*Math.pow(1-o,2)+3*n.x*Math.pow(o,2)*(1-o)+r.x*Math.pow(o,3),y:t.y*Math.pow(1-o,3)+3*e.y*o*Math.pow(1-o,2)+3*n.y*Math.pow(o,2)*(1-o)+r.y*Math.pow(o,3)}},a=0,s=2,u=r.x,l=r.y,c=r;a<o&&s<50;){var p=(c=i(1-s/Mb)).x,d=c.y;a=Rm(u,l,p,d),s++}return c}function Tb(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function Ab(t){return function(t,e){var n=function(t,e){return t.x*e.y-t.y*e.x}(t,e),r=Math.acos(function(t,e){var n=[t.x,t.y,t.z];return[e.x,e.y,e.z].reduce((function(t,e,r){return t+e*n[r]}))}(Tb(t),Tb(e)));return n>=0?r:-r}(wb,t)}function Ob(t){return t*(180/Math.PI)}var Db={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},Nb=function(t){var e=up(Db);return t&&(e=Yh(e,t)),e},Pb=Nb,Cb=1e3,Ib=999,Lb=function(){return++Cb},jb=function(){return--Ib},kb=Object.freeze({__proto__:null,Matrix:Dm,Point:Om,RotateMatrix:Nm,ScaleMatrix:Pm,StepDrag:__,TranslateMatrix:Cm,Vector:Am,action:te,cancelRaf:xb,computed:rt,configure:ce,costByPoints:H_,createEdgeGenerator:_m,createRaf:Eb,createUuid:_b,defaultAnimationOffConfig:o_,defaultAnimationOnConfig:i_,defaultTheme:Db,degrees:Ob,distance:Rm,estimateDistance:X_,filterRepeatPoints:D_,formatAnchorConnectValidateData:Jm,formatData:l_,getAnchors:Im,getAppendAttributes:cm,getBBoxCrossPointsByPoint:U_,getBBoxOfPoints:j_,getBBoxXCrossPoints:B_,getBBoxYCrossPoints:z_,getBezierControlPoints:pm,getBezierPoints:dm,getBoxByOriginNode:Z_,getBytesLength:sm,getClosestAnchor:km,getClosestPointOfPolyline:vm,getClosestRadiusCenter:Hm,getCrossPointInRect:nm,getCrossPointWithCircle:Wm,getCrossPointWithEllipse:Vm,getCrossPointWithPolygon:Fm,getEndTangent:hm,getExpandedBBox:P_,getExpandedBBoxPoint:I_,getGridOffset:Em,getHtmlTextHeight:Zm,getLongestEdge:Q_,getMinIndex:jb,getNextNeighborPoints:K_,getNodeAnchorPosition:qm,getNodeBBox:Um,getPointsFromBBox:k_,getPolylinePoints:J_,getRectRadiusCircle:Xm,getSimplePoints:im,getSimplePolyline:N_,getSvgTextSize:mm,getSvgTextWidthHeight:$m,getTextWidth:lm,getThetaOfVector:Ab,getZIndex:Lb,heuristicCostEstimate:W_,inStraightLineOfRect:Ym,isBboxOverLapping:O_,isIe:u_,isInNode:Bm,isInNodeBbox:zm,isMultipleSelect:wm,isObservable:we,isPointInArea:Mm,isPointOutsideBBox:R_,isSegmentCrossingBBox:F_,isSegmentsCrossNode:em,isSegmentsInNode:tm,isSegmentsIntersected:V_,mergeBBox:L_,normalizePolygon:xm,observable:$,pathFinder:q_,pickEdgeConfig:ym,pickNodeConfig:Km,pointDirection:C_,pointEdgeDirection:Gm,pointFilter:$_,points2PointsList:om,reaction:ae,rebuildPath:G_,refreshGraphId:mb,removeClosePointFromOpenList:Y_,sampleCubic:Sb,segmentDirection:rm,setupAnimation:a_,setupEdgeModel:A_,setupTheme:Nb,snapToGrid:bm,targetNodeInfo:Lm,toJS:Le,twoPointDistance:gm,updateAnimation:s_,updateTheme:Pb}),Rb=function(){function e(e,n){this.BaseType=t.ElementType.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=t.TextMode.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.properties={},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=t.ElementState.DEFAULT,this.modelType=t.ModelType.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=n,this.initEdgeData(e),this.setAttributes()}return e.prototype.initEdgeData=function(e){if(e.properties||(e.properties={}),!e.id){var n=this.graphModel.idGenerator,r=n&&n(e.type),o=this.createId();e.id=o||r||_b()}this.arrowConfig.markerEnd="url(#marker-end-".concat(e.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(e.id,")");var i=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=i,Ls(this,ym(e)),this.graphModel.overlapMode===t.OverlapMode.INCREASE&&(this.zIndex=e.zIndex||Lb()),this.setAnchors(),this.initPoints(),this.formatText(e)},e.prototype.setAttributes=function(){},e.prototype.createId=function(){return null},e.prototype.getEdgeStyle=function(){return no(no({},this.graphModel.theme.baseEdge),this.style)},e.prototype.getAdjustPointStyle=function(){return no({},this.graphModel.theme.edgeAdjust)},e.prototype.getTextStyle=function(){return up(this.graphModel.theme.edgeText)},e.prototype.getEdgeAnimationStyle=function(){return up(this.graphModel.theme.edgeAnimation)},e.prototype.getArrowStyle=function(){var t=this.getEdgeStyle(),e=this.getEdgeAnimationStyle(),n=this.graphModel.theme.arrow,r=this.isAnimation?e.stroke:t.stroke;return no(no(no({},t),{fill:r,stroke:r}),n)},e.prototype.getOutlineStyle=function(){return up(this.graphModel.theme.outline)},e.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(e.prototype,"sourceNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.sourceNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"targetNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.targetNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),e.prototype.getBeginAnchor=function(t,e,n){var r,o,i=Im(t);if(n){if(r=vf(i,(function(t){return t.id===n})))return r;console.warn("未在节点上找到指定的起点锚点".concat(n,",已使用默认锚点作为起点"))}return i.forEach((function(t){var n=gm(t,e);(void 0===o||n<o)&&(o=n,r=t)})),r},e.prototype.getEndAnchor=function(t,e){var n,r,o=this,i=Im(t);if(e){if(n=vf(i,(function(t){return t.id===e})))return n;console.warn("未在节点上找到指定的终点锚点".concat(e,",已使用默认锚点作为终点"))}return i.forEach((function(t){if(o.startPoint){var e=gm(t,o.startPoint);(void 0===r||e<r)&&(r=e,n=t)}})),n},e.prototype.getProperties=function(){return Le(this.properties)},e.prototype.getData=function(){var e=this.properties;we(e)&&(e=Le(e));var n={id:this.id,type:this.type,properties:e,sourceNodeId:this.sourceNode.id,targetNodeId:this.targetNode.id,startPoint:Ls({},this.startPoint),endPoint:Ls({},this.endPoint)};this.graphModel.overlapMode===t.OverlapMode.INCREASE&&(n.zIndex=this.zIndex);var r=this.text,o=r.x,i=r.y,a=r.value;return a&&(n.text={x:o,y:i,value:a}),n},e.prototype.getHistoryData=function(){return this.getData()},e.prototype.setProperty=function(t,e){this.properties[t]=l_(e),this.setAttributes()},e.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},e.prototype.setProperties=function(t){this.properties=no(no({},Le(this.properties)),l_(t)),this.setAttributes()},e.prototype.changeEdgeId=function(t){var e=this.arrowConfig,n=e.markerEnd,r=e.markerStart;r&&r==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(t,")")),n&&n==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(t,")")),this.id=t},e.prototype.setStyle=function(t,e){var n;this.style=no(no({},this.style),((n={})[t]=l_(e),n))},e.prototype.setStyles=function(t){this.style=no(no({},this.style),l_(t))},e.prototype.updateStyles=function(t){this.style=no({},l_(t))},e.prototype.setTextMode=function(t){this.textMode=t},e.prototype.formatText=function(t){var e,n,r,o=this.textPosition,i=o.x,a=o.y,s=t.text,u={value:"",x:i,y:a,draggable:!1,editable:!0};s&&("string"==typeof s?u=no(no({},u),{value:s}):(u=no(no({},u),{x:null!==(e=s.x)&&void 0!==e?e:i,y:null!==(n=s.y)&&void 0!==n?n:a,value:null!==(r=s.value)&&void 0!==r?r:""}),Dh(s.draggable)||(u.draggable=s.draggable),Dh(s.editable)||(u.editable=s.editable))),this.text=u},e.prototype.resetTextPosition=function(){var t=this.textPosition,e=t.x,n=t.y;this.text.x=e,this.text.y=n},e.prototype.moveText=function(t,e){var n=this.text,r=n.x,o=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,editable:s,draggable:a,x:r+t,y:o+e}},e.prototype.setText=function(t){t&&Ls(this.text,t)},e.prototype.updateText=function(t){this.text=no(no({},Le(this.text)),{value:t})},e.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){if(!(t=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId)))throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:t.x,y:t.y}),this.sourceAnchorId||(this.sourceAnchorId=t.id)}if(!this.targetAnchorId||!this.endPoint){var t;if(!(t=this.getEndAnchor(this.targetNode,this.targetAnchorId)))throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:t.x,y:t.y}),this.targetAnchorId||(this.targetAnchorId=t.id)}},e.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},e.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t},e.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},e.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},e.prototype.openEdgeAnimation=function(){this.isAnimation=!0},e.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},e.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},e.prototype.updateStartPoint=function(t){this.startPoint=t},e.prototype.moveStartPoint=function(t,e){this.startPoint&&(this.startPoint.x+=t,this.startPoint.y+=e)},e.prototype.updateEndPoint=function(t){this.endPoint=t},e.prototype.moveEndPoint=function(t,e){this.endPoint&&(this.endPoint.x+=t,this.endPoint.y+=e)},e.prototype.setZIndex=function(t){void 0===t&&(t=0),this.zIndex=t},e.prototype.initPoints=function(){},e.prototype.updateAttributes=function(t){Ls(this,t)},e.prototype.getAdjustStart=function(){return this.startPoint},e.prototype.getAdjustEnd=function(){return this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint;this.updateStartPoint({x:e.x,y:e.y}),this.updateEndPoint({x:n.x,y:n.y})},e.BaseType=t.ElementType.EDGE,oo([$],e.prototype,"type",void 0),oo([$],e.prototype,"sourceNodeId",void 0),oo([$],e.prototype,"targetNodeId",void 0),oo([$],e.prototype,"startPoint",void 0),oo([$],e.prototype,"endPoint",void 0),oo([$],e.prototype,"textMode",void 0),oo([$],e.prototype,"text",void 0),oo([$],e.prototype,"properties",void 0),oo([$],e.prototype,"points",void 0),oo([$],e.prototype,"pointsList",void 0),oo([$],e.prototype,"isSelected",void 0),oo([$],e.prototype,"isHovered",void 0),oo([$],e.prototype,"isHitable",void 0),oo([$],e.prototype,"isHittable",void 0),oo([$],e.prototype,"draggable",void 0),oo([$],e.prototype,"visible",void 0),oo([$],e.prototype,"isAnimation",void 0),oo([$],e.prototype,"isShowAdjustPoint",void 0),oo([$],e.prototype,"zIndex",void 0),oo([$],e.prototype,"state",void 0),oo([$],e.prototype,"style",void 0),oo([$],e.prototype,"arrowConfig",void 0),oo([rt],e.prototype,"sourceNode",null),oo([rt],e.prototype,"targetNode",null),oo([rt],e.prototype,"textPosition",null),oo([te],e.prototype,"setProperty",null),oo([te],e.prototype,"deleteProperty",null),oo([te],e.prototype,"setProperties",null),oo([te],e.prototype,"changeEdgeId",null),oo([te],e.prototype,"setStyle",null),oo([te],e.prototype,"setStyles",null),oo([te],e.prototype,"updateStyles",null),oo([te],e.prototype,"setTextMode",null),oo([te],e.prototype,"formatText",null),oo([te],e.prototype,"resetTextPosition",null),oo([te],e.prototype,"moveText",null),oo([te],e.prototype,"setText",null),oo([te],e.prototype,"updateText",null),oo([te],e.prototype,"setAnchors",null),oo([te],e.prototype,"setSelected",null),oo([te],e.prototype,"setHovered",null),oo([te],e.prototype,"setHitable",null),oo([te],e.prototype,"setHittable",null),oo([te],e.prototype,"openEdgeAnimation",null),oo([te],e.prototype,"closeEdgeAnimation",null),oo([te],e.prototype,"setElementState",null),oo([te],e.prototype,"updateStartPoint",null),oo([te],e.prototype,"moveStartPoint",null),oo([te],e.prototype,"updateEndPoint",null),oo([te],e.prototype,"moveEndPoint",null),oo([te],e.prototype,"setZIndex",null),oo([te],e.prototype,"initPoints",null),oo([te],e.prototype,"updateAttributes",null),oo([te],e.prototype,"getAdjustStart",null),oo([te],e.prototype,"getAdjustEnd",null),oo([te],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(),Bb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.BEZIER_EDGE,o.path="",o.initEdgeData(n),o.setAttributes(),o}return eo(n,e),n.prototype.initEdgeData=function(t){this.offset=100,e.prototype.initEdgeData.call(this,t)},n.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.bezier,n=e.prototype.getEdgeStyle.call(this);return no(no({},n),up(t))},n.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var t=0,e=0;return this.pointsList.forEach((function(n){var r=n.x,o=n.y;t+=r,e+=o})),{x:t/this.pointsList.length,y:e/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},n.prototype.getData=function(){var t=e.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return no(no({},t),{pointsList:n})},n.prototype.getControls=function(){var t=this.startPoint,e=this.endPoint;return pm({start:t,end:e,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})},n.prototype.getPath=function(t){var e=io(t,4),n=e[0],r=e[1],o=e[2],i=e[3];return"M ".concat(n.x," ").concat(n.y,"\n C ").concat(r.x," ").concat(r.y,",\n ").concat(o.x," ").concat(o.y,",\n ").concat(i.x," ").concat(i.y)},n.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},n.prototype.updatePoints=function(){var t=this.getControls(),e=t.sNext,n=t.ePre;this.updatePath(e,n)},n.prototype.updatePath=function(t,e){t=up(t),e=up(e);var n={x:this.startPoint.x,y:this.startPoint.y},r={x:this.endPoint.x,y:this.endPoint.y};if(!t||!e){var o=this.getControls();t=o.sNext,e=o.ePre}this.pointsList=[n,t,e,r],this.path=this.getPath(this.pointsList)},n.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},n.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},n.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e;var n=io(this.pointsList,3),r=n[1],o=n[2];r.x+=t,r.y+=e,this.updatePath(r,o)},n.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e;var n=io(this.pointsList,3),r=n[1],o=n[2];o.x+=t,o.y+=e,this.updatePath(r,o)},n.prototype.updateAdjustAnchor=function(t,e){var n;"sNext"===e?this.pointsList[1]=t:"ePre"===e&&(this.pointsList[2]=t),this.path=this.getPath(this.pointsList),(null===(n=this.text)||void 0===n?void 0:n.value)&&this.setText(Ls({},this.text,this.textPosition))},n.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},n.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},n.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,r=t.sourceNode,o=t.targetNode,i=pm({start:e,end:n,sourceNode:r,targetNode:o,offset:this.offset}),a=i.sNext,s=i.ePre;this.pointsList=[e,a,s,n],this.initPoints()},oo([$],n.prototype,"path",void 0),oo([te],n.prototype,"initPoints",null),oo([te],n.prototype,"updatePoints",null),oo([te],n.prototype,"updateStartPoint",null),oo([te],n.prototype,"updateEndPoint",null),oo([te],n.prototype,"moveStartPoint",null),oo([te],n.prototype,"moveEndPoint",null),oo([te],n.prototype,"updateAdjustAnchor",null),oo([te],n.prototype,"getAdjustStart",null),oo([te],n.prototype,"getAdjustEnd",null),oo([te],n.prototype,"updateAfterAdjustStartAndEnd",null),n}(Rb),zb=function(e){function n(){var n=e.apply(this,ao([],io(arguments),!1))||this;return n.modelType=t.ModelType.LINE_EDGE,n}return eo(n,e),n.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.line,n=e.prototype.getEdgeStyle.call(this);return no(no({},n),up(t))},n.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},n}(Rb),Ub=function(e){function n(){var n=e.apply(this,ao([],io(arguments),!1))||this;return n.modelType=t.ModelType.POLYLINE_EDGE,n.draggingPointList=[],n}return eo(n,e),n.prototype.initEdgeData=function(t){this.offset=30,e.prototype.initEdgeData.call(this,t)},n.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.polyline,n=e.prototype.getEdgeStyle.call(this);return no(no({},n),up(t))},n.prototype.getTextPosition=function(){var t,e=null===(t=this.text)||void 0===t?void 0:t.value;if(this.dbClickPosition&&!e){var n=this.dbClickPosition;return{x:n.x,y:n.y}}var r=om(this.points),o=io(Q_(r),2),i=o[0],a=o[1];return{x:(i.x+a.x)/2,y:(i.y+a.y)/2}},n.prototype.getAfterAnchor=function(e,n,r){var o,i;return r.forEach((function(r){var a;e===t.SegmentDirection.HORIZONTAL?a=Math.abs(n.y-r.y):e===t.SegmentDirection.VERTICAL&&(a=Math.abs(n.x-r.x)),(!i||i>a)&&(i=a,o=r)})),o},n.prototype.getCrossPoint=function(e,n,r){var o;return e===t.SegmentDirection.HORIZONTAL?o={x:r.x,y:n.y}:e===t.SegmentDirection.VERTICAL&&(o={x:n.x,y:r.y}),o},n.prototype.removeCrossPoints=function(t,e,n){var r=n.map((function(t){return t}));if(1===t){var o=r[t],i=r[e],a=r[t-1];if(tm(a,o,this.sourceNode)){if(em(o,i,this.sourceNode))(s=nm(o,i,this.sourceNode))&&(r[t]=s,r.splice(t-1,1),t--,e--)}else this.sourceNode.anchors.forEach((function(e){(e.x===a.x&&e.x===o.x||e.y===a.y&&e.y===o.y)&&(Rm(e.x,e.y,o.x,o.y)<Rm(a.x,a.y,o.x,o.y)&&(r[t-1]=e))}))}if(e===n.length-2){var s,u=r[t],l=r[e],c=r[e+1];if(tm(l,c,this.targetNode)){if(em(u,l,this.targetNode))(s=nm(u,l,this.targetNode))&&(r[e]=s,r.splice(e+1,1))}else this.targetNode.anchors.forEach((function(t){(t.x===c.x&&t.x===l.x||t.y===c.y&&t.y===l.y)&&(Rm(t.x,t.y,l.x,l.y)<Rm(c.x,c.y,l.x,l.y)&&(r[e+1]=t))}))}return r},n.prototype.getDraggingPoints=function(t,e,n,r,o){var i=o.map((function(t){return t})),a=this.getAfterAnchor(t,n,r),s=this.getCrossPoint(t,n,a);return"start"===e?(i.unshift(s),i.unshift(a)):(i.push(s),i.push(a)),i},n.prototype.updateCrossPoints=function(e){var n=e.map((function(t){return t})),r=e[0],o=e[1],i=e[n.length-2],a=e[n.length-1],s=this.sourceNode,u=this.targetNode,l=s.modelType,c=u.modelType,p=rm(r,o),d=n[0];switch(l){case t.ModelType.RECT_NODE:if(0!==s.radius)Ym(r,s)||(d=Hm(r,p,s));break;case t.ModelType.CIRCLE_NODE:d=Wm(r,p,s);break;case t.ModelType.ELLIPSE_NODE:d=Vm(r,p,s);break;case t.ModelType.DIAMOND_NODE:case t.ModelType.POLYGON_NODE:d=Fm(r,p,s)}d&&(n[0]=d);var f=rm(i,a),h=n[n.length-1];switch(c){case t.ModelType.RECT_NODE:if(0!==u.radius)Ym(a,u)||(h=Hm(a,f,u));break;case t.ModelType.CIRCLE_NODE:h=Wm(a,f,u);break;case t.ModelType.ELLIPSE_NODE:h=Vm(a,f,u);break;case t.ModelType.DIAMOND_NODE:case t.ModelType.POLYGON_NODE:h=Fm(a,f,u)}return h&&(n[n.length-1]=h),n},n.prototype.getData=function(){var t=e.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return Object.assign({},t,{pointsList:n})},n.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.pointsList.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" "):this.updatePoints()},n.prototype.updatePoints=function(){var t=J_({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=t,this.points=t.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},n.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},n.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e,this.updatePoints()},n.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},n.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e,this.updatePoints()},n.prototype.updatePointsList=function(t,e){this.pointsList.forEach((function(n){n.x+=t,n.y+=e}));var n=this.pointsList[0];this.startPoint=Object.assign({},n);var r=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},r),this.initPoints()},n.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map((function(t){return t}))},n.prototype.dragAppendSimple=function(e,n){var r;this.isDragging=!0;var o=e.start,i=e.end,a=e.startIndex,s=e.endIndex,u=e.direction,l=this.pointsList,c=l;return u===t.SegmentDirection.HORIZONTAL?(l[a]={x:o.x,y:o.y+n.y},l[s]={x:i.x,y:i.y+n.y},c=this.pointsList.map((function(t){return t}))):u===t.SegmentDirection.VERTICAL&&(l[a]={x:o.x+n.x,y:o.y},l[s]={x:i.x+n.x,y:i.y},c=this.pointsList.map((function(t){return t}))),this.updatePointsAfterDrag(c),this.draggingPointList=c,(null===(r=this.text)||void 0===r?void 0:r.value)&&this.setText(Ls({},this.text,this.textPosition)),{start:Ls({},l[a]),end:Ls({},l[s]),startIndex:a,endIndex:s,direction:u}},n.prototype.dragAppend=function(e,n){var r;this.isDragging=!0;var o=e.start,i=e.end,a=e.startIndex,s=e.endIndex,u=e.direction,l=this.pointsList;if(u===t.SegmentDirection.HORIZONTAL){l[a]={x:o.x,y:o.y+n.y},l[s]={x:i.x,y:i.y+n.y};var c=this.pointsList.map((function(t){return t}));if(0!==a&&s!==this.pointsList.length-1&&(c=this.removeCrossPoints(a,s,c)),0===a){var p={x:o.x,y:o.y+n.y};if(!Bm(p,this.sourceNode)){var d=this.sourceNode.anchors;c=this.getDraggingPoints(u,"start",p,d,c)}}if(s===this.pointsList.length-1){var f={x:i.x,y:i.y+n.y};if(!Bm(f,this.targetNode)){d=this.targetNode.anchors;c=this.getDraggingPoints(u,"end",f,d,c)}}this.updatePointsAfterDrag(c),this.draggingPointList=c}else if(u===t.SegmentDirection.VERTICAL){l[a]={x:o.x+n.x,y:o.y},l[s]={x:i.x+n.x,y:i.y};c=this.pointsList.map((function(t){return t}));if(0!==a&&s!==this.pointsList.length-1&&(c=this.removeCrossPoints(a,s,c)),0===a){p={x:o.x+n.x,y:o.y};if(!Bm(p,this.sourceNode)){d=this.sourceNode.anchors;c=this.getDraggingPoints(u,"start",p,d,c)}}if(s===this.pointsList.length-1){f={x:i.x+n.x,y:i.y};if(!Bm(f,this.targetNode)){d=this.targetNode.anchors;c=this.getDraggingPoints(u,"end",f,d,c)}}this.updatePointsAfterDrag(c),this.draggingPointList=c}return(null===(r=this.text)||void 0===r?void 0:r.value)&&this.setText(Ls({},this.text,this.textPosition)),{start:Ls({},l[a]),end:Ls({},l[s]),startIndex:a,endIndex:s,direction:u}},n.prototype.dragAppendEnd=function(){if(this.draggingPointList){var t=$_(om(this.points));this.pointsList=t.map((function(t){return t})),this.draggingPointList=[];var e=t[0];this.startPoint=Ls({},e);var n=t[t.length-1];this.endPoint=Ls({},n)}this.isDragging=!1},n.prototype.updatePointsAfterDrag=function(t){var e=this.updateCrossPoints(t);this.points=e.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},n.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},n.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},n.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,r=t.sourceNode,o=t.targetNode;this.pointsList=J_({x:e.x,y:e.y},{x:n.x,y:n.y},r,o,this.offset||0),this.initPoints()},oo([$],n.prototype,"dbClickPosition",void 0),oo([te],n.prototype,"initPoints",null),oo([te],n.prototype,"updatePoints",null),oo([te],n.prototype,"updateStartPoint",null),oo([te],n.prototype,"moveStartPoint",null),oo([te],n.prototype,"updateEndPoint",null),oo([te],n.prototype,"moveEndPoint",null),oo([te],n.prototype,"updatePointsList",null),oo([te],n.prototype,"dragAppendStart",null),oo([te],n.prototype,"dragAppendSimple",null),oo([te],n.prototype,"dragAppend",null),oo([te],n.prototype,"dragAppendEnd",null),oo([te],n.prototype,"updatePointsAfterDrag",null),oo([te],n.prototype,"getAdjustStart",null),oo([te],n.prototype,"getAdjustEnd",null),oo([te],n.prototype,"updateAfterAdjustStartAndEnd",null),n}(Rb),Xb=function(){function e(e,n){this.BaseType=t.ElementType.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=t.TextMode.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.properties={},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.enableRotate=!0,this.enableResize=!0,this.zIndex=1,this.state=t.ElementState.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=t.ModelType.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=n,this.properties=e.properties||{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t;var e=this.x,n=void 0===e?0:e,r=this.y,o=void 0===r?0:r;this.transform=new Cm(-n,-o).rotate(t).translate(n,o).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),e.prototype.initNodeData=function(e){if(e.properties||(e.properties={}),!e.id){var n=this.graphModel.idGenerator,r=n&&n(e.type),o=this.createId();e.id=o||r||_b()}this.formatText(e),Ls(this,Km(e)),this.graphModel.overlapMode===t.OverlapMode.INCREASE&&(this.zIndex=e.zIndex||Lb())},e.prototype.setAttributes=function(){},e.prototype.createId=function(){return null},e.prototype.setTextMode=function(t){this.textMode=t},e.prototype.formatText=function(t){var e,n,r,o=t.x,i=t.y,a=t.text,s={value:"",x:o,y:i,draggable:!1,editable:!0};a&&("string"==typeof a?s.value=a:(s=no(no({},s),{x:null!==(e=a.x)&&void 0!==e?e:o,y:null!==(n=a.y)&&void 0!==n?n:i,value:null!==(r=a.value)&&void 0!==r?r:""}),Dh(a.draggable)||(s.draggable=a.draggable),Dh(a.editable)||(s.draggable=a.draggable))),t.text=s},e.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.width=e,this.height=n,this.setProperties({width:e,height:n}),this.getData()},e.prototype.proportionalResize=function(){},e.prototype.getData=function(){var e=this.text,n=e.x,r=e.y,o=e.value,i=this.properties;we(i)&&(i=Le(i));var a={id:this.id,type:this.type,x:this.x,y:this.y,properties:i};return this.rotate&&(a.rotate=this.rotate),this.graphModel.overlapMode===t.OverlapMode.INCREASE&&(a.zIndex=this.zIndex),o&&(a.text={x:n,y:r,value:o}),a},e.prototype.getHistoryData=function(){return this.getData()},e.prototype.getProperties=function(){return Le(this.properties)},e.prototype.getOuterGAttributes=function(){return{className:""}},e.prototype.getNodeStyle=function(){return no(no({},this.graphModel.theme.baseNode),this.style)},e.prototype.getTextStyle=function(){return up(this.graphModel.theme.nodeText)},e.prototype.getRotateControlStyle=function(){return up(this.graphModel.theme.rotateControl)},e.prototype.getResizeControlStyle=function(){return up(this.graphModel.theme.resizeControl)},e.prototype.getResizeOutlineStyle=function(){return up(this.graphModel.theme.resizeOutline)},e.prototype.getAnchorStyle=function(t){return up(this.graphModel.theme.anchor)},e.prototype.getAnchorLineStyle=function(t){return up(this.graphModel.theme.anchorLine)},e.prototype.getOutlineStyle=function(){return up(this.graphModel.theme.outline)},e.prototype.isAllowConnectedAsSource=function(t,e,n,r){var o=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var i=!0,a="",s=0;s<o.length;s++){var u=o[s];if(!u.validate.call(this,this,t,e,n,r)){i=!1,a=u.message;break}}return{isAllPass:i,msg:a}},e.prototype.getConnectedSourceRules=function(){return this.sourceRules},e.prototype.isAllowConnectedAsTarget=function(t,e,n,r){var o=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var i=!0,a="",s=0;s<o.length;s++){var u=o[s];if(!u.validate.call(this,t,this,e,n,r)){i=!1,a=u.message;break}}return{isAllPass:i,msg:a}},e.prototype.isAllowMoveNode=function(t,e){var n,r,o=!0,i=!0,a=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),u=s.next();!u.done;u=s.next()){var l=(0,u.value)(this,t,e);if(!l)return!1;if("object"==typeof l){var c=l;if(!c.x&&!c.y)return!1;o=o&&c.x,i=i&&c.y}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return{x:o,y:i}},e.prototype.getConnectedTargetRules=function(){return this.targetRules},e.prototype.getAnchorsByOffset=function(){var t=this,e=t.anchorsOffset,n=t.id,r=t.x,o=t.y;return e&&e.length>0?e.map((function(t,e){return t.length?{id:"".concat(n,"_").concat(e),x:r+t[0],y:o+t[1]}:no(no({},t),{x:r+t.x,y:o+t.y,id:t.id||"".concat(n,"_").concat(e)})})):this.getDefaultAnchor()},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.getTargetAnchor=function(t){return km(t,this)},e.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(e.prototype,"anchors",{get:function(){var t=this.getAnchorsByOffset(),e=this,n=e.x,r=e.y,o=e.rotate;return t.forEach((function(t){var e=t.x,i=t.y,a=io(new Dm([e,i,1]).translate(-n,-r).rotate(o).translate(n,r)[0],2),s=a[0],u=a[1];t.x=s,t.y=u})),t},enumerable:!1,configurable:!0}),e.prototype.getAnchorInfo=function(t){if(!Sh(t))for(var e=0;e<this.anchors.length;e++){var n=this.anchors[e];if(n.id===t)return n}},e.prototype.addNodeMoveRules=function(t){this.moveRules.includes(t)||this.moveRules.push(t)},e.prototype.isAllowMoveByXORY=function(t,e,n){var r,o;if(n)r=!0,o=!0;else{var i=this.isAllowMoveNode(t,e);"boolean"==typeof i?(r=i,o=i):(r=i.x,o=i.y)}return{isAllowMoveX:r,isAllowMoveY:o}},e.prototype.move=function(t,e,n){void 0===n&&(n=!1);var r=this.isAllowMoveByXORY(t,e,n),o=r.isAllowMoveX,i=r.isAllowMoveY;return o&&(this.x=this.x+t,this.text&&this.moveText(t,0)),i&&(this.y=this.y+e,this.text&&this.moveText(0,e)),o||i},e.prototype.getMoveDistance=function(t,e,n){void 0===n&&(n=!1);var r=this.isAllowMoveByXORY(t,e,n),o=r.isAllowMoveX,i=r.isAllowMoveY,a=0,s=0;return o&&t&&(this.x=this.x+t,this.text&&this.moveText(t,0),a=t),i&&e&&(this.y=this.y+e,this.text&&this.moveText(0,e),s=e),[a,s]},e.prototype.moveTo=function(t,e,n){void 0===n&&(n=!1);var r=t-this.x,o=e-this.y;return!(!n&&!this.isAllowMoveNode(r,o))&&(this.text&&this.moveText(r,o),this.x=t,this.y=e,!0)},e.prototype.moveText=function(t,e){var n=this.text,r=n.x,o=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,editable:s,draggable:a,x:r+t,y:o+e}},e.prototype.updateText=function(t){this.text=no(no({},Le(this.text)),{value:t})},e.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},e.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t,this.setIsShowAnchor(t)},e.prototype.setIsShowAnchor=function(t){void 0===t&&(t=!0),this.isShowAnchor=t},e.prototype.setEnableRotate=function(t){void 0===t&&(t=!0),this.enableRotate=t},e.prototype.setEnableResize=function(t){void 0===t&&(t=!0),this.enableResize=t},e.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},e.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},e.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},e.prototype.setProperty=function(e,n){var r,o=Le(this.properties),i=no(no({},o),((r={})[e]=l_(n),r));this.properties=i,this.setAttributes(),this.graphModel.eventCenter.emit(t.EventType.NODE_PROPERTIES_CHANGE,{id:this.id,keys:[e],preProperties:o,properties:i})},e.prototype.setProperties=function(e){var n=Le(this.properties),r=no(no({},n),l_(e));this.properties=r,this.setAttributes();var o=[];Uh(e,(function(t,e){(Rf(n,e)&&n[e]!==t||!Rf(n,e))&&o.push(e)})),this.graphModel.eventCenter.emit(t.EventType.NODE_PROPERTIES_CHANGE,{id:this.id,keys:o,preProperties:n,properties:r})},e.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},e.prototype.setStyle=function(t,e){var n;this.style=no(no({},this.style),((n={})[t]=l_(e),n))},e.prototype.setStyles=function(t){this.style=no(no({},this.style),l_(t))},e.prototype.updateStyles=function(t){this.style=no({},l_(t))},e.prototype.setZIndex=function(t){void 0===t&&(t=1),this.zIndex=t},e.prototype.updateAttributes=function(t){Ls(this,t)},e.BaseType=t.ElementType.NODE,oo([$],e.prototype,"type",void 0),oo([$],e.prototype,"x",void 0),oo([$],e.prototype,"y",void 0),oo([$],e.prototype,"textMode",void 0),oo([$],e.prototype,"text",void 0),oo([$],e.prototype,"properties",void 0),oo([$],e.prototype,"_width",void 0),oo([$],e.prototype,"_height",void 0),oo([$],e.prototype,"anchorsOffset",void 0),oo([$],e.prototype,"isSelected",void 0),oo([$],e.prototype,"isHovered",void 0),oo([$],e.prototype,"isShowAnchor",void 0),oo([$],e.prototype,"isDragging",void 0),oo([$],e.prototype,"isHitable",void 0),oo([$],e.prototype,"isHittable",void 0),oo([$],e.prototype,"draggable",void 0),oo([$],e.prototype,"visible",void 0),oo([$],e.prototype,"enableRotate",void 0),oo([$],e.prototype,"enableResize",void 0),oo([$],e.prototype,"zIndex",void 0),oo([$],e.prototype,"state",void 0),oo([$],e.prototype,"autoToFront",void 0),oo([$],e.prototype,"style",void 0),oo([$],e.prototype,"transform",void 0),oo([$],e.prototype,"_rotate",void 0),oo([rt],e.prototype,"incoming",null),oo([rt],e.prototype,"outgoing",null),oo([te],e.prototype,"setTextMode",null),oo([te],e.prototype,"addNodeMoveRules",null),oo([te],e.prototype,"move",null),oo([te],e.prototype,"getMoveDistance",null),oo([te],e.prototype,"moveTo",null),oo([te],e.prototype,"moveText",null),oo([te],e.prototype,"updateText",null),oo([te],e.prototype,"setSelected",null),oo([te],e.prototype,"setHovered",null),oo([te],e.prototype,"setIsShowAnchor",null),oo([te],e.prototype,"setEnableRotate",null),oo([te],e.prototype,"setEnableResize",null),oo([te],e.prototype,"setHitable",null),oo([te],e.prototype,"setHittable",null),oo([te],e.prototype,"setElementState",null),oo([te],e.prototype,"setProperty",null),oo([te],e.prototype,"setProperties",null),oo([te],e.prototype,"deleteProperty",null),oo([te],e.prototype,"setStyle",null),oo([te],e.prototype,"setStyles",null),oo([te],e.prototype,"updateStyles",null),oo([te],e.prototype,"setZIndex",null),oo([te],e.prototype,"updateAttributes",null),e}(),Hb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.CIRCLE_NODE,o.properties={},o.r=50,o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),Object.defineProperty(n.prototype,"width",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties.r;t&&(this.r=t)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.circle,r=this.properties.style,o=void 0===r?{}:r;return no(no(no({},t),up(n)),up(o))},n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.r;return[{x:e,y:n-r,id:"".concat(this.id,"_0")},{x:e+r,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+r,id:"".concat(this.id,"_2")},{x:e-r,y:n,id:"".concat(this.id,"_3")}]},n.prototype.resize=function(t){var e=t.width,n=t.deltaX,r=t.deltaY;return this.move(n/2,r/2),this.r=e,this.setProperties({r:e}),this.getData()},oo([$],n.prototype,"properties",void 0),oo([$],n.prototype,"r",void 0),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(Xb),Wb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.DIAMOND_NODE,o.rx=30,o.ry=50,o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.rx,r=t.ry;n&&(this.rx=n),r&&(this.ry=r)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.diamond,r=this.properties.style,o=void 0===r?{}:r;return no(no(no({},t),up(n)),up(o))},Object.defineProperty(n.prototype,"points",{get:function(){var t=this,e=t.x,n=t.y,r=t.rx,o=t.ry;return[[e,n-o],[e+r,n],[e,n+o],[e-r,n]]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pointsPosition",{get:function(){return Mf(this.points,(function(t){var e=io(t,2);return{x:e[0],y:e[1]}}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return Yd(this.points,(function(n){var r=io(n,1)[0];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return Yd(this.points,(function(n){var r=io(n,2)[1];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),n.prototype.getDefaultAnchor=function(){var t=this;return Mf(this.points,(function(e,n){var r=io(e,2);return{x:r[0],y:r[1],id:"".concat(t.id,"_").concat(n)}}))},n.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},oo([$],n.prototype,"rx",void 0),oo([$],n.prototype,"ry",void 0),oo([$],n.prototype,"properties",void 0),oo([rt],n.prototype,"points",null),oo([rt],n.prototype,"pointsPosition",null),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(Xb),Gb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.ELLIPSE_NODE,o.rx=30,o.ry=45,o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.rx,r=t.ry;n&&(this.rx=n),r&&(this.ry=r)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.ellipse,r=this.properties.style,o=void 0===r?{}:r;return no(no(no({},t),up(n)),up(o))},Object.defineProperty(n.prototype,"width",{get:function(){return 2*this.rx},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return 2*this.ry},enumerable:!1,configurable:!0}),n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.rx,o=t.ry;return[{x:e,y:n-o,id:"".concat(this.id,"_0")},{x:e+r,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o,id:"".concat(this.id,"_2")},{x:e-r,y:n,id:"".concat(this.id,"_3")}]},n.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},oo([$],n.prototype,"rx",void 0),oo([$],n.prototype,"ry",void 0),oo([$],n.prototype,"properties",void 0),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(Xb),Yb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.POLYGON_NODE,o.points=[[50,0],[100,50],[50,100],[0,50]],o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.points,r=t.width,o=t.height,i=n||this.points;this.points=xm(i,r,o)},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.polygon,r=this.properties.style,o=void 0===r?{}:r;return no(no(no({},t),up(n)),up(o))},Object.defineProperty(n.prototype,"pointsPosition",{get:function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return this.points.map((function(t){return{x:t[0]+e-r/2,y:t[1]+n-o/2}}))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var r=io(n,1)[0];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var r=io(n,2)[1];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),n.prototype.getDefaultAnchor=function(){var t=this,e=this,n=e.x,r=e.y,o=e.width,i=e.height;return e.points.map((function(e,a){var s=io(e,2),u=s[0],l=s[1];return{x:n+u-o/2,y:r+l-i/2,id:"".concat(t.id,"_").concat(a)}}))},n.prototype.resize=function(t){var e=this,n=t.width,r=t.height,o=t.deltaX,i=t.deltaY;this.move(o/2,i/2);var a=Mf(this.points,(function(t){var o=io(t,2),i=o[0],a=o[1];return[i*n/e.width,a*r/e.height]}));return this.points=a,this.properties.points=a,this.getData()},oo([$],n.prototype,"points",void 0),oo([$],n.prototype,"properties",void 0),oo([rt],n.prototype,"pointsPosition",null),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(Xb),Vb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.RECT_NODE,o.radius=0,o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.width,r=t.height,o=t.radius;n&&(this.width=n),r&&(this.height=r),o&&(this.radius=o)},n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return[{x:e,y:n-o/2,id:"".concat(this.id,"_0")},{x:e+r/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o/2,id:"".concat(this.id,"_2")},{x:e-r/2,y:n,id:"".concat(this.id,"_3")}]},n.prototype.getNodeStyle=function(){var t=e.prototype.getNodeStyle.call(this),n=this.graphModel.theme.rect,r=this.properties.style,o=void 0===r?{}:r;return no(no(no({},t),up(n)),up(o))},oo([$],n.prototype,"radius",void 0),oo([$],n.prototype,"properties",void 0),n}(Xb),Fb=function(e){function n(){var n=e.apply(this,ao([],io(arguments),!1))||this;return n.modelType=t.ModelType.TEXT_NODE,n}return eo(n,e),n.prototype.getTextStyle=function(){var t=e.prototype.getTextStyle.call(this),n=this.graphModel.theme.text;return no(no({},t),up(n))},Object.defineProperty(n.prototype,"width",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return $m({rows:t,fontSize:e,rowsLength:t.length}).width},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return $m({rows:t,fontSize:e,rowsLength:t.length}).height},enumerable:!1,configurable:!0}),oo([rt],n.prototype,"width",null),oo([rt],n.prototype,"height",null),n}(Xb),Kb=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o.modelType=t.ModelType.HTML_NODE,o.properties={},o.properties=n.properties||{},o.setAttributes(),o}return eo(n,e),n.prototype.setAttributes=function(){e.prototype.setAttributes.call(this);var t=this.properties,n=t.width,r=t.height;n&&(this.width=n),r&&(this.height=r)},n.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return[{x:e,y:n-o/2,id:"".concat(this.id,"_0")},{x:e+r/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o/2,id:"".concat(this.id,"_2")},{x:e-r/2,y:n,id:"".concat(this.id,"_3")}]},oo([$],n.prototype,"properties",void 0),n}(Xb),qb={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},Zb=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],$b=function(){function e(e){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.textMode=t.TextMode.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!0,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=t.TextMode.TEXT,this.edgeTextMode=t.TextMode.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",Ls(this,this.computeConfig(e))}return e.prototype.updateEditConfig=function(t){var e=this.computeConfig(t);Ls(this,e)},e.prototype.computeConfig=function(t){var e=t.isSilentMode,n=t.textDraggable,r=t.textMode,o=t.textEdit,i=t.adjustEdgeStartAndEnd,a={};if(!1===e&&Ls(a,this.stagedConfig),!0===e&&e!==this.isSilentMode){var s=Gv(qb,Zb);this.stagedConfig=Gv(this,Zb),Ls(a,s)}!1===o&&Ls(a,{nodeTextEdit:!1,edgeTextEdit:!1}),r&&Ls(a,{nodeTextMode:r,edgeTextMode:r}),!1===n&&Ls(a,{nodeTextDraggable:!1,edgeTextDraggable:!1}),dh(i)&&Ls(a,{adjustEdgeStart:i,adjustEdgeEnd:i});var u=Gv(t,Zb);return Ls(a,u)},e.prototype.updateTextMode=function(t){this.textMode=t,this.edgeTextMode=t,this.nodeTextMode=t},e.prototype.getConfig=function(){return Gv(this,Zb)},oo([$],e.prototype,"isSilentMode",void 0),oo([$],e.prototype,"stopZoomGraph",void 0),oo([$],e.prototype,"stopMoveGraph",void 0),oo([$],e.prototype,"stopScrollGraph",void 0),oo([$],e.prototype,"textMode",void 0),oo([$],e.prototype,"textEdit",void 0),oo([$],e.prototype,"textDraggable",void 0),oo([$],e.prototype,"nodeTextEdit",void 0),oo([$],e.prototype,"nodeTextDraggable",void 0),oo([$],e.prototype,"nodeTextMultiple",void 0),oo([$],e.prototype,"nodeTextVertical",void 0),oo([$],e.prototype,"nodeTextMode",void 0),oo([$],e.prototype,"edgeTextMode",void 0),oo([$],e.prototype,"edgeTextEdit",void 0),oo([$],e.prototype,"edgeTextDraggable",void 0),oo([$],e.prototype,"edgeTextMultiple",void 0),oo([$],e.prototype,"edgeTextVertical",void 0),oo([$],e.prototype,"hideAnchors",void 0),oo([$],e.prototype,"allowRotate",void 0),oo([$],e.prototype,"allowResize",void 0),oo([$],e.prototype,"hoverOutline",void 0),oo([$],e.prototype,"nodeSelectedOutline",void 0),oo([$],e.prototype,"adjustNodePosition",void 0),oo([$],e.prototype,"autoExpand",void 0),oo([$],e.prototype,"adjustEdge",void 0),oo([$],e.prototype,"adjustEdgeMiddle",void 0),oo([$],e.prototype,"adjustEdgeStartAndEnd",void 0),oo([$],e.prototype,"adjustEdgeStart",void 0),oo([$],e.prototype,"adjustEdgeEnd",void 0),oo([$],e.prototype,"edgeSelectedOutline",void 0),oo([te],e.prototype,"updateEditConfig",null),oo([te],e.prototype,"updateTextMode",null),e}(),Jb=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){var r=this;null==t||t.split(",").forEach((function(t){t=t.trim(),r._events[t]||(r._events[t]=[]),r._events[t].push({callback:e,once:!!n})}))},t.prototype.once=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){t=t.trim(),n.on(t,e,!0)}))},t.prototype.emit=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){var r=n._events[t]||[],o=n._events["*"]||[],i=function(r){for(var o=r.length,i=0;i<o;i++)if(r[i]){var a=r[i],s=a.callback;a.once&&(r.splice(i,1),0===r.length&&delete n._events[t],o--,i--),s.apply(n,[e])}};i(r),i(o)}))},t.prototype.off=function(t,e){var n=this;t||(this._events={}),t.split(",").forEach((function(t){if(e){for(var r=n._events[t]||[],o=r.length,i=0;i<o;i++)r[i].callback===e&&(r.splice(i,1),o--,i--);0===r.length&&delete n._events[t]}else delete n._events[t]}))},t.prototype.getEvents=function(){return this._events},t}(),Qb=function(){function e(e){this.modelMap=new Map,this.nodeMoveRules=[],this.nodes=[],this.edges=[],this.overlapMode=t.OverlapMode.DEFAULT,this.gridSize=1,this.partial=!1;var n=e.container,r=e.partial,o=e.background,i=void 0===o?{}:o,a=e.grid,s=e.idGenerator,u=e.edgeGenerator,l=e.animation,c=e.customTrajectory;this.rootEl=n,this.partial=!!r,this.background=i,"object"==typeof a&&(this.gridSize=a.size||1),this.theme=Nb(e.style),this.edgeType=e.edgeType||"polyline",this.animation=a_(l),this.overlapMode=e.overlapMode||t.OverlapMode.DEFAULT,this.width=e.width||this.rootEl.getBoundingClientRect().width,this.height=e.height||this.rootEl.getBoundingClientRect().height,this.eventCenter=new Jb,this.editConfigModel=new $b(e),this.transformModel=new nE(this.eventCenter,e),this.flowId=_b(),this.idGenerator=s,this.edgeGenerator=_m(this,u),this.customTrajectory=c}return Object.defineProperty(e.prototype,"nodesMap",{get:function(){return this.nodes.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"edgesMap",{get:function(){return this.edges.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"modelsMap",{get:function(){return ao(ao([],io(this.nodes),!1),io(this.edges),!1).reduce((function(t,e){return t[e.id]=e,t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sortElements",{get:function(){for(var t=ao(ao([],io(this.nodes),!1),io(this.edges),!1).sort((function(t,e){return t.zIndex-e.zIndex})),e=[],n=[-200,-200],r=[this.width+g_,this.height+g_],o=0;o<t.length;o++){var i=t[o];i.visible&&(!this.partial||i.isSelected||this.isElementInArea(i,n,r,!1,!1))&&e.push(i)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textEditElement",{get:function(){var e=this.nodes.find((function(e){return e.state===t.ElementState.TEXT_EDIT})),n=this.edges.find((function(e){return e.state===t.ElementState.TEXT_EDIT}));return e||n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectElements",{get:function(){var t=new Map;return this.nodes.forEach((function(e){e.isSelected&&t.set(e.id,e)})),this.edges.forEach((function(e){e.isSelected&&t.set(e.id,e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectNodes",{get:function(){var t=[];return this.nodes.forEach((function(e){e.isSelected&&t.push(e)})),t},enumerable:!1,configurable:!0}),e.prototype.getAreaElement=function(t,e,n,r,o){var i=this;void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[];return Yd(ao(ao([],io(this.nodes),!1),io(this.edges),!1),(function(s){var u=i.isElementInArea(s,t,e,n,r);o&&!s.visible||!u||a.push(s)})),a},e.prototype.getModel=function(t){return this.modelMap.get(t)},e.prototype.getNodeModelById=function(t){var e;return this.fakeNode&&t===this.fakeNode.id?this.fakeNode:null===(e=this.nodesMap[t])||void 0===e?void 0:e.model},e.prototype.getPointByClient=function(t){var e=t.x,n=t.y,r=this.rootEl.getBoundingClientRect(),o={x:e-r.left,y:n-r.top},i=io(this.transformModel.HtmlPointToCanvasPoint([o.x,o.y]),2);return{domOverlayPosition:o,canvasOverlayPosition:{x:i[0],y:i[1]}}},e.prototype.isElementInArea=function(e,n,r,o,i){var a;if(void 0===o&&(o=!0),void 0===i&&(i=!0),e.BaseType===t.ElementType.NODE){for(var s=Um(e),u=s.minX,l=s.minY,c=s.maxX,p=s.maxY,d=[{x:u,y:l},{x:c,y:l},{x:c,y:p},{x:u,y:p}],f=i,h=0;h<d.length;h++){var v=d[h],y=v.x,g=v.y;if(y=(a=io(this.transformModel.CanvasPointToHtmlPoint([y,g]),2))[0],g=a[1],Mm([y,g],n,r)!==i){f=!i;break}}return f}if(e.BaseType===t.ElementType.EDGE){var _=e.startPoint,m=e.endPoint,b=this.transformModel.CanvasPointToHtmlPoint([_.x,_.y]),E=this.transformModel.CanvasPointToHtmlPoint([m.x,m.y]),x=Mm(b,n,r),M=Mm(E,n,r);return o?x&&M:x||M}return!1},e.prototype.graphDataToModel=function(t){var e=this;if(this.width&&this.height||this.resize(),!t)return this.nodes=[],void(this.edges=[]);if(t.nodes?this.nodes=Mf(t.nodes,(function(t){return e.getModelAfterSnapToGrid(t)})):this.nodes=[],t.edges){var n=this.edgeType;this.edges=Mf(t.edges,(function(t){var r,o=e.getModel(null!==(r=t.type)&&void 0!==r?r:n);if(!o)throw new Error("找不到".concat(t.type,"对应的边。"));return new o(t,e)}))}else this.edges=[]},e.prototype.modelToGraphData=function(){var t=[];this.edges.forEach((function(e){var n=e.getData();n&&!e.virtual&&t.push(n)}));var e=[];return this.nodes.forEach((function(t){var n=t.getData();n&&!t.virtual&&e.push(n)})),{nodes:e,edges:t}},e.prototype.modelToHistoryData=function(){for(var t=!1,e=[],n=0;n<this.nodes.length;n++){var r=this.nodes[n];if(r.isDragging){t=!0;break}e.push(r.getHistoryData())}if(t)return!1;for(var o=!1,i=[],a=0;a<this.edges.length;a++){var s=this.edges[a];if(s.isDragging){o=!0;break}i.push(s.getHistoryData())}return!o&&{nodes:e,edges:i}},e.prototype.getEdgeModelById=function(t){var e;return null===(e=this.edgesMap[t])||void 0===e?void 0:e.model},e.prototype.getElement=function(t){return this.modelsMap[t]},e.prototype.getNodeEdges=function(t){for(var e=[],n=0;n<this.edges.length;n++){var r=this.edges[n],o=r.sourceNodeId===t,i=r.targetNodeId===t;(o||i)&&e.push(r)}return e},e.prototype.getSelectElements=function(e){void 0===e&&(e=!0);var n=this.selectElements,r={nodes:[],edges:[]};return n.forEach((function(o){if(o.BaseType===t.ElementType.NODE&&r.nodes.push(o.getData()),o.BaseType===t.ElementType.EDGE){var i=o.getData(),a=n.get(i.sourceNodeId)&&n.get(i.targetNodeId);(e||a)&&r.edges.push(i)}})),r},e.prototype.updateAttributes=function(t,e){var n=this.getElement(t);null==n||n.updateAttributes(e)},e.prototype.changeNodeId=function(t,e){return e||(e=_b()),this.nodesMap[e]?(console.warn("当前流程图已存在节点".concat(e,", 修改失败")),""):this.nodesMap[t]?(this.edges.forEach((function(n){n.sourceNodeId===t&&(n.sourceNodeId=e),n.targetNodeId===t&&(n.targetNodeId=e)})),this.nodesMap[t].model.id=e,this.nodesMap[e]=this.nodesMap[t],e):(console.warn("当前流程图找不到节点".concat(t,", 修改失败")),"")},e.prototype.changeEdgeId=function(t,e){return e||(e=_b()),this.edgesMap[e]?(console.warn("当前流程图已存在边: ".concat(e,", 修改失败")),""):this.edgesMap[t]?(this.edges.forEach((function(n){n.id===t&&n.changeEdgeId(e)})),e):(console.warn("当前流程图找不到边: ".concat(e,", 修改失败")),"")},e.prototype.getTextModel=function(e){var n=this.editConfigModel,r=n.textMode,o=n.nodeTextMode,i=n.edgeTextMode;return e.BaseType===t.ElementType.NODE?e.textMode||o||r||t.TextMode.TEXT:e.BaseType===t.ElementType.EDGE?e.textMode||i||r||t.TextMode.TEXT:void 0},e.prototype.setTextMode=function(t,e){this.editConfigModel.updateEditConfig({textMode:t})},e.prototype.setFakeNode=function(t){this.fakeNode=t},e.prototype.removeFakeNode=function(){this.fakeNode=null},e.prototype.setModel=function(t,e){return this.modelMap.set(t,e)},e.prototype.toFront=function(e){var n,r,o,i=(null===(n=this.nodesMap[e])||void 0===n?void 0:n.model)||(null===(r=this.edgesMap[e])||void 0===r?void 0:r.model);i&&(this.overlapMode===t.OverlapMode.DEFAULT&&(null===(o=this.topElement)||void 0===o||o.setZIndex(),i.setZIndex(9999),this.topElement=i),this.overlapMode===t.OverlapMode.INCREASE&&this.setElementZIndex(e,"top"))},e.prototype.setElementZIndex=function(t,e){var n,r,o=(null===(n=this.nodesMap[t])||void 0===n?void 0:n.model)||(null===(r=this.edgesMap[t])||void 0===r?void 0:r.model);if(o){var i=void 0;"number"==typeof e?i=e:("top"===e&&(i=Lb()),"bottom"===e&&(i=jb())),o.setZIndex(i)}},e.prototype.deleteNode=function(e){var n=this.nodesMap[e].model.getData();this.deleteEdgeBySource(e),this.deleteEdgeByTarget(e),this.nodes.splice(this.nodesMap[e].index,1),this.eventCenter.emit(t.EventType.NODE_DELETE,{data:n})},e.prototype.addNode=function(e,n,r){void 0===n&&(n=t.EventType.NODE_ADD);var o=l_(e),i=o.id;i&&this.nodesMap[i]&&delete o.id;var a=this.getModelAfterSnapToGrid(o);this.nodes.push(a);var s={data:a.getData()};return r&&(s.e=r),this.eventCenter.emit(n,s),a},e.prototype.getModelAfterSnapToGrid=function(t){var e=this.getModel(t.type);if(!e)throw new Error("找不到".concat(t.type,"对应的节点,请确认是否已注册此类型节点。"));var n=t.x,r=t.y;return n&&r&&(t.x=bm(n,this.gridSize),t.y=bm(r,this.gridSize),Uo(t.text)&&(t.text.x+=t.x-n,t.text.y+=t.y-r)),new e(t,this)},e.prototype.cloneNode=function(t){var e=this.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){n.x+=30,n.y+=30,n.id="",Uo(n.text)&&(n.text.x+=30,n.text.y+=30);var r=this.addNode(n);return r.setSelected(!0),null==e||e.setSelected(!1),r.getData()}},e.prototype.moveNode=function(t,e,n,r){var o;void 0===r&&(r=!1);var i=this.nodesMap[t];i?(e=(o=io(i.model.getMoveDistance(e,n,r),2))[0],n=o[1],this.moveEdge(t,e,n)):console.warn("不存在id为".concat(t,"的节点"))},e.prototype.moveNode2Coordinate=function(t,e,n,r){void 0===r&&(r=!1);var o=this.nodesMap[t];if(o){var i=o.model,a=e-i.x,s=n-i.y;this.moveNode(t,a,s,r)}else console.warn("不存在id为".concat(t,"的节点"))},e.prototype.editText=function(e){this.setElementStateById(e,t.ElementState.TEXT_EDIT)},e.prototype.addEdge=function(e){var n=l_(e),r=n.type;r||(r=this.edgeType),n.id&&this.edgesMap[n.id]&&delete n.id;var o=this.getModel(r);if(!o)throw new Error("找不到".concat(r,"对应的边,请确认是否已注册此类型边。"));var i=new o(no(no({},n),{type:r}),this),a=i.getData();return this.edges.push(i),this.eventCenter.emit(t.EventType.EDGE_ADD,{data:a}),i},e.prototype.moveEdge=function(t,e,n){for(var r=0;r<this.edges.length;r++){var o=this.edges[r],i=o.textPosition,a=i.x,s=i.y,u=this.edges[r].sourceNodeId===t,l=this.edges[r].targetNodeId===t;u&&o.moveStartPoint(e,n),l&&o.moveEndPoint(e,n),(u||l)&&this.handleEdgeTextMove(o,a,s)}},e.prototype.handleEdgeTextMove=function(e,n,r){var o;if(e.customTextPosition)e.resetTextPosition();else{if(e.modelType===t.ModelType.POLYLINE_EDGE&&(null===(o=e.text)||void 0===o?void 0:o.value)){var i=e.text,a=vm(i,e.points);e.moveText(a.x-i.x,a.y-i.y)}var s=e.textPosition,u=s.x,l=s.y;e.moveText(u-n,l-r)}},e.prototype.deleteEdgeBySourceAndTarget=function(e,n){for(var r=0;r<this.edges.length;r++)if(this.edges[r].sourceNodeId===e&&this.edges[r].targetNodeId===n){var o=this.edges[r].getData();this.edges.splice(r,1),r--,this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:o})}},e.prototype.deleteEdgeById=function(e){if(this.edgesMap[e]){var n=this.edgesMap[e].index,r=this.edgesMap[e].model.getData();this.edges.splice(n,1),this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:r})}},e.prototype.deleteEdgeBySource=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:r})}},e.prototype.deleteEdgeByTarget=function(e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].targetNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(t.EventType.EDGE_DELETE,{data:r})}},e.prototype.setElementStateById=function(e,n,r){this.nodes.forEach((function(o){o.id===e?o.setElementState(n,r):o.setElementState(t.ElementState.DEFAULT)})),this.edges.forEach((function(o){o.id===e?o.setElementState(n,r):o.setElementState(t.ElementState.DEFAULT)}))},e.prototype.updateText=function(t,e){var n=vf(ao(ao([],io(this.nodes),!1),io(this.edges),!1),(function(e){return e.id===t}));null==n||n.updateText(e)},e.prototype.selectNodeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var r=null===(n=this.nodesMap[t])||void 0===n?void 0:n.model;null==r||r.setSelected(!0)},e.prototype.selectEdgeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var r=null===(n=this.edgesMap[t])||void 0===n?void 0:n.model;null==r||r.setSelected(!0)},e.prototype.selectElementById=function(t,e){void 0===e&&(e=!1),e||this.clearSelectElements();var n=this.getElement(t);null==n||n.setSelected(!0)},e.prototype.clearSelectElements=function(){var e;this.selectElements.forEach((function(t){null==t||t.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===t.OverlapMode.DEFAULT&&(null===(e=this.topElement)||void 0===e||e.setZIndex())},e.prototype.moveNodes=function(e,n,r,o){var i,a,s,u=this;void 0===o&&(o=!1);for(var l=e.reduce((function(t,e){var i=u.nodesMap[e].model;return t[e]=i.getMoveDistance(n,r,o),t}),{}),c=0;c<this.edges.length;c++){var p=this.edges[c],d=p.textPosition,f=d.x,h=d.y,v=l[p.sourceNodeId],y=l[p.targetNodeId],g=void 0,_=void 0;v&&y&&p.modelType===t.ModelType.POLYLINE_EDGE?(g=(i=io(v,2))[0],_=i[1],p.updatePointsList(g,_)):(v&&(g=(a=io(v,2))[0],_=a[1],p.moveStartPoint(g,_)),y&&(g=(s=io(y,2))[0],_=s[1],p.moveEndPoint(g,_))),(v||y)&&this.handleEdgeTextMove(p,f,h)}},e.prototype.addNodeMoveRules=function(t){this.nodeMoveRules.includes(t)||this.nodeMoveRules.push(t)},e.prototype.setDefaultEdgeType=function(t){this.edgeType=t},e.prototype.changeNodeType=function(t,e){var n=this.getNodeModelById(t);if(n){var r=n.getData();r.type=e;var o=this.getModel(e);if(!o)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));var i=new o(r,this);this.nodes.splice(this.nodesMap[t].index,1,i),this.getNodeEdges(t).forEach((function(e){if(e.sourceNodeId===t){var n=qm(i,e.startPoint,i.width,i.height);e.updateStartPoint(n)}if(e.targetNodeId===t){n=qm(i,e.endPoint,i.width,i.height);e.updateEndPoint(n)}}))}else console.warn("找不到id为".concat(t,"的节点"))},e.prototype.changeEdgeType=function(t,e){var n=this.getEdgeModelById(t);if(n){if(n.type!==e){var r=n.getData();r.type=e;var o=this.getModel(e);if(!o)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));delete r.pointsList;var i=new o(r,this);this.edges.splice(this.edgesMap[t].index,1,i)}}else console.warn("找不到id为".concat(t,"的边"))},e.prototype.getNodeIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetNodeId===t&&e.push(n)})),e},e.prototype.getNodeOutgoingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceNodeId===t&&e.push(n)})),e},e.prototype.getAnchorIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetAnchorId===t&&e.push(n)})),e},e.prototype.getAnchorOutcomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceAnchorId===t&&e.push(n)})),e},e.prototype.getNodeIncomingNode=function(t){var e=this,n=[];return this.edges.forEach((function(r){var o;r.targetNodeId===t&&n.push(null===(o=e.nodesMap[r.sourceNodeId])||void 0===o?void 0:o.model)})),n},e.prototype.getNodeOutgoingNode=function(t){var e=this,n=[];return this.edges.forEach((function(r){r.sourceNodeId===t&&n.push(e.nodesMap[r.targetNodeId].model)})),n},e.prototype.setTheme=function(t){this.theme=Pb(no(no({},this.theme),t))},e.prototype.resize=function(t,e){this.width=t||this.rootEl.getBoundingClientRect().width,this.height=e||this.rootEl.getBoundingClientRect().height,this.width&&this.height||console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")},e.prototype.clearData=function(){this.nodes=[],this.edges=[]},e.prototype.getVirtualRectSize=function(){var t=this.nodes,e=[],n=[];t.forEach((function(t){var r=t.x,o=t.y,i=t.width,a=t.height,s=t.getNodeStyle().strokeWidth,u=void 0===s?0:s,l=r+i/2+u,c=r-i/2-u,p=o+a/2+u,d=o-a/2-u;e=e.concat([l,c].filter((function(t){return!Number.isNaN(t)}))),n=n.concat([p,d].filter((function(t){return!Number.isNaN(t)})))}));var r=Math.min.apply(Math,ao([],io(e),!1)),o=Math.max.apply(Math,ao([],io(e),!1)),i=Math.min.apply(Math,ao([],io(n),!1)),a=o-r||0,s=Math.max.apply(Math,ao([],io(n),!1))-i||0;return{width:a,height:s,x:r+a/2,y:i+s/2}},e.prototype.translateCenter=function(){var t=this,e=t.nodes,n=t.width,r=t.height,o=t.rootEl,i=t.transformModel;if(e.length){var a=n||o.clientWidth,s=r||o.clientHeight,u=this.getVirtualRectSize(),l=u.x,c=u.y;i.focusOn(l,c,a,s)}},e.prototype.fitView=function(t,e){void 0===t&&(t=20),void 0===e&&(e=20);var n=this,r=n.nodes,o=n.width,i=n.height,a=n.rootEl,s=n.transformModel;if(r.length){var u=o||a.clientWidth,l=i||a.clientHeight,c=this.getVirtualRectSize(),p=c.width,d=c.height,f=c.x,h=c.y,v=(p+e)/u,y=(d+t)/l,g=1/Math.max(v,y),_=[u/2,l/2];s.zoom(g,_),s.focusOn(f,h,u,l)}},e.prototype.openEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.openEdgeAnimation()},e.prototype.closeEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.closeEdgeAnimation()},e.prototype.getPartial=function(){return this.partial},e.prototype.setPartial=function(t){this.partial=t},oo([$],e.prototype,"width",void 0),oo([$],e.prototype,"height",void 0),oo([$],e.prototype,"edgeType",void 0),oo([$],e.prototype,"nodes",void 0),oo([$],e.prototype,"edges",void 0),oo([$],e.prototype,"fakeNode",void 0),oo([$],e.prototype,"overlapMode",void 0),oo([$],e.prototype,"background",void 0),oo([$],e.prototype,"gridSize",void 0),oo([$],e.prototype,"transformModel",void 0),oo([$],e.prototype,"editConfigModel",void 0),oo([$],e.prototype,"partial",void 0),oo([rt],e.prototype,"nodesMap",null),oo([rt],e.prototype,"edgesMap",null),oo([rt],e.prototype,"modelsMap",null),oo([rt],e.prototype,"sortElements",null),oo([rt],e.prototype,"textEditElement",null),oo([rt],e.prototype,"selectElements",null),oo([rt],e.prototype,"selectNodes",null),oo([te],e.prototype,"setTextMode",null),oo([te],e.prototype,"setFakeNode",null),oo([te],e.prototype,"removeFakeNode",null),oo([te],e.prototype,"setModel",null),oo([te],e.prototype,"toFront",null),oo([te],e.prototype,"setElementZIndex",null),oo([te],e.prototype,"deleteNode",null),oo([te],e.prototype,"addNode",null),oo([te],e.prototype,"cloneNode",null),oo([te],e.prototype,"moveNode",null),oo([te],e.prototype,"moveNode2Coordinate",null),oo([te],e.prototype,"editText",null),oo([te],e.prototype,"addEdge",null),oo([te],e.prototype,"moveEdge",null),oo([te],e.prototype,"deleteEdgeBySourceAndTarget",null),oo([te],e.prototype,"deleteEdgeById",null),oo([te],e.prototype,"deleteEdgeBySource",null),oo([te],e.prototype,"deleteEdgeByTarget",null),oo([te],e.prototype,"setElementStateById",null),oo([te],e.prototype,"updateText",null),oo([te],e.prototype,"selectNodeById",null),oo([te],e.prototype,"selectEdgeById",null),oo([te],e.prototype,"selectElementById",null),oo([te],e.prototype,"clearSelectElements",null),oo([te],e.prototype,"moveNodes",null),oo([te],e.prototype,"setDefaultEdgeType",null),oo([te],e.prototype,"changeNodeType",null),oo([te],e.prototype,"changeEdgeType",null),oo([te],e.prototype,"getNodeIncomingEdge",null),oo([te],e.prototype,"getNodeOutgoingEdge",null),oo([te],e.prototype,"getAnchorIncomingEdge",null),oo([te],e.prototype,"getAnchorOutcomingEdge",null),oo([te],e.prototype,"getNodeIncomingNode",null),oo([te],e.prototype,"getNodeOutgoingNode",null),oo([te],e.prototype,"setTheme",null),oo([te],e.prototype,"resize",null),oo([te],e.prototype,"clearData",null),oo([te],e.prototype,"translateCenter",null),oo([te],e.prototype,"fitView",null),oo([te],e.prototype,"openEdgeAnimation",null),oo([te],e.prototype,"closeEdgeAnimation",null),oo([te],e.prototype,"setPartial",null),e}(),tE=function(){function t(t){this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=t}return t.prototype.getStyle=function(){return no({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(t,e){for(var n=t.x,r=t.y,o=!1,i=!1,a=0;a<e.length;a++){var s=e[a];if(s.id!==t.id&&(n===s.x&&(o=!0),r===s.y&&(i=!0),o&&i))break}return{isShowVertical:o,isShowHorizontal:i,position:{x:n,y:r}}},t.prototype.getHorizontalSnapline=function(t,e){var n,r=!1,o=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=Um(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=Um(s))}}for(var u=0;u<e.length;u++){var l=e[u];if(l.id!==t.id){var c=Um(l);if(c.minY===(null==n?void 0:n.minY)||c.maxY===(null==n?void 0:n.minY)){r=!0,o=n.minY;break}if(c.minY===(null==n?void 0:n.maxY)||c.maxY===(null==n?void 0:n.maxY)){r=!0,o=n.maxY;break}}}return{isShowHorizontal:r,isShowVertical:this.isShowVertical,position:no(no({},this.position),{y:o})}},t.prototype.getVerticalSnapline=function(t,e){var n,r=!1,o=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=Um(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=Um(s))}}for(var u=0;u<e.length;u++){var l=e[u];if(l.id!==t.id){var c=Um(l);if(c.minX===(null==n?void 0:n.minX)||c.maxX===(null==n?void 0:n.minX)){r=!0,o=n.minX;break}if(c.minX===(null==n?void 0:n.maxX)||c.maxX===(null==n?void 0:n.maxX)){r=!0,o=n.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:r,position:no(no({},this.position),{x:o})}},t.prototype.getSnapLinePosition=function(t,e){var n=this.getCenterSnapLine(t,e),r=n.isShowHorizontal,o=n.isShowVertical;if(!r){var i=this.getHorizontalSnapline(t,e);i.isShowHorizontal&&(n.isShowHorizontal=i.isShowHorizontal,n.position.y=i.position.y)}if(!o){var a=this.getVerticalSnapline(t,e);a.isShowVertical&&(n.isShowVertical=a.isShowVertical,n.position.x=a.position.x)}return n},t.prototype.setSnaplineInfo=function(t){var e=t.isShowHorizontal,n=t.isShowVertical,r=t.position;this.position=r,this.isShowHorizontal=e,this.isShowVertical=n},t.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},t.prototype.setNodeSnapLine=function(t){var e=this.graphModel.nodes,n=this.getSnapLinePosition(t,e);this.setSnaplineInfo(n)},oo([$],t.prototype,"isShowHorizontal",void 0),oo([$],t.prototype,"isShowVertical",void 0),oo([$],t.prototype,"position",void 0),oo([te],t.prototype,"clearSnapline",null),oo([te],t.prototype,"setNodeSnapLine",null),t}(),eE={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},nE=function(){function e(t,e){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=t;var n=e.stopMoveGraph,r=void 0!==n&&n;this.updateTranslateLimits(r)}return e.prototype.setZoomMiniSize=function(t){this.MINI_SCALE_SIZE=t},e.prototype.setZoomMaxSize=function(t){this.MAX_SCALE_SIZE=t},e.prototype.HtmlPointToCanvasPoint=function(t){var e=io(t,2),n=e[0],r=e[1];return[(n-this.TRANSLATE_X)/this.SCALE_X,(r-this.TRANSLATE_Y)/this.SCALE_Y]},e.prototype.CanvasPointToHtmlPoint=function(t){var e=io(t,2),n=e[0],r=e[1];return[n*this.SCALE_X+this.TRANSLATE_X,r*this.SCALE_Y+this.TRANSLATE_Y]},e.prototype.moveCanvasPointByHtml=function(t,e,n){var r=io(t,2),o=r[0],i=r[1];return[o+e/this.SCALE_X,i+n/this.SCALE_Y]},e.prototype.fixDeltaXY=function(t,e){return[t/this.SCALE_X,e/this.SCALE_Y]},e.prototype.getTransformStyle=function(){var t=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(t,")")}},e.prototype.zoom=function(t,e){void 0===t&&(t=!1);var n=this.SCALE_X,r=this.SCALE_Y;return"number"==typeof t?(n=t,r=t):t?(n+=this.ZOOM_SIZE,r+=this.ZOOM_SIZE):(n-=this.ZOOM_SIZE,r-=this.ZOOM_SIZE),n<this.MINI_SCALE_SIZE||n>this.MAX_SCALE_SIZE||(e&&(this.TRANSLATE_X-=(n-this.SCALE_X)*e[0],this.TRANSLATE_Y-=(r-this.SCALE_Y)*e[1]),this.SCALE_X=n,this.SCALE_Y=r,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")},e.prototype.emitGraphTransform=function(e){this.eventCenter.emit(t.EventType.GRAPH_TRANSFORM,{type:e,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},e.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},e.prototype.translate=function(t,e){this.TRANSLATE_X+t<=this.translateLimitMaxX&&this.TRANSLATE_X+t>=this.translateLimitMinX&&(this.TRANSLATE_X+=t),this.TRANSLATE_Y+e<=this.translateLimitMaxY&&this.TRANSLATE_Y+e>=this.translateLimitMinY&&(this.TRANSLATE_Y+=e),this.emitGraphTransform("translate")},e.prototype.focusOn=function(t,e,n,r){var o=io(this.CanvasPointToHtmlPoint([t,e]),2),i=io([n/2-o[0],r/2-o[1]],2),a=i[0],s=i[1];this.TRANSLATE_X+=a,this.TRANSLATE_Y+=s,this.emitGraphTransform("focusOn")},e.prototype.updateTranslateLimits=function(t){var e;e=io(Array.isArray(t)&&4===t.length?t:eE[t.toString()],4),this.translateLimitMinX=e[0],this.translateLimitMinY=e[1],this.translateLimitMaxX=e[2],this.translateLimitMaxY=e[3]},oo([$],e.prototype,"SCALE_X",void 0),oo([$],e.prototype,"SKEW_Y",void 0),oo([$],e.prototype,"SKEW_X",void 0),oo([$],e.prototype,"SCALE_Y",void 0),oo([$],e.prototype,"TRANSLATE_X",void 0),oo([$],e.prototype,"TRANSLATE_Y",void 0),oo([$],e.prototype,"ZOOM_SIZE",void 0),oo([te],e.prototype,"zoom",null),oo([te],e.prototype,"resetZoom",null),oo([te],e.prototype,"translate",null),oo([te],e.prototype,"focusOn",null),e}(),rE=function(e){function n(n){var r=e.call(this)||this;r.stepScrollX=0,r.stepScrollY=0,r.onDragging=function(t){var e=t.deltaX,n=t.deltaY;r.setState({isDragging:!0});var o=r.props.graphModel,i=o.transformModel;!0!==o.editConfigModel.stopMoveGraph&&i.translate(e,n)},r.onDragEnd=function(){r.setState({isDragging:!1})},r.zoomHandler=function(t){var e=r.props,n=e.graphModel,o=n.editConfigModel,i=n.transformModel,a=n.gridSize,s=e.graphModel,u=t.deltaX,l=t.deltaY;if(o.stopScrollGraph||!0===t.ctrlKey){if(!o.stopZoomGraph){t.preventDefault();var c=s.getPointByClient({x:t.clientX,y:t.clientY}).canvasOverlayPosition,p=c.x,d=c.y;i.zoom(t.deltaY<0,[p,d])}}else{if(t.preventDefault(),r.stepScrollX+=u,r.stepScrollY+=l,Math.abs(r.stepScrollX)>=a){var f=r.stepScrollX%a,h=r.stepScrollX-f;i.translate(-h*i.SCALE_X,0),r.stepScrollX=f}if(Math.abs(r.stepScrollY)>=a){var v=r.stepScrollY%a,y=r.stepScrollY-v;i.translate(0,-y*i.SCALE_Y),r.stepScrollY=v}}},r.clickHandler=function(e){if("canvas-overlay"===e.target.getAttribute("name")){var n=r.props.graphModel;n.selectElements.size>0&&n.clearSelectElements(),n.eventCenter.emit(t.EventType.BLANK_CLICK,{e:e})}},r.handleContextMenu=function(e){if("canvas-overlay"===e.target.getAttribute("name")){e.preventDefault();var n=r.props.graphModel,o=n.getPointByClient({x:e.clientX,y:e.clientY});n.eventCenter.emit(t.EventType.BLANK_CONTEXTMENU,{e:e,position:o})}},r.mouseDownHandler=function(e){var n=r.props.graphModel,o=n.eventCenter,i=n.editConfigModel,a=n.transformModel.SCALE_X,s=n.gridSize,u=e.target,l=!i.adjustEdge&&!i.adjustNodePosition;("canvas-overlay"===u.getAttribute("name")||l)&&(!0!==i.stopMoveGraph?(r.stepDrag.setStep(s*a),r.stepDrag.handleMouseDown(e)):o.emit(t.EventType.BLANK_MOUSEDOWN,{e:e}),r.clickHandler(e))};var o=n.graphModel,i=o.gridSize,a=o.eventCenter;return r.stepDrag=new __({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:i,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),r.state={isDragging:!1},r}return eo(n,e),n.prototype.render=function(){var t=this.props.graphModel.transformModel.getTransformStyle().transform,e=this.props,n=e.children,r=e.dnd,o=this.state.isDragging;return uo("svg",no({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:o?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},r.eventMap(),{children:uo("g",{transform:t,children:n})}))},n=oo([Ax],n)}(Vn);function oE(e){var n=e.x,r=void 0===n?0:n,o=e.y,i=void 0===o?0:o,a=e.value,s=e.fontSize,u=void 0===s?12:s,l=e.fill,c=void 0===l?"currentColor":l,p=e.overflowMode,d=void 0===p?"default":p,f=e.textWidth,h=void 0===f?void 0:f,v=e.model,y={x:r,y:i,fill:c,fontSize:u,textAnchor:"middle",dominantBaseline:"central"};if(Yd(Jd(e),(function(t){var e=io(t,2),n=e[0],r=e[1];"object"!=typeof r&&(y[n]=r)})),a){var g=String(a).split(/[\r\n]/g),_=g.length;if("default"!==d){var m=v.BaseType,b=v.modelType;if(m===t.ElementType.NODE&&b!==t.ModelType.TEXT_NODE||m===t.ElementType.EDGE&&h)return iE(e)}if(_>1){var E=g.map((function(t,e){return uo("tspan",{className:"lf-text-tspan",x:r,y:i+(e-(_-1)/2)*(u+2),children:t})}));return uo("text",no({},y,{children:E}))}return uo("text",no({},y,{children:a}))}return null}function iE(t){var e=t.x,n=t.y,r=t.value,o=t.model,i=t.textWidth,a=t.fontSize,s=void 0===a?12:a,u=t.lineHeight,l=t.fontFamily,c=void 0===l?"":l,p=t.wrapPadding,d=void 0===p?"0, 0":p,f=t.overflowMode,h=o.width,v=o.height,y=o.textHeight,g=i||h,_=String(r).split(/[\r\n]/g),m=_.length,b=Zm({rows:_,style:{fontSize:"".concat(s,"px"),width:"".concat(g,"px"),fontFamily:c,lineHeight:u,padding:d},rowsLength:m,className:"lf-get-text-height"}),E=v>b?v:b;y&&(E=y);var x="ellipsis"===f;return x&&(E=s+2),uo("g",{children:uo("foreignObject",{width:g,height:E,x:e-g/2,y:n-E/2,style:{overflow:"visible",textAlign:"left"},children:uo("div",{className:"lf-node-text-auto-wrap",style:{minHeight:E,width:g,padding:d},children:uo("div",{className:x?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:x?_.join(""):"",style:no({},t),children:_.map((function(t){return uo("div",{className:"lf-node-text--auto-wrap-inner",children:t})}))})})})})}function aE(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return Yd(Jd(t),(function(t){var n=io(t,2),r=n[0],o=n[1];("style"===r||"object"!=typeof o)&&(e[r]=o)})),uo("line",no({},e))}function sE(t){var e=t.x,n=t.y,r=t.width,o=t.height,i=t.className,a=t.strokeWidth,s=t.radius,u=void 0===s?0:s,l=e-r/2,c=n-o/2,p={};return p["stroke-width"]=a,Yd(Jd(t),(function(t){var e=io(t,2),n=e[0],r=e[1];"object"!=typeof r&&(p[n]=r)})),p.className=i?"lf-basic-shape ".concat(i):"lf-basic-shape",u&&(p.rx=u,p.ry=u),p.x=l,p.y=c,uo("rect",no({},p))}function uE(t){var e={d:""};return Yd(Jd(t),(function(t){var n=io(t,2),r=n[0],o=n[1];"style"!==r&&"object"==typeof o||(e[r]=o)})),uo("path",no({},e))}function lE(t){var e=t.x,n=void 0===e?0:e,r=t.y,o=void 0===r?0:r,i=t.r,a=void 0===i?4:i,s=t.className,u={cx:n,cy:o,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return Yd(Jd(t),(function(t){var e=io(t,2),n=e[0],r=e[1];"object"!=typeof r&&(u[n]=r)})),u.className=s?"lf-basic-shape ".concat(s):"lf-basic-shape",uo("circle",no({},u))}function cE(t){var e=t.x,n=void 0===e?0:e,r=t.y,o=void 0===r?0:r,i=t.rx,a=void 0===i?4:i,s=t.ry,u=void 0===s?4:s,l=t.className,c={cx:n,cy:o,rx:a,ry:u,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return Yd(Jd(t),(function(t){var e=io(t,2),n=e[0],r=e[1];"object"!=typeof r&&(c[n]=r)})),c.className=l?"lf-basic-shape ".concat(l):"lf-basic-shape",uo("ellipse",no({},c))}function pE(t){var e=t.points,n=void 0===e?[]:e,r=t.className,o={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};return Yd(Jd(t),(function(t){var e=io(t,2),n=e[0],r=e[1];"object"!=typeof r&&(o[n]=r)})),r?o.classNmae="lf-basic-shape ".concat(r):o.className="lf-basic-shape",o.points=n.map((function(t){return t.join(",")})).join(" "),uo("polygon",no({},o))}function dE(t){var e=t.className,n={points:"",fill:"none"};return Yd(Jd(t),(function(t){var e=io(t,2),r=e[0],o=e[1];("style"===r||"object"!=typeof o)&&(n[r]=o)})),e&&(n.className="".concat(e)),uo("polyline",no({},n))}var fE=function(e){function n(){var n=e.call(this)||this;return n.onDragging=function(e){var r=e.event,o=n.props,i=o.graphModel,a=o.bezierModel,s=o.type,u=i.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,l=u.x,c=u.y;a.updateAdjustAnchor({x:l,y:c},s),i.eventCenter.emit(t.EventType.EDGE_ADJUST,{data:a.getData()})},n.onDragEnd=function(){n.props.bezierModel.isDragging=!1},n.dragHandler=new __({onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return eo(n,e),n.prototype.render=function(){var t=this,e=this.props.position,n=e.x,r=e.y,o=this.props.bezierModel.getEdgeStyle().adjustAnchor;return uo(lE,no({className:"lf-bezier-adjust-anchor",x:n,y:r},o,{onMouseDown:function(e){t.dragHandler.handleMouseDown(e)}}))},n}(Vn),hE=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return eo(n,e),n.prototype.getBezierAdjust=function(t,e){var n=t.path,r=t.id,o=io(dm(n),4),i=o[0],a=o[1],s=o[2],u=o[3],l=t.getEdgeStyle().adjustLine,c=[];return c.push(uo(aE,no({x1:i.x,y1:i.y,x2:a.x,y2:a.y},l))),c.push(uo(fE,{position:a,bezierModel:t,graphModel:e,type:"sNext"},"".concat(r,"_ePre"))),c.push(uo(aE,no({x1:u.x,y1:u.y,x2:s.x,y2:s.y},l))),c.push(uo(fE,{position:s,bezierModel:t,graphModel:e,type:"ePre"},"".concat(r,"_sNext"))),c},n.prototype.selectedBezierEdge=function(){for(var e=this.props.graphModel,n=e.edges,r=[],o=0;o<n.length;o++){var i=n[o];i.isSelected&&i.modelType===t.ModelType.BEZIER_EDGE&&i.draggable&&r.push(this.getBezierAdjust(i,e))}return r},n.prototype.render=function(){return uo("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},n=oo([Ax],n)}(Vn),vE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.render=function(){return uo("div",{className:"lf-background",children:uo("div",{style:this.props.background,className:"lf-background-area"})})},e}(Vn),yE=function(t){function e(){var e=t.apply(this,ao([],io(arguments),!1))||this;return e.id=_b(),e}return eo(e,t),e.prototype.renderDot=function(){var t=this.props,e=t.config,n=t.size,r=void 0===n?1:n,o=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,u=void 0===s?2:s,l=Math.min(Math.max(2,u),r/4);return uo("g",{fill:a,opacity:o?1:0,children:[uo("circle",{cx:0,cy:0,r:l/2}),uo("circle",{cx:0,cy:r,r:l/2}),uo("circle",{cx:r,cy:0,r:l/2}),uo("circle",{cx:r,cy:r,r:l/2})]})},e.prototype.renderMesh=function(){var t=this.props,e=t.config,n=t.size,r=void 0===n?1:n,o=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,u=void 0===s?1:s,l=Math.min(Math.max(1,u),r/2);return uo("path",{d:"M 0 0 H ".concat(r," V ").concat(r," H 0 Z"),stroke:a,strokeWidth:l,opacity:o?1:0,fill:"transparent"})},e.prototype.render=function(){var t=this.props,e=t.type,n=t.size,r=void 0===n?1:n,o=t.graphModel.transformModel,i=[o.SCALE_X,o.SKEW_Y,o.SKEW_X,o.SCALE_Y,o.TRANSLATE_X,o.TRANSLATE_Y].join(","),a="matrix(".concat(i,")");return uo("div",{className:"lf-grid",children:uo("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[uo("defs",{children:uo("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:a,x:"0",y:"0",width:r,height:r,children:["dot"===e&&this.renderDot(),"mesh"===e&&this.renderMesh()]})}),uo("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=oo([Ax],e)}(Vn);!function(t){t.defaultProps={size:10,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}},t.getGridOptions=function(e){var n=up(t.defaultProps);return Ls(n,"number"==typeof e?{size:e}:"boolean"==typeof e?{visible:e}:e)}}(yE||(yE={}));var gE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.render=function(){return uo("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:uo("g",{transform:this.props.graphModel.transformModel.getTransformStyle().transform,children:this.props.children})})},e=oo([Ax],e)}(Vn),_E=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return eo(n,e),n.prototype.getNodesOutline=function(){var t=this.props.graphModel,e=t.nodes,n=t.editConfigModel,r=n.hoverOutline,o=n.nodeSelectedOutline,i=[];return e.forEach((function(t){if(t.isHovered||t.isSelected){var e=t.isHovered,n=t.isSelected,a=t.x,s=t.y,u=t.width,l=t.height;if(o&&n||r&&e){var c=t.getOutlineStyle(),p={};if(Object.keys(c).forEach((function(t){"hover"!==t&&(p[t]=c[t])})),e){var d=c.hover;p=no(no({},p),d)}i.push(uo(sE,no({transform:t.transform,className:"lf-outline-node",x:a,y:s,width:u+10,height:l+10},p)))}}})),i},n.prototype.getEdgeOutline=function(){for(var e=this.props.graphModel,n=e.edges,r=e.editConfigModel,o=r.edgeSelectedOutline,i=r.hoverOutline,a=[],s=0;s<n.length;s++){var u=n[s];(o&&u.isSelected||i&&u.isHovered)&&(u.modelType===t.ModelType.LINE_EDGE?a.push(this.getLineOutline(u)):u.modelType===t.ModelType.POLYLINE_EDGE?a.push(this.getPolylineOutline(u)):u.modelType===t.ModelType.BEZIER_EDGE&&a.push(this.getBezierOutline(u)))}return a},n.prototype.getLineOutline=function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,o=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10,s=t.getOutlineStyle();return uo(sE,no({className:"lf-outline-edge",x:r,y:o,width:i,height:a},s))},n.prototype.getPolylineOutline=function(t){var e=t.points,n=om(e),r=j_(n,8),o=r.x,i=r.y,a=r.width,s=r.height,u=t.getOutlineStyle();return uo(sE,no({className:"lf-outline",x:o,y:i,width:a,height:s},u))},n.prototype.getBezierOutline=function(t){var e=t.path,n=dm(e),r=j_(n,8),o=r.x,i=r.y,a=r.width,s=r.height,u=t.getOutlineStyle();return uo(sE,no({className:"lf-outline",x:o,y:i,width:a,height:s},u))},n.prototype.render=function(){return uo("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},n=oo([Ax],n)}(Vn),mE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.render=function(){var t=this.props.snaplineModel,e=null!=t?t:{},n=e.position,r=e.isShowHorizontal,o=e.isShowVertical,i=null==t?void 0:t.getStyle(),a=null!=n?n:{},s=a.x,u=void 0===s?0:s,l=a.y,c=void 0===l?0:l,p=no(no({x1:-1e5,y1:c,x2:1e5,y2:c},i),{stroke:r?null==i?void 0:i.stroke:"none"}),d=no(no({x1:u,y1:-1e5,x2:u,y2:1e5},i),{stroke:o?null==i?void 0:i.stroke:"none"});return uo("g",{className:"lf-snapline",children:[uo(aE,no({},p)),uo(aE,no({},d))]})},e=oo([Ax],e)}(Vn),bE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var t=this.props,e=t.tool,n=t.graphModel,r=n.textEditElement,o=e.getTools().map((function(t){return Hn(t,{textEditElement:r,graphModel:n,lf:e.instance})}));return e.components=o,o},e.prototype.triggerToolRender=function(){var t=this.props,e=t.tool,n=t.graphModel,r=document.querySelector("#ToolOverlay_".concat(n.flowId)),o=e.getInstance();o.components.forEach((function(t){return t(o,r)})),o.components=[]},e.prototype.render=function(){var t=this.props.graphModel;return uo("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(t.flowId),children:this.getTools()})},e=oo([Ax],e)}(Vn),EE=function(e){function n(){var t=e.apply(this,ao([],io(arguments),!1))||this;return t.handleResize=function(){t.props.graphModel.resize()},t}return eo(n,e),n.prototype.componentDidMount=function(){window.addEventListener("resize",Jy(this.handleResize,200))},n.prototype.componentDidUpdate=function(){this.props.graphModel.eventCenter.emit(t.EventType.GRAPH_UPDATED,{})},n.prototype.componentWillUnmount=function(){window.removeEventListener("resize",Jy(this.handleResize,200))},n.prototype.getComponent=function(t,e,n){void 0===n&&(n="canvas-overlay");var r=(0,this.props.getView)(t.type);return r?uo(r,{model:t,graphModel:e,overlay:n},t.id):null},n.prototype.render=function(){var t=this,e=this.props,n=e.graphModel,r=e.tool,o=e.options,i=e.dnd,a=e.snaplineModel;o.width&&"".concat(n.width,"px"),o.height&&"".concat(n.height,"px");var s=o.grid&&yE.getGridOptions(o.grid),u=n.fakeNode,l=n.editConfigModel.adjustEdge;return uo("div",{className:"lf-graph","flow-id":n.flowId,children:[uo(rE,{graphModel:n,dnd:i,children:[uo("g",{className:"lf-base",children:Mf(n.sortElements,(function(e){return t.getComponent(e,n)}))}),u?this.getComponent(u,n):""]}),uo(gE,{graphModel:n,children:[uo(_E,{graphModel:n}),l?uo(hE,{graphModel:n}):"",!1!==o.snapline?uo(mE,{snaplineModel:a}):""]}),uo(bE,{graphModel:n,tool:r}),o.background&&uo(vE,{background:o.background}),s&&uo(yE,no({},s,{graphModel:n}))]})},n=oo([Ax],n)}(Vn),xE=function(e){function n(){var n=e.call(this)||this;return n.onDragStart=function(e){var r=e.event,o=n.props,i=o.anchorData,a=o.nodeModel,s=o.graphModel;s.selectNodeById(a.id),a.autoToFront&&s.toFront(a.id),s.eventCenter.emit(t.EventType.ANCHOR_DRAGSTART,{data:i,e:r,nodeModel:a}),n.setState({startX:i.x,startY:i.y,endX:i.x,endY:i.y})},n.onDragging=function(e){var r=e.event,o=n.props,i=o.graphModel,a=o.nodeModel,s=o.anchorData,u=i.transformModel,l=i.eventCenter,c=i.width,p=i.height,d=i.editConfigModel,f=d.autoExpand,h=d.stopMoveGraph;if(r){var v=r.clientX,y=r.clientY,g=i.getPointByClient({x:v,y:y}),_=g.domOverlayPosition,m=_.x,b=_.y,E=g.canvasOverlayPosition,x=E.x,M=E.y;n.t&&xb(n.t);var w=[];m<10?w=[10,0]:m+10>c?w=[-10,0]:b<10?w=[0,10]:b+10>p&&(w=[0,-10]),n.setState({endX:x,endY:M,dragging:!0}),n.moveAnchorEnd(x,M),w.length>0&&!h&&f&&(n.t=Eb((function(){var t=io(w,2),e=t[0],r=t[1];u.translate(e,r);var o=n.state,i=o.endX,a=o.endY;n.setState({endX:i-e,endY:a-r}),n.moveAnchorEnd(i-e,a-r)}))),l.emit(t.EventType.ANCHOR_DRAG,{data:s,e:r,nodeModel:a})}},n.onDragEnd=function(e){var r=e.event;n.t&&xb(n.t);var o=n.checkEnd(r);n.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),n.sourceRuleResults.clear(),n.targetRuleResults.clear();var i=n.props,a=i.graphModel,s=i.nodeModel,u=i.anchorData;o&&a.eventCenter.emit(t.EventType.ANCHOR_DRAGEND,{data:u,e:r,nodeModel:s,edgeModel:o})},n.checkEnd=function(e){var r,o=n.props,i=o.graphModel,a=o.nodeModel,s=o.anchorData,u=s.x,l=s.y,c=s.id,p=n.state,d=p.endX,f=p.endY,h=p.dragging,v=Lm({x:d,y:f},i);if(n.preTargetNode&&n.preTargetNode.state!==t.ElementState.DEFAULT&&n.preTargetNode.setElementState(t.ElementState.DEFAULT),h&&v&&v.node){var y=v.node,g=v.anchor.id,_="".concat(a.id,"_").concat(y.id,"_").concat(g,"_").concat(c),m=n.sourceRuleResults.get(_)||{},b=m.isAllPass,E=m.msg,x=n.targetRuleResults.get(_)||{},M=x.isAllPass,w=x.msg;if(b&&M){y.setElementState(t.ElementState.DEFAULT);var S=i.getNodeModelById(v.node.id),T=null===(r=i.edgeGenerator)||void 0===r?void 0:r.call(i,a.getData(),null==S?void 0:S.getData()),A=i.addEdge(no(no({},T),{sourceNodeId:a.id,sourceAnchorId:c,startPoint:{x:u,y:l},targetNodeId:v.node.id,targetAnchorId:v.anchor.id,endPoint:{x:v.anchor.x,y:v.anchor.y}})),O=n.props.anchorData;return i.eventCenter.emit(t.EventType.ANCHOR_DROP,{data:O,e:e,nodeModel:a,edgeModel:A}),A}var D=y.getData();return i.eventCenter.emit(t.EventType.CONNECTION_NOT_ALLOWED,{data:D,msg:w||E||"不允许添加连线"}),null}},n.sourceRuleResults=new Map,n.targetRuleResults=new Map,n.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},n.dragHandler=new __({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd}),n}return eo(n,e),n.prototype.getAnchorShape=function(){var t=this.props,e=t.anchorData,n=t.style,r=t.node.getAnchorShape(e);if(r)return r;var o=e.x,i=e.y,a=no(no({},n),null==n?void 0:n.hover);return uo("g",{children:[uo(lE,no({className:"lf-node-anchor-hover"},a,{x:o,y:i})),uo(lE,no({className:"lf-node-anchor"},n,{x:o,y:i}))]})},Object.defineProperty(n.prototype,"customTrajectory",{get:function(){return this.props.graphModel.customTrajectory},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"relateEdges",{get:function(){var t=this.props,e=t.graphModel,n=e.getAnchorIncomingEdge,r=e.getAnchorOutcomingEdge,o=t.anchorData.id;return{incomingEdgeList:n(o),outcomingEdgeList:r(o)}},enumerable:!1,configurable:!0}),n.prototype.moveAnchorEnd=function(e,n){var r,o,i=this.props,a=i.graphModel,s=i.nodeModel,u=i.anchorData,l=Lm({x:e,y:n},a);if(l){var c=l.node,p=l.anchor.id;if(this.preTargetNode&&this.preTargetNode!==l.node&&this.preTargetNode.setElementState(t.ElementState.DEFAULT),u.id===p)return;this.preTargetNode=c;var d="".concat(s.id,"_").concat(c.id,"_").concat(p,"_").concat(u.id);if(!this.targetRuleResults.has(d)){var f=l.anchor,h=s.isAllowConnectedAsSource(c,u,f),v=c.isAllowConnectedAsTarget(s,u,f);this.sourceRuleResults.set(d,Jm(h)),this.targetRuleResults.set(d,Jm(v))}var y=(null!==(r=this.sourceRuleResults.get(d))&&void 0!==r?r:{}).isAllPass,g=(null!==(o=this.targetRuleResults.get(d))&&void 0!==o?o:{}).isAllPass;y&&g?c.setElementState(t.ElementState.ALLOW_CONNECT):c.setElementState(t.ElementState.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==t.ElementState.DEFAULT&&this.preTargetNode.setElementState(t.ElementState.DEFAULT)},n.prototype.isShowLine=function(){var t=this.state,e=t.startX,n=t.startY,r=t.endX,o=t.endY;return Rm(e,n,r,o)>10},n.prototype.render=function(){var t=this,e=this.state,n=e.startX,r=e.startY,o=e.endX,i=e.endY,a=this.props,s=a.anchorData.edgeAddable,u=a.edgeStyle;return uo("g",{className:"lf-anchor",children:[uo("g",{onMouseDown:function(e){!1!==s&&t.dragHandler.handleMouseDown(e)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(no({sourcePoint:{x:n,y:r},targetPoint:{x:o,y:i}},u)):uo(aE,no({x1:n,y1:r,x2:o,y2:i},u,{"pointer-events":"none"})))]})},n}(Vn),ME=function(e){function n(n){var r=e.call(this,n)||this;return r.style={},r.onDragging=function(e){var n,o=e.event,i=r.props,a=i.graphModel,s=i.nodeModel,u=i.eventCenter,l=a.selectNodes,c=s.x,p=s.y,d=o.clientX,f=o.clientY,h=a.getPointByClient({x:d,y:f}).canvasOverlayPosition,v=h.x,y=h.y,g=new Am(v-c,y-p),_=(null===(n=r.normal)||void 0===n?void 0:n.angle(g))-r.defaultAngle,m=new Cm(-c,-p).rotate(_).translate(c,p).toString();s.transform=m,s.rotate=_;var b=Mf(l,(function(t){return t.id}));-1===b.indexOf(s.id)&&(b=[s.id]);var E=dy(b,(function(t,e){var n=a.getNodeModelById(e);return t[e]=null==n?void 0:n.getMoveDistance(0,0,!1),t}),{});b.forEach((function(t){a.getNodeEdges(t).forEach((function(t){if(E[t.sourceNodeId]){var e=a.getNodeModelById(t.sourceNodeId).anchors.find((function(e){return e.id===t.sourceAnchorId}));t.updateStartPoint(e)}if(E[t.targetNodeId]){e=a.getNodeModelById(t.targetNodeId).anchors.find((function(e){return e.id===t.targetAnchorId}));t.updateEndPoint(e)}}))})),u.emit(t.EventType.NODE_ROTATE,{e:o,model:s,data:s.getData()})},r.style=n.style,r.stepperDrag=new __({onDragging:r.onDragging}),r}return eo(n,e),n.prototype.render=function(){var t=this,e=this.props.nodeModel,n=e.x,r=e.y,o=n+e.width/2+20,i=r-e.height/2-20;return this.normal=new Am(1,0),this.defaultAngle=this.normal.angle(new Am(o-n,i-r)),e.defaultAngle=this.defaultAngle,uo("g",{className:"lf-rotate-control",children:uo("g",{onMouseDown:function(e){t.stepperDrag.handleMouseDown(e)},children:uo(lE,no({},this.style,{cx:o,cy:i}))})})},n}(Vn),wE={},SE={get exports(){return wE},set exports(t){wE=t}};
26
26
  /*!
27
27
  Copyright (c) 2018 Jed Watson.
28
28
  Licensed under the MIT License (MIT), see
29
29
  http://jedwatson.github.io/classnames
30
30
  */
31
- !function(t){!function(){var e={}.hasOwnProperty;function n(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=o(t,r(n)))}return t}function r(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var r="";for(var i in t)e.call(t,i)&&t[i]&&(r=o(r,i));return r}function o(t,e){return e?t?t+" "+e:t+e:t}t.exports?(n.default=n,t.exports=n):window.classNames=n}()}(uE);var lE,cE=sE,pE=function(e){function n(n){var r=e.call(this)||this;r.mouseDownHandler=function(t){var e=r.props,n=e.draggable,o=e.model,i=e.graphModel.editConfigModel.nodeTextDraggable;(n||i)&&(r.stepperDrag.model=o,r.stepperDrag.handleMouseDown(t))},r.onDragging=function(t){var e=t.deltaX,n=t.deltaY,o=r.props,i=o.model,a=o.graphModel.transformModel;if(e&&n){var s=io(a.fixDeltaXY(e,n),2),u=s[0],l=s[1];i.moveText(u,l)}},r.dbClickHandler=function(){r.props.editable&&r.props.model.setElementState(t.ElementState.TEXT_EDIT)};var o=n.draggable;return r.stepperDrag=new f_({onDragging:r.onDragging,step:1,isStopPropagation:o}),r}return eo(n,e),n.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel,r=e.text,o=r.value,i=r.x,a=r.y,s=r.editable,u=r.draggable,l={x:i,y:a,className:"",value:o},c=e.getTextStyle(),p=n.nodeTextDraggable||u;return uo(Ub,no({},l,c,{className:cE({"lf-element-text":s,"lf-text-draggable":!s&&p,"lf-text-disabled":!s&&!p}),model:e}))},n.prototype.render=function(){if(this.props.model.text)return uo("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},n}(Vn),dE=function(t){function e(e){var n=t.call(this,e)||this;return n.setHoverOn=function(){n.setState({isHovered:!0})},n.setHoverOff=function(){n.setState({isHovered:!1})},n.state={isHovered:!1},n}return eo(e,t),e.prototype.getBackground=function(){var t=this.state.isHovered,e=this.props.model,n=e.text,r=e.getTextStyle(),o=r.background||{};if(t&&r.hover&&r.hover.background&&(o=no(no({},o),r.hover.background)),(null==n?void 0:n.value)&&"transparent"!==(null==o?void 0:o.fill)){var i=r.fontSize,a=r.textWidth,s=r.lineHeight,u=r.overflowMode,l=o.wrapPadding,c=null==n?void 0:n.value.split(/[\r\n]/g),p=c.length,d=n.x,f=n.y,h={};if("autoWrap"===u&&a){var y=jm({rows:c,style:{fontSize:"".concat(i,"px"),width:"".concat(a,"px"),lineHeight:s,padding:l},rowsLength:p,className:"lf-get-text-height"});h=no(no({},o),{x:d,y:f,width:a,height:y})}else{var v=im({rows:c,rowsLength:p,fontSize:i}),g=v.width,_=v.height;if("ellipsis"===u&&(g=a,_=i+2),"string"==typeof o.wrapPadding){var m=o.wrapPadding.split(",").filter((function(t){return t.trim()})).map((function(t){return parseFloat(t.trim())}));if(m.length>0&&m.length<=4){if(1===m.length){var b=io(m,1)[0];m=[b,b,b,b]}else if(2===m.length){var E=io(m,2),x=E[0];m=[x,w=E[1],x,w]}else if(3===m.length){var w,S=io(m,3);m=[S[0],w=S[1],S[2],w]}var M=io(m,4),A=M[0],T=M[1],O=M[2],N=M[3];g+=T+N,_+=A+O,d+=(T-N)/2,f+=(O-A)/2}}h=no(no({},o),{x:d-1,y:f-1,width:g,height:_})}return uo(Wb,no({},h))}return null},e.prototype.getShape=function(){var t=this.props.model,e=t.text,n=e.x,r=e.y,o=e.value;if(!o)return null;var i=t.getTextStyle(),a=no({x:n,y:r,value:o,model:t,className:"lf-element-text"},i);return uo("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),uo(Ub,no({},a))]})},e}(pE);!function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"}(lE||(lE={}));var fE,hE=function(e){function n(n){var r=e.call(this)||this;r.updateEdgePointByAnchors=function(){var t=r.nodeModel,e=t.id,n=t.anchors;Yd(r.graphModel.getNodeEdges(e),(function(t){if(t.sourceNodeId===e)(r=yf(n,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:r.x,y:r.y});else if(t.targetNodeId===e){var r;(r=yf(n,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:r.x,y:r.y})}}))},r.triggerResizeEvent=function(e,n){r.graphModel.eventCenter.emit(t.EventType.NODE_RESIZE,{preNodeData:e,nextNodeData:n})},r.recalcResizeInfo=function(t,e,n,r,o){void 0===n&&(n=1),void 0===r&&(r=!1),void 0===o&&(o=!1);var i=up(e),a=i.deltaX,s=i.deltaY,u=i.width,l=i.height,c=i.PCTResizeInfo;if(c){var p=0,d=0;switch(t){case lE.LEFT_TOP:d=(-1*a-s)/4;break;case lE.RIGHT_TOP:d=(a-s)/4;break;case lE.RIGHT_BOTTOM:d=(a+s)/4;break;case lE.LEFT_BOTTOM:d=(-1*a+s)/4}0!==d&&(p=Math.round(d/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+p,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+p,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var f=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),h=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case lE.LEFT_TOP:a=u-f,s=l-h;break;case lE.RIGHT_TOP:a=f-u,s=l-h;break;case lE.RIGHT_BOTTOM:a=f-u,s=h-l;break;case lE.LEFT_BOTTOM:a=u-f,s=h-l}return i}switch(t){case lE.LEFT_TOP:i.width=r?u:u-a*n,i.height=o?l:l-s*n;break;case lE.RIGHT_TOP:i.width=r?u:u+a*n,i.height=o?l:l-s*n;break;case lE.RIGHT_BOTTOM:i.width=r?u:u+a*n,i.height=o?l:l+s*n;break;case lE.LEFT_BOTTOM:i.width=r?u:u-a*n,i.height=o?l:l+s*n}return i},r.resizeNode=function(t){var e=t.deltaX,n=t.deltaY,o=r.nodeModel,i=o.r,a=o.rx,s=o.ry,u=o.width,l=o.height,c=o.PCTResizeInfo,p=o.minWidth,d=o.minHeight,f=o.maxWidth,h=o.maxHeight,y=p===f,v=d===h,g={width:i||a||u,height:i||s||l,deltaX:e,deltaY:n,PCTResizeInfo:c},_=i||a&&s?.5:1,m=r.recalcResizeInfo(r.index,g,_,y,v);if(m.width<p||m.width>f||m.height<d||m.height>h)r.dragHandler.cancelDrag();else{m.deltaX=y?0:m.deltaX,m.deltaY=y?0:m.deltaY;var b=r.nodeModel.getData(),E=r.nodeModel.resize(m);console.log("nextNodeData ===>>>",E),r.updateEdgePointByAnchors(),r.triggerResizeEvent(b,E)}},r.onDragging=function(t){var e=t.deltaX,n=t.deltaY,o=io(r.graphModel.transformModel.fixDeltaXY(e,n),2),i=o[0],a=o[1];r.resizeNode({deltaX:i,deltaY:a})},r.onDragEnd=function(){var t=r.nodeModel.x,e=r.nodeModel.y;r.nodeModel.moveTo(t,e),r.updateEdgePointByAnchors()};var o=n.index,i=n.model,a=n.graphModel;return r.index=o,r.nodeModel=i,r.graphModel=a,r.dragHandler=new f_({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:a.gridSize}),r}return eo(n,e),n.prototype.render=function(){var t=this.props,e=t.x,n=t.y,r=t.direction,o=t.model.getResizeControlStyle(),i=o.width,a=o.height,s=ro(o,["width","height"]);return uo("g",{className:"lf-resize-control lf-resize-control-".concat(r),children:uo(Wb,no({className:"lf-resize-control-content",x:e,y:n,width:null!=i?i:7,height:null!=a?a:7},s,{onMouseDown:this.dragHandler.handleMouseDown}))})},n}(Vn),yE=function(t){function e(){return t.call(this)||this}return eo(e,t),e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=Mm(e),o=r.minX,i=r.minY,a=r.maxX,s=r.maxY;return wf([{index:lE.LEFT_TOP,direction:"nw",x:o,y:i},{index:lE.RIGHT_TOP,direction:"ne",x:a,y:i},{index:lE.RIGHT_BOTTOM,direction:"se",x:a,y:s},{index:lE.LEFT_BOTTOM,direction:"sw",x:o,y:s}],(function(t){return uo(hE,no({},t,{model:e,graphModel:n}))}))},e.prototype.getResizeOutline=function(){var t=this.props.model,e=t.x,n=t.y,r=t.width,o=t.height,i=t.getResizeOutlineStyle();return uo(Wb,no({},i,{x:e,y:n,width:r,height:o}))},e.prototype.render=function(){return uo("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e}(Vn),vE=function(e){function n(n){var r=e.call(this)||this;r.onDragStart=function(t){var e=t.event,n=r.props,o=n.model,i=n.graphModel;if(e){var a=i.getPointByClient({x:e.clientX,y:e.clientY}).canvasOverlayPosition,s=a.x,u=a.y;r.moveOffset={dx:o.x-s,dy:o.y-u}}},r.onDragging=function(t){var e,n,o,i,a=t.event,s=r.props,u=s.model,l=s.graphModel,c=l.editConfigModel,p=c.stopMoveGraph,d=c.autoExpand,f=l.transformModel,h=l.selectNodes,y=l.width,v=l.height,g=l.gridSize;u.isDragging=!0;var _=a,m=_.clientX,b=_.clientY,E=l.getPointByClient({x:m,y:b}).canvasOverlayPosition,x=E.x,w=E.y,S=io(f.CanvasPointToHtmlPoint([x,w]),2),M=S[0],A=S[1];if(x+=null!==(n=null===(e=r.moveOffset)||void 0===e?void 0:e.dx)&&void 0!==n?n:0,w+=null!==(i=null===(o=r.moveOffset)||void 0===o?void 0:o.dy)&&void 0!==i?i:0,x=am(x,g),w=am(w,g),y&&v){if(!d||p||!(M<0||A<0||M>y||A>v)){var T=io(f.CanvasPointToHtmlPoint([x-u.width/2,w-u.height/2]),2),O=T[0],N=T[1],D=io(f.CanvasPointToHtmlPoint([x+u.width/2,w+u.height/2]),2),P=D[0],C=D[1],I=Math.max(g,20),j=[];O<0?j=[I,0]:P>l.width?j=[-I,0]:N<0?j=[0,I]:C>l.height&&(j=[0,-I]),r.t&&ib(r.t),u.transform=new gm(-x,-w).rotate(u.rotate).translate(x,w).toString();var k=h.map((function(t){return t.id}));-1===k.indexOf(u.id)&&(k=[u.id]),j.length>0&&!p&&d?r.t=ob((function(){var t=io(j,2),e=t[0],n=t[1];f.translate(null!=e?e:0,null!=n?n:0);var r=-(null!=e?e:0)/f.SCALE_X,o=-(null!=n?n:0)/f.SCALE_X;l.moveNodes(k,r,o)})):l.moveNodes(k,x-u.x,w-u.y)}}else l.moveNode2Coordinate(u.id,x,w)},r.onDragEnd=function(){r.t&&ib(r.t),r.props.model.isDragging=!1},r.handleMouseUp=function(){var t=r.props.model;r.mouseUpDrag=t.isDragging},r.handleClick=function(e){var n=!1===r.mouseUpDrag;if(r.startTime){var o=r.props,i=o.model,a=o.graphModel;if(n){var s={data:i.getData(),e:e,position:a.getPointByClient({x:e.clientX,y:e.clientY}),isSelected:!1,isMultiple:!1},u=2===e.button,l=2===e.detail;if(!u){var c=a.editConfigModel,p=lm(e,c);s.isMultiple=p,i.isSelected&&!l&&p?(s.isSelected=!1,i.setSelected(!1)):(a.selectNodeById(i.id,p),s.isSelected=!0,r.toFront()),l?(c.nodeTextEdit&&i.text.editable&&(i.setSelected(!1),a.setElementStateById(i.id,t.ElementState.TEXT_EDIT)),a.eventCenter.emit(t.EventType.NODE_DBCLICK,s)):(a.eventCenter.emit(t.EventType.ELEMENT_CLICK,s),a.eventCenter.emit(t.EventType.NODE_CLICK,s))}}}},r.handleContextMenu=function(e){e.preventDefault();var n=r.props,o=n.model,i=n.graphModel,a=o.getData(),s=i.getPointByClient({x:e.clientX,y:e.clientY});i.setElementStateById(o.id,t.ElementState.SHOW_MENU,s.domOverlayPosition),o.isSelected||i.selectNodeById(o.id),i.eventCenter.emit(t.EventType.NODE_CONTEXTMENU,{data:a,e:e,position:s}),r.toFront()},r.handleMouseDown=function(t){var e=r.props,n=e.model,o=e.graphModel;r.startTime=(new Date).getTime(),o.editConfigModel.adjustNodePosition&&n.draggable&&r.stepDrag&&r.stepDrag.handleMouseDown(t)},r.setHoverOn=function(e){var n=r.props,o=n.model,i=n.graphModel;if(!o.isHovered){var a=o.getData();o.setHovered(!0),i.eventCenter.emit(t.EventType.NODE_MOUSEENTER,{data:a,e:e})}},r.setHoverOff=function(e){var n=r.props,o=n.model,i=n.graphModel,a=o.getData();o.isHovered&&(o.setHovered(!1),i.eventCenter.emit(t.EventType.NODE_MOUSELEAVE,{data:a,e:e}))},r.onMouseOut=function(t){o_&&r.setHoverOff(t)};var o=n.graphModel,i=o.gridSize,a=o.eventCenter,s=n.model;return r.stepDrag=new f_({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:i,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),r.modelDisposer=ae((function(){return r.props}),(function(t){t&&t.model&&r.stepDrag.setModel(t.model)})),r}return eo(n,e),n.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer()},n.prototype.componentDidMount=function(){},n.prototype.componentDidUpdate=function(){},n.prototype.getAnchorShape=function(t){return null},n.prototype.getAnchors=function(){var t=this,e=this.props,n=e.model,r=e.graphModel,o=n.isSelected,i=n.isHitable,a=n.isDragging,s=n.isShowAnchor;return i&&(o||s)&&!a?wf(n.anchors,(function(e,o){var i=n.getAnchorLineStyle(e),a=n.getAnchorStyle(e);return uo(iE,{anchorData:e,node:t,style:a,edgeStyle:i,anchorIndex:o,nodeModel:n,graphModel:r,setHoverOff:t.setHoverOff})})):[]},n.prototype.getRotateControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.isSelected,o=e.isHitable,i=e.enableRotate,a=e.isHovered,s=e.getRotateControlStyle();if(o&&(r||a)&&i)return uo(aE,{graphModel:n,nodeModel:e,eventCenter:n.eventCenter,style:s})},n.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.isSelected,o=e.isHitable,i=e.enableResize,a=e.isHovered,s=e.getResizeControlStyle();return o&&(r||a)&&i?uo(yE,{style:s,model:e,graphModel:n}):null},n.prototype.getText=function(){var e,n=this.props,r=n.model,o=n.graphModel;if(r.state===t.ElementState.TEXT_EDIT)return null;if(r.text){var i=o.editConfigModel,a=!1;return(r.text.draggable||i.nodeTextDraggable)&&(a=!0),uo(pE,{editable:i.nodeTextEdit&&(null===(e=r.text.editable)||void 0===e||e),model:r,graphModel:o,draggable:a})}return null},n.prototype.getStateClassName=function(){var e=this.props.model,n=e.state,r=e.isDragging,o=e.isSelected,i="lf-node";switch(n){case t.ElementState.ALLOW_CONNECT:i+=" lf-node-allow";break;case t.ElementState.NOT_ALLOW_CONNECT:i+=" lf-node-not-allow";break;default:i+=" lf-node-default"}return r&&(i+=" lf-isDragging"),o&&(i+=" lf-node-selected"),i},n.prototype.toFront=function(){var t=this.props,e=t.model,n=t.graphModel;e.autoToFront&&n.toFront(e.id)},n.prototype.render=function(){var t,e=this.props,n=e.model,r=e.graphModel,o=r.editConfigModel,i=o.hideAnchors,a=o.adjustNodePosition,s=o.allowRotate,u=o.allowResize,l=r.gridSize,c=r.transformModel.SCALE_X,p=n.isHitable,d=n.draggable,f=n.transform,h=n.getOuterGAttributes(),y=h.className,v=void 0===y?"":y,g=ro(h,["className"]),_=uo("g",{className:"lf-node-content",children:[uo("g",{transform:f,children:[this.getShape(),this.getText(),s&&this.getRotateControl(),u&&this.getResizeControl()]}),!i&&this.getAnchors()]});return p?(a&&d&&this.stepDrag.setStep(l*c),t=uo("g",no({className:"".concat(this.getStateClassName()," ").concat(v),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu},g,{children:_}))):t=uo("g",no({className:"".concat(this.getStateClassName()," ").concat(v)},g,{children:_})),t},n.isObserved=!1,n}(Vn),gE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return uo(Wb,no({},e,{x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius}))},e}(vE),_E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.r,o=t.getNodeStyle();return uo(Vb,no({},o,{x:e,y:n,r:r}))},e}(vE),mE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t,n=e.x,r=e.y,o=e.width,i=e.height,a=e.points,s=t.getNodeStyle(),u={transform:"matrix(1 0 0 1 ".concat(n-o/2," ").concat(r-i/2,")")};return uo("g",no({},u,{children:uo(Kb,no({},s,{points:a,x:n,y:r}))}))},e}(vE),bE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return uo("g",{children:uo(Kb,no({},e,{points:t.points,x:t.x,y:t.y}))})},e}(vE),EE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return uo(Fb,no({},e,{x:t.x,y:t.y,rx:t.rx,ry:t.ry}))},e}(vE),xE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getBackground=function(){var t=this.props.model,e=t.getTextStyle(),n=t.width,r=t.height,o=t.x,i=t.y,a=no(no({},e.background),{x:o,y:i,width:n,height:r});return uo(Wb,no({},a))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return uo("g",{children:this.getBackground()})},e}(vE),wE=function(t){function e(){var e=t.apply(this,ao([],io(arguments),!1))||this;return e.ref={current:null},e}return eo(e,t),Object.defineProperty(e.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),e.prototype.setHtml=function(t){t.appendChild(document.createElement("div"))},e.prototype.confirmUpdate=function(t){this.setHtml(t)},e.prototype.shouldUpdate=function(){return(!this.preProperties||this.preProperties!==this.currentProperties)&&(this.preProperties=this.currentProperties,!0)},e.prototype.componentDidMount=function(){console.log("HtmlNode ---\x3e>> componentDidMount - 初始化内容"),this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},e.prototype.componentDidUpdate=function(){console.log("HtmlNode ---\x3e>> componentDidUpdate - 更新节点内容"),this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},e.prototype.componentWillUnmount=function(){this.rootEl.innerHTML=""},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.height,o=t.width,i=t.getNodeStyle();return this.currentProperties=JSON.stringify(t.properties),uo("foreignObject",no({},i,{x:e-o/2,y:n-r/2,width:o,height:r,ref:this.ref}))},e}(vE);t.AdjustType=void 0,(fE=t.AdjustType||(t.AdjustType={})).SOURCE="SOURCE",fE.TARGET="TARGET";var SE=function(e){function n(n){var r=e.call(this)||this;r.handleMouseDown=function(t){r.stepDrag&&r.stepDrag.handleMouseDown(t)},r.onDragStart=function(){var t=r.props,e=t.x,n=t.y,o=t.edgeModel,i=o.startPoint,a=o.endPoint,s=o.pointsList;r.oldEdge={startPoint:i,endPoint:a,pointsList:s},r.setState({endX:e,endY:n,dragging:!0})},r.onDragging=function(e){var n=e.deltaX,o=e.deltaY,i=r.state,a=i.endX,s=i.endY,u=r.props,l=u.graphModel,c=u.type,p=l.transformModel,d=l.editConfigModel,f=io(p.moveCanvasPointByHtml([a,s],n,o),2),h=f[0],y=f[1];r.setState({endX:h,endY:y,dragging:!0});var v=r.props.edgeModel,g=mm({x:a,y:s},l);if(g&&g.node&&r.isAllowAdjust(g).pass){var _=void 0,m=v.startPoint,b=v.endPoint,E=v.sourceNode,x=v.targetNode;c===t.AdjustType.SOURCE?_={startPoint:{x:g.anchor.x,y:g.anchor.y},endPoint:{x:b.x,y:b.y},sourceNode:g.node,targetNode:x}:c===t.AdjustType.TARGET&&(_={startPoint:{x:m.x,y:m.y},endPoint:{x:g.anchor.x,y:g.anchor.y},sourceNode:E,targetNode:g.node}),v.updateAfterAdjustStartAndEnd(_)}else c===t.AdjustType.SOURCE?v.updateStartPoint({x:h,y:y}):c===t.AdjustType.TARGET&&v.updateEndPoint({x:h,y:y});v.text.value&&d.adjustEdge&&v.setText(Object.assign({},v.text,v.textPosition))},r.onDragEnd=function(e){var n,o,i,a=e.event;try{r.setState({dragging:!1});var s=r.props,u=s.graphModel,l=s.edgeModel,c=s.type,p=r.state,d=p.endX,f=p.endY,h=p.dragging,y=mm({x:d,y:f},u);if(!h)return;var v=!1,g=void 0;if(y&&y.node){var _=r.isAllowAdjust(y),m=_.pass,b=_.msg,E=_.newTargetNode;if(m){var x=l.getData(),w=x.text,S=x.sourceAnchorId,M=void 0===S?"":S,A=x.targetAnchorId,T=void 0===A?"":A,O=ro(x,["text","sourceAnchorId","targetAnchorId"]);if(g=no(no({sourceAnchorId:M,targetAnchorId:T},O),{text:(null==w?void 0:w.value)||""}),c===t.AdjustType.SOURCE){var N=u.getNodeModelById(y.node.id),D=u.getNodeModelById(l.targetNodeId),P=null===(n=u.edgeGenerator)||void 0===n?void 0:n.call(u,null==N?void 0:N.getData(),null==D?void 0:D.getData(),g);g=no(no({},P),{sourceNodeId:y.node.id,sourceAnchorId:y.anchor.id,startPoint:{x:y.anchor.x,y:y.anchor.y},targetNodeId:l.targetNodeId,endPoint:no({},l.endPoint)}),l.sourceNodeId===y.node.id&&l.sourceAnchorId===y.anchor.id&&(v=!0)}else if(c===t.AdjustType.TARGET){N=u.getNodeModelById(l.sourceNodeId),D=u.getNodeModelById(y.node.id),P=null===(o=u.edgeGenerator)||void 0===o?void 0:o.call(u,null==N?void 0:N.getData(),null==D?void 0:D.getData(),g);g=no(no({},P),{sourceNodeId:l.sourceNodeId,startPoint:no({},l.startPoint),targetNodeId:y.node.id,targetAnchorId:y.anchor.id,endPoint:{x:y.anchor.x,y:y.anchor.y}}),l.targetNodeId===y.node.id&&l.targetAnchorId===y.anchor.id&&(v=!0)}}else{v=!0;var C=E.getData();u.eventCenter.emit(t.EventType.CONNECTION_NOT_ALLOWED,{data:C,msg:b})}}else v=!0;if(v)r.recoveryEdge();else{var I=l.getData();u.deleteEdgeById(l.id);var j=u.addEdge(no({},g));u.eventCenter.emit(t.EventType.EDGE_EXCHANGE_NODE,{data:{newEdge:j.getData(),oldEdge:I}})}null===(i=r.preTargetNode)||void 0===i||i.setElementState(t.ElementState.DEFAULT)}finally{(u=r.props.graphModel).eventCenter.emit(t.EventType.ADJUST_POINT_DRAGEND,{e:a,data:r.stepDragData})}},r.recoveryEdge=function(){var e=r.props.edgeModel,n=r.oldEdge,o=n.startPoint,i=n.endPoint,a=n.pointsList;e.updateStartPoint(o),e.updateEndPoint(i),e.modelType!==t.ModelType.LINE_EDGE&&(e.pointsList=null!=a?a:[],e.initPoints())},r.getAdjustPointStyle=function(){return r.props.graphModel.theme.edgeAdjust},r.state={dragging:!1,endX:0,endY:0},r.targetRuleResults=new Map,r.sourceRuleResults=new Map;var o=n.type,i=n.edgeModel,a=n.graphModel.eventCenter;return r.stepDragData={type:o,edgeData:i.getData()},r.stepDrag=new f_({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:a,data:r.stepDragData}),r}return eo(n,e),n.prototype.isAllowAdjust=function(e){var n,r,o,i,a=this.props,s=a.edgeModel,u=s.id,l=s.sourceNode,c=s.targetNode,p=s.sourceAnchorId,d=s.targetAnchorId,f=a.type;if(f===t.AdjustType.SOURCE?(n=e.node,r=c,o=e.anchor,i=c.getAnchorInfo(d)):(n=l,r=e.node,i=e.anchor,o=l.getAnchorInfo(p)),this.preTargetNode&&this.preTargetNode!==e.node&&this.preTargetNode.setElementState(t.ElementState.DEFAULT),this.preTargetNode=e.node,i.id===o.id)return{pass:!1,msg:"",newTargetNode:r};var h="".concat(n.id,"_").concat(r.id,"_").concat(o.id,"_").concat(i.id);if(!this.targetRuleResults.has(h)){var y=n.isAllowConnectedAsSource(r,o,i,u),v=r.isAllowConnectedAsTarget(n,o,i,u);this.sourceRuleResults.set(h,Rm(y)),this.targetRuleResults.set(h,Rm(v))}var g=this.sourceRuleResults.get(h),_=g.isAllPass,m=g.msg,b=this.targetRuleResults.get(h),E=b.isAllPass,x=b.msg,w=_&&E?t.ElementState.ALLOW_CONNECT:t.ElementState.NOT_ALLOW_CONNECT;return f===t.AdjustType.SOURCE?n.setElementState(w):r.setElementState(w),{pass:_&&E,msg:x||m,newTargetNode:r}},n.prototype.render=function(){var t=this.props,e=t.x,n=t.y,r=t.getAdjustPointShape,o=t.edgeModel,i=this.state.dragging;return uo("g",{pointerEvents:i?"none":"",onMouseDown:this.handleMouseDown,children:i?"":r(e,n,o)})},n}(Vn),ME=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getArrowAttributes=function(){var t=this.props,e=t.arrowInfo,n=t.style,r=e.start,o=e.end,i={start:r,end:o,offset:n.offset,verticalLength:n.verticalLength,type:"end"},a=h_(i),s=a.leftX,u=a.leftY,l=a.rightX,c=a.rightY;return no({d:"M".concat(s," ").concat(u," L").concat(o.x," ").concat(o.y," L").concat(l," ").concat(c," z")},n)},e.prototype.getShape=function(){var t=this.getArrowAttributes(),e=t.d,n=t.strokeWidth,r=t.stroke;return uo(Yb,{d:e,fill:t.fill,strokeWidth:n,stroke:r})},e.prototype.render=function(){return uo("g",{className:"lf-arrow",children:this.getShape()})},e}(Vn),AE=function(e){function n(){var n=e.call(this)||this;return n.textRef={current:null},n.handleHover=function(e,r){var o=n.props,i=o.model,a=o.graphModel.eventCenter;i.setHovered(e);var s=e?t.EventType.EDGE_MOUSEENTER:t.EventType.EDGE_MOUSELEAVE,u=i.getData();a.emit(s,{data:u,e:r})},n.setHoverOn=function(t){n.props.model.isHovered||(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOn(),n.handleHover(!0,t))},n.setHoverOff=function(t){n.props.model.isHovered&&(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOff(),n.handleHover(!1,t))},n.handleContextMenu=function(e){e.preventDefault(),n.contextMenuTime=(new Date).getTime(),n.clickTimer&&clearTimeout(n.clickTimer);var r=n.props,o=r.model,i=r.graphModel,a=i.getPointByClient({x:e.clientX,y:e.clientY});i.setElementStateById(o.id,t.ElementState.SHOW_MENU,a.domOverlayPosition),n.toFront(),o.isSelected||i.selectEdgeById(o.id);var s=null==o?void 0:o.getData();i.eventCenter.emit(t.EventType.EDGE_CONTEXTMENU,{data:s,e:e,position:a})},n.handleMouseDown=function(t){t.stopPropagation(),n.startTime=(new Date).getTime()},n.handleMouseUp=function(e){if(n.startTime&&!((new Date).getTime()-n.startTime>200||2===e.button)){var r=2===e.detail,o=n.props,i=o.model,a=o.graphModel,s=null==i?void 0:i.getData(),u=a.getPointByClient({x:e.clientX,y:e.clientY});if(r){var l=a.editConfigModel,c=a.textEditElement;if(c&&c.id===i.id&&a.setElementStateById(i.id,t.ElementState.DEFAULT),l.edgeTextEdit&&i.text.editable&&a.setElementStateById(i.id,t.ElementState.TEXT_EDIT),i.modelType===t.ModelType.POLYLINE_EDGE){var p=i,d=a.getPointByClient({x:e.x,y:e.y}).canvasOverlayPosition,f=d.x,h=d.y,y=em({x:f,y:h},p.points);p.dbClickPosition=y}a.eventCenter.emit(t.EventType.EDGE_DBCLICK,{data:s,e:e,position:u})}else a.eventCenter.emit(t.EventType.ELEMENT_CLICK,{data:s,e:e,position:u}),a.eventCenter.emit(t.EventType.EDGE_CLICK,{data:s,e:e,position:u});var v=a.editConfigModel;a.selectEdgeById(i.id,lm(e,v)),n.toFront()}},n}return eo(n,e),n.prototype.getShape=function(){return uo("g",{children:this.getEdge()})},n.prototype.getTextStyle=function(){},n.prototype.getText=function(){var e=this.props,n=e.model,r=e.graphModel;if(n.state===t.ElementState.TEXT_EDIT)return null;var o=!1,i=r.editConfigModel;return(n.text.draggable||i.edgeTextDraggable)&&(o=!0),uo(dE,{ref:this.textRef,editable:i.edgeTextEdit&&n.text.editable,model:n,graphModel:r,draggable:o})},n.prototype.getArrowInfo=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=t.isSelected;return{start:e,end:n,hover:this.state.hover,isSelected:r}},n.prototype.getLastTwoPoints=function(){var t=this.props.model;return[t.startPoint,t.endPoint]},n.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},n.prototype.getArrow=function(){var t=this.props.model,e=t.id,n=t.getArrowStyle(),r=n.refY,o=void 0===r?0:r,i=n.refX,a=void 0===i?2:i,s=io(this.getLastTwoPoints(),2),u=s[0],l=s[1],c="auto";return null!==u&&null!==l&&(c=pb(cb({x:l.x-u.x,y:l.y-u.y,z:0}))),uo("g",{children:uo("defs",{children:[uo("marker",{id:"marker-start-".concat(e),refX:-a,refY:o,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),uo("marker",{id:"marker-end-".concat(e),refX:a,refY:o,overflow:"visible",orient:c,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},n.prototype.getStartArrow=function(){return uo("path",{})},n.prototype.getEndArrow=function(){var t=this.props.model.getArrowStyle(),e=t.stroke,n=t.strokeWidth,r=t.offset,o=t.verticalLength;return uo("path",{stroke:e,fill:e,strokeWidth:n,transform:"rotate(180)",d:"M 0 0 L ".concat(r," -").concat(o," L ").concat(r," ").concat(o," Z")})},n.prototype.getAdjustPointShape=function(t,e,n){var r=n.getAdjustPointStyle();return uo(Vb,no({className:"lf-edge-adjust-point"},r,{x:t,y:e}))},n.prototype.getAdjustPoints=function(){var e=this.props,n=e.model,r=e.graphModel,o=n.getAdjustStart(),i=n.getAdjustEnd();return uo("g",{children:[uo(SE,no({type:t.AdjustType.SOURCE},o,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:n,graphModel:r})),uo(SE,no({type:t.AdjustType.TARGET},i,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:n,graphModel:r}))]})},n.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},n.prototype.getAppendWidth=function(){return uo("g",{})},n.prototype.getAppend=function(){return uo("g",{className:"lf-edge-append",children:this.getAppendWidth()})},n.prototype.getEdge=function(){return null},n.prototype.toFront=function(){var t=this.props,e=t.graphModel,n=t.model;e.toFront(n.id)},n.prototype.render=function(){var t=this.props.model,e=t.isSelected,n=t.isHitable,r=t.isShowAdjustPoint;return uo("g",{children:[uo("g",{className:["lf-edge",!n&&"pointer-none",e&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),r&&e?this.getAdjustPoints():""]})},n.isObserved=!1,n}(Vn),TE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.getEdgeStyle(),n=t,r=n.path,o=n.isAnimation,i=n.arrowConfig,a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,u=a.stroke,l=a.strokeDashoffset,c=a.animationName,p=a.animationDuration,d=a.animationIterationCount,f=a.animationTimingFunction,h=a.animationDirection;return uo(Yb,no({d:r},e,i,o?{strokeDasharray:s,stroke:u,style:{strokeDashoffset:l,animationName:c,animationDuration:p,animationIterationCount:d,animationTimingFunction:f,animationDirection:h}}:{}))},e.prototype.getAppendWidth=function(){return uo(Yb,{d:this.props.model.path,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var t=this.props.model,e=this.state.hover,n=t.isSelected,r=t.getArrowStyle().offset,o=t.pointsList.map((function(t){return{x:t.x,y:t.y}})),i=io(tm(o,r),2);return{start:i[0],end:i[1],hover:e,isSelected:n}},e.prototype.getLastTwoPoints=function(){var t=this.props.model,e=t.getArrowStyle().offset,n=t.pointsList.map((function(t){return{x:t.x,y:t.y}}));return tm(n,e)},e}(AE),OE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=t.isAnimation,o=t.arrowConfig,i=t.getEdgeStyle(),a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,u=a.stroke,l=a.strokeDashoffset,c=a.animationName,p=a.animationDuration,d=a.animationIterationCount,f=a.animationTimingFunction,h=a.animationDirection;return uo(Gb,no({},i,{x1:e.x,y1:e.y,x2:n.x,y2:n.y},o,r?{strokeDasharray:s,stroke:u,style:{strokeDashoffset:l,animationName:c,animationDuration:p,animationIterationCount:d,animationTimingFunction:f,animationDirection:h}}:{}))},e.prototype.getAppendWidth=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=Z_({start:e,end:n}),o=r.d,i=r.strokeWidth,a=r.fill,s=r.strokeDasharray;return uo(Yb,{d:o,fill:a,strokeWidth:i,stroke:r.stroke,strokeDasharray:s})},e}(AE),NE=function(e){function n(){var n=e.call(this)||this;return n.onDragStart=function(){var t=n.props.model;t.dragAppendStart(),n.isShowAdjustPointTemp=t.isShowAdjustPoint,t.isShowAdjustPoint=!1},n.onDragging=function(t){var e=t.deltaX,r=t.deltaY,o=n.props,i=o.model,a=o.graphModel;n.isDragging=!0;var s=a.transformModel,u=a.editConfigModel,l=io(s.fixDeltaXY(e,r),2),c=l[0],p=l[1],d=i,f=u.adjustEdgeMiddle;n.appendInfo=f?d.dragAppendSimple(n.appendInfo,{x:c,y:p}):d.dragAppend(n.appendInfo,{x:c,y:p})},n.onDragEnd=function(){var e,r=n.props,o=r.model,i=r.graphModel.eventCenter,a=o;a.dragAppendEnd(),n.isDragging=!1,a.isShowAdjustPoint=null!==(e=n.isShowAdjustPointTemp)&&void 0!==e&&e,n.appendInfo=void 0,i.emit(t.EventType.EDGE_ADJUST,{data:a.getData()})},n.beforeDragStart=function(t,e){e.draggable&&n.drag.handleMouseDown(t),n.appendInfo=e},n.drag=new f_({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,isStopPropagation:!1}),n}return eo(n,e),n.prototype.getEdge=function(){var t=this.props.model,e=t.points,n=t.isAnimation,r=t.arrowConfig,o=t.getEdgeStyle(),i=t.getEdgeAnimationStyle(),a=i.strokeDasharray,s=i.stroke,u=i.strokeDashoffset,l=i.animationName,c=i.animationDuration,p=i.animationIterationCount,d=i.animationTimingFunction,f=i.animationDirection;return uo(qb,no({points:e},o,r,n?{strokeDasharray:a,stroke:s,style:{strokeDashoffset:u,animationName:l,animationDuration:c,animationIterationCount:p,animationTimingFunction:d,animationDirection:f}}:{}))},n.prototype.getArrowInfo=function(){var t=this.props.model,e=t.points,n=t.isSelected,r=this.state.hover,o=Y_(e),i=o[0],a=o[0];return o.length>=2&&(i=o[o.length-2],a=o[o.length-1]),{start:i,end:a,hover:r,isSelected:n}},n.prototype.getLastTwoPoints=function(){var t=this.props.model.points,e=Y_(t),n=e[0],r=e[0];return e.length>=2&&(n=e[e.length-2],r=e[e.length-1]),[n,r]},n.prototype.getAppendAttributes=function(t){var e,n=t.start,r=t.end;if(n.x===r.x&&n.y===r.y)e="";else{var o={start:n,end:r,offset:10,verticalLength:5},i=h_(no(no({},o),{type:"start"})),a=h_(no(no({},o),{type:"end"}));e="M".concat(i.leftX," ").concat(i.leftY,"\n L").concat(i.rightX," ").concat(i.rightY,"\n L").concat(a.rightX," ").concat(a.rightY,"\n L").concat(a.leftX," ").concat(a.leftY," z")}return{d:e,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},n.prototype.getAppendShape=function(t){var e=this.getAppendAttributes(t),n=e.d,r=e.strokeWidth,o=e.fill,i=e.strokeDasharray;return uo(Yb,{d:n,fill:o,strokeWidth:r,stroke:e.stroke,strokeDasharray:i})},n.prototype.getAppendWidth=function(){for(var t=this,e=this.props,n=e.model,r=e.graphModel,o=n.pointsList,i=n.draggable,a=[],s=o.length,u=function(e){var n="lf-polyline-append",u={start:{x:o[e].x,y:o[e].y},end:{x:o[e+1].x,y:o[e+1].y},startIndex:e,endIndex:e+1,direction:p_.HORIZONTAL,draggable:!0},c=uo("g",{className:n,children:l.getAppendShape(u)}),p=r.editConfigModel,d=p.adjustEdge,f=p.adjustEdgeMiddle;if(d&&i){var h=u.startIndex,y=u.endIndex,v=f&&(0===h||y===s-1);u.draggable=!v,u.start.x===u.end.x?(u.draggable&&(n+="-ew-resize"),u.direction=p_.VERTICAL):u.start.y===u.end.y&&(u.draggable&&(n+="-ns-resize"),u.direction=p_.HORIZONTAL),c=uo("g",{className:l.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(e){return t.beforeDragStart(e,u)},children:uo("g",{className:n,children:l.getAppendShape(u)})})}a.push(c)},l=this,c=0;c<s-1;c++)u(c);return uo("g",{children:a})},n}(AE),DE=function(){function e(e){var n=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){n.nodeConfig=null,window.document.removeEventListener("mouseup",n.stopDrag)},this.dragEnter=function(t){n.nodeConfig&&!n.fakeNode&&(n.fakeNode=n.lf.createFakeNode(no(no({},n.nodeConfig),n.clientToLocalPoint({x:t.clientX,y:t.clientY}))))},this.onDragOver=function(e){if(e.preventDefault(),n.fakeNode){var r=n.clientToLocalPoint({x:e.clientX,y:e.clientY}),o=r.x,i=r.y;n.fakeNode.moveTo(o,i);var a=n.fakeNode.getData();n.lf.setNodeSnapLine(a),n.lf.graphModel.eventCenter.emit(t.EventType.NODE_DND_DRAG,{data:a})}return!1},this.onDragLeave=function(){n.fakeNode&&(n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)},this.onDrop=function(e){n.lf.graphModel&&e&&n.nodeConfig&&(n.lf.addNode(no(no({},n.nodeConfig),n.clientToLocalPoint({x:e.clientX,y:e.clientY})),t.EventType.NODE_DND_ADD,e),e.preventDefault(),e.stopPropagation(),n.nodeConfig=null,n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)};var r=e.lf;this.lf=r}return e.prototype.clientToLocalPoint=function(t){var e=t.x,n=t.y,r=cu(this.lf.options,["grid","size"]),o=this.lf.graphModel.getPointByClient({x:e,y:n}).canvasOverlayPosition,i=o.x,a=o.y;return{x:am(i,r),y:am(a,r)}},e.prototype.startDrag=function(t){var e=this.lf.graphModel.editConfigModel;(null==e?void 0:e.isSilentMode)||(this.nodeConfig=t,window.document.addEventListener("mouseup",this.stopDrag))},e.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},e}(),PE=function(e){function n(n){var r=e.call(this,n)||this;return r.ref={current:null},r.__prevText={type:"",text:"",id:""},r.keyupHandler=function(e){var n=r.props.graphModel.textEditElement;"Enter"===e.key&&e.altKey&&(null==n||n.setElementState(t.ElementState.DEFAULT))},r.inputHandler=function(t){var e=t.target.innerText,n=r.props.graphModel.textEditElement;n&&(r.__prevText={type:n.type,text:e.replace(/(\r\n)+$|(\n)+$/,""),id:n.id})},r.keydownHandler=function(t){t.stopPropagation()},r.state={style:{left:0,top:0}},r}return eo(n,e),n.getDerivedStateFromProps=function(e){var n,r,o=e.textEditElement,i=e.graphModel,a=i.transformModel,s=i.theme,u=s.inputText;if(o){if(!(null===(n=o.text)||void 0===n?void 0:n.value)&&o.BaseType===t.ElementType.EDGE){var l=o.text,c=o.textPosition,p=c.x,d=c.y;l.x=p,l.y=d,o.setText(l)}var f={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(o.BaseType===t.ElementType.EDGE){var h=s.edgeText,y=h.overflowMode,v=h.lineHeight,g=h.wrapPadding;(m=h.textWidth)&&"autoWrap"===y&&(r=no(no({},f),{width:m,minWidth:m,lineHeight:v,padding:g}))}else if(o.BaseType===t.ElementType.NODE){var _=s.nodeText,m=(y=_.overflowMode,v=_.lineHeight,g=_.wrapPadding,_.textWidth),b=o.width,E=o.modelType,x=o.textWidth||m||b;(E!==t.ModelType.TEXT_NODE&&"autoWrap"===y||E===t.ModelType.TEXT_NODE&&m)&&(r=no(no({},f),{width:x,minWidth:x,lineHeight:v,padding:g}))}var w=o.text,S=w.x,M=w.y,A=io(a.CanvasPointToHtmlPoint([S,M]),2),T=A[0],O=A[1];return{style:no(no({left:T,top:O},r),u)}}return null},n.prototype.componentDidUpdate=function(){var e=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),""!==this.__prevText.id){var n=this.__prevText,r=n.text,o=n.id;e.updateText(o,r),e.eventCenter.emit(t.EventType.TEXT_UPDATE,{data:no({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},n.prototype.placeCaretAtEnd=function(t){if(void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var n=window.getSelection();null==n||n.removeAllRanges(),null==n||n.addRange(e)}},n.prototype.render=function(){var t,e=this.props.graphModel.textEditElement,n=this.state.style;return e?uo("div",{contentEditable:!0,className:"lf-text-input",style:n,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:null===(t=e.text)||void 0===t?void 0:t.value},e.id):null},n.toolName="textEdit",n=oo([cx],n)}(Vn),CE=function(e){return e.modelType===t.ModelType.LINE_EDGE?function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,o=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:r-i/2,y:o-a/2,x1:r+i/2,y1:o+a/2}}(e):e.modelType===t.ModelType.POLYLINE_EDGE?function(t){var e=t.points,n=Y_(e),r=x_(n,8),o=r.x,i=r.y,a=r.width,s=r.height;return{x:o-a/2,y:i-s/2,x1:o+a/2,y1:i+s/2}}(e):e.modelType===t.ModelType.BEZIER_EDGE?function(t){var e=t.path,n=J_(e),r=x_(n,8),o=r.x,i=r.y,a=r.width,s=r.height;return{x:o-a/2,y:i-s/2,x1:o+a/2,y1:i+s/2}}(e):void 0},IE=function(e){function n(n){var r=e.call(this,n)||this;r.handleMouseDown=function(t){r.stepDrag.handleMouseDown(t)},r.handleWheelEvent=function(t){var e,n;t.preventDefault();var o=t.deltaX,i=t.deltaY,a=t.clientX,s=t.clientY,u=t.ctrlKey,l=new WheelEvent("wheel",{deltaX:o,deltaY:i,clientX:a,clientY:s,ctrlKey:u});null===(n=null===(e=r.props.logicFlow.container)||void 0===e?void 0:e.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))||void 0===n||n.dispatchEvent(l)},r.onDragging=function(t){var e=t.deltaX,n=t.deltaY,o=r.props,i=o.graphModel,a=o.logicFlow.getTransform(),s=a.SCALE_X,u=a.SCALE_Y,l=i.getSelectElements(!0);i.moveNodes(l.nodes.map((function(t){return t.id})),e/s,n/u)},r.handleContextMenu=function(e){e.preventDefault();var n=r.props,o=n.graphModel,i=n.graphModel,a=i.eventCenter,s=i.selectElements,u=o.getPointByClient({x:e.clientX,y:e.clientY}),l={nodes:[],edges:[]};ao([],io(s.values()),!1).forEach((function(e){e.BaseType===t.ElementType.NODE&&l.nodes.push(e.getData()),e.BaseType===t.ElementType.EDGE&&l.edges.push(e.getData())})),a.emit(t.EventType.SELECTION_CONTEXTMENU,{data:l,e:e,position:u})};var o=n.graphModel,i=o.gridSize,a=o.eventCenter;return r.stepDrag=new f_({onDragging:r.onDragging,step:i,eventType:"SELECTION",eventCenter:a}),r}return eo(n,e),n.prototype.render=function(){var e,n,r=this.props.graphModel,o=r.selectElements,i=r.transformModel,a=this.props.logicFlow.getTransform(),s=a.SCALE_X,u=a.SCALE_Y;if(!(o.size<=1)){var l=Number.MAX_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,p=Number.MIN_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER;return o.forEach((function(e){var n;e.BaseType===t.ElementType.NODE&&(n=function(t){var e=t.x,n=t.y,r=t.width,o=t.height;return{x:e-r/2,y:n-o/2,x1:e+r/2,y1:n+o/2}}(e)),e.BaseType===t.ElementType.EDGE&&(n=CE(e)),void 0!==n&&(l=Math.min(l,n.x),c=Math.min(c,n.y),p=Math.max(p,n.x1),d=Math.max(d,n.y1))})),e=io(i.CanvasPointToHtmlPoint([l,c]),2),l=e[0],c=e[1],n=io(i.CanvasPointToHtmlPoint([p,d]),2),p=n[0],d=n[1],uo("div",{className:"lf-multiple-select",style:{left:"".concat(l-20*s/2,"px"),top:"".concat(c-20*u/2,"px"),width:"".concat(p-l+20*s,"px"),height:"".concat(d-c+20*u,"px"),"border-width":"".concat(2*s,"px")},onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},n.toolName="multipleSelect",n=oo([cx],n)}(Vn),jE=function(){function e(e){this.toolMap=new Map,this.instance=e,this.isDisabledTool(PE.toolName)||this.registerTool(PE.toolName,PE),this.isDisabledTool(IE.toolName)||this.registerTool(IE.toolName,IE);var n=e.graphModel;n.eventCenter.on("".concat(t.EventType.GRAPH_TRANSFORM,",").concat(t.EventType.NODE_CLICK,",").concat(t.EventType.BLANK_CLICK," "),(function(){var e,r=n.textEditElement,o=n.editConfigModel,i=o.edgeTextEdit,a=o.nodeTextEdit;(i||a)&&r&&(null===(e=n.textEditElement)||void 0===e||e.setElementState(t.ElementState.DEFAULT))}))}return e.prototype.isDisabledTool=function(t){var e;return-1!==(null===(e=this.instance.options.disabledTools)||void 0===e?void 0:e.indexOf(t))},e.prototype.registerTool=function(t,e){this.toolMap.set(t,e)},e.prototype.getTools=function(){return Array.from(this.toolMap.values())},e.prototype.getInstance=function(){return this.instance},e}();var kE={},RE={get exports(){return kE},set exports(t){kE=t}};!function(t){!function(e,n,r){if(e){for(var o,i={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},a={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},s={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},u={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l=1;l<20;++l)i[111+l]="f"+l;for(l=0;l<=9;++l)i[l+96]=l.toString();v.prototype.bind=function(t,e,n){var r=this;return t=t instanceof Array?t:[t],r._bindMultiple.call(r,t,e,n),r},v.prototype.unbind=function(t,e){return this.bind.call(this,t,(function(){}),e)},v.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},v.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},v.prototype.stopCallback=function(t,e){if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(y(e,this.target))return!1;if("composedPath"in t&&"function"==typeof t.composedPath){var n=t.composedPath()[0];n!==t.target&&(e=n)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},v.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},v.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);o=null},v.init=function(){var t=v(n);for(var e in t)"_"!==e.charAt(0)&&(v[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},v.init(),e.Mousetrap=v,t.exports&&(t.exports=v)}function c(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function p(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return i[t.which]?i[t.which]:a[t.which]?a[t.which]:String.fromCharCode(t.which).toLowerCase()}function d(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function f(t,e,n){return n||(n=function(){if(!o)for(var t in o={},i)t>95&&t<112||i.hasOwnProperty(t)&&(o[i[t]]=t);return o}()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function h(t,e){var n,r,o,i=[];for(n=function(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus")).split("+")}(t),o=0;o<n.length;++o)r=n[o],u[r]&&(r=u[r]),e&&"keypress"!=e&&s[r]&&(r=s[r],i.push("shift")),d(r)&&i.push(r);return{key:r,modifiers:i,action:e=f(r,i,e)}}function y(t,e){return null!==t&&t!==n&&(t===e||y(t.parentNode,e))}function v(t){var e=this;if(t=t||n,!(e instanceof v))return new v(t);e.target=t,e._callbacks={},e._directMap={};var r,o={},i=!1,a=!1,s=!1;function u(t){t=t||{};var e,n=!1;for(e in o)t[e]?n=!0:o[e]=0;n||(s=!1)}function l(t,n,r,i,a,s){var u,l,c,p,f=[],h=r.type;if(!e._callbacks[t])return[];for("keyup"==h&&d(t)&&(n=[t]),u=0;u<e._callbacks[t].length;++u)if(l=e._callbacks[t][u],(i||!l.seq||o[l.seq]==l.level)&&h==l.action&&("keypress"==h&&!r.metaKey&&!r.ctrlKey||(c=n,p=l.modifiers,c.sort().join(",")===p.sort().join(",")))){var y=!i&&l.combo==a,v=i&&l.seq==i&&l.level==s;(y||v)&&e._callbacks[t].splice(u,1),f.push(l)}return f}function f(t,n,r,o){e.stopCallback(n,n.target||n.srcElement,r,o)||!1===t(n,r)&&(function(t){t.preventDefault?t.preventDefault():t.returnValue=!1}(n),function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}(n))}function y(t){"number"!=typeof t.which&&(t.which=t.keyCode);var n=p(t);n&&("keyup"!=t.type||i!==n?e.handleKey(n,function(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}(t),t):i=!1)}function g(t,e,n,a){function l(e){return function(){s=e,++o[t],clearTimeout(r),r=setTimeout(u,1e3)}}function c(e){f(n,e,t),"keyup"!==a&&(i=p(e)),setTimeout(u,10)}o[t]=0;for(var d=0;d<e.length;++d){var y=d+1===e.length?c:l(a||h(e[d+1]).action);_(e[d],y,a,t,d)}}function _(t,n,r,o,i){e._directMap[t+":"+r]=n;var a,s=(t=t.replace(/\s+/g," ")).split(" ");s.length>1?g(t,s,n,r):(a=h(t,r),e._callbacks[a.key]=e._callbacks[a.key]||[],l(a.key,a.modifiers,{type:a.action},o,t,i),e._callbacks[a.key][o?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:o,level:i,combo:t}))}e._handleKey=function(t,e,n){var r,o=l(t,e,n),i={},c=0,p=!1;for(r=0;r<o.length;++r)o[r].seq&&(c=Math.max(c,o[r].level));for(r=0;r<o.length;++r)if(o[r].seq){if(o[r].level!=c)continue;p=!0,i[o[r].seq]=1,f(o[r].callback,n,o[r].combo,o[r].seq)}else p||f(o[r].callback,n,o[r].combo);var h="keypress"==n.type&&a;n.type!=s||d(t)||h||u(i),a=p&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var r=0;r<t.length;++r)_(t[r],e,n)},c(t,"keypress",y),c(t,"keydown",y),c(t,"keyup",y)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(RE);var LE=kE,BE=function(){function t(t){t.keyboard||(t.keyboard={enabled:!1}),this.options=t;var e=t.lf;this.target=e.container,this.mousetrap=new LE(this.target),t.keyboard.enabled&&!e.options.isSilentMode&&this.enable(!0)}return t.prototype.initShortcuts=function(){var t,e=this,n=(null!==(t=this.options.keyboard)&&void 0!==t?t:{}).shortcuts;if(n)if(No(n))n.forEach((function(t){var n=t.keys,r=t.callback,o=t.action;return e.on(n,r,o)}));else{var r=n.keys,o=n.callback,i=n.action;this.on(r,o,i)}},t.prototype.on=function(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)},Object.defineProperty(t.prototype,"disabled",{get:function(){var t,e;return!0!==(null===(e=null===(t=this.options)||void 0===t?void 0:t.keyboard)||void 0===e?void 0:e.enabled)},enumerable:!1,configurable:!0}),t.prototype.off=function(t,e){this.mousetrap.unbind(this.getKeys(t),e)},t.prototype.enable=function(t){(this.disabled||t)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},t.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},t.prototype.getKeys=function(t){var e=this;return(Array.isArray(t)?t:[t]).map((function(t){return e.formatKey(t)}))},t.prototype.formatKey=function(t){return t.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},t}();function zE(t,e){void 0===e&&(e="Illegal state"),t||function(t){throw new Error("[mobx-utils] "+t)}(e)}var HE=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(HE(Object.getPrototypeOf(t))||[])},UE=function(t){return function(t){var e=HE(t),n=e.filter((function(t,n){return e.indexOf(t)===n}));return n}(t).filter((function(t){return"constructor"!==t&&!~t.indexOf("__")}))},XE="pending",GE="fulfilled",WE="rejected";function YE(t){switch(this.state){case XE:return t.pending&&t.pending(this.value);case WE:return t.rejected&&t.rejected(this.value);case GE:return t.fulfilled?t.fulfilled(this.value):this.value}}function VE(t,e){if(zE(arguments.length<=2,"fromPromise expects up to two arguments"),zE("function"==typeof t||"object"==typeof t&&t&&"function"==typeof t.then,"Please pass a promise or function to fromPromise"),!0===t.isPromiseBasedObservable)return t;"function"==typeof t&&(t=new Promise(t));var n=t;t.then(te("observableFromPromise-resolve",(function(t){n.value=t,n.state=GE})),te("observableFromPromise-reject",(function(t){n.value=t,n.state=WE}))),n.isPromiseBasedObservable=!0,n.case=YE;var r=e&&e.state===GE?e.value:void 0;return pe(n,{value:r,state:XE},{},{deep:!1}),n}!function(t){t.reject=te("fromPromise.reject",(function(e){var n=t(Promise.reject(e));return n.state=WE,n.value=e,n})),t.resolve=te("fromPromise.resolve",(function(e){void 0===e&&(e=void 0);var n=t(Promise.resolve(e));return n.state=GE,n.value=e,n}))}(VE||(VE={}));var FE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a};!function(){function t(t,e){var n=this;ee((function(){n.current=e,n.subscription=t.subscribe(n)}))}t.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.next=function(t){this.current=t},t.prototype.complete=function(){this.dispose()},t.prototype.error=function(t){this.current=t,this.dispose()},FE([$.ref],t.prototype,"current",void 0),FE([te.bound],t.prototype,"next",null),FE([te.bound],t.prototype,"complete",null),FE([te.bound],t.prototype,"error",null)}();var KE=function(){return KE=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},KE.apply(this,arguments)},qE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},ZE=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];function $E(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function JE(t){return fn(t)||Je(t)||nn(t)}function QE(t,e){var n=new WeakMap;function r(r){var a=n.get(r.object);!function(t,e){switch(t.type){case"add":o(t.newValue,e,t.name);break;case"update":i(t.oldValue),o(t.newValue,e,t.name||""+t.index);break;case"remove":case"delete":i(t.oldValue);break;case"splice":t.removed.map(i),t.added.forEach((function(n,r){return o(n,e,""+(t.index+r))}));for(var r=t.index+t.addedCount;r<t.object.length;r++)if(JE(t.object[r])){var a=n.get(t.object[r]);a&&(a.path=""+r)}}}(r,a),e(r,$E(a),t)}function o(t,e,i){if(JE(t)){var a=n.get(t);if(a){if(a.parent!==e||a.path!==i)throw new Error("The same observable object cannot appear twice in the same tree, trying to assign it to '"+$E(e)+"/"+i+"', but it already exists at '"+$E(a.parent)+"/"+a.path+"'")}else{var s={parent:e,path:i,dispose:De(t,r)};n.set(t,s),Te(t).forEach((function(t){var e=t[0];return o(t[1],s,e)}))}}}function i(t){if(JE(t)){var e=n.get(t);if(!e)return;n.delete(t),e.dispose(),Ae(t).forEach(i)}}return o(t,void 0,""),function(){i(t)}}!function(){function t(t){var e=this;this.model=t,this.localValues=$.map({}),this.localComputedValues=$.map({}),this.isPropertyDirty=function(t){return e.localValues.has(t)},zE(fn(t),"createViewModel expects an observable object"),UE(t).forEach((function(n){if(n!==S&&"__mobxDidRunLazyInitializers"!==n){if(zE(-1===ZE.indexOf(n),"The propertyname "+n+" is reserved and cannot be used with viewModels"),xe(t,n)){var r=yn(t,n).derivation;e.localComputedValues.set(n,rt(r.bind(e)))}var o=Object.getOwnPropertyDescriptor(t,n),i=o?{enumerable:o.enumerable}:{};Object.defineProperty(e,n,KE(KE({},i),{configurable:!0,get:function(){return xe(t,n)?e.localComputedValues.get(n).get():e.isPropertyDirty(n)?e.localValues.get(n):e.model[n]},set:te((function(t){t!==e.model[n]?e.localValues.set(n,t):e.localValues.delete(n)}))}))}}))}Object.defineProperty(t.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),t.prototype.submit=function(){var t=this;Me(this.localValues).forEach((function(e){var n=t.localValues.get(e),r=t.model[e];Je(r)?r.replace(n):nn(r)?(r.clear(),r.merge(n)):Ee(n)||(t.model[e]=n)})),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(t){this.localValues.delete(t)},qE([rt],t.prototype,"isDirty",null),qE([rt],t.prototype,"changedValues",null),qE([te.bound],t.prototype,"submit",null),qE([te.bound],t.prototype,"reset",null),qE([te.bound],t.prototype,"resetProperty",null)}();var tx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){function e(e,n,r){var o=void 0===r?{}:r,i=o.name,a=void 0===i?"ogm"+(1e3*Math.random()|0):i,s=o.keyToName,u=void 0===s?function(t){return""+t}:s,l=t.call(this)||this;l._keyToName=u,l._groupBy=n,l._ogmInfoKey=Symbol("ogmInfo"+a),l._base=e;for(var c=0;c<e.length;c++)l._addItem(e[c]);return l._disposeBaseObserver=De(l._base,(function(t){if("splice"===t.type)Re((function(){for(var e=0,n=t.removed;e<n.length;e++){var r=n[e];l._removeItem(r)}for(var o=0,i=t.added;o<i.length;o++){var a=i[o];l._addItem(a)}}));else{if("update"!==t.type)throw new Error("illegal state");Re((function(){l._removeItem(t.oldValue),l._addItem(t.newValue)}))}})),l}tx(e,t),e.prototype.clear=function(){throw new Error("not supported")},e.prototype.delete=function(t){throw new Error("not supported")},e.prototype.set=function(t,e){throw new Error("not supported")},e.prototype.dispose=function(){this._disposeBaseObserver();for(var t=0;t<this._base.length;t++){var e=this._base[t];e[this._ogmInfoKey].reaction(),delete e[this._ogmInfoKey]}},e.prototype._getGroupArr=function(e){var n=t.prototype.get.call(this,e);return void 0===n&&(n=$([],{name:"GroupArray["+this._keyToName(e)+"]",deep:!1}),t.prototype.set.call(this,e,n)),n},e.prototype._removeFromGroupArr=function(e,n){var r=t.prototype.get.call(this,e);1===r.length?t.prototype.delete.call(this,e):(n===r.length-1||(r[n]=r[r.length-1],r[n][this._ogmInfoKey].groupArrIndex=n),r.length--)},e.prototype._addItem=function(t){var e=this,n=this._groupBy(t),r=this._getGroupArr(n),o={groupByValue:n,groupArrIndex:r.length,reaction:ae((function(){return e._groupBy(t)}),(function(n,r){var o=t[e._ogmInfoKey];e._removeFromGroupArr(o.groupByValue,o.groupArrIndex);var i=e._getGroupArr(n),a=i.length;i.push(t),o.groupByValue=n,o.groupArrIndex=a}))};Object.defineProperty(t,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:o}),r.push(t)},e.prototype._removeItem=function(t){var e=t[this._ogmInfoKey];this._removeFromGroupArr(e.groupByValue,e.groupArrIndex),e.reaction(),delete t[this._ogmInfoKey]}}(en),Promise.resolve(),"undefined"!=typeof queueMicrotask||"undefined"!=typeof process&&process.nextTick;var ex=function(){function e(t){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=t}return e.prototype.add=function(e){yh(zd(this.undos),e)||(this.undos.push(e),yh(this.curData,e)||(this.redos=[]),this.eventCenter.emit(t.EventType.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},e.prototype.undoAble=function(){return this.undos.length>1},e.prototype.undo=function(){if(this.undoAble()){var t=this.undos.pop();this.redos.push(t);var e=this.undos.pop();return this.curData=up(e),e}},e.prototype.redoAble=function(){return this.redos.length>0},e.prototype.redo=function(){if(this.redoAble()){var t=this.redos.pop();return this.curData=up(t),t}},e.prototype.watch=function(t){var e=this;this.stopWatch&&this.stopWatch(),this.undos.push(t.modelToGraphData()),this.stopWatch=QE(t,bd((function(){var n=t.modelToHistoryData();n&&e.add(no({},n))}),this.waitTime))},e}(),nx=null;function rx(t,e){return t.x+=e,t.y+=e,t.text&&(t.text.x+=e,t.text.y+=e),t}function ox(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach((function(t){t.x+=e,t.y+=e})),t.text&&(t.text.x+=e,t.text.y+=e),t}var ix=40,ax=40;var sx=Symbol("plugin registered by Logicflow.use"),ux=function(){function e(e){var n,r=this;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(t,e){return r.viewMap.set(t,e)},this.getView=function(t){return r.viewMap.get(t)};var o=t.Options.get(e),i=o.container,a=o.width,s=o.height;this.options=o,this.container=this.initContainer(i,a,s),this.graphModel=new Rb(no(no({},o),{container:this.container})),this.plugins=null!==(n=o.plugins)&&void 0!==n?n:[];var u,l,c,p,d=this.graphModel.eventCenter;this.tool=new jE(this),this.dnd=new DE({lf:this}),this.history=new ex(d),this.keyboard=new BE({lf:this,keyboard:o.keyboard}),!1!==o.snapline&&(this.snaplineModel=new Lb(this.graphModel),function(t,e){t.on("node:mousemove",(function(t){var n=t.data;e.setNodeSnapLine(n)})),t.on("node:mouseup",(function(){e.clearSnapline()}))}(d,this.snaplineModel)),o.isSilentMode||(u=this,l=this.graphModel,c=u.keyboard,p=c.options.keyboard,c.on(["cmd + c","ctrl + c"],(function(){if(ax=ix,!(null==p?void 0:p.enabled))return!0;if(l.textEditElement)return!0;var t=u.options.guards,e=l.getSelectElements(!1);return t&&t.beforeClone&&!t.beforeClone(e)||0===e.nodes.length&&0===e.edges.length?(nx=null,!0):((nx=e).nodes.forEach((function(t){return rx(t,ix)})),nx.edges.forEach((function(t){return ox(t,ix)})),!1)})),c.on(["cmd + v","ctrl + v"],(function(){if(!(null==p?void 0:p.enabled))return!0;if(l.textEditElement)return!0;if(nx&&(nx.nodes||nx.edges)){u.clearSelectElements();var t=u.addElements(nx,ax);if(!t)return!0;t.nodes.forEach((function(t){return u.selectElementById(t.id,!0)})),t.edges.forEach((function(t){return u.selectElementById(t.id,!0)})),nx.nodes.forEach((function(t){return rx(t,ix)})),nx.edges.forEach((function(t){return ox(t,ix)})),ax+=ix}return!1})),c.on(["cmd + z","ctrl + z"],(function(){return!(null==p?void 0:p.enabled)||!!l.textEditElement||(u.undo(),!1)})),c.on(["cmd + y","ctrl + y"],(function(){return!(null==p?void 0:p.enabled)||!!l.textEditElement||(u.redo(),!1)})),c.on(["backspace"],(function(){if(!(null==p?void 0:p.enabled))return!0;if(l.textEditElement)return!0;var t=l.getSelectElements(!0);return u.clearSelectElements(),t.edges.forEach((function(t){return t.id&&u.deleteEdge(t.id)})),t.nodes.forEach((function(t){return t.id&&u.deleteNode(t.id)})),!1})),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(o.disabledPlugins)}return e.prototype.initContainer=function(t,e,n){var r=document.createElement("div");return r.style.position="relative",r.style.width=e?"".concat(e,"px"):"100%",r.style.height=n?"".concat(n,"px"):"100%",t.innerHTML="",t.appendChild(r),r},Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),e.prototype.register=function(t,e,n){if(void 0===n&&(n=!0),"string"==typeof t){var r={BaseEdge:AE,BaseEdgeModel:bb,BaseNode:vE,BaseNodeModel:Sb,RectNode:gE,RectNodeModel:Nb,CircleNode:_E,CircleNodeModel:Mb,PolygonNode:mE,PolygonNodeModel:Ob,TextNode:xE,TextNodeModel:Db,LineEdge:OE,LineEdgeModel:xb,DiamondNode:bE,DiamondNodeModel:Ab,PolylineEdge:NE,PolylineEdgeModel:wb,BezierEdge:TE,BezierEdgeModel:Eb,EllipseNode:EE,EllipseNodeModel:Tb,HtmlNode:wE,HtmlNodeModel:Pb,h:Xn,type:t};if(this.viewMap.forEach((function(t){var e=t.extendKey;e&&(r[e]=t)})),this.graphModel.modelMap.forEach((function(t){var e=t.extendKey;e&&(r[e]=t)})),e){var o=e(r),i=o.view,a=o.model,s=i;n&&!s.isObserved&&(s.isObserved=!0,s=cx(s)),this.setView(t,s),this.graphModel.setModel(t,a)}}else this.registerElement(t)},e.prototype.registerElement=function(t){var e=t.view;!1===t.isObserverView||e.isObserved||(e.isObserved=!0,e=cx(e)),this.setView(t.type,e),this.graphModel.setModel(t.type,t.model)},e.prototype.batchRegister=function(t){var e=this;void 0===t&&(t=[]),Yd(t,(function(t){e.registerElement(t)}))},e.prototype.defaultRegister=function(){var t=[{type:"rect",view:gE,model:Nb},{type:"circle",view:_E,model:Mb},{type:"polygon",view:mE,model:Ob},{type:"text",view:xE,model:Db},{type:"ellipse",view:EE,model:Tb},{type:"diamond",view:bE,model:Ab},{type:"html",view:wE,model:Pb},{type:"line",view:OE,model:xb},{type:"polyline",view:NE,model:wb},{type:"bezier",view:TE,model:Eb}];this.batchRegister(t)},e.prototype.addNode=function(e,n,r){return void 0===n&&(n=t.EventType.NODE_ADD),this.graphModel.addNode(e,n,r)},e.prototype.deleteNode=function(t){var e=this.graphModel.getNodeModelById(t);if(!e)return!1;var n=e.getData(),r=this.options.guards,o=!(null==r?void 0:r.beforeDelete)||r.beforeDelete(n);return o&&this.graphModel.deleteNode(t),o},e.prototype.cloneNode=function(t){var e=this.graphModel.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){var r=this.options.guards;if(!(null==r?void 0:r.beforeClone)||r.beforeClone(n))return this.graphModel.cloneNode(t)}},e.prototype.changeNodeId=function(t,e){return this.graphModel.changeNodeId(t,e)},e.prototype.changeNodeType=function(t,e){this.graphModel.changeNodeType(t,e)},e.prototype.getNodeModelById=function(t){return this.graphModel.getNodeModelById(t)},e.prototype.getNodeDataById=function(t){var e=this.getNodeModelById(t);return null==e?void 0:e.getData()},e.prototype.getNodeIncomingEdge=function(t){return this.graphModel.getNodeIncomingEdge(t)},e.prototype.getNodeOutgoingEdge=function(t){return this.graphModel.getNodeOutgoingEdge(t)},e.prototype.getNodeIncomingNode=function(t){return this.graphModel.getNodeIncomingNode(t)},e.prototype.getNodeOutgoingNode=function(t){return this.graphModel.getNodeOutgoingNode(t)},e.prototype.createFakeNode=function(t){var e=this.graphModel.modelMap.get(t.type);if(!e)return console.warn("不存在为".concat(t.type,"类型的节点")),null;var n=new e(no(no({},t),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(n),n},e.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},e.prototype.setNodeSnapLine=function(t){var e;null===(e=this.snaplineModel)||void 0===e||e.setNodeSnapLine(t)},e.prototype.removeNodeSnapLine=function(){var t;null===(t=this.snaplineModel)||void 0===t||t.clearSnapline()},e.prototype.setDefaultEdgeType=function(t){this.graphModel.setDefaultEdgeType(t)},e.prototype.addEdge=function(t){return this.graphModel.addEdge(t)},e.prototype.getEdgeDataById=function(t){var e=this.getEdgeModelById(t);return null==e?void 0:e.getData()},e.prototype.getEdgeModelById=function(t){return this.graphModel.getEdgeModelById(t)},e.prototype.getEdgeModels=function(t){var e=t.sourceNodeId,n=t.targetNodeId,r=[],o=this.graphModel.edges;return e&&n?Yd(o,(function(t){t.sourceNodeId===e&&t.targetNodeId===n&&r.push(t)})):e?Yd(o,(function(t){t.sourceNodeId===e&&r.push(t)})):n&&Yd(o,(function(t){t.targetNodeId===n&&r.push(t)})),r},e.prototype.changeEdgeId=function(t,e){return this.graphModel.changeEdgeId(t,e)},e.prototype.changeEdgeType=function(t,e){this.graphModel.changeEdgeType(t,e)},e.prototype.deleteEdge=function(t){var e=this.graphModel.getEdgeModelById(t);if(!e)return!1;var n=e.getData(),r=this.options.guards,o=!(null==r?void 0:r.beforeDelete)||r.beforeDelete(n);return o&&this.graphModel.deleteEdgeById(t),o},e.prototype.deleteEdgeByNodeId=function(t){var e=t.sourceNodeId,n=t.targetNodeId;e&&n?this.graphModel.deleteEdgeBySourceAndTarget(e,n):e?this.graphModel.deleteEdgeBySource(e):n&&this.graphModel.deleteEdgeByTarget(n)},e.prototype.getNodeEdges=function(t){return this.graphModel.getNodeEdges(t)},e.prototype.addElements=function(t,e){var n=this,r=t.nodes,o=t.edges;void 0===e&&(e=40),console.log("addElements",r,o,e);var i={},a={nodes:[],edges:[]};return Yd(r,(function(t){var e=t.id,r=n.addNode(t);e&&(i[e]=r.id),a.nodes.push(r)})),Yd(o,(function(t){var e=t.sourceNodeId,r=t.targetNodeId;i[e]&&(e=i[e]),i[r]&&(r=i[r]);var o=n.graphModel.addEdge(no(no({},t),{sourceNodeId:e,targetNodeId:r}));a.edges.push(o)})),a},e.prototype.selectElementById=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!0),this.graphModel.selectElementById(t,e),!e&&n&&this.graphModel.toFront(t)},e.prototype.getSelectElements=function(t){return void 0===t&&(t=!0),this.graphModel.getSelectElements(t)},e.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},e.prototype.getModelById=function(t){return this.graphModel.getElement(t)},e.prototype.getDataById=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getData()},e.prototype.deleteElement=function(e){var n,r,o,i=this.getModelById(e);return!!i&&(null!==(o=null===(r=((n={})[t.ElementType.NODE]=this.deleteNode,n[t.ElementType.EDGE]=this.deleteEdge,n)[i.BaseType])||void 0===r?void 0:r.call(this,e))&&void 0!==o&&o)},e.prototype.setElementZIndex=function(t,e){return this.graphModel.setElementZIndex(t,e)},e.prototype.getAreaElement=function(t,e,n,r,o){return void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===o&&(o=!1),this.graphModel.getAreaElement(t,e,n,r,o).map((function(t){return t.getData()}))},e.prototype.setProperties=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.setProperties(i_(e))},e.prototype.getProperties=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getProperties()},e.prototype.deleteProperty=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.deleteProperty(e)},e.prototype.updateAttributes=function(t,e){this.graphModel.updateAttributes(t,e)},e.prototype.editText=function(t){this.graphModel.editText(t)},e.prototype.updateText=function(t,e){this.graphModel.updateText(t,e)},e.prototype.updateEditConfig=function(t){var e=this.graphModel,n=e.editConfigModel,r=e.transformModel;n.updateEditConfig(t),void 0!==(null==t?void 0:t.stopMoveGraph)&&r.updateTranslateLimits(t.stopMoveGraph),(null==t?void 0:t.isSilentMode)?this.keyboard.disable():this.keyboard.enable(!0)},e.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},e.prototype.setTheme=function(t){this.graphModel.setTheme(t)},e.prototype.focusByElement=function(t){var e=void 0,n=this.getNodeModelById(t);if(n){var r=n.getData();e={x:r.x,y:r.y}}var o=this.getEdgeModelById(t);if(o){var i=o.textPosition;e={x:i.x,y:i.y}}e&&this.focusByCoordinate(e)},e.prototype.focusByCoordinate=function(t){var e=this.graphModel,n=e.transformModel,r=e.width,o=e.height,i=t.x,a=t.y;n.focusOn(i,a,r,o)},e.prototype.focusOn=function(t){if("string"==typeof t)this.focusByElement(t);else if("x"in t&&"y"in t)this.focusByCoordinate(t);else{var e=t.id,n=t.coordinate;e&&this.focusByElement(e),n&&this.focusByCoordinate(n)}},e.prototype.resize=function(t,e){this.graphModel.resize(t,e),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},e.prototype.toFront=function(t){this.graphModel.toFront(t)},e.prototype.getPointByClient=function(t,e){return"object"==typeof t?this.graphModel.getPointByClient(t):"number"==typeof e?this.graphModel.getPointByClient({x:t,y:e}):void 0},e.prototype.getGraphData=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,ao([n],io(t),!1)):n},e.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},e.prototype.clearData=function(){this.graphModel.clearData()},e.prototype.renderRawData=function(e){this.graphModel.graphDataToModel(i_(e)),!1!==this.options.history&&this.history.watch(this.graphModel),function(t,e,n){null==e.__k&&(e.textContent=""),pr(t,e),"function"==typeof n&&n(),t&&t.__c}(uo(oE,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(t.EventType.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData()})},e.prototype.render=function(t){var e=up(t);this.adapterIn&&(e=this.adapterIn(e)),this.renderRawData(e)},e.prototype.undo=function(){if(this.history.undoAble()){var t=i_(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},e.prototype.redo=function(){if(this.history.redoAble()){var t=i_(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},e.prototype.zoom=function(t,e){return this.graphModel.transformModel.zoom(t,e)},e.prototype.resetZoom=function(){this.graphModel.transformModel.resetZoom()},e.prototype.setZoomMiniSize=function(t){this.graphModel.transformModel.setZoomMiniSize(t)},e.prototype.setZoomMaxSize=function(t){this.graphModel.transformModel.setZoomMaxSize(t)},e.prototype.getTransform=function(){var t=this.graphModel.transformModel;return{SCALE_X:t.SCALE_X,SCALE_Y:t.SCALE_Y,TRANSLATE_X:t.TRANSLATE_X,TRANSLATE_Y:t.TRANSLATE_Y}},e.prototype.translate=function(t,e){this.graphModel.transformModel.translate(t,e)},e.prototype.resetTranslate=function(){var t=this.graphModel.transformModel,e=t.TRANSLATE_X,n=t.TRANSLATE_Y;this.translate(-e,-n)},e.prototype.translateCenter=function(){this.graphModel.translateCenter()},e.prototype.fitView=function(t,e){void 0===e&&(e=t),this.graphModel.fitView(t,e)},e.prototype.openEdgeAnimation=function(t){this.graphModel.openEdgeAnimation(t)},e.prototype.closeEdgeAnimation=function(t){this.graphModel.closeEdgeAnimation(t)},e.prototype.on=function(t,e){this.graphModel.eventCenter.on(t,e)},e.prototype.off=function(t,e){this.graphModel.eventCenter.off(t,e)},e.prototype.once=function(t,e){this.graphModel.eventCenter.once(t,e)},e.prototype.emit=function(t,e){this.graphModel.eventCenter.emit(t,e)},e.use=function(t,e){var n,r=t.pluginName;if(!r)throw new Error("请给插件指定 pluginName!");this.extensions.set(r,((n={})[sx]=sx,n.extension=t,n.props=e,n))},e.prototype.installPlugins=function(t){var n=this;void 0===t&&(t=[]);var r=Array.from(e.extensions,(function(t){return io(t,2)[1]}));Yd(ao(ao([],io(r),!1),io(this.plugins),!1),(function(e){var r,o;sx in e?(r=e.extension,o=e.props):r=e;var i=null==r?void 0:r.pluginName;-1===Vf(t,i)&&n.installPlugin(r,o)}))},e.prototype.installPlugin=function(t,n){var r;if("pluginName"in t&&"install"in t){var o=t.pluginName,i=t.install,a=t.render;o&&(i&&i.call(t,this,e),a&&this.components.push(a.bind(t)),this.extension[o]=t)}else{var s=t,u=new s({lf:this,LogicFlow:e,props:n,options:null!==(r=this.options.pluginsOptions)&&void 0!==r?r:{}});u.render&&this.components.push(u.render.bind(u)),this.extension[s.pluginName]=u}},e.extensions=new Map,e}();!function(t){t.toStringTag="LF.".concat(t.name)}(ux||(ux={}));var lx=ux;function cx(t){return o.observer(t)}t.AdjustPoint=SE,t.Arrow=ME,t.BaseEdge=AE,t.BaseEdgeModel=bb,t.BaseNode=vE,t.BaseNodeModel=Sb,t.BaseText=pE,t.BezierEdge=TE,t.BezierEdgeModel=Eb,t.Circle=Vb,t.CircleNode=_E,t.CircleNodeModel=Mb,t.Component=Vn,t.DiamondNode=bE,t.DiamondNodeModel=Ab,t.EditConfigModel=jb,t.Ellipse=Fb,t.EllipseNode=EE,t.EllipseNodeModel=Tb,t.GraphModel=Rb,t.HtmlNode=wE,t.HtmlNodeModel=Pb,t.Keyboard=BE,t.Line=Gb,t.LineEdge=OE,t.LineEdgeModel=xb,t.LineText=dE,t.LogicFlow=lx,t.LogicFlowUtil=mb,t.Path=Yb,t.Polygon=Kb,t.PolygonNode=mE,t.PolygonNodeModel=Ob,t.Polyline=qb,t.PolylineEdge=NE,t.PolylineEdgeModel=wb,t.Rect=Wb,t.RectNode=gE,t.RectNodeModel=Nb,t.SnaplineModel=Lb,t.Text=Ub,t.TextNode=xE,t.TextNodeModel=Db,t.TransformModel=zb,t.createRef=Wn,t.default=lx,t.formatAnchorConnectValidateData=Rm,t.h=Xn,t.observer=cx,t.renderHtmlText=Xb,Object.defineProperty(t,"__esModule",{value:!0})}));
31
+ !function(t){!function(){var e={}.hasOwnProperty;function n(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=o(t,r(n)))}return t}function r(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var r="";for(var i in t)e.call(t,i)&&t[i]&&(r=o(r,i));return r}function o(t,e){return e?t?t+" "+e:t+e:t}t.exports?(n.default=n,t.exports=n):window.classNames=n}()}(SE);var TE,AE=wE,OE=function(e){function n(n){var r=e.call(this)||this;r.mouseDownHandler=function(t){var e=r.props,n=e.draggable,o=e.model,i=e.graphModel.editConfigModel.nodeTextDraggable;(n||i)&&(r.stepperDrag.model=o,r.stepperDrag.handleMouseDown(t))},r.onDragging=function(t){var e=t.deltaX,n=t.deltaY,o=r.props,i=o.model,a=o.graphModel.transformModel;if(e&&n){var s=io(a.fixDeltaXY(e,n),2),u=s[0],l=s[1];i.moveText(u,l)}},r.dbClickHandler=function(){var e=r.props,n=e.editable,o=e.graphModel.eventCenter,i=e.model;n&&i.setElementState(t.ElementState.TEXT_EDIT),o.emit(t.EventType.TEXT_DBCLICK,{data:i.text,model:i})};var o=n.draggable;return r.stepperDrag=new __({onDragging:r.onDragging,step:1,eventType:"TEXT",isStopPropagation:o}),r}return eo(n,e),n.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel,r=e.text,o=r.value,i=r.x,a=r.y,s=r.editable,u=r.draggable,l={x:i,y:a,className:"",value:o},c=e.getTextStyle(),p=n.nodeTextDraggable||u;return uo(oE,no({},l,c,{className:AE({"lf-element-text":s,"lf-text-draggable":!s&&p,"lf-text-disabled":!s&&!p}),model:e}))},n.prototype.render=function(){if(this.props.model.text)return uo("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},n}(Vn),DE=function(t){function e(e){var n=t.call(this,e)||this;return n.setHoverOn=function(){n.setState({isHovered:!0})},n.setHoverOff=function(){n.setState({isHovered:!1})},n.state={isHovered:!1},n}return eo(e,t),e.prototype.getBackground=function(){var t=this.state.isHovered,e=this.props.model,n=e.text,r=e.getTextStyle(),o=r.background||{};if(t&&r.hover&&r.hover.background&&(o=no(no({},o),r.hover.background)),(null==n?void 0:n.value)&&"transparent"!==(null==o?void 0:o.fill)){var i=r.fontSize,a=r.textWidth,s=r.lineHeight,u=r.overflowMode,l=o.wrapPadding,c=null==n?void 0:n.value.split(/[\r\n]/g),p=c.length,d=n.x,f=n.y,h={};if("autoWrap"===u&&a){var v=Zm({rows:c,style:{fontSize:"".concat(i,"px"),width:"".concat(a,"px"),lineHeight:s,padding:l},rowsLength:p,className:"lf-get-text-height"});h=no(no({},o),{x:d,y:f,width:a,height:v})}else{var y=mm({rows:c,rowsLength:p,fontSize:i}),g=y.width,_=y.height;if("ellipsis"===u&&(g=a,_=i+2),"string"==typeof o.wrapPadding){var m=o.wrapPadding.split(",").filter((function(t){return t.trim()})).map((function(t){return parseFloat(t.trim())}));if(m.length>0&&m.length<=4){if(1===m.length){var b=io(m,1)[0];m=[b,b,b,b]}else if(2===m.length){var E=io(m,2),x=E[0];m=[x,M=E[1],x,M]}else if(3===m.length){var M,w=io(m,3);m=[w[0],M=w[1],w[2],M]}var S=io(m,4),T=S[0],A=S[1],O=S[2],D=S[3];g+=A+D,_+=T+O,d+=(A-D)/2,f+=(O-T)/2}}h=no(no({},o),{x:d-1,y:f-1,width:g,height:_})}return uo(sE,no({},h))}return null},e.prototype.getShape=function(){var t=this.props.model,e=t.text,n=e.x,r=e.y,o=e.value;if(!o)return null;var i=t.getTextStyle(),a=no({x:n,y:r,value:o,model:t,className:"lf-element-text"},i);return uo("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),uo(oE,no({},a))]})},e}(OE);!function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"}(TE||(TE={}));var NE,PE=function(e){function n(n){var r=e.call(this)||this;r.updateEdgePointByAnchors=function(){var t=r.nodeModel,e=t.id,n=t.anchors;Yd(r.graphModel.getNodeEdges(e),(function(t){if(t.sourceNodeId===e)(r=vf(n,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:r.x,y:r.y});else if(t.targetNodeId===e){var r;(r=vf(n,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:r.x,y:r.y})}}))},r.triggerResizeEvent=function(e,n,o){r.graphModel.eventCenter.emit(t.EventType.NODE_RESIZE,{preData:e,data:n,model:o})},r.recalcResizeInfo=function(t,e,n,r,o){void 0===n&&(n=1),void 0===r&&(r=!1),void 0===o&&(o=!1);var i=up(e),a=i.deltaX,s=i.deltaY,u=i.width,l=i.height,c=i.PCTResizeInfo;if(c){var p=0,d=0;switch(t){case TE.LEFT_TOP:d=(-1*a-s)/4;break;case TE.RIGHT_TOP:d=(a-s)/4;break;case TE.RIGHT_BOTTOM:d=(a+s)/4;break;case TE.LEFT_BOTTOM:d=(-1*a+s)/4}0!==d&&(p=Math.round(d/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+p,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+p,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var f=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),h=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case TE.LEFT_TOP:a=u-f,s=l-h;break;case TE.RIGHT_TOP:a=f-u,s=l-h;break;case TE.RIGHT_BOTTOM:a=f-u,s=h-l;break;case TE.LEFT_BOTTOM:a=u-f,s=h-l}return i}switch(t){case TE.LEFT_TOP:i.width=r?u:u-a*n,i.height=o?l:l-s*n;break;case TE.RIGHT_TOP:i.width=r?u:u+a*n,i.height=o?l:l-s*n;break;case TE.RIGHT_BOTTOM:i.width=r?u:u+a*n,i.height=o?l:l+s*n;break;case TE.LEFT_BOTTOM:i.width=r?u:u-a*n,i.height=o?l:l+s*n}return i},r.resizeNode=function(t){var e=t.deltaX,n=t.deltaY,o=r.nodeModel,i=o.r,a=o.rx,s=o.ry,u=o.width,l=o.height,c=o.PCTResizeInfo,p=o.minWidth,d=o.minHeight,f=o.maxWidth,h=o.maxHeight,v=p===f,y=d===h,g={width:i||a||u,height:i||s||l,deltaX:e,deltaY:n,PCTResizeInfo:c},_=i||a&&s?.5:1,m=r.recalcResizeInfo(r.index,g,_,v,y);if(m.width<p||m.width>f||m.height<d||m.height>h)r.dragHandler.cancelDrag();else{m.deltaX=v?0:m.deltaX,m.deltaY=v?0:m.deltaY;var b=r.nodeModel.getData(),E=r.nodeModel.resize(m);r.updateEdgePointByAnchors(),r.triggerResizeEvent(b,E,r.nodeModel)}},r.onDragging=function(t){var e=t.deltaX,n=t.deltaY,o=io(r.graphModel.transformModel.fixDeltaXY(e,n),2),i=o[0],a=o[1];r.resizeNode({deltaX:i,deltaY:a})},r.onDragEnd=function(){var t=r.nodeModel.x,e=r.nodeModel.y;r.nodeModel.moveTo(t,e),r.updateEdgePointByAnchors()};var o=n.index,i=n.model,a=n.graphModel;return r.index=o,r.nodeModel=i,r.graphModel=a,r.dragHandler=new __({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:a.gridSize}),r}return eo(n,e),n.prototype.render=function(){var t=this.props,e=t.x,n=t.y,r=t.direction,o=t.model.getResizeControlStyle(),i=o.width,a=o.height,s=ro(o,["width","height"]);return uo("g",{className:"lf-resize-control lf-resize-control-".concat(r),children:[uo(sE,no({className:"lf-resize-control-content",x:e,y:n,width:null!=i?i:7,height:null!=a?a:7},s)),uo(sE,{className:"lf-resize-control-content",x:e,y:n,width:30,height:30,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},n}(Vn),CE=function(t){function e(){return t.call(this)||this}return eo(e,t),e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=Um(e),o=r.minX,i=r.minY,a=r.maxX,s=r.maxY;return Mf([{index:TE.LEFT_TOP,direction:"nw",x:o,y:i},{index:TE.RIGHT_TOP,direction:"ne",x:a,y:i},{index:TE.RIGHT_BOTTOM,direction:"se",x:a,y:s},{index:TE.LEFT_BOTTOM,direction:"sw",x:o,y:s}],(function(t){return uo(PE,no({},t,{model:e,graphModel:n}))}))},e.prototype.getResizeOutline=function(){var t=this.props.model,e=t.x,n=t.y,r=t.width,o=t.height,i=t.getResizeOutlineStyle();return uo(sE,no({},i,{x:e,y:n,width:r,height:o}))},e.prototype.render=function(){return uo("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e}(Vn),IE=function(e){function n(n){var r=e.call(this)||this;r.onDragStart=function(t){var e=t.event,n=r.props,o=n.model,i=n.graphModel;if(e){var a=i.getPointByClient({x:e.clientX,y:e.clientY}).canvasOverlayPosition,s=a.x,u=a.y;r.moveOffset={dx:o.x-s,dy:o.y-u}}},r.onDragging=function(t){var e,n,o,i,a=t.event,s=r.props,u=s.model,l=s.graphModel,c=l.editConfigModel,p=c.stopMoveGraph,d=c.autoExpand,f=l.transformModel,h=l.selectNodes,v=l.width,y=l.height,g=l.gridSize;u.isDragging=!0;var _=a,m=_.clientX,b=_.clientY,E=l.getPointByClient({x:m,y:b}).canvasOverlayPosition,x=E.x,M=E.y,w=io(f.CanvasPointToHtmlPoint([x,M]),2),S=w[0],T=w[1];if(x+=null!==(n=null===(e=r.moveOffset)||void 0===e?void 0:e.dx)&&void 0!==n?n:0,M+=null!==(i=null===(o=r.moveOffset)||void 0===o?void 0:o.dy)&&void 0!==i?i:0,x=bm(x,g),M=bm(M,g),v&&y){if(!d||p||!(S<0||T<0||S>v||T>y)){var A=io(f.CanvasPointToHtmlPoint([x-u.width/2,M-u.height/2]),2),O=A[0],D=A[1],N=io(f.CanvasPointToHtmlPoint([x+u.width/2,M+u.height/2]),2),P=N[0],C=N[1],I=Math.max(g,20),L=[];O<0?L=[I,0]:P>l.width?L=[-I,0]:D<0?L=[0,I]:C>l.height&&(L=[0,-I]),r.t&&xb(r.t),u.transform=new Cm(-x,-M).rotate(u.rotate).translate(x,M).toString();var j=h.map((function(t){return t.id}));-1===j.indexOf(u.id)&&(j=[u.id]),L.length>0&&!p&&d?r.t=Eb((function(){var t=io(L,2),e=t[0],n=t[1];f.translate(null!=e?e:0,null!=n?n:0);var r=-(null!=e?e:0)/f.SCALE_X,o=-(null!=n?n:0)/f.SCALE_X;l.moveNodes(j,r,o)})):l.moveNodes(j,x-u.x,M-u.y)}}else l.moveNode2Coordinate(u.id,x,M)},r.onDragEnd=function(){r.t&&xb(r.t),r.props.model.isDragging=!1},r.handleMouseUp=function(){var t=r.props.model;r.mouseUpDrag=t.isDragging},r.handleClick=function(e){var n=!1===r.mouseUpDrag;if(r.startTime){var o=r.props,i=o.model,a=o.graphModel;if(n){var s={data:i.getData(),e:e,position:a.getPointByClient({x:e.clientX,y:e.clientY}),isSelected:!1,isMultiple:!1},u=2===e.button,l=2===e.detail;if(!u){var c=a.editConfigModel,p=wm(e,c);s.isMultiple=p,i.isSelected&&!l&&p?(s.isSelected=!1,i.setSelected(!1)):(a.selectNodeById(i.id,p),s.isSelected=!0,r.toFront()),l?(c.nodeTextEdit&&i.text.editable&&(i.setSelected(!1),a.setElementStateById(i.id,t.ElementState.TEXT_EDIT)),a.eventCenter.emit(t.EventType.NODE_DBCLICK,s)):(a.eventCenter.emit(t.EventType.ELEMENT_CLICK,s),a.eventCenter.emit(t.EventType.NODE_CLICK,s))}}}},r.handleContextMenu=function(e){e.preventDefault();var n=r.props,o=n.model,i=n.graphModel,a=o.getData(),s=i.getPointByClient({x:e.clientX,y:e.clientY});i.setElementStateById(o.id,t.ElementState.SHOW_MENU,s.domOverlayPosition),o.isSelected||i.selectNodeById(o.id),i.eventCenter.emit(t.EventType.NODE_CONTEXTMENU,{data:a,e:e,position:s}),r.toFront()},r.handleMouseDown=function(t){var e=r.props,n=e.model,o=e.graphModel;r.startTime=(new Date).getTime(),o.editConfigModel.adjustNodePosition&&n.draggable&&r.stepDrag&&r.stepDrag.handleMouseDown(t)},r.setHoverOn=function(e){var n=r.props,o=n.model,i=n.graphModel;if(!o.isHovered){var a=o.getData();o.setHovered(!0),i.eventCenter.emit(t.EventType.NODE_MOUSEENTER,{data:a,e:e})}},r.setHoverOff=function(e){var n=r.props,o=n.model,i=n.graphModel,a=o.getData();o.isHovered&&(o.setHovered(!1),i.eventCenter.emit(t.EventType.NODE_MOUSELEAVE,{data:a,e:e}))},r.onMouseOut=function(t){u_&&r.setHoverOff(t)};var o=n.graphModel,i=o.gridSize,a=o.eventCenter,s=n.model;return r.stepDrag=new __({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:i,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),r.modelDisposer=ae((function(){return r.props}),(function(t){t&&t.model&&r.stepDrag.setModel(t.model)})),r}return eo(n,e),n.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer()},n.prototype.componentDidMount=function(){},n.prototype.componentDidUpdate=function(){},n.prototype.getAnchorShape=function(t){return null},n.prototype.getAnchors=function(){var t=this,e=this.props,n=e.model,r=e.graphModel,o=n.isSelected,i=n.isHitable,a=n.isDragging,s=n.isShowAnchor;return i&&(o||s)&&!a?Mf(n.anchors,(function(e,o){var i=n.getAnchorLineStyle(e),a=n.getAnchorStyle(e);return uo(xE,{anchorData:e,node:t,style:a,edgeStyle:i,anchorIndex:o,nodeModel:n,graphModel:r,setHoverOff:t.setHoverOff})})):[]},n.prototype.getRotateControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.isSelected,o=e.isHitable,i=e.enableRotate,a=e.isHovered,s=e.getRotateControlStyle();if(o&&(r||a)&&i)return uo(ME,{graphModel:n,nodeModel:e,eventCenter:n.eventCenter,style:s})},n.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.isSelected,o=e.isHitable,i=e.enableResize,a=e.isHovered,s=e.getResizeControlStyle();return o&&(r||a)&&i?uo(CE,{style:s,model:e,graphModel:n}):null},n.prototype.getText=function(){var e,n=this.props,r=n.model,o=n.graphModel,i=o.editConfigModel;if(i.nodeTextMode!==t.TextMode.TEXT)return null;if(r.state===t.ElementState.TEXT_EDIT)return null;if(r.text){var a=!1;return i.nodeTextDraggable&&r.text.draggable&&(a=!0),uo(OE,{editable:i.nodeTextEdit&&(null===(e=r.text.editable)||void 0===e||e),model:r,graphModel:o,draggable:a})}return null},n.prototype.getStateClassName=function(){var e=this.props.model,n=e.state,r=e.isDragging,o=e.isSelected,i="lf-node";switch(n){case t.ElementState.ALLOW_CONNECT:i+=" lf-node-allow";break;case t.ElementState.NOT_ALLOW_CONNECT:i+=" lf-node-not-allow";break;default:i+=" lf-node-default"}return r&&(i+=" lf-dragging"),o&&(i+=" lf-node-selected"),i},n.prototype.toFront=function(){var t=this.props,e=t.model,n=t.graphModel;e.autoToFront&&n.toFront(e.id)},n.prototype.render=function(){var t,e=this.props,n=e.model,r=e.graphModel,o=r.editConfigModel,i=o.hideAnchors,a=o.adjustNodePosition,s=o.allowRotate,u=o.allowResize,l=r.gridSize,c=r.transformModel.SCALE_X,p=n.isHitable,d=n.draggable,f=n.transform,h=n.getOuterGAttributes(),v=h.className,y=void 0===v?"":v,g=ro(h,["className"]),_=uo("g",{className:"lf-node-content",children:[uo("g",{transform:f,children:[this.getShape(),this.getText(),s&&this.getRotateControl(),u&&this.getResizeControl()]}),!i&&this.getAnchors()]});return p?(a&&d&&this.stepDrag.setStep(l*c),t=uo("g",no({className:"".concat(this.getStateClassName()," ").concat(y),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu},g,{children:_}))):t=uo("g",no({className:"".concat(this.getStateClassName()," ").concat(y)},g,{children:_})),t},n.isObserved=!1,n}(Vn),LE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return uo(sE,no({},e,{x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius}))},e}(IE),jE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.r,o=t.getNodeStyle();return uo(lE,no({},o,{x:e,y:n,r:r}))},e}(IE),kE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t,n=e.x,r=e.y,o=e.width,i=e.height,a=e.points,s=t.getNodeStyle(),u={transform:"matrix(1 0 0 1 ".concat(n-o/2," ").concat(r-i/2,")")};return uo("g",no({},u,{children:uo(pE,no({},s,{points:a,x:n,y:r}))}))},e}(IE),RE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return uo("g",{children:uo(pE,no({},e,{points:t.points,x:t.x,y:t.y}))})},e}(IE),BE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return uo(cE,no({},e,{x:t.x,y:t.y,rx:t.rx,ry:t.ry}))},e}(IE),zE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getBackground=function(){var t=this.props.model,e=t.getTextStyle(),n=t.width,r=t.height,o=t.x,i=t.y,a=no(no({},e.background),{x:o,y:i,width:n,height:r});return uo(sE,no({},a))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return uo("g",{children:this.getBackground()})},e}(IE),UE=function(t){function e(){var e=t.apply(this,ao([],io(arguments),!1))||this;return e.ref={current:null},e}return eo(e,t),Object.defineProperty(e.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),e.prototype.setHtml=function(t){t.appendChild(document.createElement("div"))},e.prototype.confirmUpdate=function(t){this.setHtml(t)},e.prototype.shouldUpdate=function(){return(!this.preProperties||this.preProperties!==this.currentProperties)&&(this.preProperties=this.currentProperties,!0)},e.prototype.componentDidMount=function(){this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},e.prototype.componentDidUpdate=function(){this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},e.prototype.componentWillUnmount=function(){this.rootEl.innerHTML=""},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.height,o=t.width,i=t.getNodeStyle();return this.currentProperties=JSON.stringify(t.properties),uo("foreignObject",no({},i,{x:e-o/2,y:n-r/2,width:o,height:r,ref:this.ref}))},e}(IE);t.AdjustType=void 0,(NE=t.AdjustType||(t.AdjustType={})).SOURCE="SOURCE",NE.TARGET="TARGET";var XE=function(e){function n(n){var r=e.call(this)||this;r.handleMouseDown=function(t){r.stepDrag&&r.stepDrag.handleMouseDown(t)},r.onDragStart=function(){var t=r.props,e=t.x,n=t.y,o=t.edgeModel,i=o.startPoint,a=o.endPoint,s=o.pointsList;r.oldEdge={startPoint:i,endPoint:a,pointsList:s},r.setState({endX:e,endY:n,dragging:!0})},r.onDragging=function(e){var n=e.deltaX,o=e.deltaY,i=r.state,a=i.endX,s=i.endY,u=r.props,l=u.graphModel,c=u.type,p=l.transformModel,d=l.editConfigModel,f=io(p.moveCanvasPointByHtml([a,s],n,o),2),h=f[0],v=f[1];r.setState({endX:h,endY:v,dragging:!0});var y=r.props.edgeModel,g=Lm({x:a,y:s},l);if(g&&g.node&&r.isAllowAdjust(g).pass){var _=y.startPoint,m=y.endPoint,b=y.sourceNode,E=y.targetNode,x=c===t.AdjustType.SOURCE?{startPoint:{x:g.anchor.x,y:g.anchor.y},endPoint:{x:m.x,y:m.y},sourceNode:g.node,targetNode:E}:{startPoint:{x:_.x,y:_.y},endPoint:{x:g.anchor.x,y:g.anchor.y},sourceNode:b,targetNode:g.node};y.updateAfterAdjustStartAndEnd(x)}else c===t.AdjustType.SOURCE?y.updateStartPoint({x:h,y:v}):y.updateEndPoint({x:h,y:v});y.text.value&&d.adjustEdge&&y.setText(Object.assign({},y.text,y.textPosition))},r.onDragEnd=function(e){var n,o,i,a=e.event;try{r.setState({dragging:!1});var s=r.props,u=s.graphModel,l=s.edgeModel,c=s.type,p=r.state,d=p.endX,f=p.endY,h=p.dragging,v=Lm({x:d,y:f},u);if(!h)return;var y=!1,g=void 0;if(v&&v.node){var _=r.isAllowAdjust(v),m=_.pass,b=_.msg,E=_.newTargetNode;if(m){var x=l.getData(),M=x.text,w=x.sourceAnchorId,S=void 0===w?"":w,T=x.targetAnchorId,A=void 0===T?"":T,O=ro(x,["text","sourceAnchorId","targetAnchorId"]);if(g=no(no({sourceAnchorId:S,targetAnchorId:A},O),{text:(null==M?void 0:M.value)||""}),c===t.AdjustType.SOURCE){var D=u.getNodeModelById(v.node.id),N=u.getNodeModelById(l.targetNodeId),P=null===(n=u.edgeGenerator)||void 0===n?void 0:n.call(u,null==D?void 0:D.getData(),null==N?void 0:N.getData(),g);g=no(no({},P),{sourceNodeId:v.node.id,sourceAnchorId:v.anchor.id,startPoint:{x:v.anchor.x,y:v.anchor.y},targetNodeId:l.targetNodeId,endPoint:no({},l.endPoint)}),l.sourceNodeId===v.node.id&&l.sourceAnchorId===v.anchor.id&&(y=!0)}else if(c===t.AdjustType.TARGET){D=u.getNodeModelById(l.sourceNodeId),N=u.getNodeModelById(v.node.id),P=null===(o=u.edgeGenerator)||void 0===o?void 0:o.call(u,null==D?void 0:D.getData(),null==N?void 0:N.getData(),g);g=no(no({},P),{sourceNodeId:l.sourceNodeId,startPoint:no({},l.startPoint),targetNodeId:v.node.id,targetAnchorId:v.anchor.id,endPoint:{x:v.anchor.x,y:v.anchor.y}}),l.targetNodeId===v.node.id&&l.targetAnchorId===v.anchor.id&&(y=!0)}}else{y=!0;var C=E.getData();u.eventCenter.emit(t.EventType.CONNECTION_NOT_ALLOWED,{data:C,msg:b})}}else y=!0;if(y)r.recoveryEdge();else{var I=l.getData();u.deleteEdgeById(l.id);var L=u.addEdge(no({},g));u.eventCenter.emit(t.EventType.EDGE_EXCHANGE_NODE,{data:{newEdge:L.getData(),oldEdge:I}})}null===(i=r.preTargetNode)||void 0===i||i.setElementState(t.ElementState.DEFAULT)}finally{(u=r.props.graphModel).eventCenter.emit(t.EventType.ADJUST_POINT_DRAGEND,{e:a,data:r.stepDragData})}},r.recoveryEdge=function(){var e=r.props.edgeModel,n=r.oldEdge,o=n.startPoint,i=n.endPoint,a=n.pointsList;e.updateStartPoint(o),e.updateEndPoint(i),e.modelType!==t.ModelType.LINE_EDGE&&(e.pointsList=null!=a?a:[],e.initPoints())},r.getAdjustPointStyle=function(){return r.props.graphModel.theme.edgeAdjust},r.state={dragging:!1,endX:0,endY:0},r.targetRuleResults=new Map,r.sourceRuleResults=new Map;var o=n.type,i=n.edgeModel,a=n.graphModel.eventCenter;return r.stepDragData={type:o,edgeData:i.getData()},r.stepDrag=new __({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:a,data:r.stepDragData}),r}return eo(n,e),n.prototype.isAllowAdjust=function(e){var n,r,o,i,a=this.props,s=a.edgeModel,u=s.id,l=s.sourceNode,c=s.targetNode,p=s.sourceAnchorId,d=s.targetAnchorId,f=a.type;if(f===t.AdjustType.SOURCE?(n=e.node,r=c,o=e.anchor,i=c.getAnchorInfo(d)):(n=l,r=e.node,i=e.anchor,o=l.getAnchorInfo(p)),this.preTargetNode&&this.preTargetNode!==e.node&&this.preTargetNode.setElementState(t.ElementState.DEFAULT),this.preTargetNode=e.node,i.id===o.id)return{pass:!1,msg:"",newTargetNode:r};var h="".concat(n.id,"_").concat(r.id,"_").concat(o.id,"_").concat(i.id);if(!this.targetRuleResults.has(h)){var v=n.isAllowConnectedAsSource(r,o,i,u),y=r.isAllowConnectedAsTarget(n,o,i,u);this.sourceRuleResults.set(h,Jm(v)),this.targetRuleResults.set(h,Jm(y))}var g=this.sourceRuleResults.get(h),_=g.isAllPass,m=g.msg,b=this.targetRuleResults.get(h),E=b.isAllPass,x=b.msg,M=_&&E?t.ElementState.ALLOW_CONNECT:t.ElementState.NOT_ALLOW_CONNECT;return f===t.AdjustType.SOURCE?n.setElementState(M):r.setElementState(M),{pass:_&&E,msg:x||m,newTargetNode:r}},n.prototype.render=function(){var t=this.props,e=t.x,n=t.y,r=t.getAdjustPointShape,o=t.edgeModel,i=this.state.dragging;return uo("g",{pointerEvents:i?"none":"",onMouseDown:this.handleMouseDown,children:i?"":r(e,n,o)})},n}(Vn),HE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getArrowAttributes=function(){var t=this.props,e=t.arrowInfo,n=t.style,r=e.start,o=e.end,i={start:r,end:o,offset:n.offset,verticalLength:n.verticalLength,type:"end"},a=T_(i),s=a.leftX,u=a.leftY,l=a.rightX,c=a.rightY;return no({d:"M".concat(s," ").concat(u," L").concat(o.x," ").concat(o.y," L").concat(l," ").concat(c," z")},n)},e.prototype.getShape=function(){var t=this.getArrowAttributes(),e=t.d,n=t.strokeWidth,r=t.stroke;return uo(uE,{d:e,fill:t.fill,strokeWidth:n,stroke:r})},e.prototype.render=function(){return uo("g",{className:"lf-arrow",children:this.getShape()})},e}(Vn),WE=function(e){function n(){var n=e.call(this)||this;return n.textRef={current:null},n.handleHover=function(e,r){var o=n.props,i=o.model,a=o.graphModel.eventCenter;i.setHovered(e);var s=e?t.EventType.EDGE_MOUSEENTER:t.EventType.EDGE_MOUSELEAVE,u=i.getData();a.emit(s,{data:u,e:r})},n.setHoverOn=function(t){n.props.model.isHovered||(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOn(),n.handleHover(!0,t))},n.setHoverOff=function(t){n.props.model.isHovered&&(n.textRef&&n.textRef.current&&n.textRef.current.setHoverOff(),n.handleHover(!1,t))},n.handleContextMenu=function(e){e.preventDefault(),n.contextMenuTime=(new Date).getTime(),n.clickTimer&&clearTimeout(n.clickTimer);var r=n.props,o=r.model,i=r.graphModel,a=i.getPointByClient({x:e.clientX,y:e.clientY});i.setElementStateById(o.id,t.ElementState.SHOW_MENU,a.domOverlayPosition),n.toFront(),o.isSelected||i.selectEdgeById(o.id);var s=null==o?void 0:o.getData();i.eventCenter.emit(t.EventType.EDGE_CONTEXTMENU,{data:s,e:e,position:a})},n.handleMouseDown=function(t){t.stopPropagation(),n.startTime=(new Date).getTime()},n.handleMouseUp=function(e){if(n.startTime&&!((new Date).getTime()-n.startTime>200||2===e.button)){var r=2===e.detail,o=n.props,i=o.model,a=o.graphModel,s=null==i?void 0:i.getData(),u=a.getPointByClient({x:e.clientX,y:e.clientY});if(r){var l=a.editConfigModel,c=a.textEditElement,p=i.id,d=i.text,f=i.modelType;if(c&&c.id===p&&a.setElementStateById(p,t.ElementState.DEFAULT),l.edgeTextEdit&&d.editable&&(i.setSelected(!1),a.setElementStateById(p,t.ElementState.TEXT_EDIT)),f===t.ModelType.POLYLINE_EDGE){var h=i,v=a.getPointByClient({x:e.x,y:e.y}).canvasOverlayPosition,y=v.x,g=v.y;h.dbClickPosition=vm({x:y,y:g},h.points)}a.eventCenter.emit(t.EventType.EDGE_DBCLICK,{data:s,e:e,position:u})}else a.eventCenter.emit(t.EventType.ELEMENT_CLICK,{data:s,e:e,position:u}),a.eventCenter.emit(t.EventType.EDGE_CLICK,{data:s,e:e,position:u});var _=a.editConfigModel;a.selectEdgeById(i.id,wm(e,_)),n.toFront()}},n}return eo(n,e),n.prototype.getShape=function(){return uo("g",{children:this.getEdge()})},n.prototype.getTextStyle=function(){},n.prototype.getText=function(){var e,n=this.props,r=n.model,o=n.graphModel,i=o.editConfigModel;if(i.edgeTextMode!==t.TextMode.TEXT)return null;if(r.state===t.ElementState.TEXT_EDIT)return null;if(r.text){var a=!1;return i.edgeTextDraggable&&r.text.draggable&&(a=!0),uo(DE,{ref:this.textRef,editable:i.edgeTextEdit&&(null===(e=r.text.editable)||void 0===e||e),model:r,graphModel:o,draggable:a})}return null},n.prototype.getArrowInfo=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=t.isSelected;return{start:e,end:n,hover:this.state.hover,isSelected:r}},n.prototype.getLastTwoPoints=function(){var t=this.props.model;return[t.startPoint,t.endPoint]},n.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},n.prototype.getArrow=function(){var t=this.props.model,e=t.id,n=t.getArrowStyle(),r=n.refY,o=void 0===r?0:r,i=n.refX,a=void 0===i?2:i,s=io(this.getLastTwoPoints(),2),u=s[0],l=s[1],c="auto";return null!==u&&null!==l&&(c=Ob(Ab({x:l.x-u.x,y:l.y-u.y,z:0}))),uo("g",{children:uo("defs",{children:[uo("marker",{id:"marker-start-".concat(e),refX:-a,refY:o,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),uo("marker",{id:"marker-end-".concat(e),refX:a,refY:o,overflow:"visible",orient:c,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},n.prototype.getStartArrow=function(){return uo("path",{})},n.prototype.getEndArrow=function(){var t=this.props.model.getArrowStyle(),e=t.stroke,n=t.strokeWidth,r=t.offset,o=t.verticalLength;return uo("path",{stroke:e,fill:e,strokeWidth:n,transform:"rotate(180)",d:"M 0 0 L ".concat(r," -").concat(o," L ").concat(r," ").concat(o," Z")})},n.prototype.getAdjustPointShape=function(t,e,n){var r=n.getAdjustPointStyle();return uo(lE,no({className:"lf-edge-adjust-point"},r,{x:t,y:e}))},n.prototype.getAdjustPoints=function(){var e=this.props,n=e.model,r=e.graphModel,o=r.editConfigModel,i=o.adjustEdgeStartAndEnd,a=o.adjustEdgeStart,s=o.adjustEdgeEnd,u=n.getAdjustStart(),l=n.getAdjustEnd();return uo("g",{children:[i&&a&&uo(XE,no({type:t.AdjustType.SOURCE},u,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:n,graphModel:r})),i&&s&&uo(XE,no({type:t.AdjustType.TARGET},l,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:n,graphModel:r}))]})},n.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},n.prototype.getAppendWidth=function(){return uo("g",{})},n.prototype.getAppend=function(){return uo("g",{className:"lf-edge-append",children:this.getAppendWidth()})},n.prototype.getEdge=function(){return null},n.prototype.toFront=function(){var t=this.props,e=t.graphModel,n=t.model;e.toFront(n.id)},n.prototype.render=function(){var t=this.props.model,e=t.isSelected,n=t.isHitable,r=t.isShowAdjustPoint;return uo("g",{children:[uo("g",{className:["lf-edge",!n&&"pointer-none",e&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),r&&e?this.getAdjustPoints():""]})},n.isObserved=!1,n}(Vn),GE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.getEdgeStyle(),n=t,r=n.path,o=n.isAnimation,i=n.arrowConfig,a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,u=a.stroke,l=a.strokeDashoffset,c=a.animationName,p=a.animationDuration,d=a.animationIterationCount,f=a.animationTimingFunction,h=a.animationDirection;return uo(uE,no({d:r},e,i,o?{strokeDasharray:s,stroke:u,style:{strokeDashoffset:l,animationName:c,animationDuration:p,animationIterationCount:d,animationTimingFunction:f,animationDirection:h}}:{}))},e.prototype.getAppendWidth=function(){return uo(uE,{d:this.props.model.path,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var t=this.props.model,e=this.state.hover,n=t.isSelected,r=t.getArrowStyle().offset,o=t.pointsList.map((function(t){return{x:t.x,y:t.y}})),i=io(hm(o,r),2);return{start:i[0],end:i[1],hover:e,isSelected:n}},e.prototype.getLastTwoPoints=function(){var t=this.props.model,e=t.getArrowStyle().offset,n=t.pointsList.map((function(t){return{x:t.x,y:t.y}}));return hm(n,e)},e}(WE),YE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eo(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=t.isAnimation,o=t.arrowConfig,i=t.getEdgeStyle(),a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,u=a.stroke,l=a.strokeDashoffset,c=a.animationName,p=a.animationDuration,d=a.animationIterationCount,f=a.animationTimingFunction,h=a.animationDirection;return uo(aE,no({},i,{x1:e.x,y1:e.y,x2:n.x,y2:n.y},o,r?{strokeDasharray:s,stroke:u,style:{strokeDashoffset:l,animationName:c,animationDuration:p,animationIterationCount:d,animationTimingFunction:f,animationDirection:h}}:{}))},e.prototype.getAppendWidth=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=cm({start:e,end:n}),o=r.d,i=r.strokeWidth,a=r.fill,s=r.strokeDasharray;return uo(uE,{d:o,fill:a,strokeWidth:i,stroke:r.stroke,strokeDasharray:s})},e}(WE),VE=function(e){function n(){var n=e.call(this)||this;return n.onDragStart=function(){var t=n.props.model;t.dragAppendStart(),n.isShowAdjustPointTemp=t.isShowAdjustPoint,t.isShowAdjustPoint=!1},n.onDragging=function(t){var e=t.deltaX,r=t.deltaY,o=n.props,i=o.model,a=o.graphModel;n.isDragging=!0;var s=a.transformModel,u=a.editConfigModel,l=io(s.fixDeltaXY(e,r),2),c=l[0],p=l[1],d=i,f=u.adjustEdgeMiddle;n.appendInfo=f?d.dragAppendSimple(n.appendInfo,{x:c,y:p}):d.dragAppend(n.appendInfo,{x:c,y:p})},n.onDragEnd=function(){var e,r=n.props,o=r.model,i=r.graphModel.eventCenter,a=o;a.dragAppendEnd(),n.isDragging=!1,a.isShowAdjustPoint=null!==(e=n.isShowAdjustPointTemp)&&void 0!==e&&e,n.appendInfo=void 0,i.emit(t.EventType.EDGE_ADJUST,{data:a.getData()})},n.beforeDragStart=function(t,e){e.draggable&&n.drag.handleMouseDown(t),n.appendInfo=e},n.drag=new __({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,isStopPropagation:!1}),n}return eo(n,e),n.prototype.getEdge=function(){var t=this.props.model,e=t.points,n=t.isAnimation,r=t.arrowConfig,o=t.getEdgeStyle(),i=t.getEdgeAnimationStyle(),a=i.strokeDasharray,s=i.stroke,u=i.strokeDashoffset,l=i.animationName,c=i.animationDuration,p=i.animationIterationCount,d=i.animationTimingFunction,f=i.animationDirection;return uo(dE,no({points:e},o,r,n?{strokeDasharray:a,stroke:s,style:{strokeDashoffset:u,animationName:l,animationDuration:c,animationIterationCount:p,animationTimingFunction:d,animationDirection:f}}:{}))},n.prototype.getArrowInfo=function(){var t=this.props.model,e=t.points,n=t.isSelected,r=this.state.hover,o=om(e),i=o[0],a=o[0];return o.length>=2&&(i=o[o.length-2],a=o[o.length-1]),{start:i,end:a,hover:r,isSelected:n}},n.prototype.getLastTwoPoints=function(){var t=this.props.model.points,e=om(t),n=e[0],r=e[0];return e.length>=2&&(n=e[e.length-2],r=e[e.length-1]),[n,r]},n.prototype.getAppendAttributes=function(t){var e,n=t.start,r=t.end;if(n.x===r.x&&n.y===r.y)e="";else{var o={start:n,end:r,offset:10,verticalLength:5},i=T_(no(no({},o),{type:"start"})),a=T_(no(no({},o),{type:"end"}));e="M".concat(i.leftX," ").concat(i.leftY,"\n L").concat(i.rightX," ").concat(i.rightY,"\n L").concat(a.rightX," ").concat(a.rightY,"\n L").concat(a.leftX," ").concat(a.leftY," z")}return{d:e,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},n.prototype.getAppendShape=function(t){var e=this.getAppendAttributes(t),n=e.d,r=e.strokeWidth,o=e.fill,i=e.strokeDasharray;return uo(uE,{d:n,fill:o,strokeWidth:r,stroke:e.stroke,strokeDasharray:i})},n.prototype.getAppendWidth=function(){for(var e=this,n=this.props,r=n.model,o=n.graphModel,i=r.pointsList,a=r.draggable,s=[],u=i.length,l=function(n){var r="lf-polyline-append",l={start:{x:i[n].x,y:i[n].y},end:{x:i[n+1].x,y:i[n+1].y},startIndex:n,endIndex:n+1,direction:t.SegmentDirection.HORIZONTAL,draggable:!0},p=uo("g",{className:r,children:c.getAppendShape(l)}),d=o.editConfigModel,f=d.adjustEdge,h=d.adjustEdgeMiddle;if(f&&a){var v=l.startIndex,y=l.endIndex,g=h&&(0===v||y===u-1);l.draggable=!g,l.start.x===l.end.x?(l.draggable&&(r+="-ew-resize"),l.direction=t.SegmentDirection.VERTICAL):l.start.y===l.end.y&&(l.draggable&&(r+="-ns-resize"),l.direction=t.SegmentDirection.HORIZONTAL),p=uo("g",{className:c.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(t){return e.beforeDragStart(t,l)},children:uo("g",{className:r,children:c.getAppendShape(l)})})}s.push(p)},c=this,p=0;p<u-1;p++)l(p);return uo("g",{children:s})},n}(WE),FE=function(){function e(e){var n=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){n.nodeConfig=null,window.document.removeEventListener("mouseup",n.stopDrag)},this.dragEnter=function(t){n.nodeConfig&&!n.fakeNode&&(n.fakeNode=n.lf.createFakeNode(no(no({},n.nodeConfig),n.clientToLocalPoint({x:t.clientX,y:t.clientY}))))},this.onDragOver=function(e){if(e.preventDefault(),n.fakeNode){var r=n.clientToLocalPoint({x:e.clientX,y:e.clientY}),o=r.x,i=r.y;n.fakeNode.moveTo(o,i);var a=n.fakeNode.getData();n.lf.setNodeSnapLine(a),n.lf.graphModel.eventCenter.emit(t.EventType.NODE_DND_DRAG,{data:a})}return!1},this.onDragLeave=function(){n.fakeNode&&(n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)},this.onDrop=function(e){n.lf.graphModel&&e&&n.nodeConfig&&(n.lf.addNode(no(no({},n.nodeConfig),n.clientToLocalPoint({x:e.clientX,y:e.clientY})),t.EventType.NODE_DND_ADD,e),e.preventDefault(),e.stopPropagation(),n.nodeConfig=null,n.lf.removeNodeSnapLine(),n.lf.graphModel.removeFakeNode(),n.fakeNode=null)};var r=e.lf;this.lf=r}return e.prototype.clientToLocalPoint=function(t){var e=t.x,n=t.y,r=cu(this.lf.options,["grid","size"]),o=this.lf.graphModel.getPointByClient({x:e,y:n}).canvasOverlayPosition,i=o.x,a=o.y;return{x:bm(i,r),y:bm(a,r)}},e.prototype.startDrag=function(t){var e=this.lf.graphModel.editConfigModel;(null==e?void 0:e.isSilentMode)||(this.nodeConfig=t,window.document.addEventListener("mouseup",this.stopDrag))},e.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},e}();var KE=function(e){function n(n){var r=e.call(this,n)||this;return r.ref={current:null},r.__prevText={type:"",text:"",id:""},r.keyupHandler=function(e){var n=r.props.graphModel.textEditElement;"Enter"===e.key&&e.altKey&&(null==n||n.setElementState(t.ElementState.DEFAULT))},r.inputHandler=function(t){var e=t.target.innerText,n=r.props.graphModel.textEditElement;n&&(r.__prevText={type:n.type,text:e.replace(/(\r\n)+$|(\n)+$/,""),id:n.id})},r.keydownHandler=function(t){t.stopPropagation()},r.state={style:{left:0,top:0}},r}return eo(n,e),n.getDerivedStateFromProps=function(e){var n,r,o=e.textEditElement,i=e.graphModel,a=i.transformModel,s=i.theme,u=s.inputText;if(o){if(!(null===(n=o.text)||void 0===n?void 0:n.value)&&o.BaseType===t.ElementType.EDGE){var l=o.text,c=o.textPosition,p=c.x,d=c.y;l.x=p,l.y=d,o.setText(l)}var f={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(o.BaseType===t.ElementType.EDGE){var h=s.edgeText,v=h.overflowMode,y=h.lineHeight,g=h.wrapPadding;(m=h.textWidth)&&"autoWrap"===v&&(r=no(no({},f),{width:m,minWidth:m,lineHeight:y,padding:g}))}else if(o.BaseType===t.ElementType.NODE){var _=s.nodeText,m=(v=_.overflowMode,y=_.lineHeight,g=_.wrapPadding,_.textWidth),b=o.width,E=o.modelType,x=o.textWidth||m||b;(E!==t.ModelType.TEXT_NODE&&"autoWrap"===v||E===t.ModelType.TEXT_NODE&&m)&&(r=no(no({},f),{width:x,minWidth:x,lineHeight:y,padding:g}))}var M=o.text,w=M.x,S=M.y,T=io(a.CanvasPointToHtmlPoint([w,S]),2),A=T[0],O=T[1];return{style:no(no({left:A,top:O},r),u)}}return null},n.prototype.componentDidUpdate=function(){var e=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),""!==this.__prevText.id){var n=this.__prevText,r=n.text,o=n.id;e.updateText(o,r),e.eventCenter.emit(t.EventType.TEXT_UPDATE,{data:no({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},n.prototype.placeCaretAtEnd=function(t){if(void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var n=window.getSelection();null==n||n.removeAllRanges(),null==n||n.addRange(e)}},n.prototype.render=function(){var t,e=this.props.graphModel.textEditElement,n=this.state.style;return e?uo("div",{contentEditable:!0,className:"lf-text-input",style:n,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:null===(t=e.text)||void 0===t?void 0:t.value},e.id):null},n.toolName="text-edit-tool",n=oo([Ax],n)}(Vn),qE=function(e){function n(n){var r=e.call(this,n)||this;r.handleMouseDown=function(t){r.stepDrag.handleMouseDown(t)},r.handleWheelEvent=function(t){var e,n;t.preventDefault();var o=t.deltaX,i=t.deltaY,a=t.clientX,s=t.clientY,u=t.ctrlKey,l=new WheelEvent("wheel",{deltaX:o,deltaY:i,clientX:a,clientY:s,ctrlKey:u});null===(n=null===(e=r.props.lf.container)||void 0===e?void 0:e.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))||void 0===n||n.dispatchEvent(l)},r.onDragging=function(t){var e=t.deltaX,n=t.deltaY,o=r.props,i=o.graphModel,a=o.lf.getTransform(),s=a.SCALE_X,u=a.SCALE_Y,l=i.getSelectElements(!0);i.moveNodes(l.nodes.map((function(t){return t.id})),e/s,n/u)},r.handleContextMenu=function(e){e.preventDefault();var n=r.props,o=n.graphModel,i=n.graphModel,a=i.eventCenter,s=i.selectElements,u=o.getPointByClient({x:e.clientX,y:e.clientY}),l={nodes:[],edges:[]};ao([],io(s.values()),!1).forEach((function(e){e.BaseType===t.ElementType.NODE&&l.nodes.push(e.getData()),e.BaseType===t.ElementType.EDGE&&l.edges.push(e.getData())})),a.emit(t.EventType.SELECTION_CONTEXTMENU,{data:l,e:e,position:u})};var o=n.graphModel,i=o.gridSize,a=o.eventCenter;return r.stepDrag=new __({onDragging:r.onDragging,step:i,eventType:"SELECTION",eventCenter:a}),r}return eo(n,e),n.prototype.render=function(){var e,n,r=this.props.graphModel,o=r.selectElements,i=r.transformModel,a=this.props.lf.getTransform(),s=a.SCALE_X,u=a.SCALE_Y;if(!(o.size<=1)){var l=Number.MAX_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,p=Number.MIN_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER;return o.forEach((function(e){var n;e.BaseType===t.ElementType.NODE&&(n=m_(e)),e.BaseType===t.ElementType.EDGE&&(n=M_(e)),void 0!==n&&(l=Math.min(l,n.x),c=Math.min(c,n.y),p=Math.max(p,n.x1),d=Math.max(d,n.y1))})),e=io(i.CanvasPointToHtmlPoint([l,c]),2),l=e[0],c=e[1],n=io(i.CanvasPointToHtmlPoint([p,d]),2),p=n[0],d=n[1],uo("div",{className:"lf-multiple-select",style:{left:"".concat(l-20*s/2,"px"),top:"".concat(c-20*u/2,"px"),width:"".concat(p-l+20*s,"px"),height:"".concat(d-c+20*u,"px"),"border-width":"".concat(2*s,"px")},onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},n.toolName="multiple-select-tool",n=oo([Ax],n)}(Vn),ZE=[KE,qE],$E=function(){function e(e){var n=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=e,Yd(ZE,(function(t){n.isDisabled(t.toolName)||n.registerTool(t.toolName,t)}));var r=e.graphModel;r.eventCenter.on("".concat(t.EventType.GRAPH_TRANSFORM,",").concat(t.EventType.NODE_CLICK,",").concat(t.EventType.BLANK_CLICK," "),(function(){var e,n=r.textEditElement,o=r.editConfigModel,i=o.edgeTextEdit,a=o.nodeTextEdit;(i||a)&&n&&(null===(e=r.textEditElement)||void 0===e||e.setElementState(t.ElementState.DEFAULT))}))}return e.prototype.isDisabled=function(t){var e;return-1!==(null===(e=this.instance.options.disabledTools)||void 0===e?void 0:e.indexOf(t))},e.prototype.registerTool=function(t,e){this.toolMap.set(t,e)},e.prototype.disableTool=function(t){var e=this.toolMap.get(t);if(e)return this.disabledToolMap.set(t,e),this.toolMap.delete(t),!0;throw new Error("禁用失败,不存在名为 ${tool} 的工具")},e.prototype.enableTool=function(t){var e=this.disabledToolMap.get(t);if(e)return this.toolMap.set(t,e),this.disabledToolMap.delete(t),!0;throw new Error("不存在名为 ${tool} 的工具")},e.prototype.getTools=function(){return Array.from(this.toolMap.values())},e.prototype.getInstance=function(){return this.instance},oo([$],e.prototype,"toolMap",void 0),oo([te],e.prototype,"disableTool",null),oo([te],e.prototype,"enableTool",null),e}();function JE(t,e){void 0===e&&(e="Illegal state"),t||function(t){throw new Error("[mobx-utils] "+t)}(e)}var QE=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(QE(Object.getPrototypeOf(t))||[])},tx=function(t){return function(t){var e=QE(t),n=e.filter((function(t,n){return e.indexOf(t)===n}));return n}(t).filter((function(t){return"constructor"!==t&&!~t.indexOf("__")}))},ex="pending",nx="fulfilled",rx="rejected";function ox(t){switch(this.state){case ex:return t.pending&&t.pending(this.value);case rx:return t.rejected&&t.rejected(this.value);case nx:return t.fulfilled?t.fulfilled(this.value):this.value}}function ix(t,e){if(JE(arguments.length<=2,"fromPromise expects up to two arguments"),JE("function"==typeof t||"object"==typeof t&&t&&"function"==typeof t.then,"Please pass a promise or function to fromPromise"),!0===t.isPromiseBasedObservable)return t;"function"==typeof t&&(t=new Promise(t));var n=t;t.then(te("observableFromPromise-resolve",(function(t){n.value=t,n.state=nx})),te("observableFromPromise-reject",(function(t){n.value=t,n.state=rx}))),n.isPromiseBasedObservable=!0,n.case=ox;var r=e&&e.state===nx?e.value:void 0;return pe(n,{value:r,state:ex},{},{deep:!1}),n}!function(t){t.reject=te("fromPromise.reject",(function(e){var n=t(Promise.reject(e));return n.state=rx,n.value=e,n})),t.resolve=te("fromPromise.resolve",(function(e){void 0===e&&(e=void 0);var n=t(Promise.resolve(e));return n.state=nx,n.value=e,n}))}(ix||(ix={}));var ax=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a};!function(){function t(t,e){var n=this;ee((function(){n.current=e,n.subscription=t.subscribe(n)}))}t.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.next=function(t){this.current=t},t.prototype.complete=function(){this.dispose()},t.prototype.error=function(t){this.current=t,this.dispose()},ax([$.ref],t.prototype,"current",void 0),ax([te.bound],t.prototype,"next",null),ax([te.bound],t.prototype,"complete",null),ax([te.bound],t.prototype,"error",null)}();var sx=function(){return sx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},sx.apply(this,arguments)},ux=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},lx=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];function cx(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function px(t){return fn(t)||Je(t)||nn(t)}function dx(t,e){var n=new WeakMap;function r(r){var a=n.get(r.object);!function(t,e){switch(t.type){case"add":o(t.newValue,e,t.name);break;case"update":i(t.oldValue),o(t.newValue,e,t.name||""+t.index);break;case"remove":case"delete":i(t.oldValue);break;case"splice":t.removed.map(i),t.added.forEach((function(n,r){return o(n,e,""+(t.index+r))}));for(var r=t.index+t.addedCount;r<t.object.length;r++)if(px(t.object[r])){var a=n.get(t.object[r]);a&&(a.path=""+r)}}}(r,a),e(r,cx(a),t)}function o(t,e,i){if(px(t)){var a=n.get(t);if(a){if(a.parent!==e||a.path!==i)throw new Error("The same observable object cannot appear twice in the same tree, trying to assign it to '"+cx(e)+"/"+i+"', but it already exists at '"+cx(a.parent)+"/"+a.path+"'")}else{var s={parent:e,path:i,dispose:Ne(t,r)};n.set(t,s),Ae(t).forEach((function(t){var e=t[0];return o(t[1],s,e)}))}}}function i(t){if(px(t)){var e=n.get(t);if(!e)return;n.delete(t),e.dispose(),Te(t).forEach(i)}}return o(t,void 0,""),function(){i(t)}}!function(){function t(t){var e=this;this.model=t,this.localValues=$.map({}),this.localComputedValues=$.map({}),this.isPropertyDirty=function(t){return e.localValues.has(t)},JE(fn(t),"createViewModel expects an observable object"),tx(t).forEach((function(n){if(n!==w&&"__mobxDidRunLazyInitializers"!==n){if(JE(-1===lx.indexOf(n),"The propertyname "+n+" is reserved and cannot be used with viewModels"),xe(t,n)){var r=vn(t,n).derivation;e.localComputedValues.set(n,rt(r.bind(e)))}var o=Object.getOwnPropertyDescriptor(t,n),i=o?{enumerable:o.enumerable}:{};Object.defineProperty(e,n,sx(sx({},i),{configurable:!0,get:function(){return xe(t,n)?e.localComputedValues.get(n).get():e.isPropertyDirty(n)?e.localValues.get(n):e.model[n]},set:te((function(t){t!==e.model[n]?e.localValues.set(n,t):e.localValues.delete(n)}))}))}}))}Object.defineProperty(t.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),t.prototype.submit=function(){var t=this;Se(this.localValues).forEach((function(e){var n=t.localValues.get(e),r=t.model[e];Je(r)?r.replace(n):nn(r)?(r.clear(),r.merge(n)):Ee(n)||(t.model[e]=n)})),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(t){this.localValues.delete(t)},ux([rt],t.prototype,"isDirty",null),ux([rt],t.prototype,"changedValues",null),ux([te.bound],t.prototype,"submit",null),ux([te.bound],t.prototype,"reset",null),ux([te.bound],t.prototype,"resetProperty",null)}();var fx=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){function e(e,n,r){var o=void 0===r?{}:r,i=o.name,a=void 0===i?"ogm"+(1e3*Math.random()|0):i,s=o.keyToName,u=void 0===s?function(t){return""+t}:s,l=t.call(this)||this;l._keyToName=u,l._groupBy=n,l._ogmInfoKey=Symbol("ogmInfo"+a),l._base=e;for(var c=0;c<e.length;c++)l._addItem(e[c]);return l._disposeBaseObserver=Ne(l._base,(function(t){if("splice"===t.type)ke((function(){for(var e=0,n=t.removed;e<n.length;e++){var r=n[e];l._removeItem(r)}for(var o=0,i=t.added;o<i.length;o++){var a=i[o];l._addItem(a)}}));else{if("update"!==t.type)throw new Error("illegal state");ke((function(){l._removeItem(t.oldValue),l._addItem(t.newValue)}))}})),l}fx(e,t),e.prototype.clear=function(){throw new Error("not supported")},e.prototype.delete=function(t){throw new Error("not supported")},e.prototype.set=function(t,e){throw new Error("not supported")},e.prototype.dispose=function(){this._disposeBaseObserver();for(var t=0;t<this._base.length;t++){var e=this._base[t];e[this._ogmInfoKey].reaction(),delete e[this._ogmInfoKey]}},e.prototype._getGroupArr=function(e){var n=t.prototype.get.call(this,e);return void 0===n&&(n=$([],{name:"GroupArray["+this._keyToName(e)+"]",deep:!1}),t.prototype.set.call(this,e,n)),n},e.prototype._removeFromGroupArr=function(e,n){var r=t.prototype.get.call(this,e);1===r.length?t.prototype.delete.call(this,e):(n===r.length-1||(r[n]=r[r.length-1],r[n][this._ogmInfoKey].groupArrIndex=n),r.length--)},e.prototype._addItem=function(t){var e=this,n=this._groupBy(t),r=this._getGroupArr(n),o={groupByValue:n,groupArrIndex:r.length,reaction:ae((function(){return e._groupBy(t)}),(function(n,r){var o=t[e._ogmInfoKey];e._removeFromGroupArr(o.groupByValue,o.groupArrIndex);var i=e._getGroupArr(n),a=i.length;i.push(t),o.groupByValue=n,o.groupArrIndex=a}))};Object.defineProperty(t,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:o}),r.push(t)},e.prototype._removeItem=function(t){var e=t[this._ogmInfoKey];this._removeFromGroupArr(e.groupByValue,e.groupArrIndex),e.reaction(),delete t[this._ogmInfoKey]}}(en),Promise.resolve(),"undefined"!=typeof queueMicrotask||"undefined"!=typeof process&&process.nextTick;var hx=function(){function e(t){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=t}return e.prototype.add=function(e){mh(zd(this.undos),e)||(this.undos.push(e),mh(this.curData,e)||(this.redos=[]),this.eventCenter.emit(t.EventType.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},e.prototype.undoAble=function(){return this.undos.length>1},e.prototype.undo=function(){if(this.undoAble()){var t=this.undos.pop();this.redos.push(t);var e=this.undos.pop();return this.curData=up(e),e}},e.prototype.redoAble=function(){return this.redos.length>0},e.prototype.redo=function(){if(this.redoAble()){var t=this.redos.pop();return this.curData=up(t),t}},e.prototype.watch=function(t){var e=this;this.stopWatch&&this.stopWatch(),this.undos.push(t.modelToGraphData()),this.stopWatch=dx(t,bd((function(){var n=t.modelToHistoryData();n&&e.add(no({},n))}),this.waitTime))},e}(),vx={},yx={get exports(){return vx},set exports(t){vx=t}};!function(t){!function(e,n,r){if(e){for(var o,i={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},a={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},s={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},u={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l=1;l<20;++l)i[111+l]="f"+l;for(l=0;l<=9;++l)i[l+96]=l.toString();y.prototype.bind=function(t,e,n){var r=this;return t=t instanceof Array?t:[t],r._bindMultiple.call(r,t,e,n),r},y.prototype.unbind=function(t,e){return this.bind.call(this,t,(function(){}),e)},y.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},y.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},y.prototype.stopCallback=function(t,e){if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(v(e,this.target))return!1;if("composedPath"in t&&"function"==typeof t.composedPath){var n=t.composedPath()[0];n!==t.target&&(e=n)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},y.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},y.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);o=null},y.init=function(){var t=y(n);for(var e in t)"_"!==e.charAt(0)&&(y[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},y.init(),e.Mousetrap=y,t.exports&&(t.exports=y)}function c(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function p(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return i[t.which]?i[t.which]:a[t.which]?a[t.which]:String.fromCharCode(t.which).toLowerCase()}function d(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function f(t,e,n){return n||(n=function(){if(!o)for(var t in o={},i)t>95&&t<112||i.hasOwnProperty(t)&&(o[i[t]]=t);return o}()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function h(t,e){var n,r,o,i=[];for(n=function(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus")).split("+")}(t),o=0;o<n.length;++o)r=n[o],u[r]&&(r=u[r]),e&&"keypress"!=e&&s[r]&&(r=s[r],i.push("shift")),d(r)&&i.push(r);return{key:r,modifiers:i,action:e=f(r,i,e)}}function v(t,e){return null!==t&&t!==n&&(t===e||v(t.parentNode,e))}function y(t){var e=this;if(t=t||n,!(e instanceof y))return new y(t);e.target=t,e._callbacks={},e._directMap={};var r,o={},i=!1,a=!1,s=!1;function u(t){t=t||{};var e,n=!1;for(e in o)t[e]?n=!0:o[e]=0;n||(s=!1)}function l(t,n,r,i,a,s){var u,l,c,p,f=[],h=r.type;if(!e._callbacks[t])return[];for("keyup"==h&&d(t)&&(n=[t]),u=0;u<e._callbacks[t].length;++u)if(l=e._callbacks[t][u],(i||!l.seq||o[l.seq]==l.level)&&h==l.action&&("keypress"==h&&!r.metaKey&&!r.ctrlKey||(c=n,p=l.modifiers,c.sort().join(",")===p.sort().join(",")))){var v=!i&&l.combo==a,y=i&&l.seq==i&&l.level==s;(v||y)&&e._callbacks[t].splice(u,1),f.push(l)}return f}function f(t,n,r,o){e.stopCallback(n,n.target||n.srcElement,r,o)||!1===t(n,r)&&(function(t){t.preventDefault?t.preventDefault():t.returnValue=!1}(n),function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}(n))}function v(t){"number"!=typeof t.which&&(t.which=t.keyCode);var n=p(t);n&&("keyup"!=t.type||i!==n?e.handleKey(n,function(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}(t),t):i=!1)}function g(t,e,n,a){function l(e){return function(){s=e,++o[t],clearTimeout(r),r=setTimeout(u,1e3)}}function c(e){f(n,e,t),"keyup"!==a&&(i=p(e)),setTimeout(u,10)}o[t]=0;for(var d=0;d<e.length;++d){var v=d+1===e.length?c:l(a||h(e[d+1]).action);_(e[d],v,a,t,d)}}function _(t,n,r,o,i){e._directMap[t+":"+r]=n;var a,s=(t=t.replace(/\s+/g," ")).split(" ");s.length>1?g(t,s,n,r):(a=h(t,r),e._callbacks[a.key]=e._callbacks[a.key]||[],l(a.key,a.modifiers,{type:a.action},o,t,i),e._callbacks[a.key][o?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:o,level:i,combo:t}))}e._handleKey=function(t,e,n){var r,o=l(t,e,n),i={},c=0,p=!1;for(r=0;r<o.length;++r)o[r].seq&&(c=Math.max(c,o[r].level));for(r=0;r<o.length;++r)if(o[r].seq){if(o[r].level!=c)continue;p=!0,i[o[r].seq]=1,f(o[r].callback,n,o[r].combo,o[r].seq)}else p||f(o[r].callback,n,o[r].combo);var h="keypress"==n.type&&a;n.type!=s||d(t)||h||u(i),a=p&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var r=0;r<t.length;++r)_(t[r],e,n)},c(t,"keypress",v),c(t,"keydown",v),c(t,"keyup",v)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(yx);var gx=vx,_x=function(){function t(t){t.keyboard||(t.keyboard={enabled:!1}),this.options=t;var e=t.lf;this.target=e.container,this.mousetrap=new gx(this.target),t.keyboard.enabled&&!e.options.isSilentMode&&this.enable(!0)}return t.prototype.initShortcuts=function(){var t,e=this,n=(null!==(t=this.options.keyboard)&&void 0!==t?t:{}).shortcuts;if(n)if(Do(n))n.forEach((function(t){var n=t.keys,r=t.callback,o=t.action;return e.on(n,r,o)}));else{var r=n.keys,o=n.callback,i=n.action;this.on(r,o,i)}},t.prototype.on=function(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)},Object.defineProperty(t.prototype,"disabled",{get:function(){var t,e;return!0!==(null===(e=null===(t=this.options)||void 0===t?void 0:t.keyboard)||void 0===e?void 0:e.enabled)},enumerable:!1,configurable:!0}),t.prototype.off=function(t,e){this.mousetrap.unbind(this.getKeys(t),e)},t.prototype.enable=function(t){(this.disabled||t)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},t.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},t.prototype.getKeys=function(t){var e=this;return(Array.isArray(t)?t:[t]).map((function(t){return e.formatKey(t)}))},t.prototype.formatKey=function(t){return t.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},t}(),mx=null;function bx(t,e){return t.x+=e,t.y+=e,_h(t.text)||(t.text.x+=e,t.text.y+=e),t}function Ex(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach((function(t){t.x+=e,t.y+=e})),_h(t.text)||(t.text.x+=e,t.text.y+=e),t}var xx=40,Mx=40;var wx=Symbol("plugin registered by Logicflow.use"),Sx=function(){function e(e){var n,r=this;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(t,e){return r.viewMap.set(t,e)},this.getView=function(t){return r.viewMap.get(t)};var o=t.Options.get(e),i=o.container,a=o.width,s=o.height;this.options=o,this.container=this.initContainer(i,a,s),this.graphModel=new Qb(no(no({},o),{container:this.container})),this.plugins=null!==(n=o.plugins)&&void 0!==n?n:[];var u,l,c,p,d=this.graphModel.eventCenter;this.tool=new $E(this),this.dnd=new FE({lf:this}),this.history=new hx(d),this.keyboard=new _x({lf:this,keyboard:o.keyboard}),!1!==o.snapline&&(this.snaplineModel=new tE(this.graphModel),function(t,e){t.on("node:mousemove",(function(t){var n=t.data;e.setNodeSnapLine(n)})),t.on("node:mouseup",(function(){e.clearSnapline()}))}(d,this.snaplineModel)),o.isSilentMode||(u=this,l=this.graphModel,c=u.keyboard,p=c.options.keyboard,c.on(["cmd + c","ctrl + c"],(function(){if(Mx=xx,!(null==p?void 0:p.enabled))return!0;if(l.textEditElement)return!0;var t=u.options.guards,e=l.getSelectElements(!1);return t&&t.beforeClone&&!t.beforeClone(e)||0===e.nodes.length&&0===e.edges.length?(mx=null,!0):((mx=e).nodes.forEach((function(t){return bx(t,xx)})),mx.edges.forEach((function(t){return Ex(t,xx)})),!1)})),c.on(["cmd + v","ctrl + v"],(function(){if(!(null==p?void 0:p.enabled))return!0;if(l.textEditElement)return!0;if(mx&&(mx.nodes||mx.edges)){u.clearSelectElements();var t=u.addElements(mx,Mx);if(!t)return!0;t.nodes.forEach((function(t){return u.selectElementById(t.id,!0)})),t.edges.forEach((function(t){return u.selectElementById(t.id,!0)})),mx.nodes.forEach((function(t){return bx(t,xx)})),mx.edges.forEach((function(t){return Ex(t,xx)})),Mx+=xx}return!1})),c.on(["cmd + z","ctrl + z"],(function(){return!(null==p?void 0:p.enabled)||!!l.textEditElement||(u.undo(),!1)})),c.on(["cmd + y","ctrl + y"],(function(){return!(null==p?void 0:p.enabled)||!!l.textEditElement||(u.redo(),!1)})),c.on(["backspace"],(function(){if(!(null==p?void 0:p.enabled))return!0;if(l.textEditElement)return!0;var t=l.getSelectElements(!0);return u.clearSelectElements(),t.edges.forEach((function(t){return t.id&&u.deleteEdge(t.id)})),t.nodes.forEach((function(t){return t.id&&u.deleteNode(t.id)})),!1})),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(o.disabledPlugins)}return e.prototype.initContainer=function(t,e,n){var r=document.createElement("div");return r.style.position="relative",r.style.width=e?"".concat(e,"px"):"100%",r.style.height=n?"".concat(n,"px"):"100%",t.innerHTML="",t.appendChild(r),r},Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return e.toStringTag},enumerable:!1,configurable:!0}),e.prototype.register=function(t,e,n){if(void 0===n&&(n=!0),"string"==typeof t){var r={BaseEdge:WE,BaseEdgeModel:Rb,BaseNode:IE,BaseNodeModel:Xb,RectNode:LE,RectNodeModel:Vb,CircleNode:jE,CircleNodeModel:Hb,PolygonNode:kE,PolygonNodeModel:Yb,TextNode:zE,TextNodeModel:Fb,LineEdge:YE,LineEdgeModel:zb,DiamondNode:RE,DiamondNodeModel:Wb,PolylineEdge:VE,PolylineEdgeModel:Ub,BezierEdge:GE,BezierEdgeModel:Bb,EllipseNode:BE,EllipseNodeModel:Gb,HtmlNode:UE,HtmlNodeModel:Kb,h:Hn,type:t};if(this.viewMap.forEach((function(t){var e=t.extendKey;e&&(r[e]=t)})),this.graphModel.modelMap.forEach((function(t){var e=t.extendKey;e&&(r[e]=t)})),e){var o=e(r),i=o.view,a=o.model,s=i;n&&!s.isObserved&&(s.isObserved=!0,s=Ax(s)),this.setView(t,s),this.graphModel.setModel(t,a)}}else this.registerElement(t)},e.prototype.registerElement=function(t){var e=t.view;!1===t.isObserverView||e.isObserved||(e.isObserved=!0,e=Ax(e)),this.setView(t.type,e),this.graphModel.setModel(t.type,t.model)},e.prototype.batchRegister=function(t){var e=this;void 0===t&&(t=[]),Yd(t,(function(t){e.registerElement(t)}))},e.prototype.defaultRegister=function(){var t=[{type:"rect",view:LE,model:Vb},{type:"circle",view:jE,model:Hb},{type:"polygon",view:kE,model:Yb},{type:"text",view:zE,model:Fb},{type:"ellipse",view:BE,model:Gb},{type:"diamond",view:RE,model:Wb},{type:"html",view:UE,model:Kb},{type:"line",view:YE,model:zb},{type:"polyline",view:VE,model:Ub},{type:"bezier",view:GE,model:Bb}];this.batchRegister(t)},e.prototype.addNode=function(e,n,r){return void 0===n&&(n=t.EventType.NODE_ADD),this.graphModel.addNode(e,n,r)},e.prototype.deleteNode=function(t){var e=this.graphModel.getNodeModelById(t);if(!e)return!1;var n=e.getData(),r=this.options.guards,o=!(null==r?void 0:r.beforeDelete)||r.beforeDelete(n);return o&&this.graphModel.deleteNode(t),o},e.prototype.cloneNode=function(t){var e=this.graphModel.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){var r=this.options.guards;if(!(null==r?void 0:r.beforeClone)||r.beforeClone(n))return this.graphModel.cloneNode(t)}},e.prototype.changeNodeId=function(t,e){return this.graphModel.changeNodeId(t,e)},e.prototype.changeNodeType=function(t,e){this.graphModel.changeNodeType(t,e)},e.prototype.getNodeModelById=function(t){return this.graphModel.getNodeModelById(t)},e.prototype.getNodeDataById=function(t){var e=this.getNodeModelById(t);return null==e?void 0:e.getData()},e.prototype.getNodeIncomingEdge=function(t){return this.graphModel.getNodeIncomingEdge(t)},e.prototype.getNodeOutgoingEdge=function(t){return this.graphModel.getNodeOutgoingEdge(t)},e.prototype.getNodeIncomingNode=function(t){return this.graphModel.getNodeIncomingNode(t)},e.prototype.getNodeOutgoingNode=function(t){return this.graphModel.getNodeOutgoingNode(t)},e.prototype.createFakeNode=function(t){var e=this.graphModel.modelMap.get(t.type);if(!e)return console.warn("不存在为".concat(t.type,"类型的节点")),null;var n=new e(no(no({},t),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(n),n},e.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},e.prototype.setNodeSnapLine=function(t){var e;null===(e=this.snaplineModel)||void 0===e||e.setNodeSnapLine(t)},e.prototype.removeNodeSnapLine=function(){var t;null===(t=this.snaplineModel)||void 0===t||t.clearSnapline()},e.prototype.setDefaultEdgeType=function(t){this.graphModel.setDefaultEdgeType(t)},e.prototype.addEdge=function(t){return this.graphModel.addEdge(t)},e.prototype.getEdgeDataById=function(t){var e=this.getEdgeModelById(t);return null==e?void 0:e.getData()},e.prototype.getEdgeModelById=function(t){return this.graphModel.getEdgeModelById(t)},e.prototype.getEdgeModels=function(t){var e=t.sourceNodeId,n=t.targetNodeId,r=[],o=this.graphModel.edges;return e&&n?Yd(o,(function(t){t.sourceNodeId===e&&t.targetNodeId===n&&r.push(t)})):e?Yd(o,(function(t){t.sourceNodeId===e&&r.push(t)})):n&&Yd(o,(function(t){t.targetNodeId===n&&r.push(t)})),r},e.prototype.changeEdgeId=function(t,e){return this.graphModel.changeEdgeId(t,e)},e.prototype.changeEdgeType=function(t,e){this.graphModel.changeEdgeType(t,e)},e.prototype.deleteEdge=function(t){var e=this.graphModel.getEdgeModelById(t);if(!e)return!1;var n=e.getData(),r=this.options.guards,o=!(null==r?void 0:r.beforeDelete)||r.beforeDelete(n);return o&&this.graphModel.deleteEdgeById(t),o},e.prototype.deleteEdgeByNodeId=function(t){var e=t.sourceNodeId,n=t.targetNodeId;e&&n?this.graphModel.deleteEdgeBySourceAndTarget(e,n):e?this.graphModel.deleteEdgeBySource(e):n&&this.graphModel.deleteEdgeByTarget(n)},e.prototype.getNodeEdges=function(t){return this.graphModel.getNodeEdges(t)},e.prototype.addElements=function(t,e){var n=this,r=t.nodes,o=t.edges;void 0===e&&(e=40),console.log("distance",e);var i={},a={nodes:[],edges:[]};return Yd(r,(function(t){var e=t.id,r=n.addNode(t);e&&(i[e]=r.id),a.nodes.push(r)})),Yd(o,(function(t){var e=t.sourceNodeId,r=t.targetNodeId;i[e]&&(e=i[e]),i[r]&&(r=i[r]);var o=n.graphModel.addEdge(no(no({},t),{sourceNodeId:e,targetNodeId:r}));a.edges.push(o)})),a},e.prototype.selectElementById=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!0),this.graphModel.selectElementById(t,e),!e&&n&&this.graphModel.toFront(t)},e.prototype.getSelectElements=function(t){return void 0===t&&(t=!0),this.graphModel.getSelectElements(t)},e.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},e.prototype.getModelById=function(t){return this.graphModel.getElement(t)},e.prototype.getDataById=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getData()},e.prototype.deleteElement=function(e){var n,r,o,i=this.getModelById(e);return!!i&&(null!==(o=null===(r=((n={})[t.ElementType.NODE]=this.deleteNode,n[t.ElementType.EDGE]=this.deleteEdge,n)[i.BaseType])||void 0===r?void 0:r.call(this,e))&&void 0!==o&&o)},e.prototype.setElementZIndex=function(t,e){return this.graphModel.setElementZIndex(t,e)},e.prototype.getAreaElement=function(t,e,n,r,o){return void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===o&&(o=!1),this.graphModel.getAreaElement(t,e,n,r,o).map((function(t){return t.getData()}))},e.prototype.setProperties=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.setProperties(l_(e))},e.prototype.getProperties=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getProperties()},e.prototype.deleteProperty=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.deleteProperty(e)},e.prototype.updateAttributes=function(t,e){this.graphModel.updateAttributes(t,e)},e.prototype.editText=function(t){this.graphModel.editText(t)},e.prototype.updateText=function(t,e){this.graphModel.updateText(t,e)},e.prototype.updateEditConfig=function(t){var e=this.graphModel,n=e.editConfigModel,r=e.transformModel;n.updateEditConfig(t),void 0!==(null==t?void 0:t.stopMoveGraph)&&r.updateTranslateLimits(t.stopMoveGraph),(null==t?void 0:t.isSilentMode)?this.keyboard.disable():this.keyboard.enable(!0)},e.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},e.prototype.setTheme=function(t){this.graphModel.setTheme(t)},e.prototype.focusByElement=function(t){var e=void 0,n=this.getNodeModelById(t);if(n){var r=n.getData();e={x:r.x,y:r.y}}var o=this.getEdgeModelById(t);if(o){var i=o.textPosition;e={x:i.x,y:i.y}}e&&this.focusByCoordinate(e)},e.prototype.focusByCoordinate=function(t){var e=this.graphModel,n=e.transformModel,r=e.width,o=e.height,i=t.x,a=t.y;n.focusOn(i,a,r,o)},e.prototype.focusOn=function(t){if("string"==typeof t)this.focusByElement(t);else if("x"in t&&"y"in t)this.focusByCoordinate(t);else{var e=t.id,n=t.coordinate;e&&this.focusByElement(e),n&&this.focusByCoordinate(n)}},e.prototype.resize=function(t,e){this.graphModel.resize(t,e),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},e.prototype.toFront=function(t){this.graphModel.toFront(t)},e.prototype.getPointByClient=function(t,e){return"object"==typeof t?this.graphModel.getPointByClient(t):"number"==typeof e?this.graphModel.getPointByClient({x:t,y:e}):void 0},e.prototype.getGraphData=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,ao([n],io(t),!1)):n},e.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},e.prototype.clearData=function(){this.graphModel.clearData()},e.prototype.renderRawData=function(e){this.graphModel.graphDataToModel(l_(e)),!1!==this.options.history&&this.history.watch(this.graphModel),function(t,e,n){null==e.__k&&(e.textContent=""),pr(t,e),"function"==typeof n&&n(),t&&t.__c}(uo(EE,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(t.EventType.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},e.prototype.render=function(t){var e=up(t);this.adapterIn&&(e=this.adapterIn(e)),this.renderRawData(e)},e.prototype.undo=function(){if(this.history.undoAble()){var t=l_(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},e.prototype.redo=function(){if(this.history.redoAble()){var t=l_(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},e.prototype.zoom=function(t,e){return this.graphModel.transformModel.zoom(t,e)},e.prototype.resetZoom=function(){this.graphModel.transformModel.resetZoom()},e.prototype.setZoomMiniSize=function(t){this.graphModel.transformModel.setZoomMiniSize(t)},e.prototype.setZoomMaxSize=function(t){this.graphModel.transformModel.setZoomMaxSize(t)},e.prototype.getTransform=function(){var t=this.graphModel.transformModel;return{SCALE_X:t.SCALE_X,SCALE_Y:t.SCALE_Y,TRANSLATE_X:t.TRANSLATE_X,TRANSLATE_Y:t.TRANSLATE_Y}},e.prototype.translate=function(t,e){this.graphModel.transformModel.translate(t,e)},e.prototype.resetTranslate=function(){var t=this.graphModel.transformModel,e=t.TRANSLATE_X,n=t.TRANSLATE_Y;this.translate(-e,-n)},e.prototype.translateCenter=function(){this.graphModel.translateCenter()},e.prototype.fitView=function(t,e){void 0===e&&(e=t),this.graphModel.fitView(t,e)},e.prototype.openEdgeAnimation=function(t){this.graphModel.openEdgeAnimation(t)},e.prototype.closeEdgeAnimation=function(t){this.graphModel.closeEdgeAnimation(t)},e.prototype.on=function(t,e){this.graphModel.eventCenter.on(t,e)},e.prototype.off=function(t,e){this.graphModel.eventCenter.off(t,e)},e.prototype.once=function(t,e){this.graphModel.eventCenter.once(t,e)},e.prototype.emit=function(t,e){this.graphModel.eventCenter.emit(t,e)},e.use=function(t,e){var n,r=t.pluginName;if(!r)throw new Error("请给插件指定 pluginName!");this.extensions.set(r,((n={})[wx]=wx,n.extension=t,n.props=e,n))},e.prototype.installPlugins=function(t){var n=this;void 0===t&&(t=[]);var r=Array.from(e.extensions,(function(t){return io(t,2)[1]}));Yd(ao(ao([],io(this.plugins),!1),io(r),!1),(function(e){var r,o;wx in e?(r=e.extension,o=e.props):r=e;var i=null==r?void 0:r.pluginName;-1===Vf(t,i)&&n.installPlugin(r,o)}))},e.prototype.installPlugin=function(t,n){var r,o;if("pluginName"in t&&"install"in t){var i=t.pluginName,a=t.install,s=t.render;i&&(a&&a.call(t,this,e),s&&this.components.push(s.bind(t)),this.extension[i]=t)}else{var u=t,l=u.pluginName,c=new u({lf:this,LogicFlow:e,props:n,options:null!==(o=null===(r=this.options.pluginsOptions)||void 0===r?void 0:r[l])&&void 0!==o?o:{}});c.render&&this.components.push(c.render.bind(c)),this.extension[l]=c}},e.extensions=new Map,e}();!function(t){t.toStringTag="LF.".concat(t.name)}(Sx||(Sx={}));var Tx=Sx;function Ax(t){return o.observer(t)}t.AdjustPoint=XE,t.Arrow=HE,t.BaseEdge=WE,t.BaseEdgeModel=Rb,t.BaseNode=IE,t.BaseNodeModel=Xb,t.BaseText=OE,t.BezierEdge=GE,t.BezierEdgeModel=Bb,t.Circle=lE,t.CircleNode=jE,t.CircleNodeModel=Hb,t.Component=Vn,t.DEFAULT_GRID_SIZE=10,t.DEFAULT_VISIBLE_SPACE=g_,t.DiamondNode=RE,t.DiamondNodeModel=Wb,t.ELEMENT_MAX_Z_INDEX=9999,t.EditConfigModel=$b,t.Ellipse=cE,t.EllipseNode=BE,t.EllipseNodeModel=Gb,t.GraphModel=Qb,t.HtmlNode=UE,t.HtmlNodeModel=Kb,t.Keyboard=_x,t.Line=aE,t.LineEdge=YE,t.LineEdgeModel=zb,t.LineText=DE,t.LogicFlow=Tx,t.LogicFlowUtil=kb,t.Matrix=Dm,t.Path=uE,t.Point=Om,t.Polygon=pE,t.PolygonNode=kE,t.PolygonNodeModel=Yb,t.Polyline=dE,t.PolylineEdge=VE,t.PolylineEdgeModel=Ub,t.Rect=sE,t.RectNode=LE,t.RectNodeModel=Vb,t.RotateMatrix=Nm,t.ScaleMatrix=Pm,t.SnaplineModel=tE,t.StepDrag=__,t.Text=oE,t.TextNode=zE,t.TextNodeModel=Fb,t.Tool=$E,t.TransformModel=nE,t.TranslateMatrix=Cm,t.Vector=Am,t.action=te,t.cancelRaf=xb,t.computed=rt,t.configure=ce,t.costByPoints=H_,t.createEdgeGenerator=_m,t.createRaf=Eb,t.createRef=Gn,t.createUuid=_b,t.default=Tx,t.defaultAnimationOffConfig=o_,t.defaultAnimationOnConfig=i_,t.defaultTheme=Db,t.degrees=Ob,t.distance=Rm,t.estimateDistance=X_,t.filterRepeatPoints=D_,t.formatAnchorConnectValidateData=Jm,t.formatData=l_,t.getAnchors=Im,t.getAppendAttributes=cm,t.getBBoxCrossPointsByPoint=U_,t.getBBoxOfPoints=j_,t.getBBoxXCrossPoints=B_,t.getBBoxYCrossPoints=z_,t.getBezierControlPoints=pm,t.getBezierOutline=x_,t.getBezierPoints=dm,t.getBoxByOriginNode=Z_,t.getBytesLength=sm,t.getClosestAnchor=km,t.getClosestPointOfPolyline=vm,t.getClosestRadiusCenter=Hm,t.getCrossPointInRect=nm,t.getCrossPointOfLine=w_,t.getCrossPointWithCircle=Wm,t.getCrossPointWithEllipse=Vm,t.getCrossPointWithPolygon=Fm,t.getEdgeOutline=M_,t.getEndTangent=hm,t.getExpandedBBox=P_,t.getExpandedBBoxPoint=I_,t.getGridOffset=Em,t.getHtmlTextHeight=Zm,t.getLineOutline=b_,t.getLongestEdge=Q_,t.getMinIndex=jb,t.getNextNeighborPoints=K_,t.getNodeAnchorPosition=qm,t.getNodeBBox=Um,t.getNodeOutline=m_,t.getPointsFromBBox=k_,t.getPolylineOutline=E_,t.getPolylinePoints=J_,t.getRectRadiusCircle=Xm,t.getSimplePoints=im,t.getSimplePolyline=N_,t.getSvgTextSize=mm,t.getSvgTextWidthHeight=$m,t.getTextWidth=lm,t.getThetaOfVector=Ab,t.getVerticalPointOfLine=T_,t.getZIndex=Lb,t.h=Hn,t.heuristicCostEstimate=W_,t.inStraightLineOfRect=Ym,t.isBboxOverLapping=O_,t.isIe=u_,t.isInNode=Bm,t.isInNodeBbox=zm,t.isInSegment=S_,t.isMultipleSelect=wm,t.isObservable=we,t.isPointInArea=Mm,t.isPointOutsideBBox=R_,t.isSegmentCrossingBBox=F_,t.isSegmentsCrossNode=em,t.isSegmentsInNode=tm,t.isSegmentsIntersected=V_,t.mergeBBox=L_,t.normalizePolygon=xm,t.observable=$,t.observer=Ax,t.pathFinder=q_,t.pickEdgeConfig=ym,t.pickNodeConfig=Km,t.pointDirection=C_,t.pointEdgeDirection=Gm,t.pointFilter=$_,t.points2PointsList=om,t.reaction=ae,t.rebuildPath=G_,t.refreshGraphId=mb,t.removeClosePointFromOpenList=Y_,t.renderHtmlText=iE,t.sampleCubic=Sb,t.segmentDirection=rm,t.setupAnimation=a_,t.setupEdgeModel=A_,t.setupTheme=Nb,t.snapToGrid=bm,t.targetNodeInfo=Lm,t.toJS=Le,t.twoPointDistance=gm,t.updateAnimation=s_,t.updateTheme=Pb,Object.defineProperty(t,"__esModule",{value:!0})}));
32
32
  //# sourceMappingURL=index.min.js.map