@logicflow/extension 2.0.0-beta.7 → 2.0.0-beta.8
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.
- package/.turbo/turbo-build.log +754 -750
- package/dist/index.min.js +6 -6
- package/es/NodeResize/control/Control.d.ts +3 -3
- package/es/NodeResize/control/Control.js +10 -1
- package/es/NodeResize/control/Control.js.map +1 -1
- package/es/NodeResize/index.d.ts +4 -0
- package/es/NodeResize/index.js.map +1 -1
- package/es/bpmn-elements/presets/Pool/Pool.d.ts +9 -9
- package/es/dynamic-group/index.d.ts +106 -0
- package/es/dynamic-group/index.js +536 -0
- package/es/dynamic-group/index.js.map +1 -0
- package/es/dynamic-group/model.d.ts +135 -0
- package/es/dynamic-group/model.js +413 -0
- package/es/dynamic-group/model.js.map +1 -0
- package/es/dynamic-group/node.d.ts +16 -0
- package/es/dynamic-group/node.js +143 -0
- package/es/dynamic-group/node.js.map +1 -0
- package/es/dynamic-group/utils.d.ts +17 -0
- package/es/dynamic-group/utils.js +27 -0
- package/es/dynamic-group/utils.js.map +1 -0
- package/es/index.d.ts +14 -9
- package/es/index.js +21 -9
- package/es/index.js.map +1 -1
- package/es/materials/group/GroupNode.d.ts +0 -4
- package/es/materials/group/GroupNode.js +1 -0
- package/es/materials/group/GroupNode.js.map +1 -1
- package/es/materials/group/index.d.ts +4 -4
- package/es/materials/group/index.js +5 -1
- package/es/materials/group/index.js.map +1 -1
- package/es/materials/node-selection/index.d.ts +4 -0
- package/es/materials/node-selection/index.js.map +1 -1
- package/es/mindmap/index.d.ts +2 -2
- package/lib/NodeResize/control/Control.d.ts +3 -3
- package/lib/NodeResize/control/Control.js +10 -1
- package/lib/NodeResize/control/Control.js.map +1 -1
- package/lib/NodeResize/index.d.ts +4 -0
- package/lib/NodeResize/index.js.map +1 -1
- package/lib/bpmn-elements/presets/Pool/Pool.d.ts +9 -9
- package/lib/dynamic-group/index.d.ts +106 -0
- package/lib/dynamic-group/index.js +553 -0
- package/lib/dynamic-group/index.js.map +1 -0
- package/lib/dynamic-group/model.d.ts +135 -0
- package/lib/dynamic-group/model.js +416 -0
- package/lib/dynamic-group/model.js.map +1 -0
- package/lib/dynamic-group/node.d.ts +16 -0
- package/lib/dynamic-group/node.js +146 -0
- package/lib/dynamic-group/node.js.map +1 -0
- package/lib/dynamic-group/utils.d.ts +17 -0
- package/lib/dynamic-group/utils.js +32 -0
- package/lib/dynamic-group/utils.js.map +1 -0
- package/lib/index.d.ts +14 -9
- package/lib/index.js +21 -9
- package/lib/index.js.map +1 -1
- package/lib/materials/group/GroupNode.d.ts +0 -4
- package/lib/materials/group/GroupNode.js +1 -0
- package/lib/materials/group/GroupNode.js.map +1 -1
- package/lib/materials/group/index.d.ts +4 -4
- package/lib/materials/group/index.js +5 -1
- package/lib/materials/group/index.js.map +1 -1
- package/lib/materials/node-selection/index.d.ts +4 -0
- package/lib/materials/node-selection/index.js.map +1 -1
- package/lib/mindmap/index.d.ts +2 -2
- package/package.json +2 -2
- package/src/NodeResize/control/Control.tsx +10 -1
- package/src/NodeResize/index.ts +4 -0
- package/src/dynamic-group/index.ts +609 -0
- package/src/dynamic-group/model.ts +503 -0
- package/src/dynamic-group/node.ts +140 -0
- package/src/dynamic-group/utils.ts +33 -0
- package/src/index.ts +26 -9
- package/src/materials/group/GroupNode.ts +1 -4
- package/src/materials/group/index.ts +6 -1
- package/src/materials/node-selection/index.ts +6 -1
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).Extension={})}(this,(function(t){"use strict";var e=40,n=40,o=40,r=40,i=40,a=40,s=100,l=80,u=100,c=80,d={rect:{radius:5,stroke:"rgb(24, 125, 255)"},circle:{r:18,stroke:"rgb(24, 125, 255)"},polygon:{stroke:"rgb(24, 125, 255)"},polyline:{stroke:"rgb(24, 125, 255)",hoverStroke:"rgb(24, 125, 255)",selectedStroke:"rgb(24, 125, 255)"},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"white",height:14,stroke:"transparent",radius:3}}},p=function(t,e){return p=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])},p(t,e)};function h(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}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var f=function(){return f=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},f.apply(this,arguments)};function g(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n}function v(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function y(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function m(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function b(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function x(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function w(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 o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:function(){return t[e]}})})),n}var S,C={},
|
|
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).Extension={})}(this,(function(t){"use strict";var e=40,n=40,o=40,r=40,i=40,a=40,s=100,l=80,u=100,c=80,d={rect:{radius:5,stroke:"rgb(24, 125, 255)"},circle:{r:18,stroke:"rgb(24, 125, 255)"},polygon:{stroke:"rgb(24, 125, 255)"},polyline:{stroke:"rgb(24, 125, 255)",hoverStroke:"rgb(24, 125, 255)",selectedStroke:"rgb(24, 125, 255)"},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"white",height:14,stroke:"transparent",radius:3}}},p=function(t,e){return p=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])},p(t,e)};function h(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}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var f=function(){return f=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},f.apply(this,arguments)};function g(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n}function v(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function y(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function m(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function b(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function x(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function w(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 o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:function(){return t[e]}})})),n}var S,C={},M={};var O="An invariant failed, however the error is obfuscated because this is a production build.",T=[];Object.freeze(T);var N={};function A(){return++ne.mobxGuid}function P(t){throw D(!1,t),"X"}function D(t,e){if(!t)throw new Error("[mobx] "+(e||O))}function k(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}Object.freeze(N);var R=function(){};function I(t){return null!==t&&"object"==typeof t}function L(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function j(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function B(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return I(t)&&!0===t[n]}}function H(t){return t instanceof Map}function z(t){return t instanceof Set}function F(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 W(t){return t&&t.toString?t.toString():new String(t).toString()}function G(t){return null===t?null:"object"==typeof t?""+t:t}var X="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,U=Symbol("mobx administration"),Y=function(){function t(t){void 0===t&&(t="Atom@"+A()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=_t.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 le(this)},t.prototype.reportChanged=function(){ae(),function(t){if(t.lowestObserverState===_t.STALE)return;t.lowestObserverState=_t.STALE,t.observers.forEach((function(e){e.dependenciesState===_t.UP_TO_DATE&&(e.isTracing!==xt.NONE&&ue(e,t),e.onBecomeStale()),e.dependenciesState=_t.STALE}))}(this),se()},t.prototype.toString=function(){return this.name},t}(),V=B("Atom",Y);function K(t,e,n){void 0===e&&(e=R),void 0===n&&(n=R);var o=new Y(t);return e!==R&&Te(o,e),n!==R&&Ne(o,n),o}var q={identity:function(t,e){return t===e},structural:function(t,e){return Hn(t,e)},default:function(t,e){return Object.is(t,e)},shallow:function(t,e){return Hn(t,e,1)}},Z=function(t,e){return Z=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])},Z(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 $=function(){return $=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},$.apply(this,arguments)};function J(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 Q(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function tt(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Q(arguments[e]));return t}var et=Symbol("mobx did run lazy initializers"),nt=Symbol("mobx pending decorators"),ot={},rt={};function it(t){var e,n;if(!0!==t[et]){var o=t[nt];if(o){j(t,et,!0);var r=tt(Object.getOwnPropertySymbols(o),Object.keys(o));try{for(var i=J(r),a=i.next();!a.done;a=i.next()){var s=o[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 at(t,e){return function(){var n,o,r=function(o,r,i,a){if(!0===a)return e(o,r,i,o,n),null;if(!Object.prototype.hasOwnProperty.call(o,nt)){var s=o[nt];j(o,nt,$({},s))}return o[nt][r]={prop:r,propertyCreator:e,descriptor:i,decoratorTarget:o,decoratorArguments:n},function(t,e){var n=e?ot:rt;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return it(this),this[t]},set:function(e){it(this),this[t]=e}})}(r,t)};return(2===(o=arguments).length||3===o.length)&&("string"==typeof o[1]||"symbol"==typeof o[1])||4===o.length&&!0===o[3]?(n=T,r.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),r)}}function st(t,e,n){return Ge(t)?t:Array.isArray(t)?mt.array(t,{name:n}):I(t)?mt.object(t,void 0,{name:n}):H(t)?mt.map(t,{name:n}):F(t)?mt.set(t,{name:n}):t}function lt(t){return t}function ut(t){D(t);var e=at(!0,(function(e,n,o,r,i){var a=o?o.initializer?o.initializer.call(e):o.value:void 0;Nn(e).addObservableProp(n,a,t)})),n=("undefined"!=typeof process&&process.env,e);return n.enhancer=t,n}var ct={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function dt(t){return null==t?ct:"string"==typeof t?{name:t,deep:!0,proxy:!0}:t}Object.freeze(ct);var pt=ut(st),ht=ut((function(t,e,n){return null==t||Rn(t)||_n(t)||Sn(t)||Mn(t)?t:Array.isArray(t)?mt.array(t,{name:n,deep:!1}):I(t)?mt.object(t,void 0,{name:n,deep:!1}):H(t)?mt.map(t,{name:n,deep:!1}):F(t)?mt.set(t,{name:n,deep:!1}):P(!1)})),ft=ut(lt),gt=ut((function(t,e,n){return Hn(t,e)?e:t}));function vt(t){return t.defaultDecorator?t.defaultDecorator.enhancer:!1===t.deep?lt:st}var yt={box:function(t,e){arguments.length>2&&bt("box");var n=dt(e);return new Yt(t,vt(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&bt("array");var n=dt(e);return function(t,e,n,o){void 0===n&&(n="ObservableArray@"+A());void 0===o&&(o=!1);var r=new vn(n,e,o);!function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}(r.values,G,r);var i=new Proxy(r.values,gn);if(r.proxy=i,t&&t.length){var a=Xt(!0);r.spliceWithArray(0,0,t),Gt(a)}return i}(t,vt(n),n.name)},map:function(t,e){arguments.length>2&&bt("map");var n=dt(e);return new wn(t,vt(n),n.name)},set:function(t,e){arguments.length>2&&bt("set");var n=dt(e);return new On(t,vt(n),n.name)},object:function(t,e,n){"string"==typeof arguments[1]&&bt("object");var o=dt(n);if(!1===o.proxy)return De({},t,e,o);var r=ke(o),i=function(t){var e=new Proxy(t,ln);return t[G].proxy=e,e}(De({},void 0,void 0,o));return Re(i,t,e,r),i},ref:ft,shallow:ht,deep:pt,struct:gt},mt=function(t,e,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return pt.apply(null,arguments);if(Ge(t))return t;var o=I(t)?mt.object(t,e,n):Array.isArray(t)?mt.array(t,e):H(t)?mt.map(t,e):F(t)?mt.set(t,e):t;if(o!==t)return o;P(!1)};function bt(t){P("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}Object.keys(yt).forEach((function(t){return mt[t]=yt[t]}));var _t,xt,Et=at(!1,(function(t,e,n,o,r){var i=n.get,a=n.set,s=r[0]||{};Nn(t).addComputedProp(t,e,$({get:i,set:a,context:t},s))})),wt=Et({equals:q.structural}),St=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 o="object"==typeof e?e:{};return o.get=t,o.set="function"==typeof e?e:o.set,o.name=o.name||t.name||"",new Kt(o)};St.struct=wt,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"}(_t||(_t={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(xt||(xt={}));var Ct=function(t){this.cause=t};function Ot(t){return t instanceof Ct}function Mt(t){switch(t.dependenciesState){case _t.UP_TO_DATE:return!1;case _t.NOT_TRACKING:case _t.STALE:return!0;case _t.POSSIBLY_STALE:for(var e=Rt(!0),n=Dt(),o=t.observing,r=o.length,i=0;i<r;i++){var a=o[i];if(qt(a)){if(ne.disableErrorBoundaries)a.get();else try{a.get()}catch(t){return kt(n),Lt(e),!0}if(t.dependenciesState===_t.STALE)return kt(n),Lt(e),!0}}return It(t),kt(n),Lt(e),!1}}function Tt(t){var e=t.observers.size>0;ne.computationDepth>0&&e&&P(!1),ne.allowStateChanges||!e&&"strict"!==ne.enforceActions||P(!1)}function Nt(t,e,n){var o=Rt(!0);It(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++ne.runId;var r,i=ne.trackingDerivation;if(ne.trackingDerivation=t,!0===ne.disableErrorBoundaries)r=e.call(n);else try{r=e.call(n)}catch(t){r=new Ct(t)}return ne.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,o=_t.UP_TO_DATE,r=0,i=t.unboundDepsCount,a=0;a<i;a++){0===(s=n[a]).diffValue&&(s.diffValue=1,r!==a&&(n[r]=s),r++),s.dependenciesState>o&&(o=s.dependenciesState)}n.length=r,t.newObserving=null,i=e.length;for(;i--;){0===(s=e[i]).diffValue&&re(s,t),s.diffValue=0}for(;r--;){var s;1===(s=n[r]).diffValue&&(s.diffValue=0,oe(s,t))}o!==_t.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}(t),Lt(o),r}function At(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)re(e[n],t);t.dependenciesState=_t.NOT_TRACKING}function Pt(t){var e=Dt();try{return t()}finally{kt(e)}}function Dt(){var t=ne.trackingDerivation;return ne.trackingDerivation=null,t}function kt(t){ne.trackingDerivation=t}function Rt(t){var e=ne.allowStateReads;return ne.allowStateReads=t,e}function Lt(t){ne.allowStateReads=t}function It(t){if(t.dependenciesState!==_t.UP_TO_DATE){t.dependenciesState=_t.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=_t.UP_TO_DATE}}var jt=0,Bt=1,Ht=Object.getOwnPropertyDescriptor((function(){}),"name");function Ft(t,e,n){var o=function(){return zt(t,e,n||this,arguments)};return o.isMobxAction=!0,o}function zt(t,e,n,o){var r=Wt();try{return e.apply(n,o)}catch(t){throw r.error=t,t}finally{Ut(r)}}function Wt(t,e,n){var o=Dt();ae();var r={prevDerivation:o,prevAllowStateChanges:Xt(!0),prevAllowStateReads:Rt(!0),notifySpy:false,startTime:0,actionId:Bt++,parentActionId:jt};return jt=r.actionId,r}function Ut(t){jt!==t.actionId&&P("invalid action stack. did you forget to finish an action?"),jt=t.parentActionId,void 0!==t.error&&(ne.suppressReactionErrors=!0),Gt(t.prevAllowStateChanges),Lt(t.prevAllowStateReads),se(),kt(t.prevDerivation),t.notifySpy,ne.suppressReactionErrors=!1}function Xt(t){var e=ne.allowStateChanges;return ne.allowStateChanges=t,e}function Gt(t){ne.allowStateChanges=t}Ht&&Ht.configurable;var Yt=function(t){function e(e,n,o,r,i){void 0===o&&(o="ObservableValue@"+A()),void 0===r&&(r=!0),void 0===i&&(i=q.default);var a=t.call(this,o)||this;return a.enhancer=n,a.name=o,a.equals=i,a.hasUnreportedChange=!1,a.value=n(e,void 0,o),a}return function(t,e){function n(){this.constructor=t}Z(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))!==ne.UNCHANGED){false,this.setNewValue(t)}},e.prototype.prepareNewValue=function(t){if(Tt(this),un(this)){var e=dn(this,{object:this,type:"update",newValue:t});if(!e)return ne.UNCHANGED;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.equals(this.value,t)?ne.UNCHANGED:t},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),pn(this)&&fn(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 cn(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),hn(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return U(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(Y),Vt=B("ObservableValue",Yt),Kt=function(){function t(t){this.dependenciesState=_t.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=_t.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+A(),this.value=new Ct(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=xt.NONE,D(t.get,"missing option for computed: get"),this.derivation=t.get,this.name=t.name||"ComputedValue@"+A(),t.set&&(this.setter=Ft(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?q.structural:q.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==_t.UP_TO_DATE)return;t.lowestObserverState=_t.POSSIBLY_STALE,t.observers.forEach((function(e){e.dependenciesState===_t.UP_TO_DATE&&(e.dependenciesState=_t.POSSIBLY_STALE,e.isTracing!==xt.NONE&&ue(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&&P("Cycle detected in computation "+this.name+": "+this.derivation),0!==ne.inBatch||0!==this.observers.size||this.keepAlive?(le(this),Mt(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===_t.STALE)return;t.lowestObserverState=_t.STALE,t.observers.forEach((function(e){e.dependenciesState===_t.POSSIBLY_STALE?e.dependenciesState=_t.STALE:e.dependenciesState===_t.UP_TO_DATE&&(t.lowestObserverState=_t.UP_TO_DATE)}))}(this)):Mt(this)&&(this.warnAboutUntrackedRead(),ae(),this.value=this.computeValue(!1),se());var t=this.value;if(Ot(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(Ot(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){D(!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 D(!1,!1)},t.prototype.trackAndCompute=function(){var t=this.value,e=this.dependenciesState===_t.NOT_TRACKING,n=this.computeValue(!0),o=e||Ot(t)||Ot(n)||!this.equals(t,n);return o&&(this.value=n),o},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,ne.computationDepth++,t)e=Nt(this,this.derivation,this.scope);else if(!0===ne.disableErrorBoundaries)e=this.derivation.call(this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new Ct(t)}return ne.computationDepth--,this.isComputing=!1,e},t.prototype.suspend=function(){this.keepAlive||(At(this),this.value=void 0)},t.prototype.observe=function(t,e){var n=this,o=!0,r=void 0;return Se((function(){var i=n.get();if(!o||e){var a=Dt();t({type:"update",object:n,newValue:i,oldValue:r}),kt(a)}o=!1,r=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 U(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),qt=B("ComputedValue",Kt),Zt=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],$t=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},Jt={};function Qt(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:Jt}var te=!0,ee=!1,ne=function(){var t=Qt();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(te=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new $t).version&&(te=!1),te?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new $t):(setTimeout((function(){ee||P("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new $t)}();function oe(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function re(t,e){t.observers.delete(e),0===t.observers.size&&ie(t)}function ie(t){!1===t.isPendingUnobservation&&(t.isPendingUnobservation=!0,ne.pendingUnobservations.push(t))}function ae(){ne.inBatch++}function se(){if(0==--ne.inBatch){fe();for(var t=ne.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 Kt&&n.suspend())}ne.pendingUnobservations=[]}}function le(t){var e=ne.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&&ne.inBatch>0&&ie(t),!1)}function ue(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===xt.BREAK){var n=[];ce(Le(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 Kt?t.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function ce(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 ce(t,e,n+1)})))}var de=function(){function t(t,e,n,o){void 0===t&&(t="Reaction@"+A()),void 0===o&&(o=!1),this.name=t,this.onInvalidate=e,this.errorHandler=n,this.requiresObservable=o,this.observing=[],this.newObserving=[],this.dependenciesState=_t.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+A(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=xt.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,ne.pendingReactions.push(this),fe())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(ae(),this._isScheduled=!1,Mt(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(t){this.reportExceptionInDerivation(t)}}se()}},t.prototype.track=function(t){if(!this.isDisposed){ae(),this._isRunning=!0;var e=Nt(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&At(this),Ot(e)&&this.reportExceptionInDerivation(e.cause),se()}},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{if(ne.disableErrorBoundaries)throw t;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";ne.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,t),ne.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(ae(),At(this),se()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t[G]=this,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(t){void 0===t&&(t=!1),nn(this,t)},t}();var pe=100,he=function(t){return t()};function fe(){ne.inBatch>0||ne.isRunningReactions||he(ge)}function ge(){ne.isRunningReactions=!0;for(var t=ne.pendingReactions,e=0;t.length>0;){++e===pe&&(console.error("Reaction doesn't converge to a stable state after "+pe+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),o=0,r=n.length;o<r;o++)n[o].runReaction()}ne.isRunningReactions=!1}var ve=B("Reaction",de);function ye(t){var e=he;he=function(n){return t((function(){return e(n)}))}}function me(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}function be(){P(!1)}function _e(t){return function(e,n,o){if(o){if(o.value)return{value:Ft(t,o.value),enumerable:!1,configurable:!0,writable:!0};var r=o.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Ft(t,r.call(this))}}}return function(t){return function(e,n,o){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(e){j(this,n,xe(t,e))}})}}(t).apply(this,arguments)}}var xe=function(t,e,n,o){return 1===arguments.length&&"function"==typeof t?Ft(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?Ft(t,e):1===arguments.length&&"string"==typeof t?_e(t):!0!==o?_e(e).apply(null,arguments):void j(t,e,Ft(t.name||e,n.value,this))};function Ee(t,e){"string"==typeof t||t.name;return zt(0,"function"==typeof t?t:e,this,void 0)}function we(t,e,n){j(t,e,Ft(e,n.bind(t)))}function Se(t,e){void 0===e&&(e=N);var n,o=e&&e.name||t.name||"Autorun@"+A();if(!e.scheduler&&!e.delay)n=new de(o,(function(){this.track(a)}),e.onError,e.requiresObservable);else{var r=Oe(e),i=!1;n=new de(o,(function(){i||(i=!0,r((function(){i=!1,n.isDisposed||n.track(a)})))}),e.onError,e.requiresObservable)}function a(){t(n)}return n.schedule(),n.getDisposer()}xe.bound=function(t,e,n,o){return!0===o?(we(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return we(this,e,n.value||n.initializer.call(this)),this[e]},set:be}:{enumerable:!1,configurable:!0,set:function(t){we(this,e,t)},get:function(){}}};var Ce=function(t){return t()};function Oe(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:Ce}function Me(t,e,n){void 0===n&&(n=N);var o,r,i,a=n.name||"Reaction@"+A(),s=xe(a,n.onError?(o=n.onError,r=e,function(){try{return r.apply(this,arguments)}catch(t){o.call(this,t)}}):e),l=!n.scheduler&&!n.delay,u=Oe(n),c=!0,d=!1,p=n.compareStructural?q.structural:n.equals||q.default,h=new de(a,(function(){c||l?f():d||(d=!0,u(f))}),n.onError,n.requiresObservable);function f(){if(d=!1,!h.isDisposed){var e=!1;h.track((function(){var n=t(h);e=c||!p(i,n),i=n})),c&&n.fireImmediately&&s(i,h),c||!0!==e||s(i,h),c&&(c=!1)}}return h.schedule(),h.getDisposer()}function Te(t,e,n){return Ae("onBecomeObserved",t,e,n)}function Ne(t,e,n){return Ae("onBecomeUnobserved",t,e,n)}function Ae(t,e,n,o){var r="function"==typeof o?Ln(e,n):Ln(e),i="function"==typeof o?o:n,a=t+"Listeners";return r[a]?r[a].add(i):r[a]=new Set([i]),"function"!=typeof r[t]?P(!1):function(){var t=r[a];t&&(t.delete(i),0===t.size&&delete r[a])}}function Pe(t){var e=t.enforceActions,n=t.computedRequiresReaction,o=t.computedConfigurable,r=t.disableErrorBoundaries,i=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(!0===t.isolateGlobalState&&((ne.pendingReactions.length||ne.inBatch||ne.isRunningReactions)&&P("isolateGlobalState should be called before MobX is running any reactions"),ee=!0,te&&(0==--Qt().__mobxInstanceCount&&(Qt().__mobxGlobals=void 0),ne=new $t)),void 0!==e){var l=void 0;switch(e){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:P("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}ne.enforceActions=l,ne.allowStateChanges=!0!==l&&"strict"!==l}void 0!==n&&(ne.computedRequiresReaction=!!n),void 0!==a&&(ne.reactionRequiresObservable=!!a),void 0!==s&&(ne.observableRequiresReaction=!!s,ne.allowStateReads=!ne.observableRequiresReaction),void 0!==o&&(ne.computedConfigurable=!!o),void 0!==r&&(!0===r&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),ne.disableErrorBoundaries=!!r),i&&ye(i)}function De(t,e,n,o){var r=ke(o=dt(o));return it(t),Nn(t,o.name,r.enhancer),e&&Re(t,e,n,r),t}function ke(t){return t.defaultDecorator||(!1===t.deep?ft:pt)}function Re(t,e,n,o){var r,i;ae();try{var a=X(e);try{for(var s=J(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=Object.getOwnPropertyDescriptor(e,u);0;var d=n&&u in n?n[u]:c.get?Et:o;0;var p=d(t,u,c,!0);p&&Object.defineProperty(t,u,p)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}}finally{se()}}function Le(t,e){return Ie(Ln(t,e))}function Ie(t){var e,n,o={name:t.name};return t.observing&&t.observing.length>0&&(o.dependencies=(e=t.observing,n=[],e.forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n).map(Ie)),o}function je(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(je)),e}var Be=0;function He(){this.message="FLOW_CANCELLED"}function Fe(t){"function"==typeof t.cancel&&t.cancel()}function ze(t,e){if(null==t)return!1;if(void 0!==e){if(!1===Rn(t))return!1;if(!t[G].values.has(e))return!1;var n=Ln(t,e);return qt(n)}return qt(t)}function We(t){return arguments.length>1?P(!1):ze(t)}function Ue(t,e){return"string"!=typeof e?P(!1):ze(t,e)}function Xe(t,e){return null!=t&&(void 0!==e?!!Rn(t)&&t[G].values.has(e):Rn(t)||!!t[G]||V(t)||ve(t)||qt(t))}function Ge(t){return 1!==arguments.length&&P(!1),Xe(t)}function Ye(t){return Rn(t)?t[G].getKeys():Sn(t)||Mn(t)?Array.from(t.keys()):_n(t)?t.map((function(t,e){return e})):P(!1)}function Ve(t){return Rn(t)?Ye(t).map((function(e){return t[e]})):Sn(t)?Ye(t).map((function(e){return t.get(e)})):Mn(t)?Array.from(t.values()):_n(t)?t.slice():P(!1)}function Ke(t){return Rn(t)?Ye(t).map((function(e){return[e,t[e]]})):Sn(t)?Ye(t).map((function(e){return[e,t.get(e)]})):Mn(t)?Array.from(t.entries()):_n(t)?t.map((function(t,e){return[e,t]})):P(!1)}function qe(t,e,n){if(2!==arguments.length||Mn(t))if(Rn(t)){var o=t[G];o.values.get(e)?o.write(e,n):o.addObservableProp(e,n,o.defaultEnhancer)}else if(Sn(t))t.set(e,n);else if(Mn(t))t.add(e);else{if(!_n(t))return P(!1);"number"!=typeof e&&(e=parseInt(e,10)),D(e>=0,"Not a valid index: '"+e+"'"),ae(),e>=t.length&&(t.length=e+1),t[e]=n,se()}else{ae();var r=e;try{for(var i in r)qe(t,i,r[i])}finally{se()}}}function Ze(t,e){return Rn(t)?In(t).has(e):Sn(t)||Mn(t)?t.has(e):_n(t)?e>=0&&e<t.length:P(!1)}function $e(t,e,n,o){return"function"==typeof n?function(t,e,n,o){return In(t,e).observe(n,o)}(t,e,n,o):function(t,e,n){return In(t).observe(e,n)}(t,e,n)}He.prototype=Object.create(Error.prototype);var Je={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Qe(t,e,n,o){return o.detectCycles&&t.set(e,n),n}function tn(t,e,n){if(!e.recurseEverything&&!Ge(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(Vt(t))return tn(t.get(),e,n);if(Ge(t)&&Ye(t),!0===e.detectCycles&&null!==t&&n.has(t))return n.get(t);if(_n(t)||Array.isArray(t)){var o=Qe(n,t,[],e),r=t.map((function(t){return tn(t,e,n)}));o.length=r.length;for(var i=0,a=r.length;i<a;i++)o[i]=r[i];return o}if(Mn(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===e.exportMapsAsObjects){var s=Qe(n,t,new Set,e);return t.forEach((function(t){s.add(tn(t,e,n))})),s}var l=Qe(n,t,[],e);return t.forEach((function(t){l.push(tn(t,e,n))})),l}if(Sn(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===e.exportMapsAsObjects){var u=Qe(n,t,new Map,e);return t.forEach((function(t,o){u.set(o,tn(t,e,n))})),u}var c=Qe(n,t,{},e);return t.forEach((function(t,o){c[o]=tn(t,e,n)})),c}var d=Qe(n,t,{},e);return z(t).forEach((function(o){d[o]=tn(t[o],e,n)})),d}function en(t,e){var n;return"boolean"==typeof e&&(e={detectCycles:e}),e||(e=Je),e.detectCycles=void 0===e.detectCycles?!0===e.recurseEverything:!0===e.detectCycles,e.detectCycles&&(n=new Map),tn(t,e,n)}function nn(){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 o=function(t){switch(t.length){case 0:return ne.trackingDerivation;case 1:return Ln(t[0]);case 2:return Ln(t[0],t[1])}}(t);if(!o)return P(!1);o.isTracing===xt.NONE&&console.log("[mobx.trace] '"+o.name+"' tracing enabled"),o.isTracing=n?xt.BREAK:xt.LOG}function on(t,e){void 0===e&&(e=void 0),ae();try{return t.apply(e)}finally{se()}}function rn(t,e,n){var o;"number"==typeof n.timeout&&(o=setTimeout((function(){if(!i[G].isDisposed){i();var t=new Error("WHEN_TIMEOUT");if(!n.onError)throw t;n.onError(t)}}),n.timeout)),n.name=n.name||"When@"+A();var r=Ft(n.name+"-effect",e),i=Se((function(e){t()&&(e.dispose(),o&&clearTimeout(o),r())}),n);return i}function an(t){return t[G]}function sn(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t}var ln={has:function(t,e){if(e===G||"constructor"===e||e===et)return!0;var n=an(t);return sn(e)?n.has(e):e in t},get:function(t,e){if(e===G||"constructor"===e||e===et)return t[e];var n=an(t),o=n.values.get(e);if(o instanceof Y){var r=o.get();return void 0===r&&n.has(e),r}return sn(e)&&n.has(e),t[e]},set:function(t,e,n){return!!sn(e)&&(qe(t,e,n),!0)},deleteProperty:function(t,e){return!!sn(e)&&(an(t).remove(e),!0)},ownKeys:function(t){return an(t).keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return P("Dynamic observable objects cannot be frozen"),!1}};function un(t){return void 0!==t.interceptors&&t.interceptors.length>0}function cn(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),k((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function dn(t,e){var n=Dt();try{for(var o=tt(t.interceptors||[]),r=0,i=o.length;r<i&&(D(!(e=o[r](e))||e.type,"Intercept handlers should return nothing or a change object"),e);r++);return e}finally{kt(n)}}function pn(t){return void 0!==t.changeListeners&&t.changeListeners.length>0}function hn(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),k((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function fn(t,e){var n=Dt(),o=t.changeListeners;if(o){for(var r=0,i=(o=o.slice()).length;r<i;r++)o[r](e);kt(n)}}var gn={get:function(t,e){return e===G?t[G]:"length"===e?t[G].getArrayLength():"number"==typeof e?yn.get.call(t,e):"string"!=typeof e||isNaN(e)?yn.hasOwnProperty(e)?yn[e]:t[e]:yn.get.call(t,parseInt(e))},set:function(t,e,n){return"length"===e&&t[G].setArrayLength(n),"number"==typeof e&&yn.set.call(t,e,n),"symbol"==typeof e||isNaN(e)?t[e]=n:yn.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return P("Observable arrays cannot be frozen"),!1}};var vn=function(){function t(t,e,n){this.owned=n,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new Y(t||"ObservableArray@"+A()),this.enhancer=function(n,o){return e(n,o,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 cn(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}),hn(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),o=0;o<t-e;o++)n[o]=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 o=this;Tt(this.atom);var r=this.values.length;if(void 0===t?t=0:t>r?t=r:t<0&&(t=Math.max(0,r+t)),e=1===arguments.length?r-t:null==e?0:Math.max(0,Math.min(e,r-t)),void 0===n&&(n=T),un(this)){var i=dn(this,{object:this.proxy,type:"splice",index:t,removedCount:e,added:n});if(!i)return T;e=i.removedCount,n=i.added}n=0===n.length?n:n.map((function(t){return o.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 o;if(n.length<1e4)return(o=this.values).splice.apply(o,tt([t,e],n));var r=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),r},t.prototype.notifyArrayChildUpdate=function(t,e,n){var o=!this.owned&&!1,r=pn(this),i=r||o?{object:this.proxy,type:"update",index:t,newValue:e,oldValue:n}:null;this.atom.reportChanged(),r&&fn(this,i)},t.prototype.notifyArraySplice=function(t,e,n){var o=!this.owned&&!1,r=pn(this),i=r||o?{object:this.proxy,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;this.atom.reportChanged(),r&&fn(this,i)},t}(),yn={intercept:function(t){return this[G].intercept(t)},observe:function(t,e){return void 0===e&&(e=!1),this[G].observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[G];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=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=this[G];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray(t);case 2:return r.spliceWithArray(t,e)}return r.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){return this[G].spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[G];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[G].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[G];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[G],n=e.dehanceValues(e.values).indexOf(t);return n>-1&&(this.splice(n,1),!0)},get:function(t){var e=this[G];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[G],o=n.values;if(t<o.length){Tt(n.atom);var r=o[t];if(un(n)){var i=dn(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!i)return;e=i.newValue}(e=n.enhancer(e,r))!==r&&(o[t]=e,n.notifyArrayChildUpdate(t,e,r))}else{if(t!==o.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+o.length);n.spliceWithArray(t,0,[e])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(t){"function"==typeof Array.prototype[t]&&(yn[t]=function(){var e=this[G];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]&&(yn[t]=function(e,n){var o=this,r=this[G];return r.atom.reportObserved(),r.dehanceValues(r.values)[t]((function(t,r){return e.call(n,t,r,o)}),n)})})),["reduce","reduceRight"].forEach((function(t){yn[t]=function(){var e=this,n=this[G];n.atom.reportObserved();var o=arguments[0];return arguments[0]=function(t,r,i){return r=n.dehanceValue(r),o(t,r,i,e)},n.values[t].apply(n.values,arguments)}}));var mn,bn=B("ObservableArrayAdministration",vn);function _n(t){return L(t)&&bn(t[G])}var xn,En={},wn=function(){function t(t,e,n){if(void 0===e&&(e=st),void 0===n&&(n="ObservableMap@"+A()),this.enhancer=e,this.name=n,this[mn]=En,this._keysAtom=K(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(!ne.trackingDerivation)return this._has(t);var n=this._hasMap.get(t);if(!n){var o=n=new Yt(this._has(t),lt,this.name+"."+W(t)+"?",!1);this._hasMap.set(t,o),Ne(o,(function(){return e._hasMap.delete(t)}))}return n.get()},t.prototype.set=function(t,e){var n=this._has(t);if(un(this)){var o=dn(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!o)return this;e=o.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if((Tt(this._keysAtom),un(this))&&!(o=dn(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=pn(this),o=n?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return on((function(){e._keysAtom.reportChanged(),e._updateHasMapEntry(t,!1),e._data.get(t).setNewValue(void 0),e._data.delete(t)})),n&&fn(this,o),!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))!==ne.UNCHANGED){var o=!1,r=pn(this),i=r?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;o,n.setNewValue(e),r&&fn(this,i)}},t.prototype._addValue=function(t,e){var n=this;Tt(this._keysAtom),on((function(){var o=new Yt(e,n.enhancer,n.name+"."+W(t),!1);n._data.set(t,o),e=o.value,n._updateHasMapEntry(t,!0),n._keysAtom.reportChanged()}));var o=pn(this);o&&fn(this,o?{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 Un({next:function(){var n=e.next(),o=n.done,r=n.value;return{done:o,value:o?void 0:t.get(r)}}})},t.prototype.entries=function(){var t=this,e=this.keys();return Un({next:function(){var n=e.next(),o=n.done,r=n.value;return{done:o,value:o?void 0:[r,t.get(r)]}}})},t.prototype[(mn=G,Symbol.iterator)]=function(){return this.entries()},t.prototype.forEach=function(t,e){var n,o;try{for(var r=J(this),i=r.next();!i.done;i=r.next()){var a=Q(i.value,2),s=a[0],l=a[1];t.call(e,l,s,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}},t.prototype.merge=function(t){var e=this;return Sn(t)&&(t=t.toJS()),on((function(){var n=Xt(!0);try{I(t)?z(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=Q(t,2),o=n[0],r=n[1];return e.set(o,r)})):H(t)?(t.constructor!==Map&&P("Cannot initialize from classes that inherit from Map: "+t.constructor.name),t.forEach((function(t,n){return e.set(n,t)}))):null!=t&&P("Cannot initialize map from "+t)}finally{Gt(n)}})),this},t.prototype.clear=function(){var t=this;on((function(){Pt((function(){var e,n;try{for(var o=J(t.keys()),r=o.next();!r.done;r=o.next()){var i=r.value;t.delete(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}))},t.prototype.replace=function(t){var e=this;return on((function(){var n,o,r,i,a=function(t){if(H(t)||Sn(t))return t;if(Array.isArray(t))return new Map(t);if(I(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}return P("Cannot convert to map from '"+t+"'")}(t),s=new Map,l=!1;try{for(var u=J(e._data.keys()),c=u.next();!c.done;c=u.next()){var d=c.value;if(!a.has(d))if(e.delete(d))l=!0;else{var p=e._data.get(d);s.set(d,p)}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}try{for(var h=J(a.entries()),f=h.next();!f.done;f=h.next()){var g=Q(f.value,2),v=(d=g[0],p=g[1],e._data.has(d));if(e.set(d,p),e._data.has(d)){var y=e._data.get(d);s.set(d,y),v||(l=!0)}}}catch(t){r={error:t}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}if(!l)if(e._data.size!==s.size)e._keysAtom.reportChanged();else for(var m=e._data.keys(),b=s.keys(),_=m.next(),x=b.next();!_.done;){if(_.value!==x.value){e._keysAtom.reportChanged();break}_=m.next(),x=b.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 o=J(this),r=o.next();!r.done;r=o.next()){var i=Q(r.value,2),a=i[0],s=i[1];n["symbol"==typeof a?a:W(a)]=s}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}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 W(e)+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return hn(this,t)},t.prototype.intercept=function(t){return cn(this,t)},t}(),Sn=B("ObservableMap",wn),Cn={},On=function(){function t(t,e,n){if(void 0===e&&(e=st),void 0===n&&(n="ObservableSet@"+A()),this.name=n,this[xn]=Cn,this._data=new Set,this._atom=K(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,o){return e(t,o,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;on((function(){Pt((function(){var e,n;try{for(var o=J(t._data.values()),r=o.next();!r.done;r=o.next()){var i=r.value;t.delete(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}))},t.prototype.forEach=function(t,e){var n,o;try{for(var r=J(this),i=r.next();!i.done;i=r.next()){var a=i.value;t.call(e,a,a,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}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((Tt(this._atom),un(this))&&!(o=dn(this,{type:"add",object:this,newValue:t})))return this;if(!this.has(t)){on((function(){e._data.add(e.enhancer(t,void 0)),e._atom.reportChanged()}));var n=pn(this),o=n?{type:"add",object:this,newValue:t}:null;n&&fn(this,o)}return this},t.prototype.delete=function(t){var e=this;if(un(this)&&!(o=dn(this,{type:"delete",object:this,oldValue:t})))return!1;if(this.has(t)){var n=pn(this),o=n?{type:"delete",object:this,oldValue:t}:null;return on((function(){e._atom.reportChanged(),e._data.delete(t)})),n&&fn(this,o),!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 Un({next:function(){var o=t;return t+=1,o<n.length?{value:[e[o],n[o]],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 Un({next:function(){return e<n.length?{value:t.dehanceValue(n[e++]),done:!1}:{done:!0}}})},t.prototype.replace=function(t){var e=this;return Mn(t)&&(t=t.toJS()),on((function(){var n=Xt(!0);try{Array.isArray(t)||F(t)?(e.clear(),t.forEach((function(t){return e.add(t)}))):null!=t&&P("Cannot initialize set from "+t)}finally{Gt(n)}})),this},t.prototype.observe=function(t,e){return hn(this,t)},t.prototype.intercept=function(t){return cn(this,t)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[(xn=G,Symbol.iterator)]=function(){return this.values()},t}(),Mn=B("ObservableSet",On),Tn=function(){function t(t,e,n,o){void 0===e&&(e=new Map),this.target=t,this.values=e,this.name=n,this.defaultEnhancer=o,this.keysAtom=new Y(n+".keys")}return t.prototype.read=function(t){return this.values.get(t).get()},t.prototype.write=function(t,e){var n=this.target,o=this.values.get(t);if(o instanceof Kt)o.set(e);else{if(un(this)){if(!(a=dn(this,{type:"update",object:this.proxy||n,name:t,newValue:e})))return;e=a.newValue}if((e=o.prepareNewValue(e))!==ne.UNCHANGED){var r=pn(this),i=!1,a=r?{type:"update",object:this.proxy||n,oldValue:o.value,name:t,newValue:e}:null;i,o.setNewValue(e),r&&fn(this,a)}}},t.prototype.has=function(t){var e=this.pendingKeys||(this.pendingKeys=new Map),n=e.get(t);if(n)return n.get();var o=!!this.values.get(t);return n=new Yt(o,lt,this.name+"."+W(t)+"?",!1),e.set(t,n),n.get()},t.prototype.addObservableProp=function(t,e,n){void 0===n&&(n=this.defaultEnhancer);var o=this.target;if(un(this)){var r=dn(this,{object:this.proxy||o,name:t,type:"add",newValue:e});if(!r)return;e=r.newValue}var i=new Yt(e,n,this.name+"."+W(t),!1);this.values.set(t,i),e=i.value,Object.defineProperty(o,t,function(t){return An[t]||(An[t]={configurable:!0,enumerable:!0,get:function(){return this[G].read(t)},set:function(e){this[G].write(t,e)}})}(t)),this.notifyPropertyAddition(t,e)},t.prototype.addComputedProp=function(t,e,n){var o=this.target;n.name=n.name||this.name+"."+W(e),this.values.set(e,new Kt(n)),(t===o||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 Pn[t]||(Pn[t]={configurable:ne.computedConfigurable,enumerable:!1,get:function(){return Dn(this).read(t)},set:function(e){Dn(this).write(t,e)}})}(e))},t.prototype.remove=function(t){if(this.values.has(t)){var e=this.target;if(un(this))if(!(s=dn(this,{object:this.proxy||e,name:t,type:"remove"})))return;try{ae();var n=pn(this),o=!1,r=this.values.get(t),i=r&&r.get();if(r&&r.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;o,n&&fn(this,s)}finally{se()}}},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 hn(this,t)},t.prototype.intercept=function(t){return cn(this,t)},t.prototype.notifyPropertyAddition=function(t,e){var n=pn(this),o=n?{type:"add",object:this.proxy||this.target,name:t,newValue:e}:null;if(n&&fn(this,o),this.pendingKeys){var r=this.pendingKeys.get(t);r&&r.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var t,e;this.keysAtom.reportObserved();var n=[];try{for(var o=J(this.values),r=o.next();!r.done;r=o.next()){var i=Q(r.value,2),a=i[0];i[1]instanceof Yt&&n.push(a)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},t}();function Nn(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n=st),Object.prototype.hasOwnProperty.call(t,G))return t[G];I(t)||(e=(t.constructor.name||"ObservableObject")+"@"+A()),e||(e="ObservableObject@"+A());var o=new Tn(t,new Map,W(e),n);return j(t,G,o),o}var An=Object.create(null),Pn=Object.create(null);function Dn(t){var e=t[G];return e||(it(t),t[G])}var kn=B("ObservableObjectAdministration",Tn);function Rn(t){return!!L(t)&&(it(t),kn(t[G]))}function Ln(t,e){if("object"==typeof t&&null!==t){if(_n(t))return void 0!==e&&P(!1),t[G].atom;if(Mn(t))return t[G];if(Sn(t)){var n=t;return void 0===e?n._keysAtom:((o=n._data.get(e)||n._hasMap.get(e))||P(!1),o)}var o;if(it(t),e&&!t[G]&&t[e],Rn(t))return e?((o=t[G].values.get(e))||P(!1),o):P(!1);if(V(t)||qt(t)||ve(t))return t}else if("function"==typeof t&&ve(t[G]))return t[G];return P(!1)}function In(t,e){return t||P("Expecting some object"),void 0!==e?In(Ln(t,e)):V(t)||qt(t)||ve(t)||Sn(t)||Mn(t)?t:(it(t),t[G]?t[G]:void P(!1))}function jn(t,e){return(void 0!==e?Ln(t,e):Rn(t)||Sn(t)||Mn(t)?In(t):Ln(t)).name}var Bn=Object.prototype.toString;function Hn(t,e,n){return void 0===n&&(n=-1),Fn(t,e,n)}function Fn(t,e,n,o,r){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=Bn.call(t);if(a!==Bn.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=zn(t),e=zn(e);var s="[object Array]"===a;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;var l=t.constructor,u=e.constructor;if(l!==u&&!("function"==typeof l&&l instanceof l&&"function"==typeof u&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}if(0===n)return!1;n<0&&(n=-1),r=r||[];for(var c=(o=o||[]).length;c--;)if(o[c]===t)return r[c]===e;if(o.push(t),r.push(e),s){if((c=t.length)!==e.length)return!1;for(;c--;)if(!Fn(t[c],e[c],n-1,o,r))return!1}else{var d=Object.keys(t),p=void 0;if(c=d.length,Object.keys(e).length!==c)return!1;for(;c--;)if(!Wn(e,p=d[c])||!Fn(t[p],e[p],n-1,o,r))return!1}return o.pop(),r.pop(),!0}function zn(t){return _n(t)?t.slice():H(t)||Sn(t)||F(t)||Mn(t)?Array.from(t.entries()):t}function Wn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Un(t){return t[Symbol.iterator]=Xn,t}function Xn(){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:me,extras:{getDebugName:jn},$mobx:G});var Gn=Object.freeze({__proto__:null,$mobx:G,FlowCancellationError:He,get IDerivationState(){return _t},ObservableMap:wn,ObservableSet:On,Reaction:de,_allowStateChanges:function(t,e){var n,o=Xt(t);try{n=e()}finally{Gt(o)}return n},_allowStateChangesInsideComputed:function(t){var e,n=ne.computationDepth;ne.computationDepth=0;try{e=t()}finally{ne.computationDepth=n}return e},_allowStateReadsEnd:Lt,_allowStateReadsStart:Rt,_endAction:Ut,_getAdministration:In,_getGlobalState:function(){return ne},_interceptReads:function(t,e,n){var o;if(Sn(t)||_n(t)||Vt(t))o=In(t);else{if(!Rn(t))return P(!1);if("string"!=typeof e)return P(!1);o=In(t,e)}return void 0!==o.dehancer?P(!1):(o.dehancer="function"==typeof e?e:n,function(){o.dehancer=void 0})},_isComputingDerivation:function(){return null!==ne.trackingDerivation},_resetGlobalState:function(){var t=new $t;for(var e in t)-1===Zt.indexOf(e)&&(ne[e]=t[e]);ne.allowStateChanges=!ne.enforceActions},_startAction:Wt,action:xe,autorun:Se,comparer:q,computed:St,configure:Pe,createAtom:K,decorate:function(t,e){var n="function"==typeof t?t.prototype:t,o=function(t){var o=e[t];Array.isArray(o)||(o=[o]);var r=Object.getOwnPropertyDescriptor(n,t),i=o.reduce((function(e,o){return o(n,t,e)}),r);i&&Object.defineProperty(n,t,i)};for(var r in e)o(r);return t},entries:Ke,extendObservable:De,flow:function(t){1!==arguments.length&&P("Flow expects 1 argument and cannot be used as decorator");var e=t.name||"<unnamed flow>";return function(){var n,o=arguments,r=++Be,i=xe(e+" - runid: "+r+" - init",t).apply(this,o),a=void 0,s=new Promise((function(t,o){var s=0;function l(t){var n;a=void 0;try{n=xe(e+" - runid: "+r+" - yield "+s++,i.next).call(i,t)}catch(t){return o(t)}c(n)}function u(t){var n;a=void 0;try{n=xe(e+" - runid: "+r+" - yield "+s++,i.throw).call(i,t)}catch(t){return o(t)}c(n)}function c(e){if(!e||"function"!=typeof e.then)return e.done?t(e.value):(a=Promise.resolve(e.value)).then(l,u);e.then(c,o)}n=o,l(void 0)}));return s.cancel=xe(e+" - runid: "+r+" - cancel",(function(){try{a&&Fe(a);var t=i.return(void 0),e=Promise.resolve(t.value);e.then(R,R),Fe(e),n(new He)}catch(t){n(t)}})),s}},get:function(t,e){if(Ze(t,e))return Rn(t)?t[e]:Sn(t)?t.get(e):_n(t)?t[e]:P(!1)},getAtom:Ln,getDebugName:jn,getDependencyTree:Le,getObserverTree:function(t,e){return je(Ln(t,e))},has:Ze,intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return In(t,e).intercept(n)}(t,e,n):function(t,e){return In(t).intercept(e)}(t,e)},isAction:function(t){return"function"==typeof t&&!0===t.isMobxAction},isArrayLike:function(t){return Array.isArray(t)||_n(t)},isBoxedObservable:Vt,isComputed:We,isComputedProp:Ue,isFlowCancellationError:function(t){return t instanceof He},isObservable:Ge,isObservableArray:_n,isObservableMap:Sn,isObservableObject:Rn,isObservableProp:function(t,e){return"string"!=typeof e?P(!1):Xe(t,e)},isObservableSet:Mn,keys:Ye,observable:mt,observe:$e,onBecomeObserved:Te,onBecomeUnobserved:Ne,onReactionError:function(t){return ne.globalReactionErrorHandlers.push(t),function(){var e=ne.globalReactionErrorHandlers.indexOf(t);e>=0&&ne.globalReactionErrorHandlers.splice(e,1)}},reaction:Me,remove:function(t,e){if(Rn(t))t[G].remove(e);else if(Sn(t))t.delete(e);else if(Mn(t))t.delete(e);else{if(!_n(t))return P(!1);"number"!=typeof e&&(e=parseInt(e,10)),D(e>=0,"Not a valid index: '"+e+"'"),t.splice(e,1)}},runInAction:Ee,set:qe,spy:me,toJS:en,trace:nn,transaction:on,untracked:Pt,values:Ve,when:function(t,e,n){return 1===arguments.length||e&&"object"==typeof e?function(t,e){var n,o=new Promise((function(o,r){var i=rn(t,o,$($({},e),{onError:r}));n=function(){i(),r("WHEN_CANCELLED")}}));return o.cancel=n,o}(t,e):rn(t,e,n||{})}}),Yn=w(Gn);!function(t,e){!function(t,e,n){function o(t){return!(t.prototype&&t.prototype.render||e.Component.isPrototypeOf(t))}function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.prefix,o=void 0===n?"":n,r=e.suffix,i=void 0===r?"":r;return o+(t.displayName||t.name||t.constructor&&t.constructor.name||"<component>")+i}var i="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},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),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)},u=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},c=!1,d=console;function p(t){c=t}function h(t){var e=n._getGlobalState().allowStateChanges;return n._getGlobalState().allowStateChanges=t,e}function f(t){n._getGlobalState().allowStateChanges=t}function g(t,e,n,o,r){var i=h(t),a=void 0;try{a=e(n,o,r)}finally{f(i)}return a}function v(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=t[e],r=m[e],i=o?!0===n?function(){r.apply(this,arguments),o.apply(this,arguments)}:function(){o.apply(this,arguments),r.apply(this,arguments)}:r;t[e]=i}function y(t,e){if(null==t||null==e||"object"!==(void 0===t?"undefined":i(t))||"object"!==(void 0===e?"undefined":i(e)))return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var o=void 0,r=n.length-1;o=n[r];r--)if(e[o]!==t[o])return!0;return!1}var m={componentWillMount:function(){var t=this;if(!0!==c){var o=r(this),i=!1,a=!1;h.call(this,"props"),h.call(this,"state");var s=this.render.bind(this),l=null,u=!1,d=function(){return(l=new n.Reaction(o+".render()",(function(){if(!u&&(u=!0,"function"==typeof t.componentWillReact&&t.componentWillReact(),!0!==t.__$mobxIsUnmounted)){var n=!0;try{a=!0,i||e.Component.prototype.forceUpdate.call(t),n=!1}finally{a=!1,n&&l.dispose()}}}))).reactComponent=t,p.$mobx=l,t.render=p,p(t.props,t.state,t.context)},p=function(t,e,n){u=!1;var o=void 0,r=void 0;if(l.track((function(){try{r=g(!1,s,t,e,n)}catch(t){o=t}})),o)throw o;return r};this.render=d}function h(t){var e=this[t],o=n.createAtom("reactive "+t);Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:function(){return o.reportObserved(),e},set:function(t){!a&&y(e,t)?(e=t,i=!0,o.reportChanged(),i=!1):e=t}})}},componentWillUnmount:function(){!0!==c&&(this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0)},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(t,e){return c&&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||y(this.props,t)}};function b(t){var n,i;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((i=n=function(e){function n(){return a(this,n),u(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return l(n,e),s(n,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),n}(e.Component),n.displayName=r(t),i));if(!t)throw new Error("Please pass a valid component to 'observer'");return _(t.prototype||t),t.isMobXReactObserver=!0,t}function _(t){v(t,"componentWillMount",!0),v(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,o=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,i=Object.getOwnPropertyDescriptor,a=Object.getPrototypeOf,s=a&&a(Object);return function l(u,c,d){if("string"!=typeof c){if(s){var p=a(c);p&&p!==s&&l(u,p,d)}var h=o(c);r&&(h=h.concat(r(c)));for(var f=0;f<h.length;++f){var g=h[f];if(!(t[g]||e[g]||d&&d[g])){var v=i(c,g);try{n(u,g,v)}catch(t){}}}return u}return u}}))})),C={isMobxInjector:{value:!0,writable:!0,configurable:!0,enumerable:!0}};function O(t,n,o){var i,c,d=r(n,{prefix:"inject-",suffix:o?"-with-"+o:""}),p=(c=i=function(o){function r(){return a(this,r),u(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return l(r,o),s(r,[{key:"render",value:function(){var o={};for(var r in this.props)this.props.hasOwnProperty(r)&&(o[r]=this.props[r]);var i=t(this.context.mobxStores||{},o,this.context)||{};for(var a in i)o[a]=i[a];return e.h(n,o)}}]),r}(e.Component),i.displayName=d,c);return S(p,n),p.wrappedComponent=n,Object.defineProperties(p,C),p}function M(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 T(){var t=void 0;if("function"==typeof arguments[0])return t=arguments[0],function(e){var n=O(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=M(e),function(n){return O(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?T.apply(null,t)(N(e)):function(e){return N(t,e)}:b(t)}var A={children:!0,key:!0,ref:!0},P=console,D=function(t){function n(){return a(this,n),u(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return l(n,t),s(n,[{key:"render",value:function(t){var n=t.children;return n.length>1?e.h("div",null," ",n," "):n[0]}},{key:"getChildContext",value:function(){var t={},e=this.context.mobxStores;if(e)for(var n in e)t[n]=e[n];for(var o in this.props)A[o]||"suppressChangedStoreWarning"===o||(t[o]=this.props[o]);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)A[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")}}]),n}(e.Component);if(!e.Component)throw new Error("mobx-preact requires Preact to be available");t.observer=b,t.Observer=x,t.useStaticRendering=p,t.connect=N,t.inject=T,t.Provider=D,Object.defineProperty(t,"__esModule",{value:!0})}(e,function(){if(S)return O;S=1;var t,e,n,o,r,i,a,s,l,u,c,d,p={},h=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function v(t,e){for(var n in e)t[n]=e[n];return t}function y(t){var e=t.parentNode;e&&e.removeChild(t)}function m(e,n,o){var r,i,a,s={};for(a in n)"key"==a?r=n[a]:"ref"==a?i=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?t.call(arguments,2):o),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return b(e,s,r,i,null)}function b(t,o,r,i,a){var s={type:t,props:o,key:r,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 _(t){return t.children}function x(t,e){this.props=t,this.context=e}function E(t,e){if(null==e)return t.__?E(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?E(t):null}function w(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 w(t)}}function C(t){(!t.__d&&(t.__d=!0)&&r.push(t)&&!M.__r++||i!==e.debounceRendering)&&((i=e.debounceRendering)||a)(M)}function M(){var t,n,o,i,a,l,u,c;for(r.sort(s);t=r.shift();)t.__d&&(n=r.length,i=void 0,l=(a=(o=t).__v).__e,u=[],c=[],o.__P&&((i=v({},a)).__v=a.__v+1,e.vnode&&e.vnode(i),L(o.__P,i,a,o.__n,o.__P.namespaceURI,32&a.__u?[l]:null,u,null==l?E(a):l,!!(32&a.__u),c),i.__v=a.__v,i.__.__k[i.__i]=i,I(u,i,c),i.__e!=l&&w(i)),r.length>n&&r.sort(s));M.__r=0}function T(t,e,n,o,r,i,a,s,l,u,c){var d,f,g,v,y,m=o&&o.__k||h,b=e.length;for(n.__d=l,N(n,e,m),l=n.__d,d=0;d<b;d++)null!=(g=n.__k[d])&&"boolean"!=typeof g&&"function"!=typeof g&&(f=-1===g.__i?p:m[g.__i]||p,g.__i=d,L(t,g,f,r,i,a,s,l,u,c),v=g.__e,g.ref&&f.ref!=g.ref&&(f.ref&&B(f.ref,null,g),c.push(g.ref,g.__c||v,g)),null==y&&null!=v&&(y=v),65536&g.__u||f.__k===g.__k?l=A(g,l,t):"function"==typeof g.type&&void 0!==g.__d?l=g.__d:v&&(l=v.nextSibling),g.__d=void 0,g.__u&=-196609);n.__d=l,n.__e=y}function N(t,e,n){var o,r,i,a,s,l=e.length,u=n.length,c=u,d=0;for(t.__k=[],o=0;o<l;o++)a=o+d,null!=(r=t.__k[o]=null==(r=e[o])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?b(null,r,null,null,null):g(r)?b(_,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?b(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=t,r.__b=t.__b+1,s=P(r,n,a,c),r.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof r.type&&(r.__u|=65536)):s!==a&&(s==a-1?d=s-a:s==a+1?d++:s>a?c>l-a?d+=s-a:d--:s<a&&d++,s!==o+d&&(r.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==t.__d&&(t.__d=E(i)),H(i,i,!1),n[a]=null,c--);if(c)for(o=0;o<u;o++)null!=(i=n[o])&&!(131072&i.__u)&&(i.__e==t.__d&&(t.__d=E(i)),H(i,i))}function A(t,e,n){var o,r;if("function"==typeof t.type){for(o=t.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=t,e=A(o[r],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=E(t)),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,o){var r=t.key,i=t.type,a=n-1,s=n+1,l=e[n];if(null===l||l&&r==l.key&&i===l.type&&!(131072&l.__u))return n;if(o>(null==l||131072&l.__u?0:1))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&!(131072&l.__u)&&r==l.key&&i===l.type)return a;a--}if(s<e.length){if((l=e[s])&&!(131072&l.__u)&&r==l.key&&i===l.type)return s;s++}}return-1}function D(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||f.test(e)?n:n+"px"}function k(t,e,n,o,r){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||D(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||D(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?o?n.t=o.t:(n.t=l,t.addEventListener(e,i?c:u,i)):t.removeEventListener(e,i?c:u,i);else{if("http://www.w3.org/2000/svg"==r)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&&"popover"!=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,"popover"==e&&1==n?"":n))}}function R(t){return function(n){if(this.l){var o=this.l[n.type+t];if(null==n.u)n.u=l++;else if(n.u<o.t)return;return o(e.event?e.event(n):n)}}}function L(t,n,o,r,i,a,s,l,u,c){var d,p,h,f,y,m,b,E,w,S,C,O,M,N,A,P,D=n.type;if(void 0!==n.constructor)return null;128&o.__u&&(u=!!(32&o.__u),a=[l=n.__e=o.__e]),(d=e.__b)&&d(n);t:if("function"==typeof D)try{if(E=n.props,w="prototype"in D&&D.prototype.render,S=(d=D.contextType)&&r[d.__c],C=d?S?S.props.value:d.__:r,o.__c?b=(p=n.__c=o.__c).__=p.__E:(w?n.__c=p=new D(E,C):(n.__c=p=new x(E,C),p.constructor=D,p.render=F),S&&S.sub(p),p.props=E,p.state||(p.state={}),p.context=C,p.__n=r,h=p.__d=!0,p.__h=[],p._sb=[]),w&&null==p.__s&&(p.__s=p.state),w&&null!=D.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=v({},p.__s)),v(p.__s,D.getDerivedStateFromProps(E,p.__s))),f=p.props,y=p.state,p.__v=n,h)w&&null==D.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),w&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(w&&null==D.getDerivedStateFromProps&&E!==f&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(E,C),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(E,p.__s,C)||n.__v===o.__v)){for(n.__v!==o.__v&&(p.props=E,p.state=p.__s,p.__d=!1),n.__e=o.__e,n.__k=o.__k,n.__k.forEach((function(t){t&&(t.__=n)})),O=0;O<p._sb.length;O++)p.__h.push(p._sb[O]);p._sb=[],p.__h.length&&s.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(E,p.__s,C),w&&null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(f,y,m)}))}if(p.context=C,p.props=E,p.__P=t,p.__e=!1,M=e.__r,N=0,w){for(p.state=p.__s,p.__d=!1,M&&M(n),d=p.render(p.props,p.state,p.context),A=0;A<p._sb.length;A++)p.__h.push(p._sb[A]);p._sb=[]}else do{p.__d=!1,M&&M(n),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++N<25);p.state=p.__s,null!=p.getChildContext&&(r=v(v({},r),p.getChildContext())),w&&!h&&null!=p.getSnapshotBeforeUpdate&&(m=p.getSnapshotBeforeUpdate(f,y)),T(t,g(P=null!=d&&d.type===_&&null==d.key?d.props.children:d)?P:[P],n,o,r,i,a,s,l,u,c),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),b&&(p.__E=p.__=null)}catch(t){if(n.__v=null,u||null!=a){for(n.__u|=u?160:32;l&&8===l.nodeType&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,n.__e=l}else n.__e=o.__e,n.__k=o.__k;e.__e(t,n,o)}else null==a&&n.__v===o.__v?(n.__k=o.__k,n.__e=o.__e):n.__e=j(o.__e,n,o,r,i,a,s,u,c);(d=e.diffed)&&d(n)}function I(t,n,o){n.__d=void 0;for(var r=0;r<o.length;r++)B(o[r],o[++r],o[++r]);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 j(e,n,o,r,i,a,s,l,u){var c,d,h,f,v,m,b,_=o.props,x=n.props,w=n.type;if("svg"===w?i="http://www.w3.org/2000/svg":"math"===w?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==!!w&&(w?v.localName===w:3===v.nodeType)){e=v,a[c]=null;break}if(null==e){if(null===w)return document.createTextNode(x);e=document.createElementNS(i,w,x.is&&x),a=null,l=!1}if(null===w)_===x||l&&e.data===x||(e.data=x);else{if(a=a&&t.call(e.childNodes),_=o.props||p,!l&&null!=a)for(_={},c=0;c<e.attributes.length;c++)_[(v=e.attributes[c]).name]=v.value;for(c in _)if(v=_[c],"children"==c);else if("dangerouslySetInnerHTML"==c)h=v;else if("key"!==c&&!(c in x)){if("value"==c&&"defaultValue"in x||"checked"==c&&"defaultChecked"in x)continue;k(e,c,null,v,i)}for(c in x)v=x[c],"children"==c?f=v:"dangerouslySetInnerHTML"==c?d=v:"value"==c?m=v:"checked"==c?b=v:"key"===c||l&&"function"!=typeof v||_[c]===v||k(e,c,v,_[c],i);if(d)l||h&&(d.__html===h.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),n.__k=[];else if(h&&(e.innerHTML=""),T(e,g(f)?f:[f],n,o,r,"foreignObject"===w?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:o.__k&&E(o,0),l,u),null!=a)for(c=a.length;c--;)null!=a[c]&&y(a[c]);l||(c="value",void 0!==m&&(m!==e[c]||"progress"===w&&!m||"option"===w&&m!==_[c])&&k(e,c,m,_[c],i),c="checked",void 0!==b&&b!==e[c]&&k(e,c,b,_[c],i))}return e}function B(t,n,o){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==n||(t.__u=t(n))}else t.current=n}catch(t){e.__e(t,o)}}function H(t,n,o){var r,i;if(e.unmount&&e.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||B(r,null,n)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){e.__e(t,n)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&H(r[i],n,o||"function"!=typeof t.type);o||null==t.__e||y(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function F(t,e,n){return this.constructor(t,n)}function z(n,o,r){var i,a,s,l;e.__&&e.__(n,o),a=(i="function"==typeof r)?null:r&&r.__k||o.__k,s=[],l=[],L(o,n=(!i&&r||o).__k=m(_,null,[n]),a||p,p,o.namespaceURI,!i&&r?[r]:a?null:o.firstChild?t.call(o.childNodes):null,s,!i&&r?r:a?a.__e:o.firstChild,i,l),I(s,n,l)}return t=h.slice,e={__e:function(t,e,n,o){for(var r,i,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(t)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,o||{}),a=r.__d),a)return r.__E=r}catch(e){t=e}throw t}},n=0,o=function(t){return null!=t&&null==t.constructor},x.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof t&&(t=t(v({},n),this.props)),t&&v(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),C(this))},x.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),C(this))},x.prototype.render=_,r=[],a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(t,e){return t.__v.__b-e.__v.__b},M.__r=0,l=0,u=R(!1),c=R(!0),d=0,O.Component=x,O.Fragment=_,O.cloneElement=function(e,n,o){var r,i,a,s,l=v({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)"key"==a?r=n[a]:"ref"==a?i=n[a]:l[a]=void 0===n[a]&&void 0!==s?s[a]:n[a];return arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):o),b(e.type,l,r||e.key,i||e.ref,null)},O.createContext=function(t,e){var n={__c:e="__cC"+d++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,o;return this.getChildContext||(n=[],(o={})[e]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,C(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n},O.createElement=m,O.createRef=function(){return{current:null}},O.h=m,O.hydrate=function t(e,n){z(e,n,t)},O.isValidElement=o,O.options=e,O.render=z,O.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},O}(),Yn)}(0,C);var Vn,Kn,qn,Zn,$n,Jn,Qn,to,eo,no,oo={},ro=[],io=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ao=Array.isArray;function so(t,e){for(var n in e)t[n]=e[n];return t}function lo(t){var e=t.parentNode;e&&e.removeChild(t)}function uo(t,e,n){var o,r,i,a={};for(i in e)"key"==i?o=e[i]:"ref"==i?r=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?Vn.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 co(t,a,o,r,null)}function co(t,e,n,o,r){var i={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++qn:r,__i:-1,__u:0};return null==r&&null!=Kn.vnode&&Kn.vnode(i),i}function po(t){return t.children}function ho(t,e){this.props=t,this.context=e}function fo(t,e){if(null==e)return t.__?fo(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?fo(t):null}function go(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 go(t)}}function vo(t){(!t.__d&&(t.__d=!0)&&Zn.push(t)&&!yo.__r++||$n!==Kn.debounceRendering)&&(($n=Kn.debounceRendering)||Jn)(yo)}function yo(){var t,e,n,o,r,i,a,s;for(Zn.sort(Qn);t=Zn.shift();)t.__d&&(e=Zn.length,o=void 0,i=(r=(n=t).__v).__e,a=[],s=[],n.__P&&((o=so({},r)).__v=r.__v+1,Kn.vnode&&Kn.vnode(o),Oo(n.__P,o,r,n.__n,n.__P.namespaceURI,32&r.__u?[i]:null,a,null==i?fo(r):i,!!(32&r.__u),s),o.__v=r.__v,o.__.__k[o.__i]=o,Mo(a,o,s),o.__e!=i&&go(o)),Zn.length>e&&Zn.sort(Qn));yo.__r=0}function mo(t,e,n,o,r,i,a,s,l,u,c){var d,p,h,f,g,v=o&&o.__k||ro,y=e.length;for(n.__d=l,bo(n,e,v),l=n.__d,d=0;d<y;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(p=-1===h.__i?oo:v[h.__i]||oo,h.__i=d,Oo(t,h,p,r,i,a,s,l,u,c),f=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&No(p.ref,null,h),c.push(h.ref,h.__c||f,h)),null==g&&null!=f&&(g=f),65536&h.__u||p.__k===h.__k?l=_o(h,l,t):"function"==typeof h.type&&void 0!==h.__d?l=h.__d:f&&(l=f.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=l,n.__e=g}function bo(t,e,n){var o,r,i,a,s,l=e.length,u=n.length,c=u,d=0;for(t.__k=[],o=0;o<l;o++)a=o+d,null!=(r=t.__k[o]=null==(r=e[o])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?co(null,r,null,null,null):ao(r)?co(po,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?co(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=t,r.__b=t.__b+1,s=Eo(r,n,a,c),r.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof r.type&&(r.__u|=65536)):s!==a&&(s==a-1?d=s-a:s==a+1?d++:s>a?c>l-a?d+=s-a:d--:s<a&&d++,s!==o+d&&(r.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==t.__d&&(t.__d=fo(i)),Ao(i,i,!1),n[a]=null,c--);if(c)for(o=0;o<u;o++)null!=(i=n[o])&&!(131072&i.__u)&&(i.__e==t.__d&&(t.__d=fo(i)),Ao(i,i))}function _o(t,e,n){var o,r;if("function"==typeof t.type){for(o=t.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=t,e=_o(o[r],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=fo(t)),n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function xo(t,e){return e=e||[],null==t||"boolean"==typeof t||(ao(t)?t.some((function(t){xo(t,e)})):e.push(t)),e}function Eo(t,e,n,o){var r=t.key,i=t.type,a=n-1,s=n+1,l=e[n];if(null===l||l&&r==l.key&&i===l.type&&!(131072&l.__u))return n;if(o>(null==l||131072&l.__u?0:1))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&!(131072&l.__u)&&r==l.key&&i===l.type)return a;a--}if(s<e.length){if((l=e[s])&&!(131072&l.__u)&&r==l.key&&i===l.type)return s;s++}}return-1}function wo(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||io.test(e)?n:n+"px"}function So(t,e,n,o,r){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||wo(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||wo(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?o?n.u=o.u:(n.u=to,t.addEventListener(e,i?no:eo,i)):t.removeEventListener(e,i?no:eo,i);else{if("http://www.w3.org/2000/svg"==r)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&&"popover"!=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,"popover"==e&&1==n?"":n))}}function Co(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e.t)e.t=to++;else if(e.t<n.u)return;return n(Kn.event?Kn.event(e):e)}}}function Oo(t,e,n,o,r,i,a,s,l,u){var c,d,p,h,f,g,v,y,m,b,_,x,E,w,S,C,O=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=e.__e=n.__e]),(c=Kn.__b)&&c(e);t:if("function"==typeof O)try{if(y=e.props,m="prototype"in O&&O.prototype.render,b=(c=O.contextType)&&o[c.__c],_=c?b?b.props.value:c.__:o,n.__c?v=(d=e.__c=n.__c).__=d.__E:(m?e.__c=d=new O(y,_):(e.__c=d=new ho(y,_),d.constructor=O,d.render=Po),b&&b.sub(d),d.props=y,d.state||(d.state={}),d.context=_,d.__n=o,p=d.__d=!0,d.__h=[],d._sb=[]),m&&null==d.__s&&(d.__s=d.state),m&&null!=O.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=so({},d.__s)),so(d.__s,O.getDerivedStateFromProps(y,d.__s))),h=d.props,f=d.state,d.__v=e,p)m&&null==O.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),m&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(m&&null==O.getDerivedStateFromProps&&y!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,_),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,_)||e.__v===n.__v)){for(e.__v!==n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),x=0;x<d._sb.length;x++)d.__h.push(d._sb[x]);d._sb=[],d.__h.length&&a.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,_),m&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(h,f,g)}))}if(d.context=_,d.props=y,d.__P=t,d.__e=!1,E=Kn.__r,w=0,m){for(d.state=d.__s,d.__d=!1,E&&E(e),c=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,E&&E(e),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++w<25);d.state=d.__s,null!=d.getChildContext&&(o=so(so({},o),d.getChildContext())),m&&!p&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(h,f)),mo(t,ao(C=null!=c&&c.type===po&&null==c.key?c.props.children:c)?C:[C],e,n,o,r,i,a,s,l,u),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),v&&(d.__E=d.__=null)}catch(t){if(e.__v=null,l||null!=i){for(e.__u|=l?160:32;s&&8===s.nodeType&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,e.__e=s}else e.__e=n.__e,e.__k=n.__k;Kn.__e(t,e,n)}else null==i&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=To(n.__e,e,n,o,r,i,a,l,u);(c=Kn.diffed)&&c(e)}function Mo(t,e,n){e.__d=void 0;for(var o=0;o<n.length;o++)No(n[o],n[++o],n[++o]);Kn.__c&&Kn.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Kn.__e(t,e.__v)}}))}function To(t,e,n,o,r,i,a,s,l){var u,c,d,p,h,f,g,v=n.props,y=e.props,m=e.type;if("svg"===m?r="http://www.w3.org/2000/svg":"math"===m?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=i)for(u=0;u<i.length;u++)if((h=i[u])&&"setAttribute"in h==!!m&&(m?h.localName===m:3===h.nodeType)){t=h,i[u]=null;break}if(null==t){if(null===m)return document.createTextNode(y);t=document.createElementNS(r,m,y.is&&y),i=null,s=!1}if(null===m)v===y||s&&t.data===y||(t.data=y);else{if(i=i&&Vn.call(t.childNodes),v=n.props||oo,!s&&null!=i)for(v={},u=0;u<t.attributes.length;u++)v[(h=t.attributes[u]).name]=h.value;for(u in v)if(h=v[u],"children"==u);else if("dangerouslySetInnerHTML"==u)d=h;else if("key"!==u&&!(u in y)){if("value"==u&&"defaultValue"in y||"checked"==u&&"defaultChecked"in y)continue;So(t,u,null,h,r)}for(u in y)h=y[u],"children"==u?p=h:"dangerouslySetInnerHTML"==u?c=h:"value"==u?f=h:"checked"==u?g=h:"key"===u||s&&"function"!=typeof h||v[u]===h||So(t,u,h,v[u],r);if(c)s||d&&(c.__html===d.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),mo(t,ao(p)?p:[p],e,n,o,"foreignObject"===m?"http://www.w3.org/1999/xhtml":r,i,a,i?i[0]:n.__k&&fo(n,0),s,l),null!=i)for(u=i.length;u--;)null!=i[u]&&lo(i[u]);s||(u="value",void 0!==f&&(f!==t[u]||"progress"===m&&!f||"option"===m&&f!==v[u])&&So(t,u,f,v[u],r),u="checked",void 0!==g&&g!==t[u]&&So(t,u,g,v[u],r))}return t}function No(t,e,n){try{if("function"==typeof t){var o="function"==typeof t.__u;o&&t.__u(),o&&null==e||(t.__u=t(e))}else t.current=e}catch(t){Kn.__e(t,n)}}function Ao(t,e,n){var o,r;if(Kn.unmount&&Kn.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||No(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){Kn.__e(t,e)}o.base=o.__P=null}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&Ao(o[r],e,n||"function"!=typeof t.type);n||null==t.__e||lo(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function Po(t,e,n){return this.constructor(t,n)}function Do(t,e,n){var o,r,i,a;Kn.__&&Kn.__(t,e),r=(o="function"==typeof n)?null:n&&n.__k||e.__k,i=[],a=[],Oo(e,t=(!o&&n||e).__k=uo(po,null,[t]),r||oo,oo,e.namespaceURI,!o&&n?[n]:r?null:e.firstChild?Vn.call(e.childNodes):null,i,!o&&n?n:r?r.__e:e.firstChild,o,a),Mo(i,t,a)}Vn=ro.slice,Kn={__e:function(t,e,n,o){for(var r,i,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(t)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,o||{}),a=r.__d),a)return r.__E=r}catch(e){t=e}throw t}},qn=0,ho.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=so({},this.state),"function"==typeof t&&(t=t(so({},n),this.props)),t&&so(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),vo(this))},ho.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),vo(this))},ho.prototype.render=po,Zn=[],Jn="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Qn=function(t,e){return t.__v.__b-e.__v.__b},yo.__r=0,to=0,eo=Co(!1),no=Co(!0);var ko,Ro,Lo,Io=[],jo=Kn,Bo=jo.__b,Ho=jo.__r,Fo=jo.diffed,zo=jo.__c,Wo=jo.unmount,Uo=jo.__;function Xo(){for(var t;t=Io.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Vo),t.__H.__h.forEach(Ko),t.__H.__h=[]}catch(e){t.__H.__h=[],jo.__e(e,t.__v)}}jo.__b=function(t){ko=null,Bo&&Bo(t)},jo.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Uo&&Uo(t,e)},jo.__r=function(t){Ho&&Ho(t);var e=(ko=t.__c).__H;e&&(Ro===ko?(e.__h=[],ko.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0}))):(e.__h.forEach(Vo),e.__h.forEach(Ko),e.__h=[])),Ro=ko},jo.diffed=function(t){Fo&&Fo(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Io.push(e)&&Lo===jo.requestAnimationFrame||((Lo=jo.requestAnimationFrame)||Yo)(Xo)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.i=void 0}))),Ro=ko=null},jo.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Vo),t.__h=t.__h.filter((function(t){return!t.__||Ko(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],jo.__e(n,t.__v)}})),zo&&zo(t,e)},jo.unmount=function(t){Wo&&Wo(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{Vo(t)}catch(t){e=t}})),n.__H=void 0,e&&jo.__e(e,n.__v))};var Go="function"==typeof requestAnimationFrame;function Yo(t){var e,n=function(){clearTimeout(o),Go&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);Go&&(e=requestAnimationFrame(n))}function Vo(t){var e=ko,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),ko=e}function Ko(t){var e=ko;t.__c=t.__(),ko=e}function qo(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var o in e)if("__source"!==o&&t[o]!==e[o])return!0;return!1}function Zo(t,e){this.props=t,this.context=e}(Zo.prototype=new ho).isPureReactComponent=!0,Zo.prototype.shouldComponentUpdate=function(t,e){return qo(this.props,t)||qo(this.state,e)};var $o=Kn.__b;Kn.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),$o&&$o(t)};var Jo=Kn.__e;Kn.__e=function(t,e,n,o){if(t.then)for(var r,i=e;i=i.__;)if((r=i.__c)&&r.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e);Jo(t,e,n,o)};var Qo=Kn.unmount;function tr(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 tr(t,e,n)}))),t}function er(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return er(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 nr(){this.__u=0,this.t=null,this.__b=null}function or(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function rr(){this.u=null,this.o=null}Kn.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Qo&&Qo(t)},(nr.prototype=new ho).__c=function(t,e){var n=e.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var r=or(o.__v),i=!1,a=function(){i||(i=!0,n.__R=null,r?r(s):s())};n.__R=a;var s=function(){if(! --o.__u){if(o.state.__a){var t=o.state.__a;o.__v.__k[0]=er(t,t.__c.__P,t.__c.__O)}var e;for(o.setState({__a:o.__b=null});e=o.t.pop();)e.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(a,a)},nr.prototype.componentWillUnmount=function(){this.t=[]},nr.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=tr(this.__b,n,o.__O=o.__P)}this.__b=null}var r=e.__a&&uo(po,null,t.fallback);return r&&(r.__u&=-33),[uo(po,null,e.__a?null:t.children),r]};var ir=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]}};(rr.prototype=new ho).__a=function(t){var e=this,n=or(e.__v),o=e.o.get(t);return o[0]++,function(r){var i=function(){e.props.revealOrder?(o.push(r),ir(e,t,o)):r()};n?n(i):i()}},rr.prototype.render=function(t){this.u=null,this.o=new Map;var e=xo(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},rr.prototype.componentDidUpdate=rr.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){ir(t,n,e)}))};var ar="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,sr=/^(?: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]/,lr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ur=/[A-Z0-9]/g,cr="undefined"!=typeof document,dr=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};ho.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(ho.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var pr=Kn.event;function hr(){}function fr(){return this.cancelBubble}function gr(){return this.defaultPrevented}Kn.event=function(t){return pr&&(t=pr(t)),t.persist=hr,t.isPropagationStopped=fr,t.isDefaultPrevented=gr,t.nativeEvent=t};var vr={enumerable:!1,configurable:!0,get:function(){return this.class}},yr=Kn.vnode;Kn.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,o={};for(var r in e){var i=e[r];if(!("value"===r&&"defaultValue"in e&&null==i||cr&&"children"===r&&"noscript"===n||"class"===r||"className"===r)){var a=r.toLowerCase();"defaultValue"===r&&"value"in e&&null==e.value?r="value":"download"===r&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"ondoubleclick"===a?r="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||dr(e.type)?"onfocus"===a?r="onfocusin":"onblur"===a?r="onfocusout":lr.test(r)?r=a:-1===n.indexOf("-")&&sr.test(r)?r=r.replace(ur,"-$&").toLowerCase():null===i&&(i=void 0):a=r="oninput","oninput"===a&&o[r=a]&&(r="oninputCapture"),o[r]=i}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=xo(e.children).forEach((function(t){t.props.selected=-1!=o.value.indexOf(t.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=xo(e.children).forEach((function(t){t.props.selected=o.multiple?-1!=o.defaultValue.indexOf(t.props.value):o.defaultValue==t.props.value}))),e.class&&!e.className?(o.class=e.class,Object.defineProperty(o,"className",vr)):(e.className&&!e.class||e.class&&e.className)&&(o.class=o.className=e.className),t.props=o}(t),t.$$typeof=ar,yr&&yr(t)};var mr=Kn.__r;Kn.__r=function(t){mr&&mr(t),t.__c};var br=Kn.diffed;Kn.diffed=function(t){br&&br(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 _r=0;function xr(t,e,n,o,r,i){e||(e={});var a,s,l=e;if("ref"in l)for(s in l={},e)"ref"==s?a=e[s]:l[s]=e[s];var u={type:t,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--_r,__i:-1,__u:0,__source:r,__self:i};if("function"==typeof t&&(a=t.defaultProps))for(s in a)void 0===l[s]&&(l[s]=a[s]);return Kn.vnode&&Kn.vnode(u),u}var Er="object"==typeof global&&global&&global.Object===Object&&global,wr="object"==typeof self&&self&&self.Object===Object&&self,Sr=Er||wr||Function("return this")(),Cr=Sr.Symbol,Or=Object.prototype,Mr=Or.hasOwnProperty,Tr=Or.toString,Nr=Cr?Cr.toStringTag:void 0;var Ar=Object.prototype.toString;var Pr="[object Null]",Dr="[object Undefined]",kr=Cr?Cr.toStringTag:void 0;function Rr(t){return null==t?void 0===t?Dr:Pr:kr&&kr in Object(t)?function(t){var e=Mr.call(t,Nr),n=t[Nr];try{t[Nr]=void 0;var o=!0}catch(t){}var r=Tr.call(t);return o&&(e?t[Nr]=n:delete t[Nr]),r}(t):function(t){return Ar.call(t)}(t)}function Lr(t){return null!=t&&"object"==typeof t}var Ir="[object Symbol]";function jr(t){return"symbol"==typeof t||Lr(t)&&Rr(t)==Ir}var Br=NaN;function Hr(t){return"number"==typeof t?t:jr(t)?Br:+t}function Fr(t,e){for(var n=-1,o=null==t?0:t.length,r=Array(o);++n<o;)r[n]=e(t[n],n,t);return r}var zr=Array.isArray,Wr=1/0,Ur=Cr?Cr.prototype:void 0,Xr=Ur?Ur.toString:void 0;function Gr(t){if("string"==typeof t)return t;if(zr(t))return Fr(t,Gr)+"";if(jr(t))return Xr?Xr.call(t):"";var e=t+"";return"0"==e&&1/t==-Wr?"-0":e}function Yr(t,e){return function(n,o){var r;if(void 0===n&&void 0===o)return e;if(void 0!==n&&(r=n),void 0!==o){if(void 0===r)return o;"string"==typeof n||"string"==typeof o?(n=Gr(n),o=Gr(o)):(n=Hr(n),o=Hr(o)),r=t(n,o)}return r}}var Vr=Yr((function(t,e){return t+e}),0),Kr=/\s/;function qr(t){for(var e=t.length;e--&&Kr.test(t.charAt(e)););return e}var Zr=/^\s+/;function $r(t){return t?t.slice(0,qr(t)+1).replace(Zr,""):t}function Jr(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Qr=NaN,ti=/^[-+]0x[0-9a-f]+$/i,ei=/^0b[01]+$/i,ni=/^0o[0-7]+$/i,oi=parseInt;function ri(t){if("number"==typeof t)return t;if(jr(t))return Qr;if(Jr(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Jr(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$r(t);var n=ei.test(t);return n||ni.test(t)?oi(t.slice(2),n?2:8):ti.test(t)?Qr:+t}var ii=1/0,ai=17976931348623157e292;function si(t){return t?(t=ri(t))===ii||t===-ii?(t<0?-1:1)*ai:t==t?t:0:0===t?t:0}function li(t){var e=si(t),n=e%1;return e==e?n?e-n:e:0}function ui(t){return t}var ci="[object AsyncFunction]",di="[object Function]",pi="[object GeneratorFunction]",hi="[object Proxy]";function fi(t){if(!Jr(t))return!1;var e=Rr(t);return e==di||e==pi||e==ci||e==hi}var gi,vi=Sr["__core-js_shared__"],yi=(gi=/[^.]+$/.exec(vi&&vi.keys&&vi.keys.IE_PROTO||""))?"Symbol(src)_1."+gi:"";var mi=Function.prototype.toString;function bi(t){if(null!=t){try{return mi.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var _i=/^\[object .+?Constructor\]$/,xi=Function.prototype,Ei=Object.prototype,wi=xi.toString,Si=Ei.hasOwnProperty,Ci=RegExp("^"+wi.call(Si).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Oi(t){return!(!Jr(t)||function(t){return!!yi&&yi in t}(t))&&(fi(t)?Ci:_i).test(bi(t))}function Mi(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Oi(n)?n:void 0}var Ti=Mi(Sr,"WeakMap"),Ni=Ti&&new Ti,Ai=Ni?function(t,e){return Ni.set(t,e),t}:ui,Pi=Object.create,Di=function(){function t(){}return function(e){if(!Jr(e))return{};if(Pi)return Pi(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function ki(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=Di(t.prototype),o=t.apply(n,e);return Jr(o)?o:n}}var Ri=1;function Li(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 Ii=Math.max;function ji(t,e,n,o){for(var r=-1,i=t.length,a=n.length,s=-1,l=e.length,u=Ii(i-a,0),c=Array(l+u),d=!o;++s<l;)c[s]=e[s];for(;++r<a;)(d||r<i)&&(c[n[r]]=t[r]);for(;u--;)c[s++]=t[r++];return c}var Bi=Math.max;function Hi(t,e,n,o){for(var r=-1,i=t.length,a=-1,s=n.length,l=-1,u=e.length,c=Bi(i-s,0),d=Array(c+u),p=!o;++r<c;)d[r]=t[r];for(var h=r;++l<u;)d[h+l]=e[l];for(;++a<s;)(p||r<i)&&(d[h+n[a]]=t[r++]);return d}function Fi(){}var zi=4294967295;function Wi(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=zi,this.__views__=[]}function Ui(){}Wi.prototype=Di(Fi.prototype),Wi.prototype.constructor=Wi;var Xi=Ni?function(t){return Ni.get(t)}:Ui,Gi={},Yi=Object.prototype.hasOwnProperty;function Vi(t){for(var e=t.name+"",n=Gi[e],o=Yi.call(Gi,e)?n.length:0;o--;){var r=n[o],i=r.func;if(null==i||i==t)return r.name}return e}function Ki(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function qi(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}function Zi(t){if(t instanceof Wi)return t.clone();var e=new Ki(t.__wrapped__,t.__chain__);return e.__actions__=qi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}Ki.prototype=Di(Fi.prototype),Ki.prototype.constructor=Ki;var $i=Object.prototype.hasOwnProperty;function Ji(t){if(Lr(t)&&!zr(t)&&!(t instanceof Wi)){if(t instanceof Ki)return t;if($i.call(t,"__wrapped__"))return Zi(t)}return new Ki(t)}function Qi(t){var e=Vi(t),n=Ji[e];if("function"!=typeof n||!(e in Wi.prototype))return!1;if(t===n)return!0;var o=Xi(n);return!!o&&t===o[0]}Ji.prototype=Fi.prototype,Ji.prototype.constructor=Ji;var ta=Date.now;function ea(t){var e=0,n=0;return function(){var o=ta(),r=16-(o-n);if(n=o,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var na=ea(Ai),oa=/\{\n\/\* \[wrapped with (.+)\] \*/,ra=/,? & /;var ia=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function aa(t){return function(){return t}}var sa=function(){try{var t=Mi(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),la=sa?function(t,e){return sa(t,"toString",{configurable:!0,enumerable:!1,value:aa(e),writable:!0})}:ui,ua=ea(la);function ca(t,e){for(var n=-1,o=null==t?0:t.length;++n<o&&!1!==e(t[n],n,t););return t}function da(t,e,n,o){for(var r=t.length,i=n+(o?1:-1);o?i--:++i<r;)if(e(t[i],i,t))return i;return-1}function pa(t){return t!=t}function ha(t,e,n){return e==e?function(t,e,n){for(var o=n-1,r=t.length;++o<r;)if(t[o]===e)return o;return-1}(t,e,n):da(t,pa,n)}function fa(t,e){return!!(null==t?0:t.length)&&ha(t,e,0)>-1}var ga=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function va(t,e,n){var o=e+"";return ua(t,function(t,e){var n=e.length;if(!n)return t;var o=n-1;return e[o]=(n>1?"& ":"")+e[o],e=e.join(n>2?", ":" "),t.replace(ia,"{\n/* [wrapped with "+e+"] */\n")}(o,function(t,e){return ca(ga,(function(n){var o="_."+n[0];e&n[1]&&!fa(t,o)&&t.push(o)})),t.sort()}(function(t){var e=t.match(oa);return e?e[1].split(ra):[]}(o),n)))}var ya=1,ma=2,ba=4,_a=8,xa=32,Ea=64;function wa(t,e,n,o,r,i,a,s,l,u){var c=e&_a;e|=c?xa:Ea,(e&=~(c?Ea:xa))&ba||(e&=~(ya|ma));var d=[t,e,r,c?i:void 0,c?a:void 0,c?void 0:i,c?void 0:a,s,l,u],p=n.apply(void 0,d);return Qi(t)&&na(p,d),p.placeholder=o,va(p,t,e)}function Sa(t){return t.placeholder}var Ca=9007199254740991,Oa=/^(?:0|[1-9]\d*)$/;function Ma(t,e){var n=typeof t;return!!(e=null==e?Ca:e)&&("number"==n||"symbol"!=n&&Oa.test(t))&&t>-1&&t%1==0&&t<e}var Ta=Math.min;var Na="__lodash_placeholder__";function Aa(t,e){for(var n=-1,o=t.length,r=0,i=[];++n<o;){var a=t[n];a!==e&&a!==Na||(t[n]=Na,i[r++]=n)}return i}var Pa=1,Da=2,ka=8,Ra=16,La=128,Ia=512;function ja(t,e,n,o,r,i,a,s,l,u){var c=e&La,d=e&Pa,p=e&Da,h=e&(ka|Ra),f=e&Ia,g=p?void 0:ki(t);return function v(){for(var y=arguments.length,m=Array(y),b=y;b--;)m[b]=arguments[b];if(h)var _=Sa(v),x=function(t,e){for(var n=t.length,o=0;n--;)t[n]===e&&++o;return o}(m,_);if(o&&(m=ji(m,o,r,h)),i&&(m=Hi(m,i,a,h)),y-=x,h&&y<u){var E=Aa(m,_);return wa(t,e,ja,v.placeholder,n,m,E,s,l,u-y)}var w=d?n:this,S=p?w[t]:t;return y=m.length,s?m=function(t,e){for(var n=t.length,o=Ta(e.length,n),r=qi(t);o--;){var i=e[o];t[o]=Ma(i,n)?r[i]:void 0}return t}(m,s):f&&y>1&&m.reverse(),c&&l<y&&(m.length=l),this&&this!==Sr&&this instanceof v&&(S=g||ki(S)),S.apply(w,m)}}var Ba=1;var Ha="__lodash_placeholder__",Fa=1,za=2,Wa=4,Ua=8,Xa=128,Ga=256,Ya=Math.min;var Va="Expected a function",Ka=1,qa=2,Za=8,$a=16,Ja=32,Qa=64,ts=Math.max;function es(t,e,n,o,r,i,a,s){var l=e&qa;if(!l&&"function"!=typeof t)throw new TypeError(Va);var u=o?o.length:0;if(u||(e&=~(Ja|Qa),o=r=void 0),a=void 0===a?a:ts(li(a),0),s=void 0===s?s:li(s),u-=r?r.length:0,e&Qa){var c=o,d=r;o=r=void 0}var p=l?void 0:Xi(t),h=[t,e,n,o,r,c,d,i,a,s];if(p&&function(t,e){var n=t[1],o=e[1],r=n|o,i=r<(Fa|za|Xa),a=o==Xa&&n==Ua||o==Xa&&n==Ga&&t[7].length<=e[8]||o==(Xa|Ga)&&e[7].length<=e[8]&&n==Ua;if(!i&&!a)return t;o&Fa&&(t[2]=e[2],r|=n&Fa?0:Wa);var s=e[3];if(s){var l=t[3];t[3]=l?ji(l,s,e[4]):s,t[4]=l?Aa(t[3],Ha):e[4]}(s=e[5])&&(l=t[5],t[5]=l?Hi(l,s,e[6]):s,t[6]=l?Aa(t[5],Ha):e[6]),(s=e[7])&&(t[7]=s),o&Xa&&(t[8]=null==t[8]?e[8]:Ya(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=r}(h,p),t=h[0],e=h[1],n=h[2],o=h[3],r=h[4],!(s=h[9]=void 0===h[9]?l?0:t.length:ts(h[9]-u,0))&&e&(Za|$a)&&(e&=~(Za|$a)),e&&e!=Ka)f=e==Za||e==$a?function(t,e,n){var o=ki(t);return function r(){for(var i=arguments.length,a=Array(i),s=i,l=Sa(r);s--;)a[s]=arguments[s];var u=i<3&&a[0]!==l&&a[i-1]!==l?[]:Aa(a,l);return(i-=u.length)<n?wa(t,e,ja,r.placeholder,void 0,a,u,void 0,void 0,n-i):Li(this&&this!==Sr&&this instanceof r?o:t,this,a)}}(t,e,s):e!=Ja&&e!=(Ka|Ja)||r.length?ja.apply(void 0,h):function(t,e,n,o){var r=e&Ba,i=ki(t);return function e(){for(var a=-1,s=arguments.length,l=-1,u=o.length,c=Array(u+s),d=this&&this!==Sr&&this instanceof e?i:t;++l<u;)c[l]=o[l];for(;s--;)c[l++]=arguments[++a];return Li(d,r?n:this,c)}}(t,e,n,o);else var f=function(t,e,n){var o=e&Ri,r=ki(t);return function e(){return(this&&this!==Sr&&this instanceof e?r:t).apply(o?n:this,arguments)}}(t,e,n);return va((p?Ai:na)(f,h),t,e)}var ns=128;function os(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,es(t,ns,void 0,void 0,void 0,void 0,e)}function rs(t,e,n){"__proto__"==e&&sa?sa(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function is(t,e){return t===e||t!=t&&e!=e}var as=Object.prototype.hasOwnProperty;function ss(t,e,n){var o=t[e];as.call(t,e)&&is(o,n)&&(void 0!==n||e in t)||rs(t,e,n)}function ls(t,e,n,o){var r=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],l=o?o(n[s],t[s],s,n,t):void 0;void 0===l&&(l=t[s]),r?rs(n,s,l):ss(n,s,l)}return n}var us=Math.max;function cs(t,e,n){return e=us(void 0===e?t.length-1:e,0),function(){for(var o=arguments,r=-1,i=us(o.length-e,0),a=Array(i);++r<i;)a[r]=o[e+r];r=-1;for(var s=Array(e+1);++r<e;)s[r]=o[r];return s[e]=n(a),Li(t,this,s)}}function ds(t,e){return ua(cs(t,e,ui),t+"")}var ps=9007199254740991;function hs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=ps}function fs(t){return null!=t&&hs(t.length)&&!fi(t)}function gs(t,e,n){if(!Jr(n))return!1;var o=typeof e;return!!("number"==o?fs(n)&&Ma(e,n.length):"string"==o&&e in n)&&is(n[e],t)}function vs(t){return ds((function(e,n){var o=-1,r=n.length,i=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(r--,i):void 0,a&&gs(n[0],n[1],a)&&(i=r<3?void 0:i,r=1),e=Object(e);++o<r;){var s=n[o];s&&t(e,s,o,i)}return e}))}var ys=Object.prototype;function ms(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ys)}function bs(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}function _s(t){return Lr(t)&&"[object Arguments]"==Rr(t)}var xs=Object.prototype,Es=xs.hasOwnProperty,ws=xs.propertyIsEnumerable,Ss=_s(function(){return arguments}())?_s:function(t){return Lr(t)&&Es.call(t,"callee")&&!ws.call(t,"callee")};function Cs(){return!1}var Os="object"==typeof t&&t&&!t.nodeType&&t,Ms=Os&&"object"==typeof module&&module&&!module.nodeType&&module,Ts=Ms&&Ms.exports===Os?Sr.Buffer:void 0,Ns=(Ts?Ts.isBuffer:void 0)||Cs,As={};function Ps(t){return function(e){return t(e)}}As["[object Float32Array]"]=As["[object Float64Array]"]=As["[object Int8Array]"]=As["[object Int16Array]"]=As["[object Int32Array]"]=As["[object Uint8Array]"]=As["[object Uint8ClampedArray]"]=As["[object Uint16Array]"]=As["[object Uint32Array]"]=!0,As["[object Arguments]"]=As["[object Array]"]=As["[object ArrayBuffer]"]=As["[object Boolean]"]=As["[object DataView]"]=As["[object Date]"]=As["[object Error]"]=As["[object Function]"]=As["[object Map]"]=As["[object Number]"]=As["[object Object]"]=As["[object RegExp]"]=As["[object Set]"]=As["[object String]"]=As["[object WeakMap]"]=!1;var Ds="object"==typeof t&&t&&!t.nodeType&&t,ks=Ds&&"object"==typeof module&&module&&!module.nodeType&&module,Rs=ks&&ks.exports===Ds&&Er.process,Ls=function(){try{var t=ks&&ks.require&&ks.require("util").types;return t||Rs&&Rs.binding&&Rs.binding("util")}catch(t){}}(),Is=Ls&&Ls.isTypedArray,js=Is?Ps(Is):function(t){return Lr(t)&&hs(t.length)&&!!As[Rr(t)]},Bs=Object.prototype.hasOwnProperty;function Hs(t,e){var n=zr(t),o=!n&&Ss(t),r=!n&&!o&&Ns(t),i=!n&&!o&&!r&&js(t),a=n||o||r||i,s=a?bs(t.length,String):[],l=s.length;for(var u in t)!e&&!Bs.call(t,u)||a&&("length"==u||r&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Ma(u,l))||s.push(u);return s}function Fs(t,e){return function(n){return t(e(n))}}var zs=Fs(Object.keys,Object),Ws=Object.prototype.hasOwnProperty;function Us(t){if(!ms(t))return zs(t);var e=[];for(var n in Object(t))Ws.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Xs(t){return fs(t)?Hs(t):Us(t)}var Gs=Object.prototype.hasOwnProperty,Ys=vs((function(t,e){if(ms(e)||fs(e))ls(e,Xs(e),t);else for(var n in e)Gs.call(e,n)&&ss(t,n,e[n])}));var Vs=Object.prototype.hasOwnProperty;function Ks(t){if(!Jr(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=ms(t),n=[];for(var o in t)("constructor"!=o||!e&&Vs.call(t,o))&&n.push(o);return n}function qs(t){return fs(t)?Hs(t,!0):Ks(t)}var Zs=vs((function(t,e){ls(e,qs(e),t)})),$s=vs((function(t,e,n,o){ls(e,qs(e),t,o)})),Js=vs((function(t,e,n,o){ls(e,Xs(e),t,o)})),Qs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tl=/^\w*$/;function el(t,e){if(zr(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!jr(t))||(tl.test(t)||!Qs.test(t)||null!=e&&t in Object(e))}var nl=Mi(Object,"create");var ol=Object.prototype.hasOwnProperty;var rl=Object.prototype.hasOwnProperty;function il(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function al(t,e){for(var n=t.length;n--;)if(is(t[n][0],e))return n;return-1}il.prototype.clear=function(){this.__data__=nl?nl(null):{},this.size=0},il.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},il.prototype.get=function(t){var e=this.__data__;if(nl){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return ol.call(e,t)?e[t]:void 0},il.prototype.has=function(t){var e=this.__data__;return nl?void 0!==e[t]:rl.call(e,t)},il.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nl&&void 0===e?"__lodash_hash_undefined__":e,this};var sl=Array.prototype.splice;function ll(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}ll.prototype.clear=function(){this.__data__=[],this.size=0},ll.prototype.delete=function(t){var e=this.__data__,n=al(e,t);return!(n<0)&&(n==e.length-1?e.pop():sl.call(e,n,1),--this.size,!0)},ll.prototype.get=function(t){var e=this.__data__,n=al(e,t);return n<0?void 0:e[n][1]},ll.prototype.has=function(t){return al(this.__data__,t)>-1},ll.prototype.set=function(t,e){var n=this.__data__,o=al(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};var ul=Mi(Sr,"Map");function cl(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function dl(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}dl.prototype.clear=function(){this.size=0,this.__data__={hash:new il,map:new(ul||ll),string:new il}},dl.prototype.delete=function(t){var e=cl(this,t).delete(t);return this.size-=e?1:0,e},dl.prototype.get=function(t){return cl(this,t).get(t)},dl.prototype.has=function(t){return cl(this,t).has(t)},dl.prototype.set=function(t,e){var n=cl(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};var pl="Expected a function";function hl(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(pl);var n=function(){var o=arguments,r=e?e.apply(this,o):o[0],i=n.cache;if(i.has(r))return i.get(r);var a=t.apply(this,o);return n.cache=i.set(r,a)||i,a};return n.cache=new(hl.Cache||dl),n}hl.Cache=dl;var fl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gl=/\\(\\)?/g,vl=function(t){var e=hl(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(fl,(function(t,n,o,r){e.push(o?r.replace(gl,"$1"):n||t)})),e}));function yl(t){return null==t?"":Gr(t)}function ml(t,e){return zr(t)?t:el(t,e)?[t]:vl(yl(t))}var bl=1/0;function _l(t){if("string"==typeof t||jr(t))return t;var e=t+"";return"0"==e&&1/t==-bl?"-0":e}function xl(t,e){for(var n=0,o=(e=ml(e,t)).length;null!=t&&n<o;)t=t[_l(e[n++])];return n&&n==o?t:void 0}function El(t,e,n){var o=null==t?void 0:xl(t,e);return void 0===o?n:o}function wl(t,e){for(var n=-1,o=e.length,r=Array(o),i=null==t;++n<o;)r[n]=i?void 0:El(t,e[n]);return r}function Sl(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t}var Cl=Cr?Cr.isConcatSpreadable:void 0;function Ol(t){return zr(t)||Ss(t)||!!(Cl&&t&&t[Cl])}function Ml(t,e,n,o,r){var i=-1,a=t.length;for(n||(n=Ol),r||(r=[]);++i<a;){var s=t[i];e>0&&n(s)?e>1?Ml(s,e-1,n,o,r):Sl(r,s):o||(r[r.length]=s)}return r}function Tl(t){return(null==t?0:t.length)?Ml(t,1):[]}function Nl(t){return ua(cs(t,void 0,Tl),t+"")}var Al=Nl(wl),Pl=Fs(Object.getPrototypeOf,Object),Dl="[object Object]",kl=Function.prototype,Rl=Object.prototype,Ll=kl.toString,Il=Rl.hasOwnProperty,jl=Ll.call(Object);function Bl(t){if(!Lr(t)||Rr(t)!=Dl)return!1;var e=Pl(t);if(null===e)return!0;var n=Il.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ll.call(n)==jl}var Hl="[object DOMException]",Fl="[object Error]";function zl(t){if(!Lr(t))return!1;var e=Rr(t);return e==Fl||e==Hl||"string"==typeof t.message&&"string"==typeof t.name&&!Bl(t)}var Wl=ds((function(t,e){try{return Li(t,void 0,e)}catch(t){return zl(t)?t:new Error(t)}})),Ul="Expected a function";function Xl(t,e){var n;if("function"!=typeof e)throw new TypeError(Ul);return t=li(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var Gl=ds((function(t,e,n){var o=1;if(n.length){var r=Aa(n,Sa(Gl));o|=32}return es(t,o,e,n,r)}));Gl.placeholder={};var Yl=Nl((function(t,e){return ca(e,(function(e){e=_l(e),rs(t,e,Gl(t[e],t))})),t})),Vl=ds((function(t,e,n){var o=3;if(n.length){var r=Aa(n,Sa(Vl));o|=32}return es(e,o,t,n,r)}));function Kl(t,e,n){var o=-1,r=t.length;e<0&&(e=-e>r?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(r);++o<r;)i[o]=t[o+e];return i}function ql(t,e,n){var o=t.length;return n=void 0===n?o:n,!e&&n>=o?t:Kl(t,e,n)}Vl.placeholder={};var Zl=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function $l(t){return Zl.test(t)}var Jl="\\ud800-\\udfff",Ql="["+Jl+"]",tu="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",eu="\\ud83c[\\udffb-\\udfff]",nu="[^"+Jl+"]",ou="(?:\\ud83c[\\udde6-\\uddff]){2}",ru="[\\ud800-\\udbff][\\udc00-\\udfff]",iu="(?:"+tu+"|"+eu+")"+"?",au="[\\ufe0e\\ufe0f]?",su=au+iu+("(?:\\u200d(?:"+[nu,ou,ru].join("|")+")"+au+iu+")*"),lu="(?:"+[nu+tu+"?",tu,ou,ru,Ql].join("|")+")",uu=RegExp(eu+"(?="+eu+")|"+lu+su,"g");function cu(t){return $l(t)?function(t){return t.match(uu)||[]}(t):function(t){return t.split("")}(t)}function du(t){return function(e){var n=$l(e=yl(e))?cu(e):void 0,o=n?n[0]:e.charAt(0),r=n?ql(n,1).join(""):e.slice(1);return o[t]()+r}}var pu=du("toUpperCase");function hu(t){return pu(yl(t).toLowerCase())}function fu(t,e,n,o){var r=-1,i=null==t?0:t.length;for(o&&i&&(n=t[++r]);++r<i;)n=e(n,t[r],r,t);return n}function gu(t){return function(e){return null==t?void 0:t[e]}}var vu=gu({"À":"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"}),yu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mu=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function bu(t){return(t=yl(t))&&t.replace(yu,vu).replace(mu,"")}var _u=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var xu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Eu="\\ud800-\\udfff",wu="\\u2700-\\u27bf",Su="a-z\\xdf-\\xf6\\xf8-\\xff",Cu="A-Z\\xc0-\\xd6\\xd8-\\xde",Ou="\\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",Mu="["+Ou+"]",Tu="\\d+",Nu="["+wu+"]",Au="["+Su+"]",Pu="[^"+Eu+Ou+Tu+wu+Su+Cu+"]",Du="(?:\\ud83c[\\udde6-\\uddff]){2}",ku="[\\ud800-\\udbff][\\udc00-\\udfff]",Ru="["+Cu+"]",Lu="(?:"+Au+"|"+Pu+")",Iu="(?:"+Ru+"|"+Pu+")",ju="(?:['’](?:d|ll|m|re|s|t|ve))?",Bu="(?:['’](?:D|LL|M|RE|S|T|VE))?",Hu="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Fu="[\\ufe0e\\ufe0f]?",zu=Fu+Hu+("(?:\\u200d(?:"+["[^"+Eu+"]",Du,ku].join("|")+")"+Fu+Hu+")*"),Wu="(?:"+[Nu,Du,ku].join("|")+")"+zu,Uu=RegExp([Ru+"?"+Au+"+"+ju+"(?="+[Mu,Ru,"$"].join("|")+")",Iu+"+"+Bu+"(?="+[Mu,Ru+Lu,"$"].join("|")+")",Ru+"?"+Lu+"+"+ju,Ru+"+"+Bu,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tu,Wu].join("|"),"g");function Xu(t,e,n){return t=yl(t),void 0===(e=n?void 0:e)?function(t){return xu.test(t)}(t)?function(t){return t.match(Uu)||[]}(t):function(t){return t.match(_u)||[]}(t):t.match(e)||[]}var Gu=RegExp("['’]","g");function Yu(t){return function(e){return fu(Xu(bu(e).replace(Gu,"")),t,"")}}var Vu=Yu((function(t,e,n){return e=e.toLowerCase(),t+(n?hu(e):e)}));var Ku=Sr.isFinite,qu=Math.min;function Zu(t){var e=Math[t];return function(t,n){if(t=ri(t),(n=null==n?0:qu(li(n),292))&&Ku(t)){var o=(yl(t)+"e").split("e");return+((o=(yl(e(o[0]+"e"+(+o[1]+n)))+"e").split("e"))[0]+"e"+(+o[1]-n))}return e(t)}}var $u=Zu("ceil");function Ju(t){var e=Ji(t);return e.__chain__=!0,e}var Qu=Math.ceil,tc=Math.max;function ec(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function nc(t){var e=this.__data__=new ll(t);this.size=e.size}function oc(t,e){return t&&ls(e,Xs(e),t)}nc.prototype.clear=function(){this.__data__=new ll,this.size=0},nc.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},nc.prototype.get=function(t){return this.__data__.get(t)},nc.prototype.has=function(t){return this.__data__.has(t)},nc.prototype.set=function(t,e){var n=this.__data__;if(n instanceof ll){var o=n.__data__;if(!ul||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new dl(o)}return n.set(t,e),this.size=n.size,this};var rc="object"==typeof t&&t&&!t.nodeType&&t,ic=rc&&"object"==typeof module&&module&&!module.nodeType&&module,ac=ic&&ic.exports===rc?Sr.Buffer:void 0,sc=ac?ac.allocUnsafe:void 0;function lc(t,e){if(e)return t.slice();var n=t.length,o=sc?sc(n):new t.constructor(n);return t.copy(o),o}function uc(t,e){for(var n=-1,o=null==t?0:t.length,r=0,i=[];++n<o;){var a=t[n];e(a,n,t)&&(i[r++]=a)}return i}function cc(){return[]}var dc=Object.prototype.propertyIsEnumerable,pc=Object.getOwnPropertySymbols,hc=pc?function(t){return null==t?[]:(t=Object(t),uc(pc(t),(function(e){return dc.call(t,e)})))}:cc;var fc=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Sl(e,hc(t)),t=Pl(t);return e}:cc;function gc(t,e,n){var o=e(t);return zr(t)?o:Sl(o,n(t))}function vc(t){return gc(t,Xs,hc)}function yc(t){return gc(t,qs,fc)}var mc=Mi(Sr,"DataView"),bc=Mi(Sr,"Promise"),_c=Mi(Sr,"Set"),xc="[object Map]",Ec="[object Promise]",wc="[object Set]",Sc="[object WeakMap]",Cc="[object DataView]",Oc=bi(mc),Mc=bi(ul),Tc=bi(bc),Nc=bi(_c),Ac=bi(Ti),Pc=Rr;(mc&&Pc(new mc(new ArrayBuffer(1)))!=Cc||ul&&Pc(new ul)!=xc||bc&&Pc(bc.resolve())!=Ec||_c&&Pc(new _c)!=wc||Ti&&Pc(new Ti)!=Sc)&&(Pc=function(t){var e=Rr(t),n="[object Object]"==e?t.constructor:void 0,o=n?bi(n):"";if(o)switch(o){case Oc:return Cc;case Mc:return xc;case Tc:return Ec;case Nc:return wc;case Ac:return Sc}return e});var Dc=Pc,kc=Object.prototype.hasOwnProperty;var Rc=Sr.Uint8Array;function Lc(t){var e=new t.constructor(t.byteLength);return new Rc(e).set(new Rc(t)),e}var Ic=/\w*$/;var jc=Cr?Cr.prototype:void 0,Bc=jc?jc.valueOf:void 0;function Hc(t,e){var n=e?Lc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var Fc="[object Boolean]",zc="[object Date]",Wc="[object Map]",Uc="[object Number]",Xc="[object RegExp]",Gc="[object Set]",Yc="[object String]",Vc="[object Symbol]",Kc="[object ArrayBuffer]",qc="[object DataView]",Zc="[object Float32Array]",$c="[object Float64Array]",Jc="[object Int8Array]",Qc="[object Int16Array]",td="[object Int32Array]",ed="[object Uint8Array]",nd="[object Uint8ClampedArray]",od="[object Uint16Array]",rd="[object Uint32Array]";function id(t,e,n){var o,r=t.constructor;switch(e){case Kc:return Lc(t);case Fc:case zc:return new r(+t);case qc:return function(t,e){var n=e?Lc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case Zc:case $c:case Jc:case Qc:case td:case ed:case nd:case od:case rd:return Hc(t,n);case Wc:return new r;case Uc:case Yc:return new r(t);case Xc:return function(t){var e=new t.constructor(t.source,Ic.exec(t));return e.lastIndex=t.lastIndex,e}(t);case Gc:return new r;case Vc:return o=t,Bc?Object(Bc.call(o)):{}}}function ad(t){return"function"!=typeof t.constructor||ms(t)?{}:Di(Pl(t))}var sd=Ls&&Ls.isMap,ld=sd?Ps(sd):function(t){return Lr(t)&&"[object Map]"==Dc(t)};var ud=Ls&&Ls.isSet,cd=ud?Ps(ud):function(t){return Lr(t)&&"[object Set]"==Dc(t)},dd=1,pd=2,hd=4,fd="[object Arguments]",gd="[object Function]",vd="[object GeneratorFunction]",yd="[object Object]",md={};function bd(t,e,n,o,r,i){var a,s=e&dd,l=e&pd,u=e&hd;if(n&&(a=r?n(t,o,r,i):n(t)),void 0!==a)return a;if(!Jr(t))return t;var c=zr(t);if(c){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&kc.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return qi(t,a)}else{var d=Dc(t),p=d==gd||d==vd;if(Ns(t))return lc(t,s);if(d==yd||d==fd||p&&!r){if(a=l||p?{}:ad(t),!s)return l?function(t,e){return ls(t,fc(t),e)}(t,function(t,e){return t&&ls(e,qs(e),t)}(a,t)):function(t,e){return ls(t,hc(t),e)}(t,oc(a,t))}else{if(!md[d])return r?t:{};a=id(t,d,s)}}i||(i=new nc);var h=i.get(t);if(h)return h;i.set(t,a),cd(t)?t.forEach((function(o){a.add(bd(o,e,n,o,t,i))})):ld(t)&&t.forEach((function(o,r){a.set(r,bd(o,e,n,r,t,i))}));var f=c?void 0:(u?l?yc:vc:l?qs:Xs)(t);return ca(f||t,(function(o,r){f&&(o=t[r=o]),ss(a,r,bd(o,e,n,r,t,i))})),a}md[fd]=md["[object Array]"]=md["[object ArrayBuffer]"]=md["[object DataView]"]=md["[object Boolean]"]=md["[object Date]"]=md["[object Float32Array]"]=md["[object Float64Array]"]=md["[object Int8Array]"]=md["[object Int16Array]"]=md["[object Int32Array]"]=md["[object Map]"]=md["[object Number]"]=md[yd]=md["[object RegExp]"]=md["[object Set]"]=md["[object String]"]=md["[object Symbol]"]=md["[object Uint8Array]"]=md["[object Uint8ClampedArray]"]=md["[object Uint16Array]"]=md["[object Uint32Array]"]=!0,md["[object Error]"]=md[gd]=md["[object WeakMap]"]=!1;function _d(t){return bd(t,5)}function xd(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new dl;++e<n;)this.add(t[e])}function Ed(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}function wd(t,e){return t.has(e)}xd.prototype.add=xd.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},xd.prototype.has=function(t){return this.__data__.has(t)};var Sd=1,Cd=2;function Od(t,e,n,o,r,i){var a=n&Sd,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var u=i.get(t),c=i.get(e);if(u&&c)return u==e&&c==t;var d=-1,p=!0,h=n&Cd?new xd:void 0;for(i.set(t,e),i.set(e,t);++d<s;){var f=t[d],g=e[d];if(o)var v=a?o(g,f,d,e,t,i):o(f,g,d,t,e,i);if(void 0!==v){if(v)continue;p=!1;break}if(h){if(!Ed(e,(function(t,e){if(!wd(h,e)&&(f===t||r(f,t,n,o,i)))return h.push(e)}))){p=!1;break}}else if(f!==g&&!r(f,g,n,o,i)){p=!1;break}}return i.delete(t),i.delete(e),p}function Md(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n}function Td(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Nd=1,Ad=2,Pd="[object Boolean]",Dd="[object Date]",kd="[object Error]",Rd="[object Map]",Ld="[object Number]",Id="[object RegExp]",jd="[object Set]",Bd="[object String]",Hd="[object Symbol]",Fd="[object ArrayBuffer]",zd="[object DataView]",Wd=Cr?Cr.prototype:void 0,Ud=Wd?Wd.valueOf:void 0;var Xd=1,Gd=Object.prototype.hasOwnProperty;var Yd=1,Vd="[object Arguments]",Kd="[object Array]",qd="[object Object]",Zd=Object.prototype.hasOwnProperty;function $d(t,e,n,o,r,i){var a=zr(t),s=zr(e),l=a?Kd:Dc(t),u=s?Kd:Dc(e),c=(l=l==Vd?qd:l)==qd,d=(u=u==Vd?qd:u)==qd,p=l==u;if(p&&Ns(t)){if(!Ns(e))return!1;a=!0,c=!1}if(p&&!c)return i||(i=new nc),a||js(t)?Od(t,e,n,o,r,i):function(t,e,n,o,r,i,a){switch(n){case zd:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Fd:return!(t.byteLength!=e.byteLength||!i(new Rc(t),new Rc(e)));case Pd:case Dd:case Ld:return is(+t,+e);case kd:return t.name==e.name&&t.message==e.message;case Id:case Bd:return t==e+"";case Rd:var s=Md;case jd:var l=o&Nd;if(s||(s=Td),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;o|=Ad,a.set(t,e);var c=Od(s(t),s(e),o,r,i,a);return a.delete(t),c;case Hd:if(Ud)return Ud.call(t)==Ud.call(e)}return!1}(t,e,l,n,o,r,i);if(!(n&Yd)){var h=c&&Zd.call(t,"__wrapped__"),f=d&&Zd.call(e,"__wrapped__");if(h||f){var g=h?t.value():t,v=f?e.value():e;return i||(i=new nc),r(g,v,n,o,i)}}return!!p&&(i||(i=new nc),function(t,e,n,o,r,i){var a=n&Xd,s=vc(t),l=s.length;if(l!=vc(e).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in e:Gd.call(e,c)))return!1}var d=i.get(t),p=i.get(e);if(d&&p)return d==e&&p==t;var h=!0;i.set(t,e),i.set(e,t);for(var f=a;++u<l;){var g=t[c=s[u]],v=e[c];if(o)var y=a?o(v,g,c,e,t,i):o(g,v,c,t,e,i);if(!(void 0===y?g===v||r(g,v,n,o,i):y)){h=!1;break}f||(f="constructor"==c)}if(h&&!f){var m=t.constructor,b=e.constructor;m==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(h=!1)}return i.delete(t),i.delete(e),h}(t,e,n,o,r,i))}function Jd(t,e,n,o,r){return t===e||(null==t||null==e||!Lr(t)&&!Lr(e)?t!=t&&e!=e:$d(t,e,n,o,Jd,r))}var Qd=1,tp=2;function ep(t,e,n,o){var r=n.length,i=r,a=!o;if(null==t)return!i;for(t=Object(t);r--;){var s=n[r];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++r<i;){var l=(s=n[r])[0],u=t[l],c=s[1];if(a&&s[2]){if(void 0===u&&!(l in t))return!1}else{var d=new nc;if(o)var p=o(u,c,l,t,e,d);if(!(void 0===p?Jd(c,u,Qd|tp,o,d):p))return!1}}return!0}function np(t){return t==t&&!Jr(t)}function op(t){for(var e=Xs(t),n=e.length;n--;){var o=e[n],r=t[o];e[n]=[o,r,np(r)]}return e}function rp(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function ip(t){var e=op(t);return 1==e.length&&e[0][2]?rp(e[0][0],e[0][1]):function(n){return n===t||ep(n,t,e)}}function ap(t,e){return null!=t&&e in Object(t)}function sp(t,e,n){for(var o=-1,r=(e=ml(e,t)).length,i=!1;++o<r;){var a=_l(e[o]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++o!=r?i:!!(r=null==t?0:t.length)&&hs(r)&&Ma(a,r)&&(zr(t)||Ss(t))}function lp(t,e){return null!=t&&sp(t,e,ap)}var up=1,cp=2;function dp(t,e){return el(t)&&np(e)?rp(_l(t),e):function(n){var o=El(n,t);return void 0===o&&o===e?lp(n,t):Jd(e,o,up|cp)}}function pp(t){return function(e){return null==e?void 0:e[t]}}function hp(t){return el(t)?pp(_l(t)):function(t){return function(e){return xl(e,t)}}(t)}function fp(t){return"function"==typeof t?t:null==t?ui:"object"==typeof t?zr(t)?dp(t[0],t[1]):ip(t):hp(t)}function gp(t,e,n){var o=n.length;if(null==t)return!o;for(t=Object(t);o--;){var r=n[o],i=e[r],a=t[r];if(void 0===a&&!(r in t)||!i(a))return!1}return!0}function vp(t,e,n,o){for(var r=-1,i=null==t?0:t.length;++r<i;){var a=t[r];e(o,a,n(a),t)}return o}function yp(t){return function(e,n,o){for(var r=-1,i=Object(e),a=o(e),s=a.length;s--;){var l=a[t?s:++r];if(!1===n(i[l],l,i))break}return e}}var mp=yp();function bp(t,e){return t&&mp(t,e,Xs)}function _p(t,e){return function(n,o){if(null==n)return n;if(!fs(n))return t(n,o);for(var r=n.length,i=e?r:-1,a=Object(n);(e?i--:++i<r)&&!1!==o(a[i],i,a););return n}}var xp=_p(bp);function Ep(t,e,n,o){return xp(t,(function(t,r,i){e(o,t,n(t),i)})),o}function wp(t,e){return function(n,o){var r=zr(n)?vp:Ep,i=e?e():{};return r(n,t,fp(o),i)}}var Sp=Object.prototype.hasOwnProperty,Cp=wp((function(t,e,n){Sp.call(t,n)?++t[n]:rs(t,n,1)}));function Op(t,e,n){var o=es(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return o.placeholder=Op.placeholder,o}Op.placeholder={};function Mp(t,e,n){var o=es(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return o.placeholder=Mp.placeholder,o}Mp.placeholder={};var Tp=function(){return Sr.Date.now()},Np="Expected a function",Ap=Math.max,Pp=Math.min;function Dp(t,e,n){var o,r,i,a,s,l,u=0,c=!1,d=!1,p=!0;if("function"!=typeof t)throw new TypeError(Np);function h(e){var n=o,i=r;return o=r=void 0,u=e,a=t.apply(i,n)}function f(t){var n=t-l;return void 0===l||n>=e||n<0||d&&t-u>=i}function g(){var t=Tp();if(f(t))return v(t);s=setTimeout(g,function(t){var n=e-(t-l);return d?Pp(n,i-(t-u)):n}(t))}function v(t){return s=void 0,p&&o?h(t):(o=r=void 0,a)}function y(){var t=Tp(),n=f(t);if(o=arguments,r=this,l=t,n){if(void 0===s)return function(t){return u=t,s=setTimeout(g,e),c?h(t):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,e),h(l)}return void 0===s&&(s=setTimeout(g,e)),a}return e=ri(e)||0,Jr(n)&&(c=!!n.leading,i=(d="maxWait"in n)?Ap(ri(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,o=l=r=s=void 0},y.flush=function(){return void 0===s?a:v(Tp())},y}var kp=Object.prototype,Rp=kp.hasOwnProperty,Lp=ds((function(t,e){t=Object(t);var n=-1,o=e.length,r=o>2?e[2]:void 0;for(r&&gs(e[0],e[1],r)&&(o=1);++n<o;)for(var i=e[n],a=qs(i),s=-1,l=a.length;++s<l;){var u=a[s],c=t[u];(void 0===c||is(c,kp[u])&&!Rp.call(t,u))&&(t[u]=i[u])}return t}));function Ip(t,e,n){(void 0!==n&&!is(t[e],n)||void 0===n&&!(e in t))&&rs(t,e,n)}function jp(t){return Lr(t)&&fs(t)}function Bp(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Hp(t){return ls(t,qs(t))}function Fp(t,e,n,o,r){t!==e&&mp(e,(function(i,a){if(r||(r=new nc),Jr(i))!function(t,e,n,o,r,i,a){var s=Bp(t,n),l=Bp(e,n),u=a.get(l);if(u)Ip(t,n,u);else{var c=i?i(s,l,n+"",t,e,a):void 0,d=void 0===c;if(d){var p=zr(l),h=!p&&Ns(l),f=!p&&!h&&js(l);c=l,p||h||f?zr(s)?c=s:jp(s)?c=qi(s):h?(d=!1,c=lc(l,!0)):f?(d=!1,c=Hc(l,!0)):c=[]:Bl(l)||Ss(l)?(c=s,Ss(s)?c=Hp(s):Jr(s)&&!fi(s)||(c=ad(l))):d=!1}d&&(a.set(l,c),r(c,l,o,i,a),a.delete(l)),Ip(t,n,c)}}(t,e,a,n,Fp,o,r);else{var s=o?o(Bp(t,a),i,a+"",t,e,r):void 0;void 0===s&&(s=i),Ip(t,a,s)}}),qs)}function zp(t,e,n,o,r,i){return Jr(t)&&Jr(e)&&(i.set(e,t),Fp(t,e,void 0,zp,i),i.delete(e)),t}var Wp=vs((function(t,e,n,o){Fp(t,e,n,o)})),Up=ds((function(t){return t.push(void 0,zp),Li(Wp,void 0,t)}));function Xp(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}var Gp=ds((function(t,e){return Xp(t,1,e)})),Yp=ds((function(t,e,n){return Xp(t,ri(e)||0,n)}));function Vp(t,e,n){for(var o=-1,r=null==t?0:t.length;++o<r;)if(n(e,t[o]))return!0;return!1}var Kp=200;function qp(t,e,n,o){var r=-1,i=fa,a=!0,s=t.length,l=[],u=e.length;if(!s)return l;n&&(e=Fr(e,Ps(n))),o?(i=Vp,a=!1):e.length>=Kp&&(i=wd,a=!1,e=new xd(e));t:for(;++r<s;){var c=t[r],d=null==n?c:n(c);if(c=o||0!==c?c:0,a&&d==d){for(var p=u;p--;)if(e[p]===d)continue t;l.push(c)}else i(e,d,o)||l.push(c)}return l}var Zp=ds((function(t,e){return jp(t)?qp(t,Ml(e,1,jp,!0)):[]}));function $p(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var Jp=ds((function(t,e){var n=$p(e);return jp(n)&&(n=void 0),jp(t)?qp(t,Ml(e,1,jp,!0),fp(n)):[]})),Qp=ds((function(t,e){var n=$p(e);return jp(n)&&(n=void 0),jp(t)?qp(t,Ml(e,1,jp,!0),void 0,n):[]})),th=Yr((function(t,e){return t/e}),1);function eh(t,e,n,o){for(var r=t.length,i=o?r:-1;(o?i--:++i<r)&&e(t[i],i,t););return n?Kl(t,o?0:i,o?i+1:r):Kl(t,o?i+1:0,o?r:i)}function nh(t){return"function"==typeof t?t:ui}function oh(t,e){return(zr(t)?ca:xp)(t,nh(e))}function rh(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}var ih=yp(!0);function ah(t,e){return t&&ih(t,e,Xs)}var sh=_p(ah,!0);function lh(t,e){return(zr(t)?rh:sh)(t,nh(e))}function uh(t){return function(e){var n=Dc(e);return"[object Map]"==n?Md(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 Fr(e,(function(e){return[e,t[e]]}))}(e,t(e))}}var ch=uh(Xs),dh=uh(qs),ph=gu({"&":"&","<":"<",">":">",'"':""","'":"'"}),hh=/[&<>"']/g,fh=RegExp(hh.source);function gh(t){return(t=yl(t))&&fh.test(t)?t.replace(hh,ph):t}var vh=/[\\^$.*+?()[\]{}|]/g,yh=RegExp(vh.source);function mh(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(!e(t[n],n,t))return!1;return!0}function bh(t,e){var n=!0;return xp(t,(function(t,o,r){return n=!!e(t,o,r)})),n}var _h=4294967295;function xh(t){return t?ec(li(t),0,_h):0}function Eh(t,e){var n=[];return xp(t,(function(t,o,r){e(t,o,r)&&n.push(t)})),n}function wh(t){return function(e,n,o){var r=Object(e);if(!fs(e)){var i=fp(n);e=Xs(e),n=function(t){return i(r[t],t,r)}}var a=t(e,n,o);return a>-1?r[i?e[a]:a]:void 0}}var Sh=Math.max;function Ch(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var r=null==n?0:li(n);return r<0&&(r=Sh(o+r,0)),da(t,fp(e),r)}var Oh=wh(Ch);function Mh(t,e,n){var o;return n(t,(function(t,n,r){if(e(t,n,r))return o=n,!1})),o}var Th=Math.max,Nh=Math.min;function Ah(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var r=o-1;return void 0!==n&&(r=li(n),r=n<0?Th(o+r,0):Nh(r,o-1)),da(t,fp(e),r,!0)}var Ph=wh(Ah);function Dh(t){return t&&t.length?t[0]:void 0}function kh(t,e){var n=-1,o=fs(t)?Array(t.length):[];return xp(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}function Rh(t,e){return(zr(t)?Fr:kh)(t,fp(e))}var Lh=1/0;var Ih=1/0;var jh=Zu("floor");function Bh(t){return Nl((function(e){var n=e.length,o=n,r=Ki.prototype.thru;for(t&&e.reverse();o--;){var i=e[o];if("function"!=typeof i)throw new TypeError("Expected a function");if(r&&!a&&"wrapper"==Vi(i))var a=new Ki([],!0)}for(o=a?o:n;++o<n;){var s=Vi(i=e[o]),l="wrapper"==s?Xi(i):void 0;a=l&&Qi(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[Vi(l[0])].apply(a,l[3]):1==i.length&&Qi(i)?a[s]():a.thru(i)}return function(){var t=arguments,o=t[0];if(a&&1==t.length&&zr(o))return a.plant(o).value();for(var r=0,i=n?e[r].apply(this,t):o;++r<n;)i=e[r].call(this,i);return i}}))}var Hh=Bh(),Fh=Bh(!0);function zh(t,e){return uc(e,(function(e){return fi(t[e])}))}var Wh=Object.prototype.hasOwnProperty,Uh=wp((function(t,e,n){Wh.call(t,n)?t[n].push(e):rs(t,n,[e])}));function Xh(t,e){return t>e}function Gh(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ri(e),n=ri(n)),t(e,n)}}var Yh=Gh(Xh),Vh=Gh((function(t,e){return t>=e})),Kh=Object.prototype.hasOwnProperty;function qh(t,e){return null!=t&&Kh.call(t,e)}function Zh(t,e){return null!=t&&sp(t,e,qh)}var $h=Math.max,Jh=Math.min;var Qh="[object String]";function tf(t){return"string"==typeof t||!zr(t)&&Lr(t)&&Rr(t)==Qh}function ef(t,e){return Fr(e,(function(e){return t[e]}))}function nf(t){return null==t?[]:ef(t,Xs(t))}var of=Math.max;var rf=Math.max;function af(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var r=null==n?0:li(n);return r<0&&(r=rf(o+r,0)),ha(t,e,r)}var sf=Math.min;function lf(t,e,n){for(var o=n?Vp:fa,r=t[0].length,i=t.length,a=i,s=Array(i),l=1/0,u=[];a--;){var c=t[a];a&&e&&(c=Fr(c,Ps(e))),l=sf(c.length,l),s[a]=!n&&(e||r>=120&&c.length>=120)?new xd(a&&c):void 0}c=t[0];var d=-1,p=s[0];t:for(;++d<r&&u.length<l;){var h=c[d],f=e?e(h):h;if(h=n||0!==h?h:0,!(p?wd(p,f):o(u,f,n))){for(a=i;--a;){var g=s[a];if(!(g?wd(g,f):o(t[a],f,n)))continue t}p&&p.push(f),u.push(h)}}return u}function uf(t){return jp(t)?t:[]}var cf=ds((function(t){var e=Fr(t,uf);return e.length&&e[0]===t[0]?lf(e):[]})),df=ds((function(t){var e=$p(t),n=Fr(t,uf);return e===$p(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?lf(n,fp(e)):[]})),pf=ds((function(t){var e=$p(t),n=Fr(t,uf);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?lf(n,void 0,e):[]}));function hf(t,e){return function(n,o){return function(t,e,n,o){return bp(t,(function(t,r,i){e(o,n(t),r,i)})),o}(n,t,e(o),{})}}var ff=Object.prototype.toString,gf=hf((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=ff.call(e)),t[e]=n}),aa(ui)),vf=Object.prototype,yf=vf.hasOwnProperty,mf=vf.toString,bf=hf((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=mf.call(e)),yf.call(t,e)?t[e].push(n):t[e]=[n]}),fp);function _f(t,e){return e.length<2?t:xl(t,Kl(e,0,-1))}function xf(t,e,n){var o=null==(t=_f(t,e=ml(e,t)))?t:t[_l($p(e))];return null==o?void 0:Li(o,t,n)}var Ef=ds(xf),wf=ds((function(t,e,n){var o=-1,r="function"==typeof e,i=fs(t)?Array(t.length):[];return xp(t,(function(t){i[++o]=r?Li(e,t,n):xf(t,e,n)})),i}));var Sf=Ls&&Ls.isArrayBuffer,Cf=Sf?Ps(Sf):function(t){return Lr(t)&&"[object ArrayBuffer]"==Rr(t)};function Of(t){return!0===t||!1===t||Lr(t)&&"[object Boolean]"==Rr(t)}var Mf=Ls&&Ls.isDate,Tf=Mf?Ps(Mf):function(t){return Lr(t)&&"[object Date]"==Rr(t)};var Nf="[object Map]",Af="[object Set]",Pf=Object.prototype.hasOwnProperty;function Df(t){if(null==t)return!0;if(fs(t)&&(zr(t)||"string"==typeof t||"function"==typeof t.splice||Ns(t)||js(t)||Ss(t)))return!t.length;var e=Dc(t);if(e==Nf||e==Af)return!t.size;if(ms(t))return!Us(t).length;for(var n in t)if(Pf.call(t,n))return!1;return!0}function kf(t,e){return Jd(t,e)}var Rf=Sr.isFinite;function Lf(t){return"number"==typeof t&&t==li(t)}var If="[object Number]";function jf(t){return"number"==typeof t||Lr(t)&&Rr(t)==If}var Bf=vi?fi:Cs;function Hf(t){return null==t}var Ff=Ls&&Ls.isRegExp,zf=Ff?Ps(Ff):function(t){return Lr(t)&&"[object RegExp]"==Rr(t)},Wf=9007199254740991;function Uf(t){return void 0===t}var Xf=Array.prototype.join;var Gf=Yu((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Yf=wp((function(t,e,n){rs(t,n,e)}));var Vf=Math.max,Kf=Math.min;var qf=Yu((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Zf=du("toLowerCase");function $f(t,e){return t<e}var Jf=Gh($f),Qf=Gh((function(t,e){return t<=e}));function tg(t,e){var n={};return e=fp(e),bp(t,(function(t,o,r){rs(n,e(t,o,r),t)})),n}function eg(t,e,n){for(var o=-1,r=t.length;++o<r;){var i=t[o],a=e(i);if(null!=a&&(void 0===s?a==a&&!jr(a):n(a,s)))var s=a,l=i}return l}function ng(t,e){for(var n,o=-1,r=t.length;++o<r;){var i=e(t[o]);void 0!==i&&(n=void 0===n?i:n+i)}return n}var og=NaN;function rg(t,e){var n=null==t?0:t.length;return n?ng(t,e)/n:og}var ig=vs((function(t,e,n){Fp(t,e,n)})),ag=ds((function(t,e){return function(n){return xf(n,t,e)}})),sg=ds((function(t,e){return function(n){return xf(t,n,e)}}));function lg(t,e,n){var o=Xs(e),r=zh(e,o),i=!(Jr(n)&&"chain"in n&&!n.chain),a=fi(t);return ca(r,(function(n){var o=e[n];t[n]=o,a&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=qi(this.__actions__)).push({func:o,args:arguments,thisArg:t}),n.__chain__=e,n}return o.apply(t,Sl([this.value()],arguments))})})),t}var ug=Yr((function(t,e){return t*e}),1),cg="Expected a function";function dg(t){if("function"!=typeof t)throw new TypeError(cg);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 pg="[object Map]",hg="[object Set]",fg=Cr?Cr.iterator:void 0;function gg(t){if(!t)return[];if(fs(t))return tf(t)?cu(t):qi(t);if(fg&&t[fg])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[fg]());var e=Dc(t);return(e==pg?Md:e==hg?Td:nf)(t)}function vg(t,e){var n=t.length;if(n)return Ma(e+=e<0?n:0,n)?t[e]:void 0}function yg(t,e){return null==(t=_f(t,e=ml(e,t)))||delete t[_l($p(e))]}function mg(t){return Bl(t)?void 0:t}var bg=Nl((function(t,e){var n={};if(null==t)return n;var o=!1;e=Fr(e,(function(e){return e=ml(e,t),o||(o=e.length>1),e})),ls(t,yc(t),n),o&&(n=bd(n,7,mg));for(var r=e.length;r--;)yg(n,e[r]);return n}));function _g(t,e,n,o){if(!Jr(t))return t;for(var r=-1,i=(e=ml(e,t)).length,a=i-1,s=t;null!=s&&++r<i;){var l=_l(e[r]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(r!=a){var c=s[l];void 0===(u=o?o(c,l,s):void 0)&&(u=Jr(c)?c:Ma(e[r+1])?[]:{})}ss(s,l,u),s=s[l]}return t}function xg(t,e,n){for(var o=-1,r=e.length,i={};++o<r;){var a=e[o],s=xl(t,a);n(s,a)&&_g(i,ml(a,t),s)}return i}function Eg(t,e){if(null==t)return{};var n=Fr(yc(t),(function(t){return[t]}));return e=fp(e),xg(t,n,(function(t,n){return e(t,n[0])}))}function wg(t,e){if(t!==e){var n=void 0!==t,o=null===t,r=t==t,i=jr(t),a=void 0!==e,s=null===e,l=e==e,u=jr(e);if(!s&&!u&&!i&&t>e||i&&a&&l&&!s&&!u||o&&a&&l||!n&&l||!r)return 1;if(!o&&!i&&!u&&t<e||u&&n&&r&&!o&&!i||s&&n&&r||!a&&r||!l)return-1}return 0}function Sg(t,e,n){e=e.length?Fr(e,(function(t){return zr(t)?function(e){return xl(e,1===t.length?t[0]:t)}:t})):[ui];var o=-1;e=Fr(e,Ps(fp));var r=kh(t,(function(t,n,r){var i=Fr(e,(function(e){return e(t)}));return{criteria:i,index:++o,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(r,(function(t,e){return function(t,e,n){for(var o=-1,r=t.criteria,i=e.criteria,a=r.length,s=n.length;++o<a;){var l=wg(r[o],i[o]);if(l)return o>=s?l:l*("desc"==n[o]?-1:1)}return t.index-e.index}(t,e,n)}))}function Cg(t){return Nl((function(e){return e=Fr(e,Ps(fp)),ds((function(n){var o=this;return t(e,(function(t){return Li(t,o,n)}))}))}))}var Og=Cg(Fr),Mg=ds,Tg=Math.min,Ng=Mg((function(t,e){var n=(e=1==e.length&&zr(e[0])?Fr(e[0],Ps(fp)):Fr(Ml(e,1),Ps(fp))).length;return ds((function(o){for(var r=-1,i=Tg(o.length,n);++r<i;)o[r]=e[r].call(this,o[r]);return Li(t,this,o)}))})),Ag=Cg(mh),Pg=Cg(Ed),Dg=9007199254740991,kg=Math.floor;function Rg(t,e){var n="";if(!t||e<1||e>Dg)return n;do{e%2&&(n+=t),(e=kg(e/2))&&(t+=t)}while(e);return n}var Lg=pp("length"),Ig="\\ud800-\\udfff",jg="["+Ig+"]",Bg="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Hg="\\ud83c[\\udffb-\\udfff]",Fg="[^"+Ig+"]",zg="(?:\\ud83c[\\udde6-\\uddff]){2}",Wg="[\\ud800-\\udbff][\\udc00-\\udfff]",Ug="(?:"+Bg+"|"+Hg+")"+"?",Xg="[\\ufe0e\\ufe0f]?",Gg=Xg+Ug+("(?:\\u200d(?:"+[Fg,zg,Wg].join("|")+")"+Xg+Ug+")*"),Yg="(?:"+[Fg+Bg+"?",Bg,zg,Wg,jg].join("|")+")",Vg=RegExp(Hg+"(?="+Hg+")|"+Yg+Gg,"g");function Kg(t){return $l(t)?function(t){for(var e=Vg.lastIndex=0;Vg.test(t);)++e;return e}(t):Lg(t)}var qg=Math.ceil;function Zg(t,e){var n=(e=void 0===e?" ":Gr(e)).length;if(n<2)return n?Rg(e,t):e;var o=Rg(e,qg(t/Kg(e)));return $l(e)?ql(cu(o),0,t).join(""):o.slice(0,t)}var $g=Math.ceil,Jg=Math.floor;var Qg=/^\s+/,tv=Sr.parseInt;var ev=ds((function(t,e){return es(t,32,void 0,e,Aa(e,Sa(ev)))}));ev.placeholder={};var nv=ds((function(t,e){return es(t,64,void 0,e,Aa(e,Sa(nv)))}));nv.placeholder={};var ov=wp((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var rv=Nl((function(t,e){return null==t?{}:function(t,e){return xg(t,e,(function(e,n){return lp(t,n)}))}(t,e)}));function iv(t,e,n,o){for(var r=n-1,i=t.length;++r<i;)if(o(t[r],e))return r;return-1}var av=Array.prototype.splice;function sv(t,e,n,o){var r=o?iv:ha,i=-1,a=e.length,s=t;for(t===e&&(e=qi(e)),n&&(s=Fr(t,Ps(n)));++i<a;)for(var l=0,u=e[i],c=n?n(u):u;(l=r(s,c,l,o))>-1;)s!==t&&av.call(s,l,1),av.call(t,l,1);return t}function lv(t,e){return t&&t.length&&e&&e.length?sv(t,e):t}var uv=ds(lv);var cv=Array.prototype.splice;function dv(t,e){for(var n=t?e.length:0,o=n-1;n--;){var r=e[n];if(n==o||r!==i){var i=r;Ma(r)?cv.call(t,r,1):yg(t,r)}}return t}var pv=Nl((function(t,e){var n=null==t?0:t.length,o=wl(t,e);return dv(t,Fr(e,(function(t){return Ma(t,n)?+t:t})).sort(wg)),o})),hv=Math.floor,fv=Math.random;function gv(t,e){return t+hv(fv()*(e-t+1))}var vv=parseFloat,yv=Math.min,mv=Math.random;var bv=Math.ceil,_v=Math.max;function xv(t){return function(e,n,o){return o&&"number"!=typeof o&&gs(e,n,o)&&(n=o=void 0),e=si(e),void 0===n?(n=e,e=0):n=si(n),function(t,e,n,o){for(var r=-1,i=_v(bv((e-t)/(n||1)),0),a=Array(i);i--;)a[o?i:++r]=t,t+=n;return a}(e,n,o=void 0===o?e<n?1:-1:si(o),t)}}var Ev=xv(),wv=xv(!0),Sv=Nl((function(t,e){return es(t,256,void 0,void 0,void 0,e)}));function Cv(t,e,n,o,r){return r(t,(function(t,r,i){n=o?(o=!1,t):e(n,t,r,i)})),n}function Ov(t,e,n){var o=zr(t)?fu:Cv,r=arguments.length<3;return o(t,fp(e),n,r,xp)}function Mv(t,e,n,o){var r=null==t?0:t.length;for(o&&r&&(n=t[--r]);r--;)n=e(n,t[r],r,t);return n}var Tv=Array.prototype.reverse;function Nv(t){return null==t?t:Tv.call(t)}var Av=Zu("round");function Pv(t){var e=t.length;return e?t[gv(0,e-1)]:void 0}function Dv(t){return Pv(nf(t))}function kv(t,e){var n=-1,o=t.length,r=o-1;for(e=void 0===e?o:e;++n<e;){var i=gv(n,r),a=t[i];t[i]=t[n],t[n]=a}return t.length=e,t}function Rv(t,e){return kv(qi(t),ec(e,0,t.length))}function Lv(t,e){var n=nf(t);return kv(n,ec(e,0,n.length))}function Iv(t){return kv(qi(t))}function jv(t){return kv(nf(t))}var Bv=Yu((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function Hv(t,e){var n;return xp(t,(function(t,o,r){return!(n=e(t,o,r))})),!!n}var Fv=ds((function(t,e){if(null==t)return[];var n=e.length;return n>1&&gs(t,e[0],e[1])?e=[]:n>2&&gs(e[0],e[1],e[2])&&(e=[e[0]]),Sg(t,Ml(e,1),[])})),zv=4294967294,Wv=Math.floor,Uv=Math.min;function Xv(t,e,n,o){var r=0,i=null==t?0:t.length;if(0===i)return 0;for(var a=(e=n(e))!=e,s=null===e,l=jr(e),u=void 0===e;r<i;){var c=Wv((r+i)/2),d=n(t[c]),p=void 0!==d,h=null===d,f=d==d,g=jr(d);if(a)var v=o||f;else v=u?f&&(o||p):s?f&&p&&(o||!h):l?f&&p&&!h&&(o||!g):!h&&!g&&(o?d<=e:d<e);v?r=c+1:i=c}return Uv(i,zv)}var Gv=2147483647;function Yv(t,e,n){var o=0,r=null==t?o:t.length;if("number"==typeof e&&e==e&&r<=Gv){for(;o<r;){var i=o+r>>>1,a=t[i];null!==a&&!jr(a)&&(n?a<=e:a<e)?o=i+1:r=i}return r}return Xv(t,e,ui,n)}function Vv(t,e){for(var n=-1,o=t.length,r=0,i=[];++n<o;){var a=t[n],s=e?e(a):a;if(!n||!is(s,l)){var l=s;i[r++]=0===a?0:a}}return i}var Kv=Math.max;var qv=Yu((function(t,e,n){return t+(n?" ":"")+pu(e)}));var Zv=Yr((function(t,e){return t-e}),0);var $v=Object.prototype,Jv=$v.hasOwnProperty;function Qv(t,e,n,o){return void 0===t||is(t,$v[n])&&!Jv.call(o,n)?e:t}var ty={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function ey(t){return"\\"+ty[t]}var ny=/<%=([\s\S]+?)%>/g,oy={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:ny,variable:"",imports:{_:{escape:gh}}},ry=/\b__p \+= '';/g,iy=/\b(__p \+=) '' \+/g,ay=/(__e\(.*?\)|\b__t\)) \+\n'';/g,sy=/[()=,{}\[\]\/\s]/,ly=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,uy=/($^)/,cy=/['\n\r\u2028\u2029\\]/g,dy=Object.prototype.hasOwnProperty;function py(t,e,n){var o=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return Jr(n)&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),Dp(t,e,{leading:o,maxWait:e,trailing:r})}function hy(t,e){return e(t)}var fy=4294967295,gy=Math.min;function vy(t,e){var n=t;return n instanceof Wi&&(n=n.value()),fu(e,(function(t,e){return e.func.apply(e.thisArg,Sl([t],e.args))}),n)}function yy(){return vy(this.__wrapped__,this.__actions__)}var my=9007199254740991;function by(t,e){for(var n=t.length;n--&&ha(e,t[n],0)>-1;);return n}function _y(t,e){for(var n=-1,o=t.length;++n<o&&ha(e,t[n],0)>-1;);return n}var xy=/^\s+/;var Ey=/\w*$/;var wy=gu({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Sy=/&(?:amp|lt|gt|quot|#39);/g,Cy=RegExp(Sy.source);var Oy=_c&&1/Td(new _c([,-0]))[1]==1/0?function(t){return new _c(t)}:Ui,My=200;function Ty(t,e,n){var o=-1,r=fa,i=t.length,a=!0,s=[],l=s;if(n)a=!1,r=Vp;else if(i>=My){var u=e?null:Oy(t);if(u)return Td(u);a=!1,r=wd,l=new xd}else l=e?[]:s;t:for(;++o<i;){var c=t[o],d=e?e(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var p=l.length;p--;)if(l[p]===d)continue t;e&&l.push(d),s.push(c)}else r(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}var Ny=ds((function(t){return Ty(Ml(t,1,jp,!0))})),Ay=ds((function(t){var e=$p(t);return jp(e)&&(e=void 0),Ty(Ml(t,1,jp,!0),fp(e))})),Py=ds((function(t){var e=$p(t);return e="function"==typeof e?e:void 0,Ty(Ml(t,1,jp,!0),void 0,e)}));var Dy=0;var ky=Math.max;function Ry(t){if(!t||!t.length)return[];var e=0;return t=uc(t,(function(t){if(jp(t))return e=ky(t.length,e),!0})),bs(e,(function(e){return Fr(t,pp(e))}))}function Ly(t,e){if(!t||!t.length)return[];var n=Ry(t);return null==e?n:Fr(n,(function(t){return Li(e,void 0,t)}))}function Iy(t,e,n,o){return _g(t,e,n(xl(t,e)),o)}var jy=Yu((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}));var By=ds((function(t,e){return jp(t)?qp(t,e):[]}));var Hy=Nl((function(t){var e=t.length,n=e?t[0]:0,o=this.__wrapped__,r=function(e){return wl(e,t)};return!(e>1||this.__actions__.length)&&o instanceof Wi&&Ma(n)?((o=o.slice(n,+n+(e?1:0))).__actions__.push({func:hy,args:[r],thisArg:void 0}),new Ki(o,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(r)}));function Fy(t,e,n){var o=t.length;if(o<2)return o?Ty(t[0]):[];for(var r=-1,i=Array(o);++r<o;)for(var a=t[r],s=-1;++s<o;)s!=r&&(i[r]=qp(i[r]||a,t[s],e,n));return Ty(Ml(i,1),e,n)}var zy=ds((function(t){return Fy(uc(t,jp))})),Wy=ds((function(t){var e=$p(t);return jp(e)&&(e=void 0),Fy(uc(t,jp),fp(e))})),Uy=ds((function(t){var e=$p(t);return e="function"==typeof e?e:void 0,Fy(uc(t,jp),void 0,e)})),Xy=ds(Ry);function Gy(t,e,n){for(var o=-1,r=t.length,i=e.length,a={};++o<r;){var s=o<i?e[o]:void 0;n(a,t[o],s)}return a}var Yy=ds((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Ly(t,n)})),Vy={chunk:function(t,e,n){e=(n?gs(t,e,n):void 0===e)?1:tc(li(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var r=0,i=0,a=Array(Qu(o/e));r<o;)a[i++]=Kl(t,r,r+=e);return a},compact:function(t){for(var e=-1,n=null==t?0:t.length,o=0,r=[];++e<n;){var i=t[e];i&&(r[o++]=i)}return r},concat:function(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],o=t;o--;)e[o-1]=arguments[o];return Sl(zr(n)?qi(n):[n],Ml(e,1))},difference:Zp,differenceBy:Jp,differenceWith:Qp,drop:function(t,e,n){var o=null==t?0:t.length;return o?Kl(t,(e=n||void 0===e?1:li(e))<0?0:e,o):[]},dropRight:function(t,e,n){var o=null==t?0:t.length;return o?Kl(t,0,(e=o-(e=n||void 0===e?1:li(e)))<0?0:e):[]},dropRightWhile:function(t,e){return t&&t.length?eh(t,fp(e),!0,!0):[]},dropWhile:function(t,e){return t&&t.length?eh(t,fp(e),!0):[]},fill:function(t,e,n,o){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&gs(t,e,n)&&(n=0,o=r),function(t,e,n,o){var r=t.length;for((n=li(n))<0&&(n=-n>r?0:r+n),(o=void 0===o||o>r?r:li(o))<0&&(o+=r),o=n>o?0:xh(o);n<o;)t[n++]=e;return t}(t,e,n,o)):[]},findIndex:Ch,findLastIndex:Ah,first:Dh,flatten:Tl,flattenDeep:function(t){return(null==t?0:t.length)?Ml(t,Ih):[]},flattenDepth:function(t,e){return(null==t?0:t.length)?Ml(t,e=void 0===e?1:li(e)):[]},fromPairs:function(t){for(var e=-1,n=null==t?0:t.length,o={};++e<n;){var r=t[e];o[r[0]]=r[1]}return o},head:Dh,indexOf:af,initial:function(t){return(null==t?0:t.length)?Kl(t,0,-1):[]},intersection:cf,intersectionBy:df,intersectionWith:pf,join:function(t,e){return null==t?"":Xf.call(t,e)},last:$p,lastIndexOf:function(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var r=o;return void 0!==n&&(r=(r=li(n))<0?Vf(o+r,0):Kf(r,o-1)),e==e?function(t,e,n){for(var o=n+1;o--;)if(t[o]===e)return o;return o}(t,e,r):da(t,pa,r,!0)},nth:function(t,e){return t&&t.length?vg(t,li(e)):void 0},pull:uv,pullAll:lv,pullAllBy:function(t,e,n){return t&&t.length&&e&&e.length?sv(t,e,fp(n)):t},pullAllWith:function(t,e,n){return t&&t.length&&e&&e.length?sv(t,e,void 0,n):t},pullAt:pv,remove:function(t,e){var n=[];if(!t||!t.length)return n;var o=-1,r=[],i=t.length;for(e=fp(e);++o<i;){var a=t[o];e(a,o,t)&&(n.push(a),r.push(o))}return dv(t,r),n},reverse:Nv,slice:function(t,e,n){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&gs(t,e,n)?(e=0,n=o):(e=null==e?0:li(e),n=void 0===n?o:li(n)),Kl(t,e,n)):[]},sortedIndex:function(t,e){return Yv(t,e)},sortedIndexBy:function(t,e,n){return Xv(t,e,fp(n))},sortedIndexOf:function(t,e){var n=null==t?0:t.length;if(n){var o=Yv(t,e);if(o<n&&is(t[o],e))return o}return-1},sortedLastIndex:function(t,e){return Yv(t,e,!0)},sortedLastIndexBy:function(t,e,n){return Xv(t,e,fp(n),!0)},sortedLastIndexOf:function(t,e){if(null==t?0:t.length){var n=Yv(t,e,!0)-1;if(is(t[n],e))return n}return-1},sortedUniq:function(t){return t&&t.length?Vv(t):[]},sortedUniqBy:function(t,e){return t&&t.length?Vv(t,fp(e)):[]},tail:function(t){var e=null==t?0:t.length;return e?Kl(t,1,e):[]},take:function(t,e,n){return t&&t.length?Kl(t,0,(e=n||void 0===e?1:li(e))<0?0:e):[]},takeRight:function(t,e,n){var o=null==t?0:t.length;return o?Kl(t,(e=o-(e=n||void 0===e?1:li(e)))<0?0:e,o):[]},takeRightWhile:function(t,e){return t&&t.length?eh(t,fp(e),!1,!0):[]},takeWhile:function(t,e){return t&&t.length?eh(t,fp(e)):[]},union:Ny,unionBy:Ay,unionWith:Py,uniq:function(t){return t&&t.length?Ty(t):[]},uniqBy:function(t,e){return t&&t.length?Ty(t,fp(e)):[]},uniqWith:function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Ty(t,void 0,e):[]},unzip:Ry,unzipWith:Ly,without:By,xor:zy,xorBy:Wy,xorWith:Uy,zip:Xy,zipObject:function(t,e){return Gy(t||[],e||[],ss)},zipObjectDeep:function(t,e){return Gy(t||[],e||[],_g)},zipWith:Yy},Ky={countBy:Cp,each:oh,eachRight:lh,every:function(t,e,n){var o=zr(t)?mh:bh;return n&&gs(t,e,n)&&(e=void 0),o(t,fp(e))},filter:function(t,e){return(zr(t)?uc:Eh)(t,fp(e))},find:Oh,findLast:Ph,flatMap:function(t,e){return Ml(Rh(t,e),1)},flatMapDeep:function(t,e){return Ml(Rh(t,e),Lh)},flatMapDepth:function(t,e,n){return n=void 0===n?1:li(n),Ml(Rh(t,e),n)},forEach:oh,forEachRight:lh,groupBy:Uh,includes:function(t,e,n,o){t=fs(t)?t:nf(t),n=n&&!o?li(n):0;var r=t.length;return n<0&&(n=of(r+n,0)),tf(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&ha(t,e,n)>-1},invokeMap:wf,keyBy:Yf,map:Rh,orderBy:function(t,e,n,o){return null==t?[]:(zr(e)||(e=null==e?[]:[e]),zr(n=o?void 0:n)||(n=null==n?[]:[n]),Sg(t,e,n))},partition:ov,reduce:Ov,reduceRight:function(t,e,n){var o=zr(t)?Mv:Cv,r=arguments.length<3;return o(t,fp(e),n,r,sh)},reject:function(t,e){return(zr(t)?uc:Eh)(t,dg(fp(e)))},sample:function(t){return(zr(t)?Pv:Dv)(t)},sampleSize:function(t,e,n){return e=(n?gs(t,e,n):void 0===e)?1:li(e),(zr(t)?Rv:Lv)(t,e)},shuffle:function(t){return(zr(t)?Iv:jv)(t)},size:function(t){if(null==t)return 0;if(fs(t))return tf(t)?Kg(t):t.length;var e=Dc(t);return"[object Map]"==e||"[object Set]"==e?t.size:Us(t).length},some:function(t,e,n){var o=zr(t)?Ed:Hv;return n&&gs(t,e,n)&&(e=void 0),o(t,fp(e))},sortBy:Fv},qy=Tp,Zy={after:function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=li(t),function(){if(--t<1)return e.apply(this,arguments)}},ary:os,before:Xl,bind:Gl,bindKey:Vl,curry:Op,curryRight:Mp,debounce:Dp,defer:Gp,delay:Yp,flip:function(t){return es(t,512)},memoize:hl,negate:dg,once:function(t){return Xl(2,t)},overArgs:Ng,partial:ev,partialRight:nv,rearg:Sv,rest:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return ds(t,e=void 0===e?e:li(e))},spread:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:Kv(li(e),0),ds((function(n){var o=n[e],r=ql(n,0,e);return o&&Sl(r,o),Li(t,this,r)}))},throttle:py,unary:function(t){return os(t,1)},wrap:function(t,e){return ev(nh(e),t)}},$y={castArray:function(){if(!arguments.length)return[];var t=arguments[0];return zr(t)?t:[t]},clone:function(t){return bd(t,4)},cloneDeep:_d,cloneDeepWith:function(t,e){return bd(t,5,e="function"==typeof e?e:void 0)},cloneWith:function(t,e){return bd(t,4,e="function"==typeof e?e:void 0)},conformsTo:function(t,e){return null==e||gp(t,e,Xs(e))},eq:is,gt:Yh,gte:Vh,isArguments:Ss,isArray:zr,isArrayBuffer:Cf,isArrayLike:fs,isArrayLikeObject:jp,isBoolean:Of,isBuffer:Ns,isDate:Tf,isElement:function(t){return Lr(t)&&1===t.nodeType&&!Bl(t)},isEmpty:Df,isEqual:kf,isEqualWith:function(t,e,n){var o=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===o?Jd(t,e,void 0,n):!!o},isError:zl,isFinite:function(t){return"number"==typeof t&&Rf(t)},isFunction:fi,isInteger:Lf,isLength:hs,isMap:ld,isMatch:function(t,e){return t===e||ep(t,e,op(e))},isMatchWith:function(t,e,n){return n="function"==typeof n?n:void 0,ep(t,e,op(e),n)},isNaN:function(t){return jf(t)&&t!=+t},isNative:function(t){if(Bf(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Oi(t)},isNil:Hf,isNull:function(t){return null===t},isNumber:jf,isObject:Jr,isObjectLike:Lr,isPlainObject:Bl,isRegExp:zf,isSafeInteger:function(t){return Lf(t)&&t>=-9007199254740991&&t<=Wf},isSet:cd,isString:tf,isSymbol:jr,isTypedArray:js,isUndefined:Uf,isWeakMap:function(t){return Lr(t)&&"[object WeakMap]"==Dc(t)},isWeakSet:function(t){return Lr(t)&&"[object WeakSet]"==Rr(t)},lt:Jf,lte:Qf,toArray:gg,toFinite:si,toInteger:li,toLength:xh,toNumber:ri,toPlainObject:Hp,toSafeInteger:function(t){return t?ec(li(t),-9007199254740991,my):0===t?t:0},toString:yl},Jy={add:Vr,ceil:$u,divide:th,floor:jh,max:function(t){return t&&t.length?eg(t,ui,Xh):void 0},maxBy:function(t,e){return t&&t.length?eg(t,fp(e),Xh):void 0},mean:function(t){return rg(t,ui)},meanBy:function(t,e){return rg(t,fp(e))},min:function(t){return t&&t.length?eg(t,ui,$f):void 0},minBy:function(t,e){return t&&t.length?eg(t,fp(e),$f):void 0},multiply:ug,round:Av,subtract:Zv,sum:function(t){return t&&t.length?ng(t,ui):0},sumBy:function(t,e){return t&&t.length?ng(t,fp(e)):0}},Qy=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=ri(n))==n?n:0),void 0!==e&&(e=(e=ri(e))==e?e:0),ec(ri(t),e,n)},tm=function(t,e,n){return e=si(e),void 0===n?(n=e,e=0):n=si(n),function(t,e,n){return t>=Jh(e,n)&&t<$h(e,n)}(t=ri(t),e,n)},em=function(t,e,n){if(n&&"boolean"!=typeof n&&gs(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=si(t),void 0===e?(e=t,t=0):e=si(e)),t>e){var o=t;t=e,e=o}if(n||t%1||e%1){var r=mv();return yv(t+r*(e-t+vv("1e-"+((r+"").length-1))),e)}return gv(t,e)},nm={assign:Ys,assignIn:Zs,assignInWith:$s,assignWith:Js,at:Al,create:function(t,e){var n=Di(t);return null==e?n:oc(n,e)},defaults:Lp,defaultsDeep:Up,entries:ch,entriesIn:dh,extend:Zs,extendWith:$s,findKey:function(t,e){return Mh(t,fp(e),bp)},findLastKey:function(t,e){return Mh(t,fp(e),ah)},forIn:function(t,e){return null==t?t:mp(t,nh(e),qs)},forInRight:function(t,e){return null==t?t:ih(t,nh(e),qs)},forOwn:function(t,e){return t&&bp(t,nh(e))},forOwnRight:function(t,e){return t&&ah(t,nh(e))},functions:function(t){return null==t?[]:zh(t,Xs(t))},functionsIn:function(t){return null==t?[]:zh(t,qs(t))},get:El,has:Zh,hasIn:lp,invert:gf,invertBy:bf,invoke:Ef,keys:Xs,keysIn:qs,mapKeys:tg,mapValues:function(t,e){var n={};return e=fp(e),bp(t,(function(t,o,r){rs(n,o,e(t,o,r))})),n},merge:ig,mergeWith:Wp,omit:bg,omitBy:function(t,e){return Eg(t,dg(fp(e)))},pick:rv,pickBy:Eg,result:function(t,e,n){var o=-1,r=(e=ml(e,t)).length;for(r||(r=1,t=void 0);++o<r;){var i=null==t?void 0:t[_l(e[o])];void 0===i&&(o=r,i=n),t=fi(i)?i.call(t):i}return t},set:function(t,e,n){return null==t?t:_g(t,e,n)},setWith:function(t,e,n,o){return o="function"==typeof o?o:void 0,null==t?t:_g(t,e,n,o)},toPairs:ch,toPairsIn:dh,transform:function(t,e,n){var o=zr(t),r=o||Ns(t)||js(t);if(e=fp(e),null==n){var i=t&&t.constructor;n=r?o?new i:[]:Jr(t)&&fi(i)?Di(Pl(t)):{}}return(r?ca:bp)(t,(function(t,o,r){return e(n,t,o,r)})),n},unset:function(t,e){return null==t||yg(t,e)},update:function(t,e,n){return null==t?t:Iy(t,e,nh(n))},updateWith:function(t,e,n,o){return o="function"==typeof o?o:void 0,null==t?t:Iy(t,e,nh(n),o)},values:nf,valuesIn:function(t){return null==t?[]:ef(t,qs(t))}},om={at:Hy,chain:Ju,commit:function(){return new Ki(this.value(),this.__chain__)},lodash:Ji,next:function(){void 0===this.__values__&&(this.__values__=gg(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 Fi;){var o=Zi(n);o.__index__=0,o.__values__=void 0,e?r.__wrapped__=o:e=o;var r=o;n=n.__wrapped__}return r.__wrapped__=t,e},reverse:function(){var t=this.__wrapped__;if(t instanceof Wi){var e=t;return this.__actions__.length&&(e=new Wi(this)),(e=e.reverse()).__actions__.push({func:hy,args:[Nv],thisArg:void 0}),new Ki(e,this.__chain__)}return this.thru(Nv)},tap:function(t,e){return e(t),t},thru:hy,toIterator:function(){return this},toJSON:yy,value:yy,valueOf:yy,wrapperChain:function(){return Ju(this)}},rm={camelCase:Vu,capitalize:hu,deburr:bu,endsWith:function(t,e,n){t=yl(t),e=Gr(e);var o=t.length,r=n=void 0===n?o:ec(li(n),0,o);return(n-=e.length)>=0&&t.slice(n,r)==e},escape:gh,escapeRegExp:function(t){return(t=yl(t))&&yh.test(t)?t.replace(vh,"\\$&"):t},kebabCase:Gf,lowerCase:qf,lowerFirst:Zf,pad:function(t,e,n){t=yl(t);var o=(e=li(e))?Kg(t):0;if(!e||o>=e)return t;var r=(e-o)/2;return Zg(Jg(r),n)+t+Zg($g(r),n)},padEnd:function(t,e,n){t=yl(t);var o=(e=li(e))?Kg(t):0;return e&&o<e?t+Zg(e-o,n):t},padStart:function(t,e,n){t=yl(t);var o=(e=li(e))?Kg(t):0;return e&&o<e?Zg(e-o,n)+t:t},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),tv(yl(t).replace(Qg,""),e||0)},repeat:function(t,e,n){return e=(n?gs(t,e,n):void 0===e)?1:li(e),Rg(yl(t),e)},replace:function(){var t=arguments,e=yl(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&&gs(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=yl(t))&&("string"==typeof e||null!=e&&!zf(e))&&!(e=Gr(e))&&$l(t)?ql(cu(t),0,n):t.split(e,n):[]},startCase:qv,startsWith:function(t,e,n){return t=yl(t),n=null==n?0:ec(li(n),0,t.length),e=Gr(e),t.slice(n,n+e.length)==e},template:function(t,e,n){var o=oy.imports._.templateSettings||oy;n&&gs(t,e,n)&&(e=void 0),t=yl(t),e=$s({},e,o,Qv);var r,i,a=$s({},e.imports,o.imports,Qv),s=Xs(a),l=ef(a,s),u=0,c=e.interpolate||uy,d="__p += '",p=RegExp((e.escape||uy).source+"|"+c.source+"|"+(c===ny?ly:uy).source+"|"+(e.evaluate||uy).source+"|$","g"),h=dy.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(p,(function(e,n,o,a,s,l){return o||(o=a),d+=t.slice(u,l).replace(cy,ey),n&&(r=!0,d+="' +\n__e("+n+") +\n'"),s&&(i=!0,d+="';\n"+s+";\n__p += '"),o&&(d+="' +\n((__t = ("+o+")) == null ? '' : __t) +\n'"),u=l+e.length,e})),d+="';\n";var f=dy.call(e,"variable")&&e.variable;if(f){if(sy.test(f))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(ry,""):d).replace(iy,"$1").replace(ay,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Wl((function(){return Function(s,h+"return "+d).apply(void 0,l)}));if(g.source=d,zl(g))throw g;return g},templateSettings:oy,toLower:function(t){return yl(t).toLowerCase()},toUpper:function(t){return yl(t).toUpperCase()},trim:function(t,e,n){if((t=yl(t))&&(n||void 0===e))return $r(t);if(!t||!(e=Gr(e)))return t;var o=cu(t),r=cu(e);return ql(o,_y(o,r),by(o,r)+1).join("")},trimEnd:function(t,e,n){if((t=yl(t))&&(n||void 0===e))return t.slice(0,qr(t)+1);if(!t||!(e=Gr(e)))return t;var o=cu(t);return ql(o,0,by(o,cu(e))+1).join("")},trimStart:function(t,e,n){if((t=yl(t))&&(n||void 0===e))return t.replace(xy,"");if(!t||!(e=Gr(e)))return t;var o=cu(t);return ql(o,_y(o,cu(e))).join("")},truncate:function(t,e){var n=30,o="...";if(Jr(e)){var r="separator"in e?e.separator:r;n="length"in e?li(e.length):n,o="omission"in e?Gr(e.omission):o}var i=(t=yl(t)).length;if($l(t)){var a=cu(t);i=a.length}if(n>=i)return t;var s=n-Kg(o);if(s<1)return o;var l=a?ql(a,0,s).join(""):t.slice(0,s);if(void 0===r)return l+o;if(a&&(s+=l.length-s),zf(r)){if(t.slice(s).search(r)){var u,c=l;for(r.global||(r=RegExp(r.source,yl(Ey.exec(r))+"g")),r.lastIndex=0;u=r.exec(c);)var d=u.index;l=l.slice(0,void 0===d?s:d)}}else if(t.indexOf(Gr(r),s)!=s){var p=l.lastIndexOf(r);p>-1&&(l=l.slice(0,p))}return l+o},unescape:function(t){return(t=yl(t))&&Cy.test(t)?t.replace(Sy,wy):t},upperCase:jy,upperFirst:pu,words:Xu},im={attempt:Wl,bindAll:Yl,cond:function(t){var e=null==t?0:t.length,n=fp;return t=e?Fr(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],ds((function(n){for(var o=-1;++o<e;){var r=t[o];if(Li(r[0],this,n))return Li(r[1],this,n)}}))},conforms:function(t){return function(t){var e=Xs(t);return function(n){return gp(n,t,e)}}(bd(t,1))},constant:aa,defaultTo:function(t,e){return null==t||t!=t?e:t},flow:Hh,flowRight:Fh,identity:ui,iteratee:function(t){return fp("function"==typeof t?t:bd(t,1))},matches:function(t){return ip(bd(t,1))},matchesProperty:function(t,e){return dp(t,bd(e,1))},method:ag,methodOf:sg,mixin:lg,noop:Ui,nthArg:function(t){return t=li(t),ds((function(e){return vg(e,t)}))},over:Og,overEvery:Ag,overSome:Pg,property:hp,propertyOf:function(t){return function(e){return null==t?void 0:xl(t,e)}},range:Ev,rangeRight:wv,stubArray:cc,stubFalse:Cs,stubObject:function(){return{}},stubString:function(){return""},stubTrue:function(){return!0},times:function(t,e){if((t=li(t))<1||t>9007199254740991)return[];var n=fy,o=gy(t,fy);e=nh(e),t-=fy;for(var r=bs(o,e);++n<t;)e(n);return r},toPath:function(t){return zr(t)?Fr(t,_l):jr(t)?[t]:qi(vl(yl(t)))},uniqueId:function(t){var e=++Dy;return yl(t)+e}};var am=Math.max,sm=Math.min;var lm=Math.min;
|
|
15
|
+
***************************************************************************** */var $=function(){return $=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},$.apply(this,arguments)};function J(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 Q(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function tt(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Q(arguments[e]));return t}var et=Symbol("mobx did run lazy initializers"),nt=Symbol("mobx pending decorators"),ot={},rt={};function it(t){var e,n;if(!0!==t[et]){var o=t[nt];if(o){j(t,et,!0);var r=tt(Object.getOwnPropertySymbols(o),Object.keys(o));try{for(var i=J(r),a=i.next();!a.done;a=i.next()){var s=o[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 at(t,e){return function(){var n,o,r=function(o,r,i,a){if(!0===a)return e(o,r,i,o,n),null;if(!Object.prototype.hasOwnProperty.call(o,nt)){var s=o[nt];j(o,nt,$({},s))}return o[nt][r]={prop:r,propertyCreator:e,descriptor:i,decoratorTarget:o,decoratorArguments:n},function(t,e){var n=e?ot:rt;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return it(this),this[t]},set:function(e){it(this),this[t]=e}})}(r,t)};return(2===(o=arguments).length||3===o.length)&&("string"==typeof o[1]||"symbol"==typeof o[1])||4===o.length&&!0===o[3]?(n=T,r.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),r)}}function st(t,e,n){return Ue(t)?t:Array.isArray(t)?mt.array(t,{name:n}):L(t)?mt.object(t,void 0,{name:n}):H(t)?mt.map(t,{name:n}):z(t)?mt.set(t,{name:n}):t}function lt(t){return t}function ut(t){D(t);var e=at(!0,(function(e,n,o,r,i){var a=o?o.initializer?o.initializer.call(e):o.value:void 0;Nn(e).addObservableProp(n,a,t)})),n=("undefined"!=typeof process&&process.env,e);return n.enhancer=t,n}var ct={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function dt(t){return null==t?ct:"string"==typeof t?{name:t,deep:!0,proxy:!0}:t}Object.freeze(ct);var pt=ut(st),ht=ut((function(t,e,n){return null==t||Rn(t)||_n(t)||Sn(t)||On(t)?t:Array.isArray(t)?mt.array(t,{name:n,deep:!1}):L(t)?mt.object(t,void 0,{name:n,deep:!1}):H(t)?mt.map(t,{name:n,deep:!1}):z(t)?mt.set(t,{name:n,deep:!1}):P(!1)})),ft=ut(lt),gt=ut((function(t,e,n){return Hn(t,e)?e:t}));function vt(t){return t.defaultDecorator?t.defaultDecorator.enhancer:!1===t.deep?lt:st}var yt={box:function(t,e){arguments.length>2&&bt("box");var n=dt(e);return new Yt(t,vt(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&bt("array");var n=dt(e);return function(t,e,n,o){void 0===n&&(n="ObservableArray@"+A());void 0===o&&(o=!1);var r=new vn(n,e,o);!function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}(r.values,U,r);var i=new Proxy(r.values,gn);if(r.proxy=i,t&&t.length){var a=Xt(!0);r.spliceWithArray(0,0,t),Ut(a)}return i}(t,vt(n),n.name)},map:function(t,e){arguments.length>2&&bt("map");var n=dt(e);return new wn(t,vt(n),n.name)},set:function(t,e){arguments.length>2&&bt("set");var n=dt(e);return new Mn(t,vt(n),n.name)},object:function(t,e,n){"string"==typeof arguments[1]&&bt("object");var o=dt(n);if(!1===o.proxy)return De({},t,e,o);var r=ke(o),i=function(t){var e=new Proxy(t,ln);return t[U].proxy=e,e}(De({},void 0,void 0,o));return Re(i,t,e,r),i},ref:ft,shallow:ht,deep:pt,struct:gt},mt=function(t,e,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return pt.apply(null,arguments);if(Ue(t))return t;var o=L(t)?mt.object(t,e,n):Array.isArray(t)?mt.array(t,e):H(t)?mt.map(t,e):z(t)?mt.set(t,e):t;if(o!==t)return o;P(!1)};function bt(t){P("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}Object.keys(yt).forEach((function(t){return mt[t]=yt[t]}));var _t,xt,Et=at(!1,(function(t,e,n,o,r){var i=n.get,a=n.set,s=r[0]||{};Nn(t).addComputedProp(t,e,$({get:i,set:a,context:t},s))})),wt=Et({equals:q.structural}),St=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 o="object"==typeof e?e:{};return o.get=t,o.set="function"==typeof e?e:o.set,o.name=o.name||t.name||"",new Kt(o)};St.struct=wt,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"}(_t||(_t={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(xt||(xt={}));var Ct=function(t){this.cause=t};function Mt(t){return t instanceof Ct}function Ot(t){switch(t.dependenciesState){case _t.UP_TO_DATE:return!1;case _t.NOT_TRACKING:case _t.STALE:return!0;case _t.POSSIBLY_STALE:for(var e=Rt(!0),n=Dt(),o=t.observing,r=o.length,i=0;i<r;i++){var a=o[i];if(qt(a)){if(ne.disableErrorBoundaries)a.get();else try{a.get()}catch(t){return kt(n),It(e),!0}if(t.dependenciesState===_t.STALE)return kt(n),It(e),!0}}return Lt(t),kt(n),It(e),!1}}function Tt(t){var e=t.observers.size>0;ne.computationDepth>0&&e&&P(!1),ne.allowStateChanges||!e&&"strict"!==ne.enforceActions||P(!1)}function Nt(t,e,n){var o=Rt(!0);Lt(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++ne.runId;var r,i=ne.trackingDerivation;if(ne.trackingDerivation=t,!0===ne.disableErrorBoundaries)r=e.call(n);else try{r=e.call(n)}catch(t){r=new Ct(t)}return ne.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,o=_t.UP_TO_DATE,r=0,i=t.unboundDepsCount,a=0;a<i;a++){0===(s=n[a]).diffValue&&(s.diffValue=1,r!==a&&(n[r]=s),r++),s.dependenciesState>o&&(o=s.dependenciesState)}n.length=r,t.newObserving=null,i=e.length;for(;i--;){0===(s=e[i]).diffValue&&re(s,t),s.diffValue=0}for(;r--;){var s;1===(s=n[r]).diffValue&&(s.diffValue=0,oe(s,t))}o!==_t.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}(t),It(o),r}function At(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)re(e[n],t);t.dependenciesState=_t.NOT_TRACKING}function Pt(t){var e=Dt();try{return t()}finally{kt(e)}}function Dt(){var t=ne.trackingDerivation;return ne.trackingDerivation=null,t}function kt(t){ne.trackingDerivation=t}function Rt(t){var e=ne.allowStateReads;return ne.allowStateReads=t,e}function It(t){ne.allowStateReads=t}function Lt(t){if(t.dependenciesState!==_t.UP_TO_DATE){t.dependenciesState=_t.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=_t.UP_TO_DATE}}var jt=0,Bt=1,Ht=Object.getOwnPropertyDescriptor((function(){}),"name");function zt(t,e,n){var o=function(){return Ft(t,e,n||this,arguments)};return o.isMobxAction=!0,o}function Ft(t,e,n,o){var r=Wt();try{return e.apply(n,o)}catch(t){throw r.error=t,t}finally{Gt(r)}}function Wt(t,e,n){var o=Dt();ae();var r={prevDerivation:o,prevAllowStateChanges:Xt(!0),prevAllowStateReads:Rt(!0),notifySpy:false,startTime:0,actionId:Bt++,parentActionId:jt};return jt=r.actionId,r}function Gt(t){jt!==t.actionId&&P("invalid action stack. did you forget to finish an action?"),jt=t.parentActionId,void 0!==t.error&&(ne.suppressReactionErrors=!0),Ut(t.prevAllowStateChanges),It(t.prevAllowStateReads),se(),kt(t.prevDerivation),t.notifySpy,ne.suppressReactionErrors=!1}function Xt(t){var e=ne.allowStateChanges;return ne.allowStateChanges=t,e}function Ut(t){ne.allowStateChanges=t}Ht&&Ht.configurable;var Yt=function(t){function e(e,n,o,r,i){void 0===o&&(o="ObservableValue@"+A()),void 0===r&&(r=!0),void 0===i&&(i=q.default);var a=t.call(this,o)||this;return a.enhancer=n,a.name=o,a.equals=i,a.hasUnreportedChange=!1,a.value=n(e,void 0,o),a}return function(t,e){function n(){this.constructor=t}Z(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))!==ne.UNCHANGED){false,this.setNewValue(t)}},e.prototype.prepareNewValue=function(t){if(Tt(this),un(this)){var e=dn(this,{object:this,type:"update",newValue:t});if(!e)return ne.UNCHANGED;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.equals(this.value,t)?ne.UNCHANGED:t},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),pn(this)&&fn(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 cn(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),hn(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return G(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(Y),Vt=B("ObservableValue",Yt),Kt=function(){function t(t){this.dependenciesState=_t.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=_t.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+A(),this.value=new Ct(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=xt.NONE,D(t.get,"missing option for computed: get"),this.derivation=t.get,this.name=t.name||"ComputedValue@"+A(),t.set&&(this.setter=zt(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?q.structural:q.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==_t.UP_TO_DATE)return;t.lowestObserverState=_t.POSSIBLY_STALE,t.observers.forEach((function(e){e.dependenciesState===_t.UP_TO_DATE&&(e.dependenciesState=_t.POSSIBLY_STALE,e.isTracing!==xt.NONE&&ue(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&&P("Cycle detected in computation "+this.name+": "+this.derivation),0!==ne.inBatch||0!==this.observers.size||this.keepAlive?(le(this),Ot(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===_t.STALE)return;t.lowestObserverState=_t.STALE,t.observers.forEach((function(e){e.dependenciesState===_t.POSSIBLY_STALE?e.dependenciesState=_t.STALE:e.dependenciesState===_t.UP_TO_DATE&&(t.lowestObserverState=_t.UP_TO_DATE)}))}(this)):Ot(this)&&(this.warnAboutUntrackedRead(),ae(),this.value=this.computeValue(!1),se());var t=this.value;if(Mt(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(Mt(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){D(!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 D(!1,!1)},t.prototype.trackAndCompute=function(){var t=this.value,e=this.dependenciesState===_t.NOT_TRACKING,n=this.computeValue(!0),o=e||Mt(t)||Mt(n)||!this.equals(t,n);return o&&(this.value=n),o},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,ne.computationDepth++,t)e=Nt(this,this.derivation,this.scope);else if(!0===ne.disableErrorBoundaries)e=this.derivation.call(this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new Ct(t)}return ne.computationDepth--,this.isComputing=!1,e},t.prototype.suspend=function(){this.keepAlive||(At(this),this.value=void 0)},t.prototype.observe=function(t,e){var n=this,o=!0,r=void 0;return Se((function(){var i=n.get();if(!o||e){var a=Dt();t({type:"update",object:n,newValue:i,oldValue:r}),kt(a)}o=!1,r=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 G(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),qt=B("ComputedValue",Kt),Zt=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],$t=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},Jt={};function Qt(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:Jt}var te=!0,ee=!1,ne=function(){var t=Qt();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(te=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new $t).version&&(te=!1),te?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new $t):(setTimeout((function(){ee||P("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new $t)}();function oe(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function re(t,e){t.observers.delete(e),0===t.observers.size&&ie(t)}function ie(t){!1===t.isPendingUnobservation&&(t.isPendingUnobservation=!0,ne.pendingUnobservations.push(t))}function ae(){ne.inBatch++}function se(){if(0==--ne.inBatch){fe();for(var t=ne.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 Kt&&n.suspend())}ne.pendingUnobservations=[]}}function le(t){var e=ne.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&&ne.inBatch>0&&ie(t),!1)}function ue(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===xt.BREAK){var n=[];ce(Ie(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 Kt?t.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function ce(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 ce(t,e,n+1)})))}var de=function(){function t(t,e,n,o){void 0===t&&(t="Reaction@"+A()),void 0===o&&(o=!1),this.name=t,this.onInvalidate=e,this.errorHandler=n,this.requiresObservable=o,this.observing=[],this.newObserving=[],this.dependenciesState=_t.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+A(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=xt.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,ne.pendingReactions.push(this),fe())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(ae(),this._isScheduled=!1,Ot(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(t){this.reportExceptionInDerivation(t)}}se()}},t.prototype.track=function(t){if(!this.isDisposed){ae(),this._isRunning=!0;var e=Nt(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&At(this),Mt(e)&&this.reportExceptionInDerivation(e.cause),se()}},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{if(ne.disableErrorBoundaries)throw t;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";ne.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,t),ne.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(ae(),At(this),se()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t[U]=this,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(t){void 0===t&&(t=!1),nn(this,t)},t}();var pe=100,he=function(t){return t()};function fe(){ne.inBatch>0||ne.isRunningReactions||he(ge)}function ge(){ne.isRunningReactions=!0;for(var t=ne.pendingReactions,e=0;t.length>0;){++e===pe&&(console.error("Reaction doesn't converge to a stable state after "+pe+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),o=0,r=n.length;o<r;o++)n[o].runReaction()}ne.isRunningReactions=!1}var ve=B("Reaction",de);function ye(t){var e=he;he=function(n){return t((function(){return e(n)}))}}function me(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}function be(){P(!1)}function _e(t){return function(e,n,o){if(o){if(o.value)return{value:zt(t,o.value),enumerable:!1,configurable:!0,writable:!0};var r=o.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return zt(t,r.call(this))}}}return function(t){return function(e,n,o){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(e){j(this,n,xe(t,e))}})}}(t).apply(this,arguments)}}var xe=function(t,e,n,o){return 1===arguments.length&&"function"==typeof t?zt(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?zt(t,e):1===arguments.length&&"string"==typeof t?_e(t):!0!==o?_e(e).apply(null,arguments):void j(t,e,zt(t.name||e,n.value,this))};function Ee(t,e){"string"==typeof t||t.name;return Ft(0,"function"==typeof t?t:e,this,void 0)}function we(t,e,n){j(t,e,zt(e,n.bind(t)))}function Se(t,e){void 0===e&&(e=N);var n,o=e&&e.name||t.name||"Autorun@"+A();if(!e.scheduler&&!e.delay)n=new de(o,(function(){this.track(a)}),e.onError,e.requiresObservable);else{var r=Me(e),i=!1;n=new de(o,(function(){i||(i=!0,r((function(){i=!1,n.isDisposed||n.track(a)})))}),e.onError,e.requiresObservable)}function a(){t(n)}return n.schedule(),n.getDisposer()}xe.bound=function(t,e,n,o){return!0===o?(we(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return we(this,e,n.value||n.initializer.call(this)),this[e]},set:be}:{enumerable:!1,configurable:!0,set:function(t){we(this,e,t)},get:function(){}}};var Ce=function(t){return t()};function Me(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:Ce}function Oe(t,e,n){void 0===n&&(n=N);var o,r,i,a=n.name||"Reaction@"+A(),s=xe(a,n.onError?(o=n.onError,r=e,function(){try{return r.apply(this,arguments)}catch(t){o.call(this,t)}}):e),l=!n.scheduler&&!n.delay,u=Me(n),c=!0,d=!1,p=n.compareStructural?q.structural:n.equals||q.default,h=new de(a,(function(){c||l?f():d||(d=!0,u(f))}),n.onError,n.requiresObservable);function f(){if(d=!1,!h.isDisposed){var e=!1;h.track((function(){var n=t(h);e=c||!p(i,n),i=n})),c&&n.fireImmediately&&s(i,h),c||!0!==e||s(i,h),c&&(c=!1)}}return h.schedule(),h.getDisposer()}function Te(t,e,n){return Ae("onBecomeObserved",t,e,n)}function Ne(t,e,n){return Ae("onBecomeUnobserved",t,e,n)}function Ae(t,e,n,o){var r="function"==typeof o?In(e,n):In(e),i="function"==typeof o?o:n,a=t+"Listeners";return r[a]?r[a].add(i):r[a]=new Set([i]),"function"!=typeof r[t]?P(!1):function(){var t=r[a];t&&(t.delete(i),0===t.size&&delete r[a])}}function Pe(t){var e=t.enforceActions,n=t.computedRequiresReaction,o=t.computedConfigurable,r=t.disableErrorBoundaries,i=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(!0===t.isolateGlobalState&&((ne.pendingReactions.length||ne.inBatch||ne.isRunningReactions)&&P("isolateGlobalState should be called before MobX is running any reactions"),ee=!0,te&&(0==--Qt().__mobxInstanceCount&&(Qt().__mobxGlobals=void 0),ne=new $t)),void 0!==e){var l=void 0;switch(e){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:P("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}ne.enforceActions=l,ne.allowStateChanges=!0!==l&&"strict"!==l}void 0!==n&&(ne.computedRequiresReaction=!!n),void 0!==a&&(ne.reactionRequiresObservable=!!a),void 0!==s&&(ne.observableRequiresReaction=!!s,ne.allowStateReads=!ne.observableRequiresReaction),void 0!==o&&(ne.computedConfigurable=!!o),void 0!==r&&(!0===r&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),ne.disableErrorBoundaries=!!r),i&&ye(i)}function De(t,e,n,o){var r=ke(o=dt(o));return it(t),Nn(t,o.name,r.enhancer),e&&Re(t,e,n,r),t}function ke(t){return t.defaultDecorator||(!1===t.deep?ft:pt)}function Re(t,e,n,o){var r,i;ae();try{var a=X(e);try{for(var s=J(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=Object.getOwnPropertyDescriptor(e,u);0;var d=n&&u in n?n[u]:c.get?Et:o;0;var p=d(t,u,c,!0);p&&Object.defineProperty(t,u,p)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}}finally{se()}}function Ie(t,e){return Le(In(t,e))}function Le(t){var e,n,o={name:t.name};return t.observing&&t.observing.length>0&&(o.dependencies=(e=t.observing,n=[],e.forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n).map(Le)),o}function je(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(je)),e}var Be=0;function He(){this.message="FLOW_CANCELLED"}function ze(t){"function"==typeof t.cancel&&t.cancel()}function Fe(t,e){if(null==t)return!1;if(void 0!==e){if(!1===Rn(t))return!1;if(!t[U].values.has(e))return!1;var n=In(t,e);return qt(n)}return qt(t)}function We(t){return arguments.length>1?P(!1):Fe(t)}function Ge(t,e){return"string"!=typeof e?P(!1):Fe(t,e)}function Xe(t,e){return null!=t&&(void 0!==e?!!Rn(t)&&t[U].values.has(e):Rn(t)||!!t[U]||V(t)||ve(t)||qt(t))}function Ue(t){return 1!==arguments.length&&P(!1),Xe(t)}function Ye(t){return Rn(t)?t[U].getKeys():Sn(t)||On(t)?Array.from(t.keys()):_n(t)?t.map((function(t,e){return e})):P(!1)}function Ve(t){return Rn(t)?Ye(t).map((function(e){return t[e]})):Sn(t)?Ye(t).map((function(e){return t.get(e)})):On(t)?Array.from(t.values()):_n(t)?t.slice():P(!1)}function Ke(t){return Rn(t)?Ye(t).map((function(e){return[e,t[e]]})):Sn(t)?Ye(t).map((function(e){return[e,t.get(e)]})):On(t)?Array.from(t.entries()):_n(t)?t.map((function(t,e){return[e,t]})):P(!1)}function qe(t,e,n){if(2!==arguments.length||On(t))if(Rn(t)){var o=t[U];o.values.get(e)?o.write(e,n):o.addObservableProp(e,n,o.defaultEnhancer)}else if(Sn(t))t.set(e,n);else if(On(t))t.add(e);else{if(!_n(t))return P(!1);"number"!=typeof e&&(e=parseInt(e,10)),D(e>=0,"Not a valid index: '"+e+"'"),ae(),e>=t.length&&(t.length=e+1),t[e]=n,se()}else{ae();var r=e;try{for(var i in r)qe(t,i,r[i])}finally{se()}}}function Ze(t,e){return Rn(t)?Ln(t).has(e):Sn(t)||On(t)?t.has(e):_n(t)?e>=0&&e<t.length:P(!1)}function $e(t,e,n,o){return"function"==typeof n?function(t,e,n,o){return Ln(t,e).observe(n,o)}(t,e,n,o):function(t,e,n){return Ln(t).observe(e,n)}(t,e,n)}He.prototype=Object.create(Error.prototype);var Je={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Qe(t,e,n,o){return o.detectCycles&&t.set(e,n),n}function tn(t,e,n){if(!e.recurseEverything&&!Ue(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(Vt(t))return tn(t.get(),e,n);if(Ue(t)&&Ye(t),!0===e.detectCycles&&null!==t&&n.has(t))return n.get(t);if(_n(t)||Array.isArray(t)){var o=Qe(n,t,[],e),r=t.map((function(t){return tn(t,e,n)}));o.length=r.length;for(var i=0,a=r.length;i<a;i++)o[i]=r[i];return o}if(On(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===e.exportMapsAsObjects){var s=Qe(n,t,new Set,e);return t.forEach((function(t){s.add(tn(t,e,n))})),s}var l=Qe(n,t,[],e);return t.forEach((function(t){l.push(tn(t,e,n))})),l}if(Sn(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===e.exportMapsAsObjects){var u=Qe(n,t,new Map,e);return t.forEach((function(t,o){u.set(o,tn(t,e,n))})),u}var c=Qe(n,t,{},e);return t.forEach((function(t,o){c[o]=tn(t,e,n)})),c}var d=Qe(n,t,{},e);return F(t).forEach((function(o){d[o]=tn(t[o],e,n)})),d}function en(t,e){var n;return"boolean"==typeof e&&(e={detectCycles:e}),e||(e=Je),e.detectCycles=void 0===e.detectCycles?!0===e.recurseEverything:!0===e.detectCycles,e.detectCycles&&(n=new Map),tn(t,e,n)}function nn(){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 o=function(t){switch(t.length){case 0:return ne.trackingDerivation;case 1:return In(t[0]);case 2:return In(t[0],t[1])}}(t);if(!o)return P(!1);o.isTracing===xt.NONE&&console.log("[mobx.trace] '"+o.name+"' tracing enabled"),o.isTracing=n?xt.BREAK:xt.LOG}function on(t,e){void 0===e&&(e=void 0),ae();try{return t.apply(e)}finally{se()}}function rn(t,e,n){var o;"number"==typeof n.timeout&&(o=setTimeout((function(){if(!i[U].isDisposed){i();var t=new Error("WHEN_TIMEOUT");if(!n.onError)throw t;n.onError(t)}}),n.timeout)),n.name=n.name||"When@"+A();var r=zt(n.name+"-effect",e),i=Se((function(e){t()&&(e.dispose(),o&&clearTimeout(o),r())}),n);return i}function an(t){return t[U]}function sn(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t}var ln={has:function(t,e){if(e===U||"constructor"===e||e===et)return!0;var n=an(t);return sn(e)?n.has(e):e in t},get:function(t,e){if(e===U||"constructor"===e||e===et)return t[e];var n=an(t),o=n.values.get(e);if(o instanceof Y){var r=o.get();return void 0===r&&n.has(e),r}return sn(e)&&n.has(e),t[e]},set:function(t,e,n){return!!sn(e)&&(qe(t,e,n),!0)},deleteProperty:function(t,e){return!!sn(e)&&(an(t).remove(e),!0)},ownKeys:function(t){return an(t).keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return P("Dynamic observable objects cannot be frozen"),!1}};function un(t){return void 0!==t.interceptors&&t.interceptors.length>0}function cn(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),k((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function dn(t,e){var n=Dt();try{for(var o=tt(t.interceptors||[]),r=0,i=o.length;r<i&&(D(!(e=o[r](e))||e.type,"Intercept handlers should return nothing or a change object"),e);r++);return e}finally{kt(n)}}function pn(t){return void 0!==t.changeListeners&&t.changeListeners.length>0}function hn(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),k((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function fn(t,e){var n=Dt(),o=t.changeListeners;if(o){for(var r=0,i=(o=o.slice()).length;r<i;r++)o[r](e);kt(n)}}var gn={get:function(t,e){return e===U?t[U]:"length"===e?t[U].getArrayLength():"number"==typeof e?yn.get.call(t,e):"string"!=typeof e||isNaN(e)?yn.hasOwnProperty(e)?yn[e]:t[e]:yn.get.call(t,parseInt(e))},set:function(t,e,n){return"length"===e&&t[U].setArrayLength(n),"number"==typeof e&&yn.set.call(t,e,n),"symbol"==typeof e||isNaN(e)?t[e]=n:yn.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return P("Observable arrays cannot be frozen"),!1}};var vn=function(){function t(t,e,n){this.owned=n,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new Y(t||"ObservableArray@"+A()),this.enhancer=function(n,o){return e(n,o,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 cn(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}),hn(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),o=0;o<t-e;o++)n[o]=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 o=this;Tt(this.atom);var r=this.values.length;if(void 0===t?t=0:t>r?t=r:t<0&&(t=Math.max(0,r+t)),e=1===arguments.length?r-t:null==e?0:Math.max(0,Math.min(e,r-t)),void 0===n&&(n=T),un(this)){var i=dn(this,{object:this.proxy,type:"splice",index:t,removedCount:e,added:n});if(!i)return T;e=i.removedCount,n=i.added}n=0===n.length?n:n.map((function(t){return o.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 o;if(n.length<1e4)return(o=this.values).splice.apply(o,tt([t,e],n));var r=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),r},t.prototype.notifyArrayChildUpdate=function(t,e,n){var o=!this.owned&&!1,r=pn(this),i=r||o?{object:this.proxy,type:"update",index:t,newValue:e,oldValue:n}:null;this.atom.reportChanged(),r&&fn(this,i)},t.prototype.notifyArraySplice=function(t,e,n){var o=!this.owned&&!1,r=pn(this),i=r||o?{object:this.proxy,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;this.atom.reportChanged(),r&&fn(this,i)},t}(),yn={intercept:function(t){return this[U].intercept(t)},observe:function(t,e){return void 0===e&&(e=!1),this[U].observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[U];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=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var r=this[U];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray(t);case 2:return r.spliceWithArray(t,e)}return r.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){return this[U].spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[U];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[U].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[U];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[U],n=e.dehanceValues(e.values).indexOf(t);return n>-1&&(this.splice(n,1),!0)},get:function(t){var e=this[U];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[U],o=n.values;if(t<o.length){Tt(n.atom);var r=o[t];if(un(n)){var i=dn(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!i)return;e=i.newValue}(e=n.enhancer(e,r))!==r&&(o[t]=e,n.notifyArrayChildUpdate(t,e,r))}else{if(t!==o.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+o.length);n.spliceWithArray(t,0,[e])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(t){"function"==typeof Array.prototype[t]&&(yn[t]=function(){var e=this[U];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]&&(yn[t]=function(e,n){var o=this,r=this[U];return r.atom.reportObserved(),r.dehanceValues(r.values)[t]((function(t,r){return e.call(n,t,r,o)}),n)})})),["reduce","reduceRight"].forEach((function(t){yn[t]=function(){var e=this,n=this[U];n.atom.reportObserved();var o=arguments[0];return arguments[0]=function(t,r,i){return r=n.dehanceValue(r),o(t,r,i,e)},n.values[t].apply(n.values,arguments)}}));var mn,bn=B("ObservableArrayAdministration",vn);function _n(t){return I(t)&&bn(t[U])}var xn,En={},wn=function(){function t(t,e,n){if(void 0===e&&(e=st),void 0===n&&(n="ObservableMap@"+A()),this.enhancer=e,this.name=n,this[mn]=En,this._keysAtom=K(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(!ne.trackingDerivation)return this._has(t);var n=this._hasMap.get(t);if(!n){var o=n=new Yt(this._has(t),lt,this.name+"."+W(t)+"?",!1);this._hasMap.set(t,o),Ne(o,(function(){return e._hasMap.delete(t)}))}return n.get()},t.prototype.set=function(t,e){var n=this._has(t);if(un(this)){var o=dn(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!o)return this;e=o.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if((Tt(this._keysAtom),un(this))&&!(o=dn(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=pn(this),o=n?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return on((function(){e._keysAtom.reportChanged(),e._updateHasMapEntry(t,!1),e._data.get(t).setNewValue(void 0),e._data.delete(t)})),n&&fn(this,o),!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))!==ne.UNCHANGED){var o=!1,r=pn(this),i=r?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;o,n.setNewValue(e),r&&fn(this,i)}},t.prototype._addValue=function(t,e){var n=this;Tt(this._keysAtom),on((function(){var o=new Yt(e,n.enhancer,n.name+"."+W(t),!1);n._data.set(t,o),e=o.value,n._updateHasMapEntry(t,!0),n._keysAtom.reportChanged()}));var o=pn(this);o&&fn(this,o?{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 Gn({next:function(){var n=e.next(),o=n.done,r=n.value;return{done:o,value:o?void 0:t.get(r)}}})},t.prototype.entries=function(){var t=this,e=this.keys();return Gn({next:function(){var n=e.next(),o=n.done,r=n.value;return{done:o,value:o?void 0:[r,t.get(r)]}}})},t.prototype[(mn=U,Symbol.iterator)]=function(){return this.entries()},t.prototype.forEach=function(t,e){var n,o;try{for(var r=J(this),i=r.next();!i.done;i=r.next()){var a=Q(i.value,2),s=a[0],l=a[1];t.call(e,l,s,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}},t.prototype.merge=function(t){var e=this;return Sn(t)&&(t=t.toJS()),on((function(){var n=Xt(!0);try{L(t)?F(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=Q(t,2),o=n[0],r=n[1];return e.set(o,r)})):H(t)?(t.constructor!==Map&&P("Cannot initialize from classes that inherit from Map: "+t.constructor.name),t.forEach((function(t,n){return e.set(n,t)}))):null!=t&&P("Cannot initialize map from "+t)}finally{Ut(n)}})),this},t.prototype.clear=function(){var t=this;on((function(){Pt((function(){var e,n;try{for(var o=J(t.keys()),r=o.next();!r.done;r=o.next()){var i=r.value;t.delete(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}))},t.prototype.replace=function(t){var e=this;return on((function(){var n,o,r,i,a=function(t){if(H(t)||Sn(t))return t;if(Array.isArray(t))return new Map(t);if(L(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}return P("Cannot convert to map from '"+t+"'")}(t),s=new Map,l=!1;try{for(var u=J(e._data.keys()),c=u.next();!c.done;c=u.next()){var d=c.value;if(!a.has(d))if(e.delete(d))l=!0;else{var p=e._data.get(d);s.set(d,p)}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}try{for(var h=J(a.entries()),f=h.next();!f.done;f=h.next()){var g=Q(f.value,2),v=(d=g[0],p=g[1],e._data.has(d));if(e.set(d,p),e._data.has(d)){var y=e._data.get(d);s.set(d,y),v||(l=!0)}}}catch(t){r={error:t}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}if(!l)if(e._data.size!==s.size)e._keysAtom.reportChanged();else for(var m=e._data.keys(),b=s.keys(),_=m.next(),x=b.next();!_.done;){if(_.value!==x.value){e._keysAtom.reportChanged();break}_=m.next(),x=b.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 o=J(this),r=o.next();!r.done;r=o.next()){var i=Q(r.value,2),a=i[0],s=i[1];n["symbol"==typeof a?a:W(a)]=s}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}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 W(e)+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return hn(this,t)},t.prototype.intercept=function(t){return cn(this,t)},t}(),Sn=B("ObservableMap",wn),Cn={},Mn=function(){function t(t,e,n){if(void 0===e&&(e=st),void 0===n&&(n="ObservableSet@"+A()),this.name=n,this[xn]=Cn,this._data=new Set,this._atom=K(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,o){return e(t,o,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;on((function(){Pt((function(){var e,n;try{for(var o=J(t._data.values()),r=o.next();!r.done;r=o.next()){var i=r.value;t.delete(i)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}))},t.prototype.forEach=function(t,e){var n,o;try{for(var r=J(this),i=r.next();!i.done;i=r.next()){var a=i.value;t.call(e,a,a,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}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((Tt(this._atom),un(this))&&!(o=dn(this,{type:"add",object:this,newValue:t})))return this;if(!this.has(t)){on((function(){e._data.add(e.enhancer(t,void 0)),e._atom.reportChanged()}));var n=pn(this),o=n?{type:"add",object:this,newValue:t}:null;n&&fn(this,o)}return this},t.prototype.delete=function(t){var e=this;if(un(this)&&!(o=dn(this,{type:"delete",object:this,oldValue:t})))return!1;if(this.has(t)){var n=pn(this),o=n?{type:"delete",object:this,oldValue:t}:null;return on((function(){e._atom.reportChanged(),e._data.delete(t)})),n&&fn(this,o),!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 Gn({next:function(){var o=t;return t+=1,o<n.length?{value:[e[o],n[o]],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 Gn({next:function(){return e<n.length?{value:t.dehanceValue(n[e++]),done:!1}:{done:!0}}})},t.prototype.replace=function(t){var e=this;return On(t)&&(t=t.toJS()),on((function(){var n=Xt(!0);try{Array.isArray(t)||z(t)?(e.clear(),t.forEach((function(t){return e.add(t)}))):null!=t&&P("Cannot initialize set from "+t)}finally{Ut(n)}})),this},t.prototype.observe=function(t,e){return hn(this,t)},t.prototype.intercept=function(t){return cn(this,t)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[(xn=U,Symbol.iterator)]=function(){return this.values()},t}(),On=B("ObservableSet",Mn),Tn=function(){function t(t,e,n,o){void 0===e&&(e=new Map),this.target=t,this.values=e,this.name=n,this.defaultEnhancer=o,this.keysAtom=new Y(n+".keys")}return t.prototype.read=function(t){return this.values.get(t).get()},t.prototype.write=function(t,e){var n=this.target,o=this.values.get(t);if(o instanceof Kt)o.set(e);else{if(un(this)){if(!(a=dn(this,{type:"update",object:this.proxy||n,name:t,newValue:e})))return;e=a.newValue}if((e=o.prepareNewValue(e))!==ne.UNCHANGED){var r=pn(this),i=!1,a=r?{type:"update",object:this.proxy||n,oldValue:o.value,name:t,newValue:e}:null;i,o.setNewValue(e),r&&fn(this,a)}}},t.prototype.has=function(t){var e=this.pendingKeys||(this.pendingKeys=new Map),n=e.get(t);if(n)return n.get();var o=!!this.values.get(t);return n=new Yt(o,lt,this.name+"."+W(t)+"?",!1),e.set(t,n),n.get()},t.prototype.addObservableProp=function(t,e,n){void 0===n&&(n=this.defaultEnhancer);var o=this.target;if(un(this)){var r=dn(this,{object:this.proxy||o,name:t,type:"add",newValue:e});if(!r)return;e=r.newValue}var i=new Yt(e,n,this.name+"."+W(t),!1);this.values.set(t,i),e=i.value,Object.defineProperty(o,t,function(t){return An[t]||(An[t]={configurable:!0,enumerable:!0,get:function(){return this[U].read(t)},set:function(e){this[U].write(t,e)}})}(t)),this.notifyPropertyAddition(t,e)},t.prototype.addComputedProp=function(t,e,n){var o=this.target;n.name=n.name||this.name+"."+W(e),this.values.set(e,new Kt(n)),(t===o||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 Pn[t]||(Pn[t]={configurable:ne.computedConfigurable,enumerable:!1,get:function(){return Dn(this).read(t)},set:function(e){Dn(this).write(t,e)}})}(e))},t.prototype.remove=function(t){if(this.values.has(t)){var e=this.target;if(un(this))if(!(s=dn(this,{object:this.proxy||e,name:t,type:"remove"})))return;try{ae();var n=pn(this),o=!1,r=this.values.get(t),i=r&&r.get();if(r&&r.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;o,n&&fn(this,s)}finally{se()}}},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 hn(this,t)},t.prototype.intercept=function(t){return cn(this,t)},t.prototype.notifyPropertyAddition=function(t,e){var n=pn(this),o=n?{type:"add",object:this.proxy||this.target,name:t,newValue:e}:null;if(n&&fn(this,o),this.pendingKeys){var r=this.pendingKeys.get(t);r&&r.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var t,e;this.keysAtom.reportObserved();var n=[];try{for(var o=J(this.values),r=o.next();!r.done;r=o.next()){var i=Q(r.value,2),a=i[0];i[1]instanceof Yt&&n.push(a)}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},t}();function Nn(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n=st),Object.prototype.hasOwnProperty.call(t,U))return t[U];L(t)||(e=(t.constructor.name||"ObservableObject")+"@"+A()),e||(e="ObservableObject@"+A());var o=new Tn(t,new Map,W(e),n);return j(t,U,o),o}var An=Object.create(null),Pn=Object.create(null);function Dn(t){var e=t[U];return e||(it(t),t[U])}var kn=B("ObservableObjectAdministration",Tn);function Rn(t){return!!I(t)&&(it(t),kn(t[U]))}function In(t,e){if("object"==typeof t&&null!==t){if(_n(t))return void 0!==e&&P(!1),t[U].atom;if(On(t))return t[U];if(Sn(t)){var n=t;return void 0===e?n._keysAtom:((o=n._data.get(e)||n._hasMap.get(e))||P(!1),o)}var o;if(it(t),e&&!t[U]&&t[e],Rn(t))return e?((o=t[U].values.get(e))||P(!1),o):P(!1);if(V(t)||qt(t)||ve(t))return t}else if("function"==typeof t&&ve(t[U]))return t[U];return P(!1)}function Ln(t,e){return t||P("Expecting some object"),void 0!==e?Ln(In(t,e)):V(t)||qt(t)||ve(t)||Sn(t)||On(t)?t:(it(t),t[U]?t[U]:void P(!1))}function jn(t,e){return(void 0!==e?In(t,e):Rn(t)||Sn(t)||On(t)?Ln(t):In(t)).name}var Bn=Object.prototype.toString;function Hn(t,e,n){return void 0===n&&(n=-1),zn(t,e,n)}function zn(t,e,n,o,r){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=Bn.call(t);if(a!==Bn.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=Fn(t),e=Fn(e);var s="[object Array]"===a;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;var l=t.constructor,u=e.constructor;if(l!==u&&!("function"==typeof l&&l instanceof l&&"function"==typeof u&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}if(0===n)return!1;n<0&&(n=-1),r=r||[];for(var c=(o=o||[]).length;c--;)if(o[c]===t)return r[c]===e;if(o.push(t),r.push(e),s){if((c=t.length)!==e.length)return!1;for(;c--;)if(!zn(t[c],e[c],n-1,o,r))return!1}else{var d=Object.keys(t),p=void 0;if(c=d.length,Object.keys(e).length!==c)return!1;for(;c--;)if(!Wn(e,p=d[c])||!zn(t[p],e[p],n-1,o,r))return!1}return o.pop(),r.pop(),!0}function Fn(t){return _n(t)?t.slice():H(t)||Sn(t)||z(t)||On(t)?Array.from(t.entries()):t}function Wn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Gn(t){return t[Symbol.iterator]=Xn,t}function Xn(){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:me,extras:{getDebugName:jn},$mobx:U});var Un=Object.freeze({__proto__:null,$mobx:U,FlowCancellationError:He,get IDerivationState(){return _t},ObservableMap:wn,ObservableSet:Mn,Reaction:de,_allowStateChanges:function(t,e){var n,o=Xt(t);try{n=e()}finally{Ut(o)}return n},_allowStateChangesInsideComputed:function(t){var e,n=ne.computationDepth;ne.computationDepth=0;try{e=t()}finally{ne.computationDepth=n}return e},_allowStateReadsEnd:It,_allowStateReadsStart:Rt,_endAction:Gt,_getAdministration:Ln,_getGlobalState:function(){return ne},_interceptReads:function(t,e,n){var o;if(Sn(t)||_n(t)||Vt(t))o=Ln(t);else{if(!Rn(t))return P(!1);if("string"!=typeof e)return P(!1);o=Ln(t,e)}return void 0!==o.dehancer?P(!1):(o.dehancer="function"==typeof e?e:n,function(){o.dehancer=void 0})},_isComputingDerivation:function(){return null!==ne.trackingDerivation},_resetGlobalState:function(){var t=new $t;for(var e in t)-1===Zt.indexOf(e)&&(ne[e]=t[e]);ne.allowStateChanges=!ne.enforceActions},_startAction:Wt,action:xe,autorun:Se,comparer:q,computed:St,configure:Pe,createAtom:K,decorate:function(t,e){var n="function"==typeof t?t.prototype:t,o=function(t){var o=e[t];Array.isArray(o)||(o=[o]);var r=Object.getOwnPropertyDescriptor(n,t),i=o.reduce((function(e,o){return o(n,t,e)}),r);i&&Object.defineProperty(n,t,i)};for(var r in e)o(r);return t},entries:Ke,extendObservable:De,flow:function(t){1!==arguments.length&&P("Flow expects 1 argument and cannot be used as decorator");var e=t.name||"<unnamed flow>";return function(){var n,o=arguments,r=++Be,i=xe(e+" - runid: "+r+" - init",t).apply(this,o),a=void 0,s=new Promise((function(t,o){var s=0;function l(t){var n;a=void 0;try{n=xe(e+" - runid: "+r+" - yield "+s++,i.next).call(i,t)}catch(t){return o(t)}c(n)}function u(t){var n;a=void 0;try{n=xe(e+" - runid: "+r+" - yield "+s++,i.throw).call(i,t)}catch(t){return o(t)}c(n)}function c(e){if(!e||"function"!=typeof e.then)return e.done?t(e.value):(a=Promise.resolve(e.value)).then(l,u);e.then(c,o)}n=o,l(void 0)}));return s.cancel=xe(e+" - runid: "+r+" - cancel",(function(){try{a&&ze(a);var t=i.return(void 0),e=Promise.resolve(t.value);e.then(R,R),ze(e),n(new He)}catch(t){n(t)}})),s}},get:function(t,e){if(Ze(t,e))return Rn(t)?t[e]:Sn(t)?t.get(e):_n(t)?t[e]:P(!1)},getAtom:In,getDebugName:jn,getDependencyTree:Ie,getObserverTree:function(t,e){return je(In(t,e))},has:Ze,intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return Ln(t,e).intercept(n)}(t,e,n):function(t,e){return Ln(t).intercept(e)}(t,e)},isAction:function(t){return"function"==typeof t&&!0===t.isMobxAction},isArrayLike:function(t){return Array.isArray(t)||_n(t)},isBoxedObservable:Vt,isComputed:We,isComputedProp:Ge,isFlowCancellationError:function(t){return t instanceof He},isObservable:Ue,isObservableArray:_n,isObservableMap:Sn,isObservableObject:Rn,isObservableProp:function(t,e){return"string"!=typeof e?P(!1):Xe(t,e)},isObservableSet:On,keys:Ye,observable:mt,observe:$e,onBecomeObserved:Te,onBecomeUnobserved:Ne,onReactionError:function(t){return ne.globalReactionErrorHandlers.push(t),function(){var e=ne.globalReactionErrorHandlers.indexOf(t);e>=0&&ne.globalReactionErrorHandlers.splice(e,1)}},reaction:Oe,remove:function(t,e){if(Rn(t))t[U].remove(e);else if(Sn(t))t.delete(e);else if(On(t))t.delete(e);else{if(!_n(t))return P(!1);"number"!=typeof e&&(e=parseInt(e,10)),D(e>=0,"Not a valid index: '"+e+"'"),t.splice(e,1)}},runInAction:Ee,set:qe,spy:me,toJS:en,trace:nn,transaction:on,untracked:Pt,values:Ve,when:function(t,e,n){return 1===arguments.length||e&&"object"==typeof e?function(t,e){var n,o=new Promise((function(o,r){var i=rn(t,o,$($({},e),{onError:r}));n=function(){i(),r("WHEN_CANCELLED")}}));return o.cancel=n,o}(t,e):rn(t,e,n||{})}}),Yn=w(Un);!function(t,e){!function(t,e,n){function o(t){return!(t.prototype&&t.prototype.render||e.Component.isPrototypeOf(t))}function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.prefix,o=void 0===n?"":n,r=e.suffix,i=void 0===r?"":r;return o+(t.displayName||t.name||t.constructor&&t.constructor.name||"<component>")+i}var i="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},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),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)},u=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},c=!1,d=console;function p(t){c=t}function h(t){var e=n._getGlobalState().allowStateChanges;return n._getGlobalState().allowStateChanges=t,e}function f(t){n._getGlobalState().allowStateChanges=t}function g(t,e,n,o,r){var i=h(t),a=void 0;try{a=e(n,o,r)}finally{f(i)}return a}function v(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=t[e],r=m[e],i=o?!0===n?function(){r.apply(this,arguments),o.apply(this,arguments)}:function(){o.apply(this,arguments),r.apply(this,arguments)}:r;t[e]=i}function y(t,e){if(null==t||null==e||"object"!==(void 0===t?"undefined":i(t))||"object"!==(void 0===e?"undefined":i(e)))return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var o=void 0,r=n.length-1;o=n[r];r--)if(e[o]!==t[o])return!0;return!1}var m={componentWillMount:function(){var t=this;if(!0!==c){var o=r(this),i=!1,a=!1;h.call(this,"props"),h.call(this,"state");var s=this.render.bind(this),l=null,u=!1,d=function(){return(l=new n.Reaction(o+".render()",(function(){if(!u&&(u=!0,"function"==typeof t.componentWillReact&&t.componentWillReact(),!0!==t.__$mobxIsUnmounted)){var n=!0;try{a=!0,i||e.Component.prototype.forceUpdate.call(t),n=!1}finally{a=!1,n&&l.dispose()}}}))).reactComponent=t,p.$mobx=l,t.render=p,p(t.props,t.state,t.context)},p=function(t,e,n){u=!1;var o=void 0,r=void 0;if(l.track((function(){try{r=g(!1,s,t,e,n)}catch(t){o=t}})),o)throw o;return r};this.render=d}function h(t){var e=this[t],o=n.createAtom("reactive "+t);Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:function(){return o.reportObserved(),e},set:function(t){!a&&y(e,t)?(e=t,i=!0,o.reportChanged(),i=!1):e=t}})}},componentWillUnmount:function(){!0!==c&&(this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0)},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(t,e){return c&&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||y(this.props,t)}};function b(t){var n,i;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((i=n=function(e){function n(){return a(this,n),u(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return l(n,e),s(n,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),n}(e.Component),n.displayName=r(t),i));if(!t)throw new Error("Please pass a valid component to 'observer'");return _(t.prototype||t),t.isMobXReactObserver=!0,t}function _(t){v(t,"componentWillMount",!0),v(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,o=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,i=Object.getOwnPropertyDescriptor,a=Object.getPrototypeOf,s=a&&a(Object);return function l(u,c,d){if("string"!=typeof c){if(s){var p=a(c);p&&p!==s&&l(u,p,d)}var h=o(c);r&&(h=h.concat(r(c)));for(var f=0;f<h.length;++f){var g=h[f];if(!(t[g]||e[g]||d&&d[g])){var v=i(c,g);try{n(u,g,v)}catch(t){}}}return u}return u}}))})),C={isMobxInjector:{value:!0,writable:!0,configurable:!0,enumerable:!0}};function M(t,n,o){var i,c,d=r(n,{prefix:"inject-",suffix:o?"-with-"+o:""}),p=(c=i=function(o){function r(){return a(this,r),u(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return l(r,o),s(r,[{key:"render",value:function(){var o={};for(var r in this.props)this.props.hasOwnProperty(r)&&(o[r]=this.props[r]);var i=t(this.context.mobxStores||{},o,this.context)||{};for(var a in i)o[a]=i[a];return e.h(n,o)}}]),r}(e.Component),i.displayName=d,c);return S(p,n),p.wrappedComponent=n,Object.defineProperties(p,C),p}function O(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 T(){var t=void 0;if("function"==typeof arguments[0])return t=arguments[0],function(e){var n=M(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=O(e),function(n){return M(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?T.apply(null,t)(N(e)):function(e){return N(t,e)}:b(t)}var A={children:!0,key:!0,ref:!0},P=console,D=function(t){function n(){return a(this,n),u(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return l(n,t),s(n,[{key:"render",value:function(t){var n=t.children;return n.length>1?e.h("div",null," ",n," "):n[0]}},{key:"getChildContext",value:function(){var t={},e=this.context.mobxStores;if(e)for(var n in e)t[n]=e[n];for(var o in this.props)A[o]||"suppressChangedStoreWarning"===o||(t[o]=this.props[o]);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)A[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")}}]),n}(e.Component);if(!e.Component)throw new Error("mobx-preact requires Preact to be available");t.observer=b,t.Observer=x,t.useStaticRendering=p,t.connect=N,t.inject=T,t.Provider=D,Object.defineProperty(t,"__esModule",{value:!0})}(e,function(){if(S)return M;S=1;var t,e,n,o,r,i,a,s,l,u,c,d,p={},h=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function v(t,e){for(var n in e)t[n]=e[n];return t}function y(t){var e=t.parentNode;e&&e.removeChild(t)}function m(e,n,o){var r,i,a,s={};for(a in n)"key"==a?r=n[a]:"ref"==a?i=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?t.call(arguments,2):o),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return b(e,s,r,i,null)}function b(t,o,r,i,a){var s={type:t,props:o,key:r,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 _(t){return t.children}function x(t,e){this.props=t,this.context=e}function E(t,e){if(null==e)return t.__?E(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?E(t):null}function w(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 w(t)}}function C(t){(!t.__d&&(t.__d=!0)&&r.push(t)&&!O.__r++||i!==e.debounceRendering)&&((i=e.debounceRendering)||a)(O)}function O(){var t,n,o,i,a,l,u,c;for(r.sort(s);t=r.shift();)t.__d&&(n=r.length,i=void 0,l=(a=(o=t).__v).__e,u=[],c=[],o.__P&&((i=v({},a)).__v=a.__v+1,e.vnode&&e.vnode(i),I(o.__P,i,a,o.__n,o.__P.namespaceURI,32&a.__u?[l]:null,u,null==l?E(a):l,!!(32&a.__u),c),i.__v=a.__v,i.__.__k[i.__i]=i,L(u,i,c),i.__e!=l&&w(i)),r.length>n&&r.sort(s));O.__r=0}function T(t,e,n,o,r,i,a,s,l,u,c){var d,f,g,v,y,m=o&&o.__k||h,b=e.length;for(n.__d=l,N(n,e,m),l=n.__d,d=0;d<b;d++)null!=(g=n.__k[d])&&"boolean"!=typeof g&&"function"!=typeof g&&(f=-1===g.__i?p:m[g.__i]||p,g.__i=d,I(t,g,f,r,i,a,s,l,u,c),v=g.__e,g.ref&&f.ref!=g.ref&&(f.ref&&B(f.ref,null,g),c.push(g.ref,g.__c||v,g)),null==y&&null!=v&&(y=v),65536&g.__u||f.__k===g.__k?l=A(g,l,t):"function"==typeof g.type&&void 0!==g.__d?l=g.__d:v&&(l=v.nextSibling),g.__d=void 0,g.__u&=-196609);n.__d=l,n.__e=y}function N(t,e,n){var o,r,i,a,s,l=e.length,u=n.length,c=u,d=0;for(t.__k=[],o=0;o<l;o++)a=o+d,null!=(r=t.__k[o]=null==(r=e[o])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?b(null,r,null,null,null):g(r)?b(_,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?b(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=t,r.__b=t.__b+1,s=P(r,n,a,c),r.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof r.type&&(r.__u|=65536)):s!==a&&(s==a-1?d=s-a:s==a+1?d++:s>a?c>l-a?d+=s-a:d--:s<a&&d++,s!==o+d&&(r.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==t.__d&&(t.__d=E(i)),H(i,i,!1),n[a]=null,c--);if(c)for(o=0;o<u;o++)null!=(i=n[o])&&!(131072&i.__u)&&(i.__e==t.__d&&(t.__d=E(i)),H(i,i))}function A(t,e,n){var o,r;if("function"==typeof t.type){for(o=t.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=t,e=A(o[r],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=E(t)),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,o){var r=t.key,i=t.type,a=n-1,s=n+1,l=e[n];if(null===l||l&&r==l.key&&i===l.type&&!(131072&l.__u))return n;if(o>(null==l||131072&l.__u?0:1))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&!(131072&l.__u)&&r==l.key&&i===l.type)return a;a--}if(s<e.length){if((l=e[s])&&!(131072&l.__u)&&r==l.key&&i===l.type)return s;s++}}return-1}function D(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||f.test(e)?n:n+"px"}function k(t,e,n,o,r){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||D(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||D(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?o?n.t=o.t:(n.t=l,t.addEventListener(e,i?c:u,i)):t.removeEventListener(e,i?c:u,i);else{if("http://www.w3.org/2000/svg"==r)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&&"popover"!=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,"popover"==e&&1==n?"":n))}}function R(t){return function(n){if(this.l){var o=this.l[n.type+t];if(null==n.u)n.u=l++;else if(n.u<o.t)return;return o(e.event?e.event(n):n)}}}function I(t,n,o,r,i,a,s,l,u,c){var d,p,h,f,y,m,b,E,w,S,C,M,O,N,A,P,D=n.type;if(void 0!==n.constructor)return null;128&o.__u&&(u=!!(32&o.__u),a=[l=n.__e=o.__e]),(d=e.__b)&&d(n);t:if("function"==typeof D)try{if(E=n.props,w="prototype"in D&&D.prototype.render,S=(d=D.contextType)&&r[d.__c],C=d?S?S.props.value:d.__:r,o.__c?b=(p=n.__c=o.__c).__=p.__E:(w?n.__c=p=new D(E,C):(n.__c=p=new x(E,C),p.constructor=D,p.render=z),S&&S.sub(p),p.props=E,p.state||(p.state={}),p.context=C,p.__n=r,h=p.__d=!0,p.__h=[],p._sb=[]),w&&null==p.__s&&(p.__s=p.state),w&&null!=D.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=v({},p.__s)),v(p.__s,D.getDerivedStateFromProps(E,p.__s))),f=p.props,y=p.state,p.__v=n,h)w&&null==D.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),w&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(w&&null==D.getDerivedStateFromProps&&E!==f&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(E,C),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(E,p.__s,C)||n.__v===o.__v)){for(n.__v!==o.__v&&(p.props=E,p.state=p.__s,p.__d=!1),n.__e=o.__e,n.__k=o.__k,n.__k.forEach((function(t){t&&(t.__=n)})),M=0;M<p._sb.length;M++)p.__h.push(p._sb[M]);p._sb=[],p.__h.length&&s.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(E,p.__s,C),w&&null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(f,y,m)}))}if(p.context=C,p.props=E,p.__P=t,p.__e=!1,O=e.__r,N=0,w){for(p.state=p.__s,p.__d=!1,O&&O(n),d=p.render(p.props,p.state,p.context),A=0;A<p._sb.length;A++)p.__h.push(p._sb[A]);p._sb=[]}else do{p.__d=!1,O&&O(n),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++N<25);p.state=p.__s,null!=p.getChildContext&&(r=v(v({},r),p.getChildContext())),w&&!h&&null!=p.getSnapshotBeforeUpdate&&(m=p.getSnapshotBeforeUpdate(f,y)),T(t,g(P=null!=d&&d.type===_&&null==d.key?d.props.children:d)?P:[P],n,o,r,i,a,s,l,u,c),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),b&&(p.__E=p.__=null)}catch(t){if(n.__v=null,u||null!=a){for(n.__u|=u?160:32;l&&8===l.nodeType&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,n.__e=l}else n.__e=o.__e,n.__k=o.__k;e.__e(t,n,o)}else null==a&&n.__v===o.__v?(n.__k=o.__k,n.__e=o.__e):n.__e=j(o.__e,n,o,r,i,a,s,u,c);(d=e.diffed)&&d(n)}function L(t,n,o){n.__d=void 0;for(var r=0;r<o.length;r++)B(o[r],o[++r],o[++r]);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 j(e,n,o,r,i,a,s,l,u){var c,d,h,f,v,m,b,_=o.props,x=n.props,w=n.type;if("svg"===w?i="http://www.w3.org/2000/svg":"math"===w?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==!!w&&(w?v.localName===w:3===v.nodeType)){e=v,a[c]=null;break}if(null==e){if(null===w)return document.createTextNode(x);e=document.createElementNS(i,w,x.is&&x),a=null,l=!1}if(null===w)_===x||l&&e.data===x||(e.data=x);else{if(a=a&&t.call(e.childNodes),_=o.props||p,!l&&null!=a)for(_={},c=0;c<e.attributes.length;c++)_[(v=e.attributes[c]).name]=v.value;for(c in _)if(v=_[c],"children"==c);else if("dangerouslySetInnerHTML"==c)h=v;else if("key"!==c&&!(c in x)){if("value"==c&&"defaultValue"in x||"checked"==c&&"defaultChecked"in x)continue;k(e,c,null,v,i)}for(c in x)v=x[c],"children"==c?f=v:"dangerouslySetInnerHTML"==c?d=v:"value"==c?m=v:"checked"==c?b=v:"key"===c||l&&"function"!=typeof v||_[c]===v||k(e,c,v,_[c],i);if(d)l||h&&(d.__html===h.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),n.__k=[];else if(h&&(e.innerHTML=""),T(e,g(f)?f:[f],n,o,r,"foreignObject"===w?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:o.__k&&E(o,0),l,u),null!=a)for(c=a.length;c--;)null!=a[c]&&y(a[c]);l||(c="value",void 0!==m&&(m!==e[c]||"progress"===w&&!m||"option"===w&&m!==_[c])&&k(e,c,m,_[c],i),c="checked",void 0!==b&&b!==e[c]&&k(e,c,b,_[c],i))}return e}function B(t,n,o){try{if("function"==typeof t){var r="function"==typeof t.__u;r&&t.__u(),r&&null==n||(t.__u=t(n))}else t.current=n}catch(t){e.__e(t,o)}}function H(t,n,o){var r,i;if(e.unmount&&e.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||B(r,null,n)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){e.__e(t,n)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&H(r[i],n,o||"function"!=typeof t.type);o||null==t.__e||y(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function z(t,e,n){return this.constructor(t,n)}function F(n,o,r){var i,a,s,l;e.__&&e.__(n,o),a=(i="function"==typeof r)?null:r&&r.__k||o.__k,s=[],l=[],I(o,n=(!i&&r||o).__k=m(_,null,[n]),a||p,p,o.namespaceURI,!i&&r?[r]:a?null:o.firstChild?t.call(o.childNodes):null,s,!i&&r?r:a?a.__e:o.firstChild,i,l),L(s,n,l)}return t=h.slice,e={__e:function(t,e,n,o){for(var r,i,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(t)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,o||{}),a=r.__d),a)return r.__E=r}catch(e){t=e}throw t}},n=0,o=function(t){return null!=t&&null==t.constructor},x.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof t&&(t=t(v({},n),this.props)),t&&v(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),C(this))},x.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),C(this))},x.prototype.render=_,r=[],a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(t,e){return t.__v.__b-e.__v.__b},O.__r=0,l=0,u=R(!1),c=R(!0),d=0,M.Component=x,M.Fragment=_,M.cloneElement=function(e,n,o){var r,i,a,s,l=v({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)"key"==a?r=n[a]:"ref"==a?i=n[a]:l[a]=void 0===n[a]&&void 0!==s?s[a]:n[a];return arguments.length>2&&(l.children=arguments.length>3?t.call(arguments,2):o),b(e.type,l,r||e.key,i||e.ref,null)},M.createContext=function(t,e){var n={__c:e="__cC"+d++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,o;return this.getChildContext||(n=[],(o={})[e]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,C(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n},M.createElement=m,M.createRef=function(){return{current:null}},M.h=m,M.hydrate=function t(e,n){F(e,n,t)},M.isValidElement=o,M.options=e,M.render=F,M.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},M}(),Yn)}(0,C);var Vn,Kn,qn,Zn,$n,Jn,Qn,to,eo,no,oo={},ro=[],io=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ao=Array.isArray;function so(t,e){for(var n in e)t[n]=e[n];return t}function lo(t){var e=t.parentNode;e&&e.removeChild(t)}function uo(t,e,n){var o,r,i,a={};for(i in e)"key"==i?o=e[i]:"ref"==i?r=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?Vn.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 co(t,a,o,r,null)}function co(t,e,n,o,r){var i={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++qn:r,__i:-1,__u:0};return null==r&&null!=Kn.vnode&&Kn.vnode(i),i}function po(t){return t.children}function ho(t,e){this.props=t,this.context=e}function fo(t,e){if(null==e)return t.__?fo(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?fo(t):null}function go(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 go(t)}}function vo(t){(!t.__d&&(t.__d=!0)&&Zn.push(t)&&!yo.__r++||$n!==Kn.debounceRendering)&&(($n=Kn.debounceRendering)||Jn)(yo)}function yo(){var t,e,n,o,r,i,a,s;for(Zn.sort(Qn);t=Zn.shift();)t.__d&&(e=Zn.length,o=void 0,i=(r=(n=t).__v).__e,a=[],s=[],n.__P&&((o=so({},r)).__v=r.__v+1,Kn.vnode&&Kn.vnode(o),Mo(n.__P,o,r,n.__n,n.__P.namespaceURI,32&r.__u?[i]:null,a,null==i?fo(r):i,!!(32&r.__u),s),o.__v=r.__v,o.__.__k[o.__i]=o,Oo(a,o,s),o.__e!=i&&go(o)),Zn.length>e&&Zn.sort(Qn));yo.__r=0}function mo(t,e,n,o,r,i,a,s,l,u,c){var d,p,h,f,g,v=o&&o.__k||ro,y=e.length;for(n.__d=l,bo(n,e,v),l=n.__d,d=0;d<y;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(p=-1===h.__i?oo:v[h.__i]||oo,h.__i=d,Mo(t,h,p,r,i,a,s,l,u,c),f=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&No(p.ref,null,h),c.push(h.ref,h.__c||f,h)),null==g&&null!=f&&(g=f),65536&h.__u||p.__k===h.__k?l=_o(h,l,t):"function"==typeof h.type&&void 0!==h.__d?l=h.__d:f&&(l=f.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=l,n.__e=g}function bo(t,e,n){var o,r,i,a,s,l=e.length,u=n.length,c=u,d=0;for(t.__k=[],o=0;o<l;o++)a=o+d,null!=(r=t.__k[o]=null==(r=e[o])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?co(null,r,null,null,null):ao(r)?co(po,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?co(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=t,r.__b=t.__b+1,s=Eo(r,n,a,c),r.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof r.type&&(r.__u|=65536)):s!==a&&(s==a-1?d=s-a:s==a+1?d++:s>a?c>l-a?d+=s-a:d--:s<a&&d++,s!==o+d&&(r.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==t.__d&&(t.__d=fo(i)),Ao(i,i,!1),n[a]=null,c--);if(c)for(o=0;o<u;o++)null!=(i=n[o])&&!(131072&i.__u)&&(i.__e==t.__d&&(t.__d=fo(i)),Ao(i,i))}function _o(t,e,n){var o,r;if("function"==typeof t.type){for(o=t.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=t,e=_o(o[r],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=fo(t)),n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function xo(t,e){return e=e||[],null==t||"boolean"==typeof t||(ao(t)?t.some((function(t){xo(t,e)})):e.push(t)),e}function Eo(t,e,n,o){var r=t.key,i=t.type,a=n-1,s=n+1,l=e[n];if(null===l||l&&r==l.key&&i===l.type&&!(131072&l.__u))return n;if(o>(null==l||131072&l.__u?0:1))for(;a>=0||s<e.length;){if(a>=0){if((l=e[a])&&!(131072&l.__u)&&r==l.key&&i===l.type)return a;a--}if(s<e.length){if((l=e[s])&&!(131072&l.__u)&&r==l.key&&i===l.type)return s;s++}}return-1}function wo(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||io.test(e)?n:n+"px"}function So(t,e,n,o,r){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||wo(t.style,e,"");if(n)for(e in n)o&&n[e]===o[e]||wo(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?o?n.u=o.u:(n.u=to,t.addEventListener(e,i?no:eo,i)):t.removeEventListener(e,i?no:eo,i);else{if("http://www.w3.org/2000/svg"==r)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&&"popover"!=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,"popover"==e&&1==n?"":n))}}function Co(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e.t)e.t=to++;else if(e.t<n.u)return;return n(Kn.event?Kn.event(e):e)}}}function Mo(t,e,n,o,r,i,a,s,l,u){var c,d,p,h,f,g,v,y,m,b,_,x,E,w,S,C,M=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(l=!!(32&n.__u),i=[s=e.__e=n.__e]),(c=Kn.__b)&&c(e);t:if("function"==typeof M)try{if(y=e.props,m="prototype"in M&&M.prototype.render,b=(c=M.contextType)&&o[c.__c],_=c?b?b.props.value:c.__:o,n.__c?v=(d=e.__c=n.__c).__=d.__E:(m?e.__c=d=new M(y,_):(e.__c=d=new ho(y,_),d.constructor=M,d.render=Po),b&&b.sub(d),d.props=y,d.state||(d.state={}),d.context=_,d.__n=o,p=d.__d=!0,d.__h=[],d._sb=[]),m&&null==d.__s&&(d.__s=d.state),m&&null!=M.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=so({},d.__s)),so(d.__s,M.getDerivedStateFromProps(y,d.__s))),h=d.props,f=d.state,d.__v=e,p)m&&null==M.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),m&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(m&&null==M.getDerivedStateFromProps&&y!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,_),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,_)||e.__v===n.__v)){for(e.__v!==n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),x=0;x<d._sb.length;x++)d.__h.push(d._sb[x]);d._sb=[],d.__h.length&&a.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,_),m&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(h,f,g)}))}if(d.context=_,d.props=y,d.__P=t,d.__e=!1,E=Kn.__r,w=0,m){for(d.state=d.__s,d.__d=!1,E&&E(e),c=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,E&&E(e),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++w<25);d.state=d.__s,null!=d.getChildContext&&(o=so(so({},o),d.getChildContext())),m&&!p&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(h,f)),mo(t,ao(C=null!=c&&c.type===po&&null==c.key?c.props.children:c)?C:[C],e,n,o,r,i,a,s,l,u),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),v&&(d.__E=d.__=null)}catch(t){if(e.__v=null,l||null!=i){for(e.__u|=l?160:32;s&&8===s.nodeType&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,e.__e=s}else e.__e=n.__e,e.__k=n.__k;Kn.__e(t,e,n)}else null==i&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=To(n.__e,e,n,o,r,i,a,l,u);(c=Kn.diffed)&&c(e)}function Oo(t,e,n){e.__d=void 0;for(var o=0;o<n.length;o++)No(n[o],n[++o],n[++o]);Kn.__c&&Kn.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Kn.__e(t,e.__v)}}))}function To(t,e,n,o,r,i,a,s,l){var u,c,d,p,h,f,g,v=n.props,y=e.props,m=e.type;if("svg"===m?r="http://www.w3.org/2000/svg":"math"===m?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=i)for(u=0;u<i.length;u++)if((h=i[u])&&"setAttribute"in h==!!m&&(m?h.localName===m:3===h.nodeType)){t=h,i[u]=null;break}if(null==t){if(null===m)return document.createTextNode(y);t=document.createElementNS(r,m,y.is&&y),i=null,s=!1}if(null===m)v===y||s&&t.data===y||(t.data=y);else{if(i=i&&Vn.call(t.childNodes),v=n.props||oo,!s&&null!=i)for(v={},u=0;u<t.attributes.length;u++)v[(h=t.attributes[u]).name]=h.value;for(u in v)if(h=v[u],"children"==u);else if("dangerouslySetInnerHTML"==u)d=h;else if("key"!==u&&!(u in y)){if("value"==u&&"defaultValue"in y||"checked"==u&&"defaultChecked"in y)continue;So(t,u,null,h,r)}for(u in y)h=y[u],"children"==u?p=h:"dangerouslySetInnerHTML"==u?c=h:"value"==u?f=h:"checked"==u?g=h:"key"===u||s&&"function"!=typeof h||v[u]===h||So(t,u,h,v[u],r);if(c)s||d&&(c.__html===d.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(d&&(t.innerHTML=""),mo(t,ao(p)?p:[p],e,n,o,"foreignObject"===m?"http://www.w3.org/1999/xhtml":r,i,a,i?i[0]:n.__k&&fo(n,0),s,l),null!=i)for(u=i.length;u--;)null!=i[u]&&lo(i[u]);s||(u="value",void 0!==f&&(f!==t[u]||"progress"===m&&!f||"option"===m&&f!==v[u])&&So(t,u,f,v[u],r),u="checked",void 0!==g&&g!==t[u]&&So(t,u,g,v[u],r))}return t}function No(t,e,n){try{if("function"==typeof t){var o="function"==typeof t.__u;o&&t.__u(),o&&null==e||(t.__u=t(e))}else t.current=e}catch(t){Kn.__e(t,n)}}function Ao(t,e,n){var o,r;if(Kn.unmount&&Kn.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||No(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){Kn.__e(t,e)}o.base=o.__P=null}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&Ao(o[r],e,n||"function"!=typeof t.type);n||null==t.__e||lo(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function Po(t,e,n){return this.constructor(t,n)}function Do(t,e,n){var o,r,i,a;Kn.__&&Kn.__(t,e),r=(o="function"==typeof n)?null:n&&n.__k||e.__k,i=[],a=[],Mo(e,t=(!o&&n||e).__k=uo(po,null,[t]),r||oo,oo,e.namespaceURI,!o&&n?[n]:r?null:e.firstChild?Vn.call(e.childNodes):null,i,!o&&n?n:r?r.__e:e.firstChild,o,a),Oo(i,t,a)}Vn=ro.slice,Kn={__e:function(t,e,n,o){for(var r,i,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(t)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,o||{}),a=r.__d),a)return r.__E=r}catch(e){t=e}throw t}},qn=0,ho.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=so({},this.state),"function"==typeof t&&(t=t(so({},n),this.props)),t&&so(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),vo(this))},ho.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),vo(this))},ho.prototype.render=po,Zn=[],Jn="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Qn=function(t,e){return t.__v.__b-e.__v.__b},yo.__r=0,to=0,eo=Co(!1),no=Co(!0);var ko,Ro,Io,Lo=[],jo=Kn,Bo=jo.__b,Ho=jo.__r,zo=jo.diffed,Fo=jo.__c,Wo=jo.unmount,Go=jo.__;function Xo(){for(var t;t=Lo.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Vo),t.__H.__h.forEach(Ko),t.__H.__h=[]}catch(e){t.__H.__h=[],jo.__e(e,t.__v)}}jo.__b=function(t){ko=null,Bo&&Bo(t)},jo.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Go&&Go(t,e)},jo.__r=function(t){Ho&&Ho(t);var e=(ko=t.__c).__H;e&&(Ro===ko?(e.__h=[],ko.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0}))):(e.__h.forEach(Vo),e.__h.forEach(Ko),e.__h=[])),Ro=ko},jo.diffed=function(t){zo&&zo(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==Lo.push(e)&&Io===jo.requestAnimationFrame||((Io=jo.requestAnimationFrame)||Yo)(Xo)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.i=void 0}))),Ro=ko=null},jo.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Vo),t.__h=t.__h.filter((function(t){return!t.__||Ko(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],jo.__e(n,t.__v)}})),Fo&&Fo(t,e)},jo.unmount=function(t){Wo&&Wo(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{Vo(t)}catch(t){e=t}})),n.__H=void 0,e&&jo.__e(e,n.__v))};var Uo="function"==typeof requestAnimationFrame;function Yo(t){var e,n=function(){clearTimeout(o),Uo&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,100);Uo&&(e=requestAnimationFrame(n))}function Vo(t){var e=ko,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),ko=e}function Ko(t){var e=ko;t.__c=t.__(),ko=e}function qo(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var o in e)if("__source"!==o&&t[o]!==e[o])return!0;return!1}function Zo(t,e){this.props=t,this.context=e}(Zo.prototype=new ho).isPureReactComponent=!0,Zo.prototype.shouldComponentUpdate=function(t,e){return qo(this.props,t)||qo(this.state,e)};var $o=Kn.__b;Kn.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),$o&&$o(t)};var Jo=Kn.__e;Kn.__e=function(t,e,n,o){if(t.then)for(var r,i=e;i=i.__;)if((r=i.__c)&&r.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e);Jo(t,e,n,o)};var Qo=Kn.unmount;function tr(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 tr(t,e,n)}))),t}function er(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return er(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 nr(){this.__u=0,this.t=null,this.__b=null}function or(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function rr(){this.u=null,this.o=null}Kn.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Qo&&Qo(t)},(nr.prototype=new ho).__c=function(t,e){var n=e.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var r=or(o.__v),i=!1,a=function(){i||(i=!0,n.__R=null,r?r(s):s())};n.__R=a;var s=function(){if(! --o.__u){if(o.state.__a){var t=o.state.__a;o.__v.__k[0]=er(t,t.__c.__P,t.__c.__O)}var e;for(o.setState({__a:o.__b=null});e=o.t.pop();)e.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(a,a)},nr.prototype.componentWillUnmount=function(){this.t=[]},nr.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=tr(this.__b,n,o.__O=o.__P)}this.__b=null}var r=e.__a&&uo(po,null,t.fallback);return r&&(r.__u&=-33),[uo(po,null,e.__a?null:t.children),r]};var ir=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]}};(rr.prototype=new ho).__a=function(t){var e=this,n=or(e.__v),o=e.o.get(t);return o[0]++,function(r){var i=function(){e.props.revealOrder?(o.push(r),ir(e,t,o)):r()};n?n(i):i()}},rr.prototype.render=function(t){this.u=null,this.o=new Map;var e=xo(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},rr.prototype.componentDidUpdate=rr.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){ir(t,n,e)}))};var ar="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,sr=/^(?: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]/,lr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ur=/[A-Z0-9]/g,cr="undefined"!=typeof document,dr=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};ho.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(ho.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var pr=Kn.event;function hr(){}function fr(){return this.cancelBubble}function gr(){return this.defaultPrevented}Kn.event=function(t){return pr&&(t=pr(t)),t.persist=hr,t.isPropagationStopped=fr,t.isDefaultPrevented=gr,t.nativeEvent=t};var vr={enumerable:!1,configurable:!0,get:function(){return this.class}},yr=Kn.vnode;Kn.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,o={};for(var r in e){var i=e[r];if(!("value"===r&&"defaultValue"in e&&null==i||cr&&"children"===r&&"noscript"===n||"class"===r||"className"===r)){var a=r.toLowerCase();"defaultValue"===r&&"value"in e&&null==e.value?r="value":"download"===r&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"ondoubleclick"===a?r="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||dr(e.type)?"onfocus"===a?r="onfocusin":"onblur"===a?r="onfocusout":lr.test(r)?r=a:-1===n.indexOf("-")&&sr.test(r)?r=r.replace(ur,"-$&").toLowerCase():null===i&&(i=void 0):a=r="oninput","oninput"===a&&o[r=a]&&(r="oninputCapture"),o[r]=i}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=xo(e.children).forEach((function(t){t.props.selected=-1!=o.value.indexOf(t.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=xo(e.children).forEach((function(t){t.props.selected=o.multiple?-1!=o.defaultValue.indexOf(t.props.value):o.defaultValue==t.props.value}))),e.class&&!e.className?(o.class=e.class,Object.defineProperty(o,"className",vr)):(e.className&&!e.class||e.class&&e.className)&&(o.class=o.className=e.className),t.props=o}(t),t.$$typeof=ar,yr&&yr(t)};var mr=Kn.__r;Kn.__r=function(t){mr&&mr(t),t.__c};var br=Kn.diffed;Kn.diffed=function(t){br&&br(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 _r=0;function xr(t,e,n,o,r,i){e||(e={});var a,s,l=e;if("ref"in l)for(s in l={},e)"ref"==s?a=e[s]:l[s]=e[s];var u={type:t,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--_r,__i:-1,__u:0,__source:r,__self:i};if("function"==typeof t&&(a=t.defaultProps))for(s in a)void 0===l[s]&&(l[s]=a[s]);return Kn.vnode&&Kn.vnode(u),u}var Er="object"==typeof global&&global&&global.Object===Object&&global,wr="object"==typeof self&&self&&self.Object===Object&&self,Sr=Er||wr||Function("return this")(),Cr=Sr.Symbol,Mr=Object.prototype,Or=Mr.hasOwnProperty,Tr=Mr.toString,Nr=Cr?Cr.toStringTag:void 0;var Ar=Object.prototype.toString;var Pr="[object Null]",Dr="[object Undefined]",kr=Cr?Cr.toStringTag:void 0;function Rr(t){return null==t?void 0===t?Dr:Pr:kr&&kr in Object(t)?function(t){var e=Or.call(t,Nr),n=t[Nr];try{t[Nr]=void 0;var o=!0}catch(t){}var r=Tr.call(t);return o&&(e?t[Nr]=n:delete t[Nr]),r}(t):function(t){return Ar.call(t)}(t)}function Ir(t){return null!=t&&"object"==typeof t}var Lr="[object Symbol]";function jr(t){return"symbol"==typeof t||Ir(t)&&Rr(t)==Lr}var Br=NaN;function Hr(t){return"number"==typeof t?t:jr(t)?Br:+t}function zr(t,e){for(var n=-1,o=null==t?0:t.length,r=Array(o);++n<o;)r[n]=e(t[n],n,t);return r}var Fr=Array.isArray,Wr=1/0,Gr=Cr?Cr.prototype:void 0,Xr=Gr?Gr.toString:void 0;function Ur(t){if("string"==typeof t)return t;if(Fr(t))return zr(t,Ur)+"";if(jr(t))return Xr?Xr.call(t):"";var e=t+"";return"0"==e&&1/t==-Wr?"-0":e}function Yr(t,e){return function(n,o){var r;if(void 0===n&&void 0===o)return e;if(void 0!==n&&(r=n),void 0!==o){if(void 0===r)return o;"string"==typeof n||"string"==typeof o?(n=Ur(n),o=Ur(o)):(n=Hr(n),o=Hr(o)),r=t(n,o)}return r}}var Vr=Yr((function(t,e){return t+e}),0),Kr=/\s/;function qr(t){for(var e=t.length;e--&&Kr.test(t.charAt(e)););return e}var Zr=/^\s+/;function $r(t){return t?t.slice(0,qr(t)+1).replace(Zr,""):t}function Jr(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Qr=NaN,ti=/^[-+]0x[0-9a-f]+$/i,ei=/^0b[01]+$/i,ni=/^0o[0-7]+$/i,oi=parseInt;function ri(t){if("number"==typeof t)return t;if(jr(t))return Qr;if(Jr(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Jr(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$r(t);var n=ei.test(t);return n||ni.test(t)?oi(t.slice(2),n?2:8):ti.test(t)?Qr:+t}var ii=1/0,ai=17976931348623157e292;function si(t){return t?(t=ri(t))===ii||t===-ii?(t<0?-1:1)*ai:t==t?t:0:0===t?t:0}function li(t){var e=si(t),n=e%1;return e==e?n?e-n:e:0}function ui(t){return t}var ci="[object AsyncFunction]",di="[object Function]",pi="[object GeneratorFunction]",hi="[object Proxy]";function fi(t){if(!Jr(t))return!1;var e=Rr(t);return e==di||e==pi||e==ci||e==hi}var gi,vi=Sr["__core-js_shared__"],yi=(gi=/[^.]+$/.exec(vi&&vi.keys&&vi.keys.IE_PROTO||""))?"Symbol(src)_1."+gi:"";var mi=Function.prototype.toString;function bi(t){if(null!=t){try{return mi.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var _i=/^\[object .+?Constructor\]$/,xi=Function.prototype,Ei=Object.prototype,wi=xi.toString,Si=Ei.hasOwnProperty,Ci=RegExp("^"+wi.call(Si).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mi(t){return!(!Jr(t)||function(t){return!!yi&&yi in t}(t))&&(fi(t)?Ci:_i).test(bi(t))}function Oi(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Mi(n)?n:void 0}var Ti=Oi(Sr,"WeakMap"),Ni=Ti&&new Ti,Ai=Ni?function(t,e){return Ni.set(t,e),t}:ui,Pi=Object.create,Di=function(){function t(){}return function(e){if(!Jr(e))return{};if(Pi)return Pi(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function ki(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=Di(t.prototype),o=t.apply(n,e);return Jr(o)?o:n}}var Ri=1;function Ii(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 Li=Math.max;function ji(t,e,n,o){for(var r=-1,i=t.length,a=n.length,s=-1,l=e.length,u=Li(i-a,0),c=Array(l+u),d=!o;++s<l;)c[s]=e[s];for(;++r<a;)(d||r<i)&&(c[n[r]]=t[r]);for(;u--;)c[s++]=t[r++];return c}var Bi=Math.max;function Hi(t,e,n,o){for(var r=-1,i=t.length,a=-1,s=n.length,l=-1,u=e.length,c=Bi(i-s,0),d=Array(c+u),p=!o;++r<c;)d[r]=t[r];for(var h=r;++l<u;)d[h+l]=e[l];for(;++a<s;)(p||r<i)&&(d[h+n[a]]=t[r++]);return d}function zi(){}var Fi=4294967295;function Wi(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Fi,this.__views__=[]}function Gi(){}Wi.prototype=Di(zi.prototype),Wi.prototype.constructor=Wi;var Xi=Ni?function(t){return Ni.get(t)}:Gi,Ui={},Yi=Object.prototype.hasOwnProperty;function Vi(t){for(var e=t.name+"",n=Ui[e],o=Yi.call(Ui,e)?n.length:0;o--;){var r=n[o],i=r.func;if(null==i||i==t)return r.name}return e}function Ki(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function qi(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}function Zi(t){if(t instanceof Wi)return t.clone();var e=new Ki(t.__wrapped__,t.__chain__);return e.__actions__=qi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}Ki.prototype=Di(zi.prototype),Ki.prototype.constructor=Ki;var $i=Object.prototype.hasOwnProperty;function Ji(t){if(Ir(t)&&!Fr(t)&&!(t instanceof Wi)){if(t instanceof Ki)return t;if($i.call(t,"__wrapped__"))return Zi(t)}return new Ki(t)}function Qi(t){var e=Vi(t),n=Ji[e];if("function"!=typeof n||!(e in Wi.prototype))return!1;if(t===n)return!0;var o=Xi(n);return!!o&&t===o[0]}Ji.prototype=zi.prototype,Ji.prototype.constructor=Ji;var ta=Date.now;function ea(t){var e=0,n=0;return function(){var o=ta(),r=16-(o-n);if(n=o,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var na=ea(Ai),oa=/\{\n\/\* \[wrapped with (.+)\] \*/,ra=/,? & /;var ia=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function aa(t){return function(){return t}}var sa=function(){try{var t=Oi(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),la=sa?function(t,e){return sa(t,"toString",{configurable:!0,enumerable:!1,value:aa(e),writable:!0})}:ui,ua=ea(la);function ca(t,e){for(var n=-1,o=null==t?0:t.length;++n<o&&!1!==e(t[n],n,t););return t}function da(t,e,n,o){for(var r=t.length,i=n+(o?1:-1);o?i--:++i<r;)if(e(t[i],i,t))return i;return-1}function pa(t){return t!=t}function ha(t,e,n){return e==e?function(t,e,n){for(var o=n-1,r=t.length;++o<r;)if(t[o]===e)return o;return-1}(t,e,n):da(t,pa,n)}function fa(t,e){return!!(null==t?0:t.length)&&ha(t,e,0)>-1}var ga=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function va(t,e,n){var o=e+"";return ua(t,function(t,e){var n=e.length;if(!n)return t;var o=n-1;return e[o]=(n>1?"& ":"")+e[o],e=e.join(n>2?", ":" "),t.replace(ia,"{\n/* [wrapped with "+e+"] */\n")}(o,function(t,e){return ca(ga,(function(n){var o="_."+n[0];e&n[1]&&!fa(t,o)&&t.push(o)})),t.sort()}(function(t){var e=t.match(oa);return e?e[1].split(ra):[]}(o),n)))}var ya=1,ma=2,ba=4,_a=8,xa=32,Ea=64;function wa(t,e,n,o,r,i,a,s,l,u){var c=e&_a;e|=c?xa:Ea,(e&=~(c?Ea:xa))&ba||(e&=~(ya|ma));var d=[t,e,r,c?i:void 0,c?a:void 0,c?void 0:i,c?void 0:a,s,l,u],p=n.apply(void 0,d);return Qi(t)&&na(p,d),p.placeholder=o,va(p,t,e)}function Sa(t){return t.placeholder}var Ca=9007199254740991,Ma=/^(?:0|[1-9]\d*)$/;function Oa(t,e){var n=typeof t;return!!(e=null==e?Ca:e)&&("number"==n||"symbol"!=n&&Ma.test(t))&&t>-1&&t%1==0&&t<e}var Ta=Math.min;var Na="__lodash_placeholder__";function Aa(t,e){for(var n=-1,o=t.length,r=0,i=[];++n<o;){var a=t[n];a!==e&&a!==Na||(t[n]=Na,i[r++]=n)}return i}var Pa=1,Da=2,ka=8,Ra=16,Ia=128,La=512;function ja(t,e,n,o,r,i,a,s,l,u){var c=e&Ia,d=e&Pa,p=e&Da,h=e&(ka|Ra),f=e&La,g=p?void 0:ki(t);return function v(){for(var y=arguments.length,m=Array(y),b=y;b--;)m[b]=arguments[b];if(h)var _=Sa(v),x=function(t,e){for(var n=t.length,o=0;n--;)t[n]===e&&++o;return o}(m,_);if(o&&(m=ji(m,o,r,h)),i&&(m=Hi(m,i,a,h)),y-=x,h&&y<u){var E=Aa(m,_);return wa(t,e,ja,v.placeholder,n,m,E,s,l,u-y)}var w=d?n:this,S=p?w[t]:t;return y=m.length,s?m=function(t,e){for(var n=t.length,o=Ta(e.length,n),r=qi(t);o--;){var i=e[o];t[o]=Oa(i,n)?r[i]:void 0}return t}(m,s):f&&y>1&&m.reverse(),c&&l<y&&(m.length=l),this&&this!==Sr&&this instanceof v&&(S=g||ki(S)),S.apply(w,m)}}var Ba=1;var Ha="__lodash_placeholder__",za=1,Fa=2,Wa=4,Ga=8,Xa=128,Ua=256,Ya=Math.min;var Va="Expected a function",Ka=1,qa=2,Za=8,$a=16,Ja=32,Qa=64,ts=Math.max;function es(t,e,n,o,r,i,a,s){var l=e&qa;if(!l&&"function"!=typeof t)throw new TypeError(Va);var u=o?o.length:0;if(u||(e&=~(Ja|Qa),o=r=void 0),a=void 0===a?a:ts(li(a),0),s=void 0===s?s:li(s),u-=r?r.length:0,e&Qa){var c=o,d=r;o=r=void 0}var p=l?void 0:Xi(t),h=[t,e,n,o,r,c,d,i,a,s];if(p&&function(t,e){var n=t[1],o=e[1],r=n|o,i=r<(za|Fa|Xa),a=o==Xa&&n==Ga||o==Xa&&n==Ua&&t[7].length<=e[8]||o==(Xa|Ua)&&e[7].length<=e[8]&&n==Ga;if(!i&&!a)return t;o&za&&(t[2]=e[2],r|=n&za?0:Wa);var s=e[3];if(s){var l=t[3];t[3]=l?ji(l,s,e[4]):s,t[4]=l?Aa(t[3],Ha):e[4]}(s=e[5])&&(l=t[5],t[5]=l?Hi(l,s,e[6]):s,t[6]=l?Aa(t[5],Ha):e[6]),(s=e[7])&&(t[7]=s),o&Xa&&(t[8]=null==t[8]?e[8]:Ya(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=r}(h,p),t=h[0],e=h[1],n=h[2],o=h[3],r=h[4],!(s=h[9]=void 0===h[9]?l?0:t.length:ts(h[9]-u,0))&&e&(Za|$a)&&(e&=~(Za|$a)),e&&e!=Ka)f=e==Za||e==$a?function(t,e,n){var o=ki(t);return function r(){for(var i=arguments.length,a=Array(i),s=i,l=Sa(r);s--;)a[s]=arguments[s];var u=i<3&&a[0]!==l&&a[i-1]!==l?[]:Aa(a,l);return(i-=u.length)<n?wa(t,e,ja,r.placeholder,void 0,a,u,void 0,void 0,n-i):Ii(this&&this!==Sr&&this instanceof r?o:t,this,a)}}(t,e,s):e!=Ja&&e!=(Ka|Ja)||r.length?ja.apply(void 0,h):function(t,e,n,o){var r=e&Ba,i=ki(t);return function e(){for(var a=-1,s=arguments.length,l=-1,u=o.length,c=Array(u+s),d=this&&this!==Sr&&this instanceof e?i:t;++l<u;)c[l]=o[l];for(;s--;)c[l++]=arguments[++a];return Ii(d,r?n:this,c)}}(t,e,n,o);else var f=function(t,e,n){var o=e&Ri,r=ki(t);return function e(){return(this&&this!==Sr&&this instanceof e?r:t).apply(o?n:this,arguments)}}(t,e,n);return va((p?Ai:na)(f,h),t,e)}var ns=128;function os(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,es(t,ns,void 0,void 0,void 0,void 0,e)}function rs(t,e,n){"__proto__"==e&&sa?sa(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function is(t,e){return t===e||t!=t&&e!=e}var as=Object.prototype.hasOwnProperty;function ss(t,e,n){var o=t[e];as.call(t,e)&&is(o,n)&&(void 0!==n||e in t)||rs(t,e,n)}function ls(t,e,n,o){var r=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],l=o?o(n[s],t[s],s,n,t):void 0;void 0===l&&(l=t[s]),r?rs(n,s,l):ss(n,s,l)}return n}var us=Math.max;function cs(t,e,n){return e=us(void 0===e?t.length-1:e,0),function(){for(var o=arguments,r=-1,i=us(o.length-e,0),a=Array(i);++r<i;)a[r]=o[e+r];r=-1;for(var s=Array(e+1);++r<e;)s[r]=o[r];return s[e]=n(a),Ii(t,this,s)}}function ds(t,e){return ua(cs(t,e,ui),t+"")}var ps=9007199254740991;function hs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=ps}function fs(t){return null!=t&&hs(t.length)&&!fi(t)}function gs(t,e,n){if(!Jr(n))return!1;var o=typeof e;return!!("number"==o?fs(n)&&Oa(e,n.length):"string"==o&&e in n)&&is(n[e],t)}function vs(t){return ds((function(e,n){var o=-1,r=n.length,i=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(r--,i):void 0,a&&gs(n[0],n[1],a)&&(i=r<3?void 0:i,r=1),e=Object(e);++o<r;){var s=n[o];s&&t(e,s,o,i)}return e}))}var ys=Object.prototype;function ms(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ys)}function bs(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}function _s(t){return Ir(t)&&"[object Arguments]"==Rr(t)}var xs=Object.prototype,Es=xs.hasOwnProperty,ws=xs.propertyIsEnumerable,Ss=_s(function(){return arguments}())?_s:function(t){return Ir(t)&&Es.call(t,"callee")&&!ws.call(t,"callee")};function Cs(){return!1}var Ms="object"==typeof t&&t&&!t.nodeType&&t,Os=Ms&&"object"==typeof module&&module&&!module.nodeType&&module,Ts=Os&&Os.exports===Ms?Sr.Buffer:void 0,Ns=(Ts?Ts.isBuffer:void 0)||Cs,As={};function Ps(t){return function(e){return t(e)}}As["[object Float32Array]"]=As["[object Float64Array]"]=As["[object Int8Array]"]=As["[object Int16Array]"]=As["[object Int32Array]"]=As["[object Uint8Array]"]=As["[object Uint8ClampedArray]"]=As["[object Uint16Array]"]=As["[object Uint32Array]"]=!0,As["[object Arguments]"]=As["[object Array]"]=As["[object ArrayBuffer]"]=As["[object Boolean]"]=As["[object DataView]"]=As["[object Date]"]=As["[object Error]"]=As["[object Function]"]=As["[object Map]"]=As["[object Number]"]=As["[object Object]"]=As["[object RegExp]"]=As["[object Set]"]=As["[object String]"]=As["[object WeakMap]"]=!1;var Ds="object"==typeof t&&t&&!t.nodeType&&t,ks=Ds&&"object"==typeof module&&module&&!module.nodeType&&module,Rs=ks&&ks.exports===Ds&&Er.process,Is=function(){try{var t=ks&&ks.require&&ks.require("util").types;return t||Rs&&Rs.binding&&Rs.binding("util")}catch(t){}}(),Ls=Is&&Is.isTypedArray,js=Ls?Ps(Ls):function(t){return Ir(t)&&hs(t.length)&&!!As[Rr(t)]},Bs=Object.prototype.hasOwnProperty;function Hs(t,e){var n=Fr(t),o=!n&&Ss(t),r=!n&&!o&&Ns(t),i=!n&&!o&&!r&&js(t),a=n||o||r||i,s=a?bs(t.length,String):[],l=s.length;for(var u in t)!e&&!Bs.call(t,u)||a&&("length"==u||r&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||Oa(u,l))||s.push(u);return s}function zs(t,e){return function(n){return t(e(n))}}var Fs=zs(Object.keys,Object),Ws=Object.prototype.hasOwnProperty;function Gs(t){if(!ms(t))return Fs(t);var e=[];for(var n in Object(t))Ws.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Xs(t){return fs(t)?Hs(t):Gs(t)}var Us=Object.prototype.hasOwnProperty,Ys=vs((function(t,e){if(ms(e)||fs(e))ls(e,Xs(e),t);else for(var n in e)Us.call(e,n)&&ss(t,n,e[n])}));var Vs=Object.prototype.hasOwnProperty;function Ks(t){if(!Jr(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=ms(t),n=[];for(var o in t)("constructor"!=o||!e&&Vs.call(t,o))&&n.push(o);return n}function qs(t){return fs(t)?Hs(t,!0):Ks(t)}var Zs=vs((function(t,e){ls(e,qs(e),t)})),$s=vs((function(t,e,n,o){ls(e,qs(e),t,o)})),Js=vs((function(t,e,n,o){ls(e,Xs(e),t,o)})),Qs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tl=/^\w*$/;function el(t,e){if(Fr(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!jr(t))||(tl.test(t)||!Qs.test(t)||null!=e&&t in Object(e))}var nl=Oi(Object,"create");var ol=Object.prototype.hasOwnProperty;var rl=Object.prototype.hasOwnProperty;function il(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function al(t,e){for(var n=t.length;n--;)if(is(t[n][0],e))return n;return-1}il.prototype.clear=function(){this.__data__=nl?nl(null):{},this.size=0},il.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},il.prototype.get=function(t){var e=this.__data__;if(nl){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return ol.call(e,t)?e[t]:void 0},il.prototype.has=function(t){var e=this.__data__;return nl?void 0!==e[t]:rl.call(e,t)},il.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nl&&void 0===e?"__lodash_hash_undefined__":e,this};var sl=Array.prototype.splice;function ll(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}ll.prototype.clear=function(){this.__data__=[],this.size=0},ll.prototype.delete=function(t){var e=this.__data__,n=al(e,t);return!(n<0)&&(n==e.length-1?e.pop():sl.call(e,n,1),--this.size,!0)},ll.prototype.get=function(t){var e=this.__data__,n=al(e,t);return n<0?void 0:e[n][1]},ll.prototype.has=function(t){return al(this.__data__,t)>-1},ll.prototype.set=function(t,e){var n=this.__data__,o=al(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};var ul=Oi(Sr,"Map");function cl(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function dl(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}dl.prototype.clear=function(){this.size=0,this.__data__={hash:new il,map:new(ul||ll),string:new il}},dl.prototype.delete=function(t){var e=cl(this,t).delete(t);return this.size-=e?1:0,e},dl.prototype.get=function(t){return cl(this,t).get(t)},dl.prototype.has=function(t){return cl(this,t).has(t)},dl.prototype.set=function(t,e){var n=cl(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};var pl="Expected a function";function hl(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(pl);var n=function(){var o=arguments,r=e?e.apply(this,o):o[0],i=n.cache;if(i.has(r))return i.get(r);var a=t.apply(this,o);return n.cache=i.set(r,a)||i,a};return n.cache=new(hl.Cache||dl),n}hl.Cache=dl;var fl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,gl=/\\(\\)?/g,vl=function(t){var e=hl(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(fl,(function(t,n,o,r){e.push(o?r.replace(gl,"$1"):n||t)})),e}));function yl(t){return null==t?"":Ur(t)}function ml(t,e){return Fr(t)?t:el(t,e)?[t]:vl(yl(t))}var bl=1/0;function _l(t){if("string"==typeof t||jr(t))return t;var e=t+"";return"0"==e&&1/t==-bl?"-0":e}function xl(t,e){for(var n=0,o=(e=ml(e,t)).length;null!=t&&n<o;)t=t[_l(e[n++])];return n&&n==o?t:void 0}function El(t,e,n){var o=null==t?void 0:xl(t,e);return void 0===o?n:o}function wl(t,e){for(var n=-1,o=e.length,r=Array(o),i=null==t;++n<o;)r[n]=i?void 0:El(t,e[n]);return r}function Sl(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t}var Cl=Cr?Cr.isConcatSpreadable:void 0;function Ml(t){return Fr(t)||Ss(t)||!!(Cl&&t&&t[Cl])}function Ol(t,e,n,o,r){var i=-1,a=t.length;for(n||(n=Ml),r||(r=[]);++i<a;){var s=t[i];e>0&&n(s)?e>1?Ol(s,e-1,n,o,r):Sl(r,s):o||(r[r.length]=s)}return r}function Tl(t){return(null==t?0:t.length)?Ol(t,1):[]}function Nl(t){return ua(cs(t,void 0,Tl),t+"")}var Al=Nl(wl),Pl=zs(Object.getPrototypeOf,Object),Dl="[object Object]",kl=Function.prototype,Rl=Object.prototype,Il=kl.toString,Ll=Rl.hasOwnProperty,jl=Il.call(Object);function Bl(t){if(!Ir(t)||Rr(t)!=Dl)return!1;var e=Pl(t);if(null===e)return!0;var n=Ll.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Il.call(n)==jl}var Hl="[object DOMException]",zl="[object Error]";function Fl(t){if(!Ir(t))return!1;var e=Rr(t);return e==zl||e==Hl||"string"==typeof t.message&&"string"==typeof t.name&&!Bl(t)}var Wl=ds((function(t,e){try{return Ii(t,void 0,e)}catch(t){return Fl(t)?t:new Error(t)}})),Gl="Expected a function";function Xl(t,e){var n;if("function"!=typeof e)throw new TypeError(Gl);return t=li(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var Ul=ds((function(t,e,n){var o=1;if(n.length){var r=Aa(n,Sa(Ul));o|=32}return es(t,o,e,n,r)}));Ul.placeholder={};var Yl=Nl((function(t,e){return ca(e,(function(e){e=_l(e),rs(t,e,Ul(t[e],t))})),t})),Vl=ds((function(t,e,n){var o=3;if(n.length){var r=Aa(n,Sa(Vl));o|=32}return es(e,o,t,n,r)}));function Kl(t,e,n){var o=-1,r=t.length;e<0&&(e=-e>r?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(r);++o<r;)i[o]=t[o+e];return i}function ql(t,e,n){var o=t.length;return n=void 0===n?o:n,!e&&n>=o?t:Kl(t,e,n)}Vl.placeholder={};var Zl=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function $l(t){return Zl.test(t)}var Jl="\\ud800-\\udfff",Ql="["+Jl+"]",tu="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",eu="\\ud83c[\\udffb-\\udfff]",nu="[^"+Jl+"]",ou="(?:\\ud83c[\\udde6-\\uddff]){2}",ru="[\\ud800-\\udbff][\\udc00-\\udfff]",iu="(?:"+tu+"|"+eu+")"+"?",au="[\\ufe0e\\ufe0f]?",su=au+iu+("(?:\\u200d(?:"+[nu,ou,ru].join("|")+")"+au+iu+")*"),lu="(?:"+[nu+tu+"?",tu,ou,ru,Ql].join("|")+")",uu=RegExp(eu+"(?="+eu+")|"+lu+su,"g");function cu(t){return $l(t)?function(t){return t.match(uu)||[]}(t):function(t){return t.split("")}(t)}function du(t){return function(e){var n=$l(e=yl(e))?cu(e):void 0,o=n?n[0]:e.charAt(0),r=n?ql(n,1).join(""):e.slice(1);return o[t]()+r}}var pu=du("toUpperCase");function hu(t){return pu(yl(t).toLowerCase())}function fu(t,e,n,o){var r=-1,i=null==t?0:t.length;for(o&&i&&(n=t[++r]);++r<i;)n=e(n,t[r],r,t);return n}function gu(t){return function(e){return null==t?void 0:t[e]}}var vu=gu({"À":"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"}),yu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mu=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function bu(t){return(t=yl(t))&&t.replace(yu,vu).replace(mu,"")}var _u=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var xu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Eu="\\ud800-\\udfff",wu="\\u2700-\\u27bf",Su="a-z\\xdf-\\xf6\\xf8-\\xff",Cu="A-Z\\xc0-\\xd6\\xd8-\\xde",Mu="\\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",Ou="["+Mu+"]",Tu="\\d+",Nu="["+wu+"]",Au="["+Su+"]",Pu="[^"+Eu+Mu+Tu+wu+Su+Cu+"]",Du="(?:\\ud83c[\\udde6-\\uddff]){2}",ku="[\\ud800-\\udbff][\\udc00-\\udfff]",Ru="["+Cu+"]",Iu="(?:"+Au+"|"+Pu+")",Lu="(?:"+Ru+"|"+Pu+")",ju="(?:['’](?:d|ll|m|re|s|t|ve))?",Bu="(?:['’](?:D|LL|M|RE|S|T|VE))?",Hu="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",zu="[\\ufe0e\\ufe0f]?",Fu=zu+Hu+("(?:\\u200d(?:"+["[^"+Eu+"]",Du,ku].join("|")+")"+zu+Hu+")*"),Wu="(?:"+[Nu,Du,ku].join("|")+")"+Fu,Gu=RegExp([Ru+"?"+Au+"+"+ju+"(?="+[Ou,Ru,"$"].join("|")+")",Lu+"+"+Bu+"(?="+[Ou,Ru+Iu,"$"].join("|")+")",Ru+"?"+Iu+"+"+ju,Ru+"+"+Bu,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tu,Wu].join("|"),"g");function Xu(t,e,n){return t=yl(t),void 0===(e=n?void 0:e)?function(t){return xu.test(t)}(t)?function(t){return t.match(Gu)||[]}(t):function(t){return t.match(_u)||[]}(t):t.match(e)||[]}var Uu=RegExp("['’]","g");function Yu(t){return function(e){return fu(Xu(bu(e).replace(Uu,"")),t,"")}}var Vu=Yu((function(t,e,n){return e=e.toLowerCase(),t+(n?hu(e):e)}));var Ku=Sr.isFinite,qu=Math.min;function Zu(t){var e=Math[t];return function(t,n){if(t=ri(t),(n=null==n?0:qu(li(n),292))&&Ku(t)){var o=(yl(t)+"e").split("e");return+((o=(yl(e(o[0]+"e"+(+o[1]+n)))+"e").split("e"))[0]+"e"+(+o[1]-n))}return e(t)}}var $u=Zu("ceil");function Ju(t){var e=Ji(t);return e.__chain__=!0,e}var Qu=Math.ceil,tc=Math.max;function ec(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function nc(t){var e=this.__data__=new ll(t);this.size=e.size}function oc(t,e){return t&&ls(e,Xs(e),t)}nc.prototype.clear=function(){this.__data__=new ll,this.size=0},nc.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},nc.prototype.get=function(t){return this.__data__.get(t)},nc.prototype.has=function(t){return this.__data__.has(t)},nc.prototype.set=function(t,e){var n=this.__data__;if(n instanceof ll){var o=n.__data__;if(!ul||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new dl(o)}return n.set(t,e),this.size=n.size,this};var rc="object"==typeof t&&t&&!t.nodeType&&t,ic=rc&&"object"==typeof module&&module&&!module.nodeType&&module,ac=ic&&ic.exports===rc?Sr.Buffer:void 0,sc=ac?ac.allocUnsafe:void 0;function lc(t,e){if(e)return t.slice();var n=t.length,o=sc?sc(n):new t.constructor(n);return t.copy(o),o}function uc(t,e){for(var n=-1,o=null==t?0:t.length,r=0,i=[];++n<o;){var a=t[n];e(a,n,t)&&(i[r++]=a)}return i}function cc(){return[]}var dc=Object.prototype.propertyIsEnumerable,pc=Object.getOwnPropertySymbols,hc=pc?function(t){return null==t?[]:(t=Object(t),uc(pc(t),(function(e){return dc.call(t,e)})))}:cc;var fc=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Sl(e,hc(t)),t=Pl(t);return e}:cc;function gc(t,e,n){var o=e(t);return Fr(t)?o:Sl(o,n(t))}function vc(t){return gc(t,Xs,hc)}function yc(t){return gc(t,qs,fc)}var mc=Oi(Sr,"DataView"),bc=Oi(Sr,"Promise"),_c=Oi(Sr,"Set"),xc="[object Map]",Ec="[object Promise]",wc="[object Set]",Sc="[object WeakMap]",Cc="[object DataView]",Mc=bi(mc),Oc=bi(ul),Tc=bi(bc),Nc=bi(_c),Ac=bi(Ti),Pc=Rr;(mc&&Pc(new mc(new ArrayBuffer(1)))!=Cc||ul&&Pc(new ul)!=xc||bc&&Pc(bc.resolve())!=Ec||_c&&Pc(new _c)!=wc||Ti&&Pc(new Ti)!=Sc)&&(Pc=function(t){var e=Rr(t),n="[object Object]"==e?t.constructor:void 0,o=n?bi(n):"";if(o)switch(o){case Mc:return Cc;case Oc:return xc;case Tc:return Ec;case Nc:return wc;case Ac:return Sc}return e});var Dc=Pc,kc=Object.prototype.hasOwnProperty;var Rc=Sr.Uint8Array;function Ic(t){var e=new t.constructor(t.byteLength);return new Rc(e).set(new Rc(t)),e}var Lc=/\w*$/;var jc=Cr?Cr.prototype:void 0,Bc=jc?jc.valueOf:void 0;function Hc(t,e){var n=e?Ic(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var zc="[object Boolean]",Fc="[object Date]",Wc="[object Map]",Gc="[object Number]",Xc="[object RegExp]",Uc="[object Set]",Yc="[object String]",Vc="[object Symbol]",Kc="[object ArrayBuffer]",qc="[object DataView]",Zc="[object Float32Array]",$c="[object Float64Array]",Jc="[object Int8Array]",Qc="[object Int16Array]",td="[object Int32Array]",ed="[object Uint8Array]",nd="[object Uint8ClampedArray]",od="[object Uint16Array]",rd="[object Uint32Array]";function id(t,e,n){var o,r=t.constructor;switch(e){case Kc:return Ic(t);case zc:case Fc:return new r(+t);case qc:return function(t,e){var n=e?Ic(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case Zc:case $c:case Jc:case Qc:case td:case ed:case nd:case od:case rd:return Hc(t,n);case Wc:return new r;case Gc:case Yc:return new r(t);case Xc:return function(t){var e=new t.constructor(t.source,Lc.exec(t));return e.lastIndex=t.lastIndex,e}(t);case Uc:return new r;case Vc:return o=t,Bc?Object(Bc.call(o)):{}}}function ad(t){return"function"!=typeof t.constructor||ms(t)?{}:Di(Pl(t))}var sd=Is&&Is.isMap,ld=sd?Ps(sd):function(t){return Ir(t)&&"[object Map]"==Dc(t)};var ud=Is&&Is.isSet,cd=ud?Ps(ud):function(t){return Ir(t)&&"[object Set]"==Dc(t)},dd=1,pd=2,hd=4,fd="[object Arguments]",gd="[object Function]",vd="[object GeneratorFunction]",yd="[object Object]",md={};function bd(t,e,n,o,r,i){var a,s=e&dd,l=e&pd,u=e&hd;if(n&&(a=r?n(t,o,r,i):n(t)),void 0!==a)return a;if(!Jr(t))return t;var c=Fr(t);if(c){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&kc.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return qi(t,a)}else{var d=Dc(t),p=d==gd||d==vd;if(Ns(t))return lc(t,s);if(d==yd||d==fd||p&&!r){if(a=l||p?{}:ad(t),!s)return l?function(t,e){return ls(t,fc(t),e)}(t,function(t,e){return t&&ls(e,qs(e),t)}(a,t)):function(t,e){return ls(t,hc(t),e)}(t,oc(a,t))}else{if(!md[d])return r?t:{};a=id(t,d,s)}}i||(i=new nc);var h=i.get(t);if(h)return h;i.set(t,a),cd(t)?t.forEach((function(o){a.add(bd(o,e,n,o,t,i))})):ld(t)&&t.forEach((function(o,r){a.set(r,bd(o,e,n,r,t,i))}));var f=c?void 0:(u?l?yc:vc:l?qs:Xs)(t);return ca(f||t,(function(o,r){f&&(o=t[r=o]),ss(a,r,bd(o,e,n,r,t,i))})),a}md[fd]=md["[object Array]"]=md["[object ArrayBuffer]"]=md["[object DataView]"]=md["[object Boolean]"]=md["[object Date]"]=md["[object Float32Array]"]=md["[object Float64Array]"]=md["[object Int8Array]"]=md["[object Int16Array]"]=md["[object Int32Array]"]=md["[object Map]"]=md["[object Number]"]=md[yd]=md["[object RegExp]"]=md["[object Set]"]=md["[object String]"]=md["[object Symbol]"]=md["[object Uint8Array]"]=md["[object Uint8ClampedArray]"]=md["[object Uint16Array]"]=md["[object Uint32Array]"]=!0,md["[object Error]"]=md[gd]=md["[object WeakMap]"]=!1;function _d(t){return bd(t,5)}function xd(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new dl;++e<n;)this.add(t[e])}function Ed(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}function wd(t,e){return t.has(e)}xd.prototype.add=xd.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},xd.prototype.has=function(t){return this.__data__.has(t)};var Sd=1,Cd=2;function Md(t,e,n,o,r,i){var a=n&Sd,s=t.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var u=i.get(t),c=i.get(e);if(u&&c)return u==e&&c==t;var d=-1,p=!0,h=n&Cd?new xd:void 0;for(i.set(t,e),i.set(e,t);++d<s;){var f=t[d],g=e[d];if(o)var v=a?o(g,f,d,e,t,i):o(f,g,d,t,e,i);if(void 0!==v){if(v)continue;p=!1;break}if(h){if(!Ed(e,(function(t,e){if(!wd(h,e)&&(f===t||r(f,t,n,o,i)))return h.push(e)}))){p=!1;break}}else if(f!==g&&!r(f,g,n,o,i)){p=!1;break}}return i.delete(t),i.delete(e),p}function Od(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n}function Td(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Nd=1,Ad=2,Pd="[object Boolean]",Dd="[object Date]",kd="[object Error]",Rd="[object Map]",Id="[object Number]",Ld="[object RegExp]",jd="[object Set]",Bd="[object String]",Hd="[object Symbol]",zd="[object ArrayBuffer]",Fd="[object DataView]",Wd=Cr?Cr.prototype:void 0,Gd=Wd?Wd.valueOf:void 0;var Xd=1,Ud=Object.prototype.hasOwnProperty;var Yd=1,Vd="[object Arguments]",Kd="[object Array]",qd="[object Object]",Zd=Object.prototype.hasOwnProperty;function $d(t,e,n,o,r,i){var a=Fr(t),s=Fr(e),l=a?Kd:Dc(t),u=s?Kd:Dc(e),c=(l=l==Vd?qd:l)==qd,d=(u=u==Vd?qd:u)==qd,p=l==u;if(p&&Ns(t)){if(!Ns(e))return!1;a=!0,c=!1}if(p&&!c)return i||(i=new nc),a||js(t)?Md(t,e,n,o,r,i):function(t,e,n,o,r,i,a){switch(n){case Fd:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case zd:return!(t.byteLength!=e.byteLength||!i(new Rc(t),new Rc(e)));case Pd:case Dd:case Id:return is(+t,+e);case kd:return t.name==e.name&&t.message==e.message;case Ld:case Bd:return t==e+"";case Rd:var s=Od;case jd:var l=o&Nd;if(s||(s=Td),t.size!=e.size&&!l)return!1;var u=a.get(t);if(u)return u==e;o|=Ad,a.set(t,e);var c=Md(s(t),s(e),o,r,i,a);return a.delete(t),c;case Hd:if(Gd)return Gd.call(t)==Gd.call(e)}return!1}(t,e,l,n,o,r,i);if(!(n&Yd)){var h=c&&Zd.call(t,"__wrapped__"),f=d&&Zd.call(e,"__wrapped__");if(h||f){var g=h?t.value():t,v=f?e.value():e;return i||(i=new nc),r(g,v,n,o,i)}}return!!p&&(i||(i=new nc),function(t,e,n,o,r,i){var a=n&Xd,s=vc(t),l=s.length;if(l!=vc(e).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in e:Ud.call(e,c)))return!1}var d=i.get(t),p=i.get(e);if(d&&p)return d==e&&p==t;var h=!0;i.set(t,e),i.set(e,t);for(var f=a;++u<l;){var g=t[c=s[u]],v=e[c];if(o)var y=a?o(v,g,c,e,t,i):o(g,v,c,t,e,i);if(!(void 0===y?g===v||r(g,v,n,o,i):y)){h=!1;break}f||(f="constructor"==c)}if(h&&!f){var m=t.constructor,b=e.constructor;m==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(h=!1)}return i.delete(t),i.delete(e),h}(t,e,n,o,r,i))}function Jd(t,e,n,o,r){return t===e||(null==t||null==e||!Ir(t)&&!Ir(e)?t!=t&&e!=e:$d(t,e,n,o,Jd,r))}var Qd=1,tp=2;function ep(t,e,n,o){var r=n.length,i=r,a=!o;if(null==t)return!i;for(t=Object(t);r--;){var s=n[r];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++r<i;){var l=(s=n[r])[0],u=t[l],c=s[1];if(a&&s[2]){if(void 0===u&&!(l in t))return!1}else{var d=new nc;if(o)var p=o(u,c,l,t,e,d);if(!(void 0===p?Jd(c,u,Qd|tp,o,d):p))return!1}}return!0}function np(t){return t==t&&!Jr(t)}function op(t){for(var e=Xs(t),n=e.length;n--;){var o=e[n],r=t[o];e[n]=[o,r,np(r)]}return e}function rp(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function ip(t){var e=op(t);return 1==e.length&&e[0][2]?rp(e[0][0],e[0][1]):function(n){return n===t||ep(n,t,e)}}function ap(t,e){return null!=t&&e in Object(t)}function sp(t,e,n){for(var o=-1,r=(e=ml(e,t)).length,i=!1;++o<r;){var a=_l(e[o]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++o!=r?i:!!(r=null==t?0:t.length)&&hs(r)&&Oa(a,r)&&(Fr(t)||Ss(t))}function lp(t,e){return null!=t&&sp(t,e,ap)}var up=1,cp=2;function dp(t,e){return el(t)&&np(e)?rp(_l(t),e):function(n){var o=El(n,t);return void 0===o&&o===e?lp(n,t):Jd(e,o,up|cp)}}function pp(t){return function(e){return null==e?void 0:e[t]}}function hp(t){return el(t)?pp(_l(t)):function(t){return function(e){return xl(e,t)}}(t)}function fp(t){return"function"==typeof t?t:null==t?ui:"object"==typeof t?Fr(t)?dp(t[0],t[1]):ip(t):hp(t)}function gp(t,e,n){var o=n.length;if(null==t)return!o;for(t=Object(t);o--;){var r=n[o],i=e[r],a=t[r];if(void 0===a&&!(r in t)||!i(a))return!1}return!0}function vp(t,e,n,o){for(var r=-1,i=null==t?0:t.length;++r<i;){var a=t[r];e(o,a,n(a),t)}return o}function yp(t){return function(e,n,o){for(var r=-1,i=Object(e),a=o(e),s=a.length;s--;){var l=a[t?s:++r];if(!1===n(i[l],l,i))break}return e}}var mp=yp();function bp(t,e){return t&&mp(t,e,Xs)}function _p(t,e){return function(n,o){if(null==n)return n;if(!fs(n))return t(n,o);for(var r=n.length,i=e?r:-1,a=Object(n);(e?i--:++i<r)&&!1!==o(a[i],i,a););return n}}var xp=_p(bp);function Ep(t,e,n,o){return xp(t,(function(t,r,i){e(o,t,n(t),i)})),o}function wp(t,e){return function(n,o){var r=Fr(n)?vp:Ep,i=e?e():{};return r(n,t,fp(o),i)}}var Sp=Object.prototype.hasOwnProperty,Cp=wp((function(t,e,n){Sp.call(t,n)?++t[n]:rs(t,n,1)}));function Mp(t,e,n){var o=es(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return o.placeholder=Mp.placeholder,o}Mp.placeholder={};function Op(t,e,n){var o=es(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return o.placeholder=Op.placeholder,o}Op.placeholder={};var Tp=function(){return Sr.Date.now()},Np="Expected a function",Ap=Math.max,Pp=Math.min;function Dp(t,e,n){var o,r,i,a,s,l,u=0,c=!1,d=!1,p=!0;if("function"!=typeof t)throw new TypeError(Np);function h(e){var n=o,i=r;return o=r=void 0,u=e,a=t.apply(i,n)}function f(t){var n=t-l;return void 0===l||n>=e||n<0||d&&t-u>=i}function g(){var t=Tp();if(f(t))return v(t);s=setTimeout(g,function(t){var n=e-(t-l);return d?Pp(n,i-(t-u)):n}(t))}function v(t){return s=void 0,p&&o?h(t):(o=r=void 0,a)}function y(){var t=Tp(),n=f(t);if(o=arguments,r=this,l=t,n){if(void 0===s)return function(t){return u=t,s=setTimeout(g,e),c?h(t):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,e),h(l)}return void 0===s&&(s=setTimeout(g,e)),a}return e=ri(e)||0,Jr(n)&&(c=!!n.leading,i=(d="maxWait"in n)?Ap(ri(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,o=l=r=s=void 0},y.flush=function(){return void 0===s?a:v(Tp())},y}var kp=Object.prototype,Rp=kp.hasOwnProperty,Ip=ds((function(t,e){t=Object(t);var n=-1,o=e.length,r=o>2?e[2]:void 0;for(r&&gs(e[0],e[1],r)&&(o=1);++n<o;)for(var i=e[n],a=qs(i),s=-1,l=a.length;++s<l;){var u=a[s],c=t[u];(void 0===c||is(c,kp[u])&&!Rp.call(t,u))&&(t[u]=i[u])}return t}));function Lp(t,e,n){(void 0!==n&&!is(t[e],n)||void 0===n&&!(e in t))&&rs(t,e,n)}function jp(t){return Ir(t)&&fs(t)}function Bp(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Hp(t){return ls(t,qs(t))}function zp(t,e,n,o,r){t!==e&&mp(e,(function(i,a){if(r||(r=new nc),Jr(i))!function(t,e,n,o,r,i,a){var s=Bp(t,n),l=Bp(e,n),u=a.get(l);if(u)Lp(t,n,u);else{var c=i?i(s,l,n+"",t,e,a):void 0,d=void 0===c;if(d){var p=Fr(l),h=!p&&Ns(l),f=!p&&!h&&js(l);c=l,p||h||f?Fr(s)?c=s:jp(s)?c=qi(s):h?(d=!1,c=lc(l,!0)):f?(d=!1,c=Hc(l,!0)):c=[]:Bl(l)||Ss(l)?(c=s,Ss(s)?c=Hp(s):Jr(s)&&!fi(s)||(c=ad(l))):d=!1}d&&(a.set(l,c),r(c,l,o,i,a),a.delete(l)),Lp(t,n,c)}}(t,e,a,n,zp,o,r);else{var s=o?o(Bp(t,a),i,a+"",t,e,r):void 0;void 0===s&&(s=i),Lp(t,a,s)}}),qs)}function Fp(t,e,n,o,r,i){return Jr(t)&&Jr(e)&&(i.set(e,t),zp(t,e,void 0,Fp,i),i.delete(e)),t}var Wp=vs((function(t,e,n,o){zp(t,e,n,o)})),Gp=ds((function(t){return t.push(void 0,Fp),Ii(Wp,void 0,t)}));function Xp(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}var Up=ds((function(t,e){return Xp(t,1,e)})),Yp=ds((function(t,e,n){return Xp(t,ri(e)||0,n)}));function Vp(t,e,n){for(var o=-1,r=null==t?0:t.length;++o<r;)if(n(e,t[o]))return!0;return!1}var Kp=200;function qp(t,e,n,o){var r=-1,i=fa,a=!0,s=t.length,l=[],u=e.length;if(!s)return l;n&&(e=zr(e,Ps(n))),o?(i=Vp,a=!1):e.length>=Kp&&(i=wd,a=!1,e=new xd(e));t:for(;++r<s;){var c=t[r],d=null==n?c:n(c);if(c=o||0!==c?c:0,a&&d==d){for(var p=u;p--;)if(e[p]===d)continue t;l.push(c)}else i(e,d,o)||l.push(c)}return l}var Zp=ds((function(t,e){return jp(t)?qp(t,Ol(e,1,jp,!0)):[]}));function $p(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var Jp=ds((function(t,e){var n=$p(e);return jp(n)&&(n=void 0),jp(t)?qp(t,Ol(e,1,jp,!0),fp(n)):[]})),Qp=ds((function(t,e){var n=$p(e);return jp(n)&&(n=void 0),jp(t)?qp(t,Ol(e,1,jp,!0),void 0,n):[]})),th=Yr((function(t,e){return t/e}),1);function eh(t,e,n,o){for(var r=t.length,i=o?r:-1;(o?i--:++i<r)&&e(t[i],i,t););return n?Kl(t,o?0:i,o?i+1:r):Kl(t,o?i+1:0,o?r:i)}function nh(t){return"function"==typeof t?t:ui}function oh(t,e){return(Fr(t)?ca:xp)(t,nh(e))}function rh(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}var ih=yp(!0);function ah(t,e){return t&&ih(t,e,Xs)}var sh=_p(ah,!0);function lh(t,e){return(Fr(t)?rh:sh)(t,nh(e))}function uh(t){return function(e){var n=Dc(e);return"[object Map]"==n?Od(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 zr(e,(function(e){return[e,t[e]]}))}(e,t(e))}}var ch=uh(Xs),dh=uh(qs),ph=gu({"&":"&","<":"<",">":">",'"':""","'":"'"}),hh=/[&<>"']/g,fh=RegExp(hh.source);function gh(t){return(t=yl(t))&&fh.test(t)?t.replace(hh,ph):t}var vh=/[\\^$.*+?()[\]{}|]/g,yh=RegExp(vh.source);function mh(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(!e(t[n],n,t))return!1;return!0}function bh(t,e){var n=!0;return xp(t,(function(t,o,r){return n=!!e(t,o,r)})),n}var _h=4294967295;function xh(t){return t?ec(li(t),0,_h):0}function Eh(t,e){var n=[];return xp(t,(function(t,o,r){e(t,o,r)&&n.push(t)})),n}function wh(t,e){return(Fr(t)?uc:Eh)(t,fp(e))}function Sh(t){return function(e,n,o){var r=Object(e);if(!fs(e)){var i=fp(n);e=Xs(e),n=function(t){return i(r[t],t,r)}}var a=t(e,n,o);return a>-1?r[i?e[a]:a]:void 0}}var Ch=Math.max;function Mh(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var r=null==n?0:li(n);return r<0&&(r=Ch(o+r,0)),da(t,fp(e),r)}var Oh=Sh(Mh);function Th(t,e,n){var o;return n(t,(function(t,n,r){if(e(t,n,r))return o=n,!1})),o}var Nh=Math.max,Ah=Math.min;function Ph(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var r=o-1;return void 0!==n&&(r=li(n),r=n<0?Nh(o+r,0):Ah(r,o-1)),da(t,fp(e),r,!0)}var Dh=Sh(Ph);function kh(t){return t&&t.length?t[0]:void 0}function Rh(t,e){var n=-1,o=fs(t)?Array(t.length):[];return xp(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}function Ih(t,e){return(Fr(t)?zr:Rh)(t,fp(e))}var Lh=1/0;var jh=1/0;var Bh=Zu("floor");function Hh(t){return Nl((function(e){var n=e.length,o=n,r=Ki.prototype.thru;for(t&&e.reverse();o--;){var i=e[o];if("function"!=typeof i)throw new TypeError("Expected a function");if(r&&!a&&"wrapper"==Vi(i))var a=new Ki([],!0)}for(o=a?o:n;++o<n;){var s=Vi(i=e[o]),l="wrapper"==s?Xi(i):void 0;a=l&&Qi(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[Vi(l[0])].apply(a,l[3]):1==i.length&&Qi(i)?a[s]():a.thru(i)}return function(){var t=arguments,o=t[0];if(a&&1==t.length&&Fr(o))return a.plant(o).value();for(var r=0,i=n?e[r].apply(this,t):o;++r<n;)i=e[r].call(this,i);return i}}))}var zh=Hh(),Fh=Hh(!0);function Wh(t,e){return uc(e,(function(e){return fi(t[e])}))}var Gh=Object.prototype.hasOwnProperty,Xh=wp((function(t,e,n){Gh.call(t,n)?t[n].push(e):rs(t,n,[e])}));function Uh(t,e){return t>e}function Yh(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ri(e),n=ri(n)),t(e,n)}}var Vh=Yh(Uh),Kh=Yh((function(t,e){return t>=e})),qh=Object.prototype.hasOwnProperty;function Zh(t,e){return null!=t&&qh.call(t,e)}function $h(t,e){return null!=t&&sp(t,e,Zh)}var Jh=Math.max,Qh=Math.min;var tf="[object String]";function ef(t){return"string"==typeof t||!Fr(t)&&Ir(t)&&Rr(t)==tf}function nf(t,e){return zr(e,(function(e){return t[e]}))}function of(t){return null==t?[]:nf(t,Xs(t))}var rf=Math.max;var af=Math.max;function sf(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var r=null==n?0:li(n);return r<0&&(r=af(o+r,0)),ha(t,e,r)}var lf=Math.min;function uf(t,e,n){for(var o=n?Vp:fa,r=t[0].length,i=t.length,a=i,s=Array(i),l=1/0,u=[];a--;){var c=t[a];a&&e&&(c=zr(c,Ps(e))),l=lf(c.length,l),s[a]=!n&&(e||r>=120&&c.length>=120)?new xd(a&&c):void 0}c=t[0];var d=-1,p=s[0];t:for(;++d<r&&u.length<l;){var h=c[d],f=e?e(h):h;if(h=n||0!==h?h:0,!(p?wd(p,f):o(u,f,n))){for(a=i;--a;){var g=s[a];if(!(g?wd(g,f):o(t[a],f,n)))continue t}p&&p.push(f),u.push(h)}}return u}function cf(t){return jp(t)?t:[]}var df=ds((function(t){var e=zr(t,cf);return e.length&&e[0]===t[0]?uf(e):[]})),pf=ds((function(t){var e=$p(t),n=zr(t,cf);return e===$p(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?uf(n,fp(e)):[]})),hf=ds((function(t){var e=$p(t),n=zr(t,cf);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?uf(n,void 0,e):[]}));function ff(t,e){return function(n,o){return function(t,e,n,o){return bp(t,(function(t,r,i){e(o,n(t),r,i)})),o}(n,t,e(o),{})}}var gf=Object.prototype.toString,vf=ff((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=gf.call(e)),t[e]=n}),aa(ui)),yf=Object.prototype,mf=yf.hasOwnProperty,bf=yf.toString,_f=ff((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=bf.call(e)),mf.call(t,e)?t[e].push(n):t[e]=[n]}),fp);function xf(t,e){return e.length<2?t:xl(t,Kl(e,0,-1))}function Ef(t,e,n){var o=null==(t=xf(t,e=ml(e,t)))?t:t[_l($p(e))];return null==o?void 0:Ii(o,t,n)}var wf=ds(Ef),Sf=ds((function(t,e,n){var o=-1,r="function"==typeof e,i=fs(t)?Array(t.length):[];return xp(t,(function(t){i[++o]=r?Ii(e,t,n):Ef(t,e,n)})),i}));var Cf=Is&&Is.isArrayBuffer,Mf=Cf?Ps(Cf):function(t){return Ir(t)&&"[object ArrayBuffer]"==Rr(t)};function Of(t){return!0===t||!1===t||Ir(t)&&"[object Boolean]"==Rr(t)}var Tf=Is&&Is.isDate,Nf=Tf?Ps(Tf):function(t){return Ir(t)&&"[object Date]"==Rr(t)};var Af="[object Map]",Pf="[object Set]",Df=Object.prototype.hasOwnProperty;function kf(t){if(null==t)return!0;if(fs(t)&&(Fr(t)||"string"==typeof t||"function"==typeof t.splice||Ns(t)||js(t)||Ss(t)))return!t.length;var e=Dc(t);if(e==Af||e==Pf)return!t.size;if(ms(t))return!Gs(t).length;for(var n in t)if(Df.call(t,n))return!1;return!0}function Rf(t,e){return Jd(t,e)}var If=Sr.isFinite;function Lf(t){return"number"==typeof t&&t==li(t)}var jf="[object Number]";function Bf(t){return"number"==typeof t||Ir(t)&&Rr(t)==jf}var Hf=vi?fi:Cs;function zf(t){return null==t}var Ff=Is&&Is.isRegExp,Wf=Ff?Ps(Ff):function(t){return Ir(t)&&"[object RegExp]"==Rr(t)},Gf=9007199254740991;function Xf(t){return void 0===t}var Uf=Array.prototype.join;var Yf=Yu((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Vf=wp((function(t,e,n){rs(t,n,e)}));var Kf=Math.max,qf=Math.min;var Zf=Yu((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),$f=du("toLowerCase");function Jf(t,e){return t<e}var Qf=Yh(Jf),tg=Yh((function(t,e){return t<=e}));function eg(t,e){var n={};return e=fp(e),bp(t,(function(t,o,r){rs(n,e(t,o,r),t)})),n}function ng(t,e,n){for(var o=-1,r=t.length;++o<r;){var i=t[o],a=e(i);if(null!=a&&(void 0===s?a==a&&!jr(a):n(a,s)))var s=a,l=i}return l}function og(t,e){for(var n,o=-1,r=t.length;++o<r;){var i=e(t[o]);void 0!==i&&(n=void 0===n?i:n+i)}return n}var rg=NaN;function ig(t,e){var n=null==t?0:t.length;return n?og(t,e)/n:rg}var ag=vs((function(t,e,n){zp(t,e,n)})),sg=ds((function(t,e){return function(n){return Ef(n,t,e)}})),lg=ds((function(t,e){return function(n){return Ef(t,n,e)}}));function ug(t,e,n){var o=Xs(e),r=Wh(e,o),i=!(Jr(n)&&"chain"in n&&!n.chain),a=fi(t);return ca(r,(function(n){var o=e[n];t[n]=o,a&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=qi(this.__actions__)).push({func:o,args:arguments,thisArg:t}),n.__chain__=e,n}return o.apply(t,Sl([this.value()],arguments))})})),t}var cg=Yr((function(t,e){return t*e}),1),dg="Expected a function";function pg(t){if("function"!=typeof t)throw new TypeError(dg);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 hg="[object Map]",fg="[object Set]",gg=Cr?Cr.iterator:void 0;function vg(t){if(!t)return[];if(fs(t))return ef(t)?cu(t):qi(t);if(gg&&t[gg])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[gg]());var e=Dc(t);return(e==hg?Od:e==fg?Td:of)(t)}function yg(t,e){var n=t.length;if(n)return Oa(e+=e<0?n:0,n)?t[e]:void 0}function mg(t,e){return null==(t=xf(t,e=ml(e,t)))||delete t[_l($p(e))]}function bg(t){return Bl(t)?void 0:t}var _g=Nl((function(t,e){var n={};if(null==t)return n;var o=!1;e=zr(e,(function(e){return e=ml(e,t),o||(o=e.length>1),e})),ls(t,yc(t),n),o&&(n=bd(n,7,bg));for(var r=e.length;r--;)mg(n,e[r]);return n}));function xg(t,e,n,o){if(!Jr(t))return t;for(var r=-1,i=(e=ml(e,t)).length,a=i-1,s=t;null!=s&&++r<i;){var l=_l(e[r]),u=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(r!=a){var c=s[l];void 0===(u=o?o(c,l,s):void 0)&&(u=Jr(c)?c:Oa(e[r+1])?[]:{})}ss(s,l,u),s=s[l]}return t}function Eg(t,e,n){for(var o=-1,r=e.length,i={};++o<r;){var a=e[o],s=xl(t,a);n(s,a)&&xg(i,ml(a,t),s)}return i}function wg(t,e){if(null==t)return{};var n=zr(yc(t),(function(t){return[t]}));return e=fp(e),Eg(t,n,(function(t,n){return e(t,n[0])}))}function Sg(t,e){if(t!==e){var n=void 0!==t,o=null===t,r=t==t,i=jr(t),a=void 0!==e,s=null===e,l=e==e,u=jr(e);if(!s&&!u&&!i&&t>e||i&&a&&l&&!s&&!u||o&&a&&l||!n&&l||!r)return 1;if(!o&&!i&&!u&&t<e||u&&n&&r&&!o&&!i||s&&n&&r||!a&&r||!l)return-1}return 0}function Cg(t,e,n){e=e.length?zr(e,(function(t){return Fr(t)?function(e){return xl(e,1===t.length?t[0]:t)}:t})):[ui];var o=-1;e=zr(e,Ps(fp));var r=Rh(t,(function(t,n,r){var i=zr(e,(function(e){return e(t)}));return{criteria:i,index:++o,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(r,(function(t,e){return function(t,e,n){for(var o=-1,r=t.criteria,i=e.criteria,a=r.length,s=n.length;++o<a;){var l=Sg(r[o],i[o]);if(l)return o>=s?l:l*("desc"==n[o]?-1:1)}return t.index-e.index}(t,e,n)}))}function Mg(t){return Nl((function(e){return e=zr(e,Ps(fp)),ds((function(n){var o=this;return t(e,(function(t){return Ii(t,o,n)}))}))}))}var Og=Mg(zr),Tg=ds,Ng=Math.min,Ag=Tg((function(t,e){var n=(e=1==e.length&&Fr(e[0])?zr(e[0],Ps(fp)):zr(Ol(e,1),Ps(fp))).length;return ds((function(o){for(var r=-1,i=Ng(o.length,n);++r<i;)o[r]=e[r].call(this,o[r]);return Ii(t,this,o)}))})),Pg=Mg(mh),Dg=Mg(Ed),kg=9007199254740991,Rg=Math.floor;function Ig(t,e){var n="";if(!t||e<1||e>kg)return n;do{e%2&&(n+=t),(e=Rg(e/2))&&(t+=t)}while(e);return n}var Lg=pp("length"),jg="\\ud800-\\udfff",Bg="["+jg+"]",Hg="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",zg="\\ud83c[\\udffb-\\udfff]",Fg="[^"+jg+"]",Wg="(?:\\ud83c[\\udde6-\\uddff]){2}",Gg="[\\ud800-\\udbff][\\udc00-\\udfff]",Xg="(?:"+Hg+"|"+zg+")"+"?",Ug="[\\ufe0e\\ufe0f]?",Yg=Ug+Xg+("(?:\\u200d(?:"+[Fg,Wg,Gg].join("|")+")"+Ug+Xg+")*"),Vg="(?:"+[Fg+Hg+"?",Hg,Wg,Gg,Bg].join("|")+")",Kg=RegExp(zg+"(?="+zg+")|"+Vg+Yg,"g");function qg(t){return $l(t)?function(t){for(var e=Kg.lastIndex=0;Kg.test(t);)++e;return e}(t):Lg(t)}var Zg=Math.ceil;function $g(t,e){var n=(e=void 0===e?" ":Ur(e)).length;if(n<2)return n?Ig(e,t):e;var o=Ig(e,Zg(t/qg(e)));return $l(e)?ql(cu(o),0,t).join(""):o.slice(0,t)}var Jg=Math.ceil,Qg=Math.floor;var tv=/^\s+/,ev=Sr.parseInt;var nv=ds((function(t,e){return es(t,32,void 0,e,Aa(e,Sa(nv)))}));nv.placeholder={};var ov=ds((function(t,e){return es(t,64,void 0,e,Aa(e,Sa(ov)))}));ov.placeholder={};var rv=wp((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var iv=Nl((function(t,e){return null==t?{}:function(t,e){return Eg(t,e,(function(e,n){return lp(t,n)}))}(t,e)}));function av(t,e,n,o){for(var r=n-1,i=t.length;++r<i;)if(o(t[r],e))return r;return-1}var sv=Array.prototype.splice;function lv(t,e,n,o){var r=o?av:ha,i=-1,a=e.length,s=t;for(t===e&&(e=qi(e)),n&&(s=zr(t,Ps(n)));++i<a;)for(var l=0,u=e[i],c=n?n(u):u;(l=r(s,c,l,o))>-1;)s!==t&&sv.call(s,l,1),sv.call(t,l,1);return t}function uv(t,e){return t&&t.length&&e&&e.length?lv(t,e):t}var cv=ds(uv);var dv=Array.prototype.splice;function pv(t,e){for(var n=t?e.length:0,o=n-1;n--;){var r=e[n];if(n==o||r!==i){var i=r;Oa(r)?dv.call(t,r,1):mg(t,r)}}return t}var hv=Nl((function(t,e){var n=null==t?0:t.length,o=wl(t,e);return pv(t,zr(e,(function(t){return Oa(t,n)?+t:t})).sort(Sg)),o})),fv=Math.floor,gv=Math.random;function vv(t,e){return t+fv(gv()*(e-t+1))}var yv=parseFloat,mv=Math.min,bv=Math.random;var _v=Math.ceil,xv=Math.max;function Ev(t){return function(e,n,o){return o&&"number"!=typeof o&&gs(e,n,o)&&(n=o=void 0),e=si(e),void 0===n?(n=e,e=0):n=si(n),function(t,e,n,o){for(var r=-1,i=xv(_v((e-t)/(n||1)),0),a=Array(i);i--;)a[o?i:++r]=t,t+=n;return a}(e,n,o=void 0===o?e<n?1:-1:si(o),t)}}var wv=Ev(),Sv=Ev(!0),Cv=Nl((function(t,e){return es(t,256,void 0,void 0,void 0,e)}));function Mv(t,e,n,o,r){return r(t,(function(t,r,i){n=o?(o=!1,t):e(n,t,r,i)})),n}function Ov(t,e,n){var o=Fr(t)?fu:Mv,r=arguments.length<3;return o(t,fp(e),n,r,xp)}function Tv(t,e,n,o){var r=null==t?0:t.length;for(o&&r&&(n=t[--r]);r--;)n=e(n,t[r],r,t);return n}var Nv=Array.prototype.reverse;function Av(t){return null==t?t:Nv.call(t)}var Pv=Zu("round");function Dv(t){var e=t.length;return e?t[vv(0,e-1)]:void 0}function kv(t){return Dv(of(t))}function Rv(t,e){var n=-1,o=t.length,r=o-1;for(e=void 0===e?o:e;++n<e;){var i=vv(n,r),a=t[i];t[i]=t[n],t[n]=a}return t.length=e,t}function Iv(t,e){return Rv(qi(t),ec(e,0,t.length))}function Lv(t,e){var n=of(t);return Rv(n,ec(e,0,n.length))}function jv(t){return Rv(qi(t))}function Bv(t){return Rv(of(t))}var Hv=Yu((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function zv(t,e){var n;return xp(t,(function(t,o,r){return!(n=e(t,o,r))})),!!n}var Fv=ds((function(t,e){if(null==t)return[];var n=e.length;return n>1&&gs(t,e[0],e[1])?e=[]:n>2&&gs(e[0],e[1],e[2])&&(e=[e[0]]),Cg(t,Ol(e,1),[])})),Wv=4294967294,Gv=Math.floor,Xv=Math.min;function Uv(t,e,n,o){var r=0,i=null==t?0:t.length;if(0===i)return 0;for(var a=(e=n(e))!=e,s=null===e,l=jr(e),u=void 0===e;r<i;){var c=Gv((r+i)/2),d=n(t[c]),p=void 0!==d,h=null===d,f=d==d,g=jr(d);if(a)var v=o||f;else v=u?f&&(o||p):s?f&&p&&(o||!h):l?f&&p&&!h&&(o||!g):!h&&!g&&(o?d<=e:d<e);v?r=c+1:i=c}return Xv(i,Wv)}var Yv=2147483647;function Vv(t,e,n){var o=0,r=null==t?o:t.length;if("number"==typeof e&&e==e&&r<=Yv){for(;o<r;){var i=o+r>>>1,a=t[i];null!==a&&!jr(a)&&(n?a<=e:a<e)?o=i+1:r=i}return r}return Uv(t,e,ui,n)}function Kv(t,e){for(var n=-1,o=t.length,r=0,i=[];++n<o;){var a=t[n],s=e?e(a):a;if(!n||!is(s,l)){var l=s;i[r++]=0===a?0:a}}return i}var qv=Math.max;var Zv=Yu((function(t,e,n){return t+(n?" ":"")+pu(e)}));var $v=Yr((function(t,e){return t-e}),0);var Jv=Object.prototype,Qv=Jv.hasOwnProperty;function ty(t,e,n,o){return void 0===t||is(t,Jv[n])&&!Qv.call(o,n)?e:t}var ey={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function ny(t){return"\\"+ey[t]}var oy=/<%=([\s\S]+?)%>/g,ry={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:oy,variable:"",imports:{_:{escape:gh}}},iy=/\b__p \+= '';/g,ay=/\b(__p \+=) '' \+/g,sy=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ly=/[()=,{}\[\]\/\s]/,uy=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,cy=/($^)/,dy=/['\n\r\u2028\u2029\\]/g,py=Object.prototype.hasOwnProperty;function hy(t,e,n){var o=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return Jr(n)&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),Dp(t,e,{leading:o,maxWait:e,trailing:r})}function fy(t,e){return e(t)}var gy=4294967295,vy=Math.min;function yy(t,e){var n=t;return n instanceof Wi&&(n=n.value()),fu(e,(function(t,e){return e.func.apply(e.thisArg,Sl([t],e.args))}),n)}function my(){return yy(this.__wrapped__,this.__actions__)}var by=9007199254740991;function _y(t,e){for(var n=t.length;n--&&ha(e,t[n],0)>-1;);return n}function xy(t,e){for(var n=-1,o=t.length;++n<o&&ha(e,t[n],0)>-1;);return n}var Ey=/^\s+/;var wy=/\w*$/;var Sy=gu({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Cy=/&(?:amp|lt|gt|quot|#39);/g,My=RegExp(Cy.source);var Oy=_c&&1/Td(new _c([,-0]))[1]==1/0?function(t){return new _c(t)}:Gi,Ty=200;function Ny(t,e,n){var o=-1,r=fa,i=t.length,a=!0,s=[],l=s;if(n)a=!1,r=Vp;else if(i>=Ty){var u=e?null:Oy(t);if(u)return Td(u);a=!1,r=wd,l=new xd}else l=e?[]:s;t:for(;++o<i;){var c=t[o],d=e?e(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var p=l.length;p--;)if(l[p]===d)continue t;e&&l.push(d),s.push(c)}else r(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}var Ay=ds((function(t){return Ny(Ol(t,1,jp,!0))})),Py=ds((function(t){var e=$p(t);return jp(e)&&(e=void 0),Ny(Ol(t,1,jp,!0),fp(e))})),Dy=ds((function(t){var e=$p(t);return e="function"==typeof e?e:void 0,Ny(Ol(t,1,jp,!0),void 0,e)}));var ky=0;var Ry=Math.max;function Iy(t){if(!t||!t.length)return[];var e=0;return t=uc(t,(function(t){if(jp(t))return e=Ry(t.length,e),!0})),bs(e,(function(e){return zr(t,pp(e))}))}function Ly(t,e){if(!t||!t.length)return[];var n=Iy(t);return null==e?n:zr(n,(function(t){return Ii(e,void 0,t)}))}function jy(t,e,n,o){return xg(t,e,n(xl(t,e)),o)}var By=Yu((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}));var Hy=ds((function(t,e){return jp(t)?qp(t,e):[]}));var zy=Nl((function(t){var e=t.length,n=e?t[0]:0,o=this.__wrapped__,r=function(e){return wl(e,t)};return!(e>1||this.__actions__.length)&&o instanceof Wi&&Oa(n)?((o=o.slice(n,+n+(e?1:0))).__actions__.push({func:fy,args:[r],thisArg:void 0}),new Ki(o,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(r)}));function Fy(t,e,n){var o=t.length;if(o<2)return o?Ny(t[0]):[];for(var r=-1,i=Array(o);++r<o;)for(var a=t[r],s=-1;++s<o;)s!=r&&(i[r]=qp(i[r]||a,t[s],e,n));return Ny(Ol(i,1),e,n)}var Wy=ds((function(t){return Fy(uc(t,jp))})),Gy=ds((function(t){var e=$p(t);return jp(e)&&(e=void 0),Fy(uc(t,jp),fp(e))})),Xy=ds((function(t){var e=$p(t);return e="function"==typeof e?e:void 0,Fy(uc(t,jp),void 0,e)})),Uy=ds(Iy);function Yy(t,e,n){for(var o=-1,r=t.length,i=e.length,a={};++o<r;){var s=o<i?e[o]:void 0;n(a,t[o],s)}return a}var Vy=ds((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Ly(t,n)})),Ky={chunk:function(t,e,n){e=(n?gs(t,e,n):void 0===e)?1:tc(li(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var r=0,i=0,a=Array(Qu(o/e));r<o;)a[i++]=Kl(t,r,r+=e);return a},compact:function(t){for(var e=-1,n=null==t?0:t.length,o=0,r=[];++e<n;){var i=t[e];i&&(r[o++]=i)}return r},concat:function(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],o=t;o--;)e[o-1]=arguments[o];return Sl(Fr(n)?qi(n):[n],Ol(e,1))},difference:Zp,differenceBy:Jp,differenceWith:Qp,drop:function(t,e,n){var o=null==t?0:t.length;return o?Kl(t,(e=n||void 0===e?1:li(e))<0?0:e,o):[]},dropRight:function(t,e,n){var o=null==t?0:t.length;return o?Kl(t,0,(e=o-(e=n||void 0===e?1:li(e)))<0?0:e):[]},dropRightWhile:function(t,e){return t&&t.length?eh(t,fp(e),!0,!0):[]},dropWhile:function(t,e){return t&&t.length?eh(t,fp(e),!0):[]},fill:function(t,e,n,o){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&gs(t,e,n)&&(n=0,o=r),function(t,e,n,o){var r=t.length;for((n=li(n))<0&&(n=-n>r?0:r+n),(o=void 0===o||o>r?r:li(o))<0&&(o+=r),o=n>o?0:xh(o);n<o;)t[n++]=e;return t}(t,e,n,o)):[]},findIndex:Mh,findLastIndex:Ph,first:kh,flatten:Tl,flattenDeep:function(t){return(null==t?0:t.length)?Ol(t,jh):[]},flattenDepth:function(t,e){return(null==t?0:t.length)?Ol(t,e=void 0===e?1:li(e)):[]},fromPairs:function(t){for(var e=-1,n=null==t?0:t.length,o={};++e<n;){var r=t[e];o[r[0]]=r[1]}return o},head:kh,indexOf:sf,initial:function(t){return(null==t?0:t.length)?Kl(t,0,-1):[]},intersection:df,intersectionBy:pf,intersectionWith:hf,join:function(t,e){return null==t?"":Uf.call(t,e)},last:$p,lastIndexOf:function(t,e,n){var o=null==t?0:t.length;if(!o)return-1;var r=o;return void 0!==n&&(r=(r=li(n))<0?Kf(o+r,0):qf(r,o-1)),e==e?function(t,e,n){for(var o=n+1;o--;)if(t[o]===e)return o;return o}(t,e,r):da(t,pa,r,!0)},nth:function(t,e){return t&&t.length?yg(t,li(e)):void 0},pull:cv,pullAll:uv,pullAllBy:function(t,e,n){return t&&t.length&&e&&e.length?lv(t,e,fp(n)):t},pullAllWith:function(t,e,n){return t&&t.length&&e&&e.length?lv(t,e,void 0,n):t},pullAt:hv,remove:function(t,e){var n=[];if(!t||!t.length)return n;var o=-1,r=[],i=t.length;for(e=fp(e);++o<i;){var a=t[o];e(a,o,t)&&(n.push(a),r.push(o))}return pv(t,r),n},reverse:Av,slice:function(t,e,n){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&gs(t,e,n)?(e=0,n=o):(e=null==e?0:li(e),n=void 0===n?o:li(n)),Kl(t,e,n)):[]},sortedIndex:function(t,e){return Vv(t,e)},sortedIndexBy:function(t,e,n){return Uv(t,e,fp(n))},sortedIndexOf:function(t,e){var n=null==t?0:t.length;if(n){var o=Vv(t,e);if(o<n&&is(t[o],e))return o}return-1},sortedLastIndex:function(t,e){return Vv(t,e,!0)},sortedLastIndexBy:function(t,e,n){return Uv(t,e,fp(n),!0)},sortedLastIndexOf:function(t,e){if(null==t?0:t.length){var n=Vv(t,e,!0)-1;if(is(t[n],e))return n}return-1},sortedUniq:function(t){return t&&t.length?Kv(t):[]},sortedUniqBy:function(t,e){return t&&t.length?Kv(t,fp(e)):[]},tail:function(t){var e=null==t?0:t.length;return e?Kl(t,1,e):[]},take:function(t,e,n){return t&&t.length?Kl(t,0,(e=n||void 0===e?1:li(e))<0?0:e):[]},takeRight:function(t,e,n){var o=null==t?0:t.length;return o?Kl(t,(e=o-(e=n||void 0===e?1:li(e)))<0?0:e,o):[]},takeRightWhile:function(t,e){return t&&t.length?eh(t,fp(e),!1,!0):[]},takeWhile:function(t,e){return t&&t.length?eh(t,fp(e)):[]},union:Ay,unionBy:Py,unionWith:Dy,uniq:function(t){return t&&t.length?Ny(t):[]},uniqBy:function(t,e){return t&&t.length?Ny(t,fp(e)):[]},uniqWith:function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Ny(t,void 0,e):[]},unzip:Iy,unzipWith:Ly,without:Hy,xor:Wy,xorBy:Gy,xorWith:Xy,zip:Uy,zipObject:function(t,e){return Yy(t||[],e||[],ss)},zipObjectDeep:function(t,e){return Yy(t||[],e||[],xg)},zipWith:Vy},qy={countBy:Cp,each:oh,eachRight:lh,every:function(t,e,n){var o=Fr(t)?mh:bh;return n&&gs(t,e,n)&&(e=void 0),o(t,fp(e))},filter:wh,find:Oh,findLast:Dh,flatMap:function(t,e){return Ol(Ih(t,e),1)},flatMapDeep:function(t,e){return Ol(Ih(t,e),Lh)},flatMapDepth:function(t,e,n){return n=void 0===n?1:li(n),Ol(Ih(t,e),n)},forEach:oh,forEachRight:lh,groupBy:Xh,includes:function(t,e,n,o){t=fs(t)?t:of(t),n=n&&!o?li(n):0;var r=t.length;return n<0&&(n=rf(r+n,0)),ef(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&ha(t,e,n)>-1},invokeMap:Sf,keyBy:Vf,map:Ih,orderBy:function(t,e,n,o){return null==t?[]:(Fr(e)||(e=null==e?[]:[e]),Fr(n=o?void 0:n)||(n=null==n?[]:[n]),Cg(t,e,n))},partition:rv,reduce:Ov,reduceRight:function(t,e,n){var o=Fr(t)?Tv:Mv,r=arguments.length<3;return o(t,fp(e),n,r,sh)},reject:function(t,e){return(Fr(t)?uc:Eh)(t,pg(fp(e)))},sample:function(t){return(Fr(t)?Dv:kv)(t)},sampleSize:function(t,e,n){return e=(n?gs(t,e,n):void 0===e)?1:li(e),(Fr(t)?Iv:Lv)(t,e)},shuffle:function(t){return(Fr(t)?jv:Bv)(t)},size:function(t){if(null==t)return 0;if(fs(t))return ef(t)?qg(t):t.length;var e=Dc(t);return"[object Map]"==e||"[object Set]"==e?t.size:Gs(t).length},some:function(t,e,n){var o=Fr(t)?Ed:zv;return n&&gs(t,e,n)&&(e=void 0),o(t,fp(e))},sortBy:Fv},Zy=Tp,$y={after:function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=li(t),function(){if(--t<1)return e.apply(this,arguments)}},ary:os,before:Xl,bind:Ul,bindKey:Vl,curry:Mp,curryRight:Op,debounce:Dp,defer:Up,delay:Yp,flip:function(t){return es(t,512)},memoize:hl,negate:pg,once:function(t){return Xl(2,t)},overArgs:Ag,partial:nv,partialRight:ov,rearg:Cv,rest:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return ds(t,e=void 0===e?e:li(e))},spread:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:qv(li(e),0),ds((function(n){var o=n[e],r=ql(n,0,e);return o&&Sl(r,o),Ii(t,this,r)}))},throttle:hy,unary:function(t){return os(t,1)},wrap:function(t,e){return nv(nh(e),t)}},Jy={castArray:function(){if(!arguments.length)return[];var t=arguments[0];return Fr(t)?t:[t]},clone:function(t){return bd(t,4)},cloneDeep:_d,cloneDeepWith:function(t,e){return bd(t,5,e="function"==typeof e?e:void 0)},cloneWith:function(t,e){return bd(t,4,e="function"==typeof e?e:void 0)},conformsTo:function(t,e){return null==e||gp(t,e,Xs(e))},eq:is,gt:Vh,gte:Kh,isArguments:Ss,isArray:Fr,isArrayBuffer:Mf,isArrayLike:fs,isArrayLikeObject:jp,isBoolean:Of,isBuffer:Ns,isDate:Nf,isElement:function(t){return Ir(t)&&1===t.nodeType&&!Bl(t)},isEmpty:kf,isEqual:Rf,isEqualWith:function(t,e,n){var o=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===o?Jd(t,e,void 0,n):!!o},isError:Fl,isFinite:function(t){return"number"==typeof t&&If(t)},isFunction:fi,isInteger:Lf,isLength:hs,isMap:ld,isMatch:function(t,e){return t===e||ep(t,e,op(e))},isMatchWith:function(t,e,n){return n="function"==typeof n?n:void 0,ep(t,e,op(e),n)},isNaN:function(t){return Bf(t)&&t!=+t},isNative:function(t){if(Hf(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mi(t)},isNil:zf,isNull:function(t){return null===t},isNumber:Bf,isObject:Jr,isObjectLike:Ir,isPlainObject:Bl,isRegExp:Wf,isSafeInteger:function(t){return Lf(t)&&t>=-9007199254740991&&t<=Gf},isSet:cd,isString:ef,isSymbol:jr,isTypedArray:js,isUndefined:Xf,isWeakMap:function(t){return Ir(t)&&"[object WeakMap]"==Dc(t)},isWeakSet:function(t){return Ir(t)&&"[object WeakSet]"==Rr(t)},lt:Qf,lte:tg,toArray:vg,toFinite:si,toInteger:li,toLength:xh,toNumber:ri,toPlainObject:Hp,toSafeInteger:function(t){return t?ec(li(t),-9007199254740991,by):0===t?t:0},toString:yl},Qy={add:Vr,ceil:$u,divide:th,floor:Bh,max:function(t){return t&&t.length?ng(t,ui,Uh):void 0},maxBy:function(t,e){return t&&t.length?ng(t,fp(e),Uh):void 0},mean:function(t){return ig(t,ui)},meanBy:function(t,e){return ig(t,fp(e))},min:function(t){return t&&t.length?ng(t,ui,Jf):void 0},minBy:function(t,e){return t&&t.length?ng(t,fp(e),Jf):void 0},multiply:cg,round:Pv,subtract:$v,sum:function(t){return t&&t.length?og(t,ui):0},sumBy:function(t,e){return t&&t.length?og(t,fp(e)):0}},tm=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=ri(n))==n?n:0),void 0!==e&&(e=(e=ri(e))==e?e:0),ec(ri(t),e,n)},em=function(t,e,n){return e=si(e),void 0===n?(n=e,e=0):n=si(n),function(t,e,n){return t>=Qh(e,n)&&t<Jh(e,n)}(t=ri(t),e,n)},nm=function(t,e,n){if(n&&"boolean"!=typeof n&&gs(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=si(t),void 0===e?(e=t,t=0):e=si(e)),t>e){var o=t;t=e,e=o}if(n||t%1||e%1){var r=bv();return mv(t+r*(e-t+yv("1e-"+((r+"").length-1))),e)}return vv(t,e)},om={assign:Ys,assignIn:Zs,assignInWith:$s,assignWith:Js,at:Al,create:function(t,e){var n=Di(t);return null==e?n:oc(n,e)},defaults:Ip,defaultsDeep:Gp,entries:ch,entriesIn:dh,extend:Zs,extendWith:$s,findKey:function(t,e){return Th(t,fp(e),bp)},findLastKey:function(t,e){return Th(t,fp(e),ah)},forIn:function(t,e){return null==t?t:mp(t,nh(e),qs)},forInRight:function(t,e){return null==t?t:ih(t,nh(e),qs)},forOwn:function(t,e){return t&&bp(t,nh(e))},forOwnRight:function(t,e){return t&&ah(t,nh(e))},functions:function(t){return null==t?[]:Wh(t,Xs(t))},functionsIn:function(t){return null==t?[]:Wh(t,qs(t))},get:El,has:$h,hasIn:lp,invert:vf,invertBy:_f,invoke:wf,keys:Xs,keysIn:qs,mapKeys:eg,mapValues:function(t,e){var n={};return e=fp(e),bp(t,(function(t,o,r){rs(n,o,e(t,o,r))})),n},merge:ag,mergeWith:Wp,omit:_g,omitBy:function(t,e){return wg(t,pg(fp(e)))},pick:iv,pickBy:wg,result:function(t,e,n){var o=-1,r=(e=ml(e,t)).length;for(r||(r=1,t=void 0);++o<r;){var i=null==t?void 0:t[_l(e[o])];void 0===i&&(o=r,i=n),t=fi(i)?i.call(t):i}return t},set:function(t,e,n){return null==t?t:xg(t,e,n)},setWith:function(t,e,n,o){return o="function"==typeof o?o:void 0,null==t?t:xg(t,e,n,o)},toPairs:ch,toPairsIn:dh,transform:function(t,e,n){var o=Fr(t),r=o||Ns(t)||js(t);if(e=fp(e),null==n){var i=t&&t.constructor;n=r?o?new i:[]:Jr(t)&&fi(i)?Di(Pl(t)):{}}return(r?ca:bp)(t,(function(t,o,r){return e(n,t,o,r)})),n},unset:function(t,e){return null==t||mg(t,e)},update:function(t,e,n){return null==t?t:jy(t,e,nh(n))},updateWith:function(t,e,n,o){return o="function"==typeof o?o:void 0,null==t?t:jy(t,e,nh(n),o)},values:of,valuesIn:function(t){return null==t?[]:nf(t,qs(t))}},rm={at:zy,chain:Ju,commit:function(){return new Ki(this.value(),this.__chain__)},lodash:Ji,next:function(){void 0===this.__values__&&(this.__values__=vg(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 zi;){var o=Zi(n);o.__index__=0,o.__values__=void 0,e?r.__wrapped__=o:e=o;var r=o;n=n.__wrapped__}return r.__wrapped__=t,e},reverse:function(){var t=this.__wrapped__;if(t instanceof Wi){var e=t;return this.__actions__.length&&(e=new Wi(this)),(e=e.reverse()).__actions__.push({func:fy,args:[Av],thisArg:void 0}),new Ki(e,this.__chain__)}return this.thru(Av)},tap:function(t,e){return e(t),t},thru:fy,toIterator:function(){return this},toJSON:my,value:my,valueOf:my,wrapperChain:function(){return Ju(this)}},im={camelCase:Vu,capitalize:hu,deburr:bu,endsWith:function(t,e,n){t=yl(t),e=Ur(e);var o=t.length,r=n=void 0===n?o:ec(li(n),0,o);return(n-=e.length)>=0&&t.slice(n,r)==e},escape:gh,escapeRegExp:function(t){return(t=yl(t))&&yh.test(t)?t.replace(vh,"\\$&"):t},kebabCase:Yf,lowerCase:Zf,lowerFirst:$f,pad:function(t,e,n){t=yl(t);var o=(e=li(e))?qg(t):0;if(!e||o>=e)return t;var r=(e-o)/2;return $g(Qg(r),n)+t+$g(Jg(r),n)},padEnd:function(t,e,n){t=yl(t);var o=(e=li(e))?qg(t):0;return e&&o<e?t+$g(e-o,n):t},padStart:function(t,e,n){t=yl(t);var o=(e=li(e))?qg(t):0;return e&&o<e?$g(e-o,n)+t:t},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),ev(yl(t).replace(tv,""),e||0)},repeat:function(t,e,n){return e=(n?gs(t,e,n):void 0===e)?1:li(e),Ig(yl(t),e)},replace:function(){var t=arguments,e=yl(t[0]);return t.length<3?e:e.replace(t[1],t[2])},snakeCase:Hv,split:function(t,e,n){return n&&"number"!=typeof n&&gs(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=yl(t))&&("string"==typeof e||null!=e&&!Wf(e))&&!(e=Ur(e))&&$l(t)?ql(cu(t),0,n):t.split(e,n):[]},startCase:Zv,startsWith:function(t,e,n){return t=yl(t),n=null==n?0:ec(li(n),0,t.length),e=Ur(e),t.slice(n,n+e.length)==e},template:function(t,e,n){var o=ry.imports._.templateSettings||ry;n&&gs(t,e,n)&&(e=void 0),t=yl(t),e=$s({},e,o,ty);var r,i,a=$s({},e.imports,o.imports,ty),s=Xs(a),l=nf(a,s),u=0,c=e.interpolate||cy,d="__p += '",p=RegExp((e.escape||cy).source+"|"+c.source+"|"+(c===oy?uy:cy).source+"|"+(e.evaluate||cy).source+"|$","g"),h=py.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(p,(function(e,n,o,a,s,l){return o||(o=a),d+=t.slice(u,l).replace(dy,ny),n&&(r=!0,d+="' +\n__e("+n+") +\n'"),s&&(i=!0,d+="';\n"+s+";\n__p += '"),o&&(d+="' +\n((__t = ("+o+")) == null ? '' : __t) +\n'"),u=l+e.length,e})),d+="';\n";var f=py.call(e,"variable")&&e.variable;if(f){if(ly.test(f))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(iy,""):d).replace(ay,"$1").replace(sy,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Wl((function(){return Function(s,h+"return "+d).apply(void 0,l)}));if(g.source=d,Fl(g))throw g;return g},templateSettings:ry,toLower:function(t){return yl(t).toLowerCase()},toUpper:function(t){return yl(t).toUpperCase()},trim:function(t,e,n){if((t=yl(t))&&(n||void 0===e))return $r(t);if(!t||!(e=Ur(e)))return t;var o=cu(t),r=cu(e);return ql(o,xy(o,r),_y(o,r)+1).join("")},trimEnd:function(t,e,n){if((t=yl(t))&&(n||void 0===e))return t.slice(0,qr(t)+1);if(!t||!(e=Ur(e)))return t;var o=cu(t);return ql(o,0,_y(o,cu(e))+1).join("")},trimStart:function(t,e,n){if((t=yl(t))&&(n||void 0===e))return t.replace(Ey,"");if(!t||!(e=Ur(e)))return t;var o=cu(t);return ql(o,xy(o,cu(e))).join("")},truncate:function(t,e){var n=30,o="...";if(Jr(e)){var r="separator"in e?e.separator:r;n="length"in e?li(e.length):n,o="omission"in e?Ur(e.omission):o}var i=(t=yl(t)).length;if($l(t)){var a=cu(t);i=a.length}if(n>=i)return t;var s=n-qg(o);if(s<1)return o;var l=a?ql(a,0,s).join(""):t.slice(0,s);if(void 0===r)return l+o;if(a&&(s+=l.length-s),Wf(r)){if(t.slice(s).search(r)){var u,c=l;for(r.global||(r=RegExp(r.source,yl(wy.exec(r))+"g")),r.lastIndex=0;u=r.exec(c);)var d=u.index;l=l.slice(0,void 0===d?s:d)}}else if(t.indexOf(Ur(r),s)!=s){var p=l.lastIndexOf(r);p>-1&&(l=l.slice(0,p))}return l+o},unescape:function(t){return(t=yl(t))&&My.test(t)?t.replace(Cy,Sy):t},upperCase:By,upperFirst:pu,words:Xu},am={attempt:Wl,bindAll:Yl,cond:function(t){var e=null==t?0:t.length,n=fp;return t=e?zr(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],ds((function(n){for(var o=-1;++o<e;){var r=t[o];if(Ii(r[0],this,n))return Ii(r[1],this,n)}}))},conforms:function(t){return function(t){var e=Xs(t);return function(n){return gp(n,t,e)}}(bd(t,1))},constant:aa,defaultTo:function(t,e){return null==t||t!=t?e:t},flow:zh,flowRight:Fh,identity:ui,iteratee:function(t){return fp("function"==typeof t?t:bd(t,1))},matches:function(t){return ip(bd(t,1))},matchesProperty:function(t,e){return dp(t,bd(e,1))},method:sg,methodOf:lg,mixin:ug,noop:Gi,nthArg:function(t){return t=li(t),ds((function(e){return yg(e,t)}))},over:Og,overEvery:Pg,overSome:Dg,property:hp,propertyOf:function(t){return function(e){return null==t?void 0:xl(t,e)}},range:wv,rangeRight:Sv,stubArray:cc,stubFalse:Cs,stubObject:function(){return{}},stubString:function(){return""},stubTrue:function(){return!0},times:function(t,e){if((t=li(t))<1||t>9007199254740991)return[];var n=gy,o=vy(t,gy);e=nh(e),t-=gy;for(var r=bs(o,e);++n<t;)e(n);return r},toPath:function(t){return Fr(t)?zr(t,_l):jr(t)?[t]:qi(vl(yl(t)))},uniqueId:function(t){var e=++ky;return yl(t)+e}};var sm=Math.max,lm=Math.min;var um=Math.min;
|
|
16
16
|
/**
|
|
17
17
|
* @license
|
|
18
18
|
* Lodash (Custom Build) <https://lodash.com/>
|
|
@@ -22,21 +22,21 @@
|
|
|
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 um,cm=4294967295,dm=Array.prototype,pm=Object.prototype.hasOwnProperty,hm=Cr?Cr.iterator:void 0,fm=Math.max,gm=Math.min,vm=function(t){return function(e,n,o){if(null==o){var r=Jr(n),i=r&&Xs(n),a=i&&i.length&&zh(n,i);(a?a.length:r)||(o=n,n=e,e=this)}return t(e,n,o)}}(lg);Ji.after=Zy.after,Ji.ary=Zy.ary,Ji.assign=nm.assign,Ji.assignIn=nm.assignIn,Ji.assignInWith=nm.assignInWith,Ji.assignWith=nm.assignWith,Ji.at=nm.at,Ji.before=Zy.before,Ji.bind=Zy.bind,Ji.bindAll=im.bindAll,Ji.bindKey=Zy.bindKey,Ji.castArray=$y.castArray,Ji.chain=om.chain,Ji.chunk=Vy.chunk,Ji.compact=Vy.compact,Ji.concat=Vy.concat,Ji.cond=im.cond,Ji.conforms=im.conforms,Ji.constant=im.constant,Ji.countBy=Ky.countBy,Ji.create=nm.create,Ji.curry=Zy.curry,Ji.curryRight=Zy.curryRight,Ji.debounce=Zy.debounce,Ji.defaults=nm.defaults,Ji.defaultsDeep=nm.defaultsDeep,Ji.defer=Zy.defer,Ji.delay=Zy.delay,Ji.difference=Vy.difference,Ji.differenceBy=Vy.differenceBy,Ji.differenceWith=Vy.differenceWith,Ji.drop=Vy.drop,Ji.dropRight=Vy.dropRight,Ji.dropRightWhile=Vy.dropRightWhile,Ji.dropWhile=Vy.dropWhile,Ji.fill=Vy.fill,Ji.filter=Ky.filter,Ji.flatMap=Ky.flatMap,Ji.flatMapDeep=Ky.flatMapDeep,Ji.flatMapDepth=Ky.flatMapDepth,Ji.flatten=Vy.flatten,Ji.flattenDeep=Vy.flattenDeep,Ji.flattenDepth=Vy.flattenDepth,Ji.flip=Zy.flip,Ji.flow=im.flow,Ji.flowRight=im.flowRight,Ji.fromPairs=Vy.fromPairs,Ji.functions=nm.functions,Ji.functionsIn=nm.functionsIn,Ji.groupBy=Ky.groupBy,Ji.initial=Vy.initial,Ji.intersection=Vy.intersection,Ji.intersectionBy=Vy.intersectionBy,Ji.intersectionWith=Vy.intersectionWith,Ji.invert=nm.invert,Ji.invertBy=nm.invertBy,Ji.invokeMap=Ky.invokeMap,Ji.iteratee=im.iteratee,Ji.keyBy=Ky.keyBy,Ji.keys=Xs,Ji.keysIn=nm.keysIn,Ji.map=Ky.map,Ji.mapKeys=nm.mapKeys,Ji.mapValues=nm.mapValues,Ji.matches=im.matches,Ji.matchesProperty=im.matchesProperty,Ji.memoize=Zy.memoize,Ji.merge=nm.merge,Ji.mergeWith=nm.mergeWith,Ji.method=im.method,Ji.methodOf=im.methodOf,Ji.mixin=vm,Ji.negate=dg,Ji.nthArg=im.nthArg,Ji.omit=nm.omit,Ji.omitBy=nm.omitBy,Ji.once=Zy.once,Ji.orderBy=Ky.orderBy,Ji.over=im.over,Ji.overArgs=Zy.overArgs,Ji.overEvery=im.overEvery,Ji.overSome=im.overSome,Ji.partial=Zy.partial,Ji.partialRight=Zy.partialRight,Ji.partition=Ky.partition,Ji.pick=nm.pick,Ji.pickBy=nm.pickBy,Ji.property=im.property,Ji.propertyOf=im.propertyOf,Ji.pull=Vy.pull,Ji.pullAll=Vy.pullAll,Ji.pullAllBy=Vy.pullAllBy,Ji.pullAllWith=Vy.pullAllWith,Ji.pullAt=Vy.pullAt,Ji.range=im.range,Ji.rangeRight=im.rangeRight,Ji.rearg=Zy.rearg,Ji.reject=Ky.reject,Ji.remove=Vy.remove,Ji.rest=Zy.rest,Ji.reverse=Vy.reverse,Ji.sampleSize=Ky.sampleSize,Ji.set=nm.set,Ji.setWith=nm.setWith,Ji.shuffle=Ky.shuffle,Ji.slice=Vy.slice,Ji.sortBy=Ky.sortBy,Ji.sortedUniq=Vy.sortedUniq,Ji.sortedUniqBy=Vy.sortedUniqBy,Ji.split=rm.split,Ji.spread=Zy.spread,Ji.tail=Vy.tail,Ji.take=Vy.take,Ji.takeRight=Vy.takeRight,Ji.takeRightWhile=Vy.takeRightWhile,Ji.takeWhile=Vy.takeWhile,Ji.tap=om.tap,Ji.throttle=Zy.throttle,Ji.thru=hy,Ji.toArray=$y.toArray,Ji.toPairs=nm.toPairs,Ji.toPairsIn=nm.toPairsIn,Ji.toPath=im.toPath,Ji.toPlainObject=$y.toPlainObject,Ji.transform=nm.transform,Ji.unary=Zy.unary,Ji.union=Vy.union,Ji.unionBy=Vy.unionBy,Ji.unionWith=Vy.unionWith,Ji.uniq=Vy.uniq,Ji.uniqBy=Vy.uniqBy,Ji.uniqWith=Vy.uniqWith,Ji.unset=nm.unset,Ji.unzip=Vy.unzip,Ji.unzipWith=Vy.unzipWith,Ji.update=nm.update,Ji.updateWith=nm.updateWith,Ji.values=nm.values,Ji.valuesIn=nm.valuesIn,Ji.without=Vy.without,Ji.words=rm.words,Ji.wrap=Zy.wrap,Ji.xor=Vy.xor,Ji.xorBy=Vy.xorBy,Ji.xorWith=Vy.xorWith,Ji.zip=Vy.zip,Ji.zipObject=Vy.zipObject,Ji.zipObjectDeep=Vy.zipObjectDeep,Ji.zipWith=Vy.zipWith,Ji.entries=nm.toPairs,Ji.entriesIn=nm.toPairsIn,Ji.extend=nm.assignIn,Ji.extendWith=nm.assignInWith,vm(Ji,Ji),Ji.add=Jy.add,Ji.attempt=im.attempt,Ji.camelCase=rm.camelCase,Ji.capitalize=rm.capitalize,Ji.ceil=Jy.ceil,Ji.clamp=Qy,Ji.clone=$y.clone,Ji.cloneDeep=$y.cloneDeep,Ji.cloneDeepWith=$y.cloneDeepWith,Ji.cloneWith=$y.cloneWith,Ji.conformsTo=$y.conformsTo,Ji.deburr=rm.deburr,Ji.defaultTo=im.defaultTo,Ji.divide=Jy.divide,Ji.endsWith=rm.endsWith,Ji.eq=$y.eq,Ji.escape=rm.escape,Ji.escapeRegExp=rm.escapeRegExp,Ji.every=Ky.every,Ji.find=Ky.find,Ji.findIndex=Vy.findIndex,Ji.findKey=nm.findKey,Ji.findLast=Ky.findLast,Ji.findLastIndex=Vy.findLastIndex,Ji.findLastKey=nm.findLastKey,Ji.floor=Jy.floor,Ji.forEach=Ky.forEach,Ji.forEachRight=Ky.forEachRight,Ji.forIn=nm.forIn,Ji.forInRight=nm.forInRight,Ji.forOwn=nm.forOwn,Ji.forOwnRight=nm.forOwnRight,Ji.get=nm.get,Ji.gt=$y.gt,Ji.gte=$y.gte,Ji.has=nm.has,Ji.hasIn=nm.hasIn,Ji.head=Vy.head,Ji.identity=ui,Ji.includes=Ky.includes,Ji.indexOf=Vy.indexOf,Ji.inRange=tm,Ji.invoke=nm.invoke,Ji.isArguments=$y.isArguments,Ji.isArray=zr,Ji.isArrayBuffer=$y.isArrayBuffer,Ji.isArrayLike=$y.isArrayLike,Ji.isArrayLikeObject=$y.isArrayLikeObject,Ji.isBoolean=$y.isBoolean,Ji.isBuffer=$y.isBuffer,Ji.isDate=$y.isDate,Ji.isElement=$y.isElement,Ji.isEmpty=$y.isEmpty,Ji.isEqual=$y.isEqual,Ji.isEqualWith=$y.isEqualWith,Ji.isError=$y.isError,Ji.isFinite=$y.isFinite,Ji.isFunction=$y.isFunction,Ji.isInteger=$y.isInteger,Ji.isLength=$y.isLength,Ji.isMap=$y.isMap,Ji.isMatch=$y.isMatch,Ji.isMatchWith=$y.isMatchWith,Ji.isNaN=$y.isNaN,Ji.isNative=$y.isNative,Ji.isNil=$y.isNil,Ji.isNull=$y.isNull,Ji.isNumber=$y.isNumber,Ji.isObject=Jr,Ji.isObjectLike=$y.isObjectLike,Ji.isPlainObject=$y.isPlainObject,Ji.isRegExp=$y.isRegExp,Ji.isSafeInteger=$y.isSafeInteger,Ji.isSet=$y.isSet,Ji.isString=$y.isString,Ji.isSymbol=$y.isSymbol,Ji.isTypedArray=$y.isTypedArray,Ji.isUndefined=$y.isUndefined,Ji.isWeakMap=$y.isWeakMap,Ji.isWeakSet=$y.isWeakSet,Ji.join=Vy.join,Ji.kebabCase=rm.kebabCase,Ji.last=$p,Ji.lastIndexOf=Vy.lastIndexOf,Ji.lowerCase=rm.lowerCase,Ji.lowerFirst=rm.lowerFirst,Ji.lt=$y.lt,Ji.lte=$y.lte,Ji.max=Jy.max,Ji.maxBy=Jy.maxBy,Ji.mean=Jy.mean,Ji.meanBy=Jy.meanBy,Ji.min=Jy.min,Ji.minBy=Jy.minBy,Ji.stubArray=im.stubArray,Ji.stubFalse=im.stubFalse,Ji.stubObject=im.stubObject,Ji.stubString=im.stubString,Ji.stubTrue=im.stubTrue,Ji.multiply=Jy.multiply,Ji.nth=Vy.nth,Ji.noop=im.noop,Ji.now=qy,Ji.pad=rm.pad,Ji.padEnd=rm.padEnd,Ji.padStart=rm.padStart,Ji.parseInt=rm.parseInt,Ji.random=em,Ji.reduce=Ky.reduce,Ji.reduceRight=Ky.reduceRight,Ji.repeat=rm.repeat,Ji.replace=rm.replace,Ji.result=nm.result,Ji.round=Jy.round,Ji.sample=Ky.sample,Ji.size=Ky.size,Ji.snakeCase=rm.snakeCase,Ji.some=Ky.some,Ji.sortedIndex=Vy.sortedIndex,Ji.sortedIndexBy=Vy.sortedIndexBy,Ji.sortedIndexOf=Vy.sortedIndexOf,Ji.sortedLastIndex=Vy.sortedLastIndex,Ji.sortedLastIndexBy=Vy.sortedLastIndexBy,Ji.sortedLastIndexOf=Vy.sortedLastIndexOf,Ji.startCase=rm.startCase,Ji.startsWith=rm.startsWith,Ji.subtract=Jy.subtract,Ji.sum=Jy.sum,Ji.sumBy=Jy.sumBy,Ji.template=rm.template,Ji.times=im.times,Ji.toFinite=$y.toFinite,Ji.toInteger=li,Ji.toLength=$y.toLength,Ji.toLower=rm.toLower,Ji.toNumber=$y.toNumber,Ji.toSafeInteger=$y.toSafeInteger,Ji.toString=$y.toString,Ji.toUpper=rm.toUpper,Ji.trim=rm.trim,Ji.trimEnd=rm.trimEnd,Ji.trimStart=rm.trimStart,Ji.truncate=rm.truncate,Ji.unescape=rm.unescape,Ji.uniqueId=im.uniqueId,Ji.upperCase=rm.upperCase,Ji.upperFirst=rm.upperFirst,Ji.each=Ky.forEach,Ji.eachRight=Ky.forEachRight,Ji.first=Vy.head,vm(Ji,(um={},bp(Ji,(function(t,e){pm.call(Ji.prototype,e)||(um[e]=t)})),um),{chain:!1}),Ji.VERSION="4.17.21",(Ji.templateSettings=rm.templateSettings).imports._=Ji,ca(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Ji[t].placeholder=Ji})),ca(["drop","take"],(function(t,e){Wi.prototype[t]=function(n){n=void 0===n?1:fm(li(n),0);var o=this.__filtered__&&!e?new Wi(this):this.clone();return o.__filtered__?o.__takeCount__=gm(n,o.__takeCount__):o.__views__.push({size:gm(n,cm),type:t+(o.__dir__<0?"Right":"")}),o},Wi.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ca(["filter","map","takeWhile"],(function(t,e){var n=e+1,o=1==n||3==n;Wi.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:fp(t),type:n}),e.__filtered__=e.__filtered__||o,e}})),ca(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wi.prototype[t]=function(){return this[n](1).value()[0]}})),ca(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wi.prototype[t]=function(){return this.__filtered__?new Wi(this):this[n](1)}})),Wi.prototype.compact=function(){return this.filter(ui)},Wi.prototype.find=function(t){return this.filter(t).head()},Wi.prototype.findLast=function(t){return this.reverse().find(t)},Wi.prototype.invokeMap=ds((function(t,e){return"function"==typeof t?new Wi(this):this.map((function(n){return xf(n,t,e)}))})),Wi.prototype.reject=function(t){return this.filter(dg(fp(t)))},Wi.prototype.slice=function(t,e){t=li(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Wi(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=li(e))<0?n.dropRight(-e):n.take(e-t)),n)},Wi.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wi.prototype.toArray=function(){return this.take(cm)},bp(Wi.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),r=Ji[o?"take"+("last"==e?"Right":""):e],i=o||/^find/.test(e);r&&(Ji.prototype[e]=function(){var e=this.__wrapped__,a=o?[1]:arguments,s=e instanceof Wi,l=a[0],u=s||zr(e),c=function(t){var e=r.apply(Ji,Sl([t],a));return o&&d?e[0]:e};u&&n&&"function"==typeof l&&1!=l.length&&(s=u=!1);var d=this.__chain__,p=!!this.__actions__.length,h=i&&!d,f=s&&!p;if(!i&&u){e=f?e:new Wi(this);var g=t.apply(e,a);return g.__actions__.push({func:hy,args:[c],thisArg:void 0}),new Ki(g,d)}return h&&f?t.apply(this,a):(g=this.thru(c),h?o?g.value()[0]:g.value():g)})})),ca(["pop","push","shift","sort","splice","unshift"],(function(t){var e=dm[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",o=/^(?:pop|shift)$/.test(t);Ji.prototype[t]=function(){var t=arguments;if(o&&!this.__chain__){var r=this.value();return e.apply(zr(r)?r:[],t)}return this[n]((function(n){return e.apply(zr(n)?n:[],t)}))}})),bp(Wi.prototype,(function(t,e){var n=Ji[e];if(n){var o=n.name+"";pm.call(Gi,o)||(Gi[o]=[]),Gi[o].push({name:e,func:n})}})),Gi[ja(void 0,2).name]=[{name:"wrapper",func:void 0}],Wi.prototype.clone=function(){var t=new Wi(this.__wrapped__);return t.__actions__=qi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=qi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=qi(this.__views__),t},Wi.prototype.reverse=function(){if(this.__filtered__){var t=new Wi(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wi.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=zr(t),o=e<0,r=n?t.length:0,i=function(t,e,n){for(var o=-1,r=n.length;++o<r;){var i=n[o],a=i.size;switch(i.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=sm(e,t+a);break;case"takeRight":t=am(t,e-a)}}return{start:t,end:e}}(0,r,this.__views__),a=i.start,s=i.end,l=s-a,u=o?s:a-1,c=this.__iteratees__,d=c.length,p=0,h=lm(l,this.__takeCount__);if(!n||!o&&r==l&&h==l)return vy(t,this.__actions__);var f=[];t:for(;l--&&p<h;){for(var g=-1,v=t[u+=e];++g<d;){var y=c[g],m=y.iteratee,b=y.type,_=m(v);if(2==b)v=_;else if(!_){if(1==b)continue t;break t}}f[p++]=v}return f},Ji.prototype.at=om.at,Ji.prototype.chain=om.wrapperChain,Ji.prototype.commit=om.commit,Ji.prototype.next=om.next,Ji.prototype.plant=om.plant,Ji.prototype.reverse=om.reverse,Ji.prototype.toJSON=Ji.prototype.valueOf=Ji.prototype.value=om.value,Ji.prototype.first=Ji.prototype.head,hm&&(Ji.prototype[hm]=om.toIterator);var ym,mm=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n};!function(t){t.get=function(e){var n=mm(e,[]);if(!e.container)throw new Error("Ensure the container of LogicFlow is specified and valid.");return Ys({},t.defaults,n)}}(ym||(ym={})),function(t){t.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}}(ym||(ym={}));var bm={node:!1,edge:!1},_m={node:!0,edge:!0},xm=null!==El(window,"navigator.userAgent","").match(/MSIE|Trident/);function Em(t){try{return JSON.parse(JSON.stringify(t))}catch(e){return t}}var wm,Sm,Cm,Om,Mm,Tm,Nm,Am=200;!function(t){t[t.DEFAULT=1]="DEFAULT",t[t.TEXT_EDIT=2]="TEXT_EDIT",t[t.SHOW_MENU=3]="SHOW_MENU",t[t.ALLOW_CONNECT=4]="ALLOW_CONNECT",t[t.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"}(wm||(wm={})),function(t){t.NODE="node",t.EDGE="edge",t.GRAPH="graph"}(Sm||(Sm={})),function(t){t.NODE="node",t.CIRCLE_NODE="circle-node",t.POLYGON_NODE="polygon-node",t.RECT_NODE="rect-node",t.TEXT_NODE="text-node",t.ELLIPSE_NODE="ellipse-node",t.DIAMOND_NODE="diamond-node",t.HTML_NODE="html-node",t.CUSTOM_HTML_NODE="custom-html-node",t.EDGE="edge",t.LINE_EDGE="line-edge",t.POLYLINE_EDGE="polyline-edge",t.BEZIER_EDGE="bezier-edge",t.GRAPH="graph"}(Cm||(Cm={})),function(t){t.ELEMENT_CLICK="element:click",t.NODE_ADD="node:add",t.NODE_DELETE="node:delete",t.NODE_CLICK="node:click",t.NODE_DBCLICK="node:dbclick",t.NODE_GROUP_COPY="node:group-copy-add",t.NODE_DND_ADD="node:dnd-add",t.NODE_DND_DRAG="node:dnd-drag",t.NODE_MOUSEDOWN="node:mousedown",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DROP="node:drop",t.NODE_MOUSEUP="node:mouseup",t.NODE_MOUSEMOVE="node:mousemove",t.NODE_MOUSEENTER="node:mouseenter",t.NODE_MOUSELEAVE="node:mouseleave",t.NODE_CONTEXTMENU="node:contextmenu",t.NODE_ROTATE="node:rotate",t.NODE_RESIZE="node:resize",t.NODE_PROPERTIES_CHANGE="node:properties-change",t.NODE_PROPERTIES_DELETE="node:properties-delete",t.EDGE_ADD="edge:add",t.EDGE_DELETE="edge:delete",t.EDGE_CLICK="edge:click",t.EDGE_DBCLICK="edge:dbclick",t.EDGE_MOUSEENTER="edge:mouseenter",t.EDGE_MOUSELEAVE="edge:mouseleave",t.EDGE_CONTEXTMENU="edge:contextmenu",t.EDGE_ADJUST="edge:adjust",t.EDGE_EXCHANGE_NODE="edge:exchange-node",t.ANCHOR_DRAGSTART="anchor:dragstart",t.ANCHOR_DRAG="anchor:drag",t.ANCHOR_DROP="anchor:drop",t.ANCHOR_DRAGEND="anchor:dragend",t.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",t.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",t.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",t.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",t.ADJUST_POINT_DRAG="adjustPoint:drag",t.ADJUST_POINT_DROP="adjustPoint:drop",t.ADJUST_POINT_DRAGEND="adjustPoint:dragend",t.BLANK_MOUSEDOWN="blank:mousedown",t.BLANK_DRAGSTART="blank:dragstart",t.BLANK_DRAG="blank:drag",t.BLANK_DROP="blank:drop",t.BLANK_MOUSEMOVE="blank:mousemove",t.BLANK_MOUSEUP="blank:mouseup",t.BLANK_CLICK="blank:click",t.BLANK_CONTEXTMENU="blank:contextmenu",t.SELECTION_MOUSEDOWN="selection:mousedown",t.SELECTION_DRAGSTART="selection:dragstart",t.SELECTION_DRAG="selection:drag",t.SELECTION_DROP="selection:drop",t.SELECTION_MOUSEMOVE="selection:mousemove",t.SELECTION_MOUSEUP="selection:mouseup",t.SELECTION_CONTEXTMENU="selection:contextmenu",t.CONNECTION_NOT_ALLOWED="connection:not-allowed",t.TEXT_MOUSEDOWN="text:mousedown",t.TEXT_DRAGSTART="text:dragstart",t.TEXT_DRAG="text:drag",t.TEXT_DROP="text:drop",t.TEXT_CLICK="text:click",t.TEXT_DBCLICK="text:dbclick",t.TEXT_BLUR="text:blur",t.TEXT_MOUSEMOVE="text:mousemove",t.TEXT_MOUSEUP="text:mouseup",t.TEXT_FOCUS="text:focus",t.TEXT_ADD="text:add",t.TEXT_UPDATE="text:update",t.TEXT_CLEAR="text:clear",t.LABEL_MOUSEDOWN="label:mousedown",t.LABEL_DRAGSTART="label:dragstart",t.LABEL_DRAG="label:drag",t.LABEL_DROP="label:drop",t.LABEL_CLICK="label:click",t.LABEL_DBCLICK="label:dbclick",t.LABEL_BLUR="label:blur",t.LABEL_MOUSEMOVE="label:mousemove",t.LABEL_MOUSEUP="label:mouseup",t.LABEL_FOCUS="label:focus",t.LABEL_ADD="label:add",t.LABEL_UPDATE="label:update",t.LABEL_CLEAR="label:clear",t.LABEL_DELETE="label:delete",t.LABEL_SHOULD_ADD="label:should-add",t.LABEL_BATCH_ADD="label:batch-add",t.LABEL_SHOULD_UPDATE="label:should-update",t.LABEL_SHOULD_DELETE="label:should-delete",t.LABEL_BATCH_DELETE="label:batch-delete",t.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",t.HISTORY_CHANGE="history:change",t.GRAPH_TRANSFORM="graph:transform",t.GRAPH_RENDERED="graph:rendered",t.GRAPH_UPDATED="graph:updated"}(Om||(Om={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE"}(Mm||(Mm={})),function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(Tm||(Tm={})),function(t){t.TEXT="text",t.LABEL="label"}(Nm||(Nm={}));var Pm=function(){function t(t){var e=t.onDragStart,n=void 0===e?Ui:e,o=t.onDragging,r=void 0===o?Ui:o,i=t.onDragEnd,a=void 0===i?Ui:i,s=t.eventType,l=void 0===s?"":s,u=t.eventCenter,c=t.step,d=void 0===c?1:c,p=t.isStopPropagation,h=void 0===p||p,f=t.model,g=t.data,v=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(t){var e,n,o=null===window||void 0===window?void 0:window.document;if(0===t.button){v.isStopPropagation&&t.stopPropagation(),v.isStartDragging=!0,v.startX=t.clientX,v.startY=t.clientY,o.addEventListener("mousemove",v.handleMouseMove,!1),o.addEventListener("mouseup",v.handleMouseUp,!1);var r=null===(e=v.model)||void 0===e?void 0:e.getData();null===(n=v.eventCenter)||void 0===n||n.emit(Om["".concat(v.eventType,"_MOUSEDOWN")],{e:t,data:v.data||r}),v.startTime=(new Date).getTime()}},this.handleMouseMove=function(t){var e,n;if(v.isStopPropagation&&t.stopPropagation(),v.isStartDragging&&(v.sumDeltaX+=t.clientX-v.startX,v.sumDeltaY+=t.clientY-v.startY,v.startX=t.clientX,v.startY=t.clientY,v.step<=1||Math.abs(v.sumDeltaX)>v.step||Math.abs(v.sumDeltaY)>v.step)){var o=v.sumDeltaX%v.step,r=v.sumDeltaY%v.step,i=v.sumDeltaX-o,a=v.sumDeltaY-r;v.sumDeltaX=o,v.sumDeltaY=r;var s=null===(e=v.model)||void 0===e?void 0:e.getData();v.isDragging||(null===(n=v.eventCenter)||void 0===n||n.emit(Om["".concat(v.eventType,"_DRAGSTART")],{e:t,data:v.data||s}),v.onDragStart({event:t})),v.isDragging=!0,Promise.resolve().then((function(){var e,n;v.onDragging({deltaX:i,deltaY:a,event:t}),null===(e=v.eventCenter)||void 0===e||e.emit(Om["".concat(v.eventType,"_MOUSEMOVE")],{deltaX:i,deltaY:a,e:t,data:v.data||s}),null===(n=v.eventCenter)||void 0===n||n.emit(Om["".concat(v.eventType,"_DRAG")],{e:t,data:v.data||s})}))}},this.handleMouseUp=function(t){var e=window.document;v.isStartDragging=!1,v.isStopPropagation&&t.stopPropagation(),Promise.resolve().then((function(){var n,o,r;e.removeEventListener("mousemove",v.handleMouseMove,!1),e.removeEventListener("mouseup",v.handleMouseUp,!1);var i=null===(n=v.model)||void 0===n?void 0:n.getData();null===(o=v.eventCenter)||void 0===o||o.emit(Om["".concat(v.eventType,"_MOUSEUP")],{e:t,data:v.data||i}),v.isDragging&&(v.isDragging=!1,v.onDragEnd({event:t}),null===(r=v.eventCenter)||void 0===r||r.emit(Om["".concat(v.eventType,"_DROP")],{e:t,data:v.data||i}))}))},this.cancelDrag=function(){var t=null===window||void 0===window?void 0:window.document;t.removeEventListener("mousemove",v.handleMouseMove,!1),t.removeEventListener("mouseup",v.handleMouseUp,!1),v.onDragEnd({event:void 0}),v.isDragging=!1},this.onDragStart=n,this.onDragging=r,this.onDragEnd=a,this.step=d,this.isStopPropagation=h,this.eventType=l,this.eventCenter=u,this.model=f,this.data=g}return t.prototype.setStep=function(t){this.step=t},t.prototype.setModel=function(t){this.model=t},t}(),Dm=function(t){return t.modelType===Cm.LINE_EDGE?function(t){var e=t.startPoint,n=t.endPoint,o=(e.x+n.x)/2,r=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:o-i/2,y:r-a/2,x1:o+i/2,y1:r+a/2}}(t):t.modelType===Cm.POLYLINE_EDGE?function(t){var e=t.points,n=rb(e),o=Wm(n,8),r=o.x,i=o.y,a=o.width,s=o.height;return{x:r-a/2,y:i-s/2,x1:r+a/2,y1:i+s/2}}(t):t.modelType===Cm.BEZIER_EDGE?function(t){var e=t.path,n=ub(e),o=Wm(n,8),r=o.x,i=o.y,a=o.width,s=o.height;return{x:r-a/2,y:i-s/2,x1:r+a/2,y1:i+s/2}}(t):void 0},km=function(t,e,n){var o=t.x,r=t.y,i=e.x,a=e.y,s=n.x,l=n.y,u=(l-a)/(s-i),c=a-u*i;return o>=i&&o<=s&&r>=a&&r<=l&&Math.abs(r-u*o+c)<Number.EPSILON},Rm=function(t){var e=t.start,n=t.end,o=t.offset,r=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)),l=Math.atan(o/r),u=Math.sqrt(r*r+o*o);return"start"===i?n.x>=e.x?(a.leftX=e.x+u*Math.sin(s+l),a.leftY=e.y-u*Math.cos(s+l),a.rightX=e.x-u*Math.sin(s-l),a.rightY=e.y+u*Math.cos(s-l)):(a.leftX=e.x-u*Math.sin(s+l),a.leftY=e.y+u*Math.cos(s+l),a.rightX=e.x+u*Math.sin(s-l),a.rightY=e.y-u*Math.cos(s-l)):"end"===i&&(n.x>=e.x?(a.leftX=n.x+u*Math.sin(s-l),a.leftY=n.y-u*Math.cos(s-l),a.rightX=n.x-u*Math.sin(s+l),a.rightY=n.y+u*Math.cos(s+l)):(a.leftX=n.x-u*Math.sin(s-l),a.leftY=n.y+u*Math.cos(s-l),a.rightX=n.x+u*Math.sin(s+l),a.rightY=n.y-u*Math.cos(s+l))),a},Lm=function(){return Lm=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Lm.apply(this,arguments)},Im=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},jm=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Bm=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},Hm=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}},Fm=function(t,e,n){var o=function(t,e){var n=Math.abs(t.x-e.centerX),o=Math.abs(t.y-e.centerY);return n/e.width>o/e.height?Tm.HORIZONTAL:Tm.VERTICAL}(n,e);return o===Tm.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}},zm=function(t,e){var n=Math.min(t.minX,e.minX),o=Math.min(t.minY,e.minY),r=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{x:(n+r)/2,y:(o+i)/2,centerX:(n+r)/2,centerY:(o+i)/2,minX:n,minY:o,maxX:r,maxY:i,height:i-o,width:r-n}},Wm=function(t,e){void 0===t&&(t=[]);var n=[],o=[];t.forEach((function(t){n.push(t.x),o.push(t.y)}));var r=Math.min.apply(Math,jm([],Im(n),!1)),i=Math.max.apply(Math,jm([],Im(n),!1)),a=Math.min.apply(Math,jm([],Im(o),!1)),s=Math.max.apply(Math,jm([],Im(o),!1)),l=i-r,u=s-a;return e&&(l+=e,u+=e),{centerX:(r+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:r,minY:a,x:(r+i)/2,y:(a+s)/2,height:u,width:l}},Um=function(t){var e=t.minX,n=t.minY,o=t.maxX,r=t.maxY;return[{x:e,y:n},{x:o,y:n},{x:o,y:r},{x:e,y:r}]},Xm=function(t,e){var n=t.x,o=t.y;return n<e.minX||n>e.maxX||o<e.minY||o>e.maxY},Gm=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},Ym=function(t,e,n,o,r){return Gm(t,e)+Gm(t,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}(t,[e,n,o,r])},Vm=function(t,e,n,o,r){r||(r=0),t.unshift(e[o]),n[o]&&n[o]!==o&&r<=100&&Vm(t,e,n,n[o],r+1)},Km=function(t,e,n,o){var r=e.x-t.x,i=e.y-t.y,a=o.x-n.x,s=o.y-n.y,l=(-i*(t.x-n.x)+r*(t.y-n.y))/(-a*i+r*s),u=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*i+r*s);return l>=0&&l<=1&&u>=0&&u<=1},qm=function(t,e,n){if(0===n.width&&0===n.height)return!1;var o=Im(Um(n),4),r=o[0],i=o[1],a=o[2],s=o[3];return Km(t,e,r,i)||Km(t,e,r,s)||Km(t,e,i,a)||Km(t,e,a,s)},Zm=function(t,e,n,o,r,i,a){var s=[],l=[e],u={},c={},d={};e.id&&(c[e.id]=0,d[e.id]=Ym(e,n,e));var p={};t.forEach((function(t){t.id&&(p[t.id]=t)}));for(var h=function(){var h,f,g,v,y=1/0;if(l.forEach((function(t){t.id&&d[t.id]<y&&(y=d[t.id],h=t)})),h===n&&n.id){var m=[];return Vm(m,p,u,n.id),{value:m}}if(!h)return{value:[e,n]};g=h,(v=(f=l).indexOf(g))>-1&&f.splice(v,1),s.push(h),function(t,e,n,o){var r=[];return t.forEach((function(t){t!==e&&(t.x!==e.x&&t.y!==e.y||qm(t,e,n)||qm(t,e,o)||r.push(t))})),Bm(r)}(t,h,o,r).forEach((function(t){if(-1===s.indexOf(t)&&(-1===l.indexOf(t)&&l.push(t),(null==h?void 0:h.id)&&(null==t?void 0:t.id))){var o=d[h.id]+Gm(h,t);if(c[t.id]&&o>=c[t.id])return;u[t.id]=h.id,c[t.id]=o,d[t.id]=c[t.id]+Ym(t,n,e,i,a)}}))};l.length;){var f=h();if("object"==typeof f)return f.value}return[e,n]},$m=function(t){return Hb(t)},Jm=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],o=t[e],r=t[e+1];n.x===o.x&&o.x===r.x||n.y===o.y&&o.y===r.y?t.splice(e,1):e++}return t},Qm=function(t,e,n,o,r){var i,a,s=$m(n),l=$m(o),u=Hm(s,r),c=Hm(l,r),d=Fm(u,s,t),p=Fm(c,l,e);if(i=u,a=c,2*Math.abs(i.centerX-a.centerX)<i.width+a.width&&2*Math.abs(i.centerY-a.centerY)<i.height+a.height){var h=ib(t,e,d,p);return jm(jm([t,d],Im(h),!1),[p,e],!1)}var f=Wm([d,p]),g=zm(u,f),v=zm(c,f),y=[];y=(y=y.concat(Um(g))).concat(Um(v));var m={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[f,g,v].forEach((function(t){y=y.concat(function(t,e){return jm(jm([],Im(function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x)),!1),Im(function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y)),!1)}(t,m).filter((function(t){return Xm(t,u)&&Xm(t,c)})))})),[{x:d.x,y:p.y},{x:p.x,y:d.y}].forEach((function(t){Xm(t,u)&&Xm(t,c)&&y.push(t)})),y.unshift(d),y.push(p),y=Bm(y);var b=Zm(y,d,p,s,l,t,e);return b.unshift(t),b.push(e),b.length>2&&(b=Jm(b)),Bm(b)},tb=function(t,e,n){var o=jb(t,n),r=jb(e,n);return o&&r},eb=function(t,e,n){var o=jb(t,n),r=jb(e,n);return!(o&&r)&&(o||r)},nb=function(t,e,n){for(var o=void 0,r=Hb(n),i=Um(r),a=0;a<i.length;a++){Km(t,e,i[a],i[(a+1)%i.length])&&(o=[i[a],i[(a+1)%i.length]])}if(o)return function(t,e,n,o){var r=(e.y-t.y)*(o.x-n.x)-(t.x-e.x)*(n.y-o.y);if(0===r)return!1;var i=((e.x-t.x)*(o.x-n.x)*(n.y-t.y)+(e.y-t.y)*(o.x-n.x)*t.x-(o.y-n.y)*(e.x-t.x)*n.x)/r,a=-((e.y-t.y)*(o.y-n.y)*(n.x-t.x)+(e.x-t.x)*(o.y-n.y)*t.y-(o.x-n.x)*(e.y-t.y)*n.y)/r;return(i-t.x)*(i-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(i-n.x)*(i-o.x)<=0&&(a-n.y)*(a-o.y)<=0&&{x:i,y:a}}(t,e,o[0],o[1])},ob=function(t,e){var n=void 0;return t.x===e.x?n=Tm.VERTICAL:t.y===e.y&&(n=Tm.HORIZONTAL),n},rb=function(t){var e=t.split(" "),n=[];return e&&e.forEach((function(t){var e=Im(t.split(","),2),o=e[0],r=e[1];n.push({x:Number(o),y:Number(r)})})),n},ib=function(t,e,n,o){var r=[];if(ob(t,n)===ob(e,o))t.y===n.y?(r.push({x:n.x,y:(n.y+o.y)/2}),r.push({x:o.x,y:(n.y+o.y)/2})):(r.push({x:(n.x+o.x)/2,y:n.y}),r.push({x:(n.x+o.x)/2,y:o.y}));else{var i={x:n.x,y:o.y},a=km(i,t,n),s=km(i,e,o);if(a||s)i={x:o.x,y:n.y};else{var l=ab(i,t,n),u=ab(i,e,o);l&&u&&(i={x:o.x,y:n.y})}r.push(i)}return r},ab=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},sb=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:e+=o>=1&&o<=126||o>=65376&&o<=65439?1:2}return e},lb=function(t){var e=t.start,n=t.end,o=t.sourceNode,r=t.targetNode,i=t.offset,a=Hb(o),s=Hb(r),l=Hm(a,i),u=Hm(s,i);return{sNext:Fm(l,a,e),ePre:Fm(u,s,n)}},ub=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(",");return[cb(e[0]),cb(e[1]),cb(e[2]),cb(e[3])]},cb=function(t){var e=Im(t.replace(/(^\s*)/g,"").split(" "),2);return{x:+e[0],y:+e[1]}},db=function(t,e){var n=Im(t,4),o=function(t,e,n,o,r){var i=function(r){if(r<0||r>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-r,3)+3*e.x*r*Math.pow(1-r,2)+3*n.x*Math.pow(r,2)*(1-r)+o.x*Math.pow(r,3),y:t.y*Math.pow(1-r,3)+3*e.y*r*Math.pow(1-r,2)+3*n.y*Math.pow(r,2)*(1-r)+o.y*Math.pow(r,3)}},a=0,s=2,l=o.x,u=o.y,c=o;for(;a<r&&s<50;){var d=(c=i(1-s/m_)).x,p=c.y;a=Ib(l,u,d,p),s++}return c}(n[0],n[1],n[2],n[3],e);return[o,t[3]]},pb=function(t,e){for(var n,o=t.x,r=t.y,i=rb(e),a=Number.MAX_SAFE_INTEGER,s=[],l=0;l<i.length;l++)s.push({start:i[l],end:i[(l+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:r};if(km(s,e,i))(l=Math.abs(e.x-o))<a&&(a=l,n=s)}else if(e.y===i.y){var l;s={x:o,y:e.y};if(km(s,e,i))(l=Math.abs(e.y-r))<a&&(a=l,n=s)}})),!n){var u=s[0],c=u.start,d=u.end;n={x:c.x+(d.x-c.x)/2,y:c.y+(d.y-c.y)/2}}return n},hb=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};var fb=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},gb=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function vb(t,e){return e*Math.round(t/e)||t}var yb=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},mb=function(t,e,n){var o=yb(t,2),r=o[0],i=o[1],a=yb(e,2),s=a[0],l=a[1],u=yb(n,2),c=u[0],d=u[1];return r>s&&r<c&&i>l&&i<d},bb=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},_b=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();function xb(t,e){return!!(t instanceof wb&&e instanceof wb)}var Eb=function(t){function e(n,o,r){var i=t.call(this,3)||this;return i[0]=n,i[1]=o,i[2]=r,i.x=n,i.y=o,i.z=r,Object.setPrototypeOf(i,e.prototype),i}return _b(e,t),e.prototype.add=function(t){if(xb(this,t))return new wb(this.x+t.x,this.y+t.y);var e=this.z+t.z;return new Sb((this.x+t.x)/e,(this.y+t.y)/e)},e.prototype.subtract=function(t){if(xb(this,t))return new wb(this.x-t.x,this.y-t.y);var e=this.z-t.z;return 0===e?new wb(this.x-t.x,this.y-t.y):new Sb((this.x-t.x)/e,(this.y-t.y)/e)},e}(Array),wb=function(t){function e(n,o,r){var i=t.call(this,n,o,null!=r?r:0)||this;return Object.setPrototypeOf(i,e.prototype),i}return _b(e,t),e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(t){var e=this;return t.reduce((function(t,n,o){return t+n*e[o]}))},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}(Eb),Sb=function(t){function e(n,o){var r=t.call(this,n,o,1)||this;return Object.setPrototypeOf(r,e.prototype),r}return _b(e,t),e.prototype.toString=function(){return"Point"},e}(Eb),Cb=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ob=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Mb=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Tb=function(t){function e(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=t.call(this,n.length)||this;return r.fill(new Array(3)),n.forEach((function(t,e){r[e]=t})),r.columns=n[0].length,r.rows=n.length,Object.setPrototypeOf(r,e.prototype),r}return Cb(e,t),e.prototype.getRow=function(t){return this[t]},e.prototype.getColumn=function(t){return Mb([],Ob(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,Mb([void 0],Ob(t),!1)))},e.prototype.cross=function(t){var n=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===t.rows)for(var o=0;o<this.rows;o++)for(var r=this.getRow(o),i=function(e){var i=t.getColumn(e);n[o][e]=r.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,Mb([void 0],Ob(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 Sb(t[0],t[1])}))},e.prototype.toString=function(){var t=Ob(this[0],2),e=t[0],n=t[1],o=Ob(this[1],2),r=o[0],i=o[1],a=Ob(this[2],2),s=a[0],l=a[1];return"matrix(".concat(e," ").concat(n," ").concat(r," ").concat(i," ").concat(s," ").concat(l,")")},e.prototype.translate=function(t,e){return this.cross(new Pb(t,e))},e.prototype.rotate=function(t){return this.cross(new Nb(t))},e.prototype.scale=function(t,e){return this.cross(new Ab(t,e))},e}(Array),Nb=function(t){function e(n){var o=t.call(this,new wb(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new wb(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new wb(0,0,1))||this;return Object.setPrototypeOf(o,e.prototype),o}return Cb(e,t),e.prototype.inverse=function(){return this.transpose()},e}(Tb),Ab=function(t){function e(n,o){var r=t.call(this,new wb(n,0,0),new wb(0,o,0),new wb(0,0,1))||this;return r.sx=n,r.sy=o,Object.setPrototypeOf(r,e.prototype),r}return Cb(e,t),e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(Tb),Pb=function(t){function e(n,o){var r=t.call(this,new wb(1,0,0),new wb(0,1,0),new wb(n,o,1))||this;return r.tx=n,r.ty=o,Object.setPrototypeOf(r,e.prototype),r}return Cb(e,t),e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(Tb);Pe({isolateGlobalState:!0});var Db=function(){return Db=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Db.apply(this,arguments)},kb=function(t){return t.anchors},Rb=function(t,e){for(var n,o=e.nodes,r=o.length-1;r>=0;r--){var i=o[r];if(Bb(t,i)){var a=i.getTargetAnchor(t);if(a){var s={node:i,anchorIndex:a.index,anchor:a.anchor};n&&!Lb(i,n.node,e)||(n=s)}}}return n},Lb=function(t,e,n){return t.zIndex>e.zIndex||n.nodesMap[t.id].index>n.nodesMap[e.id].index},Ib=function(t,e,n,o){return Math.hypot(t-n,e-o)},jb=function(t,e){var n=!1,o=Hb(e);return t.x>=o.minX-0&&t.x<=o.maxX+0&&t.y>=o.minY-0&&t.y<=o.maxY+0&&(n=!0),n},Bb=function(t,e){var n=!1,o=Hb(e);return t.x>=o.minX-5&&t.x<=o.maxX+5&&t.y>=o.minY-5&&t.y<=o.maxY+5&&(n=!0),n},Hb=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{minX:e-o/2,minY:n-r/2,maxX:e+o/2,maxY:n+r/2,x:e,y:n,width:o,height:r,centerX:e,centerY:n}},Fb=function(t,e,n){var o,r=function(t){var e=t,n=e.x,o=e.y,r=e.width,i=e.height,a=e.radius;return[{x:n-r/2+a,y:o-i/2+a,r:a},{x:n+r/2-a,y:o-i/2+a,r:a},{x:n-r/2+a,y:o+i/2-a,r:a},{x:n+r/2-a,y:o+i/2-a,r:a}]}(n),i=Number.MAX_SAFE_INTEGER;return r.forEach((function(e){var n=Ib(t.x,t.y,e.x,e.y);n<i&&(i=n,o=e)})),zb(t,e,o)},zb=function(t,e,n){var o,r=n.x,i=n.y,a=n.r;if(e===Tm.HORIZONTAL){var s=r-Math.sqrt(a*a-(t.y-i)*(t.y-i)),l=r+Math.sqrt(a*a-(t.y-i)*(t.y-i));o={x:Math.abs(s-t.x)<Math.abs(l-t.x)?s:l,y:t.y}}else if(e===Tm.VERTICAL){var u=i-Math.sqrt(a*a-(t.x-r)*(t.x-r)),c=i+Math.sqrt(a*a-(t.x-r)*(t.x-r)),d=Math.abs(u-t.y)<Math.abs(c-t.y)?u:c;o={x:t.x,y:d}}return o},Wb=function(t,e){var n=e,o=!1,r=n.x,i=n.y,a=n.width,s=n.height,l=n.radius,u=r-a/2+l,c=r+a/2-l,d=i-s/2+l,p=i+s/2-l;return t.y===i+s/2||t.y===i-s/2?o=t.x>u&&t.x<c:t.x!==r+a/2&&t.x!==r-a/2||(o=t.y>d&&t.y<p),o},Ub=function(t,e,n){var o,r=n,i=r.x,a=r.y,s=r.rx,l=r.ry;if(e===Tm.HORIZONTAL){var u=i-Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),c=i+Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l));o={x:Math.abs(u-t.x)<Math.abs(c-t.x)?u:c,y:t.y}}else if(e===Tm.VERTICAL){var d=a-Math.sqrt(l*l-(t.x-i)*(t.x-i)*l*l/(s*s)),p=a+Math.sqrt(l*l-(t.x-i)*(t.x-i)*l*l/(s*s)),h=Math.abs(d-t.y)<Math.abs(p-t.y)?d:p;o={x:t.x,y:h}}return o},Xb=function(t,e,n){for(var o,r=n.pointsPosition,i=Number.MAX_SAFE_INTEGER,a=[],s=0;s<r.length;s++)a.push({start:r[s],end:r[(s+1)%r.length]});return a.forEach((function(n){var r=n.start,a=n.end,s=r,l=a;r.x>a.x&&(s=a,l=r);var u={x:t.x,y:t.y};if(s.x===l.x&&e===Tm.HORIZONTAL&&(u={x:s.x,y:t.y}),s.y===l.y&&e===Tm.VERTICAL&&(u={x:t.x,y:s.y}),s.x!==l.x&&s.y!==l.y){var c=(l.y-s.y)/(l.x-s.x),d=(s.x*l.y-l.x*s.y)/(s.x-l.x);e===Tm.HORIZONTAL?u={x:(t.y-d)/c,y:t.y}:e===Tm.VERTICAL&&(u={x:t.x,y:c*t.x+d})}if(km(u,r,a)){var p=Ib(u.x,u.y,t.x,t.y);p<i&&(i=p,o=u)}})),o},Gb=function(t,e,n,o){var r=t.x,i=t.y;return e.x>t.x?r=t.x+n/2:e.x<t.x&&(r=t.x-n/2),e.y>t.y?i=t.y+o/2:e.y<t.y&&(i=t.y-o/2),{x:r,y:i}},Yb=function(t){var e=t.rows,n=t.style,o=t.rowsLength,r=t.className,i=document.createElement("div");i.className=r,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)),o>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},Vb=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,r=0;return e&&e.forEach((function(t){var e=sb(t);r=e>r?e:r})),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}},Kb=function(t){return"object"!=typeof t?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let qb;const Zb=new Uint8Array(16);function $b(){if(!qb&&(qb="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qb))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qb(Zb)}var Jb=/^(?:[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 Qb=[];for(let t=0;t<256;++t)Qb.push((t+256).toString(16).slice(1));function t_(t,e=0){return Qb[t[e+0]]+Qb[t[e+1]]+Qb[t[e+2]]+Qb[t[e+3]]+"-"+Qb[t[e+4]]+Qb[t[e+5]]+"-"+Qb[t[e+6]]+Qb[t[e+7]]+"-"+Qb[t[e+8]]+Qb[t[e+9]]+"-"+Qb[t[e+10]]+Qb[t[e+11]]+Qb[t[e+12]]+Qb[t[e+13]]+Qb[t[e+14]]+Qb[t[e+15]]}function e_(t){if(!function(t){return"string"==typeof t&&Jb.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 n_(t,e,n){function o(t,o,r,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 o&&(o=e_(o)),16!==(null===(a=o)||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(o),s.set(t,o.length),s=n(s),s[6]=15&s[6]|e,s[8]=63&s[8]|128,r){i=i||0;for(let t=0;t<16;++t)r[i+t]=s[t];return r}return t_(s)}try{o.name=t}catch(t){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}function o_(t){return 14+(t+64>>>9<<4)+1}function r_(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function i_(t,e,n,o,r,i){return r_((a=r_(r_(e,t),r_(o,i)))<<(s=r)|a>>>32-s,n);var a,s}function a_(t,e,n,o,r,i,a){return i_(e&n|~e&o,t,e,r,i,a)}function s_(t,e,n,o,r,i,a){return i_(e&o|n&~o,t,e,r,i,a)}function l_(t,e,n,o,r,i,a){return i_(e^n^o,t,e,r,i,a)}function u_(t,e,n,o,r,i,a){return i_(n^(e|~o),t,e,r,i,a)}n_("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,o="0123456789abcdef";for(let r=0;r<n;r+=8){const n=t[r>>5]>>>r%32&255,i=parseInt(o.charAt(n>>>4&15)+o.charAt(15&n),16);e.push(i)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[o_(e)-1]=e;let n=1732584193,o=-271733879,r=-1732584194,i=271733878;for(let e=0;e<t.length;e+=16){const a=n,s=o,l=r,u=i;n=a_(n,o,r,i,t[e],7,-680876936),i=a_(i,n,o,r,t[e+1],12,-389564586),r=a_(r,i,n,o,t[e+2],17,606105819),o=a_(o,r,i,n,t[e+3],22,-1044525330),n=a_(n,o,r,i,t[e+4],7,-176418897),i=a_(i,n,o,r,t[e+5],12,1200080426),r=a_(r,i,n,o,t[e+6],17,-1473231341),o=a_(o,r,i,n,t[e+7],22,-45705983),n=a_(n,o,r,i,t[e+8],7,1770035416),i=a_(i,n,o,r,t[e+9],12,-1958414417),r=a_(r,i,n,o,t[e+10],17,-42063),o=a_(o,r,i,n,t[e+11],22,-1990404162),n=a_(n,o,r,i,t[e+12],7,1804603682),i=a_(i,n,o,r,t[e+13],12,-40341101),r=a_(r,i,n,o,t[e+14],17,-1502002290),o=a_(o,r,i,n,t[e+15],22,1236535329),n=s_(n,o,r,i,t[e+1],5,-165796510),i=s_(i,n,o,r,t[e+6],9,-1069501632),r=s_(r,i,n,o,t[e+11],14,643717713),o=s_(o,r,i,n,t[e],20,-373897302),n=s_(n,o,r,i,t[e+5],5,-701558691),i=s_(i,n,o,r,t[e+10],9,38016083),r=s_(r,i,n,o,t[e+15],14,-660478335),o=s_(o,r,i,n,t[e+4],20,-405537848),n=s_(n,o,r,i,t[e+9],5,568446438),i=s_(i,n,o,r,t[e+14],9,-1019803690),r=s_(r,i,n,o,t[e+3],14,-187363961),o=s_(o,r,i,n,t[e+8],20,1163531501),n=s_(n,o,r,i,t[e+13],5,-1444681467),i=s_(i,n,o,r,t[e+2],9,-51403784),r=s_(r,i,n,o,t[e+7],14,1735328473),o=s_(o,r,i,n,t[e+12],20,-1926607734),n=l_(n,o,r,i,t[e+5],4,-378558),i=l_(i,n,o,r,t[e+8],11,-2022574463),r=l_(r,i,n,o,t[e+11],16,1839030562),o=l_(o,r,i,n,t[e+14],23,-35309556),n=l_(n,o,r,i,t[e+1],4,-1530992060),i=l_(i,n,o,r,t[e+4],11,1272893353),r=l_(r,i,n,o,t[e+7],16,-155497632),o=l_(o,r,i,n,t[e+10],23,-1094730640),n=l_(n,o,r,i,t[e+13],4,681279174),i=l_(i,n,o,r,t[e],11,-358537222),r=l_(r,i,n,o,t[e+3],16,-722521979),o=l_(o,r,i,n,t[e+6],23,76029189),n=l_(n,o,r,i,t[e+9],4,-640364487),i=l_(i,n,o,r,t[e+12],11,-421815835),r=l_(r,i,n,o,t[e+15],16,530742520),o=l_(o,r,i,n,t[e+2],23,-995338651),n=u_(n,o,r,i,t[e],6,-198630844),i=u_(i,n,o,r,t[e+7],10,1126891415),r=u_(r,i,n,o,t[e+14],15,-1416354905),o=u_(o,r,i,n,t[e+5],21,-57434055),n=u_(n,o,r,i,t[e+12],6,1700485571),i=u_(i,n,o,r,t[e+3],10,-1894986606),r=u_(r,i,n,o,t[e+10],15,-1051523),o=u_(o,r,i,n,t[e+1],21,-2054922799),n=u_(n,o,r,i,t[e+8],6,1873313359),i=u_(i,n,o,r,t[e+15],10,-30611744),r=u_(r,i,n,o,t[e+6],15,-1560198380),o=u_(o,r,i,n,t[e+13],21,1309151649),n=u_(n,o,r,i,t[e+4],6,-145523070),i=u_(i,n,o,r,t[e+11],10,-1120210379),r=u_(r,i,n,o,t[e+2],15,718787259),o=u_(o,r,i,n,t[e+9],21,-343485551),n=r_(n,a),o=r_(o,s),r=r_(r,l),i=r_(i,u)}return[n,o,r,i]}(function(t){if(0===t.length)return[];const e=8*t.length,n=new Uint32Array(o_(e));for(let o=0;o<e;o+=8)n[o>>5]|=(255&t[o/8])<<o%32;return n}(t),8*t.length))}));var c_={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function d_(t,e,n){if(c_.randomUUID&&!e&&!t)return c_.randomUUID();const o=(t=t||{}).random||(t.rng||$b)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=o[t];return e}return t_(o)}function p_(t,e,n,o){switch(t){case 0:return e&n^~e&o;case 1:case 3:return e^n^o;case 2:return e&n^e&o^n&o}}function h_(t,e){return t<<e|t>>>32-e}n_("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 o=t.length/4+2,r=Math.ceil(o/16),i=new Array(r);for(let e=0;e<r;++e){const n=new Uint32Array(16);for(let o=0;o<16;++o)n[o]=t[64*e+4*o]<<24|t[64*e+4*o+1]<<16|t[64*e+4*o+2]<<8|t[64*e+4*o+3];i[e]=n}i[r-1][14]=8*(t.length-1)/Math.pow(2,32),i[r-1][14]=Math.floor(i[r-1][14]),i[r-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<r;++t){const o=new Uint32Array(80);for(let e=0;e<16;++e)o[e]=i[t][e];for(let t=16;t<80;++t)o[t]=h_(o[t-3]^o[t-8]^o[t-14]^o[t-16],1);let r=n[0],a=n[1],s=n[2],l=n[3],u=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),i=h_(r,5)+p_(n,a,s,l)+u+e[n]+o[t]>>>0;u=l,l=s,s=h_(a,30)>>>0,a=r,r=i}n[0]=n[0]+r>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+l>>>0,n[4]=n[4]+u>>>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 f_=function(){return d_()},g_=new Map,v_=function(t){var e=f_();var n=window.requestAnimationFrame((function n(){if(t(),g_.get(e)){var o=window.requestAnimationFrame(n);g_.set(e,o)}}));return g_.set(e,n),e},y_=function(t){var e=g_.get(t);e&&(window.cancelAnimationFrame(e),g_.delete(t))},m_=100,b_={x:1,y:0,z:0};function __(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function x_(t){return function(t,e){var n=function(t,e){return t.x*e.y-t.y*e.x}(t,e),o=Math.acos(function(t,e){var n=[t.x,t.y,t.z];return[e.x,e.y,e.z].reduce((function(t,e,o){return t+e*n[o]}))}(__(t),__(e)));return n>=0?o:-o}(b_,t)}var E_={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"}},w_=function(t){var e=_d(E_);return t&&(e=ig(e,t)),e},S_=w_,C_=1e3,O_=999,M_=function(){return++C_},T_=function(){return T_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},T_.apply(this,arguments)},N_=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},A_=function(){function t(t,e){this.BaseType=Sm.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=Nm.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=wm.DEFAULT,this.modelType=Cm.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=e,this.initEdgeData(t),this.setAttributes()}return t.prototype.initEdgeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),o=this.createId();t.id=o||n||f_()}this.arrowConfig.markerEnd="url(#marker-end-".concat(t.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(t.id,")");var r=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=r,Ys(this,function(t){return rv(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])}(t)),this.graphModel.overlapMode===Mm.INCREASE&&(this.zIndex=t.zIndex||M_()),this.setAnchors(),this.initPoints(),this.formatText(t)},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.getEdgeStyle=function(){return T_(T_({},this.graphModel.theme.baseEdge),this.style)},t.prototype.getAdjustPointStyle=function(){return T_({},this.graphModel.theme.edgeAdjust)},t.prototype.getTextStyle=function(){return _d(this.graphModel.theme.edgeText)},t.prototype.getEdgeAnimationStyle=function(){return _d(this.graphModel.theme.edgeAnimation)},t.prototype.getArrowStyle=function(){var t=this.getEdgeStyle(),e=this.getEdgeAnimationStyle(),n=this.graphModel.theme.arrow,o=this.isAnimation?e.stroke:t.stroke;return T_(T_(T_({},t),{fill:o,stroke:o}),n)},t.prototype.getOutlineStyle=function(){return _d(this.graphModel.theme.outline)},t.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(t.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(t.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(t.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),t.prototype.getBeginAnchor=function(t,e,n){var o,r,i=kb(t);if(n){if(o=Oh(i,(function(t){return t.id===n})))return o;console.warn("未在节点上找到指定的起点锚点".concat(n,",已使用默认锚点作为起点"))}return i.forEach((function(t){var n=hb(t,e);(void 0===r||n<r)&&(r=n,o=t)})),o},t.prototype.getEndAnchor=function(t,e){var n,o,r=this,i=kb(t);if(e){if(n=Oh(i,(function(t){return t.id===e})))return n;console.warn("未在节点上找到指定的终点锚点".concat(e,",已使用默认锚点作为终点"))}return i.forEach((function(t){if(r.startPoint){var e=hb(t,r.startPoint);(void 0===o||e<o)&&(o=e,n=t)}})),n},t.prototype.getProperties=function(){return en(this.properties)},t.prototype.getData=function(){var t=this.properties;Ge(t)&&(t=en(t));var e={id:this.id,type:this.type,properties:t,sourceNodeId:this.sourceNode.id,targetNodeId:this.targetNode.id,startPoint:Ys({},this.startPoint),endPoint:Ys({},this.endPoint)};this.graphModel.overlapMode===Mm.INCREASE&&(e.zIndex=this.zIndex);var n=this.text,o=n.x,r=n.y,i=n.value;return i&&(e.text={x:o,y:r,value:i}),e},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.setProperty=function(t,e){this.properties[t]=Em(e),this.setAttributes()},t.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},t.prototype.setProperties=function(t){this.properties=T_(T_({},en(this.properties)),Em(t)),this.setAttributes()},t.prototype.changeEdgeId=function(t){var e=this.arrowConfig,n=e.markerEnd,o=e.markerStart;o&&o==="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},t.prototype.setStyle=function(t,e){var n;this.style=T_(T_({},this.style),((n={})[t]=Em(e),n))},t.prototype.setStyles=function(t){this.style=T_(T_({},this.style),Em(t))},t.prototype.updateStyles=function(t){this.style=T_({},Em(t))},t.prototype.setTextMode=function(t){this.textMode=t},t.prototype.formatText=function(t){var e,n,o,r=this.textPosition,i=r.x,a=r.y,s=t.text,l={value:"",x:i,y:a,draggable:!1,editable:!0};s&&("string"==typeof s?l=T_(T_({},l),{value:s}):(l=T_(T_({},l),{x:null!==(e=s.x)&&void 0!==e?e:i,y:null!==(n=s.y)&&void 0!==n?n:a,value:null!==(o=s.value)&&void 0!==o?o:""}),Uf(s.draggable)||(l.draggable=s.draggable),Uf(s.editable)||(l.editable=s.editable))),this.text=l},t.prototype.resetTextPosition=function(){var t=this.textPosition,e=t.x,n=t.y;this.text.x=e,this.text.y=n},t.prototype.moveText=function(t,e){var n=this.text,o=n.x,r=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,editable:s,draggable:a,x:o+t,y:r+e}},t.prototype.setText=function(t){t&&Ys(this.text,t)},t.prototype.updateText=function(t){this.text=T_(T_({},en(this.text)),{value:t})},t.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)}},t.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},t.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t},t.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},t.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},t.prototype.openEdgeAnimation=function(){this.isAnimation=!0},t.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},t.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},t.prototype.updateStartPoint=function(t){this.startPoint=t},t.prototype.moveStartPoint=function(t,e){this.startPoint&&(this.startPoint.x+=t,this.startPoint.y+=e)},t.prototype.updateEndPoint=function(t){this.endPoint=t},t.prototype.moveEndPoint=function(t,e){this.endPoint&&(this.endPoint.x+=t,this.endPoint.y+=e)},t.prototype.setZIndex=function(t){void 0===t&&(t=0),this.zIndex=t},t.prototype.initPoints=function(){},t.prototype.updateAttributes=function(t){Ys(this,t)},t.prototype.getAdjustStart=function(){return this.startPoint},t.prototype.getAdjustEnd=function(){return this.endPoint},t.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})},t.BaseType=Sm.EDGE,N_([mt],t.prototype,"type",void 0),N_([mt],t.prototype,"sourceNodeId",void 0),N_([mt],t.prototype,"targetNodeId",void 0),N_([mt],t.prototype,"startPoint",void 0),N_([mt],t.prototype,"endPoint",void 0),N_([mt],t.prototype,"textMode",void 0),N_([mt],t.prototype,"text",void 0),N_([mt],t.prototype,"properties",void 0),N_([mt],t.prototype,"points",void 0),N_([mt],t.prototype,"pointsList",void 0),N_([mt],t.prototype,"isSelected",void 0),N_([mt],t.prototype,"isHovered",void 0),N_([mt],t.prototype,"isHitable",void 0),N_([mt],t.prototype,"isHittable",void 0),N_([mt],t.prototype,"draggable",void 0),N_([mt],t.prototype,"visible",void 0),N_([mt],t.prototype,"isAnimation",void 0),N_([mt],t.prototype,"isShowAdjustPoint",void 0),N_([mt],t.prototype,"zIndex",void 0),N_([mt],t.prototype,"state",void 0),N_([mt],t.prototype,"style",void 0),N_([mt],t.prototype,"arrowConfig",void 0),N_([St],t.prototype,"sourceNode",null),N_([St],t.prototype,"targetNode",null),N_([St],t.prototype,"textPosition",null),N_([xe],t.prototype,"setProperty",null),N_([xe],t.prototype,"deleteProperty",null),N_([xe],t.prototype,"setProperties",null),N_([xe],t.prototype,"changeEdgeId",null),N_([xe],t.prototype,"setStyle",null),N_([xe],t.prototype,"setStyles",null),N_([xe],t.prototype,"updateStyles",null),N_([xe],t.prototype,"setTextMode",null),N_([xe],t.prototype,"formatText",null),N_([xe],t.prototype,"resetTextPosition",null),N_([xe],t.prototype,"moveText",null),N_([xe],t.prototype,"setText",null),N_([xe],t.prototype,"updateText",null),N_([xe],t.prototype,"setAnchors",null),N_([xe],t.prototype,"setSelected",null),N_([xe],t.prototype,"setHovered",null),N_([xe],t.prototype,"setHitable",null),N_([xe],t.prototype,"setHittable",null),N_([xe],t.prototype,"openEdgeAnimation",null),N_([xe],t.prototype,"closeEdgeAnimation",null),N_([xe],t.prototype,"setElementState",null),N_([xe],t.prototype,"updateStartPoint",null),N_([xe],t.prototype,"moveStartPoint",null),N_([xe],t.prototype,"updateEndPoint",null),N_([xe],t.prototype,"moveEndPoint",null),N_([xe],t.prototype,"setZIndex",null),N_([xe],t.prototype,"initPoints",null),N_([xe],t.prototype,"updateAttributes",null),N_([xe],t.prototype,"getAdjustStart",null),N_([xe],t.prototype,"getAdjustEnd",null),N_([xe],t.prototype,"updateAfterAdjustStartAndEnd",null),t}(),P_=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),D_=function(){return D_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},D_.apply(this,arguments)},k_=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},R_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},L_=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Cm.BEZIER_EDGE,o.path="",o.initEdgeData(e),o.setAttributes(),o}return P_(e,t),e.prototype.initEdgeData=function(e){this.offset=100,t.prototype.initEdgeData.call(this,e)},e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.bezier,n=t.prototype.getEdgeStyle.call(this);return D_(D_({},n),_d(e))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var t=0,e=0;return this.pointsList.forEach((function(n){var o=n.x,r=n.y;t+=o,e+=r})),{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}},e.prototype.getData=function(){var e=t.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return D_(D_({},e),{pointsList:n})},e.prototype.getControls=function(){var t=this.startPoint,e=this.endPoint;return lb({start:t,end:e,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})},e.prototype.getPath=function(t){var e=R_(t,4),n=e[0],o=e[1],r=e[2],i=e[3];return"M ".concat(n.x," ").concat(n.y,"\n C ").concat(o.x," ").concat(o.y,",\n ").concat(r.x," ").concat(r.y,",\n ").concat(i.x," ").concat(i.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var t=this.getControls(),e=t.sNext,n=t.ePre;this.updatePath(e,n)},e.prototype.updatePath=function(t,e){t=_d(t),e=_d(e);var n={x:this.startPoint.x,y:this.startPoint.y},o={x:this.endPoint.x,y:this.endPoint.y};if(!t||!e){var r=this.getControls();t=r.sNext,e=r.ePre}this.pointsList=[n,t,e,o],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e;var n=R_(this.pointsList,3),o=n[1],r=n[2];o.x+=t,o.y+=e,this.updatePath(o,r)},e.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e;var n=R_(this.pointsList,3),o=n[1],r=n[2];r.x+=t,r.y+=e,this.updatePath(o,r)},e.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(Ys({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,o=t.sourceNode,r=t.targetNode,i=lb({start:e,end:n,sourceNode:o,targetNode:r,offset:this.offset}),a=i.sNext,s=i.ePre;this.pointsList=[e,a,s,n],this.initPoints()},k_([mt],e.prototype,"path",void 0),k_([xe],e.prototype,"initPoints",null),k_([xe],e.prototype,"updatePoints",null),k_([xe],e.prototype,"updateStartPoint",null),k_([xe],e.prototype,"updateEndPoint",null),k_([xe],e.prototype,"moveStartPoint",null),k_([xe],e.prototype,"moveEndPoint",null),k_([xe],e.prototype,"updateAdjustAnchor",null),k_([xe],e.prototype,"getAdjustStart",null),k_([xe],e.prototype,"getAdjustEnd",null),k_([xe],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(A_),I_=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),j_=function(){return j_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},j_.apply(this,arguments)},B_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},H_=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},F_=function(t){function e(){var e=t.apply(this,H_([],B_(arguments),!1))||this;return e.modelType=Cm.LINE_EDGE,e}return I_(e,t),e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.line,n=t.prototype.getEdgeStyle.call(this);return j_(j_({},n),_d(e))},e.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e}(A_),z_=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),W_=function(){return W_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},W_.apply(this,arguments)},U_=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},X_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},G_=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Y_=function(t){function e(){var e=t.apply(this,G_([],X_(arguments),!1))||this;return e.modelType=Cm.POLYLINE_EDGE,e.draggingPointList=[],e}return z_(e,t),e.prototype.initEdgeData=function(e){this.offset=30,t.prototype.initEdgeData.call(this,e)},e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.polyline,n=t.prototype.getEdgeStyle.call(this);return W_(W_({},n),_d(e))},e.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 o=rb(this.points),r=X_(function(t){if(1===t.length){var e=Im(t,1)[0];return[e,e]}for(var n=t[0],o=t[1],r=Ib(n.x,n.y,o.x,o.y),i=1;i<t.length-1;i++){var a=t[i],s=t[i+1],l=Ib(a.x,a.y,s.x,s.y);l>r&&(r=l,n=a,o=s)}return[n,o]}(o),2),i=r[0],a=r[1];return{x:(i.x+a.x)/2,y:(i.y+a.y)/2}},e.prototype.getAfterAnchor=function(t,e,n){var o,r;return n.forEach((function(n){var i;t===Tm.HORIZONTAL?i=Math.abs(e.y-n.y):t===Tm.VERTICAL&&(i=Math.abs(e.x-n.x)),(!r||r>i)&&(r=i,o=n)})),o},e.prototype.getCrossPoint=function(t,e,n){var o;return t===Tm.HORIZONTAL?o={x:n.x,y:e.y}:t===Tm.VERTICAL&&(o={x:e.x,y:n.y}),o},e.prototype.removeCrossPoints=function(t,e,n){var o=n.map((function(t){return t}));if(1===t){var r=o[t],i=o[e],a=o[t-1];if(tb(a,r,this.sourceNode)){if(eb(r,i,this.sourceNode))(s=nb(r,i,this.sourceNode))&&(o[t]=s,o.splice(t-1,1),t--,e--)}else this.sourceNode.anchors.forEach((function(e){(e.x===a.x&&e.x===r.x||e.y===a.y&&e.y===r.y)&&(Ib(e.x,e.y,r.x,r.y)<Ib(a.x,a.y,r.x,r.y)&&(o[t-1]=e))}))}if(e===n.length-2){var s,l=o[t],u=o[e],c=o[e+1];if(tb(u,c,this.targetNode)){if(eb(l,u,this.targetNode))(s=nb(l,u,this.targetNode))&&(o[e]=s,o.splice(e+1,1))}else this.targetNode.anchors.forEach((function(t){(t.x===c.x&&t.x===u.x||t.y===c.y&&t.y===u.y)&&(Ib(t.x,t.y,u.x,u.y)<Ib(c.x,c.y,u.x,u.y)&&(o[e+1]=t))}))}return o},e.prototype.getDraggingPoints=function(t,e,n,o,r){var i=r.map((function(t){return t})),a=this.getAfterAnchor(t,n,o),s=this.getCrossPoint(t,n,a);return"start"===e?(i.unshift(s),i.unshift(a)):(i.push(s),i.push(a)),i},e.prototype.updateCrossPoints=function(t){var e=t.map((function(t){return t})),n=t[0],o=t[1],r=t[e.length-2],i=t[e.length-1],a=this.sourceNode,s=this.targetNode,l=a.modelType,u=s.modelType,c=ob(n,o),d=e[0];switch(l){case Cm.RECT_NODE:if(0!==a.radius)Wb(n,a)||(d=Fb(n,c,a));break;case Cm.CIRCLE_NODE:d=zb(n,c,a);break;case Cm.ELLIPSE_NODE:d=Ub(n,c,a);break;case Cm.DIAMOND_NODE:case Cm.POLYGON_NODE:d=Xb(n,c,a)}d&&(e[0]=d);var p=ob(r,i),h=e[e.length-1];switch(u){case Cm.RECT_NODE:if(0!==s.radius)Wb(i,s)||(h=Fb(i,p,s));break;case Cm.CIRCLE_NODE:h=zb(i,p,s);break;case Cm.ELLIPSE_NODE:h=Ub(i,p,s);break;case Cm.DIAMOND_NODE:case Cm.POLYGON_NODE:h=Xb(i,p,s)}return h&&(e[e.length-1]=h),e},e.prototype.getData=function(){var e=t.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return Object.assign({},e,{pointsList:n})},e.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.pointsList.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" "):this.updatePoints()},e.prototype.updatePoints=function(){var t=Qm({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(" ")},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e,this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e,this.updatePoints()},e.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 o=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},o),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map((function(t){return t}))},e.prototype.dragAppendSimple=function(t,e){var n;this.isDragging=!0;var o=t.start,r=t.end,i=t.startIndex,a=t.endIndex,s=t.direction,l=this.pointsList,u=l;return s===Tm.HORIZONTAL?(l[i]={x:o.x,y:o.y+e.y},l[a]={x:r.x,y:r.y+e.y},u=this.pointsList.map((function(t){return t}))):s===Tm.VERTICAL&&(l[i]={x:o.x+e.x,y:o.y},l[a]={x:r.x+e.x,y:r.y},u=this.pointsList.map((function(t){return t}))),this.updatePointsAfterDrag(u),this.draggingPointList=u,(null===(n=this.text)||void 0===n?void 0:n.value)&&this.setText(Ys({},this.text,this.textPosition)),{start:Ys({},l[i]),end:Ys({},l[a]),startIndex:i,endIndex:a,direction:s}},e.prototype.dragAppend=function(t,e){var n;this.isDragging=!0;var o=t.start,r=t.end,i=t.startIndex,a=t.endIndex,s=t.direction,l=this.pointsList;if(s===Tm.HORIZONTAL){l[i]={x:o.x,y:o.y+e.y},l[a]={x:r.x,y:r.y+e.y};var u=this.pointsList.map((function(t){return t}));if(0!==i&&a!==this.pointsList.length-1&&(u=this.removeCrossPoints(i,a,u)),0===i){var c={x:o.x,y:o.y+e.y};if(!jb(c,this.sourceNode)){var d=this.sourceNode.anchors;u=this.getDraggingPoints(s,"start",c,d,u)}}if(a===this.pointsList.length-1){var p={x:r.x,y:r.y+e.y};if(!jb(p,this.targetNode)){d=this.targetNode.anchors;u=this.getDraggingPoints(s,"end",p,d,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}else if(s===Tm.VERTICAL){l[i]={x:o.x+e.x,y:o.y},l[a]={x:r.x+e.x,y:r.y};u=this.pointsList.map((function(t){return t}));if(0!==i&&a!==this.pointsList.length-1&&(u=this.removeCrossPoints(i,a,u)),0===i){c={x:o.x+e.x,y:o.y};if(!jb(c,this.sourceNode)){d=this.sourceNode.anchors;u=this.getDraggingPoints(s,"start",c,d,u)}}if(a===this.pointsList.length-1){p={x:r.x+e.x,y:r.y};if(!jb(p,this.targetNode)){d=this.targetNode.anchors;u=this.getDraggingPoints(s,"end",p,d,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}return(null===(n=this.text)||void 0===n?void 0:n.value)&&this.setText(Ys({},this.text,this.textPosition)),{start:Ys({},l[i]),end:Ys({},l[a]),startIndex:i,endIndex:a,direction:s}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var t=Jm(rb(this.points));this.pointsList=t.map((function(t){return t})),this.draggingPointList=[];var e=t[0];this.startPoint=Ys({},e);var n=t[t.length-1];this.endPoint=Ys({},n)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(t){var e=this.updateCrossPoints(t);this.points=e.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,o=t.sourceNode,r=t.targetNode;this.pointsList=Qm({x:e.x,y:e.y},{x:n.x,y:n.y},o,r,this.offset||0),this.initPoints()},U_([mt],e.prototype,"dbClickPosition",void 0),U_([xe],e.prototype,"initPoints",null),U_([xe],e.prototype,"updatePoints",null),U_([xe],e.prototype,"updateStartPoint",null),U_([xe],e.prototype,"moveStartPoint",null),U_([xe],e.prototype,"updateEndPoint",null),U_([xe],e.prototype,"moveEndPoint",null),U_([xe],e.prototype,"updatePointsList",null),U_([xe],e.prototype,"dragAppendStart",null),U_([xe],e.prototype,"dragAppendSimple",null),U_([xe],e.prototype,"dragAppend",null),U_([xe],e.prototype,"dragAppendEnd",null),U_([xe],e.prototype,"updatePointsAfterDrag",null),U_([xe],e.prototype,"getAdjustStart",null),U_([xe],e.prototype,"getAdjustEnd",null),U_([xe],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(A_),V_=function(){return V_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},V_.apply(this,arguments)},K_=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},q_=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Z_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},$_=function(){function t(t,e){this.BaseType=Sm.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=Nm.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=wm.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=Cm.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=e,this.properties=t.properties||{},this.initNodeData(t),this.setAttributes()}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t;var e=this.x,n=void 0===e?0:e,o=this.y,r=void 0===o?0:o;this.transform=new Pb(-n,-r).rotate(t).translate(n,r).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),t.prototype.initNodeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),o=this.createId();t.id=o||n||f_()}this.formatText(t),Ys(this,function(t){return rv(t,["id","type","x","y","text","label","properties","virtual","rotate"])}(t)),this.graphModel.overlapMode===Mm.INCREASE&&(this.zIndex=t.zIndex||M_())},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.setTextMode=function(t){this.textMode=t},t.prototype.formatText=function(t){var e,n,o,r=t.x,i=t.y,a=t.text,s={value:"",x:r,y:i,draggable:!1,editable:!0};a&&("string"==typeof a?s.value=a:(s=V_(V_({},s),{x:null!==(e=a.x)&&void 0!==e?e:r,y:null!==(n=a.y)&&void 0!==n?n:i,value:null!==(o=a.value)&&void 0!==o?o:""}),Uf(a.draggable)||(s.draggable=a.draggable),Uf(a.editable)||(s.draggable=a.draggable))),t.text=s},t.prototype.resize=function(t){var e=t.width,n=t.height,o=t.deltaX,r=t.deltaY;return this.move(o/2,r/2),this.width=e,this.height=n,this.setProperties({width:e,height:n}),this.getData()},t.prototype.proportionalResize=function(){},t.prototype.getData=function(){var t=this.text,e=t.x,n=t.y,o=t.value,r=this.properties;Ge(r)&&(r=en(r));var i={id:this.id,type:this.type,x:this.x,y:this.y,properties:r};return this.rotate&&(i.rotate=this.rotate),this.graphModel.overlapMode===Mm.INCREASE&&(i.zIndex=this.zIndex),o&&(i.text={x:e,y:n,value:o}),i},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.getProperties=function(){return en(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return V_(V_({},this.graphModel.theme.baseNode),this.style)},t.prototype.getTextStyle=function(){var t=this.graphModel.theme.nodeText,e=this.properties.textStyle,n=void 0===e?{}:e;return V_(V_({},_d(t)),_d(n))},t.prototype.getRotateControlStyle=function(){return _d(this.graphModel.theme.rotateControl)},t.prototype.getResizeControlStyle=function(){return _d(this.graphModel.theme.resizeControl)},t.prototype.getResizeOutlineStyle=function(){return _d(this.graphModel.theme.resizeOutline)},t.prototype.getAnchorStyle=function(t){return _d(this.graphModel.theme.anchor)},t.prototype.getAnchorLineStyle=function(t){return _d(this.graphModel.theme.anchorLine)},t.prototype.getOutlineStyle=function(){return _d(this.graphModel.theme.outline)},t.prototype.isAllowConnectedAsSource=function(t,e,n,o){var r=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var i=!0,a="",s=0;s<r.length;s++){var l=r[s];if(!l.validate.call(this,this,t,e,n,o)){i=!1,a=l.message;break}}return{isAllPass:i,msg:a}},t.prototype.getConnectedSourceRules=function(){return this.sourceRules},t.prototype.isAllowConnectedAsTarget=function(t,e,n,o){var r=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var i=!0,a="",s=0;s<r.length;s++){var l=r[s];if(!l.validate.call(this,t,this,e,n,o)){i=!1,a=l.message;break}}return{isAllPass:i,msg:a}},t.prototype.isAllowMoveNode=function(t,e){var n,o,r=!0,i=!0,a=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var s=q_(a),l=s.next();!l.done;l=s.next()){var u=(0,l.value)(this,t,e);if(!u)return!1;if("object"==typeof u){var c=u;if(!c.x&&!c.y)return!1;r=r&&c.x,i=i&&c.y}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return{x:r,y:i}},t.prototype.getConnectedTargetRules=function(){return this.targetRules},t.prototype.getAnchorsByOffset=function(){var t=this,e=t.anchorsOffset,n=t.id,o=t.x,r=t.y;return e&&e.length>0?e.map((function(t,e){return t.length?{id:"".concat(n,"_").concat(e),x:o+t[0],y:r+t[1]}:V_(V_({},t),{x:o+t.x,y:r+t.y,id:t.id||"".concat(n,"_").concat(e)})})):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(t){return function(t,e){for(var n,o=kb(e),r=Number.MAX_SAFE_INTEGER,i=0;i<o.length;i++){var a=Ib(t.x,t.y,o[i].x,o[i].y);a<r&&(r=a,n={index:i,anchor:Db(Db({},o[i]),{x:o[i].x,y:o[i].y,id:o[i].id})})}return n}(t,this)},t.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(t.prototype,"anchors",{get:function(){var t=this.getAnchorsByOffset(),e=this,n=e.x,o=e.y,r=e.rotate;return t.forEach((function(t){var e=t.x,i=t.y,a=Z_(new Tb([e,i,1]).translate(-n,-o).rotate(r).translate(n,o)[0],2),s=a[0],l=a[1];t.x=s,t.y=l})),t},enumerable:!1,configurable:!0}),t.prototype.getAnchorInfo=function(t){if(!Hf(t))for(var e=0;e<this.anchors.length;e++){var n=this.anchors[e];if(n.id===t)return n}},t.prototype.addNodeMoveRules=function(t){this.moveRules.includes(t)||this.moveRules.push(t)},t.prototype.isAllowMoveByXORY=function(t,e,n){var o,r;if(n)o=!0,r=!0;else{var i=this.isAllowMoveNode(t,e);"boolean"==typeof i?(o=i,r=i):(o=i.x,r=i.y)}return{isAllowMoveX:o,isAllowMoveY:r}},t.prototype.move=function(t,e,n){void 0===n&&(n=!1);var o=this.isAllowMoveByXORY(t,e,n),r=o.isAllowMoveX,i=o.isAllowMoveY;return r&&(this.x=this.x+t,this.text&&this.moveText(t,0)),i&&(this.y=this.y+e,this.text&&this.moveText(0,e)),r||i},t.prototype.getMoveDistance=function(t,e,n){void 0===n&&(n=!1);var o=this.isAllowMoveByXORY(t,e,n),r=o.isAllowMoveX,i=o.isAllowMoveY,a=0,s=0;return r&&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]},t.prototype.moveTo=function(t,e,n){void 0===n&&(n=!1);var o=t-this.x,r=e-this.y;return!(!n&&!this.isAllowMoveNode(o,r))&&(this.text&&this.moveText(o,r),this.x=t,this.y=e,!0)},t.prototype.moveText=function(t,e){var n=this.text,o=n.x,r=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,editable:s,draggable:a,x:o+t,y:r+e}},t.prototype.updateText=function(t){this.text=V_(V_({},en(this.text)),{value:t})},t.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},t.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t,this.setIsShowAnchor(t)},t.prototype.setIsShowAnchor=function(t){void 0===t&&(t=!0),this.isShowAnchor=t},t.prototype.setEnableRotate=function(t){void 0===t&&(t=!0),this.enableRotate=t},t.prototype.setEnableResize=function(t){void 0===t&&(t=!0),this.enableResize=t},t.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},t.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},t.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},t.prototype.setProperty=function(t,e){var n,o=en(this.properties),r=V_(V_({},o),((n={})[t]=Em(e),n));this.properties=r,this.setAttributes(),this.graphModel.eventCenter.emit(Om.NODE_PROPERTIES_CHANGE,{id:this.id,keys:[t],preProperties:o,properties:r})},t.prototype.setProperties=function(t){var e=en(this.properties),n=V_(V_({},e),Em(t));this.properties=n,this.setAttributes();var o=[];tg(t,(function(t,n){(Zh(e,n)&&e[n]!==t||!Zh(e,n))&&o.push(n)})),this.graphModel.eventCenter.emit(Om.NODE_PROPERTIES_CHANGE,{id:this.id,keys:o,preProperties:e,properties:n})},t.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},t.prototype.setStyle=function(t,e){var n;this.style=V_(V_({},this.style),((n={})[t]=Em(e),n))},t.prototype.setStyles=function(t){this.style=V_(V_({},this.style),Em(t))},t.prototype.updateStyles=function(t){this.style=V_({},Em(t))},t.prototype.setZIndex=function(t){void 0===t&&(t=1),this.zIndex=t},t.prototype.updateAttributes=function(t){Ys(this,t)},t.BaseType=Sm.NODE,K_([mt],t.prototype,"type",void 0),K_([mt],t.prototype,"x",void 0),K_([mt],t.prototype,"y",void 0),K_([mt],t.prototype,"textMode",void 0),K_([mt],t.prototype,"text",void 0),K_([mt],t.prototype,"properties",void 0),K_([mt],t.prototype,"_width",void 0),K_([mt],t.prototype,"_height",void 0),K_([mt],t.prototype,"anchorsOffset",void 0),K_([mt],t.prototype,"isSelected",void 0),K_([mt],t.prototype,"isHovered",void 0),K_([mt],t.prototype,"isShowAnchor",void 0),K_([mt],t.prototype,"isDragging",void 0),K_([mt],t.prototype,"isHitable",void 0),K_([mt],t.prototype,"isHittable",void 0),K_([mt],t.prototype,"draggable",void 0),K_([mt],t.prototype,"visible",void 0),K_([mt],t.prototype,"enableRotate",void 0),K_([mt],t.prototype,"enableResize",void 0),K_([mt],t.prototype,"zIndex",void 0),K_([mt],t.prototype,"state",void 0),K_([mt],t.prototype,"autoToFront",void 0),K_([mt],t.prototype,"style",void 0),K_([mt],t.prototype,"transform",void 0),K_([mt],t.prototype,"_rotate",void 0),K_([St],t.prototype,"incoming",null),K_([St],t.prototype,"outgoing",null),K_([xe],t.prototype,"setTextMode",null),K_([xe],t.prototype,"addNodeMoveRules",null),K_([xe],t.prototype,"move",null),K_([xe],t.prototype,"getMoveDistance",null),K_([xe],t.prototype,"moveTo",null),K_([xe],t.prototype,"moveText",null),K_([xe],t.prototype,"updateText",null),K_([xe],t.prototype,"setSelected",null),K_([xe],t.prototype,"setHovered",null),K_([xe],t.prototype,"setIsShowAnchor",null),K_([xe],t.prototype,"setEnableRotate",null),K_([xe],t.prototype,"setEnableResize",null),K_([xe],t.prototype,"setHitable",null),K_([xe],t.prototype,"setHittable",null),K_([xe],t.prototype,"setElementState",null),K_([xe],t.prototype,"setProperty",null),K_([xe],t.prototype,"setProperties",null),K_([xe],t.prototype,"deleteProperty",null),K_([xe],t.prototype,"setStyle",null),K_([xe],t.prototype,"setStyles",null),K_([xe],t.prototype,"updateStyles",null),K_([xe],t.prototype,"setZIndex",null),K_([xe],t.prototype,"updateAttributes",null),t}(),J_=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Q_=function(){return Q_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Q_.apply(this,arguments)},tx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},ex=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Cm.CIRCLE_NODE,o.properties={},o.r=50,o.properties=e.properties||{},o.setAttributes(),o}return J_(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties.r;e&&(this.r=e)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.circle,o=this.properties.style,r=void 0===o?{}:o;return Q_(Q_(Q_({},e),_d(n)),_d(r))},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.r;return[{x:e,y:n-o,id:"".concat(this.id,"_0")},{x:e+o,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o,id:"".concat(this.id,"_2")},{x:e-o,y:n,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var e=t.width,n=t.deltaX,o=t.deltaY;return this.move(n/2,o/2),this.r=e,this.setProperties({r:e}),this.getData()},tx([mt],e.prototype,"properties",void 0),tx([mt],e.prototype,"r",void 0),tx([St],e.prototype,"width",null),tx([St],e.prototype,"height",null),e}($_),nx=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ox=function(){return ox=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},ox.apply(this,arguments)},rx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},ix=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},ax=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Cm.DIAMOND_NODE,o.rx=30,o.ry=50,o.properties={},o.properties=e.properties||{},o.setAttributes(),o}return nx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.rx,o=e.ry;n&&(this.rx=n),o&&(this.ry=o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.diamond,o=this.properties.style,r=void 0===o?{}:o;return ox(ox(ox({},e),_d(n)),_d(r))},Object.defineProperty(e.prototype,"points",{get:function(){var t=this,e=t.x,n=t.y,o=t.rx,r=t.ry;return[[e,n-r],[e+o,n],[e,n+r],[e-o,n]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return Rh(this.points,(function(t){var e=ix(t,2);return{x:e[0],y:e[1]}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return oh(this.points,(function(n){var o=ix(n,1)[0];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return oh(this.points,(function(n){var o=ix(n,2)[1];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this;return Rh(this.points,(function(e,n){var o=ix(e,2);return{x:o[0],y:o[1],id:"".concat(t.id,"_").concat(n)}}))},e.prototype.resize=function(t){var e=t.width,n=t.height,o=t.deltaX,r=t.deltaY;return this.move(o/2,r/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},rx([mt],e.prototype,"rx",void 0),rx([mt],e.prototype,"ry",void 0),rx([mt],e.prototype,"properties",void 0),rx([St],e.prototype,"points",null),rx([St],e.prototype,"pointsPosition",null),rx([St],e.prototype,"width",null),rx([St],e.prototype,"height",null),e}($_),sx=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),lx=function(){return lx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},lx.apply(this,arguments)},ux=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},cx=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Cm.ELLIPSE_NODE,o.rx=30,o.ry=45,o.properties={},o.properties=e.properties||{},o.setAttributes(),o}return sx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.rx,o=e.ry;n&&(this.rx=n),o&&(this.ry=o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.ellipse,o=this.properties.style,r=void 0===o?{}:o;return lx(lx(lx({},e),_d(n)),_d(r))},Object.defineProperty(e.prototype,"width",{get:function(){return 2*this.rx},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 2*this.ry},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.rx,r=t.ry;return[{x:e,y:n-r,id:"".concat(this.id,"_0")},{x:e+o,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+r,id:"".concat(this.id,"_2")},{x:e-o,y:n,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var e=t.width,n=t.height,o=t.deltaX,r=t.deltaY;return this.move(o/2,r/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},ux([mt],e.prototype,"rx",void 0),ux([mt],e.prototype,"ry",void 0),ux([mt],e.prototype,"properties",void 0),ux([St],e.prototype,"width",null),ux([St],e.prototype,"height",null),e}($_),dx=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),px=function(){return px=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},px.apply(this,arguments)},hx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},fx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},gx=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Cm.POLYGON_NODE,o.points=[[50,0],[100,50],[50,100],[0,50]],o.properties={},o.properties=e.properties||{},o.setAttributes(),o}return dx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.points,o=e.width,r=e.height,i=n||this.points;this.points=function(t,e,n){if(!t)return[];var o=Math.min.apply(Math,gb([],fb(t.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,gb([],fb(t.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,gb([],fb(t.map((function(t){return t[1]}))),!1)),a=Math.max.apply(Math,gb([],fb(t.map((function(t){return t[1]}))),!1)),s=-o,l=-i,u=t.map((function(t){var e=fb(t,2),n=e[0],o=e[1];return[n+s,o+l]})),c=e?e/(r-o):1,d=n?n/(a-i):1,p=Math.min(c,d);return u.map((function(t){var e=fb(t,2),n=e[0],o=e[1];return[n*p,o*p]}))}(i,o,r)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.polygon,o=this.properties.style,r=void 0===o?{}:o;return px(px(px({},e),_d(n)),_d(r))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var t=this,e=t.x,n=t.y,o=t.width,r=t.height;return this.points.map((function(t){return{x:t[0]+e-o/2,y:t[1]+n-r/2}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var o=fx(n,1)[0];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var o=fx(n,2)[1];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,e=this,n=e.x,o=e.y,r=e.width,i=e.height;return e.points.map((function(e,a){var s=fx(e,2),l=s[0],u=s[1];return{x:n+l-r/2,y:o+u-i/2,id:"".concat(t.id,"_").concat(a)}}))},e.prototype.resize=function(t){var e=this,n=t.width,o=t.height,r=t.deltaX,i=t.deltaY;this.move(r/2,i/2);var a=Rh(this.points,(function(t){var r=fx(t,2),i=r[0],a=r[1];return[i*n/e.width,a*o/e.height]}));return this.points=a,this.properties.points=a,this.getData()},hx([mt],e.prototype,"points",void 0),hx([mt],e.prototype,"properties",void 0),hx([St],e.prototype,"pointsPosition",null),hx([St],e.prototype,"width",null),hx([St],e.prototype,"height",null),e}($_),vx=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),yx=function(){return yx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},yx.apply(this,arguments)},mx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},bx=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Cm.RECT_NODE,o.radius=0,o.properties={},o.properties=e.properties||{},o.setAttributes(),o}return vx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.width,o=e.height,r=e.radius;n&&(this.width=n),o&&(this.height=o),r&&(this.radius=r)},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.width,r=t.height;return[{x:e,y:n-r/2,id:"".concat(this.id,"_0")},{x:e+o/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+r/2,id:"".concat(this.id,"_2")},{x:e-o/2,y:n,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.rect,o=this.properties.style,r=void 0===o?{}:o;return yx(yx(yx({},e),_d(n)),_d(r))},mx([mt],e.prototype,"radius",void 0),mx([mt],e.prototype,"properties",void 0),e}($_),_x=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),xx=function(){return xx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},xx.apply(this,arguments)},Ex=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},wx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Sx=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Cx=function(t){function e(){var e=t.apply(this,Sx([],wx(arguments),!1))||this;return e.modelType=Cm.TEXT_NODE,e}return _x(e,t),e.prototype.getTextStyle=function(){var e=t.prototype.getTextStyle.call(this),n=this.graphModel.theme.text,o=this.properties.textStyle;return xx(xx(xx({},e),_d(n)),_d(o))},Object.defineProperty(e.prototype,"width",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return Vb({rows:t,fontSize:e,rowsLength:t.length}).width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return Vb({rows:t,fontSize:e,rowsLength:t.length}).height},enumerable:!1,configurable:!0}),Ex([St],e.prototype,"width",null),Ex([St],e.prototype,"height",null),e}($_),Ox=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Mx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Tx=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Cm.HTML_NODE,o.properties={},o.properties=e.properties||{},o.setAttributes(),o}return Ox(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.width,o=e.height;n&&(this.width=n),o&&(this.height=o)},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.width,r=t.height;return[{x:e,y:n-r/2,id:"".concat(this.id,"_0")},{x:e+o/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+r/2,id:"".concat(this.id,"_2")},{x:e-o/2,y:n,id:"".concat(this.id,"_3")}]},Mx([mt],e.prototype,"properties",void 0),e}($_),Nx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Ax={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},Px=["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"],Dx=function(){function t(t){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.textMode=Nm.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!0,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=Nm.TEXT,this.edgeTextMode=Nm.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="",Ys(this,this.computeConfig(t))}return t.prototype.updateEditConfig=function(t){var e=this.computeConfig(t);Ys(this,e)},t.prototype.computeConfig=function(t){var e=t.isSilentMode,n=t.textDraggable,o=t.textMode,r=t.textEdit,i=t.adjustEdgeStartAndEnd,a={};if(!1===e&&Ys(a,this.stagedConfig),!0===e&&e!==this.isSilentMode){var s=rv(Ax,Px);this.stagedConfig=rv(this,Px),Ys(a,s)}!1===r&&Ys(a,{nodeTextEdit:!1,edgeTextEdit:!1}),o&&Ys(a,{nodeTextMode:o,edgeTextMode:o}),!1===n&&Ys(a,{nodeTextDraggable:!1,edgeTextDraggable:!1}),Of(i)&&Ys(a,{adjustEdgeStart:i,adjustEdgeEnd:i});var l=rv(t,Px);return Ys(a,l)},t.prototype.updateTextMode=function(t){this.textMode=t,this.edgeTextMode=t,this.nodeTextMode=t},t.prototype.getConfig=function(){return rv(this,Px)},Nx([mt],t.prototype,"isSilentMode",void 0),Nx([mt],t.prototype,"stopZoomGraph",void 0),Nx([mt],t.prototype,"stopMoveGraph",void 0),Nx([mt],t.prototype,"stopScrollGraph",void 0),Nx([mt],t.prototype,"textMode",void 0),Nx([mt],t.prototype,"textEdit",void 0),Nx([mt],t.prototype,"textDraggable",void 0),Nx([mt],t.prototype,"nodeTextEdit",void 0),Nx([mt],t.prototype,"nodeTextDraggable",void 0),Nx([mt],t.prototype,"nodeTextMultiple",void 0),Nx([mt],t.prototype,"nodeTextVertical",void 0),Nx([mt],t.prototype,"nodeTextMode",void 0),Nx([mt],t.prototype,"edgeTextMode",void 0),Nx([mt],t.prototype,"edgeTextEdit",void 0),Nx([mt],t.prototype,"edgeTextDraggable",void 0),Nx([mt],t.prototype,"edgeTextMultiple",void 0),Nx([mt],t.prototype,"edgeTextVertical",void 0),Nx([mt],t.prototype,"hideAnchors",void 0),Nx([mt],t.prototype,"allowRotate",void 0),Nx([mt],t.prototype,"allowResize",void 0),Nx([mt],t.prototype,"hoverOutline",void 0),Nx([mt],t.prototype,"nodeSelectedOutline",void 0),Nx([mt],t.prototype,"adjustNodePosition",void 0),Nx([mt],t.prototype,"autoExpand",void 0),Nx([mt],t.prototype,"adjustEdge",void 0),Nx([mt],t.prototype,"adjustEdgeMiddle",void 0),Nx([mt],t.prototype,"adjustEdgeStartAndEnd",void 0),Nx([mt],t.prototype,"adjustEdgeStart",void 0),Nx([mt],t.prototype,"adjustEdgeEnd",void 0),Nx([mt],t.prototype,"edgeSelectedOutline",void 0),Nx([xe],t.prototype,"updateEditConfig",null),Nx([xe],t.prototype,"updateTextMode",null),t}(),kx=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){var o=this;null==t||t.split(",").forEach((function(t){t=t.trim(),o._events[t]||(o._events[t]=[]),o._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 o=n._events[t]||[],r=n._events["*"]||[],i=function(o){for(var r=o.length,i=0;i<r;i++)if(o[i]){var a=o[i],s=a.callback;a.once&&(o.splice(i,1),0===o.length&&delete n._events[t],r--,i--),s.apply(n,[e])}};i(o),i(r)}))},t.prototype.off=function(t,e){var n=this;t||(this._events={}),t.split(",").forEach((function(t){if(e){for(var o=n._events[t]||[],r=o.length,i=0;i<r;i++)o[i].callback===e&&(o.splice(i,1),r--,i--);0===o.length&&delete n._events[t]}else delete n._events[t]}))},t.prototype.getEvents=function(){return this._events},t}(),Rx=function(){return Rx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Rx.apply(this,arguments)},Lx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Ix=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},jx=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Bx=function(){function t(t){this.modelMap=new Map,this.nodeMoveRules=[],this.nodes=[],this.edges=[],this.overlapMode=Mm.DEFAULT,this.gridSize=1,this.partial=!1;var e,n,o,r=t.container,i=t.partial,a=t.background,s=void 0===a?{}:a,l=t.grid,u=t.idGenerator,c=t.edgeGenerator,d=t.animation,p=t.customTrajectory;this.rootEl=r,this.partial=!!i,this.background=s,"object"==typeof l&&(this.gridSize=l.size||1),this.theme=w_(t.style),this.edgeType=t.edgeType||"polyline",this.animation=(e=d)&&"boolean"!=typeof e?ig(_d(bm),e):_d(!0===e?_m:bm),this.overlapMode=t.overlapMode||Mm.DEFAULT,this.width=t.width||this.rootEl.getBoundingClientRect().width,this.height=t.height||this.rootEl.getBoundingClientRect().height,this.eventCenter=new kx,this.editConfigModel=new Dx(t),this.transformModel=new Gx(this.eventCenter,t),this.flowId=f_(),this.idGenerator=u,this.edgeGenerator=(n=this,"function"!=typeof(o=c)?function(t,e,o){return Object.assign({type:n.edgeType},o)}:function(t,e,r){var i=o(t,e,r);return i?"string"==typeof i?Object.assign({},r,{type:i}):Object.assign({type:i},r):{type:n.edgeType}}),this.customTrajectory=p}return Object.defineProperty(t.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(t.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(t.prototype,"modelsMap",{get:function(){return jx(jx([],Ix(this.nodes),!1),Ix(this.edges),!1).reduce((function(t,e){return t[e.id]=e,t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sortElements",{get:function(){for(var t=jx(jx([],Ix(this.nodes),!1),Ix(this.edges),!1).sort((function(t,e){return t.zIndex-e.zIndex})),e=[],n=[-200,-200],o=[this.width+Am,this.height+Am],r=0;r<t.length;r++){var i=t[r];i.visible&&(!this.partial||i.isSelected||this.isElementInArea(i,n,o,!1,!1))&&e.push(i)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textEditElement",{get:function(){var t=this.nodes.find((function(t){return t.state===wm.TEXT_EDIT})),e=this.edges.find((function(t){return t.state===wm.TEXT_EDIT}));return t||e},enumerable:!1,configurable:!0}),Object.defineProperty(t.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(t.prototype,"selectNodes",{get:function(){var t=[];return this.nodes.forEach((function(e){e.isSelected&&t.push(e)})),t},enumerable:!1,configurable:!0}),t.prototype.getAreaElement=function(t,e,n,o,r){var i=this;void 0===n&&(n=!0),void 0===o&&(o=!0),void 0===r&&(r=!1);var a=[];return oh(jx(jx([],Ix(this.nodes),!1),Ix(this.edges),!1),(function(s){var l=i.isElementInArea(s,t,e,n,o);r&&!s.visible||!l||a.push(s)})),a},t.prototype.getModel=function(t){return this.modelMap.get(t)},t.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},t.prototype.getPointByClient=function(t){var e=t.x,n=t.y,o=this.rootEl.getBoundingClientRect(),r={x:e-o.left,y:n-o.top},i=Ix(this.transformModel.HtmlPointToCanvasPoint([r.x,r.y]),2);return{domOverlayPosition:r,canvasOverlayPosition:{x:i[0],y:i[1]}}},t.prototype.isElementInArea=function(t,e,n,o,r){var i;if(void 0===o&&(o=!0),void 0===r&&(r=!0),t.BaseType===Sm.NODE){for(var a=Hb(t),s=a.minX,l=a.minY,u=a.maxX,c=a.maxY,d=[{x:s,y:l},{x:u,y:l},{x:u,y:c},{x:s,y:c}],p=r,h=0;h<d.length;h++){var f=d[h],g=f.x,v=f.y;if(g=(i=Ix(this.transformModel.CanvasPointToHtmlPoint([g,v]),2))[0],v=i[1],mb([g,v],e,n)!==r){p=!r;break}}return p}if(t.BaseType===Sm.EDGE){var y=t.startPoint,m=t.endPoint,b=this.transformModel.CanvasPointToHtmlPoint([y.x,y.y]),_=this.transformModel.CanvasPointToHtmlPoint([m.x,m.y]),x=mb(b,e,n),E=mb(_,e,n);return o?x&&E:x||E}return!1},t.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=Rh(t.nodes,(function(t){return e.getModelAfterSnapToGrid(t)})):this.nodes=[],t.edges){var n=this.edgeType;this.edges=Rh(t.edges,(function(t){var o,r=e.getModel(null!==(o=t.type)&&void 0!==o?o:n);if(!r)throw new Error("找不到".concat(t.type,"对应的边。"));return new r(t,e)}))}else this.edges=[]},t.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}},t.prototype.modelToHistoryData=function(){for(var t=!1,e=[],n=0;n<this.nodes.length;n++){var o=this.nodes[n];if(o.isDragging){t=!0;break}e.push(o.getHistoryData())}if(t)return!1;for(var r=!1,i=[],a=0;a<this.edges.length;a++){var s=this.edges[a];if(s.isDragging){r=!0;break}i.push(s.getHistoryData())}return!r&&{nodes:e,edges:i}},t.prototype.getEdgeModelById=function(t){var e;return null===(e=this.edgesMap[t])||void 0===e?void 0:e.model},t.prototype.getElement=function(t){return this.modelsMap[t]},t.prototype.getNodeEdges=function(t){for(var e=[],n=0;n<this.edges.length;n++){var o=this.edges[n],r=o.sourceNodeId===t,i=o.targetNodeId===t;(r||i)&&e.push(o)}return e},t.prototype.getSelectElements=function(t){void 0===t&&(t=!0);var e=this.selectElements,n={nodes:[],edges:[]};return e.forEach((function(o){if(o.BaseType===Sm.NODE&&n.nodes.push(o.getData()),o.BaseType===Sm.EDGE){var r=o.getData(),i=e.get(r.sourceNodeId)&&e.get(r.targetNodeId);(t||i)&&n.edges.push(r)}})),n},t.prototype.updateAttributes=function(t,e){var n=this.getElement(t);null==n||n.updateAttributes(e)},t.prototype.changeNodeId=function(t,e){return e||(e=f_()),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,", 修改失败")),"")},t.prototype.changeEdgeId=function(t,e){return e||(e=f_()),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,", 修改失败")),"")},t.prototype.getTextModel=function(t){var e=this.editConfigModel,n=e.textMode,o=e.nodeTextMode,r=e.edgeTextMode;return t.BaseType===Sm.NODE?t.textMode||o||n||Nm.TEXT:t.BaseType===Sm.EDGE?t.textMode||r||n||Nm.TEXT:void 0},t.prototype.setTextMode=function(t,e){this.editConfigModel.updateEditConfig({textMode:t})},t.prototype.setFakeNode=function(t){this.fakeNode=t},t.prototype.removeFakeNode=function(){this.fakeNode=null},t.prototype.setModel=function(t,e){return this.modelMap.set(t,e)},t.prototype.toFront=function(t){var e,n,o,r=(null===(e=this.nodesMap[t])||void 0===e?void 0:e.model)||(null===(n=this.edgesMap[t])||void 0===n?void 0:n.model);r&&(this.overlapMode===Mm.DEFAULT&&(null===(o=this.topElement)||void 0===o||o.setZIndex(),r.setZIndex(9999),this.topElement=r),this.overlapMode===Mm.INCREASE&&this.setElementZIndex(t,"top"))},t.prototype.setElementZIndex=function(t,e){var n,o,r=(null===(n=this.nodesMap[t])||void 0===n?void 0:n.model)||(null===(o=this.edgesMap[t])||void 0===o?void 0:o.model);if(r){var i=void 0;"number"==typeof e?i=e:("top"===e&&(i=M_()),"bottom"===e&&(i=--O_)),r.setZIndex(i)}},t.prototype.deleteNode=function(t){var e=this.nodesMap[t].model.getData();this.deleteEdgeBySource(t),this.deleteEdgeByTarget(t),this.nodes.splice(this.nodesMap[t].index,1),this.eventCenter.emit(Om.NODE_DELETE,{data:e})},t.prototype.addNode=function(t,e,n){void 0===e&&(e=Om.NODE_ADD);var o=Em(t),r=o.id;r&&this.nodesMap[r]&&delete o.id;var i=this.getModelAfterSnapToGrid(o);this.nodes.push(i);var a={data:i.getData()};return n&&(a.e=n),this.eventCenter.emit(e,a),i},t.prototype.getModelAfterSnapToGrid=function(t){var e=this.getModel(t.type);if(!e)throw new Error("找不到".concat(t.type,"对应的节点,请确认是否已注册此类型节点。"));var n=t.x,o=t.y;return n&&o&&(t.x=vb(n,this.gridSize),t.y=vb(o,this.gridSize),Jr(t.text)&&(t.text.x+=t.x-n,t.text.y+=t.y-o)),new e(t,this)},t.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="",Jr(n.text)&&(n.text.x+=30,n.text.y+=30);var o=this.addNode(n);return o.setSelected(!0),null==e||e.setSelected(!1),o.getData()}},t.prototype.moveNode=function(t,e,n,o){var r;void 0===o&&(o=!1);var i=this.nodesMap[t];if(i){var a=i.model;e=(r=Ix(a.getMoveDistance(e,n,o),2))[0],n=r[1],this.moveEdge(t,e,n)}else console.warn("不存在id为".concat(t,"的节点"))},t.prototype.moveNode2Coordinate=function(t,e,n,o){void 0===o&&(o=!1);var r=this.nodesMap[t];if(r){var i=r.model,a=e-i.x,s=n-i.y;this.moveNode(t,a,s,o)}else console.warn("不存在id为".concat(t,"的节点"))},t.prototype.editText=function(t){this.setElementStateById(t,wm.TEXT_EDIT)},t.prototype.addEdge=function(t){var e=Em(t),n=e.type;n||(n=this.edgeType),e.id&&this.edgesMap[e.id]&&delete e.id;var o=this.getModel(n);if(!o)throw new Error("找不到".concat(n,"对应的边,请确认是否已注册此类型边。"));var r=new o(Rx(Rx({},e),{type:n}),this),i=r.getData();return this.edges.push(r),this.eventCenter.emit(Om.EDGE_ADD,{data:i}),r},t.prototype.moveEdge=function(t,e,n){for(var o=0;o<this.edges.length;o++){var r=this.edges[o],i=r.textPosition,a=i.x,s=i.y,l=this.edges[o].sourceNodeId===t,u=this.edges[o].targetNodeId===t;l&&r.moveStartPoint(e,n),u&&r.moveEndPoint(e,n),(l||u)&&this.handleEdgeTextMove(r,a,s)}},t.prototype.handleEdgeTextMove=function(t,e,n){var o;if(t.customTextPosition)t.resetTextPosition();else{if(t.modelType===Cm.POLYLINE_EDGE&&(null===(o=t.text)||void 0===o?void 0:o.value)){var r=t.text,i=pb(r,t.points);t.moveText(i.x-r.x,i.y-r.y)}var a=t.textPosition,s=a.x,l=a.y;t.moveText(s-e,l-n)}},t.prototype.deleteEdgeBySourceAndTarget=function(t,e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===t&&this.edges[n].targetNodeId===e){var o=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(Om.EDGE_DELETE,{data:o})}},t.prototype.deleteEdgeById=function(t){if(this.edgesMap[t]){var e=this.edgesMap[t].index,n=this.edgesMap[t].model.getData();this.edges.splice(e,1),this.eventCenter.emit(Om.EDGE_DELETE,{data:n})}},t.prototype.deleteEdgeBySource=function(t){for(var e=0;e<this.edges.length;e++)if(this.edges[e].sourceNodeId===t){var n=this.edges[e].getData();this.edges.splice(e,1),e--,this.eventCenter.emit(Om.EDGE_DELETE,{data:n})}},t.prototype.deleteEdgeByTarget=function(t){for(var e=0;e<this.edges.length;e++)if(this.edges[e].targetNodeId===t){var n=this.edges[e].getData();this.edges.splice(e,1),e--,this.eventCenter.emit(Om.EDGE_DELETE,{data:n})}},t.prototype.setElementStateById=function(t,e,n){this.nodes.forEach((function(o){o.id===t?o.setElementState(e,n):o.setElementState(wm.DEFAULT)})),this.edges.forEach((function(o){o.id===t?o.setElementState(e,n):o.setElementState(wm.DEFAULT)}))},t.prototype.updateText=function(t,e){var n=Oh(jx(jx([],Ix(this.nodes),!1),Ix(this.edges),!1),(function(e){return e.id===t}));null==n||n.updateText(e)},t.prototype.selectNodeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var o=null===(n=this.nodesMap[t])||void 0===n?void 0:n.model;null==o||o.setSelected(!0)},t.prototype.selectEdgeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var o=null===(n=this.edgesMap[t])||void 0===n?void 0:n.model;null==o||o.setSelected(!0)},t.prototype.selectElementById=function(t,e){void 0===e&&(e=!1),e||this.clearSelectElements();var n=this.getElement(t);null==n||n.setSelected(!0)},t.prototype.clearSelectElements=function(){var t;this.selectElements.forEach((function(t){null==t||t.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===Mm.DEFAULT&&(null===(t=this.topElement)||void 0===t||t.setZIndex())},t.prototype.moveNodes=function(t,e,n,o){var r,i,a,s=this;void 0===o&&(o=!1);for(var l=t.reduce((function(t,r){var i=s.nodesMap[r].model;return t[r]=i.getMoveDistance(e,n,o),t}),{}),u=0;u<this.edges.length;u++){var c=this.edges[u],d=c.textPosition,p=d.x,h=d.y,f=l[c.sourceNodeId],g=l[c.targetNodeId],v=void 0,y=void 0;f&&g&&c.modelType===Cm.POLYLINE_EDGE?(v=(r=Ix(f,2))[0],y=r[1],c.updatePointsList(v,y)):(f&&(v=(i=Ix(f,2))[0],y=i[1],c.moveStartPoint(v,y)),g&&(v=(a=Ix(g,2))[0],y=a[1],c.moveEndPoint(v,y))),(f||g)&&this.handleEdgeTextMove(c,p,h)}},t.prototype.addNodeMoveRules=function(t){this.nodeMoveRules.includes(t)||this.nodeMoveRules.push(t)},t.prototype.setDefaultEdgeType=function(t){this.edgeType=t},t.prototype.changeNodeType=function(t,e){var n=this.getNodeModelById(t);if(n){var o=n.getData();o.type=e;var r=this.getModel(e);if(!r)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));var i=new r(o,this);this.nodes.splice(this.nodesMap[t].index,1,i),this.getNodeEdges(t).forEach((function(e){if(e.sourceNodeId===t){var n=Gb(i,e.startPoint,i.width,i.height);e.updateStartPoint(n)}if(e.targetNodeId===t){n=Gb(i,e.endPoint,i.width,i.height);e.updateEndPoint(n)}}))}else console.warn("找不到id为".concat(t,"的节点"))},t.prototype.changeEdgeType=function(t,e){var n=this.getEdgeModelById(t);if(n){if(n.type!==e){var o=n.getData();o.type=e;var r=this.getModel(e);if(!r)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));delete o.pointsList;var i=new r(o,this);this.edges.splice(this.edgesMap[t].index,1,i)}}else console.warn("找不到id为".concat(t,"的边"))},t.prototype.getNodeIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetNodeId===t&&e.push(n)})),e},t.prototype.getNodeOutgoingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceNodeId===t&&e.push(n)})),e},t.prototype.getAnchorIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetAnchorId===t&&e.push(n)})),e},t.prototype.getAnchorOutcomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceAnchorId===t&&e.push(n)})),e},t.prototype.getNodeIncomingNode=function(t){var e=this,n=[];return this.edges.forEach((function(o){var r;o.targetNodeId===t&&n.push(null===(r=e.nodesMap[o.sourceNodeId])||void 0===r?void 0:r.model)})),n},t.prototype.getNodeOutgoingNode=function(t){var e=this,n=[];return this.edges.forEach((function(o){o.sourceNodeId===t&&n.push(e.nodesMap[o.targetNodeId].model)})),n},t.prototype.setTheme=function(t){this.theme=S_(Rx(Rx({},this.theme),t))},t.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")},t.prototype.clearData=function(){this.nodes=[],this.edges=[]},t.prototype.getVirtualRectSize=function(){var t=this.nodes,e=[],n=[];t.forEach((function(t){var o=t.x,r=t.y,i=t.width,a=t.height,s=t.getNodeStyle().strokeWidth,l=void 0===s?0:s,u=o+i/2+l,c=o-i/2-l,d=r+a/2+l,p=r-a/2-l;e=e.concat([u,c].filter((function(t){return!Number.isNaN(t)}))),n=n.concat([d,p].filter((function(t){return!Number.isNaN(t)})))}));var o=Math.min.apply(Math,jx([],Ix(e),!1)),r=Math.max.apply(Math,jx([],Ix(e),!1)),i=Math.min.apply(Math,jx([],Ix(n),!1)),a=r-o||0,s=Math.max.apply(Math,jx([],Ix(n),!1))-i||0;return{width:a,height:s,x:o+a/2,y:i+s/2}},t.prototype.translateCenter=function(){var t=this,e=t.nodes,n=t.width,o=t.height,r=t.rootEl,i=t.transformModel;if(e.length){var a=n||r.clientWidth,s=o||r.clientHeight,l=this.getVirtualRectSize(),u=l.x,c=l.y;i.focusOn(u,c,a,s)}},t.prototype.fitView=function(t,e){void 0===t&&(t=20),void 0===e&&(e=20);var n=this,o=n.nodes,r=n.width,i=n.height,a=n.rootEl,s=n.transformModel;if(o.length){var l=r||a.clientWidth,u=i||a.clientHeight,c=this.getVirtualRectSize(),d=c.width,p=c.height,h=c.x,f=c.y,g=(d+e)/l,v=(p+t)/u,y=1/Math.max(g,v),m=[l/2,u/2];s.zoom(y,m),s.focusOn(h,f,l,u)}},t.prototype.openEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.openEdgeAnimation()},t.prototype.closeEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.closeEdgeAnimation()},t.prototype.getPartial=function(){return this.partial},t.prototype.setPartial=function(t){this.partial=t},Lx([mt],t.prototype,"width",void 0),Lx([mt],t.prototype,"height",void 0),Lx([mt],t.prototype,"edgeType",void 0),Lx([mt],t.prototype,"nodes",void 0),Lx([mt],t.prototype,"edges",void 0),Lx([mt],t.prototype,"fakeNode",void 0),Lx([mt],t.prototype,"overlapMode",void 0),Lx([mt],t.prototype,"background",void 0),Lx([mt],t.prototype,"gridSize",void 0),Lx([mt],t.prototype,"transformModel",void 0),Lx([mt],t.prototype,"editConfigModel",void 0),Lx([mt],t.prototype,"partial",void 0),Lx([St],t.prototype,"nodesMap",null),Lx([St],t.prototype,"edgesMap",null),Lx([St],t.prototype,"modelsMap",null),Lx([St],t.prototype,"sortElements",null),Lx([St],t.prototype,"textEditElement",null),Lx([St],t.prototype,"selectElements",null),Lx([St],t.prototype,"selectNodes",null),Lx([xe],t.prototype,"setTextMode",null),Lx([xe],t.prototype,"setFakeNode",null),Lx([xe],t.prototype,"removeFakeNode",null),Lx([xe],t.prototype,"setModel",null),Lx([xe],t.prototype,"toFront",null),Lx([xe],t.prototype,"setElementZIndex",null),Lx([xe],t.prototype,"deleteNode",null),Lx([xe],t.prototype,"addNode",null),Lx([xe],t.prototype,"cloneNode",null),Lx([xe],t.prototype,"moveNode",null),Lx([xe],t.prototype,"moveNode2Coordinate",null),Lx([xe],t.prototype,"editText",null),Lx([xe],t.prototype,"addEdge",null),Lx([xe],t.prototype,"moveEdge",null),Lx([xe],t.prototype,"deleteEdgeBySourceAndTarget",null),Lx([xe],t.prototype,"deleteEdgeById",null),Lx([xe],t.prototype,"deleteEdgeBySource",null),Lx([xe],t.prototype,"deleteEdgeByTarget",null),Lx([xe],t.prototype,"setElementStateById",null),Lx([xe],t.prototype,"updateText",null),Lx([xe],t.prototype,"selectNodeById",null),Lx([xe],t.prototype,"selectEdgeById",null),Lx([xe],t.prototype,"selectElementById",null),Lx([xe],t.prototype,"clearSelectElements",null),Lx([xe],t.prototype,"moveNodes",null),Lx([xe],t.prototype,"setDefaultEdgeType",null),Lx([xe],t.prototype,"changeNodeType",null),Lx([xe],t.prototype,"changeEdgeType",null),Lx([xe],t.prototype,"getNodeIncomingEdge",null),Lx([xe],t.prototype,"getNodeOutgoingEdge",null),Lx([xe],t.prototype,"getAnchorIncomingEdge",null),Lx([xe],t.prototype,"getAnchorOutcomingEdge",null),Lx([xe],t.prototype,"getNodeIncomingNode",null),Lx([xe],t.prototype,"getNodeOutgoingNode",null),Lx([xe],t.prototype,"setTheme",null),Lx([xe],t.prototype,"resize",null),Lx([xe],t.prototype,"clearData",null),Lx([xe],t.prototype,"translateCenter",null),Lx([xe],t.prototype,"fitView",null),Lx([xe],t.prototype,"openEdgeAnimation",null),Lx([xe],t.prototype,"closeEdgeAnimation",null),Lx([xe],t.prototype,"setPartial",null),t}(),Hx=function(){return Hx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Hx.apply(this,arguments)},Fx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},zx=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 Hx({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(t,e){for(var n=t.x,o=t.y,r=!1,i=!1,a=0;a<e.length;a++){var s=e[a];if(s.id!==t.id&&(n===s.x&&(r=!0),o===s.y&&(i=!0),r&&i))break}return{isShowVertical:r,isShowHorizontal:i,position:{x:n,y:o}}},t.prototype.getHorizontalSnapline=function(t,e){var n,o=!1,r=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=Hb(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=Hb(s))}}for(var l=0;l<e.length;l++){var u=e[l];if(u.id!==t.id){var c=Hb(u);if(c.minY===(null==n?void 0:n.minY)||c.maxY===(null==n?void 0:n.minY)){o=!0,r=n.minY;break}if(c.minY===(null==n?void 0:n.maxY)||c.maxY===(null==n?void 0:n.maxY)){o=!0,r=n.maxY;break}}}return{isShowHorizontal:o,isShowVertical:this.isShowVertical,position:Hx(Hx({},this.position),{y:r})}},t.prototype.getVerticalSnapline=function(t,e){var n,o=!1,r=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=Hb(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=Hb(s))}}for(var l=0;l<e.length;l++){var u=e[l];if(u.id!==t.id){var c=Hb(u);if(c.minX===(null==n?void 0:n.minX)||c.maxX===(null==n?void 0:n.minX)){o=!0,r=n.minX;break}if(c.minX===(null==n?void 0:n.maxX)||c.maxX===(null==n?void 0:n.maxX)){o=!0,r=n.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:o,position:Hx(Hx({},this.position),{x:r})}},t.prototype.getSnapLinePosition=function(t,e){var n=this.getCenterSnapLine(t,e),o=n.isShowHorizontal,r=n.isShowVertical;if(!o){var i=this.getHorizontalSnapline(t,e);i.isShowHorizontal&&(n.isShowHorizontal=i.isShowHorizontal,n.position.y=i.position.y)}if(!r){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,o=t.position;this.position=o,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)},Fx([mt],t.prototype,"isShowHorizontal",void 0),Fx([mt],t.prototype,"isShowVertical",void 0),Fx([mt],t.prototype,"position",void 0),Fx([xe],t.prototype,"clearSnapline",null),Fx([xe],t.prototype,"setNodeSnapLine",null),t}(),Wx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Ux=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Xx={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]},Gx=function(){function t(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,o=void 0!==n&&n;this.updateTranslateLimits(o)}return t.prototype.setZoomMiniSize=function(t){this.MINI_SCALE_SIZE=t},t.prototype.setZoomMaxSize=function(t){this.MAX_SCALE_SIZE=t},t.prototype.HtmlPointToCanvasPoint=function(t){var e=Ux(t,2),n=e[0],o=e[1];return[(n-this.TRANSLATE_X)/this.SCALE_X,(o-this.TRANSLATE_Y)/this.SCALE_Y]},t.prototype.CanvasPointToHtmlPoint=function(t){var e=Ux(t,2),n=e[0],o=e[1];return[n*this.SCALE_X+this.TRANSLATE_X,o*this.SCALE_Y+this.TRANSLATE_Y]},t.prototype.moveCanvasPointByHtml=function(t,e,n){var o=Ux(t,2),r=o[0],i=o[1];return[r+e/this.SCALE_X,i+n/this.SCALE_Y]},t.prototype.fixDeltaXY=function(t,e){return[t/this.SCALE_X,e/this.SCALE_Y]},t.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,")")}},t.prototype.zoom=function(t,e){void 0===t&&(t=!1);var n=this.SCALE_X,o=this.SCALE_Y;return"number"==typeof t?(n=t,o=t):t?(n+=this.ZOOM_SIZE,o+=this.ZOOM_SIZE):(n-=this.ZOOM_SIZE,o-=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-=(o-this.SCALE_Y)*e[1]),this.SCALE_X=n,this.SCALE_Y=o,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")},t.prototype.emitGraphTransform=function(t){this.eventCenter.emit(Om.GRAPH_TRANSFORM,{type:t,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}})},t.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},t.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")},t.prototype.focusOn=function(t,e,n,o){var r=Ux(this.CanvasPointToHtmlPoint([t,e]),2),i=r[0],a=r[1],s=Ux([n/2-i,o/2-a],2),l=s[0],u=s[1];this.TRANSLATE_X+=l,this.TRANSLATE_Y+=u,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(t){var e;e=Ux(Array.isArray(t)&&4===t.length?t:Xx[t.toString()],4),this.translateLimitMinX=e[0],this.translateLimitMinY=e[1],this.translateLimitMaxX=e[2],this.translateLimitMaxY=e[3]},Wx([mt],t.prototype,"SCALE_X",void 0),Wx([mt],t.prototype,"SKEW_Y",void 0),Wx([mt],t.prototype,"SKEW_X",void 0),Wx([mt],t.prototype,"SCALE_Y",void 0),Wx([mt],t.prototype,"TRANSLATE_X",void 0),Wx([mt],t.prototype,"TRANSLATE_Y",void 0),Wx([mt],t.prototype,"ZOOM_SIZE",void 0),Wx([xe],t.prototype,"zoom",null),Wx([xe],t.prototype,"resetZoom",null),Wx([xe],t.prototype,"translate",null),Wx([xe],t.prototype,"focusOn",null),t}(),Yx=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Vx=function(){return Vx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Vx.apply(this,arguments)},Kx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},qx=function(t){function e(e){var n=t.call(this)||this;n.stepScrollX=0,n.stepScrollY=0,n.onDragging=function(t){var e=t.deltaX,o=t.deltaY;n.setState({isDragging:!0});var r=n.props.graphModel,i=r.transformModel;!0!==r.editConfigModel.stopMoveGraph&&i.translate(e,o)},n.onDragEnd=function(){n.setState({isDragging:!1})},n.zoomHandler=function(t){var e=n.props,o=e.graphModel,r=o.editConfigModel,i=o.transformModel,a=o.gridSize,s=e.graphModel,l=t.deltaX,u=t.deltaY;if(r.stopScrollGraph||t.ctrlKey||t.metaKey){if(!r.stopZoomGraph){t.preventDefault();var c=s.getPointByClient({x:t.clientX,y:t.clientY}).canvasOverlayPosition,d=c.x,p=c.y;i.zoom(t.deltaY<0,[d,p])}}else{if(t.preventDefault(),n.stepScrollX+=l,n.stepScrollY+=u,Math.abs(n.stepScrollX)>=a){var h=n.stepScrollX%a,f=n.stepScrollX-h;i.translate(-f*i.SCALE_X,0),n.stepScrollX=h}if(Math.abs(n.stepScrollY)>=a){var g=n.stepScrollY%a,v=n.stepScrollY-g;i.translate(0,-v*i.SCALE_Y),n.stepScrollY=g}}},n.clickHandler=function(t){if("canvas-overlay"===t.target.getAttribute("name")){var e=n.props.graphModel;e.selectElements.size>0&&e.clearSelectElements(),e.eventCenter.emit(Om.BLANK_CLICK,{e:t})}},n.handleContextMenu=function(t){if("canvas-overlay"===t.target.getAttribute("name")){t.preventDefault();var e=n.props.graphModel,o=e.getPointByClient({x:t.clientX,y:t.clientY});e.eventCenter.emit(Om.BLANK_CONTEXTMENU,{e:t,position:o})}},n.mouseDownHandler=function(t){var e=n.props.graphModel,o=e.eventCenter,r=e.editConfigModel,i=e.transformModel.SCALE_X,a=e.gridSize,s=t.target,l=!r.adjustEdge&&!r.adjustNodePosition;("canvas-overlay"===s.getAttribute("name")||l)&&(!0!==r.stopMoveGraph?(n.stepDrag.setStep(a*i),n.stepDrag.handleMouseDown(t)):o.emit(Om.BLANK_MOUSEDOWN,{e:t}),n.clickHandler(t))};var o=e.graphModel,r=o.gridSize,i=o.eventCenter;return n.stepDrag=new Pm({onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:r,eventType:"BLANK",isStopPropagation:!1,eventCenter:i,model:void 0}),n.state={isDragging:!1},n}return Yx(e,t),e.prototype.render=function(){var t=this.props.graphModel.transformModel.getTransformStyle().transform,e=this.props,n=e.children,o=e.dnd,r=this.state.isDragging;return xr("svg",Vx({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:r?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},o.eventMap(),{children:xr("g",{transform:t,children:n})}))},e=Kx([fC],e)}(ho),Zx=function(){return Zx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Zx.apply(this,arguments)},$x=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function Jx(t){var e=t.x,n=void 0===e?0:e,o=t.y,r=void 0===o?0:o,i=t.value,a=t.fontSize,s=void 0===a?12:a,l=t.fill,u=void 0===l?"currentColor":l,c=t.overflowMode,d=void 0===c?"default":c,p=t.textWidth,h=void 0===p?void 0:p,f=t.model,g={x:n,y:r,fill:u,fontSize:s,textAnchor:"middle",dominantBaseline:"central"};if(oh(ch(t),(function(t){var e=$x(t,2),n=e[0],o=e[1];"object"!=typeof o&&(g[n]=o)})),i){var v=String(i).split(/[\r\n]/g),y=v.length;if("default"!==d){var m=f.BaseType,b=f.modelType;if(m===Sm.NODE&&b!==Cm.TEXT_NODE||m===Sm.EDGE&&h)return function(t){var e=t.x,n=t.y,o=t.value,r=t.model,i=t.textWidth,a=t.fontSize,s=void 0===a?12:a,l=t.lineHeight,u=t.fontFamily,c=void 0===u?"":u,d=t.wrapPadding,p=void 0===d?"0, 0":d,h=t.overflowMode,f=r.width,g=r.height,v=r.textHeight,y=i||f,m=String(o).split(/[\r\n]/g),b=m.length,_=Yb({rows:m,style:{fontSize:"".concat(s,"px"),width:"".concat(y,"px"),fontFamily:c,lineHeight:l,padding:p},rowsLength:b,className:"lf-get-text-height"}),x=g>_?g:_;v&&(x=v);var E="ellipsis"===h;E&&(x=s+2);return xr("g",{children:xr("foreignObject",{width:y,height:x,x:e-y/2,y:n-x/2,style:{overflow:"visible",textAlign:"left"},children:xr("div",{className:"lf-node-text-auto-wrap",style:{minHeight:x,width:y,padding:p},children:xr("div",{className:E?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:E?m.join(""):"",style:Zx({},t),children:m.map((function(t){return xr("div",{className:"lf-node-text--auto-wrap-inner",children:t})}))})})})})}(t)}if(y>1){var _=v.map((function(t,e){return xr("tspan",{className:"lf-text-tspan",x:n,y:r+(e-(y-1)/2)*(s+2),children:t})}));return xr("text",Zx({},g,{children:_}))}return xr("text",Zx({},g,{children:i}))}return null}var Qx=function(){return Qx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Qx.apply(this,arguments)},tE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function eE(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return oh(ch(t),(function(t){var n=tE(t,2),o=n[0],r=n[1];("style"===o||"object"!=typeof r)&&(e[o]=r)})),xr("line",Qx({},e))}var nE=function(){return nE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},nE.apply(this,arguments)},oE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function rE(t){var e=t.x,n=t.y,o=t.width,r=t.height,i=t.className,a=t.strokeWidth,s=t.radius,l=void 0===s?0:s,u=e-o/2,c=n-r/2,d={};return d["stroke-width"]=a,oh(ch(t),(function(t){var e=oE(t,2),n=e[0],o=e[1];"object"!=typeof o&&(d[n]=o)})),d.className=i?"lf-basic-shape ".concat(i):"lf-basic-shape",l&&(d.rx=l,d.ry=l),d.x=u,d.y=c,xr("rect",nE({},d))}var iE=function(){return iE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},iE.apply(this,arguments)},aE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function sE(t){var e={d:""};return oh(ch(t),(function(t){var n=aE(t,2),o=n[0],r=n[1];"style"!==o&&"object"==typeof r||(e[o]=r)})),xr("path",iE({},e))}var lE=function(){return lE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},lE.apply(this,arguments)},uE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function cE(t){var e=t.x,n=void 0===e?0:e,o=t.y,r=void 0===o?0:o,i=t.r,a=void 0===i?4:i,s=t.className,l={cx:n,cy:r,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return oh(ch(t),(function(t){var e=uE(t,2),n=e[0],o=e[1];"object"!=typeof o&&(l[n]=o)})),l.className=s?"lf-basic-shape ".concat(s):"lf-basic-shape",xr("circle",lE({},l))}var dE=function(){return dE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},dE.apply(this,arguments)},pE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function hE(t){var e=t.x,n=void 0===e?0:e,o=t.y,r=void 0===o?0:o,i=t.rx,a=void 0===i?4:i,s=t.ry,l=void 0===s?4:s,u=t.className,c={cx:n,cy:r,rx:a,ry:l,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return oh(ch(t),(function(t){var e=pE(t,2),n=e[0],o=e[1];"object"!=typeof o&&(c[n]=o)})),c.className=u?"lf-basic-shape ".concat(u):"lf-basic-shape",xr("ellipse",dE({},c))}var fE=function(){return fE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},fE.apply(this,arguments)},gE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function vE(t){var e=t.points,n=void 0===e?[]:e,o=t.className,r={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};return oh(ch(t),(function(t){var e=gE(t,2),n=e[0],o=e[1];"object"!=typeof o&&(r[n]=o)})),o?r.classNmae="lf-basic-shape ".concat(o):r.className="lf-basic-shape",r.points=n.map((function(t){return t.join(",")})).join(" "),xr("polygon",fE({},r))}var yE=function(){return yE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},yE.apply(this,arguments)},mE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function bE(t){var e=t.className,n={points:"",fill:"none"};return oh(ch(t),(function(t){var e=mE(t,2),o=e[0],r=e[1];("style"===o||"object"!=typeof r)&&(n[o]=r)})),e&&(n.className="".concat(e)),xr("polyline",yE({},n))}var _E=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),xE=function(){return xE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},xE.apply(this,arguments)},EE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},wE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},SE=function(t){function e(){var e=t.call(this)||this;return e.onDragging=function(t){var n=t.event,o=e.props,r=o.graphModel,i=o.bezierModel,a=o.type,s=r.getPointByClient({x:n.clientX,y:n.clientY}).canvasOverlayPosition,l=s.x,u=s.y;i.updateAdjustAnchor({x:l,y:u},a),r.eventCenter.emit(Om.EDGE_ADJUST,{data:i.getData()})},e.onDragEnd=function(){e.props.bezierModel.isDragging=!1},e.dragHandler=new Pm({onDragging:e.onDragging,onDragEnd:e.onDragEnd}),e}return _E(e,t),e.prototype.render=function(){var t=this,e=this.props.position,n=e.x,o=e.y,r=this.props.bezierModel.getEdgeStyle().adjustAnchor;return xr(cE,xE({className:"lf-bezier-adjust-anchor",x:n,y:o},r,{onMouseDown:function(e){t.dragHandler.handleMouseDown(e)}}))},e}(ho),CE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _E(e,t),e.prototype.getBezierAdjust=function(t,e){var n=t.path,o=t.id,r=ub(n),i=wE(r,4),a=i[0],s=i[1],l=i[2],u=i[3],c=t.getEdgeStyle().adjustLine,d=[];return d.push(xr(eE,xE({x1:a.x,y1:a.y,x2:s.x,y2:s.y},c))),d.push(xr(SE,{position:s,bezierModel:t,graphModel:e,type:"sNext"},"".concat(o,"_ePre"))),d.push(xr(eE,xE({x1:u.x,y1:u.y,x2:l.x,y2:l.y},c))),d.push(xr(SE,{position:l,bezierModel:t,graphModel:e,type:"ePre"},"".concat(o,"_sNext"))),d},e.prototype.selectedBezierEdge=function(){for(var t=this.props.graphModel,e=t.edges,n=[],o=0;o<e.length;o++){var r=e[o];r.isSelected&&r.modelType===Cm.BEZIER_EDGE&&r.draggable&&n.push(this.getBezierAdjust(r,t))}return n},e.prototype.render=function(){return xr("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},e=EE([fC],e)}(ho),OE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ME=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return OE(e,t),e.prototype.render=function(){return xr("div",{className:"lf-background",children:xr("div",{style:this.props.background,className:"lf-background-area"})})},e}(ho),TE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),NE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},AE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},PE=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},DE=function(t){function e(){var e=t.apply(this,PE([],AE(arguments),!1))||this;return e.id=f_(),e}return TE(e,t),e.prototype.renderDot=function(){var t=this.props,e=t.config,n=t.size,o=void 0===n?1:n,r=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,l=void 0===s?2:s,u=Math.min(Math.max(2,l),o/4);return xr("g",{fill:a,opacity:r?1:0,children:[xr("circle",{cx:0,cy:0,r:u/2}),xr("circle",{cx:0,cy:o,r:u/2}),xr("circle",{cx:o,cy:0,r:u/2}),xr("circle",{cx:o,cy:o,r:u/2})]})},e.prototype.renderMesh=function(){var t=this.props,e=t.config,n=t.size,o=void 0===n?1:n,r=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,l=void 0===s?1:s,u=Math.min(Math.max(1,l),o/2);return xr("path",{d:"M 0 0 H ".concat(o," V ").concat(o," H 0 Z"),stroke:a,strokeWidth:u,opacity:r?1:0,fill:"transparent"})},e.prototype.render=function(){var t=this.props,e=t.type,n=t.size,o=void 0===n?1:n,r=t.graphModel.transformModel,i=[r.SCALE_X,r.SKEW_Y,r.SKEW_X,r.SCALE_Y,r.TRANSLATE_X,r.TRANSLATE_Y].join(","),a="matrix(".concat(i,")");return xr("div",{className:"lf-grid",children:xr("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[xr("defs",{children:xr("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:a,x:"0",y:"0",width:o,height:o,children:["dot"===e&&this.renderDot(),"mesh"===e&&this.renderMesh()]})}),xr("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=NE([fC],e)}(ho);!function(t){t.defaultProps={size:10,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}},t.getGridOptions=function(e){var n=_d(t.defaultProps);return Ys(n,"number"==typeof e?{size:e}:"boolean"==typeof e?{visible:e}:e)}}(DE||(DE={}));var kE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),RE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},LE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return kE(e,t),e.prototype.render=function(){return xr("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:xr("g",{transform:this.props.graphModel.transformModel.getTransformStyle().transform,children:this.props.children})})},e=RE([fC],e)}(ho),IE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),jE=function(){return jE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},jE.apply(this,arguments)},BE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},HE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return IE(e,t),e.prototype.getNodesOutline=function(){var t=this.props.graphModel,e=t.nodes,n=t.editConfigModel,o=n.hoverOutline,r=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,l=t.width,u=t.height;if(r&&n||o&&e){var c=t.getOutlineStyle(),d={};if(Object.keys(c).forEach((function(t){"hover"!==t&&(d[t]=c[t])})),e){var p=c.hover;d=jE(jE({},d),p)}i.push(xr(rE,jE({transform:t.transform,className:"lf-outline-node",x:a,y:s,width:l+10,height:u+10},d)))}}})),i},e.prototype.getEdgeOutline=function(){for(var t=this.props.graphModel,e=t.edges,n=t.editConfigModel,o=n.edgeSelectedOutline,r=n.hoverOutline,i=[],a=0;a<e.length;a++){var s=e[a];(o&&s.isSelected||r&&s.isHovered)&&(s.modelType===Cm.LINE_EDGE?i.push(this.getLineOutline(s)):s.modelType===Cm.POLYLINE_EDGE?i.push(this.getPolylineOutline(s)):s.modelType===Cm.BEZIER_EDGE&&i.push(this.getBezierOutline(s)))}return i},e.prototype.getLineOutline=function(t){var e=t.startPoint,n=t.endPoint,o=(e.x+n.x)/2,r=(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 xr(rE,jE({className:"lf-outline-edge",x:o,y:r,width:i,height:a},s))},e.prototype.getPolylineOutline=function(t){var e=t.points,n=rb(e),o=Wm(n,8),r=o.x,i=o.y,a=o.width,s=o.height,l=t.getOutlineStyle();return xr(rE,jE({className:"lf-outline",x:r,y:i,width:a,height:s},l))},e.prototype.getBezierOutline=function(t){var e=t.path,n=ub(e),o=Wm(n,8),r=o.x,i=o.y,a=o.width,s=o.height,l=t.getOutlineStyle();return xr(rE,jE({className:"lf-outline",x:r,y:i,width:a,height:s},l))},e.prototype.render=function(){return xr("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},e=BE([fC],e)}(ho),FE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),zE=function(){return zE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},zE.apply(this,arguments)},WE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},UE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return FE(e,t),e.prototype.render=function(){var t=this.props.snaplineModel,e=null!=t?t:{},n=e.position,o=e.isShowHorizontal,r=e.isShowVertical,i=null==t?void 0:t.getStyle(),a=null!=n?n:{},s=a.x,l=void 0===s?0:s,u=a.y,c=void 0===u?0:u,d=zE(zE({x1:-1e5,y1:c,x2:1e5,y2:c},i),{stroke:o?null==i?void 0:i.stroke:"none"}),p=zE(zE({x1:l,y1:-1e5,x2:l,y2:1e5},i),{stroke:r?null==i?void 0:i.stroke:"none"});return xr("g",{className:"lf-snapline",children:[xr(eE,zE({},d)),xr(eE,zE({},p))]})},e=WE([fC],e)}(ho),XE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),GE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},YE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return XE(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,o=n.textEditElement,r=e.getTools().map((function(t){return uo(t,{textEditElement:o,graphModel:n,lf:e.instance})}));return e.components=r,r},e.prototype.triggerToolRender=function(){var t=this.props,e=t.tool,n=t.graphModel,o=document.querySelector("#ToolOverlay_".concat(n.flowId)),r=e.getInstance();r.components.forEach((function(t){return t(r,o)})),r.components=[]},e.prototype.render=function(){var t=this.props.graphModel;return xr("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(t.flowId),children:this.getTools()})},e=GE([fC],e)}(ho),VE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),KE=function(){return KE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},KE.apply(this,arguments)},qE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},ZE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},$E=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},JE=function(t){function e(){var e=t.apply(this,$E([],ZE(arguments),!1))||this;return e.handleResize=function(){e.props.graphModel.resize()},e}return VE(e,t),e.prototype.componentDidMount=function(){window.addEventListener("resize",py(this.handleResize,200))},e.prototype.componentDidUpdate=function(){this.props.graphModel.eventCenter.emit(Om.GRAPH_UPDATED,{})},e.prototype.componentWillUnmount=function(){window.removeEventListener("resize",py(this.handleResize,200))},e.prototype.getComponent=function(t,e,n){void 0===n&&(n="canvas-overlay");var o=(0,this.props.getView)(t.type);return o?xr(o,{model:t,graphModel:e,overlay:n},t.id):null},e.prototype.render=function(){var t=this,e=this.props,n=e.graphModel,o=e.tool,r=e.options,i=e.dnd,a=e.snaplineModel;r.width&&"".concat(n.width,"px"),r.height&&"".concat(n.height,"px");var s=r.grid&&DE.getGridOptions(r.grid),l=n.fakeNode,u=n.editConfigModel.adjustEdge;return xr("div",{className:"lf-graph","flow-id":n.flowId,children:[xr(qx,{graphModel:n,dnd:i,children:[xr("g",{className:"lf-base",children:Rh(n.sortElements,(function(e){return t.getComponent(e,n)}))}),l?this.getComponent(l,n):""]}),xr(LE,{graphModel:n,children:[xr(HE,{graphModel:n}),u?xr(CE,{graphModel:n}):"",!1!==r.snapline?xr(UE,{snaplineModel:a}):""]}),xr(YE,{graphModel:n,tool:o}),r.background&&xr(ME,{background:r.background}),s&&xr(DE,KE({},s,{graphModel:n}))]})},e=qE([fC],e)}(ho),QE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),tw=function(){return tw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},tw.apply(this,arguments)},ew=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},nw=function(t){function e(){var e=t.call(this)||this;return e.onDragStart=function(t){var n=t.event,o=e.props,r=o.anchorData,i=o.nodeModel,a=o.graphModel;a.selectNodeById(i.id),i.autoToFront&&a.toFront(i.id),a.eventCenter.emit(Om.ANCHOR_DRAGSTART,{data:r,e:n,nodeModel:i}),e.setState({startX:r.x,startY:r.y,endX:r.x,endY:r.y})},e.onDragging=function(t){var n=t.event,o=e.props,r=o.graphModel,i=o.nodeModel,a=o.anchorData,s=r.transformModel,l=r.eventCenter,u=r.width,c=r.height,d=r.editConfigModel,p=d.autoExpand,h=d.stopMoveGraph;if(n){var f=n.clientX,g=n.clientY,v=r.getPointByClient({x:f,y:g}),y=v.domOverlayPosition,m=y.x,b=y.y,_=v.canvasOverlayPosition,x=_.x,E=_.y;e.t&&y_(e.t);var w=[];m<10?w=[10,0]:m+10>u?w=[-10,0]:b<10?w=[0,10]:b+10>c&&(w=[0,-10]),e.setState({endX:x,endY:E,dragging:!0}),e.moveAnchorEnd(x,E),w.length>0&&!h&&p&&(e.t=v_((function(){var t=ew(w,2),n=t[0],o=t[1];s.translate(n,o);var r=e.state,i=r.endX,a=r.endY;e.setState({endX:i-n,endY:a-o}),e.moveAnchorEnd(i-n,a-o)}))),l.emit(Om.ANCHOR_DRAG,{data:a,e:n,nodeModel:i})}},e.onDragEnd=function(t){var n=t.event;e.t&&y_(e.t);var o=e.checkEnd(n);e.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),e.sourceRuleResults.clear(),e.targetRuleResults.clear();var r=e.props,i=r.graphModel,a=r.nodeModel,s=r.anchorData;o&&i.eventCenter.emit(Om.ANCHOR_DRAGEND,{data:s,e:n,nodeModel:a,edgeModel:o})},e.checkEnd=function(t){var n,o=e.props,r=o.graphModel,i=o.nodeModel,a=o.anchorData,s=a.x,l=a.y,u=a.id,c=e.state,d=c.endX,p=c.endY,h=c.dragging,f=Rb({x:d,y:p},r);if(e.preTargetNode&&e.preTargetNode.state!==wm.DEFAULT&&e.preTargetNode.setElementState(wm.DEFAULT),h&&f&&f.node){var g=f.node,v=f.anchor.id,y="".concat(i.id,"_").concat(g.id,"_").concat(v,"_").concat(u),m=e.sourceRuleResults.get(y)||{},b=m.isAllPass,_=m.msg,x=e.targetRuleResults.get(y)||{},E=x.isAllPass,w=x.msg;if(b&&E){g.setElementState(wm.DEFAULT);var S=r.getNodeModelById(f.node.id),C=null===(n=r.edgeGenerator)||void 0===n?void 0:n.call(r,i.getData(),null==S?void 0:S.getData()),O=r.addEdge(tw(tw({},C),{sourceNodeId:i.id,sourceAnchorId:u,startPoint:{x:s,y:l},targetNodeId:f.node.id,targetAnchorId:f.anchor.id,endPoint:{x:f.anchor.x,y:f.anchor.y}})),M=e.props.anchorData;return r.eventCenter.emit(Om.ANCHOR_DROP,{data:M,e:t,nodeModel:i,edgeModel:O}),O}var T=g.getData();return r.eventCenter.emit(Om.CONNECTION_NOT_ALLOWED,{data:T,msg:w||_||"不允许添加连线"}),null}},e.sourceRuleResults=new Map,e.targetRuleResults=new Map,e.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},e.dragHandler=new Pm({onDragStart:e.onDragStart,onDragging:e.onDragging,onDragEnd:e.onDragEnd}),e}return QE(e,t),e.prototype.getAnchorShape=function(){var t=this.props,e=t.anchorData,n=t.style,o=t.node.getAnchorShape(e);if(o)return o;var r=e.x,i=e.y,a=tw(tw({},n),null==n?void 0:n.hover);return xr("g",{children:[xr(cE,tw({className:"lf-node-anchor-hover"},a,{x:r,y:i})),xr(cE,tw({className:"lf-node-anchor"},n,{x:r,y:i}))]})},Object.defineProperty(e.prototype,"customTrajectory",{get:function(){return this.props.graphModel.customTrajectory},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relateEdges",{get:function(){var t=this.props,e=t.graphModel,n=e.getAnchorIncomingEdge,o=e.getAnchorOutcomingEdge,r=t.anchorData.id;return{incomingEdgeList:n(r),outcomingEdgeList:o(r)}},enumerable:!1,configurable:!0}),e.prototype.moveAnchorEnd=function(t,e){var n,o,r=this.props,i=r.graphModel,a=r.nodeModel,s=r.anchorData,l=Rb({x:t,y:e},i);if(l){var u=l.node,c=l.anchor.id;if(this.preTargetNode&&this.preTargetNode!==l.node&&this.preTargetNode.setElementState(wm.DEFAULT),s.id===c)return;this.preTargetNode=u;var d="".concat(a.id,"_").concat(u.id,"_").concat(c,"_").concat(s.id);if(!this.targetRuleResults.has(d)){var p=l.anchor,h=a.isAllowConnectedAsSource(u,s,p),f=u.isAllowConnectedAsTarget(a,s,p);this.sourceRuleResults.set(d,Kb(h)),this.targetRuleResults.set(d,Kb(f))}var g=(null!==(n=this.sourceRuleResults.get(d))&&void 0!==n?n:{}).isAllPass,v=(null!==(o=this.targetRuleResults.get(d))&&void 0!==o?o:{}).isAllPass;g&&v?u.setElementState(wm.ALLOW_CONNECT):u.setElementState(wm.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==wm.DEFAULT&&this.preTargetNode.setElementState(wm.DEFAULT)},e.prototype.isShowLine=function(){var t=this.state,e=t.startX,n=t.startY,o=t.endX,r=t.endY;return Ib(e,n,o,r)>10},e.prototype.render=function(){var t=this,e=this.state,n=e.startX,o=e.startY,r=e.endX,i=e.endY,a=this.props,s=a.anchorData.edgeAddable,l=a.edgeStyle;return xr("g",{className:"lf-anchor",children:[xr("g",{onMouseDown:function(e){!1!==s&&t.dragHandler.handleMouseDown(e)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(tw({sourcePoint:{x:n,y:o},targetPoint:{x:r,y:i}},l)):xr(eE,tw({x1:n,y1:o,x2:r,y2:i},l,{"pointer-events":"none"})))]})},e}(ho),ow=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),rw=function(){return rw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},rw.apply(this,arguments)},iw=function(t){function e(e){var n=t.call(this,e)||this;return n.style={},n.onDragging=function(t){var e,o=t.event,r=n.props,i=r.graphModel,a=r.nodeModel,s=r.eventCenter,l=i.selectNodes,u=a.x,c=a.y,d=o.clientX,p=o.clientY,h=i.getPointByClient({x:d,y:p}).canvasOverlayPosition,f=h.x,g=h.y,v=new wb(f-u,g-c),y=(null===(e=n.normal)||void 0===e?void 0:e.angle(v))-n.defaultAngle,m=new Pb(-u,-c).rotate(y).translate(u,c).toString();a.transform=m,a.rotate=y;var b=Rh(l,(function(t){return t.id}));-1===b.indexOf(a.id)&&(b=[a.id]);var _=Ov(b,(function(t,e){var n=i.getNodeModelById(e);return t[e]=null==n?void 0:n.getMoveDistance(0,0,!1),t}),{});b.forEach((function(t){i.getNodeEdges(t).forEach((function(t){if(_[t.sourceNodeId]){var e=i.getNodeModelById(t.sourceNodeId).anchors.find((function(e){return e.id===t.sourceAnchorId}));t.updateStartPoint(e)}if(_[t.targetNodeId]){e=i.getNodeModelById(t.targetNodeId).anchors.find((function(e){return e.id===t.targetAnchorId}));t.updateEndPoint(e)}}))})),s.emit(Om.NODE_ROTATE,{e:o,model:a,data:a.getData()})},n.style=e.style,n.stepperDrag=new Pm({onDragging:n.onDragging}),n}return ow(e,t),e.prototype.render=function(){var t=this,e=this.props.nodeModel,n=e.x,o=e.y,r=n+e.width/2+20,i=o-e.height/2-20;return this.normal=new wb(1,0),this.defaultAngle=this.normal.angle(new wb(r-n,i-o)),e.defaultAngle=this.defaultAngle,xr("g",{className:"lf-rotate-control",children:xr("g",{onMouseDown:function(e){t.stepperDrag.handleMouseDown(e)},children:xr(cE,rw({},this.style,{cx:r,cy:i}))})})},e}(ho),aw={},sw={get exports(){return aw},set exports(t){aw=t}};
|
|
25
|
+
var cm,dm=4294967295,pm=Array.prototype,hm=Object.prototype.hasOwnProperty,fm=Cr?Cr.iterator:void 0,gm=Math.max,vm=Math.min,ym=function(t){return function(e,n,o){if(null==o){var r=Jr(n),i=r&&Xs(n),a=i&&i.length&&Wh(n,i);(a?a.length:r)||(o=n,n=e,e=this)}return t(e,n,o)}}(ug);Ji.after=$y.after,Ji.ary=$y.ary,Ji.assign=om.assign,Ji.assignIn=om.assignIn,Ji.assignInWith=om.assignInWith,Ji.assignWith=om.assignWith,Ji.at=om.at,Ji.before=$y.before,Ji.bind=$y.bind,Ji.bindAll=am.bindAll,Ji.bindKey=$y.bindKey,Ji.castArray=Jy.castArray,Ji.chain=rm.chain,Ji.chunk=Ky.chunk,Ji.compact=Ky.compact,Ji.concat=Ky.concat,Ji.cond=am.cond,Ji.conforms=am.conforms,Ji.constant=am.constant,Ji.countBy=qy.countBy,Ji.create=om.create,Ji.curry=$y.curry,Ji.curryRight=$y.curryRight,Ji.debounce=$y.debounce,Ji.defaults=om.defaults,Ji.defaultsDeep=om.defaultsDeep,Ji.defer=$y.defer,Ji.delay=$y.delay,Ji.difference=Ky.difference,Ji.differenceBy=Ky.differenceBy,Ji.differenceWith=Ky.differenceWith,Ji.drop=Ky.drop,Ji.dropRight=Ky.dropRight,Ji.dropRightWhile=Ky.dropRightWhile,Ji.dropWhile=Ky.dropWhile,Ji.fill=Ky.fill,Ji.filter=qy.filter,Ji.flatMap=qy.flatMap,Ji.flatMapDeep=qy.flatMapDeep,Ji.flatMapDepth=qy.flatMapDepth,Ji.flatten=Ky.flatten,Ji.flattenDeep=Ky.flattenDeep,Ji.flattenDepth=Ky.flattenDepth,Ji.flip=$y.flip,Ji.flow=am.flow,Ji.flowRight=am.flowRight,Ji.fromPairs=Ky.fromPairs,Ji.functions=om.functions,Ji.functionsIn=om.functionsIn,Ji.groupBy=qy.groupBy,Ji.initial=Ky.initial,Ji.intersection=Ky.intersection,Ji.intersectionBy=Ky.intersectionBy,Ji.intersectionWith=Ky.intersectionWith,Ji.invert=om.invert,Ji.invertBy=om.invertBy,Ji.invokeMap=qy.invokeMap,Ji.iteratee=am.iteratee,Ji.keyBy=qy.keyBy,Ji.keys=Xs,Ji.keysIn=om.keysIn,Ji.map=qy.map,Ji.mapKeys=om.mapKeys,Ji.mapValues=om.mapValues,Ji.matches=am.matches,Ji.matchesProperty=am.matchesProperty,Ji.memoize=$y.memoize,Ji.merge=om.merge,Ji.mergeWith=om.mergeWith,Ji.method=am.method,Ji.methodOf=am.methodOf,Ji.mixin=ym,Ji.negate=pg,Ji.nthArg=am.nthArg,Ji.omit=om.omit,Ji.omitBy=om.omitBy,Ji.once=$y.once,Ji.orderBy=qy.orderBy,Ji.over=am.over,Ji.overArgs=$y.overArgs,Ji.overEvery=am.overEvery,Ji.overSome=am.overSome,Ji.partial=$y.partial,Ji.partialRight=$y.partialRight,Ji.partition=qy.partition,Ji.pick=om.pick,Ji.pickBy=om.pickBy,Ji.property=am.property,Ji.propertyOf=am.propertyOf,Ji.pull=Ky.pull,Ji.pullAll=Ky.pullAll,Ji.pullAllBy=Ky.pullAllBy,Ji.pullAllWith=Ky.pullAllWith,Ji.pullAt=Ky.pullAt,Ji.range=am.range,Ji.rangeRight=am.rangeRight,Ji.rearg=$y.rearg,Ji.reject=qy.reject,Ji.remove=Ky.remove,Ji.rest=$y.rest,Ji.reverse=Ky.reverse,Ji.sampleSize=qy.sampleSize,Ji.set=om.set,Ji.setWith=om.setWith,Ji.shuffle=qy.shuffle,Ji.slice=Ky.slice,Ji.sortBy=qy.sortBy,Ji.sortedUniq=Ky.sortedUniq,Ji.sortedUniqBy=Ky.sortedUniqBy,Ji.split=im.split,Ji.spread=$y.spread,Ji.tail=Ky.tail,Ji.take=Ky.take,Ji.takeRight=Ky.takeRight,Ji.takeRightWhile=Ky.takeRightWhile,Ji.takeWhile=Ky.takeWhile,Ji.tap=rm.tap,Ji.throttle=$y.throttle,Ji.thru=fy,Ji.toArray=Jy.toArray,Ji.toPairs=om.toPairs,Ji.toPairsIn=om.toPairsIn,Ji.toPath=am.toPath,Ji.toPlainObject=Jy.toPlainObject,Ji.transform=om.transform,Ji.unary=$y.unary,Ji.union=Ky.union,Ji.unionBy=Ky.unionBy,Ji.unionWith=Ky.unionWith,Ji.uniq=Ky.uniq,Ji.uniqBy=Ky.uniqBy,Ji.uniqWith=Ky.uniqWith,Ji.unset=om.unset,Ji.unzip=Ky.unzip,Ji.unzipWith=Ky.unzipWith,Ji.update=om.update,Ji.updateWith=om.updateWith,Ji.values=om.values,Ji.valuesIn=om.valuesIn,Ji.without=Ky.without,Ji.words=im.words,Ji.wrap=$y.wrap,Ji.xor=Ky.xor,Ji.xorBy=Ky.xorBy,Ji.xorWith=Ky.xorWith,Ji.zip=Ky.zip,Ji.zipObject=Ky.zipObject,Ji.zipObjectDeep=Ky.zipObjectDeep,Ji.zipWith=Ky.zipWith,Ji.entries=om.toPairs,Ji.entriesIn=om.toPairsIn,Ji.extend=om.assignIn,Ji.extendWith=om.assignInWith,ym(Ji,Ji),Ji.add=Qy.add,Ji.attempt=am.attempt,Ji.camelCase=im.camelCase,Ji.capitalize=im.capitalize,Ji.ceil=Qy.ceil,Ji.clamp=tm,Ji.clone=Jy.clone,Ji.cloneDeep=Jy.cloneDeep,Ji.cloneDeepWith=Jy.cloneDeepWith,Ji.cloneWith=Jy.cloneWith,Ji.conformsTo=Jy.conformsTo,Ji.deburr=im.deburr,Ji.defaultTo=am.defaultTo,Ji.divide=Qy.divide,Ji.endsWith=im.endsWith,Ji.eq=Jy.eq,Ji.escape=im.escape,Ji.escapeRegExp=im.escapeRegExp,Ji.every=qy.every,Ji.find=qy.find,Ji.findIndex=Ky.findIndex,Ji.findKey=om.findKey,Ji.findLast=qy.findLast,Ji.findLastIndex=Ky.findLastIndex,Ji.findLastKey=om.findLastKey,Ji.floor=Qy.floor,Ji.forEach=qy.forEach,Ji.forEachRight=qy.forEachRight,Ji.forIn=om.forIn,Ji.forInRight=om.forInRight,Ji.forOwn=om.forOwn,Ji.forOwnRight=om.forOwnRight,Ji.get=om.get,Ji.gt=Jy.gt,Ji.gte=Jy.gte,Ji.has=om.has,Ji.hasIn=om.hasIn,Ji.head=Ky.head,Ji.identity=ui,Ji.includes=qy.includes,Ji.indexOf=Ky.indexOf,Ji.inRange=em,Ji.invoke=om.invoke,Ji.isArguments=Jy.isArguments,Ji.isArray=Fr,Ji.isArrayBuffer=Jy.isArrayBuffer,Ji.isArrayLike=Jy.isArrayLike,Ji.isArrayLikeObject=Jy.isArrayLikeObject,Ji.isBoolean=Jy.isBoolean,Ji.isBuffer=Jy.isBuffer,Ji.isDate=Jy.isDate,Ji.isElement=Jy.isElement,Ji.isEmpty=Jy.isEmpty,Ji.isEqual=Jy.isEqual,Ji.isEqualWith=Jy.isEqualWith,Ji.isError=Jy.isError,Ji.isFinite=Jy.isFinite,Ji.isFunction=Jy.isFunction,Ji.isInteger=Jy.isInteger,Ji.isLength=Jy.isLength,Ji.isMap=Jy.isMap,Ji.isMatch=Jy.isMatch,Ji.isMatchWith=Jy.isMatchWith,Ji.isNaN=Jy.isNaN,Ji.isNative=Jy.isNative,Ji.isNil=Jy.isNil,Ji.isNull=Jy.isNull,Ji.isNumber=Jy.isNumber,Ji.isObject=Jr,Ji.isObjectLike=Jy.isObjectLike,Ji.isPlainObject=Jy.isPlainObject,Ji.isRegExp=Jy.isRegExp,Ji.isSafeInteger=Jy.isSafeInteger,Ji.isSet=Jy.isSet,Ji.isString=Jy.isString,Ji.isSymbol=Jy.isSymbol,Ji.isTypedArray=Jy.isTypedArray,Ji.isUndefined=Jy.isUndefined,Ji.isWeakMap=Jy.isWeakMap,Ji.isWeakSet=Jy.isWeakSet,Ji.join=Ky.join,Ji.kebabCase=im.kebabCase,Ji.last=$p,Ji.lastIndexOf=Ky.lastIndexOf,Ji.lowerCase=im.lowerCase,Ji.lowerFirst=im.lowerFirst,Ji.lt=Jy.lt,Ji.lte=Jy.lte,Ji.max=Qy.max,Ji.maxBy=Qy.maxBy,Ji.mean=Qy.mean,Ji.meanBy=Qy.meanBy,Ji.min=Qy.min,Ji.minBy=Qy.minBy,Ji.stubArray=am.stubArray,Ji.stubFalse=am.stubFalse,Ji.stubObject=am.stubObject,Ji.stubString=am.stubString,Ji.stubTrue=am.stubTrue,Ji.multiply=Qy.multiply,Ji.nth=Ky.nth,Ji.noop=am.noop,Ji.now=Zy,Ji.pad=im.pad,Ji.padEnd=im.padEnd,Ji.padStart=im.padStart,Ji.parseInt=im.parseInt,Ji.random=nm,Ji.reduce=qy.reduce,Ji.reduceRight=qy.reduceRight,Ji.repeat=im.repeat,Ji.replace=im.replace,Ji.result=om.result,Ji.round=Qy.round,Ji.sample=qy.sample,Ji.size=qy.size,Ji.snakeCase=im.snakeCase,Ji.some=qy.some,Ji.sortedIndex=Ky.sortedIndex,Ji.sortedIndexBy=Ky.sortedIndexBy,Ji.sortedIndexOf=Ky.sortedIndexOf,Ji.sortedLastIndex=Ky.sortedLastIndex,Ji.sortedLastIndexBy=Ky.sortedLastIndexBy,Ji.sortedLastIndexOf=Ky.sortedLastIndexOf,Ji.startCase=im.startCase,Ji.startsWith=im.startsWith,Ji.subtract=Qy.subtract,Ji.sum=Qy.sum,Ji.sumBy=Qy.sumBy,Ji.template=im.template,Ji.times=am.times,Ji.toFinite=Jy.toFinite,Ji.toInteger=li,Ji.toLength=Jy.toLength,Ji.toLower=im.toLower,Ji.toNumber=Jy.toNumber,Ji.toSafeInteger=Jy.toSafeInteger,Ji.toString=Jy.toString,Ji.toUpper=im.toUpper,Ji.trim=im.trim,Ji.trimEnd=im.trimEnd,Ji.trimStart=im.trimStart,Ji.truncate=im.truncate,Ji.unescape=im.unescape,Ji.uniqueId=am.uniqueId,Ji.upperCase=im.upperCase,Ji.upperFirst=im.upperFirst,Ji.each=qy.forEach,Ji.eachRight=qy.forEachRight,Ji.first=Ky.head,ym(Ji,(cm={},bp(Ji,(function(t,e){hm.call(Ji.prototype,e)||(cm[e]=t)})),cm),{chain:!1}),Ji.VERSION="4.17.21",(Ji.templateSettings=im.templateSettings).imports._=Ji,ca(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Ji[t].placeholder=Ji})),ca(["drop","take"],(function(t,e){Wi.prototype[t]=function(n){n=void 0===n?1:gm(li(n),0);var o=this.__filtered__&&!e?new Wi(this):this.clone();return o.__filtered__?o.__takeCount__=vm(n,o.__takeCount__):o.__views__.push({size:vm(n,dm),type:t+(o.__dir__<0?"Right":"")}),o},Wi.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ca(["filter","map","takeWhile"],(function(t,e){var n=e+1,o=1==n||3==n;Wi.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:fp(t),type:n}),e.__filtered__=e.__filtered__||o,e}})),ca(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wi.prototype[t]=function(){return this[n](1).value()[0]}})),ca(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Wi.prototype[t]=function(){return this.__filtered__?new Wi(this):this[n](1)}})),Wi.prototype.compact=function(){return this.filter(ui)},Wi.prototype.find=function(t){return this.filter(t).head()},Wi.prototype.findLast=function(t){return this.reverse().find(t)},Wi.prototype.invokeMap=ds((function(t,e){return"function"==typeof t?new Wi(this):this.map((function(n){return Ef(n,t,e)}))})),Wi.prototype.reject=function(t){return this.filter(pg(fp(t)))},Wi.prototype.slice=function(t,e){t=li(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Wi(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=li(e))<0?n.dropRight(-e):n.take(e-t)),n)},Wi.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wi.prototype.toArray=function(){return this.take(dm)},bp(Wi.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),o=/^(?:head|last)$/.test(e),r=Ji[o?"take"+("last"==e?"Right":""):e],i=o||/^find/.test(e);r&&(Ji.prototype[e]=function(){var e=this.__wrapped__,a=o?[1]:arguments,s=e instanceof Wi,l=a[0],u=s||Fr(e),c=function(t){var e=r.apply(Ji,Sl([t],a));return o&&d?e[0]:e};u&&n&&"function"==typeof l&&1!=l.length&&(s=u=!1);var d=this.__chain__,p=!!this.__actions__.length,h=i&&!d,f=s&&!p;if(!i&&u){e=f?e:new Wi(this);var g=t.apply(e,a);return g.__actions__.push({func:fy,args:[c],thisArg:void 0}),new Ki(g,d)}return h&&f?t.apply(this,a):(g=this.thru(c),h?o?g.value()[0]:g.value():g)})})),ca(["pop","push","shift","sort","splice","unshift"],(function(t){var e=pm[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",o=/^(?:pop|shift)$/.test(t);Ji.prototype[t]=function(){var t=arguments;if(o&&!this.__chain__){var r=this.value();return e.apply(Fr(r)?r:[],t)}return this[n]((function(n){return e.apply(Fr(n)?n:[],t)}))}})),bp(Wi.prototype,(function(t,e){var n=Ji[e];if(n){var o=n.name+"";hm.call(Ui,o)||(Ui[o]=[]),Ui[o].push({name:e,func:n})}})),Ui[ja(void 0,2).name]=[{name:"wrapper",func:void 0}],Wi.prototype.clone=function(){var t=new Wi(this.__wrapped__);return t.__actions__=qi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=qi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=qi(this.__views__),t},Wi.prototype.reverse=function(){if(this.__filtered__){var t=new Wi(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wi.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Fr(t),o=e<0,r=n?t.length:0,i=function(t,e,n){for(var o=-1,r=n.length;++o<r;){var i=n[o],a=i.size;switch(i.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=lm(e,t+a);break;case"takeRight":t=sm(t,e-a)}}return{start:t,end:e}}(0,r,this.__views__),a=i.start,s=i.end,l=s-a,u=o?s:a-1,c=this.__iteratees__,d=c.length,p=0,h=um(l,this.__takeCount__);if(!n||!o&&r==l&&h==l)return yy(t,this.__actions__);var f=[];t:for(;l--&&p<h;){for(var g=-1,v=t[u+=e];++g<d;){var y=c[g],m=y.iteratee,b=y.type,_=m(v);if(2==b)v=_;else if(!_){if(1==b)continue t;break t}}f[p++]=v}return f},Ji.prototype.at=rm.at,Ji.prototype.chain=rm.wrapperChain,Ji.prototype.commit=rm.commit,Ji.prototype.next=rm.next,Ji.prototype.plant=rm.plant,Ji.prototype.reverse=rm.reverse,Ji.prototype.toJSON=Ji.prototype.valueOf=Ji.prototype.value=rm.value,Ji.prototype.first=Ji.prototype.head,fm&&(Ji.prototype[fm]=rm.toIterator);var mm,bm=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n};!function(t){t.get=function(e){var n=bm(e,[]);if(!e.container)throw new Error("Ensure the container of LogicFlow is specified and valid.");return Ys({},t.defaults,n)}}(mm||(mm={})),function(t){t.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}}(mm||(mm={}));var _m={node:!1,edge:!1},xm={node:!0,edge:!0},Em=null!==El(window,"navigator.userAgent","").match(/MSIE|Trident/);function wm(t){try{return JSON.parse(JSON.stringify(t))}catch(e){return t}}var Sm,Cm,Mm,Om,Tm,Nm,Am,Pm=200;!function(t){t[t.DEFAULT=1]="DEFAULT",t[t.TEXT_EDIT=2]="TEXT_EDIT",t[t.SHOW_MENU=3]="SHOW_MENU",t[t.ALLOW_CONNECT=4]="ALLOW_CONNECT",t[t.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"}(Sm||(Sm={})),function(t){t.NODE="node",t.EDGE="edge",t.GRAPH="graph"}(Cm||(Cm={})),function(t){t.NODE="node",t.CIRCLE_NODE="circle-node",t.POLYGON_NODE="polygon-node",t.RECT_NODE="rect-node",t.TEXT_NODE="text-node",t.ELLIPSE_NODE="ellipse-node",t.DIAMOND_NODE="diamond-node",t.HTML_NODE="html-node",t.CUSTOM_HTML_NODE="custom-html-node",t.EDGE="edge",t.LINE_EDGE="line-edge",t.POLYLINE_EDGE="polyline-edge",t.BEZIER_EDGE="bezier-edge",t.GRAPH="graph"}(Mm||(Mm={})),function(t){t.ELEMENT_CLICK="element:click",t.NODE_ADD="node:add",t.NODE_DELETE="node:delete",t.NODE_CLICK="node:click",t.NODE_DBCLICK="node:dbclick",t.NODE_GROUP_COPY="node:group-copy-add",t.NODE_DND_ADD="node:dnd-add",t.NODE_DND_DRAG="node:dnd-drag",t.NODE_MOUSEDOWN="node:mousedown",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DROP="node:drop",t.NODE_MOUSEUP="node:mouseup",t.NODE_MOUSEMOVE="node:mousemove",t.NODE_MOUSEENTER="node:mouseenter",t.NODE_MOUSELEAVE="node:mouseleave",t.NODE_CONTEXTMENU="node:contextmenu",t.NODE_ROTATE="node:rotate",t.NODE_RESIZE="node:resize",t.NODE_PROPERTIES_CHANGE="node:properties-change",t.NODE_PROPERTIES_DELETE="node:properties-delete",t.EDGE_ADD="edge:add",t.EDGE_DELETE="edge:delete",t.EDGE_CLICK="edge:click",t.EDGE_DBCLICK="edge:dbclick",t.EDGE_MOUSEENTER="edge:mouseenter",t.EDGE_MOUSELEAVE="edge:mouseleave",t.EDGE_CONTEXTMENU="edge:contextmenu",t.EDGE_ADJUST="edge:adjust",t.EDGE_EXCHANGE_NODE="edge:exchange-node",t.ANCHOR_DRAGSTART="anchor:dragstart",t.ANCHOR_DRAG="anchor:drag",t.ANCHOR_DROP="anchor:drop",t.ANCHOR_DRAGEND="anchor:dragend",t.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",t.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",t.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",t.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",t.ADJUST_POINT_DRAG="adjustPoint:drag",t.ADJUST_POINT_DROP="adjustPoint:drop",t.ADJUST_POINT_DRAGEND="adjustPoint:dragend",t.BLANK_MOUSEDOWN="blank:mousedown",t.BLANK_DRAGSTART="blank:dragstart",t.BLANK_DRAG="blank:drag",t.BLANK_DROP="blank:drop",t.BLANK_MOUSEMOVE="blank:mousemove",t.BLANK_MOUSEUP="blank:mouseup",t.BLANK_CLICK="blank:click",t.BLANK_CONTEXTMENU="blank:contextmenu",t.SELECTION_MOUSEDOWN="selection:mousedown",t.SELECTION_DRAGSTART="selection:dragstart",t.SELECTION_DRAG="selection:drag",t.SELECTION_DROP="selection:drop",t.SELECTION_MOUSEMOVE="selection:mousemove",t.SELECTION_MOUSEUP="selection:mouseup",t.SELECTION_CONTEXTMENU="selection:contextmenu",t.CONNECTION_NOT_ALLOWED="connection:not-allowed",t.TEXT_MOUSEDOWN="text:mousedown",t.TEXT_DRAGSTART="text:dragstart",t.TEXT_DRAG="text:drag",t.TEXT_DROP="text:drop",t.TEXT_CLICK="text:click",t.TEXT_DBCLICK="text:dbclick",t.TEXT_BLUR="text:blur",t.TEXT_MOUSEMOVE="text:mousemove",t.TEXT_MOUSEUP="text:mouseup",t.TEXT_FOCUS="text:focus",t.TEXT_ADD="text:add",t.TEXT_UPDATE="text:update",t.TEXT_CLEAR="text:clear",t.LABEL_MOUSEDOWN="label:mousedown",t.LABEL_DRAGSTART="label:dragstart",t.LABEL_DRAG="label:drag",t.LABEL_DROP="label:drop",t.LABEL_CLICK="label:click",t.LABEL_DBCLICK="label:dbclick",t.LABEL_BLUR="label:blur",t.LABEL_MOUSEMOVE="label:mousemove",t.LABEL_MOUSEUP="label:mouseup",t.LABEL_FOCUS="label:focus",t.LABEL_ADD="label:add",t.LABEL_UPDATE="label:update",t.LABEL_CLEAR="label:clear",t.LABEL_DELETE="label:delete",t.LABEL_SHOULD_ADD="label:should-add",t.LABEL_BATCH_ADD="label:batch-add",t.LABEL_SHOULD_UPDATE="label:should-update",t.LABEL_SHOULD_DELETE="label:should-delete",t.LABEL_BATCH_DELETE="label:batch-delete",t.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",t.HISTORY_CHANGE="history:change",t.GRAPH_TRANSFORM="graph:transform",t.GRAPH_RENDERED="graph:rendered",t.GRAPH_UPDATED="graph:updated"}(Om||(Om={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE"}(Tm||(Tm={})),function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(Nm||(Nm={})),function(t){t.TEXT="text",t.LABEL="label"}(Am||(Am={}));var Dm=function(){function t(t){var e=t.onDragStart,n=void 0===e?Gi:e,o=t.onDragging,r=void 0===o?Gi:o,i=t.onDragEnd,a=void 0===i?Gi:i,s=t.eventType,l=void 0===s?"":s,u=t.eventCenter,c=t.step,d=void 0===c?1:c,p=t.isStopPropagation,h=void 0===p||p,f=t.model,g=t.data,v=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(t){var e,n,o=null===window||void 0===window?void 0:window.document;if(0===t.button){v.isStopPropagation&&t.stopPropagation(),v.isStartDragging=!0,v.startX=t.clientX,v.startY=t.clientY,o.addEventListener("mousemove",v.handleMouseMove,!1),o.addEventListener("mouseup",v.handleMouseUp,!1);var r=null===(e=v.model)||void 0===e?void 0:e.getData();null===(n=v.eventCenter)||void 0===n||n.emit(Om["".concat(v.eventType,"_MOUSEDOWN")],{e:t,data:v.data||r}),v.startTime=(new Date).getTime()}},this.handleMouseMove=function(t){var e,n;if(v.isStopPropagation&&t.stopPropagation(),v.isStartDragging&&(v.sumDeltaX+=t.clientX-v.startX,v.sumDeltaY+=t.clientY-v.startY,v.startX=t.clientX,v.startY=t.clientY,v.step<=1||Math.abs(v.sumDeltaX)>v.step||Math.abs(v.sumDeltaY)>v.step)){var o=v.sumDeltaX%v.step,r=v.sumDeltaY%v.step,i=v.sumDeltaX-o,a=v.sumDeltaY-r;v.sumDeltaX=o,v.sumDeltaY=r;var s=null===(e=v.model)||void 0===e?void 0:e.getData();v.isDragging||(null===(n=v.eventCenter)||void 0===n||n.emit(Om["".concat(v.eventType,"_DRAGSTART")],{e:t,data:v.data||s}),v.onDragStart({event:t})),v.isDragging=!0,Promise.resolve().then((function(){var e,n;v.onDragging({deltaX:i,deltaY:a,event:t}),null===(e=v.eventCenter)||void 0===e||e.emit(Om["".concat(v.eventType,"_MOUSEMOVE")],{deltaX:i,deltaY:a,e:t,data:v.data||s}),null===(n=v.eventCenter)||void 0===n||n.emit(Om["".concat(v.eventType,"_DRAG")],{e:t,data:v.data||s})}))}},this.handleMouseUp=function(t){var e=window.document;v.isStartDragging=!1,v.isStopPropagation&&t.stopPropagation(),Promise.resolve().then((function(){var n,o,r;e.removeEventListener("mousemove",v.handleMouseMove,!1),e.removeEventListener("mouseup",v.handleMouseUp,!1);var i=null===(n=v.model)||void 0===n?void 0:n.getData();null===(o=v.eventCenter)||void 0===o||o.emit(Om["".concat(v.eventType,"_MOUSEUP")],{e:t,data:v.data||i}),v.isDragging&&(v.isDragging=!1,v.onDragEnd({event:t}),null===(r=v.eventCenter)||void 0===r||r.emit(Om["".concat(v.eventType,"_DROP")],{e:t,data:v.data||i}))}))},this.cancelDrag=function(){var t=null===window||void 0===window?void 0:window.document;t.removeEventListener("mousemove",v.handleMouseMove,!1),t.removeEventListener("mouseup",v.handleMouseUp,!1),v.onDragEnd({event:void 0}),v.isDragging=!1},this.onDragStart=n,this.onDragging=r,this.onDragEnd=a,this.step=d,this.isStopPropagation=h,this.eventType=l,this.eventCenter=u,this.model=f,this.data=g}return t.prototype.setStep=function(t){this.step=t},t.prototype.setModel=function(t){this.model=t},t}(),km=function(t){return t.modelType===Mm.LINE_EDGE?function(t){var e=t.startPoint,n=t.endPoint,o=(e.x+n.x)/2,r=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:o-i/2,y:r-a/2,x1:o+i/2,y1:r+a/2}}(t):t.modelType===Mm.POLYLINE_EDGE?function(t){var e=t.points,n=ib(e),o=Gm(n,8),r=o.x,i=o.y,a=o.width,s=o.height;return{x:r-a/2,y:i-s/2,x1:r+a/2,y1:i+s/2}}(t):t.modelType===Mm.BEZIER_EDGE?function(t){var e=t.path,n=cb(e),o=Gm(n,8),r=o.x,i=o.y,a=o.width,s=o.height;return{x:r-a/2,y:i-s/2,x1:r+a/2,y1:i+s/2}}(t):void 0},Rm=function(t,e,n){var o=t.x,r=t.y,i=e.x,a=e.y,s=n.x,l=n.y,u=(l-a)/(s-i),c=a-u*i;return o>=i&&o<=s&&r>=a&&r<=l&&Math.abs(r-u*o+c)<Number.EPSILON},Im=function(t){var e=t.start,n=t.end,o=t.offset,r=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)),l=Math.atan(o/r),u=Math.sqrt(r*r+o*o);return"start"===i?n.x>=e.x?(a.leftX=e.x+u*Math.sin(s+l),a.leftY=e.y-u*Math.cos(s+l),a.rightX=e.x-u*Math.sin(s-l),a.rightY=e.y+u*Math.cos(s-l)):(a.leftX=e.x-u*Math.sin(s+l),a.leftY=e.y+u*Math.cos(s+l),a.rightX=e.x+u*Math.sin(s-l),a.rightY=e.y-u*Math.cos(s-l)):"end"===i&&(n.x>=e.x?(a.leftX=n.x+u*Math.sin(s-l),a.leftY=n.y-u*Math.cos(s-l),a.rightX=n.x-u*Math.sin(s+l),a.rightY=n.y+u*Math.cos(s+l)):(a.leftX=n.x-u*Math.sin(s-l),a.leftY=n.y+u*Math.cos(s-l),a.rightX=n.x+u*Math.sin(s+l),a.rightY=n.y-u*Math.cos(s+l))),a},Lm=function(){return Lm=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Lm.apply(this,arguments)},jm=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Bm=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Hm=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},zm=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}},Fm=function(t,e,n){var o=function(t,e){var n=Math.abs(t.x-e.centerX),o=Math.abs(t.y-e.centerY);return n/e.width>o/e.height?Nm.HORIZONTAL:Nm.VERTICAL}(n,e);return o===Nm.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}},Wm=function(t,e){var n=Math.min(t.minX,e.minX),o=Math.min(t.minY,e.minY),r=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{x:(n+r)/2,y:(o+i)/2,centerX:(n+r)/2,centerY:(o+i)/2,minX:n,minY:o,maxX:r,maxY:i,height:i-o,width:r-n}},Gm=function(t,e){void 0===t&&(t=[]);var n=[],o=[];t.forEach((function(t){n.push(t.x),o.push(t.y)}));var r=Math.min.apply(Math,Bm([],jm(n),!1)),i=Math.max.apply(Math,Bm([],jm(n),!1)),a=Math.min.apply(Math,Bm([],jm(o),!1)),s=Math.max.apply(Math,Bm([],jm(o),!1)),l=i-r,u=s-a;return e&&(l+=e,u+=e),{centerX:(r+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:r,minY:a,x:(r+i)/2,y:(a+s)/2,height:u,width:l}},Xm=function(t){var e=t.minX,n=t.minY,o=t.maxX,r=t.maxY;return[{x:e,y:n},{x:o,y:n},{x:o,y:r},{x:e,y:r}]},Um=function(t,e){var n=t.x,o=t.y;return n<e.minX||n>e.maxX||o<e.minY||o>e.maxY},Ym=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},Vm=function(t,e,n,o,r){return Ym(t,e)+Ym(t,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}(t,[e,n,o,r])},Km=function(t,e,n,o,r){r||(r=0),t.unshift(e[o]),n[o]&&n[o]!==o&&r<=100&&Km(t,e,n,n[o],r+1)},qm=function(t,e,n,o){var r=e.x-t.x,i=e.y-t.y,a=o.x-n.x,s=o.y-n.y,l=(-i*(t.x-n.x)+r*(t.y-n.y))/(-a*i+r*s),u=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*i+r*s);return l>=0&&l<=1&&u>=0&&u<=1},Zm=function(t,e,n){if(0===n.width&&0===n.height)return!1;var o=jm(Xm(n),4),r=o[0],i=o[1],a=o[2],s=o[3];return qm(t,e,r,i)||qm(t,e,r,s)||qm(t,e,i,a)||qm(t,e,a,s)},$m=function(t,e,n,o,r,i,a){var s=[],l=[e],u={},c={},d={};e.id&&(c[e.id]=0,d[e.id]=Vm(e,n,e));var p={};t.forEach((function(t){t.id&&(p[t.id]=t)}));for(var h=function(){var h,f,g,v,y=1/0;if(l.forEach((function(t){t.id&&d[t.id]<y&&(y=d[t.id],h=t)})),h===n&&n.id){var m=[];return Km(m,p,u,n.id),{value:m}}if(!h)return{value:[e,n]};g=h,(v=(f=l).indexOf(g))>-1&&f.splice(v,1),s.push(h),function(t,e,n,o){var r=[];return t.forEach((function(t){t!==e&&(t.x!==e.x&&t.y!==e.y||Zm(t,e,n)||Zm(t,e,o)||r.push(t))})),Hm(r)}(t,h,o,r).forEach((function(t){if(-1===s.indexOf(t)&&(-1===l.indexOf(t)&&l.push(t),(null==h?void 0:h.id)&&(null==t?void 0:t.id))){var o=d[h.id]+Ym(h,t);if(c[t.id]&&o>=c[t.id])return;u[t.id]=h.id,c[t.id]=o,d[t.id]=c[t.id]+Vm(t,n,e,i,a)}}))};l.length;){var f=h();if("object"==typeof f)return f.value}return[e,n]},Jm=function(t){return zb(t)},Qm=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],o=t[e],r=t[e+1];n.x===o.x&&o.x===r.x||n.y===o.y&&o.y===r.y?t.splice(e,1):e++}return t},tb=function(t,e,n,o,r){var i,a,s=Jm(n),l=Jm(o),u=zm(s,r),c=zm(l,r),d=Fm(u,s,t),p=Fm(c,l,e);if(i=u,a=c,2*Math.abs(i.centerX-a.centerX)<i.width+a.width&&2*Math.abs(i.centerY-a.centerY)<i.height+a.height){var h=ab(t,e,d,p);return Bm(Bm([t,d],jm(h),!1),[p,e],!1)}var f=Gm([d,p]),g=Wm(u,f),v=Wm(c,f),y=[];y=(y=y.concat(Xm(g))).concat(Xm(v));var m={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[f,g,v].forEach((function(t){y=y.concat(function(t,e){return Bm(Bm([],jm(function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x)),!1),jm(function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y)),!1)}(t,m).filter((function(t){return Um(t,u)&&Um(t,c)})))})),[{x:d.x,y:p.y},{x:p.x,y:d.y}].forEach((function(t){Um(t,u)&&Um(t,c)&&y.push(t)})),y.unshift(d),y.push(p),y=Hm(y);var b=$m(y,d,p,s,l,t,e);return b.unshift(t),b.push(e),b.length>2&&(b=Qm(b)),Hm(b)},eb=function(t,e,n){var o=Bb(t,n),r=Bb(e,n);return o&&r},nb=function(t,e,n){var o=Bb(t,n),r=Bb(e,n);return!(o&&r)&&(o||r)},ob=function(t,e,n){for(var o=void 0,r=zb(n),i=Xm(r),a=0;a<i.length;a++){qm(t,e,i[a],i[(a+1)%i.length])&&(o=[i[a],i[(a+1)%i.length]])}if(o)return function(t,e,n,o){var r=(e.y-t.y)*(o.x-n.x)-(t.x-e.x)*(n.y-o.y);if(0===r)return!1;var i=((e.x-t.x)*(o.x-n.x)*(n.y-t.y)+(e.y-t.y)*(o.x-n.x)*t.x-(o.y-n.y)*(e.x-t.x)*n.x)/r,a=-((e.y-t.y)*(o.y-n.y)*(n.x-t.x)+(e.x-t.x)*(o.y-n.y)*t.y-(o.x-n.x)*(e.y-t.y)*n.y)/r;return(i-t.x)*(i-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(i-n.x)*(i-o.x)<=0&&(a-n.y)*(a-o.y)<=0&&{x:i,y:a}}(t,e,o[0],o[1])},rb=function(t,e){var n=void 0;return t.x===e.x?n=Nm.VERTICAL:t.y===e.y&&(n=Nm.HORIZONTAL),n},ib=function(t){var e=t.split(" "),n=[];return e&&e.forEach((function(t){var e=jm(t.split(","),2),o=e[0],r=e[1];n.push({x:Number(o),y:Number(r)})})),n},ab=function(t,e,n,o){var r=[];if(rb(t,n)===rb(e,o))t.y===n.y?(r.push({x:n.x,y:(n.y+o.y)/2}),r.push({x:o.x,y:(n.y+o.y)/2})):(r.push({x:(n.x+o.x)/2,y:n.y}),r.push({x:(n.x+o.x)/2,y:o.y}));else{var i={x:n.x,y:o.y},a=Rm(i,t,n),s=Rm(i,e,o);if(a||s)i={x:o.x,y:n.y};else{var l=sb(i,t,n),u=sb(i,e,o);l&&u&&(i={x:o.x,y:n.y})}r.push(i)}return r},sb=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},lb=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:e+=o>=1&&o<=126||o>=65376&&o<=65439?1:2}return e},ub=function(t){var e=t.start,n=t.end,o=t.sourceNode,r=t.targetNode,i=t.offset,a=zb(o),s=zb(r),l=zm(a,i),u=zm(s,i);return{sNext:Fm(l,a,e),ePre:Fm(u,s,n)}},cb=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(",");return[db(e[0]),db(e[1]),db(e[2]),db(e[3])]},db=function(t){var e=jm(t.replace(/(^\s*)/g,"").split(" "),2);return{x:+e[0],y:+e[1]}},pb=function(t,e){var n=jm(t,4),o=function(t,e,n,o,r){var i=function(r){if(r<0||r>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-r,3)+3*e.x*r*Math.pow(1-r,2)+3*n.x*Math.pow(r,2)*(1-r)+o.x*Math.pow(r,3),y:t.y*Math.pow(1-r,3)+3*e.y*r*Math.pow(1-r,2)+3*n.y*Math.pow(r,2)*(1-r)+o.y*Math.pow(r,3)}},a=0,s=2,l=o.x,u=o.y,c=o;for(;a<r&&s<50;){var d=(c=i(1-s/$_)).x,p=c.y;a=jb(l,u,d,p),s++}return c}(n[0],n[1],n[2],n[3],e);return[o,t[3]]},hb=function(t,e){for(var n,o=t.x,r=t.y,i=ib(e),a=Number.MAX_SAFE_INTEGER,s=[],l=0;l<i.length;l++)s.push({start:i[l],end:i[(l+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:r};if(Rm(s,e,i))(l=Math.abs(e.x-o))<a&&(a=l,n=s)}else if(e.y===i.y){var l;s={x:o,y:e.y};if(Rm(s,e,i))(l=Math.abs(e.y-r))<a&&(a=l,n=s)}})),!n){var u=s[0],c=u.start,d=u.end;n={x:c.x+(d.x-c.x)/2,y:c.y+(d.y-c.y)/2}}return n},fb=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};var gb=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},vb=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))};function yb(t,e){return e*Math.round(t/e)||t}var mb=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},bb=function(t,e,n){var o=mb(t,2),r=o[0],i=o[1],a=mb(e,2),s=a[0],l=a[1],u=mb(n,2),c=u[0],d=u[1];return r>s&&r<c&&i>l&&i<d},_b=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},xb=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();function Eb(t,e){return!!(t instanceof Sb&&e instanceof Sb)}var wb=function(t){function e(n,o,r){var i=t.call(this,3)||this;return i[0]=n,i[1]=o,i[2]=r,i.x=n,i.y=o,i.z=r,Object.setPrototypeOf(i,e.prototype),i}return xb(e,t),e.prototype.add=function(t){if(Eb(this,t))return new Sb(this.x+t.x,this.y+t.y);var e=this.z+t.z;return new Cb((this.x+t.x)/e,(this.y+t.y)/e)},e.prototype.subtract=function(t){if(Eb(this,t))return new Sb(this.x-t.x,this.y-t.y);var e=this.z-t.z;return 0===e?new Sb(this.x-t.x,this.y-t.y):new Cb((this.x-t.x)/e,(this.y-t.y)/e)},e}(Array),Sb=function(t){function e(n,o,r){var i=t.call(this,n,o,null!=r?r:0)||this;return Object.setPrototypeOf(i,e.prototype),i}return xb(e,t),e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(t){var e=this;return t.reduce((function(t,n,o){return t+n*e[o]}))},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}(wb),Cb=function(t){function e(n,o){var r=t.call(this,n,o,1)||this;return Object.setPrototypeOf(r,e.prototype),r}return xb(e,t),e.prototype.toString=function(){return"Point"},e}(wb),Mb=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ob=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Tb=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Nb=function(t){function e(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=t.call(this,n.length)||this;return r.fill(new Array(3)),n.forEach((function(t,e){r[e]=t})),r.columns=n[0].length,r.rows=n.length,Object.setPrototypeOf(r,e.prototype),r}return Mb(e,t),e.prototype.getRow=function(t){return this[t]},e.prototype.getColumn=function(t){return Tb([],Ob(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,Tb([void 0],Ob(t),!1)))},e.prototype.cross=function(t){var n=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===t.rows)for(var o=0;o<this.rows;o++)for(var r=this.getRow(o),i=function(e){var i=t.getColumn(e);n[o][e]=r.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,Tb([void 0],Ob(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 Cb(t[0],t[1])}))},e.prototype.toString=function(){var t=Ob(this[0],2),e=t[0],n=t[1],o=Ob(this[1],2),r=o[0],i=o[1],a=Ob(this[2],2),s=a[0],l=a[1];return"matrix(".concat(e," ").concat(n," ").concat(r," ").concat(i," ").concat(s," ").concat(l,")")},e.prototype.translate=function(t,e){return this.cross(new Db(t,e))},e.prototype.rotate=function(t){return this.cross(new Ab(t))},e.prototype.scale=function(t,e){return this.cross(new Pb(t,e))},e}(Array),Ab=function(t){function e(n){var o=t.call(this,new Sb(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new Sb(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new Sb(0,0,1))||this;return Object.setPrototypeOf(o,e.prototype),o}return Mb(e,t),e.prototype.inverse=function(){return this.transpose()},e}(Nb),Pb=function(t){function e(n,o){var r=t.call(this,new Sb(n,0,0),new Sb(0,o,0),new Sb(0,0,1))||this;return r.sx=n,r.sy=o,Object.setPrototypeOf(r,e.prototype),r}return Mb(e,t),e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(Nb),Db=function(t){function e(n,o){var r=t.call(this,new Sb(1,0,0),new Sb(0,1,0),new Sb(n,o,1))||this;return r.tx=n,r.ty=o,Object.setPrototypeOf(r,e.prototype),r}return Mb(e,t),e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(Nb);Pe({isolateGlobalState:!0});var kb=function(){return kb=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},kb.apply(this,arguments)},Rb=function(t){return t.anchors},Ib=function(t,e){for(var n,o=e.nodes,r=o.length-1;r>=0;r--){var i=o[r];if(Hb(t,i)){var a=i.getTargetAnchor(t);if(a){var s={node:i,anchorIndex:a.index,anchor:a.anchor};n&&!Lb(i,n.node,e)||(n=s)}}}return n},Lb=function(t,e,n){return t.zIndex>e.zIndex||n.nodesMap[t.id].index>n.nodesMap[e.id].index},jb=function(t,e,n,o){return Math.hypot(t-n,e-o)},Bb=function(t,e){var n=!1,o=zb(e);return t.x>=o.minX-0&&t.x<=o.maxX+0&&t.y>=o.minY-0&&t.y<=o.maxY+0&&(n=!0),n},Hb=function(t,e){var n=!1,o=zb(e);return t.x>=o.minX-5&&t.x<=o.maxX+5&&t.y>=o.minY-5&&t.y<=o.maxY+5&&(n=!0),n},zb=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{minX:e-o/2,minY:n-r/2,maxX:e+o/2,maxY:n+r/2,x:e,y:n,width:o,height:r,centerX:e,centerY:n}},Fb=function(t,e,n){var o,r=function(t){var e=t,n=e.x,o=e.y,r=e.width,i=e.height,a=e.radius;return[{x:n-r/2+a,y:o-i/2+a,r:a},{x:n+r/2-a,y:o-i/2+a,r:a},{x:n-r/2+a,y:o+i/2-a,r:a},{x:n+r/2-a,y:o+i/2-a,r:a}]}(n),i=Number.MAX_SAFE_INTEGER;return r.forEach((function(e){var n=jb(t.x,t.y,e.x,e.y);n<i&&(i=n,o=e)})),Wb(t,e,o)},Wb=function(t,e,n){var o,r=n.x,i=n.y,a=n.r;if(e===Nm.HORIZONTAL){var s=r-Math.sqrt(a*a-(t.y-i)*(t.y-i)),l=r+Math.sqrt(a*a-(t.y-i)*(t.y-i));o={x:Math.abs(s-t.x)<Math.abs(l-t.x)?s:l,y:t.y}}else if(e===Nm.VERTICAL){var u=i-Math.sqrt(a*a-(t.x-r)*(t.x-r)),c=i+Math.sqrt(a*a-(t.x-r)*(t.x-r)),d=Math.abs(u-t.y)<Math.abs(c-t.y)?u:c;o={x:t.x,y:d}}return o},Gb=function(t,e){var n=e,o=!1,r=n.x,i=n.y,a=n.width,s=n.height,l=n.radius,u=r-a/2+l,c=r+a/2-l,d=i-s/2+l,p=i+s/2-l;return t.y===i+s/2||t.y===i-s/2?o=t.x>u&&t.x<c:t.x!==r+a/2&&t.x!==r-a/2||(o=t.y>d&&t.y<p),o},Xb=function(t,e,n){var o,r=n,i=r.x,a=r.y,s=r.rx,l=r.ry;if(e===Nm.HORIZONTAL){var u=i-Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l)),c=i+Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(l*l));o={x:Math.abs(u-t.x)<Math.abs(c-t.x)?u:c,y:t.y}}else if(e===Nm.VERTICAL){var d=a-Math.sqrt(l*l-(t.x-i)*(t.x-i)*l*l/(s*s)),p=a+Math.sqrt(l*l-(t.x-i)*(t.x-i)*l*l/(s*s)),h=Math.abs(d-t.y)<Math.abs(p-t.y)?d:p;o={x:t.x,y:h}}return o},Ub=function(t,e,n){for(var o,r=n.pointsPosition,i=Number.MAX_SAFE_INTEGER,a=[],s=0;s<r.length;s++)a.push({start:r[s],end:r[(s+1)%r.length]});return a.forEach((function(n){var r=n.start,a=n.end,s=r,l=a;r.x>a.x&&(s=a,l=r);var u={x:t.x,y:t.y};if(s.x===l.x&&e===Nm.HORIZONTAL&&(u={x:s.x,y:t.y}),s.y===l.y&&e===Nm.VERTICAL&&(u={x:t.x,y:s.y}),s.x!==l.x&&s.y!==l.y){var c=(l.y-s.y)/(l.x-s.x),d=(s.x*l.y-l.x*s.y)/(s.x-l.x);e===Nm.HORIZONTAL?u={x:(t.y-d)/c,y:t.y}:e===Nm.VERTICAL&&(u={x:t.x,y:c*t.x+d})}if(Rm(u,r,a)){var p=jb(u.x,u.y,t.x,t.y);p<i&&(i=p,o=u)}})),o},Yb=function(t,e,n,o){var r=t.x,i=t.y;return e.x>t.x?r=t.x+n/2:e.x<t.x&&(r=t.x-n/2),e.y>t.y?i=t.y+o/2:e.y<t.y&&(i=t.y-o/2),{x:r,y:i}},Vb=function(t){var e=t.rows,n=t.style,o=t.rowsLength,r=t.className,i=document.createElement("div");i.className=r,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)),o>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},Kb=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,r=0;return e&&e.forEach((function(t){var e=lb(t);r=e>r?e:r})),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}},qb=function(t){return"object"!=typeof t?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let Zb;const $b=new Uint8Array(16);function Jb(){if(!Zb&&(Zb="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zb))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zb($b)}var Qb=/^(?:[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 t_=[];for(let t=0;t<256;++t)t_.push((t+256).toString(16).slice(1));function e_(t,e=0){return t_[t[e+0]]+t_[t[e+1]]+t_[t[e+2]]+t_[t[e+3]]+"-"+t_[t[e+4]]+t_[t[e+5]]+"-"+t_[t[e+6]]+t_[t[e+7]]+"-"+t_[t[e+8]]+t_[t[e+9]]+"-"+t_[t[e+10]]+t_[t[e+11]]+t_[t[e+12]]+t_[t[e+13]]+t_[t[e+14]]+t_[t[e+15]]}function n_(t){if(!function(t){return"string"==typeof t&&Qb.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 o_(t,e,n){function o(t,o,r,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 o&&(o=n_(o)),16!==(null===(a=o)||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(o),s.set(t,o.length),s=n(s),s[6]=15&s[6]|e,s[8]=63&s[8]|128,r){i=i||0;for(let t=0;t<16;++t)r[i+t]=s[t];return r}return e_(s)}try{o.name=t}catch(t){}return o.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",o.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",o}function r_(t){return 14+(t+64>>>9<<4)+1}function i_(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function a_(t,e,n,o,r,i){return i_((a=i_(i_(e,t),i_(o,i)))<<(s=r)|a>>>32-s,n);var a,s}function s_(t,e,n,o,r,i,a){return a_(e&n|~e&o,t,e,r,i,a)}function l_(t,e,n,o,r,i,a){return a_(e&o|n&~o,t,e,r,i,a)}function u_(t,e,n,o,r,i,a){return a_(e^n^o,t,e,r,i,a)}function c_(t,e,n,o,r,i,a){return a_(n^(e|~o),t,e,r,i,a)}o_("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,o="0123456789abcdef";for(let r=0;r<n;r+=8){const n=t[r>>5]>>>r%32&255,i=parseInt(o.charAt(n>>>4&15)+o.charAt(15&n),16);e.push(i)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[r_(e)-1]=e;let n=1732584193,o=-271733879,r=-1732584194,i=271733878;for(let e=0;e<t.length;e+=16){const a=n,s=o,l=r,u=i;n=s_(n,o,r,i,t[e],7,-680876936),i=s_(i,n,o,r,t[e+1],12,-389564586),r=s_(r,i,n,o,t[e+2],17,606105819),o=s_(o,r,i,n,t[e+3],22,-1044525330),n=s_(n,o,r,i,t[e+4],7,-176418897),i=s_(i,n,o,r,t[e+5],12,1200080426),r=s_(r,i,n,o,t[e+6],17,-1473231341),o=s_(o,r,i,n,t[e+7],22,-45705983),n=s_(n,o,r,i,t[e+8],7,1770035416),i=s_(i,n,o,r,t[e+9],12,-1958414417),r=s_(r,i,n,o,t[e+10],17,-42063),o=s_(o,r,i,n,t[e+11],22,-1990404162),n=s_(n,o,r,i,t[e+12],7,1804603682),i=s_(i,n,o,r,t[e+13],12,-40341101),r=s_(r,i,n,o,t[e+14],17,-1502002290),o=s_(o,r,i,n,t[e+15],22,1236535329),n=l_(n,o,r,i,t[e+1],5,-165796510),i=l_(i,n,o,r,t[e+6],9,-1069501632),r=l_(r,i,n,o,t[e+11],14,643717713),o=l_(o,r,i,n,t[e],20,-373897302),n=l_(n,o,r,i,t[e+5],5,-701558691),i=l_(i,n,o,r,t[e+10],9,38016083),r=l_(r,i,n,o,t[e+15],14,-660478335),o=l_(o,r,i,n,t[e+4],20,-405537848),n=l_(n,o,r,i,t[e+9],5,568446438),i=l_(i,n,o,r,t[e+14],9,-1019803690),r=l_(r,i,n,o,t[e+3],14,-187363961),o=l_(o,r,i,n,t[e+8],20,1163531501),n=l_(n,o,r,i,t[e+13],5,-1444681467),i=l_(i,n,o,r,t[e+2],9,-51403784),r=l_(r,i,n,o,t[e+7],14,1735328473),o=l_(o,r,i,n,t[e+12],20,-1926607734),n=u_(n,o,r,i,t[e+5],4,-378558),i=u_(i,n,o,r,t[e+8],11,-2022574463),r=u_(r,i,n,o,t[e+11],16,1839030562),o=u_(o,r,i,n,t[e+14],23,-35309556),n=u_(n,o,r,i,t[e+1],4,-1530992060),i=u_(i,n,o,r,t[e+4],11,1272893353),r=u_(r,i,n,o,t[e+7],16,-155497632),o=u_(o,r,i,n,t[e+10],23,-1094730640),n=u_(n,o,r,i,t[e+13],4,681279174),i=u_(i,n,o,r,t[e],11,-358537222),r=u_(r,i,n,o,t[e+3],16,-722521979),o=u_(o,r,i,n,t[e+6],23,76029189),n=u_(n,o,r,i,t[e+9],4,-640364487),i=u_(i,n,o,r,t[e+12],11,-421815835),r=u_(r,i,n,o,t[e+15],16,530742520),o=u_(o,r,i,n,t[e+2],23,-995338651),n=c_(n,o,r,i,t[e],6,-198630844),i=c_(i,n,o,r,t[e+7],10,1126891415),r=c_(r,i,n,o,t[e+14],15,-1416354905),o=c_(o,r,i,n,t[e+5],21,-57434055),n=c_(n,o,r,i,t[e+12],6,1700485571),i=c_(i,n,o,r,t[e+3],10,-1894986606),r=c_(r,i,n,o,t[e+10],15,-1051523),o=c_(o,r,i,n,t[e+1],21,-2054922799),n=c_(n,o,r,i,t[e+8],6,1873313359),i=c_(i,n,o,r,t[e+15],10,-30611744),r=c_(r,i,n,o,t[e+6],15,-1560198380),o=c_(o,r,i,n,t[e+13],21,1309151649),n=c_(n,o,r,i,t[e+4],6,-145523070),i=c_(i,n,o,r,t[e+11],10,-1120210379),r=c_(r,i,n,o,t[e+2],15,718787259),o=c_(o,r,i,n,t[e+9],21,-343485551),n=i_(n,a),o=i_(o,s),r=i_(r,l),i=i_(i,u)}return[n,o,r,i]}(function(t){if(0===t.length)return[];const e=8*t.length,n=new Uint32Array(r_(e));for(let o=0;o<e;o+=8)n[o>>5]|=(255&t[o/8])<<o%32;return n}(t),8*t.length))}));var d_={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function p_(t,e,n){if(d_.randomUUID&&!e&&!t)return d_.randomUUID();const o=(t=t||{}).random||(t.rng||Jb)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=o[t];return e}return e_(o)}function h_(t,e,n,o){switch(t){case 0:return e&n^~e&o;case 1:case 3:return e^n^o;case 2:return e&n^e&o^n&o}}function f_(t,e){return t<<e|t>>>32-e}o_("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 o=t.length/4+2,r=Math.ceil(o/16),i=new Array(r);for(let e=0;e<r;++e){const n=new Uint32Array(16);for(let o=0;o<16;++o)n[o]=t[64*e+4*o]<<24|t[64*e+4*o+1]<<16|t[64*e+4*o+2]<<8|t[64*e+4*o+3];i[e]=n}i[r-1][14]=8*(t.length-1)/Math.pow(2,32),i[r-1][14]=Math.floor(i[r-1][14]),i[r-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<r;++t){const o=new Uint32Array(80);for(let e=0;e<16;++e)o[e]=i[t][e];for(let t=16;t<80;++t)o[t]=f_(o[t-3]^o[t-8]^o[t-14]^o[t-16],1);let r=n[0],a=n[1],s=n[2],l=n[3],u=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),i=f_(r,5)+h_(n,a,s,l)+u+e[n]+o[t]>>>0;u=l,l=s,s=f_(a,30)>>>0,a=r,r=i}n[0]=n[0]+r>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+l>>>0,n[4]=n[4]+u>>>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 g_=function(){return p_()},v_=new Map,y_=function(t){var e=g_();var n=window.requestAnimationFrame((function n(){if(t(),v_.get(e)){var o=window.requestAnimationFrame(n);v_.set(e,o)}}));return v_.set(e,n),e},m_=function(t){var e=v_.get(t);e&&(window.cancelAnimationFrame(e),v_.delete(t))},b_=function(){return b_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},b_.apply(this,arguments)},__=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function x_(t){var e=t.x,n=void 0===e?0:e,o=t.y,r=void 0===o?0:o,i=t.value,a=t.fontSize,s=void 0===a?12:a,l=t.fill,u=void 0===l?"currentColor":l,c=t.overflowMode,d=void 0===c?"default":c,p=t.textWidth,h=void 0===p?void 0:p,f=t.model,g={x:n,y:r,fill:u,fontSize:s,textAnchor:"middle",dominantBaseline:"central"};if(oh(ch(t),(function(t){var e=__(t,2),n=e[0],o=e[1];"object"!=typeof o&&(g[n]=o)})),i){var v=String(i).split(/[\r\n]/g),y=v.length;if("default"!==d){var m=f.BaseType,b=f.modelType;if(m===Cm.NODE&&b!==Mm.TEXT_NODE||m===Cm.EDGE&&h)return function(t){var e=t.x,n=t.y,o=t.value,r=t.model,i=t.textWidth,a=t.fontSize,s=void 0===a?12:a,l=t.lineHeight,u=t.fontFamily,c=void 0===u?"":u,d=t.wrapPadding,p=void 0===d?"0, 0":d,h=t.overflowMode,f=r.width,g=r.height,v=r.textHeight,y=i||f,m=String(o).split(/[\r\n]/g),b=m.length,_=Vb({rows:m,style:{fontSize:"".concat(s,"px"),width:"".concat(y,"px"),fontFamily:c,lineHeight:l,padding:p},rowsLength:b,className:"lf-get-text-height"}),x=g>_?g:_;v&&(x=v);var E="ellipsis"===h;E&&(x=s+2);return xr("g",{children:xr("foreignObject",{width:y,height:x,x:e-y/2,y:n-x/2,style:{overflow:"visible",textAlign:"left"},children:xr("div",{className:"lf-node-text-auto-wrap",style:{minHeight:x,width:y,padding:p},children:xr("div",{className:E?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:E?m.join(""):"",style:b_({},t),children:m.map((function(t){return xr("div",{className:"lf-node-text--auto-wrap-inner",children:t})}))})})})})}(t)}if(y>1){var _=v.map((function(t,e){return xr("tspan",{className:"lf-text-tspan",x:n,y:r+(e-(y-1)/2)*(s+2),children:t})}));return xr("text",b_({},g,{children:_}))}return xr("text",b_({},g,{children:i}))}return null}var E_=function(){return E_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},E_.apply(this,arguments)},w_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function S_(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return oh(ch(t),(function(t){var n=w_(t,2),o=n[0],r=n[1];("style"===o||"object"!=typeof r)&&(e[o]=r)})),xr("line",E_({},e))}var C_=function(){return C_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},C_.apply(this,arguments)},M_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function O_(t){var e=t.x,n=t.y,o=t.width,r=t.height,i=t.className,a=t.strokeWidth,s=t.radius,l=void 0===s?0:s,u=e-o/2,c=n-r/2,d={};return d["stroke-width"]=a,oh(ch(t),(function(t){var e=M_(t,2),n=e[0],o=e[1];"object"!=typeof o&&(d[n]=o)})),d.className=i?"lf-basic-shape ".concat(i):"lf-basic-shape",l&&(d.rx=l,d.ry=l),d.x=u,d.y=c,xr("rect",C_({},d))}var T_=function(){return T_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},T_.apply(this,arguments)},N_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function A_(t){var e={d:""};return oh(ch(t),(function(t){var n=N_(t,2),o=n[0],r=n[1];"style"!==o&&"object"==typeof r||(e[o]=r)})),xr("path",T_({},e))}var P_=function(){return P_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},P_.apply(this,arguments)},D_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function k_(t){var e=t.x,n=void 0===e?0:e,o=t.y,r=void 0===o?0:o,i=t.r,a=void 0===i?4:i,s=t.className,l={cx:n,cy:r,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return oh(ch(t),(function(t){var e=D_(t,2),n=e[0],o=e[1];"object"!=typeof o&&(l[n]=o)})),l.className=s?"lf-basic-shape ".concat(s):"lf-basic-shape",xr("circle",P_({},l))}var R_=function(){return R_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},R_.apply(this,arguments)},I_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function L_(t){var e=t.x,n=void 0===e?0:e,o=t.y,r=void 0===o?0:o,i=t.rx,a=void 0===i?4:i,s=t.ry,l=void 0===s?4:s,u=t.className,c={cx:n,cy:r,rx:a,ry:l,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return oh(ch(t),(function(t){var e=I_(t,2),n=e[0],o=e[1];"object"!=typeof o&&(c[n]=o)})),c.className=u?"lf-basic-shape ".concat(u):"lf-basic-shape",xr("ellipse",R_({},c))}var j_=function(){return j_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},j_.apply(this,arguments)},B_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function H_(t){var e=t.points,n=void 0===e?[]:e,o=t.className,r={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};return oh(ch(t),(function(t){var e=B_(t,2),n=e[0],o=e[1];"object"!=typeof o&&(r[n]=o)})),o?r.classNmae="lf-basic-shape ".concat(o):r.className="lf-basic-shape",r.points=n.map((function(t){return t.join(",")})).join(" "),xr("polygon",j_({},r))}var z_=function(){return z_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},z_.apply(this,arguments)},F_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};function W_(t){var e=t.className,n={points:"",fill:"none"};return oh(ch(t),(function(t){var e=F_(t,2),o=e[0],r=e[1];("style"===o||"object"!=typeof r)&&(n[o]=r)})),e&&(n.className="".concat(e)),xr("polyline",z_({},n))}var G_,X_=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),U_=function(){return U_=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},U_.apply(this,arguments)},Y_=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n},V_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};!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"}(G_||(G_={}));var K_=function(t){function e(e){var n=t.call(this)||this;n.updateEdgePointByAnchors=function(){var t=n.nodeModel,e=t.id,o=t.anchors;oh(n.graphModel.getNodeEdges(e),(function(t){if(t.sourceNodeId===e)(n=Oh(o,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:n.x,y:n.y});else if(t.targetNodeId===e){var n;(n=Oh(o,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:n.x,y:n.y})}}))},n.triggerResizeEvent=function(t,e,o,r,i,a){n.graphModel.eventCenter.emit(Om.NODE_RESIZE,{preData:t,data:e,deltaX:o,deltaY:r,index:i,model:a})},n.recalcResizeInfo=function(t,e,n,o,r){void 0===n&&(n=1),void 0===o&&(o=!1),void 0===r&&(r=!1);var i=_d(e),a=i.deltaX,s=i.deltaY,l=i.width,u=i.height,c=i.PCTResizeInfo;if(c){var d=0,p=0;switch(t){case G_.LEFT_TOP:p=(-1*a-s)/4;break;case G_.RIGHT_TOP:p=(a-s)/4;break;case G_.RIGHT_BOTTOM:p=(a+s)/4;break;case G_.LEFT_BOTTOM:p=(-1*a+s)/4}0!==p&&(d=Math.round(p/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var h=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),f=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case G_.LEFT_TOP:a=l-h,s=u-f;break;case G_.RIGHT_TOP:a=h-l,s=u-f;break;case G_.RIGHT_BOTTOM:a=h-l,s=f-u;break;case G_.LEFT_BOTTOM:a=l-h,s=f-u}return i}switch(t){case G_.LEFT_TOP:i.width=o?l:l-a*n,i.height=r?u:u-s*n;break;case G_.RIGHT_TOP:i.width=o?l:l+a*n,i.height=r?u:u-s*n;break;case G_.RIGHT_BOTTOM:i.width=o?l:l+a*n,i.height=r?u:u+s*n;break;case G_.LEFT_BOTTOM:i.width=o?l:l-a*n,i.height=r?u:u+s*n}return i},n.resizeNode=function(t){var e=t.deltaX,o=t.deltaY,r=n.index,i=n.props,a=i.model,s=i.graphModel;Z_({deltaX:e,deltaY:o,index:r,nodeModel:a,graphModel:s,cancelCallback:function(){n.dragHandler.cancelDrag()}})},n.onDragging=function(t){var e=t.deltaX,o=t.deltaY,r=n.graphModel.transformModel,i=V_(r.fixDeltaXY(e,o),2),a=i[0],s=i[1];n.resizeNode({deltaX:a,deltaY:s})},n.onDragEnd=function(){var t=n.nodeModel.x,e=n.nodeModel.y;n.nodeModel.moveTo(t,e),n.updateEdgePointByAnchors()};var o=e.index,r=e.model,i=e.graphModel;return n.index=o,n.nodeModel=r,n.graphModel=i,n.dragHandler=new Dm({onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:i.gridSize}),n}return X_(e,t),e.prototype.render=function(){var t=this.props,e=t.x,n=t.y,o=t.direction,r=t.model.getResizeControlStyle(),i=r.width,a=r.height,s=Y_(r,["width","height"]);return xr("g",{className:"lf-resize-control lf-resize-control-".concat(o),children:[xr(O_,U_({className:"lf-resize-control-content",x:e,y:n,width:null!=i?i:7,height:null!=a?a:7},s)),xr(O_,{className:"lf-resize-control-content",x:e,y:n,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e}(ho),q_=function(t){function e(){return t.call(this)||this}return X_(e,t),e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,o=zb(e),r=o.minX,i=o.minY,a=o.maxX,s=o.maxY;return Ih([{index:G_.LEFT_TOP,direction:"nw",x:r,y:i},{index:G_.RIGHT_TOP,direction:"ne",x:a,y:i},{index:G_.RIGHT_BOTTOM,direction:"se",x:a,y:s},{index:G_.LEFT_BOTTOM,direction:"sw",x:r,y:s}],(function(t){return xr(K_,U_({},t,{model:e,graphModel:n}))}))},e.prototype.getResizeOutline=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.getResizeOutlineStyle();return xr(O_,U_({},i,{x:e,y:n,width:o,height:r}))},e.prototype.render=function(){return xr("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e}(ho),Z_=function(t){var e=t.deltaX,n=t.deltaY,o=t.index,r=t.nodeModel,i=t.graphModel,a=t.cancelCallback,s=r.r,l=r.rx,u=r.ry,c=r.width,d=r.height,p=r.PCTResizeInfo,h=r.minWidth,f=r.minHeight,g=r.maxWidth,v=r.maxHeight,y=h===g,m=function(t,e,n,o,r){void 0===n&&(n=1),void 0===o&&(o=!1),void 0===r&&(r=!1);var i=_d(e),a=i.deltaX,s=i.deltaY,l=i.width,u=i.height,c=i.PCTResizeInfo;if(c){var d=0,p=0;switch(t){case G_.LEFT_TOP:p=(-1*a-s)/4;break;case G_.RIGHT_TOP:p=(a-s)/4;break;case G_.RIGHT_BOTTOM:p=(a+s)/4;break;case G_.LEFT_BOTTOM:p=(-1*a+s)/4}0!==p&&(d=Math.round(p/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var h=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),f=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case G_.LEFT_TOP:a=l-h,s=u-f;break;case G_.RIGHT_TOP:a=h-l,s=u-f;break;case G_.RIGHT_BOTTOM:a=h-l,s=f-u;break;case G_.LEFT_BOTTOM:a=l-h,s=f-u}return i}switch(t){case G_.LEFT_TOP:i.width=o?l:l-a*n,i.height=r?u:u-s*n;break;case G_.RIGHT_TOP:i.width=o?l:l+a*n,i.height=r?u:u-s*n;break;case G_.RIGHT_BOTTOM:i.width=o?l:l+a*n,i.height=r?u:u+s*n;break;case G_.LEFT_BOTTOM:i.width=o?l:l-a*n,i.height=r?u:u+s*n}return i}(o,{width:s||l||c,height:s||u||d,deltaX:e,deltaY:n,PCTResizeInfo:p},s||l&&u?.5:1,y,f===v);if(m.width<h||m.width>g||m.height<f||m.height>v)null==a||a();else{m.deltaX=y?0:m.deltaX,m.deltaY=y?0:m.deltaY;var b=r.getData(),_=r.resize(m);!function(t,e){var n=t.id,o=t.anchors;oh(e.getNodeEdges(n),(function(t){if(t.sourceNodeId===n)(e=Oh(o,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:e.x,y:e.y});else if(t.targetNodeId===n){var e;(e=Oh(o,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:e.x,y:e.y})}}))}(r,i),function(t,e,n,o,r,i,a){a.eventCenter.emit(Om.NODE_RESIZE,{preData:t,data:e,deltaX:n,deltaY:o,index:r,model:i})}(b,_,e,n,o,r,i)}},$_=100,J_={x:1,y:0,z:0};function Q_(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function tx(t){return function(t,e){var n=function(t,e){return t.x*e.y-t.y*e.x}(t,e),o=Math.acos(function(t,e){var n=[t.x,t.y,t.z];return[e.x,e.y,e.z].reduce((function(t,e,o){return t+e*n[o]}))}(Q_(t),Q_(e)));return n>=0?o:-o}(J_,t)}var ex={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"}},nx=function(t){var e=_d(ex);return t&&(e=ag(e,t)),e},ox=nx,rx=1e3,ix=999,ax=function(){return++rx},sx=function(){return sx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},sx.apply(this,arguments)},lx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},ux=function(){function t(t,e){var n;this.BaseType=Cm.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=Am.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},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=Sm.DEFAULT,this.modelType=Mm.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=e,this.properties=null!==(n=t.properties)&&void 0!==n?n:{},this.initEdgeData(t),this.setAttributes()}return t.prototype.initEdgeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),o=this.createId();t.id=o||n||g_()}this.arrowConfig.markerEnd="url(#marker-end-".concat(t.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(t.id,")");var r=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=r,Ys(this,function(t){return iv(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])}(t)),this.graphModel.overlapMode===Tm.INCREASE&&(this.zIndex=t.zIndex||ax()),this.setAnchors(),this.initPoints(),this.formatText(t)},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.getEdgeStyle=function(){return sx(sx({},this.graphModel.theme.baseEdge),this.style)},t.prototype.getAdjustPointStyle=function(){return sx({},this.graphModel.theme.edgeAdjust)},t.prototype.getTextStyle=function(){return _d(this.graphModel.theme.edgeText)},t.prototype.getEdgeAnimationStyle=function(){return _d(this.graphModel.theme.edgeAnimation)},t.prototype.getArrowStyle=function(){var t=this.getEdgeStyle(),e=this.getEdgeAnimationStyle(),n=this.graphModel.theme.arrow,o=this.isAnimation?e.stroke:t.stroke;return sx(sx(sx({},t),{fill:o,stroke:o}),n)},t.prototype.getOutlineStyle=function(){return _d(this.graphModel.theme.outline)},t.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(t.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(t.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(t.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),t.prototype.getBeginAnchor=function(t,e,n){var o,r,i=Rb(t);if(n){if(o=Oh(i,(function(t){return t.id===n})))return o;console.warn("未在节点上找到指定的起点锚点".concat(n,",已使用默认锚点作为起点"))}return i.forEach((function(t){var n=fb(t,e);(void 0===r||n<r)&&(r=n,o=t)})),o},t.prototype.getEndAnchor=function(t,e){var n,o,r=this,i=Rb(t);if(e){if(n=Oh(i,(function(t){return t.id===e})))return n;console.warn("未在节点上找到指定的终点锚点".concat(e,",已使用默认锚点作为终点"))}return i.forEach((function(t){if(r.startPoint){var e=fb(t,r.startPoint);(void 0===o||e<o)&&(o=e,n=t)}})),n},t.prototype.getProperties=function(){return en(this.properties)},t.prototype.getData=function(){var t=this.properties;Ue(t)&&(t=en(t));var e={id:this.id,type:this.type,properties:t,sourceNodeId:this.sourceNode.id,targetNodeId:this.targetNode.id,startPoint:Ys({},this.startPoint),endPoint:Ys({},this.endPoint)};this.graphModel.overlapMode===Tm.INCREASE&&(e.zIndex=this.zIndex);var n=this.text,o=n.x,r=n.y,i=n.value;return i&&(e.text={x:o,y:r,value:i}),e},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.setProperty=function(t,e){var n,o=en(this.properties);this.properties=sx(sx({},o),((n={})[t]=wm(e),n)),this.setAttributes()},t.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},t.prototype.setProperties=function(t){this.properties=sx(sx({},en(this.properties)),wm(t)),this.setAttributes()},t.prototype.changeEdgeId=function(t){var e=this.arrowConfig,n=e.markerEnd,o=e.markerStart;o&&o==="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},t.prototype.setStyle=function(t,e){var n;this.style=sx(sx({},this.style),((n={})[t]=wm(e),n))},t.prototype.setStyles=function(t){this.style=sx(sx({},this.style),wm(t))},t.prototype.updateStyles=function(t){this.style=sx({},wm(t))},t.prototype.setTextMode=function(t){this.textMode=t},t.prototype.formatText=function(t){var e,n,o,r=this.textPosition,i=r.x,a=r.y,s=t.text,l={value:"",x:i,y:a,draggable:!1,editable:!0};s&&("string"==typeof s?l=sx(sx({},l),{value:s}):(l=sx(sx({},l),{x:null!==(e=s.x)&&void 0!==e?e:i,y:null!==(n=s.y)&&void 0!==n?n:a,value:null!==(o=s.value)&&void 0!==o?o:""}),Xf(s.draggable)||(l.draggable=s.draggable),Xf(s.editable)||(l.editable=s.editable))),this.text=l},t.prototype.resetTextPosition=function(){var t=this.textPosition,e=t.x,n=t.y;this.text.x=e,this.text.y=n},t.prototype.moveText=function(t,e){var n=this.text,o=n.x,r=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,editable:s,draggable:a,x:o+t,y:r+e}},t.prototype.setText=function(t){t&&Ys(this.text,t)},t.prototype.updateText=function(t){this.text=sx(sx({},en(this.text)),{value:t})},t.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)}},t.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},t.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t},t.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},t.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},t.prototype.openEdgeAnimation=function(){this.isAnimation=!0},t.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},t.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},t.prototype.updateStartPoint=function(t){this.startPoint=t},t.prototype.moveStartPoint=function(t,e){this.startPoint&&(this.startPoint.x+=t,this.startPoint.y+=e)},t.prototype.updateEndPoint=function(t){this.endPoint=t},t.prototype.moveEndPoint=function(t,e){this.endPoint&&(this.endPoint.x+=t,this.endPoint.y+=e)},t.prototype.setZIndex=function(t){void 0===t&&(t=0),this.zIndex=t},t.prototype.initPoints=function(){},t.prototype.updateAttributes=function(t){Ys(this,t)},t.prototype.getAdjustStart=function(){return this.startPoint},t.prototype.getAdjustEnd=function(){return this.endPoint},t.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})},t.BaseType=Cm.EDGE,lx([mt],t.prototype,"type",void 0),lx([mt],t.prototype,"sourceNodeId",void 0),lx([mt],t.prototype,"targetNodeId",void 0),lx([mt],t.prototype,"startPoint",void 0),lx([mt],t.prototype,"endPoint",void 0),lx([mt],t.prototype,"textMode",void 0),lx([mt],t.prototype,"text",void 0),lx([mt],t.prototype,"properties",void 0),lx([mt],t.prototype,"points",void 0),lx([mt],t.prototype,"pointsList",void 0),lx([mt],t.prototype,"isSelected",void 0),lx([mt],t.prototype,"isHovered",void 0),lx([mt],t.prototype,"isHitable",void 0),lx([mt],t.prototype,"isHittable",void 0),lx([mt],t.prototype,"draggable",void 0),lx([mt],t.prototype,"visible",void 0),lx([mt],t.prototype,"isAnimation",void 0),lx([mt],t.prototype,"isShowAdjustPoint",void 0),lx([mt],t.prototype,"zIndex",void 0),lx([mt],t.prototype,"state",void 0),lx([mt],t.prototype,"style",void 0),lx([mt],t.prototype,"arrowConfig",void 0),lx([St],t.prototype,"sourceNode",null),lx([St],t.prototype,"targetNode",null),lx([St],t.prototype,"textPosition",null),lx([xe],t.prototype,"setProperty",null),lx([xe],t.prototype,"deleteProperty",null),lx([xe],t.prototype,"setProperties",null),lx([xe],t.prototype,"changeEdgeId",null),lx([xe],t.prototype,"setStyle",null),lx([xe],t.prototype,"setStyles",null),lx([xe],t.prototype,"updateStyles",null),lx([xe],t.prototype,"setTextMode",null),lx([xe],t.prototype,"formatText",null),lx([xe],t.prototype,"resetTextPosition",null),lx([xe],t.prototype,"moveText",null),lx([xe],t.prototype,"setText",null),lx([xe],t.prototype,"updateText",null),lx([xe],t.prototype,"setAnchors",null),lx([xe],t.prototype,"setSelected",null),lx([xe],t.prototype,"setHovered",null),lx([xe],t.prototype,"setHitable",null),lx([xe],t.prototype,"setHittable",null),lx([xe],t.prototype,"openEdgeAnimation",null),lx([xe],t.prototype,"closeEdgeAnimation",null),lx([xe],t.prototype,"setElementState",null),lx([xe],t.prototype,"updateStartPoint",null),lx([xe],t.prototype,"moveStartPoint",null),lx([xe],t.prototype,"updateEndPoint",null),lx([xe],t.prototype,"moveEndPoint",null),lx([xe],t.prototype,"setZIndex",null),lx([xe],t.prototype,"initPoints",null),lx([xe],t.prototype,"updateAttributes",null),lx([xe],t.prototype,"getAdjustStart",null),lx([xe],t.prototype,"getAdjustEnd",null),lx([xe],t.prototype,"updateAfterAdjustStartAndEnd",null),t}(),cx=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),dx=function(){return dx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},dx.apply(this,arguments)},px=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},hx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},fx=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Mm.BEZIER_EDGE,o.path="",o.initEdgeData(e),o.setAttributes(),o}return cx(e,t),e.prototype.initEdgeData=function(e){this.offset=100,t.prototype.initEdgeData.call(this,e)},e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.bezier,n=t.prototype.getEdgeStyle.call(this),o=this.properties.style,r=void 0===o?{}:o;return dx(dx(dx({},n),_d(e)),_d(r))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var t=0,e=0;return this.pointsList.forEach((function(n){var o=n.x,r=n.y;t+=o,e+=r})),{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}},e.prototype.getData=function(){var e=t.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return dx(dx({},e),{pointsList:n})},e.prototype.getControls=function(){var t=this.startPoint,e=this.endPoint;return ub({start:t,end:e,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})},e.prototype.getPath=function(t){var e=hx(t,4),n=e[0],o=e[1],r=e[2],i=e[3];return"M ".concat(n.x," ").concat(n.y,"\n C ").concat(o.x," ").concat(o.y,",\n ").concat(r.x," ").concat(r.y,",\n ").concat(i.x," ").concat(i.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var t=this.getControls(),e=t.sNext,n=t.ePre;this.updatePath(e,n)},e.prototype.updatePath=function(t,e){t=_d(t),e=_d(e);var n={x:this.startPoint.x,y:this.startPoint.y},o={x:this.endPoint.x,y:this.endPoint.y};if(!t||!e){var r=this.getControls();t=r.sNext,e=r.ePre}this.pointsList=[n,t,e,o],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e;var n=hx(this.pointsList,3),o=n[1],r=n[2];o.x+=t,o.y+=e,this.updatePath(o,r)},e.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e;var n=hx(this.pointsList,3),o=n[1],r=n[2];r.x+=t,r.y+=e,this.updatePath(o,r)},e.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(Ys({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,o=t.sourceNode,r=t.targetNode,i=ub({start:e,end:n,sourceNode:o,targetNode:r,offset:this.offset}),a=i.sNext,s=i.ePre;this.pointsList=[e,a,s,n],this.initPoints()},px([mt],e.prototype,"path",void 0),px([xe],e.prototype,"initPoints",null),px([xe],e.prototype,"updatePoints",null),px([xe],e.prototype,"updateStartPoint",null),px([xe],e.prototype,"updateEndPoint",null),px([xe],e.prototype,"moveStartPoint",null),px([xe],e.prototype,"moveEndPoint",null),px([xe],e.prototype,"updateAdjustAnchor",null),px([xe],e.prototype,"getAdjustStart",null),px([xe],e.prototype,"getAdjustEnd",null),px([xe],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(ux),gx=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),vx=function(){return vx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},vx.apply(this,arguments)},yx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},mx=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},bx=function(t){function e(){var e=t.apply(this,mx([],yx(arguments),!1))||this;return e.modelType=Mm.LINE_EDGE,e}return gx(e,t),e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.line,n=t.prototype.getEdgeStyle.call(this),o=this.properties.style,r=void 0===o?{}:o;return vx(vx(vx({},n),_d(e)),_d(r))},e.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e}(ux),_x=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),xx=function(){return xx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},xx.apply(this,arguments)},Ex=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},wx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Sx=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Cx=function(t){function e(){var e=t.apply(this,Sx([],wx(arguments),!1))||this;return e.modelType=Mm.POLYLINE_EDGE,e.draggingPointList=[],e}return _x(e,t),e.prototype.initEdgeData=function(e){this.offset=30,t.prototype.initEdgeData.call(this,e)},e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.polyline,n=t.prototype.getEdgeStyle.call(this),o=this.properties.style,r=void 0===o?{}:o;return xx(xx(xx({},n),_d(e)),_d(r))},e.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 o=ib(this.points),r=wx(function(t){if(1===t.length){var e=jm(t,1)[0];return[e,e]}for(var n=t[0],o=t[1],r=jb(n.x,n.y,o.x,o.y),i=1;i<t.length-1;i++){var a=t[i],s=t[i+1],l=jb(a.x,a.y,s.x,s.y);l>r&&(r=l,n=a,o=s)}return[n,o]}(o),2),i=r[0],a=r[1];return{x:(i.x+a.x)/2,y:(i.y+a.y)/2}},e.prototype.getAfterAnchor=function(t,e,n){var o,r;return n.forEach((function(n){var i;t===Nm.HORIZONTAL?i=Math.abs(e.y-n.y):t===Nm.VERTICAL&&(i=Math.abs(e.x-n.x)),(!r||r>i)&&(r=i,o=n)})),o},e.prototype.getCrossPoint=function(t,e,n){var o;return t===Nm.HORIZONTAL?o={x:n.x,y:e.y}:t===Nm.VERTICAL&&(o={x:e.x,y:n.y}),o},e.prototype.removeCrossPoints=function(t,e,n){var o=n.map((function(t){return t}));if(1===t){var r=o[t],i=o[e],a=o[t-1];if(eb(a,r,this.sourceNode)){if(nb(r,i,this.sourceNode))(s=ob(r,i,this.sourceNode))&&(o[t]=s,o.splice(t-1,1),t--,e--)}else this.sourceNode.anchors.forEach((function(e){(e.x===a.x&&e.x===r.x||e.y===a.y&&e.y===r.y)&&(jb(e.x,e.y,r.x,r.y)<jb(a.x,a.y,r.x,r.y)&&(o[t-1]=e))}))}if(e===n.length-2){var s,l=o[t],u=o[e],c=o[e+1];if(eb(u,c,this.targetNode)){if(nb(l,u,this.targetNode))(s=ob(l,u,this.targetNode))&&(o[e]=s,o.splice(e+1,1))}else this.targetNode.anchors.forEach((function(t){(t.x===c.x&&t.x===u.x||t.y===c.y&&t.y===u.y)&&(jb(t.x,t.y,u.x,u.y)<jb(c.x,c.y,u.x,u.y)&&(o[e+1]=t))}))}return o},e.prototype.getDraggingPoints=function(t,e,n,o,r){var i=r.map((function(t){return t})),a=this.getAfterAnchor(t,n,o),s=this.getCrossPoint(t,n,a);return"start"===e?(i.unshift(s),i.unshift(a)):(i.push(s),i.push(a)),i},e.prototype.updateCrossPoints=function(t){var e=t.map((function(t){return t})),n=t[0],o=t[1],r=t[e.length-2],i=t[e.length-1],a=this.sourceNode,s=this.targetNode,l=a.modelType,u=s.modelType,c=rb(n,o),d=e[0];switch(l){case Mm.RECT_NODE:if(0!==a.radius)Gb(n,a)||(d=Fb(n,c,a));break;case Mm.CIRCLE_NODE:d=Wb(n,c,a);break;case Mm.ELLIPSE_NODE:d=Xb(n,c,a);break;case Mm.DIAMOND_NODE:case Mm.POLYGON_NODE:d=Ub(n,c,a)}d&&(e[0]=d);var p=rb(r,i),h=e[e.length-1];switch(u){case Mm.RECT_NODE:if(0!==s.radius)Gb(i,s)||(h=Fb(i,p,s));break;case Mm.CIRCLE_NODE:h=Wb(i,p,s);break;case Mm.ELLIPSE_NODE:h=Xb(i,p,s);break;case Mm.DIAMOND_NODE:case Mm.POLYGON_NODE:h=Ub(i,p,s)}return h&&(e[e.length-1]=h),e},e.prototype.getData=function(){var e=t.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return Object.assign({},e,{pointsList:n})},e.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.pointsList.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" "):this.updatePoints()},e.prototype.updatePoints=function(){var t=tb({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(" ")},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e,this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e,this.updatePoints()},e.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 o=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},o),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map((function(t){return t}))},e.prototype.dragAppendSimple=function(t,e){var n;this.isDragging=!0;var o=t.start,r=t.end,i=t.startIndex,a=t.endIndex,s=t.direction,l=this.pointsList,u=l;return s===Nm.HORIZONTAL?(l[i]={x:o.x,y:o.y+e.y},l[a]={x:r.x,y:r.y+e.y},u=this.pointsList.map((function(t){return t}))):s===Nm.VERTICAL&&(l[i]={x:o.x+e.x,y:o.y},l[a]={x:r.x+e.x,y:r.y},u=this.pointsList.map((function(t){return t}))),this.updatePointsAfterDrag(u),this.draggingPointList=u,(null===(n=this.text)||void 0===n?void 0:n.value)&&this.setText(Ys({},this.text,this.textPosition)),{start:Ys({},l[i]),end:Ys({},l[a]),startIndex:i,endIndex:a,direction:s}},e.prototype.dragAppend=function(t,e){var n;this.isDragging=!0;var o=t.start,r=t.end,i=t.startIndex,a=t.endIndex,s=t.direction,l=this.pointsList;if(s===Nm.HORIZONTAL){l[i]={x:o.x,y:o.y+e.y},l[a]={x:r.x,y:r.y+e.y};var u=this.pointsList.map((function(t){return t}));if(0!==i&&a!==this.pointsList.length-1&&(u=this.removeCrossPoints(i,a,u)),0===i){var c={x:o.x,y:o.y+e.y};if(!Bb(c,this.sourceNode)){var d=this.sourceNode.anchors;u=this.getDraggingPoints(s,"start",c,d,u)}}if(a===this.pointsList.length-1){var p={x:r.x,y:r.y+e.y};if(!Bb(p,this.targetNode)){d=this.targetNode.anchors;u=this.getDraggingPoints(s,"end",p,d,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}else if(s===Nm.VERTICAL){l[i]={x:o.x+e.x,y:o.y},l[a]={x:r.x+e.x,y:r.y};u=this.pointsList.map((function(t){return t}));if(0!==i&&a!==this.pointsList.length-1&&(u=this.removeCrossPoints(i,a,u)),0===i){c={x:o.x+e.x,y:o.y};if(!Bb(c,this.sourceNode)){d=this.sourceNode.anchors;u=this.getDraggingPoints(s,"start",c,d,u)}}if(a===this.pointsList.length-1){p={x:r.x+e.x,y:r.y};if(!Bb(p,this.targetNode)){d=this.targetNode.anchors;u=this.getDraggingPoints(s,"end",p,d,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}return(null===(n=this.text)||void 0===n?void 0:n.value)&&this.setText(Ys({},this.text,this.textPosition)),{start:Ys({},l[i]),end:Ys({},l[a]),startIndex:i,endIndex:a,direction:s}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var t=Qm(ib(this.points));this.pointsList=t.map((function(t){return t})),this.draggingPointList=[];var e=t[0];this.startPoint=Ys({},e);var n=t[t.length-1];this.endPoint=Ys({},n)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(t){var e=this.updateCrossPoints(t);this.points=e.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,o=t.sourceNode,r=t.targetNode;this.pointsList=tb({x:e.x,y:e.y},{x:n.x,y:n.y},o,r,this.offset||0),this.initPoints()},Ex([mt],e.prototype,"dbClickPosition",void 0),Ex([xe],e.prototype,"initPoints",null),Ex([xe],e.prototype,"updatePoints",null),Ex([xe],e.prototype,"updateStartPoint",null),Ex([xe],e.prototype,"moveStartPoint",null),Ex([xe],e.prototype,"updateEndPoint",null),Ex([xe],e.prototype,"moveEndPoint",null),Ex([xe],e.prototype,"updatePointsList",null),Ex([xe],e.prototype,"dragAppendStart",null),Ex([xe],e.prototype,"dragAppendSimple",null),Ex([xe],e.prototype,"dragAppend",null),Ex([xe],e.prototype,"dragAppendEnd",null),Ex([xe],e.prototype,"updatePointsAfterDrag",null),Ex([xe],e.prototype,"getAdjustStart",null),Ex([xe],e.prototype,"getAdjustEnd",null),Ex([xe],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(ux),Mx=function(){return Mx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Mx.apply(this,arguments)},Ox=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Tx=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Nx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Ax=function(){function t(t,e){var n;this.BaseType=Cm.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=Am.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},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.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=Sm.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=Mm.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=e,this.properties=null!==(n=t.properties)&&void 0!==n?n:{},this.initNodeData(t),this.setAttributes()}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t;var e=this.x,n=void 0===e?0:e,o=this.y,r=void 0===o?0:o;this.transform=new Db(-n,-r).rotate(t).translate(n,r).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),t.prototype.initNodeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),o=this.createId();t.id=o||n||g_()}this.formatText(t),Ys(this,function(t){return iv(t,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"])}(t)),this.graphModel.overlapMode===Tm.INCREASE&&(this.zIndex=t.zIndex||ax())},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.setTextMode=function(t){this.textMode=t},t.prototype.formatText=function(t){var e,n,o,r=t.x,i=t.y,a=t.text,s={value:"",x:r,y:i,draggable:!1,editable:!0};a&&("string"==typeof a?s.value=a:(s=Mx(Mx({},s),{x:null!==(e=a.x)&&void 0!==e?e:r,y:null!==(n=a.y)&&void 0!==n?n:i,value:null!==(o=a.value)&&void 0!==o?o:""}),Xf(a.draggable)||(s.draggable=a.draggable),Xf(a.editable)||(s.draggable=a.draggable))),t.text=s},t.prototype.resize=function(t){var e=t.width,n=t.height,o=t.deltaX,r=t.deltaY;return this.move(o/2,r/2),this.width=e,this.height=n,this.setProperties({width:e,height:n}),this.getData()},t.prototype.proportionalResize=function(){},t.prototype.getData=function(){var t=this.text,e=t.x,n=t.y,o=t.value,r=this.properties;Ue(r)&&(r=en(r));var i={id:this.id,type:this.type,x:this.x,y:this.y,properties:r};return this.rotate&&(i.rotate=this.rotate),this.graphModel.overlapMode===Tm.INCREASE&&(i.zIndex=this.zIndex),o&&(i.text={x:e,y:n,value:o}),i},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.getProperties=function(){return en(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return Mx(Mx({},this.graphModel.theme.baseNode),this.style)},t.prototype.getTextStyle=function(){var t=this.graphModel.theme.nodeText,e=this.properties.textStyle,n=void 0===e?{}:e;return Mx(Mx({},_d(t)),_d(n))},t.prototype.getRotateControlStyle=function(){return _d(this.graphModel.theme.rotateControl)},t.prototype.getResizeControlStyle=function(){return _d(this.graphModel.theme.resizeControl)},t.prototype.getResizeOutlineStyle=function(){return _d(this.graphModel.theme.resizeOutline)},t.prototype.getAnchorStyle=function(t){return _d(this.graphModel.theme.anchor)},t.prototype.getAnchorLineStyle=function(t){return _d(this.graphModel.theme.anchorLine)},t.prototype.getOutlineStyle=function(){return _d(this.graphModel.theme.outline)},t.prototype.isAllowConnectedAsSource=function(t,e,n,o){var r=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var i=!0,a="",s=0;s<r.length;s++){var l=r[s];if(!l.validate.call(this,this,t,e,n,o)){i=!1,a=l.message;break}}return{isAllPass:i,msg:a}},t.prototype.getConnectedSourceRules=function(){return this.sourceRules},t.prototype.isAllowConnectedAsTarget=function(t,e,n,o){var r=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var i=!0,a="",s=0;s<r.length;s++){var l=r[s];if(!l.validate.call(this,t,this,e,n,o)){i=!1,a=l.message;break}}return{isAllPass:i,msg:a}},t.prototype.isAllowMoveNode=function(t,e){var n,o,r=!0,i=!0,a=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var s=Tx(a),l=s.next();!l.done;l=s.next()){var u=(0,l.value)(this,t,e);if(!u)return!1;if("object"==typeof u){var c=u;if(!c.x&&!c.y)return!1;r=r&&c.x,i=i&&c.y}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return{x:r,y:i}},t.prototype.getConnectedTargetRules=function(){return this.targetRules},t.prototype.getAnchorsByOffset=function(){var t=this,e=t.anchorsOffset,n=t.id,o=t.x,r=t.y;return e&&e.length>0?e.map((function(t,e){return t.length?{id:"".concat(n,"_").concat(e),x:o+t[0],y:r+t[1]}:Mx(Mx({},t),{x:o+t.x,y:r+t.y,id:t.id||"".concat(n,"_").concat(e)})})):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(t){return function(t,e){for(var n,o=Rb(e),r=Number.MAX_SAFE_INTEGER,i=0;i<o.length;i++){var a=jb(t.x,t.y,o[i].x,o[i].y);a<r&&(r=a,n={index:i,anchor:kb(kb({},o[i]),{x:o[i].x,y:o[i].y,id:o[i].id})})}return n}(t,this)},t.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(t.prototype,"anchors",{get:function(){var t=this.getAnchorsByOffset(),e=this,n=e.x,o=e.y,r=e.rotate;return t.forEach((function(t){var e=t.x,i=t.y,a=Nx(new Nb([e,i,1]).translate(-n,-o).rotate(r).translate(n,o)[0],2),s=a[0],l=a[1];t.x=s,t.y=l})),t},enumerable:!1,configurable:!0}),t.prototype.getAnchorInfo=function(t){if(!zf(t))for(var e=0;e<this.anchors.length;e++){var n=this.anchors[e];if(n.id===t)return n}},t.prototype.addNodeMoveRules=function(t){this.moveRules.includes(t)||this.moveRules.push(t)},t.prototype.isAllowMoveByXORY=function(t,e,n){var o,r;if(n)o=!0,r=!0;else{var i=this.isAllowMoveNode(t,e);"boolean"==typeof i?(o=i,r=i):(o=i.x,r=i.y)}return{isAllowMoveX:o,isAllowMoveY:r}},t.prototype.move=function(t,e,n){void 0===n&&(n=!1);var o=this.isAllowMoveByXORY(t,e,n),r=o.isAllowMoveX,i=o.isAllowMoveY;return r&&(this.x=this.x+t,this.text&&this.moveText(t,0)),i&&(this.y=this.y+e,this.text&&this.moveText(0,e)),r||i},t.prototype.getMoveDistance=function(t,e,n){void 0===n&&(n=!1);var o=this.isAllowMoveByXORY(t,e,n),r=o.isAllowMoveX,i=o.isAllowMoveY,a=0,s=0;return r&&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]},t.prototype.moveTo=function(t,e,n){void 0===n&&(n=!1);var o=t-this.x,r=e-this.y;return!(!n&&!this.isAllowMoveNode(o,r))&&(this.text&&this.moveText(o,r),this.x=t,this.y=e,!0)},t.prototype.moveText=function(t,e){var n=this.text,o=n.x,r=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,editable:s,draggable:a,x:o+t,y:r+e}},t.prototype.updateText=function(t){this.text=Mx(Mx({},en(this.text)),{value:t})},t.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},t.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t,this.setIsShowAnchor(t)},t.prototype.setIsShowAnchor=function(t){void 0===t&&(t=!0),this.isShowAnchor=t},t.prototype.setRotatable=function(t){void 0===t&&(t=!0),this.rotatable=t},t.prototype.setResizable=function(t){void 0===t&&(t=!0),this.resizable=t},t.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},t.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},t.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},t.prototype.setProperty=function(t,e){var n,o=en(this.properties),r=Mx(Mx({},o),((n={})[t]=wm(e),n));this.properties=r,this.setAttributes(),this.graphModel.eventCenter.emit(Om.NODE_PROPERTIES_CHANGE,{id:this.id,keys:[t],preProperties:o,properties:r})},t.prototype.setProperties=function(t){var e=en(this.properties),n=Mx(Mx({},e),wm(t));this.properties=n,this.setAttributes();var o=[];eg(t,(function(t,n){($h(e,n)&&e[n]!==t||!$h(e,n))&&o.push(n)})),this.graphModel.eventCenter.emit(Om.NODE_PROPERTIES_CHANGE,{id:this.id,keys:o,preProperties:e,properties:n})},t.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},t.prototype.setStyle=function(t,e){var n;this.style=Mx(Mx({},this.style),((n={})[t]=wm(e),n))},t.prototype.setStyles=function(t){this.style=Mx(Mx({},this.style),wm(t))},t.prototype.updateStyles=function(t){this.style=Mx({},wm(t))},t.prototype.setZIndex=function(t){void 0===t&&(t=1),this.zIndex=t},t.prototype.updateAttributes=function(t){Ys(this,t)},t.BaseType=Cm.NODE,Ox([mt],t.prototype,"type",void 0),Ox([mt],t.prototype,"x",void 0),Ox([mt],t.prototype,"y",void 0),Ox([mt],t.prototype,"textMode",void 0),Ox([mt],t.prototype,"text",void 0),Ox([mt],t.prototype,"properties",void 0),Ox([mt],t.prototype,"_width",void 0),Ox([mt],t.prototype,"_height",void 0),Ox([mt],t.prototype,"anchorsOffset",void 0),Ox([mt],t.prototype,"isSelected",void 0),Ox([mt],t.prototype,"isHovered",void 0),Ox([mt],t.prototype,"isShowAnchor",void 0),Ox([mt],t.prototype,"isDragging",void 0),Ox([mt],t.prototype,"isHitable",void 0),Ox([mt],t.prototype,"isHittable",void 0),Ox([mt],t.prototype,"draggable",void 0),Ox([mt],t.prototype,"visible",void 0),Ox([mt],t.prototype,"rotatable",void 0),Ox([mt],t.prototype,"resizable",void 0),Ox([mt],t.prototype,"zIndex",void 0),Ox([mt],t.prototype,"state",void 0),Ox([mt],t.prototype,"autoToFront",void 0),Ox([mt],t.prototype,"style",void 0),Ox([mt],t.prototype,"transform",void 0),Ox([mt],t.prototype,"_rotate",void 0),Ox([St],t.prototype,"incoming",null),Ox([St],t.prototype,"outgoing",null),Ox([xe],t.prototype,"setTextMode",null),Ox([xe],t.prototype,"addNodeMoveRules",null),Ox([xe],t.prototype,"move",null),Ox([xe],t.prototype,"getMoveDistance",null),Ox([xe],t.prototype,"moveTo",null),Ox([xe],t.prototype,"moveText",null),Ox([xe],t.prototype,"updateText",null),Ox([xe],t.prototype,"setSelected",null),Ox([xe],t.prototype,"setHovered",null),Ox([xe],t.prototype,"setIsShowAnchor",null),Ox([xe],t.prototype,"setRotatable",null),Ox([xe],t.prototype,"setResizable",null),Ox([xe],t.prototype,"setHitable",null),Ox([xe],t.prototype,"setHittable",null),Ox([xe],t.prototype,"setElementState",null),Ox([xe],t.prototype,"setProperty",null),Ox([xe],t.prototype,"setProperties",null),Ox([xe],t.prototype,"deleteProperty",null),Ox([xe],t.prototype,"setStyle",null),Ox([xe],t.prototype,"setStyles",null),Ox([xe],t.prototype,"updateStyles",null),Ox([xe],t.prototype,"setZIndex",null),Ox([xe],t.prototype,"updateAttributes",null),t}(),Px=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dx=function(){return Dx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Dx.apply(this,arguments)},kx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Rx=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Mm.CIRCLE_NODE,o.r=50,o.setAttributes(),o}return Px(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties.r;e&&(this.r=e)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.circle,o=this.properties.style,r=void 0===o?{}:o;return Dx(Dx(Dx({},e),_d(n)),_d(r))},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.r;return[{x:e,y:n-o,id:"".concat(this.id,"_0")},{x:e+o,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o,id:"".concat(this.id,"_2")},{x:e-o,y:n,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var e=t.width,n=t.deltaX,o=t.deltaY;return this.move(n/2,o/2),this.r=e,this.setProperties({r:e}),this.getData()},kx([mt],e.prototype,"r",void 0),kx([St],e.prototype,"width",null),kx([St],e.prototype,"height",null),e}(Ax),Ix=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Lx=function(){return Lx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Lx.apply(this,arguments)},jx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Bx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Hx=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Mm.DIAMOND_NODE,o.rx=30,o.ry=50,o.setAttributes(),o}return Ix(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.rx,o=e.ry;n&&(this.rx=n),o&&(this.ry=o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.diamond,o=this.properties.style,r=void 0===o?{}:o;return Lx(Lx(Lx({},e),_d(n)),_d(r))},Object.defineProperty(e.prototype,"points",{get:function(){var t=this,e=t.x,n=t.y,o=t.rx,r=t.ry;return[[e,n-r],[e+o,n],[e,n+r],[e-o,n]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return Ih(this.points,(function(t){var e=Bx(t,2);return{x:e[0],y:e[1]}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return oh(this.points,(function(n){var o=Bx(n,1)[0];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return oh(this.points,(function(n){var o=Bx(n,2)[1];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this;return Ih(this.points,(function(e,n){var o=Bx(e,2);return{x:o[0],y:o[1],id:"".concat(t.id,"_").concat(n)}}))},e.prototype.resize=function(t){var e=t.width,n=t.height,o=t.deltaX,r=t.deltaY;return this.move(o/2,r/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},jx([mt],e.prototype,"rx",void 0),jx([mt],e.prototype,"ry",void 0),jx([St],e.prototype,"points",null),jx([St],e.prototype,"pointsPosition",null),jx([St],e.prototype,"width",null),jx([St],e.prototype,"height",null),e}(Ax),zx=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Fx=function(){return Fx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Fx.apply(this,arguments)},Wx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Gx=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Mm.ELLIPSE_NODE,o.rx=30,o.ry=45,o.setAttributes(),o}return zx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.rx,o=e.ry;n&&(this.rx=n),o&&(this.ry=o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.ellipse,o=this.properties.style,r=void 0===o?{}:o;return Fx(Fx(Fx({},e),_d(n)),_d(r))},Object.defineProperty(e.prototype,"width",{get:function(){return 2*this.rx},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 2*this.ry},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.rx,r=t.ry;return[{x:e,y:n-r,id:"".concat(this.id,"_0")},{x:e+o,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+r,id:"".concat(this.id,"_2")},{x:e-o,y:n,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var e=t.width,n=t.height,o=t.deltaX,r=t.deltaY;return this.move(o/2,r/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},Wx([mt],e.prototype,"rx",void 0),Wx([mt],e.prototype,"ry",void 0),Wx([St],e.prototype,"width",null),Wx([St],e.prototype,"height",null),e}(Ax),Xx=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ux=function(){return Ux=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Ux.apply(this,arguments)},Yx=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Vx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Kx=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Mm.POLYGON_NODE,o.points=[[50,0],[100,50],[50,100],[0,50]],o.setAttributes(),o}return Xx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.points,o=e.width,r=e.height,i=n||this.points;this.points=function(t,e,n){if(!t)return[];var o=Math.min.apply(Math,vb([],gb(t.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,vb([],gb(t.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,vb([],gb(t.map((function(t){return t[1]}))),!1)),a=Math.max.apply(Math,vb([],gb(t.map((function(t){return t[1]}))),!1)),s=-o,l=-i,u=t.map((function(t){var e=gb(t,2),n=e[0],o=e[1];return[n+s,o+l]})),c=e?e/(r-o):1,d=n?n/(a-i):1,p=Math.min(c,d);return u.map((function(t){var e=gb(t,2),n=e[0],o=e[1];return[n*p,o*p]}))}(i,o,r)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.polygon,o=this.properties.style,r=void 0===o?{}:o;return Ux(Ux(Ux({},e),_d(n)),_d(r))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var t=this,e=t.x,n=t.y,o=t.width,r=t.height;return this.points.map((function(t){return{x:t[0]+e-o/2,y:t[1]+n-r/2}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var o=Vx(n,1)[0];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var o=Vx(n,2)[1];o<t&&(t=o),o>e&&(e=o)})),e-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,e=this,n=e.x,o=e.y,r=e.width,i=e.height;return e.points.map((function(e,a){var s=Vx(e,2),l=s[0],u=s[1];return{x:n+l-r/2,y:o+u-i/2,id:"".concat(t.id,"_").concat(a)}}))},e.prototype.resize=function(t){var e=this,n=t.width,o=t.height,r=t.deltaX,i=t.deltaY;this.move(r/2,i/2);var a=Ih(this.points,(function(t){var r=Vx(t,2),i=r[0],a=r[1];return[i*n/e.width,a*o/e.height]}));return this.points=a,this.properties.points=a,this.getData()},Yx([mt],e.prototype,"points",void 0),Yx([St],e.prototype,"pointsPosition",null),Yx([St],e.prototype,"width",null),Yx([St],e.prototype,"height",null),e}(Ax),qx=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Zx=function(){return Zx=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Zx.apply(this,arguments)},$x=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Jx=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Mm.RECT_NODE,o.radius=0,o.setAttributes(),o}return qx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.width,o=e.height,r=e.radius;n&&(this.width=n),o&&(this.height=o),r&&(this.radius=r)},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.width,r=t.height;return[{x:e,y:n-r/2,id:"".concat(this.id,"_0")},{x:e+o/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+r/2,id:"".concat(this.id,"_2")},{x:e-o/2,y:n,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.rect,o=this.properties.style,r=void 0===o?{}:o;return Zx(Zx(Zx({},e),_d(n)),_d(r))},$x([mt],e.prototype,"radius",void 0),e}(Ax),Qx=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),tE=function(){return tE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},tE.apply(this,arguments)},eE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},nE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},oE=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},rE=function(t){function e(){var e=t.apply(this,oE([],nE(arguments),!1))||this;return e.modelType=Mm.TEXT_NODE,e}return Qx(e,t),e.prototype.getTextStyle=function(){var e=t.prototype.getTextStyle.call(this),n=this.graphModel.theme.text,o=this.properties.textStyle;return tE(tE(tE({},e),_d(n)),_d(o))},Object.defineProperty(e.prototype,"width",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return Kb({rows:t,fontSize:e,rowsLength:t.length}).width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return Kb({rows:t,fontSize:e,rowsLength:t.length}).height},enumerable:!1,configurable:!0}),eE([St],e.prototype,"width",null),eE([St],e.prototype,"height",null),e}(Ax),iE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),aE=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.modelType=Mm.HTML_NODE,o.setAttributes(),o}return iE(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.width,o=e.height;n&&(this.width=n),o&&(this.height=o)},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,o=t.width,r=t.height;return[{x:e,y:n-r/2,id:"".concat(this.id,"_0")},{x:e+o/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+r/2,id:"".concat(this.id,"_2")},{x:e-o/2,y:n,id:"".concat(this.id,"_3")}]},e}(Ax),sE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},lE={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},uE=["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"],cE=function(){function t(t){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.textMode=Am.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=Am.TEXT,this.edgeTextMode=Am.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="",Ys(this,this.computeConfig(t))}return t.prototype.updateEditConfig=function(t){var e=this.computeConfig(t);Ys(this,e)},t.prototype.computeConfig=function(t){var e=t.isSilentMode,n=t.textDraggable,o=t.textMode,r=t.textEdit,i=t.adjustEdgeStartAndEnd,a={};if(!1===e&&Ys(a,this.stagedConfig),!0===e&&e!==this.isSilentMode){var s=iv(lE,uE);this.stagedConfig=iv(this,uE),Ys(a,s)}Xf(r)||Ys(a,{nodeTextEdit:r,edgeTextEdit:r}),Xf(n)||Ys(a,{nodeTextDraggable:n,edgeTextDraggable:n}),o&&Ys(a,{nodeTextMode:o,edgeTextMode:o}),Of(i)&&Ys(a,{adjustEdgeStart:i,adjustEdgeEnd:i});var l=iv(t,uE);return Ys(a,l)},t.prototype.updateTextMode=function(t){this.textMode=t,this.edgeTextMode=t,this.nodeTextMode=t},t.prototype.getConfig=function(){return iv(this,uE)},sE([mt],t.prototype,"isSilentMode",void 0),sE([mt],t.prototype,"stopZoomGraph",void 0),sE([mt],t.prototype,"stopMoveGraph",void 0),sE([mt],t.prototype,"stopScrollGraph",void 0),sE([mt],t.prototype,"textMode",void 0),sE([mt],t.prototype,"textEdit",void 0),sE([mt],t.prototype,"textDraggable",void 0),sE([mt],t.prototype,"nodeTextEdit",void 0),sE([mt],t.prototype,"nodeTextDraggable",void 0),sE([mt],t.prototype,"nodeTextMultiple",void 0),sE([mt],t.prototype,"nodeTextVertical",void 0),sE([mt],t.prototype,"nodeTextMode",void 0),sE([mt],t.prototype,"edgeTextMode",void 0),sE([mt],t.prototype,"edgeTextEdit",void 0),sE([mt],t.prototype,"edgeTextDraggable",void 0),sE([mt],t.prototype,"edgeTextMultiple",void 0),sE([mt],t.prototype,"edgeTextVertical",void 0),sE([mt],t.prototype,"hideAnchors",void 0),sE([mt],t.prototype,"allowRotate",void 0),sE([mt],t.prototype,"allowResize",void 0),sE([mt],t.prototype,"hoverOutline",void 0),sE([mt],t.prototype,"nodeSelectedOutline",void 0),sE([mt],t.prototype,"adjustNodePosition",void 0),sE([mt],t.prototype,"autoExpand",void 0),sE([mt],t.prototype,"adjustEdge",void 0),sE([mt],t.prototype,"adjustEdgeMiddle",void 0),sE([mt],t.prototype,"adjustEdgeStartAndEnd",void 0),sE([mt],t.prototype,"adjustEdgeStart",void 0),sE([mt],t.prototype,"adjustEdgeEnd",void 0),sE([mt],t.prototype,"edgeSelectedOutline",void 0),sE([xe],t.prototype,"updateEditConfig",null),sE([xe],t.prototype,"updateTextMode",null),t}(),dE=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){var o=this;null==t||t.split(",").forEach((function(t){t=t.trim(),o._events[t]||(o._events[t]=[]),o._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 o=n._events[t]||[],r=n._events["*"]||[],i=function(o){for(var r=o.length,i=0;i<r;i++)if(o[i]){var a=o[i],s=a.callback;a.once&&(o.splice(i,1),0===o.length&&delete n._events[t],r--,i--),s.apply(n,[e])}};i(o),i(r)}))},t.prototype.off=function(t,e){var n=this;t||(this._events={}),t.split(",").forEach((function(t){if(e){for(var o=n._events[t]||[],r=o.length,i=0;i<r;i++)o[i].callback===e&&(o.splice(i,1),r--,i--);0===o.length&&delete n._events[t]}else delete n._events[t]}))},t.prototype.getEvents=function(){return this._events},t}(),pE=function(){return pE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},pE.apply(this,arguments)},hE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},fE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},gE=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},vE=function(){function t(t){this.modelMap=new Map,this.nodeMoveRules=[],this.nodes=[],this.edges=[],this.overlapMode=Tm.DEFAULT,this.gridSize=1,this.partial=!1;var e,n,o,r=t.container,i=t.partial,a=t.background,s=void 0===a?{}:a,l=t.grid,u=t.idGenerator,c=t.edgeGenerator,d=t.animation,p=t.customTrajectory;this.rootEl=r,this.partial=!!i,this.background=s,"object"==typeof l&&(this.gridSize=l.size||1),this.theme=nx(t.style),this.edgeType=t.edgeType||"polyline",this.animation=(e=d)&&"boolean"!=typeof e?ag(_d(_m),e):_d(!0===e?xm:_m),this.overlapMode=t.overlapMode||Tm.DEFAULT,this.width=t.width||this.rootEl.getBoundingClientRect().width,this.height=t.height||this.rootEl.getBoundingClientRect().height,this.eventCenter=new dE,this.editConfigModel=new cE(t),this.transformModel=new wE(this.eventCenter,t),this.flowId=g_(),this.idGenerator=u,this.edgeGenerator=(n=this,"function"!=typeof(o=c)?function(t,e,o){return Object.assign({type:n.edgeType},o)}:function(t,e,r){var i=o(t,e,r);return i?"string"==typeof i?Object.assign({},r,{type:i}):Object.assign({type:i},r):{type:n.edgeType}}),this.customTrajectory=p}return Object.defineProperty(t.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(t.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(t.prototype,"modelsMap",{get:function(){return gE(gE([],fE(this.nodes),!1),fE(this.edges),!1).reduce((function(t,e){return t[e.id]=e,t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sortElements",{get:function(){for(var t=gE(gE([],fE(this.nodes),!1),fE(this.edges),!1).sort((function(t,e){return t.zIndex-e.zIndex})),e=[],n=[-200,-200],o=[this.width+Pm,this.height+Pm],r=0;r<t.length;r++){var i=t[r];i.visible&&(!this.partial||i.isSelected||this.isElementInArea(i,n,o,!1,!1))&&e.push(i)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textEditElement",{get:function(){var t=this.nodes.find((function(t){return t.state===Sm.TEXT_EDIT})),e=this.edges.find((function(t){return t.state===Sm.TEXT_EDIT}));return t||e},enumerable:!1,configurable:!0}),Object.defineProperty(t.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(t.prototype,"selectNodes",{get:function(){var t=[];return this.nodes.forEach((function(e){e.isSelected&&t.push(e)})),t},enumerable:!1,configurable:!0}),t.prototype.getAreaElement=function(t,e,n,o,r){var i=this;void 0===n&&(n=!0),void 0===o&&(o=!0),void 0===r&&(r=!1);var a=[];return oh(gE(gE([],fE(this.nodes),!1),fE(this.edges),!1),(function(s){var l=i.isElementInArea(s,t,e,n,o);r&&!s.visible||!l||a.push(s)})),a},t.prototype.getModel=function(t){return this.modelMap.get(t)},t.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},t.prototype.getPointByClient=function(t){var e=t.x,n=t.y,o=this.rootEl.getBoundingClientRect(),r={x:e-o.left,y:n-o.top},i=fE(this.transformModel.HtmlPointToCanvasPoint([r.x,r.y]),2);return{domOverlayPosition:r,canvasOverlayPosition:{x:i[0],y:i[1]}}},t.prototype.isElementInArea=function(t,e,n,o,r){var i;if(void 0===o&&(o=!0),void 0===r&&(r=!0),t.BaseType===Cm.NODE){for(var a=zb(t),s=a.minX,l=a.minY,u=a.maxX,c=a.maxY,d=[{x:s,y:l},{x:u,y:l},{x:u,y:c},{x:s,y:c}],p=r,h=0;h<d.length;h++){var f=d[h],g=f.x,v=f.y;if(g=(i=fE(this.transformModel.CanvasPointToHtmlPoint([g,v]),2))[0],v=i[1],bb([g,v],e,n)!==r){p=!r;break}}return p}if(t.BaseType===Cm.EDGE){var y=t.startPoint,m=t.endPoint,b=this.transformModel.CanvasPointToHtmlPoint([y.x,y.y]),_=this.transformModel.CanvasPointToHtmlPoint([m.x,m.y]),x=bb(b,e,n),E=bb(_,e,n);return o?x&&E:x||E}return!1},t.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=Ih(t.nodes,(function(t){return e.getModelAfterSnapToGrid(t)})):this.nodes=[],t.edges){var n=this.edgeType;this.edges=Ih(t.edges,(function(t){var o,r=e.getModel(null!==(o=t.type)&&void 0!==o?o:n);if(!r)throw new Error("找不到".concat(t.type,"对应的边。"));return new r(t,e)}))}else this.edges=[]},t.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}},t.prototype.modelToHistoryData=function(){for(var t=!1,e=[],n=0;n<this.nodes.length;n++){var o=this.nodes[n];if(o.isDragging){t=!0;break}e.push(o.getHistoryData())}if(t)return!1;for(var r=!1,i=[],a=0;a<this.edges.length;a++){var s=this.edges[a];if(s.isDragging){r=!0;break}i.push(s.getHistoryData())}return!r&&{nodes:e,edges:i}},t.prototype.getEdgeModelById=function(t){var e;return null===(e=this.edgesMap[t])||void 0===e?void 0:e.model},t.prototype.getElement=function(t){return this.modelsMap[t]},t.prototype.getNodeEdges=function(t){for(var e=[],n=0;n<this.edges.length;n++){var o=this.edges[n],r=o.sourceNodeId===t,i=o.targetNodeId===t;(r||i)&&e.push(o)}return e},t.prototype.getSelectElements=function(t){void 0===t&&(t=!0);var e=this.selectElements,n={nodes:[],edges:[]};return e.forEach((function(o){if(o.BaseType===Cm.NODE&&n.nodes.push(o.getData()),o.BaseType===Cm.EDGE){var r=o.getData(),i=e.get(r.sourceNodeId)&&e.get(r.targetNodeId);(t||i)&&n.edges.push(r)}})),n},t.prototype.updateAttributes=function(t,e){var n=this.getElement(t);null==n||n.updateAttributes(e)},t.prototype.changeNodeId=function(t,e){return e||(e=g_()),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,", 修改失败")),"")},t.prototype.changeEdgeId=function(t,e){return e||(e=g_()),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,", 修改失败")),"")},t.prototype.getTextModel=function(t){var e=this.editConfigModel,n=e.textMode,o=e.nodeTextMode,r=e.edgeTextMode;return t.BaseType===Cm.NODE?t.textMode||o||n||Am.TEXT:t.BaseType===Cm.EDGE?t.textMode||r||n||Am.TEXT:void 0},t.prototype.setTextMode=function(t,e){this.editConfigModel.updateEditConfig({textMode:t})},t.prototype.setFakeNode=function(t){this.fakeNode=t},t.prototype.removeFakeNode=function(){this.fakeNode=null},t.prototype.setModel=function(t,e){return this.modelMap.set(t,e)},t.prototype.toFront=function(t){var e,n,o,r=(null===(e=this.nodesMap[t])||void 0===e?void 0:e.model)||(null===(n=this.edgesMap[t])||void 0===n?void 0:n.model);r&&(this.overlapMode===Tm.DEFAULT&&(null===(o=this.topElement)||void 0===o||o.setZIndex(),r.setZIndex(9999),this.topElement=r),this.overlapMode===Tm.INCREASE&&this.setElementZIndex(t,"top"))},t.prototype.setElementZIndex=function(t,e){var n,o,r=(null===(n=this.nodesMap[t])||void 0===n?void 0:n.model)||(null===(o=this.edgesMap[t])||void 0===o?void 0:o.model);if(r){var i=void 0;"number"==typeof e?i=e:("top"===e&&(i=ax()),"bottom"===e&&(i=--ix)),r.setZIndex(i)}},t.prototype.deleteNode=function(t){var e=this.nodesMap[t].model.getData();this.deleteEdgeBySource(t),this.deleteEdgeByTarget(t),this.nodes.splice(this.nodesMap[t].index,1),this.eventCenter.emit(Om.NODE_DELETE,{data:e})},t.prototype.addNode=function(t,e,n){void 0===e&&(e=Om.NODE_ADD);var o=wm(t),r=o.id;r&&this.nodesMap[r]&&delete o.id;var i=this.getModelAfterSnapToGrid(o);this.nodes.push(i);var a={data:i.getData()};return n&&(a.e=n),this.eventCenter.emit(e,a),i},t.prototype.getModelAfterSnapToGrid=function(t){var e=this.getModel(t.type);if(!e)throw new Error("找不到".concat(t.type,"对应的节点,请确认是否已注册此类型节点。"));var n=t.x,o=t.y;return n&&o&&(t.x=yb(n,this.gridSize),t.y=yb(o,this.gridSize),"object"==typeof t.text&&null!==t.text&&(t.text.x+=t.x-n,t.text.y+=t.y-o)),new e(t,this)},t.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="","object"==typeof n.text&&null!==n.text&&(n.text.x+=30,n.text.y+=30);var o=this.addNode(n);return o.setSelected(!0),null==e||e.setSelected(!1),o.getData()}},t.prototype.moveNode=function(t,e,n,o){var r;void 0===o&&(o=!1);var i=this.nodesMap[t];if(i){var a=i.model;e=(r=fE(a.getMoveDistance(e,n,o),2))[0],n=r[1],this.moveEdge(t,e,n)}else console.warn("不存在id为".concat(t,"的节点"))},t.prototype.moveNode2Coordinate=function(t,e,n,o){void 0===o&&(o=!1);var r=this.nodesMap[t];if(r){var i=r.model,a=e-i.x,s=n-i.y;this.moveNode(t,a,s,o)}else console.warn("不存在id为".concat(t,"的节点"))},t.prototype.editText=function(t){this.setElementStateById(t,Sm.TEXT_EDIT)},t.prototype.addEdge=function(t){var e=wm(t),n=e.type;n||(n=this.edgeType),e.id&&this.edgesMap[e.id]&&delete e.id;var o=this.getModel(n);if(!o)throw new Error("找不到".concat(n,"对应的边,请确认是否已注册此类型边。"));var r=new o(pE(pE({},e),{type:n}),this),i=r.getData();return this.edges.push(r),this.eventCenter.emit(Om.EDGE_ADD,{data:i}),r},t.prototype.moveEdge=function(t,e,n){for(var o=0;o<this.edges.length;o++){var r=this.edges[o],i=r.textPosition,a=i.x,s=i.y,l=this.edges[o].sourceNodeId===t,u=this.edges[o].targetNodeId===t;l&&r.moveStartPoint(e,n),u&&r.moveEndPoint(e,n),(l||u)&&this.handleEdgeTextMove(r,a,s)}},t.prototype.handleEdgeTextMove=function(t,e,n){var o;if(t.customTextPosition)t.resetTextPosition();else{if(t.modelType===Mm.POLYLINE_EDGE&&(null===(o=t.text)||void 0===o?void 0:o.value)){var r=t.text,i=hb(r,t.points);t.moveText(i.x-r.x,i.y-r.y)}var a=t.textPosition,s=a.x,l=a.y;t.moveText(s-e,l-n)}},t.prototype.deleteEdgeBySourceAndTarget=function(t,e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===t&&this.edges[n].targetNodeId===e){var o=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(Om.EDGE_DELETE,{data:o})}},t.prototype.deleteEdgeById=function(t){if(this.edgesMap[t]){var e=this.edgesMap[t].index,n=this.edgesMap[t].model.getData();this.edges.splice(e,1),this.eventCenter.emit(Om.EDGE_DELETE,{data:n})}},t.prototype.deleteEdgeBySource=function(t){for(var e=0;e<this.edges.length;e++)if(this.edges[e].sourceNodeId===t){var n=this.edges[e].getData();this.edges.splice(e,1),e--,this.eventCenter.emit(Om.EDGE_DELETE,{data:n})}},t.prototype.deleteEdgeByTarget=function(t){for(var e=0;e<this.edges.length;e++)if(this.edges[e].targetNodeId===t){var n=this.edges[e].getData();this.edges.splice(e,1),e--,this.eventCenter.emit(Om.EDGE_DELETE,{data:n})}},t.prototype.setElementStateById=function(t,e,n){this.nodes.forEach((function(o){o.id===t?o.setElementState(e,n):o.setElementState(Sm.DEFAULT)})),this.edges.forEach((function(o){o.id===t?o.setElementState(e,n):o.setElementState(Sm.DEFAULT)}))},t.prototype.updateText=function(t,e){var n=Oh(gE(gE([],fE(this.nodes),!1),fE(this.edges),!1),(function(e){return e.id===t}));null==n||n.updateText(e)},t.prototype.selectNodeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var o=null===(n=this.nodesMap[t])||void 0===n?void 0:n.model;null==o||o.setSelected(!0)},t.prototype.selectEdgeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var o=null===(n=this.edgesMap[t])||void 0===n?void 0:n.model;null==o||o.setSelected(!0)},t.prototype.selectElementById=function(t,e){void 0===e&&(e=!1),e||this.clearSelectElements();var n=this.getElement(t);null==n||n.setSelected(!0)},t.prototype.clearSelectElements=function(){var t;this.selectElements.forEach((function(t){null==t||t.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===Tm.DEFAULT&&(null===(t=this.topElement)||void 0===t||t.setZIndex())},t.prototype.moveNodes=function(t,e,n,o){var r,i,a,s=this;void 0===o&&(o=!1);for(var l=t.reduce((function(t,r){var i=s.nodesMap[r].model;return t[r]=i.getMoveDistance(e,n,o),t}),{}),u=0;u<this.edges.length;u++){var c=this.edges[u],d=c.textPosition,p=d.x,h=d.y,f=l[c.sourceNodeId],g=l[c.targetNodeId],v=void 0,y=void 0;f&&g&&c.modelType===Mm.POLYLINE_EDGE?(v=(r=fE(f,2))[0],y=r[1],c.updatePointsList(v,y)):(f&&(v=(i=fE(f,2))[0],y=i[1],c.moveStartPoint(v,y)),g&&(v=(a=fE(g,2))[0],y=a[1],c.moveEndPoint(v,y))),(f||g)&&this.handleEdgeTextMove(c,p,h)}},t.prototype.addNodeMoveRules=function(t){this.nodeMoveRules.includes(t)||this.nodeMoveRules.push(t)},t.prototype.setDefaultEdgeType=function(t){this.edgeType=t},t.prototype.changeNodeType=function(t,e){var n=this.getNodeModelById(t);if(n){var o=n.getData();o.type=e;var r=this.getModel(e);if(!r)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));var i=new r(o,this);this.nodes.splice(this.nodesMap[t].index,1,i),this.getNodeEdges(t).forEach((function(e){if(e.sourceNodeId===t){var n=Yb(i,e.startPoint,i.width,i.height);e.updateStartPoint(n)}if(e.targetNodeId===t){n=Yb(i,e.endPoint,i.width,i.height);e.updateEndPoint(n)}}))}else console.warn("找不到id为".concat(t,"的节点"))},t.prototype.changeEdgeType=function(t,e){var n=this.getEdgeModelById(t);if(n){if(n.type!==e){var o=n.getData();o.type=e;var r=this.getModel(e);if(!r)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));delete o.pointsList;var i=new r(o,this);this.edges.splice(this.edgesMap[t].index,1,i)}}else console.warn("找不到id为".concat(t,"的边"))},t.prototype.getNodeIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetNodeId===t&&e.push(n)})),e},t.prototype.getNodeOutgoingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceNodeId===t&&e.push(n)})),e},t.prototype.getAnchorIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetAnchorId===t&&e.push(n)})),e},t.prototype.getAnchorOutcomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceAnchorId===t&&e.push(n)})),e},t.prototype.getNodeIncomingNode=function(t){var e=this,n=[];return this.edges.forEach((function(o){var r;o.targetNodeId===t&&n.push(null===(r=e.nodesMap[o.sourceNodeId])||void 0===r?void 0:r.model)})),n},t.prototype.getNodeOutgoingNode=function(t){var e=this,n=[];return this.edges.forEach((function(o){o.sourceNodeId===t&&n.push(e.nodesMap[o.targetNodeId].model)})),n},t.prototype.setTheme=function(t){this.theme=ox(pE(pE({},this.theme),t))},t.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")},t.prototype.clearData=function(){this.nodes=[],this.edges=[]},t.prototype.getVirtualRectSize=function(){var t=this.nodes,e=[],n=[];t.forEach((function(t){var o=t.x,r=t.y,i=t.width,a=t.height,s=t.getNodeStyle().strokeWidth,l=void 0===s?0:s,u=o+i/2+l,c=o-i/2-l,d=r+a/2+l,p=r-a/2-l;e=e.concat([u,c].filter((function(t){return!Number.isNaN(t)}))),n=n.concat([d,p].filter((function(t){return!Number.isNaN(t)})))}));var o=Math.min.apply(Math,gE([],fE(e),!1)),r=Math.max.apply(Math,gE([],fE(e),!1)),i=Math.min.apply(Math,gE([],fE(n),!1)),a=r-o||0,s=Math.max.apply(Math,gE([],fE(n),!1))-i||0;return{width:a,height:s,x:o+a/2,y:i+s/2}},t.prototype.translateCenter=function(){var t=this,e=t.nodes,n=t.width,o=t.height,r=t.rootEl,i=t.transformModel;if(e.length){var a=n||r.clientWidth,s=o||r.clientHeight,l=this.getVirtualRectSize(),u=l.x,c=l.y;i.focusOn(u,c,a,s)}},t.prototype.fitView=function(t,e){void 0===t&&(t=20),void 0===e&&(e=20);var n=this,o=n.nodes,r=n.width,i=n.height,a=n.rootEl,s=n.transformModel;if(o.length){var l=r||a.clientWidth,u=i||a.clientHeight,c=this.getVirtualRectSize(),d=c.width,p=c.height,h=c.x,f=c.y,g=(d+e)/l,v=(p+t)/u,y=1/Math.max(g,v),m=[l/2,u/2];s.zoom(y,m),s.focusOn(h,f,l,u)}},t.prototype.openEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.openEdgeAnimation()},t.prototype.closeEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.closeEdgeAnimation()},t.prototype.getPartial=function(){return this.partial},t.prototype.setPartial=function(t){this.partial=t},hE([mt],t.prototype,"width",void 0),hE([mt],t.prototype,"height",void 0),hE([mt],t.prototype,"edgeType",void 0),hE([mt],t.prototype,"nodes",void 0),hE([mt],t.prototype,"edges",void 0),hE([mt],t.prototype,"fakeNode",void 0),hE([mt],t.prototype,"overlapMode",void 0),hE([mt],t.prototype,"background",void 0),hE([mt],t.prototype,"gridSize",void 0),hE([mt],t.prototype,"transformModel",void 0),hE([mt],t.prototype,"editConfigModel",void 0),hE([mt],t.prototype,"partial",void 0),hE([St],t.prototype,"nodesMap",null),hE([St],t.prototype,"edgesMap",null),hE([St],t.prototype,"modelsMap",null),hE([St],t.prototype,"sortElements",null),hE([St],t.prototype,"textEditElement",null),hE([St],t.prototype,"selectElements",null),hE([St],t.prototype,"selectNodes",null),hE([xe],t.prototype,"setTextMode",null),hE([xe],t.prototype,"setFakeNode",null),hE([xe],t.prototype,"removeFakeNode",null),hE([xe],t.prototype,"setModel",null),hE([xe],t.prototype,"toFront",null),hE([xe],t.prototype,"setElementZIndex",null),hE([xe],t.prototype,"deleteNode",null),hE([xe],t.prototype,"addNode",null),hE([xe],t.prototype,"cloneNode",null),hE([xe],t.prototype,"moveNode",null),hE([xe],t.prototype,"moveNode2Coordinate",null),hE([xe],t.prototype,"editText",null),hE([xe],t.prototype,"addEdge",null),hE([xe],t.prototype,"moveEdge",null),hE([xe],t.prototype,"deleteEdgeBySourceAndTarget",null),hE([xe],t.prototype,"deleteEdgeById",null),hE([xe],t.prototype,"deleteEdgeBySource",null),hE([xe],t.prototype,"deleteEdgeByTarget",null),hE([xe],t.prototype,"setElementStateById",null),hE([xe],t.prototype,"updateText",null),hE([xe],t.prototype,"selectNodeById",null),hE([xe],t.prototype,"selectEdgeById",null),hE([xe],t.prototype,"selectElementById",null),hE([xe],t.prototype,"clearSelectElements",null),hE([xe],t.prototype,"moveNodes",null),hE([xe],t.prototype,"setDefaultEdgeType",null),hE([xe],t.prototype,"changeNodeType",null),hE([xe],t.prototype,"changeEdgeType",null),hE([xe],t.prototype,"getNodeIncomingEdge",null),hE([xe],t.prototype,"getNodeOutgoingEdge",null),hE([xe],t.prototype,"getAnchorIncomingEdge",null),hE([xe],t.prototype,"getAnchorOutcomingEdge",null),hE([xe],t.prototype,"getNodeIncomingNode",null),hE([xe],t.prototype,"getNodeOutgoingNode",null),hE([xe],t.prototype,"setTheme",null),hE([xe],t.prototype,"resize",null),hE([xe],t.prototype,"clearData",null),hE([xe],t.prototype,"translateCenter",null),hE([xe],t.prototype,"fitView",null),hE([xe],t.prototype,"openEdgeAnimation",null),hE([xe],t.prototype,"closeEdgeAnimation",null),hE([xe],t.prototype,"setPartial",null),t}(),yE=function(){return yE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},yE.apply(this,arguments)},mE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},bE=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 yE({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(t,e){for(var n=t.x,o=t.y,r=!1,i=!1,a=0;a<e.length;a++){var s=e[a];if(s.id!==t.id&&(n===s.x&&(r=!0),o===s.y&&(i=!0),r&&i))break}return{isShowVertical:r,isShowHorizontal:i,position:{x:n,y:o}}},t.prototype.getHorizontalSnapline=function(t,e){var n,o=!1,r=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=zb(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=zb(s))}}for(var l=0;l<e.length;l++){var u=e[l];if(u.id!==t.id){var c=zb(u);if(c.minY===(null==n?void 0:n.minY)||c.maxY===(null==n?void 0:n.minY)){o=!0,r=n.minY;break}if(c.minY===(null==n?void 0:n.maxY)||c.maxY===(null==n?void 0:n.maxY)){o=!0,r=n.maxY;break}}}return{isShowHorizontal:o,isShowVertical:this.isShowVertical,position:yE(yE({},this.position),{y:r})}},t.prototype.getVerticalSnapline=function(t,e){var n,o=!1,r=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=zb(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=zb(s))}}for(var l=0;l<e.length;l++){var u=e[l];if(u.id!==t.id){var c=zb(u);if(c.minX===(null==n?void 0:n.minX)||c.maxX===(null==n?void 0:n.minX)){o=!0,r=n.minX;break}if(c.minX===(null==n?void 0:n.maxX)||c.maxX===(null==n?void 0:n.maxX)){o=!0,r=n.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:o,position:yE(yE({},this.position),{x:r})}},t.prototype.getSnapLinePosition=function(t,e){var n=this.getCenterSnapLine(t,e),o=n.isShowHorizontal,r=n.isShowVertical;if(!o){var i=this.getHorizontalSnapline(t,e);i.isShowHorizontal&&(n.isShowHorizontal=i.isShowHorizontal,n.position.y=i.position.y)}if(!r){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,o=t.position;this.position=o,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)},mE([mt],t.prototype,"isShowHorizontal",void 0),mE([mt],t.prototype,"isShowVertical",void 0),mE([mt],t.prototype,"position",void 0),mE([xe],t.prototype,"clearSnapline",null),mE([xe],t.prototype,"setNodeSnapLine",null),t}(),_E=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},xE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},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]},wE=function(){function t(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,o=void 0!==n&&n;this.updateTranslateLimits(o)}return t.prototype.setZoomMiniSize=function(t){this.MINI_SCALE_SIZE=t},t.prototype.setZoomMaxSize=function(t){this.MAX_SCALE_SIZE=t},t.prototype.HtmlPointToCanvasPoint=function(t){var e=xE(t,2),n=e[0],o=e[1];return[(n-this.TRANSLATE_X)/this.SCALE_X,(o-this.TRANSLATE_Y)/this.SCALE_Y]},t.prototype.CanvasPointToHtmlPoint=function(t){var e=xE(t,2),n=e[0],o=e[1];return[n*this.SCALE_X+this.TRANSLATE_X,o*this.SCALE_Y+this.TRANSLATE_Y]},t.prototype.moveCanvasPointByHtml=function(t,e,n){var o=xE(t,2),r=o[0],i=o[1];return[r+e/this.SCALE_X,i+n/this.SCALE_Y]},t.prototype.fixDeltaXY=function(t,e){return[t/this.SCALE_X,e/this.SCALE_Y]},t.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,")")}},t.prototype.zoom=function(t,e){void 0===t&&(t=!1);var n=this.SCALE_X,o=this.SCALE_Y;return"number"==typeof t?(n=t,o=t):t?(n+=this.ZOOM_SIZE,o+=this.ZOOM_SIZE):(n-=this.ZOOM_SIZE,o-=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-=(o-this.SCALE_Y)*e[1]),this.SCALE_X=n,this.SCALE_Y=o,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")},t.prototype.emitGraphTransform=function(t){this.eventCenter.emit(Om.GRAPH_TRANSFORM,{type:t,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}})},t.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},t.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")},t.prototype.focusOn=function(t,e,n,o){var r=xE(this.CanvasPointToHtmlPoint([t,e]),2),i=r[0],a=r[1],s=xE([n/2-i,o/2-a],2),l=s[0],u=s[1];this.TRANSLATE_X+=l,this.TRANSLATE_Y+=u,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(t){var e;e=xE(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]},_E([mt],t.prototype,"SCALE_X",void 0),_E([mt],t.prototype,"SKEW_Y",void 0),_E([mt],t.prototype,"SKEW_X",void 0),_E([mt],t.prototype,"SCALE_Y",void 0),_E([mt],t.prototype,"TRANSLATE_X",void 0),_E([mt],t.prototype,"TRANSLATE_Y",void 0),_E([mt],t.prototype,"ZOOM_SIZE",void 0),_E([xe],t.prototype,"zoom",null),_E([xe],t.prototype,"resetZoom",null),_E([xe],t.prototype,"translate",null),_E([xe],t.prototype,"focusOn",null),t}(),SE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),CE=function(){return CE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},CE.apply(this,arguments)},ME=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},OE=function(t){function e(e){var n=t.call(this)||this;n.stepScrollX=0,n.stepScrollY=0,n.onDragging=function(t){var e=t.deltaX,o=t.deltaY;n.setState({isDragging:!0});var r=n.props.graphModel,i=r.transformModel;!0!==r.editConfigModel.stopMoveGraph&&i.translate(e,o)},n.onDragEnd=function(){n.setState({isDragging:!1})},n.zoomHandler=function(t){var e=n.props,o=e.graphModel,r=o.editConfigModel,i=o.transformModel,a=o.gridSize,s=e.graphModel,l=t.deltaX,u=t.deltaY;if(r.stopScrollGraph||t.ctrlKey||t.metaKey){if(!r.stopZoomGraph){t.preventDefault();var c=s.getPointByClient({x:t.clientX,y:t.clientY}).canvasOverlayPosition,d=c.x,p=c.y;i.zoom(t.deltaY<0,[d,p])}}else{if(t.preventDefault(),n.stepScrollX+=l,n.stepScrollY+=u,Math.abs(n.stepScrollX)>=a){var h=n.stepScrollX%a,f=n.stepScrollX-h;i.translate(-f*i.SCALE_X,0),n.stepScrollX=h}if(Math.abs(n.stepScrollY)>=a){var g=n.stepScrollY%a,v=n.stepScrollY-g;i.translate(0,-v*i.SCALE_Y),n.stepScrollY=g}}},n.clickHandler=function(t){if("canvas-overlay"===t.target.getAttribute("name")){var e=n.props.graphModel;e.selectElements.size>0&&e.clearSelectElements(),e.eventCenter.emit(Om.BLANK_CLICK,{e:t})}},n.handleContextMenu=function(t){if("canvas-overlay"===t.target.getAttribute("name")){t.preventDefault();var e=n.props.graphModel,o=e.getPointByClient({x:t.clientX,y:t.clientY});e.eventCenter.emit(Om.BLANK_CONTEXTMENU,{e:t,position:o})}},n.mouseDownHandler=function(t){var e=n.props.graphModel,o=e.eventCenter,r=e.editConfigModel,i=e.transformModel.SCALE_X,a=e.gridSize,s=t.target,l=!r.adjustEdge&&!r.adjustNodePosition;("canvas-overlay"===s.getAttribute("name")||l)&&(!0!==r.stopMoveGraph?(n.stepDrag.setStep(a*i),n.stepDrag.handleMouseDown(t)):o.emit(Om.BLANK_MOUSEDOWN,{e:t}),n.clickHandler(t))};var o=e.graphModel,r=o.gridSize,i=o.eventCenter;return n.stepDrag=new Dm({onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:r,eventType:"BLANK",isStopPropagation:!1,eventCenter:i,model:void 0}),n.state={isDragging:!1},n}return SE(e,t),e.prototype.render=function(){var t=this.props.graphModel.transformModel.getTransformStyle().transform,e=this.props,n=e.children,o=e.dnd,r=this.state.isDragging;return xr("svg",CE({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:r?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},o.eventMap(),{children:xr("g",{transform:t,children:n})}))},e=ME([yC],e)}(ho),TE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),NE=function(){return NE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},NE.apply(this,arguments)},AE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},PE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},DE=function(t){function e(){var e=t.call(this)||this;return e.onDragging=function(t){var n=t.event,o=e.props,r=o.graphModel,i=o.bezierModel,a=o.type,s=r.getPointByClient({x:n.clientX,y:n.clientY}).canvasOverlayPosition,l=s.x,u=s.y;i.updateAdjustAnchor({x:l,y:u},a),r.eventCenter.emit(Om.EDGE_ADJUST,{data:i.getData()})},e.onDragEnd=function(){e.props.bezierModel.isDragging=!1},e.dragHandler=new Dm({onDragging:e.onDragging,onDragEnd:e.onDragEnd}),e}return TE(e,t),e.prototype.render=function(){var t=this,e=this.props.position,n=e.x,o=e.y,r=this.props.bezierModel.getEdgeStyle().adjustAnchor;return xr(k_,NE({className:"lf-bezier-adjust-anchor",x:n,y:o},r,{onMouseDown:function(e){t.dragHandler.handleMouseDown(e)}}))},e}(ho),kE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return TE(e,t),e.prototype.getBezierAdjust=function(t,e){var n=t.path,o=t.id,r=cb(n),i=PE(r,4),a=i[0],s=i[1],l=i[2],u=i[3],c=t.getEdgeStyle().adjustLine,d=[];return d.push(xr(S_,NE({x1:a.x,y1:a.y,x2:s.x,y2:s.y},c))),d.push(xr(DE,{position:s,bezierModel:t,graphModel:e,type:"sNext"},"".concat(o,"_ePre"))),d.push(xr(S_,NE({x1:u.x,y1:u.y,x2:l.x,y2:l.y},c))),d.push(xr(DE,{position:l,bezierModel:t,graphModel:e,type:"ePre"},"".concat(o,"_sNext"))),d},e.prototype.selectedBezierEdge=function(){for(var t=this.props.graphModel,e=t.edges,n=[],o=0;o<e.length;o++){var r=e[o];r.isSelected&&r.modelType===Mm.BEZIER_EDGE&&r.draggable&&n.push(this.getBezierAdjust(r,t))}return n},e.prototype.render=function(){return xr("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},e=AE([yC],e)}(ho),RE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),IE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return RE(e,t),e.prototype.render=function(){return xr("div",{className:"lf-background",children:xr("div",{style:this.props.background,className:"lf-background-area"})})},e}(ho),LE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),jE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},BE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},HE=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},zE=function(t){function e(){var e=t.apply(this,HE([],BE(arguments),!1))||this;return e.id=g_(),e}return LE(e,t),e.prototype.renderDot=function(){var t=this.props,e=t.config,n=t.size,o=void 0===n?1:n,r=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,l=void 0===s?2:s,u=Math.min(Math.max(2,l),o/4);return xr("g",{fill:a,opacity:r?1:0,children:[xr("circle",{cx:0,cy:0,r:u/2}),xr("circle",{cx:0,cy:o,r:u/2}),xr("circle",{cx:o,cy:0,r:u/2}),xr("circle",{cx:o,cy:o,r:u/2})]})},e.prototype.renderMesh=function(){var t=this.props,e=t.config,n=t.size,o=void 0===n?1:n,r=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,l=void 0===s?1:s,u=Math.min(Math.max(1,l),o/2);return xr("path",{d:"M 0 0 H ".concat(o," V ").concat(o," H 0 Z"),stroke:a,strokeWidth:u,opacity:r?1:0,fill:"transparent"})},e.prototype.render=function(){var t=this.props,e=t.type,n=t.size,o=void 0===n?1:n,r=t.graphModel.transformModel,i=[r.SCALE_X,r.SKEW_Y,r.SKEW_X,r.SCALE_Y,r.TRANSLATE_X,r.TRANSLATE_Y].join(","),a="matrix(".concat(i,")");return xr("div",{className:"lf-grid",children:xr("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[xr("defs",{children:xr("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:a,x:"0",y:"0",width:o,height:o,children:["dot"===e&&this.renderDot(),"mesh"===e&&this.renderMesh()]})}),xr("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=jE([yC],e)}(ho);!function(t){t.defaultProps={size:10,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}},t.getGridOptions=function(e){var n=_d(t.defaultProps);return Ys(n,"number"==typeof e?{size:e}:"boolean"==typeof e?{visible:e}:e)}}(zE||(zE={}));var FE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),WE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},GE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return FE(e,t),e.prototype.render=function(){return xr("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:xr("g",{transform:this.props.graphModel.transformModel.getTransformStyle().transform,children:this.props.children})})},e=WE([yC],e)}(ho),XE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),UE=function(){return UE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},UE.apply(this,arguments)},YE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},VE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return XE(e,t),e.prototype.getNodesOutline=function(){var t=this.props.graphModel,e=t.nodes,n=t.editConfigModel,o=n.hoverOutline,r=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,l=t.width,u=t.height;if(r&&n||o&&e){var c=t.getOutlineStyle(),d={};if(Object.keys(c).forEach((function(t){"hover"!==t&&(d[t]=c[t])})),e){var p=c.hover;d=UE(UE({},d),p)}i.push(xr(O_,UE({transform:t.transform,className:"lf-outline-node",x:a,y:s,width:l+10,height:u+10},d)))}}})),i},e.prototype.getEdgeOutline=function(){for(var t=this.props.graphModel,e=t.edges,n=t.editConfigModel,o=n.edgeSelectedOutline,r=n.hoverOutline,i=[],a=0;a<e.length;a++){var s=e[a];(o&&s.isSelected||r&&s.isHovered)&&(s.modelType===Mm.LINE_EDGE?i.push(this.getLineOutline(s)):s.modelType===Mm.POLYLINE_EDGE?i.push(this.getPolylineOutline(s)):s.modelType===Mm.BEZIER_EDGE&&i.push(this.getBezierOutline(s)))}return i},e.prototype.getLineOutline=function(t){var e=t.startPoint,n=t.endPoint,o=(e.x+n.x)/2,r=(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 xr(O_,UE({className:"lf-outline-edge",x:o,y:r,width:i,height:a},s))},e.prototype.getPolylineOutline=function(t){var e=t.points,n=ib(e),o=Gm(n,8),r=o.x,i=o.y,a=o.width,s=o.height,l=t.getOutlineStyle();return xr(O_,UE({className:"lf-outline",x:r,y:i,width:a,height:s},l))},e.prototype.getBezierOutline=function(t){var e=t.path,n=cb(e),o=Gm(n,8),r=o.x,i=o.y,a=o.width,s=o.height,l=t.getOutlineStyle();return xr(O_,UE({className:"lf-outline",x:r,y:i,width:a,height:s},l))},e.prototype.render=function(){return xr("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},e=YE([yC],e)}(ho),KE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),qE=function(){return qE=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},qE.apply(this,arguments)},ZE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},$E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return KE(e,t),e.prototype.render=function(){var t=this.props.snaplineModel,e=null!=t?t:{},n=e.position,o=e.isShowHorizontal,r=e.isShowVertical,i=null==t?void 0:t.getStyle(),a=null!=n?n:{},s=a.x,l=void 0===s?0:s,u=a.y,c=void 0===u?0:u,d=qE(qE({x1:-1e5,y1:c,x2:1e5,y2:c},i),{stroke:o?null==i?void 0:i.stroke:"none"}),p=qE(qE({x1:l,y1:-1e5,x2:l,y2:1e5},i),{stroke:r?null==i?void 0:i.stroke:"none"});return xr("g",{className:"lf-snapline",children:[xr(S_,qE({},d)),xr(S_,qE({},p))]})},e=ZE([yC],e)}(ho),JE=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),QE=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},tw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return JE(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,o=n.textEditElement,r=e.getTools().map((function(t){return uo(t,{textEditElement:o,graphModel:n,lf:e.instance})}));return e.components=r,r},e.prototype.triggerToolRender=function(){var t=this.props,e=t.tool,n=t.graphModel,o=document.querySelector("#ToolOverlay_".concat(n.flowId)),r=e.getInstance();r.components.forEach((function(t){return t(r,o)})),r.components=[]},e.prototype.render=function(){var t=this.props.graphModel;return xr("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(t.flowId),children:this.getTools()})},e=QE([yC],e)}(ho),ew=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),nw=function(){return nw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},nw.apply(this,arguments)},ow=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},rw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},iw=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},aw=function(t){function e(){var e=t.apply(this,iw([],rw(arguments),!1))||this;return e.handleResize=function(){e.props.graphModel.resize()},e}return ew(e,t),e.prototype.componentDidMount=function(){window.addEventListener("resize",hy(this.handleResize,200))},e.prototype.componentDidUpdate=function(){var t=this.props.graphModel.modelToGraphData();this.props.graphModel.eventCenter.emit(Om.GRAPH_UPDATED,{data:t})},e.prototype.componentWillUnmount=function(){window.removeEventListener("resize",hy(this.handleResize,200))},e.prototype.getComponent=function(t,e,n){void 0===n&&(n="canvas-overlay");var o=(0,this.props.getView)(t.type);return o?xr(o,{model:t,graphModel:e,overlay:n},t.id):null},e.prototype.render=function(){var t=this,e=this.props,n=e.graphModel,o=e.tool,r=e.options,i=e.dnd,a=e.snaplineModel;r.width&&"".concat(n.width,"px"),r.height&&"".concat(n.height,"px");var s=r.grid&&zE.getGridOptions(r.grid),l=n.fakeNode,u=n.editConfigModel.adjustEdge;return xr("div",{className:"lf-graph","flow-id":n.flowId,children:[xr(OE,{graphModel:n,dnd:i,children:[xr("g",{className:"lf-base",children:Ih(n.sortElements,(function(e){return t.getComponent(e,n)}))}),l?this.getComponent(l,n):""]}),xr(GE,{graphModel:n,children:[xr(VE,{graphModel:n}),u?xr(kE,{graphModel:n}):"",!1!==r.snapline?xr($E,{snaplineModel:a}):""]}),xr(tw,{graphModel:n,tool:o}),r.background&&xr(IE,{background:r.background}),s&&xr(zE,nw({},s,{graphModel:n}))]})},e=ow([yC],e)}(ho),sw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),lw=function(){return lw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},lw.apply(this,arguments)},uw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},cw=function(t){function e(){var e=t.call(this)||this;return e.onDragStart=function(t){var n=t.event,o=e.props,r=o.anchorData,i=o.nodeModel,a=o.graphModel;a.selectNodeById(i.id),i.autoToFront&&a.toFront(i.id),a.eventCenter.emit(Om.ANCHOR_DRAGSTART,{data:r,e:n,nodeModel:i}),e.setState({startX:r.x,startY:r.y,endX:r.x,endY:r.y})},e.onDragging=function(t){var n=t.event,o=e.props,r=o.graphModel,i=o.nodeModel,a=o.anchorData,s=r.transformModel,l=r.eventCenter,u=r.width,c=r.height,d=r.editConfigModel,p=d.autoExpand,h=d.stopMoveGraph;if(n){var f=n.clientX,g=n.clientY,v=r.getPointByClient({x:f,y:g}),y=v.domOverlayPosition,m=y.x,b=y.y,_=v.canvasOverlayPosition,x=_.x,E=_.y;e.t&&m_(e.t);var w=[];m<10?w=[10,0]:m+10>u?w=[-10,0]:b<10?w=[0,10]:b+10>c&&(w=[0,-10]),e.setState({endX:x,endY:E,dragging:!0}),e.moveAnchorEnd(x,E),w.length>0&&!h&&p&&(e.t=y_((function(){var t=uw(w,2),n=t[0],o=t[1];s.translate(n,o);var r=e.state,i=r.endX,a=r.endY;e.setState({endX:i-n,endY:a-o}),e.moveAnchorEnd(i-n,a-o)}))),l.emit(Om.ANCHOR_DRAG,{data:a,e:n,nodeModel:i})}},e.onDragEnd=function(t){var n=t.event;e.t&&m_(e.t);var o=e.checkEnd(n);e.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),e.sourceRuleResults.clear(),e.targetRuleResults.clear();var r=e.props,i=r.graphModel,a=r.nodeModel,s=r.anchorData;o&&i.eventCenter.emit(Om.ANCHOR_DRAGEND,{data:s,e:n,nodeModel:a,edgeModel:o})},e.checkEnd=function(t){var n,o=e.props,r=o.graphModel,i=o.nodeModel,a=o.anchorData,s=a.x,l=a.y,u=a.id,c=e.state,d=c.endX,p=c.endY,h=c.dragging,f=Ib({x:d,y:p},r);if(e.preTargetNode&&e.preTargetNode.state!==Sm.DEFAULT&&e.preTargetNode.setElementState(Sm.DEFAULT),h&&f&&f.node){var g=f.node,v=f.anchor.id,y="".concat(i.id,"_").concat(g.id,"_").concat(v,"_").concat(u),m=e.sourceRuleResults.get(y)||{},b=m.isAllPass,_=m.msg,x=e.targetRuleResults.get(y)||{},E=x.isAllPass,w=x.msg;if(b&&E){g.setElementState(Sm.DEFAULT);var S=r.getNodeModelById(f.node.id),C=null===(n=r.edgeGenerator)||void 0===n?void 0:n.call(r,i.getData(),null==S?void 0:S.getData()),M=r.addEdge(lw(lw({},C),{sourceNodeId:i.id,sourceAnchorId:u,startPoint:{x:s,y:l},targetNodeId:f.node.id,targetAnchorId:f.anchor.id,endPoint:{x:f.anchor.x,y:f.anchor.y}})),O=e.props.anchorData;return r.eventCenter.emit(Om.ANCHOR_DROP,{data:O,e:t,nodeModel:i,edgeModel:M}),M}var T=g.getData();return r.eventCenter.emit(Om.CONNECTION_NOT_ALLOWED,{data:T,msg:w||_||"不允许添加连线"}),null}},e.sourceRuleResults=new Map,e.targetRuleResults=new Map,e.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},e.dragHandler=new Dm({onDragStart:e.onDragStart,onDragging:e.onDragging,onDragEnd:e.onDragEnd}),e}return sw(e,t),e.prototype.getAnchorShape=function(){var t=this.props,e=t.anchorData,n=t.style,o=t.node.getAnchorShape(e);if(o)return o;var r=e.x,i=e.y,a=lw(lw({},n),null==n?void 0:n.hover);return xr("g",{children:[xr(k_,lw({className:"lf-node-anchor-hover"},a,{x:r,y:i})),xr(k_,lw({className:"lf-node-anchor"},n,{x:r,y:i}))]})},Object.defineProperty(e.prototype,"customTrajectory",{get:function(){return this.props.graphModel.customTrajectory},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relateEdges",{get:function(){var t=this.props,e=t.graphModel,n=e.getAnchorIncomingEdge,o=e.getAnchorOutcomingEdge,r=t.anchorData.id;return{incomingEdgeList:n(r),outcomingEdgeList:o(r)}},enumerable:!1,configurable:!0}),e.prototype.moveAnchorEnd=function(t,e){var n,o,r=this.props,i=r.graphModel,a=r.nodeModel,s=r.anchorData,l=Ib({x:t,y:e},i);if(l){var u=l.node,c=l.anchor.id;if(this.preTargetNode&&this.preTargetNode!==l.node&&this.preTargetNode.setElementState(Sm.DEFAULT),s.id===c)return;this.preTargetNode=u;var d="".concat(a.id,"_").concat(u.id,"_").concat(c,"_").concat(s.id);if(!this.targetRuleResults.has(d)){var p=l.anchor,h=a.isAllowConnectedAsSource(u,s,p),f=u.isAllowConnectedAsTarget(a,s,p);this.sourceRuleResults.set(d,qb(h)),this.targetRuleResults.set(d,qb(f))}var g=(null!==(n=this.sourceRuleResults.get(d))&&void 0!==n?n:{}).isAllPass,v=(null!==(o=this.targetRuleResults.get(d))&&void 0!==o?o:{}).isAllPass;g&&v?u.setElementState(Sm.ALLOW_CONNECT):u.setElementState(Sm.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==Sm.DEFAULT&&this.preTargetNode.setElementState(Sm.DEFAULT)},e.prototype.isShowLine=function(){var t=this.state,e=t.startX,n=t.startY,o=t.endX,r=t.endY;return jb(e,n,o,r)>10},e.prototype.render=function(){var t=this,e=this.state,n=e.startX,o=e.startY,r=e.endX,i=e.endY,a=this.props,s=a.anchorData.edgeAddable,l=a.edgeStyle;return xr("g",{className:"lf-anchor",children:[xr("g",{onMouseDown:function(e){!1!==s&&t.dragHandler.handleMouseDown(e)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(lw({sourcePoint:{x:n,y:o},targetPoint:{x:r,y:i}},l)):xr(S_,lw({x1:n,y1:o,x2:r,y2:i},l,{"pointer-events":"none"})))]})},e}(ho),dw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),pw=function(){return pw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},pw.apply(this,arguments)},hw=function(t){function e(e){var n=t.call(this,e)||this;return n.style={},n.onDragging=function(t){var e,o=t.event,r=n.props,i=r.graphModel,a=r.nodeModel,s=r.eventCenter,l=i.selectNodes,u=a.x,c=a.y,d=o.clientX,p=o.clientY,h=i.getPointByClient({x:d,y:p}).canvasOverlayPosition,f=h.x,g=h.y,v=new Sb(f-u,g-c),y=(null===(e=n.normal)||void 0===e?void 0:e.angle(v))-n.defaultAngle,m=new Db(-u,-c).rotate(y).translate(u,c).toString();a.transform=m,a.rotate=y;var b=Ih(l,(function(t){return t.id}));-1===b.indexOf(a.id)&&(b=[a.id]);var _=Ov(b,(function(t,e){var n=i.getNodeModelById(e);return t[e]=null==n?void 0:n.getMoveDistance(0,0,!1),t}),{});b.forEach((function(t){i.getNodeEdges(t).forEach((function(t){if(_[t.sourceNodeId]){var e=i.getNodeModelById(t.sourceNodeId).anchors.find((function(e){return e.id===t.sourceAnchorId}));t.updateStartPoint(e)}if(_[t.targetNodeId]){e=i.getNodeModelById(t.targetNodeId).anchors.find((function(e){return e.id===t.targetAnchorId}));t.updateEndPoint(e)}}))})),s.emit(Om.NODE_ROTATE,{e:o,model:a,data:a.getData()})},n.style=e.style,n.stepperDrag=new Dm({onDragging:n.onDragging}),n}return dw(e,t),e.prototype.render=function(){var t=this,e=this.props.nodeModel,n=e.x,o=e.y,r=n+e.width/2+20,i=o-e.height/2-20;return this.normal=new Sb(1,0),this.defaultAngle=this.normal.angle(new Sb(r-n,i-o)),e.defaultAngle=this.defaultAngle,xr("g",{className:"lf-rotate-control",children:xr("g",{onMouseDown:function(e){t.stepperDrag.handleMouseDown(e)},children:xr(k_,pw({},this.style,{cx:r,cy:i}))})})},e}(ho),fw={},gw={get exports(){return fw},set exports(t){fw=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=r(t,o(n)))}return t}function o(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 o="";for(var i in t)e.call(t,i)&&t[i]&&(o=r(o,i));return o}function r(t,e){return e?t?t+" "+e:t+e:t}t.exports?(n.default=n,t.exports=n):window.classNames=n}()}(sw);var lw,uw=aw,cw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),dw=function(){return dw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},dw.apply(this,arguments)},pw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},hw=function(t){function e(e){var n=t.call(this)||this;n.mouseDownHandler=function(t){var e=n.props,o=e.draggable,r=e.model,i=e.graphModel.editConfigModel.nodeTextDraggable;(o||i)&&(n.stepperDrag.model=r,n.stepperDrag.handleMouseDown(t))},n.onDragging=function(t){var e=t.deltaX,o=t.deltaY,r=n.props,i=r.model,a=r.graphModel.transformModel;if(e&&o){var s=pw(a.fixDeltaXY(e,o),2),l=s[0],u=s[1];i.moveText(l,u)}},n.dbClickHandler=function(){var t=n.props,e=t.editable,o=t.graphModel.eventCenter,r=t.model;e&&r.setElementState(wm.TEXT_EDIT),o.emit(Om.TEXT_DBCLICK,{data:r.text,model:r})};var o=e.draggable;return n.stepperDrag=new Pm({onDragging:n.onDragging,step:1,eventType:"TEXT",isStopPropagation:o}),n}return cw(e,t),e.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel,o=e.text,r=o.value,i=o.x,a=o.y,s=o.editable,l=o.draggable,u={x:i,y:a,className:"",value:r},c=e.getTextStyle(),d=n.nodeTextDraggable||l;return xr(Jx,dw({},u,c,{className:uw({"lf-element-text":s,"lf-text-draggable":!s&&d,"lf-text-disabled":!s&&!d}),model:e}))},e.prototype.render=function(){if(this.props.model.text)return xr("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},e}(ho),fw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),gw=function(){return gw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},gw.apply(this,arguments)},vw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},yw=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 fw(e,t),e.prototype.getBackground=function(){var t=this.state.isHovered,e=this.props.model,n=e.text,o=e.getTextStyle(),r=o.background||{};if(t&&o.hover&&o.hover.background&&(r=gw(gw({},r),o.hover.background)),(null==n?void 0:n.value)&&"transparent"!==(null==r?void 0:r.fill)){var i=o.fontSize,a=o.textWidth,s=o.lineHeight,l=o.overflowMode,u=r.wrapPadding,c=null==n?void 0:n.value.split(/[\r\n]/g),d=c.length,p=n.x,h=n.y,f={};if("autoWrap"===l&&a){var g=Yb({rows:c,style:{fontSize:"".concat(i,"px"),width:"".concat(a,"px"),lineHeight:s,padding:u},rowsLength:d,className:"lf-get-text-height"});f=gw(gw({},r),{x:p,y:h,width:a,height:g})}else{var v=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,r=0;return oh(e,(function(t){var e=sb(t);r=e>r?e:r})),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}}({rows:c,rowsLength:d,fontSize:i}),y=v.width,m=v.height;if("ellipsis"===l&&(y=a,m=i+2),"string"==typeof r.wrapPadding){var b=r.wrapPadding.split(",").filter((function(t){return t.trim()})).map((function(t){return parseFloat(t.trim())}));if(b.length>0&&b.length<=4){if(1===b.length){var _=vw(b,1)[0];b=[_,_,_,_]}else if(2===b.length){var x=vw(b,2),E=x[0];b=[E,w=x[1],E,w]}else if(3===b.length){var w,S=vw(b,3);b=[S[0],w=S[1],S[2],w]}var C=vw(b,4),O=C[0],M=C[1],T=C[2],N=C[3];y+=M+N,m+=O+T,p+=(M-N)/2,h+=(T-O)/2}}f=gw(gw({},r),{x:p-1,y:h-1,width:y,height:m})}return xr(rE,gw({},f))}return null},e.prototype.getShape=function(){var t=this.props.model,e=t.text,n=e.x,o=e.y,r=e.value;if(!r)return null;var i=t.getTextStyle(),a=gw({x:n,y:o,value:r,model:t,className:"lf-element-text"},i);return xr("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),xr(Jx,gw({},a))]})},e}(hw),mw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),bw=function(){return bw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},bw.apply(this,arguments)},_w=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n},xw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};!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"}(lw||(lw={}));var Ew,ww=function(t){function e(e){var n=t.call(this)||this;n.updateEdgePointByAnchors=function(){var t=n.nodeModel,e=t.id,o=t.anchors;oh(n.graphModel.getNodeEdges(e),(function(t){if(t.sourceNodeId===e)(n=Oh(o,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:n.x,y:n.y});else if(t.targetNodeId===e){var n;(n=Oh(o,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:n.x,y:n.y})}}))},n.triggerResizeEvent=function(t,e,o){n.graphModel.eventCenter.emit(Om.NODE_RESIZE,{preData:t,data:e,model:o})},n.recalcResizeInfo=function(t,e,n,o,r){void 0===n&&(n=1),void 0===o&&(o=!1),void 0===r&&(r=!1);var i=_d(e),a=i.deltaX,s=i.deltaY,l=i.width,u=i.height,c=i.PCTResizeInfo;if(c){var d=0,p=0;switch(t){case lw.LEFT_TOP:p=(-1*a-s)/4;break;case lw.RIGHT_TOP:p=(a-s)/4;break;case lw.RIGHT_BOTTOM:p=(a+s)/4;break;case lw.LEFT_BOTTOM:p=(-1*a+s)/4}0!==p&&(d=Math.round(p/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+d,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var h=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),f=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case lw.LEFT_TOP:a=l-h,s=u-f;break;case lw.RIGHT_TOP:a=h-l,s=u-f;break;case lw.RIGHT_BOTTOM:a=h-l,s=f-u;break;case lw.LEFT_BOTTOM:a=l-h,s=f-u}return i}switch(t){case lw.LEFT_TOP:i.width=o?l:l-a*n,i.height=r?u:u-s*n;break;case lw.RIGHT_TOP:i.width=o?l:l+a*n,i.height=r?u:u-s*n;break;case lw.RIGHT_BOTTOM:i.width=o?l:l+a*n,i.height=r?u:u+s*n;break;case lw.LEFT_BOTTOM:i.width=o?l:l-a*n,i.height=r?u:u+s*n}return i},n.resizeNode=function(t){var e=t.deltaX,o=t.deltaY,r=n.nodeModel,i=r.r,a=r.rx,s=r.ry,l=r.width,u=r.height,c=r.PCTResizeInfo,d=r.minWidth,p=r.minHeight,h=r.maxWidth,f=r.maxHeight,g=d===h,v=p===f,y={width:i||a||l,height:i||s||u,deltaX:e,deltaY:o,PCTResizeInfo:c},m=i||a&&s?.5:1,b=n.recalcResizeInfo(n.index,y,m,g,v);if(b.width<d||b.width>h||b.height<p||b.height>f)n.dragHandler.cancelDrag();else{b.deltaX=g?0:b.deltaX,b.deltaY=g?0:b.deltaY;var _=n.nodeModel.getData(),x=n.nodeModel.resize(b);n.updateEdgePointByAnchors(),n.triggerResizeEvent(_,x,n.nodeModel)}},n.onDragging=function(t){var e=t.deltaX,o=t.deltaY,r=n.graphModel.transformModel,i=xw(r.fixDeltaXY(e,o),2),a=i[0],s=i[1];n.resizeNode({deltaX:a,deltaY:s})},n.onDragEnd=function(){var t=n.nodeModel.x,e=n.nodeModel.y;n.nodeModel.moveTo(t,e),n.updateEdgePointByAnchors()};var o=e.index,r=e.model,i=e.graphModel;return n.index=o,n.nodeModel=r,n.graphModel=i,n.dragHandler=new Pm({onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:i.gridSize}),n}return mw(e,t),e.prototype.render=function(){var t=this.props,e=t.x,n=t.y,o=t.direction,r=t.model.getResizeControlStyle(),i=r.width,a=r.height,s=_w(r,["width","height"]);return xr("g",{className:"lf-resize-control lf-resize-control-".concat(o),children:[xr(rE,bw({className:"lf-resize-control-content",x:e,y:n,width:null!=i?i:7,height:null!=a?a:7},s)),xr(rE,{className:"lf-resize-control-content",x:e,y:n,width:30,height:30,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},e}(ho),Sw=function(t){function e(){return t.call(this)||this}return mw(e,t),e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,o=Hb(e),r=o.minX,i=o.minY,a=o.maxX,s=o.maxY;return Rh([{index:lw.LEFT_TOP,direction:"nw",x:r,y:i},{index:lw.RIGHT_TOP,direction:"ne",x:a,y:i},{index:lw.RIGHT_BOTTOM,direction:"se",x:a,y:s},{index:lw.LEFT_BOTTOM,direction:"sw",x:r,y:s}],(function(t){return xr(ww,bw({},t,{model:e,graphModel:n}))}))},e.prototype.getResizeOutline=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.getResizeOutlineStyle();return xr(rE,bw({},i,{x:e,y:n,width:o,height:r}))},e.prototype.render=function(){return xr("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e}(ho),Cw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ow=function(){return Ow=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Ow.apply(this,arguments)},Mw=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n},Tw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Nw=function(t){function e(e){var n=t.call(this)||this;n.onDragStart=function(t){var e=t.event,o=n.props,r=o.model,i=o.graphModel;if(e){var a=i.getPointByClient({x:e.clientX,y:e.clientY}).canvasOverlayPosition,s=a.x,l=a.y;n.moveOffset={dx:r.x-s,dy:r.y-l}}},n.onDragging=function(t){var e,o,r,i,a=t.event,s=n.props,l=s.model,u=s.graphModel,c=u.editConfigModel,d=c.stopMoveGraph,p=c.autoExpand,h=u.transformModel,f=u.selectNodes,g=u.width,v=u.height,y=u.gridSize;l.isDragging=!0;var m=a,b=m.clientX,_=m.clientY,x=u.getPointByClient({x:b,y:_}).canvasOverlayPosition,E=x.x,w=x.y,S=Tw(h.CanvasPointToHtmlPoint([E,w]),2),C=S[0],O=S[1];if(E+=null!==(o=null===(e=n.moveOffset)||void 0===e?void 0:e.dx)&&void 0!==o?o:0,w+=null!==(i=null===(r=n.moveOffset)||void 0===r?void 0:r.dy)&&void 0!==i?i:0,E=vb(E,y),w=vb(w,y),g&&v){if(!p||d||!(C<0||O<0||C>g||O>v)){var M=Tw(h.CanvasPointToHtmlPoint([E-l.width/2,w-l.height/2]),2),T=M[0],N=M[1],A=Tw(h.CanvasPointToHtmlPoint([E+l.width/2,w+l.height/2]),2),P=A[0],D=A[1],k=Math.max(y,20),R=[];T<0?R=[k,0]:P>u.width?R=[-k,0]:N<0?R=[0,k]:D>u.height&&(R=[0,-k]),n.t&&y_(n.t),l.transform=new Pb(-E,-w).rotate(l.rotate).translate(E,w).toString();var L=f.map((function(t){return t.id}));-1===L.indexOf(l.id)&&(L=[l.id]),R.length>0&&!d&&p?n.t=v_((function(){var t=Tw(R,2),e=t[0],n=t[1];h.translate(null!=e?e:0,null!=n?n:0);var o=-(null!=e?e:0)/h.SCALE_X,r=-(null!=n?n:0)/h.SCALE_X;u.moveNodes(L,o,r)})):u.moveNodes(L,E-l.x,w-l.y)}}else u.moveNode2Coordinate(l.id,E,w)},n.onDragEnd=function(){n.t&&y_(n.t),n.props.model.isDragging=!1},n.handleMouseUp=function(){var t=n.props.model;n.mouseUpDrag=t.isDragging},n.handleClick=function(t){var e=!1===n.mouseUpDrag;if(n.startTime){var o=n.props,r=o.model,i=o.graphModel;if(e){var a={data:r.getData(),e:t,position:i.getPointByClient({x:t.clientX,y:t.clientY}),isSelected:!1,isMultiple:!1},s=2===t.button,l=2===t.detail;if(!s){var u=i.editConfigModel,c=bb(t,u);a.isMultiple=c,r.isSelected&&!l&&c?(a.isSelected=!1,r.setSelected(!1)):(i.selectNodeById(r.id,c),a.isSelected=!0,n.toFront()),l?(u.nodeTextEdit&&r.text.editable&&(r.setSelected(!1),i.setElementStateById(r.id,wm.TEXT_EDIT)),i.eventCenter.emit(Om.NODE_DBCLICK,a)):(i.eventCenter.emit(Om.ELEMENT_CLICK,a),i.eventCenter.emit(Om.NODE_CLICK,a))}}}},n.handleContextMenu=function(t){t.preventDefault();var e=n.props,o=e.model,r=e.graphModel,i=o.getData(),a=r.getPointByClient({x:t.clientX,y:t.clientY});r.setElementStateById(o.id,wm.SHOW_MENU,a.domOverlayPosition),o.isSelected||r.selectNodeById(o.id),r.eventCenter.emit(Om.NODE_CONTEXTMENU,{data:i,e:t,position:a}),n.toFront()},n.handleMouseDown=function(t){var e=n.props,o=e.model,r=e.graphModel;n.startTime=(new Date).getTime(),r.editConfigModel.adjustNodePosition&&o.draggable&&n.stepDrag&&n.stepDrag.handleMouseDown(t)},n.setHoverOn=function(t){var e=n.props,o=e.model,r=e.graphModel;if(!o.isHovered){var i=o.getData();o.setHovered(!0),r.eventCenter.emit(Om.NODE_MOUSEENTER,{data:i,e:t})}},n.setHoverOff=function(t){var e=n.props,o=e.model,r=e.graphModel,i=o.getData();o.isHovered&&(o.setHovered(!1),r.eventCenter.emit(Om.NODE_MOUSELEAVE,{data:i,e:t}))},n.onMouseOut=function(t){xm&&n.setHoverOff(t)};var o=e.graphModel,r=o.gridSize,i=o.eventCenter,a=e.model;return n.stepDrag=new Pm({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:r,eventType:"NODE",isStopPropagation:!1,eventCenter:i,model:a}),n.modelDisposer=Me((function(){return n.props}),(function(t){t&&t.model&&n.stepDrag.setModel(t.model)})),n}return Cw(e,t),e.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer()},e.prototype.componentDidMount=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.getAnchorShape=function(t){return null},e.prototype.getAnchors=function(){var t=this,e=this.props,n=e.model,o=e.graphModel,r=n.isSelected,i=n.isHitable,a=n.isDragging,s=n.isShowAnchor;return i&&(r||s)&&!a?Rh(n.anchors,(function(e,r){var i=n.getAnchorLineStyle(e),a=n.getAnchorStyle(e);return xr(nw,{anchorData:e,node:t,style:a,edgeStyle:i,anchorIndex:r,nodeModel:n,graphModel:o,setHoverOff:t.setHoverOff})})):[]},e.prototype.getRotateControl=function(){var t=this.props,e=t.model,n=t.graphModel,o=e.isSelected,r=e.isHitable,i=e.enableRotate,a=e.isHovered,s=e.getRotateControlStyle();if(r&&(o||a)&&i)return xr(iw,{graphModel:n,nodeModel:e,eventCenter:n.eventCenter,style:s})},e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,o=e.isSelected,r=e.isHitable,i=e.enableResize,a=e.isHovered,s=e.getResizeControlStyle();return r&&(o||a)&&i?xr(Sw,{style:s,model:e,graphModel:n}):null},e.prototype.getText=function(){var t,e=this.props,n=e.model,o=e.graphModel,r=o.editConfigModel;if(r.nodeTextMode!==Nm.TEXT)return null;if(n.state===wm.TEXT_EDIT)return null;if(n.text){var i=!1;return r.nodeTextDraggable&&n.text.draggable&&(i=!0),xr(hw,{editable:r.nodeTextEdit&&(null===(t=n.text.editable)||void 0===t||t),model:n,graphModel:o,draggable:i})}return null},e.prototype.getStateClassName=function(){var t=this.props.model,e=t.state,n=t.isDragging,o=t.isSelected,r="lf-node";switch(e){case wm.ALLOW_CONNECT:r+=" lf-node-allow";break;case wm.NOT_ALLOW_CONNECT:r+=" lf-node-not-allow";break;default:r+=" lf-node-default"}return n&&(r+=" lf-dragging"),o&&(r+=" lf-node-selected"),r},e.prototype.toFront=function(){var t=this.props,e=t.model,n=t.graphModel;e.autoToFront&&n.toFront(e.id)},e.prototype.render=function(){var t,e=this.props,n=e.model,o=e.graphModel,r=o.editConfigModel,i=r.hideAnchors,a=r.adjustNodePosition,s=r.allowRotate,l=r.allowResize,u=o.gridSize,c=o.transformModel.SCALE_X,d=n.isHitable,p=n.draggable,h=n.transform,f=n.getOuterGAttributes(),g=f.className,v=void 0===g?"":g,y=Mw(f,["className"]),m=xr("g",{className:"lf-node-content",children:[xr("g",{transform:h,children:[this.getShape(),this.getText(),s&&this.getRotateControl(),l&&this.getResizeControl()]}),!i&&this.getAnchors()]});return d?(a&&p&&this.stepDrag.setStep(u*c),t=xr("g",Ow({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},y,{children:m}))):t=xr("g",Ow({className:"".concat(this.getStateClassName()," ").concat(v)},y,{children:m})),t},e.isObserved=!1,e}(ho),Aw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Pw=function(){return Pw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Pw.apply(this,arguments)},Dw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Aw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return xr(rE,Pw({},e,{x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius}))},e}(Nw),kw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Rw=function(){return Rw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Rw.apply(this,arguments)},Lw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return kw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,o=t.r,r=t.getNodeStyle();return xr(cE,Rw({},r,{x:e,y:n,r:o}))},e}(Nw),Iw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),jw=function(){return jw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},jw.apply(this,arguments)},Bw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Iw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t,n=e.x,o=e.y,r=e.width,i=e.height,a=e.points,s=t.getNodeStyle(),l={transform:"matrix(1 0 0 1 ".concat(n-r/2," ").concat(o-i/2,")")};return xr("g",jw({},l,{children:xr(vE,jw({},s,{points:a,x:n,y:o}))}))},e}(Nw),Hw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Fw=function(){return Fw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Fw.apply(this,arguments)},zw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Hw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return xr("g",{children:xr(vE,Fw({},e,{points:t.points,x:t.x,y:t.y}))})},e}(Nw),Ww=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Uw=function(){return Uw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Uw.apply(this,arguments)},Xw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ww(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return xr(hE,Uw({},e,{x:t.x,y:t.y,rx:t.rx,ry:t.ry}))},e}(Nw),Gw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Yw=function(){return Yw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Yw.apply(this,arguments)},Vw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gw(e,t),e.prototype.getBackground=function(){var t=this.props.model,e=t.getTextStyle(),n=t.width,o=t.height,r=t.x,i=t.y,a=Yw(Yw({},e.background),{x:r,y:i,width:n,height:o});return xr(rE,Yw({},a))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return xr("g",{children:this.getBackground()})},e}(Nw),Kw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),qw=function(){return qw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},qw.apply(this,arguments)},Zw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},$w=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Jw=function(t){function e(){var e=t.apply(this,$w([],Zw(arguments),!1))||this;return e.ref={current:null},e}return Kw(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,o=t.height,r=t.width,i=t.getNodeStyle();return this.currentProperties=JSON.stringify(t.properties),xr("foreignObject",qw({},i,{x:e-r/2,y:n-o/2,width:r,height:o,ref:this.ref}))},e}(Nw),Qw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),tS=function(){return tS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},tS.apply(this,arguments)},eS=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n},nS=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};!function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"}(Ew||(Ew={}));var oS=function(t){function e(e){var n=t.call(this)||this;n.handleMouseDown=function(t){n.stepDrag&&n.stepDrag.handleMouseDown(t)},n.onDragStart=function(){var t=n.props,e=t.x,o=t.y,r=t.edgeModel,i=r.startPoint,a=r.endPoint,s=r.pointsList;n.oldEdge={startPoint:i,endPoint:a,pointsList:s},n.setState({endX:e,endY:o,dragging:!0})},n.onDragging=function(t){var e=t.deltaX,o=t.deltaY,r=n.state,i=r.endX,a=r.endY,s=n.props,l=s.graphModel,u=s.type,c=l.transformModel,d=l.editConfigModel,p=nS(c.moveCanvasPointByHtml([i,a],e,o),2),h=p[0],f=p[1];n.setState({endX:h,endY:f,dragging:!0});var g=n.props.edgeModel,v=Rb({x:i,y:a},l);if(v&&v.node&&n.isAllowAdjust(v).pass){var y=g.startPoint,m=g.endPoint,b=g.sourceNode,_=g.targetNode,x=u===Ew.SOURCE?{startPoint:{x:v.anchor.x,y:v.anchor.y},endPoint:{x:m.x,y:m.y},sourceNode:v.node,targetNode:_}:{startPoint:{x:y.x,y:y.y},endPoint:{x:v.anchor.x,y:v.anchor.y},sourceNode:b,targetNode:v.node};g.updateAfterAdjustStartAndEnd(x)}else u===Ew.SOURCE?g.updateStartPoint({x:h,y:f}):g.updateEndPoint({x:h,y:f});g.text.value&&d.adjustEdge&&g.setText(Object.assign({},g.text,g.textPosition))},n.onDragEnd=function(t){var e,o,r,i=t.event;try{n.setState({dragging:!1});var a=n.props,s=a.graphModel,l=a.edgeModel,u=a.type,c=n.state,d=c.endX,p=c.endY,h=c.dragging,f=Rb({x:d,y:p},s);if(!h)return;var g=!1,v=void 0;if(f&&f.node){var y=n.isAllowAdjust(f),m=y.pass,b=y.msg,_=y.newTargetNode;if(m){var x=l.getData(),E=x.text,w=x.sourceAnchorId,S=void 0===w?"":w,C=x.targetAnchorId,O=void 0===C?"":C,M=eS(x,["text","sourceAnchorId","targetAnchorId"]);if(v=tS(tS({sourceAnchorId:S,targetAnchorId:O},M),{text:(null==E?void 0:E.value)||""}),u===Ew.SOURCE){var T=s.getNodeModelById(f.node.id),N=s.getNodeModelById(l.targetNodeId),A=null===(e=s.edgeGenerator)||void 0===e?void 0:e.call(s,null==T?void 0:T.getData(),null==N?void 0:N.getData(),v);v=tS(tS({},A),{sourceNodeId:f.node.id,sourceAnchorId:f.anchor.id,startPoint:{x:f.anchor.x,y:f.anchor.y},targetNodeId:l.targetNodeId,endPoint:tS({},l.endPoint)}),l.sourceNodeId===f.node.id&&l.sourceAnchorId===f.anchor.id&&(g=!0)}else if(u===Ew.TARGET){T=s.getNodeModelById(l.sourceNodeId),N=s.getNodeModelById(f.node.id),A=null===(o=s.edgeGenerator)||void 0===o?void 0:o.call(s,null==T?void 0:T.getData(),null==N?void 0:N.getData(),v);v=tS(tS({},A),{sourceNodeId:l.sourceNodeId,startPoint:tS({},l.startPoint),targetNodeId:f.node.id,targetAnchorId:f.anchor.id,endPoint:{x:f.anchor.x,y:f.anchor.y}}),l.targetNodeId===f.node.id&&l.targetAnchorId===f.anchor.id&&(g=!0)}}else{g=!0;var P=_.getData();s.eventCenter.emit(Om.CONNECTION_NOT_ALLOWED,{data:P,msg:b})}}else g=!0;if(g)n.recoveryEdge();else{var D=l.getData();s.deleteEdgeById(l.id);var k=s.addEdge(tS({},v));s.eventCenter.emit(Om.EDGE_EXCHANGE_NODE,{data:{newEdge:k.getData(),oldEdge:D}})}null===(r=n.preTargetNode)||void 0===r||r.setElementState(wm.DEFAULT)}finally{(s=n.props.graphModel).eventCenter.emit(Om.ADJUST_POINT_DRAGEND,{e:i,data:n.stepDragData})}},n.recoveryEdge=function(){var t=n.props.edgeModel,e=n.oldEdge,o=e.startPoint,r=e.endPoint,i=e.pointsList;t.updateStartPoint(o),t.updateEndPoint(r),t.modelType!==Cm.LINE_EDGE&&(t.pointsList=null!=i?i:[],t.initPoints())},n.getAdjustPointStyle=function(){return n.props.graphModel.theme.edgeAdjust},n.state={dragging:!1,endX:0,endY:0},n.targetRuleResults=new Map,n.sourceRuleResults=new Map;var o=e.type,r=e.edgeModel,i=e.graphModel.eventCenter;return n.stepDragData={type:o,edgeData:r.getData()},n.stepDrag=new Pm({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:i,data:n.stepDragData}),n}return Qw(e,t),e.prototype.isAllowAdjust=function(t){var e,n,o,r,i=this.props,a=i.edgeModel,s=a.id,l=a.sourceNode,u=a.targetNode,c=a.sourceAnchorId,d=a.targetAnchorId,p=i.type;if(p===Ew.SOURCE?(e=t.node,n=u,o=t.anchor,r=u.getAnchorInfo(d)):(e=l,n=t.node,r=t.anchor,o=l.getAnchorInfo(c)),this.preTargetNode&&this.preTargetNode!==t.node&&this.preTargetNode.setElementState(wm.DEFAULT),this.preTargetNode=t.node,r.id===o.id)return{pass:!1,msg:"",newTargetNode:n};var h="".concat(e.id,"_").concat(n.id,"_").concat(o.id,"_").concat(r.id);if(!this.targetRuleResults.has(h)){var f=e.isAllowConnectedAsSource(n,o,r,s),g=n.isAllowConnectedAsTarget(e,o,r,s);this.sourceRuleResults.set(h,Kb(f)),this.targetRuleResults.set(h,Kb(g))}var v=this.sourceRuleResults.get(h),y=v.isAllPass,m=v.msg,b=this.targetRuleResults.get(h),_=b.isAllPass,x=b.msg,E=y&&_?wm.ALLOW_CONNECT:wm.NOT_ALLOW_CONNECT;return p===Ew.SOURCE?e.setElementState(E):n.setElementState(E),{pass:y&&_,msg:x||m,newTargetNode:n}},e.prototype.render=function(){var t=this.props,e=t.x,n=t.y,o=t.getAdjustPointShape,r=t.edgeModel,i=this.state.dragging;return xr("g",{pointerEvents:i?"none":"",onMouseDown:this.handleMouseDown,children:i?"":o(e,n,r)})},e}(ho),rS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),iS=function(){return iS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},iS.apply(this,arguments)};!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}rS(e,t),e.prototype.getArrowAttributes=function(){var t=this.props,e=t.arrowInfo,n=t.style,o=e.start,r=e.end,i={start:o,end:r,offset:n.offset,verticalLength:n.verticalLength,type:"end"},a=Rm(i),s=a.leftX,l=a.leftY,u=a.rightX,c=a.rightY;return iS({d:"M".concat(s," ").concat(l," L").concat(r.x," ").concat(r.y," L").concat(u," ").concat(c," z")},n)},e.prototype.getShape=function(){var t=this.getArrowAttributes(),e=t.d,n=t.strokeWidth,o=t.stroke;return xr(sE,{d:e,fill:t.fill,strokeWidth:n,stroke:o})},e.prototype.render=function(){return xr("g",{className:"lf-arrow",children:this.getShape()})}}(ho);var aS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),sS=function(){return sS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},sS.apply(this,arguments)},lS=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},uS=function(t){function e(){var e=t.call(this)||this;return e.textRef={current:null},e.handleHover=function(t,n){var o=e.props,r=o.model,i=o.graphModel.eventCenter;r.setHovered(t);var a=t?Om.EDGE_MOUSEENTER:Om.EDGE_MOUSELEAVE,s=r.getData();i.emit(a,{data:s,e:n})},e.setHoverOn=function(t){e.props.model.isHovered||(e.textRef&&e.textRef.current&&e.textRef.current.setHoverOn(),e.handleHover(!0,t))},e.setHoverOff=function(t){e.props.model.isHovered&&(e.textRef&&e.textRef.current&&e.textRef.current.setHoverOff(),e.handleHover(!1,t))},e.handleContextMenu=function(t){t.preventDefault(),e.contextMenuTime=(new Date).getTime(),e.clickTimer&&clearTimeout(e.clickTimer);var n=e.props,o=n.model,r=n.graphModel,i=r.getPointByClient({x:t.clientX,y:t.clientY});r.setElementStateById(o.id,wm.SHOW_MENU,i.domOverlayPosition),e.toFront(),o.isSelected||r.selectEdgeById(o.id);var a=null==o?void 0:o.getData();r.eventCenter.emit(Om.EDGE_CONTEXTMENU,{data:a,e:t,position:i})},e.handleMouseDown=function(t){t.stopPropagation(),e.startTime=(new Date).getTime()},e.handleMouseUp=function(t){if(e.startTime&&!((new Date).getTime()-e.startTime>200||2===t.button)){var n=2===t.detail,o=e.props,r=o.model,i=o.graphModel,a=null==r?void 0:r.getData(),s=i.getPointByClient({x:t.clientX,y:t.clientY});if(n){var l=i.editConfigModel,u=i.textEditElement,c=r.id,d=r.text,p=r.modelType;if(u&&u.id===c&&i.setElementStateById(c,wm.DEFAULT),l.edgeTextEdit&&d.editable&&(r.setSelected(!1),i.setElementStateById(c,wm.TEXT_EDIT)),p===Cm.POLYLINE_EDGE){var h=r,f=i.getPointByClient({x:t.x,y:t.y}).canvasOverlayPosition,g=f.x,v=f.y;h.dbClickPosition=pb({x:g,y:v},h.points)}i.eventCenter.emit(Om.EDGE_DBCLICK,{data:a,e:t,position:s})}else i.eventCenter.emit(Om.ELEMENT_CLICK,{data:a,e:t,position:s}),i.eventCenter.emit(Om.EDGE_CLICK,{data:a,e:t,position:s});var y=i.editConfigModel;i.selectEdgeById(r.id,bb(t,y)),e.toFront()}},e}return aS(e,t),e.prototype.getShape=function(){return xr("g",{children:this.getEdge()})},e.prototype.getTextStyle=function(){},e.prototype.getText=function(){var t,e=this.props,n=e.model,o=e.graphModel,r=o.editConfigModel;if(r.edgeTextMode!==Nm.TEXT)return null;if(n.state===wm.TEXT_EDIT)return null;if(n.text){var i=!1;return r.edgeTextDraggable&&n.text.draggable&&(i=!0),xr(yw,{ref:this.textRef,editable:r.edgeTextEdit&&(null===(t=n.text.editable)||void 0===t||t),model:n,graphModel:o,draggable:i})}return null},e.prototype.getArrowInfo=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,o=t.isSelected;return{start:e,end:n,hover:this.state.hover,isSelected:o}},e.prototype.getLastTwoPoints=function(){var t=this.props.model;return[t.startPoint,t.endPoint]},e.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},e.prototype.getArrow=function(){var t=this.props.model,e=t.id,n=t.getArrowStyle(),o=n.refY,r=void 0===o?0:o,i=n.refX,a=void 0===i?2:i,s=lS(this.getLastTwoPoints(),2),l=s[0],u=s[1],c="auto";return null!==l&&null!==u&&(c=x_({x:u.x-l.x,y:u.y-l.y,z:0})*(180/Math.PI)),xr("g",{children:xr("defs",{children:[xr("marker",{id:"marker-start-".concat(e),refX:-a,refY:r,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),xr("marker",{id:"marker-end-".concat(e),refX:a,refY:r,overflow:"visible",orient:c,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getStartArrow=function(){return xr("path",{})},e.prototype.getEndArrow=function(){var t=this.props.model.getArrowStyle(),e=t.stroke,n=t.strokeWidth,o=t.offset,r=t.verticalLength;return xr("path",{stroke:e,fill:e,strokeWidth:n,transform:"rotate(180)",d:"M 0 0 L ".concat(o," -").concat(r," L ").concat(o," ").concat(r," Z")})},e.prototype.getAdjustPointShape=function(t,e,n){var o=n.getAdjustPointStyle();return xr(cE,sS({className:"lf-edge-adjust-point"},o,{x:t,y:e}))},e.prototype.getAdjustPoints=function(){var t=this.props,e=t.model,n=t.graphModel,o=n.editConfigModel,r=o.adjustEdgeStartAndEnd,i=o.adjustEdgeStart,a=o.adjustEdgeEnd,s=e.getAdjustStart(),l=e.getAdjustEnd();return xr("g",{children:[r&&i&&xr(oS,sS({type:Ew.SOURCE},s,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:e,graphModel:n})),r&&a&&xr(oS,sS({type:Ew.TARGET},l,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:e,graphModel:n}))]})},e.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},e.prototype.getAppendWidth=function(){return xr("g",{})},e.prototype.getAppend=function(){return xr("g",{className:"lf-edge-append",children:this.getAppendWidth()})},e.prototype.getEdge=function(){return null},e.prototype.toFront=function(){var t=this.props,e=t.graphModel,n=t.model;e.toFront(n.id)},e.prototype.render=function(){var t=this.props.model,e=t.isSelected,n=t.isHitable,o=t.isShowAdjustPoint;return xr("g",{children:[xr("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()]}),o&&e?this.getAdjustPoints():""]})},e.isObserved=!1,e}(ho),cS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),dS=function(){return dS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},dS.apply(this,arguments)},pS=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},hS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return cS(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.getEdgeStyle(),n=t,o=n.path,r=n.isAnimation,i=n.arrowConfig,a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,l=a.stroke,u=a.strokeDashoffset,c=a.animationName,d=a.animationDuration,p=a.animationIterationCount,h=a.animationTimingFunction,f=a.animationDirection;return xr(sE,dS({d:o},e,i,r?{strokeDasharray:s,stroke:l,style:{strokeDashoffset:u,animationName:c,animationDuration:d,animationIterationCount:p,animationTimingFunction:h,animationDirection:f}}:{}))},e.prototype.getAppendWidth=function(){return xr(sE,{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,o=t.getArrowStyle().offset,r=t.pointsList.map((function(t){return{x:t.x,y:t.y}})),i=pS(db(r,o),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 db(n,e)},e}(uS),fS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),gS=function(){return gS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},gS.apply(this,arguments)},vS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fS(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,o=t.isAnimation,r=t.arrowConfig,i=t.getEdgeStyle(),a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,l=a.stroke,u=a.strokeDashoffset,c=a.animationName,d=a.animationDuration,p=a.animationIterationCount,h=a.animationTimingFunction,f=a.animationDirection;return xr(eE,gS({},i,{x1:e.x,y1:e.y,x2:n.x,y2:n.y},r,o?{strokeDasharray:s,stroke:l,style:{strokeDashoffset:u,animationName:c,animationDuration:d,animationIterationCount:p,animationTimingFunction:h,animationDirection:f}}:{}))},e.prototype.getAppendWidth=function(){var t=this.props.model,e=function(t){var e,n=t.start,o=t.end;if(n.x===o.x&&n.y===o.y)e="";else{var r={start:n,end:o,offset:10,verticalLength:5},i=Rm(Lm(Lm({},r),{type:"start"})),a=Rm(Lm(Lm({},r),{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"}}({start:t.startPoint,end:t.endPoint}),n=e.d,o=e.strokeWidth,r=e.fill,i=e.strokeDasharray;return xr(sE,{d:n,fill:r,strokeWidth:o,stroke:e.stroke,strokeDasharray:i})},e}(uS),yS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),mS=function(){return mS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},mS.apply(this,arguments)},bS=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},_S=function(t){function e(){var e=t.call(this)||this;return e.onDragStart=function(){var t=e.props.model;t.dragAppendStart(),e.isShowAdjustPointTemp=t.isShowAdjustPoint,t.isShowAdjustPoint=!1},e.onDragging=function(t){var n=t.deltaX,o=t.deltaY,r=e.props,i=r.model,a=r.graphModel;e.isDragging=!0;var s=a.transformModel,l=a.editConfigModel,u=bS(s.fixDeltaXY(n,o),2),c=u[0],d=u[1],p=i,h=l.adjustEdgeMiddle;e.appendInfo=h?p.dragAppendSimple(e.appendInfo,{x:c,y:d}):p.dragAppend(e.appendInfo,{x:c,y:d})},e.onDragEnd=function(){var t,n=e.props,o=n.model,r=n.graphModel.eventCenter,i=o;i.dragAppendEnd(),e.isDragging=!1,i.isShowAdjustPoint=null!==(t=e.isShowAdjustPointTemp)&&void 0!==t&&t,e.appendInfo=void 0,r.emit(Om.EDGE_ADJUST,{data:i.getData()})},e.beforeDragStart=function(t,n){n.draggable&&e.drag.handleMouseDown(t),e.appendInfo=n},e.drag=new Pm({onDragStart:e.onDragStart,onDragging:e.onDragging,onDragEnd:e.onDragEnd,isStopPropagation:!1}),e}return yS(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.points,n=t.isAnimation,o=t.arrowConfig,r=t.getEdgeStyle(),i=t.getEdgeAnimationStyle(),a=i.strokeDasharray,s=i.stroke,l=i.strokeDashoffset,u=i.animationName,c=i.animationDuration,d=i.animationIterationCount,p=i.animationTimingFunction,h=i.animationDirection;return xr(bE,mS({points:e},r,o,n?{strokeDasharray:a,stroke:s,style:{strokeDashoffset:l,animationName:u,animationDuration:c,animationIterationCount:d,animationTimingFunction:p,animationDirection:h}}:{}))},e.prototype.getArrowInfo=function(){var t=this.props.model,e=t.points,n=t.isSelected,o=this.state.hover,r=rb(e),i=r[0],a=r[0];return r.length>=2&&(i=r[r.length-2],a=r[r.length-1]),{start:i,end:a,hover:o,isSelected:n}},e.prototype.getLastTwoPoints=function(){var t=this.props.model.points,e=rb(t),n=e[0],o=e[0];return e.length>=2&&(n=e[e.length-2],o=e[e.length-1]),[n,o]},e.prototype.getAppendAttributes=function(t){var e,n=t.start,o=t.end;if(n.x===o.x&&n.y===o.y)e="";else{var r={start:n,end:o,offset:10,verticalLength:5},i=Rm(mS(mS({},r),{type:"start"})),a=Rm(mS(mS({},r),{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"}},e.prototype.getAppendShape=function(t){var e=this.getAppendAttributes(t),n=e.d,o=e.strokeWidth,r=e.fill,i=e.strokeDasharray;return xr(sE,{d:n,fill:r,strokeWidth:o,stroke:e.stroke,strokeDasharray:i})},e.prototype.getAppendWidth=function(){for(var t=this,e=this.props,n=e.model,o=e.graphModel,r=n.pointsList,i=n.draggable,a=[],s=r.length,l=function(e){var n="lf-polyline-append",l={start:{x:r[e].x,y:r[e].y},end:{x:r[e+1].x,y:r[e+1].y},startIndex:e,endIndex:e+1,direction:Tm.HORIZONTAL,draggable:!0},c=xr("g",{className:n,children:u.getAppendShape(l)}),d=o.editConfigModel,p=d.adjustEdge,h=d.adjustEdgeMiddle;if(p&&i){var f=l.startIndex,g=l.endIndex,v=h&&(0===f||g===s-1);l.draggable=!v,l.start.x===l.end.x?(l.draggable&&(n+="-ew-resize"),l.direction=Tm.VERTICAL):l.start.y===l.end.y&&(l.draggable&&(n+="-ns-resize"),l.direction=Tm.HORIZONTAL),c=xr("g",{className:u.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(e){return t.beforeDragStart(e,l)},children:xr("g",{className:n,children:u.getAppendShape(l)})})}a.push(c)},u=this,c=0;c<s-1;c++)l(c);return xr("g",{children:a})},e}(uS),xS=function(){return xS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},xS.apply(this,arguments)},ES=function(){function t(t){var e=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){e.nodeConfig=null,window.document.removeEventListener("mouseup",e.stopDrag)},this.dragEnter=function(t){e.nodeConfig&&!e.fakeNode&&(e.fakeNode=e.lf.createFakeNode(xS(xS({},e.nodeConfig),e.clientToLocalPoint({x:t.clientX,y:t.clientY}))))},this.onDragOver=function(t){if(t.preventDefault(),e.fakeNode){var n=e.clientToLocalPoint({x:t.clientX,y:t.clientY}),o=n.x,r=n.y;e.fakeNode.moveTo(o,r);var i=e.fakeNode.getData();e.lf.setNodeSnapLine(i),e.lf.graphModel.eventCenter.emit(Om.NODE_DND_DRAG,{data:i})}return!1},this.onDragLeave=function(){e.fakeNode&&(e.lf.removeNodeSnapLine(),e.lf.graphModel.removeFakeNode(),e.fakeNode=null)},this.onDrop=function(t){e.lf.graphModel&&t&&e.nodeConfig&&(e.lf.addNode(xS(xS({},e.nodeConfig),e.clientToLocalPoint({x:t.clientX,y:t.clientY})),Om.NODE_DND_ADD,t),t.preventDefault(),t.stopPropagation(),e.nodeConfig=null,e.lf.removeNodeSnapLine(),e.lf.graphModel.removeFakeNode(),e.fakeNode=null)};var n=t.lf;this.lf=n}return t.prototype.clientToLocalPoint=function(t){var e=t.x,n=t.y,o=El(this.lf.options,["grid","size"]),r=this.lf.graphModel.getPointByClient({x:e,y:n}).canvasOverlayPosition,i=r.x,a=r.y;return{x:vb(i,o),y:vb(a,o)}},t.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))},t.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},t}();var wS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),SS=function(){return SS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},SS.apply(this,arguments)},CS=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},OS=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},MS=function(t){function e(e){var n=t.call(this,e)||this;return n.ref={current:null},n.__prevText={type:"",text:"",id:""},n.keyupHandler=function(t){var e=n.props.graphModel.textEditElement;"Enter"===t.key&&t.altKey&&(null==e||e.setElementState(wm.DEFAULT))},n.inputHandler=function(t){var e=t.target.innerText,o=n.props.graphModel.textEditElement;o&&(n.__prevText={type:o.type,text:e.replace(/(\r\n)+$|(\n)+$/,""),id:o.id})},n.keydownHandler=function(t){t.stopPropagation()},n.state={style:{left:0,top:0}},n}return wS(e,t),e.getDerivedStateFromProps=function(t){var e,n,o=t.textEditElement,r=t.graphModel,i=r.transformModel,a=r.theme,s=a.inputText;if(o){if(!(null===(e=o.text)||void 0===e?void 0:e.value)&&o.BaseType===Sm.EDGE){var l=o.text,u=o.textPosition,c=u.x,d=u.y;l.x=c,l.y=d,o.setText(l)}var p={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(o.BaseType===Sm.EDGE){var h=a.edgeText,f=h.overflowMode,g=h.lineHeight,v=h.wrapPadding;(m=h.textWidth)&&"autoWrap"===f&&(n=SS(SS({},p),{width:m,minWidth:m,lineHeight:g,padding:v}))}else if(o.BaseType===Sm.NODE){var y=a.nodeText,m=(f=y.overflowMode,g=y.lineHeight,v=y.wrapPadding,y.textWidth),b=o.width,_=o.modelType,x=o.textWidth||m||b;(_!==Cm.TEXT_NODE&&"autoWrap"===f||_===Cm.TEXT_NODE&&m)&&(n=SS(SS({},p),{width:x,minWidth:x,lineHeight:g,padding:v}))}var E=o.text,w=E.x,S=E.y,C=OS(i.CanvasPointToHtmlPoint([w,S]),2),O=C[0],M=C[1];return{style:SS(SS({left:O,top:M},n),s)}}return null},e.prototype.componentDidUpdate=function(){var t=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),""!==this.__prevText.id){var e=this.__prevText,n=e.text,o=e.id;t.updateText(o,n),t.eventCenter.emit(Om.TEXT_UPDATE,{data:SS({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},e.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)}},e.prototype.render=function(){var t,e=this.props.graphModel.textEditElement,n=this.state.style;return e?xr("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},e.toolName="text-edit-tool",e=CS([fC],e)}(ho),TS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),NS=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},AS=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},PS=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},DS=function(t){function e(e){var n=t.call(this,e)||this;n.handleMouseDown=function(t){n.stepDrag.handleMouseDown(t)},n.handleWheelEvent=function(t){var e,o;t.preventDefault();var r=t.deltaX,i=t.deltaY,a=t.clientX,s=t.clientY,l=t.ctrlKey,u=new WheelEvent("wheel",{deltaX:r,deltaY:i,clientX:a,clientY:s,ctrlKey:l});null===(o=null===(e=n.props.lf.container)||void 0===e?void 0:e.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))||void 0===o||o.dispatchEvent(u)},n.onDragging=function(t){var e=t.deltaX,o=t.deltaY,r=n.props,i=r.graphModel,a=r.lf.getTransform(),s=a.SCALE_X,l=a.SCALE_Y,u=i.getSelectElements(!0);i.moveNodes(u.nodes.map((function(t){return t.id})),e/s,o/l)},n.handleContextMenu=function(t){t.preventDefault();var e=n.props,o=e.graphModel,r=e.graphModel,i=r.eventCenter,a=r.selectElements,s=o.getPointByClient({x:t.clientX,y:t.clientY}),l={nodes:[],edges:[]};PS([],AS(a.values()),!1).forEach((function(t){t.BaseType===Sm.NODE&&l.nodes.push(t.getData()),t.BaseType===Sm.EDGE&&l.edges.push(t.getData())})),i.emit(Om.SELECTION_CONTEXTMENU,{data:l,e:t,position:s})};var o=e.graphModel,r=o.gridSize,i=o.eventCenter;return n.stepDrag=new Pm({onDragging:n.onDragging,step:r,eventType:"SELECTION",eventCenter:i}),n}return TS(e,t),e.prototype.render=function(){var t,e,n=this.props.graphModel,o=n.selectElements,r=n.transformModel,i=this.props.lf.getTransform(),a=i.SCALE_X,s=i.SCALE_Y;if(!(o.size<=1)){var l=Number.MAX_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER,c=Number.MIN_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER;return o.forEach((function(t){var e;t.BaseType===Sm.NODE&&(e=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{x:e-o/2,y:n-r/2,x1:e+o/2,y1:n+r/2}}(t)),t.BaseType===Sm.EDGE&&(e=Dm(t)),void 0!==e&&(l=Math.min(l,e.x),u=Math.min(u,e.y),c=Math.max(c,e.x1),d=Math.max(d,e.y1))})),t=AS(r.CanvasPointToHtmlPoint([l,u]),2),l=t[0],u=t[1],e=AS(r.CanvasPointToHtmlPoint([c,d]),2),c=e[0],d=e[1],xr("div",{className:"lf-multiple-select",style:{left:"".concat(l-20*a/2,"px"),top:"".concat(u-20*s/2,"px"),width:"".concat(c-l+20*a,"px"),height:"".concat(d-u+20*s,"px"),"border-width":"".concat(2*a,"px")},onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},e.toolName="multiple-select-tool",e=NS([fC],e)}(ho),kS=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},RS=[MS,DS],LS=function(){function t(t){var e=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=t,oh(RS,(function(t){e.isDisabled(t.toolName)||e.registerTool(t.toolName,t)}));var n=t.graphModel;n.eventCenter.on("".concat(Om.GRAPH_TRANSFORM,",").concat(Om.NODE_CLICK,",").concat(Om.BLANK_CLICK," "),(function(){var t,e=n.textEditElement,o=n.editConfigModel,r=o.edgeTextEdit,i=o.nodeTextEdit;(r||i)&&e&&(null===(t=n.textEditElement)||void 0===t||t.setElementState(wm.DEFAULT))}))}return t.prototype.isDisabled=function(t){var e;return-1!==(null===(e=this.instance.options.disabledTools)||void 0===e?void 0:e.indexOf(t))},t.prototype.registerTool=function(t,e){this.toolMap.set(t,e)},t.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} 的工具")},t.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} 的工具")},t.prototype.getTools=function(){return Array.from(this.toolMap.values())},t.prototype.getInstance=function(){return this.instance},kS([mt],t.prototype,"toolMap",void 0),kS([xe],t.prototype,"disableTool",null),kS([xe],t.prototype,"enableTool",null),t}();function IS(t,e){void 0===e&&(e="Illegal state"),t||function(t){throw new Error("[mobx-utils] "+t)}(e)}var jS=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(jS(Object.getPrototypeOf(t))||[])},BS=function(t){return function(t){var e=jS(t);return e.filter((function(t,n){return e.indexOf(t)===n}))}(t).filter((function(t){return"constructor"!==t&&!~t.indexOf("__")}))},HS="pending",FS="fulfilled",zS="rejected";function WS(t){switch(this.state){case HS:return t.pending&&t.pending(this.value);case zS:return t.rejected&&t.rejected(this.value);case FS:return t.fulfilled?t.fulfilled(this.value):this.value}}function US(t,e){if(IS(arguments.length<=2,"fromPromise expects up to two arguments"),IS("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(xe("observableFromPromise-resolve",(function(t){n.value=t,n.state=FS})),xe("observableFromPromise-reject",(function(t){n.value=t,n.state=zS}))),n.isPromiseBasedObservable=!0,n.case=WS;var o=e&&e.state===FS?e.value:void 0;return De(n,{value:o,state:HS},{},{deep:!1}),n}!function(t){t.reject=xe("fromPromise.reject",(function(e){var n=t(Promise.reject(e));return n.state=zS,n.value=e,n})),t.resolve=xe("fromPromise.resolve",(function(e){void 0===e&&(e=void 0);var n=t(Promise.resolve(e));return n.state=FS,n.value=e,n}))}(US||(US={}));var XS=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(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()},XS([mt.ref],t.prototype,"current",void 0),XS([xe.bound],t.prototype,"next",null),XS([xe.bound],t.prototype,"complete",null),XS([xe.bound],t.prototype,"error",null)}();var GS=function(){return GS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},GS.apply(this,arguments)},YS=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},VS=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];function KS(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function qS(t){return Rn(t)||_n(t)||Sn(t)}function ZS(t,e){var n=new WeakMap;function o(o){var a=n.get(o.object);!function(t,e){switch(t.type){case"add":r(t.newValue,e,t.name);break;case"update":i(t.oldValue),r(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,o){return r(n,e,""+(t.index+o))}));for(var o=t.index+t.addedCount;o<t.object.length;o++)if(qS(t.object[o])){var a=n.get(t.object[o]);a&&(a.path=""+o)}}}(o,a),e(o,KS(a),t)}function r(t,e,i){if(qS(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 '"+KS(e)+"/"+i+"', but it already exists at '"+KS(a.parent)+"/"+a.path+"'")}else{var s={parent:e,path:i,dispose:$e(t,o)};n.set(t,s),Ke(t).forEach((function(t){var e=t[0];return r(t[1],s,e)}))}}}function i(t){if(qS(t)){var e=n.get(t);if(!e)return;n.delete(t),e.dispose(),Ve(t).forEach(i)}}return r(t,void 0,""),function(){i(t)}}!function(){function t(t){var e=this;this.model=t,this.localValues=mt.map({}),this.localComputedValues=mt.map({}),this.isPropertyDirty=function(t){return e.localValues.has(t)},IS(Rn(t),"createViewModel expects an observable object"),BS(t).forEach((function(n){if(n!==G&&"__mobxDidRunLazyInitializers"!==n){if(IS(-1===VS.indexOf(n),"The propertyname "+n+" is reserved and cannot be used with viewModels"),Ue(t,n)){var o=In(t,n).derivation;e.localComputedValues.set(n,St(o.bind(e)))}var r=Object.getOwnPropertyDescriptor(t,n),i=r?{enumerable:r.enumerable}:{};Object.defineProperty(e,n,GS(GS({},i),{configurable:!0,get:function(){return Ue(t,n)?e.localComputedValues.get(n).get():e.isPropertyDirty(n)?e.localValues.get(n):e.model[n]},set:xe((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;Ye(this.localValues).forEach((function(e){var n=t.localValues.get(e),o=t.model[e];_n(o)?o.replace(n):Sn(o)?(o.clear(),o.merge(n)):We(n)||(t.model[e]=n)})),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(t){this.localValues.delete(t)},YS([St],t.prototype,"isDirty",null),YS([St],t.prototype,"changedValues",null),YS([xe.bound],t.prototype,"submit",null),YS([xe.bound],t.prototype,"reset",null),YS([xe.bound],t.prototype,"resetProperty",null)}();var $S=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 o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();!function(t){function e(e,n,o){var r=void 0===o?{}:o,i=r.name,a=void 0===i?"ogm"+(1e3*Math.random()|0):i,s=r.keyToName,l=void 0===s?function(t){return""+t}:s,u=t.call(this)||this;u._keyToName=l,u._groupBy=n,u._ogmInfoKey=Symbol("ogmInfo"+a),u._base=e;for(var c=0;c<e.length;c++)u._addItem(e[c]);return u._disposeBaseObserver=$e(u._base,(function(t){if("splice"===t.type)on((function(){for(var e=0,n=t.removed;e<n.length;e++){var o=n[e];u._removeItem(o)}for(var r=0,i=t.added;r<i.length;r++){var a=i[r];u._addItem(a)}}));else{if("update"!==t.type)throw new Error("illegal state");on((function(){u._removeItem(t.oldValue),u._addItem(t.newValue)}))}})),u}$S(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=mt([],{name:"GroupArray["+this._keyToName(e)+"]",deep:!1}),t.prototype.set.call(this,e,n)),n},e.prototype._removeFromGroupArr=function(e,n){var o=t.prototype.get.call(this,e);1===o.length?t.prototype.delete.call(this,e):(n===o.length-1||(o[n]=o[o.length-1],o[n][this._ogmInfoKey].groupArrIndex=n),o.length--)},e.prototype._addItem=function(t){var e=this,n=this._groupBy(t),o=this._getGroupArr(n),r={groupByValue:n,groupArrIndex:o.length,reaction:Me((function(){return e._groupBy(t)}),(function(n,o){var r=t[e._ogmInfoKey];e._removeFromGroupArr(r.groupByValue,r.groupArrIndex);var i=e._getGroupArr(n),a=i.length;i.push(t),r.groupByValue=n,r.groupArrIndex=a}))};Object.defineProperty(t,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:r}),o.push(t)},e.prototype._removeItem=function(t){var e=t[this._ogmInfoKey];this._removeFromGroupArr(e.groupByValue,e.groupArrIndex),e.reaction(),delete t[this._ogmInfoKey]}}(wn),Promise.resolve(),"undefined"!=typeof queueMicrotask||"undefined"!=typeof process&&process.nextTick;var JS=function(){return JS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},JS.apply(this,arguments)},QS=function(){function t(t){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=t}return t.prototype.add=function(t){kf($p(this.undos),t)||(this.undos.push(t),kf(this.curData,t)||(this.redos=[]),this.eventCenter.emit(Om.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},t.prototype.undoAble=function(){return this.undos.length>1},t.prototype.undo=function(){if(this.undoAble()){var t=this.undos.pop();this.redos.push(t);var e=this.undos.pop();return this.curData=_d(e),e}},t.prototype.redoAble=function(){return this.redos.length>0},t.prototype.redo=function(){if(this.redoAble()){var t=this.redos.pop();return this.curData=_d(t),t}},t.prototype.watch=function(t){var e=this;this.stopWatch&&this.stopWatch(),this.undos.push(t.modelToGraphData()),this.stopWatch=ZS(t,Dp((function(){var n=t.modelToHistoryData();n&&e.add(JS({},n))}),this.waitTime))},t}(),tC={},eC={get exports(){return tC},set exports(t){tC=t}};!function(t){!function(e,n){if(e){for(var o,r={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"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l=1;l<20;++l)r[111+l]="f"+l;for(l=0;l<=9;++l)r[l+96]=l.toString();g.prototype.bind=function(t,e,n){var o=this;return t=t instanceof Array?t:[t],o._bindMultiple.call(o,t,e,n),o},g.prototype.unbind=function(t,e){return this.bind.call(this,t,(function(){}),e)},g.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},g.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},g.prototype.stopCallback=function(t,e){if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(f(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},g.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},g.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(r[e]=t[e]);o=null},g.init=function(){var t=g(n);for(var e in t)"_"!==e.charAt(0)&&(g[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},g.init(),e.Mousetrap=g,t.exports&&(t.exports=g)}function u(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function c(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return r[t.which]?r[t.which]:i[t.which]?i[t.which]:String.fromCharCode(t.which).toLowerCase()}function d(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function p(t,e,n){return n||(n=function(){if(!o)for(var t in o={},r)t>95&&t<112||r.hasOwnProperty(t)&&(o[r[t]]=t);return o}()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function h(t,e){var n,o,r,i=[];for(n=function(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus")).split("+")}(t),r=0;r<n.length;++r)o=n[r],s[o]&&(o=s[o]),e&&"keypress"!=e&&a[o]&&(o=a[o],i.push("shift")),d(o)&&i.push(o);return{key:o,modifiers:i,action:e=p(o,i,e)}}function f(t,e){return null!==t&&t!==n&&(t===e||f(t.parentNode,e))}function g(t){var e=this;if(t=t||n,!(e instanceof g))return new g(t);e.target=t,e._callbacks={},e._directMap={};var o,r={},i=!1,a=!1,s=!1;function l(t){t=t||{};var e,n=!1;for(e in r)t[e]?n=!0:r[e]=0;n||(s=!1)}function p(t,n,o,i,a,s){var l,u,c,p,h=[],f=o.type;if(!e._callbacks[t])return[];for("keyup"==f&&d(t)&&(n=[t]),l=0;l<e._callbacks[t].length;++l)if(u=e._callbacks[t][l],(i||!u.seq||r[u.seq]==u.level)&&f==u.action&&("keypress"==f&&!o.metaKey&&!o.ctrlKey||(c=n,p=u.modifiers,c.sort().join(",")===p.sort().join(",")))){var g=!i&&u.combo==a,v=i&&u.seq==i&&u.level==s;(g||v)&&e._callbacks[t].splice(l,1),h.push(u)}return h}function f(t,n,o,r){e.stopCallback(n,n.target||n.srcElement,o,r)||!1===t(n,o)&&(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=c(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 y(t,e,n,a){function u(e){return function(){s=e,++r[t],clearTimeout(o),o=setTimeout(l,1e3)}}function d(e){f(n,e,t),"keyup"!==a&&(i=c(e)),setTimeout(l,10)}r[t]=0;for(var p=0;p<e.length;++p){var g=p+1===e.length?d:u(a||h(e[p+1]).action);m(e[p],g,a,t,p)}}function m(t,n,o,r,i){e._directMap[t+":"+o]=n;var a,s=(t=t.replace(/\s+/g," ")).split(" ");s.length>1?y(t,s,n,o):(a=h(t,o),e._callbacks[a.key]=e._callbacks[a.key]||[],p(a.key,a.modifiers,{type:a.action},r,t,i),e._callbacks[a.key][r?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:r,level:i,combo:t}))}e._handleKey=function(t,e,n){var o,r=p(t,e,n),i={},u=0,c=!1;for(o=0;o<r.length;++o)r[o].seq&&(u=Math.max(u,r[o].level));for(o=0;o<r.length;++o)if(r[o].seq){if(r[o].level!=u)continue;c=!0,i[r[o].seq]=1,f(r[o].callback,n,r[o].combo,r[o].seq)}else c||f(r[o].callback,n,r[o].combo);var h="keypress"==n.type&&a;n.type!=s||d(t)||h||l(i),a=c&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var o=0;o<t.length;++o)m(t[o],e,n)},u(t,"keypress",v),u(t,"keydown",v),u(t,"keyup",v)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(eC);var nC=tC,oC=function(){function t(t){t.keyboard||(t.keyboard={enabled:!1}),this.options=t;var e=t.lf;this.target=e.container,this.mousetrap=new nC(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(zr(n))n.forEach((function(t){var n=t.keys,o=t.callback,r=t.action;return e.on(n,o,r)}));else{var o=n.keys,r=n.callback,i=n.action;this.on(o,r,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}(),rC=null;function iC(t,e){return t.x+=e,t.y+=e,Df(t.text)||(t.text.x+=e,t.text.y+=e),t}function aC(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})),Df(t.text)||(t.text.x+=e,t.text.y+=e),t}var sC=40,lC=40;var uC=function(){return uC=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},uC.apply(this,arguments)},cC=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},dC=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},pC=Symbol("plugin registered by Logicflow.use"),hC=function(){function t(t){var e,n=this;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(t,e){return n.viewMap.set(t,e)},this.getView=function(t){return n.viewMap.get(t)};var o=ym.get(t),r=o.container,i=o.width,a=o.height;this.options=o,this.container=this.initContainer(r,i,a),this.graphModel=new Bx(uC(uC({},o),{container:this.container})),this.plugins=null!==(e=o.plugins)&&void 0!==e?e:[];var s,l,u,c,d=this.graphModel.eventCenter;this.tool=new LS(this),this.dnd=new ES({lf:this}),this.history=new QS(d),this.keyboard=new oC({lf:this,keyboard:o.keyboard}),!1!==o.snapline&&(this.snaplineModel=new zx(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||(s=this,l=this.graphModel,u=s.keyboard,c=u.options.keyboard,u.on(["cmd + c","ctrl + c"],(function(){if(lC=sC,!(null==c?void 0:c.enabled))return!0;if(l.textEditElement)return!0;var t=s.options.guards,e=l.getSelectElements(!1);return t&&t.beforeClone&&!t.beforeClone(e)||0===e.nodes.length&&0===e.edges.length?(rC=null,!0):((rC=e).nodes.forEach((function(t){return iC(t,sC)})),rC.edges.forEach((function(t){return aC(t,sC)})),!1)})),u.on(["cmd + v","ctrl + v"],(function(){if(!(null==c?void 0:c.enabled))return!0;if(l.textEditElement)return!0;if(rC&&(rC.nodes||rC.edges)){s.clearSelectElements();var t=s.addElements(rC,lC);if(!t)return!0;t.nodes.forEach((function(t){return s.selectElementById(t.id,!0)})),t.edges.forEach((function(t){return s.selectElementById(t.id,!0)})),rC.nodes.forEach((function(t){return iC(t,sC)})),rC.edges.forEach((function(t){return aC(t,sC)})),lC+=sC}return!1})),u.on(["cmd + z","ctrl + z"],(function(){return!(null==c?void 0:c.enabled)||!!l.textEditElement||(s.undo(),!1)})),u.on(["cmd + y","ctrl + y"],(function(){return!(null==c?void 0:c.enabled)||!!l.textEditElement||(s.redo(),!1)})),u.on(["backspace"],(function(){if(!(null==c?void 0:c.enabled))return!0;if(l.textEditElement)return!0;var t=l.getSelectElements(!0);return s.clearSelectElements(),t.edges.forEach((function(t){return t.id&&s.deleteEdge(t.id)})),t.nodes.forEach((function(t){return t.id&&s.deleteNode(t.id)})),!1})),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(o.disabledPlugins)}return t.prototype.initContainer=function(t,e,n){var o=document.createElement("div");return o.style.position="relative",o.style.width=e?"".concat(e,"px"):"100%",o.style.height=n?"".concat(n,"px"):"100%",t.innerHTML="",t.appendChild(o),o},Object.defineProperty(t.prototype,Symbol.toStringTag,{get:function(){return t.toStringTag},enumerable:!1,configurable:!0}),t.prototype.register=function(t,e,n){if(void 0===n&&(n=!0),"string"==typeof t){var o={BaseEdge:uS,BaseEdgeModel:A_,BaseNode:Nw,BaseNodeModel:$_,RectNode:Dw,RectNodeModel:bx,CircleNode:Lw,CircleNodeModel:ex,PolygonNode:Bw,PolygonNodeModel:gx,TextNode:Vw,TextNodeModel:Cx,LineEdge:vS,LineEdgeModel:F_,DiamondNode:zw,DiamondNodeModel:ax,PolylineEdge:_S,PolylineEdgeModel:Y_,BezierEdge:hS,BezierEdgeModel:L_,EllipseNode:Xw,EllipseNodeModel:cx,HtmlNode:Jw,HtmlNodeModel:Tx,h:uo,type:t};if(this.viewMap.forEach((function(t){var e=t.extendKey;e&&(o[e]=t)})),this.graphModel.modelMap.forEach((function(t){var e=t.extendKey;e&&(o[e]=t)})),e){var r=e(o),i=r.view,a=r.model,s=i;n&&!s.isObserved&&(s.isObserved=!0,s=fC(s)),this.setView(t,s),this.graphModel.setModel(t,a)}}else this.registerElement(t)},t.prototype.registerElement=function(t){var e=t.view;!1===t.isObserverView||e.isObserved||(e.isObserved=!0,e=fC(e)),this.setView(t.type,e),this.graphModel.setModel(t.type,t.model)},t.prototype.batchRegister=function(t){var e=this;void 0===t&&(t=[]),oh(t,(function(t){e.registerElement(t)}))},t.prototype.defaultRegister=function(){var t=[{type:"rect",view:Dw,model:bx},{type:"circle",view:Lw,model:ex},{type:"polygon",view:Bw,model:gx},{type:"text",view:Vw,model:Cx},{type:"ellipse",view:Xw,model:cx},{type:"diamond",view:zw,model:ax},{type:"html",view:Jw,model:Tx},{type:"line",view:vS,model:F_},{type:"polyline",view:_S,model:Y_},{type:"bezier",view:hS,model:L_}];this.batchRegister(t)},t.prototype.addNode=function(t,e,n){return void 0===e&&(e=Om.NODE_ADD),this.graphModel.addNode(t,e,n)},t.prototype.deleteNode=function(t){var e=this.graphModel.getNodeModelById(t);if(!e)return!1;var n=e.getData(),o=this.options.guards,r=!(null==o?void 0:o.beforeDelete)||o.beforeDelete(n);return r&&this.graphModel.deleteNode(t),r},t.prototype.cloneNode=function(t){var e=this.graphModel.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){var o=this.options.guards;if(!(null==o?void 0:o.beforeClone)||o.beforeClone(n))return this.graphModel.cloneNode(t)}},t.prototype.changeNodeId=function(t,e){return this.graphModel.changeNodeId(t,e)},t.prototype.changeNodeType=function(t,e){this.graphModel.changeNodeType(t,e)},t.prototype.getNodeModelById=function(t){return this.graphModel.getNodeModelById(t)},t.prototype.getNodeDataById=function(t){var e=this.getNodeModelById(t);return null==e?void 0:e.getData()},t.prototype.getNodeIncomingEdge=function(t){return this.graphModel.getNodeIncomingEdge(t)},t.prototype.getNodeOutgoingEdge=function(t){return this.graphModel.getNodeOutgoingEdge(t)},t.prototype.getNodeIncomingNode=function(t){return this.graphModel.getNodeIncomingNode(t)},t.prototype.getNodeOutgoingNode=function(t){return this.graphModel.getNodeOutgoingNode(t)},t.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(uC(uC({},t),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(n),n},t.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},t.prototype.setNodeSnapLine=function(t){var e;null===(e=this.snaplineModel)||void 0===e||e.setNodeSnapLine(t)},t.prototype.removeNodeSnapLine=function(){var t;null===(t=this.snaplineModel)||void 0===t||t.clearSnapline()},t.prototype.setDefaultEdgeType=function(t){this.graphModel.setDefaultEdgeType(t)},t.prototype.addEdge=function(t){return this.graphModel.addEdge(t)},t.prototype.getEdgeDataById=function(t){var e=this.getEdgeModelById(t);return null==e?void 0:e.getData()},t.prototype.getEdgeModelById=function(t){return this.graphModel.getEdgeModelById(t)},t.prototype.getEdgeModels=function(t){var e=t.sourceNodeId,n=t.targetNodeId,o=[],r=this.graphModel.edges;return e&&n?oh(r,(function(t){t.sourceNodeId===e&&t.targetNodeId===n&&o.push(t)})):e?oh(r,(function(t){t.sourceNodeId===e&&o.push(t)})):n&&oh(r,(function(t){t.targetNodeId===n&&o.push(t)})),o},t.prototype.changeEdgeId=function(t,e){return this.graphModel.changeEdgeId(t,e)},t.prototype.changeEdgeType=function(t,e){this.graphModel.changeEdgeType(t,e)},t.prototype.deleteEdge=function(t){var e=this.graphModel.getEdgeModelById(t);if(!e)return!1;var n=e.getData(),o=this.options.guards,r=!(null==o?void 0:o.beforeDelete)||o.beforeDelete(n);return r&&this.graphModel.deleteEdgeById(t),r},t.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)},t.prototype.getNodeEdges=function(t){return this.graphModel.getNodeEdges(t)},t.prototype.addElements=function(t,e){var n=this,o=t.nodes,r=t.edges;void 0===e&&(e=40),console.log("distance",e);var i={},a={nodes:[],edges:[]};return oh(o,(function(t){var e=t.id,o=n.addNode(t);e&&(i[e]=o.id),a.nodes.push(o)})),oh(r,(function(t){var e=t.sourceNodeId,o=t.targetNodeId;i[e]&&(e=i[e]),i[o]&&(o=i[o]);var r=n.graphModel.addEdge(uC(uC({},t),{sourceNodeId:e,targetNodeId:o}));a.edges.push(r)})),a},t.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)},t.prototype.getSelectElements=function(t){return void 0===t&&(t=!0),this.graphModel.getSelectElements(t)},t.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},t.prototype.getModelById=function(t){return this.graphModel.getElement(t)},t.prototype.getDataById=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getData()},t.prototype.deleteElement=function(t){var e,n,o,r=this.getModelById(t);return!!r&&(null!==(o=null===(n=((e={})[Sm.NODE]=this.deleteNode,e[Sm.EDGE]=this.deleteEdge,e)[r.BaseType])||void 0===n?void 0:n.call(this,t))&&void 0!==o&&o)},t.prototype.setElementZIndex=function(t,e){return this.graphModel.setElementZIndex(t,e)},t.prototype.getAreaElement=function(t,e,n,o,r){return void 0===n&&(n=!0),void 0===o&&(o=!0),void 0===r&&(r=!1),this.graphModel.getAreaElement(t,e,n,o,r).map((function(t){return t.getData()}))},t.prototype.setProperties=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.setProperties(Em(e))},t.prototype.getProperties=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getProperties()},t.prototype.deleteProperty=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.deleteProperty(e)},t.prototype.updateAttributes=function(t,e){this.graphModel.updateAttributes(t,e)},t.prototype.editText=function(t){this.graphModel.editText(t)},t.prototype.updateText=function(t,e){this.graphModel.updateText(t,e)},t.prototype.updateEditConfig=function(t){var e=this.graphModel,n=e.editConfigModel,o=e.transformModel;n.updateEditConfig(t),void 0!==(null==t?void 0:t.stopMoveGraph)&&o.updateTranslateLimits(t.stopMoveGraph),(null==t?void 0:t.isSilentMode)?this.keyboard.disable():this.keyboard.enable(!0)},t.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},t.prototype.setTheme=function(t){this.graphModel.setTheme(t)},t.prototype.focusByElement=function(t){var e=void 0,n=this.getNodeModelById(t);if(n){var o=n.getData();e={x:o.x,y:o.y}}var r=this.getEdgeModelById(t);if(r){var i=r.textPosition;e={x:i.x,y:i.y}}e&&this.focusByCoordinate(e)},t.prototype.focusByCoordinate=function(t){var e=this.graphModel,n=e.transformModel,o=e.width,r=e.height,i=t.x,a=t.y;n.focusOn(i,a,o,r)},t.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)}},t.prototype.resize=function(t,e){this.graphModel.resize(t,e),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},t.prototype.toFront=function(t){this.graphModel.toFront(t)},t.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},t.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,dC([n],cC(t),!1)):n},t.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},t.prototype.clearData=function(){this.graphModel.clearData()},t.prototype.renderRawData=function(t){this.graphModel.graphDataToModel(Em(t)),!1!==this.options.history&&this.history.watch(this.graphModel),function(t,e,n){null==e.__k&&(e.textContent=""),Do(t,e),"function"==typeof n&&n(),t&&t.__c}(xr(JE,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(Om.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},t.prototype.render=function(t){var e=_d(t);this.adapterIn&&(e=this.adapterIn(e)),this.renderRawData(e)},t.prototype.undo=function(){if(this.history.undoAble()){var t=Em(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},t.prototype.redo=function(){if(this.history.redoAble()){var t=Em(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},t.prototype.zoom=function(t,e){return this.graphModel.transformModel.zoom(t,e)},t.prototype.resetZoom=function(){this.graphModel.transformModel.resetZoom()},t.prototype.setZoomMiniSize=function(t){this.graphModel.transformModel.setZoomMiniSize(t)},t.prototype.setZoomMaxSize=function(t){this.graphModel.transformModel.setZoomMaxSize(t)},t.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}},t.prototype.translate=function(t,e){this.graphModel.transformModel.translate(t,e)},t.prototype.resetTranslate=function(){var t=this.graphModel.transformModel,e=t.TRANSLATE_X,n=t.TRANSLATE_Y;this.translate(-e,-n)},t.prototype.translateCenter=function(){this.graphModel.translateCenter()},t.prototype.fitView=function(t,e){void 0===e&&(e=t),this.graphModel.fitView(t,e)},t.prototype.openEdgeAnimation=function(t){this.graphModel.openEdgeAnimation(t)},t.prototype.closeEdgeAnimation=function(t){this.graphModel.closeEdgeAnimation(t)},t.prototype.on=function(t,e){this.graphModel.eventCenter.on(t,e)},t.prototype.off=function(t,e){this.graphModel.eventCenter.off(t,e)},t.prototype.once=function(t,e){this.graphModel.eventCenter.once(t,e)},t.prototype.emit=function(t,e){this.graphModel.eventCenter.emit(t,e)},t.use=function(t,e){var n,o=t.pluginName;if(!o)throw new Error("请给插件指定 pluginName!");this.extensions.set(o,((n={})[pC]=pC,n.extension=t,n.props=e,n))},t.prototype.installPlugins=function(e){var n=this;void 0===e&&(e=[]);var o=Array.from(t.extensions,(function(t){return cC(t,2)[1]}));oh(dC(dC([],cC(this.plugins),!1),cC(o),!1),(function(t){var o,r;pC in t?(o=t.extension,r=t.props):o=t;var i=null==o?void 0:o.pluginName;-1===af(e,i)&&n.installPlugin(o,r)}))},t.prototype.installPlugin=function(e,n){var o,r;if("pluginName"in e&&"install"in e){var i=e.pluginName,a=e.install,s=e.render;i&&(a&&a.call(e,this,t),s&&this.components.push(s.bind(e)),this.extension[i]=e)}else{var l=e,u=l.pluginName,c=new l({lf:this,LogicFlow:t,props:n,options:null!==(r=null===(o=this.options.pluginsOptions)||void 0===o?void 0:o[u])&&void 0!==r?r:{}});c.render&&this.components.push(c.render.bind(c)),this.extension[u]=c}},t.extensions=new Map,t}();function fC(t){return C.observer(t)}!function(t){t.toStringTag="LF.".concat(t.name)}(hC||(hC={}));var gC=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),vC=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new gC;function yC(){return vC.next()}var mC=function(t){function e(e,n){return e.id||(e.id="Event_".concat(yC())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),t.call(this,e,n)||this}return h(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var e=t.prototype.getConnectedTargetRules.call(this);return e.push({message:"起始节点不能作为边的终点",validate:function(){return!1}}),e},e.extendKey="StartEventModel",e}(ex),bC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.extendKey="StartEventNode",e}(Lw),_C={type:"bpmn:startEvent",view:bC,model:mC},xC=function(t){function e(e,n){return e.id||(e.id="Event_".concat(yC())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),t.call(this,e,n)||this}return h(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var e=t.prototype.getConnectedSourceRules.call(this);return e.push({message:"结束节点不能作为边的起点",validate:function(){return!1}}),e},e.extendKey="EndEventModel",e}(ex),EC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},e.prototype.getShape=function(){var e=this.props.model,n=e.getNodeStyle(),o=e,r=o.x,i=o.y,a=o.r;return uo("g",{},t.prototype.getShape.call(this),uo("circle",f(f({},n),{cx:r,cy:i,r:a-5})))},e.extendKey="EndEventView",e}(Lw),wC={type:"bpmn:endEvent",view:EC,model:xC},SC=function(t){function e(e,n){return e.id||(e.id="Flow_".concat(yC())),t.call(this,e,n)||this}return h(e,t),e.extendKey="SequenceFlowModel",e}(Y_),CC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.extendKey="SequenceFlowEdge",e}(_S),OC={type:"bpmn:sequenceFlow",view:CC,model:SC},MC=function(t){function e(e,n){var o=this;return e.id||(e.id="Gateway_".concat(yC())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),(o=t.call(this,e,n)||this).points=[[25,0],[50,25],[25,50],[0,25]],o}return h(e,t),e.extendKey="ExclusiveGatewayModel",e}(gx),TC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t,n=e.x,o=e.y,r=e.width,i=e.height,a=e.points,s=t.getNodeStyle();return uo("g",{transform:"matrix(1 0 0 1 ".concat(n-r/2," ").concat(o-i/2,")")},uo("polygon",f(f({},s),{x:n,y:o,points:a})),uo("path",f({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},s)))},e.extendKey="ExclusiveGatewayNode",e}(Bw),NC={type:"bpmn:exclusiveGateway",view:TC,model:MC},AC=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(yC())),t.call(this,e,n)||this}return h(e,t),e.extendKey="ServiceTaskModel",e}(bx),PC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getLabelShape=function(){var t=this.props.model,e=t.x,n=t.y;return uo("svg",{x:e-t.width/2+5,y:n-t.height/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},uo("path",{fill:t.getNodeStyle().stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.radius,a=t.getNodeStyle();return uo("g",{},[uo("rect",f({x:e-o/2,y:n-r/2,rx:i,ry:i,width:o,height:r},a)),this.getLabelShape()])},e.extendKey="ServiceTaskNode",e}(Dw),DC={type:"bpmn:serviceTask",view:PC,model:AC},kC=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(yC())),t.call(this,e,n)||this}return h(e,t),e.extendKey="UserTaskModel",e}(bx),RC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getLabelShape=function(){var t=this.props.model,e=t.x,n=t.y;return uo("svg",{x:e-t.width/2+5,y:n-t.height/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},uo("path",{fill:t.getNodeStyle().stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.radius,a=t.getNodeStyle();return uo("g",{},[uo("rect",f(f({},a),{x:e-o/2,y:n-r/2,rx:i,ry:i,width:o,height:r})),this.getLabelShape()])},e.extendKey="UserTaskNode",e}(Dw),LC={type:"bpmn:userTask",view:RC,model:kC},IC={pluginName:"bpmnElement",install:function(t){t.setTheme(d),t.register(_C),t.register(wC),t.register(NC),t.register(LC),t.register(DC),t.options.customBpmnEdge||(t.register(OC),t.setDefaultEdgeType("bpmn:sequenceFlow"))}},jC=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),BC=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new jC;function HC(){return BC.next()}function FC(t){return Object.prototype.toString.call(t)}function zC(t){var e=t;return"[object Object]"===FC(t)?(e={},Object.keys(t).forEach((function(n){var o=n;"-"===n.charAt(0)&&(o=n.substring(1)),e[o]=zC(t[n])}))):Array.isArray(t)&&(e=[],t.forEach((function(t,n){e[n]=zC(t)}))),e}var WC="\t\n";function UC(t,e,n){var o=function(t){return" ".repeat(t)}(n),r="";if("#text"===e)return WC+o+t;if("#cdata-section"===e)return WC+o+"<![CDATA["+t+"]]>";if("#comment"===e)return WC+o+"\x3c!--"+t+"--\x3e";if("-"==="".concat(e).charAt(0))return" "+e.substring(1)+'="'+function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(zC(t)).replace(/"/g,"'")}return e}(t)+'"';if(Array.isArray(t))t.forEach((function(t){r+=UC(t,e,n+1)}));else if("[object Object]"===FC(t)){var i=Object.keys(t),a="",s="";r+=(0===n?"":WC+o)+"<"+e,i.forEach((function(e){"-"===e.charAt(0)?a+=UC(t[e],e,n+1):s+=UC(t[e],e,n+1)})),r+=a+(""!==s?">".concat(s).concat(WC+o,"</").concat(e,">"):" />")}else r+=WC+o+"<".concat(e,">").concat(t.toString(),"</").concat(e,">");return r}function XC(t){var e="";for(var n in t)e+=UC(t[n],n,0);return e}var GC=function(){};(GC.ObjTree=function(){return this}).VERSION="0.23",GC.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',GC.ObjTree.prototype.attr_prefix="-",GC.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},GC.ObjTree.prototype.parseHTTP=function(t,e,n){var o,r={};for(var i in e)r[i]=e[i];if(r.method||(void 0===r.postBody&&void 0===r.postbody&&void 0===r.parameters?r.method="get":r.method="post"),n){r.asynchronous=!0;var a=this,s=n,l=r.onComplete;r.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),s(e,t),l&&l(t)}}else r.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)r.uri=t,(u=new HTTP.Request(r))&&(o=u.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var u;(u=new Ajax.Request(t,r))&&(o=u.transport)}return n?o:o&&o.responseXML&&o.responseXML.documentElement?this.parseDOM(o.responseXML.documentElement):void 0},GC.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!=t.nodeType){var o={};o[t.nodeName]=n,n=o}return n}},GC.ObjTree.prototype.parseElement=function(t){if(7!=t.nodeType){if(3==t.nodeType||4==t.nodeType||8==t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var o=0;o<t.attributes.length;o++){if("string"==typeof(s=t.attributes[o].nodeName)){var r=t.attributes[o].nodeValue;try{r=JSON.parse(t.attributes[o].nodeValue.replace(/'/g,'"'))}catch(e){r=t.attributes[o].nodeValue}r&&(void 0===n[s=this.attr_prefix+s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],r))}}}if(t.childNodes&&t.childNodes.length){var i=!0;e&&(i=!1);for(o=0;o<t.childNodes.length&&i;o++){var a=t.childNodes[o].nodeType;3!=a&&4!=a&&8!=a&&(i=!1)}if(i){e||(e="");for(o=0;o<t.childNodes.length;o++)e+=t.childNodes[o].nodeValue}else{e||(e={});for(o=0;o<t.childNodes.length;o++){var s;if("string"==typeof(s=t.childNodes[o].nodeName))(r=this.parseElement(t.childNodes[o]))&&(void 0===n[s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],r))}}}else null===e&&(e={});return e}},GC.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(1==n&&(t[e]=[]),t[e][t[e].length]=o):1==n?t[e]=o:2==n?t[e]=[t[e],o]:t[e][t[e].length]=o},GC.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},GC.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];r.charAt(0)!=this.attr_prefix?void 0===i||null==i?n[n.length]="<"+r+" />":"object"==typeof i&&i.constructor==Array?n[n.length]=this.array_to_xml(r,i):n[n.length]="object"==typeof i?this.hash_to_xml(r,i):this.scalar_to_xml(r,i):o[o.length]=" "+r.substring(1)+'="'+this.xml_escape(i)+'"'}var a=o.join(""),s=n.join("");return void 0===t||null==t||(s=n.length>0?s.match(/\n/)?"<"+t+a+">\n"+s+"</"+t+">\n":"<"+t+a+">"+s+"</"+t+">\n":"<"+t+a+" />\n"),s},GC.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o<e.length;o++){var r=e[o];void 0===r||null==r?n[n.length]="<"+t+" />":"object"==typeof r&&r.constructor==Array?n[n.length]=this.array_to_xml(t,r):n[n.length]="object"==typeof r?this.hash_to_xml(t,r):this.scalar_to_xml(t,r)}return n.join("")},GC.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"==t?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+">\n"},GC.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var YC,VC=function(t){return(new GC.ObjTree).parseXML(t)};!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"}(YC||(YC={}));var KC=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],qC=["properties","startPoint","endPoint","pointsList"];function ZC(t){var e=t?qC.concat(t):qC;return function(t){return function t(n){var o={};return"string"==typeof n?n:Array.isArray(n)?n.map((function(e){return t(e)})):(Object.entries(n).forEach((function(n){var r=_(n,2),i=r[0],a=r[1];"object"!=typeof a?0===i.indexOf("-")||["#text","#cdata-section","#comment"].includes(i)?o[i]=a:o["-".concat(i)]=a:e.includes(i)?o["-".concat(i)]=t(a):o[i]=t(a)})),o)}(t)}}function $C(t){var e={};return Object.entries(t).forEach((function(t){var n=_(t,2),o=n[0],r=n[1];0===o.indexOf("-")?e[o.substring(1)]=zC(r):"string"==typeof r?e[o]=r:"[object Object]"===Object.prototype.toString.call(r)?e[o]=$C(r):Array.isArray(r)?e[o]=r.map((function(t){return $C(t)})):e[o]=r})),e}function JC(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,o=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),r={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":o};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(r["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),r})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,o=100,r=80,i=t.x,a=t.y,s=nO.shapeConfigMap.get(t.type);s&&(o=s.width,r=s.height),i-=o/2,a-=r/2;var l={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":i,"-y":a,"-width":o,"-height":r}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(l["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),l}))}function QC(t){var e=[],n=[],o=t["bpmn:definitions"];if(o){var r=o["bpmn:process"];Object.keys(r).forEach((function(t){if(0===t.indexOf("bpmn:")){var i=r[t];if(t===YC.FLOW){var a=o["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];n=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var o;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(eO(o,t))}));else{var o=void 0;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(eO(o,t))}return n}(i,a)}else{var s=o["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];e=e.concat(function(t,e,n){var o=[];if(Array.isArray(t))t.forEach((function(t){var r=tO(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(r)}));else{var r=tO(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(r)}return o}(i,s,t))}}}))}return{nodes:e,edges:n}}function tO(t,e,n){var o,r,i=Number(t["dc:Bounds"]["-x"]),a=Number(t["dc:Bounds"]["-y"]),s=n["-name"],l=nO.shapeConfigMap.get(e);if(l&&(i+=l.width/2,a+=l.height/2),Object.entries(n).forEach((function(t){var e=_(t,2),n=e[0],r=e[1];-1===KC.indexOf(n)&&(o||(o={}),o[n]=r)})),o&&(o=$C(o)),s&&(r={x:i,y:a,value:s},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var u=t["bpmndi:BPMNLabel"]["dc:Bounds"];r.x=Number(u["-x"])+Number(u["-width"])/2,r.y=Number(u["-y"])+Number(u["-height"])/2}var c={id:t["-bpmnElement"],type:e,x:i,y:a,properties:o};return r&&(c.text=r),c}function eO(t,e){var n,o,r=e["-name"];if(r){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],a=0;r.split("\n").forEach((function(t){a<t.length&&(a=t.length)})),n={value:r,x:Number(i["-x"])+10*a/2,y:Number(i["-y"])+7}}Object.entries(e).forEach((function(t){var e=_(t,2),n=e[0],r=e[1];-1===KC.indexOf(n)&&(o||(o={}),o[n]=r)})),o&&(o=$C(o));var s={id:e["-id"],type:YC.FLOW,pointsList:t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:o};return n&&(s.text=n),s}var nO=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var o=f({},n.processAttributes);!function(t,e,n){var o=new Map;e.nodes.forEach((function(e){var r,i={"-id":e.id};if((null===(r=e.text)||void 0===r?void 0:r.value)&&(i["-name"]=e.text.value),e.properties){var a=ZC(n)(e.properties);Object.assign(i,a)}o.set(e.id,i),t[e.type]?Array.isArray(t[e.type])?t[e.type].push(i):t[e.type]=[t[e.type],i]:t[e.type]=i}));var r=e.edges.map((function(t){var e,r,i=o.get(t.targetNodeId);i["bpmn:incoming"]?Array.isArray(i["bpmn:incoming"])?i["bpmn:incoming"].push(t.id):i["bpmn:incoming"]=[i["bpmn:incoming"],t.id]:i["bpmn:incoming"]=t.id;var a={"-id":t.id,"-sourceRef":t.sourceNodeId,"-targetRef":t.targetNodeId};if((null===(e=t.text)||void 0===e?void 0:e.value)&&(a["-name"]=null===(r=t.text)||void 0===r?void 0:r.value),t.properties){var s=ZC(n)(t.properties);Object.assign(a,s)}return a}));e.edges.forEach((function(t){var e=o.get(t.sourceNodeId);e["bpmn:outgoing"]?Array.isArray(e["bpmn:outgoing"])?e["bpmn:outgoing"].push(t.id):e["bpmn:outgoing"]=[e["bpmn:outgoing"],t.id]:e["bpmn:outgoing"]=t.id})),t[YC.FLOW]=r}(o,t,e);var r={"-id":"BPMNPlane_1","-bpmnElement":o["-id"]};JC(r,t);var i=n.definitionAttributes;return i["bpmn:process"]=o,i["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":r},{"bpmn:definitions":i}},this.adapterIn=function(t){if(t)return QC(t)},e.adapterIn=function(t){return n.adapterIn(t)},e.adapterOut=function(t,e){return n.adapterOut(t,e)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(HC())},this.definitionAttributes={"-id":"Definitions_".concat(HC()),"-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();nO.shapeConfigMap.set(YC.START,{width:e,height:n}),nO.shapeConfigMap.set(YC.END,{width:o,height:r}),nO.shapeConfigMap.set(YC.GATEWAY,{width:i,height:a}),nO.shapeConfigMap.set(YC.SYSTEM,{width:s,height:l}),nO.shapeConfigMap.set(YC.USER,{width:u,height:c});var oO=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e=VC(t);return n.adapterIn(e)},n.adapterXmlOut=function(t,e){return XC(n.adapterOut(t,e))};var o=e.lf;return o.adapterIn=n.adapterXmlIn,o.adapterOut=n.adapterXmlOut,n}return h(e,t),e.pluginName="bpmnXmlAdapter",e}(nO);function rO(){this.targetRules.push({message:"分组外的节点不允许连接分组内的",validate:function(t,e){var n=!!t.properties.parent,o=!!e.properties.parent;return!(!n&&o)}})}var iO=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var t="xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}));return t},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),aO=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new iO;function sO(){return aO.next()}var lO=Object.freeze({__proto__:null,genBpmnId:sO,groupRule:rO});function uO(t){var e=_(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var n,o=this.props.model,r=o.getNodeStyle(),i=o,a=i.x,s=i.y,l=i.r,u=i.width,c=i.height,d=i.properties,p=t.prototype.getShape.call(this),h=d.definitionType,g=((null===(n=e.endEvent)||void 0===n?void 0:n.get(h))||{}).icon,v=Array.isArray(g)?uo.apply(void 0,x(["g",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")")}],_(g),!1)):uo("path",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")"),d:g,style:"fill: black; stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;"});return uo("g",{},p,uo("circle",f(f({},r),{strokeWidth:2,cx:a,cy:s,r:l-2})),v)},n}(Lw),o=function(t){function n(n,o){var r,i,a,s;n.id||(n.id="Event_".concat(sO())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var l=((null===(i=e.endEvent)||void 0===i?void 0:i.get(null===(a=n.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return n.properties=f(f({},u),n.properties),(null===(s=n.properties)||void 0===s?void 0:s.definitionType)&&(n.properties.definitionId="Definition_".concat(sO())),r=t.call(this,n,o)||this,rO.call(r),r}return h(n,t),n.prototype.setAttributes=function(){this.r=18},n.prototype.getConnectedSourceRules=function(){var e=this,n=t.prototype.getConnectedSourceRules.call(this),o={message:"结束节点不能作为边的起点",validate:function(t,n){return console.log("_target",n),t!==e}};return n.push(o),n},n}(ex);return{type:"bpmn:endEvent",view:n,model:o}}function cO(t){var e=_(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var t,n=this.props.model,o=n.getNodeStyle(),r=n,i=r.x,a=r.y,s=r.r,l=r.width,u=r.height,c=r.properties.definitionType,d=((null===(t=e.intermediateCatchEvent)||void 0===t?void 0:t.get(c))||{}).icon,p=Array.isArray(d)?uo.apply(void 0,x(["g",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")")}],_(d),!1)):uo("path",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")"),d:d});return uo("g",{},uo("circle",f(f({},o),{cx:i,cy:a,r:s,strokeWidth:1.5})),uo("circle",f(f({},o),{cx:i,cy:a,r:s-3,strokeWidth:1.5})),p)},n}(Lw),o=function(t){function n(n,o){var r,i,a,s;n.id||(n.id="Event_".concat(sO())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var l=((null===(i=e.intermediateCatchEvent)||void 0===i?void 0:i.get(null===(a=n.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return n.properties=f(f({},u),n.properties),(null===(s=n.properties)||void 0===s?void 0:s.definitionType)&&(n.properties.definitionId="Definition_".concat(sO())),r=t.call(this,n,o)||this,rO.call(r),r}return h(n,t),n.prototype.setAttributes=function(){this.r=18},n}(ex);return{type:"bpmn:intermediateCatchEvent",view:n,model:o}}function dO(t){var e=_(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var t,n=this.props.model,o=n.getNodeStyle(),r=n,i=r.x,a=r.y,s=r.r,l=r.width,u=r.height,c=r.properties,d=c.definitionType,p=c.isInterrupting,h=((null===(t=e.startEvent)||void 0===t?void 0:t.get(d))||{}).icon,g=Array.isArray(h)?uo.apply(void 0,x(["g",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")")}],_(h),!1)):uo("path",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")"),d:h,style:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"});return uo("g",{},uo("circle",f(f({},o),{cx:i,cy:a,r:s,strokeDasharray:p?"5,5":"",strokeWidth:2})),g)},n}(Lw),o=function(t){function n(n,o){var r,i,a;n.id||(n.id="Event_".concat(sO())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var s=((null===(r=e.startEvent)||void 0===r?void 0:r.get(null===(i=n.properties)||void 0===i?void 0:i.definitionType))||{}).properties,l=void 0===s?{}:s;return n.properties=f(f({},l),n.properties),(null===(a=n.properties)||void 0===a?void 0:a.definitionType)&&(n.properties.definitionId="Definition_".concat(sO())),t.call(this,n,o)||this}return h(n,t),n.prototype.setAttributes=function(){this.r=18},n.prototype.getConnectedTargetRules=function(){var e=this,n=t.prototype.getConnectedTargetRules.call(this),o={message:"起始节点不能作为边的终点",validate:function(t,n){return n!==e}};return n.push(o),n},n}(ex);return{type:"bpmn:startEvent",view:n,model:o}}function pO(t){var e=_(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var t,n=this.props.model,o=n.getNodeStyle(),r=n,i=r.x,a=r.y,s=r.r,l=r.width,u=r.height,c=r.properties,d=c.definitionType,p=c.cancelActivity,h=((null===(t=e.boundaryEvent)||void 0===t?void 0:t.get(d))||{}).icon,g=Array.isArray(h)?uo.apply(void 0,x(["g",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")")}],_(h),!1)):uo("path",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")"),d:h});return uo("g",{},uo("circle",f(f({},o),{cx:i,cy:a,r:s,strokeDasharray:p?"":"5,5",strokeWidth:1.5})),uo("circle",f(f({},o),{cx:i,cy:a,r:s-3,strokeDasharray:p?"":"5,5",strokeWidth:1.5})),g)},n}(Lw),o=function(t){function n(n,o){var r,i,a,s;n.id||(n.id="Event_".concat(sO())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var l=((null===(i=e.boundaryEvent)||void 0===i?void 0:i.get(null===(a=n.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return n.properties=f(f({attachedToRef:"",cancelActivity:!0},u),n.properties),(null===(s=n.properties)||void 0===s?void 0:s.definitionType)&&(n.properties.definitionId="Definition_".concat(sO())),r=t.call(this,n,o)||this,rO.call(r),r}return h(n,t),n.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.r=20,this.autoToFront=!1,this.zIndex=99999},n.prototype.setAttributes=function(){this.r=18},n}(ex);return{type:"bpmn:boundaryEvent",view:n,model:o}}function hO(t){var e=_(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var t,n=this.props.model,o=n.getNodeStyle(),r=n,i=r.x,a=r.y,s=r.r,l=r.width,u=r.height,c=r.properties.definitionType,d=((null===(t=e.intermediateThrowEvent)||void 0===t?void 0:t.get(c))||{}).icon,p=Array.isArray(d)?uo.apply(void 0,x(["g",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")")}],_(d),!1)):uo("path",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")"),d:d,style:"fill: black"});return uo("g",{},uo("circle",f(f({},o),{cx:i,cy:a,r:s,strokeWidth:1.5})),uo("circle",f(f({},o),{cx:i,cy:a,r:s-3,strokeWidth:1.5})),p)},n}(Lw),o=function(t){function n(n,o){var r,i,a,s;n.id||(n.id="Event_".concat(sO())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var l=((null===(i=e.intermediateThrowEvent)||void 0===i?void 0:i.get(null===(a=n.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return n.properties=f(f({},u),n.properties),(null===(s=n.properties)||void 0===s?void 0:s.definitionType)&&(n.properties.definitionId="Definition_".concat(sO())),r=t.call(this,n,o)||this,rO.call(r),r}return h(n,t),n.prototype.setAttributes=function(){this.r=18},n}(ex);return{type:"bpmn:intermediateThrowEvent",view:n,model:o}}var fO=[uo("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),uo("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"})],gO=[uo("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"})],vO="m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z",yO="m 23,10 0,12.5 -12.5,0 0,5 12.5,0 0,12.5 5,0 0,-12.5 12.5,0 0,-5 -12.5,0 0,-12.5 -5,0 z",mO=uo("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"}),bO="M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z",_O="M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z",xO="m44,60 m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",EO="m47,61 m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",wO="m 50,73 c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",SO=Object.freeze({__proto__:null,compensationIcon:"m 7.92,18 9,-6.5 0,13 z m 9.3,-0.4 8.7,-6.1 0,13 -8.7,-6.1 z",conditionalIcon:"M 10.5,8.5 l 14.5,0 l 0,18 l -14.5,0 Z M 12.5,11.5 l 10.5,0 M 12.5,14.5 l 10.5,0 M 12.5,17.5 l 10.5,0 M 12.5,20.5 l 10.5,0 M 12.5,23.5 l 10.5,0 M 12.5,26.5 l 10.5,0 ",errorIcon:"m 7.2,25.991999999999997 0.09350000000000001,-0.025300000000000003 7.3392,-9.610700000000001 7.667000000000001,8.9661 4.7003,-18.2204 -5.8707,11.6501 -7.299600000000001,-9.585400000000002 z",escalationIcon:"M 18,7.2 l 8,20 l -8,-7 l -8,7 Z",exclusiveIcon:vO,inclusiveIcon:mO,linkIcon:"m 20.52,9.468 0,4.4375 -13.5,0 0,6.75 13.5,0 0,4.4375 9.84375,-7.8125 -9.84375,-7.8125 z",loopMarker:wO,manualTaskIcon:"M0.5,3.751L4.583,0.5009999999999999C4.583,0.5009999999999999,15.749,0.5839999999999999,16.666,0.5839999999999999S14.249,3.5009999999999994,15.166,3.5009999999999994S26.833,3.5009999999999994,27.75,3.5009999999999994C28.916,5.209,27.582,6.667999999999999,26.916,7.167999999999999S27.791,9.084999999999999,25.916,11.584999999999999C25.166,11.834999999999999,26.666,13.459999999999999,24.583000000000002,14.918C23.416,15.501,25.166,16.46,23.333000000000002,17.750999999999998C22.166,17.750999999999998,2.5000000000000036,17.833999999999996,2.5000000000000036,17.833999999999996L0.5000000000000036,16.500999999999998V3.751ZM13.5,7L27,7M13.5,11L26,11M14,14.5L25,14.5M8.2,3.1L15,3.1",messageIcon:"m 8.459999999999999,11.34 l 0,12.6 l 18.900000000000002,0 l 0,-12.6 z l 9.450000000000001,5.4 l 9.450000000000001,-5.4",parallelIcon:yO,parallelMarker:xO,scriptTaskIcon:"M6.402,0.5H20.902C20.902,0.5,15.069,3.333,15.069,6.083S19.486,12.083,19.486,15.25S15.319,20.333,15.319,20.333H0.235C0.235,20.333,5.235,17.665999999999997,5.235,15.332999999999998S0.6520000000000001,8.582999999999998,0.6520000000000001,6.082999999999998S6.402,0.5,6.402,0.5ZM3.5,4.5L13.5,4.5M3.8,8.5L13.8,8.5M6.3,12.5L16.3,12.5M6.5,16.5L16.5,16.5",sequentialMarker:EO,serviceTaskIcon:bO,signalIcon:"M 18,7.2 l 9,16.2 l -18,0 Z",style:{throw:"fill: rgb(34, 36, 42); stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;",catch:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;",nonIntermediate:"stroke-width: 1.5; stroke-dash-array: 6",intermediate:"stroke-width: 1.5"},terminateIcon:gO,timerIcon:fO,userTaskIcon:_O});function CO(t,e,n){var o=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getShape=function(){var t=this.props.model,n=t,o=n.x,r=n.y,i=n.width,a=n.height,s=n.points,l=t.getNodeStyle();return uo("g",{transform:"matrix(1 0 0 1 ".concat(o-i/2," ").concat(r-a/2,")")},uo(vE,f(f({},l),{x:o,y:r,points:s})),"string"==typeof e?uo("path",f(f({d:e},l),{fill:"rgb(34, 36, 42)",strokeWidth:1})):e)},n}(Bw);return{type:t,view:o,model:function(t){function e(e,o){var r=this;return e.id||(e.id="Gateway_".concat(sO())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),e.properties=f(f({},n||{}),e.properties),(r=t.call(this,e,o)||this).points=[[25,0],[50,25],[25,50],[0,25]],rO.call(r),r}return h(e,t),e}(gx)}}var OO={parallel:xO,sequential:EO,loop:wO};function MO(t,e,n){var o=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,o=t.y,r=t.width,i=t.height,a=t.getNodeStyle(),s=Array.isArray(e)?uo.apply(void 0,x(["g",{transform:"matrix(1 0 0 1 ".concat(n-r/2," ").concat(o-i/2,")")}],_(e),!1)):uo("path",{fill:a.stroke,d:e});return uo("svg",{x:n-r/2+5,y:o-i/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},s)},n.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.radius,a=t.properties,s=t.getNodeStyle();return uo("g",{},[uo("rect",f(f({},s),{x:e-o/2,y:n-r/2,rx:i,ry:i,width:o,height:r,opacity:.95})),this.getLabelShape(),uo("g",{transform:"matrix(1 0 0 1 ".concat(e-o/2," ").concat(n-r/2,")")},uo("path",{fill:"white",strokeLinecap:"round",strokeLinejoin:"round",stroke:"rgb(34, 36, 42)",strokeWidth:"2",d:OO[a.multiInstanceType]||""}))])},n}(Dw),r=function(t){function e(e,o){var r,i=this;e.id||(e.id="Activity_".concat(sO()));var a=f(f({},n||{}),e.properties);return e.properties=a,i=t.call(this,e,o)||this,null===(r=null==a?void 0:a.boundaryEvents)||void 0===r||r.forEach((function(t){i.addBoundaryEvent(t)})),i.deleteProperty("boundaryEvents"),rO.call(i),i}return h(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",!e.hover&&(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(bx);return{type:t,view:o,model:r}}var TO=Pm,NO=function(t){function e(e){var n=t.call(this)||this;return n.updatePosition=function(t){var e=t.deltaX,o=t.deltaY,r=n.nodeModel,i=r.x,a=r.y;n.nodeModel.x=i+e/2,n.nodeModel.y=a+o/2,n.nodeModel.moveText(e/2,o/2)},n.getResize=function(t){var e=t.index,n=t.deltaX,o=t.deltaY,r=t.width,i=t.height,a=t.PCTResizeInfo,s=t.pct,l=void 0===s?1:s,u=t.freezeWidth,c=void 0!==u&&u,d=t.freezeHeight,p=void 0!==d&&d,h={width:r,height:i,deltaX:n,deltaY:o};if(a){var f=0,g=0;switch(e){case 0:g=(-1*n-o)/4;break;case 1:g=(n-o)/4;break;case 2:g=(n+o)/4;break;case 3:g=(-1*n+o)/4}0!==g&&(f=Math.round(g/a.ResizeBasis.basisHeight*1e5)/1e3),a.ResizePCT.widthPCT=Math.max(Math.min(a.ResizePCT.widthPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit),a.ResizePCT.heightPCT=Math.max(Math.min(a.ResizePCT.heightPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit);var v=Math.round(a.ResizePCT.widthPCT*a.ResizeBasis.basisWidth/100),y=Math.round(a.ResizePCT.heightPCT*a.ResizeBasis.basisHeight/100);switch(e){case 0:n=r-v,o=i-y;break;case 1:n=v-r,o=i-y;break;case 2:n=v-r,o=y-i;break;case 3:n=r-v,o=y-i}return h.width=v,h.height=y,h.deltaX=n/l,h.deltaY=o/l,h}switch(e){case 0:h.width=c?r:r-n*l,h.height=p?i:i-o*l;break;case 1:h.width=c?r:r+n*l,h.height=p?i:i-o*l;break;case 2:h.width=c?r:r+n*l,h.height=p?i:i+o*l;break;case 3:h.width=c?r:r-n*l,h.height=p?i:i+o*l}return h},n.updateEdgePointByAnchors=function(){var t=n.nodeModel,e=t.id,o=t.anchors,r=n.getNodeEdges(e);r.sourceEdges.forEach((function(t){var e=o.find((function(e){return e.id===t.sourceAnchorId}));e&&t.updateStartPoint({x:e.x,y:e.y})})),r.targetEdges.forEach((function(t){var e=o.find((function(e){return e.id===t.targetAnchorId}));e&&t.updateEndPoint({x:e.x,y:e.y})}))},n.updateRect=function(t){var e=t.deltaX,o=t.deltaY,r=n.nodeModel,i=r.x,a=r.y,s=r.width,l=r.height,u=r.radius,c=r.PCTResizeInfo,d=n.nodeModel,p=d.minWidth,h=d.minHeight,f=d.maxWidth,g=d.maxHeight,v=n.index,y=p===f,m=h===g,b=n.getResize({index:v,deltaX:e,deltaY:o,width:s,height:l,PCTResizeInfo:c,pct:1,freezeWidth:y,freezeHeight:m});if(b.width<p||b.width>f||b.height<h||b.height>g)n.dragHandler.cancelDrag();else{n.updatePosition({deltaX:y?0:b.deltaX,deltaY:m?0:b.deltaY}),n.nodeModel.width=b.width,n.nodeModel.height=b.height,n.nodeModel.setProperties({nodeSize:{width:b.width,height:b.height}});var _={x:i,y:a,width:s,height:l,radius:u},x={x:n.nodeModel.x,y:n.nodeModel.y,width:n.nodeModel.width,height:n.nodeModel.height,radius:u};n.updateEdgePointByAnchors(),n.eventEmit({beforeNode:_,afterNode:x})}},n.updateEllipse=function(t){var e=t.deltaX,o=t.deltaY,r=n.nodeModel,i=r.rx,a=r.ry,s=r.x,l=r.y,u=r.PCTResizeInfo,c=n.index,d=n.nodeModel,p=d.minWidth,h=d.minHeight,g=d.maxWidth,v=d.maxHeight,y=p===g,m=h===v,b=i,_=a,x=n.getResize({index:c,deltaX:e,deltaY:o,width:b,height:_,PCTResizeInfo:u,pct:.5,freezeWidth:y,freezeHeight:m});if(x.width<p/2||x.width>g/2||x.height<h/2||x.height>v/2)n.dragHandler.cancelDrag();else{n.updatePosition({deltaX:y?0:x.deltaX,deltaY:m?0:x.deltaY}),n.nodeModel.rx=x.width,n.nodeModel.ry=x.height,n.nodeModel.setProperties({nodeSize:{rx:x.width,ry:x.height}});var E={x:s,y:l},w={rx:x.width,ry:x.height,x:n.nodeModel.x,y:n.nodeModel.y};n.updateEdgePointByAnchors(),n.eventEmit({beforeNode:f(f({},E),{rx:i,ry:a}),afterNode:w})}},n.updateDiamond=function(t){var e=t.deltaX,o=t.deltaY,r=n.nodeModel,i=r.rx,a=r.ry,s=r.x,l=r.y,u=r.PCTResizeInfo,c=n.index,d=n.nodeModel,p=d.minWidth,h=d.minHeight,f=d.maxWidth,g=d.maxHeight,v=p===f,y=h===g,m=i,b=a,_=n.getResize({index:c,deltaX:e,deltaY:o,width:m,height:b,PCTResizeInfo:u,pct:.5,freezeWidth:v,freezeHeight:y});if(_.width<p/2||_.width>f/2||_.height<h/2||_.height>g/2)n.dragHandler.cancelDrag();else{n.updatePosition({deltaX:v?0:_.deltaX,deltaY:y?0:_.deltaY}),n.nodeModel.rx=_.width,n.nodeModel.ry=_.height,n.nodeModel.setProperties({nodeSize:{rx:_.width,ry:_.height}});var x={x:s,y:l,rx:i,ry:a},E={rx:_.width,ry:_.height,x:n.nodeModel.x,y:n.nodeModel.y};n.updateEdgePointByAnchors(),n.eventEmit({beforeNode:x,afterNode:E})}},n.eventEmit=function(t){var e=t.beforeNode,o=t.afterNode,r=n.nodeModel,i=r.id,a=r.modelType,s=r.type,l=f({id:i,modelType:a,type:s},e),u=f({id:i,modelType:a,type:s},o);n.graphModel.eventCenter.emit("node:resize",{preData:l,data:u,model:n.nodeModel})},n.onDragging=function(t){var e,o=t.deltaX,r=t.deltaY,i=n.graphModel.transformModel,a=n.nodeModel.modelType;o=(e=_(i.fixDeltaXY(o,r),2))[0],r=e[1],a===Cm.RECT_NODE||a===Cm.HTML_NODE?n.updateRect({deltaX:o,deltaY:r}):a===Cm.ELLIPSE_NODE?n.updateEllipse({deltaX:o,deltaY:r}):a===Cm.DIAMOND_NODE&&n.updateDiamond({deltaX:o,deltaY:r})},n.onDragEnd=function(){var t=n.graphModel.gridSize,e=void 0===t?1:t,o=e*Math.round(n.nodeModel.x/e),r=e*Math.round(n.nodeModel.y/e);n.nodeModel.moveTo(o,r),n.updateEdgePointByAnchors()},n.index=e.index,n.nodeModel=e.model,n.graphModel=e.graphModel,n.dragHandler=new TO({onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:1}),n}return h(e,t),e.prototype.getNodeEdges=function(t){for(var e=this.graphModel.edges,n=[],o=[],r=0;r<e.length;r++){var i=e[r];i.sourceNodeId===t?n.push(i):e[r].targetNodeId===t&&o.push(i)}return{sourceEdges:n,targetEdges:o}},e.prototype.render=function(){var t=this.props,e=t.x,n=t.y,o=t.index,r=t.model.getControlPointStyle();return xr("g",{className:"lf-resize-control-".concat(o),children:xr(rE,f({className:"lf-node-control",x:e,y:n},r,{onMouseDown:this.dragHandler.handleMouseDown}))})},e}(ho),AO=function(t){function e(){var e=t.call(this)||this;return e.state={},e}return h(e,t),e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,o=e.x,r=e.y,i=e.width,a=e.height,s={minX:o-i/2,minY:r-a/2,maxX:o+i/2,maxY:r+a/2},l=s.minX,u=s.minY,c=s.maxX,d=s.maxY;return[{x:l,y:u},{x:c,y:u},{x:c,y:d},{x:l,y:d}].map((function(t,o){return xr(NO,f({index:o},t,{model:e,graphModel:n}))}))},e.prototype.getGroupSolid=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.getResizeOutlineStyle();return xr(rE,f({},i,{x:e,y:n,width:o,height:r}))},e.prototype.render=function(){return xr("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},e}(ho),PO=function(t){function e(e,n){var o=t.call(this,e,n)||this,r=e.properties.nodeSize;return r&&(o.rx=r.rx,o.ry=r.ry),o}return h(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(cx),DO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return xr(AO,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel.isSilentMode;return xr("g",{children:[this.getResizeShape(),e.isSelected&&!n?this.getControlGroup():""]})},e}(Xw),kO={type:"ellipse",view:DO,model:PO},RO=function(t){function e(e,n){var o=t.call(this,e,n)||this,r=e.properties.nodeSize;return r&&(o.rx=r.rx,o.ry=r.ry),o}return h(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(ax),LO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return xr(AO,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){var t=this.props.model,e=t.points,n=t.getNodeStyle();return xr("g",{children:xr(vE,f({},n,{points:e}))})},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return xr("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(zw),IO={type:"diamond",view:LO,model:RO},jO=function(t){function e(e,n){var o=t.call(this,e,n)||this,r=e.properties.nodeSize;return r&&(o.width=r.width,o.height=r.height),o}return h(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(Tx),BO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return xr(AO,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return xr("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(Jw),HO={type:"html",view:BO,model:jO},FO=function(t){function e(e,n){var o=t.call(this,e,n)||this,r=e.properties.nodeSize;return r&&(o.width=r.width,o.height=r.height),o}return h(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(bx),zO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return xr(AO,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return xr("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(Dw),WO={type:"rect",view:zO,model:FO},UO={pluginName:"nodeResize",step:0,install:function(t){t.register(kO),t.register(IO),t.register(HO),t.register(WO)}},XO=function(t){function e(){var e=t.apply(this,x([],_(arguments),!1))||this;return e.isGroup=!0,e.isFolded=!1,e.unfoldedWidth=500,e.unfoldedHeight=300,e.childrenLastFoldStatus={},e}return h(e,t),e.prototype.initNodeData=function(e){var n=this;t.prototype.initNodeData.call(this,e);var o=[];zr(e.children)&&(o=e.children),this.children=new Set(o),this.width=500,this.height=300,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=-1e4,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,void 0===this.properties.isFolded&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout((function(){n.isFolded&&n.foldGroup(n.isFolded)}))},e.prototype.getResizeOutlineStyle=function(){var e=t.prototype.getResizeOutlineStyle.call(this);return e.stroke="none",e},e.prototype.foldGroup=function(t){var e=this;if(t!==this.isFolded){this.setProperty("isFolded",t),this.isFolded=t,t?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var n=x(x([],_(this.incoming.edges),!1),_(this.outgoing.edges),!1);this.children.forEach((function(o){var r=e.graphModel.getElement(o);if(r){var i=r.isFolded;if(r.isGroup&&!r.isFolded&&r.foldGroup(t),r.isGroup&&!t){var a=e.childrenLastFoldStatus[o];void 0!==a&&a!==r.isFolded&&r.foldGroup(a)}e.childrenLastFoldStatus[o]=!!i,r.visible=!t;var s=r.incoming.edges,l=r.outgoing.edges;n=x(x(x([],_(n),!1),_(s),!1),_(l),!1)}})),this.foldEdge(t,n)}},e.prototype.getAnchorStyle=function(e){var n=t.prototype.getAnchorStyle.call(this,e);return n.stroke="transparent",n.fill="transparent",n.hover.fill="transparent",n.hover.stroke="transparent",n},e.prototype.foldEdge=function(t,e){var n=this;e.forEach((function(e,o){var r=e.id,i=e.sourceNodeId,a=e.targetNodeId,s=e.startPoint,l=e.endPoint,u=e.type,c=e.text,d=e.getProperties(),p={id:"".concat(r,"__").concat(o),sourceNodeId:i,targetNodeId:a,startPoint:s,endPoint:l,type:u,properties:d,text:null==c?void 0:c.value};e.virtual&&n.graphModel.deleteEdgeById(e.id);var h=n.graphModel.group.getNodeGroup(a);h||(h=n.graphModel.getNodeModelById(a));var f=n.graphModel.group.getNodeGroup(i);f||(f=n.graphModel.getNodeModelById(i)),t&&!1!==e.visible&&(n.children.has(i)||n.id===i?(p.startPoint=void 0,p.sourceNodeId=n.id):(p.endPoint=void 0,p.targetNodeId=n.id),h.id===n.id&&f.id===n.id||n.createVirtualEdge(p),e.visible=!1),t||!1!==e.visible||(h&&h.isGroup&&h.isFolded?(p.targetNodeId=h.id,p.endPoint=void 0,n.createVirtualEdge(p)):f&&f.isGroup&&f.isFolded?(p.sourceNodeId=f.id,p.startPoint=void 0,n.createVirtualEdge(p)):e.visible=!0)}))},e.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var e=this.graphModel.addEdge(t);e.virtual=!0,e.text.editable=!1,e.isFoldedEdge=!0},e.prototype.isInRange=function(t){var e=t.minX,n=t.minY,o=t.maxX,r=t.maxY;return e>=this.x-this.width/2&&o<=this.x+this.width/2&&n>=this.y-this.height/2&&r<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(t){var e=t.x1,n=t.y1,o=t.x2,r=t.y2;return{x:e>=this.x-this.width/2&&o<=this.x+this.width/2,y:n>=this.y-this.height/2&&r<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(t){this.setProperty("groupAddable",t)},e.prototype.addChild=function(t){this.children.add(t),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(t){this.children.delete(t),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var e=this,n=t.prototype.getData.call(this);n.children=[],this.children.forEach((function(t){var o=e.graphModel.getNodeModelById(t);o&&!o.virtual&&n.children.push(t)}));var o=n.properties;return null==o||delete o.groupAddable,null==o||delete o.isFolded,n},e.prototype.getHistoryData=function(){var e=t.prototype.getData.call(this);e.children=x([],_(this.children),!1),e.isGroup=!0;var n=e.properties;return null==n||delete n.groupAddable,(null==n?void 0:n.isFolded)&&(e.x=e.x+this.unfoldedWidth/2-this.foldedWidth/2,e.y=e.y+this.unfoldedHeight/2-this.foldedHeight/2),e},e.prototype.isAllowAppendIn=function(t){return console.info("_nodeData",t),!0},e.prototype.toBack=function(){this.zIndex--},e}(FO),GO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var e=this.props.model,n=e.resizable,o=e.properties;return n&&!o.isFolded?t.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var t=this.props.model,e=t.width,n=t.height,o=t.x,r=t.y,i=t.radius,a=t.properties,s=t.getAddableOutlineStyle;if(!a.groupAddable)return null;var l=this.props.model.getNodeStyle().strokeWidth,u=void 0===l?0:l,c=s(),d=e+u+8,p=n+u+8;return uo("rect",f(f({},c),{width:d,height:p,x:o-d/2,y:r-p/2,rx:i,ry:i}))},e.prototype.getFoldIcon=function(){var t=this.props.model,e=t.x-t.width/2+5,n=t.y-t.height/2+5;if(!t.foldable)return null;var o=uo("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:t.properties.isFolded?"M ".concat(e+3,",").concat(n+6," ").concat(e+11,",").concat(n+6," M").concat(e+7,",").concat(n+2," ").concat(e+7,",").concat(n+10):"M ".concat(e+3,",").concat(n+6," ").concat(e+11,",").concat(n+6," ")});return uo("g",{},[uo("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:t.x-t.width/2+5,y:t.y-t.height/2+5,onClick:function(){t.foldGroup(!t.properties.isFolded)}}),o])},e.prototype.getResizeShape=function(){return uo("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},e}(zO),YO={type:"group",view:GO,model:XO},VO=-1e4,KO=function(){function t(t){var e=t.lf,n=this;this.topGroupZIndex=VO,this.nodeGroupMap=new Map,this.graphRendered=function(t){var e=t.data;e&&e.nodes&&(e.nodes.forEach((function(t){t.children&&t.children.forEach((function(e){n.nodeGroupMap.set(e,t.id)}))})),n.checkAndCorrectTopGroupZIndex(e.nodes))},this.appendNodeToGroup=function(t){var e=t.data,o=n.nodeGroupMap.get(e.id);if(o){var r=n.lf.getNodeModelById(o);r.removeChild(e.id),n.nodeGroupMap.delete(e.id),r.setAllowAppendChild(!1)}var i=n.lf.getNodeModelById(e.id),a=null==i?void 0:i.getBounds();if(a&&i){var s=n.getGroup(a,e);if(i.isGroup&&(e.children.forEach((function(t){n.nodeGroupMap.set(t,e.id)})),n.checkAndCorrectTopGroupZIndex([e]),n.nodeSelected({data:e,isSelected:!1,isMultiple:!1})),!s)return;if(!s.isAllowAppendIn(e))return void n.lf.emit("group:not-allowed",{group:s.getData(),node:e});s.addChild(e.id),n.nodeGroupMap.set(e.id,s.id),s.setAllowAppendChild(!1)}},this.deleteGroupChild=function(t){var e=t.data;e.children&&e.children.forEach((function(t){n.nodeGroupMap.delete(t),n.lf.deleteNode(t)}));var o=n.nodeGroupMap.get(e.id);o&&(n.lf.getNodeModelById(o).removeChild(e.id),n.nodeGroupMap.delete(e.id))},this.setActiveGroup=function(t){var e=t.data,o=n.lf.getNodeModelById(e.id),r=null==o?void 0:o.getBounds();if(o&&r){var i=n.getGroup(r,e);if(n.activeGroup&&n.activeGroup.setAllowAppendChild(!1),!i||o.isGroup&&i.id===e.id)return;if(!i.isAllowAppendIn(e))return;n.activeGroup=i,n.activeGroup.setAllowAppendChild(!0)}},this.findNodeAndChildMaxZIndex=function(t){var e=VO;return t.isGroup&&(e=Math.max(e,t.zIndex)),t.children&&t.children.forEach((function(t){"object"==typeof t&&(t=t.id);var o=n.lf.getNodeModelById(t);if(null==o?void 0:o.isGroup){var r=n.findNodeAndChildMaxZIndex(o);e=Math.max(r,e)}})),e},this.checkAndCorrectTopGroupZIndex=function(t){var e=VO;if(t.forEach((function(t){var o=n.lf.getNodeModelById(t.id);if(o){var r=n.findNodeAndChildMaxZIndex(o);r>e&&(e=r)}})),!(n.topGroupZIndex>=e)){for(var o=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})),r=n.topGroupZIndex,i=0;i<o.length;i++){var a=o[i];a.zIndex>r&&(r=a.zIndex)}n.topGroupZIndex=r}},this.nodeSelected=function(t){var e=t.data,o=t.isMultiple,r=t.isSelected,i=n.lf.getNodeModelById(e.id);if(n.toFrontGroup(i),n.topGroupZIndex>-1e3){n.topGroupZIndex=VO;for(var a=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})).sort((function(t,e){return t.zIndex-e.zIndex})),s=0,l=0;l<a.length;l++){var u=a[l];u.zIndex!==s&&(n.topGroupZIndex++,s=u.zIndex),u.setZIndex(n.topGroupZIndex)}}if(o&&r)if(null==i?void 0:i.isGroup)i.children.forEach((function(t){var e=n.lf.graphModel.getElement(t);null==e||e.setSelected(!1)}));else{var c=n.nodeGroupMap.get(e.id);if(c){var d=n.lf.getNodeModelById(c);(null==d?void 0:d.isSelected)&&(null==i||i.setSelected(!1))}}},this.toFrontGroup=function(t){t&&t.isGroup&&(n.topGroupZIndex++,t.setZIndex(n.topGroupZIndex),t.children&&t.children.forEach((function(t){var e=n.lf.getNodeModelById(t);n.toFrontGroup(e)})))},e.register(YO),this.lf=e,e.graphModel.addNodeMoveRules((function(t,o,r){if(t.isGroup){var i=n.getNodeAllChild(t);return e.graphModel.moveNodes(i,o,r,!0),!0}var a=e.getNodeModelById(n.nodeGroupMap.get(t.id));if(a&&a.isRestrict){var s=t.getBounds(),l=s.minX,u=s.minY,c=s.maxX,d=s.maxY;return a.isAllowMoveTo({x1:l+o,y1:u+r,x2:c+o,y2:d+r})}return!0})),e.graphModel.group=this,e.on("node:add,node:drop,node:dnd-add",this.appendNodeToGroup),e.on("node:delete",this.deleteGroupChild),e.on("node:dnd-drag,node:drag",this.setActiveGroup),e.on("node:click",this.nodeSelected),e.on("graph:rendered",this.graphRendered),e.addElements=function(t,o){var r=t.nodes,i=t.edges,a={},s={nodes:[],edges:[]},l=[];return oh(r,(function(t){var r=t.id,i=t.children,u=g(t,["children"]),c=e.addNode(u);if(!c)return{nodes:[],edges:[]};r&&(a[r]=c.id),s.nodes.push(c);var d=n.createAllChildNodes(a,i,c,o).edgesArray;l.push.apply(l,x([],_(d),!1))})),l.forEach((function(t){n.createEdgeModel(t,a,o)})),oh(i,(function(t){var e=n.createEdgeModel(t,a,0);s.edges.push(e)})),s}}return t.prototype.createAllChildNodes=function(t,e,n,o){var r=this,i=this.lf,a=[],s=[],l=[];null==e||e.forEach((function(e){var u=i.getNodeModelById(e);if(u){var c=u.x,d=u.y,p=u.properties,h=u.type,f=u.rotate,g=u.children,v={x:c+o,y:d+o,properties:p,type:h,rotate:f},y=Om.NODE_GROUP_COPY||"node:group-copy-add",m=i.addNode(v,y);if(n.addChild(m.id),t[e]=m.id,l.push(m),u.incoming.edges.forEach((function(t){s.push(t)})),u.outgoing.edges.forEach((function(t){s.push(t)})),g instanceof Set){var b=r.createAllChildNodes(t,g,m,o),E=b.nodesArray,w=b.edgesArray;l.push.apply(l,x([],_(E),!1)),a.push.apply(a,x([],_(w),!1))}}}));var u=s.filter((function(e){return t[e.sourceNodeId]&&t[e.targetNodeId]})).map((function(t){return t.getData()}));return{nodesArray:l,edgesArray:a.concat(u)}},t.prototype.createEdgeModel=function(t,e,n){var o=this.lf,r=t.sourceNodeId,i=t.targetNodeId;e[r]&&(r=e[r]),e[i]&&(i=e[i]);var a=t.type,s=t.startPoint,l=t.endPoint,u=t.pointsList,c=t.text,d={x:((null==s?void 0:s.x)||0)+n,y:((null==s?void 0:s.y)||0)+n},p={x:((null==l?void 0:l.x)||0)+n,y:((null==l?void 0:l.y)||0)+n},h=[];u&&u.length>0&&(h=u.map((function(t){return t.x+=n,t.y+=n,t})));var g={type:a,startPoint:d,endPoint:p,sourceNodeId:r,targetNodeId:i,pointsList:h};return Jr(c)&&!Df(c)&&(g.text=f(f({},c),{x:(null==c?void 0:c.x)+n,y:(null==c?void 0:c.y)+n})),o.graphModel.addEdge(g)},t.prototype.getNodeAllChild=function(t){var e=this,n=[];return t.children&&t.children.forEach((function(t){n.push(t);var o=e.lf.getNodeModelById(t);(null==o?void 0:o.isGroup)&&(n=n.concat(e.getNodeAllChild(o)))})),n},t.prototype.getGroup=function(t,e){var n=this.lf.graphModel.nodes.filter((function(n){return n.isGroup&&n.isInRange(t)&&n.id!==e.id}));if(0!==n.length){if(1===n.length)return n[0];for(var o=n[n.length-1],r=n.length-2;r>=0;r--)n[r].zIndex>o.zIndex&&(o=n[r]);return o}},t.prototype.getNodeGroup=function(t){var e=this.nodeGroupMap.get(t);if(e)return this.lf.getNodeModelById(e)},t.prototype.render=function(){},t.prototype.destroy=function(){},t.pluginName="group",t}();function qO(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getFoldIcon=function(){var t=this.props.model,e=t,n=e.x,o=e.y,r=e.width,i=e.height,a=e.properties,s=e.foldable,l=t.x-t.width/2+5,u=t.y-t.height/2+5;if(!s)return null;var c=uo("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:a.isFolded?"M ".concat(l+3,",").concat(u+6," ").concat(l+11,",").concat(u+6," M").concat(l+7,",").concat(u+2," ").concat(l+7,",").concat(u+10):"M ".concat(l+3,",").concat(u+6," ").concat(l+11,",").concat(u+6," ")});return uo("g",{},[uo("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:n-r/2+5,y:o-i/2+5,onClick:function(e){var n,o;null===(o=(n=e.stopPropagation()(t)).foldGroup)||void 0===o||o.call(n,!a.isFolded)}}),c])},e.prototype.getResizeShape=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.getNodeStyle(),a=f(f({},i),{x:e-o/2,y:n-r/2,width:o,height:r,stroke:"black",strokeWidth:2,strokeDasharray:"0 0"});return uo("g",{},[uo("rect",f({},a)),this.getFoldIcon()])},e}(GO),e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.foldable=!0,this.resizable=!0,this.width=400,this.height=200,this.resetWidthHeight(),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.resetWidthHeight=function(){var t,e,n=null===(t=this.properties.iniProp)||void 0===t?void 0:t.width,o=null===(e=this.properties.iniProp)||void 0===e?void 0:e.height;n&&(this.width=n),o&&(this.height=o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke="#989891",e.strokeWidth=1,e.strokeDasharray="3 3",this.isSelected&&(e.stroke="rgb(124, 15, 255)"),this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.addChild=function(e){var n=this.graphModel.getElement(e);null==n||n.setProperties({parent:this.id}),t.prototype.addChild.call(this,e)},e.prototype.getAnchorStyle=function(){var e=t.prototype.getAnchorStyle.call(this);return e.stroke="#000",e.fill="#fff",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(XO);return{type:"bpmn:subProcess",view:t,model:e}}function ZO(t){var e=MO("bpmn:serviceTask",bO),n=MO("bpmn:userTask",_O);t.register(e),t.register(n),t.register(qO()),function(t){function e(t,e){var n=t.x,o=t.y,r=t.width,i=t.height,a=t.id,s=n-r/2,l=n+r/2,u=o-i/2,c=o+i/2,d=e.x,p=e.y;return d>s-5&&d<l+5&&p>u-5&&p<c+5&&!(d>s+5&&d<l-5&&p>u+5&&p<c-5)?a:null}t.on("node:drag,node:dnd-drag",(function(n){var o,r,i=n.data;if("bpmn:boundaryEvent"===i.type){var a=t.graphModel.nodes;try{for(var s=b(a),l=s.next();!l.done;l=s.next()){var u=l.value;u.isTaskNode&&(e(u,i)?u.setTouching(!0):u.setTouching(!1))}}catch(t){o={error:t}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}}})),t.on("node:drop,node:dnd-add",(function(n){var o,r,i=n.data,a=i.type,s=i.id;if("bpmn:boundaryEvent"===a){var l=t.graphModel.nodes;try{for(var u=b(l),c=u.next();!c.done;c=u.next()){var d,p=c.value;if(p.isTaskNode)if(null!==(d=e(p,i))){var h=t.graphModel.getNodeModelById(s),f=t.graphModel.getNodeModelById(d),g=h.properties.attachedToRef;return g&&g!==d&&t.graphModel.getNodeModelById(g).deleteBoundaryEvent(s),void f.addBoundaryEvent(s)}}}catch(t){o={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(o)throw o.error}}}})),t.graphModel.addNodeMoveRules((function(e,n,o){if(e.isTaskNode){var r=e.boundaryEvents;return t.graphModel.moveNodes(r,n,o,!0),!0}return!0}))}(t)}function $O(t){var e=function(e){function n(n,o){n.id||(n.id="Flow_".concat(sO()));var r=f(f(f({},t||{}),n.properties),{isDefaultFlow:!1});return n.properties=r,e.call(this,n,o)||this}return h(n,e),n.extendKey="SequenceFlowModel",n}(Y_),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getStartArrow=function(){return uo("path",this.props.model.properties.isDefaultFlow?{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}:{d:""})},e.extendKey="SequenceFlowEdge",e}(_S);return{type:"bpmn:sequenceFlow",view:n,model:e}}var JO=$O();var QO=[{nodes:["startEvent","intermediateCatchEvent","boundaryEvent"],definition:[{type:"bpmn:timerEventDefinition",icon:fO,properties:{definitionType:"bpmn:timerEventDefinition",timerValue:"",timerType:""}}]}];function tM(t){function e(e){e.forEach((function(e){var n,o;n=e.nodes,o=e.definition,n.forEach((function(e){(null==t?void 0:t[e])||(t[e]=new Map);var n=null==t?void 0:t[e];o.forEach((function(t){n.set(t.type,t)}))}))}))}return function(){return[t,e]}}var eM=function(){function t(t){var e=t.lf;e.definition={},e.useDefinition=tM(e.definition);var n=_(e.useDefinition(),2),o=n[0],r=n[1];console.log("_definition",o),r(QO),function(t){t.register(dO(t)),t.register(uO(t)),t.register(cO(t)),t.register(hO(t)),t.register(pO(t))}(e),function(t){var e=CO("bpmn:exclusiveGateway",vO),n=CO("bpmn:parallelGateway",yO),o=CO("bpmn:inclusiveGateway",mO);t.register(e),t.register(o),t.register(n)}(e),function(t){t.register(JO)}(e),ZO(e),e.setDefaultEdgeType("bpmn:sequenceFlow")}return t.pluginName="BpmnElementsPlugin",t}(),nM=40,oM=40,rM=40,iM=40,aM=100,sM=80,lM=100,uM=80,cM=100,dM=80,pM=100,hM=80,fM=100,gM=80,vM=100,yM=80,mM=100,bM=80,_M=100,xM=80,EM=function(){};(EM.ObjTree=function(){return this}).VERSION="0.23",EM.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',EM.ObjTree.prototype.attr_prefix="-",EM.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},EM.ObjTree.prototype.parseHTTP=function(t,e,n){var o,r={};for(var i in e)r[i]=e[i];if(r.method||(void 0===r.postBody&&void 0===r.postbody&&void 0===r.parameters?r.method="get":r.method="post"),n){r.asynchronous=!0;var a=this,s=n,l=r.onComplete;r.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),s(e,t),l&&l(t)}}else r.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)r.uri=t,(u=new HTTP.Request(r))&&(o=u.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var u;(u=new Ajax.Request(t,r))&&(o=u.transport)}return n?o:o&&o.responseXML&&o.responseXML.documentElement?this.parseDOM(o.responseXML.documentElement):void 0},EM.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!==t.nodeType){var o={};o[t.nodeName]=n,n=o}return n}},EM.ObjTree.prototype.parseElement=function(t){if(7!==t.nodeType){if(3===t.nodeType||4===t.nodeType||8===t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var o=0;o<t.attributes.length;o++){if("string"==typeof(s=t.attributes[o].nodeName)){var r=t.attributes[o].nodeValue;try{r=JSON.parse(t.attributes[o].nodeValue.replace(/'/g,'"'))}catch(e){r=t.attributes[o].nodeValue}null!=r&&(void 0===n[s=this.attr_prefix+s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],r))}}}if(t.childNodes&&t.childNodes.length){var i=!0;e&&(i=!1);for(o=0;o<t.childNodes.length&&i;o++){var a=t.childNodes[o].nodeType;3!==a&&4!==a&&8!==a&&(i=!1)}if(i){e||(e="");for(o=0;o<t.childNodes.length;o++)e+=t.childNodes[o].nodeValue}else{e||(e={});for(o=0;o<t.childNodes.length;o++){var s;if("string"==typeof(s=t.childNodes[o].nodeName))(r=this.parseElement(t.childNodes[o]))&&(void 0===n[s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],r))}}}else null===e&&(e={});return e}},EM.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(1===n&&(t[e]=[]),t[e][t[e].length]=o):1===n?t[e]=o:2===n?t[e]=[t[e],o]:t[e][t[e].length]=o},EM.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},EM.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var r in e)if(Zh(e,r)){var i=e[r];r.charAt(0)!==this.attr_prefix?void 0===i||null==i?n[n.length]="<".concat(r," />"):"object"==typeof i&&i.constructor===Array?n[n.length]=this.array_to_xml(r,i):n[n.length]="object"==typeof i?this.hash_to_xml(r,i):this.scalar_to_xml(r,i):o[o.length]=" ".concat(r.substring(1),'="').concat(this.xml_escape(i),'"')}var a=o.join(""),s=n.join("");return void 0===t||null==t||(s=n.length>0?s.match(/\n/)?"<".concat(t).concat(a,">\n").concat(s,"</").concat(t,">\n"):"<".concat(t).concat(a,">").concat(s,"</").concat(t,">\n"):"<".concat(t).concat(a," />\n")),s},EM.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o<e.length;o++){var r=e[o];void 0===r||null==r?n[n.length]="<".concat(t," />"):"object"==typeof r&&r.constructor===Array?n[n.length]=this.array_to_xml(t,r):n[n.length]="object"==typeof r?this.hash_to_xml(t,r):this.scalar_to_xml(t,r)}return n.join("")},EM.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"===t?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,">\n")},EM.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};function wM(t){return Object.prototype.toString.call(t)}function SM(t){return" ".repeat(t)}function CM(t){return"[object Object]"===wM(t)?Object.keys(t).reduce((function(e,n){var o=n;return"-"===n.charAt(0)&&(o=n.substring(1)),e[o]=CM(t[n]),e}),{}):Array.isArray(t)?t.map((function(t){return CM(t)})):t}var OM,MM="\t\n";function TM(t,e,n){var o=SM(n),r="",i=MM+o;if("-json"===e)return"";if("#text"===e)return i+t;if("#cdata-section"===e)return"".concat(i,"<![CDATA[").concat(t,"]]>");if("#comment"===e)return"".concat(i,"\x3c!--").concat(t,"--\x3e");if("-"==="".concat(e).charAt(0))return" ".concat(e.substring(1),'="').concat(function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(CM(t)).replace(/"/g,"'")}return e}(t),'"');if(Array.isArray(t))r+=t.map((function(t){return TM(t,e,n+1)})).join("");else if("[object Object]"===wM(t)){var a=Object.keys(t),s="",l=t["-json"]?MM+SM(n+1)+t["-json"]:"";r+="".concat(0===n?"":i,"<").concat(e),a.forEach((function(e){"-"===e.charAt(0)?s+=TM(t[e],e,n+1):l+=TM(t[e],e,n+1)})),r+=s+(""!==l?">".concat(l).concat(i,"</").concat(e,">"):" />")}else r+="".concat(i,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return r}!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"}(OM||(OM={}));var NM=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],AM=["properties","startPoint","endPoint","pointsList"],PM={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},DM=function(t,e){return Object.keys(e||{}).forEach((function(n){if(t[n]){var o=e[n],r=o.in,i=o.out;r&&(t[n].in=r),i&&(t[n].out=i)}else t[n]=e[n]})),t},kM={"bpmn:startEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=kM[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=kM[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=kM[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=kM[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,o=e.condition;return o?"cdata"===n?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(o,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(o,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,o=e.timerValue,r=e.definitionId;return{json:'<bpmn:timerEventDefinition id="'.concat(r,'"').concat(n&&o?">".concat("<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(o,"</bpmn:").concat(n,">"),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,o,r,i=t,a=e["-id"],s="",l="";try{for(var u=b(Object.keys(e)),c=u.next();!c.done;c=u.next()){var d=c.value;d.includes("bpmn:")&&(s=_(d.split(":"),2)[1],l=null===(r=e[d])||void 0===r?void 0:r["#text"])}}catch(t){n={error:t}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return{"-definitionId":a,"-definitionType":i,"-timerType":s,"-timerValue":l}}},"bpmn:conditionExpression":{in:function(t,e){var n,o="",r="";return e["#cdata-section"]?(r="cdata",o=(null===(n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))||void 0===n?void 0:n[1])||""):e["#text"]&&(r="normal",o=e["#text"]),{"-condition":o,"-expressionType":r}}}};function RM(t){var e=null!=t?t:{},n=e.retainedAttrsFields,o=e.excludeFields,r=e.transformer,i=new Set(x(x([],_(AM),!1),_(n||[]),!1)),a={in:new Set(x(x([],_(PM.in),!1),_((null==o?void 0:o.in)||[]),!1)),out:new Set(x(x([],_(PM.out),!1),_((null==o?void 0:o.out)||[]),!1))};return kM=DM(kM,r),function(t){var e=t.nodes,n=t.edges;return function t(o,r){var s,l;if(1!==(null==o?void 0:o.flag)){var u;if((u=kM[o.type])&&u.out){var c=u.out(o),d=Object.keys(c);d.length>0&&d.forEach((function(t){o[t]=c[t]}))}(null==o?void 0:o.children)&&(o.children=o.children.map((function(t){return e.find((function(e){return e.id===t}))||n.find((function(e){return e.id===t}))||{}})));var p={};if("string"==typeof o)return o;if(Array.isArray(o))return o.map((function(e){return t(e,"")})).filter((function(t){return null!=t}));try{for(var h=b(Object.entries(o)),f=h.next();!f.done;f=h.next()){var g=_(f.value,2),v=g[0],y=g[1];if(1===(null==y?void 0:y.flag))return;var m=[r,v].filter((function(t){return t})).join(".");a.out.has(m)||("object"!=typeof y?0===v.indexOf("-")||["#text","#cdata-section","#comment"].includes(v)?p[v]=y:p["-".concat(v)]=y:i.has(m)?p["-".concat(v)]=t(y,m):p[v]=t(y,m))}}catch(t){s={error:t}}finally{try{f&&!f.done&&(l=h.return)&&l.call(h)}finally{if(s)throw s.error}}return p}}(t,"")}}function LM(t){var e,n,o={};try{for(var r=b(Object.entries(t)),i=r.next();!i.done;i=r.next()){var a=_(i.value,2),s=a[0],l=a[1];0===s.indexOf("-")?o[s.substring(1)]=CM(l):"string"==typeof l?o[s]=l:"[object Object]"===Object.prototype.toString.call(l)?o[s]=LM(l):Array.isArray(l)?o[s]=l.map((function(t){return LM(t)})):o[s]=l}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o}function IM(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,o=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),r={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":o};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(r["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),r})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,o=100,r=80,i=t.x,a=t.y,s=zM.shapeConfigMap.get(t.type);s&&(o=s.width,r=s.height),i-=o/2,a-=r/2;var l={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":i,"-y":a,"-width":o,"-height":r}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(l["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),l}))}var jM=["bpmn:incoming","bpmn:outgoing"];function BM(t,e){var n=[],o=[],r=new Map,i=null!=e?e:{},a=i.transformer,s=i.excludeFields,l={in:new Set(x(x([],_(PM.in),!1),_((null==s?void 0:s.in)||[]),!1)),out:new Set(x(x([],_(PM.out),!1),_((null==s?void 0:s.out)||[]),!1))};kM=DM(kM,a);var u,c,d=t["bpmn:definitions"];if(d){var p=d["bpmn:process"];u=p,c=[function(t){function e(t){t["-children"]||(t["-children"]=[]),Object.keys(t).forEach((function(e){var n;0!==e.indexOf("bpmn:")||jM.includes(e)||(p[e]||(p[e]=[]),!Array.isArray(p[e])&&(p[e]=[p[e]]),Array.isArray(t[e])?(n=p[e]).push.apply(n,x([],_(t[e]),!1)):p[e].push(t[e]),Array.isArray(t[e])?t[e].forEach((function(n){!e.includes("Flow")&&t["-children"].push(n["-id"])})):!e.includes("Flow")&&t["-children"].push(t[e]["-id"]),delete t[e])}))}if("bpmn:subProcess"===t){var n=p[t];Array.isArray(n)?n.forEach((function(n){"bpmn:subProcess"===t&&e(n)})):e(n)}},function(t){function e(t){var n;r.set(t["-id"],t),Array.isArray(t)?t.forEach((function(t){e(t)})):"object"==typeof t&&(n=t,Object.keys(n).forEach((function(t){var o,r;if(t.includes("bpmn:")){var i={};kM[t]&&kM[t].in?(i=null===(r=(o=kM[t]).in)||void 0===r?void 0:r.call(o,t,Ji.cloneDeep(n[t])),delete n[t]):e(n[t]);var a=void 0;(a=Reflect.ownKeys(i)).length>0&&a.forEach((function(t){Reflect.set(n,t,i[t])}))}})))}e(p[t])},function(t){if(0===t.indexOf("bpmn:")){var e=p[t];if("bpmn:sequenceFlow"===t){var i=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];o=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var o;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(FM(o,t))}));else{var o=void 0;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(FM(o,t))}return n}(e,i)}else{var a=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if("bpmn:boundaryEvent"===t){var s=p[t],l=function(t){var e=t["-attachedToRef"],n=r.get(e);n["-boundaryEvents"]||(n["-boundaryEvents"]=[]),n["-boundaryEvents"].push(t["-id"])};Array.isArray(s)?s.forEach((function(t){l(t)})):l(s)}n=n.concat(function(t,e,n){var o=[];if(Array.isArray(t))t.forEach((function(t){var r=HM(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(r)}));else{var r=HM(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(r)}return o}(e,a,t))}}}],c.forEach((function(t){try{Object.keys(u).forEach((function(e){try{t(e)}catch(t){console.error(t)}}))}catch(t){console.error(t)}}))}var h=function(t,e,n){Object.keys(t).forEach((function(o){var r=n?"".concat(n,".").concat(o):o;e.has(r)?delete t[o]:"object"==typeof t[o]&&h(t[o],e,r)}))};return n.forEach((function(t){var n,o;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var r=null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.in,i=t.type;r[i]&&(t.type=r[i])}h(t,l.in,"")})),o.forEach((function(t){var n,o;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var r=null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.in,i=t.type;r[i]&&(t.type=r[i])}h(t,l.in,"")})),{nodes:n,edges:o}}function HM(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),r=Number(t["dc:Bounds"]["-y"]),i=n["-children"],a=n["-name"],s=zM.shapeConfigMap.get(e);s&&(o+=s.width/2,r+=s.height/2);var l,u={};if(Object.entries(n).forEach((function(t){var e=_(t,2),n=e[0],o=e[1];NM.includes(n)||(u[n]=o)})),u=LM(u),a&&(l={x:o,y:r,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];l.x=Number(c["-x"])+Number(c["-width"])/2,l.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:o,y:r,properties:u};return i&&(d.children=i),l&&(d.text=l),d}function FM(t,e){var n,o=e["-name"];if(o){var r=t["bpmndi:BPMNLabel"]["dc:Bounds"],i=0;o.split("\n").forEach((function(t){i<t.length&&(i=t.length)})),n={value:o,x:Number(r["-x"])+10*i/2,y:Number(r["-y"])+7}}var a={};Object.entries(e).forEach((function(t){var e=_(t,2),n=e[0],o=e[1];NM.includes(n)||(a[n]=o)})),a=LM(a);var s=t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),l={id:e["-id"],type:OM.FLOW,pointsList:s,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(l.text=n),l}var zM=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var o,r,i=f({},n.processAttributes);!function(t,e,n){var o,r=new Map,i=RM(n)(e);i.nodes.forEach((function(e){var n=e["-id"],o=e["-type"],i=e.text,a=e.children,s=g(e,["-id","-type","text","children"]),l={"-id":n};(null==i?void 0:i["-value"])&&(l["-name"]=i["-value"]),s["-json"]&&(l["-json"]=s["-json"]),s["-properties"]&&Object.assign(l,s["-properties"]),a&&(l.children=a),t[o]||(t[o]=[]),t[o].push(l),r.set(n,l)}));var a=i.edges.map((function(t){var e=t["-id"],n=t["-sourceNodeId"],o=t["-targetNodeId"],i=t.text,a=g(t,["-id","-sourceNodeId","-targetNodeId","text"]),s=r.get(o);s["bpmn:incoming"]||(s["bpmn:incoming"]=[]),s["bpmn:incoming"].push(e);var l={"-id":e,"-sourceRef":n,"-targetRef":o};return(null==i?void 0:i["-value"])&&(l["-name"]=i["-value"]),a["-json"]&&(l["-json"]=a["-json"]),a["-properties"]&&Object.assign(l,a["-properties"]),l}));e.edges.forEach((function(t){var e=t.sourceNodeId,n=t.id,o=r.get(e);o["bpmn:outgoing"]||(o["bpmn:outgoing"]=[]),o["bpmn:outgoing"].push(n)})),null===(o=t["bpmn:subProcess"])||void 0===o||o.forEach((function(e){var n={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},o=[];e.children.forEach((function(o){var i,a=r.get(o["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach((function(t){a[t]&&a[t].forEach((function(e){n[t].add(e)}))}));var s=null===(i=t[o["-type"]])||void 0===i?void 0:i.findIndex((function(t){return t["-id"]===o["-id"]}));s>=0&&t[o["-type"]].splice(s,1),r.delete(o["-id"]),e[o["-type"]]||(e[o["-type"]]=[]),e[o["-type"]].push(a)}));var i=n["bpmn:incoming"];n["bpmn:outgoing"].forEach((function(t){i.has(t)&&o.push(t)}));for(var s,l=function(t){var n=a.findIndex((function(e){return e["-id"]===o[t]}));n>=0?(e["bpmn:sequenceFlow"]||(e["bpmn:sequenceFlow"]=[]),e["bpmn:sequenceFlow"].push(a[n]),a.splice(n,1)):t++,s=t},u=0;u<o.length;)l(u),u=s;delete e.children})),t[OM.FLOW]=a}(i,t,e);var a={"-id":"BPMNPlane_1","-bpmnElement":i["-id"]};IM(a,t);var s=n.definitionAttributes;s["bpmn:process"]=i,s["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":a};var l={"bpmn:definitions":s};if(null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.out){var u=null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.out,c=function(t){Array.isArray(t)&&t.forEach((function(t){return c(t)})),"object"==typeof t&&Object.keys(t).forEach((function(e){var n;(n=u[e])?(t[n]=Ji.cloneDeep(t[e]),delete t[e],c(t[n])):c(t[e])}))};c(l)}return l},this.adapterIn=function(t,e){if(t)return BM(t,e)},e.adapterIn=this.adapterIn,e.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();zM.shapeConfigMap.set(OM.START,{width:nM,height:oM}),zM.shapeConfigMap.set(OM.END,{width:rM,height:iM}),zM.shapeConfigMap.set(OM.INTERMEDIATE_CATCH,{width:lM,height:uM}),zM.shapeConfigMap.set(OM.INTERMEDIATE_THROW,{width:lM,height:uM}),zM.shapeConfigMap.set(OM.BOUNDARY,{width:aM,height:sM}),zM.shapeConfigMap.set(OM.PARALLEL_GATEWAY,{width:cM,height:dM}),zM.shapeConfigMap.set(OM.INCLUSIVE_GATEWAY,{width:pM,height:hM}),zM.shapeConfigMap.set(OM.EXCLUSIVE_GATEWAY,{width:fM,height:gM}),zM.shapeConfigMap.set(OM.SYSTEM,{width:vM,height:yM}),zM.shapeConfigMap.set(OM.USER,{width:mM,height:bM}),zM.shapeConfigMap.set(OM.SUBPROCESS,{width:_M,height:xM});var WM=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e,o=(e=t,(new EM.ObjTree).parseXML(e));return n.adapterIn(o,n.props)},n.adapterXmlOut=function(t){return function(t){var e="";for(var n in t)e+=TM(t[n],n,0);return e}(n.adapterOut(t,n.props))};var o=e.lf,r=e.props;return o.adapterIn=n.adapterXmlIn,o.adapterOut=n.adapterXmlOut,n.props=r,n}return h(e,t),e.pluginName="BPMNAdapter",e}(zM),UM={};function XM(t){return t.startsWith("data:text/plain")}function GM(t){return y(this,void 0,void 0,(function(){return m(this,(function(e){return UM[t]?[2,UM[t]]:[2,new Promise((function(e,n){try{fetch(t).then((function(t){return t.blob()})).then((function(o){var r=new FileReader;r.onloadend=function(){e(UM[t]=r.result)},r.onerror=n,r.readAsDataURL(o)})).catch((function(){e(UM[t]=t)}))}catch(e){return UM[t]=t}}))]}))}))}function YM(t,e){return y(this,void 0,void 0,(function(){var n,o,r;return m(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),(n=t.getAttribute(e)||"").startsWith("data:")?[2]:[4,GM(n)];case 1:return XM(o=i.sent())?[2]:(t.setAttribute(e,o),[3,3]);case 2:return r=i.sent(),console.error(r),[3,3];case 3:return[2]}}))}))}function VM(t,e){return y(this,void 0,void 0,(function(){var n,o;return m(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e.startsWith("data:")?[2]:[4,GM(e)];case 1:return XM(n=r.sent())?[2]:(t.style.backgroundImage="url(".concat(n,")"),[3,3]);case 2:return o=r.sent(),console.error(o),[3,3];case 3:return[2]}}))}))}function KM(t){return y(this,void 0,void 0,(function(){var e,n,o,r,i,a,s,l,u;return m(this,(function(c){switch(c.label){case 0:for(e=[t],o=[];e.length;)(n=e.shift()).children.length&&e.push.apply(e,x([],_(n.children),!1)),n instanceof HTMLElement&&(r=n.style,i=r.background,a=r.backgroundImage,(s=i.match(/url\(["']?(.*?)["']?\)/))&&s[1]&&(u=s[1],o.push(VM(n,u))),(l=a.match(/url\(["']?(.*?)["']?\)/))&&l[1]&&(u=l[1],o.push(VM(n,u)))),n instanceof HTMLImageElement?o.push(YM(n,"src")):n instanceof SVGImageElement&&o.push(YM(n,"href"));return[4,Promise.all(o)];case 1:return c.sent(),[2]}}))}))}function qM(t,e,n){var o=document.createElement("canvas");o.width=e,o.height=n;var r=o.getContext("2d");return r&&r.drawImage(t,0,0,t.width,t.height,0,0,e,n),o}var ZM,$M=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.customCssRules="",this.useGlobalRules=!0,e.getSnapshot=function(t,e){return y(n,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshot(t,e)];case 1:return[2,n.sent()]}}))}))},e.getSnapshotBlob=function(t,e){return y(n,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshotBlob(t,e)];case 1:return[2,n.sent()]}}))}))},e.getSnapshotBase64=function(t,e){return y(n,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshotBase64(t,e)];case 1:return[2,n.sent()]}}))}))}}return t.prototype.getSvgRootElement=function(t){return t.container.querySelector(".lf-canvas-overlay")},t.prototype.triggerDownload=function(t){var e=new MouseEvent("click",{view:document.defaultView,bubbles:!1,cancelable:!0}),n=document.createElement("a");n.setAttribute("download",this.fileName),n.setAttribute("href",t),n.setAttribute("target","_blank"),n.dispatchEvent(e)},t.prototype.removeAnchor=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,o=0;o<n;o++){var r=e[o];(r.classList&&Array.from(r.classList)||[]).indexOf("lf-anchor")>-1&&(t.removeChild(t.childNodes[o]),n--,o--)}},t.prototype.removeRotateControl=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,o=0;o<n;o++){var r=e[o];(r.classList&&Array.from(r.classList)||[]).indexOf("lf-rotate-control")>-1&&(t.removeChild(t.childNodes[o]),n--,o--)}},t.prototype.getSnapshot=function(t,e){return y(this,void 0,void 0,(function(){var n,o,r,i,a=this;return m(this,(function(s){switch(s.label){case 0:return n=this.lf.graphModel.getPartial(),o=(null!=e?e:{}).partial,r=void 0===o?n:o,i=this.lf.getEditConfig(),this.lf.updateEditConfig({isSilentMode:!0,stopScrollGraph:!0,stopMoveGraph:!0}),n===r?[3,1]:(this.lf.graphModel.setPartial(r),this.lf.graphModel.eventCenter.once("graph:updated",(function(){return y(a,void 0,void 0,(function(){return m(this,(function(o){switch(o.label){case 0:return[4,this.snapshot(t,e)];case 1:return o.sent(),this.lf.graphModel.setPartial(n),[2]}}))}))})),[3,3]);case 1:return[4,this.snapshot(t,e)];case 2:s.sent(),s.label=3;case 3:return this.lf.updateEditConfig(i),[2]}}))}))},t.prototype.snapshot=function(t,e){return y(this,void 0,void 0,(function(){var n,o,r,i,a,s,l,u,c,d=this;return m(this,(function(p){switch(p.label){case 0:return o=(n=null!=e?e:{}).fileType,r=void 0===o?"png":o,i=n.quality,this.fileName="".concat(null!=t?t:"logic-flow.".concat(Date.now()),".").concat(r),[4,KM(a=this.getSvgRootElement(this.lf))];case 1:return p.sent(),"svg"===r?(s=this.cloneSvg(a),l=(new XMLSerializer).serializeToString(s),u=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),c=URL.createObjectURL(u),this.triggerDownload(c)):this.getCanvasData(a,null!=e?e:{}).then((function(t){var e=t.toDataURL("image/".concat(r),i).replace("image/".concat(r),"image/octet-stream");d.triggerDownload(e)})),[2]}}))}))},t.prototype.getSnapshotBase64=function(t,e){return y(this,void 0,void 0,(function(){var n,o=this;return m(this,(function(r){switch(r.label){case 0:return[4,KM(n=this.getSvgRootElement(this.lf))];case 1:return r.sent(),[2,new Promise((function(r){o.getCanvasData(n,{backgroundColor:t}).then((function(t){var n=t.toDataURL("image/".concat(null!=e?e:"png"));r({data:n,width:t.width,height:t.height})}))}))]}}))}))},t.prototype.getSnapshotBlob=function(t,e){return y(this,void 0,void 0,(function(){var n,o=this;return m(this,(function(r){switch(r.label){case 0:return[4,KM(n=this.getSvgRootElement(this.lf))];case 1:return r.sent(),[2,new Promise((function(r){o.getCanvasData(n,{backgroundColor:t}).then((function(t){t.toBlob((function(e){r({data:e,width:t.width,height:t.height})}),"image/".concat(null!=e?e:"png"))}))}))]}}))}))},t.prototype.getClassRules=function(){var t="";if(this.useGlobalRules)for(var e=document.styleSheets,n=0;n<e.length;n++){var o=e[n];try{for(var r=0;r<o.cssRules.length;r++)t+=o.cssRules[r].cssText}catch(t){console.log("CSS scripts from different sources have been filtered out")}}return this.customCssRules&&(t+=this.customCssRules),t},t.prototype.getCanvasData=function(t,e){return y(this,void 0,void 0,(function(){var n,o,r,i,a,s,l,u,c,d,p,h,f,g,v,y,b,_,x,E,w,S,C,O,M,T;return m(this,(function(m){return n=e.width,o=e.height,r=e.backgroundColor,i=e.padding,a=void 0===i?40:i,s=this.cloneSvg(t,!1),(l=window.devicePixelRatio||1)<1&&(l=1),u=this.lf.graphModel.rootEl.querySelector(".lf-base"),c=u.getBoundingClientRect(),d=this.lf.container.querySelector(".lf-canvas-overlay"),p=d.getBoundingClientRect(),h=c.x-p.x,f=c.y-p.y,g=this.lf.graphModel,v=g.transformModel,y=v.SCALE_X,b=v.SCALE_Y,_=v.TRANSLATE_X,x=v.TRANSLATE_Y,s.lastChild.style.transform="matrix(1, 0, 0, 1, ".concat((-h+_)*(1/y),", ").concat((-f+x)*(1/b),")"),E=Math.ceil(c.width/y),w=Math.ceil(c.height/b),(S=document.createElement("canvas")).style.width="".concat(E,"px"),S.style.height="".concat(w,"px"),S.width=E*l+2*a,S.height=w*l+2*a,(C=S.getContext("2d"))&&(C.clearRect(0,0,S.width,S.height),C.scale(l,l),r?(C.fillStyle=r,C.fillRect(0,0,S.width,S.height)):C.clearRect(0,0,S.width,S.height)),O=new Image,(M=document.createElement("style")).innerHTML=this.getClassRules(),(T=document.createElement("foreignObject")).appendChild(M),s.appendChild(T),[2,new Promise((function(t){O.onload=function(){var e=navigator.userAgent.indexOf("Firefox")>-1;try{e?createImageBitmap(O,{resizeWidth:n&&o?qM(S,n,o).width:S.width,resizeHeight:n&&o?qM(S,n,o).height:S.height}).then((function(e){null==C||C.drawImage(e,a/l,a/l),t(n&&o?qM(S,n,o):S)})):(null==C||C.drawImage(O,a/l,a/l),t(n&&o?qM(S,n,o):S))}catch(e){null==C||C.drawImage(O,a/l,a/l),t(n&&o?qM(S,n,o):S)}};var e="data:image/svg+xml;charset=utf-8,".concat((new XMLSerializer).serializeToString(s)).replace(/\n/g,"").replace(/\t/g,"").replace(/#/g,"%23");O.src=e}))]}))}))},t.prototype.cloneSvg=function(t,e){var n,o=this;void 0===e&&(e=!0);var r=t.cloneNode(!0),i=r.lastChild,a=null===(n=null==i?void 0:i.childNodes)||void 0===n?void 0:n.length;if(a)for(var s=0;s<a;s++){var l=null==i?void 0:i.childNodes[s],u=l.classList&&Array.from(l.classList);if(u&&u.indexOf("lf-base")<0)null==i||i.removeChild(i.childNodes[s]),a--,s--;else{var c=null==i?void 0:i.childNodes[s];c&&c.childNodes.forEach((function(t){var e=t;o.removeAnchor(e.firstChild),o.removeRotateControl(e.firstChild)}))}}if(e){var d=document.createElement("style");d.innerHTML=this.getClassRules();var p=document.createElement("foreignObject");p.appendChild(d),r.appendChild(p)}return r},t.pluginName="snapshot",t}(),JM={SEQUENCE_FLOW:1,START_EVENT:2,END_EVENT:3,USER_TASK:4,EXCLUSIVE_GATEWAY:6},QM={1:"bpmn:sequenceFlow",2:"bpmn:startEvent",3:"bpmn:endEvent",4:"bpmn:userTask",6:"bpmn:exclusiveGateway"};function tT(t){switch(t){case"bpmn:sequenceFlow":return JM.SEQUENCE_FLOW;case"bpmn:startEvent":return JM.START_EVENT;case"bpmn:endEvent":return JM.END_EVENT;case"bpmn:userTask":return JM.USER_TASK;case"bpmn:exclusiveGateway":return JM.EXCLUSIVE_GATEWAY;default:return t}}!function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(ZM||(ZM={}));var eT=function(t,e,n,o){return void 0===o&&(o=0),rT(t,e,n)<=o};function nT(t){return t*t}function oT(t,e){return nT(t.x-e.x)+nT(t.y-e.y)}var rT=function(t,e,n){return Math.sqrt(function(t,e,n){var o=oT(e,n);if(0===o)return oT(t,e);var r=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/o;return r=Math.max(0,Math.min(1,r)),oT(t,{x:e.x+r*(n.x-e.x),y:e.y+r*(n.y-e.y)})}(t,e,n))},iT=function(t,e,n){var o=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{minX:e-o/2,minY:n-r/2,maxX:e+o/2,maxY:n+r/2,x:e,y:n,width:o,height:r,centerX:e,centerY:n}}(t),r=function(t,e){var n;return t.x===e.x?n=ZM.VERTICAL:t.y===e.y&&(n=ZM.HORIZONTAL),n}(e,n),i=Math.max(e.x,n.x),a=Math.min(e.x,n.x),s=Math.max(e.y,n.y),l=Math.min(e.y,n.y),u=t.x,c=t.y,d=t.width,p=t.height;if(r===ZM.HORIZONTAL){if(i>=o.maxX&&a<=o.minX)return{startCrossPoint:{x:e.x>n.x?u+d/2:u-d/2,y:e.y},endCrossPoint:{x:e.x>n.x?u-d/2:u+d/2,y:e.y}}}else if(r===ZM.VERTICAL&&s>=o.maxY&&l<=o.minY)return{startCrossPoint:{x:e.x,y:e.y>n.y?c+p/2:c-p/2},endCrossPoint:{x:e.x,y:e.y>n.y?c-p/2:c+p/2}}},aT=function(t,e,n){void 0===n&&(n=0);for(var o=t.x,r=t.y,i=e.pointsList,a=0;a<i.length-1;a++)if(eT({x:o,y:r},i[a],i[a+1],n)){var s=iT(t,i[a],i[a+1]);if(s)return{crossIndex:a+1,crossPoints:s}}return{crossIndex:-1,crossPoints:{startCrossPoint:{x:0,y:0},endCrossPoint:{x:0,y:0}}}},sT=function(){function t(t){var e=t.lf;this._lf=e,this.deviation=20,this.dndAdd=!0,this.dropAdd=!0,this.eventHandler()}return t.prototype.eventHandler=function(){var t=this;this.dndAdd&&this._lf.on("node:dnd-add",(function(e){var n=e.data;t.insetNode(n)})),this.dropAdd&&this._lf.on("node:drop",(function(e){for(var n=e.data,o=t._lf.graphModel.edges,r=n.id,i=!0,a=0;a<o.length;a++)if(o[a].sourceNodeId===r||o[a].targetNodeId===r){i=!1;break}i&&t.insetNode(n)}))},t.prototype.checkRuleBeforeInsetNode=function(t,e,n,o,r){var i=this._lf.getNodeModelById(t),a=this._lf.getNodeModelById(e),s=i.getAnchorInfo(n),l=a.getAnchorInfo(o),u=i.isAllowConnectedAsSource(r,s,l),c=a.isAllowConnectedAsTarget(r,s,l),d=Kb(u),p=d.isAllPass,h=d.msg,f=Kb(c),g=f.isAllPass;return{isPass:p&&g,sourceMsg:h,targetMsg:f.msg}},t.prototype.insetNode=function(t){var e=this,n=this._lf.graphModel.edges,o=this._lf.getNodeModelById(t.id),r=null==o?void 0:o.getDefaultAnchor();if(!r||0===r.length)this._lf.graphModel.eventCenter.emit(Om.CONNECTION_NOT_ALLOWED,{data:t,msg:"自定义类型节点不显示锚点,也不允许其他节点连接到此节点"});else if(o)for(var i=0;i<n.length;i++){var a=aT(o,n[i],this.deviation),s=a.crossIndex,l=a.crossPoints;if(s>=0){var u=n[i],c=u.sourceNodeId,d=u.targetNodeId,p=u.id,h=u.type,f=u.pointsList,g=u.sourceAnchorId,v=u.targetAnchorId,y=_d(f[0]),m=_d(l.startCrossPoint);this._lf.deleteEdge(p);var b=this.checkRuleBeforeInsetNode(c,d,g,v,t);if(this._lf.addEdge({type:h,sourceNodeId:c,targetNodeId:t.id,startPoint:y,endPoint:m,pointsList:x(x([],_(f.slice(0,s)),!1),[l.startCrossPoint],!1)}),this._lf.addEdge({type:h,sourceNodeId:t.id,targetNodeId:d,startPoint:_d(l.endCrossPoint),endPoint:_d(f[f.length-1]),pointsList:x([l.endCrossPoint],_(f.slice(s)),!1)}),b.isPass)break;this._lf.graphModel.eventCenter.emit(Om.CONNECTION_NOT_ALLOWED,{data:t,msg:b.targetMsg||b.sourceMsg}),setTimeout((function(){e._lf.undo()}),200);break}}},t.pluginName="insertNodeInPolyline",t}(),lT=function(){function t(t){var e=t.lf,n=this;this.controlItems=[{key:"zoom-out",iconClass:"lf-control-zoomOut",title:"缩小流程图",text:"缩小",onClick:function(){n.lf.zoom(!1)}},{key:"zoom-in",iconClass:"lf-control-zoomIn",title:"放大流程图",text:"放大",onClick:function(){n.lf.zoom(!0)}},{key:"reset",iconClass:"lf-control-fit",title:"恢复流程原有尺寸",text:"适应",onClick:function(){n.lf.resetZoom()}},{key:"undo",iconClass:"lf-control-undo",title:"回到上一步",text:"上一步",onClick:function(){n.lf.undo()}},{key:"redo",iconClass:"lf-control-redo",title:"移到下一步",text:"下一步",onClick:function(){n.lf.redo()}}],this.lf=e}return t.prototype.render=function(t,e){this.destroy();var n=this.getControlTool();this.toolEl=n,e.appendChild(n),this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.toolEl&&this.domContainer.contains(this.toolEl)&&this.domContainer.removeChild(this.toolEl)},t.prototype.addItem=function(t){this.controlItems.push(t)},t.prototype.removeItem=function(t){var e=this.controlItems.findIndex((function(e){return e.key===t}));return-1==e?null:this.controlItems.splice(e,1)[0]},t.prototype.getControlTool=function(){var t=this,e="lf-control-item",n="lf-control-item disabled",o=document.createElement("div"),r=[];return o.className="lf-control",this.controlItems.forEach((function(o){var i=document.createElement("div"),a=document.createElement("i"),s=document.createElement("span");switch(i.className=n,o.onClick&&(i.onclick=o.onClick.bind(null,t.lf)),o.onMouseEnter&&(i.onmouseenter=o.onMouseEnter.bind(null,t.lf)),o.onMouseLeave&&(i.onmouseleave=o.onMouseLeave.bind(null,t.lf)),a.className=o.iconClass,s.className="lf-control-text",s.title=o.title,s.innerText=o.text,i.append(a,s),o.text){case"上一步":t.lf.on("history:change",(function(t){var o=t.data.undoAble;i.className=o?e:n}));break;case"下一步":t.lf.on("history:change",(function(t){var o=t.data.redoAble;i.className=o?e:n}));break;default:i.className=e}r.push(i)})),o.append.apply(o,x([],_(r),!1)),o},t.pluginName="control",t}(),uT="lf:defaultNodeMenu",cT="lf:defaultEdgeMenu",dT="lf:defaultGraphMenu",pT="lf:defaultSelectionMenu",hT=function(){function t(t){var e=t.lf,n=this;this.__currentData=null,this.lf=e,e.options.isSilentMode||(this.__menuDOM=document.createElement("ul"),this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(t){n.setMenuConfig(t)},this.lf.addMenuConfig=function(t){n.addMenuConfig(t)},this.lf.setMenuByType=function(t){n.setMenuByType(t)})}return t.prototype.init=function(){var t,e,n,o,r=this,i=[{text:"删除",callback:function(t){r.lf.deleteNode(t.id)}},{text:"编辑文本",callback:function(t){r.lf.graphModel.editText(t.id)}},{text:"复制",callback:function(t){r.lf.cloneNode(t.id)}}];null===(t=this.menuTypeMap)||void 0===t||t.set(uT,i);var a=[{text:"删除",callback:function(t){r.lf.deleteEdge(t.id)}},{text:"编辑文本",callback:function(t){r.lf.graphModel.editText(t.id)}}];null===(e=this.menuTypeMap)||void 0===e||e.set(cT,a),null===(n=this.menuTypeMap)||void 0===n||n.set(dT,[]);var s=[{text:"删除",callback:function(t){r.lf.clearSelectElements(),t.edges.forEach((function(t){return r.lf.deleteEdge(t.id)})),t.nodes.forEach((function(t){return r.lf.deleteNode(t.id)}))}}];null===(o=this.menuTypeMap)||void 0===o||o.set(pT,s)},t.prototype.render=function(t,e){var n=this;t.options.isSilentMode||(this.__container=e,this.__currentData=null,this.__menuDOM&&(this.__menuDOM.className="lf-menu",e.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",(function(t){t.stopPropagation();for(var e=t.target;-1===Array.from(e.classList).indexOf("lf-menu-item")&&-1===Array.from(e.classList).indexOf("lf-menu");)e=null==e?void 0:e.parentElement;Array.from(e.classList).indexOf("lf-menu-item")>-1?(e.onclickCallback(n.__currentData),n.__menuDOM&&(n.__menuDOM.style.display="none"),n.__currentData=null):console.warn("点击区域不在菜单项内,请检查代码!")}),!0)),this.lf.on("node:contextmenu",(function(t){var e,o,r=t.data,i=t.position,a=t.e,s=i.domOverlayPosition,l=s.x,u=s.y,c=r.id,d=n.lf.graphModel.getNodeModelById(c);if(d){var p=[],h=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(d.type);p=d&&d.menu&&Array.isArray(d.menu)?d.menu:h||(null===(o=n.menuTypeMap)||void 0===o?void 0:o.get(uT)),n.__currentData=r,n.showMenu(l,u,p,{width:d.width,height:d.height,clientX:a.clientX,clientY:a.clientY})}})),this.lf.on("edge:contextmenu",(function(t){var e,o,r,i=t.data,a=t.position,s=t.e,l=a.domOverlayPosition,u=l.x,c=l.y,d=i.id,p=n.lf.graphModel.getEdgeModelById(d);if(p){var h=[],f=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(p.type);h=p&&p.menu&&Array.isArray(p.menu)?p.menu:f||(null!==(r=null===(o=n.menuTypeMap)||void 0===o?void 0:o.get(cT))&&void 0!==r?r:[]),n.__currentData=i,n.showMenu(u,c,h,{width:p.width,height:p.height,clientX:s.clientX,clientY:s.clientY})}})),this.lf.on("blank:contextmenu",(function(t){var e,o,r=t.position,i=null!==(o=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(dT))&&void 0!==o?o:[],a=r.domOverlayPosition,s=a.x,l=a.y;n.showMenu(s,l,i)})),this.lf.on("selection:contextmenu",(function(t){var e,o=t.data,r=t.position,i=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(pT),a=r.domOverlayPosition,s=a.x,l=a.y;n.__currentData=o,n.showMenu(s,l,i)})),this.lf.on("node:mousedown",(function(){n.__menuDOM.style.display="none"})),this.lf.on("edge:click",(function(){n.__menuDOM.style.display="none"})),this.lf.on("blank:click",(function(){n.__menuDOM.style.display="none"})))},t.prototype.destroy=function(){var t;this.__menuDOM&&(null===(t=null==this?void 0:this.__container)||void 0===t||t.removeChild(this.__menuDOM),this.__menuDOM=void 0)},t.prototype.showMenu=function(t,e,n,o){if(n&&n.length){var r=this.__menuDOM;if(r){if(r.innerHTML="",r.append.apply(r,x([],_(this.__getMenuDom(n)),!1)),!r.children.length)return;if(r.style.display="block",!o)return r.style.top="".concat(e,"px"),void(r.style.left="".concat(t,"px"));var i=o.width,a=o.height,s=o.clientX,l=o.clientY,u=this.lf.graphModel,c=r.offsetWidth,d=!0,p=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=p-s,f=u.rootEl.getBoundingClientRect(),g=f.left+f.width;g<p&&(h=g-s),h<c&&(d=!1),r.style.left="".concat(d?t:t-i,"px");var v=r.offsetHeight,y=!0,m=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,b=m-l,E=f.top+f.height;E<m&&(b=E-l),b<v&&(y=!1),r.style.top="".concat(y?e:e-a,"px")}}},t.prototype.setMenuByType=function(t){var e;t.type&&t.menu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(t.type,t.menu))},t.prototype.__getMenuDom=function(t){var e=[];return t&&t.length>0&&t.forEach((function(t){var n=document.createElement("li");if(t.className?n.className="lf-menu-item ".concat(t.className):n.className="lf-menu-item",!0===t.icon){var o=document.createElement("span");o.className="lf-menu-item-icon",n.appendChild(o)}var r=document.createElement("span");r.className="lf-menu-item-text",t.text&&(r.innerText=t.text),n.appendChild(r),n.onclickCallback=t.callback,e.push(n)})),e},t.prototype.setMenuConfig=function(t){var e,n,o;t&&(void 0!==t.nodeMenu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(uT,t.nodeMenu?t.nodeMenu:[])),void 0!==t.edgeMenu&&(null===(n=this.menuTypeMap)||void 0===n||n.set(cT,t.edgeMenu?t.edgeMenu:[])),void 0!==t.graphMenu&&(null===(o=this.menuTypeMap)||void 0===o||o.set(dT,t.graphMenu?t.graphMenu:[])))},t.prototype.addMenuConfig=function(t){var e,n,o,r,i,a,s,l,u;if(t){if(Array.isArray(t.nodeMenu)){var c=null!==(n=null===(e=this.menuTypeMap)||void 0===e?void 0:e.get(uT))&&void 0!==n?n:[];null===(o=this.menuTypeMap)||void 0===o||o.set(uT,c.concat(t.nodeMenu))}if(Array.isArray(t.edgeMenu)){c=null!==(i=null===(r=this.menuTypeMap)||void 0===r?void 0:r.get(cT))&&void 0!==i?i:[];null===(a=this.menuTypeMap)||void 0===a||a.set(cT,c.concat(t.edgeMenu))}if(Array.isArray(t.graphMenu)){c=null!==(l=null===(s=this.menuTypeMap)||void 0===s?void 0:s.get(dT))&&void 0!==l?l:[];null===(u=this.menuTypeMap)||void 0===u||u.set(dT,c.concat(t.graphMenu))}}},t.prototype.changeMenuItem=function(t,e){if("add"===t)this.addMenuConfig(e);else{if("reset"!==t)throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'");this.setMenuConfig(e)}},t.pluginName="menu",t}(),fT="menu-common",gT=function(){function t(t){var e=t.lf,n=this;this.menuTypeMap=new Map,this.listenDelete=function(){n.hideContextMenu()},this.lf=e,this.__menuDOM=document.createElement("div"),this.__menuDOM.className="lf-inner-context",this.menuTypeMap.set(fT,[]),this.lf.setContextMenuByType=function(t,e){n.setContextMenuByType(t,e)},this.lf.setContextMenuItems=function(t){n.setContextMenuItems(t)},this.lf.showContextMenu=function(t){n.showContextMenu(t)},this.lf.hideContextMenu=function(){n.hideContextMenu()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("node:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("edge:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("blank:click",(function(){n.hideContextMenu()}))},t.prototype.setContextMenuByType=function(t,e){this.menuTypeMap.set(t,e)},t.prototype.hideContextMenu=function(){this.__menuDOM.innerHTML="",this.__menuDOM.style.display="none",this.isShow&&this.container.removeChild(this.__menuDOM),this.lf.off("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!1},t.prototype.showContextMenu=function(t){t&&t.id?(this._activeData=t,this.createContextMenu()):console.warn("请检查传入的参数")},t.prototype.setContextMenuItems=function(t){this.menuTypeMap.set(fT,t)},t.prototype.getContextMenuPosition=function(){var t=this._activeData,e=this.lf.graphModel.getElement(t.id);if(e){var n,o;if("edge"===e.BaseType){n=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER;var r=e.getData();n=Math.max(r.startPoint.x,n),o=Math.min(r.startPoint.y,o),n=Math.max(r.endPoint.x,n),o=Math.min(r.endPoint.y,o),r.pointsList&&r.pointsList.forEach((function(t){n=Math.max(t.x,n),o=Math.min(t.y,o)}))}return"node"===e.BaseType&&(n=t.x+e.width/2,o=t.y-e.height/2),this.lf.graphModel.transformModel.CanvasPointToHtmlPoint([n,o])}},t.prototype.createContextMenu=function(){var t=this;if(!this.lf.options.isSilentMode){var e=x(x([],_(this.menuTypeMap.get(this._activeData.type)||[]),!1),_(this.menuTypeMap.get(fT)||[]),!1),n=document.createDocumentFragment();e.forEach((function(e){var o=document.createElement("div");o.className="lf-context-item";var r=document.createElement("img");r.src=e.icon,r.className="lf-context-img",e.className&&(o.className="".concat(o.className," ").concat(e.className)),r.addEventListener("click",(function(){t.hideContextMenu(),e.callback?e.callback(t._activeData):t.addNode({sourceId:t._activeData.id,x:t._activeData.x,y:t._activeData.y,properties:e.properties,type:e.type})})),o.appendChild(r),n.appendChild(o)})),this.__menuDOM.innerHTML="",this.__menuDOM.appendChild(n),this.showMenu()}},t.prototype.addNode=function(t,e){var n=void 0!==e;void 0===e&&(e=t.y);var o=this.lf.getNodeModelById(t.sourceId);if(o){var r=t.x-o.width+200,i=e-t.y/2-20,a=t.x+o.width+200,s=e+t.y/2+20;if(this.lf.getAreaElement([r,i],[a,s]).length)return e+=100,void this.addNode(t,e);if(t.type){var l=this.lf.addNode({type:t.type,x:t.x+200,y:e,properties:t.properties}),u=void 0,c=void 0;n&&(u={x:t.x,y:t.y+o.height/2},c={x:l.x-l.width/2,y:l.y}),this.lf.addEdge({sourceNodeId:t.sourceId,targetNodeId:l.id,startPoint:u,endPoint:c})}}},t.prototype.showMenu=function(){var t=this.getContextMenuPosition();if(t){var e=_(t,2),n=e[0],o=e[1];this.__menuDOM.style.display="flex",this.__menuDOM.style.top="".concat(o,"px"),this.__menuDOM.style.left="".concat(n+10,"px"),this.container.appendChild(this.__menuDOM),!this.isShow&&this.lf.on("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!0}},t.pluginName="contextMenu",t}(),vT=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.lf.setPatternItems=function(t){n.setPatternItems(t)}}return t.prototype.render=function(t,e){var n=this;this.destroy(),this.shapeList&&0!==this.shapeList.length?(this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.shapeList.forEach((function(t){var e;null===(e=n.panelEl)||void 0===e||e.appendChild(n.createDndItem(t))})),e.appendChild(this.panelEl),this.domContainer=e):this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.panelEl&&this.domContainer.contains(this.panelEl)&&this.domContainer.removeChild(this.panelEl)},t.prototype.setPatternItems=function(t){this.shapeList=t,this.domContainer&&this.render(this.lf,this.domContainer)},t.prototype.createDndItem=function(t){var e=this,n=document.createElement("div");n.className=t.className?"lf-dnd-item ".concat(t.className):"lf-dnd-item";var o=document.createElement("div");if(o.className="lf-dnd-shape",t.icon&&(o.style.backgroundImage="url(".concat(t.icon,")")),n.appendChild(o),t.label){var r=document.createElement("div");r.innerText=t.label,r.className="lf-dnd-text",n.appendChild(r)}return t.disabled?(n.classList.add("disabled"),n.onmousedown=function(){t.callback&&t.callback(e.lf,e.domContainer)},n):(n.onmousedown=function(){t.type&&e.lf.dnd.startDrag({type:t.type,properties:t.properties,text:t.text}),t.callback&&t.callback(e.lf,e.domContainer)},n.ondblclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-dbclick",{e:n,data:t})},n.onclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-click",{e:n,data:t})},n.oncontextmenu=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-contextmenu",{e:n,data:t})},n)},t.pluginName="dndPanel",t}(),yT=function(){function t(t){var e=t.lf,n=this;this.disabled=!0,this.isDefaultStopMoveGraph=!1,this.isWholeNode=!0,this.isWholeEdge=!0,this.draw=function(t){var e=n.lf.getPointByClient(t.clientX,t.clientY).domOverlayPosition,o=e.x,r=e.y;if(n.endPoint={x:o,y:r},n.startPoint){var i=n.startPoint,a=i.x,s=i.y,l=a,u=s,c=o-a,d=r-s;o<a&&(l=o,c=a-o),r<s&&(u=r,d=s-r),n.wrapper&&(n.wrapper.style.left="".concat(l,"px"),n.wrapper.style.top="".concat(u,"px"),n.wrapper.style.width="".concat(c,"px"),n.wrapper.style.height="".concat(d,"px"))}},this.drawOff=function(){var t;if(document.removeEventListener("mousemove",n.draw),document.removeEventListener("mouseup",n.drawOff),n.wrapper&&(n.wrapper.oncontextmenu=null,null===(t=n.container)||void 0===t||t.removeChild(n.wrapper)),n.startPoint&&n.endPoint){var e=n.startPoint,o=e.x,r=e.y,i=n.endPoint,a=i.x,s=i.y,l=[Math.min(o,a),Math.min(r,s)],u=[Math.max(o,a),Math.max(r,s)];if(n.lf.emit("selection:selected-area",{topLeft:l,bottomRight:u}),Math.abs(a-o)<10&&Math.abs(s-r)<10)return;var c=n.lf.graphModel.getAreaElement(l,u,n.isWholeEdge,n.isWholeNode,!0),d=n.lf.graphModel.group;c.forEach((function(t){d&&d.getNodeGroup(t.id)||n.lf.selectElementById(t.id,!0)})),n.lf.emit("selection:selected",c)}},this.lf=e;var o=e.getEditConfig().stopMoveGraph;this.isDefaultStopMoveGraph=o,e.openSelectionSelect=function(){n.openSelectionSelect()},e.closeSelectionSelect=function(){n.closeSelectionSelect()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("blank:mousedown",(function(o){var r=o.e;if(t.getEditConfig().stopMoveGraph&&!n.disabled&&!(2===r.button)){var i=t.getPointByClient(r.clientX,r.clientY).domOverlayPosition,a=i.x,s=i.y;n.startPoint={x:a,y:s},n.endPoint={x:a,y:s};var l=document.createElement("div");l.className="lf-selection-select",l.oncontextmenu=function(t){t.preventDefault()},l.style.top="".concat(n.startPoint.y,"px"),l.style.left="".concat(n.startPoint.x,"px"),e.appendChild(l),n.wrapper=l,document.addEventListener("mousemove",n.draw),document.addEventListener("mouseup",n.drawOff)}}))},t.prototype.setSelectionSense=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.isWholeEdge=t,this.isWholeNode=e},t.prototype.openSelectionSelect=function(){this.lf.getEditConfig().stopMoveGraph||(this.isDefaultStopMoveGraph=!1,this.lf.updateEditConfig({stopMoveGraph:!0})),this.open()},t.prototype.closeSelectionSelect=function(){this.isDefaultStopMoveGraph||this.lf.updateEditConfig({stopMoveGraph:!1}),this.close()},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t}(),mT=function(){function t(t){var e=t.lf,n=t.LogicFlow,o=t.options,r=this;this.width=200,this.height=150,this.scale=1,this.translateX=0,this.translateY=0,this.showEdge=!1,this.viewPortTop=0,this.viewPortLeft=0,this.viewPortWidth=150,this.viewPortHeight=75,this.isShow=!1,this.isShowHeader=!1,this.isShowCloseIcon=!1,this.headerTitle="导航",this.disabledPlugins=["miniMap","control","selectionSelect"],this.render=function(t,e){r.container=e,r.lf.on("history:change",(function(){r.isShow&&r.setView()})),r.lf.on("graph:transform",(function(){r.isShow&&r.setView(!1)}))},this.show=function(t,e){r.isShow||(r.createMiniMap(t,e),r.setView()),r.isShow=!0},this.hide=function(){r.isShow&&(r.removeMiniMap(),r.lf.emit("miniMap:close",{})),r.isShow=!1},this.updatePosition=function(t){if("object"==typeof t)void 0===t.left&&void 0===t.right||(r.leftPosition=t.left,r.rightPosition=t.right),void 0===t.top&&void 0===t.bottom||(r.topPosition=t.top,r.bottomPosition=t.bottom);else switch(t){case"left-top":r.leftPosition=0,r.rightPosition=void 0,r.topPosition=0,r.bottomPosition=void 0;break;case"right-top":r.leftPosition=void 0,r.rightPosition=0,r.topPosition=0,r.bottomPosition=void 0;break;case"left-bottom":r.leftPosition=0,r.rightPosition=void 0,r.topPosition=void 0,r.bottomPosition=0;break;case"right-bottom":r.leftPosition=void 0,r.rightPosition=0,r.topPosition=void 0,r.bottomPosition=0}r.updateMiniMapPosition()},this.reset=function(){r.lf.resetTranslate(),r.lf.resetZoom()},this.setShowEdge=function(t){r.showEdge!==t&&(r.showEdge=t,r.setView())},this.startDrag=function(t){document.addEventListener("mousemove",r.drag),document.addEventListener("mouseup",r.drop);var e=t.x,n=t.y;r.startPosition={x:e,y:n}},this.drag=function(t){var e=t.x,n=t.y,o=(e-r.startPosition.x)/r.scale,i=(n-r.startPosition.y)/r.scale,a=r.viewPortLeft+o+r.viewPortWidth/r.scale/2,s=r.viewPortTop+i+r.viewPortHeight/r.scale/2;r.startPosition={x:e,y:n},r.lf.focusOn({coordinate:{x:a,y:s}})},this.drop=function(){document.removeEventListener("mousemove",r.drag),document.removeEventListener("mouseup",r.drop)},this.mapClick=function(t){var e=t.offsetX,n=t.offsetY,o=r.translateX+e/r.scale,i=r.translateY+n/r.scale;r.lf.focusOn({coordinate:{x:o,y:i}})},this.lf=e,this.LFCtor=n,o&&this.setOption(o),this.viewPortWidth=e.graphModel.width,this.viewPortHeight=e.graphModel.height;var i={left:0,right:this.viewPortWidth,top:0,bottom:this.viewPortHeight};this.bounds=i,this.elementAreaBounds=i,this.viewPortBounds=i,this.initMiniMap()}return t.prototype.setOption=function(t){var e=t.width,n=void 0===e?150:e,o=t.height,r=void 0===o?220:o,i=t.showEdge,a=void 0!==i&&i,s=t.isShowHeader,l=void 0!==s&&s,u=t.isShowCloseIcon,c=void 0!==u&&u,d=t.leftPosition,p=t.topPosition,h=t.rightPosition,f=void 0===h?0:h,g=t.bottomPosition,v=void 0===g?0:g,y=t.headerTitle,m=void 0===y?"导航":y;this.width=n,this.height=r,this.showEdge=a,this.isShowHeader=l,this.isShowCloseIcon=c,this.leftPosition=d,this.rightPosition=void 0!==d?void 0:f,this.topPosition=p,this.bottomPosition=void 0!==p?void 0:v,this.headerTitle=m},t.prototype.initMiniMap=function(){var t=document.createElement("div");t.className="lf-mini-map-graph",t.style.width="".concat(this.width,"px"),t.style.height="".concat(this.height,"px"),this.lfMap=new this.LFCtor({container:t,grid:!1,isSilentMode:!0,stopZoomGraph:!0,stopScrollGraph:!0,stopMoveGraph:!1,history:!1,snapline:!1,disabledPlugins:this.disabledPlugins}),this.miniMapWrap=t,this.createViewPort(),t.addEventListener("click",this.mapClick)},t.prototype.createMiniMap=function(t,e){var n,o=document.createElement("div");this.miniMapContainer=o,o.appendChild(this.miniMapWrap),o.style.position="absolute",void 0===t&&void 0===e||(this.leftPosition=t||0,this.topPosition=e||0,this.rightPosition=void 0,this.bottomPosition=void 0),this.updateMiniMapPosition(),o.className="lf-mini-map",this.isShowCloseIcon||o.classList.add("lf-mini-map-no-close-icon"),this.isShowHeader||o.classList.add("lf-mini-map-no-header"),null===(n=this.container)||void 0===n||n.appendChild(o),this.miniMapWrap.appendChild(this.viewport);var r=document.createElement("div");r.className="lf-mini-map-header",r.innerText=this.headerTitle,o.appendChild(r);var i=document.createElement("span");i.className="lf-mini-map-close",i.addEventListener("click",this.hide),o.appendChild(i)},t.prototype.updateMiniMapPosition=function(){if(this.miniMapContainer){var t=this.miniMapContainer.style;void 0!==this.rightPosition?(t.right="".concat(this.rightPosition,"px"),t.left=""):(t.left="".concat(this.leftPosition,"px"),t.right=""),void 0!==this.bottomPosition?(t.bottom="".concat(this.bottomPosition,"px"),t.top=""):(t.top="".concat(this.topPosition,"px"),t.bottom="")}},t.prototype.removeMiniMap=function(){var t;this.miniMapContainer&&(null===(t=this.container)||void 0===t||t.removeChild(this.miniMapContainer))},t.prototype.updateBounds=function(t){t&&this.updateElementAreaBounds(t),this.updateViewPortBounds(),this.bounds={left:Math.min(this.elementAreaBounds.left,this.viewPortBounds.left),right:Math.max(this.elementAreaBounds.right,this.viewPortBounds.right),top:Math.min(this.elementAreaBounds.top,this.viewPortBounds.top),bottom:Math.max(this.elementAreaBounds.bottom,this.viewPortBounds.bottom)}},t.prototype.updateElementAreaBounds=function(t){var e={left:0,right:0,top:0,bottom:0},n=t.nodes;n&&n.length>0&&n.forEach((function(t){var n,o,r=t.x,i=t.y,a=null!==(n=t.width)&&void 0!==n?n:200,s=null!==(o=t.height)&&void 0!==o?o:200,l=r-a/2,u=r+a/2,c=i-s/2,d=i+s/2;e.left=Math.min(l,e.left),e.right=Math.max(u,e.right),e.top=Math.min(c,e.top),e.bottom=Math.max(d,e.bottom)})),this.elementAreaBounds=e},t.prototype.updateViewPortBounds=function(){var t=this.lf.getTransform(),e=t.TRANSLATE_X,n=t.TRANSLATE_Y,o=t.SCALE_X,r=t.SCALE_Y,i=this.lf.graphModel,a=i.width,s=i.height;this.viewPortBounds={left:-e/o,right:(-e+a)/o,top:-n/r,bottom:(-n+s)/r}},t.prototype.resetData=function(t){var e=t.nodes,n=t.edges;return e.forEach((function(t){t.text=void 0})),this.showEdge&&n.forEach((function(t){t.text=void 0})),{nodes:e,edges:this.showEdge?n:[]}},t.prototype.setView=function(t){var e,n;if(void 0===t&&(t=!0),t){var o=this.lf.getGraphRawData(),r=this.resetData(o),i=this.lf.viewMap,a=this.lf.graphModel.modelMap,s=this.lfMap.viewMap;try{for(var l=b(i.keys()),u=l.next();!u.done;u=l.next()){var c=u.value;s.has(c)||this.lfMap.register({type:c,view:i.get(c),model:a.get(c)})}}catch(t){e={error:t}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}this.lfMap.render(r),this.updateBounds(r)}else this.updateBounds();var d=this.bounds,p=d.left,h=d.top,f=d.right-p,g=d.bottom-h,v=this.width/f,y=this.height/g,m=Math.min(v,y);this.scale=m;var _=p-(this.width/m-f)/2,x=h-(this.height/m-g)/2;if(this.lfMap.graphModel.transformModel.translate(-_+this.translateX,-x+this.translateY),this.translateX=_,this.translateY=x,this.miniMapWrap.firstChild){var E=this.miniMapWrap.firstChild.style;E.pointerEvents="none",E.transform="matrix(".concat(m,", 0, 0, ").concat(m,", 0, 0)"),E.transformOrigin="left top",E.height="".concat(this.height/m,"px"),E.width="".concat(this.width/m,"px"),this.updateViewPort()}},t.prototype.updateViewPort=function(){var t=this.viewport.style,e=this.lf.getTransform(),n=e.TRANSLATE_X,o=e.TRANSLATE_Y,r=e.SCALE_X,i=e.SCALE_Y,a=this.lf.graphModel,s=a.width,l=a.height;this.viewPortLeft=-n/r,this.viewPortTop=-o/i,this.viewPortWidth=s/r*this.scale,this.viewPortHeight=l/i*this.scale,t.width="".concat(this.viewPortWidth,"px"),t.height="".concat(this.viewPortHeight,"px"),t.left="".concat((this.viewPortLeft-this.translateX)*this.scale,"px"),t.top="".concat((this.viewPortTop-this.translateY)*this.scale,"px")},t.prototype.createViewPort=function(){var t=document.createElement("div");t.className="lf-minimap-viewport",t.addEventListener("mousedown",this.startDrag),t.addEventListener("click",(function(t){t.stopPropagation()})),this.viewport=t},t.pluginName="miniMap",t}(),bT={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function _T(t,e,n,o){var r,i="",a="";t[0]===e[0]?i=t[1]>e[1]?"t":"b":t[1]===e[1]&&(i=t[0]>e[0]?"l":"r"),e[0]===n[0]?a=e[1]>n[1]?"t":"b":e[1]===n[1]&&(a=e[0]>n[0]?"l":"r");var s=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,o)||.2*o,l="".concat(i).concat(a),u=bT[l]||"-",c="L ".concat(t[0]," ").concat(t[1]);if("-"===u)c+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var d=_(function(t,e,n,o){var r=[t[0],t[1]],i=[t[0],t[1]];switch(n){case"tl":return"tr"===e?(r[1]+=o,i[0]+=o):"lb"===e&&(r[0]+=o,i[1]+=o),[r,i];case"tr":return"tl"===e?(r[1]+=o,i[0]-=o):"rb"===e&&(r[0]-=o,i[1]+=o),[r,i];case"bl":return"br"===e?(r[1]-=o,i[0]+=o):"lt"===e&&(r[0]+=o,i[1]-=o),[r,i];case"br":return"bl"===e?(r[1]-=o,i[0]-=o):"rt"===e&&(r[0]-=o,i[1]-=o),[r,i];default:return[]}}(e,l,u,s),2),p=d[0],h=d[1];p&&h&&(c+="L ".concat(p[0]," ").concat(p[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(h[0]," ").concat(h[1]),r=_(h,2),e[0]=r[0],e[1]=r[1])}return c}function xT(t,e){var n=0,o="";if(2===t.length)o+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(o+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){o+=_T(t[n-1],t[n],t[1+n++],e)}o+="L ".concat(t[n][0]," ").concat(t[n][1])}return o}var ET=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.points,n=t.isAnimation,o=t.arrowConfig,r=t.radius,i=void 0===r?5:r,a=t.getEdgeStyle(),s=t.getEdgeAnimationStyle(),l=function(t){for(var e=t,n=1;n<e.length-1;){var o=_(e[n-1],2),r=o[0],i=o[1],a=_(e[n],2),s=a[0],l=a[1],u=_(e[n+1],2),c=u[0],d=u[1];r===s&&s===c||i===l&&l===d?e.splice(n,1):n++}return e}(e.split(" ").map((function(t){return t.split(",").map((function(t){return+t}))}))),u=xT(l,i),c=f(f(f({style:n?s:{}},a),o),{fill:"none"});return uo("path",f({d:u},c))},e}(_S),wT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e}(Y_),ST=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getLabelShape=function(){var t=this.props.model,e=t.id,n=t.x,o=t.y,r=t.width,i=t.height,a=t.properties,s=this.props.model.getNodeStyle();return uo("svg",{x:n-r/2,y:o-i/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[a.labelText?uo("text",{x:0,y:-5,fontSize:"16px",fill:s.stroke},a.labelText):"",a.disabledDelete?"":uo("text",{x:a.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:s.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,e)},"x")])},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.id,a=this.props.model.getNodeStyle();return uo("g",{},[uo("rect",f(f({},a),{x:e-o/2,y:n-r/2,width:o,height:r,id:i})),this.getLabelShape()])},e.prototype.toFront=function(){},e.prototype.handleCustomDeleteIconClick=function(t){this.props.graphModel.deleteNode(t)},e}(Bw),CT=function(t){function e(){var e=t.apply(this,x([],_(arguments),!1))||this;return e.d=10,e}return h(e,t),e.prototype.initNodeData=function(e){e.text={value:"",x:e.x,y:e.y,draggable:!1,editable:!1},t.prototype.initNodeData.call(this,e),this.zIndex=0,this.draggable=!0},e.prototype.setAttributes=function(){var t,e=this;this.points=[],(null===(t=this.properties)||void 0===t?void 0:t.node_selection_ids).length>1&&setTimeout((function(){var t;e.updatePointsByNodes((null===(t=e.properties)||void 0===t?void 0:t.node_selection_ids)||[])}))},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke=this.properties.strokeColor||"#008000",e.strokeDasharray="10 5",e},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(t){this.points=t},e.prototype.updateCoordinate=function(t){var e=t.x,n=t.y;this.x=e,this.y=n},e.prototype.updatePointsByNodes=function(t){var e=this,n=[],o=1/0,r=1/0,i=-1/0,a=-1/0;t.forEach((function(t){var n=e.graphModel.getNodeModelById(t);if(n){var s=n.width,l=n.height,u=n.x,c=n.y;o=Math.min(o,u-s/2-e.d),r=Math.min(r,c-l/2-e.d),i=Math.max(i,u+s/2+e.d),a=Math.max(a,c+l/2+e.d)}})),n.push([o,r],[i,r],[i,a],[o,a]),[o,r,i,a].some((function(t){return Math.abs(t)===1/0}))||(this.updatePoints(n),this.updateCoordinate({x:(i+o)/2,y:(a+r)/2}))},e}(gx),OT=function(){function t(t){var e=t.lf;this.selectNodes=[],this.d=10,e.register({type:"node-selection",view:ST,model:CT})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map((function(t){return t.id}))},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds}}).updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var t=this.getNodeSelection();t&&(this.lf.setProperties(t.id,{node_selection_ids:this.selectNodesIds}),this.lf.getNodeModelById(t.id).updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var t=this,e=this.selectNodesIds,n=this.lf.getGraphRawData(),o=e.filter((function(e){return e!==t.currentClickNode.id}));return n.nodes.find((function(t){if("node-selection"===t.type){var e=El(t,"properties.node_selection_ids",[]);return o.every((function(t){return e.includes(t)}))}return!1}))},t.prototype.render=function(t){var e=this;this.lf=t,t.on("node:click",(function(n){if(n.e.shiftKey&&"node-selection"!==n.data.type){e.currentClickNode=n.data;var o=!1;e.selectNodesIds.includes(n.data.id)&&(e.lf.getNodeModelById(n.data.id).setSelected(!1),o=!0);var r=t.getSelectElements(!0).nodes;e.selectNodes=r,1===e.selectNodes.length?o?e.updateNodeSelection():e.addNodeSelection():e.selectNodes.length>1&&e.updateNodeSelection()}})),t.graphModel.addNodeMoveRules((function(e,n,o){if("node-selection"===e.type){var r=e.properties.node_selection_ids;return t.graphModel.moveNodes(r,n,o,!0),!0}return!0}))},t.pluginName="node-selection",t}(),MT=function(t){function e(e){var n=t.call(this,e)||this;n.textRef={current:null},n.setHoverOn=function(){var t=n.props.element;t.isDragging||n.state.isHovered||(n.setState({isHovered:!0}),t.setHovered(!0))},n.setHoverOff=function(){var t=n.props.element;n.state.isHovered&&(n.setState({isHovered:!1}),t.setHovered(!1))},n.handleMouseDown=function(t){var e,o=n.props,r=o.label,i=o.graphModel.editConfigModel.nodeTextDraggable;(null!==(e=r.draggable)&&void 0!==e?e:i)&&!n.state.isDragging&&(n.setState({isDragging:!0}),n.stepDrag.handleMouseDown(t))},n.handleDragging=function(t){var e=t.deltaX,o=t.deltaY,r=n.props,i=r.label,a=r.element,s=r.graphModel,l=_(s.transformModel.fixDeltaXY(e,o),2),u=l[0],c=l[1],d=a.properties._label,p=Ch(d,(function(t){return t.id===i.id})),h=d[p];d[p]=f(f({},h),{x:h.x+u,y:h.y+c});var g=s.getElement(a.id);null==g||g.setProperty("_label",d),s.eventCenter.emit("label:drag",{data:i.getData(),model:i})},n.handleDragEnd=function(){n.setState({isDragging:!1})},n.handleDbClick=function(t){var e=n.props,o=e.label,r=e.element;if(e.graphModel.eventCenter.emit("label:dblclick",{data:o.getData(),e:t,model:r}),o.editable){if(r.setSelected(),r.setElementState(wm.TEXT_EDIT),n.setState({isEditing:!0}),n.textRef.current){n.textRef.current.contentEditable="true",n.textRef.current.focus();var i=document.createRange(),a=window.getSelection();i.selectNodeContents(n.textRef.current),i.collapse(!1),null==a||a.removeAllRanges(),null==a||a.addRange(i)}}else r.setSelected(!0)},n.handleBlur=function(t){var e=n.props,o=e.label,r=e.element;e.graphModel.eventCenter.emit("label:blur",{e:t,model:r,data:o.getData(),element:n.textRef.current}),n.setState({isDragging:!1,isHovered:!1})},n.reCalcLabelSize=function(){};var o=e.label,r=e.graphModel,i=r.gridSize,a=r.eventCenter;return n.stepDrag=new Pm({onDragging:n.handleDragging,onDragEnd:n.handleDragEnd,step:i,eventType:"LABEL",model:o,eventCenter:a}),n.state={isEditing:!1,isHovered:!1,isDragging:!1},n}return h(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props,n=e.label,o=e.element,r=e.graphModel;r.eventCenter.on("blank:click,node:click,edge:click",(function(){var e,i,a,s;if(t.state.isEditing){t.setState({isEditing:!1});var l=null!==(i=null===(e=t.textRef.current)||void 0===e?void 0:e.innerText)&&void 0!==i?i:"",u=null!==(s=null===(a=t.textRef.current)||void 0===a?void 0:a.innerHTML)&&void 0!==s?s:"",c=o.properties._label,d=Ch(c,(function(t){return t.id===n.id})),p=c[d];c[d]=f(f({},p),{value:l,content:u});var h=r.getElement(o.id);null==h||h.setProperty("_label",c),o.setElementState(wm.DEFAULT)}t.textRef.current&&(t.textRef.current.contentEditable="false")}))},e.prototype.componentDidUpdate=function(){console.log("Label componentDidUpdate")},e.prototype.componentWillUnmount=function(){this.props.graphModel.eventCenter.off("blank:click,node:click,edge:click")},e.prototype.render=function(){var t,e=this.props,n=e.label,o=e.element,r=e.graphModel,i=this.state,a=i.isDragging,s=i.isHovered,l=i.isEditing,u=r.transformModel.getTransformStyle().transform,c=n.id,d=n.x,p=n.y,h=n.zIndex,g=n.vertical,v=n.style,y=n.rotate,m=n.content,b=n.labelWidth,_=n.textOverflowMode,x=null!=b?b:"node"===o.BaseType?o.width-20:80,E={left:"".concat(d-x/2,"px"),top:"".concat(p-10,"px"),width:"".concat(x,"px"),height:"20px",zIndex:null!=h?h:1,transform:y?"".concat(u," rotate(").concat(y,"deg)"):"".concat(u," rotate(").concat(g?-.25:0,"turn)")};return xr("div",{id:"element-container-".concat(c),className:uw("lf-label-editor-container"),style:E,onMouseDown:this.handleMouseDown,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:xr("div",{ref:this.textRef,id:"editor-container-".concat(c),className:uw("lf-label-editor",(t={"lf-label-editor-dragging":a,"lf-label-editor-editing":l,"lf-label-editor-hover":!l&&s},t["lf-label-editor-".concat(_)]=!l,t)),style:f({maxWidth:"".concat(x,"px"),width:"".concat(x,"px")},v),dangerouslySetInnerHTML:{__html:m}})})},e=v([fC],e)}(ho),TT=f_,NT=function(){function t(t,e,n){var o;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=e,this.graphModel=n,this.id=null!==(o=t.id)&&void 0!==o?o:TT(),this.initLabelData(t)}return t.prototype.initLabelData=function(t){Ys(this,t)},t.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,content:this.content,value:this.value,rotate:this.rotate,style:en(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},v([mt],t.prototype,"x",void 0),v([mt],t.prototype,"y",void 0),v([mt],t.prototype,"content",void 0),v([mt],t.prototype,"value",void 0),v([mt],t.prototype,"rotate",void 0),v([mt],t.prototype,"style",void 0),v([mt],t.prototype,"zIndex",void 0),v([mt],t.prototype,"vertical",void 0),v([mt],t.prototype,"editable",void 0),v([mt],t.prototype,"draggable",void 0),v([mt],t.prototype,"labelWidth",void 0),v([mt],t.prototype,"textOverflowMode",void 0),t}(),AT={},PT={get exports(){return AT},set exports(t){AT=t}};!function(t){
|
|
31
|
+
!function(t){!function(){var e={}.hasOwnProperty;function n(){for(var t="",e=0;e<arguments.length;e++){var n=arguments[e];n&&(t=r(t,o(n)))}return t}function o(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 o="";for(var i in t)e.call(t,i)&&t[i]&&(o=r(o,i));return o}function r(t,e){return e?t?t+" "+e:t+e:t}t.exports?(n.default=n,t.exports=n):window.classNames=n}()}(gw);var vw,yw=fw,mw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),bw=function(){return bw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},bw.apply(this,arguments)},_w=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},xw=function(t){function e(e){var n=t.call(this)||this;n.mouseDownHandler=function(t){var e=n.props,o=e.draggable,r=e.model,i=e.graphModel.editConfigModel.nodeTextDraggable;(null!=o?o:i)&&(n.stepperDrag.model=r,n.stepperDrag.handleMouseDown(t))},n.onDragging=function(t){var e=t.deltaX,o=t.deltaY,r=n.props,i=r.model,a=r.graphModel.transformModel;if(e&&o){var s=_w(a.fixDeltaXY(e,o),2),l=s[0],u=s[1];i.moveText(l,u)}},n.dbClickHandler=function(){var t=n.props,e=t.editable,o=t.graphModel.eventCenter,r=t.model;e&&r.setElementState(Sm.TEXT_EDIT),o.emit(Om.TEXT_DBCLICK,{data:r.text,model:r})};var o=e.draggable;return n.stepperDrag=new Dm({onDragging:n.onDragging,step:1,eventType:"TEXT",isStopPropagation:o}),n}return mw(e,t),e.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel,o=e.text,r=o.value,i=o.x,a=o.y,s=o.editable,l=o.draggable,u={x:i,y:a,className:"",value:r},c=e.getTextStyle(),d=n.nodeTextDraggable||l;return xr(x_,bw({},u,c,{className:yw({"lf-element-text":s,"lf-text-draggable":!s&&d,"lf-text-disabled":!s&&!d}),model:e}))},e.prototype.render=function(){if(this.props.model.text)return xr("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},e}(ho),Ew=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ww=function(){return ww=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},ww.apply(this,arguments)},Sw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Cw=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 Ew(e,t),e.prototype.getBackground=function(){var t=this.state.isHovered,e=this.props.model,n=e.text,o=e.getTextStyle(),r=o.background||{};if(t&&o.hover&&o.hover.background&&(r=ww(ww({},r),o.hover.background)),(null==n?void 0:n.value)&&"transparent"!==(null==r?void 0:r.fill)){var i=o.fontSize,a=o.textWidth,s=o.lineHeight,l=o.overflowMode,u=r.wrapPadding,c=null==n?void 0:n.value.split(/[\r\n]/g),d=c.length,p=n.x,h=n.y,f={};if("autoWrap"===l&&a){var g=Vb({rows:c,style:{fontSize:"".concat(i,"px"),width:"".concat(a,"px"),lineHeight:s,padding:u},rowsLength:d,className:"lf-get-text-height"});f=ww(ww({},r),{x:p,y:h,width:a,height:g})}else{var v=function(t){var e=t.rows,n=t.rowsLength,o=t.fontSize,r=0;return oh(e,(function(t){var e=lb(t);r=e>r?e:r})),{width:Math.ceil(r/2)*o+o/4,height:n*(o+2)+o/4}}({rows:c,rowsLength:d,fontSize:i}),y=v.width,m=v.height;if("ellipsis"===l&&(y=a,m=i+2),"string"==typeof r.wrapPadding){var b=r.wrapPadding.split(",").filter((function(t){return t.trim()})).map((function(t){return parseFloat(t.trim())}));if(b.length>0&&b.length<=4){if(1===b.length){var _=Sw(b,1)[0];b=[_,_,_,_]}else if(2===b.length){var x=Sw(b,2),E=x[0];b=[E,w=x[1],E,w]}else if(3===b.length){var w,S=Sw(b,3);b=[S[0],w=S[1],S[2],w]}var C=Sw(b,4),M=C[0],O=C[1],T=C[2],N=C[3];y+=O+N,m+=M+T,p+=(O-N)/2,h+=(T-M)/2}}f=ww(ww({},r),{x:p-1,y:h-1,width:y,height:m})}return xr(O_,ww({},f))}return null},e.prototype.getShape=function(){var t=this.props.model,e=t.text,n=e.x,o=e.y,r=e.value;if(!r)return null;var i=t.getTextStyle(),a=ww({x:n,y:o,value:r,model:t,className:"lf-element-text"},i);return xr("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),xr(x_,ww({},a))]})},e}(xw),Mw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ow=function(){return Ow=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Ow.apply(this,arguments)},Tw=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n},Nw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Aw=function(t){function e(e){var n=t.call(this)||this;n.onDragStart=function(t){var e=t.event,o=n.props,r=o.model,i=o.graphModel;if(e){var a=i.getPointByClient({x:e.clientX,y:e.clientY}).canvasOverlayPosition,s=a.x,l=a.y;n.moveOffset={dx:r.x-s,dy:r.y-l}}},n.onDragging=function(t){var e,o,r,i,a=t.event,s=n.props,l=s.model,u=s.graphModel,c=u.editConfigModel,d=c.stopMoveGraph,p=c.autoExpand,h=u.transformModel,f=u.selectNodes,g=u.width,v=u.height,y=u.gridSize;l.isDragging=!0;var m=a,b=m.clientX,_=m.clientY,x=u.getPointByClient({x:b,y:_}).canvasOverlayPosition,E=x.x,w=x.y,S=Nw(h.CanvasPointToHtmlPoint([E,w]),2),C=S[0],M=S[1];if(E+=null!==(o=null===(e=n.moveOffset)||void 0===e?void 0:e.dx)&&void 0!==o?o:0,w+=null!==(i=null===(r=n.moveOffset)||void 0===r?void 0:r.dy)&&void 0!==i?i:0,E=yb(E,y),w=yb(w,y),g&&v){if(!p||d||!(C<0||M<0||C>g||M>v)){var O=Nw(h.CanvasPointToHtmlPoint([E-l.width/2,w-l.height/2]),2),T=O[0],N=O[1],A=Nw(h.CanvasPointToHtmlPoint([E+l.width/2,w+l.height/2]),2),P=A[0],D=A[1],k=Math.max(y,20),R=[];T<0?R=[k,0]:P>u.width?R=[-k,0]:N<0?R=[0,k]:D>u.height&&(R=[0,-k]),n.t&&m_(n.t),l.transform=new Db(-E,-w).rotate(l.rotate).translate(E,w).toString();var I=f.map((function(t){return t.id}));-1===I.indexOf(l.id)&&(I=[l.id]),R.length>0&&!d&&p?n.t=y_((function(){var t=Nw(R,2),e=t[0],n=t[1];h.translate(null!=e?e:0,null!=n?n:0);var o=-(null!=e?e:0)/h.SCALE_X,r=-(null!=n?n:0)/h.SCALE_X;u.moveNodes(I,o,r)})):u.moveNodes(I,E-l.x,w-l.y)}}else u.moveNode2Coordinate(l.id,E,w)},n.onDragEnd=function(){n.t&&m_(n.t),n.props.model.isDragging=!1},n.onMouseOut=function(t){Em&&n.setHoverOff(t)},n.handleMouseUp=function(){var t=n.props.model;n.mouseUpDrag=t.isDragging},n.handleClick=function(t){var e=!1===n.mouseUpDrag;if(n.startTime){var o=n.props,r=o.model,i=o.graphModel;if(e){var a={data:r.getData(),e:t,position:i.getPointByClient({x:t.clientX,y:t.clientY}),isSelected:!1,isMultiple:!1},s=2===t.button,l=2===t.detail;if(!s){var u=i.editConfigModel,c=_b(t,u);a.isMultiple=c,r.isSelected&&!l&&c?(a.isSelected=!1,r.setSelected(!1)):(i.selectNodeById(r.id,c),a.isSelected=!0,n.toFront()),l?(u.nodeTextEdit&&r.text.editable&&(r.setSelected(!1),i.setElementStateById(r.id,Sm.TEXT_EDIT)),i.eventCenter.emit(Om.NODE_DBCLICK,a)):(i.eventCenter.emit(Om.ELEMENT_CLICK,a),i.eventCenter.emit(Om.NODE_CLICK,a))}}}},n.handleContextMenu=function(t){t.preventDefault();var e=n.props,o=e.model,r=e.graphModel,i=o.getData(),a=r.getPointByClient({x:t.clientX,y:t.clientY});r.setElementStateById(o.id,Sm.SHOW_MENU,a.domOverlayPosition),o.isSelected||r.selectNodeById(o.id),r.eventCenter.emit(Om.NODE_CONTEXTMENU,{data:i,e:t,position:a}),n.toFront()},n.handleMouseDown=function(t){var e=n.props,o=e.model,r=e.graphModel;n.startTime=(new Date).getTime(),r.editConfigModel.adjustNodePosition&&o.draggable&&n.stepDrag&&n.stepDrag.handleMouseDown(t)},n.setHoverOn=function(t){var e=n.props,o=e.model,r=e.graphModel;if(!o.isHovered){var i=o.getData();o.setHovered(!0),r.eventCenter.emit(Om.NODE_MOUSEENTER,{data:i,e:t})}},n.setHoverOff=function(t){var e=n.props,o=e.model,r=e.graphModel,i=o.getData();o.isHovered&&(o.setHovered(!1),r.eventCenter.emit(Om.NODE_MOUSELEAVE,{data:i,e:t}))};var o=e.graphModel,r=o.gridSize,i=o.eventCenter,a=e.model;return n.stepDrag=new Dm({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:r,eventType:"NODE",isStopPropagation:!1,eventCenter:i,model:a}),n.modelDisposer=Oe((function(){return n.props}),(function(t){t&&t.model&&n.stepDrag.setModel(t.model)})),n}return Mw(e,t),e.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer()},e.prototype.componentDidMount=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.getAnchorShape=function(t){return null},e.prototype.getAnchors=function(){var t=this,e=this.props,n=e.model,o=e.graphModel,r=n.isSelected,i=n.isHitable,a=n.isDragging,s=n.isShowAnchor;return i&&(r||s)&&!a?Ih(n.anchors,(function(e,r){var i=n.getAnchorLineStyle(e),a=n.getAnchorStyle(e);return xr(cw,{anchorData:e,node:t,style:a,edgeStyle:i,anchorIndex:r,nodeModel:n,graphModel:o,setHoverOff:t.setHoverOff})})):[]},e.prototype.getRotateControl=function(){var t=this.props,e=t.model,n=t.graphModel,o=n.editConfigModel,r=o.isSilentMode,i=o.allowRotate,a=e.isSelected,s=e.isHitable,l=e.rotatable,u=e.isHovered,c=i&&l,d=e.getRotateControlStyle();if(!r&&s&&(a||u)&&c)return xr(hw,{graphModel:n,nodeModel:e,eventCenter:n.eventCenter,style:d})},e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,o=n.editConfigModel,r=o.isSilentMode,i=o.allowResize,a=e.isSelected,s=e.isHitable,l=e.resizable,u=e.isHovered,c=i&&l,d=e.getResizeControlStyle();return!r&&s&&(a||u)&&c?xr(q_,{style:d,model:e,graphModel:n}):null},e.prototype.getText=function(){var t,e=this.props,n=e.model,o=e.graphModel,r=o.editConfigModel;if(r.nodeTextMode!==Am.TEXT)return null;if(n.state===Sm.TEXT_EDIT)return null;if(n.text){var i=!1;return r.nodeTextDraggable&&n.text.draggable&&(i=!0),xr(xw,{editable:r.nodeTextEdit&&(null===(t=n.text.editable)||void 0===t||t),model:n,graphModel:o,draggable:i})}return null},e.prototype.getStateClassName=function(){var t=this.props.model,e=t.state,n=t.isDragging,o=t.isSelected,r="lf-node";switch(e){case Sm.ALLOW_CONNECT:r+=" lf-node-allow";break;case Sm.NOT_ALLOW_CONNECT:r+=" lf-node-not-allow";break;default:r+=" lf-node-default"}return n&&(r+=" lf-dragging"),o&&(r+=" lf-node-selected"),r},e.prototype.toFront=function(){var t=this.props,e=t.model,n=t.graphModel;e.autoToFront&&n.toFront(e.id)},e.prototype.render=function(){var t,e=this.props,n=e.model,o=e.graphModel,r=o.editConfigModel,i=r.hideAnchors,a=r.adjustNodePosition,s=r.allowRotate,l=r.allowResize,u=o.gridSize,c=o.transformModel.SCALE_X,d=n.isHitable,p=n.draggable,h=n.transform,f=n.getOuterGAttributes(),g=f.className,v=void 0===g?"":g,y=Tw(f,["className"]),m=xr("g",{className:"lf-node-content",children:[xr("g",{transform:h,children:[this.getShape(),this.getText(),s&&this.getRotateControl(),l&&this.getResizeControl()]}),!i&&this.getAnchors()]});return d?(a&&p&&this.stepDrag.setStep(u*c),t=xr("g",Ow({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},y,{children:m}))):t=xr("g",Ow({className:"".concat(this.getStateClassName()," ").concat(v)},y,{children:m})),t},e.isObserved=!1,e}(ho),Pw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dw=function(){return Dw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Dw.apply(this,arguments)},kw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Pw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return xr(O_,Dw({},e,{x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius}))},e}(Aw),Rw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Iw=function(){return Iw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Iw.apply(this,arguments)},Lw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Rw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,o=t.r,r=t.getNodeStyle();return xr(k_,Iw({},r,{x:e,y:n,r:o}))},e}(Aw),jw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Bw=function(){return Bw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Bw.apply(this,arguments)},Hw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return jw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t,n=e.x,o=e.y,r=e.width,i=e.height,a=e.points,s=t.getNodeStyle(),l={transform:"matrix(1 0 0 1 ".concat(n-r/2," ").concat(o-i/2,")")};return xr("g",Bw({},l,{children:xr(H_,Bw({},s,{points:a,x:n,y:o}))}))},e}(Aw),zw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Fw=function(){return Fw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Fw.apply(this,arguments)},Ww=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return zw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return xr("g",{children:xr(H_,Fw({},e,{points:t.points,x:t.x,y:t.y}))})},e}(Aw),Gw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Xw=function(){return Xw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Xw.apply(this,arguments)},Uw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return xr(L_,Xw({},e,{x:t.x,y:t.y,rx:t.rx,ry:t.ry}))},e}(Aw),Yw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Vw=function(){return Vw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Vw.apply(this,arguments)},Kw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Yw(e,t),e.prototype.getBackground=function(){var t=this.props.model,e=t.getTextStyle(),n=t.width,o=t.height,r=t.x,i=t.y,a=Vw(Vw({},e.background),{x:r,y:i,width:n,height:o});return xr(O_,Vw({},a))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return xr("g",{children:this.getBackground()})},e}(Aw),qw=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Zw=function(){return Zw=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Zw.apply(this,arguments)},$w=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},Jw=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},Qw=function(t){function e(){var e=t.apply(this,Jw([],$w(arguments),!1))||this;return e.ref={current:null},e}return qw(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,o=t.height,r=t.width,i=t.getNodeStyle();return this.currentProperties=JSON.stringify(t.properties),xr("foreignObject",Zw({},i,{x:e-r/2,y:n-o/2,width:r,height:o,ref:this.ref}))},e}(Aw),tS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),eS=function(){return eS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},eS.apply(this,arguments)},nS=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n},oS=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a};!function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"}(vw||(vw={}));var rS=function(t){function e(e){var n=t.call(this)||this;n.handleMouseDown=function(t){n.stepDrag&&n.stepDrag.handleMouseDown(t)},n.onDragStart=function(){var t=n.props,e=t.x,o=t.y,r=t.edgeModel,i=r.startPoint,a=r.endPoint,s=r.pointsList;n.oldEdge={startPoint:i,endPoint:a,pointsList:s},n.setState({endX:e,endY:o,dragging:!0})},n.onDragging=function(t){var e=t.deltaX,o=t.deltaY,r=n.state,i=r.endX,a=r.endY,s=n.props,l=s.graphModel,u=s.type,c=l.transformModel,d=l.editConfigModel,p=oS(c.moveCanvasPointByHtml([i,a],e,o),2),h=p[0],f=p[1];n.setState({endX:h,endY:f,dragging:!0});var g=n.props.edgeModel,v=Ib({x:i,y:a},l);if(v&&v.node&&n.isAllowAdjust(v).pass){var y=g.startPoint,m=g.endPoint,b=g.sourceNode,_=g.targetNode,x=u===vw.SOURCE?{startPoint:{x:v.anchor.x,y:v.anchor.y},endPoint:{x:m.x,y:m.y},sourceNode:v.node,targetNode:_}:{startPoint:{x:y.x,y:y.y},endPoint:{x:v.anchor.x,y:v.anchor.y},sourceNode:b,targetNode:v.node};g.updateAfterAdjustStartAndEnd(x)}else u===vw.SOURCE?g.updateStartPoint({x:h,y:f}):g.updateEndPoint({x:h,y:f});g.text.value&&d.adjustEdge&&g.setText(Object.assign({},g.text,g.textPosition))},n.onDragEnd=function(t){var e,o,r,i=t.event;try{n.setState({dragging:!1});var a=n.props,s=a.graphModel,l=a.edgeModel,u=a.type,c=n.state,d=c.endX,p=c.endY,h=c.dragging,f=Ib({x:d,y:p},s);if(!h)return;var g=!1,v=void 0;if(f&&f.node){var y=n.isAllowAdjust(f),m=y.pass,b=y.msg,_=y.newTargetNode;if(m){var x=l.getData(),E=x.text,w=x.sourceAnchorId,S=void 0===w?"":w,C=x.targetAnchorId,M=void 0===C?"":C,O=nS(x,["text","sourceAnchorId","targetAnchorId"]);if(v=eS(eS({sourceAnchorId:S,targetAnchorId:M},O),{text:(null==E?void 0:E.value)||""}),u===vw.SOURCE){var T=s.getNodeModelById(f.node.id),N=s.getNodeModelById(l.targetNodeId),A=null===(e=s.edgeGenerator)||void 0===e?void 0:e.call(s,null==T?void 0:T.getData(),null==N?void 0:N.getData(),v);v=eS(eS({},A),{sourceNodeId:f.node.id,sourceAnchorId:f.anchor.id,startPoint:{x:f.anchor.x,y:f.anchor.y},targetNodeId:l.targetNodeId,endPoint:eS({},l.endPoint)}),l.sourceNodeId===f.node.id&&l.sourceAnchorId===f.anchor.id&&(g=!0)}else if(u===vw.TARGET){T=s.getNodeModelById(l.sourceNodeId),N=s.getNodeModelById(f.node.id),A=null===(o=s.edgeGenerator)||void 0===o?void 0:o.call(s,null==T?void 0:T.getData(),null==N?void 0:N.getData(),v);v=eS(eS({},A),{sourceNodeId:l.sourceNodeId,startPoint:eS({},l.startPoint),targetNodeId:f.node.id,targetAnchorId:f.anchor.id,endPoint:{x:f.anchor.x,y:f.anchor.y}}),l.targetNodeId===f.node.id&&l.targetAnchorId===f.anchor.id&&(g=!0)}}else{g=!0;var P=_.getData();s.eventCenter.emit(Om.CONNECTION_NOT_ALLOWED,{data:P,msg:b})}}else g=!0;if(g)n.recoveryEdge();else{var D=l.getData();s.deleteEdgeById(l.id);var k=s.addEdge(eS({},v));s.eventCenter.emit(Om.EDGE_EXCHANGE_NODE,{data:{newEdge:k.getData(),oldEdge:D}})}null===(r=n.preTargetNode)||void 0===r||r.setElementState(Sm.DEFAULT)}finally{(s=n.props.graphModel).eventCenter.emit(Om.ADJUST_POINT_DRAGEND,{e:i,data:n.stepDragData})}},n.recoveryEdge=function(){var t=n.props.edgeModel,e=n.oldEdge,o=e.startPoint,r=e.endPoint,i=e.pointsList;t.updateStartPoint(o),t.updateEndPoint(r),t.modelType!==Mm.LINE_EDGE&&(t.pointsList=null!=i?i:[],t.initPoints())},n.getAdjustPointStyle=function(){return n.props.graphModel.theme.edgeAdjust},n.state={dragging:!1,endX:0,endY:0},n.targetRuleResults=new Map,n.sourceRuleResults=new Map;var o=e.type,r=e.edgeModel,i=e.graphModel.eventCenter;return n.stepDragData={type:o,edgeData:r.getData()},n.stepDrag=new Dm({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:i,data:n.stepDragData}),n}return tS(e,t),e.prototype.isAllowAdjust=function(t){var e,n,o,r,i=this.props,a=i.edgeModel,s=a.id,l=a.sourceNode,u=a.targetNode,c=a.sourceAnchorId,d=a.targetAnchorId,p=i.type;if(p===vw.SOURCE?(e=t.node,n=u,o=t.anchor,r=u.getAnchorInfo(d)):(e=l,n=t.node,r=t.anchor,o=l.getAnchorInfo(c)),this.preTargetNode&&this.preTargetNode!==t.node&&this.preTargetNode.setElementState(Sm.DEFAULT),this.preTargetNode=t.node,r.id===o.id)return{pass:!1,msg:"",newTargetNode:n};var h="".concat(e.id,"_").concat(n.id,"_").concat(o.id,"_").concat(r.id);if(!this.targetRuleResults.has(h)){var f=e.isAllowConnectedAsSource(n,o,r,s),g=n.isAllowConnectedAsTarget(e,o,r,s);this.sourceRuleResults.set(h,qb(f)),this.targetRuleResults.set(h,qb(g))}var v=this.sourceRuleResults.get(h),y=v.isAllPass,m=v.msg,b=this.targetRuleResults.get(h),_=b.isAllPass,x=b.msg,E=y&&_?Sm.ALLOW_CONNECT:Sm.NOT_ALLOW_CONNECT;return p===vw.SOURCE?e.setElementState(E):n.setElementState(E),{pass:y&&_,msg:x||m,newTargetNode:n}},e.prototype.render=function(){var t=this.props,e=t.x,n=t.y,o=t.getAdjustPointShape,r=t.edgeModel,i=this.state.dragging;return xr("g",{pointerEvents:i?"none":"",onMouseDown:this.handleMouseDown,children:i?"":o(e,n,r)})},e}(ho),iS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),aS=function(){return aS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},aS.apply(this,arguments)};!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}iS(e,t),e.prototype.getArrowAttributes=function(){var t=this.props,e=t.arrowInfo,n=t.style,o=e.start,r=e.end,i={start:o,end:r,offset:n.offset,verticalLength:n.verticalLength,type:"end"},a=Im(i),s=a.leftX,l=a.leftY,u=a.rightX,c=a.rightY;return aS({d:"M".concat(s," ").concat(l," L").concat(r.x," ").concat(r.y," L").concat(u," ").concat(c," z")},n)},e.prototype.getShape=function(){var t=this.getArrowAttributes(),e=t.d,n=t.strokeWidth,o=t.stroke;return xr(A_,{d:e,fill:t.fill,strokeWidth:n,stroke:o})},e.prototype.render=function(){return xr("g",{className:"lf-arrow",children:this.getShape()})}}(ho);var sS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),lS=function(){return lS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},lS.apply(this,arguments)},uS=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},cS=function(t){function e(){var e=t.call(this)||this;return e.textRef={current:null},e.handleHover=function(t,n){var o=e.props,r=o.model,i=o.graphModel.eventCenter;r.setHovered(t);var a=t?Om.EDGE_MOUSEENTER:Om.EDGE_MOUSELEAVE,s=r.getData();i.emit(a,{data:s,e:n})},e.setHoverOn=function(t){e.props.model.isHovered||(e.textRef&&e.textRef.current&&e.textRef.current.setHoverOn(),e.handleHover(!0,t))},e.setHoverOff=function(t){e.props.model.isHovered&&(e.textRef&&e.textRef.current&&e.textRef.current.setHoverOff(),e.handleHover(!1,t))},e.handleContextMenu=function(t){t.preventDefault(),e.contextMenuTime=(new Date).getTime(),e.clickTimer&&clearTimeout(e.clickTimer);var n=e.props,o=n.model,r=n.graphModel,i=r.getPointByClient({x:t.clientX,y:t.clientY});r.setElementStateById(o.id,Sm.SHOW_MENU,i.domOverlayPosition),e.toFront(),o.isSelected||r.selectEdgeById(o.id);var a=null==o?void 0:o.getData();r.eventCenter.emit(Om.EDGE_CONTEXTMENU,{data:a,e:t,position:i})},e.handleMouseDown=function(t){t.stopPropagation(),e.startTime=(new Date).getTime()},e.handleMouseUp=function(t){if(e.startTime&&!((new Date).getTime()-e.startTime>200||2===t.button)){var n=2===t.detail,o=e.props,r=o.model,i=o.graphModel,a=null==r?void 0:r.getData(),s=i.getPointByClient({x:t.clientX,y:t.clientY});if(n){var l=i.editConfigModel,u=i.textEditElement,c=r.id,d=r.text,p=r.modelType;if(u&&u.id===c&&i.setElementStateById(c,Sm.DEFAULT),l.edgeTextEdit&&d.editable&&(r.setSelected(!1),i.setElementStateById(c,Sm.TEXT_EDIT)),p===Mm.POLYLINE_EDGE){var h=r,f=i.getPointByClient({x:t.x,y:t.y}).canvasOverlayPosition,g=f.x,v=f.y;h.dbClickPosition=hb({x:g,y:v},h.points)}i.eventCenter.emit(Om.EDGE_DBCLICK,{data:a,e:t,position:s})}else i.eventCenter.emit(Om.ELEMENT_CLICK,{data:a,e:t,position:s}),i.eventCenter.emit(Om.EDGE_CLICK,{data:a,e:t,position:s});var y=i.editConfigModel;i.selectEdgeById(r.id,_b(t,y)),e.toFront()}},e}return sS(e,t),e.prototype.getShape=function(){return xr("g",{children:this.getEdge()})},e.prototype.getTextStyle=function(){},e.prototype.getText=function(){var t,e=this.props,n=e.model,o=e.graphModel,r=o.editConfigModel;if(r.edgeTextMode!==Am.TEXT)return null;if(n.state===Sm.TEXT_EDIT)return null;if(n.text){var i=!1;return r.edgeTextDraggable&&n.text.draggable&&(i=!0),xr(Cw,{ref:this.textRef,editable:r.edgeTextEdit&&(null===(t=n.text.editable)||void 0===t||t),model:n,graphModel:o,draggable:i})}return null},e.prototype.getArrowInfo=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,o=t.isSelected;return{start:e,end:n,hover:this.state.hover,isSelected:o}},e.prototype.getLastTwoPoints=function(){var t=this.props.model;return[t.startPoint,t.endPoint]},e.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},e.prototype.getArrow=function(){var t=this.props.model,e=t.id,n=t.getArrowStyle(),o=n.refY,r=void 0===o?0:o,i=n.refX,a=void 0===i?2:i,s=uS(this.getLastTwoPoints(),2),l=s[0],u=s[1],c="auto";return null!==l&&null!==u&&(c=tx({x:u.x-l.x,y:u.y-l.y,z:0})*(180/Math.PI)),xr("g",{children:xr("defs",{children:[xr("marker",{id:"marker-start-".concat(e),refX:-a,refY:r,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),xr("marker",{id:"marker-end-".concat(e),refX:a,refY:r,overflow:"visible",orient:c,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getStartArrow=function(){return xr("path",{})},e.prototype.getEndArrow=function(){var t=this.props.model.getArrowStyle(),e=t.stroke,n=t.strokeWidth,o=t.offset,r=t.verticalLength;return xr("path",{stroke:e,fill:e,strokeWidth:n,transform:"rotate(180)",d:"M 0 0 L ".concat(o," -").concat(r," L ").concat(o," ").concat(r," Z")})},e.prototype.getAdjustPointShape=function(t,e,n){var o=n.getAdjustPointStyle();return xr(k_,lS({className:"lf-edge-adjust-point"},o,{x:t,y:e}))},e.prototype.getAdjustPoints=function(){var t=this.props,e=t.model,n=t.graphModel,o=n.editConfigModel,r=o.adjustEdgeStartAndEnd,i=o.adjustEdgeStart,a=o.adjustEdgeEnd,s=e.getAdjustStart(),l=e.getAdjustEnd();return xr("g",{children:[r&&i&&xr(rS,lS({type:vw.SOURCE},s,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:e,graphModel:n})),r&&a&&xr(rS,lS({type:vw.TARGET},l,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:e,graphModel:n}))]})},e.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},e.prototype.getAppendWidth=function(){return xr("g",{})},e.prototype.getAppend=function(){return xr("g",{className:"lf-edge-append",children:this.getAppendWidth()})},e.prototype.getEdge=function(){return null},e.prototype.toFront=function(){var t=this.props,e=t.graphModel,n=t.model;e.toFront(n.id)},e.prototype.render=function(){var t=this.props.model,e=t.isSelected,n=t.isHitable,o=t.isShowAdjustPoint;return xr("g",{children:[xr("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()]}),o&&e?this.getAdjustPoints():""]})},e.isObserved=!1,e}(ho),dS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),pS=function(){return pS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},pS.apply(this,arguments)},hS=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},fS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return dS(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.getEdgeStyle(),n=t,o=n.path,r=n.isAnimation,i=n.arrowConfig,a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,l=a.stroke,u=a.strokeDashoffset,c=a.animationName,d=a.animationDuration,p=a.animationIterationCount,h=a.animationTimingFunction,f=a.animationDirection;return xr(A_,pS({d:o},e,i,r?{strokeDasharray:s,stroke:l,style:{strokeDashoffset:u,animationName:c,animationDuration:d,animationIterationCount:p,animationTimingFunction:h,animationDirection:f}}:{}))},e.prototype.getAppendWidth=function(){return xr(A_,{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,o=t.getArrowStyle().offset,r=t.pointsList.map((function(t){return{x:t.x,y:t.y}})),i=hS(pb(r,o),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 pb(n,e)},e}(cS),gS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),vS=function(){return vS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},vS.apply(this,arguments)},yS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return gS(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,o=t.isAnimation,r=t.arrowConfig,i=t.getEdgeStyle(),a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,l=a.stroke,u=a.strokeDashoffset,c=a.animationName,d=a.animationDuration,p=a.animationIterationCount,h=a.animationTimingFunction,f=a.animationDirection;return xr(S_,vS({},i,{x1:e.x,y1:e.y,x2:n.x,y2:n.y},r,o?{strokeDasharray:s,stroke:l,style:{strokeDashoffset:u,animationName:c,animationDuration:d,animationIterationCount:p,animationTimingFunction:h,animationDirection:f}}:{}))},e.prototype.getAppendWidth=function(){var t=this.props.model,e=function(t){var e,n=t.start,o=t.end;if(n.x===o.x&&n.y===o.y)e="";else{var r={start:n,end:o,offset:10,verticalLength:5},i=Im(Lm(Lm({},r),{type:"start"})),a=Im(Lm(Lm({},r),{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"}}({start:t.startPoint,end:t.endPoint}),n=e.d,o=e.strokeWidth,r=e.fill,i=e.strokeDasharray;return xr(A_,{d:n,fill:r,strokeWidth:o,stroke:e.stroke,strokeDasharray:i})},e}(cS),mS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),bS=function(){return bS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},bS.apply(this,arguments)},_S=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},xS=function(t){function e(){var e=t.call(this)||this;return e.onDragStart=function(){var t=e.props.model;t.dragAppendStart(),e.isShowAdjustPointTemp=t.isShowAdjustPoint,t.isShowAdjustPoint=!1},e.onDragging=function(t){var n=t.deltaX,o=t.deltaY,r=e.props,i=r.model,a=r.graphModel;e.isDragging=!0;var s=a.transformModel,l=a.editConfigModel,u=_S(s.fixDeltaXY(n,o),2),c=u[0],d=u[1],p=i,h=l.adjustEdgeMiddle;e.appendInfo=h?p.dragAppendSimple(e.appendInfo,{x:c,y:d}):p.dragAppend(e.appendInfo,{x:c,y:d})},e.onDragEnd=function(){var t,n=e.props,o=n.model,r=n.graphModel.eventCenter,i=o;i.dragAppendEnd(),e.isDragging=!1,i.isShowAdjustPoint=null!==(t=e.isShowAdjustPointTemp)&&void 0!==t&&t,e.appendInfo=void 0,r.emit(Om.EDGE_ADJUST,{data:i.getData()})},e.beforeDragStart=function(t,n){n.draggable&&e.drag.handleMouseDown(t),e.appendInfo=n},e.drag=new Dm({onDragStart:e.onDragStart,onDragging:e.onDragging,onDragEnd:e.onDragEnd,isStopPropagation:!1}),e}return mS(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.points,n=t.isAnimation,o=t.arrowConfig,r=t.getEdgeStyle(),i=t.getEdgeAnimationStyle(),a=i.strokeDasharray,s=i.stroke,l=i.strokeDashoffset,u=i.animationName,c=i.animationDuration,d=i.animationIterationCount,p=i.animationTimingFunction,h=i.animationDirection;return xr(W_,bS({points:e},r,o,n?{strokeDasharray:a,stroke:s,style:{strokeDashoffset:l,animationName:u,animationDuration:c,animationIterationCount:d,animationTimingFunction:p,animationDirection:h}}:{}))},e.prototype.getArrowInfo=function(){var t=this.props.model,e=t.points,n=t.isSelected,o=this.state.hover,r=ib(e),i=r[0],a=r[0];return r.length>=2&&(i=r[r.length-2],a=r[r.length-1]),{start:i,end:a,hover:o,isSelected:n}},e.prototype.getLastTwoPoints=function(){var t=this.props.model.points,e=ib(t),n=e[0],o=e[0];return e.length>=2&&(n=e[e.length-2],o=e[e.length-1]),[n,o]},e.prototype.getAppendAttributes=function(t){var e,n=t.start,o=t.end;if(n.x===o.x&&n.y===o.y)e="";else{var r={start:n,end:o,offset:10,verticalLength:5},i=Im(bS(bS({},r),{type:"start"})),a=Im(bS(bS({},r),{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"}},e.prototype.getAppendShape=function(t){var e=this.getAppendAttributes(t),n=e.d,o=e.strokeWidth,r=e.fill,i=e.strokeDasharray;return xr(A_,{d:n,fill:r,strokeWidth:o,stroke:e.stroke,strokeDasharray:i})},e.prototype.getAppendWidth=function(){for(var t=this,e=this.props,n=e.model,o=e.graphModel,r=n.pointsList,i=n.draggable,a=[],s=r.length,l=function(e){var n="lf-polyline-append",l={start:{x:r[e].x,y:r[e].y},end:{x:r[e+1].x,y:r[e+1].y},startIndex:e,endIndex:e+1,direction:Nm.HORIZONTAL,draggable:!0},c=xr("g",{className:n,children:u.getAppendShape(l)}),d=o.editConfigModel,p=d.adjustEdge,h=d.adjustEdgeMiddle;if(p&&i){var f=l.startIndex,g=l.endIndex,v=h&&(0===f||g===s-1);l.draggable=!v,l.start.x===l.end.x?(l.draggable&&(n+="-ew-resize"),l.direction=Nm.VERTICAL):l.start.y===l.end.y&&(l.draggable&&(n+="-ns-resize"),l.direction=Nm.HORIZONTAL),c=xr("g",{className:u.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(e){return t.beforeDragStart(e,l)},children:xr("g",{className:n,children:u.getAppendShape(l)})})}a.push(c)},u=this,c=0;c<s-1;c++)l(c);return xr("g",{children:a})},e}(cS),ES=function(){return ES=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},ES.apply(this,arguments)},wS=function(){function t(t){var e=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){e.nodeConfig=null,window.document.removeEventListener("mouseup",e.stopDrag)},this.dragEnter=function(t){e.nodeConfig&&!e.fakeNode&&(e.fakeNode=e.lf.createFakeNode(ES(ES({},e.nodeConfig),e.clientToLocalPoint({x:t.clientX,y:t.clientY}))))},this.onDragOver=function(t){if(t.preventDefault(),e.fakeNode){var n=e.clientToLocalPoint({x:t.clientX,y:t.clientY}),o=n.x,r=n.y;e.fakeNode.moveTo(o,r);var i=e.fakeNode.getData();e.lf.setNodeSnapLine(i),e.lf.graphModel.eventCenter.emit(Om.NODE_DND_DRAG,{data:i})}return!1},this.onDragLeave=function(){e.fakeNode&&(e.lf.removeNodeSnapLine(),e.lf.graphModel.removeFakeNode(),e.fakeNode=null)},this.onDrop=function(t){e.lf.graphModel&&t&&e.nodeConfig&&(e.lf.addNode(ES(ES({},e.nodeConfig),e.clientToLocalPoint({x:t.clientX,y:t.clientY})),Om.NODE_DND_ADD,t),t.preventDefault(),t.stopPropagation(),e.nodeConfig=null,e.lf.removeNodeSnapLine(),e.lf.graphModel.removeFakeNode(),e.fakeNode=null)};var n=t.lf;this.lf=n}return t.prototype.clientToLocalPoint=function(t){var e=t.x,n=t.y,o=El(this.lf.options,["grid","size"]),r=this.lf.graphModel.getPointByClient({x:e,y:n}).canvasOverlayPosition,i=r.x,a=r.y;return{x:yb(i,o),y:yb(a,o)}},t.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))},t.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},t}();var SS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),CS=function(){return CS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},CS.apply(this,arguments)},MS=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},OS=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},TS=function(t){function e(e){var n=t.call(this,e)||this;return n.ref={current:null},n.__prevText={type:"",text:"",id:""},n.keyupHandler=function(t){var e=n.props.graphModel.textEditElement;"Enter"===t.key&&t.altKey&&(null==e||e.setElementState(Sm.DEFAULT))},n.inputHandler=function(t){var e=t.target.innerText,o=n.props.graphModel.textEditElement;o&&(n.__prevText={type:o.type,text:e.replace(/(\r\n)+$|(\n)+$/,""),id:o.id})},n.keydownHandler=function(t){t.stopPropagation()},n.state={style:{left:0,top:0}},n}return SS(e,t),e.getDerivedStateFromProps=function(t){var e,n,o=t.textEditElement,r=t.graphModel,i=r.transformModel,a=r.theme,s=a.inputText;if(o){if(!(null===(e=o.text)||void 0===e?void 0:e.value)&&o.BaseType===Cm.EDGE){var l=o.text,u=o.textPosition,c=u.x,d=u.y;l.x=c,l.y=d,o.setText(l)}var p={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(o.BaseType===Cm.EDGE){var h=a.edgeText,f=h.overflowMode,g=h.lineHeight,v=h.wrapPadding;(m=h.textWidth)&&"autoWrap"===f&&(n=CS(CS({},p),{width:m,minWidth:m,lineHeight:g,padding:v}))}else if(o.BaseType===Cm.NODE){var y=a.nodeText,m=(f=y.overflowMode,g=y.lineHeight,v=y.wrapPadding,y.textWidth),b=o.width,_=o.modelType,x=o.textWidth||m||b;(_!==Mm.TEXT_NODE&&"autoWrap"===f||_===Mm.TEXT_NODE&&m)&&(n=CS(CS({},p),{width:x,minWidth:x,lineHeight:g,padding:v}))}var E=o.text,w=E.x,S=E.y,C=OS(i.CanvasPointToHtmlPoint([w,S]),2),M=C[0],O=C[1];return{style:CS(CS({left:M,top:O},n),s)}}return null},e.prototype.componentDidUpdate=function(){var t=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),""!==this.__prevText.id){var e=this.__prevText,n=e.text,o=e.id;t.updateText(o,n),t.eventCenter.emit(Om.TEXT_UPDATE,{data:CS({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},e.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)}},e.prototype.render=function(){var t,e=this.props.graphModel.textEditElement,n=this.state.style;return e?xr("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},e.toolName="text-edit-tool",e=MS([yC],e)}(ho),NS=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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),AS=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},PS=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},DS=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},kS=function(t){function e(e){var n=t.call(this,e)||this;n.handleMouseDown=function(t){n.stepDrag.handleMouseDown(t)},n.handleWheelEvent=function(t){var e,o;t.preventDefault();var r=t.deltaX,i=t.deltaY,a=t.clientX,s=t.clientY,l=t.ctrlKey,u=new WheelEvent("wheel",{deltaX:r,deltaY:i,clientX:a,clientY:s,ctrlKey:l});null===(o=null===(e=n.props.lf.container)||void 0===e?void 0:e.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))||void 0===o||o.dispatchEvent(u)},n.onDragging=function(t){var e=t.deltaX,o=t.deltaY,r=n.props,i=r.graphModel,a=r.lf.getTransform(),s=a.SCALE_X,l=a.SCALE_Y,u=i.getSelectElements(!0);i.moveNodes(u.nodes.map((function(t){return t.id})),e/s,o/l)},n.handleContextMenu=function(t){t.preventDefault();var e=n.props,o=e.graphModel,r=e.graphModel,i=r.eventCenter,a=r.selectElements,s=o.getPointByClient({x:t.clientX,y:t.clientY}),l={nodes:[],edges:[]};DS([],PS(a.values()),!1).forEach((function(t){t.BaseType===Cm.NODE&&l.nodes.push(t.getData()),t.BaseType===Cm.EDGE&&l.edges.push(t.getData())})),i.emit(Om.SELECTION_CONTEXTMENU,{data:l,e:t,position:s})};var o=e.graphModel,r=o.gridSize,i=o.eventCenter;return n.stepDrag=new Dm({onDragging:n.onDragging,step:r,eventType:"SELECTION",eventCenter:i}),n}return NS(e,t),e.prototype.render=function(){var t,e,n=this.props.graphModel,o=n.selectElements,r=n.transformModel,i=this.props.lf.getTransform(),a=i.SCALE_X,s=i.SCALE_Y;if(!(o.size<=1)){var l=Number.MAX_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER,c=Number.MIN_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER;return o.forEach((function(t){var e;t.BaseType===Cm.NODE&&(e=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{x:e-o/2,y:n-r/2,x1:e+o/2,y1:n+r/2}}(t)),t.BaseType===Cm.EDGE&&(e=km(t)),void 0!==e&&(l=Math.min(l,e.x),u=Math.min(u,e.y),c=Math.max(c,e.x1),d=Math.max(d,e.y1))})),t=PS(r.CanvasPointToHtmlPoint([l,u]),2),l=t[0],u=t[1],e=PS(r.CanvasPointToHtmlPoint([c,d]),2),c=e[0],d=e[1],xr("div",{className:"lf-multiple-select",style:{left:"".concat(l-20*a/2,"px"),top:"".concat(u-20*s/2,"px"),width:"".concat(c-l+20*a,"px"),height:"".concat(d-u+20*s,"px"),"border-width":"".concat(2*a,"px")},onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},e.toolName="multiple-select-tool",e=AS([yC],e)}(ho),RS=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},IS=[TS,kS],LS=function(){function t(t){var e=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=t,oh(IS,(function(t){e.isDisabled(t.toolName)||e.registerTool(t.toolName,t)}));var n=t.graphModel;n.eventCenter.on("".concat(Om.GRAPH_TRANSFORM,",").concat(Om.NODE_CLICK,",").concat(Om.BLANK_CLICK," "),(function(){var t,e=n.textEditElement,o=n.editConfigModel,r=o.edgeTextEdit,i=o.nodeTextEdit;(r||i)&&e&&(null===(t=n.textEditElement)||void 0===t||t.setElementState(Sm.DEFAULT))}))}return t.prototype.isDisabled=function(t){var e;return-1!==(null===(e=this.instance.options.disabledTools)||void 0===e?void 0:e.indexOf(t))},t.prototype.registerTool=function(t,e){this.toolMap.set(t,e)},t.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} 的工具")},t.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} 的工具")},t.prototype.getTools=function(){return Array.from(this.toolMap.values())},t.prototype.getInstance=function(){return this.instance},RS([mt],t.prototype,"toolMap",void 0),RS([xe],t.prototype,"disableTool",null),RS([xe],t.prototype,"enableTool",null),t}();function jS(t,e){void 0===e&&(e="Illegal state"),t||function(t){throw new Error("[mobx-utils] "+t)}(e)}var BS=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(BS(Object.getPrototypeOf(t))||[])},HS=function(t){return function(t){var e=BS(t);return e.filter((function(t,n){return e.indexOf(t)===n}))}(t).filter((function(t){return"constructor"!==t&&!~t.indexOf("__")}))},zS="pending",FS="fulfilled",WS="rejected";function GS(t){switch(this.state){case zS:return t.pending&&t.pending(this.value);case WS:return t.rejected&&t.rejected(this.value);case FS:return t.fulfilled?t.fulfilled(this.value):this.value}}function XS(t,e){if(jS(arguments.length<=2,"fromPromise expects up to two arguments"),jS("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(xe("observableFromPromise-resolve",(function(t){n.value=t,n.state=FS})),xe("observableFromPromise-reject",(function(t){n.value=t,n.state=WS}))),n.isPromiseBasedObservable=!0,n.case=GS;var o=e&&e.state===FS?e.value:void 0;return De(n,{value:o,state:zS},{},{deep:!1}),n}!function(t){t.reject=xe("fromPromise.reject",(function(e){var n=t(Promise.reject(e));return n.state=WS,n.value=e,n})),t.resolve=xe("fromPromise.resolve",(function(e){void 0===e&&(e=void 0);var n=t(Promise.resolve(e));return n.state=FS,n.value=e,n}))}(XS||(XS={}));var US=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(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()},US([mt.ref],t.prototype,"current",void 0),US([xe.bound],t.prototype,"next",null),US([xe.bound],t.prototype,"complete",null),US([xe.bound],t.prototype,"error",null)}();var YS=function(){return YS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},YS.apply(this,arguments)},VS=function(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},KS=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];function qS(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function ZS(t){return Rn(t)||_n(t)||Sn(t)}function $S(t,e){var n=new WeakMap;function o(o){var a=n.get(o.object);!function(t,e){switch(t.type){case"add":r(t.newValue,e,t.name);break;case"update":i(t.oldValue),r(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,o){return r(n,e,""+(t.index+o))}));for(var o=t.index+t.addedCount;o<t.object.length;o++)if(ZS(t.object[o])){var a=n.get(t.object[o]);a&&(a.path=""+o)}}}(o,a),e(o,qS(a),t)}function r(t,e,i){if(ZS(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 '"+qS(e)+"/"+i+"', but it already exists at '"+qS(a.parent)+"/"+a.path+"'")}else{var s={parent:e,path:i,dispose:$e(t,o)};n.set(t,s),Ke(t).forEach((function(t){var e=t[0];return r(t[1],s,e)}))}}}function i(t){if(ZS(t)){var e=n.get(t);if(!e)return;n.delete(t),e.dispose(),Ve(t).forEach(i)}}return r(t,void 0,""),function(){i(t)}}!function(){function t(t){var e=this;this.model=t,this.localValues=mt.map({}),this.localComputedValues=mt.map({}),this.isPropertyDirty=function(t){return e.localValues.has(t)},jS(Rn(t),"createViewModel expects an observable object"),HS(t).forEach((function(n){if(n!==U&&"__mobxDidRunLazyInitializers"!==n){if(jS(-1===KS.indexOf(n),"The propertyname "+n+" is reserved and cannot be used with viewModels"),Ge(t,n)){var o=Ln(t,n).derivation;e.localComputedValues.set(n,St(o.bind(e)))}var r=Object.getOwnPropertyDescriptor(t,n),i=r?{enumerable:r.enumerable}:{};Object.defineProperty(e,n,YS(YS({},i),{configurable:!0,get:function(){return Ge(t,n)?e.localComputedValues.get(n).get():e.isPropertyDirty(n)?e.localValues.get(n):e.model[n]},set:xe((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;Ye(this.localValues).forEach((function(e){var n=t.localValues.get(e),o=t.model[e];_n(o)?o.replace(n):Sn(o)?(o.clear(),o.merge(n)):We(n)||(t.model[e]=n)})),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(t){this.localValues.delete(t)},VS([St],t.prototype,"isDirty",null),VS([St],t.prototype,"changedValues",null),VS([xe.bound],t.prototype,"submit",null),VS([xe.bound],t.prototype,"reset",null),VS([xe.bound],t.prototype,"resetProperty",null)}();var JS=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 o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();!function(t){function e(e,n,o){var r=void 0===o?{}:o,i=r.name,a=void 0===i?"ogm"+(1e3*Math.random()|0):i,s=r.keyToName,l=void 0===s?function(t){return""+t}:s,u=t.call(this)||this;u._keyToName=l,u._groupBy=n,u._ogmInfoKey=Symbol("ogmInfo"+a),u._base=e;for(var c=0;c<e.length;c++)u._addItem(e[c]);return u._disposeBaseObserver=$e(u._base,(function(t){if("splice"===t.type)on((function(){for(var e=0,n=t.removed;e<n.length;e++){var o=n[e];u._removeItem(o)}for(var r=0,i=t.added;r<i.length;r++){var a=i[r];u._addItem(a)}}));else{if("update"!==t.type)throw new Error("illegal state");on((function(){u._removeItem(t.oldValue),u._addItem(t.newValue)}))}})),u}JS(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=mt([],{name:"GroupArray["+this._keyToName(e)+"]",deep:!1}),t.prototype.set.call(this,e,n)),n},e.prototype._removeFromGroupArr=function(e,n){var o=t.prototype.get.call(this,e);1===o.length?t.prototype.delete.call(this,e):(n===o.length-1||(o[n]=o[o.length-1],o[n][this._ogmInfoKey].groupArrIndex=n),o.length--)},e.prototype._addItem=function(t){var e=this,n=this._groupBy(t),o=this._getGroupArr(n),r={groupByValue:n,groupArrIndex:o.length,reaction:Oe((function(){return e._groupBy(t)}),(function(n,o){var r=t[e._ogmInfoKey];e._removeFromGroupArr(r.groupByValue,r.groupArrIndex);var i=e._getGroupArr(n),a=i.length;i.push(t),r.groupByValue=n,r.groupArrIndex=a}))};Object.defineProperty(t,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:r}),o.push(t)},e.prototype._removeItem=function(t){var e=t[this._ogmInfoKey];this._removeFromGroupArr(e.groupByValue,e.groupArrIndex),e.reaction(),delete t[this._ogmInfoKey]}}(wn),Promise.resolve(),"undefined"!=typeof queueMicrotask||"undefined"!=typeof process&&process.nextTick;var QS=function(){return QS=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},QS.apply(this,arguments)},tC=function(){function t(t){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=t}return t.prototype.add=function(t){Rf($p(this.undos),t)||(this.undos.push(t),Rf(this.curData,t)||(this.redos=[]),this.eventCenter.emit(Om.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},t.prototype.undoAble=function(){return this.undos.length>1},t.prototype.undo=function(){if(this.undoAble()){var t=this.undos.pop();this.redos.push(t);var e=this.undos.pop();return this.curData=_d(e),e}},t.prototype.redoAble=function(){return this.redos.length>0},t.prototype.redo=function(){if(this.redoAble()){var t=this.redos.pop();return this.curData=_d(t),t}},t.prototype.watch=function(t){var e=this;this.stopWatch&&this.stopWatch(),this.undos.push(t.modelToGraphData()),this.stopWatch=$S(t,Dp((function(){var n=t.modelToHistoryData();n&&e.add(QS({},n))}),this.waitTime))},t}(),eC={},nC={get exports(){return eC},set exports(t){eC=t}};!function(t){!function(e,n){if(e){for(var o,r={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"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l=1;l<20;++l)r[111+l]="f"+l;for(l=0;l<=9;++l)r[l+96]=l.toString();g.prototype.bind=function(t,e,n){var o=this;return t=t instanceof Array?t:[t],o._bindMultiple.call(o,t,e,n),o},g.prototype.unbind=function(t,e){return this.bind.call(this,t,(function(){}),e)},g.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},g.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},g.prototype.stopCallback=function(t,e){if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(f(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},g.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},g.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(r[e]=t[e]);o=null},g.init=function(){var t=g(n);for(var e in t)"_"!==e.charAt(0)&&(g[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},g.init(),e.Mousetrap=g,t.exports&&(t.exports=g)}function u(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function c(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return r[t.which]?r[t.which]:i[t.which]?i[t.which]:String.fromCharCode(t.which).toLowerCase()}function d(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function p(t,e,n){return n||(n=function(){if(!o)for(var t in o={},r)t>95&&t<112||r.hasOwnProperty(t)&&(o[r[t]]=t);return o}()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function h(t,e){var n,o,r,i=[];for(n=function(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus")).split("+")}(t),r=0;r<n.length;++r)o=n[r],s[o]&&(o=s[o]),e&&"keypress"!=e&&a[o]&&(o=a[o],i.push("shift")),d(o)&&i.push(o);return{key:o,modifiers:i,action:e=p(o,i,e)}}function f(t,e){return null!==t&&t!==n&&(t===e||f(t.parentNode,e))}function g(t){var e=this;if(t=t||n,!(e instanceof g))return new g(t);e.target=t,e._callbacks={},e._directMap={};var o,r={},i=!1,a=!1,s=!1;function l(t){t=t||{};var e,n=!1;for(e in r)t[e]?n=!0:r[e]=0;n||(s=!1)}function p(t,n,o,i,a,s){var l,u,c,p,h=[],f=o.type;if(!e._callbacks[t])return[];for("keyup"==f&&d(t)&&(n=[t]),l=0;l<e._callbacks[t].length;++l)if(u=e._callbacks[t][l],(i||!u.seq||r[u.seq]==u.level)&&f==u.action&&("keypress"==f&&!o.metaKey&&!o.ctrlKey||(c=n,p=u.modifiers,c.sort().join(",")===p.sort().join(",")))){var g=!i&&u.combo==a,v=i&&u.seq==i&&u.level==s;(g||v)&&e._callbacks[t].splice(l,1),h.push(u)}return h}function f(t,n,o,r){e.stopCallback(n,n.target||n.srcElement,o,r)||!1===t(n,o)&&(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=c(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 y(t,e,n,a){function u(e){return function(){s=e,++r[t],clearTimeout(o),o=setTimeout(l,1e3)}}function d(e){f(n,e,t),"keyup"!==a&&(i=c(e)),setTimeout(l,10)}r[t]=0;for(var p=0;p<e.length;++p){var g=p+1===e.length?d:u(a||h(e[p+1]).action);m(e[p],g,a,t,p)}}function m(t,n,o,r,i){e._directMap[t+":"+o]=n;var a,s=(t=t.replace(/\s+/g," ")).split(" ");s.length>1?y(t,s,n,o):(a=h(t,o),e._callbacks[a.key]=e._callbacks[a.key]||[],p(a.key,a.modifiers,{type:a.action},r,t,i),e._callbacks[a.key][r?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:r,level:i,combo:t}))}e._handleKey=function(t,e,n){var o,r=p(t,e,n),i={},u=0,c=!1;for(o=0;o<r.length;++o)r[o].seq&&(u=Math.max(u,r[o].level));for(o=0;o<r.length;++o)if(r[o].seq){if(r[o].level!=u)continue;c=!0,i[r[o].seq]=1,f(r[o].callback,n,r[o].combo,r[o].seq)}else c||f(r[o].callback,n,r[o].combo);var h="keypress"==n.type&&a;n.type!=s||d(t)||h||l(i),a=c&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var o=0;o<t.length;++o)m(t[o],e,n)},u(t,"keypress",v),u(t,"keydown",v),u(t,"keyup",v)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(nC);var oC=eC,rC=function(){return rC=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},rC.apply(this,arguments)},iC=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n},aC=null;function sC(t,e){return t.x+=e,t.y+=e,kf(t.text)||(t.text.x+=e,t.text.y+=e),t}function lC(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})),kf(t.text)||(t.text.x+=e,t.text.y+=e),t}var uC=40,cC=40;var dC=function(){function t(t){t.keyboard||(t.keyboard={enabled:!1}),this.options=t;var e=t.lf;this.target=e.container,this.mousetrap=new oC(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(Fr(n))n.forEach((function(t){var n=t.keys,o=t.callback,r=t.action;return e.on(n,o,r)}));else{var o=n.keys,r=n.callback,i=n.action;this.on(o,r,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}(),pC=function(){return pC=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},pC.apply(this,arguments)},hC=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},fC=function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r<i;r++)!o&&r in e||(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},gC=Symbol("plugin registered by Logicflow.use"),vC=function(){function t(t){var e,n=this;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(t,e){return n.viewMap.set(t,e)},this.getView=function(t){return n.viewMap.get(t)};var o=mm.get(t),r=o.container,i=o.width,a=o.height;this.options=o,this.container=this.initContainer(r,i,a),this.graphModel=new vE(pC(pC({},o),{container:this.container})),this.plugins=null!==(e=o.plugins)&&void 0!==e?e:[];var s,l,u,c,d=this.graphModel.eventCenter;this.tool=new LS(this),this.dnd=new wS({lf:this}),this.history=new tC(d),this.keyboard=new dC({lf:this,keyboard:o.keyboard}),!1!==o.snapline&&(this.snaplineModel=new bE(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||(s=this,l=this.graphModel,u=s.keyboard,c=u.options.keyboard,u.on(["cmd + c","ctrl + c"],(function(){if(cC=uC,!(null==c?void 0:c.enabled))return!0;if(l.textEditElement)return!0;var t=s.options.guards,e=l.getSelectElements(!1);return t&&t.beforeClone&&!t.beforeClone(e)||0===e.nodes.length&&0===e.edges.length?(aC=null,!0):((aC=e).nodes.forEach((function(t){return sC(t,uC)})),aC.edges.forEach((function(t){return lC(t,uC)})),!1)})),u.on(["cmd + v","ctrl + v"],(function(){if(!(null==c?void 0:c.enabled))return!0;if(l.textEditElement)return!0;if(aC&&(aC.nodes||aC.edges)){s.clearSelectElements();var t=s.addElements(aC,cC);if(!t)return!0;t.nodes.forEach((function(t){return s.selectElementById(t.id,!0)})),t.edges.forEach((function(t){return s.selectElementById(t.id,!0)})),aC.nodes.forEach((function(t){return sC(t,uC)})),aC.edges.forEach((function(t){return lC(t,uC)})),cC+=uC}return!1})),u.on(["cmd + z","ctrl + z"],(function(){return!(null==c?void 0:c.enabled)||!!l.textEditElement||(s.undo(),!1)})),u.on(["cmd + y","ctrl + y"],(function(){return!(null==c?void 0:c.enabled)||!!l.textEditElement||(s.redo(),!1)})),u.on(["backspace"],(function(){if(!(null==c?void 0:c.enabled))return!0;if(l.textEditElement)return!0;var t=l.getSelectElements(!0);return s.clearSelectElements(),t.edges.forEach((function(t){return t.id&&s.deleteEdge(t.id)})),t.nodes.forEach((function(t){return t.id&&s.deleteNode(t.id)})),!1})),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(o.disabledPlugins)}return t.prototype.initContainer=function(t,e,n){var o=document.createElement("div");return o.style.position="relative",o.style.width=e?"".concat(e,"px"):"100%",o.style.height=n?"".concat(n,"px"):"100%",t.innerHTML="",t.appendChild(o),o},Object.defineProperty(t.prototype,Symbol.toStringTag,{get:function(){return t.toStringTag},enumerable:!1,configurable:!0}),t.prototype.register=function(t,e,n){if(void 0===n&&(n=!0),"string"==typeof t){var o={BaseEdge:cS,BaseEdgeModel:ux,BaseNode:Aw,BaseNodeModel:Ax,RectNode:kw,RectNodeModel:Jx,CircleNode:Lw,CircleNodeModel:Rx,PolygonNode:Hw,PolygonNodeModel:Kx,TextNode:Kw,TextNodeModel:rE,LineEdge:yS,LineEdgeModel:bx,DiamondNode:Ww,DiamondNodeModel:Hx,PolylineEdge:xS,PolylineEdgeModel:Cx,BezierEdge:fS,BezierEdgeModel:fx,EllipseNode:Uw,EllipseNodeModel:Gx,HtmlNode:Qw,HtmlNodeModel:aE,h:uo,type:t};if(this.viewMap.forEach((function(t){var e=t.extendKey;e&&(o[e]=t)})),this.graphModel.modelMap.forEach((function(t){var e=t.extendKey;e&&(o[e]=t)})),e){var r=e(o),i=r.view,a=r.model,s=i;n&&!s.isObserved&&(s.isObserved=!0,s=yC(s)),this.setView(t,s),this.graphModel.setModel(t,a)}}else this.registerElement(t)},t.prototype.registerElement=function(t){var e=t.view;!1===t.isObserverView||e.isObserved||(e.isObserved=!0,e=yC(e)),this.setView(t.type,e),this.graphModel.setModel(t.type,t.model)},t.prototype.batchRegister=function(t){var e=this;void 0===t&&(t=[]),oh(t,(function(t){e.registerElement(t)}))},t.prototype.defaultRegister=function(){var t=[{type:"rect",view:kw,model:Jx},{type:"circle",view:Lw,model:Rx},{type:"polygon",view:Hw,model:Kx},{type:"text",view:Kw,model:rE},{type:"ellipse",view:Uw,model:Gx},{type:"diamond",view:Ww,model:Hx},{type:"html",view:Qw,model:aE},{type:"line",view:yS,model:bx},{type:"polyline",view:xS,model:Cx},{type:"bezier",view:fS,model:fx}];this.batchRegister(t)},t.prototype.addNode=function(t,e,n){return void 0===e&&(e=Om.NODE_ADD),this.graphModel.addNode(t,e,n)},t.prototype.deleteNode=function(t){var e=this.graphModel.getNodeModelById(t);if(!e)return!1;var n=e.getData(),o=this.options.guards,r=!(null==o?void 0:o.beforeDelete)||o.beforeDelete(n);return r&&this.graphModel.deleteNode(t),r},t.prototype.cloneNode=function(t){var e=this.graphModel.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){var o=this.options.guards;if(!(null==o?void 0:o.beforeClone)||o.beforeClone(n))return this.graphModel.cloneNode(t)}},t.prototype.changeNodeId=function(t,e){return this.graphModel.changeNodeId(t,e)},t.prototype.changeNodeType=function(t,e){this.graphModel.changeNodeType(t,e)},t.prototype.getNodeModelById=function(t){return this.graphModel.getNodeModelById(t)},t.prototype.getNodeDataById=function(t){var e=this.getNodeModelById(t);return null==e?void 0:e.getData()},t.prototype.getNodeIncomingEdge=function(t){return this.graphModel.getNodeIncomingEdge(t)},t.prototype.getNodeOutgoingEdge=function(t){return this.graphModel.getNodeOutgoingEdge(t)},t.prototype.getNodeIncomingNode=function(t){return this.graphModel.getNodeIncomingNode(t)},t.prototype.getNodeOutgoingNode=function(t){return this.graphModel.getNodeOutgoingNode(t)},t.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(pC(pC({},t),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(n),n},t.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},t.prototype.setNodeSnapLine=function(t){var e;null===(e=this.snaplineModel)||void 0===e||e.setNodeSnapLine(t)},t.prototype.removeNodeSnapLine=function(){var t;null===(t=this.snaplineModel)||void 0===t||t.clearSnapline()},t.prototype.setDefaultEdgeType=function(t){this.graphModel.setDefaultEdgeType(t)},t.prototype.addEdge=function(t){return this.graphModel.addEdge(t)},t.prototype.getEdgeDataById=function(t){var e=this.getEdgeModelById(t);return null==e?void 0:e.getData()},t.prototype.getEdgeModelById=function(t){return this.graphModel.getEdgeModelById(t)},t.prototype.getEdgeModels=function(t){var e=t.sourceNodeId,n=t.targetNodeId,o=[],r=this.graphModel.edges;return e&&n?oh(r,(function(t){t.sourceNodeId===e&&t.targetNodeId===n&&o.push(t)})):e?oh(r,(function(t){t.sourceNodeId===e&&o.push(t)})):n&&oh(r,(function(t){t.targetNodeId===n&&o.push(t)})),o},t.prototype.changeEdgeId=function(t,e){return this.graphModel.changeEdgeId(t,e)},t.prototype.changeEdgeType=function(t,e){this.graphModel.changeEdgeType(t,e)},t.prototype.deleteEdge=function(t){var e=this.graphModel.getEdgeModelById(t);if(!e)return!1;var n=e.getData(),o=this.options.guards,r=!(null==o?void 0:o.beforeDelete)||o.beforeDelete(n);return r&&this.graphModel.deleteEdgeById(t),r},t.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)},t.prototype.getNodeEdges=function(t){return this.graphModel.getNodeEdges(t)},t.prototype.addElements=function(t,e){var n=this,o=t.nodes,r=t.edges;void 0===e&&(e=40),console.log("distance",e);var i={},a={nodes:[],edges:[]};return oh(o,(function(t){var e=t.id,o=n.addNode(t);e&&(i[e]=o.id),a.nodes.push(o)})),oh(r,(function(t){var e=t.sourceNodeId,o=t.targetNodeId;i[e]&&(e=i[e]),i[o]&&(o=i[o]);var r=n.graphModel.addEdge(pC(pC({},t),{sourceNodeId:e,targetNodeId:o}));a.edges.push(r)})),a},t.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)},t.prototype.getSelectElements=function(t){return void 0===t&&(t=!0),this.graphModel.getSelectElements(t)},t.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},t.prototype.getModelById=function(t){return this.graphModel.getElement(t)},t.prototype.getDataById=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getData()},t.prototype.deleteElement=function(t){var e,n,o,r=this.getModelById(t);return!!r&&(null!==(o=null===(n=((e={})[Cm.NODE]=this.deleteNode,e[Cm.EDGE]=this.deleteEdge,e)[r.BaseType])||void 0===n?void 0:n.call(this,t))&&void 0!==o&&o)},t.prototype.setElementZIndex=function(t,e){return this.graphModel.setElementZIndex(t,e)},t.prototype.getAreaElement=function(t,e,n,o,r){return void 0===n&&(n=!0),void 0===o&&(o=!0),void 0===r&&(r=!1),this.graphModel.getAreaElement(t,e,n,o,r).map((function(t){return t.getData()}))},t.prototype.setProperties=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.setProperties(wm(e))},t.prototype.getProperties=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getProperties()},t.prototype.deleteProperty=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.deleteProperty(e)},t.prototype.updateAttributes=function(t,e){this.graphModel.updateAttributes(t,e)},t.prototype.editText=function(t){this.graphModel.editText(t)},t.prototype.updateText=function(t,e){this.graphModel.updateText(t,e)},t.prototype.updateEditConfig=function(t){var e=this.graphModel,n=e.editConfigModel,o=e.transformModel;n.updateEditConfig(t),void 0!==(null==t?void 0:t.stopMoveGraph)&&o.updateTranslateLimits(t.stopMoveGraph),(null==t?void 0:t.isSilentMode)?this.keyboard.disable():this.keyboard.enable(!0)},t.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},t.prototype.setTheme=function(t){this.graphModel.setTheme(t)},t.prototype.focusByElement=function(t){var e=void 0,n=this.getNodeModelById(t);if(n){var o=n.getData();e={x:o.x,y:o.y}}var r=this.getEdgeModelById(t);if(r){var i=r.textPosition;e={x:i.x,y:i.y}}e&&this.focusByCoordinate(e)},t.prototype.focusByCoordinate=function(t){var e=this.graphModel,n=e.transformModel,o=e.width,r=e.height,i=t.x,a=t.y;n.focusOn(i,a,o,r)},t.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)}},t.prototype.resize=function(t,e){this.graphModel.resize(t,e),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},t.prototype.toFront=function(t){this.graphModel.toFront(t)},t.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},t.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,fC([n],hC(t),!1)):n},t.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},t.prototype.clearData=function(){this.graphModel.clearData()},t.prototype.renderRawData=function(t){this.graphModel.graphDataToModel(wm(t)),!1!==this.options.history&&this.history.watch(this.graphModel),function(t,e,n){null==e.__k&&(e.textContent=""),Do(t,e),"function"==typeof n&&n(),t&&t.__c}(xr(aw,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(Om.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},t.prototype.render=function(t){var e=_d(t);this.adapterIn&&(e=this.adapterIn(e)),this.renderRawData(e)},t.prototype.undo=function(){if(this.history.undoAble()){var t=wm(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},t.prototype.redo=function(){if(this.history.redoAble()){var t=wm(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},t.prototype.zoom=function(t,e){return this.graphModel.transformModel.zoom(t,e)},t.prototype.resetZoom=function(){this.graphModel.transformModel.resetZoom()},t.prototype.setZoomMiniSize=function(t){this.graphModel.transformModel.setZoomMiniSize(t)},t.prototype.setZoomMaxSize=function(t){this.graphModel.transformModel.setZoomMaxSize(t)},t.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}},t.prototype.translate=function(t,e){this.graphModel.transformModel.translate(t,e)},t.prototype.resetTranslate=function(){var t=this.graphModel.transformModel,e=t.TRANSLATE_X,n=t.TRANSLATE_Y;this.translate(-e,-n)},t.prototype.translateCenter=function(){this.graphModel.translateCenter()},t.prototype.fitView=function(t,e){void 0===e&&(e=t),this.graphModel.fitView(t,e)},t.prototype.openEdgeAnimation=function(t){this.graphModel.openEdgeAnimation(t)},t.prototype.closeEdgeAnimation=function(t){this.graphModel.closeEdgeAnimation(t)},t.prototype.on=function(t,e){this.graphModel.eventCenter.on(t,e)},t.prototype.off=function(t,e){this.graphModel.eventCenter.off(t,e)},t.prototype.once=function(t,e){this.graphModel.eventCenter.once(t,e)},t.prototype.emit=function(t,e){this.graphModel.eventCenter.emit(t,e)},t.use=function(t,e){var n,o=t.pluginName;if(!o)throw new Error("请给插件指定 pluginName!");this.extensions.set(o,((n={})[gC]=gC,n.extension=t,n.props=e,n))},t.prototype.installPlugins=function(e){var n=this;void 0===e&&(e=[]);var o=Array.from(t.extensions,(function(t){return hC(t,2)[1]}));oh(fC(fC([],hC(this.plugins),!1),hC(o),!1),(function(t){var o,r;gC in t?(o=t.extension,r=t.props):o=t;var i=null==o?void 0:o.pluginName;-1===sf(e,i)&&n.installPlugin(o,r)}))},t.prototype.installPlugin=function(e,n){var o,r;if("pluginName"in e&&"install"in e){var i=e.pluginName,a=e.install,s=e.render;i&&(a&&a.call(e,this,t),s&&this.components.push(s.bind(e)),this.extension[i]=e)}else{var l=e,u=l.pluginName,c=new l({lf:this,LogicFlow:t,props:n,options:null!==(r=null===(o=this.options.pluginsOptions)||void 0===o?void 0:o[u])&&void 0!==r?r:{}});c.render&&this.components.push(c.render.bind(c)),this.extension[u]=c}},t.extensions=new Map,t}();function yC(t){return C.observer(t)}!function(t){t.toStringTag="LF.".concat(t.name)}(vC||(vC={}));var mC=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),bC=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new mC;function _C(){return bC.next()}var xC=function(t){function e(e,n){return e.id||(e.id="Event_".concat(_C())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),t.call(this,e,n)||this}return h(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var e=t.prototype.getConnectedTargetRules.call(this);return e.push({message:"起始节点不能作为边的终点",validate:function(){return!1}}),e},e.extendKey="StartEventModel",e}(Rx),EC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.extendKey="StartEventNode",e}(Lw),wC={type:"bpmn:startEvent",view:EC,model:xC},SC=function(t){function e(e,n){return e.id||(e.id="Event_".concat(_C())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),t.call(this,e,n)||this}return h(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var e=t.prototype.getConnectedSourceRules.call(this);return e.push({message:"结束节点不能作为边的起点",validate:function(){return!1}}),e},e.extendKey="EndEventModel",e}(Rx),CC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},e.prototype.getShape=function(){var e=this.props.model,n=e.getNodeStyle(),o=e,r=o.x,i=o.y,a=o.r;return uo("g",{},t.prototype.getShape.call(this),uo("circle",f(f({},n),{cx:r,cy:i,r:a-5})))},e.extendKey="EndEventView",e}(Lw),MC={type:"bpmn:endEvent",view:CC,model:SC},OC=function(t){function e(e,n){return e.id||(e.id="Flow_".concat(_C())),t.call(this,e,n)||this}return h(e,t),e.extendKey="SequenceFlowModel",e}(Cx),TC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.extendKey="SequenceFlowEdge",e}(xS),NC={type:"bpmn:sequenceFlow",view:TC,model:OC},AC=function(t){function e(e,n){var o=this;return e.id||(e.id="Gateway_".concat(_C())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),(o=t.call(this,e,n)||this).points=[[25,0],[50,25],[25,50],[0,25]],o}return h(e,t),e.extendKey="ExclusiveGatewayModel",e}(Kx),PC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t,n=e.x,o=e.y,r=e.width,i=e.height,a=e.points,s=t.getNodeStyle();return uo("g",{transform:"matrix(1 0 0 1 ".concat(n-r/2," ").concat(o-i/2,")")},uo("polygon",f(f({},s),{x:n,y:o,points:a})),uo("path",f({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},s)))},e.extendKey="ExclusiveGatewayNode",e}(Hw),DC={type:"bpmn:exclusiveGateway",view:PC,model:AC},kC=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(_C())),t.call(this,e,n)||this}return h(e,t),e.extendKey="ServiceTaskModel",e}(Jx),RC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getLabelShape=function(){var t=this.props.model,e=t.x,n=t.y;return uo("svg",{x:e-t.width/2+5,y:n-t.height/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},uo("path",{fill:t.getNodeStyle().stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.radius,a=t.getNodeStyle();return uo("g",{},[uo("rect",f({x:e-o/2,y:n-r/2,rx:i,ry:i,width:o,height:r},a)),this.getLabelShape()])},e.extendKey="ServiceTaskNode",e}(kw),IC={type:"bpmn:serviceTask",view:RC,model:kC},LC=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(_C())),t.call(this,e,n)||this}return h(e,t),e.extendKey="UserTaskModel",e}(Jx),jC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getLabelShape=function(){var t=this.props.model,e=t.x,n=t.y;return uo("svg",{x:e-t.width/2+5,y:n-t.height/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},uo("path",{fill:t.getNodeStyle().stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.radius,a=t.getNodeStyle();return uo("g",{},[uo("rect",f(f({},a),{x:e-o/2,y:n-r/2,rx:i,ry:i,width:o,height:r})),this.getLabelShape()])},e.extendKey="UserTaskNode",e}(kw),BC={type:"bpmn:userTask",view:jC,model:LC},HC={pluginName:"bpmnElement",install:function(t){t.setTheme(d),t.register(wC),t.register(MC),t.register(DC),t.register(BC),t.register(IC),t.options.customBpmnEdge||(t.register(NC),t.setDefaultEdgeType("bpmn:sequenceFlow"))}},zC=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),FC=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new zC;function WC(){return FC.next()}function GC(t){return Object.prototype.toString.call(t)}function XC(t){var e=t;return"[object Object]"===GC(t)?(e={},Object.keys(t).forEach((function(n){var o=n;"-"===n.charAt(0)&&(o=n.substring(1)),e[o]=XC(t[n])}))):Array.isArray(t)&&(e=[],t.forEach((function(t,n){e[n]=XC(t)}))),e}var UC="\t\n";function YC(t,e,n){var o=function(t){return" ".repeat(t)}(n),r="";if("#text"===e)return UC+o+t;if("#cdata-section"===e)return UC+o+"<![CDATA["+t+"]]>";if("#comment"===e)return UC+o+"\x3c!--"+t+"--\x3e";if("-"==="".concat(e).charAt(0))return" "+e.substring(1)+'="'+function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(XC(t)).replace(/"/g,"'")}return e}(t)+'"';if(Array.isArray(t))t.forEach((function(t){r+=YC(t,e,n+1)}));else if("[object Object]"===GC(t)){var i=Object.keys(t),a="",s="";r+=(0===n?"":UC+o)+"<"+e,i.forEach((function(e){"-"===e.charAt(0)?a+=YC(t[e],e,n+1):s+=YC(t[e],e,n+1)})),r+=a+(""!==s?">".concat(s).concat(UC+o,"</").concat(e,">"):" />")}else r+=UC+o+"<".concat(e,">").concat(t.toString(),"</").concat(e,">");return r}function VC(t){var e="";for(var n in t)e+=YC(t[n],n,0);return e}var KC=function(){};(KC.ObjTree=function(){return this}).VERSION="0.23",KC.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',KC.ObjTree.prototype.attr_prefix="-",KC.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},KC.ObjTree.prototype.parseHTTP=function(t,e,n){var o,r={};for(var i in e)r[i]=e[i];if(r.method||(void 0===r.postBody&&void 0===r.postbody&&void 0===r.parameters?r.method="get":r.method="post"),n){r.asynchronous=!0;var a=this,s=n,l=r.onComplete;r.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),s(e,t),l&&l(t)}}else r.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)r.uri=t,(u=new HTTP.Request(r))&&(o=u.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var u;(u=new Ajax.Request(t,r))&&(o=u.transport)}return n?o:o&&o.responseXML&&o.responseXML.documentElement?this.parseDOM(o.responseXML.documentElement):void 0},KC.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!=t.nodeType){var o={};o[t.nodeName]=n,n=o}return n}},KC.ObjTree.prototype.parseElement=function(t){if(7!=t.nodeType){if(3==t.nodeType||4==t.nodeType||8==t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var o=0;o<t.attributes.length;o++){if("string"==typeof(s=t.attributes[o].nodeName)){var r=t.attributes[o].nodeValue;try{r=JSON.parse(t.attributes[o].nodeValue.replace(/'/g,'"'))}catch(e){r=t.attributes[o].nodeValue}r&&(void 0===n[s=this.attr_prefix+s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],r))}}}if(t.childNodes&&t.childNodes.length){var i=!0;e&&(i=!1);for(o=0;o<t.childNodes.length&&i;o++){var a=t.childNodes[o].nodeType;3!=a&&4!=a&&8!=a&&(i=!1)}if(i){e||(e="");for(o=0;o<t.childNodes.length;o++)e+=t.childNodes[o].nodeValue}else{e||(e={});for(o=0;o<t.childNodes.length;o++){var s;if("string"==typeof(s=t.childNodes[o].nodeName))(r=this.parseElement(t.childNodes[o]))&&(void 0===n[s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],r))}}}else null===e&&(e={});return e}},KC.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(1==n&&(t[e]=[]),t[e][t[e].length]=o):1==n?t[e]=o:2==n?t[e]=[t[e],o]:t[e][t[e].length]=o},KC.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},KC.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];r.charAt(0)!=this.attr_prefix?void 0===i||null==i?n[n.length]="<"+r+" />":"object"==typeof i&&i.constructor==Array?n[n.length]=this.array_to_xml(r,i):n[n.length]="object"==typeof i?this.hash_to_xml(r,i):this.scalar_to_xml(r,i):o[o.length]=" "+r.substring(1)+'="'+this.xml_escape(i)+'"'}var a=o.join(""),s=n.join("");return void 0===t||null==t||(s=n.length>0?s.match(/\n/)?"<"+t+a+">\n"+s+"</"+t+">\n":"<"+t+a+">"+s+"</"+t+">\n":"<"+t+a+" />\n"),s},KC.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o<e.length;o++){var r=e[o];void 0===r||null==r?n[n.length]="<"+t+" />":"object"==typeof r&&r.constructor==Array?n[n.length]=this.array_to_xml(t,r):n[n.length]="object"==typeof r?this.hash_to_xml(t,r):this.scalar_to_xml(t,r)}return n.join("")},KC.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"==t?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+">\n"},KC.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var qC,ZC=function(t){return(new KC.ObjTree).parseXML(t)};!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"}(qC||(qC={}));var $C=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],JC=["properties","startPoint","endPoint","pointsList"];function QC(t){var e=t?JC.concat(t):JC;return function(t){return function t(n){var o={};return"string"==typeof n?n:Array.isArray(n)?n.map((function(e){return t(e)})):(Object.entries(n).forEach((function(n){var r=_(n,2),i=r[0],a=r[1];"object"!=typeof a?0===i.indexOf("-")||["#text","#cdata-section","#comment"].includes(i)?o[i]=a:o["-".concat(i)]=a:e.includes(i)?o["-".concat(i)]=t(a):o[i]=t(a)})),o)}(t)}}function tM(t){var e={};return Object.entries(t).forEach((function(t){var n=_(t,2),o=n[0],r=n[1];0===o.indexOf("-")?e[o.substring(1)]=XC(r):"string"==typeof r?e[o]=r:"[object Object]"===Object.prototype.toString.call(r)?e[o]=tM(r):Array.isArray(r)?e[o]=r.map((function(t){return tM(t)})):e[o]=r})),e}function eM(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,o=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),r={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":o};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(r["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),r})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,o=100,r=80,i=t.x,a=t.y,s=iM.shapeConfigMap.get(t.type);s&&(o=s.width,r=s.height),i-=o/2,a-=r/2;var l={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":i,"-y":a,"-width":o,"-height":r}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(l["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),l}))}function nM(t){var e=[],n=[],o=t["bpmn:definitions"];if(o){var r=o["bpmn:process"];Object.keys(r).forEach((function(t){if(0===t.indexOf("bpmn:")){var i=r[t];if(t===qC.FLOW){var a=o["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];n=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var o;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(rM(o,t))}));else{var o=void 0;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(rM(o,t))}return n}(i,a)}else{var s=o["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];e=e.concat(function(t,e,n){var o=[];if(Array.isArray(t))t.forEach((function(t){var r=oM(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(r)}));else{var r=oM(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(r)}return o}(i,s,t))}}}))}return{nodes:e,edges:n}}function oM(t,e,n){var o,r,i=Number(t["dc:Bounds"]["-x"]),a=Number(t["dc:Bounds"]["-y"]),s=n["-name"],l=iM.shapeConfigMap.get(e);if(l&&(i+=l.width/2,a+=l.height/2),Object.entries(n).forEach((function(t){var e=_(t,2),n=e[0],r=e[1];-1===$C.indexOf(n)&&(o||(o={}),o[n]=r)})),o&&(o=tM(o)),s&&(r={x:i,y:a,value:s},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var u=t["bpmndi:BPMNLabel"]["dc:Bounds"];r.x=Number(u["-x"])+Number(u["-width"])/2,r.y=Number(u["-y"])+Number(u["-height"])/2}var c={id:t["-bpmnElement"],type:e,x:i,y:a,properties:o};return r&&(c.text=r),c}function rM(t,e){var n,o,r=e["-name"];if(r){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],a=0;r.split("\n").forEach((function(t){a<t.length&&(a=t.length)})),n={value:r,x:Number(i["-x"])+10*a/2,y:Number(i["-y"])+7}}Object.entries(e).forEach((function(t){var e=_(t,2),n=e[0],r=e[1];-1===$C.indexOf(n)&&(o||(o={}),o[n]=r)})),o&&(o=tM(o));var s={id:e["-id"],type:qC.FLOW,pointsList:t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:o};return n&&(s.text=n),s}var iM=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var o=f({},n.processAttributes);!function(t,e,n){var o=new Map;e.nodes.forEach((function(e){var r,i={"-id":e.id};if((null===(r=e.text)||void 0===r?void 0:r.value)&&(i["-name"]=e.text.value),e.properties){var a=QC(n)(e.properties);Object.assign(i,a)}o.set(e.id,i),t[e.type]?Array.isArray(t[e.type])?t[e.type].push(i):t[e.type]=[t[e.type],i]:t[e.type]=i}));var r=e.edges.map((function(t){var e,r,i=o.get(t.targetNodeId);i["bpmn:incoming"]?Array.isArray(i["bpmn:incoming"])?i["bpmn:incoming"].push(t.id):i["bpmn:incoming"]=[i["bpmn:incoming"],t.id]:i["bpmn:incoming"]=t.id;var a={"-id":t.id,"-sourceRef":t.sourceNodeId,"-targetRef":t.targetNodeId};if((null===(e=t.text)||void 0===e?void 0:e.value)&&(a["-name"]=null===(r=t.text)||void 0===r?void 0:r.value),t.properties){var s=QC(n)(t.properties);Object.assign(a,s)}return a}));e.edges.forEach((function(t){var e=o.get(t.sourceNodeId);e["bpmn:outgoing"]?Array.isArray(e["bpmn:outgoing"])?e["bpmn:outgoing"].push(t.id):e["bpmn:outgoing"]=[e["bpmn:outgoing"],t.id]:e["bpmn:outgoing"]=t.id})),t[qC.FLOW]=r}(o,t,e);var r={"-id":"BPMNPlane_1","-bpmnElement":o["-id"]};eM(r,t);var i=n.definitionAttributes;return i["bpmn:process"]=o,i["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":r},{"bpmn:definitions":i}},this.adapterIn=function(t){if(t)return nM(t)},e.adapterIn=function(t){return n.adapterIn(t)},e.adapterOut=function(t,e){return n.adapterOut(t,e)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(WC())},this.definitionAttributes={"-id":"Definitions_".concat(WC()),"-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();iM.shapeConfigMap.set(qC.START,{width:e,height:n}),iM.shapeConfigMap.set(qC.END,{width:o,height:r}),iM.shapeConfigMap.set(qC.GATEWAY,{width:i,height:a}),iM.shapeConfigMap.set(qC.SYSTEM,{width:s,height:l}),iM.shapeConfigMap.set(qC.USER,{width:u,height:c});var aM=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e=ZC(t);return n.adapterIn(e)},n.adapterXmlOut=function(t,e){return VC(n.adapterOut(t,e))};var o=e.lf;return o.adapterIn=n.adapterXmlIn,o.adapterOut=n.adapterXmlOut,n}return h(e,t),e.pluginName="bpmnXmlAdapter",e}(iM);function sM(){this.targetRules.push({message:"分组外的节点不允许连接分组内的",validate:function(t,e){var n=!!t.properties.parent,o=!!e.properties.parent;return!(!n&&o)}})}var lM=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var t="xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}));return t},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),uM=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new lM;function cM(){return uM.next()}var dM=Object.freeze({__proto__:null,genBpmnId:cM,groupRule:sM});function pM(t){var e=_(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var n,o=this.props.model,r=o.getNodeStyle(),i=o,a=i.x,s=i.y,l=i.r,u=i.width,c=i.height,d=i.properties,p=t.prototype.getShape.call(this),h=d.definitionType,g=((null===(n=e.endEvent)||void 0===n?void 0:n.get(h))||{}).icon,v=Array.isArray(g)?uo.apply(void 0,x(["g",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")")}],_(g),!1)):uo("path",{transform:"matrix(1 0 0 1 ".concat(a-u/2," ").concat(s-c/2,")"),d:g,style:"fill: black; stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;"});return uo("g",{},p,uo("circle",f(f({},r),{strokeWidth:2,cx:a,cy:s,r:l-2})),v)},n}(Lw),o=function(t){function n(n,o){var r,i,a,s;n.id||(n.id="Event_".concat(cM())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var l=((null===(i=e.endEvent)||void 0===i?void 0:i.get(null===(a=n.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return n.properties=f(f({},u),n.properties),(null===(s=n.properties)||void 0===s?void 0:s.definitionType)&&(n.properties.definitionId="Definition_".concat(cM())),r=t.call(this,n,o)||this,sM.call(r),r}return h(n,t),n.prototype.setAttributes=function(){this.r=18},n.prototype.getConnectedSourceRules=function(){var e=this,n=t.prototype.getConnectedSourceRules.call(this),o={message:"结束节点不能作为边的起点",validate:function(t,n){return console.log("_target",n),t!==e}};return n.push(o),n},n}(Rx);return{type:"bpmn:endEvent",view:n,model:o}}function hM(t){var e=_(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var t,n=this.props.model,o=n.getNodeStyle(),r=n,i=r.x,a=r.y,s=r.r,l=r.width,u=r.height,c=r.properties.definitionType,d=((null===(t=e.intermediateCatchEvent)||void 0===t?void 0:t.get(c))||{}).icon,p=Array.isArray(d)?uo.apply(void 0,x(["g",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")")}],_(d),!1)):uo("path",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")"),d:d});return uo("g",{},uo("circle",f(f({},o),{cx:i,cy:a,r:s,strokeWidth:1.5})),uo("circle",f(f({},o),{cx:i,cy:a,r:s-3,strokeWidth:1.5})),p)},n}(Lw),o=function(t){function n(n,o){var r,i,a,s;n.id||(n.id="Event_".concat(cM())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var l=((null===(i=e.intermediateCatchEvent)||void 0===i?void 0:i.get(null===(a=n.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return n.properties=f(f({},u),n.properties),(null===(s=n.properties)||void 0===s?void 0:s.definitionType)&&(n.properties.definitionId="Definition_".concat(cM())),r=t.call(this,n,o)||this,sM.call(r),r}return h(n,t),n.prototype.setAttributes=function(){this.r=18},n}(Rx);return{type:"bpmn:intermediateCatchEvent",view:n,model:o}}function fM(t){var e=_(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var t,n=this.props.model,o=n.getNodeStyle(),r=n,i=r.x,a=r.y,s=r.r,l=r.width,u=r.height,c=r.properties,d=c.definitionType,p=c.isInterrupting,h=((null===(t=e.startEvent)||void 0===t?void 0:t.get(d))||{}).icon,g=Array.isArray(h)?uo.apply(void 0,x(["g",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")")}],_(h),!1)):uo("path",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")"),d:h,style:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"});return uo("g",{},uo("circle",f(f({},o),{cx:i,cy:a,r:s,strokeDasharray:p?"5,5":"",strokeWidth:2})),g)},n}(Lw),o=function(t){function n(n,o){var r,i,a;n.id||(n.id="Event_".concat(cM())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var s=((null===(r=e.startEvent)||void 0===r?void 0:r.get(null===(i=n.properties)||void 0===i?void 0:i.definitionType))||{}).properties,l=void 0===s?{}:s;return n.properties=f(f({},l),n.properties),(null===(a=n.properties)||void 0===a?void 0:a.definitionType)&&(n.properties.definitionId="Definition_".concat(cM())),t.call(this,n,o)||this}return h(n,t),n.prototype.setAttributes=function(){this.r=18},n.prototype.getConnectedTargetRules=function(){var e=this,n=t.prototype.getConnectedTargetRules.call(this),o={message:"起始节点不能作为边的终点",validate:function(t,n){return n!==e}};return n.push(o),n},n}(Rx);return{type:"bpmn:startEvent",view:n,model:o}}function gM(t){var e=_(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var t,n=this.props.model,o=n.getNodeStyle(),r=n,i=r.x,a=r.y,s=r.r,l=r.width,u=r.height,c=r.properties,d=c.definitionType,p=c.cancelActivity,h=((null===(t=e.boundaryEvent)||void 0===t?void 0:t.get(d))||{}).icon,g=Array.isArray(h)?uo.apply(void 0,x(["g",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")")}],_(h),!1)):uo("path",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")"),d:h});return uo("g",{},uo("circle",f(f({},o),{cx:i,cy:a,r:s,strokeDasharray:p?"":"5,5",strokeWidth:1.5})),uo("circle",f(f({},o),{cx:i,cy:a,r:s-3,strokeDasharray:p?"":"5,5",strokeWidth:1.5})),g)},n}(Lw),o=function(t){function n(n,o){var r,i,a,s;n.id||(n.id="Event_".concat(cM())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var l=((null===(i=e.boundaryEvent)||void 0===i?void 0:i.get(null===(a=n.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return n.properties=f(f({attachedToRef:"",cancelActivity:!0},u),n.properties),(null===(s=n.properties)||void 0===s?void 0:s.definitionType)&&(n.properties.definitionId="Definition_".concat(cM())),r=t.call(this,n,o)||this,sM.call(r),r}return h(n,t),n.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.r=20,this.autoToFront=!1,this.zIndex=99999},n.prototype.setAttributes=function(){this.r=18},n}(Rx);return{type:"bpmn:boundaryEvent",view:n,model:o}}function vM(t){var e=_(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var t,n=this.props.model,o=n.getNodeStyle(),r=n,i=r.x,a=r.y,s=r.r,l=r.width,u=r.height,c=r.properties.definitionType,d=((null===(t=e.intermediateThrowEvent)||void 0===t?void 0:t.get(c))||{}).icon,p=Array.isArray(d)?uo.apply(void 0,x(["g",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")")}],_(d),!1)):uo("path",{transform:"matrix(1 0 0 1 ".concat(i-l/2," ").concat(a-u/2,")"),d:d,style:"fill: black"});return uo("g",{},uo("circle",f(f({},o),{cx:i,cy:a,r:s,strokeWidth:1.5})),uo("circle",f(f({},o),{cx:i,cy:a,r:s-3,strokeWidth:1.5})),p)},n}(Lw),o=function(t){function n(n,o){var r,i,a,s;n.id||(n.id="Event_".concat(cM())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var l=((null===(i=e.intermediateThrowEvent)||void 0===i?void 0:i.get(null===(a=n.properties)||void 0===a?void 0:a.definitionType))||{}).properties,u=void 0===l?{}:l;return n.properties=f(f({},u),n.properties),(null===(s=n.properties)||void 0===s?void 0:s.definitionType)&&(n.properties.definitionId="Definition_".concat(cM())),r=t.call(this,n,o)||this,sM.call(r),r}return h(n,t),n.prototype.setAttributes=function(){this.r=18},n}(Rx);return{type:"bpmn:intermediateThrowEvent",view:n,model:o}}var yM=[uo("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),uo("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),uo("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"})],mM=[uo("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"})],bM="m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z",_M="m 23,10 0,12.5 -12.5,0 0,5 12.5,0 0,12.5 5,0 0,-12.5 12.5,0 0,-5 -12.5,0 0,-12.5 -5,0 z",xM=uo("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"}),EM="M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z",wM="M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z",SM="m44,60 m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",CM="m47,61 m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",MM="m 50,73 c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",OM=Object.freeze({__proto__:null,compensationIcon:"m 7.92,18 9,-6.5 0,13 z m 9.3,-0.4 8.7,-6.1 0,13 -8.7,-6.1 z",conditionalIcon:"M 10.5,8.5 l 14.5,0 l 0,18 l -14.5,0 Z M 12.5,11.5 l 10.5,0 M 12.5,14.5 l 10.5,0 M 12.5,17.5 l 10.5,0 M 12.5,20.5 l 10.5,0 M 12.5,23.5 l 10.5,0 M 12.5,26.5 l 10.5,0 ",errorIcon:"m 7.2,25.991999999999997 0.09350000000000001,-0.025300000000000003 7.3392,-9.610700000000001 7.667000000000001,8.9661 4.7003,-18.2204 -5.8707,11.6501 -7.299600000000001,-9.585400000000002 z",escalationIcon:"M 18,7.2 l 8,20 l -8,-7 l -8,7 Z",exclusiveIcon:bM,inclusiveIcon:xM,linkIcon:"m 20.52,9.468 0,4.4375 -13.5,0 0,6.75 13.5,0 0,4.4375 9.84375,-7.8125 -9.84375,-7.8125 z",loopMarker:MM,manualTaskIcon:"M0.5,3.751L4.583,0.5009999999999999C4.583,0.5009999999999999,15.749,0.5839999999999999,16.666,0.5839999999999999S14.249,3.5009999999999994,15.166,3.5009999999999994S26.833,3.5009999999999994,27.75,3.5009999999999994C28.916,5.209,27.582,6.667999999999999,26.916,7.167999999999999S27.791,9.084999999999999,25.916,11.584999999999999C25.166,11.834999999999999,26.666,13.459999999999999,24.583000000000002,14.918C23.416,15.501,25.166,16.46,23.333000000000002,17.750999999999998C22.166,17.750999999999998,2.5000000000000036,17.833999999999996,2.5000000000000036,17.833999999999996L0.5000000000000036,16.500999999999998V3.751ZM13.5,7L27,7M13.5,11L26,11M14,14.5L25,14.5M8.2,3.1L15,3.1",messageIcon:"m 8.459999999999999,11.34 l 0,12.6 l 18.900000000000002,0 l 0,-12.6 z l 9.450000000000001,5.4 l 9.450000000000001,-5.4",parallelIcon:_M,parallelMarker:SM,scriptTaskIcon:"M6.402,0.5H20.902C20.902,0.5,15.069,3.333,15.069,6.083S19.486,12.083,19.486,15.25S15.319,20.333,15.319,20.333H0.235C0.235,20.333,5.235,17.665999999999997,5.235,15.332999999999998S0.6520000000000001,8.582999999999998,0.6520000000000001,6.082999999999998S6.402,0.5,6.402,0.5ZM3.5,4.5L13.5,4.5M3.8,8.5L13.8,8.5M6.3,12.5L16.3,12.5M6.5,16.5L16.5,16.5",sequentialMarker:CM,serviceTaskIcon:EM,signalIcon:"M 18,7.2 l 9,16.2 l -18,0 Z",style:{throw:"fill: rgb(34, 36, 42); stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;",catch:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;",nonIntermediate:"stroke-width: 1.5; stroke-dash-array: 6",intermediate:"stroke-width: 1.5"},terminateIcon:mM,timerIcon:yM,userTaskIcon:wM});function TM(t,e,n){var o=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getShape=function(){var t=this.props.model,n=t,o=n.x,r=n.y,i=n.width,a=n.height,s=n.points,l=t.getNodeStyle();return uo("g",{transform:"matrix(1 0 0 1 ".concat(o-i/2," ").concat(r-a/2,")")},uo(H_,f(f({},l),{x:o,y:r,points:s})),"string"==typeof e?uo("path",f(f({d:e},l),{fill:"rgb(34, 36, 42)",strokeWidth:1})):e)},n}(Hw);return{type:t,view:o,model:function(t){function e(e,o){var r=this;return e.id||(e.id="Gateway_".concat(cM())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),e.properties=f(f({},n||{}),e.properties),(r=t.call(this,e,o)||this).points=[[25,0],[50,25],[25,50],[0,25]],sM.call(r),r}return h(e,t),e}(Kx)}}var NM={parallel:SM,sequential:CM,loop:MM};function AM(t,e,n){var o=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,o=t.y,r=t.width,i=t.height,a=t.getNodeStyle(),s=Array.isArray(e)?uo.apply(void 0,x(["g",{transform:"matrix(1 0 0 1 ".concat(n-r/2," ").concat(o-i/2,")")}],_(e),!1)):uo("path",{fill:a.stroke,d:e});return uo("svg",{x:n-r/2+5,y:o-i/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},s)},n.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.radius,a=t.properties,s=t.getNodeStyle();return uo("g",{},[uo("rect",f(f({},s),{x:e-o/2,y:n-r/2,rx:i,ry:i,width:o,height:r,opacity:.95})),this.getLabelShape(),uo("g",{transform:"matrix(1 0 0 1 ".concat(e-o/2," ").concat(n-r/2,")")},uo("path",{fill:"white",strokeLinecap:"round",strokeLinejoin:"round",stroke:"rgb(34, 36, 42)",strokeWidth:"2",d:NM[a.multiInstanceType]||""}))])},n}(kw),r=function(t){function e(e,o){var r,i=this;e.id||(e.id="Activity_".concat(cM()));var a=f(f({},n||{}),e.properties);return e.properties=a,i=t.call(this,e,o)||this,null===(r=null==a?void 0:a.boundaryEvents)||void 0===r||r.forEach((function(t){i.addBoundaryEvent(t)})),i.deleteProperty("boundaryEvents"),sM.call(i),i}return h(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",!e.hover&&(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(Jx);return{type:t,view:o,model:r}}var PM=Dm,DM=function(t){function e(e){var n=t.call(this)||this;return n.updatePosition=function(t){var e=t.deltaX,o=t.deltaY,r=n.nodeModel,i=r.x,a=r.y;n.nodeModel.x=i+e/2,n.nodeModel.y=a+o/2,n.nodeModel.moveText(e/2,o/2)},n.getResize=function(t){var e=t.index,n=t.deltaX,o=t.deltaY,r=t.width,i=t.height,a=t.PCTResizeInfo,s=t.pct,l=void 0===s?1:s,u=t.freezeWidth,c=void 0!==u&&u,d=t.freezeHeight,p=void 0!==d&&d,h={width:r,height:i,deltaX:n,deltaY:o};if(a){var f=0,g=0;switch(e){case 0:g=(-1*n-o)/4;break;case 1:g=(n-o)/4;break;case 2:g=(n+o)/4;break;case 3:g=(-1*n+o)/4}0!==g&&(f=Math.round(g/a.ResizeBasis.basisHeight*1e5)/1e3),a.ResizePCT.widthPCT=Math.max(Math.min(a.ResizePCT.widthPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit),a.ResizePCT.heightPCT=Math.max(Math.min(a.ResizePCT.heightPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit);var v=Math.round(a.ResizePCT.widthPCT*a.ResizeBasis.basisWidth/100),y=Math.round(a.ResizePCT.heightPCT*a.ResizeBasis.basisHeight/100);switch(e){case 0:n=r-v,o=i-y;break;case 1:n=v-r,o=i-y;break;case 2:n=v-r,o=y-i;break;case 3:n=r-v,o=y-i}return h.width=v,h.height=y,h.deltaX=n/l,h.deltaY=o/l,h}switch(e){case 0:h.width=c?r:r-n*l,h.height=p?i:i-o*l;break;case 1:h.width=c?r:r+n*l,h.height=p?i:i-o*l;break;case 2:h.width=c?r:r+n*l,h.height=p?i:i+o*l;break;case 3:h.width=c?r:r-n*l,h.height=p?i:i+o*l}return h},n.updateEdgePointByAnchors=function(){var t=n.nodeModel,e=t.id,o=t.anchors,r=n.getNodeEdges(e);r.sourceEdges.forEach((function(t){var e=o.find((function(e){return e.id===t.sourceAnchorId}));e&&t.updateStartPoint({x:e.x,y:e.y})})),r.targetEdges.forEach((function(t){var e=o.find((function(e){return e.id===t.targetAnchorId}));e&&t.updateEndPoint({x:e.x,y:e.y})}))},n.updateRect=function(t){var e=t.deltaX,o=t.deltaY,r=n.nodeModel,i=r.x,a=r.y,s=r.width,l=r.height,u=r.radius,c=r.PCTResizeInfo,d=n.nodeModel,p=d.minWidth,h=d.minHeight,f=d.maxWidth,g=d.maxHeight,v=n.index,y=p===f,m=h===g,b=n.getResize({index:v,deltaX:e,deltaY:o,width:s,height:l,PCTResizeInfo:c,pct:1,freezeWidth:y,freezeHeight:m});if(b.width<p||b.width>f||b.height<h||b.height>g)n.dragHandler.cancelDrag();else{n.updatePosition({deltaX:y?0:b.deltaX,deltaY:m?0:b.deltaY}),n.nodeModel.width=b.width,n.nodeModel.height=b.height,n.nodeModel.setProperties({nodeSize:{width:b.width,height:b.height}});var _={x:i,y:a,width:s,height:l,radius:u},x={x:n.nodeModel.x,y:n.nodeModel.y,width:n.nodeModel.width,height:n.nodeModel.height,radius:u};n.updateEdgePointByAnchors(),n.eventEmit({deltaX:e,deltaY:o,beforeNode:_,afterNode:x})}},n.updateEllipse=function(t){var e=t.deltaX,o=t.deltaY,r=n.nodeModel,i=r.rx,a=r.ry,s=r.x,l=r.y,u=r.PCTResizeInfo,c=n.index,d=n.nodeModel,p=d.minWidth,h=d.minHeight,g=d.maxWidth,v=d.maxHeight,y=p===g,m=h===v,b=i,_=a,x=n.getResize({index:c,deltaX:e,deltaY:o,width:b,height:_,PCTResizeInfo:u,pct:.5,freezeWidth:y,freezeHeight:m});if(x.width<p/2||x.width>g/2||x.height<h/2||x.height>v/2)n.dragHandler.cancelDrag();else{n.updatePosition({deltaX:y?0:x.deltaX,deltaY:m?0:x.deltaY}),n.nodeModel.rx=x.width,n.nodeModel.ry=x.height,n.nodeModel.setProperties({nodeSize:{rx:x.width,ry:x.height}});var E={x:s,y:l},w={rx:x.width,ry:x.height,x:n.nodeModel.x,y:n.nodeModel.y};n.updateEdgePointByAnchors(),n.eventEmit({deltaX:e,deltaY:o,beforeNode:f(f({},E),{rx:i,ry:a}),afterNode:w})}},n.updateDiamond=function(t){var e=t.deltaX,o=t.deltaY,r=n.nodeModel,i=r.rx,a=r.ry,s=r.x,l=r.y,u=r.PCTResizeInfo,c=n.index,d=n.nodeModel,p=d.minWidth,h=d.minHeight,f=d.maxWidth,g=d.maxHeight,v=p===f,y=h===g,m=i,b=a,_=n.getResize({index:c,deltaX:e,deltaY:o,width:m,height:b,PCTResizeInfo:u,pct:.5,freezeWidth:v,freezeHeight:y});if(_.width<p/2||_.width>f/2||_.height<h/2||_.height>g/2)n.dragHandler.cancelDrag();else{n.updatePosition({deltaX:v?0:_.deltaX,deltaY:y?0:_.deltaY}),n.nodeModel.rx=_.width,n.nodeModel.ry=_.height,n.nodeModel.setProperties({nodeSize:{rx:_.width,ry:_.height}});var x={x:s,y:l,rx:i,ry:a},E={rx:_.width,ry:_.height,x:n.nodeModel.x,y:n.nodeModel.y};n.updateEdgePointByAnchors(),n.eventEmit({deltaX:e,deltaY:o,beforeNode:x,afterNode:E})}},n.eventEmit=function(t){var e=t.deltaX,o=t.deltaY,r=t.beforeNode,i=t.afterNode,a=n.nodeModel,s=a.id,l=a.modelType,u=a.type,c=f({id:s,modelType:l,type:u},r),d=f({id:s,modelType:l,type:u},i);n.graphModel.eventCenter.emit("node:resize",{preData:c,data:d,deltaX:e,deltaY:o,index:n.index,model:n.nodeModel})},n.onDragging=function(t){var e,o=t.deltaX,r=t.deltaY,i=n.graphModel.transformModel,a=n.nodeModel.modelType;o=(e=_(i.fixDeltaXY(o,r),2))[0],r=e[1],a===Mm.RECT_NODE||a===Mm.HTML_NODE?n.updateRect({deltaX:o,deltaY:r}):a===Mm.ELLIPSE_NODE?n.updateEllipse({deltaX:o,deltaY:r}):a===Mm.DIAMOND_NODE&&n.updateDiamond({deltaX:o,deltaY:r})},n.onDragEnd=function(){var t=n.graphModel.gridSize,e=void 0===t?1:t,o=e*Math.round(n.nodeModel.x/e),r=e*Math.round(n.nodeModel.y/e);n.nodeModel.moveTo(o,r),n.updateEdgePointByAnchors()},n.index=e.index,n.nodeModel=e.model,n.graphModel=e.graphModel,n.dragHandler=new PM({onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:1}),n}return h(e,t),e.prototype.getNodeEdges=function(t){for(var e=this.graphModel.edges,n=[],o=[],r=0;r<e.length;r++){var i=e[r];i.sourceNodeId===t?n.push(i):e[r].targetNodeId===t&&o.push(i)}return{sourceEdges:n,targetEdges:o}},e.prototype.render=function(){var t=this.props,e=t.x,n=t.y,o=t.index,r=t.model.getControlPointStyle();return xr("g",{className:"lf-resize-control-".concat(o),children:xr(O_,f({className:"lf-node-control",x:e,y:n},r,{onMouseDown:this.dragHandler.handleMouseDown}))})},e}(ho),kM=function(t){function e(){var e=t.call(this)||this;return e.state={},e}return h(e,t),e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,o=e.x,r=e.y,i=e.width,a=e.height,s={minX:o-i/2,minY:r-a/2,maxX:o+i/2,maxY:r+a/2},l=s.minX,u=s.minY,c=s.maxX,d=s.maxY;return[{x:l,y:u},{x:c,y:u},{x:c,y:d},{x:l,y:d}].map((function(t,o){return xr(DM,f({index:o},t,{model:e,graphModel:n}))}))},e.prototype.getGroupSolid=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.getResizeOutlineStyle();return xr(O_,f({},i,{x:e,y:n,width:o,height:r}))},e.prototype.render=function(){return xr("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},e}(ho),RM=function(t){function e(e,n){var o=t.call(this,e,n)||this,r=e.properties.nodeSize;return r&&(o.rx=r.rx,o.ry=r.ry),o}return h(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(Gx),IM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return xr(kM,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel.isSilentMode;return xr("g",{children:[this.getResizeShape(),e.isSelected&&!n?this.getControlGroup():""]})},e}(Uw),LM={type:"ellipse",view:IM,model:RM},jM=function(t){function e(e,n){var o=t.call(this,e,n)||this,r=e.properties.nodeSize;return r&&(o.rx=r.rx,o.ry=r.ry),o}return h(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(Hx),BM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return xr(kM,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){var t=this.props.model,e=t.points,n=t.getNodeStyle();return xr("g",{children:xr(H_,f({},n,{points:e}))})},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return xr("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(Ww),HM={type:"diamond",view:BM,model:jM},zM=function(t){function e(e,n){var o=t.call(this,e,n)||this,r=e.properties.nodeSize;return r&&(o.width=r.width,o.height=r.height),o}return h(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(aE),FM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return xr(kM,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return xr("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(Qw),WM={type:"html",view:FM,model:zM},GM=function(t){function e(e,n){var o=t.call(this,e,n)||this,r=e.properties.nodeSize;return r&&(o.width=r.width,o.height=r.height),o}return h(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(Jx),XM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return xr(kM,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return xr("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(kw),UM={type:"rect",view:XM,model:GM},YM={pluginName:"nodeResize",step:0,install:function(t){t.register(LM),t.register(HM),t.register(WM),t.register(UM)}},VM=function(t){function e(){var e=t.apply(this,x([],_(arguments),!1))||this;return e.isGroup=!0,e.isFolded=!1,e.unfoldedWidth=500,e.unfoldedHeight=300,e.childrenLastFoldStatus={},e}return h(e,t),e.prototype.initNodeData=function(e){var n=this;t.prototype.initNodeData.call(this,e);var o=[];Fr(e.children)&&(o=e.children),this.children=new Set(o),this.width=500,this.height=300,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=-1e4,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,void 0===this.properties.isFolded&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout((function(){n.isFolded&&n.foldGroup(n.isFolded)}))},e.prototype.getResizeOutlineStyle=function(){var e=t.prototype.getResizeOutlineStyle.call(this);return e.stroke="none",e},e.prototype.foldGroup=function(t){var e=this;if(t!==this.isFolded){this.setProperty("isFolded",t),this.isFolded=t,t?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var n=x(x([],_(this.incoming.edges),!1),_(this.outgoing.edges),!1);this.children.forEach((function(o){var r=e.graphModel.getElement(o);if(r){var i=r.isFolded;if(r.isGroup&&!r.isFolded&&r.foldGroup(t),r.isGroup&&!t){var a=e.childrenLastFoldStatus[o];void 0!==a&&a!==r.isFolded&&r.foldGroup(a)}e.childrenLastFoldStatus[o]=!!i,r.visible=!t;var s=r.incoming.edges,l=r.outgoing.edges;n=x(x(x([],_(n),!1),_(s),!1),_(l),!1)}})),this.foldEdge(t,n)}},e.prototype.getAnchorStyle=function(e){var n=t.prototype.getAnchorStyle.call(this,e);return n.stroke="transparent",n.fill="transparent",n.hover.fill="transparent",n.hover.stroke="transparent",n},e.prototype.foldEdge=function(t,e){var n=this;e.forEach((function(e,o){var r=e.id,i=e.sourceNodeId,a=e.targetNodeId,s=e.startPoint,l=e.endPoint,u=e.type,c=e.text,d=e.getProperties(),p={id:"".concat(r,"__").concat(o),sourceNodeId:i,targetNodeId:a,startPoint:s,endPoint:l,type:u,properties:d,text:null==c?void 0:c.value};e.virtual&&n.graphModel.deleteEdgeById(e.id);var h=n.graphModel.group.getNodeGroup(a);h||(h=n.graphModel.getNodeModelById(a));var f=n.graphModel.group.getNodeGroup(i);f||(f=n.graphModel.getNodeModelById(i)),t&&!1!==e.visible&&(n.children.has(i)||n.id===i?(p.startPoint=void 0,p.sourceNodeId=n.id):(p.endPoint=void 0,p.targetNodeId=n.id),h.id===n.id&&f.id===n.id||n.createVirtualEdge(p),e.visible=!1),t||!1!==e.visible||(h&&h.isGroup&&h.isFolded?(p.targetNodeId=h.id,p.endPoint=void 0,n.createVirtualEdge(p)):f&&f.isGroup&&f.isFolded?(p.sourceNodeId=f.id,p.startPoint=void 0,n.createVirtualEdge(p)):e.visible=!0)}))},e.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var e=this.graphModel.addEdge(t);e.virtual=!0,e.text.editable=!1,e.isFoldedEdge=!0},e.prototype.isInRange=function(t){var e=t.minX,n=t.minY,o=t.maxX,r=t.maxY;return e>=this.x-this.width/2&&o<=this.x+this.width/2&&n>=this.y-this.height/2&&r<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(t){var e=t.x1,n=t.y1,o=t.x2,r=t.y2;return{x:e>=this.x-this.width/2&&o<=this.x+this.width/2,y:n>=this.y-this.height/2&&r<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(t){this.setProperty("groupAddable",t)},e.prototype.addChild=function(t){this.children.add(t),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(t){this.children.delete(t),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var e=this,n=t.prototype.getData.call(this);n.children=[],console.log("this.children",this.children),this.children.forEach((function(t){var o=e.graphModel.getNodeModelById(t);o&&!o.virtual&&n.children.push(t)}));var o=n.properties;return null==o||delete o.groupAddable,null==o||delete o.isFolded,n},e.prototype.getHistoryData=function(){var e=t.prototype.getData.call(this);e.children=x([],_(this.children),!1),e.isGroup=!0;var n=e.properties;return null==n||delete n.groupAddable,(null==n?void 0:n.isFolded)&&(e.x=e.x+this.unfoldedWidth/2-this.foldedWidth/2,e.y=e.y+this.unfoldedHeight/2-this.foldedHeight/2),e},e.prototype.isAllowAppendIn=function(t){return console.info("_nodeData",t),!0},e.prototype.toBack=function(){this.zIndex--},e}(GM),KM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var e=this.props.model,n=e.resizable,o=e.properties;return n&&!o.isFolded?t.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var t=this.props.model,e=t.width,n=t.height,o=t.x,r=t.y,i=t.radius,a=t.properties,s=t.getAddableOutlineStyle;if(!a.groupAddable)return null;var l=this.props.model.getNodeStyle().strokeWidth,u=void 0===l?0:l,c=s(),d=e+u+8,p=n+u+8;return uo("rect",f(f({},c),{width:d,height:p,x:o-d/2,y:r-p/2,rx:i,ry:i}))},e.prototype.getFoldIcon=function(){var t=this.props.model,e=t.x-t.width/2+5,n=t.y-t.height/2+5;if(!t.foldable)return null;var o=uo("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:t.properties.isFolded?"M ".concat(e+3,",").concat(n+6," ").concat(e+11,",").concat(n+6," M").concat(e+7,",").concat(n+2," ").concat(e+7,",").concat(n+10):"M ".concat(e+3,",").concat(n+6," ").concat(e+11,",").concat(n+6," ")});return uo("g",{},[uo("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:t.x-t.width/2+5,y:t.y-t.height/2+5,onClick:function(){t.foldGroup(!t.properties.isFolded)}}),o])},e.prototype.getResizeShape=function(){return uo("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},e}(XM),qM={type:"group",view:KM,model:VM},ZM=-1e4,$M=function(){function t(t){var e=t.lf,n=this;this.topGroupZIndex=ZM,this.nodeGroupMap=new Map,this.graphRendered=function(t){var e=t.data;e&&e.nodes&&(e.nodes.forEach((function(t){t.children&&t.children.forEach((function(e){n.nodeGroupMap.set(e,t.id)}))})),n.checkAndCorrectTopGroupZIndex(e.nodes))},this.appendNodeToGroup=function(t){var e=t.data,o=n.nodeGroupMap.get(e.id);if(o){var r=n.lf.getNodeModelById(o);r.removeChild(e.id),n.nodeGroupMap.delete(e.id),r.setAllowAppendChild(!1)}var i=n.lf.getNodeModelById(e.id),a=null==i?void 0:i.getBounds();if(a&&i){var s=n.getGroup(a,e);if(i.isGroup&&(e.children.forEach((function(t){n.nodeGroupMap.set(t,e.id)})),n.checkAndCorrectTopGroupZIndex([e]),n.nodeSelected({data:e,isSelected:!1,isMultiple:!1})),!s)return;if(!s.isAllowAppendIn(e))return void n.lf.emit("group:not-allowed",{group:s.getData(),node:e});s.addChild(e.id),n.nodeGroupMap.set(e.id,s.id),s.setAllowAppendChild(!1)}},this.deleteGroupChild=function(t){var e=t.data;e.children&&e.children.forEach((function(t){n.nodeGroupMap.delete(t),n.lf.deleteNode(t)}));var o=n.nodeGroupMap.get(e.id);o&&(n.lf.getNodeModelById(o).removeChild(e.id),n.nodeGroupMap.delete(e.id))},this.setActiveGroup=function(t){var e=t.data,o=n.lf.getNodeModelById(e.id),r=null==o?void 0:o.getBounds();if(o&&r){var i=n.getGroup(r,e);if(n.activeGroup&&n.activeGroup.setAllowAppendChild(!1),!i||o.isGroup&&i.id===e.id)return;if(!i.isAllowAppendIn(e))return;n.activeGroup=i,n.activeGroup.setAllowAppendChild(!0)}},this.findNodeAndChildMaxZIndex=function(t){var e=ZM;return t.isGroup&&(e=Math.max(e,t.zIndex)),t.children&&t.children.forEach((function(t){"object"==typeof t&&(t=t.id);var o=n.lf.getNodeModelById(t);if(null==o?void 0:o.isGroup){var r=n.findNodeAndChildMaxZIndex(o);e=Math.max(r,e)}})),e},this.checkAndCorrectTopGroupZIndex=function(t){var e=ZM;if(t.forEach((function(t){var o=n.lf.getNodeModelById(t.id);if(o){var r=n.findNodeAndChildMaxZIndex(o);r>e&&(e=r)}})),!(n.topGroupZIndex>=e)){for(var o=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})),r=n.topGroupZIndex,i=0;i<o.length;i++){var a=o[i];a.zIndex>r&&(r=a.zIndex)}n.topGroupZIndex=r}},this.nodeSelected=function(t){var e=t.data,o=t.isMultiple,r=t.isSelected,i=n.lf.getNodeModelById(e.id);if(n.toFrontGroup(i),n.topGroupZIndex>-1e3){n.topGroupZIndex=ZM;for(var a=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})).sort((function(t,e){return t.zIndex-e.zIndex})),s=0,l=0;l<a.length;l++){var u=a[l];u.zIndex!==s&&(n.topGroupZIndex++,s=u.zIndex),u.setZIndex(n.topGroupZIndex)}}if(o&&r)if(null==i?void 0:i.isGroup)i.children.forEach((function(t){var e=n.lf.graphModel.getElement(t);null==e||e.setSelected(!1)}));else{var c=n.nodeGroupMap.get(e.id);if(c){var d=n.lf.getNodeModelById(c);(null==d?void 0:d.isSelected)&&(null==i||i.setSelected(!1))}}},this.toFrontGroup=function(t){t&&t.isGroup&&(n.topGroupZIndex++,t.setZIndex(n.topGroupZIndex),t.children&&t.children.forEach((function(t){var e=n.lf.getNodeModelById(t);n.toFrontGroup(e)})))},e.register(qM),this.lf=e,e.graphModel.addNodeMoveRules((function(t,o,r){if(t.isGroup){var i=n.getNodeAllChild(t);return e.graphModel.moveNodes(i,o,r,!0),!0}var a=e.getNodeModelById(n.nodeGroupMap.get(t.id));if(a&&a.isRestrict){var s=t.getBounds(),l=s.minX,u=s.minY,c=s.maxX,d=s.maxY;return a.isAllowMoveTo({x1:l+o,y1:u+r,x2:c+o,y2:d+r})}return!0})),e.graphModel.group=this,e.on("node:add,node:drop,node:dnd-add",this.appendNodeToGroup),e.on("node:delete",this.deleteGroupChild),e.on("node:dnd-drag,node:drag",this.setActiveGroup),e.on("node:click",this.nodeSelected),e.on("graph:rendered",this.graphRendered),e.addElements=function(t,o){var r=t.nodes,i=t.edges,a={},s={nodes:[],edges:[]},l=[];return oh(r,(function(t){var r=t.id,i=t.children,u=g(t,["children"]),c=e.addNode(u);if(!c)return{nodes:[],edges:[]};r&&(a[r]=c.id),s.nodes.push(c);var d=n.createAllChildNodes(a,i,c,o).edgesArray;l.push.apply(l,x([],_(d),!1))})),l.forEach((function(t){n.createEdgeModel(t,a,o)})),oh(i,(function(t){var e=n.createEdgeModel(t,a,0);s.edges.push(e)})),s}}return t.prototype.createAllChildNodes=function(t,e,n,o){var r=this,i=this.lf,a=[],s=[],l=[];null==e||e.forEach((function(e){var u=i.getNodeModelById(e);if(u){var c=u.x,d=u.y,p=u.properties,h=u.type,f=u.rotate,g=u.children,v={x:c+o,y:d+o,properties:p,type:h,rotate:f},y=Om.NODE_GROUP_COPY||"node:group-copy-add",m=i.addNode(v,y);if(n.addChild(m.id),t[e]=m.id,l.push(m),u.incoming.edges.forEach((function(t){s.push(t)})),u.outgoing.edges.forEach((function(t){s.push(t)})),g instanceof Set){var b=r.createAllChildNodes(t,g,m,o),E=b.nodesArray,w=b.edgesArray;l.push.apply(l,x([],_(E),!1)),a.push.apply(a,x([],_(w),!1))}}}));var u=s.filter((function(e){return t[e.sourceNodeId]&&t[e.targetNodeId]})).map((function(t){return t.getData()}));return{nodesArray:l,edgesArray:a.concat(u)}},t.prototype.createEdgeModel=function(t,e,n){var o=this.lf,r=t.sourceNodeId,i=t.targetNodeId;e[r]&&(r=e[r]),e[i]&&(i=e[i]);var a=t.type,s=t.startPoint,l=t.endPoint,u=t.pointsList,c=t.text,d={x:((null==s?void 0:s.x)||0)+n,y:((null==s?void 0:s.y)||0)+n},p={x:((null==l?void 0:l.x)||0)+n,y:((null==l?void 0:l.y)||0)+n},h=[];u&&u.length>0&&(h=u.map((function(t){return t.x+=n,t.y+=n,t})));var g={type:a,startPoint:d,endPoint:p,sourceNodeId:r,targetNodeId:i,pointsList:h};return Jr(c)&&!kf(c)&&(g.text=f(f({},c),{x:(null==c?void 0:c.x)+n,y:(null==c?void 0:c.y)+n})),o.graphModel.addEdge(g)},t.prototype.getNodeAllChild=function(t){var e=this,n=[];return t.children&&t.children.forEach((function(t){n.push(t);var o=e.lf.getNodeModelById(t);(null==o?void 0:o.isGroup)&&(n=n.concat(e.getNodeAllChild(o)))})),n},t.prototype.getGroup=function(t,e){var n=this.lf.graphModel.nodes.filter((function(n){return n.isGroup&&n.isInRange(t)&&n.id!==e.id}));if(0!==n.length){if(1===n.length)return n[0];for(var o=n[n.length-1],r=n.length-2;r>=0;r--)n[r].zIndex>o.zIndex&&(o=n[r]);return o}},t.prototype.getNodeGroup=function(t){var e=this.nodeGroupMap.get(t);if(e)return this.lf.getNodeModelById(e)},t.prototype.render=function(){},t.prototype.destroy=function(){},t.pluginName="group",t}();function JM(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getFoldIcon=function(){var t=this.props.model,e=t,n=e.x,o=e.y,r=e.width,i=e.height,a=e.properties,s=e.foldable,l=t.x-t.width/2+5,u=t.y-t.height/2+5;if(!s)return null;var c=uo("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:a.isFolded?"M ".concat(l+3,",").concat(u+6," ").concat(l+11,",").concat(u+6," M").concat(l+7,",").concat(u+2," ").concat(l+7,",").concat(u+10):"M ".concat(l+3,",").concat(u+6," ").concat(l+11,",").concat(u+6," ")});return uo("g",{},[uo("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:n-r/2+5,y:o-i/2+5,onClick:function(e){var n,o;null===(o=(n=e.stopPropagation()(t)).foldGroup)||void 0===o||o.call(n,!a.isFolded)}}),c])},e.prototype.getResizeShape=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.getNodeStyle(),a=f(f({},i),{x:e-o/2,y:n-r/2,width:o,height:r,stroke:"black",strokeWidth:2,strokeDasharray:"0 0"});return uo("g",{},[uo("rect",f({},a)),this.getFoldIcon()])},e}(KM),e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.foldable=!0,this.resizable=!0,this.width=400,this.height=200,this.resetWidthHeight(),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.resetWidthHeight=function(){var t,e,n=null===(t=this.properties.iniProp)||void 0===t?void 0:t.width,o=null===(e=this.properties.iniProp)||void 0===e?void 0:e.height;n&&(this.width=n),o&&(this.height=o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke="#989891",e.strokeWidth=1,e.strokeDasharray="3 3",this.isSelected&&(e.stroke="rgb(124, 15, 255)"),this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.addChild=function(e){var n=this.graphModel.getElement(e);null==n||n.setProperties({parent:this.id}),t.prototype.addChild.call(this,e)},e.prototype.getAnchorStyle=function(){var e=t.prototype.getAnchorStyle.call(this);return e.stroke="#000",e.fill="#fff",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(VM);return{type:"bpmn:subProcess",view:t,model:e}}function QM(t){var e=AM("bpmn:serviceTask",EM),n=AM("bpmn:userTask",wM);t.register(e),t.register(n),t.register(JM()),function(t){function e(t,e){var n=t.x,o=t.y,r=t.width,i=t.height,a=t.id,s=n-r/2,l=n+r/2,u=o-i/2,c=o+i/2,d=e.x,p=e.y;return d>s-5&&d<l+5&&p>u-5&&p<c+5&&!(d>s+5&&d<l-5&&p>u+5&&p<c-5)?a:null}t.on("node:drag,node:dnd-drag",(function(n){var o,r,i=n.data;if("bpmn:boundaryEvent"===i.type){var a=t.graphModel.nodes;try{for(var s=b(a),l=s.next();!l.done;l=s.next()){var u=l.value;u.isTaskNode&&(e(u,i)?u.setTouching(!0):u.setTouching(!1))}}catch(t){o={error:t}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}}})),t.on("node:drop,node:dnd-add",(function(n){var o,r,i=n.data,a=i.type,s=i.id;if("bpmn:boundaryEvent"===a){var l=t.graphModel.nodes;try{for(var u=b(l),c=u.next();!c.done;c=u.next()){var d,p=c.value;if(p.isTaskNode)if(null!==(d=e(p,i))){var h=t.graphModel.getNodeModelById(s),f=t.graphModel.getNodeModelById(d),g=h.properties.attachedToRef;return g&&g!==d&&t.graphModel.getNodeModelById(g).deleteBoundaryEvent(s),void f.addBoundaryEvent(s)}}}catch(t){o={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(o)throw o.error}}}})),t.graphModel.addNodeMoveRules((function(e,n,o){if(e.isTaskNode){var r=e.boundaryEvents;return t.graphModel.moveNodes(r,n,o,!0),!0}return!0}))}(t)}function tO(t){var e=function(e){function n(n,o){n.id||(n.id="Flow_".concat(cM()));var r=f(f(f({},t||{}),n.properties),{isDefaultFlow:!1});return n.properties=r,e.call(this,n,o)||this}return h(n,e),n.extendKey="SequenceFlowModel",n}(Cx),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getStartArrow=function(){return uo("path",this.props.model.properties.isDefaultFlow?{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}:{d:""})},e.extendKey="SequenceFlowEdge",e}(xS);return{type:"bpmn:sequenceFlow",view:n,model:e}}var eO=tO();var nO=[{nodes:["startEvent","intermediateCatchEvent","boundaryEvent"],definition:[{type:"bpmn:timerEventDefinition",icon:yM,properties:{definitionType:"bpmn:timerEventDefinition",timerValue:"",timerType:""}}]}];function oO(t){function e(e){e.forEach((function(e){var n,o;n=e.nodes,o=e.definition,n.forEach((function(e){(null==t?void 0:t[e])||(t[e]=new Map);var n=null==t?void 0:t[e];o.forEach((function(t){n.set(t.type,t)}))}))}))}return function(){return[t,e]}}var rO=function(){function t(t){var e=t.lf;e.definition={},e.useDefinition=oO(e.definition);var n=_(e.useDefinition(),2),o=n[0],r=n[1];console.log("_definition",o),r(nO),function(t){t.register(fM(t)),t.register(pM(t)),t.register(hM(t)),t.register(vM(t)),t.register(gM(t))}(e),function(t){var e=TM("bpmn:exclusiveGateway",bM),n=TM("bpmn:parallelGateway",_M),o=TM("bpmn:inclusiveGateway",xM);t.register(e),t.register(o),t.register(n)}(e),function(t){t.register(eO)}(e),QM(e),e.setDefaultEdgeType("bpmn:sequenceFlow")}return t.pluginName="BpmnElementsPlugin",t}(),iO=40,aO=40,sO=40,lO=40,uO=100,cO=80,dO=100,pO=80,hO=100,fO=80,gO=100,vO=80,yO=100,mO=80,bO=100,_O=80,xO=100,EO=80,wO=100,SO=80,CO=function(){};(CO.ObjTree=function(){return this}).VERSION="0.23",CO.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',CO.ObjTree.prototype.attr_prefix="-",CO.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(t,"application/xml");if(!o)return;e=o.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},CO.ObjTree.prototype.parseHTTP=function(t,e,n){var o,r={};for(var i in e)r[i]=e[i];if(r.method||(void 0===r.postBody&&void 0===r.postbody&&void 0===r.parameters?r.method="get":r.method="post"),n){r.asynchronous=!0;var a=this,s=n,l=r.onComplete;r.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),s(e,t),l&&l(t)}}else r.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)r.uri=t,(u=new HTTP.Request(r))&&(o=u.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var u;(u=new Ajax.Request(t,r))&&(o=u.transport)}return n?o:o&&o.responseXML&&o.responseXML.documentElement?this.parseDOM(o.responseXML.documentElement):void 0},CO.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!==t.nodeType){var o={};o[t.nodeName]=n,n=o}return n}},CO.ObjTree.prototype.parseElement=function(t){if(7!==t.nodeType){if(3===t.nodeType||4===t.nodeType||8===t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var o=0;o<t.attributes.length;o++){if("string"==typeof(s=t.attributes[o].nodeName)){var r=t.attributes[o].nodeValue;try{r=JSON.parse(t.attributes[o].nodeValue.replace(/'/g,'"'))}catch(e){r=t.attributes[o].nodeValue}null!=r&&(void 0===n[s=this.attr_prefix+s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],r))}}}if(t.childNodes&&t.childNodes.length){var i=!0;e&&(i=!1);for(o=0;o<t.childNodes.length&&i;o++){var a=t.childNodes[o].nodeType;3!==a&&4!==a&&8!==a&&(i=!1)}if(i){e||(e="");for(o=0;o<t.childNodes.length;o++)e+=t.childNodes[o].nodeValue}else{e||(e={});for(o=0;o<t.childNodes.length;o++){var s;if("string"==typeof(s=t.childNodes[o].nodeName))(r=this.parseElement(t.childNodes[o]))&&(void 0===n[s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],r))}}}else null===e&&(e={});return e}},CO.ObjTree.prototype.addNode=function(t,e,n,o){this.__force_array[e]?(1===n&&(t[e]=[]),t[e][t[e].length]=o):1===n?t[e]=o:2===n?t[e]=[t[e],o]:t[e][t[e].length]=o},CO.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},CO.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],o=[];for(var r in e)if($h(e,r)){var i=e[r];r.charAt(0)!==this.attr_prefix?void 0===i||null==i?n[n.length]="<".concat(r," />"):"object"==typeof i&&i.constructor===Array?n[n.length]=this.array_to_xml(r,i):n[n.length]="object"==typeof i?this.hash_to_xml(r,i):this.scalar_to_xml(r,i):o[o.length]=" ".concat(r.substring(1),'="').concat(this.xml_escape(i),'"')}var a=o.join(""),s=n.join("");return void 0===t||null==t||(s=n.length>0?s.match(/\n/)?"<".concat(t).concat(a,">\n").concat(s,"</").concat(t,">\n"):"<".concat(t).concat(a,">").concat(s,"</").concat(t,">\n"):"<".concat(t).concat(a," />\n")),s},CO.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],o=0;o<e.length;o++){var r=e[o];void 0===r||null==r?n[n.length]="<".concat(t," />"):"object"==typeof r&&r.constructor===Array?n[n.length]=this.array_to_xml(t,r):n[n.length]="object"==typeof r?this.hash_to_xml(t,r):this.scalar_to_xml(t,r)}return n.join("")},CO.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"===t?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,">\n")},CO.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};function MO(t){return Object.prototype.toString.call(t)}function OO(t){return" ".repeat(t)}function TO(t){return"[object Object]"===MO(t)?Object.keys(t).reduce((function(e,n){var o=n;return"-"===n.charAt(0)&&(o=n.substring(1)),e[o]=TO(t[n]),e}),{}):Array.isArray(t)?t.map((function(t){return TO(t)})):t}var NO,AO="\t\n";function PO(t,e,n){var o=OO(n),r="",i=AO+o;if("-json"===e)return"";if("#text"===e)return i+t;if("#cdata-section"===e)return"".concat(i,"<![CDATA[").concat(t,"]]>");if("#comment"===e)return"".concat(i,"\x3c!--").concat(t,"--\x3e");if("-"==="".concat(e).charAt(0))return" ".concat(e.substring(1),'="').concat(function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(TO(t)).replace(/"/g,"'")}return e}(t),'"');if(Array.isArray(t))r+=t.map((function(t){return PO(t,e,n+1)})).join("");else if("[object Object]"===MO(t)){var a=Object.keys(t),s="",l=t["-json"]?AO+OO(n+1)+t["-json"]:"";r+="".concat(0===n?"":i,"<").concat(e),a.forEach((function(e){"-"===e.charAt(0)?s+=PO(t[e],e,n+1):l+=PO(t[e],e,n+1)})),r+=s+(""!==l?">".concat(l).concat(i,"</").concat(e,">"):" />")}else r+="".concat(i,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return r}!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"}(NO||(NO={}));var DO=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],kO=["properties","startPoint","endPoint","pointsList"],RO={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},IO=function(t,e){return Object.keys(e||{}).forEach((function(n){if(t[n]){var o=e[n],r=o.in,i=o.out;r&&(t[n].in=r),i&&(t[n].out=i)}else t[n]=e[n]})),t},LO={"bpmn:startEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=LO[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=LO[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=LO[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,o=t.properties;return(null===(n=null===(e=LO[o.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,o=e.condition;return o?"cdata"===n?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(o,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(o,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,o=e.timerValue,r=e.definitionId;return{json:'<bpmn:timerEventDefinition id="'.concat(r,'"').concat(n&&o?">".concat("<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(o,"</bpmn:").concat(n,">"),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,o,r,i=t,a=e["-id"],s="",l="";try{for(var u=b(Object.keys(e)),c=u.next();!c.done;c=u.next()){var d=c.value;d.includes("bpmn:")&&(s=_(d.split(":"),2)[1],l=null===(r=e[d])||void 0===r?void 0:r["#text"])}}catch(t){n={error:t}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}return{"-definitionId":a,"-definitionType":i,"-timerType":s,"-timerValue":l}}},"bpmn:conditionExpression":{in:function(t,e){var n,o="",r="";return e["#cdata-section"]?(r="cdata",o=(null===(n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))||void 0===n?void 0:n[1])||""):e["#text"]&&(r="normal",o=e["#text"]),{"-condition":o,"-expressionType":r}}}};function jO(t){var e=null!=t?t:{},n=e.retainedAttrsFields,o=e.excludeFields,r=e.transformer,i=new Set(x(x([],_(kO),!1),_(n||[]),!1)),a={in:new Set(x(x([],_(RO.in),!1),_((null==o?void 0:o.in)||[]),!1)),out:new Set(x(x([],_(RO.out),!1),_((null==o?void 0:o.out)||[]),!1))};return LO=IO(LO,r),function(t){var e=t.nodes,n=t.edges;return function t(o,r){var s,l;if(1!==(null==o?void 0:o.flag)){var u;if((u=LO[o.type])&&u.out){var c=u.out(o),d=Object.keys(c);d.length>0&&d.forEach((function(t){o[t]=c[t]}))}(null==o?void 0:o.children)&&(o.children=o.children.map((function(t){return e.find((function(e){return e.id===t}))||n.find((function(e){return e.id===t}))||{}})));var p={};if("string"==typeof o)return o;if(Array.isArray(o))return o.map((function(e){return t(e,"")})).filter((function(t){return null!=t}));try{for(var h=b(Object.entries(o)),f=h.next();!f.done;f=h.next()){var g=_(f.value,2),v=g[0],y=g[1];if(1===(null==y?void 0:y.flag))return;var m=[r,v].filter((function(t){return t})).join(".");a.out.has(m)||("object"!=typeof y?0===v.indexOf("-")||["#text","#cdata-section","#comment"].includes(v)?p[v]=y:p["-".concat(v)]=y:i.has(m)?p["-".concat(v)]=t(y,m):p[v]=t(y,m))}}catch(t){s={error:t}}finally{try{f&&!f.done&&(l=h.return)&&l.call(h)}finally{if(s)throw s.error}}return p}}(t,"")}}function BO(t){var e,n,o={};try{for(var r=b(Object.entries(t)),i=r.next();!i.done;i=r.next()){var a=_(i.value,2),s=a[0],l=a[1];0===s.indexOf("-")?o[s.substring(1)]=TO(l):"string"==typeof l?o[s]=l:"[object Object]"===Object.prototype.toString.call(l)?o[s]=BO(l):Array.isArray(l)?o[s]=l.map((function(t){return BO(t)})):o[s]=l}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return o}function HO(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,o=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),r={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":o};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(r["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),r})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,o=100,r=80,i=t.x,a=t.y,s=XO.shapeConfigMap.get(t.type);s&&(o=s.width,r=s.height),i-=o/2,a-=r/2;var l={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":i,"-y":a,"-width":o,"-height":r}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(l["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),l}))}var zO=["bpmn:incoming","bpmn:outgoing"];function FO(t,e){var n=[],o=[],r=new Map,i=null!=e?e:{},a=i.transformer,s=i.excludeFields,l={in:new Set(x(x([],_(RO.in),!1),_((null==s?void 0:s.in)||[]),!1)),out:new Set(x(x([],_(RO.out),!1),_((null==s?void 0:s.out)||[]),!1))};LO=IO(LO,a);var u,c,d=t["bpmn:definitions"];if(d){var p=d["bpmn:process"];u=p,c=[function(t){function e(t){t["-children"]||(t["-children"]=[]),Object.keys(t).forEach((function(e){var n;0!==e.indexOf("bpmn:")||zO.includes(e)||(p[e]||(p[e]=[]),!Array.isArray(p[e])&&(p[e]=[p[e]]),Array.isArray(t[e])?(n=p[e]).push.apply(n,x([],_(t[e]),!1)):p[e].push(t[e]),Array.isArray(t[e])?t[e].forEach((function(n){!e.includes("Flow")&&t["-children"].push(n["-id"])})):!e.includes("Flow")&&t["-children"].push(t[e]["-id"]),delete t[e])}))}if("bpmn:subProcess"===t){var n=p[t];Array.isArray(n)?n.forEach((function(n){"bpmn:subProcess"===t&&e(n)})):e(n)}},function(t){function e(t){var n;r.set(t["-id"],t),Array.isArray(t)?t.forEach((function(t){e(t)})):"object"==typeof t&&(n=t,Object.keys(n).forEach((function(t){var o,r;if(t.includes("bpmn:")){var i={};LO[t]&&LO[t].in?(i=null===(r=(o=LO[t]).in)||void 0===r?void 0:r.call(o,t,Ji.cloneDeep(n[t])),delete n[t]):e(n[t]);var a=void 0;(a=Reflect.ownKeys(i)).length>0&&a.forEach((function(t){Reflect.set(n,t,i[t])}))}})))}e(p[t])},function(t){if(0===t.indexOf("bpmn:")){var e=p[t];if("bpmn:sequenceFlow"===t){var i=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];o=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var o;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(GO(o,t))}));else{var o=void 0;o=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(GO(o,t))}return n}(e,i)}else{var a=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if("bpmn:boundaryEvent"===t){var s=p[t],l=function(t){var e=t["-attachedToRef"],n=r.get(e);n["-boundaryEvents"]||(n["-boundaryEvents"]=[]),n["-boundaryEvents"].push(t["-id"])};Array.isArray(s)?s.forEach((function(t){l(t)})):l(s)}n=n.concat(function(t,e,n){var o=[];if(Array.isArray(t))t.forEach((function(t){var r=WO(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(r)}));else{var r=WO(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);o.push(r)}return o}(e,a,t))}}}],c.forEach((function(t){try{Object.keys(u).forEach((function(e){try{t(e)}catch(t){console.error(t)}}))}catch(t){console.error(t)}}))}var h=function(t,e,n){Object.keys(t).forEach((function(o){var r=n?"".concat(n,".").concat(o):o;e.has(r)?delete t[o]:"object"==typeof t[o]&&h(t[o],e,r)}))};return n.forEach((function(t){var n,o;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var r=null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.in,i=t.type;r[i]&&(t.type=r[i])}h(t,l.in,"")})),o.forEach((function(t){var n,o;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var r=null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.in,i=t.type;r[i]&&(t.type=r[i])}h(t,l.in,"")})),{nodes:n,edges:o}}function WO(t,e,n){var o=Number(t["dc:Bounds"]["-x"]),r=Number(t["dc:Bounds"]["-y"]),i=n["-children"],a=n["-name"],s=XO.shapeConfigMap.get(e);s&&(o+=s.width/2,r+=s.height/2);var l,u={};if(Object.entries(n).forEach((function(t){var e=_(t,2),n=e[0],o=e[1];DO.includes(n)||(u[n]=o)})),u=BO(u),a&&(l={x:o,y:r,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];l.x=Number(c["-x"])+Number(c["-width"])/2,l.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:o,y:r,properties:u};return i&&(d.children=i),l&&(d.text=l),d}function GO(t,e){var n,o=e["-name"];if(o){var r=t["bpmndi:BPMNLabel"]["dc:Bounds"],i=0;o.split("\n").forEach((function(t){i<t.length&&(i=t.length)})),n={value:o,x:Number(r["-x"])+10*i/2,y:Number(r["-y"])+7}}var a={};Object.entries(e).forEach((function(t){var e=_(t,2),n=e[0],o=e[1];DO.includes(n)||(a[n]=o)})),a=BO(a);var s=t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),l={id:e["-id"],type:NO.FLOW,pointsList:s,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(l.text=n),l}var XO=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var o,r,i=f({},n.processAttributes);!function(t,e,n){var o,r=new Map,i=jO(n)(e);i.nodes.forEach((function(e){var n=e["-id"],o=e["-type"],i=e.text,a=e.children,s=g(e,["-id","-type","text","children"]),l={"-id":n};(null==i?void 0:i["-value"])&&(l["-name"]=i["-value"]),s["-json"]&&(l["-json"]=s["-json"]),s["-properties"]&&Object.assign(l,s["-properties"]),a&&(l.children=a),t[o]||(t[o]=[]),t[o].push(l),r.set(n,l)}));var a=i.edges.map((function(t){var e=t["-id"],n=t["-sourceNodeId"],o=t["-targetNodeId"],i=t.text,a=g(t,["-id","-sourceNodeId","-targetNodeId","text"]),s=r.get(o);s["bpmn:incoming"]||(s["bpmn:incoming"]=[]),s["bpmn:incoming"].push(e);var l={"-id":e,"-sourceRef":n,"-targetRef":o};return(null==i?void 0:i["-value"])&&(l["-name"]=i["-value"]),a["-json"]&&(l["-json"]=a["-json"]),a["-properties"]&&Object.assign(l,a["-properties"]),l}));e.edges.forEach((function(t){var e=t.sourceNodeId,n=t.id,o=r.get(e);o["bpmn:outgoing"]||(o["bpmn:outgoing"]=[]),o["bpmn:outgoing"].push(n)})),null===(o=t["bpmn:subProcess"])||void 0===o||o.forEach((function(e){var n={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},o=[];e.children.forEach((function(o){var i,a=r.get(o["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach((function(t){a[t]&&a[t].forEach((function(e){n[t].add(e)}))}));var s=null===(i=t[o["-type"]])||void 0===i?void 0:i.findIndex((function(t){return t["-id"]===o["-id"]}));s>=0&&t[o["-type"]].splice(s,1),r.delete(o["-id"]),e[o["-type"]]||(e[o["-type"]]=[]),e[o["-type"]].push(a)}));var i=n["bpmn:incoming"];n["bpmn:outgoing"].forEach((function(t){i.has(t)&&o.push(t)}));for(var s,l=function(t){var n=a.findIndex((function(e){return e["-id"]===o[t]}));n>=0?(e["bpmn:sequenceFlow"]||(e["bpmn:sequenceFlow"]=[]),e["bpmn:sequenceFlow"].push(a[n]),a.splice(n,1)):t++,s=t},u=0;u<o.length;)l(u),u=s;delete e.children})),t[NO.FLOW]=a}(i,t,e);var a={"-id":"BPMNPlane_1","-bpmnElement":i["-id"]};HO(a,t);var s=n.definitionAttributes;s["bpmn:process"]=i,s["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":a};var l={"bpmn:definitions":s};if(null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.out){var u=null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.out,c=function(t){Array.isArray(t)&&t.forEach((function(t){return c(t)})),"object"==typeof t&&Object.keys(t).forEach((function(e){var n;(n=u[e])?(t[n]=Ji.cloneDeep(t[e]),delete t[e],c(t[n])):c(t[e])}))};c(l)}return l},this.adapterIn=function(t,e){if(t)return FO(t,e)},e.adapterIn=this.adapterIn,e.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"Definitions","-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();XO.shapeConfigMap.set(NO.START,{width:iO,height:aO}),XO.shapeConfigMap.set(NO.END,{width:sO,height:lO}),XO.shapeConfigMap.set(NO.INTERMEDIATE_CATCH,{width:dO,height:pO}),XO.shapeConfigMap.set(NO.INTERMEDIATE_THROW,{width:dO,height:pO}),XO.shapeConfigMap.set(NO.BOUNDARY,{width:uO,height:cO}),XO.shapeConfigMap.set(NO.PARALLEL_GATEWAY,{width:hO,height:fO}),XO.shapeConfigMap.set(NO.INCLUSIVE_GATEWAY,{width:gO,height:vO}),XO.shapeConfigMap.set(NO.EXCLUSIVE_GATEWAY,{width:yO,height:mO}),XO.shapeConfigMap.set(NO.SYSTEM,{width:bO,height:_O}),XO.shapeConfigMap.set(NO.USER,{width:xO,height:EO}),XO.shapeConfigMap.set(NO.SUBPROCESS,{width:wO,height:SO});var UO=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e,o=(e=t,(new CO.ObjTree).parseXML(e));return n.adapterIn(o,n.props)},n.adapterXmlOut=function(t){return function(t){var e="";for(var n in t)e+=PO(t[n],n,0);return e}(n.adapterOut(t,n.props))};var o=e.lf,r=e.props;return o.adapterIn=n.adapterXmlIn,o.adapterOut=n.adapterXmlOut,n.props=r,n}return h(e,t),e.pluginName="BPMNAdapter",e}(XO),YO={SEQUENCE_FLOW:1,START_EVENT:2,END_EVENT:3,USER_TASK:4,EXCLUSIVE_GATEWAY:6},VO={1:"bpmn:sequenceFlow",2:"bpmn:startEvent",3:"bpmn:endEvent",4:"bpmn:userTask",6:"bpmn:exclusiveGateway"};function KO(t){switch(t){case"bpmn:sequenceFlow":return YO.SEQUENCE_FLOW;case"bpmn:startEvent":return YO.START_EVENT;case"bpmn:endEvent":return YO.END_EVENT;case"bpmn:userTask":return YO.USER_TASK;case"bpmn:exclusiveGateway":return YO.EXCLUSIVE_GATEWAY;default:return t}}var qO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.componentDidMount=function(){t.prototype.componentDidMount.call(this);var e=this.props,n=e.model,o=e.graphModel,r=o.eventCenter;r.on("node:rotate",(function(t){var e=t.model;e.id===n.id&&oh(Array.from(n.children),(function(t){var n=o.getNodeModelById(t);n&&(n.rotate=e.rotate)}))})),r.on("node:resize",(function(t){var e=t.deltaX,r=t.deltaY,i=t.index;t.model.id===n.id&&oh(Array.from(n.children),(function(t){var n=o.getNodeModelById(t);n&&Z_({deltaX:e,deltaY:r,index:i,nodeModel:n,graphModel:o,cancelCallback:function(){}})}))}))},e.prototype.getResizeControl=function(){var e=this.props.model,n=e.resizable,o=e.isCollapsed;return n&&!o?t.prototype.getResizeControl.call(this):null},e.prototype.getAppendAreaShape=function(){var t=this.props.model,e=t.width,n=t.height,o=t.x,r=t.y,i=t.radius;if(!t.groupAddable)return null;var a=t.getNodeStyle().strokeWidth,s=void 0===a?0:a,l=t.getAddableOutlineStyle(),u=e+s+8,c=n+s+8;return uo("rect",f(f({},l),{width:u,height:c,x:o-u/2,y:r-c/2,rx:i,ry:i}))},e.prototype.getCollapseIcon=function(t,e){return"M ".concat(t+3,",").concat(e+6," ").concat(t+11,",").concat(e+6," M").concat(t+7,",").concat(e+2," ").concat(t+7,",").concat(e+10)},e.prototype.getExpandIcon=function(t,e){return"M ".concat(t+3,",").concat(e+6," ").concat(t+11,",").concat(e+6," ")},e.prototype.getOperateIcon=function(){var t=this.props.model,e=t.x,n=t.y,o=e-t.width/2+10,r=n-t.height/2+10;if(!t.collapsible)return null;var i=uo("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:(null==t?void 0:t.isCollapsed)?this.getCollapseIcon(o,r):this.getExpandIcon(o,r)});return uo("g",{},[uo("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#f4f5f6",stroke:"#cecece",cursor:"pointer",x:o,y:r,onClick:function(){t.toggleCollapse(!t.isCollapsed)}}),i])},e.prototype.getShape=function(){return uo("g",{},[this.getAppendAreaShape(),t.prototype.getShape.call(this),this.getOperateIcon()])},e}(kw),ZO=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.isGroup=!0,o.isRestrict=!1,o.collapsible=!0,o.isCollapsed=!1,o.groupAddable=!1,o.transformWidthContainer=!0,o.childrenLastCollapseStateDict={},o.initNodeData(e),o.setAttributes(),o}return h(e,t),e.prototype.initNodeData=function(e){var n;t.prototype.initNodeData.call(this,e);var o=null!==(n=e.properties)&&void 0!==n?n:{},r=o.children,i=o.width,a=o.height,s=o.collapsedWidth,l=o.collapsedHeight,u=o.collapsible,c=o.isCollapsed,d=o.zIndex,p=o.isRestrict,h=o.autoToFront;this.children=r?new Set(r):new Set,this.zIndex=null!=d?d:-1e4,this.isCollapsed=null!=c&&c;var f=null!=i?i:400,g=null!=a?a:230;this.width=f,this.height=g,this.expandWidth=f,this.expandHeight=g,this.collapsedWidth=null!=s?s:80,this.collapsedHeight=null!=l?l:60,this.isRestrict=null!=p&&p,this.collapsible=null==u||u,this.autoToFront=null!=h&&h,this.text.editable=!1,this.text.draggable=!1},e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this),this.isCollapsed&&this.toggleCollapse(!0)},e.prototype.getData=function(){var e=this,n=t.prototype.getData.call(this),o=[];return oh(Array.from(this.children),(function(t){var n=e.graphModel.getNodeModelById(t);n&&!n.virtual&&o.push(t)})),n.children=o,n.properties&&(n.properties.children=o,n.properties.isCollapsed=this.isCollapsed),n},e.prototype.getHistoryData=function(){var e=t.prototype.getHistoryData.call(this);e.children=Array.from(this.children),e.isGroup=!0;var n=this,o=n.x,r=n.y,i=n.collapsedWidth,a=n.collapsedHeight,s=n.expandWidth,l=n.expandHeight;return n.isCollapsed&&(e.x=o+s/2-i/2,e.y=r+l/2-a/2),e},e.prototype.toggleCollapse=function(t){var e=this,n=!!t;this.isCollapsed=n,n?this.collapse():this.expand();var o=x(x([],_(this.incoming.edges),!1),_(this.outgoing.edges),!1);console.log("this --\x3e>",this),console.log("this.children --\x3e>",this.children),oh(Array.from(this.children),(function(n){var r=e.graphModel.getElement(n);if(r){var i=r.isCollapsed;if(r.isGroup){var a=r;if(a.isCollapsed||a.toggleCollapse(t),!t){var s=e.childrenLastCollapseStateDict[n];void 0!==s&&s!==r.isCollapsed&&a.toggleCollapse(s)}}if(e.childrenLastCollapseStateDict[n]=!!i,r.visible=!t,r.BaseType===Cm.NODE){var l=r.incoming.edges,u=r.outgoing.edges;o=x(x(x([],_(o),!1),_(l),!1),_(u),!1)}}})),this.collapseEdge(n,o)},e.prototype.collapse=function(){var t=this,e=t.x,n=t.y,o=t.text,r=t.width,i=t.height,a=t.collapsedWidth,s=t.collapsedHeight;this.x=e-r/2+a/2,this.y=n-i/2+s/2,this.text.x=o.x-r/2+a/2,this.text.y=o.y-i/2+s/2,this.expandWidth=r,this.expandHeight=i,this.width=a,this.height=s},e.prototype.expand=function(){var t=this,e=t.x,n=t.y,o=t.text,r=t.expandWidth,i=t.expandHeight,a=t.collapsedWidth,s=t.collapsedHeight;this.width=r,this.height=i,this.x=e+this.width/2-a/2,this.y=n+this.height/2-s/2,this.text.x=o.x+this.width/2-a/2,this.text.y=o.y+this.height/2-s/2},e.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var e=this.graphModel.addEdge(t);e.virtual=!0,e.text.editable=!1,e.isCollapsedEdge=!0},e.prototype.collapseEdge=function(t,e){var n=this,o=this.graphModel;oh(e,(function(e,r){var i,a=e.getData(),s=a.targetNodeId,l=a.sourceNodeId,u=f(f({},a),{id:"".concat(a.id,"__").concat(r),text:null===(i=a.text)||void 0===i?void 0:i.value});e.virtual&&o.deleteEdgeById(e.id);var c=o.group.getGroupByNodeId(s);c||(c=o.getNodeModelById(s));var d=o.group.getGroupByNodeId(l);d||(d=o.getNodeModelById(l)),t&&e.visible&&(n.children.has(l)||n.id===l?(u.startPoint=void 0,u.sourceNodeId=n.id):(u.endPoint=void 0,u.targetNodeId=n.id),c.id===n.id&&d.id===n.id||n.createVirtualEdge(u),e.visible=!1),t||e.visible||(c&&c.isGroup&&c.isCollapsed?(u.targetNodeId=c.id,u.endPoint=void 0,n.createVirtualEdge(u)):d&&d.isGroup&&d.isCollapsed?(u.sourceNodeId=d.id,u.startPoint=void 0,n.createVirtualEdge(u)):e.visible=!0)}))},e.prototype.isAllowAppendIn=function(t){return console.info("_nodeData",t),!0},e.prototype.setAllowAppendChild=function(t){this.groupAddable=t},e.prototype.addChild=function(t){this.children.add(t);var e=this.getData();this.graphModel.eventCenter.emit("group:add-node",{data:e})},e.prototype.removeChild=function(t){this.children.delete(t);var e=this.getData();this.graphModel.eventCenter.emit("group:remove-node",{data:e})},e.prototype.toBack=function(){this.zIndex--},e.prototype.getResizeOutlineStyle=function(){var e=t.prototype.getResizeOutlineStyle.call(this);return e.stroke="none",e},e.prototype.getAnchorStyle=function(){var e=t.prototype.getAnchorStyle.call(this);return e.stroke="transparent",e.fill="transparent",e.hover&&(e.hover.fill="transparent",e.hover.stroke="transparent"),e},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#feb663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},v([mt],e.prototype,"isCollapsed",void 0),v([mt],e.prototype,"groupAddable",void 0),v([mt],e.prototype,"transformWidthContainer",void 0),e}(Jx);var $O,JO={type:"dynamic-group",view:qO,model:ZO},QO=-1e4,tT=function(){function t(t){var e=t.lf,n=t.options,o=this;this.topGroupZIndex=QO,this.nodeGroupMap=new Map,this.addNodeToGroup=function(t){var e=t.data,n=o.nodeGroupMap.get(e.id);n&&((s=o.lf.getNodeModelById(n)).removeChild(e.id),o.nodeGroupMap.delete(e.id),s.setAllowAppendChild(!1));var r=o.lf.getNodeModelById(e.id),i=null==r?void 0:r.getBounds();if(r&&i){if(r.isGroup){var a=r;oh(Array.from(a.children),(function(t){o.nodeGroupMap.set(t,e.id)})),o.calibrateTopGroupZIndex([e]),o.onNodeSelect({data:e,isSelected:!1,isMultiple:!1})}var s;if(s=o.getGroupByBounds(i,e)){var l=s.isAllowAppendIn(e);console.log("isAllowAppendIn",l),l?(s.addChild(e.id),o.nodeGroupMap.set(e.id,s.id),s.setAllowAppendChild(!0)):o.lf.emit("group:not-allowed",{group:s.getData(),node:e})}}},this.removeNodeFromGroup=function(t){var e=t.data;e.isGroup&&e.children&&oh(Array.from(e.children),(function(t){o.nodeGroupMap.delete(t),o.lf.deleteNode(t)}));var n=o.nodeGroupMap.get(e.id);if(n){var r=o.lf.getNodeModelById(n);r&&r.removeChild(e.id),o.nodeGroupMap.delete(e.id)}},this.setActiveGroup=function(t){var e=t.data,n=o.lf.getNodeModelById(e.id),r=null==n?void 0:n.getBounds();if(n&&r){var i=o.getGroupByBounds(r,e);if(o.activeGroup&&o.activeGroup.setAllowAppendChild(!1),!i||n.isGroup&&i.id===e.id)return;if(!i.isAllowAppendIn(e))return;o.activeGroup=i,console.log("this.activeGroup",o.activeGroup),o.activeGroup.setAllowAppendChild(!0)}},this.onNodeSelect=function(t){var e=t.data,n=t.isMultiple,r=t.isSelected,i=o.lf.getNodeModelById(e.id);if(o.sendNodeToFront(i),o.topGroupZIndex>-1e3){var a=o.lf.graphModel.nodes;o.topGroupZIndex=QO;var s=Fv(wh(a,(function(t){return!!t.isGroup})),"zIndex"),l=0;oh(s,(function(t){t.zIndex!==l&&(o.topGroupZIndex++,l=t.zIndex),t.setZIndex(o.topGroupZIndex)}))}if(n&&r)if(null==i?void 0:i.isGroup){var u=i.children;oh(Array.from(u),(function(t){var e=o.lf.getNodeModelById(t);null==e||e.setSelected(!1)}))}else{var c=o.nodeGroupMap.get(e.id);if(c){var d=o.lf.getNodeModelById(c);(null==d?void 0:d.isSelected)&&(null==i||i.setSelected(!1))}}},this.onGraphRendered=function(t){var e=t.data;console.log("data",e),oh(e.nodes,(function(t){t.children&&oh(t.children,(function(e){o.nodeGroupMap.set(e,t.id)}))})),o.calibrateTopGroupZIndex(e.nodes)},e.register(JO),this.lf=e,console.log("options",n),Ys(this,n),this.init()}return t.prototype.getNodesInGroup=function(t){var e=this,n=[];return t.isGroup&&oh(Array.from(t.children),(function(t){n.push(t);var o=e.lf.getNodeModelById(t);(null==o?void 0:o.isGroup)&&(n=n.concat(e.getNodesInGroup(o)))})),n},t.prototype.getGroupByNodeId=function(t){var e=this.nodeGroupMap.get(t);if(e)return this.lf.getNodeModelById(e)},t.prototype.getGroupByBounds=function(t,e){var n=wh(this.lf.graphModel.nodes,(function(n){return!!n.isGroup&&function(t,e){var n=t.minX,o=t.minY,r=t.maxX,i=t.maxY,a=e.x,s=e.y,l=e.width,u=e.height;return n>=a-l/2&&r<=a+l/2&&o>=s-u/2&&i<=s+u/2}(t,n)&&n.id!==e.id})),o=n.length;if(o<=1)return n[0];for(var r=n[o-1],i=o-2;i>=0;i--)r=n[i];return r},t.prototype.sendNodeToFront=function(t){var e=this;if(t&&t.isGroup&&(this.topGroupZIndex++,t.setZIndex(this.topGroupZIndex),t.children)){var n=t.children;oh(Array.from(n),(function(t){var n=e.lf.getNodeModelById(t);e.sendNodeToFront(n)}))}},t.prototype.getMaxZIndex=function(t){var e=this,n=QO;if(t.isGroup&&(n=Math.max(n,t.zIndex)),t.children){var o=t.children;oh(Array.from(o),(function(t){var o=e.lf.getNodeModelById(t);if(null==o?void 0:o.isGroup){var r=e.getMaxZIndex(o);n=Math.max(n,r)}}))}return n},t.prototype.calibrateTopGroupZIndex=function(t){var e=this,n=QO;if(oh(t,(function(t){var o=e.lf.getNodeModelById(t.id);if(o){var r=e.getMaxZIndex(o);r>n&&(n=r)}})),!(this.topGroupZIndex>=n)){var o=wh(this.lf.graphModel.nodes,(function(t){return!!t.isGroup})),r=this.topGroupZIndex;oh(o,(function(t){t.zIndex>r&&(r=t.zIndex)})),this.topGroupZIndex=r}},t.prototype.initGroupChildNodes=function(t,e,n,o){var r=this,i=[],a=[],s=[];oh(Array.from(e),(function(l){var u=r.lf.getNodeModelById(l);if(u){var c=u.getData(),d=Om.NODE_GROUP_COPY||"node:group-copy-add",p=function(t,e){var n=t.x,o=t.y,r=t.text,i=r?{x:r.x+e,y:r.y+e,value:r.value}:void 0;return rC(rC({},t),{id:"",x:n+e,y:o+e,text:i})}(c,o),h=r.lf.addNode(p,d);if(n.addChild(h.id),t[l]=h.id,i.push(h),s.push.apply(s,x([],_(x(x([],_(h.incoming.edges),!1),_(h.outgoing.edges),!1)),!1)),e instanceof Set){var f=r.initGroupChildNodes(t,e,h,o),g=f.childNodes,v=f.edgesData;i.push.apply(i,x([],_(g),!1)),a.push.apply(a,x([],_(v),!1))}}})),console.log("allRelatedEdges --\x3e>",s);var l=Ih(wh(s,(function(e){return $h(t,e.sourceNodeId)&&$h(t,e.targetNodeId)})),(function(t){return t.getData()}));return{childNodes:i,edgesData:a.concat(l)}},t.prototype.createEdge=function(t,e,n){var o,r,i=t.sourceNodeId,a=t.targetNodeId,s=null!==(o=e[i])&&void 0!==o?o:i,l=null!==(r=e[a])&&void 0!==r?r:a,u=_d(t);return t.id&&"object"==typeof t.text&&null!==t.text&&(u=function(t,e){var n=t.startPoint,o=t.endPoint,r=t.pointsList,i=t.text,a=iC(t,["startPoint","endPoint","pointsList","text"]);a.id="";var s={x:n.x+e,y:n.y+e},l={x:o.x+e,y:o.y+e},u=Ih(r,(function(t){return{x:t.x+e,y:t.y+e}})),c=i?rC(rC({},i),{x:i.x+e,y:i.y+e}):void 0;return rC(rC({},a),{startPoint:s,endPoint:l,pointsList:u,text:c})}(t,n)),this.lf.graphModel.addEdge(f(f({},u),{sourceNodeId:s,targetNodeId:l}))},t.prototype.init=function(){var t=this,e=this.lf,n=e.graphModel;n.addNodeMoveRules((function(e,o,r){if(e.isGroup){var i=t.getNodesInGroup(e);return n.moveNodes(i,o,r,!0),!0}var a=t.nodeGroupMap.get(e.id),s=t.lf.getNodeModelById(a);return!s||!s.isRestrict||function(t,e){var n=t.minX,o=t.minY,r=t.maxX,i=t.maxY,a=e.x,s=e.y,l=e.width,u=e.height;return{x:n>=a-l/2&&r<=a+l/2,y:o>=s-u/2&&i<=s+u/2}}(e.getBounds(),s)})),n.group=this,e.on("node:add,node:drop,node:dnd-add",this.addNodeToGroup),e.on("node:delete",this.removeNodeFromGroup),e.on("node:drag,node:dnd-drag",this.setActiveGroup),e.on("node:click",this.onNodeSelect),e.on("graph:rendered",this.onGraphRendered),e.on("graph:updated",(function(t){var e=t.data;return console.log("data",e)})),e.on("group:add-node",(function(t){var e=t.data;return console.log("group:add-node",e)})),e.addElements=function(n,o){var r=n.nodes,i=n.edges;void 0===o&&(o=40);var a={},s={nodes:[],edges:[]},l=[];return oh(r,(function(n){var r=n.id,i=n.children,u=g(n,["children"]),c=e.addNode(u);if(r&&(a[r]=c.id),s.nodes.push(c),c.isGroup){var d=t.initGroupChildNodes(a,i,c,o).edgesData;l.push.apply(l,x([],_(d),!1))}})),oh(l,(function(e){t.createEdge(e,a,o)})),console.log("selectedEdges ---\x3e>>",i),oh(i,(function(e){s.edges.push(t.createEdge(e,a,o))})),s},this.render()},t.prototype.render=function(){},t.prototype.destroy=function(){this.lf.off("node:add,node:drop,node:dnd-add",this.addNodeToGroup),this.lf.off("node:delete",this.removeNodeFromGroup),this.lf.off("node:drag,node:dnd-drag",this.setActiveGroup),this.lf.off("node:click",this.onNodeSelect),this.lf.off("graph:rendered",this.onGraphRendered)},t.pluginName="dynamicGroup",t}();!function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}($O||($O={}));var eT=function(t,e,n,o){return void 0===o&&(o=0),rT(t,e,n)<=o};function nT(t){return t*t}function oT(t,e){return nT(t.x-e.x)+nT(t.y-e.y)}var rT=function(t,e,n){return Math.sqrt(function(t,e,n){var o=oT(e,n);if(0===o)return oT(t,e);var r=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/o;return r=Math.max(0,Math.min(1,r)),oT(t,{x:e.x+r*(n.x-e.x),y:e.y+r*(n.y-e.y)})}(t,e,n))},iT=function(t,e,n){var o=function(t){var e=t.x,n=t.y,o=t.width,r=t.height;return{minX:e-o/2,minY:n-r/2,maxX:e+o/2,maxY:n+r/2,x:e,y:n,width:o,height:r,centerX:e,centerY:n}}(t),r=function(t,e){var n;return t.x===e.x?n=$O.VERTICAL:t.y===e.y&&(n=$O.HORIZONTAL),n}(e,n),i=Math.max(e.x,n.x),a=Math.min(e.x,n.x),s=Math.max(e.y,n.y),l=Math.min(e.y,n.y),u=t.x,c=t.y,d=t.width,p=t.height;if(r===$O.HORIZONTAL){if(i>=o.maxX&&a<=o.minX)return{startCrossPoint:{x:e.x>n.x?u+d/2:u-d/2,y:e.y},endCrossPoint:{x:e.x>n.x?u-d/2:u+d/2,y:e.y}}}else if(r===$O.VERTICAL&&s>=o.maxY&&l<=o.minY)return{startCrossPoint:{x:e.x,y:e.y>n.y?c+p/2:c-p/2},endCrossPoint:{x:e.x,y:e.y>n.y?c-p/2:c+p/2}}},aT=function(t,e,n){void 0===n&&(n=0);for(var o=t.x,r=t.y,i=e.pointsList,a=0;a<i.length-1;a++)if(eT({x:o,y:r},i[a],i[a+1],n)){var s=iT(t,i[a],i[a+1]);if(s)return{crossIndex:a+1,crossPoints:s}}return{crossIndex:-1,crossPoints:{startCrossPoint:{x:0,y:0},endCrossPoint:{x:0,y:0}}}},sT=function(){function t(t){var e=t.lf;this._lf=e,this.deviation=20,this.dndAdd=!0,this.dropAdd=!0,this.eventHandler()}return t.prototype.eventHandler=function(){var t=this;this.dndAdd&&this._lf.on("node:dnd-add",(function(e){var n=e.data;t.insetNode(n)})),this.dropAdd&&this._lf.on("node:drop",(function(e){for(var n=e.data,o=t._lf.graphModel.edges,r=n.id,i=!0,a=0;a<o.length;a++)if(o[a].sourceNodeId===r||o[a].targetNodeId===r){i=!1;break}i&&t.insetNode(n)}))},t.prototype.checkRuleBeforeInsetNode=function(t,e,n,o,r){var i=this._lf.getNodeModelById(t),a=this._lf.getNodeModelById(e),s=i.getAnchorInfo(n),l=a.getAnchorInfo(o),u=i.isAllowConnectedAsSource(r,s,l),c=a.isAllowConnectedAsTarget(r,s,l),d=qb(u),p=d.isAllPass,h=d.msg,f=qb(c),g=f.isAllPass;return{isPass:p&&g,sourceMsg:h,targetMsg:f.msg}},t.prototype.insetNode=function(t){var e=this,n=this._lf.graphModel.edges,o=this._lf.getNodeModelById(t.id),r=null==o?void 0:o.getDefaultAnchor();if(!r||0===r.length)this._lf.graphModel.eventCenter.emit(Om.CONNECTION_NOT_ALLOWED,{data:t,msg:"自定义类型节点不显示锚点,也不允许其他节点连接到此节点"});else if(o)for(var i=0;i<n.length;i++){var a=aT(o,n[i],this.deviation),s=a.crossIndex,l=a.crossPoints;if(s>=0){var u=n[i],c=u.sourceNodeId,d=u.targetNodeId,p=u.id,h=u.type,f=u.pointsList,g=u.sourceAnchorId,v=u.targetAnchorId,y=_d(f[0]),m=_d(l.startCrossPoint);this._lf.deleteEdge(p);var b=this.checkRuleBeforeInsetNode(c,d,g,v,t);if(this._lf.addEdge({type:h,sourceNodeId:c,targetNodeId:t.id,startPoint:y,endPoint:m,pointsList:x(x([],_(f.slice(0,s)),!1),[l.startCrossPoint],!1)}),this._lf.addEdge({type:h,sourceNodeId:t.id,targetNodeId:d,startPoint:_d(l.endCrossPoint),endPoint:_d(f[f.length-1]),pointsList:x([l.endCrossPoint],_(f.slice(s)),!1)}),b.isPass)break;this._lf.graphModel.eventCenter.emit(Om.CONNECTION_NOT_ALLOWED,{data:t,msg:b.targetMsg||b.sourceMsg}),setTimeout((function(){e._lf.undo()}),200);break}}},t.pluginName="insertNodeInPolyline",t}(),lT=function(t){function e(e){var n=t.call(this,e)||this;n.textRef={current:null},n.setHoverOn=function(){var t=n.props.element;t.isDragging||n.state.isHovered||(n.setState({isHovered:!0}),t.setHovered(!0))},n.setHoverOff=function(){var t=n.props.element;n.state.isHovered&&(n.setState({isHovered:!1}),t.setHovered(!1))},n.handleMouseDown=function(t){var e,o=n.props,r=o.label,i=o.graphModel.editConfigModel.nodeTextDraggable;(null!==(e=r.draggable)&&void 0!==e?e:i)&&!n.state.isDragging&&(n.setState({isDragging:!0}),n.stepDrag.handleMouseDown(t))},n.handleDragging=function(t){var e=t.deltaX,o=t.deltaY,r=n.props,i=r.label,a=r.element,s=r.graphModel,l=_(s.transformModel.fixDeltaXY(e,o),2),u=l[0],c=l[1],d=a.properties._label,p=Mh(d,(function(t){return t.id===i.id})),h=d[p];d[p]=f(f({},h),{x:h.x+u,y:h.y+c});var g=s.getElement(a.id);null==g||g.setProperty("_label",d),s.eventCenter.emit("label:drag",{data:i.getData(),model:i})},n.handleDragEnd=function(){n.setState({isDragging:!1})},n.handleDbClick=function(t){var e=n.props,o=e.label,r=e.element;if(e.graphModel.eventCenter.emit("label:dblclick",{data:o.getData(),e:t,model:r}),o.editable){if(r.setSelected(),r.setElementState(Sm.TEXT_EDIT),n.setState({isEditing:!0}),n.textRef.current){n.textRef.current.contentEditable="true",n.textRef.current.focus();var i=document.createRange(),a=window.getSelection();i.selectNodeContents(n.textRef.current),i.collapse(!1),null==a||a.removeAllRanges(),null==a||a.addRange(i)}}else r.setSelected(!0)},n.handleBlur=function(t){var e=n.props,o=e.label,r=e.element;e.graphModel.eventCenter.emit("label:blur",{e:t,model:r,data:o.getData(),element:n.textRef.current}),n.setState({isDragging:!1,isHovered:!1})},n.reCalcLabelSize=function(){};var o=e.label,r=e.graphModel,i=r.gridSize,a=r.eventCenter;return n.stepDrag=new Dm({onDragging:n.handleDragging,onDragEnd:n.handleDragEnd,step:i,eventType:"LABEL",model:o,eventCenter:a}),n.state={isEditing:!1,isHovered:!1,isDragging:!1},n}return h(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props,n=e.label,o=e.element,r=e.graphModel;r.eventCenter.on("blank:click,node:click,edge:click",(function(){var e,i,a,s;if(t.state.isEditing){t.setState({isEditing:!1});var l=null!==(i=null===(e=t.textRef.current)||void 0===e?void 0:e.innerText)&&void 0!==i?i:"",u=null!==(s=null===(a=t.textRef.current)||void 0===a?void 0:a.innerHTML)&&void 0!==s?s:"",c=o.properties._label,d=Mh(c,(function(t){return t.id===n.id})),p=c[d];c[d]=f(f({},p),{value:l,content:u});var h=r.getElement(o.id);null==h||h.setProperty("_label",c),o.setElementState(Sm.DEFAULT)}t.textRef.current&&(t.textRef.current.contentEditable="false")}))},e.prototype.componentDidUpdate=function(){console.log("Label componentDidUpdate")},e.prototype.componentWillUnmount=function(){this.props.graphModel.eventCenter.off("blank:click,node:click,edge:click")},e.prototype.render=function(){var t,e=this.props,n=e.label,o=e.element,r=e.graphModel,i=this.state,a=i.isDragging,s=i.isHovered,l=i.isEditing,u=r.transformModel.getTransformStyle().transform,c=n.id,d=n.x,p=n.y,h=n.zIndex,g=n.vertical,v=n.style,y=n.rotate,m=n.content,b=n.labelWidth,_=n.textOverflowMode,x=null!=b?b:"node"===o.BaseType?o.width-20:80,E={left:"".concat(d-x/2,"px"),top:"".concat(p-10,"px"),width:"".concat(x,"px"),height:"20px",zIndex:null!=h?h:1,transform:y?"".concat(u," rotate(").concat(y,"deg)"):"".concat(u," rotate(").concat(g?-.25:0,"turn)")};return xr("div",{id:"element-container-".concat(c),className:yw("lf-label-editor-container"),style:E,onMouseDown:this.handleMouseDown,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:xr("div",{ref:this.textRef,id:"editor-container-".concat(c),className:yw("lf-label-editor",(t={"lf-label-editor-dragging":a,"lf-label-editor-editing":l,"lf-label-editor-hover":!l&&s},t["lf-label-editor-".concat(_)]=!l,t)),style:f({maxWidth:"".concat(x,"px"),width:"".concat(x,"px")},v),dangerouslySetInnerHTML:{__html:m}})})},e=v([yC],e)}(ho),uT=g_,cT=function(){function t(t,e,n){var o;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=e,this.graphModel=n,this.id=null!==(o=t.id)&&void 0!==o?o:uT(),this.initLabelData(t)}return t.prototype.initLabelData=function(t){Ys(this,t)},t.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,content:this.content,value:this.value,rotate:this.rotate,style:en(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},v([mt],t.prototype,"x",void 0),v([mt],t.prototype,"y",void 0),v([mt],t.prototype,"content",void 0),v([mt],t.prototype,"value",void 0),v([mt],t.prototype,"rotate",void 0),v([mt],t.prototype,"style",void 0),v([mt],t.prototype,"zIndex",void 0),v([mt],t.prototype,"vertical",void 0),v([mt],t.prototype,"editable",void 0),v([mt],t.prototype,"draggable",void 0),v([mt],t.prototype,"labelWidth",void 0),v([mt],t.prototype,"textOverflowMode",void 0),t}(),dT={},pT={get exports(){return dT},set exports(t){dT=t}};!function(t){
|
|
32
32
|
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
|
|
33
33
|
"classList"in document.createElement("_")||function(t){if("Element"in t){var e="classList",n="prototype",o=t.Element[n],r=Object,i=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},a=Array[n].indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1},s=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},l=function(t,e){if(""===e)throw new s("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new s("INVALID_CHARACTER_ERR","String contains an invalid character");return a.call(t,e)},u=function(t){for(var e=i.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],o=0,r=n.length;o<r;o++)this.push(n[o]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},c=u[n]=[],d=function(){return new u(this)};if(s[n]=Error[n],c.item=function(t){return this[t]||null},c.contains=function(t){return-1!==l(this,t+="")},c.add=function(){var t,e=arguments,n=0,o=e.length,r=!1;do{-1===l(this,t=e[n]+"")&&(this.push(t),r=!0)}while(++n<o);r&&this._updateClassName()},c.remove=function(){var t,e,n=arguments,o=0,r=n.length,i=!1;do{for(e=l(this,t=n[o]+"");-1!==e;)this.splice(e,1),i=!0,e=l(this,t)}while(++o<r);i&&this._updateClassName()},c.toggle=function(t,e){t+="";var n=this.contains(t),o=n?!0!==e&&"remove":!1!==e&&"add";return o&&this[o](t),!0===e||!1===e?e:!n},c.toString=function(){return this.join(" ")},r.defineProperty){var p={get:d,enumerable:!0,configurable:!0};try{r.defineProperty(o,e,p)}catch(t){-2146823252===t.number&&(p.enumerable=!1,r.defineProperty(o,e,p))}}else r[n].__defineGetter__&&o.__defineGetter__(e,d)}}(self)
|
|
34
|
-
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */,function(t){if(t.URL=t.URL||t.webkitURL,t.Blob&&t.URL)try{return void new Blob}catch(t){}var e=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||function(t){var e=function(t){return Object.prototype.toString.call(t).match(/^\[object\s(.*)\]$/)[1]},n=function(){this.data=[]},o=function(t,e,n){this.data=t,this.size=t.length,this.type=e,this.encoding=n},r=n.prototype,i=o.prototype,a=t.FileReaderSync,s=function(t){this.code=this[this.name=t]},l="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),u=l.length,c=t.URL||t.webkitURL||t,d=c.createObjectURL,p=c.revokeObjectURL,h=c,f=t.btoa,g=t.atob,v=t.ArrayBuffer,y=t.Uint8Array,m=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(o.fake=i.fake=!0;u--;)s.prototype[l[u]]=u+1;return c.createObjectURL||(h=t.URL=function(t){var e,n=document.createElementNS("http://www.w3.org/1999/xhtml","a");return n.href=t,"origin"in n||("data:"===n.protocol.toLowerCase()?n.origin=null:(e=t.match(m),n.origin=e&&e[1])),n}),h.createObjectURL=function(t){var e,n=t.type;return null===n&&(n="application/octet-stream"),t instanceof o?(e="data:"+n,"base64"===t.encoding?e+";base64,"+t.data:"URI"===t.encoding?e+","+decodeURIComponent(t.data):f?e+";base64,"+f(t.data):e+","+encodeURIComponent(t.data)):d?d.call(c,t):void 0},h.revokeObjectURL=function(t){"data:"!==t.substring(0,5)&&p&&p.call(c,t)},r.append=function(t){var n=this.data;if(y&&(t instanceof v||t instanceof y)){for(var r="",i=new y(t),l=0,u=i.length;l<u;l++)r+=String.fromCharCode(i[l]);n.push(r)}else if("Blob"===e(t)||"File"===e(t)){if(!a)throw new s("NOT_READABLE_ERR");var c=new a;n.push(c.readAsBinaryString(t))}else t instanceof o?"base64"===t.encoding&&g?n.push(g(t.data)):"URI"===t.encoding?n.push(decodeURIComponent(t.data)):"raw"===t.encoding&&n.push(t.data):("string"!=typeof t&&(t+=""),n.push(unescape(encodeURIComponent(t))))},r.getBlob=function(t){return arguments.length||(t=null),new o(this.data.join(""),t,"raw")},r.toString=function(){return"[object BlobBuilder]"},i.slice=function(t,e,n){var r=arguments.length;return r<3&&(n=null),new o(this.data.slice(t,r>1?e:this.data.length),n,this.encoding)},i.toString=function(){return"[object Blob]"},i.close=function(){this.size=0,delete this.data},n}(t);t.Blob=function(t,n){var o=n&&n.type||"",r=new e;if(t)for(var i=0,a=t.length;i<a;i++)Uint8Array&&t[i]instanceof Uint8Array?r.append(t[i].buffer):r.append(t[i]);var s=r.getBlob(o);return!s.slice&&s.webkitSlice&&(s.slice=s.webkitSlice),s};var n=Object.getPrototypeOf||function(t){return t.__proto__};t.Blob.prototype=n(new t.Blob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||E.content||E),function(e,n){"undefined"!=typeof process&&process&&process.versions&&process.versions.electron?e.MediumEditor=n:t.exports=n}(E,function(){function t(t,e){return this.init(t,e)}var e,n,o,r,i,a,s,l,u,c,d;return t.extensions={},function(e){function n(t,e){var n,o=Array.prototype.slice.call(arguments,2);e=e||{};for(var r=0;r<o.length;r++){var i=o[r];if(i)for(n in i)i.hasOwnProperty(n)&&void 0!==i[n]&&(t||!1===e.hasOwnProperty(n))&&(e[n]=i[n])}return e}var o=!1;try{var r=document.createElement("div"),i=document.createTextNode(" ");r.appendChild(i),o=r.contains(i)}catch(t){}var a={isIE:"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&null!==new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent),isEdge:null!==/Edge\/\d+/.exec(navigator.userAgent),isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:e.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(t){return!!(a.isMac&&t.metaKey||!a.isMac&&t.ctrlKey)},isKey:function(t,e){var n=a.getKeyCode(t);return!1===Array.isArray(e)?n===e:-1!==e.indexOf(n)},getKeyCode:function(t){var e=t.which;return null===e&&(e=null!==t.charCode?t.charCode:t.keyCode),e},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var t=[!0].concat(Array.prototype.slice.call(arguments));return n.apply(this,t)},defaults:function(){var t=[!1].concat(Array.prototype.slice.call(arguments));return n.apply(this,t)},createLink:function(t,e,n,o){var r=t.createElement("a");return a.moveTextRangeIntoElement(e[0],e[e.length-1],r),r.setAttribute("href",n),o&&("_blank"===o&&r.setAttribute("rel","noopener noreferrer"),r.setAttribute("target",o)),r},findOrCreateMatchingTextNodes:function(t,e,n){for(var o=t.createTreeWalker(e,NodeFilter.SHOW_ALL,null,!1),r=[],i=0,s=!1,l=null,u=null;null!==(l=o.nextNode());)if(!(l.nodeType>3))if(3===l.nodeType){if(!s&&n.start<i+l.nodeValue.length&&(s=!0,u=a.splitStartNodeIfNeeded(l,n.start,i)),s&&a.splitEndNodeIfNeeded(l,u,n.end,i),s&&i===n.end)break;if(s&&i>n.end+1)throw new Error("PerformLinking overshot the target!");s&&r.push(u||l),i+=l.nodeValue.length,null!==u&&(i+=u.nodeValue.length,o.nextNode()),u=null}else"img"===l.tagName.toLowerCase()&&(!s&&n.start<=i&&(s=!0),s&&r.push(l));return r},splitStartNodeIfNeeded:function(t,e,n){return e!==n?t.splitText(e-n):null},splitEndNodeIfNeeded:function(t,e,n,o){var r,i;r=o+t.nodeValue.length+(e?e.nodeValue.length:0)-1,i=n-o-(e?t.nodeValue.length:0),r>=n&&o!==r&&0!==i&&(e||t).splitText(i)},splitByBlockElements:function(e){if(3!==e.nodeType&&1!==e.nodeType)return[];var n=[],o=t.util.blockContainerElementNames.join(",");if(3===e.nodeType||0===e.querySelectorAll(o).length)return[e];for(var r=0;r<e.childNodes.length;r++){var i=e.childNodes[r];if(3===i.nodeType)n.push(i);else if(1===i.nodeType){0===i.querySelectorAll(o).length?n.push(i):n=n.concat(t.util.splitByBlockElements(i))}}return n},findAdjacentTextNodeWithContent:function(t,e,n){var o,r=!1,i=n.createNodeIterator(t,NodeFilter.SHOW_TEXT,null,!1);for(o=i.nextNode();o;){if(o===e)r=!0;else if(r&&3===o.nodeType&&o.nodeValue&&o.nodeValue.trim().length>0)break;o=i.nextNode()}return o},findPreviousSibling:function(t){if(!t||a.isMediumEditorElement(t))return!1;for(var e=t.previousSibling;!e&&!a.isMediumEditorElement(t.parentNode);)e=(t=t.parentNode).previousSibling;return e},isDescendant:function(t,e,n){if(!t||!e)return!1;if(t===e)return!!n;if(1!==t.nodeType)return!1;if(o||3!==e.nodeType)return t.contains(e);for(var r=e.parentNode;null!==r;){if(r===t)return!0;r=r.parentNode}return!1},isElement:function(t){return!(!t||1!==t.nodeType)},throttle:function(t,e){var n,o,r,i=null,a=0,s=function(){a=Date.now(),i=null,r=t.apply(n,o),i||(n=o=null)};return e||0===e||(e=50),function(){var l=Date.now(),u=e-(l-a);return n=this,o=arguments,u<=0||u>e?(i&&(clearTimeout(i),i=null),a=l,r=t.apply(n,o),i||(n=o=null)):i||(i=setTimeout(s,u)),r}},traverseUp:function(t,e){if(!t)return!1;do{if(1===t.nodeType){if(e(t))return t;if(a.isMediumEditorElement(t))return!1}t=t.parentNode}while(t);return!1},htmlEntities:function(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},insertHTMLCommand:function(e,n){var o,r,i,s,l,u,c,d=!1,p=["insertHTML",!1,n];if(!t.util.isEdge&&e.queryCommandSupported("insertHTML"))try{return e.execCommand.apply(e,p)}catch(t){}if((o=e.getSelection()).rangeCount){if(c=(r=o.getRangeAt(0)).commonAncestorContainer,a.isMediumEditorElement(c)&&!c.firstChild)r.selectNode(c.appendChild(e.createTextNode("")));else if(3===c.nodeType&&0===r.startOffset&&r.endOffset===c.nodeValue.length||3!==c.nodeType&&c.innerHTML===r.toString()){for(;!a.isMediumEditorElement(c)&&c.parentNode&&1===c.parentNode.childNodes.length&&!a.isMediumEditorElement(c.parentNode);)c=c.parentNode;r.selectNode(c)}for(r.deleteContents(),(i=e.createElement("div")).innerHTML=n,s=e.createDocumentFragment();i.firstChild;)l=i.firstChild,u=s.appendChild(l);r.insertNode(s),u&&((r=r.cloneRange()).setStartAfter(u),r.collapse(!0),t.selection.selectRange(e,r)),d=!0}return e.execCommand.callListeners&&e.execCommand.callListeners(p,d),d},execFormatBlock:function(e,n){var o=a.getTopBlockContainer(t.selection.getSelectionStart(e));if("blockquote"===n){if(o&&Array.prototype.slice.call(o.childNodes).some((function(t){return a.isBlockContainer(t)})))return e.execCommand("outdent",!1,null);if(a.isIE)return e.execCommand("indent",!1,n)}if(o&&n===o.nodeName.toLowerCase()&&(n="p"),a.isIE&&(n="<"+n+">"),o&&"blockquote"===o.nodeName.toLowerCase()){if(a.isIE&&"<p>"===n)return e.execCommand("outdent",!1,n);if((a.isFF||a.isEdge)&&"p"===n)return Array.prototype.slice.call(o.childNodes).some((function(t){return!a.isBlockContainer(t)}))&&e.execCommand("formatBlock",!1,n),e.execCommand("outdent",!1,n)}return e.execCommand("formatBlock",!1,n)},setTargetBlank:function(t,e){var n,o=e||!1;if("a"===t.nodeName.toLowerCase())t.target="_blank",t.rel="noopener noreferrer";else for(t=t.getElementsByTagName("a"),n=0;n<t.length;n+=1)!1!==o&&o!==t[n].attributes.href.value||(t[n].target="_blank",t[n].rel="noopener noreferrer")},removeTargetBlank:function(t,e){var n;if("a"===t.nodeName.toLowerCase())t.removeAttribute("target"),t.removeAttribute("rel");else for(t=t.getElementsByTagName("a"),n=0;n<t.length;n+=1)e===t[n].attributes.href.value&&(t[n].removeAttribute("target"),t[n].removeAttribute("rel"))},addClassToAnchors:function(t,e){var n,o,r=e.split(" ");if("a"===t.nodeName.toLowerCase())for(o=0;o<r.length;o+=1)t.classList.add(r[o]);else{var i=t.getElementsByTagName("a");if(0===i.length){var s=a.getClosestTag(t,"a");t=s?[s]:[]}else t=i;for(n=0;n<t.length;n+=1)for(o=0;o<r.length;o+=1)t[n].classList.add(r[o])}},isListItem:function(t){if(!t)return!1;if("li"===t.nodeName.toLowerCase())return!0;for(var e=t.parentNode,n=e.nodeName.toLowerCase();"li"===n||!a.isBlockContainer(e)&&"div"!==n;){if("li"===n)return!0;if(!(e=e.parentNode))return!1;n=e.nodeName.toLowerCase()}return!1},cleanListDOM:function(e,n){if("li"===n.nodeName.toLowerCase()){var o=n.parentElement;"p"===o.parentElement.nodeName.toLowerCase()&&(a.unwrap(o.parentElement,e),t.selection.moveCursor(e,n.firstChild,n.firstChild.textContent.length))}},splitOffDOMTree:function(t,e,n){for(var o=e,r=null,i=!n;o!==t;){var a,s=o.parentNode,l=s.cloneNode(!1),u=i?o:s.firstChild;for(r&&(i?l.appendChild(r):a=r),r=l;u;){var c=u.nextSibling;u===o?(u.hasChildNodes()?u=u.cloneNode(!1):u.parentNode.removeChild(u),u.textContent&&r.appendChild(u),u=i?c:null):(u.parentNode.removeChild(u),(u.hasChildNodes()||u.textContent)&&r.appendChild(u),u=c)}a&&r.appendChild(a),o=s}return r},moveTextRangeIntoElement:function(t,e,n){if(!t||!e)return!1;var o=a.findCommonRoot(t,e);if(!o)return!1;if(e===t){var r=t.parentNode,i=t.nextSibling;return r.removeChild(t),n.appendChild(t),i?r.insertBefore(n,i):r.appendChild(n),n.hasChildNodes()}for(var s,l,u,c=[],d=0;d<o.childNodes.length;d++)if(u=o.childNodes[d],s){if(a.isDescendant(u,e,!0)){l=u;break}c.push(u)}else a.isDescendant(u,t,!0)&&(s=u);var p=l.nextSibling,h=o.ownerDocument.createDocumentFragment();return s===t?(s.parentNode.removeChild(s),h.appendChild(s)):h.appendChild(a.splitOffDOMTree(s,t)),c.forEach((function(t){t.parentNode.removeChild(t),h.appendChild(t)})),l===e?(l.parentNode.removeChild(l),h.appendChild(l)):h.appendChild(a.splitOffDOMTree(l,e,!0)),n.appendChild(h),l.parentNode===o?o.insertBefore(n,l):p?o.insertBefore(n,p):o.appendChild(n),n.hasChildNodes()},depthOfNode:function(t){for(var e=0,n=t;null!==n.parentNode;)n=n.parentNode,e++;return e},findCommonRoot:function(t,e){for(var n=a.depthOfNode(t),o=a.depthOfNode(e),r=t,i=e;n!==o;)n>o?(r=r.parentNode,n-=1):(i=i.parentNode,o-=1);for(;r!==i;)r=r.parentNode,i=i.parentNode;return r},isElementAtBeginningOfBlock:function(t){for(var e;!a.isBlockContainer(t)&&!a.isMediumEditorElement(t);){for(e=t;e=e.previousSibling;)if((3===e.nodeType?e.nodeValue:e.textContent).length>0)return!1;t=t.parentNode}return!0},isMediumEditorElement:function(t){return t&&t.getAttribute&&!!t.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(t){return a.traverseUp(t,(function(t){return a.isMediumEditorElement(t)}))},isBlockContainer:function(t){return t&&3!==t.nodeType&&-1!==a.blockContainerElementNames.indexOf(t.nodeName.toLowerCase())},getClosestBlockContainer:function(t){return a.traverseUp(t,(function(t){return a.isBlockContainer(t)||a.isMediumEditorElement(t)}))},getTopBlockContainer:function(t){var e=!!a.isBlockContainer(t)&&t;return a.traverseUp(t,(function(t){return a.isBlockContainer(t)&&(e=t),!(e||!a.isMediumEditorElement(t))&&(e=t,!0)})),e},getFirstSelectableLeafNode:function(t){for(;t&&t.firstChild;)t=t.firstChild;if("table"===(t=a.traverseUp(t,(function(t){return-1===a.emptyElementNames.indexOf(t.nodeName.toLowerCase())}))).nodeName.toLowerCase()){var e=t.querySelector("th, td");e&&(t=e)}return t},getFirstTextNode:function(t){return a.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),a._getFirstTextNode(t)},_getFirstTextNode:function(t){if(3===t.nodeType)return t;for(var e=0;e<t.childNodes.length;e++){var n=a._getFirstTextNode(t.childNodes[e]);if(null!==n)return n}return null},ensureUrlHasProtocol:function(t){return-1===t.indexOf("://")?"http://"+t:t},warn:function(){void 0!==e.console&&"function"==typeof e.console.warn&&e.console.warn.apply(e.console,arguments)},deprecated:function(t,e,n){var o=t+" is deprecated, please use "+e+" instead.";n&&(o+=" Will be removed in "+n),a.warn(o)},deprecatedMethod:function(t,e,n,o){a.deprecated(t,e,o),"function"==typeof this[e]&&this[e].apply(this,n)},cleanupAttrs:function(t,e){e.forEach((function(e){t.removeAttribute(e)}))},cleanupTags:function(t,e){-1!==e.indexOf(t.nodeName.toLowerCase())&&t.parentNode.removeChild(t)},unwrapTags:function(e,n){-1!==n.indexOf(e.nodeName.toLowerCase())&&t.util.unwrap(e,document)},getClosestTag:function(t,e){return a.traverseUp(t,(function(t){return t.nodeName.toLowerCase()===e.toLowerCase()}))},unwrap:function(t,e){for(var n=e.createDocumentFragment(),o=Array.prototype.slice.call(t.childNodes),r=0;r<o.length;r++)n.appendChild(o[r]);n.childNodes.length?t.parentNode.replaceChild(n,t):t.parentNode.removeChild(t)},guid:function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}};t.util=a}(window),(e=function(e){t.util.extend(this,e)}).extend=function(e){var n,o=this;n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return o.apply(this,arguments)},t.util.extend(n,o);var r=function(){this.constructor=n};return r.prototype=o.prototype,n.prototype=new r,e&&t.util.extend(n.prototype,e),n},e.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(t){return this.base.options[t]}},["execAction","on","off","subscribe","trigger"].forEach((function(t){e.prototype[t]=function(){return this.base[t].apply(this.base,arguments)}})),t.Extension=e,function(){function e(e){return t.util.isBlockContainer(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var n={findMatchingSelectionParent:function(e,n){var o,r=n.getSelection();return 0!==r.rangeCount&&(o=r.getRangeAt(0).commonAncestorContainer,t.util.traverseUp(o,e))},getSelectionElement:function(e){return this.findMatchingSelectionParent((function(e){return t.util.isMediumEditorElement(e)}),e)},exportSelection:function(t,e){if(!t)return null;var n=null,o=e.getSelection();if(o.rangeCount>0){var r,i=o.getRangeAt(0),a=i.cloneRange();a.selectNodeContents(t),a.setEnd(i.startContainer,i.startOffset),n={start:r=a.toString().length,end:r+i.toString().length},this.doesRangeStartWithImages(i,e)&&(n.startsWithImage=!0);var s=this.getTrailingImageCount(t,n,i.endContainer,i.endOffset);if(s&&(n.trailingImageCount=s),0!==r){var l=this.getIndexRelativeToAdjacentEmptyBlocks(e,t,i.startContainer,i.startOffset);-1!==l&&(n.emptyBlocksIndex=l)}}return n},importSelection:function(t,e,n,o){if(t&&e){var r=n.createRange();r.setStart(e,0),r.collapse(!0);var i,a=e,s=[],l=0,u=!1,c=!1,d=0,p=!1,h=!1,f=null;for((o||t.startsWithImage||void 0!==t.emptyBlocksIndex)&&(h=!0);!p&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||c){if(t.trailingImageCount&&c&&("img"===a.nodeName.toLowerCase()&&d++,d===t.trailingImageCount)){for(var g=0;a.parentNode.childNodes[g]!==a;)g++;r.setEnd(a.parentNode,g+1),p=!0}if(!p&&1===a.nodeType)for(var v=a.childNodes.length-1;v>=0;)s.push(a.childNodes[v]),v-=1}else i=l+a.length,!u&&t.start>=l&&t.start<=i&&(h||t.start<i?(r.setStart(a,t.start-l),u=!0):f=a),u&&t.end>=l&&t.end<=i&&(t.trailingImageCount?c=!0:(r.setEnd(a,t.end-l),p=!0)),l=i;p||(a=s.pop())}!u&&f&&(r.setStart(f,f.length),r.setEnd(f,f.length)),void 0!==t.emptyBlocksIndex&&(r=this.importSelectionMoveCursorPastBlocks(n,e,t.emptyBlocksIndex,r)),o&&(r=this.importSelectionMoveCursorPastAnchor(t,r)),this.selectRange(n,r)}},importSelectionMoveCursorPastAnchor:function(e,n){if(e.start===e.end&&3===n.startContainer.nodeType&&n.startOffset===n.startContainer.nodeValue.length&&t.util.traverseUp(n.startContainer,(function(t){return"a"===t.nodeName.toLowerCase()}))){for(var o=n.startContainer,r=n.startContainer.parentNode;null!==r&&"a"!==r.nodeName.toLowerCase();)r.childNodes[r.childNodes.length-1]!==o?r=null:(o=r,r=r.parentNode);if(null!==r&&"a"===r.nodeName.toLowerCase()){for(var i=null,a=0;null===i&&a<r.parentNode.childNodes.length;a++)r.parentNode.childNodes[a]===r&&(i=a);n.setStart(r.parentNode,i+1),n.collapse(!0)}}return n},importSelectionMoveCursorPastBlocks:function(n,o,r,i){var a,s,l=n.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,e,!1),u=i.startContainer,c=0;for(r=r||1,a=3===u.nodeType&&t.util.isBlockContainer(u.previousSibling)?u.previousSibling:t.util.getClosestBlockContainer(u);l.nextNode();)if(s){if(s=l.currentNode,++c===r)break;if(s.textContent.length>0)break}else a===l.currentNode&&(s=l.currentNode);return s||(s=a),i.setStart(t.util.getFirstSelectableLeafNode(s),0),i},getIndexRelativeToAdjacentEmptyBlocks:function(n,o,r,i){if(r.textContent.length>0&&i>0)return-1;var a=r;if(3!==a.nodeType&&(a=r.childNodes[i]),a){if(!t.util.isElementAtBeginningOfBlock(a))return-1;var s=t.util.findPreviousSibling(a);if(!s)return-1;if(s.nodeValue)return-1}for(var l=t.util.getClosestBlockContainer(r),u=n.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,e,!1),c=0;u.nextNode();){var d=""===u.currentNode.textContent;if((d||c>0)&&(c+=1),u.currentNode===l)return c;d||(c=0)}return c},doesRangeStartWithImages:function(t,e){if(0!==t.startOffset||1!==t.startContainer.nodeType)return!1;if("img"===t.startContainer.nodeName.toLowerCase())return!0;var n=t.startContainer.querySelector("img");if(!n)return!1;for(var o=e.createTreeWalker(t.startContainer,NodeFilter.SHOW_ALL,null,!1);o.nextNode();){var r=o.currentNode;if(r===n)break;if(r.nodeValue)return!1}return!0},getTrailingImageCount:function(t,e,n,o){if(0===o||1!==n.nodeType)return 0;if("img"!==n.nodeName.toLowerCase()&&!n.querySelector("img"))return 0;for(var r=n.childNodes[o-1];r.hasChildNodes();)r=r.lastChild;for(var i,a=t,s=[],l=0,u=!1,c=!1,d=!1,p=0;!d&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||c){if("img"===a.nodeName.toLowerCase()&&p++,a===r)d=!0;else if(1===a.nodeType)for(var h=a.childNodes.length-1;h>=0;)s.push(a.childNodes[h]),h-=1}else p=0,i=l+a.length,!u&&e.start>=l&&e.start<=i&&(u=!0),u&&e.end>=l&&e.end<=i&&(c=!0),l=i;d||(a=s.pop())}return p},selectionContainsContent:function(t){var e=t.getSelection();if(!e||e.isCollapsed||!e.rangeCount)return!1;if(""!==e.toString().trim())return!0;var n=this.getSelectedParentElement(e.getRangeAt(0));return!(!n||!("img"===n.nodeName.toLowerCase()||1===n.nodeType&&n.querySelector("img")))},selectionInContentEditableFalse:function(t){var e,n=this.findMatchingSelectionParent((function(t){var n=t&&t.getAttribute("contenteditable");return"true"===n&&(e=!0),"#text"!==t.nodeName&&"false"===n}),t);return!e&&n},getSelectionHtml:function(t){var e,n,o,r="",i=t.getSelection();if(i.rangeCount){for(o=t.createElement("div"),e=0,n=i.rangeCount;e<n;e+=1)o.appendChild(i.getRangeAt(e).cloneContents());r=o.innerHTML}return r},getCaretOffsets:function(t,e){var n,o;return e||(e=window.getSelection().getRangeAt(0)),n=e.cloneRange(),o=e.cloneRange(),n.selectNodeContents(t),n.setEnd(e.endContainer,e.endOffset),o.selectNodeContents(t),o.setStart(e.endContainer,e.endOffset),{left:n.toString().length,right:o.toString().length}},rangeSelectsSingleNode:function(t){var e=t.startContainer;return e===t.endContainer&&e.hasChildNodes()&&t.endOffset===t.startOffset+1},getSelectedParentElement:function(t){return t?this.rangeSelectsSingleNode(t)&&3!==t.startContainer.childNodes[t.startOffset].nodeType?t.startContainer.childNodes[t.startOffset]:3===t.startContainer.nodeType?t.startContainer.parentNode:t.startContainer:null},getSelectedElements:function(t){var e,n,o,r=t.getSelection();if(!r.rangeCount||r.isCollapsed||!r.getRangeAt(0).commonAncestorContainer)return[];if(3===(e=r.getRangeAt(0)).commonAncestorContainer.nodeType){for(n=[],o=e.commonAncestorContainer;o.parentNode&&1===o.parentNode.childNodes.length;)n.push(o.parentNode),o=o.parentNode;return n}return[].filter.call(e.commonAncestorContainer.getElementsByTagName("*"),(function(t){return"function"!=typeof r.containsNode||r.containsNode(t,!0)}))},selectNode:function(t,e){var n=e.createRange();n.selectNodeContents(t),this.selectRange(e,n)},select:function(t,e,n,o,r){var i=t.createRange();return i.setStart(e,n),o?i.setEnd(o,r):i.collapse(!0),this.selectRange(t,i),i},clearSelection:function(t,e){e?t.getSelection().collapseToStart():t.getSelection().collapseToEnd()},moveCursor:function(t,e,n){this.select(t,e,n)},getSelectionRange:function(t){var e=t.getSelection();return 0===e.rangeCount?null:e.getRangeAt(0)},selectRange:function(t,e){var n=t.getSelection();n.removeAllRanges(),n.addRange(e)},getSelectionStart:function(t){var e=t.getSelection().anchorNode;return e&&3===e.nodeType?e.parentNode:e}};t.selection=n}(),function(){function e(e,n){return!!e&&e.some((function(e){if("function"!=typeof e.getInteractionElements)return!1;var o=e.getInteractionElements();return!!o&&(Array.isArray(o)||(o=[o]),o.some((function(e){return t.util.isDescendant(e,n,!0)})))}))}var n=function(t){this.base=t,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};n.prototype={InputEventOnContenteditableSupported:!t.util.isIE&&!t.util.isEdge,attachDOMEvent:function(e,n,o,r){var i=this.base.options.contentWindow,a=this.base.options.ownerDocument;e=t.util.isElement(e)||[i,a].indexOf(e)>-1?[e]:e,Array.prototype.forEach.call(e,function(t){t.addEventListener(n,o,r),this.events.push([t,n,o,r])}.bind(this))},detachDOMEvent:function(e,n,o,r){var i,a,s=this.base.options.contentWindow,l=this.base.options.ownerDocument;e&&(e=t.util.isElement(e)||[s,l].indexOf(e)>-1?[e]:e,Array.prototype.forEach.call(e,function(t){-1!==(i=this.indexOfListener(t,n,o,r))&&(a=this.events.splice(i,1)[0])[0].removeEventListener(a[1],a[2],a[3])}.bind(this)))},indexOfListener:function(t,e,n,o){var r,i,a;for(r=0,i=this.events.length;r<i;r+=1)if((a=this.events[r])[0]===t&&a[1]===e&&a[2]===n&&a[3]===o)return r;return-1},detachAllDOMEvents:function(){for(var t=this.events.pop();t;)t[0].removeEventListener(t[1],t[2],t[3]),t=this.events.pop()},detachAllEventsFromElement:function(t){for(var e=this.events.filter((function(e){return e&&e[0].getAttribute&&e[0].getAttribute("medium-editor-index")===t.getAttribute("medium-editor-index")})),n=0,o=e.length;n<o;n++){var r=e[n];this.detachDOMEvent(r[0],r[1],r[2],r[3])}},attachAllEventsToElement:function(t){this.listeners.editableInput&&(this.contentCache[t.getAttribute("medium-editor-index")]=t.innerHTML),this.eventsCache&&this.eventsCache.forEach((function(e){this.attachDOMEvent(t,e.name,e.handler.bind(this))}),this)},enableCustomEvent:function(t){void 0!==this.disabledEvents[t]&&delete this.disabledEvents[t]},disableCustomEvent:function(t){this.disabledEvents[t]=!0},attachCustomEvent:function(t,e){this.setupListener(t),this.customEvents[t]||(this.customEvents[t]=[]),this.customEvents[t].push(e)},detachCustomEvent:function(t,e){var n=this.indexOfCustomListener(t,e);-1!==n&&this.customEvents[t].splice(n,1)},indexOfCustomListener:function(t,e){return this.customEvents[t]&&this.customEvents[t].length?this.customEvents[t].indexOf(e):-1},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(t,e,n){this.customEvents[t]&&!this.disabledEvents[t]&&this.customEvents[t].forEach((function(t){t(e,n)}))},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach((function(t){t.removeAttribute("data-medium-focused")}))},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=function(t){this.handleDocumentExecCommand(t)}.bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var t=this.options.ownerDocument;if(this.execCommandListener&&t.execCommand.listeners){var e=t.execCommand.listeners.indexOf(this.execCommandListener);-1!==e&&t.execCommand.listeners.splice(e,1),t.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var t=this.options.ownerDocument;if(!t.execCommand.listeners){var e=function(e,n){t.execCommand.listeners&&t.execCommand.listeners.forEach((function(t){t({command:e[0],value:e[2],args:e,result:n})}))},n=function(){var n=t.execCommand.orig.apply(this,arguments);if(!t.execCommand.listeners)return n;var o=Array.prototype.slice.call(arguments);return e(o,n),n};n.orig=t.execCommand,n.listeners=[],n.callListeners=e,t.execCommand=n}},unwrapExecCommand:function(){var t=this.options.ownerDocument;t.execCommand.orig&&(t.execCommand=t.execCommand.orig)},setupListener:function(t){if(!this.listeners[t]){switch(t){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach((function(t){this.contentCache[t.getAttribute("medium-editor-index")]=t.innerHTML}),this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":case"editableKeydownEnter":case"editableKeydownTab":case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste)}this.listeners[t]=!0}},attachToEachElement:function(t,e){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach((function(n){this.attachDOMEvent(n,t,e.bind(this))}),this),this.eventsCache.push({name:t,handler:e})},cleanupElement:function(t){var e=t.getAttribute("medium-editor-index");e&&(this.detachAllEventsFromElement(t),this.contentCache&&delete this.contentCache[e])},focusElement:function(t){t.focus(),this.updateFocus(t,{target:t,type:"focus"})},updateFocus:function(n,o){var r,i=this.base.getFocusedElement();i&&"click"===o.type&&this.lastMousedownTarget&&(t.util.isDescendant(i,this.lastMousedownTarget,!0)||e(this.base.extensions,this.lastMousedownTarget))&&(r=i),r||this.base.elements.some((function(e){return!r&&t.util.isDescendant(e,n,!0)&&(r=e),!!r}),this);var a=!t.util.isDescendant(i,n,!0)&&!e(this.base.extensions,n);r!==i&&(i&&a&&(i.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",o,i)),r&&(r.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",o,r))),a&&this.triggerCustomEvent("externalInteraction",o)},updateInput:function(t,e){if(this.contentCache){var n=t.getAttribute("medium-editor-index"),o=t.innerHTML;o!==this.contentCache[n]&&this.triggerCustomEvent("editableInput",e,t),this.contentCache[n]=o}},handleDocumentSelectionChange:function(e){if(e.currentTarget&&e.currentTarget.activeElement){var n,o=e.currentTarget.activeElement;this.base.elements.some((function(e){return!!t.util.isDescendant(e,o,!0)&&(n=e,!0)}),this),n&&this.updateInput(n,{target:o,currentTarget:n})}},handleDocumentExecCommand:function(){var t=this.base.getFocusedElement();t&&this.updateInput(t,{target:t,currentTarget:t})},handleBodyClick:function(t){this.updateFocus(t.target,t)},handleBodyFocus:function(t){this.updateFocus(t.target,t)},handleBodyMousedown:function(t){this.lastMousedownTarget=t.target},handleInput:function(t){this.updateInput(t.currentTarget,t)},handleClick:function(t){this.triggerCustomEvent("editableClick",t,t.currentTarget)},handleBlur:function(t){this.triggerCustomEvent("editableBlur",t,t.currentTarget)},handleKeypress:function(t){if(this.triggerCustomEvent("editableKeypress",t,t.currentTarget),this.keypressUpdateInput){var e={target:t.target,currentTarget:t.currentTarget};setTimeout(function(){this.updateInput(e.currentTarget,e)}.bind(this),0)}},handleKeyup:function(t){this.triggerCustomEvent("editableKeyup",t,t.currentTarget)},handleMouseover:function(t){this.triggerCustomEvent("editableMouseover",t,t.currentTarget)},handleDragging:function(t){this.triggerCustomEvent("editableDrag",t,t.currentTarget)},handleDrop:function(t){this.triggerCustomEvent("editableDrop",t,t.currentTarget)},handlePaste:function(t){this.triggerCustomEvent("editablePaste",t,t.currentTarget)},handleKeydown:function(e){return this.triggerCustomEvent("editableKeydown",e,e.currentTarget),t.util.isKey(e,t.util.keyCode.SPACE)?this.triggerCustomEvent("editableKeydownSpace",e,e.currentTarget):t.util.isKey(e,t.util.keyCode.ENTER)||e.ctrlKey&&t.util.isKey(e,t.util.keyCode.M)?this.triggerCustomEvent("editableKeydownEnter",e,e.currentTarget):t.util.isKey(e,t.util.keyCode.TAB)?this.triggerCustomEvent("editableKeydownTab",e,e.currentTarget):t.util.isKey(e,[t.util.keyCode.DELETE,t.util.keyCode.BACKSPACE])?this.triggerCustomEvent("editableKeydownDelete",e,e.currentTarget):void 0}},t.Events=n}(),n=t.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(e){n.isBuiltInButton(e)?t.Extension.call(this,this.defaults[e]):t.Extension.call(this,e)},init:function(){t.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return"function"==typeof this.action?this.action(this.base.options):this.action},getAria:function(){return"function"==typeof this.aria?this.aria(this.base.options):this.aria},getTagNames:function(){return"function"==typeof this.tagNames?this.tagNames(this.base.options):this.tagNames},createButton:function(){var t=this.document.createElement("button"),e=this.contentDefault,n=this.getAria(),o=this.getEditorOption("buttonLabels");return t.classList.add("medium-editor-action"),t.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach((function(e){t.classList.add(e)})),t.setAttribute("data-action",this.getAction()),n&&(t.setAttribute("title",n),t.setAttribute("aria-label",n)),this.attrs&&Object.keys(this.attrs).forEach((function(e){t.setAttribute(e,this.attrs[e])}),this),"fontawesome"===o&&this.contentFA&&(e=this.contentFA),t.innerHTML=e,t},handleClick:function(t){t.preventDefault(),t.stopPropagation();var e=this.getAction();e&&this.execAction(e)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var t=null;return this.useQueryState&&(t=this.base.queryCommandState(this.getAction())),t},isAlreadyApplied:function(t){var e,n,o=!1,r=this.getTagNames();return!1===this.knownState||!0===this.knownState?this.knownState:(r&&r.length>0&&(o=-1!==r.indexOf(t.nodeName.toLowerCase())),!o&&this.style&&(e=this.style.value.split("|"),n=this.window.getComputedStyle(t,null).getPropertyValue(this.style.prop),e.forEach((function(t){this.knownState||((o=-1!==n.indexOf(t))||"text-decoration"!==this.style.prop)&&(this.knownState=o)}),this)),o)}}),n.isBuiltInButton=function(e){return"string"==typeof e&&t.extensions.button.prototype.defaults.hasOwnProperty(e)},t.extensions.button=n,t.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>•</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>→</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>←</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>“</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}},o=t.extensions.button.extend({init:function(){t.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return!!this.hasForm&&this.getForm().classList.contains(this.activeClass)},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var t=this.base.getExtensionByName("toolbar");t&&t.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var t=this.base.getExtensionByName("toolbar");t&&t.hideToolbarDefaultActions()},setToolbarPosition:function(){var t=this.base.getExtensionByName("toolbar");t&&t.setToolbarPosition()}}),t.extensions.form=o,r=t.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){t.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(e){e.preventDefault(),e.stopPropagation();var n=t.selection.getSelectionRange(this.document);return"a"===n.startContainer.nodeName.toLowerCase()||"a"===n.endContainer.nodeName.toLowerCase()||t.util.getClosestTag(t.selection.getSelectedParentElement(n),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(e){t.util.isKey(e,t.util.keyCode.K)&&t.util.isMetaCtrlKey(e)&&!e.shiftKey&&this.handleClick(e)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var t=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return t.push('<a href="#" class="medium-editor-toolbar-save">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),t.push('<a href="#" class="medium-editor-toolbar-close">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&t.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&t.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),t.join("")},isDisplayed:function(){return t.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){t.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(e){var n=this.getInput(),o=this.getAnchorTargetCheckbox(),r=this.getAnchorButtonCheckbox();if("string"==typeof(e=e||{value:""})&&(e={value:e}),this.base.saveSelection(),this.hideToolbarDefaultActions(),t.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),n.value=e.value,n.focus(),o&&(o.checked="_blank"===e.target),r){var i=e.buttonClass?e.buttonClass.split(" "):[];r.checked=-1!==i.indexOf(this.customClassOption)}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var t=this.getAnchorTargetCheckbox(),e=this.getAnchorButtonCheckbox(),n={value:this.getInput().value.trim()};return this.linkValidation&&(n.value=this.checkLinkFormat(n.value)),n.target="_self",t&&t.checked&&(n.target="_blank"),e&&e.checked&&(n.buttonClass=this.customClassOption),n},doFormSave:function(){var t=this.getFormOpts();this.completeFormSave(t)},completeFormSave:function(t){this.base.restoreSelection(),this.execAction(this.action,t),this.base.checkSelection()},ensureEncodedUri:function(t){return t===decodeURI(t)?encodeURI(t):t},ensureEncodedUriComponent:function(t){return t===decodeURIComponent(t)?encodeURIComponent(t):t},ensureEncodedParam:function(t){var e=t.split("="),n=e[0],o=e[1];return n+(void 0===o?"":"="+this.ensureEncodedUriComponent(o))},ensureEncodedQuery:function(t){return t.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(t){var e=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i.test(t),n="",o=t.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),r=o[1],i=o[2],a=o[3];if(/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/.test(t))return"tel:"+t;if(!e){var s=r.split("/")[0];(s.match(/.+(\.|:).+/)||"localhost"===s)&&(n="http://")}return n+this.ensureEncodedUri(r)+(void 0===i?"":"?"+this.ensureEncodedQuery(i))+(void 0===a?"":"#"+a)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(t){var e=t.querySelector(".medium-editor-toolbar-close"),n=t.querySelector(".medium-editor-toolbar-save"),o=t.querySelector(".medium-editor-toolbar-input");this.on(t,"click",this.handleFormClick.bind(this)),this.on(o,"keyup",this.handleTextboxKeyup.bind(this)),this.on(e,"click",this.handleCloseClick.bind(this)),this.on(n,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var t=this.document.createElement("div");return t.className="medium-editor-toolbar-form",t.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),t.innerHTML=this.getTemplate(),this.attachFormEvents(t),t},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(e){if(e.keyCode===t.util.keyCode.ENTER)return e.preventDefault(),void this.doFormSave();e.keyCode===t.util.keyCode.ESCAPE&&(e.preventDefault(),this.doFormCancel())},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}}),t.extensions.anchor=r,i=t.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var t=this.document.createElement("div");return t.id="medium-editor-anchor-preview-"+this.getEditorId(),t.className="medium-editor-anchor-preview",t.innerHTML=this.getTemplate(),this.on(t,"click",this.handleClick.bind(this)),t},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(t){return!(!this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")&&!t.getAttribute("data-disable-preview"))||(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=t.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=t.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=t,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(t){t=t||this.activeAnchor;var e,n,o,r,i,a=this.window.innerWidth,s=this.anchorPreview.offsetHeight,l=t.getBoundingClientRect(),u=this.diffLeft,c=this.diffTop,d=this.getEditorOption("elementsContainer"),p=["absolute","fixed"].indexOf(window.getComputedStyle(d).getPropertyValue("position"))>-1,h={};e=this.anchorPreview.offsetWidth/2;var f=this.base.getExtensionByName("toolbar");f&&(u=f.diffLeft,c=f.diffTop),n=u-e,p?(r=d.getBoundingClientRect(),["top","left"].forEach((function(t){h[t]=l[t]-r[t]})),h.width=l.width,h.height=l.height,l=h,a=r.width,i=d.scrollTop):i=this.window.pageYOffset,o=l.left+l.width/2,i+=s+l.top+l.height-c-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(i)+"px",this.anchorPreview.style.right="initial",o<e?(this.anchorPreview.style.left=n+e+"px",this.anchorPreview.style.right="initial"):a-o<e?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=n+o+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(t){var e=this.base.getExtensionByName("anchor"),n=this.activeAnchor;e&&n&&(t.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay(function(){if(n){var t={value:n.attributes.href.value,target:n.getAttribute("target"),buttonClass:n.getAttribute("class")};e.showForm(t),n=null}}.bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(e){var n=t.util.getClosestTag(e.target,"a");if(!1!==n){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(n.outerHTML)||/href=["']#\S+["']/.test(n.outerHTML)))return!0;var o=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&o&&o.isDisplayed&&o.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==n&&this.detachPreviewHandlers(),this.anchorToPreview=n,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay(function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}.bind(this))}},handlePreviewMouseover:function(){this.lastOver=(new Date).getTime(),this.hovering=!0},handlePreviewMouseout:function(t){t.relatedTarget&&/anchor-preview/.test(t.relatedTarget.className)||(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;(new Date).getTime()-this.lastOver>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=(new Date).getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}}),t.extensions.anchorPreview=i,function(){var e,n,o,r,i;function a(e){return!t.util.getClosestTag(e,"a")}e=[" ","\t","\n","\r"," "," "," "," "," ","\u2028","\u2029"],o="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+(n="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw")+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+n+"))",r=new RegExp("^("+n+")$","i"),i=new RegExp(o,"gi");var s=t.Extension.extend({init:function(){t.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var t=0,e=0;e<this.window._mediumEditors.length;e++){var n=this.window._mediumEditors[e];null!==n&&void 0!==n.getExtensionByName("autoLink")&&t++}return 1===t},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(t,e){this.performLinking(e)},onKeypress:function(e){this.disableEventHandling||t.util.isKey(e,[t.util.keyCode.SPACE,t.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout(function(){try{var t=this.base.exportSelection();this.performLinking(e.target)&&this.base.importSelection(t,!0)}catch(t){window.console&&window.console.error("Failed to perform linking",t),this.disableEventHandling=!0}}.bind(this),0))},performLinking:function(e){var n=t.util.splitByBlockElements(e),o=!1;0===n.length&&(n=[e]);for(var r=0;r<n.length;r++)o=this.removeObsoleteAutoLinkSpans(n[r])||o,o=this.performLinkingWithinElement(n[r])||o;return this.base.events.updateInput(e,{target:e,currentTarget:e}),o},removeObsoleteAutoLinkSpans:function(e){if(!e||3===e.nodeType)return!1;for(var n=e.querySelectorAll('span[data-auto-link="true"]'),o=!1,r=0;r<n.length;r++){var i=n[r].textContent;if(-1===i.indexOf("://")&&(i=t.util.ensureUrlHasProtocol(i)),n[r].getAttribute("data-href")!==i&&a(n[r])){o=!0;var s=i.replace(/\s+$/,"");if(n[r].getAttribute("data-href")===s){var l=i.length-s.length,u=t.util.splitOffDOMTree(n[r],this.splitTextBeforeEnd(n[r],l));n[r].parentNode.insertBefore(u,n[r].nextSibling)}else t.util.unwrap(n[r],this.document)}}return o},splitTextBeforeEnd:function(t,e){for(var n,o,r,i=this.document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1),a=!0;a;)a=null!==i.lastChild();for(;e>0&&null!==r;)(o=(n=i.currentNode).nodeValue).length>e?(r=n.splitText(o.length-e),e=0):(r=i.previousNode(),e-=o.length);return r},performLinkingWithinElement:function(e){for(var n=this.findLinkableText(e),o=0;o<n.length;o++){var r=t.util.findOrCreateMatchingTextNodes(this.document,e,n[o]);this.shouldNotLink(r)||this.createAutoLink(r,n[o].href)}return!1},shouldNotLink:function(e){for(var n=!1,o=0;o<e.length&&!1===n;o++)n=!!t.util.traverseUp(e[o],(function(t){return"a"===t.nodeName.toLowerCase()||t.getAttribute&&"true"===t.getAttribute("data-auto-link")}));return n},findLinkableText:function(t){for(var n=t.textContent,o=null,a=[];null!==(o=i.exec(n));){var s=o.index+o[0].length;!(0!==o.index&&-1===e.indexOf(n[o.index-1])||s!==n.length&&-1===e.indexOf(n[s]))&&(-1!==o[0].indexOf("/")||r.test(o[0].split(".").pop().split("?").shift()))&&a.push({href:o[0],start:o.index,end:s})}return a},createAutoLink:function(e,n){n=t.util.ensureUrlHasProtocol(n);var o=t.util.createLink(this.document,e,n,this.getEditorOption("targetBlank")?"_blank":null),r=this.document.createElement("span");for(r.setAttribute("data-auto-link","true"),r.setAttribute("data-href",n),o.insertBefore(r,o.firstChild);o.childNodes.length>1;)r.appendChild(o.childNodes[1])}});t.extensions.autoLink=s}(),function(){var e="medium-editor-dragover";function n(n){var o=t.util.getContainerEditorElement(n);Array.prototype.slice.call(o.parentElement.querySelectorAll("."+e)).forEach((function(t){t.classList.remove(e)}))}var o=t.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(t){t.preventDefault(),t.dataTransfer.dropEffect="copy";var o=t.target.classList?t.target:t.target.parentElement;n(o),"dragover"===t.type&&o.classList.add(e)},handleDrop:function(t){t.preventDefault(),t.stopPropagation(),this.base.selectElement(t.target);var e=this.base.exportSelection();e.start=e.end,this.base.importSelection(e),t.dataTransfer.files&&Array.prototype.slice.call(t.dataTransfer.files).forEach((function(t){this.isAllowedFile(t)&&t.type.match("image")&&this.insertImageFile(t)}),this),n(t.target)},isAllowedFile:function(t){return this.allowedTypes.some((function(e){return!!t.type.match(e)}))},insertImageFile:function(e){if("function"==typeof FileReader){var n=new FileReader;n.readAsDataURL(e),n.addEventListener("load",function(e){var n=this.document.createElement("img");n.src=e.target.result,t.util.insertHTMLCommand(this.document,n.outerHTML)}.bind(this))}}});t.extensions.fileDragging=o}(),a=t.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach((function(t){var e=t.key.charCodeAt(0);this.keys[e]||(this.keys[e]=[]),this.keys[e].push(t)}),this)},handleKeydown:function(e){var n=t.util.getKeyCode(e);if(this.keys[n]){var o=t.util.isMetaCtrlKey(e),r=!!e.shiftKey,i=!!e.altKey;this.keys[n].forEach((function(t){t.meta!==o||t.shift!==r||t.alt!==i&&void 0!==t.alt||(e.preventDefault(),e.stopPropagation(),"function"==typeof t.command?t.command.apply(this):!1!==t.command&&this.execAction(t.command))}),this)}}}),t.extensions.keyboardCommands=a,s=t.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){t.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(t){if(t.preventDefault(),t.stopPropagation(),!this.isDisplayed()){var e=this.document.queryCommandValue("fontName")+"";this.showForm(e)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(t){var e=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),e.value=t||"",e.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var t,e=this.document,n=e.createElement("div"),o=e.createElement("select"),r=e.createElement("a"),i=e.createElement("a");n.className="medium-editor-toolbar-form",n.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(n,"click",this.handleFormClick.bind(this));for(var a=0;a<this.fonts.length;a++)(t=e.createElement("option")).innerHTML=this.fonts[a],t.value=this.fonts[a],o.appendChild(t);return o.className="medium-editor-toolbar-select",n.appendChild(o),this.on(o,"change",this.handleFontChange.bind(this)),i.setAttribute("href","#"),i.className="medium-editor-toobar-save",i.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"✓",n.appendChild(i),this.on(i,"click",this.handleSaveClick.bind(this),!0),r.setAttribute("href","#"),r.className="medium-editor-toobar-close",r.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"×",n.appendChild(r),this.on(r,"click",this.handleCloseClick.bind(this)),n},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){t.selection.getSelectedElements(this.document).forEach((function(t){"font"===t.nodeName.toLowerCase()&&t.hasAttribute("face")&&t.removeAttribute("face")}))},handleFontChange:function(){var t=this.getSelect().value;""===t?this.clearFontName():this.execAction("fontName",{value:t})},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}}),t.extensions.fontName=s,l=t.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'<i class="fa fa-text-height"></i>',init:function(){t.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(t){if(t.preventDefault(),t.stopPropagation(),!this.isDisplayed()){var e=this.document.queryCommandValue("fontSize")+"";this.showForm(e)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(t){var e=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),e.value=t||"",e.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var t=this.document,e=t.createElement("div"),n=t.createElement("input"),o=t.createElement("a"),r=t.createElement("a");return e.className="medium-editor-toolbar-form",e.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(e,"click",this.handleFormClick.bind(this)),n.setAttribute("type","range"),n.setAttribute("min","1"),n.setAttribute("max","7"),n.className="medium-editor-toolbar-input",e.appendChild(n),this.on(n,"change",this.handleSliderChange.bind(this)),r.setAttribute("href","#"),r.className="medium-editor-toobar-save",r.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"✓",e.appendChild(r),this.on(r,"click",this.handleSaveClick.bind(this),!0),o.setAttribute("href","#"),o.className="medium-editor-toobar-close",o.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"×",e.appendChild(o),this.on(o,"click",this.handleCloseClick.bind(this)),e},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){t.selection.getSelectedElements(this.document).forEach((function(t){"font"===t.nodeName.toLowerCase()&&t.hasAttribute("size")&&t.removeAttribute("size")}))},handleSliderChange:function(){var t=this.getInput().value;"4"===t?this.clearFontSize():this.execAction("fontSize",{value:t})},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}}),t.extensions.fontSize=l,function(){var e="%ME_PASTEBIN%",n=null,o=null,r=function(t){t.stopPropagation()};function i(t,e,n){var o=t.clipboardData||e.clipboardData||n.dataTransfer,r={};if(!o)return r;if(o.getData){var i=o.getData("Text");i&&i.length>0&&(r["text/plain"]=i)}if(o.types)for(var a=0;a<o.types.length;a++){var s=o.types[a];r[s]=o.getData(s)}return r}var a=t.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){t.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach((function(t){this.on(t,"paste",this.handlePaste.bind(this))}),this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(t,e){this.on(e,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(t,e){if(!t.defaultPrevented){var n=i(t,this.window,this.document),o=n["text/html"],r=n["text/plain"];this.window.clipboardData&&void 0===t.clipboardData&&!o&&(o=r),(o||r)&&(t.preventDefault(),this.doPaste(o,r,e))}},doPaste:function(e,n,o){var r,i,a="";if(this.cleanPastedHTML&&e)return this.cleanPaste(e);if(n){if(this.getEditorOption("disableReturn")||o&&o.getAttribute("data-disable-return"))a=t.util.htmlEntities(n);else if((r=n.split(/[\r\n]+/g)).length>1)for(i=0;i<r.length;i+=1)""!==r[i]&&(a+="<p>"+t.util.htmlEntities(r[i])+"</p>");else a=t.util.htmlEntities(r[0]);t.util.insertHTMLCommand(this.document,a)}},handlePasteBinPaste:function(t){if(t.defaultPrevented)this.removePasteBin();else{var e=i(t,this.window,this.document),n=e["text/html"],r=e["text/plain"],a=o;if(!this.cleanPastedHTML||n)return t.preventDefault(),this.removePasteBin(),this.doPaste(n,r,a),void this.trigger("editablePaste",{currentTarget:a,target:a},a);setTimeout(function(){this.cleanPastedHTML&&(n=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(n,r,a),this.trigger("editablePaste",{currentTarget:a,target:a},a)}.bind(this),0)}},handleKeydown:function(e,n){t.util.isKey(e,t.util.keyCode.V)&&t.util.isMetaCtrlKey(e)&&(e.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(n))},createPasteBin:function(i){var a,s=t.selection.getSelectionRange(this.document),l=this.window.pageYOffset;o=i,s&&((a=s.getClientRects()).length?l+=a[0].top:void 0!==s.startContainer.getBoundingClientRect?l+=s.startContainer.getBoundingClientRect().top:l+=s.getBoundingClientRect().top),n=s;var u=this.document.createElement("div");u.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),u.setAttribute("style","border: 1px red solid; position: absolute; top: "+l+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),u.setAttribute("contentEditable",!0),u.innerHTML=e,this.document.body.appendChild(u),this.on(u,"focus",r),this.on(u,"focusin",r),this.on(u,"focusout",r),u.focus(),t.selection.selectNode(u,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(u,"paste",this.boundHandlePaste)},removePasteBin:function(){null!==n&&(t.selection.selectRange(this.document,n),n=null),null!==o&&(o=null);var e=this.getPasteBin();e&&e&&(this.off(e,"focus",r),this.off(e,"focusin",r),this.off(e,"focusout",r),this.off(e,"paste",this.boundHandlePaste),e.parentElement.removeChild(e))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var t=this.getPasteBin();if(!t)return!1;if(t.firstChild&&"mcepastebin"===t.firstChild.id)return!1;var n=t.innerHTML;return!(!n||n===e)&&n},cleanPaste:function(t){var e,n,o,r,i=/<p|<br|<div/.test(t),a=[].concat(this.preCleanReplacements||[],[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]],this.cleanReplacements||[]);for(e=0;e<a.length;e+=1)t=t.replace(a[e][0],a[e][1]);if(!i)return this.pasteHTML(t);for((o=this.document.createElement("div")).innerHTML="<p>"+t.split("<br><br>").join("</p><p>")+"</p>",n=o.querySelectorAll("a,p,div,br"),e=0;e<n.length;e+=1)switch((r=n[e]).innerHTML=r.innerHTML.replace(/\n/gi," "),r.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(r);break;case"br":this.filterLineBreak(r)}this.pasteHTML(o.innerHTML)},pasteHTML:function(e,n){n=t.util.defaults({},n,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var o,r,i,a,s=this.document.createDocumentFragment();for(s.appendChild(this.document.createElement("body")),(a=s.querySelector("body")).innerHTML=e,this.cleanupSpans(a),o=a.querySelectorAll("*"),i=0;i<o.length;i+=1)"a"===(r=o[i]).nodeName.toLowerCase()&&this.getEditorOption("targetBlank")&&t.util.setTargetBlank(r),t.util.cleanupAttrs(r,n.cleanAttrs),t.util.cleanupTags(r,n.cleanTags),t.util.unwrapTags(r,n.unwrapTags);t.util.insertHTMLCommand(this.document,a.innerHTML.replace(/ /g," "))},isCommonBlock:function(t){return t&&("p"===t.nodeName.toLowerCase()||"div"===t.nodeName.toLowerCase())},filterCommonBlocks:function(t){/^\s*$/.test(t.textContent)&&t.parentNode&&t.parentNode.removeChild(t)},filterLineBreak:function(t){this.isCommonBlock(t.previousElementSibling)?this.removeWithParent(t):!this.isCommonBlock(t.parentNode)||t.parentNode.firstChild!==t&&t.parentNode.lastChild!==t?t.parentNode&&1===t.parentNode.childElementCount&&""===t.parentNode.textContent&&this.removeWithParent(t):this.removeWithParent(t)},removeWithParent:function(t){t&&t.parentNode&&(t.parentNode.parentNode&&1===t.parentNode.childElementCount?t.parentNode.parentNode.removeChild(t.parentNode):t.parentNode.removeChild(t))},cleanupSpans:function(e){var n,o,r,i=e.querySelectorAll(".replace-with"),a=function(t){return t&&"#text"!==t.nodeName&&"false"===t.getAttribute("contenteditable")};for(n=0;n<i.length;n+=1)o=i[n],r=this.document.createElement(o.classList.contains("bold")?"b":"i"),o.classList.contains("bold")&&o.classList.contains("italic")?r.innerHTML="<i>"+o.innerHTML+"</i>":r.innerHTML=o.innerHTML,o.parentNode.replaceChild(r,o);for(i=e.querySelectorAll("span"),n=0;n<i.length;n+=1){if(o=i[n],t.util.traverseUp(o,a))return!1;t.util.unwrap(o,this.document)}}});t.extensions.paste=a}(),u=t.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){t.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(t,e){this.initElement(e)},initElement:function(t){t.getAttribute("data-placeholder")||t.setAttribute("data-placeholder",this.text),this.updatePlaceholder(t)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(t,e){this.cleanupElement(e)},cleanupElement:function(t){t.getAttribute("data-placeholder")===this.text&&t.removeAttribute("data-placeholder")},showPlaceholder:function(e){e&&(t.util.isFF&&0===e.childNodes.length?(e.classList.add("medium-editor-placeholder-relative"),e.classList.remove("medium-editor-placeholder")):(e.classList.add("medium-editor-placeholder"),e.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(t){t&&(t.classList.remove("medium-editor-placeholder"),t.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(t,e){if(t.querySelector("img, blockquote, ul, ol, table")||""!==t.textContent.replace(/^\s+|\s+$/g,""))return this.hidePlaceholder(t);e||this.showPlaceholder(t)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(t,e){var n=this.hideOnClick&&e===this.base.getFocusedElement();this.updatePlaceholder(e,n)},handleFocus:function(t,e){this.hidePlaceholder(e)},handleBlur:function(t,e){this.updatePlaceholder(e)}}),t.extensions.placeholder=u,c=t.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){t.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(t,e){return this.base.extensions.forEach((function(n){if(n!==this)return t.apply(e||this,arguments)}),this)},createToolbar:function(){var t=this.document.createElement("div");return t.id="medium-editor-toolbar-"+this.getEditorId(),t.className="medium-editor-toolbar",this.static?t.className+=" static-toolbar":this.relativeContainer?t.className+=" medium-editor-relative-toolbar":t.className+=" medium-editor-stalker-toolbar",t.appendChild(this.createToolbarButtons()),this.forEachExtension((function(e){e.hasForm&&t.appendChild(e.getForm())})),this.attachEventHandlers(),t},createToolbarButtons:function(){var e,n,o,r,i,a,s=this.document.createElement("ul");return s.id="medium-editor-toolbar-actions"+this.getEditorId(),s.className="medium-editor-toolbar-actions",s.style.display="block",this.buttons.forEach((function(o){"string"==typeof o?(i=o,a=null):(i=o.name,a=o),(r=this.base.addBuiltInExtension(i,a))&&"function"==typeof r.getButton&&(n=r.getButton(this.base),e=this.document.createElement("li"),t.util.isElement(n)?e.appendChild(n):e.innerHTML=n,s.appendChild(e))}),this),(o=s.querySelectorAll("button")).length>0&&(o[0].classList.add(this.firstButtonClass),o[o.length-1].classList.add(this.lastButtonClass)),s},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=t.util.throttle(function(){this.base.isActive&&this.positionToolbarIfShown()}.bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(e){if(e&&e.target&&t.util.isDescendant(this.getToolbarElement(),e.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout(function(){this.checkState()}.bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout(function(){this.hideToolbar()}.bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return"block"===this.getToolbarActionsElement().style.display},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay(function(){this.showToolbar()}.bind(this))},hideExtensionForms:function(){this.forEachExtension((function(t){t.hasForm&&t.isDisplayed()&&t.hideForm()}))},multipleBlockElementsSelected:function(){var e=new RegExp("<("+t.util.blockContainerElementNames.join("|")+")[^>]*>","g"),n=t.selection.getSelectionHtml(this.document).replace(/<[^\/>][^>]*><\/[^>]+>/gim,"").match(e);return!!n&&n.length>1},modifySelection:function(){var e=this.window.getSelection().getRangeAt(0);if(this.standardizeSelectionStart&&e.startContainer.nodeValue&&e.startOffset===e.startContainer.nodeValue.length){var n=t.util.findAdjacentTextNodeWithContent(t.selection.getSelectionElement(this.window),e.startContainer,this.document);if(n){for(var o=0;0===n.nodeValue.substr(o,1).trim().length;)o+=1;e=t.selection.select(this.document,n,o,e.endContainer,e.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||t.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var e=t.selection.getSelectionElement(this.window);return!e||-1===this.getEditorElements().indexOf(e)||e.getAttribute("data-disable-toolbar")?this.hideToolbar():this.updateOnEmptySelection&&this.static?this.showAndUpdateToolbar():!t.selection.selectionContainsContent(this.document)||!1===this.allowMultiParagraphSelection&&this.multipleBlockElementsSelected()?this.hideToolbar():void this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension((function(t){"function"==typeof t.isActive&&"function"==typeof t.setInactive&&t.setInactive()})),this.checkActiveButtons()},checkActiveButtons:function(){var e,n=[],o=null,r=t.selection.getSelectionRange(this.document),i=function(t){"function"==typeof t.checkState?t.checkState(e):"function"==typeof t.isActive&&"function"==typeof t.isAlreadyApplied&&"function"==typeof t.setActive&&!t.isActive()&&t.isAlreadyApplied(e)&&t.setActive()};if(r&&(this.forEachExtension((function(t){"function"!=typeof t.queryCommandState||null===(o=t.queryCommandState())?n.push(t):o&&"function"==typeof t.setActive&&t.setActive()})),e=t.selection.getSelectedParentElement(r),this.getEditorElements().some((function(n){return t.util.isDescendant(n,e,!0)}))))for(;e&&(n.forEach(i),!t.util.isMediumEditorElement(e));)e=e.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var t=this.base.getFocusedElement(),e=this.window.getSelection();if(!t)return this;!this.static&&e.isCollapsed||(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(t):this.positionToolbar(e)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(t){this.getToolbarElement().style.left="0";var e,n=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,o=this.window.innerWidth,r=this.getToolbarElement(),i=t.getBoundingClientRect(),a=i.top+n,s=i.left+i.width/2,l=r.offsetHeight,u=r.offsetWidth,c=u/2;switch(this.sticky?n>a+t.offsetHeight-l-this.stickyTopOffset?(r.style.top=a+t.offsetHeight-l+"px",r.classList.remove("medium-editor-sticky-toolbar")):n>a-l-this.stickyTopOffset?(r.classList.add("medium-editor-sticky-toolbar"),r.style.top=this.stickyTopOffset+"px"):(r.classList.remove("medium-editor-sticky-toolbar"),r.style.top=a-l+"px"):r.style.top=a-l+"px",this.align){case"left":e=i.left;break;case"right":e=i.right-u;break;case"center":e=s-c}e<0?e=0:e+u>o&&(e=o-Math.ceil(u)-1),r.style.left=e+"px"},positionToolbar:function(t){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var e=t.getRangeAt(0),n=e.getBoundingClientRect();(!n||0===n.height&&0===n.width&&e.startContainer===e.endContainer)&&(n=1===e.startContainer.nodeType&&e.startContainer.querySelector("img")?e.startContainer.querySelector("img").getBoundingClientRect():e.startContainer.getBoundingClientRect());var o,r,i=this.window.innerWidth,a=this.getToolbarElement(),s=a.offsetHeight,l=a.offsetWidth/2,u=this.diffLeft-l,c=this.getEditorOption("elementsContainer"),d=["absolute","fixed"].indexOf(window.getComputedStyle(c).getPropertyValue("position"))>-1,p={},h={};d?(r=c.getBoundingClientRect(),["top","left"].forEach((function(t){h[t]=n[t]-r[t]})),h.width=n.width,h.height=n.height,n=h,i=r.width,p.top=c.scrollTop):p.top=this.window.pageYOffset,o=n.left+n.width/2,p.top+=n.top-s,n.top<50?(a.classList.add("medium-toolbar-arrow-over"),a.classList.remove("medium-toolbar-arrow-under"),p.top+=50+n.height-this.diffTop):(a.classList.add("medium-toolbar-arrow-under"),a.classList.remove("medium-toolbar-arrow-over"),p.top+=this.diffTop),o<l?(p.left=u+l,p.right="initial"):i-o<l?(p.left="auto",p.right=0):(p.left=u+o,p.right="initial"),["top","left","right"].forEach((function(t){a.style[t]=p[t]+(isNaN(p[t])?"":"px")}))}}),t.extensions.toolbar=c,d=t.Extension.extend({init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(t){var e="medium-editor-dragover";t.preventDefault(),t.dataTransfer.dropEffect="copy","dragover"===t.type?t.target.classList.add(e):"dragleave"===t.type&&t.target.classList.remove(e)},handleDrop:function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.files&&Array.prototype.slice.call(e.dataTransfer.files,0).some(function(e){var n,o;e.type.match("image")&&((n=new FileReader).readAsDataURL(e),o="medium-img-"+ +new Date,t.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+o+'" />'),n.onload=function(){var t=this.document.getElementById(o);t&&(t.removeAttribute("id"),t.removeAttribute("class"),t.src=n.result)}.bind(this))}.bind(this)),e.target.classList.remove("medium-editor-dragover")}}),t.extensions.imageDragging=d,function(){function e(e){var n=t.selection.getSelectionStart(this.options.ownerDocument),o=n.textContent,r=t.selection.getCaretOffsets(n);(void 0===o[r.left-1]||""===o[r.left-1].trim()||void 0!==o[r.left]&&""===o[r.left].trim())&&e.preventDefault()}function n(e,n){if(this.options.disableReturn||n.getAttribute("data-disable-return"))e.preventDefault();else if(this.options.disableDoubleReturn||n.getAttribute("data-disable-double-return")){var o=t.selection.getSelectionStart(this.options.ownerDocument);(o&&""===o.textContent.trim()&&"li"!==o.nodeName.toLowerCase()||o.previousElementSibling&&"br"!==o.previousElementSibling.nodeName.toLowerCase()&&""===o.previousElementSibling.textContent.trim())&&e.preventDefault()}}function o(e){var n=t.selection.getSelectionStart(this.options.ownerDocument);"pre"===(n&&n.nodeName.toLowerCase())&&(e.preventDefault(),t.util.insertHTMLCommand(this.options.ownerDocument," ")),t.util.isListItem(n)&&(e.preventDefault(),e.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function r(e){var n,o=t.selection.getSelectionStart(this.options.ownerDocument),r=o.nodeName.toLowerCase(),i=/^(\s+|<br\/?>)?$/i,a=/h\d/i;t.util.isKey(e,[t.util.keyCode.BACKSPACE,t.util.keyCode.ENTER])&&o.previousElementSibling&&a.test(r)&&0===t.selection.getCaretOffsets(o).left?t.util.isKey(e,t.util.keyCode.BACKSPACE)&&i.test(o.previousElementSibling.innerHTML)?(o.previousElementSibling.parentNode.removeChild(o.previousElementSibling),e.preventDefault()):!this.options.disableDoubleReturn&&t.util.isKey(e,t.util.keyCode.ENTER)&&((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",o.previousElementSibling.parentNode.insertBefore(n,o),e.preventDefault()):t.util.isKey(e,t.util.keyCode.DELETE)&&o.nextElementSibling&&o.previousElementSibling&&!a.test(r)&&i.test(o.innerHTML)&&a.test(o.nextElementSibling.nodeName.toLowerCase())?(t.selection.moveCursor(this.options.ownerDocument,o.nextElementSibling),o.previousElementSibling.parentNode.removeChild(o),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&"li"===r&&i.test(o.innerHTML)&&!o.previousElementSibling&&!o.parentElement.previousElementSibling&&o.nextElementSibling&&"li"===o.nextElementSibling.nodeName.toLowerCase()?((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",o.parentElement.parentElement.insertBefore(n,o.parentElement),t.selection.moveCursor(this.options.ownerDocument,n),o.parentElement.removeChild(o),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&!1!==t.util.getClosestTag(o,"blockquote")&&0===t.selection.getCaretOffsets(o).left?(e.preventDefault(),t.util.execFormatBlock(this.options.ownerDocument,"p")):t.util.isKey(e,t.util.keyCode.ENTER)&&!1!==t.util.getClosestTag(o,"blockquote")&&0===t.selection.getCaretOffsets(o).right?((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",o.parentElement.insertBefore(n,o.nextSibling),t.selection.moveCursor(this.options.ownerDocument,n),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&t.util.isMediumEditorElement(o.parentElement)&&!o.previousElementSibling&&o.nextElementSibling&&i.test(o.innerHTML)&&(e.preventDefault(),t.selection.moveCursor(this.options.ownerDocument,o.nextSibling),o.parentElement.removeChild(o))}function i(e){var n=t.selection.getSelectionStart(this.options.ownerDocument);n&&(t.util.isMediumEditorElement(n)&&0===n.children.length&&!t.util.isBlockContainer(n)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),!t.util.isKey(e,t.util.keyCode.ENTER)||t.util.isListItem(n)||t.util.isBlockContainer(n)||("a"===n.nodeName.toLowerCase()?this.options.ownerDocument.execCommand("unlink",!1,null):e.shiftKey||e.ctrlKey||this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function a(t,e){var n=e.parentNode.querySelector('textarea[medium-editor-textarea-id="'+e.getAttribute("medium-editor-textarea-id")+'"]');n&&(n.value=e.innerHTML.trim())}function s(t){t._mediumEditors||(t._mediumEditors=[null]),this.id||(this.id=t._mediumEditors.length),t._mediumEditors[this.id]=this}function l(t){t._mediumEditors&&t._mediumEditors[this.id]&&(t._mediumEditors[this.id]=null)}function u(e,n,o){var r=[];if(e||(e=[]),"string"==typeof e&&(e=n.querySelectorAll(e)),t.util.isElement(e)&&(e=[e]),o)for(var i=0;i<e.length;i++){var a=e[i];!t.util.isElement(a)||a.getAttribute("data-medium-editor-element")||a.getAttribute("medium-editor-textarea-id")||r.push(a)}else r=Array.prototype.slice.apply(e);return r}function c(t){var e=t.parentNode.querySelector('textarea[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]');e&&(e.classList.remove("medium-editor-hidden"),e.removeAttribute("medium-editor-textarea-id")),t.parentNode&&t.parentNode.removeChild(t)}function d(t,e,n){return t=function(t,e){return Object.keys(e).forEach((function(n){void 0===t[n]&&(t[n]=e[n])})),t}(t,{window:n.options.contentWindow,document:n.options.ownerDocument,base:n}),"function"==typeof t.init&&t.init(),t.name||(t.name=e),t}function p(){return!this.elements.every((function(t){return!!t.getAttribute("data-disable-toolbar")}))&&!1!==this.options.toolbar}function h(){return!!p.call(this)&&!1!==this.options.anchorPreview}function f(){return!1!==this.options.placeholder}function g(){return!1!==this.options.autoLink}function v(){return!1!==this.options.imageDragging}function y(){return!1!==this.options.keyboardCommands}function m(){return!this.options.extensions.imageDragging}function b(t){for(var e=this.options.ownerDocument.createElement("div"),n=Date.now(),o="medium-editor-"+n,r=t.attributes;this.options.ownerDocument.getElementById(o);)n++,o="medium-editor-"+n;e.className=t.className,e.id=o,e.innerHTML=t.value,t.setAttribute("medium-editor-textarea-id",o);for(var i=0,a=r.length;i<a;i++)e.hasAttribute(r[i].nodeName)||e.setAttribute(r[i].nodeName,r[i].value);return t.form&&this.on(t.form,"reset",function(t){t.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(o))}.bind(this)),t.classList.add("medium-editor-hidden"),t.parentNode.insertBefore(e,t),e}function _(e,o){if(!e.getAttribute("data-medium-editor-element")){"textarea"===e.nodeName.toLowerCase()&&(e=b.call(this,e),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=a.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),this.options.disableEditing||e.getAttribute("data-disable-editing")||(e.setAttribute("contentEditable",!0),e.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(e.getAttribute("data-disable-return")||e.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=n.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),this.options.disableReturn||e.getAttribute("data-disable-return")||this.on(e,"keyup",i.bind(this));var r=t.util.guid();e.setAttribute("data-medium-editor-element",!0),e.classList.add("medium-editor-element"),e.setAttribute("role","textbox"),e.setAttribute("aria-multiline",!0),e.setAttribute("data-medium-editor-editor-index",o),e.setAttribute("medium-editor-index",r),O[r]=e.innerHTML,this.events.attachAllEventsToElement(e)}return e}function x(){this.subscribe("editableKeydownTab",o.bind(this)),this.subscribe("editableKeydownDelete",r.bind(this)),this.subscribe("editableKeydownEnter",r.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",e.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=n.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function E(){if(this.extensions=[],Object.keys(this.options.extensions).forEach((function(t){"toolbar"!==t&&this.options.extensions[t]&&this.extensions.push(d(this.options.extensions[t],t,this))}),this),m.call(this)){var e=this.options.fileDragging;e||(e={},v.call(this)||(e.allowedTypes=[])),this.addBuiltInExtension("fileDragging",e)}var n={paste:!0,"anchor-preview":h.call(this),autoLink:g.call(this),keyboardCommands:y.call(this),placeholder:f.call(this)};Object.keys(n).forEach((function(t){n[t]&&this.addBuiltInExtension(t)}),this);var o=this.options.extensions.toolbar;if(!o&&p.call(this)){var r=t.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});o=new t.extensions.toolbar(r)}o&&this.extensions.push(d(o,"toolbar",this))}function w(e,n){return n&&[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]].forEach((function(e){n.hasOwnProperty(e[0])&&void 0!==n[e[0]]&&t.util.deprecated(e[0],e[1],"v6.0.0")})),t.util.defaults({},n,e)}function S(e,n){var o,r;if(o=/^append-(.+)$/gi.exec(e))return t.util.execFormatBlock(this.options.ownerDocument,o[1]);if("fontSize"===e)return n.size&&t.util.deprecated(".size option for fontSize command",".value","6.0.0"),r=n.value||n.size,this.options.ownerDocument.execCommand("fontSize",!1,r);if("fontName"===e)return n.name&&t.util.deprecated(".name option for fontName command",".value","6.0.0"),r=n.value||n.name,this.options.ownerDocument.execCommand("fontName",!1,r);if("createLink"===e)return this.createLink(n);if("image"===e){var i=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,i)}if("html"===e){var a=this.options.contentWindow.getSelection().toString().trim();return t.util.insertHTMLCommand(this.options.ownerDocument,a)}if(/justify([A-Za-z]*)$/g.exec(e)){var s=this.options.ownerDocument.execCommand(e,!1,null),l=t.selection.getSelectedParentElement(t.selection.getSelectionRange(this.options.ownerDocument));return l&&C.call(this,t.util.getTopBlockContainer(l)),s}return r=n&&n.value,this.options.ownerDocument.execCommand(e,!1,r)}function C(e){if(e){var n,o=Array.prototype.slice.call(e.childNodes).filter((function(t){var e="div"===t.nodeName.toLowerCase();return e&&!n&&(n=t.style.textAlign),e}));o.length&&(this.saveSelection(),o.forEach((function(e){if(e.style.textAlign===n){var o=e.lastChild;if(o){t.util.unwrap(e,this.options.ownerDocument);var r=this.options.ownerDocument.createElement("BR");o.parentNode.insertBefore(r,o.nextSibling)}}}),this),e.style.textAlign=n,this.restoreSelection())}}var O={};t.prototype={init:function(t,e){return this.options=w.call(this,this.defaults,e),this.origElements=t,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(s.call(this,this.options.contentWindow),this.events=new t.Events(this),this.elements=[],this.addElements(this.origElements),0!==this.elements.length&&(this.isActive=!0,E.call(this),x.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach((function(t){"function"==typeof t.destroy&&t.destroy()}),this),this.events.destroy(),this.elements.forEach((function(t){this.options.spellcheck&&(t.innerHTML=t.innerHTML),t.removeAttribute("contentEditable"),t.removeAttribute("spellcheck"),t.removeAttribute("data-medium-editor-element"),t.classList.remove("medium-editor-element"),t.removeAttribute("role"),t.removeAttribute("aria-multiline"),t.removeAttribute("medium-editor-index"),t.removeAttribute("data-medium-editor-editor-index"),t.getAttribute("medium-editor-textarea-id")&&c(t)}),this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,l.call(this,this.options.contentWindow))},on:function(t,e,n,o){return this.events.attachDOMEvent(t,e,n,o),this},off:function(t,e,n,o){return this.events.detachDOMEvent(t,e,n,o),this},subscribe:function(t,e){return this.events.attachCustomEvent(t,e),this},unsubscribe:function(t,e){return this.events.detachCustomEvent(t,e),this},trigger:function(t,e,n){return this.events.triggerCustomEvent(t,e,n),this},delay:function(t){var e=this;return setTimeout((function(){e.isActive&&t()}),this.options.delay)},serialize:function(){var t,e={},n=this.elements.length;for(t=0;t<n;t+=1)e[""!==this.elements[t].id?this.elements[t].id:"element-"+t]={value:this.elements[t].innerHTML.trim()};return e},getExtensionByName:function(t){var e;return this.extensions&&this.extensions.length&&this.extensions.some((function(n){return n.name===t&&(e=n,!0)})),e},addBuiltInExtension:function(e,n){var o,r=this.getExtensionByName(e);if(r)return r;switch(e){case"anchor":o=t.util.extend({},this.options.anchor,n),r=new t.extensions.anchor(o);break;case"anchor-preview":r=new t.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":r=new t.extensions.autoLink;break;case"fileDragging":r=new t.extensions.fileDragging(n);break;case"fontname":r=new t.extensions.fontName(this.options.fontName);break;case"fontsize":r=new t.extensions.fontSize(n);break;case"keyboardCommands":r=new t.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":r=new t.extensions.paste(this.options.paste);break;case"placeholder":r=new t.extensions.placeholder(this.options.placeholder);break;default:t.extensions.button.isBuiltInButton(e)&&(n?(o=t.util.defaults({},n,t.extensions.button.prototype.defaults[e]),r=new t.extensions.button(o)):r=new t.extensions.button(e))}return r&&this.extensions.push(d(r,e,this)),r},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var t=this.getExtensionByName("toolbar");return t&&t.checkState(),this},queryCommandState:function(t){var e,n=null;(e=/^full-(.+)$/gi.exec(t))&&(t=e[1]);try{n=this.options.ownerDocument.queryCommandState(t)}catch(t){n=null}return n},execAction:function(e,n){var o,r;return(o=/^full-(.+)$/gi.exec(e))?(this.saveSelection(),this.selectAllContents(),r=S.call(this,o[1],n),this.restoreSelection()):r=S.call(this,e,n),"insertunorderedlist"!==e&&"insertorderedlist"!==e||t.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),r},getSelectedParentElement:function(e){return void 0===e&&(e=this.options.contentWindow.getSelection().getRangeAt(0)),t.selection.getSelectedParentElement(e)},selectAllContents:function(){var e=t.selection.getSelectionElement(this.options.contentWindow);if(e){for(;1===e.children.length;)e=e.children[0];this.selectElement(e)}},selectElement:function(e){t.selection.selectNode(e,this.options.ownerDocument);var n=t.selection.getSelectionElement(this.options.contentWindow);n&&this.events.focusElement(n)},getFocusedElement:function(){var t;return this.elements.some((function(e){return!t&&e.getAttribute("data-medium-focused")&&(t=e),!!t}),this),t},exportSelection:function(){var e=t.selection.getSelectionElement(this.options.contentWindow),n=this.elements.indexOf(e),o=null;return n>=0&&(o=t.selection.exportSelection(e,this.options.ownerDocument)),null!==o&&0!==n&&(o.editableElementIndex=n),o},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(e,n){if(e){var o=this.elements[e.editableElementIndex||0];t.selection.importSelection(e,o,this.options.ownerDocument,n)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(e){var n,o=t.selection.getSelectionElement(this.options.contentWindow),r={};if(-1!==this.elements.indexOf(o)){try{if(this.events.disableCustomEvent("editableInput"),e.url&&t.util.deprecated(".url option for createLink",".value","6.0.0"),(n=e.url||e.value)&&n.trim().length>0){var i=this.options.contentWindow.getSelection();if(i){var a,s,l,u,c=i.getRangeAt(0),d=c.commonAncestorContainer;if(3===c.endContainer.nodeType&&3!==c.startContainer.nodeType&&0===c.startOffset&&c.startContainer.firstChild===c.endContainer&&(d=c.endContainer),s=t.util.getClosestBlockContainer(c.startContainer),l=t.util.getClosestBlockContainer(c.endContainer),3!==d.nodeType&&0!==d.textContent.length&&s===l){var p=s||o,h=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),a=this.exportSelection(),h.appendChild(p.cloneNode(!0)),o===p?t.selection.select(this.options.ownerDocument,p.firstChild,0,p.lastChild,3===p.lastChild.nodeType?p.lastChild.nodeValue.length:p.lastChild.childNodes.length):t.selection.select(this.options.ownerDocument,p,0,p,p.childNodes.length);var f=this.exportSelection();0===(u=t.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,h,{start:a.start-f.start,end:a.end-f.start,editableElementIndex:a.editableElementIndex})).length&&((h=this.options.ownerDocument.createDocumentFragment()).appendChild(d.cloneNode(!0)),u=[h.firstChild.firstChild,h.firstChild.lastChild]),t.util.createLink(this.options.ownerDocument,u,n.trim());var g=(h.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;t.util.insertHTMLCommand(this.options.ownerDocument,h.firstChild.innerHTML.replace(/^\s+/,"")),a.start-=g,a.end-=g,this.importSelection(a)}else this.options.ownerDocument.execCommand("createLink",!1,n);this.options.targetBlank||"_blank"===e.target?t.util.setTargetBlank(t.selection.getSelectionStart(this.options.ownerDocument),n):t.util.removeTargetBlank(t.selection.getSelectionStart(this.options.ownerDocument),n),e.buttonClass&&t.util.addClassToAnchors(t.selection.getSelectionStart(this.options.ownerDocument),e.buttonClass)}}if(this.options.targetBlank||"_blank"===e.target||e.buttonClass){(r=this.options.ownerDocument.createEvent("HTMLEvents")).initEvent("input",!0,!0,this.options.contentWindow);for(var v=0,y=this.elements.length;v<y;v+=1)this.elements[v].dispatchEvent(r)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",r,o)}},cleanPaste:function(t){this.getExtensionByName("paste").cleanPaste(t)},pasteHTML:function(t,e){this.getExtensionByName("paste").pasteHTML(t,e)},setContent:function(t,e){if(e=e||0,this.elements[e]){var n=this.elements[e];n.innerHTML=t,this.checkContentChanged(n)}},getContent:function(t){return t=t||0,this.elements[t]?this.elements[t].innerHTML.trim():null},checkContentChanged:function(e){e=e||t.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(e,{target:e,currentTarget:e})},resetContent:function(t){if(t){var e=this.elements.indexOf(t);-1!==e&&this.setContent(O[t.getAttribute("medium-editor-index")],e)}else this.elements.forEach((function(t,e){this.setContent(O[t.getAttribute("medium-editor-index")],e)}),this)},addElements:function(t){var e=u(t,this.options.ownerDocument,!0);if(0===e.length)return!1;e.forEach((function(t){t=_.call(this,t,this.id),this.elements.push(t),this.trigger("addElement",{target:t,currentTarget:t},t)}),this)},removeElements:function(t){var e=u(t,this.options.ownerDocument).map((function(t){return t.getAttribute("medium-editor-textarea-id")&&t.parentNode?t.parentNode.querySelector('div[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]'):t}));this.elements=this.elements.filter((function(t){return-1===e.indexOf(t)||(this.events.cleanupElement(t),t.getAttribute("medium-editor-textarea-id")&&c(t),this.trigger("removeElement",{target:t,currentTarget:t},t),!1)}),this)}},t.getEditorFromElement=function(t){var e=t.getAttribute("data-medium-editor-editor-index"),n=t&&t.ownerDocument&&(t.ownerDocument.defaultView||t.ownerDocument.parentWindow);return n&&n._mediumEditors&&n._mediumEditors[e]?n._mediumEditors[e]:null}}(),t.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0},t.parseVersionString=function(t){var e=t.split("-"),n=e[0].split("."),o=e.length>1?e[1]:"";return{major:parseInt(n[0],10),minor:parseInt(n[1],10),revision:parseInt(n[2],10),preRelease:o,toString:function(){return[n[0],n[1],n[2]].join(".")+(o?"-"+o:"")}}},t.version=t.parseVersionString.call(this,"5.23.3"),t}())}(PT);var DT=AT,kT=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},RT=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),LT=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],o=!0,r=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(o=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);o=!0);}catch(t){r=!0,i=t}finally{try{!o&&s.return&&s.return()}finally{if(r)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};
|
|
34
|
+
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */,function(t){if(t.URL=t.URL||t.webkitURL,t.Blob&&t.URL)try{return void new Blob}catch(t){}var e=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||function(t){var e=function(t){return Object.prototype.toString.call(t).match(/^\[object\s(.*)\]$/)[1]},n=function(){this.data=[]},o=function(t,e,n){this.data=t,this.size=t.length,this.type=e,this.encoding=n},r=n.prototype,i=o.prototype,a=t.FileReaderSync,s=function(t){this.code=this[this.name=t]},l="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),u=l.length,c=t.URL||t.webkitURL||t,d=c.createObjectURL,p=c.revokeObjectURL,h=c,f=t.btoa,g=t.atob,v=t.ArrayBuffer,y=t.Uint8Array,m=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(o.fake=i.fake=!0;u--;)s.prototype[l[u]]=u+1;return c.createObjectURL||(h=t.URL=function(t){var e,n=document.createElementNS("http://www.w3.org/1999/xhtml","a");return n.href=t,"origin"in n||("data:"===n.protocol.toLowerCase()?n.origin=null:(e=t.match(m),n.origin=e&&e[1])),n}),h.createObjectURL=function(t){var e,n=t.type;return null===n&&(n="application/octet-stream"),t instanceof o?(e="data:"+n,"base64"===t.encoding?e+";base64,"+t.data:"URI"===t.encoding?e+","+decodeURIComponent(t.data):f?e+";base64,"+f(t.data):e+","+encodeURIComponent(t.data)):d?d.call(c,t):void 0},h.revokeObjectURL=function(t){"data:"!==t.substring(0,5)&&p&&p.call(c,t)},r.append=function(t){var n=this.data;if(y&&(t instanceof v||t instanceof y)){for(var r="",i=new y(t),l=0,u=i.length;l<u;l++)r+=String.fromCharCode(i[l]);n.push(r)}else if("Blob"===e(t)||"File"===e(t)){if(!a)throw new s("NOT_READABLE_ERR");var c=new a;n.push(c.readAsBinaryString(t))}else t instanceof o?"base64"===t.encoding&&g?n.push(g(t.data)):"URI"===t.encoding?n.push(decodeURIComponent(t.data)):"raw"===t.encoding&&n.push(t.data):("string"!=typeof t&&(t+=""),n.push(unescape(encodeURIComponent(t))))},r.getBlob=function(t){return arguments.length||(t=null),new o(this.data.join(""),t,"raw")},r.toString=function(){return"[object BlobBuilder]"},i.slice=function(t,e,n){var r=arguments.length;return r<3&&(n=null),new o(this.data.slice(t,r>1?e:this.data.length),n,this.encoding)},i.toString=function(){return"[object Blob]"},i.close=function(){this.size=0,delete this.data},n}(t);t.Blob=function(t,n){var o=n&&n.type||"",r=new e;if(t)for(var i=0,a=t.length;i<a;i++)Uint8Array&&t[i]instanceof Uint8Array?r.append(t[i].buffer):r.append(t[i]);var s=r.getBlob(o);return!s.slice&&s.webkitSlice&&(s.slice=s.webkitSlice),s};var n=Object.getPrototypeOf||function(t){return t.__proto__};t.Blob.prototype=n(new t.Blob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||E.content||E),function(e,n){"undefined"!=typeof process&&process&&process.versions&&process.versions.electron?e.MediumEditor=n:t.exports=n}(E,function(){function t(t,e){return this.init(t,e)}var e,n,o,r,i,a,s,l,u,c,d;return t.extensions={},function(e){function n(t,e){var n,o=Array.prototype.slice.call(arguments,2);e=e||{};for(var r=0;r<o.length;r++){var i=o[r];if(i)for(n in i)i.hasOwnProperty(n)&&void 0!==i[n]&&(t||!1===e.hasOwnProperty(n))&&(e[n]=i[n])}return e}var o=!1;try{var r=document.createElement("div"),i=document.createTextNode(" ");r.appendChild(i),o=r.contains(i)}catch(t){}var a={isIE:"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&null!==new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent),isEdge:null!==/Edge\/\d+/.exec(navigator.userAgent),isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:e.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(t){return!!(a.isMac&&t.metaKey||!a.isMac&&t.ctrlKey)},isKey:function(t,e){var n=a.getKeyCode(t);return!1===Array.isArray(e)?n===e:-1!==e.indexOf(n)},getKeyCode:function(t){var e=t.which;return null===e&&(e=null!==t.charCode?t.charCode:t.keyCode),e},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var t=[!0].concat(Array.prototype.slice.call(arguments));return n.apply(this,t)},defaults:function(){var t=[!1].concat(Array.prototype.slice.call(arguments));return n.apply(this,t)},createLink:function(t,e,n,o){var r=t.createElement("a");return a.moveTextRangeIntoElement(e[0],e[e.length-1],r),r.setAttribute("href",n),o&&("_blank"===o&&r.setAttribute("rel","noopener noreferrer"),r.setAttribute("target",o)),r},findOrCreateMatchingTextNodes:function(t,e,n){for(var o=t.createTreeWalker(e,NodeFilter.SHOW_ALL,null,!1),r=[],i=0,s=!1,l=null,u=null;null!==(l=o.nextNode());)if(!(l.nodeType>3))if(3===l.nodeType){if(!s&&n.start<i+l.nodeValue.length&&(s=!0,u=a.splitStartNodeIfNeeded(l,n.start,i)),s&&a.splitEndNodeIfNeeded(l,u,n.end,i),s&&i===n.end)break;if(s&&i>n.end+1)throw new Error("PerformLinking overshot the target!");s&&r.push(u||l),i+=l.nodeValue.length,null!==u&&(i+=u.nodeValue.length,o.nextNode()),u=null}else"img"===l.tagName.toLowerCase()&&(!s&&n.start<=i&&(s=!0),s&&r.push(l));return r},splitStartNodeIfNeeded:function(t,e,n){return e!==n?t.splitText(e-n):null},splitEndNodeIfNeeded:function(t,e,n,o){var r,i;r=o+t.nodeValue.length+(e?e.nodeValue.length:0)-1,i=n-o-(e?t.nodeValue.length:0),r>=n&&o!==r&&0!==i&&(e||t).splitText(i)},splitByBlockElements:function(e){if(3!==e.nodeType&&1!==e.nodeType)return[];var n=[],o=t.util.blockContainerElementNames.join(",");if(3===e.nodeType||0===e.querySelectorAll(o).length)return[e];for(var r=0;r<e.childNodes.length;r++){var i=e.childNodes[r];if(3===i.nodeType)n.push(i);else if(1===i.nodeType){0===i.querySelectorAll(o).length?n.push(i):n=n.concat(t.util.splitByBlockElements(i))}}return n},findAdjacentTextNodeWithContent:function(t,e,n){var o,r=!1,i=n.createNodeIterator(t,NodeFilter.SHOW_TEXT,null,!1);for(o=i.nextNode();o;){if(o===e)r=!0;else if(r&&3===o.nodeType&&o.nodeValue&&o.nodeValue.trim().length>0)break;o=i.nextNode()}return o},findPreviousSibling:function(t){if(!t||a.isMediumEditorElement(t))return!1;for(var e=t.previousSibling;!e&&!a.isMediumEditorElement(t.parentNode);)e=(t=t.parentNode).previousSibling;return e},isDescendant:function(t,e,n){if(!t||!e)return!1;if(t===e)return!!n;if(1!==t.nodeType)return!1;if(o||3!==e.nodeType)return t.contains(e);for(var r=e.parentNode;null!==r;){if(r===t)return!0;r=r.parentNode}return!1},isElement:function(t){return!(!t||1!==t.nodeType)},throttle:function(t,e){var n,o,r,i=null,a=0,s=function(){a=Date.now(),i=null,r=t.apply(n,o),i||(n=o=null)};return e||0===e||(e=50),function(){var l=Date.now(),u=e-(l-a);return n=this,o=arguments,u<=0||u>e?(i&&(clearTimeout(i),i=null),a=l,r=t.apply(n,o),i||(n=o=null)):i||(i=setTimeout(s,u)),r}},traverseUp:function(t,e){if(!t)return!1;do{if(1===t.nodeType){if(e(t))return t;if(a.isMediumEditorElement(t))return!1}t=t.parentNode}while(t);return!1},htmlEntities:function(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},insertHTMLCommand:function(e,n){var o,r,i,s,l,u,c,d=!1,p=["insertHTML",!1,n];if(!t.util.isEdge&&e.queryCommandSupported("insertHTML"))try{return e.execCommand.apply(e,p)}catch(t){}if((o=e.getSelection()).rangeCount){if(c=(r=o.getRangeAt(0)).commonAncestorContainer,a.isMediumEditorElement(c)&&!c.firstChild)r.selectNode(c.appendChild(e.createTextNode("")));else if(3===c.nodeType&&0===r.startOffset&&r.endOffset===c.nodeValue.length||3!==c.nodeType&&c.innerHTML===r.toString()){for(;!a.isMediumEditorElement(c)&&c.parentNode&&1===c.parentNode.childNodes.length&&!a.isMediumEditorElement(c.parentNode);)c=c.parentNode;r.selectNode(c)}for(r.deleteContents(),(i=e.createElement("div")).innerHTML=n,s=e.createDocumentFragment();i.firstChild;)l=i.firstChild,u=s.appendChild(l);r.insertNode(s),u&&((r=r.cloneRange()).setStartAfter(u),r.collapse(!0),t.selection.selectRange(e,r)),d=!0}return e.execCommand.callListeners&&e.execCommand.callListeners(p,d),d},execFormatBlock:function(e,n){var o=a.getTopBlockContainer(t.selection.getSelectionStart(e));if("blockquote"===n){if(o&&Array.prototype.slice.call(o.childNodes).some((function(t){return a.isBlockContainer(t)})))return e.execCommand("outdent",!1,null);if(a.isIE)return e.execCommand("indent",!1,n)}if(o&&n===o.nodeName.toLowerCase()&&(n="p"),a.isIE&&(n="<"+n+">"),o&&"blockquote"===o.nodeName.toLowerCase()){if(a.isIE&&"<p>"===n)return e.execCommand("outdent",!1,n);if((a.isFF||a.isEdge)&&"p"===n)return Array.prototype.slice.call(o.childNodes).some((function(t){return!a.isBlockContainer(t)}))&&e.execCommand("formatBlock",!1,n),e.execCommand("outdent",!1,n)}return e.execCommand("formatBlock",!1,n)},setTargetBlank:function(t,e){var n,o=e||!1;if("a"===t.nodeName.toLowerCase())t.target="_blank",t.rel="noopener noreferrer";else for(t=t.getElementsByTagName("a"),n=0;n<t.length;n+=1)!1!==o&&o!==t[n].attributes.href.value||(t[n].target="_blank",t[n].rel="noopener noreferrer")},removeTargetBlank:function(t,e){var n;if("a"===t.nodeName.toLowerCase())t.removeAttribute("target"),t.removeAttribute("rel");else for(t=t.getElementsByTagName("a"),n=0;n<t.length;n+=1)e===t[n].attributes.href.value&&(t[n].removeAttribute("target"),t[n].removeAttribute("rel"))},addClassToAnchors:function(t,e){var n,o,r=e.split(" ");if("a"===t.nodeName.toLowerCase())for(o=0;o<r.length;o+=1)t.classList.add(r[o]);else{var i=t.getElementsByTagName("a");if(0===i.length){var s=a.getClosestTag(t,"a");t=s?[s]:[]}else t=i;for(n=0;n<t.length;n+=1)for(o=0;o<r.length;o+=1)t[n].classList.add(r[o])}},isListItem:function(t){if(!t)return!1;if("li"===t.nodeName.toLowerCase())return!0;for(var e=t.parentNode,n=e.nodeName.toLowerCase();"li"===n||!a.isBlockContainer(e)&&"div"!==n;){if("li"===n)return!0;if(!(e=e.parentNode))return!1;n=e.nodeName.toLowerCase()}return!1},cleanListDOM:function(e,n){if("li"===n.nodeName.toLowerCase()){var o=n.parentElement;"p"===o.parentElement.nodeName.toLowerCase()&&(a.unwrap(o.parentElement,e),t.selection.moveCursor(e,n.firstChild,n.firstChild.textContent.length))}},splitOffDOMTree:function(t,e,n){for(var o=e,r=null,i=!n;o!==t;){var a,s=o.parentNode,l=s.cloneNode(!1),u=i?o:s.firstChild;for(r&&(i?l.appendChild(r):a=r),r=l;u;){var c=u.nextSibling;u===o?(u.hasChildNodes()?u=u.cloneNode(!1):u.parentNode.removeChild(u),u.textContent&&r.appendChild(u),u=i?c:null):(u.parentNode.removeChild(u),(u.hasChildNodes()||u.textContent)&&r.appendChild(u),u=c)}a&&r.appendChild(a),o=s}return r},moveTextRangeIntoElement:function(t,e,n){if(!t||!e)return!1;var o=a.findCommonRoot(t,e);if(!o)return!1;if(e===t){var r=t.parentNode,i=t.nextSibling;return r.removeChild(t),n.appendChild(t),i?r.insertBefore(n,i):r.appendChild(n),n.hasChildNodes()}for(var s,l,u,c=[],d=0;d<o.childNodes.length;d++)if(u=o.childNodes[d],s){if(a.isDescendant(u,e,!0)){l=u;break}c.push(u)}else a.isDescendant(u,t,!0)&&(s=u);var p=l.nextSibling,h=o.ownerDocument.createDocumentFragment();return s===t?(s.parentNode.removeChild(s),h.appendChild(s)):h.appendChild(a.splitOffDOMTree(s,t)),c.forEach((function(t){t.parentNode.removeChild(t),h.appendChild(t)})),l===e?(l.parentNode.removeChild(l),h.appendChild(l)):h.appendChild(a.splitOffDOMTree(l,e,!0)),n.appendChild(h),l.parentNode===o?o.insertBefore(n,l):p?o.insertBefore(n,p):o.appendChild(n),n.hasChildNodes()},depthOfNode:function(t){for(var e=0,n=t;null!==n.parentNode;)n=n.parentNode,e++;return e},findCommonRoot:function(t,e){for(var n=a.depthOfNode(t),o=a.depthOfNode(e),r=t,i=e;n!==o;)n>o?(r=r.parentNode,n-=1):(i=i.parentNode,o-=1);for(;r!==i;)r=r.parentNode,i=i.parentNode;return r},isElementAtBeginningOfBlock:function(t){for(var e;!a.isBlockContainer(t)&&!a.isMediumEditorElement(t);){for(e=t;e=e.previousSibling;)if((3===e.nodeType?e.nodeValue:e.textContent).length>0)return!1;t=t.parentNode}return!0},isMediumEditorElement:function(t){return t&&t.getAttribute&&!!t.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(t){return a.traverseUp(t,(function(t){return a.isMediumEditorElement(t)}))},isBlockContainer:function(t){return t&&3!==t.nodeType&&-1!==a.blockContainerElementNames.indexOf(t.nodeName.toLowerCase())},getClosestBlockContainer:function(t){return a.traverseUp(t,(function(t){return a.isBlockContainer(t)||a.isMediumEditorElement(t)}))},getTopBlockContainer:function(t){var e=!!a.isBlockContainer(t)&&t;return a.traverseUp(t,(function(t){return a.isBlockContainer(t)&&(e=t),!(e||!a.isMediumEditorElement(t))&&(e=t,!0)})),e},getFirstSelectableLeafNode:function(t){for(;t&&t.firstChild;)t=t.firstChild;if("table"===(t=a.traverseUp(t,(function(t){return-1===a.emptyElementNames.indexOf(t.nodeName.toLowerCase())}))).nodeName.toLowerCase()){var e=t.querySelector("th, td");e&&(t=e)}return t},getFirstTextNode:function(t){return a.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),a._getFirstTextNode(t)},_getFirstTextNode:function(t){if(3===t.nodeType)return t;for(var e=0;e<t.childNodes.length;e++){var n=a._getFirstTextNode(t.childNodes[e]);if(null!==n)return n}return null},ensureUrlHasProtocol:function(t){return-1===t.indexOf("://")?"http://"+t:t},warn:function(){void 0!==e.console&&"function"==typeof e.console.warn&&e.console.warn.apply(e.console,arguments)},deprecated:function(t,e,n){var o=t+" is deprecated, please use "+e+" instead.";n&&(o+=" Will be removed in "+n),a.warn(o)},deprecatedMethod:function(t,e,n,o){a.deprecated(t,e,o),"function"==typeof this[e]&&this[e].apply(this,n)},cleanupAttrs:function(t,e){e.forEach((function(e){t.removeAttribute(e)}))},cleanupTags:function(t,e){-1!==e.indexOf(t.nodeName.toLowerCase())&&t.parentNode.removeChild(t)},unwrapTags:function(e,n){-1!==n.indexOf(e.nodeName.toLowerCase())&&t.util.unwrap(e,document)},getClosestTag:function(t,e){return a.traverseUp(t,(function(t){return t.nodeName.toLowerCase()===e.toLowerCase()}))},unwrap:function(t,e){for(var n=e.createDocumentFragment(),o=Array.prototype.slice.call(t.childNodes),r=0;r<o.length;r++)n.appendChild(o[r]);n.childNodes.length?t.parentNode.replaceChild(n,t):t.parentNode.removeChild(t)},guid:function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}};t.util=a}(window),(e=function(e){t.util.extend(this,e)}).extend=function(e){var n,o=this;n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return o.apply(this,arguments)},t.util.extend(n,o);var r=function(){this.constructor=n};return r.prototype=o.prototype,n.prototype=new r,e&&t.util.extend(n.prototype,e),n},e.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(t){return this.base.options[t]}},["execAction","on","off","subscribe","trigger"].forEach((function(t){e.prototype[t]=function(){return this.base[t].apply(this.base,arguments)}})),t.Extension=e,function(){function e(e){return t.util.isBlockContainer(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var n={findMatchingSelectionParent:function(e,n){var o,r=n.getSelection();return 0!==r.rangeCount&&(o=r.getRangeAt(0).commonAncestorContainer,t.util.traverseUp(o,e))},getSelectionElement:function(e){return this.findMatchingSelectionParent((function(e){return t.util.isMediumEditorElement(e)}),e)},exportSelection:function(t,e){if(!t)return null;var n=null,o=e.getSelection();if(o.rangeCount>0){var r,i=o.getRangeAt(0),a=i.cloneRange();a.selectNodeContents(t),a.setEnd(i.startContainer,i.startOffset),n={start:r=a.toString().length,end:r+i.toString().length},this.doesRangeStartWithImages(i,e)&&(n.startsWithImage=!0);var s=this.getTrailingImageCount(t,n,i.endContainer,i.endOffset);if(s&&(n.trailingImageCount=s),0!==r){var l=this.getIndexRelativeToAdjacentEmptyBlocks(e,t,i.startContainer,i.startOffset);-1!==l&&(n.emptyBlocksIndex=l)}}return n},importSelection:function(t,e,n,o){if(t&&e){var r=n.createRange();r.setStart(e,0),r.collapse(!0);var i,a=e,s=[],l=0,u=!1,c=!1,d=0,p=!1,h=!1,f=null;for((o||t.startsWithImage||void 0!==t.emptyBlocksIndex)&&(h=!0);!p&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||c){if(t.trailingImageCount&&c&&("img"===a.nodeName.toLowerCase()&&d++,d===t.trailingImageCount)){for(var g=0;a.parentNode.childNodes[g]!==a;)g++;r.setEnd(a.parentNode,g+1),p=!0}if(!p&&1===a.nodeType)for(var v=a.childNodes.length-1;v>=0;)s.push(a.childNodes[v]),v-=1}else i=l+a.length,!u&&t.start>=l&&t.start<=i&&(h||t.start<i?(r.setStart(a,t.start-l),u=!0):f=a),u&&t.end>=l&&t.end<=i&&(t.trailingImageCount?c=!0:(r.setEnd(a,t.end-l),p=!0)),l=i;p||(a=s.pop())}!u&&f&&(r.setStart(f,f.length),r.setEnd(f,f.length)),void 0!==t.emptyBlocksIndex&&(r=this.importSelectionMoveCursorPastBlocks(n,e,t.emptyBlocksIndex,r)),o&&(r=this.importSelectionMoveCursorPastAnchor(t,r)),this.selectRange(n,r)}},importSelectionMoveCursorPastAnchor:function(e,n){if(e.start===e.end&&3===n.startContainer.nodeType&&n.startOffset===n.startContainer.nodeValue.length&&t.util.traverseUp(n.startContainer,(function(t){return"a"===t.nodeName.toLowerCase()}))){for(var o=n.startContainer,r=n.startContainer.parentNode;null!==r&&"a"!==r.nodeName.toLowerCase();)r.childNodes[r.childNodes.length-1]!==o?r=null:(o=r,r=r.parentNode);if(null!==r&&"a"===r.nodeName.toLowerCase()){for(var i=null,a=0;null===i&&a<r.parentNode.childNodes.length;a++)r.parentNode.childNodes[a]===r&&(i=a);n.setStart(r.parentNode,i+1),n.collapse(!0)}}return n},importSelectionMoveCursorPastBlocks:function(n,o,r,i){var a,s,l=n.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,e,!1),u=i.startContainer,c=0;for(r=r||1,a=3===u.nodeType&&t.util.isBlockContainer(u.previousSibling)?u.previousSibling:t.util.getClosestBlockContainer(u);l.nextNode();)if(s){if(s=l.currentNode,++c===r)break;if(s.textContent.length>0)break}else a===l.currentNode&&(s=l.currentNode);return s||(s=a),i.setStart(t.util.getFirstSelectableLeafNode(s),0),i},getIndexRelativeToAdjacentEmptyBlocks:function(n,o,r,i){if(r.textContent.length>0&&i>0)return-1;var a=r;if(3!==a.nodeType&&(a=r.childNodes[i]),a){if(!t.util.isElementAtBeginningOfBlock(a))return-1;var s=t.util.findPreviousSibling(a);if(!s)return-1;if(s.nodeValue)return-1}for(var l=t.util.getClosestBlockContainer(r),u=n.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,e,!1),c=0;u.nextNode();){var d=""===u.currentNode.textContent;if((d||c>0)&&(c+=1),u.currentNode===l)return c;d||(c=0)}return c},doesRangeStartWithImages:function(t,e){if(0!==t.startOffset||1!==t.startContainer.nodeType)return!1;if("img"===t.startContainer.nodeName.toLowerCase())return!0;var n=t.startContainer.querySelector("img");if(!n)return!1;for(var o=e.createTreeWalker(t.startContainer,NodeFilter.SHOW_ALL,null,!1);o.nextNode();){var r=o.currentNode;if(r===n)break;if(r.nodeValue)return!1}return!0},getTrailingImageCount:function(t,e,n,o){if(0===o||1!==n.nodeType)return 0;if("img"!==n.nodeName.toLowerCase()&&!n.querySelector("img"))return 0;for(var r=n.childNodes[o-1];r.hasChildNodes();)r=r.lastChild;for(var i,a=t,s=[],l=0,u=!1,c=!1,d=!1,p=0;!d&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||c){if("img"===a.nodeName.toLowerCase()&&p++,a===r)d=!0;else if(1===a.nodeType)for(var h=a.childNodes.length-1;h>=0;)s.push(a.childNodes[h]),h-=1}else p=0,i=l+a.length,!u&&e.start>=l&&e.start<=i&&(u=!0),u&&e.end>=l&&e.end<=i&&(c=!0),l=i;d||(a=s.pop())}return p},selectionContainsContent:function(t){var e=t.getSelection();if(!e||e.isCollapsed||!e.rangeCount)return!1;if(""!==e.toString().trim())return!0;var n=this.getSelectedParentElement(e.getRangeAt(0));return!(!n||!("img"===n.nodeName.toLowerCase()||1===n.nodeType&&n.querySelector("img")))},selectionInContentEditableFalse:function(t){var e,n=this.findMatchingSelectionParent((function(t){var n=t&&t.getAttribute("contenteditable");return"true"===n&&(e=!0),"#text"!==t.nodeName&&"false"===n}),t);return!e&&n},getSelectionHtml:function(t){var e,n,o,r="",i=t.getSelection();if(i.rangeCount){for(o=t.createElement("div"),e=0,n=i.rangeCount;e<n;e+=1)o.appendChild(i.getRangeAt(e).cloneContents());r=o.innerHTML}return r},getCaretOffsets:function(t,e){var n,o;return e||(e=window.getSelection().getRangeAt(0)),n=e.cloneRange(),o=e.cloneRange(),n.selectNodeContents(t),n.setEnd(e.endContainer,e.endOffset),o.selectNodeContents(t),o.setStart(e.endContainer,e.endOffset),{left:n.toString().length,right:o.toString().length}},rangeSelectsSingleNode:function(t){var e=t.startContainer;return e===t.endContainer&&e.hasChildNodes()&&t.endOffset===t.startOffset+1},getSelectedParentElement:function(t){return t?this.rangeSelectsSingleNode(t)&&3!==t.startContainer.childNodes[t.startOffset].nodeType?t.startContainer.childNodes[t.startOffset]:3===t.startContainer.nodeType?t.startContainer.parentNode:t.startContainer:null},getSelectedElements:function(t){var e,n,o,r=t.getSelection();if(!r.rangeCount||r.isCollapsed||!r.getRangeAt(0).commonAncestorContainer)return[];if(3===(e=r.getRangeAt(0)).commonAncestorContainer.nodeType){for(n=[],o=e.commonAncestorContainer;o.parentNode&&1===o.parentNode.childNodes.length;)n.push(o.parentNode),o=o.parentNode;return n}return[].filter.call(e.commonAncestorContainer.getElementsByTagName("*"),(function(t){return"function"!=typeof r.containsNode||r.containsNode(t,!0)}))},selectNode:function(t,e){var n=e.createRange();n.selectNodeContents(t),this.selectRange(e,n)},select:function(t,e,n,o,r){var i=t.createRange();return i.setStart(e,n),o?i.setEnd(o,r):i.collapse(!0),this.selectRange(t,i),i},clearSelection:function(t,e){e?t.getSelection().collapseToStart():t.getSelection().collapseToEnd()},moveCursor:function(t,e,n){this.select(t,e,n)},getSelectionRange:function(t){var e=t.getSelection();return 0===e.rangeCount?null:e.getRangeAt(0)},selectRange:function(t,e){var n=t.getSelection();n.removeAllRanges(),n.addRange(e)},getSelectionStart:function(t){var e=t.getSelection().anchorNode;return e&&3===e.nodeType?e.parentNode:e}};t.selection=n}(),function(){function e(e,n){return!!e&&e.some((function(e){if("function"!=typeof e.getInteractionElements)return!1;var o=e.getInteractionElements();return!!o&&(Array.isArray(o)||(o=[o]),o.some((function(e){return t.util.isDescendant(e,n,!0)})))}))}var n=function(t){this.base=t,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};n.prototype={InputEventOnContenteditableSupported:!t.util.isIE&&!t.util.isEdge,attachDOMEvent:function(e,n,o,r){var i=this.base.options.contentWindow,a=this.base.options.ownerDocument;e=t.util.isElement(e)||[i,a].indexOf(e)>-1?[e]:e,Array.prototype.forEach.call(e,function(t){t.addEventListener(n,o,r),this.events.push([t,n,o,r])}.bind(this))},detachDOMEvent:function(e,n,o,r){var i,a,s=this.base.options.contentWindow,l=this.base.options.ownerDocument;e&&(e=t.util.isElement(e)||[s,l].indexOf(e)>-1?[e]:e,Array.prototype.forEach.call(e,function(t){-1!==(i=this.indexOfListener(t,n,o,r))&&(a=this.events.splice(i,1)[0])[0].removeEventListener(a[1],a[2],a[3])}.bind(this)))},indexOfListener:function(t,e,n,o){var r,i,a;for(r=0,i=this.events.length;r<i;r+=1)if((a=this.events[r])[0]===t&&a[1]===e&&a[2]===n&&a[3]===o)return r;return-1},detachAllDOMEvents:function(){for(var t=this.events.pop();t;)t[0].removeEventListener(t[1],t[2],t[3]),t=this.events.pop()},detachAllEventsFromElement:function(t){for(var e=this.events.filter((function(e){return e&&e[0].getAttribute&&e[0].getAttribute("medium-editor-index")===t.getAttribute("medium-editor-index")})),n=0,o=e.length;n<o;n++){var r=e[n];this.detachDOMEvent(r[0],r[1],r[2],r[3])}},attachAllEventsToElement:function(t){this.listeners.editableInput&&(this.contentCache[t.getAttribute("medium-editor-index")]=t.innerHTML),this.eventsCache&&this.eventsCache.forEach((function(e){this.attachDOMEvent(t,e.name,e.handler.bind(this))}),this)},enableCustomEvent:function(t){void 0!==this.disabledEvents[t]&&delete this.disabledEvents[t]},disableCustomEvent:function(t){this.disabledEvents[t]=!0},attachCustomEvent:function(t,e){this.setupListener(t),this.customEvents[t]||(this.customEvents[t]=[]),this.customEvents[t].push(e)},detachCustomEvent:function(t,e){var n=this.indexOfCustomListener(t,e);-1!==n&&this.customEvents[t].splice(n,1)},indexOfCustomListener:function(t,e){return this.customEvents[t]&&this.customEvents[t].length?this.customEvents[t].indexOf(e):-1},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(t,e,n){this.customEvents[t]&&!this.disabledEvents[t]&&this.customEvents[t].forEach((function(t){t(e,n)}))},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach((function(t){t.removeAttribute("data-medium-focused")}))},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=function(t){this.handleDocumentExecCommand(t)}.bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var t=this.options.ownerDocument;if(this.execCommandListener&&t.execCommand.listeners){var e=t.execCommand.listeners.indexOf(this.execCommandListener);-1!==e&&t.execCommand.listeners.splice(e,1),t.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var t=this.options.ownerDocument;if(!t.execCommand.listeners){var e=function(e,n){t.execCommand.listeners&&t.execCommand.listeners.forEach((function(t){t({command:e[0],value:e[2],args:e,result:n})}))},n=function(){var n=t.execCommand.orig.apply(this,arguments);if(!t.execCommand.listeners)return n;var o=Array.prototype.slice.call(arguments);return e(o,n),n};n.orig=t.execCommand,n.listeners=[],n.callListeners=e,t.execCommand=n}},unwrapExecCommand:function(){var t=this.options.ownerDocument;t.execCommand.orig&&(t.execCommand=t.execCommand.orig)},setupListener:function(t){if(!this.listeners[t]){switch(t){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach((function(t){this.contentCache[t.getAttribute("medium-editor-index")]=t.innerHTML}),this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":case"editableKeydownEnter":case"editableKeydownTab":case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste)}this.listeners[t]=!0}},attachToEachElement:function(t,e){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach((function(n){this.attachDOMEvent(n,t,e.bind(this))}),this),this.eventsCache.push({name:t,handler:e})},cleanupElement:function(t){var e=t.getAttribute("medium-editor-index");e&&(this.detachAllEventsFromElement(t),this.contentCache&&delete this.contentCache[e])},focusElement:function(t){t.focus(),this.updateFocus(t,{target:t,type:"focus"})},updateFocus:function(n,o){var r,i=this.base.getFocusedElement();i&&"click"===o.type&&this.lastMousedownTarget&&(t.util.isDescendant(i,this.lastMousedownTarget,!0)||e(this.base.extensions,this.lastMousedownTarget))&&(r=i),r||this.base.elements.some((function(e){return!r&&t.util.isDescendant(e,n,!0)&&(r=e),!!r}),this);var a=!t.util.isDescendant(i,n,!0)&&!e(this.base.extensions,n);r!==i&&(i&&a&&(i.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",o,i)),r&&(r.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",o,r))),a&&this.triggerCustomEvent("externalInteraction",o)},updateInput:function(t,e){if(this.contentCache){var n=t.getAttribute("medium-editor-index"),o=t.innerHTML;o!==this.contentCache[n]&&this.triggerCustomEvent("editableInput",e,t),this.contentCache[n]=o}},handleDocumentSelectionChange:function(e){if(e.currentTarget&&e.currentTarget.activeElement){var n,o=e.currentTarget.activeElement;this.base.elements.some((function(e){return!!t.util.isDescendant(e,o,!0)&&(n=e,!0)}),this),n&&this.updateInput(n,{target:o,currentTarget:n})}},handleDocumentExecCommand:function(){var t=this.base.getFocusedElement();t&&this.updateInput(t,{target:t,currentTarget:t})},handleBodyClick:function(t){this.updateFocus(t.target,t)},handleBodyFocus:function(t){this.updateFocus(t.target,t)},handleBodyMousedown:function(t){this.lastMousedownTarget=t.target},handleInput:function(t){this.updateInput(t.currentTarget,t)},handleClick:function(t){this.triggerCustomEvent("editableClick",t,t.currentTarget)},handleBlur:function(t){this.triggerCustomEvent("editableBlur",t,t.currentTarget)},handleKeypress:function(t){if(this.triggerCustomEvent("editableKeypress",t,t.currentTarget),this.keypressUpdateInput){var e={target:t.target,currentTarget:t.currentTarget};setTimeout(function(){this.updateInput(e.currentTarget,e)}.bind(this),0)}},handleKeyup:function(t){this.triggerCustomEvent("editableKeyup",t,t.currentTarget)},handleMouseover:function(t){this.triggerCustomEvent("editableMouseover",t,t.currentTarget)},handleDragging:function(t){this.triggerCustomEvent("editableDrag",t,t.currentTarget)},handleDrop:function(t){this.triggerCustomEvent("editableDrop",t,t.currentTarget)},handlePaste:function(t){this.triggerCustomEvent("editablePaste",t,t.currentTarget)},handleKeydown:function(e){return this.triggerCustomEvent("editableKeydown",e,e.currentTarget),t.util.isKey(e,t.util.keyCode.SPACE)?this.triggerCustomEvent("editableKeydownSpace",e,e.currentTarget):t.util.isKey(e,t.util.keyCode.ENTER)||e.ctrlKey&&t.util.isKey(e,t.util.keyCode.M)?this.triggerCustomEvent("editableKeydownEnter",e,e.currentTarget):t.util.isKey(e,t.util.keyCode.TAB)?this.triggerCustomEvent("editableKeydownTab",e,e.currentTarget):t.util.isKey(e,[t.util.keyCode.DELETE,t.util.keyCode.BACKSPACE])?this.triggerCustomEvent("editableKeydownDelete",e,e.currentTarget):void 0}},t.Events=n}(),n=t.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(e){n.isBuiltInButton(e)?t.Extension.call(this,this.defaults[e]):t.Extension.call(this,e)},init:function(){t.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return"function"==typeof this.action?this.action(this.base.options):this.action},getAria:function(){return"function"==typeof this.aria?this.aria(this.base.options):this.aria},getTagNames:function(){return"function"==typeof this.tagNames?this.tagNames(this.base.options):this.tagNames},createButton:function(){var t=this.document.createElement("button"),e=this.contentDefault,n=this.getAria(),o=this.getEditorOption("buttonLabels");return t.classList.add("medium-editor-action"),t.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach((function(e){t.classList.add(e)})),t.setAttribute("data-action",this.getAction()),n&&(t.setAttribute("title",n),t.setAttribute("aria-label",n)),this.attrs&&Object.keys(this.attrs).forEach((function(e){t.setAttribute(e,this.attrs[e])}),this),"fontawesome"===o&&this.contentFA&&(e=this.contentFA),t.innerHTML=e,t},handleClick:function(t){t.preventDefault(),t.stopPropagation();var e=this.getAction();e&&this.execAction(e)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var t=null;return this.useQueryState&&(t=this.base.queryCommandState(this.getAction())),t},isAlreadyApplied:function(t){var e,n,o=!1,r=this.getTagNames();return!1===this.knownState||!0===this.knownState?this.knownState:(r&&r.length>0&&(o=-1!==r.indexOf(t.nodeName.toLowerCase())),!o&&this.style&&(e=this.style.value.split("|"),n=this.window.getComputedStyle(t,null).getPropertyValue(this.style.prop),e.forEach((function(t){this.knownState||((o=-1!==n.indexOf(t))||"text-decoration"!==this.style.prop)&&(this.knownState=o)}),this)),o)}}),n.isBuiltInButton=function(e){return"string"==typeof e&&t.extensions.button.prototype.defaults.hasOwnProperty(e)},t.extensions.button=n,t.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>•</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>→</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>←</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>“</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}},o=t.extensions.button.extend({init:function(){t.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return!!this.hasForm&&this.getForm().classList.contains(this.activeClass)},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var t=this.base.getExtensionByName("toolbar");t&&t.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var t=this.base.getExtensionByName("toolbar");t&&t.hideToolbarDefaultActions()},setToolbarPosition:function(){var t=this.base.getExtensionByName("toolbar");t&&t.setToolbarPosition()}}),t.extensions.form=o,r=t.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){t.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(e){e.preventDefault(),e.stopPropagation();var n=t.selection.getSelectionRange(this.document);return"a"===n.startContainer.nodeName.toLowerCase()||"a"===n.endContainer.nodeName.toLowerCase()||t.util.getClosestTag(t.selection.getSelectedParentElement(n),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(e){t.util.isKey(e,t.util.keyCode.K)&&t.util.isMetaCtrlKey(e)&&!e.shiftKey&&this.handleClick(e)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var t=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return t.push('<a href="#" class="medium-editor-toolbar-save">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),t.push('<a href="#" class="medium-editor-toolbar-close">',"fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&t.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&t.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),t.join("")},isDisplayed:function(){return t.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){t.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(e){var n=this.getInput(),o=this.getAnchorTargetCheckbox(),r=this.getAnchorButtonCheckbox();if("string"==typeof(e=e||{value:""})&&(e={value:e}),this.base.saveSelection(),this.hideToolbarDefaultActions(),t.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),n.value=e.value,n.focus(),o&&(o.checked="_blank"===e.target),r){var i=e.buttonClass?e.buttonClass.split(" "):[];r.checked=-1!==i.indexOf(this.customClassOption)}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var t=this.getAnchorTargetCheckbox(),e=this.getAnchorButtonCheckbox(),n={value:this.getInput().value.trim()};return this.linkValidation&&(n.value=this.checkLinkFormat(n.value)),n.target="_self",t&&t.checked&&(n.target="_blank"),e&&e.checked&&(n.buttonClass=this.customClassOption),n},doFormSave:function(){var t=this.getFormOpts();this.completeFormSave(t)},completeFormSave:function(t){this.base.restoreSelection(),this.execAction(this.action,t),this.base.checkSelection()},ensureEncodedUri:function(t){return t===decodeURI(t)?encodeURI(t):t},ensureEncodedUriComponent:function(t){return t===decodeURIComponent(t)?encodeURIComponent(t):t},ensureEncodedParam:function(t){var e=t.split("="),n=e[0],o=e[1];return n+(void 0===o?"":"="+this.ensureEncodedUriComponent(o))},ensureEncodedQuery:function(t){return t.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(t){var e=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i.test(t),n="",o=t.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),r=o[1],i=o[2],a=o[3];if(/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/.test(t))return"tel:"+t;if(!e){var s=r.split("/")[0];(s.match(/.+(\.|:).+/)||"localhost"===s)&&(n="http://")}return n+this.ensureEncodedUri(r)+(void 0===i?"":"?"+this.ensureEncodedQuery(i))+(void 0===a?"":"#"+a)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(t){var e=t.querySelector(".medium-editor-toolbar-close"),n=t.querySelector(".medium-editor-toolbar-save"),o=t.querySelector(".medium-editor-toolbar-input");this.on(t,"click",this.handleFormClick.bind(this)),this.on(o,"keyup",this.handleTextboxKeyup.bind(this)),this.on(e,"click",this.handleCloseClick.bind(this)),this.on(n,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var t=this.document.createElement("div");return t.className="medium-editor-toolbar-form",t.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),t.innerHTML=this.getTemplate(),this.attachFormEvents(t),t},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(e){if(e.keyCode===t.util.keyCode.ENTER)return e.preventDefault(),void this.doFormSave();e.keyCode===t.util.keyCode.ESCAPE&&(e.preventDefault(),this.doFormCancel())},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}}),t.extensions.anchor=r,i=t.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var t=this.document.createElement("div");return t.id="medium-editor-anchor-preview-"+this.getEditorId(),t.className="medium-editor-anchor-preview",t.innerHTML=this.getTemplate(),this.on(t,"click",this.handleClick.bind(this)),t},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(t){return!(!this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")&&!t.getAttribute("data-disable-preview"))||(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=t.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=t.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=t,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(t){t=t||this.activeAnchor;var e,n,o,r,i,a=this.window.innerWidth,s=this.anchorPreview.offsetHeight,l=t.getBoundingClientRect(),u=this.diffLeft,c=this.diffTop,d=this.getEditorOption("elementsContainer"),p=["absolute","fixed"].indexOf(window.getComputedStyle(d).getPropertyValue("position"))>-1,h={};e=this.anchorPreview.offsetWidth/2;var f=this.base.getExtensionByName("toolbar");f&&(u=f.diffLeft,c=f.diffTop),n=u-e,p?(r=d.getBoundingClientRect(),["top","left"].forEach((function(t){h[t]=l[t]-r[t]})),h.width=l.width,h.height=l.height,l=h,a=r.width,i=d.scrollTop):i=this.window.pageYOffset,o=l.left+l.width/2,i+=s+l.top+l.height-c-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(i)+"px",this.anchorPreview.style.right="initial",o<e?(this.anchorPreview.style.left=n+e+"px",this.anchorPreview.style.right="initial"):a-o<e?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=n+o+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(t){var e=this.base.getExtensionByName("anchor"),n=this.activeAnchor;e&&n&&(t.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay(function(){if(n){var t={value:n.attributes.href.value,target:n.getAttribute("target"),buttonClass:n.getAttribute("class")};e.showForm(t),n=null}}.bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(e){var n=t.util.getClosestTag(e.target,"a");if(!1!==n){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(n.outerHTML)||/href=["']#\S+["']/.test(n.outerHTML)))return!0;var o=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&o&&o.isDisplayed&&o.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==n&&this.detachPreviewHandlers(),this.anchorToPreview=n,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay(function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}.bind(this))}},handlePreviewMouseover:function(){this.lastOver=(new Date).getTime(),this.hovering=!0},handlePreviewMouseout:function(t){t.relatedTarget&&/anchor-preview/.test(t.relatedTarget.className)||(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;(new Date).getTime()-this.lastOver>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=(new Date).getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}}),t.extensions.anchorPreview=i,function(){var e,n,o,r,i;function a(e){return!t.util.getClosestTag(e,"a")}e=[" ","\t","\n","\r"," "," "," "," "," ","\u2028","\u2029"],o="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+(n="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw")+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+n+"))",r=new RegExp("^("+n+")$","i"),i=new RegExp(o,"gi");var s=t.Extension.extend({init:function(){t.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var t=0,e=0;e<this.window._mediumEditors.length;e++){var n=this.window._mediumEditors[e];null!==n&&void 0!==n.getExtensionByName("autoLink")&&t++}return 1===t},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(t,e){this.performLinking(e)},onKeypress:function(e){this.disableEventHandling||t.util.isKey(e,[t.util.keyCode.SPACE,t.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout(function(){try{var t=this.base.exportSelection();this.performLinking(e.target)&&this.base.importSelection(t,!0)}catch(t){window.console&&window.console.error("Failed to perform linking",t),this.disableEventHandling=!0}}.bind(this),0))},performLinking:function(e){var n=t.util.splitByBlockElements(e),o=!1;0===n.length&&(n=[e]);for(var r=0;r<n.length;r++)o=this.removeObsoleteAutoLinkSpans(n[r])||o,o=this.performLinkingWithinElement(n[r])||o;return this.base.events.updateInput(e,{target:e,currentTarget:e}),o},removeObsoleteAutoLinkSpans:function(e){if(!e||3===e.nodeType)return!1;for(var n=e.querySelectorAll('span[data-auto-link="true"]'),o=!1,r=0;r<n.length;r++){var i=n[r].textContent;if(-1===i.indexOf("://")&&(i=t.util.ensureUrlHasProtocol(i)),n[r].getAttribute("data-href")!==i&&a(n[r])){o=!0;var s=i.replace(/\s+$/,"");if(n[r].getAttribute("data-href")===s){var l=i.length-s.length,u=t.util.splitOffDOMTree(n[r],this.splitTextBeforeEnd(n[r],l));n[r].parentNode.insertBefore(u,n[r].nextSibling)}else t.util.unwrap(n[r],this.document)}}return o},splitTextBeforeEnd:function(t,e){for(var n,o,r,i=this.document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1),a=!0;a;)a=null!==i.lastChild();for(;e>0&&null!==r;)(o=(n=i.currentNode).nodeValue).length>e?(r=n.splitText(o.length-e),e=0):(r=i.previousNode(),e-=o.length);return r},performLinkingWithinElement:function(e){for(var n=this.findLinkableText(e),o=0;o<n.length;o++){var r=t.util.findOrCreateMatchingTextNodes(this.document,e,n[o]);this.shouldNotLink(r)||this.createAutoLink(r,n[o].href)}return!1},shouldNotLink:function(e){for(var n=!1,o=0;o<e.length&&!1===n;o++)n=!!t.util.traverseUp(e[o],(function(t){return"a"===t.nodeName.toLowerCase()||t.getAttribute&&"true"===t.getAttribute("data-auto-link")}));return n},findLinkableText:function(t){for(var n=t.textContent,o=null,a=[];null!==(o=i.exec(n));){var s=o.index+o[0].length;!(0!==o.index&&-1===e.indexOf(n[o.index-1])||s!==n.length&&-1===e.indexOf(n[s]))&&(-1!==o[0].indexOf("/")||r.test(o[0].split(".").pop().split("?").shift()))&&a.push({href:o[0],start:o.index,end:s})}return a},createAutoLink:function(e,n){n=t.util.ensureUrlHasProtocol(n);var o=t.util.createLink(this.document,e,n,this.getEditorOption("targetBlank")?"_blank":null),r=this.document.createElement("span");for(r.setAttribute("data-auto-link","true"),r.setAttribute("data-href",n),o.insertBefore(r,o.firstChild);o.childNodes.length>1;)r.appendChild(o.childNodes[1])}});t.extensions.autoLink=s}(),function(){var e="medium-editor-dragover";function n(n){var o=t.util.getContainerEditorElement(n);Array.prototype.slice.call(o.parentElement.querySelectorAll("."+e)).forEach((function(t){t.classList.remove(e)}))}var o=t.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(t){t.preventDefault(),t.dataTransfer.dropEffect="copy";var o=t.target.classList?t.target:t.target.parentElement;n(o),"dragover"===t.type&&o.classList.add(e)},handleDrop:function(t){t.preventDefault(),t.stopPropagation(),this.base.selectElement(t.target);var e=this.base.exportSelection();e.start=e.end,this.base.importSelection(e),t.dataTransfer.files&&Array.prototype.slice.call(t.dataTransfer.files).forEach((function(t){this.isAllowedFile(t)&&t.type.match("image")&&this.insertImageFile(t)}),this),n(t.target)},isAllowedFile:function(t){return this.allowedTypes.some((function(e){return!!t.type.match(e)}))},insertImageFile:function(e){if("function"==typeof FileReader){var n=new FileReader;n.readAsDataURL(e),n.addEventListener("load",function(e){var n=this.document.createElement("img");n.src=e.target.result,t.util.insertHTMLCommand(this.document,n.outerHTML)}.bind(this))}}});t.extensions.fileDragging=o}(),a=t.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach((function(t){var e=t.key.charCodeAt(0);this.keys[e]||(this.keys[e]=[]),this.keys[e].push(t)}),this)},handleKeydown:function(e){var n=t.util.getKeyCode(e);if(this.keys[n]){var o=t.util.isMetaCtrlKey(e),r=!!e.shiftKey,i=!!e.altKey;this.keys[n].forEach((function(t){t.meta!==o||t.shift!==r||t.alt!==i&&void 0!==t.alt||(e.preventDefault(),e.stopPropagation(),"function"==typeof t.command?t.command.apply(this):!1!==t.command&&this.execAction(t.command))}),this)}}}),t.extensions.keyboardCommands=a,s=t.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){t.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(t){if(t.preventDefault(),t.stopPropagation(),!this.isDisplayed()){var e=this.document.queryCommandValue("fontName")+"";this.showForm(e)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(t){var e=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),e.value=t||"",e.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var t,e=this.document,n=e.createElement("div"),o=e.createElement("select"),r=e.createElement("a"),i=e.createElement("a");n.className="medium-editor-toolbar-form",n.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(n,"click",this.handleFormClick.bind(this));for(var a=0;a<this.fonts.length;a++)(t=e.createElement("option")).innerHTML=this.fonts[a],t.value=this.fonts[a],o.appendChild(t);return o.className="medium-editor-toolbar-select",n.appendChild(o),this.on(o,"change",this.handleFontChange.bind(this)),i.setAttribute("href","#"),i.className="medium-editor-toobar-save",i.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"✓",n.appendChild(i),this.on(i,"click",this.handleSaveClick.bind(this),!0),r.setAttribute("href","#"),r.className="medium-editor-toobar-close",r.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"×",n.appendChild(r),this.on(r,"click",this.handleCloseClick.bind(this)),n},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){t.selection.getSelectedElements(this.document).forEach((function(t){"font"===t.nodeName.toLowerCase()&&t.hasAttribute("face")&&t.removeAttribute("face")}))},handleFontChange:function(){var t=this.getSelect().value;""===t?this.clearFontName():this.execAction("fontName",{value:t})},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}}),t.extensions.fontName=s,l=t.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'<i class="fa fa-text-height"></i>',init:function(){t.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(t){if(t.preventDefault(),t.stopPropagation(),!this.isDisplayed()){var e=this.document.queryCommandValue("fontSize")+"";this.showForm(e)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(t){var e=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),e.value=t||"",e.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var t=this.document,e=t.createElement("div"),n=t.createElement("input"),o=t.createElement("a"),r=t.createElement("a");return e.className="medium-editor-toolbar-form",e.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(e,"click",this.handleFormClick.bind(this)),n.setAttribute("type","range"),n.setAttribute("min","1"),n.setAttribute("max","7"),n.className="medium-editor-toolbar-input",e.appendChild(n),this.on(n,"change",this.handleSliderChange.bind(this)),r.setAttribute("href","#"),r.className="medium-editor-toobar-save",r.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-check"></i>':"✓",e.appendChild(r),this.on(r,"click",this.handleSaveClick.bind(this),!0),o.setAttribute("href","#"),o.className="medium-editor-toobar-close",o.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'<i class="fa fa-times"></i>':"×",e.appendChild(o),this.on(o,"click",this.handleCloseClick.bind(this)),e},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){t.selection.getSelectedElements(this.document).forEach((function(t){"font"===t.nodeName.toLowerCase()&&t.hasAttribute("size")&&t.removeAttribute("size")}))},handleSliderChange:function(){var t=this.getInput().value;"4"===t?this.clearFontSize():this.execAction("fontSize",{value:t})},handleFormClick:function(t){t.stopPropagation()},handleSaveClick:function(t){t.preventDefault(),this.doFormSave()},handleCloseClick:function(t){t.preventDefault(),this.doFormCancel()}}),t.extensions.fontSize=l,function(){var e="%ME_PASTEBIN%",n=null,o=null,r=function(t){t.stopPropagation()};function i(t,e,n){var o=t.clipboardData||e.clipboardData||n.dataTransfer,r={};if(!o)return r;if(o.getData){var i=o.getData("Text");i&&i.length>0&&(r["text/plain"]=i)}if(o.types)for(var a=0;a<o.types.length;a++){var s=o.types[a];r[s]=o.getData(s)}return r}var a=t.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){t.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach((function(t){this.on(t,"paste",this.handlePaste.bind(this))}),this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(t,e){this.on(e,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(t,e){if(!t.defaultPrevented){var n=i(t,this.window,this.document),o=n["text/html"],r=n["text/plain"];this.window.clipboardData&&void 0===t.clipboardData&&!o&&(o=r),(o||r)&&(t.preventDefault(),this.doPaste(o,r,e))}},doPaste:function(e,n,o){var r,i,a="";if(this.cleanPastedHTML&&e)return this.cleanPaste(e);if(n){if(this.getEditorOption("disableReturn")||o&&o.getAttribute("data-disable-return"))a=t.util.htmlEntities(n);else if((r=n.split(/[\r\n]+/g)).length>1)for(i=0;i<r.length;i+=1)""!==r[i]&&(a+="<p>"+t.util.htmlEntities(r[i])+"</p>");else a=t.util.htmlEntities(r[0]);t.util.insertHTMLCommand(this.document,a)}},handlePasteBinPaste:function(t){if(t.defaultPrevented)this.removePasteBin();else{var e=i(t,this.window,this.document),n=e["text/html"],r=e["text/plain"],a=o;if(!this.cleanPastedHTML||n)return t.preventDefault(),this.removePasteBin(),this.doPaste(n,r,a),void this.trigger("editablePaste",{currentTarget:a,target:a},a);setTimeout(function(){this.cleanPastedHTML&&(n=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(n,r,a),this.trigger("editablePaste",{currentTarget:a,target:a},a)}.bind(this),0)}},handleKeydown:function(e,n){t.util.isKey(e,t.util.keyCode.V)&&t.util.isMetaCtrlKey(e)&&(e.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(n))},createPasteBin:function(i){var a,s=t.selection.getSelectionRange(this.document),l=this.window.pageYOffset;o=i,s&&((a=s.getClientRects()).length?l+=a[0].top:void 0!==s.startContainer.getBoundingClientRect?l+=s.startContainer.getBoundingClientRect().top:l+=s.getBoundingClientRect().top),n=s;var u=this.document.createElement("div");u.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),u.setAttribute("style","border: 1px red solid; position: absolute; top: "+l+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),u.setAttribute("contentEditable",!0),u.innerHTML=e,this.document.body.appendChild(u),this.on(u,"focus",r),this.on(u,"focusin",r),this.on(u,"focusout",r),u.focus(),t.selection.selectNode(u,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(u,"paste",this.boundHandlePaste)},removePasteBin:function(){null!==n&&(t.selection.selectRange(this.document,n),n=null),null!==o&&(o=null);var e=this.getPasteBin();e&&e&&(this.off(e,"focus",r),this.off(e,"focusin",r),this.off(e,"focusout",r),this.off(e,"paste",this.boundHandlePaste),e.parentElement.removeChild(e))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var t=this.getPasteBin();if(!t)return!1;if(t.firstChild&&"mcepastebin"===t.firstChild.id)return!1;var n=t.innerHTML;return!(!n||n===e)&&n},cleanPaste:function(t){var e,n,o,r,i=/<p|<br|<div/.test(t),a=[].concat(this.preCleanReplacements||[],[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]],this.cleanReplacements||[]);for(e=0;e<a.length;e+=1)t=t.replace(a[e][0],a[e][1]);if(!i)return this.pasteHTML(t);for((o=this.document.createElement("div")).innerHTML="<p>"+t.split("<br><br>").join("</p><p>")+"</p>",n=o.querySelectorAll("a,p,div,br"),e=0;e<n.length;e+=1)switch((r=n[e]).innerHTML=r.innerHTML.replace(/\n/gi," "),r.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(r);break;case"br":this.filterLineBreak(r)}this.pasteHTML(o.innerHTML)},pasteHTML:function(e,n){n=t.util.defaults({},n,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var o,r,i,a,s=this.document.createDocumentFragment();for(s.appendChild(this.document.createElement("body")),(a=s.querySelector("body")).innerHTML=e,this.cleanupSpans(a),o=a.querySelectorAll("*"),i=0;i<o.length;i+=1)"a"===(r=o[i]).nodeName.toLowerCase()&&this.getEditorOption("targetBlank")&&t.util.setTargetBlank(r),t.util.cleanupAttrs(r,n.cleanAttrs),t.util.cleanupTags(r,n.cleanTags),t.util.unwrapTags(r,n.unwrapTags);t.util.insertHTMLCommand(this.document,a.innerHTML.replace(/ /g," "))},isCommonBlock:function(t){return t&&("p"===t.nodeName.toLowerCase()||"div"===t.nodeName.toLowerCase())},filterCommonBlocks:function(t){/^\s*$/.test(t.textContent)&&t.parentNode&&t.parentNode.removeChild(t)},filterLineBreak:function(t){this.isCommonBlock(t.previousElementSibling)?this.removeWithParent(t):!this.isCommonBlock(t.parentNode)||t.parentNode.firstChild!==t&&t.parentNode.lastChild!==t?t.parentNode&&1===t.parentNode.childElementCount&&""===t.parentNode.textContent&&this.removeWithParent(t):this.removeWithParent(t)},removeWithParent:function(t){t&&t.parentNode&&(t.parentNode.parentNode&&1===t.parentNode.childElementCount?t.parentNode.parentNode.removeChild(t.parentNode):t.parentNode.removeChild(t))},cleanupSpans:function(e){var n,o,r,i=e.querySelectorAll(".replace-with"),a=function(t){return t&&"#text"!==t.nodeName&&"false"===t.getAttribute("contenteditable")};for(n=0;n<i.length;n+=1)o=i[n],r=this.document.createElement(o.classList.contains("bold")?"b":"i"),o.classList.contains("bold")&&o.classList.contains("italic")?r.innerHTML="<i>"+o.innerHTML+"</i>":r.innerHTML=o.innerHTML,o.parentNode.replaceChild(r,o);for(i=e.querySelectorAll("span"),n=0;n<i.length;n+=1){if(o=i[n],t.util.traverseUp(o,a))return!1;t.util.unwrap(o,this.document)}}});t.extensions.paste=a}(),u=t.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){t.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(t,e){this.initElement(e)},initElement:function(t){t.getAttribute("data-placeholder")||t.setAttribute("data-placeholder",this.text),this.updatePlaceholder(t)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(t,e){this.cleanupElement(e)},cleanupElement:function(t){t.getAttribute("data-placeholder")===this.text&&t.removeAttribute("data-placeholder")},showPlaceholder:function(e){e&&(t.util.isFF&&0===e.childNodes.length?(e.classList.add("medium-editor-placeholder-relative"),e.classList.remove("medium-editor-placeholder")):(e.classList.add("medium-editor-placeholder"),e.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(t){t&&(t.classList.remove("medium-editor-placeholder"),t.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(t,e){if(t.querySelector("img, blockquote, ul, ol, table")||""!==t.textContent.replace(/^\s+|\s+$/g,""))return this.hidePlaceholder(t);e||this.showPlaceholder(t)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(t,e){var n=this.hideOnClick&&e===this.base.getFocusedElement();this.updatePlaceholder(e,n)},handleFocus:function(t,e){this.hidePlaceholder(e)},handleBlur:function(t,e){this.updatePlaceholder(e)}}),t.extensions.placeholder=u,c=t.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){t.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(t,e){return this.base.extensions.forEach((function(n){if(n!==this)return t.apply(e||this,arguments)}),this)},createToolbar:function(){var t=this.document.createElement("div");return t.id="medium-editor-toolbar-"+this.getEditorId(),t.className="medium-editor-toolbar",this.static?t.className+=" static-toolbar":this.relativeContainer?t.className+=" medium-editor-relative-toolbar":t.className+=" medium-editor-stalker-toolbar",t.appendChild(this.createToolbarButtons()),this.forEachExtension((function(e){e.hasForm&&t.appendChild(e.getForm())})),this.attachEventHandlers(),t},createToolbarButtons:function(){var e,n,o,r,i,a,s=this.document.createElement("ul");return s.id="medium-editor-toolbar-actions"+this.getEditorId(),s.className="medium-editor-toolbar-actions",s.style.display="block",this.buttons.forEach((function(o){"string"==typeof o?(i=o,a=null):(i=o.name,a=o),(r=this.base.addBuiltInExtension(i,a))&&"function"==typeof r.getButton&&(n=r.getButton(this.base),e=this.document.createElement("li"),t.util.isElement(n)?e.appendChild(n):e.innerHTML=n,s.appendChild(e))}),this),(o=s.querySelectorAll("button")).length>0&&(o[0].classList.add(this.firstButtonClass),o[o.length-1].classList.add(this.lastButtonClass)),s},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=t.util.throttle(function(){this.base.isActive&&this.positionToolbarIfShown()}.bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(e){if(e&&e.target&&t.util.isDescendant(this.getToolbarElement(),e.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout(function(){this.checkState()}.bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout(function(){this.hideToolbar()}.bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return"block"===this.getToolbarActionsElement().style.display},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay(function(){this.showToolbar()}.bind(this))},hideExtensionForms:function(){this.forEachExtension((function(t){t.hasForm&&t.isDisplayed()&&t.hideForm()}))},multipleBlockElementsSelected:function(){var e=new RegExp("<("+t.util.blockContainerElementNames.join("|")+")[^>]*>","g"),n=t.selection.getSelectionHtml(this.document).replace(/<[^\/>][^>]*><\/[^>]+>/gim,"").match(e);return!!n&&n.length>1},modifySelection:function(){var e=this.window.getSelection().getRangeAt(0);if(this.standardizeSelectionStart&&e.startContainer.nodeValue&&e.startOffset===e.startContainer.nodeValue.length){var n=t.util.findAdjacentTextNodeWithContent(t.selection.getSelectionElement(this.window),e.startContainer,this.document);if(n){for(var o=0;0===n.nodeValue.substr(o,1).trim().length;)o+=1;e=t.selection.select(this.document,n,o,e.endContainer,e.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||t.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var e=t.selection.getSelectionElement(this.window);return!e||-1===this.getEditorElements().indexOf(e)||e.getAttribute("data-disable-toolbar")?this.hideToolbar():this.updateOnEmptySelection&&this.static?this.showAndUpdateToolbar():!t.selection.selectionContainsContent(this.document)||!1===this.allowMultiParagraphSelection&&this.multipleBlockElementsSelected()?this.hideToolbar():void this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension((function(t){"function"==typeof t.isActive&&"function"==typeof t.setInactive&&t.setInactive()})),this.checkActiveButtons()},checkActiveButtons:function(){var e,n=[],o=null,r=t.selection.getSelectionRange(this.document),i=function(t){"function"==typeof t.checkState?t.checkState(e):"function"==typeof t.isActive&&"function"==typeof t.isAlreadyApplied&&"function"==typeof t.setActive&&!t.isActive()&&t.isAlreadyApplied(e)&&t.setActive()};if(r&&(this.forEachExtension((function(t){"function"!=typeof t.queryCommandState||null===(o=t.queryCommandState())?n.push(t):o&&"function"==typeof t.setActive&&t.setActive()})),e=t.selection.getSelectedParentElement(r),this.getEditorElements().some((function(n){return t.util.isDescendant(n,e,!0)}))))for(;e&&(n.forEach(i),!t.util.isMediumEditorElement(e));)e=e.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var t=this.base.getFocusedElement(),e=this.window.getSelection();if(!t)return this;!this.static&&e.isCollapsed||(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(t):this.positionToolbar(e)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(t){this.getToolbarElement().style.left="0";var e,n=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,o=this.window.innerWidth,r=this.getToolbarElement(),i=t.getBoundingClientRect(),a=i.top+n,s=i.left+i.width/2,l=r.offsetHeight,u=r.offsetWidth,c=u/2;switch(this.sticky?n>a+t.offsetHeight-l-this.stickyTopOffset?(r.style.top=a+t.offsetHeight-l+"px",r.classList.remove("medium-editor-sticky-toolbar")):n>a-l-this.stickyTopOffset?(r.classList.add("medium-editor-sticky-toolbar"),r.style.top=this.stickyTopOffset+"px"):(r.classList.remove("medium-editor-sticky-toolbar"),r.style.top=a-l+"px"):r.style.top=a-l+"px",this.align){case"left":e=i.left;break;case"right":e=i.right-u;break;case"center":e=s-c}e<0?e=0:e+u>o&&(e=o-Math.ceil(u)-1),r.style.left=e+"px"},positionToolbar:function(t){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var e=t.getRangeAt(0),n=e.getBoundingClientRect();(!n||0===n.height&&0===n.width&&e.startContainer===e.endContainer)&&(n=1===e.startContainer.nodeType&&e.startContainer.querySelector("img")?e.startContainer.querySelector("img").getBoundingClientRect():e.startContainer.getBoundingClientRect());var o,r,i=this.window.innerWidth,a=this.getToolbarElement(),s=a.offsetHeight,l=a.offsetWidth/2,u=this.diffLeft-l,c=this.getEditorOption("elementsContainer"),d=["absolute","fixed"].indexOf(window.getComputedStyle(c).getPropertyValue("position"))>-1,p={},h={};d?(r=c.getBoundingClientRect(),["top","left"].forEach((function(t){h[t]=n[t]-r[t]})),h.width=n.width,h.height=n.height,n=h,i=r.width,p.top=c.scrollTop):p.top=this.window.pageYOffset,o=n.left+n.width/2,p.top+=n.top-s,n.top<50?(a.classList.add("medium-toolbar-arrow-over"),a.classList.remove("medium-toolbar-arrow-under"),p.top+=50+n.height-this.diffTop):(a.classList.add("medium-toolbar-arrow-under"),a.classList.remove("medium-toolbar-arrow-over"),p.top+=this.diffTop),o<l?(p.left=u+l,p.right="initial"):i-o<l?(p.left="auto",p.right=0):(p.left=u+o,p.right="initial"),["top","left","right"].forEach((function(t){a.style[t]=p[t]+(isNaN(p[t])?"":"px")}))}}),t.extensions.toolbar=c,d=t.Extension.extend({init:function(){t.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(t){var e="medium-editor-dragover";t.preventDefault(),t.dataTransfer.dropEffect="copy","dragover"===t.type?t.target.classList.add(e):"dragleave"===t.type&&t.target.classList.remove(e)},handleDrop:function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.files&&Array.prototype.slice.call(e.dataTransfer.files,0).some(function(e){var n,o;e.type.match("image")&&((n=new FileReader).readAsDataURL(e),o="medium-img-"+ +new Date,t.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+o+'" />'),n.onload=function(){var t=this.document.getElementById(o);t&&(t.removeAttribute("id"),t.removeAttribute("class"),t.src=n.result)}.bind(this))}.bind(this)),e.target.classList.remove("medium-editor-dragover")}}),t.extensions.imageDragging=d,function(){function e(e){var n=t.selection.getSelectionStart(this.options.ownerDocument),o=n.textContent,r=t.selection.getCaretOffsets(n);(void 0===o[r.left-1]||""===o[r.left-1].trim()||void 0!==o[r.left]&&""===o[r.left].trim())&&e.preventDefault()}function n(e,n){if(this.options.disableReturn||n.getAttribute("data-disable-return"))e.preventDefault();else if(this.options.disableDoubleReturn||n.getAttribute("data-disable-double-return")){var o=t.selection.getSelectionStart(this.options.ownerDocument);(o&&""===o.textContent.trim()&&"li"!==o.nodeName.toLowerCase()||o.previousElementSibling&&"br"!==o.previousElementSibling.nodeName.toLowerCase()&&""===o.previousElementSibling.textContent.trim())&&e.preventDefault()}}function o(e){var n=t.selection.getSelectionStart(this.options.ownerDocument);"pre"===(n&&n.nodeName.toLowerCase())&&(e.preventDefault(),t.util.insertHTMLCommand(this.options.ownerDocument," ")),t.util.isListItem(n)&&(e.preventDefault(),e.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function r(e){var n,o=t.selection.getSelectionStart(this.options.ownerDocument),r=o.nodeName.toLowerCase(),i=/^(\s+|<br\/?>)?$/i,a=/h\d/i;t.util.isKey(e,[t.util.keyCode.BACKSPACE,t.util.keyCode.ENTER])&&o.previousElementSibling&&a.test(r)&&0===t.selection.getCaretOffsets(o).left?t.util.isKey(e,t.util.keyCode.BACKSPACE)&&i.test(o.previousElementSibling.innerHTML)?(o.previousElementSibling.parentNode.removeChild(o.previousElementSibling),e.preventDefault()):!this.options.disableDoubleReturn&&t.util.isKey(e,t.util.keyCode.ENTER)&&((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",o.previousElementSibling.parentNode.insertBefore(n,o),e.preventDefault()):t.util.isKey(e,t.util.keyCode.DELETE)&&o.nextElementSibling&&o.previousElementSibling&&!a.test(r)&&i.test(o.innerHTML)&&a.test(o.nextElementSibling.nodeName.toLowerCase())?(t.selection.moveCursor(this.options.ownerDocument,o.nextElementSibling),o.previousElementSibling.parentNode.removeChild(o),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&"li"===r&&i.test(o.innerHTML)&&!o.previousElementSibling&&!o.parentElement.previousElementSibling&&o.nextElementSibling&&"li"===o.nextElementSibling.nodeName.toLowerCase()?((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",o.parentElement.parentElement.insertBefore(n,o.parentElement),t.selection.moveCursor(this.options.ownerDocument,n),o.parentElement.removeChild(o),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&!1!==t.util.getClosestTag(o,"blockquote")&&0===t.selection.getCaretOffsets(o).left?(e.preventDefault(),t.util.execFormatBlock(this.options.ownerDocument,"p")):t.util.isKey(e,t.util.keyCode.ENTER)&&!1!==t.util.getClosestTag(o,"blockquote")&&0===t.selection.getCaretOffsets(o).right?((n=this.options.ownerDocument.createElement("p")).innerHTML="<br>",o.parentElement.insertBefore(n,o.nextSibling),t.selection.moveCursor(this.options.ownerDocument,n),e.preventDefault()):t.util.isKey(e,t.util.keyCode.BACKSPACE)&&t.util.isMediumEditorElement(o.parentElement)&&!o.previousElementSibling&&o.nextElementSibling&&i.test(o.innerHTML)&&(e.preventDefault(),t.selection.moveCursor(this.options.ownerDocument,o.nextSibling),o.parentElement.removeChild(o))}function i(e){var n=t.selection.getSelectionStart(this.options.ownerDocument);n&&(t.util.isMediumEditorElement(n)&&0===n.children.length&&!t.util.isBlockContainer(n)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),!t.util.isKey(e,t.util.keyCode.ENTER)||t.util.isListItem(n)||t.util.isBlockContainer(n)||("a"===n.nodeName.toLowerCase()?this.options.ownerDocument.execCommand("unlink",!1,null):e.shiftKey||e.ctrlKey||this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function a(t,e){var n=e.parentNode.querySelector('textarea[medium-editor-textarea-id="'+e.getAttribute("medium-editor-textarea-id")+'"]');n&&(n.value=e.innerHTML.trim())}function s(t){t._mediumEditors||(t._mediumEditors=[null]),this.id||(this.id=t._mediumEditors.length),t._mediumEditors[this.id]=this}function l(t){t._mediumEditors&&t._mediumEditors[this.id]&&(t._mediumEditors[this.id]=null)}function u(e,n,o){var r=[];if(e||(e=[]),"string"==typeof e&&(e=n.querySelectorAll(e)),t.util.isElement(e)&&(e=[e]),o)for(var i=0;i<e.length;i++){var a=e[i];!t.util.isElement(a)||a.getAttribute("data-medium-editor-element")||a.getAttribute("medium-editor-textarea-id")||r.push(a)}else r=Array.prototype.slice.apply(e);return r}function c(t){var e=t.parentNode.querySelector('textarea[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]');e&&(e.classList.remove("medium-editor-hidden"),e.removeAttribute("medium-editor-textarea-id")),t.parentNode&&t.parentNode.removeChild(t)}function d(t,e,n){return t=function(t,e){return Object.keys(e).forEach((function(n){void 0===t[n]&&(t[n]=e[n])})),t}(t,{window:n.options.contentWindow,document:n.options.ownerDocument,base:n}),"function"==typeof t.init&&t.init(),t.name||(t.name=e),t}function p(){return!this.elements.every((function(t){return!!t.getAttribute("data-disable-toolbar")}))&&!1!==this.options.toolbar}function h(){return!!p.call(this)&&!1!==this.options.anchorPreview}function f(){return!1!==this.options.placeholder}function g(){return!1!==this.options.autoLink}function v(){return!1!==this.options.imageDragging}function y(){return!1!==this.options.keyboardCommands}function m(){return!this.options.extensions.imageDragging}function b(t){for(var e=this.options.ownerDocument.createElement("div"),n=Date.now(),o="medium-editor-"+n,r=t.attributes;this.options.ownerDocument.getElementById(o);)n++,o="medium-editor-"+n;e.className=t.className,e.id=o,e.innerHTML=t.value,t.setAttribute("medium-editor-textarea-id",o);for(var i=0,a=r.length;i<a;i++)e.hasAttribute(r[i].nodeName)||e.setAttribute(r[i].nodeName,r[i].value);return t.form&&this.on(t.form,"reset",function(t){t.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(o))}.bind(this)),t.classList.add("medium-editor-hidden"),t.parentNode.insertBefore(e,t),e}function _(e,o){if(!e.getAttribute("data-medium-editor-element")){"textarea"===e.nodeName.toLowerCase()&&(e=b.call(this,e),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=a.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),this.options.disableEditing||e.getAttribute("data-disable-editing")||(e.setAttribute("contentEditable",!0),e.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(e.getAttribute("data-disable-return")||e.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=n.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),this.options.disableReturn||e.getAttribute("data-disable-return")||this.on(e,"keyup",i.bind(this));var r=t.util.guid();e.setAttribute("data-medium-editor-element",!0),e.classList.add("medium-editor-element"),e.setAttribute("role","textbox"),e.setAttribute("aria-multiline",!0),e.setAttribute("data-medium-editor-editor-index",o),e.setAttribute("medium-editor-index",r),M[r]=e.innerHTML,this.events.attachAllEventsToElement(e)}return e}function x(){this.subscribe("editableKeydownTab",o.bind(this)),this.subscribe("editableKeydownDelete",r.bind(this)),this.subscribe("editableKeydownEnter",r.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",e.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=n.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function E(){if(this.extensions=[],Object.keys(this.options.extensions).forEach((function(t){"toolbar"!==t&&this.options.extensions[t]&&this.extensions.push(d(this.options.extensions[t],t,this))}),this),m.call(this)){var e=this.options.fileDragging;e||(e={},v.call(this)||(e.allowedTypes=[])),this.addBuiltInExtension("fileDragging",e)}var n={paste:!0,"anchor-preview":h.call(this),autoLink:g.call(this),keyboardCommands:y.call(this),placeholder:f.call(this)};Object.keys(n).forEach((function(t){n[t]&&this.addBuiltInExtension(t)}),this);var o=this.options.extensions.toolbar;if(!o&&p.call(this)){var r=t.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});o=new t.extensions.toolbar(r)}o&&this.extensions.push(d(o,"toolbar",this))}function w(e,n){return n&&[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]].forEach((function(e){n.hasOwnProperty(e[0])&&void 0!==n[e[0]]&&t.util.deprecated(e[0],e[1],"v6.0.0")})),t.util.defaults({},n,e)}function S(e,n){var o,r;if(o=/^append-(.+)$/gi.exec(e))return t.util.execFormatBlock(this.options.ownerDocument,o[1]);if("fontSize"===e)return n.size&&t.util.deprecated(".size option for fontSize command",".value","6.0.0"),r=n.value||n.size,this.options.ownerDocument.execCommand("fontSize",!1,r);if("fontName"===e)return n.name&&t.util.deprecated(".name option for fontName command",".value","6.0.0"),r=n.value||n.name,this.options.ownerDocument.execCommand("fontName",!1,r);if("createLink"===e)return this.createLink(n);if("image"===e){var i=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,i)}if("html"===e){var a=this.options.contentWindow.getSelection().toString().trim();return t.util.insertHTMLCommand(this.options.ownerDocument,a)}if(/justify([A-Za-z]*)$/g.exec(e)){var s=this.options.ownerDocument.execCommand(e,!1,null),l=t.selection.getSelectedParentElement(t.selection.getSelectionRange(this.options.ownerDocument));return l&&C.call(this,t.util.getTopBlockContainer(l)),s}return r=n&&n.value,this.options.ownerDocument.execCommand(e,!1,r)}function C(e){if(e){var n,o=Array.prototype.slice.call(e.childNodes).filter((function(t){var e="div"===t.nodeName.toLowerCase();return e&&!n&&(n=t.style.textAlign),e}));o.length&&(this.saveSelection(),o.forEach((function(e){if(e.style.textAlign===n){var o=e.lastChild;if(o){t.util.unwrap(e,this.options.ownerDocument);var r=this.options.ownerDocument.createElement("BR");o.parentNode.insertBefore(r,o.nextSibling)}}}),this),e.style.textAlign=n,this.restoreSelection())}}var M={};t.prototype={init:function(t,e){return this.options=w.call(this,this.defaults,e),this.origElements=t,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(s.call(this,this.options.contentWindow),this.events=new t.Events(this),this.elements=[],this.addElements(this.origElements),0!==this.elements.length&&(this.isActive=!0,E.call(this),x.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach((function(t){"function"==typeof t.destroy&&t.destroy()}),this),this.events.destroy(),this.elements.forEach((function(t){this.options.spellcheck&&(t.innerHTML=t.innerHTML),t.removeAttribute("contentEditable"),t.removeAttribute("spellcheck"),t.removeAttribute("data-medium-editor-element"),t.classList.remove("medium-editor-element"),t.removeAttribute("role"),t.removeAttribute("aria-multiline"),t.removeAttribute("medium-editor-index"),t.removeAttribute("data-medium-editor-editor-index"),t.getAttribute("medium-editor-textarea-id")&&c(t)}),this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,l.call(this,this.options.contentWindow))},on:function(t,e,n,o){return this.events.attachDOMEvent(t,e,n,o),this},off:function(t,e,n,o){return this.events.detachDOMEvent(t,e,n,o),this},subscribe:function(t,e){return this.events.attachCustomEvent(t,e),this},unsubscribe:function(t,e){return this.events.detachCustomEvent(t,e),this},trigger:function(t,e,n){return this.events.triggerCustomEvent(t,e,n),this},delay:function(t){var e=this;return setTimeout((function(){e.isActive&&t()}),this.options.delay)},serialize:function(){var t,e={},n=this.elements.length;for(t=0;t<n;t+=1)e[""!==this.elements[t].id?this.elements[t].id:"element-"+t]={value:this.elements[t].innerHTML.trim()};return e},getExtensionByName:function(t){var e;return this.extensions&&this.extensions.length&&this.extensions.some((function(n){return n.name===t&&(e=n,!0)})),e},addBuiltInExtension:function(e,n){var o,r=this.getExtensionByName(e);if(r)return r;switch(e){case"anchor":o=t.util.extend({},this.options.anchor,n),r=new t.extensions.anchor(o);break;case"anchor-preview":r=new t.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":r=new t.extensions.autoLink;break;case"fileDragging":r=new t.extensions.fileDragging(n);break;case"fontname":r=new t.extensions.fontName(this.options.fontName);break;case"fontsize":r=new t.extensions.fontSize(n);break;case"keyboardCommands":r=new t.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":r=new t.extensions.paste(this.options.paste);break;case"placeholder":r=new t.extensions.placeholder(this.options.placeholder);break;default:t.extensions.button.isBuiltInButton(e)&&(n?(o=t.util.defaults({},n,t.extensions.button.prototype.defaults[e]),r=new t.extensions.button(o)):r=new t.extensions.button(e))}return r&&this.extensions.push(d(r,e,this)),r},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var t=this.getExtensionByName("toolbar");return t&&t.checkState(),this},queryCommandState:function(t){var e,n=null;(e=/^full-(.+)$/gi.exec(t))&&(t=e[1]);try{n=this.options.ownerDocument.queryCommandState(t)}catch(t){n=null}return n},execAction:function(e,n){var o,r;return(o=/^full-(.+)$/gi.exec(e))?(this.saveSelection(),this.selectAllContents(),r=S.call(this,o[1],n),this.restoreSelection()):r=S.call(this,e,n),"insertunorderedlist"!==e&&"insertorderedlist"!==e||t.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),r},getSelectedParentElement:function(e){return void 0===e&&(e=this.options.contentWindow.getSelection().getRangeAt(0)),t.selection.getSelectedParentElement(e)},selectAllContents:function(){var e=t.selection.getSelectionElement(this.options.contentWindow);if(e){for(;1===e.children.length;)e=e.children[0];this.selectElement(e)}},selectElement:function(e){t.selection.selectNode(e,this.options.ownerDocument);var n=t.selection.getSelectionElement(this.options.contentWindow);n&&this.events.focusElement(n)},getFocusedElement:function(){var t;return this.elements.some((function(e){return!t&&e.getAttribute("data-medium-focused")&&(t=e),!!t}),this),t},exportSelection:function(){var e=t.selection.getSelectionElement(this.options.contentWindow),n=this.elements.indexOf(e),o=null;return n>=0&&(o=t.selection.exportSelection(e,this.options.ownerDocument)),null!==o&&0!==n&&(o.editableElementIndex=n),o},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(e,n){if(e){var o=this.elements[e.editableElementIndex||0];t.selection.importSelection(e,o,this.options.ownerDocument,n)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(e){var n,o=t.selection.getSelectionElement(this.options.contentWindow),r={};if(-1!==this.elements.indexOf(o)){try{if(this.events.disableCustomEvent("editableInput"),e.url&&t.util.deprecated(".url option for createLink",".value","6.0.0"),(n=e.url||e.value)&&n.trim().length>0){var i=this.options.contentWindow.getSelection();if(i){var a,s,l,u,c=i.getRangeAt(0),d=c.commonAncestorContainer;if(3===c.endContainer.nodeType&&3!==c.startContainer.nodeType&&0===c.startOffset&&c.startContainer.firstChild===c.endContainer&&(d=c.endContainer),s=t.util.getClosestBlockContainer(c.startContainer),l=t.util.getClosestBlockContainer(c.endContainer),3!==d.nodeType&&0!==d.textContent.length&&s===l){var p=s||o,h=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),a=this.exportSelection(),h.appendChild(p.cloneNode(!0)),o===p?t.selection.select(this.options.ownerDocument,p.firstChild,0,p.lastChild,3===p.lastChild.nodeType?p.lastChild.nodeValue.length:p.lastChild.childNodes.length):t.selection.select(this.options.ownerDocument,p,0,p,p.childNodes.length);var f=this.exportSelection();0===(u=t.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,h,{start:a.start-f.start,end:a.end-f.start,editableElementIndex:a.editableElementIndex})).length&&((h=this.options.ownerDocument.createDocumentFragment()).appendChild(d.cloneNode(!0)),u=[h.firstChild.firstChild,h.firstChild.lastChild]),t.util.createLink(this.options.ownerDocument,u,n.trim());var g=(h.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;t.util.insertHTMLCommand(this.options.ownerDocument,h.firstChild.innerHTML.replace(/^\s+/,"")),a.start-=g,a.end-=g,this.importSelection(a)}else this.options.ownerDocument.execCommand("createLink",!1,n);this.options.targetBlank||"_blank"===e.target?t.util.setTargetBlank(t.selection.getSelectionStart(this.options.ownerDocument),n):t.util.removeTargetBlank(t.selection.getSelectionStart(this.options.ownerDocument),n),e.buttonClass&&t.util.addClassToAnchors(t.selection.getSelectionStart(this.options.ownerDocument),e.buttonClass)}}if(this.options.targetBlank||"_blank"===e.target||e.buttonClass){(r=this.options.ownerDocument.createEvent("HTMLEvents")).initEvent("input",!0,!0,this.options.contentWindow);for(var v=0,y=this.elements.length;v<y;v+=1)this.elements[v].dispatchEvent(r)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",r,o)}},cleanPaste:function(t){this.getExtensionByName("paste").cleanPaste(t)},pasteHTML:function(t,e){this.getExtensionByName("paste").pasteHTML(t,e)},setContent:function(t,e){if(e=e||0,this.elements[e]){var n=this.elements[e];n.innerHTML=t,this.checkContentChanged(n)}},getContent:function(t){return t=t||0,this.elements[t]?this.elements[t].innerHTML.trim():null},checkContentChanged:function(e){e=e||t.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(e,{target:e,currentTarget:e})},resetContent:function(t){if(t){var e=this.elements.indexOf(t);-1!==e&&this.setContent(M[t.getAttribute("medium-editor-index")],e)}else this.elements.forEach((function(t,e){this.setContent(M[t.getAttribute("medium-editor-index")],e)}),this)},addElements:function(t){var e=u(t,this.options.ownerDocument,!0);if(0===e.length)return!1;e.forEach((function(t){t=_.call(this,t,this.id),this.elements.push(t),this.trigger("addElement",{target:t,currentTarget:t},t)}),this)},removeElements:function(t){var e=u(t,this.options.ownerDocument).map((function(t){return t.getAttribute("medium-editor-textarea-id")&&t.parentNode?t.parentNode.querySelector('div[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]'):t}));this.elements=this.elements.filter((function(t){return-1===e.indexOf(t)||(this.events.cleanupElement(t),t.getAttribute("medium-editor-textarea-id")&&c(t),this.trigger("removeElement",{target:t,currentTarget:t},t),!1)}),this)}},t.getEditorFromElement=function(t){var e=t.getAttribute("data-medium-editor-editor-index"),n=t&&t.ownerDocument&&(t.ownerDocument.defaultView||t.ownerDocument.parentWindow);return n&&n._mediumEditors&&n._mediumEditors[e]?n._mediumEditors[e]:null}}(),t.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0},t.parseVersionString=function(t){var e=t.split("-"),n=e[0].split("."),o=e.length>1?e[1]:"";return{major:parseInt(n[0],10),minor:parseInt(n[1],10),revision:parseInt(n[2],10),preRelease:o,toString:function(){return[n[0],n[1],n[2]].join(".")+(o?"-"+o:"")}}},t.version=t.parseVersionString.call(this,"5.23.3"),t}())}(pT);var hT=dT,fT=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},gT=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),vT=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],o=!0,r=!1,i=void 0;try{for(var a,s=t[Symbol.iterator]();!(o=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);o=!0);}catch(t){r=!0,i=t}finally{try{!o&&s.return&&s.return()}finally{if(r)throw i}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")};
|
|
35
35
|
/*!
|
|
36
36
|
* vanilla-picker v2.12.3
|
|
37
37
|
* https://vanilla-picker.js.org
|
|
38
38
|
*
|
|
39
39
|
* Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
|
|
40
40
|
* Released under the ISC license.
|
|
41
|
-
*/String.prototype.startsWith=String.prototype.startsWith||function(t){return 0===this.indexOf(t)},String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var IT={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function jT(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString())||"0"}var BT=function(){function t(e,n,o,r){kT(this,t);var i=this;if(void 0===e);else if(Array.isArray(e))this.rgba=e;else if(void 0===o){var a=e&&""+e;a&&function(e){if(e.startsWith("hsl")){var n=e.match(/([\-\d\.e]+)/g).map(Number),o=LT(n,4),r=o[0],a=o[1],s=o[2],l=o[3];void 0===l&&(l=1),r/=360,a/=100,s/=100,i.hsla=[r,a,s,l]}else if(e.startsWith("rgb")){var u=e.match(/([\-\d\.e]+)/g).map(Number),c=LT(u,4),d=c[0],p=c[1],h=c[2],f=c[3];void 0===f&&(f=1),i.rgba=[d,p,h,f]}else e.startsWith("#")?i.rgba=t.hexToRgb(e):i.rgba=t.nameToRgb(e)||t.hexToRgb(e)}(a.toLowerCase())}else this.rgba=[e,n,o,void 0===r?1:r]}return RT(t,[{key:"printRGB",value:function(t){var e=(t?this.rgba:this.rgba.slice(0,3)).map((function(t,e){return jT(t,3===e?3:0)}));return t?"rgba("+e+")":"rgb("+e+")"}},{key:"printHSL",value:function(t){var e=[360,100,100,1],n=["","%","%",""],o=(t?this.hsla:this.hsla.slice(0,3)).map((function(t,o){return jT(t*e[o],3===o?3:1)+n[o]}));return t?"hsla("+o+")":"hsl("+o+")"}},{key:"printHex",value:function(t){var e=this.hex;return t?e:e.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(t){3===t.length&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(t){3===t.length&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var t=this.rgba.map((function(t,e){return e<3?t.toString(16):Math.round(255*t).toString(16)}));return"#"+t.map((function(t){return t.padStart(2,"0")})).join("")},set:function(e){this.rgba=t.hexToRgb(e)}}],[{key:"hexToRgb",value:function(t){var e=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!e.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var n=e.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));return n[3]=n[3]/255,n}},{key:"nameToRgb",value:function(e){var n=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),o=IT[n];return void 0===o?o:t.hexToRgb(o.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var e=LT(t,4),n=e[0],o=e[1],r=e[2],i=e[3];n/=255,o/=255,r/=255;var a=Math.max(n,o,r),s=Math.min(n,o,r),l=void 0,u=void 0,c=(a+s)/2;if(a===s)l=u=0;else{var d=a-s;switch(u=c>.5?d/(2-a-s):d/(a+s),a){case n:l=(o-r)/d+(o<r?6:0);break;case o:l=(r-n)/d+2;break;case r:l=(n-o)/d+4}l/=6}return[l,u,c,i]}},{key:"hslToRgb",value:function(t){var e=LT(t,4),n=e[0],o=e[1],r=e[2],i=e[3],a=void 0,s=void 0,l=void 0;if(0===o)a=s=l=r;else{var u=function(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},c=r<.5?r*(1+o):r+o-r*o,d=2*r-c;a=u(d,c,n+1/3),s=u(d,c,n),l=u(d,c,n-1/3)}var p=[255*a,255*s,255*l].map(Math.round);return p[3]=i,p}}]),t}(),HT=function(){function t(){kT(this,t),this._events=[]}return RT(t,[{key:"add",value:function(t,e,n){t.addEventListener(e,n,!1),this._events.push({target:t,type:e,handler:n})}},{key:"remove",value:function(e,n,o){this._events=this._events.filter((function(r){var i=!0;return e&&e!==r.target&&(i=!1),n&&n!==r.type&&(i=!1),o&&o!==r.handler&&(i=!1),i&&t._doRemove(r.target,r.type,r.handler),!i}))}},{key:"destroy",value:function(){this._events.forEach((function(e){return t._doRemove(e.target,e.type,e.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(t,e,n){t.removeEventListener(e,n,!1)}}]),t}();function FT(t,e,n){var o=!1;function r(t,e,n){return Math.max(e,Math.min(t,n))}function i(t,i,a){if(a&&(o=!0),o){t.preventDefault();var s=e.getBoundingClientRect(),l=s.width,u=s.height,c=i.clientX,d=i.clientY,p=r(c-s.left,0,l),h=r(d-s.top,0,u);n(p/l,h/u)}}function a(t,e){1===(void 0===t.buttons?t.which:t.buttons)?i(t,t,e):o=!1}function s(t,e){1===t.touches.length?i(t,t.touches[0],e):o=!1}t.add(e,"mousedown",(function(t){a(t,!0)})),t.add(e,"touchstart",(function(t){s(t,!0)})),t.add(window,"mousemove",a),t.add(e,"touchmove",s),t.add(window,"mouseup",(function(t){o=!1})),t.add(e,"touchend",(function(t){o=!1})),t.add(e,"touchcancel",(function(t){o=!1}))}var zT="keydown",WT="mousedown",UT="focusin";function XT(t,e){return(e||document).querySelector(t)}function GT(t){t.preventDefault(),t.stopPropagation()}function YT(t,e,n,o,r){t.add(e,zT,(function(t){n.indexOf(t.key)>=0&&(r&>(t),o(t))}))}var VT=function(){function t(e){kT(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new HT,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return RT(t,[{key:"setOptions",value:function(t){var e=this;if(t){var n=this.settings;if(t instanceof HTMLElement)n.parent=t;else{n.parent&&t.parent&&n.parent!==t.parent&&(this._events.remove(n.parent),this._popupInited=!1),function(t,e,n){for(var o in t)n&&n.indexOf(o)>=0||(e[o]=t[o])}(t,n),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var o=t.color||t.colour;o&&this._setColor(o)}var r=n.parent;if(r&&n.popup&&!this._popupInited){var i=function(t){return e.openHandler(t)};this._events.add(r,"click",i),YT(this._events,r,[" ","Spacebar","Enter"],i),this._popupInited=!0}else t.parent&&!n.popup&&this.show()}}},{key:"openHandler",value:function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var e=t&&t.type===zT?this._domEdit:this.domElement;setTimeout((function(){return e.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(t){var e=t&&t.type,n=!1;if(t)if(e===WT||e===UT){var o=(this.__containedEvent||0)+100;t.timeStamp>o&&(n=!0)}else GT(t),n=!0;else n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents="",e!==WT&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(t,e){this.closeHandler(),this.setOptions(t),e&&this.openHandler()}},{key:"setColor",value:function(t,e){this._setColor(t,{silent:e})}},{key:"_setColor",value:function(t,e){if("string"==typeof t&&(t=t.trim()),t){e=e||{};var n=void 0;try{n=new BT(t)}catch(t){if(e.failSilently)return;throw t}if(!this.settings.alpha){var o=n.hsla;o[3]=1,n.hsla=o}this.colour=this.color=n,this._setHSLA(null,null,null,null,e)}}},{key:"setColour",value:function(t,e){this.setColor(t,e)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var t=this._toggleDOM(!0);return this._setPosition(),t}var e,n,o=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',r=(e=o,(n=document.createElement("div")).innerHTML=e,n.firstElementChild);return this.domElement=r,this._domH=XT(".picker_hue",r),this._domSL=XT(".picker_sl",r),this._domA=XT(".picker_alpha",r),this._domEdit=XT(".picker_editor input",r),this._domSample=XT(".picker_sample",r),this._domOkay=XT(".picker_done button",r),this._domCancel=XT(".picker_cancel button",r),r.classList.add("layout_"+this.settings.layout),this.settings.alpha||r.classList.add("no_alpha"),this.settings.editor||r.classList.add("no_editor"),this.settings.cancelButton||r.classList.add("no_cancel"),this._ifPopup((function(){return r.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var t=this,e=this,n=this.domElement,o=this._events;function r(t,e,n){o.add(t,e,n)}r(n,"click",(function(t){return t.preventDefault()})),FT(o,this._domH,(function(t,n){return e._setHSLA(t)})),FT(o,this._domSL,(function(t,n){return e._setHSLA(null,t,1-n)})),this.settings.alpha&&FT(o,this._domA,(function(t,n){return e._setHSLA(null,null,null,1-n)}));var i=this._domEdit;r(i,"input",(function(t){e._setColor(this.value,{fromEditor:!0,failSilently:!0})})),r(i,"focus",(function(t){var e=this;e.selectionStart===e.selectionEnd&&e.select()})),this._ifPopup((function(){var e=function(e){return t.closeHandler(e)};r(window,WT,e),r(window,UT,e),YT(o,n,["Esc","Escape"],e);var i=function(e){t.__containedEvent=e.timeStamp};r(n,WT,i),r(n,UT,i),r(t._domCancel,"click",e)}));var a=function(e){t._ifPopup((function(){return t.closeHandler(e)})),t.onDone&&t.onDone(t.colour)};r(this._domOkay,"click",a),YT(o,n,["Enter"],a)}},{key:"_setPosition",value:function(){var t=this.settings.parent,e=this.domElement;t!==e.parentNode&&t.appendChild(e),this._ifPopup((function(n){"static"===getComputedStyle(t).position&&(t.style.position="relative");var o=!0===n?"popup_right":"popup_"+n;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){t===o?e.classList.add(t):e.classList.remove(t)})),e.classList.add(o)}))}},{key:"_setHSLA",value:function(t,e,n,o,r){r=r||{};var i=this.colour,a=i.hsla;[t,e,n,o].forEach((function(t,e){(t||0===t)&&(a[e]=t)})),i.hsla=a,this._updateUI(r),this.onChange&&!r.silent&&this.onChange(i)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var e=this.colour,n=e.hsla,o="hsl("+360*n[0]+", 100%, 50%)",r=e.hslString,i=e.hslaString,a=this._domH,s=this._domSL,l=this._domA,u=XT(".picker_selector",a),c=XT(".picker_selector",s),d=XT(".picker_selector",l);m(0,u,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=o,m(0,c,n[1]),b(0,c,1-n[2]),s.style.color=r,b(0,d,1-n[3]);var p=r,h=p.replace("hsl","hsla").replace(")",", 0)"),f="linear-gradient("+[p,h]+")";if(this._domA.style.background=f+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!t.fromEditor){var g=this.settings.editorFormat,v=this.settings.alpha,y=void 0;switch(g){case"rgb":y=e.printRGB(v);break;case"hsl":y=e.printHSL(v);break;default:y=e.printHex(v)}this._domEdit.value=y}this._domSample.style.color=i}function m(t,e,n){e.style.left=100*n+"%"}function b(t,e,n){e.style.top=100*n+"%"}}},{key:"_ifPopup",value:function(t,e){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):e&&e()}},{key:"_toggleDOM",value:function(t){var e=this.domElement;if(!e)return!1;var n=t?"":"none",o=e.style.display!==n;return o&&(e.style.display=n),o}}]),t}(),KT=document.createElement("style");KT.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(KT),VT.StyleElement=KT;var qT={},ZT={get exports(){return qT},set exports(t){qT=t}};!function(t){t.exports=function(){var t="object",e="function",n="undefined",o=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],r=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],i=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],a=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function s(n,o){var r=typeof n[o];return r==e||!(r!=t||!n[o])||"unknown"==r}function l(e,n){return!(typeof e[n]!=t||!e[n])}function u(t,e){return typeof t[e]!=n}function c(t){return function(e,n){for(var o=n.length;o--;)if(!t(e,n[o]))return!1;return!0}}var d=c(s),p=c(l),h=c(u);function f(t){return t&&d(t,a)&&h(t,i)}function g(t){return l(t,"body")?t.body:t.getElementsByTagName("body")[0]}var v,y,m=[].forEach?function(t,e){t.forEach(e)}:function(t,e){for(var n=0,o=t.length;n<o;++n)e(t[n],n)},b={},_=typeof window!=n&&typeof document!=n,x={isHostMethod:s,isHostObject:l,isHostProperty:u,areHostMethods:d,areHostObjects:p,areHostProperties:h,isTextRange:f,getBody:g,forEach:m},E={version:"1.3.1",initialized:!1,isBrowser:_,supported:!0,util:x,features:{},modules:b,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==n||rangyAutoInitialize}};function w(t){typeof console!=n&&s(console,"log")&&console.log(t)}function S(t,e){_&&e?alert(t):w(t)}function C(t){E.initialized=!0,E.supported=!1,S("Rangy is not supported in this environment. Reason: "+t,E.config.alertOnFail)}function O(t){S("Rangy warning: "+t,E.config.alertOnWarn)}E.fail=C,E.warn=O,{}.hasOwnProperty?(x.extend=v=function(t,e,n){var o,r;for(var i in e)e.hasOwnProperty(i)&&(o=t[i],r=e[i],n&&null!==o&&"object"==typeof o&&null!==r&&"object"==typeof r&&v(o,r,!0),t[i]=r);return e.hasOwnProperty("toString")&&(t.toString=e.toString),t},x.createOptions=function(t,e){var n={};return v(n,e),t&&v(n,t),n}):C("hasOwnProperty not supported"),_||C("Rangy can only run in a browser"),function(){var t;if(_){var e=document.createElement("div");e.appendChild(document.createElement("span"));var n=[].slice;try{1==n.call(e.childNodes,0)[0].nodeType&&(t=function(t){return n.call(t,0)})}catch(t){}}t||(t=function(t){for(var e=[],n=0,o=t.length;n<o;++n)e[n]=t[n];return e}),x.toArray=t}(),_&&(s(document,"addEventListener")?y=function(t,e,n){t.addEventListener(e,n,!1)}:s(document,"attachEvent")?y=function(t,e,n){t.attachEvent("on"+e,n)}:C("Document does not have required addEventListener or attachEvent method"),x.addListener=y);var M=[];function T(t){return t.message||t.description||String(t)}function N(){if(_&&!E.initialized){var t,e=!1,n=!1;s(document,"createRange")&&(t=document.createRange(),d(t,r)&&h(t,o)&&(e=!0));var i=g(document);if(i&&"body"==i.nodeName.toLowerCase())if(i&&s(i,"createTextRange")&&f(t=i.createTextRange())&&(n=!0),e||n){var a;for(var l in E.initialized=!0,E.features={implementsDomRange:e,implementsTextRange:n},b)(a=b[l])instanceof R&&a.init(a,E);for(var u=0,c=M.length;u<c;++u)try{M[u](E)}catch(t){w("Rangy init listener threw an exception. Continuing. Detail: "+T(t))}}else C("Neither Range nor TextRange are available");else C("No body element found")}}function A(t,e,n){n&&(t+=" in module "+n.name),E.warn("DEPRECATED: "+t+" is deprecated. Please use "+e+" instead.")}function P(t,e,n,o){t[e]=function(){return A(e,n,o),t[n].apply(t,x.toArray(arguments))}}x.deprecationNotice=A,x.createAliasForDeprecatedMethod=P,E.init=N,E.addInitListener=function(t){E.initialized?t(E):M.push(t)};var D=[];function k(t){t=t||window,N();for(var e=0,n=D.length;e<n;++e)D[e](t)}function R(t,e,n){this.name=t,this.dependencies=e,this.initialized=!1,this.supported=!1,this.initializer=n}function L(t,e,n){var o=new R(t,e,(function(e){if(!e.initialized){e.initialized=!0;try{n(E,e),e.supported=!0}catch(e){w("Module '"+t+"' failed to load: "+T(e)),e.stack&&w(e.stack)}}}));return b[t]=o,o}function I(){}function j(){}E.addShimListener=function(t){D.push(t)},_&&(E.shim=E.createMissingNativeApi=k,P(E,"createMissingNativeApi","shim")),R.prototype={init:function(){for(var t,e,n=this.dependencies||[],o=0,r=n.length;o<r;++o){if(e=n[o],!((t=b[e])&&t instanceof R))throw new Error("required module '"+e+"' not found");if(t.init(),!t.supported)throw new Error("required module '"+e+"' not supported")}this.initializer(this)},fail:function(t){throw this.initialized=!0,this.supported=!1,new Error(t)},warn:function(t){E.warn("Module "+this.name+": "+t)},deprecationNotice:function(t,e){E.warn("DEPRECATED: "+t+" in module "+this.name+" is deprecated. Please use "+e+" instead")},createError:function(t){return new Error("Error in Rangy "+this.name+" module: "+t)}},E.createModule=function(t){var e,n;2==arguments.length?(e=arguments[1],n=[]):(e=arguments[2],n=arguments[1]);var o=L(t,n,e);E.initialized&&E.supported&&o.init()},E.createCoreModule=function(t,e,n){L(t,e,n)},E.RangePrototype=I,E.rangePrototype=new I,E.selectionPrototype=new j,E.createCoreModule("DomUtil",[],(function(t,e){var n="undefined",o=t.util,r=o.getBody;o.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||e.fail("document missing a Node creation method"),o.isHostMethod(document,"getElementsByTagName")||e.fail("document missing getElementsByTagName method");var i=document.createElement("div");o.areHostMethods(i,["insertBefore","appendChild","cloneNode"]||!o.areHostObjects(i,["previousSibling","nextSibling","childNodes","parentNode"]))||e.fail("Incomplete Element implementation"),o.isHostProperty(i,"innerHTML")||e.fail("Element is missing innerHTML property");var a=document.createTextNode("test");o.areHostMethods(a,["splitText","deleteData","insertData","appendData","cloneNode"]||!o.areHostObjects(i,["previousSibling","nextSibling","childNodes","parentNode"])||!o.areHostProperties(a,["data"]))||e.fail("Incomplete Text Node implementation");var s=function(t,e){for(var n=t.length;n--;)if(t[n]===e)return!0;return!1};function l(t){var e;return typeof t.namespaceURI==n||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function u(t){var e=t.parentNode;return 1==e.nodeType?e:null}function c(t){for(var e=0;t=t.previousSibling;)++e;return e}function d(t){switch(t.nodeType){case 7:case 10:return 0;case 3:case 8:return t.length;default:return t.childNodes.length}}function p(t,e){var n,o=[];for(n=t;n;n=n.parentNode)o.push(n);for(n=e;n;n=n.parentNode)if(s(o,n))return n;return null}function h(t,e,n){for(var o=n?e:e.parentNode;o;){if(o===t)return!0;o=o.parentNode}return!1}function f(t,e){return h(t,e,!0)}function g(t,e,n){for(var o,r=n?t:t.parentNode;r;){if((o=r.parentNode)===e)return r;r=o}return null}function v(t){var e=t.nodeType;return 3==e||4==e||8==e}function y(t){if(!t)return!1;var e=t.nodeType;return 3==e||8==e}function m(t,e){var n=e.nextSibling,o=e.parentNode;return n?o.insertBefore(t,n):o.appendChild(t),t}function b(t,e,n){var o=t.cloneNode(!1);if(o.deleteData(0,e),t.deleteData(e,t.length-e),m(o,t),n)for(var r,i=0;r=n[i++];)r.node==t&&r.offset>e?(r.node=o,r.offset-=e):r.node==t.parentNode&&r.offset>c(t)&&++r.offset;return o}function _(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=n)return t.ownerDocument;if(typeof t.document!=n)return t.document;if(t.parentNode)return _(t.parentNode);throw e.createError("getDocument: no document found for node")}function x(t){var o=_(t);if(typeof o.defaultView!=n)return o.defaultView;if(typeof o.parentWindow!=n)return o.parentWindow;throw e.createError("Cannot get a window object for node")}function E(t){if(typeof t.contentDocument!=n)return t.contentDocument;if(typeof t.contentWindow!=n)return t.contentWindow.document;throw e.createError("getIframeDocument: No Document object found for iframe element")}function w(t){if(typeof t.contentWindow!=n)return t.contentWindow;if(typeof t.contentDocument!=n)return t.contentDocument.defaultView;throw e.createError("getIframeWindow: No Window object found for iframe element")}function S(t){return t&&o.isHostMethod(t,"setTimeout")&&o.isHostObject(t,"document")}function C(t,e,n){var r;if(t?o.isHostProperty(t,"nodeType")?r=1==t.nodeType&&"iframe"==t.tagName.toLowerCase()?E(t):_(t):S(t)&&(r=t.document):r=document,!r)throw e.createError(n+"(): Parameter must be a Window object or DOM node");return r}function O(t){for(var e;e=t.parentNode;)t=e;return t}function M(t,n,o,r){var i,a,s,l,u;if(t==o)return n===r?0:n<r?-1:1;if(i=g(o,t,!0))return n<=c(i)?-1:1;if(i=g(t,o,!0))return c(i)<r?-1:1;if(!(a=p(t,o)))throw new Error("comparePoints error: nodes have no common ancestor");if((s=t===a?a:g(t,a,!0))===(l=o===a?a:g(o,a,!0)))throw e.createError("comparePoints got to case 4 and childA and childB are the same!");for(u=a.firstChild;u;){if(u===s)return-1;if(u===l)return 1;u=u.nextSibling}}var T,N=!1;function A(t){try{return t.parentNode,!1}catch(t){return!0}}function P(t){if(!t)return"[No node]";if(N&&A(t))return"[Broken node]";if(v(t))return'"'+t.data+'"';if(1==t.nodeType){var e=t.id?' id="'+t.id+'"':"";return"<"+t.nodeName+e+">[index:"+c(t)+",length:"+t.childNodes.length+"]["+(t.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return t.nodeName}function D(t){for(var e,n=_(t).createDocumentFragment();e=t.firstChild;)n.appendChild(e);return n}function k(t,e,n){var o=r(t),i=t.createElement("div");i.contentEditable=""+!!n,e&&(i.innerHTML=e);var a=o.firstChild;return a?o.insertBefore(i,a):o.appendChild(i),i}function R(t){return t.parentNode.removeChild(t)}function L(t){this.root=t,this._next=t}function I(t){return new L(t)}function j(t,e){this.node=t,this.offset=e}function B(t){this.code=this[t],this.codeName=t,this.message="DOMException: "+this.codeName}!function(){var e=document.createElement("b");e.innerHTML="1";var n=e.firstChild;e.innerHTML="<br />",N=A(n),t.features.crashyTextNodes=N}(),typeof window.getComputedStyle!=n?T=function(t,e){return x(t).getComputedStyle(t,null)[e]}:typeof document.documentElement.currentStyle!=n?T=function(t,e){return t.currentStyle?t.currentStyle[e]:""}:e.fail("No means of obtaining computed style properties found"),L.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var t,e,n=this._current=this._next;if(this._current)if(t=n.firstChild)this._next=t;else{for(e=null;n!==this.root&&!(e=n.nextSibling);)n=n.parentNode;this._next=e}return this._current},detach:function(){this._current=this._next=this.root=null}},j.prototype={equals:function(t){return!!t&&this.node===t.node&&this.offset==t.offset},inspect:function(){return"[DomPosition("+P(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}},B.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},B.prototype.toString=function(){return this.message},t.dom={arrayContains:s,isHtmlNamespace:l,parentElement:u,getNodeIndex:c,getNodeLength:d,getCommonAncestor:p,isAncestorOf:h,isOrIsAncestorOf:f,getClosestAncestorIn:g,isCharacterDataNode:v,isTextOrCommentNode:y,insertAfter:m,splitDataNode:b,getDocument:_,getWindow:x,getIframeWindow:w,getIframeDocument:E,getBody:r,isWindow:S,getContentDocument:C,getRootContainer:O,comparePoints:M,isBrokenNode:A,inspectNode:P,getComputedStyleProperty:T,createTestElement:k,removeNode:R,fragmentFromNodeChildren:D,createIterator:I,DomPosition:j},t.DOMException=B})),E.createCoreModule("DomRange",["DomUtil"],(function(t,e){var n=t.dom,o=t.util,r=n.DomPosition,i=t.DOMException,a=n.isCharacterDataNode,s=n.getNodeIndex,l=n.isOrIsAncestorOf,u=n.getDocument,c=n.comparePoints,d=n.splitDataNode,p=n.getClosestAncestorIn,h=n.getNodeLength,f=n.arrayContains,g=n.getRootContainer,v=t.features.crashyTextNodes,y=n.removeNode;function m(t,e){return 3!=t.nodeType&&(l(t,e.startContainer)||l(t,e.endContainer))}function b(t){return t.document||u(t.startContainer)}function _(t){return g(t.startContainer)}function x(t){return new r(t.parentNode,s(t))}function E(t){return new r(t.parentNode,s(t)+1)}function w(t,e,o){var r=11==t.nodeType?t.firstChild:t;return a(e)?o==e.length?n.insertAfter(t,e):e.parentNode.insertBefore(t,0==o?e:d(e,o)):o>=e.childNodes.length?e.appendChild(t):e.insertBefore(t,e.childNodes[o]),r}function S(t,e,n){if(Z(t),Z(e),b(e)!=b(t))throw new i("WRONG_DOCUMENT_ERR");var o=c(t.startContainer,t.startOffset,e.endContainer,e.endOffset),r=c(t.endContainer,t.endOffset,e.startContainer,e.startOffset);return n?o<=0&&r>=0:o<0&&r>0}function C(t){for(var e,n,o,r=b(t.range).createDocumentFragment();n=t.next();){if(e=t.isPartiallySelectedSubtree(),n=n.cloneNode(!e),e&&(o=t.getSubtreeIterator(),n.appendChild(C(o)),o.detach()),10==n.nodeType)throw new i("HIERARCHY_REQUEST_ERR");r.appendChild(n)}return r}function O(t,e,o){var r,i,a,s;for(o=o||{stop:!1};a=t.next();)if(t.isPartiallySelectedSubtree()){if(!1===e(a))return void(o.stop=!0);if(O(s=t.getSubtreeIterator(),e,o),s.detach(),o.stop)return}else for(r=n.createIterator(a);i=r.next();)if(!1===e(i))return void(o.stop=!0)}function M(t){for(var e;t.next();)t.isPartiallySelectedSubtree()?(M(e=t.getSubtreeIterator()),e.detach()):t.remove()}function T(t){for(var e,n,o=b(t.range).createDocumentFragment();e=t.next();){if(t.isPartiallySelectedSubtree()?(e=e.cloneNode(!1),n=t.getSubtreeIterator(),e.appendChild(T(n)),n.detach()):t.remove(),10==e.nodeType)throw new i("HIERARCHY_REQUEST_ERR");o.appendChild(e)}return o}function N(t,e,n){var o,r=!(!e||!e.length),i=!!n;r&&(o=new RegExp("^("+e.join("|")+")$"));var s=[];return O(new P(t,!1),(function(e){if((!r||o.test(e.nodeType))&&(!i||n(e))){var l=t.startContainer;if(e!=l||!a(l)||t.startOffset!=l.length){var u=t.endContainer;e==u&&a(u)&&0==t.endOffset||s.push(e)}}})),s}function A(t){return"["+(void 0===t.getName?"Range":t.getName())+"("+n.inspectNode(t.startContainer)+":"+t.startOffset+", "+n.inspectNode(t.endContainer)+":"+t.endOffset+")]"}function P(t,e){if(this.range=t,this.clonePartiallySelectedTextNodes=e,!t.collapsed){this.sc=t.startContainer,this.so=t.startOffset,this.ec=t.endContainer,this.eo=t.endOffset;var n=t.commonAncestorContainer;this.sc===this.ec&&a(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==n||a(this.sc)?p(this.sc,n,!0):this.sc.childNodes[this.so],this._last=this.ec!==n||a(this.ec)?p(this.ec,n,!0):this.ec.childNodes[this.eo-1])}}P.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var t=this._current=this._next;return t&&(this._next=t!==this._last?t.nextSibling:null,a(t)&&this.clonePartiallySelectedTextNodes&&(t===this.ec&&(t=t.cloneNode(!0)).deleteData(this.eo,t.length-this.eo),this._current===this.sc&&(t=t.cloneNode(!0)).deleteData(0,this.so))),t},remove:function(){var t,e,n=this._current;!a(n)||n!==this.sc&&n!==this.ec?n.parentNode&&y(n):(t=n===this.sc?this.so:0)!=(e=n===this.ec?this.eo:n.length)&&n.deleteData(t,e-t)},isPartiallySelectedSubtree:function(){return m(this._current,this.range)},getSubtreeIterator:function(){var t;if(this.isSingleCharacterDataNode)(t=this.range.cloneRange()).collapse(!1);else{t=new yt(b(this.range));var e=this._current,n=e,o=0,r=e,i=h(e);l(e,this.sc)&&(n=this.sc,o=this.so),l(e,this.ec)&&(r=this.ec,i=this.eo),vt(t,n,o,r,i)}return new P(t,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var D=[1,3,4,5,7,8,10],k=[2,9,11],R=[5,6,10,12],L=[1,3,4,5,7,8,10,11],I=[1,3,4,5,7,8];function j(t){return function(e,n){for(var o,r=n?e:e.parentNode;r;){if(o=r.nodeType,f(t,o))return r;r=r.parentNode}return null}}var B=j([9,11]),H=j(R),F=j([6,10,12]),z=j([1]);function W(t,e){if(F(t,e))throw new i("INVALID_NODE_TYPE_ERR")}function U(t,e){if(!f(e,t.nodeType))throw new i("INVALID_NODE_TYPE_ERR")}function X(t,e){if(e<0||e>(a(t)?t.length:t.childNodes.length))throw new i("INDEX_SIZE_ERR")}function G(t,e){if(B(t,!0)!==B(e,!0))throw new i("WRONG_DOCUMENT_ERR")}function Y(t){if(H(t,!0))throw new i("NO_MODIFICATION_ALLOWED_ERR")}function V(t,e){if(!t)throw new i(e)}function K(t,e){return e<=(a(t)?t.length:t.childNodes.length)}function q(t){return!!t.startContainer&&!!t.endContainer&&!(v&&(n.isBrokenNode(t.startContainer)||n.isBrokenNode(t.endContainer)))&&g(t.startContainer)==g(t.endContainer)&&K(t.startContainer,t.startOffset)&&K(t.endContainer,t.endOffset)}function Z(t){if(!q(t))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+t.inspect()+")")}var $=document.createElement("style"),J=!1;try{$.innerHTML="<b>x</b>",J=3==$.firstChild.nodeType}catch(t){}t.features.htmlParsingConforms=J;var Q=J?function(t){var e=this.startContainer,o=u(e);if(!e)throw new i("INVALID_STATE_ERR");var r=null;return 1==e.nodeType?r=e:a(e)&&(r=n.parentElement(e)),(r=null===r||"HTML"==r.nodeName&&n.isHtmlNamespace(u(r).documentElement)&&n.isHtmlNamespace(r)?o.createElement("body"):r.cloneNode(!1)).innerHTML=t,n.fragmentFromNodeChildren(r)}:function(t){var e=b(this).createElement("body");return e.innerHTML=t,n.fragmentFromNodeChildren(e)};function tt(t,e){Z(t);var n=t.startContainer,o=t.startOffset,r=t.endContainer,i=t.endOffset,l=n===r;a(r)&&i>0&&i<r.length&&d(r,i,e),a(n)&&o>0&&o<n.length&&(n=d(n,o,e),l?(i-=o,r=n):r==n.parentNode&&i>=s(n)&&i++,o=0),t.setStartAndEnd(n,o,r,i)}function et(t){Z(t);var e=t.commonAncestorContainer.parentNode.cloneNode(!1);return e.appendChild(t.cloneContents()),e.innerHTML}var nt=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],ot=0,rt=1,it=2,at=3,st=0,lt=1,ut=2,ct=3;function dt(t){t.START_TO_START=ot,t.START_TO_END=rt,t.END_TO_END=it,t.END_TO_START=at,t.NODE_BEFORE=st,t.NODE_AFTER=lt,t.NODE_BEFORE_AND_AFTER=ut,t.NODE_INSIDE=ct}function pt(t){dt(t),dt(t.prototype)}function ht(t,e){return function(){Z(this);var n,o=this.startContainer,r=this.startOffset,i=this.commonAncestorContainer,a=new P(this,!0);o!==i&&(o=(n=E(p(o,i,!0))).node,r=n.offset),O(a,Y),a.reset();var s=t(a);return a.detach(),e(this,o,r,o,r),s}}function ft(e,n){function r(t,e){return function(n){U(n,D),U(g(n),k);var o=(t?x:E)(n);(e?i:l)(this,o.node,o.offset)}}function i(t,e,o){var r=t.endContainer,i=t.endOffset;e===t.startContainer&&o===t.startOffset||(g(e)==g(r)&&1!=c(e,o,r,i)||(r=e,i=o),n(t,e,o,r,i))}function l(t,e,o){var r=t.startContainer,i=t.startOffset;e===t.endContainer&&o===t.endOffset||(g(e)==g(r)&&-1!=c(e,o,r,i)||(r=e,i=o),n(t,r,i,e,o))}var u=function(){};u.prototype=t.rangePrototype,e.prototype=new u,o.extend(e.prototype,{setStart:function(t,e){W(t,!0),X(t,e),i(this,t,e)},setEnd:function(t,e){W(t,!0),X(t,e),l(this,t,e)},setStartAndEnd:function(){var t=arguments,e=t[0],o=t[1],r=e,i=o;switch(t.length){case 3:i=t[2];break;case 4:r=t[2],i=t[3]}W(e,!0),X(e,o),W(r,!0),X(r,i),n(this,e,o,r,i)},setBoundary:function(t,e,n){this["set"+(n?"Start":"End")](t,e)},setStartBefore:r(!0,!0),setStartAfter:r(!1,!0),setEndBefore:r(!0,!1),setEndAfter:r(!1,!1),collapse:function(t){Z(this),t?n(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):n(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(t){W(t,!0),n(this,t,0,t,h(t))},selectNode:function(t){W(t,!1),U(t,D);var e=x(t),o=E(t);n(this,e.node,e.offset,o.node,o.offset)},extractContents:ht(T,n),deleteContents:ht(M,n),canSurroundContents:function(){Z(this),Y(this.startContainer),Y(this.endContainer);var t=new P(this,!0),e=t._first&&m(t._first,this)||t._last&&m(t._last,this);return t.detach(),!e},splitBoundaries:function(){tt(this)},splitBoundariesPreservingPositions:function(t){tt(this,t)},normalizeBoundaries:function(){Z(this);var t,e=this.startContainer,o=this.startOffset,r=this.endContainer,i=this.endOffset,l=function(t){var e=t.nextSibling;e&&e.nodeType==t.nodeType&&(r=t,i=t.length,t.appendData(e.data),y(e))},u=function(t){var n=t.previousSibling;if(n&&n.nodeType==t.nodeType){e=t;var a=t.length;if(o=n.length,t.insertData(0,n.data),y(n),e==r)i+=o,r=e;else if(r==t.parentNode){var l=s(t);i==l?(r=t,i=a):i>l&&i--}}},c=!0;if(a(r))i==r.length?l(r):0==i&&(t=r.previousSibling)&&t.nodeType==r.nodeType&&(i=t.length,e==r&&(c=!1),t.appendData(r.data),y(r),r=t);else{if(i>0){var d=r.childNodes[i-1];d&&a(d)&&l(d)}c=!this.collapsed}if(c){if(a(e))0==o?u(e):o==e.length&&(t=e.nextSibling)&&t.nodeType==e.nodeType&&(r==t&&(r=e,i+=e.length),e.appendData(t.data),y(t));else if(o<e.childNodes.length){var p=e.childNodes[o];p&&a(p)&&u(p)}}else e=r,o=i;n(this,e,o,r,i)},collapseToPoint:function(t,e){W(t,!0),X(t,e),this.setStartAndEnd(t,e)},parentElement:function(){return Z(this),this.commonAncestorContainer?z(this.commonAncestorContainer,!0):null}}),pt(e)}function gt(t){t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset,t.commonAncestorContainer=t.collapsed?t.startContainer:n.getCommonAncestor(t.startContainer,t.endContainer)}function vt(t,e,o,r,i){t.startContainer=e,t.startOffset=o,t.endContainer=r,t.endOffset=i,t.document=n.getDocument(e),gt(t)}function yt(t){vt(this,t,0,t,0)}o.extend(t.rangePrototype,{compareBoundaryPoints:function(t,e){var n,o,r,i;Z(this),G(this.startContainer,e.startContainer);var a=t==at||t==ot?"start":"end",s=t==rt||t==ot?"start":"end";return n=this[a+"Container"],o=this[a+"Offset"],r=e[s+"Container"],i=e[s+"Offset"],c(n,o,r,i)},insertNode:function(t){if(Z(this),U(t,L),Y(this.startContainer),l(t,this.startContainer))throw new i("HIERARCHY_REQUEST_ERR");var e=w(t,this.startContainer,this.startOffset);this.setStartBefore(e)},cloneContents:function(){var t,e;if(Z(this),this.collapsed)return b(this).createDocumentFragment();if(this.startContainer===this.endContainer&&a(this.startContainer))return(t=this.startContainer.cloneNode(!0)).data=t.data.slice(this.startOffset,this.endOffset),(e=b(this).createDocumentFragment()).appendChild(t),e;var n=new P(this,!0);return t=C(n),n.detach(),t},canSurroundContents:function(){Z(this),Y(this.startContainer),Y(this.endContainer);var t=new P(this,!0),e=t._first&&m(t._first,this)||t._last&&m(t._last,this);return t.detach(),!e},surroundContents:function(t){if(U(t,I),!this.canSurroundContents())throw new i("INVALID_STATE_ERR");var e=this.extractContents();if(t.hasChildNodes())for(;t.lastChild;)t.removeChild(t.lastChild);w(t,this.startContainer,this.startOffset),t.appendChild(e),this.selectNode(t)},cloneRange:function(){Z(this);for(var t,e=new yt(b(this)),n=nt.length;n--;)e[t=nt[n]]=this[t];return e},toString:function(){Z(this);var t=this.startContainer;if(t===this.endContainer&&a(t))return 3==t.nodeType||4==t.nodeType?t.data.slice(this.startOffset,this.endOffset):"";var e=[],n=new P(this,!0);return O(n,(function(t){3!=t.nodeType&&4!=t.nodeType||e.push(t.data)})),n.detach(),e.join("")},compareNode:function(t){Z(this);var e=t.parentNode,n=s(t);if(!e)throw new i("NOT_FOUND_ERR");var o=this.comparePoint(e,n),r=this.comparePoint(e,n+1);return o<0?r>0?ut:st:r>0?lt:ct},comparePoint:function(t,e){return Z(this),V(t,"HIERARCHY_REQUEST_ERR"),G(t,this.startContainer),c(t,e,this.startContainer,this.startOffset)<0?-1:c(t,e,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:Q,toHtml:function(){return et(this)},intersectsNode:function(t,e){if(Z(this),g(t)!=_(this))return!1;var n=t.parentNode,o=s(t);if(!n)return!0;var r=c(n,o,this.endContainer,this.endOffset),i=c(n,o+1,this.startContainer,this.startOffset);return e?r<=0&&i>=0:r<0&&i>0},isPointInRange:function(t,e){return Z(this),V(t,"HIERARCHY_REQUEST_ERR"),G(t,this.startContainer),c(t,e,this.startContainer,this.startOffset)>=0&&c(t,e,this.endContainer,this.endOffset)<=0},intersectsRange:function(t){return S(this,t,!1)},intersectsOrTouchesRange:function(t){return S(this,t,!0)},intersection:function(t){if(this.intersectsRange(t)){var e=c(this.startContainer,this.startOffset,t.startContainer,t.startOffset),n=c(this.endContainer,this.endOffset,t.endContainer,t.endOffset),o=this.cloneRange();return-1==e&&o.setStart(t.startContainer,t.startOffset),1==n&&o.setEnd(t.endContainer,t.endOffset),o}return null},union:function(t){if(this.intersectsOrTouchesRange(t)){var e=this.cloneRange();return-1==c(t.startContainer,t.startOffset,this.startContainer,this.startOffset)&&e.setStart(t.startContainer,t.startOffset),1==c(t.endContainer,t.endOffset,this.endContainer,this.endOffset)&&e.setEnd(t.endContainer,t.endOffset),e}throw new i("Ranges do not intersect")},containsNode:function(t,e){return e?this.intersectsNode(t,!1):this.compareNode(t)==ct},containsNodeContents:function(t){return this.comparePoint(t,0)>=0&&this.comparePoint(t,h(t))<=0},containsRange:function(t){var e=this.intersection(t);return null!==e&&t.equals(e)},containsNodeText:function(t){var e=this.cloneRange();e.selectNode(t);var n=e.getNodes([3]);if(n.length>0){e.setStart(n[0],0);var o=n.pop();return e.setEnd(o,o.length),this.containsRange(e)}return this.containsNodeContents(t)},getNodes:function(t,e){return Z(this),N(this,t,e)},getDocument:function(){return b(this)},collapseBefore:function(t){this.setEndBefore(t),this.collapse(!1)},collapseAfter:function(t){this.setStartAfter(t),this.collapse(!0)},getBookmark:function(e){var o=b(this),r=t.createRange(o);e=e||n.getBody(o),r.selectNodeContents(e);var i=this.intersection(r),a=0,s=0;return i&&(r.setEnd(i.startContainer,i.startOffset),s=(a=r.toString().length)+i.toString().length),{start:a,end:s,containerNode:e}},moveToBookmark:function(t){var e=t.containerNode,n=0;this.setStart(e,0),this.collapse(!0);for(var o,r,i,a,s=[e],l=!1,u=!1;!u&&(o=s.pop());)if(3==o.nodeType)r=n+o.length,!l&&t.start>=n&&t.start<=r&&(this.setStart(o,t.start-n),l=!0),l&&t.end>=n&&t.end<=r&&(this.setEnd(o,t.end-n),u=!0),n=r;else for(i=(a=o.childNodes).length;i--;)s.push(a[i])},getName:function(){return"DomRange"},equals:function(t){return yt.rangesEqual(this,t)},isValid:function(){return q(this)},inspect:function(){return A(this)},detach:function(){}}),ft(yt,vt),o.extend(yt,{rangeProperties:nt,RangeIterator:P,copyComparisonConstants:pt,createPrototypeRange:ft,inspect:A,toHtml:et,getRangeDocument:b,rangesEqual:function(t,e){return t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset}}),t.DomRange=yt})),E.createCoreModule("WrappedRange",["DomRange"],(function(t,e){var n,o,r=t.dom,i=t.util,a=r.DomPosition,s=t.DomRange,l=r.getBody,u=r.getContentDocument,c=r.isCharacterDataNode;if(t.features.implementsDomRange&&function(){var o,a,c=s.rangeProperties;function d(t){for(var e,n=c.length;n--;)t[e=c[n]]=t.nativeRange[e];t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset}function p(t,e,n,o,r){var i=t.startContainer!==e||t.startOffset!=n,a=t.endContainer!==o||t.endOffset!=r,s=!t.equals(t.nativeRange);(i||a||s)&&(t.setEnd(o,r),t.setStart(e,n))}n=function(t){if(!t)throw e.createError("WrappedRange: Range must be specified");this.nativeRange=t,d(this)},s.createPrototypeRange(n,p),(o=n.prototype).selectNode=function(t){this.nativeRange.selectNode(t),d(this)},o.cloneContents=function(){return this.nativeRange.cloneContents()},o.surroundContents=function(t){this.nativeRange.surroundContents(t),d(this)},o.collapse=function(t){this.nativeRange.collapse(t),d(this)},o.cloneRange=function(){return new n(this.nativeRange.cloneRange())},o.refresh=function(){d(this)},o.toString=function(){return this.nativeRange.toString()};var h=document.createTextNode("test");l(document).appendChild(h);var f=document.createRange();f.setStart(h,0),f.setEnd(h,0);try{f.setStart(h,1),o.setStart=function(t,e){this.nativeRange.setStart(t,e),d(this)},o.setEnd=function(t,e){this.nativeRange.setEnd(t,e),d(this)},a=function(t){return function(e){this.nativeRange[t](e),d(this)}}}catch(t){o.setStart=function(t,e){try{this.nativeRange.setStart(t,e)}catch(n){this.nativeRange.setEnd(t,e),this.nativeRange.setStart(t,e)}d(this)},o.setEnd=function(t,e){try{this.nativeRange.setEnd(t,e)}catch(n){this.nativeRange.setStart(t,e),this.nativeRange.setEnd(t,e)}d(this)},a=function(t,e){return function(n){try{this.nativeRange[t](n)}catch(o){this.nativeRange[e](n),this.nativeRange[t](n)}d(this)}}}o.setStartBefore=a("setStartBefore","setEndBefore"),o.setStartAfter=a("setStartAfter","setEndAfter"),o.setEndBefore=a("setEndBefore","setStartBefore"),o.setEndAfter=a("setEndAfter","setStartAfter"),o.selectNodeContents=function(t){this.setStartAndEnd(t,0,r.getNodeLength(t))},f.selectNodeContents(h),f.setEnd(h,3);var g=document.createRange();g.selectNodeContents(h),g.setEnd(h,4),g.setStart(h,2),-1==f.compareBoundaryPoints(f.START_TO_END,g)&&1==f.compareBoundaryPoints(f.END_TO_START,g)?o.compareBoundaryPoints=function(t,e){return t==(e=e.nativeRange||e).START_TO_END?t=e.END_TO_START:t==e.END_TO_START&&(t=e.START_TO_END),this.nativeRange.compareBoundaryPoints(t,e)}:o.compareBoundaryPoints=function(t,e){return this.nativeRange.compareBoundaryPoints(t,e.nativeRange||e)};var v=document.createElement("div");v.innerHTML="123";var y=v.firstChild,m=l(document);m.appendChild(v),f.setStart(y,1),f.setEnd(y,2),f.deleteContents(),"13"==y.data&&(o.deleteContents=function(){this.nativeRange.deleteContents(),d(this)},o.extractContents=function(){var t=this.nativeRange.extractContents();return d(this),t}),m.removeChild(v),m=null,i.isHostMethod(f,"createContextualFragment")&&(o.createContextualFragment=function(t){return this.nativeRange.createContextualFragment(t)}),l(document).removeChild(h),o.getName=function(){return"WrappedRange"},t.WrappedRange=n,t.createNativeRange=function(t){return(t=u(t,e,"createNativeRange")).createRange()}}(),t.features.implementsTextRange){var d=function(t){var e=t.parentElement(),n=t.duplicate();n.collapse(!0);var o=n.parentElement();(n=t.duplicate()).collapse(!1);var i=n.parentElement(),a=o==i?o:r.getCommonAncestor(o,i);return a==e?a:r.getCommonAncestor(e,a)},p=function(t){return 0==t.compareEndPoints("StartToEnd",t)},h=function(t,e,n,o,i){var s=t.duplicate();s.collapse(n);var l=s.parentElement();if(r.isOrIsAncestorOf(e,l)||(l=e),!l.canHaveHTML){var u=new a(l.parentNode,r.getNodeIndex(l));return{boundaryPosition:u,nodeInfo:{nodeIndex:u.offset,containerElement:u.node}}}var d=r.getDocument(l).createElement("span");d.parentNode&&r.removeNode(d);for(var p,h,f,g,v,y=n?"StartToStart":"StartToEnd",m=i&&i.containerElement==l?i.nodeIndex:0,b=l.childNodes.length,_=b,x=_;x==b?l.appendChild(d):l.insertBefore(d,l.childNodes[x]),s.moveToElementText(d),0!=(p=s.compareEndPoints(y,t))&&m!=_;){if(-1==p){if(_==m+1)break;m=x}else _=_==m+1?m:x;x=Math.floor((m+_)/2),l.removeChild(d)}if(v=d.nextSibling,-1==p&&v&&c(v)){var E;if(s.setEndPoint(n?"EndToStart":"EndToEnd",t),/[\r\n]/.test(v.data)){var w=s.duplicate(),S=w.text.replace(/\r\n/g,"\r").length;for(E=w.moveStart("character",S);-1==(p=w.compareEndPoints("StartToEnd",w));)E++,w.moveStart("character",1)}else E=s.text.length;g=new a(v,E)}else h=(o||!n)&&d.previousSibling,g=(f=(o||n)&&d.nextSibling)&&c(f)?new a(f,0):h&&c(h)?new a(h,h.data.length):new a(l,r.getNodeIndex(d));return r.removeNode(d),{boundaryPosition:g,nodeInfo:{nodeIndex:x,containerElement:l}}},f=function(t,e){var n,o,i,a,s=t.offset,u=r.getDocument(t.node),d=l(u).createTextRange(),p=c(t.node);return p?o=(n=t.node).parentNode:(n=s<(a=t.node.childNodes).length?a[s]:null,o=t.node),(i=u.createElement("span")).innerHTML="&#feff;",n?o.insertBefore(i,n):o.appendChild(i),d.moveToElementText(i),d.collapse(!e),o.removeChild(i),p&&d[e?"moveStart":"moveEnd"]("character",s),d};(o=function(t){this.textRange=t,this.refresh()}).prototype=new s(document),o.prototype.refresh=function(){var t,e,n,o=d(this.textRange);p(this.textRange)?e=t=h(this.textRange,o,!0,!0).boundaryPosition:(t=(n=h(this.textRange,o,!0,!1)).boundaryPosition,e=h(this.textRange,o,!1,!1,n.nodeInfo).boundaryPosition),this.setStart(t.node,t.offset),this.setEnd(e.node,e.offset)},o.prototype.getName=function(){return"WrappedTextRange"},s.copyComparisonConstants(o);var g=function(t){if(t.collapsed)return f(new a(t.startContainer,t.startOffset),!0);var e=f(new a(t.startContainer,t.startOffset),!0),n=f(new a(t.endContainer,t.endOffset),!1),o=l(s.getRangeDocument(t)).createTextRange();return o.setEndPoint("StartToStart",e),o.setEndPoint("EndToEnd",n),o};if(o.rangeToTextRange=g,o.prototype.toTextRange=function(){return g(this)},t.WrappedTextRange=o,!t.features.implementsDomRange||t.config.preferTextRange){var v=Function("return this;")();void 0===v.Range&&(v.Range=o),t.createNativeRange=function(t){return t=u(t,e,"createNativeRange"),l(t).createTextRange()},t.WrappedRange=o}}t.createRange=function(n){return n=u(n,e,"createRange"),new t.WrappedRange(t.createNativeRange(n))},t.createRangyRange=function(t){return t=u(t,e,"createRangyRange"),new s(t)},i.createAliasForDeprecatedMethod(t,"createIframeRange","createRange"),i.createAliasForDeprecatedMethod(t,"createIframeRangyRange","createRangyRange"),t.addShimListener((function(e){var n=e.document;void 0===n.createRange&&(n.createRange=function(){return t.createRange(n)}),n=e=null}))})),E.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],(function(t,e){t.config.checkSelectionRanges=!0;var n,o,r="boolean",i="number",a=t.dom,s=t.util,l=s.isHostMethod,u=t.DomRange,c=t.WrappedRange,d=t.DOMException,p=a.DomPosition,h=t.features,f="Control",g=a.getDocument,v=a.getBody,y=u.rangesEqual;function m(t){return"string"==typeof t?/^backward(s)?$/i.test(t):!!t}function b(t,n){if(t){if(a.isWindow(t))return t;if(t instanceof Z)return t.win;var o=a.getContentDocument(t,e,n);return a.getWindow(o)}return window}function _(t){return b(t,"getWinSelection").getSelection()}function x(t){return b(t,"getDocSelection").document.selection}function E(t){var e=!1;return t.anchorNode&&(e=1==a.comparePoints(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)),e}var w=l(window,"getSelection"),S=s.isHostObject(document,"selection");h.implementsWinGetSelection=w,h.implementsDocSelection=S;var C=S&&(!w||t.config.preferTextRange);if(C)n=x,t.isSelectionValid=function(t){var e=b(t,"isSelectionValid").document,n=e.selection;return"None"!=n.type||g(n.createRange().parentElement())==e};else{if(!w)return e.fail("Neither document.selection or window.getSelection() detected."),!1;n=_,t.isSelectionValid=function(){return!0}}t.getNativeSelection=n;var O=n();if(!O)return e.fail("Native selection was null (possibly issue 138?)"),!1;var M=t.createNativeRange(document),T=v(document),N=s.areHostProperties(O,["anchorNode","focusNode","anchorOffset","focusOffset"]);h.selectionHasAnchorAndFocus=N;var A=l(O,"extend");h.selectionHasExtend=A;var P=l(O,"setBaseAndExtent");h.selectionHasSetBaseAndExtent=P;var D=typeof O.rangeCount==i;h.selectionHasRangeCount=D;var k=!1,R=!0,L=A?function(e,n){var o=u.getRangeDocument(n),r=t.createRange(o);r.collapseToPoint(n.endContainer,n.endOffset),e.addRange(U(r)),e.extend(n.startContainer,n.startOffset)}:null;s.areHostMethods(O,["addRange","getRangeAt","removeAllRanges"])&&typeof O.rangeCount==i&&h.implementsDomRange&&function(){var e=window.getSelection();if(e){for(var n=e.rangeCount,o=n>1,r=[],i=E(e),s=0;s<n;++s)r[s]=e.getRangeAt(s);var l=a.createTestElement(document,"",!1),u=l.appendChild(document.createTextNode(" ")),c=document.createRange();if(c.setStart(u,1),c.collapse(!0),e.removeAllRanges(),e.addRange(c),R=1==e.rangeCount,e.removeAllRanges(),!o){var d=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(d&&parseInt(d[1])>=36)k=!1;else{var p=c.cloneRange();c.setStart(u,0),p.setEnd(u,3),p.setStart(u,2),e.addRange(c),e.addRange(p),k=2==e.rangeCount}}for(a.removeNode(l),e.removeAllRanges(),s=0;s<n;++s)0==s&&i?L?L(e,r[s]):(t.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),e.addRange(r[s])):e.addRange(r[s])}}(),h.selectionSupportsMultipleRanges=k,h.collapsedNonEditableSelectionsSupported=R;var I,j,B=!1;function H(t,e,n){var o=n?"end":"start",r=n?"start":"end";t.anchorNode=e[o+"Container"],t.anchorOffset=e[o+"Offset"],t.focusNode=e[r+"Container"],t.focusOffset=e[r+"Offset"]}function F(t){var e=t.nativeSelection;t.anchorNode=e.anchorNode,t.anchorOffset=e.anchorOffset,t.focusNode=e.focusNode,t.focusOffset=e.focusOffset}function z(t){t.anchorNode=t.focusNode=null,t.anchorOffset=t.focusOffset=0,t.rangeCount=0,t.isCollapsed=!0,t._ranges.length=0,W(t)}function W(t){t.type=0==t.rangeCount?"None":o(t)?"Caret":"Range"}function U(e){var n;return e instanceof u?((n=t.createNativeRange(e.getDocument())).setEnd(e.endContainer,e.endOffset),n.setStart(e.startContainer,e.startOffset)):e instanceof c?n=e.nativeRange:h.implementsDomRange&&e instanceof a.getWindow(e.startContainer).Range&&(n=e),n}function X(t){if(!t.length||1!=t[0].nodeType)return!1;for(var e=1,n=t.length;e<n;++e)if(!a.isAncestorOf(t[0],t[e]))return!1;return!0}function G(t){var n=t.getNodes();if(!X(n))throw e.createError("getSingleElementFromRange: range "+t.inspect()+" did not consist of a single element");return n[0]}function Y(t){return!!t&&void 0!==t.text}function V(t,e){var n=new c(e);t._ranges=[n],H(t,n,!1),t.rangeCount=1,t.isCollapsed=n.collapsed,W(t)}function K(e){if(e._ranges.length=0,"None"==e.docSelection.type)z(e);else{var n=e.docSelection.createRange();if(Y(n))V(e,n);else{e.rangeCount=n.length;for(var o,r=g(n.item(0)),i=0;i<e.rangeCount;++i)(o=t.createRange(r)).selectNode(n.item(i)),e._ranges.push(o);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,H(e,e._ranges[e.rangeCount-1],!1),W(e)}}}function q(t,n){for(var o=t.docSelection.createRange(),r=G(n),i=g(o.item(0)),a=v(i).createControlRange(),s=0,l=o.length;s<l;++s)a.add(o.item(s));try{a.add(r)}catch(t){throw e.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),K(t)}function Z(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function $(t){t.win=t.anchorNode=t.focusNode=t._ranges=null,t.rangeCount=t.anchorOffset=t.focusOffset=0,t.detached=!0,W(t)}T&&l(T,"createControlRange")&&(I=T.createControlRange(),s.areHostProperties(I,["item","add"])&&(B=!0)),h.implementsControlRange=B,o=N?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return!!t.rangeCount&&t.getRangeAt(t.rangeCount-1).collapsed},l(O,"getRangeAt")?j=function(t,e){try{return t.getRangeAt(e)}catch(t){return null}}:N&&(j=function(e){var n=g(e.anchorNode),o=t.createRange(n);return o.setStartAndEnd(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset),o.collapsed!==this.isCollapsed&&o.setStartAndEnd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset),o}),Z.prototype=t.selectionPrototype;var J=[];function Q(t,e){for(var n,o,r=J.length;r--;)if(o=(n=J[r]).selection,"deleteAll"==e)$(o);else if(n.win==t)return"delete"==e?(J.splice(r,1),!0):o;return"deleteAll"==e&&(J.length=0),null}var tt=function(t){if(t&&t instanceof Z)return t.refresh(),t;var e=Q(t=b(t,"getNativeSelection")),o=n(t),r=S?x(t):null;return e?(e.nativeSelection=o,e.docSelection=r,e.refresh()):(e=new Z(o,r,t),J.push({win:t,selection:e})),e};t.getSelection=tt,s.createAliasForDeprecatedMethod(t,"getIframeSelection","getSelection");var et,nt=Z.prototype;function ot(t,n){for(var o,r=g(n[0].startContainer),i=v(r).createControlRange(),a=0,s=n.length;a<s;++a){o=G(n[a]);try{i.add(o)}catch(t){throw e.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}i.select(),K(t)}if(!C&&N&&s.areHostMethods(O,["removeAllRanges","addRange"])){nt.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),z(this)};var rt=function(t,e){L(t.nativeSelection,e),t.refresh()};nt.addRange=D?function(e,n){if(B&&S&&this.docSelection.type==f)q(this,e);else if(m(n)&&A)rt(this,e);else{var r;k?r=this.rangeCount:(this.removeAllRanges(),r=0);var i=U(e).cloneRange();try{this.nativeSelection.addRange(i)}catch(t){}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==r+1){if(t.config.checkSelectionRanges){var a=j(this.nativeSelection,this.rangeCount-1);a&&!y(a,e)&&(e=new c(a))}this._ranges[this.rangeCount-1]=e,H(this,e,it(this.nativeSelection)),this.isCollapsed=o(this),W(this)}else this.refresh()}}:function(t,e){m(e)&&A?rt(this,t):(this.nativeSelection.addRange(U(t)),this.refresh())},nt.setRanges=function(t){if(B&&S&&t.length>1)ot(this,t);else{this.removeAllRanges();for(var e=0,n=t.length;e<n;++e)this.addRange(t[e])}}}else{if(!(l(O,"empty")&&l(M,"select")&&B&&C))return e.fail("No means of selecting a Range or TextRange was found"),!1;nt.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var t;if(this.anchorNode)t=g(this.anchorNode);else if(this.docSelection.type==f){var e=this.docSelection.createRange();e.length&&(t=g(e.item(0)))}t&&(v(t).createTextRange().select(),this.docSelection.empty())}}catch(t){}z(this)},nt.addRange=function(e){this.docSelection.type==f?q(this,e):(t.WrappedTextRange.rangeToTextRange(e).select(),this._ranges[0]=e,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,H(this,e,!1),W(this))},nt.setRanges=function(t){this.removeAllRanges();var e=t.length;e>1?ot(this,t):e&&this.addRange(t[0])}}if(nt.getRangeAt=function(t){if(t<0||t>=this.rangeCount)throw new d("INDEX_SIZE_ERR");return this._ranges[t].cloneRange()},C)et=function(e){var n;t.isSelectionValid(e.win)?n=e.docSelection.createRange():(n=v(e.win.document).createTextRange()).collapse(!0),e.docSelection.type==f?K(e):Y(n)?V(e,n):z(e)};else if(l(O,"getRangeAt")&&typeof O.rangeCount==i)et=function(e){if(B&&S&&e.docSelection.type==f)K(e);else if(e._ranges.length=e.rangeCount=e.nativeSelection.rangeCount,e.rangeCount){for(var n=0,r=e.rangeCount;n<r;++n)e._ranges[n]=new t.WrappedRange(e.nativeSelection.getRangeAt(n));H(e,e._ranges[e.rangeCount-1],it(e.nativeSelection)),e.isCollapsed=o(e),W(e)}else z(e)};else{if(!N||typeof O.isCollapsed!=r||typeof M.collapsed!=r||!h.implementsDomRange)return e.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;et=function(t){var e,n=t.nativeSelection;n.anchorNode?(e=j(n,0),t._ranges=[e],t.rangeCount=1,F(t),t.isCollapsed=o(t),W(t)):z(t)}}nt.refresh=function(t){var e=t?this._ranges.slice(0):null,n=this.anchorNode,o=this.anchorOffset;if(et(this),t){var r=e.length;if(r!=this._ranges.length)return!0;if(this.anchorNode!=n||this.anchorOffset!=o)return!0;for(;r--;)if(!y(e[r],this._ranges[r]))return!0;return!1}};var it,at=function(t,e){var n=t.getAllRanges();t.removeAllRanges();for(var o=0,r=n.length;o<r;++o)y(e,n[o])||t.addRange(n[o]);t.rangeCount||z(t)};function st(t,e){if(t.win.document!=g(e))throw new d("WRONG_DOCUMENT_ERR")}function lt(t,e){if(e<0||e>(a.isCharacterDataNode(t)?t.length:t.childNodes.length))throw new d("INDEX_SIZE_ERR")}function ut(e){return function(n,o){var r;this.rangeCount?(r=this.getRangeAt(0))["set"+(e?"Start":"End")](n,o):(r=t.createRange(this.win.document)).setStartAndEnd(n,o),this.setSingleRange(r,this.isBackward())}}function ct(t){var e=[],n=new p(t.anchorNode,t.anchorOffset),o=new p(t.focusNode,t.focusOffset),r="function"==typeof t.getName?t.getName():"Selection";if(void 0!==t.rangeCount)for(var i=0,a=t.rangeCount;i<a;++i)e[i]=u.inspect(t.getRangeAt(i));return"["+r+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+o.inspect()+"]"}nt.removeRange=B&&S?function(t){if(this.docSelection.type==f){for(var e=this.docSelection.createRange(),n=G(t),o=g(e.item(0)),r=v(o).createControlRange(),i=!1,a=0,s=e.length;a<s;++a)e.item(a)!==n||i?r.add(e.item(a)):i=!0;r.select(),K(this)}else at(this,t)}:function(t){at(this,t)},!C&&N&&h.implementsDomRange?(it=E,nt.isBackward=function(){return it(this)}):it=nt.isBackward=function(){return!1},nt.isBackwards=nt.isBackward,nt.toString=function(){for(var t=[],e=0,n=this.rangeCount;e<n;++e)t[e]=""+this._ranges[e];return t.join("")},nt.collapse=function(e,n){st(this,e);var o=t.createRange(e);o.collapseToPoint(e,n),this.setSingleRange(o),this.isCollapsed=!0},nt.collapseToStart=function(){if(!this.rangeCount)throw new d("INVALID_STATE_ERR");var t=this._ranges[0];this.collapse(t.startContainer,t.startOffset)},nt.collapseToEnd=function(){if(!this.rangeCount)throw new d("INVALID_STATE_ERR");var t=this._ranges[this.rangeCount-1];this.collapse(t.endContainer,t.endOffset)},nt.selectAllChildren=function(e){st(this,e);var n=t.createRange(e);n.selectNodeContents(e),this.setSingleRange(n)},P?nt.setBaseAndExtent=function(t,e,n,o){this.nativeSelection.setBaseAndExtent(t,e,n,o),this.refresh()}:A&&(nt.setBaseAndExtent=function(e,n,o,r){lt(e,n),lt(o,r),st(this,e),st(this,o);var i=t.createRange(node),s=-1==a.comparePoints(e,n,o,r);s?i.setStartAndEnd(o,r,e,n):i.setStartAndEnd(e,n,o,r),this.setSingleRange(i,s)}),nt.deleteFromDocument=function(){if(B&&S&&this.docSelection.type==f){for(var t,e=this.docSelection.createRange();e.length;)t=e.item(0),e.remove(t),a.removeNode(t);this.refresh()}else if(this.rangeCount){var n=this.getAllRanges();if(n.length){this.removeAllRanges();for(var o=0,r=n.length;o<r;++o)n[o].deleteContents();this.addRange(n[r-1])}}},nt.eachRange=function(t,e){for(var n=0,o=this._ranges.length;n<o;++n)if(t(this.getRangeAt(n)))return e},nt.getAllRanges=function(){var t=[];return this.eachRange((function(e){t.push(e)})),t},nt.setSingleRange=function(t,e){this.removeAllRanges(),this.addRange(t,e)},nt.callMethodOnEachRange=function(t,e){var n=[];return this.eachRange((function(o){n.push(o[t].apply(o,e||[]))})),n},nt.setStart=ut(!0),nt.setEnd=ut(!1),t.rangePrototype.select=function(t){tt(this.getDocument()).setSingleRange(this,t)},nt.changeEachRange=function(t){var e=[],n=this.isBackward();this.eachRange((function(n){t(n),e.push(n)})),this.removeAllRanges(),n&&1==e.length?this.addRange(e[0],"backward"):this.setRanges(e)},nt.containsNode=function(t,e){return this.eachRange((function(n){return n.containsNode(t,e)}),!0)||!1},nt.getBookmark=function(t){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[t])}},nt.moveToBookmark=function(e){for(var n,o,r=[],i=0;n=e.rangeBookmarks[i++];)(o=t.createRange(this.win)).moveToBookmark(n),r.push(o);e.backward?this.setSingleRange(r[0],"backward"):this.setRanges(r)},nt.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},nt.restoreRanges=function(t){this.removeAllRanges();for(var e,n=0;e=t.ranges[n];++n)this.addRange(e,t.backward&&0==n)},nt.toHtml=function(){var t=[];return this.eachRange((function(e){t.push(u.toHtml(e))})),t.join("")},h.implementsTextRange&&(nt.getNativeTextRange=function(){var n;if(n=this.docSelection){var o=n.createRange();if(Y(o))return o;throw e.createError("getNativeTextRange: selection is a control selection")}if(this.rangeCount>0)return t.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw e.createError("getNativeTextRange: selection contains no range")}),nt.getName=function(){return"WrappedSelection"},nt.inspect=function(){return ct(this)},nt.detach=function(){Q(this.win,"delete"),$(this)},Z.detachAll=function(){Q(null,"deleteAll")},Z.inspect=ct,Z.isDirectionBackward=m,t.Selection=Z,t.selectionPrototype=nt,t.addShimListener((function(t){void 0===t.getSelection&&(t.getSelection=function(){return tt(t)}),t=null}))}));var B=!1,H=function(t){B||(B=!0,!E.initialized&&E.config.autoInitialize&&N())};return _&&("complete"==document.readyState?H():(s(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",H,!1),y(window,"load",H))),E}()}(ZT);var $T=qT,JT={toolbar:{allowMultiParagraphSelection:!0,buttons:["bold","colorpicker","italic","underline","strikethrough","quote","justifyLeft","justifyCenter","justifyRight","justifyFull","superscript","subscript","orderedlist","unorderedlist","pre","removeFormat","outdent","indent","h2","h3"],standardizeSelectionStart:!1,updateOnEmptySelection:!1},placeholder:{text:"请输入内容",hideOnClick:!0},disableEditing:!0},QT=DT.extensions.button.extend({name:"colorpicker",tagNames:["mark"],contentDefault:"<b>Color</b>",aria:"Color Picker",action:"colorPicker",init:function(){var t=this;$T.init(),DT.extensions.button.prototype.init.call(this),this.colorPicker=new VT({parent:this.button,color:"#000",onDone:function(e){t.coloredText&&t.coloredText.isAppliedToSelection()&&t.coloredText.undoToSelection(),t.coloredText=$T.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:e.hex}},normalize:!0}),t.coloredText.toggleSelection(),t.base.checkContentChanged(),t.setInactive()}})},getButton:function(){return this.button},handleClick:function(){this.setActive(),this.colorPicker.show()},isAlreadyApplied:function(t){return"mark"===t.nodeName.toLowerCase()},isActive:function(){return this.button.classList.contains("medium-editor-button-active")},setInactive:function(){this.button.classList.remove("medium-editor-button-active")},setActive:function(){this.button.classList.add("medium-editor-button-active")}}),tN=function(t){function e(e){var n=t.call(this,e)||this;n.labelMap=new Map;var o=e.lf,r=e.graphModel;return n.lf=o,n.graphModel=r,n.state={tick:0},n}return h(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props.graphModel;this.editor=new DT(".lf-label-editor",ig(JT,{autoLink:!0,extensions:{colorPicker:new QT}})),e.eventCenter.on("text:update,node:mousemove,node:resize,node:rotate,node:drag,label:drop,node:drop",(function(){})),e.eventCenter.on("node:properties-change,node:properties-delete",(function(){t.setState({tick:t.state.tick+1})}))},e.prototype.componentDidUpdate=function(){var t;this.editor&&this.editor.elements.length>0?this.editor.addElements(".lf-label-editor"):(null===(t=this.editor)||void 0===t||t.destroy(),this.editor=new DT(".lf-label-editor",ig(JT,{autoLink:!0,extensions:{colorPicker:new QT}})))},e.prototype.componentWillUnmount=function(){var t;null===(t=this.editor)||void 0===t||t.destroy()},e.prototype.getLabels=function(){var t=this,e=this.props,n=e.lf.extension,o=e.graphModel,r=x(x([],_(o.nodes),!1),_(o.edges),!1);if(n.Label){var i=[];return oh(r,(function(e){var n,r;oh(null!==(r=null===(n=e.getData().properties)||void 0===n?void 0:n._label)&&void 0!==r?r:[],(function(n){var r=t.labelMap,a=new NT(n,e,o);r.set(a.id,a),i.push(xr(MT,{label:a,element:e,graphModel:o},a.id))}))})),i}return null},e.prototype.render=function(){return xr("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},e.toolName="label-edit-tool",e=v([fC],e)}(ho);var eN=function(){function t(t){var e,n,o,r=t.lf,i=t.options;this.labelInitPositionMap=new Map,this.lf=r,this.options=null!=i?i:{},this.textOverflowMode=null!==(e=i.textOverflowMode)&&void 0!==e?e:"default",this.isMultiple=null===(n=i.isMultiple)||void 0===n||n,this.labelWidth=i.labelWidth,this.maxCount=null!==(o=i.maxCount)&&void 0!==o?o:1/0,r.graphModel.editConfigModel.updateTextMode(Nm.LABEL),this.addEventListeners(),r.tool.registerTool(tN.toolName,tN),r.tool.disableTool("text-edit-tool")}return t.prototype.formatConfig=function(t,e){var n=t.editConfigModel,o=n.nodeTextEdit,r=n.edgeTextEdit,i=n.nodeTextDraggable,a=n.edgeTextDraggable,s=this,l=s.textOverflowMode,u=s.isMultiple,c=s.maxCount,d=s.labelWidth,p=e.text,h=e.zIndex,g=e.properties,v=g._label,y=g._labelOption,m=v,b=void 0===y?{}:y,_=b.isMultiple,x=b.maxCount,E=[];if(zr(m)){var w=null!=x?x:c;E=u&&_?m.length>w?m.slice(0,w):m:[m[0]]}else if(Jr(m))E=[m];else if("string"==typeof m||!m){var S=f(f({},p),{content:m||p.value,draggable:"edge"===e.BaseType?a:i});E=S.value?[S]:[]}return"edge"===e.BaseType&&(E=Rh(E,(function(t){var e=t.x,n=t.y;return console.log("x, y ---\x3e>>",e,n),t}))),Rh(E,(function(t){t.id||(t.id=f_());var n=t.value,s=t.content,u=t.vertical,c=t.editable,p=t.draggable,g=t.textOverflowMode,v="node"===e.BaseType?o:r,y="node"===e.BaseType?i:a;return f(f({},t),{zIndex:h,labelWidth:d,content:null!=s?s:n,vertical:null!=u&&u,editable:v&&c,draggable:y&&p,textOverflowMode:null!=g?g:l})}))},t.prototype.setupLabels=function(t){var e=this;oh(t.sortElements,(function(n){e.rewriteInnerMethods(n);var o=e.formatConfig(t,n);n.setProperty("_label",o)}))},t.prototype.addLabel=function(t,e){var n,o,r,i=this.maxCount,a=t.properties,s=null!==(n=a._label)&&void 0!==n?n:[],l=null!==(o=a._labelOption)&&void 0!==o?o:{},u=s.length,c={id:f_(),x:e.x,y:e.y,content:"Label".concat(u+1),value:"Label".concat(u+1),style:{},draggable:!0,editable:!0,vertical:!1};u>=(null!==(r=null==l?void 0:l.maxCount)&&void 0!==r?r:i)||(s.push(c),t.setProperty("_label",s))},t.prototype.addEventListeners=function(){var t=this,e=this.lf.graphModel,n=e.eventCenter,o=e.editConfigModel;n.on("graph:rendered",(function(e){var n=e.graphModel;t.setupLabels(n)})),n.on("node:dbclick,edge:dbclick",(function(n){var r=n.e,i=n.data,a=e.getElement(i.id),s=e.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,l={x:s.x,y:s.y};a&&o.textMode===Nm.LABEL&&t.addLabel(a,l)})),n.on("node:resize",(function(t){var e,n,o=t.preData,r=t.data,i=t.model,a=null!==(e=o.properties)&&void 0!==e?e:{},s=a.width,l=a.height,u=a._label,c=void 0===u?[]:u,d=null!==(n=r.properties)&&void 0!==n?n:{},p=d.width,h=d.height;if(s&&l&&p&&h){var g={x:o.x,y:o.y,width:s,height:l},v={x:r.x,y:r.y,width:p,height:h},y=Rh(c,(function(t){var e,n,o,r,i,a,s,l,u,c,d,p=t.x,h=t.y,y=(n=v,o={x:p,y:h},r=(e=g).x,i=e.y,a=e.width,s=e.height,l=n.x,u=n.y,c=n.width,d=n.height,{x:l+(o.x-r)/a*c,y:u+(o.y-i)/s*d});return f(f({},t),y)}));i.setProperty("_label",y)}})),n.on("node:rotate",(function(e){var n=e.model,o=n.x,r=n.y,i=n.rotate,a=n.properties._label,s={x:o,y:r},l=Rh(void 0===a?[]:a,(function(e){if(!e.id)return e;var n={x:e.x,y:e.y};t.labelInitPositionMap.has(e.id)?n=t.labelInitPositionMap.get(e.id):t.labelInitPositionMap.set(e.id,n);var o=i*(180/Math.PI);o<0&&(o+=360);var r=o*(Math.PI/180),a=function(t,e,n){var o=e.x,r=e.y,i=t.x-o,a=t.y-r;return{x:i*Math.cos(n)-a*Math.sin(n)+o,y:i*Math.sin(n)+a*Math.cos(n)+r}}(n,s,r);return f(f(f({},e),a),{rotate:o})}));n.setProperty("_label",l)}))},t.prototype.rewriteInnerMethods=function(t){t.moveText=function(e,n){if(t.text){var o=t.text,r=o.x,i=o.y,a=o.value,s=o.draggable,l=o.editable;t.text={value:a,editable:l,draggable:s,x:r+e,y:i+n};var u=_d(t.getProperties());if(zr(u._label)){var c=Rh(u._label,(function(t){return f(f({},t),{x:t.x+e,y:t.y+n})}));null==t||t.setProperty("_label",c)}}}},t.prototype.updateTextMode=function(t){var e=this.lf.graphModel.editConfigModel;t!==e.textMode&&(e.updateTextMode(t),t===Nm.LABEL?(this.lf.tool.enableTool(tN.toolName),this.lf.tool.disableTool("text-edit-tool")):t===Nm.TEXT&&(this.lf.tool.enableTool("text-edit-tool"),this.lf.tool.disableTool(tN.toolName)))},t.prototype.render=function(){},t.prototype.destroy=function(){},t.pluginName="Label",t}(),nN=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.paths=[],e.getPathes=function(){if(!n.startNodeType)throw new Error("需要预先指定开始节点类型");return n.getPathes()},e.setRawPaths=function(t){n.setPathes(t)},e.getRawPathes=function(){return n.paths},e.setStartNodeType=function(t){n.startNodeType=t}}return t.prototype.setPathes=function(t){this.paths=t.map((function(t){return{routeId:t.routeId,name:t.name,elements:t.elements,type:t.type,similarElement:null,weight:0}}))},t.prototype.getPathes=function(){var t=this,e=this.lf.getGraphRawData(),n=new Map,o=[];e.nodes.forEach((function(e){n.set(e.id,{id:e.id,data:e,nextNodes:[]}),e.type===t.startNodeType&&o.push(e.id)})),e.edges.forEach((function(t){var e=n.get(t.sourceNodeId);null==e||e.nextNodes.push(t.targetNodeId)}));var r=[];return o.forEach((function(e){var o=n.get(e);o&&(r=r.concat(t.findPathElements(o,n,[])))})),this.getNewPathes(r)},t.prototype.findPathElements=function(t,e,n){void 0===n&&(n=[]);var o=x([],_(n),!1);if(o.push(t.id),0===t.nextNodes.length)return[o];for(var r=[],i=0;i<t.nextNodes.length;i++){var a=e.get(t.nextNodes[i]),s=void 0;if(a){var l=o.indexOf(a.id);s=-1!==l?[x(x([],_(o.slice(l)),!1),[a.id],!1)]:this.findPathElements(a,e,x([],_(o),!1)),r=r.concat(s)}}return r},t.prototype.getNewPathes=function(t){var e=this,n=[],o=new Set;t.forEach((function(t){var r=e.getNewId("path"),i=e.getNewId("路径"),a=e.isLoopPath(t),s=t.join(",");o.has(s)||(o.add(s),n.push({routeId:r,name:i,elements:t,type:a,weight:0,similarElement:""}))}));var r=JSON.parse(JSON.stringify(this.paths));return n.forEach((function(t){for(var n=0;n<r.length;n++){var o=r[n],i=e.similar2Path(x([],_(t.elements),!1),x([],_(o.elements),!1));i>t.weight&&o.weight<=i&&(t.weight=i,t.similarElement=o,i===o.weight&&o.similarElement?(o.similarElement.similarElement=null,o.similarElement.weight=0,o.similarElement=null,o.weight=0):(o.similarElement=t,o.weight=i))}})),n.forEach((function(t){t.similarElement&&t.similarElement.similarElement===t&&(t.routeId=t.similarElement.routeId,t.name=t.similarElement.name),delete t.similarElement,delete t.weight})),this.setPathes(n),n},t.prototype.similar2Path=function(t,e){var n=0,o=t.length+e.length;t.sort(),e.sort();for(var r=t.shift(),i=e.shift();void 0!==r&&void 0!==i;)r===i?(n++,r=t.shift(),i=e.shift()):r<i?r=t.shift():r>i&&(i=e.shift());return n/o*200},t.prototype.getNewId=function(t){return"".concat(t,"_").concat(yC())},t.prototype.isLoopPath=function(t){var e=t.length;return t.indexOf(t[e-1])!==e-1?1:0},t.pluginName="flowPath",t}(),oN=-1,rN=0,iN=1,aN=function(){function t(t){var e=t.lf,n=this;this.levelHeight=[],this.newNodeMap=new Map,this.lf=e,this.trunk=[],e.layout=function(t){var e=n.lf.getGraphRawData();n.lf.setStartNodeType(t);var o=n.lf.getPathes();return n.levelHeight=[],n.newNodeMap=new Map,n.layout(e,o)}}return t.prototype.layout=function(t,e){var n=this,o=[];e.forEach((function(t){var e=t.elements;e.length>o.length?o=e:e.length===o.length&&JSON.stringify(e)===JSON.stringify(n.trunk)&&(o=n.trunk)})),this.trunk=o;for(var r=this.formatData(t),i={nodes:[],edges:[]},a=o.length-1;a>=0;a--)this.setNodePosition(o[a],r,i,a,1);this.lf.graphModel.graphDataToModel(i)},t.prototype.setNodePosition=function(t,e,n,o,r){var i=this,a=e[t],s=a.text,l=a.type,u=a.next,c=a.properties,d=160*o+40,p=120*r,h={id:t,x:d,text:s,y:p,type:l,properties:c};return s&&"object"==typeof s&&(h.text=f(f({},s),{x:d+s.x,y:p+s.y})),this.newNodeMap.set(h.id,{x:h.x,y:h.y,type:l}),n.nodes.push(h),a.isFixed=!0,this.addLevelHeight(o,1),u&&u.length>0&&u.forEach((function(r){if(!e[r.nodeId].isFixed){var a=i.getLevelHeight(o+1);i.addLevelHeight(o,1),i.setNodePosition(r.nodeId,e,n,o+1,a+1)}n.edges.push(f({id:r.edgeId,type:r.edgeType,sourceNodeId:t,targetNodeId:r.nodeId,properties:r.properties,text:r.text},i.getEdgeDataPoints(t,r.nodeId)))})),h},t.prototype.getEdgeDataPoints=function(t,e){var n=this.newNodeMap.get(t),o=this.newNodeMap.get(e),r=this.getShape(t),i=r.width,a=r.height,s=this.getShape(e),l=s.width,u=s.height,c=this.getRelativePosition(n,o),d={x:n.x,y:n.y},p={x:o.x,y:o.y};switch(c){case rN:d.x=n.x+i/2,p.x=o.x-l/2;break;case oN:d.y=n.y+a/2,p.x=o.x-l/2;break;case iN:d.x=n.x+i/2,p.y=o.y+u/2}return{startPoint:d,endPoint:p}},t.prototype.getRelativePosition=function(t,e){var n=t.y,o=e.y;return n<o?-1:n===o?0:1},t.prototype.getShape=function(t){var e,n,o=this.lf.getNodeModelById(t);return{height:null!==(e=null==o?void 0:o.height)&&void 0!==e?e:0,width:null!==(n=null==o?void 0:o.width)&&void 0!==n?n:0}},t.prototype.formatData=function(t){var e=t.nodes.reduce((function(t,e){var n=e.type,o=e.properties,r=e.text,i=e.x,a=e.y;return r&&"object"==typeof r&&(r.x=r.x-i,r.y=r.y-a),t[e.id]={type:n,properties:o,text:r,prev:[],next:[]},t}),{});return t.edges.forEach((function(t){var n=t.sourceNodeId,o=t.targetNodeId,r=t.id,i=t.properties,a=t.text,s=a;"object"==typeof a&&(s=a.value),e[n].next.push({edgeId:r,nodeId:o,edgeType:t.type,properties:i,text:s}),e[o].prev.push({edgeId:r,nodeId:n,properties:i,text:s})})),e},t.prototype.addLevelHeight=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);var o=this.levelHeight[t];o||(o={positiveHeight:0,negativeHeight:0},this.levelHeight[t]=o),n?o.negativeHeight-=e:o.positiveHeight+=e},t.prototype.getLevelHeight=function(t,e){void 0===e&&(e=!1);var n=this.levelHeight[t];return n?e?n.negativeHeight:n.positiveHeight:0},t.pluginName="AutoLayout",t}(),sN=function(t,e){var n=[],o=[],r=function(t,o,i){i&&o.unshift.apply(o,x([],_(e.getEdgeModels({sourceNodeId:t.id,targetNodeId:null==i?void 0:i.id}).map((function(t){return t.id}))),!1)),o.includes(t.id)?n.push(o):(o.unshift(t.id),t.incoming.nodes.length?t.incoming.nodes.forEach((function(e){r(e,o.slice(),t)})):n.push(o))},i=function(t,n,r){r&&n.push.apply(n,x([],_(e.getEdgeModels({sourceNodeId:null==r?void 0:r.id,targetNodeId:t.id}).map((function(t){return t.id}))),!1)),n.includes(t.id)?o.push(n):(n.push(t.id),t.outgoing.nodes.length?t.outgoing.nodes.forEach((function(e){i(e,n.slice(),t)})):o.push(n))};return r(t,[]),i(t,[]),x([],_(new Set(x(x([],_(n.flat()),!1),_(o.flat()),!1))),!1)},lN=function(){function t(t){var e=t.lf;this.mode="path",this.manual=!1,this.tempStyles={},this.lf=e}return t.prototype.setMode=function(t){this.mode=t},t.prototype.setManual=function(t){this.manual=t},t.prototype.highlightSingle=function(t){var e=this.lf.getModelById(t);"node"===(null==e?void 0:e.BaseType)?e.updateStyles(this.tempStyles[t]):"edge"===(null==e?void 0:e.BaseType)&&(e.updateStyles(this.tempStyles[t]),e.sourceNode.updateStyles(this.tempStyles[e.sourceNode.id]),e.targetNode.updateStyles(this.tempStyles[e.targetNode.id]))},t.prototype.highlightPath=function(t){var e=this,n=function(t,e){var n=e.getModelById(t);return sN("node"===(null==n?void 0:n.BaseType)?n:null==n?void 0:n.targetNode,e)}(t,this.lf);n.forEach((function(t){var n;null===(n=e.lf.getModelById(t))||void 0===n||n.updateStyles(e.tempStyles[t])}))},t.prototype.highlight=function(t,e){var n=this;(void 0===e&&(e=this.mode),this.manual)||(Object.keys(this.tempStyles).length&&this.restoreHighlight(),Object.values(this.lf.graphModel.modelsMap).forEach((function(t){var e="node"===t.BaseType?t.getNodeStyle():t.getEdgeStyle();n.tempStyles[t.id]=f({},e),t.setStyles({opacity:.1})})),{single:this.highlightSingle.bind(this),path:this.highlightPath.bind(this)}[e](t))},t.prototype.restoreHighlight=function(){var t=this;Object.keys(this.tempStyles).length&&(Object.values(this.lf.graphModel.modelsMap).forEach((function(e){var n,o=null!==(n=t.tempStyles[e.id])&&void 0!==n?n:{};e.updateStyles(f({},o))})),this.tempStyles={})},t.prototype.render=function(){var t=this;this.lf.on("node:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("edge:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("node:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("edge:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("history:change",this.restoreHighlight.bind(this))},t.prototype.destroy=function(){},t.pluginName="highlight",t}();t.AutoLayout=aN,t.BPMNAdapter=WM,t.BPMNBaseAdapter=zM,t.BPMNElements=eM,t.BoundaryEventFactory=pO,t.BpmnAdapter=nO,t.BpmnElement=IC,t.BpmnXmlAdapter=oO,t.ContextMenu=gT,t.Control=lT,t.CurvedEdge=ET,t.CurvedEdgeModel=wT,t.DiamondResize=IO,t.DiamondResizeModel=RO,t.DiamondResizeView=LO,t.DndPanel=vT,t.EllipseResize=kO,t.EllipseResizeModel=PO,t.EllipseResizeView=DO,t.EndEventFactory=uO,t.EndEventModel=xC,t.EndEventView=EC,t.ExclusiveGatewayModel=MC,t.ExclusiveGatewayView=TC,t.FlowPath=nN,t.GatewayNodeFactory=CO,t.Group=KO,t.GroupNode=GO,t.GroupNodeModel=XO,t.Highlight=lN,t.HtmlResize=HO,t.HtmlResizeModel=jO,t.HtmlResizeView=BO,t.InsertNodeInPolyline=sT,t.IntermediateCatchEventFactory=cO,t.IntermediateThrowEventFactory=hO,t.Label=eN,t.Menu=hT,t.MiniMap=mT,t.NodeResize=UO,t.NodeSelection=OT,t.RectResize=WO,t.RectResizeModel=FO,t.RectResizeView=zO,t.SelectionSelect=yT,t.SequenceFlowModel=SC,t.SequenceFlowView=CC,t.ServiceTaskModel=AC,t.ServiceTaskView=PC,t.Snapshot=$M,t.StartEventFactory=dO,t.StartEventModel=mC,t.StartEventView=bC,t.SubProcessFactory=qO,t.TaskNodeFactory=MO,t.UserTaskModel=kC,t.UserTaskView=RC,t.bpmnUtils=lO,t.convertNormalToXml=RM,t.convertXmlToNormal=LM,t.gateway={exclusive:0,inclusive:1,parallel:2},t.gatewayComposable=[[1,1,0],[0,0,1],[0,1,1]],t.getCurvedEdgePath=xT,t.handleAttributes=zC,t.icons=SO,t.lfJson2Xml=XC,t.lfXml2Json=VC,t.multiInstanceIcon=OO,t.sequenceFlowFactory=$O,t.toLogicflowData=function(t){var e={nodes:[],edges:[]},n=t.flowElementList;return n&&n.length>0&&n.forEach((function(t){if(t.type===JM.SEQUENCE_FLOW){var n=function(t){var e=t.incoming,n=t.outgoing,o=t.properties,r=t.key,i=t.type,a=o.text,s=o.name,l=o.startPoint,u=o.endPoint,c=o.pointsList,d={id:r,type:QM[i],sourceNodeId:e[0],targetNodeId:n[0],text:a||s,properties:{}};l&&(d.startPoint=JSON.parse(l)),u&&(d.endPoint=JSON.parse(u)),c&&(d.pointsList=JSON.parse(c));var p=["startPoint","endPoint","pointsList","text"];return Object.keys(t.properties).forEach((function(e){-1===p.indexOf(e)&&(d.properties[e]=t.properties[e])})),d}(t);e.edges.push(n)}else{var o=function(t){var e=t.properties,n=t.key,o=t.type,r=t.bounds,i=e.x,a=e.y,s=e.text;if(void 0===i){var l=_(r,2),u=l[0],c=u.x,d=u.y,p=l[1];i=(c+p.x)/2,a=(d+p.y)/2}var h={id:n,type:QM[o],x:i,y:a,text:s,properties:{}},f=["x","y","text"];return Object.keys(t.properties).forEach((function(e){-1===f.indexOf(e)&&(h.properties[e]=t.properties[e])})),h}(t);e.nodes.push(o)}})),e},t.toNormalJson=$C,t.toTurboData=function(t){var e=new Map,n={flowElementList:[]};return t.nodes.forEach((function(t){var o=function(t){var e=t.id,n=t.type,o=t.x,r=t.y,i=t.text,a=void 0===i?"":i,s=t.properties;return{incoming:[],outgoing:[],dockers:[],type:tT(n),properties:f(f({},s),{name:a&&a.value||"",x:o,y:r,text:a}),key:e}}(t);n.flowElementList.push(o),e.set(t.id,o)})),t.edges.forEach((function(t){var o=function(t){var e=t.id,n=t.type,o=t.sourceNodeId,r=t.targetNodeId,i=t.startPoint,a=t.endPoint,s=t.pointsList,l=t.text,u=void 0===l?"":l,c=t.properties;return{incoming:[o],outgoing:[r],type:tT(n),dockers:[],properties:f(f({},c),{name:u&&u.value||"",text:u,startPoint:JSON.stringify(i),endPoint:JSON.stringify(a),pointsList:JSON.stringify(s)}),key:e}}(t);e.get(t.sourceNodeId).outgoing.push(o.key),e.get(t.targetNodeId).incoming.push(o.key),n.flowElementList.push(o)})),n},t.toXmlJson=ZC,t.useDefinition=tM}));
|
|
41
|
+
*/String.prototype.startsWith=String.prototype.startsWith||function(t){return 0===this.indexOf(t)},String.prototype.padStart=String.prototype.padStart||function(t,e){for(var n=this;n.length<t;)n=e+n;return n};var yT={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function mT(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(e>0?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString())||"0"}var bT=function(){function t(e,n,o,r){fT(this,t);var i=this;if(void 0===e);else if(Array.isArray(e))this.rgba=e;else if(void 0===o){var a=e&&""+e;a&&function(e){if(e.startsWith("hsl")){var n=e.match(/([\-\d\.e]+)/g).map(Number),o=vT(n,4),r=o[0],a=o[1],s=o[2],l=o[3];void 0===l&&(l=1),r/=360,a/=100,s/=100,i.hsla=[r,a,s,l]}else if(e.startsWith("rgb")){var u=e.match(/([\-\d\.e]+)/g).map(Number),c=vT(u,4),d=c[0],p=c[1],h=c[2],f=c[3];void 0===f&&(f=1),i.rgba=[d,p,h,f]}else e.startsWith("#")?i.rgba=t.hexToRgb(e):i.rgba=t.nameToRgb(e)||t.hexToRgb(e)}(a.toLowerCase())}else this.rgba=[e,n,o,void 0===r?1:r]}return gT(t,[{key:"printRGB",value:function(t){var e=(t?this.rgba:this.rgba.slice(0,3)).map((function(t,e){return mT(t,3===e?3:0)}));return t?"rgba("+e+")":"rgb("+e+")"}},{key:"printHSL",value:function(t){var e=[360,100,100,1],n=["","%","%",""],o=(t?this.hsla:this.hsla.slice(0,3)).map((function(t,o){return mT(t*e[o],3===o?3:1)+n[o]}));return t?"hsla("+o+")":"hsl("+o+")"}},{key:"printHex",value:function(t){var e=this.hex;return t?e:e.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=t.hslToRgb(this._hsla)},set:function(t){3===t.length&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=t.rgbToHsl(this._rgba)},set:function(t){3===t.length&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var t=this.rgba.map((function(t,e){return e<3?t.toString(16):Math.round(255*t).toString(16)}));return"#"+t.map((function(t){return t.padStart(2,"0")})).join("")},set:function(e){this.rgba=t.hexToRgb(e)}}],[{key:"hexToRgb",value:function(t){var e=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!e.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var n=e.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(t){return parseInt(t,16)}));return n[3]=n[3]/255,n}},{key:"nameToRgb",value:function(e){var n=e.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),o=yT[n];return void 0===o?o:t.hexToRgb(o.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var e=vT(t,4),n=e[0],o=e[1],r=e[2],i=e[3];n/=255,o/=255,r/=255;var a=Math.max(n,o,r),s=Math.min(n,o,r),l=void 0,u=void 0,c=(a+s)/2;if(a===s)l=u=0;else{var d=a-s;switch(u=c>.5?d/(2-a-s):d/(a+s),a){case n:l=(o-r)/d+(o<r?6:0);break;case o:l=(r-n)/d+2;break;case r:l=(n-o)/d+4}l/=6}return[l,u,c,i]}},{key:"hslToRgb",value:function(t){var e=vT(t,4),n=e[0],o=e[1],r=e[2],i=e[3],a=void 0,s=void 0,l=void 0;if(0===o)a=s=l=r;else{var u=function(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},c=r<.5?r*(1+o):r+o-r*o,d=2*r-c;a=u(d,c,n+1/3),s=u(d,c,n),l=u(d,c,n-1/3)}var p=[255*a,255*s,255*l].map(Math.round);return p[3]=i,p}}]),t}(),_T=function(){function t(){fT(this,t),this._events=[]}return gT(t,[{key:"add",value:function(t,e,n){t.addEventListener(e,n,!1),this._events.push({target:t,type:e,handler:n})}},{key:"remove",value:function(e,n,o){this._events=this._events.filter((function(r){var i=!0;return e&&e!==r.target&&(i=!1),n&&n!==r.type&&(i=!1),o&&o!==r.handler&&(i=!1),i&&t._doRemove(r.target,r.type,r.handler),!i}))}},{key:"destroy",value:function(){this._events.forEach((function(e){return t._doRemove(e.target,e.type,e.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(t,e,n){t.removeEventListener(e,n,!1)}}]),t}();function xT(t,e,n){var o=!1;function r(t,e,n){return Math.max(e,Math.min(t,n))}function i(t,i,a){if(a&&(o=!0),o){t.preventDefault();var s=e.getBoundingClientRect(),l=s.width,u=s.height,c=i.clientX,d=i.clientY,p=r(c-s.left,0,l),h=r(d-s.top,0,u);n(p/l,h/u)}}function a(t,e){1===(void 0===t.buttons?t.which:t.buttons)?i(t,t,e):o=!1}function s(t,e){1===t.touches.length?i(t,t.touches[0],e):o=!1}t.add(e,"mousedown",(function(t){a(t,!0)})),t.add(e,"touchstart",(function(t){s(t,!0)})),t.add(window,"mousemove",a),t.add(e,"touchmove",s),t.add(window,"mouseup",(function(t){o=!1})),t.add(e,"touchend",(function(t){o=!1})),t.add(e,"touchcancel",(function(t){o=!1}))}var ET="keydown",wT="mousedown",ST="focusin";function CT(t,e){return(e||document).querySelector(t)}function MT(t){t.preventDefault(),t.stopPropagation()}function OT(t,e,n,o,r){t.add(e,ET,(function(t){n.indexOf(t.key)>=0&&(r&&MT(t),o(t))}))}var TT=function(){function t(e){fT(this,t),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new _T,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return gT(t,[{key:"setOptions",value:function(t){var e=this;if(t){var n=this.settings;if(t instanceof HTMLElement)n.parent=t;else{n.parent&&t.parent&&n.parent!==t.parent&&(this._events.remove(n.parent),this._popupInited=!1),function(t,e,n){for(var o in t)n&&n.indexOf(o)>=0||(e[o]=t[o])}(t,n),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var o=t.color||t.colour;o&&this._setColor(o)}var r=n.parent;if(r&&n.popup&&!this._popupInited){var i=function(t){return e.openHandler(t)};this._events.add(r,"click",i),OT(this._events,r,[" ","Spacebar","Enter"],i),this._popupInited=!0}else t.parent&&!n.popup&&this.show()}}},{key:"openHandler",value:function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var e=t&&t.type===ET?this._domEdit:this.domElement;setTimeout((function(){return e.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(t){var e=t&&t.type,n=!1;if(t)if(e===wT||e===ST){var o=(this.__containedEvent||0)+100;t.timeStamp>o&&(n=!0)}else MT(t),n=!0;else n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents="",e!==wT&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(t,e){this.closeHandler(),this.setOptions(t),e&&this.openHandler()}},{key:"setColor",value:function(t,e){this._setColor(t,{silent:e})}},{key:"_setColor",value:function(t,e){if("string"==typeof t&&(t=t.trim()),t){e=e||{};var n=void 0;try{n=new bT(t)}catch(t){if(e.failSilently)return;throw t}if(!this.settings.alpha){var o=n.hsla;o[3]=1,n.hsla=o}this.colour=this.color=n,this._setHSLA(null,null,null,null,e)}}},{key:"setColour",value:function(t,e){this.setColor(t,e)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var t=this._toggleDOM(!0);return this._setPosition(),t}var e,n,o=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',r=(e=o,(n=document.createElement("div")).innerHTML=e,n.firstElementChild);return this.domElement=r,this._domH=CT(".picker_hue",r),this._domSL=CT(".picker_sl",r),this._domA=CT(".picker_alpha",r),this._domEdit=CT(".picker_editor input",r),this._domSample=CT(".picker_sample",r),this._domOkay=CT(".picker_done button",r),this._domCancel=CT(".picker_cancel button",r),r.classList.add("layout_"+this.settings.layout),this.settings.alpha||r.classList.add("no_alpha"),this.settings.editor||r.classList.add("no_editor"),this.settings.cancelButton||r.classList.add("no_cancel"),this._ifPopup((function(){return r.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var t=this,e=this,n=this.domElement,o=this._events;function r(t,e,n){o.add(t,e,n)}r(n,"click",(function(t){return t.preventDefault()})),xT(o,this._domH,(function(t,n){return e._setHSLA(t)})),xT(o,this._domSL,(function(t,n){return e._setHSLA(null,t,1-n)})),this.settings.alpha&&xT(o,this._domA,(function(t,n){return e._setHSLA(null,null,null,1-n)}));var i=this._domEdit;r(i,"input",(function(t){e._setColor(this.value,{fromEditor:!0,failSilently:!0})})),r(i,"focus",(function(t){var e=this;e.selectionStart===e.selectionEnd&&e.select()})),this._ifPopup((function(){var e=function(e){return t.closeHandler(e)};r(window,wT,e),r(window,ST,e),OT(o,n,["Esc","Escape"],e);var i=function(e){t.__containedEvent=e.timeStamp};r(n,wT,i),r(n,ST,i),r(t._domCancel,"click",e)}));var a=function(e){t._ifPopup((function(){return t.closeHandler(e)})),t.onDone&&t.onDone(t.colour)};r(this._domOkay,"click",a),OT(o,n,["Enter"],a)}},{key:"_setPosition",value:function(){var t=this.settings.parent,e=this.domElement;t!==e.parentNode&&t.appendChild(e),this._ifPopup((function(n){"static"===getComputedStyle(t).position&&(t.style.position="relative");var o=!0===n?"popup_right":"popup_"+n;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(t){t===o?e.classList.add(t):e.classList.remove(t)})),e.classList.add(o)}))}},{key:"_setHSLA",value:function(t,e,n,o,r){r=r||{};var i=this.colour,a=i.hsla;[t,e,n,o].forEach((function(t,e){(t||0===t)&&(a[e]=t)})),i.hsla=a,this._updateUI(r),this.onChange&&!r.silent&&this.onChange(i)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var e=this.colour,n=e.hsla,o="hsl("+360*n[0]+", 100%, 50%)",r=e.hslString,i=e.hslaString,a=this._domH,s=this._domSL,l=this._domA,u=CT(".picker_selector",a),c=CT(".picker_selector",s),d=CT(".picker_selector",l);m(0,u,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=o,m(0,c,n[1]),b(0,c,1-n[2]),s.style.color=r,b(0,d,1-n[3]);var p=r,h=p.replace("hsl","hsla").replace(")",", 0)"),f="linear-gradient("+[p,h]+")";if(this._domA.style.background=f+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!t.fromEditor){var g=this.settings.editorFormat,v=this.settings.alpha,y=void 0;switch(g){case"rgb":y=e.printRGB(v);break;case"hsl":y=e.printHSL(v);break;default:y=e.printHex(v)}this._domEdit.value=y}this._domSample.style.color=i}function m(t,e,n){e.style.left=100*n+"%"}function b(t,e,n){e.style.top=100*n+"%"}}},{key:"_ifPopup",value:function(t,e){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):e&&e()}},{key:"_toggleDOM",value:function(t){var e=this.domElement;if(!e)return!1;var n=t?"":"none",o=e.style.display!==n;return o&&(e.style.display=n),o}}]),t}(),NT=document.createElement("style");NT.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(NT),TT.StyleElement=NT;var AT={},PT={get exports(){return AT},set exports(t){AT=t}};!function(t){t.exports=function(){var t="object",e="function",n="undefined",o=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],r=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],i=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],a=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function s(n,o){var r=typeof n[o];return r==e||!(r!=t||!n[o])||"unknown"==r}function l(e,n){return!(typeof e[n]!=t||!e[n])}function u(t,e){return typeof t[e]!=n}function c(t){return function(e,n){for(var o=n.length;o--;)if(!t(e,n[o]))return!1;return!0}}var d=c(s),p=c(l),h=c(u);function f(t){return t&&d(t,a)&&h(t,i)}function g(t){return l(t,"body")?t.body:t.getElementsByTagName("body")[0]}var v,y,m=[].forEach?function(t,e){t.forEach(e)}:function(t,e){for(var n=0,o=t.length;n<o;++n)e(t[n],n)},b={},_=typeof window!=n&&typeof document!=n,x={isHostMethod:s,isHostObject:l,isHostProperty:u,areHostMethods:d,areHostObjects:p,areHostProperties:h,isTextRange:f,getBody:g,forEach:m},E={version:"1.3.1",initialized:!1,isBrowser:_,supported:!0,util:x,features:{},modules:b,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==n||rangyAutoInitialize}};function w(t){typeof console!=n&&s(console,"log")&&console.log(t)}function S(t,e){_&&e?alert(t):w(t)}function C(t){E.initialized=!0,E.supported=!1,S("Rangy is not supported in this environment. Reason: "+t,E.config.alertOnFail)}function M(t){S("Rangy warning: "+t,E.config.alertOnWarn)}E.fail=C,E.warn=M,{}.hasOwnProperty?(x.extend=v=function(t,e,n){var o,r;for(var i in e)e.hasOwnProperty(i)&&(o=t[i],r=e[i],n&&null!==o&&"object"==typeof o&&null!==r&&"object"==typeof r&&v(o,r,!0),t[i]=r);return e.hasOwnProperty("toString")&&(t.toString=e.toString),t},x.createOptions=function(t,e){var n={};return v(n,e),t&&v(n,t),n}):C("hasOwnProperty not supported"),_||C("Rangy can only run in a browser"),function(){var t;if(_){var e=document.createElement("div");e.appendChild(document.createElement("span"));var n=[].slice;try{1==n.call(e.childNodes,0)[0].nodeType&&(t=function(t){return n.call(t,0)})}catch(t){}}t||(t=function(t){for(var e=[],n=0,o=t.length;n<o;++n)e[n]=t[n];return e}),x.toArray=t}(),_&&(s(document,"addEventListener")?y=function(t,e,n){t.addEventListener(e,n,!1)}:s(document,"attachEvent")?y=function(t,e,n){t.attachEvent("on"+e,n)}:C("Document does not have required addEventListener or attachEvent method"),x.addListener=y);var O=[];function T(t){return t.message||t.description||String(t)}function N(){if(_&&!E.initialized){var t,e=!1,n=!1;s(document,"createRange")&&(t=document.createRange(),d(t,r)&&h(t,o)&&(e=!0));var i=g(document);if(i&&"body"==i.nodeName.toLowerCase())if(i&&s(i,"createTextRange")&&f(t=i.createTextRange())&&(n=!0),e||n){var a;for(var l in E.initialized=!0,E.features={implementsDomRange:e,implementsTextRange:n},b)(a=b[l])instanceof R&&a.init(a,E);for(var u=0,c=O.length;u<c;++u)try{O[u](E)}catch(t){w("Rangy init listener threw an exception. Continuing. Detail: "+T(t))}}else C("Neither Range nor TextRange are available");else C("No body element found")}}function A(t,e,n){n&&(t+=" in module "+n.name),E.warn("DEPRECATED: "+t+" is deprecated. Please use "+e+" instead.")}function P(t,e,n,o){t[e]=function(){return A(e,n,o),t[n].apply(t,x.toArray(arguments))}}x.deprecationNotice=A,x.createAliasForDeprecatedMethod=P,E.init=N,E.addInitListener=function(t){E.initialized?t(E):O.push(t)};var D=[];function k(t){t=t||window,N();for(var e=0,n=D.length;e<n;++e)D[e](t)}function R(t,e,n){this.name=t,this.dependencies=e,this.initialized=!1,this.supported=!1,this.initializer=n}function I(t,e,n){var o=new R(t,e,(function(e){if(!e.initialized){e.initialized=!0;try{n(E,e),e.supported=!0}catch(e){w("Module '"+t+"' failed to load: "+T(e)),e.stack&&w(e.stack)}}}));return b[t]=o,o}function L(){}function j(){}E.addShimListener=function(t){D.push(t)},_&&(E.shim=E.createMissingNativeApi=k,P(E,"createMissingNativeApi","shim")),R.prototype={init:function(){for(var t,e,n=this.dependencies||[],o=0,r=n.length;o<r;++o){if(e=n[o],!((t=b[e])&&t instanceof R))throw new Error("required module '"+e+"' not found");if(t.init(),!t.supported)throw new Error("required module '"+e+"' not supported")}this.initializer(this)},fail:function(t){throw this.initialized=!0,this.supported=!1,new Error(t)},warn:function(t){E.warn("Module "+this.name+": "+t)},deprecationNotice:function(t,e){E.warn("DEPRECATED: "+t+" in module "+this.name+" is deprecated. Please use "+e+" instead")},createError:function(t){return new Error("Error in Rangy "+this.name+" module: "+t)}},E.createModule=function(t){var e,n;2==arguments.length?(e=arguments[1],n=[]):(e=arguments[2],n=arguments[1]);var o=I(t,n,e);E.initialized&&E.supported&&o.init()},E.createCoreModule=function(t,e,n){I(t,e,n)},E.RangePrototype=L,E.rangePrototype=new L,E.selectionPrototype=new j,E.createCoreModule("DomUtil",[],(function(t,e){var n="undefined",o=t.util,r=o.getBody;o.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||e.fail("document missing a Node creation method"),o.isHostMethod(document,"getElementsByTagName")||e.fail("document missing getElementsByTagName method");var i=document.createElement("div");o.areHostMethods(i,["insertBefore","appendChild","cloneNode"]||!o.areHostObjects(i,["previousSibling","nextSibling","childNodes","parentNode"]))||e.fail("Incomplete Element implementation"),o.isHostProperty(i,"innerHTML")||e.fail("Element is missing innerHTML property");var a=document.createTextNode("test");o.areHostMethods(a,["splitText","deleteData","insertData","appendData","cloneNode"]||!o.areHostObjects(i,["previousSibling","nextSibling","childNodes","parentNode"])||!o.areHostProperties(a,["data"]))||e.fail("Incomplete Text Node implementation");var s=function(t,e){for(var n=t.length;n--;)if(t[n]===e)return!0;return!1};function l(t){var e;return typeof t.namespaceURI==n||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function u(t){var e=t.parentNode;return 1==e.nodeType?e:null}function c(t){for(var e=0;t=t.previousSibling;)++e;return e}function d(t){switch(t.nodeType){case 7:case 10:return 0;case 3:case 8:return t.length;default:return t.childNodes.length}}function p(t,e){var n,o=[];for(n=t;n;n=n.parentNode)o.push(n);for(n=e;n;n=n.parentNode)if(s(o,n))return n;return null}function h(t,e,n){for(var o=n?e:e.parentNode;o;){if(o===t)return!0;o=o.parentNode}return!1}function f(t,e){return h(t,e,!0)}function g(t,e,n){for(var o,r=n?t:t.parentNode;r;){if((o=r.parentNode)===e)return r;r=o}return null}function v(t){var e=t.nodeType;return 3==e||4==e||8==e}function y(t){if(!t)return!1;var e=t.nodeType;return 3==e||8==e}function m(t,e){var n=e.nextSibling,o=e.parentNode;return n?o.insertBefore(t,n):o.appendChild(t),t}function b(t,e,n){var o=t.cloneNode(!1);if(o.deleteData(0,e),t.deleteData(e,t.length-e),m(o,t),n)for(var r,i=0;r=n[i++];)r.node==t&&r.offset>e?(r.node=o,r.offset-=e):r.node==t.parentNode&&r.offset>c(t)&&++r.offset;return o}function _(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=n)return t.ownerDocument;if(typeof t.document!=n)return t.document;if(t.parentNode)return _(t.parentNode);throw e.createError("getDocument: no document found for node")}function x(t){var o=_(t);if(typeof o.defaultView!=n)return o.defaultView;if(typeof o.parentWindow!=n)return o.parentWindow;throw e.createError("Cannot get a window object for node")}function E(t){if(typeof t.contentDocument!=n)return t.contentDocument;if(typeof t.contentWindow!=n)return t.contentWindow.document;throw e.createError("getIframeDocument: No Document object found for iframe element")}function w(t){if(typeof t.contentWindow!=n)return t.contentWindow;if(typeof t.contentDocument!=n)return t.contentDocument.defaultView;throw e.createError("getIframeWindow: No Window object found for iframe element")}function S(t){return t&&o.isHostMethod(t,"setTimeout")&&o.isHostObject(t,"document")}function C(t,e,n){var r;if(t?o.isHostProperty(t,"nodeType")?r=1==t.nodeType&&"iframe"==t.tagName.toLowerCase()?E(t):_(t):S(t)&&(r=t.document):r=document,!r)throw e.createError(n+"(): Parameter must be a Window object or DOM node");return r}function M(t){for(var e;e=t.parentNode;)t=e;return t}function O(t,n,o,r){var i,a,s,l,u;if(t==o)return n===r?0:n<r?-1:1;if(i=g(o,t,!0))return n<=c(i)?-1:1;if(i=g(t,o,!0))return c(i)<r?-1:1;if(!(a=p(t,o)))throw new Error("comparePoints error: nodes have no common ancestor");if((s=t===a?a:g(t,a,!0))===(l=o===a?a:g(o,a,!0)))throw e.createError("comparePoints got to case 4 and childA and childB are the same!");for(u=a.firstChild;u;){if(u===s)return-1;if(u===l)return 1;u=u.nextSibling}}var T,N=!1;function A(t){try{return t.parentNode,!1}catch(t){return!0}}function P(t){if(!t)return"[No node]";if(N&&A(t))return"[Broken node]";if(v(t))return'"'+t.data+'"';if(1==t.nodeType){var e=t.id?' id="'+t.id+'"':"";return"<"+t.nodeName+e+">[index:"+c(t)+",length:"+t.childNodes.length+"]["+(t.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return t.nodeName}function D(t){for(var e,n=_(t).createDocumentFragment();e=t.firstChild;)n.appendChild(e);return n}function k(t,e,n){var o=r(t),i=t.createElement("div");i.contentEditable=""+!!n,e&&(i.innerHTML=e);var a=o.firstChild;return a?o.insertBefore(i,a):o.appendChild(i),i}function R(t){return t.parentNode.removeChild(t)}function I(t){this.root=t,this._next=t}function L(t){return new I(t)}function j(t,e){this.node=t,this.offset=e}function B(t){this.code=this[t],this.codeName=t,this.message="DOMException: "+this.codeName}!function(){var e=document.createElement("b");e.innerHTML="1";var n=e.firstChild;e.innerHTML="<br />",N=A(n),t.features.crashyTextNodes=N}(),typeof window.getComputedStyle!=n?T=function(t,e){return x(t).getComputedStyle(t,null)[e]}:typeof document.documentElement.currentStyle!=n?T=function(t,e){return t.currentStyle?t.currentStyle[e]:""}:e.fail("No means of obtaining computed style properties found"),I.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var t,e,n=this._current=this._next;if(this._current)if(t=n.firstChild)this._next=t;else{for(e=null;n!==this.root&&!(e=n.nextSibling);)n=n.parentNode;this._next=e}return this._current},detach:function(){this._current=this._next=this.root=null}},j.prototype={equals:function(t){return!!t&&this.node===t.node&&this.offset==t.offset},inspect:function(){return"[DomPosition("+P(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}},B.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},B.prototype.toString=function(){return this.message},t.dom={arrayContains:s,isHtmlNamespace:l,parentElement:u,getNodeIndex:c,getNodeLength:d,getCommonAncestor:p,isAncestorOf:h,isOrIsAncestorOf:f,getClosestAncestorIn:g,isCharacterDataNode:v,isTextOrCommentNode:y,insertAfter:m,splitDataNode:b,getDocument:_,getWindow:x,getIframeWindow:w,getIframeDocument:E,getBody:r,isWindow:S,getContentDocument:C,getRootContainer:M,comparePoints:O,isBrokenNode:A,inspectNode:P,getComputedStyleProperty:T,createTestElement:k,removeNode:R,fragmentFromNodeChildren:D,createIterator:L,DomPosition:j},t.DOMException=B})),E.createCoreModule("DomRange",["DomUtil"],(function(t,e){var n=t.dom,o=t.util,r=n.DomPosition,i=t.DOMException,a=n.isCharacterDataNode,s=n.getNodeIndex,l=n.isOrIsAncestorOf,u=n.getDocument,c=n.comparePoints,d=n.splitDataNode,p=n.getClosestAncestorIn,h=n.getNodeLength,f=n.arrayContains,g=n.getRootContainer,v=t.features.crashyTextNodes,y=n.removeNode;function m(t,e){return 3!=t.nodeType&&(l(t,e.startContainer)||l(t,e.endContainer))}function b(t){return t.document||u(t.startContainer)}function _(t){return g(t.startContainer)}function x(t){return new r(t.parentNode,s(t))}function E(t){return new r(t.parentNode,s(t)+1)}function w(t,e,o){var r=11==t.nodeType?t.firstChild:t;return a(e)?o==e.length?n.insertAfter(t,e):e.parentNode.insertBefore(t,0==o?e:d(e,o)):o>=e.childNodes.length?e.appendChild(t):e.insertBefore(t,e.childNodes[o]),r}function S(t,e,n){if(Z(t),Z(e),b(e)!=b(t))throw new i("WRONG_DOCUMENT_ERR");var o=c(t.startContainer,t.startOffset,e.endContainer,e.endOffset),r=c(t.endContainer,t.endOffset,e.startContainer,e.startOffset);return n?o<=0&&r>=0:o<0&&r>0}function C(t){for(var e,n,o,r=b(t.range).createDocumentFragment();n=t.next();){if(e=t.isPartiallySelectedSubtree(),n=n.cloneNode(!e),e&&(o=t.getSubtreeIterator(),n.appendChild(C(o)),o.detach()),10==n.nodeType)throw new i("HIERARCHY_REQUEST_ERR");r.appendChild(n)}return r}function M(t,e,o){var r,i,a,s;for(o=o||{stop:!1};a=t.next();)if(t.isPartiallySelectedSubtree()){if(!1===e(a))return void(o.stop=!0);if(M(s=t.getSubtreeIterator(),e,o),s.detach(),o.stop)return}else for(r=n.createIterator(a);i=r.next();)if(!1===e(i))return void(o.stop=!0)}function O(t){for(var e;t.next();)t.isPartiallySelectedSubtree()?(O(e=t.getSubtreeIterator()),e.detach()):t.remove()}function T(t){for(var e,n,o=b(t.range).createDocumentFragment();e=t.next();){if(t.isPartiallySelectedSubtree()?(e=e.cloneNode(!1),n=t.getSubtreeIterator(),e.appendChild(T(n)),n.detach()):t.remove(),10==e.nodeType)throw new i("HIERARCHY_REQUEST_ERR");o.appendChild(e)}return o}function N(t,e,n){var o,r=!(!e||!e.length),i=!!n;r&&(o=new RegExp("^("+e.join("|")+")$"));var s=[];return M(new P(t,!1),(function(e){if((!r||o.test(e.nodeType))&&(!i||n(e))){var l=t.startContainer;if(e!=l||!a(l)||t.startOffset!=l.length){var u=t.endContainer;e==u&&a(u)&&0==t.endOffset||s.push(e)}}})),s}function A(t){return"["+(void 0===t.getName?"Range":t.getName())+"("+n.inspectNode(t.startContainer)+":"+t.startOffset+", "+n.inspectNode(t.endContainer)+":"+t.endOffset+")]"}function P(t,e){if(this.range=t,this.clonePartiallySelectedTextNodes=e,!t.collapsed){this.sc=t.startContainer,this.so=t.startOffset,this.ec=t.endContainer,this.eo=t.endOffset;var n=t.commonAncestorContainer;this.sc===this.ec&&a(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==n||a(this.sc)?p(this.sc,n,!0):this.sc.childNodes[this.so],this._last=this.ec!==n||a(this.ec)?p(this.ec,n,!0):this.ec.childNodes[this.eo-1])}}P.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var t=this._current=this._next;return t&&(this._next=t!==this._last?t.nextSibling:null,a(t)&&this.clonePartiallySelectedTextNodes&&(t===this.ec&&(t=t.cloneNode(!0)).deleteData(this.eo,t.length-this.eo),this._current===this.sc&&(t=t.cloneNode(!0)).deleteData(0,this.so))),t},remove:function(){var t,e,n=this._current;!a(n)||n!==this.sc&&n!==this.ec?n.parentNode&&y(n):(t=n===this.sc?this.so:0)!=(e=n===this.ec?this.eo:n.length)&&n.deleteData(t,e-t)},isPartiallySelectedSubtree:function(){return m(this._current,this.range)},getSubtreeIterator:function(){var t;if(this.isSingleCharacterDataNode)(t=this.range.cloneRange()).collapse(!1);else{t=new yt(b(this.range));var e=this._current,n=e,o=0,r=e,i=h(e);l(e,this.sc)&&(n=this.sc,o=this.so),l(e,this.ec)&&(r=this.ec,i=this.eo),vt(t,n,o,r,i)}return new P(t,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var D=[1,3,4,5,7,8,10],k=[2,9,11],R=[5,6,10,12],I=[1,3,4,5,7,8,10,11],L=[1,3,4,5,7,8];function j(t){return function(e,n){for(var o,r=n?e:e.parentNode;r;){if(o=r.nodeType,f(t,o))return r;r=r.parentNode}return null}}var B=j([9,11]),H=j(R),z=j([6,10,12]),F=j([1]);function W(t,e){if(z(t,e))throw new i("INVALID_NODE_TYPE_ERR")}function G(t,e){if(!f(e,t.nodeType))throw new i("INVALID_NODE_TYPE_ERR")}function X(t,e){if(e<0||e>(a(t)?t.length:t.childNodes.length))throw new i("INDEX_SIZE_ERR")}function U(t,e){if(B(t,!0)!==B(e,!0))throw new i("WRONG_DOCUMENT_ERR")}function Y(t){if(H(t,!0))throw new i("NO_MODIFICATION_ALLOWED_ERR")}function V(t,e){if(!t)throw new i(e)}function K(t,e){return e<=(a(t)?t.length:t.childNodes.length)}function q(t){return!!t.startContainer&&!!t.endContainer&&!(v&&(n.isBrokenNode(t.startContainer)||n.isBrokenNode(t.endContainer)))&&g(t.startContainer)==g(t.endContainer)&&K(t.startContainer,t.startOffset)&&K(t.endContainer,t.endOffset)}function Z(t){if(!q(t))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+t.inspect()+")")}var $=document.createElement("style"),J=!1;try{$.innerHTML="<b>x</b>",J=3==$.firstChild.nodeType}catch(t){}t.features.htmlParsingConforms=J;var Q=J?function(t){var e=this.startContainer,o=u(e);if(!e)throw new i("INVALID_STATE_ERR");var r=null;return 1==e.nodeType?r=e:a(e)&&(r=n.parentElement(e)),(r=null===r||"HTML"==r.nodeName&&n.isHtmlNamespace(u(r).documentElement)&&n.isHtmlNamespace(r)?o.createElement("body"):r.cloneNode(!1)).innerHTML=t,n.fragmentFromNodeChildren(r)}:function(t){var e=b(this).createElement("body");return e.innerHTML=t,n.fragmentFromNodeChildren(e)};function tt(t,e){Z(t);var n=t.startContainer,o=t.startOffset,r=t.endContainer,i=t.endOffset,l=n===r;a(r)&&i>0&&i<r.length&&d(r,i,e),a(n)&&o>0&&o<n.length&&(n=d(n,o,e),l?(i-=o,r=n):r==n.parentNode&&i>=s(n)&&i++,o=0),t.setStartAndEnd(n,o,r,i)}function et(t){Z(t);var e=t.commonAncestorContainer.parentNode.cloneNode(!1);return e.appendChild(t.cloneContents()),e.innerHTML}var nt=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],ot=0,rt=1,it=2,at=3,st=0,lt=1,ut=2,ct=3;function dt(t){t.START_TO_START=ot,t.START_TO_END=rt,t.END_TO_END=it,t.END_TO_START=at,t.NODE_BEFORE=st,t.NODE_AFTER=lt,t.NODE_BEFORE_AND_AFTER=ut,t.NODE_INSIDE=ct}function pt(t){dt(t),dt(t.prototype)}function ht(t,e){return function(){Z(this);var n,o=this.startContainer,r=this.startOffset,i=this.commonAncestorContainer,a=new P(this,!0);o!==i&&(o=(n=E(p(o,i,!0))).node,r=n.offset),M(a,Y),a.reset();var s=t(a);return a.detach(),e(this,o,r,o,r),s}}function ft(e,n){function r(t,e){return function(n){G(n,D),G(g(n),k);var o=(t?x:E)(n);(e?i:l)(this,o.node,o.offset)}}function i(t,e,o){var r=t.endContainer,i=t.endOffset;e===t.startContainer&&o===t.startOffset||(g(e)==g(r)&&1!=c(e,o,r,i)||(r=e,i=o),n(t,e,o,r,i))}function l(t,e,o){var r=t.startContainer,i=t.startOffset;e===t.endContainer&&o===t.endOffset||(g(e)==g(r)&&-1!=c(e,o,r,i)||(r=e,i=o),n(t,r,i,e,o))}var u=function(){};u.prototype=t.rangePrototype,e.prototype=new u,o.extend(e.prototype,{setStart:function(t,e){W(t,!0),X(t,e),i(this,t,e)},setEnd:function(t,e){W(t,!0),X(t,e),l(this,t,e)},setStartAndEnd:function(){var t=arguments,e=t[0],o=t[1],r=e,i=o;switch(t.length){case 3:i=t[2];break;case 4:r=t[2],i=t[3]}W(e,!0),X(e,o),W(r,!0),X(r,i),n(this,e,o,r,i)},setBoundary:function(t,e,n){this["set"+(n?"Start":"End")](t,e)},setStartBefore:r(!0,!0),setStartAfter:r(!1,!0),setEndBefore:r(!0,!1),setEndAfter:r(!1,!1),collapse:function(t){Z(this),t?n(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):n(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(t){W(t,!0),n(this,t,0,t,h(t))},selectNode:function(t){W(t,!1),G(t,D);var e=x(t),o=E(t);n(this,e.node,e.offset,o.node,o.offset)},extractContents:ht(T,n),deleteContents:ht(O,n),canSurroundContents:function(){Z(this),Y(this.startContainer),Y(this.endContainer);var t=new P(this,!0),e=t._first&&m(t._first,this)||t._last&&m(t._last,this);return t.detach(),!e},splitBoundaries:function(){tt(this)},splitBoundariesPreservingPositions:function(t){tt(this,t)},normalizeBoundaries:function(){Z(this);var t,e=this.startContainer,o=this.startOffset,r=this.endContainer,i=this.endOffset,l=function(t){var e=t.nextSibling;e&&e.nodeType==t.nodeType&&(r=t,i=t.length,t.appendData(e.data),y(e))},u=function(t){var n=t.previousSibling;if(n&&n.nodeType==t.nodeType){e=t;var a=t.length;if(o=n.length,t.insertData(0,n.data),y(n),e==r)i+=o,r=e;else if(r==t.parentNode){var l=s(t);i==l?(r=t,i=a):i>l&&i--}}},c=!0;if(a(r))i==r.length?l(r):0==i&&(t=r.previousSibling)&&t.nodeType==r.nodeType&&(i=t.length,e==r&&(c=!1),t.appendData(r.data),y(r),r=t);else{if(i>0){var d=r.childNodes[i-1];d&&a(d)&&l(d)}c=!this.collapsed}if(c){if(a(e))0==o?u(e):o==e.length&&(t=e.nextSibling)&&t.nodeType==e.nodeType&&(r==t&&(r=e,i+=e.length),e.appendData(t.data),y(t));else if(o<e.childNodes.length){var p=e.childNodes[o];p&&a(p)&&u(p)}}else e=r,o=i;n(this,e,o,r,i)},collapseToPoint:function(t,e){W(t,!0),X(t,e),this.setStartAndEnd(t,e)},parentElement:function(){return Z(this),this.commonAncestorContainer?F(this.commonAncestorContainer,!0):null}}),pt(e)}function gt(t){t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset,t.commonAncestorContainer=t.collapsed?t.startContainer:n.getCommonAncestor(t.startContainer,t.endContainer)}function vt(t,e,o,r,i){t.startContainer=e,t.startOffset=o,t.endContainer=r,t.endOffset=i,t.document=n.getDocument(e),gt(t)}function yt(t){vt(this,t,0,t,0)}o.extend(t.rangePrototype,{compareBoundaryPoints:function(t,e){var n,o,r,i;Z(this),U(this.startContainer,e.startContainer);var a=t==at||t==ot?"start":"end",s=t==rt||t==ot?"start":"end";return n=this[a+"Container"],o=this[a+"Offset"],r=e[s+"Container"],i=e[s+"Offset"],c(n,o,r,i)},insertNode:function(t){if(Z(this),G(t,I),Y(this.startContainer),l(t,this.startContainer))throw new i("HIERARCHY_REQUEST_ERR");var e=w(t,this.startContainer,this.startOffset);this.setStartBefore(e)},cloneContents:function(){var t,e;if(Z(this),this.collapsed)return b(this).createDocumentFragment();if(this.startContainer===this.endContainer&&a(this.startContainer))return(t=this.startContainer.cloneNode(!0)).data=t.data.slice(this.startOffset,this.endOffset),(e=b(this).createDocumentFragment()).appendChild(t),e;var n=new P(this,!0);return t=C(n),n.detach(),t},canSurroundContents:function(){Z(this),Y(this.startContainer),Y(this.endContainer);var t=new P(this,!0),e=t._first&&m(t._first,this)||t._last&&m(t._last,this);return t.detach(),!e},surroundContents:function(t){if(G(t,L),!this.canSurroundContents())throw new i("INVALID_STATE_ERR");var e=this.extractContents();if(t.hasChildNodes())for(;t.lastChild;)t.removeChild(t.lastChild);w(t,this.startContainer,this.startOffset),t.appendChild(e),this.selectNode(t)},cloneRange:function(){Z(this);for(var t,e=new yt(b(this)),n=nt.length;n--;)e[t=nt[n]]=this[t];return e},toString:function(){Z(this);var t=this.startContainer;if(t===this.endContainer&&a(t))return 3==t.nodeType||4==t.nodeType?t.data.slice(this.startOffset,this.endOffset):"";var e=[],n=new P(this,!0);return M(n,(function(t){3!=t.nodeType&&4!=t.nodeType||e.push(t.data)})),n.detach(),e.join("")},compareNode:function(t){Z(this);var e=t.parentNode,n=s(t);if(!e)throw new i("NOT_FOUND_ERR");var o=this.comparePoint(e,n),r=this.comparePoint(e,n+1);return o<0?r>0?ut:st:r>0?lt:ct},comparePoint:function(t,e){return Z(this),V(t,"HIERARCHY_REQUEST_ERR"),U(t,this.startContainer),c(t,e,this.startContainer,this.startOffset)<0?-1:c(t,e,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:Q,toHtml:function(){return et(this)},intersectsNode:function(t,e){if(Z(this),g(t)!=_(this))return!1;var n=t.parentNode,o=s(t);if(!n)return!0;var r=c(n,o,this.endContainer,this.endOffset),i=c(n,o+1,this.startContainer,this.startOffset);return e?r<=0&&i>=0:r<0&&i>0},isPointInRange:function(t,e){return Z(this),V(t,"HIERARCHY_REQUEST_ERR"),U(t,this.startContainer),c(t,e,this.startContainer,this.startOffset)>=0&&c(t,e,this.endContainer,this.endOffset)<=0},intersectsRange:function(t){return S(this,t,!1)},intersectsOrTouchesRange:function(t){return S(this,t,!0)},intersection:function(t){if(this.intersectsRange(t)){var e=c(this.startContainer,this.startOffset,t.startContainer,t.startOffset),n=c(this.endContainer,this.endOffset,t.endContainer,t.endOffset),o=this.cloneRange();return-1==e&&o.setStart(t.startContainer,t.startOffset),1==n&&o.setEnd(t.endContainer,t.endOffset),o}return null},union:function(t){if(this.intersectsOrTouchesRange(t)){var e=this.cloneRange();return-1==c(t.startContainer,t.startOffset,this.startContainer,this.startOffset)&&e.setStart(t.startContainer,t.startOffset),1==c(t.endContainer,t.endOffset,this.endContainer,this.endOffset)&&e.setEnd(t.endContainer,t.endOffset),e}throw new i("Ranges do not intersect")},containsNode:function(t,e){return e?this.intersectsNode(t,!1):this.compareNode(t)==ct},containsNodeContents:function(t){return this.comparePoint(t,0)>=0&&this.comparePoint(t,h(t))<=0},containsRange:function(t){var e=this.intersection(t);return null!==e&&t.equals(e)},containsNodeText:function(t){var e=this.cloneRange();e.selectNode(t);var n=e.getNodes([3]);if(n.length>0){e.setStart(n[0],0);var o=n.pop();return e.setEnd(o,o.length),this.containsRange(e)}return this.containsNodeContents(t)},getNodes:function(t,e){return Z(this),N(this,t,e)},getDocument:function(){return b(this)},collapseBefore:function(t){this.setEndBefore(t),this.collapse(!1)},collapseAfter:function(t){this.setStartAfter(t),this.collapse(!0)},getBookmark:function(e){var o=b(this),r=t.createRange(o);e=e||n.getBody(o),r.selectNodeContents(e);var i=this.intersection(r),a=0,s=0;return i&&(r.setEnd(i.startContainer,i.startOffset),s=(a=r.toString().length)+i.toString().length),{start:a,end:s,containerNode:e}},moveToBookmark:function(t){var e=t.containerNode,n=0;this.setStart(e,0),this.collapse(!0);for(var o,r,i,a,s=[e],l=!1,u=!1;!u&&(o=s.pop());)if(3==o.nodeType)r=n+o.length,!l&&t.start>=n&&t.start<=r&&(this.setStart(o,t.start-n),l=!0),l&&t.end>=n&&t.end<=r&&(this.setEnd(o,t.end-n),u=!0),n=r;else for(i=(a=o.childNodes).length;i--;)s.push(a[i])},getName:function(){return"DomRange"},equals:function(t){return yt.rangesEqual(this,t)},isValid:function(){return q(this)},inspect:function(){return A(this)},detach:function(){}}),ft(yt,vt),o.extend(yt,{rangeProperties:nt,RangeIterator:P,copyComparisonConstants:pt,createPrototypeRange:ft,inspect:A,toHtml:et,getRangeDocument:b,rangesEqual:function(t,e){return t.startContainer===e.startContainer&&t.startOffset===e.startOffset&&t.endContainer===e.endContainer&&t.endOffset===e.endOffset}}),t.DomRange=yt})),E.createCoreModule("WrappedRange",["DomRange"],(function(t,e){var n,o,r=t.dom,i=t.util,a=r.DomPosition,s=t.DomRange,l=r.getBody,u=r.getContentDocument,c=r.isCharacterDataNode;if(t.features.implementsDomRange&&function(){var o,a,c=s.rangeProperties;function d(t){for(var e,n=c.length;n--;)t[e=c[n]]=t.nativeRange[e];t.collapsed=t.startContainer===t.endContainer&&t.startOffset===t.endOffset}function p(t,e,n,o,r){var i=t.startContainer!==e||t.startOffset!=n,a=t.endContainer!==o||t.endOffset!=r,s=!t.equals(t.nativeRange);(i||a||s)&&(t.setEnd(o,r),t.setStart(e,n))}n=function(t){if(!t)throw e.createError("WrappedRange: Range must be specified");this.nativeRange=t,d(this)},s.createPrototypeRange(n,p),(o=n.prototype).selectNode=function(t){this.nativeRange.selectNode(t),d(this)},o.cloneContents=function(){return this.nativeRange.cloneContents()},o.surroundContents=function(t){this.nativeRange.surroundContents(t),d(this)},o.collapse=function(t){this.nativeRange.collapse(t),d(this)},o.cloneRange=function(){return new n(this.nativeRange.cloneRange())},o.refresh=function(){d(this)},o.toString=function(){return this.nativeRange.toString()};var h=document.createTextNode("test");l(document).appendChild(h);var f=document.createRange();f.setStart(h,0),f.setEnd(h,0);try{f.setStart(h,1),o.setStart=function(t,e){this.nativeRange.setStart(t,e),d(this)},o.setEnd=function(t,e){this.nativeRange.setEnd(t,e),d(this)},a=function(t){return function(e){this.nativeRange[t](e),d(this)}}}catch(t){o.setStart=function(t,e){try{this.nativeRange.setStart(t,e)}catch(n){this.nativeRange.setEnd(t,e),this.nativeRange.setStart(t,e)}d(this)},o.setEnd=function(t,e){try{this.nativeRange.setEnd(t,e)}catch(n){this.nativeRange.setStart(t,e),this.nativeRange.setEnd(t,e)}d(this)},a=function(t,e){return function(n){try{this.nativeRange[t](n)}catch(o){this.nativeRange[e](n),this.nativeRange[t](n)}d(this)}}}o.setStartBefore=a("setStartBefore","setEndBefore"),o.setStartAfter=a("setStartAfter","setEndAfter"),o.setEndBefore=a("setEndBefore","setStartBefore"),o.setEndAfter=a("setEndAfter","setStartAfter"),o.selectNodeContents=function(t){this.setStartAndEnd(t,0,r.getNodeLength(t))},f.selectNodeContents(h),f.setEnd(h,3);var g=document.createRange();g.selectNodeContents(h),g.setEnd(h,4),g.setStart(h,2),-1==f.compareBoundaryPoints(f.START_TO_END,g)&&1==f.compareBoundaryPoints(f.END_TO_START,g)?o.compareBoundaryPoints=function(t,e){return t==(e=e.nativeRange||e).START_TO_END?t=e.END_TO_START:t==e.END_TO_START&&(t=e.START_TO_END),this.nativeRange.compareBoundaryPoints(t,e)}:o.compareBoundaryPoints=function(t,e){return this.nativeRange.compareBoundaryPoints(t,e.nativeRange||e)};var v=document.createElement("div");v.innerHTML="123";var y=v.firstChild,m=l(document);m.appendChild(v),f.setStart(y,1),f.setEnd(y,2),f.deleteContents(),"13"==y.data&&(o.deleteContents=function(){this.nativeRange.deleteContents(),d(this)},o.extractContents=function(){var t=this.nativeRange.extractContents();return d(this),t}),m.removeChild(v),m=null,i.isHostMethod(f,"createContextualFragment")&&(o.createContextualFragment=function(t){return this.nativeRange.createContextualFragment(t)}),l(document).removeChild(h),o.getName=function(){return"WrappedRange"},t.WrappedRange=n,t.createNativeRange=function(t){return(t=u(t,e,"createNativeRange")).createRange()}}(),t.features.implementsTextRange){var d=function(t){var e=t.parentElement(),n=t.duplicate();n.collapse(!0);var o=n.parentElement();(n=t.duplicate()).collapse(!1);var i=n.parentElement(),a=o==i?o:r.getCommonAncestor(o,i);return a==e?a:r.getCommonAncestor(e,a)},p=function(t){return 0==t.compareEndPoints("StartToEnd",t)},h=function(t,e,n,o,i){var s=t.duplicate();s.collapse(n);var l=s.parentElement();if(r.isOrIsAncestorOf(e,l)||(l=e),!l.canHaveHTML){var u=new a(l.parentNode,r.getNodeIndex(l));return{boundaryPosition:u,nodeInfo:{nodeIndex:u.offset,containerElement:u.node}}}var d=r.getDocument(l).createElement("span");d.parentNode&&r.removeNode(d);for(var p,h,f,g,v,y=n?"StartToStart":"StartToEnd",m=i&&i.containerElement==l?i.nodeIndex:0,b=l.childNodes.length,_=b,x=_;x==b?l.appendChild(d):l.insertBefore(d,l.childNodes[x]),s.moveToElementText(d),0!=(p=s.compareEndPoints(y,t))&&m!=_;){if(-1==p){if(_==m+1)break;m=x}else _=_==m+1?m:x;x=Math.floor((m+_)/2),l.removeChild(d)}if(v=d.nextSibling,-1==p&&v&&c(v)){var E;if(s.setEndPoint(n?"EndToStart":"EndToEnd",t),/[\r\n]/.test(v.data)){var w=s.duplicate(),S=w.text.replace(/\r\n/g,"\r").length;for(E=w.moveStart("character",S);-1==(p=w.compareEndPoints("StartToEnd",w));)E++,w.moveStart("character",1)}else E=s.text.length;g=new a(v,E)}else h=(o||!n)&&d.previousSibling,g=(f=(o||n)&&d.nextSibling)&&c(f)?new a(f,0):h&&c(h)?new a(h,h.data.length):new a(l,r.getNodeIndex(d));return r.removeNode(d),{boundaryPosition:g,nodeInfo:{nodeIndex:x,containerElement:l}}},f=function(t,e){var n,o,i,a,s=t.offset,u=r.getDocument(t.node),d=l(u).createTextRange(),p=c(t.node);return p?o=(n=t.node).parentNode:(n=s<(a=t.node.childNodes).length?a[s]:null,o=t.node),(i=u.createElement("span")).innerHTML="&#feff;",n?o.insertBefore(i,n):o.appendChild(i),d.moveToElementText(i),d.collapse(!e),o.removeChild(i),p&&d[e?"moveStart":"moveEnd"]("character",s),d};(o=function(t){this.textRange=t,this.refresh()}).prototype=new s(document),o.prototype.refresh=function(){var t,e,n,o=d(this.textRange);p(this.textRange)?e=t=h(this.textRange,o,!0,!0).boundaryPosition:(t=(n=h(this.textRange,o,!0,!1)).boundaryPosition,e=h(this.textRange,o,!1,!1,n.nodeInfo).boundaryPosition),this.setStart(t.node,t.offset),this.setEnd(e.node,e.offset)},o.prototype.getName=function(){return"WrappedTextRange"},s.copyComparisonConstants(o);var g=function(t){if(t.collapsed)return f(new a(t.startContainer,t.startOffset),!0);var e=f(new a(t.startContainer,t.startOffset),!0),n=f(new a(t.endContainer,t.endOffset),!1),o=l(s.getRangeDocument(t)).createTextRange();return o.setEndPoint("StartToStart",e),o.setEndPoint("EndToEnd",n),o};if(o.rangeToTextRange=g,o.prototype.toTextRange=function(){return g(this)},t.WrappedTextRange=o,!t.features.implementsDomRange||t.config.preferTextRange){var v=Function("return this;")();void 0===v.Range&&(v.Range=o),t.createNativeRange=function(t){return t=u(t,e,"createNativeRange"),l(t).createTextRange()},t.WrappedRange=o}}t.createRange=function(n){return n=u(n,e,"createRange"),new t.WrappedRange(t.createNativeRange(n))},t.createRangyRange=function(t){return t=u(t,e,"createRangyRange"),new s(t)},i.createAliasForDeprecatedMethod(t,"createIframeRange","createRange"),i.createAliasForDeprecatedMethod(t,"createIframeRangyRange","createRangyRange"),t.addShimListener((function(e){var n=e.document;void 0===n.createRange&&(n.createRange=function(){return t.createRange(n)}),n=e=null}))})),E.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],(function(t,e){t.config.checkSelectionRanges=!0;var n,o,r="boolean",i="number",a=t.dom,s=t.util,l=s.isHostMethod,u=t.DomRange,c=t.WrappedRange,d=t.DOMException,p=a.DomPosition,h=t.features,f="Control",g=a.getDocument,v=a.getBody,y=u.rangesEqual;function m(t){return"string"==typeof t?/^backward(s)?$/i.test(t):!!t}function b(t,n){if(t){if(a.isWindow(t))return t;if(t instanceof Z)return t.win;var o=a.getContentDocument(t,e,n);return a.getWindow(o)}return window}function _(t){return b(t,"getWinSelection").getSelection()}function x(t){return b(t,"getDocSelection").document.selection}function E(t){var e=!1;return t.anchorNode&&(e=1==a.comparePoints(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset)),e}var w=l(window,"getSelection"),S=s.isHostObject(document,"selection");h.implementsWinGetSelection=w,h.implementsDocSelection=S;var C=S&&(!w||t.config.preferTextRange);if(C)n=x,t.isSelectionValid=function(t){var e=b(t,"isSelectionValid").document,n=e.selection;return"None"!=n.type||g(n.createRange().parentElement())==e};else{if(!w)return e.fail("Neither document.selection or window.getSelection() detected."),!1;n=_,t.isSelectionValid=function(){return!0}}t.getNativeSelection=n;var M=n();if(!M)return e.fail("Native selection was null (possibly issue 138?)"),!1;var O=t.createNativeRange(document),T=v(document),N=s.areHostProperties(M,["anchorNode","focusNode","anchorOffset","focusOffset"]);h.selectionHasAnchorAndFocus=N;var A=l(M,"extend");h.selectionHasExtend=A;var P=l(M,"setBaseAndExtent");h.selectionHasSetBaseAndExtent=P;var D=typeof M.rangeCount==i;h.selectionHasRangeCount=D;var k=!1,R=!0,I=A?function(e,n){var o=u.getRangeDocument(n),r=t.createRange(o);r.collapseToPoint(n.endContainer,n.endOffset),e.addRange(G(r)),e.extend(n.startContainer,n.startOffset)}:null;s.areHostMethods(M,["addRange","getRangeAt","removeAllRanges"])&&typeof M.rangeCount==i&&h.implementsDomRange&&function(){var e=window.getSelection();if(e){for(var n=e.rangeCount,o=n>1,r=[],i=E(e),s=0;s<n;++s)r[s]=e.getRangeAt(s);var l=a.createTestElement(document,"",!1),u=l.appendChild(document.createTextNode(" ")),c=document.createRange();if(c.setStart(u,1),c.collapse(!0),e.removeAllRanges(),e.addRange(c),R=1==e.rangeCount,e.removeAllRanges(),!o){var d=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(d&&parseInt(d[1])>=36)k=!1;else{var p=c.cloneRange();c.setStart(u,0),p.setEnd(u,3),p.setStart(u,2),e.addRange(c),e.addRange(p),k=2==e.rangeCount}}for(a.removeNode(l),e.removeAllRanges(),s=0;s<n;++s)0==s&&i?I?I(e,r[s]):(t.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),e.addRange(r[s])):e.addRange(r[s])}}(),h.selectionSupportsMultipleRanges=k,h.collapsedNonEditableSelectionsSupported=R;var L,j,B=!1;function H(t,e,n){var o=n?"end":"start",r=n?"start":"end";t.anchorNode=e[o+"Container"],t.anchorOffset=e[o+"Offset"],t.focusNode=e[r+"Container"],t.focusOffset=e[r+"Offset"]}function z(t){var e=t.nativeSelection;t.anchorNode=e.anchorNode,t.anchorOffset=e.anchorOffset,t.focusNode=e.focusNode,t.focusOffset=e.focusOffset}function F(t){t.anchorNode=t.focusNode=null,t.anchorOffset=t.focusOffset=0,t.rangeCount=0,t.isCollapsed=!0,t._ranges.length=0,W(t)}function W(t){t.type=0==t.rangeCount?"None":o(t)?"Caret":"Range"}function G(e){var n;return e instanceof u?((n=t.createNativeRange(e.getDocument())).setEnd(e.endContainer,e.endOffset),n.setStart(e.startContainer,e.startOffset)):e instanceof c?n=e.nativeRange:h.implementsDomRange&&e instanceof a.getWindow(e.startContainer).Range&&(n=e),n}function X(t){if(!t.length||1!=t[0].nodeType)return!1;for(var e=1,n=t.length;e<n;++e)if(!a.isAncestorOf(t[0],t[e]))return!1;return!0}function U(t){var n=t.getNodes();if(!X(n))throw e.createError("getSingleElementFromRange: range "+t.inspect()+" did not consist of a single element");return n[0]}function Y(t){return!!t&&void 0!==t.text}function V(t,e){var n=new c(e);t._ranges=[n],H(t,n,!1),t.rangeCount=1,t.isCollapsed=n.collapsed,W(t)}function K(e){if(e._ranges.length=0,"None"==e.docSelection.type)F(e);else{var n=e.docSelection.createRange();if(Y(n))V(e,n);else{e.rangeCount=n.length;for(var o,r=g(n.item(0)),i=0;i<e.rangeCount;++i)(o=t.createRange(r)).selectNode(n.item(i)),e._ranges.push(o);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,H(e,e._ranges[e.rangeCount-1],!1),W(e)}}}function q(t,n){for(var o=t.docSelection.createRange(),r=U(n),i=g(o.item(0)),a=v(i).createControlRange(),s=0,l=o.length;s<l;++s)a.add(o.item(s));try{a.add(r)}catch(t){throw e.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),K(t)}function Z(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function $(t){t.win=t.anchorNode=t.focusNode=t._ranges=null,t.rangeCount=t.anchorOffset=t.focusOffset=0,t.detached=!0,W(t)}T&&l(T,"createControlRange")&&(L=T.createControlRange(),s.areHostProperties(L,["item","add"])&&(B=!0)),h.implementsControlRange=B,o=N?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return!!t.rangeCount&&t.getRangeAt(t.rangeCount-1).collapsed},l(M,"getRangeAt")?j=function(t,e){try{return t.getRangeAt(e)}catch(t){return null}}:N&&(j=function(e){var n=g(e.anchorNode),o=t.createRange(n);return o.setStartAndEnd(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset),o.collapsed!==this.isCollapsed&&o.setStartAndEnd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset),o}),Z.prototype=t.selectionPrototype;var J=[];function Q(t,e){for(var n,o,r=J.length;r--;)if(o=(n=J[r]).selection,"deleteAll"==e)$(o);else if(n.win==t)return"delete"==e?(J.splice(r,1),!0):o;return"deleteAll"==e&&(J.length=0),null}var tt=function(t){if(t&&t instanceof Z)return t.refresh(),t;var e=Q(t=b(t,"getNativeSelection")),o=n(t),r=S?x(t):null;return e?(e.nativeSelection=o,e.docSelection=r,e.refresh()):(e=new Z(o,r,t),J.push({win:t,selection:e})),e};t.getSelection=tt,s.createAliasForDeprecatedMethod(t,"getIframeSelection","getSelection");var et,nt=Z.prototype;function ot(t,n){for(var o,r=g(n[0].startContainer),i=v(r).createControlRange(),a=0,s=n.length;a<s;++a){o=U(n[a]);try{i.add(o)}catch(t){throw e.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}i.select(),K(t)}if(!C&&N&&s.areHostMethods(M,["removeAllRanges","addRange"])){nt.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),F(this)};var rt=function(t,e){I(t.nativeSelection,e),t.refresh()};nt.addRange=D?function(e,n){if(B&&S&&this.docSelection.type==f)q(this,e);else if(m(n)&&A)rt(this,e);else{var r;k?r=this.rangeCount:(this.removeAllRanges(),r=0);var i=G(e).cloneRange();try{this.nativeSelection.addRange(i)}catch(t){}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==r+1){if(t.config.checkSelectionRanges){var a=j(this.nativeSelection,this.rangeCount-1);a&&!y(a,e)&&(e=new c(a))}this._ranges[this.rangeCount-1]=e,H(this,e,it(this.nativeSelection)),this.isCollapsed=o(this),W(this)}else this.refresh()}}:function(t,e){m(e)&&A?rt(this,t):(this.nativeSelection.addRange(G(t)),this.refresh())},nt.setRanges=function(t){if(B&&S&&t.length>1)ot(this,t);else{this.removeAllRanges();for(var e=0,n=t.length;e<n;++e)this.addRange(t[e])}}}else{if(!(l(M,"empty")&&l(O,"select")&&B&&C))return e.fail("No means of selecting a Range or TextRange was found"),!1;nt.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var t;if(this.anchorNode)t=g(this.anchorNode);else if(this.docSelection.type==f){var e=this.docSelection.createRange();e.length&&(t=g(e.item(0)))}t&&(v(t).createTextRange().select(),this.docSelection.empty())}}catch(t){}F(this)},nt.addRange=function(e){this.docSelection.type==f?q(this,e):(t.WrappedTextRange.rangeToTextRange(e).select(),this._ranges[0]=e,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,H(this,e,!1),W(this))},nt.setRanges=function(t){this.removeAllRanges();var e=t.length;e>1?ot(this,t):e&&this.addRange(t[0])}}if(nt.getRangeAt=function(t){if(t<0||t>=this.rangeCount)throw new d("INDEX_SIZE_ERR");return this._ranges[t].cloneRange()},C)et=function(e){var n;t.isSelectionValid(e.win)?n=e.docSelection.createRange():(n=v(e.win.document).createTextRange()).collapse(!0),e.docSelection.type==f?K(e):Y(n)?V(e,n):F(e)};else if(l(M,"getRangeAt")&&typeof M.rangeCount==i)et=function(e){if(B&&S&&e.docSelection.type==f)K(e);else if(e._ranges.length=e.rangeCount=e.nativeSelection.rangeCount,e.rangeCount){for(var n=0,r=e.rangeCount;n<r;++n)e._ranges[n]=new t.WrappedRange(e.nativeSelection.getRangeAt(n));H(e,e._ranges[e.rangeCount-1],it(e.nativeSelection)),e.isCollapsed=o(e),W(e)}else F(e)};else{if(!N||typeof M.isCollapsed!=r||typeof O.collapsed!=r||!h.implementsDomRange)return e.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;et=function(t){var e,n=t.nativeSelection;n.anchorNode?(e=j(n,0),t._ranges=[e],t.rangeCount=1,z(t),t.isCollapsed=o(t),W(t)):F(t)}}nt.refresh=function(t){var e=t?this._ranges.slice(0):null,n=this.anchorNode,o=this.anchorOffset;if(et(this),t){var r=e.length;if(r!=this._ranges.length)return!0;if(this.anchorNode!=n||this.anchorOffset!=o)return!0;for(;r--;)if(!y(e[r],this._ranges[r]))return!0;return!1}};var it,at=function(t,e){var n=t.getAllRanges();t.removeAllRanges();for(var o=0,r=n.length;o<r;++o)y(e,n[o])||t.addRange(n[o]);t.rangeCount||F(t)};function st(t,e){if(t.win.document!=g(e))throw new d("WRONG_DOCUMENT_ERR")}function lt(t,e){if(e<0||e>(a.isCharacterDataNode(t)?t.length:t.childNodes.length))throw new d("INDEX_SIZE_ERR")}function ut(e){return function(n,o){var r;this.rangeCount?(r=this.getRangeAt(0))["set"+(e?"Start":"End")](n,o):(r=t.createRange(this.win.document)).setStartAndEnd(n,o),this.setSingleRange(r,this.isBackward())}}function ct(t){var e=[],n=new p(t.anchorNode,t.anchorOffset),o=new p(t.focusNode,t.focusOffset),r="function"==typeof t.getName?t.getName():"Selection";if(void 0!==t.rangeCount)for(var i=0,a=t.rangeCount;i<a;++i)e[i]=u.inspect(t.getRangeAt(i));return"["+r+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+o.inspect()+"]"}nt.removeRange=B&&S?function(t){if(this.docSelection.type==f){for(var e=this.docSelection.createRange(),n=U(t),o=g(e.item(0)),r=v(o).createControlRange(),i=!1,a=0,s=e.length;a<s;++a)e.item(a)!==n||i?r.add(e.item(a)):i=!0;r.select(),K(this)}else at(this,t)}:function(t){at(this,t)},!C&&N&&h.implementsDomRange?(it=E,nt.isBackward=function(){return it(this)}):it=nt.isBackward=function(){return!1},nt.isBackwards=nt.isBackward,nt.toString=function(){for(var t=[],e=0,n=this.rangeCount;e<n;++e)t[e]=""+this._ranges[e];return t.join("")},nt.collapse=function(e,n){st(this,e);var o=t.createRange(e);o.collapseToPoint(e,n),this.setSingleRange(o),this.isCollapsed=!0},nt.collapseToStart=function(){if(!this.rangeCount)throw new d("INVALID_STATE_ERR");var t=this._ranges[0];this.collapse(t.startContainer,t.startOffset)},nt.collapseToEnd=function(){if(!this.rangeCount)throw new d("INVALID_STATE_ERR");var t=this._ranges[this.rangeCount-1];this.collapse(t.endContainer,t.endOffset)},nt.selectAllChildren=function(e){st(this,e);var n=t.createRange(e);n.selectNodeContents(e),this.setSingleRange(n)},P?nt.setBaseAndExtent=function(t,e,n,o){this.nativeSelection.setBaseAndExtent(t,e,n,o),this.refresh()}:A&&(nt.setBaseAndExtent=function(e,n,o,r){lt(e,n),lt(o,r),st(this,e),st(this,o);var i=t.createRange(node),s=-1==a.comparePoints(e,n,o,r);s?i.setStartAndEnd(o,r,e,n):i.setStartAndEnd(e,n,o,r),this.setSingleRange(i,s)}),nt.deleteFromDocument=function(){if(B&&S&&this.docSelection.type==f){for(var t,e=this.docSelection.createRange();e.length;)t=e.item(0),e.remove(t),a.removeNode(t);this.refresh()}else if(this.rangeCount){var n=this.getAllRanges();if(n.length){this.removeAllRanges();for(var o=0,r=n.length;o<r;++o)n[o].deleteContents();this.addRange(n[r-1])}}},nt.eachRange=function(t,e){for(var n=0,o=this._ranges.length;n<o;++n)if(t(this.getRangeAt(n)))return e},nt.getAllRanges=function(){var t=[];return this.eachRange((function(e){t.push(e)})),t},nt.setSingleRange=function(t,e){this.removeAllRanges(),this.addRange(t,e)},nt.callMethodOnEachRange=function(t,e){var n=[];return this.eachRange((function(o){n.push(o[t].apply(o,e||[]))})),n},nt.setStart=ut(!0),nt.setEnd=ut(!1),t.rangePrototype.select=function(t){tt(this.getDocument()).setSingleRange(this,t)},nt.changeEachRange=function(t){var e=[],n=this.isBackward();this.eachRange((function(n){t(n),e.push(n)})),this.removeAllRanges(),n&&1==e.length?this.addRange(e[0],"backward"):this.setRanges(e)},nt.containsNode=function(t,e){return this.eachRange((function(n){return n.containsNode(t,e)}),!0)||!1},nt.getBookmark=function(t){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[t])}},nt.moveToBookmark=function(e){for(var n,o,r=[],i=0;n=e.rangeBookmarks[i++];)(o=t.createRange(this.win)).moveToBookmark(n),r.push(o);e.backward?this.setSingleRange(r[0],"backward"):this.setRanges(r)},nt.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},nt.restoreRanges=function(t){this.removeAllRanges();for(var e,n=0;e=t.ranges[n];++n)this.addRange(e,t.backward&&0==n)},nt.toHtml=function(){var t=[];return this.eachRange((function(e){t.push(u.toHtml(e))})),t.join("")},h.implementsTextRange&&(nt.getNativeTextRange=function(){var n;if(n=this.docSelection){var o=n.createRange();if(Y(o))return o;throw e.createError("getNativeTextRange: selection is a control selection")}if(this.rangeCount>0)return t.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw e.createError("getNativeTextRange: selection contains no range")}),nt.getName=function(){return"WrappedSelection"},nt.inspect=function(){return ct(this)},nt.detach=function(){Q(this.win,"delete"),$(this)},Z.detachAll=function(){Q(null,"deleteAll")},Z.inspect=ct,Z.isDirectionBackward=m,t.Selection=Z,t.selectionPrototype=nt,t.addShimListener((function(t){void 0===t.getSelection&&(t.getSelection=function(){return tt(t)}),t=null}))}));var B=!1,H=function(t){B||(B=!0,!E.initialized&&E.config.autoInitialize&&N())};return _&&("complete"==document.readyState?H():(s(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",H,!1),y(window,"load",H))),E}()}(PT);var DT=AT,kT={toolbar:{allowMultiParagraphSelection:!0,buttons:["bold","colorpicker","italic","underline","strikethrough","quote","justifyLeft","justifyCenter","justifyRight","justifyFull","superscript","subscript","orderedlist","unorderedlist","pre","removeFormat","outdent","indent","h2","h3"],standardizeSelectionStart:!1,updateOnEmptySelection:!1},placeholder:{text:"请输入内容",hideOnClick:!0},disableEditing:!0},RT=hT.extensions.button.extend({name:"colorpicker",tagNames:["mark"],contentDefault:"<b>Color</b>",aria:"Color Picker",action:"colorPicker",init:function(){var t=this;DT.init(),hT.extensions.button.prototype.init.call(this),this.colorPicker=new TT({parent:this.button,color:"#000",onDone:function(e){t.coloredText&&t.coloredText.isAppliedToSelection()&&t.coloredText.undoToSelection(),t.coloredText=DT.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:e.hex}},normalize:!0}),t.coloredText.toggleSelection(),t.base.checkContentChanged(),t.setInactive()}})},getButton:function(){return this.button},handleClick:function(){this.setActive(),this.colorPicker.show()},isAlreadyApplied:function(t){return"mark"===t.nodeName.toLowerCase()},isActive:function(){return this.button.classList.contains("medium-editor-button-active")},setInactive:function(){this.button.classList.remove("medium-editor-button-active")},setActive:function(){this.button.classList.add("medium-editor-button-active")}}),IT=function(t){function e(e){var n=t.call(this,e)||this;n.labelMap=new Map;var o=e.lf,r=e.graphModel;return n.lf=o,n.graphModel=r,n.state={tick:0},n}return h(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props.graphModel;this.editor=new hT(".lf-label-editor",ag(kT,{autoLink:!0,extensions:{colorPicker:new RT}})),e.eventCenter.on("text:update,node:mousemove,node:resize,node:rotate,node:drag,label:drop,node:drop",(function(){})),e.eventCenter.on("node:properties-change,node:properties-delete",(function(){t.setState({tick:t.state.tick+1})}))},e.prototype.componentDidUpdate=function(){var t;this.editor&&this.editor.elements.length>0?this.editor.addElements(".lf-label-editor"):(null===(t=this.editor)||void 0===t||t.destroy(),this.editor=new hT(".lf-label-editor",ag(kT,{autoLink:!0,extensions:{colorPicker:new RT}})))},e.prototype.componentWillUnmount=function(){var t;null===(t=this.editor)||void 0===t||t.destroy()},e.prototype.getLabels=function(){var t=this,e=this.props,n=e.lf.extension,o=e.graphModel,r=x(x([],_(o.nodes),!1),_(o.edges),!1);if(n.Label){var i=[];return oh(r,(function(e){var n,r;oh(null!==(r=null===(n=e.getData().properties)||void 0===n?void 0:n._label)&&void 0!==r?r:[],(function(n){var r=t.labelMap,a=new cT(n,e,o);r.set(a.id,a),i.push(xr(lT,{label:a,element:e,graphModel:o},a.id))}))})),i}return null},e.prototype.render=function(){return xr("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},e.toolName="label-edit-tool",e=v([yC],e)}(ho);var LT=function(){function t(t){var e,n,o,r=t.lf,i=t.options;this.labelInitPositionMap=new Map,this.lf=r,this.options=null!=i?i:{},this.textOverflowMode=null!==(e=i.textOverflowMode)&&void 0!==e?e:"default",this.isMultiple=null===(n=i.isMultiple)||void 0===n||n,this.labelWidth=i.labelWidth,this.maxCount=null!==(o=i.maxCount)&&void 0!==o?o:1/0,r.graphModel.editConfigModel.updateTextMode(Am.LABEL),this.addEventListeners(),r.tool.registerTool(IT.toolName,IT),r.tool.disableTool("text-edit-tool")}return t.prototype.formatConfig=function(t,e){var n=t.editConfigModel,o=n.nodeTextEdit,r=n.edgeTextEdit,i=n.nodeTextDraggable,a=n.edgeTextDraggable,s=this,l=s.textOverflowMode,u=s.isMultiple,c=s.maxCount,d=s.labelWidth,p=e.text,h=e.zIndex,g=e.properties,v=g._label,y=g._labelOption,m=v,b=void 0===y?{}:y,_=b.isMultiple,x=b.maxCount,E=[];if(Fr(m)){var w=null!=x?x:c;E=u&&_?m.length>w?m.slice(0,w):m:[m[0]]}else if(Jr(m))E=[m];else if("string"==typeof m||!m){var S=f(f({},p),{content:m||p.value,draggable:"edge"===e.BaseType?a:i});E=S.value?[S]:[]}return"edge"===e.BaseType&&(E=Ih(E,(function(t){var e=t.x,n=t.y;return console.log("x, y ---\x3e>>",e,n),t}))),Ih(E,(function(t){t.id||(t.id=g_());var n=t.value,s=t.content,u=t.vertical,c=t.editable,p=t.draggable,g=t.textOverflowMode,v="node"===e.BaseType?o:r,y="node"===e.BaseType?i:a;return f(f({},t),{zIndex:h,labelWidth:d,content:null!=s?s:n,vertical:null!=u&&u,editable:v&&c,draggable:y&&p,textOverflowMode:null!=g?g:l})}))},t.prototype.setupLabels=function(t){var e=this;oh(t.sortElements,(function(n){e.rewriteInnerMethods(n);var o=e.formatConfig(t,n);n.setProperty("_label",o)}))},t.prototype.addLabel=function(t,e){var n,o,r,i=this.maxCount,a=t.properties,s=null!==(n=a._label)&&void 0!==n?n:[],l=null!==(o=a._labelOption)&&void 0!==o?o:{},u=s.length,c={id:g_(),x:e.x,y:e.y,content:"Label".concat(u+1),value:"Label".concat(u+1),style:{},draggable:!0,editable:!0,vertical:!1};u>=(null!==(r=null==l?void 0:l.maxCount)&&void 0!==r?r:i)||(s.push(c),t.setProperty("_label",s))},t.prototype.addEventListeners=function(){var t=this,e=this.lf.graphModel,n=e.eventCenter,o=e.editConfigModel;n.on("graph:rendered",(function(e){var n=e.graphModel;t.setupLabels(n)})),n.on("node:dbclick,edge:dbclick",(function(n){var r=n.e,i=n.data,a=e.getElement(i.id),s=e.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,l={x:s.x,y:s.y};a&&o.textMode===Am.LABEL&&t.addLabel(a,l)})),n.on("node:resize",(function(t){var e,n,o=t.preData,r=t.data,i=t.model,a=null!==(e=o.properties)&&void 0!==e?e:{},s=a.width,l=a.height,u=a._label,c=void 0===u?[]:u,d=null!==(n=r.properties)&&void 0!==n?n:{},p=d.width,h=d.height;if(s&&l&&p&&h){var g={x:o.x,y:o.y,width:s,height:l},v={x:r.x,y:r.y,width:p,height:h},y=Ih(c,(function(t){var e,n,o,r,i,a,s,l,u,c,d,p=t.x,h=t.y,y=(n=v,o={x:p,y:h},r=(e=g).x,i=e.y,a=e.width,s=e.height,l=n.x,u=n.y,c=n.width,d=n.height,{x:l+(o.x-r)/a*c,y:u+(o.y-i)/s*d});return f(f({},t),y)}));i.setProperty("_label",y)}})),n.on("node:rotate",(function(e){var n=e.model,o=n.x,r=n.y,i=n.rotate,a=n.properties._label,s={x:o,y:r},l=Ih(void 0===a?[]:a,(function(e){if(!e.id)return e;var n={x:e.x,y:e.y};t.labelInitPositionMap.has(e.id)?n=t.labelInitPositionMap.get(e.id):t.labelInitPositionMap.set(e.id,n);var o=i*(180/Math.PI);o<0&&(o+=360);var r=o*(Math.PI/180),a=function(t,e,n){var o=e.x,r=e.y,i=t.x-o,a=t.y-r;return{x:i*Math.cos(n)-a*Math.sin(n)+o,y:i*Math.sin(n)+a*Math.cos(n)+r}}(n,s,r);return f(f(f({},e),a),{rotate:o})}));n.setProperty("_label",l)}))},t.prototype.rewriteInnerMethods=function(t){t.moveText=function(e,n){if(t.text){var o=t.text,r=o.x,i=o.y,a=o.value,s=o.draggable,l=o.editable;t.text={value:a,editable:l,draggable:s,x:r+e,y:i+n};var u=_d(t.getProperties());if(Fr(u._label)){var c=Ih(u._label,(function(t){return f(f({},t),{x:t.x+e,y:t.y+n})}));null==t||t.setProperty("_label",c)}}}},t.prototype.updateTextMode=function(t){var e=this.lf.graphModel.editConfigModel;t!==e.textMode&&(e.updateTextMode(t),t===Am.LABEL?(this.lf.tool.enableTool(IT.toolName),this.lf.tool.disableTool("text-edit-tool")):t===Am.TEXT&&(this.lf.tool.enableTool("text-edit-tool"),this.lf.tool.disableTool(IT.toolName)))},t.prototype.render=function(){},t.prototype.destroy=function(){},t.pluginName="Label",t}(),jT={};function BT(t){return t.startsWith("data:text/plain")}function HT(t){return y(this,void 0,void 0,(function(){return m(this,(function(e){return jT[t]?[2,jT[t]]:[2,new Promise((function(e,n){try{fetch(t).then((function(t){return t.blob()})).then((function(o){var r=new FileReader;r.onloadend=function(){e(jT[t]=r.result)},r.onerror=n,r.readAsDataURL(o)})).catch((function(){e(jT[t]=t)}))}catch(e){return jT[t]=t}}))]}))}))}function zT(t,e){return y(this,void 0,void 0,(function(){var n,o,r;return m(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),(n=t.getAttribute(e)||"").startsWith("data:")?[2]:[4,HT(n)];case 1:return BT(o=i.sent())?[2]:(t.setAttribute(e,o),[3,3]);case 2:return r=i.sent(),console.error(r),[3,3];case 3:return[2]}}))}))}function FT(t,e){return y(this,void 0,void 0,(function(){var n,o;return m(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e.startsWith("data:")?[2]:[4,HT(e)];case 1:return BT(n=r.sent())?[2]:(t.style.backgroundImage="url(".concat(n,")"),[3,3]);case 2:return o=r.sent(),console.error(o),[3,3];case 3:return[2]}}))}))}function WT(t){return y(this,void 0,void 0,(function(){var e,n,o,r,i,a,s,l,u;return m(this,(function(c){switch(c.label){case 0:for(e=[t],o=[];e.length;)(n=e.shift()).children.length&&e.push.apply(e,x([],_(n.children),!1)),n instanceof HTMLElement&&(r=n.style,i=r.background,a=r.backgroundImage,(s=i.match(/url\(["']?(.*?)["']?\)/))&&s[1]&&(u=s[1],o.push(FT(n,u))),(l=a.match(/url\(["']?(.*?)["']?\)/))&&l[1]&&(u=l[1],o.push(FT(n,u)))),n instanceof HTMLImageElement?o.push(zT(n,"src")):n instanceof SVGImageElement&&o.push(zT(n,"href"));return[4,Promise.all(o)];case 1:return c.sent(),[2]}}))}))}function GT(t,e,n){var o=document.createElement("canvas");o.width=e,o.height=n;var r=o.getContext("2d");return r&&r.drawImage(t,0,0,t.width,t.height,0,0,e,n),o}var XT=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.customCssRules="",this.useGlobalRules=!0,e.getSnapshot=function(t,e){return y(n,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshot(t,e)];case 1:return[2,n.sent()]}}))}))},e.getSnapshotBlob=function(t,e){return y(n,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshotBlob(t,e)];case 1:return[2,n.sent()]}}))}))},e.getSnapshotBase64=function(t,e){return y(n,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshotBase64(t,e)];case 1:return[2,n.sent()]}}))}))}}return t.prototype.getSvgRootElement=function(t){return t.container.querySelector(".lf-canvas-overlay")},t.prototype.triggerDownload=function(t){var e=new MouseEvent("click",{view:document.defaultView,bubbles:!1,cancelable:!0}),n=document.createElement("a");n.setAttribute("download",this.fileName),n.setAttribute("href",t),n.setAttribute("target","_blank"),n.dispatchEvent(e)},t.prototype.removeAnchor=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,o=0;o<n;o++){var r=e[o];(r.classList&&Array.from(r.classList)||[]).indexOf("lf-anchor")>-1&&(t.removeChild(t.childNodes[o]),n--,o--)}},t.prototype.removeRotateControl=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,o=0;o<n;o++){var r=e[o];(r.classList&&Array.from(r.classList)||[]).indexOf("lf-rotate-control")>-1&&(t.removeChild(t.childNodes[o]),n--,o--)}},t.prototype.getSnapshot=function(t,e){return y(this,void 0,void 0,(function(){var n,o,r,i,a=this;return m(this,(function(s){switch(s.label){case 0:return n=this.lf.graphModel.getPartial(),o=(null!=e?e:{}).partial,r=void 0===o?n:o,i=this.lf.getEditConfig(),this.lf.updateEditConfig({isSilentMode:!0,stopScrollGraph:!0,stopMoveGraph:!0}),n===r?[3,1]:(this.lf.graphModel.setPartial(r),this.lf.graphModel.eventCenter.once("graph:updated",(function(){return y(a,void 0,void 0,(function(){return m(this,(function(o){switch(o.label){case 0:return[4,this.snapshot(t,e)];case 1:return o.sent(),this.lf.graphModel.setPartial(n),[2]}}))}))})),[3,3]);case 1:return[4,this.snapshot(t,e)];case 2:s.sent(),s.label=3;case 3:return this.lf.updateEditConfig(i),[2]}}))}))},t.prototype.snapshot=function(t,e){return y(this,void 0,void 0,(function(){var n,o,r,i,a,s,l,u,c,d=this;return m(this,(function(p){switch(p.label){case 0:return o=(n=null!=e?e:{}).fileType,r=void 0===o?"png":o,i=n.quality,this.fileName="".concat(null!=t?t:"logic-flow.".concat(Date.now()),".").concat(r),[4,WT(a=this.getSvgRootElement(this.lf))];case 1:return p.sent(),"svg"===r?(s=this.cloneSvg(a),l=(new XMLSerializer).serializeToString(s),u=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),c=URL.createObjectURL(u),this.triggerDownload(c)):this.getCanvasData(a,null!=e?e:{}).then((function(t){var e=t.toDataURL("image/".concat(r),i).replace("image/".concat(r),"image/octet-stream");d.triggerDownload(e)})),[2]}}))}))},t.prototype.getSnapshotBase64=function(t,e){return y(this,void 0,void 0,(function(){var n,o=this;return m(this,(function(r){switch(r.label){case 0:return[4,WT(n=this.getSvgRootElement(this.lf))];case 1:return r.sent(),[2,new Promise((function(r){o.getCanvasData(n,{backgroundColor:t}).then((function(t){var n=t.toDataURL("image/".concat(null!=e?e:"png"));r({data:n,width:t.width,height:t.height})}))}))]}}))}))},t.prototype.getSnapshotBlob=function(t,e){return y(this,void 0,void 0,(function(){var n,o=this;return m(this,(function(r){switch(r.label){case 0:return[4,WT(n=this.getSvgRootElement(this.lf))];case 1:return r.sent(),[2,new Promise((function(r){o.getCanvasData(n,{backgroundColor:t}).then((function(t){t.toBlob((function(e){r({data:e,width:t.width,height:t.height})}),"image/".concat(null!=e?e:"png"))}))}))]}}))}))},t.prototype.getClassRules=function(){var t="";if(this.useGlobalRules)for(var e=document.styleSheets,n=0;n<e.length;n++){var o=e[n];try{for(var r=0;r<o.cssRules.length;r++)t+=o.cssRules[r].cssText}catch(t){console.log("CSS scripts from different sources have been filtered out")}}return this.customCssRules&&(t+=this.customCssRules),t},t.prototype.getCanvasData=function(t,e){return y(this,void 0,void 0,(function(){var n,o,r,i,a,s,l,u,c,d,p,h,f,g,v,y,b,_,x,E,w,S,C,M,O,T;return m(this,(function(m){return n=e.width,o=e.height,r=e.backgroundColor,i=e.padding,a=void 0===i?40:i,s=this.cloneSvg(t,!1),(l=window.devicePixelRatio||1)<1&&(l=1),u=this.lf.graphModel.rootEl.querySelector(".lf-base"),c=u.getBoundingClientRect(),d=this.lf.container.querySelector(".lf-canvas-overlay"),p=d.getBoundingClientRect(),h=c.x-p.x,f=c.y-p.y,g=this.lf.graphModel,v=g.transformModel,y=v.SCALE_X,b=v.SCALE_Y,_=v.TRANSLATE_X,x=v.TRANSLATE_Y,s.lastChild.style.transform="matrix(1, 0, 0, 1, ".concat((-h+_)*(1/y),", ").concat((-f+x)*(1/b),")"),E=Math.ceil(c.width/y),w=Math.ceil(c.height/b),(S=document.createElement("canvas")).style.width="".concat(E,"px"),S.style.height="".concat(w,"px"),S.width=E*l+2*a,S.height=w*l+2*a,(C=S.getContext("2d"))&&(C.clearRect(0,0,S.width,S.height),C.scale(l,l),r?(C.fillStyle=r,C.fillRect(0,0,S.width,S.height)):C.clearRect(0,0,S.width,S.height)),M=new Image,(O=document.createElement("style")).innerHTML=this.getClassRules(),(T=document.createElement("foreignObject")).appendChild(O),s.appendChild(T),[2,new Promise((function(t){M.onload=function(){var e=navigator.userAgent.indexOf("Firefox")>-1;try{e?createImageBitmap(M,{resizeWidth:n&&o?GT(S,n,o).width:S.width,resizeHeight:n&&o?GT(S,n,o).height:S.height}).then((function(e){null==C||C.drawImage(e,a/l,a/l),t(n&&o?GT(S,n,o):S)})):(null==C||C.drawImage(M,a/l,a/l),t(n&&o?GT(S,n,o):S))}catch(e){null==C||C.drawImage(M,a/l,a/l),t(n&&o?GT(S,n,o):S)}};var e="data:image/svg+xml;charset=utf-8,".concat((new XMLSerializer).serializeToString(s)).replace(/\n/g,"").replace(/\t/g,"").replace(/#/g,"%23");M.src=e}))]}))}))},t.prototype.cloneSvg=function(t,e){var n,o=this;void 0===e&&(e=!0);var r=t.cloneNode(!0),i=r.lastChild,a=null===(n=null==i?void 0:i.childNodes)||void 0===n?void 0:n.length;if(a)for(var s=0;s<a;s++){var l=null==i?void 0:i.childNodes[s],u=l.classList&&Array.from(l.classList);if(u&&u.indexOf("lf-base")<0)null==i||i.removeChild(i.childNodes[s]),a--,s--;else{var c=null==i?void 0:i.childNodes[s];c&&c.childNodes.forEach((function(t){var e=t;o.removeAnchor(e.firstChild),o.removeRotateControl(e.firstChild)}))}}if(e){var d=document.createElement("style");d.innerHTML=this.getClassRules();var p=document.createElement("foreignObject");p.appendChild(d),r.appendChild(p)}return r},t.pluginName="snapshot",t}(),UT=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.paths=[],e.getPathes=function(){if(!n.startNodeType)throw new Error("需要预先指定开始节点类型");return n.getPathes()},e.setRawPaths=function(t){n.setPathes(t)},e.getRawPathes=function(){return n.paths},e.setStartNodeType=function(t){n.startNodeType=t}}return t.prototype.setPathes=function(t){this.paths=t.map((function(t){return{routeId:t.routeId,name:t.name,elements:t.elements,type:t.type,similarElement:null,weight:0}}))},t.prototype.getPathes=function(){var t=this,e=this.lf.getGraphRawData(),n=new Map,o=[];e.nodes.forEach((function(e){n.set(e.id,{id:e.id,data:e,nextNodes:[]}),e.type===t.startNodeType&&o.push(e.id)})),e.edges.forEach((function(t){var e=n.get(t.sourceNodeId);null==e||e.nextNodes.push(t.targetNodeId)}));var r=[];return o.forEach((function(e){var o=n.get(e);o&&(r=r.concat(t.findPathElements(o,n,[])))})),this.getNewPathes(r)},t.prototype.findPathElements=function(t,e,n){void 0===n&&(n=[]);var o=x([],_(n),!1);if(o.push(t.id),0===t.nextNodes.length)return[o];for(var r=[],i=0;i<t.nextNodes.length;i++){var a=e.get(t.nextNodes[i]),s=void 0;if(a){var l=o.indexOf(a.id);s=-1!==l?[x(x([],_(o.slice(l)),!1),[a.id],!1)]:this.findPathElements(a,e,x([],_(o),!1)),r=r.concat(s)}}return r},t.prototype.getNewPathes=function(t){var e=this,n=[],o=new Set;t.forEach((function(t){var r=e.getNewId("path"),i=e.getNewId("路径"),a=e.isLoopPath(t),s=t.join(",");o.has(s)||(o.add(s),n.push({routeId:r,name:i,elements:t,type:a,weight:0,similarElement:""}))}));var r=JSON.parse(JSON.stringify(this.paths));return n.forEach((function(t){for(var n=0;n<r.length;n++){var o=r[n],i=e.similar2Path(x([],_(t.elements),!1),x([],_(o.elements),!1));i>t.weight&&o.weight<=i&&(t.weight=i,t.similarElement=o,i===o.weight&&o.similarElement?(o.similarElement.similarElement=null,o.similarElement.weight=0,o.similarElement=null,o.weight=0):(o.similarElement=t,o.weight=i))}})),n.forEach((function(t){t.similarElement&&t.similarElement.similarElement===t&&(t.routeId=t.similarElement.routeId,t.name=t.similarElement.name),delete t.similarElement,delete t.weight})),this.setPathes(n),n},t.prototype.similar2Path=function(t,e){var n=0,o=t.length+e.length;t.sort(),e.sort();for(var r=t.shift(),i=e.shift();void 0!==r&&void 0!==i;)r===i?(n++,r=t.shift(),i=e.shift()):r<i?r=t.shift():r>i&&(i=e.shift());return n/o*200},t.prototype.getNewId=function(t){return"".concat(t,"_").concat(_C())},t.prototype.isLoopPath=function(t){var e=t.length;return t.indexOf(t[e-1])!==e-1?1:0},t.pluginName="flowPath",t}(),YT=-1,VT=0,KT=1,qT=function(){function t(t){var e=t.lf,n=this;this.levelHeight=[],this.newNodeMap=new Map,this.lf=e,this.trunk=[],e.layout=function(t){var e=n.lf.getGraphRawData();n.lf.setStartNodeType(t);var o=n.lf.getPathes();return n.levelHeight=[],n.newNodeMap=new Map,n.layout(e,o)}}return t.prototype.layout=function(t,e){var n=this,o=[];e.forEach((function(t){var e=t.elements;e.length>o.length?o=e:e.length===o.length&&JSON.stringify(e)===JSON.stringify(n.trunk)&&(o=n.trunk)})),this.trunk=o;for(var r=this.formatData(t),i={nodes:[],edges:[]},a=o.length-1;a>=0;a--)this.setNodePosition(o[a],r,i,a,1);this.lf.graphModel.graphDataToModel(i)},t.prototype.setNodePosition=function(t,e,n,o,r){var i=this,a=e[t],s=a.text,l=a.type,u=a.next,c=a.properties,d=160*o+40,p=120*r,h={id:t,x:d,text:s,y:p,type:l,properties:c};return s&&"object"==typeof s&&(h.text=f(f({},s),{x:d+s.x,y:p+s.y})),this.newNodeMap.set(h.id,{x:h.x,y:h.y,type:l}),n.nodes.push(h),a.isFixed=!0,this.addLevelHeight(o,1),u&&u.length>0&&u.forEach((function(r){if(!e[r.nodeId].isFixed){var a=i.getLevelHeight(o+1);i.addLevelHeight(o,1),i.setNodePosition(r.nodeId,e,n,o+1,a+1)}n.edges.push(f({id:r.edgeId,type:r.edgeType,sourceNodeId:t,targetNodeId:r.nodeId,properties:r.properties,text:r.text},i.getEdgeDataPoints(t,r.nodeId)))})),h},t.prototype.getEdgeDataPoints=function(t,e){var n=this.newNodeMap.get(t),o=this.newNodeMap.get(e),r=this.getShape(t),i=r.width,a=r.height,s=this.getShape(e),l=s.width,u=s.height,c=this.getRelativePosition(n,o),d={x:n.x,y:n.y},p={x:o.x,y:o.y};switch(c){case VT:d.x=n.x+i/2,p.x=o.x-l/2;break;case YT:d.y=n.y+a/2,p.x=o.x-l/2;break;case KT:d.x=n.x+i/2,p.y=o.y+u/2}return{startPoint:d,endPoint:p}},t.prototype.getRelativePosition=function(t,e){var n=t.y,o=e.y;return n<o?-1:n===o?0:1},t.prototype.getShape=function(t){var e,n,o=this.lf.getNodeModelById(t);return{height:null!==(e=null==o?void 0:o.height)&&void 0!==e?e:0,width:null!==(n=null==o?void 0:o.width)&&void 0!==n?n:0}},t.prototype.formatData=function(t){var e=t.nodes.reduce((function(t,e){var n=e.type,o=e.properties,r=e.text,i=e.x,a=e.y;return r&&"object"==typeof r&&(r.x=r.x-i,r.y=r.y-a),t[e.id]={type:n,properties:o,text:r,prev:[],next:[]},t}),{});return t.edges.forEach((function(t){var n=t.sourceNodeId,o=t.targetNodeId,r=t.id,i=t.properties,a=t.text,s=a;"object"==typeof a&&(s=a.value),e[n].next.push({edgeId:r,nodeId:o,edgeType:t.type,properties:i,text:s}),e[o].prev.push({edgeId:r,nodeId:n,properties:i,text:s})})),e},t.prototype.addLevelHeight=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);var o=this.levelHeight[t];o||(o={positiveHeight:0,negativeHeight:0},this.levelHeight[t]=o),n?o.negativeHeight-=e:o.positiveHeight+=e},t.prototype.getLevelHeight=function(t,e){void 0===e&&(e=!1);var n=this.levelHeight[t];return n?e?n.negativeHeight:n.positiveHeight:0},t.pluginName="AutoLayout",t}(),ZT=function(){function t(t){var e=t.lf,n=this;this.controlItems=[{key:"zoom-out",iconClass:"lf-control-zoomOut",title:"缩小流程图",text:"缩小",onClick:function(){n.lf.zoom(!1)}},{key:"zoom-in",iconClass:"lf-control-zoomIn",title:"放大流程图",text:"放大",onClick:function(){n.lf.zoom(!0)}},{key:"reset",iconClass:"lf-control-fit",title:"恢复流程原有尺寸",text:"适应",onClick:function(){n.lf.resetZoom()}},{key:"undo",iconClass:"lf-control-undo",title:"回到上一步",text:"上一步",onClick:function(){n.lf.undo()}},{key:"redo",iconClass:"lf-control-redo",title:"移到下一步",text:"下一步",onClick:function(){n.lf.redo()}}],this.lf=e}return t.prototype.render=function(t,e){this.destroy();var n=this.getControlTool();this.toolEl=n,e.appendChild(n),this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.toolEl&&this.domContainer.contains(this.toolEl)&&this.domContainer.removeChild(this.toolEl)},t.prototype.addItem=function(t){this.controlItems.push(t)},t.prototype.removeItem=function(t){var e=this.controlItems.findIndex((function(e){return e.key===t}));return-1==e?null:this.controlItems.splice(e,1)[0]},t.prototype.getControlTool=function(){var t=this,e="lf-control-item",n="lf-control-item disabled",o=document.createElement("div"),r=[];return o.className="lf-control",this.controlItems.forEach((function(o){var i=document.createElement("div"),a=document.createElement("i"),s=document.createElement("span");switch(i.className=n,o.onClick&&(i.onclick=o.onClick.bind(null,t.lf)),o.onMouseEnter&&(i.onmouseenter=o.onMouseEnter.bind(null,t.lf)),o.onMouseLeave&&(i.onmouseleave=o.onMouseLeave.bind(null,t.lf)),a.className=o.iconClass,s.className="lf-control-text",s.title=o.title,s.innerText=o.text,i.append(a,s),o.text){case"上一步":t.lf.on("history:change",(function(t){var o=t.data.undoAble;i.className=o?e:n}));break;case"下一步":t.lf.on("history:change",(function(t){var o=t.data.redoAble;i.className=o?e:n}));break;default:i.className=e}r.push(i)})),o.append.apply(o,x([],_(r),!1)),o},t.pluginName="control",t}(),$T="lf:defaultNodeMenu",JT="lf:defaultEdgeMenu",QT="lf:defaultGraphMenu",tN="lf:defaultSelectionMenu",eN=function(){function t(t){var e=t.lf,n=this;this.__currentData=null,this.lf=e,e.options.isSilentMode||(this.__menuDOM=document.createElement("ul"),this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(t){n.setMenuConfig(t)},this.lf.addMenuConfig=function(t){n.addMenuConfig(t)},this.lf.setMenuByType=function(t){n.setMenuByType(t)})}return t.prototype.init=function(){var t,e,n,o,r=this,i=[{text:"删除",callback:function(t){r.lf.deleteNode(t.id)}},{text:"编辑文本",callback:function(t){r.lf.graphModel.editText(t.id)}},{text:"复制",callback:function(t){r.lf.cloneNode(t.id)}}];null===(t=this.menuTypeMap)||void 0===t||t.set($T,i);var a=[{text:"删除",callback:function(t){r.lf.deleteEdge(t.id)}},{text:"编辑文本",callback:function(t){r.lf.graphModel.editText(t.id)}}];null===(e=this.menuTypeMap)||void 0===e||e.set(JT,a),null===(n=this.menuTypeMap)||void 0===n||n.set(QT,[]);var s=[{text:"删除",callback:function(t){r.lf.clearSelectElements(),t.edges.forEach((function(t){return r.lf.deleteEdge(t.id)})),t.nodes.forEach((function(t){return r.lf.deleteNode(t.id)}))}}];null===(o=this.menuTypeMap)||void 0===o||o.set(tN,s)},t.prototype.render=function(t,e){var n=this;t.options.isSilentMode||(this.__container=e,this.__currentData=null,this.__menuDOM&&(this.__menuDOM.className="lf-menu",e.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",(function(t){t.stopPropagation();for(var e=t.target;-1===Array.from(e.classList).indexOf("lf-menu-item")&&-1===Array.from(e.classList).indexOf("lf-menu");)e=null==e?void 0:e.parentElement;Array.from(e.classList).indexOf("lf-menu-item")>-1?(e.onclickCallback(n.__currentData),n.__menuDOM&&(n.__menuDOM.style.display="none"),n.__currentData=null):console.warn("点击区域不在菜单项内,请检查代码!")}),!0)),this.lf.on("node:contextmenu",(function(t){var e,o,r=t.data,i=t.position,a=t.e,s=i.domOverlayPosition,l=s.x,u=s.y,c=r.id,d=n.lf.graphModel.getNodeModelById(c);if(d){var p=[],h=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(d.type);p=d&&d.menu&&Array.isArray(d.menu)?d.menu:h||(null===(o=n.menuTypeMap)||void 0===o?void 0:o.get($T)),n.__currentData=r,n.showMenu(l,u,p,{width:d.width,height:d.height,clientX:a.clientX,clientY:a.clientY})}})),this.lf.on("edge:contextmenu",(function(t){var e,o,r,i=t.data,a=t.position,s=t.e,l=a.domOverlayPosition,u=l.x,c=l.y,d=i.id,p=n.lf.graphModel.getEdgeModelById(d);if(p){var h=[],f=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(p.type);h=p&&p.menu&&Array.isArray(p.menu)?p.menu:f||(null!==(r=null===(o=n.menuTypeMap)||void 0===o?void 0:o.get(JT))&&void 0!==r?r:[]),n.__currentData=i,n.showMenu(u,c,h,{width:p.width,height:p.height,clientX:s.clientX,clientY:s.clientY})}})),this.lf.on("blank:contextmenu",(function(t){var e,o,r=t.position,i=null!==(o=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(QT))&&void 0!==o?o:[],a=r.domOverlayPosition,s=a.x,l=a.y;n.showMenu(s,l,i)})),this.lf.on("selection:contextmenu",(function(t){var e,o=t.data,r=t.position,i=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(tN),a=r.domOverlayPosition,s=a.x,l=a.y;n.__currentData=o,n.showMenu(s,l,i)})),this.lf.on("node:mousedown",(function(){n.__menuDOM.style.display="none"})),this.lf.on("edge:click",(function(){n.__menuDOM.style.display="none"})),this.lf.on("blank:click",(function(){n.__menuDOM.style.display="none"})))},t.prototype.destroy=function(){var t;this.__menuDOM&&(null===(t=null==this?void 0:this.__container)||void 0===t||t.removeChild(this.__menuDOM),this.__menuDOM=void 0)},t.prototype.showMenu=function(t,e,n,o){if(n&&n.length){var r=this.__menuDOM;if(r){if(r.innerHTML="",r.append.apply(r,x([],_(this.__getMenuDom(n)),!1)),!r.children.length)return;if(r.style.display="block",!o)return r.style.top="".concat(e,"px"),void(r.style.left="".concat(t,"px"));var i=o.width,a=o.height,s=o.clientX,l=o.clientY,u=this.lf.graphModel,c=r.offsetWidth,d=!0,p=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=p-s,f=u.rootEl.getBoundingClientRect(),g=f.left+f.width;g<p&&(h=g-s),h<c&&(d=!1),r.style.left="".concat(d?t:t-i,"px");var v=r.offsetHeight,y=!0,m=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,b=m-l,E=f.top+f.height;E<m&&(b=E-l),b<v&&(y=!1),r.style.top="".concat(y?e:e-a,"px")}}},t.prototype.setMenuByType=function(t){var e;t.type&&t.menu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(t.type,t.menu))},t.prototype.__getMenuDom=function(t){var e=[];return t&&t.length>0&&t.forEach((function(t){var n=document.createElement("li");if(t.className?n.className="lf-menu-item ".concat(t.className):n.className="lf-menu-item",!0===t.icon){var o=document.createElement("span");o.className="lf-menu-item-icon",n.appendChild(o)}var r=document.createElement("span");r.className="lf-menu-item-text",t.text&&(r.innerText=t.text),n.appendChild(r),n.onclickCallback=t.callback,e.push(n)})),e},t.prototype.setMenuConfig=function(t){var e,n,o;t&&(void 0!==t.nodeMenu&&(null===(e=this.menuTypeMap)||void 0===e||e.set($T,t.nodeMenu?t.nodeMenu:[])),void 0!==t.edgeMenu&&(null===(n=this.menuTypeMap)||void 0===n||n.set(JT,t.edgeMenu?t.edgeMenu:[])),void 0!==t.graphMenu&&(null===(o=this.menuTypeMap)||void 0===o||o.set(QT,t.graphMenu?t.graphMenu:[])))},t.prototype.addMenuConfig=function(t){var e,n,o,r,i,a,s,l,u;if(t){if(Array.isArray(t.nodeMenu)){var c=null!==(n=null===(e=this.menuTypeMap)||void 0===e?void 0:e.get($T))&&void 0!==n?n:[];null===(o=this.menuTypeMap)||void 0===o||o.set($T,c.concat(t.nodeMenu))}if(Array.isArray(t.edgeMenu)){c=null!==(i=null===(r=this.menuTypeMap)||void 0===r?void 0:r.get(JT))&&void 0!==i?i:[];null===(a=this.menuTypeMap)||void 0===a||a.set(JT,c.concat(t.edgeMenu))}if(Array.isArray(t.graphMenu)){c=null!==(l=null===(s=this.menuTypeMap)||void 0===s?void 0:s.get(QT))&&void 0!==l?l:[];null===(u=this.menuTypeMap)||void 0===u||u.set(QT,c.concat(t.graphMenu))}}},t.prototype.changeMenuItem=function(t,e){if("add"===t)this.addMenuConfig(e);else{if("reset"!==t)throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'");this.setMenuConfig(e)}},t.pluginName="menu",t}(),nN="menu-common",oN=function(){function t(t){var e=t.lf,n=this;this.menuTypeMap=new Map,this.listenDelete=function(){n.hideContextMenu()},this.lf=e,this.__menuDOM=document.createElement("div"),this.__menuDOM.className="lf-inner-context",this.menuTypeMap.set(nN,[]),this.lf.setContextMenuByType=function(t,e){n.setContextMenuByType(t,e)},this.lf.setContextMenuItems=function(t){n.setContextMenuItems(t)},this.lf.showContextMenu=function(t){n.showContextMenu(t)},this.lf.hideContextMenu=function(){n.hideContextMenu()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("node:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("edge:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("blank:click",(function(){n.hideContextMenu()}))},t.prototype.setContextMenuByType=function(t,e){this.menuTypeMap.set(t,e)},t.prototype.hideContextMenu=function(){this.__menuDOM.innerHTML="",this.__menuDOM.style.display="none",this.isShow&&this.container.removeChild(this.__menuDOM),this.lf.off("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!1},t.prototype.showContextMenu=function(t){t&&t.id?(this._activeData=t,this.createContextMenu()):console.warn("请检查传入的参数")},t.prototype.setContextMenuItems=function(t){this.menuTypeMap.set(nN,t)},t.prototype.getContextMenuPosition=function(){var t=this._activeData,e=this.lf.graphModel.getElement(t.id);if(e){var n,o;if("edge"===e.BaseType){n=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER;var r=e.getData();n=Math.max(r.startPoint.x,n),o=Math.min(r.startPoint.y,o),n=Math.max(r.endPoint.x,n),o=Math.min(r.endPoint.y,o),r.pointsList&&r.pointsList.forEach((function(t){n=Math.max(t.x,n),o=Math.min(t.y,o)}))}return"node"===e.BaseType&&(n=t.x+e.width/2,o=t.y-e.height/2),this.lf.graphModel.transformModel.CanvasPointToHtmlPoint([n,o])}},t.prototype.createContextMenu=function(){var t=this;if(!this.lf.options.isSilentMode){var e=x(x([],_(this.menuTypeMap.get(this._activeData.type)||[]),!1),_(this.menuTypeMap.get(nN)||[]),!1),n=document.createDocumentFragment();e.forEach((function(e){var o=document.createElement("div");o.className="lf-context-item";var r=document.createElement("img");r.src=e.icon,r.className="lf-context-img",e.className&&(o.className="".concat(o.className," ").concat(e.className)),r.addEventListener("click",(function(){t.hideContextMenu(),e.callback?e.callback(t._activeData):t.addNode({sourceId:t._activeData.id,x:t._activeData.x,y:t._activeData.y,properties:e.properties,type:e.type})})),o.appendChild(r),n.appendChild(o)})),this.__menuDOM.innerHTML="",this.__menuDOM.appendChild(n),this.showMenu()}},t.prototype.addNode=function(t,e){var n=void 0!==e;void 0===e&&(e=t.y);var o=this.lf.getNodeModelById(t.sourceId);if(o){var r=t.x-o.width+200,i=e-t.y/2-20,a=t.x+o.width+200,s=e+t.y/2+20;if(this.lf.getAreaElement([r,i],[a,s]).length)return e+=100,void this.addNode(t,e);if(t.type){var l=this.lf.addNode({type:t.type,x:t.x+200,y:e,properties:t.properties}),u=void 0,c=void 0;n&&(u={x:t.x,y:t.y+o.height/2},c={x:l.x-l.width/2,y:l.y}),this.lf.addEdge({sourceNodeId:t.sourceId,targetNodeId:l.id,startPoint:u,endPoint:c})}}},t.prototype.showMenu=function(){var t=this.getContextMenuPosition();if(t){var e=_(t,2),n=e[0],o=e[1];this.__menuDOM.style.display="flex",this.__menuDOM.style.top="".concat(o,"px"),this.__menuDOM.style.left="".concat(n+10,"px"),this.container.appendChild(this.__menuDOM),!this.isShow&&this.lf.on("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!0}},t.pluginName="contextMenu",t}(),rN=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.lf.setPatternItems=function(t){n.setPatternItems(t)}}return t.prototype.render=function(t,e){var n=this;this.destroy(),this.shapeList&&0!==this.shapeList.length?(this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.shapeList.forEach((function(t){var e;null===(e=n.panelEl)||void 0===e||e.appendChild(n.createDndItem(t))})),e.appendChild(this.panelEl),this.domContainer=e):this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.panelEl&&this.domContainer.contains(this.panelEl)&&this.domContainer.removeChild(this.panelEl)},t.prototype.setPatternItems=function(t){this.shapeList=t,this.domContainer&&this.render(this.lf,this.domContainer)},t.prototype.createDndItem=function(t){var e=this,n=document.createElement("div");n.className=t.className?"lf-dnd-item ".concat(t.className):"lf-dnd-item";var o=document.createElement("div");if(o.className="lf-dnd-shape",t.icon&&(o.style.backgroundImage="url(".concat(t.icon,")")),n.appendChild(o),t.label){var r=document.createElement("div");r.innerText=t.label,r.className="lf-dnd-text",n.appendChild(r)}return t.disabled?(n.classList.add("disabled"),n.onmousedown=function(){t.callback&&t.callback(e.lf,e.domContainer)},n):(n.onmousedown=function(){t.type&&e.lf.dnd.startDrag({type:t.type,properties:t.properties,text:t.text}),t.callback&&t.callback(e.lf,e.domContainer)},n.ondblclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-dbclick",{e:n,data:t})},n.onclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-click",{e:n,data:t})},n.oncontextmenu=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-contextmenu",{e:n,data:t})},n)},t.pluginName="dndPanel",t}(),iN=function(){function t(t){var e=t.lf,n=t.LogicFlow,o=t.options,r=this;this.width=200,this.height=150,this.scale=1,this.translateX=0,this.translateY=0,this.showEdge=!1,this.viewPortTop=0,this.viewPortLeft=0,this.viewPortWidth=150,this.viewPortHeight=75,this.isShow=!1,this.isShowHeader=!1,this.isShowCloseIcon=!1,this.headerTitle="导航",this.disabledPlugins=["miniMap","control","selectionSelect"],this.render=function(t,e){r.container=e,r.lf.on("history:change",(function(){r.isShow&&r.setView()})),r.lf.on("graph:transform",(function(){r.isShow&&r.setView(!1)}))},this.show=function(t,e){r.isShow||(r.createMiniMap(t,e),r.setView()),r.isShow=!0},this.hide=function(){r.isShow&&(r.removeMiniMap(),r.lf.emit("miniMap:close",{})),r.isShow=!1},this.updatePosition=function(t){if("object"==typeof t)void 0===t.left&&void 0===t.right||(r.leftPosition=t.left,r.rightPosition=t.right),void 0===t.top&&void 0===t.bottom||(r.topPosition=t.top,r.bottomPosition=t.bottom);else switch(t){case"left-top":r.leftPosition=0,r.rightPosition=void 0,r.topPosition=0,r.bottomPosition=void 0;break;case"right-top":r.leftPosition=void 0,r.rightPosition=0,r.topPosition=0,r.bottomPosition=void 0;break;case"left-bottom":r.leftPosition=0,r.rightPosition=void 0,r.topPosition=void 0,r.bottomPosition=0;break;case"right-bottom":r.leftPosition=void 0,r.rightPosition=0,r.topPosition=void 0,r.bottomPosition=0}r.updateMiniMapPosition()},this.reset=function(){r.lf.resetTranslate(),r.lf.resetZoom()},this.setShowEdge=function(t){r.showEdge!==t&&(r.showEdge=t,r.setView())},this.startDrag=function(t){document.addEventListener("mousemove",r.drag),document.addEventListener("mouseup",r.drop);var e=t.x,n=t.y;r.startPosition={x:e,y:n}},this.drag=function(t){var e=t.x,n=t.y,o=(e-r.startPosition.x)/r.scale,i=(n-r.startPosition.y)/r.scale,a=r.viewPortLeft+o+r.viewPortWidth/r.scale/2,s=r.viewPortTop+i+r.viewPortHeight/r.scale/2;r.startPosition={x:e,y:n},r.lf.focusOn({coordinate:{x:a,y:s}})},this.drop=function(){document.removeEventListener("mousemove",r.drag),document.removeEventListener("mouseup",r.drop)},this.mapClick=function(t){var e=t.offsetX,n=t.offsetY,o=r.translateX+e/r.scale,i=r.translateY+n/r.scale;r.lf.focusOn({coordinate:{x:o,y:i}})},this.lf=e,this.LFCtor=n,o&&this.setOption(o),this.viewPortWidth=e.graphModel.width,this.viewPortHeight=e.graphModel.height;var i={left:0,right:this.viewPortWidth,top:0,bottom:this.viewPortHeight};this.bounds=i,this.elementAreaBounds=i,this.viewPortBounds=i,this.initMiniMap()}return t.prototype.setOption=function(t){var e=t.width,n=void 0===e?150:e,o=t.height,r=void 0===o?220:o,i=t.showEdge,a=void 0!==i&&i,s=t.isShowHeader,l=void 0!==s&&s,u=t.isShowCloseIcon,c=void 0!==u&&u,d=t.leftPosition,p=t.topPosition,h=t.rightPosition,f=void 0===h?0:h,g=t.bottomPosition,v=void 0===g?0:g,y=t.headerTitle,m=void 0===y?"导航":y;this.width=n,this.height=r,this.showEdge=a,this.isShowHeader=l,this.isShowCloseIcon=c,this.leftPosition=d,this.rightPosition=void 0!==d?void 0:f,this.topPosition=p,this.bottomPosition=void 0!==p?void 0:v,this.headerTitle=m},t.prototype.initMiniMap=function(){var t=document.createElement("div");t.className="lf-mini-map-graph",t.style.width="".concat(this.width,"px"),t.style.height="".concat(this.height,"px"),this.lfMap=new this.LFCtor({container:t,grid:!1,isSilentMode:!0,stopZoomGraph:!0,stopScrollGraph:!0,stopMoveGraph:!1,history:!1,snapline:!1,disabledPlugins:this.disabledPlugins}),this.miniMapWrap=t,this.createViewPort(),t.addEventListener("click",this.mapClick)},t.prototype.createMiniMap=function(t,e){var n,o=document.createElement("div");this.miniMapContainer=o,o.appendChild(this.miniMapWrap),o.style.position="absolute",void 0===t&&void 0===e||(this.leftPosition=t||0,this.topPosition=e||0,this.rightPosition=void 0,this.bottomPosition=void 0),this.updateMiniMapPosition(),o.className="lf-mini-map",this.isShowCloseIcon||o.classList.add("lf-mini-map-no-close-icon"),this.isShowHeader||o.classList.add("lf-mini-map-no-header"),null===(n=this.container)||void 0===n||n.appendChild(o),this.miniMapWrap.appendChild(this.viewport);var r=document.createElement("div");r.className="lf-mini-map-header",r.innerText=this.headerTitle,o.appendChild(r);var i=document.createElement("span");i.className="lf-mini-map-close",i.addEventListener("click",this.hide),o.appendChild(i)},t.prototype.updateMiniMapPosition=function(){if(this.miniMapContainer){var t=this.miniMapContainer.style;void 0!==this.rightPosition?(t.right="".concat(this.rightPosition,"px"),t.left=""):(t.left="".concat(this.leftPosition,"px"),t.right=""),void 0!==this.bottomPosition?(t.bottom="".concat(this.bottomPosition,"px"),t.top=""):(t.top="".concat(this.topPosition,"px"),t.bottom="")}},t.prototype.removeMiniMap=function(){var t;this.miniMapContainer&&(null===(t=this.container)||void 0===t||t.removeChild(this.miniMapContainer))},t.prototype.updateBounds=function(t){t&&this.updateElementAreaBounds(t),this.updateViewPortBounds(),this.bounds={left:Math.min(this.elementAreaBounds.left,this.viewPortBounds.left),right:Math.max(this.elementAreaBounds.right,this.viewPortBounds.right),top:Math.min(this.elementAreaBounds.top,this.viewPortBounds.top),bottom:Math.max(this.elementAreaBounds.bottom,this.viewPortBounds.bottom)}},t.prototype.updateElementAreaBounds=function(t){var e={left:0,right:0,top:0,bottom:0},n=t.nodes;n&&n.length>0&&n.forEach((function(t){var n,o,r=t.x,i=t.y,a=null!==(n=t.width)&&void 0!==n?n:200,s=null!==(o=t.height)&&void 0!==o?o:200,l=r-a/2,u=r+a/2,c=i-s/2,d=i+s/2;e.left=Math.min(l,e.left),e.right=Math.max(u,e.right),e.top=Math.min(c,e.top),e.bottom=Math.max(d,e.bottom)})),this.elementAreaBounds=e},t.prototype.updateViewPortBounds=function(){var t=this.lf.getTransform(),e=t.TRANSLATE_X,n=t.TRANSLATE_Y,o=t.SCALE_X,r=t.SCALE_Y,i=this.lf.graphModel,a=i.width,s=i.height;this.viewPortBounds={left:-e/o,right:(-e+a)/o,top:-n/r,bottom:(-n+s)/r}},t.prototype.resetData=function(t){var e=t.nodes,n=t.edges;return e.forEach((function(t){t.text=void 0})),this.showEdge&&n.forEach((function(t){t.text=void 0})),{nodes:e,edges:this.showEdge?n:[]}},t.prototype.setView=function(t){var e,n;if(void 0===t&&(t=!0),t){var o=this.lf.getGraphRawData(),r=this.resetData(o),i=this.lf.viewMap,a=this.lf.graphModel.modelMap,s=this.lfMap.viewMap;try{for(var l=b(i.keys()),u=l.next();!u.done;u=l.next()){var c=u.value;s.has(c)||this.lfMap.register({type:c,view:i.get(c),model:a.get(c)})}}catch(t){e={error:t}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}this.lfMap.render(r),this.updateBounds(r)}else this.updateBounds();var d=this.bounds,p=d.left,h=d.top,f=d.right-p,g=d.bottom-h,v=this.width/f,y=this.height/g,m=Math.min(v,y);this.scale=m;var _=p-(this.width/m-f)/2,x=h-(this.height/m-g)/2;if(this.lfMap.graphModel.transformModel.translate(-_+this.translateX,-x+this.translateY),this.translateX=_,this.translateY=x,this.miniMapWrap.firstChild){var E=this.miniMapWrap.firstChild.style;E.pointerEvents="none",E.transform="matrix(".concat(m,", 0, 0, ").concat(m,", 0, 0)"),E.transformOrigin="left top",E.height="".concat(this.height/m,"px"),E.width="".concat(this.width/m,"px"),this.updateViewPort()}},t.prototype.updateViewPort=function(){var t=this.viewport.style,e=this.lf.getTransform(),n=e.TRANSLATE_X,o=e.TRANSLATE_Y,r=e.SCALE_X,i=e.SCALE_Y,a=this.lf.graphModel,s=a.width,l=a.height;this.viewPortLeft=-n/r,this.viewPortTop=-o/i,this.viewPortWidth=s/r*this.scale,this.viewPortHeight=l/i*this.scale,t.width="".concat(this.viewPortWidth,"px"),t.height="".concat(this.viewPortHeight,"px"),t.left="".concat((this.viewPortLeft-this.translateX)*this.scale,"px"),t.top="".concat((this.viewPortTop-this.translateY)*this.scale,"px")},t.prototype.createViewPort=function(){var t=document.createElement("div");t.className="lf-minimap-viewport",t.addEventListener("mousedown",this.startDrag),t.addEventListener("click",(function(t){t.stopPropagation()})),this.viewport=t},t.pluginName="miniMap",t}(),aN=function(){function t(t){var e=t.lf,n=this;this.disabled=!0,this.isDefaultStopMoveGraph=!1,this.isWholeNode=!0,this.isWholeEdge=!0,this.draw=function(t){var e=n.lf.getPointByClient(t.clientX,t.clientY).domOverlayPosition,o=e.x,r=e.y;if(n.endPoint={x:o,y:r},n.startPoint){var i=n.startPoint,a=i.x,s=i.y,l=a,u=s,c=o-a,d=r-s;o<a&&(l=o,c=a-o),r<s&&(u=r,d=s-r),n.wrapper&&(n.wrapper.style.left="".concat(l,"px"),n.wrapper.style.top="".concat(u,"px"),n.wrapper.style.width="".concat(c,"px"),n.wrapper.style.height="".concat(d,"px"))}},this.drawOff=function(){var t;if(document.removeEventListener("mousemove",n.draw),document.removeEventListener("mouseup",n.drawOff),n.wrapper&&(n.wrapper.oncontextmenu=null,null===(t=n.container)||void 0===t||t.removeChild(n.wrapper)),n.startPoint&&n.endPoint){var e=n.startPoint,o=e.x,r=e.y,i=n.endPoint,a=i.x,s=i.y,l=[Math.min(o,a),Math.min(r,s)],u=[Math.max(o,a),Math.max(r,s)];if(n.lf.emit("selection:selected-area",{topLeft:l,bottomRight:u}),Math.abs(a-o)<10&&Math.abs(s-r)<10)return;var c=n.lf.graphModel.getAreaElement(l,u,n.isWholeEdge,n.isWholeNode,!0),d=n.lf.graphModel.group;c.forEach((function(t){d&&d.getNodeGroup(t.id)||n.lf.selectElementById(t.id,!0)})),n.lf.emit("selection:selected",c)}},this.lf=e;var o=e.getEditConfig().stopMoveGraph;this.isDefaultStopMoveGraph=o,e.openSelectionSelect=function(){n.openSelectionSelect()},e.closeSelectionSelect=function(){n.closeSelectionSelect()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("blank:mousedown",(function(o){var r=o.e;if(t.getEditConfig().stopMoveGraph&&!n.disabled&&!(2===r.button)){var i=t.getPointByClient(r.clientX,r.clientY).domOverlayPosition,a=i.x,s=i.y;n.startPoint={x:a,y:s},n.endPoint={x:a,y:s};var l=document.createElement("div");l.className="lf-selection-select",l.oncontextmenu=function(t){t.preventDefault()},l.style.top="".concat(n.startPoint.y,"px"),l.style.left="".concat(n.startPoint.x,"px"),e.appendChild(l),n.wrapper=l,document.addEventListener("mousemove",n.draw),document.addEventListener("mouseup",n.drawOff)}}))},t.prototype.setSelectionSense=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.isWholeEdge=t,this.isWholeNode=e},t.prototype.openSelectionSelect=function(){this.lf.getEditConfig().stopMoveGraph||(this.isDefaultStopMoveGraph=!1,this.lf.updateEditConfig({stopMoveGraph:!0})),this.open()},t.prototype.closeSelectionSelect=function(){this.isDefaultStopMoveGraph||this.lf.updateEditConfig({stopMoveGraph:!1}),this.close()},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t}(),sN=function(t,e){var n=[],o=[],r=function(t,o,i){i&&o.unshift.apply(o,x([],_(e.getEdgeModels({sourceNodeId:t.id,targetNodeId:null==i?void 0:i.id}).map((function(t){return t.id}))),!1)),o.includes(t.id)?n.push(o):(o.unshift(t.id),t.incoming.nodes.length?t.incoming.nodes.forEach((function(e){r(e,o.slice(),t)})):n.push(o))},i=function(t,n,r){r&&n.push.apply(n,x([],_(e.getEdgeModels({sourceNodeId:null==r?void 0:r.id,targetNodeId:t.id}).map((function(t){return t.id}))),!1)),n.includes(t.id)?o.push(n):(n.push(t.id),t.outgoing.nodes.length?t.outgoing.nodes.forEach((function(e){i(e,n.slice(),t)})):o.push(n))};return r(t,[]),i(t,[]),x([],_(new Set(x(x([],_(n.flat()),!1),_(o.flat()),!1))),!1)},lN=function(){function t(t){var e=t.lf;this.mode="path",this.manual=!1,this.tempStyles={},this.lf=e}return t.prototype.setMode=function(t){this.mode=t},t.prototype.setManual=function(t){this.manual=t},t.prototype.highlightSingle=function(t){var e=this.lf.getModelById(t);"node"===(null==e?void 0:e.BaseType)?e.updateStyles(this.tempStyles[t]):"edge"===(null==e?void 0:e.BaseType)&&(e.updateStyles(this.tempStyles[t]),e.sourceNode.updateStyles(this.tempStyles[e.sourceNode.id]),e.targetNode.updateStyles(this.tempStyles[e.targetNode.id]))},t.prototype.highlightPath=function(t){var e=this,n=function(t,e){var n=e.getModelById(t);return sN("node"===(null==n?void 0:n.BaseType)?n:null==n?void 0:n.targetNode,e)}(t,this.lf);n.forEach((function(t){var n;null===(n=e.lf.getModelById(t))||void 0===n||n.updateStyles(e.tempStyles[t])}))},t.prototype.highlight=function(t,e){var n=this;(void 0===e&&(e=this.mode),this.manual)||(Object.keys(this.tempStyles).length&&this.restoreHighlight(),Object.values(this.lf.graphModel.modelsMap).forEach((function(t){var e="node"===t.BaseType?t.getNodeStyle():t.getEdgeStyle();n.tempStyles[t.id]=f({},e),t.setStyles({opacity:.1})})),{single:this.highlightSingle.bind(this),path:this.highlightPath.bind(this)}[e](t))},t.prototype.restoreHighlight=function(){var t=this;Object.keys(this.tempStyles).length&&(Object.values(this.lf.graphModel.modelsMap).forEach((function(e){var n,o=null!==(n=t.tempStyles[e.id])&&void 0!==n?n:{};e.updateStyles(f({},o))})),this.tempStyles={})},t.prototype.render=function(){var t=this;this.lf.on("node:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("edge:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("node:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("edge:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("history:change",this.restoreHighlight.bind(this))},t.prototype.destroy=function(){},t.pluginName="highlight",t}(),uN={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function cN(t,e,n,o){var r,i="",a="";t[0]===e[0]?i=t[1]>e[1]?"t":"b":t[1]===e[1]&&(i=t[0]>e[0]?"l":"r"),e[0]===n[0]?a=e[1]>n[1]?"t":"b":e[1]===n[1]&&(a=e[0]>n[0]?"l":"r");var s=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,o)||.2*o,l="".concat(i).concat(a),u=uN[l]||"-",c="L ".concat(t[0]," ").concat(t[1]);if("-"===u)c+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var d=_(function(t,e,n,o){var r=[t[0],t[1]],i=[t[0],t[1]];switch(n){case"tl":return"tr"===e?(r[1]+=o,i[0]+=o):"lb"===e&&(r[0]+=o,i[1]+=o),[r,i];case"tr":return"tl"===e?(r[1]+=o,i[0]-=o):"rb"===e&&(r[0]-=o,i[1]+=o),[r,i];case"bl":return"br"===e?(r[1]-=o,i[0]+=o):"lt"===e&&(r[0]+=o,i[1]-=o),[r,i];case"br":return"bl"===e?(r[1]-=o,i[0]-=o):"rt"===e&&(r[0]-=o,i[1]-=o),[r,i];default:return[]}}(e,l,u,s),2),p=d[0],h=d[1];p&&h&&(c+="L ".concat(p[0]," ").concat(p[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(h[0]," ").concat(h[1]),r=_(h,2),e[0]=r[0],e[1]=r[1])}return c}function dN(t,e){var n=0,o="";if(2===t.length)o+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(o+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){o+=cN(t[n-1],t[n],t[1+n++],e)}o+="L ".concat(t[n][0]," ").concat(t[n][1])}return o}var pN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.points,n=t.isAnimation,o=t.arrowConfig,r=t.radius,i=void 0===r?5:r,a=t.getEdgeStyle(),s=t.getEdgeAnimationStyle(),l=function(t){for(var e=t,n=1;n<e.length-1;){var o=_(e[n-1],2),r=o[0],i=o[1],a=_(e[n],2),s=a[0],l=a[1],u=_(e[n+1],2),c=u[0],d=u[1];r===s&&s===c||i===l&&l===d?e.splice(n,1):n++}return e}(e.split(" ").map((function(t){return t.split(",").map((function(t){return+t}))}))),u=dN(l,i),c=f(f(f({style:n?s:{}},a),o),{fill:"none"});return uo("path",f({d:u},c))},e}(xS),hN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e}(Cx),fN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getLabelShape=function(){var t=this.props.model,e=t.id,n=t.x,o=t.y,r=t.width,i=t.height,a=t.properties,s=this.props.model.getNodeStyle();return uo("svg",{x:n-r/2,y:o-i/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[a.labelText?uo("text",{x:0,y:-5,fontSize:"16px",fill:s.stroke},a.labelText):"",a.disabledDelete?"":uo("text",{x:a.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:s.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,e)},"x")])},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,o=t.width,r=t.height,i=t.id,a=this.props.model.getNodeStyle();return uo("g",{},[uo("rect",f(f({},a),{x:e-o/2,y:n-r/2,width:o,height:r,id:i})),this.getLabelShape()])},e.prototype.toFront=function(){},e.prototype.handleCustomDeleteIconClick=function(t){this.props.graphModel.deleteNode(t)},e}(Hw),gN=function(t){function e(){var e=t.apply(this,x([],_(arguments),!1))||this;return e.d=10,e}return h(e,t),e.prototype.initNodeData=function(e){e.text={value:"",x:e.x,y:e.y,draggable:!1,editable:!1},t.prototype.initNodeData.call(this,e),this.zIndex=0,this.draggable=!0},e.prototype.setAttributes=function(){var t,e=this;this.points=[],(null===(t=this.properties)||void 0===t?void 0:t.node_selection_ids).length>1&&setTimeout((function(){var t;e.updatePointsByNodes((null===(t=e.properties)||void 0===t?void 0:t.node_selection_ids)||[])}))},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke=this.properties.strokeColor||"#008000",e.strokeDasharray="10 5",e},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(t){this.points=t},e.prototype.updateCoordinate=function(t){var e=t.x,n=t.y;this.x=e,this.y=n},e.prototype.updatePointsByNodes=function(t){var e=this,n=[],o=1/0,r=1/0,i=-1/0,a=-1/0;t.forEach((function(t){var n=e.graphModel.getNodeModelById(t);if(n){var s=n.width,l=n.height,u=n.x,c=n.y;o=Math.min(o,u-s/2-e.d),r=Math.min(r,c-l/2-e.d),i=Math.max(i,u+s/2+e.d),a=Math.max(a,c+l/2+e.d)}})),n.push([o,r],[i,r],[i,a],[o,a]),[o,r,i,a].some((function(t){return Math.abs(t)===1/0}))||(this.updatePoints(n),this.updateCoordinate({x:(i+o)/2,y:(a+r)/2}))},e}(Kx),vN=function(){function t(t){var e=t.lf;this.selectNodes=[],this.d=10,e.register({type:"node-selection",view:fN,model:gN})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map((function(t){return t.id}))},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds}}).updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var t=this.getNodeSelection();t&&(this.lf.setProperties(t.id,{node_selection_ids:this.selectNodesIds}),this.lf.getNodeModelById(t.id).updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var t=this,e=this.selectNodesIds,n=this.lf.getGraphRawData(),o=e.filter((function(e){return e!==t.currentClickNode.id}));return n.nodes.find((function(t){if("node-selection"===t.type){var e=El(t,"properties.node_selection_ids",[]);return o.every((function(t){return e.includes(t)}))}return!1}))},t.prototype.render=function(t){var e=this;this.lf=t,t.on("node:click",(function(n){if(n.e.shiftKey&&"node-selection"!==n.data.type){e.currentClickNode=n.data;var o=!1;e.selectNodesIds.includes(n.data.id)&&(e.lf.getNodeModelById(n.data.id).setSelected(!1),o=!0);var r=t.getSelectElements(!0).nodes;e.selectNodes=r,1===e.selectNodes.length?o?e.updateNodeSelection():e.addNodeSelection():e.selectNodes.length>1&&e.updateNodeSelection()}})),t.graphModel.addNodeMoveRules((function(e,n,o){if("node-selection"===e.type){var r=e.properties.node_selection_ids;return t.graphModel.moveNodes(r,n,o,!0),!0}return!0}))},t.pluginName="node-selection",t}();t.AutoLayout=qT,t.BPMNAdapter=UO,t.BPMNBaseAdapter=XO,t.BPMNElements=rO,t.BoundaryEventFactory=gM,t.BpmnAdapter=iM,t.BpmnElement=HC,t.BpmnXmlAdapter=aM,t.ContextMenu=oN,t.Control=ZT,t.CurvedEdge=pN,t.CurvedEdgeModel=hN,t.DiamondResize=HM,t.DiamondResizeModel=jM,t.DiamondResizeView=BM,t.DndPanel=rN,t.DynamicGroup=tT,t.DynamicGroupNode=qO,t.DynamicGroupNodeModel=ZO,t.EllipseResize=LM,t.EllipseResizeModel=RM,t.EllipseResizeView=IM,t.EndEventFactory=pM,t.EndEventModel=SC,t.EndEventView=CC,t.ExclusiveGatewayModel=AC,t.ExclusiveGatewayView=PC,t.FlowPath=UT,t.GatewayNodeFactory=TM,t.Group=$M,t.GroupNode=KM,t.GroupNodeModel=VM,t.Highlight=lN,t.HtmlResize=WM,t.HtmlResizeModel=zM,t.HtmlResizeView=FM,t.InsertNodeInPolyline=sT,t.IntermediateCatchEventFactory=hM,t.IntermediateThrowEventFactory=vM,t.Label=LT,t.Menu=eN,t.MiniMap=iN,t.NodeResize=YM,t.NodeSelection=vN,t.RectResize=UM,t.RectResizeModel=GM,t.RectResizeView=XM,t.SelectionSelect=aN,t.SequenceFlowModel=OC,t.SequenceFlowView=TC,t.ServiceTaskModel=kC,t.ServiceTaskView=RC,t.Snapshot=XT,t.StartEventFactory=fM,t.StartEventModel=xC,t.StartEventView=EC,t.SubProcessFactory=JM,t.TaskNodeFactory=AM,t.UserTaskModel=LC,t.UserTaskView=jC,t.bpmnUtils=dM,t.convertNormalToXml=jO,t.convertXmlToNormal=BO,t.dynamicGroup=JO,t.gateway={exclusive:0,inclusive:1,parallel:2},t.gatewayComposable=[[1,1,0],[0,0,1],[0,1,1]],t.getCurvedEdgePath=dN,t.handleAttributes=XC,t.icons=OM,t.lfJson2Xml=VC,t.lfXml2Json=ZC,t.multiInstanceIcon=NM,t.sequenceFlowFactory=tO,t.toLogicflowData=function(t){var e={nodes:[],edges:[]},n=t.flowElementList;return n&&n.length>0&&n.forEach((function(t){if(t.type===YO.SEQUENCE_FLOW){var n=function(t){var e=t.incoming,n=t.outgoing,o=t.properties,r=t.key,i=t.type,a=o.text,s=o.name,l=o.startPoint,u=o.endPoint,c=o.pointsList,d={id:r,type:VO[i],sourceNodeId:e[0],targetNodeId:n[0],text:a||s,properties:{}};l&&(d.startPoint=JSON.parse(l)),u&&(d.endPoint=JSON.parse(u)),c&&(d.pointsList=JSON.parse(c));var p=["startPoint","endPoint","pointsList","text"];return Object.keys(t.properties).forEach((function(e){-1===p.indexOf(e)&&(d.properties[e]=t.properties[e])})),d}(t);e.edges.push(n)}else{var o=function(t){var e=t.properties,n=t.key,o=t.type,r=t.bounds,i=e.x,a=e.y,s=e.text;if(void 0===i){var l=_(r,2),u=l[0],c=u.x,d=u.y,p=l[1];i=(c+p.x)/2,a=(d+p.y)/2}var h={id:n,type:VO[o],x:i,y:a,text:s,properties:{}},f=["x","y","text"];return Object.keys(t.properties).forEach((function(e){-1===f.indexOf(e)&&(h.properties[e]=t.properties[e])})),h}(t);e.nodes.push(o)}})),e},t.toNormalJson=tM,t.toTurboData=function(t){var e=new Map,n={flowElementList:[]};return t.nodes.forEach((function(t){var o=function(t){var e=t.id,n=t.type,o=t.x,r=t.y,i=t.text,a=void 0===i?"":i,s=t.properties;return{incoming:[],outgoing:[],dockers:[],type:KO(n),properties:f(f({},s),{name:a&&a.value||"",x:o,y:r,text:a}),key:e}}(t);n.flowElementList.push(o),e.set(t.id,o)})),t.edges.forEach((function(t){var o=function(t){var e=t.id,n=t.type,o=t.sourceNodeId,r=t.targetNodeId,i=t.startPoint,a=t.endPoint,s=t.pointsList,l=t.text,u=void 0===l?"":l,c=t.properties;return{incoming:[o],outgoing:[r],type:KO(n),dockers:[],properties:f(f({},c),{name:u&&u.value||"",text:u,startPoint:JSON.stringify(i),endPoint:JSON.stringify(a),pointsList:JSON.stringify(s)}),key:e}}(t);e.get(t.sourceNodeId).outgoing.push(o.key),e.get(t.targetNodeId).incoming.push(o.key),n.flowElementList.push(o)})),n},t.toXmlJson=QC,t.useDefinition=oO}));
|
|
42
42
|
//# sourceMappingURL=index.min.js.map
|