33 lines
818 KiB
JavaScript
33 lines
818 KiB
JavaScript
(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[823],{51223:function(t,e,n){var i=n(5112),s=n(70030),o=n(3070),r=i("unscopables"),a=Array.prototype;void 0==a[r]&&o.f(a,r,{configurable:!0,value:s(null)}),t.exports=function(t){a[r][t]=!0}},60490:function(t,e,n){var i=n(35005);t.exports=i("document","documentElement")},70030:function(t,e,n){var i,s=n(19670),o=n(36048),r=n(80748),a=n(3501),l=n(60490),c=n(80317),h=n(6200),u=">",d="<",g="prototype",p="script",f=h("IE_PROTO"),m=function(){},y=function(t){return d+p+u+t+d+"/"+p+u},b=function(t){t.write(y("")),t.close();var e=t.parentWindow.Object;return t=null,e},w=function(){var t,e=c("iframe"),n="java"+p+":";return e.style.display="none",l.appendChild(e),e.src=String(n),t=e.contentWindow.document,t.open(),t.write(y("document.F=Object")),t.close(),t.F},C=function(){try{i=new ActiveXObject("htmlfile")}catch(e){}C="undefined"!=typeof document?document.domain&&i?b(i):w():b(i);var t=r.length;while(t--)delete C[g][r[t]];return C()};a[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(m[g]=s(t),n=new m,m[g]=null,n[f]=t):n=C(),void 0===e?n:o.f(n,e)}},36048:function(t,e,n){var i=n(19781),s=n(3353),o=n(3070),r=n(19670),a=n(45656),l=n(81956);e.f=i&&!s?Object.defineProperties:function(t,e){r(t);var n,i=a(e),s=l(e),c=s.length,h=0;while(c>h)o.f(t,n=s[h++],i[n]);return t}},81956:function(t,e,n){var i=n(16324),s=n(80748);t.exports=Object.keys||function(t){return i(t,s)}},26699:function(t,e,n){"use strict";var i=n(82109),s=n(41318).includes,o=n(47293),r=n(51223),a=o((function(){return!Array(1).includes()}));i({target:"Array",proto:!0,forced:a},{includes:function(t){return s(this,t,arguments.length>1?arguments[1]:void 0)}}),r("includes")},50450:function(t,e,n){var i,s,o;
|
||
/*!
|
||
* jQuery Mousewheel 3.1.13
|
||
*
|
||
* Copyright jQuery Foundation and other contributors
|
||
* Released under the MIT license
|
||
* http://jquery.org/license
|
||
*/(function(r){s=[n(19755)],i=r,o="function"===typeof i?i.apply(e,s):i,void 0===o||(t.exports=o)})((function(t){var e,n,i=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],s="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],o=Array.prototype.slice;if(t.event.fixHooks)for(var r=i.length;r;)t.event.fixHooks[i[--r]]=t.event.mouseHooks;var a=t.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=s.length;e;)this.addEventListener(s[--e],l,!1);else this.onmousewheel=l;t.data(this,"mousewheel-line-height",a.getLineHeight(this)),t.data(this,"mousewheel-page-height",a.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=s.length;e;)this.removeEventListener(s[--e],l,!1);else this.onmousewheel=null;t.removeData(this,"mousewheel-line-height"),t.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var n=t(e),i=n["offsetParent"in t.fn?"offsetParent":"parent"]();return i.length||(i=t("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(e){return t(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function l(i){var s=i||window.event,r=o.call(arguments,1),l=0,u=0,d=0,g=0,p=0,f=0;if(i=t.event.fix(s),i.type="mousewheel","detail"in s&&(d=-1*s.detail),"wheelDelta"in s&&(d=s.wheelDelta),"wheelDeltaY"in s&&(d=s.wheelDeltaY),"wheelDeltaX"in s&&(u=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(u=-1*d,d=0),l=0===d?u:d,"deltaY"in s&&(d=-1*s.deltaY,l=d),"deltaX"in s&&(u=s.deltaX,0===d&&(l=-1*u)),0!==d||0!==u){if(1===s.deltaMode){var m=t.data(this,"mousewheel-line-height");l*=m,d*=m,u*=m}else if(2===s.deltaMode){var y=t.data(this,"mousewheel-page-height");l*=y,d*=y,u*=y}if(g=Math.max(Math.abs(d),Math.abs(u)),(!n||g<n)&&(n=g,h(s,g)&&(n/=40)),h(s,g)&&(l/=40,u/=40,d/=40),l=Math[l>=1?"floor":"ceil"](l/n),u=Math[u>=1?"floor":"ceil"](u/n),d=Math[d>=1?"floor":"ceil"](d/n),a.settings.normalizeOffset&&this.getBoundingClientRect){var b=this.getBoundingClientRect();p=i.clientX-b.left,f=i.clientY-b.top}return i.deltaX=u,i.deltaY=d,i.deltaFactor=n,i.offsetX=p,i.offsetY=f,i.deltaMode=0,r.unshift(i,l,u,d),e&&clearTimeout(e),e=setTimeout(c,200),(t.event.dispatch||t.event.handle).apply(this,r)}}function c(){n=null}function h(t,e){return a.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120===0}t.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})}))},19755:function(t,e){var n,i;
|
||
/*!
|
||
* jQuery JavaScript Library v3.6.0
|
||
* https://jquery.com/
|
||
*
|
||
* Includes Sizzle.js
|
||
* https://sizzlejs.com/
|
||
*
|
||
* Copyright OpenJS Foundation and other contributors
|
||
* Released under the MIT license
|
||
* https://jquery.org/license
|
||
*
|
||
* Date: 2021-03-02T17:08Z
|
||
*/(function(e,n){"use strict";"object"===typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)})("undefined"!==typeof window?window:this,(function(s,o){"use strict";var r=[],a=Object.getPrototypeOf,l=r.slice,c=r.flat?function(t){return r.flat.call(t)}:function(t){return r.concat.apply([],t)},h=r.push,u=r.indexOf,d={},g=d.toString,p=d.hasOwnProperty,f=p.toString,m=f.call(Object),y={},b=function(t){return"function"===typeof t&&"number"!==typeof t.nodeType&&"function"!==typeof t.item},w=function(t){return null!=t&&t===t.window},C=s.document,v={type:!0,src:!0,nonce:!0,noModule:!0};function x(t,e,n){n=n||C;var i,s,o=n.createElement("script");if(o.text=t,e)for(i in v)s=e[i]||e.getAttribute&&e.getAttribute(i),s&&o.setAttribute(i,s);n.head.appendChild(o).parentNode.removeChild(o)}function k(t){return null==t?t+"":"object"===typeof t||"function"===typeof t?d[g.call(t)]||"object":typeof t}var E="3.6.0",M=function(t,e){return new M.fn.init(t,e)};function S(t){var e=!!t&&"length"in t&&t.length,n=k(t);return!b(t)&&!w(t)&&("array"===n||0===e||"number"===typeof e&&e>0&&e-1 in t)}M.fn=M.prototype={jquery:E,constructor:M,length:0,toArray:function(){return l.call(this)},get:function(t){return null==t?l.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=M.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return M.each(this,t)},map:function(t){return this.pushStack(M.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(M.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(M.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:r.sort,splice:r.splice},M.extend=M.fn.extend=function(){var t,e,n,i,s,o,r=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"===typeof r&&(c=r,r=arguments[a]||{},a++),"object"===typeof r||b(r)||(r={}),a===l&&(r=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)i=t[e],"__proto__"!==e&&r!==i&&(c&&i&&(M.isPlainObject(i)||(s=Array.isArray(i)))?(n=r[e],o=s&&!Array.isArray(n)?[]:s||M.isPlainObject(n)?n:{},s=!1,r[e]=M.extend(c,o,i)):void 0!==i&&(r[e]=i));return r},M.extend({expando:"jQuery"+(E+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==g.call(t))&&(e=a(t),!e||(n=p.call(e,"constructor")&&e.constructor,"function"===typeof n&&f.call(n)===m))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){x(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,i=0;if(S(t)){for(n=t.length;i<n;i++)if(!1===e.call(t[i],i,t[i]))break}else for(i in t)if(!1===e.call(t[i],i,t[i]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(S(Object(t))?M.merge(n,"string"===typeof t?[t]:t):h.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:u.call(e,t,n)},merge:function(t,e){for(var n=+e.length,i=0,s=t.length;i<n;i++)t[s++]=e[i];return t.length=s,t},grep:function(t,e,n){for(var i,s=[],o=0,r=t.length,a=!n;o<r;o++)i=!e(t[o],o),i!==a&&s.push(t[o]);return s},map:function(t,e,n){var i,s,o=0,r=[];if(S(t))for(i=t.length;o<i;o++)s=e(t[o],o,n),null!=s&&r.push(s);else for(o in t)s=e(t[o],o,n),null!=s&&r.push(s);return c(r)},guid:1,support:y}),"function"===typeof Symbol&&(M.fn[Symbol.iterator]=r[Symbol.iterator]),M.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){d["[object "+e+"]"]=e.toLowerCase()}));var A=
|
||
/*!
|
||
* Sizzle CSS Selector Engine v2.3.6
|
||
* https://sizzlejs.com/
|
||
*
|
||
* Copyright JS Foundation and other contributors
|
||
* Released under the MIT license
|
||
* https://js.foundation/
|
||
*
|
||
* Date: 2021-02-16
|
||
*/
|
||
function(t){var e,n,i,s,o,r,a,l,c,h,u,d,g,p,f,m,y,b,w,C="sizzle"+1*new Date,v=t.document,x=0,k=0,E=lt(),M=lt(),S=lt(),A=lt(),D=function(t,e){return t===e&&(u=!0),0},P={}.hasOwnProperty,O=[],T=O.pop,N=O.push,j=O.push,F=O.slice,L=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},z="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",I="[\\x20\\t\\r\\n\\f]",B="(?:\\\\[\\da-fA-F]{1,6}"+I+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",R="\\["+I+"*("+B+")(?:"+I+"*([*^$|!~]?=)"+I+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+B+"))|)"+I+"*\\]",$=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+R+")*)|.*)\\)|)",V=new RegExp(I+"+","g"),_=new RegExp("^"+I+"+|((?:^|[^\\\\])(?:\\\\.)*)"+I+"+$","g"),G=new RegExp("^"+I+"*,"+I+"*"),H=new RegExp("^"+I+"*([>+~]|"+I+")"+I+"*"),U=new RegExp(I+"|>"),W=new RegExp($),q=new RegExp("^"+B+"$"),Z={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+I+"*(even|odd|(([+-]|)(\\d*)n|)"+I+"*(?:([+-]|)"+I+"*(\\d+)|))"+I+"*\\)|)","i"),bool:new RegExp("^(?:"+z+")$","i"),needsContext:new RegExp("^"+I+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+I+"*((?:-\\d)?\\d*)"+I+"*\\)|)(?=[^-]|$)","i")},X=/HTML$/i,Y=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+I+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},it=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,st=function(t,e){return e?"\0"===t?"<22>":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){d()},rt=Ct((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{j.apply(O=F.call(v.childNodes),v.childNodes),O[v.childNodes.length].nodeType}catch(At){j={apply:O.length?function(t,e){N.apply(t,F.call(e))}:function(t,e){var n=t.length,i=0;while(t[n++]=e[i++]);t.length=n-1}}}function at(t,e,i,s){var o,a,c,h,u,p,y,b=e&&e.ownerDocument,v=e?e.nodeType:9;if(i=i||[],"string"!==typeof t||!t||1!==v&&9!==v&&11!==v)return i;if(!s&&(d(e),e=e||g,f)){if(11!==v&&(u=Q.exec(t)))if(o=u[1]){if(9===v){if(!(c=e.getElementById(o)))return i;if(c.id===o)return i.push(c),i}else if(b&&(c=b.getElementById(o))&&w(e,c)&&c.id===o)return i.push(c),i}else{if(u[2])return j.apply(i,e.getElementsByTagName(t)),i;if((o=u[3])&&n.getElementsByClassName&&e.getElementsByClassName)return j.apply(i,e.getElementsByClassName(o)),i}if(n.qsa&&!A[t+" "]&&(!m||!m.test(t))&&(1!==v||"object"!==e.nodeName.toLowerCase())){if(y=t,b=e,1===v&&(U.test(t)||H.test(t))){b=tt.test(t)&&yt(e.parentNode)||e,b===e&&n.scope||((h=e.getAttribute("id"))?h=h.replace(it,st):e.setAttribute("id",h=C)),p=r(t),a=p.length;while(a--)p[a]=(h?"#"+h:":scope")+" "+wt(p[a]);y=p.join(",")}try{return j.apply(i,b.querySelectorAll(y)),i}catch(x){A(t,!0)}finally{h===C&&e.removeAttribute("id")}}}return l(t.replace(_,"$1"),e,i,s)}function lt(){var t=[];function e(n,s){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=s}return e}function ct(t){return t[C]=!0,t}function ht(t){var e=g.createElement("fieldset");try{return!!t(e)}catch(At){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ut(t,e){var n=t.split("|"),s=n.length;while(s--)i.attrHandle[n[s]]=e}function dt(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)while(n=n.nextSibling)if(n===e)return-1;return t?1:-1}function gt(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function pt(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function ft(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&rt(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function mt(t){return ct((function(e){return e=+e,ct((function(n,i){var s,o=t([],n.length,e),r=o.length;while(r--)n[s=o[r]]&&(n[s]=!(i[s]=n[s]))}))}))}function yt(t){return t&&"undefined"!==typeof t.getElementsByTagName&&t}for(e in n=at.support={},o=at.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!X.test(e||n&&n.nodeName||"HTML")},d=at.setDocument=function(t){var e,s,r=t?t.ownerDocument||t:v;return r!=g&&9===r.nodeType&&r.documentElement?(g=r,p=g.documentElement,f=!o(g),v!=g&&(s=g.defaultView)&&s.top!==s&&(s.addEventListener?s.addEventListener("unload",ot,!1):s.attachEvent&&s.attachEvent("onunload",ot)),n.scope=ht((function(t){return p.appendChild(t).appendChild(g.createElement("div")),"undefined"!==typeof t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ht((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ht((function(t){return t.appendChild(g.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(g.getElementsByClassName),n.getById=ht((function(t){return p.appendChild(t).id=C,!g.getElementsByName||!g.getElementsByName(C).length})),n.getById?(i.filter["ID"]=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},i.find["ID"]=function(t,e){if("undefined"!==typeof e.getElementById&&f){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter["ID"]=function(t){var e=t.replace(et,nt);return function(t){var n="undefined"!==typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find["ID"]=function(t,e){if("undefined"!==typeof e.getElementById&&f){var n,i,s,o=e.getElementById(t);if(o){if(n=o.getAttributeNode("id"),n&&n.value===t)return[o];s=e.getElementsByName(t),i=0;while(o=s[i++])if(n=o.getAttributeNode("id"),n&&n.value===t)return[o]}return[]}}),i.find["TAG"]=n.getElementsByTagName?function(t,e){return"undefined"!==typeof e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],s=0,o=e.getElementsByTagName(t);if("*"===t){while(n=o[s++])1===n.nodeType&&i.push(n);return i}return o},i.find["CLASS"]=n.getElementsByClassName&&function(t,e){if("undefined"!==typeof e.getElementsByClassName&&f)return e.getElementsByClassName(t)},y=[],m=[],(n.qsa=K.test(g.querySelectorAll))&&(ht((function(t){var e;p.appendChild(t).innerHTML="<a id='"+C+"'></a><select id='"+C+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+I+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\["+I+"*(?:value|"+z+")"),t.querySelectorAll("[id~="+C+"-]").length||m.push("~="),e=g.createElement("input"),e.setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||m.push("\\["+I+"*name"+I+"*="+I+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+C+"+*").length||m.push(".#.+[+~]"),t.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]")})),ht((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=g.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&m.push("name"+I+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),p.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),m.push(",.*:")}))),(n.matchesSelector=K.test(b=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ht((function(t){n.disconnectedMatch=b.call(t,"*"),b.call(t,"[s!='']:x"),y.push("!=",$)})),m=m.length&&new RegExp(m.join("|")),y=y.length&&new RegExp(y.join("|")),e=K.test(p.compareDocumentPosition),w=e||K.test(p.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)while(e=e.parentNode)if(e===t)return!0;return!1},D=e?function(t,e){if(t===e)return u=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&i||!n.sortDetached&&e.compareDocumentPosition(t)===i?t==g||t.ownerDocument==v&&w(v,t)?-1:e==g||e.ownerDocument==v&&w(v,e)?1:h?L(h,t)-L(h,e):0:4&i?-1:1)}:function(t,e){if(t===e)return u=!0,0;var n,i=0,s=t.parentNode,o=e.parentNode,r=[t],a=[e];if(!s||!o)return t==g?-1:e==g?1:s?-1:o?1:h?L(h,t)-L(h,e):0;if(s===o)return dt(t,e);n=t;while(n=n.parentNode)r.unshift(n);n=e;while(n=n.parentNode)a.unshift(n);while(r[i]===a[i])i++;return i?dt(r[i],a[i]):r[i]==v?-1:a[i]==v?1:0},g):g},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&f&&!A[e+" "]&&(!y||!y.test(e))&&(!m||!m.test(e)))try{var i=b.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(At){A(e,!0)}return at(e,g,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=g&&d(t),w(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=g&&d(t);var s=i.attrHandle[e.toLowerCase()],o=s&&P.call(i.attrHandle,e.toLowerCase())?s(t,e,!f):void 0;return void 0!==o?o:n.attributes||!f?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},at.escape=function(t){return(t+"").replace(it,st)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,i=[],s=0,o=0;if(u=!n.detectDuplicates,h=!n.sortStable&&t.slice(0),t.sort(D),u){while(e=t[o++])e===t[o]&&(s=i.push(o));while(s--)t.splice(i[s],1)}return h=null,t},s=at.getText=function(t){var e,n="",i=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"===typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=s(t)}else if(3===o||4===o)return t.nodeValue}else while(e=t[i++])n+=s(e);return n},i=at.selectors={cacheLength:50,createPseudo:ct,match:Z,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Z["CHILD"].test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&W.test(n)&&(e=r(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=E[t+" "];return e||(e=new RegExp("(^|"+I+")"+t+"("+I+"|$)"))&&E(t,(function(t){return e.test("string"===typeof t.className&&t.className||"undefined"!==typeof t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var s=at.attr(i,t);return null==s?"!="===e:!e||(s+="","="===e?s===n:"!="===e?s!==n:"^="===e?n&&0===s.indexOf(n):"*="===e?n&&s.indexOf(n)>-1:"$="===e?n&&s.slice(-n.length)===n:"~="===e?(" "+s.replace(V," ")+" ").indexOf(n)>-1:"|="===e&&(s===n||s.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,s){var o="nth"!==t.slice(0,3),r="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===s?function(t){return!!t.parentNode}:function(e,n,l){var c,h,u,d,g,p,f=o!==r?"nextSibling":"previousSibling",m=e.parentNode,y=a&&e.nodeName.toLowerCase(),b=!l&&!a,w=!1;if(m){if(o){while(f){d=e;while(d=d[f])if(a?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;p=f="only"===t&&!p&&"nextSibling"}return!0}if(p=[r?m.firstChild:m.lastChild],r&&b){d=m,u=d[C]||(d[C]={}),h=u[d.uniqueID]||(u[d.uniqueID]={}),c=h[t]||[],g=c[0]===x&&c[1],w=g&&c[2],d=g&&m.childNodes[g];while(d=++g&&d&&d[f]||(w=g=0)||p.pop())if(1===d.nodeType&&++w&&d===e){h[t]=[x,g,w];break}}else if(b&&(d=e,u=d[C]||(d[C]={}),h=u[d.uniqueID]||(u[d.uniqueID]={}),c=h[t]||[],g=c[0]===x&&c[1],w=g),!1===w)while(d=++g&&d&&d[f]||(w=g=0)||p.pop())if((a?d.nodeName.toLowerCase()===y:1===d.nodeType)&&++w&&(b&&(u=d[C]||(d[C]={}),h=u[d.uniqueID]||(u[d.uniqueID]={}),h[t]=[x,w]),d===e))break;return w-=s,w===i||w%i===0&&w/i>=0}}},PSEUDO:function(t,e){var n,s=i.pseudos[t]||i.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return s[C]?s(e):s.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?ct((function(t,n){var i,o=s(t,e),r=o.length;while(r--)i=L(t,o[r]),t[i]=!(n[i]=o[r])})):function(t){return s(t,0,n)}):s}},pseudos:{not:ct((function(t){var e=[],n=[],i=a(t.replace(_,"$1"));return i[C]?ct((function(t,e,n,s){var o,r=i(t,null,s,[]),a=t.length;while(a--)(o=r[a])&&(t[a]=!(e[a]=o))})):function(t,s,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}})),has:ct((function(t){return function(e){return at(t,e).length>0}})),contains:ct((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||s(e)).indexOf(t)>-1}})),lang:ct((function(t){return q.test(t||"")||at.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=f?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===p},focus:function(t){return t===g.activeElement&&(!g.hasFocus||g.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:ft(!1),disabled:ft(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos["empty"](t)},header:function(t){return J.test(t.nodeName)},input:function(t){return Y.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:mt((function(){return[0]})),last:mt((function(t,e){return[e-1]})),eq:mt((function(t,e,n){return[n<0?n+e:n]})),even:mt((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:mt((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:mt((function(t,e,n){for(var i=n<0?n+e:n>e?e:n;--i>=0;)t.push(i);return t})),gt:mt((function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t}))}},i.pseudos["nth"]=i.pseudos["eq"],{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[e]=gt(e);for(e in{submit:!0,reset:!0})i.pseudos[e]=pt(e);function bt(){}function wt(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function Ct(t,e,n){var i=e.dir,s=e.next,o=s||i,r=n&&"parentNode"===o,a=k++;return e.first?function(e,n,s){while(e=e[i])if(1===e.nodeType||r)return t(e,n,s);return!1}:function(e,n,l){var c,h,u,d=[x,a];if(l){while(e=e[i])if((1===e.nodeType||r)&&t(e,n,l))return!0}else while(e=e[i])if(1===e.nodeType||r)if(u=e[C]||(e[C]={}),h=u[e.uniqueID]||(u[e.uniqueID]={}),s&&s===e.nodeName.toLowerCase())e=e[i]||e;else{if((c=h[o])&&c[0]===x&&c[1]===a)return d[2]=c[2];if(h[o]=d,d[2]=t(e,n,l))return!0}return!1}}function vt(t){return t.length>1?function(e,n,i){var s=t.length;while(s--)if(!t[s](e,n,i))return!1;return!0}:t[0]}function xt(t,e,n){for(var i=0,s=e.length;i<s;i++)at(t,e[i],n);return n}function kt(t,e,n,i,s){for(var o,r=[],a=0,l=t.length,c=null!=e;a<l;a++)(o=t[a])&&(n&&!n(o,i,s)||(r.push(o),c&&e.push(a)));return r}function Et(t,e,n,i,s,o){return i&&!i[C]&&(i=Et(i)),s&&!s[C]&&(s=Et(s,o)),ct((function(o,r,a,l){var c,h,u,d=[],g=[],p=r.length,f=o||xt(e||"*",a.nodeType?[a]:a,[]),m=!t||!o&&e?f:kt(f,d,t,a,l),y=n?s||(o?t:p||i)?[]:r:m;if(n&&n(m,y,a,l),i){c=kt(y,g),i(c,[],a,l),h=c.length;while(h--)(u=c[h])&&(y[g[h]]=!(m[g[h]]=u))}if(o){if(s||t){if(s){c=[],h=y.length;while(h--)(u=y[h])&&c.push(m[h]=u);s(null,y=[],c,l)}h=y.length;while(h--)(u=y[h])&&(c=s?L(o,u):d[h])>-1&&(o[c]=!(r[c]=u))}}else y=kt(y===r?y.splice(p,y.length):y),s?s(null,r,y,l):j.apply(r,y)}))}function Mt(t){for(var e,n,s,o=t.length,r=i.relative[t[0].type],a=r||i.relative[" "],l=r?1:0,h=Ct((function(t){return t===e}),a,!0),u=Ct((function(t){return L(e,t)>-1}),a,!0),d=[function(t,n,i){var s=!r&&(i||n!==c)||((e=n).nodeType?h(t,n,i):u(t,n,i));return e=null,s}];l<o;l++)if(n=i.relative[t[l].type])d=[Ct(vt(d),n)];else{if(n=i.filter[t[l].type].apply(null,t[l].matches),n[C]){for(s=++l;s<o;s++)if(i.relative[t[s].type])break;return Et(l>1&&vt(d),l>1&&wt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(_,"$1"),n,l<s&&Mt(t.slice(l,s)),s<o&&Mt(t=t.slice(s)),s<o&&wt(t))}d.push(n)}return vt(d)}function St(t,e){var n=e.length>0,s=t.length>0,o=function(o,r,a,l,h){var u,p,m,y=0,b="0",w=o&&[],C=[],v=c,k=o||s&&i.find["TAG"]("*",h),E=x+=null==v?1:Math.random()||.1,M=k.length;for(h&&(c=r==g||r||h);b!==M&&null!=(u=k[b]);b++){if(s&&u){p=0,r||u.ownerDocument==g||(d(u),a=!f);while(m=t[p++])if(m(u,r||g,a)){l.push(u);break}h&&(x=E)}n&&((u=!m&&u)&&y--,o&&w.push(u))}if(y+=b,n&&b!==y){p=0;while(m=e[p++])m(w,C,r,a);if(o){if(y>0)while(b--)w[b]||C[b]||(C[b]=T.call(l));C=kt(C)}j.apply(l,C),h&&!o&&C.length>0&&y+e.length>1&&at.uniqueSort(l)}return h&&(x=E,c=v),w};return n?ct(o):o}return bt.prototype=i.filters=i.pseudos,i.setFilters=new bt,r=at.tokenize=function(t,e){var n,s,o,r,a,l,c,h=M[t+" "];if(h)return e?0:h.slice(0);a=t,l=[],c=i.preFilter;while(a){for(r in n&&!(s=G.exec(a))||(s&&(a=a.slice(s[0].length)||a),l.push(o=[])),n=!1,(s=H.exec(a))&&(n=s.shift(),o.push({value:n,type:s[0].replace(_," ")}),a=a.slice(n.length)),i.filter)!(s=Z[r].exec(a))||c[r]&&!(s=c[r](s))||(n=s.shift(),o.push({value:n,type:r,matches:s}),a=a.slice(n.length));if(!n)break}return e?a.length:a?at.error(t):M(t,l).slice(0)},a=at.compile=function(t,e){var n,i=[],s=[],o=S[t+" "];if(!o){e||(e=r(t)),n=e.length;while(n--)o=Mt(e[n]),o[C]?i.push(o):s.push(o);o=S(t,St(s,i)),o.selector=t}return o},l=at.select=function(t,e,n,s){var o,l,c,h,u,d="function"===typeof t&&t,g=!s&&r(t=d.selector||t);if(n=n||[],1===g.length){if(l=g[0]=g[0].slice(0),l.length>2&&"ID"===(c=l[0]).type&&9===e.nodeType&&f&&i.relative[l[1].type]){if(e=(i.find["ID"](c.matches[0].replace(et,nt),e)||[])[0],!e)return n;d&&(e=e.parentNode),t=t.slice(l.shift().value.length)}o=Z["needsContext"].test(t)?0:l.length;while(o--){if(c=l[o],i.relative[h=c.type])break;if((u=i.find[h])&&(s=u(c.matches[0].replace(et,nt),tt.test(l[0].type)&&yt(e.parentNode)||e))){if(l.splice(o,1),t=s.length&&wt(l),!t)return j.apply(n,s),n;break}}}return(d||a(t,g))(s,e,!f,n,!e||tt.test(t)&&yt(e.parentNode)||e),n},n.sortStable=C.split("").sort(D).join("")===C,n.detectDuplicates=!!u,d(),n.sortDetached=ht((function(t){return 1&t.compareDocumentPosition(g.createElement("fieldset"))})),ht((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||ut("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ht((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ut("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ht((function(t){return null==t.getAttribute("disabled")}))||ut(z,(function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null})),at}(s);M.find=A,M.expr=A.selectors,M.expr[":"]=M.expr.pseudos,M.uniqueSort=M.unique=A.uniqueSort,M.text=A.getText,M.isXMLDoc=A.isXML,M.contains=A.contains,M.escapeSelector=A.escape;var D=function(t,e,n){var i=[],s=void 0!==n;while((t=t[e])&&9!==t.nodeType)if(1===t.nodeType){if(s&&M(t).is(n))break;i.push(t)}return i},P=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},O=M.expr.match.needsContext;function T(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(t,e,n){return b(e)?M.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?M.grep(t,(function(t){return t===e!==n})):"string"!==typeof e?M.grep(t,(function(t){return u.call(e,t)>-1!==n})):M.filter(e,t,n)}M.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?M.find.matchesSelector(i,t)?[i]:[]:M.find.matches(t,M.grep(e,(function(t){return 1===t.nodeType})))},M.fn.extend({find:function(t){var e,n,i=this.length,s=this;if("string"!==typeof t)return this.pushStack(M(t).filter((function(){for(e=0;e<i;e++)if(M.contains(s[e],this))return!0})));for(n=this.pushStack([]),e=0;e<i;e++)M.find(t,s[e],n);return i>1?M.uniqueSort(n):n},filter:function(t){return this.pushStack(j(this,t||[],!1))},not:function(t){return this.pushStack(j(this,t||[],!0))},is:function(t){return!!j(this,"string"===typeof t&&O.test(t)?M(t):t||[],!1).length}});var F,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,z=M.fn.init=function(t,e,n){var i,s;if(!t)return this;if(n=n||F,"string"===typeof t){if(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:L.exec(t),!i||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof M?e[0]:e,M.merge(this,M.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:C,!0)),N.test(i[1])&&M.isPlainObject(e))for(i in e)b(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return s=C.getElementById(i[2]),s&&(this[0]=s,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):b(t)?void 0!==n.ready?n.ready(t):t(M):M.makeArray(t,this)};z.prototype=M.fn,F=M(C);var I=/^(?:parents|prev(?:Until|All))/,B={children:!0,contents:!0,next:!0,prev:!0};function R(t,e){while((t=t[e])&&1!==t.nodeType);return t}M.fn.extend({has:function(t){var e=M(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(M.contains(this,e[t]))return!0}))},closest:function(t,e){var n,i=0,s=this.length,o=[],r="string"!==typeof t&&M(t);if(!O.test(t))for(;i<s;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(r?r.index(n)>-1:1===n.nodeType&&M.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?M.uniqueSort(o):o)},index:function(t){return t?"string"===typeof t?u.call(M(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(M.uniqueSort(M.merge(this.get(),M(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),M.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return D(t,"parentNode")},parentsUntil:function(t,e,n){return D(t,"parentNode",n)},next:function(t){return R(t,"nextSibling")},prev:function(t){return R(t,"previousSibling")},nextAll:function(t){return D(t,"nextSibling")},prevAll:function(t){return D(t,"previousSibling")},nextUntil:function(t,e,n){return D(t,"nextSibling",n)},prevUntil:function(t,e,n){return D(t,"previousSibling",n)},siblings:function(t){return P((t.parentNode||{}).firstChild,t)},children:function(t){return P(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(T(t,"template")&&(t=t.content||t),M.merge([],t.childNodes))}},(function(t,e){M.fn[t]=function(n,i){var s=M.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"===typeof i&&(s=M.filter(i,s)),this.length>1&&(B[t]||M.uniqueSort(s),I.test(t)&&s.reverse()),this.pushStack(s)}}));var $=/[^\x20\t\r\n\f]+/g;function V(t){var e={};return M.each(t.match($)||[],(function(t,n){e[n]=!0})),e}function _(t){return t}function G(t){throw t}function H(t,e,n,i){var s;try{t&&b(s=t.promise)?s.call(t).done(e).fail(n):t&&b(s=t.then)?s.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}M.Callbacks=function(t){t="string"===typeof t?V(t):M.extend({},t);var e,n,i,s,o=[],r=[],a=-1,l=function(){for(s=s||t.once,i=e=!0;r.length;a=-1){n=r.shift();while(++a<o.length)!1===o[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=o.length,n=!1)}t.memory||(n=!1),e=!1,s&&(o=n?[]:"")},c={add:function(){return o&&(n&&!e&&(a=o.length-1,r.push(n)),function e(n){M.each(n,(function(n,i){b(i)?t.unique&&c.has(i)||o.push(i):i&&i.length&&"string"!==k(i)&&e(i)}))}(arguments),n&&!e&&l()),this},remove:function(){return M.each(arguments,(function(t,e){var n;while((n=M.inArray(e,o,n))>-1)o.splice(n,1),n<=a&&a--})),this},has:function(t){return t?M.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return s=r=[],o=n="",this},disabled:function(){return!o},lock:function(){return s=r=[],n||e||(o=n=""),this},locked:function(){return!!s},fireWith:function(t,n){return s||(n=n||[],n=[t,n.slice?n.slice():n],r.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},M.extend({Deferred:function(t){var e=[["notify","progress",M.Callbacks("memory"),M.Callbacks("memory"),2],["resolve","done",M.Callbacks("once memory"),M.Callbacks("once memory"),0,"resolved"],["reject","fail",M.Callbacks("once memory"),M.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return M.Deferred((function(n){M.each(e,(function(e,i){var s=b(t[i[4]])&&t[i[4]];o[i[1]]((function(){var t=s&&s.apply(this,arguments);t&&b(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,s?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,i){var o=0;function r(t,e,n,i){return function(){var a=this,l=arguments,c=function(){var s,c;if(!(t<o)){if(s=n.apply(a,l),s===e.promise())throw new TypeError("Thenable self-resolution");c=s&&("object"===typeof s||"function"===typeof s)&&s.then,b(c)?i?c.call(s,r(o,e,_,i),r(o,e,G,i)):(o++,c.call(s,r(o,e,_,i),r(o,e,G,i),r(o,e,_,e.notifyWith))):(n!==_&&(a=void 0,l=[s]),(i||e.resolveWith)(a,l))}},h=i?c:function(){try{c()}catch(i){M.Deferred.exceptionHook&&M.Deferred.exceptionHook(i,h.stackTrace),t+1>=o&&(n!==G&&(a=void 0,l=[i]),e.rejectWith(a,l))}};t?h():(M.Deferred.getStackHook&&(h.stackTrace=M.Deferred.getStackHook()),s.setTimeout(h))}}return M.Deferred((function(s){e[0][3].add(r(0,s,b(i)?i:_,s.notifyWith)),e[1][3].add(r(0,s,b(t)?t:_)),e[2][3].add(r(0,s,b(n)?n:G))})).promise()},promise:function(t){return null!=t?M.extend(t,i):i}},o={};return M.each(e,(function(t,s){var r=s[2],a=s[5];i[s[1]]=r.add,a&&r.add((function(){n=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),r.add(s[3].fire),o[s[0]]=function(){return o[s[0]+"With"](this===o?void 0:this,arguments),this},o[s[0]+"With"]=r.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,i=Array(n),s=l.call(arguments),o=M.Deferred(),r=function(t){return function(n){i[t]=this,s[t]=arguments.length>1?l.call(arguments):n,--e||o.resolveWith(i,s)}};if(e<=1&&(H(t,o.done(r(n)).resolve,o.reject,!e),"pending"===o.state()||b(s[n]&&s[n].then)))return o.then();while(n--)H(s[n],r(n),o.reject);return o.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;M.Deferred.exceptionHook=function(t,e){s.console&&s.console.warn&&t&&U.test(t.name)&&s.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},M.readyException=function(t){s.setTimeout((function(){throw t}))};var W=M.Deferred();function q(){C.removeEventListener("DOMContentLoaded",q),s.removeEventListener("load",q),M.ready()}M.fn.ready=function(t){return W.then(t).catch((function(t){M.readyException(t)})),this},M.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--M.readyWait:M.isReady)||(M.isReady=!0,!0!==t&&--M.readyWait>0||W.resolveWith(C,[M]))}}),M.ready.then=W.then,"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?s.setTimeout(M.ready):(C.addEventListener("DOMContentLoaded",q),s.addEventListener("load",q));var Z=function(t,e,n,i,s,o,r){var a=0,l=t.length,c=null==n;if("object"===k(n))for(a in s=!0,n)Z(t,e,a,n[a],!0,o,r);else if(void 0!==i&&(s=!0,b(i)||(r=!0),c&&(r?(e.call(t,i),e=null):(c=e,e=function(t,e,n){return c.call(M(t),n)})),e))for(;a<l;a++)e(t[a],n,r?i:i.call(t[a],a,e(t[a],n)));return s?t:c?e.call(t):l?e(t[0],n):o},X=/^-ms-/,Y=/-([a-z])/g;function J(t,e){return e.toUpperCase()}function K(t){return t.replace(X,"ms-").replace(Y,J)}var Q=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function tt(){this.expando=M.expando+tt.uid++}tt.uid=1,tt.prototype={cache:function(t){var e=t[this.expando];return e||(e={},Q(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var i,s=this.cache(t);if("string"===typeof e)s[K(e)]=n;else for(i in e)s[K(i)]=e[i];return s},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][K(e)]},access:function(t,e,n){return void 0===e||e&&"string"===typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,i=t[this.expando];if(void 0!==i){if(void 0!==e){Array.isArray(e)?e=e.map(K):(e=K(e),e=e in i?[e]:e.match($)||[]),n=e.length;while(n--)delete i[e[n]]}(void 0===e||M.isEmptyObject(i))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!M.isEmptyObject(e)}};var et=new tt,nt=new tt,it=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,st=/[A-Z]/g;function ot(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:it.test(t)?JSON.parse(t):t)}function rt(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(st,"-$&").toLowerCase(),n=t.getAttribute(i),"string"===typeof n){try{n=ot(n)}catch(s){}nt.set(t,e,n)}else n=void 0;return n}M.extend({hasData:function(t){return nt.hasData(t)||et.hasData(t)},data:function(t,e,n){return nt.access(t,e,n)},removeData:function(t,e){nt.remove(t,e)},_data:function(t,e,n){return et.access(t,e,n)},_removeData:function(t,e){et.remove(t,e)}}),M.fn.extend({data:function(t,e){var n,i,s,o=this[0],r=o&&o.attributes;if(void 0===t){if(this.length&&(s=nt.get(o),1===o.nodeType&&!et.get(o,"hasDataAttrs"))){n=r.length;while(n--)r[n]&&(i=r[n].name,0===i.indexOf("data-")&&(i=K(i.slice(5)),rt(o,i,s[i])));et.set(o,"hasDataAttrs",!0)}return s}return"object"===typeof t?this.each((function(){nt.set(this,t)})):Z(this,(function(e){var n;if(o&&void 0===e)return n=nt.get(o,t),void 0!==n?n:(n=rt(o,t),void 0!==n?n:void 0);this.each((function(){nt.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){nt.remove(this,t)}))}}),M.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=et.get(t,e),n&&(!i||Array.isArray(n)?i=et.access(t,e,M.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=M.queue(t,e),i=n.length,s=n.shift(),o=M._queueHooks(t,e),r=function(){M.dequeue(t,e)};"inprogress"===s&&(s=n.shift(),i--),s&&("fx"===e&&n.unshift("inprogress"),delete o.stop,s.call(t,r,o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return et.get(t,n)||et.access(t,n,{empty:M.Callbacks("once memory").add((function(){et.remove(t,[e+"queue",n])}))})}}),M.fn.extend({queue:function(t,e){var n=2;return"string"!==typeof t&&(e=t,t="fx",n--),arguments.length<n?M.queue(this[0],t):void 0===e?this:this.each((function(){var n=M.queue(this,t,e);M._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&M.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){M.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,s=M.Deferred(),o=this,r=this.length,a=function(){--i||s.resolveWith(o,[o])};"string"!==typeof t&&(e=t,t=void 0),t=t||"fx";while(r--)n=et.get(o[r],t+"queueHooks"),n&&n.empty&&(i++,n.empty.add(a));return a(),s.promise(e)}});var at=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,lt=new RegExp("^(?:([+-])=|)("+at+")([a-z%]*)$","i"),ct=["Top","Right","Bottom","Left"],ht=C.documentElement,ut=function(t){return M.contains(t.ownerDocument,t)},dt={composed:!0};ht.getRootNode&&(ut=function(t){return M.contains(t.ownerDocument,t)||t.getRootNode(dt)===t.ownerDocument});var gt=function(t,e){return t=e||t,"none"===t.style.display||""===t.style.display&&ut(t)&&"none"===M.css(t,"display")};function pt(t,e,n,i){var s,o,r=20,a=i?function(){return i.cur()}:function(){return M.css(t,e,"")},l=a(),c=n&&n[3]||(M.cssNumber[e]?"":"px"),h=t.nodeType&&(M.cssNumber[e]||"px"!==c&&+l)&<.exec(M.css(t,e));if(h&&h[3]!==c){l/=2,c=c||h[3],h=+l||1;while(r--)M.style(t,e,h+c),(1-o)*(1-(o=a()/l||.5))<=0&&(r=0),h/=o;h*=2,M.style(t,e,h+c),n=n||[]}return n&&(h=+h||+l||0,s=n[1]?h+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=h,i.end=s)),s}var ft={};function mt(t){var e,n=t.ownerDocument,i=t.nodeName,s=ft[i];return s||(e=n.body.appendChild(n.createElement(i)),s=M.css(e,"display"),e.parentNode.removeChild(e),"none"===s&&(s="block"),ft[i]=s,s)}function yt(t,e){for(var n,i,s=[],o=0,r=t.length;o<r;o++)i=t[o],i.style&&(n=i.style.display,e?("none"===n&&(s[o]=et.get(i,"display")||null,s[o]||(i.style.display="")),""===i.style.display&>(i)&&(s[o]=mt(i))):"none"!==n&&(s[o]="none",et.set(i,"display",n)));for(o=0;o<r;o++)null!=s[o]&&(t[o].style.display=s[o]);return t}M.fn.extend({show:function(){return yt(this,!0)},hide:function(){return yt(this)},toggle:function(t){return"boolean"===typeof t?t?this.show():this.hide():this.each((function(){gt(this)?M(this).show():M(this).hide()}))}});var bt=/^(?:checkbox|radio)$/i,wt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ct=/^$|^module$|\/(?:java|ecma)script/i;(function(){var t=C.createDocumentFragment(),e=t.appendChild(C.createElement("div")),n=C.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),y.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,e.innerHTML="<option></option>",y.option=!!e.lastChild})();var vt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function xt(t,e){var n;return n="undefined"!==typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!==typeof t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&T(t,e)?M.merge([t],n):n}function kt(t,e){for(var n=0,i=t.length;n<i;n++)et.set(t[n],"globalEval",!e||et.get(e[n],"globalEval"))}vt.tbody=vt.tfoot=vt.colgroup=vt.caption=vt.thead,vt.th=vt.td,y.option||(vt.optgroup=vt.option=[1,"<select multiple='multiple'>","</select>"]);var Et=/<|&#?\w+;/;function Mt(t,e,n,i,s){for(var o,r,a,l,c,h,u=e.createDocumentFragment(),d=[],g=0,p=t.length;g<p;g++)if(o=t[g],o||0===o)if("object"===k(o))M.merge(d,o.nodeType?[o]:o);else if(Et.test(o)){r=r||u.appendChild(e.createElement("div")),a=(wt.exec(o)||["",""])[1].toLowerCase(),l=vt[a]||vt._default,r.innerHTML=l[1]+M.htmlPrefilter(o)+l[2],h=l[0];while(h--)r=r.lastChild;M.merge(d,r.childNodes),r=u.firstChild,r.textContent=""}else d.push(e.createTextNode(o));u.textContent="",g=0;while(o=d[g++])if(i&&M.inArray(o,i)>-1)s&&s.push(o);else if(c=ut(o),r=xt(u.appendChild(o),"script"),c&&kt(r),n){h=0;while(o=r[h++])Ct.test(o.type||"")&&n.push(o)}return u}var St=/^([^.]*)(?:\.(.+)|)/;function At(){return!0}function Dt(){return!1}function Pt(t,e){return t===Ot()===("focus"===e)}function Ot(){try{return C.activeElement}catch(t){}}function Tt(t,e,n,i,s,o){var r,a;if("object"===typeof e){for(a in"string"!==typeof n&&(i=i||n,n=void 0),e)Tt(t,a,n,i,e[a],o);return t}if(null==i&&null==s?(s=n,i=n=void 0):null==s&&("string"===typeof n?(s=i,i=void 0):(s=i,i=n,n=void 0)),!1===s)s=Dt;else if(!s)return t;return 1===o&&(r=s,s=function(t){return M().off(t),r.apply(this,arguments)},s.guid=r.guid||(r.guid=M.guid++)),t.each((function(){M.event.add(this,e,s,i,n)}))}function Nt(t,e,n){n?(et.set(t,e,!1),M.event.add(t,e,{namespace:!1,handler:function(t){var i,s,o=et.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(M.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=l.call(arguments),et.set(this,e,o),i=n(this,e),this[e](),s=et.get(this,e),o!==s||i?et.set(this,e,!1):s={},o!==s)return t.stopImmediatePropagation(),t.preventDefault(),s&&s.value}else o.length&&(et.set(this,e,{value:M.event.trigger(M.extend(o[0],M.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===et.get(t,e)&&M.event.add(t,e,At)}M.event={global:{},add:function(t,e,n,i,s){var o,r,a,l,c,h,u,d,g,p,f,m=et.get(t);if(Q(t)){n.handler&&(o=n,n=o.handler,s=o.selector),s&&M.find.matchesSelector(ht,s),n.guid||(n.guid=M.guid++),(l=m.events)||(l=m.events=Object.create(null)),(r=m.handle)||(r=m.handle=function(e){return"undefined"!==typeof M&&M.event.triggered!==e.type?M.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match($)||[""],c=e.length;while(c--)a=St.exec(e[c])||[],g=f=a[1],p=(a[2]||"").split(".").sort(),g&&(u=M.event.special[g]||{},g=(s?u.delegateType:u.bindType)||g,u=M.event.special[g]||{},h=M.extend({type:g,origType:f,data:i,handler:n,guid:n.guid,selector:s,needsContext:s&&M.expr.match.needsContext.test(s),namespace:p.join(".")},o),(d=l[g])||(d=l[g]=[],d.delegateCount=0,u.setup&&!1!==u.setup.call(t,i,p,r)||t.addEventListener&&t.addEventListener(g,r)),u.add&&(u.add.call(t,h),h.handler.guid||(h.handler.guid=n.guid)),s?d.splice(d.delegateCount++,0,h):d.push(h),M.event.global[g]=!0)}},remove:function(t,e,n,i,s){var o,r,a,l,c,h,u,d,g,p,f,m=et.hasData(t)&&et.get(t);if(m&&(l=m.events)){e=(e||"").match($)||[""],c=e.length;while(c--)if(a=St.exec(e[c])||[],g=f=a[1],p=(a[2]||"").split(".").sort(),g){u=M.event.special[g]||{},g=(i?u.delegateType:u.bindType)||g,d=l[g]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=o=d.length;while(o--)h=d[o],!s&&f!==h.origType||n&&n.guid!==h.guid||a&&!a.test(h.namespace)||i&&i!==h.selector&&("**"!==i||!h.selector)||(d.splice(o,1),h.selector&&d.delegateCount--,u.remove&&u.remove.call(t,h));r&&!d.length&&(u.teardown&&!1!==u.teardown.call(t,p,m.handle)||M.removeEvent(t,g,m.handle),delete l[g])}else for(g in l)M.event.remove(t,g+e[c],n,i,!0);M.isEmptyObject(l)&&et.remove(t,"handle events")}},dispatch:function(t){var e,n,i,s,o,r,a=new Array(arguments.length),l=M.event.fix(t),c=(et.get(this,"events")||Object.create(null))[l.type]||[],h=M.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,l)){r=M.event.handlers.call(this,l,c),e=0;while((s=r[e++])&&!l.isPropagationStopped()){l.currentTarget=s.elem,n=0;while((o=s.handlers[n++])&&!l.isImmediatePropagationStopped())l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,i=((M.event.special[o.origType]||{}).handle||o.handler).apply(s.elem,a),void 0!==i&&!1===(l.result=i)&&(l.preventDefault(),l.stopPropagation()))}return h.postDispatch&&h.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,i,s,o,r,a=[],l=e.delegateCount,c=t.target;if(l&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(o=[],r={},n=0;n<l;n++)i=e[n],s=i.selector+" ",void 0===r[s]&&(r[s]=i.needsContext?M(s,this).index(c)>-1:M.find(s,this,null,[c]).length),r[s]&&o.push(i);o.length&&a.push({elem:c,handlers:o})}return c=this,l<e.length&&a.push({elem:c,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(M.Event.prototype,t,{enumerable:!0,configurable:!0,get:b(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[M.expando]?t:new M.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return bt.test(e.type)&&e.click&&T(e,"input")&&Nt(e,"click",At),!1},trigger:function(t){var e=this||t;return bt.test(e.type)&&e.click&&T(e,"input")&&Nt(e,"click"),!0},_default:function(t){var e=t.target;return bt.test(e.type)&&e.click&&T(e,"input")&&et.get(e,"click")||T(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},M.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},M.Event=function(t,e){if(!(this instanceof M.Event))return new M.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?At:Dt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&M.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[M.expando]=!0},M.Event.prototype={constructor:M.Event,isDefaultPrevented:Dt,isPropagationStopped:Dt,isImmediatePropagationStopped:Dt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=At,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=At,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=At,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},M.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},M.event.addProp),M.each({focus:"focusin",blur:"focusout"},(function(t,e){M.event.special[t]={setup:function(){return Nt(this,t,Pt),!1},trigger:function(){return Nt(this,t),!0},_default:function(){return!0},delegateType:e}})),M.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){M.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=this,s=t.relatedTarget,o=t.handleObj;return s&&(s===i||M.contains(i,s))||(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}})),M.fn.extend({on:function(t,e,n,i){return Tt(this,t,e,n,i)},one:function(t,e,n,i){return Tt(this,t,e,n,i,1)},off:function(t,e,n){var i,s;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,M(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"===typeof t){for(s in t)this.off(s,e,t[s]);return this}return!1!==e&&"function"!==typeof e||(n=e,e=void 0),!1===n&&(n=Dt),this.each((function(){M.event.remove(this,t,n,e)}))}});var jt=/<script|<style|<link/i,Ft=/checked\s*(?:[^=]|=\s*.checked.)/i,Lt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function zt(t,e){return T(t,"table")&&T(11!==e.nodeType?e:e.firstChild,"tr")&&M(t).children("tbody")[0]||t}function It(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Bt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Rt(t,e){var n,i,s,o,r,a,l;if(1===e.nodeType){if(et.hasData(t)&&(o=et.get(t),l=o.events,l))for(s in et.remove(e,"handle events"),l)for(n=0,i=l[s].length;n<i;n++)M.event.add(e,s,l[s][n]);nt.hasData(t)&&(r=nt.access(t),a=M.extend({},r),nt.set(e,a))}}function $t(t,e){var n=e.nodeName.toLowerCase();"input"===n&&bt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function Vt(t,e,n,i){e=c(e);var s,o,r,a,l,h,u=0,d=t.length,g=d-1,p=e[0],f=b(p);if(f||d>1&&"string"===typeof p&&!y.checkClone&&Ft.test(p))return t.each((function(s){var o=t.eq(s);f&&(e[0]=p.call(this,s,o.html())),Vt(o,e,n,i)}));if(d&&(s=Mt(e,t[0].ownerDocument,!1,t,i),o=s.firstChild,1===s.childNodes.length&&(s=o),o||i)){for(r=M.map(xt(s,"script"),It),a=r.length;u<d;u++)l=s,u!==g&&(l=M.clone(l,!0,!0),a&&M.merge(r,xt(l,"script"))),n.call(t[u],l,u);if(a)for(h=r[r.length-1].ownerDocument,M.map(r,Bt),u=0;u<a;u++)l=r[u],Ct.test(l.type||"")&&!et.access(l,"globalEval")&&M.contains(h,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?M._evalUrl&&!l.noModule&&M._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},h):x(l.textContent.replace(Lt,""),l,h))}return t}function _t(t,e,n){for(var i,s=e?M.filter(e,t):t,o=0;null!=(i=s[o]);o++)n||1!==i.nodeType||M.cleanData(xt(i)),i.parentNode&&(n&&ut(i)&&kt(xt(i,"script")),i.parentNode.removeChild(i));return t}M.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var i,s,o,r,a=t.cloneNode(!0),l=ut(t);if(!y.noCloneChecked&&(1===t.nodeType||11===t.nodeType)&&!M.isXMLDoc(t))for(r=xt(a),o=xt(t),i=0,s=o.length;i<s;i++)$t(o[i],r[i]);if(e)if(n)for(o=o||xt(t),r=r||xt(a),i=0,s=o.length;i<s;i++)Rt(o[i],r[i]);else Rt(t,a);return r=xt(a,"script"),r.length>0&&kt(r,!l&&xt(t,"script")),a},cleanData:function(t){for(var e,n,i,s=M.event.special,o=0;void 0!==(n=t[o]);o++)if(Q(n)){if(e=n[et.expando]){if(e.events)for(i in e.events)s[i]?M.event.remove(n,i):M.removeEvent(n,i,e.handle);n[et.expando]=void 0}n[nt.expando]&&(n[nt.expando]=void 0)}}}),M.fn.extend({detach:function(t){return _t(this,t,!0)},remove:function(t){return _t(this,t)},text:function(t){return Z(this,(function(t){return void 0===t?M.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Vt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=zt(this,t);e.appendChild(t)}}))},prepend:function(){return Vt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=zt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Vt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Vt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(M.cleanData(xt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return M.clone(this,t,e)}))},html:function(t){return Z(this,(function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"===typeof t&&!jt.test(t)&&!vt[(wt.exec(t)||["",""])[1].toLowerCase()]){t=M.htmlPrefilter(t);try{for(;n<i;n++)e=this[n]||{},1===e.nodeType&&(M.cleanData(xt(e,!1)),e.innerHTML=t);e=0}catch(s){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Vt(this,arguments,(function(e){var n=this.parentNode;M.inArray(this,t)<0&&(M.cleanData(xt(this)),n&&n.replaceChild(e,this))}),t)}}),M.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){M.fn[t]=function(t){for(var n,i=[],s=M(t),o=s.length-1,r=0;r<=o;r++)n=r===o?this:this.clone(!0),M(s[r])[e](n),h.apply(i,n.get());return this.pushStack(i)}}));var Gt=new RegExp("^("+at+")(?!px)[a-z%]+$","i"),Ht=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=s),e.getComputedStyle(t)},Ut=function(t,e,n){var i,s,o={};for(s in e)o[s]=t.style[s],t.style[s]=e[s];for(s in i=n.call(t),e)t.style[s]=o[s];return i},Wt=new RegExp(ct.join("|"),"i");function qt(t,e,n){var i,s,o,r,a=t.style;return n=n||Ht(t),n&&(r=n.getPropertyValue(e)||n[e],""!==r||ut(t)||(r=M.style(t,e)),!y.pixelBoxStyles()&&Gt.test(r)&&Wt.test(e)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=n.width,a.width=i,a.minWidth=s,a.maxWidth=o)),void 0!==r?r+"":r}function Zt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}(function(){function t(){if(h){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",h.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ht.appendChild(c).appendChild(h);var t=s.getComputedStyle(h);n="1%"!==t.top,l=12===e(t.marginLeft),h.style.right="60%",r=36===e(t.right),i=36===e(t.width),h.style.position="absolute",o=12===e(h.offsetWidth/3),ht.removeChild(c),h=null}}function e(t){return Math.round(parseFloat(t))}var n,i,o,r,a,l,c=C.createElement("div"),h=C.createElement("div");h.style&&(h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===h.style.backgroundClip,M.extend(y,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),r},pixelPosition:function(){return t(),n},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,e,n,i;return null==a&&(t=C.createElement("table"),e=C.createElement("tr"),n=C.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="border:1px solid",e.style.height="1px",n.style.height="9px",n.style.display="block",ht.appendChild(t).appendChild(e).appendChild(n),i=s.getComputedStyle(e),a=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===e.offsetHeight,ht.removeChild(t)),a}}))})();var Xt=["Webkit","Moz","ms"],Yt=C.createElement("div").style,Jt={};function Kt(t){var e=t[0].toUpperCase()+t.slice(1),n=Xt.length;while(n--)if(t=Xt[n]+e,t in Yt)return t}function Qt(t){var e=M.cssProps[t]||Jt[t];return e||(t in Yt?t:Jt[t]=Kt(t)||t)}var te=/^(none|table(?!-c[ea]).+)/,ee=/^--/,ne={position:"absolute",visibility:"hidden",display:"block"},ie={letterSpacing:"0",fontWeight:"400"};function se(t,e,n){var i=lt.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function oe(t,e,n,i,s,o){var r="width"===e?1:0,a=0,l=0;if(n===(i?"border":"content"))return 0;for(;r<4;r+=2)"margin"===n&&(l+=M.css(t,n+ct[r],!0,s)),i?("content"===n&&(l-=M.css(t,"padding"+ct[r],!0,s)),"margin"!==n&&(l-=M.css(t,"border"+ct[r]+"Width",!0,s))):(l+=M.css(t,"padding"+ct[r],!0,s),"padding"!==n?l+=M.css(t,"border"+ct[r]+"Width",!0,s):a+=M.css(t,"border"+ct[r]+"Width",!0,s));return!i&&o>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-a-.5))||0),l}function re(t,e,n){var i=Ht(t),s=!y.boxSizingReliable()||n,o=s&&"border-box"===M.css(t,"boxSizing",!1,i),r=o,a=qt(t,e,i),l="offset"+e[0].toUpperCase()+e.slice(1);if(Gt.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&o||!y.reliableTrDimensions()&&T(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===M.css(t,"display",!1,i))&&t.getClientRects().length&&(o="border-box"===M.css(t,"boxSizing",!1,i),r=l in t,r&&(a=t[l])),a=parseFloat(a)||0,a+oe(t,e,n||(o?"border":"content"),r,i,a)+"px"}function ae(t,e,n,i,s){return new ae.prototype.init(t,e,n,i,s)}M.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=qt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var s,o,r,a=K(e),l=ee.test(e),c=t.style;if(l||(e=Qt(a)),r=M.cssHooks[e]||M.cssHooks[a],void 0===n)return r&&"get"in r&&void 0!==(s=r.get(t,!1,i))?s:c[e];o=typeof n,"string"===o&&(s=lt.exec(n))&&s[1]&&(n=pt(t,e,s),o="number"),null!=n&&n===n&&("number"!==o||l||(n+=s&&s[3]||(M.cssNumber[a]?"":"px")),y.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),r&&"set"in r&&void 0===(n=r.set(t,n,i))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,i){var s,o,r,a=K(e),l=ee.test(e);return l||(e=Qt(a)),r=M.cssHooks[e]||M.cssHooks[a],r&&"get"in r&&(s=r.get(t,!0,n)),void 0===s&&(s=qt(t,e,i)),"normal"===s&&e in ie&&(s=ie[e]),""===n||n?(o=parseFloat(s),!0===n||isFinite(o)?o||0:s):s}}),M.each(["height","width"],(function(t,e){M.cssHooks[e]={get:function(t,n,i){if(n)return!te.test(M.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?re(t,e,i):Ut(t,ne,(function(){return re(t,e,i)}))},set:function(t,n,i){var s,o=Ht(t),r=!y.scrollboxSize()&&"absolute"===o.position,a=r||i,l=a&&"border-box"===M.css(t,"boxSizing",!1,o),c=i?oe(t,e,i,l,o):0;return l&&r&&(c-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-oe(t,e,"border",!1,o)-.5)),c&&(s=lt.exec(n))&&"px"!==(s[3]||"px")&&(t.style[e]=n,n=M.css(t,e)),se(t,n,c)}}})),M.cssHooks.marginLeft=Zt(y.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(qt(t,"marginLeft"))||t.getBoundingClientRect().left-Ut(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),M.each({margin:"",padding:"",border:"Width"},(function(t,e){M.cssHooks[t+e]={expand:function(n){for(var i=0,s={},o="string"===typeof n?n.split(" "):[n];i<4;i++)s[t+ct[i]+e]=o[i]||o[i-2]||o[0];return s}},"margin"!==t&&(M.cssHooks[t+e].set=se)})),M.fn.extend({css:function(t,e){return Z(this,(function(t,e,n){var i,s,o={},r=0;if(Array.isArray(e)){for(i=Ht(t),s=e.length;r<s;r++)o[e[r]]=M.css(t,e[r],!1,i);return o}return void 0!==n?M.style(t,e,n):M.css(t,e)}),t,e,arguments.length>1)}}),M.Tween=ae,ae.prototype={constructor:ae,init:function(t,e,n,i,s,o){this.elem=t,this.prop=n,this.easing=s||M.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(M.cssNumber[n]?"":"px")},cur:function(){var t=ae.propHooks[this.prop];return t&&t.get?t.get(this):ae.propHooks._default.get(this)},run:function(t){var e,n=ae.propHooks[this.prop];return this.options.duration?this.pos=e=M.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ae.propHooks._default.set(this),this}},ae.prototype.init.prototype=ae.prototype,ae.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=M.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){M.fx.step[t.prop]?M.fx.step[t.prop](t):1!==t.elem.nodeType||!M.cssHooks[t.prop]&&null==t.elem.style[Qt(t.prop)]?t.elem[t.prop]=t.now:M.style(t.elem,t.prop,t.now+t.unit)}}},ae.propHooks.scrollTop=ae.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},M.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},M.fx=ae.prototype.init,M.fx.step={};var le,ce,he=/^(?:toggle|show|hide)$/,ue=/queueHooks$/;function de(){ce&&(!1===C.hidden&&s.requestAnimationFrame?s.requestAnimationFrame(de):s.setTimeout(de,M.fx.interval),M.fx.tick())}function ge(){return s.setTimeout((function(){le=void 0})),le=Date.now()}function pe(t,e){var n,i=0,s={height:t};for(e=e?1:0;i<4;i+=2-e)n=ct[i],s["margin"+n]=s["padding"+n]=t;return e&&(s.opacity=s.width=t),s}function fe(t,e,n){for(var i,s=(be.tweeners[e]||[]).concat(be.tweeners["*"]),o=0,r=s.length;o<r;o++)if(i=s[o].call(n,e,t))return i}function me(t,e,n){var i,s,o,r,a,l,c,h,u="width"in e||"height"in e,d=this,g={},p=t.style,f=t.nodeType&>(t),m=et.get(t,"fxshow");for(i in n.queue||(r=M._queueHooks(t,"fx"),null==r.unqueued&&(r.unqueued=0,a=r.empty.fire,r.empty.fire=function(){r.unqueued||a()}),r.unqueued++,d.always((function(){d.always((function(){r.unqueued--,M.queue(t,"fx").length||r.empty.fire()}))}))),e)if(s=e[i],he.test(s)){if(delete e[i],o=o||"toggle"===s,s===(f?"hide":"show")){if("show"!==s||!m||void 0===m[i])continue;f=!0}g[i]=m&&m[i]||M.style(t,i)}if(l=!M.isEmptyObject(e),l||!M.isEmptyObject(g))for(i in u&&1===t.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],c=m&&m.display,null==c&&(c=et.get(t,"display")),h=M.css(t,"display"),"none"===h&&(c?h=c:(yt([t],!0),c=t.style.display||c,h=M.css(t,"display"),yt([t]))),("inline"===h||"inline-block"===h&&null!=c)&&"none"===M.css(t,"float")&&(l||(d.done((function(){p.display=c})),null==c&&(h=p.display,c="none"===h?"":h)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",d.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),l=!1,g)l||(m?"hidden"in m&&(f=m.hidden):m=et.access(t,"fxshow",{display:c}),o&&(m.hidden=!f),f&&yt([t],!0),d.done((function(){for(i in f||yt([t]),et.remove(t,"fxshow"),g)M.style(t,i,g[i])}))),l=fe(f?m[i]:0,i,d),i in m||(m[i]=l.start,f&&(l.end=l.start,l.start=0))}function ye(t,e){var n,i,s,o,r;for(n in t)if(i=K(n),s=e[i],o=t[n],Array.isArray(o)&&(s=o[1],o=t[n]=o[0]),n!==i&&(t[i]=o,delete t[n]),r=M.cssHooks[i],r&&"expand"in r)for(n in o=r.expand(o),delete t[i],o)n in t||(t[n]=o[n],e[n]=s);else e[i]=s}function be(t,e,n){var i,s,o=0,r=be.prefilters.length,a=M.Deferred().always((function(){delete l.elem})),l=function(){if(s)return!1;for(var e=le||ge(),n=Math.max(0,c.startTime+c.duration-e),i=n/c.duration||0,o=1-i,r=0,l=c.tweens.length;r<l;r++)c.tweens[r].run(o);return a.notifyWith(t,[c,o,n]),o<1&&l?n:(l||a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c]),!1)},c=a.promise({elem:t,props:M.extend({},e),opts:M.extend(!0,{specialEasing:{},easing:M.easing._default},n),originalProperties:e,originalOptions:n,startTime:le||ge(),duration:n.duration,tweens:[],createTween:function(e,n){var i=M.Tween(t,c.opts,e,n,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(i),i},stop:function(e){var n=0,i=e?c.tweens.length:0;if(s)return this;for(s=!0;n<i;n++)c.tweens[n].run(1);return e?(a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c,e])):a.rejectWith(t,[c,e]),this}}),h=c.props;for(ye(h,c.opts.specialEasing);o<r;o++)if(i=be.prefilters[o].call(c,t,h,c.opts),i)return b(i.stop)&&(M._queueHooks(c.elem,c.opts.queue).stop=i.stop.bind(i)),i;return M.map(h,fe,c),b(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),M.fx.timer(M.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}M.Animation=M.extend(be,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return pt(n.elem,t,lt.exec(e),n),n}]},tweener:function(t,e){b(t)?(e=t,t=["*"]):t=t.match($);for(var n,i=0,s=t.length;i<s;i++)n=t[i],be.tweeners[n]=be.tweeners[n]||[],be.tweeners[n].unshift(e)},prefilters:[me],prefilter:function(t,e){e?be.prefilters.unshift(t):be.prefilters.push(t)}}),M.speed=function(t,e,n){var i=t&&"object"===typeof t?M.extend({},t):{complete:n||!n&&e||b(t)&&t,duration:t,easing:n&&e||e&&!b(e)&&e};return M.fx.off?i.duration=0:"number"!==typeof i.duration&&(i.duration in M.fx.speeds?i.duration=M.fx.speeds[i.duration]:i.duration=M.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){b(i.old)&&i.old.call(this),i.queue&&M.dequeue(this,i.queue)},i},M.fn.extend({fadeTo:function(t,e,n,i){return this.filter(gt).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var s=M.isEmptyObject(t),o=M.speed(e,n,i),r=function(){var e=be(this,M.extend({},t),o);(s||et.get(this,"finish"))&&e.stop(!0)};return r.finish=r,s||!1===o.queue?this.each(r):this.queue(o.queue,r)},stop:function(t,e,n){var i=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!==typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,s=null!=t&&t+"queueHooks",o=M.timers,r=et.get(this);if(s)r[s]&&r[s].stop&&i(r[s]);else for(s in r)r[s]&&r[s].stop&&ue.test(s)&&i(r[s]);for(s=o.length;s--;)o[s].elem!==this||null!=t&&o[s].queue!==t||(o[s].anim.stop(n),e=!1,o.splice(s,1));!e&&n||M.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=et.get(this),i=n[t+"queue"],s=n[t+"queueHooks"],o=M.timers,r=i?i.length:0;for(n.finish=!0,M.queue(this,t,[]),s&&s.stop&&s.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<r;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish}))}}),M.each(["toggle","show","hide"],(function(t,e){var n=M.fn[e];M.fn[e]=function(t,i,s){return null==t||"boolean"===typeof t?n.apply(this,arguments):this.animate(pe(e,!0),t,i,s)}})),M.each({slideDown:pe("show"),slideUp:pe("hide"),slideToggle:pe("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){M.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),M.timers=[],M.fx.tick=function(){var t,e=0,n=M.timers;for(le=Date.now();e<n.length;e++)t=n[e],t()||n[e]!==t||n.splice(e--,1);n.length||M.fx.stop(),le=void 0},M.fx.timer=function(t){M.timers.push(t),M.fx.start()},M.fx.interval=13,M.fx.start=function(){ce||(ce=!0,de())},M.fx.stop=function(){ce=null},M.fx.speeds={slow:600,fast:200,_default:400},M.fn.delay=function(t,e){return t=M.fx&&M.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,n){var i=s.setTimeout(e,t);n.stop=function(){s.clearTimeout(i)}}))},function(){var t=C.createElement("input"),e=C.createElement("select"),n=e.appendChild(C.createElement("option"));t.type="checkbox",y.checkOn=""!==t.value,y.optSelected=n.selected,t=C.createElement("input"),t.value="t",t.type="radio",y.radioValue="t"===t.value}();var we,Ce=M.expr.attrHandle;M.fn.extend({attr:function(t,e){return Z(this,M.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){M.removeAttr(this,t)}))}}),M.extend({attr:function(t,e,n){var i,s,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"===typeof t.getAttribute?M.prop(t,e,n):(1===o&&M.isXMLDoc(t)||(s=M.attrHooks[e.toLowerCase()]||(M.expr.match.bool.test(e)?we:void 0)),void 0!==n?null===n?void M.removeAttr(t,e):s&&"set"in s&&void 0!==(i=s.set(t,n,e))?i:(t.setAttribute(e,n+""),n):s&&"get"in s&&null!==(i=s.get(t,e))?i:(i=M.find.attr(t,e),null==i?void 0:i))},attrHooks:{type:{set:function(t,e){if(!y.radioValue&&"radio"===e&&T(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,s=e&&e.match($);if(s&&1===t.nodeType)while(n=s[i++])t.removeAttribute(n)}}),we={set:function(t,e,n){return!1===e?M.removeAttr(t,n):t.setAttribute(n,n),n}},M.each(M.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=Ce[e]||M.find.attr;Ce[e]=function(t,e,i){var s,o,r=e.toLowerCase();return i||(o=Ce[r],Ce[r]=s,s=null!=n(t,e,i)?r:null,Ce[r]=o),s}}));var ve=/^(?:input|select|textarea|button)$/i,xe=/^(?:a|area)$/i;function ke(t){var e=t.match($)||[];return e.join(" ")}function Ee(t){return t.getAttribute&&t.getAttribute("class")||""}function Me(t){return Array.isArray(t)?t:"string"===typeof t&&t.match($)||[]}M.fn.extend({prop:function(t,e){return Z(this,M.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[M.propFix[t]||t]}))}}),M.extend({prop:function(t,e,n){var i,s,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&M.isXMLDoc(t)||(e=M.propFix[e]||e,s=M.propHooks[e]),void 0!==n?s&&"set"in s&&void 0!==(i=s.set(t,n,e))?i:t[e]=n:s&&"get"in s&&null!==(i=s.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=M.find.attr(t,"tabindex");return e?parseInt(e,10):ve.test(t.nodeName)||xe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),y.optSelected||(M.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),M.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){M.propFix[this.toLowerCase()]=this})),M.fn.extend({addClass:function(t){var e,n,i,s,o,r,a,l=0;if(b(t))return this.each((function(e){M(this).addClass(t.call(this,e,Ee(this)))}));if(e=Me(t),e.length)while(n=this[l++])if(s=Ee(n),i=1===n.nodeType&&" "+ke(s)+" ",i){r=0;while(o=e[r++])i.indexOf(" "+o+" ")<0&&(i+=o+" ");a=ke(i),s!==a&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,s,o,r,a,l=0;if(b(t))return this.each((function(e){M(this).removeClass(t.call(this,e,Ee(this)))}));if(!arguments.length)return this.attr("class","");if(e=Me(t),e.length)while(n=this[l++])if(s=Ee(n),i=1===n.nodeType&&" "+ke(s)+" ",i){r=0;while(o=e[r++])while(i.indexOf(" "+o+" ")>-1)i=i.replace(" "+o+" "," ");a=ke(i),s!==a&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t,i="string"===n||Array.isArray(t);return"boolean"===typeof e&&i?e?this.addClass(t):this.removeClass(t):b(t)?this.each((function(n){M(this).toggleClass(t.call(this,n,Ee(this),e),e)})):this.each((function(){var e,s,o,r;if(i){s=0,o=M(this),r=Me(t);while(e=r[s++])o.hasClass(e)?o.removeClass(e):o.addClass(e)}else void 0!==t&&"boolean"!==n||(e=Ee(this),e&&et.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":et.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,i=0;e=" "+t+" ";while(n=this[i++])if(1===n.nodeType&&(" "+ke(Ee(n))+" ").indexOf(e)>-1)return!0;return!1}});var Se=/\r/g;M.fn.extend({val:function(t){var e,n,i,s=this[0];return arguments.length?(i=b(t),this.each((function(n){var s;1===this.nodeType&&(s=i?t.call(this,n,M(this).val()):t,null==s?s="":"number"===typeof s?s+="":Array.isArray(s)&&(s=M.map(s,(function(t){return null==t?"":t+""}))),e=M.valHooks[this.type]||M.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,s,"value")||(this.value=s))}))):s?(e=M.valHooks[s.type]||M.valHooks[s.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(n=e.get(s,"value"))?n:(n=s.value,"string"===typeof n?n.replace(Se,""):null==n?"":n)):void 0}}),M.extend({valHooks:{option:{get:function(t){var e=M.find.attr(t,"value");return null!=e?e:ke(M.text(t))}},select:{get:function(t){var e,n,i,s=t.options,o=t.selectedIndex,r="select-one"===t.type,a=r?null:[],l=r?o+1:s.length;for(i=o<0?l:r?o:0;i<l;i++)if(n=s[i],(n.selected||i===o)&&!n.disabled&&(!n.parentNode.disabled||!T(n.parentNode,"optgroup"))){if(e=M(n).val(),r)return e;a.push(e)}return a},set:function(t,e){var n,i,s=t.options,o=M.makeArray(e),r=s.length;while(r--)i=s[r],(i.selected=M.inArray(M.valHooks.option.get(i),o)>-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),M.each(["radio","checkbox"],(function(){M.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=M.inArray(M(t).val(),e)>-1}},y.checkOn||(M.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),y.focusin="onfocusin"in s;var Ae=/^(?:focusinfocus|focusoutblur)$/,De=function(t){t.stopPropagation()};M.extend(M.event,{trigger:function(t,e,n,i){var o,r,a,l,c,h,u,d,g=[n||C],f=p.call(t,"type")?t.type:t,m=p.call(t,"namespace")?t.namespace.split("."):[];if(r=d=a=n=n||C,3!==n.nodeType&&8!==n.nodeType&&!Ae.test(f+M.event.triggered)&&(f.indexOf(".")>-1&&(m=f.split("."),f=m.shift(),m.sort()),c=f.indexOf(":")<0&&"on"+f,t=t[M.expando]?t:new M.Event(f,"object"===typeof t&&t),t.isTrigger=i?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:M.makeArray(e,[t]),u=M.event.special[f]||{},i||!u.trigger||!1!==u.trigger.apply(n,e))){if(!i&&!u.noBubble&&!w(n)){for(l=u.delegateType||f,Ae.test(l+f)||(r=r.parentNode);r;r=r.parentNode)g.push(r),a=r;a===(n.ownerDocument||C)&&g.push(a.defaultView||a.parentWindow||s)}o=0;while((r=g[o++])&&!t.isPropagationStopped())d=r,t.type=o>1?l:u.bindType||f,h=(et.get(r,"events")||Object.create(null))[t.type]&&et.get(r,"handle"),h&&h.apply(r,e),h=c&&r[c],h&&h.apply&&Q(r)&&(t.result=h.apply(r,e),!1===t.result&&t.preventDefault());return t.type=f,i||t.isDefaultPrevented()||u._default&&!1!==u._default.apply(g.pop(),e)||!Q(n)||c&&b(n[f])&&!w(n)&&(a=n[c],a&&(n[c]=null),M.event.triggered=f,t.isPropagationStopped()&&d.addEventListener(f,De),n[f](),t.isPropagationStopped()&&d.removeEventListener(f,De),M.event.triggered=void 0,a&&(n[c]=a)),t.result}},simulate:function(t,e,n){var i=M.extend(new M.Event,n,{type:t,isSimulated:!0});M.event.trigger(i,null,e)}}),M.fn.extend({trigger:function(t,e){return this.each((function(){M.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return M.event.trigger(t,e,n,!0)}}),y.focusin||M.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){M.event.simulate(e,t.target,M.event.fix(t))};M.event.special[e]={setup:function(){var i=this.ownerDocument||this.document||this,s=et.access(i,e);s||i.addEventListener(t,n,!0),et.access(i,e,(s||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,s=et.access(i,e)-1;s?et.access(i,e,s):(i.removeEventListener(t,n,!0),et.remove(i,e))}}}));var Pe=s.location,Oe={guid:Date.now()},Te=/\?/;M.parseXML=function(t){var e,n;if(!t||"string"!==typeof t)return null;try{e=(new s.DOMParser).parseFromString(t,"text/xml")}catch(i){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||M.error("Invalid XML: "+(n?M.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Ne=/\[\]$/,je=/\r?\n/g,Fe=/^(?:submit|button|image|reset|file)$/i,Le=/^(?:input|select|textarea|keygen)/i;function ze(t,e,n,i){var s;if(Array.isArray(e))M.each(e,(function(e,s){n||Ne.test(t)?i(t,s):ze(t+"["+("object"===typeof s&&null!=s?e:"")+"]",s,n,i)}));else if(n||"object"!==k(e))i(t,e);else for(s in e)ze(t+"["+s+"]",e[s],n,i)}M.param=function(t,e){var n,i=[],s=function(t,e){var n=b(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!M.isPlainObject(t))M.each(t,(function(){s(this.name,this.value)}));else for(n in t)ze(n,t[n],e,s);return i.join("&")},M.fn.extend({serialize:function(){return M.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=M.prop(this,"elements");return t?M.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!M(this).is(":disabled")&&Le.test(this.nodeName)&&!Fe.test(t)&&(this.checked||!bt.test(t))})).map((function(t,e){var n=M(this).val();return null==n?null:Array.isArray(n)?M.map(n,(function(t){return{name:e.name,value:t.replace(je,"\r\n")}})):{name:e.name,value:n.replace(je,"\r\n")}})).get()}});var Ie=/%20/g,Be=/#.*$/,Re=/([?&])_=[^&]*/,$e=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ve=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,_e=/^(?:GET|HEAD)$/,Ge=/^\/\//,He={},Ue={},We="*/".concat("*"),qe=C.createElement("a");function Ze(t){return function(e,n){"string"!==typeof e&&(n=e,e="*");var i,s=0,o=e.toLowerCase().match($)||[];if(b(n))while(i=o[s++])"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Xe(t,e,n,i){var s={},o=t===Ue;function r(a){var l;return s[a]=!0,M.each(t[a]||[],(function(t,a){var c=a(e,n,i);return"string"!==typeof c||o||s[c]?o?!(l=c):void 0:(e.dataTypes.unshift(c),r(c),!1)})),l}return r(e.dataTypes[0])||!s["*"]&&r("*")}function Ye(t,e){var n,i,s=M.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((s[n]?t:i||(i={}))[n]=e[n]);return i&&M.extend(!0,t,i),t}function Je(t,e,n){var i,s,o,r,a=t.contents,l=t.dataTypes;while("*"===l[0])l.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){l.unshift(s);break}if(l[0]in n)o=l[0];else{for(s in n){if(!l[0]||t.converters[s+" "+l[0]]){o=s;break}r||(r=s)}o=o||r}if(o)return o!==l[0]&&l.unshift(o),n[o]}function Ke(t,e,n,i){var s,o,r,a,l,c={},h=t.dataTypes.slice();if(h[1])for(r in t.converters)c[r.toLowerCase()]=t.converters[r];o=h.shift();while(o)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=h.shift(),o)if("*"===o)o=l;else if("*"!==l&&l!==o){if(r=c[l+" "+o]||c["* "+o],!r)for(s in c)if(a=s.split(" "),a[1]===o&&(r=c[l+" "+a[0]]||c["* "+a[0]],r)){!0===r?r=c[s]:!0!==c[s]&&(o=a[0],h.unshift(a[1]));break}if(!0!==r)if(r&&t.throws)e=r(e);else try{e=r(e)}catch(u){return{state:"parsererror",error:r?u:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}qe.href=Pe.href,M.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Pe.href,type:"GET",isLocal:Ve.test(Pe.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":We,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":M.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ye(Ye(t,M.ajaxSettings),e):Ye(M.ajaxSettings,t)},ajaxPrefilter:Ze(He),ajaxTransport:Ze(Ue),ajax:function(t,e){"object"===typeof t&&(e=t,t=void 0),e=e||{};var n,i,o,r,a,l,c,h,u,d,g=M.ajaxSetup({},e),p=g.context||g,f=g.context&&(p.nodeType||p.jquery)?M(p):M.event,m=M.Deferred(),y=M.Callbacks("once memory"),b=g.statusCode||{},w={},v={},x="canceled",k={readyState:0,getResponseHeader:function(t){var e;if(c){if(!r){r={};while(e=$e.exec(o))r[e[1].toLowerCase()+" "]=(r[e[1].toLowerCase()+" "]||[]).concat(e[2])}e=r[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(t,e){return null==c&&(t=v[t.toLowerCase()]=v[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(g.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)k.always(t[k.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||x;return n&&n.abort(e),E(0,e),this}};if(m.promise(k),g.url=((t||g.url||Pe.href)+"").replace(Ge,Pe.protocol+"//"),g.type=e.method||e.type||g.method||g.type,g.dataTypes=(g.dataType||"*").toLowerCase().match($)||[""],null==g.crossDomain){l=C.createElement("a");try{l.href=g.url,l.href=l.href,g.crossDomain=qe.protocol+"//"+qe.host!==l.protocol+"//"+l.host}catch(S){g.crossDomain=!0}}if(g.data&&g.processData&&"string"!==typeof g.data&&(g.data=M.param(g.data,g.traditional)),Xe(He,g,e,k),c)return k;for(u in h=M.event&&g.global,h&&0===M.active++&&M.event.trigger("ajaxStart"),g.type=g.type.toUpperCase(),g.hasContent=!_e.test(g.type),i=g.url.replace(Be,""),g.hasContent?g.data&&g.processData&&0===(g.contentType||"").indexOf("application/x-www-form-urlencoded")&&(g.data=g.data.replace(Ie,"+")):(d=g.url.slice(i.length),g.data&&(g.processData||"string"===typeof g.data)&&(i+=(Te.test(i)?"&":"?")+g.data,delete g.data),!1===g.cache&&(i=i.replace(Re,"$1"),d=(Te.test(i)?"&":"?")+"_="+Oe.guid+++d),g.url=i+d),g.ifModified&&(M.lastModified[i]&&k.setRequestHeader("If-Modified-Since",M.lastModified[i]),M.etag[i]&&k.setRequestHeader("If-None-Match",M.etag[i])),(g.data&&g.hasContent&&!1!==g.contentType||e.contentType)&&k.setRequestHeader("Content-Type",g.contentType),k.setRequestHeader("Accept",g.dataTypes[0]&&g.accepts[g.dataTypes[0]]?g.accepts[g.dataTypes[0]]+("*"!==g.dataTypes[0]?", "+We+"; q=0.01":""):g.accepts["*"]),g.headers)k.setRequestHeader(u,g.headers[u]);if(g.beforeSend&&(!1===g.beforeSend.call(p,k,g)||c))return k.abort();if(x="abort",y.add(g.complete),k.done(g.success),k.fail(g.error),n=Xe(Ue,g,e,k),n){if(k.readyState=1,h&&f.trigger("ajaxSend",[k,g]),c)return k;g.async&&g.timeout>0&&(a=s.setTimeout((function(){k.abort("timeout")}),g.timeout));try{c=!1,n.send(w,E)}catch(S){if(c)throw S;E(-1,S)}}else E(-1,"No Transport");function E(t,e,r,l){var u,d,w,C,v,x=e;c||(c=!0,a&&s.clearTimeout(a),n=void 0,o=l||"",k.readyState=t>0?4:0,u=t>=200&&t<300||304===t,r&&(C=Je(g,k,r)),!u&&M.inArray("script",g.dataTypes)>-1&&M.inArray("json",g.dataTypes)<0&&(g.converters["text script"]=function(){}),C=Ke(g,C,k,u),u?(g.ifModified&&(v=k.getResponseHeader("Last-Modified"),v&&(M.lastModified[i]=v),v=k.getResponseHeader("etag"),v&&(M.etag[i]=v)),204===t||"HEAD"===g.type?x="nocontent":304===t?x="notmodified":(x=C.state,d=C.data,w=C.error,u=!w)):(w=x,!t&&x||(x="error",t<0&&(t=0))),k.status=t,k.statusText=(e||x)+"",u?m.resolveWith(p,[d,x,k]):m.rejectWith(p,[k,x,w]),k.statusCode(b),b=void 0,h&&f.trigger(u?"ajaxSuccess":"ajaxError",[k,g,u?d:w]),y.fireWith(p,[k,x]),h&&(f.trigger("ajaxComplete",[k,g]),--M.active||M.event.trigger("ajaxStop")))}return k},getJSON:function(t,e,n){return M.get(t,e,n,"json")},getScript:function(t,e){return M.get(t,void 0,e,"script")}}),M.each(["get","post"],(function(t,e){M[e]=function(t,n,i,s){return b(n)&&(s=s||i,i=n,n=void 0),M.ajax(M.extend({url:t,type:e,dataType:s,data:n,success:i},M.isPlainObject(t)&&t))}})),M.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),M._evalUrl=function(t,e,n){return M.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){M.globalEval(t,e,n)}})},M.fn.extend({wrapAll:function(t){var e;return this[0]&&(b(t)&&(t=t.call(this[0])),e=M(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){var t=this;while(t.firstElementChild)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return b(t)?this.each((function(e){M(this).wrapInner(t.call(this,e))})):this.each((function(){var e=M(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=b(t);return this.each((function(n){M(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){M(this).replaceWith(this.childNodes)})),this}}),M.expr.pseudos.hidden=function(t){return!M.expr.pseudos.visible(t)},M.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},M.ajaxSettings.xhr=function(){try{return new s.XMLHttpRequest}catch(t){}};var Qe={0:200,1223:204},tn=M.ajaxSettings.xhr();y.cors=!!tn&&"withCredentials"in tn,y.ajax=tn=!!tn,M.ajaxTransport((function(t){var e,n;if(y.cors||tn&&!t.crossDomain)return{send:function(i,o){var r,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(r in t.xhrFields)a[r]=t.xhrFields[r];for(r in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(r,i[r]);e=function(t){return function(){e&&(e=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!==typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Qe[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!==typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),n=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&s.setTimeout((function(){e&&n()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(l){if(e)throw l}},abort:function(){e&&e()}}})),M.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),M.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return M.globalEval(t),t}}}),M.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),M.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,s){e=M("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&s("error"===t.type?404:200,t.type)}),C.head.appendChild(e[0])},abort:function(){n&&n()}}}));var en=[],nn=/(=)\?(?=&|$)|\?\?/;M.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=en.pop()||M.expando+"_"+Oe.guid++;return this[t]=!0,t}}),M.ajaxPrefilter("json jsonp",(function(t,e,n){var i,o,r,a=!1!==t.jsonp&&(nn.test(t.url)?"url":"string"===typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&nn.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=b(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(nn,"$1"+i):!1!==t.jsonp&&(t.url+=(Te.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return r||M.error(i+" was not called"),r[0]},t.dataTypes[0]="json",o=s[i],s[i]=function(){r=arguments},n.always((function(){void 0===o?M(s).removeProp(i):s[i]=o,t[i]&&(t.jsonpCallback=e.jsonpCallback,en.push(i)),r&&b(o)&&o(r[0]),r=o=void 0})),"script"})),y.createHTMLDocument=function(){var t=C.implementation.createHTMLDocument("").body;return t.innerHTML="<form></form><form></form>",2===t.childNodes.length}(),M.parseHTML=function(t,e,n){return"string"!==typeof t?[]:("boolean"===typeof e&&(n=e,e=!1),e||(y.createHTMLDocument?(e=C.implementation.createHTMLDocument(""),i=e.createElement("base"),i.href=C.location.href,e.head.appendChild(i)):e=C),s=N.exec(t),o=!n&&[],s?[e.createElement(s[1])]:(s=Mt([t],e,o),o&&o.length&&M(o).remove(),M.merge([],s.childNodes)));var i,s,o},M.fn.load=function(t,e,n){var i,s,o,r=this,a=t.indexOf(" ");return a>-1&&(i=ke(t.slice(a)),t=t.slice(0,a)),b(e)?(n=e,e=void 0):e&&"object"===typeof e&&(s="POST"),r.length>0&&M.ajax({url:t,type:s||"GET",dataType:"html",data:e}).done((function(t){o=arguments,r.html(i?M("<div>").append(M.parseHTML(t)).find(i):t)})).always(n&&function(t,e){r.each((function(){n.apply(this,o||[t.responseText,e,t])}))}),this},M.expr.pseudos.animated=function(t){return M.grep(M.timers,(function(e){return t===e.elem})).length},M.offset={setOffset:function(t,e,n){var i,s,o,r,a,l,c,h=M.css(t,"position"),u=M(t),d={};"static"===h&&(t.style.position="relative"),a=u.offset(),o=M.css(t,"top"),l=M.css(t,"left"),c=("absolute"===h||"fixed"===h)&&(o+l).indexOf("auto")>-1,c?(i=u.position(),r=i.top,s=i.left):(r=parseFloat(o)||0,s=parseFloat(l)||0),b(e)&&(e=e.call(t,n,M.extend({},a))),null!=e.top&&(d.top=e.top-a.top+r),null!=e.left&&(d.left=e.left-a.left+s),"using"in e?e.using.call(t,d):u.css(d)}},M.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){M.offset.setOffset(this,t,e)}));var e,n,i=this[0];return i?i.getClientRects().length?(e=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,i=this[0],s={top:0,left:0};if("fixed"===M.css(i,"position"))e=i.getBoundingClientRect();else{e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;while(t&&(t===n.body||t===n.documentElement)&&"static"===M.css(t,"position"))t=t.parentNode;t&&t!==i&&1===t.nodeType&&(s=M(t).offset(),s.top+=M.css(t,"borderTopWidth",!0),s.left+=M.css(t,"borderLeftWidth",!0))}return{top:e.top-s.top-M.css(i,"marginTop",!0),left:e.left-s.left-M.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){var t=this.offsetParent;while(t&&"static"===M.css(t,"position"))t=t.offsetParent;return t||ht}))}}),M.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;M.fn[t]=function(i){return Z(this,(function(t,i,s){var o;if(w(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===s)return o?o[e]:t[i];o?o.scrollTo(n?o.pageXOffset:s,n?s:o.pageYOffset):t[i]=s}),t,i,arguments.length)}})),M.each(["top","left"],(function(t,e){M.cssHooks[e]=Zt(y.pixelPosition,(function(t,n){if(n)return n=qt(t,e),Gt.test(n)?M(t).position()[e]+"px":n}))})),M.each({Height:"height",Width:"width"},(function(t,e){M.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){M.fn[i]=function(s,o){var r=arguments.length&&(n||"boolean"!==typeof s),a=n||(!0===s||!0===o?"margin":"border");return Z(this,(function(e,n,s){var o;return w(e)?0===i.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===s?M.css(e,n,a):M.style(e,n,s,a)}),e,r?s:void 0,r)}}))})),M.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){M.fn[e]=function(t){return this.on(e,t)}})),M.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),M.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){M.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var sn=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;M.proxy=function(t,e){var n,i,s;if("string"===typeof e&&(n=t[e],e=t,t=n),b(t))return i=l.call(arguments,2),s=function(){return t.apply(e||this,i.concat(l.call(arguments)))},s.guid=t.guid=t.guid||M.guid++,s},M.holdReady=function(t){t?M.readyWait++:M.ready(!0)},M.isArray=Array.isArray,M.parseJSON=JSON.parse,M.nodeName=T,M.isFunction=b,M.isWindow=w,M.camelCase=K,M.type=k,M.now=Date.now,M.isNumeric=function(t){var e=M.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},M.trim=function(t){return null==t?"":(t+"").replace(sn,"")},n=[],i=function(){return M}.apply(e,n),void 0===i||(t.exports=i);var on=s.jQuery,rn=s.$;return M.noConflict=function(t){return s.$===M&&(s.$=rn),t&&s.jQuery===M&&(s.jQuery=on),M},"undefined"===typeof o&&(s.jQuery=s.$=M),M}))},42441:function(t,e,n){var i;(function(s,o,r){if(s){for(var a,l={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"},c={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},h={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},u={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},d=1;d<20;++d)l[111+d]="f"+d;for(d=0;d<=9;++d)l[d+96]=d.toString();M.prototype.bind=function(t,e,n){var i=this;return t=t instanceof Array?t:[t],i._bindMultiple.call(i,t,e,n),i},M.prototype.unbind=function(t,e){var n=this;return n.bind.call(n,t,(function(){}),e)},M.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},M.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},M.prototype.stopCallback=function(t,e){var n=this;if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(E(e,n.target))return!1;if("composedPath"in t&&"function"===typeof t.composedPath){var i=t.composedPath()[0];i!==t.target&&(e=i)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},M.prototype.handleKey=function(){var t=this;return t._handleKey.apply(t,arguments)},M.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(l[e]=t[e]);a=null},M.init=function(){var t=M(o);for(var e in t)"_"!==e.charAt(0)&&(M[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},M.init(),s.Mousetrap=M,t.exports&&(t.exports=M),i=function(){return M}.call(e,n,e,t),i===r||(t.exports=i)}function g(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function p(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return l[t.which]?l[t.which]:c[t.which]?c[t.which]:String.fromCharCode(t.which).toLowerCase()}function f(t,e){return t.sort().join(",")===e.sort().join(",")}function m(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}function y(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function b(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function w(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function C(){if(!a)for(var t in a={},l)t>95&&t<112||l.hasOwnProperty(t)&&(a[l[t]]=t);return a}function v(t,e,n){return n||(n=C()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function x(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus"),t.split("+"))}function k(t,e){var n,i,s,o=[];for(n=x(t),s=0;s<n.length;++s)i=n[s],u[i]&&(i=u[i]),e&&"keypress"!=e&&h[i]&&(i=h[i],o.push("shift")),w(i)&&o.push(i);return e=v(i,o,e),{key:i,modifiers:o,action:e}}function E(t,e){return null!==t&&t!==o&&(t===e||E(t.parentNode,e))}function M(t){var e=this;if(t=t||o,!(e instanceof M))return new M(t);e.target=t,e._callbacks={},e._directMap={};var n,i={},s=!1,r=!1,a=!1;function l(t){t=t||{};var e,n=!1;for(e in i)t[e]?n=!0:i[e]=0;n||(a=!1)}function c(t,n,s,o,r,a){var l,c,h=[],u=s.type;if(!e._callbacks[t])return[];for("keyup"==u&&w(t)&&(n=[t]),l=0;l<e._callbacks[t].length;++l)if(c=e._callbacks[t][l],(o||!c.seq||i[c.seq]==c.level)&&u==c.action&&("keypress"==u&&!s.metaKey&&!s.ctrlKey||f(n,c.modifiers))){var d=!o&&c.combo==r,g=o&&c.seq==o&&c.level==a;(d||g)&&e._callbacks[t].splice(l,1),h.push(c)}return h}function h(t,n,i,s){e.stopCallback(n,n.target||n.srcElement,i,s)||!1===t(n,i)&&(y(n),b(n))}function u(t){"number"!==typeof t.which&&(t.which=t.keyCode);var n=p(t);n&&("keyup"!=t.type||s!==n?e.handleKey(n,m(t),t):s=!1)}function d(){clearTimeout(n),n=setTimeout(l,1e3)}function C(t,e,n,o){function r(e){return function(){a=e,++i[t],d()}}function c(e){h(n,e,t),"keyup"!==o&&(s=p(e)),setTimeout(l,10)}i[t]=0;for(var u=0;u<e.length;++u){var g=u+1===e.length,f=g?c:r(o||k(e[u+1]).action);v(e[u],f,o,t,u)}}function v(t,n,i,s,o){e._directMap[t+":"+i]=n,t=t.replace(/\s+/g," ");var r,a=t.split(" ");a.length>1?C(t,a,n,i):(r=k(t,i),e._callbacks[r.key]=e._callbacks[r.key]||[],c(r.key,r.modifiers,{type:r.action},s,t,o),e._callbacks[r.key][s?"unshift":"push"]({callback:n,modifiers:r.modifiers,action:r.action,seq:s,level:o,combo:t}))}e._handleKey=function(t,e,n){var i,s=c(t,e,n),o={},u=0,d=!1;for(i=0;i<s.length;++i)s[i].seq&&(u=Math.max(u,s[i].level));for(i=0;i<s.length;++i)if(s[i].seq){if(s[i].level!=u)continue;d=!0,o[s[i].seq]=1,h(s[i].callback,n,s[i].combo,s[i].seq)}else d||h(s[i].callback,n,s[i].combo);var g="keypress"==n.type&&r;n.type!=a||w(t)||g||l(o),r=d&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var i=0;i<t.length;++i)v(t[i],e,n)},g(t,"keypress",u),g(t,"keydown",u),g(t,"keyup",u)}})("undefined"!==typeof window?window:null,"undefined"!==typeof window?document:null)},64339:function(t,e,n){"use strict";n.d(e,{b0:function(){return i},wg:function(){return s}});const i="document_template_properties",s=[{author:{},template:{databaseType:"mysql-8.0.28",jdbcDriverFileUrl:"https://maven.aliyun.com/repository/central/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar",icon:n(92357),description:"mysql-8.0.28",jdbcDriverClassName:"com.mysql.cj.jdbc.Driver",jdbcProtocol:"jdbc:mysql",urlPattern:"{{jdbc.protocol}}://{{db.url}}/{{db.name}}",isLocalUpload:!1}},{author:{},template:{databaseType:"mysql-5.1.49",jdbcDriverFileUrl:"https://maven.aliyun.com/repository/central/mysql/mysql-connector-java/5.1.49/mysql-connector-java-5.1.49.jar",icon:n(92357),description:"mysql-5.1.49",jdbcDriverClassName:"com.mysql.jdbc.Driver",jdbcProtocol:"jdbc:mysql",urlPattern:"{{jdbc.protocol}}://{{db.url}}/{{db.name}}",isLocalUpload:!1}},{author:{},template:{databaseType:"postgresql-42.3.4",jdbcDriverFileUrl:"https://maven.aliyun.com/repository/central/org/postgresql/postgresql/42.3.4/postgresql-42.3.4.jar",icon:n(43609),description:"postgresql jdbc version 42.3.4",jdbcDriverClassName:"org.postgresql.Driver",jdbcProtocol:"jdbc:postgresql",urlPattern:"{{jdbc.protocol}}://{{db.url}}/{{db.name}}",isLocalUpload:!1}},{author:{},template:{databaseType:"mariadb-3.0.3",jdbcDriverFileUrl:"https://maven.aliyun.com/repository/central/org/mariadb/jdbc/mariadb-java-client/3.0.3/mariadb-java-client-3.0.3.jar",icon:n(36658),description:"mariadb-3.0.3",jdbcDriverClassName:"org.mariadb.jdbc.Driver",jdbcProtocol:"jdbc:mariadb",urlPattern:"{{jdbc.protocol}}://{{db.url}}/{{db.name}}",isLocalUpload:!1}},{author:{},template:{databaseType:"oracle-thin-12.2.0.1",jdbcDriverFileUrl:"https://maven.aliyun.com/repository/central/com/oracle/database/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.jar",icon:n(22260),description:"oracle-thin-12.2.0.1",jdbcDriverClassName:"oracle.jdbc.OracleDriver",jdbcProtocol:"jdbc:oracle:thin",urlPattern:"{{jdbc.protocol}}:@{{db.url}}:{{db.name}}",isLocalUpload:!1}},{author:{},template:{databaseType:"sqlServer-9.4.1.jre8",jdbcDriverFileUrl:"https://maven.aliyun.com/repository/central/com/microsoft/sqlserver/mssql-jdbc/9.4.1.jre8/mssql-jdbc-9.4.1.jre8.jar",icon:n(35641),description:"sqlServer-9.4.1.jre8",jdbcDriverClassName:"com.microsoft.sqlserver.jdbc.SQLServerDriver",jdbcProtocol:"jdbc:sqlserver",urlPattern:"{{jdbc.protocol}}://{{db.url}};databaseName={{db.name}}",isLocalUpload:!1}}]},76631:function(t,e,n){"use strict";n.d(e,{D:function(){return o},z:function(){return r}});var i=n(63872);const s="/api/v1.0",o=()=>i.Z.get(s+"/document_template/properties"),r=t=>i.Z.patch(s+"/document_template/properties",t)},79324:function(t,e,n){"use strict";n.d(e,{hW:function(){return o},Rp:function(){return r},Iu:function(){return a},M7:function(){return c},Dg:function(){return h},lN:function(){return u},jI:function(){return p}});var i=n(63872);const s="/api/v1.0/projects",o=t=>i.Z.get(s,{params:t}),r=t=>i.Z.get(s+"/"+t),a=t=>t.id?g(t):l(t),l=t=>i.Z.post(s,t),c=t=>i.Z.post(s+"/test_connection",t),h=(t,e)=>i.Z.post(s+"/"+t+"/list_manual_tasks",e),u=(t,e)=>i.Z.patch(s+"/"+t+"/tasks/"+e+"/cancel"),d="/api/v1.0/groups",g=t=>i.Z.patch(d+"/"+t.groupId+"/projects",t),p=(t,e)=>i.Z["delete"](d+"/"+t+"/projects/"+e)},75823:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return bC}});var i={};n.r(i),n.d(i,{async:function(){return td},block:function(){return Hu},circle:function(){return nd},circlePlus:function(){return id},classic:function(){return Uu},cross:function(){return Ku},diamond:function(){return Zu},ellipse:function(){return od},path:function(){return Yu}});var s={};n.r(s),n.d(s,{annotations:function(){return Ou},atConnectionLength:function(){return Cd},atConnectionLengthIgnoreGradient:function(){return yd},atConnectionLengthKeepGradient:function(){return md},atConnectionRatio:function(){return vd},atConnectionRatioIgnoreGradient:function(){return wd},atConnectionRatioKeepGradient:function(){return bd},connection:function(){return fd},displayEmpty:function(){return Nu},eol:function(){return Tu},fill:function(){return xu},filter:function(){return $u},html:function(){return Ru},lineHeight:function(){return Au},port:function(){return Vu},ref:function(){return qh},refCx:function(){return su},refCy:function(){return ou},refD:function(){return uu},refDKeepOffset:function(){return au},refDResetOffset:function(){return ru},refDx:function(){return Yh},refDy:function(){return Jh},refHeight:function(){return Qh},refHeight2:function(){return mu},refPoints:function(){return du},refPointsKeepOffset:function(){return cu},refPointsResetOffset:function(){return lu},refR:function(){return hu},refRCircumscribed:function(){return iu},refRInscribed:function(){return nu},refRx:function(){return tu},refRy:function(){return eu},refWidth:function(){return Kh},refWidth2:function(){return fu},refX:function(){return Zh},refX2:function(){return gu},refY:function(){return Xh},refY2:function(){return pu},resetOffset:function(){return zu},sourceMarker:function(){return cd},stroke:function(){return ku},style:function(){return Bu},targetMarker:function(){return hd},text:function(){return Eu},textPath:function(){return Pu},textVerticalAnchor:function(){return Du},textWrap:function(){return Mu},title:function(){return ju},vertexMarker:function(){return ud},xAlign:function(){return Fu},yAlign:function(){return Lu}});var o={};n.r(o),n.d(o,{dot:function(){return Ed},doubleMesh:function(){return Ad},fixedDot:function(){return Md},mesh:function(){return Sd}});var r={};n.r(r),n.d(r,{blur:function(){return jd},brightness:function(){return $d},contrast:function(){return Vd},dropShadow:function(){return Fd},grayScale:function(){return Ld},highlight:function(){return Nd},hueRotate:function(){return Bd},invert:function(){return Rd},outline:function(){return Td},saturate:function(){return Id},sepia:function(){return zd}});var a={};n.r(a),n.d(a,{flipX:function(){return Gd},flipXY:function(){return Ud},flipY:function(){return Hd},watermark:function(){return Wd}});var l={};n.r(l),n.d(l,{className:function(){return Jd},opacity:function(){return Qd},stroke:function(){return eg}});var c={};n.r(c),n.d(c,{absolute:function(){return rg},bottom:function(){return fg},ellipse:function(){return ag},ellipseSpread:function(){return lg},left:function(){return dg},line:function(){return ug},right:function(){return gg},top:function(){return pg}});var h={};n.r(h),n.d(h,{bottom:function(){return Eg},inside:function(){return Ag},insideOriented:function(){return Dg},left:function(){return vg},manual:function(){return Cg},outside:function(){return Mg},outsideOriented:function(){return Sg},radial:function(){return Ng},radialOriented:function(){return jg},right:function(){return xg},top:function(){return kg}});var u={};n.r(u),n.d(u,{noop:function(){return Kg},pinAbsolute:function(){return sp},pinRelative:function(){return ip}});var d={};n.r(d),n.d(d,{bottom:function(){return jp},bottomLeft:function(){return Bp},bottomRight:function(){return Rp},center:function(){return Tp},left:function(){return Fp},midSide:function(){return qp},nodeCenter:function(){return Up},orth:function(){return Hp},right:function(){return Lp},top:function(){return Np},topLeft:function(){return zp},topRight:function(){return Ip}});var g={};n.r(g),n.d(g,{closest:function(){return Kp},length:function(){return Yp},orth:function(){return tf},ratio:function(){return Xp}});var p={};n.r(p),n.d(p,{anchor:function(){return hf},bbox:function(){return rf},boundary:function(){return lf},rect:function(){return af}});var f={};n.r(f),n.d(f,{er:function(){return Kf},loop:function(){return tm},manhattan:function(){return Xf},metro:function(){return Jf},normal:function(){return df},oneSide:function(){return gf},orth:function(){return Cf}});var m={};n.r(m),n.d(m,{jumpover:function(){return bm},loop:function(){return im},normal:function(){return nm},rounded:function(){return sm},smooth:function(){return om}});var y=n(66252),b=n(3577);const w={class:"card-header"},C=(0,y.Uk)("任务列表"),v={key:0},x=(0,y.Uk)("| "),k={style:{"font-size":"12px"}},E=(0,y.Uk)(" 已完成 "),M=(0,y.Uk)(" 已失败 "),S=(0,y.Uk)(" 已取消 "),A=(0,y.Uk)(" 等待中 "),D=(0,y.Uk)(" 同步中 "),P=(0,y.Uk)(" 同步 "),O=(0,y._)("span",{style:{"font-size":"12px"}},"重置",-1),T={id:"toc-tree-wrapper"},N={class:"span-ellipsis"},j={key:0,style:{color:"#67C23A"}},F={style:{color:"#95d475"}},L={key:1,style:{color:"#E6A23C"}},z={style:{color:"#f3d19e"}},I={key:2,style:{color:"#F56C6C"}},B={style:{color:"#fab6b6"}},R={key:3},$={style:{color:"#b1b3b8"}},V=(0,y.Uk)(" 同步 "),_=(0,y.Uk)(" 导出");function G(t,e,n,i,s,o){const r=(0,y.up)("el-link"),a=(0,y.up)("el-button"),l=(0,y.up)("el-tooltip"),c=(0,y.up)("el-progress"),h=(0,y.up)("el-card"),u=(0,y.up)("el-button-group"),d=(0,y.up)("el-empty"),g=(0,y.up)("el-skeleton"),p=(0,y.up)("el-switch"),f=(0,y.up)("Search"),m=(0,y.up)("el-icon"),G=(0,y.up)("arrow-down"),H=(0,y.up)("el-checkbox"),U=(0,y.up)("el-dropdown-item"),W=(0,y.up)("el-dropdown-menu"),q=(0,y.up)("el-dropdown"),Z=(0,y.up)("el-input"),X=(0,y.up)("el-tree-v2"),Y=(0,y.up)("el-space"),J=(0,y.up)("el-aside"),K=(0,y.up)("el-option"),Q=(0,y.up)("el-select"),tt=(0,y.up)("el-header"),et=(0,y.up)("DocumentList"),nt=(0,y.up)("el-backtop"),it=(0,y.up)("el-tab-pane"),st=(0,y.up)("el-col"),ot=(0,y.up)("el-row"),rt=(0,y.up)("diagram"),at=(0,y.up)("el-tabs"),lt=(0,y.up)("document-discussion"),ct=(0,y.up)("el-main"),ht=(0,y.up)("el-container"),ut=(0,y.Q2)("loading"),dt=(0,y.Q2)("require-roles"),gt=(0,y.Q2)("select-more");return(0,y.wg)(),(0,y.iD)(y.HY,null,[i.projectTaskData.showTaskList&&i.projectTaskData.tasks.length>0?((0,y.wg)(),(0,y.j4)(h,{key:0,id:"task-list",style:{position:"fixed",right:"20px !important",top:"80px !important",width:"300px","z-index":"1000"}},{header:(0,y.w5)((()=>[(0,y._)("div",w,[(0,y.Wm)(r,{icon:"List",underline:!1},{default:(0,y.w5)((()=>[C])),_:1}),(0,y.Wm)(a,{icon:"Close",text:"",onClick:e[0]||(e[0]=t=>i.projectTaskData.showTaskList=!1),style:{color:"#303133"}})])])),default:(0,y.w5)((()=>[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(i.projectTaskData.tasks,(t=>((0,y.wg)(),(0,y.iD)("div",{key:t.taskId},[(0,y.Uk)(" #"+(0,b.zw)(t.taskId)+" ",1),t.runAt?((0,y.wg)(),(0,y.iD)("span",v,[x,(0,y._)("span",k,"开始于:"+(0,b.zw)(t.runAt),1)])):(0,y.kq)("",!0),(0,y.Wm)(c,{percentage:"NEW"==t.status?0:100,indeterminate:"NEW"==t.status||"RUNNING"==t.status,style:{width:"100%"},status:i.taskStatusToProgressStatus(t)},{default:(0,y.w5)((()=>["FINISHED"==t.status?((0,y.wg)(),(0,y.j4)(l,{key:0,content:"点击刷新文档"},{default:(0,y.w5)((()=>[(0,y.Wm)(a,{text:"",icon:"RefreshRight",style:{color:"#67C23A"},onClick:e=>i.onClickTaskProgress(t)},{default:(0,y.w5)((()=>[E])),_:2},1032,["onClick"])])),_:2},1024)):"FAILED"==t.status?((0,y.wg)(),(0,y.j4)(l,{key:1,content:t.result},{default:(0,y.w5)((()=>[(0,y.Wm)(a,{text:"",icon:"WarningFilled",style:{color:"#F56C6C"},onClick:e=>i.onClickTaskProgress(t)},{default:(0,y.w5)((()=>[M])),_:2},1032,["onClick"])])),_:2},1032,["content"])):"CANCELED"==t.status?((0,y.wg)(),(0,y.j4)(l,{key:2,content:t.result},{default:(0,y.w5)((()=>[(0,y.Wm)(a,{text:"",icon:"WarningFilled",style:{color:"#E6A23C"},onClick:e=>i.onClickTaskProgress(t)},{default:(0,y.w5)((()=>[S])),_:2},1032,["onClick"])])),_:2},1032,["content"])):"NEW"==t.status?((0,y.wg)(),(0,y.j4)(l,{key:3,content:"点击取消同步"},{default:(0,y.w5)((()=>[(0,y.Wm)(a,{text:"",icon:"CircleCloseFilled",onClick:e=>i.onClickTaskProgress(t),style:{color:"#303133"}},{default:(0,y.w5)((()=>[A])),_:2},1032,["onClick"])])),_:2},1024)):((0,y.wg)(),(0,y.j4)(l,{key:4,content:"点击取消同步"},{default:(0,y.w5)((()=>[(0,y.Wm)(a,{text:"",icon:"CircleCloseFilled",onClick:e=>i.onClickTaskProgress(t)},{default:(0,y.w5)((()=>[D])),_:2},1032,["onClick"])])),_:2},1024))])),_:2},1032,["percentage","indeterminate","status"])])))),128))])),_:1})):(0,y.kq)("",!0),i.isShowNoDataPage?((0,y.wg)(),(0,y.j4)(d,{key:1,description:"似乎还没有同步过文档"},{default:(0,y.w5)((()=>[(0,y.Wm)(u,null,{default:(0,y.w5)((()=>[(0,y.Wm)(a,{type:"success",icon:"Refresh",onClick:i.onSyncProjectDocument,loading:i.loadings.handleSync},{default:(0,y.w5)((()=>[P])),_:1},8,["onClick","loading"]),i.projectTaskData.tasks.length>0?((0,y.wg)(),(0,y.j4)(a,{key:0,type:"success",icon:"List",onClick:e[1]||(e[1]=t=>i.projectTaskData.showTaskList=!i.projectTaskData.showTaskList)},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(i.projectTaskData.tasks.length),1)])),_:1})):(0,y.kq)("",!0)])),_:1})])),_:1})):i.isShowLoadingPage?(0,y.wy)(((0,y.wg)(),(0,y.j4)(g,{key:2,rows:12},null,512)),[[ut,!i.loadings.init]]):((0,y.wg)(),(0,y.j4)(ht,{key:3},{default:(0,y.w5)((()=>[(0,y.Wm)(J,null,{default:(0,y.w5)((()=>[(0,y.Wm)(Y,{direction:"vertical",size:26,alignment:"left",class:"doc-toc-aside",style:{width:"300px"}},{default:(0,y.w5)((()=>[(0,y.Wm)(p,{modelValue:i.tocData.isMultiSelectionMode,"onUpdate:modelValue":e[2]||(e[2]=t=>i.tocData.isMultiSelectionMode=t),"active-text":"多选模式","inactive-text":"单选模式",onChange:i.onMultiSelectionModeChange,loading:i.loadings.multiSelectionModeChanging},null,8,["modelValue","onChange","loading"]),(0,y.Wm)(Z,{modelValue:i.searchTableText,"onUpdate:modelValue":e[7]||(e[7]=t=>i.searchTableText=t),placeholder:"输入表名、注释、描述进行搜索",class:"search-input"},(0,y.Nv)({_:2},[i.documentDiffData.diffModeEnabled?{name:"suffix",fn:(0,y.w5)((()=>[(0,y.Wm)(m,null,{default:(0,y.w5)((()=>[(0,y.Wm)(f)])),_:1})]))}:void 0,i.documentDiffData.diffModeEnabled&&i.projectData.documentFilter.version!=i.documentDiffData.originalVersion&&null!=i.documentDiffData.originalVersion?{name:"prefix",fn:(0,y.w5)((()=>[(0,y.Wm)(q,null,{dropdown:(0,y.w5)((()=>[(0,y.Wm)(W,null,{default:(0,y.w5)((()=>[(0,y.Wm)(U,null,{default:(0,y.w5)((()=>[(0,y.Wm)(H,{modelValue:i.searchFilter.filterAdded,"onUpdate:modelValue":e[3]||(e[3]=t=>i.searchFilter.filterAdded=t),"true-label":"1","false-label":"0",label:"新增",size:"small",onChange:i.onSearchFilterChange},null,8,["modelValue","onChange"])])),_:1}),(0,y.Wm)(U,null,{default:(0,y.w5)((()=>[(0,y.Wm)(H,{modelValue:i.searchFilter.filterRemoved,"onUpdate:modelValue":e[4]||(e[4]=t=>i.searchFilter.filterRemoved=t),"true-label":"1","false-label":"0",label:"删除",size:"small",onChange:i.onSearchFilterChange},null,8,["modelValue","onChange"])])),_:1}),(0,y.Wm)(U,null,{default:(0,y.w5)((()=>[(0,y.Wm)(H,{modelValue:i.searchFilter.filterModified,"onUpdate:modelValue":e[5]||(e[5]=t=>i.searchFilter.filterModified=t),"true-label":"1","false-label":"0",label:"修改",size:"small",onChange:i.onSearchFilterChange},null,8,["modelValue","onChange"])])),_:1}),(0,y.Wm)(U,null,{default:(0,y.w5)((()=>[(0,y.Wm)(H,{modelValue:i.searchFilter.filterNone,"onUpdate:modelValue":e[6]||(e[6]=t=>i.searchFilter.filterNone=t),"true-label":"1","false-label":"0",label:"无变化",size:"small",onChange:i.onSearchFilterChange},null,8,["modelValue","onChange"])])),_:1}),(0,y.Wm)(U,{divided:"",onClick:i.resetSearchFilter},{default:(0,y.w5)((()=>[O])),_:1},8,["onClick"])])),_:1})])),default:(0,y.w5)((()=>[(0,y._)("span",null,[(0,y.Wm)(m,null,{default:(0,y.w5)((()=>[(0,y.Wm)(G)])),_:1})])])),_:1})]))}:{name:"prefix",fn:(0,y.w5)((()=>[(0,y.Wm)(m,null,{default:(0,y.w5)((()=>[(0,y.Wm)(f)])),_:1})]))}]),1032,["modelValue"]),(0,y._)("div",T,[(0,y.Wm)(X,{ref:"treeRef",data:i.tocData.value,"show-checkbox":i.tocData.isMultiSelectionMode,"default-expanded-keys":[-1],"node-key":"id","highlight-current":"",onNodeClick:i.onTocNodeClick,onCheckChange:i.onTocNodeCheckChange,"current-node-key":i.tocData.currentTocNodeKey,"filter-method":i.searchTables,height:i.tocTreeHeight},{default:(0,y.w5)((({data:t})=>[(0,y._)("span",N,[(0,y.Wm)(l,{content:t.comment&&""!=t.comment?t.name+" /*"+t.comment+"*/":t.name,effect:"light"},{default:(0,y.w5)((()=>[(0,y._)("span",null,[i.documentDiffData.diffModeEnabled&&"ADDED"==t.diffType?((0,y.wg)(),(0,y.iD)("span",j,[(0,y.Uk)((0,b.zw)(t.name)+" ",1),(0,y._)("span",F,(0,b.zw)(i.tocItemComment(t)),1)])):i.documentDiffData.diffModeEnabled&&"MODIFIED"==t.diffType?((0,y.wg)(),(0,y.iD)("span",L,[(0,y.Uk)((0,b.zw)(t.name)+" ",1),(0,y._)("span",z,(0,b.zw)(i.tocItemComment(t)),1)])):i.documentDiffData.diffModeEnabled&&"REMOVED"==t.diffType?((0,y.wg)(),(0,y.iD)("span",I,[(0,y.Uk)((0,b.zw)(t.name)+" ",1),(0,y._)("span",B,(0,b.zw)(i.tocItemComment(t)),1)])):((0,y.wg)(),(0,y.iD)("span",R,[(0,y.Uk)((0,b.zw)(t.name)+" ",1),(0,y._)("span",$,(0,b.zw)(i.tocItemComment(t)),1)]))])])),_:2},1032,["content"])])])),_:1},8,["data","show-checkbox","onNodeClick","onCheckChange","current-node-key","filter-method","height"])])])),_:1})])),_:1}),(0,y.Wm)(ht,null,{default:(0,y.w5)((()=>[(0,y.Wm)(tt,null,{default:(0,y.w5)((()=>[(0,y._)("div",null,[(0,y.Wm)(Y,{size:28,style:{"margin-bottom":"33px"}},{default:(0,y.w5)((()=>[(0,y.Wm)(u,null,{default:(0,y.w5)((()=>[(0,y.Wm)(a,{type:"success",icon:"Refresh",onClick:i.onSyncProjectDocument,loading:i.loadings.handleSync},{default:(0,y.w5)((()=>[V])),_:1},8,["onClick","loading"]),i.projectTaskData.tasks.length>0?((0,y.wg)(),(0,y.j4)(a,{key:0,type:"success",icon:"List",onClick:e[8]||(e[8]=t=>i.projectTaskData.showTaskList=!i.projectTaskData.showTaskList)},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(i.projectTaskData.tasks.length),1)])),_:1})):(0,y.kq)("",!0)])),_:1}),(0,y.wy)(((0,y.wg)(),(0,y.j4)(q,null,{dropdown:(0,y.w5)((()=>[(0,y.Wm)(W,null,{default:(0,y.w5)((()=>[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(i.fileTypes,((t,e)=>((0,y.wg)(),(0,y.j4)(U,{key:e,onClick:e=>i.onFileExport(t.type,t.fileExtension)},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(t.name),1)])),_:2},1032,["onClick"])))),128))])),_:1})])),default:(0,y.w5)((()=>[(0,y.Wm)(a,{type:"primary",style:{width:"100%"},icon:"Download",loading:i.loadings.export},{default:(0,y.w5)((()=>[_,(0,y.Wm)(m,{style:{"margin-left":"8px"}},{default:(0,y.w5)((()=>[(0,y.Wm)(G)])),_:1})])),_:1},8,["loading"])])),_:1})),[[dt,["SYS_OWNER","GROUP_OWNER?groupId="+i.projectData.groupId,"GROUP_MEMBER?groupId="+i.projectData.groupId]]]),(0,y.wy)(((0,y.wg)(),(0,y.j4)(Q,{onChange:i.onProjectDocumentVersionChange,modelValue:i.projectData.documentFilter.version,"onUpdate:modelValue":e[9]||(e[9]=t=>i.projectData.documentFilter.version=t),placeholder:"当前版本",clearable:""},{default:(0,y.w5)((()=>[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(i.versionData.versions,(t=>((0,y.wg)(),(0,y.j4)(K,{key:t.version,label:"["+t.createAt+"]->"+t.version,value:t.version},null,8,["label","value"])))),128))])),_:1},8,["onChange","modelValue"])),[[gt,i.loadMoreDocumentVersions],[ut,i.loadings.loadingVersions]]),i.documentDiffData.diffModeEnabled?(0,y.wy)(((0,y.wg)(),(0,y.j4)(Q,{key:0,onChange:i.onProjectDocumentCompareVersionChange,modelValue:i.documentDiffData.originalVersion,"onUpdate:modelValue":e[10]||(e[10]=t=>i.documentDiffData.originalVersion=t),placeholder:"对比版本",clearable:""},{default:(0,y.w5)((()=>[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(i.versionData.versions,(t=>((0,y.wg)(),(0,y.j4)(K,{key:t.version,label:"["+t.createAt+"]->"+t.version,value:t.version},null,8,["label","value"])))),128))])),_:1},8,["onChange","modelValue"])),[[gt,i.loadMoreDocumentVersions],[ut,i.loadings.loadingVersions]]):(0,y.kq)("",!0),"tableDocument"==i.activeTab?((0,y.wg)(),(0,y.j4)(p,{key:1,modelValue:i.documentDiffData.diffModeEnabled,"onUpdate:modelValue":e[11]||(e[11]=t=>i.documentDiffData.diffModeEnabled=t),"before-change":i.beforeDiffModeChange,"active-text":"显示版本差异"},null,8,["modelValue","before-change"])):(0,y.kq)("",!0)])),_:1})])])),_:1}),(0,y.Wm)(ct,null,{default:(0,y.w5)((()=>[(0,y.Wm)(at,{"model-value":"tableDocument",onTabClick:i.onTabClick},{default:(0,y.w5)((()=>[(0,y.Wm)(it,{label:"文档",name:"tableDocument"},{default:(0,y.w5)((()=>[(0,y.Wm)(et,{tablesData:i.documentData.tables,overviewData:i.documentData.overview,diffEnabled:i.documentDiffData.diffModeEnabled,docVersion:i.projectData.documentFilter.version,onOnRemark:i.showDiscussionDrawer},null,8,["tablesData","overviewData","diffEnabled","docVersion","onOnRemark"]),(0,y.Wm)(nt,{right:100,bottom:100})])),_:1}),(0,y.Wm)(it,{label:"UML",name:"umlPanel",style:{width:"100%"},lazy:!0},{default:(0,y.w5)((()=>[(0,y.Wm)(ot,null,{default:(0,y.w5)((()=>[(0,y.Wm)(st,{span:5},{default:(0,y.w5)((()=>[(0,y.Wm)(p,{modelValue:i.umlData.showComment,"onUpdate:modelValue":e[12]||(e[12]=t=>i.umlData.showComment=t),"active-text":"显示注释","inactive-text":"隐藏注释"},null,8,["modelValue"])])),_:1})])),_:1}),(0,y.Wm)(rt,{"model-data":i.umlData.tables,"show-comment":i.umlData.showComment,ref:"umlDiagramComponentRef"},null,8,["model-data","show-comment"])])),_:1})])),_:1},8,["onTabClick"]),(0,y.Wm)(lt,{groupId:i.documentDiscussionData.groupId,projectId:i.documentDiscussionData.projectId,tableName:i.documentDiscussionData.tableName,columnName:i.documentDiscussionData.columnName,isShowDrawer:i.documentDiscussionData.isShowDrawer,onOnClose:e[13]||(e[13]=t=>i.documentDiscussionData.isShowDrawer=!1)},null,8,["groupId","projectId","tableName","columnName","isShowDrawer"])])),_:1})])),_:1})])),_:1}))],64)}n(26699);var H=n(2262),U=n(42119),W=n(63872);const q="/api/v1.0",Z=(t,e,n)=>W.Z.post(q+"/projects/"+t+"/documents/"+e+"/table_documents",n),X=(t,e)=>W.Z.get(q+"/projects/"+t+"/documents/simple",{params:e}),Y=t=>W.Z.post(q+"/projects/"+t+"/documents"),J=(t,e)=>W.Z.get(q+"/projects/"+t+"/document_versions",{params:e}),K=(t,e,n,i)=>et(q+"/projects/"+t+"/document_files",e,n,i),Q=()=>W.Z.get(q+"/document_file_types"),tt=(t,e)=>W.Z.get(q+"/projects/"+t+"/tables",{params:e});function et(t,e,n,i){W.Z.get(t,{responseType:"blob",params:e}).then((t=>{let e=window.URL||window.webkitURL||window;const s=document.createElement("a");s.href=e.createObjectURL(new Blob([t])),s.download=n,document.body.appendChild(s),s.click(),i()})).catch((()=>i()))}var nt=n(79324),it=n(45244),st=n(46461);const ot={id:"diagram-container",style:{"min-width":"100vw","min-height":"100vh"}};function rt(t,e,n,i,s,o){return(0,y.wg)(),(0,y.iD)("div",ot)}var at=n(19755),lt=n.n(at);n(50450);const ct=navigator.userAgent;var ht;if(function(t){t.IS_MAC=navigator.appVersion.indexOf("Mac")>0,t.IS_IOS=!!ct.match(/(iPad|iPhone|iPod)/g),t.IS_WINDOWS=navigator.appVersion.indexOf("Win")>0,t.IS_IE=ct.indexOf("MSIE")>=0,t.IS_IE11=!!ct.match(/Trident\/7\./),t.IS_EDGE=!!ct.match(/Edge\//),t.IS_NETSCAPE=ct.indexOf("Mozilla/")>=0&&ct.indexOf("MSIE")<0&&ct.indexOf("Edge/")<0,t.IS_CHROME_APP=null!=window.chrome&&null!=window.chrome.app&&null!=window.chrome.app.runtime,t.IS_CHROME=ct.indexOf("Chrome/")>=0&&ct.indexOf("Edge/")<0,t.IS_OPERA=ct.indexOf("Opera/")>=0||ct.indexOf("OPR/")>=0,t.IS_FIREFOX=ct.indexOf("Firefox/")>=0,t.IS_SAFARI=ct.indexOf("AppleWebKit/")>=0&&ct.indexOf("Chrome/")<0&&ct.indexOf("Edge/")<0,t.SUPPORT_TOUCH="ontouchstart"in document.documentElement,t.SUPPORT_POINTER=null!=window.PointerEvent&&!t.IS_MAC,t.SUPPORT_PASSIVE=!1;try{const e=Object.defineProperty({},"passive",{get(){t.SUPPORT_PASSIVE=!0}}),n=document.createElement("div");n.addEventListener&&n.addEventListener("click",(()=>{}),e)}catch(e){}t.NO_FOREIGNOBJECT=!document.createElementNS||"[object SVGForeignObjectElement]"!==`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`||ct.indexOf("Opera/")>=0,t.SUPPORT_FOREIGNOBJECT=!t.NO_FOREIGNOBJECT}(ht||(ht={})),function(t){function e(){const t=window.module;return null!=t&&null!=t.hot&&null!=t.hot.status?t.hot.status():"unkonwn"}function n(){return"apply"===e()}t.getHMRStatus=e,t.isApplyingHMR=n;const i={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function s(t){const e=document.createElement(i[t]||"div"),n=`on${t}`;let s=n in e;return s||(e.setAttribute(n,"return;"),s="function"===typeof e[n]),s}t.isEventSupported=s}(ht||(ht={})),ht.SUPPORT_PASSIVE){lt().event.special.touchstart={setup(t,e,n){if(!this.addEventListener)return!1;this.addEventListener("touchstart",n,{passive:!0})}};const t=lt().event.special.mousewheel;if(t){const e=t.setup;t.setup=function(){const t=this.addEventListener;if(!t)return!1;this.addEventListener=(e,n)=>{t.call(this,e,n,{passive:!0})},e.call(this),this.addEventListener=t}}}window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),function(t){t.forEach((t=>{Object.prototype.hasOwnProperty.call(t,"append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value(...t){const e=document.createDocumentFragment();t.forEach((t=>{const n=t instanceof Node;e.appendChild(n?t:document.createTextNode(String(t)))})),this.appendChild(e)}})}))}([Element.prototype,Document.prototype,DocumentFragment.prototype]);var ut=n(27771),dt=n(50585),gt=n(69958);function pt(t){return t&&t.length?(0,gt.Z)(t):[]}var ft=pt,mt=n(34468),yt=n(72714),bt=4294967295,wt=bt-1,Ct=Math.floor,vt=Math.min;function xt(t,e,n,i){var s=0,o=null==t?0:t.length;if(0===o)return 0;e=n(e);var r=e!==e,a=null===e,l=(0,yt.Z)(e),c=void 0===e;while(s<o){var h=Ct((s+o)/2),u=n(t[h]),d=void 0!==u,g=null===u,p=u===u,f=(0,yt.Z)(u);if(r)var m=i||p;else m=c?p&&(i||d):a?p&&d&&(i||!g):l?p&&d&&!g&&(i||!f):!g&&!f&&(i?u<=e:u<e);m?s=h+1:o=h}return vt(o,wt)}var kt=xt,Et=n(69203),Mt=4294967295,St=Mt>>>1;function At(t,e,n){var i=0,s=null==t?i:t.length;if("number"==typeof e&&e===e&&s<=St){while(i<s){var o=i+s>>>1,r=t[o];null!==r&&!(0,yt.Z)(r)&&(n?r<=e:r<e)?i=o+1:s=o}return s}return kt(t,e,Et.Z,n)}var Dt=At;function Pt(t,e){return Dt(t,e)}var Ot=Pt,Tt=n(31667),Nt=n(2674),jt=1,Ft=2;function Lt(t,e,n,i){var s=n.length,o=s,r=!i;if(null==t)return!o;t=Object(t);while(s--){var a=n[s];if(r&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}while(++s<o){a=n[s];var l=a[0],c=t[l],h=a[1];if(r&&a[2]){if(void 0===c&&!(l in t))return!1}else{var u=new Tt.Z;if(i)var d=i(c,h,l,t,e,u);if(!(void 0===d?(0,Nt.Z)(h,c,jt|Ft,i,u):d))return!1}}return!0}var zt=Lt,It=n(77226);function Bt(t){return t===t&&!(0,It.Z)(t)}var Rt=Bt,$t=n(17179);function Vt(t){var e=(0,$t.Z)(t),n=e.length;while(n--){var i=e[n],s=t[i];e[n]=[i,s,Rt(s)]}return e}var _t=Vt;function Gt(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}var Ht=Gt;function Ut(t){var e=_t(t);return 1==e.length&&e[0][2]?Ht(e[0][0],e[0][1]):function(n){return n===t||zt(n,t,e)}}var Wt=Ut,qt=n(16423),Zt=n(75487),Xt=n(99365),Yt=n(62281),Jt=1,Kt=2;function Qt(t,e){return(0,Xt.Z)(t)&&Rt(e)?Ht((0,Yt.Z)(t),e):function(n){var i=(0,qt.Z)(n,t);return void 0===i&&i===e?(0,Zt.Z)(n,t):(0,Nt.Z)(e,i,Jt|Kt)}}var te=Qt;function ee(t){return function(e){return null==e?void 0:e[t]}}var ne=ee,ie=n(13317);function se(t){return function(e){return(0,ie.Z)(e,t)}}var oe=se;function re(t){return(0,Xt.Z)(t)?ne((0,Yt.Z)(t)):oe(t)}var ae=re;function le(t){return"function"==typeof t?t:null==t?Et.Z:"object"==typeof t?(0,ut.Z)(t)?te(t[0],t[1]):Wt(t):ae(t)}var ce=le;function he(t,e,n){return kt(t,e,ce(n,2))}var ue=he,de=n(10626),ge=n(74073);function pe(t){return function(e,n,i){var s=-1,o=Object(e),r=i(e),a=r.length;while(a--){var l=r[t?a:++s];if(!1===n(o[l],l,o))break}return e}}var fe=pe,me=fe(),ye=me;function be(t,e){return t&&ye(t,e,$t.Z)}var we=be;function Ce(t,e){return function(n,i){if(null==n)return n;if(!(0,dt.Z)(n))return t(n,i);var s=n.length,o=e?s:-1,r=Object(n);while(e?o--:++o<s)if(!1===i(r[o],o,r))break;return n}}var ve=Ce,xe=ve(we),ke=xe;function Ee(t,e){var n=-1,i=(0,dt.Z)(t)?Array(t.length):[];return ke(t,(function(t,s,o){i[++n]=e(t,s,o)})),i}var Me=Ee;function Se(t,e){var n=t.length;t.sort(e);while(n--)t[n]=t[n].value;return t}var Ae=Se,De=n(21162);function Pe(t,e){if(t!==e){var n=void 0!==t,i=null===t,s=t===t,o=(0,yt.Z)(t),r=void 0!==e,a=null===e,l=e===e,c=(0,yt.Z)(e);if(!a&&!c&&!o&&t>e||o&&r&&l&&!a&&!c||i&&r&&l||!n&&l||!s)return 1;if(!i&&!o&&!c&&t<e||c&&n&&s&&!i&&!o||a&&n&&s||!r&&s||!l)return-1}return 0}var Oe=Pe;function Te(t,e,n){var i=-1,s=t.criteria,o=e.criteria,r=s.length,a=n.length;while(++i<r){var l=Oe(s[i],o[i]);if(l){if(i>=a)return l;var c=n[i];return l*("desc"==c?-1:1)}}return t.index-e.index}var Ne=Te;function je(t,e,n){e=e.length?(0,ge.Z)(e,(function(t){return(0,ut.Z)(t)?function(e){return(0,ie.Z)(e,1===t.length?t[0]:t)}:t})):[Et.Z];var i=-1;e=(0,ge.Z)(e,(0,De.Z)(ce));var s=Me(t,(function(t,n,s){var o=(0,ge.Z)(e,(function(e){return e(t)}));return{criteria:o,index:++i,value:t}}));return Ae(s,(function(t,e){return Ne(t,e,n)}))}var Fe=je,Le=n(69581),ze=n(79651),Ie=n(56009);function Be(t,e,n){if(!(0,It.Z)(n))return!1;var i=typeof e;return!!("number"==i?(0,dt.Z)(n)&&(0,Ie.Z)(e,n.length):"string"==i&&e in n)&&(0,ze.Z)(n[e],t)}var Re=Be,$e=(0,Le.Z)((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Re(t,e[0],e[1])?e=[]:n>2&&Re(e[0],e[1],e[2])&&(e=[e[0]]),Fe(t,(0,de.Z)(e,1),[])})),Ve=$e,_e=n(74752);function Ge(t,e,n,i){var s=-1,o=null==t?0:t.length;while(++s<o){var r=t[s];e(i,r,n(r),t)}return i}var He=Ge;function Ue(t,e,n,i){return ke(t,(function(t,s,o){e(i,t,n(t),o)})),i}var We=Ue;function qe(t,e){return function(n,i){var s=(0,ut.Z)(n)?He:We,o=e?e():{};return s(n,t,ce(i,2),o)}}var Ze=qe,Xe=Object.prototype,Ye=Xe.hasOwnProperty,Je=Ze((function(t,e,n){Ye.call(t,n)?t[n].push(e):(0,_e.Z)(t,n,[e])})),Ke=Je,Qe=n(63001),tn=n(35415),en=n(22783),nn=n(59548),sn=200;function on(t,e,n,i){var s=-1,o=tn.Z,r=!0,a=t.length,l=[],c=e.length;if(!a)return l;n&&(e=(0,ge.Z)(e,(0,De.Z)(n))),i?(o=en.Z,r=!1):e.length>=sn&&(o=nn.Z,r=!1,e=new Qe.Z(e));t:while(++s<a){var h=t[s],u=null==n?h:n(h);if(h=i||0!==h?h:0,r&&u===u){var d=c;while(d--)if(e[d]===u)continue t;l.push(h)}else o(e,u,i)||l.push(h)}return l}var rn=on,an=n(836),ln=(0,Le.Z)((function(t,e){return(0,an.Z)(t)?rn(t,(0,de.Z)(e,1,an.Z,!0)):[]})),cn=ln;var hn=Object.prototype,un=hn.hasOwnProperty;function dn(t,e){return null!=t&&un.call(t,e)}var gn=dn,pn=n(16174);function fn(t,e){return null!=t&&(0,pn.Z)(t,e,gn)}var mn=fn,yn=n(94907);var bn=n(32957);function wn(t,e,n){(void 0!==n&&!(0,ze.Z)(t[e],n)||void 0===n&&!(e in t))&&(0,_e.Z)(t,e,n)}var Cn=wn,vn=n(91050),xn=n(12701),kn=n(87215),En=n(73658),Mn=n(29169),Sn=n(77008),An=n(73234),Dn=n(93589),Pn=n(12513),On=n(18533),Tn="[object Object]",Nn=Function.prototype,jn=Object.prototype,Fn=Nn.toString,Ln=jn.hasOwnProperty,zn=Fn.call(Object);function In(t){if(!(0,On.Z)(t)||(0,Dn.Z)(t)!=Tn)return!1;var e=(0,Pn.Z)(t);if(null===e)return!0;var n=Ln.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Fn.call(n)==zn}var Bn=In,Rn=n(18843);function $n(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}var Vn=$n,_n=n(31899);function Gn(t){return(0,_n.Z)(t,(0,bn.Z)(t))}var Hn=Gn;function Un(t,e,n,i,s,o,r){var a=Vn(t,n),l=Vn(e,n),c=r.get(l);if(c)Cn(t,n,c);else{var h=o?o(a,l,n+"",t,e,r):void 0,u=void 0===h;if(u){var d=(0,ut.Z)(l),g=!d&&(0,Sn.Z)(l),p=!d&&!g&&(0,Rn.Z)(l);h=l,d||g||p?(0,ut.Z)(a)?h=a:(0,an.Z)(a)?h=(0,kn.Z)(a):g?(u=!1,h=(0,vn.Z)(l,!0)):p?(u=!1,h=(0,xn.Z)(l,!0)):h=[]:Bn(l)||(0,Mn.Z)(l)?(h=a,(0,Mn.Z)(a)?h=Hn(a):(0,It.Z)(a)&&!(0,An.Z)(a)||(h=(0,En.Z)(l))):u=!1}u&&(r.set(l,h),s(h,l,i,o,r),r["delete"](l)),Cn(t,n,h)}}var Wn=Un;function qn(t,e,n,i,s){t!==e&&ye(e,(function(o,r){if(s||(s=new Tt.Z),(0,It.Z)(o))Wn(t,e,r,n,qn,i,s);else{var a=i?i(Vn(t,r),o,r+"",t,e,s):void 0;void 0===a&&(a=o),Cn(t,r,a)}}),bn.Z)}var Zn=qn;function Xn(t){return(0,Le.Z)((function(e,n){var i=-1,s=n.length,o=s>1?n[s-1]:void 0,r=s>2?n[2]:void 0;o=t.length>3&&"function"==typeof o?(s--,o):void 0,r&&Re(n[0],n[1],r)&&(o=s<3?void 0:o,s=1),e=Object(e);while(++i<s){var a=n[i];a&&t(e,a,i,o)}return e}))}var Yn=Xn,Jn=Yn((function(t,e,n){Zn(t,e,n)})),Kn=Jn,Qn=(Yn((function(t,e){(0,_n.Z)(e,(0,bn.Z)(e),t)})),n(50576)),ti=n(39473),ei=n(83970),ni=n(72764),ii="[object Map]",si="[object Set]",oi=Object.prototype,ri=oi.hasOwnProperty;function ai(t){if(null==t)return!0;if((0,dt.Z)(t)&&((0,ut.Z)(t)||"string"==typeof t||"function"==typeof t.splice||(0,Sn.Z)(t)||(0,Rn.Z)(t)||(0,Mn.Z)(t)))return!t.length;var e=(0,ei.Z)(t);if(e==ii||e==si)return!t.size;if((0,ni.Z)(t))return!(0,ti.Z)(t).length;for(var n in t)if(ri.call(t,n))return!1;return!0}var li=ai,ci=n(92346),hi=n(59827),ui=1,di=4;function gi(t){return(0,hi.Z)(t,ui|di)}var pi=gi,fi=Object.prototype,mi=fi.hasOwnProperty,yi=(0,Le.Z)((function(t,e){t=Object(t);var n=-1,i=e.length,s=i>2?e[2]:void 0;s&&Re(e[0],e[1],s)&&(i=1);while(++n<i){var o=e[n],r=(0,bn.Z)(o),a=-1,l=r.length;while(++a<l){var c=r[a],h=t[c];(void 0===h||(0,ze.Z)(h,fi[c])&&!mi.call(t,c))&&(t[c]=o[c])}}return t})),bi=yi,wi=n(18069);function Ci(t,e,n,i,s,o){return(0,It.Z)(t)&&(0,It.Z)(e)&&(o.set(e,t),Zn(t,e,void 0,Ci,o),o["delete"](e)),t}var vi=Ci,xi=Yn((function(t,e,n,i){Zn(t,e,n,i)})),ki=xi,Ei=(0,Le.Z)((function(t){return t.push(void 0,vi),(0,wi.Z)(ki,void 0,t)})),Mi=Ei;function Si(t,...e){e.forEach((e=>{Object.getOwnPropertyNames(e.prototype).forEach((n=>{"constructor"!==n&&Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n))}))}))}const Ai=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])};function Di(t,e){function n(){this.constructor=t}Ai(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}class Pi{}const Oi=/^\s*class\s+/.test(`${Pi}`)||/^\s*class\s*\{/.test(`${class{}}`);function Ti(t,e){let n;return Oi?n=class extends e{}:(n=function(){return e.apply(this,arguments)},Di(n,e)),Object.defineProperty(n,"name",{value:t}),n}function Ni(t){return"__proto__"===t}function ji(t,e,n="/"){let i;const s=Array.isArray(e)?e:e.split(n);if(s.length){i=t;while(s.length){const t=s.shift();if(Object(i)!==i||!t||!(t in i))return;i=i[t]}}return i}function Fi(t,e,n,i="/"){const s=Array.isArray(e)?e:e.split(i),o=s.pop();if(o&&!Ni(o)){let e=t;s.forEach((t=>{Ni(t)||(null==e[t]&&(e[t]={}),e=e[t])})),e[o]=n}return t}function Li(t,e,n="/"){const i=Array.isArray(e)?e.slice():e.split(n),s=i.pop();if(s)if(i.length>0){const e=ji(t,i);e&&delete e[s]}else delete t[s];return t}var zi=n(77338);function Ii(t){return function(e){return null==t?void 0:t[e]}}var Bi=Ii,Ri={"&":"&","<":"<",">":">",'"':""","'":"'"},$i=Bi(Ri),Vi=$i,_i=/[&<>"']/g,Gi=RegExp(_i.source);function Hi(t){return t=(0,zi.Z)(t),t&&Gi.test(t)?t.replace(_i,Vi):t}var Ui=Hi,Wi={"&":"&","<":"<",">":">",""":'"',"'":"'"},qi=(Bi(Wi),/&(?:amp|lt|gt|quot|#39);/g);RegExp(qi.source);function Zi(t,e,n){return t===t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}var Xi=Zi,Yi=(n(42845),n(21357));function Ji(t,e,n){var i=-1,s=t.length;e<0&&(e=-e>s?0:s+e),n=n>s?s:n,n<0&&(n+=s),s=e>n?0:n-e>>>0,e>>>=0;var o=Array(s);while(++i<s)o[i]=t[i+e];return o}var Ki=Ji;function Qi(t,e,n){var i=t.length;return n=void 0===n?i:n,!e&&n>=i?t:Ki(t,e,n)}var ts=Qi,es="\\ud800-\\udfff",ns="\\u0300-\\u036f",is="\\ufe20-\\ufe2f",ss="\\u20d0-\\u20ff",os=ns+is+ss,rs="\\ufe0e\\ufe0f",as="\\u200d",ls=RegExp("["+as+es+os+rs+"]");function cs(t){return ls.test(t)}var hs=cs,us="[object RegExp]";function ds(t){return(0,On.Z)(t)&&(0,Dn.Z)(t)==us}var gs=ds,ps=n(98351),fs=ps.Z&&ps.Z.isRegExp;fs&&(0,De.Z)(fs);function ms(t){return t.split("")}var ys=ms,bs="\\ud800-\\udfff",ws="\\u0300-\\u036f",Cs="\\ufe20-\\ufe2f",vs="\\u20d0-\\u20ff",xs=ws+Cs+vs,ks="\\ufe0e\\ufe0f",Es="["+bs+"]",Ms="["+xs+"]",Ss="\\ud83c[\\udffb-\\udfff]",As="(?:"+Ms+"|"+Ss+")",Ds="[^"+bs+"]",Ps="(?:\\ud83c[\\udde6-\\uddff]){2}",Os="[\\ud800-\\udbff][\\udc00-\\udfff]",Ts="\\u200d",Ns=As+"?",js="["+ks+"]?",Fs="(?:"+Ts+"(?:"+[Ds,Ps,Os].join("|")+")"+js+Ns+")*",Ls=js+Ns+Fs,zs="(?:"+[Ds+Ms+"?",Ms,Ps,Os,Es].join("|")+")",Is=RegExp(Ss+"(?="+Ss+")|"+zs+Ls,"g");function Bs(t){return t.match(Is)||[]}var Rs=Bs;function $s(t){return hs(t)?Rs(t):ys(t)}var Vs=$s;Math.floor;ne("length");var _s="\\ud800-\\udfff",Gs="\\u0300-\\u036f",Hs="\\ufe20-\\ufe2f",Us="\\u20d0-\\u20ff",Ws=Gs+Hs+Us,qs="\\ufe0e\\ufe0f",Zs="["+_s+"]",Xs="["+Ws+"]",Ys="\\ud83c[\\udffb-\\udfff]",Js="(?:"+Xs+"|"+Ys+")",Ks="[^"+_s+"]",Qs="(?:\\ud83c[\\udde6-\\uddff]){2}",to="[\\ud800-\\udbff][\\udc00-\\udfff]",eo="\\u200d",no=Js+"?",io="["+qs+"]?",so="(?:"+eo+"(?:"+[Ks,Qs,to].join("|")+")"+io+no+")*",oo=io+no+so,ro="(?:"+[Ks+Xs+"?",Xs,Qs,to,Zs].join("|")+")";RegExp(Ys+"(?="+Ys+")|"+ro+oo,"g");Math.ceil;Math.ceil,Math.floor;var ao=Yn((function(t,e,n,i){(0,_n.Z)(e,(0,bn.Z)(e),t,i)})),lo=ao,co="[object DOMException]",ho="[object Error]";function uo(t){if(!(0,On.Z)(t))return!1;var e=(0,Dn.Z)(t);return e==ho||e==co||"string"==typeof t.message&&"string"==typeof t.name&&!Bn(t)}var go=uo,po=(0,Le.Z)((function(t,e){try{return(0,wi.Z)(t,void 0,e)}catch(n){return go(n)?n:new Error(n)}})),fo=po;function mo(t,e){return(0,ge.Z)(e,(function(e){return t[e]}))}var yo=mo,bo=Object.prototype,wo=bo.hasOwnProperty;function Co(t,e,n,i){return void 0===t||(0,ze.Z)(t,bo[n])&&!wo.call(i,n)?e:t}var vo=Co,xo={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function ko(t){return"\\"+xo[t]}var Eo=ko,Mo=/<%=([\s\S]+?)%>/g,So=Mo,Ao=/<%-([\s\S]+?)%>/g,Do=Ao,Po=/<%([\s\S]+?)%>/g,Oo=Po,To={escape:Do,evaluate:Oo,interpolate:So,variable:"",imports:{_:{escape:Ui}}},No=To,jo="Invalid `variable` option passed into `_.template`",Fo=/\b__p \+= '';/g,Lo=/\b(__p \+=) '' \+/g,zo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Io=/[()=,{}\[\]\/\s]/,Bo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ro=/($^)/,$o=/['\n\r\u2028\u2029\\]/g,Vo=Object.prototype,_o=Vo.hasOwnProperty;function Go(t,e,n){var i=No.imports._.templateSettings||No;n&&Re(t,e,n)&&(e=void 0),t=(0,zi.Z)(t),e=lo({},e,i,vo);var s,o,r=lo({},e.imports,i.imports,vo),a=(0,$t.Z)(r),l=yo(r,a),c=0,h=e.interpolate||Ro,u="__p += '",d=RegExp((e.escape||Ro).source+"|"+h.source+"|"+(h===So?Bo:Ro).source+"|"+(e.evaluate||Ro).source+"|$","g"),g=_o.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(d,(function(e,n,i,r,a,l){return i||(i=r),u+=t.slice(c,l).replace($o,Eo),n&&(s=!0,u+="' +\n__e("+n+") +\n'"),a&&(o=!0,u+="';\n"+a+";\n__p += '"),i&&(u+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),c=l+e.length,e})),u+="';\n";var p=_o.call(e,"variable")&&e.variable;if(p){if(Io.test(p))throw new Error(jo)}else u="with (obj) {\n"+u+"\n}\n";u=(o?u.replace(Fo,""):u).replace(Lo,"$1").replace(zo,"$1;"),u="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+u+"return __p\n}";var f=fo((function(){return Function(a,g+"return "+u).apply(void 0,l)}));if(f.source=u,go(f))throw f;return f}var Ho=Go,Uo=0;function Wo(t){var e=++Uo;return(0,zi.Z)(t)+e}var qo=Wo;function Zo(t,e,n,i){var s=-1,o=null==t?0:t.length;i&&o&&(n=t[++s]);while(++s<o)n=e(n,t[s],s,t);return n}var Xo=Zo,Yo={"À":"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"},Jo=Bi(Yo),Ko=Jo,Qo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,tr="\\u0300-\\u036f",er="\\ufe20-\\ufe2f",nr="\\u20d0-\\u20ff",ir=tr+er+nr,sr="["+ir+"]",or=RegExp(sr,"g");function rr(t){return t=(0,zi.Z)(t),t&&t.replace(Qo,Ko).replace(or,"")}var ar=rr,lr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function cr(t){return t.match(lr)||[]}var hr=cr,ur=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function dr(t){return ur.test(t)}var gr=dr,pr="\\ud800-\\udfff",fr="\\u0300-\\u036f",mr="\\ufe20-\\ufe2f",yr="\\u20d0-\\u20ff",br=fr+mr+yr,wr="\\u2700-\\u27bf",Cr="a-z\\xdf-\\xf6\\xf8-\\xff",vr="\\xac\\xb1\\xd7\\xf7",xr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",kr="\\u2000-\\u206f",Er=" \\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",Mr="A-Z\\xc0-\\xd6\\xd8-\\xde",Sr="\\ufe0e\\ufe0f",Ar=vr+xr+kr+Er,Dr="['’]",Pr="["+Ar+"]",Or="["+br+"]",Tr="\\d+",Nr="["+wr+"]",jr="["+Cr+"]",Fr="[^"+pr+Ar+Tr+wr+Cr+Mr+"]",Lr="\\ud83c[\\udffb-\\udfff]",zr="(?:"+Or+"|"+Lr+")",Ir="[^"+pr+"]",Br="(?:\\ud83c[\\udde6-\\uddff]){2}",Rr="[\\ud800-\\udbff][\\udc00-\\udfff]",$r="["+Mr+"]",Vr="\\u200d",_r="(?:"+jr+"|"+Fr+")",Gr="(?:"+$r+"|"+Fr+")",Hr="(?:"+Dr+"(?:d|ll|m|re|s|t|ve))?",Ur="(?:"+Dr+"(?:D|LL|M|RE|S|T|VE))?",Wr=zr+"?",qr="["+Sr+"]?",Zr="(?:"+Vr+"(?:"+[Ir,Br,Rr].join("|")+")"+qr+Wr+")*",Xr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Yr="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Jr=qr+Wr+Zr,Kr="(?:"+[Nr,Br,Rr].join("|")+")"+Jr,Qr=RegExp([$r+"?"+jr+"+"+Hr+"(?="+[Pr,$r,"$"].join("|")+")",Gr+"+"+Ur+"(?="+[Pr,$r+_r,"$"].join("|")+")",$r+"?"+_r+"+"+Hr,$r+"+"+Ur,Yr,Xr,Tr,Kr].join("|"),"g");function ta(t){return t.match(Qr)||[]}var ea=ta;function na(t,e,n){return t=(0,zi.Z)(t),e=n?void 0:e,void 0===e?gr(t)?ea(t):hr(t):t.match(e)||[]}var ia=na,sa="['’]",oa=RegExp(sa,"g");function ra(t){return function(e){return Xo(ia(ar(e).replace(oa,"")),t,"")}}var aa=ra;function la(t){return function(e){e=(0,zi.Z)(e);var n=hs(e)?Vs(e):void 0,i=n?n[0]:e.charAt(0),s=n?ts(n,1).join(""):e.slice(1);return i[t]()+s}}var ca=la,ha=ca("toUpperCase"),ua=ha,da=aa((function(t,e,n){return t+(n?" ":"")+ua(e)})),ga=da;function pa(t){return ua((0,zi.Z)(t).toLowerCase())}var fa=pa,ma=aa((function(t,e,n){return e=e.toLowerCase(),t+(n?fa(e):e)})),ya=ma,ba=aa((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),wa=ba,Ca=aa((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),va=Ca,xa=ca("toLowerCase"),ka=xa;const Ea=t=>{const e=Object.create(null);return n=>{const i=e[n];return i||(e[n]=t(n))}},Ma=Ea((t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase())),Sa=Ea((t=>ga(ya(t)).replace(/ /g,"")));Ea((t=>wa(t).replace(/ /g,"_"))),Ea((t=>va(t).replace(/ /g,"."))),Ea((t=>va(t).replace(/ /g,"/"))),Ea((t=>ua(va(t)))),Ea((t=>ga(ya(t))));function Aa(t){let e=2166136261,n=!1,i=t;for(let s=0,o=i.length;s<o;s+=1){let t=i.charCodeAt(s);t>127&&!n&&(i=unescape(encodeURIComponent(i)),t=i.charCodeAt(s),n=!0),e^=t,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function Da(){let t="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let n=0,i=e.length;n<i;n+=1){const i=e[n],s=16*Math.random()|0,o="x"===i?s:"y"===i?3&s|8:i;t+=o.toString(16)}return t}function Pa(t,e={}){const n=lt().parseHTML(t,null,!1);return n.forEach((t=>{const e=t;if(e){const t=e.attributes;if(t)for(let n=0,i=t.length;n<i;n+=1){const i=t.item(n);if(i){const t=i.value.toLowerCase(),n=i.name.toLowerCase();(n.startsWith("on")||t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:"))&&e.removeAttribute(n)}}}})),e.raw?n:lt()("<div/>").append(n).html()}function Oa(t,e,n){const i=Math.min(2,Math.floor(.34*t.length));let s,o=Math.floor(.4*t.length)+1,r=!1;const a=t.toLowerCase();for(const l of e){const e=n(l);if(void 0!==e&&Math.abs(e.length-a.length)<=i){const n=e.toLowerCase();if(n===a){if(e===t)continue;return l}if(r)continue;if(e.length<3)continue;const i=Ta(a,n,o-1);if(void 0===i)continue;i<3?(r=!0,s=l):(o=i,s=l)}}return s}function Ta(t,e,n){let i=new Array(e.length+1),s=new Array(e.length+1);const o=n+1;for(let a=0;a<=e.length;a+=1)i[a]=a;for(let a=1;a<=t.length;a+=1){const r=t.charCodeAt(a-1),l=a>n?a-n:1,c=e.length>n+a?n+a:e.length;s[0]=a;let h=a;for(let t=1;t<l;t+=1)s[t]=o;for(let t=l;t<=c;t+=1){const n=r===e.charCodeAt(t-1)?i[t-1]:Math.min(i[t]+1,s[t-1]+1,i[t-1]+2);s[t]=n,h=Math.min(h,n)}for(let t=c+1;t<=e.length;t+=1)s[t]=o;if(h>n)return;const u=i;i=s,s=u}const r=i[e.length];return r>n?void 0:r}var Na="[object Number]";function ja(t){return"number"==typeof t||(0,On.Z)(t)&&(0,Dn.Z)(t)==Na}var Fa=ja;var La=n(66092);La.Z.isFinite;function za(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(0,Yi.Z)(n),n=n===n?n:0),void 0!==e&&(e=(0,Yi.Z)(e),e=e===e?e:0),Xi((0,Yi.Z)(t),e,n)}var Ia=za;Math.max,Math.min;La.Z.parseInt;const Ba=t=>!Array.isArray(t)&&t-parseFloat(t)+1>=0;function Ra(t){return"string"===typeof t&&"%"===t.slice(-1)}function $a(t,e){if(null==t)return 0;let n;if("string"===typeof t){if(n=parseFloat(t),Ra(t)&&(n/=100,Number.isFinite(n)))return n*e}else n=t;return Number.isFinite(n)?n>0&&n<1?n*e:n:0}function Va(t,e){function n(e){const n=new RegExp(`(?:\\d+(?:\\.\\d+)*)(${e})$`).exec(t);return n?n[1]:null}const i=parseFloat(t);if(Number.isNaN(i))return null;let s;if(null==e)s="[A-Za-z]*";else if(Array.isArray(e)){if(0===e.length)return null;s=e.join("|")}else"string"===typeof e&&(s=e);const o=n(s);return null===o?null:{unit:o,value:i}}function _a(t){if("object"===typeof t){let e=0,n=0,i=0,s=0;return null!=t.vertical&&Number.isFinite(t.vertical)&&(n=s=t.vertical),null!=t.horizontal&&Number.isFinite(t.horizontal)&&(i=e=t.horizontal),null!=t.left&&Number.isFinite(t.left)&&(e=t.left),null!=t.top&&Number.isFinite(t.top)&&(n=t.top),null!=t.right&&Number.isFinite(t.right)&&(i=t.right),null!=t.bottom&&Number.isFinite(t.bottom)&&(s=t.bottom),{top:n,right:i,bottom:s,left:e}}let e=0;return null!=t&&Number.isFinite(t)&&(e=t),{top:e,right:e,bottom:e,left:e}}n(42054);var Ga=n(36409),Ha="Expected a function";function Ua(t,e,n){if("function"!=typeof t)throw new TypeError(Ha);return setTimeout((function(){t.apply(void 0,n)}),e)}var Wa=Ua,qa=(0,Le.Z)((function(t,e){return Wa(t,1,e)})),Za=qa;function Xa(t,e,n){if(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]);case 4:return t.call(e,n[0],n[1],n[2],n[3]);case 5:return t.call(e,n[0],n[1],n[2],n[3],n[4]);case 6:return t.call(e,n[0],n[1],n[2],n[3],n[4],n[5]);default:return t.apply(e,n)}return t.call(e)}function Ya(t,e,...n){return Xa(t,e,n)}function Ja(t){return"object"===typeof t&&t.then&&"function"===typeof t.then}function Ka(t){return null!=t&&(t instanceof Promise||Ja(t))}function Qa(...t){const e=[];t.forEach((t=>{Array.isArray(t)?e.push(...t):e.push(t)}));const n=e.some((t=>Ka(t)));if(n){const t=e.map((t=>Ka(t)?t:Promise.resolve(!1!==t)));return Promise.all(t).then((t=>t.reduce(((t,e)=>!1!==e&&t),!0)))}return e.every((t=>!1!==t))}function tl(...t){const e=Qa(t);return"boolean"===typeof e?Promise.resolve(e):e}const el=/[\t\r\n\f]/g,nl=/\S+/g,il=t=>` ${t} `;function sl(t){return t&&t.getAttribute&&t.getAttribute("class")||""}function ol(t,e){if(null==t||null==e)return!1;const n=il(sl(t)),i=il(e);return 1===t.nodeType&&n.replace(el," ").includes(i)}function rl(t,e){if(null!=t&&null!=e){if("function"===typeof e)return rl(t,e(sl(t)));if("string"===typeof e&&1===t.nodeType){const n=e.match(nl)||[],i=il(sl(t)).replace(el," ");let s=n.reduce(((t,e)=>t.indexOf(il(e))<0?`${t}${e} `:t),i);s=s.trim(),i!==s&&t.setAttribute("class",s)}}}function al(t,e){if(null!=t){if("function"===typeof e)return al(t,e(sl(t)));if((!e||"string"===typeof e)&&1===t.nodeType){const n=(e||"").match(nl)||[],i=il(sl(t)).replace(el," ");let s=n.reduce(((t,e)=>{const n=il(e);return t.indexOf(n)>-1?t.replace(n," "):t}),i);s=e?s.trim():"",i!==s&&t.setAttribute("class",s)}}}function ll(t,e,n){if(null!=t&&null!=e)if(null==n||"string"!==typeof e){if("function"===typeof e)return ll(t,e(sl(t),n),n);if("string"===typeof e){const n=e.match(nl)||[];n.forEach((e=>{ol(t,e)?al(t,e):rl(t,e)}))}}else n?rl(t,e):al(t,e)}let cl=0;function hl(){return cl+=1,`v${cl}`}function ul(t){return null!=t.id&&""!==t.id||(t.id=hl()),t.id}function dl(t){return null!=t&&("function"===typeof t.getScreenCTM&&t instanceof SVGElement)}const gl={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},pl="1.1";function fl(t,e=document){return e.createElement(t)}function ml(t,e=gl.xhtml,n=document){return n.createElementNS(e,t)}function yl(t,e=document){return ml(t,gl.svg,e)}function bl(t){if(t){const e=`<svg xmlns="${gl.svg}" xmlns:xlink="${gl.xlink}" version="${pl}">${t}</svg>`,{documentElement:n}=wl(e,{async:!1});return n}const e=document.createElementNS(gl.svg,"svg");return e.setAttributeNS(gl.xmlns,"xmlns:xlink",gl.xlink),e.setAttribute("version",pl),e}function wl(t,e={}){let n;try{const i=new DOMParser;if(null!=e.async){const t=i;t.async=e.async}n=i.parseFromString(t,e.mimeType||"text/xml")}catch(i){n=void 0}if(!n||n.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${t}`);return n}function Cl(t,e=!0){const n=t.nodeName;return e?n.toLowerCase():n.toUpperCase()}function vl(t){let e=0,n=t.previousSibling;while(n)1===n.nodeType&&(e+=1),n=n.previousSibling;return e}function xl(t,e){return t.querySelectorAll(e)}function kl(t,e){return t.querySelector(e)}function El(t,e,n){const i=t.ownerSVGElement;let s=t.parentNode;while(s&&s!==n&&s!==i){if(ol(s,e))return s;s=s.parentNode}return null}function Ml(t,e){const n=e&&e.parentNode;return t===n||!!(n&&1===n.nodeType&&16&t.compareDocumentPosition(n))}function Sl(t){t.parentNode&&t.parentNode.removeChild(t)}function Al(t){while(t.firstChild)t.removeChild(t.firstChild)}function Dl(t,e){const n=Array.isArray(e)?e:[e];n.forEach((e=>{null!=e&&t.appendChild(e)}))}function Pl(t,e){const n=t.firstChild;return n?Ol(n,e):Dl(t,e)}function Ol(t,e){const n=t.parentNode;if(n){const i=Array.isArray(e)?e:[e];i.forEach((e=>{null!=e&&n.insertBefore(e,t)}))}}function Tl(t,e){null!=e&&e.appendChild(t)}function Nl(t){try{return t instanceof HTMLElement}catch(e){return"object"===typeof t&&1===t.nodeType&&"object"===typeof t.style&&"object"===typeof t.ownerDocument}}const jl=["viewBox"];function Fl(t,e){return t.getAttribute(e)}function Ll(t,e){const n=Rl(e);n.ns?t.hasAttributeNS(n.ns,n.local)&&t.removeAttributeNS(n.ns,n.local):t.hasAttribute(e)&&t.removeAttribute(e)}function zl(t,e,n){if(null==n)return Ll(t,e);const i=Rl(e);i.ns&&"string"===typeof n?t.setAttributeNS(i.ns,e,n):"id"===e?t.id=`${n}`:t.setAttribute(e,`${n}`)}function Il(t,e){Object.keys(e).forEach((n=>{zl(t,n,e[n])}))}function Bl(t,e,n){if(null==e){const e=t.attributes,n={};for(let t=0;t<e.length;t+=1)n[e[t].name]=e[t].value;return n}if("string"===typeof e&&void 0===n)return t.getAttribute(e);"object"===typeof e?Il(t,e):zl(t,e,n)}function Rl(t){if(-1!==t.indexOf(":")){const e=t.split(":");return{ns:gl[e[0]],local:e[1]}}return{ns:null,local:t}}function $l(t){const e={};return Object.keys(t).forEach((n=>{const i=jl.includes(n)?n:Ma(n);e[i]=t[n]})),e}function Vl(t){const e={},n=t.split(";");return n.forEach((t=>{const n=t.trim();if(n){const t=n.split("=");t.length&&(e[t[0].trim()]=t[1]?t[1].trim():"")}})),e}function _l(t,e){return Object.keys(e).forEach((n=>{if("class"===n)t[n]=t[n]?`${t[n]} ${e[n]}`:e[n];else if("style"===n){const i="object"===typeof t[n],s="object"===typeof e[n];let o,r;i&&s?(o=t[n],r=e[n]):i?(o=t[n],r=Vl(e[n])):s?(o=Vl(t[n]),r=e[n]):(o=Vl(t[n]),r=Vl(e[n])),t[n]=_l(o,r)}else t[n]=e[n]})),t}function Gl(t,e,n={}){const i=n.offset||0,s=[],o=[];let r,a,l=null;for(let c=0;c<t.length;c+=1){r=o[c]=t[c];for(let s=0,a=e.length;s<a;s+=1){const a=e[s],l=a.start+i,h=a.end+i;c>=l&&c<h&&("string"===typeof r?r=o[c]={t:t[c],attrs:a.attrs}:r.attrs=_l(_l({},r.attrs),a.attrs),n.includeAnnotationIndices&&(null==r.annotations&&(r.annotations=[]),r.annotations.push(s)))}a=o[c-1],a?It.Z(r)&&It.Z(a)?(l=l,JSON.stringify(r.attrs)===JSON.stringify(a.attrs)?l.t+=r.t:(s.push(l),l=r)):It.Z(r)||It.Z(a)?(l=l,s.push(l),l=r):l=(l||"")+r:l=r}return null!=l&&s.push(l),s}function Hl(t){return t.replace(/ /g," ")}var Ul,Wl;let ql;(function(t){function e(t){return null===t||void 0===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t}function n(t){return Array.isArray(t)}function i(t){return!e(t)&&!n(t)}function s(t,i){if(t===i)return!0;if(e(t)||e(i))return!1;const s=n(t),o=n(i);return s===o&&(s&&o?r(t,i):a(t,i))}function o(t){return e(t)?t:n(t)?l(t):c(t)}function r(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n+=1)if(!s(t[n],e[n]))return!1;return!0}function a(t,e){if(t===e)return!0;for(const n in t)if(!(n in e))return!1;for(const n in e)if(!(n in t))return!1;for(const n in t)if(!s(t[n],e[n]))return!1;return!0}function l(t){const e=new Array(t.length);for(let n=0,i=t.length;n<i;n+=1)e[n]=o(t[n]);return e}function c(t){const e={};return Object.keys(t).forEach((n=>{e[n]=o(t[n])})),e}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=n,t.isObject=i,t.deepEqual=s,t.deepCopy=o})(Ul||(Ul={})),function(t){function e(t){const e="data:";return t.substr(0,e.length)===e}function n(t,n){if(!t||e(t))return void setTimeout((()=>n(null,t)));const i=()=>{n(new Error(`Failed to load image: ${t}`))},s=window.FileReader?t=>{if(200===t.status){const e=new FileReader;e.onload=t=>{const e=t.target.result;n(null,e)},e.onerror=i,e.readAsDataURL(t.response)}else i()}:e=>{const s=t=>{const e=32768,n=[];for(let i=0;i<t.length;i+=e)n.push(String.fromCharCode.apply(null,t.subarray(i,i+e)));return n.join("")};if(200===e.status){let i=t.split(".").pop()||"png";"svg"===i&&(i="svg+xml");const o=`data:image/${i};base64,`,r=new Uint8Array(e.response),a=o+btoa(s(r));n(null,a)}else i()},o=new XMLHttpRequest;o.responseType=window.FileReader?"blob":"arraybuffer",o.open("GET",t,!0),o.addEventListener("error",i),o.addEventListener("load",(()=>s(o))),o.send()}function i(t){let e=t.replace(/\s/g,"");e=decodeURIComponent(e);const n=e.indexOf(","),i=e.slice(0,n),s=i.split(":")[1].split(";")[0],o=e.slice(n+1);let r;r=i.indexOf("base64")>=0?atob(o):unescape(encodeURIComponent(o));const a=new Uint8Array(r.length);for(let l=0;l<r.length;l+=1)a[l]=r.charCodeAt(l);return new Blob([a],{type:s})}function s(t,e){const n=window.navigator.msSaveBlob;if(n)n(t,e);else{const n=window.URL.createObjectURL(t),i=document.createElement("a");i.href=n,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)}}function o(t,e){const n=i(t);s(n,e)}function r(t){const e=t.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return e&&e[2]?e[2].replace(/\s+/," ").split(" "):null}function a(t){const e=parseFloat(t);return Number.isNaN(e)?null:e}function l(t,e={}){let n=null;const i=e=>(null==n&&(n=r(t)),null!=n?a(n[e]):null),s=e=>{const n=t.match(e);return n&&n[2]?a(n[2]):null};let o=e.width;if(null==o&&(o=s(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==o&&(o=i(2)),null==o)throw new Error("Can not parse width from svg string");let l=e.height;if(null==l&&(l=s(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==l&&(l=i(3)),null==l)throw new Error("Can not parse height from svg string");const c=encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22"),h="data:image/svg+xml",u=`${h},${c}`;return u}t.isDataUrl=e,t.imageToDataUri=n,t.dataUriToBlob=i,t.downloadBlob=s,t.downloadDataUri=o,t.svgToDataUrl=l}(Wl||(Wl={}));const Zl={px(t){return t},mm(t){return ql*t},cm(t){return ql*t*10},in(t){return ql*t*25.4},pt(t){return ql*(25.4*t/72)},pc(t){return ql*(25.4*t/6)}};var Xl;(function(t){function e(t,e,n){const i=lt()("<div/>").css({display:"inline-block",position:"absolute",left:-15e3,top:-15e3,width:t+(n||""),height:e+(n||"")}).appendTo(document.body),s={width:i.width()||0,height:i.height()||0};return i.remove(),s}function n(t,n){null==ql&&(ql=e("1","1","mm").width);const i=n?Zl[n]:null;return i?i(t):t}t.measure=e,t.toPx=n})(Xl||(Xl={}));const Yl=function(){let t;const e=window;if(null!=e&&(t=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame,null!=t&&(t=t.bind(e))),null==t){let e=0;t=t=>{const n=(new Date).getTime(),i=Math.max(0,16-(n-e)),s=setTimeout((()=>{t(n+i)}),i);return e=n+i,s}}return t}(),Jl=function(){let t;const e=window;return null!=e&&(t=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.webkitCancelRequestAnimationFrame||e.msCancelAnimationFrame||e.msCancelRequestAnimationFrame||e.oCancelAnimationFrame||e.oCancelRequestAnimationFrame||e.mozCancelAnimationFrame||e.mozCancelRequestAnimationFrame,t&&(t=t.bind(e))),null==t&&(t=clearTimeout),t}();document&&document.createElement("div").style;function Kl(t,e){const n=t.ownerDocument&&t.ownerDocument.defaultView&&t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):window.getComputedStyle(t,null);return n&&e?n.getPropertyValue(e)||n[e]:n}(function(){const t=document;t.selection||window.getSelection})();var Ql;function tc(t,e=0){return Number.isInteger(t)?t:+t.toFixed(e)}function ec(t,e){let n,i;if(null==e?(i=null==t?1:t,n=0):(i=e,n=null==t?0:t),i<n){const t=n;n=i,i=t}return Math.floor(Math.random()*(i-n+1)+n)}function nc(t,e,n){return Number.isNaN(t)?NaN:Number.isNaN(e)||Number.isNaN(n)?0:e<n?t<e?e:t>n?n:t:t<n?n:t>e?e:t}function ic(t,e){return e*Math.round(t/e)}function sc(t,e){return null!=e&&null!=t&&e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function oc(t,e){const n=t.x-e.x,i=t.y-e.y;return n*n+i*i}(function(t){function e(t){return 180*t/Math.PI%360}function n(t){return t%360+(t<0?360:0)}t.toDeg=e,t.toRad=function(t,e=!1){const n=e?t:t%360;return n*Math.PI/180},t.normalize=n})(Ql||(Ql={}));class rc{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class ac extends rc{constructor(t,e){super(),this.x=null==t?0:t,this.y=null==e?0:e}get[Symbol.toStringTag](){return ac.toStringTag}round(t=0){return this.x=tc(this.x,t),this.y=tc(this.y,t),this}add(t,e){const n=ac.create(t,e);return this.x+=n.x,this.y+=n.y,this}update(t,e){const n=ac.create(t,e);return this.x=n.x,this.y=n.y,this}translate(t,e){const n=ac.create(t,e);return this.x+=n.x,this.y+=n.y,this}rotate(t,e){const n=ac.rotate(this,t,e);return this.x=n.x,this.y=n.y,this}scale(t,e,n=new ac){const i=ac.create(n);return this.x=i.x+t*(this.x-i.x),this.y=i.y+e*(this.y-i.y),this}closest(t){if(1===t.length)return ac.create(t[0]);let e=null,n=1/0;return t.forEach((t=>{const i=this.squaredDistance(t);i<n&&(e=t,n=i)})),e?ac.create(e):null}distance(t){return Math.sqrt(this.squaredDistance(t))}squaredDistance(t){const e=ac.create(t),n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistance(t){const e=ac.create(t);return Math.abs(e.x-this.x)+Math.abs(e.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(t=new ac){const e=ac.create(t),n=-(e.y-this.y),i=e.x-this.x;let s=Math.atan2(n,i);return s<0&&(s=2*Math.PI+s),180*s/Math.PI}angleBetween(t,e){if(this.equals(t)||this.equals(e))return NaN;let n=this.theta(e)-this.theta(t);return n<0&&(n+=360),n}vectorAngle(t){const e=new ac(0,0);return e.angleBetween(this,t)}toPolar(t){return this.update(ac.toPolar(this,t)),this}changeInAngle(t,e,n=new ac){return this.clone().translate(-t,-e).theta(n)-this.theta(n)}adhereToRect(t){return sc(t,this)||(this.x=Math.min(Math.max(this.x,t.x),t.x+t.width),this.y=Math.min(Math.max(this.y,t.y),t.y+t.height)),this}bearing(t){const e=ac.create(t),n=Ql.toRad(this.y),i=Ql.toRad(e.y),s=this.x,o=e.x,r=Ql.toRad(o-s),a=Math.sin(r)*Math.cos(i),l=Math.cos(n)*Math.sin(i)-Math.sin(n)*Math.cos(i)*Math.cos(r),c=Ql.toDeg(Math.atan2(a,l)),h=["NE","E","SE","S","SW","W","NW","N"];let u=c-22.5;return u<0&&(u+=360),u=parseInt(u/45,10),h[u]}cross(t,e){if(null!=t&&null!=e){const n=ac.create(t),i=ac.create(e);return(i.x-this.x)*(n.y-this.y)-(i.y-this.y)*(n.x-this.x)}return NaN}dot(t){const e=ac.create(t);return this.x*e.x+this.y*e.y}diff(t,e){if("number"===typeof t)return new ac(this.x-t,this.y-e);const n=ac.create(t);return new ac(this.x-n.x,this.y-n.y)}lerp(t,e){const n=ac.create(t);return new ac((1-e)*this.x+e*n.x,(1-e)*this.y+e*n.y)}normalize(t=1){const e=t/this.magnitude();return this.scale(e,e)}move(t,e){const n=ac.create(t),i=Ql.toRad(n.theta(this));return this.translate(Math.cos(i)*e,-Math.sin(i)*e)}reflection(t){return ac.create(t).move(this,this.distance(t))}snapToGrid(t,e){return this.x=ic(this.x,t),this.y=ic(this.y,null==e?t:e),this}equals(t){const e=ac.create(t);return null!=e&&e.x===this.x&&e.y===this.y}clone(){return ac.clone(this)}toJSON(){return ac.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"number"===typeof i.x&&"number"===typeof i.y&&"function"===typeof i.toPolar}t.toStringTag=`X6.Geometry.${t.name}`,t.isPoint=e})(ac||(ac={})),function(t){function e(t){return null!=t&&"object"===typeof t&&"number"===typeof t.x&&"number"===typeof t.y}function n(t){return null!=t&&Array.isArray(t)&&2===t.length&&"number"===typeof t[0]&&"number"===typeof t[1]}t.isPointLike=e,t.isPointData=n}(ac||(ac={})),function(t){function e(e,i){return null==e||"number"===typeof e?new t(e,i):n(e)}function n(e){return t.isPoint(e)?new t(e.x,e.y):Array.isArray(e)?new t(e[0],e[1]):new t(e.x,e.y)}function i(e){return t.isPoint(e)?{x:e.x,y:e.y}:Array.isArray(e)?{x:e[0],y:e[1]}:{x:e.x,y:e.y}}function s(e,i,s=new t){let o=Math.abs(e*Math.cos(i)),r=Math.abs(e*Math.sin(i));const a=n(s),l=Ql.normalize(Ql.toDeg(i));return l<90?r=-r:l<180?(o=-o,r=-r):l<270&&(o=-o),new t(a.x+o,a.y+r)}function o(e,i=new t){const s=n(e),o=n(i),r=s.x-o.x,a=s.y-o.y;return new t(Math.sqrt(r*r+a*a),Ql.toRad(o.theta(s)))}function r(t,e){return t===e||null!=t&&null!=e&&(t.x===e.x&&t.y===e.y)}function a(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!==e.length)return!1;if(null!=t&&null!=e)for(let n=0,i=t.length;n<i;n+=1)if(!r(t[n],e[n]))return!1;return!0}function l(e,n,i,s){return new t(ec(e,n),ec(i,s))}function c(t,e,n){const i=Ql.toRad(Ql.normalize(-e)),s=Math.sin(i),o=Math.cos(i);return h(t,o,s,n)}function h(e,i,s,o=new t){const r=n(e),a=n(o),l=r.x-a.x,c=r.y-a.y,h=l*i-c*s,u=c*i+l*s;return new t(h+a.x,u+a.y)}t.create=e,t.clone=n,t.toJSON=i,t.fromPolar=s,t.toPolar=o,t.equals=r,t.equalPoints=a,t.random=l,t.rotate=c,t.rotateEx=h}(ac||(ac={}));class lc extends rc{constructor(t,e,n,i){super(),this.x=null==t?0:t,this.y=null==e?0:e,this.width=null==n?0:n,this.height=null==i?0:i}get[Symbol.toStringTag](){return lc.toStringTag}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new ac(this.x,this.y)}get topLeft(){return new ac(this.x,this.y)}get topCenter(){return new ac(this.x+this.width/2,this.y)}get topRight(){return new ac(this.x+this.width,this.y)}get center(){return new ac(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new ac(this.x,this.y+this.height)}get bottomCenter(){return new ac(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new ac(this.x+this.width,this.y+this.height)}get corner(){return new ac(this.x+this.width,this.y+this.height)}get rightMiddle(){return new ac(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new ac(this.x,this.y+this.height/2)}get topLine(){return new cc(this.topLeft,this.topRight)}get rightLine(){return new cc(this.topRight,this.bottomRight)}get bottomLine(){return new cc(this.bottomLeft,this.bottomRight)}get leftLine(){return new cc(this.topLeft,this.bottomLeft)}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(t){if(!t)return this.clone();const e=Ql.toRad(t),n=Math.abs(Math.sin(e)),i=Math.abs(Math.cos(e)),s=this.width*i+this.height*n,o=this.width*n+this.height*i;return new lc(this.x+(this.width-s)/2,this.y+(this.height-o)/2,s,o)}round(t=0){return this.x=tc(this.x,t),this.y=tc(this.y,t),this.width=tc(this.width,t),this.height=tc(this.height,t),this}add(t,e,n,i){const s=lc.create(t,e,n,i),o=Math.min(this.x,s.x),r=Math.min(this.y,s.y),a=Math.max(this.x+this.width,s.x+s.width),l=Math.max(this.y+this.height,s.y+s.height);return this.x=o,this.y=r,this.width=a-o,this.height=l-r,this}update(t,e,n,i){const s=lc.create(t,e,n,i);return this.x=s.x,this.y=s.y,this.width=s.width,this.height=s.height,this}inflate(t,e){const n=t,i=null!=e?e:t;return this.x-=n,this.y-=i,this.width+=2*n,this.height+=2*i,this}snapToGrid(t,e){const n=this.origin.snapToGrid(t,e),i=this.corner.snapToGrid(t,e);return this.x=n.x,this.y=n.y,this.width=i.x-n.x,this.height=i.y-n.y,this}translate(t,e){const n=ac.create(t,e);return this.x+=n.x,this.y+=n.y,this}scale(t,e,n=new ac){const i=this.origin.scale(t,e,n);return this.x=i.x,this.y=i.y,this.width*=t,this.height*=e,this}rotate(t,e=this.getCenter()){if(0!==t){const n=Ql.toRad(t),i=Math.cos(n),s=Math.sin(n);let o=this.getOrigin(),r=this.getTopRight(),a=this.getBottomRight(),l=this.getBottomLeft();o=ac.rotateEx(o,i,s,e),r=ac.rotateEx(r,i,s,e),a=ac.rotateEx(a,i,s,e),l=ac.rotateEx(l,i,s,e);const c=new lc(o.x,o.y,0,0);c.add(r.x,r.y,0,0),c.add(a.x,a.y,0,0),c.add(l.x,l.y,0,0),this.update(c)}return this}rotate90(){const t=(this.width-this.height)/2;this.x+=t,this.y-=t;const e=this.width;return this.width=this.height,this.height=e,this}moveAndExpand(t){const e=lc.clone(t);return this.x+=e.x||0,this.y+=e.y||0,this.width+=e.width||0,this.height+=e.height||0,this}getMaxScaleToFit(t,e=this.center){const n=lc.clone(t),i=e.x,s=e.y;let o=1/0,r=1/0,a=1/0,l=1/0,c=1/0,h=1/0,u=1/0,d=1/0;const g=n.topLeft;g.x<i&&(o=(this.x-i)/(g.x-i)),g.y<s&&(c=(this.y-s)/(g.y-s));const p=n.bottomRight;p.x>i&&(r=(this.x+this.width-i)/(p.x-i)),p.y>s&&(h=(this.y+this.height-s)/(p.y-s));const f=n.topRight;f.x>i&&(a=(this.x+this.width-i)/(f.x-i)),f.y<s&&(u=(this.y-s)/(f.y-s));const m=n.bottomLeft;return m.x<i&&(l=(this.x-i)/(m.x-i)),m.y>s&&(d=(this.y+this.height-s)/(m.y-s)),{sx:Math.min(o,r,a,l),sy:Math.min(c,h,u,d)}}getMaxUniformScaleToFit(t,e=this.center){const n=this.getMaxScaleToFit(t,e);return Math.min(n.sx,n.sy)}containsPoint(t,e){return sc(this,ac.create(t,e))}containsRect(t,e,n,i){const s=lc.create(t,e,n,i),o=this.x,r=this.y,a=this.width,l=this.height,c=s.x,h=s.y,u=s.width,d=s.height;return 0!==a&&0!==l&&0!==u&&0!==d&&(c>=o&&h>=r&&c+u<=o+a&&h+d<=r+l)}intersectsWithLine(t){const e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],i=[];return e.forEach((e=>{const s=t.intersectsWithLine(e);null!==s&&i.indexOf(s.toString())<0&&(n.push(s),i.push(s.toString()))})),n.length>0?n:null}intersectsWithLineFromCenterToPoint(t,e){const n=ac.clone(t),i=this.center;let s=null;null!=e&&0!==e&&n.rotate(e,i);const o=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],r=new cc(i,n);for(let a=o.length-1;a>=0;a-=1){const t=o[a].intersectsWithLine(r);if(null!==t){s=t;break}}return s&&null!=e&&0!==e&&s.rotate(-e,i),s}intersectsWithRect(t,e,n,i){const s=lc.create(t,e,n,i);if(!this.isIntersectWithRect(s))return null;const o=this.origin,r=this.corner,a=s.origin,l=s.corner,c=Math.max(o.x,a.x),h=Math.max(o.y,a.y);return new lc(c,h,Math.min(r.x,l.x)-c,Math.min(r.y,l.y)-h)}isIntersectWithRect(t,e,n,i){const s=lc.create(t,e,n,i),o=this.origin,r=this.corner,a=s.origin,l=s.corner;return!(l.x<=o.x||l.y<=o.y||a.x>=r.x||a.y>=r.y)}normalize(){let t=this.x,e=this.y,n=this.width,i=this.height;return this.width<0&&(t=this.x+this.width,n=-this.width),this.height<0&&(e=this.y+this.height,i=-this.height),this.x=t,this.y=e,this.width=n,this.height=i,this}union(t){const e=lc.clone(t),n=this.origin,i=this.corner,s=e.origin,o=e.corner,r=Math.min(n.x,s.x),a=Math.min(n.y,s.y),l=Math.max(i.x,o.x),c=Math.max(i.y,o.y);return new lc(r,a,l-r,c-a)}getNearestSideToPoint(t){const e=ac.clone(t),n=e.x-this.x,i=this.x+this.width-e.x,s=e.y-this.y,o=this.y+this.height-e.y;let r=n,a="left";return i<r&&(r=i,a="right"),s<r&&(r=s,a="top"),o<r&&(a="bottom"),a}getNearestPointToPoint(t){const e=ac.clone(t);if(this.containsPoint(e)){const t=this.getNearestSideToPoint(e);switch(t){case"right":return new ac(this.x+this.width,e.y);case"left":return new ac(this.x,e.y);case"bottom":return new ac(e.x,this.y+this.height);case"top":return new ac(e.x,this.y);default:break}}return e.adhereToRect(this)}equals(t){return null!=t&&t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height}clone(){return new lc(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"number"===typeof i.x&&"number"===typeof i.y&&"number"===typeof i.width&&"number"===typeof i.height&&"function"===typeof i.inflate&&"function"===typeof i.moveAndExpand}t.toStringTag=`X6.Geometry.${t.name}`,t.isRectangle=e})(lc||(lc={})),function(t){function e(t){return null!=t&&"object"===typeof t&&"number"===typeof t.x&&"number"===typeof t.y&&"number"===typeof t.width&&"number"===typeof t.height}t.isRectangleLike=e}(lc||(lc={})),function(t){function e(e,i,s,o){return null==e||"number"===typeof e?new t(e,i,s,o):n(e)}function n(e){return t.isRectangle(e)?e.clone():Array.isArray(e)?new t(e[0],e[1],e[2],e[3]):new t(e.x,e.y,e.width,e.height)}function i(e){return new t(0,0,e.width,e.height)}function s(e,n){return new t(e.x,e.y,n.width,n.height)}function o(e){return new t(e.x-e.a,e.y-e.b,2*e.a,2*e.b)}t.create=e,t.clone=n,t.fromSize=i,t.fromPositionAndSize=s,t.fromEllipse=o}(lc||(lc={}));class cc extends rc{constructor(t,e,n,i){super(),"number"===typeof t&&"number"===typeof e?(this.start=new ac(t,e),this.end=new ac(n,i)):(this.start=ac.create(t),this.end=ac.create(e))}get[Symbol.toStringTag](){return cc.toStringTag}get center(){return new ac((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}getCenter(){return this.center}round(t=0){return this.start.round(t),this.end.round(t),this}translate(t,e){return"number"===typeof t?(this.start.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.end.translate(t)),this}rotate(t,e){return this.start.rotate(t,e),this.end.rotate(t,e),this}scale(t,e,n){return this.start.scale(t,e,n),this.end.scale(t,e,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const t=this.start.x-this.end.x,e=this.start.y-this.end.y;return t*t+e*e}setLength(t){const e=this.length();if(!e)return this;const n=t/e;return this.scale(n,n,this.start)}parallel(t){const e=this.clone();if(!e.isDifferentiable())return e;const{start:n,end:i}=e,s=n.clone().rotate(270,i),o=i.clone().rotate(90,n);return n.move(o,t),i.move(s,t),e}vector(){return new ac(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const t=new ac(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,t)}bbox(){const t=Math.min(this.start.x,this.end.x),e=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new lc(t,e,n-t,i-e)}bearing(){return this.start.bearing(this.end)}closestPoint(t){return this.pointAt(this.closestPointNormalizedLength(t))}closestPointLength(t){return this.closestPointNormalizedLength(t)*this.length()}closestPointTangent(t){return this.tangentAt(this.closestPointNormalizedLength(t))}closestPointNormalizedLength(t){const e=this.vector().dot(new cc(this.start,t).vector()),n=Math.min(1,Math.max(0,e/this.squaredLength()));return Number.isNaN(n)?0:n}pointAt(t){const e=this.start,n=this.end;return t<=0?e.clone():t>=1?n.clone():e.lerp(n,t)}pointAtLength(t){const e=this.start,n=this.end;let i=!0;t<0&&(i=!1,t=-t);const s=this.length();if(t>=s)return i?n.clone():e.clone();const o=(i?t:s-t)/s;return this.pointAt(o)}divideAt(t){const e=this.pointAt(t);return[new cc(this.start,e),new cc(e,this.end)]}divideAtLength(t){const e=this.pointAtLength(t);return[new cc(this.start,e),new cc(e,this.end)]}containsPoint(t){const e=this.start,n=this.end;if(0!==e.cross(t,n))return!1;const i=this.length();return!(new cc(e,t).length()>i)&&!(new cc(t,n).length()>i)}intersect(t,e){const n=t.intersectsWithLine(this,e);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(t){const e=new ac(this.end.x-this.start.x,this.end.y-this.start.y),n=new ac(t.end.x-t.start.x,t.end.y-t.start.y),i=e.x*n.y-e.y*n.x,s=new ac(t.start.x-this.start.x,t.start.y-this.start.y),o=s.x*n.y-s.y*n.x,r=s.x*e.y-s.y*e.x;if(0===i||o*i<0||r*i<0)return null;if(i>0){if(o>i||r>i)return null}else if(o<i||r<i)return null;return new ac(this.start.x+o*e.x/i,this.start.y+o*e.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(t){const e=ac.clone(t),n=this.start,i=this.end,s=(i.x-n.x)*(e.y-n.y)-(i.y-n.y)*(e.x-n.x);return s/this.length()}pointSquaredDistance(t,e){const n=ac.create(t,e);return this.closestPoint(n).squaredDistance(n)}pointDistance(t,e){const n=ac.create(t,e);return this.closestPoint(n).distance(n)}tangentAt(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,i=this.pointAt(t),s=new cc(e,n);return s.translate(i.x-e.x,i.y-e.y),s}tangentAtLength(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,i=this.pointAtLength(t),s=new cc(e,n);return s.translate(i.x-e.x,i.y-e.y),s}relativeCcw(t,e){const n=ac.create(t,e);let i=n.x-this.start.x,s=n.y-this.start.y;const o=this.end.x-this.start.x,r=this.end.y-this.start.y;let a=i*r-s*o;return 0===a&&(a=i*o+s*r,a>0&&(i-=o,s-=r,a=i*o+s*r,a<0&&(a=0))),a<0?-1:a>0?1:0}equals(t){return null!=t&&this.start.x===t.start.x&&this.start.y===t.start.y&&this.end.x===t.end.x&&this.end.y===t.end.y}clone(){return new cc(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;try{if((null==n||n===t.toStringTag)&&ac.isPoint(i.start)&&ac.isPoint(i.end)&&"function"===typeof i.vector&&"function"===typeof i.bearing&&"function"===typeof i.parallel&&"function"===typeof i.intersect)return!0}catch(s){return!1}return!1}t.toStringTag=`X6.Geometry.${t.name}`,t.isLine=e})(cc||(cc={}));class hc extends rc{constructor(t,e,n,i){super(),this.x=null==t?0:t,this.y=null==e?0:e,this.a=null==n?0:n,this.b=null==i?0:i}get[Symbol.toStringTag](){return hc.toStringTag}get center(){return new ac(this.x,this.y)}bbox(){return lc.fromEllipse(this)}getCenter(){return this.center}inflate(t,e){const n=t,i=null!=e?e:t;return this.a+=2*n,this.b+=2*i,this}normalizedDistance(t,e){const n=ac.create(t,e),i=n.x-this.x,s=n.y-this.y,o=this.a,r=this.b;return i*i/(o*o)+s*s/(r*r)}containsPoint(t,e){return this.normalizedDistance(t,e)<=1}intersectsWithLine(t){const e=[],n=this.a,i=this.b,s=t.start,o=t.end,r=t.vector(),a=s.diff(new ac(this.x,this.y)),l=new ac(r.x/(n*n),r.y/(i*i)),c=new ac(a.x/(n*n),a.y/(i*i)),h=r.dot(l),u=r.dot(c),d=a.dot(c)-1,g=u*u-h*d;if(g<0)return null;if(g>0){const t=Math.sqrt(g),n=(-u-t)/h,i=(-u+t)/h;if((n<0||n>1)&&(i<0||i>1))return null;n>=0&&n<=1&&e.push(s.lerp(o,n)),i>=0&&i<=1&&e.push(s.lerp(o,i))}else{const t=-u/h;if(!(t>=0&&t<=1))return null;e.push(s.lerp(o,t))}return e}intersectsWithLineFromCenterToPoint(t,e=0){const n=ac.clone(t);e&&n.rotate(e,this.getCenter());const i=n.x-this.x,s=n.y-this.y;let o;if(0===i)return o=this.bbox().getNearestPointToPoint(n),e?o.rotate(-e,this.getCenter()):o;const r=s/i,a=r*r,l=this.a*this.a,c=this.b*this.b;let h=Math.sqrt(1/(1/l+a/c));h=i<0?-h:h;const u=r*h;return o=new ac(this.x+h,this.y+u),e?o.rotate(-e,this.getCenter()):o}tangentTheta(t){const e=ac.clone(t),n=e.x,i=e.y,s=this.a,o=this.b,r=this.bbox().center,a=r.x,l=r.y,c=30,h=n>r.x+s/2,u=n<r.x-s/2;let d,g;return h||u?(g=n>r.x?i-c:i+c,d=s*s/(n-a)-s*s*(i-l)*(g-l)/(o*o*(n-a))+a):(d=i>r.y?n+c:n-c,g=o*o/(i-l)-o*o*(n-a)*(d-a)/(s*s*(i-l))+l),new ac(d,g).theta(e)}scale(t,e){return this.a*=t,this.b*=e,this}rotate(t,e){const n=lc.fromEllipse(this);n.rotate(t,e);const i=hc.fromRect(n);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this}translate(t,e){const n=ac.create(t,e);return this.x+=n.x,this.y+=n.y,this}equals(t){return null!=t&&t.x===this.x&&t.y===this.y&&t.a===this.a&&t.b===this.b}clone(){return new hc(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"number"===typeof i.x&&"number"===typeof i.y&&"number"===typeof i.a&&"number"===typeof i.b&&"function"===typeof i.inflate&&"function"===typeof i.normalizedDistance}t.toStringTag=`X6.Geometry.${t.name}`,t.isEllipse=e})(hc||(hc={})),function(t){function e(e,i,s,o){return null==e||"number"===typeof e?new t(e,i,s,o):n(e)}function n(e){return t.isEllipse(e)?e.clone():Array.isArray(e)?new t(e[0],e[1],e[2],e[3]):new t(e.x,e.y,e.a,e.b)}function i(e){const n=e.center;return new t(n.x,n.y,e.width/2,e.height/2)}t.create=e,t.parse=n,t.fromRect=i}(hc||(hc={}));class uc extends rc{constructor(t){if(super(),null!=t){if("string"===typeof t)return uc.parse(t);this.points=t.map((t=>ac.create(t)))}else this.points=[]}get[Symbol.toStringTag](){return uc.toStringTag}get start(){return 0===this.points.length?null:this.points[0]}get end(){return 0===this.points.length?null:this.points[this.points.length-1]}scale(t,e,n=new ac){return this.points.forEach((i=>i.scale(t,e,n))),this}rotate(t,e){return this.points.forEach((n=>n.rotate(t,e))),this}translate(t,e){const n=ac.create(t,e);return this.points.forEach((t=>t.translate(n.x,n.y))),this}bbox(){if(0===this.points.length)return new lc;let t=1/0,e=-1/0,n=1/0,i=-1/0;const s=this.points;for(let o=0,r=s.length;o<r;o+=1){const r=s[o],a=r.x,l=r.y;a<t&&(t=a),a>e&&(e=a),l<n&&(n=l),l>i&&(i=l)}return new lc(t,n,e-t,i-n)}closestPoint(t){const e=this.closestPointLength(t);return this.pointAtLength(e)}closestPointLength(t){const e=this.points,n=e.length;if(0===n||1===n)return 0;let i=0,s=0,o=1/0;for(let r=0,a=n-1;r<a;r+=1){const n=new cc(e[r],e[r+1]),a=n.length(),l=n.closestPointNormalizedLength(t),c=n.pointAt(l),h=c.squaredDistance(t);h<o&&(o=h,s=i+l*a),i+=a}return s}closestPointNormalizedLength(t){const e=this.closestPointLength(t);if(0===e)return 0;const n=this.length();return 0===n?0:e/n}closestPointTangent(t){const e=this.closestPointLength(t);return this.tangentAtLength(e)}containsPoint(t){if(0===this.points.length)return!1;const e=ac.clone(t),n=e.x,i=e.y,s=this.points,o=s.length;let r=o-1,a=0;for(let l=0;l<o;l+=1){const o=s[r],c=s[l];if(e.equals(o))return!0;const h=new cc(o,c);if(h.containsPoint(t))return!0;if(i<=o.y&&i>c.y||i>o.y&&i<=c.y){const e=o.x-n>c.x-n?o.x-n:c.x-n;if(e>=0){const s=new ac(n+e,i),o=new cc(t,s);h.intersectsWithLine(o)&&(a+=1)}}r=l}return a%2===1}intersectsWithLine(t){const e=[];for(let n=0,i=this.points.length-1;n<i;n+=1){const i=this.points[n],s=this.points[n+1],o=t.intersectsWithLine(new cc(i,s));o&&e.push(o)}return e.length>0?e:null}isDifferentiable(){for(let t=0,e=this.points.length-1;t<e;t+=1){const e=this.points[t],n=this.points[t+1],i=new cc(e,n);if(i.isDifferentiable())return!0}return!1}length(){let t=0;for(let e=0,n=this.points.length-1;e<n;e+=1){const n=this.points[e],i=this.points[e+1];t+=n.distance(i)}return t}pointAt(t){const e=this.points,n=e.length;if(0===n)return null;if(1===n)return e[0].clone();if(t<=0)return e[0].clone();if(t>=1)return e[n-1].clone();const i=this.length(),s=i*t;return this.pointAtLength(s)}pointAtLength(t){const e=this.points,n=e.length;if(0===n)return null;if(1===n)return e[0].clone();let i=!0;t<0&&(i=!1,t=-t);let s=0;for(let r=0,a=n-1;r<a;r+=1){const n=i?r:a-1-r,o=e[n],l=e[n+1],c=new cc(o,l),h=o.distance(l);if(t<=s+h)return c.pointAtLength((i?1:-1)*(t-s));s+=h}const o=i?e[n-1]:e[0];return o.clone()}tangentAt(t){const e=this.points,n=e.length;if(0===n||1===n)return null;t<0&&(t=0),t>1&&(t=1);const i=this.length(),s=i*t;return this.tangentAtLength(s)}tangentAtLength(t){const e=this.points,n=e.length;if(0===n||1===n)return null;let i,s=!0;t<0&&(s=!1,t=-t);let o=0;for(let r=0,a=n-1;r<a;r+=1){const n=s?r:a-1-r,l=e[n],c=e[n+1],h=new cc(l,c),u=l.distance(c);if(h.isDifferentiable()){if(t<=o+u)return h.tangentAtLength((s?1:-1)*(t-o));i=h}o+=u}if(i){const t=s?1:0;return i.tangentAt(t)}return null}simplify(t={}){const e=this.points;if(e.length<3)return this;const n=t.threshold||0;let i=0;while(e[i+2]){const t=i,s=i+1,o=i+2,r=e[t],a=e[s],l=e[o],c=new cc(r,l),h=c.closestPoint(a),u=h.distance(a);u<=n?e.splice(s,1):i+=1}return this}toHull(){const t=this.points,e=t.length;if(0===e)return new uc;let n=t[0];for(let u=1;u<e;u+=1)(t[u].y<n.y||t[u].y===n.y&&t[u].x>n.x)&&(n=t[u]);const i=[];for(let u=0;u<e;u+=1){let e=n.theta(t[u]);0===e&&(e=360),i.push([t[u],u,e])}if(i.sort(((t,e)=>{let n=t[2]-e[2];return 0===n&&(n=e[1]-t[1]),n})),i.length>2){const t=i[i.length-1];i.unshift(t)}const s={},o=[],r=t=>`${t[0].toString()}@${t[1]}`;while(0!==i.length){const t=i.pop(),e=t[0];if(s[r(t)])continue;let n=!1;while(!n)if(o.length<2)o.push(t),n=!0;else{const a=o.pop(),l=a[0],c=o.pop(),h=c[0],u=h.cross(l,e);if(u<0)o.push(c),o.push(a),o.push(t),n=!0;else if(0===u){const t=1e-10,n=l.angleBetween(h,e);Math.abs(n-180)<t||l.equals(e)||h.equals(l)?(s[r(a)]=l,o.push(c)):Math.abs((n+1)%360-1)<t&&(o.push(c),i.push(a))}else s[r(a)]=l,o.push(c)}}let a;o.length>2&&o.pop();let l=-1;for(let u=0,d=o.length;u<d;u+=1){const t=o[u][1];(void 0===a||t<a)&&(a=t,l=u)}let c=[];if(l>0){const t=o.slice(l),e=o.slice(0,l);c=t.concat(e)}else c=o;const h=[];for(let u=0,d=c.length;u<d;u+=1)h.push(c[u][0]);return new uc(h)}equals(t){return null!=t&&(t.points.length===this.points.length&&t.points.every(((t,e)=>t.equals(this.points[e]))))}clone(){return new uc(this.points.map((t=>t.clone())))}toJSON(){return this.points.map((t=>t.toJSON()))}serialize(){return this.points.map((t=>`${t.x}, ${t.y}`)).join(" ")}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.toHull&&"function"===typeof i.simplify}t.toStringTag=`X6.Geometry.${t.name}`,t.isPolyline=e})(uc||(uc={})),function(t){function e(e){const n=e.trim();if(""===n)return new t;const i=[],s=n.split(/\s*,\s*|\s+/);for(let t=0,o=s.length;t<o;t+=2)i.push({x:+s[t],y:+s[t+1]});return new t(i)}t.parse=e}(uc||(uc={}));class dc extends rc{constructor(t,e,n,i){super(),this.PRECISION=3,this.start=ac.create(t),this.controlPoint1=ac.create(e),this.controlPoint2=ac.create(n),this.end=ac.create(i)}get[Symbol.toStringTag](){return dc.toStringTag}bbox(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end,s=t.x,o=t.y,r=e.x,a=e.y,l=n.x,c=n.y,h=i.x,u=i.y,d=[],g=[],p=[[],[]];let f,m,y,b,w,C,v,x,k,E,M;for(let N=0;N<2;N+=1)if(0===N?(m=6*s-12*r+6*l,f=-3*s+9*r-9*l+3*h,y=3*r-3*s):(m=6*o-12*a+6*c,f=-3*o+9*a-9*c+3*u,y=3*a-3*o),Math.abs(f)<1e-12){if(Math.abs(m)<1e-12)continue;b=-y/m,b>0&&b<1&&g.push(b)}else v=m*m-4*y*f,x=Math.sqrt(v),v<0||(w=(-m+x)/(2*f),w>0&&w<1&&g.push(w),C=(-m-x)/(2*f),C>0&&C<1&&g.push(C));let S=g.length;const A=S;while(S)S-=1,b=g[S],M=1-b,k=M*M*M*s+3*M*M*b*r+3*M*b*b*l+b*b*b*h,p[0][S]=k,E=M*M*M*o+3*M*M*b*a+3*M*b*b*c+b*b*b*u,p[1][S]=E,d[S]={X:k,Y:E};g[A]=0,g[A+1]=1,d[A]={X:s,Y:o},d[A+1]={X:h,Y:u},p[0][A]=s,p[1][A]=o,p[0][A+1]=h,p[1][A+1]=u,g.length=A+2,p[0].length=A+2,p[1].length=A+2,d.length=A+2;const D=Math.min.apply(null,p[0]),P=Math.min.apply(null,p[1]),O=Math.max.apply(null,p[0]),T=Math.max.apply(null,p[1]);return new lc(D,P,O-D,T-P)}closestPoint(t,e={}){return this.pointAtT(this.closestPointT(t,e))}closestPointLength(t,e={}){const n=this.getOptions(e);return this.lengthAtT(this.closestPointT(t,n),n)}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),i=this.closestPointLength(t,n);if(!i)return 0;const s=this.length(n);return 0===s?0:i/s}closestPointT(t,e={}){const n=this.getPrecision(e),i=this.getDivisions(e),s=Math.pow(10,-n);let o=null,r=0,a=0,l=0,c=0,h=0,u=null;const d=i.length;let g=d>0?1/d:0;i.forEach(((e,n)=>{const i=e.start.distance(t),s=e.end.distance(t),d=i+s;(null==u||d<u)&&(o=e,r=n*g,a=(n+1)*g,l=i,c=s,u=d,h=e.endpointDistance())}));while(1){const e=l?Math.abs(l-c)/l:0,n=null!=c?Math.abs(l-c)/c:0,i=e<s||n<s,u=!l||l<h*s,d=!c||c<h*s,p=u||d;if(i||p)return l<=c?r:a;const f=o.divide(.5);g/=2;const m=f[0].start.distance(t),y=f[0].end.distance(t),b=m+y,w=f[1].start.distance(t),C=f[1].end.distance(t),v=w+C;b<=v?(o=f[0],a-=g,l=m,c=y):(o=f[1],r+=g,l=w,c=C)}}closestPointTangent(t,e={}){return this.tangentAtT(this.closestPointT(t,e))}containsPoint(t,e={}){const n=this.toPolyline(e);return n.containsPoint(t)}divideAt(t,e={}){if(t<=0)return this.divideAtT(0);if(t>=1)return this.divideAtT(1);const n=this.tAt(t,e);return this.divideAtT(n)}divideAtLength(t,e={}){const n=this.tAtLength(t,e);return this.divideAtT(n)}divide(t){return this.divideAtT(t)}divideAtT(t){const e=this.start,n=this.controlPoint1,i=this.controlPoint2,s=this.end;if(t<=0)return[new dc(e,e,e,e),new dc(e,n,i,s)];if(t>=1)return[new dc(e,n,i,s),new dc(s,s,s,s)];const o=this.getSkeletonPoints(t),r=o.startControlPoint1,a=o.startControlPoint2,l=o.divider,c=o.dividerControlPoint1,h=o.dividerControlPoint2;return[new dc(e,r,a,l),new dc(l,c,h,s)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(t){const e=this.start,n=this.controlPoint1,i=this.controlPoint2,s=this.end;if(t<=0)return{startControlPoint1:e.clone(),startControlPoint2:e.clone(),divider:e.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:i.clone()};if(t>=1)return{startControlPoint1:n.clone(),startControlPoint2:i.clone(),divider:s.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:s.clone()};const o=new cc(e,n).pointAt(t),r=new cc(n,i).pointAt(t),a=new cc(i,s).pointAt(t),l=new cc(o,r).pointAt(t),c=new cc(r,a).pointAt(t),h=new cc(l,c).pointAt(t);return{startControlPoint1:o,startControlPoint2:l,divider:h,dividerControlPoint1:c,dividerControlPoint2:a}}getSubdivisions(t={}){const e=this.getPrecision(t);let n=[new dc(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===e)return n;let i=this.endpointDistance();const s=Math.pow(10,-e);let o=0;while(1){o+=1;const t=[];n.forEach((e=>{const n=e.divide(.5);t.push(n[0],n[1])}));const e=t.reduce(((t,e)=>t+e.endpointDistance()),0),r=0!==e?(e-i)/e:0;if(o>1&&r<s)return t;n=t,i=e}}length(t={}){const e=this.getDivisions(t);return e.reduce(((t,e)=>t+e.endpointDistance()),0)}lengthAtT(t,e={}){if(t<=0)return 0;const n=void 0===e.precision?this.PRECISION:e.precision,i=this.divide(t)[0];return i.length({precision:n})}pointAt(t,e={}){if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.tAt(t,e);return this.pointAtT(n)}pointAtLength(t,e={}){const n=this.tAtLength(t,e);return this.pointAtT(n)}pointAtT(t){return t<=0?this.start.clone():t>=1?this.end.clone():this.getSkeletonPoints(t).divider}isDifferentiable(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(i))}tangentAt(t,e={}){if(!this.isDifferentiable())return null;t<0?t=0:t>1&&(t=1);const n=this.tAt(t,e);return this.tangentAtT(n)}tangentAtLength(t,e={}){if(!this.isDifferentiable())return null;const n=this.tAtLength(t,e);return this.tangentAtT(n)}tangentAtT(t){if(!this.isDifferentiable())return null;t<0&&(t=0),t>1&&(t=1);const e=this.getSkeletonPoints(t),n=e.startControlPoint2,i=e.dividerControlPoint1,s=e.divider,o=new cc(n,i);return o.translate(s.x-n.x,s.y-n.y),o}getPrecision(t={}){return null==t.precision?this.PRECISION:t.precision}getDivisions(t={}){if(null!=t.subdivisions)return t.subdivisions;const e=this.getPrecision(t);return this.getSubdivisions({precision:e})}getOptions(t={}){const e=this.getPrecision(t),n=this.getDivisions(t);return{precision:e,subdivisions:n}}tAt(t,e={}){if(t<=0)return 0;if(t>=1)return 1;const n=this.getOptions(e),i=this.length(n),s=i*t;return this.tAtLength(s,n)}tAtLength(t,e={}){let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),s=this.getDivisions(e),o={precision:i,subdivisions:s};let r,a,l=null,c=0,h=0,u=0;const d=s.length;let g=d>0?1/d:0;for(let m=0;m<d;m+=1){const e=n?m:d-1-m,i=s[m],o=i.endpointDistance();if(t<=u+o){l=i,r=e*g,a=(e+1)*g,c=n?t-u:o+u-t,h=n?o+u-t:t-u;break}u+=o}if(null==l)return n?1:0;const p=this.length(o),f=Math.pow(10,-i);while(1){let t,e,n;if(t=0!==p?c/p:0,t<f)return r;if(t=0!==p?h/p:0,t<f)return a;const i=l.divide(.5);g/=2;const s=i[0].endpointDistance(),o=i[1].endpointDistance();c<=s?(l=i[0],a-=g,e=c,n=s-e):(l=i[1],r+=g,e=c-s,n=o-e),c=e,h=n}}toPoints(t={}){const e=this.getDivisions(t),n=[e[0].start.clone()];return e.forEach((t=>n.push(t.end.clone()))),n}toPolyline(t={}){return new uc(this.toPoints(t))}scale(t,e,n){return this.start.scale(t,e,n),this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.start.rotate(t,e),this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?(this.start.translate(t,e),this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return null!=t&&this.start.equals(t.start)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)&&this.end.equals(t.end)}clone(){return new dc(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;try{if((null==n||n===t.toStringTag)&&ac.isPoint(i.start)&&ac.isPoint(i.controlPoint1)&&ac.isPoint(i.controlPoint2)&&ac.isPoint(i.end)&&"function"===typeof i.toPoints&&"function"===typeof i.toPolyline)return!0}catch(s){return!1}return!1}t.toStringTag=`X6.Geometry.${t.name}`,t.isCurve=e})(dc||(dc={})),function(t){function e(t){const e=t.length,n=[],i=[];let s=2;n[0]=t[0]/s;for(let o=1;o<e;o+=1)i[o]=1/s,s=(o<e-1?4:3.5)-i[o],n[o]=(t[o]-n[o-1])/s;for(let o=1;o<e;o+=1)n[e-o-1]-=i[e-o]*n[e-o];return n}function n(t){const n=t.map((t=>ac.clone(t))),i=[],s=[],o=n.length-1;if(1===o)return i[0]=new ac((2*n[0].x+n[1].x)/3,(2*n[0].y+n[1].y)/3),s[0]=new ac(2*i[0].x-n[0].x,2*i[0].y-n[0].y),[i,s];const r=[];for(let e=1;e<o-1;e+=1)r[e]=4*n[e].x+2*n[e+1].x;r[0]=n[0].x+2*n[1].x,r[o-1]=(8*n[o-1].x+n[o].x)/2;const a=e(r);for(let e=1;e<o-1;e+=1)r[e]=4*n[e].y+2*n[e+1].y;r[0]=n[0].y+2*n[1].y,r[o-1]=(8*n[o-1].y+n[o].y)/2;const l=e(r);for(let e=0;e<o;e+=1)i.push(new ac(a[e],l[e])),e<o-1?s.push(new ac(2*n[e+1].x-a[e+1],2*n[e+1].y-l[e+1])):s.push(new ac((n[o].x+a[o-1])/2,(n[o].y+l[o-1])/2));return[i,s]}function i(e){if(null==e||Array.isArray(e)&&e.length<2)throw new Error("At least 2 points are required");const i=n(e),s=[];for(let n=0,o=i[0].length;n<o;n+=1){const o=new ac(i[0][n].x,i[0][n].y),r=new ac(i[1][n].x,i[1][n].y);s.push(new t(e[n],o,r,e[n+1]))}return s}t.throughPoints=i}(dc||(dc={}));class gc extends rc{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(null==this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(t,e){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(t);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(t,e){if(t<=0)return 0;const n=this.length();return t>=1?n:n*t}divideAtT(t){if(this.divideAt)return this.divideAt(t);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(t){if(this.pointAt)return this.pointAt(t);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(t){if(this.tangentAt)return this.tangentAt(t);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class pc extends gc{constructor(t,e){super(),cc.isLine(t)?this.endPoint=t.end.clone().round(2):this.endPoint=ac.create(t,e).round(2)}get type(){return"L"}get line(){return new cc(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[new pc(e[0]),new pc(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[new pc(e[0]),new pc(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return null!=this.previousSegment&&!this.start.equals(this.end)}clone(){return new pc(this.end)}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?this.end.translate(t,e):this.end.translate(t),this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}(function(t){function e(...e){const n=e.length,i=e[0];if(cc.isLine(i))return new t(i);if(ac.isPointLike(i))return 1===n?new t(i):e.map((e=>new t(e)));if(2===n)return new t(+e[0],+e[1]);const s=[];for(let o=0;o<n;o+=2){const n=+e[o],i=+e[o+1];s.push(new t(n,i))}return s}t.create=e})(pc||(pc={}));class fc extends gc{get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new cc(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[e[1].isDifferentiable()?new pc(e[0]):this.clone(),new pc(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new pc(e[0]):this.clone(),new pc(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}clone(){return new fc}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(t){function e(){return new t}t.create=e})(fc||(fc={}));class mc extends gc{constructor(t,e){super(),this.isVisible=!1,this.isSubpathStart=!0,cc.isLine(t)||dc.isCurve(t)?this.endPoint=t.end.clone().round(2):this.endPoint=ac.create(t,e).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?this.end.translate(t,e):this.end.translate(t),this}clone(){return new mc(this.end)}equals(t){return this.type===t.type&&this.end.equals(t.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}(function(t){function e(...e){const n=e.length,i=e[0];if(cc.isLine(i))return new t(i);if(dc.isCurve(i))return new t(i);if(ac.isPointLike(i)){if(1===n)return new t(i);const s=[];for(let i=0;i<n;i+=1)0===i?s.push(new t(e[i])):s.push(new pc(e[i]));return s}if(2===n)return new t(+e[0],+e[1]);const s=[];for(let o=0;o<n;o+=2){const n=+e[o],i=+e[o+1];0===o?s.push(new t(n,i)):s.push(new pc(n,i))}return s}t.create=e})(mc||(mc={}));class yc extends gc{constructor(t,e,n,i,s,o){super(),dc.isCurve(t)?(this.controlPoint1=t.controlPoint1.clone().round(2),this.controlPoint2=t.controlPoint2.clone().round(2),this.endPoint=t.end.clone().round(2)):"number"===typeof t?(this.controlPoint1=new ac(t,e).round(2),this.controlPoint2=new ac(n,i).round(2),this.endPoint=new ac(s,o).round(2)):(this.controlPoint1=ac.create(t).round(2),this.controlPoint2=ac.create(e).round(2),this.endPoint=ac.create(n).round(2))}get type(){return"C"}get curve(){return new dc(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(t){return this.curve.closestPoint(t)}closestPointLength(t){return this.curve.closestPointLength(t)}closestPointNormalizedLength(t){return this.curve.closestPointNormalizedLength(t)}closestPointTangent(t){return this.curve.closestPointTangent(t)}length(){return this.curve.length()}divideAt(t,e={}){const n=this.curve.divideAt(t,e);return[new yc(n[0]),new yc(n[1])]}divideAtLength(t,e={}){const n=this.curve.divideAtLength(t,e);return[new yc(n[0]),new yc(n[1])]}divideAtT(t){const e=this.curve.divideAtT(t);return[new yc(e[0]),new yc(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.curve.pointAt(t)}pointAtLength(t){return this.curve.pointAtLength(t)}tangentAt(t){return this.curve.tangentAt(t)}tangentAtLength(t){return this.curve.tangentAtLength(t)}isDifferentiable(){if(!this.previousSegment)return!1;const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(i))}scale(t,e,n){return this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?(this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return this.start.equals(t.start)&&this.end.equals(t.end)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)}clone(){return new yc(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.controlPoint1,e=this.controlPoint2,n=this.end;return[this.type,t.x,t.y,e.x,e.y,n.x,n.y].join(" ")}}function bc(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function wc(t,e,n,i,s,o){const r=1/3,a=2/3;return[r*t+a*n,r*e+a*i,r*s+a*n,r*o+a*i,s,o]}function Cc(t,e,n,i,s,o,r,a,l,c){const h=120*Math.PI/180,u=Math.PI/180*(+s||0);let d,g,p,f,m,y=[];if(c)g=c[0],p=c[1],f=c[2],m=c[3];else{d=bc(t,e,-u),t=d.x,e=d.y,d=bc(a,l,-u),a=d.x,l=d.y;const s=(t-a)/2,c=(e-l)/2;let h=s*s/(n*n)+c*c/(i*i);h>1&&(h=Math.sqrt(h),n*=h,i*=h);const y=n*n,b=i*i,w=(o===r?-1:1)*Math.sqrt(Math.abs((y*b-y*c*c-b*s*s)/(y*c*c+b*s*s)));f=w*n*c/i+(t+a)/2,m=w*-i*s/n+(e+l)/2,g=Math.asin((e-m)/i),p=Math.asin((l-m)/i),g=t<f?Math.PI-g:g,p=a<f?Math.PI-p:p,g<0&&(g=2*Math.PI+g),p<0&&(p=2*Math.PI+p),r&&g>p&&(g-=2*Math.PI),!r&&p>g&&(p-=2*Math.PI)}let b=p-g;if(Math.abs(b)>h){const t=p,e=a,o=l;p=g+h*(r&&p>g?1:-1),a=f+n*Math.cos(p),l=m+i*Math.sin(p),y=Cc(a,l,n,i,s,0,r,e,o,[p,t,f,m])}b=p-g;const w=Math.cos(g),C=Math.sin(g),v=Math.cos(p),x=Math.sin(p),k=Math.tan(b/4),E=4/3*(n*k),M=4/3*(i*k),S=[t,e],A=[t+E*C,e-M*w],D=[a+E*x,l-M*v],P=[a,l];if(A[0]=2*S[0]-A[0],A[1]=2*S[1]-A[1],c)return[A,D,P].concat(y);{y=[A,D,P].concat(y).join().split(",");const t=[],e=y.length;for(let n=0;n<e;n+=1)t[n]=n%2?bc(+y[n-1],+y[n],u).y:bc(+y[n],+y[n+1],u).x;return t}}function vc(t){if(!t)return null;const e="\t\n\v\f\r \u2028\u2029",n=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),i=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"ig"),s={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},o=[];return t.replace(n,((t,e,n)=>{const r=[];let a=e.toLowerCase();n.replace(i,((t,e)=>(e&&r.push(+e),t))),"m"===a&&r.length>2&&(o.push([e,...r.splice(0,2)]),a="l",e="m"===e?"l":"L");const l=s[a];while(r.length>=l)if(o.push([e,...r.splice(0,l)]),!l)break;return t})),o}function xc(t){const e=vc(t);if(!e||!e.length)return[["M",0,0]];let n=0,i=0,s=0,o=0;const r=[];for(let a=0,l=e.length;a<l;a+=1){const t=[];r.push(t);const l=e[a],c=l[0];if(c!==c.toUpperCase())switch(t[0]=c.toUpperCase(),t[0]){case"A":t[1]=l[1],t[2]=l[2],t[3]=l[3],t[4]=l[4],t[5]=l[5],t[6]=+l[6]+n,t[7]=+l[7]+i;break;case"V":t[1]=+l[1]+i;break;case"H":t[1]=+l[1]+n;break;case"M":s=+l[1]+n,o=+l[2]+i;for(let e=1,s=l.length;e<s;e+=1)t[e]=+l[e]+(e%2?n:i);break;default:for(let e=1,s=l.length;e<s;e+=1)t[e]=+l[e]+(e%2?n:i);break}else for(let e=0,n=l.length;e<n;e+=1)t[e]=l[e];switch(t[0]){case"Z":n=+s,i=+o;break;case"H":n=t[1];break;case"V":i=t[1];break;case"M":s=t[t.length-2],o=t[t.length-1],n=t[t.length-2],i=t[t.length-1];break;default:n=t[t.length-2],i=t[t.length-1];break}}return r}function kc(t){const e=xc(t),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function i(t,e,n){let i,s;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(t[0]in{T:1,Q:1}||(e.qx=null,e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":return 0===parseFloat(t[1])||0===parseFloat(t[2])?["L",t[6],t[7]]:["C"].concat(Cc.apply(0,[e.x,e.y].concat(t.slice(1))));case"S":return"C"===n||"S"===n?(i=2*e.x-e.bx,s=2*e.y-e.by):(i=e.x,s=e.y),["C",i,s].concat(t.slice(1));case"T":return"Q"===n||"T"===n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),["C"].concat(wc(e.x,e.y,e.qx,e.qy,t[1],t[2]));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(wc(e.x,e.y,t[1],t[2],t[3],t[4]));case"H":return["L"].concat(t[1],e.y);case"V":return["L"].concat(e.x,t[1]);case"L":break;case"Z":break;default:break}return t}function s(t,n){if(t[n].length>7){t[n].shift();const i=t[n];while(i.length)o[n]="A",n+=1,t.splice(n,0,["C"].concat(i.splice(0,6)));t.splice(n,1),a=e.length}}const o=[];let r="",a=e.length;for(let l=0;l<a;l+=1){let t="";e[l]&&(t=e[l][0]),"C"!==t&&(o[l]=t,l>0&&(r=o[l-1])),e[l]=i(e[l],n,r),"A"!==o[l]&&"C"===t&&(o[l]="C"),s(e,l);const a=e[l],c=a.length;n.x=a[c-2],n.y=a[c-1],n.bx=parseFloat(a[c-4])||n.x,n.by=parseFloat(a[c-3])||n.y}return e[0][0]&&"M"===e[0][0]||e.unshift(["M",0,0]),e}function Ec(t){return kc(t).map((t=>t.map((t=>"string"===typeof t?t:tc(t,2))))).join(",").split(",").join(" ")}(function(t){function e(...e){const n=e.length,i=e[0];if(dc.isCurve(i))return new t(i);if(ac.isPointLike(i)){if(3===n)return new t(e[0],e[1],e[2]);const i=[];for(let s=0;s<n;s+=3)i.push(new t(e[s],e[s+1],e[s+2]));return i}if(6===n)return new t(e[0],e[1],e[2],e[3],e[4],e[5]);const s=[];for(let o=0;o<n;o+=6)s.push(new t(e[o],e[o+1],e[o+2],e[o+3],e[o+4],e[o+5]));return s}t.create=e})(yc||(yc={}));const Mc=new RegExp("^[\\s\\dLMCZz,.]*$");function Sc(t){return"string"===typeof t&&Mc.test(t)}function Ac(t,e){return(t%e+e)%e}function Dc(t,e,n,i,s){const o=[],r=t[t.length-1],a=null!=e&&e>0,l=e||0;if(i&&a){t=t.slice();const e=t[0],n=new ac(r.x+(e.x-r.x)/2,r.y+(e.y-r.y)/2);t.splice(0,0,n)}let c=t[0],h=1;n?o.push("M",c.x,c.y):o.push("L",c.x,c.y);while(h<(i?t.length:t.length-1)){let e=t[Ac(h,t.length)],n=c.x-e.x,i=c.y-e.y;if(a&&(0!==n||0!==i)&&(null==s||s.indexOf(h-1)<0)){let s=Math.sqrt(n*n+i*i);const r=n*Math.min(l,s/2)/s,a=i*Math.min(l,s/2)/s,c=e.x+r,u=e.y+a;o.push("L",c,u);let d=t[Ac(h+1,t.length)];while(h<t.length-2&&0===Math.round(d.x-e.x)&&0===Math.round(d.y-e.y))d=t[Ac(h+2,t.length)],h+=1;n=d.x-e.x,i=d.y-e.y,s=Math.max(1,Math.sqrt(n*n+i*i));const g=n*Math.min(l,s/2)/s,p=i*Math.min(l,s/2)/s,f=e.x+g,m=e.y+p;o.push("Q",e.x,e.y,f,m),e=new ac(f,m)}else o.push("L",e.x,e.y);c=e,h+=1}return i?o.push("Z"):o.push("L",r.x,r.y),o.map((t=>"string"===typeof t?t:+t.toFixed(3))).join(" ")}function Pc(t,e={}){const n=[];return t&&t.length&&t.forEach((t=>{Array.isArray(t)?n.push({x:t[0],y:t[1]}):n.push({x:t.x,y:t.y})})),Dc(n,e.round,null==e.initialMove||e.initialMove,e.close,e.exclude)}function Oc(t,e,n,i,s=0,o=0,r=0,a,l){if(0===n||0===i)return[];a-=t,l-=e,n=Math.abs(n),i=Math.abs(i);const c=-a/2,h=-l/2,u=Math.cos(s*Math.PI/180),d=Math.sin(s*Math.PI/180),g=u*c+d*h,p=-1*d*c+u*h,f=g*g,m=p*p,y=n*n,b=i*i,w=f/y+m/b;let C;if(w>1)n=Math.sqrt(w)*n,i=Math.sqrt(w)*i,C=0;else{let t=1;o===r&&(t=-1),C=t*Math.sqrt((y*b-y*m-b*f)/(y*m+b*f))}const v=C*n*p/i,x=-1*C*i*g/n,k=u*v-d*x+a/2,E=d*v+u*x+l/2;let M=Math.atan2((p-x)/i,(g-v)/n)-Math.atan2(0,1),S=M>=0?M:2*Math.PI+M;M=Math.atan2((-p-x)/i,(-g-v)/n)-Math.atan2((p-x)/i,(g-v)/n);let A=M>=0?M:2*Math.PI+M;0===r&&A>0?A-=2*Math.PI:0!==r&&A<0&&(A+=2*Math.PI);const D=2*A/Math.PI,P=Math.ceil(D<0?-1*D:D),O=A/P,T=8/3*Math.sin(O/4)*Math.sin(O/4)/Math.sin(O/2),N=u*n,j=u*i,F=d*n,L=d*i;let z=Math.cos(S),I=Math.sin(S),B=-T*(N*I+L*z),R=-T*(F*I-j*z),$=0,V=0;const _=[];for(let G=0;G<P;G+=1){S+=O,z=Math.cos(S),I=Math.sin(S),$=N*z-L*I+k,V=F*z+j*I+E;const n=-T*(N*I+L*z),i=-T*(F*I-j*z),s=6*G;_[s]=Number(B+t),_[s+1]=Number(R+e),_[s+2]=Number($-n+t),_[s+3]=Number(V-i+e),_[s+4]=Number($+t),_[s+5]=Number(V+e),B=$+n,R=V+i}return _.map((t=>+t.toFixed(2)))}function Tc(t,e,n,i,s=0,o=0,r=0,a,l){const c=[],h=Oc(t,e,n,i,s,o,r,a,l);if(null!=h)for(let u=0,d=h.length;u<d;u+=6)c.push("C",h[u],h[u+1],h[u+2],h[u+3],h[u+4],h[u+5]);return c.join(" ")}class Nc extends rc{constructor(t){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(t))if(cc.isLine(t[0])||dc.isCurve(t[0])){let e=null;const n=t;n.forEach(((t,n)=>{0===n&&this.appendSegment(Nc.createSegment("M",t.start)),null==e||e.end.equals(t.start)||this.appendSegment(Nc.createSegment("M",t.start)),cc.isLine(t)?this.appendSegment(Nc.createSegment("L",t.end)):dc.isCurve(t)&&this.appendSegment(Nc.createSegment("C",t.controlPoint1,t.controlPoint2,t.end)),e=t}))}else{const e=t;e.forEach((t=>{t.isSegment&&this.appendSegment(t)}))}else null!=t&&(cc.isLine(t)?(this.appendSegment(Nc.createSegment("M",t.start)),this.appendSegment(Nc.createSegment("L",t.end))):dc.isCurve(t)?(this.appendSegment(Nc.createSegment("M",t.start)),this.appendSegment(Nc.createSegment("C",t.controlPoint1,t.controlPoint2,t.end))):uc.isPolyline(t)?t.points&&t.points.length&&t.points.forEach(((t,e)=>{const n=0===e?Nc.createSegment("M",t):Nc.createSegment("L",t);this.appendSegment(n)})):t.isSegment&&this.appendSegment(t))}get[Symbol.toStringTag](){return Nc.toStringTag}get start(){const t=this.segments,e=t.length;if(0===e)return null;for(let n=0;n<e;n+=1){const e=t[n];if(e.isVisible)return e.start}return t[e-1].end}get end(){const t=this.segments,e=t.length;if(0===e)return null;for(let n=e-1;n>=0;n-=1){const e=t[n];if(e.isVisible)return e.end}return t[e-1].end}moveTo(...t){return this.appendSegment(mc.create.call(null,...t))}lineTo(...t){return this.appendSegment(pc.create.call(null,...t))}curveTo(...t){return this.appendSegment(yc.create.call(null,...t))}arcTo(t,e,n,i,s,o,r){const a=this.end||new ac,l="number"===typeof o?Oc(a.x,a.y,t,e,n,i,s,o,r):Oc(a.x,a.y,t,e,n,i,s,o.x,o.y);if(null!=l)for(let c=0,h=l.length;c<h;c+=6)this.curveTo(l[c],l[c+1],l[c+2],l[c+3],l[c+4],l[c+5]);return this}quadTo(t,e,n,i){const s=this.end||new ac,o=["M",s.x,s.y];if("number"===typeof t)o.push("Q",t,e,n,i);else{const n=e;o.push("Q",t.x,t.y,n.x,n.y)}const r=Nc.parse(o.join(" "));return this.appendSegment(r.segments.slice(1)),this}close(){return this.appendSegment(fc.create())}drawPoints(t,e={}){const n=Pc(t,e),i=Nc.parse(n);i&&i.segments&&this.appendSegment(i.segments)}bbox(){const t=this.segments,e=t.length;if(0===e)return null;let n;for(let s=0;s<e;s+=1){const e=t[s];if(e.isVisible){const t=e.bbox();null!=t&&(n=n?n.union(t):t)}}if(null!=n)return n;const i=t[e-1];return new lc(i.end.x,i.end.y,0,0)}appendSegment(t){const e=this.segments.length;let n,i=0!==e?this.segments[e-1]:null;const s=null;if(Array.isArray(t))for(let o=0,r=t.length;o<r;o+=1){const e=t[o];n=this.prepareSegment(e,i,s),this.segments.push(n),i=n}else null!=t&&t.isSegment&&(n=this.prepareSegment(t,i,s),this.segments.push(n));return this}insertSegment(t,e){const n=this.segments.length;if(t<0&&(t=n+t+1),t>n||t<0)throw new Error("Index out of range.");let i,s=null,o=null;if(0!==n&&(t>=1?(s=this.segments[t-1],o=s.nextSegment):(s=null,o=this.segments[0])),Array.isArray(e))for(let r=0,a=e.length;r<a;r+=1){const n=e[r];i=this.prepareSegment(n,s,o),this.segments.splice(t+r,0,i),s=i}else i=this.prepareSegment(e,s,o),this.segments.splice(t,0,i);return this}removeSegment(t){const e=this.fixIndex(t),n=this.segments.splice(e,1)[0],i=n.previousSegment,s=n.nextSegment;return i&&(i.nextSegment=s),s&&(s.previousSegment=i),n.isSubpathStart&&s&&this.updateSubpathStartSegment(s),n}replaceSegment(t,e){const n=this.fixIndex(t);let i;const s=this.segments[n];let o=s.previousSegment;const r=s.nextSegment;let a=s.isSubpathStart;if(Array.isArray(e)){this.segments.splice(t,1);for(let n=0,s=e.length;n<s;n+=1){const s=e[n];i=this.prepareSegment(s,o,r),this.segments.splice(t+n,0,i),o=i,a&&i.isSubpathStart&&(a=!1)}}else i=this.prepareSegment(e,o,r),this.segments.splice(n,1,i),a&&i.isSubpathStart&&(a=!1);a&&r&&this.updateSubpathStartSegment(r)}getSegment(t){const e=this.fixIndex(t);return this.segments[e]}fixIndex(t){const e=this.segments.length;if(0===e)throw new Error("Path has no segments.");let n=t;while(n<0)n=e+n;if(n>=e||n<0)throw new Error("Index out of range.");return n}segmentAt(t,e={}){const n=this.segmentIndexAt(t,e);return n?this.getSegment(n):null}segmentAtLength(t,e={}){const n=this.segmentIndexAtLength(t,e);return n?this.getSegment(n):null}segmentIndexAt(t,e={}){if(0===this.segments.length)return null;const n=nc(t,0,1),i=this.getOptions(e),s=this.length(i),o=s*n;return this.segmentIndexAtLength(o,i)}segmentIndexAtLength(t,e={}){const n=this.segments.length;if(0===n)return null;let i=!0;t<0&&(i=!1,t=-t);const s=this.getPrecision(e),o=this.getSubdivisions(e);let r=0,a=null;for(let l=0;l<n;l+=1){const e=i?l:n-1-l,c=this.segments[e],h=o[e],u=c.length({precision:s,subdivisions:h});if(c.isVisible){if(t<=r+u)return e;a=e}r+=u}return a}getSegmentSubdivisions(t={}){const e=this.getPrecision(t),n=[];for(let i=0,s=this.segments.length;i<s;i+=1){const t=this.segments[i],s=t.getSubdivisions({precision:e});n.push(s)}return n}updateSubpathStartSegment(t){let e=t.previousSegment,n=t;while(n&&!n.isSubpathStart)n.subpathStartSegment=null!=e?e.subpathStartSegment:null,e=n,n=n.nextSegment}prepareSegment(t,e,n){t.previousSegment=e,t.nextSegment=n,null!=e&&(e.nextSegment=t),null!=n&&(n.previousSegment=t);let i=t;return t.isSubpathStart&&(t.subpathStartSegment=t,i=n),null!=i&&this.updateSubpathStartSegment(i),t}closestPoint(t,e={}){const n=this.closestPointT(t,e);return n?this.pointAtT(n):null}closestPointLength(t,e={}){const n=this.getOptions(e),i=this.closestPointT(t,n);return i?this.lengthAtT(i,n):0}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),i=this.closestPointLength(t,n);if(0===i)return 0;const s=this.length(n);return 0===s?0:i/s}closestPointT(t,e={}){if(0===this.segments.length)return null;const n=this.getPrecision(e),i=this.getSubdivisions(e);let s,o=1/0;for(let r=0,a=this.segments.length;r<a;r+=1){const e=this.segments[r],a=i[r];if(e.isVisible){const i=e.closestPointT(t,{precision:n,subdivisions:a}),l=e.pointAtT(i),c=oc(l,t);c<o&&(s={segmentIndex:r,value:i},o=c)}}return s||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(t,e={}){if(0===this.segments.length)return null;const n=this.getPrecision(e),i=this.getSubdivisions(e);let s,o=1/0;for(let r=0,a=this.segments.length;r<a;r+=1){const e=this.segments[r],a=i[r];if(e.isDifferentiable()){const i=e.closestPointT(t,{precision:n,subdivisions:a}),r=e.pointAtT(i),l=oc(r,t);l<o&&(s=e.tangentAtT(i),o=l)}}return s||null}containsPoint(t,e={}){const n=this.toPolylines(e);if(!n)return!1;let i=0;for(let s=0,o=n.length;s<o;s+=1){const e=n[s];e.containsPoint(t)&&(i+=1)}return i%2===1}pointAt(t,e={}){if(0===this.segments.length)return null;if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.getOptions(e),i=this.length(n),s=i*t;return this.pointAtLength(s,n)}pointAtLength(t,e={}){if(0===this.segments.length)return null;if(0===t)return this.start.clone();let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),s=this.getSubdivisions(e);let o,r=0;for(let l=0,c=this.segments.length;l<c;l+=1){const e=n?l:c-1-l,a=this.segments[e],h=s[e],u=a.length({precision:i,subdivisions:h});if(a.isVisible){if(t<=r+u)return a.pointAtLength((n?1:-1)*(t-r),{precision:i,subdivisions:h});o=a}r+=u}if(o)return n?o.end:o.start;const a=this.segments[this.segments.length-1];return a.end.clone()}pointAtT(t){const e=this.segments,n=e.length;if(0===n)return null;const i=t.segmentIndex;if(i<0)return e[0].pointAtT(0);if(i>=n)return e[n-1].pointAtT(1);const s=nc(t.value,0,1);return e[i].pointAtT(s)}divideAt(t,e={}){if(0===this.segments.length)return null;const n=nc(t,0,1),i=this.getOptions(e),s=this.length(i),o=s*n;return this.divideAtLength(o,i)}divideAtLength(t,e={}){if(0===this.segments.length)return null;let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),s=this.getSubdivisions(e);let o,r,a,l,c,h=0;for(let C=0,v=this.segments.length;C<v;C+=1){const e=n?C:v-1-C,c=this.getSegment(e),u=s[e],d={precision:i,subdivisions:u},g=c.length(d);if(c.isDifferentiable()&&(a=c,l=e,t<=h+g)){r=e,o=c.divideAtLength((n?1:-1)*(t-h),d);break}h+=g}if(!a)return null;o||(r=l,c=n?1:0,o=a.divideAtT(c));const u=this.clone(),d=r;u.replaceSegment(d,o);const g=d;let p=d+1,f=d+2;o[0].isDifferentiable()||(u.removeSegment(g),p-=1,f-=1);const m=u.getSegment(p).start;u.insertSegment(p,Nc.createSegment("M",m)),f+=1,o[1].isDifferentiable()||(u.removeSegment(f-1),f-=1);const y=f-g-1;for(let C=f,v=u.segments.length;C<v;C+=1){const t=this.getSegment(C-y),e=u.getSegment(C);if("Z"===e.type&&!t.subpathStartSegment.end.equals(e.subpathStartSegment.end)){const e=Nc.createSegment("L",t.end);u.replaceSegment(C,e)}}const b=new Nc(u.segments.slice(0,p)),w=new Nc(u.segments.slice(p));return[b,w]}intersectsWithLine(t,e={}){const n=this.toPolylines(e);if(null==n)return null;let i=null;for(let s=0,o=n.length;s<o;s+=1){const e=n[s],o=t.intersect(e);o&&(null==i&&(i=[]),Array.isArray(o)?i.push(...o):i.push(o))}return i}isDifferentiable(){for(let t=0,e=this.segments.length;t<e;t+=1){const e=this.segments[t];if(e.isDifferentiable())return!0}return!1}isValid(){const t=this.segments,e=0===t.length||"M"===t[0].type;return e}length(t={}){if(0===this.segments.length)return 0;const e=this.getSubdivisions(t);let n=0;for(let i=0,s=this.segments.length;i<s;i+=1){const t=this.segments[i],s=e[i];n+=t.length({subdivisions:s})}return n}lengthAtT(t,e={}){const n=this.segments.length;if(0===n)return 0;let i=t.segmentIndex;if(i<0)return 0;let s=nc(t.value,0,1);i>=n&&(i=n-1,s=1);const o=this.getPrecision(e),r=this.getSubdivisions(e);let a=0;for(let h=0;h<i;h+=1){const t=this.segments[h],e=r[h];a+=t.length({precision:o,subdivisions:e})}const l=this.segments[i],c=r[i];return a+=l.lengthAtT(s,{precision:o,subdivisions:c}),a}tangentAt(t,e={}){if(0===this.segments.length)return null;const n=nc(t,0,1),i=this.getOptions(e),s=this.length(i),o=s*n;return this.tangentAtLength(o,i)}tangentAtLength(t,e={}){if(0===this.segments.length)return null;let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),s=this.getSubdivisions(e);let o,r=0;for(let a=0,l=this.segments.length;a<l;a+=1){const e=n?a:l-1-a,c=this.segments[e],h=s[e],u=c.length({precision:i,subdivisions:h});if(c.isDifferentiable()){if(t<=r+u)return c.tangentAtLength((n?1:-1)*(t-r),{precision:i,subdivisions:h});o=c}r+=u}if(o){const t=n?1:0;return o.tangentAtT(t)}return null}tangentAtT(t){const e=this.segments.length;if(0===e)return null;const n=t.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=e)return this.segments[e-1].tangentAtT(1);const i=nc(t.value,0,1);return this.segments[n].tangentAtT(i)}getPrecision(t={}){return null==t.precision?this.PRECISION:t.precision}getSubdivisions(t={}){if(null==t.segmentSubdivisions){const e=this.getPrecision(t);return this.getSegmentSubdivisions({precision:e})}return t.segmentSubdivisions}getOptions(t={}){const e=this.getPrecision(t),n=this.getSubdivisions(t);return{precision:e,segmentSubdivisions:n}}toPoints(t={}){const e=this.segments,n=e.length;if(0===n)return null;const i=this.getSubdivisions(t),s=[];let o=[];for(let r=0;r<n;r+=1){const t=e[r];if(t.isVisible){const e=i[r];e.length>0?e.forEach((t=>o.push(t.start))):o.push(t.start)}else o.length>0&&(o.push(e[r-1].end),s.push(o),o=[])}return o.length>0&&(o.push(this.end),s.push(o)),s}toPolylines(t={}){const e=this.toPoints(t);return e?e.map((t=>new uc(t))):null}scale(t,e,n){return this.segments.forEach((i=>i.scale(t,e,n))),this}rotate(t,e){return this.segments.forEach((n=>n.rotate(t,e))),this}translate(t,e){return"number"===typeof t?this.segments.forEach((n=>n.translate(t,e))):this.segments.forEach((e=>e.translate(t))),this}clone(){const t=new Nc;return this.segments.forEach((e=>t.appendSegment(e.clone()))),t}equals(t){if(null==t)return!1;const e=this.segments,n=t.segments,i=e.length;if(n.length!==i)return!1;for(let s=0;s<i;s+=1){const t=e[s],i=n[s];if(t.type!==i.type||!t.equals(i))return!1}return!0}toJSON(){return this.segments.map((t=>t.toJSON()))}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map((t=>t.serialize())).join(" ")}toString(){return this.serialize()}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return!(null!=n&&n!==t.toStringTag||!Array.isArray(i.segments)||"function"!==typeof i.moveTo||"function"!==typeof i.lineTo||"function"!==typeof i.curveTo)}t.toStringTag=`X6.Geometry.${t.name}`,t.isPath=e})(Nc||(Nc={})),function(t){function e(e){if(!e)return new t;const i=new t,s=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,o=t.normalize(e).match(s);if(null!=o)for(let t=0,r=o.length;t<r;t+=1){const e=o[t],s=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,r=e.match(s);if(null!=r){const t=r[0],e=r.slice(1).map((t=>+t)),s=n.call(null,t,...e);i.appendSegment(s)}}return i}function n(t,...e){if("M"===t)return mc.create.call(null,...e);if("L"===t)return pc.create.call(null,...e);if("C"===t)return yc.create.call(null,...e);if("z"===t||"Z"===t)return fc.create();throw new Error(`Invalid path segment type "${t}"`)}t.parse=e,t.createSegment=n}(Nc||(Nc={})),function(t){t.normalize=Ec,t.isValid=Sc,t.drawArc=Tc,t.drawPoints=Pc,t.arcToCurves=Oc}(Nc||(Nc={}));class jc{constructor(t,e,n){if(!t)throw new TypeError("Invalid element to create vector");let i;if(jc.isVector(t))i=t.node;else if("string"===typeof t)if("svg"===t.toLowerCase())i=bl();else if("<"===t[0]){const e=bl(t);i=document.importNode(e.firstChild,!0)}else i=document.createElementNS(gl.svg,t);else i=t;this.node=i,e&&this.setAttributes(e),n&&this.append(n)}get[Symbol.toStringTag](){return jc.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(t){this.node.id=t}transform(t,e){return null==t?jh(this.node):(jh(this.node,t,e),this)}translate(t,e=0,n={}){return null==t?Fh(this.node):(Fh(this.node,t,e,n),this)}rotate(t,e,n,i={}){return null==t?Lh(this.node):(Lh(this.node,t,e,n,i),this)}scale(t,e){return null==t?zh(this.node):(zh(this.node,t,e),this)}getTransformToElement(t){const e=jc.toNode(t);return Eh(this.node,e)}removeAttribute(t){return Ll(this.node,t),this}getAttribute(t){return Fl(this.node,t)}setAttribute(t,e){return zl(this.node,t,e),this}setAttributes(t){return Il(this.node,t),this}attr(t,e){return null==t?Bl(this.node):"string"===typeof t&&void 0===e?Bl(this.node,t):("object"===typeof t?Bl(this.node,t):Bl(this.node,t,e),this)}svg(){return this.node instanceof SVGSVGElement?this:jc.create(this.node.ownerSVGElement)}defs(){const t=this.svg()||this,e=t.node.getElementsByTagName("defs")[0];return e?jc.create(e):jc.create("defs").appendTo(t)}text(t,e={}){return Rc(this.node,t,e),this}tagName(){return Cl(this.node)}clone(){return jc.create(this.node.cloneNode(!0))}remove(){return Sl(this.node),this}empty(){return Al(this.node),this}append(t){return Dl(this.node,jc.toNodes(t)),this}appendTo(t){return Tl(this.node,jc.isVector(t)?t.node:t),this}prepend(t){return Pl(this.node,jc.toNodes(t)),this}before(t){return Ol(this.node,jc.toNodes(t)),this}replace(t){return this.node.parentNode&&this.node.parentNode.replaceChild(jc.toNode(t),this.node),jc.create(t)}first(){return this.node.firstChild?jc.create(this.node.firstChild):null}last(){return this.node.lastChild?jc.create(this.node.lastChild):null}get(t){const e=this.node.childNodes[t];return e?jc.create(e):null}indexOf(t){const e=Array.prototype.slice.call(this.node.childNodes);return e.indexOf(jc.toNode(t))}find(t){const e=[],n=xl(this.node,t);if(n)for(let i=0,s=n.length;i<s;i+=1)e.push(jc.create(n[i]));return e}findOne(t){const e=kl(this.node,t);return e?jc.create(e):null}findParentByClass(t,e){const n=El(this.node,t,e);return n?jc.create(n):null}matches(t){const e=this.node,n=(this.node.matches,e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null);return n&&n.call(e,t)}contains(t){return Ml(this.node,jc.isVector(t)?t.node:t)}wrap(t){const e=jc.create(t),n=this.node.parentNode;return null!=n&&n.insertBefore(e.node,this.node),e.append(this)}parent(t){let e=this;if(null==e.node.parentNode)return null;if(e=jc.create(e.node.parentNode),null==t)return e;do{if("string"===typeof t?e.matches(t):e instanceof t)return e}while(e=jc.create(e.node.parentNode));return e}children(){const t=this.node.childNodes,e=[];for(let n=0;n<t.length;n+=1){const i=t[n];1===i.nodeType&&e.push(jc.create(t[n]))}return e}eachChild(t,e){const n=this.children();for(let i=0,s=n.length;i<s;i+=1)t.call(n[i],n[i],i,n),e&&n[i].eachChild(t,e);return this}index(){return vl(this.node)}hasClass(t){return ol(this.node,t)}addClass(t){return rl(this.node,t),this}removeClass(t){return al(this.node,t),this}toggleClass(t,e){return ll(this.node,t,e),this}toLocalPoint(t,e){return Mh(this.node,t,e)}toGeometryShape(){return Sh(this.node)}translateCenterToPoint(t){const e=this.getBBox({target:this.svg()}),n=e.getCenter();return this.translate(t.x-n.x,t.y-n.y),this}translateAndAutoOrient(t,e,n){return Ih(this.node,t,e,n),this}animate(t){return Ah(this.node,t)}animateTransform(t){return Dh(this.node,t)}animateAlongPath(t,e){return Th(this.node,t,e)}normalizePath(){const t=this.tagName();return"path"===t&&this.attr("d",Nc.normalize(this.attr("d"))),this}bbox(t,e){return xh(this.node,t,e)}getBBox(t={}){return kh(this.node,{recursive:t.recursive,target:t.target?jc.toNode(t.target):null})}sample(t=1){return this.node instanceof SVGPathElement?Hc(this.node,t):[]}toPath(){return jc.create(th(this.node))}toPathData(){return eh(this.node)}}function Fc(t,e){const n=jc.create(e),i=jc.create("textPath"),s=t.d;if(s&&void 0===t["xlink:href"]){const t=jc.create("path").attr("d",s).appendTo(n.defs());i.attr("xlink:href",`#${t.id}`)}return"object"===typeof t&&i.attr(t),i.node}function Lc(t,e,n){const i=n.eol,s=n.baseSize,o=n.lineHeight;let r,a=0;const l={},c=e.length-1;for(let h=0;h<=c;h+=1){let o=e[h],l=null;if("object"===typeof o){const t=o.attrs,e=jc.create("tspan",t);r=e.node;let u=o.t;i&&h===c&&(u+=i),r.textContent=u;const d=t.class;d&&e.addClass(d),n.includeAnnotationIndices&&e.attr("annotations",o.annotations.join(",")),l=parseFloat(t["font-size"]),void 0===l&&(l=s),l&&l>a&&(a=l)}else i&&h===c&&(o+=i),r=document.createTextNode(o||" "),s&&s>a&&(a=s);t.appendChild(r)}return a&&(l.maxFontSize=a),o?l.lineHeight=o:a&&(l.lineHeight=1.2*a),l}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&i.node instanceof SVGElement&&"function"===typeof i.animate&&"function"===typeof i.sample&&"function"===typeof i.normalizePath&&"function"===typeof i.toPath}function n(e,n,i){return new t(e,n,i)}function i(t){if("<"===t[0]){const e=bl(t),i=[];for(let t=0,s=e.childNodes.length;t<s;t+=1){const s=e.childNodes[t];i.push(n(document.importNode(s,!0)))}return i}return[n(t)]}function s(t){return e(t)?t.node:t}function o(t){return Array.isArray(t)?t.map((t=>s(t))):[s(t)]}t.toStringTag=`X6.${t.name}`,t.isVector=e,t.create=n,t.createVectors=i,t.toNode=s,t.toNodes=o})(jc||(jc={}));const zc=/em$/;function Ic(t,e){const n=parseFloat(t);return zc.test(t)?n*e:n}function Bc(t,e,n,i){if(!Array.isArray(e))return 0;const s=e.length;if(!s)return 0;let o=e[0];const r=Ic(o.maxFontSize,n)||n;let a=0;const l=Ic(i,n);for(let u=1;u<s;u+=1){o=e[u];const t=Ic(o.lineHeight,n)||l;a+=t}const c=Ic(o.maxFontSize,n)||n;let h;switch(t){case"middle":h=r/2-.15*c-a/2;break;case"bottom":h=-.25*c-a;break;default:case"top":h=.8*r;break}return h}function Rc(t,e,n={}){e=Hl(e);const i=n.eol;let s=n.textPath;const o=n.textVerticalAnchor,r="middle"===o||"bottom"===o||"top"===o;let a=n.x;void 0===a&&(a=t.getAttribute("x")||0);const l=n.includeAnnotationIndices;let c=n.annotations;c&&!Array.isArray(c)&&(c=[c]);const h=n.lineHeight,u="auto"===h,d=u?"1.5em":h||"1em";Al(t),Bl(t,{"xml:space":"preserve",display:e||n.displayEmpty?null:"none"});const g=Bl(t,"font-size");let p,f,m=parseFloat(g);m||(m=16,!r&&!c||g||Bl(t,"font-size",`${m}`)),s?("string"===typeof s&&(s={d:s}),p=Fc(s,t)):p=document.createDocumentFragment();let y,b=0;const w=e.split("\n"),C=[],v=w.length-1;for(let k=0;k<=v;k+=1){f=d;let t="v-line";const e=yl("tspan");let n,o=w[k];if(o)if(c){const t=Gl(o,c,{offset:-b,includeAnnotationIndices:l});n=Lc(e,t,{eol:k!==v&&i,baseSize:m,lineHeight:u?null:d,includeAnnotationIndices:l});const s=n.lineHeight;s&&u&&0!==k&&(f=s),0===k&&(y=.8*n.maxFontSize)}else i&&k!==v&&(o+=i),e.textContent=o;else{e.textContent="-",t+=" v-empty-line";const i=e.style;i.fillOpacity=0,i.strokeOpacity=0,c&&(n={})}n&&C.push(n),k>0&&e.setAttribute("dy",f),(k>0||s)&&e.setAttribute("x",a),e.className.baseVal=t,p.appendChild(e),b+=o.length+1}if(r)if(c)f=Bc(o,C,m,d);else if("top"===o)f="0.8em";else{let t;switch(v>0?(t=parseFloat(d)||1,t*=v,zc.test(d)||(t/=m)):t=0,o){case"middle":f=.3-t/2+"em";break;case"bottom":f=-t-.3+"em";break;default:break}}else 0===o?f="0em":o?f=o:(f=0,null==t.getAttribute("y")&&t.setAttribute("y",`${y||"0.8em"}`));const x=p.firstChild;x.setAttribute("dy",f),t.appendChild(p)}function $c(t,e,n,i){const s=[],o=[];if(null!=e){const n=t.split(e);if(s.push(...n),"string"===typeof e)for(let t=0,i=n.length-1;t<i;t+=1)o.push(e);else{const i=t.match(new RegExp(e,"g"));for(let t=0,e=n.length-1;t<e;t+=1)o.push(i?i[t]:"")}}else{let e="";for(let n=0,i=t.length;n<i;n+=1){const i=t[n];" "===i?(s.push(e),o.push(" "),e=""):i.match(/[^\x00-\xff]/)?(e.length&&(s.push(e),o.push("")),s.push(i),o.push(""),e=""):e+=i}e.length&&s.push(e)}for(let r=0;r<s.length;r+=1){const t=s[r];if(t.indexOf(n)>=0&&t.length>1){const e=t.split(n);for(let t=0,s=e.length-1;t<s;t+=1)e.splice(2*t+1,0,n);const i=e.filter((t=>""!==t));s.splice(r,1,...i);const a=i.map((()=>""));a.pop(),o.splice(r,0,...a)}}for(let r=0;r<s.length;r+=1){const t=s[r],e=t.search(i);e>0&&e<t.length-1&&(s.splice(r,1,t.substring(0,e+1),t.substring(e+1)),o.splice(r,0,""))}return{words:s,separators:o}}function Vc(t,e,n={},i={}){const s=e.width,o=e.height,r=i.svgDocument||yl("svg"),a=yl("text"),l=yl("tspan"),c=document.createTextNode("");Bl(a,n),a.appendChild(l),a.style.opacity="0",a.style.display="block",l.style.display="block",l.appendChild(c),r.appendChild(a);const h=null==r.parentNode;h&&document.body.appendChild(r);const u=i.eol||"\n",d=i.separator||" ",g=i.hyphen?new RegExp(i.hyphen):/[^\w\d]/,p=!1!==i.breakWord,f=[],m={};let y,b,w,C=[];const{words:v,separators:x}=$c(t,i.separator,u,g);for(let k=0,E=0,M=v.length;k<M;k+=1){const t=v[k];if(t)if(t!==u){if(null!=C[E]?(w=x[k-1]||"",c.data=`${C[E]}${w}${t}`):c.data=t,l.getComputedTextLength()<=s)C[E]=c.data,m[E]=x[k],y&&(f[E]=!0,E+=1,y=0);else{if(p){if(!C[E]||y){const e=!!y,n=1===t.length;if(y=t.length-1,e||n){if(n){if(!C[E]){C=[];break}v.splice(k,2,t+v[k+1]),x.splice(k+1,1),f[E]=!0,E+=1,M-=1,k-=1;continue}v[k]=t.substring(0,y),v[k+1]=t.substring(y)+v[k+1]}else v.splice(k,1,t.substring(0,y),t.substring(y)),x.splice(k,0,""),M+=1,E&&!f[E-1]&&(E-=1);k-=1;continue}}else if(!C[E]){C[E]=t,f[E]=!0,E+=1;continue}E+=1,k-=1}if(null!=o){if(null==b){let t;t="auto"===n.lineHeight?{value:1.5,unit:"em"}:Va(n.lineHeight,["em"])||{value:1,unit:"em"},b=t.value,"em"===t.unit&&(ht.IS_FIREFOX?b*=l.getBBox().height:b*=a.getBBox().height)}if(b*C.length>o){const t=Math.floor(o/b)-1,e=C[t],n=C[t+1];if(C.splice(t+1),null==e)break;let r=i.ellipsis;if(!r)break;"string"!==typeof r&&(r="…");let a=e;n&&p&&(a+=w+n);let h,u,g=a.length;do{if(u=a[g],h=a.substring(0,g),u?u.match(d)&&(h+=u):h+=m[t],h+=r,c.data=h,l.getComputedTextLength()<=s){C[t]=h;break}g-=1}while(g>=0);break}}}else f[E]=!0,E+=1,C[E]=""}return Sl(h?r:a),C.join(u)}const _c=.551784;function Gc(t,e,n=NaN){const i=t.getAttribute(e);if(null==i)return n;const s=parseFloat(i);return Number.isNaN(s)?n:s}function Hc(t,e=1){const n=t.getTotalLength(),i=[];let s,o=0;while(o<n)s=t.getPointAtLength(o),i.push({distance:o,x:s.x,y:s.y}),o+=e;return i}function Uc(t){return["M",Gc(t,"x1"),Gc(t,"y1"),"L",Gc(t,"x2"),Gc(t,"y2")].join(" ")}function Wc(t){const e=Xc(t);return 0===e.length?null:`${Zc(e)} Z`}function qc(t){const e=Xc(t);return 0===e.length?null:Zc(e)}function Zc(t){const e=t.map((t=>`${t.x} ${t.y}`));return`M ${e.join(" L")}`}function Xc(t){const e=[],n=t.points;if(n)for(let i=0,s=n.numberOfItems;i<s;i+=1)e.push(n.getItem(i));return e}function Yc(t){const e=Gc(t,"cx",0),n=Gc(t,"cy",0),i=Gc(t,"r"),s=i*_c;return["M",e,n-i,"C",e+s,n-i,e+i,n-s,e+i,n,"C",e+i,n+s,e+s,n+i,e,n+i,"C",e-s,n+i,e-i,n+s,e-i,n,"C",e-i,n-s,e-s,n-i,e,n-i,"Z"].join(" ")}function Jc(t){const e=Gc(t,"cx",0),n=Gc(t,"cy",0),i=Gc(t,"rx"),s=Gc(t,"ry")||i,o=i*_c,r=s*_c,a=["M",e,n-s,"C",e+o,n-s,e+i,n-r,e+i,n,"C",e+i,n+r,e+o,n+s,e,n+s,"C",e-o,n+s,e-i,n+r,e-i,n,"C",e-i,n-r,e-o,n-s,e,n-s,"Z"].join(" ");return a}function Kc(t){return Qc({x:Gc(t,"x",0),y:Gc(t,"y",0),width:Gc(t,"width",0),height:Gc(t,"height",0),rx:Gc(t,"rx",0),ry:Gc(t,"ry",0)})}function Qc(t){let e;const n=t.x,i=t.y,s=t.width,o=t.height,r=Math.min(t.rx||t["top-rx"]||0,s/2),a=Math.min(t.rx||t["bottom-rx"]||0,s/2),l=Math.min(t.ry||t["top-ry"]||0,o/2),c=Math.min(t.ry||t["bottom-ry"]||0,o/2);return e=r||a||l||c?["M",n,i+l,"v",o-l-c,"a",a,c,0,0,0,a,c,"h",s-2*a,"a",a,c,0,0,0,a,-c,"v",-(o-c-l),"a",r,l,0,0,0,-r,-l,"h",-(s-2*r),"a",r,l,0,0,0,-r,l,"Z"]:["M",n,i,"H",n+s,"V",i+o,"H",n,"V",i,"Z"],e.join(" ")}function th(t){const e=yl("path");Bl(e,Bl(t));const n=eh(t);return n&&e.setAttribute("d",n),e}function eh(t){const e=t.tagName.toLowerCase();switch(e){case"path":return t.getAttribute("d");case"line":return Uc(t);case"polygon":return Wc(t);case"polyline":return qc(t);case"ellipse":return Jc(t);case"circle":return Yc(t);case"rect":return Kc(t);default:break}throw new Error(`"${e}" cannot be converted to svg path element.`)}function nh(t,e,n,i){const s=2*Math.PI-1e-6,o=t,r=e;let a=n,l=i;if(l<a){const t=a;a=l,l=t}const c=l-a,h=c<Math.PI?"0":"1",u=Math.cos(a),d=Math.sin(a),g=Math.cos(l),p=Math.sin(l);return c>=s?o?`M0,${r}A${r},${r} 0 1,1 0,${-r}A${r},${r} 0 1,1 0,${r}M0,${o}A${o},${o} 0 1,0 0,${-o}A${o},${o} 0 1,0 0,${o}Z`:`M0,${r}A${r},${r} 0 1,1 0,${-r}A${r},${r} 0 1,1 0,${r}Z`:o?`M${r*u},${r*d}A${r},${r} 0 ${h},1 ${r*g},${r*p}L${o*g},${o*p}A${o},${o} 0 ${h},0 ${o*u},${o*d}Z`:`M${r*u},${r*d}A${r},${r} 0 ${h},1 ${r*g},${r*p}L0,0Z`}const ih=yl("svg"),sh=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,oh=/[ ,]+/,rh=/^(\w+)\((.*)\)/;function ah(t,e){const n=ih.createSVGPoint();return n.x=t,n.y=e,n}function lh(t){const e=ih.createSVGMatrix();if(null!=t){const n=t,i=e;for(const t in n)i[t]=n[t]}return e}function ch(t){return null!=t?(t instanceof DOMMatrix||(t=lh(t)),ih.createSVGTransformFromMatrix(t)):ih.createSVGTransform()}function hh(t){let e=lh();const n=null!=t&&t.match(sh);if(!n)return e;for(let i=0,s=n.length;i<s;i+=1){const t=n[i],s=t.match(rh);if(s){let t,n,i,o,r,a=lh();const l=s[2].split(oh);switch(s[1].toLowerCase()){case"scale":t=parseFloat(l[0]),n=void 0===l[1]?t:parseFloat(l[1]),a=a.scaleNonUniform(t,n);break;case"translate":i=parseFloat(l[0]),o=parseFloat(l[1]),a=a.translate(i,o);break;case"rotate":r=parseFloat(l[0]),i=parseFloat(l[1])||0,o=parseFloat(l[2])||0,a=0!==i||0!==o?a.translate(i,o).rotate(r).translate(-i,-o):a.rotate(r);break;case"skewx":r=parseFloat(l[0]),a=a.skewX(r);break;case"skewy":r=parseFloat(l[0]),a=a.skewY(r);break;case"matrix":a.a=parseFloat(l[0]),a.b=parseFloat(l[1]),a.c=parseFloat(l[2]),a.d=parseFloat(l[3]),a.e=parseFloat(l[4]),a.f=parseFloat(l[5]);break;default:continue}e=e.multiply(a)}}return e}function uh(t){const e=t||{},n=null!=e.a?e.a:1,i=null!=e.b?e.b:0,s=null!=e.c?e.c:0,o=null!=e.d?e.d:1,r=null!=e.e?e.e:0,a=null!=e.f?e.f:0;return`matrix(${n},${i},${s},${o},${r},${a})`}function dh(t){let e,n,i;if(t){const s=oh;if(t.trim().indexOf("matrix")>=0){const s=hh(t),o=ph(s);e=[o.translateX,o.translateY],n=[o.rotation],i=[o.scaleX,o.scaleY];const r=[];0===e[0]&&0===e[1]||r.push(`translate(${e.join(",")})`),1===i[0]&&1===i[1]||r.push(`scale(${i.join(",")})`),0!==n[0]&&r.push(`rotate(${n[0]})`),t=r.join(" ")}else{const o=t.match(/translate\((.*?)\)/);o&&(e=o[1].split(s));const r=t.match(/rotate\((.*?)\)/);r&&(n=r[1].split(s));const a=t.match(/scale\((.*?)\)/);a&&(i=a[1].split(s))}}const s=i&&i[0]?parseFloat(i[0]):1;return{raw:t||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:n&&n[0]?parseInt(n[0],10):0,cx:n&&n[1]?parseInt(n[1],10):void 0,cy:n&&n[2]?parseInt(n[2],10):void 0},scale:{sx:s,sy:i&&i[1]?parseFloat(i[1]):s}}}function gh(t,e){const n=e.x*t.a+e.y*t.c+0,i=e.x*t.b+e.y*t.d+0;return{x:n,y:i}}function ph(t){const e=gh(t,{x:0,y:1}),n=gh(t,{x:1,y:0}),i=180/Math.PI*Math.atan2(e.y,e.x)-90,s=180/Math.PI*Math.atan2(n.y,n.x);return{skewX:i,skewY:s,translateX:t.e,translateY:t.f,scaleX:Math.sqrt(t.a*t.a+t.b*t.b),scaleY:Math.sqrt(t.c*t.c+t.d*t.d),rotation:i}}function fh(t){let e,n,i,s;return t?(e=null==t.a?1:t.a,s=null==t.d?1:t.d,n=t.b,i=t.c):e=s=1,{sx:n?Math.sqrt(e*e+n*n):e,sy:i?Math.sqrt(i*i+s*s):s}}function mh(t){let e={x:0,y:1};return t&&(e=gh(t,e)),{angle:Ql.normalize(Ql.toDeg(Math.atan2(e.y,e.x))-90)}}function yh(t){return{tx:t&&t.e||0,ty:t&&t.f||0}}function bh(t,e){const n=ah(t.x,t.y).matrixTransform(e);return new ac(n.x,n.y)}function wh(t,e){return new cc(bh(t.start,e),bh(t.end,e))}function Ch(t,e){const n=ih.createSVGPoint();n.x=t.x,n.y=t.y;const i=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y;const s=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y+t.height;const o=n.matrixTransform(e);n.x=t.x,n.y=t.y+t.height;const r=n.matrixTransform(e),a=Math.min(i.x,s.x,o.x,r.x),l=Math.max(i.x,s.x,o.x,r.x),c=Math.min(i.y,s.y,o.y,r.y),h=Math.max(i.y,s.y,o.y,r.y);return new lc(a,c,l-a,h-c)}var vh=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};function xh(t,e,n){let i;const s=t.ownerSVGElement;if(!s)return new lc(0,0,0,0);try{i=t.getBBox()}catch(r){i={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}if(e)return lc.create(i);const o=Eh(t,n||s);return Ch(i,o)}function kh(t,e={}){let n;const i=t.ownerSVGElement;if(!i||!dl(t)){if(Nl(t)){const{left:e,top:n,width:i,height:s}=Nh(t);return new lc(e,n,i,s)}return new lc(0,0,0,0)}let s=e.target;const o=e.recursive;if(!o){try{n=t.getBBox()}catch(r){n={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}if(!s)return lc.create(n);const e=Eh(t,s);return Ch(n,e)}{const e=t.childNodes,i=e.length;if(0===i)return kh(t,{target:s});s||(s=t);for(let t=0;t<i;t+=1){const i=e[t];let o;o=0===i.childNodes.length?kh(i,{target:s}):kh(i,{target:s,recursive:!0}),n=n?n.union(o):o}return n}}function Eh(t,e){if(dl(e)&&dl(t)){const n=e.getScreenCTM(),i=t.getScreenCTM();if(n&&i)return n.inverse().multiply(i)}return lh()}function Mh(t,e,n){const i=t instanceof SVGSVGElement?t:t.ownerSVGElement,s=i.createSVGPoint();s.x=e,s.y=n;try{const e=i.getScreenCTM(),n=s.matrixTransform(e.inverse()),o=Eh(t,i).inverse();return n.matrixTransform(o)}catch(o){return s}}function Sh(t){const e=e=>{const n=t.getAttribute(e),i=n?parseFloat(n):0;return Number.isNaN(i)?0:i};switch(t instanceof SVGElement&&t.nodeName.toLowerCase()){case"rect":return new lc(e("x"),e("y"),e("width"),e("height"));case"circle":return new hc(e("cx"),e("cy"),e("r"),e("r"));case"ellipse":return new hc(e("cx"),e("cy"),e("rx"),e("ry"));case"polyline":{const e=Xc(t);return new uc(e)}case"polygon":{const e=Xc(t);return e.length>1&&e.push(e[0]),new uc(e)}case"path":{let e=t.getAttribute("d");return Nc.isValid(e)||(e=Nc.normalize(e)),Nc.parse(e)}case"line":return new cc(e("x1"),e("y1"),e("x2"),e("y2"));default:break}return kh(t)}function Ah(t,e){return Ph(t,e,"animate")}function Dh(t,e){return Ph(t,e,"animateTransform")}function Ph(t,e,n){const i=yl(n);t.appendChild(i);try{return Oh(i,e)}catch(s){}return()=>{}}function Oh(t,e){const{start:n,complete:i,repeat:s}=e,o=vh(e,["start","complete","repeat"]);Bl(t,o),n&&t.addEventListener("beginEvent",n),i&&t.addEventListener("endEvent",i),s&&t.addEventListener("repeatEvent",s);const r=t;return r.beginElement(),()=>r.endElement()}function Th(t,e,n){const i=ul(n),s=yl("animateMotion"),o=yl("mpath");Bl(o,{"xlink:href":`#${i}`}),s.appendChild(o),t.appendChild(s);try{return Oh(s,e)}catch(r){if("fake"===document.documentElement.getAttribute("smiling")){const t=s;t.animators=[];const e=window,n=t.getAttribute("id");n&&(e.id2anim[n]=t);const i=e.getTargets(t);for(let s=0,o=i.length;s<o;s+=1){const n=i[s],o=new e.Animator(t,n,s);e.animators.push(o),t.animators[s]=o,o.register()}}}return()=>{}}function Nh(t){let e=0,n=0,i=0,s=0;if(t){let o=t;while(o)e+=o.offsetLeft,n+=o.offsetTop,o=o.offsetParent,o&&(e+=parseInt(Kl(o,"borderLeft"),10),n+=parseInt(Kl(o,"borderTop"),10));i=t.offsetWidth,s=t.offsetHeight}return{left:e,top:n,width:i,height:s}}function jh(t,e,n={}){if(null==e)return hh(Bl(t,"transform"));if(n.absolute)return void t.setAttribute("transform",uh(e));const i=t.transform,s=ch(e);i.baseVal.appendItem(s)}function Fh(t,e,n=0,i={}){let s=Bl(t,"transform");const o=dh(s);if(null==e)return o.translation;s=o.raw,s=s.replace(/translate\([^)]*\)/g,"").trim();const r=i.absolute?e:o.translation.tx+e,a=i.absolute?n:o.translation.ty+n,l=`translate(${r},${a})`;t.setAttribute("transform",`${l} ${s}`.trim())}function Lh(t,e,n,i,s={}){let o=Bl(t,"transform");const r=dh(o);if(null==e)return r.rotation;o=r.raw,o=o.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const a=s.absolute?e:r.rotation.angle+e,l=null!=n&&null!=i?`,${n},${i}`:"",c=`rotate(${a}${l})`;t.setAttribute("transform",`${o} ${c}`.trim())}function zh(t,e,n){let i=Bl(t,"transform");const s=dh(i);if(null==e)return s.scale;n=null==n?e:n,i=s.raw,i=i.replace(/scale\([^)]*\)/g,"").trim();const o=`scale(${e},${n})`;t.setAttribute("transform",`${i} ${o}`.trim())}function Ih(t,e,n,i){const s=ac.create(e),o=ac.create(n);if(!i){const e=t instanceof SVGSVGElement?t:t.ownerSVGElement;i=e}const r=zh(t);t.setAttribute("transform","");const a=kh(t,{target:i}).scale(r.sx,r.sy),l=ch();l.setTranslate(-a.x-a.width/2,-a.y-a.height/2);const c=ch(),h=s.angleBetween(o,s.clone().translate(1,0));h&&c.setRotate(h,0,0);const u=ch(),d=s.clone().move(o,a.width/2);u.setTranslate(2*s.x-d.x,2*s.y-d.y);const g=Eh(t,i),p=ch();p.setMatrix(u.matrix.multiply(c.matrix.multiply(l.matrix.multiply(g.scale(r.sx,r.sy))))),t.setAttribute("transform",uh(p.matrix))}class Bh{constructor(t,e,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=ht.isEventSupported("wheel")?"wheel":"mousewheel",this.target=t,this.onWheelCallback=e,this.onWheelGuard=n,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){ht.SUPPORT_PASSIVE?this.target.addEventListener(this.eventName,this.onWheel,{passive:!1}):lt()(this.target).on("mousewheel",this.onWheel)}disable(){ht.SUPPORT_PASSIVE?this.target.removeEventListener(this.eventName,this.onWheel):lt()(this.target).off("mousewheel")}onWheel(t){if(null!=this.onWheelGuard&&!this.onWheelGuard(t))return;let e;this.deltaX+=t.deltaX,this.deltaY+=t.deltaY,t.preventDefault(),0===this.deltaX&&0===this.deltaY||(t.stopPropagation(),e=!0),!0===e&&0===this.animationFrameId&&(this.animationFrameId=requestAnimationFrame((()=>{this.didWheel(t)})))}didWheel(t){this.animationFrameId=0,this.onWheelCallback(t,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}jc.isVector,jc.create,jc.createVectors;function Rh(t,e=60){let n=null;return(...i)=>{n&&clearTimeout(n),n=window.setTimeout((()=>{t.apply(this,i)}),e)}}function $h(t){let e=null,n=[];const i=()=>{if("static"===getComputedStyle(t).position){const e=t.style;e.position="relative"}const e=document.createElement("object");return e.onload=()=>{e.contentDocument.defaultView.addEventListener("resize",s),s()},e.style.display="block",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.height="100%",e.style.width="100%",e.style.overflow="hidden",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.opacity="0",e.setAttribute("tabindex","-1"),e.type="text/html",t.appendChild(e),e.data="about:blank",e},s=Rh((()=>{n.forEach((e=>e(t)))})),o=t=>{e||(e=i()),-1===n.indexOf(t)&&n.push(t)},r=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",s),e.parentNode.removeChild(e),e=null,n=[])},a=t=>{const i=n.indexOf(t);-1!==i&&n.splice(i,1),0===n.length&&e&&r()};return{element:t,bind:o,destroy:r,unbind:a}}function Vh(t){let e=null,n=[];const i=Rh((()=>{n.forEach((e=>{e(t)}))})),s=()=>{const e=new ResizeObserver(i);return e.observe(t),i(),e},o=t=>{e||(e=s()),-1===n.indexOf(t)&&n.push(t)},r=()=>{e&&(e.disconnect(),n=[],e=null)},a=t=>{const i=n.indexOf(t);-1!==i&&n.splice(i,1),0===n.length&&e&&r()};return{element:t,bind:o,destroy:r,unbind:a}}const _h="undefined"!==typeof ResizeObserver?Vh:$h;var Gh,Hh;(function(t){const e=new WeakMap;function n(t){let n=e.get(t);return n||(n=_h(t),e.set(t,n),n)}function i(t){t.destroy(),e.delete(t.element)}t.bind=(t,e)=>{const i=n(t);return i.bind(e),()=>i.unbind(e)},t.clear=t=>{const e=n(t);i(e)}})(Gh||(Gh={})),function(t){const e=[],n=1e3/60,i=[];let s=0;const o=()=>performance.now(),r=t=>t[0],a=t=>1===i.push(t)&&l(),l=(()=>{const t=()=>i.splice(0,i.length).forEach((t=>t()));if("undefined"!==typeof MessageChannel){const{port1:e,port2:n}=new MessageChannel;return e.onmessage=t,()=>n.postMessage(null)}return()=>setTimeout(t)})(),c=()=>{s=o()+n;let i=r(e);while(i&&!t.shouldYield()){const{callback:t,data:n}=i;i.callback=null;const s=t&&t(n);s?i.callback=s:e.shift(),i=r(e)}i&&a(c)};t.scheduleTask=(t,n)=>{const i={callback:t,data:n};e.push(i),a(c)},t.shouldYield=()=>{var t,e;return(null===(e=null===(t=navigator)||void 0===t?void 0:t.scheduling)||void 0===e?void 0:e.isInputPending())||o()>=s}}(Hh||(Hh={}));class Uh{constructor(t){this.options=Object.assign({},t),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(t,e,n=!1){if("object"===typeof t)return void Object.keys(t).forEach((n=>{this.register(n,t[n],e)}));!this.exist(t)||n||ht.isApplyingHMR()||this.onDuplicated(t);const i=this.options.process,s=i?Ya(i,this,t,e):e;return this.data[t]=s,s}unregister(t){const e=t?this.data[t]:null;return delete this.data[t],e}get(t){return t?this.data[t]:null}exist(t){return!!t&&null!=this.data[t]}onDuplicated(t){try{throw this.options.onConflict&&Ya(this.options.onConflict,this,t),new Error(`${ua(this.options.type)} with name '${t}' already registered.`)}catch(e){throw e}}onNotFound(t,e){throw new Error(this.getSpellingSuggestion(t,e))}getSpellingSuggestion(t,e){const n=this.getSpellingSuggestionForName(t),i=e?`${e} ${ka(this.options.type)}`:this.options.type;return`${ua(i)} with name '${t}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(t){return Oa(t,Object.keys(this.data),(t=>t))}}(function(t){function e(e){return new t(e)}t.create=e})(Uh||(Uh={}));const Wh={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},qh={},Zh={position:yu("x","width","origin")},Xh={position:yu("y","height","origin")},Yh={position:yu("x","width","corner")},Jh={position:yu("y","height","corner")},Kh={set:bu("width","width")},Qh={set:bu("height","height")},tu={set:bu("rx","width")},eu={set:bu("ry","height")},nu={set:(t=>{const e=bu(t,"width"),n=bu(t,"height");return function(t,i){const s=i.refBBox,o=s.height>s.width?e:n;return Ya(o,this,t,i)}})("r")},iu={set(t,{refBBox:e}){let n=parseFloat(t);const i=Ra(t);i&&(n/=100);const s=Math.sqrt(e.height*e.height+e.width*e.width);let o;return Number.isFinite(n)&&(o=i||n>=0&&n<=1?n*s:Math.max(n+s,0)),{r:o}}},su={set:bu("cx","width")},ou={set:bu("cy","height")},ru={set:Cu({resetOffset:!0})},au={set:Cu({resetOffset:!1})},lu={set:vu({resetOffset:!0})},cu={set:vu({resetOffset:!1})},hu=nu,uu=ru,du=lu,gu=Zh,pu=Xh,fu=Kh,mu=Qh;function yu(t,e,n){return(i,{refBBox:s})=>{if(null==i)return null;let o=parseFloat(i);const r=Ra(i);let a;if(r&&(o/=100),Number.isFinite(o)){const i=s[n];a=r||o>0&&o<1?i[t]+s[e]*o:i[t]+o}const l=new ac;return l[t]=a||0,l}}function bu(t,e){return function(n,{refBBox:i}){let s=parseFloat(n);const o=Ra(n);o&&(s/=100);const r={};if(Number.isFinite(s)){const n=o||s>=0&&s<=1?s*i[e]:Math.max(s+i[e],0);r[t]=n}return r}}function wu(t,e){const n="x6-shape",i=e&&e.resetOffset;return function(e,{view:s,elem:o,refBBox:r}){const a=s.$(o);let l=a.data(n);if(!l||l.value!==e){const i=t(e);l={value:e,shape:i,shapeBBox:i.bbox()},a.data(n,l)}const c=l.shape.clone(),h=l.shapeBBox.clone(),u=h.getOrigin(),d=r.getOrigin();h.x=d.x,h.y=d.y;const g=r.getMaxScaleToFit(h,d),p=0===h.width||0===r.width?1:g.sx,f=0===h.height||0===r.height?1:g.sy;return c.scale(p,f,u),i&&c.translate(-u.x,-u.y),c}}function Cu(t){function e(t){return Nc.parse(t)}const n=wu(e,t);return(t,e)=>{const i=n(t,e);return{d:i.serialize()}}}function vu(t){const e=wu((t=>new uc(t)),t);return(t,n)=>{const i=e(t,n);return{points:i.serialize()}}}const xu={qualify:Bn,set(t,{view:e}){return`url(#${e.graph.defineGradient(t)})`}},ku={qualify:Bn,set(t,{view:e}){const n=e.cell,i=Object.assign({},t);if(n.isEdge()&&"linearGradient"===i.type){const t=e,s=t.sourcePoint,o=t.targetPoint;i.id=`gradient-${i.type}-${n.id}`,i.attrs=Object.assign(Object.assign({},i.attrs),{x1:s.x,y1:s.y,x2:o.x,y2:o.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(i.id)}return`url(#${e.graph.defineGradient(i)})`}},Eu={qualify(t,{attrs:e}){return null==e.textWrap||!Bn(e.textWrap)},set(t,{view:e,elem:n,attrs:i}){const s="x6-text",o=e.$(n),r=o.data(s),a=t=>{try{return JSON.parse(t)}catch(e){return t}},l={x:i.x,eol:i.eol,annotations:a(i.annotations),textPath:a(i["text-path"]||i.textPath),textVerticalAnchor:i["text-vertical-anchor"]||i.textVerticalAnchor,displayEmpty:"true"===(i["display-empty"]||i.displayEmpty),lineHeight:i["line-height"]||i.lineHeight},c=i["font-size"]||i.fontSize,h=JSON.stringify([t,l]);if(c&&n.setAttribute("font-size",c),null==r||r!==h){const i=l.textPath;if(null!=i&&"object"===typeof i){const t=i.selector;if("string"===typeof t){const n=e.find(t)[0];n instanceof SVGPathElement&&(ul(n),l.textPath=Object.assign({"xlink:href":`#${n.id}`},i))}}Rc(n,`${t}`,l),o.data(s,h)}}},Mu={qualify:Bn,set(t,{view:e,elem:n,attrs:i,refBBox:s}){const o=t,r=o.width||0;Ra(r)?s.width*=parseFloat(r)/100:r<=0?s.width+=r:s.width=r;const a=o.height||0;let l;Ra(a)?s.height*=parseFloat(a)/100:a<=0?s.height+=a:s.height=a;let c=o.text;null==c&&(c=i.text),l=null!=c?Vc(`${c}`,s,{"font-weight":i["font-weight"]||i.fontWeight,"font-size":i["font-size"]||i.fontSize,"font-family":i["font-family"]||i.fontFamily,lineHeight:i.lineHeight},{svgDocument:e.graph.view.svg,ellipsis:o.ellipsis,hyphen:o.hyphen,breakWord:o.breakWord}):"",Ya(Eu.set,this,l,{view:e,elem:n,attrs:i,refBBox:s,cell:e.cell})}},Su=(t,{attrs:e})=>void 0!==e.text,Au={qualify:Su},Du={qualify:Su},Pu={qualify:Su},Ou={qualify:Su},Tu={qualify:Su},Nu={qualify:Su},ju={qualify(t,{elem:e}){return e instanceof SVGElement},set(t,{view:e,elem:n}){const i="x6-title",s=`${t}`,o=e.$(n),r=o.data(i);if(null==r||r!==s){o.data(i,s);const t=n.firstChild;if(t&&"TITLE"===t.tagName.toUpperCase()){const e=t;e.textContent=s}else{const e=document.createElementNS(n.namespaceURI,"title");e.textContent=s,n.insertBefore(e,t)}}}},Fu={offset:Iu("x","width","right")},Lu={offset:Iu("y","height","bottom")},zu={offset(t,{refBBox:e}){return t?{x:-e.x,y:-e.y}:{x:0,y:0}}};function Iu(t,e,n){return(i,{refBBox:s})=>{const o=new ac;let r;return r="middle"===i?s[e]/2:i===n?s[e]:"number"===typeof i&&Number.isFinite(i)?i>-1&&i<1?-s[e]*i:-i:Ra(i)?s[e]*parseFloat(i)/100:0,o[t]=-(s[t]+r),o}}const Bu={qualify:Bn,set(t,{view:e,elem:n}){e.$(n).css(t)}},Ru={set(t,{view:e,elem:n}){e.$(n).html(`${t}`)}},$u={qualify:Bn,set(t,{view:e}){return`url(#${e.graph.defineFilter(t)})`}},Vu={set(t){return null!=t&&"object"===typeof t&&t.id?t.id:t}};function _u(t,e,n){let i,s;"object"===typeof e?(i=e.x,s=e.y):(i=e,s=n);const o=Nc.parse(t),r=o.bbox();if(r){let t=-r.height/2-r.y,e=-r.width/2-r.x;"number"===typeof i&&(e-=i),"number"===typeof s&&(t-=s),o.translate(e,t)}return o.serialize()}var Gu=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const Hu=t=>{var{size:e,width:n,height:i,offset:s,open:o}=t,r=Gu(t,["size","width","height","offset","open"]);return Wu({size:e,width:n,height:i,offset:s},!0===o,!0,void 0,r)},Uu=t=>{var{size:e,width:n,height:i,offset:s,factor:o}=t,r=Gu(t,["size","width","height","offset","factor"]);return Wu({size:e,width:n,height:i,offset:s},!1,!1,o,r)};function Wu(t,e,n,i=3/4,s={}){const o=t.size||10,r=t.width||o,a=t.height||o,l=new Nc,c={};if(e)l.moveTo(r,0).lineTo(0,a/2).lineTo(r,a),c.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(r,0),!n){const t=Ia(i,0,1);l.lineTo(r*t,a/2)}l.lineTo(r,a),l.close()}return Object.assign(Object.assign(Object.assign({},c),s),{tagName:"path",d:_u(l.serialize(),{x:null!=t.offset?t.offset:-r/2})})}var qu=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const Zu=t=>{var{size:e,width:n,height:i,offset:s}=t,o=qu(t,["size","width","height","offset"]);const r=e||10,a=n||r,l=i||r,c=new Nc;return c.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},o),{tagName:"path",d:_u(c.serialize(),null==s?-a/2:s)})};var Xu=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const Yu=t=>{var{d:e,offsetX:n,offsetY:i}=t,s=Xu(t,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},s),{tagName:"path",d:_u(e,n,i)})};var Ju=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const Ku=t=>{var{size:e,width:n,height:i,offset:s}=t,o=Ju(t,["size","width","height","offset"]);const r=e||10,a=n||r,l=i||r,c=new Nc;return c.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},o),{tagName:"path",fill:"none",d:_u(c.serialize(),s||-a/2)})};var Qu=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const td=t=>{var{width:e,height:n,offset:i,open:s,flip:o}=t,r=Qu(t,["width","height","offset","open","flip"]);let a=n||6;const l=e||10,c=!0===s,h=!0===o,u=Object.assign(Object.assign({},r),{tagName:"path"});h&&(a=-a);const d=new Nc;return d.moveTo(0,a).lineTo(l,0),c?u.fill="none":(d.lineTo(l,a),d.close()),u.d=_u(d.serialize(),{x:i||-l/2,y:a/2}),u};var ed=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const nd=t=>{var{r:e}=t,n=ed(t,["r"]);const i=e||5;return Object.assign(Object.assign({cx:i},n),{tagName:"circle",r:i})},id=t=>{var{r:e}=t,n=ed(t,["r"]);const i=e||5,s=new Nc;return s.moveTo(i,0).lineTo(i,2*i),s.moveTo(0,i).lineTo(2*i,i),{children:[Object.assign(Object.assign({},nd({r:i})),{fill:"none"}),Object.assign(Object.assign({},n),{tagName:"path",d:_u(s.serialize(),-i)})]}};var sd=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const od=t=>{var{rx:e,ry:n}=t,i=sd(t,["rx","ry"]);const s=e||5,o=n||5;return Object.assign(Object.assign({cx:s},i),{tagName:"ellipse",rx:s,ry:o})};var rd;(function(t){t.presets=i,t.registry=Uh.create({type:"marker"}),t.registry.register(t.presets,!0)})(rd||(rd={})),function(t){t.normalize=_u}(rd||(rd={}));var ad=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};function ld(t){return"string"===typeof t||Bn(t)}const cd={qualify:ld,set(t,{view:e,attrs:n}){return dd("marker-start",t,e,n)}},hd={qualify:ld,set(t,{view:e,attrs:n}){return dd("marker-end",t,e,n,{transform:"rotate(180)"})}},ud={qualify:ld,set(t,{view:e,attrs:n}){return dd("marker-mid",t,e,n)}};function dd(t,e,n,i,s={}){const o="string"===typeof e?{name:e}:e,{name:r,args:a}=o,l=ad(o,["name","args"]);let c=l;if(r&&"string"===typeof r){const t=rd.registry.get(r);if(!t)return rd.registry.onNotFound(r);c=t(Object.assign(Object.assign({},l),a))}const h=Object.assign(Object.assign(Object.assign({},gd(i,t)),s),c);return{[t]:`url(#${n.graph.defineMarker(h)})`}}function gd(t,e){const n={},i=t.stroke;"string"===typeof i&&(n.stroke=i,n.fill=i);let s=t.strokeOpacity;if(null==s&&(s=t["stroke-opacity"]),null==s&&(s=t.opacity),null!=s&&(n["stroke-opacity"]=s,n["fill-opacity"]=s),"marker-mid"!==e){const i=parseFloat(t.strokeWidth||t["stroke-width"]);if(Number.isFinite(i)&&i>1){const t=Math.ceil(i/2);n.refX="marker-start"===e?t:-t}}return n}const pd=(t,{view:e})=>e.cell.isEdge(),fd={qualify:pd,set(t,e){const n=e.view,i=t.stubs||0;let s;if(Number.isFinite(i)&&0!==i){let t;if(i<0){const e=n.getConnectionLength()||0;t=(e+i)/2}else t=i;const e=n.getConnection();if(e){const n=e.divideAtLength(t),i=e.divideAtLength(-t);n&&i&&(s=`${n[0].serialize()} ${i[1].serialize()}`)}}return{d:s||n.getConnectionPathData()}}},md={qualify:pd,set:xd("getTangentAtLength",{rotate:!0})},yd={qualify:pd,set:xd("getTangentAtLength",{rotate:!1})},bd={qualify:pd,set:xd("getTangentAtRatio",{rotate:!0})},wd={qualify:pd,set:xd("getTangentAtRatio",{rotate:!1})},Cd=md,vd=bd;function xd(t,e){const n={x:1,y:0};return(i,s)=>{let o,r;const a=s.view,l=a[t](Number(i));return l?(r=e.rotate?l.vector().vectorAngle(n):0,o=l.start):(o=a.path.start,r=0),0===r?{transform:`translate(${o.x},${o.y}')`}:{transform:`translate(${o.x},${o.y}') rotate(${r})`}}}var kd;(function(t){function e(t,e,n){if(null!=t){if("string"===typeof t)return!0;if("function"!==typeof t.qualify||Ya(t.qualify,this,e,n))return!0}return!1}t.isValidDefinition=e})(kd||(kd={})),function(t){t.presets=Object.assign(Object.assign({},Wh),s),t.registry=Uh.create({type:"attribute definition"}),t.registry.register(t.presets,!0)}(kd||(kd={}));const Ed={color:"#aaaaaa",thickness:1,markup:"rect",update(t,e){const n=e.thickness*e.sx,i=e.thickness*e.sy;Bl(t,{width:n,height:i,rx:n,ry:i,fill:e.color})}},Md={color:"#aaaaaa",thickness:1,markup:"rect",update(t,e){const n=e.sx<=1?e.thickness*e.sx:e.thickness;Bl(t,{width:n,height:n,rx:n,ry:n,fill:e.color})}},Sd={color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(t,e){let n;const i=e.width,s=e.height,o=e.thickness;n=i-o>=0&&s-o>=0?["M",i,0,"H0 M0 0 V0",s].join(" "):"M 0 0 0 0",Bl(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}},Ad=[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(t,e){let n;const i=e.width,s=e.height,o=e.thickness;n=i-o>=0&&s-o>=0?["M",i,0,"H0 M0 0 V0",s].join(" "):"M 0 0 0 0",Bl(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(t,e){let n;const i=e.factor||1,s=e.width*i,o=e.height*i,r=e.thickness;n=s-r>=0&&o-r>=0?["M",s,0,"H0 M0 0 V0",o].join(" "):"M 0 0 0 0",e.width=s,e.height=o,Bl(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}}];class Dd{constructor(){this.patterns={},this.root=jc.create(bl(),{width:"100%",height:"100%"},[yl("defs")]).node}add(t,e){const n=this.root.childNodes[0];n&&n.appendChild(e),this.patterns[t]=e,jc.create("rect",{width:"100%",height:"100%",fill:`url(#${t})`}).appendTo(this.root)}get(t){return this.patterns[t]}has(t){return null!=this.patterns[t]}}function Pd(t,e){return null!=t?t:e}function Od(t,e){return null!=t&&Number.isFinite(t)?t:e}function Td(t={}){const e=Pd(t.color,"blue"),n=Od(t.width,1),i=Od(t.margin,2),s=Od(t.opacity,1),o=i,r=i+n;return`\n <filter>\n <feFlood flood-color="${e}" flood-opacity="${s}" result="colored"/>\n <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${r}" />\n <feMorphology in="SourceAlpha" result="morphedInner" operator="dilate" radius="${o}" />\n <feComposite result="morphedOuterColored" in="colored" in2="morphedOuter" operator="in"/>\n <feComposite operator="xor" in="morphedOuterColored" in2="morphedInner" result="outline"/>\n <feMerge>\n <feMergeNode in="outline"/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>\n `.trim()}function Nd(t={}){const e=Pd(t.color,"red"),n=Od(t.blur,0),i=Od(t.width,1),s=Od(t.opacity,1);return`\n <filter>\n <feFlood flood-color="${e}" flood-opacity="${s}" result="colored"/>\n <feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${i}"/>\n <feComposite result="composed" in="colored" in2="morphed" operator="in"/>\n <feGaussianBlur result="blured" in="composed" stdDeviation="${n}"/>\n <feBlend in="SourceGraphic" in2="blured" mode="normal"/>\n </filter>\n `.trim()}function jd(t={}){const e=Od(t.x,2),n=null!=t.y&&Number.isFinite(t.y)?[e,t.y]:e;return`\n <filter>\n <feGaussianBlur stdDeviation="${n}"/>\n </filter>\n `.trim()}function Fd(t={}){const e=Od(t.dx,0),n=Od(t.dy,0),i=Pd(t.color,"black"),s=Od(t.blur,4),o=Od(t.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>\n <feDropShadow stdDeviation="${s}" dx="${e}" dy="${n}" flood-color="${i}" flood-opacity="${o}" />\n </filter>`.trim():`<filter>\n <feGaussianBlur in="SourceAlpha" stdDeviation="${s}" />\n <feOffset dx="${e}" dy="${n}" result="offsetblur" />\n <feFlood flood-color="${i}" />\n <feComposite in2="offsetblur" operator="in" />\n <feComponentTransfer>\n <feFuncA type="linear" slope="${o}" />\n </feComponentTransfer>\n <feMerge>\n <feMergeNode/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>`.trim()}function Ld(t={}){const e=Od(t.amount,1),n=.2126+.7874*(1-e),i=.7152-.7152*(1-e),s=.0722-.0722*(1-e),o=.2126-.2126*(1-e),r=.7152+.2848*(1-e),a=.0722-.0722*(1-e),l=.2126-.2126*(1-e),c=.0722+.9278*(1-e);return`\n <filter>\n <feColorMatrix type="matrix" values="${n} ${i} ${s} 0 0 ${o} ${r} ${a} 0 0 ${l} ${i} ${c} 0 0 0 0 0 1 0"/>\n </filter>\n `.trim()}function zd(t={}){const e=Od(t.amount,1),n=.393+.607*(1-e),i=.769-.769*(1-e),s=.189-.189*(1-e),o=.349-.349*(1-e),r=.686+.314*(1-e),a=.168-.168*(1-e),l=.272-.272*(1-e),c=.534-.534*(1-e),h=.131+.869*(1-e);return`\n <filter>\n <feColorMatrix type="matrix" values="${n} ${i} ${s} 0 0 ${o} ${r} ${a} 0 0 ${l} ${c} ${h} 0 0 0 0 0 1 0"/>\n </filter>\n `.trim()}function Id(t={}){const e=Od(t.amount,1);return`\n <filter>\n <feColorMatrix type="saturate" values="${1-e}"/>\n </filter>\n `.trim()}function Bd(t={}){const e=Od(t.angle,0);return`\n <filter>\n <feColorMatrix type="hueRotate" values="${e}"/>\n </filter>\n `.trim()}function Rd(t={}){const e=Od(t.amount,1),n=1-e;return`\n <filter>\n <feComponentTransfer>\n <feFuncR type="table" tableValues="${e} ${n}"/>\n <feFuncG type="table" tableValues="${e} ${n}"/>\n <feFuncB type="table" tableValues="${e} ${n}"/>\n </feComponentTransfer>\n </filter>\n `.trim()}function $d(t={}){const e=Od(t.amount,1);return`\n <filter>\n <feComponentTransfer>\n <feFuncR type="linear" slope="${e}"/>\n <feFuncG type="linear" slope="${e}"/>\n <feFuncB type="linear" slope="${e}"/>\n </feComponentTransfer>\n </filter>\n `.trim()}function Vd(t={}){const e=Od(t.amount,1),n=.5-e/2;return`\n <filter>\n <feComponentTransfer>\n <feFuncR type="linear" slope="${e}" intercept="${n}"/>\n <feFuncG type="linear" slope="${e}" intercept="${n}"/>\n <feFuncB type="linear" slope="${e}" intercept="${n}"/>\n </feComponentTransfer>\n </filter>\n `.trim()}var _d;(function(t){t.presets=o,t.registry=Uh.create({type:"grid"}),t.registry.register(t.presets,!0)})(Dd||(Dd={})),function(t){t.presets=r,t.registry=Uh.create({type:"filter"}),t.registry.register(t.presets,!0)}(_d||(_d={}));const Gd=function(t){const e=document.createElement("canvas"),n=t.width,i=t.height;e.width=2*n,e.height=i;const s=e.getContext("2d");return s.drawImage(t,0,0,n,i),s.translate(2*n,0),s.scale(-1,1),s.drawImage(t,0,0,n,i),e},Hd=function(t){const e=document.createElement("canvas"),n=t.width,i=t.height;e.width=n,e.height=2*i;const s=e.getContext("2d");return s.drawImage(t,0,0,n,i),s.translate(0,2*i),s.scale(1,-1),s.drawImage(t,0,0,n,i),e},Ud=function(t){const e=document.createElement("canvas"),n=t.width,i=t.height;e.width=2*n,e.height=2*i;const s=e.getContext("2d");return s.drawImage(t,0,0,n,i),s.setTransform(-1,0,0,-1,e.width,e.height),s.drawImage(t,0,0,n,i),s.setTransform(-1,0,0,1,e.width,0),s.drawImage(t,0,0,n,i),s.setTransform(1,0,0,-1,0,e.height),s.drawImage(t,0,0,n,i),e},Wd=function(t,e){const n=t.width,i=t.height,s=document.createElement("canvas");s.width=3*n,s.height=3*i;const o=s.getContext("2d"),r=null!=e.angle?-e.angle:-20,a=Ql.toRad(r),l=s.width/4,c=s.height/4;for(let h=0;h<4;h+=1)for(let e=0;e<4;e+=1)(h+e)%2>0&&(o.setTransform(1,0,0,1,(2*h-1)*l,(2*e-1)*c),o.rotate(a),o.drawImage(t,-n/2,-i/2,n,i));return s};var qd;(function(t){t.presets=Object.assign({},a),t.presets["flip-x"]=Gd,t.presets["flip-y"]=Hd,t.presets["flip-xy"]=Ud,t.registry=Uh.create({type:"background pattern"}),t.registry.register(t.presets,!0)})(qd||(qd={}));const Zd={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,trackable:!1,trackInfo:{},track(t){Zd.trackable=t}};var Xd;(function(t){function e(t){return`${Zd.prefixCls}-${t}`}t.snapToGrid=ic,t.normalizeMarker=_u,t.prefix=e})(Xd||(Xd={})),function(t){function e(t,e,n,i=[]){const s="function"===typeof e.children?e.children(t):t[e.children||"children"];return n||(n=e.createNode(t),i.push(n)),Array.isArray(s)&&s.forEach((t=>{const s=e.createNode(t),o=e.createEdge(n,s);i.push(s,o),this.makeTree(t,e,s,i)})),i}t.makeTree=e}(Xd||(Xd={}));const Yd=Xd.prefix("highlighted"),Jd={highlight(t,e,n){const i=n&&n.className||Yd;rl(e,i)},unhighlight(t,e,n){const i=n&&n.className||Yd;al(e,i)}},Kd=Xd.prefix("highlight-opacity"),Qd={highlight(t,e){rl(e,Kd)},unhighlight(t,e){al(e,Kd)}},tg={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},eg={highlight(t,e,n){const i=ng.getHighlighterId(e,n);if(ng.hasCache(i))return;n=Mi({},n,tg);const s=jc.create(e);let o,r;try{o=s.toPathData()}catch(h){r=s.bbox(!0),o=Qc(Object.assign(Object.assign({},n),r))}const a=yl("path");if(Bl(a,Object.assign({d:o,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},n.attrs?$l(n.attrs):null)),t.isEdgeElement(e))Bl(a,"d",t.getConnectionPathData());else{let e=s.getTransformToElement(t.container);const i=n.padding;if(i){null==r&&(r=s.bbox(!0));const t=r.x+r.width/2,n=r.y+r.height/2;r=Ch(r,e);const o=Math.max(r.width,1),a=Math.max(r.height,1),l=(o+i)/o,c=(a+i)/a,h=lh({a:l,b:0,c:0,d:c,e:t-l*t,f:n-c*n});e=e.multiply(h)}jh(a,e)}rl(a,Xd.prefix("highlight-stroke"));const l=t.cell,c=()=>ng.removeHighlighter(i);l.on("removed",c),l.model&&l.model.on("reseted",c),t.container.appendChild(a),ng.setCache(i,a)},unhighlight(t,e,n){ng.removeHighlighter(ng.getHighlighterId(e,n))}};var ng,ig;function sg(t,e={}){return new ac($a(e.x,t.width),$a(e.y,t.height))}function og(t,e,n){return Object.assign({angle:e,position:t.toJSON()},n)}(function(t){function e(t,e){return ul(t),t.id+JSON.stringify(e)}t.getHighlighterId=e;const n={};function i(t,e){n[t]=e}function s(t){return null!=n[t]}function o(t){const e=n[t];e&&(Sl(e),delete n[t])}t.setCache=i,t.hasCache=s,t.removeHighlighter=o})(ng||(ng={})),function(t){function e(t,e){if("function"!==typeof e.highlight)throw new Error(`Highlighter '${t}' is missing required \`highlight()\` method`);if("function"!==typeof e.unhighlight)throw new Error(`Highlighter '${t}' is missing required \`unhighlight()\` method`)}t.check=e}(ig||(ig={})),function(t){t.presets=l,t.registry=Uh.create({type:"highlighter"}),t.registry.register(t.presets,!0)}(ig||(ig={}));const rg=(t,e)=>t.map((({x:t,y:n,angle:i})=>og(sg(e,{x:t,y:n}),i||0))),ag=(t,e,n)=>{const i=n.start||0,s=n.step||20;return cg(t,e,i,((t,e)=>(t+.5-e/2)*s))},lg=(t,e,n)=>{const i=n.start||0,s=n.step||360/t.length;return cg(t,e,i,(t=>t*s))};function cg(t,e,n,i){const s=e.getCenter(),o=e.getTopCenter(),r=e.width/e.height,a=hc.fromRect(e),l=t.length;return t.map(((t,e)=>{const c=n+i(e,l),h=o.clone().rotate(-c,s).scale(r,1,s),u=t.compensateRotate?-a.tangentTheta(h):0;return(t.dx||t.dy)&&h.translate(t.dx||0,t.dy||0),t.dr&&h.move(s,t.dr),og(h.round(),u,t)}))}var hg=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const ug=(t,e,n)=>{const i=sg(e,n.start||e.getOrigin()),s=sg(e,n.end||e.getCorner());return mg(t,i,s,n)},dg=(t,e,n)=>mg(t,e.getTopLeft(),e.getBottomLeft(),n),gg=(t,e,n)=>mg(t,e.getTopRight(),e.getBottomRight(),n),pg=(t,e,n)=>mg(t,e.getTopLeft(),e.getTopRight(),n),fg=(t,e,n)=>mg(t,e.getBottomLeft(),e.getBottomRight(),n);function mg(t,e,n,i){const s=new cc(e,n),o=t.length;return t.map(((t,e)=>{var{strict:n}=t,r=hg(t,["strict"]);const a=n||i.strict?(e+1)/(o+1):(e+.5)/o,l=s.pointAt(a);return(r.dx||r.dy)&&l.translate(r.dx||0,r.dy||0),og(l.round(),0,r)}))}var yg;(function(t){t.presets=c,t.registry=Uh.create({type:"port layout"}),t.registry.register(t.presets,!0)})(yg||(yg={}));const bg={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function wg(t,e){const{x:n,y:i,angle:s,attrs:o}=e||{};return Mi({},{angle:s,attrs:o,position:{x:n,y:i}},t,bg)}const Cg=(t,e,n)=>wg({position:e.getTopLeft()},n),vg=(t,e,n)=>wg({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},n),xg=(t,e,n)=>wg({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},n),kg=(t,e,n)=>wg({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},n),Eg=(t,e,n)=>wg({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},n),Mg=(t,e,n)=>Pg(t,e,!1,n),Sg=(t,e,n)=>Pg(t,e,!0,n),Ag=(t,e,n)=>Og(t,e,!1,n),Dg=(t,e,n)=>Og(t,e,!0,n);function Pg(t,e,n,i){const s=null!=i.offset?i.offset:15,o=e.getCenter().theta(t),r=Tg(e);let a,l,c,h,u=0;return o<r[1]||o>r[2]?(a=".3em",l=s,c=0,h="start"):o<r[0]?(a="0",l=0,c=-s,n?(u=-90,h="start"):h="middle"):o<r[3]?(a=".3em",l=-s,c=0,h="end"):(a=".6em",l=0,c=s,n?(u=90,h="start"):h="middle"),wg({position:{x:Math.round(l),y:Math.round(c)},angle:u,attrs:{".":{y:a,"text-anchor":h}}},i)}function Og(t,e,n,i){const s=null!=i.offset?i.offset:15,o=e.getCenter().theta(t),r=Tg(e);let a,l,c,h,u=0;return o<r[1]||o>r[2]?(a=".3em",l=-s,c=0,h="end"):o<r[0]?(a=".6em",l=0,c=s,n?(u=90,h="start"):h="middle"):o<r[3]?(a=".3em",l=s,c=0,h="start"):(a="0em",l=0,c=-s,n?(u=-90,h="start"):h="middle"),wg({position:{x:Math.round(l),y:Math.round(c)},angle:u,attrs:{".":{y:a,"text-anchor":h}}},i)}function Tg(t){const e=t.getCenter(),n=e.theta(t.getTopLeft()),i=e.theta(t.getBottomLeft()),s=e.theta(t.getBottomRight()),o=e.theta(t.getTopRight());return[n,o,s,i]}const Ng=(t,e,n)=>Fg(t.diff(e.getCenter()),!1,n),jg=(t,e,n)=>Fg(t.diff(e.getCenter()),!0,n);function Fg(t,e,n){const i=null!=n.offset?n.offset:20,s=new ac(0,0),o=-t.theta(s),r=t.clone().move(s,i).diff(t).round();let a,l=".3em",c=o;return(o+90)%180===0?(a=e?"end":"middle",e||-270!==o||(l="0em")):o>-270&&o<-90?(a="start",c=o-180):a="end",wg({position:r.round().toJSON(),angle:e?c:0,attrs:{".":{y:l,"text-anchor":a}}},n)}var Lg,zg;(function(t){t.presets=h,t.registry=Uh.create({type:"port label layout"}),t.registry.register(t.presets,!0)})(Lg||(Lg={}));class Ig{constructor(t,e,n,i){return null==t?this.set(255,255,255,1):"number"===typeof t?this.set(t,e,n,i):"string"===typeof t?Ig.fromString(t)||this:Array.isArray(t)?this.set(t):void this.set(t.r,t.g,t.b,null==t.a?1:t.a)}blend(t,e,n){this.set(t.r+(e.r-t.r)*n,t.g+(e.g-t.g)*n,t.b+(e.b-t.b)*n,t.a+(e.a-t.a)*n)}lighten(t){const e=Ig.lighten(this.toArray(),t);this.r=e[0],this.g=e[1],this.b=e[2],this.a=e[3]}darken(t){this.lighten(-t)}set(t,e,n,i){const s=Array.isArray(t)?t[0]:t,o=Array.isArray(t)?t[1]:e,r=Array.isArray(t)?t[2]:n,a=Array.isArray(t)?t[3]:i;return this.r=Math.round(Ia(s,0,255)),this.g=Math.round(Ia(o,0,255)),this.b=Math.round(Ia(r,0,255)),this.a=null==a?1:Ia(a,0,1),this}toHex(){const t=["r","g","b"].map((t=>{const e=this[t].toString(16);return e.length<2?`0${e}`:e}));return`#${t.join("")}`}toRGBA(){return this.toArray()}toHSLA(){return Ig.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(t){const e=`${this.r},${this.g},${this.b},`;return t?`rgb(${e})`:`rgba(${e},${this.a})`}toGrey(){return Ig.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}(function(t){function e(e){return new t(e)}function n(e){return new t([...p(e),1])}function i(e){const n=e.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(n){const e=n[1].split(/\s*,\s*/).map((t=>parseInt(t,10)));return new t(e)}return null}function s(t,e,n){n<0&&++n,n>1&&--n;const i=6*n;return i<1?t+(e-t)*i:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function o(e){const n=e.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(n){const e=n[2].split(/\s*,\s*/),i=(parseFloat(e[0])%360+360)%360/360,s=parseFloat(e[1])/100,o=parseFloat(e[2])/100,r=null==e[3]?1:parseInt(e[3],10);return new t(c(i,s,o,r))}return null}function r(e){if(e.startsWith("#"))return n(e);if(e.startsWith("rgb"))return i(e);const s=t.named[e];return s?n(s):o(e)}function a(e,n){return t.fromArray([e,e,e,n])}function l(t,e,n,i){const s=Array.isArray(t)?t[0]:t,o=Array.isArray(t)?t[1]:e,r=Array.isArray(t)?t[2]:n,a=Array.isArray(t)?t[3]:i,l=Math.max(s,o,r),c=Math.min(s,o,r),h=(l+c)/2;let u=0,d=0;if(c!==l){const t=l-c;switch(d=h>.5?t/(2-l-c):t/(l+c),l){case s:u=(o-r)/t+(o<r?6:0);break;case o:u=(r-s)/t+2;break;case r:u=(s-o)/t+4;break;default:break}u/=6}return[u,d,h,null==a?1:a]}function c(t,e,n,i){const o=Array.isArray(t)?t[0]:t,r=Array.isArray(t)?t[1]:e,a=Array.isArray(t)?t[2]:n,l=Array.isArray(t)?t[3]:i,c=a<=.5?a*(r+1):a+r-a*r,h=2*a-c;return[256*s(h,c,o+1/3),256*s(h,c,o),256*s(h,c,o-1/3),null==l?1:l]}function h(e){return new t(Math.round(256*Math.random()),Math.round(256*Math.random()),Math.round(256*Math.random()),e?void 0:parseFloat(Math.random().toFixed(2)))}function u(){const t="0123456789ABCDEF";let e="#";for(let n=0;n<6;n+=1)e+=t[Math.floor(16*Math.random())];return e}function d(t){return h(t).toString()}function g(t,e){if("string"===typeof t){const n="#"===t[0],[i,s,o]=p(t);return e?.299*i+.587*s+.114*o>186?"#000000":"#ffffff":`${n?"#":""}${f(255-i,255-s,255-o)}`}const n=t[0],i=t[1],s=t[2],o=t[3];return e?.299*n+.587*i+.114*s>186?[0,0,0,o]:[255,255,255,o]:[255-n,255-i,255-s,o]}function p(t){const e=0===t.indexOf("#")?t:`#${t}`;let n=Number(`0x${e.substr(1)}`);if(4!==e.length&&7!==e.length||Number.isNaN(n))throw new Error("Invalid hex color.");const i=4===e.length?4:8,s=(1<<i)-1,o=["b","g","r"].map((()=>{const t=n&s;return n>>=i,4===i?17*t:t}));return[o[2],o[1],o[0]]}function f(t,e,n){const i=t=>t.length<2?`0${t}`:t;return`${i(t.toString(16))}${i(e.toString(16))}${i(n.toString(16))}`}function m(t,e){return b(t,e)}function y(t,e){return b(t,-e)}function b(t,e){if("string"===typeof t){const n="#"===t[0],i=parseInt(n?t.substr(1):t,16),s=Ia((i>>16)+e,0,255),o=Ia((i>>8&255)+e,0,255),r=Ia((255&i)+e,0,255);return`${n?"#":""}${(r|o<<8|s<<16).toString(16)}`}const n=f(t[0],t[1],t[2]),i=p(b(n,e));return[i[0],i[1],i[2],t[3]]}t.fromArray=e,t.fromHex=n,t.fromRGBA=i,t.fromHSLA=o,t.fromString=r,t.makeGrey=a,t.rgba2hsla=l,t.hsla2rgba=c,t.random=h,t.randomHex=u,t.randomRGBA=d,t.invert=g,t.lighten=m,t.darken=y})(Ig||(Ig={})),function(t){t.named={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",burntsienna:"#ea7e5d",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(Ig||(Ig={}));class Bg{constructor(){this.listeners={}}on(t,e,n){if(null==e)return this;this.listeners[t]||(this.listeners[t]=[]);const i=this.listeners[t];return i.push(e,n),this}once(t,e,n){const i=(...s)=>(this.off(t,i),zg.call([e,n],s));return this.on(t,i,this)}off(t,e,n){if(!(t||e||n))return this.listeners={},this;const i=this.listeners,s=t?[t]:Object.keys(i);return s.forEach((t=>{const s=i[t];if(s)if(e||n)for(let i=s.length-2;i>=0;i-=2)e&&s[i]!==e||n&&s[i+1]!==n||s.splice(i,2);else delete i[t]})),this}trigger(t,...e){let n=!0;if("*"!==t){const i=this.listeners[t];null!=i&&(n=zg.call([...i],e))}const i=this.listeners["*"];return null!=i?Qa([n,zg.call([...i],[t,...e])]):n}emit(t,...e){return this.trigger(t,...e)}}(function(t){function e(t,e){const n=[];for(let i=0;i<t.length;i+=2){const s=t[i],o=t[i+1],r=Array.isArray(e)?e:[e],a=Xa(s,o,r);n.push(a)}return Qa(n)}t.call=e})(zg||(zg={}));class Rg{get disposed(){return!0===this._disposed}dispose(){this._disposed=!0}}(function(t){function e(){return(t,e,n)=>{const i=n.value,s=t.__proto__;n.value=function(){this.disposed||(i.call(this),s.dispose.call(this))}}}t.dispose=e})(Rg||(Rg={}));class $g{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach((t=>{t.dispose()})),this.items.clear())}contains(t){return this.items.has(t)}add(t){this.items.add(t)}remove(t){this.items.delete(t)}clear(){this.items.clear()}}(function(t){function e(e){const n=new t;return e.forEach((t=>{n.add(t)})),n}t.from=e})($g||($g={}));class Vg extends Bg{}(function(t){t.dispose=Rg.dispose})(Vg||(Vg={})),Si(Vg,Rg);class _g extends Vg{get disabled(){return!0===this._disabled}enable(){delete this._disabled}disable(){this._disabled=!0}}var Gg,Hg,Ug,Wg,qg,Zg=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class Xg extends Rg{constructor(){super(),this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(t){return this.map.has(t)}get(t){return this.map.get(t)}set(t,e){this.map.set(t,e),this.arr.push(t)}delete(t){const e=this.arr.indexOf(t);e>=0&&this.arr.splice(e,1);const n=this.map.get(t);return this.map.delete(t),n}each(t){this.arr.forEach((e=>{const n=this.map.get(e);t(n,e)}))}dispose(){this.clear()}}Zg([Rg.dispose()],Xg.prototype,"dispose",null);class Yg{constructor(t={}){this.comparator=t.comparator||Yg.defaultComparator,this.index={},this.data=t.data||[],this.heapify()}isEmpty(){return 0===this.data.length}insert(t,e,n){const i={priority:t,value:e},s=this.data.length-1;return n&&(i.id=n,this.index[n]=s),this.data.push(i),this.bubbleUp(s),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(t,e){const n=this.index[t];if("undefined"===typeof n)throw new Error(`Node with id '${t}' was not found in the heap.`);const i=this.data,s=i[n].priority,o=this.comparator(e,s);o<0?(i[n].priority=e,this.bubbleUp(n)):o>0&&(i[n].priority=e,this.bubbleDown(n))}remove(){const t=this.data,e=t[0],n=t.pop();return delete this.index[t.length],t.length>0&&(t[0]=n,n.id&&(this.index[n.id]=0),this.bubbleDown(0)),e?e.value:null}heapify(){for(let t=0;t<this.data.length;t+=1)this.bubbleUp(t)}bubbleUp(t){const e=this.data;let n,i,s=t;while(s>0){if(i=s-1>>>1,!(this.comparator(e[s].priority,e[i].priority)<0))break;{n=e[i],e[i]=e[s];let t=e[s].id;null!=t&&(this.index[t]=i),e[s]=n,t=e[s].id,null!=t&&(this.index[t]=s),s=i}}}bubbleDown(t){const e=this.data,n=e.length-1;let i=t;while(1){const t=1+(i<<1),s=t+1;let o=i;if(t<=n&&this.comparator(e[t].priority,e[o].priority)<0&&(o=t),s<=n&&this.comparator(e[s].priority,e[o].priority)<0&&(o=s),o===i)break;{const t=e[o];e[o]=e[i];let n=e[i].id;null!=n&&(this.index[n]=o),e[i]=t,n=e[i].id,null!=n&&(this.index[n]=i),i=o}}}}(function(t){t.defaultComparator=(t,e)=>t-e})(Yg||(Yg={})),function(t){function e(t,e,n=((t,e)=>1)){const i={},s={},o={},r=new Yg;i[e]=0,Object.keys(t).forEach((t=>{t!==e&&(i[t]=1/0),r.insert(i[t],t,t)}));while(!r.isEmpty()){const e=r.remove();o[e]=!0;const a=t[e]||[];for(let t=0;t<a.length;t+=1){const l=a[t];if(!o[l]){const t=i[e]+n(e,l);t<i[l]&&(i[l]=t,s[l]=e,r.updatePriority(l,t))}}}return s}t.run=e}(Gg||(Gg={})),function(t){t.linear=t=>t,t.quad=t=>t*t,t.cubic=t=>t*t*t,t.inout=t=>{if(t<=0)return 0;if(t>=1)return 1;const e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)},t.exponential=t=>Math.pow(2,10*(t-1)),t.bounce=t=>{for(let e=0,n=1;1;e+=n,n/=2)if(t>=(7-4*e)/11){const i=(11-6*e-11*t)/4;return-i*i+n*n}}}(Hg||(Hg={})),function(t){t.decorators={reverse(t){return e=>1-t(1-e)},reflect(t){return e=>.5*(e<.5?t(2*e):2-t(2-2*e))},clamp(t,e=0,n=1){return i=>{const s=t(i);return s<e?e:s>n?n:s}},back(t=1.70158){return e=>e*e*((t+1)*e-t)},elastic(t=1.5){return e=>Math.pow(2,10*(e-1))*Math.cos(20*Math.PI*t/3*e)}}}(Hg||(Hg={})),function(t){function e(t){return-1*Math.cos(t*(Math.PI/2))+1}function n(t){return Math.sin(t*(Math.PI/2))}function i(t){return-.5*(Math.cos(Math.PI*t)-1)}function s(t){return t*t}function o(t){return t*(2-t)}function r(t){return t<.5?2*t*t:(4-2*t)*t-1}function a(t){return t*t*t}function l(t){const e=t-1;return e*e*e+1}function c(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}function h(t){return t*t*t*t}function u(t){const e=t-1;return 1-e*e*e*e}function d(t){const e=t-1;return t<.5?8*t*t*t*t:1-8*e*e*e*e}function g(t){return t*t*t*t*t}function p(t){const e=t-1;return 1+e*e*e*e*e}function f(t){const e=t-1;return t<.5?16*t*t*t*t*t:1+16*e*e*e*e*e}function m(t){return 0===t?0:Math.pow(2,10*(t-1))}function y(t){return 1===t?1:1-Math.pow(2,-10*t)}function b(t){if(0===t||1===t)return t;const e=2*t,n=e-1;return e<1?.5*Math.pow(2,10*n):.5*(2-Math.pow(2,-10*n))}function w(t){const e=t/1;return-1*(Math.sqrt(1-e*t)-1)}function C(t){const e=t-1;return Math.sqrt(1-e*e)}function v(t){const e=2*t,n=e-2;return e<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-n*n)+1)}function x(t,e=1.70158){return t*t*((e+1)*t-e)}function k(t,e=1.70158){const n=t/1-1;return n*n*((e+1)*n+e)+1}function E(t,e=1.70158){const n=2*t,i=n-2,s=1.525*e;return n<1?.5*n*n*((s+1)*n-s):.5*(i*i*((s+1)*i+s)+2)}function M(t,e=.7){if(0===t||1===t)return t;const n=t/1,i=n-1,s=1-e,o=s/(2*Math.PI)*Math.asin(1);return-Math.pow(2,10*i)*Math.sin((i-o)*(2*Math.PI)/s)}function S(t,e=.7){const n=1-e,i=2*t;if(0===t||1===t)return t;const s=n/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/n)+1}function A(t,e=.65){const n=1-e;if(0===t||1===t)return t;const i=2*t,s=i-1,o=n/(2*Math.PI)*Math.asin(1);return i<1?Math.pow(2,10*s)*Math.sin((s-o)*(2*Math.PI)/n)*-.5:Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/n)*.5+1}function D(t){const e=t/1;if(e<1/2.75)return 7.5625*e*e;if(e<2/2.75){const t=e-1.5/2.75;return 7.5625*t*t+.75}if(e<2.5/2.75){const t=e-2.25/2.75;return 7.5625*t*t+.9375}{const t=e-2.625/2.75;return 7.5625*t*t+.984375}}function P(t){return 1-D(1-t)}function O(t){return t<.5?.5*P(2*t):.5*D(2*t-1)+.5}t.easeInSine=e,t.easeOutSine=n,t.easeInOutSine=i,t.easeInQuad=s,t.easeOutQuad=o,t.easeInOutQuad=r,t.easeInCubic=a,t.easeOutCubic=l,t.easeInOutCubic=c,t.easeInQuart=h,t.easeOutQuart=u,t.easeInOutQuart=d,t.easeInQuint=g,t.easeOutQuint=p,t.easeInOutQuint=f,t.easeInExpo=m,t.easeOutExpo=y,t.easeInOutExpo=b,t.easeInCirc=w,t.easeOutCirc=C,t.easeInOutCirc=v,t.easeInBack=x,t.easeOutBack=k,t.easeInOutBack=E,t.easeInElastic=M,t.easeOutElastic=S,t.easeInOutElastic=A,t.easeOutBounce=D,t.easeInBounce=P,t.easeInOutBounce=O}(Hg||(Hg={})),function(t){t.number=(t,e)=>{const n=e-t;return e=>t+n*e},t.object=(t,e)=>{const n=Object.keys(t);return i=>{const s={};for(let o=n.length-1;-1!==o;o-=1){const r=n[o];s[r]=t[r]+(e[r]-t[r])*i}return s}},t.unit=(t,e)=>{const n=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,i=n.exec(t),s=n.exec(e),o=s?s[1]:"",r=i?+i[1]:0,a=s?+s[1]:0,l=o.indexOf("."),c=l>0?o[1].length-l-1:0,h=a-r,u=i?i[2]:"";return t=>(r+h*t).toFixed(c)+u},t.color=(t,e)=>{const n=parseInt(t.slice(1),16),i=parseInt(e.slice(1),16),s=255&n,o=(255&i)-s,r=65280&n,a=(65280&i)-r,l=16711680&n,c=(16711680&i)-l;return t=>{const e=s+o*t&255,n=r+a*t&65280,i=l+c*t&16711680;return`#${(1<<24|e|n|i).toString(16).slice(1)}`}}}(Ug||(Ug={})),function(t){const e=`${Zd.prefixCls}.storage`;function n(t,e,n){const i=e.id||qo("doc-"),s=l(t);s.keys.push(i),r(c(t,i),e),r(h(t),s),o(n,null,Object.assign(Object.assign({},e),{id:i}))}function i(t,e,n){const i=l(t),s=[];if(null==e)i.keys.forEach((e=>{const i=a(c(t,e));i?s.push(i):o(n,new Error(`No document found for an ID '${e}' from index.`))})),o(n,null,s);else if(e.id){const i=a(c(t,e.id));o(n,null,i?[i]:[])}else o(n,null,[])}function s(t,e,n){const i=l(t);if(null==e)i.keys.forEach((e=>{localStorage.removeItem(c(t,e))})),localStorage.removeItem(h(t)),o(n,null);else if(e.id){const s=i.keys.indexOf(e.id);s>=0&&i.keys.splice(s,1),localStorage.removeItem(c(t,e.id)),r(h(t),i),o(n,null)}}function o(t,e,n){t&&Za((()=>{t(e,n)}))}function r(t,e){localStorage.setItem(t,JSON.stringify(e))}function a(t){const e=localStorage.getItem(t);return e?JSON.parse(e):null}function l(t){const e=a(h(t));return e?(null==e.keys&&(e.keys=[]),e):{keys:[]}}function c(t,n){return`${e}.${t}.docs.${n}`}function h(t){return`${e}.${t}.index`}t.insert=n,t.find=i,t.remove=s}(Wg||(Wg={}));class Jg extends Vg{constructor(){super(),this.cid=qg.uniqueId(),Jg.views[this.cid]=this}get priority(){return 2}confirmUpdate(t,e){return 0}$(t){return Jg.$(t)}empty(t=this.container){return this.$(t).empty(),this}unmount(t=this.container){return this.$(t).remove(),this}remove(t=this.container){return t===this.container&&(this.removeEventListeners(document),this.onRemove(),delete Jg.views[this.cid]),this.unmount(t),this}onRemove(){}setClass(t,e=this.container){e.classList.value=Array.isArray(t)?t.join(" "):t}addClass(t,e=this.container){return this.$(e).addClass(Array.isArray(t)?t.join(" "):t),this}removeClass(t,e=this.container){return this.$(e).removeClass(Array.isArray(t)?t.join(" "):t),this}setStyle(t,e=this.container){return this.$(e).css(t),this}setAttrs(t,e=this.container){return null!=t&&null!=e&&(e instanceof SVGElement?Bl(e,t):this.$(e).attr(t)),this}findAttr(t,e=this.container){let n=e;while(n&&1===n.nodeType){const e=n.getAttribute(t);if(null!=e)return e;if(n===this.container)return null;n=n.parentNode}return null}find(t,e=this.container,n=this.selectors){return Jg.find(t,e,n).elems}findOne(t,e=this.container,n=this.selectors){const i=this.find(t,e,n);return i.length>0?i[0]:null}findByAttr(t,e=this.container){let n=e;while(n&&n.getAttribute){const e=n.getAttribute(t);if((null!=e||n===this.container)&&"false"!==e)return n;n=n.parentNode}return null}getSelector(t,e){let n;if(t===this.container)return"string"===typeof e&&(n=`> ${e}`),n;if(t){const i=vl(t)+1;n=`${t.tagName.toLowerCase()}:nth-child(${i})`,e&&(n+=` > ${e}`),n=this.getSelector(t.parentNode,n)}return n}prefixClassName(t){return Xd.prefix(t)}delegateEvents(t,e){if(null==t)return this;e||this.undelegateEvents();const n=/^(\S+)\s*(.*)$/;return Object.keys(t).forEach((e=>{const i=e.match(n);if(null==i)return;const s=this.getEventHandler(t[e]);"function"===typeof s&&this.delegateEvent(i[1],i[2],s)})),this}undelegateEvents(){return this.$(this.container).off(this.getEventNamespace()),this}delegateDocumentEvents(t,e){return this.addEventListeners(document,t,e),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(t,e,n){return this.$(this.container).on(t+this.getEventNamespace(),e,n),this}undelegateEvent(t,e,n){const i=t+this.getEventNamespace();return null==e?this.$(this.container).off(i):"string"===typeof e?this.$(this.container).off(i,e,n):this.$(this.container).off(i,e),this}addEventListeners(t,e,n){if(null==e)return this;const i=this.getEventNamespace(),s=this.$(t);return Object.keys(e).forEach((t=>{const o=this.getEventHandler(e[t]);"function"===typeof o&&s.on(t+i,n,o)})),this}removeEventListeners(t){return null!=t&&this.$(t).off(this.getEventNamespace()),this}getEventNamespace(){return`.${Zd.prefixCls}-event-${this.cid}`}getEventHandler(t){let e;if("string"===typeof t){const n=this[t];"function"===typeof n&&(e=(...t)=>n.call(this,...t))}else e=(...e)=>t.call(this,...e);return e}getEventTarget(t,e={}){const{target:n,type:i,clientX:s=0,clientY:o=0}=t;return e.fromPoint||"touchmove"===i||"touchend"===i?document.elementFromPoint(s,o):n}stopPropagation(t){return this.setEventData(t,{propagationStopped:!0}),this}isPropagationStopped(t){return!0===this.getEventData(t).propagationStopped}getEventData(t){return this.eventData(t)}setEventData(t,e){return this.eventData(t,e)}eventData(t,e){if(null==t)throw new TypeError("Event object required");let n=t.data;const i=`__${this.cid}__`;return null==e?null==n?{}:n[i]||{}:(null==n&&(n=t.data={}),null==n[i]?n[i]=Object.assign({},e):n[i]=Object.assign(Object.assign({},n[i]),e),n[i])}normalizeEvent(t){return Jg.normalizeEvent(t)}}(function(t){function e(t){return lt()(t)}function n(t,e){return e?yl(t||"g"):ml(t||"div")}function i(t,n,i){if(!t||"."===t)return{elems:[n]};if(i){const e=i[t];if(e)return{elems:Array.isArray(e)?e:[e]}}return Zd.useCSSSelector?{isCSSSelector:!0,elems:e(n).find(t).toArray()}:{elems:[]}}function s(t){let e=t;const n=t.originalEvent,i=n&&n.changedTouches&&n.changedTouches[0];if(i){for(const e in t)void 0===i[e]&&(i[e]=t[e]);e=i}const s=e.target;if(s){const t=s.correspondingUseElement;t&&(e.target=t)}return e}t.$=e,t.createElement=n,t.find=i,t.normalizeEvent=s})(Jg||(Jg={})),function(t){function e(e){return t.views[e]||null}t.views={},t.getView=e}(Jg||(Jg={})),function(t){let e=0;function n(){const t=`v${e}`;return e+=1,t}t.uniqueId=n}(qg||(qg={}));const Kg=t=>t;function Qg(t,e){return 0===e?"0%":`${Math.round(t/e*100)}%`}function tp(t){const e=(e,n,i,s)=>n.isEdgeElement(i)?np(t,e,n,i,s):ep(t,e,n,i,s);return e}function ep(t,e,n,i,s){const o=n.cell,r=o.getAngle(),a=n.getUnrotatedBBoxOfElement(i),l=o.getBBox().getCenter(),c=ac.create(s).rotate(r,l);let h=c.x-a.x,u=c.y-a.y;return t&&(h=Qg(h,a.width),u=Qg(u,a.height)),e.anchor={name:"topLeft",args:{dx:h,dy:u,rotate:!0}},e}function np(t,e,n,i,s){const o=n.getConnection();if(!o)return e;const r=o.closestPointLength(s);if(t){const t=o.length();e.anchor={name:"ratio",args:{ratio:r/t}}}else e.anchor={name:"length",args:{length:r}};return e}const ip=tp(!0),sp=tp(!1);var op,rp;(function(t){t.presets=u,t.registry=Uh.create({type:"connection strategy"}),t.registry.register(t.presets,!0)})(op||(op={}));class ap{constructor(t){this.view=t,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new Xg,this.pathCache={}}get(t){const e=this.elemCache;return e.has(t)||this.elemCache.set(t,{}),this.elemCache.get(t)}getData(t){const e=this.get(t);return e.data||(e.data={}),e.data}getMatrix(t){const e=this.get(t);if(null==e.matrix){const n=this.view.rotatableNode||this.view.container;e.matrix=Eh(t,n)}return lh(e.matrix)}getShape(t){const e=this.get(t);return null==e.shape&&(e.shape=Sh(t)),e.shape.clone()}getBoundingRect(t){const e=this.get(t);return null==e.boundingRect&&(e.boundingRect=kh(t)),e.boundingRect.clone()}}(function(t){function e(t){return null!=t&&!n(t)}function n(t){return null!=t&&"string"===typeof t}function i(t){return null==t||n(t)?t:pi(t)}function s(t){return`${t}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}function o(t){const e=document.createDocumentFragment(),n={},i={},o=s(t),r=Pa(o,{raw:!0});return r.forEach((t=>{e.appendChild(t)})),{fragment:e,selectors:i,groups:n}}function r(t,e={ns:gl.svg}){const n=document.createDocumentFragment(),i={},s={},o=[{markup:Array.isArray(t)?t:[t],parent:n,ns:e.ns}];while(o.length>0){const t=o.pop();let e=t.ns||gl.svg;const n=t.markup,r=t.parent;n.forEach((t=>{const n=t.tagName;if(!n)throw new TypeError("Invalid tagName");t.ns&&(e=t.ns);const a=e===gl.svg,l=e?ml(n,e):fl(n),c=t.attrs;c&&(a?Bl(l,$l(c)):lt()(l).attr(c));const h=t.style;h&<()(l).css(h);const u=t.className;null!=u&&l.setAttribute("class",Array.isArray(u)?u.join(" "):u),t.textContent&&(l.textContent=t.textContent);const d=t.selector;if(null!=d){if(s[d])throw new TypeError("Selector must be unique");s[d]=l}if(t.groupSelector){let e=t.groupSelector;Array.isArray(e)||(e=[e]),e.forEach((t=>{i[t]||(i[t]=[]),i[t].push(l)}))}r.appendChild(l);const g=t.children;Array.isArray(g)&&o.push({ns:e,markup:g,parent:l})}))}return Object.keys(i).forEach((t=>{if(s[t])throw new Error("Ambiguous group selector");s[t]=i[t]})),{fragment:n,selectors:s,groups:i}}function a(t){return t instanceof SVGElement?yl("g"):fl("div")}function l(t){if(n(t)){const e=jc.createVectors(t),n=e.length;if(1===n)return{elem:e[0].node};if(n>1){const t=a(e[0].node);return e.forEach((e=>{t.appendChild(e.node)})),{elem:t}}return{}}const e=r(t),i=e.fragment;let s=null;return i.childNodes.length>1?(s=a(i.firstChild),s.appendChild(i)):s=i.firstChild,{elem:s,selectors:e.selectors}}function c(t){const e=jc.createVectors(t),n=document.createDocumentFragment();for(let i=0,s=e.length;i<s;i+=1){const t=e[i].node;n.appendChild(t)}return{fragment:n,selectors:{}}}t.isJSONMarkup=e,t.isStringMarkup=n,t.clone=i,t.sanitize=s,t.parseStringMarkup=o,t.parseJSONMarkup=r,t.renderMarkup=l,t.parseLabelStringMarkup=c})(rp||(rp={})),function(t){function e(t,n,i){if(null!=t){let s;const o=t.tagName.toLowerCase();if(t===n)return s="string"===typeof i?`> ${o} > ${i}`:`> ${o}`,s;const r=t.parentNode;if(r&&r.childNodes.length>1){const e=vl(t)+1;s=`${o}:nth-child(${e})`}else s=o;return i&&(s+=` > ${i}`),e(t.parentNode,n,s)}return i}function n(t,n,i){if("#text"===t.nodeName)return null;let s=null,o=null,r=null,a=!1;const l={tagName:t.tagName};if(t.attributes){r={};for(let e=0,n=t.attributes.length;e<n;e+=1){const n=t.attributes[e],i=n.nodeName,a=n.nodeValue;"selector"===i?s=a:"groupSelector"===i?o=a:"class"===i?l.attrs={class:a}:r[i]=a}}return null==s&&(a=!0,s=e(t,n)),t.namespaceURI&&(l.ns=t.namespaceURI),null==l.ns&&(["body","div","section","main","nav","footer","span","p","h1","h2","h3","h4","h5","h6","ul","ol","dl","center","strong","pre","form","select","textarea","fieldset","marquee","bgsound","iframe","frameset"].includes(t.tagName)?l.ns=gl.xhtml:i&&(l.ns=i)),s&&(l.selector=s),null!=o&&(l.groupSelector=o),{markup:l,attrs:r,isCSSSelector:a}}function i(e){const i=t.sanitize(e),s=wl(i,{mimeType:"image/svg+xml"}),o=Array.prototype.slice.call(s.childNodes),r={},a=new WeakMap,l=(t,e,i)=>{const s=n(t,e,i);if(null!=s){const{markup:n,attrs:i,isCSSSelector:o}=s;if(a.set(t,n),n.selector&&null!=i&&(Object.keys(i).length&&(r[n.selector]=i),o&&delete n.selector),t.childNodes&&t.childNodes.length>0)for(let s=0,r=t.childNodes.length;s<r;s+=1){const i=t.childNodes[s],o=l(i,e,n.ns);o&&(null==n.children&&(n.children=[]),n.children.push(o))}return n}{const e=a.get(t.parentNode);e&&t.textContent&&(e.textContent=t.textContent)}},c=o.map((t=>l(t,t))).filter((t=>null!=t));return{markup:c,attrs:r}}t.getSelector=e,t.xml2json=i}(rp||(rp={})),function(t){function e(){return"g"}function n(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}function i(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}t.getPortContainerMarkup=e,t.getPortMarkup=n,t.getPortLabelMarkup=i}(rp||(rp={})),function(t){function e(){return t.sanitize('\n <path class="connection" stroke="black" d="M 0 0 0 0"/>\n <path class="source-marker" fill="black" stroke="black" d="M 0 0 0 0"/>\n <path class="target-marker" fill="black" stroke="black" d="M 0 0 0 0"/>\n <path class="connection-wrap" d="M 0 0 0 0"/>\n <g class="labels"/>\n <g class="vertices"/>\n <g class="arrowheads"/>\n <g class="tools"/>\n ')}function n(){return t.sanitize('\n <g class="edge-tool">\n <g class="tool-remove" event="edge:remove">\n <circle r="11" />\n <path transform="scale(.8) translate(-16, -16)" d="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z" />\n <title>Remove edge.</title>\n </g>\n <g class="tool-options" event="edge:options">\n <circle r="11" transform="translate(25)"/>\n <path fill="white" transform="scale(.55) translate(29, -16)" d="M31.229,17.736c0.064-0.571,0.104-1.148,0.104-1.736s-0.04-1.166-0.104-1.737l-4.377-1.557c-0.218-0.716-0.504-1.401-0.851-2.05l1.993-4.192c-0.725-0.91-1.549-1.734-2.458-2.459l-4.193,1.994c-0.647-0.347-1.334-0.632-2.049-0.849l-1.558-4.378C17.165,0.708,16.588,0.667,16,0.667s-1.166,0.041-1.737,0.105L12.707,5.15c-0.716,0.217-1.401,0.502-2.05,0.849L6.464,4.005C5.554,4.73,4.73,5.554,4.005,6.464l1.994,4.192c-0.347,0.648-0.632,1.334-0.849,2.05l-4.378,1.557C0.708,14.834,0.667,15.412,0.667,16s0.041,1.165,0.105,1.736l4.378,1.558c0.217,0.715,0.502,1.401,0.849,2.049l-1.994,4.193c0.725,0.909,1.549,1.733,2.459,2.458l4.192-1.993c0.648,0.347,1.334,0.633,2.05,0.851l1.557,4.377c0.571,0.064,1.148,0.104,1.737,0.104c0.588,0,1.165-0.04,1.736-0.104l1.558-4.377c0.715-0.218,1.399-0.504,2.049-0.851l4.193,1.993c0.909-0.725,1.733-1.549,2.458-2.458l-1.993-4.193c0.347-0.647,0.633-1.334,0.851-2.049L31.229,17.736zM16,20.871c-2.69,0-4.872-2.182-4.872-4.871c0-2.69,2.182-4.872,4.872-4.872c2.689,0,4.871,2.182,4.871,4.872C20.871,18.689,18.689,20.871,16,20.871z"/>\n <title>Edge options.</title>\n </g>\n </g>\n ')}function i(){return t.sanitize('\n <g class="vertex-group" transform="translate(<%= x %>, <%= y %>)">\n <circle class="vertex" data-index="<%= index %>" r="10" />\n <path class="vertex-remove-area" data-index="<%= index %>" d="M16,5.333c-7.732,0-14,4.701-14,10.5c0,1.982,0.741,3.833,2.016,5.414L2,25.667l5.613-1.441c2.339,1.317,5.237,2.107,8.387,2.107c7.732,0,14-4.701,14-10.5C30,10.034,23.732,5.333,16,5.333z" transform="translate(5, -33)"/>\n <path class="vertex-remove" data-index="<%= index %>" transform="scale(.8) translate(9.5, -37)" d="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z">\n <title>Remove vertex.</title>\n </path>\n </g>\n ')}function s(){return t.sanitize('\n <g class="arrowhead-group arrowhead-group-<%= end %>">\n <path class="arrowhead" data-terminal="<%= end %>" d="M 26 0 L 0 13 L 26 26 z" />\n </g>\n ')}t.getEdgeMarkup=e,t.getEdgeToolMarkup=n,t.getEdgeVertexMarkup=i,t.getEdgeArrowheadMarkup=s}(rp||(rp={})),function(t){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:gl.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:gl.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}t.getForeignObjectMarkup=e}(rp||(rp={}));class lp{constructor(t){this.view=t}get cell(){return this.view.cell}getDefinition(t){return this.cell.getAttrDefinition(t)}processAttrs(t,e){let n,i,s,o,r;const a=[];return Object.keys(e).forEach((i=>{const s=e[i],o=this.getDefinition(i),r=Ya(kd.isValidDefinition,this.view,o,s,{elem:t,attrs:e,cell:this.cell,view:this.view});if(o&&r)"string"===typeof o?(null==n&&(n={}),n[o]=s):null!==s&&a.push({name:i,definition:o});else{null==n&&(n={});const t=lp.CASE_SENSITIVE_ATTR.includes(i)?i:Ma(i);n[t]=s}})),a.forEach((({name:n,definition:a})=>{const l=e[n],c=a;"function"===typeof c.set&&(!Nl(t)&&lp.DELAY_ATTRS.includes(n)?(null==r&&(r={}),r[n]=l):(null==i&&(i={}),i[n]=l));const h=a;"function"===typeof h.offset&&(null==s&&(s={}),s[n]=l);const u=a;"function"===typeof u.position&&(null==o&&(o={}),o[n]=l)})),{raw:e,normal:n,set:i,offset:s,position:o,delay:r}}mergeProcessedAttrs(t,e){t.set=Object.assign(Object.assign({},t.set),e.set),t.position=Object.assign(Object.assign({},t.position),e.position),t.offset=Object.assign(Object.assign({},t.offset),e.offset);const n=t.normal&&t.normal.transform;null!=n&&e.normal&&(e.normal.transform=n),t.normal=e.normal}findAttrs(t,e,n,i){const s=[],o=new Xg;return Object.keys(t).forEach((r=>{const a=t[r];if(!Bn(a))return;const{isCSSSelector:l,elems:c}=Jg.find(r,e,i);n[r]=c;for(let t=0,e=c.length;t<e;t+=1){const n=c[t],h=i&&i[r]===n,u=o.get(n);if(u){u.array||(s.push(n),u.array=!0,u.attrs=[u.attrs],u.priority=[u.priority]);const t=u.attrs,i=u.priority;if(h)t.unshift(a),i.unshift(-1);else{const n=Ot(i,l?-1:e);t.splice(n,0,a),i.splice(n,0,e)}}else o.set(n,{elem:n,attrs:a,priority:h?-1:e,array:!1})}})),s.forEach((t=>{const e=o.get(t),n=e.attrs;e.attrs=n.reduceRight(((t,e)=>Kn(t,e)),{})})),o}updateRelativeAttrs(t,e,n,i){const s=e.raw||{};let o=e.normal||{};const r=e.set,a=e.position,l=e.offset,c=e.delay,h=()=>({elem:t,cell:this.cell,view:this.view,attrs:s,refBBox:n.clone()});if(null!=r&&Object.keys(r).forEach((t=>{const e=r[t],n=this.getDefinition(t);if(null!=n){const i=Ya(n.set,this.view,e,h());"object"===typeof i?o=Object.assign(Object.assign({},o),i):null!=i&&(o[t]=i)}})),Nl(t))return void this.view.setAttrs(o,t);const u=o.transform,d=u?`${u}`:null,g=hh(d),p=new ac(g.e,g.f);u&&(delete o.transform,g.e=0,g.f=0);let f=1,m=1;if(a||l){const e=this.view.getScaleOfElement(t,i.scalableNode);f=e.sx,m=e.sy}let y=!1;null!=a&&Object.keys(a).forEach((t=>{const e=a[t],n=this.getDefinition(t);if(null!=n){const t=Ya(n.position,this.view,e,h());null!=t&&(y=!0,p.translate(ac.create(t).scale(f,m)))}})),this.view.setAttrs(o,t);let b=!1;if(null!=l){const e=this.view.getBoundingRectOfElement(t);if(e.width>0&&e.height>0){const n=Ch(e,g).scale(1/f,1/m);Object.keys(l).forEach((e=>{const i=l[e],o=this.getDefinition(e);if(null!=o){const e=Ya(o.offset,this.view,i,{elem:t,cell:this.cell,view:this.view,attrs:s,refBBox:n});null!=e&&(b=!0,p.translate(ac.create(e).scale(f,m)))}}))}}(null!=u||y||b)&&(p.round(1),g.e=p.x,g.f=p.y,t.setAttribute("transform",uh(g)));const w=()=>{null!=c&&Object.keys(c).forEach((e=>{const n=c[e],i=this.getDefinition(e);if(null!=i){const s=Ya(i.set,this.view,n,h());"object"===typeof s?this.view.setAttrs(s,t):null!=s&&this.view.setAttrs({[e]:s},t)}}))};i.forceSync?w():Hh.scheduleTask(w)}update(t,e,n){const i={},s=this.findAttrs(n.attrs||e,t,i,n.selectors),o=n.attrs?this.findAttrs(e,t,i,n.selectors):s,r=[];s.each((e=>{const s=e.elem,a=e.attrs,l=this.processAttrs(s,a);if(null==l.set&&null==l.position&&null==l.offset&&null==l.delay)this.view.setAttrs(l.normal,s);else{const e=o.get(s),c=e?e.attrs:null,h=c&&null==a.ref?c.ref:a.ref;let u;if(h){if(u=(i[h]||this.view.find(h,t,n.selectors))[0],!u)throw new Error(`"${h}" reference does not exist.`)}else u=null;const d={node:s,refNode:u,attributes:c,processedAttributes:l},g=r.findIndex((t=>t.refNode===s));g>-1?r.splice(g,0,d):r.push(d)}}));const a=new Xg;let l;r.forEach((e=>{const i=e.node,s=e.refNode;let o;const c=null!=s&&null!=n.rotatableNode&&Ml(n.rotatableNode,s);if(s&&(o=a.get(s)),!o){const e=c?n.rotatableNode:t;o=s?kh(s,{target:e}):n.rootBBox,s&&a.set(s,o)}let h;n.attrs&&e.attributes?(h=this.processAttrs(i,e.attributes),this.mergeProcessedAttrs(h,e.processedAttributes)):h=e.processedAttributes;let u=o;c&&null!=n.rotatableNode&&!n.rotatableNode.contains(i)&&(l||(l=hh(Bl(n.rotatableNode,"transform"))),u=Ch(o,l));const d=r.find((t=>t.refNode===i));d&&(n.forceSync=!0),this.updateRelativeAttrs(i,h,u,n)}))}}(function(t){t.CASE_SENSITIVE_ATTR=["viewBox"],t.DELAY_ATTRS=["text","textWrap","sourceMarker","targetMarker"]})(lp||(lp={}));class cp{constructor(t,e,n=[]){this.view=t;const i={},s={};let o=0;Object.keys(e).forEach((t=>{let n=e[t];Array.isArray(n)||(n=[n]),n.forEach((e=>{let n=i[e];n||(o+=1,n=i[e]=1<<o),s[t]|=n}))}));let r=n;if(Array.isArray(r)||(r=[r]),r.forEach((t=>{i[t]||(o+=1,i[t]=1<<o)})),o>25)throw new Error("Maximum number of flags exceeded.");this.flags=i,this.attrs=s,this.bootstrap=n}get cell(){return this.view.cell}getFlag(t){const e=this.flags;return null==e?0:Array.isArray(t)?t.reduce(((t,n)=>t|e[n]),0):0|e[t]}hasAction(t,e){return t&this.getFlag(e)}removeAction(t,e){return t^t&this.getFlag(e)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let t=0;return this.attrs?(Object.keys(this.attrs).forEach((e=>{this.cell.hasChanged(e)&&(t|=this.attrs[e])})),t):t}}var hp=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class up extends Jg{constructor(t,e={}){super(),this.cell=t,this.options=this.ensureOptions(e),this.graph=this.options.graph,this.attr=new lp(this),this.flag=new cp(this,this.options.actions,this.options.bootstrap),this.cache=new ap(this),this.setContainer(this.ensureContainer()),this.setup(),this.$(this.container).data("view",this),this.init()}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){const e=(t,e)=>null!=e?ft([...Array.isArray(t)?t:[t],...Array.isArray(e)?e:[e]]):Array.isArray(t)?[...t]:[t],n=pi(this.getDefaults()),{bootstrap:i,actions:s,events:o,documentEvents:r}=t,a=hp(t,["bootstrap","actions","events","documentEvents"]);return i&&(n.bootstrap=e(n.bootstrap,i)),s&&Object.keys(s).forEach((t=>{const i=s[t],o=n.actions[t];i&&o?n.actions[t]=e(o,i):i&&(n.actions[t]=e(i))})),o&&(n.events=Object.assign(Object.assign({},n.events),o)),t.documentEvents&&(n.documentEvents=Object.assign(Object.assign({},n.documentEvents),r)),Kn(n,a)}get[Symbol.toStringTag](){return up.toStringTag}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(t){return this.getConstructor().getOptions(t)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return Jg.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(t){if(this.container!==t){this.undelegateEvents(),this.container=t,null!=this.options.events&&this.delegateEvents(this.options.events);const e=this.getContainerAttrs();null!=e&&this.setAttrs(e,t);const n=this.getContainerStyle();null!=n&&this.setStyle(n,t);const i=this.getContainerClassName();null!=i&&this.addClass(i,t)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(t,e={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(t){return this.flag.getFlag(t)}hasAction(t,e){return this.flag.hasAction(t,e)}removeAction(t,e){return this.flag.removeAction(t,e)}handleAction(t,e,n,i){if(this.hasAction(t,e)){n();const s=[e];return i&&("string"===typeof i?s.push(i):s.push(...i)),this.removeAction(t,s)}return t}setup(){this.cell.on("changed",(({options:t})=>this.onAttrsChange(t)))}onAttrsChange(t){let e=this.flag.getChangedFlag();!t.updated&&e&&(t.dirty&&this.hasAction(e,"update")&&(e|=this.getFlag("render")),t.toolId&&(t.async=!1),null!=this.graph&&this.graph.renderer.requestViewUpdate(this,e,this.priority,t))}parseJSONMarkup(t,e){const n=rp.parseJSONMarkup(t),i=n.selectors,s=this.rootSelector;if(e&&s){if(i[s])throw new Error("Invalid root selector");i[s]=e}return n}can(t){let e=this.graph.options.interacting;if("function"===typeof e&&(e=Ya(e,this.graph,this)),"object"===typeof e){let n=e[t];return"function"===typeof n&&(n=Ya(n,this.graph,this)),!1!==n}return"boolean"===typeof e&&e}cleanCache(){return this.cache.clean(),this}getCache(t){return this.cache.get(t)}getDataOfElement(t){return this.cache.getData(t)}getMatrixOfElement(t){return this.cache.getMatrix(t)}getShapeOfElement(t){return this.cache.getShape(t)}getScaleOfElement(t,e){let n,i;if(e&&e.contains(t)){const t=zh(e);n=1/t.sx,i=1/t.sy}else n=1,i=1;return{sx:n,sy:i}}getBoundingRectOfElement(t){return this.cache.getBoundingRect(t)}getBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),i=this.getRootRotatedMatrix(),s=this.getRootTranslatedMatrix();return Ch(e,s.multiply(i).multiply(n))}getUnrotatedBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),i=this.getRootTranslatedMatrix();return Ch(e,i.multiply(n))}getBBox(t={}){let e;if(t.useCellGeometry){const t=this.cell,n=t.isNode()?t.getAngle():0;e=t.getBBox().bbox(n)}else e=this.getBBoxOfElement(this.container);return this.graph.localToGraph(e)}getRootTranslatedMatrix(){const t=this.cell,e=t.isNode()?t.getPosition():{x:0,y:0};return lh().translate(e.x,e.y)}getRootRotatedMatrix(){let t=lh();const e=this.cell,n=e.isNode()?e.getAngle():0;if(n){const i=e.getBBox(),s=i.width/2,o=i.height/2;t=t.translate(s,o).rotate(n).translate(-s,-o)}return t}findMagnet(t=this.container){return this.findByAttr("magnet",t)}updateAttrs(t,e,n={}){null==n.rootBBox&&(n.rootBBox=new lc),null==n.selectors&&(n.selectors=this.selectors),this.attr.update(t,e,n)}isEdgeElement(t){return this.cell.isEdge()&&(null==t||t===this.container)}prepareHighlight(t,e={}){const n=t&&this.$(t)[0]||this.container;return e.partial=n===this.container,n}highlight(t,e={}){const n=this.prepareHighlight(t,e);return this.notify("cell:highlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}),this}unhighlight(t,e={}){const n=this.prepareHighlight(t,e);return this.notify("cell:unhighlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(t,e){}getEdgeTerminal(t,e,n,i,s){const o=this.cell,r=this.findAttr("port",t),a=t.getAttribute("data-selector"),l={cell:o.id};return null!=a&&(l.magnet=a),null!=r?(l.port=r,o.isNode()&&(o.hasPort(r)||null!=a||(l.selector=this.getSelector(t)))):null==a&&this.container!==t&&(l.selector=this.getSelector(t)),this.customizeEdgeTerminal(l,t,e,n,i,s)}customizeEdgeTerminal(t,e,n,i,s,o){const r=s.getStrategy()||this.graph.options.connecting.strategy;if(r){const a="string"===typeof r?r:r.name,l="string"===typeof r?{}:r.args||{},c=op.registry;if(a){const r=c.get(a);if(null==r)return c.onNotFound(a);const h=Ya(r,this.graph,t,this,e,new ac(n,i),s,o,l);if(h)return h}}return t}getMagnetFromEdgeTerminal(t){const e=this.cell,n=this.container,i=t.port;let s,o=t.magnet;return null!=i&&e.isNode()&&e.hasPort(i)?s=this.findPortElem(i,o)||n:(o||(o=t.selector),o||null==i||(o=`[port="${i}"]`),s=this.findOne(o,n,this.selectors)),s}animate(t,e){const n="string"===typeof t?this.findOne(t):t;if(null==n)throw new Error("Invalid animation element.");const i=n.parentNode,s=()=>{i||Sl(n)},o=jc.create(n);i||o.appendTo(this.graph.view.stage);const r=e.complete;return e.complete=t=>{s(),r&&r(t)},o.animate(e)}animateTransform(t,e){const n="string"===typeof t?this.findOne(t):t;if(null==n)throw new Error("Invalid animation element.");const i=n.parentNode,s=()=>{i||Sl(n)},o=jc.create(n);i||o.appendTo(this.graph.view.stage);const r=e.complete;return e.complete=t=>{s(),r&&r(t)},o.animateTransform(e)}hasTools(t){const e=this.tools;return null!=e&&(null==t||e.name===t)}addTools(t){if(!this.can("toolsAddable"))return this;if(this.removeTools(),t){const e=dp.isToolsView(t)?t:new dp(t);this.tools=e,this.graph.on("tools:hide",this.hideTools,this),this.graph.on("tools:show",this.showTools,this),this.graph.on("tools:remove",this.removeTools,this),e.config({view:this}),e.mount()}return this}updateTools(t={}){return this.tools&&this.tools.update(t),this}removeTools(){return this.tools&&(this.tools.remove(),this.graph.off("tools:hide",this.hideTools,this),this.graph.off("tools:show",this.showTools,this),this.graph.off("tools:remove",this.removeTools,this),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}notify(t,e){return this.trigger(t,e),this.graph.trigger(t,e),this}getEventArgs(t,e,n){const i=this,s=i.cell;return null==e||null==n?{e:t,view:i,cell:s}:{e:t,x:e,y:n,view:i,cell:s}}onClick(t,e,n){this.notify("cell:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){this.notify("cell:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){this.notify("cell:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(t,e,n))}onMouseUp(t,e,n){this.notify("cell:mouseup",this.getEventArgs(t,e,n)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(t,e,n){this.notify("cell:mousemove",this.getEventArgs(t,e,n))}onMouseOver(t){this.notify("cell:mouseover",this.getEventArgs(t))}onMouseOut(t){this.notify("cell:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.notify("cell:mouseenter",this.getEventArgs(t))}onMouseLeave(t){this.notify("cell:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,i){this.notify("cell:mousewheel",Object.assign({delta:i},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,i){this.notify("cell:customevent",Object.assign({name:e},this.getEventArgs(t,n,i))),this.notify(e,Object.assign({},this.getEventArgs(t,n,i)))}onMagnetMouseDown(t,e,n,i){}onMagnetDblClick(t,e,n,i){}onMagnetContextMenu(t,e,n,i){}onLabelMouseDown(t,e,n){}checkMouseleave(t){const e=this.graph;e.renderer.isAsync()&&e.renderer.dumpView(this);const n=this.getEventTarget(t,{fromPoint:!0}),i=e.renderer.findViewByElem(n);i!==this&&(this.onMouseLeave(t),i&&i.onMouseEnter(t))}}up.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},function(t){t.Flag=cp,t.Attr=lp}(up||(up={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNodeView&&"function"===typeof i.isEdgeView&&"function"===typeof i.confirmUpdate}t.toStringTag=`X6.${t.name}`,t.isCellView=e}(up||(up={})),function(t){function e(t){return function(e){e.config({priority:t})}}function n(t){return function(e){e.config({bootstrap:t})}}t.priority=e,t.bootstrap=n}(up||(up={})),function(t){t.registry=Uh.create({type:"view"})}(up||(up={}));class dp extends Jg{constructor(t={}){super(),this.svgContainer=this.createContainer(!0,t),this.htmlContainer=this.createContainer(!1,t),this.config(t)}get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return dp.toStringTag}createContainer(t,e){const n=t?Jg.createElement("g",!0):Jg.createElement("div",!1);return rl(n,this.prefixClassName("cell-tools")),e.className&&rl(n,e.className),n}config(t){if(this.options=Object.assign(Object.assign({},this.options),t),!up.isCellView(t.view)||t.view===this.cellView)return this;this.cellView=t.view,this.cell.isEdge()?(rl(this.svgContainer,this.prefixClassName("edge-tools")),rl(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(rl(this.svgContainer,this.prefixClassName("node-tools")),rl(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const e=this.options.items;if(!Array.isArray(e))return this;this.tools=[];const n=[];e.forEach((t=>{if(dp.ToolItem.isToolItem(t))"vertices"===t.name?n.unshift(t):n.push(t);else{const e="object"===typeof t?t.name:t;"vertices"===e?n.unshift(t):n.push(t)}}));for(let i=0;i<n.length;i+=1){const t=n[i];let e;if(dp.ToolItem.isToolItem(t))e=t;else{const n="object"===typeof t?t.name:t,i="object"===typeof t&&t.args||{};if(n)if(this.cell.isNode()){const t=Dp.registry.get(n);if(!t)return Dp.registry.onNotFound(n);e=new t(i)}else if(this.cell.isEdge()){const t=Pp.registry.get(n);if(!t)return Pp.registry.onNotFound(n);e=new t(i)}}if(e){e.config(this.cellView,this),e.render();const t=!1!==e.options.isSVGElement?this.svgContainer:this.htmlContainer;t.appendChild(e.container),this.tools.push(e)}}return this}update(t={}){const e=this.tools;return e&&e.forEach((e=>{t.toolId!==e.cid&&e.isVisible()&&e.update()})),this}focus(t){const e=this.tools;return e&&e.forEach((e=>{t===e?e.show():e.hide()})),this}blur(t){const e=this.tools;return e&&e.forEach((e=>{e===t||e.isVisible()||(e.show(),e.update())})),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const t=this.tools;return t&&(t.forEach((t=>t.remove())),this.tools=null),Sl(this.svgContainer),Sl(this.htmlContainer),super.remove()}mount(){const t=this.tools,e=this.cellView;if(e&&t){const n=t.some((t=>!1!==t.options.isSVGElement)),i=t.some((t=>!1===t.options.isSVGElement));if(n){const t=this.options.local?e.container:e.graph.view.decorator;t.appendChild(this.svgContainer)}i&&this.graph.container.appendChild(this.htmlContainer)}return this}}function gp(t,e,n,i){const s=Ya(op.presets.pinRelative,this.graph,{},e,n,t,this.cell,i,{});return s.anchor}function pp(t,e){return e?t.cell.getBBox():t.cell.isEdge()?t.getConnection().bbox():t.getUnrotatedBBoxOfElement(t.container)}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&null!=i.graph&&null!=i.cell&&"function"===typeof i.config&&"function"===typeof i.update&&"function"===typeof i.focus&&"function"===typeof i.blur&&"function"===typeof i.show&&"function"===typeof i.hide}t.toStringTag=`X6.${t.name}`,t.isToolsView=e})(dp||(dp={})),function(t){class e extends Jg{constructor(t={}){super(),this.visible=!0,this.options=this.getOptions(t),this.container=Jg.createElement(this.options.tagName||"g",!1!==this.options.isSVGElement),rl(this.container,this.prefixClassName("cell-tool")),"string"===typeof this.options.className&&rl(this.container,this.options.className),this.init()}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){return Kn(pi(this.getDefaults()),t)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return e.toStringTag}init(){}getOptions(t){const e=this.constructor;return e.getOptions(t)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(t,e){return this.cellView=t,this.parent=e,this.stamp(this.container),this.cell.isEdge()?rl(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&rl(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const t=this.options.markup;if(t){const e=rp.isStringMarkup(t)?rp.parseStringMarkup(t):rp.parseJSONMarkup(t);this.container.appendChild(e.fragment),this.childNodes=e.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(t=this.container){t&&t.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return!!this.visible}focus(){const t=this.options.focusOpacity;return null!=t&&Number.isFinite(t)&&(this.container.style.opacity=`${t}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(t){return null==this.graph||null==this.cellView||this.graph.view.guard(t,this.cellView)}}e.defaults={isSVGElement:!0,tagName:"g"},t.ToolItem=e,function(t){let e=0;function n(t){return t?Sa(t):(e+=1,`CustomTool${e}`)}function i(t){const e=Ti(n(t.name),this);return e.config(t),e}t.define=i}(e=t.ToolItem||(t.ToolItem={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&null!=i.graph&&null!=i.cell&&"function"===typeof i.config&&"function"===typeof i.update&&"function"===typeof i.focus&&"function"===typeof i.blur&&"function"===typeof i.show&&"function"===typeof i.hide&&"function"===typeof i.isVisible}t.toStringTag=`X6.${t.name}`,t.isToolItem=e}(e=t.ToolItem||(t.ToolItem={}))}(dp||(dp={}));class fp extends dp.ToolItem{onRender(){rl(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView,e=t.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();jh(this.container,e,{absolute:!0})}getNodeMatrix(){const t=this.cellView,e=this.options;let{x:n=0,y:i=0}=e;const{offset:s,useCellGeometry:o,rotate:r}=e;let a=pp(t,o);const l=t.cell.getAngle();r||(a=a.bbox(l));let c=0,h=0;"number"===typeof s?(c=s,h=s):"object"===typeof s&&(c=s.x,h=s.y),n=$a(n,a.width),i=$a(i,a.height);let u=lh().translate(a.x+a.width/2,a.y+a.height/2);return r&&(u=u.rotate(l)),u=u.translate(n+c-a.width/2,i+h-a.height/2),u}getEdgeMatrix(){const t=this.cellView,e=this.options,{offset:n=0,distance:i=0,rotate:s}=e;let o,r,a;o=Ra(i)?t.getTangentAtRatio(parseFloat(i)/100):t.getTangentAtLength(i),o?(r=o.start,a=o.vector().vectorAngle(new ac(1,0))||0):(r=t.getConnection().start,a=0);let l=lh().translate(r.x,r.y).rotate(a);return l="object"===typeof n?l.translate(n.x||0,n.y||0):l.translate(0,n),s||(l=l.rotate(-a)),l}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.options.onClick;"function"===typeof e&&Ya(e,this.cellView,{e:t,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(t){t.config({name:"button",events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(fp||(fp={})),function(t){t.Remove=t.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,onClick({view:t,btn:e}){e.parent.remove(),t.cell.remove({ui:!0,toolId:e.cid})}})}(fp||(fp={}));var mp=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class yp extends dp.ToolItem{onRender(){if(rl(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const t=this.options.attrs,{class:e}=t,n=mp(t,["class"]);Bl(this.container,$l(n)),e&&rl(this.container,e)}this.update()}update(){const t=this.cellView,e=this.options,{useCellGeometry:n,rotate:i}=e,s=_a(e.padding);let o=pp(t,n).moveAndExpand({x:-s.left,y:-s.top,width:s.left+s.right,height:s.top+s.bottom});const r=t.cell;if(r.isNode()){const t=r.getAngle();if(t)if(i){const e=r.getBBox().getCenter();Lh(this.container,t,e.x,e.y,{absolute:!0})}else o=o.bbox(t)}return Bl(this.container,o.toJSON()),this}}(function(t){t.config({name:"boundary",tagName:"rect",padding:10,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})})(yp||(yp={}));class bp extends dp.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){const t=this.vertices;return t.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach((t=>{this.stopHandleListening(t),t.remove()}))}renderHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const n=t[e],i=this.options.createHandle,s=this.options.processHandle,o=i({index:e,graph:this.graph,guard:t=>this.guard(t),attrs:this.options.attrs||{}});s&&s(o),this.graph.hook.onToolItemCreated({name:"vertices",cell:this.cell,view:this.cellView,tool:o}),o.updatePosition(n.x,n.y),this.stamp(o.container),this.container.appendChild(o.container),this.handles.push(o),this.startHandleListening(o)}}updateHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const n=t[e],i=this.handles[e];i&&i.updatePosition(n.x,n.y)}}updatePath(){const t=this.childNodes.connection;t&&t.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.on("remove",this.onHandleRemove,this)}stopHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.off("remove",this.onHandleRemove,this)}getNeighborPoints(t){const e=this.cellView,n=this.vertices,i=t>0?n[t-1]:e.sourceAnchor,s=t<n.length-1?n[t+1]:e.targetAnchor;return{prev:ac.create(i),next:ac.create(s)}}getMouseEventArgs(t){const e=this.normalizeEvent(t),{x:n,y:i}=this.graph.snapToGrid(e.clientX,e.clientY);return{e:e,x:n,y:i}}onHandleChange({e:t}){this.focus();const e=this.cellView;if(e.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:n,x:i,y:s}=this.getMouseEventArgs(t);e.notifyMouseDown(n,i,s)}}onHandleChanging({handle:t,e:e}){const n=this.cellView,i=t.options.index,{e:s,x:o,y:r}=this.getMouseEventArgs(e),a={x:o,y:r};this.snapVertex(a,i),n.cell.setVertexAt(i,a,{ui:!0,toolId:this.cid}),t.updatePosition(a.x,a.y),this.options.stopPropagation||n.notifyMouseMove(s,o,r)}onHandleChanged({e:t}){const e=this.options,n=this.cellView;if(e.addable&&this.updatePath(),!e.removeRedundancies)return;const i=n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});i&&this.render(),this.blur(),n.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),this.eventData(t).vertexAdded&&n.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid});const{e:s,x:o,y:r}=this.getMouseEventArgs(t);this.options.stopPropagation||n.notifyMouseUp(s,o,r),n.checkMouseleave(s),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}snapVertex(t,e){const n=this.options.snapRadius||0;if(n>0){const i=this.getNeighborPoints(e),s=i.prev,o=i.next;Math.abs(t.x-s.x)<n?t.x=s.x:Math.abs(t.x-o.x)<n&&(t.x=o.x),Math.abs(t.y-s.y)<n?t.y=i.prev.y:Math.abs(t.y-o.y)<n&&(t.y=o.y)}}onHandleRemove({handle:t,e:e}){if(this.options.removable){const n=t.options.index,i=this.cellView;i.cell.removeVertexAt(n,{ui:!0}),this.options.addable&&this.updatePath(),i.checkMouseleave(this.normalizeEvent(e))}}onPathMouseDown(t){const e=this.cellView;if(this.guard(t)||!this.options.addable||!e.can("vertexAddable"))return;t.stopPropagation(),t.preventDefault();const n=this.normalizeEvent(t),i=this.graph.snapToGrid(n.clientX,n.clientY).toJSON();e.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const s=e.getVertexIndex(i.x,i.y);this.snapVertex(i,s),e.cell.insertVertex(i,s,{ui:!0,toolId:this.cid}),this.render();const o=this.handles[s];this.eventData(n,{vertexAdded:!0}),o.onMouseDown(n)}onRemove(){this.resetHandles()}}(function(t){class e extends Jg{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}get graph(){return this.options.graph}render(){this.container=Jg.createElement("circle",!0);const e=this.options.attrs;if("function"===typeof e){const n=t.getDefaults();this.setAttrs(Object.assign(Object.assign({},n.attrs),e(this)))}else this.setAttrs(e);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(t,e){this.setAttrs({cx:t,cy:e})}onMouseDown(t){this.options.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data),this.emit("change",{e:t,handle:this}))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(t){this.emit("remove",{e:t,handle:this})}}t.Handle=e})(bp||(bp={})),function(t){const e=Xd.prefix("edge-tool-vertex-path");t.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:e=>new t.Handle(e),markup:[{tagName:"path",selector:"connection",className:e,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${e}`]:"onPathMouseDown",[`touchstart .${e}`]:"onPathMouseDown"}})}(bp||(bp={}));class wp extends dp.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){rl(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const t=this.cellView,e=[...this.vertices];e.unshift(t.sourcePoint),e.push(t.targetPoint);for(let n=0,i=e.length;n<i-1;n+=1){const t=e[n],i=e[n+1],s=this.renderHandle(t,i,n);this.stamp(s.container),this.handles.push(s)}return this}renderHandle(t,e,n){const i=this.options.createHandle({index:n,graph:this.graph,guard:t=>this.guard(t),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(i),this.graph.hook.onToolItemCreated({name:"segments",cell:this.cell,view:this.cellView,tool:i}),this.updateHandle(i,t,e),this.container.appendChild(i.container),this.startHandleListening(i),i}startHandleListening(t){t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)}stopHandleListening(t){t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach((t=>{this.stopHandleListening(t),t.remove()}))}shiftHandleIndexes(t){const e=this.handles;for(let n=0,i=e.length;n<i;n+=1)e[n].options.index+=t}resetAnchor(t,e){const n=this.cellView.cell,i={ui:!0,toolId:this.cid};e?n.prop([t,"anchor"],e,i):n.removeProp([t,"anchor"],i)}snapHandle(t,e,n){const i=t.options.axis,s=t.options.index,o=this.cellView,r=o.cell,a=r.getVertices(),l=a[s-2]||n.sourceAnchor,c=a[s+1]||n.targetAnchor,h=this.options.snapRadius;return Math.abs(e[i]-l[i])<h?e[i]=l[i]:Math.abs(e[i]-c[i])<h&&(e[i]=c[i]),e}onHandleChanging({handle:t,e:e}){const n=this.graph,i=this.options,s=this.cellView,o=i.anchor,r=t.options.axis,a=t.options.index-1,l=this.getEventData(e),c=this.normalizeEvent(e),h=n.snapToGrid(c.clientX,c.clientY),u=this.snapHandle(t,h.clone(),l),d=pi(this.vertices);let g=d[a],p=d[a+1];const f=s.sourceView,m=s.sourceBBox;let y=!1,b=!1;if(g?0===a?m.containsPoint(g)?(d.shift(),this.shiftHandleIndexes(-1),y=!0):(g[r]=u[r],b=!0):g[r]=u[r]:(g=s.sourceAnchor.toJSON(),g[r]=u[r],m.containsPoint(g)?y=!0:(d.unshift(g),this.shiftHandleIndexes(1),b=!0)),"function"===typeof o&&f){if(y){const t=l.sourceAnchor.clone();t[r]=u[r];const e=Ya(o,s,t,f,s.sourceMagnet||f.container,"source",s,this);this.resetAnchor("source",e)}b&&this.resetAnchor("source",l.sourceAnchorDef)}const w=s.targetView,C=s.targetBBox;let v=!1,x=!1;if(p?a===d.length-2?C.containsPoint(p)?(d.pop(),v=!0):(p[r]=u[r],x=!0):p[r]=u[r]:(p=s.targetAnchor.toJSON(),p[r]=u[r],C.containsPoint(p)?v=!0:(d.push(p),x=!0)),"function"===typeof o&&w){if(v){const t=l.targetAnchor.clone();t[r]=u[r];const e=Ya(o,s,t,w,s.targetMagnet||w.container,"target",s,this);this.resetAnchor("target",e)}x&&this.resetAnchor("target",l.targetAnchorDef)}ac.equalPoints(d,this.vertices)||this.cellView.cell.setVertices(d,{ui:!0,toolId:this.cid}),this.updateHandle(t,g,p,0),i.stopPropagation||s.notifyMouseMove(c,h.x,h.y)}onHandleChange({handle:t,e:e}){const n=this.options,i=this.handles,s=this.cellView,o=t.options.index;if(Array.isArray(i)){for(let t=0,e=i.length;t<e;t+=1)t!==o&&i[t].hide();if(this.focus(),this.setEventData(e,{sourceAnchor:s.sourceAnchor.clone(),targetAnchor:s.targetAnchor.clone(),sourceAnchorDef:pi(this.cell.prop(["source","anchor"])),targetAnchorDef:pi(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!n.stopPropagation){const t=this.normalizeEvent(e),n=this.graph.snapToGrid(t.clientX,t.clientY);s.notifyMouseDown(t,n.x,n.y)}}}onHandleChanged({e:t}){const e=this.options,n=this.cellView;e.removeRedundancies&&n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const i=this.normalizeEvent(t),s=this.graph.snapToGrid(i.clientX,i.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),e.stopPropagation||n.notifyMouseUp(i,s.x,s.y),n.checkMouseleave(i),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}updateHandle(t,e,n,i=0){const s=this.options.precision||0,o=Math.abs(e.x-n.x)<s,r=Math.abs(e.y-n.y)<s;if(o||r){const s=new cc(e,n),r=s.length();if(r<this.options.threshold)t.hide();else{const e=s.getCenter(),n=o?"x":"y";e[n]+=i||0;const r=s.vector().vectorAngle(new ac(1,0));t.updatePosition(e.x,e.y,r,this.cellView),t.show(),t.options.axis=n}}else t.hide()}onRemove(){this.resetHandles()}}(function(t){class e extends Jg{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=Jg.createElement("rect",!0);const e=this.options.attrs;if("function"===typeof e){const n=t.getDefaults();this.setAttrs(Object.assign(Object.assign({},n.attrs),e(this)))}else this.setAttrs(e);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(t,e,n,i){const s=i.getClosestPoint(new ac(t,e))||new ac(t,e);let o=lh().translate(s.x,s.y);if(s.equals({x:t,y:e}))o=o.rotate(n);else{const n=new cc(t,e,s.x,s.y);let i=n.vector().vectorAngle(new ac(1,0));0!==i&&(i+=90),o=o.rotate(i)}this.setAttrs({transform:uh(o),cursor:n%180===0?"row-resize":"col-resize"})}onMouseDown(t){this.options.guard(t)||(this.trigger("change",{e:t,handle:this}),t.stopPropagation(),t.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}}t.Handle=e})(wp||(wp={})),function(t){t.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:e=>new t.Handle(e),anchor:gp})}(wp||(wp={}));class Cp extends dp.ToolItem{get type(){return this.options.type}onRender(){rl(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const t=this.type,e=this.cellView,n=e.getTerminalView(t);return n?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const t=this.childNodes;if(!t)return;const e=t.anchor;if(!e)return;const n=this.type,i=this.cellView,s=this.options,o=i.getTerminalAnchor(n),r=i.cell.prop([n,"anchor"]);e.setAttribute("transform",`translate(${o.x}, ${o.y})`);const a=r?s.customAnchorAttrs:s.defaultAnchorAttrs;a&&Object.keys(a).forEach((t=>{e.setAttribute(t,a[t])}))}updateArea(){const t=this.childNodes;if(!t)return;const e=t.area;if(!e)return;const n=this.type,i=this.cellView,s=i.getTerminalView(n);if(s){const t=s.cell,o=i.getTerminalMagnet(n);let r,a,l,c=this.options.areaPadding||0;Number.isFinite(c)||(c=0),s.isEdgeElement(o)?(r=s.getBBox(),a=0,l=r.getCenter()):(r=s.getUnrotatedBBoxOfElement(o),a=t.getAngle(),l=r.getCenter(),a&&l.rotate(-a,t.getBBox().getCenter())),r.inflate(c),Bl(e,{x:-r.width/2,y:-r.height/2,width:r.width,height:r.height,transform:`translate(${l.x}, ${l.y}) rotate(${a})`})}}toggleArea(t){if(this.childNodes){const e=this.childNodes.area;e&&(e.style.display=t?"":"none")}}onMouseDown(t){this.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(t){const e=this.type,n=this.cell;t?n.prop([e,"anchor"],t,{rewrite:!0,ui:!0,toolId:this.cid}):n.removeProp([e,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(t){const e=this.type,n=this.cellView,i=n.getTerminalView(e);if(null==i)return;const s=this.normalizeEvent(t),o=i.cell,r=n.getTerminalMagnet(e);let a=this.graph.clientToLocal(s.clientX,s.clientY);const l=this.options.snap;if("function"===typeof l){const t=Ya(l,n,a,i,r,e,n,this);a=ac.create(t)}if(this.options.restrictArea)if(i.isEdgeElement(r)){const t=i.getClosestPoint(a);t&&(a=t)}else{const t=i.getUnrotatedBBoxOfElement(r),e=o.getAngle(),n=o.getBBox().getCenter(),s=a.clone().rotate(e,n);t.containsPoint(s)||(a=t.getNearestPointToPoint(s).rotate(-e,n))}let c;const h=this.options.anchor;"function"===typeof h&&(c=Ya(h,n,a,i,r,e,n,this)),this.resetAnchor(c),this.update()}onMouseUp(t){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const e=this.cellView;this.options.removeRedundancies&&e.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const t=this.options.resetAnchor;t&&this.resetAnchor(!0===t?void 0:t),this.update()}}(function(t){t.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:gp,snap(t,e,n,i,s,o){const r=o.options.snapRadius||0,a="source"===i,l=a?0:-1,c=this.cell.getVertexAt(l)||this.getTerminalAnchor(a?"target":"source");return c&&(Math.abs(c.x-t.x)<r&&(t.x=c.x),Math.abs(c.y-t.y)<r&&(t.y=c.y)),t}})})(Cp||(Cp={}));const vp=Cp.define({name:"source-anchor",type:"source"}),xp=Cp.define({name:"target-anchor",type:"target"});var kp=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Ep extends dp.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const t=this.options.attrs,{class:e}=t,n=kp(t,["class"]);this.setAttrs(n,this.container),e&&rl(this.container,e)}}onRender(){rl(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const t=this.ratio,e=this.cellView,n=e.getTangentAtRatio(t),i=n?n.start:e.getPointAtRatio(t),s=n&&n.vector().vectorAngle(new ac(1,0))||0;if(!i)return this;const o=lh().translate(i.x,i.y).rotate(s);return jh(this.container,o,{absolute:!0}),this}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.cellView;if(e.can("arrowheadMovable")){e.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const n=this.graph.snapToGrid(t.clientX,t.clientY),i=e.prepareArrowheadDragging(this.type,{x:n.x,y:n.y,options:{toolId:this.cid}});this.cellView.setEventData(t,i),this.delegateDocumentEvents(this.options.documentEvents,t.data),e.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(t){const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY);this.cellView.onMouseMove(e,n.x,n.y),this.update()}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.cellView,i=this.graph.snapToGrid(e.clientX,e.clientY);n.onMouseUp(e,i.x,i.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",n.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}(function(t){t.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})})(Ep||(Ep={}));const Mp=Ep.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),Sp=Ep.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class Ap extends dp.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5}render(){return this.createElement(),this.update(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents),this}createElement(){const{cell:t}=this,e=[this.prefixClassName((t.isEdge()?"edge":"node")+"-tool-editor"),this.prefixClassName("cell-tool-editor")];this.editor=dp.createElement("div",!1),this.addClass(e,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}update(){const{graph:t,cell:e,editor:n}=this,i=n.style;let s=new ac,o=20;if(e.isNode())s=e.getBBox().center,o=e.size().width-4;else if(e.isEdge()){const e=this.options.event,n=e.target,i=n.parentElement,r=i&&ol(i,this.prefixClassName("edge-label"));if(r){const t=i.getAttribute("data-index")||"0";this.labelIndex=parseInt(t,10);const e=i.getAttribute("transform"),{translation:r}=dh(e);s=new ac(r.tx,r.ty),o=kh(n).width}else{if(!this.options.labelAddable)return this;s=t.clientToLocal(ac.create(e.clientX,e.clientY));const n=this.cellView,i=n.path.closestPointLength(s);this.distance=i}}s=t.localToGraph(s),i.left=`${s.x}px`,i.top=`${s.y}px`,i.minWidth=`${o}px`;const r=t.scale();i.transform=`scale(${r.sx}, ${r.sy}) translate(-50%, -50%)`;const a=this.options.attrs;i.fontSize=`${a.fontSize}px`,i.fontFamily=a.fontFamily,i.color=a.color,i.backgroundColor=a.backgroundColor;const l=this.options.getText;let c;return"function"===typeof l&&(c=Ya(l,this.cellView,{cell:this.cell,index:this.labelIndex})),n.innerText=c||"",this}onDocumentMouseDown(t){if(t.target!==this.editor){const t=this.cell,e=this.editor.innerText.replace(/\n$/,"")||"",n=this.options.setText;"function"===typeof n&&Ya(n,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance}),t.removeTool(t.isEdge()?"edge-editor":"node-editor"),this.undelegateDocumentEvents()}}onDblClick(t){t.stopPropagation()}onMouseDown(t){t.stopPropagation()}autoFocus(){setTimeout((()=>{this.editor.focus(),this.selectText()}))}selectText(){if(window.getSelection){const t=document.createRange(),e=window.getSelection();t.selectNodeContents(this.editor),e.removeAllRanges(),e.addRange(t)}}}(function(t){t.config({tagName:"div",isSVGElement:!1,events:{dblclick:"onDblClick",mousedown:"onMouseDown"},documentEvents:{mousedown:"onDocumentMouseDown"}})})(Ap||(Ap={})),function(t){t.NodeEditor=t.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText({cell:t}){return t.attr("text/text")},setText({cell:t,value:e}){t.attr("text/text",e)}}),t.EdgeEditor=t.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText({cell:t,index:e}){return-1===e?"":t.prop(`labels/${e}/attrs/label/text`)},setText({cell:t,value:e,index:n,distance:i}){const s=t;-1===n?s.appendLabel({position:{distance:i},attrs:{label:{text:e}}}):e?s.prop(`labels/${n}/attrs/label/text`,e):"number"===typeof n&&s.removeLabelAt(n)}})}(Ap||(Ap={}));var Dp,Pp,Op=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};(function(t){t.presets={boundary:yp,button:fp,"button-remove":fp.Remove,"node-editor":Ap.NodeEditor},t.registry=Uh.create({type:"node tool",process(t,e){if("function"===typeof e)return e;let n=dp.ToolItem;const{inherit:i}=e,s=Op(e,["inherit"]);if(i){const t=this.get(i);null==t?this.onNotFound(i,"inherited"):n=t}return null==s.name&&(s.name=t),n.define.call(n,s)}}),t.registry.register(t.presets,!0)})(Dp||(Dp={})),function(t){t.presets={boundary:yp,vertices:bp,segments:wp,button:fp,"button-remove":fp.Remove,"source-anchor":vp,"target-anchor":xp,"source-arrowhead":Mp,"target-arrowhead":Sp,"edge-editor":Ap.EdgeEditor},t.registry=Uh.create({type:"edge tool",process(t,e){if("function"===typeof e)return e;let n=dp.ToolItem;const{inherit:i}=e,s=Op(e,["inherit"]);if(i){const t=this.get(i);null==t?this.onNotFound(i,"inherited"):n=t}return null==s.name&&(s.name=t),n.define.call(n,s)}}),t.registry.register(t.presets,!0)}(Pp||(Pp={}));const Tp=$p("center"),Np=$p("topCenter"),jp=$p("bottomCenter"),Fp=$p("leftMiddle"),Lp=$p("rightMiddle"),zp=$p("topLeft"),Ip=$p("topRight"),Bp=$p("bottomLeft"),Rp=$p("bottomRight");function $p(t){return function(e,n,i,s={}){const o=s.rotate?e.getUnrotatedBBoxOfElement(n):e.getBBoxOfElement(n),r=o[t];r.x+=$a(s.dx,o.width),r.y+=$a(s.dy,o.height);const a=e.cell;return s.rotate?r.rotate(-a.getAngle(),a.getBBox().getCenter()):r}}function Vp(t){return function(e,n,i,s){if(i instanceof Element){const o=this.graph.renderer.findViewByElem(i);let r;if(o)if(o.isEdgeElement(i)){const t=null!=s.fixedAt?s.fixedAt:"50%";r=_p(o,t)}else r=o.getBBoxOfElement(i).getCenter();else r=new ac;return t.call(this,e,n,r,s)}return t.apply(this,arguments)}}function _p(t,e){const n=Ra(e),i="string"===typeof e?parseFloat(e):e;return n?t.getPointAtRatio(i/100):t.getPointAtLength(i)}const Gp=function(t,e,n,i){const s=t.cell.getAngle(),o=t.getBBoxOfElement(e),r=o.getCenter(),a=o.getTopLeft(),l=o.getBottomRight();let c=i.padding;if(Number.isFinite(c)||(c=0),a.y+c<=n.y&&n.y<=l.y-c){const t=n.y-r.y;r.x+=0===s||180===s?0:1*t/Math.tan(Ql.toRad(s)),r.y+=t}else if(a.x+c<=n.x&&n.x<=l.x-c){const t=n.x-r.x;r.y+=90===s||270===s?0:t*Math.tan(Ql.toRad(s)),r.x+=t}return r},Hp=Vp(Gp),Up=function(t,e,n,i,s){const o=t.cell.getConnectionPoint(this.cell,s);return(i.dx||i.dy)&&o.translate(i.dx||0,i.dy||0),o},Wp=function(t,e,n,i){let s,o,r=0;const a=t.cell;i.rotate?(s=t.getUnrotatedBBoxOfElement(e),o=a.getBBox().getCenter(),r=a.getAngle()):s=t.getBBoxOfElement(e);const l=i.padding;null!=l&&Number.isFinite(l)&&s.inflate(l),i.rotate&&n.rotate(r,o);const c=s.getNearestSideToPoint(n);let h;switch(c){case"left":h=s.getLeftMiddle();break;case"right":h=s.getRightMiddle();break;case"top":h=s.getTopCenter();break;case"bottom":h=s.getBottomCenter();break;default:break}const u=i.direction;return"H"===u?"top"!==c&&"bottom"!==c||(h=n.x<=s.x+s.width?s.getLeftMiddle():s.getRightMiddle()):"V"===u&&(h=n.y<=s.y+s.height?s.getTopCenter():s.getBottomCenter()),i.rotate?h.rotate(-r,o):h},qp=Vp(Wp);var Zp;(function(t){t.presets=d,t.registry=Uh.create({type:"node endpoint"}),t.registry.register(t.presets,!0)})(Zp||(Zp={}));const Xp=function(t,e,n,i){let s=null!=i.ratio?i.ratio:.5;return s>1&&(s/=100),t.getPointAtRatio(s)},Yp=function(t,e,n,i){const s=null!=i.length?i.length:20;return t.getPointAtLength(s)},Jp=function(t,e,n,i){const s=t.getClosestPoint(n);return null!=s?s:new ac},Kp=Vp(Jp),Qp=function(t,e,n,i){const s=1e6,o=t.getConnection(),r=t.getConnectionSubdivisions(),a=new cc(n.clone().translate(0,s),n.clone().translate(0,-s)),l=new cc(n.clone().translate(s,0),n.clone().translate(-s,0)),c=a.intersect(o,{segmentSubdivisions:r}),h=l.intersect(o,{segmentSubdivisions:r}),u=[];return c&&u.push(...c),h&&u.push(...h),u.length>0?n.closest(u):null!=i.fallbackAt?_p(t,i.fallbackAt):Ya(Jp,this,t,e,n,i)},tf=Vp(Qp);var ef;function nf(t,e,n){let i;if("object"===typeof n){if(Number.isFinite(n.y)){const i=new cc(e,t),{start:s,end:o}=i.parallel(n.y);e=s,t=o}i=n.x}else i=n;if(null==i||!Number.isFinite(i))return t;const s=t.distance(e);return 0===i&&s>0?t:t.move(e,-Math.min(i,s-1))}function sf(t){const e=t.getAttribute("stroke-width");return null===e?0:parseFloat(e)||0}function of(t){if(null==t)return null;let e=t;do{let t=e.tagName;if("string"!==typeof t)return null;if(t=t.toUpperCase(),"G"===t)e=e.firstElementChild;else{if("TITLE"!==t)break;e=e.nextElementSibling}}while(e);return e}(function(t){t.presets=g,t.registry=Uh.create({type:"edge endpoint"}),t.registry.register(t.presets,!0)})(ef||(ef={}));const rf=function(t,e,n,i){const s=e.getBBoxOfElement(n);i.stroked&&s.inflate(sf(n)/2);const o=t.intersect(s),r=o&&o.length?t.start.closest(o):t.end;return nf(r,t.start,i.offset)},af=function(t,e,n,i,s){const o=e.cell,r=o.isNode()?o.getAngle():0;if(0===r)return Ya(rf,this,t,e,n,i,s);const a=e.getUnrotatedBBoxOfElement(n);i.stroked&&a.inflate(sf(n)/2);const l=a.getCenter(),c=t.clone().rotate(r,l),h=c.setLength(1e6).intersect(a),u=h&&h.length?c.start.closest(h).rotate(-r,l):t.end;return nf(u,t.start,i.offset)},lf=function(t,e,n,i){let s,o;const r=t.end,a=i.selector;if(s="string"===typeof a?e.findOne(a):Array.isArray(a)?ji(n,a):of(n),!dl(s)){if(s===n||!dl(n))return r;s=n}const l=e.getShapeOfElement(s),c=e.getMatrixOfElement(s),h=e.getRootTranslatedMatrix(),u=e.getRootRotatedMatrix(),d=h.multiply(u).multiply(c),g=d.inverse(),p=wh(t,g),f=p.start.clone(),m=e.getDataOfElement(s);if(!1===i.insideout){null==m.shapeBBox&&(m.shapeBBox=l.bbox());const t=m.shapeBBox;if(null!=t&&t.containsPoint(f))return r}let y;if(!0===i.extrapolate&&p.setLength(1e6),Nc.isPath(l)){const t=i.precision||2;null==m.segmentSubdivisions&&(m.segmentSubdivisions=l.getSegmentSubdivisions({precision:t})),y={precision:t,segmentSubdivisions:m.segmentSubdivisions},o=p.intersect(l,y)}else o=p.intersect(l);o?Array.isArray(o)&&(o=f.closest(o)):!0===i.sticky&&(o=lc.isRectangle(l)?l.getNearestPointToPoint(f):hc.isEllipse(l)?l.intersectsWithLineFromCenterToPoint(f):l.closestPoint(f,y));const b=o?bh(o,d):r;let w=i.offset||0;return!1!==i.stroked&&("object"===typeof w?(w=Object.assign({},w),null==w.x&&(w.x=0),w.x+=sf(s)/2):w+=sf(s)/2),nf(b,t.start,w)};function cf(t,e,n=0){const{start:i,end:s}=t;let o,r,a,l;switch(e){case"left":l="x",o=s,r=i,a=-1;break;case"right":l="x",o=i,r=s,a=1;break;case"top":l="y",o=s,r=i,a=-1;break;case"bottom":l="y",o=i,r=s,a=1;break;default:return}i[l]<s[l]?o[l]=r[l]:r[l]=o[l],Number.isFinite(n)&&(o[l]+=a*n,r[l]+=a*n)}const hf=function(t,e,n,i){const{alignOffset:s,align:o}=i;return o&&cf(t,o,s),nf(t.end,t.start,i.offset)};var uf;(function(t){t.presets=p,t.registry=Uh.create({type:"connection point"}),t.registry.register(t.presets,!0)})(uf||(uf={}));const df=function(t){return[...t]},gf=function(t,e,n){const i=e.side||"bottom",s=_a(e.padding||40),o=n.sourceBBox,r=n.targetBBox,a=o.getCenter(),l=r.getCenter();let c,h,u;switch(i){case"top":u=-1,c="y",h="height";break;case"left":u=-1,c="x",h="width";break;case"right":u=1,c="x",h="width";break;case"bottom":default:u=1,c="y",h="height";break}return a[c]+=u*(o[h]/2+s[i]),l[c]+=u*(r[h]/2+s[i]),u*(a[c]-l[c])>0?l[c]=a[c]:a[c]=l[c],[a.toJSON(),...t,l.toJSON()]};function pf(t){return new lc(t.x,t.y,0,0)}function ff(t={}){const e=_a(t.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function mf(t,e={}){return t.sourceBBox.clone().moveAndExpand(ff(e))}function yf(t,e={}){return t.targetBBox.clone().moveAndExpand(ff(e))}function bf(t,e={}){if(t.sourceAnchor)return t.sourceAnchor;const n=mf(t,e);return n.getCenter()}function wf(t,e={}){if(t.targetAnchor)return t.targetAnchor;const n=yf(t,e);return n.getCenter()}const Cf=function(t,e,n){let i=mf(n,e),s=yf(n,e);const o=bf(n,e),r=wf(n,e);i=i.union(pf(o)),s=s.union(pf(r));const a=t.map((t=>ac.create(t)));a.unshift(o),a.push(r);let l=null;const c=[];for(let h=0,u=a.length-1;h<u;h+=1){let t=null;const n=a[h],o=a[h+1],r=null!=vf.getBearing(n,o);if(0===h)h+1===u?i.intersectsWithRect(s.clone().inflate(1))?t=vf.insideNode(n,o,i,s):r||(t=vf.nodeToNode(n,o,i,s)):i.containsPoint(o)?t=vf.insideNode(n,o,i,pf(o).moveAndExpand(ff(e))):r||(t=vf.nodeToVertex(n,o,i));else if(h+1===u){const i=r&&vf.getBearing(o,n)===l;s.containsPoint(n)||i?t=vf.insideNode(n,o,pf(n).moveAndExpand(ff(e)),s,l):r||(t=vf.vertexToNode(n,o,s,l))}else r||(t=vf.vertexToVertex(n,o,l));t?(c.push(...t.points),l=t.direction):l=vf.getBearing(n,o),h+1<u&&c.push(o)}return c};var vf;(function(t){const e={N:"S",S:"N",E:"W",W:"E"},n={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function i(t,e,n){let i=new ac(t.x,e.y);return n.containsPoint(i)&&(i=new ac(e.x,t.y)),i}function s(t,e){return t["W"===e||"E"===e?"width":"height"]}function o(t,e){return t.x===e.x?t.y>e.y?"N":"S":t.y===e.y?t.x>e.x?"W":"E":null}function r(t,n,i){const s=new ac(t.x,n.y),r=new ac(n.x,t.y),a=o(t,s),l=o(t,r),c=i?e[i]:null,h=a===i||a!==c&&(l===c||l!==i)?s:r;return{points:[h],direction:o(h,n)}}function a(t,e,n){const s=i(t,e,n);return{points:[s],direction:o(s,e)}}function l(t,e,n,r){const a=[new ac(t.x,e.y),new ac(e.x,t.y)],l=a.filter((t=>!n.containsPoint(t))),c=l.filter((e=>o(e,t)!==r));let h;if(c.length>0)return h=c.filter((e=>o(t,e)===r)).pop(),h=h||c[0],{points:[h],direction:o(h,e)};{h=cn(a,l)[0];const c=ac.create(e).move(h,-s(n,r)/2),u=i(c,t,n);return{points:[u,c],direction:o(c,e)}}}function c(t,e,n,i){let l=a(e,t,i);const c=l.points[0];if(n.containsPoint(c)){l=a(t,e,n);const h=l.points[0];if(i.containsPoint(h)){const u=ac.create(t).move(h,-s(n,o(t,h))/2),d=ac.create(e).move(c,-s(i,o(e,c))/2),g=new cc(u,d).getCenter(),p=a(t,g,n),f=r(g,e,p.direction);l.points=[p.points[0],f.points[0]],l.direction=f.direction}}return l}function h(t,e,s,r,a){const l=s.union(r).inflate(1),c=l.getCenter(),h=c.distance(e)>c.distance(t),u=h?e:t,d=h?t:e;let g,p,f,m;a?(g=ac.fromPolar(l.width+l.height,n[a],u),g=l.getNearestPointToPoint(g).move(g,-1)):g=l.getNearestPointToPoint(u).move(u,1),p=i(g,d,l),g.round().equals(p.round())?(p=ac.fromPolar(l.width+l.height,Ql.toRad(g.theta(u))+Math.PI/2,d),p=l.getNearestPointToPoint(p).move(d,1).round(),f=i(g,p,l),m=h?[p,f,g]:[g,f,p]):m=h?[p,g]:[g,p];const y=o(h?g:p,e);return{points:m,direction:y}}t.getBBoxSize=s,t.getBearing=o,t.vertexToVertex=r,t.nodeToVertex=a,t.vertexToNode=l,t.nodeToNode=c,t.insideNode=h})(vf||(vf={}));const xf={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeShapes:[],excludeHiddenNodes:!1,startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){const t=kf(this.step,this);return t},directions(){const t=kf(this.step,this),e=kf(this.cost,this);return[{cost:e,offsetX:t,offsetY:0},{cost:e,offsetX:-t,offsetY:0},{cost:e,offsetX:0,offsetY:t},{cost:e,offsetX:0,offsetY:-t}]},penalties(){const t=kf(this.step,this);return{0:0,45:t/2,90:t/2}},paddingBox(){const t=kf(this.step,this);return{x:-t,y:-t,width:2*t,height:2*t}},fallbackRouter:Cf,draggingRouter:null};function kf(t,e){return"function"===typeof t?t.call(e):t}function Ef(t){const e=Object.keys(t).reduce(((e,n)=>{const i=e;return i[n]="fallbackRouter"===n||"draggingRouter"===n||"fallbackRoute"===n?t[n]:kf(t[n],t),e}),{});if(e.padding){const n=_a(e.padding);t.paddingBox={x:-n.left,y:-n.top,width:n.left+n.right,height:n.top+n.bottom}}return e.directions.forEach((t=>{const e=new ac(0,0),n=new ac(t.offsetX,t.offsetY);t.angle=Ql.normalize(e.theta(n))})),e}const Mf=1,Sf=2;class Af{constructor(){this.items=[],this.hash={},this.values={}}add(t,e){this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=Mf,this.values[t]=e;const n=ue(this.items,t,(t=>this.values[t]));this.items.splice(n,0,t)}pop(){const t=this.items.shift();return t&&(this.hash[t]=Sf),t}isOpen(t){return this.hash[t]===Mf}isClose(t){return this.hash[t]===Sf}isEmpty(){return 0===this.items.length}}class Df{constructor(t){this.options=t,this.mapGridSize=100,this.map={}}build(t,e){const n=this.options,i=n.excludeTerminals.reduce(((n,i)=>{const s=e[i];if(s){const e=t.getCell(s.cell);e&&n.push(e)}return n}),[]);let s=[];const o=t.getCell(e.getSourceCellId());o&&(s=mt.Z(s,o.getAncestors().map((t=>t.id))));const r=t.getCell(e.getTargetCellId());r&&(s=mt.Z(s,r.getAncestors().map((t=>t.id))));const a=this.mapGridSize;return t.getNodes().reduce(((t,e)=>{const o=e.shape,r=n.excludeShapes,l=!!o&&r.includes(o),c=i.some((t=>t.id===e.id)),h=s.includes(e.id),u=n.excludeHiddenNodes&&!e.isVisible(),d=l||c||h||u;if(!d){const i=e.getBBox().moveAndExpand(n.paddingBox),s=i.getOrigin().snapToGrid(a),o=i.getCorner().snapToGrid(a);for(let e=s.x;e<=o.x;e+=a)for(let n=s.y;n<=o.y;n+=a){const s=new ac(e,n).toString();null==t[s]&&(t[s]=[]),t[s].push(i)}}return t}),this.map),this}isAccessible(t){const e=t.clone().snapToGrid(this.mapGridSize).toString(),n=this.map[e];return!n||n.every((e=>!e.containsPoint(t)))}}function Pf(t,e){const n=t.sourceBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function Of(t,e){const n=t.targetBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function Tf(t,e){if(t.sourceAnchor)return t.sourceAnchor;const n=Pf(t,e);return n.getCenter()}function Nf(t,e){if(t.targetAnchor)return t.targetAnchor;const n=Of(t,e);return n.getCenter()}function jf(t,e,n,i,s){const o=360/n,r=t.theta(Ff(t,e,i,s)),a=Ql.normalize(r+o/2);return o*Math.floor(a/o)}function Ff(t,e,n,i){const s=i.step,o=e.x-t.x,r=e.y-t.y,a=o/n.x,l=r/n.y,c=a*s,h=l*s;return new ac(t.x+c,t.y+h)}function Lf(t,e){const n=Math.abs(t-e);return n>180?360-n:n}function zf(t,e){const n=e.step;return e.directions.forEach((e=>{e.gridOffsetX=e.offsetX/n*t.x,e.gridOffsetY=e.offsetY/n*t.y})),e.directions}function If(t,e,n){return{source:e.clone(),x:Bf(n.x-e.x,t),y:Bf(n.y-e.y,t)}}function Bf(t,e){if(!t)return e;const n=Math.abs(t),i=Math.round(n/e);if(!i)return n;const s=i*e,o=n-s,r=o/i;return e+r}function Rf(t,e){const n=e.source,i=Xd.snapToGrid(t.x-n.x,e.x)+n.x,s=Xd.snapToGrid(t.y-n.y,e.y)+n.y;return new ac(i,s)}function $f(t,e){return t.round(e)}function Vf(t,e,n){return $f(Rf(t.clone(),e),n)}function _f(t){return t.toString()}function Gf(t){return new ac(0===t.x?0:Math.abs(t.x)/t.x,0===t.y?0:Math.abs(t.y)/t.y)}function Hf(t,e){let n=1/0;for(let i=0,s=e.length;i<s;i+=1){const s=t.manhattanDistance(e[i]);s<n&&(n=s)}return n}function Uf(t,e,n,i,s){const o=s.precision,r=s.directionMap,a=t.diff(e.getCenter()),l=Object.keys(r).reduce(((s,l)=>{if(n.includes(l)){const n=r[l],c=new ac(t.x+n.x*(Math.abs(a.x)+e.width),t.y+n.y*(Math.abs(a.y)+e.height)),h=new cc(t,c),u=h.intersect(e)||[];let d,g=null;for(let e=0;e<u.length;e+=1){const n=u[e],i=t.squaredDistance(n);(null==d||i>d)&&(d=i,g=n)}if(g){let t=Vf(g,i,o);e.containsPoint(t)&&(t=Vf(t.translate(n.x*i.x,n.y*i.y),i,o)),s.push(t)}}return s}),[]);return e.containsPoint(t)||l.push(Vf(t,i,o)),l}function Wf(t,e,n,i,s){const o=[];let r,a=Gf(s.diff(n)),l=_f(n),c=t[l];while(c){r=e[l];const n=Gf(r.diff(c));n.equals(a)||(o.unshift(r),a=n),l=_f(c),c=t[l]}const h=e[l],u=Gf(h.diff(i));return u.equals(a)||o.unshift(h),o}function qf(t,e,n,i,s){const o=s.precision;let r,a;r=lc.isRectangle(e)?$f(Tf(t,s).clone(),o):$f(e.clone(),o),a=lc.isRectangle(n)?$f(Nf(t,s).clone(),o):$f(n.clone(),o);const l=If(s.step,r,a),c=r,h=a;let u,d;if(u=lc.isRectangle(e)?Uf(c,e,s.startDirections,l,s):[c],d=lc.isRectangle(n)?Uf(a,n,s.endDirections,l,s):[h],u=u.filter((t=>i.isAccessible(t))),d=d.filter((t=>i.isAccessible(t))),u.length>0&&d.length>0){const t=new Af,e={},n={},r={};for(let i=0,s=u.length;i<s;i+=1){const n=u[i],s=_f(n);t.add(s,Hf(n,d)),e[s]=n,r[s]=0}const a=s.previousDirectionAngle,g=void 0===a;let p,f;const m=zf(l,s),y=m.length,b=d.reduce(((t,e)=>{const n=_f(e);return t.push(n),t}),[]),w=ac.equalPoints(u,d);let C=s.maxLoopCount;while(!t.isEmpty()&&C>0){const u=t.pop(),v=e[u],x=n[u],k=r[u],E=v.equals(c),M=null==x;let S;S=M?g?E?null:jf(c,v,y,l,s):a:jf(x,v,y,l,s);const A=M&&w;if(!A&&b.indexOf(u)>=0)return s.previousDirectionAngle=S,Wf(n,e,v,c,h);for(let a=0;a<y;a+=1){p=m[a];const c=p.angle;if(f=Lf(S,c),(!g||!E)&&f>s.maxDirectionChange)continue;const u=Vf(v.clone().translate(p.gridOffsetX||0,p.gridOffsetY||0),l,o),w=_f(u);if(t.isClose(w)||!i.isAccessible(u))continue;if(b.indexOf(w)>=0){const t=u.equals(h);if(!t){const t=jf(u,h,y,l,s),e=Lf(c,t);if(e>s.maxDirectionChange)continue}}const C=p.cost,x=E?0:s.penalties[f],M=k+C+x;(!t.isOpen(w)||M<r[w])&&(e[w]=u,n[w]=v,r[w]=M,t.add(w,M+Hf(u,d)))}C-=1}}return s.fallbackRoute?Ya(s.fallbackRoute,this,c,h,s):null}const Zf=function(t,e,n){const i=Ef(e),s=Pf(n,i),o=Of(n,i),r=Tf(n,i),a=new Df(i).build(n.graph.model,n.cell),l=t.map((t=>ac.create(t))),c=[];let h,u,d=r;for(let g=0,p=l.length;g<=p;g+=1){let e=null;if(h=u||s,u=l[g],null==u){u=o;const t=n.cell,a=null==t.getSourceCellId()||null==t.getTargetCellId();if(a&&"function"===typeof i.draggingRouter){const t=h===s?r:h,o=u.getOrigin();e=Ya(i.draggingRouter,n,t,o,i)}}if(null==e&&(e=qf(n,h,u,a,i)),null===e)return Ya(i.fallbackRouter,this,t,i,n);const p=e[0];p&&p.equals(d)&&e.shift(),d=e[e.length-1]||d,c.push(...e)}return c},Xf=function(t,e,n){return Ya(Zf,this,t,Object.assign(Object.assign({},xf),e),n)},Yf={maxDirectionChange:45,directions(){const t=kf(this.step,this),e=kf(this.cost,this),n=Math.ceil(Math.sqrt(t*t<<1));return[{cost:e,offsetX:t,offsetY:0},{cost:n,offsetX:t,offsetY:t},{cost:e,offsetX:0,offsetY:t},{cost:n,offsetX:-t,offsetY:t},{cost:e,offsetX:-t,offsetY:0},{cost:n,offsetX:-t,offsetY:-t},{cost:e,offsetX:0,offsetY:-t},{cost:n,offsetX:t,offsetY:-t}]},fallbackRoute(t,e,n){const i=t.theta(e),s=[];let o={x:e.x,y:t.y},r={x:t.x,y:e.y};if(i%180>90){const t=o;o=r,r=t}const a=i%90<45?o:r,l=new cc(t,a),c=90*Math.ceil(i/90),h=ac.fromPolar(l.squaredLength(),Ql.toRad(c+135),a),u=new cc(e,h),d=l.intersectsWithLine(u),g=d||e,p=d?g:t,f=360/n.directions.length,m=p.theta(e),y=Ql.normalize(m+f/2),b=f*Math.floor(y/f);return n.previousDirectionAngle=b,g&&s.push(g.round()),s.push(e),s}},Jf=function(t,e,n){return Ya(Xf,this,t,Object.assign(Object.assign({},Yf),e),n)},Kf=function(t,e,n){const i=e.offset||32,s=null==e.min?16:e.min;let o=0,r=e.direction;const a=n.sourceBBox,l=n.targetBBox,c=a.getCenter(),h=l.getCenter();if("number"===typeof i&&(o=i),null==r){let t=l.left-a.right,e=l.top-a.bottom;t>=0&&e>=0?r=t>=e?"L":"T":t<=0&&e>=0?(t=a.left-l.right,r=t>=0&&t>=e?"R":"T"):t>=0&&e<=0?(e=a.top-l.bottom,r=e>=0?t>=e?"L":"B":"L"):(t=a.left-l.right,e=a.top-l.bottom,r=t>=0&&e>=0?t>=e?"R":"B":t<=0&&e>=0?"B":t>=0&&e<=0||Math.abs(t)>Math.abs(e)?"R":"B")}let u,d,g;"H"===r?r=h.x-c.x>=0?"L":"R":"V"===r&&(r=h.y-c.y>=0?"T":"B"),"center"===i&&("L"===r?o=(l.left-a.right)/2:"R"===r?o=(a.left-l.right)/2:"T"===r?o=(l.top-a.bottom)/2:"B"===r&&(o=(a.top-l.bottom)/2));const p="L"===r||"R"===r;if(p){if(h.y===c.y)return[...t];g="L"===r?1:-1,u="x",d="width"}else{if(h.x===c.x)return[...t];g="T"===r?1:-1,u="y",d="height"}const f=c.clone(),m=h.clone();if(f[u]+=g*(a[d]/2+o),m[u]-=g*(l[d]/2+o),p){const t=f.x,e=m.x,n=a.width/2+s,i=l.width/2+s;h.x>c.x?e<=t&&(f.x=Math.max(e,c.x+n),m.x=Math.min(t,h.x-i)):e>=t&&(f.x=Math.min(e,c.x-n),m.x=Math.max(t,h.x+i))}else{const t=f.y,e=m.y,n=a.height/2+s,i=l.height/2+s;h.y>c.y?e<=t&&(f.y=Math.max(e,c.y+n),m.y=Math.min(t,h.y-i)):e>=t&&(f.y=Math.min(e,c.y-n),m.y=Math.max(t,h.y+i))}return[f.toJSON(),...t,m.toJSON()]};function Qf(t,e){if(null!=e&&!1!==e){const n="boolean"===typeof e?0:e;if(n>0){const e=ac.create(t[1]).move(t[2],n),i=ac.create(t[1]).move(t[0],n);return[e.toJSON(),...t,i.toJSON()]}{const e=t[1];return[Object.assign({},e),...t,Object.assign({},e)]}}return t}const tm=function(t,e,n){const i=e.width||50,s=e.height||80,o=s/2,r=e.angle||"auto",a=n.sourceAnchor,l=n.targetAnchor,c=n.sourceBBox,h=n.targetBBox;if(a.equals(l)){const t=t=>{const e=Ql.toRad(t),n=Math.sin(e),s=Math.cos(e),r=new ac(a.x+s*i,a.y+n*i),l=new ac(r.x-s*o,r.y-n*o),c=l.clone().rotate(-90,r),h=l.clone().rotate(90,r);return[c.toJSON(),r.toJSON(),h.toJSON()]},n=t=>{const e=a.clone().move(t,-1),n=new cc(e,t);return!c.containsPoint(t)&&!c.intersectsWithLine(n)},s=[0,90,180,270,45,135,225,315];if("number"===typeof r)return Qf(t(r),e.merge);const l=c.getCenter();if(l.equals(a))return Qf(t(0),e.merge);const h=l.angleBetween(a,l.clone().translate(1,0));let u=t(h);if(n(u[1]))return Qf(u,e.merge);for(let i=1,o=s.length;i<o;i+=1)if(u=t(h+s[i]),n(u[1]))return Qf(u,e.merge);return Qf(u,e.merge)}{const t=new cc(a,l);let s=t.parallel(-i),r=s.getCenter(),u=s.start.clone().move(s.end,o),d=s.end.clone().move(s.start,o);const g=t.parallel(-1),p=new cc(g.start,r),f=new cc(g.end,r);if((c.containsPoint(r)||h.containsPoint(r)||c.intersectsWithLine(p)||c.intersectsWithLine(f)||h.intersectsWithLine(p)||h.intersectsWithLine(f))&&(s=t.parallel(i),r=s.getCenter(),u=s.start.clone().move(s.end,o),d=s.end.clone().move(s.start,o)),e.merge){const t=new cc(a,l),e=new cc(r,t.center).setLength(Number.MAX_SAFE_INTEGER),i=c.intersectsWithLine(e),s=h.intersectsWithLine(e),o=i?Array.isArray(i)?i:[i]:[];s&&(Array.isArray(s)?o.push(...s):o.push(s));const u=t.center.closest(o);u?(n.sourceAnchor=u.clone(),n.targetAnchor=u.clone()):(n.sourceAnchor=t.center.clone(),n.targetAnchor=t.center.clone())}return Qf([u.toJSON(),r.toJSON(),d.toJSON()],e.merge)}};var em;(function(t){t.presets=f,t.registry=Uh.create({type:"router"}),t.registry.register(t.presets,!0)})(em||(em={}));const nm=function(t,e,n,i={}){const s=[t,...n,e],o=new uc(s),r=new Nc(o);return i.raw?r:r.serialize()},im=function(t,e,n,i={}){const s=3===n.length?0:1,o=ac.create(n[0+s]),r=ac.create(n[2+s]),a=ac.create(n[1+s]);if(!ac.equals(t,e)){const n=new ac((t.x+e.x)/2,(t.y+e.y)/2),i=n.angleBetween(ac.create(t).rotate(90,n),a);i>1&&(o.rotate(180-i,n),r.rotate(180-i,n),a.rotate(180-i,n))}const l=`\n M ${t.x} ${t.y}\n Q ${o.x} ${o.y} ${a.x} ${a.y}\n Q ${r.x} ${r.y} ${e.x} ${e.y}\n `;return i.raw?Nc.parse(l):l},sm=function(t,e,n,i={}){const s=new Nc;s.appendSegment(Nc.createSegment("M",t));const o=1/3,r=2/3,a=i.radius||10;let l,c;for(let h=0,u=n.length;h<u;h+=1){const i=ac.create(n[h]),u=n[h-1]||t,d=n[h+1]||e;l=c||i.distance(u)/2,c=i.distance(d)/2;const g=-Math.min(a,l),p=-Math.min(a,c),f=i.clone().move(u,g).round(),m=i.clone().move(d,p).round(),y=new ac(o*f.x+r*i.x,r*i.y+o*f.y),b=new ac(o*m.x+r*i.x,r*i.y+o*m.y);s.appendSegment(Nc.createSegment("L",f)),s.appendSegment(Nc.createSegment("C",y,b,m))}return s.appendSegment(Nc.createSegment("L",e)),i.raw?s:s.serialize()},om=function(t,e,n,i={}){let s,o=i.direction;if(n&&0!==n.length){const i=[t,...n,e],o=dc.throughPoints(i);s=new Nc(o)}else if(s=new Nc,s.appendSegment(Nc.createSegment("M",t)),o||(o=Math.abs(t.x-e.x)>=Math.abs(t.y-e.y)?"H":"V"),"H"===o){const n=(t.x+e.x)/2;s.appendSegment(Nc.createSegment("C",n,t.y,n,e.y,e.x,e.y))}else{const n=(t.y+e.y)/2;s.appendSegment(Nc.createSegment("C",t.x,n,e.x,n,e.x,e.y))}return i.raw?s:s.serialize()},rm=1,am=1/3,lm=2/3;function cm(t){let e=t.graph._jumpOverUpdateList;if(null==e&&(e=t.graph._jumpOverUpdateList=[],t.graph.on("cell:mouseup",(()=>{const e=t.graph._jumpOverUpdateList;for(let t=0;t<e.length;t+=1)e[t].update()})),t.graph.on("model:reseted",(()=>{e=t.graph._jumpOverUpdateList=[]}))),e.indexOf(t)<0){e.push(t);const n=()=>e.splice(e.indexOf(t),1);t.cell.once("change:connector",n),t.cell.once("removed",n)}}function hm(t,e,n=[]){const i=[t,...n,e],s=[];return i.forEach(((t,e)=>{const n=i[e+1];null!=n&&s.push(new cc(t,n))})),s}function um(t,e){const n=[];return e.forEach((e=>{const i=t.intersectsWithLine(e);i&&n.push(i)})),n}function dm(t,e){return new cc(t,e).squaredLength()}function gm(t,e,n){return e.reduce(((i,s,o)=>{if(ym.includes(s))return i;const r=i.pop()||t,a=ac.create(s).move(r.start,-n);let l=ac.create(s).move(r.start,+n);const c=e[o+1];if(null!=c){const t=l.distance(c);t<=n&&(l=c.move(r.start,t),ym.push(c))}else{const t=a.distance(r.end);if(t<2*n+rm)return i.push(r),i}const h=l.distance(r.start);if(h<2*n+rm)return i.push(r),i;const u=new cc(a,l);return mm.push(u),i.push(new cc(r.start,a),u,new cc(l,r.end)),i}),[])}function pm(t,e,n,i){const s=new Nc;let o;return o=Nc.createSegment("M",t[0].start),s.appendSegment(o),t.forEach(((r,a)=>{if(mm.includes(r)){let t,i,a,l;if("arc"===n){t=-90,i=r.start.diff(r.end);const e=i.x<0||0===i.x&&i.y<0;e&&(t+=180);const n=r.getCenter(),c=new cc(n,r.end).rotate(t,n);let h;h=new cc(r.start,n),a=h.pointAt(2/3).rotate(t,r.start),l=c.pointAt(1/3).rotate(-t,c.end),o=Nc.createSegment("C",a,l,c.end),s.appendSegment(o),h=new cc(n,r.end),a=c.pointAt(1/3).rotate(t,c.end),l=h.pointAt(1/3).rotate(-t,r.end),o=Nc.createSegment("C",a,l,r.end),s.appendSegment(o)}else if("gap"===n)o=Nc.createSegment("M",r.end),s.appendSegment(o);else if("cubic"===n){t=r.start.theta(r.end);const n=.6*e;let c=1.35*e;i=r.start.diff(r.end);const h=i.x<0||0===i.x&&i.y<0;h&&(c*=-1),a=new ac(r.start.x+n,r.start.y+c).rotate(t,r.start),l=new ac(r.end.x-n,r.end.y+c).rotate(t,r.end),o=Nc.createSegment("C",a,l,r.end),s.appendSegment(o)}}else{const e=t[a+1];0===i||!e||mm.includes(e)?(o=Nc.createSegment("L",r.end),s.appendSegment(o)):fm(i,s,r.end,r.start,e.end)}})),s}function fm(t,e,n,i,s){const o=n.distance(i)/2,r=n.distance(s)/2,a=-Math.min(t,o),l=-Math.min(t,r),c=n.clone().move(i,a).round(),h=n.clone().move(s,l).round(),u=new ac(am*c.x+lm*n.x,lm*n.y+am*c.y),d=new ac(am*h.x+lm*n.x,lm*n.y+am*h.y);let g;g=Nc.createSegment("L",c),e.appendSegment(g),g=Nc.createSegment("C",u,d,h),e.appendSegment(g)}let mm,ym;const bm=function(t,e,n,i={}){mm=[],ym=[],cm(this);const s=i.size||5,o=i.type||"arc",r=i.radius||0,a=i.ignoreConnectors||["smooth"],l=this.graph,c=l.model,h=c.getEdges();if(1===h.length)return pm(hm(t,e,n),s,o,r);const u=this.cell,d=h.indexOf(u),g=l.options.connecting.connector||{},p=h.filter(((t,e)=>{const n=t.getConnector()||g;return!a.includes(n.name)&&(!(e>d)||"jumpover"!==n.name)})),f=p.map((t=>l.renderer.findViewByCell(t))),m=hm(t,e,n),y=f.map((t=>null==t?[]:t===this?m:hm(t.sourcePoint,t.targetPoint,t.routePoints))),b=[];m.forEach((t=>{const e=p.reduce(((e,n,i)=>{if(n!==u){const n=um(t,y[i]);e.push(...n)}return e}),[]).sort(((e,n)=>dm(t.start,e)-dm(t.start,n)));e.length>0?b.push(...gm(t,e,s)):b.push(t)}));const w=pm(b,s,o,r);return mm=[],ym=[],i.raw?w:w.serialize()};var wm;(function(t){t.presets=m,t.registry=Uh.create({type:"connector"}),t.registry.register(t.presets,!0)})(wm||(wm={}));Uh.create;class Cm{constructor(t){this.cell=t,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(t,e,n={},i="/"){const s=this.cell.getPropByPath(t),o=bi(n,Cm.defaultOptions),r=this.getTiming(o.timing),a=this.getInterp(o.interp,s,e);let l=0;const c=Array.isArray(t)?t.join(i):t,h=Array.isArray(t)?t:t.split(i),u=()=>{const t=(new Date).getTime();0===l&&(l=t);const e=t-l;let i=e/o.duration;i<1?this.ids[c]=Yl(u):i=1;const s=a(r(i));this.cell.setPropByPath(h,s),n.progress&&n.progress(Object.assign({progress:i,currentValue:s},this.getArgs(c))),1===i&&(this.cell.notify("transition:end",this.getArgs(c)),this.cell.notify("transition:complete",this.getArgs(c)),n.complete&&n.complete(this.getArgs(c)),this.cell.notify("transition:finish",this.getArgs(c)),n.finish&&n.finish(this.getArgs(c)),this.clean(c))};return setTimeout((()=>{this.stop(t,void 0,i),this.cache[c]={startValue:s,targetValue:e,options:o},this.ids[c]=Yl(u),this.cell.notify("transition:begin",this.getArgs(c)),this.cell.notify("transition:start",this.getArgs(c)),n.start&&n.start(this.getArgs(c))}),n.delay),this.stop.bind(this,t,i,n)}stop(t,e={},n="/"){const i=Array.isArray(t)?t:t.split(n);return Object.keys(this.ids).filter((t=>Qn.Z(i,t.split(n).slice(0,i.length)))).forEach((t=>{Jl(this.ids[t]);const n=this.cache[t],i=this.getArgs(t),s=Object.assign(Object.assign({},n.options),e),o=s.jumpedToEnd;o&&null!=n.targetValue&&(this.cell.setPropByPath(t,n.targetValue),this.cell.notify("transition:end",Object.assign({},i)),this.cell.notify("transition:complete",Object.assign({},i)),s.complete&&s.complete(Object.assign({},i)));const r=Object.assign({jumpedToEnd:o},i);this.cell.notify("transition:stop",Object.assign({},r)),s.stop&&s.stop(Object.assign({},r)),this.cell.notify("transition:finish",Object.assign({},i)),s.finish&&s.finish(Object.assign({},i)),this.clean(t)})),this}clean(t){delete this.ids[t],delete this.cache[t]}getTiming(t){return"string"===typeof t?Hg[t]:t}getInterp(t,e,n){return t?t(e,n):"number"===typeof n?Ug.number(e,n):"string"===typeof n?"#"===n[0]?Ug.color(e,n):Ug.unit(e,n):Ug.object(e,n)}getArgs(t){const e=this.cache[t];return{path:t,startValue:e.startValue,targetValue:e.targetValue,cell:this.cell}}}(function(t){t.defaultOptions={delay:10,duration:100,timing:"linear"}})(Cm||(Cm={}));var vm=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class xm extends Vg{constructor(t={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(pi(t)),this.changed={}}mutate(t,e={}){const n=!0===e.unset,i=!0===e.silent,s=[],o=this.changing;this.changing=!0,o||(this.previous=pi(this.data),this.changed={});const r=this.data,a=this.previous,l=this.changed;if(Object.keys(t).forEach((e=>{const i=e,o=t[i];Qn.Z(r[i],o)||s.push(i),Qn.Z(a[i],o)?delete l[i]:l[i]=o,n?delete r[i]:r[i]=o})),!i&&s.length>0&&(this.pending=!0,this.pendingOptions=e,s.forEach((t=>{this.emit("change:*",{key:t,options:e,store:this,current:r[t],previous:a[t]})}))),o)return this;if(!i)while(this.pending)this.pending=!1,this.emit("changed",{current:r,previous:a,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(t,e){if(null==t)return this.data;const n=this.data[t];return null==n?e:n}getPrevious(t){if(this.previous){const e=this.previous[t];return null==e?void 0:e}}set(t,e,n){return null!=t&&("object"===typeof t?this.mutate(t,e):this.mutate({[t]:e},n)),this}remove(t,e){const n=void 0,i={};let s;if("string"===typeof t)i[t]=n,s=e;else if(Array.isArray(t))t.forEach((t=>i[t]=n)),s=e;else{for(const t in this.data)i[t]=n;s=t}return this.mutate(i,Object.assign(Object.assign({},s),{unset:!0})),this}getByPath(t){return ji(this.data,t,"/")}setByPath(t,e,n={}){const i="/",s=Array.isArray(t)?[...t]:t.split(i),o=Array.isArray(t)?t.join(i):t,r=s[0],a=s.length;if(n.propertyPath=o,n.propertyValue=e,n.propertyPathArray=s,1===a)this.set(r,e,n);else{const o={};let l=o,c=r;for(let t=1;t<a;t+=1){const e=s[t],n=Number.isFinite(Number(e));l=l[c]=n?[]:{},c=e}Fi(o,s,e,i);const h=pi(this.data);n.rewrite&&Li(h,t,i);const u=Kn(h,o);this.set(r,u[r],n)}return this}removeByPath(t,e){const n=Array.isArray(t)?t:t.split("/"),i=n[0];if(1===n.length)this.remove(i,e);else{const t=n.slice(1),s=pi(this.get(i));s&&Li(s,t),this.set(i,s,e)}return this}hasChanged(t){return null==t?Object.keys(this.changed).length>0:t in this.changed}getChanges(t){if(null==t)return this.hasChanged()?pi(this.changed):null;const e=this.changing?this.previous:this.data,n={};let i;for(const s in t){const o=t[s];Qn.Z(e[s],o)||(n[s]=o,i=!0)}return i?pi(n):null}toJSON(){return pi(this.data)}clone(){const t=this.constructor;return new t(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}vm([Vg.dispose()],xm.prototype,"dispose",null);var km,Em=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},Mm=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Sm extends Vg{constructor(t={}){super();const e=this.constructor,n=e.getDefaults(!0),i=Kn({},this.preprocess(n),this.preprocess(t));this.id=i.id||Da(),this.store=new xm(i),this.animation=new Cm(this),this.setup(),this.init(),this.postprocess(t)}static config(t){const{markup:e,propHooks:n,attrHooks:i}=t,s=Mm(t,["markup","propHooks","attrHooks"]);null!=e&&(this.markup=e),n&&(this.propHooks=this.propHooks.slice(),Array.isArray(n)?this.propHooks.push(...n):"function"===typeof n?this.propHooks.push(n):Object.keys(n).forEach((t=>{const e=n[t];"function"===typeof e&&this.propHooks.push(e)}))),i&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),i)),this.defaults=Kn({},this.defaults,s)}static getMarkup(){return this.markup}static getDefaults(t){return t?this.defaults:pi(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(t,e){return this.propHooks.reduce(((e,n)=>n?Ya(n,t,e):e),e)}get[Symbol.toStringTag](){return Sm.toStringTag}init(){}get model(){return this._model}set model(t){this._model!==t&&(this._model=t)}preprocess(t,e){const n=t.id,i=this.constructor,s=i.applyPropHooks(this,t);return null==n&&!0!==e&&(s.id=Da()),s}postprocess(t){}setup(){this.store.on("change:*",(t=>{const{key:e,current:n,previous:i,options:s}=t;this.notify("change:*",{key:e,options:s,current:n,previous:i,cell:this}),this.notify(`change:${e}`,{options:s,current:n,previous:i,cell:this});const o=e;"source"!==o&&"target"!==o||this.notify("change:terminal",{type:o,current:n,previous:i,options:s,cell:this})})),this.store.on("changed",(({options:t})=>this.notify("changed",{options:t,cell:this})))}notify(t,e){this.trigger(t,e);const n=this.model;return n&&(n.notify(`cell:${t}`,e),this.isNode()?n.notify(`node:${t}`,Object.assign(Object.assign({},e),{node:this})):this.isEdge()&&n.notify(`edge:${t}`,Object.assign(Object.assign({},e),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(t){return this.store===t.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(t,e){return null==t?this.store.get():this.store.get(t,e)}setProp(t,e,n){if("string"===typeof t)this.store.set(t,e,n);else{const n=this.preprocess(t,!0);this.store.set(Kn({},this.getProp(),n),e),this.postprocess(t)}return this}removeProp(t,e){return"string"===typeof t||Array.isArray(t)?this.store.removeByPath(t,e):this.store.remove(e),this}hasChanged(t){return null==t?this.store.hasChanged():this.store.hasChanged(t)}getPropByPath(t){return this.store.getByPath(t)}setPropByPath(t,e,n={}){return this.model&&("children"===t?this._children=e?e.map((t=>this.model.getCell(t))).filter((t=>null!=t)):null:"parent"===t&&(this._parent=e?this.model.getCell(e):null)),this.store.setByPath(t,e,n),this}removePropByPath(t,e={}){const n=Array.isArray(t)?t:t.split("/");return"attrs"===n[0]&&(e.dirty=!0),this.store.removeByPath(n,e),this}prop(t,e,n){return null==t?this.getProp():"string"===typeof t||Array.isArray(t)?1===arguments.length?this.getPropByPath(t):null==e?this.removePropByPath(t,n||{}):this.setPropByPath(t,e,n||{}):this.setProp(t,e||{})}previous(t){return this.store.getPrevious(t)}get zIndex(){return this.getZIndex()}set zIndex(t){null==t?this.removeZIndex():this.setZIndex(t)}getZIndex(){return this.store.get("zIndex")}setZIndex(t,e={}){return this.store.set("zIndex",t,e),this}removeZIndex(t={}){return this.store.remove("zIndex",t),this}toFront(t={}){const e=this.model;if(e){let n,i=e.getMaxZIndex();t.deep?(n=this.getDescendants({deep:!0,breadthFirst:!0}),n.unshift(this)):n=[this],i=i-n.length+1;const s=e.total();let o=e.indexOf(this)!==s-n.length;o||(o=n.some(((t,e)=>t.getZIndex()!==i+e))),o&&this.batchUpdate("to-front",(()=>{i+=n.length,n.forEach(((e,n)=>{e.setZIndex(i+n,t)}))}))}return this}toBack(t={}){const e=this.model;if(e){let n,i=e.getMinZIndex();t.deep?(n=this.getDescendants({deep:!0,breadthFirst:!0}),n.unshift(this)):n=[this];let s=0!==e.indexOf(this);s||(s=n.some(((t,e)=>t.getZIndex()!==i+e))),s&&this.batchUpdate("to-back",(()=>{i-=n.length,n.forEach(((e,n)=>{e.setZIndex(i+n,t)}))}))}return this}get markup(){return this.getMarkup()}set markup(t){null==t?this.removeMarkup():this.setMarkup(t)}getMarkup(){let t=this.store.get("markup");if(null==t){const e=this.constructor;t=e.getMarkup()}return t}setMarkup(t,e={}){return this.store.set("markup",t,e),this}removeMarkup(t={}){return this.store.remove("markup",t),this}get attrs(){return this.getAttrs()}set attrs(t){null==t?this.removeAttrs():this.setAttrs(t)}getAttrs(){const t=this.store.get("attrs");return t?Object.assign({},t):{}}setAttrs(t,e={}){if(null==t)this.removeAttrs(e);else{const n=t=>this.store.set("attrs",t,e);if(!0===e.overwrite)n(t);else{const i=this.getAttrs();!1===e.deep?n(Object.assign(Object.assign({},i),t)):n(Kn({},i,t))}}return this}replaceAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{deep:!1}))}removeAttrs(t={}){return this.store.remove("attrs",t),this}getAttrDefinition(t){if(!t)return null;const e=this.constructor,n=e.getAttrHooks()||{};let i=n[t]||kd.registry.get(t);if(!i){const e=ya(t);i=n[e]||kd.registry.get(e)}return i||null}getAttrByPath(t){return null==t||""===t?this.getAttrs():this.getPropByPath(this.prefixAttrPath(t))}setAttrByPath(t,e,n={}){return this.setPropByPath(this.prefixAttrPath(t),e,n),this}removeAttrByPath(t,e={}){return this.removePropByPath(this.prefixAttrPath(t),e),this}prefixAttrPath(t){return Array.isArray(t)?["attrs"].concat(t):`attrs/${t}`}attr(t,e,n){return null==t?this.getAttrByPath():"string"===typeof t||Array.isArray(t)?1===arguments.length?this.getAttrByPath(t):null==e?this.removeAttrByPath(t,n||{}):this.setAttrByPath(t,e,n||{}):this.setAttrs(t,e||{})}get visible(){return this.isVisible()}set visible(t){this.setVisible(t)}setVisible(t,e={}){return this.store.set("visible",t,e),this}isVisible(){return!1!==this.store.get("visible")}show(t={}){return this.isVisible()||this.setVisible(!0,t),this}hide(t={}){return this.isVisible()&&this.setVisible(!1,t),this}toggleVisible(t,e={}){const n="boolean"===typeof t?t:!this.isVisible(),i="boolean"===typeof t?e:t;return n?this.show(i):this.hide(i),this}get data(){return this.getData()}set data(t){this.setData(t)}getData(){return this.store.get("data")}setData(t,e={}){if(null==t)this.removeData(e);else{const n=t=>this.store.set("data",t,e);if(!0===e.overwrite)n(t);else{const i=this.getData();!1===e.deep?n("object"===typeof t?Object.assign(Object.assign({},i),t):t):n(Kn({},i,t))}}return this}replaceData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{deep:!1}))}removeData(t={}){return this.store.remove("data",t),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const t=this.getParentId();if(t&&this.model){const e=this.model.getCell(t);return this._parent=e,e}return null}getChildren(){const t=this.store.get("children");if(t&&t.length&&this.model){const e=t.map((t=>{var e;return null===(e=this.model)||void 0===e?void 0:e.getCell(t)})).filter((t=>null!=t));return this._children=e,[...e]}return null}hasParent(){return null!=this.parent}isParentOf(t){return null!=t&&t.getParent()===this}isChildOf(t){return null!=t&&this.getParent()===t}eachChild(t,e){return this.children&&this.children.forEach(t,e),this}filterChild(t,e){return this.children?this.children.filter(t,e):[]}getChildCount(){return null==this.children?0:this.children.length}getChildIndex(t){return null==this.children?-1:this.children.indexOf(t)}getChildAt(t){return null!=this.children&&t>=0?this.children[t]:null}getAncestors(t={}){const e=[];let n=this.getParent();while(n)e.push(n),n=!1!==t.deep?n.getParent():null;return e}getDescendants(t={}){if(!1!==t.deep){if(t.breadthFirst){const t=[],e=this.getChildren()||[];while(e.length>0){const n=e.shift(),i=n.getChildren();t.push(n),i&&e.push(...i)}return t}{const e=this.getChildren()||[];return e.forEach((n=>{e.push(...n.getDescendants(t))})),e}}return this.getChildren()||[]}isDescendantOf(t,e={}){if(null==t)return!1;if(!1!==e.deep){let e=this.getParent();while(e){if(e===t)return!0;e=e.getParent()}return!1}return this.isChildOf(t)}isAncestorOf(t,e={}){return null!=t&&t.isDescendantOf(this,e)}contains(t){return this.isAncestorOf(t)}getCommonAncestor(...t){return Sm.getCommonAncestor(this,...t)}setParent(t,e={}){return this._parent=t,t?this.store.set("parent",t.id,e):this.store.remove("parent",e),this}setChildren(t,e={}){return this._children=t,null!=t?this.store.set("children",t.map((t=>t.id)),e):this.store.remove("children",e),this}unembed(t,e={}){const n=this.children;if(null!=n&&null!=t){const i=this.getChildIndex(t);-1!==i&&(n.splice(i,1),t.setParent(null,e),this.setChildren(n,e))}return this}embed(t,e={}){return t.addTo(this,e),this}addTo(t,e={}){return Sm.isCell(t)?t.addChild(this,e):t.addCell(this,e),this}insertTo(t,e,n={}){return t.insertChild(this,e,n),this}addChild(t,e={}){return this.insertChild(t,void 0,e)}insertChild(t,e,n={}){if(null!=t&&t!==this){const i=t.getParent(),s=this!==i;let o=e;if(null==o&&(o=this.getChildCount(),s||(o-=1)),i){const e=i.getChildren();if(e){const s=e.indexOf(t);s>=0&&(t.setParent(null,n),e.splice(s,1),i.setChildren(e,n))}}let r=this.children;if(null==r?(r=[],r.push(t)):r.splice(o,0,t),t.setParent(this,n),this.setChildren(r,n),s&&this.model){const t=this.model.getIncomingEdges(this),e=this.model.getOutgoingEdges(this);t&&t.forEach((t=>t.updateParent(n))),e&&e.forEach((t=>t.updateParent(n)))}this.model&&this.model.addCell(t,n)}return this}removeFromParent(t={}){const e=this.getParent();if(null!=e){const n=e.getChildIndex(this);e.removeChildAt(n,t)}return this}removeChild(t,e={}){const n=this.getChildIndex(t);return this.removeChildAt(n,e)}removeChildAt(t,e={}){const n=this.getChildAt(t),i=this.children;return null!=i&&null!=n&&(this.unembed(n,e),n.remove(e)),n}remove(t={}){return this.batchUpdate("remove",(()=>{const e=this.getParent();e&&e.removeChild(this,t),!1!==t.deep&&this.eachChild((e=>e.remove(t))),this.model&&this.model.removeCell(this,t)})),this}transition(t,e,n={},i="/"){return this.animation.start(t,e,n,i)}stopTransition(t,e,n="/"){return this.animation.stop(t,e,n),this}getTransitions(){return this.animation.get()}translate(t,e,n){return this}scale(t,e,n,i){return this}addTools(t,e,n){const i=Array.isArray(t)?t:[t],s="string"===typeof e?e:null,o="object"===typeof e?e:"object"===typeof n?n:{};if(o.reset)return this.setTools({name:s,items:i,local:o.local},o);let r=pi(this.getTools());return null==r||null==s||r.name===s?(null==r&&(r={}),r.items||(r.items=[]),r.name=s,r.items=[...r.items,...i],this.setTools(Object.assign({},r),o)):void 0}setTools(t,e={}){return null==t?this.removeTools():this.store.set("tools",Sm.normalizeTools(t),e),this}getTools(){return this.store.get("tools")}removeTools(t={}){return this.store.remove("tools",t),this}hasTools(t){const e=this.getTools();return null!=e&&(null==t||e.name===t)}hasTool(t){const e=this.getTools();return null!=e&&e.items.some((e=>"string"===typeof e?e===t:e.name===t))}removeTool(t,e={}){const n=pi(this.getTools());if(n){let i=!1;const s=n.items.slice(),o=t=>{s.splice(t,1),i=!0};if("number"===typeof t)o(t);else for(let e=s.length-1;e>=0;e-=1){const n=s[e],i="string"===typeof n?n===t:n.name===t;i&&o(e)}i&&(n.items=s,this.setTools(n,e))}return this}getBBox(t){return new lc}getConnectionPoint(t,e){return new ac}toJSON(t={}){const e=Object.assign({},this.store.get()),n=Object.prototype.toString,i=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!e.shape){const t=this.constructor;throw new Error(`Unable to serialize ${i} missing "shape" prop, check the ${i} "${t.name||n.call(t)}"`)}const s=this.constructor,o=!0===t.diff,r=e.attrs||{},a=s.getDefaults(!0),l=o?this.preprocess(a,!0):a,c=l.attrs||{},h={};Object.keys(e).forEach((t=>{const s=e[t];if(null!=s&&!Array.isArray(s)&&"object"===typeof s&&!Bn(s))throw new Error(`Can only serialize ${i} with plain-object props, but got a "${n.call(s)}" type of key "${t}" on ${i} "${this.id}"`);if("attrs"!==t&&"shape"!==t&&o){const n=l[t];Qn.Z(s,n)&&delete e[t]}})),Object.keys(r).forEach((t=>{const e=r[t],n=c[t];Object.keys(e).forEach((i=>{const s=e[i],o=n?n[i]:null;null==s||"object"!==typeof s||Array.isArray(s)?null!=n&&Qn.Z(o,s)||(null==h[t]&&(h[t]={}),h[t][i]=s):Object.keys(s).forEach((e=>{const r=s[e];if(null==n||null==o||!It.Z(o)||!Qn.Z(o[e],r)){null==h[t]&&(h[t]={}),null==h[t][i]&&(h[t][i]={});const n=h[t][i];n[e]=r}}))}))}));const u=Object.assign(Object.assign({},e),{attrs:li(h)?void 0:h});null==u.attrs&&delete u.attrs;const d=u;return 0===d.angle&&delete d.angle,pi(d)}clone(t={}){if(!t.deep){const e=Object.assign({},this.store.get());t.keepId||delete e.id,delete e.parent,delete e.children;const n=this.constructor;return new n(e)}const e=Sm.deepClone(this);return e[this.id]}findView(t){return t.renderer.findViewByCell(this)}startBatch(t,e={},n=this.model){return this.notify("batch:start",{name:t,data:e,cell:this}),n&&n.startBatch(t,Object.assign(Object.assign({},e),{cell:this})),this}stopBatch(t,e={},n=this.model){return n&&n.stopBatch(t,Object.assign(Object.assign({},e),{cell:this})),this.notify("batch:stop",{name:t,data:e,cell:this}),this}batchUpdate(t,e,n){const i=this.model;this.startBatch(t,n,i);const s=e();return this.stopBatch(t,n,i),s}dispose(){this.removeFromParent(),this.store.dispose()}}Sm.defaults={},Sm.attrHooks={},Sm.propHooks=[],Em([Vg.dispose()],Sm.prototype,"dispose",null),function(t){function e(t){return"string"===typeof t?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}t.normalizeTools=e}(Sm||(Sm={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNode&&"function"===typeof i.isEdge&&"function"===typeof i.prop&&"function"===typeof i.attr}t.toStringTag=`X6.${t.name}`,t.isCell=e}(Sm||(Sm={})),function(t){function e(...t){const e=t.filter((t=>null!=t)).map((t=>t.getAncestors())).sort(((t,e)=>t.length-e.length)),n=e.shift();return n.find((t=>e.every((e=>e.includes(t)))))||null}function n(t,e={}){let n=null;for(let i=0,s=t.length;i<s;i+=1){const s=t[i];let o=s.getBBox(e);if(o){if(s.isNode()){const t=s.getAngle();null!=t&&0!==t&&(o=o.bbox(t))}n=null==n?o:n.union(o)}}return n}function i(e){const n=[e,...e.getDescendants({deep:!0})];return t.cloneCells(n)}function s(t){const e=ft(t),n=e.reduce(((t,e)=>(t[e.id]=e.clone(),t)),{});return e.forEach((t=>{const e=n[t.id];if(e.isEdge()){const t=e.getSourceCellId(),i=e.getTargetCellId();t&&n[t]&&e.setSource(Object.assign(Object.assign({},e.getSource()),{cell:n[t].id})),i&&n[i]&&e.setTarget(Object.assign(Object.assign({},e.getTarget()),{cell:n[i].id}))}const i=t.getParent();i&&n[i.id]&&e.setParent(n[i.id]);const s=t.getChildren();if(s&&s.length){const t=s.reduce(((t,e)=>(n[e.id]&&t.push(n[e.id]),t)),[]);t.length>0&&e.setChildren(t)}})),n}t.getCommonAncestor=e,t.getCellsBBox=n,t.deepClone=i,t.cloneCells=s}(Sm||(Sm={})),function(t){t.config({propHooks(e){var{tools:n}=e,i=Mm(e,["tools"]);return n&&(i.tools=t.normalizeTools(n)),i}})}(Sm||(Sm={})),function(t){let e,n;function i(t,i){return i?null!=e&&e.exist(t):null!=n&&n.exist(t)}function s(t){e=t}function o(t){n=t}t.exist=i,t.setEdgeRegistry=s,t.setNodeRegistry=o}(km||(km={}));class Am{constructor(t){this.ports=[],this.groups={},this.init(pi(t))}getPorts(){return this.ports}getGroup(t){return null!=t?this.groups[t]:null}getPortsByGroup(t){return this.ports.filter((e=>e.group===t||null==e.group&&null==t))}getPortsLayoutByGroup(t,e){const n=this.getPortsByGroup(t),i=t?this.getGroup(t):null,s=i?i.position:null,o=s?s.name:null;let r;if(null!=o){const t=yg.registry.get(o);if(null==t)return yg.registry.onNotFound(o);r=t}else r=yg.presets.left;const a=n.map((t=>t&&t.position&&t.position.args||{})),l=s&&s.args||{},c=r(a,e,l);return c.map(((t,i)=>{const s=n[i];return{portLayout:t,portId:s.id,portSize:s.size,portAttrs:s.attrs,labelSize:s.label.size,labelLayout:this.getPortLabelLayout(s,ac.create(t.position),e)}}))}init(t){const{groups:e,items:n}=t;null!=e&&Object.keys(e).forEach((t=>{this.groups[t]=this.parseGroup(e[t])})),Array.isArray(n)&&n.forEach((t=>{this.ports.push(this.parsePort(t))}))}parseGroup(t){return Object.assign(Object.assign({},t),{label:this.getLabel(t,!0),position:this.getPortPosition(t.position,!0)})}parsePort(t){const e=Object.assign({},t),n=this.getGroup(t.group)||{};return e.markup=e.markup||n.markup,e.attrs=Kn({},n.attrs,e.attrs),e.position=this.createPosition(n,e),e.label=Kn({},n.label,this.getLabel(e)),e.zIndex=this.getZIndex(n,e),e.size=Object.assign(Object.assign({},n.size),e.size),e}getZIndex(t,e){return"number"===typeof e.zIndex?e.zIndex:"number"===typeof t.zIndex||"auto"===t.zIndex?t.zIndex:"auto"}createPosition(t,e){return Kn({name:"left",args:{}},t.position,{args:e.args})}getPortPosition(t,e=!1){if(null==t){if(e)return{name:"left",args:{}}}else{if("string"===typeof t)return{name:t,args:{}};if(Array.isArray(t))return{name:"absolute",args:{x:t[0],y:t[1]}};if("object"===typeof t)return t}return{args:{}}}getPortLabelPosition(t,e=!1){if(null==t){if(e)return{name:"left",args:{}}}else{if("string"===typeof t)return{name:t,args:{}};if("object"===typeof t)return t}return{args:{}}}getLabel(t,e=!1){const n=t.label||{};return n.position=this.getPortLabelPosition(n.position,e),n}getPortLabelLayout(t,e,n){const i=t.label.position.name||"left",s=t.label.position.args||{},o=Lg.registry.get(i)||Lg.presets.left;return o?o(e,n,s):null}}var Dm=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Pm extends Sm{constructor(t={}){super(t),this.initPorts()}get[Symbol.toStringTag](){return Pm.toStringTag}preprocess(t,e){const{x:n,y:i,width:s,height:o}=t,r=Dm(t,["x","y","width","height"]);if(null!=n||null!=i){const t=r.position;r.position=Object.assign(Object.assign({},t),{x:null!=n?n:t?t.x:0,y:null!=i?i:t?t.y:0})}if(null!=s||null!=o){const t=r.size;r.size=Object.assign(Object.assign({},t),{width:null!=s?s:t?t.width:0,height:null!=o?o:t?t.height:0})}return super.preprocess(r,e)}isNode(){return!0}size(t,e,n){return void 0===t?this.getSize():"number"===typeof t?this.setSize(t,e,n):this.setSize(t,e)}getSize(){const t=this.store.get("size");return t?Object.assign({},t):{width:1,height:1}}setSize(t,e,n){return"object"===typeof t?this.resize(t.width,t.height,e):this.resize(t,e,n),this}resize(t,e,n={}){this.startBatch("resize",n);const i=n.direction;if(i){const s=this.getSize();switch(i){case"left":case"right":e=s.height;break;case"top":case"bottom":t=s.width;break;default:break}const o={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3};let r=o[i];const a=Ql.normalize(this.getAngle()||0);n.absolute&&(r+=Math.floor((a+45)/90),r%=4);const l=this.getBBox();let c;c=0===r?l.getBottomLeft():1===r?l.getCorner():2===r?l.getTopRight():l.getOrigin();const h=c.clone().rotate(-a,l.getCenter()),u=Math.sqrt(t*t+e*e)/2;let d=r*Math.PI/2;d+=Math.atan(r%2===0?e/t:t/e),d-=Ql.toRad(a);const g=ac.fromPolar(u,d,h),p=g.clone().translate(t/-2,e/-2);this.store.set("size",{width:t,height:e},n),this.setPosition(p.x,p.y,n)}else this.store.set("size",{width:t,height:e},n);return this.stopBatch("resize",n),this}scale(t,e,n,i={}){const s=this.getBBox().scale(t,e,null==n?void 0:n);return this.startBatch("scale",i),this.setPosition(s.x,s.y,i),this.resize(s.width,s.height,i),this.stopBatch("scale"),this}position(t,e,n){return"number"===typeof t?this.setPosition(t,e,n):this.getPosition(t)}getPosition(t={}){if(t.relative){const t=this.getParent();if(null!=t&&t.isNode()){const e=this.getPosition(),n=t.getPosition();return{x:e.x-n.x,y:e.y-n.y}}}const e=this.store.get("position");return e?Object.assign({},e):{x:0,y:0}}setPosition(t,e,n={}){let i,s,o;if("object"===typeof t?(i=t.x,s=t.y,o=e||{}):(i=t,s=e,o=n||{}),o.relative){const t=this.getParent();if(null!=t&&t.isNode()){const e=t.getPosition();i+=e.x,s+=e.y}}if(o.deep){const t=this.getPosition();this.translate(i-t.x,s-t.y,o)}else this.store.set("position",{x:i,y:s},o);return this}translate(t=0,e=0,n={}){if(0===t&&0===e)return this;n.translateBy=n.translateBy||this.id;const i=this.getPosition();if(null!=n.restrict&&n.translateBy===this.id){const s=this.getBBox({deep:!0}),o=n.restrict,r=i.x-s.x,a=i.y-s.y,l=Math.max(o.x+r,Math.min(o.x+o.width+r-s.width,i.x+t)),c=Math.max(o.y+a,Math.min(o.y+o.height+a-s.height,i.y+e));t=l-i.x,e=c-i.y}const s={x:i.x+t,y:i.y+e};return n.tx=t,n.ty=e,n.transition?("object"!==typeof n.transition&&(n.transition={}),this.transition("position",s,Object.assign(Object.assign({},n.transition),{interp:Ug.object})),this.eachChild((i=>{var s;const o=null===(s=n.exclude)||void 0===s?void 0:s.includes(i);o||i.translate(t,e,n)}))):(this.startBatch("translate",n),this.store.set("position",s,n),this.eachChild((i=>{var s;const o=null===(s=n.exclude)||void 0===s?void 0:s.includes(i);o||i.translate(t,e,n)})),this.stopBatch("translate",n)),this}angle(t,e){return null==t?this.getAngle():this.rotate(t,e)}getAngle(){return this.store.get("angle",0)}rotate(t,e={}){const n=this.getAngle();if(e.center){const i=this.getSize(),s=this.getPosition(),o=this.getBBox().getCenter();o.rotate(n-t,e.center);const r=o.x-i.width/2-s.x,a=o.y-i.height/2-s.y;this.startBatch("rotate",{angle:t,options:e}),this.setPosition(s.x+r,s.y+a,e),this.rotate(t,Object.assign(Object.assign({},e),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",e.absolute?t:(n+t)%360,e);return this}getBBox(t={}){if(t.deep){const t=this.getDescendants({deep:!0,breadthFirst:!0});return t.push(this),Sm.getCellsBBox(t)}return lc.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(t,e){const n=this.getBBox(),i=n.getCenter(),s=t.getTerminal(e);if(null==s)return i;const o=s.port;if(!o||!this.hasPort(o))return i;const r=this.getPort(o);if(!r||!r.group)return i;const a=this.getPortsPosition(r.group),l=a[o].position,c=ac.create(l).translate(n.getOrigin()),h=this.getAngle();return h&&c.rotate(-h,i),c}fit(t={}){const e=this.getChildren()||[],n=e.filter((t=>t.isNode()));if(0===n.length)return this;this.startBatch("fit-embeds",t),t.deep&&n.forEach((e=>e.fit(t)));let{x:i,y:s,width:o,height:r}=Sm.getCellsBBox(n);const a=_a(t.padding);return i-=a.left,s-=a.top,o+=a.left+a.right,r+=a.bottom+a.top,this.store.set({position:{x:i,y:s},size:{width:o,height:r}},t),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(t){this.setPortContainerMarkup(t)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||rp.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(t,e={}){return this.store.set("portContainerMarkup",rp.clone(t),e),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(t){this.setPortMarkup(t)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||rp.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(t,e={}){return this.store.set("portMarkup",rp.clone(t),e),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(t){this.setPortLabelMarkup(t)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||rp.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(t,e={}){return this.store.set("portLabelMarkup",rp.clone(t),e),this}get ports(){const t=this.store.get("ports",{items:[]});return null==t.items&&(t.items=[]),t}getPorts(){return pi(this.ports.items)}getPortsByGroup(t){return this.getPorts().filter((e=>e.group===t))}getPort(t){return pi(this.ports.items.find((e=>e.id&&e.id===t)))}getPortAt(t){return this.ports.items[t]||null}hasPorts(){return this.ports.items.length>0}hasPort(t){return-1!==this.getPortIndex(t)}getPortIndex(t){const e="string"===typeof t?t:t.id;return null!=e?this.ports.items.findIndex((t=>t.id===e)):-1}getPortsPosition(t){const e=this.getSize(),n=this.port.getPortsLayoutByGroup(t,new lc(0,0,e.width,e.height));return n.reduce(((t,e)=>{const n=e.portLayout;return t[e.portId]={position:Object.assign({},n.position),angle:n.angle||0},t}),{})}getPortProp(t,e){return this.getPropByPath(this.prefixPortPath(t,e))}setPortProp(t,e,n,i){if("string"===typeof e||Array.isArray(e)){const s=this.prefixPortPath(t,e),o=n;return this.setPropByPath(s,o,i)}const s=this.prefixPortPath(t),o=e;return this.setPropByPath(s,o,n)}removePortProp(t,e,n){return"string"===typeof e||Array.isArray(e)?this.removePropByPath(this.prefixPortPath(t,e),n):this.removePropByPath(this.prefixPortPath(t),e)}portProp(t,e,n,i){return null==e?this.getPortProp(t):"string"===typeof e||Array.isArray(e)?2===arguments.length?this.getPortProp(t,e):null==n?this.removePortProp(t,e,i):this.setPortProp(t,e,n,i):this.setPortProp(t,e,n)}prefixPortPath(t,e){const n=this.getPortIndex(t);if(-1===n)throw new Error(`Unable to find port with id: "${t}"`);return null==e||""===e?["ports","items",`${n}`]:Array.isArray(e)?["ports","items",`${n}`,...e]:`ports/items/${n}/${e}`}addPort(t,e){const n=[...this.ports.items];return n.push(t),this.setPropByPath("ports/items",n,e),this}addPorts(t,e){return this.setPropByPath("ports/items",[...this.ports.items,...t],e),this}insertPort(t,e,n){const i=[...this.ports.items];return i.splice(t,0,e),this.setPropByPath("ports/items",i,n),this}removePort(t,e={}){return this.removePortAt(this.getPortIndex(t),e)}removePortAt(t,e={}){if(t>=0){const n=[...this.ports.items];n.splice(t,1),e.rewrite=!0,this.setPropByPath("ports/items",n,e)}return this}removePorts(t,e){let n;if(Array.isArray(t)){if(n=e||{},t.length){n.rewrite=!0;const e=[...this.ports.items],i=e.filter((e=>!t.some((t=>{const n="string"===typeof t?t:t.id;return e.id===n}))));this.setPropByPath("ports/items",i,n)}}else n=t||{},n.rewrite=!0,this.setPropByPath("ports/items",[],n);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(t,e){return this.port.getPortsLayoutByGroup(t,e)}initPorts(){this.updatePortData(),this.on("change:ports",(()=>{this.processRemovedPort(),this.updatePortData()}))}processRemovedPort(){const t=this.ports,e={};t.items.forEach((t=>{t.id&&(e[t.id]=!0)}));const n={},i=this.store.getPrevious("ports")||{items:[]};i.items.forEach((t=>{t.id&&!e[t.id]&&(n[t.id]=!0)}));const s=this.model;if(s&&!li(n)){const t=s.getConnectedEdges(this,{incoming:!0});t.forEach((t=>{const e=t.getTargetPortId();e&&n[e]&&t.remove()}));const e=s.getConnectedEdges(this,{outgoing:!0});e.forEach((t=>{const e=t.getSourcePortId();e&&n[e]&&t.remove()}))}}validatePorts(){const t={},e=[];return this.ports.items.forEach((n=>{"object"!==typeof n&&e.push(`Invalid port ${n}.`),null==n.id&&(n.id=this.generatePortId()),t[n.id]&&e.push("Duplicitied port id."),t[n.id]=!0})),e}generatePortId(){return Da()}updatePortData(){const t=this.validatePorts();if(t.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(t.join(" "));const e=this.port?this.port.getPorts():null;this.port=new Am(this.ports);const n=this.port.getPorts(),i=e?n.filter((t=>e.find((e=>e.id===t.id))?null:t)):[...n],s=e?e.filter((t=>n.find((e=>e.id===t.id))?null:t)):[];i.length>0&&this.notify("ports:added",{added:i,cell:this,node:this}),s.length>0&&this.notify("ports:removed",{removed:s,cell:this,node:this})}}Pm.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNode&&"function"===typeof i.isEdge&&"function"===typeof i.prop&&"function"===typeof i.attr&&"function"===typeof i.size&&"function"===typeof i.position}t.toStringTag=`X6.${t.name}`,t.isNode=e}(Pm||(Pm={})),function(t){t.config({propHooks(t){var{ports:e}=t,n=Dm(t,["ports"]);return e&&(n.ports=Array.isArray(e)?{items:e}:e),n}})}(Pm||(Pm={})),function(t){t.registry=Uh.create({type:"node",process(e,n){if(km.exist(e,!0))throw new Error(`Node with name '${e}' was registered by anthor Edge`);if("function"===typeof n)return n.config({shape:e}),n;let i=t;const{inherit:s}=n,o=Dm(n,["inherit"]);if(s)if("string"===typeof s){const t=this.get(s);null==t?this.onNotFound(s,"inherited"):i=t}else i=s;null==o.constructorName&&(o.constructorName=e);const r=i.define.call(i,o);return r.config({shape:e}),r}}),km.setNodeRegistry(t.registry)}(Pm||(Pm={})),function(t){let e=0;function n(t){return t?Sa(t):(e+=1,`CustomNode${e}`)}function i(e){const{constructorName:i,overwrite:s}=e,o=Dm(e,["constructorName","overwrite"]),r=Ti(n(i||o.shape),this);return r.config(o),o.shape&&t.registry.register(o.shape,r,s),r}function s(e){const n=e.shape||"rect",i=t.registry.get(n);return i?new i(e):t.registry.onNotFound(n)}t.define=i,t.create=s}(Pm||(Pm={}));var Om=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Tm extends Pm{get label(){return this.getLabel()}set label(t){this.setLabel(t)}getLabel(){return this.getAttrByPath("text/text")}setLabel(t,e){return null==t?this.removeLabel():this.setAttrByPath("text/text",t,e),this}removeLabel(){return this.removeAttrByPath("text/text"),this}}(function(t){t.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},t.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},t.config({attrs:{text:Object.assign({},t.labelAttr)},propHooks(t){const{label:e}=t,n=Om(t,["label"]);return e&&Fi(n,"attrs/text/text",e),n}})})(Tm||(Tm={}));var Nm=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};function jm(t,e=!1){return`<g class="rotatable"><g class="scalable"><${t}/></g>${e?"":"<text/>"}</g>`}function Fm(t){return`basic.${t}`}function Lm(t="xlink:href"){const e=e=>{const{imageUrl:n,imageWidth:i,imageHeight:s}=e,o=Nm(e,["imageUrl","imageWidth","imageHeight"]);if(null!=n||null!=i||null!=s){const e=()=>{if(o.attrs){const e=o.attrs.image;null!=n&&(e[t]=n),null!=i&&(e.width=i),null!=s&&(e.height=s),o.attrs.image=e}};o.attrs?(null==o.attrs.image&&(o.attrs.image={}),e()):(o.attrs={image:{}},e())}return o};return e}function zm(t,e,n={}){const i=Fm(t),s={constructorName:i,attrs:{".":{fill:"#ffffff",stroke:"none"},[t]:{fill:"#ffffff",stroke:"#000000"}}};n.ignoreMarkup||(s.markup=jm(t,!0===n.noText));const o=n.parent||Tm;return o.define(Kn(s,e,{shape:i}))}zm("rect",{attrs:{rect:{width:100,height:60}}}),zm("circle",{width:60,height:60,attrs:{circle:{r:30,cx:30,cy:30}}}),zm("ellipse",{width:60,height:40,attrs:{ellipse:{rx:30,ry:20,cx:30,cy:20}}}),zm("polygon",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),zm("polyline",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),zm("image",{attrs:{text:{refY:null,refDy:16}},propHooks:Lm()});var Im=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const Bm=zm("path",{width:60,height:60,attrs:{text:{ref:"path",refY:null,refDy:16}},propHooks(t){const{d:e}=t,n=Im(t,["d"]);return null!=e&&Fi(n,"attrs/path/d",e),n}});zm("rhombus",{d:"M 30 0 L 60 30 30 60 0 30 z",attrs:{text:{refY:.5,refDy:null}}},{parent:Bm,ignoreMarkup:!0}),zm("cylinder",{width:40,height:40,attrs:{path:{fill:"#FFFFFF",stroke:"#cbd2d7",strokeWidth:3,d:["M 0 10 C 10 5, 30 5, 40 10 C 30 15, 10 15, 0 10","L 0 20","C 10 25, 30 25, 40 20","L 40 10"].join(" ")},text:{refY:.7,refDy:null,fill:"#435460"}}},{parent:Bm,ignoreMarkup:!0});var Rm=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class $m extends Sm{constructor(t={}){super(t)}get[Symbol.toStringTag](){return $m.toStringTag}preprocess(t,e){const{source:n,sourceCell:i,sourcePort:s,sourcePoint:o,target:r,targetCell:a,targetPort:l,targetPoint:c}=t,h=Rm(t,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),u=h,d=t=>"string"===typeof t||"number"===typeof t;if(null!=n)if(Sm.isCell(n))u.source={cell:n.id};else if(d(n))u.source={cell:n};else if(ac.isPoint(n))u.source=n.toJSON();else if(Array.isArray(n))u.source={x:n[0],y:n[1]};else{const t=n.cell;Sm.isCell(t)?u.source=Object.assign(Object.assign({},n),{cell:t.id}):u.source=n}if(null!=i||null!=s){let t=u.source;if(null!=i){const e=d(i)?i:i.id;t?t.cell=e:t=u.source={cell:e}}null!=s&&t&&(t.port=s)}else null!=o&&(u.source=ac.create(o).toJSON());if(null!=r)if(Sm.isCell(r))u.target={cell:r.id};else if(d(r))u.target={cell:r};else if(ac.isPoint(r))u.target=r.toJSON();else if(Array.isArray(r))u.target={x:r[0],y:r[1]};else{const t=r.cell;Sm.isCell(t)?u.target=Object.assign(Object.assign({},r),{cell:t.id}):u.target=r}if(null!=a||null!=l){let t=u.target;if(null!=a){const e=d(a)?a:a.id;t?t.cell=e:t=u.target={cell:e}}null!=l&&t&&(t.port=l)}else null!=c&&(u.target=ac.create(c).toJSON());return super.preprocess(u,e)}setup(){super.setup(),this.on("change:labels",(t=>this.onLabelsChanged(t))),this.on("change:vertices",(t=>this.onVertexsChanged(t)))}isEdge(){return!0}disconnect(t={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},t),this}get source(){return this.getSource()}set source(t){this.setSource(t)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(t,e,n={}){return this.setTerminal("source",t,e,n)}get target(){return this.getTarget()}set target(t){this.setTarget(t)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(t,e,n={}){return this.setTerminal("target",t,e,n)}getTerminal(t){return Object.assign({},this.store.get(t))}setTerminal(t,e,n,i={}){if(Sm.isCell(e))return this.store.set(t,Kn({},n,{cell:e.id}),i),this;const s=e;return ac.isPoint(e)||null!=s.x&&null!=s.y?(this.store.set(t,Kn({},n,{x:s.x,y:s.y}),i),this):(this.store.set(t,pi(e),i),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(t){const e=this[t];if(ac.isPointLike(e))return ac.create(e);const n=this.getTerminalCell(t);return n?n.getConnectionPoint(this,t):new ac}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(t){if(this.model){const e="source"===t?this.getSourceCellId():this.getTargetCellId();if(e)return this.model.getCell(e)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(t){let e=this;const n={};while(e&&e.isEdge()){if(n[e.id])return null;n[e.id]=!0,e=e.getTerminalCell(t)}return e&&e.isNode()?e:null}get router(){return this.getRouter()}set router(t){null==t?this.removeRouter():this.setRouter(t)}getRouter(){return this.store.get("router")}setRouter(t,e,n){return"object"===typeof t?this.store.set("router",t,e):this.store.set("router",{name:t,args:e},n),this}removeRouter(t={}){return this.store.remove("router",t),this}get connector(){return this.getConnector()}set connector(t){null==t?this.removeConnector():this.setConnector(t)}getConnector(){return this.store.get("connector")}setConnector(t,e,n){return"object"===typeof t?this.store.set("connector",t,e):this.store.set("connector",{name:t,args:e},n),this}removeConnector(t={}){return this.store.remove("connector",t)}get strategy(){return this.getStrategy()}set strategy(t){null==t?this.removeStrategy():this.setStrategy(t)}getStrategy(){return this.store.get("strategy")}setStrategy(t,e,n){return"object"===typeof t?this.store.set("strategy",t,e):this.store.set("strategy",{name:t,args:e},n),this}removeStrategy(t={}){return this.store.remove("strategy",t)}getDefaultLabel(){const t=this.constructor,e=this.store.get("defaultLabel")||t.defaultLabel||{};return pi(e)}get labels(){return this.getLabels()}set labels(t){this.setLabels(t)}getLabels(){return[...this.store.get("labels",[])].map((t=>this.parseLabel(t)))}setLabels(t,e={}){return this.store.set("labels",Array.isArray(t)?t:[t],e),this}insertLabel(t,e,n={}){const i=this.getLabels(),s=i.length;let o=null!=e&&Number.isFinite(e)?e:s;return o<0&&(o=s+o+1),i.splice(o,0,this.parseLabel(t)),this.setLabels(i,n)}appendLabel(t,e={}){return this.insertLabel(t,-1,e)}getLabelAt(t){const e=this.getLabels();return null!=t&&Number.isFinite(t)?this.parseLabel(e[t]):null}setLabelAt(t,e,n={}){if(null!=t&&Number.isFinite(t)){const i=this.getLabels();i[t]=this.parseLabel(e),this.setLabels(i,n)}return this}removeLabelAt(t,e={}){const n=this.getLabels(),i=null!=t&&Number.isFinite(t)?t:-1,s=n.splice(i,1);return this.setLabels(n,e),s.length?s[0]:null}parseLabel(t){if("string"===typeof t){const e=this.constructor;return e.parseStringLabel(t)}return t}onLabelsChanged({previous:t,current:e}){const n=t&&e?e.filter((e=>t.find((t=>e===t||Qn.Z(e,t)))?null:e)):e?[...e]:[],i=t&&e?t.filter((t=>e.find((e=>t===e||Qn.Z(t,e)))?null:t)):t?[...t]:[];n.length>0&&this.notify("labels:added",{added:n,cell:this,edge:this}),i.length>0&&this.notify("labels:removed",{removed:i,cell:this,edge:this})}get vertexMarkup(){return this.getVertexMarkup()}set vertexMarkup(t){this.setVertexMarkup(t)}getDefaultVertexMarkup(){return this.store.get("defaultVertexMarkup")||rp.getEdgeVertexMarkup()}getVertexMarkup(){return this.store.get("vertexMarkup")||this.getDefaultVertexMarkup()}setVertexMarkup(t,e={}){return this.store.set("vertexMarkup",rp.clone(t),e),this}get vertices(){return this.getVertices()}set vertices(t){this.setVertices(t)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(t,e={}){const n=Array.isArray(t)?t:[t];return this.store.set("vertices",n.map((t=>ac.toJSON(t))),e),this}insertVertex(t,e,n={}){const i=this.getVertices(),s=i.length;let o=null!=e&&Number.isFinite(e)?e:s;return o<0&&(o=s+o+1),i.splice(o,0,ac.toJSON(t)),this.setVertices(i,n)}appendVertex(t,e={}){return this.insertVertex(t,-1,e)}getVertexAt(t){if(null!=t&&Number.isFinite(t)){const e=this.getVertices();return e[t]}return null}setVertexAt(t,e,n={}){if(null!=t&&Number.isFinite(t)){const i=this.getVertices();i[t]=e,this.setVertices(i,n)}return this}removeVertexAt(t,e={}){const n=this.getVertices(),i=null!=t&&Number.isFinite(t)?t:-1;return n.splice(i,1),this.setVertices(n,e)}onVertexsChanged({previous:t,current:e}){const n=t&&e?e.filter((e=>t.find((t=>ac.equals(e,t)))?null:e)):e?[...e]:[],i=t&&e?t.filter((t=>e.find((e=>ac.equals(t,e)))?null:t)):t?[...t]:[];n.length>0&&this.notify("vertexs:added",{added:n,cell:this,edge:this}),i.length>0&&this.notify("vertexs:removed",{removed:i,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||rp.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}get toolMarkup(){return this.getToolMarkup()}set toolMarkup(t){this.setToolMarkup(t)}getDefaultToolMarkup(){return this.store.get("defaultToolMarkup")||rp.getEdgeToolMarkup()}getToolMarkup(){return this.store.get("toolMarkup")||this.getDefaultToolMarkup()}setToolMarkup(t,e={}){return this.store.set("toolMarkup",t,e),this}get doubleToolMarkup(){return this.getDoubleToolMarkup()}set doubleToolMarkup(t){this.setDoubleToolMarkup(t)}getDefaultDoubleToolMarkup(){return this.store.get("defaultDoubleToolMarkup")}getDoubleToolMarkup(){return this.store.get("doubleToolMarkup")||this.getDefaultDoubleToolMarkup()}setDoubleToolMarkup(t,e={}){return this.store.set("doubleToolMarkup",t,e),this}get arrowheadMarkup(){return this.getArrowheadMarkup()}set arrowheadMarkup(t){this.setArrowheadMarkup(t)}getDefaultArrowheadMarkup(){return this.store.get("defaultArrowheadMarkup")||rp.getEdgeArrowheadMarkup()}getArrowheadMarkup(){return this.store.get("arrowheadMarkup")||this.getDefaultArrowheadMarkup()}setArrowheadMarkup(t,e={}){return this.store.set("arrowheadMarkup",t,e),this}translate(t,e,n={}){return n.translateBy=n.translateBy||this.id,n.tx=t,n.ty=e,this.applyToPoints((n=>({x:(n.x||0)+t,y:(n.y||0)+e})),n)}scale(t,e,n,i={}){return this.applyToPoints((i=>ac.create(i).scale(t,e,n).toJSON()),i)}applyToPoints(t,e={}){const n={},i=this.getSource(),s=this.getTarget();ac.isPointLike(i)&&(n.source=t(i)),ac.isPointLike(s)&&(n.target=t(s));const o=this.getVertices();return o.length>0&&(n.vertices=o.map(t)),this.store.set(n,e),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const t=[this.getSourcePoint(),...this.getVertices().map((t=>ac.create(t))),this.getTargetPoint()];return new uc(t)}updateParent(t){let e=null;const n=this.getSourceCell(),i=this.getTargetCell(),s=this.getParent();return n&&i&&(e=n===i||n.isDescendantOf(i)?i:i.isDescendantOf(n)?n:Sm.getCommonAncestor(n,i)),!s||e&&e.id===s.id||s.unembed(this,t),e&&e.embed(this,t),e}hasLoop(t={}){const e=this.getSource(),n=this.getTarget(),i=e.cell,s=n.cell;if(!i||!s)return!1;let o=i===s;if(!o&&t.deep&&this._model){const e=this.getSourceCell(),n=this.getTargetCell();e&&n&&(o=e.isAncestorOf(n,t)||n.isAncestorOf(e,t))}return o}getFragmentAncestor(){const t=[this,this.getSourceNode(),this.getTargetNode()].filter((t=>null!=t));return this.getCommonAncestor(...t)}isFragmentDescendantOf(t){const e=this.getFragmentAncestor();return!!e&&(e.id===t.id||e.isDescendantOf(t))}}$m.defaults={},function(t){function e(t,e){const n=t,i=e;return n.cell===i.cell&&(n.port===i.port||null==n.port&&null==i.port)}t.equalTerminals=e}($m||($m={})),function(t){function e(t){return{attrs:{label:{text:t}}}}t.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}},t.parseStringLabel=e}($m||($m={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNode&&"function"===typeof i.isEdge&&"function"===typeof i.prop&&"function"===typeof i.attr&&"function"===typeof i.disconnect&&"function"===typeof i.getSource&&"function"===typeof i.getTarget}t.toStringTag=`X6.${t.name}`,t.isEdge=e}($m||($m={})),function(t){t.registry=Uh.create({type:"edge",process(e,n){if(km.exist(e,!1))throw new Error(`Edge with name '${e}' was registered by anthor Node`);if("function"===typeof n)return n.config({shape:e}),n;let i=t;const{inherit:s="edge"}=n,o=Rm(n,["inherit"]);if("string"===typeof s){const t=this.get(s||"edge");null==t&&s?this.onNotFound(s,"inherited"):i=t}else i=s;null==o.constructorName&&(o.constructorName=e);const r=i.define.call(i,o);return r.config({shape:e}),r}}),km.setEdgeRegistry(t.registry)}($m||($m={})),function(t){let e=0;function n(t){return t?Sa(t):(e+=1,`CustomEdge${e}`)}function i(e){const{constructorName:i,overwrite:s}=e,o=Rm(e,["constructorName","overwrite"]),r=Ti(n(i||o.shape),this);return r.config(o),o.shape&&t.registry.register(o.shape,r,s),r}function s(e){const n=e.shape||"edge",i=t.registry.get(n);return i?new i(e):t.registry.onNotFound(n)}t.define=i,t.create=s}($m||($m={})),function(t){const e="basic.edge";t.config({shape:e,propHooks(e){const{label:n,vertices:i}=e,s=Rm(e,["label","vertices"]);if(n){null==s.labels&&(s.labels=[]);const e="string"===typeof n?t.parseStringLabel(n):n;s.labels.push(e)}return i&&Array.isArray(i)&&(s.vertices=i.map((t=>ac.create(t).toJSON()))),s}}),t.registry.register(e,t)}($m||($m={}));var Vm=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class _m extends up{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.markerCache={}}get[Symbol.toStringTag](){return _m.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const t=this.sourceView;if(!t){const t=this.cell.getSource();return new lc(t.x,t.y)}const e=this.sourceMagnet;return t.isEdgeElement(e)?new lc(this.sourceAnchor.x,this.sourceAnchor.y):t.getBBoxOfElement(e||t.container)}get targetBBox(){const t=this.targetView;if(!t){const t=this.cell.getTarget();return new lc(t.x,t.y)}const e=this.targetMagnet;return t.isEdgeElement(e)?new lc(this.targetAnchor.x,this.targetAnchor.y):t.getBBoxOfElement(e||t.container)}isEdgeView(){return!0}confirmUpdate(t,e={}){let n=t;if(this.hasAction(n,"source")){if(!this.updateTerminalProperties("source"))return n;n=this.removeAction(n,"source")}if(this.hasAction(n,"target")){if(!this.updateTerminalProperties("target"))return n;n=this.removeAction(n,"target")}const i=this.graph,s=this.sourceView,o=this.targetView;return i&&(s&&!i.renderer.isViewMounted(s)||o&&!i.renderer.isViewMounted(o))?n:this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","vertices","labels","tools","widget"]),n):(n=this.handleAction(n,"vertices",(()=>this.renderVertexMarkers())),n=this.handleAction(n,"update",(()=>this.update(null,e))),n=this.handleAction(n,"labels",(()=>this.onLabelsChange(e))),n=this.handleAction(n,"tools",(()=>{this.renderTools(),this.updateToolsPosition()})),n=this.handleAction(n,"widget",(()=>this.renderExternalTools())),n)}onLabelsChange(t={}){this.shouldRerenderLabels(t)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(t={}){const e=this.cell.previous("labels");if(null==e)return!0;if("propertyPathArray"in t&&"propertyValue"in t){const n=t.propertyPathArray||[],i=n.length;if(i>1){const s=n[1];if(e[s]){if(2===i)return"object"===typeof t.propertyValue&&mn(t.propertyValue,"markup");if("markup"!==n[2])return!1}}}return!0}render(){return this.empty(),this.containers={},this.renderMarkup(),this.renderLabels(),this.update(),this.renderExternalTools(),this}renderMarkup(){const t=this.cell.markup;if(t)return"string"===typeof t?this.renderStringMarkup(t):this.renderJSONMarkup(t);throw new TypeError("Invalid edge markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.append(e.fragment)}renderStringMarkup(t){const e=this.containers,n=jc.createVectors(t);n.forEach((t=>{const n=t.attr("class");n&&(e[ya(n)]=t.node)})),this.renderTools(),this.renderVertexMarkers(),this.renderArrowheadMarkers(),Dl(this.container,n.map((t=>t.node)))}renderLabels(){const t=this.cell,e=t.getLabels(),n=e.length;let i=this.containers.labels;if(this.labelCache={},this.labelSelectors={},n<=0)return i&&i.parentNode&&i.parentNode.removeChild(i),this;i?this.empty(i):(i=yl("g"),this.addClass(this.prefixClassName("edge-labels"),i),this.containers.labels=i);for(let s=0,o=e.length;s<o;s+=1){const n=e[s],o=this.normalizeLabelMarkup(this.parseLabelMarkup(n.markup));let r,a;if(o)r=o.node,a=o.selectors;else{const e=t.getDefaultLabel(),n=this.normalizeLabelMarkup(this.parseLabelMarkup(e.markup));r=n.node,a=n.selectors}r.setAttribute("data-index",`${s}`),i.appendChild(r);const l=this.rootSelector;if(a[l])throw new Error("Ambiguous label root selector.");a[l]=r,this.labelCache[s]=r,this.labelSelectors[s]=a}return null==i.parentNode&&this.container.appendChild(i),this.updateLabels(),this.customizeLabels(),this}parseLabelMarkup(t){return t?"string"===typeof t?this.parseLabelStringMarkup(t):this.parseJSONMarkup(t):null}parseLabelStringMarkup(t){const e=jc.createVectors(t),n=document.createDocumentFragment();for(let i=0,s=e.length;i<s;i+=1){const t=e[i].node;n.appendChild(t)}return{fragment:n,selectors:{}}}normalizeLabelMarkup(t){if(null==t)return;const e=t.fragment;if(!(e instanceof DocumentFragment)||!e.hasChildNodes())throw new Error("Invalid label markup.");let n;const i=e.childNodes;return n=i.length>1||"G"!==i[0].nodeName.toUpperCase()?jc.create("g").append(e):jc.create(i[0]),n.addClass(this.prefixClassName("edge-label")),{node:n.node,selectors:t.selectors}}updateLabels(){if(this.containers.labels){const t=this.cell,e=t.labels,n=this.can("edgeLabelMovable"),i=t.getDefaultLabel();for(let s=0,o=e.length;s<o;s+=1){const t=this.labelCache[s],o=this.labelSelectors[s];t.setAttribute("cursor",n?"move":"default");const r=e[s],a=Kn({},i.attrs,r.attrs);this.updateAttrs(t,a,{selectors:o,rootBBox:r.size?lc.fromSize(r.size):void 0})}}}mergeLabelAttrs(t,e,n){if(null===e)return null;if(void 0===e){if(null===n)return null;if(void 0===n)return;return t?n:Kn({},n)}return t?Kn({},n,e):void 0}customizeLabels(){if(this.containers.labels){const t=this.cell,e=t.labels;for(let n=0,i=e.length;n<i;n+=1){const i=e[n],s=this.labelCache[n],o=this.labelSelectors[n];this.graph.hook.onEdgeLabelRendered({edge:t,label:i,container:s,selectors:o})}}}renderTools(){const t=this.containers.tools;if(null==t)return this;const e=this.cell.toolMarkup,n=this.$(t).empty();if(rp.isStringMarkup(e)){let t=Ho(e);const i=jc.create(t());if(n.append(i.node),this.toolCache=i.node,this.options.doubleTools){let e;const s=this.cell.doubleToolMarkup;rp.isStringMarkup(s)?(t=Ho(s),e=jc.create(t())):e=i.clone(),n.append(e.node),this.tool2Cache=e.node}}return this}renderExternalTools(){const t=this.cell.getTools();return this.addTools(t),this}renderVertexMarkers(){const t=this.containers.vertices;if(null==t)return this;const e=this.cell.vertexMarkup,n=this.$(t).empty();if(rp.isStringMarkup(e)){const t=Ho(e);this.cell.getVertices().forEach(((e,i)=>{n.append(jc.create(t(Object.assign({index:i},e))).node)}))}return this}renderArrowheadMarkers(){const t=this.containers.arrowheads;if(null==t)return this;const e=this.cell.arrowheadMarkup,n=this.$(t).empty();if(rp.isStringMarkup(e)){const t=Ho(e),i=jc.create(t({end:"source"})).node,s=jc.create(t({end:"target"})).node;this.containers.sourceArrowhead=i,this.containers.targetArrowhead=s,n.append(i,s)}return this}update(t,e={}){this.cleanCache(),this.updateConnection(e);const n=this.cell.getAttrs();return null!=n&&this.updateAttrs(this.container,n,{attrs:t===n?null:t,selectors:this.selectors}),this.updateConnectionPath(),this.updateLabelPositions(),this.updateToolsPosition(),this.updateArrowheadMarkers(),this.updateTools(e),this}removeRedundantLinearVertices(t={}){const e=this.cell,n=e.getVertices(),i=[this.sourceAnchor,...n,this.targetAnchor],s=i.length,o=new uc(i);o.simplify({threshold:.01});const r=o.points.map((t=>t.toJSON())),a=r.length;return s===a?0:(e.setVertices(r.slice(1,a-1),t),s-a)}updateConnectionPath(){const t=this.containers;if(t.connection){const e=this.getConnectionPathData();t.connection.setAttribute("d",e)}if(t.connectionWrap){const e=this.getConnectionPathData();t.connectionWrap.setAttribute("d",e)}t.sourceMarker&&t.targetMarker&&this.translateAndAutoOrientArrows(t.sourceMarker,t.targetMarker)}getTerminalView(t){switch(t){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalAnchor(t){switch(t){case"source":return ac.create(this.sourceAnchor);case"target":return ac.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalConnectionPoint(t){switch(t){case"source":return ac.create(this.sourcePoint);case"target":return ac.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalMagnet(t,e={}){switch(t){case"source":{if(e.raw)return this.sourceMagnet;const t=this.sourceView;return t?this.sourceMagnet||t.container:null}case"target":{if(e.raw)return this.targetMagnet;const t=this.targetView;return t?this.targetMagnet||t.container:null}default:throw new Error(`Unknown terminal type '${t}'`)}}updateConnection(t={}){const e=this.cell;if(t.translateBy&&e.isFragmentDescendantOf(t.translateBy)){const e=t.tx||0,n=t.ty||0;this.routePoints=new uc(this.routePoints).translate(e,n).points,this.translateConnectionPoints(e,n),this.path.translate(e,n)}else{const t=e.getVertices(),n=this.findAnchors(t);this.sourceAnchor=n.source,this.targetAnchor=n.target,this.routePoints=this.findRoutePoints(t);const i=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=i.source,this.targetPoint=i.target;const s=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,s.source||this.sourcePoint,s.target||this.targetPoint)}this.cleanCache()}findAnchors(t){const e=this.cell,n=e.source,i=e.target,s=t[0],o=t[t.length-1];return i.priority&&!n.priority?this.findAnchorsOrdered("target",o,"source",s):this.findAnchorsOrdered("source",s,"target",o)}findAnchorsOrdered(t,e,n,i){let s,o;const r=this.cell,a=r[t],l=r[n],c=this.getTerminalView(t),h=this.getTerminalView(n),u=this.getTerminalMagnet(t),d=this.getTerminalMagnet(n);if(c){let n;n=e?ac.create(e):h?d:ac.create(l),s=this.getAnchor(a.anchor,c,u,n,t)}else s=ac.create(a);if(h){const t=ac.create(i||s);o=this.getAnchor(l.anchor,h,d,t,n)}else o=ac.isPointLike(l)?ac.create(l):new ac;return{[t]:s,[n]:o}}getAnchor(t,e,n,i,s){const o=e.isEdgeElement(n),r=this.graph.options.connecting;let a,l="string"===typeof t?{name:t}:t;if(!l){const t=o?("source"===s?r.sourceEdgeAnchor:r.targetEdgeAnchor)||r.edgeAnchor:("source"===s?r.sourceAnchor:r.targetAnchor)||r.anchor;l="string"===typeof t?{name:t}:t}if(!l)throw new Error("Anchor should be specified.");const c=l.name;if(o){const t=ef.registry.get(c);if("function"!==typeof t)return ef.registry.onNotFound(c);a=Ya(t,this,e,n,i,l.args||{},s)}else{const t=Zp.registry.get(c);if("function"!==typeof t)return Zp.registry.onNotFound(c);a=Ya(t,this,e,n,i,l.args||{},s)}return a?a.round(this.POINT_ROUNDING):new ac}findRoutePoints(t=[]){const e=this.graph.options.connecting.router||em.presets.normal,n=this.cell.getRouter()||e;let i;if("function"===typeof n)i=Ya(n,this,t,{},this);else{const e="string"===typeof n?n:n.name,s="string"===typeof n?{}:n.args||{},o=e?em.registry.get(e):em.presets.normal;if("function"!==typeof o)return em.registry.onNotFound(e);i=Ya(o,this,t,s,this)}return null==i?t.map((t=>ac.create(t))):i.map((t=>ac.create(t)))}findConnectionPoints(t,e,n){const i=this.cell,s=this.graph.options.connecting,o=i.getSource(),r=i.getTarget(),a=this.sourceView,l=this.targetView,c=t[0],h=t[t.length-1];let u,d;if(a&&!a.isEdgeElement(this.sourceMagnet)){const t=this.sourceMagnet||a.container,i=c||n,r=new cc(i,e),l=o.connectionPoint||s.sourceConnectionPoint||s.connectionPoint;u=this.getConnectionPoint(l,a,t,r,"source")}else u=e;if(l&&!l.isEdgeElement(this.targetMagnet)){const t=this.targetMagnet||l.container,i=r.connectionPoint||s.targetConnectionPoint||s.connectionPoint,o=h||e,a=new cc(o,n);d=this.getConnectionPoint(i,l,t,a,"target")}else d=n;return{source:u,target:d}}getConnectionPoint(t,e,n,i,s){const o=i.end;if(null==t)return o;const r="string"===typeof t?t:t.name,a="string"===typeof t?{}:t.args,l=uf.registry.get(r);if("function"!==typeof l)return uf.registry.onNotFound(r);const c=Ya(l,this,i,e,n,a||{},s);return c?c.round(this.POINT_ROUNDING):o}updateMarkerAttr(t){const e=this.cell.getAttrs(),n=`.${t}-marker`,i=e&&e[n];i&&this.updateAttrs(this.container,{},{attrs:{[n]:i},selectors:this.selectors})}findMarkerPoints(t,e,n){const i=t=>{const e=this.cell.getAttrs(),n=Object.keys(e);for(let i=0,s=n.length;i<s;i+=1){const s=e[n[i]];if(s[`${t}Marker`]||s[`${t}-marker`]){const t=s.strokeWidth||s["stroke-width"];if(t)return parseFloat(t);break}}return null},s=t[0],o=t[t.length-1],r=this.containers.sourceMarker,a=this.containers.targetMarker,l=this.markerCache;let c,h;if(r){if(this.updateMarkerAttr("source"),l.sourceBBox=l.sourceBBox||kh(r),l.sourceBBox.width>0){const t=zh(r);c=e.clone().move(s||n,l.sourceBBox.width*t.sx*-1)}}else{const t=i("source");t&&(c=e.clone().move(s||n,-t))}if(a){if(this.updateMarkerAttr("target"),l.targetBBox=l.targetBBox||kh(a),l.targetBBox.width>0){const t=zh(a);h=n.clone().move(o||e,l.targetBBox.width*t.sx*-1)}}else{const t=i("target");t&&(h=n.clone().move(o||e,-t))}return l.sourcePoint=c||e.clone(),l.targetPoint=h||n.clone(),{source:c,target:h}}findPath(t,e,n){const i=this.cell.getConnector()||this.graph.options.connecting.connector;let s,o,r;if("string"===typeof i?s=i:(s=i.name,o=i.args),s){const t=wm.registry.get(s);if("function"!==typeof t)return wm.registry.onNotFound(s);r=t}else r=wm.presets.normal;const a=Ya(r,this,e,n,t,Object.assign(Object.assign({},o),{raw:!0}),this);return"string"===typeof a?Nc.parse(a):a}translateConnectionPoints(t,e){const n=this.markerCache;n.sourcePoint&&n.sourcePoint.translate(t,e),n.targetPoint&&n.targetPoint.translate(t,e),this.sourcePoint.translate(t,e),this.targetPoint.translate(t,e),this.sourceAnchor.translate(t,e),this.targetAnchor.translate(t,e)}updateLabelPositions(){if(null==this.containers.labels)return this;const t=this.path;if(!t)return this;const e=this.cell,n=e.getLabels();if(0===n.length)return this;const i=e.getDefaultLabel(),s=this.normalizeLabelPosition(i.position);for(let o=0,r=n.length;o<r;o+=1){const t=n[o],e=this.normalizeLabelPosition(t.position),i=Kn({},s,e),r=this.getLabelTransformationMatrix(i);this.labelCache[o].setAttribute("transform",uh(r))}return this}updateToolsPosition(){if(null==this.containers.tools)return this;let t="",e=this.options.toolsOffset;const n=this.getConnectionLength();if(null!=n){n<this.options.shortLength&&(t="scale(.5)",e/=2);let i=this.getPointAtLength(e);if(null!=i&&Bl(this.toolCache,"transform",`translate(${i.x},${i.y}) ${t}`),this.options.doubleTools&&n>=this.options.longLength){const s=this.options.doubleToolsOffset||e;i=this.getPointAtLength(n-s),null!=i&&Bl(this.tool2Cache,"transform",`translate(${i.x},${i.y}) ${t}`),Bl(this.tool2Cache,"visibility","visible")}else this.options.doubleTools&&Bl(this.tool2Cache,"visibility","hidden")}return this}updateArrowheadMarkers(){const t=this.containers.arrowheads;if(null==t)return this;if("none"===t.style.display)return this;const e=this.containers.sourceArrowhead,n=this.containers.targetArrowhead;if(e&&n){const t=this.getConnectionLength()||0,i=t<this.options.shortLength?.5:1;zh(e,i),zh(n,i),this.translateAndAutoOrientArrows(e,n)}return this}updateTerminalProperties(t){const e=this.cell,n=this.graph,i=e[t],s=i&&i.cell,o=`${t}View`;if(!s)return this[o]=null,this.updateTerminalMagnet(t),!0;const r=n.getCellById(s);if(!r)throw new Error(`Edge's ${t} node with id "${s}" not exists`);const a=r.findView(n);return!!a&&(this[o]=a,this.updateTerminalMagnet(t),!0)}updateTerminalMagnet(t){const e=`${t}Magnet`,n=this.getTerminalView(t);if(n){let i=n.getMagnetFromEdgeTerminal(this.cell[t]);i===n.container&&(i=null),this[e]=i}else this[e]=null}translateAndAutoOrientArrows(t,e){const n=this.routePoints;t&&Ih(t,this.sourcePoint,n[0]||this.targetPoint,this.graph.view.stage),e&&Ih(e,this.targetPoint,n[n.length-1]||this.sourcePoint,this.graph.view.stage)}getLabelPositionAngle(t){const e=this.cell.getLabelAt(t);return e&&e.position&&"object"===typeof e.position&&e.position.angle||0}getLabelPositionArgs(t){const e=this.cell.getLabelAt(t);if(e&&e.position&&"object"===typeof e.position)return e.position.options}getDefaultLabelPositionArgs(){const t=this.cell.getDefaultLabel();if(t&&t.position&&"object"===typeof t.position)return t.position.options}mergeLabelPositionArgs(t,e){return null===t?null:void 0===t?null===e?null:e:Kn({},e,t)}addLabel(t,e,n,i){let s,o,r,a=0;"number"!==typeof t?(s=t.x,o=t.y,"number"===typeof e?(a=e,r=n):r=e):(s=t,o=e,"number"===typeof n?(a=n,r=i):r=n);const l=this.getDefaultLabelPositionArgs(),c=r,h=this.mergeLabelPositionArgs(c,l),u={position:this.getLabelPosition(s,o,a,h)},d=-1;return this.cell.insertLabel(u,d,r),d}addVertex(t,e,n){const i="number"!==typeof t,s=i?t.x:t,o=i?t.y:e,r=i?e:n,a={x:s,y:o},l=this.getVertexIndex(s,o);return this.cell.insertVertex(a,l,r),l}sendToken(t,e,n){let i,s,o,r,a="linear";"object"===typeof e?(i=e.duration,s=!0===e.reversed,o=e.selector,!1===e.rotate?r="":!0===e.rotate?r="auto":null!=e.rotate&&(r=`${e.rotate}`),e.timing&&(a=e.timing)):(i=e,s=!1,o=null),i=i||1e3;const l={dur:`${i}ms`,repeatCount:"1",calcMode:a,fill:"freeze"};if(r&&(l.rotate=r),s&&(l.keyPoints="1;0",l.keyTimes="0;1"),"object"===typeof e){const{duration:t,reversed:n,selector:i,rotate:s,timing:o}=e,r=Vm(e,["duration","reversed","selector","rotate","timing"]);Object.keys(r).forEach((t=>{l[t]=r[t]}))}let c;if(c="string"===typeof o?this.findOne(o,this.container,this.selectors):this.containers.connection?this.containers.connection:this.container.querySelector("path"),!(c instanceof SVGPathElement))throw new Error("Token animation requires a valid connection path.");const h="string"===typeof t?this.findOne(t):t;if(null==h)throw new Error("Token animation requires a valid token element.");const u=h.parentNode,d=()=>{u||Sl(h)},g=jc.create(h);u||g.appendTo(this.graph.view.stage);const p=l.complete;l.complete=t=>{d(),n&&n(),p&&p(t)};const f=g.animateAlongPath(l,c);return()=>{d(),f()}}getConnection(){return null!=this.path?this.path.clone():null}getConnectionPathData(){if(null==this.path)return"";const t=this.cache.pathCache;return mn(t,"data")||(t.data=this.path.serialize()),t.data||""}getConnectionSubdivisions(){if(null==this.path)return null;const t=this.cache.pathCache;return mn(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions}getConnectionLength(){if(null==this.path)return 0;const t=this.cache.pathCache;return mn(t,"length")||(t.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),t.length}getPointAtLength(t){return null==this.path?null:this.path.pointAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(t){return null==this.path?null:(Ra(t)&&(t=parseFloat(t)/100),this.path.pointAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(t){return null==this.path?null:this.path.tangentAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(t){return null==this.path?null:this.path.tangentAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(t){return null==this.path?null:this.path.closestPoint(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(t){return null==this.path?null:this.path.closestPointLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(t){return null==this.path?null:this.path.closestPointNormalizedLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(t,e,n,i){const s={distance:0};let o,r=0;"number"===typeof n?(r=n,o=i):o=n,null!=o&&(s.options=o);const a=o&&o.absoluteOffset,l=!(o&&o.absoluteDistance),c=o&&o.absoluteDistance&&o.reverseDistance,h=this.path,u={segmentSubdivisions:this.getConnectionSubdivisions()},d=new ac(t,e),g=h.closestPointT(d,u),p=this.getConnectionLength()||0;let f,m,y=h.lengthAtT(g,u);if(l&&(y=p>0?y/p:0),c&&(y=-1*(p-y)||1),s.distance=y,a||(f=h.tangentAtT(g)),f)m=f.pointOffset(d);else{const t=h.pointAtT(g),e=d.diff(t);m={x:e.x,y:e.y}}return s.offset=m,s.angle=r,s}normalizeLabelPosition(t){return"number"===typeof t?{distance:t}:t}getLabelTransformationMatrix(t){const e=this.normalizeLabelPosition(t),n=e.options||{},i=e.angle||0,s=e.distance,o=s>0&&s<=1;let r=0;const a={x:0,y:0},l=e.offset;l&&("number"===typeof l?r=l:(null!=l.x&&(a.x=l.x),null!=l.y&&(a.y=l.y)));const c=0!==a.x||0!==a.y||0===r,h=n.keepGradient,u=n.ensureLegibility,d=this.path,g={segmentSubdivisions:this.getConnectionSubdivisions()},p=o?s*this.getConnectionLength():s,f=d.tangentAtLength(p,g);let m,y=i;if(f){if(c)m=f.start,m.translate(a);else{const t=f.clone();t.rotate(-90,f.start),t.setLength(r),m=t.end}h&&(y=f.angle()+i,u&&(y=Ql.normalize((y+90)%180-90)))}else m=d.start,c&&m.translate(a);return lh().translate(m.x,m.y).rotate(y)}getLabelCoordinates(t){const e=this.getLabelTransformationMatrix(t);return new ac(e.e,e.f)}getVertexIndex(t,e){const n=this.cell,i=n.getVertices(),s=this.getClosestPointLength(new ac(t,e));let o=0;if(null!=s)for(const r=i.length;o<r;o+=1){const t=i[o],e=this.getClosestPointLength(t);if(null!=e&&s<e)break}return o}getEventArgs(t,e,n){const i=this,s=i.cell,o=s;return null==e||null==n?{e:t,view:i,edge:s,cell:o}:{e:t,x:e,y:n,view:i,edge:s,cell:o}}notifyUnhandledMouseDown(t,e,n){this.notify("edge:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("edge:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("edge:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("edge:mouseup",this.getEventArgs(t,e,n))}onClick(t,e,n){super.onClick(t,e,n),this.notify("edge:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("edge:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("edge:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.notifyMouseDown(t,e,n);const i=t.target.getAttribute("class");switch(i){case"vertex":return void this.startVertexDragging(t,e,n);case"vertex-remove":case"vertex-remove-area":return void this.handleVertexRemoving(t,e,n);case"connection":case"connection-wrap":return void this.handleVertexAdding(t,e,n);case"arrowhead":return void this.startArrowheadDragging(t,e,n);case"source-marker":case"target-marker":return void this.notifyUnhandledMouseDown(t,e,n);default:break}this.startEdgeDragging(t,e,n)}onMouseMove(t,e,n){const i=this.getEventData(t);switch(i.action){case"drag-vertex":this.dragVertex(t,e,n);break;case"drag-label":this.dragLabel(t,e,n);break;case"drag-arrowhead":this.dragArrowhead(t,e,n);break;case"drag-edge":this.dragEdge(t,e,n);break;default:break}return this.notifyMouseMove(t,e,n),i}onMouseUp(t,e,n){const i=this.getEventData(t);switch(i.action){case"drag-vertex":this.stopVertexDragging(t,e,n);break;case"drag-label":this.stopLabelDragging(t,e,n);break;case"drag-arrowhead":this.stopArrowheadDragging(t,e,n);break;case"drag-edge":this.stopEdgeDragging(t,e,n);break;default:break}return this.notifyMouseUp(t,e,n),this.checkMouseleave(t),i}onMouseOver(t){super.onMouseOver(t),this.notify("edge:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("edge:mouseout",this.getEventArgs(t))}onMouseEnter(t){super.onMouseEnter(t),this.notify("edge:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("edge:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,i){super.onMouseWheel(t,e,n,i),this.notify("edge:mousewheel",Object.assign({delta:i},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,i){const s=El(t.target,"edge-tool",this.container);if(s){if(t.stopPropagation(),this.can("useEdgeTools")){if("edge:remove"===e)return void this.cell.remove({ui:!0});this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,i)))}this.notifyMouseDown(t,n,i)}else this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,i))),super.onCustomEvent(t,e,n,i)}onLabelMouseDown(t,e,n){this.notifyMouseDown(t,e,n),this.startLabelDragging(t,e,n);const i=this.getEventData(t).stopPropagation;i&&t.stopPropagation()}startEdgeDragging(t,e,n){this.can("edgeMovable")?this.setEventData(t,{x:e,y:n,moving:!1,action:"drag-edge"}):this.notifyUnhandledMouseDown(t,e,n)}dragEdge(t,e,n){const i=this.getEventData(t);i.moving||(i.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(e-i.x,n-i.y,{ui:!0}),this.setEventData(t,{x:e,y:n}),this.notify("edge:moving",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(t,e,n){const i=this.getEventData(t);i.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),i.moving=!1}prepareArrowheadDragging(t,e){const n=this.getTerminalMagnet(t),i={action:"drag-arrowhead",x:e.x,y:e.y,isNewEdge:!0===e.isNewEdge,terminalType:t,initialMagnet:n,initialTerminal:ci.Z(this.cell[t]),fallbackAction:e.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(t),options:e.options};return this.beforeArrowheadDragging(i),i}createValidateConnectionArgs(t){const e=[];let n;e[4]=t,e[5]=this;let i=0,s=0;"source"===t?(i=2,n="target"):(s=2,n="source");const o=this.cell[n],r=o.cell;if(r){let t;const n=e[i]=this.graph.renderer.findViewByCell(r);n&&(t=n.getMagnetFromEdgeTerminal(o),t===n.container&&(t=void 0)),e[i+1]=t}return(t,n)=>(e[s]=t,e[s+1]=t.container===n?void 0:n,e)}beforeArrowheadDragging(t){t.zIndex=this.cell.zIndex,this.cell.toFront();const e=this.container.style;t.pointerEvents=e.pointerEvents,e.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(t)}afterArrowheadDragging(t){null!=t.zIndex&&(this.cell.setZIndex(t.zIndex,{ui:!0}),t.zIndex=null);const e=this.container;e.style.pointerEvents=t.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(t)}arrowheadDragging(t,e,n,i){i.x=e,i.y=n,i.currentTarget!==t&&(i.currentMagnet&&i.currentView&&i.currentView.unhighlight(i.currentMagnet,{type:"magnetAdsorbed"}),i.currentView=this.graph.renderer.findViewByElem(t),i.currentView?(i.currentMagnet=i.currentView.findMagnet(t),i.currentMagnet&&this.graph.hook.validateConnection(...i.getValidateConnectionArgs(i.currentView,i.currentMagnet),i.currentView.getEdgeTerminal(i.currentMagnet,e,n,this.cell,i.terminalType))?i.currentView.highlight(i.currentMagnet,{type:"magnetAdsorbed"}):i.currentMagnet=null):i.currentMagnet=null),i.currentTarget=t,this.cell.prop(i.terminalType,{x:e,y:n},Object.assign(Object.assign({},i.options),{ui:!0}))}arrowheadDragged(t,e,n){const i=t.currentView,s=t.currentMagnet;if(!s||!i)return;i.unhighlight(s,{type:"magnetAdsorbed"});const o=t.terminalType,r=i.getEdgeTerminal(s,e,n,this.cell,o);this.cell.setTerminal(o,r,{ui:!0})}snapArrowhead(t,e,n){const i=this.graph,s=i.options.connecting.snap,o="object"===typeof s&&s.radius||50,r=i.renderer.findViewsInArea({x:t-o,y:e-o,width:2*o,height:2*o}),a=n.closestView||null,l=n.closestMagnet||null;let c;n.closestView=null,n.closestMagnet=null;let h=Number.MAX_SAFE_INTEGER;const u=new ac(t,e);let d;r.forEach((s=>{"false"!==s.container.getAttribute("magnet")&&(c=s.cell.getBBox().getCenter().distance(u),c<o&&c<h&&(l===s.container||i.hook.validateConnection(...n.getValidateConnectionArgs(s,null),s.getEdgeTerminal(s.container,t,e,this.cell,n.terminalType)))&&(h=c,n.closestView=s,n.closestMagnet=s.container)),s.container.querySelectorAll("[magnet]").forEach((r=>{if("false"!==r.getAttribute("magnet")){const a=s.getBBoxOfElement(r);c=u.distance(a.getCenter()),c<o&&c<h&&(l===r||i.hook.validateConnection(...n.getValidateConnectionArgs(s,r),s.getEdgeTerminal(r,t,e,this.cell,n.terminalType)))&&(h=c,n.closestView=s,n.closestMagnet=r)}}))}));const g=n.terminalType,p=n.closestView,f=n.closestMagnet,m=l!==f;if(a&&m&&a.unhighlight(l,{type:"magnetAdsorbed"}),p){if(!m)return;p.highlight(f,{type:"magnetAdsorbed"}),d=p.getEdgeTerminal(f,t,e,this.cell,g)}else d={x:t,y:e};this.cell.setTerminal(g,d,{},Object.assign(Object.assign({},n.options),{ui:!0}))}snapArrowheadEnd(t){const e=t.closestView,n=t.closestMagnet;e&&n&&(e.unhighlight(n,{type:"magnetAdsorbed"}),t.currentMagnet=e.findMagnet(n)),t.closestView=null,t.closestMagnet=null}finishEmbedding(t){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(t.zIndex=null)}fallbackConnection(t){switch(t.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(t.terminalType,t.initialTerminal,{ui:!0});break}}notifyConnectionEvent(t,e){const n=t.terminalType,i=t.initialTerminal,s=this.cell[n],o=s&&!$m.equalTerminals(i,s);if(o){const o=this.graph,r=i,a=r.cell?o.getCellById(r.cell):null,l=r.port,c=a?o.findViewByCell(a):null,h=a||t.isNewEdge?null:ac.create(i).toJSON(),u=s,d=u.cell?o.getCellById(u.cell):null,g=u.port,p=d?o.findViewByCell(d):null,f=d?null:ac.create(s).toJSON();this.notify("edge:connected",{e:e,previousCell:a,previousPort:l,previousView:c,previousPoint:h,currentCell:d,currentView:p,currentPort:g,currentPoint:f,previousMagnet:t.initialMagnet,currentMagnet:t.currentMagnet,edge:this.cell,view:this,type:n,isNew:t.isNewEdge})}}highlightAvailableMagnets(t){const e=this.graph,n=e.model.getCells();t.marked={};for(let i=0,s=n.length;i<s;i+=1){const s=e.renderer.findViewByCell(n[i]);if(!s)continue;const o=Array.prototype.slice.call(s.container.querySelectorAll("[magnet]"));"false"!==s.container.getAttribute("magnet")&&o.push(s.container);const r=o.filter((n=>e.hook.validateConnection(...t.getValidateConnectionArgs(s,n),s.getEdgeTerminal(n,t.x,t.y,this.cell,t.terminalType))));if(r.length>0){for(let t=0,e=r.length;t<e;t+=1)s.highlight(r[t],{type:"magnetAvailable"});s.highlight(null,{type:"nodeAvailable"}),t.marked[s.cell.id]=r}}}unhighlightAvailableMagnets(t){const e=t.marked||{};Object.keys(e).forEach((t=>{const n=this.graph.renderer.findViewByCell(t);if(n){const i=e[t];i.forEach((t=>{n.unhighlight(t,{type:"magnetAvailable"})})),n.unhighlight(null,{type:"nodeAvailable"})}})),t.marked=null}startArrowheadDragging(t,e,n){if(!this.can("arrowheadMovable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=t.target,s=i.getAttribute("data-terminal"),o=this.prepareArrowheadDragging(s,{x:e,y:n});this.setEventData(t,o)}dragArrowhead(t,e,n){const i=this.getEventData(t);this.graph.options.connecting.snap?this.snapArrowhead(e,n,i):this.arrowheadDragging(this.getEventTarget(t),e,n,i)}stopArrowheadDragging(t,e,n){const i=this.graph,s=this.getEventData(t);i.options.connecting.snap?this.snapArrowheadEnd(s):this.arrowheadDragged(s,e,n);const o=i.hook.validateEdge(this.cell,s.terminalType,s.initialTerminal);o?(this.finishEmbedding(s),this.notifyConnectionEvent(s,t)):this.fallbackConnection(s),this.afterArrowheadDragging(s)}startLabelDragging(t,e,n){if(this.can("edgeLabelMovable")){const e=t.currentTarget,n=parseInt(e.getAttribute("data-index"),10),i=this.getLabelPositionAngle(n),s=this.getLabelPositionArgs(n),o=this.getDefaultLabelPositionArgs(),r=this.mergeLabelPositionArgs(s,o);this.setEventData(t,{index:n,positionAngle:i,positionArgs:r,stopPropagation:!0,action:"drag-label"})}else this.setEventData(t,{stopPropagation:!0});this.graph.view.delegateDragEvents(t,this)}dragLabel(t,e,n){const i=this.getEventData(t),s=this.cell.getLabelAt(i.index),o=Kn({},s,{position:this.getLabelPosition(e,n,i.positionAngle,i.positionArgs)});this.cell.setLabelAt(i.index,o)}stopLabelDragging(t,e,n){}handleVertexAdding(t,e,n){if(!this.can("vertexAddable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=this.addVertex({x:e,y:n},{ui:!0});this.setEventData(t,{index:i,action:"drag-vertex"})}handleVertexRemoving(t,e,n){if(!this.can("vertexDeletable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=t.target,s=parseInt(i.getAttribute("idx"),10);this.cell.removeVertexAt(s)}startVertexDragging(t,e,n){if(!this.can("vertexMovable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=t.target,s=parseInt(i.getAttribute("idx"),10);this.setEventData(t,{index:s,action:"drag-vertex"})}dragVertex(t,e,n){const i=this.getEventData(t);this.cell.setVertexAt(i.index,{x:e,y:n},{ui:!0})}stopVertexDragging(t,e,n){}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNodeView&&"function"===typeof i.isEdgeView&&"function"===typeof i.confirmUpdate&&"function"===typeof i.update&&"function"===typeof i.getConnection}t.toStringTag=`X6.${t.name}`,t.isEdgeView=e})(_m||(_m={})),_m.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],vertices:["vertices","update"],vertexMarkup:["vertices"],toolMarkup:["tools"],tools:["widget"]},shortLength:105,longLength:155,toolsOffset:40,doubleTools:!1,doubleToolsOffset:65,sampleInterval:50}),_m.registry.register("edge",_m,!0);class Gm extends up{constructor(){super(...arguments),this.scalableNode=null,this.rotatableNode=null,this.scalableSelector="scalable",this.rotatableSelector="rotatable",this.defaultPortMarkup=rp.getPortMarkup(),this.defaultPortLabelMarkup=rp.getPortLabelMarkup(),this.defaultPortContainerMarkup=rp.getPortContainerMarkup(),this.portsCache={}}get[Symbol.toStringTag](){return Gm.toStringTag}getContainerClassName(){const t=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||t.push(this.prefixClassName("node-immovable")),t.join(" ")}updateClassName(t){const e=t.target;if(e.hasAttribute("magnet")){const t=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?al(e,t):rl(e,t)}else{const t=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(t):this.addClass(t)}}isNodeView(){return!0}confirmUpdate(t,e={}){let n=t;return this.hasAction(n,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","resize","translate","rotate","ports","tools"])):(n=this.handleAction(n,"resize",(()=>this.resize(e)),"update"),n=this.handleAction(n,"update",(()=>this.update()),Zd.useCSSSelector?"ports":null),n=this.handleAction(n,"translate",(()=>this.translate())),n=this.handleAction(n,"rotate",(()=>this.rotate())),n=this.handleAction(n,"ports",(()=>this.renderPorts())),n=this.handleAction(n,"tools",(()=>this.renderTools()))),n}update(t){this.cleanCache(),Zd.useCSSSelector&&this.removePorts();const e=this.cell,n=e.getSize(),i=e.getAttrs();this.updateAttrs(this.container,i,{attrs:t===i?null:t,rootBBox:new lc(0,0,n.width,n.height),selectors:this.selectors,scalableNode:this.scalableNode,rotatableNode:this.rotatableNode}),Zd.useCSSSelector&&this.renderPorts()}renderMarkup(){const t=this.cell.markup;if(t)return"string"===typeof t?this.renderStringMarkup(t):this.renderJSONMarkup(t);throw new TypeError("Invalid node markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container),n=t=>Array.isArray(t)?t[0]:t;this.selectors=e.selectors,this.rotatableNode=n(this.selectors[this.rotatableSelector]),this.scalableNode=n(this.selectors[this.scalableSelector]),this.container.appendChild(e.fragment)}renderStringMarkup(t){Dl(this.container,jc.toNodes(jc.createVectors(t))),this.rotatableNode=kl(this.container,`.${this.rotatableSelector}`),this.scalableNode=kl(this.container,`.${this.scalableSelector}`),this.selectors={},this.rootSelector&&(this.selectors[this.rootSelector]=this.container)}render(){return this.empty(),this.renderMarkup(),this.scalableNode&&this.update(),this.resize(),this.rotatableNode?(this.rotate(),this.translate()):this.updateTransform(),Zd.useCSSSelector||this.renderPorts(),this.renderTools(),this}resize(t={}){if(this.scalableNode)return this.updateSize(t);this.cell.getAngle()&&this.rotate(),this.update()}translate(){if(this.rotatableNode)return this.updateTranslation();this.updateTransform()}rotate(){if(this.rotatableNode)return this.updateRotation(),void this.update();this.updateTransform()}getTranslationString(){const t=this.cell.getPosition();return`translate(${t.x},${t.y})`}getRotationString(){const t=this.cell.getAngle();if(t){const e=this.cell.getSize();return`rotate(${t},${e.width/2},${e.height/2})`}}updateTransform(){let t=this.getTranslationString();const e=this.getRotationString();e&&(t+=` ${e}`),this.container.setAttribute("transform",t)}updateRotation(){if(null!=this.rotatableNode){const t=this.getRotationString();null!=t?this.rotatableNode.setAttribute("transform",t):this.rotatableNode.removeAttribute("transform")}}updateTranslation(){this.container.setAttribute("transform",this.getTranslationString())}updateSize(t={}){const e=this.cell,n=e.getSize(),i=e.getAngle(),s=this.scalableNode;let o=!1;s.getElementsByTagName("path").length>0&&(o=!0);const r=kh(s,{recursive:o}),a=n.width/(r.width||1),l=n.height/(r.height||1);s.setAttribute("transform",`scale(${a},${l})`);const c=this.rotatableNode;if(null!=c){const o=c.getAttribute("transform");if(o){c.setAttribute("transform",`${o} rotate(${-i},${n.width/2},${n.height/2})`);const r=kh(s,{target:this.graph.view.stage});e.prop("position",{x:r.x,y:r.y},Object.assign({updated:!0},t)),this.translate(),this.rotate()}}this.update()}findPortElem(t,e){const n=t?this.portsCache[t]:null;if(!n)return null;const i=n.portContentElement,s=n.portContentSelectors||{};return this.findOne(e,i,s)}initializePorts(){this.cleanPortsCache()}refreshPorts(){this.removePorts(),this.cleanPortsCache(),this.renderPorts()}cleanPortsCache(){this.portsCache={}}removePorts(){Object.keys(this.portsCache).forEach((t=>{const e=this.portsCache[t];Sl(e.portElement)}))}renderPorts(){const t=this.getPortsContainer(),e=[];t.childNodes.forEach((t=>{e.push(t)}));const n=Ke(this.cell.getParsedPorts(),"zIndex"),i="auto";n[i]&&n[i].forEach((n=>{const i=this.getPortElement(n);t.append(i),e.push(i)})),Object.keys(n).forEach((t=>{if(t!==i){const i=parseInt(t,10);this.appendPorts(n[t],i,e)}})),this.updatePorts()}getPortsContainer(){return this.rotatableNode||this.container}appendPorts(t,e,n){const i=t.map((t=>this.getPortElement(t)));n[e]||e<0?Ol(n[Math.max(e,0)],i):Dl(this.getPortsContainer(),i)}getPortElement(t){const e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)}createPortElement(t){let e=rp.renderMarkup(this.getPortContainerMarkup());const n=e.elem;if(null==n)throw new Error("Invalid port container markup.");e=rp.renderMarkup(this.getPortMarkup(t));const i=e.elem,s=e.selectors;if(null==i)throw new Error("Invalid port markup.");this.setAttrs({port:t.id,"port-group":t.group},i),e=rp.renderMarkup(this.getPortLabelMarkup(t.label));const o=e.elem,r=e.selectors;if(null==o)throw new Error("Invalid port label markup.");let a;if(s&&r){for(const t in r)if(s[t]&&t!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},s),r)}else a=s||r;return rl(n,"x6-port"),rl(i,"x6-port-body"),rl(o,"x6-port-label"),n.appendChild(i),n.appendChild(o),this.portsCache[t.id]={portElement:n,portSelectors:a,portLabelElement:o,portLabelSelectors:r,portContentElement:i,portContentSelectors:s},this.graph.hook.onPortRendered({port:t,node:this.cell,container:n,selectors:a,labelContainer:o,labelSelectors:r,contentContainer:i,contentSelectors:s}),n}updatePorts(){this.updatePortGroup();const t=this.cell.getParsedGroups();Object.keys(t).forEach((t=>this.updatePortGroup(t)))}updatePortGroup(t){const e=lc.fromSize(this.cell.getSize()),n=this.cell.getPortsLayoutByGroup(t,e);for(let i=0,s=n.length;i<s;i+=1){const t=n[i],e=t.portId,s=this.portsCache[e]||{},o=t.portLayout;if(this.applyPortTransform(s.portElement,o),null!=t.portAttrs){const e={selectors:s.portSelectors||{}};t.portSize&&(e.rootBBox=lc.fromSize(t.portSize)),this.updateAttrs(s.portElement,t.portAttrs,e)}const r=t.labelLayout;if(r&&(this.applyPortTransform(s.portLabelElement,r,-(o.angle||0)),r.attrs)){const e={selectors:s.portLabelSelectors||{}};t.labelSize&&(e.rootBBox=lc.fromSize(t.labelSize)),this.updateAttrs(s.portLabelElement,r.attrs,e)}}}applyPortTransform(t,e,n=0){const i=e.angle,s=e.position,o=lh().rotate(n).translate(s.x||0,s.y||0).rotate(i||0);jh(t,o,{absolute:!0})}getPortContainerMarkup(){return this.cell.getPortContainerMarkup()||this.defaultPortContainerMarkup}getPortMarkup(t){return t.markup||this.cell.portMarkup||this.defaultPortMarkup}getPortLabelMarkup(t){return t.markup||this.cell.portLabelMarkup||this.defaultPortLabelMarkup}getEventArgs(t,e,n){const i=this,s=i.cell,o=s;return null==e||null==n?{e:t,view:i,node:s,cell:o}:{e:t,x:e,y:n,view:i,node:s,cell:o}}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("node:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("node:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("node:mouseup",this.getEventArgs(t,e,n))}onClick(t,e,n){super.onClick(t,e,n),this.notify("node:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("node:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("node:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.isPropagationStopped(t)||(this.notifyMouseDown(t,e,n),this.startNodeDragging(t,e,n))}onMouseMove(t,e,n){const i=this.getEventData(t),s=i.action;if("magnet"===s)this.dragMagnet(t,e,n);else{if("move"===s){const s=i,o=s.targetView||this;o.dragNode(t,e,n),o.notify("node:moving",{e:t,x:e,y:n,view:o,cell:o.cell,node:o.cell})}this.notifyMouseMove(t,e,n)}this.setEventData(t,i)}onMouseUp(t,e,n){const i=this.getEventData(t),s=i.action;if("magnet"===s)this.stopMagnetDragging(t,e,n);else if(this.notifyMouseUp(t,e,n),"move"===s){const s=i,o=s.targetView||this;o.stopNodeDragging(t,e,n)}const o=i.targetMagnet;o&&this.onMagnetClick(t,o,e,n),this.checkMouseleave(t)}onMouseOver(t){super.onMouseOver(t),this.notify("node:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("node:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.updateClassName(t),super.onMouseEnter(t),this.notify("node:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("node:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,i){super.onMouseWheel(t,e,n,i),this.notify("node:mousewheel",Object.assign({delta:i},this.getEventArgs(t,e,n)))}onMagnetClick(t,e,n,i){const s=this.graph.view.getMouseMovedCount(t);s>this.graph.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:e},this.getEventArgs(t,n,i)))}onMagnetDblClick(t,e,n,i){this.notify("node:magnet:dblclick",Object.assign({magnet:e},this.getEventArgs(t,n,i)))}onMagnetContextMenu(t,e,n,i){this.notify("node:magnet:contextmenu",Object.assign({magnet:e},this.getEventArgs(t,n,i)))}onMagnetMouseDown(t,e,n,i){this.startMagnetDragging(t,n,i)}onCustomEvent(t,e,n,i){this.notify("node:customevent",Object.assign({name:e},this.getEventArgs(t,n,i))),super.onCustomEvent(t,e,n,i)}prepareEmbedding(t){const e=this.getEventData(t),n=e.cell||this.cell,i=this.graph.findViewByCell(n),s=this.graph.snapToGrid(t.clientX,t.clientY);this.notify("node:embed",{e:t,node:n,view:i,cell:n,x:s.x,y:s.y,currentParent:n.getParent()})}processEmbedding(t,e){const n=e.cell||this.cell,i=e.graph||this.graph,s=i.options.embedding,o=s.findParent;let r="function"===typeof o?Ya(o,i,{view:this,node:this.cell}).filter((t=>Sm.isCell(t)&&this.cell.id!==t.id&&!t.isDescendantOf(this.cell))):i.model.getNodesUnderNode(n,{by:o});s.frontOnly&&(r=r.slice(-1));let a=null;const l=e.candidateEmbedView,c=s.validate;for(let u=r.length-1;u>=0;u-=1){const t=r[u];if(l&&l.cell.id===t.id){a=l;break}{const e=t.findView(i);if(Ya(c,i,{child:this.cell,parent:e.cell,childView:this,parentView:e})){a=e;break}}}this.clearEmbedding(e),a&&a.highlight(null,{type:"embedding"}),e.candidateEmbedView=a;const h=i.snapToGrid(t.clientX,t.clientY);this.notify("node:embedding",{e:t,cell:n,node:n,view:i.findViewByCell(n),x:h.x,y:h.y,currentParent:n.getParent(),candidateParent:a?a.cell:null})}clearEmbedding(t){const e=t.candidateEmbedView;e&&(e.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null)}finalizeEmbedding(t,e){const n=e.cell||this.cell,i=e.graph||this.graph,s=i.findViewByCell(n),o=n.getParent(),r=e.candidateEmbedView;r?(r.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null,null!=o&&o.id===r.cell.id||r.cell.insertChild(n,void 0,{ui:!0})):o&&o.unembed(n,{ui:!0}),i.model.getConnectedEdges(n,{deep:!0}).forEach((t=>{t.updateParent({ui:!0})}));const a=i.snapToGrid(t.clientX,t.clientY);s&&s.notify("node:embedded",{e:t,cell:n,x:a.x,y:a.y,node:n,view:i.findViewByCell(n),previousParent:o,currentParent:n.getParent()})}getDelegatedView(){let t=this.cell,e=this;while(e){if(t.isEdge())break;if(!t.hasParent()||e.can("stopDelegateOnDragging"))return e;t=t.getParent(),e=this.graph.renderer.findViewByCell(t)}return null}startMagnetDragging(t,e,n){if(!this.can("magnetConnectable"))return;t.stopPropagation();const i=t.currentTarget,s=this.graph;this.setEventData(t,{targetMagnet:i}),s.hook.validateMagnet(this,i,t)?(s.options.magnetThreshold<=0&&this.startConnectting(t,i,e,n),this.setEventData(t,{action:"magnet"}),this.stopPropagation(t)):this.onMouseDown(t,e,n),s.view.delegateDragEvents(t,this)}startConnectting(t,e,n,i){this.graph.model.startBatch("add-edge");const s=this.createEdgeFromMagnet(e,n,i);s.notifyMouseDown(t,n,i),s.setEventData(t,s.prepareArrowheadDragging("target",{x:n,y:i,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(t,{edgeView:s})}createEdgeFromMagnet(t,e,n){const i=this.graph,s=i.model,o=i.hook.getDefaultEdge(this,t);return o.setSource(Object.assign(Object.assign({},o.getSource()),this.getEdgeTerminal(t,e,n,o,"source"))),o.setTarget(Object.assign(Object.assign({},o.getTarget()),{x:e,y:n})),o.addTo(s,{async:!1,ui:!0}),o.findView(i)}dragMagnet(t,e,n){const i=this.getEventData(t),s=i.edgeView;if(s)s.onMouseMove(t,e,n),this.autoScrollGraph(t.clientX,t.clientY);else{const s=this.graph,o=s.options.magnetThreshold,r=this.getEventTarget(t),a=i.targetMagnet;if("onleave"===o){if(a===r||a.contains(r))return}else if(s.view.getMouseMovedCount(t)<=o)return;this.startConnectting(t,a,e,n)}}stopMagnetDragging(t,e,n){const i=this.eventData(t),s=i.edgeView;s&&(s.onMouseUp(t,e,n),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(t,e,n){this.notify("node:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(t,e,n,i,s){let o=[s];const r=this.graph.selection.widget;if(r&&r.options.movable){const t=this.graph.getSelectedCells();t.includes(s)&&(o=t.filter((t=>t.isNode())))}o.forEach((s=>{this.notify(t,{e:e,x:n,y:i,cell:s,node:s,view:s.findView(this.graph)})}))}startNodeDragging(t,e,n){const i=this.getDelegatedView();if(null==i||!i.can("nodeMovable"))return this.notifyUnhandledMouseDown(t,e,n);this.setEventData(t,{targetView:i,action:"move"});const s=ac.create(i.cell.getPosition());i.setEventData(t,{moving:!1,offset:s.diff(e,n),restrict:this.graph.hook.getRestrictArea(i)})}dragNode(t,e,n){const i=this.cell,s=this.graph,o=s.getGridSize(),r=this.getEventData(t),a=r.offset,l=r.restrict;r.moving||(r.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",t,e,n,this.cell)),this.autoScrollGraph(t.clientX,t.clientY);const c=Xd.snapToGrid(e+a.x,o),h=Xd.snapToGrid(n+a.y,o);i.setPosition(c,h,{restrict:l,deep:!0,ui:!0}),s.options.embedding.enabled&&(r.embedding||(this.prepareEmbedding(t),r.embedding=!0),this.processEmbedding(t,r))}stopNodeDragging(t,e,n){const i=this.getEventData(t);i.embedding&&this.finalizeEmbedding(t,i),i.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",t,e,n,this.cell)),i.moving=!1,i.embedding=!1}autoScrollGraph(t,e){const n=this.graph.scroller.widget;n&&n.autoScroll(t,e)}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNodeView&&"function"===typeof i.isEdgeView&&"function"===typeof i.confirmUpdate&&"function"===typeof i.update&&"function"===typeof i.findPortElem&&"function"===typeof i.resize&&"function"===typeof i.rotate&&"function"===typeof i.translate}t.toStringTag=`X6.${t.name}`,t.isNodeView=e})(Gm||(Gm={})),Gm.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),Gm.registry.register("node",Gm,!0);const Hm=Fm("text");class Um extends(zm("text",{view:Hm,attrs:{text:{fontSize:18,fill:"#000000",stroke:null,refX:.5,refY:.5}}},{noText:!0})){}(function(t){class e extends Gm{confirmUpdate(t,e={}){let n=super.confirmUpdate(t,e);return this.hasAction(n,"scale")&&(this.resize(),n=this.removeAction(n,"scale")),n}}t.View=e,e.config({actions:{attrs:["scale"]}}),Gm.registry.register(Hm,e)})(Um||(Um={}));class Wm extends Vg{constructor(t,e={}){super(),this.length=0,this.comparator=e.comparator||"zIndex",this.clean(),t&&this.reset(t,{silent:!0})}toJSON(){return this.cells.map((t=>t.toJSON()))}add(t,e,n){let i,s;"number"===typeof e?(i=e,s=Object.assign({merge:!1},n)):(i=this.length,s=Object.assign({merge:!1},e)),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);const o=Array.isArray(t)?t:[t],r=this.comparator&&"number"!==typeof e&&!1!==s.sort,a=this.comparator||null;let l=!1;const c=[],h=[];return o.forEach((t=>{const e=this.get(t);e?s.merge&&!t.isSameStore(e)&&(e.setProp(t.getProp(),n),h.push(e),r&&!l&&(l=null==a||"function"===typeof a?e.hasChanged():"string"===typeof a?e.hasChanged(a):a.some((t=>e.hasChanged(t))))):(c.push(t),this.reference(t))})),c.length&&(r&&(l=!0),this.cells.splice(i,0,...c),this.length=this.cells.length),l&&this.sort({silent:!0}),s.silent||(c.forEach(((t,e)=>{const n={cell:t,index:i+e,options:s};this.trigger("added",n),s.dryrun||t.notify("added",Object.assign({},n))})),l&&this.trigger("sorted"),(c.length||h.length)&&this.trigger("updated",{added:c,merged:h,removed:[],options:s})),this}remove(t,e={}){const n=Array.isArray(t)?t:[t],i=this.removeCells(n,e);return!e.silent&&i.length>0&&this.trigger("updated",{options:e,removed:i,added:[],merged:[]}),Array.isArray(t)?i:i[0]}removeCells(t,e){const n=[];for(let i=0;i<t.length;i+=1){const s=this.get(t[i]);if(null==s)continue;const o=this.cells.indexOf(s);this.cells.splice(o,1),this.length-=1,delete this.map[s.id],n.push(s),this.unreference(s),e.dryrun||s.remove(),e.silent||(this.trigger("removed",{cell:s,index:o,options:e}),e.dryrun||s.notify("removed",{cell:s,index:o,options:e}))}return n}reset(t,e={}){const n=this.cells.slice();if(n.forEach((t=>this.unreference(t))),this.clean(),this.add(t,Object.assign({silent:!0},e)),!e.silent){const t=this.cells.slice();this.trigger("reseted",{options:e,previous:n,current:t});const i=[],s=[];t.forEach((t=>{const e=n.some((e=>e.id===t.id));e||i.push(t)})),n.forEach((e=>{const n=t.some((t=>t.id===e.id));n||s.push(e)})),this.trigger("updated",{options:e,added:i,removed:s,merged:[]})}return this}push(t,e){return this.add(t,this.length,e)}pop(t){const e=this.at(this.length-1);return this.remove(e,t)}unshift(t,e){return this.add(t,0,e)}shift(t){const e=this.at(0);return this.remove(e,t)}get(t){if(null==t)return null;const e="string"===typeof t||"number"===typeof t?t:t.id;return this.map[e]||null}has(t){return null!=this.get(t)}at(t){return t<0&&(t+=this.length),this.cells[t]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(t){return this.cells.indexOf(t)}toArray(){return this.cells.slice()}sort(t={}){return null!=this.comparator&&(this.cells=Ve(this.cells,this.comparator),t.silent||this.trigger("sorted")),this}clone(){const t=this.constructor;return new t(this.cells.slice(),{comparator:this.comparator})}reference(t){this.map[t.id]=t,t.on("*",this.notifyCellEvent,this)}unreference(t){t.off("*",this.notifyCellEvent,this),delete this.map[t.id]}notifyCellEvent(t,e){const n=e.cell;this.trigger(`cell:${t}`,e),n&&(n.isNode()?this.trigger(`node:${t}`,Object.assign(Object.assign({},e),{node:n})):n.isEdge()&&this.trigger(`edge:${t}`,Object.assign(Object.assign({},e),{edge:n})))}clean(){this.length=0,this.cells=[],this.map={}}}class qm extends Vg{constructor(t=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new Wm(t),this.setup()}get[Symbol.toStringTag](){return qm.toStringTag}notify(t,e){this.trigger(t,e);const n=this.graph;return n&&("sorted"===t||"reseted"===t||"updated"===t?n.trigger(`model:${t}`,e):n.trigger(t,e)),this}setup(){const t=this.collection;t.on("sorted",(()=>this.notify("sorted",null))),t.on("updated",(t=>this.notify("updated",t))),t.on("cell:change:zIndex",(()=>this.sortOnChangeZ())),t.on("added",(({cell:t})=>{this.onCellAdded(t)})),t.on("removed",(t=>{const e=t.cell;this.onCellRemoved(e,t.options),this.notify("cell:removed",t),e.isNode()?this.notify("node:removed",Object.assign(Object.assign({},t),{node:e})):e.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},t),{edge:e}))})),t.on("reseted",(t=>{this.onReset(t.current),this.notify("reseted",t)})),t.on("edge:change:source",(({edge:t})=>this.onEdgeTerminalChanged(t,"source"))),t.on("edge:change:target",(({edge:t})=>{this.onEdgeTerminalChanged(t,"target")}))}sortOnChangeZ(){this.collection.sort()}onCellAdded(t){const e=t.id;t.isEdge()?(t.updateParent(),this.edges[e]=!0,this.onEdgeTerminalChanged(t,"source"),this.onEdgeTerminalChanged(t,"target")):this.nodes[e]=!0}onCellRemoved(t,e){const n=t.id;if(t.isEdge()){delete this.edges[n];const e=t.getSource(),i=t.getTarget();if(e&&e.cell){const t=this.outgoings[e.cell],i=t?t.indexOf(n):-1;i>=0&&(t.splice(i,1),0===t.length&&delete this.outgoings[e.cell])}if(i&&i.cell){const t=this.incomings[i.cell],e=t?t.indexOf(n):-1;e>=0&&(t.splice(e,1),0===t.length&&delete this.incomings[i.cell])}}else delete this.nodes[n];e.clear||(e.disconnectEdges?this.disconnectConnectedEdges(t,e):this.removeConnectedEdges(t,e)),t.model===this&&(t.model=null)}onReset(t){this.nodes={},this.edges={},this.outgoings={},this.incomings={},t.forEach((t=>this.onCellAdded(t)))}onEdgeTerminalChanged(t,e){const n="source"===e?this.outgoings:this.incomings,i=t.previous(e);if(i&&i.cell){const e=n[i.cell],s=e?e.indexOf(t.id):-1;s>=0&&(e.splice(s,1),0===e.length&&delete n[i.cell])}const s=t.getTerminal(e);if(s&&s.cell){const e=n[s.cell]||[],i=e.indexOf(t.id);-1===i&&e.push(t.id),n[s.cell]=e}}prepareCell(t,e){return t.model||e&&e.dryrun||(t.model=this),null==t.zIndex&&t.setZIndex(this.getMaxZIndex()+1,{silent:!0}),t}resetCells(t,e={}){return t.map((t=>this.prepareCell(t,Object.assign(Object.assign({},e),{dryrun:!0})))),this.collection.reset(t,e),t.map((t=>this.prepareCell(t,{options:e}))),this}clear(t={}){const e=this.getCells();if(0===e.length)return this;const n=Object.assign(Object.assign({},t),{clear:!0});return this.batchUpdate("clear",(()=>{const t=e.sort(((t,e)=>{const n=t.isEdge()?1:2,i=e.isEdge()?1:2;return n-i}));while(t.length>0){const e=t.shift();e&&e.remove(n)}}),n),this}addNode(t,e={}){const n=Pm.isNode(t)?t:this.createNode(t);return this.addCell(n,e),n}createNode(t){return Pm.create(t)}addEdge(t,e={}){const n=$m.isEdge(t)?t:this.createEdge(t);return this.addCell(n,e),n}createEdge(t){return $m.create(t)}addCell(t,e={}){return Array.isArray(t)?this.addCells(t,e):(this.collection.has(t)||this.addings.has(t)||(this.addings.set(t,!0),this.collection.add(this.prepareCell(t,e),e),t.eachChild((t=>this.addCell(t,e))),this.addings.delete(t)),this)}addCells(t,e={}){const n=t.length;if(0===n)return this;const i=Object.assign(Object.assign({},e),{position:n-1,maxPosition:n-1});return this.startBatch("add",Object.assign(Object.assign({},i),{cells:t})),t.forEach((t=>{this.addCell(t,i),i.position-=1})),this.stopBatch("add",Object.assign(Object.assign({},i),{cells:t})),this}removeCell(t,e={}){const n="string"===typeof t?this.getCell(t):t;return n&&this.has(n)?this.collection.remove(n,e):null}updateCellId(t,e){this.startBatch("update",{id:e}),t.prop("id",e);const n=t.clone({keepId:!0});this.addCell(n);const i=this.getConnectedEdges(t);return i.forEach((n=>{const i=n.getSourceCell(),s=n.getTargetCell();i===t&&n.setSource(Object.assign(Object.assign({},n.getSource()),{cell:e})),s===t&&n.setTarget(Object.assign(Object.assign({},n.getTarget()),{cell:e}))})),this.removeCell(t),this.stopBatch("update",{id:e}),n}removeCells(t,e={}){return t.length?this.batchUpdate("remove",(()=>t.map((t=>this.removeCell(t,e))))):[]}removeConnectedEdges(t,e={}){const n=this.getConnectedEdges(t);return n.forEach((t=>{t.remove(e)})),n}disconnectConnectedEdges(t,e={}){const n="string"===typeof t?t:t.id;this.getConnectedEdges(t).forEach((t=>{const i=t.getSourceCell(),s=t.getTargetCell();i&&i.id===n&&t.setSource({x:0,y:0},e),s&&s.id===n&&t.setTarget({x:0,y:0},e)}))}has(t){return this.collection.has(t)}total(){return this.collection.length}indexOf(t){return this.collection.indexOf(t)}getCell(t){return this.collection.get(t)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const t=this.collection.first();return t&&t.getZIndex()||0}getMaxZIndex(){const t=this.collection.last();return t&&t.getZIndex()||0}getCellsFromCache(t){return t?Object.keys(t).map((t=>this.getCell(t))).filter((t=>null!=t)):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(t){const e="string"===typeof t?t:t.id,n=this.outgoings[e];return n?n.map((t=>this.getCell(t))).filter((t=>t&&t.isEdge())):null}getIncomingEdges(t){const e="string"===typeof t?t:t.id,n=this.incomings[e];return n?n.map((t=>this.getCell(t))).filter((t=>t&&t.isEdge())):null}getConnectedEdges(t,e={}){const n=[],i="string"===typeof t?this.getCell(t):t;if(null==i)return n;const s={},o=e.indirect;let r=e.incoming,a=e.outgoing;null==r&&null==a&&(r=a=!0);const l=(t,e)=>{const i=e?this.getOutgoingEdges(t):this.getIncomingEdges(t);if(null!=i&&i.forEach((t=>{s[t.id]||(n.push(t),s[t.id]=!0,o&&(r&&l(t,!1),a&&l(t,!0)))})),o&&t.isEdge()){const i=e?t.getTargetCell():t.getSourceCell();i&&i.isEdge()&&(s[i.id]||(n.push(i),l(i,e)))}};if(a&&l(i,!0),r&&l(i,!1),e.deep){const t=i.getDescendants({deep:!0}),o={};t.forEach((t=>{t.isNode()&&(o[t.id]=!0)}));const l=(t,i)=>{const r=i?this.getOutgoingEdges(t.id):this.getIncomingEdges(t.id);null!=r&&r.forEach((t=>{if(!s[t.id]){const i=t.getSourceCell(),r=t.getTargetCell();if(!e.enclosed&&i&&o[i.id]&&r&&o[r.id])return;n.push(t),s[t.id]=!0}}))};t.forEach((t=>{t.isEdge()||(a&&l(t,!0),r&&l(t,!1))}))}return n}isBoundary(t,e){const n="string"===typeof t?this.getCell(t):t,i=e?this.getIncomingEdges(n):this.getOutgoingEdges(n);return null==i||0===i.length}getBoundaryNodes(t){const e=[];return Object.keys(this.nodes).forEach((n=>{if(this.isBoundary(n,t)){const t=this.getCell(n);t&&e.push(t)}})),e}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(t){return this.isBoundary(t,!0)}isLeaf(t){return this.isBoundary(t,!1)}getNeighbors(t,e={}){let n=e.incoming,i=e.outgoing;null==n&&null==i&&(n=i=!0);const s=this.getConnectedEdges(t,e),o=s.reduce(((s,o)=>{const r=o.hasLoop(e),a=o.getSourceCell(),l=o.getTargetCell();return n&&a&&a.isNode()&&!s[a.id]&&(!r&&(a===t||e.deep&&a.isDescendantOf(t))||(s[a.id]=a)),i&&l&&l.isNode()&&!s[l.id]&&(!r&&(l===t||e.deep&&l.isDescendantOf(t))||(s[l.id]=l)),s}),{});if(t.isEdge()){if(n){const e=t.getSourceCell();e&&e.isNode()&&!o[e.id]&&(o[e.id]=e)}if(i){const e=t.getTargetCell();e&&e.isNode()&&!o[e.id]&&(o[e.id]=e)}}return Object.keys(o).map((t=>o[t]))}isNeighbor(t,e,n={}){let i=n.incoming,s=n.outgoing;return null==i&&null==s&&(i=s=!0),this.getConnectedEdges(t,n).some((t=>{const n=t.getSourceCell(),o=t.getTargetCell();return!(!i||!n||n.id!==e.id)||!(!s||!o||o.id!==e.id)}))}getSuccessors(t,e={}){const n=[];return this.search(t,((i,s)=>{i!==t&&this.matchDistance(s,e.distance)&&n.push(i)}),Object.assign(Object.assign({},e),{outgoing:!0})),n}isSuccessor(t,e,n={}){let i=!1;return this.search(t,((s,o)=>{if(s===e&&s!==t&&this.matchDistance(o,n.distance))return i=!0,!1}),Object.assign(Object.assign({},n),{outgoing:!0})),i}getPredecessors(t,e={}){const n=[];return this.search(t,((i,s)=>{i!==t&&this.matchDistance(s,e.distance)&&n.push(i)}),Object.assign(Object.assign({},e),{incoming:!0})),n}isPredecessor(t,e,n={}){let i=!1;return this.search(t,((s,o)=>{if(s===e&&s!==t&&this.matchDistance(o,n.distance))return i=!0,!1}),Object.assign(Object.assign({},n),{incoming:!0})),i}matchDistance(t,e){return null==e||("function"===typeof e?e(t):!(!Array.isArray(e)||!e.includes(t))||t===e)}getCommonAncestor(...t){const e=[];return t.forEach((t=>{t&&(Array.isArray(t)?e.push(...t):e.push(t))})),Sm.getCommonAncestor(...e)}getSubGraph(t,e={}){const n=[],i={},s=[],o=[],r=t=>{i[t.id]||(n.push(t),i[t.id]=t,t.isEdge()&&o.push(t),t.isNode()&&s.push(t))};return t.forEach((t=>{if(r(t),e.deep){const e=t.getDescendants({deep:!0});e.forEach((t=>r(t)))}})),o.forEach((t=>{const e=t.getSourceCell(),o=t.getTargetCell();e&&!i[e.id]&&(n.push(e),i[e.id]=e,e.isNode()&&s.push(e)),o&&!i[o.id]&&(n.push(o),i[o.id]=o,o.isNode()&&s.push(o))})),s.forEach((t=>{const s=this.getConnectedEdges(t,e);s.forEach((t=>{const e=t.getSourceCell(),s=t.getTargetCell();!i[t.id]&&e&&i[e.id]&&s&&i[s.id]&&(n.push(t),i[t.id]=t)}))})),n}cloneSubGraph(t,e={}){const n=this.getSubGraph(t,e);return this.cloneCells(n)}cloneCells(t){return Sm.cloneCells(t)}getNodesFromPoint(t,e){const n="number"===typeof t?{x:t,y:e||0}:t;return this.getNodes().filter((t=>t.getBBox().containsPoint(n)))}getNodesInArea(t,e,n,i,s){const o="number"===typeof t?new lc(t,e,n,i):lc.create(t),r="number"===typeof t?s:e,a=r&&r.strict;return this.getNodes().filter((t=>{const e=t.getBBox();return a?o.containsRect(e):o.isIntersectWithRect(e)}))}getEdgesInArea(t,e,n,i,s){const o="number"===typeof t?new lc(t,e,n,i):lc.create(t),r="number"===typeof t?s:e,a=r&&r.strict;return this.getEdges().filter((t=>{const e=t.getBBox();return 0===e.width?e.inflate(1,0):0===e.height&&e.inflate(0,1),a?o.containsRect(e):o.isIntersectWithRect(e)}))}getNodesUnderNode(t,e={}){const n=t.getBBox(),i=null==e.by||"bbox"===e.by?this.getNodesInArea(n):this.getNodesFromPoint(n[e.by]);return i.filter((e=>t.id!==e.id&&!e.isDescendantOf(t)))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(t,e={}){return Sm.getCellsBBox(t,e)}search(t,e,n={}){n.breadthFirst?this.breadthFirstSearch(t,e,n):this.depthFirstSearch(t,e,n)}breadthFirstSearch(t,e,n={}){const i=[],s={},o={};i.push(t),o[t.id]=0;while(i.length>0){const t=i.shift();if(null==t||s[t.id])continue;if(s[t.id]=!0,!1===Ya(e,this,t,o[t.id]))continue;const r=this.getNeighbors(t,n);r.forEach((e=>{o[e.id]=o[t.id]+1,i.push(e)}))}}depthFirstSearch(t,e,n={}){const i=[],s={},o={};i.push(t),o[t.id]=0;while(i.length>0){const t=i.pop();if(null==t||s[t.id])continue;if(s[t.id]=!0,!1===Ya(e,this,t,o[t.id]))continue;const r=this.getNeighbors(t,n),a=i.length;r.forEach((e=>{o[e.id]=o[t.id]+1,i.splice(a,0,e)}))}}getShortestPath(t,e,n={}){const i={};this.getEdges().forEach((t=>{const e=t.getSourceCellId(),s=t.getTargetCellId();e&&s&&(i[e]||(i[e]=[]),i[s]||(i[s]=[]),i[e].push(s),n.directed||i[s].push(e))}));const s="string"===typeof t?t:t.id,o=Gg.run(i,s,n.weight),r=[];let a="string"===typeof e?e:e.id;o[a]&&r.push(a);while(a=o[a])r.unshift(a);return r}translate(t,e,n){return this.getCells().filter((t=>!t.hasParent())).forEach((i=>i.translate(t,e,n))),this}resize(t,e,n){return this.resizeCells(t,e,this.getCells(),n)}resizeCells(t,e,n,i={}){const s=this.getCellsBBox(n);if(s){const o=Math.max(t/s.width,0),r=Math.max(e/s.height,0),a=s.getOrigin();n.forEach((t=>t.scale(o,r,a,i)))}return this}toJSON(t={}){return qm.toJSON(this.getCells(),t)}parseJSON(t){return qm.fromJSON(t)}fromJSON(t,e={}){const n=this.parseJSON(t);return this.resetCells(n,e),this}startBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)+1,this.notify("batch:start",{name:t,data:e}),this}stopBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)-1,this.notify("batch:stop",{name:t,data:e}),this}batchUpdate(t,e,n={}){this.startBatch(t,n);const i=e();return this.stopBatch(t,n),i}hasActiveBatch(t=Object.keys(this.batches)){const e=Array.isArray(t)?t:[t];return e.some((t=>this.batches[t]>0))}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.addNode&&"function"===typeof i.addEdge&&null!=i.collection}t.toStringTag=`X6.${t.name}`,t.isModel=e})(qm||(qm={})),function(t){function e(t,e={}){return{cells:t.map((t=>t.toJSON(e)))}}function n(t){const e=[];return Array.isArray(t)?e.push(...t):(t.cells&&e.push(...t.cells),t.nodes&&t.nodes.forEach((t=>{null==t.shape&&(t.shape="rect"),e.push(t)})),t.edges&&t.edges.forEach((t=>{null==t.shape&&(t.shape="edge"),e.push(t)}))),e.map((t=>{const e=t.shape;if(e){if(Pm.registry.exist(e))return Pm.create(t);if($m.registry.exist(e))return $m.create(t)}throw new Error("The `shape` should be specified when creating a node/edge instance")}))}t.toJSON=e,t.fromJSON=n}(qm||(qm={}));const Zm=".text-block-content",Xm=Fm("text-block");class Ym extends Pm{get content(){return this.getContent()}set content(t){this.setContent(t)}getContent(){return this.store.get("content","")}setContent(t,e={}){this.store.set("content",t,e)}setup(){super.setup(),this.store.on("change:*",(t=>{const e=t.key;"content"===e?this.updateContent(this.getContent()):"size"===e&&this.updateSize(this.getSize())})),this.updateSize(this.getSize()),this.updateContent(this.getContent())}updateSize(t){ht.SUPPORT_FOREIGNOBJECT&&this.setAttrs({foreignObject:Object.assign({},t),[Zm]:{style:Object.assign({},t)}})}updateContent(t){ht.SUPPORT_FOREIGNOBJECT?this.setAttrs({[Zm]:{html:t?Pa(t):""}}):this.setAttrs({[Zm]:{text:t}})}}(function(t){t.config({type:Xm,view:Xm,markup:['<g class="rotatable">','<g class="scalable"><rect/></g>',ht.SUPPORT_FOREIGNOBJECT?["<foreignObject>",'<body xmlns="http://www.w3.org/1999/xhtml">',`<div class="${Zm.substr(1)}" />`,"</body>","</foreignObject>"].join(""):`<text class="${Zm.substr(1)}"/>`,"</g>"].join(""),attrs:{".":{fill:"#ffffff",stroke:"none"},rect:{fill:"#ffffff",stroke:"#000000",width:80,height:100},text:{fill:"#000000",fontSize:14,fontFamily:"Arial, helvetica, sans-serif"},body:{style:{background:"transparent",position:"static",margin:0,padding:0}},foreignObject:{style:{overflow:"hidden"}},[Zm]:{refX:.5,refY:.5,yAlign:"middle",xAlign:"middle",style:{textAlign:"center",verticalAlign:"middle",display:"table-cell",padding:"0 5px",margin:0}}}}),Pm.registry.register(Xm,t)})(Ym||(Ym={})),function(t){const e="content";class n extends Gm{confirmUpdate(t,n={}){let i=super.confirmUpdate(t,n);return this.hasAction(i,e)&&(this.updateContent(),i=this.removeAction(i,e)),i}update(t){if(ht.SUPPORT_FOREIGNOBJECT)super.update(t);else{const e=this.cell,n=Object.assign({},t||e.getAttrs());delete n[Zm],super.update(n),t&&!mn(t,Zm)||this.updateContent(t)}}updateContent(t){if(ht.SUPPORT_FOREIGNOBJECT)super.update(t);else{const e=this.cell,n=(t||e.getAttrs())[Zm],i=Vc(e.getContent(),e.getSize(),n,{svgDocument:this.graph.view.svg}),s={[Zm]:Kn({},n,{text:i})};super.update(s)}}}t.View=n,function(t){t.config({bootstrap:["render",e],actions:ht.SUPPORT_FOREIGNOBJECT?{}:{size:e,content:e}}),Gm.registry.register(Xm,t)}(n=t.View||(t.View={}))}(Ym||(Ym={}));Tm.define({shape:"empty"});function Jm(t,e="body"){return[{tagName:t,selector:e},{tagName:"text",selector:"label"}]}function Km(t,e,n={}){const i={constructorName:t,markup:Jm(t,n.selector),attrs:{[t]:Object.assign({},Tm.bodyAttr)}},s=n.parent||Tm;return s.define(Kn(i,e,{shape:t}))}Km("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}}),Pm.define({shape:"rect-headered",markup:[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"header"},{tagName:"text",selector:"headerText"},{tagName:"text",selector:"bodyText"}],attrs:{body:Object.assign(Object.assign({},Tm.bodyAttr),{refWidth:"100%",refHeight:"100%"}),header:Object.assign(Object.assign({},Tm.bodyAttr),{refWidth:"100%",height:30,stroke:"#000000"}),headerText:Object.assign(Object.assign({},Tm.labelAttr),{refX:"50%",refY:15,fontSize:16}),bodyText:Object.assign(Object.assign({},Tm.labelAttr),{refY2:15})}}),Km("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});const Qm=10;Tm.define({shape:"cylinder",overwrite:!0,markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],attrs:{body:Object.assign(Object.assign({},Tm.bodyAttr),{lateral:Qm}),top:Object.assign(Object.assign({},Tm.bodyAttr),{refCx:"50%",refRx:"50%",cy:Qm,ry:Qm})},attrHooks:{lateral:{set(t,{refBBox:e}){const n=Ra(t);n&&(t=parseFloat(t)/100);const i=e.x,s=e.y,o=e.width,r=e.height,a=o/2,l=n?r*t:t,c=.551784,h=c*a,u=c*l,d=i,g=i+o/2,p=i+o,f=s+l,m=f-l,y=s+r-l,b=s+r,w=["M",d,f,"L",d,y,"C",i,y+u,g-h,b,g,b,"C",g+h,b,p,y+u,p,y,"L",p,f,"C",p,f-u,g+h,m,g,m,"C",g-h,m,d,f-u,d,f,"Z"];return{d:w.join(" ")}}}},knob:{enabled:!0,position({node:t}){const e=t.attr("body/lateral");return{x:0,y:e}},onMouseMove({node:t,data:e,deltaY:n}){if(0!==n){const i=t.getBBox(),s=t.attr("body/lateral");null==e.round&&(e.round=s);const o=0,r=i.height/2,a=Ia(e.round+n,o,r);a!==s&&t.attr({body:{lateral:a},top:{cy:a,ry:a}})}}}}),Km("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var ty=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class ey extends Tm{get points(){return this.getPoints()}set points(t){this.setPoints(t)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(t,e){return null==t?this.removePoints():this.setAttrByPath("body/refPoints",ey.pointsToString(t),e),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(t){function e(t){return"string"===typeof t?t:t.map((t=>Array.isArray(t)?t.join(","):ac.isPointLike(t)?`${t.x}, ${t.y}`:"")).join(" ")}t.pointsToString=e,t.config({propHooks(t){const{points:n}=t,i=ty(t,["points"]);if(n){const t=e(n);t&&Fi(i,"attrs/body/refPoints",t)}return i}})})(ey||(ey={}));Km("polygon",{},{parent:ey}),Km("polyline",{},{parent:ey});var ny=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};Tm.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(t){const{path:e}=t,n=ny(t,["path"]);return e&&Fi(n,"attrs/body/refD",e),n}});var iy=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};Tm.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},ht.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:gl.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},Tm.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(t){const{text:e}=t,n=iy(t,["text"]);return e&&Fi(n,"attrs/label/text",e),n},attrHooks:{text:{set(t,{cell:e,view:n,refBBox:i,elem:s,attrs:o}){if(!(s instanceof HTMLElement)){const r=o.style||{},a={text:t,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},r),c=kd.presets.textWrap;return Ya(c.set,this,a,{cell:e,view:n,elem:s,refBBox:i,attrs:l}),{fill:r.color||null}}s.textContent=t},position(t,{refBBox:e,elem:n}){if(n instanceof SVGElement)return e.getCenter()}}}}),Km("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:Lm()},{selector:"image"}),Km("image-bordered",{markup:[{tagName:"rect",selector:"background",attrs:{stroke:"none"}},{tagName:"image",selector:"image"},{tagName:"rect",selector:"border",attrs:{fill:"none"}},{tagName:"text",selector:"label"}],attrs:{background:{refWidth:-1,refHeight:-1,x:.5,y:.5,fill:"#ffffff"},border:{refWidth:"100%",refHeight:"100%",stroke:"#333333",strokeWidth:2},image:{refWidth:-1,refHeight:-1,x:.5,y:.5}},propHooks:Lm()}),Km("image-embedded",{markup:[{tagName:"rect",selector:"body"},{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}],attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#FFFFFF",strokeWidth:2},image:{refWidth:"30%",refHeight:-20,x:10,y:10,preserveAspectRatio:"xMidYMin"}},propHooks:Lm()}),Km("image-inscribed",{propHooks:Lm(),markup:[{tagName:"ellipse",selector:"background"},{tagName:"image",selector:"image"},{tagName:"ellipse",selector:"border",attrs:{fill:"none"}},{tagName:"text",selector:"label"}],attrs:{border:{refRx:"50%",refRy:"50%",refCx:"50%",refCy:"50%",stroke:"#333333",strokeWidth:2},background:{refRx:"50%",refRy:"50%",refCx:"50%",refCy:"50%",fill:"#ffffff"},image:{refWidth:"68%",refHeight:"68%",refX:"16%",refY:"16%",preserveAspectRatio:"xMidYMid"}}});const sy=$m.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});$m.define({shape:"shadow-edge",markup:[{tagName:"path",selector:"shadow",attrs:{fill:"none"}},{tagName:"path",selector:"line",attrs:{fill:"none",cursor:"pointer"}}],attrs:{line:{connection:!0,stroke:"#FF0000",strokeWidth:20,strokeLinejoin:"round",targetMarker:{name:"path",stroke:"none",d:"M 0 -10 -10 0 0 10 z",offsetX:-5},sourceMarker:{name:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z",offsetX:-5}},shadow:{connection:!0,refX:3,refY:6,stroke:"#000000",strokeOpacity:.2,strokeWidth:20,strokeLinejoin:"round",targetMarker:{name:"path",d:"M 0 -10 -10 0 0 10 z",stroke:"none",offsetX:-5},sourceMarker:{name:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z",offsetX:-5}}}}),$m.define({shape:"double-edge",markup:[{tagName:"path",selector:"outline",attrs:{fill:"none"}},{tagName:"path",selector:"line",attrs:{fill:"none",cursor:"pointer"}}],attrs:{line:{connection:!0,stroke:"#dddddd",strokeWidth:4,strokeLinejoin:"round",targetMarker:{tagName:"path",stroke:"#000000",d:"M 10 -3 10 -10 -2 0 10 10 10 3"}},outline:{connection:!0,stroke:"#000000",strokeWidth:6,strokeLinejoin:"round"}}});class oy extends Tm{get html(){return this.getHTML()}set html(t){this.setHTML(t)}getHTML(){return this.store.get("html")}setHTML(t,e={}){return null==t?this.removeHTML(e):this.store.set("html",t,e),this}removeHTML(t={}){return this.store.remove("html",t)}}(function(t){class e extends Gm{init(){super.init(),this.cell.on("change:*",(()=>{const t=this.graph.hook.shouldUpdateHTMLComponent(this.cell);t&&this.renderHTMLComponent()}))}confirmUpdate(t){const n=super.confirmUpdate(t);return this.handleAction(n,e.action,(()=>this.renderHTMLComponent()))}renderHTMLComponent(){const t=this.selectors.foContent;if(t){const e=this.$(t).empty(),n=this.graph.hook.getHTMLComponent(this.cell);n&&("string"===typeof n?e.html(n):e.append(n))}}}t.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),Gm.registry.register("html-view",t)}(e=t.View||(t.View={}))})(oy||(oy={})),function(t){t.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},rp.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),Pm.registry.register("html",t)}(oy||(oy={})),function(t){t.componentRegistry=Uh.create({type:"html componnet"})}(oy||(oy={}));var ry=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class ay extends _g{constructor(t){super(),this.delay=10,this.throttle=2,this.threshold=5,this.changeCount=0,this.timestamp=0,this.options=Object.assign(Object.assign({},ay.defaultOptions),t),this.graph.model.on("cell:change:*",this.onModelChanged,this)}get graph(){return this.options.graph}onModelChanged(){if(this.disabled)return;const t=(new Date).getTime(),e=(t-this.timestamp)/1e3;e>this.delay||this.changeCount>=this.threshold&&e>this.throttle?(this.save(),this.reset()):this.changeCount+=1}save(){this.trigger("save")}reset(){this.changeCount=0,this.timestamp=(new Date).getTime()}dispose(){this.graph.model.off("cell:change:*",this.onModelChanged,this)}}ry([_g.dispose()],ay.prototype,"dispose",null),function(t){t.defaultOptions={delay:10,throttle:2,threshold:5}}(ay||(ay={}));class ly extends Rg{constructor(t){super(),this.graph=t,this.init()}get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}init(){}}var cy,hy=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class uy extends Jg{constructor(t){super(),this.graph=t;const{selectors:e,fragment:n}=rp.parseJSONMarkup(uy.markup);this.background=e.background,this.grid=e.grid,this.svg=e.svg,this.defs=e.defs,this.viewport=e.viewport,this.primer=e.primer,this.stage=e.stage,this.decorator=e.decorator,this.overlay=e.overlay,this.container=this.options.container,this.restore=uy.snapshoot(this.container),this.$(this.container).addClass(this.prefixClassName("graph")).append(n),this.delegateEvents()}get model(){return this.graph.model}get options(){return this.graph.options}delegateEvents(){const t=this.constructor;return super.delegateEvents(t.events),this}guard(t,e){return"mousedown"===t.type&&2===t.button||(!(!this.options.guard||!this.options.guard(t,e))||(t.data&&void 0!==t.data.guarded?t.data.guarded:!(e&&e.cell&&Sm.isCell(e.cell))&&(this.svg!==t.target&&this.container!==t.target&&!lt().contains(this.svg,t.target))))}findView(t){return this.graph.renderer.findViewByElem(t)}onDblClick(t){this.options.preventDefaultDblClick&&t.preventDefault();const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onDblClick(e,i.x,i.y):this.graph.trigger("blank:dblclick",{e:e,x:i.x,y:i.y})}onClick(t){if(this.getMouseMovedCount(t)<=this.options.clickThreshold){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onClick(e,i.x,i.y):this.graph.trigger("blank:click",{e:e,x:i.x,y:i.y})}}onContextMenu(t){this.options.preventDefaultContextMenu&&t.preventDefault();const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onContextMenu(e,i.x,i.y):this.graph.trigger("blank:contextmenu",{e:e,x:i.x,y:i.y})}delegateDragEvents(t,e){null==t.data&&(t.data={}),this.setEventData(t,{currentView:e||null,mouseMovedCount:0,startPosition:{x:t.clientX,y:t.clientY}});const n=this.constructor;this.delegateDocumentEvents(n.documentEvents,t.data),this.undelegateEvents()}getMouseMovedCount(t){const e=this.getEventData(t);return e.mouseMovedCount||0}onMouseDown(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;this.options.preventDefaultMouseDown&&e.preventDefault();const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onMouseDown(e,i.x,i.y):(this.options.preventDefaultBlankAction&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:e,x:i.x,y:i.y})),this.delegateDragEvents(e,n)}onMouseMove(t){const e=this.getEventData(t),n=e.startPosition;if(n&&n.x===t.clientX&&n.y===t.clientY)return;null==e.mouseMovedCount&&(e.mouseMovedCount=0),e.mouseMovedCount+=1;const i=e.mouseMovedCount;if(i<=this.options.moveThreshold)return;const s=this.normalizeEvent(t),o=this.graph.snapToGrid(s.clientX,s.clientY),r=e.currentView;r?r.onMouseMove(s,o.x,o.y):this.graph.trigger("blank:mousemove",{e:s,x:o.x,y:o.y}),this.setEventData(s,e)}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY),i=this.getEventData(t),s=i.currentView;s?s.onMouseUp(e,n.x,n.y):this.graph.trigger("blank:mouseup",{e:e,x:n.x,y:n.y}),t.isPropagationStopped()||this.onClick(lt().Event(t,{type:"click",data:t.data})),t.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOver(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseover",{e:e})}}onMouseOut(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOut(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseout",{e:e})}}onMouseEnter(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.renderer.findViewByElem(e.relatedTarget);if(n){if(i===n)return;n.onMouseEnter(e)}else{if(i)return;this.graph.trigger("graph:mouseenter",{e:e})}}onMouseLeave(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.renderer.findViewByElem(e.relatedTarget);if(n){if(i===n)return;n.onMouseLeave(e)}else{if(i)return;this.graph.trigger("graph:mouseleave",{e:e})}}onMouseWheel(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=e.originalEvent,s=this.graph.snapToGrid(i.clientX,i.clientY),o=Math.max(-1,Math.min(1,i.wheelDelta||-i.detail));n?n.onMouseWheel(e,s.x,s.y,o):this.graph.trigger("blank:mousewheel",{e:e,delta:o,x:s.x,y:s.y})}onCustomEvent(t){const e=t.currentTarget,n=e.getAttribute("event")||e.getAttribute("data-event");if(n){const i=this.findView(e);if(i){const e=this.normalizeEvent(t);if(this.guard(e,i))return;const s=this.graph.snapToGrid(e.clientX,e.clientY);i.onCustomEvent(e,n,s.x,s.y)}}}handleMagnetEvent(t,e){const n=t.currentTarget,i=n.getAttribute("magnet");if(i&&"false"!==i.toLowerCase()){const i=this.findView(n);if(i){const s=this.normalizeEvent(t);if(this.guard(s,i))return;const o=this.graph.snapToGrid(s.clientX,s.clientY);Ya(e,this.graph,i,s,n,o.x,o.y)}}}onMagnetMouseDown(t){this.handleMagnetEvent(t,((t,e,n,i,s)=>{t.onMagnetMouseDown(e,n,i,s)}))}onMagnetDblClick(t){this.handleMagnetEvent(t,((t,e,n,i,s)=>{t.onMagnetDblClick(e,n,i,s)}))}onMagnetContextMenu(t){this.options.preventDefaultContextMenu&&t.preventDefault(),this.handleMagnetEvent(t,((t,e,n,i,s)=>{t.onMagnetContextMenu(e,n,i,s)}))}onLabelMouseDown(t){const e=t.currentTarget,n=this.findView(e);if(n){const e=this.normalizeEvent(t);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n.onLabelMouseDown(e,i.x,i.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}hy([Jg.dispose()],uy.prototype,"dispose",null),function(t){const e=`${Zd.prefixCls}-graph`;function n(t){const e=t.cloneNode();return t.childNodes.forEach((t=>e.appendChild(t))),()=>{Al(t);while(t.attributes.length>0)t.removeAttribute(t.attributes[0].name);for(let n=0,i=e.attributes.length;n<i;n+=1){const i=e.attributes[n];t.setAttribute(i.name,i.value)}e.childNodes.forEach((e=>t.appendChild(e)))}}t.markup=[{ns:gl.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:gl.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:gl.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":gl.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${e}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${e}-svg-primer`},{tagName:"g",selector:"stage",className:`${e}-svg-stage`},{tagName:"g",selector:"decorator",className:`${e}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${e}-svg-overlay`}]}]}],t.snapshoot=n}(uy||(uy={})),function(t){const e=Zd.prefixCls;t.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${e}-cell`]:"onMouseEnter",[`mouseleave .${e}-cell`]:"onMouseLeave",[`mouseenter .${e}-cell-tools`]:"onMouseEnter",[`mouseleave .${e}-cell-tools`]:"onMouseLeave",[`mousedown .${e}-cell [event]`]:"onCustomEvent",[`touchstart .${e}-cell [event]`]:"onCustomEvent",[`mousedown .${e}-cell [data-event]`]:"onCustomEvent",[`touchstart .${e}-cell [data-event]`]:"onCustomEvent",[`dblclick .${e}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${e}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${e}-cell image`]:"onImageDragStart",[`mousedown .${e}-edge .${e}-edge-label`]:"onLabelMouseDown",[`touchstart .${e}-edge .${e}-edge-label`]:"onLabelMouseDown"},t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(uy||(uy={})),function(t){function e(t,e){return(n,i,s)=>{const o=s.value;s.value=function(...n){const s=this.scroller.widget;if(null==s){const n=`Shoule enable scroller to use method '${i}'`;if(!1!==t)throw console.error(n),new Error(n);return!1!==e&&console.warn(n),this}return o.call(this,...n)}}}t.checkScroller=e}(cy||(cy={}));const dy=".x6-graph {\n position: relative;\n outline: none;\n}\n.x6-graph-background,\n.x6-graph-grid,\n.x6-graph-svg {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-background-stage,\n.x6-graph-grid-stage,\n.x6-graph-svg-stage {\n user-select: none;\n}\n.x6-graph.x6-graph-pannable {\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n.x6-graph.x6-graph-panning {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n}\n.x6-node {\n cursor: move;\n /* stylelint-disable-next-line */\n}\n.x6-node.x6-node-immovable {\n cursor: default;\n}\n.x6-node * {\n -webkit-user-drag: none;\n}\n.x6-node .scalable * {\n vector-effect: non-scaling-stroke;\n}\n.x6-node [magnet='true'] {\n cursor: crosshair;\n transition: opacity 0.3s;\n}\n.x6-node [magnet='true']:hover {\n opacity: 0.7;\n}\n.x6-node foreignObject {\n display: block;\n overflow: visible;\n background-color: transparent;\n}\n.x6-node foreignObject > body {\n position: static;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: visible;\n background-color: transparent;\n}\n.x6-edge .source-marker,\n.x6-edge .target-marker {\n vector-effect: non-scaling-stroke;\n}\n.x6-edge .connection {\n stroke-linejoin: round;\n fill: none;\n}\n.x6-edge .connection-wrap {\n cursor: move;\n opacity: 0;\n fill: none;\n stroke: #000;\n stroke-width: 15;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n.x6-edge .connection-wrap:hover {\n opacity: 0.4;\n stroke-opacity: 0.4;\n}\n.x6-edge .vertices {\n cursor: move;\n opacity: 0;\n}\n.x6-edge .vertices .vertex {\n fill: #1abc9c;\n}\n.x6-edge .vertices .vertex :hover {\n fill: #34495e;\n stroke: none;\n}\n.x6-edge .vertices .vertex-remove {\n cursor: pointer;\n fill: #fff;\n}\n.x6-edge .vertices .vertex-remove-area {\n cursor: pointer;\n opacity: 0.1;\n}\n.x6-edge .vertices .vertex-group:hover .vertex-remove-area {\n opacity: 1;\n}\n.x6-edge .arrowheads {\n cursor: move;\n opacity: 0;\n}\n.x6-edge .arrowheads .arrowhead {\n fill: #1abc9c;\n}\n.x6-edge .arrowheads .arrowhead :hover {\n fill: #f39c12;\n stroke: none;\n}\n.x6-edge .tools {\n cursor: pointer;\n opacity: 0;\n}\n.x6-edge .tools .tool-options {\n display: none;\n}\n.x6-edge .tools .tool-remove circle {\n fill: #f00;\n}\n.x6-edge .tools .tool-remove path {\n fill: #fff;\n}\n.x6-edge:hover .vertices,\n.x6-edge:hover .arrowheads,\n.x6-edge:hover .tools {\n opacity: 1;\n}\n.x6-highlight-opacity {\n opacity: 0.3;\n}\n@keyframes halo-pie-visibility {\n 0% {\n visibility: hidden;\n }\n 100% {\n visibility: visible;\n }\n}\n@keyframes halo-pie-opening {\n 0% {\n transform: scale(0.4) rotate(-20deg);\n }\n 100% {\n transform: scale(1) rotate(0);\n }\n}\n.x6-widget-handle {\n position: absolute;\n width: 20px;\n height: 20px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: 0 0;\n background-size: 20px 20px;\n cursor: pointer;\n user-select: none;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-handle.hidden {\n display: none;\n}\n.x6-widget-handle-selected {\n background-color: rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n}\n.x6-widget-handle-remove {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15.386%2C3.365c-3.315-3.314-8.707-3.313-12.021%2C0c-3.314%2C3.315-3.314%2C8.706%2C0%2C12.02%20c3.314%2C3.314%2C8.707%2C3.314%2C12.021%2C0S18.699%2C6.68%2C15.386%2C3.365L15.386%2C3.365z%20M4.152%2C14.598C1.273%2C11.719%2C1.273%2C7.035%2C4.153%2C4.154%20c2.88-2.88%2C7.563-2.88%2C10.443%2C0c2.881%2C2.88%2C2.881%2C7.562%2C0%2C10.443C11.716%2C17.477%2C7.032%2C17.477%2C4.152%2C14.598L4.152%2C14.598z%22%2F%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.157%2C11.371L7.38%2C6.593C7.162%2C6.375%2C6.809%2C6.375%2C6.592%2C6.592c-0.218%2C0.219-0.218%2C0.572%2C0%2C0.79%20l4.776%2C4.776c0.218%2C0.219%2C0.571%2C0.219%2C0.79%2C0C12.375%2C11.941%2C12.375%2C11.588%2C12.157%2C11.371L12.157%2C11.371z%22%2F%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M11.369%2C6.593l-4.777%2C4.778c-0.217%2C0.217-0.217%2C0.568%2C0%2C0.787c0.219%2C0.219%2C0.571%2C0.217%2C0.788%2C0l4.777-4.777%20c0.218-0.218%2C0.218-0.571%2C0.001-0.789C11.939%2C6.375%2C11.587%2C6.375%2C11.369%2C6.593L11.369%2C6.593z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: pointer;\n}\n.x6-widget-handle-remove:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15.386%2C3.365c-3.315-3.314-8.707-3.313-12.021%2C0c-3.314%2C3.315-3.314%2C8.706%2C0%2C12.02%20c3.314%2C3.314%2C8.707%2C3.314%2C12.021%2C0S18.699%2C6.68%2C15.386%2C3.365L15.386%2C3.365z%22%2F%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M12.157%2C11.371L7.38%2C6.593C7.162%2C6.375%2C6.809%2C6.375%2C6.592%2C6.592c-0.218%2C0.219-0.218%2C0.572%2C0%2C0.79%20l4.776%2C4.776c0.218%2C0.219%2C0.571%2C0.219%2C0.79%2C0C12.375%2C11.941%2C12.375%2C11.588%2C12.157%2C11.371L12.157%2C11.371z%22%2F%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M11.369%2C6.593l-4.777%2C4.778c-0.217%2C0.217-0.217%2C0.568%2C0%2C0.787c0.219%2C0.219%2C0.571%2C0.217%2C0.788%2C0l4.777-4.777%20c0.218-0.218%2C0.218-0.571%2C0.001-0.789C11.939%2C6.375%2C11.587%2C6.375%2C11.369%2C6.593L11.369%2C6.593z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-rotate {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M9.374%2C17.592c-4.176%2C0-7.57-3.401-7.57-7.575c0-4.175%2C3.395-7.574%2C7.57-7.574c0.28%2C0%2C0.56%2C0.018%2C0.837%2C0.05%20V1.268c0-0.158%2C0.099-0.3%2C0.239-0.36c0.151-0.058%2C0.315-0.026%2C0.428%2C0.086l2.683%2C2.688c0.152%2C0.154%2C0.152%2C0.399%2C0%2C0.553l-2.68%2C2.693%20c-0.115%2C0.112-0.279%2C0.147-0.431%2C0.087c-0.141-0.063-0.239-0.205-0.239-0.361V5.296C9.934%2C5.243%2C9.654%2C5.22%2C9.374%2C5.22%20c-2.646%2C0-4.796%2C2.152-4.796%2C4.797s2.154%2C4.798%2C4.796%2C4.798c2.645%2C0%2C4.798-2.153%2C4.798-4.798c0-0.214%2C0.174-0.391%2C0.391-0.391h1.991%20c0.217%2C0%2C0.394%2C0.177%2C0.394%2C0.391C16.947%2C14.19%2C13.549%2C17.592%2C9.374%2C17.592L9.374%2C17.592z%20M9.374%2C17.592%22%2F%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-rotate:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M9.374%2C17.592c-4.176%2C0-7.57-3.401-7.57-7.575c0-4.175%2C3.395-7.574%2C7.57-7.574c0.28%2C0%2C0.56%2C0.018%2C0.837%2C0.05%20V1.268c0-0.158%2C0.099-0.3%2C0.239-0.36c0.151-0.058%2C0.315-0.026%2C0.428%2C0.086l2.683%2C2.688c0.152%2C0.154%2C0.152%2C0.399%2C0%2C0.553l-2.68%2C2.693%20c-0.115%2C0.112-0.279%2C0.147-0.431%2C0.087c-0.141-0.063-0.239-0.205-0.239-0.361V5.296C9.934%2C5.243%2C9.654%2C5.22%2C9.374%2C5.22%20c-2.646%2C0-4.796%2C2.152-4.796%2C4.797s2.154%2C4.798%2C4.796%2C4.798c2.645%2C0%2C4.798-2.153%2C4.798-4.798c0-0.214%2C0.174-0.391%2C0.391-0.391h1.991%20c0.217%2C0%2C0.394%2C0.177%2C0.394%2C0.391C16.947%2C14.19%2C13.549%2C17.592%2C9.374%2C17.592L9.374%2C17.592z%20M9.374%2C17.592%22%2F%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-resize {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20height%3D%2224px%22%20version%3D%221.1%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asketch%3D%22http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%2Fns%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Ctitle%2F%3E%3Cdesc%2F%3E%3Cdefs%2F%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20id%3D%22miu%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%3E%3Cg%20id%3D%22Artboard-1%22%20transform%3D%22translate(-251.000000%2C%20-443.000000)%22%3E%3Cg%20id%3D%22slice%22%20transform%3D%22translate(215.000000%2C%20119.000000)%22%2F%3E%3Cpath%20d%3D%22M252%2C448%20L256%2C448%20L256%2C444%20L252%2C444%20L252%2C448%20Z%20M257%2C448%20L269%2C448%20L269%2C446%20L257%2C446%20L257%2C448%20Z%20M257%2C464%20L269%2C464%20L269%2C462%20L257%2C462%20L257%2C464%20Z%20M270%2C444%20L270%2C448%20L274%2C448%20L274%2C444%20L270%2C444%20Z%20M252%2C462%20L252%2C466%20L256%2C466%20L256%2C462%20L252%2C462%20Z%20M270%2C462%20L270%2C466%20L274%2C466%20L274%2C462%20L270%2C462%20Z%20M254%2C461%20L256%2C461%20L256%2C449%20L254%2C449%20L254%2C461%20Z%20M270%2C461%20L272%2C461%20L272%2C449%20L270%2C449%20L270%2C461%20Z%22%20fill%3D%22%236A6C8A%22%20id%3D%22editor-crop-glyph%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E');\n cursor: se-resize;\n}\n.x6-widget-handle-resize:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20height%3D%2224px%22%20version%3D%221.1%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asketch%3D%22http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%2Fns%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Ctitle%2F%3E%3Cdesc%2F%3E%3Cdefs%2F%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20id%3D%22miu%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%3E%3Cg%20id%3D%22Artboard-1%22%20transform%3D%22translate(-251.000000%2C%20-443.000000)%22%3E%3Cg%20id%3D%22slice%22%20transform%3D%22translate(215.000000%2C%20119.000000)%22%2F%3E%3Cpath%20d%3D%22M252%2C448%20L256%2C448%20L256%2C444%20L252%2C444%20L252%2C448%20Z%20M257%2C448%20L269%2C448%20L269%2C446%20L257%2C446%20L257%2C448%20Z%20M257%2C464%20L269%2C464%20L269%2C462%20L257%2C462%20L257%2C464%20Z%20M270%2C444%20L270%2C448%20L274%2C448%20L274%2C444%20L270%2C444%20Z%20M252%2C462%20L252%2C466%20L256%2C466%20L256%2C462%20L252%2C462%20Z%20M270%2C462%20L270%2C466%20L274%2C466%20L274%2C462%20L270%2C462%20Z%20M254%2C461%20L256%2C461%20L256%2C449%20L254%2C449%20L254%2C461%20Z%20M270%2C461%20L272%2C461%20L272%2C449%20L270%2C449%20L270%2C461%20Z%22%20fill%3D%22%23FD6EB6%22%20id%3D%22editor-crop-glyph%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E');\n}\n.x6-widget-handle-clone {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.852%2C0.875h-9.27c-0.853%2C0-1.547%2C0.694-1.547%2C1.547v10.816h1.547V2.422h9.27V0.875z%20M15.172%2C3.965h-8.5%20c-0.849%2C0-1.547%2C0.698-1.547%2C1.547v10.816c0%2C0.849%2C0.698%2C1.547%2C1.547%2C1.547h8.5c0.85%2C0%2C1.543-0.698%2C1.543-1.547V5.512%20C16.715%2C4.663%2C16.021%2C3.965%2C15.172%2C3.965L15.172%2C3.965z%20M15.172%2C16.328h-8.5V5.512h8.5V16.328z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-clone:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M12.852%2C0.875h-9.27c-0.853%2C0-1.547%2C0.694-1.547%2C1.547v10.816h1.547V2.422h9.27V0.875z%20M15.172%2C3.965h-8.5%20c-0.849%2C0-1.547%2C0.698-1.547%2C1.547v10.816c0%2C0.849%2C0.698%2C1.547%2C1.547%2C1.547h8.5c0.849%2C0%2C1.543-0.698%2C1.543-1.547V5.512%20C16.715%2C4.663%2C16.021%2C3.965%2C15.172%2C3.965L15.172%2C3.965z%20M15.172%2C16.328h-8.5V5.512h8.5V16.328z%20M15.172%2C16.328%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-link {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M9.884%2C9.838c0.54-0.551%2C1.005-0.955%2C1.384-1.201c0.463-0.308%2C0.749-0.352%2C0.887-0.352h1.34v1.367%20c0%2C0.104%2C0.061%2C0.2%2C0.154%2C0.242s0.204%2C0.027%2C0.284-0.038l3.168-2.669c0.06-0.051%2C0.096-0.125%2C0.096-0.203S17.16%2C6.83%2C17.101%2C6.781%20l-3.168-2.677c-0.08-0.067-0.19-0.081-0.284-0.038c-0.094%2C0.045-0.154%2C0.139-0.154%2C0.242v1.414h-1.343%20c-1.24%2C0.014-2.215%2C0.67-2.927%2C1.242c-0.797%2C0.65-1.533%2C1.447-2.245%2C2.217c-0.361%2C0.391-0.7%2C0.759-1.044%2C1.1%20c-0.541%2C0.549-1.011%2C0.951-1.395%2C1.199c-0.354%2C0.231-0.678%2C0.357-0.921%2C0.357h-1.8c-0.146%2C0-0.266%2C0.12-0.266%2C0.265v2.029%20c0%2C0.148%2C0.12%2C0.268%2C0.266%2C0.268h1.8l0%2C0c1.255-0.014%2C2.239-0.667%2C2.958-1.24c0.82-0.661%2C1.572-1.475%2C2.297-2.256%20C9.225%2C10.524%2C9.555%2C10.169%2C9.884%2C9.838z%22%2F%3E%3C%2Fsvg%3E%20');\n cursor: move;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n}\n.x6-widget-handle-link:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M9.884%2C9.838c0.54-0.551%2C1.005-0.955%2C1.384-1.201c0.463-0.308%2C0.749-0.352%2C0.887-0.352h1.34v1.367%20c0%2C0.104%2C0.061%2C0.2%2C0.154%2C0.242s0.204%2C0.027%2C0.284-0.038l3.168-2.669c0.06-0.051%2C0.096-0.125%2C0.096-0.203S17.16%2C6.83%2C17.101%2C6.781%20l-3.168-2.677c-0.08-0.067-0.19-0.081-0.284-0.038c-0.094%2C0.045-0.154%2C0.139-0.154%2C0.242v1.414h-1.343%20c-1.24%2C0.014-2.215%2C0.67-2.927%2C1.242c-0.797%2C0.65-1.533%2C1.447-2.245%2C2.217c-0.361%2C0.391-0.7%2C0.759-1.044%2C1.1%20c-0.541%2C0.549-1.011%2C0.951-1.395%2C1.199c-0.354%2C0.231-0.678%2C0.357-0.921%2C0.357h-1.8c-0.146%2C0-0.266%2C0.12-0.266%2C0.265v2.029%20c0%2C0.148%2C0.12%2C0.268%2C0.266%2C0.268h1.8l0%2C0c1.255-0.014%2C2.239-0.667%2C2.958-1.24c0.82-0.661%2C1.572-1.475%2C2.297-2.256%20C9.225%2C10.524%2C9.555%2C10.169%2C9.884%2C9.838z%22%2F%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-fork {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%236A6C8A%22%20d%3D%22M13.307%2C11.593c-0.69%2C0-1.299%2C0.33-1.693%2C0.835l-4.136-2.387%20C7.552%2C9.82%2C7.602%2C9.589%2C7.602%2C9.344c0-0.25-0.051-0.487-0.129-0.71l4.097-2.364c0.393%2C0.536%2C1.022%2C0.888%2C1.737%2C0.888%20c1.193%2C0%2C2.16-0.967%2C2.16-2.159s-0.967-2.159-2.16-2.159c-1.191%2C0-2.158%2C0.967-2.158%2C2.159c0%2C0.076%2C0.014%2C0.149%2C0.021%2C0.223%20L6.848%2C7.716C6.469%2C7.39%2C5.982%2C7.185%2C5.442%2C7.185c-1.191%2C0-2.158%2C0.967-2.158%2C2.159s0.967%2C2.159%2C2.158%2C2.159%20c0.545%2C0%2C1.037-0.208%2C1.417-0.541l4.319%2C2.493c-0.014%2C0.098-0.029%2C0.194-0.029%2C0.296c0%2C1.193%2C0.967%2C2.159%2C2.158%2C2.159%20c1.193%2C0%2C2.16-0.966%2C2.16-2.159C15.467%2C12.559%2C14.5%2C11.593%2C13.307%2C11.593z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-fork:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23FD6EB6%22%20d%3D%22M13.307%2C11.593c-0.69%2C0-1.299%2C0.33-1.693%2C0.835l-4.136-2.387%20c0.075-0.22%2C0.125-0.452%2C0.125-0.697c0-0.25-0.051-0.487-0.129-0.71l4.097-2.365c0.394%2C0.536%2C1.022%2C0.888%2C1.737%2C0.888%20c1.193%2C0%2C2.16-0.967%2C2.16-2.159s-0.967-2.159-2.16-2.159c-1.191%2C0-2.158%2C0.967-2.158%2C2.159c0%2C0.076%2C0.015%2C0.148%2C0.022%2C0.223%20L6.848%2C7.716C6.469%2C7.39%2C5.981%2C7.185%2C5.442%2C7.185c-1.191%2C0-2.158%2C0.967-2.158%2C2.159s0.967%2C2.159%2C2.158%2C2.159%20c0.545%2C0%2C1.037-0.208%2C1.417-0.541l4.319%2C2.493c-0.013%2C0.098-0.029%2C0.194-0.029%2C0.296c0%2C1.193%2C0.967%2C2.159%2C2.158%2C2.159%20c1.193%2C0%2C2.16-0.966%2C2.16-2.159C15.467%2C12.559%2C14.5%2C11.593%2C13.307%2C11.593z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-unlink {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.285%2C9.711l-2.104-0.302L9.243%2C8.568L6.669%2C7.095C6.948%2C6.6%2C6.995%2C6.026%2C6.845%2C5.474%20c-0.191-0.698-0.695-1.36-1.438-1.786C4.068%2C2.922%2C2.464%2C3.214%2C1.82%2C4.338C1.536%2C4.836%2C1.489%2C5.414%2C1.64%2C5.97%20c0.189%2C0.698%2C0.694%2C1.36%2C1.438%2C1.787c0.328%2C0.187%2C0.67%2C0.31%2C1.01%2C0.372c0.002%2C0%2C0.006%2C0.002%2C0.008%2C0.004%20c0.027%2C0.004%2C0.057%2C0.009%2C0.088%2C0.011c2.12%2C0.316%2C3.203%2C0.915%2C3.73%2C1.337c-0.527%2C0.424-1.61%2C1.021-3.731%2C1.339%20c-0.029%2C0.003-0.058%2C0.007-0.087%2C0.012c-0.002%2C0.002-0.004%2C0.002-0.007%2C0.003c-0.341%2C0.062-0.684%2C0.187-1.013%2C0.374%20c-0.74%2C0.425-1.246%2C1.089-1.437%2C1.787c-0.149%2C0.555-0.105%2C1.133%2C0.181%2C1.632c0.011%2C0.018%2C0.021%2C0.033%2C0.033%2C0.049l0.883%2C0.783%20c0.765%2C0.366%2C1.775%2C0.328%2C2.67-0.184c0.744-0.425%2C1.248-1.088%2C1.439-1.786c0.148-0.552%2C0.104-1.126-0.176-1.62l2.573-1.473%20c0.573%2C0.287%2C2.299%2C1.292%2C2.299%2C1.292s3.602%2C1.445%2C4.241%2C1.812c0.773%2C0.191%2C0.566-0.151%2C0.566-0.151L12.285%2C9.711z%20M5.571%2C6.482%20C5.279%2C6.993%2C4.425%2C7.076%2C3.705%2C6.664C3.282%2C6.424%2C2.966%2C6.039%2C2.856%2C5.64C2.81%2C5.464%2C2.778%2C5.203%2C2.917%2C4.963%20c0.291-0.51%2C1.146-0.593%2C1.866-0.182C5.21%2C5.027%2C5.521%2C5.4%2C5.632%2C5.807C5.679%2C5.98%2C5.708%2C6.242%2C5.571%2C6.482z%20M5.632%2C13.159%20c-0.111%2C0.406-0.422%2C0.778-0.848%2C1.025c-0.719%2C0.409-1.576%2C0.327-1.867-0.184c-0.137-0.239-0.106-0.499-0.06-0.676%20c0.108-0.398%2C0.426-0.781%2C0.847-1.022c0.72-0.412%2C1.574-0.329%2C1.866%2C0.181C5.708%2C12.723%2C5.679%2C12.983%2C5.632%2C13.159z%20M16.181%2C5.139%20c-0.448%2C0.258-4.435%2C1.9-4.435%2C1.9s-1.556%2C0.855-2.104%2C1.13l0.937%2C0.843l2.057-0.229l4.11-3.638%20C16.745%2C5.146%2C17.013%2C4.664%2C16.181%2C5.139z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-unlink:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M12.285%2C9.711l-2.104-0.302L9.243%2C8.568L6.669%2C7.095C6.948%2C6.6%2C6.995%2C6.026%2C6.845%2C5.474%20c-0.191-0.698-0.695-1.36-1.438-1.786C4.068%2C2.922%2C2.464%2C3.214%2C1.82%2C4.338C1.536%2C4.836%2C1.489%2C5.414%2C1.64%2C5.97%20c0.189%2C0.698%2C0.694%2C1.36%2C1.438%2C1.787c0.328%2C0.187%2C0.67%2C0.31%2C1.01%2C0.372c0.002%2C0%2C0.006%2C0.002%2C0.008%2C0.004%20c0.027%2C0.004%2C0.057%2C0.009%2C0.088%2C0.011c2.12%2C0.316%2C3.203%2C0.915%2C3.73%2C1.337c-0.527%2C0.424-1.61%2C1.021-3.731%2C1.339%20c-0.029%2C0.003-0.058%2C0.007-0.087%2C0.012c-0.002%2C0.002-0.004%2C0.002-0.007%2C0.003c-0.341%2C0.062-0.684%2C0.187-1.013%2C0.374%20c-0.74%2C0.425-1.246%2C1.089-1.437%2C1.787c-0.149%2C0.555-0.105%2C1.133%2C0.181%2C1.632c0.011%2C0.018%2C0.021%2C0.033%2C0.033%2C0.049l0.883%2C0.783%20c0.765%2C0.366%2C1.775%2C0.328%2C2.67-0.184c0.744-0.425%2C1.248-1.088%2C1.439-1.786c0.148-0.552%2C0.104-1.126-0.176-1.62l2.573-1.473%20c0.573%2C0.287%2C2.299%2C1.292%2C2.299%2C1.292s3.602%2C1.445%2C4.241%2C1.812c0.773%2C0.191%2C0.566-0.151%2C0.566-0.151L12.285%2C9.711z%20M5.571%2C6.482%20C5.279%2C6.993%2C4.425%2C7.076%2C3.705%2C6.664C3.282%2C6.424%2C2.966%2C6.039%2C2.856%2C5.64C2.81%2C5.464%2C2.778%2C5.203%2C2.917%2C4.963%20c0.291-0.51%2C1.146-0.593%2C1.866-0.182C5.21%2C5.027%2C5.521%2C5.4%2C5.632%2C5.807C5.679%2C5.98%2C5.708%2C6.242%2C5.571%2C6.482z%20M5.632%2C13.159%20c-0.111%2C0.406-0.422%2C0.778-0.848%2C1.025c-0.719%2C0.409-1.576%2C0.327-1.867-0.184c-0.137-0.239-0.106-0.499-0.06-0.676%20c0.108-0.398%2C0.426-0.781%2C0.847-1.022c0.72-0.412%2C1.574-0.329%2C1.866%2C0.181C5.708%2C12.723%2C5.679%2C12.983%2C5.632%2C13.159z%20M16.181%2C5.139%20c-0.448%2C0.258-4.435%2C1.9-4.435%2C1.9s-1.556%2C0.855-2.104%2C1.13l0.937%2C0.843l2.057-0.229l4.11-3.638%20C16.745%2C5.146%2C17.013%2C4.664%2C16.181%2C5.139z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-direction {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20%20PUBLIC%20'-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN'%20%20'http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd'%3E%3Csvg%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%20512%20512%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%20512%20512%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%236A6C8A%3Bstroke%3A%236A6C8A%3Bstroke-width%3A30%7D%0A%09.dot%7Bfill%3A%236A6C8A%3B%7D%0A%3C%2Fstyle%3E%3Cg%3E%3Cg%20id%3D%22XMLID_475_%22%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M133.1%2C277.1c1.8%2C0%2C3.7-0.6%2C5.4-1.7c4.1-3%2C5-8.7%2C2-12.8c-3-4.1-8.7-5-12.8-2c0%2C0%2C0%2C0%2C0%2C0%20%20%20%20%20c-4.1%2C3-5%2C8.7-2%2C12.8C127.5%2C275.8%2C130.3%2C277.1%2C133.1%2C277.1z%22%20id%3D%22XMLID_489_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M138.5%2C359.6c-4.1-3-9.8-2.1-12.8%2C2c-3%2C4.1-2.1%2C9.8%2C2%2C12.8c1.6%2C1.2%2C3.5%2C1.7%2C5.4%2C1.7%20%20%20%20%20c2.8%2C0%2C5.6-1.3%2C7.4-3.7C143.5%2C368.3%2C142.6%2C362.6%2C138.5%2C359.6z%22%20id%3D%22XMLID_726_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C327.7c-4.8%2C1.6-7.4%2C6.7-5.9%2C11.5c1.3%2C3.9%2C4.8%2C6.3%2C8.7%2C6.3c0.9%2C0%2C1.9-0.1%2C2.8-0.4%20%20%20%20%20c4.8-1.6%2C7.4-6.7%2C5.9-11.5C118%2C328.8%2C112.9%2C326.2%2C108.1%2C327.7z%22%20id%3D%22XMLID_776_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C307.3c0.9%2C0.3%2C1.9%2C0.4%2C2.8%2C0.4c3.8%2C0%2C7.4-2.4%2C8.7-6.3c1.6-4.8-1.1-9.9-5.9-11.5%20%20%20%20%20c-4.8-1.6-9.9%2C1.1-11.5%2C5.9C100.7%2C300.6%2C103.3%2C305.7%2C108.1%2C307.3z%22%20id%3D%22XMLID_777_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M169.2%2C265.4c2.4%2C0%2C4.7-1%2C6.5-2.6c1.7-1.7%2C2.7-4.1%2C2.7-6.5c0-2.4-1-4.8-2.7-6.5%20%20%20%20%20c-1.7-1.7-4.1-2.7-6.5-2.7s-4.7%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.5C164.4%2C264.4%2C166.8%2C265.4%2C169.2%2C265.4z%22%20id%3D%22XMLID_797_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M247.7%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C243.7%2C265.4%2C247.7%2C261.3%2C247.7%2C256.3z%22%20id%3D%22XMLID_798_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M213%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C208.9%2C265.4%2C213%2C261.3%2C213%2C256.3z%22%20id%3D%22XMLID_799_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M317.2%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C313.1%2C265.4%2C317.2%2C261.3%2C317.2%2C256.3z%22%20id%3D%22XMLID_800_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M282.5%2C256.3c0-5-4.1-9.1-9.1-9.1s-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20S282.5%2C261.3%2C282.5%2C256.3z%22%20id%3D%22XMLID_801_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M401.1%2C185.2c0.9%2C0%2C1.9-0.1%2C2.8-0.5c4.8-1.6%2C7.4-6.7%2C5.9-11.5c-1.6-4.8-6.7-7.4-11.5-5.8%20%20%20%20%20c-4.8%2C1.6-7.4%2C6.7-5.8%2C11.5C393.6%2C182.8%2C397.2%2C185.2%2C401.1%2C185.2z%22%20id%3D%22XMLID_802_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M403.9%2C205.2c-4.8-1.6-9.9%2C1-11.5%2C5.9l0%2C0c-1.6%2C4.8%2C1.1%2C9.9%2C5.9%2C11.5%20%20%20%20%20c0.9%2C0.3%2C1.9%2C0.5%2C2.8%2C0.5c3.9%2C0%2C7.4-2.5%2C8.7-6.3c0%2C0%2C0%2C0%2C0%2C0C411.3%2C211.9%2C408.7%2C206.8%2C403.9%2C205.2z%22%20id%3D%22XMLID_803_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C237.2L373.5%2C237.2c-4.1%2C3-5%2C8.7-2%2C12.8c1.8%2C2.4%2C4.6%2C3.7%2C7.4%2C3.7%20%20%20%20%20c1.8%2C0%2C3.7-0.6%2C5.4-1.8c4.1-3%2C4.9-8.7%2C2-12.8C383.3%2C235.1%2C377.6%2C234.2%2C373.5%2C237.2z%22%20id%3D%22XMLID_804_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C152.9c1.6%2C1.2%2C3.5%2C1.8%2C5.4%2C1.8c2.8%2C0%2C5.6-1.3%2C7.4-3.8c3-4.1%2C2.1-9.8-2-12.7%20%20%20%20%20c-4.1-3-9.8-2.1-12.7%2C2C368.5%2C144.2%2C369.4%2C149.9%2C373.5%2C152.9z%22%20id%3D%22XMLID_805_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M342.8%2C247.1c-2.4%2C0-4.8%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.4%20%20%20%20%20c1.7%2C1.7%2C4%2C2.7%2C6.5%2C2.7c2.4%2C0%2C4.7-1%2C6.5-2.7c1.7-1.7%2C2.7-4%2C2.7-6.4c0-2.4-1-4.8-2.7-6.5C347.6%2C248.1%2C345.2%2C247.1%2C342.8%2C247.1z%22%20id%3D%22XMLID_806_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M342.8%2C124.7H206.6l36.4-36.4c3.6-3.6%2C3.6-9.3%2C0-12.9c-3.6-3.6-9.3-3.6-12.9%2C0l-51.5%2C51.5%20%20%20%20%20c-1.9%2C1.9-2.8%2C4.4-2.7%2C6.9c-0.1%2C2.5%2C0.7%2C5%2C2.7%2C6.9l51.5%2C51.5c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7%20%20%20%20%20c3.6-3.6%2C3.6-9.3%2C0-12.9l-36.4-36.4h136.1c0%2C0%2C0.1%2C0%2C0.1%2C0c0.6%2C0%2C1.2-0.1%2C1.8-0.2c0.2%2C0%2C0.4-0.1%2C0.6-0.1c0.1%2C0%2C0.2%2C0%2C0.3-0.1%20%20%20%20%20c3.2-1%2C5.6-3.6%2C6.3-6.9c0.1-0.6%2C0.2-1.2%2C0.2-1.8c0-0.6-0.1-1.2-0.2-1.8C351%2C127.8%2C347.3%2C124.7%2C342.8%2C124.7z%22%20id%3D%22XMLID_807_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M322.1%2C371.3l-51.5-51.5c-3.6-3.6-9.3-3.6-12.9%2C0c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9l36.9%2C36.9H169.2%20%20%20%20%20c-2.8%2C0-5.4%2C1.3-7%2C3.3c-0.1%2C0.1-0.2%2C0.2-0.3%2C0.4c-0.1%2C0.1-0.2%2C0.2-0.2%2C0.3c-0.1%2C0.1-0.1%2C0.2-0.2%2C0.4c-0.1%2C0.1-0.2%2C0.3-0.2%2C0.4%20%20%20%20%20c0%2C0.1-0.1%2C0.2-0.1%2C0.2c-0.1%2C0.2-0.2%2C0.4-0.3%2C0.6c0%2C0%2C0%2C0%2C0%2C0.1c-0.4%2C1.1-0.7%2C2.2-0.7%2C3.4c0%2C1.5%2C0.4%2C2.9%2C1%2C4.2c0%2C0%2C0%2C0.1%2C0.1%2C0.1%20%20%20%20%20c0.1%2C0.1%2C0.1%2C0.2%2C0.2%2C0.3c0.4%2C0.7%2C0.9%2C1.3%2C1.4%2C1.8c0.4%2C0.4%2C0.7%2C0.7%2C1.2%2C1c0.1%2C0.1%2C0.1%2C0.1%2C0.2%2C0.2c0%2C0%2C0.1%2C0%2C0.1%2C0.1%20%20%20%20%20c1.4%2C0.9%2C3.1%2C1.5%2C5%2C1.5h124.4l-36%2C36c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7l51.5-51.5%20%20%20%20%20c1.9-1.9%2C2.8-4.4%2C2.7-6.9C324.8%2C375.7%2C324%2C373.2%2C322.1%2C371.3z%22%20id%3D%22XMLID_808_%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n}\n.x6-widget-handle-direction:hover {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20%20PUBLIC%20'-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN'%20%20'http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd'%3E%3Csvg%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%20512%20512%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%20512%20512%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%23FD6EB6%3Bstroke%3A%23FD6EB6%3Bstroke-width%3A30%7D%0A%09.dot%7Bfill%3A%23FD6EB6%3B%7D%0A%3C%2Fstyle%3E%3Cg%3E%3Cg%20id%3D%22XMLID_475_%22%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M133.1%2C277.1c1.8%2C0%2C3.7-0.6%2C5.4-1.7c4.1-3%2C5-8.7%2C2-12.8c-3-4.1-8.7-5-12.8-2c0%2C0%2C0%2C0%2C0%2C0%20%20%20%20%20c-4.1%2C3-5%2C8.7-2%2C12.8C127.5%2C275.8%2C130.3%2C277.1%2C133.1%2C277.1z%22%20id%3D%22XMLID_489_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M138.5%2C359.6c-4.1-3-9.8-2.1-12.8%2C2c-3%2C4.1-2.1%2C9.8%2C2%2C12.8c1.6%2C1.2%2C3.5%2C1.7%2C5.4%2C1.7%20%20%20%20%20c2.8%2C0%2C5.6-1.3%2C7.4-3.7C143.5%2C368.3%2C142.6%2C362.6%2C138.5%2C359.6z%22%20id%3D%22XMLID_726_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C327.7c-4.8%2C1.6-7.4%2C6.7-5.9%2C11.5c1.3%2C3.9%2C4.8%2C6.3%2C8.7%2C6.3c0.9%2C0%2C1.9-0.1%2C2.8-0.4%20%20%20%20%20c4.8-1.6%2C7.4-6.7%2C5.9-11.5C118%2C328.8%2C112.9%2C326.2%2C108.1%2C327.7z%22%20id%3D%22XMLID_776_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C307.3c0.9%2C0.3%2C1.9%2C0.4%2C2.8%2C0.4c3.8%2C0%2C7.4-2.4%2C8.7-6.3c1.6-4.8-1.1-9.9-5.9-11.5%20%20%20%20%20c-4.8-1.6-9.9%2C1.1-11.5%2C5.9C100.7%2C300.6%2C103.3%2C305.7%2C108.1%2C307.3z%22%20id%3D%22XMLID_777_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M169.2%2C265.4c2.4%2C0%2C4.7-1%2C6.5-2.6c1.7-1.7%2C2.7-4.1%2C2.7-6.5c0-2.4-1-4.8-2.7-6.5%20%20%20%20%20c-1.7-1.7-4.1-2.7-6.5-2.7s-4.7%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.5C164.4%2C264.4%2C166.8%2C265.4%2C169.2%2C265.4z%22%20id%3D%22XMLID_797_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M247.7%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C243.7%2C265.4%2C247.7%2C261.3%2C247.7%2C256.3z%22%20id%3D%22XMLID_798_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M213%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C208.9%2C265.4%2C213%2C261.3%2C213%2C256.3z%22%20id%3D%22XMLID_799_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M317.2%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C313.1%2C265.4%2C317.2%2C261.3%2C317.2%2C256.3z%22%20id%3D%22XMLID_800_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M282.5%2C256.3c0-5-4.1-9.1-9.1-9.1s-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20S282.5%2C261.3%2C282.5%2C256.3z%22%20id%3D%22XMLID_801_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M401.1%2C185.2c0.9%2C0%2C1.9-0.1%2C2.8-0.5c4.8-1.6%2C7.4-6.7%2C5.9-11.5c-1.6-4.8-6.7-7.4-11.5-5.8%20%20%20%20%20c-4.8%2C1.6-7.4%2C6.7-5.8%2C11.5C393.6%2C182.8%2C397.2%2C185.2%2C401.1%2C185.2z%22%20id%3D%22XMLID_802_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M403.9%2C205.2c-4.8-1.6-9.9%2C1-11.5%2C5.9l0%2C0c-1.6%2C4.8%2C1.1%2C9.9%2C5.9%2C11.5%20%20%20%20%20c0.9%2C0.3%2C1.9%2C0.5%2C2.8%2C0.5c3.9%2C0%2C7.4-2.5%2C8.7-6.3c0%2C0%2C0%2C0%2C0%2C0C411.3%2C211.9%2C408.7%2C206.8%2C403.9%2C205.2z%22%20id%3D%22XMLID_803_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C237.2L373.5%2C237.2c-4.1%2C3-5%2C8.7-2%2C12.8c1.8%2C2.4%2C4.6%2C3.7%2C7.4%2C3.7%20%20%20%20%20c1.8%2C0%2C3.7-0.6%2C5.4-1.8c4.1-3%2C4.9-8.7%2C2-12.8C383.3%2C235.1%2C377.6%2C234.2%2C373.5%2C237.2z%22%20id%3D%22XMLID_804_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C152.9c1.6%2C1.2%2C3.5%2C1.8%2C5.4%2C1.8c2.8%2C0%2C5.6-1.3%2C7.4-3.8c3-4.1%2C2.1-9.8-2-12.7%20%20%20%20%20c-4.1-3-9.8-2.1-12.7%2C2C368.5%2C144.2%2C369.4%2C149.9%2C373.5%2C152.9z%22%20id%3D%22XMLID_805_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M342.8%2C247.1c-2.4%2C0-4.8%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.4%20%20%20%20%20c1.7%2C1.7%2C4%2C2.7%2C6.5%2C2.7c2.4%2C0%2C4.7-1%2C6.5-2.7c1.7-1.7%2C2.7-4%2C2.7-6.4c0-2.4-1-4.8-2.7-6.5C347.6%2C248.1%2C345.2%2C247.1%2C342.8%2C247.1z%22%20id%3D%22XMLID_806_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M342.8%2C124.7H206.6l36.4-36.4c3.6-3.6%2C3.6-9.3%2C0-12.9c-3.6-3.6-9.3-3.6-12.9%2C0l-51.5%2C51.5%20%20%20%20%20c-1.9%2C1.9-2.8%2C4.4-2.7%2C6.9c-0.1%2C2.5%2C0.7%2C5%2C2.7%2C6.9l51.5%2C51.5c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7%20%20%20%20%20c3.6-3.6%2C3.6-9.3%2C0-12.9l-36.4-36.4h136.1c0%2C0%2C0.1%2C0%2C0.1%2C0c0.6%2C0%2C1.2-0.1%2C1.8-0.2c0.2%2C0%2C0.4-0.1%2C0.6-0.1c0.1%2C0%2C0.2%2C0%2C0.3-0.1%20%20%20%20%20c3.2-1%2C5.6-3.6%2C6.3-6.9c0.1-0.6%2C0.2-1.2%2C0.2-1.8c0-0.6-0.1-1.2-0.2-1.8C351%2C127.8%2C347.3%2C124.7%2C342.8%2C124.7z%22%20id%3D%22XMLID_807_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M322.1%2C371.3l-51.5-51.5c-3.6-3.6-9.3-3.6-12.9%2C0c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9l36.9%2C36.9H169.2%20%20%20%20%20c-2.8%2C0-5.4%2C1.3-7%2C3.3c-0.1%2C0.1-0.2%2C0.2-0.3%2C0.4c-0.1%2C0.1-0.2%2C0.2-0.2%2C0.3c-0.1%2C0.1-0.1%2C0.2-0.2%2C0.4c-0.1%2C0.1-0.2%2C0.3-0.2%2C0.4%20%20%20%20%20c0%2C0.1-0.1%2C0.2-0.1%2C0.2c-0.1%2C0.2-0.2%2C0.4-0.3%2C0.6c0%2C0%2C0%2C0%2C0%2C0.1c-0.4%2C1.1-0.7%2C2.2-0.7%2C3.4c0%2C1.5%2C0.4%2C2.9%2C1%2C4.2c0%2C0%2C0%2C0.1%2C0.1%2C0.1%20%20%20%20%20c0.1%2C0.1%2C0.1%2C0.2%2C0.2%2C0.3c0.4%2C0.7%2C0.9%2C1.3%2C1.4%2C1.8c0.4%2C0.4%2C0.7%2C0.7%2C1.2%2C1c0.1%2C0.1%2C0.1%2C0.1%2C0.2%2C0.2c0%2C0%2C0.1%2C0%2C0.1%2C0.1%20%20%20%20%20c1.4%2C0.9%2C3.1%2C1.5%2C5%2C1.5h124.4l-36%2C36c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7l51.5-51.5%20%20%20%20%20c1.9-1.9%2C2.8-4.4%2C2.7-6.9C324.8%2C375.7%2C324%2C373.2%2C322.1%2C371.3z%22%20id%3D%22XMLID_808_%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n}\n.x6-widget-handle-surround .x6-widget-handle-animate .x6-widget-handle {\n transition: background-size 80ms, width 80ms, height 80ms, top 150ms, left 150ms, bottom 150ms, right 150ms;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-se {\n right: -25px;\n bottom: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-nw {\n top: -21px;\n left: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-n {\n top: -22px;\n left: 50%;\n margin-left: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-e {\n top: -webkit-calc(40%);\n top: calc(50% - 10px);\n right: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-ne {\n top: -21px;\n right: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-w {\n top: 50%;\n left: -25px;\n margin-top: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-sw {\n bottom: -25px;\n left: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-s {\n bottom: -24px;\n left: 50%;\n margin-left: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle {\n width: 15px;\n height: 15px;\n font-size: 15px;\n background-size: 15px 15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-se {\n right: -19px;\n bottom: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-nw {\n top: -19px;\n left: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-n {\n top: -19px;\n margin-left: -7.5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-e {\n top: -webkit-calc(42%);\n top: calc(50% - 8px);\n right: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-ne {\n top: -19px;\n right: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-w {\n left: -19px;\n margin-top: -8px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-sw {\n bottom: -19px;\n left: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-s {\n bottom: -19px;\n margin-left: -7.5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle {\n width: 10px;\n height: 10px;\n font-size: 10px;\n background-size: 10px 10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-se {\n right: -15px;\n bottom: -13px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-nw {\n top: -13px;\n left: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-n {\n top: -13px;\n margin-left: -5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-e {\n top: -webkit-calc(45%);\n top: calc(50% - 5px);\n right: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-ne {\n top: -13px;\n right: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-w {\n left: -15px;\n margin-top: -5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-sw {\n bottom: -13px;\n left: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-s {\n bottom: -13px;\n margin-left: -5px;\n}\n.x6-widget-handle-toolbar {\n position: absolute;\n top: -50px;\n display: table-row;\n padding: 7px 5px;\n}\n.x6-widget-handle-toolbar::after {\n position: absolute;\n top: 100%;\n left: 10px;\n width: 0;\n height: 0;\n margin-top: 4px;\n border-right: 10px solid transparent;\n border-left: 10px solid transparent;\n content: '';\n}\n.x6-widget-handle-toolbar .x6-widget-handle {\n position: relative;\n display: table-cell;\n min-width: 20px;\n margin: 0 2px;\n background-position: 3px 3px;\n background-size: 16px 16px;\n}\n.x6-widget-handle-toolbar .x6-widget-handle::after {\n position: absolute;\n bottom: -11px;\n width: 100%;\n content: '';\n}\n.x6-widget-handle-pie {\n position: absolute;\n top: -webkit-calc(0%);\n top: calc(50% - 50px);\n right: -50px;\n z-index: 1;\n display: none;\n width: 100px;\n height: 100px;\n margin: -2px -2px 0 0;\n border-radius: 50%;\n cursor: default;\n pointer-events: visiblePainted;\n}\n.x6-widget-handle-pie .x6-widget-handle {\n width: 1px;\n height: auto;\n pointer-events: visiblePainted;\n}\n.x6-widget-handle-pie-slice-svg {\n width: 100%;\n height: 100%;\n overflow: visible !important;\n}\n.x6-widget-handle-pie-slice-img,\n.x6-widget-handle-pie-slice-txt {\n display: none;\n pointer-events: none;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='e'] {\n top: calc(50% - 50px);\n right: -50px;\n left: auto;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='w'] {\n top: calc(50% - 50px);\n right: auto;\n left: -52px;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='n'] {\n top: -50px;\n right: auto;\n bottom: auto;\n left: calc(50% - 52px);\n}\n.x6-widget-handle-pie[data-pie-toggle-position='s'] {\n top: auto;\n right: auto;\n bottom: -52px;\n left: calc(50% - 52px);\n}\n.x6-widget-handle-pie-opened {\n display: block;\n animation: halo-pie-visibility 0.1s, halo-pie-opening 0.1s;\n animation-timing-function: step-end, ease;\n animation-delay: 0s, 0.1s;\n}\n.x6-widget-handle-pie-toggle {\n position: absolute;\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: -15px;\n z-index: 2;\n display: block;\n box-sizing: border-box;\n width: 30px;\n height: 30px;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 20px 20px;\n border-radius: 50%;\n cursor: pointer;\n user-select: none;\n pointer-events: visiblePainted;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-handle-pie-toggle-pos-e {\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: -15px;\n bottom: auto;\n left: auto;\n}\n.x6-widget-handle-pie-toggle-pos-w {\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: auto;\n bottom: auto;\n left: -15px;\n}\n.x6-widget-handle-pie-toggle-pos-n {\n top: -15px;\n right: auto;\n bottom: auto;\n left: -webkit-calc(35%);\n left: calc(50% - 15px);\n}\n.x6-widget-handle-pie-toggle-pos-s {\n top: auto;\n right: auto;\n bottom: -15px;\n left: -webkit-calc(35%);\n left: calc(50% - 15px);\n}\n.x6-widget-handle-pie-toggle-opened {\n transition: 0.1s background-image;\n}\n.x6-widget-handle-toolbar {\n position: static;\n display: inline-block;\n margin-top: -50px;\n margin-left: 45px;\n white-space: nowrap;\n vertical-align: top;\n background-color: #f5f5f5;\n border-bottom: 3px solid #333;\n border-radius: 5px;\n box-shadow: 0 1px 2px #222;\n}\n.x6-widget-handle-toolbar::after {\n top: -12px;\n left: 55px;\n margin-top: 0;\n border-top: 6px solid #333;\n border-right: 10px solid transparent;\n border-left: 10px solid transparent;\n}\n.x6-widget-handle-toolbar .x6-widget-handle {\n display: inline-block;\n vertical-align: top;\n}\n.x6-widget-handle-toolbar .x6-widget-handle:hover::after {\n border-bottom: 4px solid #fc6cb8;\n}\n.x6-widget-handle-toolbar .x6-widget-handle-rotate {\n position: absolute;\n top: 100%;\n right: 100%;\n margin-top: 3px;\n margin-right: 6px;\n}\n.x6-widget-handle-toolbar .x6-widget-handle-remove:hover::after,\n.x6-widget-handle-toolbar .x6-widget-handle-rotate:hover::after {\n border-bottom: none;\n}\n.x6-widget-handle-toolbar .x6-widget-handle + .x6-widget-handle {\n margin-left: 4px;\n}\n.x6-widget-handle-pie {\n box-sizing: content-box;\n background-color: #f5f5f5;\n border: 2px solid #404040;\n}\n.x6-widget-handle-pie-slice {\n fill: transparent;\n stroke: #e9e9e9;\n stroke-width: 1;\n}\n.x6-widget-handle-pie-slice:hover {\n fill: #fff;\n}\n.x6-widget-handle-pie-slice-img {\n display: block;\n}\n.x6-widget-handle-selected .x6-widget-handle-pie-slice {\n fill: #fff;\n}\n.x6-widget-handle-pie-toggle {\n background-color: #f6f6f6;\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20height%3D%2216px%22%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%2016%2016%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%2016%2016%22%20width%3D%2216px%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15%2C6h-5V1c0-0.55-0.45-1-1-1H7C6.45%2C0%2C6%2C0.45%2C6%2C1v5H1C0.45%2C6%2C0%2C6.45%2C0%2C7v2c0%2C0.55%2C0.45%2C1%2C1%2C1h5v5c0%2C0.55%2C0.45%2C1%2C1%2C1h2%20c0.55%2C0%2C1-0.45%2C1-1v-5h5c0.55%2C0%2C1-0.45%2C1-1V7C16%2C6.45%2C15.55%2C6%2C15%2C6z%22%2F%3E%3C%2Fsvg%3E');\n background-size: 16px 16px;\n border: 2px solid #3b425f;\n}\n.x6-widget-handle-pie-toggle:hover {\n background-color: #fff;\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20height%3D%2216px%22%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%2016%2016%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%2016%2016%22%20width%3D%2216px%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M15%2C6h-5V1c0-0.55-0.45-1-1-1H7C6.45%2C0%2C6%2C0.45%2C6%2C1v5H1C0.45%2C6%2C0%2C6.45%2C0%2C7v2c0%2C0.55%2C0.45%2C1%2C1%2C1h5v5c0%2C0.55%2C0.45%2C1%2C1%2C1h2%20c0.55%2C0%2C1-0.45%2C1-1v-5h5c0.55%2C0%2C1-0.45%2C1-1V7C16%2C6.45%2C15.55%2C6%2C15%2C6z%22%2F%3E%3C%2Fsvg%3E');\n border-color: #fd6eb6;\n}\n.x6-widget-handle-pie-toggle-opened {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%20xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20id%3D%22Layer_1%22%20xml%3Aspace%3D%22preserve%22%3E%3Cmetadata%20id%3D%22metadata9%22%3E%3Crdf%3ARDF%3E%3Ccc%3AWork%20rdf%3Aabout%3D%22%22%3E%3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E%3Cdc%3Atype%20rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22%20%2F%3E%3Cdc%3Atitle%3E%3C%2Fdc%3Atitle%3E%3C%2Fcc%3AWork%3E%3C%2Frdf%3ARDF%3E%3C%2Fmetadata%3E%3Cdefs%20id%3D%22defs7%22%20%2F%3E%3Cpath%20d%3D%22M%2015%2C6%2010%2C6%20C%201.0301983%2C6.00505%2015.002631%2C6.011353%206%2C6%20L%201%2C6%20C%200.45%2C6%200%2C6.45%200%2C7%20l%200%2C2%20c%200%2C0.55%200.45%2C1%201%2C1%20l%205%2C0%20c%208.988585%2C-0.019732%20-5.02893401%2C-0.018728%204%2C0%20l%205%2C0%20c%200.55%2C0%201%2C-0.45%201%2C-1%20L%2016%2C7%20C%2016%2C6.45%2015.55%2C6%2015%2C6%20z%22%20id%3D%22path3%22%20style%3D%22fill%3A%236a6c8a%22%20%2F%3E%3C%2Fsvg%3E');\n}\n.x6-widget-handle-pie-toggle-opened:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%20xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20id%3D%22Layer_1%22%20xml%3Aspace%3D%22preserve%22%3E%3Cmetadata%20id%3D%22metadata9%22%3E%3Crdf%3ARDF%3E%3Ccc%3AWork%20rdf%3Aabout%3D%22%22%3E%3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E%3Cdc%3Atype%20rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22%20%2F%3E%3Cdc%3Atitle%3E%3C%2Fdc%3Atitle%3E%3C%2Fcc%3AWork%3E%3C%2Frdf%3ARDF%3E%3C%2Fmetadata%3E%3Cdefs%20id%3D%22defs7%22%20%2F%3E%3Cpath%20d%3D%22M%2015%2C6%2010%2C6%20C%201.0301983%2C6.00505%2015.002631%2C6.011353%206%2C6%20L%201%2C6%20C%200.45%2C6%200%2C6.45%200%2C7%20l%200%2C2%20c%200%2C0.55%200.45%2C1%201%2C1%20l%205%2C0%20c%208.988585%2C-0.019732%20-5.02893401%2C-0.018728%204%2C0%20l%205%2C0%20c%200.55%2C0%201%2C-0.45%201%2C-1%20L%2016%2C7%20C%2016%2C6.45%2015.55%2C6%2015%2C6%20z%22%20id%3D%22path3%22%20style%3D%22fill%3A%23FD6EB6%22%20%2F%3E%3C%2Fsvg%3E');\n}\n.x6-widget-dnd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n}\n.x6-widget-dnd.dragging {\n display: inline-block;\n}\n.x6-widget-dnd.dragging * {\n pointer-events: none !important;\n}\n.x6-widget-dnd .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n.x6-widget-halo {\n position: absolute;\n pointer-events: none;\n}\n.x6-widget-halo-content {\n position: absolute;\n top: 100%;\n padding: 6px;\n font-size: 10px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-halo-handles + .x6-widget-halo-content {\n right: -20px;\n left: -20px;\n margin-top: 30px;\n}\n.x6-widget-halo-handles.x6-widget-handle-small + .x6-widget-halo-content {\n margin-top: 25px;\n}\n.x6-widget-halo-handles.x6-widget-handle-small + .x6-widget-halo-content {\n margin-top: 20px;\n}\n.x6-widget-halo-handles.x6-widget-handle-pie + .x6-widget-halo-content {\n right: 0;\n left: 0;\n margin-top: 10px;\n}\n.x6-widget-halo-content {\n color: #fff;\n background-color: #6a6b8a;\n}\n.x6-widget-halo.type-node .x6-widget-handle-toolbar .x6-widget-handle-remove {\n position: absolute;\n right: 100%;\n bottom: 100%;\n margin-right: 6px;\n margin-bottom: 3px;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-surround .x6-widget-handle-remove {\n background-color: #fff;\n border-radius: 50%;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-toolbar {\n margin-top: -60px;\n margin-left: -18px;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-toolbar::after {\n top: -22px;\n left: -9px;\n}\n.x6-widget-minimap {\n position: relative;\n display: table-cell;\n box-sizing: border-box;\n overflow: hidden;\n text-align: center;\n vertical-align: middle;\n background-color: #fff;\n user-select: none;\n}\n.x6-widget-minimap .x6-graph {\n display: inline-block;\n box-shadow: 0 0 4px 0 #eee;\n cursor: pointer;\n}\n.x6-widget-minimap .x6-graph > svg {\n pointer-events: none;\n shape-rendering: optimizeSpeed;\n}\n.x6-widget-minimap .x6-graph .x6-node * {\n /* stylelint-disable-next-line */\n vector-effect: initial;\n}\n.x6-widget-minimap-viewport {\n position: absolute;\n box-sizing: content-box !important;\n margin: -2px 0 0 -2px;\n border: 2px solid #31d0c6;\n cursor: move;\n}\n.x6-widget-minimap-viewport-zoom {\n position: absolute;\n right: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 12px;\n height: 12px;\n margin: 0 -6px -6px 0;\n background-color: #fff;\n border: 2px solid #31d0c6;\n border-radius: 50%;\n cursor: nwse-resize;\n}\n.x6-graph-scroller {\n position: relative;\n box-sizing: border-box;\n overflow: scroll;\n outline: none;\n}\n.x6-graph-scroller-content {\n position: relative;\n}\n.x6-graph-scroller-background {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-scroller .x6-graph {\n position: absolute;\n display: inline-block;\n margin: 0;\n box-shadow: none;\n}\n.x6-graph-scroller .x6-graph > svg {\n display: block;\n}\n.x6-graph-scroller.x6-graph-scroller-paged .x6-graph {\n box-shadow: 0 0 4px 0 #eee;\n}\n.x6-graph-scroller.x6-graph-scroller-pannable[data-panning='false'] {\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n.x6-graph-scroller.x6-graph-scroller-pannable[data-panning='true'] {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n}\n.x6-graph-pagebreak {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-pagebreak-vertical {\n position: absolute;\n top: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 1px;\n border-left: 1px dashed #bdbdbd;\n}\n.x6-graph-pagebreak-horizontal {\n position: absolute;\n right: 0;\n left: 0;\n box-sizing: border-box;\n height: 1px;\n border-top: 1px dashed #bdbdbd;\n}\n.x6-widget-selection {\n position: absolute;\n display: none;\n width: 0;\n height: 0;\n touch-action: none;\n}\n.x6-widget-selection-rubberband {\n display: block;\n overflow: visible;\n opacity: 0.3;\n}\n.x6-widget-selection-selected {\n display: block;\n}\n.x6-widget-selection-box {\n cursor: move;\n}\n.x6-widget-selection-inner[data-selection-length='0'],\n.x6-widget-selection-inner[data-selection-length='1'] {\n display: none;\n}\n.x6-widget-selection-content {\n position: absolute;\n top: 100%;\n right: -20px;\n left: -20px;\n margin-top: 30px;\n padding: 6px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-selection-content:empty {\n display: none;\n}\n.x6-widget-selection-rubberband {\n background-color: #3498db;\n border: 2px solid #2980b9;\n}\n.x6-widget-selection-box {\n box-sizing: content-box !important;\n margin-top: -4px;\n margin-left: -4px;\n padding-right: 4px;\n padding-bottom: 4px;\n border: 2px dashed #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-inner {\n box-sizing: content-box !important;\n margin-top: -8px;\n margin-left: -8px;\n padding-right: 12px;\n padding-bottom: 12px;\n border: 2px solid #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-content {\n color: #fff;\n font-size: 10px;\n background-color: #6a6b8a;\n}\n.x6-widget-snapline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n.x6-widget-snapline-vertical,\n.x6-widget-snapline-horizontal {\n position: absolute;\n opacity: 1;\n pointer-events: none;\n}\n.x6-widget-snapline-horizontal {\n border-bottom: 1px solid #2ecc71;\n}\n.x6-widget-snapline-vertical {\n border-right: 1px solid #2ecc71;\n}\n.x6-widget-stencil {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-widget-stencil::after {\n position: absolute;\n top: 0;\n display: block;\n width: 100%;\n height: 20px;\n padding: 8px 0;\n line-height: 20px;\n text-align: center;\n opacity: 0;\n transition: top 0.1s linear, opacity 0.1s linear;\n content: ' ';\n pointer-events: none;\n}\n.x6-widget-stencil-content {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: auto;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.x6-widget-stencil .x6-node [magnet]:not([magnet='passive']) {\n pointer-events: none;\n}\n.x6-widget-stencil-group {\n padding: 0;\n padding-bottom: 8px;\n overflow: hidden;\n user-select: none;\n}\n.x6-widget-stencil-group.collapsed {\n height: auto;\n padding-bottom: 0;\n}\n.x6-widget-stencil-group-title {\n position: relative;\n margin-top: 0;\n margin-bottom: 0;\n padding: 4px;\n cursor: pointer;\n}\n.x6-widget-stencil-title,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n user-select: none;\n}\n.x6-widget-stencil .unmatched {\n opacity: 0.3;\n}\n.x6-widget-stencil .x6-node.unmatched {\n display: none;\n}\n.x6-widget-stencil-group.unmatched {\n display: none;\n}\n.x6-widget-stencil-search-text {\n position: relative;\n z-index: 1;\n box-sizing: border-box;\n width: 100%;\n height: 30px;\n max-height: 30px;\n line-height: 30px;\n outline: 0;\n}\n.x6-widget-stencil.not-found::after {\n opacity: 1;\n content: attr(data-not-found-text);\n}\n.x6-widget-stencil.not-found.searchable::after {\n top: 30px;\n}\n.x6-widget-stencil.not-found.searchable.collapsable::after {\n top: 50px;\n}\n.x6-widget-stencil {\n color: #333;\n background: #f5f5f5;\n}\n.x6-widget-stencil-content {\n position: absolute;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-content {\n top: 32px;\n}\n.x6-widget-stencil.searchable > .x6-widget-stencil-content {\n top: 80px;\n}\n.x6-widget-stencil.not-found::after {\n position: absolute;\n}\n.x6-widget-stencil.not-found.searchable.collapsable::after {\n top: 80px;\n}\n.x6-widget-stencil.not-found.searchable::after {\n top: 60px;\n}\n.x6-widget-stencil-group {\n height: auto;\n margin-bottom: 1px;\n padding: 0;\n transition: none;\n}\n.x6-widget-stencil-group .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n.x6-widget-stencil-group.collapsed {\n height: auto;\n max-height: 31px;\n}\n.x6-widget-stencil-title,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n position: relative;\n left: 0;\n box-sizing: border-box;\n width: 100%;\n height: 32px;\n padding: 0 5px 0 8px;\n color: #666;\n font-weight: 700;\n font-size: 12px;\n line-height: 32px;\n cursor: default;\n transition: all 0.3;\n}\n.x6-widget-stencil-title:hover,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title:hover {\n color: #444;\n}\n.x6-widget-stencil-title {\n background: #e9e9e9;\n}\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n background: #ededed;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title {\n padding-left: 32px;\n cursor: pointer;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title::before {\n position: absolute;\n top: 6px;\n left: 8px;\n display: block;\n width: 18px;\n height: 18px;\n margin: 0;\n padding: 0;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: 0 0;\n border: none;\n content: ' ';\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNOS4zNzUuNUM0LjY4Ny41Ljg3NSA0LjMxMy44NzUgOWMwIDQuNjg4IDMuODEyIDguNSA4LjUgOC41IDQuNjg3IDAgOC41LTMuODEyIDguNS04LjUgMC00LjY4Ny0zLjgxMy04LjUtOC41LTguNXptMCAxNS44ODZDNS4zMDMgMTYuMzg2IDEuOTkgMTMuMDcyIDEuOTkgOXMzLjMxMi03LjM4NSA3LjM4NS03LjM4NVMxNi43NiA0LjkyOCAxNi43NiA5YzAgNC4wNzItMy4zMTMgNy4zODYtNy4zODUgNy4zODZ6Ii8+PHBhdGggZD0iTTEyLjc1MyA4LjQ0M0g1Ljk5N2EuNTU4LjU1OCAwIDAwMCAxLjExNmg2Ljc1NmEuNTU4LjU1OCAwIDAwMC0xLjExNnoiLz48L2c+PC9zdmc+');\n opacity: 0.4;\n transition: all 0.3s;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title:hover::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title:hover::before {\n opacity: 0.6;\n}\n.x6-widget-stencil.collapsable.collapsed > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable.collapsed > .x6-widget-stencil-group-title::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNOS4zNzUuNUM0LjY4Ny41Ljg3NSA0LjMxMy44NzUgOWMwIDQuNjg4IDMuODEyIDguNSA4LjUgOC41IDQuNjg3IDAgOC41LTMuODEyIDguNS04LjUgMC00LjY4Ny0zLjgxMy04LjUtOC41LTguNXptMCAxNS44ODZDNS4zMDMgMTYuMzg2IDEuOTkgMTMuMDcyIDEuOTkgOXMzLjMxMi03LjM4NSA3LjM4NS03LjM4NVMxNi43NiA0LjkyOCAxNi43NiA5YzAgNC4wNzItMy4zMTMgNy4zODYtNy4zODUgNy4zODZ6Ii8+PHBhdGggZD0iTTEyLjc1MyA4LjQ0M0g1Ljk5N2EuNTU4LjU1OCAwIDAwMCAxLjExNmg2Ljc1NmEuNTU4LjU1OCAwIDAwMC0xLjExNnoiLz48cGF0aCBkPSJNOC44MTcgNS42MjN2Ni43NTZhLjU1OC41NTggMCAwMDEuMTE2IDBWNS42MjNhLjU1OC41NTggMCAxMC0xLjExNiAweiIvPjwvZz48L3N2Zz4=');\n opacity: 0.4;\n}\n.x6-widget-stencil.collapsable.collapsed > .x6-widget-stencil-title:hover::before,\n.x6-widget-stencil-group.collapsable.collapsed > .x6-widget-stencil-group-title:hover::before {\n opacity: 0.6;\n}\n.x6-widget-stencil input[type='search'] {\n -webkit-appearance: textfield;\n}\n.x6-widget-stencil input[type='search']::-webkit-search-cancel-button,\n.x6-widget-stencil input[type='search']::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n.x6-widget-stencil-search-text {\n display: block;\n width: 90%;\n margin: 8px 5%;\n padding-left: 8px;\n color: #333;\n background: #fff;\n border: 1px solid #e9e9e9;\n border-radius: 12px;\n outline: 0;\n}\n.x6-widget-stencil-search-text:focus {\n outline: 0;\n}\n.x6-widget-stencil::after {\n color: #808080;\n font-weight: 600;\n font-size: 12px;\n background: 0 0;\n}\n.x6-widget-transform {\n position: absolute;\n box-sizing: content-box !important;\n margin: -5px 0 0 -5px;\n padding: 4px;\n border: 1px dashed #000;\n border-radius: 5px;\n user-select: none;\n pointer-events: none;\n}\n.x6-widget-transform > div {\n position: absolute;\n box-sizing: border-box;\n background-color: #fff;\n border: 1px solid #000;\n transition: background-color 0.2s;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-transform > div:hover {\n background-color: #d3d3d3;\n}\n.x6-widget-transform-cursor-n {\n cursor: n-resize;\n}\n.x6-widget-transform-cursor-s {\n cursor: s-resize;\n}\n.x6-widget-transform-cursor-e {\n cursor: e-resize;\n}\n.x6-widget-transform-cursor-w {\n cursor: w-resize;\n}\n.x6-widget-transform-cursor-ne {\n cursor: ne-resize;\n}\n.x6-widget-transform-cursor-nw {\n cursor: nw-resize;\n}\n.x6-widget-transform-cursor-se {\n cursor: se-resize;\n}\n.x6-widget-transform-cursor-sw {\n cursor: sw-resize;\n}\n.x6-widget-transform-resize {\n width: 10px;\n height: 10px;\n border-radius: 6px;\n}\n.x6-widget-transform-resize[data-position='top-left'] {\n top: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='top-right'] {\n top: -5px;\n right: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-left'] {\n bottom: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-right'] {\n right: -5px;\n bottom: -5px;\n}\n.x6-widget-transform-resize[data-position='top'] {\n top: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom'] {\n bottom: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='left'] {\n top: 50%;\n left: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform-resize[data-position='right'] {\n top: 50%;\n right: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='top'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='right'] {\n display: none;\n}\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='right'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='top'] {\n display: none;\n}\n.x6-widget-transform.no-resize .x6-widget-transform-resize {\n display: none;\n}\n.x6-widget-transform-rotate {\n top: -20px;\n left: -20px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n cursor: crosshair;\n}\n.x6-widget-transform.no-rotate .x6-widget-transform-rotate {\n display: none;\n}\n.x6-widget-transform-active {\n border-color: transparent;\n pointer-events: all;\n}\n.x6-widget-transform-active > div {\n display: none;\n}\n.x6-widget-transform-active > .x6-widget-transform-active-handle {\n display: block;\n background-color: #808080;\n}\n.x6-widget-knob {\n position: absolute;\n box-sizing: border-box;\n width: 16px;\n height: 16px;\n margin-top: -8px;\n margin-left: -8px;\n cursor: pointer;\n user-select: none;\n}\n.x6-widget-knob::before,\n.x6-widget-knob::after {\n position: absolute;\n transform: rotate(45deg);\n content: '';\n}\n.x6-widget-knob::before {\n top: 4px;\n left: 4px;\n box-sizing: border-box;\n width: 8px;\n height: 8px;\n background-color: #fff;\n}\n.x6-widget-knob::after {\n top: 5px;\n left: 5px;\n box-sizing: border-box;\n width: 6px;\n height: 6px;\n background-color: #fca000;\n}\n.x6-graph-print {\n position: relative;\n}\n.x6-graph-print .x6-graph-print-ready {\n display: none;\n}\n.x6-graph-print .x6-graph-print-preview {\n overflow: hidden !important;\n background: #fff !important;\n}\n@media print {\n html,\n html > body.x6-graph-printing {\n position: relative !important;\n width: 100% !important;\n height: 100% !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n html > body.x6-graph-printing > * {\n display: none !important;\n }\n html > body.x6-graph-printing > .x6-graph-print {\n display: block !important;\n }\n .x6-graph-print {\n top: 0 !important;\n left: 0 !important;\n margin: 0 !important;\n padding: 0 !important;\n overflow: hidden !important;\n page-break-after: always;\n background: #fff !important;\n }\n .x6-graph-print .x6-graph-print-ready {\n display: none;\n }\n}\n.x6-cell-tool-editor {\n position: relative;\n display: inline-block;\n min-height: 1em;\n margin: 0;\n padding: 0;\n line-height: 1;\n white-space: normal;\n text-align: center;\n vertical-align: top;\n overflow-wrap: normal;\n outline: none;\n transform-origin: 0 0;\n -webkit-user-drag: none;\n}\n.x6-edge-tool-editor {\n border: 1px solid #275fc5;\n border-radius: 2px;\n}\n";var gy=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class py extends ly{init(){Zd.autoInsertCSS&&py.ensure()}dispose(){py.clean()}}gy([py.dispose()],py.prototype,"dispose",null),function(t){let e,n=0;function i(){if(n+=1,!(n>1)&&!ht.isApplyingHMR()){e=document.createElement("style"),e.setAttribute("type","text/css"),e.textContent=dy;const t=document.querySelector("head");t&&t.insertBefore(e,t.firstChild)}}function s(){n-=1,n>0||(e&&e.parentNode&&e.parentNode.removeChild(e),e=null)}t.ensure=i,t.clean=s}(py||(py={}));var fy,my=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class yy{get handleClassName(){return fy.handle}get pie(){return Object.assign(Object.assign({},yy.defaultPieOptions),this.handleOptions.pie)}initHandles(){if(this.handles=[],this.handleOptions.handles&&this.handleOptions.handles.forEach((t=>this.addHandle(t))),"pie"===this.handleOptions.type){if(this.pie.toggles){const t=fy.pieToggle;this.$pieToggles={},this.pie.toggles.forEach((e=>{const n=this.$("<div/>");this.applyAttrs(n,e.attrs),n.addClass(t).addClass(`${t}-pos-${e.position||"e"}`).attr("data-name",e.name).appendTo(this.container),this.$pieToggles[e.name]=n}))}this.setPieIcons()}if(this.$handleContainer){const t=this.handleOptions.type||"surround";this.$handleContainer.addClass(fy.wrap).addClass(fy.animate).addClass(`${fy.handle}-${t}`)}this.delegateEvents({[`mousedown .${fy.handle}`]:"onHandleMouseDown",[`touchstart .${fy.handle}`]:"onHandleMouseDown",[`mousedown .${fy.pieToggle}`]:"onPieToggleMouseDown",[`touchstart .${fy.pieToggle}`]:"onPieToggleMouseDown"})}onHandleMouseDown(t){const e=this.$(t.currentTarget).closest(`.${fy.handle}`).attr("data-action");e&&(t.preventDefault(),t.stopPropagation(),this.setEventData(t,{action:e,clientX:t.clientX,clientY:t.clientY,startX:t.clientX,startY:t.clientY}),"mousedown"===t.type&&2===t.button?this.triggerHandleAction(e,"contextmenu",t):(this.triggerHandleAction(e,"mousedown",t),this.delegateDocumentEvents({mousemove:"onHandleMouseMove",touchmove:"onHandleMouseMove",mouseup:"onHandleMouseUp",touchend:"onHandleMouseUp",touchcancel:"onHandleMouseUp"},t.data)))}onHandleMouseMove(t){const e=this.getEventData(t),n=e.action;n&&this.triggerHandleAction(n,"mousemove",t)}onHandleMouseUp(t){const e=this.getEventData(t),n=e.action;n&&(this.triggerHandleAction(n,"mouseup",t),this.undelegateDocumentEvents())}triggerHandleAction(t,e,n,i){n.preventDefault(),n.stopPropagation();const s=this.normalizeEvent(n),o=this.getEventData(s),r=this.graph.snapToGrid(s.clientX,s.clientY),a=this.graph.snapToGrid(o.clientX,o.clientY),l=r.x-a.x,c=r.y-a.y;this.trigger(`action:${t}:${e}`,Object.assign({e:s,dx:l,dy:c,x:r.x,y:r.y,offsetX:n.clientX-o.startX,offsetY:n.clientY-o.startY},i)),o.clientX=n.clientX,o.clientY=n.clientY}onPieToggleMouseDown(t){t.stopPropagation();const e=this.$(t.target).closest(`.${fy.pieToggle}`).attr("data-name");this.isOpen(e)||this.isOpen()&&this.toggleState(),this.toggleState(e)}setPieIcons(){"pie"===this.handleOptions.type&&this.$handleContainer.find(`.${fy.handle}`).each(((t,e)=>{const n=this.$(e),i=n.attr("data-action"),s=fy.pieSlice,o=this.getHandle(i);if(!o||!o.icon){const t=window.getComputedStyle(e,":before").getPropertyValue("content");if(t&&"none"!==t){const e=n.find(`.${s}-txt`);e.length&&jc.create(e[0]).text(t.replace(/['"]/g,""))}const i=n.css("background-image");if(i){const t=i.match(/url\(['"]?([^'"]+)['"]?\)/);if(t){const e=t[1],i=n.find(`.${s}-img`);i.length>0&&jc.create(i[0]).attr("xlink:href",e)}}}}))}getHandleIdx(t){return this.handles.findIndex((e=>e.name===t))}hasHandle(t){return this.getHandleIdx(t)>=0}getHandle(t){return this.handles.find((e=>e.name===t))}renderHandle(t){const e=this.$("<div/>").addClass(`${fy.handle} ${fy.handle}-${t.name}`).attr("data-action",t.name).prop("draggable",!1);if("pie"===this.handleOptions.type){const n=this.getHandleIdx(t.name),i=this.pie,s=i.outerRadius,o=i.innerRadius,r=(s+o)/2,a=new ac(s,s),l=Ql.toRad(i.sliceAngle),c=n*l+Ql.toRad(i.startAngle),h=c+l,u=nh(o,s,c,h),d=jc.create("svg").addClass(`${fy.pieSlice}-svg`),g=jc.create("path").addClass(fy.pieSlice).attr("d",u).translate(s,s),p=ac.fromPolar(r,-c-l/2,a).toJSON(),f=i.iconSize,m=jc.create("image").attr(p).addClass(`${fy.pieSlice}-img`);p.y=p.y+f-2;const y=jc.create("text",{"font-size":f}).attr(p).addClass(`${fy.pieSlice}-txt`);m.attr({width:f,height:f}),m.translate(-f/2,-f/2),y.translate(-f/2,-f/2),d.append([g,m,y]),e.append(d.node)}else e.addClass(`${fy.handle}-pos-${t.position}`),t.content&&("string"===typeof t.content?e.html(t.content):e.append(t.content));return this.updateHandleIcon(e,t.icon),this.applyAttrs(e,t.attrs),e}addHandle(t){if(!this.hasHandle(t.name)){this.handles.push(t);const e=t.events;e&&Object.keys(e).forEach((n=>{const i=e[n],s=`action:${t.name}:${n}`;"string"===typeof i?this.on(s,this[i],this):this.on(s,i)})),this.$handleContainer&&this.$handleContainer.append(this.renderHandle(t))}return this}addHandles(t){return t.forEach((t=>this.addHandle(t))),this}removeHandles(){while(this.handles.length)this.removeHandle(this.handles[0].name);return this}removeHandle(t){const e=this.getHandleIdx(t),n=this.handles[e];return n&&(n.events&&Object.keys(n.events).forEach((e=>{this.off(`action:${t}:${e}`)})),this.getHandleElem(t).remove(),this.handles.splice(e,1)),this}changeHandle(t,e){const n=this.getHandle(t);return n&&(this.removeHandle(t),this.addHandle(Object.assign(Object.assign({},n),e))),this}toggleHandle(t,e){const n=this.getHandle(t);if(n){const i=this.getHandleElem(t),s=`${fy.handle}-selected`;void 0===e&&(e=!i.hasClass(s)),i.toggleClass(s,e);const o=e?n.iconSelected:n.icon;o&&this.updateHandleIcon(i,o)}return this}selectHandle(t){return this.toggleHandle(t,!0)}deselectHandle(t){return this.toggleHandle(t,!1)}deselectAllHandles(){return this.handles.forEach((t=>this.deselectHandle(t.name))),this}getHandleElem(t){return this.$handleContainer.find(`.${fy.handle}-${t}`)}updateHandleIcon(t,e){if("pie"===this.handleOptions.type){const n=t.find(`.${fy.pieSliceImg}`);this.$(n[0]).attr("xlink:href",e||"")}else t.css("background-image",e?`url(${e})`:"")}isRendered(){return null!=this.$handleContainer}isOpen(t){return!!this.isRendered()&&(t?this.$pieToggles[t].hasClass(fy.pieToggleOpened):this.$handleContainer.hasClass(`${fy.pieOpended}`))}toggleState(t){if(this.isRendered()){const e=this.$handleContainer;if(Object.keys(this.$pieToggles).forEach((t=>{const e=this.$pieToggles[t];e.removeClass(fy.pieToggleOpened)})),this.isOpen())this.trigger("pie:close",{name:t}),e.removeClass(fy.pieOpended);else{if(this.trigger("pie:open",{name:t}),t){const n=this.pie.toggles,i=n&&n.find((e=>e.name===t));i&&e.attr({"data-pie-toggle-name":i.name,"data-pie-toggle-position":i.position}),this.$pieToggles[t].addClass(fy.pieToggleOpened)}e.addClass(fy.pieOpended)}}}applyAttrs(t,e){if(e){const n=Jg.$(t);Object.keys(e).forEach((t=>{const i=n.find(t).addBack().filter(t),s=e[t],{class:o}=s,r=my(s,["class"]);o&&i.addClass(o),i.attr(r)}))}}}(function(t){t.defaultPieOptions={innerRadius:20,outerRadius:50,sliceAngle:45,startAngle:0,iconSize:14,toggles:[{name:"default",position:"e"}]}})(yy||(yy={})),function(t){t.handle=Jg.prototype.prefixClassName("widget-handle"),t.wrap=`${t.handle}-wrap`,t.animate=`${t.handle}-animate`,t.pieOpended=`${t.handle}-pie-opened`,t.pieToggle=`${t.handle}-pie-toggle`,t.pieToggleOpened=`${t.handle}-pie-toggle-opened`,t.pieSlice=`${t.handle}-pie-slice`,t.pieSliceImg=`${t.handle}-pie-slice-img`}(fy||(fy={}));var by,wy=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},Cy=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class vy extends Jg{constructor(t){super();const e=t,{view:n,cell:i,node:s,edge:o,graph:r}=e,a=Cy(e,["view","cell","node","edge","graph"]);n?(this.view=n,this.cell=n.cell,this.graph=n.graph,this.model=this.graph.model):(i||o||s)&&r&&(this.cell=s||o||i,this.view=r.renderer.findViewByCell(this.cell),this.graph=r,this.model=this.graph.model);const l=this.constructor;!1!==t.clearAll&&l.removeInstances(this.graph),l.register(this),this.init(a)}static ensureCache(){return this.instanceCache.has(this)||this.instanceCache.set(this,{}),this.instanceCache.get(this)}static register(t,e){null==e&&(e=t.graph);const n=this.ensureCache();let i=n[e.view.cid];null==i&&(i=n[e.view.cid]={}),i[t.cid]=t}static unregister(t,e){null==e&&(e=t.graph);const n=this.ensureCache();n[e.view.cid]&&delete n[e.view.cid][t.cid]}static removeInstances(t){const e=this.ensureCache(),n=e[t.view.cid];n&&Object.keys(n).forEach((t=>{const e=n[t];e&&e.remove()}))}static getInstances(t){const e=this.ensureCache();return e[t.view.cid]||{}}init(t){}render(){return this}startListening(){!1!==this.options.clearOnBlankMouseDown&&this.graph.on("blank:mousedown",this.remove,this)}stopListening(){!1!==this.options.clearOnBlankMouseDown&&this.graph.off("blank:mousedown",this.remove,this)}remove(){this.stopListening();const t=this.constructor;return t.unregister(this),super.remove()}dispose(){this.remove()}}vy.instanceCache=new WeakMap,wy([Jg.dispose()],vy.prototype,"dispose",null);class xy extends vy{get node(){return this.cell}get metadata(){const t=this.cell.prop("knob");return Array.isArray(t)?null!=this.options.index?t[this.options.index]:null:t}init(t){this.options=Object.assign({},t),this.render(),this.startListening()}startListening(){this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.model.on("reseted",this.remove,this),this.node.on("removed",this.remove,this),this.view.on("node:resize:mousedown",this.onTransform,this),this.view.on("node:rotate:mousedown",this.onTransform,this),this.view.on("node:resize:mouseup",this.onTransformed,this),this.view.on("node:rotate:mouseup",this.onTransformed,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this),super.startListening()}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.model.off("reseted",this.remove,this),this.node.off("removed",this.remove,this),this.view.off("node:resize:mousedown",this.onTransform,this),this.view.off("node:rotate:mousedown",this.onTransform,this),this.view.off("node:resize:mouseup",this.onTransformed,this),this.view.off("node:rotate:mouseup",this.onTransformed,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this),super.stopListening()}render(){return this.container=document.createElement("div"),rl(this.container,this.prefixClassName("widget-knob")),this.options.className&&rl(this.container,this.options.className),this.view.addClass(by.KNOB),this.graph.container.appendChild(this.container),this.update(),this}remove(){return this.view.removeClass(by.KNOB),super.remove()}update(){if(this.metadata){const{update:t,position:e}=this.metadata,n={knob:this,cell:this.cell,node:this.node};if(e){const t=e.call(this.graph,Object.assign({},n));if(t){const e=this.graph.matrix(),n=this.node.getBBox(),i=Ql.normalize(this.node.getAngle()),s=ac.create(t);0!==i&&s.rotate(-i,{x:n.width/2,y:n.height/2}),s.translate(n).scale(e.a,e.d).translate(e.e,e.f),this.container.style.left=`${s.x}px`,this.container.style.top=`${s.y}px`}}t&&t.call(this.graph,Object.assign({},n))}}hide(){this.container.style.display="none"}show(){this.container.style.display=""}onTransform(){this.hide()}onTransformed(){this.show()}onKnobMouseDown({knob:t}){this.cid!==t.cid&&this.hide()}onKnobMouseUp(){this.show()}notify(t,e){if(this.view){const n=this.view.normalizeEvent(e),i=this.graph.snapToGrid(n.clientX,n.clientY);this.view.notify(`cell:${t}`,{e:n,view:this.view,node:this.node,cell:this.cell,x:i.x,y:i.y,knob:this}),this.cell.isNode()?this.view.notify(`node:${t}`,{e:n,view:this.view,node:this.node,cell:this.cell,x:i.x,y:i.y,knob:this}):this.cell.isEdge()&&this.view.notify(`edge:${t}`,{e:n,view:this.view,edge:this.cell,cell:this.cell,x:i.x,y:i.y,knob:this})}}onMouseDown(t){t.stopPropagation(),this.setEventData(t,{knobbing:!1,originX:t.clientX,originY:t.clientY,clientX:t.clientX,clientY:t.clientY}),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(by.documentEvents,t.data),this.metadata&&this.metadata.onMouseDown&&this.metadata.onMouseDown.call(this.graph,{e:t,data:this.getEventData(t),knob:this,cell:this.cell,node:this.node}),this.notify("knob:mousedown",t)}onMouseMove(t){const e=this.getEventData(t),n=this.graph.findViewByCell(this.node);if(e.knobbing||(e.knobbing=!0,n&&(n.addClass(by.KNOBBING),this.notify("knob",t)),this.model.startBatch("knob",{cid:this.cid})),e.clientX=t.clientX,e.clientY=t.clientY,this.metadata&&this.metadata.onMouseMove){const n=this.graph.matrix(),i=(t.clientX-e.originX)/n.a,s=(t.clientY-e.originY)/n.d,o=this.node.getAngle(),r=new ac(i,s).rotate(o);this.metadata.onMouseMove.call(this.graph,{e:t,data:e,deltaX:r.x,deltaY:r.y,knob:this,cell:this.cell,node:this.node})}this.notify("knobbing",t),this.notify("knob:mousemove",t)}onMouseUp(t){this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.getEventData(t),n=this.graph.findViewByCell(this.node);e.knobbing&&(n&&n.removeClass(by.KNOBBING),this.metadata&&this.metadata.onMouseUp&&this.metadata.onMouseUp.call(this.graph,{e:t,data:e,knob:this,cell:this.cell,node:this.node}),this.model.stopBatch("knob",{cid:this.cid}),this.notify("knobbed",t)),this.notify("knob:mouseup",t)}}(function(t){t.KNOB="has-widget-knob",t.KNOBBING="node-knobbing",t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"}})(by||(by={}));var ky,Ey,My=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};(function(t){t.root="widget-minimap",t.viewport=`${t.root}-viewport`,t.zoom=`${t.viewport}-zoom`})(ky||(ky={}));class Sy extends Jg{constructor(t){super(),this.options=Object.assign(Object.assign({},Ey.defaultOptions),t),this.updateViewport=Ga.Z(this.updateViewport.bind(this),0),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(ky.root));const e=document.createElement("div");this.container.appendChild(e),this.$viewport=this.$("<div>").addClass(this.prefixClassName(ky.viewport)),this.options.scalable&&(this.zoomHandle=this.$("<div>").addClass(this.prefixClassName(ky.zoom)).appendTo(this.$viewport).get(0)),this.$container.append(this.$viewport).css({width:this.options.width,height:this.options.height,padding:this.options.padding}),this.options.container&&this.options.container.appendChild(this.container),this.sourceGraph=this.graph;const n=Object.assign(Object.assign({},this.options.graphOptions),{container:e,model:this.sourceGraph.model,frozen:!0,async:this.sourceGraph.isAsync(),interacting:!1,grid:!1,background:!1,rotating:!1,resizing:!1,embedding:!1,selecting:!1,snapline:!1,clipboard:!1,history:!1,scroller:!1});this.targetGraph=this.options.createGraph?this.options.createGraph(n):new Rb(n),this.targetGraph.renderer.unfreeze(),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}get graph(){return this.options.graph}get scroller(){return this.graph.scroller.widget}get graphContainer(){return this.scroller?this.scroller.container:this.graph.container}get $graphContainer(){return this.scroller?this.scroller.$container:this.$(this.graph.container)}startListening(){this.scroller?this.$graphContainer.on(`scroll${this.getEventNamespace()}`,this.updateViewport):(this.sourceGraph.on("translate",this.onTransform,this),this.sourceGraph.on("scale",this.onTransform,this),this.sourceGraph.on("model:updated",this.onModelUpdated,this)),this.sourceGraph.on("resize",this.updatePaper,this),this.delegateEvents({mousedown:"startAction",touchstart:"startAction",[`mousedown .${this.prefixClassName("graph")}`]:"scrollTo",[`touchstart .${this.prefixClassName("graph")}`]:"scrollTo"})}stopListening(){this.scroller?this.$graphContainer.off(this.getEventNamespace()):(this.sourceGraph.off("translate",this.onTransform,this),this.sourceGraph.off("scale",this.onTransform,this),this.sourceGraph.off("model:updated",this.onModelUpdated,this)),this.sourceGraph.off("resize",this.updatePaper,this),this.undelegateEvents()}onRemove(){this.targetGraph.view.remove(),this.stopListening(),this.targetGraph.dispose()}onTransform(t){(t.ui||this.targetGraphTransforming)&&this.updateViewport()}onModelUpdated(){this.targetGraph.zoomToFit()}updatePaper(t,e){let n,i;"object"===typeof t?(n=t.width,i=t.height):(n=t,i=e);const s=this.sourceGraph.options,o=this.sourceGraph.transform.getScale(),r=this.options.width-2*this.options.padding,a=this.options.height-2*this.options.padding;n/=o.sx,i/=o.sy,this.ratio=Math.min(r/n,a/i);const l=this.ratio,c=s.x*l/o.sx,h=s.y*l/o.sy;return n*=l,i*=l,this.targetGraph.resizeGraph(n,i),this.targetGraph.translate(c,h),this.scroller?this.targetGraph.scale(l,l):this.targetGraph.zoomToFit(),this.updateViewport(),this}updateViewport(){const t=this.sourceGraph.transform.getScale(),e=this.targetGraph.transform.getScale();let n=null;n=this.scroller?this.scroller.clientToLocalPoint(0,0):this.graph.graphToLocal(0,0);const i=this.$(this.targetGraph.container).position(),s=this.targetGraph.translate();s.ty=s.ty||0,this.geometry={top:i.top+n.y*e.sy+s.ty,left:i.left+n.x*e.sx+s.tx,width:this.$graphContainer.innerWidth()*e.sx/t.sx,height:this.$graphContainer.innerHeight()*e.sy/t.sy},this.$viewport.css(this.geometry)}startAction(t){const e=this.normalizeEvent(t),n=e.target===this.zoomHandle?"zooming":"panning",{tx:i,ty:s}=this.sourceGraph.translate(),o={action:n,clientX:e.clientX,clientY:e.clientY,scrollLeft:this.graphContainer.scrollLeft,scrollTop:this.graphContainer.scrollTop,zoom:this.sourceGraph.zoom(),scale:this.sourceGraph.transform.getScale(),geometry:this.geometry,translateX:i,translateY:s};this.targetGraphTransforming=!0,this.delegateDocumentEvents(Ey.documentEvents,o)}doAction(t){const e=this.normalizeEvent(t),n=e.clientX,i=e.clientY,s=e.data;switch(s.action){case"panning":{const t=this.sourceGraph.transform.getScale(),e=(n-s.clientX)*t.sx,o=(i-s.clientY)*t.sy;this.scroller?(this.graphContainer.scrollLeft=s.scrollLeft+e/this.ratio,this.graphContainer.scrollTop=s.scrollTop+o/this.ratio):this.sourceGraph.translate(s.translateX-e/this.ratio,s.translateY-o/this.ratio);break}case"zooming":{const t=s.scale,e=s.geometry,i=1+(s.clientX-n)/e.width/t.sx;s.frameId&&cancelAnimationFrame(s.frameId),s.frameId=requestAnimationFrame((()=>{this.sourceGraph.zoom(i*s.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})}));break}default:break}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(t){const e=this.normalizeEvent(t);let n,i;const s=this.targetGraph.translate();if(s.ty=s.ty||0,null==e.offsetX){const t=this.$(this.targetGraph.container).offset();n=e.pageX-t.left,i=e.pageY-t.top}else n=e.offsetX,i=e.offsetY;const o=(n-s.tx)/this.ratio,r=(i-s.ty)/this.ratio;this.sourceGraph.centerPoint(o,r)}dispose(){this.remove()}}My([Jg.dispose()],Sy.prototype,"dispose",null),function(t){t.defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:t=>new Rb(t)},t.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}}(Ey||(Ey={}));var Ay=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},Dy=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Py extends Jg{constructor(t){super();const{graph:e}=t,n=Dy(t,["graph"]);this.graph=e,this.options=Object.assign({tolerance:10},n),this.render(),this.parseFilter(),this.disabled||this.startListening()}get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}get disabled(){return!0!==this.options.enabled||!0!==this.graph.options.snapline.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.graph.options.snapline.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.graph.options.snapline.enabled=!1,this.stopListening())}setFilter(t){this.options.filter=t,this.parseFilter()}render(){this.container=document.createElement("div"),this.$container=this.$(this.container),this.$horizontal=this.$(document.createElement("div")).addClass(this.horizontalClassName),this.$vertical=this.$(document.createElement("div")).addClass(this.verticalClassName),this.$container.hide().addClass(this.containerClassName).append([this.$horizontal,this.$vertical]),this.options.className&&this.$container.addClass(this.options.className)}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}parseFilter(){this.filterShapes={},this.filterCells={},this.filterFunction=null;const t=this.options.filter;Array.isArray(t)?t.forEach((t=>{"string"===typeof t?this.filterShapes[t]=!0:this.filterCells[t.id]=!0})):"function"===typeof t&&(this.filterFunction=t)}onBatchStop({name:t,data:e}){"resize"===t&&this.snapOnResizing(e.cell,e)}captureCursorOffset({view:t,x:e,y:n}){const i=t.getDelegatedView();if(i&&this.isNodeMovable(i)){const i=t.cell.getPosition();this.offset={x:e-i.x,y:n-i.y}}}isNodeMovable(t){return t&&t.cell.isNode()&&t.can("nodeMovable")}snapOnResizing(t,e){if(this.options.resizing&&!e.snapped&&e.ui&&e.direction&&e.trueDirection){const n=this.graph.renderer.findViewByCell(t);if(n&&n.cell.isNode()){const i=t.getBBox(),s=i.bbox(t.getAngle()),o=s.getTopLeft(),r=s.getBottomRight(),a=Ql.normalize(t.getAngle()),l=this.options.tolerance||0;let c,h,u,d,g,p;const f={vertical:0,horizontal:0},m=e.direction,y=e.trueDirection,b=e.relativeDirection;-1!==y.indexOf("right")?f.vertical=r.x:f.vertical=o.x,-1!==y.indexOf("bottom")?f.horizontal=r.y:f.horizontal=o.y,this.model.getNodes().some((e=>{if(this.isIgnored(t,e))return!1;const n=e.getBBox().bbox(e.getAngle()),i=n.getTopLeft(),o=n.getBottomRight(),a={vertical:[i.x,o.x],horizontal:[i.y,o.y]},m={};return Object.keys(a).forEach((t=>{const e=t,n=a[e].map((t=>({position:t,distance:Math.abs(t-f[e])}))).filter((t=>t.distance<=l));m[e]=Ve(n,(t=>t.distance))})),null==c&&m.vertical.length>0&&(c=m.vertical[0].position,h=Math.min(s.y,n.y),u=Math.max(r.y,o.y)-h),null==d&&m.horizontal.length>0&&(d=m.horizontal[0].position,g=Math.min(s.x,n.x),p=Math.max(r.x,o.x)-g),null!=c&&null!=d})),this.hide();let w=0,C=0;null==d&&null==c||(null!=c&&(w=-1!==y.indexOf("right")?c-r.x:o.x-c),null!=d&&(C=-1!==y.indexOf("bottom")?d-r.y:o.y-d));let v=0,x=0;if(a%90===0)90===a||270===a?(v=C,x=w):(v=w,x=C);else{const t=a>=0&&a<90?1:a>=90&&a<180?4:a>=180&&a<270?3:2;null!=d&&null!=c&&(w<C?(C=0,d=void 0):(w=0,c=void 0));const e=Ql.toRad(a%90);w&&(v=3===t?w/Math.cos(e):w/Math.sin(e)),C&&(x=3===t?C/Math.cos(e):C/Math.sin(e));const n=1===t||3===t;switch(b){case"top":case"bottom":x=C?C/(n?Math.cos(e):Math.sin(e)):w/(n?Math.sin(e):Math.cos(e));break;case"left":case"right":v=w?w/(n?Math.cos(e):Math.sin(e)):C/(n?Math.sin(e):Math.cos(e));break;default:break}}switch(b){case"top":case"bottom":v=0;break;case"left":case"right":x=0;break;default:break}const k=this.graph.getGridSize();let E=Math.max(i.width+v,k),M=Math.max(i.height+x,k);e.minWidth&&e.minWidth>k&&(E=Math.max(E,e.minWidth)),e.minHeight&&e.minHeight>k&&(M=Math.max(M,e.minHeight)),e.maxWidth&&(E=Math.min(E,e.maxWidth)),e.maxHeight&&(M=Math.min(M,e.maxHeight)),e.preserveAspectRatio&&(x<v?M=E*(i.height/i.width):E=M*(i.width/i.height)),E===i.width&&M===i.height||(t.resize(E,M,{direction:m,relativeDirection:b,trueDirection:y,snapped:!0,snaplines:this.cid,restrict:this.graph.hook.getRestrictArea(n)}),u&&(u+=M-i.height),p&&(p+=E-i.width));const S=t.getBBox().bbox(a);c&&Math.abs(S.x-c)>1&&Math.abs(S.width+S.x-c)>1&&(c=void 0),d&&Math.abs(S.y-d)>1&&Math.abs(S.height+S.y-d)>1&&(d=void 0),this.update({verticalLeft:c,verticalTop:h,verticalHeight:u,horizontalTop:d,horizontalLeft:g,horizontalWidth:p})}}}snapOnMoving({view:t,e:e,x:n,y:i}){const s=t.getEventData(e).delegatedView||t;if(!this.isNodeMovable(s))return;const o=s.cell,r=o.getSize(),a=o.getPosition(),l=new lc(n-this.offset.x,i-this.offset.y,r.width,r.height),c=o.getAngle(),h=l.getCenter(),u=l.bbox(c),d=u.getTopLeft(),g=u.getBottomRight(),p=this.options.tolerance||0;let f,m,y,b,w,C,v=0,x=0;if(this.model.getNodes().some((t=>{if(this.isIgnored(o,t))return!1;const e=t.getBBox().bbox(t.getAngle()),n=e.getCenter(),i=e.getTopLeft(),s=e.getBottomRight();return null==f&&(Math.abs(n.x-h.x)<p?(f=n.x,v=.5):Math.abs(i.x-d.x)<p?(f=i.x,v=0):Math.abs(i.x-g.x)<p?(f=i.x,v=1):Math.abs(s.x-g.x)<p?(f=s.x,v=1):Math.abs(s.x-d.x)<p&&(f=s.x),null!=f&&(m=Math.min(u.y,e.y),y=Math.max(g.y,s.y)-m)),null==b&&(Math.abs(n.y-h.y)<p?(b=n.y,x=.5):Math.abs(i.y-d.y)<p?b=i.y:Math.abs(i.y-g.y)<p?(b=i.y,x=1):Math.abs(s.y-g.y)<p?(b=s.y,x=1):Math.abs(s.y-d.y)<p&&(b=s.y),null!=b&&(w=Math.min(u.x,e.x),C=Math.max(g.x,s.x)-w)),null!=f&&null!=b})),this.hide(),null!=b||null!=f){null!=b&&(u.y=b-x*u.height),null!=f&&(u.x=f-v*u.width);const t=u.getCenter(),e=t.x-l.width/2,n=t.y-l.height/2,i=e-a.x,r=n-a.y;0===i&&0===r||(o.translate(i,r,{snapped:!0,restrict:this.graph.hook.getRestrictArea(s)}),C&&(C+=i),y&&(y+=r)),this.update({verticalLeft:f,verticalTop:m,verticalHeight:y,horizontalTop:b,horizontalLeft:w,horizontalWidth:C})}}isIgnored(t,e){return e.id===t.id||e.isDescendantOf(t)||this.filterShapes[e.shape]||this.filterCells[e.id]||this.filterFunction&&Ya(this.filterFunction,this.graph,e)}update(t){const e=this.graph.matrix(),n=e.a,i=e.d,s=e.e,o=e.f,r=this.options.sharp,a=null!=this.graph.scroller.widget;t.horizontalTop?this.$horizontal.css({top:t.horizontalTop*i+o,left:r?t.horizontalLeft*n+s:a?"-300%":0,width:r?t.horizontalWidth*n:a?"700%":"100%"}).show():this.$horizontal.hide(),t.verticalLeft?this.$vertical.css({left:t.verticalLeft*n+s,top:r?t.verticalTop*i+o:a?"-300%":0,height:r?t.verticalHeight*i:a?"700%":"100%"}).show():this.$vertical.hide(),this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.$container.show(),this.resetTimer(),null==this.container.parentNode&&this.graph.container.appendChild(this.container),this}hide(){this.$container.hide(),this.resetTimer();const t=this.options.clean,e="number"===typeof t?t:!1!==t?3e3:0;return e>0&&(this.timer=window.setTimeout((()=>{this.unmount()}),e)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}Ay([Jg.dispose()],Py.prototype,"dispose",null);var Oy=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class Ty extends ly{init(){this.resetUpdates(),this.startListening(),this.resetViews(this.model.getCells()),!this.isFrozen()&&this.isAsync()&&this.updateViewsAsync()}startListening(){this.model.on("sorted",this.onSortModel,this),this.model.on("reseted",this.onModelReseted,this),this.model.on("batch:stop",this.onBatchStop,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("sorted",this.onSortModel,this),this.model.off("reseted",this.onModelReseted,this),this.model.off("batch:stop",this.onBatchStop,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}resetUpdates(){this.updates={priorities:[{},{},{}],mounted:{},mountedCids:[],unmounted:{},unmountedCids:[],count:0,sort:!1,frozen:!1,freezeKey:null,animationId:null}}onSortModel(){this.model.hasActiveBatch(Ty.SORT_DELAYING_BATCHES)||this.sortViews()}onModelReseted({options:t}){this.removeZPivots(),this.resetViews(this.model.getCells(),t)}onBatchStop({name:t,data:e}){if(this.isFrozen())return;const n=this.model;if(!this.isAsync()){const i=Ty.UPDATE_DELAYING_BATCHES;i.includes(t)&&!n.hasActiveBatch(i)&&this.updateViews(e)}const i=Ty.SORT_DELAYING_BATCHES;i.includes(t)&&!n.hasActiveBatch(i)&&this.sortViews()}onCellAdded({cell:t,options:e}){const n=e.position;this.isAsync()||"number"!==typeof n?this.renderView(t,e):(e.maxPosition===n&&this.freeze({key:"addCells"}),this.renderView(t,e),0===n&&this.unfreeze({key:"addCells"}))}onCellRemoved({cell:t,options:e}){const n=this.findViewByCell(t);n&&this.requestViewUpdate(n,Ty.FLAG_REMOVE,n.priority,e)}onCellZIndexChanged({cell:t,options:e}){if("approx"===this.options.sorting){const n=this.findViewByCell(t);n&&this.requestViewUpdate(n,Ty.FLAG_INSERT,n.priority,e)}}onCellVisibleChanged({cell:t,current:e,options:n}){e||this.processEdgeOnTerminalVisibleChanged(t,!1);const i=this.findViewByCell(t);!e&&i?this.removeView(t):e&&null==i&&this.renderView(t,n),e&&this.processEdgeOnTerminalVisibleChanged(t,!0)}processEdgeOnTerminalVisibleChanged(t,e){const n=(t,e)=>{const n=t.getSourceCellId();if(n!==e.id)return t.getSourceCell();const i=t.getTargetCellId();return i!==e.id?t.getTargetCell():null};this.model.getConnectedEdges(t).forEach((i=>{const s=n(i,t);(null==s||s.isVisible())&&(e?i.show():i.hide())}))}isEdgeTerminalVisible(t,e){const n="source"===e?t.getSourceCellId():t.getTargetCellId(),i=n?this.model.getCell(n):null;return!(i&&!i.isVisible())}requestConnectedEdgesUpdate(t,e={}){if(up.isCellView(t)){const n=t.cell,i=this.model.getConnectedEdges(n);for(let t=0,s=i.length;t<s;t+=1){const s=i[t],o=this.findViewByCell(s);if(!o)continue;const r=["update"];s.getTargetCell()===n&&r.push("target"),s.getSourceCell()===n&&r.push("source"),this.scheduleViewUpdate(o,o.getFlag(r),o.priority,e)}}}forcePostponedViewUpdate(t,e){if(!t||!up.isCellView(t))return!1;const n=t.cell;if(n.isNode())return!1;const i=t;if(n.isEdge()&&0===(e&t.getFlag(["source","target"]))){let t=0;const e=this.findViewByCell(n.getSourceCell());e&&!this.isViewMounted(e)&&(t=this.dumpView(e),i.updateTerminalMagnet("source"));let s=0;const o=this.findViewByCell(n.getTargetCell());if(o&&!this.isViewMounted(o)&&(s=this.dumpView(o),i.updateTerminalMagnet("target")),0===t&&0===s)return!this.dumpView(i)}return!1}scheduleViewUpdate(t,e,n,i={}){const s=t.cid,o=this.updates;let r=o.priorities[n];r||(r=o.priorities[n]={});const a=r[s]||0;(a&e)!==e&&(a||(o.count+=1),e&Ty.FLAG_REMOVE&&a&Ty.FLAG_INSERT?r[s]^=Ty.FLAG_INSERT:e&Ty.FLAG_INSERT&&a&Ty.FLAG_REMOVE&&(r[s]^=Ty.FLAG_REMOVE),r[s]|=e,this.graph.hook.onViewUpdated(t,e,i))}requestViewUpdate(t,e,n,i={}){this.scheduleViewUpdate(t,e,n,i);const s=this.isAsync();if(this.isFrozen()||s&&!1!==i.async||this.model.hasActiveBatch(Ty.UPDATE_DELAYING_BATCHES))return;const o=this.updateViews(i);s&&this.graph.trigger("render:done",{stats:o,options:i})}dumpView(t,e={}){if(null==t)return 0;const n=t.cid,i=this.updates,s=i.priorities[t.priority],o=this.registerMountedView(t)|s[n];return delete s[n],o?this.updateView(t,o,e):0}dumpViews(t={}){this.checkView(t),this.updateViews(t)}requireView(t,e={}){const n=this.findViewByCell(t);return null==n?null:(this.dumpView(n,e),n)}updateView(t,e,n={}){if(null==t)return 0;if(up.isCellView(t)){if(e&Ty.FLAG_REMOVE)return this.removeView(t.cell),0;e&Ty.FLAG_INSERT&&(this.insertView(t),e^=Ty.FLAG_INSERT)}return e?t.confirmUpdate(e,n):0}updateViews(t={}){let e,n=0,i=0,s=Ty.MIN_PRIORITY;do{e=this.updateViewsBatch(t),n+=1,i+=e.updatedCount,s=Math.min(e.priority,s)}while(!e.empty);return{priority:s,batchCount:n,updatedCount:i}}updateViewsBatch(t={}){const e=this.updates,n=e.priorities,i=t.batchSize||Ty.UPDATE_BATCH_SIZE;let s=!0,o=Ty.MIN_PRIORITY,r=0,a=0,l=0,c=0,h=t.checkView||this.options.checkView;"function"!==typeof h&&(h=null);t:for(let u=0,d=n.length;u<d;u+=1){const d=n[u];for(const n in d){if(l>=i){s=!1;break t}const g=Jg.views[n];if(!g){delete d[n];continue}let p=d[n];if(0===(p&Ty.FLAG_REMOVE)){const t=n in e.unmounted;if(h&&!Ya(h,this.graph,{view:g,unmounted:t})){t||(this.registerUnmountedView(g),g.unmount()),e.unmounted[n]|=p,delete d[n],a+=1;continue}t&&(p|=Ty.FLAG_INSERT,r+=1),p|=this.registerMountedView(g)}const f=g;let m=this.updateView(g,p,t);if(m>0){const t=f.cell;t&&t.isEdge()&&(f.hasAction(m,"source")&&!this.isEdgeTerminalVisible(t,"source")&&(m=f.removeAction(m,"source"),m|=Ty.FLAG_REMOVE),f.hasAction(m,"target")&&!this.isEdgeTerminalVisible(t,"target")&&(m=f.removeAction(m,"target"),m|=Ty.FLAG_REMOVE))}m>0&&(d[n]=m,!this.graph.hook.onViewPostponed(f,m,t)||d[n])?(c+=1,s=!1):(o>u&&(o=u),l+=1,delete d[n])}}return{empty:s,priority:o,mountedCount:r,unmountedCount:a,updatedCount:l,postponedCount:c}}updateViewsAsync(t={},e={processed:0,priority:Ty.MIN_PRIORITY}){const n=this.updates,i=n.animationId;if(i){if(Jl(i),0===e.processed){const e=t.before;"function"===typeof e&&Ya(e,this.graph,this.graph)}const s=this.updateViewsBatch(t),o=this.checkViewImpl({checkView:t.checkView,mountedBatchSize:Ty.MOUNT_BATCH_SIZE-s.mountedCount,unmountedBatchSize:Ty.MOUNT_BATCH_SIZE-s.unmountedCount});let r=e.processed;const a=n.count,l=o.mountedCount,c=o.unmountedCount;s.updatedCount>0&&(r+=s.updatedCount+s.unmountedCount,e.priority=Math.min(s.priority,e.priority),s.empty&&0===l?(s.priority=e.priority,s.mountedCount+=l,s.unmountedCount+=c,this.graph.trigger("render:done",{stats:s,options:t}),e.processed=0,n.count=0):e.processed=r);const h=t.progress;if(a&&"function"===typeof h&&Ya(h,this.graph,{total:a,done:s.empty,current:r}),n.animationId!==i)return}n.animationId=Yl((()=>{this.updateViewsAsync(t,e)}))}registerMountedView(t){const e=t.cid,n=this.updates;if(e in n.mounted)return 0;n.mounted[e]=!0,n.mountedCids.push(e);const i=n.unmounted[e]||0;return delete n.unmounted[e],i}registerUnmountedView(t){const e=t.cid,n=this.updates;if(e in n.unmounted)return 0;n.unmounted[e]|=Ty.FLAG_INSERT;const i=n.unmounted[e];return n.unmountedCids.push(e),delete n.mounted[e],i}isViewMounted(t){if(null==t)return!1;const e=t.cid;return e in this.updates.mounted}getMountedViews(){return Object.keys(this.updates.mounted).map((t=>up.views[t]))}getUnmountedViews(){return Object.keys(this.updates.unmounted).map((t=>up.views[t]))}checkMountedViews(t,e){let n=0;if("function"!==typeof t)return n;const i=this.updates,s=i.mounted,o=i.mountedCids,r=null==e?o.length:Math.min(o.length,e);for(let a=0;a<r;a+=1){const e=o[a];if(!(e in s))continue;const i=up.views[e];if(null==i)continue;const r=Ya(t,this.graph,{view:i,unmounted:!0});if(r){o.push(e);continue}n+=1;const l=this.registerUnmountedView(i);l&&i.unmount()}return o.splice(0,r),n}checkUnmountedViews(t,e){let n=0;"function"!==typeof t&&(t=null);const i=this.updates,s=i.unmounted,o=i.unmountedCids,r=null==e?o.length:Math.min(o.length,e);for(let a=0;a<r;a+=1){const e=o[a];if(!(e in s))continue;const i=up.views[e];if(null==i)continue;if(t&&!Ya(t,this.graph,{view:i,unmounted:!1})){o.push(e);continue}n+=1;const r=this.registerMountedView(i);r&&this.scheduleViewUpdate(i,r,i.priority,{mounting:!0})}return o.splice(0,r),n}checkViewImpl(t={mountedBatchSize:Number.MAX_SAFE_INTEGER,unmountedBatchSize:Number.MAX_SAFE_INTEGER}){const e=t.checkView||this.options.checkView,n=this.checkMountedViews(e,t.unmountedBatchSize),i=this.checkUnmountedViews(e,n>0?Math.min(this.updates.unmountedCids.length-n,t.mountedBatchSize):t.mountedBatchSize);return{mountedCount:i,unmountedCount:n}}checkView(t={}){return this.checkViewImpl(t)}isFrozen(){return!!this.options.frozen}freeze(t={}){const e=t.key,n=this.updates,i=this.options.frozen,s=n.freezeKey;if(e&&e!==s){if(i&&s)return;n.frozen=i,n.freezeKey=e}this.options.frozen=!0;const o=n.animationId;n.animationId=null,this.isAsync()&&null!=o&&Jl(o),this.graph.trigger("freeze",{key:e})}unfreeze(t={}){const e=t.key,n=this.updates,i=n.freezeKey;if(e&&i&&e!==i)return;if(n.freezeKey=null,e&&e===i&&n.frozen)return;const s=()=>{this.options.frozen=n.frozen=!1,n.sort&&(this.sortViews(),n.sort=!1);const i=t.after;i&&Ya(i,this.graph,this.graph),this.graph.trigger("unfreeze",{key:e})};if(this.isAsync()){this.freeze();const e=t.progress;this.updateViewsAsync(Object.assign(Object.assign({},t),{progress:({done:t,current:n,total:i})=>{e&&Ya(e,this.graph,{done:t,current:n,total:i}),t&&s()}}))}else this.updateViews(t),s()}isAsync(){return!!this.options.async}setAsync(t){this.options.async=t}onRemove(){this.freeze(),this.removeViews()}resetViews(t=[],e={}){this.resetUpdates(),this.removeViews(),this.freeze({key:"reset"});for(let n=0,i=t.length;n<i;n+=1)this.renderView(t[n],e);this.unfreeze({key:"reset"}),this.sortViews()}removeView(t){const e=this.views[t.id];if(e){const n=e.cid,i=this.updates,s=i.mounted,o=i.unmounted;e.remove(),delete this.views[t.id],delete s[n],delete o[n]}return e}removeViews(){this.views&&Object.keys(this.views).forEach((t=>{const e=this.views[t];e&&this.removeView(e.cell)})),this.views={}}renderView(t,e={}){const n=t.id,i=this.views;let s=0,o=i[n];if(t.isVisible()&&(!t.isEdge()||this.isEdgeTerminalVisible(t,"source")&&this.isEdgeTerminalVisible(t,"target"))){if(o)s=Ty.FLAG_INSERT;else{const e=this.graph.hook.createCellView(t);e&&(o=i[t.id]=e,o.graph=this.graph,s=this.registerUnmountedView(o)|o.getBootstrapFlag())}o&&this.requestViewUpdate(o,s,o.priority,e)}}isExactSorting(){return"exact"===this.options.sorting}sortViews(){this.isExactSorting()&&(this.isFrozen()?this.updates.sort=!0:this.sortViewsExact())}sortElements(t,e){const n=t.map((t=>{const e=t.parentNode,n=e.insertBefore(document.createTextNode(""),t.nextSibling);return t=>{if(e===t)throw new Error("You can't sort elements if any one is a descendant of another.");e.insertBefore(t,n),e.removeChild(n)}}));t.sort(e).forEach(((t,e)=>n[e](t)))}sortViewsExact(){const t=this.view.$(this.view.stage).children("[data-cell-id]").toArray(),e=this.model;this.sortElements(t,((t,n)=>{const i=e.getCell(t.getAttribute("data-cell-id")||""),s=e.getCell(n.getAttribute("data-cell-id")||""),o=i.getZIndex()||0,r=s.getZIndex()||0;return o===r?0:o<r?-1:1}))}addZPivot(t=0){null==this.zPivots&&(this.zPivots={});const e=this.zPivots;let n=e[t];if(n)return n;n=e[t]=document.createComment(`z-index:${t+1}`);let i=-1/0;for(const o in e){const e=+o;e<t&&e>i&&(i=e)}const s=this.view.stage;if(i!==-1/0){const t=e[i];s.insertBefore(n,t.nextSibling)}else s.insertBefore(n,s.firstChild);return n}removeZPivots(){this.zPivots&&Object.keys(this.zPivots).forEach((t=>{const e=this.zPivots[t];e&&e.parentNode&&e.parentNode.removeChild(e)})),this.zPivots={}}insertView(t){const e=this.view.stage;switch(this.options.sorting){case"approx":{const n=t.cell.getZIndex(),i=this.addZPivot(n);e.insertBefore(t.container,i);break}case"exact":default:e.appendChild(t.container);break}}findViewByCell(t){if(null==t)return null;const e=Sm.isCell(t)?t.id:t;return this.views[e]}findViewByElem(t){if(null==t)return null;const e="string"===typeof t?this.view.stage.querySelector(t):t instanceof Element?t:t[0];if(e){const t=this.view.findAttr("data-cell-id",e);if(t)return this.views[t]}return null}findViewsFromPoint(t){const e={x:t.x,y:t.y};return this.model.getCells().map((t=>this.findViewByCell(t))).filter((t=>null!=t&&kh(t.container,{target:this.view.stage}).containsPoint(e)))}findEdgeViewsInArea(t,e={}){const n=lc.create(t);return this.model.getEdges().map((t=>this.findViewByCell(t))).filter((t=>{if(t){const i=kh(t.container,{target:this.view.stage});return 0===i.width?i.inflate(1,0):0===i.height&&i.inflate(0,1),e.strict?n.containsRect(i):n.isIntersectWithRect(i)}return!1}))}findViewsInArea(t,e={}){const n=lc.create(t);return this.model.getNodes().map((t=>this.findViewByCell(t))).filter((t=>{if(t){const i=kh(t.container,{target:this.view.stage});return e.strict?n.containsRect(i):n.isIntersectWithRect(i)}return!1}))}dispose(){this.resetUpdates(),this.stopListening()}}Oy([ly.dispose()],Ty.prototype,"dispose",null),function(t){t.FLAG_INSERT=1<<30,t.FLAG_REMOVE=1<<29,t.MOUNT_BATCH_SIZE=1e3,t.UPDATE_BATCH_SIZE=1e3,t.MIN_PRIORITY=2,t.SORT_DELAYING_BATCHES=["add","to-front","to-back"],t.UPDATE_DELAYING_BATCHES=["translate"]}(Ty||(Ty={}));var Ny=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class jy extends ly{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(t={}){let e=t.size||"auto auto",n=t.position||"center";const i=this.graph.transform.getScale(),s=this.graph.translate();if("object"===typeof n){const t=s.tx+i.sx*(n.x||0),e=s.ty+i.sy*(n.y||0);n=`${t}px ${e}px`}"object"===typeof e&&(e=lc.fromSize(e).scale(i.sx,i.sy),e=`${e.width}px ${e.height}px`),this.elem.style.backgroundSize=e,this.elem.style.backgroundPosition=n}drawBackgroundImage(t,e={}){if(!(t instanceof HTMLImageElement))return void(this.elem.style.backgroundImage="");const n=this.optionsCache;if(n&&n.image!==e.image)return;let i;const s=e.opacity,o=e.size;let r=e.repeat||"no-repeat";const a=qd.registry.get(r);if("function"===typeof a){const n=e.quality||1;t.width*=n,t.height*=n;const s=a(t,e);if(!(s instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");i=s.toDataURL("image/png"),r=e.repeat&&r!==e.repeat?e.repeat:"repeat","object"===typeof o?(o.width*=s.width/t.width,o.height*=s.height/t.height):void 0===o&&(e.size={width:s.width/n,height:s.height/n})}else i=t.src,void 0===o&&(e.size={width:t.width,height:t.height});null!=n&&"object"===typeof e.size&&e.image===n.image&&e.repeat===n.repeat&&e.quality===n.quality&&(n.size=ci.Z(e.size));const l=this.elem.style;l.backgroundImage=`url(${i})`,l.backgroundRepeat=r,l.opacity=null==s||s>=1?"":`${s}`,this.updateBackgroundImage(e)}updateBackgroundColor(t){this.elem.style.backgroundColor=t||""}updateBackgroundOptions(t){this.graph.options.background=t}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(t){const e=t||{};if(this.updateBackgroundOptions(t),this.updateBackgroundColor(e.color),e.image){this.optionsCache=ci.Z(e);const n=document.createElement("img");n.onload=()=>this.drawBackgroundImage(n,t),n.setAttribute("crossorigin","anonymous"),n.src=e.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}Ny([ly.dispose()],jy.prototype,"dispose",null);var Fy,Ly=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},zy=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Iy extends Jg{constructor(t){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=Fy.getOptions(t);const e=this.graph.transform.getScale();this.sx=e.sx,this.sy=e.sy;const n=this.options.width||this.graph.options.width,i=this.options.height||this.graph.options.height;this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(Fy.containerClass)).css({width:n,height:i}),this.options.pageVisible&&this.$container.addClass(this.prefixClassName(Fy.pagedClass)),this.options.className&&this.$container.addClass(this.options.className);const s=this.graph.container;s.parentNode&&this.$container.insertBefore(s);const o=s.getAttribute("style");if(o){const t={},e=o.split(";");e.forEach((e=>{const n=e.trim();if(n){const e=n.split(":");e.length&&(t[e[0].trim()]=e[1]?e[1].trim():"")}})),Object.keys(t).forEach((e=>{"width"!==e&&"height"!==e&&(s.style[e]="",this.container.style[e]=t[e])}))}this.content=document.createElement("div"),this.$content=this.$(this.content).addClass(this.prefixClassName(Fy.contentClass)).css({width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),this.$background=this.$(this.background).addClass(this.prefixClassName(Fy.backgroundClass)),this.$content.append(this.background),this.options.pageVisible||this.$content.append(this.graph.view.grid),this.$content.append(s),this.$content.appendTo(this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new Iy.Background(this),this.options.autoResize||this.update()}get graph(){return this.options.graph}get model(){return this.graph.model}startListening(){const t=this.graph,e=this.model;t.on("scale",this.onScale,this),t.on("resize",this.onResize,this),t.on("before:print",this.storeScrollPosition,this),t.on("before:export",this.storeScrollPosition,this),t.on("after:print",this.restoreScrollPosition,this),t.on("after:export",this.restoreScrollPosition,this),t.on("render:done",this.onRenderDone,this),t.on("unfreeze",this.onUpdate,this),e.on("reseted",this.onUpdate,this),e.on("cell:added",this.onUpdate,this),e.on("cell:removed",this.onUpdate,this),e.on("cell:changed",this.onUpdate,this),e.on("batch:stop",this.onBatchStop,this),this.delegateBackgroundEvents()}stopListening(){const t=this.graph,e=this.model;t.off("scale",this.onScale,this),t.off("resize",this.onResize,this),t.off("beforeprint",this.storeScrollPosition,this),t.off("beforeexport",this.storeScrollPosition,this),t.off("afterprint",this.restoreScrollPosition,this),t.off("afterexport",this.restoreScrollPosition,this),t.off("render:done",this.onRenderDone,this),t.off("unfreeze",this.onUpdate,this),e.off("reseted",this.onUpdate,this),e.off("cell:added",this.onUpdate,this),e.off("cell:removed",this.onUpdate,this),e.off("cell:changed",this.onUpdate,this),e.off("batch:stop",this.onBatchStop,this),this.undelegateBackgroundEvents()}enableAutoResize(){this.options.autoResize=!0}disableAutoResize(){this.options.autoResize=!1}onUpdate(){!this.graph.isAsync()&&this.options.autoResize&&this.update()}onBatchStop(t){!this.graph.isAsync()&&this.options.autoResize&&Ty.UPDATE_DELAYING_BATCHES.includes(t.name)&&this.update()}delegateBackgroundEvents(t){const e=t||uy.events;this.delegatedHandlers=Object.keys(e).reduce(((t,n)=>{const i=e[n];if(-1===n.indexOf(" "))if("function"===typeof i)t[n]=i;else{let e=this.graph.view[i];"function"===typeof e&&(e=e.bind(this.graph.view),t[n]=e)}return t}),{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach((t=>{this.delegateEvent(t,{guarded:!1},this.onBackgroundEvent)}))}undelegateBackgroundEvents(){Object.keys(this.delegatedHandlers).forEach((t=>{this.undelegateEvent(t,this.onBackgroundEvent)}))}onBackgroundEvent(t){let e=!1;const n=t.target;if(this.options.pageVisible)e=this.options.background?this.background===n:this.content===n;else{const t=this.graph.view;e=t.background===n||t.grid===n}if(e){const e=this.delegatedHandlers[t.type];"function"===typeof e&&e.apply(this.graph,arguments)}}onRenderDone({stats:t}){this.options.autoResize&&t.priority<2&&this.update()}onResize(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())}onScale({sx:t,sy:e,ox:n,oy:i}){this.updateScale(t,e),(n||i)&&(this.centerPoint(n,i),this.updatePageBreak());const s=this.options.autoResizeOptions||this.options.fitTocontentOptions;"function"===typeof s&&this.update()}storeScrollPosition(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop}restoreScrollPosition(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null}storeClientSize(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}}restoreClientSize(){this.cachedClientSize=null}beforeManipulation(){(ht.IS_IE||ht.IS_EDGE)&&this.$container.css("visibility","hidden")}afterManipulation(){(ht.IS_IE||ht.IS_EDGE)&&this.$container.css("visibility","visible")}updatePageSize(t,e){null!=t&&(this.options.pageWidth=t),null!=e&&(this.options.pageHeight=e),this.updatePageBreak()}updatePageBreak(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){const t=this.graph.options.width,e=this.graph.options.height,n=this.options.pageWidth*this.sx,i=this.options.pageHeight*this.sy;if(t>n||e>i){let s=!1;const o=document.createElement("div");for(let e=1,i=Math.floor(t/n);e<i;e+=1)this.$("<div/>").addClass(this.prefixClassName("graph-pagebreak-vertical")).css({left:e*n}).appendTo(o),s=!0;for(let t=1,n=Math.floor(e/i);t<n;t+=1)this.$("<div/>").addClass(this.prefixClassName("graph-pagebreak-horizontal")).css({top:t*i}).appendTo(o),s=!0;s&&(rl(o,this.prefixClassName("graph-pagebreak")),this.$(this.graph.view.grid).after(o),this.pageBreak=o)}}}update(){const t=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(t.width/2,t.height/2);let e=this.options.autoResizeOptions||this.options.fitTocontentOptions;"function"===typeof e&&(e=Ya(e,this,this));const n=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative"},e);this.graph.fitToContent(this.getFitToContentOptions(n))}getFitToContentOptions(t){const e=this.sx,n=this.sy;return t.gridWidth&&(t.gridWidth*=e),t.gridHeight&&(t.gridHeight*=n),t.minWidth&&(t.minWidth*=e),t.minHeight&&(t.minHeight*=n),"object"===typeof t.padding?t.padding={left:(t.padding.left||0)*e,right:(t.padding.right||0)*e,top:(t.padding.top||0)*n,bottom:(t.padding.bottom||0)*n}:"number"===typeof t.padding&&(t.padding*=e),this.options.autoResize||(t.contentArea=lc.create()),t}updateScale(t,e){const n=this.graph.options,i=t/this.sx,s=e/this.sy;this.sx=t,this.sy=e,this.graph.translate(n.x*i,n.y*s),this.graph.resizeGraph(n.width*i,n.height*s)}scrollbarPosition(t,e,n){if(null==t&&null==e)return{left:this.container.scrollLeft,top:this.container.scrollTop};const i={};return"number"===typeof t&&(i.scrollLeft=t),"number"===typeof e&&(i.scrollTop=e),n&&n.animation?this.$container.animate(i,n.animation):this.$container.prop(i),this}scrollToPoint(t,e,n){const i=this.getClientSize(),s=this.graph.matrix(),o={};return"number"===typeof t&&(o.scrollLeft=t-i.width/2+s.e+(this.padding.left||0)),"number"===typeof e&&(o.scrollTop=e-i.height/2+s.f+(this.padding.top||0)),n&&n.animation?this.$container.animate(o,n.animation):this.$container.prop(o),this}scrollToContent(t){const e=this.sx,n=this.sy,i=this.graph.getContentArea().getCenter();return this.scrollToPoint(i.x*e,i.y*n,t)}scrollToCell(t,e){const n=this.sx,i=this.sy,s=t.getBBox().getCenter();return this.scrollToPoint(s.x*n,s.y*i,e)}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const i=this.graph.matrix(),s=i.a,o=i.d,r=-i.e,a=-i.f,l=r+this.graph.options.width,c=a+this.graph.options.height;let h;if(this.storeClientSize(),"number"===typeof t||"number"===typeof e){h=n;const i=this.getVisibleArea().getCenter();"number"===typeof t?t*=s:t=i.x,"number"===typeof e?e*=o:e=i.y}else h=t,t=(r+l)/2,e=(a+c)/2;if(h&&h.padding)return this.positionPoint({x:t,y:e},"50%","50%",h);const u=this.getPadding(),d=this.getClientSize(),g=d.width/2,p=d.height/2,f=g-u.left-t+r,m=g-u.right+t-l,y=p-u.top-e+a,b=p-u.bottom+e-c;this.addPadding(Math.max(f,0),Math.max(m,0),Math.max(y,0),Math.max(b,0));const w=this.scrollToPoint(t,e,h||void 0);return this.restoreClientSize(),w}centerContent(t){return this.positionContent("center",t)}centerCell(t,e){return this.positionCell(t,"center",e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t,e)}positionCell(t,e,n){const i=t.getBBox();return this.positionRect(i,e,n)}positionRect(t,e,n){const i=lc.create(t);switch(e){case"center":return this.positionPoint(i.getCenter(),"50%","50%",n);case"top":return this.positionPoint(i.getTopCenter(),"50%",0,n);case"top-right":return this.positionPoint(i.getTopRight(),"100%",0,n);case"right":return this.positionPoint(i.getRightMiddle(),"100%","50%",n);case"bottom-right":return this.positionPoint(i.getBottomRight(),"100%","100%",n);case"bottom":return this.positionPoint(i.getBottomCenter(),"50%","100%",n);case"bottom-left":return this.positionPoint(i.getBottomLeft(),0,"100%",n);case"left":return this.positionPoint(i.getLeftMiddle(),0,"50%",n);case"top-left":return this.positionPoint(i.getTopLeft(),0,0,n);default:return this}}positionPoint(t,e,n,i={}){const{padding:s}=i,o=zy(i,["padding"]),r=_a(s),a=lc.fromSize(this.getClientSize()),l=a.clone().moveAndExpand({x:r.left,y:r.top,width:-r.right-r.left,height:-r.top-r.bottom});e=$a(e,Math.max(0,l.width)),e<0&&(e=l.width+e),n=$a(n,Math.max(0,l.height)),n<0&&(n=l.height+n);const c=l.getTopLeft().translate(e,n),h=a.getCenter().diff(c),u=this.zoom(),d=h.scale(1/u,1/u),g=ac.create(t).translate(d);return this.centerPoint(g.x,g.y,o)}zoom(t,e){if(null==t)return this.sx;let n,i;e=e||{};const s=this.getClientSize(),o=this.clientToLocalPoint(s.width/2,s.height/2);let r=t,a=t;if(e.absolute||(r+=this.sx,a+=this.sy),e.scaleGrid&&(r=Math.round(r/e.scaleGrid)*e.scaleGrid,a=Math.round(a/e.scaleGrid)*e.scaleGrid),e.maxScale&&(r=Math.min(e.maxScale,r),a=Math.min(e.maxScale,a)),e.minScale&&(r=Math.max(e.minScale,r),a=Math.max(e.minScale,a)),r=this.graph.transform.clampScale(r),a=this.graph.transform.clampScale(a),e.center){const t=r/this.sx,s=a/this.sy;n=e.center.x-(e.center.x-o.x)/t,i=e.center.y-(e.center.y-o.y)/s}else n=o.x,i=o.y;return this.beforeManipulation(),this.graph.transform.scale(r,a),this.centerPoint(n,i),this.afterManipulation(),this}zoomToRect(t,e={}){const n=lc.create(t),i=this.graph;e.contentArea=n,null==e.viewportArea&&(e.viewportArea={x:i.options.x,y:i.options.y,width:this.$container.width(),height:this.$container.height()}),this.beforeManipulation(),i.transform.scaleContentToFitImpl(e,!1);const s=n.getCenter();return this.centerPoint(s.x,s.y),this.afterManipulation(),this}zoomToFit(t={}){return this.zoomToRect(this.graph.getContentArea(t),t)}transitionToPoint(t,e,n){let i,s;"object"===typeof t?(n=e,e=t.y,t=t.x):e=e,null==n&&(n={});const o=this.sx,r=Math.max(n.scale||o,1e-6),a=this.getClientSize(),l=new ac(t,e),c=this.clientToLocalPoint(a.width/2,a.height/2);if(o===r){const t=c.diff(l).scale(o,o).round();i=`translate(${t.x}px,${t.y}px)`}else{const t=r/(o-r)*l.distance(c),e=c.clone().move(l,t),n=this.localToBackgroundPoint(e).round();i=`scale(${r/o})`,s=`${n.x}px ${n.y}px`}const h=n.onTransitionEnd;return this.$container.addClass(Fy.transitionClassName),this.$content.off(Fy.transitionEventName).on(Fy.transitionEventName,(n=>{this.syncTransition(r,{x:t,y:e}),"function"===typeof h&&Ya(h,this,n.originalEvent)})).css({transform:i,transformOrigin:s,transition:"transform",transitionDuration:n.duration||"1s",transitionDelay:n.delay,transitionTimingFunction:n.timing}),this}syncTransition(t,e){return this.beforeManipulation(),this.graph.scale(t),this.removeTransition(),this.centerPoint(e.x,e.y),this.afterManipulation(),this}removeTransition(){return this.$container.removeClass(Fy.transitionClassName),this.$content.off(Fy.transitionEventName).css({transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(t,e={}){const n=lc.create(t),i=e.maxScale||1/0,s=e.minScale||Number.MIN_VALUE,o=e.scaleGrid||null,r=e.visibility||1,a=e.center?ac.create(e.center):n.getCenter(),l=this.getClientSize(),c=l.width*r,h=l.height*r;let u=new lc(a.x-c/2,a.y-h/2,c,h).getMaxUniformScaleToFit(n,a);return u=Math.min(u,i),o&&(u=Math.floor(u/o)*o),u=Math.max(s,u),this.transitionToPoint(a,Object.assign({scale:u},e))}startPanning(t){const e=this.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("pan:start",{e:e}),this.$(document.body).on({"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),this.$(window).on("mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.normalizeEvent(t),n=e.clientX-this.clientX,i=e.clientY-this.clientY;this.container.scrollTop-=i,this.container.scrollLeft-=n,this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("panning",{e:e})}stopPanning(t){this.$(document.body).off(".panning"),this.$(window).off(".panning"),this.trigger("pan:stop",{e:t})}clientToLocalPoint(t,e){let n="object"===typeof t?t.x:t,i="object"===typeof t?t.y:e;const s=this.graph.matrix();return n+=this.container.scrollLeft-this.padding.left-s.e,i+=this.container.scrollTop-this.padding.top-s.f,new ac(n/s.a,i/s.d)}localToBackgroundPoint(t,e){const n="object"===typeof t?ac.create(t):new ac(t,e),i=this.graph.matrix(),s=this.padding;return bh(n,i).translate(s.left,s.top)}resize(t,e){let n=null!=t?t:this.container.offsetWidth,i=null!=e?e:this.container.offsetHeight;"number"===typeof n&&(n=Math.round(n)),"number"===typeof i&&(i=Math.round(i)),this.options.width=n,this.options.height=i,this.$container.css({width:n,height:i}),this.update()}getClientSize(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}}autoScroll(t,e){const n=10,i=this.container,s=i.getBoundingClientRect();let o=0,r=0;return t<=s.left+n&&(o=-n),e<=s.top+n&&(r=-n),t>=s.right-n&&(o=n),e>=s.bottom-n&&(r=n),0!==o&&(i.scrollLeft+=o),0!==r&&(i.scrollTop+=r),{scrollerX:o,scrollerY:r}}addPadding(t,e,n,i){let s=this.getPadding();this.padding={left:Math.round(s.left+(t||0)),top:Math.round(s.top+(n||0)),bottom:Math.round(s.bottom+(i||0)),right:Math.round(s.right+(e||0))},s=this.padding,this.$content.css({width:s.left+this.graph.options.width+s.right,height:s.top+this.graph.options.height+s.bottom});const o=this.graph.container;return o.style.left=`${this.padding.left}px`,o.style.top=`${this.padding.top}px`,this}getPadding(){const t=this.options.padding;return _a("function"===typeof t?Ya(t,this,this):t)}getVisibleArea(){const t=this.graph.matrix(),e=this.getClientSize(),n={x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:e.width,height:e.height},i=Ch(n,t.inverse());return i.x-=(this.padding.left||0)/this.sx,i.y-=(this.padding.top||0)/this.sy,i}isCellVisible(t,e={}){const n=t.getBBox(),i=this.getVisibleArea();return e.strict?i.containsRect(n):i.isIntersectWithRect(n)}isPointVisible(t){return this.getVisibleArea().containsPoint(t)}lock(){return this.$container.css("overflow","hidden"),this}unlock(){return this.$container.css("overflow","scroll"),this}onRemove(){this.stopListening()}dispose(){this.$(this.graph.container).insertBefore(this.$container),this.remove()}}function By(t,e,n,i={}){if(n){const s=n.graph,o=s.view.normalizeEvent(e),r=s.snapToGrid(o.clientX,o.clientY);n.notify(t,Object.assign({e:o,view:n,node:n.cell,cell:n.cell,x:r.x,y:r.y},i))}}Ly([Jg.dispose()],Iy.prototype,"dispose",null),function(t){class e extends jy{constructor(t){super(t.graph),this.scroller=t,t.options.background&&this.draw(t.options.background)}get elem(){return this.scroller.background}init(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}updateBackgroundOptions(t){this.scroller.options.background=t}}t.Background=e}(Iy||(Iy={})),function(t){function e(e){const n=Kn({},t.defaultOptions,e);return null==n.pageWidth&&(n.pageWidth=e.graph.options.width),null==n.pageHeight&&(n.pageHeight=e.graph.options.height),n}t.containerClass="graph-scroller",t.panningClass=`${t.containerClass}-panning`,t.pannableClass=`${t.containerClass}-pannable`,t.pagedClass=`${t.containerClass}-paged`,t.contentClass=`${t.containerClass}-content`,t.backgroundClass=`${t.containerClass}-background`,t.transitionClassName="transition-in-progress",t.transitionEventName="transitionend.graph-scroller-transition",t.defaultOptions={padding(){const t=this.getClientSize(),e=Math.max(this.options.minVisibleWidth||0,1)||1,n=Math.max(this.options.minVisibleHeight||0,1)||1,i=Math.max(t.width-e,0),s=Math.max(t.height-n,0);return{left:i,top:s,right:i,bottom:s}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0},t.getOptions=e}(Fy||(Fy={}));var Ry,$y,Vy=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class _y extends Jg{constructor(t){super(),this.options=Kn({},Ry.defaultOptions,t),this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new Wm([],{comparator:Ry.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.initHandles(),this.startListening()}get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Ry.classNames.box)}get $boxes(){return this.$container.children(`.${this.boxClassName}`)}get handleOptions(){return this.options}startListening(){const t=this.graph,e=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),t.on("scale",this.onGraphTransformed,this),t.on("translate",this.onGraphTransformed,this),t.model.on("updated",this.onModelUpdated,this),e.on("added",this.onCellAdded,this),e.on("removed",this.onCellRemoved,this),e.on("reseted",this.onReseted,this),e.on("updated",this.onCollectionUpdated,this),e.on("node:change:position",this.onNodePositionChanged,this),e.on("cell:changed",this.onCellChanged,this)}stopListening(){const t=this.graph,e=this.collection;this.undelegateEvents(),t.off("scale",this.onGraphTransformed,this),t.off("translate",this.onGraphTransformed,this),t.model.off("updated",this.onModelUpdated,this),e.off("added",this.onCellAdded,this),e.off("removed",this.onCellRemoved,this),e.off("reseted",this.onReseted,this),e.off("updated",this.onCollectionUpdated,this),e.off("node:change:position",this.onNodePositionChanged,this),e.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes({async:!1})}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:t,options:e}){const{showNodeSelectionBox:n,pointerEvents:i}=this.options,{ui:s,selection:o}=e;let r=!this.translating;if(r=r&&(!0!==n||"none"===i),r=r&&s&&!o,r){this.translating=!0;const n=t.position(),i=t.previous("position"),s=n.x-i.x,o=n.y-i.y;0===s&&0===o||this.translateSelectedNodes(s,o,t,e),this.translating=!1}}onModelUpdated({removed:t}){t&&t.length&&this.unselect(t)}isEmpty(){return this.length<=0}isSelected(t){return this.collection.has(t)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(t,e={}){e.dryrun=!0;const n=this.filter(Array.isArray(t)?t:[t]);return this.collection.add(n,e),this}unselect(t,e={}){return e.dryrun=!0,this.collection.remove(Array.isArray(t)?t:[t],e),this}reset(t,e={}){if(t){if(e.batch){const n=this.filter(Array.isArray(t)?t:[t]);return this.collection.reset(n,Object.assign(Object.assign({},e),{ui:!0})),this}const n=this.cells,i=this.filter(Array.isArray(t)?t:[t]),s={},o={};n.forEach((t=>s[t.id]=t)),i.forEach((t=>o[t.id]=t));const r=[],a=[];return i.forEach((t=>{s[t.id]||r.push(t)})),n.forEach((t=>{o[t.id]||a.push(t)})),a.length&&this.unselect(a,Object.assign(Object.assign({},e),{ui:!0})),r.length&&this.select(r,Object.assign(Object.assign({},e),{ui:!0})),0===a.length&&0===r.length&&this.updateContainer(),this}return this.clean(e)}clean(t={}){return this.length&&(!1===t.batch?this.unselect(this.cells,t):this.collection.reset([],Object.assign(Object.assign({},t),{ui:!0}))),this}setFilter(t){this.options.filter=t}setContent(t){this.options.content=t}startSelecting(t){let e,n;t=this.normalizeEvent(t),this.clean();const i=this.graph.container;if(null!=t.offsetX&&null!=t.offsetY&&i.contains(t.target))e=t.offsetX,n=t.offsetY;else{const s=this.$(i).offset(),o=i.scrollLeft,r=i.scrollTop;e=t.clientX-s.left+window.pageXOffset+o,n=t.clientY-s.top+window.pageYOffset+r}this.$container.css({top:n,left:e,width:1,height:1}),this.setEventData(t,{action:"selecting",clientX:t.clientX,clientY:t.clientY,offsetX:e,offsetY:n,scrollerX:0,scrollerY:0}),this.delegateDocumentEvents(Ry.documentEvents,t.data)}filter(t){const e=this.options.filter;return Array.isArray(e)?t.filter((t=>!e.includes(t)&&!e.includes(t.shape))):"function"===typeof e?t.filter((t=>Ya(e,this.graph,t))):t}stopSelecting(t){const e=this.graph,n=this.getEventData(t),i=n.action;switch(i){case"selecting":{let t=this.$container.width(),n=this.$container.height();const i=this.$container.offset(),s=e.pageToLocal(i.left,i.top),o=e.transform.getScale();t/=o.sx,n/=o.sy;const r=new lc(s.x,s.y,t,n),a=this.getCellViewsInArea(r).map((t=>t.cell));this.reset(a,{batch:!0}),this.hideRubberband();break}case"translating":{const i=e.snapToGrid(t.clientX,t.clientY);if(!this.options.following){const t=n;this.updateSelectedNodesPosition({dx:t.clientX-t.originX,dy:t.clientY-t.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",t,i.x,i.y);break}default:this.clean();break}}onMouseUp(t){const e=this.getEventData(t).action;e&&(this.stopSelecting(t),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(t){this.options.following||t.stopPropagation();const e=this.normalizeEvent(t);this.options.movable&&this.startTranslating(e);const n=this.getCellViewFromElem(e.target);this.setEventData(e,{activeView:n});const i=this.graph.snapToGrid(e.clientX,e.clientY);this.notifyBoxEvent("box:mousedown",e,i.x,i.y),this.delegateDocumentEvents(Ry.documentEvents,e.data)}startTranslating(t){this.graph.model.startBatch("move-selection");const e=this.graph.snapToGrid(t.clientX,t.clientY);this.setEventData(t,{action:"translating",clientX:e.x,clientY:e.y,originX:e.x,originY:e.y})}getSelectionOffset(t,e){let n=t.x-e.clientX,i=t.y-e.clientY;const s=this.graph.hook.getRestrictArea();if(s){const o=this.collection.toArray(),r=Sm.getCellsBBox(o,{deep:!0})||lc.create(),a=s.x-r.x,l=s.y-r.y,c=s.x+s.width-(r.x+r.width),h=s.y+s.height-(r.y+r.height);if(n<a&&(n=a),i<l&&(i=l),c<n&&(n=c),h<i&&(i=h),!this.options.following){const s=t.x-e.originX,o=t.y-e.originY;n=s<=a||s>=c?0:n,i=o<=l||o>=h?0:i}}return{dx:n,dy:i}}updateSelectedNodesPosition(t){const{dx:e,dy:n}=t;if(e||n)if(this.translateSelectedNodes(e,n),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const t=this.graph.transform.getScale();this.$boxes.add(this.$selectionContainer).css({left:"+="+e*t.sx,top:"+="+n*t.sy})}}autoScrollGraph(t,e){const n=this.graph.scroller.widget;return n?n.autoScroll(t,e):{scrollerX:0,scrollerY:0}}adjustSelection(t){const e=this.normalizeEvent(t),n=this.getEventData(e),i=n.action;switch(i){case"selecting":{const t=n;!0!==t.moving&&(this.$container.appendTo(this.graph.container),this.showRubberband(),t.moving=!0);const{scrollerX:i,scrollerY:s}=this.autoScrollGraph(e.clientX,e.clientY);t.scrollerX+=i,t.scrollerY+=s;const o=e.clientX-t.clientX+t.scrollerX,r=e.clientY-t.clientY+t.scrollerY,a=parseInt(this.$container.css("left"),10),l=parseInt(this.$container.css("top"),10);this.$container.css({left:o<0?t.offsetX+o:a,top:r<0?t.offsetY+r:l,width:Math.abs(o),height:Math.abs(r)});break}case"translating":{const i=this.graph.snapToGrid(e.clientX,e.clientY),s=n,o=this.getSelectionOffset(i,s);this.options.following?this.updateSelectedNodesPosition(o):this.updateContainerPosition(o),o.dx&&(s.clientX=i.x),o.dy&&(s.clientY=i.y),this.notifyBoxEvent("box:mousemove",t,i.x,i.y);break}default:break}this.boxesUpdated=!1}translateSelectedNodes(t,e,n,i){const s={},o=[];if(n&&(s[n.id]=!0),this.collection.toArray().forEach((t=>{t.getDescendants({deep:!0}).forEach((t=>{s[t.id]=!0}))})),i&&i.translateBy){const t=this.graph.getCellById(i.translateBy);t&&(s[t.id]=!0,t.getDescendants({deep:!0}).forEach((t=>{s[t.id]=!0})),o.push(t))}this.collection.toArray().forEach((n=>{if(!s[n.id]){const r=Object.assign(Object.assign({},i),{selection:this.cid,exclude:o});n.translate(t,e,r),this.graph.model.getConnectedEdges(n).forEach((n=>{s[n.id]||(n.translate(t,e,r),s[n.id]=!0)}))}}))}getCellViewsInArea(t){const e=this.graph,n={strict:this.options.strict};let i=[];return this.options.rubberNode&&(i=this.options.useCellGeometry?i.concat(e.model.getNodesInArea(t,n).map((t=>e.renderer.findViewByCell(t))).filter((t=>null!=t))):i.concat(e.renderer.findViewsInArea(t,n))),this.options.rubberEdge&&(i=this.options.useCellGeometry?i.concat(e.model.getEdgesInArea(t,n).map((t=>e.renderer.findViewByCell(t))).filter((t=>null!=t))):i.concat(e.renderer.findEdgeViewsInArea(t,n))),i}notifyBoxEvent(t,e,n,i){const s=this.getEventData(e),o=s.activeView;this.trigger(t,{e:e,view:o,x:n,y:i,cell:o.cell})}getSelectedClassName(t){return this.prefixClassName((t.isNode()?"node":"edge")+"-selected")}addCellSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.addClass(this.getSelectedClassName(t))}removeCellUnSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.removeClass(this.getSelectedClassName(t))}destroySelectionBox(t){this.removeCellUnSelectedClassName(t),this.canShowSelectionBox(t)&&(this.$container.find(`[data-cell-id="${t.id}"]`).remove(),0===this.$boxes.length&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(t){t.forEach((t=>this.removeCellUnSelectedClassName(t))),this.hide(),this.$boxes.remove(),this.boxCount=0}hide(){this.$container.removeClass(this.prefixClassName(Ry.classNames.rubberband)).removeClass(this.prefixClassName(Ry.classNames.selected))}showRubberband(){this.$container.addClass(this.prefixClassName(Ry.classNames.rubberband))}hideRubberband(){this.$container.removeClass(this.prefixClassName(Ry.classNames.rubberband))}showSelected(){this.$container.removeAttr("style").addClass(this.prefixClassName(Ry.classNames.selected))}createContainer(){this.container=document.createElement("div"),this.$container=this.$(this.container),this.$container.addClass(this.prefixClassName(Ry.classNames.root)),this.options.className&&this.$container.addClass(this.options.className),this.$selectionContainer=this.$("<div/>").addClass(this.prefixClassName(Ry.classNames.inner)),this.$selectionContent=this.$("<div/>").addClass(this.prefixClassName(Ry.classNames.content)),this.$selectionContainer.append(this.$selectionContent),this.$selectionContainer.attr("data-selection-length",this.collection.length),this.$container.prepend(this.$selectionContainer),this.$handleContainer=this.$selectionContainer}updateContainerPosition(t){(t.dx||t.dy)&&this.$selectionContainer.css({left:`+=${t.dx}`,top:`+=${t.dy}`})}updateContainer(){const t={x:1/0,y:1/0},e={x:0,y:0},n=this.collection.toArray().filter((t=>this.canShowSelectionBox(t)));n.forEach((n=>{const i=this.graph.renderer.findViewByCell(n);if(i){const n=i.getBBox({useCellGeometry:this.options.useCellGeometry});t.x=Math.min(t.x,n.x),t.y=Math.min(t.y,n.y),e.x=Math.max(e.x,n.x+n.width),e.y=Math.max(e.y,n.y+n.height)}})),this.$selectionContainer.css({position:"absolute",pointerEvents:"none",left:t.x,top:t.y,width:e.x-t.x,height:e.y-t.y}).attr("data-selection-length",this.collection.length);const i=this.options.content;if(i)if("function"===typeof i){const t=Ya(i,this.graph,this,this.$selectionContent[0]);t&&this.$selectionContent.html(t)}else this.$selectionContent.html(i);this.collection.length>0&&!this.container.parentNode?this.$container.appendTo(this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(t){return t.isNode()&&!0===this.options.showNodeSelectionBox||t.isEdge()&&!0===this.options.showEdgeSelectionBox}createSelectionBox(t){if(this.addCellSelectedClassName(t),this.canShowSelectionBox(t)){const e=this.graph.renderer.findViewByCell(t);if(e){const n=e.getBBox({useCellGeometry:this.options.useCellGeometry}),i=this.boxClassName;this.$("<div/>").addClass(i).addClass(`${i}-${t.isNode()?"node":"edge"}`).attr("data-cell-id",t.id).css({position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:this.options.pointerEvents||"auto"}).appendTo(this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(t={}){this.collection.length>0&&(this.boxesUpdated=!0,this.graph.renderer.requestViewUpdate(this,1,2,t))}confirmUpdate(){return this.boxCount&&(this.hide(),this.$boxes.each(((t,e)=>{const n=this.$(e).remove().attr("data-cell-id"),i=this.collection.get(n);i&&this.createSelectionBox(i)})),this.updateContainer()),0}getCellViewFromElem(t){const e=t.getAttribute("data-cell-id");if(e){const t=this.collection.get(e);if(t)return this.graph.renderer.findViewByCell(t)}return null}onCellRemoved({cell:t}){this.destroySelectionBox(t),this.updateContainer()}onReseted({previous:t,current:e}){this.destroyAllSelectionBoxes(t),e.forEach((t=>{this.listenCellRemoveEvent(t),this.createSelectionBox(t)})),this.updateContainer()}onCellAdded({cell:t}){this.listenCellRemoveEvent(t),this.createSelectionBox(t),this.updateContainer()}listenCellRemoveEvent(t){t.off("removed",this.onCellRemoved,this),t.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:t,removed:e,options:n}){t.forEach((t=>{this.trigger("cell:selected",{cell:t,options:n}),this.graph.trigger("cell:selected",{cell:t,options:n}),t.isNode()?(this.trigger("node:selected",{cell:t,options:n,node:t}),this.graph.trigger("node:selected",{cell:t,options:n,node:t})):t.isEdge()&&(this.trigger("edge:selected",{cell:t,options:n,edge:t}),this.graph.trigger("edge:selected",{cell:t,options:n,edge:t}))})),e.forEach((t=>{this.trigger("cell:unselected",{cell:t,options:n}),this.graph.trigger("cell:unselected",{cell:t,options:n}),t.isNode()?(this.trigger("node:unselected",{cell:t,options:n,node:t}),this.graph.trigger("node:unselected",{cell:t,options:n,node:t})):t.isEdge()&&(this.trigger("edge:unselected",{cell:t,options:n,edge:t}),this.graph.trigger("edge:unselected",{cell:t,options:n,edge:t}))}));const i={added:t,removed:e,options:n,selected:this.cells};this.trigger("selection:changed",i),this.graph.trigger("selection:changed",i)}deleteSelectedCells(){const t=this.collection.toArray();this.clean(),this.graph.model.removeCells(t,{selection:this.cid})}startRotate({e:t}){const e=this.collection.toArray(),n=Sm.getCellsBBox(e).getCenter(),i=this.graph.snapToGrid(t.clientX,t.clientY),s=e.reduce(((t,e)=>(t[e.id]=Ql.normalize(e.getAngle()),t)),{});this.setEventData(t,{center:n,angles:s,start:i.theta(n)})}doRotate({e:t}){const e=this.getEventData(t),n=this.graph.options.rotating.grid,i="function"===typeof n?Ya(n,this.graph,null):n,s=this.graph.snapToGrid(t.clientX,t.clientY),o=e.start-s.theta(e.center);e.rotated||(e.rotated=!0),Math.abs(o)>.001&&(this.collection.toArray().forEach((t=>{const n=Xd.snapToGrid(e.angles[t.id]+o,i||15);t.rotate(n,{absolute:!0,center:e.center,selection:this.cid})})),this.updateSelectionBoxes())}stopRotate({e:t}){const e=this.getEventData(t);e.rotated&&(e.rotated=!1,this.collection.toArray().forEach((e=>{By("node:rotated",t,this.graph.findViewByCell(e))})))}startResize({e:t}){const e=this.graph.getGridSize(),n=this.collection.toArray(),i=Sm.getCellsBBox(n),s=n.map((t=>t.getBBox())),o=s.reduce(((t,e)=>e.width<t?e.width:t),1/0),r=s.reduce(((t,e)=>e.height<t?e.height:t),1/0);this.setEventData(t,{bbox:i,cells:this.graph.model.getSubGraph(n),minWidth:e*i.width/o,minHeight:e*i.height/r})}doResize({e:t,dx:e,dy:n}){const i=this.eventData(t),s=i.bbox,o=s.width,r=s.height,a=Math.max(o+e,i.minWidth),l=Math.max(r+n,i.minHeight);i.resized||(i.resized=!0),(Math.abs(o-a)>.001||Math.abs(r-l)>.001)&&(this.graph.model.resizeCells(a,l,i.cells,{selection:this.cid}),s.width=a,s.height=l,this.updateSelectionBoxes())}stopResize({e:t}){const e=this.eventData(t);e.resized&&(e.resized=!1,this.collection.toArray().forEach((e=>{By("node:resized",t,this.graph.findViewByCell(e))})))}dispose(){this.clean(),this.remove()}}Vy([Jg.dispose()],_y.prototype,"dispose",null),Si(_y,yy),function(t){const e="widget-selection";function n(t){return t.getAncestors().length}t.classNames={root:e,inner:`${e}-inner`,box:`${e}-box`,content:`${e}-content`,rubberband:`${e}-rubberband`,selected:`${e}-selected`},t.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.defaultOptions={movable:!0,following:!0,strict:!1,useCellGeometry:!1,content(t){return Ho('<%= length %> node<%= length > 1 ? "s":"" %> selected.')({length:t.length})},handles:[{name:"remove",position:"nw",events:{mousedown:"deleteSelectedCells"}},{name:"rotate",position:"sw",events:{mousedown:"startRotate",mousemove:"doRotate",mouseup:"stopRotate"}},{name:"resize",position:"se",events:{mousedown:"startResize",mousemove:"doResize",mouseup:"stopResize"}}]},t.depthComparator=n}(Ry||(Ry={}));class Gy extends vy{get node(){return this.cell}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}init(t){this.options=Object.assign(Object.assign({},$y.defaultOptions),t),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this),super.startListening()}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this),super.stopListening()}renderHandles(){this.container=document.createElement("div"),this.$container=this.$(this.container);const t=this.$("<div/>").prop("draggable",!1),e=t.clone().addClass(this.rotateClassName),n=$y.POSITIONS.map((e=>t.clone().addClass(this.resizeClassName).attr("data-position",e)));this.empty(),this.$container.append(n,e)}render(){return this.renderHandles(),this.view.addClass($y.NODE_CLS),this.$container.addClass(this.containerClassName).toggleClass("no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing).toggleClass("no-resize",!this.options.resizable).toggleClass("no-rotate",!this.options.rotatable),this.options.className&&this.$container.addClass(this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const t=this.graph.matrix(),e=this.node.getBBox();e.x*=t.a,e.x+=t.e,e.y*=t.d,e.y+=t.f,e.width*=t.a,e.height*=t.d;const n=Ql.normalize(this.node.getAngle()),i=0!==n?`rotate(${n}deg)`:"";return this.$container.css({transform:i,width:e.width,height:e.height,left:e.x,top:e.y}),this.updateResizerDirections(),this}remove(){return this.view.removeClass($y.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const t=Ql.normalize(this.node.getAngle()),e=Math.floor(t*($y.DIRECTIONS.length/360));if(e!==this.prevShift){const t=$y.DIRECTIONS.slice(e).concat($y.DIRECTIONS.slice(0,e)),n=t=>`${this.containerClassName}-cursor-${t}`;this.$container.find(`.${this.resizeClassName}`).removeClass($y.DIRECTIONS.map((t=>n(t))).join(" ")).each(((e,i)=>{this.$(i).addClass(n(t[e]))})),this.prevShift=e}}getTrueDirection(t){const e=Ql.normalize(this.node.getAngle());let n=$y.POSITIONS.indexOf(t);return n+=Math.floor(e*($y.POSITIONS.length/360)),n%=$y.POSITIONS.length,$y.POSITIONS[n]}toValidResizeDirection(t){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[t]||t}startResizing(t){t.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const e=this.$(t.target).attr("data-position"),n=this.graph.findViewByCell(this.node);this.prepareResizing(t,e),this.startAction(t),By("node:resize:mousedown",t,n)}prepareResizing(t,e){const n=this.getTrueDirection(e);let i=0,s=0;e.split("-").forEach((t=>{i={left:-1,right:1}[t]||i,s={top:-1,bottom:1}[t]||s}));const o=this.toValidResizeDirection(e),r={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[o],a=Ql.normalize(this.node.getAngle());this.setEventData(t,{selector:r,direction:o,trueDirection:n,relativeDirection:e,angle:a,resizeX:i,resizeY:s,action:"resizing"})}startRotating(t){t.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const e=this.graph.findViewByCell(this.node),n=this.node.getBBox().getCenter(),i=this.normalizeEvent(t),s=this.graph.snapToGrid(i.clientX,i.clientY);this.setEventData(t,{center:n,action:"rotating",angle:Ql.normalize(this.node.getAngle()),start:ac.create(s).theta(n)}),this.startAction(t),By("node:rotate:mousedown",t,e)}onMouseMove(t){const e=this.graph.findViewByCell(this.node);let n=this.getEventData(t);if(n.action){const i=this.normalizeEvent(t);let s=i.clientX,o=i.clientY;const r=this.graph.scroller.widget,a=this.options.restrictedResizing;if(!0===a||"number"===typeof a){const t=!0===a?0:a,e=r?Math.max(t,8):t,n=this.graph.container.getBoundingClientRect();s=Ia(s,n.left+e,n.right-e),o=Ia(o,n.top+e,n.bottom-e)}else this.options.autoScrollOnResizing&&r&&r.autoScroll(s,o);const l=this.graph.snapToGrid(s,o),c=this.graph.getGridSize(),h=this.node,u=this.options;if("resizing"===n.action){n=n,n.resized||(e&&(e.addClass("node-resizing"),By("node:resize",t,e)),n.resized=!0);const i=h.getBBox(),s=ac.create(l).rotate(n.angle,i.getCenter()).diff(i[n.selector]);let o=n.resizeX?s.x*n.resizeX:i.width,r=n.resizeY?s.y*n.resizeY:i.height;const a=o,d=r;if(o=Xd.snapToGrid(o,c),r=Xd.snapToGrid(r,c),o=Math.max(o,u.minWidth||c),r=Math.max(r,u.minHeight||c),o=Math.min(o,u.maxWidth||1/0),r=Math.min(r,u.maxHeight||1/0),u.preserveAspectRatio){const t=i.width*r/i.height,e=i.height*o/i.width;o<t?r=e:o=t}const g=n.relativeDirection;if(u.allowReverse&&(a<=-o||d<=-r)){let e;"left"===g?a<=-o&&(e="right"):"right"===g?a<=-o&&(e="left"):"top"===g?d<=-r&&(e="bottom"):"bottom"===g?d<=-r&&(e="top"):"top-left"===g?a<=-o&&d<=-r?e="bottom-right":a<=-o?e="top-right":d<=-r&&(e="bottom-left"):"top-right"===g?a<=-o&&d<=-r?e="bottom-left":a<=-o?e="top-left":d<=-r&&(e="bottom-right"):"bottom-left"===g?a<=-o&&d<=-r?e="top-right":a<=-o?e="bottom-right":d<=-r&&(e="top-left"):"bottom-right"===g&&(a<=-o&&d<=-r?e="top-left":a<=-o?e="bottom-left":d<=-r&&(e="top-right"));const n=e;this.stopHandle();const i=this.$container.find(`.${this.resizeClassName}[data-position="${n}"]`);this.startHandle(i[0]),this.prepareResizing(t,n),this.onMouseMove(t)}if(i.width!==o||i.height!==r){const i={ui:!0,direction:n.direction,relativeDirection:n.relativeDirection,trueDirection:n.trueDirection,minWidth:u.minWidth,minHeight:u.minHeight,maxWidth:u.maxWidth,maxHeight:u.maxHeight,preserveAspectRatio:!0===u.preserveAspectRatio};h.resize(o,r,i),By("node:resizing",t,e)}By("node:resize:mousemove",t,e)}else if("rotating"===n.action){n=n,n.rotated||(e&&(e.addClass("node-rotating"),By("node:rotate",t,e)),n.rotated=!0);const i=h.getAngle(),s=n.start-ac.create(l).theta(n.center);let o=n.angle+s;u.rotateGrid&&(o=Xd.snapToGrid(o,u.rotateGrid)),i!==o&&(h.rotate(o,{absolute:!0}),By("node:rotating",t,e)),By("node:rotate:mousemove",t,e)}}}onMouseUp(t){const e=this.graph.findViewByCell(this.node),n=this.getEventData(t);n.action&&(this.stopAction(t),this.model.stopBatch("resizing"===n.action?"resize":"rotate",{cid:this.cid}),"resizing"===n.action?By("node:resize:mouseup",t,e):"rotating"===n.action&&By("node:rotate:mouseup",t,e))}startHandle(t){if(this.handle=t||null,this.$container.addClass(`${this.containerClassName}-active`),t){this.$(t).addClass(`${this.containerClassName}-active-handle`);const e=t.getAttribute("data-position");if(e){const t=$y.DIRECTIONS[$y.POSITIONS.indexOf(e)];this.$container.addClass(`${this.containerClassName}-cursor-${t}`)}}}stopHandle(){if(this.$container.removeClass(`${this.containerClassName}-active`),this.handle){this.$(this.handle).removeClass(`${this.containerClassName}-active-handle`);const t=this.handle.getAttribute("data-position");if(t){const e=$y.DIRECTIONS[$y.POSITIONS.indexOf(t)];this.$container.removeClass(`${this.containerClassName}-cursor-${e}`)}this.handle=null}}startAction(t){this.startHandle(t.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents($y.documentEvents,t.data)}stopAction(t){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.graph.findViewByCell(this.node),n=this.getEventData(t);e&&(e.removeClass(`node-${n.action}`),"resizing"===n.action&&n.resized?By("node:resized",t,e):"rotating"===n.action&&n.rotated&&By("node:rotated",t,e))}}(function(t){t.NODE_CLS="has-widget-transform",t.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],t.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},t.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}})($y||($y={}));var Hy,Uy=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};(function(t){function e(t,e,n){const i={};return Object.keys(n||{}).forEach((s=>{const o=n[s];i[s]="function"===typeof o?o.call(t,e):o})),i}t.parseOptionGroup=e})(Hy||(Hy={})),function(t){function e(e){const{grid:n,panning:i,selecting:s,embedding:o,snapline:r,resizing:a,rotating:l,knob:c,clipboard:h,history:u,scroller:d,minimap:g,keyboard:p,mousewheel:f}=e,m=Uy(e,["grid","panning","selecting","embedding","snapline","resizing","rotating","knob","clipboard","history","scroller","minimap","keyboard","mousewheel"]),y=e.container;if(null==y)throw new Error("Ensure the container of the graph is specified and valid");null==m.width&&(m.width=y.clientWidth),null==m.height&&(m.height=y.clientHeight);const b=Kn({},t.defaults,m),w={size:10,visible:!1};b.grid="number"===typeof n?{size:n,visible:!1}:"boolean"===typeof n?Object.assign(Object.assign({},w),{visible:n}):Object.assign(Object.assign({},w),n);const C=["panning","selecting","embedding","snapline","resizing","rotating","knob","clipboard","history","scroller","minimap","keyboard","mousewheel"];return C.forEach((t=>{const n=e[t];"boolean"===typeof n?b[t].enabled=n:b[t]=Object.assign(Object.assign({},b[t]),n)})),b.background&&b.scroller.enabled&&null==b.scroller.background&&(b.scroller.background=b.background,delete b.background),b}t.get=e}(Hy||(Hy={})),function(t){t.defaults={x:0,y:0,grid:{size:10,visible:!1},scaling:{min:.01,max:16},background:!1,highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:Xd.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:Xd.prefix("available-magnet")}}},connecting:{snap:!1,multi:!0,dangling:!0,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",strategy:null,router:"normal",connector:"normal",validateConnection({type:t,sourceView:e,targetView:n}){const i="target"===t?n:e;return null!=i},createEdge(){return new sy}},transforming:{clearAll:!0,clearOnBlankMouseDown:!0},resizing:{enabled:!1,minWidth:0,minHeight:0,maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,orthogonal:!0,restricted:!1,autoScroll:!0,preserveAspectRatio:!1,allowReverse:!0},rotating:{enabled:!1,grid:15},translating:{restrict:!1},knob:{enabled:!1,clearAll:!0,clearOnBlankMouseDown:!0},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},selecting:{enabled:!1,rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,movable:!0,strict:!1,useCellGeometry:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,content:null,handles:null},panning:{enabled:!1,eventTypes:["leftMouseDown"]},snapline:{enabled:!1},clipboard:{enabled:!1},history:{enabled:!1},scroller:{enabled:!1},keyboard:{enabled:!1},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},async:!1,frozen:!1,sorting:"exact",moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},guard:()=>!1}}(Hy||(Hy={}));var Wy=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class qy extends ly{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(t){return null!=this.svg.getElementById(t)}filter(t){let e=t.id;const n=t.name;if(e||(e=`filter-${n}-${this.cid}-${Aa(JSON.stringify(t))}`),!this.isDefined(e)){const i=_d.registry.get(n);if(null==i)return _d.registry.onNotFound(n);const s=i(t.args||{}),o=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},t.attrs),{id:e});jc.create(rp.sanitize(s),o).appendTo(this.defs)}return e}gradient(t){let e=t.id;const n=t.type;if(e||(e=`gradient-${n}-${this.cid}-${Aa(JSON.stringify(t))}`),!this.isDefined(e)){const i=t.stops,s=i.map((t=>{const e=null!=t.opacity&&Number.isFinite(t.opacity)?t.opacity:1;return`<stop offset="${t.offset}" stop-color="${t.color}" stop-opacity="${e}"/>`})),o=`<${n}>${s.join("")}</${n}>`,r=Object.assign({id:e},t.attrs);jc.create(o,r).appendTo(this.defs)}return e}marker(t){const{id:e,refX:n,refY:i,markerUnits:s,markerOrient:o,tagName:r,children:a}=t,l=Wy(t,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let c=e;if(c||(c=`marker-${this.cid}-${Aa(JSON.stringify(t))}`),!this.isDefined(c)){"path"!==r&&delete l.d;const t=jc.create("marker",{refX:n,refY:i,id:c,overflow:"visible",orient:null!=o?o:"auto",markerUnits:s||"userSpaceOnUse"},a?a.map((t=>{var{tagName:e}=t,n=Wy(t,["tagName"]);return jc.create(`${e}`||"path",$l(Object.assign(Object.assign({},l),n)))})):[jc.create(r||"path",$l(l))]);this.defs.appendChild(t.node)}return c}remove(t){const e=this.svg.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}}var Zy=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},Xy=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Yy extends ly{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(t){this.grid.visible!==t&&(this.grid.visible=t,this.update())}getGridSize(){return this.grid.size}setGridSize(t){this.grid.size=Math.max(t,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(t){this.clear(),this.instance=null,Object.assign(this.grid,t),this.patterns=this.resolveGrid(t),this.update()}update(t={}){const e=this.grid.size;if(e<=1||!this.grid.visible)return this.clear();const n=this.graph.matrix(),i=this.getInstance(),s=Array.isArray(t)?t:[t];this.patterns.forEach(((t,o)=>{const r=`pattern_${o}`,a=n.a||1,l=n.d||1,{update:c,markup:h}=t,u=Xy(t,["update","markup"]),d=Object.assign(Object.assign(Object.assign({},u),s[o]),{sx:a,sy:l,ox:n.e||0,oy:n.f||0,width:e*a,height:e*l});i.has(r)||i.add(r,jc.create("pattern",{id:r,patternUnits:"userSpaceOnUse"},jc.createVectors(h)).node);const g=i.get(r);"function"===typeof c&&c(g.childNodes[0],d);let p=d.ox%d.width;p<0&&(p+=d.width);let f=d.oy%d.height;f<0&&(f+=d.height),Bl(g,{x:p,y:f,width:d.width,height:d.height})}));const o=(new XMLSerializer).serializeToString(i.root),r=`url(data:image/svg+xml;base64,${btoa(o)})`;this.elem.style.backgroundImage=r}getInstance(){return this.instance||(this.instance=new Dd),this.instance}resolveGrid(t){if(!t)return[];const e=t.type;if(null==e)return[Object.assign(Object.assign({},Dd.presets.dot),t.args)];const n=Dd.registry.get(e);if(n){let e=t.args||[];return Array.isArray(e)||(e=[e]),Array.isArray(n)?n.map(((t,n)=>Object.assign(Object.assign({},t),e[n]))):[Object.assign(Object.assign({},n),e[0])]}return Dd.registry.onNotFound(e)}dispose(){this.stopListening(),this.clear()}}Zy([ly.dispose()],Yy.prototype,"dispose",null);class Jy extends ly{getClientMatrix(){return lh(this.view.stage.getScreenCTM())}getClientOffset(){const t=this.view.svg.getBoundingClientRect();return new ac(t.left,t.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(t,e){const n="number"===typeof t?this.clientToLocalPoint(t,e):this.clientToLocalPoint(t.x,t.y);return n.snapToGrid(this.graph.getGridSize())}localToGraphPoint(t,e){const n=ac.create(t,e);return bh(n,this.graph.matrix())}localToClientPoint(t,e){const n=ac.create(t,e);return bh(n,this.getClientMatrix())}localToPagePoint(t,e){const n="number"===typeof t?this.localToGraphPoint(t,e):this.localToGraphPoint(t);return n.translate(this.getPageOffset())}localToGraphRect(t,e,n,i){const s=lc.create(t,e,n,i);return Ch(s,this.graph.matrix())}localToClientRect(t,e,n,i){const s=lc.create(t,e,n,i);return Ch(s,this.getClientMatrix())}localToPageRect(t,e,n,i){const s="number"===typeof t?this.localToGraphRect(t,e,n,i):this.localToGraphRect(t);return s.translate(this.getPageOffset())}graphToLocalPoint(t,e){const n=ac.create(t,e);return bh(n,this.graph.matrix().inverse())}clientToLocalPoint(t,e){const n=ac.create(t,e);return bh(n,this.getClientMatrix().inverse())}clientToGraphPoint(t,e){const n=ac.create(t,e);return bh(n,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(t,e){const n=ac.create(t,e),i=n.diff(this.getPageOffset());return this.graphToLocalPoint(i)}graphToLocalRect(t,e,n,i){const s=lc.create(t,e,n,i);return Ch(s,this.graph.matrix().inverse())}clientToLocalRect(t,e,n,i){const s=lc.create(t,e,n,i);return Ch(s,this.getClientMatrix().inverse())}clientToGraphRect(t,e,n,i){const s=lc.create(t,e,n,i);return Ch(s,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(t,e,n,i){const s=lc.create(t,e,n,i),o=this.getPageOffset();return s.x-=o.x,s.y-=o.y,this.graphToLocalRect(s)}}var Ky,Qy=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class tb extends ly{constructor(){super(...arguments),this.widget=this.graph.hook.createSnapline()}dispose(){this.widget.dispose()}}Qy([ly.dispose()],tb.prototype,"dispose",null),function(t){function e(t){const e=[],n=[];return Array.isArray(t)?e.push(...t):t.split("|").forEach((t=>{-1===t.indexOf("&")?e.push(t):n.push(...t.split("&"))})),{or:e,and:n}}function n(t,n){if(null!=t&&null!=n){const i=e(t),s=e(n),o=i.or.sort(),r=s.or.sort(),a=i.and.sort(),l=s.and.sort(),c=(t,e)=>t.length===e.length&&(0===t.length||t.every(((t,n)=>t===e[n])));return c(o,r)&&c(a,l)}return null==t&&null==n}function i(t,n,i){if(null==n||Array.isArray(n)&&0===n.length)return!i||!0!==t.altKey&&!0!==t.ctrlKey&&!0!==t.metaKey&&!0!==t.shiftKey;const{or:s,and:o}=e(n),r=e=>{const n=`${e.toLowerCase()}Key`;return!0===t[n]};return s.some((t=>r(t)))&&o.every((t=>r(t)))}t.parse=e,t.equals=n,t.isMatch=i}(Ky||(Ky={}));var eb=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class nb extends ly{get widgetOptions(){return this.options.scroller}get pannable(){return!!this.widgetOptions&&("object"===typeof this.widgetOptions.pannable?this.widgetOptions.pannable.enabled:!!this.widgetOptions.pannable)}init(){this.widget=this.graph.hook.createScroller(),this.startListening(),this.updateClassName(),this.widget&&this.widget.center()}startListening(){let t=[];const e=this.widgetOptions.pannable;t="object"===typeof e?e.eventTypes||[]:["leftMouseDown"],t.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),this.view.$(this.widget.container).on("mousedown",this.onRightMouseDown))}stopListening(){let t=[];const e=this.widgetOptions.pannable;t="object"===typeof e?e.eventTypes||[]:["leftMouseDown"],t.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&this.view.$(this.widget.container).off("mousedown",this.onRightMouseDown)}onRightMouseDown(t){2===t.button&&this.allowPanning(t,!0)&&this.widget&&(this.updateClassName(!0),this.widget.startPanning(t),this.widget.once("pan:stop",(()=>this.updateClassName(!1))))}preparePanning({e:t}){this.widget&&(this.allowPanning(t,!0)||this.allowPanning(t)&&!this.graph.selection.allowRubberband(t,!0))&&(this.updateClassName(!0),this.widget.startPanning(t),this.widget.once("pan:stop",(()=>this.updateClassName(!1))))}allowPanning(t,e){return this.widget&&this.pannable&&Ky.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowPanning(t)}updateClassName(t){if(null==this.widget)return;const e=this.widget.container,n=this.view.prefixClassName("graph-scroller-pannable");this.pannable?(rl(e,n),e.dataset.panning=(!!t).toString()):al(e,n)}enablePanning(){this.pannable||(this.widgetOptions.pannable=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.pannable=!1,this.updateClassName())}lock(){this.widget&&this.widget.lock()}unlock(){this.widget&&this.widget.unlock()}update(){this.widget&&this.widget.update()}enableAutoResize(){this.widget&&this.widget.enableAutoResize()}disableAutoResize(){this.widget&&this.widget.disableAutoResize()}resize(t,e){this.widget&&this.widget.resize(t,e)}dispose(){this.widget&&this.widget.dispose(),this.stopListening()}}eb([ly.dispose()],nb.prototype,"dispose",null);var ib=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},sb=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class ob extends ly{get commonOptions(){const t=this.instanceOptions,{enabled:e}=t,n=sb(t,["enabled"]);return n}get instanceOptions(){return this.options.clipboard}get cells(){return this.widget.cells}get disabled(){return!0!==this.instanceOptions.enabled}init(){this.widget=this.graph.hook.createClipboard(),this.widget.deserialize(this.instanceOptions)}enable(){this.disabled&&(this.instanceOptions.enabled=!0)}disable(){this.disabled||(this.instanceOptions.enabled=!1)}copy(t,e={}){this.disabled||this.widget.copy(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e))}cut(t,e={}){this.disabled||this.widget.cut(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e))}paste(t={},e=this.graph){return this.disabled?[]:this.widget.paste(e,Object.assign(Object.assign({},this.commonOptions),t))}clean(t){this.disabled&&!t||this.widget.clean()}isEmpty(){return this.widget.isEmpty()}dispose(){this.clean(!0)}}ib([ly.dispose()],ob.prototype,"dispose",null);var rb=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class ab extends ly{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:t,magnet:e,options:n={}}){const i=this.resolveHighlighter(n);if(!i)return;const s=this.getHighlighterId(e,i);if(!this.highlights[s]){const n=i.highlighter;n.highlight(t,e,Object.assign({},i.args)),this.highlights[s]={cellView:t,magnet:e,highlighter:n,args:i.args}}}onCellUnhighlight({magnet:t,options:e={}}){const n=this.resolveHighlighter(e);if(!n)return;const i=this.getHighlighterId(t,n);this.unhighlight(i)}resolveHighlighter(t){const e=this.options;let n=t.highlighter;if(null==n){const i=t.type;n=i&&e.highlighting[i]||e.highlighting.default}if(null==n)return null;const i="string"===typeof n?{name:n}:n,s=i.name,o=ig.registry.get(s);return null==o?ig.registry.onNotFound(s):(ig.check(s,o),{name:s,highlighter:o,args:i.args||{}})}getHighlighterId(t,e){return ul(t),e.name+t.id+JSON.stringify(e.args)}unhighlight(t){const e=this.highlights[t];e&&(e.highlighter.unhighlight(e.cellView,e.magnet,e.args),delete this.highlights[t])}dispose(){Object.keys(this.highlights).forEach((t=>this.unhighlight(t))),this.stopListening()}}rb([ab.dispose()],ab.prototype,"dispose",null);var lb=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class cb extends ly{constructor(){super(...arguments),this.widgets=new Map}get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get isSelectionEnabled(){return!0===this.options.selecting.enabled}init(){this.startListening(),this.resize()}startListening(){this.graph.on("node:mouseup",this.onNodeMouseUp,this),this.graph.on("node:selected",this.onNodeSelected,this),this.graph.on("node:unselected",this.onNodeUnSelected,this)}stopListening(){this.graph.off("node:mouseup",this.onNodeMouseUp,this),this.graph.off("node:selected",this.onNodeSelected,this),this.graph.off("node:unselected",this.onNodeUnSelected,this)}onNodeMouseUp({node:t}){if(!this.isSelectionEnabled){const e=this.graph.hook.createTransform(t,{clearAll:!0});e&&this.widgets.set(t,e)}}onNodeSelected({node:t}){if(this.isSelectionEnabled){const e=this.graph.hook.createTransform(t,{clearAll:!1});e&&this.widgets.set(t,e)}}onNodeUnSelected({node:t}){if(this.isSelectionEnabled){const e=this.widgets.get(t);e&&e.dispose(),this.widgets.delete(t)}}getMatrix(){const t=this.viewport.getAttribute("transform");return t!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=t),lh(this.viewportMatrix)}setMatrix(t){const e=lh(t),n=uh(e);this.viewport.setAttribute("transform",n),this.viewportMatrix=e,this.viewportTransformString=n}resize(t,e){let n=void 0===t?this.options.width:t,i=void 0===e?this.options.height:e;this.options.width=n,this.options.height=i,"number"===typeof n&&(n=Math.round(n)),"number"===typeof i&&(i=Math.round(i)),this.container.style.width=null==n?"":`${n}px`,this.container.style.height=null==i?"":`${i}px`;const s=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},s)),this}getComputedSize(){let t=this.options.width,e=this.options.height;return Fa(t)||(t=this.container.clientWidth),Fa(e)||(e=this.container.clientHeight),{width:t,height:e}}getScale(){return fh(this.getMatrix())}scale(t,e=t,n=0,i=0,s={}){if(t=this.clampScale(t),e=this.clampScale(e),n||i){const s=this.getTranslation(),o=s.tx-n*(t-1),r=s.ty-i*(e-1);o===s.tx&&r===s.ty||this.translate(o,r)}const o=this.getMatrix();return o.a=t,o.d=e,this.setMatrix(o),this.graph.trigger("scale",Object.assign({sx:t,sy:e,ox:n,oy:i},s)),this}clampScale(t){const e=this.graph.options.scaling;return Ia(t,e.min||.01,e.max||16)}getZoom(){return this.getScale().sx}zoom(t,e){e=e||{};let n=t,i=t;const s=this.getScale(),o=this.getComputedSize();let r=o.width/2,a=o.height/2;if(e.absolute||(n+=s.sx,i+=s.sy),e.scaleGrid&&(n=Math.round(n/e.scaleGrid)*e.scaleGrid,i=Math.round(i/e.scaleGrid)*e.scaleGrid),e.maxScale&&(n=Math.min(e.maxScale,n),i=Math.min(e.maxScale,i)),e.minScale&&(n=Math.max(e.minScale,n),i=Math.max(e.minScale,i)),e.center&&(r=e.center.x,a=e.center.y),n=this.clampScale(n),i=this.clampScale(i),r||a){const t=this.getTranslation(),o=r-(r-t.tx)*(n/s.sx),l=a-(a-t.ty)*(i/s.sy);o===t.tx&&l===t.ty||this.translate(o,l,{ui:e.ui})}return this.scale(n,i,0,0,{ui:e.ui}),this}getRotation(){return mh(this.getMatrix())}rotate(t,e,n){if(null==e||null==n){const t=kh(this.graph.view.stage);e=t.width/2,n=t.height/2}const i=this.getMatrix().translate(e,n).rotate(t).translate(-e,-n);return this.setMatrix(i),this}getTranslation(){return yh(this.getMatrix())}translate(t,e,n={}){const i=this.getMatrix();i.e=t||0,i.f=e||0,this.setMatrix(i);const s=this.getTranslation();return this.options.x=s.tx,this.options.y=s.ty,this.graph.trigger("translate",Object.assign(Object.assign({},s),n)),this}setOrigin(t,e){return this.translate(t||0,e||0)}fitToContent(t,e,n,i){if("object"===typeof t){const s=t;t=s.gridWidth||1,e=s.gridHeight||1,n=s.padding||0,i=s}else t=t||1,e=e||1,n=n||0,null==i&&(i={});const s=_a(n),o=i.border||0,r=i.contentArea?lc.create(i.contentArea):this.getContentArea(i);o>0&&r.inflate(o);const a=this.getScale(),l=this.getTranslation(),c=a.sx,h=a.sy;r.x*=c,r.y*=h,r.width*=c,r.height*=h;let u=Math.max(Math.ceil((r.width+r.x)/t),1)*t,d=Math.max(Math.ceil((r.height+r.y)/e),1)*e,g=0,p=0;("negative"===i.allowNewOrigin&&r.x<0||"positive"===i.allowNewOrigin&&r.x>=0||"any"===i.allowNewOrigin)&&(g=Math.ceil(-r.x/t)*t,g+=s.left,u+=g),("negative"===i.allowNewOrigin&&r.y<0||"positive"===i.allowNewOrigin&&r.y>=0||"any"===i.allowNewOrigin)&&(p=Math.ceil(-r.y/e)*e,p+=s.top,d+=p),u+=s.right,d+=s.bottom,u=Math.max(u,i.minWidth||0),d=Math.max(d,i.minHeight||0),u=Math.min(u,i.maxWidth||Number.MAX_SAFE_INTEGER),d=Math.min(d,i.maxHeight||Number.MAX_SAFE_INTEGER);const f=this.getComputedSize(),m=u!==f.width||d!==f.height,y=g!==l.tx||p!==l.ty;return y&&this.translate(g,p),m&&this.resize(u,d),new lc(-g/c,-p/h,u/c,d/h)}scaleContentToFit(t={}){this.scaleContentToFitImpl(t)}scaleContentToFitImpl(t={},e=!0){let n,i;if(t.contentArea){const e=t.contentArea;n=this.graph.localToGraph(e),i=ac.create(e)}else n=this.getContentBBox(t),i=this.graph.graphToLocal(n);if(!n.width||!n.height)return;const s=_a(t.padding),o=t.minScale||0,r=t.maxScale||Number.MAX_SAFE_INTEGER,a=t.minScaleX||o,l=t.maxScaleX||r,c=t.minScaleY||o,h=t.maxScaleY||r;let u;if(t.viewportArea)u=t.viewportArea;else{const t=this.getComputedSize(),e=this.getTranslation();u={x:e.tx,y:e.ty,width:t.width,height:t.height}}u=lc.create(u).moveAndExpand({x:s.left,y:s.top,width:-s.left-s.right,height:-s.top-s.bottom});const d=this.getScale();let g=u.width/n.width*d.sx,p=u.height/n.height*d.sy;!1!==t.preserveAspectRatio&&(g=p=Math.min(g,p));const f=t.scaleGrid;if(f&&(g=f*Math.floor(g/f),p=f*Math.floor(p/f)),g=Ia(g,a,l),p=Ia(p,c,h),this.scale(g,p),e){const t=this.options,e=u.x-i.x*g-t.x,n=u.y-i.y*p-t.y;this.translate(e,n)}}getContentArea(t={}){return t.useCellGeometry?this.model.getAllCellsBBox()||new lc:kh(this.graph.view.stage)}getContentBBox(t={}){return this.graph.localToGraph(this.getContentArea(t))}getGraphArea(){const t=lc.fromSize(this.getComputedSize());return this.graph.graphToLocal(t)}zoomToRect(t,e={}){const n=lc.create(t),i=this.graph;e.contentArea=n,null==e.viewportArea&&(e.viewportArea={x:i.options.x,y:i.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(e,!1);const s=n.getCenter();return this.centerPoint(s.x,s.y),this}zoomToFit(t={}){return this.zoomToRect(this.getContentArea(t),t)}centerPoint(t,e){const n=this.getComputedSize(),i=this.getScale(),s=this.getTranslation(),o=n.width/2,r=n.height/2;t="number"===typeof t?t:o,e="number"===typeof e?e:r,t=o-t*i.sx,e=r-e*i.sy,s.tx===t&&s.ty===e||this.translate(t,e)}centerContent(t){const e=this.graph.getContentArea(t),n=e.getCenter();this.centerPoint(n.x,n.y)}centerCell(t){return this.positionCell(t,"center")}positionPoint(t,e,n){const i=this.getComputedSize();e=$a(e,Math.max(0,i.width)),e<0&&(e=i.width+e),n=$a(n,Math.max(0,i.height)),n<0&&(n=i.height+n);const s=this.getTranslation(),o=this.getScale(),r=e-t.x*o.sx,a=n-t.y*o.sy;s.tx===r&&s.ty===a||this.translate(r,a)}positionRect(t,e){const n=lc.create(t);switch(e){case"center":return this.positionPoint(n.getCenter(),"50%","50%");case"top":return this.positionPoint(n.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(n.getTopRight(),"100%",0);case"right":return this.positionPoint(n.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(n.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(n.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(n.getBottomLeft(),0,"100%");case"left":return this.positionPoint(n.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(n.getTopLeft(),0,0);default:return this}}positionCell(t,e){const n=t.getBBox();return this.positionRect(n,e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t)}dispose(){this.widgets.forEach((t=>t.dispose())),this.widgets.clear(),this.stopListening()}}lb([cb.dispose()],cb.prototype,"dispose",null);var hb=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class ub extends ly{constructor(){super(...arguments),this.movedMap=new WeakMap,this.unselectMap=new WeakMap}get widgetOptions(){return this.options.selecting}get rubberbandDisabled(){return!0!==this.widgetOptions.enabled||!0!==this.widgetOptions.rubberband}get disabled(){return!0!==this.widgetOptions.enabled}get length(){return this.widget.length}get cells(){return this.widget.cells}init(){this.widget=this.graph.hook.createSelection(),this.startListening()}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.widget.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.widget.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:t}){(this.allowRubberband(t,!0)||this.allowRubberband(t)&&!this.graph.scroller.allowPanning(t,!0)&&!this.graph.panning.allowPanning(t,!0))&&this.startRubberband(t)}onBlankClick(){this.clean()}allowRubberband(t,e){return!this.rubberbandDisabled&&Ky.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowRubberband(t)}onCellMouseMove({cell:t}){this.movedMap.set(t,!0)}onCellMouseUp({e:t,cell:e}){const n=this.widgetOptions;let i=this.disabled;!i&&this.movedMap.has(e)&&(i=!1===n.selectCellOnMoved,i||(i=!1===n.selectNodeOnMoved&&e.isNode()),i||(i=!1===n.selectEdgeOnMoved&&e.isEdge())),i||(!1===n.multiple||!t.ctrlKey&&!t.metaKey?this.reset(e):this.unselectMap.has(e)?this.unselectMap.delete(e):this.isSelected(e)?this.unselect(e):this.select(e)),this.movedMap.delete(e)}onBoxMouseDown({e:t,cell:e}){this.disabled||!1!==this.widgetOptions.multiple&&(t.ctrlKey||t.metaKey)&&(this.unselect(e),this.unselectMap.set(e,!0))}isEmpty(){return this.length<=0}isSelected(t){return this.widget.isSelected(t)}getCells(t){return(Array.isArray(t)?t:[t]).map((t=>"string"===typeof t?this.graph.getCellById(t):t)).filter((t=>null!=t))}select(t,e={}){const n=this.getCells(t);return n.length&&(this.isMultiple()?this.widget.select(n,e):this.reset(n.slice(0,1),e)),this}unselect(t,e={}){return this.widget.unselect(this.getCells(t),e),this}reset(t,e={}){return this.widget.reset(t?this.getCells(t):[],e),this}clean(t={}){return this.widget.clean(t),this}enable(){return this.disabled&&(this.widgetOptions.enabled=!0),this}disable(){return this.disabled||(this.widgetOptions.enabled=!1),this}startRubberband(t){return this.rubberbandDisabled||this.widget.startSelecting(t),this}enableRubberband(){return this.rubberbandDisabled&&(this.widgetOptions.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.widgetOptions.rubberband=!1),this}isMultiple(){return!1!==this.widgetOptions.multiple}enableMultiple(){return this.widgetOptions.multiple=!0,this}disableMultiple(){return this.widgetOptions.multiple=!1,this}setModifiers(t){return this.widgetOptions.modifiers=t,this}setContent(t){return this.widget.setContent(t),this}setFilter(t){return this.widget.setFilter(t),this}dispose(){this.stopListening(),this.widget.dispose()}}hb([ly.dispose()],ub.prototype,"dispose",null);var db,gb=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},pb=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class fb extends Vg{constructor(t){super(),this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.handlers=[],this.graph=t.graph,this.model=t.graph.model,this.options=db.getOptions(t),this.validator=new fb.Validator({history:this,cancelInvalid:this.options.cancelInvalid}),this.clean(),this.startListening()}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}undo(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack.push(e),this.notify("undo",e,t))}return this}redo(t={}){if(!this.disabled){const e=this.redoStack.pop();e&&(this.applyCommand(e,t),this.undoStack.push(e),this.notify("redo",e,t))}return this}cancel(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack=[],this.notify("cancel",e,t))}return this}clean(t={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,t),this}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}validate(t,...e){return this.validator.validate(t,...e),this}dispose(){this.validator.dispose(),this.clean(),this.stopListening()}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach(((t,e)=>{this.handlers[e]=this.addCommand.bind(this,t),this.model.on(t,this.handlers[e])})),this.validator.on("invalid",(t=>this.trigger("invalid",t)))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach(((t,e)=>{this.model.off(t,this.handlers[e])})),this.handlers.length=0),this.validator.off("invalid")}createCommand(t){return{batch:!!t&&t.batch,data:{}}}revertCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?db.sortBatchCommands(t):[t];for(let i=n.length-1;i>=0;i-=1){const t=n[i],s=Object.assign(Object.assign({},e),yn.Z(t.options,this.options.revertOptionsList||[]));this.executeCommand(t,!0,s)}this.freezed=!1}applyCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?db.sortBatchCommands(t):[t];for(let i=0;i<n.length;i+=1){const t=n[i],s=Object.assign(Object.assign({},e),yn.Z(t.options,this.options.applyOptionsList||[]));this.executeCommand(t,!1,s)}this.freezed=!1}executeCommand(t,e,n){const i=this.model,s=i.getCell(t.data.id),o=t.event;if(db.isAddEvent(o)&&e||db.isRemoveEvent(o)&&!e)s.remove(n);else if(db.isAddEvent(o)&&!e||db.isRemoveEvent(o)&&e){const e=t.data;e.node?i.addNode(e.props,n):e.edge&&i.addEdge(e.props,n)}else if(db.isChangeEvent(o)){const i=t.data,o=i.key;if(o){const t=e?i.prev[o]:i.next[o];s.prop(o,t,n)}}else{const i=this.options.executeCommand;i&&Ya(i,this,t,e,n)}}addCommand(t,e){if(this.freezed||this.disabled)return;const n=e,i=n.options||{};if(i.dryrun)return;if(db.isAddEvent(t)&&this.options.ignoreAdd||db.isRemoveEvent(t)&&this.options.ignoreRemove||db.isChangeEvent(t)&&this.options.ignoreChange)return;const s=this.options.beforeAddCommand;if(null!=s&&!1===Ya(s,this,t,e))return;"cell:change:*"===t&&(t=`cell:change:${n.key}`);const o=n.cell,r=qm.isModel(o);let a;if(this.batchCommands){a=this.batchCommands[Math.max(this.lastBatchIndex,0)];const e=r&&!a.modelChange||a.data.id!==o.id,n=a.event!==t;if(this.lastBatchIndex>=0&&(e||n)){const e=this.batchCommands.findIndex((e=>(r&&e.modelChange||e.data.id===o.id)&&e.event===t));e<0||db.isAddEvent(t)||db.isRemoveEvent(t)?a=this.createCommand({batch:!0}):(a=this.batchCommands[e],this.batchCommands.splice(e,1)),this.batchCommands.push(a),this.lastBatchIndex=this.batchCommands.length-1}}else a=this.createCommand({batch:!1});if(db.isAddEvent(t)||db.isRemoveEvent(t)){const e=a.data;return a.event=t,a.options=i,e.id=o.id,e.props=pi(o.toJSON()),o.isEdge()?e.edge=!0:o.isNode()&&(e.node=!0),this.push(a,i)}if(db.isChangeEvent(t)){const n=e.key,s=a.data;return a.batch&&a.event||(a.event=t,a.options=i,s.key=n,null==s.prev&&(s.prev={}),s.prev[n]=ci.Z(o.previous(n)),r?a.modelChange=!0:s.id=o.id),null==s.next&&(s.next={}),s.next[n]=ci.Z(o.prop(n)),this.push(a,i)}const l=this.options.afterAddCommand;l&&Ya(l,this,t,e,a),this.push(a,i)}initBatchCommand(t){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(t){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const e=this.filterBatchCommand(this.batchCommands);e.length>0&&(this.redoStack=[],this.undoStack.push(e),this.notify("add",e,t)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(t){let e=t.slice();const n=[];while(e.length>0){const t=e.shift(),i=t.event,s=t.data.id;if(null!=i&&(null!=s||t.modelChange)){if(db.isAddEvent(i)){const t=e.findIndex((t=>db.isRemoveEvent(t.event)&&t.data.id===s));if(t>=0){e=e.filter(((e,n)=>t<n||e.data.id!==s));continue}}else if(db.isRemoveEvent(i)){const t=e.findIndex((t=>db.isAddEvent(t.event)&&t.data.id===s));if(t>=0){e.splice(t,1);continue}}else if(db.isChangeEvent(i)){const e=t.data;if(Qn.Z(e.prev,e.next))continue}n.push(t)}}return n}notify(t,e,n){const i=null==e?null:Array.isArray(e)?e:[e];this.emit(t,{cmds:i,options:n}),this.emit("change",{cmds:i,options:n})}push(t,e){this.redoStack=[],t.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:t,options:e})):(this.undoStack.push(t),this.notify("add",t,e))}}gb([Vg.dispose()],fb.prototype,"dispose",null),function(t){class e extends Vg{constructor(t){super(),this.map={},this.command=t.history,this.cancelInvalid=!1!==t.cancelInvalid,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:t}){return Array.isArray(t)?t.every((t=>this.isValidCommand(t))):this.isValidCommand(t)}isValidCommand(t){if(t.options&&!1===t.options.validation)return!0;const e=t.event&&this.map[t.event]||[];let n=null;return e.forEach((e=>{let i=0;const s=o=>{const r=e[i];i+=1;try{if(!r)return void(n=o);r(o,t,s)}catch(o){s(o)}};s(n)})),!n||(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:n}),!1)}validate(t,...e){const n=Array.isArray(t)?t:t.split(/\s+/);return e.forEach((t=>{if("function"!==typeof t)throw new Error(`${n.join(" ")} requires callback functions.`)})),n.forEach((t=>{null==this.map[t]&&(this.map[t]=[]),this.map[t].push(e)})),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}gb([Vg.dispose()],e.prototype,"dispose",null),t.Validator=e}(fb||(fb={})),function(t){function e(t){return"cell:added"===t}function n(t){return"cell:removed"===t}function i(t){return null!=t&&t.startsWith("cell:change:")}function s(e){const{graph:n}=e,i=pb(e,["graph"]),s=["cell:added","cell:removed","cell:change:*"],o=["batch:start","batch:stop"],r=e.eventNames?e.eventNames.filter((e=>!(t.isChangeEvent(e)||s.includes(e)||o.includes(e)))):s;return Object.assign(Object.assign({},i),{eventNames:r,applyOptionsList:e.applyOptionsList||["propertyPath"],revertOptionsList:e.revertOptionsList||["propertyPath"]})}function o(e){const n=[];for(let i=0,s=e.length;i<s;i+=1){const s=e[i];let o=null;if(t.isAddEvent(s.event)){const t=s.data.id;for(let n=0;n<i;n+=1)if(e[n].data.id===t){o=n;break}}null!==o?n.splice(o,0,s):n.push(s)}return n}t.isAddEvent=e,t.isRemoveEvent=n,t.isChangeEvent=i,t.getOptions=s,t.sortBatchCommands=o}(db||(db={}));var mb=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class yb extends ly{get widgetOptions(){return this.options.minimap}init(){this.widget=this.graph.hook.createMiniMap()}dispose(){this.widget&&this.widget.dispose()}}mb([ly.dispose()],yb.prototype,"dispose",null);var bb=n(42441),wb=n.n(bb),Cb=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class vb extends Rg{constructor(t){super(),this.options=t;const e=this.graph.scroller.widget;this.container=e?e.container:this.graph.container,t.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus,this),this.graph.on("blank:mouseup",this.focus,this)),this.mousetrap=vb.createMousetrap(this)}get graph(){return this.options.graph}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.graph.options.keyboard.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.graph.options.keyboard.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)}off(t,e){this.mousetrap.unbind(this.getKeys(t),e)}focus(t){const e=this.isInputEvent(t.e);if(e)return;const n=this.target;n.focus({preventScroll:!0})}getKeys(t){return(Array.isArray(t)?t:[t]).map((t=>this.formatkey(t)))}formatkey(t){const e=t.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command"),n=this.options.format;return n?Ya(n,this.graph,e):e}isGraphEvent(t){const e=t.srcElement||t.target;return!!e&&(e===this.target||e===document.body||Ml(this.container,e))}isInputEvent(t){const e=t.target,n=e&&e.tagName.toLowerCase();return"input"===n}isEnabledForEvent(t){const e=!this.disabled&&this.isGraphEvent(t),n=this.isInputEvent(t);if(e){const e=t.keyCode||t.which;if(n&&(8===e||46===e))return!1;if(this.options.guard)return Ya(this.options.guard,this.graph,t)}return e}dispose(){this.mousetrap.reset()}}Cb([Rg.dispose()],vb.prototype,"dispose",null),function(t){function e(t){const e=new(wb())(t.target),n=e.stopCallback;return e.stopCallback=(i,s,o)=>!t.isEnabledForEvent(i)||!!n&&n.call(e,i,s,o),e}t.createMousetrap=e}(vb||(vb={}));var xb=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class kb extends Rg{constructor(t){super(),this.options=t,this.cumulatedFactor=1;const e=this.graph.scroller.widget;this.container=e?e.container:this.graph.container,this.target=this.options.global?document:this.container,this.mousewheelHandle=new Bh(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.options.enabled&&this.enable(!0)}get graph(){return this.options.graph}get disabled(){return!0!==this.options.enabled}enable(t){(this.disabled||t)&&(this.options.enabled=!0,this.graph.options.mousewheel.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.options.enabled=!1,this.graph.options.mousewheel.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(t){const e=t.originalEvent||t,n=this.options.guard;return(null==n||n.call(this.graph,e))&&Ky.isMatch(e,this.options.modifiers)}onMouseWheel(t){const e=t.originalEvent||t,n=this.options.guard;if((null==n||n.call(this.graph,e))&&Ky.isMatch(e,this.options.modifiers)){const e=this.options.factor||1.2;null==this.currentScale&&(this.startPos={x:t.clientX,y:t.clientY},this.currentScale=this.graph.scroller.widget?this.graph.scroller.widget.zoom():this.graph.transform.getScale().sx);const n=t.deltaY;n<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*e*20)/20/this.currentScale:this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*(1/e)*20)/20/this.currentScale,this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const i=this.graph.scroller.widget,s=this.currentScale;let o=this.graph.transform.clampScale(s*this.cumulatedFactor);const r=this.options.minScale||Number.MIN_SAFE_INTEGER,a=this.options.maxScale||Number.MAX_SAFE_INTEGER;if(o=Ia(o,r,a),o!==s)if(i)if(this.options.zoomAtMousePosition){const t=this.graph.coord.clientToLocalPoint(this.startPos);i.zoom(o,{absolute:!0,center:t.clone()})}else i.zoom(o,{absolute:!0});else if(this.options.zoomAtMousePosition){const t=this.graph.coord.clientToGraphPoint(this.startPos);this.graph.transform.zoom(o,{absolute:!0,center:t.clone(),ui:!0})}else this.graph.transform.zoom(o,{absolute:!0,ui:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}xb([Rg.dispose()],kb.prototype,"dispose",null);var Eb=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class Mb extends ly{show(t={}){const e=Object.assign(Object.assign({},Mb.defaultOptions),t),n=this.createPrintPages(e);e.ready(n,(t=>this.showPrintWindow(t,e)),{sheetSize:this.getSheetSize(e)})}get className(){return this.view.prefixClassName("graph-print")}showPrintWindow(t,e){if(t){const n=lt()(document.body),i=lt()(this.view.container),s=this.view.prefixClassName("graph-printing");n.addClass(s);const o=i.children().detach();t.forEach((t=>{t.removeClass(`${this.className}-preview`).addClass(`${this.className}-ready`).appendTo(n)}));let r=!1;const a=()=>{r||(r=!0,n.removeClass(s),t.forEach((t=>t.remove())),i.append(o),lt()(`#${this.styleSheetId}`).remove(),this.graph.trigger("after:print",e),lt()(window).off("afterprint",a))};lt()(window).one("afterprint",a),setTimeout(a,200),window.print()}}createPrintPage(t,e){this.graph.trigger("before:print",e);const n=lt()("<div/>").addClass(this.className),i=lt()("<div/>").addClass(this.view.prefixClassName("graph-print-inner")).css("position","relative");e.size&&n.addClass(`${this.className}-size-${e.size}`);const s=jc.create(this.view.svg).clone(),o=s.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`);i.append(s.node);const r=this.getSheetSize(e),a=this.graph.transform.getGraphArea(),l=this.graph.transform.getScale(),c=this.graph.translate(),h=lh().translate(c.tx/l.sx,c.ty/l.sy),u=this.getPageInfo(a,t,r),d=u.scale,g=u.bbox;return i.css({left:0,top:0}),s.attr({width:g.width*d,height:g.height*d,style:"position:relative",viewBox:[g.x,g.y,g.width,g.height].join(" ")}),o.attr("transform",uh(h)),n.append(i),n.addClass(`${this.className}-preview`),{$page:n,sheetSize:r}}createPrintPages(t){let e;const n=this.getPrintArea(t),i=[];if(t.page){const s=this.getPageSize(n,t.page),o=this.getPageAreas(n,s);o.forEach((n=>{e=this.createPrintPage(n,t),i.push(e.$page)}))}else e=this.createPrintPage(n,t),i.push(e.$page);if(e){const n={width:e.sheetSize.cssWidth,height:e.sheetSize.cssHeight};this.updatePrintStyle(n,t)}return i}get styleSheetId(){return this.view.prefixClassName("graph-print-style")}updatePrintStyle(t,e){const n=Object.keys(t).reduce(((e,n)=>`${e} ${n}:${t[n]};`),""),i=_a(e.margin),s=e.marginUnit||"",o=e.sheetUnit||"",r=`\n @media print {\n .${this.className}.${this.className}-ready {\n ${n}\n }\n\n @page {\n margin:\n ${[i.top+s,i.right+s,i.bottom+s,i.left+s].join(" ")};\n size: ${e.sheet.width+o} ${e.sheet.height+o};\n\n .${this.className}.${this.className}-preview {\n ${n}\n }\n }`,a=this.styleSheetId,l=lt()(`#${a}`);l.length?l.html(r):lt()("head").append(`'<style type="text/css" id="${a}">${r}</style>'`)}getPrintArea(t){let e=t.area;if(!e){const n=_a(t.padding);e=this.graph.getContentArea().moveAndExpand({x:-n.left,y:-n.top,width:n.left+n.right,height:n.top+n.bottom})}return e}getPageSize(t,e){if("object"===typeof e){const n=e,i={width:n.width,height:n.height};return null==i.width&&(i.width=Math.ceil(t.width/(n.columns||1))),null==i.height&&(i.height=Math.ceil(t.height/(n.rows||1))),i}return{width:t.width,height:t.height}}getPageAreas(t,e){const n=[],i=e.width,s=e.height;for(let o=0,r=0;o<t.height&&r<200;o+=s,r+=1)for(let e=0,a=0;e<t.width&&a<200;e+=i,a+=1)n.push(new lc(t.x+e,t.y+o,i,s));return n}getSheetSize(t){const e=t.sheet,n=_a(t.margin),i=t.marginUnit||"",s=t.sheetUnit||"",o=`calc(${e.width}${s} - ${n.left+n.right}${i})`,r=`calc(${e.height}${s} - ${n.top+n.bottom}${i})`,a=Xl.measure(o,r);return{cssWidth:o,cssHeight:r,width:a.width,height:a.height}}getPageInfo(t,e,n){const i=new lc(e.x-t.x,e.y-t.y,e.width,e.height),s=i.width/i.height,o=n.width/n.height;return{bbox:i,scale:o<s?n.width/i.width:n.height/i.height,fitHorizontal:o<s}}dispose(){}}Eb([ly.dispose()],Mb.prototype,"dispose",null),function(t){t.defaultOptions={page:!1,sheet:{width:210,height:297},sheetUnit:"mm",margin:.4,marginUnit:"in",padding:5,ready:(t,e)=>e(t)}}(Mb||(Mb={}));class Sb extends ly{toSVG(t,e={}){this.graph.trigger("before:export",e);const n=this.view.svg,i=jc.create(n).clone();let s=i.node;const o=i.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),r=e.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),a=e.preserveDimensions;if(a){const t="boolean"===typeof a?r:a;i.attr({width:t.width,height:t.height})}if(i.removeAttribute("style").attr("viewBox",[r.x,r.y,r.width,r.height].join(" ")),o.removeAttribute("transform"),!1!==e.copyStyles){const t=n.ownerDocument,e=Array.from(n.querySelectorAll("*")),i=Array.from(s.querySelectorAll("*")),o=t.styleSheets.length,r=[];for(let n=o-1;n>=0;n-=1)r[n]=t.styleSheets[n],t.styleSheets[n].disabled=!0;const a={};e.forEach(((t,e)=>{const n=window.getComputedStyle(t,null),i={};Object.keys(n).forEach((t=>{i[t]=n.getPropertyValue(t)})),a[e]=i})),o!==t.styleSheets.length&&r.forEach(((e,n)=>{t.styleSheets[n]=e}));for(let n=0;n<o;n+=1)t.styleSheets[n].disabled=!1;const l={};e.forEach(((t,e)=>{const n=window.getComputedStyle(t,null),i=a[e],s={};Object.keys(n).forEach((t=>{Ba(t)||n.getPropertyValue(t)===i[t]||(s[t]=n.getPropertyValue(t))})),l[e]=s})),i.forEach(((t,e)=>{lt()(t).css(l[e])}))}const l=e.stylesheet;if("string"===typeof l){const t=n.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(l);i.prepend(jc.create("style",{type:"text/css"},[t]))}const c=()=>{const n=e.beforeSerialize;if("function"===typeof n){const t=Ya(n,this.graph,s);t instanceof SVGSVGElement&&(s=t)}const i=(new XMLSerializer).serializeToString(s).replace(/ /g," ");this.graph.trigger("after:export",e),t(i)};if(e.serializeImages){const t=i.find("image").map((t=>new Promise((e=>{const n=t.attr("xlink:href")||t.attr("href");Wl.imageToDataUri(n,((n,i)=>{!n&&i&&t.attr("xlink:href",i),e()}))}))));Promise.all(t).then(c)}else c()}toDataURL(t,e){let n=e.viewBox||this.graph.getContentBBox();const i=_a(e.padding);e.width&&e.height&&(i.left+i.right>=e.width&&(i.left=i.right=0),i.top+i.bottom>=e.height&&(i.top=i.bottom=0));const s=new lc(-i.left,-i.top,i.left+i.right,i.top+i.bottom);if(e.width&&e.height){const t=n.width+i.left+i.right,o=n.height+i.top+i.bottom;s.scale(t/e.width,o/e.height)}n=lc.create(n).moveAndExpand(s);const o="number"===typeof e.width&&"number"===typeof e.height?{width:e.width,height:e.height}:n;let r=e.ratio?parseFloat(e.ratio):1;Number.isFinite(r)&&0!==r||(r=1);const a={width:Math.max(Math.round(o.width*r),1),height:Math.max(Math.round(o.height*r),1)};{const t=document.createElement("canvas"),e=t.getContext("2d");t.width=a.width,t.height=a.height;const n=a.width-1,i=a.height-1;e.fillStyle="rgb(1,1,1)",e.fillRect(n,i,1,1);const s=e.getImageData(n,i,1,1).data;if(1!==s[0]||1!==s[1]||1!==s[2])throw new Error("size exceeded")}const l=new Image;l.onload=()=>{const n=document.createElement("canvas");n.width=a.width,n.height=a.height;const i=n.getContext("2d");i.fillStyle=e.backgroundColor||"white",i.fillRect(0,0,a.width,a.height);try{i.drawImage(l,0,0,a.width,a.height);const s=n.toDataURL(e.type,e.quality);t(s)}catch(s){}},this.toSVG((t=>{l.src=`data:image/svg+xml,${encodeURIComponent(t)}`}),Object.assign(Object.assign({},e),{viewBox:n,serializeImages:!0,preserveDimensions:Object.assign({},a)}))}toPNG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/png"}))}toJPEG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/jpeg"}))}}class Ab extends ly{constructor(){super(...arguments),this.widgets=new Map}get isSelectionEnabled(){return!0===this.options.selecting.enabled}init(){this.startListening()}startListening(){this.graph.on("node:mouseup",this.onNodeMouseUp,this),this.graph.on("node:selected",this.onNodeSelected,this),this.graph.on("node:unselected",this.onNodeUnSelected,this)}stopListening(){this.graph.off("node:mouseup",this.onNodeMouseUp,this),this.graph.off("node:selected",this.onNodeSelected,this),this.graph.off("node:unselected",this.onNodeUnSelected,this)}onNodeMouseUp({node:t}){if(!this.isSelectionEnabled){const e=this.graph.hook.createKnob(t,{clearAll:!0});e&&this.widgets.set(t,e)}}onNodeSelected({node:t}){if(this.isSelectionEnabled){const e=this.graph.hook.createKnob(t,{clearAll:!1});e&&this.widgets.set(t,e)}}onNodeUnSelected({node:t}){if(this.isSelectionEnabled){const e=this.widgets.get(t);e&&e.forEach((t=>t.dispose())),this.widgets.delete(t)}}}var Db=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class Pb extends ly{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&!0===this.widgetOptions.enabled}init(){this.startListening(),this.updateClassName()}startListening(){const t=this.widgetOptions.eventTypes;t&&(t.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),this.view.$(this.graph.container).on("mousedown",this.onRightMouseDown)),t.includes("mouseWheel")&&(this.mousewheelHandle=new Bh(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()))}stopListening(){const t=this.widgetOptions.eventTypes;t&&(t.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&this.view.$(this.graph.container).off("mousedown",this.onRightMouseDown),t.includes("mouseWheel")&&this.mousewheelHandle&&this.mousewheelHandle.disable())}preparePanning({e:t}){(this.allowPanning(t,!0)||this.allowPanning(t)&&!this.graph.selection.allowRubberband(t,!0))&&this.startPanning(t)}allowPanning(t,e){return this.pannable&&Ky.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowPanning(t)}startPanning(t){const e=this.view.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.panning=!0,this.updateClassName(),this.view.$(document.body).on({"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),this.view.$(window).on("mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.view.normalizeEvent(t),n=e.clientX-this.clientX,i=e.clientY-this.clientY;this.clientX=e.clientX,this.clientY=e.clientY;const s=this.graph.transform.getTranslation(),o=s.tx+n,r=s.ty+i;this.graph.transform.translate(o,r,{ui:!0})}stopPanning(t){this.panning=!1,this.updateClassName(),this.view.$(document.body).off(".panning"),this.view.$(window).off(".panning")}updateClassName(){const t=this.view.container,e=this.view.prefixClassName("graph-panning"),n=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(rl(t,e),al(t,n)):(al(t,e),rl(t,n)):(al(t,e),al(t,n))}onRightMouseDown(t){2===t.button&&this.allowPanning(t,!0)&&this.startPanning(t)}allowMouseWheel(t){return this.pannable&&!t.ctrlKey}onMouseWheel(t,e,n){t.ctrlKey||this.graph.translateBy(-e,-n)}autoPanning(t,e){const n=10,i=this.graph.getGraphArea();let s=0,o=0;t<=i.left+n&&(s=-n),e<=i.top+n&&(o=-n),t>=i.right-n&&(s=n),e>=i.bottom-n&&(o=n),0===s&&0===o||this.graph.translateBy(-s,-o)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}Db([ly.dispose()],Pb.prototype,"dispose",null);var Ob=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class Tb extends ly{hasScroller(){return null!=this.graph.scroller.widget}getContainer(){return this.hasScroller()?this.graph.scroller.widget.container:this.graph.container}init(){const t=this.options.autoResize;if(t){const e="boolean"===typeof t?this.getContainer():t;Gh.bind(e,(()=>{const t=this.getContainer(),e=t.offsetWidth,n=t.offsetHeight;this.resize(e,n)}))}}resize(t,e){this.hasScroller()?this.resizeScroller(t,e):this.resizeGraph(t,e)}resizeGraph(t,e){this.graph.transform.resize(t,e)}resizeScroller(t,e){this.graph.scroller.resize(t,e)}resizePage(t,e){const n=this.graph.scroller.widget;n&&n.updatePageSize(t,e)}dispose(){Gh.clear(this.getContainer())}}Ob([ly.dispose()],Tb.prototype,"dispose",null);var Nb,jb=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},Fb=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};(function(t){function e(t,e){return(n,i,s)=>{const o=s.value,r=e||i;s.value=function(...e){const n=this.options[r];if(null!=n){this.getNativeValue=o.bind(this,...e);const i=Ya(n,this.graph,...e);if(this.getNativeValue=null,null!=i||!0===t&&null===i)return i}return o.call(this,...e)}}}function n(t){return(e,n,i)=>{const s=i.value,o=t||n;i.value=function(...t){let e=s.call(this,...t);const n=this.options[o];return null!=n&&(e=Ya(n,this.graph,...t)&&e),e}}}t.hook=e,t.after=n})(Nb||(Nb={}));class Lb extends ly{createModel(){if(this.options.model)return this.options.model;const t=new qm;return t.graph=this.graph,t}createView(){return new uy(this.graph)}createRenderer(){return new Ty(this.graph)}createDefsManager(){return new qy(this.graph)}createGridManager(){return new Yy(this.graph)}createCoordManager(){return new Jy(this.graph)}createKnobManager(){return new Ab(this.graph)}createTransform(t,e){const n=this.getTransformOptions(t);return n.resizable||n.rotatable?new Gy(Object.assign(Object.assign({node:t,graph:this.graph},n),e)):(n.clearAll&&Gy.removeInstances(this.graph),null)}createKnob(t,e){const n=Hy.parseOptionGroup(this.graph,t,this.options.knob),i=Object.assign(Object.assign({},n),e);i.clearAll&&xy.removeInstances(this.graph),i.clearAll=!1;const s=t.prop("knob"),o=[],r=Array.isArray(s)?s:[s];return r.forEach(((e,s)=>{e&&!1!==e.enabled&&("function"===typeof e.enabled&&!1===e.enabled.call(this.graph,t)||n.enabled&&o.push(new xy(Object.assign({node:t,index:s,graph:this.graph},i))))})),o}getTransformOptions(t){const e=Hy.parseOptionGroup(this.graph,t,this.options.resizing),n=Hy.parseOptionGroup(this.graph,t,this.options.rotating),i=Hy.parseOptionGroup(this.graph,t,this.options.transforming),s=Object.assign(Object.assign({},i),{resizable:e.enabled,minWidth:e.minWidth,maxWidth:e.maxWidth,minHeight:e.minHeight,maxHeight:e.maxHeight,orthogonalResizing:e.orthogonal,restrictedResizing:null!=e.restrict?e.restrict:e.restricted,autoScrollOnResizing:e.autoScroll,preserveAspectRatio:e.preserveAspectRatio,allowReverse:e.allowReverse,rotatable:n.enabled,rotateGrid:n.grid});return s}createTransformManager(){return new cb(this.graph)}createHighlightManager(){return new ab(this.graph)}createBackgroundManager(){return new jy(this.graph)}createClipboard(){return new $b}createClipboardManager(){return new ob(this.graph)}createSnapline(){return new Py(Object.assign({graph:this.graph},this.options.snapline))}createSnaplineManager(){return new tb(this.graph)}createSelection(){return new _y(Object.assign({graph:this.graph},this.options.selecting))}createSelectionManager(){return new ub(this.graph)}allowRubberband(t){return!0}createHistoryManager(){return new fb(Object.assign({graph:this.graph},this.options.history))}createScroller(){return this.options.scroller.enabled?new Iy(Object.assign({graph:this.graph},this.options.scroller)):null}createScrollerManager(){return new nb(this.graph)}allowPanning(t){return!0}createMiniMap(){const t=this.options.minimap,{enabled:e}=t,n=Fb(t,["enabled"]);return e?new Sy(Object.assign({graph:this.graph},n)):null}createMiniMapManager(){return new yb(this.graph)}createKeyboard(){return new vb(Object.assign({graph:this.graph},this.options.keyboard))}createMouseWheel(){return new kb(Object.assign({graph:this.graph},this.options.mousewheel))}createPrintManager(){return new Mb(this.graph)}createFormatManager(){return new Sb(this.graph)}createPanningManager(){return new Pb(this.graph)}createSizeManager(){return new Tb(this.graph)}allowConnectToBlank(t){const e=this.options.connecting,n=null!=e.allowBlank?e.allowBlank:e.dangling;if("function"!==typeof n)return!!n;const i=this.graph.findViewByCell(t),s=t.getSourceCell(),o=t.getTargetCell(),r=this.graph.findViewByCell(s),a=this.graph.findViewByCell(o);return Ya(n,this.graph,{edge:t,edgeView:i,sourceCell:s,targetCell:o,sourceView:r,targetView:a,sourcePort:t.getSourcePortId(),targetPort:t.getTargetPortId(),sourceMagnet:i.sourceMagnet,targetMagnet:i.targetMagnet})}validateEdge(t,e,n){if(!this.allowConnectToBlank(t)){const e=t.getSourceCellId(),n=t.getTargetCellId();if(!e||!n)return!1}const i=this.options.connecting.validateEdge;return!i||Ya(i,this.graph,{edge:t,type:e,previous:n})}validateMagnet(t,e,n){if("passive"!==e.getAttribute("magnet")){const i=this.options.connecting.validateMagnet;return!i||Ya(i,this.graph,{e:n,magnet:e,view:t,cell:t.cell})}return!1}getDefaultEdge(t,e){let n;const i=this.options.connecting.createEdge;return i&&(n=Ya(i,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),null==n&&(n=new sy),n}validateConnection(t,e,n,i,s,o,r){const a=this.options.connecting,l=a.allowLoop,c=a.allowNode,h=a.allowEdge,u=a.allowPort,d=null!=a.allowMulti?a.allowMulti:a.multi,g=a.validateConnection,p=o?o.cell:null,f="target"===s?n:t,m="target"===s?i:e;let y=!0;const b=a=>{const l="source"===s?r?r.port:null:p?p.getSourcePortId():null,c="target"===s?r?r.port:null:p?p.getTargetPortId():null;return Ya(a,this.graph,{edge:p,edgeView:o,sourceView:t,targetView:n,sourcePort:l,targetPort:c,sourceMagnet:e,targetMagnet:i,sourceCell:t?t.cell:null,targetCell:n?n.cell:null,type:s})};if(null!=l&&("boolean"===typeof l?l||t!==n||(y=!1):y=b(l)),y&&null!=u&&("boolean"===typeof u?!u&&m&&(y=!1):y=b(u)),y&&null!=h&&("boolean"===typeof h?!h&&_m.isEdgeView(f)&&(y=!1):y=b(h)),y&&null!=c&&("boolean"===typeof c?c||null==f||Gm.isNodeView(f)&&null==m&&(y=!1):y=b(c)),y&&null!=d&&o){const t=o.cell,e="source"===s?r:t.getSource(),n="target"===s?r:t.getTarget(),i=r?this.graph.getCellById(r.cell):null;if(e&&n&&e.cell&&n.cell&&i)if("function"===typeof d)y=b(d);else{const t=this.model.getConnectedEdges(i,{outgoing:"source"===s,incoming:"target"===s});if(t.length)if("withPort"===d){const i=t.some((t=>{const i=t.getSource(),s=t.getTarget();return i&&s&&i.cell===e.cell&&s.cell===n.cell&&null!=i.port&&i.port===e.port&&null!=s.port&&s.port===n.port}));i&&(y=!1)}else if(!d){const i=t.some((t=>{const i=t.getSource(),s=t.getTarget();return i&&s&&i.cell===e.cell&&s.cell===n.cell}));i&&(y=!1)}}}return y&&null!=g&&(y=b(g)),y}getRestrictArea(t){const e=this.options.translating.restrict,n="function"===typeof e?Ya(e,this.graph,t):e;return"number"===typeof n?this.graph.transform.getGraphArea().inflate(n):!0===n?this.graph.transform.getGraphArea():n||null}onViewUpdated(t,e,n){e&Ty.FLAG_INSERT||n.mounting||this.graph.renderer.requestConnectedEdgesUpdate(t,n)}onViewPostponed(t,e,n){return this.graph.renderer.forcePostponedViewUpdate(t,e)}getCellView(t){return null}createCellView(t){const e={graph:this.graph},n=this.getCellView(t);if(n)return new n(t,e);const i=t.view;if(null!=i&&"string"===typeof i){const n=up.registry.get(i);return n?new n(t,e):up.registry.onNotFound(i)}return t.isNode()?new Gm(t,e):t.isEdge()?new _m(t,e):null}getHTMLComponent(t){let e=t.getHTML();return"string"===typeof e&&(e=oy.componentRegistry.get(e)||e),Bn(e)&&(e=e.render),"function"===typeof e?Ya(e,this.graph,t):e}shouldUpdateHTMLComponent(t){let e=t.getHTML();if("string"===typeof e&&(e=oy.componentRegistry.get(e)||e),Bn(e)){const n=e.shouldComponentUpdate;return"function"===typeof n?Ya(n,this.graph,t):!!n}return!1}onEdgeLabelRendered(t){}onPortRendered(t){}onToolItemCreated(t){}}jb([Nb.hook()],Lb.prototype,"createModel",null),jb([Nb.hook()],Lb.prototype,"createView",null),jb([Nb.hook()],Lb.prototype,"createRenderer",null),jb([Nb.hook()],Lb.prototype,"createDefsManager",null),jb([Nb.hook()],Lb.prototype,"createGridManager",null),jb([Nb.hook()],Lb.prototype,"createCoordManager",null),jb([Nb.hook()],Lb.prototype,"createKnobManager",null),jb([Nb.hook()],Lb.prototype,"createTransform",null),jb([Nb.hook()],Lb.prototype,"createKnob",null),jb([Nb.hook()],Lb.prototype,"createTransformManager",null),jb([Nb.hook()],Lb.prototype,"createHighlightManager",null),jb([Nb.hook()],Lb.prototype,"createBackgroundManager",null),jb([Nb.hook()],Lb.prototype,"createClipboard",null),jb([Nb.hook()],Lb.prototype,"createClipboardManager",null),jb([Nb.hook()],Lb.prototype,"createSnapline",null),jb([Nb.hook()],Lb.prototype,"createSnaplineManager",null),jb([Nb.hook()],Lb.prototype,"createSelection",null),jb([Nb.hook()],Lb.prototype,"createSelectionManager",null),jb([Nb.hook()],Lb.prototype,"allowRubberband",null),jb([Nb.hook()],Lb.prototype,"createHistoryManager",null),jb([Nb.hook()],Lb.prototype,"createScroller",null),jb([Nb.hook()],Lb.prototype,"createScrollerManager",null),jb([Nb.hook()],Lb.prototype,"allowPanning",null),jb([Nb.hook()],Lb.prototype,"createMiniMap",null),jb([Nb.hook()],Lb.prototype,"createMiniMapManager",null),jb([Nb.hook()],Lb.prototype,"createKeyboard",null),jb([Nb.hook()],Lb.prototype,"createMouseWheel",null),jb([Nb.hook()],Lb.prototype,"createPrintManager",null),jb([Nb.hook()],Lb.prototype,"createFormatManager",null),jb([Nb.hook()],Lb.prototype,"createPanningManager",null),jb([Nb.hook()],Lb.prototype,"createSizeManager",null),jb([Nb.after()],Lb.prototype,"onViewUpdated",null),jb([Nb.after()],Lb.prototype,"onViewPostponed",null),jb([Nb.hook()],Lb.prototype,"getCellView",null),jb([Nb.hook(!0)],Lb.prototype,"createCellView",null),jb([Nb.hook()],Lb.prototype,"getHTMLComponent",null),jb([Nb.hook()],Lb.prototype,"shouldUpdateHTMLComponent",null),jb([Nb.hook()],Lb.prototype,"onEdgeLabelRendered",null),jb([Nb.hook()],Lb.prototype,"onPortRendered",null),jb([Nb.hook()],Lb.prototype,"onToolItemCreated",null);var zb,Ib,Bb=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class Rb extends Vg{constructor(t){super(),this.options=Hy.get(t),this.css=new py(this),this.hook=new Lb(this),this.view=this.hook.createView(),this.defs=this.hook.createDefsManager(),this.coord=this.hook.createCoordManager(),this.transform=this.hook.createTransformManager(),this.knob=this.hook.createKnobManager(),this.highlight=this.hook.createHighlightManager(),this.grid=this.hook.createGridManager(),this.background=this.hook.createBackgroundManager(),this.model=this.hook.createModel(),this.renderer=this.hook.createRenderer(),this.clipboard=this.hook.createClipboardManager(),this.snapline=this.hook.createSnaplineManager(),this.selection=this.hook.createSelectionManager(),this.history=this.hook.createHistoryManager(),this.scroller=this.hook.createScrollerManager(),this.minimap=this.hook.createMiniMapManager(),this.keyboard=this.hook.createKeyboard(),this.mousewheel=this.hook.createMouseWheel(),this.print=this.hook.createPrintManager(),this.format=this.hook.createFormatManager(),this.panning=this.hook.createPanningManager(),this.size=this.hook.createSizeManager()}get container(){return this.view.container}get[Symbol.toStringTag](){return Rb.toStringTag}isNode(t){return t.isNode()}isEdge(t){return t.isEdge()}resetCells(t,e={}){return this.model.resetCells(t,e),this}clearCells(t={}){return this.model.clear(t),this}toJSON(t={}){return this.model.toJSON(t)}parseJSON(t){return this.model.parseJSON(t)}fromJSON(t,e={}){return this.model.fromJSON(t,e),this}getCellById(t){return this.model.getCell(t)}addNode(t,e={}){return this.model.addNode(t,e)}addNodes(t,e={}){return this.addCell(t.map((t=>Pm.isNode(t)?t:this.createNode(t))),e)}createNode(t){return this.model.createNode(t)}removeNode(t,e={}){return this.model.removeCell(t,e)}addEdge(t,e={}){return this.model.addEdge(t,e)}addEdges(t,e={}){return this.addCell(t.map((t=>$m.isEdge(t)?t:this.createEdge(t))),e)}removeEdge(t,e={}){return this.model.removeCell(t,e)}createEdge(t){return this.model.createEdge(t)}addCell(t,e={}){return this.model.addCell(t,e),this}removeCell(t,e={}){return this.model.removeCell(t,e)}removeCells(t,e={}){return this.model.removeCells(t,e)}removeConnectedEdges(t,e={}){return this.model.removeConnectedEdges(t,e)}disconnectConnectedEdges(t,e={}){return this.model.disconnectConnectedEdges(t,e),this}hasCell(t){return this.model.has(t)}getCell(t){return this.model.getCell(t)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(t){return this.model.getOutgoingEdges(t)}getIncomingEdges(t){return this.model.getIncomingEdges(t)}getConnectedEdges(t,e={}){return this.model.getConnectedEdges(t,e)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(t){return this.model.isRoot(t)}isLeafNode(t){return this.model.isLeaf(t)}getNeighbors(t,e={}){return this.model.getNeighbors(t,e)}isNeighbor(t,e,n={}){return this.model.isNeighbor(t,e,n)}getSuccessors(t,e={}){return this.model.getSuccessors(t,e)}isSuccessor(t,e,n={}){return this.model.isSuccessor(t,e,n)}getPredecessors(t,e={}){return this.model.getPredecessors(t,e)}isPredecessor(t,e,n={}){return this.model.isPredecessor(t,e,n)}getCommonAncestor(...t){return this.model.getCommonAncestor(...t)}getSubGraph(t,e={}){return this.model.getSubGraph(t,e)}cloneSubGraph(t,e={}){return this.model.cloneSubGraph(t,e)}cloneCells(t){return this.model.cloneCells(t)}getNodesFromPoint(t,e){return this.model.getNodesFromPoint(t,e)}getNodesInArea(t,e,n,i,s){return this.model.getNodesInArea(t,e,n,i,s)}getNodesUnderNode(t,e={}){return this.model.getNodesUnderNode(t,e)}searchCell(t,e,n={}){return this.model.search(t,e,n),this}getShortestPath(t,e,n={}){return this.model.getShortestPath(t,e,n)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(t,e={}){return this.model.getCellsBBox(t,e)}startBatch(t,e={}){this.model.startBatch(t,e)}stopBatch(t,e={}){this.model.stopBatch(t,e)}batchUpdate(t,e,n){const i="string"===typeof t?t:"update",s="string"===typeof t?e:t,o="function"===typeof e?n:e;this.startBatch(i,o);const r=s();return this.stopBatch(i,o),r}updateCellId(t,e){return this.model.updateCellId(t,e)}isFrozen(){return this.renderer.isFrozen()}freeze(t={}){return this.renderer.freeze(t),this}unfreeze(t={}){return this.renderer.unfreeze(t),this}isAsync(){return this.renderer.isAsync()}setAsync(t){return this.renderer.setAsync(t),this}findView(t){return Sm.isCell(t)?this.findViewByCell(t):this.findViewByElem(t)}findViews(t){return lc.isRectangleLike(t)?this.findViewsInArea(t):ac.isPointLike(t)?this.findViewsFromPoint(t):[]}findViewByCell(t){return this.renderer.findViewByCell(t)}findViewByElem(t){return this.renderer.findViewByElem(t)}findViewsFromPoint(t,e){const n="number"===typeof t?{x:t,y:e}:t;return this.renderer.findViewsFromPoint(n)}findViewsInArea(t,e,n,i,s){const o="number"===typeof t?{x:t,y:e,width:n,height:i}:t,r="number"===typeof t?s:e;return this.renderer.findViewsInArea(o,r)}isViewMounted(t){return this.renderer.isViewMounted(t)}getMountedViews(){return this.renderer.getMountedViews()}getUnmountedViews(){return this.renderer.getUnmountedViews()}matrix(t){return"undefined"===typeof t?this.transform.getMatrix():(this.transform.setMatrix(t),this)}resize(t,e){return this.size.resize(t,e),this}resizeGraph(t,e){return this.size.resizeGraph(t,e),this}resizeScroller(t,e){return this.size.resizeScroller(t,e),this}resizePage(t,e){return this.size.resizePage(t,e),this}scale(t,e=t,n=0,i=0){return"undefined"===typeof t?this.transform.getScale():(this.transform.scale(t,e,n,i),this)}zoom(t,e){const n=this.scroller.widget;if(n){if("undefined"===typeof t)return n.zoom();n.zoom(t,e)}else{if("undefined"===typeof t)return this.transform.getZoom();this.transform.zoom(t,e)}return this}zoomTo(t,e={}){const n=this.scroller.widget;return n?n.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})):this.transform.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}zoomToRect(t,e={}){const n=this.scroller.widget;return n?n.zoomToRect(t,e):this.transform.zoomToRect(t,e),this}zoomToFit(t={}){const e=this.scroller.widget;return e?e.zoomToFit(t):this.transform.zoomToFit(t),this}rotate(t,e,n){return"undefined"===typeof t?this.transform.getRotation():(this.transform.rotate(t,e,n),this)}translate(t,e){return"undefined"===typeof t?this.transform.getTranslation():(this.transform.translate(t,e),this)}translateBy(t,e){const n=this.translate(),i=n.tx+t,s=n.ty+e;return this.translate(i,s)}getArea(){return this.transform.getGraphArea()}getGraphArea(){return this.transform.getGraphArea()}getContentArea(t={}){return this.transform.getContentArea(t)}getContentBBox(t={}){return this.transform.getContentBBox(t)}fitToContent(t,e,n,i){return this.transform.fitToContent(t,e,n,i)}scaleContentToFit(t={}){return this.transform.scaleContentToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const i=this.scroller.widget;return i?i.centerPoint(t,e,n):this.transform.centerPoint(t,e),this}centerContent(t){const e=this.scroller.widget;return e?e.centerContent(t):this.transform.centerContent(t),this}centerCell(t,e){const n=this.scroller.widget;return n?n.centerCell(t,e):this.transform.centerCell(t),this}positionPoint(t,e,n,i={}){const s=this.scroller.widget;return s?s.positionPoint(t,e,n,i):this.transform.positionPoint(t,e,n),this}positionRect(t,e,n){const i=this.scroller.widget;return i?i.positionRect(t,e,n):this.transform.positionRect(t,e),this}positionCell(t,e,n){const i=this.scroller.widget;return i?i.positionCell(t,e,n):this.transform.positionCell(t,e),this}positionContent(t,e){const n=this.scroller.widget;return n?n.positionContent(t,e):this.transform.positionContent(t,e),this}getClientMatrix(){return this.coord.getClientMatrix()}getClientOffset(){return this.coord.getClientOffset()}getPageOffset(){return this.coord.getPageOffset()}snapToGrid(t,e){return this.coord.snapToGrid(t,e)}pageToLocal(t,e,n,i){return lc.isRectangleLike(t)?this.coord.pageToLocalRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.pageToLocalRect(t,e,n,i):this.coord.pageToLocalPoint(t,e)}localToPage(t,e,n,i){return lc.isRectangleLike(t)?this.coord.localToPageRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.localToPageRect(t,e,n,i):this.coord.localToPagePoint(t,e)}clientToLocal(t,e,n,i){return lc.isRectangleLike(t)?this.coord.clientToLocalRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.clientToLocalRect(t,e,n,i):this.coord.clientToLocalPoint(t,e)}localToClient(t,e,n,i){return lc.isRectangleLike(t)?this.coord.localToClientRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.localToClientRect(t,e,n,i):this.coord.localToClientPoint(t,e)}localToGraph(t,e,n,i){return lc.isRectangleLike(t)?this.coord.localToGraphRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.localToGraphRect(t,e,n,i):this.coord.localToGraphPoint(t,e)}graphToLocal(t,e,n,i){return lc.isRectangleLike(t)?this.coord.graphToLocalRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.graphToLocalRect(t,e,n,i):this.coord.graphToLocalPoint(t,e)}clientToGraph(t,e,n,i){return lc.isRectangleLike(t)?this.coord.clientToGraphRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.clientToGraphRect(t,e,n,i):this.coord.clientToGraphPoint(t,e)}defineFilter(t){return this.defs.filter(t)}defineGradient(t){return this.defs.gradient(t)}defineMarker(t){return this.defs.marker(t)}getGridSize(){return this.grid.getGridSize()}setGridSize(t){return this.grid.setGridSize(t),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(t){return this.grid.draw(t),this}updateBackground(){return this.background.update(),this}drawBackground(t,e){const n=this.scroller.widget;return null==n||null!=this.options.background&&e?this.background.draw(t):n.backgroundManager.draw(t),this}clearBackground(t){const e=this.scroller.widget;return null==e||null!=this.options.background&&t?this.background.clear():e.backgroundManager.clear(),this}isClipboardEnabled(){return!this.clipboard.disabled}enableClipboard(){return this.clipboard.enable(),this}disableClipboard(){return this.clipboard.disable(),this}toggleClipboard(t){return null!=t?t!==this.isClipboardEnabled()&&(t?this.enableClipboard():this.disableClipboard()):this.isClipboardEnabled()?this.disableClipboard():this.enableClipboard(),this}isClipboardEmpty(){return this.clipboard.isEmpty()}getCellsInClipboard(){return this.clipboard.cells}cleanClipboard(){return this.clipboard.clean(),this}copy(t,e={}){return this.clipboard.copy(t,e),this}cut(t,e={}){return this.clipboard.cut(t,e),this}paste(t={},e=this){return this.clipboard.paste(t,e)}isHistoryEnabled(){return!this.history.disabled}enableHistory(){return this.history.enable(),this}disableHistory(){return this.history.disable(),this}toggleHistory(t){return null!=t?t!==this.isHistoryEnabled()&&(t?this.enableHistory():this.disableHistory()):this.isHistoryEnabled()?this.disableHistory():this.enableHistory(),this}undo(t={}){return this.history.undo(t),this}undoAndCancel(t={}){return this.history.cancel(t),this}redo(t={}){return this.history.redo(t),this}canUndo(){return this.history.canUndo()}canRedo(){return this.history.canRedo()}cleanHistory(t={}){this.history.clean(t)}isKeyboardEnabled(){return!this.keyboard.disabled}enableKeyboard(){return this.keyboard.enable(),this}disableKeyboard(){return this.keyboard.disable(),this}toggleKeyboard(t){return null!=t?t!==this.isKeyboardEnabled()&&(t?this.enableKeyboard():this.disableKeyboard()):this.isKeyboardEnabled()?this.disableKeyboard():this.enableKeyboard(),this}bindKey(t,e,n){return this.keyboard.on(t,e,n),this}unbindKey(t,e){return this.keyboard.off(t,e),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(t){return null==t?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():t?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const t=this.scroller.widget;return t?this.scroller.pannable:this.panning.pannable}enablePanning(){const t=this.scroller.widget;return t?this.scroller.enablePanning():this.panning.enablePanning(),this}disablePanning(){const t=this.scroller.widget;return t?this.scroller.disablePanning():this.panning.disablePanning(),this}togglePanning(t){return null==t?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}lockScroller(){var t;null===(t=this.scroller.widget)||void 0===t||t.lock()}unlockScroller(){var t;null===(t=this.scroller.widget)||void 0===t||t.unlock()}updateScroller(){var t;null===(t=this.scroller.widget)||void 0===t||t.update()}getScrollbarPosition(){const t=this.scroller.widget;return t.scrollbarPosition()}setScrollbarPosition(t,e,n){const i=this.scroller.widget;return i.scrollbarPosition(t,e,n),this}scrollToPoint(t,e,n){const i=this.scroller.widget;return i.scrollToPoint(t,e,n),this}scrollToContent(t){const e=this.scroller.widget;return e.scrollToContent(t),this}scrollToCell(t,e){const n=this.scroller.widget;return n.scrollToCell(t,e),this}transitionToPoint(t,e,n){const i=this.scroller.widget;return i.transitionToPoint(t,e,n),this}transitionToRect(t,e={}){const n=this.scroller.widget;return n.transitionToRect(t,e),this}isSelectionEnabled(){return!this.selection.disabled}enableSelection(){return this.selection.enable(),this}disableSelection(){return this.selection.disable(),this}toggleSelection(t){return null!=t?t!==this.isSelectionEnabled()&&(t?this.enableSelection():this.disableSelection()):this.isSelectionEnabled()?this.disableSelection():this.enableSelection(),this}isMultipleSelection(){return this.selection.isMultiple()}enableMultipleSelection(){return this.selection.enableMultiple(),this}disableMultipleSelection(){return this.selection.disableMultiple(),this}toggleMultipleSelection(t){return null!=t?t!==this.isMultipleSelection()&&(t?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return!1!==this.selection.widget.options.movable}enableSelectionMovable(){return this.selection.widget.options.movable=!0,this}disableSelectionMovable(){return this.selection.widget.options.movable=!1,this}toggleSelectionMovable(t){return null!=t?t!==this.isSelectionMovable()&&(t?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.selection.rubberbandDisabled}enableRubberband(){return this.selection.enableRubberband(),this}disableRubberband(){return this.selection.disableRubberband(),this}toggleRubberband(t){return null!=t?t!==this.isRubberbandEnabled()&&(t?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return!0===this.selection.widget.options.strict}enableStrictRubberband(){return this.selection.widget.options.strict=!0,this}disableStrictRubberband(){return this.selection.widget.options.strict=!1,this}toggleStrictRubberband(t){return null!=t?t!==this.isStrictRubberband()&&(t?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(t){this.selection.setModifiers(t)}setSelectionFilter(t){return this.selection.setFilter(t),this}setSelectionDisplayContent(t){return this.selection.setContent(t),this}isSelectionEmpty(){return this.selection.isEmpty()}cleanSelection(t){return this.selection.clean(t),this}resetSelection(t,e){return this.selection.reset(t,e),this}getSelectedCells(){return this.selection.cells}getSelectedCellCount(){return this.selection.length}isSelected(t){return this.selection.isSelected(t)}select(t,e){return this.selection.select(t,e),this}unselect(t,e){return this.selection.unselect(t,e),this}isSnaplineEnabled(){return!this.snapline.widget.disabled}enableSnapline(){return this.snapline.widget.enable(),this}disableSnapline(){return this.snapline.widget.disable(),this}toggleSnapline(t){if(null==t)return this.isSnaplineEnabled()?this.disableSnapline():this.enableSnapline(),this;t!==this.isSnaplineEnabled()&&(t?this.enableSnapline():this.disableSnapline())}hideSnapline(){return this.snapline.widget.hide(),this}setSnaplineFilter(t){return this.snapline.widget.setFilter(t),this}isSnaplineOnResizingEnabled(){return!0===this.snapline.widget.options.resizing}enableSnaplineOnResizing(){return this.snapline.widget.options.resizing=!0,this}disableSnaplineOnResizing(){return this.snapline.widget.options.resizing=!1,this}toggleSnaplineOnResizing(t){return null!=t?t!==this.isSnaplineOnResizingEnabled()&&(t?this.enableSnaplineOnResizing():this.disableSnaplineOnResizing()):this.isSnaplineOnResizingEnabled()?this.disableSnaplineOnResizing():this.enableSnaplineOnResizing(),this}isSharpSnapline(){return!0===this.snapline.widget.options.sharp}enableSharpSnapline(){return this.snapline.widget.options.sharp=!0,this}disableSharpSnapline(){return this.snapline.widget.options.sharp=!1,this}toggleSharpSnapline(t){return null!=t?t!==this.isSharpSnapline()&&(t?this.enableSharpSnapline():this.disableSharpSnapline()):this.isSharpSnapline()?this.disableSharpSnapline():this.enableSharpSnapline(),this}getSnaplineTolerance(){return this.snapline.widget.options.tolerance}setSnaplineTolerance(t){return this.snapline.widget.options.tolerance=t,this}removeTools(){return this.emit("tools:remove"),this}hideTools(){return this.emit("tools:hide"),this}showTools(){return this.emit("tools:show"),this}toSVG(t,e={}){this.format.toSVG(t,e)}toDataURL(t,e){this.format.toDataURL(t,e)}toPNG(t,e={}){this.format.toPNG(t,e)}toJPEG(t,e={}){this.format.toJPEG(t,e)}printPreview(t){this.print.show(t)}dispose(){this.clearCells(),this.off(),this.css.dispose(),this.hook.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.knob.dispose(),this.highlight.dispose(),this.background.dispose(),this.clipboard.dispose(),this.snapline.dispose(),this.selection.dispose(),this.history.dispose(),this.keyboard.dispose(),this.mousewheel.dispose(),this.print.dispose(),this.format.dispose(),this.minimap.dispose(),this.panning.dispose(),this.scroller.dispose(),this.view.dispose(),this.renderer.dispose(),this.size.dispose()}}Bb([cy.checkScroller()],Rb.prototype,"lockScroller",null),Bb([cy.checkScroller()],Rb.prototype,"unlockScroller",null),Bb([cy.checkScroller()],Rb.prototype,"updateScroller",null),Bb([cy.checkScroller()],Rb.prototype,"getScrollbarPosition",null),Bb([cy.checkScroller()],Rb.prototype,"setScrollbarPosition",null),Bb([cy.checkScroller()],Rb.prototype,"scrollToPoint",null),Bb([cy.checkScroller()],Rb.prototype,"scrollToContent",null),Bb([cy.checkScroller()],Rb.prototype,"scrollToCell",null),Bb([cy.checkScroller()],Rb.prototype,"transitionToPoint",null),Bb([cy.checkScroller()],Rb.prototype,"transitionToRect",null),Bb([Vg.dispose()],Rb.prototype,"dispose",null),function(t){t.View=uy,t.Hook=Lb,t.Renderer=Ty,t.Keyboard=vb,t.MouseWheel=kb,t.BaseManager=ly,t.DefsManager=qy,t.GridManager=Yy,t.CoordManager=Jy,t.PrintManager=Mb,t.FormatManager=Sb,t.MiniMapManager=yb,t.HistoryManager=fb,t.SnaplineManager=tb,t.ScrollerManager=nb,t.ClipboardManager=ob,t.TransformManager=cb,t.HighlightManager=ab,t.BackgroundManager=jy,t.SelectionManager=ub}(Rb||(Rb={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&null!=i.hook&&null!=i.view&&null!=i.model}t.toStringTag=`X6.${t.name}`,t.isGraph=e}(Rb||(Rb={})),function(t){function e(e,n){const i=e instanceof HTMLElement?new t({container:e}):new t(e);return null!=n&&i.fromJSON(n),i}t.render=e}(Rb||(Rb={})),function(t){t.registerNode=Pm.registry.register,t.registerEdge=$m.registry.register,t.registerView=up.registry.register,t.registerAttr=kd.registry.register,t.registerGrid=Dd.registry.register,t.registerFilter=_d.registry.register,t.registerNodeTool=Dp.registry.register,t.registerEdgeTool=Pp.registry.register,t.registerBackground=qd.registry.register,t.registerHighlighter=ig.registry.register,t.registerPortLayout=yg.registry.register,t.registerPortLabelLayout=Lg.registry.register,t.registerMarker=rd.registry.register,t.registerRouter=em.registry.register,t.registerConnector=wm.registry.register,t.registerAnchor=Zp.registry.register,t.registerEdgeAnchor=ef.registry.register,t.registerConnectionPoint=uf.registry.register,t.registerConnectionStrategy=op.registry.register,t.registerHTMLComponent=oy.componentRegistry.register}(Rb||(Rb={})),function(t){t.unregisterNode=Pm.registry.unregister,t.unregisterEdge=$m.registry.unregister,t.unregisterView=up.registry.unregister,t.unregisterAttr=kd.registry.unregister,t.unregisterGrid=Dd.registry.unregister,t.unregisterFilter=_d.registry.unregister,t.unregisterNodeTool=Dp.registry.unregister,t.unregisterEdgeTool=Pp.registry.unregister,t.unregisterBackground=qd.registry.unregister,t.unregisterHighlighter=ig.registry.unregister,t.unregisterPortLayout=yg.registry.unregister,t.unregisterPortLabelLayout=Lg.registry.unregister,t.unregisterMarker=rd.registry.unregister,t.unregisterRouter=em.registry.unregister,t.unregisterConnector=wm.registry.unregister,t.unregisterAnchor=Zp.registry.unregister,t.unregisterEdgeAnchor=ef.registry.unregister,t.unregisterConnectionPoint=uf.registry.unregister,t.unregisterConnectionStrategy=op.registry.unregister,t.unregisterHTMLComponent=oy.componentRegistry.unregister}(Rb||(Rb={}));class $b{constructor(){this.cells=[]}copy(t,e,n={}){this.options=Object.assign({},n);const i=qm.isModel(e)?e:e.model,s=i.cloneSubGraph(t,n);this.cells=Ve(Object.keys(s).map((t=>s[t])),(t=>t.isEdge()?2:1)),this.serialize(n)}cut(t,e,n={}){this.copy(t,e,n);const i=Rb.isGraph(e)?e.model:e;i.batchUpdate("cut",(()=>{t.forEach((t=>t.remove()))}))}paste(t,e={}){const n=Object.assign(Object.assign({},this.options),e),{offset:i,edgeProps:s,nodeProps:o}=n;let r=20,a=20;i&&(r="number"===typeof i?i:i.dx,a="number"===typeof i?i:i.dy),this.deserialize(n);const l=this.cells;l.forEach((t=>{t.model=null,t.removeProp("zIndex"),(r||a)&&t.translate(r,a),o&&t.isNode()&&t.prop(o),s&&t.isEdge()&&t.prop(s)}));const c=Rb.isGraph(t)?t.model:t;return c.batchUpdate("paste",(()=>{c.addCells(this.cells)})),this.copy(l,t,e),l}serialize(t){!1!==t.useLocalStorage&&zb.save(this.cells)}deserialize(t){if(t.useLocalStorage){const t=zb.fetch();t&&(this.cells=t)}}isEmpty(){return this.cells.length<=0}clean(){this.options={},this.cells=[],zb.clean()}}(function(t){const e=`${Zd.prefixCls}.clipboard.cells`;function n(t){if(window.localStorage){const n=t.map((t=>t.toJSON()));localStorage.setItem(e,JSON.stringify(n))}}function i(){if(window.localStorage){const t=localStorage.getItem(e),n=t?JSON.parse(t):[];if(n)return qm.fromJSON(n)}}function s(){window.localStorage&&localStorage.removeItem(e)}t.save=n,t.fetch=i,t.clean=s})(zb||(zb={}));class Vb{constructor(t){this.halo=t}get options(){return this.halo.options}get graph(){return this.halo.graph}get model(){return this.halo.model}get view(){return this.halo.view}get cell(){return this.halo.cell}get node(){return this.cell}getPresets(){return{className:"type-node",handles:[{name:"remove",position:"nw",events:{mousedown:this.removeCell.bind(this)},icon:null},{name:"resize",position:"se",events:{mousedown:this.startResize.bind(this),mousemove:this.doResize.bind(this),mouseup:this.stopResize.bind(this)},icon:null},{name:"clone",position:"n",events:{mousedown:this.startClone.bind(this),mousemove:this.doClone.bind(this),mouseup:this.stopClone.bind(this)},icon:null},{name:"link",position:"e",events:{mousedown:this.startLink.bind(this),mousemove:this.doLink.bind(this),mouseup:this.stopLink.bind(this)},icon:null},{name:"fork",position:"ne",events:{mousedown:this.startFork.bind(this),mousemove:this.doFork.bind(this),mouseup:this.stopFork.bind(this)},icon:null},{name:"unlink",position:"w",events:{mousedown:this.unlink.bind(this)},icon:null},{name:"rotate",position:"sw",events:{mousedown:this.startRotate.bind(this),mousemove:this.doRotate.bind(this),mouseup:this.stopRotate.bind(this)},icon:null}],bbox(t){if(this.options.useCellGeometry){const e=t.cell;return e.getBBox()}return t.getBBox()},content(t){const e=Ho("x: <%= x %>, y: <%= y %>, width: <%= width %>, height: <%= height %>, angle: <%= angle %>"),n=t.cell,i=n.getBBox();return e({x:Math.floor(i.x),y:Math.floor(i.y),width:Math.floor(i.width),height:Math.floor(i.height),angle:Math.floor(n.getAngle())})},magnet(t){return t.container},tinyThreshold:40,smallThreshold:80,loopEdgePreferredSide:"top",loopEdgeWidth:40,rotateGrid:15,rotateEmbeds:!1}}removeCell(){this.model.removeConnectedEdges(this.cell),this.cell.remove()}startLink({x:t,y:e}){this.halo.startBatch();const n=this.graph,i=this.createEdgeConnectedToSource();i.setTarget({x:t,y:e}),this.model.addEdge(i,{validation:!1,halo:this.halo.cid,async:!1}),n.view.undelegateEvents(),this.edgeView=n.renderer.findViewByCell(i),this.edgeView.prepareArrowheadDragging("target",{x:t,y:e,fallbackAction:"remove"})}createEdgeConnectedToSource(){const t=this.getMagnet(this.view,"source"),e=this.getEdgeTerminal(this.view,t),n=this.graph.hook.getDefaultEdge(this.view,t);return n.setSource(e),n}getMagnet(t,e){const n=this.options.magnet;if("function"===typeof n){const i=Ya(n,this.halo,t,e);if(i instanceof SVGElement)return i}throw new Error("`magnet()` has to return an SVGElement")}getEdgeTerminal(t,e){const n={cell:t.cell.id};if(e!==t.container){const i=e.getAttribute("port");i?n.port=i:n.selector=t.getSelector(e)}return n}doLink({e:t,x:e,y:n}){this.edgeView&&this.edgeView.onMouseMove(t,e,n)}stopLink({e:t,x:e,y:n}){const i=this.edgeView;if(i){i.onMouseUp(t,e,n);const s=i.cell;s.hasLoop()&&this.makeLoopEdge(s),this.halo.stopBatch(),this.halo.trigger("action:edge:addde",{edge:s}),this.edgeView=null}this.graph.view.delegateEvents()}makeLoopEdge(t){let e=null,n=null;const i=this.options.loopEdgeWidth,s=this.graph.options,o=new lc(0,0,s.width,s.height),r=this.graph.graphToLocal(this.view.getBBox()),a=[this.options.loopEdgePreferredSide,"top","bottom","left","right"].some((t=>{let s=null,a=0,l=0;switch(t){case"top":s=new ac(r.x+r.width/2,r.y-i),a=i/2;break;case"bottom":s=new ac(r.x+r.width/2,r.y+r.height+i),a=i/2;break;case"left":s=new ac(r.x-i,r.y+r.height/2),l=i/2;break;case"right":s=new ac(r.x+r.width+i,r.y+r.height/2),l=i/2;break;default:break}return!!s&&(e=s.translate(-a,-l),n=s.translate(a,l),o.containsPoint(e)&&o.containsPoint(n))}));a&&e&&n&&t.setVertices([e,n])}startResize({e:t}){this.halo.startBatch(),this.flip=[1,0,0,1,1,0,0,1][Math.floor(Ql.normalize(this.node.getAngle())/45)],this.view.addClass("node-resizing"),By("node:resize",t,this.view)}doResize({e:t,dx:e,dy:n}){const i=this.node.getSize(),s=Math.max(i.width+(this.flip?e:n),1),o=Math.max(i.height+(this.flip?n:e),1);this.node.resize(s,o,{absolute:!0}),By("node:resizing",t,this.view)}stopResize({e:t}){this.view.removeClass("node-resizing"),By("node:resized",t,this.view),this.halo.stopBatch()}startClone({e:t,x:e,y:n}){this.halo.startBatch();const i=this.options,s=i.clone(this.cell,{clone:!0});if(!Sm.isCell(s))throw new Error("option 'clone()' has to return a cell");this.centerNodeAtCursor(s,e,n),this.model.addCell(s,{halo:this.halo.cid,async:!1});const o=this.graph.renderer.findViewByCell(s);o.onMouseDown(t,e,n),this.halo.setEventData(t,{cloneView:o})}centerNodeAtCursor(t,e,n){const i=t.getBBox().getCenter(),s=e-i.x,o=n-i.y;t.translate(s,o)}doClone({e:t,x:e,y:n}){const i=this.halo.getEventData(t).cloneView;i&&i.onMouseMove(t,e,n)}stopClone({e:t,x:e,y:n}){const i=this.halo.getEventData(t).cloneView;i&&i.onMouseUp(t,e,n),this.halo.stopBatch()}startFork({e:t,x:e,y:n}){this.halo.startBatch();const i=this.options.clone(this.cell,{fork:!0});if(!Sm.isCell(i))throw new Error("option 'clone()' has to return a cell");this.centerNodeAtCursor(i,e,n),this.model.addCell(i,{halo:this.halo.cid,async:!1});const s=this.createEdgeConnectedToSource(),o=this.graph.renderer.findViewByCell(i),r=this.getMagnet(o,"target"),a=this.getEdgeTerminal(o,r);s.setTarget(a),this.model.addEdge(s,{halo:this.halo.cid,async:!1}),o.onMouseDown(t,e,n),this.halo.setEventData(t,{cloneView:o})}doFork({e:t,x:e,y:n}){const i=this.halo.getEventData(t).cloneView;i&&i.onMouseMove(t,e,n)}stopFork({e:t,x:e,y:n}){const i=this.halo.getEventData(t).cloneView;i&&i.onMouseUp(t,e,n),this.halo.stopBatch()}startRotate({e:t,x:e,y:n}){this.halo.startBatch();const i=this.node.getBBox().getCenter(),s=[this.node];this.options.rotateEmbeds&&this.node.getDescendants({deep:!0}).reduce(((t,e)=>(e.isNode()&&t.push(e),t)),s),this.halo.setEventData(t,{center:i,nodes:s,rotateStartAngles:s.map((t=>t.getAngle())),clientStartAngle:new ac(e,n).theta(i)}),s.forEach((e=>{const n=this.graph.findViewByCell(e);n&&(n.addClass("node-rotating"),By("node:rotate",t,n))}))}doRotate({e:t,x:e,y:n}){const i=this.halo.getEventData(t),s=i.clientStartAngle-new ac(e,n).theta(i.center);i.nodes.forEach(((e,n)=>{const o=i.rotateStartAngles[n],r=Xd.snapToGrid(o+s,this.options.rotateGrid);e.rotate(r,{absolute:!0,center:i.center,halo:this.halo.cid}),By("node:rotating",t,this.graph.findViewByCell(e))}))}stopRotate({e:t}){const e=this.halo.getEventData(t);e.nodes.forEach((e=>{const n=this.graph.findViewByCell(e);n.removeClass("node-rotating"),By("node:rotated",t,n)})),this.halo.stopBatch()}unlink(){this.halo.startBatch(),this.model.removeConnectedEdges(this.cell),this.halo.stopBatch()}}class _b{constructor(t){this.halo=t}get options(){return this.halo.options}get graph(){return this.halo.graph}get model(){return this.halo.model}get view(){return this.halo.view}get cell(){return this.halo.cell}get edge(){return this.cell}getPresets(){return{className:"type-edge",handles:[{name:"remove",position:"nw",icon:null,events:{mousedown:this.removeEdge.bind(this)}},{name:"direction",position:"se",icon:null,events:{mousedown:this.directionSwap.bind(this)}}],content:!1,bbox(t){return t.graph.localToGraph(t.getPointAtRatio(.5))},tinyThreshold:-1,smallThreshold:-1}}removeEdge(){this.cell.remove()}directionSwap(){const t=this.edge.getSource(),e=this.edge.getTarget();this.edge.prop({source:e,target:t})}}class Gb extends vy{get type(){return this.options.type||"surround"}get handleOptions(){return this.options}init(t){this.options=Kn(Gb.defaultOptions,this.cell.isNode()?new Vb(this).getPresets():this.cell.isEdge()?new _b(this).getPresets():null,t),this.render(),this.initHandles(),this.update(),this.startListening()}startListening(){const t=this.model,e=this.graph,n=this.view.cell;n.on("removed",this.remove,this),t.on("reseted",this.remove,this),e.on("halo:destroy",this.remove,this),t.on("*",this.update,this),e.on("scale",this.update,this),e.on("translate",this.update,this),super.startListening()}stopListening(){const t=this.model,e=this.graph,n=this.view.cell;this.undelegateEvents(),n.off("removed",this.remove,this),t.off("reseted",this.remove,this),e.off("halo:destroy",this.remove,this),t.off("*",this.update,this),e.off("scale",this.update,this),e.off("translate",this.update,this),super.stopListening()}render(){const t=this.options,e=this.prefixClassName("widget-halo");return this.view.addClass(Ib.NODE_CLS),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(e).attr("data-shape",this.view.cell.shape),t.className&&this.$container.addClass(t.className),this.$handleContainer=this.$("<div/>").addClass(`${e}-handles`).appendTo(this.container),this.$content=this.$("<div/>").addClass(`${e}-content`).appendTo(this.container),this.$container.appendTo(this.graph.container),this}remove(){return this.stopBatch(),this.view.removeClass(Ib.NODE_CLS),super.remove()}update(){if(this.isRendered()){this.updateContent();const t=this.getBBox(),e=this.options.tinyThreshold||0,n=this.options.smallThreshold||0;this.$handleContainer.toggleClass(`${this.handleClassName}-tiny`,t.width<e&&t.height<e);const i=`${this.handleClassName}-small`;this.$handleContainer.toggleClass(i,!this.$handleContainer.hasClass(i)&&t.width<n&&t.height<n),this.$container.css({width:t.width,height:t.height,left:t.x,top:t.y}),this.hasHandle("unlink")&&this.toggleUnlink(),"surround"!==this.type&&"toolbar"!==this.type||this.hasHandle("fork")&&this.toggleFork()}}updateContent(){const t=this.options.content;if("function"===typeof t){const e=Ya(t,this,this.view,this.$content[0]);e&&this.$content.html(e)}else t?this.$content.html(t):this.$content.remove()}getBBox(){const t=this.view,e=this.options.bbox,n="function"===typeof e?Ya(e,this,t):e;return lc.create(Object.assign({x:0,y:0,width:1,height:1},n))}removeCell(){this.cell.remove()}toggleFork(){const t=this.view.cell.clone(),e=this.graph.hook.createCellView(t),n=this.graph.hook.validateConnection(this.view,null,e,null,"target");this.$handleContainer.children(".fork").toggleClass("hidden",!n),e.remove()}toggleUnlink(){const t=this.model.getConnectedEdges(this.view.cell).length>0;this.$handleContainer.children(".unlink").toggleClass("hidden",!t)}startBatch(){this.model.startBatch("halo",{halo:this.cid})}stopBatch(){this.model.hasActiveBatch("halo")&&this.model.stopBatch("halo",{halo:this.cid})}}(function(t){t.defaultOptions={type:"surround",clearAll:!0,clearOnBlankMouseDown:!0,useCellGeometry:!1,clone:t=>t.clone().removeZIndex()}})(Gb||(Gb={})),Object.getOwnPropertyNames(yy.prototype).forEach((t=>{"constructor"!==t&&Object.defineProperty(Gb.prototype,t,Object.getOwnPropertyDescriptor(yy.prototype,t))})),function(t){t.NODE_CLS="has-widget-halo"}(Ib||(Ib={}));var Hb,Ub,Wb,qb=function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r};class Zb extends Jg{constructor(t){super(),this.options=Object.assign(Object.assign({},Zb.defaults),t),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName("widget-dnd")),this.draggingGraph=new Rb(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1})),this.$container.append(this.draggingGraph.container)}get targetScroller(){const t=this.options.target;return Rb.isGraph(t)?t.scroller.widget:t}get targetGraph(){const t=this.options.target;return Rb.isGraph(t)?t:t.graph}get targetModel(){return this.targetGraph.model}get snapline(){return this.targetGraph.snapline.widget}start(t,e){const n=e;n.preventDefault(),this.targetModel.startBatch("dnd"),this.$container.addClass("dragging").appendTo(this.options.containerParent||document.body),this.sourceNode=t,this.prepareDragging(t,n.clientX,n.clientY);const i=this.updateNodePosition(n.clientX,n.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:n,node:t,cell:t,view:this.draggingView,x:i.x,y:i.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(Zb.documentEvents,n.data)}isSnaplineEnabled(){return this.snapline&&!this.snapline.disabled}prepareDragging(t,e,n){const i=this.draggingGraph,s=i.model,o=this.options.getDragNode(t,{sourceNode:t,draggingGraph:i,targetGraph:this.targetGraph});o.position(0,0);let r=5;if(this.isSnaplineEnabled()&&(r+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const t=this.targetGraph.transform.getScale();i.scale(t.sx,t.sy),r*=Math.max(t.sx,t.sy)}else i.scale(1,1);this.clearDragging(),this.options.animation&&this.$container.stop(!0,!0),s.resetCells([o]);const a=i.findViewByCell(o);a.undelegateEvents(),a.cell.off("changed"),i.fitToContent({padding:r,allowNewOrigin:"any"});const l=a.getBBox();this.geometryBBox=a.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(l.getTopLeft()),this.draggingNode=o,this.draggingView=a,this.draggingBBox=o.getBBox(),this.padding=r,this.originOffset=this.updateGraphPosition(e,n)}updateGraphPosition(t,e){const n=document.body.scrollTop||document.documentElement.scrollTop,i=this.delta,s=this.geometryBBox,o=this.padding||5,r={left:t-i.x-s.width/2-o,top:e-i.y-s.height/2-o+n};return this.draggingGraph&&this.$container.offset(r),r}updateNodePosition(t,e){const n=this.targetGraph.clientToLocal(t,e),i=this.draggingBBox;return n.x-=i.width/2,n.y-=i.height/2,this.draggingNode.position(n.x,n.y),n}snap({cell:t,current:e,options:n}){const i=t;if(n.snapped){const t=this.draggingBBox;i.position(t.x+n.tx,t.y+n.ty,{silent:!0}),this.draggingView.translate(),i.position(e.x,e.y,{silent:!0}),this.snapOffset={x:n.tx,y:n.ty}}else this.snapOffset=null}onDragging(t){const e=this.draggingView;if(e){t.preventDefault();const n=this.normalizeEvent(t),i=n.clientX,s=n.clientY;this.updateGraphPosition(i,s);const o=this.updateNodePosition(i,s),r=this.targetGraph.options.embedding.enabled,a=(r||this.isSnaplineEnabled())&&this.isInsideValidArea({x:i,y:s});if(r){e.setEventData(n,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const t=e.getEventData(n);a?e.processEmbedding(n,t):e.clearEmbedding(t),this.candidateEmbedView=t.candidateEmbedView}this.isSnaplineEnabled()&&(a?this.snapline.snapOnMoving({e:n,view:e,x:o.x,y:o.y}):this.snapline.hide())}}onDragEnd(t){const e=this.draggingNode;if(e){const n=this.normalizeEvent(t),i=this.draggingView,s=this.draggingBBox,o=this.snapOffset;let r=s.x,a=s.y;o&&(r+=o.x,a+=o.y),e.position(r,a,{silent:!0});const l=this.drop(e,{x:n.clientX,y:n.clientY}),c=t=>{t?(this.onDropped(e),this.targetGraph.options.embedding.enabled&&i&&(i.setEventData(n,{cell:t,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),i.finalizeEmbedding(n,i.getEventData(n)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};Ka(l)?(this.undelegateDocumentEvents(),l.then(c)):c(l)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}onDropped(t){this.draggingNode===t&&(this.clearDragging(),this.$container.removeClass("dragging").remove())}onDropInvalid(){const t=this.draggingNode;if(t){const e=this.options.animation;if(e){const n="object"===typeof e&&e.duration||150,i="object"===typeof e&&e.easing||"swing";this.draggingView=null,this.$container.animate(this.originOffset,n,i,(()=>this.onDropped(t)))}else this.onDropped(t)}}isInsideValidArea(t){let e;const n=this.targetGraph,i=this.targetScroller;if(i)if(i.options.autoResize)e=this.getDropArea(i.container);else{const t=this.getDropArea(i.container);e=this.getDropArea(n.container).intersectsWithRect(t)}else e=this.getDropArea(n.container);return e&&e.containsPoint(t)}getDropArea(t){const e=this.$(t),n=e.offset(),i=document.body.scrollTop||document.documentElement.scrollTop,s=document.body.scrollLeft||document.documentElement.scrollLeft;return lc.create({x:n.left+parseInt(e.css("border-left-width"),10)-s,y:n.top+parseInt(e.css("border-top-width"),10)-i,width:e.innerWidth(),height:e.innerHeight()})}drop(t,e){if(this.isInsideValidArea(e)){const n=this.targetGraph,i=n.model,s=n.clientToLocal(e),o=this.sourceNode,r=this.options.getDropNode(t,{sourceNode:o,draggingNode:t,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),a=r.getBBox();s.x+=a.x-a.width/2,s.y+=a.y-a.height/2;const l=this.snapOffset?1:n.getGridSize();r.position(Xd.snapToGrid(s.x,l),Xd.snapToGrid(s.y,l)),r.removeZIndex();const c=this.options.validateNode,h=!c||c(r,{sourceNode:o,draggingNode:t,droppingNode:r,targetGraph:n,draggingGraph:this.draggingGraph});return"boolean"===typeof h?h?(i.addCell(r,{stencil:this.cid}),r):null:tl(h).then((t=>t?(i.addCell(r,{stencil:this.cid}),r):null))}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove()}}function Xb(t,e={}){const n=qm.isModel(t)?t:(new qm).resetCells(t,{sort:!1,dryrun:!0}),i=n.getNodes(),s=e.columns||1,o=Math.ceil(i.length/s),r=e.dx||0,a=e.dy||0,l=!1!==e.center,c=!0===e.resizeToFit,h=e.marginX||0,u=e.marginY||0,d=[];let g=e.columnWidth;if("compact"===g)for(let b=0;b<s;b+=1){const t=Hb.getNodesInColumn(i,b,s);d.push(Hb.getMaxDim(t,"width")+r)}else{null!=g&&"auto"!==g||(g=Hb.getMaxDim(i,"width")+r);for(let t=0;t<s;t+=1)d.push(g)}const p=Hb.accumulate(d,h),f=[];let m=e.rowHeight;if("compact"===m)for(let b=0;b<o;b+=1){const t=Hb.getNodesInRow(i,b,s);f.push(Hb.getMaxDim(t,"height")+a)}else{null!=m&&"auto"!==m||(m=Hb.getMaxDim(i,"height")+a);for(let t=0;t<o;t+=1)f.push(m)}const y=Hb.accumulate(f,u);n.startBatch("layout"),i.forEach(((t,n)=>{const i=n%s,o=Math.floor(n/s),h=d[i],u=f[o];let g=0,m=0,b=t.getSize();if(c){let n=h-2*r,i=u-2*a;const s=b.height*(b.width?n/b.width:1),o=b.width*(b.height?i/b.height:1);u<s?n=o:i=s,b={width:n,height:i},t.setSize(b,e)}l&&(g=(h-b.width)/2,m=(u-b.height)/2),t.position(p[i]+r+g,y[o]+a+m,e)})),n.stopBatch("layout")}qb([Jg.dispose()],Zb.prototype,"dispose",null),function(t){t.defaults={animation:!1,getDragNode:t=>t.clone(),getDropNode:t=>t.clone()},t.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"}}(Zb||(Zb={})),function(t){function e(t,e){return t.reduce(((t,n)=>Math.max(n.getSize()[e],t)),0)}function n(t,e,n){const i=[];for(let s=n*e,o=s+n;s<o;s+=1)i.push(t[s]);return i}function i(t,e,n){const i=[];for(let s=e,o=t.length;s<o;s+=n)i.push(t[s]);return i}function s(t,e){return t.reduce(((t,e,n)=>(t.push(t[n]+e),t)),[e||0])}t.getMaxDim=e,t.getNodesInRow=n,t.getNodesInColumn=i,t.accumulate=s}(Hb||(Hb={}));class Yb extends Jg{constructor(t){if(super(),this.graphs={},this.$groups={},this.options=Object.assign(Object.assign({},Yb.defaultOptions),t),this.dnd=new Zb(this.options),this.onSearch=Ga.Z(this.onSearch,200),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(Ub.base)).attr("data-not-found-text",this.options.notFoundText||"No matches found"),this.options.collapsable=t.collapsable&&t.groups&&t.groups.some((t=>!1!==t.collapsable)),this.options.collapsable){this.$container.addClass("collapsable");const e=t.groups&&t.groups.every((t=>t.collapsed||!1===t.collapsable));e&&this.$container.addClass("collapsed")}this.$("<div/>").addClass(this.prefixClassName(Ub.title)).html(this.options.title).appendTo(this.$container),t.search&&this.$container.addClass("searchable").append(this.renderSearch()),this.$content=this.$("<div/>").addClass(this.prefixClassName(Ub.content)).appendTo(this.$container);const e=t.stencilGraphOptions||{};if(t.groups&&t.groups.length)t.groups.forEach((n=>{const i=this.$("<div/>").addClass(this.prefixClassName(Ub.group)).attr("data-name",n.name);(null==n.collapsable&&t.collapsable||!1!==n.collapsable)&&i.addClass("collapsable"),i.toggleClass("collapsed",!0===n.collapsed);const s=this.$("<h3/>").addClass(this.prefixClassName(Ub.groupTitle)).html(n.title||n.name),o=this.$("<div/>").addClass(this.prefixClassName(Ub.groupContent)),r=n.graphOptions,a=new Rb(Object.assign(Object.assign(Object.assign({},e),r),{container:document.createElement("div"),model:e.model||new qm,width:n.graphWidth||t.stencilGraphWidth,height:n.graphHeight||t.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));o.append(a.container),i.append(s,o).appendTo(this.$content),this.$groups[n.name]=i,this.graphs[n.name]=a}));else{const n=new Rb(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new qm,width:t.stencilGraphWidth,height:t.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.$content.append(n.container),this.graphs[Wb.defaultGroupName]=n}return this.startListening(),this}get targetScroller(){const t=this.options.target;return Rb.isGraph(t)?t.scroller.widget:t}get targetGraph(){const t=this.options.target;return Rb.isGraph(t)?t:t.graph}get targetModel(){return this.targetGraph.model}renderSearch(){return this.$("<div/>").addClass(this.prefixClassName(Ub.search)).append(this.$("<input/>").attr({type:"search",placeholder:this.options.placeholder||"Search"}).addClass(this.prefixClassName(Ub.searchText)))}startListening(){const t=this.prefixClassName(Ub.title),e=this.prefixClassName(Ub.searchText),n=this.prefixClassName(Ub.groupTitle);this.delegateEvents({[`click .${t}`]:"onTitleClick",[`touchstart .${t}`]:"onTitleClick",[`click .${n}`]:"onGroupTitleClick",[`touchstart .${n}`]:"onGroupTitleClick",[`input .${e}`]:"onSearch",[`focusin .${e}`]:"onSearchFocusIn",[`focusout .${e}`]:"onSearchFocusOut"}),Object.keys(this.graphs).forEach((t=>{const e=this.graphs[t];e.on("cell:mousedown",this.onDragStart,this)}))}stopListening(){this.undelegateEvents(),Object.keys(this.graphs).forEach((t=>{const e=this.graphs[t];e.off("cell:mousedown",this.onDragStart,this)}))}load(t,e){return Array.isArray(t)?this.loadGroup(t,e):this.options.groups&&Object.keys(this.options.groups).forEach((e=>{t[e]&&this.loadGroup(t[e],e)})),this}loadGroup(t,e){const n=this.getModel(e);if(n){const e=t.map((t=>Pm.isNode(t)?t:Pm.create(t)));n.resetCells(e)}const i=this.getGroup(e);let s=this.options.stencilGraphHeight;i&&null!=i.graphHeight&&(s=i.graphHeight);const o=i&&i.layout||this.options.layout;if(o&&n&&Ya(o,this,n,i),!s){const t=this.getGraph(e);t.fitToContent({minWidth:t.options.width,gridHeight:1,padding:i&&i.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(t){const{e:e,node:n}=t;this.dnd.start(n,e)}filter(t,e){const n=Object.keys(this.graphs).reduce(((n,i)=>{const s=this.graphs[i],o=i===Wb.defaultGroupName?null:i,r=s.model.getNodes().filter((n=>{let i=!1;i="function"===typeof e?Ya(e,this,n,t,o,this):"boolean"===typeof e?e:this.isCellMatched(n,t,e,t.toLowerCase()!==t);const r=s.renderer.findViewByCell(n);return r&&r.$(r.container).toggleClass("unmatched",!i),i})),a=r.length>0,l=this.options,c=new qm;return c.resetCells(r),l.layout&&Ya(l.layout,this,c,this.getGroup(i)),this.$groups[i]&&this.$groups[i].toggleClass("unmatched",!a),s.fitToContent({gridWidth:1,gridHeight:1,padding:l.stencilGraphPadding||10}),n||a}),!1);this.$container.toggleClass("not-found",!n)}isCellMatched(t,e,n,i){return!e||!n||Object.keys(n).some((s=>{if("*"===s||t.shape===s){const o=n[s];if("boolean"===typeof o)return o;const r=Array.isArray(o)?o:[o];return r.some((n=>{let s=t.getPropByPath(n);return null!=s&&(s=`${s}`,i||(s=s.toLowerCase()),s.indexOf(e)>=0)}))}return!1}))}onSearch(t){this.filter(t.target.value,this.options.search)}onSearchFocusIn(){this.$container.addClass("is-focused")}onSearchFocusOut(){this.$container.removeClass("is-focused")}onTitleClick(){this.options.collapsable&&(this.$container.toggleClass("collapsed"),this.$container.hasClass("collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(t){const e=this.$(t.target).closest(`.${this.prefixClassName(Ub.group)}`);this.toggleGroup(e.attr("data-name")||"");const n=Object.keys(this.$groups).every((t=>{const e=this.getGroup(t),n=this.$groups[t];return e&&!1===e.collapsable||n.hasClass("collapsed")}));this.$container.toggleClass("collapsed",n)}getModel(t){const e=this.getGraph(t);return e?e.model:null}getGraph(t){return this.graphs[t||Wb.defaultGroupName]}getGroup(t){const e=this.options.groups;return null!=t&&e&&e.length?e.find((e=>e.name===t)):null}toggleGroup(t){return this.isGroupCollapsed(t)?this.expandGroup(t):this.collapseGroup(t),this}collapseGroup(t){if(this.isGroupCollapsable(t)){const e=this.$groups[t];e&&!this.isGroupCollapsed(t)&&(this.trigger("group:collapse",{name:t}),e.addClass("collapsed"))}return this}expandGroup(t){if(this.isGroupCollapsable(t)){const e=this.$groups[t];e&&this.isGroupCollapsed(t)&&(this.trigger("group:expand",{name:t}),e.removeClass("collapsed"))}return this}isGroupCollapsable(t){const e=this.$groups[t];return e.hasClass("collapsable")}isGroupCollapsed(t){const e=this.$groups[t];return e&&e.hasClass("collapsed")}collapseGroups(){return Object.keys(this.$groups).forEach((t=>this.collapseGroup(t))),this}expandGroups(){return Object.keys(this.$groups).forEach((t=>this.expandGroup(t))),this}resizeGroup(t,e){const n=this.graphs[t];return n&&n.resize(e.width,e.height),this}onRemove(){Object.keys(this.graphs).forEach((t=>{const e=this.graphs[t];e.view.remove(),delete this.graphs[t]})),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}}(function(t){t.defaultOptions=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(t,e){const n={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};Xb(t,Object.assign(Object.assign(Object.assign({},n),this.options.layoutOptions),e?e.layoutOptions:{}))}},Zb.defaults)})(Yb||(Yb={})),function(t){t.base="widget-stencil",t.title=`${t.base}-title`,t.search=`${t.base}-search`,t.searchText=`${t.search}-text`,t.content=`${t.base}-content`,t.group=`${t.base}-group`,t.groupTitle=`${t.group}-title`,t.groupContent=`${t.group}-content`}(Ub||(Ub={})),function(t){t.defaultGroupName="__default__"}(Wb||(Wb={}));const Jb="1.32.2";function Kb(){if(Zd.trackable){const t="https://kcart.alipay.com/web/bi.do",e=new Image,n=Object.assign(Object.assign({},Zd.trackInfo),{version:Jb,pg:document.URL,r:(new Date).getTime(),x6:!0,page_type:"syslog"}),i=encodeURIComponent(JSON.stringify([n]));e.src=`${t}?BIProfile=merge&d=${i}`}}Zd.trackable&&setTimeout(Kb,3e3);const Qb={formatColumnType(t){const e=["timestamp","json","bool"];return null==t.decimalDigits||0==t.decimalDigits||e.some((e=>e==t.type.toLowerCase()))?t.type+"("+t.size+")":t.type+"("+t.size+", "+t.decimalDigits+")"},formatColumnName(t,e){return e&&t.comment&&""!=t.comment?t.name+" /* "+t.comment+" */":t.name}};String.prototype.byteLength=function(){var t=0;return Array.from(this).map((function(e){e.charCodeAt(0)>255?t+=2:t++})),t},String.prototype.pxWidth=function(){var t=String.prototype.pxWidth.canvas||(String.prototype.pxWidth.canvas=document.createElement("canvas")),e=t.getContext("2d");e.font="normal 12px ms";var n=e.measureText(this);return n.width};var tw={props:{modelData:Array,showComment:{default:!0}},data(){return{graph:null}},watch:{showComment:{deep:!0,handler(){this.graph.clearCells(),this.redendarUml(this.graph)}},modelData:{handler(){this.graph.clearCells(),this.redendarUml(this.graph)}}},mounted(){this.init()},methods:{init(){this.registerUmlNode();const t=this.createGraphInstance();this.redendarUml(t)},exportUml(t){"svg"==t?this.graph.toSVG((t=>{Wl.downloadDataUri(Wl.svgToDataUrl(t),"uml.svg")})):this.graph.toPNG((t=>{Wl.downloadDataUri(t,"uml.png")}),{padding:{top:20,right:30,bottom:40,left:50}})},redendarUml(t){const e=this.modelData.map((t=>({id:t.id,tableName:t.name,columns:t.columns,foreignKeys:t.foreignKeys})));let n=20,i=20;const s=60,o=60,r=5;let a=20;e.forEach(((e,l)=>{const c=this.calculateMaxHeightInGraphRow(20,e);a=c>a?c:a;let h=this.calculateMaxWidthInNode(e);const u=e.columns.map((t=>{const n=Qb.formatColumnType(t),i=Qb.formatColumnName(t,this.showComment);let s="YES"==t.nullable?"normal":"bold";return{id:e.tableName+"."+t.name,group:"columnGroup",attrs:{portBody:{width:h,height:30,refY:11},portNameLabel:{height:30,text:i,fontWeight:s,refY:11},portTypeLabel:{text:n,height:30,refY:11,refX:h-n.pxWidth()-22}}}}));t.addNode({id:e.tableName,x:n,y:i,shape:"er-rect",width:h,height:40,label:e.tableName,ports:u}),n+=h+s,(l+1)%r==0&&(i+=a+o,n=20)}));const l=e.map((t=>t.tableName));e.filter((t=>t.foreignKeys&&t.foreignKeys.length>0)).flatMap((t=>t.foreignKeys.filter((t=>-1!=l.indexOf(t.pkTableName))).map((e=>({shape:"er-edge",source:{cell:t.tableName,port:t.tableName+"."+e.fkColumnName},target:{cell:e.pkTableName,port:e.pkTableName+"."+e.pkColumnName}}))))).forEach((e=>t.addEdge(e)))},calculateMaxHeightInGraphRow(t,e){let n=30*e.columns.length+40;return t>n?t:n},calculateMaxWidthInNode(t){let e=t.tableName.pxWidth();return t.columns.forEach((t=>{const n=Qb.formatColumnType(t),i=Qb.formatColumnName(t,this.showComment);let s=80,o=s+i.pxWidth()+n.pxWidth();o>e&&(e=o)})),e},createGraphInstance(){const t=new Rb({container:document.getElementById("diagram-container"),grid:!0,panning:!0,snapline:!0,resizing:!1,keyboard:!0,mousewheel:{enabled:!0,modifiers:["ctrl","meta"]},selecting:{enabled:!0,showNodeSelectionBox:!0},connecting:{snap:!0,allowBlank:!1,allowEdge:!1,highlight:!0,interacting(){return{edgeMovable:!0}},createEdge(){return t.createEdge({shape:"er-edge",strokeDasharray:5,attrs:{line:{style:{animation:"ant-line 30s infinite linear"}}}})}}});return t.bindKey(["meta+z","ctrl+z"],(()=>(t.history.canUndo()&&t.history.undo(),!1))),t.bindKey(["meta+shift+z","ctrl+shift+z"],(()=>(t.history.canRedo()&&t.history.redo(),!1))),t.bindKey(["Backspace","Delete"],(()=>{const e=t.getSelectedCells();e.length&&t.removeCells(e)})),t.on("edge:mouseenter",(({edge:e})=>{e.attr("line/style/animation","running-line 30s infinite linear"),e.attr("line/strokeDasharray",5),this.changeUmlElementStyle(t,e)})),t.on("edge:mouseleave",(({edge:e})=>{e.attr("line/strokeDasharray",0),e.attr("line/style/animation",null),this.resetUmlElementStyle(t,e)})),t.on("edge:dblclick",(({cell:t,e:e})=>{t.addTools({name:"edge-editor",args:{event:e}})})),t.isHistoryEnabled()?t.disableHistory():t.enableHistory(),this.graph=t,t},changeUmlElementStyle(t,e){const n=t.getCellById(e.source.cell);n.setPortProp(e.source.port,"attrs/portNameLabel",{fill:"#409EFF"}),n.setPortProp(e.source.port,"attrs/portTypeLabel",{fill:"#409EFF"});const i=t.getCellById(e.target.cell);i&&(i.setPortProp(e.target.port,"attrs/portNameLabel",{fill:"#409EFF"}),i.setPortProp(e.target.port,"attrs/portTypeLabel",{fill:"#409EFF"}))},resetUmlElementStyle(t,e){const n=t.getCellById(e.source.cell);n.setPortProp(e.source.port,"attrs/portBody",{fill:"#FFF"}),n.setPortProp(e.source.port,"attrs/portNameLabel",{fill:"#303133"}),n.setPortProp(e.source.port,"attrs/portTypeLabel",{fill:"#303133"});const i=t.getCellById(e.target.cell);i&&(i.setPortProp(e.target.port,"attrs/portBody",{fill:"#FFF"}),i.setPortProp(e.target.port,"attrs/portNameLabel",{fill:"#303133"}),i.setPortProp(e.target.port,"attrs/portTypeLabel",{fill:"#303133"}))},registerUmlNode(){const t=30;Rb.registerPortLayout("erPortPosition",(e=>e.map(((e,n)=>({position:{x:0,y:(n+1)*t},angle:0})))),!0),Rb.registerEdge("er-edge",{inherit:"edge",strokeDasharray:5,connector:{name:"rounded"},router:{name:"manhattan",args:{step:10,maxDirectionChange:90}},attrs:{line:{targetMarker:{name:"classic",args:{size:7,offset:-2}}}},tools:{name:"segments",args:{stopPropagation:!1,precision:500,threshold:20,attrs:{fill:"#444"}}}},!0),Rb.registerNode("er-rect",{inherit:"rect",markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{rect:{strokeWidth:1,stroke:"#ddd",fill:"#f5f7fa"},label:{fontWeight:"bold",fill:"#000",fontSize:12}},ports:{groups:{columnGroup:{markup:[{tagName:"rect",selector:"portBody"},{tagName:"text",selector:"portNameLabel"},{tagName:"text",selector:"portTypeLabel"}],attrs:{portBody:{width:100,height:30,refY:20,strokeWidth:1,stroke:"#ddd",fill:"#FFF",magnet:!0},portNameLabel:{ref:"portBody",refX:6,refY:22,fontSize:12},portTypeLabel:{ref:"portBody",refX:95,refY:22,fontSize:12}},position:"erPortPosition"}}}},!0)}}},ew=n(83744);const nw=(0,ew.Z)(tw,[["render",rt]]);var iw=nw;const sw={class:"remark-header"},ow={class:"remark-user"},rw={class:"remark-time"},aw={class:"item text remark-content"},lw=(0,y.Uk)("提交");function cw(t,e,n,i,s,o){const r=(0,y.up)("el-button"),a=(0,y.up)("el-popconfirm"),l=(0,y.up)("el-card"),c=(0,y.up)("el-col"),h=(0,y.up)("el-row"),u=(0,y.up)("el-empty"),d=(0,y.up)("el-pagination"),g=(0,y.up)("el-divider"),p=(0,y.up)("el-input"),f=(0,y.up)("el-drawer"),m=(0,y.Q2)("require-roles");return(0,y.wg)(),(0,y.j4)(f,{modelValue:s.show,"onUpdate:modelValue":e[1]||(e[1]=t=>s.show=t),size:"50%"},{title:(0,y.w5)((()=>[(0,y._)("h2",null,(0,b.zw)(o.title),1)])),default:(0,y.w5)((()=>[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(s.pageData.content,((t,e)=>((0,y.wg)(),(0,y.j4)(h,{key:e},{default:(0,y.w5)((()=>[(0,y.Wm)(c,null,{default:(0,y.w5)((()=>[(0,y.Wm)(l,{shadow:"never",class:"remark-card"},{header:(0,y.w5)((()=>[(0,y._)("div",sw,[(0,y._)("span",null,[(0,y._)("span",ow,(0,b.zw)(t.discussBy.nickname),1),(0,y._)("span",rw,(0,b.zw)(t.createAt),1)]),(0,y.wy)(((0,y.wg)(),(0,y.iD)("span",null,[(0,y.Wm)(a,{"confirm-button-text":"确定","cancel-button-text":"取消",icon:"InfoFilled","icon-color":"red",title:"确定要删除该记录吗?",onConfirm:e=>o.onDeleteDiscussion(t.id)},{reference:(0,y.w5)((()=>[(0,y.Wm)(r,{type:"danger",icon:"Delete",circle:"",plain:"",size:"small"})])),_:2},1032,["onConfirm"])])),[[m,["SYS_OWNER","GROUP_OWNER?groupId="+n.groupId,"GROUP_MEMBER?groupId="+n.groupId]]])])])),default:(0,y.w5)((()=>[(0,y._)("div",aw,(0,b.zw)(t.content),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128)),0==s.pageData.content.length?((0,y.wg)(),(0,y.j4)(h,{key:0},{default:(0,y.w5)((()=>[(0,y.Wm)(c,null,{default:(0,y.w5)((()=>[(0,y.Wm)(u)])),_:1})])),_:1})):(0,y.kq)("",!0),(0,y.Wm)(h,null,{default:(0,y.w5)((()=>[(0,y.Wm)(c,null,{default:(0,y.w5)((()=>[(0,y.Wm)(d,{layout:"prev, pager, next","hide-on-single-page":!1,currentPage:s.pageData.page,"page-size":s.pageData.size,"page-count":s.pageData.totalPages,onCurrentChange:o.onPageChange},null,8,["currentPage","page-size","page-count","onCurrentChange"])])),_:1})])),_:1}),(0,y.Wm)(g),(0,y.wy)(((0,y.wg)(),(0,y.j4)(h,null,{default:(0,y.w5)((()=>[(0,y.Wm)(c,null,{default:(0,y.w5)((()=>[(0,y.Wm)(p,{modelValue:s.formData.content,"onUpdate:modelValue":e[0]||(e[0]=t=>s.formData.content=t),rows:5,type:"textarea",placeholder:"请输入内容"},null,8,["modelValue"])])),_:1})])),_:1})),[[m,["SYS_OWNER","GROUP_OWNER?groupId="+this.groupId,"GROUP_MEMBER?groupId="+this.groupId]]]),(0,y.Wm)(g),(0,y.wy)(((0,y.wg)(),(0,y.j4)(h,null,{default:(0,y.w5)((()=>[(0,y.Wm)(c,null,{default:(0,y.w5)((()=>[(0,y.Wm)(r,{onClick:o.onCreateDiscussion},{default:(0,y.w5)((()=>[lw])),_:1},8,["onClick"])])),_:1})])),_:1})),[[m,["SYS_OWNER","GROUP_OWNER?groupId="+this.groupId,"GROUP_MEMBER?groupId="+this.groupId]]])])),_:1},8,["modelValue"])}const hw="/api/v1.0",uw=(t,e,n)=>W.Z["delete"](hw+"/groups/"+t+"/projects/"+e+"/discussions/"+n),dw=(t,e,n)=>W.Z.post(hw+"/groups/"+t+"/projects/"+e+"/discussions",n),gw=(t,e,n)=>W.Z.get(hw+"/groups/"+t+"/projects/"+e+"/discussions",{params:n});var pw={props:["groupId","projectId","tableName","columnName","isShowDrawer"],emits:["onClose"],data(){return{formData:{content:null},pageFilter:{page:0,size:5,tableName:null,columnName:null},pageData:{content:[],page:0,size:10,totalPages:0},show:this.isShowDrawer}},computed:{title(){const t=this.columnName?"."+this.columnName:"";return"["+this.tableName+t+"]"}},watch:{isShowDrawer:{deep:!1,handler(t){t&&this.showDiscussionDrawer()}},show:{deep:!1,handler(t){t?this.showDiscussionDrawer():this.closeDiscussionDrawer(t)}}},methods:{onCreateDiscussion(){if(!this.formData.content||""==this.formData.content)return void this.$message.error("内容不能为空");const t={tableName:this.pageFilter.tableName,columnName:this.pageFilter.columnName,content:this.formData.content};dw(this.groupId,this.projectId,t).then((t=>{t.errCode||(this.formData.content=null,this.$message.success("提交成功"),this.onPageChange(1))}))},onDeleteDiscussion(t){uw(this.groupId,this.projectId,t).then((t=>{t.errCode||(this.$message.success("删除成功"),this.onPageChange(1))}))},onPageChange(t){this.pageFilter.page=t-1,gw(this.groupId,this.projectId,this.pageFilter).then((t=>{this.pageData=t.data,this.pageData.page=t.data.number+1}))},showDiscussionDrawer(){this.tableName?this.pageFilter.tableName=this.tableName:this.pageFilter.tableName=null,this.columnName?this.pageFilter.columnName=this.columnName:this.pageFilter.columnName=null,gw(this.groupId,this.projectId,this.pageFilter).then((t=>{this.pageData=t.data,this.pageData.page=t.data.number+1,this.show=!0}))},closeDiscussionDrawer(){this.$emit("onClose",this.show)}}};const fw=(0,ew.Z)(pw,[["render",cw]]);var mw=fw;const yw=(0,y.Uk)("新增"),bw=(0,y.Uk)("删除"),ww=(0,y.Uk)("修改"),Cw=(0,y.Uk)("无变化"),vw=(0,y._)("div",{id:"overview[-1]",class:"h2"},"Overview",-1),xw={key:1,id:"overview[-1]",class:"h2"},kw=(0,y._)("div",{class:"h3"},"Tables",-1),Ew={key:0},Mw={key:0},Sw=["id"],Aw={key:0,class:"table-quote"},Dw=(0,y._)("svg",{t:"1649948233819",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7285",width:"16",height:"16"},[(0,y._)("path",{d:"M195.2 458.24a259.84 259.84 0 0 1 177.92-160c92.16-29.44 47.04-128-34.56-102.72C146.56 249.28 32 395.52 32 586.56 32 736 117.12 832 249.28 832s215.04-79.68 215.04-203.52c0-177.28-168-219.52-269.12-170.24z m527.68 0a259.84 259.84 0 0 1 177.92-160c91.2-29.12 48-128-34.56-102.72-192 54.08-306.56 200-306.56 391.36 0 149.12 85.44 245.12 217.28 245.12S992 752.32 992 628.48c0-176.64-167.04-219.84-269.12-170.24z",fill:"#909399","p-id":"7286"})],-1),Pw={key:1,class:"table-quote"},Ow=(0,y._)("svg",{t:"1649948233819",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7285",width:"16",height:"16"},[(0,y._)("path",{d:"M195.2 458.24a259.84 259.84 0 0 1 177.92-160c92.16-29.44 47.04-128-34.56-102.72C146.56 249.28 32 395.52 32 586.56 32 736 117.12 832 249.28 832s215.04-79.68 215.04-203.52c0-177.28-168-219.52-269.12-170.24z m527.68 0a259.84 259.84 0 0 1 177.92-160c91.2-29.12 48-128-34.56-102.72-192 54.08-306.56 200-306.56 391.36 0 149.12 85.44 245.12 217.28 245.12S992 752.32 992 628.48c0-176.64-167.04-219.84-269.12-170.24z",fill:"#909399","p-id":"7286"})],-1),Tw={key:2,style:{color:"#c8c9cc"},class:"table-quote"},Nw=(0,y._)("svg",{t:"1649948233819",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7285",width:"16",height:"16"},[(0,y._)("path",{d:"M195.2 458.24a259.84 259.84 0 0 1 177.92-160c92.16-29.44 47.04-128-34.56-102.72C146.56 249.28 32 395.52 32 586.56 32 736 117.12 832 249.28 832s215.04-79.68 215.04-203.52c0-177.28-168-219.52-269.12-170.24z m527.68 0a259.84 259.84 0 0 1 177.92-160c91.2-29.12 48-128-34.56-102.72-192 54.08-306.56 200-306.56 391.36 0 149.12 85.44 245.12 217.28 245.12S992 752.32 992 628.48c0-176.64-167.04-219.84-269.12-170.24z",fill:"#909399","p-id":"7286"})],-1),jw=["id"],Fw=(0,y.Uk)("Insert"),Lw={key:0,class:"table-quote"},zw=(0,y._)("svg",{t:"1649948233819",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7285",width:"16",height:"16"},[(0,y._)("path",{d:"M195.2 458.24a259.84 259.84 0 0 1 177.92-160c92.16-29.44 47.04-128-34.56-102.72C146.56 249.28 32 395.52 32 586.56 32 736 117.12 832 249.28 832s215.04-79.68 215.04-203.52c0-177.28-168-219.52-269.12-170.24z m527.68 0a259.84 259.84 0 0 1 177.92-160c91.2-29.12 48-128-34.56-102.72-192 54.08-306.56 200-306.56 391.36 0 149.12 85.44 245.12 217.28 245.12S992 752.32 992 628.48c0-176.64-167.04-219.84-269.12-170.24z",fill:"#909399","p-id":"7286"})],-1),Iw={key:0},Bw={key:1,class:"table-quote"},Rw=(0,y._)("svg",{t:"1649948233819",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7285",width:"16",height:"16"},[(0,y._)("path",{d:"M195.2 458.24a259.84 259.84 0 0 1 177.92-160c92.16-29.44 47.04-128-34.56-102.72C146.56 249.28 32 395.52 32 586.56 32 736 117.12 832 249.28 832s215.04-79.68 215.04-203.52c0-177.28-168-219.52-269.12-170.24z m527.68 0a259.84 259.84 0 0 1 177.92-160c91.2-29.12 48-128-34.56-102.72-192 54.08-306.56 200-306.56 391.36 0 149.12 85.44 245.12 217.28 245.12S992 752.32 992 628.48c0-176.64-167.04-219.84-269.12-170.24z",fill:"#909399","p-id":"7286"})],-1),$w={key:0,class:"h3"},Vw=(0,y.Uk)(" PK "),_w=(0,y.Uk)(" YES "),Gw=(0,y.Uk)(" NO "),Hw=(0,y.Uk)(" YES "),Uw=(0,y.Uk)(" NO "),Ww=(0,y.Uk)(" null "),qw={key:1},Zw={key:0},Xw={key:1},Yw=(0,y._)("div",{class:"h3"},"Indexes",-1),Jw=(0,y.Uk)(" UK "),Kw={key:2},Qw=(0,y._)("div",{class:"h3"},"Foreign Keys",-1),tC={key:3},eC=(0,y._)("div",{class:"h3"},"Triggers",-1),nC={style:{"min-height":"120px"}},iC=(0,y.Uk)("保存");function sC(t,e,n,i,s,o){const r=(0,y.up)("el-tag"),a=(0,y.up)("el-space"),l=(0,y.up)("el-col"),c=(0,y.up)("el-row"),h=(0,y.up)("el-badge"),u=(0,y.up)("el-descriptions-item"),d=(0,y.up)("el-descriptions"),g=(0,y.up)("vxe-column"),p=(0,y.up)("el-input"),f=(0,y.up)("el-button"),m=(0,y.up)("vxe-table"),w=(0,y.up)("el-table-column"),C=(0,y.up)("el-table"),v=(0,y.up)("el-tooltip"),x=(0,y.up)("el-link"),k=(0,y.up)("el-backtop"),E=(0,y.up)("highlightjs"),M=(0,y.up)("el-tab-pane"),S=(0,y.up)("el-option"),A=(0,y.up)("el-select"),D=(0,y.up)("el-tabs"),P=(0,y.up)("el-dialog"),O=(0,y.Q2)("clipboard");return(0,y.wg)(),(0,y.iD)(y.HY,null,[n.diffEnabled?((0,y.wg)(),(0,y.j4)(c,{key:0,style:{"margin-bottom":"12px"}},{default:(0,y.w5)((()=>[(0,y.Wm)(l,null,{default:(0,y.w5)((()=>[(0,y.Wm)(a,null,{default:(0,y.w5)((()=>[(0,y.Wm)(r,{type:"success"},{default:(0,y.w5)((()=>[yw])),_:1}),(0,y.Wm)(r,{type:"danger"},{default:(0,y.w5)((()=>[bw])),_:1}),(0,y.Wm)(r,{type:"warning"},{default:(0,y.w5)((()=>[ww])),_:1}),(0,y.Wm)(r,{type:"info"},{default:(0,y.w5)((()=>[Cw])),_:1})])),_:1})])),_:1})])),_:1})):(0,y.kq)("",!0),n.overviewData?((0,y.wg)(),(0,y.j4)(c,{key:1,style:{"margin-top":"0px !important"}},{default:(0,y.w5)((()=>[(0,y.Wm)(l,{span:24},{default:(0,y.w5)((()=>[n.diffEnabled?((0,y.wg)(),(0,y.j4)(h,{key:0,value:n.overviewData.diffType,type:o.diffTagType(n.overviewData.diffType),class:"badge-item"},{default:(0,y.w5)((()=>[vw])),_:1},8,["value","type"])):((0,y.wg)(),(0,y.iD)("div",xw,"Overview")),(0,y.Wm)(d,{column:1,size:"large",border:""},{default:(0,y.w5)((()=>[(0,y.Wm)(u,{label:"Database Name","label-align":"left",width:"200px"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(n.overviewData.databaseName),1)])),_:1}),(0,y.Wm)(u,{label:"Schema Name","label-align":"left",width:"200px"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(n.overviewData.schemaName),1)])),_:1}),(0,y.Wm)(u,{label:"Product Name","label-align":"left"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(n.overviewData.productName),1)])),_:1}),(0,y.Wm)(u,{label:"Product Version","label-align":"left"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(n.overviewData.productVersion),1)])),_:1}),(0,y.Wm)(u,{label:"Document Version","label-align":"left"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(n.overviewData.documentVersion),1)])),_:1}),(0,y.Wm)(u,{label:"Create At","label-align":"left"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(n.overviewData.createAt),1)])),_:1})])),_:1}),kw,o.simpleTables.length>s.useVirtualTableThreshold?((0,y.wg)(),(0,y.j4)(m,{key:2,border:"inner",data:o.simpleTables,"max-height":"800","tree-config":{transform:!0,expandAll:!1,rowField:"id",parentField:"parentId"},"row-class-name":o.predicateRowClass,"row-config":{isHover:!0,height:60},"edit-config":{trigger:"dblclick",mode:"cell"}},{default:(0,y.w5)((()=>[(0,y.Wm)(g,{type:"seq",width:"60"}),(0,y.Wm)(g,{field:"name",title:o.tableFieldNameMapping("name"),"tree-node":""},{default:(0,y.w5)((({row:t})=>[(0,y._)("span",null,(0,b.zw)(t.name),1)])),_:1},8,["title"]),(0,y.Wm)(g,{field:"type",title:o.tableFieldNameMapping("type")},null,8,["title"]),(0,y.Wm)(g,{field:"comment",title:o.tableFieldNameMapping("comment")},null,8,["title"]),(0,y.Wm)(g,{field:"description",title:o.tableFieldNameMapping("description"),"edit-render":{name:"textarea"}},{edit:(0,y.w5)((({row:t})=>[(0,y.Wm)(p,{modelValue:t.description,"onUpdate:modelValue":e=>t.description=e,type:"textarea",style:{width:"100%","z-index":"1000"},autosize:"",rows:10,"input-style":s.style.noBorderInput,onChange:e=>o.onUpdateDescription(t.name,null,t)},null,8,["modelValue","onUpdate:modelValue","input-style","onChange"])])),_:1},8,["title"]),(0,y.Wm)(g,{field:"remark",title:"讨论"},{default:(0,y.w5)((({row:t})=>[t.discussionCount?((0,y.wg)(),(0,y.j4)(h,{key:0,value:t.discussionCount,max:99,class:"item",type:"info"},{default:(0,y.w5)((()=>[(0,y.Wm)(f,{onClick:e=>o.onRemark(t.name),size:"small",icon:"chat-line-round"},null,8,["onClick"])])),_:2},1032,["value"])):((0,y.wg)(),(0,y.j4)(f,{key:1,onClick:e=>o.onRemark(t.name),size:"small",icon:"chat-line-round"},null,8,["onClick"]))])),_:1})])),_:1},8,["data","row-class-name"])):((0,y.wg)(),(0,y.j4)(C,{key:3,data:o.simpleTables,border:"",width:"80%",onRowDblclick:o.onCellClick,"row-class-name":o.predicateRowClass,"highlight-current-row":"","row-key":"id"},{default:(0,y.w5)((()=>[(0,y.Wm)(w,{type:"index"}),(0,y.Wm)(w,{label:o.tableFieldNameMapping("name"),"min-width":"160",resizable:""},{default:(0,y.w5)((t=>[(0,y._)("span",null,(0,b.zw)(t.row.name),1)])),_:1},8,["label"]),(0,y.Wm)(w,{prop:"type",label:o.tableFieldNameMapping("type"),width:"200",resizable:""},null,8,["label"]),(0,y.Wm)(w,{prop:"comment",label:o.tableFieldNameMapping("comment"),"min-width":"160",resizable:""},null,8,["label"]),(0,y.Wm)(w,{label:o.tableFieldNameMapping("description"),"min-width":"160",resizable:""},{default:(0,y.w5)((t=>[t.row.toEditDescription?((0,y.wg)(),(0,y.j4)(a,{key:1,direction:"vertical",alignment:"left",style:{width:"100%"}},{default:(0,y.w5)((()=>[(0,y.Wm)(p,{modelValue:t.row.description,"onUpdate:modelValue":e=>t.row.description=e,type:"textarea",style:{width:"100%"},autosize:"","input-style":s.style.noBorderInput,onChange:e=>o.onUpdateDescription(t.row.name,null,t.row)},null,8,["modelValue","onUpdate:modelValue","input-style","onChange"])])),_:2},1024)):((0,y.wg)(),(0,y.iD)("span",Ew,(0,b.zw)(t.row.description),1))])),_:1},8,["label"]),(0,y.Wm)(w,{prop:"remark",label:"讨论","min-width":"120",resizable:""},{default:(0,y.w5)((t=>[t.row.discussionCount?((0,y.wg)(),(0,y.j4)(h,{key:0,value:t.row.discussionCount,max:99,class:"item",type:"info"},{default:(0,y.w5)((()=>[(0,y.Wm)(f,{onClick:e=>o.onRemark(t.row.name),size:"small",icon:"chat-line-round"},null,8,["onClick"])])),_:2},1032,["value"])):((0,y.wg)(),(0,y.j4)(f,{key:1,onClick:e=>o.onRemark(t.row.name),size:"small",icon:"chat-line-round"},null,8,["onClick"]))])),_:1})])),_:1},8,["data","onRowDblclick","row-class-name"]))])),_:1})])),_:1})):(0,y.kq)("",!0),((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(o.tables,(t=>((0,y.wg)(),(0,y.j4)(c,{key:t.id,style:{"margin-top":"0px !important"}},{default:(0,y.w5)((()=>[(0,y.Wm)(l,{span:24},{default:(0,y.w5)((()=>[(0,y._)("div",null,[n.diffEnabled?((0,y.wg)(),(0,y.iD)("div",Mw,[(0,y.Wm)(h,{value:t.diffType,type:o.diffTagType(t.diffType),class:"badge-item"},{default:(0,y.w5)((()=>[(0,y._)("div",{id:t.name+"["+t.id+"]",class:"h2"},(0,b.zw)(t.name),9,Sw)])),_:2},1032,["value","type"]),t.comment&&""!=t.comment?((0,y.wg)(),(0,y.iD)("div",Aw,[Dw,(0,y.Uk)(" "+(0,b.zw)(t.comment),1)])):t.description&&""!=t.description?((0,y.wg)(),(0,y.iD)("div",Pw,[Ow,(0,y.Uk)(" "+(0,b.zw)(t.description),1)])):(0,y.kq)("",!0),n.diffEnabled&&t.original&&t.original.comment!=t.comment?((0,y.wg)(),(0,y.iD)("div",Tw,[(0,y._)("del",null,[Nw,(0,y.Uk)(" "+(0,b.zw)(t.original.comment),1)])])):(0,y.kq)("",!0)])):((0,y.wg)(),(0,y.iD)("div",{key:1,id:t.name+"["+t.id+"]",class:"h2"},[(0,y.Uk)((0,b.zw)(t.name)+" ",1),(0,y.Wm)(v,{content:"SQL 测试数据生成"},{default:(0,y.w5)((()=>[(0,y.Wm)(f,{onClick:e=>o.showMockDataRules(t),round:"",size:"small"},{default:(0,y.w5)((()=>[Fw])),_:2},1032,["onClick"])])),_:2},1024),t.comment&&""!=t.comment?((0,y.wg)(),(0,y.iD)("div",Lw,[zw,(0,y.Uk)(" "+(0,b.zw)(t.comment)+" ",1),n.diffEnabled&&t.original&&t.original.comment!=t.comment?((0,y.wg)(),(0,y.iD)("span",Iw,[(0,y._)("em",null,(0,b.zw)(t.original.comment),1)])):(0,y.kq)("",!0)])):t.description&&""!=t.description?((0,y.wg)(),(0,y.iD)("div",Bw,[Rw,(0,y.Uk)(" "+(0,b.zw)(t.description),1)])):(0,y.kq)("",!0)],8,jw))]),t.columns.length>0?((0,y.wg)(),(0,y.iD)("div",$w," Columns ")):(0,y.kq)("",!0),(0,y.Wm)(C,{data:t.columns,border:"",fit:"",width:"80%",onCellDblclick:o.onCellClick,"row-class-name":o.predicateRowClass,"default-expand-all":"","row-key":"id","highlight-current-row":""},{default:(0,y.w5)((()=>[(0,y.Wm)(w,{type:"index"}),(0,y.Wm)(w,{prop:"name",label:o.columnFieldNameMapping("name"),"min-width":"120"},{default:(0,y.w5)((t=>[(0,y._)("span",null,(0,b.zw)(t.row.name),1)])),_:1},8,["label"]),(0,y.Wm)(w,{prop:"type",label:o.columnFieldNameMapping("type")},null,8,["label"]),(0,y.Wm)(w,{prop:"size",label:o.columnFieldNameMapping("size")},null,8,["label"]),(0,y.Wm)(w,{prop:"decimalDigits",label:o.columnFieldNameMapping("decimalDigits")},null,8,["label"]),(0,y.Wm)(w,{width:"120",label:o.columnFieldNameMapping("isPrimaryKey")},{default:(0,y.w5)((t=>[t.row.isPrimaryKey?((0,y.wg)(),(0,y.j4)(v,{key:0,content:"YES"},{default:(0,y.w5)((()=>[(0,y.Wm)(r,null,{default:(0,y.w5)((()=>[Vw])),_:1})])),_:1})):(0,y.kq)("",!0)])),_:1},8,["label"]),(0,y.Wm)(w,{prop:"nullable",label:o.columnFieldNameMapping("nullable"),width:"120"},{default:(0,y.w5)((t=>["YES"==t.row.nullable?((0,y.wg)(),(0,y.j4)(r,{key:0,type:"primary"},{default:(0,y.w5)((()=>[_w])),_:1})):((0,y.wg)(),(0,y.j4)(r,{key:1,type:"info"},{default:(0,y.w5)((()=>[Gw])),_:1}))])),_:1},8,["label"]),(0,y.Wm)(w,{prop:"autoIncrement",label:o.columnFieldNameMapping("autoIncrement"),width:"140"},{default:(0,y.w5)((t=>["YES"==t.row.autoIncrement?((0,y.wg)(),(0,y.j4)(r,{key:0},{default:(0,y.w5)((()=>[Hw])),_:1})):((0,y.wg)(),(0,y.j4)(r,{key:1,type:"info"},{default:(0,y.w5)((()=>[Uw])),_:1}))])),_:1},8,["label"]),(0,y.Wm)(w,{prop:"defaultValue",label:o.columnFieldNameMapping("defaultValue"),"min-width":"120"},{default:(0,y.w5)((t=>["YES"==t.row.nullable&&null==t.row.defaultValue?((0,y.wg)(),(0,y.j4)(r,{key:0,type:"danger"},{default:(0,y.w5)((()=>[Ww])),_:1})):((0,y.wg)(),(0,y.iD)("span",qw,(0,b.zw)(t.row.defaultValue),1))])),_:1},8,["label"]),(0,y.Wm)(w,{prop:"comment",label:o.columnFieldNameMapping("comment")},null,8,["label"]),(0,y.Wm)(w,{label:o.columnFieldNameMapping("description"),"min-width":"160",resizable:"","show-overflow-tooltip":""},{default:(0,y.w5)((e=>[e.row.toEditDescription?((0,y.wg)(),(0,y.j4)(a,{key:1,direction:"vertical",alignment:"left",style:{width:"100%"}},{default:(0,y.w5)((()=>[(0,y.Wm)(p,{modelValue:e.row.description,"onUpdate:modelValue":t=>e.row.description=t,type:"textarea",style:{width:"100%"},autosize:"","input-style":s.style.noBorderInput,onChange:n=>o.onUpdateDescription(t.name,e.row.name,e.row)},null,8,["modelValue","onUpdate:modelValue","input-style","onChange"])])),_:2},1024)):((0,y.wg)(),(0,y.iD)("span",Zw,[(0,y._)("pre",null,(0,b.zw)(e.row.description),1)]))])),_:2},1032,["label"]),(0,y.Wm)(w,{prop:"remark",label:"讨论","min-width":"60",resizable:""},{default:(0,y.w5)((e=>[e.row.discussionCount?((0,y.wg)(),(0,y.j4)(h,{key:0,value:e.row.discussionCount,max:99,class:"item",type:"info"},{default:(0,y.w5)((()=>[(0,y.Wm)(f,{onClick:n=>o.onRemark(t.name,e.row.name),size:"small",icon:"chat-line-round"},null,8,["onClick"])])),_:2},1032,["value"])):((0,y.wg)(),(0,y.j4)(f,{key:1,onClick:n=>o.onRemark(t.name,e.row.name),size:"small",icon:"chat-line-round"},null,8,["onClick"]))])),_:2},1024)])),_:2},1032,["data","onCellDblclick","row-class-name"]),t.indexes.length>0?((0,y.wg)(),(0,y.iD)("div",Xw,[Yw,(0,y.Wm)(C,{data:t.indexes,border:"",fit:"",width:"80%","row-class-name":o.predicateRowClass,"default-expand-all":"","row-key":"id","highlight-current-row":""},{default:(0,y.w5)((()=>[(0,y.Wm)(w,{type:"index"}),(0,y.Wm)(w,{prop:"name",label:o.indexFieldNameMapping("name"),"min-width":"120"},{default:(0,y.w5)((t=>[(0,y._)("span",null,(0,b.zw)(t.row.name),1)])),_:1},8,["label"]),(0,y.Wm)(w,{prop:"isUnique",label:o.indexFieldNameMapping("isUnique"),width:"120"},{default:(0,y.w5)((t=>[t.row.isUnique?((0,y.wg)(),(0,y.j4)(v,{key:0,content:"YES"},{default:(0,y.w5)((()=>[(0,y.Wm)(r,null,{default:(0,y.w5)((()=>[Jw])),_:1})])),_:1})):(0,y.kq)("",!0)])),_:1},8,["label"]),(0,y.Wm)(w,{label:o.indexFieldNameMapping("columnNames"),"min-width":"150"},{default:(0,y.w5)((t=>[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(t.row.columnNames,((t,e)=>((0,y.wg)(),(0,y.j4)(r,{key:e,type:"info",style:{"margin-right":"12px","margin-bottom":"6px"}},{default:(0,y.w5)((()=>[(0,y._)("span",null,(0,b.zw)(t),1)])),_:2},1024)))),128))])),_:1},8,["label"])])),_:2},1032,["data","row-class-name"])])):(0,y.kq)("",!0),t.foreignKeys.length>0?((0,y.wg)(),(0,y.iD)("div",Kw,[Qw,(0,y.Wm)(C,{data:t.foreignKeys,border:"",fit:"",width:"80%","row-class-name":o.predicateRowClass,"default-expand-all":"","row-key":"id","highlight-current-row":""},{default:(0,y.w5)((()=>[(0,y.Wm)(w,{type:"index"}),(0,y.Wm)(w,{prop:"fkName",label:o.foreignKeyFieldNameMapping("fkName"),"min-width":"120"},{default:(0,y.w5)((t=>[(0,y._)("span",null,(0,b.zw)(t.row.fkName),1)])),_:1},8,["label"]),(0,y.Wm)(w,{prop:"fkColumnName",label:o.foreignKeyFieldNameMapping("fkColumnName"),"min-width":"120"},{default:(0,y.w5)((t=>[(0,y.Wm)(r,{type:"info"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(t.row.fkColumnName),1)])),_:2},1024)])),_:1},8,["label"]),(0,y.Wm)(w,{prop:"pkName",label:o.foreignKeyFieldNameMapping("pkName"),"min-width":"120"},null,8,["label"]),(0,y.Wm)(w,{prop:"pkTableName",label:o.foreignKeyFieldNameMapping("pkTableName")},{default:(0,y.w5)((t=>[(0,y.Wm)(x,null,{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(t.row.pkTableName),1)])),_:2},1024)])),_:1},8,["label"]),(0,y.Wm)(w,{prop:"pkColumnName",label:o.foreignKeyFieldNameMapping("pkColumnName"),"min-width":"120"},{default:(0,y.w5)((t=>[(0,y.Wm)(r,{type:"info"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(t.row.pkColumnName),1)])),_:2},1024)])),_:1},8,["label"]),(0,y.Wm)(w,{prop:"updateRule",label:o.foreignKeyFieldNameMapping("updateRule")},null,8,["label"]),(0,y.Wm)(w,{prop:"deleteRule",label:o.foreignKeyFieldNameMapping("deleteRule")},null,8,["label"])])),_:2},1032,["data","row-class-name"])])):(0,y.kq)("",!0),t.triggers.length>0?((0,y.wg)(),(0,y.iD)("div",tC,[eC,(0,y.Wm)(C,{data:t.triggers,fit:"",border:"",width:"80%","row-class-name":o.predicateRowClass,"default-expand-all":"","row-key":"id","highlight-current-row":""},{default:(0,y.w5)((()=>[(0,y.Wm)(w,{type:"index"}),(0,y.Wm)(w,{prop:"name",label:o.triggerFieldNameMapping("name"),"min-width":"120"},null,8,["label"]),(0,y.Wm)(w,{prop:"timing",label:o.triggerFieldNameMapping("timing")},null,8,["label"]),(0,y.Wm)(w,{prop:"manipulation",label:o.triggerFieldNameMapping("manipulation"),width:"120"},null,8,["label"]),(0,y.Wm)(w,{prop:"statement",label:o.triggerFieldNameMapping("statement")},null,8,["label"]),(0,y.Wm)(w,{prop:"triggerCreateAt",label:o.triggerFieldNameMapping("triggerCreateAt"),width:"150"},null,8,["label"])])),_:2},1032,["data","row-class-name"])])):(0,y.kq)("",!0)])),_:2},1024)])),_:2},1024)))),128)),(0,y.Wm)(k,{right:100,bottom:100}),(0,y.Wm)(P,{title:s.mockTableName,modelValue:s.showMockDataDialog,"onUpdate:modelValue":e[2]||(e[2]=t=>s.showMockDataDialog=t),width:"60%"},{footer:(0,y.w5)((()=>[])),default:(0,y.w5)((()=>[(0,y.Wm)(D,{"model-value":"mockDataPane"},{default:(0,y.w5)((()=>[(0,y.Wm)(M,{label:"SQL 测试数据",name:"mockDataPane"},{default:(0,y.w5)((()=>[(0,y._)("div",nC,[(0,y.Wm)(E,{language:"sql",code:s.mockDataSql},null,8,["code"]),(0,y.Wm)(v,{content:"点击复制"},{default:(0,y.w5)((()=>[(0,y.wy)((0,y.Wm)(f,{icon:"copy-document",type:"primary",text:"",class:"copy-button",onClick:e[0]||(e[0]=t=>o.copyMockSql())},null,512),[[O,s.mockDataSql,"copy"],[O,o.handleCopySuccess,"success"],[O,o.handleCopyFail,"error"]])])),_:1})])])),_:1}),(0,y.Wm)(M,{label:"生成规则",name:"mockRulePane"},{default:(0,y.w5)((()=>[(0,y.Wm)(C,{data:s.mockDataRules},{default:(0,y.w5)((()=>[(0,y.Wm)(w,{prop:"columnName",label:"名称"}),(0,y.Wm)(w,{prop:"columnType",label:"类型"},{default:(0,y.w5)((t=>[(0,y.Wm)(r,null,{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(t.row.columnType),1)])),_:2},1024)])),_:1}),(0,y.Wm)(w,{prop:"mockDataType",label:"Mock 类型"},{default:(0,y.w5)((t=>[(0,y.Wm)(A,{modelValue:t.row.mockDataType,"onUpdate:modelValue":e=>t.row.mockDataType=e,placeholder:"请选择 Mock 类型"},{default:(0,y.w5)((()=>[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(s.mockDataTypes,(t=>((0,y.wg)(),(0,y.j4)(S,{key:t.value,label:t.name,value:t.value},null,8,["label","value"])))),128))])),_:2},1032,["modelValue","onUpdate:modelValue"])])),_:1}),(0,y.Wm)(w,{prop:"dependentTableName",label:"依赖表"},{default:(0,y.w5)((t=>["REF"==t.row.mockDataType?((0,y.wg)(),(0,y.j4)(A,{key:0,modelValue:t.row.dependentTableName,"onUpdate:modelValue":e=>t.row.dependentTableName=e,placeholder:"选择关联表",onChange:e=>t.row.dependentColumnName=null},{default:(0,y.w5)((()=>[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(s.mockRefTables,(t=>((0,y.wg)(),(0,y.j4)(S,{key:t.name,label:t.name,value:t.name},null,8,["label","value"])))),128))])),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):(0,y.kq)("",!0)])),_:1}),(0,y.Wm)(w,{prop:"dependentColumnName",label:"依赖列"},{default:(0,y.w5)((t=>["REF"==t.row.mockDataType?((0,y.wg)(),(0,y.j4)(A,{key:0,modelValue:t.row.dependentColumnName,"onUpdate:modelValue":e=>t.row.dependentColumnName=e,placeholder:"选择关联列"},{default:(0,y.w5)((()=>[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(o.mockRefColumns(t.row.dependentTableName),(t=>((0,y.wg)(),(0,y.j4)(S,{key:t.name,label:t.name,value:t.name},null,8,["label","value"])))),128))])),_:2},1032,["modelValue","onUpdate:modelValue"])):(0,y.kq)("",!0)])),_:1}),(0,y.Wm)(w,{prop:"mockDataScript",label:"脚本"},{default:(0,y.w5)((t=>["SCRIPT"==t.row.mockDataType?((0,y.wg)(),(0,y.j4)(p,{key:0,modelValue:t.row.mockDataScript,"onUpdate:modelValue":e=>t.row.mockDataScript=e,autosize:{minRows:2,maxRows:4},type:"textarea",placeholder:"表达式"},null,8,["modelValue","onUpdate:modelValue"])):(0,y.kq)("",!0)])),_:1})])),_:1},8,["data"]),(0,y.Wm)(f,{style:{"margin-top":"33px"},onClick:e[1]||(e[1]=t=>o.saveTableMockRules())},{default:(0,y.w5)((()=>[iC])),_:1})])),_:1})])),_:1})])),_:1},8,["title","modelValue"])],64)}const oC="/api/v1.0",rC=(t,e,n)=>W.Z.post(oC+"/groups/"+t+"/projects/"+e+"/descriptions",n);var aC=n(64339),lC=n(76631);const cC="/api/v1.0",hC=(t,e,n)=>W.Z.get(cC+"/groups/"+t+"/projects/"+e+"/mock_rules",{params:n}),uC=(t,e,n,i)=>W.Z.post(cC+"/groups/"+t+"/projects/"+e+"/tables/"+n+"/mock_rules",i),dC=(t,e,n)=>W.Z.get(cC+"/groups/"+t+"/projects/"+e+"/mock_data/sql",{params:n});var gC={props:["overviewData","tablesData","diffEnabled","docVersion"],emits:["onRemark"],data(){return{templateProperties:{tableFieldNameMap:new Map,columnFieldNameMap:new Map,indexFieldNameMap:new Map,triggerFieldNameMap:new Map,foreignKeyFieldNameMap:new Map},showMockDataDialog:!1,mockDataRules:[],mockRefTables:[],mockDataTypes:[{name:"自动",value:"AUTO",icon:"Sunny"},{name:"关联",value:"REF"},{name:"脚本",value:"SCRIPT"},{name:"手机号",value:"PHONE",icon:"cellphone"},{name:"头像",value:"AVATAR_URL",icon:"avatar"},{name:"UUID",value:"UUID"},{name:"邮箱",value:"EMAIL",icon:"box"},{name:"姓名",value:"FULL_NAME",icon:"credit-card"},{name:"地址",value:"FULL_ADDRESS"}],mockTableId:null,mockTableName:"",mockDataSql:"",style:{noBorderInput:{border:"none"}},useVirtualTableThreshold:500}},created(){const t=sessionStorage.getItem(aC.b0);if(t){const t=JSON.parse(sessionStorage.getItem(aC.b0)),e=new Map(t.tableFieldNameProperties.map((t=>[t.key,t]))),n=new Map(t.columnFieldNameProperties.map((t=>[t.key,t]))),i=new Map(t.indexFieldNameProperties.map((t=>[t.key,t]))),s=new Map(t.triggerFieldNameProperties.map((t=>[t.key,t]))),o=new Map(t.foreignKeyFieldNameProperties.map((t=>[t.key,t]))),r={tableFieldNameMap:e,columnFieldNameMap:n,indexFieldNameMap:i,triggerFieldNameMap:s,foreignKeyFieldNameMap:o};this.templateProperties=r}else(0,lC.D)().then((t=>{if(!t.errCode){sessionStorage.setItem(aC.b0,JSON.stringify(t.data));const e=new Map(t.data.columnFieldNameProperties.map((t=>[t.key,t]))),n=new Map(t.data.indexFieldNameProperties.map((t=>[t.key,t]))),i=new Map(t.data.triggerFieldNameProperties.map((t=>[t.key,t]))),s=new Map(t.data.foreignKeyFieldNameProperties.map((t=>[t.key,t]))),o=new Map(t.data.tableFieldNameProperties.map((t=>[t.key,t]))),r={tableFieldNameMap:o,columnFieldNameMap:e,indexFieldNameMap:n,triggerFieldNameMap:i,foreignKeyFieldNameMap:s};this.templateProperties=r}}))},computed:{simpleTables(){const t=this.overviewData.tables;if(t.length>this.useVirtualTableThreshold){const e=t.flatMap(((t,e)=>{const n=Object.assign({},t);return n.index=e+1,t.original?(n.original.isOriginal=!0,n.original.parentId=n.id,n.children=[n.original],[n,n.original]):[n]}));return e}return t.map(((t,e)=>{const n=Object.assign({},t);return t.original&&(n.original.isOriginal=!0,n.children=[n.original]),n.index=e+1,n}))},simpleTableColumns(){const t=[{key:0,dataKey:"index",title:"",width:100},{key:1,dataKey:"name",title:this.tableFieldNameMapping("name"),width:350},{key:2,dataKey:"type",title:this.tableFieldNameMapping("type"),width:180},{key:3,dataKey:"comment",title:this.tableFieldNameMapping("comment"),width:450},{key:4,dataKey:"description",title:this.tableFieldNameMapping("description"),width:450},{key:5,dataKey:"remark",title:"讨论",width:150}];return t},tables(){const t=this.tablesData.map((t=>{const e=Object.assign({},t);return"MODIFIED"==e.diffType?(e.columns.forEach((t=>{t.original&&(t.original.isOriginal=!0,t.children=[t.original])})),e.indexes.forEach((t=>{t.original&&(t.original.isOriginal=!0,t.children=[t.original])})),e.triggers.forEach((t=>{t.original&&(t.original.isOriginal=!0,t.children=[t.original])})),e.foreignKeys.forEach((t=>{t.original&&(t.original.isOriginal=!0,t.children=[t.original])})),e):e}));return t}},methods:{onRemark(t,e){this.$emit("onRemark",t,e)},columnNameArray(t){return t?t.split(","):[]},columnTypeFormat(t){return null==t.decimalDigits?t.type+"("+t.size+")":t.type+"("+t.size+", "+t.decimalDigits+")"},onCellClick(t){"REMOVED"==t.diffType||t.isOriginal||(1==t.toEditDescription?t.toEditDescription=!1:t.toEditDescription=!0)},onUpdateDescription(t,e,n){let i="";i=n.description?n.description:"";const s=this.$route.params.projectId,o=this.$route.params.groupId,r={tableName:t,columnName:e,content:i};rC(o,s,r).then((t=>{t.errCode||(this.$message.success("修改成功"),n.toEditDescription=!1)}))},diffTagType(t){return"REMOVED"==t?"danger":"MODIFIED"==t?"warning":"ADDED"==t?"success":"info"},predicateRowClass({row:t}){const e=t.diffType;return this.diffEnabled?"REMOVED"==e?"removed-item":"MODIFIED"==e||t.isOriginal?t.isOriginal?"modified-original-item":"modified-item":"ADDED"==e?"added-item":"":""},tableFieldNameMapping(t){const e=this.templateProperties.tableFieldNameMap.get(t);return e?e.value?e.value:e.defaultValue:t},columnFieldNameMapping(t){const e=this.templateProperties.columnFieldNameMap.get(t);return e?e.value?e.value:e.defaultValue:(console.log("can not found column field: "+t),t)},indexFieldNameMapping(t){const e=this.templateProperties.indexFieldNameMap.get(t);return e?e.value?e.value:e.defaultValue:(console.log("can not found index field: "+t),t)},triggerFieldNameMapping(t){const e=this.templateProperties.triggerFieldNameMap.get(t);return e?e.value?e.value:e.defaultValue:(console.log("can not found trigger field: "+t),t)},foreignKeyFieldNameMapping(t){const e=this.templateProperties.foreignKeyFieldNameMap.get(t);return e?e.value?e.value:e.defaultValue:(console.log("can not found fk field: "+t),t)},showMockDataRules(t){const e=t.id;this.showMockDataDialog=!0,this.mockTableId=t.id,this.mockTableName=t.name;const n=this.$route.params.projectId,i=this.$route.params.groupId,s={tableId:e,version:this.docVersion};hC(i,n,s).then((t=>{t.errCode||(this.mockDataRules=t.data)})),this.generateMockSql(e)},generateMockSql(t){this.mockDataSql="";const e=this.$route.params.projectId,n=this.$route.params.groupId,i={tableId:t,version:this.docVersion};dC(n,e,i).then((t=>{t.errCode||(this.mockDataSql=t.data)})),tt(e,{version:this.docVersion}).then((t=>{t.errCode||(this.mockRefTables=t.data)}))},mockRefColumns(t){return t&&this.mockRefTables.find((e=>e.name==t))?this.mockRefTables.find((e=>e.name==t)).columns:[]},saveTableMockRules(){const t=this.$route.params.projectId,e=this.$route.params.groupId;uC(e,t,this.mockTableId,this.mockDataRules).then((t=>{t.errCode||(this.$message.success("保存成功"),this.generateMockSql(this.mockTableId))}))},copyMockSql(){},handleCopySuccess(){this.$message.success("复制成功")},handleCopyFail(){this.$message.success("复制失败,请手动复制")}}};const pC=(0,ew.Z)(gC,[["render",sC]]);var fC=pC,mC={components:{Diagram:iw,DocumentDiscussion:mw,DocumentList:fC},setup(){const t=(0,U.yj)(),e=(0,H.qj)({handleSync:!1,loadingVersions:!1,export:!1,init:!1,multiSelectionModeChanging:!1}),n=(0,H.qj)({simpleDocumentData:null,documentFilter:{version:null},projectName:null,projectId:t.params.projectId,groupId:t.params.groupId}),i=(0,H.qj)({pageFilter:{page:0,size:10},totalPage:0,versions:[]}),s=(0,H.iH)([]);Q().then((t=>{t.errCode||(s.value=t.data)}));const o=(0,H.qj)({value:[{id:-1,name:"概览"}],lastCheckedKeys:[],treeProps:{children:"children",label:"name"},isMultiSelectionMode:!1,currentTocNodeKey:t.query.tableDocumentId?parseInt(t.query.tableDocumentId):-1}),r=(0,H.iH)(),a=(0,H.iH)(""),l=(0,H.qj)({filterAdded:0,filterRemoved:0,filterModified:0,filterNone:0});(0,y.YP)(a,(t=>{r.value.filter(t)}));const c=new Map([["ADDED",0],["REMOVED",1],["MODIFIED",2],["NONE",3]]),h=()=>{l.filterAdded=0,l.filterRemoved=0,l.filterModified=0,l.filterNone=0,r.value.filter(a.value)},u=()=>{r.value.filter(a.value)},d=(t,e)=>{const n=[l.filterAdded,l.filterRemoved,l.filterModified,l.filterNone],i=n.every((t=>0==t));if(R.diffModeEnabled&&!i&&e.diffType){const t=c.get(e.diffType);if(1!=n[t])return!1}return!t||(!!e.name.includes(t)||(!(!e.comment||!e.comment.includes(t))||!(!e.description||!e.description.includes(t))))},g=t=>t.comment&&""!=t.comment?"/*"+t.comment+"*/":t.description&&""!=t.description?"/*"+t.description+"*/":"",p=(0,H.qj)({tables:[],overview:{}}),f=(0,H.qj)({showComment:!1,tables:[]}),m=(0,H.iH)("tableDocument"),b=(e,i)=>{let s=n.simpleDocumentData.id,o=[],r=[];for(var a=0;a<e.length;a++)0!=a&&a%100==0&&(o.push(r),r=[]),r.push(e[a]),a==e.length-1&&o.push(r);const l=o.map((e=>Z(t.params.projectId,s,{tableIds:e,currentVersion:n.documentFilter.version,originalVersion:R.originalVersion})));W.Z.all(l).then(W.Z.spread(((...t)=>{const e=t.flatMap((t=>t.data));i(e)})))},w=t=>{o.isMultiSelectionMode?-1==t.id?C("overview[-1]"):C(t.name+"["+t.id+"]"):-1==t.id?(p.overview=n.simpleDocumentData,p.tables=[],f.tables=[]):b([t.id],(t=>{p.overview=null,p.tables=t,f.tables=t}))},C=t=>{const e=document.getElementById(t);if(e){var n=-100,i=e.offsetTop,s=e.offsetParent;while(null!==s)i+=s.offsetTop,s=s.offsetParent;window.scrollTo({top:i+n,behavior:"smooth"})}},v=(t,e)=>{const i=r.value.getCheckedKeys();if(o.lastCheckedKeys=i,!i.some((t=>-1==t)))return-1!=t.id||e||0!=i.length?void((e||0!=i.length)&&(e?b(i,(t=>{p.overview||(p.overview=n.simpleDocumentData),p.tables=t,f.tables=t})):(p.tables=p.tables.filter((e=>e.id!=t.id)),f.tables=f.tables.filter((e=>e.id!=t.id))))):(p.tables=[],void(f.tables=[]));-1==t.id&&e&&b(i,(t=>{p.overview||(p.overview=n.simpleDocumentData),p.tables=t,f.tables=t}))},x=(0,H.iH)(300),k=async()=>{const s=await J(t.params.projectId);i.versions=s.data.content,i.totalPage=s.data.totalPages;const r=await X(t.params.projectId,{version:n.documentFilter.version,originalVersion:R.originalVersion});r.errCode?P("error","同步失败:"+r.errMessage):r.data?(n.simpleDocumentData=r.data,n.groupId=t.params.groupId,n.projectId=t.params.projectId,n.projectName=r.data.projectName,o.isMultiSelectionMode?M(r):E(r),(0,y.Y3)((()=>{const e=document.getElementById("toc-tree-wrapper");if(e){const t=e.getBoundingClientRect(),n=window.innerHeight;x.value=n-t.y-60}if(t.query.tableDocumentId){const e=parseInt(t.query.tableDocumentId);w({id:e})}}))):P("warn","无可用数据"),e.init=!0},E=t=>{o.value=t.data.tables,o.value.unshift({id:-1,name:"概览"}),p.overview=t.data,p.tables=[]},M=t=>{const e=t.data.tables;o.value=[{id:-1,name:n.projectName,children:e}];const i=new Set(r.value.getCheckedNodes().map((t=>t.name)));let s=o.value.length>0?o.value[0].children.filter((t=>i.has(t.name))).map((t=>t.id)):[];s.some((t=>-1==t))||s.push(-1),o.lastCheckedKeys=s,b(s,(t=>{s.some((t=>-1==t))?p.overview=n.simpleDocumentData:p.overview=null,p.tables=t,f.tables=t}))},S=t=>{if(e.multiSelectionModeChanging=!0,t)b(o.lastCheckedKeys,(t=>{null==p.overview&&(p.overview=n.simpleDocumentData),p.tables=t,f.tables=t;const i=o.value.filter((t=>-1!=t.id));o.value=[{id:-1,name:n.projectName,children:i}],e.multiSelectionModeChanging=!1}));else{const t=r.value.getCurrentNode();w(null==t?{id:-1}:t),o.value=o.value.length>0&&o.value[0].children?o.value[0].children:[],o.value.unshift({id:-1,name:"概览"}),e.multiSelectionModeChanging=!1}};k();const A=(0,y.Fl)((()=>!n.simpleDocumentData&&e.init)),D=(0,y.Fl)((()=>!n.simpleDocumentData&&!e.init)),P=(t,e)=>{(0,it.z8)({showClose:!0,message:e,type:t,duration:3e3})},O=async()=>{e.loadingVersions=!0,""==n.documentFilter.version&&(n.documentFilter.version=null),k(),P("success","切换成功"),e.loadingVersions=!1},T=(i,s)=>{const o=t.params.projectId;e.export=!0;const a=n.simpleDocumentData.databaseName+"."+s,l=r.value.getCheckedKeys();let c;c=l&&l.length>0?l.reduce(((t,e)=>t+","+e)):null,K(o,{version:n.documentFilter.version,fileType:i,tableIds:c},a,(()=>e.export=!1))},N=(0,H.iH)(),j=t=>{N.value?N.value.exportUml(t):(0,it.z8)({message:"请先切换到 UML 标签页面",type:"warning",group:!0})},F=L((async()=>{if(e.loadingVersions=!0,i.pageFilter.page+1<i.totalPage){i.pageFilter.page++;const e=await J(t.params.projectId,i.pageFilter);i.totalPage=e.data.totalPages,e.data.content.length>0&&e.data.content.forEach((t=>i.versions.push(t)))}e.loadingVersions=!1}),800);function L(t,e){let n=null;return function(){let i=this,s=arguments;n&&clearTimeout(n),n=setTimeout((function(){t.apply(i,s)}),e)}}const z=(0,H.iH)({tableName:null,columnName:null,groupId:null,projectId:null,isShowDrawer:!1}),I=(t,e)=>{z.value={tableName:t,columnName:e,isShowDrawer:!0,groupId:n.groupId,projectId:n.projectId}},B=t=>{t&&(m.value=t.props.name)},R=(0,H.qj)({diffModeEnabled:!1,originalVersion:null}),$=()=>{p.overview&&(p.overview.diffType="NONE"),R.originalVersion=null,h()},V=()=>new Promise((t=>{R.diffModeEnabled?($(),R.originalVersion=null,R.diffModeEnabled=!1,_()):(R.diffModeEnabled=!0,t())})),_=()=>{R.originalVersion||$(),O()},G=(0,H.qj)({showTaskList:!0,tasks:[]}),q=()=>{const n=t.params.projectId;e.handleSync=!0,Y(n).then((t=>{!t.errCode&&t.data&&(G.tasks.push({taskId:t.data,status:"NEW"}),G.showTaskList=!0,P("success","后台同步任务创建成功")),e.handleSync=!1})).catch((()=>e.handleSync=!1))},tt=t=>{if("NEW"!=t.status&&"RUNNING"!=t.status){if("FAILED"!=t.status&&"CANCELED"!=t.status)return"FINISHED"==t.status?(et(),void(G.tasks=G.tasks.filter((e=>e.taskId!=t.taskId)))):void 0;G.tasks=G.tasks.filter((e=>e.taskId!=t.taskId))}else(0,nt.lN)(n.projectId,t.taskId).then((e=>{e.errCode||(t.status="CANCELED",(0,it.z8)({message:"取消成功",type:"success"}))}))},et=()=>{k();const t=G.showTaskList?"bottom-right":"top-right";(0,st.bM)({grouping:!0,type:"success",title:"刷新成功",message:"文档已更新为最新内容",position:t})},ot=setInterval((()=>{const t=G.tasks.find((t=>"NEW"==t.status||"RUNNING"==t.status));if(G.tasks.length>0&&t){const t={taskIdIn:G.tasks.map((t=>t.taskId))};(0,nt.Dg)(n.projectId,t).then((t=>{if(!t.errCode){const e=new Map(t.data.map((t=>[t.taskId,t])));G.tasks.forEach((t=>{if(e.has(t.taskId)){const i=G.showTaskList?"bottom-right":"top-right",s=e.get(t.taskId);t.runAt=s.runAt,"FINISHED"!=t.status&&"FINISHED"==s.status&&(t.status=s.status,t.result=s.result,n.simpleDocumentData?(0,st.bM)({grouping:!0,type:"success",title:"文档同步成功",message:"同步任务已执行完成,点击即可刷新文档内容",position:i,onClick:et}):k()),"FAILED"!=t.status&&"FAILED"==s.status&&(t.status=s.status,t.result=s.result,(0,st.bM)({grouping:!0,type:"error",title:"文档同步失败",message:"错误:"+s.result,position:i})),t.status=s.status}}))}}))}}),3e3),rt=setInterval((()=>{const t={taskStatusIn:["NEW","RUNNING"]};(0,nt.Dg)(n.projectId,t).then((t=>{if(!t.errCode){const e=new Set(G.tasks.map((t=>t.taskId))),n=t.data.filter((t=>!e.has(t.taskId)));G.tasks.push(...n)}}))}),3e3),at=t=>"NEW"==t.status||"RUNNING"==t.status?"":"CANCELED"==t.status?"warning":"FAILED"==t.status?"exception":"FINISHED"==t.status?"success":void 0;return(0,y.Jd)((()=>{clearInterval(ot),clearInterval(rt)})),{tocData:o,fileTypes:s,tocItemComment:g,documentData:p,projectData:n,versionData:i,umlData:f,loadings:e,isShowNoDataPage:A,isShowLoadingPage:D,treeRef:r,umlDiagramComponentRef:N,tocTreeHeight:x,onTocNodeClick:w,onTocNodeCheckChange:v,onMultiSelectionModeChange:S,loadMoreDocumentVersions:F,onProjectDocumentVersionChange:O,onSyncProjectDocument:q,onFileExport:T,onUmlExport:j,documentDiscussionData:z,showDiscussionDrawer:I,activeTab:m,onTabClick:B,documentDiffData:R,beforeDiffModeChange:V,onProjectDocumentCompareVersionChange:_,searchTables:d,searchTableText:a,onSearchFilterChange:u,resetSearchFilter:h,searchFilter:l,projectTaskData:G,onClickTaskProgress:tt,taskStatusToProgressStatus:at}}};const yC=(0,ew.Z)(mC,[["render",G]]);var bC=yC}}]);
|
||
//# sourceMappingURL=823.06798c2e.js.map
|