(self.webpackChunk=self.webpackChunk||[]).push([[82837],{85160:function(t,i,e){"use strict";e.d(i,{FI:function(){return a}});var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},n(t,i)};function o(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function e(){this.constructor=t}n(t,i),t.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}Object.create;Object.create;var r=e(12378),s=e(59301),a=function(t){function i(i){var e=t.call(this,i)||this;return e.wasCleared=!1,e.modelChangedListener=null,e.divRef=s.createRef(),e}return o(i,t),i.prototype.getDiagram=function(){return null===this.divRef.current?null:r.S0.fromDiv(this.divRef.current)},i.prototype.clear=function(){var t=this.getDiagram();null!==t&&(t.clear(),this.wasCleared=!0)},i.prototype.componentDidMount=function(){var t=this;if(null!==this.divRef.current){var i=this.props.initDiagram();i.div=this.divRef.current,this.modelChangedListener=function(i){if(i.isTransactionFinished&&i.model&&!i.model.isReadOnly&&t.props.onModelChange){var e=i.model.toIncrementalData(i);null!==e&&t.props.onModelChange(e)}},i.addModelChangedListener(this.modelChangedListener),i.delayInitialization((function(){t.mergeData(i,!0)}))}},i.prototype.componentWillUnmount=function(){var t=this.getDiagram();null!==t&&(t.div=null,null!==this.modelChangedListener&&(t.removeModelChangedListener(this.modelChangedListener),this.modelChangedListener=null))},i.prototype.shouldComponentUpdate=function(t,i){return t.divClassName!==this.props.divClassName||t.style!==this.props.style||!t.skipsDiagramUpdate&&(t.nodeDataArray!==this.props.nodeDataArray||t.linkDataArray!==this.props.linkDataArray||t.modelData!==this.props.modelData)},i.prototype.componentDidUpdate=function(t,i){var e=this;if(t.nodeDataArray!==this.props.nodeDataArray||t.linkDataArray!==this.props.linkDataArray||t.modelData!==this.props.modelData){var n=this.getDiagram();null!==n&&(this.wasCleared?n.delayInitialization((function(){e.mergeData(n,!0),e.wasCleared=!1})):this.mergeData(n,!1))}},i.prototype.mergeData=function(t,i){var e=this;t.model.commit((function(t){void 0!==e.props.modelData&&t.assignAllDataProperties(t.modelData,e.props.modelData),t.mergeNodeDataArray(e.props.nodeDataArray),void 0!==e.props.linkDataArray&&t instanceof r.FJ&&t.mergeLinkDataArray(e.props.linkDataArray)}),i?"initial merge":"merge data")},i.prototype.render=function(){return s.createElement("div",{ref:this.divRef,className:this.props.divClassName,style:this.props.style})},i}(s.Component);(function(t){function i(i){var e=t.call(this,i)||this;return e.divRef=s.createRef(),e}o(i,t),i.prototype.getOverview=function(){return null===this.divRef.current?null:r.S0.fromDiv(this.divRef.current)},i.prototype.componentDidMount=function(){var t;null!==this.divRef.current&&(void 0!==this.props.initOverview?t=this.props.initOverview():(t=new r.g2).contentAlignment=r.z6.Center,t.div=this.divRef.current,t.observed=this.props.observedDiagram)},i.prototype.componentWillUnmount=function(){var t=this.getOverview();null!==t&&(t.div=null,t.observed=null)},i.prototype.shouldComponentUpdate=function(t,i){return t.divClassName!==this.props.divClassName||t.style!==this.props.style||t.observedDiagram!==this.props.observedDiagram},i.prototype.componentDidUpdate=function(t,i){if(t.observedDiagram!==this.props.observedDiagram){var e=this.getOverview();null!==e&&(e.observed=this.props.observedDiagram)}},i.prototype.render=function(){return s.createElement("div",{ref:this.divRef,className:this.props.divClassName,style:this.props.style})}})(s.Component),function(t){function i(i){var e=t.call(this,i)||this;return e.wasCleared=!1,e.divRef=s.createRef(),e}o(i,t),i.prototype.getPalette=function(){return null===this.divRef.current?null:r.S0.fromDiv(this.divRef.current)},i.prototype.clear=function(){var t=this.getPalette();null!==t&&(t.clear(),this.wasCleared=!0)},i.prototype.componentDidMount=function(){var t=this;if(null!==this.divRef.current){var i=this.props.initPalette();i.div=this.divRef.current,i.delayInitialization((function(){t.mergeData(i,!0)}))}},i.prototype.componentWillUnmount=function(){var t=this.getPalette();null!==t&&(t.div=null)},i.prototype.shouldComponentUpdate=function(t,i){return t.divClassName!==this.props.divClassName||t.style!==this.props.style||(t.nodeDataArray!==this.props.nodeDataArray||t.linkDataArray!==this.props.linkDataArray||t.modelData!==this.props.modelData)},i.prototype.componentDidUpdate=function(t,i){var e=this;if(t.nodeDataArray!==this.props.nodeDataArray||t.linkDataArray!==this.props.linkDataArray||t.modelData!==this.props.modelData){var n=this.getPalette();null!==n&&(this.wasCleared?n.delayInitialization((function(){e.mergeData(n,!0),e.wasCleared=!1})):this.mergeData(n,!1))}},i.prototype.mergeData=function(t,i){var e=this;t.model.commit((function(t){void 0!==e.props.modelData&&t.assignAllDataProperties(t.modelData,e.props.modelData),t.mergeNodeDataArray(e.props.nodeDataArray),void 0!==e.props.linkDataArray&&t instanceof r.FJ&&t.mergeLinkDataArray(e.props.linkDataArray)}),i?"initial merge":"merge data")},i.prototype.render=function(){return s.createElement("div",{ref:this.divRef,className:this.props.divClassName,style:this.props.style})}}(s.Component)},12378:function(t,i,e){"use strict";e.d(i,{$u:function(){return s},BD:function(){return m},E9:function(){return r},FF:function(){return S},FJ:function(){return c},Hn:function(){return u},KX:function(){return f},NB:function(){return w},S0:function(){return p},UL:function(){return a},Vk:function(){return l},al:function(){return b},bn:function(){return x},bx:function(){return y},g2:function(){return g},h1:function(){return d},hD:function(){return M},l4:function(){return o},rU:function(){return k},s_:function(){return v},z6:function(){return h}}),t=e.hmd(t),function(){var i;function n(t){var i=0;return function(){return ii&&(i=Math.max(0,n+i)),(null==e||e>n)&&(e=n),0>(e=Number(e))&&(e=Math.max(0,n+e)),i=Number(i||0);i=t.length?t.push(e):t.splice(i,0,e):w("Cannot insert an object into an HTMLCollection or NodeList: "+e+" at "+i)}function L(t,i){Array.isArray(t)?i>=t.length?t.pop():t.splice(i,1):w("Cannot remove an object from an HTMLCollection or NodeList at "+i)}function A(){var t=E.pop();return void 0===t?[]:t}function j(t){t.length=0,E.push(t)}function F(t){if("function"==typeof t){if(t.className)return t.className;if(t.name)return t.name;var i=t.toString();if(""!==(i=i.substring(9,i.indexOf("(")).trim()))return t._className=i}else if(N(t)&&t.constructor)return F(t.constructor);return typeof t}function D(t){var i=t;return N(t)&&(t.text?i=t.text:t.name?i=t.name:void 0!==t.key?i=t.key:void 0!==t.id?i=t.id:t.constructor===Object&&(t.Text?i=t.Text:t.Name?i=t.Name:void 0!==t.Key?i=t.Key:void 0!==t.Id?i=t.Id:void 0!==t.ID&&(i=t.ID))),void 0===i?"undefined":null===i?"null":i.toString()}function B(t,i){if(t.hasOwnProperty(i))return!0;for(t=Object.getPrototypeOf(t);t&&t!==Function;){if(t.hasOwnProperty(i))return!0;var e=t.CA;if(e&&e[i])return!0;t=Object.getPrototypeOf(t)}return!1}function O(t,i,e){Object.defineProperty(xe.prototype,t,{get:i,set:e})}function I(t){for(var i=[],e=0;256>e;e++)i["0123456789abcdef".charAt(e>>4)+"0123456789abcdef".charAt(15&e)]=String.fromCharCode(e);t.length%2&&(t="0"+t),e=[];for(var n=0,o=0;oe;e++)i[e]=e;for(e=n=0;256>e;e++)n=(n+i[e]+119)%256,o=i[e],i[e]=i[n],i[n]=o;n=e=0;for(var r="",s=0;s-1||r.indexOf("© 1998-2021 Northwoods Software")>-1||r.indexOf("Not for distribution or production use")>-1||r.indexOf("gojs.net")>-1?"":r}void 0===m.requestAnimationFrame&&(void 0===m.setImmediate?m.requestAnimationFrame=function(t){m.setTimeout(t,0)}:m.requestAnimationFrame=m.setImmediate);var z=void 0!==m.navigator&&0this.key)return!1;var i=(t=t.s).length,e=++this.Za,n=this.qf;if(null!==n)for(;ethis.key)return!1;var i=--this.Za;return 0<=i?(this.key=i,this.value=t.s[i],!0):(this.de(),!1)},J.prototype.Ad=function(){return this.next()},J.prototype.first=function(){var t=this.Bb;this.qa=t.Ja;var i=t.s;return this.Za=t=i.length-1,0<=t?(i=i[t],this.key=t,this.value=i):null},J.prototype.any=function(t){var i=this.Bb;i.Hg=null;var e=(i=i.s).length;for(this.Za=e,--e;0<=e;e--)if(t(i[e]))return!0;return!1},J.prototype.all=function(t){var i=this.Bb;i.Hg=null;var e=(i=i.s).length;for(this.Za=e,--e;0<=e;e--)if(!t(i[e]))return!1;return!0},J.prototype.each=function(t){var i=this.Bb;i.Hg=null;var e=(i=i.s).length;for(this.Za=e,--e;0<=e;e--)t(i[e]);return this},J.prototype.map=function(t){var i=this.Bb;i.Hg=null;var e=[],n=(i=i.s).length;for(this.Za=n,--n;0<=n;n--)e.push(t(i[n]));return(t=new Z).s=e,t.xb(),t.iterator},J.prototype.filter=function(t){var i=this.Bb;i.Hg=null;var e=[],n=(i=i.s).length;for(this.Za=n,--n;0<=n;n--){var o=i[n];t(o)&&e.push(o)}return(t=new Z).s=e,t.xb(),t.iterator},J.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},J.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},f.Object.defineProperties(J.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),J.prototype.first=J.prototype.first,J.prototype.hasNext=J.prototype.Ad,J.prototype.next=J.prototype.next,J.prototype.reset=J.prototype.reset,J.className="ListIteratorBackwards",(i=Z.prototype).xb=function(){var t=this.Ja;999999999<++t&&(t=0),this.Ja=t},i.freeze=function(){return this._isFrozen=!0,this},i.ka=function(){return this._isFrozen=!1,this},i.toString=function(){return"List()#"+it(this)},i.add=function(t){return null===t||(this._isFrozen&&k(this,t),this.s.push(t),this.xb()),this},i.push=function(t){this.add(t)},i.addAll=function(t){if(null===t)return this;this._isFrozen&&k(this);var i=this.s;if(P(t))for(var e=t.length,n=0;nt||t>=i.length)&&M(t,"0 <= i < length",Z,"elt:i"),i[t]},i.get=function(t){return this.M(t)},i.cd=function(t,i){var e=this.s;(0>t||t>=e.length)&&M(t,"0 <= i < length",Z,"setElt:i"),this._isFrozen&&k(this,t),e[t]=i},i.set=function(t,i){this.cd(t,i)},i.first=function(){var t=this.s;return 0===t.length?null:t[0]},i.jc=function(){var t=this.s,i=t.length;return 0t&&M(t,">= 0",Z,"insertAt:i"),this._isFrozen&&k(this,t);var e=this.s;t>=e.length?e.push(i):e.splice(t,0,i),this.xb()},i.remove=function(t){if(null===t)return!1;this._isFrozen&&k(this,t);var i=this.s;return-1!==(t=i.indexOf(t))&&(t===i.length-1?i.pop():i.splice(t,1),this.xb(),!0)},i.delete=function(t){return this.remove(t)},i.mb=function(t){var i=this.s;(0>t||t>=i.length)&&M(t,"0 <= i < length",Z,"removeAt:i"),this._isFrozen&&k(this,t),t===i.length-1?i.pop():i.splice(t,1),this.xb()},i.removeRange=function(t,i){var e=this.s,n=e.length;if(0>t)t=0;else if(t>=n)return this;if(0>i)return this;if(i>=n&&(i=n-1),t>i)return this;this._isFrozen&&k(this);for(var o=t,r=i+1;r=r)return this;if((0>i||i>=o-1)&&M(i,"0 <= from < length",Z,"sortRange:from"),2===r)return 0=o)n.sort(t);else for((i=n.slice(0,e)).sort(t),t=0;t=o)for((e=n.slice(i)).sort(t),t=i;t=this.s.length)return K;var t=this.Sa;return null!==t?(t.reset(),t):new W(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return K;var t=this.Hg;return null!==t?(t.reset(),t):new J(this)}}}),Z.prototype.reverse=Z.prototype.reverse,Z.prototype.sortRange=Z.prototype.zi,Z.prototype.sort=Z.prototype.sort,Z.prototype.toSet=Z.prototype.Iv,Z.prototype.toArray=Z.prototype.Fa,Z.prototype.removeRange=Z.prototype.removeRange,Z.prototype.removeAt=Z.prototype.mb,Z.prototype.delete=Z.prototype.delete,Z.prototype.remove=Z.prototype.remove,Z.prototype.insertAt=Z.prototype.Gb,Z.prototype.pop=Z.prototype.pop,Z.prototype.last=Z.prototype.jc,Z.prototype.first=Z.prototype.first,Z.prototype.set=Z.prototype.set,Z.prototype.setElt=Z.prototype.cd,Z.prototype.get=Z.prototype.get,Z.prototype.elt=Z.prototype.M,Z.prototype.indexOf=Z.prototype.indexOf,Z.prototype.has=Z.prototype.has,Z.prototype.contains=Z.prototype.contains,Z.prototype.clear=Z.prototype.clear,Z.prototype.addAll=Z.prototype.addAll,Z.prototype.push=Z.prototype.push,Z.prototype.add=Z.prototype.add,Z.prototype.thaw=Z.prototype.ka,Z.prototype.freeze=Z.prototype.freeze,Z.className="List",_.prototype.reset=function(){var t=this.eg;t.Sa=null,this.qa=t.Ja,this.sa=null},_.prototype.next=function(){var t=this.eg;if(t.Ja!==this.qa&&null===this.key)return!1;var i=this.sa;return null!==(i=null===i?t.ea:i.va)?(this.sa=i,this.value=i.value,this.key=i.key,!0):(this.de(),!1)},_.prototype.Ad=function(){return this.next()},_.prototype.first=function(){var t=this.eg;if(this.qa=t.Ja,null!==(t=t.ea)){this.sa=t;var i=t.value;return this.key=t.key,this.value=i}return null},_.prototype.any=function(t){var i=this.eg;for(this.sa=i.Sa=null,i=i.ea;null!==i;){if(t(i.value))return!0;i=i.va}return!1},_.prototype.all=function(t){var i=this.eg;for(this.sa=i.Sa=null,i=i.ea;null!==i;){if(!t(i.value))return!1;i=i.va}return!0},_.prototype.each=function(t){var i=this.eg;for(this.sa=i.Sa=null,i=i.ea;null!==i;)t(i.value),i=i.va;return this},_.prototype.map=function(t){var i=this.eg;i.Sa=null;var e=new Z;for(i=i.ea;null!==i;)e.add(t(i.value)),i=i.va;return e.iterator},_.prototype.filter=function(t){var i=this.eg;i.Sa=null;var e=new Z;for(i=i.ea;null!==i;){var n=i.value;t(n)&&e.add(n),i=i.va}return e.iterator},_.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},_.prototype.toString=function(){return null!==this.sa?"SetIterator@"+this.sa.value:"SetIterator"},f.Object.defineProperties(_.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),_.prototype.first=_.prototype.first,_.prototype.hasNext=_.prototype.Ad,_.prototype.next=_.prototype.next,_.prototype.reset=_.prototype.reset,_.className="SetIterator",(i=$.prototype).xb=function(){var t=this.Ja;999999999<++t&&(t=0),this.Ja=t},i.freeze=function(){return this._isFrozen=!0,this},i.ka=function(){return this._isFrozen=!1,this},i.toString=function(){return"Set()#"+it(this)},i.add=function(t){if(null===t)return this;this._isFrozen&&k(this,t);var i=t;return N(t)&&(i=tt(t)),void 0===this.Tb[i]&&(this.Sb++,t=new ct(t,t),this.Tb[i]=t,null===(i=this.kf)?this.ea=t:(t.ll=i,i.va=t),this.kf=t,this.xb()),this},i.addAll=function(t){if(null===t)return this;if(this._isFrozen&&k(this),P(t))for(var i=t.length,e=0;e=this.Sb)return K;var t=this.Sa;return null!==t?(t.reset(),t):new _(this)}}}),$.prototype.toList=$.prototype.Hv,$.prototype.toArray=$.prototype.Fa,$.prototype.clear=$.prototype.clear,$.prototype.retainAll=$.prototype.pA,$.prototype.removeAll=$.prototype.hp,$.prototype.delete=$.prototype.delete,$.prototype.remove=$.prototype.remove,$.prototype.first=$.prototype.first,$.prototype.containsAny=$.prototype.Ty,$.prototype.containsAll=$.prototype.Sy,$.prototype.has=$.prototype.has,$.prototype.contains=$.prototype.contains,$.prototype.addAll=$.prototype.addAll,$.prototype.add=$.prototype.add,$.prototype.thaw=$.prototype.ka,$.prototype.freeze=$.prototype.freeze;var et,nt,ot,rt,st,at=1;function ht(t){this.ma=t,this.qa=t.Ja,this.sa=null}function lt(t){$.call(this),Q(this),this._isFrozen=!0,this.ma=t}function ut(t){this.ma=t,t.jf=null,this.qa=t.Ja,this.sa=null}function ct(t,i){this.key=t,this.value=i,this.ll=this.va=null}function ft(t){this.ma=t,t.Sa=null,this.qa=t.Ja,this.sa=null}function dt(t){Q(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.jf=this.Sa=null,this.Ja=0,this.kf=this.ea=null,"string"==typeof t&&w("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),void 0!==t&&this.addAll(t)}function pt(t,i){void 0===t?this.y=this.x=0:"number"==typeof t&&"number"==typeof i?(this.x=t,this.y=i):w("Invalid arguments to Point constructor: "+t+", "+i),this._isFrozen=!1}function gt(t){if("string"==typeof t){t=t.split(" ");for(var i=0,e=0;""===t[i];)i++;var n=t[i++];n&&(e=parseFloat(n));for(var o=0;""===t[i];)i++;return(n=t[i++])&&(o=parseFloat(n)),new pt(e,o)}return new pt}function mt(t){return t.x.toString()+" "+t.y.toString()}function yt(t,i){if(0===t)return 0i?270:0;if(0===i)return 0t?e=0>i?e+180:180-e:0>i&&(e=360-e),e}function vt(t,i){return i.Cd(t),t}function xt(t,i,e,n,o,r){var s=o-e,a=r-n,h=s*s+a*a,l=-(e-=t)*s-(n-=i)*a;return 0>=l||l>=h?(s=o-t,a=r-i,Math.min(e*e+n*n,s*s+a*a)):(t=s*n-a*e)*t/h}function bt(t,i,e,n){return(t=e-t)*t+(i=n-i)*i}function wt(t,i,e,n){return i=n-i,0===(t=e-t)?0i?270:0:0===i?0t?n=0>i?n+180:180-n:0>i&&(n=360-n),n)}$.className="Set",$.uniqueHash=Q,$.hashIdUnique=tt,$.hashId=it,ht.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},ht.prototype.next=function(){var t=this.ma;if(t.Ja!==this.qa&&null===this.key)return!1;var i=this.sa;return null!==(i=null===i?t.ea:i.va)?(this.sa=i,this.value=this.key=t=i.key,!0):(this.de(),!1)},ht.prototype.Ad=function(){return this.next()},ht.prototype.first=function(){var t=this.ma;return this.qa=t.Ja,null!==(t=t.ea)?(this.sa=t,this.value=this.key=t=t.key):null},ht.prototype.any=function(t){var i=this.ma;for(this.sa=null,i=i.ea;null!==i;){if(t(i.key))return!0;i=i.va}return!1},ht.prototype.all=function(t){var i=this.ma;for(this.sa=null,i=i.ea;null!==i;){if(!t(i.key))return!1;i=i.va}return!0},ht.prototype.each=function(t){var i=this.ma;for(this.sa=null,i=i.ea;null!==i;)t(i.key),i=i.va;return this},ht.prototype.map=function(t){var i=this.ma;this.sa=null;var e=new Z;for(i=i.ea;null!==i;)e.add(t(i.key)),i=i.va;return e.iterator},ht.prototype.filter=function(t){var i=this.ma;this.sa=null;var e=new Z;for(i=i.ea;null!==i;){var n=i.key;t(n)&&e.add(n),i=i.va}return e.iterator},ht.prototype.de=function(){this.value=this.key=null,this.qa=-1},ht.prototype.toString=function(){return null!==this.sa?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},f.Object.defineProperties(ht.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),ht.prototype.first=ht.prototype.first,ht.prototype.hasNext=ht.prototype.Ad,ht.prototype.next=ht.prototype.next,ht.prototype.reset=ht.prototype.reset,ht.className="MapKeySetIterator",c(lt,$),(i=lt.prototype).freeze=function(){return this},i.ka=function(){return this},i.toString=function(){return"MapKeySet("+this.ma.toString()+")"},i.add=function(){w("This Set is read-only: "+this.toString())},i.contains=function(t){return this.ma.contains(t)},i.has=function(t){return this.contains(t)},i.remove=function(){w("This Set is read-only: "+this.toString())},i.delete=function(t){return this.remove(t)},i.clear=function(){w("This Set is read-only: "+this.toString())},i.first=function(){var t=this.ma.ea;return null!==t?t.key:null},lt.prototype.any=function(t){for(var i=this.ma.ea;null!==i;){if(t(i.key))return!0;i=i.va}return!1},lt.prototype.all=function(t){for(var i=this.ma.ea;null!==i;){if(!t(i.key))return!1;i=i.va}return!0},lt.prototype.each=function(t){for(var i=this.ma.ea;null!==i;)t(i.key),i=i.va;return this},lt.prototype.map=function(t){for(var i=new $,e=this.ma.ea;null!==e;)i.add(t(e.key)),e=e.va;return i},lt.prototype.filter=function(t){for(var i=new $,e=this.ma.ea;null!==e;){var n=e.key;t(n)&&i.add(n),e=e.va}return i},lt.prototype.copy=function(){return new lt(this.ma)},lt.prototype.Iv=function(){var t,i=new $,e=this.ma.Tb;for(t in e)i.add(e[t].key);return i},lt.prototype.Fa=function(){var t,i=this.ma.Tb,e=Array(this.ma.Sb),n=0;for(t in i)e[n]=i[t].key,n++;return e},lt.prototype.Hv=function(){var t,i=new Z,e=this.ma.Tb;for(t in e)i.add(e[t].key);return i},f.Object.defineProperties(lt.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?K:new ht(this.ma)}}}),lt.prototype.toList=lt.prototype.Hv,lt.prototype.toArray=lt.prototype.Fa,lt.prototype.toSet=lt.prototype.Iv,lt.prototype.first=lt.prototype.first,lt.prototype.clear=lt.prototype.clear,lt.prototype.delete=lt.prototype.delete,lt.prototype.remove=lt.prototype.remove,lt.prototype.has=lt.prototype.has,lt.prototype.contains=lt.prototype.contains,lt.prototype.add=lt.prototype.add,lt.prototype.thaw=lt.prototype.ka,lt.prototype.freeze=lt.prototype.freeze,lt.className="MapKeySet",ut.prototype.reset=function(){var t=this.ma;t.jf=null,this.qa=t.Ja,this.sa=null},ut.prototype.next=function(){var t=this.ma;if(t.Ja!==this.qa&&null===this.key)return!1;var i=this.sa;return null!==(i=null===i?t.ea:i.va)?(this.sa=i,this.value=i.value,this.key=i.key,!0):(this.de(),!1)},ut.prototype.Ad=function(){return this.next()},ut.prototype.first=function(){var t=this.ma;if(this.qa=t.Ja,null!==(t=t.ea)){this.sa=t;var i=t.value;return this.key=t.key,this.value=i}return null},ut.prototype.any=function(t){var i=this.ma;for(this.sa=i.jf=null,i=i.ea;null!==i;){if(t(i.value))return!0;i=i.va}return!1},ut.prototype.all=function(t){var i=this.ma;for(this.sa=i.jf=null,i=i.ea;null!==i;){if(!t(i.value))return!1;i=i.va}return!0},ut.prototype.each=function(t){var i=this.ma;for(this.sa=i.jf=null,i=i.ea;null!==i;)t(i.value),i=i.va;return this},ut.prototype.map=function(t){var i=this.ma;this.sa=i.jf=null;var e=new Z;for(i=i.ea;null!==i;)e.add(t(i.value)),i=i.va;return e.iterator},ut.prototype.filter=function(t){var i=this.ma;this.sa=i.jf=null;var e=new Z;for(i=i.ea;null!==i;){var n=i.value;t(n)&&e.add(n),i=i.va}return e.iterator},ut.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},ut.prototype.toString=function(){return null!==this.sa?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},f.Object.defineProperties(ut.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),ut.prototype.first=ut.prototype.first,ut.prototype.hasNext=ut.prototype.Ad,ut.prototype.next=ut.prototype.next,ut.prototype.reset=ut.prototype.reset,ut.className="MapValueSetIterator",ct.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},ct.className="KeyValuePair",ft.prototype.reset=function(){var t=this.ma;t.Sa=null,this.qa=t.Ja,this.sa=null},ft.prototype.next=function(){var t=this.ma;if(t.Ja!==this.qa&&null===this.key)return!1;var i=this.sa;return null!==(i=null===i?t.ea:i.va)?(this.sa=i,this.key=i.key,this.value=i.value,!0):(this.de(),!1)},ft.prototype.Ad=function(){return this.next()},ft.prototype.first=function(){var t=this.ma;return this.qa=t.Ja,null!==(t=t.ea)?(this.sa=t,this.key=t.key,this.value=t.value,t):null},ft.prototype.any=function(t){var i=this.ma;for(this.sa=i.Sa=null,i=i.ea;null!==i;){if(t(i))return!0;i=i.va}return!1},ft.prototype.all=function(t){var i=this.ma;for(this.sa=i.Sa=null,i=i.ea;null!==i;){if(!t(i))return!1;i=i.va}return!0},ft.prototype.each=function(t){var i=this.ma;for(this.sa=i.Sa=null,i=i.ea;null!==i;)t(i),i=i.va;return this},ft.prototype.map=function(t){var i=this.ma;this.sa=i.Sa=null;var e=new Z;for(i=i.ea;null!==i;)e.add(t(i)),i=i.va;return e.iterator},ft.prototype.filter=function(t){var i=this.ma;this.sa=i.Sa=null;var e=new Z;for(i=i.ea;null!==i;)t(i)&&e.add(i),i=i.va;return e.iterator},ft.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},ft.prototype.toString=function(){return null!==this.sa?"MapIterator@"+this.sa:"MapIterator"},f.Object.defineProperties(ft.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),ft.prototype.first=ft.prototype.first,ft.prototype.hasNext=ft.prototype.Ad,ft.prototype.next=ft.prototype.next,ft.prototype.reset=ft.prototype.reset,ft.className="MapIterator",(i=dt.prototype).xb=function(){var t=this.Ja;999999999<++t&&(t=0),this.Ja=t},i.freeze=function(){return this._isFrozen=!0,this},i.ka=function(){return this._isFrozen=!1,this},i.toString=function(){return"Map()#"+it(this)},i.add=function(t,i){this._isFrozen&&k(this,t);var e=t;N(t)&&(e=tt(t));var n=this.Tb[e];return void 0===n?(this.Sb++,t=new ct(t,i),this.Tb[e]=t,null===(e=this.kf)?this.ea=t:(t.ll=e,e.va=t),this.kf=t,this.xb()):n.value=i,this},i.set=function(t,i){return this.add(t,i)},i.addAll=function(t){if(null===t)return this;if(P(t))for(var i=t.length,e=0;e=this.count)return K;var t=this.Sa;return null!==t?(t.reset(),t):new ft(this)}},iteratorKeys:{get:function(){return 0>=this.count?K:new ht(this)}},iteratorValues:{get:function(){if(0>=this.count)return K;var t=this.jf;return null!==t?(t.reset(),t):new ut(this)}}}),dt.prototype.toKeySet=dt.prototype.Lf,dt.prototype.toArray=dt.prototype.Fa,dt.prototype.clear=dt.prototype.clear,dt.prototype.delete=dt.prototype.delete,dt.prototype.remove=dt.prototype.remove,dt.prototype.get=dt.prototype.get,dt.prototype.getValue=dt.prototype.I,dt.prototype.has=dt.prototype.has,dt.prototype.contains=dt.prototype.contains,dt.prototype.first=dt.prototype.first,dt.prototype.addAll=dt.prototype.addAll,dt.prototype.set=dt.prototype.set,dt.prototype.add=dt.prototype.add,dt.prototype.thaw=dt.prototype.ka,dt.prototype.freeze=dt.prototype.freeze,dt.className="Map",pt.prototype.assign=function(t){return this.x=t.x,this.y=t.y,this},pt.prototype.h=function(t,i){return this.x=t,this.y=i,this},pt.prototype.sg=function(t,i){return this.x=t,this.y=i,this},pt.prototype.set=function(t){return this.x=t.x,this.y=t.y,this},pt.prototype.copy=function(){var t=new pt;return t.x=this.x,t.y=this.y,t},(i=pt.prototype).ja=function(){return this._isFrozen=!0,Object.freeze(this),this},i.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},i.freeze=function(){return this._isFrozen=!0,this},i.ka=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this._isFrozen=!1,this},i.toString=function(){return"Point("+this.x+","+this.y+")"},i.D=function(t){return t instanceof pt&&(this.x===t.x&&this.y===t.y)},i.hi=function(t,i){return this.x===t&&this.y===i},i.Xa=function(t){return Xi.B(this.x,t.x)&&Xi.B(this.y,t.y)},i.add=function(t){return this.x+=t.x,this.y+=t.y,this},i.re=function(t){return this.x-=t.x,this.y-=t.y,this},i.offset=function(t,i){return this.x+=t,this.y+=i,this},pt.prototype.rotate=function(t){if(0===t)return this;var i=this.x,e=this.y;if(0===i&&0===e)return this;if(360<=t?t-=360:0>t&&(t+=360),90===t){t=0;var n=1}else 180===t?(t=-1,n=0):270===t?(t=0,n=-1):(n=t*Math.PI/180,t=Math.cos(n),n=Math.sin(n));return this.x=t*i-n*e,this.y=n*i+t*e,this},(i=pt.prototype).scale=function(t,i){return this.x*=t,this.y*=i,this},i.Bf=function(t){var i=t.x-this.x;return i*i+(t=t.y-this.y)*t},i.zd=function(t,i){return(t-=this.x)*t+(i-=this.y)*i},i.normalize=function(){var t=this.x,i=this.y,e=Math.sqrt(t*t+i*i);return 0i.width+10+10+o||o>e+n)&&(e=t.height,t=t.y,n=i.y-10,!(t>i.height+10+10+n||n>e+t))}function Gt(t,i,e,n,o){var r=Math.min(t.x,i),s=Math.min(t.y,e);return i=Math.max(t.x+t.width,i+n),e=Math.max(t.y+t.height,e+o),t.x=r,t.y=s,t.width=i-r,t.height=e-s,t}function Xt(t,i,e,n,o,r,s,a){return void 0===s&&(s=0),void 0===a&&(a=0),t<=o&&o+s<=t+e&&i<=r&&r+a<=i+n}function Ut(t,i,e,n,o,r,s,a){return!(t>s+o||o>e+t)&&!(i>a+r||r>n+i)}At.className="Size",At.parse=jt,At.stringify=Ft,At.ZeroSize=kt=new At(0,0).ja(),At.OneSize=Mt=new At(1,1).ja(),At.SixSize=St=new At(6,6).ja(),At.EightSize=Nt=new At(8,8).ja(),At.TenSize=Pt=new At(10,10).ja(),At.InfiniteSize=Ct=new At(1/0,1/0).ja(),At.NoSize=Tt=new At(NaN,NaN).ja(),At.parse=jt,At.stringify=Ft,(i=Bt.prototype).assign=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.h=function(t,i,e,n){return this.x=t,this.y=i,this.width=e,this.height=n,this},i.sg=function(t,i,e,n){return this.x=t,this.y=i,this.width=e,this.height=n,this},i.set=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.dd=function(t){return this.x=t.x,this.y=t.y,this},i.tA=function(t){return this.width=t.width,this.height=t.height,this},Bt.prototype.copy=function(){var t=new Bt;return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},(i=Bt.prototype).ja=function(){return this._isFrozen=!0,Object.freeze(this),this},i.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},i.freeze=function(){return this._isFrozen=!0,this},i.ka=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this._isFrozen=!1,this},i.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},i.D=function(t){return t instanceof Bt&&(this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height)},i.hi=function(t,i,e,n){return this.x===t&&this.y===i&&this.width===e&&this.height===n},i.Xa=function(t){return Xi.B(this.x,t.x)&&Xi.B(this.y,t.y)&&Xi.B(this.width,t.width)&&Xi.B(this.height,t.height)},i.ca=function(t){return this.x<=t.x&&this.x+this.width>=t.x&&this.y<=t.y&&this.y+this.height>=t.y},i.Re=function(t){return this.x<=t.x&&t.x+t.width<=this.x+this.width&&this.y<=t.y&&t.y+t.height<=this.y+this.height},i.contains=function(t,i,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.x<=t&&t+e<=this.x+this.width&&this.y<=i&&i+n<=this.y+this.height},i.offset=function(t,i){return this.x+=t,this.y+=i,this},i.Bc=function(t,i){return Et(this,i,t,i,t)},i.Co=function(t){return Et(this,t.top,t.right,t.bottom,t.left)},i.Fv=function(t){return Et(this,-t.top,-t.right,-t.bottom,-t.left)},i.Hz=function(t,i,e,n){return Et(this,t,i,e,n)},i.Ex=function(t){return Vt(this,t.x,t.y,t.width,t.height)},i.Uu=function(t,i,e,n){return Vt(this,t,i,e,n)},i.Yc=function(t){return this.Vu(t.x,t.y,t.width,t.height)},i.Vu=function(t,i,e,n){var o=this.width,r=this.x;return!(1/0!==o&&1/0!==e&&(o+=r,e+=t,isNaN(e)||isNaN(o)||r>e||t>o))&&(t=this.height,e=this.y,!(1/0!==t&&1/0!==n&&(t+=e,n+=i,isNaN(n)||isNaN(t)||e>n||i>t)))},i.Ye=function(t){return Gt(this,t.x,t.y,0,0)},i.ed=function(t){return Gt(this,t.x,t.y,t.width,t.height)},i.Kv=function(t,i,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Gt(this,t,i,e,n)},i.yi=function(t,i,e){return this.x=t-e.offsetX-e.x*this.width,this.y=i-e.offsetY-e.y*this.height,this},i.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},i.Mz=function(){return 0===this.width&&0===this.height},Bt.alloc=function(){var t=Ht.pop();return void 0===t?new Bt:t},Bt.allocAt=function(t,i,e,n){var o=Ht.pop();return void 0===o?new Bt(t,i,e,n):o.h(t,i,e,n)},Bt.free=function(t){Ht.push(t)},f.Object.defineProperties(Bt.prototype,{left:{get:function(){return this.x},set:function(t){this.x=t}},top:{get:function(){return this.y},set:function(t){this.y=t}},right:{get:function(){return this.x+this.width},set:function(t){this.x+=t-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(t){this.y+=t-(this.y+this.height)}},position:{get:function(){return new pt(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y}},size:{get:function(){return new At(this.width,this.height)},set:function(t){this.width=t.width,this.height=t.height}},center:{get:function(){return new pt(this.x+this.width/2,this.y+this.height/2)},set:function(t){this.x=t.x-this.width/2,this.y=t.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}}),Bt.prototype.isEmpty=Bt.prototype.Mz,Bt.prototype.isReal=Bt.prototype.w,Bt.intersectsLineSegment=function(t,i,e,n,o,r,s,a){return Xi.Fx(t,i,e,n,o,r,s,a)},Bt.prototype.setSpot=Bt.prototype.yi,Bt.prototype.union=Bt.prototype.Kv,Bt.prototype.unionRect=Bt.prototype.ed,Bt.prototype.unionPoint=Bt.prototype.Ye,Bt.prototype.intersects=Bt.prototype.Vu,Bt.prototype.intersectsRect=Bt.prototype.Yc,Bt.prototype.intersect=Bt.prototype.Uu,Bt.prototype.intersectRect=Bt.prototype.Ex,Bt.prototype.grow=Bt.prototype.Hz,Bt.prototype.subtractMargin=Bt.prototype.Fv,Bt.prototype.addMargin=Bt.prototype.Co,Bt.prototype.inflate=Bt.prototype.Bc,Bt.prototype.offset=Bt.prototype.offset,Bt.prototype.contains=Bt.prototype.contains,Bt.prototype.containsRect=Bt.prototype.Re,Bt.prototype.containsPoint=Bt.prototype.ca,Bt.prototype.equalsApprox=Bt.prototype.Xa,Bt.prototype.equalTo=Bt.prototype.hi,Bt.prototype.equals=Bt.prototype.D,Bt.prototype.setSize=Bt.prototype.tA,Bt.prototype.setPoint=Bt.prototype.dd,Bt.prototype.set=Bt.prototype.set,Bt.prototype.setTo=Bt.prototype.sg;var qt,Kt,Ht=[];function Wt(t,i,e,n){void 0===t?this.left=this.bottom=this.right=this.top=0:void 0===i?this.left=this.bottom=this.right=this.top=t:void 0===e?(this.top=t,this.right=i,this.bottom=t,this.left=i):void 0!==n?(this.top=t,this.right=i,this.bottom=e,this.left=n):w("Invalid arguments to Margin constructor: "+t+", "+i+", "+e+", "+n),this._isFrozen=!1}function Jt(t){if("string"==typeof t){t=t.split(" ");for(var i=0,e=NaN;""===t[i];)i++;var n=t[i++];if(n&&(e=parseFloat(n)),isNaN(e))return new Wt;for(var o=NaN;""===t[i];)i++;if((n=t[i++])&&(o=parseFloat(n)),isNaN(o))return new Wt(e);for(var r=NaN;""===t[i];)i++;if((n=t[i++])&&(r=parseFloat(n)),isNaN(r))return new Wt(e,o);for(var s=NaN;""===t[i];)i++;return(n=t[i++])&&(s=parseFloat(n)),isNaN(s)?new Wt(e,o):new Wt(e,o,r,s)}return new Wt}function Zt(t){return t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString()}Bt.className="Rect",Bt.parse=It,Bt.stringify=zt,Bt.contains=Xt,Bt.intersects=Ut,Bt.ZeroRect=qt=new Bt(0,0,0,0).ja(),Bt.NoRect=Kt=new Bt(NaN,NaN,NaN,NaN).ja(),Bt.parse=It,Bt.stringify=zt,Bt.contains=Xt,Bt.intersects=Ut,Wt.prototype.assign=function(t){return this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left,this},Wt.prototype.sg=function(t,i,e,n){return this.top=t,this.right=i,this.bottom=e,this.left=n,this},Wt.prototype.set=function(t){return this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left,this},Wt.prototype.copy=function(){var t=new Wt;return t.top=this.top,t.right=this.right,t.bottom=this.bottom,t.left=this.left,t},(i=Wt.prototype).ja=function(){return this._isFrozen=!0,Object.freeze(this),this},i.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},i.freeze=function(){return this._isFrozen=!0,this},i.ka=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this._isFrozen=!1,this},i.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},i.D=function(t){return t instanceof Wt&&(this.top===t.top&&this.right===t.right&&this.bottom===t.bottom&&this.left===t.left)},i.hi=function(t,i,e,n){return this.top===t&&this.right===i&&this.bottom===e&&this.left===n},i.Xa=function(t){return Xi.B(this.top,t.top)&&Xi.B(this.right,t.right)&&Xi.B(this.bottom,t.bottom)&&Xi.B(this.left,t.left)},i.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},Wt.alloc=function(){var t=Oi.pop();return void 0===t?new Wt:t},Wt.free=function(t){Oi.push(t)},Wt.prototype.isReal=Wt.prototype.w,Wt.prototype.equalsApprox=Wt.prototype.Xa,Wt.prototype.equalTo=Wt.prototype.hi,Wt.prototype.equals=Wt.prototype.D,Wt.prototype.set=Wt.prototype.set,Wt.prototype.setTo=Wt.prototype.sg;var _t,$t,Qt,ti,ii,ei,ni,oi,ri,si,ai,hi,li,ui,ci,fi,di,pi,gi,mi,yi,vi,xi,bi,wi,ki,Mi,Si,Ni,Pi,Ci,Ti,Li,Ai,ji,Fi,Di,Bi,Oi=[];function Ii(t,i,e,n){void 0===t?this.offsetY=this.offsetX=this.y=this.x=0:(void 0===i&&(i=0),void 0===e&&(e=0),void 0===n&&(n=0),this.x=t,this.y=i,this.offsetX=e,this.offsetY=n),this._isFrozen=!1}function zi(t,i){return t.x=NaN,t.y=NaN,t.offsetX=i,t}function Ri(t){if("string"==typeof t){if("None"===(t=t.trim()))return Qt;if("TopLeft"===t)return ti;if("Top"===t||"TopCenter"===t||"MiddleTop"===t)return ii;if("TopRight"===t)return ei;if("Left"===t||"LeftCenter"===t||"MiddleLeft"===t)return ni;if("Center"===t)return oi;if("Right"===t||"RightCenter"===t||"MiddleRight"===t)return ri;if("BottomLeft"===t)return si;if("Bottom"===t||"BottomCenter"===t||"MiddleBottom"===t)return ai;if("BottomRight"===t)return hi;if("TopSide"===t)return li;if("LeftSide"===t)return ui;if("RightSide"===t)return ci;if("BottomSide"===t)return fi;if("TopBottomSides"===t)return di;if("LeftRightSides"===t)return pi;if("TopLeftSides"===t)return gi;if("TopRightSides"===t)return mi;if("BottomLeftSides"===t)return yi;if("BottomRightSides"===t)return vi;if("NotTopSide"===t)return xi;if("NotLeftSide"===t)return bi;if("NotRightSide"===t)return wi;if("NotBottomSide"===t)return ki;if("AllSides"===t)return Mi;if("Default"===t)return Si;t=t.split(" ");for(var i=0,e=0;""===t[i];)i++;var n=t[i++];void 0!==n&&0t&&(t+=360),0===t)return this;if(this.translate(i,e),90===t){t=0;var n=1}else 180===t?(t=-1,n=0):270===t?(t=0,n=-1):(n=t*Math.PI/180,t=Math.cos(n),n=Math.sin(n));var o=this.m12*t+this.m22*n,r=this.m11*-n+this.m21*t,s=this.m12*-n+this.m22*t;return this.m11=this.m11*t+this.m21*n,this.m12=o,this.m21=r,this.m22=s,this.translate(-i,-e),this},(i=Yi.prototype).translate=function(t,i){return this.dx+=this.m11*t+this.m21*i,this.dy+=this.m12*t+this.m22*i,this},i.scale=function(t,i){return void 0===i&&(i=t),this.m11*=t,this.m12*=t,this.m21*=i,this.m22*=i,this},i.Ga=function(t){var i=t.x,e=t.y;return t.h(i*this.m11+e*this.m21+this.dx,i*this.m12+e*this.m22+this.dy)},i.Cd=function(t){var i=1/(this.m11*this.m22-this.m12*this.m21),e=t.x,n=t.y;return t.h(e*this.m22*i+n*-this.m21*i+i*(this.m21*this.dy-this.m22*this.dx),e*-this.m12*i+n*this.m11*i+i*(this.m12*this.dx-this.m11*this.dy))},i.Eu=function(t){var i=1/(this.m11*this.m22-this.m12*this.m21),e=1.25*t.x,n=1.2*t.y;return t.h(e*this.m22*i+n*-this.m21*i+i*(this.m21*this.dy-this.m22*this.dx),e*-this.m12*i+n*this.m11*i+i*(this.m12*this.dx-this.m11*this.dy))},i.pp=function(t){var i=t.x,e=t.y,n=i+t.width,o=e+t.height,r=this.m11,s=this.m12,a=this.m21,h=this.m22,l=this.dx,u=this.dy,c=i*r+e*a+l,f=i*s+e*h+u,d=n*r+e*a+l,p=n*s+e*h+u;return e=i*r+o*a+l,i=i*s+o*h+u,r=n*r+o*a+l,n=n*s+o*h+u,o=Math.min(c,d),c=Math.max(c,d),d=Math.min(f,p),f=Math.max(f,p),o=Math.min(o,e),c=Math.max(c,e),d=Math.min(d,i),f=Math.max(f,i),o=Math.min(o,r),c=Math.max(c,r),d=Math.min(d,n),f=Math.max(f,n),t.h(o,d,c-o,f-d),t},Yi.alloc=function(){var t=Gi.pop();return void 0===t?new Yi:t},Yi.free=function(t){Gi.push(t)},Yi.prototype.transformRect=Yi.prototype.pp,Yi.prototype.transformPoint=Yi.prototype.Ga,Yi.prototype.scale=Yi.prototype.scale,Yi.prototype.translate=Yi.prototype.translate,Yi.prototype.rotate=Yi.prototype.rotate,Yi.prototype.invert=Yi.prototype.Vj,Yi.prototype.multiplyInverted=Yi.prototype.bv,Yi.prototype.multiply=Yi.prototype.multiply,Yi.prototype.reset=Yi.prototype.reset,Yi.prototype.isIdentity=Yi.prototype.ws,Yi.prototype.equals=Yi.prototype.D,Yi.prototype.setTransform=Yi.prototype.setTransform,Yi.prototype.set=Yi.prototype.set;var Gi=[];Yi.className="Transform",Yi.xF="54a702f3e53909c447824c6706603faf4c";var Xi={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(t){if(0>=t)return 0;var i=Xi.Uv;if(null===i){i=[];for(var e=0;2e3>=e;e++)i[e]=Math.sqrt(e);Xi.Uv=i}return 1>t?2e3>=(e=1/t)?1/i[0|e]:Math.sqrt(t):2e3>=t?i[0|t]:Math.sqrt(t)},B:function(t,i){return.5>(t-=i)&&-.5(t-=i)&&-5e-8=o&&(o=1e-6),tu-l){if(!(t-e>o||e-t>o))return!0;if((r=(n-i)/(e-t)*(r-t)+i)-o<=s&&s<=r+o)return!0}else{if(!(i-n>o||n-i>o))return!0;if((s=(e-t)/(n-i)*(s-i)+t)-o<=r&&r<=s+o)return!0}return!1},cs:function(t,i,e,n,o,r,s,a,h,l,u,c){if(Xi.Yb(t,i,s,a,c,e,n)&&Xi.Yb(t,i,s,a,c,o,r))return Xi.Yb(t,i,s,a,c,l,u);var f=(t+e)/2,d=(i+n)/2,p=(e+o)/2,g=(n+r)/2,m=((n=(f+p)/2)+(p=(p+(o=(o+s)/2))/2))/2,y=((e=(d+g)/2)+(g=(g+(r=(r+a)/2))/2))/2;return Xi.cs(t,i,f,d,n,e,m,y,h,l,u,c)||Xi.cs(m,y,p,g,o,r,s,a,h,l,u,c)},ax:function(t,i,e,n,o,r,s,a,h){var l=(e+o)/2,u=(n+r)/2;return h.h((((t+e)/2+l)/2+(l+(o+s)/2)/2)/2,(((i+n)/2+u)/2+(u+(r+a)/2)/2)/2),h},My:function(t,i,e,n,o,r,s,a){var h=(e+o)/2,l=(n+r)/2;return wt(((t+e)/2+h)/2,((i+n)/2+l)/2,(h+(o+s)/2)/2,(l+(r+a)/2)/2)},Dl:function(t,i,e,n,o,r,s,a,h,l){if(Xi.Yb(t,i,s,a,h,e,n)&&Xi.Yb(t,i,s,a,h,o,r))Gt(l,t,i,0,0),Gt(l,s,a,0,0);else{var u=(t+e)/2,c=(i+n)/2,f=(e+o)/2,d=(n+r)/2,p=((n=(u+f)/2)+(f=(f+(o=(o+s)/2))/2))/2,g=((e=(c+d)/2)+(d=(d+(r=(r+a)/2))/2))/2;Xi.Dl(t,i,u,c,n,e,p,g,h,l),Xi.Dl(p,g,f,d,o,r,s,a,h,l)}return l},Qe:function(t,i,e,n,o,r,s,a,h,l){if(Xi.Yb(t,i,s,a,h,e,n)&&Xi.Yb(t,i,s,a,h,o,r))0===l.length&&(l.push(t),l.push(i)),l.push(s),l.push(a);else{var u=(t+e)/2,c=(i+n)/2,f=(e+o)/2,d=(n+r)/2,p=((n=(u+f)/2)+(f=(f+(o=(o+s)/2))/2))/2,g=((e=(c+d)/2)+(d=(d+(r=(r+a)/2))/2))/2;Xi.Qe(t,i,u,c,n,e,p,g,h,l),Xi.Qe(p,g,f,d,o,r,s,a,h,l)}return l},jv:function(t,i,e,n,o,r,s,a,h,l){if(Xi.Yb(t,i,o,r,l,e,n))return Xi.Yb(t,i,o,r,l,a,h);var u=(t+e)/2,c=(i+n)/2,f=(u+(e=(e+o)/2))/2,d=(c+(n=(n+r)/2))/2;return Xi.jv(t,i,u,c,f,d,s,a,h,l)||Xi.jv(f,d,e,n,o,r,s,a,h,l)},OA:function(t,i,e,n,o,r,s){return s.h(((t+e)/2+(e+o)/2)/2,((i+n)/2+(n+r)/2)/2),s},iv:function(t,i,e,n,o,r,s,a){if(Xi.Yb(t,i,o,r,s,e,n))Gt(a,t,i,0,0),Gt(a,o,r,0,0);else{var h=(t+e)/2,l=(i+n)/2,u=(h+(e=(e+o)/2))/2,c=(l+(n=(n+r)/2))/2;Xi.iv(t,i,h,l,u,c,s,a),Xi.iv(u,c,e,n,o,r,s,a)}return a},ep:function(t,i,e,n,o,r,s,a){if(Xi.Yb(t,i,o,r,s,e,n))0===a.length&&(a.push(t),a.push(i)),a.push(o),a.push(r);else{var h=(t+e)/2,l=(i+n)/2,u=(h+(e=(e+o)/2))/2,c=(l+(n=(n+r)/2))/2;Xi.ep(t,i,h,l,u,c,s,a),Xi.ep(u,c,e,n,o,r,s,a)}return a},Eo:function(t,i,e,n,o,r,s,a,h,l,u,c,f,d){if(Xi.Yb(t,i,s,a,f,e,n)&&Xi.Yb(t,i,s,a,f,o,r))return!!Xi.Rl(t,i,s,a,h,l,u,c)&&(0!=(f=(t-s)*(l-c)-(i-a)*(h-u))&&(d.h(((t*a-i*s)*(h-u)-(t-s)*(h*c-l*u))/f,((t*a-i*s)*(l-c)-(i-a)*(h*c-l*u))/f),!0));var p=(t+e)/2,g=(i+n)/2,m=(e+o)/2,y=(n+r)/2,v=((n=(p+m)/2)+(m=(m+(o=(o+s)/2))/2))/2,x=((e=(g+y)/2)+(y=(y+(r=(r+a)/2))/2))/2,b=1/0,w=!1,k=0,M=0;return Xi.Eo(t,i,p,g,n,e,v,x,h,l,u,c,f,d)&&((t=(d.x-h)*(d.x-h)+(d.y-l)*(d.y-l))=u)return d;if((h>u?h-u:u-h)<(l>c?l-c:c-l)){if(it)return d}else if(tt)return d;0f&&d--}else{g=(i+n)/2;var m=(e+o)/2,y=(n+r)/2,v=((n=((p=(t+e)/2)+m)/2)+(m=(m+(o=(o+s)/2))/2))/2,x=((e=(g+y)/2)+(y=(y+(r=(r+a)/2))/2))/2;d+=Xi.Fo(t,i,p,g,n,e,v,x,h,l,u,c,f),d+=Xi.Fo(v,x,m,y,o,r,s,a,h,l,u,c,f)}return d},qh:function(t,i,e,n,o,r,s){return Xi.$(t,e)?(ii?(s.h(t,i),!1):(s.h(t,r),!0)):Xi.$(i,n)?(tt?(s.h(t,i),!1):(s.h(o,i),!0)):-5e-6>(o=((t-o)*(t-e)+(i-r)*(i-n))/((e-t)*(e-t)+(n-i)*(n-i)))?(s.h(t,i),!1):1.000005i?(h.h(t,i),!1):(h.h(t,e),!0)):(s=(n-i)/(e-t),Xi.$(a,s)?(Xi.qh(t,i,e,n,o,r,h),!1):(o=(s*t-a*o+r-i)/(s-a),Xi.$(s,0)?(tt?(h.h(t,i),!1):(h.h(o,i),!0)):Xi.qh(t,i,e,n,o,s*(o-t)+i,h))))},MA:function(t,i,e,n,o){return Xi.Ve(e.x,e.y,n.x,n.y,t.x,t.y,i.x,i.y,o)},KA:function(t,i,e,n,o,r,s,a,h,l){function u(e,n){var o=(e-t)*(e-t)+(n-i)*(n-i);o(e>t?e-t:t-e)){if(0>(f=1-(e-o)*(e-o)/(f*f)))return h;n=-l*(f=Math.sqrt(f))+r,u(e,l*f+r),u(e,n)}else{if(0>(f=(a=2*(e=(n-i)/(e-t))*(i-e*t)/(l*l)-2*e*r/(l*l)-2*o/(f*f))*a-4*(n=1/(f*f)+e*e/(l*l))*(2*e*t*r/(l*l)-2*i*r/(l*l)+r*r/(l*l)+o*o/(f*f)-1+(i-e*t)*(i-e*t)/(l*l))))return h;u(l=(-a+(f=Math.sqrt(f)))/(2*n),e*l-e*t+i),u(f=(-a-f)/(2*n),e*f-e*t+i)}return h},Ff:function(t,i,e,n,o,r,s,a,h){var l=1e21,u=t,c=i;if(Xi.Ve(t,i,t,n,o,r,s,a,h)){var f=(h.x-o)*(h.x-o)+(h.y-r)*(h.y-r);fl},us:function(t,i,e){return Xi.Fx(t.x,t.y,t.width,t.height,i.x,i.y,e.x,e.y)},Fx:function(t,i,e,n,o,r,s,a){var h=t+e,l=i+n;return o===s?(r=i):r===a?(o=t):!!(Xt(t,i,e,n,o,r)||Xt(t,i,e,n,s,a)||Xi.Rl(t,i,h,i,o,r,s,a)||Xi.Rl(h,i,h,l,o,r,s,a)||Xi.Rl(h,l,t,l,o,r,s,a)||Xi.Rl(t,l,t,i,o,r,s,a))},Rl:function(t,i,e,n,o,r,s,a){return t===e&&i===n&&o===s&&r===a?t===o&&i===r:0>=Xi.Fl(t,i,e,n,o,r)*Xi.Fl(t,i,e,n,s,a)&&0>=Xi.Fl(o,r,s,a,t,i)*Xi.Fl(o,r,s,a,e,n)},Fl:function(t,i,e,n,o,r){return e-=t,0===(r=(t=o-t)*(n-=i)-(i=r-i)*e)&&(0<(r=t*e+i*n)&&(0>(r=(t-e)*e+(i-n)*n)&&(r=0))),r},bp:function(t){return 0>t&&(t+=360),360<=t&&(t-=360),t},jx:function(t,i,e,n,o,r){var s=Math.PI;r||(n*=s/180,o*=s/180);var a=n>o?-1:1;r=[];var h=s/2,l=n;if(1e-5>(n=Math.min(2*s,Math.abs(o-n))))return h=l+a*Math.min(n,h),a=t+e*Math.cos(l),l=i+e*Math.sin(l),t+=e*Math.cos(h),i+=e*Math.sin(h),e=(a+t)/2,h=(l+i)/2,r.push([a,l,e,h,e,h,t,i]),r;for(;1e-5e,r=0>n;if(tl&&((i=.5*(a+h))!==a&&i!==h);++l){var u=t/(i+o),c=s/(i+r);if(0<(u=u*u+c*c-1))a=i;else{if(!(0>u))break;h=i}}e=o*e/(i+o)-e,n=r*n/(i+r)-n,e=Math.sqrt(e*e+n*n)}else e=Math.abs(n-i);else(r=t*e)<(n=t*t-i*i)?(n=r/n,r=i*Math.sqrt(Math.abs(1-n*n)),e=t*n-e,e=Math.sqrt(e*e+r*r)):e=Math.abs(e-t);return e},Ze:new X,um:new X,Mf:new X,Nf:0,vm:100};function Ui(t){Q(this),this.l=2,void 0===t&&(t=Ui.o),this.na=t,this.Ec=this.Dc=this.pd=this.od=0,t===Ui.o?this.ee=new Z:(null===Ui.V&&(Ui.V=(new Z).freeze()),this.ee=Ui.V),this.aq=this.ee.Ja,this.Ip=(new Bt).freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=ti,this.gg=hi,this.Rk=this.Sk=NaN,this.Uf=cs}function qi(t,i){return t.type===Ui.j&&i.type===Ui.o&&!!(1===i.figures.count&&(i=i.figures.M(0),1===i.segments.count&&Xi.B(t.startX,i.startX)&&Xi.B(t.startY,i.startY)&&(i=i.segments.M(0),i.type===ne&&Xi.B(t.endX,i.endX)&&Xi.B(t.endY,i.endY))))}function Ki(t,i,e){switch(t.type){case Ui.j:case Ui.u:case Ui.F:e?i.h(t.od,t.pd,0,0):Gt(i,t.od,t.pd,0,0),Gt(i,t.Dc,t.Ec,0,0);break;case Ui.o:var n=t.figures;t=n.s,n=n.length;for(var o=0;o=t)return 0;if((o>s?o-s:s-o)<(r>a?r-a:a-r)){if(ra)return 0}else if(ir)return 0}else if(os)return 0}else if(lo)return 0;return 0(t=r%360)&&(t+=360),this.Ne=t,this.Vh=0,this.Wh=Math.max(n,0),this.Pg=Math.max(o,0),"boolean"==typeof s?s&&(this.isLargeArc=!0):"number"==typeof s&&s&&(this.isLargeArc=!0),a&&(this.isClockwiseArc=!0)):(this.Ne=n,this.Vh=o,t===se&&(r=Math.max(r,0)),this.Wh=r,"number"==typeof s?(t===se&&(s=Math.max(s,0)),this.Pg=s):this.Pg=0),this.ae=null}function te(t,i){if(null!==t.ae&&!1===i._isInvalidBounds)return t.ae;var e=t.radiusX,n=t.radiusY;if(void 0===n&&(n=e),0===e||0===n)return t.ae=[],t.ae;i=t.Ne;var o=t.Vh,r=Xi.jx(0,0,e=(d=(c*d+l*a)/(Math.sqrt(c*c+l*l)*Math.sqrt(d*d+a*a)))?s=Math.PI:1<=d&&(s=0),!h&&0s&&(s+=2*Math.PI),h=i>r?1:i/r,d=i>r?r/i:1,i=Xi.jx(0,0,i>r?i:r,u,u+s,!0),(r=Yi.alloc()).reset(),r.translate(e,n),r.rotate(t.Ne,0,0),r.scale(h,d),Ui.Ha(i,r),Yi.free(r),t.ae=i,t.ae}Xi.za=Xi.AA,Ui.prototype.copy=function(){var t=new Ui;if(t.l=-2&this.l,t.na=this.na,t.od=this.od,t.pd=this.pd,t.Dc=this.Dc,t.Ec=this.Ec,this.na===Ui.o){for(var i=this.ee.s,e=t.ee,n=0;nt?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(t)+" "+this.startY.toFixed(t)+"L"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);case Ui.u:var i=new Bt(this.startX,this.startY,0,0);return i.Kv(this.endX,this.endY,0,0),0>t?"M"+i.x.toString()+" "+i.y.toString()+"H"+i.right.toString()+"V"+i.bottom.toString()+"H"+i.left.toString()+"z":"M"+i.x.toFixed(t)+" "+i.y.toFixed(t)+"H"+i.right.toFixed(t)+"V"+i.bottom.toFixed(t)+"H"+i.left.toFixed(t)+"z";case Ui.F:if((i=new Bt(this.startX,this.startY,0,0)).Kv(this.endX,this.endY,0,0),0>t)return"M"+(t=i.left.toString()+" "+(i.y+i.height/2).toString())+"A"+(i.width/2).toString()+" "+(i.height/2).toString()+" 0 0 1 "+i.right.toString()+" "+(i.y+i.height/2).toString()+"A"+(i.width/2).toString()+" "+(i.height/2).toString()+" 0 0 1 "+t;var e=i.left.toFixed(t)+" "+(i.y+i.height/2).toFixed(t);return"M"+e+"A"+(i.width/2).toFixed(t)+" "+(i.height/2).toFixed(t)+" 0 0 1 "+i.right.toFixed(t)+" "+(i.y+i.height/2).toFixed(t)+"A"+(i.width/2).toFixed(t)+" "+(i.height/2).toFixed(t)+" 0 0 1 "+e;case Ui.o:i="";for(var n=(e=this.figures.s).length,o=0;o=b-1||null!==l[g+1].match(w)}function n(){return g++,l[g]}function o(t){var i=parseFloat(n()),e=parseFloat(n());m===m.toLowerCase()&&(i=x.x+i,e=x.y+e),t.h(i,e)}function r(){return o(x),x}function s(){return o(v),v}function a(){var t=y.toLowerCase();return"c"!==t&&"s"!==t&&"q"!==t&&"t"!==t?x:new pt(2*x.x-v.x,2*x.y-v.y)}void 0===i&&(i=!1);var h=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,l=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/,/gm," ")).replace(h,"$1 $2")).replace(h,"$1 $2")).replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2")).replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2")).replace(/([0-9])([+\-])/gm,"$1 $2")).replace(/[\s\r\t\n]+/gm," ")).replace(/^\s+|\s+$/g,"")).split(" ");for(t=0;t=b-1);)if(y=m,""!==(m=n()))switch(m.toUpperCase()){case"X":d=!0,c=u=!1;break;case"M":for(p=r(),null===t.mc||!0===d?(du(t,p.x,p.y,u,!c,f),d=!1):t.moveTo(p.x,p.y),h.assign(x);!e();)p=r(),t.lineTo(p.x,p.y);break;case"L":for(;!e();)p=r(),t.lineTo(p.x,p.y);break;case"H":for(;!e();)x=new pt((m===m.toLowerCase()?x.x:0)+parseFloat(n()),x.y),t.lineTo(x.x,x.y);break;case"V":for(;!e();)x=new pt(x.x,(m===m.toLowerCase()?x.y:0)+parseFloat(n())),t.lineTo(x.x,x.y);break;case"C":for(;!e();){o(p=new pt);var k=s(),M=r();gu(t,p.x,p.y,k.x,k.y,M.x,M.y)}break;case"S":for(;!e();)p=a(),k=s(),M=r(),gu(t,p.x,p.y,k.x,k.y,M.x,M.y);break;case"Q":for(;!e();)p=s(),k=r(),mu(t,p.x,p.y,k.x,k.y);break;case"T":for(;!e();)v=p=a(),k=r(),mu(t,p.x,p.y,k.x,k.y);break;case"B":for(;!e();){p=parseFloat(n()),k=parseFloat(n()),M=parseFloat(n());var S=parseFloat(n()),N=parseFloat(n()),P=N,C=!1;e()||(P=parseFloat(n()),e()||(C=0!==parseFloat(n()))),m===m.toLowerCase()&&(M+=x.x,S+=x.y),t.arcTo(p,k,M,S,N,P,C)}break;case"A":for(;!e();)p=Math.abs(parseFloat(n())),k=Math.abs(parseFloat(n())),M=parseFloat(n()),N=S=!1,C=P=0,1===(P=n()).length?(S=!!parseFloat(P),N=!!parseFloat(n()),P=parseFloat(n())):2===P.length?(S=!!parseFloat(P[0]),N=!!parseFloat(P[1]),P=parseFloat(n())):(S=!!parseFloat(P[0]),N=!!parseFloat(P[1]),P=parseFloat(P.slice(2))),C=parseFloat(n()),m===m.toLowerCase()&&(P=x.x+P,C=x.y+C),x.h(P,C),yu(t,p,k,M,S,N,P,C);break;case"Z":pu(t),x.assign(h);break;case"F":for(p="",k=1;l[g+k];)if("0"===l[g+k])f=!0,k++;else if(null!==l[g+k].match(/[Uu]/))k++;else{if(null!==l[g+k].match(w)){p=l[g+k];break}k++}p.match(/[Mm]/)?u=!0:0(s=180*Math.atan2(i,t)/Math.PI)&&(s+=360),p.startAngle+=s),0>t&&(p.startAngle=180-p.startAngle,p.sweepAngle=-p.sweepAngle),0>n&&(p.startAngle=-p.startAngle,p.sweepAngle=-p.sweepAngle),p.radiusX*=Math.sqrt(t*t+e*e),void 0!==p.radiusY&&(p.radiusY*=Math.sqrt(i*i+n*n));break;case ae:if(s=p.endX,a=p.endY,p.endX=s*t+a*e+o,p.endY=s*i+a*n+r,0===p.radiusX||0===p.radiusY)break;0!==i&&(0>(s=180*Math.atan2(i,t)/Math.PI)&&(s+=360),p.xAxisRotation+=s),0>t&&(p.xAxisRotation=180-p.xAxisRotation,p.isClockwiseArc=!p.isClockwiseArc),0>n&&(p.xAxisRotation=-p.xAxisRotation,p.isClockwiseArc=!p.isClockwiseArc),p.radiusX*=Math.sqrt(t*t+e*e),p.radiusY*=Math.sqrt(i*i+n*n);break;default:w("Unknown Segment type: "+p.type)}}}}return this._isInvalidBounds=!0,this},i.ca=function(t,i){void 0===i&&(i=0);var e=this.od,n=this.pd,o=this.Dc,r=this.Ec;switch(this.type){case Ui.j:return Xi.Yb(e,n,o,r,i,t.x,t.y);case Ui.u:var s=Bt.allocAt(Math.min(e,o)-i,Math.min(n,r)-i,Math.abs(o-e)+2*i,Math.abs(r-n)+2*i);return t=s.ca(t),Bt.free(s),t;case Ui.F:s=Math.min(e,o)-i;var a=Math.min(n,r)-i;return e=(Math.abs(o-e)+2*i)/2,i=(Math.abs(r-n)+2*i)/2,0>=e||0>=i?!1:1>=(s=t.x-(s+e))*s/(e*e)+(a=t.y-(a+i))*a/(i*i);case Ui.o:return Hi(this,t,i,!0,!1);default:return!1}},i.Pu=function(t,i){if(0>t?t=0:1=r)return n=r-s,n=0===u?0:n/u,a=(e=e[a])[2*t],o=e[2*t+1],i.h(a+(e[2*t+2]-a)*n,o+(e[2*t+3]-o)*n),i;s+=u}}return i},i.wx=function(t){if(0>t?t=0:1=o)return i=(o=i[s])[2*t],e=o[2*t+1],n=o[2*t+2],t=o[2*t+3],1>Math.abs(n-i)&&1>Math.abs(t-e)?0:1>Math.abs(n-i)?0<=t-e?90:270:1>Math.abs(t-e)?0<=n-i?0:180:180*Math.atan2(t-e,n-i)/Math.PI;r+=l}}return NaN},i.Qu=function(t,i){if(0>t?t=0:1=r)return n=r-s,n=0===u?0:n/u,e=(u=e[a])[2*t],a=u[2*t+1],o=u[2*t+2],t=u[2*t+3],i[0]=e+(o-e)*n,i[1]=a+(t-a)*n,i[2]=1>Math.abs(o-e)&&1>Math.abs(t-a)?0:1>Math.abs(o-e)?0<=t-a?90:270:1>Math.abs(t-a)?0<=o-e?0:180:180*Math.atan2(t-a,o-e)/Math.PI,i;s+=u}}return i},i.xx=function(t){if(this.type===Ui.j){var i=this.startX,e=this.startY,n=this.endX,o=this.endY;if(i!==n||e!==o){var r=t.x;if(t=t.y,i===n){if(e=n?n===e?0:1:Math.abs(t-e)/(n-s)}if(e===o)return i=n?n===i?0:1:Math.abs(r-i)/(n-s);s=(n-i)*(n-i)+(o-e)*(o-e);var a=pt.alloc();return Xi.qh(i,e,n,o,r,t,a),t=a.x,r=a.y,pt.free(a),Math.sqrt(((t-i)*(t-i)+(r-e)*(r-e))/s)}}else{if(this.type!==Ui.u){i=this.flattenedSegments,e=this.flattenedLengths,r=this.flattenedTotalLength,n=pt.alloc(),o=1/0,a=s=0,y=i.length;for(var h=v=0,l=0;l(t=s/r)?0:1t?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(t)+" "+this.startY.toFixed(t),e=this.segments.s,n=e.length,o=0;ot?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case ne:t=0>t?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case oe:t=0>t?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(t)+" "+this.point1Y.toFixed(t)+" "+this.point2X.toFixed(t)+" "+this.point2Y.toFixed(t)+" "+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case re:t=0>t?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(t)+" "+this.point1Y.toFixed(t)+" "+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case se:t=0>t?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+" "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(t)+" "+this.sweepAngle.toFixed(t)+" "+this.centerX.toFixed(t)+" "+this.centerY.toFixed(t)+" "+this.radiusX.toFixed(t)+" "+this.radiusY.toFixed(t);break;case ae:t=0>t?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(t)+" "+this.radiusY.toFixed(t)+" "+this.xAxisRotation.toFixed(t)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;default:t=this.type.toString()}return t+(this.isClosed?"z":"")},i.freeze=function(){return this._isFrozen=!0,this},i.ka=function(){return this._isFrozen=!1,this},i.close=function(){return this.isClosed=!0,this},f.Object.defineProperties(Qi.prototype,{_isFrozen:{get:function(){return 0!=(1&this.l)},set:function(t){this.l=t?1|this.l:-2&this.l}},_isInvalidBounds:{get:function(){return 0!=(2&this.l)},set:function(t){this.l=t?2|this.l:-3&this.l}},isClosed:{get:function(){return 0!=(8&this.l)},set:function(t){this.isClosed!==t&&(this.l=t?8|this.l:-9&this.l,this._isInvalidBounds=!0)}},type:{get:function(){return this.na},set:function(t){this._isFrozen&&k(this,t),this.na=t,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(t){this._isFrozen&&k(this,t),this.Dc=t,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(t){this._isFrozen&&k(this,t),this.Ec=t,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(t){this._isFrozen&&k(this,t),this.Ne=t,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(t){this._isFrozen&&k(this,t),this.Vh=t,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(t){this._isFrozen&&k(this,t),this.Wh=t,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(t){this._isFrozen&&k(this,t),this.Pg=t,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(t){this._isFrozen&&k(this,t),this.Ne=t,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(t){this._isFrozen&&k(this,t),this.Vh=t,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(t){0>t&&M(t,">= zero",Qi,"radiusX"),this._isFrozen&&k(this,t),this.Wh=t,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(t){0>t&&M(t,">= zero",Qi,"radiusY"),this._isFrozen&&k(this,t),this.Pg=t,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(t){this._isFrozen&&k(this,t),0>(t%=360)&&(t+=360),this.Dc=t,this._isInvalidBounds=!0}},sweepAngle:{get:function(){return this.Ec},set:function(t){this._isFrozen&&k(this,t),360t&&(t=-360),this.Ec=t,this._isInvalidBounds=!0}},isClockwiseArc:{get:function(){return 0!=(4&this.l)},set:function(t){this._isFrozen&&k(this,t),this.l=t?4|this.l:-5&this.l,this._isInvalidBounds=!0}},isLargeArc:{get:function(){return 0!=(16&this.l)},set:function(t){this._isFrozen&&k(this,t),this.l=t?16|this.l:-17&this.l,this._isInvalidBounds=!0}},xAxisRotation:{get:function(){return this.Ne},set:function(t){this._isFrozen&&k(this,t),0>(t%=360)&&(t+=360),this.Ne=t,this._isInvalidBounds=!0}}}),Qi.prototype.equalsApprox=Qi.prototype.Xa;var ee=new V(Qi,"Move",0),ne=new V(Qi,"Line",1),oe=new V(Qi,"Bezier",2),re=new V(Qi,"QuadraticBezier",3),se=new V(Qi,"Arc",4),ae=new V(Qi,"SvgArc",4);function he(){this.H=null,this.xu=new pt(0,0).freeze(),this.mt=new pt(0,0).freeze(),this.Bp=this.Rq=0,this.Cp=1,this.xq="",this.Wr=this.Tp=!1,this.Rp=this.Ep=0,this.xg=this.nq=this.tq=!1,this.Zp=null,this.Rr=0,this.xd=this.Nr=null}function le(){this.H=null,this.xa="",this.ar=this.Lr=null}function ue(){this.Fm=fe,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}Qi.className="PathSegment",Qi.Move=ee,Qi.Line=ne,Qi.Bezier=oe,Qi.QuadraticBezier=re,Qi.Arc=se,Qi.SvgArc=ae,he.prototype.copy=function(){var t=new he;return this.clone(t)},he.prototype.clone=function(t){return t.H=this.H,t.xu.assign(this.viewPoint),t.mt.assign(this.documentPoint),t.Rq=this.Rq,t.Bp=this.Bp,t.Cp=this.Cp,t.xq=this.xq,t.Tp=this.Tp,t.Wr=this.Wr,t.Ep=this.Ep,t.Rp=this.Rp,t.tq=this.tq,t.nq=this.nq,t.xg=this.xg,t.Zp=this.Zp,t.Rr=this.Rr,t.Nr=this.Nr,t.xd=this.xd,t},he.prototype.toString=function(){var t="^";return 0!==this.modifiers&&(t+="M:"+this.modifiers),0!==this.button&&(t+="B:"+this.button),""!==this.key&&(t+="K:"+this.key),0!==this.clickCount&&(t+="C:"+this.clickCount),0!==this.delta&&(t+="D:"+this.delta),this.handled&&(t+="h"),this.bubbles&&(t+="b"),null!==this.documentPoint&&(t+="@"+this.documentPoint.toString()),t},he.prototype.So=function(t,i){var e=this.diagram;return null===e||Zo(e,t,i),i},he.prototype.Bz=function(t,i){var e=this.diagram;return null===e||(Zo(e,t,i),i.assign(e.Ps(i))),i},f.Object.defineProperties(he.prototype,{diagram:{get:function(){return this.H},set:function(t){this.H=t}},viewPoint:{get:function(){return this.xu},set:function(t){this.xu.assign(t)}},documentPoint:{get:function(){return this.mt},set:function(t){this.mt.assign(t)}},modifiers:{get:function(){return this.Rq},set:function(t){this.Rq=t}},button:{get:function(){return this.Bp},set:function(t){if(this.Bp=t,null===this.event)switch(t){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.Cp},set:function(t){this.Cp=t}},key:{get:function(){return this.xq},set:function(t){this.xq=t}},down:{get:function(){return this.Tp},set:function(t){this.Tp=t}},up:{get:function(){return this.Wr},set:function(t){this.Wr=t}},clickCount:{get:function(){return this.Ep},set:function(t){this.Ep=t}},delta:{get:function(){return this.Rp},set:function(t){this.Rp=t}},isMultiTouch:{get:function(){return this.tq},set:function(t){this.tq=t}},handled:{get:function(){return this.nq},set:function(t){this.nq=t}},bubbles:{get:function(){return this.xg},set:function(t){this.xg=t}},event:{get:function(){return this.Zp},set:function(t){this.Zp=t}},isTouchEvent:{get:function(){var t=this.event;return null!==t&&("touch"===t.pointerType||"pen"===t.pointerType)}},timestamp:{get:function(){return this.Rr},set:function(t){this.Rr=t}},targetDiagram:{get:function(){return this.Nr},set:function(t){this.Nr=t}},targetObject:{get:function(){return this.xd},set:function(t){this.xd=t}},control:{get:function(){return 0!=(1&this.modifiers)},set:function(t){this.modifiers=t?1|this.modifiers:-2&this.modifiers}},shift:{get:function(){return 0!=(4&this.modifiers)},set:function(t){this.modifiers=t?4|this.modifiers:-5&this.modifiers}},alt:{get:function(){return 0!=(2&this.modifiers)},set:function(t){this.modifiers=t?2|this.modifiers:-3&this.modifiers}},meta:{get:function(){return 0!=(8&this.modifiers)},set:function(t){this.modifiers=t?8|this.modifiers:-9&this.modifiers}},left:{get:function(){var t=this.event;return null===t||"mousedown"!==t.type&&"mouseup"!==t.type&&"pointerdown"!==t.type&&"pointerup"!==t.type?0!=(1&this.buttons):0===this.button},set:function(t){this.buttons=t?1|this.buttons:-2&this.buttons}},right:{get:function(){var t=this.event;return null===t||"mousedown"!==t.type&&"mouseup"!==t.type&&"pointerdown"!==t.type&&"pointerup"!==t.type?0!=(2&this.buttons):2===this.button},set:function(t){this.buttons=t?2|this.buttons:-3&this.buttons}},middle:{get:function(){var t=this.event;return null===t||"mousedown"!==t.type&&"mouseup"!==t.type&&"pointerdown"!==t.type&&"pointerup"!==t.type?0!=(4&this.buttons):1===this.button},set:function(t){this.buttons=t?4|this.buttons:-5&this.buttons}}}),he.prototype.getMultiTouchDocumentPoint=he.prototype.Bz,he.prototype.getMultiTouchViewPoint=he.prototype.So,he.className="InputEvent",le.prototype.copy=function(){var t=new le;return t.H=this.H,t.xa=this.xa,t.Lr=this.Lr,t.ar=this.ar,t},le.prototype.toString=function(){var t="*"+this.name;return null!==this.subject&&(t+=":"+this.subject.toString()),null!==this.parameter&&(t+="("+this.parameter.toString()+")"),t},f.Object.defineProperties(le.prototype,{diagram:{get:function(){return this.H},set:function(t){this.H=t}},name:{get:function(){return this.xa},set:function(t){this.xa=t}},subject:{get:function(){return this.Lr},set:function(t){this.Lr=t}},parameter:{get:function(){return this.ar},set:function(t){this.ar=t}}}),le.className="DiagramEvent",ue.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},ue.prototype.copy=function(){var t=new ue;t.Fm=this.Fm,t.Qq=this.Qq,t.rf=this.rf,t.cc=this.cc,t.H=this.H,t.Qn=this.Qn;var i=this.Sn;return t.Sn=N(i)&&"function"==typeof i.J?i.J():i,i=this.Rn,t.Rn=N(i)&&"function"==typeof i.J?i.J():i,i=this.Mn,t.Mn=N(i)&&"function"==typeof i.J?i.J():i,i=this.Ln,t.Ln=N(i)&&"function"==typeof i.J?i.J():i,t},ue.prototype.qb=function(t){t.classType===ue&&(this.change=t)},ue.prototype.toString=function(){var t="";return t=this.change===ce?t+"* ":this.change===fe?t+(null!==this.model?"!m":"!d"):t+(null!==this.model?"!m":"!d")+this.change,this.propertyName&&"string"==typeof this.propertyName&&(t+=" "+this.propertyName),this.modelChange&&this.modelChange!==this.propertyName&&(t+=" "+this.modelChange),t+=": ",this.change===ce?null!==this.oldValue&&(t+=" "+this.oldValue):(null!==this.object&&(t+=D(this.object)),null!==this.oldValue&&(t+=" old: "+D(this.oldValue)),null!==this.oldParam&&(t+=" "+this.oldParam),null!==this.newValue&&(t+=" new: "+D(this.newValue)),null!==this.newParam&&(t+=" "+this.newParam)),t},ue.prototype.I=function(t){return t?this.oldValue:this.newValue},ue.prototype.Dz=function(t){return t?this.oldParam:this.newParam},ue.prototype.canUndo=function(){return null!==this.model||null!==this.diagram},ue.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))},ue.prototype.canRedo=function(){return null!==this.model||null!==this.diagram},ue.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))},f.Object.defineProperties(ue.prototype,{model:{get:function(){return this.cc},set:function(t){this.cc=t}},diagram:{get:function(){return this.H},set:function(t){this.H=t}},change:{get:function(){return this.Fm},set:function(t){this.Fm=t}},modelChange:{get:function(){return this.Qq},set:function(t){this.Qq=t}},propertyName:{get:function(){return this.rf},set:function(t){this.rf=t}},isTransactionFinished:{get:function(){return this.Fm===ce&&("CommittedTransaction"===this.rf||"FinishedUndo"===this.rf||"FinishedRedo"===this.rf)}},object:{get:function(){return this.Qn},set:function(t){this.Qn=t}},oldValue:{get:function(){return this.Sn},set:function(t){this.Sn=t}},oldParam:{get:function(){return this.Rn},set:function(t){this.Rn=t}},newValue:{get:function(){return this.Mn},set:function(t){this.Mn=t}},newParam:{get:function(){return this.Ln},set:function(t){this.Ln=t}}}),ue.prototype.redo=ue.prototype.redo,ue.prototype.canRedo=ue.prototype.canRedo,ue.prototype.undo=ue.prototype.undo,ue.prototype.canUndo=ue.prototype.canUndo,ue.prototype.getParam=ue.prototype.Dz,ue.prototype.getValue=ue.prototype.I,ue.prototype.clear=ue.prototype.clear;var ce=new V(ue,"Transaction",-1),fe=new V(ue,"Property",0),de=new V(ue,"Insert",1),pe=new V(ue,"Remove",2);function ge(){this.o=(new Z).freeze(),this.xa="",this.j=!1}function me(){this.Pt=new $,this.Jd=!1,this.u=(new Z).freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=(new Z).freeze(),this.hl=new Z,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}function ye(t,i,e){if(t.isUndoingRedoing)return!1;t.checksTransactionLevel&&1>t.transactionLevel&&S("Ending transaction without having started a transaction: "+e);var n=1===t.transactionLevel,o=t.currentTransaction;n&&i&&(t.isInternalTransaction||t.Ob("CommittingTransaction",e,o));var r=0;if(0=n&&(null!==(r=i.M(0))&&r.clear(),i.mb(0),t.Ce--)),0===n||0!==i.count&&i.get(i.count-1)===o||(i.add(o),t.Ce++),i.freeze()),t.isInternalTransaction||t.Ob("CommittedTransaction",e,o);else{t.Fe=!0;try{t.isEnabled&&null!==o&&(o.isComplete=!0,o.undo())}finally{t.isInternalTransaction||t.Ob("RolledBackTransaction",e,o),t.Fe=!1}null!==o&&o.clear()}return t.Np=null,t.isPendingClear&&t.clear(),t.isPendingClear=!1,t.isPendingUnmodified=!1,!0}if(t.isEnabled&&!i&&null!==o){for(t=r,o=(e=o.changes).count-1;o>=t;o--)null!==(i=e.M(o))&&i.undo(),e.ka(),e.mb(o);e.freeze()}return!1}function ve(){Q(this),this.H=bo,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new he,this.Zr=-1}function xe(){ve.call(this),this.name="ToolManager",this.hb=new Z,this.ob=new Z,this.Hb=new Z,this.F=this.V=850,this.o=new At(2,2).ja(),this.Ha=5e3,this.ia=ke,this.u=Ne,this.Mp=this.j=null,this.zj=-1}function be(t,i){t.standardMouseOver(),t.isBeyondDragSize()&&t.standardWaitAfter(t.isActive?t.holdDelay:t.hoverDelay,i.lastInput)}ue.className="ChangedEvent",ue.Transaction=ce,ue.Property=fe,ue.Insert=de,ue.Remove=pe,ge.prototype.toString=function(t){var i="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==t&&0i&&t.cd(i,n),i++);for(;t.length>i;)t.pop();t.freeze()}},f.Object.defineProperties(ge.prototype,{changes:{get:function(){return this.o}},name:{get:function(){return this.xa},set:function(t){this.xa=t}},isComplete:{get:function(){return this.j},set:function(t){this.j=t}}}),ge.prototype.optimize=ge.prototype.ak,ge.prototype.redo=ge.prototype.redo,ge.prototype.canRedo=ge.prototype.canRedo,ge.prototype.undo=ge.prototype.undo,ge.prototype.canUndo=ge.prototype.canUndo,ge.prototype.clear=ge.prototype.clear,ge.className="Transaction",me.prototype.toString=function(t){var i="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;i+="[";for(var e=this.nestedTransactionNames.count,n=0;nthis.historyIndex;i--){var e=t.M(i);null!==e&&e.clear(),t.mb(i),this.rq=!0}t.freeze()}},me.prototype.canUndo=function(){if(!this.isEnabled||0=this.transactionLevel&&!this.tt&&(null!==(t=t.diagram)&&!1===t.pi||S("Change not within a transaction: "+e.toString()))}},me.prototype.skipsEvent=function(t){if(null===t||0>t.change.value)return!0;if(null===(t=t.object))return!1;if(void 0!==t.layer){if(null!==(t=t.layer)&&t.isTemporary)return!0}else if(t.isTemporary)return!0;return!1},f.Object.defineProperties(me.prototype,{models:{get:function(){return this.Pt.iterator}},isEnabled:{get:function(){return this.Jd},set:function(t){this.Jd=t}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.M(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndexo||Math.abs(i.y-t.y)>n},f.Object.defineProperties(ve.prototype,{diagram:{get:function(){return this.H},set:function(t){t instanceof To&&(this.H=t)}},name:{get:function(){return this.xa},set:function(t){this.xa=t}},isEnabled:{get:function(){return this.Jd},set:function(t){this.Jd=t}},isActive:{get:function(){return this.nb},set:function(t){this.nb=t}},transactionResult:{get:function(){return this.wm},set:function(t){this.wm=t}}}),ve.prototype.startTransaction=ve.prototype.Ea,ve.className="Tool",c(xe,ve),xe.prototype.initializeStandardTools=function(){},xe.prototype.updateAdornments=function(t){var i=this.currentToolTip;if(i instanceof Hu&&this.Mp===t){var e=i.adornedObject;(null!==t?e.part===t:null===e)?this.showToolTip(i,e):this.hideToolTip()}},xe.prototype.doMouseDown=function(){var t=this.diagram,i=t.lastInput;if(i.isTouchEvent&&this.gestureBehavior===Pe&&(i.bubbles=!1),i.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===Ce)return void(i.bubbles=!0);if(this.gestureBehavior===Pe)return;if(t.currentTool.canStartMultiTouch())return void t.currentTool.standardPinchZoomStart()}for(var e=this.mouseDownTools.length,n=0;no.right&&(e.x-=n.width+5/i.scale),e.xo.bottom?e.y-(n.height+5/i.scale):e.y+20/i.scale,e.ye.pointsCount)){var n=t.diagram;if(!n.isReadOnly){var o=t.Oe;if(null!==o){var r=null,s=null;null===e.fromNode&&(null!==(r=Ve(t,e.i(0),!1))&&(s=r.part));var a=null,h=null;null===e.toNode&&(null!==(a=Ve(t,e.i(e.pointsCount-1),!0))&&(h=a.part)),o.isValidLink(s,r,h,a)?i?(e.defaultFromPoint=e.i(0),e.defaultToPoint=e.i(e.pointsCount-1),e.suspendsRouting=!1,e.fromNode=s,null!==r&&(e.fromPortId=r.portId),e.toNode=h,null!==a&&(e.toPortId=a.portId),e.fromPort!==n.Mx&&n.R("LinkRelinked",e,n.Mx),e.toPort!==n.Nx&&n.R("LinkRelinked",e,n.Nx)):rn(o,s,r,h,a):rn(o,null,null,null,null)}}}}function Ge(t,i){var e=t.diagram;t.dragsLink&&Ye(t,!0),Ae(t);var n=t.findDragOverObject(i),o=e.lastInput;if(o.targetObject=n,null!==n){o.handled=!1;for(var r=n;null!==r;){var s=r.mouseDrop;if(null!==s&&(s(o,r),o.handled))break;Xe(t,o,r),r=Ee(r)}}else null!==(r=e.mouseDrop)&&r(o);if(t.isActive||null!==Ke){for(o=(t.copiedParts||t.draggedParts).iterator;o.next();)(r=o.key)instanceof Ju&&r.linksConnected.each((function(t){t.suspendsRouting=!1}));if(t.doDropOnto(i,n),t.isActive||null!==Ke){for(t=Bt.alloc(),i=e.selection.iterator;i.next();)(n=i.value)instanceof Ju&&Ue(e,n,t);Bt.free(t)}}}function Xe(t,i,e){t=t.diagram,e=e.part,!t.handlesDragDropForTopLevelParts||!e.isTopLevel||e instanceof gc||null!==(e=t.mouseDrop)&&e(i)}function Ue(t,i,e){var n=!1;if(e=i.getAvoidableRect(e),t.viewportBounds.Re(e)&&(n=!0),0!==(t=t.Nu(e,(function(t){return t.part}),(function(t){return t instanceof wc}),!0,(function(t){return t instanceof wc}),n)).count)for(t=t.iterator;t.next();)!(e=t.value).Td(i)&&e.isAvoiding&&e.bb()}function qe(t,i,e,n){if(null===t.copiedParts){var o=t.diagram;if(!o.isReadOnly&&!o.isModelReadOnly){o.skipsUndoManager=!e,o.partManager.addsToTemporaryLayer=!e,t.startPoint=n.documentPoint,e=o.Kj(i,o,!0);var r=Bt.alloc();o=n=1/0;for(var s=-1/0,a=-1/0,h=i.iterator;h.next();){var l=h.value;if(l.isVisible()){var u=l.location;l=u.x,u=u.y,isNaN(l)||isNaN(u)||(ls&&(s=l),u>a&&(a=u))}}for(1/0===n?r.h(0,0,0,0):r.h(n,o,s-n,a-o),n=r.x+r.width/2,o=r.y+r.height/2,Bt.free(r),r=t.Fr,s=new dt,a=pt.alloc(),h=i.iterator;h.next();)(l=h.value)instanceof wc&&l.canCopy()&&(null!==(u=e.I(l))&&(u.points=l.points,Sc(u,r.x-n,r.y-o),u.suspendsRouting=!0,s.add(u,t.Pd())));for(i=i.iterator;i.next();)(l=i.value).Zc()&&l.canCopy()&&(null!==(h=e.I(l))&&(l=l.location,a.h(r.x-(n-l.x),r.y-(o-l.y)),h.location=a,h.Va(),s.add(h,t.Pd(a))));pt.free(a),t.copiedParts=s,Le(t,s.Lf()),null!==t.draggedLink&&(i=(e=t.draggedLink).routeBounds,Sc(e,t.startPoint.x-(i.x+i.width/2),t.startPoint.y-(i.y+i.height/2))),t.doUpdateCursor(null)}}}xe.className="ToolManager",xe.WheelScroll=ke,xe.WheelZoom=Me,xe.WheelNone=Se,xe.GestureZoom=Ne,xe.GestureCancel=Pe,xe.GestureNone=Ce,c(Te,ve),Te.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(t.isReadOnly&&!t.allowDragOut||!t.allowMove&&!t.allowCopy&&!t.allowDragOut||!t.allowSelect)return!1;var i=t.lastInput;return!(!i.left||t.currentTool!==this&&(!this.isBeyondDragSize()||i.isTouchEvent&&i.timestamp-t.firstInput.timestamp=n&&(n=.1);var o=this,r=i.og(e,n,(function(i){return o.findValidLinkablePort(i,t)}),null,!0);for(n=1/0,i=null,r=r.iterator;r.next();){var s=r.value,a=s.part;if(a instanceof Ju){var h=s.ga(oi,pt.alloc()),l=e.x-h.x,u=e.y-h.y;pt.free(h),(h=l*l+u*u)e){if(null!==this.originalLink&&t===this.originalFromNode&&i===this.originalFromPort)return!0;if(null===(i=i.portId)&&(i=""),t.Mo(i).count>=e)return!1}return!0},We.prototype.isValidTo=function(t,i){if(null===t||null===i)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==t.layer&&!t.layer.allowLink||!0!==i.toLinkable))return!1;var e=i.toMaxLinks;if(1/0>e){if(null!==this.originalLink&&t===this.originalToNode&&i===this.originalToPort)return!0;if(null===(i=i.portId)&&(i=""),t.Sd(i).count>=e)return!1}return!0},We.prototype.isInSameNode=function(t,i){return null!==t&&null!==i&&(t===i||(t=t.part,i=i.part,null!==t&&t===i))},We.prototype.isLinked=function(t,i){if(null===t||null===i)return!1;var e=t.part;if(!(e instanceof Ju))return!1;null===(t=t.portId)&&(t="");var n=i.part;if(!(n instanceof Ju))return!1;for(null===(i=i.portId)&&(i=""),i=n.Sd(i);i.next();)if((n=i.value).fromNode===e&&n.fromPortId===t)return!0;return!1},We.prototype.isValidLink=function(t,i,e,n){if(!this.isValidFrom(t,i)||!this.isValidTo(e,n)||!(null===i||null===n||(i.fromLinkableSelfNode&&n.toLinkableSelfNode||!this.isInSameNode(i,n))&&(i.fromLinkableDuplicates&&n.toLinkableDuplicates||!this.isLinked(i,n)))||null!==this.originalLink&&(null!==t&&this.isLabelDependentOnLink(t,this.originalLink)||null!==e&&this.isLabelDependentOnLink(e,this.originalLink))||null!==t&&null!==e&&(null===t.data&&null!==e.data||null!==t.data&&null===e.data)||!this.isValidCycle(t,e,this.originalLink))return!1;if(null!==t){var o=t.linkValidation;if(null!==o&&!o(t,i,e,n,this.originalLink))return!1}return!(null!==e&&null!==(o=e.linkValidation)&&!o(t,i,e,n,this.originalLink))&&(null===(o=this.linkValidation)||o(t,i,e,n,this.originalLink))},We.prototype.isLabelDependentOnLink=function(t,i){if(null===t)return!1;var e=t.labeledLink;if(null===e)return!1;if(e===i)return!0;var n=new $;return n.add(t),Je(this,e,i,n)},We.prototype.isValidCycle=function(t,i,e){if(void 0===e&&(e=null),null===t||null===i)return this.isUnconnectedLinkValid;var n=this.diagram.validCycle;if(n!==Kr){if(n===Zr){if(null!==(n=e||this.temporaryLink)&&!n.isTreeLink)return!0;for(n=i.linksConnected;n.next();){var o=n.value;if(o!==e&&o.isTreeLink&&o.toNode===i)return!1}return!Ze(this,t,i,e,!0)}if(n===_r){if(null!==(n=e||this.temporaryLink)&&!n.isTreeLink)return!0;for(n=t.linksConnected;n.next();)if((o=n.value)!==e&&o.isTreeLink&&o.fromNode===t)return!1;return!Ze(this,t,i,e,!0)}if(n===Hr)return t===i?t=!0:((n=new $).add(i),t=_e(this,n,t,i,e)),!t;if(n===Wr)return!Ze(this,t,i,e,!1);if(n===Jr)return t===i?t=!0:((n=new $).add(i),t=$e(this,n,t,i,e)),!t}return!0},f.Object.defineProperties(We.prototype,{portGravity:{get:function(){return this.te},set:function(t){0<=t&&(this.te=t)}},isUnconnectedLinkValid:{get:function(){return this.Ha},set:function(t){this.Ha=t}},linkingCursor:{get:function(){return this.u},set:function(t){this.u=t}},temporaryLink:{get:function(){return this.Ci},set:function(t){this.Ci=t}},temporaryFromNode:{get:function(){return this.Bi},set:function(t){(this.Bi=t)&&(this.j=t.port)}},temporaryFromPort:{get:function(){return this.j},set:function(t){if(null!==this.j){var i=this.j.panel;if(null!==i){var e=i.O.indexOf(this.j);i.mb(e),i.Gb(e,t)}}this.j=t}},temporaryToNode:{get:function(){return this.Di},set:function(t){(this.Di=t)&&(this.o=t.port)}},temporaryToPort:{get:function(){return this.o},set:function(t){if(null!==this.o){var i=this.o.panel;if(null!==i){var e=i.O.indexOf(this.o);i.mb(e),i.Gb(e,t)}}this.o=t}},originalLink:{get:function(){return this.Hb},set:function(t){this.Hb=t}},originalFromNode:{get:function(){return this.hb},set:function(t){this.hb=t}},originalFromPort:{get:function(){return this.ob},set:function(t){this.ob=t}},originalToNode:{get:function(){return this.Oc},set:function(t){this.Oc=t}},originalToPort:{get:function(){return this.Pc},set:function(t){this.Pc=t}},isForwards:{get:function(){return this.ia},set:function(t){this.ia=t}},validPortsCache:{get:function(){return this.hy}},targetPort:{get:function(){return this.Pf},set:function(t){this.Pf=t}},linkValidation:{get:function(){return this.gj},set:function(t){this.gj=t}},portTargeted:{get:function(){return this.Of},set:function(t){this.Of=t}}}),We.className="LinkingBaseTool",c(Qe,We),Qe.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowLink||!t.model.xs()||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize())&&null!==this.findLinkablePort()},Qe.prototype.findLinkablePort=function(){var t=this.diagram,i=this.startObject;if(null===i&&(i=t.ic(t.firstInput.documentPoint,null,null)),null===i)return null;if(!((t=i.part)instanceof Ju))return null;var e=this.direction;if(e===tn||e===en){var n=this.findValidLinkablePort(i,!1);if(null!==n||this.startObject===t&&(n=t.port,this.findValidLinkablePort(n,!1)))return this.isForwards=!0,n}return(e===tn||e===nn)&&(null!==(i=this.findValidLinkablePort(i,!0))||this.startObject===t&&(i=t.port,this.findValidLinkablePort(i,!0)))?(this.isForwards=!1,i):null},Qe.prototype.doActivate=function(){var t=this.diagram,i=this.findLinkablePort();null===i?this.stopTool():(this.Ea(this.name),t.isMouseCaptured=!0,t.currentCursor=this.linkingCursor,this.isForwards?(null!==this.temporaryToNode&&(this.temporaryToNode.location=t.lastInput.documentPoint),this.originalFromPort=i,(i=this.originalFromPort.part)instanceof Ju&&(this.originalFromNode=i),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(null!==this.temporaryFromNode&&(this.temporaryFromNode.location=t.lastInput.documentPoint),this.originalToPort=i,(i=this.originalToPort.part)instanceof Ju&&(this.originalToNode=i),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),t.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.Va(),t.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.Va(),null!==this.temporaryLink&&(null!==this.temporaryFromNode&&(this.temporaryLink.fromNode=this.temporaryFromNode),null!==this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.bb(),t.add(this.temporaryLink)),this.isActive=!0)},Qe.prototype.doDeactivate=function(){this.isActive=!1;var t=this.diagram;t.remove(this.temporaryLink),t.remove(this.temporaryFromNode),t.remove(this.temporaryToNode),t.isMouseCaptured=!1,t.currentCursor="",this.stopTransaction()},Qe.prototype.doStop=function(){We.prototype.doStop.call(this),this.startObject=null},Qe.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram,i=this.transactionResult=null,e=null,n=null,o=null,r=null;try{var s=this.targetPort=this.findTargetPort(this.isForwards);if(null!==s){var a=s.part;a instanceof Ju&&(this.isForwards?(null!==this.originalFromNode&&(i=this.originalFromNode,e=this.originalFromPort),n=a,o=s):(i=a,e=s,null!==this.originalToNode&&(n=this.originalToNode,o=this.originalToPort)))}else this.isForwards?null!==this.originalFromNode&&this.isUnconnectedLinkValid&&(i=this.originalFromNode,e=this.originalFromPort):null!==this.originalToNode&&this.isUnconnectedLinkValid&&(n=this.originalToNode,o=this.originalToPort);null!==i||null!==n?null!==(r=this.insertLink(i,e,n,o))?(null===s&&(this.isForwards?r.defaultToPoint=t.lastInput.documentPoint:r.defaultFromPoint=t.lastInput.documentPoint),t.allowSelect&&(t.R("ChangingSelection",t.selection),t.clearSelection(!0),r.isSelected=!0),this.transactionResult=this.name,t.R("LinkDrawn",r)):this.doNoLink(i,e,n,o):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),r&&t.allowSelect&&t.R("ChangedSelection",t.selection)}}},Qe.prototype.isNewTreeLink=function(){var t=this.archetypeLinkData;if(null===t)return!0;if(t instanceof wc)return t.isTreeLink;var i=this.diagram;return null===i||(t=i.partManager.getLinkCategoryForData(t),null===(i=i.partManager.findLinkTemplateForCategory(t))||i.isTreeLink)},Qe.prototype.insertLink=function(t,i,e,n){return this.diagram.partManager.insertLink(t,i,e,n)},Qe.prototype.doNoLink=function(){},f.Object.defineProperties(Qe.prototype,{archetypeLinkData:{get:function(){return this.V},set:function(t){this.V=t}},archetypeLabelNodeData:{get:function(){return this.F},set:function(t){this.F=t}},direction:{get:function(){return this.K},set:function(t){this.K=t}},startObject:{get:function(){return this.Xd},set:function(t){this.Xd=t}}});var tn=new V(Qe,"Either",0),en=new V(Qe,"ForwardsOnly",0),nn=new V(Qe,"BackwardsOnly",0);function on(){We.call(this),this.name="Relinking";var t=new pl;t.figure="Diamond",t.desiredSize=Nt,t.fill="lightblue",t.stroke="dodgerblue",t.cursor=this.linkingCursor,t.segmentIndex=0,this.V=t,(t=new pl).figure="Diamond",t.desiredSize=Nt,t.fill="lightblue",t.stroke="dodgerblue",t.cursor=this.linkingCursor,t.segmentIndex=-1,this.Xd=t,this.F=null,this.Ew=new Bt}function rn(t,i,e,n,o){null!==i?(t.copyPortProperties(i,e,t.temporaryFromNode,t.temporaryFromPort,!1),t.diagram.add(t.temporaryFromNode)):t.diagram.remove(t.temporaryFromNode),null!==n?(t.copyPortProperties(n,o,t.temporaryToNode,t.temporaryToPort,!0),t.diagram.add(t.temporaryToNode)):t.diagram.remove(t.temporaryToNode)}function sn(){ve.call(this),this.name="LinkReshaping";var t=new pl;t.figure="Rectangle",t.desiredSize=St,t.fill="lightblue",t.stroke="dodgerblue",this.o=t,(t=new pl).figure="Diamond",t.desiredSize=Nt,t.fill="lightblue",t.stroke="dodgerblue",t.cursor="move",this.u=t,this.F=3,this.Ts=this.j=null,this.Fw=new pt,this.Yq=new Z}function an(t,i,e,n,o,r){return r?Math.abs(i.y-e.y)i.firstPickIndex+1&&e=e.x)i=0>=e.y?i+225:1<=e.y?i+135:i+180;else if(1<=e.x)0>=e.y?i+=315:1<=e.y&&(i+=45);else if(0>=e.y)i+=270;else{if(!(1<=e.y))break t;i+=90}0>i?i+=360:360<=i&&(i-=360),t.cursor=22.5>i?"e-resize":67.5>i?"se-resize":112.5>i?"s-resize":157.5>i?"sw-resize":202.5>i?"w-resize":247.5>i?"nw-resize":292.5>i?"n-resize":337.5>i?"ne-resize":"e-resize"}else if(t instanceof Ch)for(t=t.elements;t.next();)this.updateResizeHandles(t.value,i)},fn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!(t.isReadOnly||!t.allowResize||!t.lastInput.left)&&null!==this.findToolHandleAt(t.firstInput.documentPoint,this.name)},fn.prototype.doActivate=function(){var t=this.diagram;null===this.handle&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),null!==this.handle&&(this.adornedObject=this.handle.part.adornedObject,null!==this.adornedObject&&(t.isMouseCaptured=!0,t.animationManager.Cc(),this.Ea(this.name),this.Xq.set(this.adornedObject.ga(this.handle.alignment.gv())),this.Tn.set(this.adornedObject.part.location),this.Dw.set(this.adornedObject.desiredSize),this.pt=this.computeCellSize(),this.rt=this.computeMinSize(),this.qt=this.computeMaxSize(),this.isActive=!0))},fn.prototype.doDeactivate=function(){var t=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=t.isMouseCaptured=!1},fn.prototype.stopTransaction=function(){var t=this.diagram,i=ve.prototype.stopTransaction.call(this);return i&&null!==t.undoManager.transactionToUndo&&t.undoManager.transactionToUndo.ak(),i},fn.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},fn.prototype.doMouseMove=function(){var t=this.diagram;if(this.isActive){var i=this.rt,e=this.qt,n=this.pt,o=this.adornedObject.qs(t.lastInput.documentPoint,pt.alloc()),r=this.computeReshape();i=this.computeResize(o,this.handle.alignment,i,e,n,r),this.resize(i),t.bd(),pt.free(o)}},fn.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){var i=this.rt,e=this.qt,n=this.pt,o=this.adornedObject.qs(t.lastInput.documentPoint,pt.alloc()),r=this.computeReshape();i=this.computeResize(o,this.handle.alignment,i,e,n,r),this.resize(i),pt.free(o),t.Ya(),this.transactionResult=this.name,t.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},fn.prototype.resize=function(t){var i=this.diagram,e=this.adornedObject;if(null!==e){if(e.desiredSize=t.size,(t=e.part).Va(),e=e.ga(this.handle.alignment.gv()),t instanceof gc){var n=new Z;if(n.add(t),!this.dragsMembers&&null===t.placeholder){var o=new Ms;o.dragsMembers=!1}i.moveParts(n,this.oppositePoint.copy().re(e),!0,o)}else t.location=t.location.copy().re(e).add(this.oppositePoint);i.bd()}},fn.prototype.computeResize=function(t,i,e,n,o,r){i.Mc()&&(i=oi);var s=this.adornedObject.naturalBounds,a=s.x,h=s.y,l=s.x+s.width,u=s.y+s.height,c=1;if(!r){c=s.width;var f=s.height;0>=c&&(c=1),0>=f&&(f=1),c=f/c}return f=pt.alloc(),Xi.No(t.x,t.y,a,h,o.width,o.height,f),t=s.copy(),0>=i.x?0>=i.y?(t.x=Math.max(f.x,l-n.width),t.x=Math.min(t.x,l-e.width),t.width=Math.max(l-t.x,e.width),t.y=Math.max(f.y,u-n.height),t.y=Math.min(t.y,u-e.height),t.height=Math.max(u-t.y,e.height),r||(1<=t.height/t.width?(t.height=Math.max(Math.min(c*t.width,n.height),e.height),t.width=t.height/c):(t.width=Math.max(Math.min(t.height/c,n.width),e.width),t.height=c*t.width),t.x=l-t.width,t.y=u-t.height)):1<=i.y?(t.x=Math.max(f.x,l-n.width),t.x=Math.min(t.x,l-e.width),t.width=Math.max(l-t.x,e.width),t.height=Math.max(Math.min(f.y-h,n.height),e.height),r||(1<=t.height/t.width?(t.height=Math.max(Math.min(c*t.width,n.height),e.height),t.width=t.height/c):(t.width=Math.max(Math.min(t.height/c,n.width),e.width),t.height=c*t.width),t.x=l-t.width)):(t.x=Math.max(f.x,l-n.width),t.x=Math.min(t.x,l-e.width),t.width=l-t.x,r||(t.height=Math.max(Math.min(c*t.width,n.height),e.height),t.width=t.height/c,t.y=h+.5*(u-h-t.height))):1<=i.x?0>=i.y?(t.width=Math.max(Math.min(f.x-a,n.width),e.width),t.y=Math.max(f.y,u-n.height),t.y=Math.min(t.y,u-e.height),t.height=Math.max(u-t.y,e.height),r||(1<=t.height/t.width?(t.height=Math.max(Math.min(c*t.width,n.height),e.height),t.width=t.height/c):(t.width=Math.max(Math.min(t.height/c,n.width),e.width),t.height=c*t.width),t.y=u-t.height)):1<=i.y?(t.width=Math.max(Math.min(f.x-a,n.width),e.width),t.height=Math.max(Math.min(f.y-h,n.height),e.height),r||(1<=t.height/t.width?(t.height=Math.max(Math.min(c*t.width,n.height),e.height),t.width=t.height/c):(t.width=Math.max(Math.min(t.height/c,n.width),e.width),t.height=c*t.width))):(t.width=Math.max(Math.min(f.x-a,n.width),e.width),r||(t.height=Math.max(Math.min(c*t.width,n.height),e.height),t.width=t.height/c,t.y=h+.5*(u-h-t.height))):0>=i.y?(t.y=Math.max(f.y,u-n.height),t.y=Math.min(t.y,u-e.height),t.height=u-t.y,r||(t.width=Math.max(Math.min(t.height/c,n.width),e.width),t.height=c*t.width,t.x=a+.5*(l-a-t.width))):1<=i.y&&(t.height=Math.max(Math.min(f.y-h,n.height),e.height),r||(t.width=Math.max(Math.min(t.height/c,n.width),e.width),t.height=c*t.width,t.x=a+.5*(l-a-t.width))),pt.free(f),t},fn.prototype.computeReshape=function(){var t=fs;return this.adornedObject instanceof pl&&(t=yl(this.adornedObject)),!(t===ds||this.diagram.lastInput.shift)},fn.prototype.computeMinSize=function(){var t=this.adornedObject.minSize.copy(),i=this.minSize;return!isNaN(i.width)&&i.width>t.width&&(t.width=i.width),!isNaN(i.height)&&i.height>t.height&&(t.height=i.height),t},fn.prototype.computeMaxSize=function(){var t=this.adornedObject.maxSize.copy(),i=this.maxSize;return!isNaN(i.width)&&i.widthe?e+=360:360<=e&&(e-=360),e=Math.round(45*Math.round(e/45));var n=this.handleDistance;return 0===e?i.x=t.naturalBounds.width+n:45===e?(i.x=t.naturalBounds.width+n,i.y=t.naturalBounds.height+n):90===e?i.y=t.naturalBounds.height+n:135===e?(i.x=-n,i.y=t.naturalBounds.height+n):180===e?i.x=-n:225===e?(i.x=-n,i.y=-n):270===e?i.y=-n:315===e&&(i.x=t.naturalBounds.width+n,i.y=-n),t.ga(i)},dn.prototype.doDeactivate=function(){var t=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new pt(NaN,NaN),this.isActive=t.isMouseCaptured=!1},dn.prototype.stopTransaction=function(){var t=this.diagram,i=ve.prototype.stopTransaction.call(this);return i&&null!==t.undoManager.transactionToUndo&&t.undoManager.transactionToUndo.ak(),i},dn.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},dn.prototype.doMouseMove=function(){var t=this.diagram;this.isActive&&(t=this.computeRotate(t.lastInput.documentPoint),this.rotate(t))},dn.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){t.delaysLayout=!1;var i=this.computeRotate(t.lastInput.documentPoint);this.rotate(i),t.Ya(),this.transactionResult=this.name,t.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()},dn.prototype.rotate=function(t){var i=this.adornedObject;if(null!==i){i.angle=t,(i=i.part).Va();var e=i.locationObject,n=i.rotateObject;(e===n||e.rg(n))&&(e=this.Tn.copy(),i.location=e.re(this.rotationPoint).rotate(t-this.originalAngle).add(this.rotationPoint)),this.diagram.bd()}},dn.prototype.computeRotate=function(t){t=this.rotationPoint.ab(t)-this.handleAngle;var i=this.adornedObject.panel;null!==i&&(t-=i.li()),360<=t?t-=360:0>t&&(t+=360),i=Math.min(Math.abs(this.snapAngleMultiple),180);var e=Math.min(Math.abs(this.snapAngleEpsilon),i/2);return!this.diagram.lastInput.shift&&0i-e&&(t=(Math.floor(t/i)+1)*i)),360<=t?t-=360:0>t&&(t+=360),t},f.Object.defineProperties(dn.prototype,{handleArchetype:{get:function(){return this.o},set:function(t){this.o=t}},handle:{get:function(){return this.j},set:function(t){if(null!==t&&!(t.part instanceof Hu))throw Error("new handle is not in an Adornment: "+t);this.j=t}},adornedObject:{get:function(){return this.ue},set:function(t){if(null!==t&&t.part instanceof Hu)throw Error("new handle must not be in an Adornment: "+t);this.ue=t}},snapAngleMultiple:{get:function(){return this.ia},set:function(t){this.ia=t}},snapAngleEpsilon:{get:function(){return this.V},set:function(t){this.V=t}},originalAngle:{get:function(){return this.Cw}},rotationPoint:{get:function(){return this.kr},set:function(t){this.kr=t.copy()}},handleAngle:{get:function(){return this.u},set:function(t){this.u=t}},handleDistance:{get:function(){return this.F},set:function(t){this.F=t}}}),dn.className="RotatingTool",O("rotatingTool",(function(){return this.findTool("Rotating")}),(function(t){this.gb("Rotating",t,this.mouseDownTools)})),c(pn,ve),pn.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},pn.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},pn.className="ClickSelectingTool",c(gn,ve),gn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram,i=t.lastInput,e=t.ic(i.documentPoint,(function(t){for(;null!==t.panel&&!t.isActionable;)t=t.panel;return t}));return null!==e&&(!!e.isActionable&&(this.pk=e,t.Ck=t.ic(i.documentPoint,null,null),!0))},gn.prototype.doMouseDown=function(){if(this.isActive){var t=this.diagram.lastInput,i=this.pk;null!==i&&(t.targetObject=i,null!==i.actionDown&&i.actionDown(t,i))}else this.canStart()&&this.doActivate()},gn.prototype.doMouseMove=function(){if(this.isActive){var t=this.diagram.lastInput,i=this.pk;null!==i&&(t.targetObject=i,null!==i.actionMove&&i.actionMove(t,i))}},gn.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram.lastInput,i=this.pk;if(null===i)return;t.targetObject=i,null!==i.actionUp&&i.actionUp(t,i),this.standardMouseClick((function(t){for(;null!==t.panel&&(!t.isActionable||t!==i);)t=t.panel;return t}),(function(t){return t===i}))}this.stopTool()},gn.prototype.doCancel=function(){var t=this.diagram.lastInput,i=this.pk;null!==i&&(t.targetObject=i,null!==i.actionCancel&&i.actionCancel(t,i),this.stopTool())},gn.prototype.doStop=function(){this.pk=null},gn.className="ActionTool",c(mn,ve),mn.prototype.canStart=function(){if(!this.isEnabled||null===this.archetypeNodeData)return!1;var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(1===t.lastInput.clickCount&&(this.mw=t.lastInput.viewPoint.copy()),2!==t.lastInput.clickCount||this.isBeyondDragSize(this.mw))return!1}else if(1!==t.lastInput.clickCount)return!1;return t.currentTool===this||null===t.Ol(t.lastInput.documentPoint,!0)},mn.prototype.doMouseUp=function(){var t=this.diagram;this.isActive&&this.insertPart(t.lastInput.documentPoint),this.stopTool()},mn.prototype.insertPart=function(t){var i=this.diagram,e=this.archetypeNodeData;if(null===e)return null;var n=null;try{if(i.R("ChangingSelection",i.selection),this.Ea(this.name),e instanceof ku)e.Zc()&&(Wh(e),null!==(n=e.copy())&&i.add(n));else if(null!==e){var o=i.model.copyNodeData(e);N(o)&&(i.model.xf(o),n=i.Lc(o))}if(null!==n){var r=pt.allocAt(t.x,t.y);this.isGridSnapEnabled&&cr(this.diagram,n,t,r),n.location=r,i.allowSelect&&(i.clearSelection(!0),n.isSelected=!0),pt.free(r)}i.Ya(),this.transactionResult=this.name,i.R("PartCreated",n)}finally{this.stopTransaction(),i.R("ChangedSelection",i.selection)}return n},f.Object.defineProperties(mn.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(t){this.Ri=t}},isDoubleClick:{get:function(){return this.o},set:function(t){this.o=t}},isGridSnapEnabled:{get:function(){return this.j},set:function(t){this.j=t}}}),mn.className="ClickCreatingTool",c(yn,ve),yn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(!t.allowSelect)return!1;var i=t.lastInput;return!(!i.left||t.currentTool!==this&&(!this.isBeyondDragSize()||i.timestamp-t.firstInput.timestampo.right&&(e.x-=n.width+5/i.scale),e.xo.bottom&&(e.y-=n.height+5/i.scale),e.yt.lastInput.clickCount)},Ln.prototype.doStart=function(){Un=this,null!==this.textBlock&&this.doActivate()},Ln.prototype.doActivate=function(){if(!this.isActive){var t=this.diagram;if(null!==t){var i=this.textBlock;if(null===i&&(i=t.ic(t.lastInput.documentPoint)),null!==i&&i instanceof Pl&&(this.textBlock=i,null!==i.part)){t.animationManager.Cc(),this.isActive=!0,this.qa=En;var e=this.defaultTextEditor;null!==i.textEditor&&(e=i.textEditor),this.Zh=this.textBlock.copy();var n=new Bt(this.textBlock.ga(ti),this.textBlock.ga(hi));t.tv(n),e.show(i,t,this),this.currentTextEditor=e}}}},Ln.prototype.doCancel=function(){this.stopTool()},Ln.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},Ln.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Fn)},Ln.prototype.acceptText=function(t){switch(t){case Fn:this.qa===Xn?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():this.qa!==En&&this.qa!==Gn&&this.qa!==Vn||(this.qa=Yn,An(this));break;case jn:case Bn:case Dn:Bn===t&&!0===this.textBlock.isMultiline||this.qa!==En&&this.qa!==Gn&&this.qa!==Vn||(this.qa=Yn,An(this))}},Ln.prototype.doError=function(t,i){var e=this.textBlock;null!==e.errorFunction&&e.errorFunction(this,t,i),(t=this.currentTextEditor)&&t.show(e,this.diagram,this)},Ln.prototype.doSuccess=function(t,i){var e=this.textBlock;null!==e.textEdited&&e.textEdited(e,t,i)},Ln.prototype.doDeactivate=function(){var t=this.diagram;null!==t&&(this.qa=Rn,null!==this.currentTextEditor&&this.currentTextEditor.hide(t,this),this.textBlock=null,this.isActive=!1)},Ln.prototype.doStop=function(){Un=null},Ln.prototype.isValidText=function(t,i,e){var n=this.textValidation;return!(null!==n&&!n(t,i,e))&&!(null!==(n=t.textValidation)&&!n(t,i,e))},Ln.prototype.Lx=function(t){var i=this.Zh;return i.text=t,i.measure(this.textBlock.Ih,1/0),i},f.Object.defineProperties(Ln.prototype,{textBlock:{get:function(){return this.ia},set:function(t){this.ia=t}},currentTextEditor:{get:function(){return this.o},set:function(t){this.o=t}},defaultTextEditor:{get:function(){return this.j},set:function(t){this.j=t}},starting:{get:function(){return this.V},set:function(t){this.V=t}},textValidation:{get:function(){return this.vj},set:function(t){this.vj=t}},minimumEditorScale:{get:function(){return this.u},set:function(t){this.u=t}},selectsTextOnActivate:{get:function(){return this.F},set:function(t){this.F=t}},state:{get:function(){return this.qa},set:function(t){this.qa!==t&&(this.qa=t)}}}),Ln.prototype.measureTemporaryTextBlock=Ln.prototype.Lx;var jn=new V(Ln,"LostFocus",0),Fn=new V(Ln,"MouseDown",1),Dn=new V(Ln,"Tab",2),Bn=new V(Ln,"Enter",3),On=new V(Ln,"SingleClick",0),In=new V(Ln,"SingleClickSelected",1),zn=new V(Ln,"DoubleClick",2),Rn=new V(Ln,"StateNone",0),En=new V(Ln,"StateActive",1),Vn=new V(Ln,"StateEditing",2),Yn=new V(Ln,"StateValidating",3),Gn=new V(Ln,"StateInvalid",4),Xn=new V(Ln,"StateValidated",5),Un=null;function qn(t){oo||(eo(),oo=!0),this.H=bo,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=ro,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new $,this.ce=new ho,this.ce.Yd=this,this.Ei=new $,this.pu=new $,this.Sr=new $,this.pr=new $,t&&Object.assign(this,t)}function Kn(t,i){t.Jd&&t.canStart(i)&&(t.Zd.add(i),t.defaultAnimation.isAnimating&&t.Cc(),Qo(t.H),t.zb=!0)}function Hn(t){if(t.Jd&&t.zb){var i=t.ce,e=t.H,n=t.Zd.contains("Model");n&&(t.Ok=!0,t.Pk===ro?(i.isViewportUnconstrained=!0,i.vc.clear(),i.add(e,"position",e.position.copy().offset(0,-200),e.position),i.add(e,"opacity",0,1)):t.Pk===ao&&i.vc.clear(),t.Qw=!(t.Pk!==so||!e.du.D(e.pa)),e.R("InitialAnimationStarting",t)),n&&!t.Gh||0===i.vc.count?(t.Zd.clear(),t.zb=!1,i.vc.clear(),lo(i,e),t.Ok=!1,e.N()):(t.Zd.clear(),e.kg=!1,n=i.vc.get(e),e.autoScale!==Xr&&null!==n&&(delete n.start.scale,delete n.end.scale),m.requestAnimationFrame((function(){!1===t.zb||i.bc||(e.Gf("temporaryPixelRatio")&&Do(e),Oo(e),t.zb=!1,i.start(),i.bc&&(Zn(t),e.Ya(),po(i,0),$o(e,!0),_n(t),e.R("AnimationStarting",t)))})))}}function Wn(t){return t.Zd.contains("Trigger")&&1===t.Zd.count}function Jn(t,i,e,n){t.isTicking||Wn(t)||i instanceof wc&&(null!==i.fromNode||null!==i.toNode)||t.ce.add(i,"position",e,n,!1)}function Zn(t){if(!t.vq){var i=t.H;t.Ow=i.skipsUndoManager,t.cw=i.skipsModelSourceBindings,i.skipsUndoManager=!0,i.skipsModelSourceBindings=!0,t.vq=!0}}function _n(t){var i=t.H;i.skipsUndoManager=t.Ow,i.skipsModelSourceBindings=t.cw,t.vq=!1}function $n(t,i,e){!t.zb||i.D(e)||Wn(t)||(t.H.pi||(i=e.copy()),uo(t.ce,t.H,"position",i,e))}function Qn(t,i,e){i.fd&&(i.Tg=e,t.pr.add(i))}function to(t,i){for(i=i.findLinksConnected();i.next();){var e=i.value;e.fd&&(e.Tg=e.points.copy(),t.pr.add(e))}}function io(t,i,e,n,o){null===t&&(t=[0,0,0,0]),null===i&&(i=[0,0,0,0]);var r=t[0],s=t[1],a=t[2];t=t[3];var h=i[0],l=i[1],u=i[2];return i=i[3],0===a||100===a?(r=h,s=l):0!==u&&100!==u||(h=r,l=s),180r?r+=360:h+=360),"hsla("+(r=o(e,r,h-r,n)%360)+", "+(s=o(e,s,l-s,n))+"%, "+(a=o(e,a,u-a,n))+"%, "+(e=o(e,t,i-t,n))+")"}function eo(){function t(t,i,e,n,o,r){t.position=new pt(n(o,i.x,e.x-i.x,r),n(o,i.y,e.y-i.y,r))}var i=new dt;i.add("position:diagram",t),i.add("position",t),i.add("position:part",(function(t,i,e,n,o,r){ot&&M(t,">= 1",qn,"duration"),this.Dg=t}},isAnimating:{get:function(){return this.bc}},isTicking:{get:function(){return this.vq}},isInitial:{get:function(){return this.Gh},set:function(t){this.Gh=t}},defaultAnimation:{get:function(){return this.ce}},activeAnimations:{get:function(){return this.Ei}},initialAnimationStyle:{get:function(){return this.Pk},set:function(t){this.Pk=t}}}),qn.prototype.stopAnimation=qn.prototype.Cc;var no=null,oo=!1,ro=new V(qn,"Default",1),so=new V(qn,"AnimateLocations",2),ao=new V(qn,"None",3);function ho(t){this.vu=this.Nw=this.Yd=this.H=null,this.Xk=this.bc=this.j=!1,this.cn=this.Qd=0,this.Lp=this.ot=go,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=et,this.vc=new dt,this.Tt=new dt,this.yl=new $,this.Ut=new $,this.dw=$r,t&&Object.assign(this,t)}function lo(t,i){if(t.Tt.clear(),t.Wk=!1,t.au=0,t.Gd=NaN,0t.cn?t.Gd:n-t.Qd;i&&((o=t.gw)t.cn&&(t.ho&&!t.Wk?(t.Qd=+new Date,t.cn=t.Qd+t.Gd,t.Wk=!0):t.Ml(!1))}}}function po(t,i){for(var e=t.Gd,n=t.vc.iterator,o=t.Wk;n.next();){var r=n.key;if(!(r instanceof Ds&&null===r.diagram)){var s=n.value,a=o?s.end:s.start;s=o?s.start:s.end;var h,l=no;for(h in s)"position"===h&&(s["position:placeholder"]||s["position:nodeCollapse"])||null===l.get(h)||l.get(h)(r,a[h],s[h],t.Lp,i,e,t)}}}function go(t,i,e,n){return 1>(t/=n/2)?e/2*t*t+i:-e/2*(--t*(t-2)-1)+i}function mo(t,i,e,n){return t===n?i+e:e*(1-Math.pow(2,-10*t/n))+i}function yo(t,i,e){this.start=t,this.end=i,this.Ku={},this.Hu=e,this.nv=!1}function vo(t,i,e){this.xd=null,this.rf=t,this.so=e||wo,this.uk=null,void 0!==i&&(this.uk=i,void 0===e&&(this.so=ko))}qn.className="AnimationManager",qn.defineAnimationEffect=function(t,i){oo||(eo(),oo=!0),no.add(t,i)},qn.Default=ro,qn.AnimateLocations=so,qn.None=ao,ho.prototype.suspend=function(){this.Xk=!0},ho.prototype.advanceTo=function(t,i){i&&(this.Xk=!1),this.ho&&t>=this.Gd&&(this.Wk=!0,t-=this.Gd),this.gw=t,fo(this,!0),Zn(this.Yd),$o(this.H),_n(this.Yd),this.H.redraw()},(i=ho.prototype).start=function(){if(0===this.vc.count||this.bc)return this;for(var t=this.H,i=this.vc.iterator;i.next();){var e=i.key;null===t&&(e instanceof To?t=e:e instanceof Ds&&(t=e.diagram))}return null===t?this:(this.H=t,this.Yd=t.animationManager,!1===(i=this.Yd).isEnabled||(this.Gd=isNaN(this.Dg)?i.duration:this.Dg,this.Lp=this.ot,i.Ok&&i.Pk===ro&&this===i.defaultAnimation&&(this.Lp=mo,this.Gd=isNaN(this.Dg)?600===i.duration?900:i.duration:this.Dg),this.dw=t.scrollMode,this.isViewportUnconstrained&&(t.sj=Qr),Zn(i),this.yl.each((function(i){i.data=null,t.add(i)})),_n(i),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,function(t,i){function e(){if(0this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),lo(this,null),e.Ml(this),i.$b())}},i.Cj=function(t,i){var e=i.actualBounds,n=null;if(i instanceof gc&&(n=i.placeholder),null!==n?(e=n.ga(ti),n=n.padding,e.x+=n.left,e.y+=n.top,this.add(t,"position",e,t.position,!1)):this.add(t,"position",new pt(e.x+e.width/2,e.y+e.height/2),t.position,!1),this.add(t,"scale",.01,t.scale,!1),t instanceof gc)for(t=t.memberParts;t.next();)(n=t.value)instanceof Ju&&this.Cj(n,i)},i.Aj=function(t,i){if(t.isVisible()){var e=null;if(i instanceof gc&&(e=i.placeholder),null!==e){var n=e.ga(ti);e=e.padding,n.x+=e.left,n.y+=e.top,this.add(t,"position:placeholder",t.position,n,!0)}else this.add(t,"position:nodeCollapse",t.position,i,!0);if(this.add(t,"scale",t.scale,.01,!0),(n=this.vc).contains(t)&&(n.I(t).nv=!0),t instanceof gc)for(t=t.memberParts;t.next();)(n=t.value)instanceof Ju&&this.Aj(n,i)}},i.Ez=function(t){var i=this.Tt.get(t);return null===i&&(i={},this.Tt.add(t,i)),i},f.Object.defineProperties(ho.prototype,{duration:{get:function(){return this.Dg},set:function(t){1>t&&M(t,">= 1",ho,"duration"),this.Dg=t}},reversible:{get:function(){return this.ho},set:function(t){this.ho=t}},runCount:{get:function(){return this.cu},set:function(t){0=o)return i;if(0>i&&(i=t.indexOf(e)),0>i)return-1;for(var r=i-1,s=NaN;0<=r&&(s=t.M(r).zOrder,isNaN(s));)r--;for(var a=i+1,h=NaN;an)for(;;){if(-1===r||s<=n){if(++r===i)break;return t.mb(i),t.Gb(r,e),r}for(s=NaN;0<=--r&&(s=t.M(r).zOrder,isNaN(s)););}else if(!isNaN(h)&&h=n){if(--a===i)break;return t.mb(i),t.Gb(a,e),a}for(h=NaN;++an&&a.containingGroup===e&&(n=s,0<=i))break}!(0>n)&&no;o++)i[I("7ca11abfd7330390")](I(n[o-1]),10,15*o);for(i[e]=I("39f046ebb36e4b"),e=1;5>e;e++)i[I("7ca11abfd7330390")](I(n[e-1]),10,15*e);4===n.length&&"5"===n[0][0]&&"7"===n[3][0]||(Yi.prototype.Cd=Yi.prototype.Eu),ss=t}}(),as=!0),Q(this),bo=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,Vr){var e=this,n=function(){e.removeEventListener(m.document,"DOMContentLoaded",n,!1),e.setRTL()};null!==m.document.body?this.setRTL():e.addEventListener(m.document,"DOMContentLoaded",n,!1)}this.ol=null,Rr.add("Model",Qf);var o=this;return this.Hb=function(t){var i=o.partManager;if(t.model===i.diagram.model&&i.diagram.aa){i.diagram.aa=!1;try{var e=t.change;""===t.modelChange&&e===fe&&i.updateDataBindings(t.object,t.propertyName)}finally{i.diagram.aa=!0}}},this.Oc=function(t){o.partManager.doModelChanged(t)},this.hu=this.ku=null,Lo(this),this.model=Od(),this.Wg=!0,Io(this),this.layout=new Ff,this.Wg=!1,this.ck=this.ek=this.fk=this.dk=this.ui=this.aA=this.$j=this.Ov=null,this.hk=function(){},this.preventDefault=null,this.rn=!1,this.Yf=new hs,void 0!==t&&("string"==typeof t||m.Element&&t instanceof Element?Fo(this,t):i=t),this.vb=!1,i&&this.nm(i),this}function Lo(t){t.Yd=new qn,t.Yd.Xe(t),t.Db=17,t.Gw=!1,t.tn=!1,t.bu="default",t.Wa=new Z,t.pj=new dt,t.nl="default",t.Tx(),t.Sx(),t.pb=1,t.pa=new pt(NaN,NaN).freeze(),t.du=new pt(NaN,NaN),t.Ca=1,t.Pp=1,t.zt=new pt(NaN,NaN).freeze(),t.At=NaN,t.Ot=1e-4,t.Mt=100,t.Ab=new Yi,t.zu=new pt(NaN,NaN).freeze(),t.ut=new Bt(NaN,NaN,NaN,NaN).freeze(),t.rj=new Wt(0,0,0,0).freeze(),t.sj=$r,t.nu=!1,t.Zt=null,t.fu=null,t.yh=Xr,t.zk=Si,t.Fg=Xr,t.pq=Si,t.yt=ti,t.Bt=ti,t.Fc=!0,t.pn=!1,t.De=new $,t.Eh=new dt,t.Xm=!0,t.vp=250,t.vk=-1,t.xp=new Wt(16,16,16,16).freeze(),t.kg=!1,t.Jk=!1,t.fn=!0,t.bq=new he,t.bq.diagram=t,t.Qg=new he,t.Qg.diagram=t,t.cj=new he,t.cj.diagram=t,t.zg=null,t.pf=null,t.qu=!1,function(t){function i(t){var i=t.toLowerCase(),o=new Z;e.add(t,o),e.add(i,o),n.add(t,t),n.add(i,t)}var e=new dt,n=new dt;i("InitialAnimationStarting"),i("AnimationStarting"),i("AnimationFinished"),i("BackgroundSingleClicked"),i("BackgroundDoubleClicked"),i("BackgroundContextClicked"),i("ClipboardChanged"),i("ClipboardPasted"),i("DocumentBoundsChanged"),i("ExternalObjectsDropped"),i("GainedFocus"),i("InitialLayoutCompleted"),i("LayoutCompleted"),i("LinkDrawn"),i("LinkRelinked"),i("LinkReshaped"),i("LostFocus"),i("Modified"),i("ObjectSingleClicked"),i("ObjectDoubleClicked"),i("ObjectContextClicked"),i("PartCreated"),i("PartResized"),i("PartRotated"),i("SelectionMoved"),i("SelectionCopied"),i("SelectionDeleting"),i("SelectionDeleted"),i("SelectionGrouped"),i("SelectionUngrouped"),i("ChangingSelection"),i("ChangedSelection"),i("SubGraphCollapsed"),i("SubGraphExpanded"),i("TextEdited"),i("TreeCollapsed"),i("TreeExpanded"),i("ViewportBoundsChanged"),i("InvalidateDraw"),t.iw=e,t.hw=n}(t),t.ai=new $,t.Ht=!0,t.uu=ts,t.pw=!1,t.wu=Kr,t.it="auto",t.Op="auto",t.zh=null,t.Fh=null,t.Bh=null,t.Qh=null,t.Oh=null,t.Nh=null,t.Qt=null,t.Lh=null,t.xt=!1,t.Mh=null,t.Ph=null,t.$h=null,t.Ch=null,t.Rt=!1,t.Yt={},t.oj=[null,null],t.Wg=!1,t.Iw=!1,t.ou=!1,t.lt=!1,t.rw=!0,t.ld=!1,t.$i=!1,t.Tw=!0,t.Ce=-2,t.Og=new dt,t.Xn=new Z,t.Gg=!1,t.Jd=!0,t.Us=!0,t.Fi=!0,t.Gi=!0,t.Vs=!1,t.Ws=!0,t.Pi=!0,t.Hi=!0,t.Qi=!0,t.Ys=!0,t.Ii=!0,t.Ki=!0,t.Ji=!0,t.Li=!0,t.Mi=!0,t.Ni=!0,t.Oi=!0,t.Zs=!0,t.at=!0,t.qw=!1,t.Vk=!1,t.mn=!0,t.nn=!0,t.Xs=!0,t.$s=!0,t.iu=16,t.mu=16,t.qr=!1,t.gu=!1,t.lu=0,t.ju=0,t.yb=new Wt(5).freeze(),t.Hw=(new $).freeze(),t.Nt=999999999,t.nw=(new $).freeze(),t.Zi=!0,t.Ee=!0,t.vd=!0,t.Be=!1,t.gf=!1,t.xh=!0,t.hf=!1,t.sy=new $,t.ow=new $,t.Xh=null,t.aw=new At(8,8),t.bw=999,t.Bw=1,t.Jw=0,t.fc={scale:1,position:new pt,bounds:new Bt,Py:new At,bA:new At,Oz:!1},t.fc.canvasSize=t.fc.Py,t.fc.newCanvasSize=t.fc.bA,t.fc.isScroll=!1,t.Rw=new Bt(NaN,NaN,NaN,NaN).freeze(),t.wo=new At(NaN,NaN).freeze(),t.Sp=new Bt(NaN,NaN,NaN,NaN).freeze(),t.It=!1,t.Lg=new dt;var i=new Ju,e=new Pl;e.bind(new Gd("text","",D)),i.add(e),t.ny=i,t.Lg.add("",i),i=new Ju,(e=new Pl).stroke="brown",e.bind(new Gd("text","",D)),i.add(e),t.Lg.add("Comment",i),(i=new Ju).selectable=!1,i.avoidable=!1,(e=new pl).figure="Ellipse",e.fill="black",e.stroke=null,e.desiredSize=new At(3,3).ja(),i.add(e),t.Lg.add("LinkLabel",i),t.Yi=new dt,(i=new gc).selectionObjectName="GROUPPANEL",i.type=Ch.Vertical,(e=new Pl).font="bold 12pt sans-serif",e.bind(new Gd("text","",D)),i.add(e),(e=new Ch(Ch.Auto)).name="GROUPPANEL";var n=new pl;n.figure="Rectangle",n.fill="rgba(128,128,128,0.2)",n.stroke="black",e.add(n),(n=new bc).padding=new Wt(5,5,5,5).ja(),e.add(n),i.add(e),t.ly=i,t.Yi.add("",i),t.Kh=new dt,i=new wc,(e=new pl).isPanelMain=!0,i.add(e),(e=new pl).toArrow="Standard",e.fill="black",e.stroke=null,e.strokeWidth=0,i.add(e),t.my=i,t.Kh.add("",i),i=new wc,(e=new pl).isPanelMain=!0,e.stroke="brown",i.add(e),t.Kh.add("Comment",i),(i=new Hu).type=Ch.Auto,(e=new pl).fill=null,e.stroke="dodgerblue",e.strokeWidth=3,i.add(e),(e=new bc).margin=new Wt(1.5,1.5,1.5,1.5).ja(),i.add(e),t.St=i,t.wt=i,(i=new Hu).type=Ch.Link,(e=new pl).isPanelMain=!0,e.fill=null,e.stroke="dodgerblue",e.strokeWidth=3,i.add(e),t.Kt=i,t.fe=null,t.mq=!1,t.Ck=null,t.partManager=new Qf,t.toolManager=new xe,t.toolManager.initializeStandardTools(),t.defaultTool=t.toolManager,t.currentTool=t.defaultTool,t.nt=null,t.Wm=new Ms,t.Vt=null,t.Wt=null,t.Mr=!1,t.commandHandler=jo(),t.eq=null,t.fq=st,t.Pw=!1,t.Mb=1,t.Yh=null,t.Oq=1,t.Sq=0,t.zw=[0,0,0,0,0],t.Tq=0,t.yq=1,t.tw=0,t.uw=new pt,t.zy=500,t.wp=new pt,t.wq=!1}function Ao(t,i){t.animationManager.Cc(!0),t.Hw=(new $).freeze(),t.nw=(new $).freeze();var e=t.skipsUndoManager,n=null!==t.cc&&void 0!==t.cc;n&&(t.skipsUndoManager=!0);var o=null;null!==t.fe&&(null!==(o=t.fe.part)&&t.remove(o));var r=[],s=t.Wa.length;if(i){for(i=0;iMath.abs(i.deltaY)?-n:-o):void 0!==i.wheelDeltaX?(0!==i.wheelDeltaX&&(n=0Math.abs(i.wheelDeltaY)?-n:-o):void 0!==i.wheelDelta&&0!==i.wheelDelta&&(e.delta=0e||Math.abs(o.y-i.screenY)>e)?t.yq++:t.yq=1,n.clickCount=t.yq,t.tw=i.timeStamp,t.uw.sg(i.screenX,i.screenY),t.doMouseDown(),1===i.button?i.preventDefault():Wo(n,i)}},t.dk=function(i){if(t.isEnabled){t.Vk=!0;var e=t.oj;if(null===e[0]||e[0].pointerId!==i.pointerId&&e[0].pointerType===i.pointerType){if(null!==e[1]&&e[1].pointerId===i.pointerId)return void(e[1]=i);if(null!==e[0])return;e[0]=i}else e[0]=i;if(e[0].pointerId===i.pointerId){e=Ho(t,i,!1,!1,!1,null!==e[1]);var n=m.document.elementFromPoint(i.clientX,i.clientY)||null;null!==n&&void 0!==n.shadowRoot&&null!==n.shadowRoot&&(n=n.shadowRoot.elementFromPoint(i.clientX,i.clientY));var o=t,r=i;n&&n.H&&(r=i,o=n.H),e.targetDiagram=o,Jo(t,r,e),e.targetObject=null,t.doMouseMove(),Wo(e,i)}}},t.fk=function(i){if(t.isEnabled){t.Vk=!0;var e="touch"===i.pointerType||"pen"===i.pointerType,n=t.Yt;if(e&&t.qu)delete n[i.pointerId],i.preventDefault();else if(null===(n=t.oj)[0]||n[0].pointerId!==i.pointerId&&n[0].pointerType===i.pointerType)null!==n[1]&&n[1].pointerId===i.pointerId&&(n[1]=null);else{n[0]=null,n=Ho(t,i,!1,!0,!0,!1);var o=m.document.elementFromPoint(i.clientX,i.clientY)||null;null!==o&&void 0!==o.shadowRoot&&null!==o.shadowRoot&&(o=o.shadowRoot.elementFromPoint(i.clientX,i.clientY)),null!==o&&o.H instanceof To&&o.H!==t&&Jo(o.H,i,n),null===o&&(o=i.target),Jo(t,i,n),n.clickCount=t.yq,n.targetDiagram=Ko(i,o),n.targetObject=null,t.doMouseUp(),Wo(n,i),e&&(t.wq=!1)}}},t.ek=function(i){if(t.isEnabled){t.Vk=!1;var e=t.Yt;e[i.pointerId]&&delete e[i.pointerId],null!==(e=t.oj)[0]&&e[0].pointerId===i.pointerId&&(e[0]=null),null!==e[1]&&e[1].pointerId===i.pointerId&&(e[1]=null),"touch"!==i.pointerType&&"pen"!==i.pointerType&&((i=t.currentTool).cancelWaitAfter(),i.standardMouseOver())}},t.ck=function(i){var e=t.oj;null!==e[0]&&e[0].pointerId===i.pointerId?(e[0]=null,t.wq=!1):null!==e[1]&&e[1].pointerId===i.pointerId&&(e[1]=null)},t.Vp=n.Z["d"+ws[1]+ws[2]+"wI"+rs.slice(1,5)]["b"+Ud.slice(1,i)](n.Z,ss,i,i),n.Vc(!0),function(t){var i=t.ta.Oa;i instanceof HTMLCanvasElement||(i=t.div),t.addEventListener(i,"pointerdown",t.ui,!1),t.addEventListener(i,"pointermove",t.dk,!1),t.addEventListener(i,"pointerup",t.fk,!1),t.addEventListener(i,"pointerout",t.ek,!1),t.addEventListener(i,"pointercancel",t.ck,!1),t.addEventListener(i,"pointerenter",t.bz,!1),t.addEventListener(i,"pointerleave",t.cz,!1),t.addEventListener(i,"wheel",t.$j,!1),t.addEventListener(i,"keydown",t.Qz,!1),t.addEventListener(i,"keyup",t.Rz,!1),t.addEventListener(i,"blur",t.Ny,!1),t.addEventListener(i,"focus",t.Oy,!1),t.addEventListener(i,"selectstart",(function(t){return t.preventDefault(),!1}),!1),t.addEventListener(i,"contextmenu",(function(t){return t.preventDefault(),!1}),!1),t.addEventListener(m,"resize",t.Ov,!1)}(t),"svg"===t.nl&&(i=t.pj.get("svg"),t.Ka.appendChild(i.Oa),t.ib=i.context)}}function Do(t){30e&&(i=e),it.maxScale&&(i=t.maxScale),i):i===qr?((i=h>a?(s-t.Db)/n:(r-t.Db)/o)>e&&(i=e),it.maxScale&&(i=t.maxScale),i):t.scale}function Xo(t,i,e,n,o,r){var s=pt.allocAt(t.pa.x,t.pa.y),a=s.x,h=s.y;if(null!==t.eq){var l=pt.alloc();a=(l=t.eq.ga(ti,l)).x-t.fq.x/t.scale,h=l.y-t.fq.y/t.scale,o=Qt,pt.free(l)}(r||t.scrollMode===$r)&&(o.sb()&&(e>i.width&&(a=i.x+(o.x*i.width+o.offsetX)-(o.x*e-o.offsetX)),n>i.height&&(h=i.y+(o.y*i.height+o.offsetY)-(o.y*n-o.offsetY))),o=t.rj,r=e-i.width,ei.left?a=i.left:ai.top?h=i.top:hi;i++){var e=t.De.iterator;if(null===e||0===t.De.count)break;t.De=new $,t.Nv(e,t.De)}t.nodes.each((function(t){t instanceof gc&&0!=(65536&t.U)!=!1&&(t.U=65536^t.U)}))}}function tr(t,i){for(var e=A(),n=A(),o=i.memberParts;o.next();){var r=o.value;r.isVisible()&&(r instanceof gc?(ia(r)||na(r)||Iu(r))&&tr(t,r):r instanceof wc?r.fromNode===i||r.toNode===i?n.push(r):e.push(r):(r.measure(1/0,1/0),r.arrange()))}for(t=e.length,o=0;ow&&(y=M.left,v=M.right),m.height>k&&(x=M.top,b=M.bottom)):(y=M.left,v=M.right,x=M.top,b=M.bottom);var S=m.width+y+v,N=m.height+x+b,P=S>h/(M=t.scale),C=N>l/M;if(!(r||t.gf||t.Be||P||C))return!0;y=m.x-y,h=u.x,v=m.right+v,l=u.right+s,x=m.y-x;var T=u.y;m=m.bottom+b,u=u.bottom+a;var L="1px";if(b="1px",t.scrollMode===$r&&(P||C)&&(P&&t.hasHorizontalScrollbar&&t.allowHorizontalScroll&&(P=1,y+1l+1&&(P=Math.max((v-l)*M+t.Aa,P)),w+s+1u+1&&(P=Math.max((m-u)*M+t.ya,P)),k+a+1l+1&&(s=Math.max((v-l)*M+t.Aa,s)),w+1u+1&&(a=Math.max((m-u)*M+s,a)),k+1l+1&&(i=t.position.x*M)),t.tn)switch(t.bu){case"negative":i=-(p.scrollWidth-i-p.clientWidth);break;case"reverse":i=p.scrollWidth-i-p.clientWidth}return p.scrollLeft=i,t.hasVerticalScrollbar&&t.allowVerticalScroll&&(k+1u+1&&(p.scrollTop=t.position.y*M)),h=t.Aa,l=t.ya,p.style.width=h+(t.gf?t.Db:0)+"px",p.style.height=l+(t.Be?t.Db:0)+"px",e===h&&n===l&&!t.animationManager.zb||(e=Bt.allocAt(o,c,f,d),t.onViewportBoundsChanged(e,t.viewportBounds,M,r),Bt.free(e),!1)}function ar(t,i,e){var n=i.layer;null!==n&&n.diagram===t&&(i.isSelected=!1,i.isHighlighted=!1,i.C(2),e&&i.Lj(),0<=(e=n.pc(-1,i,!1))&&t.cb(pe,"parts",n,i,null,e,null),null!==(t=i.layerChanged)&&t(i,n,null))}function hr(t,i,e,n,o,r){if(!i.contains(e)&&(void 0===r&&(r=!1),!n||r||e.canMove()||e.canCopy()))if(void 0===o&&(o=ur(t)),e instanceof Ju){if(i.add(e,t.Pd(o,e,e.location)),e instanceof gc&&(null!==e.placeholder||o.dragsMembers))for(r=e.memberParts;r.next();)hr(t,i,r.value,n,o,o.groupsAlwaysMove);for(r=e.linksConnected;r.next();){var s=r.value;if(!i.contains(s)){var a=s.fromNode,h=s.toNode;null!==a&&i.contains(a)&&null!==h&&i.contains(h)&&hr(t,i,s,n,o)}}if(o.dragsTree)for(e=e.Ou();e.next();)hr(t,i,e.value,n,o)}else if(e instanceof wc)for(i.add(e,t.Pd(o,e)),e=e.labelNodes;e.next();)hr(t,i,e.value,n,o);else e instanceof Hu||i.add(e,t.Pd(o,e,e.location))}function lr(t,i,e,n,o){if(null!==i&&0!==i.count){var r=pt.alloc(),s=pt.alloc();s.assign(e),isNaN(s.x)&&(s.x=0),isNaN(s.y)&&(s.y=0),(e=t.Mr)||fr(t,i);for(var a=A(),h=A(),l=i.iterator,u=pt.alloc();l.next();){var c=l.key,f=l.value;if(c.Zc()){var d=pr(t,c,i);null!==d?a.push(new ks(c,f,d)):o&&!c.canMove()||(d=f.point,r.assign(d),t.computeMove(c,r.add(s),n,u),c.location=u,void 0===f.shifted&&(f.shifted=new pt),f.shifted.assign(u.re(d)))}else l.key instanceof wc&&h.push(l.sa)}for(pt.free(u),o=a.length,l=0;lt.maxScale&&(e=t.maxScale),r=pt.allocAt(t.pa.x+a/i-a/e,t.pa.y+h/i-h/e),t.position=r,pt.free(r),t.Ca=e,kr(t),t.vb=!1,t.onViewportBoundsChanged(o,t.viewportBounds,i,!1),Yo(t,!1),n.zb&&(Wn(n)||n.ce.add(n.H,"scale",i,t.Ca))}}function yr(t,i){var e=t.fe;if(null!==e&&e.visible){for(var n=At.alloc(),o=1,r=1,s=e.O.s,a=s.length,h=0;hu||(Fh(l.figure)?r=r*u/Xi.vx(r,u):o=o*u/Xi.vx(o,u))}if(s=e.gridCellSize,n.h(r*s.width,o*s.height),void 0!==i)o=i.width,r=i.height,t=i.x,s=i.y;else{if(i=Bt.alloc(),t=t.viewportBounds,i.h(t.x,t.y,t.width,t.height),!i.w())return void Bt.free(i);o=i.width,r=i.height,t=i.x,s=i.y,Bt.free(i)}e.width=o+2*n.width,e.height=r+2*n.height,i=pt.alloc(),Xi.No(t,s,0,0,n.width,n.height,i),i.offset(-n.width,-n.height),At.free(n),e.part.location=i,pt.free(i)}}function vr(t){var i=t.isModified;t.Tw!==i&&(t.Tw=i,t.R("Modified"))}function xr(t,i){for(var e=(i=i.O.s).length,n=0;n=n&&!r.defaultAnimation.isAnimating&&!r.zb&&(i||Kn(r,"Layout")),t.xh=!1;for(var s=t.ai.iterator;s.next();)Cr(t,s.value,i,n);o.isValidLayout||(!i||o.isRealtime||null===o.isRealtime||0===n?(o.doLayout(t),Qo(t),o.isValidLayout=!0):t.xh=!0)}finally{i=t.undoManager.isInternalTransaction,0===n&&(t.eb("Layout"),t.undoManager.isInternalTransaction=!1),!i||0!==n&&1!==n||Hn(r),t.aa=e}}}function Cr(t,i,e,n){if(null!==i){for(var o=i.gl.iterator;o.next();)Cr(t,o.value,e,n);null===(o=i.layout)||o.isValidLayout||(!e||o.isRealtime||0===n?(i.rh=!i.location.w(),o.doLayout(i),i.C(32),tr(t,i),o.isValidLayout=!0):t.xh=!0)}}function Tr(t,i){var e=t.hw.I(i);return null!==e?e:t.hw.I(i.toLowerCase())}function Lr(t,i){var e=t.iw.I(i);return null!==e||null!==(e=t.iw.I(i.toLowerCase()))?e:void w("Unknown DiagramEvent name: "+i)}function Ar(t){if(t.animationManager.isTicking)return!1;var i=t.currentTool;return i!==t.toolManager.findTool("Dragging")||(!t.Mr||i.isComplexRoutingRealtime)}function jr(t,i,e,n){var o=t.Xh;if(null===o&&(t.Xh=o=new pf(t.avoidanceCellSize)),o.vs||o.group!==e||o.Yx!==n){if(o.Hx=Math.max(o.Os+1,Math.floor(t.avoidanceLimit/t.avoidanceCellSize.width)),o.Ix=Math.max(o.Os+1,Math.floor(t.avoidanceLimit/t.avoidanceCellSize.height)),null!==e&&(e=Fr(t,e)),null===e){i=Bt.alloc(),t.computeOccupiedArea(i),i.Bc(100,100),o.initialize(i);for(var r=t.nodes;r.next();){var s=r.value,a=s.layer;null!==a&&a.visible&&!a.isTemporary&&Dr(t,s,n,i)}Bt.free(i)}else{for(0h?i(e,o,a):m.requestAnimationFrame(n)}for(var o=e.callback,r=!0,s=t.Og.iterator;s.next();)if(!s.value[0].al){r=!1;break}if("function"!=typeof o||r)return i(e,o,t);var a=t,h=e.callbackTimeout||300,l=+new Date;return m.requestAnimationFrame((function(){n()})),null}function zr(t,i,e,n){if(t.animationManager.Cc(),t.bd(),null===t.ta)return null;"object"!=typeof i&&w("properties argument must be an Object.");var o=i.size||null,r=i.scale||null;void 0!==i.scale&&isNaN(i.scale)&&(r="NaN");var s=i.maxSize;void 0===i.maxSize&&(s="SVG"===e?new At(1/0,1/0):new At(2e3,2e3));var a=i.position||null,h=i.parts||null,l=void 0===i.padding?1:i.padding,u=i.background||null,c=i.omitTemporary;void 0===c&&(c=!0);var f=i.document||document,d=i.elementFinished||null,p=i.showTemporary;void 0===p&&(p=!c),void 0===(i=i.showGrid)&&(i=p),null!==o&&isNaN(o.width)&&isNaN(o.height)&&(o=null),"number"==typeof l?l=new Wt(l):l instanceof Wt||w("MakeImage padding must be a Margin or a number."),l.left=Math.max(l.left,0),l.right=Math.max(l.right,0),l.top=Math.max(l.top,0),l.bottom=Math.max(l.bottom,0),t.ib.Vc(!0);var g=(c=new Fa(null,f,void 0,!0)).context;if(!(o||r||h||a))return c.width=t.Aa+Math.ceil(l.left+l.right),c.height=t.ya+Math.ceil(l.top+l.bottom),"SVG"===e?null===n?null:(n.resize(c.width,c.height,c.width,c.height),n.ownerDocument=f,n.hs=d,ir(t,n.context,l,new At(c.width,c.height),t.Ca,t.pa,h,u,p,i),n.context):(t.Xm=!1,ir(t,g,l,new At(c.width,c.height),t.Ca,t.pa,h,u,p,i),t.Xm=!0,c.context);var m=t.Pp,y=t.documentBounds.copy();if(y.Fv(t.yb),p)for(var v=t.Wa.s,x=v.length,b=0;bm?(r=m,o=y.width,y=y.height):(o=s.width,y=s.height):(o=y.width*r,y=y.height*r):(r=m,o=y.width,y=y.height),null!==l?(o+=a,y+=x):l=new Wt(0),null!==s&&(m=s.width,s=s.height,isNaN(m)&&(m=2e3),isNaN(s)&&(s=2e3),isFinite(m)&&(o=Math.min(o,m)),isFinite(s)&&(y=Math.min(y,s))),c.width=Math.ceil(o),c.height=Math.ceil(y),"SVG"===e?null===n?null:(n.resize(c.width,c.height,c.width,c.height),n.ownerDocument=f,n.hs=d,ir(t,n.context,l,new At(Math.ceil(o),Math.ceil(y)),r,v,h,u,p,i),n.context):(t.Xm=!1,ir(t,g,l,new At(Math.ceil(o),Math.ceil(y)),r,v,h,u,p,i),t.Xm=!0,c.context)}vo.className="AnimationTrigger",vo.Default=wo,vo.Immediate=ko,vo.Bundled=Mo,(i=So.prototype).clear=function(){for(var t=this.Pa,i=0;i=t)return i;for(var e=0,n=0,o=0,r=0,s=0,a=this.Pa.iterator;a.next();){var h=a.value;h instanceof gc?o++:h instanceof Ju?n++:h instanceof wc?r++:h instanceof Hu?s++:e++}if(a="",0e.Oq||a.height*o>e.Oq?i.gc(t,e):(o=i.actualBounds,r=i.naturalBounds,0===o.width||0===o.height||isNaN(o.x)||isNaN(o.y)||!i.isVisible()||(e=i.transform,null!==i.areaBackground&&(Us(i,t,i.areaBackground,!0,!0,r,o),t.fillRect(o.x,o.y,o.width,o.height)),null===i.areaBackground&&null===i.background&&(Us(i,t,"rgba(0,0,0,0.3)",!0,!1,r,o),t.fillRect(o.x,o.y,o.width,o.height)),null!==i.background&&(t.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),Us(i,t,i.background,!0,!1,r,o),t.fillRect(0,0,r.width/2,r.height/2),e.ws()||(i=1/(e.m11*e.m22-e.m12*e.m21),t.transform(e.m22*i,-e.m12*i,-e.m21*i,e.m11*i,i*(e.m21*e.dy-e.m22*e.dx),i*(e.m12*e.dx-e.m11*e.dy)))))),n&&(t.restore(),t.Vc(!0))}},i.g=function(t,i,e,n,o){var r=this.diagram;null!==r&&r.cb(fe,t,this,i,e,n,o)},i.oi=function(t,i,e){var n=this.Pa;if(i.Ig=this,null===this&&Xs(i),t>=n.count)t=n.count;else if(n.M(t)===i)return-1;return n.Gb(t,i),i.Vo(e),null!==(n=this.diagram)&&(e?n.N():n.oi(i)),Co(this,t,i),t},i.pc=function(t,i,e){if(!e&&i.layer!==this&&null!==i.layer)return i.layer.pc(t,i,e);var n=this.Pa;if(0>t||t>=n.length){if(0>(t=n.indexOf(i)))return-1}else if(n.M(t)!==i&&0>(t=n.indexOf(i)))return-1;return i.Wo(e),n.mb(t),null!==(n=this.diagram)&&(e?n.N():n.pc(i)),i.Ig=null,Xs(i),t},f.Object.defineProperties(So.prototype,{parts:{get:function(){return this.Pa.iterator}},partsBackwards:{get:function(){return this.Pa.iteratorBackwards}},diagram:{get:function(){return this.H}},name:{get:function(){return this.xa},set:function(t){var i=this.xa;if(i!==t){var e=this.diagram;if(null!==e)for(""===i&&w("Cannot rename default Layer to: "+t),e=e.layers;e.next();)e.value.name===t&&w("Layer.name is already present in this diagram: "+t);for(this.xa=t,this.g("name",i,t),t=this.Pa.iterator;t.next();)t.value.layerName=this.xa}}},opacity:{get:function(){return this.pb},set:function(t){var i=this.pb;i!==t&&((0>t||1=t)return i;for(var e=this.Wa.iterator;e.next();)i+="\n "+e.value.toString(t-1);return i},To.prototype.addEventListener=function(t,i,e,n){t.addEventListener(i,e,{capture:n,passive:!1})},To.prototype.removeEventListener=function(t,i,e,n){t.removeEventListener(i,e,{capture:n})},To.prototype.computePixelRatio=function(){return null!==this.Yh?this.Yh:m.devicePixelRatio||1},To.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},To.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},To.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},To.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},To.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},To.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},To.prototype.doFocus=function(){this.focus()},To.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var t=m.scrollX||m.pageXOffset,i=m.scrollY||m.pageYOffset;this.ta.focus(),m.scrollTo(t,i)}},To.prototype.Oy=function(){this.H.R("GainedFocus")},To.prototype.Ny=function(){this.H.R("LostFocus")},To.prototype.kx=function(t){if(null!==this.ta){var i=this.ku,e=this.hu;this.qr=!0;var n=this.documentBounds,o=this.viewportBounds,r=this.rj,s=n.x-r.left,a=n.y-r.top,h=n.width+r.left+r.right,l=n.height+r.top+r.bottom,u=n.right+r.right;r=n.bottom+r.bottom;var c=o.x;n=o.y;var f=o.width,d=o.height,p=o.right,g=o.bottom;o=this.scale;var m=t.scrollLeft;if(this.tn)switch(this.bu){case"negative":m=m+t.scrollWidth-t.clientWidth;break;case"reverse":m=t.scrollWidth-m-t.clientWidth}var y=m;fp&&(this.position=m.h(-(i.scrollWidth-this.Aa)+y-this.Aa/o+u,this.position.y))),t.vy&&this.allowVerticalScroll&&(ag&&(this.position=m.h(this.position.x,-(i.scrollHeight-this.ya)+t.scrollTop-this.ya/o+r))),pt.free(m),this.vd=!0,this.Ee=this.qr=!1,n=this.documentBounds,o=this.viewportBounds,u=n.right,p=o.right,r=n.bottom,g=o.bottom,s=n.x,c=o.x,a=n.y,n=o.y,f>=h&&s>=c&&u<=p&&(e.style.width="1px"),d>=l&&a>=n&&r<=g&&(e.style.height="1px"))}},To.prototype.computeBounds=function(t){return void 0===t&&(t=new Bt),Qo(this),Vo(this,t)},To.prototype.computePartsBounds=function(t,i){void 0===i&&(i=!1);var e=null;if(P(t))for(var n=0;no/e?(r-(this.Be?this.Db:0))/n:(o-(this.gf?this.Db:0))/e:Math.min(r/n,o/e)}this.scale=o,this.position=new pt(t.x,t.y)}},i.Jy=function(t,i){this.Va();var e=this.documentBounds,n=this.viewportBounds;this.position=new pt(e.x+(t.x*e.width+t.offsetX)-(i.x*n.width-i.offsetX),e.y+(t.y*e.height+t.offsetY)-(i.y*n.height-i.offsetY))},i.zz=function(t){if(t instanceof Ds){this.eq=t;var i=pt.alloc();this.fq=this.op(t.ga(ti,i)),pt.free(i)}else this.eq=null,this.fq=st},i.Ol=function(t,i){if(void 0===i&&(i=!0),i){if((t=Uo(this,t,(function(t){return t.part}),(function(t){return t.canSelect()})))instanceof ku)return t}else if((t=Uo(this,t,(function(t){return t.part})))instanceof ku)return t;return null},i.ic=function(t,i,e){void 0===i&&(i=null),void 0===e&&(e=null),Qo(this);for(var n=this.Wa.iteratorBackwards;n.next();){var o=n.value;if(o.visible&&null!==(o=o.ic(t,i,e)))return o}return null},i.lz=function(t,i,e){return void 0===i&&(i=!0),function(t,i,e,n,o){for(void 0===e&&(e=null),void 0===n&&(n=null),o instanceof Z||o instanceof $||(o=new $),Qo(t),t=t.Wa.iteratorBackwards;t.next();){var r=t.value;r.visible&&!r.isTemporary&&r.ji(i,e,n,o)}return o}(this,t,(function(t){return t.part}),i?function(t){return t instanceof ku&&t.canSelect()}:null,e)},i.ji=function(t,i,e,n){void 0===i&&(i=null),void 0===e&&(e=null),n instanceof Z||n instanceof $||(n=new $),Qo(this);for(var o=this.Wa.iteratorBackwards;o.next();){var r=o.value;r.visible&&r.ji(t,i,e,n)}return n},i.ux=function(t,i,e,n){return void 0===i&&(i=!1),void 0===e&&(e=!0),function(t,i,e,n,o){var r=null;for(void 0===r&&(r=null),void 0===e&&(e=null),void 0===n&&(n=!1),o instanceof Z||o instanceof $||(o=new $),Qo(t),t=t.Wa.iteratorBackwards;t.next();){var s=t.value;s.visible&&!s.isTemporary&&s.Cf(i,r,e,n,o)}return o}(this,t,(function(t){return t instanceof ku&&(!e||t.canSelect())}),i,n)},i.Cf=function(t,i,e,n,o){void 0===i&&(i=null),void 0===e&&(e=null),void 0===n&&(n=!1),o instanceof Z||o instanceof $||(o=new $),Qo(this);for(var r=this.Wa.iteratorBackwards;r.next();){var s=r.value;s.visible&&s.Cf(t,i,e,n,o)}return o},i.Nu=function(t,i,e,n,o,r){var s=new $;Qo(this);for(var a=this.Wa.iteratorBackwards;a.next();){var h=a.value;h.visible&&h.Nu(t,i,e,n,s,o,r)}return s},i.mz=function(t,i,e,n,o){return void 0===e&&(e=!0),void 0===n&&(n=!0),function(t,i,e,n,o,r){var s=null;void 0===s&&(s=null),void 0===n&&(n=null),void 0===o&&(o=!0),!1!==o&&!0!==o&&((o instanceof Z||o instanceof $)&&(r=o),o=!0);for(r instanceof Z||r instanceof $||(r=new $),Qo(t),t=t.Wa.iteratorBackwards;t.next();){var a=t.value;a.visible&&!a.isTemporary&&a.og(i,e,s,n,o,r)}return r}(this,t,i,(function(t){return t instanceof ku&&(!n||t.canSelect())}),e,o)},i.og=function(t,i,e,n,o,r){void 0===e&&(e=null),void 0===n&&(n=null),void 0===o&&(o=!0),!1!==o&&!0!==o&&((o instanceof Z||o instanceof $)&&(r=o),o=!0),r instanceof Z||r instanceof $||(r=new $),Qo(this);for(var s=this.Wa.iteratorBackwards;s.next();){var a=s.value;a.visible&&a.og(t,i,e,n,o,r)}return r},To.prototype.acceptEvent=function(t){return qo(this,t,t instanceof MouseEvent)},To.prototype.Qz=function(t){var i=this.H;if(!this.H.isEnabled)return!1;var e=qo(i,t,!1);switch(e.key=String.fromCharCode(t.which),e.down=!0,t.which){case 8:e.key="Backspace";break;case 33:e.key="PageUp";break;case 34:e.key="PageDown";break;case 35:e.key="End";break;case 36:e.key="Home";break;case 37:e.key="Left";break;case 38:e.key="Up";break;case 39:e.key="Right";break;case 40:e.key="Down";break;case 45:e.key="Insert";break;case 46:e.key="Del";break;case 48:e.key="0";break;case 187:case 61:case 107:e.key="Add";break;case 189:case 173:case 109:e.key="Subtract";break;case 27:e.key="Esc"}return i.doKeyDown(),Wo(e,t)},To.prototype.Rz=function(t){var i=this.H;if(!i.isEnabled)return!1;var e=qo(i,t,!1);switch(e.key=String.fromCharCode(t.which),e.up=!0,t.which){case 8:e.key="Backspace";break;case 33:e.key="PageUp";break;case 34:e.key="PageDown";break;case 35:e.key="End";break;case 36:e.key="Home";break;case 37:e.key="Left";break;case 38:e.key="Up";break;case 39:e.key="Right";break;case 40:e.key="Down";break;case 45:e.key="Insert";break;case 46:e.key="Del"}return i.doKeyUp(),Wo(e,t)},To.prototype.bz=function(t){var i=this.H;if(!i.isEnabled)return!1;var e=qo(i,t,!0);return null!==i.mouseEnter&&i.mouseEnter(e),i.currentTool.standardMouseOver(),Wo(e,t)},To.prototype.cz=function(t){var i=this.H;if(!i.isEnabled)return!1;var e=qo(i,t,!0);return null!==i.mouseLeave&&i.mouseLeave(e),Wo(e,t)},To.prototype.getMouse=function(t){var i=this.ta;if(null===i)return new pt(0,0);var e=i.getBoundingClientRect();return i=t.clientX-this.Aa/e.width*e.left,t=t.clientY-this.ya/e.height*e.top,null!==this.Ab?vt(new pt(i,t),this.Ab):new pt(i,t)},To.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))},To.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},(i=To.prototype).Pz=function(){return this.kg},i.Xy=function(t){void 0===t&&(t=null);var i=this.animationManager,e=i.isEnabled;i.Cc(),i.isEnabled=!1,$o(this),this.hf=!1,this.du=new pt(NaN,NaN),i.isEnabled=e,this.ld=!0;var n=this;null!==t&&x((function(){n.ld=!1,Kn(i,"Model"),t(n)}),1)},i.$b=function(t){if(void 0===t&&(t=!1),!0!==this.kg&&!(this.vb||!1===t&&this.ld)){this.kg=!0;var i=this;m.requestAnimationFrame((function(){i.kg&&i.bd()}))}},i.bd=function(){this.fn&&!this.kg||(this.fn&&(this.fn=!1),$o(this))},i.Nv=function(t,i){for(t.reset();t.next();){var e=t.value;!e.Zc()||e instanceof gc||(e.si()?(e.measure(1/0,1/0),e.arrange()):i.add(e))}for(t.reset();t.next();)(e=t.value)instanceof gc&&e.isVisible()&&tr(this,e);for(t.reset();t.next();)(e=t.value)instanceof wc&&e.isVisible()&&(e.si()?(e.measure(1/0,1/0),e.arrange()):i.add(e));for(t.reset();t.next();)(e=t.value)instanceof Hu&&e.isVisible()&&(e.si()?(e.measure(1/0,1/0),e.arrange()):i.add(e))},i.Fd=function(t,i,e,n){if(this.vd||this.animationManager.isAnimating)for(var o=0;on&&this.Ya(),this},i.Cy=function(t,i){gr(this,t,i),t.Xe(this);var e=this.Wa,n=e.indexOf(t);0<=n&&(e.remove(t),null!==this.cc&&this.cb(pe,"layers",this,t,null,n,null));var o,r=e.count;for(o=0;on&&this.Ya(),this},i.kA=function(t){if(t.diagram!==this&&w("Cannot remove a Layer from another Diagram: "+t+" of "+t.diagram),""!==t.name){var i=this.Wa,e=i.indexOf(t);if(i.remove(t)){for(i=t.Pa.copy().iterator;i.next();){var n=i.value,o=n.layerName;o!==t.name?n.layerName=o:n.layerName=""}null!==this.cc&&this.cb(pe,"layers",this,t,null,e,null),this.N(),this.Ya()}}},i.Qj=function(t){for(var i=this.layers;i.next();){var e=i.value;if(e.name===t)return e}return null},i.Yw=function(t){return null===this.pf&&(this.pf=new Z),this.pf.add(t),this.model.Pe(t),this},i.mA=function(t){null!==this.pf&&(this.pf.remove(t),0===this.pf.count&&(this.pf=null)),this.model.ik(t)},i.Pe=function(t){return null===this.zg&&(this.zg=new Z),this.zg.add(t),this},i.ik=function(t){null!==this.zg&&(this.zg.remove(t),0===this.zg.count&&(this.zg=null))},i.ds=function(t){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(t),t.change!==ce&&(this.isModified=!0),null!==this.zg)for(var i=this.zg,e=i.length,n=0;nc.Pa.indexOf(d)&&c.oi(f,d,p):(d.isSelected=!1,d.isHighlighted=!1,d.Wb(),c.pc(p?f:-1,d,p)))}else c instanceof To?"number"==typeof f&&d instanceof So&&(i?(d.Xe(this),this.Wa.Gb(f,d)):this.Wa.mb(f)):w("unknown ChangedEvent.Remove object: "+t.toString());this.isModified=!0}else n!==ce&&w("unknown ChangedEvent: "+t.toString())}finally{this.skipsModelSourceBindings=e}}},To.prototype.Ea=function(t){return this.undoManager.Ea(t)},To.prototype.eb=function(t){return this.undoManager.eb(t)},To.prototype.Kf=function(){return this.undoManager.Kf()},To.prototype.commit=function(t,i){void 0===i&&(i="");var e=this.skipsUndoManager;null===i&&(this.skipsUndoManager=!0,i=""),this.undoManager.Ea(i);var n=!1;try{t(this),n=!0}finally{n?this.undoManager.eb(i):this.undoManager.Kf(),this.skipsUndoManager=e}},To.prototype.updateAllTargetBindings=function(t){this.partManager.updateAllTargetBindings(t)},To.prototype.rp=function(){this.partManager.rp()},To.prototype.onViewportBoundsChanged=function(t,i,e,n){if(!t.D(i)){void 0===n&&(n=!1),n||(this.Ee=!0),this.vd=!0;var o=this.layout;null===o||!o.isViewportSized||this.autoScale!==Xr||t.width===i.width&&t.height===i.height||o.C(),o=this.currentTool,!0===this.Vk&&o instanceof xe&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),be(o,this)),this.vb||this.invalidateViewport(t,i),yr(this),this.fc.scale=e,this.fc.position.x=t.x,this.fc.position.y=t.y,this.fc.bounds.assign(t),this.fc.canvasSize.width=Math.round(t.width*e),this.fc.canvasSize.height=Math.round(t.height*e),this.fc.newCanvasSize.width=this.Aa,this.fc.newCanvasSize.height=this.ya,this.fc.isScroll=n,this.R("ViewportBoundsChanged",this.fc,t),this.isVirtualized&&this.links.each((function(t){t.isAvoiding&&t.actualBounds.Yc(i)&&t.bb()}))}},To.prototype.clearSelection=function(t){void 0===t&&(t=!1);var i=this.selection;if(0!==i.count){t||this.R("ChangingSelection",i);for(var e=i.Fa(),n=e.length,o=0;o=e.top&&0>=e.left&&0>=e.right&&0>=e.bottom)return i;var n=this.viewportBounds,o=this.scale;n=Bt.allocAt(0,0,n.width*o,n.height*o);var r=pt.allocAt(0,0);if(t.x>=n.x&&t.xn.x+n.width-e.right&&this.allowHorizontalScroll&&(s=Math.max(this.scrollHorizontalLineChange,1),s|=0,r.x+=s,t.x>n.x+n.width-e.right/2&&(r.x+=s),t.x>n.x+n.width-e.right/4&&(r.x+=4*s));return t.y>=n.y&&t.yn.y+n.height-e.bottom&&this.allowVerticalScroll&&(s=Math.max(this.scrollVerticalLineChange,1),s|=0,r.y+=s,t.y>n.y+n.height-e.bottom/2&&(r.y+=s),t.y>n.y+n.height-e.bottom/4&&(r.y+=4*s)),r.Xa(et)||(i=new pt(i.x+r.x/o,i.y+r.y/o)),Bt.free(n),pt.free(r),i},(i=To.prototype).Cs=function(){return null},i.av=function(){return null},i.bs=function(t,i){this.pj.add(t,i)},i.Fu=function(t){(this.Pw=t)||this.nodes.each((function(t){t instanceof gc&&(t.$p=null)}))},i.Wz=function(t){return Vr?(void 0===t&&(t={}),t.returnType="Image",this.Jx(t)):null},i.Jx=function(t){return void 0===t&&(t={}),Ir(this,this.Xz,t)},i.Xz=function(t,i,e){var n=zr(e,t,"canvas",null);if(null===n)return null;var o=null;if(null!==(e=n.Z.canvas))switch(o=t.returnType,o=void 0===o?"string":o.toLowerCase(),o){case rs+"data":o=n.getImageData(0,0,e.width,e.height);break;case rs:(n=(t.document||document).createElement("img")).src=e.toDataURL(t.type,t.details),o=n;break;case"blob":return"function"!=typeof i&&w('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.'),"function"==typeof e.toBlob?(e.toBlob(i,t.type,t.details),"toBlob"):(i(null),null);default:o=e.toDataURL(t.type,t.details)}return"function"==typeof i?(i(o),null):o},f.Object.defineProperties(To.prototype,{renderer:{get:function(){return this.nl},set:function(t){this instanceof Ps||(""===t&&(t="default"),(t=t.toLowerCase())!==this.nl&&(this.nl=t,"default"===t||"canvas"===t?(null!==(t=this.pj.get("svg"))&&t.Oa.remove(),this.ta&&(this.ib=this.ta.context)):"svg"===t?(this.pj.contains("svg")?t=this.pj.get("svg"):(t=new ya(this,m.document),this.bs("svg",t)),null!==this.div&&this.div.appendChild(t.Oa),this.ib=t.context,this.ta&&(this.ta.context.setTransform(this.Mb,0,0,this.Mb,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya))):"debug"!==t||this.pj.contains("SVG")||(t=new ya(this,m.document),this.bs("SVG",t),t.Oa.style.backgroundColor="whitesmoke",null!==this.div&&this.div.after(t.Oa)),this.hk()))}},div:{get:function(){return this.Ka},set:function(t){if(this.Ka!==t){var i=this.Ka;null!==i?(i.H=void 0,i.goDiagram=void 0,i.go=void 0,i.innerHTML="",null!==this.ta&&(i=this.ta.Oa,this.removeEventListener(i,"pointermove",this.dk,!1),this.removeEventListener(i,"pointerdown",this.ui,!1),this.removeEventListener(i,"pointerup",this.fk,!1),this.removeEventListener(i,"pointerout",this.ek,!1),this.removeEventListener(i,"pointercancel",this.ck,!1),this.ta.mx()),this.ol&&(this.ol.disconnect(),this.ol=null),null!==(i=this.toolManager)&&(i.mouseDownTools.each((function(t){t.cancelWaitAfter()})),i.mouseMoveTools.each((function(t){t.cancelWaitAfter()})),i.mouseUpTools.each((function(t){t.cancelWaitAfter()}))),i.cancelWaitAfter(),this.currentTool.doCancel(),this.ta=null,this.removeEventListener(m,"resize",this.Ov,!1),this.removeEventListener(m,"wheel",this.$j,!0),bo===this&&(bo=null)):null===this.ui&&(this.hf=!1),this.Ka=null,null!==t&&((i=t.H)&&(i.div=null),Fo(this,t),this.hk())}}},$w:{get:function(){return this.Sq}},pi:{get:function(){return this.hf}},draggedLink:{get:function(){return this.nt},set:function(t){this.nt!==t&&(this.nt=t,null!==t&&(this.Vt=t.fromPort,this.Wt=t.toPort))}},Mx:{get:function(){return this.Vt},set:function(t){this.Vt=t}},Nx:{get:function(){return this.Wt},set:function(t){this.Wt=t}},animationManager:{get:function(){return this.Yd}},undoManager:{get:function(){return this.cc.undoManager}},skipsUndoManager:{get:function(){return this.Wg},set:function(t){this.Wg=t,this.cc.skipsUndoManager=t}},delaysLayout:{get:function(){return this.lt},set:function(t){this.lt=t}},opacity:{get:function(){return this.pb},set:function(t){var i=this.pb;i!==t&&((0>t||1t&&M(t,">= 0",To,"scrollHorizontalLineChange"),this.iu=t,this.g("scrollHorizontalLineChange",i,t))}},scrollVerticalLineChange:{get:function(){return this.mu},set:function(t){var i=this.mu;i!==t&&(0>t&&M(t,">= 0",To,"scrollVerticalLineChange"),this.mu=t,this.g("scrollVerticalLineChange",i,t))}},lastInput:{get:function(){return this.cj},set:function(t){this.cj=t}},previousInput:{get:function(){return this.Qg},set:function(t){this.Qg=t}},firstInput:{get:function(){return this.bq},set:function(t){this.bq=t}},currentCursor:{get:function(){return this.it},set:function(t){if(""===t&&(t=this.Op),this.it!==t){var i=this.ta,e=this.Ka;if(null!==i&&null!==e){this.it=t;var n=i.style.cursor;i.style.cursor=t,e.style.cursor=t,i.style.cursor===n&&(i.style.cursor="-webkit-"+t,e.style.cursor="-webkit-"+t,i.style.cursor===n&&(i.style.cursor="-moz-"+t,e.style.cursor="-moz-"+t,i.style.cursor===n&&(i.style.cursor=t,e.style.cursor=t)))}}}},defaultCursor:{get:function(){return this.Op},set:function(t){""===t&&(t="auto");var i=this.Op;i!==t&&(this.Op=t,this.g("defaultCursor",i,t))}},click:{get:function(){return this.zh},set:function(t){var i=this.zh;i!==t&&(this.zh=t,this.g("click",i,t))}},doubleClick:{get:function(){return this.Fh},set:function(t){var i=this.Fh;i!==t&&(this.Fh=t,this.g("doubleClick",i,t))}},contextClick:{get:function(){return this.Bh},set:function(t){var i=this.Bh;i!==t&&(this.Bh=t,this.g("contextClick",i,t))}},mouseOver:{get:function(){return this.Qh},set:function(t){var i=this.Qh;i!==t&&(this.Qh=t,this.g("mouseOver",i,t))}},mouseHover:{get:function(){return this.Oh},set:function(t){var i=this.Oh;i!==t&&(this.Oh=t,this.g("mouseHover",i,t))}},mouseHold:{get:function(){return this.Nh},set:function(t){var i=this.Nh;i!==t&&(this.Nh=t,this.g("mouseHold",i,t))}},mouseDragOver:{get:function(){return this.Qt},set:function(t){var i=this.Qt;i!==t&&(this.Qt=t,this.g("mouseDragOver",i,t))}},mouseDrop:{get:function(){return this.Lh},set:function(t){var i=this.Lh;i!==t&&(this.Lh=t,this.g("mouseDrop",i,t))}},handlesDragDropForTopLevelParts:{get:function(){return this.xt},set:function(t){var i=this.xt;i!==t&&(this.xt=t,this.g("handlesDragDropForTopLevelParts",i,t))}},mouseEnter:{get:function(){return this.Mh},set:function(t){var i=this.Mh;i!==t&&(this.Mh=t,this.g("mouseEnter",i,t))}},mouseLeave:{get:function(){return this.Ph},set:function(t){var i=this.Ph;i!==t&&(this.Ph=t,this.g("mouseLeave",i,t))}},toolTip:{get:function(){return this.$h},set:function(t){var i=this.$h;i!==t&&(this.$h=t,this.g("toolTip",i,t))}},contextMenu:{get:function(){return this.Ch},set:function(t){var i=this.Ch;i!==t&&(this.Ch=t,this.g("contextMenu",i,t))}},commandHandler:{get:function(){return this.nb},set:function(t){this.nb!==t&&(this.nb=t,t.Xe(this))}},toolManager:{get:function(){return this.te},set:function(t){this.te!==t&&(this.te=t,t.diagram=this)}},defaultTool:{get:function(){return this.ob},set:function(t){var i=this.ob;i!==t&&(this.ob=t,t.diagram=this,this.currentTool===i&&(this.currentTool=t))}},currentTool:{get:function(){return this.hb},set:function(t){var i=this.hb;i&&(i.isActive&&i.doDeactivate(),i.cancelWaitAfter(),i.doStop()),null===t&&(t=this.defaultTool),null!==t&&(this.hb=t,t.diagram=this,t.doStart())}},selection:{get:function(){return this.Hw}},maxSelectionCount:{get:function(){return this.Nt},set:function(t){var i=this.Nt;if(i!==t)if(0<=t&&!isNaN(t)){if(this.Nt=t,this.g("maxSelectionCount",i,t),!this.undoManager.isUndoingRedoing&&0<(t=this.selection.count-t)){this.R("ChangingSelection",this.selection),i=this.selection.Fa();for(var e=0;e= 0",To,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.St},set:function(t){var i=this.St;i!==t&&(this.St=t,this.g("nodeSelectionAdornmentTemplate",i,t))}},groupSelectionAdornmentTemplate:{get:function(){return this.wt},set:function(t){var i=this.wt;i!==t&&(this.wt=t,this.g("groupSelectionAdornmentTemplate",i,t))}},linkSelectionAdornmentTemplate:{get:function(){return this.Kt},set:function(t){var i=this.Kt;i!==t&&(this.Kt=t,this.g("linkSelectionAdornmentTemplate",i,t))}},highlighteds:{get:function(){return this.nw}},isModified:{get:function(){var t=this.undoManager;return t.isEnabled?null!==t.currentTransaction||this.rn&&this.Ce!==t.historyIndex:this.rn},set:function(t){if(this.rn!==t){this.rn=t;var i=this.undoManager;!t&&i.isEnabled&&(this.Ce=i.historyIndex),t||vr(this)}}},model:{get:function(){return this.cc},set:function(t){var i=this.cc;if(i!==t){this.currentTool.doCancel(),i&&i.undoManager!==t.undoManager&&i.undoManager.isInTransaction&&w("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var e=Ao(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var n=this.vb;this.vb=!0,Kn(this.animationManager,"Model"),i&&(null!==this.pf&&this.pf.each((function(t){return i.ik(t)})),i.ik(this.Oc)),this.cc=t,this.partManager=function(t){return null!==(t=Rr.get(t))?new t:new Qf}(this.cc.type);for(var o=0;othis.scale&&(this.scale=t)):M(t,"> 0",To,"minScale"))}},maxScale:{get:function(){return this.Mt},set:function(t){var i=this.Mt;i!==t&&(0 0",To,"maxScale"))}},zoomPoint:{get:function(){return this.zu},set:function(t){this.zu.D(t)||(this.zu=t=t.J())}},contentAlignment:{get:function(){return this.zk},set:function(t){var i=this.zk;i.D(t)||(this.zk=t=t.J(),this.g("contentAlignment",i,t),Yo(this,!1))}},initialContentAlignment:{get:function(){return this.pq},set:function(t){var i=this.pq;i.D(t)||(this.pq=t=t.J(),this.g("initialContentAlignment",i,t))}},padding:{get:function(){return this.yb},set:function(t){"number"==typeof t&&(t=new Wt(t));var i=this.yb;i.D(t)||(this.yb=t=t.J(),this.Ya(),this.g("padding",i,t))}},partManager:{get:function(){return this.Pc},set:function(t){var i=this.Pc;i!==t&&(null!==t.diagram&&w("Cannot share PartManagers between Diagrams: "+t.toString()),i&&i.Xe(null),this.Pc=t,t.Xe(this))}},nodes:{get:function(){return this.partManager.nodes.iterator}},links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{get:function(){return this.Sc},set:function(t){var i=this.Sc;i!==t&&(this.Sc=t,t.diagram=this,t.group=null,this.xh=!0,this.g("layout",i,t),this.$b())}},isTreePathToChildren:{get:function(){return this.Ht},set:function(t){var i=this.Ht;if(i!==t&&(this.Ht=t,this.g("isTreePathToChildren",i,t),!this.undoManager.isUndoingRedoing))for(t=this.nodes;t.next();)oc(t.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(t){var i=this.uu;i!==t&&(t!==ts&&t!==is&&t!==es&&w("Unknown Diagram.treeCollapsePolicy: "+t),this.uu=t,this.g("treeCollapsePolicy",i,t))}},Ue:{get:function(){return this.pw},set:function(t){this.pw=t}},avoidanceCellSize:{get:function(){return this.aw},set:function(t){this.Xh=null,this.aw=new At(Math.max(1,t.width),Math.max(1,t.height))}},avoidanceLimit:{get:function(){return this.bw},set:function(t){this.bw=Math.max(1,t)}},autoScrollInterval:{get:function(){return this.vp},set:function(t){var i=this.vp;i!==t&&(this.vp=t,this.g("autoScrollInterval",i,t))}},autoScrollRegion:{get:function(){return this.xp},set:function(t){"number"==typeof t&&(t=new Wt(t));var i=this.xp;i.D(t)||(this.xp=t=t.J(),this.Ya(),this.g("autoScrollRegion",i,t))}}}),f.Object.defineProperties(To,{licenseKey:{get:function(){return ns.jc()},set:function(t){ns.add(t.replace(/\s/g,""))}},version:{get:function(){return os}}}),To.prototype.makeImageData=To.prototype.Jx,To.prototype.makeImage=To.prototype.Wz,To.prototype.cacheGroupExternalLinks=To.prototype.Fu,To.prototype.addRenderer=To.prototype.bs,To.prototype.makeSVG=To.prototype.av,To.prototype.makeSvg=To.prototype.Cs,To.prototype.stopAutoScroll=To.prototype.ug,To.prototype.doAutoScroll=To.prototype.gs,To.prototype.isUnoccupied=To.prototype.Yj,To.prototype.raiseDiagramEvent=To.prototype.R,To.prototype.removeDiagramListener=To.prototype.am,To.prototype.addDiagramListener=To.prototype.Bj,To.prototype.findTreeRoots=To.prototype.yz,To.prototype.layoutDiagram=To.prototype.Uz,To.prototype.findTopLevelGroups=To.prototype.qz,To.prototype.findTopLevelNodesAndLinks=To.prototype.rz,To.prototype.ensureBounds=To.prototype.Va,To.prototype.findLinksByExample=To.prototype.ls,To.prototype.findNodesByExample=To.prototype.ms,To.prototype.findLinkForData=To.prototype.Kc,To.prototype.findNodeForData=To.prototype.ii,To.prototype.findPartForData=To.prototype.Lc,To.prototype.findLinkForKey=To.prototype.findLinkForKey,To.prototype.findNodeForKey=To.prototype.Vb,To.prototype.findPartForKey=To.prototype.findPartForKey,To.prototype.rebuildParts=To.prototype.Wd,To.prototype.transformViewToDoc=To.prototype.Ps,To.prototype.transformRectDocToView=To.prototype.zA,To.prototype.transformDocToView=To.prototype.op,To.prototype.centerRect=To.prototype.es,To.prototype.scrollToRect=To.prototype.tv,To.prototype.scroll=To.prototype.scroll,To.prototype.highlightCollection=To.prototype.Jz,To.prototype.highlight=To.prototype.Iz,To.prototype.selectCollection=To.prototype.rA,To.prototype.select=To.prototype.select,To.prototype.updateAllRelationshipsFromData=To.prototype.rp,To.prototype.updateAllTargetBindings=To.prototype.updateAllTargetBindings,To.prototype.commit=To.prototype.commit,To.prototype.rollbackTransaction=To.prototype.Kf,To.prototype.commitTransaction=To.prototype.eb,To.prototype.startTransaction=To.prototype.Ea,To.prototype.raiseChanged=To.prototype.g,To.prototype.raiseChangedEvent=To.prototype.cb,To.prototype.removeChangedListener=To.prototype.ik,To.prototype.addChangedListener=To.prototype.Pe,To.prototype.removeModelChangedListener=To.prototype.mA,To.prototype.addModelChangedListener=To.prototype.Yw,To.prototype.findLayer=To.prototype.Qj,To.prototype.removeLayer=To.prototype.kA,To.prototype.addLayerAfter=To.prototype.Cy,To.prototype.addLayerBefore=To.prototype.Ww,To.prototype.addLayer=To.prototype.Al,To.prototype.moveParts=To.prototype.moveParts,To.prototype.copyParts=To.prototype.Kj,To.prototype.removeParts=To.prototype.Is,To.prototype.remove=To.prototype.remove,To.prototype.add=To.prototype.add,To.prototype.clearDelayedGeometries=To.prototype.bx,To.prototype.setProperties=To.prototype.nm,To.prototype.attach=To.prototype.Du,To.prototype.set=To.prototype.set,To.prototype.resetInputOptions=To.prototype.Sx,To.prototype.setInputOption=To.prototype.sA,To.prototype.getInputOption=To.prototype.Ql,To.prototype.resetRenderingHints=To.prototype.Tx,To.prototype.setRenderingHint=To.prototype.Xx,To.prototype.getRenderingHint=To.prototype.Gf,To.prototype.maybeUpdate=To.prototype.bd,To.prototype.requestUpdate=To.prototype.$b,To.prototype.delayInitialization=To.prototype.Xy,To.prototype.isUpdateRequested=To.prototype.Pz,To.prototype.invalidateDocumentBounds=To.prototype.Ya,To.prototype.findObjectsNear=To.prototype.og,To.prototype.findPartsNear=To.prototype.mz,To.prototype.findObjectsIn=To.prototype.Cf,To.prototype.findPartsIn=To.prototype.ux,To.prototype.findObjectsAt=To.prototype.ji,To.prototype.findPartsAt=To.prototype.lz,To.prototype.findObjectAt=To.prototype.ic,To.prototype.findPartAt=To.prototype.Ol,To.prototype.focusObject=To.prototype.zz,To.prototype.alignDocument=To.prototype.Jy,To.prototype.zoomToRect=To.prototype.BA,To.prototype.zoomToFit=To.prototype.zoomToFit,To.prototype.diagramScroll=To.prototype.kx,To.prototype.focus=To.prototype.focus;var Rr=new dt,Er=null,Vr=void 0!==m.document,Yr=null,Gr="",Xr=new V(To,"None",0),Ur=new V(To,"Uniform",1),qr=new V(To,"UniformToFill",2),Kr=new V(To,"CycleAll",10),Hr=new V(To,"CycleNotDirected",11),Wr=new V(To,"CycleNotDirectedFast",12),Jr=new V(To,"CycleNotUndirected",13),Zr=new V(To,"CycleDestinationTree",14),_r=new V(To,"CycleSourceTree",15),$r=new V(To,"DocumentScroll",1),Qr=new V(To,"InfiniteScroll",2),ts=new V(To,"TreeParentCollapsed",21),is=new V(To,"AllParentsCollapsed",22),es=new V(To,"AnyParentsCollapsed",23),ns=new Z,os="2.3.10",rs="image",ss=null,as=!1;function hs(){this.wy=null,this.j="zz@orderNum","63ad05bbe23a1786468a4c741b6d2"===this._tk?this.Rc=this.j=!0:this.Rc=null}function ls(t,i){if(i.ib.setTransform(i.Mb,0,0,i.Mb,0,0),i.ib.yc(),null===t.Rc)t:{i="f";var e=m[I("76a715b2f73f148a")][I("72ba13b5")]||"";if(t.Rc=!0,Vr){var n=To[I("76a115b6ed251eaf4692")];if(n)for(var o=ns.iterator;o.next()&&!(6>(n=I(n=o.value).split(I("39e9"))).length);){var r=I(n[1]).split(".");if("7da71ca0"!==n[4])break;var s=I(y[I("6cae19")]).split(".");if(r[0]>s[0]||r[0]===s[0]&&r[1]>=s[1]){var a=m[I("74a900bae4370f8b51")][I("6fbb13a1c2311e8a57")].toLowerCase();if(s=a[I("73a612b6fb191d")](I("3aad1ab6e022098b4dc4")),r=I(n[2]),-1(s=i[I("73a612b6fb191d")](r))&&r!==I("7da71ca0ad381e90")&&(s=i[I("73a612b6fb191d")](I("76a715b2ef3e149757"))),0>s&&(s=i[I("73a612b6fb191d")](I("76a715b2ef3e149757"))),0>s&&(s=i[I("73a612b6fb191d")](I("2bfa41fdb3784bca12"))),0>s&&(s=e[I("73a612b6fb191d")](I("7baa19a6f76c1988428554"))),t.Rc=!(0<=s&&sa),!t.Rc))break;if("#"===r[0]){s=m.document.createElement("div");for(var h=n[0].replace(/[A-Za-z]/g,"");4>h.length;)h+="9";if(a=h,h=h.substr(h.length-4),n="",n+=["gsh","gsf"][parseInt(h.substr(0,1),10)%2],n+=["Header","Background","Display","Feedback"][parseInt(h.substr(0,1),10)%4],s[I("79a417a0f0181a8946")]=n,m.document[I("78a712aa")]){m.document[I("78a712aa")][I("7bb806b6ed32388c4a875b")](s),h=m.getComputedStyle(s).getPropertyValue(I("78a704b7e62456904c9b12701b6532a8"));var l=m.getComputedStyle(s).getPropertyValue(I("75b817b0ea2202"));if(m.document[I("78a712aa")][I("68ad1bbcf533388c4a875b")](s),h){if(s=m[I("77a902b0eb1b1e804a8a")],l==="0."+parseInt(a,10)%100||-1!==h.indexOf(parseInt(r[1]+r[2],16))&&-1!==h.indexOf(parseInt(r[3]+r[4],16))){t.Rc=!1;break}if(s&&s(I("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(n="."+n,r=0;rn.updateDelay?n.N():n.o||(n.o=!0,setTimeout((function(){return n.redraw()}),n.updateDelay))},e.Of=function(){null!==n.observed&&Ts(n)},e.autoScale=Ur,e.vb=!1,i&&Object.assign(e,i),e}function Cs(t){var i=t.observed;if(null!==i){var e=t.drawsTemporaryLayers,n=t.drawsGrid&&e,o=i.grid;n&&null!==o&&o.visible&&!isNaN(o.width)&&!isNaN(o.height)&&(yr(i,o=Bt.alloc().assign(t.viewportBounds).ed(i.viewportBounds)),Bt.free(o),Qo(i));var r=t.Ab;r.reset(),1!==t.scale&&r.scale(t.scale),0===t.position.x&&0===t.position.y||r.translate(-t.position.x,-t.position.y),(o=t.ib).scale(t.Mb,t.Mb),o.transform(r.m11,r.m12,r.m21,r.m22,r.dx,r.dy),o.yc(),r=(i=i.Wa.s).length;for(var s=0;sn||r>o)&&(ea(t,!0),t.measure(e>n?n:e,r>o?o:r,0,0));break;case cs:ea(t,!0),t.measure(n,o,0,0);break;case ps:ea(t,!0),t.measure(n,r,0,0);break;case gs:ea(t,!0),t.measure(e,o,0,0)}}}function Rs(t,i){return null!==i&&(Vh(i)&&(i=i.panel),0!=(512&i.l)||(i.type===Ch.Auto||i.type===Ch.Spot)&&i.Pb()!==t)}function Es(t,i,e,n){Us(t,i,t.areaBackground,!0,!0,e,n),t.areaBackground instanceof Ia&&t.areaBackground.type===$a?(i.beginPath(),i.rect(n.x,n.y,n.width,n.height),i.ng(t.areaBackground)):i.fillRect(n.x,n.y,n.width,n.height)}function Vs(t,i,e,n){var o=t.kq(),r=e.x,s=e.y,a=e.width+o,h=e.height+o;Us(t,i,t.Ma,!0,!1,e,n),t.Ma instanceof Ia&&t.Ma.type===$a?(i.beginPath(),i.rect(r-o/2,s-o/2,a,h),i.ng(t.Ma)):i.fillRect(r-o/2,s-o/2,a,h)}function Ys(t,i,e){for(var n=i.O.s,o=n.length,r=-1,s=0;so)&&w("Must specify non-negative integer row for RowColumnDefinition "+i+", not: "+o),t.isRow=!0,t.index=o):void 0!==i.column&&((null==(o=i.column)||1/0===o||isNaN(o)||0>o)&&w("Must specify non-negative integer column for RowColumnDefinition "+i+", not: "+o),t.isRow=!1,t.index=o),o=new X,i)"row"!==e&&"column"!==e&&(o[e]=i[e]);nr(t,o)}else nr(t,i);else w('Unknown initializer "'+i+'" for object being constructed by GraphObject.make: '+t)}function la(t,i){ca.add(t,i)}function ua(t,i,e){void 0===e&&(e=null);var n=t[1];if("function"==typeof e?e(n):"string"==typeof n)return t.splice(1,1),n;if(void 0===i)throw Error("no "+("function"==typeof e?"satisfactory":"string")+" argument for GraphObject builder "+t[0]);return i}us.className="DraggingInfo",ks.className="DraggingNodeInfoPair",Ms.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new At(NaN,NaN).freeze(),this.gridSnapCellSpot=ti,this.gridSnapOrigin=new pt(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},Ms.className="DraggingOptions",c(Ss,To),Ss.prototype.reset=function(){To.prototype.reset.call(this),Ns(this)},Ss.className="Palette",c(Ps,To),Ps.prototype.computePixelRatio=function(){return 1},Ps.prototype.redraw=function(){if(this.o&&1<=this.updateDelay){this.o=!1;var t=this.ta,i=this.ib;if(null!==t&&null!==i){if(or(this),null===this.ql){var e=new Fa(null);e.width=t.width,e.height=t.height,this.ql=e}try{this.ta=this.ql,this.ib=this.ta.context,this.ib.Vc(!0),this.ib.setTransform(1,0,0,1,0,0),this.ib.clearRect(0,0,this.ta.width,this.ta.height),Cs(this)}finally{this.ta=t,this.ib=i}}}To.prototype.redraw.call(this)},Ps.prototype.gc=function(){if(null===this.Ka&&w("No div specified"),null===this.ta&&w("No canvas specified"),!(this.ta instanceof ya)&&(Su(this.box),this.Fc)){var t=this.observed;if(null!==t&&!t.animationManager.defaultAnimation.isAnimating&&t.pi){or(this);var i=this.ta;(t=this.ib).Vc(!0),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,i.width,i.height),1>this.updateDelay?Cs(this):null!==this.ql&&(t.drawImage(this.ql.Oa,0,0),(i=this.Ab).reset(),1!==this.scale&&i.scale(this.scale),0===this.position.x&&0===this.position.y||i.translate(-this.position.x,-this.position.y),t.scale(this.Mb,this.Mb),t.transform(i.m11,i.m12,i.m21,i.m22,i.dx,i.dy),t.yc());for(var e=(i=this.Wa.s).length,n=0;nt&&(t=0),this.ia!==t&&(this.ia=t)}}}),Ps.className="Overview",c(Ls,Te),Ls.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(null===t||!t.allowMove||!t.allowSelect)return!1;var i=t.observed;if(null===i)return!1;var e=t.lastInput;return!(!e.left||t.currentTool!==this&&(!this.isBeyondDragSize()||e.isTouchEvent&&e.timestamp-t.firstInput.timestampi.maxScale||(i.scale=t))},As.prototype.canDecreaseZoom=function(t){void 0===t&&(t=1/this.zoomFactor);var i=this.diagram;return i.autoScale===Xr&&(!((t=i.scale*t)i.maxScale)&&i.allowZoom)},As.prototype.increaseZoom=function(t){void 0===t&&(t=this.zoomFactor);var i=this.diagram;i.autoScale===Xr&&((t=i.scale*t)i.maxScale||(i.scale=t))},As.prototype.canIncreaseZoom=function(t){void 0===t&&(t=this.zoomFactor);var i=this.diagram;return i.autoScale===Xr&&(!((t=i.scale*t)i.maxScale)&&i.allowZoom)},As.prototype.resetZoom=function(t){void 0===t&&(t=this.defaultScale);var i=this.diagram;ti.maxScale||(i.scale=t)},As.prototype.canResetZoom=function(t){void 0===t&&(t=this.defaultScale);var i=this.diagram;return!(ti.maxScale)&&i.allowZoom},As.prototype.zoomToFit=function(){var t=this.diagram,i=t.animationManager;i.Cc(),t.redraw();var e=t.position,n=t.scale;Kn(i,"Zoom To Fit"),this.isZoomToFitRestoreEnabled&&n===this.Au&&!isNaN(this.Jt)&&t.documentBounds.D(this.yu)?(t.scale=this.Jt,t.position=this.sw,this.Au=NaN,this.yu=qt):(this.Jt=n,this.sw=e.copy(),t.zoomToFit(),this.Au=t.scale,this.yu=t.documentBounds.copy()),Hn(i)},As.prototype.canZoomToFit=function(){return this.diagram.allowZoom},As.prototype.scrollToPart=function(t){void 0===t&&(t=null);var i=this.diagram;if(i.Va(),null===t){try{null!==this.cg&&(this.cg.next()?t=this.cg.value:this.cg=null)}catch(t){this.cg=null}null===t&&(0(t=180*Math.atan2(t.m12,t.m11)/Math.PI)&&(t+=360),t},i.Df=function(){if(0!=(4096&this.l)==!1)return this.Kk;var t=this.Ca;return null!==this.panel?t*this.panel.Df():t},i.qs=function(t,i){return void 0===i&&(i=new pt),i.assign(t),this.oe.Cd(i),i},i.rs=function(t,i,e){return this.Sj(t.x,t.y,i.x,i.y,e)},i.Sj=function(t,i,e,n,o){var r=this.transform,s=1/(r.m11*r.m22-r.m12*r.m21),a=r.m22*s,h=-r.m12*s,l=-r.m21*s,u=r.m11*s,c=s*(r.m21*r.dy-r.m22*r.dx),f=s*(r.m12*r.dx-r.m11*r.dy);return null!==this.areaBackground?(r=this.actualBounds,Xi.Ff(r.left,r.top,r.right,r.bottom,t,i,e,n,o)):(s=t*a+i*l+c,t=t*h+i*u+f,i=e*a+n*l+c,e=e*h+n*u+f,o.h(0,0),n=this.naturalBounds,e=Xi.Ff(0,0,n.width,n.height,s,t,i,e,o),o.transform(r),e)},Ds.prototype.measure=function(t,i,e,n){if(!1!==ia(this)){var o=this.Kg,r=o.right+o.left;o=o.top+o.bottom,t=Math.max(t-r,0),i=Math.max(i-o,0),e=Math.max((e||0)-r,0),n=Math.max((n||0)-o,0),r=this.angle,o=this.desiredSize;var s=this.kq();90===r||270===r?(t=isFinite(o.height)?o.height+s:t,i=isFinite(o.width)?o.width+s:i):(t=isFinite(o.width)?o.width+s:t,i=isFinite(o.height)?o.height+s:i),o=e||0,s=n||0;var a=this instanceof Ch;switch(Hs(this,!0)){case fs:s=o=0,a&&(i=t=1/0);break;case cs:isFinite(t)&&t>e&&(o=t),isFinite(i)&&i>n&&(s=i);break;case ps:isFinite(t)&&t>e&&(o=t),s=0,a&&(i=1/0);break;case gs:isFinite(i)&&i>n&&(s=i),o=0,a&&(t=1/0)}a=this.maxSize;var h=this.minSize;o>a.width&&h.widtha.height&&h.heightt.height||this.Cb>t.width))&&(e=!0)),this.l=e?256|this.l:-257&this.l,this.Ib.w()||w("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(r,this.Ib),oa(this,!1),Bt.free(r)},(i=Ds.prototype).eh=function(){},i.Xl=function(t,i){var e=this.part;null!==e&&null!==e.diagram&&(e.selectionObject!==this&&e.resizeObject!==this&&e.rotateObject!==this||Ru(e,!0),this.N(),Rt(t,i)||(e.oh(),this.Pn(e)))},i.Pn=function(t){null!==this.portId&&(Ru(t,!0),t instanceof Ju&&Qu(t,this))},i.gc=function(t,i){if(!function(t,i,e){if(!(i instanceof va))return!1;if(!t.visible||0===t.opacity||t.Dd()&&!t.isVisible())return null!==t.svg&&null!==t.svg.parentNode&&t.svg.remove(),!0;var n=t.panel,o=t.nk(i);if(t.kk(i,e,o))return null!==t.svg.parentElement?(t.Dd()&&(i.ti=t.svg),!0):(t.Dd()?(null!==i.ti?i.ti.after(t.svg):i.Nj.prepend(t.svg),i.ti=t.svg):n&&Ys(t,n,t.svg),!0);if(t.Dd()&&t.isShadowed){var r=t.shadowOffset;i.Ev(r.x*e.scale*t.scale*e.Mb,r.y*e.scale*t.scale*e.Mb,t.shadowBlur),Aa(i),i.shadowColor=t.shadowColor}t instanceof Pl&&(i.font=t.font),i.yd=null;var s=t.transform;r=t instanceof Ch;var a=t instanceof Ch&&Vh(t);0!=(4096&t.l)==!0&&qs(t);var h=t.Ib;if(i.rb.ha=[1,0,0,1,0,0],i.o=!1,o&&(i.o=!0,r&&a?(Ca(i,1,0,0,1,0,0),t.svg=i.ad):r?(Ca(i,s.m11,s.m12,s.m21,s.m22,s.dx,s.dy),t.svg=i.ad):Ca(i,1,0,0,1,0,0)),o=t.naturalBounds,null!==t.areaBackground){var l=s.copy().Vj();i.rb.ha=[l.m11,l.m12,l.m21,l.m22,l.dx,l.dy],Es(t,i,o,h),i.rb.ha=[1,0,0,1,0,0],i.yd.gd=i.ad,i.yd.prepend(i.ad)}return r||(i.rb.ha=[s.m11,s.m12,s.m21,s.m22,s.dx,s.dy]),null!==t.background&&(r?(a&&(i.rb.ha=[s.m11,s.m12,s.m21,s.m22,s.dx,s.dy]),Vs(t,i,o,h),a&&(i.rb.ha=[1,0,0,1,0,0])):(i.rb.ha=[s.m11,s.m12,s.m21,s.m22,s.dx,s.dy],Vs(t,i,o,h)),i.yd.Ma=i.ad,i.yd.prepend(i.ad)),s=i.yd,o=t.part,a=!1,o&&e.Gf("drawShadows")&&(a=o.isShadowed),i.clipInsteadOfFill&&(a=!1),t.Dd()&&a&&Aa(i),a&&!0===t.shadowVisible?Aa(i):a&&!1===t.shadowVisible&&La(i),o=t.panel,a&&Rs(t,o)&&null===t.shadowVisible&&La(i),i.Il&&(l=e.computePixelRatio(),l="drop-shadow("+i.shadowOffsetX/l+"px "+i.shadowOffsetY/l+"px "+i.shadowBlur/l/2+"px "+i.shadowColor+")",null!==t.background&&s.Ma.setAttributeNS(null,"filter",l),null!==t.areaBackground&&s.gd.setAttributeNS(null,"filter",l)),a&&(null!==t.Ma||null!==t.areaBackground||Rs(t,o))?(Zs(t,!0),null===t.shadowVisible&&La(i)):Zs(t,!1),o=a,t.hh(i,e),r&&i.nh.pop(),i.o&&i.nh.pop(),s=i.Gv.hs,a=r?t.svg:i.yd,l=t.svg,r||null===l||a===l||l.parentNode!==t.panel.svg?(t.svg=a,null!==s&&null===a&&(Ta(i),i.nh.pop()),null===a||(t.$o(i,n,h,a),i.Il&&(e=e.computePixelRatio(),t.Dv(a,"drop-shadow("+i.shadowOffsetX/e+"px "+i.shadowOffsetY/e+"px "+i.shadowBlur/e/2+"px "+i.shadowColor+")")),o&&0!=(512&t.l)==!0&&Aa(i),t.Dd()&&La(i),e=t.Dd()?t.opacity*i.globalAlpha:t.opacity,1!==e&&a.setAttributeNS(null,"opacity",e.toString()),""!==t.filter&&a.setAttributeNS(null,"filter",t.filter),t.Dd()?(i.ti?i.ti.after(a):i.Nj.prepend(a),i.ti=a):null!==n&&Ys(t,n,a),null!==s&&s(t,a)),!0):(t.svg.replaceWith(a),t.svg=a,null!==a&&t.$o(i,n,h,a),Gs(i,l),!0)}(this,t,i)&&this.visible){var e=this.opacity;if(0!==e){var n=1;1!==e&&(n=t.globalAlpha,t.globalAlpha=n*e);var o="";""!==this.filter&&(o=t.filter,t.filter=this.filter);var r=this instanceof Ch&&Vh(this),s=this.Ib;if(r){var a=this.Ib,h=this.dc,l=this.areaBackground,u=this.Ma;null===l&&null===u||t.yc(),null!==l&&(Us(this,t,l,!0,!0,h,a),l instanceof Ia&&l.type===$a?(t.beginPath(),t.rect(a.x,a.y,a.width,a.height),t.ng(l)):t.fillRect(a.x,a.y,a.width,a.height)),null!==u&&(Us(this,t,u,!0,!1,h,a),u instanceof Ia&&u.type===$a?(t.beginPath(),t.rect(a.x,a.y,a.width,a.height),t.ng(u)):t.fillRect(a.x,a.y,a.width,a.height)),this.hh(t,i)}if(!r&&(r||0!==s.width&&0!==s.height&&!isNaN(s.x)&&!isNaN(s.y))){r=this.transform,a=this.panel,0!=(4096&this.l)==!0&&qs(this),h=!1;var c,f=0;if((l=this.part)&&i.Gf("drawShadows")&&(h=l.isShadowed)&&(u=l.shadowOffset,f=Math.max(u.y,u.x)*i.scale*i.Mb),u=this.Dd(),!(c=i.$i||!u)){var d,p=this.naturalBounds,g=(c=this.wh).m11,m=c.m21,y=c.dx,v=c.m12,x=c.m22,b=c.dy,w=d=0;c=d*g+w*m+y;var k=d*v+w*x+b,M=(d=p.width+f)*g+(w=0)*m+y;d=d*v+w*x+b,w=Math.min(c,M);var S=Math.min(k,d),N=Math.max(c+0,M)-w,P=Math.max(k+0,d)-S;c=w,k=S,M=(d=p.width+f)*g+(w=p.height+f)*m+y,d=d*v+w*x+b,w=Math.min(c,M),S=Math.min(k,d),N=Math.max(c+N,M)-w,P=Math.max(k+P,d)-S,c=w,k=S,M=(d=0)*g+(w=p.height+f)*m+y,d=d*v+w*x+b,w=Math.min(c,M),S=Math.min(k,d),N=Math.max(c+N,M)-w,P=Math.max(k+P,d)-S,c=w,k=S,p=(f=i.viewportBounds).x,g=f.y,c=!(c>f.width+p||p>N+c||k>f.height+g||g>P+k)}if(c){if(c=0!=(256&this.l),t.clipInsteadOfFill&&(c=!1),this instanceof Pl&&(t.font=this.font),c){if(k=a.se()?a.naturalBounds:a.actualBounds,N=Math.max(s.x,k.x),P=Math.max(s.y,k.y),f=Math.min(s.right,k.right)-N,p=Math.min(s.bottom,k.bottom)-P,null!==(g=this.tb)&&(N=g.x,P=g.y,f=g.width,p=g.height),N>s.width+s.x||s.x>k.width+k.x)return 1!==e&&(t.globalAlpha=n),void(""!==this.filter&&(t.filter=o));t.save(),t.beginPath(),t.rect(N,P,f,p),t.clip()}if(u){if(!l.isVisible())return 1!==e&&(t.globalAlpha=n),void(""!==this.filter&&(t.filter=o));h&&(k=l.shadowOffset,t.Ev(k.x*i.scale*this.scale*i.Mb,k.y*i.scale*this.scale*i.Mb,l.shadowBlur),Aa(t),t.shadowColor=l.shadowColor)}h&&!0===this.shadowVisible?Aa(t):h&&!1===this.shadowVisible&&La(t),l=this.naturalBounds,null!==this.areaBackground&&(t.yc(),Es(this,t,l,s)),t.transform(r.m11,r.m12,r.m21,r.m22,r.dx,r.dy),h&&Rs(this,a)&&null===this.shadowVisible&&La(t),null!==this.Ma&&(t.yc(),Vs(this,t,l,s)),h&&(null!==this.Ma||null!==this.areaBackground||Rs(this,a))?(Zs(this,!0),null===this.shadowVisible&&La(t)):Zs(this,!1),this.hh(t,i),h&&0!=(512&this.l)==!0&&Aa(t),u&&h&&La(t),c&&(t.restore(),t.Vc(this instanceof Ch)),r.ws()||(i=1/(r.m11*r.m22-r.m12*r.m21),t.transform(r.m22*i,-r.m12*i,-r.m21*i,r.m11*i,i*(r.m21*r.dy-r.m22*r.dx),i*(r.m12*r.dx-r.m11*r.dy)))}}1!==e&&(t.globalAlpha=n),""!==this.filter&&(t.filter=o)}}},i.Dv=function(){},i.$o=function(t,i,e,n){var o=0!=(256&this.l);if(t.clipInsteadOfFill&&(o=!1),o){var r=i.se()?i.naturalBounds:i.actualBounds;i=Math.max(e.x,r.x),o=Math.max(e.y,r.y);var s=Math.min(e.right,r.right)-i;e=Math.min(e.bottom,r.bottom)-o,null!==(r=this.tb)&&(i=r.x,o=r.y,s=r.width,e=r.height);var a=null;null!==(r=n.getAttribute("clip-path"))&&(a=t.svg.getElementById(r.split("#")[1].slice(0,-1))),null===a?(r="CLIP"+at++,a=t.Ud("clipPath",{id:r}),i=t.Ud("rect",{x:i,y:o,width:s,height:e}),this instanceof Ch&&(o=this.transform.copy().Vj(),i.setAttribute("transform","matrix("+o.m11+", "+o.m12+", "+o.m21+", "+o.m22+", "+o.dx+", "+o.dy+")")),a.appendChild(i),t.svg.appendChild(a),n.setAttributeNS(null,"clip-path","url(#"+r+")")):((t=a.firstElementChild).setAttribute("x",i.toString()),t.setAttribute("y",o.toString()),t.setAttribute("width",s.toString()),t.setAttribute("height",e.toString()))}else n.removeAttributeNS(null,"clip-path"),Gs(t,n)},i.hh=function(){},i.lv=function(){this.Uc=!0},i.kk=function(t,i,e){if(this.Uc)return this.lv(),this.Uc=!1;if(null===(i=this.svg))return!1;if(!this.visible)return i.remove(),!1;if("g"!==i.nodeName&&e||"g"===i.nodeName&&!e)return!1;var n=this.transform,o=this instanceof Ch&&Vh(this);if(!(this instanceof Ch&&o))if(this instanceof ou){var r=this.bt;t.rb.ha=[n.m11,n.m12,n.m21,n.m22,n.dx,n.dy],null!==r&&ba(t,r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]),e?i.lastElementChild.setAttributeNS(null,"transform",wa(t)):i.setAttributeNS(null,"transform",wa(t))}else if(!e||this instanceof Ch)i.setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")");else if(this instanceof pl){r=i.getElementsByTagName("path");for(var s=0;st?t=0:1t||1=t&&w("GraphObject.scale for "+this+" must be greater than zero, not: "+t),this.Ca=t,this.v(),this.g("scale",i,t))}},angle:{get:function(){return this.Kb},set:function(t){var i=this.Kb;i!==t&&(0>(t%=360)&&(t+=360),i!==t&&(this.Kb=t,sa(this),this.v(),this.g("angle",i,t)))}},desiredSize:{get:function(){return this.jd},set:function(t){var i=t.width,e=t.height,n=this.jd,o=n.width,r=n.height;(o===i||isNaN(o)&&isNaN(i))&&(r===e||isNaN(r)&&isNaN(e))||(this.jd=t=t.J(),this.v(),this instanceof pl&&this.qc(),this.g("desiredSize",n,t),_s(this)&&(null!==(t=this.part)&&(Os(this,t,"width"),Os(this,t,"height"))))}},width:{get:function(){return this.jd.width},set:function(t){var i=this.jd.width;i===t||isNaN(i)&&isNaN(t)||(i=this.jd,this.jd=t=new At(t,this.jd.height).freeze(),this.v(),this instanceof pl&&this.qc(),this.g("desiredSize",i,t),_s(this)&&(null!==(t=this.part)&&Os(this,t,"width")))}},height:{get:function(){return this.jd.height},set:function(t){var i=this.jd.height;i===t||isNaN(i)&&isNaN(t)||(i=this.jd,this.jd=t=new At(this.jd.width,t).freeze(),this.v(),this instanceof pl&&this.qc(),this.g("desiredSize",i,t),_s(this)&&(null!==(t=this.part)&&Os(this,t,"height")))}},minSize:{get:function(){return null!==this.A?this.A.u:kt},set:function(t){var i=this.minSize;i.D(t)||(t=t.copy(),isNaN(t.width)&&(t.width=0),isNaN(t.height)&&(t.height=0),t.freeze(),Bs(this),this.A.u=t,this.v(),this.g("minSize",i,t))}},maxSize:{get:function(){return null!==this.A?this.A.o:Ct},set:function(t){var i=this.maxSize;i.D(t)||(t=t.copy(),isNaN(t.width)&&(t.width=1/0),isNaN(t.height)&&(t.height=1/0),t.freeze(),Bs(this),this.A.o=t,this.v(),this.g("maxSize",i,t))}},measuredBounds:{get:function(){return this.uc}},naturalBounds:{get:function(){return this.dc}},margin:{get:function(){return this.Kg},set:function(t){"number"==typeof t&&(t=new Wt(t));var i=this.Kg;i.D(t)||(this.Kg=t=t.J(),this.v(),this.g("margin",i,t))}},transform:{get:function(){return 0!=(2048&this.l)==!0&&qs(this),this.Ab}},oe:{get:function(){return 0!=(4096&this.l)==!0&&qs(this),this.wh}},animationTriggers:{get:function(){return null!==this.A?this.A.hb:null},set:function(t){this.animationTriggers!==t&&(Bs(this),this.A.hb=t)}},reshapingBehavior:{get:function(){return null!==this.A?this.A.Pf:fs},set:function(t){this.reshapingBehavior!==t&&(Bs(this),this.A.Pf=t)}},alignment:{get:function(){return this.Jb},set:function(t){var i=this.Jb;i.D(t)||(t.Mc()&&!t.Xb()&&w("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+t),this.Jb=t=t.J(),Ks(this),this.g("alignment",i,t))}},column:{get:function(){return this.Ag},set:function(t){t=Math.round(t);var i=this.Ag;i!==t&&(0>t&&M(t,">= 0",Ds,"column"),this.Ag=t,this.v(),this.g("column",i,t),null!==this.svg&&this.svg.remove())}},columnSpan:{get:function(){return null!==this.A?this.A.ob:1},set:function(t){t=Math.round(t);var i=this.columnSpan;i!==t&&(1>t&&M(t,">= 1",Ds,"columnSpan"),Bs(this),this.A.ob=t,this.v(),this.g("columnSpan",i,t))}},row:{get:function(){return this.io},set:function(t){t=Math.round(t);var i=this.io;i!==t&&(0>t&&M(t,">= 0",Ds,"row"),this.io=t,this.v(),this.g("row",i,t),null!==this.svg&&this.svg.remove())}},rowSpan:{get:function(){return null!==this.A?this.A.Bi:1},set:function(t){t=Math.round(t);var i=this.rowSpan;i!==t&&(1>t&&M(t,">= 1",Ds,"rowSpan"),Bs(this),this.A.Bi=t,this.v(),this.g("rowSpan",i,t))}},spanAllocation:{get:function(){return null!==this.A?this.A.Di:null},set:function(t){var i=this.spanAllocation;i!==t&&(Bs(this),this.A.Di=t,this.v(),this.g("spanAllocation",i,t))}},alignmentFocus:{get:function(){return this.sk},set:function(t){var i=this.sk;i.D(t)||(this.sk=t=t.J(),this.v(),this.g("alignmentFocus",i,t))}},portId:{get:function(){return this.Yn},set:function(t){var i=this.Yn;if(i!==t){var e=this.part;null===e||e instanceof Ju||w("Cannot set portID on a Link: "+t),null!==i&&null!==e&&ac(e,this),this.Yn=t,null!==t&&null!==e&&(e.Te=!0,sc(e,this)),this.g("portId",i,t)}}},toSpot:{get:function(){return null!==this.ba?this.ba.yj:Qt},set:function(t){var i=this.toSpot;i.D(t)||(t=t.J(),this.Xc(),this.ba.yj=t,this.g("toSpot",i,t),ra(this))}},toEndSegmentLength:{get:function(){return null!==this.ba?this.ba.wj:10},set:function(t){var i=this.toEndSegmentLength;i!==t&&(0>t&&M(t,">= 0",Ds,"toEndSegmentLength"),this.Xc(),this.ba.wj=t,this.g("toEndSegmentLength",i,t),ra(this))}},toShortLength:{get:function(){return null!==this.ba?this.ba.xj:0},set:function(t){var i=this.toShortLength;i!==t&&(this.Xc(),this.ba.xj=t,this.g("toShortLength",i,t),ra(this))}},toLinkable:{get:function(){return null!==this.ba?this.ba.Tr:null},set:function(t){var i=this.toLinkable;i!==t&&(this.Xc(),this.ba.Tr=t,this.g("toLinkable",i,t))}},toMaxLinks:{get:function(){return null!==this.ba?this.ba.Ur:1/0},set:function(t){var i=this.toMaxLinks;i!==t&&(0>t&&M(t,">= 0",Ds,"toMaxLinks"),this.Xc(),this.ba.Ur=t,this.g("toMaxLinks",i,t))}},fromSpot:{get:function(){return null!==this.ba?this.ba.Xi:Qt},set:function(t){var i=this.fromSpot;i.D(t)||(t=t.J(),this.Xc(),this.ba.Xi=t,this.g("fromSpot",i,t),ra(this))}},fromEndSegmentLength:{get:function(){return null!==this.ba?this.ba.Vi:10},set:function(t){var i=this.fromEndSegmentLength;i!==t&&(0>t&&M(t,">= 0",Ds,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=t,this.g("fromEndSegmentLength",i,t),ra(this))}},fromShortLength:{get:function(){return null!==this.ba?this.ba.Wi:0},set:function(t){var i=this.fromShortLength;i!==t&&(this.Xc(),this.ba.Wi=t,this.g("fromShortLength",i,t),ra(this))}},fromLinkable:{get:function(){return null!==this.ba?this.ba.hq:null},set:function(t){var i=this.fromLinkable;i!==t&&(this.Xc(),this.ba.hq=t,this.g("fromLinkable",i,t))}},fromMaxLinks:{get:function(){return null!==this.ba?this.ba.iq:1/0},set:function(t){var i=this.fromMaxLinks;i!==t&&(0>t&&M(t,">= 0",Ds,"fromMaxLinks"),this.Xc(),this.ba.iq=t,this.g("fromMaxLinks",i,t))}},cursor:{get:function(){return null!==this.A?this.A.j:""},set:function(t){var i=this.cursor;i!==t&&(Bs(this),this.A.j=t,this.g("cursor",i,t))}},click:{get:function(){return null!==this.A?this.A.zh:null},set:function(t){var i=this.click;i!==t&&(Bs(this),this.A.zh=t,this.g("click",i,t))}},doubleClick:{get:function(){return null!==this.A?this.A.Fh:null},set:function(t){var i=this.doubleClick;i!==t&&(Bs(this),this.A.Fh=t,this.g("doubleClick",i,t))}},contextClick:{get:function(){return null!==this.A?this.A.Bh:null},set:function(t){var i=this.contextClick;i!==t&&(Bs(this),this.A.Bh=t,this.g("contextClick",i,t))}},mouseEnter:{get:function(){return null!==this.A?this.A.Mh:null},set:function(t){var i=this.mouseEnter;i!==t&&(Bs(this),this.A.Mh=t,this.g("mouseEnter",i,t))}},mouseLeave:{get:function(){return null!==this.A?this.A.Ph:null},set:function(t){var i=this.mouseLeave;i!==t&&(Bs(this),this.A.Ph=t,this.g("mouseLeave",i,t))}},mouseOver:{get:function(){return null!==this.A?this.A.Qh:null},set:function(t){var i=this.mouseOver;i!==t&&(Bs(this),this.A.Qh=t,this.g("mouseOver",i,t))}},mouseHover:{get:function(){return null!==this.A?this.A.Oh:null},set:function(t){var i=this.mouseHover;i!==t&&(Bs(this),this.A.Oh=t,this.g("mouseHover",i,t))}},mouseHold:{get:function(){return null!==this.A?this.A.Nh:null},set:function(t){var i=this.mouseHold;i!==t&&(Bs(this),this.A.Nh=t,this.g("mouseHold",i,t))}},mouseDragEnter:{get:function(){return null!==this.A?this.A.Of:null},set:function(t){var i=this.mouseDragEnter;i!==t&&(Bs(this),this.A.Of=t,this.g("mouseDragEnter",i,t))}},mouseDragLeave:{get:function(){return null!==this.A?this.A.Xd:null},set:function(t){var i=this.mouseDragLeave;i!==t&&(Bs(this),this.A.Xd=t,this.g("mouseDragLeave",i,t))}},mouseDrop:{get:function(){return null!==this.A?this.A.Lh:null},set:function(t){var i=this.mouseDrop;i!==t&&(Bs(this),this.A.Lh=t,this.g("mouseDrop",i,t))}},actionDown:{get:function(){return null!==this.A?this.A.V:null},set:function(t){var i=this.actionDown;i!==t&&(Bs(this),this.A.V=t,this.g("actionDown",i,t))}},actionMove:{get:function(){return null!==this.A?this.A.ia:null},set:function(t){var i=this.actionMove;i!==t&&(Bs(this),this.A.ia=t,this.g("actionMove",i,t))}},actionUp:{get:function(){return null!==this.A?this.A.Ha:null},set:function(t){var i=this.actionUp;i!==t&&(Bs(this),this.A.Ha=t,this.g("actionUp",i,t))}},actionCancel:{get:function(){return null!==this.A?this.A.F:null},set:function(t){var i=this.actionCancel;i!==t&&(Bs(this),this.A.F=t,this.g("actionCancel",i,t))}},toolTip:{get:function(){return null!==this.A?this.A.$h:null},set:function(t){var i=this.toolTip;i!==t&&(Bs(this),this.A.$h=t,this.g("toolTip",i,t))}},contextMenu:{get:function(){return null!==this.A?this.A.Ch:null},set:function(t){var i=this.contextMenu;i!==t&&(Bs(this),this.A.Ch=t,this.g("contextMenu",i,t))}}}),Ds.prototype.trigger=Ds.prototype.Jv,Ds.prototype.findBindingPanel=Ds.prototype.ih,Ds.prototype.findTemplateBinder=Ds.prototype.pz,Ds.prototype.setProperties=Ds.prototype.nm,Ds.prototype.apply=Ds.prototype.apply,Ds.prototype.attach=Ds.prototype.Du,Ds.prototype.set=Ds.prototype.set,Ds.prototype.isEnabledObject=Ds.prototype.If,Ds.prototype.isVisibleObject=Ds.prototype.Ed,Ds.prototype.isContainedBy=Ds.prototype.rg,Ds.prototype.getNearestIntersectionPoint=Ds.prototype.rs,Ds.prototype.getLocalPoint=Ds.prototype.qs,Ds.prototype.getDocumentScale=Ds.prototype.Df,Ds.prototype.getDocumentAngle=Ds.prototype.li,Ds.prototype.getDocumentBounds=Ds.prototype.mi,Ds.prototype.getDocumentPoint=Ds.prototype.ga,Ds.prototype.intersectsRect=Ds.prototype.Yc,Ds.prototype.containedInRect=Ds.prototype.fh,Ds.prototype.containsRect=Ds.prototype.Re,Ds.prototype.containsPoint=Ds.prototype.ca,Ds.prototype.raiseChanged=Ds.prototype.g,Ds.prototype.raiseChangedEvent=Ds.prototype.cb,Ds.prototype.addCopyProperty=Ds.prototype.Vw;var ca=null;function fa(){this.nc=!1,this.xa="",this.zp=-1,this.nb=this.wm=this.te=null,this.j="",this.hb=this.Di=this.Hb=this.Ch=this.$h=this.F=this.Ha=this.ia=this.V=this.Lh=this.Xd=this.Of=this.Nh=this.Oh=this.Qh=this.Ph=this.Mh=this.Bh=this.Fh=this.zh=null,this.u=kt,this.o=Ct,this.hg=ms,this.ob=this.Bi=1,this.Pf=fs,this.Pc=this.Ci=this.gd=null,this.Oc="category"}function da(){this.u=-1/0,this.o=0,this.F=et,this.rr=Wc,this.j=this.V="None"}function pa(){this.yj=this.Xi=Si,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}function ga(){this.ha=[1,0,0,1,0,0]}function ma(t){this.type=t,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}function ya(t,i,e){this.ownerDocument=t=void 0===i?m.document:i,this.cA="http://www.w3.org/2000/svg",void 0!==t&&(this.Oa=this.Ud("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink")),this.hs=null,this.context=new va(this,e)}function va(t,i){this.Gv=t,this.svg=t.Oa,this.stack=[],this.nh=[],this.fillStyle="#000000",this.font="10px sans-serif",this.globalAlpha=1,this.lineCap="butt",this.lineDashOffset=0,this.lineJoin="miter",this.lineWidth=1,this.miterLimit=10,this.shadowBlur=0,this.shadowColor="rgba(0, 0, 0, 0)",this.shadowOffsetY=this.shadowOffsetX=0,this.Il=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.Vg=this.Br=this.Ar=0,this.yd=this.ad=null,this.path=[],this.Yl={},this.Ct=!1,this.Yg=null,this.uj=0,this.rb=new ga,this.j=Ta(this),this.Nj=Ta(this,"gojs-diagram"),this.Hl=this.ti=null;var e=at++,n=this.Ud("clipPath",{id:"mainClip"+e});n.appendChild(this.Ud("rect",{x:0,y:0,width:t.width,height:t.height})),this.ww=n,this.svg.appendChild(this.j),this.j.appendChild(this.Nj),this.svg.appendChild(n),this.j.setAttributeNS(null,"clip-path","url(#mainClip"+e+")"),this.eA={},this.isTemporary=!!i,this.filter="",this.bk=null}function xa(t,i,e,n,o,r,s){void 0===t.Nj?Ca(t,i,e,n,o,r,s):t.Nj.setAttribute("transform","matrix("+i+", "+e+", "+n+", "+o+", "+r+", "+s+")")}function ba(t,i,e,n,o,r,s,a,h){n=a/n,o=h/o,0===r&&0===s||t.rb.translate(r,s),1===n&&1===o||t.rb.scale(n,o),0===i&&0===e||t.rb.translate(-i,-e)}function wa(t){return"matrix("+(t=t.rb.ha)[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function ka(t,i,e,n){"fill"===i?Ma(t,e):"stroke"===i&&Na(t,e),null!==n&&(t=n.ha,e.transform="matrix("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")")}function Ma(t,i){t.fillStyle instanceof ma?i.fill=Pa(t,t.fillStyle,!0):/^rgba\(/.test(t.fillStyle)?(t=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.fillStyle),i.fill="rgb("+t[1]+","+t[2]+","+t[3]+")",i["fill-opacity"]=t[4]):i.fill=t.fillStyle}function Sa(t,i,e){e=e?"fill":"stroke",t.fillStyle instanceof ma?i.setAttributeNS(null,"fill",Pa(t,t.fillStyle,!0)):/^rgba\(/.test(t.fillStyle)?(t=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.fillStyle),i.setAttributeNS(null,e,"rgb("+t[1]+","+t[2]+","+t[3]+")"),i.setAttributeNS(null,e+"-opacity",t[4])):i.setAttributeNS(null,e,t.fillStyle)}function Na(t,i){if(t.strokeStyle instanceof ma)i.stroke=Pa(t,t.strokeStyle,!1);else if(/^rgba\(/.test(t.strokeStyle)){var e=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.strokeStyle);i.stroke="rgb("+e[1]+","+e[2]+","+e[3]+")",i["stroke-opacity"]=e[4]}else i.stroke=t.strokeStyle;i["stroke-width"]=t.lineWidth,i["stroke-linecap"]=t.lineCap,i["stroke-linejoin"]=t.lineJoin,i["stroke-miterlimit"]=t.miterLimit,t.Ct&&(i["stroke-dasharray"]=t.Yg.toString(),i["stroke-dashoffset"]=t.uj)}function Pa(t,i,e){var n="";if(null!==(n=null!==t.Hl?t.Hl.getAttribute(e?"fill":"stroke"):null)&&-1!==n.indexOf("GRAD")?(n=n.split("#")[1].slice(0,-1),null!==(e=t.svg.getElementById(n))&&e.remove()):n="GRAD"+at++,"linear"===i.type)e=t.Ud("linearGradient",{x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2,id:n,gradientUnits:"userSpaceOnUse"});else{if("radial"!==i.type)throw Error("invalid gradient");e=t.Ud("radialGradient",{x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2,r1:i.r1,r2:i.r2,id:n})}var o=i.gx;i=o.length;for(var r=[],s=0;si.offset?1:-1})),o=0;ot&&(t+=360),0!==t){if(this.translate(i,e),90===t){t=0;var n=1}else 180===t?(t=-1,n=0):270===t?(t=0,n=-1):(n=t*Math.PI/180,t=Math.cos(n),n=Math.sin(n));var o=this.ha[1]*t+this.ha[3]*n,r=this.ha[0]*-n+this.ha[2]*t,s=this.ha[1]*-n+this.ha[3]*t;this.ha[0]=this.ha[0]*t+this.ha[2]*n,this.ha[1]=o,this.ha[2]=r,this.ha[3]=s,this.translate(-i,-e)}},ga.className="STransform",ma.prototype.addColorStop=function(t,i){this.gx.push({offset:t,color:i})},ma.className="SGradient",ya.prototype.resize=function(t,i,e,n){return(this.width!==t||this.height!==i)&&(this.width=t,this.height=i,this.style.width=e+"px",this.style.height=n+"px",this.Oa.setAttributeNS(null,"width",e+"px"),this.Oa.setAttributeNS(null,"height",n+"px"),this.Oa.setAttributeNS(null,"viewBox","0 0 "+e+" "+n),this.context.ww.firstElementChild.setAttributeNS(null,"width",e+"px"),this.context.ww.firstElementChild.setAttributeNS(null,"height",n+"px"),!0)},ya.prototype.Ud=function(t,i,e){if(t=this.ownerDocument.createElementNS(this.cA,t),N(i))for(var n in i)t.setAttributeNS("href"===n?"http://www.w3.org/1999/xlink":"",n,i[n]);return void 0!==e&&(t.textContent=e),t},ya.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},ya.prototype.focus=function(){this.Oa.focus()},ya.prototype.mx=function(){this.ownerDocument=null},f.Object.defineProperties(ya.prototype,{width:{get:function(){return this.Oa.width.baseVal.value},set:function(t){this.Oa.setAttribute("width",t+"px")}},height:{get:function(){return this.Oa.height.baseVal.value},set:function(t){this.Oa.setAttribute("height",t+"px")}},style:{get:function(){return this.Oa.style}}}),ya.className="SVGSurface",(i=va.prototype).arc=function(t,i,e,n,o,r,s,a){var h=2*Math.PI,l=h-1e-6,u=e*Math.cos(n),c=e*Math.sin(n),f=t+u,d=i+c,p=r?0:1;n=r?n-o:o-n,(1e-6n&&(n=n%h+h),n>l?(this.path.push(["A",e,e,0,1,p,t-u,i-c]),this.path.push(["A",e,e,0,1,p,f,d])):1e-6=Math.PI),p,t+e*Math.cos(o),i+e*Math.sin(o)])},i.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},i.Se=function(t){this.addPath(this.path,this.rb,t||0)},i.bezierCurveTo=function(t,i,e,n,o,r){this.path.push(["C",t,i,e,n,o,r])},i.clearRect=function(){},i.clip=function(){this.Yl.clipPath=!0},i.closePath=function(){this.path.push(["z"])},i.createLinearGradient=function(t,i,e,n){var o=new ma("linear");return o.x1=t,o.y1=i,o.x2=e,o.y2=n,o},i.createPattern=function(t){var i="";t instanceof HTMLCanvasElement&&(i=t.toDataURL()),t instanceof HTMLImageElement&&(i=t.getAttribute("src"));var e=this.eA;if(e[i])return"url(#"+e[i]+")";var n="PATTERN"+at++,o={x:0,y:0,width:t.width,height:t.height,href:i};return(t=this.Ud("pattern",{width:t.width,height:t.height,id:n,patternUnits:"userSpaceOnUse"})).appendChild(this.Ud(rs,o)),this.svg.appendChild(t),e[i]=n,"url(#"+n+")"},i.createRadialGradient=function(t,i,e,n,o,r){var s=new ma("radial");return s.x1=t,s.y1=i,s.r1=e,s.x2=n,s.y2=o,s.r2=r,s},i.drawImage=function(t,i,e,n,o,r,s,a,h){var l="";t instanceof HTMLCanvasElement&&(l=t.toDataURL()),t instanceof HTMLImageElement&&(l=t.getAttribute("src"));var u=t instanceof HTMLImageElement?t.naturalWidth:t.width;t=t instanceof HTMLImageElement?t.naturalHeight:t.height,void 0===n&&(r=i,s=e,a=n=u,h=o=t),ba(this,i,e,n=n||0,o=o||0,r||0,s||0,a=a||0,h=h||0),r={x:0,y:0,width:u||n,height:t||o,href:l},Xi.$(n,a)&&Xi.$(o,h)?-1===l.toLowerCase().indexOf(".svg")&&-1===l.toLowerCase().indexOf("data:image/svg")&&(r.preserveAspectRatio="xMidYMid slice"):r.preserveAspectRatio="none",0===i&&0===e&&n===u&&o===t||(n+=i,o+=e,r["clip-path"]="path('M "+i+","+e+" L "+n+" "+e+" L "+n+" "+o+" L "+i+" "+o+" z')"),ka(this,rs,r,this.rb),this.addElement(rs,r)},i.fill=function(t){t&&(this.Yl["fill-rule"]="evenodd"),Ma(this,this.Yl)},i.ng=function(t,i){this.clipInsteadOfFill?this.clip():this.fill(i)},i.fillRect=function(t,i,e,n){ka(this,"fill",t={x:(t=[t,i,e,n])[0],y:t[1],width:t[2],height:t[3]},this.rb),this.addElement("rect",t)},i.ox=function(t,i,e,n){ka(this,"fill",t={x:t,y:i,width:e,height:n},this.rb),Ma(this,t),this.svg.prepend(this.Ud("rect",t))},i.fillText=function(t,i,e){t=[t,i,e],"left"===(i=this.textAlign)?i="start":"right"===i?i="end":"center"===i&&(i="middle"),ka(this,"fill",i={x:t[1],y:t[2],style:"font: "+this.font,"text-anchor":i},this.rb),this.addElement("text",i,t[0])},i.lineTo=function(t,i){this.path.push(["L",t,i])},i.moveTo=function(t,i){this.path.push(["M",t,i])},i.quadraticCurveTo=function(t,i,e,n){this.path.push(["Q",t,i,e,n])},i.rect=function(t,i,e,n){this.path.push(["M",t,i],["L",t+e,i],["L",t+e,i+n],["L",t,i+n],["z"])},i.restore=function(){this.rb=this.stack.pop(),this.path=this.stack.pop();var t=this.stack.pop();this.fillStyle=t.fillStyle,this.font=t.font,this.globalAlpha=t.globalAlpha,this.lineCap=t.lineCap,this.lineDashOffset=t.lineDashOffset,this.lineJoin=t.lineJoin,this.lineWidth=t.lineWidth,this.miterLimit=t.miterLimit,this.shadowBlur=t.shadowBlur,this.shadowColor=t.shadowColor,this.shadowOffsetX=t.shadowOffsetX,this.shadowOffsetY=t.shadowOffsetY,this.strokeStyle=t.strokeStyle,this.textAlign=t.textAlign,this.bk=t.bk},i.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign,bk:this.bk});for(var t=[],i=0;ie?(this.scale(e/t,1),this.translate((t-e)/2,0)):e>t&&(this.scale(1,t/e),this.translate(0,(e-t)/2)),this.Hm?this.clip():this.fill(i),t>e?(this.translate(-(t-e)/2,0),this.scale(1/(e/t),1)):e>t&&(this.translate(0,-(e-t)/2),this.scale(1,1/(t/e)))}else this.Hm?this.clip():this.fill(i)},i.jk=function(){this.Hm||this.stroke()},i.Ev=function(t,i,e){this.Ar=t,this.Br=i,this.Vg=e},i.js=function(t,i){var e=this.Z;void 0!==e.setLineDash&&(e.setLineDash(t),e.lineDashOffset=i)},i.fs=function(){var t=this.Z;void 0!==t.setLineDash&&(t.setLineDash(Ba),t.lineDashOffset=0)},i.Vc=function(t){t&&(this.dt=""),this.ct=this.et=""},i.Hs=function(){},f.Object.defineProperties(Da.prototype,{fillStyle:{get:function(){return this.Z.fillStyle},set:function(t){this.ct!==t&&(this.ct=this.Z.fillStyle=t)}},font:{get:function(){return this.Z.font},set:function(t){this.dt!==t&&(this.dt=this.Z.font=t)}},globalAlpha:{get:function(){return this.Z.globalAlpha},set:function(t){this.Z.globalAlpha=t}},lineCap:{get:function(){return this.Z.lineCap},set:function(t){this.Z.lineCap=t}},lineDashOffset:{get:function(){return this.Z.lineDashOffset},set:function(t){this.Z.lineDashOffset=t}},lineJoin:{get:function(){return this.Z.lineJoin},set:function(t){this.Z.lineJoin=t}},lineWidth:{get:function(){return this.Z.lineWidth},set:function(t){this.Z.lineWidth=t}},miterLimit:{get:function(){return this.Z.miterLimit},set:function(t){this.Z.miterLimit=t}},shadowBlur:{get:function(){return this.Z.shadowBlur},set:function(t){this.Z.shadowBlur=t}},shadowColor:{get:function(){return this.Z.shadowColor},set:function(t){this.Z.shadowColor=t}},shadowOffsetX:{get:function(){return this.Z.shadowOffsetX},set:function(t){this.Z.shadowOffsetX=t}},shadowOffsetY:{get:function(){return this.Z.shadowOffsetY},set:function(t){this.Z.shadowOffsetY=t}},strokeStyle:{get:function(){return this.Z.strokeStyle},set:function(t){this.et!==t&&(this.et=this.Z.strokeStyle=t)}},textAlign:{get:function(){return this.Z.textAlign},set:function(t){this.Z.textAlign=t}},imageSmoothingEnabled:{get:function(){return this.Z.imageSmoothingEnabled},set:function(t){this.Z.imageSmoothingEnabled=t}},filter:{get:function(){return this.Z.filter},set:function(t){this.Z.filter=""===t?"none":t}},clipInsteadOfFill:{get:function(){return this.Hm},set:function(t){this.Hm=t}}});var Ba=Object.freeze([]);function Oa(){this.F=this.o=this.u=this.j=0}function Ia(t,i){uh||(Ja(),uh=!0),Q(this),this._isFrozen=!1,void 0===t?(this.na=Za,this.xk="black"):"string"==typeof t?(this.na=Za,this.xk=t):(this.na=t,this.xk="black"),(t=this.na)===_a?(this.Qd=ii,this.Lk=ai):this.Lk=this.Qd=t===$a?oi:Qt,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,i&&Object.assign(this,i)}function za(t,i,e){return i=void 0===i||"number"!=typeof i?.2:i,e=void 0===e?th:e,Ga(t),Ya(i,e)}function Ra(t,i,e){return i=void 0===i||"number"!=typeof i?.2:i,e=void 0===e?th:e,Ga(t),Ya(-i,e)}function Ea(t,i,e){Ga(t),t=sh.j;var n=sh.u,o=sh.o,r=sh.F;return Ga(i),void 0===e&&(e=.5),"rgba("+Math.round((sh.j-t)*e+t)+", "+Math.round((sh.u-n)*e+n)+", "+Math.round((sh.o-o)*e+o)+", "+Math.round((sh.F-r)*e+r)+")"}function Va(t){return!!t&&(t instanceof Ia?t.Gx():(Ga(t),128>(299*sh.j+587*sh.u+114*sh.o)/1e3))}function Ya(t,i){switch(i){case th:i=100*Ua(sh.j);var e=100*Ua(sh.u),n=100*Ua(sh.o);return hh.j=.4124564*i+.3575761*e+.1804375*n,hh.u=.2126729*i+.7151522*e+.072175*n,hh.o=.0193339*i+.119192*e+.9503041*n,hh.F=sh.F,i=Ka(hh.j/oh[0]),e=Ka(hh.u/oh[1]),n=Ka(hh.o/oh[2]),lh.j=116*e-16,lh.u=500*(i-e),lh.o=200*(e-n),lh.F=hh.F,lh.j=Math.min(100,Math.max(0,lh.j+100*t)),i=(t=(lh.j+16)/116)-lh.o/200,hh.j=oh[0]*Ha(lh.u/500+t),hh.u=oh[1]*(lh.j>nh*eh?Math.pow(t,3):lh.j/nh),hh.o=oh[2]*Ha(i),hh.F=lh.F,t=-.969266*hh.j+1.8760108*hh.u+.041556*hh.o,i=.0556434*hh.j+-.2040259*hh.u+1.0572252*hh.o,sh.j=255*qa((3.2404542*hh.j+-1.5371385*hh.u+-.4985314*hh.o)/100),sh.u=255*qa(t/100),sh.o=255*qa(i/100),sh.F=hh.F,sh.j=Math.round(sh.j),255sh.j&&(sh.j=0),sh.u=Math.round(sh.u),255sh.u&&(sh.u=0),sh.o=Math.round(sh.o),255sh.o&&(sh.o=0),"rgba("+sh.j+", "+sh.u+", "+sh.o+", "+sh.F+")";case ih:return Xa(),ah.o=Math.min(100,Math.max(0,ah.o+100*t)),"hsla("+ah.j+", "+ah.u+"%, "+ah.o+"%, "+ah.F+")";default:w("Unknown color space: "+i)}}function Ga(t){uh||(Ja(),uh=!0);var i=rh;if(null!==i){i.clearRect(0,0,1,1),i.fillStyle="#000000";var e=i.fillStyle;i.fillStyle=t,i.fillStyle!==e?(i.fillRect(0,0,1,1),t=i.getImageData(0,0,1,1).data,sh.j=t[0],sh.u=t[1],sh.o=t[2],sh.F=t[3]/255):(i.fillStyle="#FFFFFF",i.fillStyle=t,sh.j=0,sh.u=0,sh.o=0,sh.F=1)}}function Xa(){var t=sh.j/255,i=sh.u/255,e=sh.o/255,n=Math.max(t,i,e),o=Math.min(t,i,e),r=n-o;if(o=(n+o)/2,0===r)var s=t=0;else{switch(n){case t:s=(i-e)/r%6;break;case i:s=(e-t)/r+2;break;case e:s=(t-i)/r+4}0>(s*=60)&&(s+=360),t=r/(1-Math.abs(2*o-1))}ah.j=Math.round(s),ah.u=Math.round(100*t),ah.o=Math.round(100*o),ah.F=sh.F}function Ua(t){return.04045>=(t/=255)?t/12.92:Math.pow((t+.055)/1.055,2.4)}function qa(t){return.0031308>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function Ka(t){return t>eh?Math.pow(t,1/3):(nh*t+16)/116}function Ha(t){var i=t*t*t;return i>eh?i:(116*t-16)/nh}function Wa(t,i){"string"!=typeof t&&(t instanceof Ia||w("Value for "+i+" must be a color string or a Brush, not "+t))}function Ja(){rh=Vr?new Fa(null,void 0,{willReadFrequently:!0}).context:null}Da.className="CanvasSurfaceContext",Oa.className="ColorNumbers",Ia.prototype.copy=function(){var t=new Ia;return t.na=this.na,t.xk=this.xk,t.Qd=this.Qd.J(),t.Lk=this.Lk.J(),t.Gr=this.Gr,t.Xp=this.Xp,null!==this.we&&(t.we=this.we.copy()),t.cr=this.cr,t},(i=Ia.prototype).freeze=function(){return this._isFrozen=!0,null!==this.we&&this.we.freeze(),this},i.ka=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this._isFrozen=!1,null!==this.we&&this.we.ka(),this},i.qb=function(t){t.classType===Ia&&(this.type=t)},i.toString=function(){var t="Brush(";if(this.type===Za)t+=this.color;else if(t=this.type===_a?t+"Linear ":this.type===$a?t+"Radial ":this.type===Qa?t+"Pattern ":t+"(unknown) ",t+=this.start+" "+this.end,null!==this.colorStops)for(var i=this.colorStops.iterator;i.next();)t+=" "+i.key+":"+i.value;return t+")"},i.addColorStop=function(t,i){return this._isFrozen&&k(this),("number"!=typeof t||!isFinite(t)||1t)&&M(t,"0 <= loc <= 1",Ia,"addColorStop:loc"),null===this.we&&(this.we=new dt),this.we.add(t,i),this.na===Za&&(this.type=_a),this.xe=null,this},i.Vz=function(t,i){if(this._isFrozen&&k(this),t=void 0===t||"number"!=typeof t?.2:t,i=void 0===i?th:i,this.type===Za)Ga(this.color),this.color=Ya(t,i);else if((this.type===_a||this.type===$a)&&null!==this.colorStops)for(var e=this.colorStops.iterator;e.next();)Ga(e.value),this.addColorStop(e.key,Ya(t,i));return this},i.Wy=function(t,i){if(this._isFrozen&&k(this),t=void 0===t||"number"!=typeof t?.2:t,i=void 0===i?th:i,this.type===Za)Ga(this.color),this.color=Ya(-t,i);else if((this.type===_a||this.type===$a)&&null!==this.colorStops)for(var e=this.colorStops.iterator;e.next();)Ga(e.value),this.addColorStop(e.key,Ya(-t,i));return this},i.Gx=function(){if(this.type===Za)return Va(this.color);if((this.type===_a||this.type===$a)&&null!==this.colorStops){var t=this.colorStops;if(this.type===$a)return Va(t.first().value);if(null!==t.get(.5))return Va(t.get(.5));if(2===t.count)return Va(Ea((t=t.Fa())[0].value,t[1].value));for(var i=t.iterator,e=-1,n=-1,o=1,r=1;i.next();){var s=i.key,a=Math.abs(.5-i.key);o>r&&a=o&&an&&(r=e,e=n,n=r,r=o),o=n-e,Va(Ea(t.get(e),t.get(n),1-r/o))}return!1},f.Object.defineProperties(Ia.prototype,{type:{get:function(){return this.na},set:function(t){this._isFrozen&&k(this,t),this.na=t,this.start.Mc()&&(t===_a?this.start=ii:t===$a&&(this.start=oi)),this.end.Mc()&&(t===_a?this.end=ai:t===$a&&(this.end=oi)),this.xe=null}},color:{get:function(){return this.xk},set:function(t){this._isFrozen&&k(this,t),this.xk=t,this.xe=null}},start:{get:function(){return this.Qd},set:function(t){this._isFrozen&&k(this,t),this.Qd=t.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(t){this._isFrozen&&k(this,t),this.Lk=t.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(t){this._isFrozen&&k(this,t),0>t&&M(t,">= zero",Ia,"startRadius"),this.Gr=t,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(t){this._isFrozen&&k(this,t),0>t&&M(t,">= zero",Ia,"endRadius"),this.Xp=t,this.xe=null}},colorStops:{get:function(){return this.we},set:function(t){this._isFrozen&&k(this,t),this.we=t,this.xe=null}},pattern:{get:function(){return this.cr},set:function(t){this._isFrozen&&k(this,t),this.cr=t,this.xe=null}}}),Ia.prototype.isDark=Ia.prototype.Gx,Ia.prototype.darkenBy=Ia.prototype.Wy,Ia.prototype.lightenBy=Ia.prototype.Vz,Ia.prototype.addColorStop=Ia.prototype.addColorStop;var Za,_a,$a,Qa,th,ih,eh=216/24389,nh=24389/27,oh=[95.047,100,108.883],rh=null,sh=new Oa,ah=new Oa,hh=new Oa,lh=new Oa,uh=!1;function ch(){this.xa="Base"}function fh(){this.xa="Base"}function dh(){this.xa="Base"}function ph(){this.xa="Base"}function gh(){this.xa="Base"}function mh(t,i,e){var n=null;if(t instanceof Ch&&""!==t.$e&&((n=t.fb(t.$e))===t&&(n=null)),null!==n)for(e&&t.arrange(0,0,i.width,i.height),i.assign(n.actualBounds),n=n.panel;n!==t;)n.transform.pp(i),n=n.panel}function yh(){this.xa="Base"}function vh(){this.xa="Base",this.name="Table"}function xh(){this.xa="Base"}function bh(){this.xa="Base"}function wh(){this.xa="Base"}function kh(){this.xa="Base"}function Mh(t,i,e,n){if(0>i)return t%i===e;if(t%i!==e)return!1;i=n.length;for(var o=0;os.height)continue}else if(l.position>s.width)continue;var u=l.separatorStrokeWidth;isNaN(u)&&(u=e?t.defaultRowSeparatorStrokeWidth:t.defaultColumnSeparatorStrokeWidth);var c=l.separatorStroke;if(null===c&&(c=e?t.defaultRowSeparatorStroke:t.defaultColumnSeparatorStroke),0!==u&&null!==c){Us(t,i,c,!1,!1,s,r),c=!1;var f=l.separatorDashArray;null===f&&(f=e?t.defaultRowSeparatorDashArray:t.defaultColumnSeparatorDashArray),null!==f&&(c=!0,i.js(f,0)),i.beginPath(),f=l.position+u,e?f>s.height&&(u-=f-s.height):f>s.width&&(u-=f-s.width),l=l.position+u/2,i.lineWidth=u,u=t.yb,e?(l+=u.top,f=s.width-u.right,i.moveTo(u.left,l),i.lineTo(f,l)):(l+=u.left,f=s.height-u.bottom,i.moveTo(l,u.top),i.lineTo(l,f)),i.stroke(),i.Se(),c&&i.fs()}}}}function Ah(t,i,e,n,o){for(var r=n.length,s=t.actualBounds,a=t.naturalBounds,h=jh(t,!0),l=jh(t,!1),u=0;uf)){var d=c.Wc(),p=c.separatorStrokeWidth;isNaN(p)&&(p=e?t.defaultRowSeparatorStrokeWidth:t.defaultColumnSeparatorStrokeWidth);var g=c.separatorStroke;null===g&&(g=e?t.defaultRowSeparatorStroke:t.defaultColumnSeparatorStroke),null!==g&&c.index!==(e?h:l)||(p=0),d-=p,(p=c.position+p)+(d+=c.actual)>f&&(d=f-p),0>=d||(f=t.yb,Us(t,i,c.background,!0,!1,a,s),e?i.fillRect(f.left,p+f.top,s.width-(f.left+f.right),d):i.fillRect(p+f.left,f.top,d,s.height-(f.top+f.bottom)))}}}}function jh(t,i){for(var e=i?t.rowCount:t.columnCount,n=0;nh.width||a.y>h.height||0>a.x+a.width||0>a.y+a.height||(s instanceof Ch&&Yh(s,i,e,n),null!==i&&(s=i(s)),null===s||null!==e&&!e(s)||n.add(s))}}}function Gh(t){var i=null;return t instanceof pl&&((i=t.spot1)===Si&&(i=null),null!==(t=t.geometry)&&null===i&&(i=t.spot1)),null===i&&(i=ti),i}function Xh(t){var i=null;return t instanceof pl&&((i=t.spot2)===Si&&(i=null),null!==(t=t.geometry)&&null===i&&(i=t.spot2)),null===i&&(i=hi),i}function Uh(t,i){t.l=i?16777216|t.l:-16777217&t.l}function qh(t,i,e){var n=t.rowDefs;if(!(0>i)){if(n[i]=e instanceof hl?e:void 0,!e)for(i=n.length-1;0<=i&&void 0===n[i--];)n.length--;t.v()}}function Kh(t,i,e){var n=t.colDefs;if(!(0>i)){if(n[i]=e instanceof hl?e:void 0,!e)for(i=n.length-1;0<=i&&void 0===n[i--];)n.length--;t.v()}}function Hh(t){return null!==(t=t.allBindings)&&t._isFrozen}function Wh(t){var i=t.allBindings;if(null===i)null!==t.data&&w("Template cannot have .data be non-null: "+t),t.allBindings=i=new Z;else if(i._isFrozen)return;var e=new Z;Uh(t,!1),t.qm(t,(function(t,n){n.th();var o=n.localBindings;if(null!==o)for($s(n,!1),o=o.iterator;o.next();){var r=o.value;r.mode===Kd&&$s(n,!0);var s=r.sourceName;null!==s&&("/"===s&&Uh(t,!0),null!==(s=Xd(r,t,n))&&(e.add(s),null===s.srcBindings&&(s.srcBindings=new Z),s.srcBindings.add(r))),i.add(r)}if(n instanceof Ch&&n.type===Ch.Table){if(0e;)t.pc(t.O.length-1,!1);else if(t.O.length<=e){e=i.length;for(var n=0;ne)){var o=Qh(t,i);if(null!==(o=tl(t,o))){if(Wh(o),0!=(16777216&(o=o.copy()).l)){var r=t.ih();null!==r&&Uh(r,!0)}"object"==typeof i&&(null===t.ge&&(t.ge=new dt),t.ge.add(i,o)),r=e+Jh(t),t.Gb(r,o),n&&(o.ub=i,$h(t,r,e),o.ub=null),o.data=i}}}function $h(t,i,e){for(t=t.O;ii.length&&(i="0"+i),2>n.length&&(n="0"+n),2>t.length&&(t="0"+t),"#"+i+n+t},Ia.isValidColor=function(t){if("black"===t)return!0;if(""===t)return!1;uh||(Ja(),uh=!0);var i=rh;if(null===i)return!0;i.fillStyle="#000000";var e=i.fillStyle;return i.fillStyle=t,i.fillStyle!==e||(i.fillStyle="#FFFFFF",e=i.fillStyle,i.fillStyle=t,i.fillStyle!==e)},Ia.lighten=function(t){return za(t)},Ia.lightenBy=za,Ia.darken=function(t){return Ra(t)},Ia.darkenBy=Ra,Ia.mix=Ea,Ia.isDark=Va,ch.prototype.measure=function(){},ch.prototype.Yz=function(t,i,e,n,o){t.measure(i,e,n,o)},ch.prototype.arrange=function(){},ch.prototype.Ly=function(t,i,e,n,o,r){t.arrange(i,e,n,o,r)},ch.prototype.iA=function(t){t.Uj()},ch.prototype.gc=function(){},f.Object.defineProperties(ch.prototype,{name:{get:function(){return this.xa},set:function(t){this.xa=t}},classType:{get:function(){return Ch}}}),ch.prototype.remeasureObject=ch.prototype.iA,ch.prototype.arrangeElement=ch.prototype.Ly,ch.prototype.measureElement=ch.prototype.Yz,ch.className="PanelLayout",c(fh,ch),fh.prototype.measure=function(t,i,e,n,o,r,s){var a=n.length;t=Dh(t);for(var h=0;hS&&(z=Math.max(S-ot,0));var rt=0===C.oa;C.oc=C.oc+z,C.actual=C.oa+z,S=Math.max(S-(z+(rt?ot:0)),0)}if(1===K.columnSpan&&(_===fs||_===gs)){var st=(C=t.Eb(Y)).Wc();(z=Math.max(et-C.actual,0))+st>M&&(z=Math.max(M-st,0));var at=0===C.oa;C.oc=C.oc+z,C.actual=C.oa+z,M=Math.max(M-(z+(at?st:0)),0)}H&&K.Uj()}}}}}j(v);var ht=0,lt=0;r=t.columnCount;for(var ut=0;ut=t.rowCount);ii++)C=t.Fb(Zt.row+ii),z=0,z=_===cs||_===gs?Math.max(C.minimum,0===Xt[Zt.row+ii]?C.maximum:Math.min(Xt[Zt.row+ii],C.maximum)):Math.max(C.minimum,isNaN(C.Hc)?C.maximum:Math.min(C.Hc,C.maximum)),Gt.height+=z,ti+=C.minimum;for(var ei=1;ei=t.columnCount);ei++)C=t.Eb(Zt.column+ei),z=0,z=_===cs||_===ps?Math.max(C.minimum,0===Ut[Zt.column+ei]?C.maximum:Math.min(Ut[Zt.column+ei],C.maximum)):Math.max(C.minimum,isNaN(C.Hc)?C.maximum:Math.min(C.Hc,C.maximum)),Gt.width+=z,Qt+=C.minimum;Ct.width+=Gt.width,Ct.height+=Gt.height;var ni=Zt.margin,oi=ni.right+ni.left,ri=ni.top+ni.bottom;Zt.measure(Ct.width,Ct.height,Qt,ti);for(var si=Zt.measuredBounds,ai=Math.max(si.width+oi,0),hi=Math.max(si.height+ri,0),li=0,ui=0;ui=t.rowCount);ui++)li+=(C=t.Fb(Zt.row+ui)).total||0;if(li=ci)&&!(Zt.row+pi>=t.rowCount);pi++){var gi=(C=t.Fb(Zt.row+pi)).oa||0,mi=di(Zt,C,fi);C.actual=Math.min(C.maximum,gi+mi),C.oa!==gi&&(ci-=C.oa-gi)}for(;0yi&&(C.actual=Math.min(C.maximum,yi+ci),C.oa!==yi&&(ci-=C.oa-yi)),0===C.index)break;C=t.Fb(C.index-1)}}for(var vi=0,xi=0;xi=t.columnCount);xi++)vi+=(C=t.Eb(Zt.column+xi)).total||0;if(vi=bi)&&!(Zt.column+Mi>=t.columnCount);Mi++){var Si=(C=t.Eb(Zt.column+Mi)).oa||0,Ni=ki(Zt,C,wi);C.actual=Math.min(C.maximum,Si+Ni),C.oa!==Si&&(bi-=C.oa-Si)}for(;0Pi&&(C.actual=Math.min(C.maximum,Pi+bi),C.oa!==Pi&&(bi-=C.oa-Pi)),0===C.index)break;C=t.Eb(C.index-1)}}}}j(x),At.free(Gt),At.free(Ct),void 0!==Xt&&j(Xt),void 0!==Ut&&j(Ut);var Ci=0,Ti=0,Li=t.desiredSize,Ai=t.maxSize;_=Hs(t,!0);var ji=lt=ht=0,Fi=0;r=t.columnCount;for(var Di=0;Di=t.rowCount);C++){var T=t.Fb(v+C);0!==T.oa&&(y.height+=T.total)}for(C=1;C=t.columnCount);C++)0!==(T=t.Eb(b+C)).oa&&(y.width+=T.total);var L=w.oa+y.width,A=x.oa+y.height;C=a,T=h;var j=L,F=A,D=a,B=h,O=L,I=A;a+L>e.width&&(O=Math.max(e.width-a,0)),h+A>e.height&&(I=Math.max(e.height-h,0));var z=N.alignment;if(z.Xb()){(z=t.defaultAlignment).sb()||(z=oi);var R=z.x,E=z.y,V=z.offsetX;z=z.offsetY;var Y=w.alignment,G=x.alignment;Y.sb()&&(R=Y.x,V=Y.offsetX),G.sb()&&(E=G.y,z=G.offsetY)}else R=z.x,E=z.y,V=z.offsetX,z=z.offsetY;(isNaN(R)||isNaN(E))&&(E=R=.5,z=V=0),Y=P.width,G=P.height;var X=N.margin,U=X.left+X.right,q=X.top+X.bottom,K=Ws(N,x,w,!1);!isNaN(N.desiredSize.width)||K!==cs&&K!==ps||(Y=Math.max(L-U,0)),!isNaN(N.desiredSize.height)||K!==cs&&K!==gs||(G=Math.max(A-q,0)),L=N.maxSize,A=N.minSize,Y=Math.min(L.width,Y),G=Math.min(L.height,G),Y=Math.max(A.width,Y),L=(G=Math.max(A.height,G))+q,C+=j*R-(Y+U)*R+V+X.left,T+=F*E-L*E+z+X.top,N.visible&&(Xt(D,B,O,I,C,T,P.width,P.height)?N.arrange(C,T,Y,G):N.arrange(C,T,Y,G,new Bt(D,B,O,I)))}}for(At.free(y),t=0;t=(e=t.Df()*e.scale)&&(e=1);var n=t.gridCellSize,o=n.width;n=n.height;var r=t.naturalBounds,s=t.actualBounds,a=r.width,h=r.height,l=Math.ceil(a/o),u=Math.ceil(h/n),c=t.gridOrigin,f=c.x;c=c.y,i.save(),i.beginPath(),i.rect(0,0,a,h),i.clip(),i.Se();for(var d=[],p=t.O.s,g=p.length,m=0;mx)){y=Fh(y.figure);for(var b=0;bx&&v.push(w))}}}}for(g=(p=t.O.s).length,m=0;mo*(y=Math.abs(v))*e))){if(x=k.segmentIndex,isFinite(x)&&!isNaN(x)||(x=0),0>x&&(x=y-Math.min(-x,y)),x=Math.round(x%y),b=1,1!==(y=k.opacity)){if(0===y)continue;b=i.globalAlpha,i.globalAlpha=b*y}w=d[m];var M=!1,S=k.strokeDashArray;if(null!==S&&(M=!0,i.js(S,k.strokeDashOffset)),"LineV"===k.figure&&null!==k.stroke&&0c)v.measure(1/0,1/0,0,0),x=v.measuredBounds,e.ed(x),d.push(x);else{var b=v.segmentIndex,w=v.segmentFraction,k=v.alignmentFocus;k.Mc()&&(k=oi);var M=v.segmentOrientation,S=v.segmentOffset;if(isNaN(b)){var N=h.ua;x=A(),N.Qu(w,x);var P=pt.allocAt(x[0],x[1]);if(P.add(h.i(0)),N.type===Ui.j?P.offset(-N.startX,-N.startY):null!==(N=N.figures.first())&&P.offset(-N.startX,-N.startY),N=x[2],M!==Wc){var C=h.computeAngle(v,M,N);v.Kb=C}C=P.x-i.x;var T=P.y-i.y;pt.free(P),j(x)}else if(b<-c||b>=c)x=pt.alloc(),h.vg(),h.computeMidPoint(x),N=h.midAngle,M!==Wc&&(C=h.computeAngle(v,M,N),v.Kb=C),C=x.x-i.x,T=x.y-i.y,pt.free(x);else{if(C=0,0<=b?(T=u.M(b),x=bL+10?0<=b?N.ab(T):T.ab(N):L>P+10?0<=b?x.ab(C):C.ab(x):0<=b?N.ab(C):C.ab(N)}else N=0<=b?T.ab(x):x.ab(T);M!==Wc&&(C=h.computeAngle(v,M,N),v.Kb=C),C=T.x+(x.x-T.x)*w-i.x,T=T.y+(x.y-T.y)*w-i.y}v.measure(1/0,1/0,0,0),x=v.measuredBounds,P=v.naturalBounds;var F=0;v instanceof pl&&(F=v.strokeWidth),L=P.width+F;var D=P.height+F;p.reset(),p.translate(-x.x,-x.y),p.scale(v.scale,v.scale),p.rotate(M===Wc?v.angle:N,L/2,D/2),M!==nf&&M!==af||p.rotate(90,L/2,D/2),M!==of&&M!==hf||p.rotate(-90,L/2,D/2),M===lf&&(45N||225N)&&p.rotate(-N,L/2,D/2),P=new Bt(0,0,L,D),g.xi(P,k),p.Ga(g),k=-g.x+F/2*v.scale,v=-g.y+F/2*v.scale,m.assign(S),F=isNaN(S.x);var B=isNaN(S.y);if(F||B){L=L/2+3,D=D/2+3;var O=45<=N&&135>=N,I=225<=N&&315>=N;M===Wc&&(O||I)?(m.x=B?L:S.y,m.y=F?D:S.x,O?0<=b||isNaN(b)&&.5>w||!F||(m.y=-D):I&&((0<=b||isNaN(b)&&.5>w)&&F&&(m.y=-D),B&&(m.x=-L))):(F&&(m.x=0<=b||isNaN(b)&&.5>w?L:-L),B&&(m.y=-D),m.rotate(N))}else m.rotate(N);C+=m.x,T+=m.y,P.set(x),P.h(C+k,T+v,x.width,x.height),d.push(P),e.ed(P)}}if(null!==s)for(n=s.labelNodes;n.next();)n.value.measure(1/0,1/0);t.jg=e,t.position.h(i.x+e.x,i.y+e.y),Ot(o,e.width||0,e.height||0),Yi.free(p),pt.free(g),pt.free(m)}}}},Sh.prototype.arrange=function(t,i){var e=i.length;if(t instanceof Hu||t instanceof wc){var n=t,o=null;t instanceof Hu&&(n=(o=t).adornedPart);var r=t instanceof Hu?null:n.path,s=t.j;if(0!==s.length){var a=0;if(null!==r&&a=e)m=p=pt.alloc(),(d=c).vg(),d.computeMidPoint(m),d=c.midAngle,l!==Wc&&(c=c.computeAngle(s,l,d),s.angle=c),c=p.x,m=p.y,pt.free(p);else{if(g=0,0<=a?(p=i.s[a],m=av+10?0<=a?d.ab(p):p.ab(d):v>y+10?0<=a?m.ab(g):g.ab(m):0<=a?d.ab(g):g.ab(d)}else d=0<=a?p.ab(m):m.ab(p);l!==Wc&&(c=c.computeAngle(s,l,d),s.angle=c),c=p.x+(m.x-p.x)*h,m=p.y+(m.y-p.y)*h}if(f.ys())s.location=new pt(c,m);else{f.Mc()&&(f=oi),(p=Yi.alloc()).reset(),p.scale(s.scale,s.scale),p.rotate(s.angle,0,0);var x=s.naturalBounds;g=Bt.allocAt(0,0,x.width,x.height),(y=pt.alloc()).xi(g,f),p.Ga(y),f=-y.x,v=-y.y;var b=x.width,w=x.height;(x=pt.alloc()).assign(u);var k=isNaN(u.x),M=isNaN(u.y);if(k||M){b=b/2+3,w=w/2+3;var S=45<=d&&135>=d,N=225<=d&&315>=d;l===Wc&&(S||N)?(x.x=M?b:u.y,x.y=k?w:u.x,S?0<=a||isNaN(a)&&.5>h||!k||(x.y=-w):N&&((0<=a||isNaN(a)&&.5>h)&&k&&(x.y=-w),M&&(x.x=-b))):(k&&(x.x=0<=a||isNaN(a)&&.5>h?b:-b),M&&(x.y=-w),x.rotate(d))}else x.rotate(d);c+=x.x,m+=x.y,p.pp(g),f+=g.x,v+=g.y,a=pt.allocAt(c+f,m+v),s.move(a),pt.free(a),pt.free(x),pt.free(y),Bt.free(g),Yi.free(p)}}null!==o?o.Ul(!1):n.Ul(!1),n=Tu(t),t.location.h(t.position.x+n.x,t.position.y+n.y),pt.free(n)}},c(Ph,ch),Ph.prototype.measure=function(t,i,e,n,o,r,s){var a=t.Pb();t.graduatedBounds=[];var h=a.margin,l=h.right+h.left,u=h.top+h.bottom;a.measure(i,e,r,s);var c=a.measuredBounds,f=new Bt(-h.left,-h.top,Math.max(c.width+l,0),Math.max(c.height+u,0));t.graduatedBounds.push(f),o.assign(f);for(var d=a.geometry,p=a.strokeWidth,g=d.flattenedSegments,m=d.flattenedLengths,y=d.flattenedTotalLength,v=g.length,x=0,b=0,w=A(),k=0;kL&&(L+=360),S.push(L)}x=C,b=T}w.push(S)}if(null===t.graduatedIntervals){for(var F=[],D=t.O.s,B=D.length,O=0;OR))for(var E=0;ER&&z.push(Y)}}}}t.graduatedIntervals=F}var G=t.graduatedIntervals,X=t.O.s,U=X.length,q=0,K=0,H=y;t.graduatedMarks=[];for(var W,J=0;J$*_*y/t.graduatedRange&&null===Z.graduatedSkip)){var Q=m[0][0],tt=0,it=0;K=y*Z.graduatedStart-1e-4,H=y*Z.graduatedEnd+1e-4;var et=$*_,nt=t.graduatedTickBase;if(ntt.graduatedMin+et&&(nt-=Math.floor((nt-t.graduatedMin)/et)*et);for(var rt=G[J],st=nt,at=1e-6*t.graduatedMax,ht=1;nt<=t.graduatedMax+at;ht++){t:{for(var lt=rt.length,ut=0;ut-ft){var dt=!1;break t}}dt=!0}if(dt&&(nt>t.graduatedMax&&(nt=t.graduatedMax),null===Z.graduatedSkip||Z instanceof Pl&&!Z.graduatedSkip(nt,Z)||Z instanceof pl&&!Z.graduatedSkip(nt,Z))&&((q=(nt-t.graduatedMin)*y/t.graduatedRange)>y&&(q=y),K<=q&&q<=H)){for(var gt=w[tt][it],mt=m[tt][it];ttQ&&itbt&&.4995bt?0bt||.9995Nt){var Pt=1-Math.abs(.5-bt);gt=(kt*Pt+St*(1-Pt))%360;break t}}}gt=kt}if(Z instanceof Pl){var Ct="";null!==Z.graduatedFunction?Ct=null!=(Ct=Z.graduatedFunction(nt,Z))?Ct.toString():"":Ct=(+nt.toFixed(2)).toString(),""!==Ct&&W.push({$l:wt,angle:gt,text:Ct})}else W.push({$l:wt,angle:gt})}nt=st+ht*et}}}t.graduatedMarks.push(W)}j(w);var Tt=t.graduatedMarks;if(null!==Tt)for(var Lt=n.length,At=0;AtQt;Qt++){switch(Qt){case 0:Xt.h(Ut,qt);break;case 1:Xt.h(Ut+Et,qt);break;case 2:Xt.h(Ut,qt+Vt);break;case 3:Xt.h(Ut+Et,qt+Vt)}Xt.rotate($t+jt.angle),Xt.offset(Zt,_t),0===Wt&&0===Qt?Kt.h(Xt.x,Xt.y,0,0):Kt.Ye(Xt),Xt.offset(-Zt,-_t),Xt.rotate(-$t-jt.angle)}pt.free(Xt),null!==Dt.graduatedBounds&&Dt.graduatedBounds.push(Kt),Gt(Ot,Kt.x,Kt.y,Kt.width,Kt.height)}else if(jt instanceof Pl){var ti=t,ei=o;null===ti.temporaryTextBlock&&(ti.temporaryTextBlock=new Pl);var ni=ti.temporaryTextBlock;Tl(ni,jt);var oi=jt.alignmentFocus;oi.Mc()&&(oi=ii);for(var ri=jt.segmentOrientation,si=jt.segmentOffset,ai=new Bt,hi=0,li=0,ui=0,ci=0,fi=0,di=Ft.length,pi=0;piui||225ui)&&bi.rotate(-ui,vi/2,xi/2);var wi=Bt.allocAt(0,0,vi,xi),ki=pt.alloc();ki.xi(wi,oi),bi.Ga(ki);var Mi=-ki.x,Si=-ki.y,Ni=pt.alloc();Ni.assign(si),isNaN(Ni.x)&&(Ni.x=vi/2+3),isNaN(Ni.y)&&(Ni.y=-(xi/2+3)),Ni.rotate(ui);var Pi=new Bt(hi+=Ni.x+Mi,li+=Ni.y+Si,mi.width,mi.height),Ci=new Bt(mi.x,mi.y,mi.width,mi.height),Ti=new Bt(yi.x,yi.y,yi.width,yi.height);gi.Sz=ci,gi.lineCount=ni.lineCount,gi.lines=[ni.Cb,ni.Ih,ni.df,ni.Le,ni.Qc,ni.Qb,ni.ze],gi.actualBounds=Pi,gi.measuredBounds=Ci,gi.naturalBounds=Ti,0===pi?ai.assign(Pi):ai.ed(Pi),pt.free(Ni),pt.free(ki),Bt.free(wi),Yi.free(bi)}null!==ti.graduatedBounds&&ti.graduatedBounds.push(ai),Gt(ei,ai.x,ai.y,ai.width,ai.height)}ea(jt,!1)}}},Ph.prototype.arrange=function(t,i,e){if(null!==t.graduatedBounds){var n=t.Pb(),o=t.graduatedMarks;if(null!==o){var r=t.graduatedBounds,s=0,a=r[s];s++,null!==n&&n.arrange(a.x-e.x,a.y-e.y,a.width,a.height);for(var h=i.length,l=0;l=(s=t.Df()*e.scale)&&(s=1);for(var a=r.actualBounds,h=t.O.s,l=t.graduatedMarks,u=h.length,c=0;ct.graduatedTickUnit*f.interval*r.geometry.flattenedTotalLength/t.graduatedRange*s&&null===f.graduatedSkip)){var g=f.measuredBounds,m=f.strokeWidth*f.scale,y=f.alignmentFocus;y.Mc()&&(y=ii);for(var v=0;vn&&o.set(p),pt.free(p)),pt.free(u),r&&o.transform(s),l},i.Gj=function(){for(var t=this.O.s,i=t.length,e=0;ee||r>n)&&(this.v(),this.measure(i>e?e:i,r>n?n:r,0,0));break;case cs:this.v(!0),this.measure(e+a,n+s,0,0);break;case ps:this.v(!0),this.measure(e+a,r+s,0,0);break;case gs:this.v(!0),this.measure(i+a,n+s,0,0)}}this.na.arrange(this,o,this.jg)}},i.gh=function(t){var i=this.naturalBounds,e=Dh(this);if(Xt(0,0,i.width,i.height,t.x,t.y)){for(var n=(i=this.O.s).length,o=pt.allocAt(0,0);n--;){var r=i[n];if((r.visible||r===e)&&(vt(o.set(t),r.transform),r.ca(o)))return pt.free(o),!0}return pt.free(o),null!==this.Ma||null!==this.areaBackground}return!1},i.ks=function(t){if(this.bindingId===t)return this;for(var i=this.O.s,e=i.length,n=0;nf.width||c.y>f.height||0>c.x+c.width||0>c.y+c.height||(c=u,u=u instanceof Ch?u:null,(f=Yi.alloc()).set(s),(null!==u?u.Cf(t,i,e,n,o,f):Is(c,t,n,f))&&(null!==i&&(c=i(c)),null===c||null!==e&&!e(c)||o.add(c)),Yi.free(f))}}return void 0===r&&Yi.free(s),n}return void 0===r&&Yi.free(s),!1},i.og=function(t,i,e,n,o,r){if(!1===this.pickable)return!1;void 0===e&&(e=null),void 0===n&&(n=null);var s=this.naturalBounds,a=this.se(),h=a?t:vt(pt.allocAt(t.x,t.y),this.transform),l=a?i:vt(pt.allocAt(i.x,i.y),this.transform),u=h.Bf(l),c=0m.width||g.y>m.height||0>g.x+g.width||0>g.y+g.height)||(p.se()?(g=p.transform,vt(h.set(t),g),vt(l.set(i),g)):(h.set(t),l.set(i)),g=p,(null!==(p=p instanceof Ch?p:null)?p.og(h,l,e,n,o,r):g.tx(h,l,o))&&(null!==e&&(g=e(g)),null===g||null!==n&&!n(g)||r.add(g)))}}pt.free(h),pt.free(l)}return o?c:s}return!1},i.add=function(t){for(var i=[],e=0;e=o.count&&t>=o.count)return;o.mb(r),n=r}else w("element "+i.toString()+" has panel "+e.toString()+" but is not contained by it.")}(0>t||t>o.count)&&(t=o.count),o.Gb(t,i),(0===t||i.isPanelMain)&&(this.$g=null),ia(this)||this.v(),i.v(!1),(null!==i.portId||i instanceof Ch&&!0===i.Te)&&(this.Te=!0),this.graduatedIntervals=null,this.If()||il(this,i,!1),null!==(e=this.part)&&(e.Rh=null,e.ag=NaN,this.Te&&e instanceof Ju&&(e.Te=!0),e.Te&&e instanceof Ju&&(e.wc=null),null!==(o=this.diagram)&&o.undoManager.isUndoingRedoing||(-1!==n&&e.cb(pe,"elements",this,i,null,n,null),e.cb(de,"elements",this,null,i,null,t)))},i.remove=function(t){for(var i=this.O.s,e=i.length,n=-1,o=0;ot&&M(t,">= 0",Ch,"getRowDefinition:idx"),t=Math.round(t);var i=this.rowDefs;if(void 0===i[t]){var e=new hl;e.wi(this),e.isRow=!0,e.index=t,i[t]=e,this.cb(de,"rowdefs",this,null,e,null,t)}return i[t]},i.oA=function(t){if(0>t&&M(t,">= 0",Ch,"removeRowDefinition:idx"),0!==this.rowCount){t=Math.round(t);var i=this.rowDefs,e=i[t];if(e){i[t]=void 0;for(var n=i.length-1;0<=n&&void 0===i[n--];)i.length--;this.cb(pe,"rowdefs",this,e,null,t,null),this.v()}}},i.Eb=function(t){0>t&&M(t,">= 0",Ch,"getColumnDefinition:idx"),t=Math.round(t);var i=this.colDefs;if(void 0===i[t]){var e=new hl;e.wi(this),e.isRow=!1,e.index=t,i[t]=e,this.cb(de,"coldefs",this,null,e,null,t)}return i[t]},i.jA=function(t){if(0>t&&M(t,">= 0",Ch,"removeColumnDefinition:idx"),0!==this.columnCount){t=Math.round(t);var i=this.colDefs,e=i[t];if(e){i[t]=void 0;for(var n=i.length-1;0<=n&&void 0===i[n--];)i.length--;this.cb(pe,"coldefs",this,e,null,t,null),this.v()}}},i.Gy=function(t){var i=null;return t.isRow?i=this.Fb(t.index):t.isRow||(i=this.Eb(t.index)),i&&ll(i,t),this},i.Hy=function(t,i){return(t=this.Fb(t))&&ll(t,new hl(i)),this},i.By=function(t,i){return(t=this.Eb(t))&&ll(t,new hl(i)),this},i.nz=function(t){if(0>t||this.type!==Ch.Table||0===this.rowCount)return-1;for(var i=0,e=this.rowDefs,n=e.length,o=this.topIndex;ot||this.type!==Ch.Table||0===this.columnCount)return-1;for(var i=0,e=this.colDefs,n=e.length,o=this.leftIndex;ot;)this.pc(this.O.length-1,!1);Zh(this,this.itemArray)},f.Object.defineProperties(Ch.prototype,{type:{get:function(){return this.na},set:function(t){var i=this.na;i!==t&&(this.na=t,this.isAtomic=this.na===Ch.Grid,this.v(),this.g("type",i,t))}},elements:{get:function(){return this.O.iterator}},naturalBounds:{get:function(){return this.dc}},padding:{get:function(){return this.yb},set:function(t){"number"==typeof t?(0>t&&M(t,">= 0",Ch,"padding"),t=new Wt(t)):(0>t.left&&M(t.left,">= 0",Ch,"padding:value.left"),0>t.right&&M(t.right,">= 0",Ch,"padding:value.right"),0>t.top&&M(t.top,">= 0",Ch,"padding:value.top"),0>t.bottom&&M(t.bottom,">= 0",Ch,"padding:value.bottom"));var i=this.yb;i.D(t)||(this.yb=t=t.J(),this.v(),this.g("padding",i,t))}},defaultAlignment:{get:function(){return this.Tm},set:function(t){var i=this.Tm;i.D(t)||(this.Tm=t=t.J(),this.v(),this.g("defaultAlignment",i,t))}},defaultStretch:{get:function(){return this.Uf},set:function(t){var i=this.Uf;i!==t&&(this.Uf=t,this.v(),this.g("defaultStretch",i,t))}},defaultSeparatorPadding:{get:function(){return null!==this.T?this.T.Qp:_t},set:function(t){"number"==typeof t&&(t=new Wt(t));var i=this.defaultSeparatorPadding;i.D(t)||(t=t.J(),null===this.T&&(this.T=new al),this.T.Qp=t,this.v(),this.g("defaultSeparatorPadding",i,t))}},defaultRowSeparatorStroke:{get:function(){return null!==this.T?this.T.ia:null},set:function(t){var i=this.defaultRowSeparatorStroke;i!==t&&(null===t||"string"==typeof t||t instanceof Ia)&&(t instanceof Ia&&t.freeze(),null===this.T&&(this.T=new al),this.T.ia=t,this.N(),this.g("defaultRowSeparatorStroke",i,t))}},defaultRowSeparatorStrokeWidth:{get:function(){return null!==this.T?this.T.Ha:1},set:function(t){var i=this.defaultRowSeparatorStrokeWidth;i!==t&&isFinite(t)&&0<=t&&(null===this.T&&(this.T=new al),this.T.Ha=t,this.v(),this.g("defaultRowSeparatorStrokeWidth",i,t))}},defaultRowSeparatorDashArray:{get:function(){return null!==this.T?this.T.V:null},set:function(t){var i=this.defaultRowSeparatorDashArray;if(i!==t){if(null!==t){for(var e=t.length,n=0,o=0;ot)&&w("Panel.topIndex must be greater than zero and a real number, not: "+t),null===this.T&&(this.T=new al),this.T.Hb=t,this.v(),this.g("topIndex",i,t))}},leftIndex:{get:function(){return null!==this.T?this.T.hb:0},set:function(t){var i=this.leftIndex;i!==t&&((!isFinite(t)||0>t)&&w("Panel.leftIndex must be greater than zero and a real number, not: "+t),null===this.T&&(this.T=new al),this.T.hb=t,this.v(),this.g("leftIndex",i,t))}},data:{get:function(){return this.ub},set:function(t){var i=this.ub;if(i!==t){var e=this instanceof ku&&!(this instanceof Hu);Wh(this),this.ub=t;var n=this.diagram;null!==n&&(e?(e=n.partManager,this instanceof wc?(null!==i&&e.bf.remove(i),null!==t&&e.bf.add(t,this)):this instanceof ku&&(null!==i&&e.cf.remove(i),null!==t&&e.cf.add(t,this))):null!==(e=this.panel)&&null!==e.ge&&(null!==i&&e.ge.remove(i),null!==t&&e.ge.add(t,this))),this.g("data",i,t),null!==n&&n.undoManager.isUndoingRedoing||null!==t&&this.La()}}},itemIndex:{get:function(){return this.zn},set:function(t){var i=this.zn;i!==t&&(this.zn=t,this.g("itemIndex",i,t))}},allBindings:{get:function(){return null!==this.A?this.A.nb:null},set:function(t){this.localBindings!==t&&(null===this.A&&(this.A=new fa),this.A.nb=t)}},itemArray:{get:function(){return this.Hh},set:function(t){var i=this.Hh;if(i!==t||null!==t&&function(t,i){for(var e=(t=t.O.s).length,n=i.length,o=0,r=null;ot&&M(t,">= 0",hl,"height"),this.Hc=t,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Ob("height",i,t))}},width:{get:function(){return this.Hc},set:function(t){var i=this.Hc;i!==t&&(0>t&&M(t,">= 0",hl,"width"),this.Hc=t,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Ob("width",i,t))}},minimum:{get:function(){return this.jj},set:function(t){var i=this.jj;i!==t&&((0>t||!isFinite(t))&&M(t,">= 0",hl,"minimum"),this.jj=t,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Ob("minimum",i,t))}},maximum:{get:function(){return this.hj},set:function(t){var i=this.hj;i!==t&&(0>t&&M(t,">= 0",hl,"maximum"),this.hj=t,this.actual=this.oa,null!==this.panel&&this.panel.v(),this.Ob("maximum",i,t))}},alignment:{get:function(){return this.Jb},set:function(t){var i=this.Jb;i.D(t)||(this.Jb=t.J(),null!==this.panel&&this.panel.v(),this.Ob("alignment",i,t))}},stretch:{get:function(){return this.hg},set:function(t){var i=this.hg;i!==t&&(this.hg=t,null!==this.panel&&this.panel.v(),this.Ob("stretch",i,t))}},separatorPadding:{get:function(){return this.dg},set:function(t){"number"==typeof t&&(t=new Wt(t));var i=this.dg;null!==t&&null!==i&&i.D(t)||(null!==t&&(t=t.J()),this.dg=t,null!==this.panel&&this.panel.v(),this.Ob("separatorPadding",i,t))}},separatorStroke:{get:function(){return this.lo},set:function(t){var i=this.lo;i!==t&&(null!==t&&Wa(t,"RowColumnDefinition.separatorStroke"),t instanceof Ia&&t.freeze(),this.lo=t,null!==this.panel&&this.panel.v(),this.Ob("separatorStroke",i,t))}},separatorStrokeWidth:{get:function(){return this.mo},set:function(t){var i=this.mo;i!==t&&(this.mo=t,null!==this.panel&&this.panel.v(),this.Ob("separatorStrokeWidth",i,t))}},separatorDashArray:{get:function(){return this.tj},set:function(t){var i=this.tj;if(i!==t){if(null!==t){for(var e=t.length,n=0,o=0;oo)){var r=n.measuredBounds,s=Math.max(1,r.width);r=r.height;for(var a,h,l,u,c,f,d=e[0],p=e[1],g=0,m=A(),y=2;yl&&(l=1),o=e=l,h=0!==(a=s/2),l=(f=m[y=0])[0],c=f[1],u=f[2],f=f[3];for(var v=0;.1<=g;){if(0===v&&(h?(o=e,o-=a,g-=a,h=!1):o=e,0===o&&(o=1)),o>g)return void j(m);o>f?(v=o-f,o=f):v=0;var x=Math.sqrt(o*o/(1+u*u));if(0>l&&(x=-x),d+=x,p+=u*x,t.translate(d,p),t.rotate(c),t.translate(-s/2,-r/2),0===v&&n.hh(t,i),t.translate(s/2,r/2),t.rotate(-c),t.translate(-d,-p),g-=o,f-=o,0!==v){if(++y===m.length)return void j(m);l=(f=m[y])[0],c=f[1],u=f[2],f=f[3],o=v}}j(m)}}function yl(t){var i=t.geometryStretch;return null!==t.Rd?i===ms?cs:i:i===ms?Sl[t.figure].defaultStretch:i}function vl(t,i,e,n,o){return(i=(t=e.x-t)*t+(i=e.y-i)*i)e?t-e:e-t)<(i>n?i-n:n-i)?(t=it||Xi.$(h.y,t))&&(h.yi||Xi.$(h.x,i))&&(h.x=t&&n<=i):(t=n&&e<=t)}function wl(t){var i=t.diagram;null!==i&&i.undoManager.isUndoingRedoing||(t.segmentOrientation=ef,"None"!==t.toArrow?(t.segmentIndex=-1,t.alignmentFocus=ji):"None"!==t.fromArrow&&(t.segmentIndex=0,t.alignmentFocus=new Ii(1-ji.x,ji.y)))}function kl(t){var i=Ml[t];if(void 0===i){var e=t.toLowerCase();if("none"===e)return"None";if(void 0===(i=Ml[e])){var n,o=null;for(n in Xi.um)if(n.toLowerCase()===e){o=n;break}if(null!==o)return t=Ui.parse(Xi.um[o],!1),Ml[o]=t,e!==o&&(Ml[e]=o),o}}return"string"==typeof i?i:i instanceof Ui?t:null}hl.className="RowColumnDefinition",hl.Default=cl,hl.None=fl,hl.ProportionalExtra=dl,c(pl,Ds),pl.prototype.cloneProtected=function(t){Ds.prototype.cloneProtected.call(this,t),t.ua=this.ua,t.Rd=this.Rd,t.an=this.an,t.Ui=this.Ui,t.xc=this.xc,t.ig=this.ig,null!==this.Yg&&(t.Yg=C(this.Yg)),null!==this.Na&&(t.Na=this.Na.nc?this.Na:this.Na.copy()),t.Un=this.Un,t.Vn=this.Vn,null!==this.fa&&(t.fa=this.fa.copy())},(i=pl.prototype).th=function(){Ds.prototype.th.call(this),null!==this.Na&&(this.Na.nc=!0)},i.qb=function(t){t===fs||t===ds||t===ys||t===ms?this.geometryStretch=t:Ds.prototype.qb.call(this,t)},i.toString=function(){return"Shape("+("None"!==this.figure?this.figure:"None"!==this.toArrow?this.toArrow:this.fromArrow)+")#"+it(this)},i.hh=function(t,i){var e=this.xc,n=this.Ui;if(null!==e||null!==n){var o=this.ua;if(null!==o){t.yc();var r=this.actualBounds,s=this.naturalBounds;null!==n&&Us(this,t,n,!0,!1,s,r);var a=this.part,h=this.ig;if(null===e||0!==h||null===a||!this.isPanelMain&&a.Pb()!==this||(h=a.type===Ch.Link&&a instanceof Hu&&"Selection"===a.category&&a.adornedObject instanceof pl&&a.adornedPart.Pb()===a.adornedObject?a.adornedObject.strokeWidth:0),0===h&&(e=null),null!==e&&0!==h&&(Us(this,t,e,!1,!1,s,r),t.lineWidth=h,t.lineJoin=this.strokeJoin,t.lineCap=this.strokeCap,t.miterLimit=this.strokeMiterLimit),r=!1,a&&i.Gf("drawShadows")&&(r=a.isShadowed),!1===t.Il&&(r=!1),a=!0,null===e||null!==n&&"transparent"!==n||(a=!1),s=!1,null!==(h=this.strokeDashArray)&&(s=!0,t.js(h,this.strokeDashOffset)),o.type===Ui.j)t.beginPath(),t.moveTo(o.startX,o.startY),t.lineTo(o.endX,o.endY),null!==e&&t.jk(),t.Se();else if(o.type===Ui.u){var l=o.startX;h=o.startY;var u=o.endX,c=o.endY;o=Math.min(l,u);var f=Math.min(h,c);l=Math.abs(u-l),h=Math.abs(c-h),t.beginPath(),t.rect(o,f,l,h),null!==n&&t.ng(n),null!==e&&(a&&r&&La(t),t.jk(),a&&r&&Aa(t)),t.Se()}else if(o.type===Ui.F)l=o.startX,h=o.startY,u=o.endX,c=o.endY,o=Math.abs(u-l)/2,f=Math.abs(c-h)/2,l=Math.min(l,u)+o,h=Math.min(h,c)+f,t.beginPath(),t.moveTo(l,h-f),t.bezierCurveTo(l+Xi.wg*o,h-f,l+o,h-Xi.wg*f,l+o,h),t.bezierCurveTo(l+o,h+Xi.wg*f,l+Xi.wg*o,h+f,l,h+f),t.bezierCurveTo(l-Xi.wg*o,h+f,l-o,h+Xi.wg*f,l-o,h),t.bezierCurveTo(l-o,h-Xi.wg*f,l-Xi.wg*o,h-f,l,h-f),t.closePath(),null!==n&&t.ng(n),null!==e&&(a&&r&&La(t),t.jk(),a&&r&&Aa(t)),t.Se();else if(o.type===Ui.o)for(h=(o=o.figures).length,f=0;fg.sweepAngle,null!==d?d.endX:l.startX,null!==d?d.endY:l.startY)}else if(0===(m=(d=te(g,l)).length))t.lineTo(g.centerX,g.centerY);else for(var y=0;y(e.startX-e.endX)*(t.x-e.endX)+(e.startY-e.endY)*(t.y-e.endY)||0>n)&&(Bt.free(r),Xi.Yb(e.startX,e.startY,e.endX,e.endY,o,t.x,t.y)));if(e.type===Ui.u){i=e.startX;var s=e.startY,a=e.endX;if(e=e.endY,r.x=Math.min(i,a),r.y=Math.min(s,e),r.width=Math.abs(a-i),r.height=Math.abs(e-s),null===this.fill){if(r.Bc(-n,-n),r.ca(t))return Bt.free(r),!1;r.Bc(n,n)}return null!==this.stroke&&r.Bc(o,o),t=r.ca(t),Bt.free(r),t}if(e.type===Ui.F){s=e.startX,o=e.startY,a=e.endX;var h=e.endY;if(e=Math.min(s,a),i=Math.min(o,h),s=Math.abs(a-s)/2,o=Math.abs(h-o)/2,e=t.x-(e+s),i=t.y-(i+o),null===this.fill){if(o-=n,0>=(s-=n)||0>=o||1>=e*e/(s*s)+i*i/(o*o))return Bt.free(r),!1;s+=n,o+=n}return null!==this.stroke&&(s+=n,o+=n),Bt.free(r),!(0>=s||0>=o)&&1>=e*e/(s*s)+i*i/(o*o)}if(e.type===Ui.o)return Bt.free(r),null===this.fill?Ji(e,t.x,t.y,o):Hi(e,t,o,1=this.strokeWidth)u=Xi.Ve(l.startX,l.startY,l.endX,l.endY,r,s,a,h,o);else{if(l.startX===l.endX?(n=c,u=0):(i=(l.endY-l.startY)/(l.endX-l.startX),n=(u=c/Math.sqrt(1+i*i))*i),i=A(),t=new pt,Xi.Ve(l.startX+n,l.startY+u,l.endX+n,l.endY+u,r,s,a,h,t)&&i.push(t),t=new pt,Xi.Ve(l.startX-n,l.startY-u,l.endX-n,l.endY-u,r,s,a,h,t)&&i.push(t),t=new pt,Xi.Ve(l.startX+n,l.startY+u,l.startX-n,l.startY-u,r,s,a,h,t)&&i.push(t),t=new pt,Xi.Ve(l.endX+n,l.endY+u,l.endX-n,l.endY-u,r,s,a,h,t)&&i.push(t),0===(a=i.length))return j(i),!1;for(u=!0,h=1/0,n=0;nMath.abs(e)){if(0>t*t*e*e+l*l-(h=s-u-e*(r-n))*h){o.x=NaN,o.y=NaN,u=!1;break t}a=(-t*t*e*h+t*l*(c=Math.sqrt(t*t*e*e+l*l-h*h)))/(l*l+t*t*e*e)+n,t=(-t*t*e*h-t*l*c)/(l*l+t*t*e*e)+n,l=e*(a-n)+h+u,h=e*(t-n)+h+u,Math.abs((r-a)*(r-a))+Math.abs((s-l)*(s-l))(a-=a/(t*t)*(h=r-n)*h)){o.x=NaN,o.y=NaN,u=!1;break t}a=u+(h=Math.sqrt(a)),h=u-h,Math.abs(a-s)Math.abs(p)?(g*=.5/p,p=.5):0!==g&&.5>Math.abs(g)&&(p*=.5/g,g=.5),y-=p,v-=g;d.contains(y,v);)y-=p,v-=g;for(o.x=a,o.y=h,g=0;go)return!0;return!1}if(e&&null!==this.fill&&this.gh(t,!0))return!0;var o=t.Bf(i),r=o;if(1.5=o||bt(i,r,0,-c)>=o||bt(i,r,0,c)>=o||bt(i,r,u,0)>=o);if((t=Xi.$y(u,c,i,r))*t<=o)return!0}else if(i.type===Ui.o){if(r=(l=i.bounds).x,a=l.y,h=l.x+l.width,l=l.y+l.height,t.x>h&&t.xl&&t.yo&&xt(t.x,t.y,r,a,h,a)>o&&xt(t.x,t.y,h,l,r,l)>o&&xt(t.x,t.y,h,l,h,a)>o)return!1;if(r=Math.sqrt(o),!e){for(e=i.figures,i=0;io)return!1;for(h=(a=r.segments.s).length,l=0;lo)return!1;break;case oe:var f=A();if(Xi.Qe(s,u,c.point1X,c.point1Y,c.point2X,c.point2Y,c.endX,c.endY,.8,f),s=n(f,t),j(f),s)return!1;if(s=c.endX,u=c.endY,t.zd(s,u)>o)return!1;break;case re:if(f=A(),Xi.ep(s,u,c.point1X,c.point1Y,c.endX,c.endY,.8,f),s=n(f,t),j(f),s)return!1;if(s=c.endX,u=c.endY,t.zd(s,u)>o)return!1;break;case se:case ae:var d=(f=c.type===se?te(c,r):ie(c,r,s,u)).length;if(0===d){if(s=c.type===se?c.centerX:c.endX,u=c.type===se?c.centerY:c.endY,t.zd(s,u)>o)return!1;break}c=null;for(var p=A(),g=0;g= 0",pl,"strokeWidth:value")}},strokeCap:{get:function(){return null!==this.Na?this.Na.Hr:"butt"},set:function(t){var i=this.strokeCap;i!==t&&("string"!=typeof t||"butt"!==t&&"round"!==t&&"square"!==t?M(t,'"butt", "round", or "square"',pl,"strokeCap"):(gl(this),this.Na.Hr=t,this.N(),this.g("strokeCap",i,t)))}},strokeJoin:{get:function(){return null!==this.Na?this.Na.Ir:"miter"},set:function(t){var i=this.strokeJoin;i!==t&&("string"!=typeof t||"miter"!==t&&"bevel"!==t&&"round"!==t?M(t,'"miter", "bevel", or "round"',pl,"strokeJoin"):(gl(this),this.Na.Ir=t,this.N(),this.g("strokeJoin",i,t)))}},strokeMiterLimit:{get:function(){return null!==this.Na?this.Na.Jr:10},set:function(t){var i=this.strokeMiterLimit;if(i!==t&&1<=t){gl(this),this.Na.Jr=t,this.N();var e=this.part;null!==e&&(e.ag=NaN),this.g("strokeMiterLimit",i,t)}}},strokeDashArray:{get:function(){return this.Yg},set:function(t){var i=this.Yg;if(i!==t){if(null!==t){for(var e=t.length,n=0,o=0;ot?t=0:1t?t=0:1t.maxLines&&(t.l|=16777216))}function Al(t,i,e,n){var o=t.formatting===ql;o&&(i=i.trim());var r=0,s=t.Ae,a=t.spacingAbove+t.spacingBelow;a=Math.max(0,Dl(t)+a);var h=t.overflow===Ul?Bl(s):0;if(t.Gc>=t.maxLines)null!==n&&n.h(0,a);else if(s=i,t.wrap===El){t.Le=1;var l=Fl(i);if(0===h||l<=e)t.Cb=Math.max(t.Cb,l),Ll(t,i,t.Cb),null!==n&&n.h(l,a);else{for(l=Fl((r=jl(t,s))+(i=jl(t,s=s.substr(r.length))));0e&&1e;){var c=1;for(l=Fl(i.substr(0,c)),u=0;l<=e;)c++,u=l,l=Fl(i.substr(0,c));if(1===c){var f=l;r=Math.max(r,l)}else f=u,r=Math.max(r,u);if(1>--c&&(c=1),Ll(t,i.substr(0,c),f),h++,i=i.substr(c),t.Gc+h>t.maxLines)break}for(l=Fl(i+(u=jl(t,s)));0t.maxLines))break}t.Le=Math.min(t.maxLines,h),t.Cb=Math.max(t.Cb,r),null!==n&&n.h(t.Cb,a*t.Le)}}function jl(t,i){if(t.wrap===Gl)return i.substr(0,1);for(var e=i.length,n=0,o=Hl;n=i.length?i:i.substr(0,n)}function Fl(t){return null===tu?8*t.length:tu.measureText(t).width}function Dl(t){if(null!==t.df)return t.df;var i=t.Ae;if(null===tu){var e=16;return t.df=e}return void 0!==Wl[i]&&5e3>Jl?e=Wl[i]:(e=1.3*tu.measureText("M").width,Wl[i]=e,Jl++),t.df=e}function Bl(t){if(null===tu)return 6;if(void 0!==Zl[t]&&5e3>_l)var i=Zl[t];else i=tu.measureText($l).width,Zl[t]=i,_l++;return i}function Ol(t,i){var e=t.ec.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),n=t.spacingAbove+t.spacingBelow;if(n=Math.max(0,Dl(t)+n),0===e.length)return t.Cb=0,t.Gc=1,n;if(!t.isMultiline){var o=e.indexOf("\n",0);0<=o&&(e=e.substr(0,o))}o=0;for(var r,s=t.Gc=0,a=!1;!a;){if(-1===(r=e.indexOf("\n",s))&&(r=e.length,a=!0),s<=r){if(s=e.substr(s,r-s),t.wrap!==El){t.Le=0;var h=At.alloc();Al(t,s,i,h),o+=h.height,At.free(h),t.Gc+=t.Le}else Al(t,s,i,null),o+=n,t.Gc++;t.Gc===t.maxLines&&(a=!0)}s=r+1}return t.Lq=o}pl.className="Shape",pl.getFigureGenerators=function(){var t,i=new dt;for(t in Xi.Ze)t!==t.toLowerCase()&&i.add(t,Xi.Ze[t]);return i.freeze(),i},pl.defineFigureGenerator=function(t,i){var e=t.toLowerCase(),n=Xi.Ze;n[t]=i,n[e]=t},pl.getArrowheadGeometries=function(){var t=new dt;for(n in Xi.um)if(void 0===Ml[n]){var i=Ui.parse(Xi.um[n],!1);Ml[n]=i,(i=n.toLowerCase())!==n&&(Ml[i]=n)}for(var e in Ml)if(e!==e.toLowerCase()){var n=Ml[e];n instanceof Ui&&t.add(e,n)}return t.freeze(),t},pl.defineArrowheadGeometry=function(t,i){var e=null;e="string"==typeof i?Ui.parse(i,!1):i,"none"!==(i=t.toLowerCase())&&t!==i||w("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+t);var n=Ml;n[t]=e,n[i]=t},Nl.prototype.copy=function(){var t=new Nl;return t.Hr=this.Hr,t.Ir=this.Ir,t.Jr=this.Jr,t.uj=this.uj,t.br=this.br,t.jq=this.jq,t.fg=this.fg.J(),t.gg=this.gg.J(),t},c(Pl,Ds),Pl.prototype.cloneProtected=function(t){Ds.prototype.cloneProtected.call(this,t),t.ec=this.ec,t.xc=this.xc,t.Ae=this.Ae,t.Gc=this.Gc,t.Cb=this.Cb,t.Lq=this.Lq,t.Gm=this.Gm,null!==this.fa&&(t.fa=this.fa.copy()),null!==this.da&&(t.da=this.da.nc?this.da:this.da.copy()),t.Ih=this.Ih,t.df=this.df,t.Le=this.Le,t.Qc=this.Qc,t.Qb=this.Qb,t.ze=this.ze},(i=Pl.prototype).th=function(){Ds.prototype.th.call(this),null!==this.da&&(this.da.nc=!0)},i.qb=function(t){t.classType===Pl?this.wrap=t:Ds.prototype.qb.call(this,t)},i.toString=function(){return 22(c*c+u*u)*f*f&&(e=!0),i.ib!==t&&(e=!1),i.ib instanceof va&&(e=!1),!1===i.Gf("textGreeking")&&(e=!1),i=this.spacingAbove,c=this.spacingBelow,this.flip){case xs:t.translate(o,0),t.scale(-1,1);break;case vs:t.translate(0,r),t.scale(1,-1);break;case bs:t.translate(o,r),t.scale(-1,-1)}if(t.yc(),r>(f=(i+s+c)*(u=this.Gc))&&(n=(n=this.verticalAlignment).y*r-n.y*f+n.offsetY),1===u&&null!==this.ze)(c=this.Cb)>o&&(c=o),this.Oj(this.ze,t,0,n+i,o,s,c,e,a,h,l);else if(null!==this.Qc&&null!==this.Qb)for(f=0;fo&&(d=o),n+=i,this.Oj(this.Qb[f],t,0,n,o,s,d,e,a,h,l),n+=s+c}switch(this.flip){case xs:t.scale(-1,1),t.translate(-o,0);break;case vs:t.scale(1,-1),t.translate(0,-r);break;case bs:t.scale(-1,-1),t.translate(-o,-r)}}},i.Oj=function(t,i,e,n,o,r,s,a,h,l,u){var c=0;if(a)"left"===h?c=0:"right"===h?c=o-s:"center"===h&&(c=(o-s)/2),i.fillRect(e+c,n+.25*r,s,1);else{if("left"===h?c=0:"right"===h?c=o:"center"===h&&(c=o/2),o=null!==zl?zl(this,r):.75*r,i.fillText(t,e+c,n+o),0===(t=r/20|0)&&(t=1),"right"===h?c-=s:"center"===h&&(c-=s/2),l){h=e+c,l=n+(a=null!==Rl?Rl(this,r):.8*r),o=e+c+s,a=n+a;var f=t;i.beginPath(),i.lineWidth=f,i.moveTo(h,l),i.lineTo(o,a),i.stroke(),i.Se(),i instanceof va&&i.ad.classList.add("gojs-td")}u&&(u=n+r-r/2.2|0,0!=t%2&&(u+=.5),n=e+c,r=u,e=e+c+s,s=u,c=t,i.beginPath(),i.lineWidth=c,i.moveTo(n,r),i.lineTo(e,s),i.stroke(),i.Se(),i instanceof va&&i.ad.classList.add("gojs-td"))}},i.kk=function(t,i,e){if(!Ds.prototype.kk.call(this,t,i,e))return!1;if(Us(this,t,this.xc,!0,!1,this.naturalBounds,this.actualBounds),e){if(0===this.svg.getElementsByTagName("text").length)return!0;for(i=this.svg.getElementsByClassName("gojs-td"),e=0;e=this.Qb.length))){for(this.l|=16777216,l=this.Qb[h],i=Math.max(1,t-i);Fl(l)>i&&1t?t=0:1t?t=0:1=(t=Math.floor(t))&&M(t,"> 0",Pl,"maxLines"),Cl(this),this.da.Jq=t,this.v(),this.g("maxLines",i,t))}},metrics:{get:function(){return{arrSize:null!==this.Qc?this.Qc:[this.Cb],arrText:null!==this.Qb?this.Qb:[this.ze],maxLineWidth:this.Cb,fontHeight:this.df}}},choices:{get:function(){return this.Gm},set:function(t){var i=this.Gm;i!==t&&(this.Gm=t,this.g("choices",i,t))}}});var Il,zl=null,Rl=null,El=new V(Pl,"None",0),Vl=new V(Pl,"WrapFit",1),Yl=new V(Pl,"WrapDesiredSize",2),Gl=new V(Pl,"WrapBreakAll",3),Xl=new V(Pl,"OverflowClip",0),Ul=new V(Pl,"OverflowEllipsis",1),ql=new V(Pl,"FormatTrim",0),Kl=new V(Pl,"FormatNone",0),Hl=/[ \u200b\u00ad]/,Wl=new X,Jl=0,Zl=new X,_l=0,$l="...",Ql="",tu=null,iu=!1;function eu(){this.nc=!1,this.Hd=null,this.Xf=fs,this.gq=ql,this.Jq=1/0,this.$q=Xl,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=Ci,this.$r=Yl}function nu(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}function ou(t,i){Ds.call(this),this.Eg=null,this.qo="",this.Xg=Kt,this.Nk=cs,this.Zg=this.Hd=null,this.Mk=oi,this.Xf=fs,this.vl=null,this.qn=!1,this.en=!0,this.al=!1,this.bt=this.rl=null,"string"==typeof t?this.source=t:t&&Object.assign(this,t),i&&Object.assign(this,i)}function ru(t){void 0===t&&(t=""),""!==t?Il[t]&&(delete Il[t],au--):(Il=new X,au=0)}function su(t,i){i.qy||(i.Fq=function(e){i.sq=!0,i.ln=!1;var n=i.Bg.copy();if(null!=n){for(n=n.iterator;n.next();){var o=n.value;o.N();var r=i.getAttribute("src")||"",s=o.Og.I(r);if(null!==s)for(var a=s.length,h=0;h=n.width&&(r=r+p.offsetX+(c*p.x-n.width*p.x)),f>=n.height&&(s=s+p.offsetY+(f*p.y-n.height*p.y)),h=Math.min(n.width,c),a=Math.min(n.height,f);break;case cs:c=n.width,f=n.height;break;case ds:case ys:d===ds?(c*=d=Math.min(n.height/f,n.width/c),f*=d):d===ys&&(f*=d=Math.max(n.height/f,n.width/c),(c*=d)>=n.width&&(r=(r+p.offsetX+(c*p.x-n.width*p.x)/c)*h),f>=n.height&&(s=(s+p.offsetY+(f*p.y-n.height*p.y)/f)*a),h*=1/(c/n.width),a*=1/(f/n.height),c=n.width,f=n.height)}var g=c*(d=this.Df()*i.scale)*f*d,m=h*a/g,y=e.__goCache;d=null;var v=hu;if(!o){if(e.sq&&void 0!==y&&4v*v)for(null===y.gi&&(uu(y,4,l,u,e),uu(y,16,l,u,e)),l=(o=y.gi).length,u=0;ut)&&(t=5),t=Math.min(t,i/3);var n="rr"+i+","+e+","+(t=Math.min(t,e/3)),o=Xi.Mf[n];if(void 0!==o)return o;var r=t*Xi.wg;return o=(new Ui).add(new $i(t,0,!0).add(new Qi(ne,i-t,0)).add(new Qi(oe,i,t,i-r,0,i,r)).add(new Qi(ne,i,e-t)).add(new Qi(oe,i-t,e,i,e-r,i-r,e)).add(new Qi(ne,t,e)).add(new Qi(oe,0,e-t,r,e,0,e-r)).add(new Qi(ne,0,t)).add(new Qi(oe,t,0,0,r,r,0).close())),1o.x&&t.y>o.y&&t.righto.x&&i.y>o.y&&i.right=e.maxSelectionCount)){this.G^=4096;var n=!1;if(null!==e){n=e.skipsUndoManager,e.skipsUndoManager=!0;var o=e.selection;o.ka(),t?o.add(this):o.remove(this),o.freeze()}this.g("isSelected",i,t),this.Wb(),null!==(t=this.selectionChanged)&&t(this),null!==e&&(e.$b(),e.skipsUndoManager=n)}}}},isHighlighted:{get:function(){return 0!=(524288&this.G)},set:function(t){var i=0!=(524288&this.G);if(i!==t){this.G^=524288;var e=this.diagram;null!==e&&((e=e.highlighteds).ka(),t?e.add(this):e.remove(this),e.freeze()),this.g("isHighlighted",i,t),this.N(),null!==(t=this.highlightedChanged)&&t(this)}}},isShadowed:{get:function(){return 0!=(8192&this.G)},set:function(t){var i=0!=(8192&this.G);i!==t&&(this.G^=8192,this.Uc=!0,this.g("isShadowed",i,t),this.N())}},isAnimated:{get:function(){return 0!=(262144&this.G)},set:function(t){var i=0!=(262144&this.G);i!==t&&(this.G^=262144,this.g("isAnimated",i,t))}},highlightedChanged:{get:function(){return null!==this.P?this.P.oq:null},set:function(t){var i=this.highlightedChanged;i!==t&&(Mu(this),this.P.oq=t,this.g("highlightedChanged",i,t))}},selectionObjectName:{get:function(){return null!==this.P?this.P.vr:""},set:function(t){var i=this.selectionObjectName;i!==t&&(Mu(this),this.P.vr=t,this.Ug=null,this.g("selectionObjectName",i,t))}},selectionAdornmentTemplate:{get:function(){return null!==this.P?this.P.tr:null},set:function(t){var i=this.selectionAdornmentTemplate;i!==t&&(Mu(this),this.P.tr=t,this.g("selectionAdornmentTemplate",i,t))}},selectionObject:{get:function(){if(null===this.Ug){var t=this.selectionObjectName;null!==t&&""!==t?(t=this.fb(t),this.Ug=null!==t?t:this):this instanceof wc?(t=this.path,this.Ug=null!==t?t:this):this.Ug=this}return this.Ug}},selectionChanged:{get:function(){return null!==this.P?this.P.ur:null},set:function(t){var i=this.selectionChanged;i!==t&&(Mu(this),this.P.ur=t,this.g("selectionChanged",i,t))}},resizeAdornmentTemplate:{get:function(){return null!==this.P?this.P.fr:null},set:function(t){var i=this.resizeAdornmentTemplate;i!==t&&(Mu(this),this.P.fr=t,this.g("resizeAdornmentTemplate",i,t))}},resizeObjectName:{get:function(){return null!==this.P?this.P.hr:""},set:function(t){var i=this.resizeObjectName;i!==t&&(Mu(this),this.P.hr=t,this.g("resizeObjectName",i,t))}},resizeObject:{get:function(){var t=this.resizeObjectName;return""!==t&&null!==(t=this.fb(t))?t:this}},resizeCellSize:{get:function(){return null!==this.P?this.P.gr:Tt},set:function(t){var i=this.resizeCellSize;i.D(t)||(t=t.J(),Mu(this),this.P.gr=t,this.g("resizeCellSize",i,t))}},rotateAdornmentTemplate:{get:function(){return null!==this.P?this.P.ir:null},set:function(t){var i=this.rotateAdornmentTemplate;i!==t&&(Mu(this),this.P.ir=t,this.g("rotateAdornmentTemplate",i,t))}},rotateObjectName:{get:function(){return null!==this.P?this.P.jr:""},set:function(t){var i=this.rotateObjectName;i!==t&&(Mu(this),this.P.jr=t,this.g("rotateObjectName",i,t))}},rotateObject:{get:function(){var t=this.rotateObjectName;return""!==t&&null!==(t=this.fb(t))?t:this}},rotationSpot:{get:function(){return null!==this.P?this.P.lr:Si},set:function(t){var i=this.rotationSpot;i.D(t)||(t=t.J(),Mu(this),this.P.lr=t,this.g("rotationSpot",i,t))}},text:{get:function(){return this.ec},set:function(t){var i=this.ec;i!==t&&(this.ec=t,this.g("text",i,t))}},containingGroup:{get:function(){return this.Ah},set:function(t){if(this.Zc()){var i=this.Ah;if(i!==t){null===t||this!==t&&!t.Td(this)||(this===t&&w("Cannot make a Group a member of itself: "+this.toString()),w("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+t.toString())),this.C(2);var e=this.diagram;if(null!==i?yc(i,this):this instanceof gc&&null!==e&&e.ai.remove(this),this.Ah=t,null!==t?mc(t,this):this instanceof gc&&null!==e&&e.ai.add(this),this.C(1),null!==e&&e.aa){var n=this.data,o=e.model;if(null!==n&&o.Xj()){var r=o.wa(null!==t?t.data:null);o.mp(n,r)}}if(null!==(n=this.containingGroupChanged)&&(o=!0,null!==e&&(o=e.aa,e.aa=!0),n(this,i,t),null!==e&&(e.aa=o)),this instanceof gc)for(qu(e=new $,this,!0,0,!0),e=e.iterator;e.next();)if((n=e.value)instanceof Ju)for(n=n.linksConnected;n.next();)kc(n.value);if(this instanceof Ju){for(e=this.linksConnected;e.next();)kc(e.value);null!==(e=this.labeledLink)&&kc(e)}this.g("containingGroup",i,t),null!==t&&(null!==(i=t.layer)&&Co(i,-1,t))}}else w("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{get:function(){return null!==this.P?this.P.Kp:null},set:function(t){var i=this.containingGroupChanged;i!==t&&(Mu(this),this.P.Kp=t,this.g("containingGroupChanged",i,t))}},isTopLevel:{get:function(){return!(null!==this.containingGroup||this instanceof Ju&&null!==this.labeledLink)}},layoutConditions:{get:function(){return null!==this.P?this.P.Cq:127},set:function(t){var i=this.layoutConditions;i!==t&&(Mu(this),this.P.Cq=t,this.g("layoutConditions",i,t))}},dragComputation:{get:function(){return null!==this.P?this.P.Up:null},set:function(t){var i=this.dragComputation;i!==t&&(Mu(this),this.P.Up=t,this.g("dragComputation",i,t))}},shadowOffset:{get:function(){return null!==this.P?this.P.zr:rt},set:function(t){var i=this.shadowOffset;i.D(t)||(t=t.J(),Mu(this),this.P.zr=t,this.N(),this.g("shadowOffset",i,t))}},shadowColor:{get:function(){return null!==this.P?this.P.yr:"gray"},set:function(t){var i=this.shadowColor;i!==t&&(Mu(this),this.P.yr=t,this.N(),this.g("shadowColor",i,t))}},shadowBlur:{get:function(){return null!==this.P?this.P.Vg:4},set:function(t){var i=this.shadowBlur;i!==t&&(Mu(this),this.P.Vg=t,this.N(),this.g("shadowBlur",i,t))}}}),ku.prototype.invalidateLayout=ku.prototype.C,ku.prototype.findCommonContainingGroup=ku.prototype.px,ku.prototype.isMemberOf=ku.prototype.Td,ku.prototype.findTopLevelPart=ku.prototype.sz,ku.prototype.findSubGraphLevel=ku.prototype.oz,ku.prototype.ensureBounds=ku.prototype.Va,ku.prototype.getDocumentBounds=ku.prototype.mi,ku.prototype.findObject=ku.prototype.fb,ku.prototype.moveTo=ku.prototype.moveTo,ku.prototype.invalidateAdornments=ku.prototype.Wb,ku.prototype.clearAdornments=ku.prototype.Ej,ku.prototype.removeAdornment=ku.prototype.Jf,ku.prototype.addAdornment=ku.prototype.bh,ku.prototype.findAdornment=ku.prototype.Pj,ku.prototype.updateTargetBindings=ku.prototype.La;var Ku=!1;function Hu(t,i){void 0===t||t instanceof ch||"string"==typeof t?ku.call(this,t):(ku.call(this),t&&(i=t)),this.G&=-257,this.Jg="Adornment",this.ue=null,this.Aw=0,this.Uw=!1,this.j=this.$a=null,i&&Object.assign(this,i)}function Wu(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=$t,this.er=dc,this.Kr=this.ij=this.Nq=this.Mq=null}function Ju(t,i){void 0===t||t instanceof ch||"string"==typeof t?ku.call(this,t):(ku.call(this),t&&(i=t)),this.U=13,this.Ba=null,this.jb=new Z,this.wc=this.af=this.Yk=null,this.ci=!1,i&&Object.assign(this,i)}function Zu(t){null===t.Ba?t.Ba=new Wu:t.Ba.nc&&(t.Ba=t.Ba.copy())}function _u(t,i){null!==i&&(null===t.af&&(t.af=new $),t.af.add(i))}function $u(t,i,e,n){if(null===i||null===t.af)return null;for(var o=t.af.iterator;o.next();){var r=o.value;if(r.Ds===t&&r.cv===i&&r.Ox===e&&r.Px===n||r.Ds===i&&r.cv===t&&r.Ox===n&&r.Px===e)return r}return null}function Qu(t,i){for(t=t.linksConnected;t.next();){var e=t.value;e.fromPort!==i&&e.toPort!==i||(tc(e.fromPort),tc(e.toPort),e.bb())}}function tc(t){if(null!==t){var i=t.Zn;null!==i&&i.Sl(),null===(i=(t=t.part).containingGroup)||t.isVisible()||tc(i.port)}}function ic(t,i,e,n){if(null!==i&&!e.has(i)){e.add(i);var o=!0,r=t.diagram;null!==r&&(o=r.isTreePathToChildren),i.linksConnected.each((function(r){r.isTreeLink?(o?r.fromNode===i:r.toNode===i)&&ic(t,o?r.toNode:r.fromNode,e,n):n.add(r)}))}}function ec(t,i,e){tc(e);var n=t.jb.contains(i);if(n||t.jb.add(i),!n||i.fromNode===i.toNode){var o=t.linkConnected;if(null!==o){var r=!0,s=t.diagram;null!==s&&(r=s.aa,s.aa=!0),o(t,i,e),null!==s&&(s.aa=r)}}!n&&i.isTreeLink&&(e=i.fromNode,i=i.toNode,null!==e&&null!==i&&e!==i&&(n=!0,null!==(t=t.diagram)&&(n=t.isTreePathToChildren),r=n?e:i,(o=n?i:e).ci||(o.ci=r),!r.isTreeLeaf||null!==t&&t.undoManager.isUndoingRedoing||(n?e===r&&(r.isTreeLeaf=!1):i===r&&(r.isTreeLeaf=!1))))}function nc(t,i,e){tc(e);var n=t.jb.remove(i),o=null;if(n||i.toNode===i.fromNode){var r=t.linkDisconnected;if(o=t.diagram,null!==r){var s=!0;null!==o&&(s=o.aa,o.aa=!0),r(t,i,e),null!==o&&(o.aa=s)}}n&&i.isTreeLink&&(e=!0,null!==o&&(e=o.isTreePathToChildren),t=e?i.toNode:i.fromNode,i=e?i.fromNode:i.toNode,null!==t&&(t.ci=!1),null===i||i.isTreeLeaf||(0===i.jb.count?(i.ci=null,null!==o&&o.undoManager.isUndoingRedoing||(i.isTreeLeaf=!0)):oc(i)))}function oc(t){if(t.ci=!1,0!==t.jb.count){var i=!0,e=t.diagram;if(null===e||!e.undoManager.isUndoingRedoing){for(null!==e&&(i=e.isTreePathToChildren),e=t.jb.iterator;e.next();){var n=e.value;if(n.isTreeLink)if(i){if(n.fromNode===t)return void(t.isTreeLeaf=!1)}else if(n.toNode===t)return void(t.isTreeLeaf=!1)}t.isTreeLeaf=!0}}}function rc(t){null===t.wc?t.wc=new dt:t.wc.clear(),t.qm(t,(function(t,i){sc(t,i)})),0===t.wc.count&&t.wc.add("",t)}function sc(t,i){var e=i.portId;null!==e&&null!==t.wc&&t.wc.add(e,i)}function ac(t,i,e){var n=i.portId;if(null!==n&&(null!==t.wc&&t.wc.remove(n),null!==(i=t.diagram)&&e)){for(e=null,t=t.findLinksConnected(n);t.next();)n=t.value,null===e&&(e=A()),e.push(n);if(null!==e){for(t=0;tt&&(t=1);var i=this.diagram;if(null!==i&&!i.Ue){i.Ue=!0;var e=new $;e.add(this),lc(this,e,i.isTreePathToChildren,t,i,this,i.treeCollapsePolicy===ts),i.Ue=!1}},Ju.prototype.expandTree=function(t){void 0===t&&(t=2),2>t&&(t=2);var i=this.diagram;if(null!==i&&!i.Ue){i.Ue=!0;var e=new $;e.add(this),cc(this,e,i.isTreePathToChildren,t,i,this,i.treeCollapsePolicy===ts),i.Ue=!1}},f.Object.defineProperties(Ju.prototype,{portSpreading:{get:function(){return null!==this.Ba?this.Ba.er:dc},set:function(t){var i=this.portSpreading;i!==t&&(Zu(this),this.Ba.er=t,this.g("portSpreading",i,t),null!==(t=this.diagram)&&t.undoManager.isUndoingRedoing||this.Bd())}},avoidable:{get:function(){return 0!=(8&this.U)},set:function(t){var i=0!=(8&this.U);if(i!==t){this.U^=8;var e=this.diagram;null!==e&&Br(e,this),this.g("avoidable",i,t)}}},avoidableMargin:{get:function(){return null!==this.Ba?this.Ba.yp:$t},set:function(t){"number"==typeof t&&(t=new Wt(t));var i=this.avoidableMargin;if(!i.D(t)){t=t.J(),Zu(this),this.Ba.yp=t;var e=this.diagram;null!==e&&Br(e,this),this.g("avoidableMargin",i,t)}}},linksConnected:{get:function(){return this.jb.iterator}},linkConnected:{get:function(){return null!==this.Ba?this.Ba.Dq:null},set:function(t){var i=this.linkConnected;i!==t&&(Zu(this),this.Ba.Dq=t,this.g("linkConnected",i,t))}},linkDisconnected:{get:function(){return null!==this.Ba?this.Ba.Eq:null},set:function(t){var i=this.linkDisconnected;i!==t&&(Zu(this),this.Ba.Eq=t,this.g("linkDisconnected",i,t))}},linkValidation:{get:function(){return null!==this.Ba?this.Ba.gj:null},set:function(t){var i=this.linkValidation;i!==t&&(Zu(this),this.Ba.gj=t,this.g("linkValidation",i,t))}},isLinkLabel:{get:function(){return null!==this.Yk}},labeledLink:{get:function(){return this.Yk},set:function(t){var i=this.Yk;if(i!==t){var e=this.diagram,n=this.data;if(null!==i){if(null!==i.wd&&(i.wd.remove(this),i.v()),null!==e&&null!==n&&!e.undoManager.isUndoingRedoing){var o=i.data,r=e.model;if(null!==o&&r.ri()){var s=r.wa(n);void 0!==s&&r.Qx(o,s)}}this.containingGroup=null}this.Yk=t,null!==t&&(Mc(t,this),null===e||null===n||e.undoManager.isUndoingRedoing||(o=t.data,e=e.model,null!==o&&e.ri()&&(void 0!==(n=e.wa(n))&&e.Bu(o,n))),this.containingGroup=t.containingGroup),Ks(this),this.g("labeledLink",i,t)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return null===this.wc&&rc(this),this.wc.iteratorValues}},isTreeExpanded:{get:function(){return 0!=(1&this.U)},set:function(t){var i=0!=(1&this.U);if(i!==t){this.U^=1;var e=this.diagram;if(this.g("isTreeExpanded",i,t),null!==(i=this.treeExpandedChanged)){var n=!0;null!==e&&(n=e.aa,e.aa=!0),i(this),null!==e&&(e.aa=n)}null!==e&&e.undoManager.isUndoingRedoing?this.Zb(t):t?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{get:function(){return 0!=(2&this.U)},set:function(t){var i=0!=(2&this.U);i!==t&&(this.U^=2,this.g("wasTreeExpanded",i,t))}},treeExpandedChanged:{get:function(){return null!==this.Ba?this.Ba.Vr:null},set:function(t){var i=this.treeExpandedChanged;i!==t&&(Zu(this),this.Ba.Vr=t,this.g("treeExpandedChanged",i,t))}},isTreeLeaf:{get:function(){return 0!=(4&this.U)},set:function(t){var i=0!=(4&this.U);i!==t&&(this.U^=4,this.g("isTreeLeaf",i,t))}}}),Ju.prototype.expandTree=Ju.prototype.expandTree,Ju.prototype.collapseTree=Ju.prototype.collapseTree,Ju.prototype.findTreeParts=Ju.prototype.wz,Ju.prototype.findTreeChildrenNodes=Ju.prototype.Ou,Ju.prototype.findTreeChildrenLinks=Ju.prototype.Qo,Ju.prototype.findTreeLevel=Ju.prototype.uz,Ju.prototype.findTreeParentChain=Ju.prototype.vz,Ju.prototype.findTreeParentNode=Ju.prototype.pg,Ju.prototype.findTreeParentLink=Ju.prototype.kh,Ju.prototype.findCommonTreeParent=Ju.prototype.gz,Ju.prototype.findTreeRoot=Ju.prototype.xz,Ju.prototype.isInTreeOf=Ju.prototype.Nz,Ju.prototype.findPort=Ju.prototype.ns,Ju.prototype.findLinksTo=Ju.prototype.kz,Ju.prototype.findLinksBetween=Ju.prototype.jz,Ju.prototype.findNodesInto=Ju.prototype.Oo,Ju.prototype.findNodesOutOf=Ju.prototype.Po,Ju.prototype.findNodesConnected=Ju.prototype.Mu,Ju.prototype.findLinksInto=Ju.prototype.Sd,Ju.prototype.findLinksOutOf=Ju.prototype.Mo,Ju.prototype.findExternalTreeLinksConnected=Ju.prototype.qx,Ju.prototype.invalidateConnectedLinks=Ju.prototype.Bd,Ju.prototype.invalidateLinkBundle=Ju.prototype.Lz;var fc=new V(Ju,"SpreadingNone",10),dc=new V(Ju,"SpreadingEvenly",11),pc=new V(Ju,"SpreadingPacked",12);function gc(t,i){void 0===t||t instanceof ch||"string"==typeof t?Ju.call(this,t):(Ju.call(this),t&&(i=t)),this.U|=4608,this.Gn=new $,this.$a=null,this.Sc=new Ff,this.Sc.group=this,this.gl=new $,this.tb=this.$p=null,i&&Object.assign(this,i)}function mc(t,i){if(t.Gn.add(i)){i instanceof gc&&t.gl.add(i);var e=t.memberAdded;if(null!==e){var n=!0,o=t.diagram;null!==o&&(n=o.aa,o.aa=!0),e(t,i),null!==o&&(o.aa=n)}t.isVisible()&&t.isSubGraphExpanded||i.Zb(!1)}i instanceof wc&&!t.computesBoundsIncludingLinks||(null===(i=t.$a)&&(i=t),i.v())}function yc(t,i){if(t.Gn.remove(i)){i instanceof gc&&t.gl.remove(i);var e=t.memberRemoved;if(null!==e){var n=!0,o=t.diagram;null!==o&&(n=o.aa,o.aa=!0),e(t,i),null!==o&&(o.aa=n)}t.isVisible()&&t.isSubGraphExpanded||i.Zb(!0)}i instanceof wc&&!t.computesBoundsIncludingLinks||(null===(i=t.$a)&&(i=t),i.v())}function vc(t,i,e,n){for(var o=t.memberParts;o.next();){var r=o.value;if(r.Zb(!1),r instanceof gc&&r.isSubGraphExpanded&&(r.wasSubGraphExpanded=r.isSubGraphExpanded,vc(r,i,e,n)),r instanceof Ju)r.Bd(i),e.Aj(r,n);else if(r instanceof wc)for(r=r.labelNodes;r.next();)r.value.Bd(i)}t.isSubGraphExpanded=!1}function xc(t,i,e,n){for(var o=t.memberParts;o.next();){var r=o.value;if(r.Zb(!0),r instanceof gc&&r.wasSubGraphExpanded&&(r.wasSubGraphExpanded=!1,xc(r,i,e,n)),r instanceof Ju)r.Bd(i),e.Cj(r,n);else if(r instanceof wc)for(r=r.labelNodes;r.next();)r.value.Bd(i)}t.isSubGraphExpanded=!0}function bc(t){Ds.call(this),this.yb=_t,this.ko=new Bt(NaN,NaN,NaN,NaN),t&&Object.assign(this,t)}function wc(t){ku.call(this,Ch.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=Wc,this.Om=0,this.Qm=Wc,this.Rm=NaN,this.qj=Uc,this.po=.5,this.wd=null,this.Nb=(new Z).freeze(),this.Tg=this.Mg=null,this.ml=new Bt,this.ua=new Ui,this.u=this.o=this.Sf=this.Wf=null,this.su=new pt,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],t&&Object.assign(this,t)}function kc(t){var i=t.fromNode,e=t.toNode,n=null;if(n=null!==i?null!==e?i.px(e):i.containingGroup:null!==e?e.containingGroup:null,i=n,(e=t.Ah)!==i){null!==e&&yc(e,t),t.Ah=i,null!==i&&mc(i,t);var o=t.containingGroupChanged;if(null!==o){var r=!0,s=t.diagram;null!==s&&(r=s.aa,s.aa=!0),o(t,e,i),null!==s&&(s.aa=r)}!t.fd||t.Lw!==e&&t.Mw!==e||t.bb()}if(t.isLabeledLink)for(t=t.labelNodes;t.next();)t.value.containingGroup=n}function Mc(t,i){null===t.wd&&(t.wd=new $),t.wd.add(i),t.v()}function Sc(t,i,e){if(0!==i||0!==e)if(0===t.pointsCount)t.defaultFromPoint&&t.defaultFromPoint.offset(i,e),t.defaultToPoint&&t.defaultToPoint.offset(i,e);else{for(var n=t.fd,o=new Z,r=t.Nb.iterator;r.next();){var s=r.value;o.add(new pt(s.x+i,s.y+e).freeze())}o.freeze(),r=t.Nb,t.Nb=o,s=t.diagram,isNaN(i)||isNaN(e)||null!==s&&s.animationManager.zb?t.v():(t.ke.h(t.ke.x+i,t.ke.y+e),t.pa.h(t.pa.x+i,t.pa.y+e),Ks(t)),n?Nc(t):(t.defaultFromPoint&&(t.defaultFromPoint=t.i(0)),t.defaultToPoint&&(t.defaultToPoint=t.i(t.pointsCount-1))),null!==s&&s.animationManager.zb&&Qn(s.animationManager,t,o),t.g("points",r,o)}}function Nc(t){0===t.Nb.count?t.fd=!1:(t.fd=!0,t.cq=null,t.vt=NaN,t.defaultFromPoint=t.i(0),t.defaultToPoint=t.i(t.pointsCount-1),Rc(t,!1))}function Pc(t,i){return Math.abs(i.x-t.x)>Math.abs(i.y-t.y)?(i.x>=t.x?i.x=t.x+9e9:i.x=t.x-9e9,i.y=t.y):(i.y>=t.y?i.y=t.y+9e9:i.y=t.y-9e9,i.x=t.x),i}function Cc(t,i){var e=i.Zn;return null===e&&((e=new Tf).port=i,e.node=i.part,i.Zn=e),Af(e,t)}function Tc(t){return t===Qt||.5===t.x&&.5===t.y}function Lc(t){return.5===t.x&&.5===t.y?t:oi}function Ac(t){if(null===t.diagram||!t.isAvoiding||!Ar(t.diagram))return!1;var i=t.points.s,e=i.length;if(4>e)return!1;t=jr(t.diagram,!0,t.containingGroup,null);for(var n=1;nSf&&mf(i,u,c)!==l-1&&(mf(i,e-a,n)===l-1?(o=180,u=e-a,c=n):mf(i,e+a,n)===l-1?(o=0,u=e+a,c=n):mf(i,e,n-h)===l-1?(o=270,u=e,c=n-h):mf(i,e,n+h)===l-1&&(o=90,u=e,c=n+h));l>Sf&&mf(i,u,c)===l-1;)e=u,n=c,0===o?u+=a:90===o?c+=h:180===o?u-=a:c-=h,--l;r?l>Sf&&(180===o||0===o?e=Math.floor(e/a)*a+a/2:90!==o&&270!==o||(n=Math.floor(n/h)*h+h/2)):(e=Math.floor(e/a)*a+a/2,n=Math.floor(n/h)*h+h/2),l>Sf&&(r=o,s=e,u=n,0===o?(r=90,u+=h):90===o?(r=180,s-=a):180===o?(r=270,u-=h):270===o&&(r=0,s+=a),mf(i,s,u)===l-1?jc(t,i,s,u,r,!1,r):(s=e,u=n,0===o?(r=270,u-=h):90===o?(r=0,s+=a):180===o?(r=90,u+=h):270===o&&(r=180,s-=a),mf(i,s,u)===l-1&&jc(t,i,s,u,r,!1,r))),t.yf(e,n)}function Fc(t,i,e,n){return t=e-t,isNaN(t)||1/0===t||-1/0===t?NaN:(0>t&&(t=-t),i=n-i,isNaN(i)||1/0===i||-1/0===i?NaN:(0>i&&(i=-i),Xi.$(t,0)?i:Xi.$(i,0)?t:Math.sqrt(t*t+i*i)))}function Dc(t,i,e,n){var o=t.pointsCount;if(2>o)return i;if(e){var r=t.i(1);if(e=r.x-n.x,r=r.y-n.y,0===(n=Fc(i.x,i.y,e,r)))return i;o=2===o?.5*n:n,(t=t.computeShortLength(!0))>o&&(t=o),o=t*(r-i.y)/n,i.x+=t*(e-i.x)/n,i.y+=o}else{if(e=(r=t.i(o-2)).x-n.x,r=r.y-n.y,0===(n=Fc(i.x,i.y,e,r)))return i;o=2===o?.5*n:n,(t=t.computeShortLength(!1))>o&&(t=o),o=t*(i.y-r)/n,i.x-=t*(i.x-e)/n,i.y-=o}return i}function Bc(t,i,e,n){for(var o=t.pointsCount,r=i;Xi.$(i.x,r.x)&&Xi.$(i.y,r.y);){if(e>=o)return o-1;r=t.i(e++)}if(!Xi.$(i.x,r.x)&&!Xi.$(i.y,r.y))return e-1;for(var s=r;Xi.$(i.x,r.x)&&Xi.$(r.x,s.x)&&(!n||(i.y>=r.y?r.y>=s.y:r.y<=s.y))||Xi.$(i.y,r.y)&&Xi.$(r.y,s.y)&&(!n||(i.x>=r.x?r.x>=s.x:r.x<=s.x));){if(e>=o)return o-1;s=t.i(e++)}return e-2}function Oc(t,i,e,n,o,r,s){if(!s&&zc(t)){var a=(s=t.computeJumpLength())/2,h=[],l=0;if(t.isVisible()&&(l=function(t,i,e,n){var o=t.diagram;if(null===o||i.D(e))return 0;for(o=o.layers;o.next();){var r=o.value;if(null!==r&&r.visible)for(var s=(r=r.Pa.s).length,a=0;ac-s;)l--,c=Math.max(u-a,r.x);u=r.y-s+n,c+=e,d=r.y+n,t.curve===Zc?du(i,c,d,!1):gu(i,f,u,c,u,c,d)}else if(Xi.B(o.x,r.x))if(o.yu-s;)l--,u=Math.max(c-a,r.y);c=r.x-s+e,d=r.x+e,u+=n,t.curve===Zc?du(i,d,u,!1):gu(i,c,f,c,u,d,u)}}i.lineTo(r.x+e,r.y+n)}function Ic(t,i,e,n){for(var o=Xi.B(t.y,i.y),r=n.pointsCount,s=n.i(0),a=pt.alloc(),h=1;hs.x&&u.x>=l.x||l.xs.y&&u.y>=l.y||l.ys&&Math.min(p,g)u&&!Xi.B(p,g)){a.x=u,a.y=s,u=!0;break t}}else if(Xi.B(c,d)&&Xi.B(p,g)&&Math.min(u,f)p&&Math.min(s,m)c&&!Xi.B(s,m)){a.x=p,a.y=c,u=!0;break t}a.x=0,a.y=0,u=!1}u&&(o?e.push(a.x):e.push(a.y)),s=l}pt.free(a)}function zc(t){return(t=t.curve)===_c||t===Zc}function Rc(t,i){(i||zc(t))&&(null===(i=t.diagram)||i.animationManager.isTicking||i.Eh.contains(t)||0===t.ml.width&&0===t.ml.height||i.Eh.add(t,t.ml.copy()))}function Ec(t,i,e){if(null!==i&&i.lk&&i.fd&&zc(i)){var n=i.routeBounds;n.w()&&(t.routeBounds.Yc(n)||e.Yc(n))&&(t.usesSamePort(i)||i.qc())}}function Vc(t){var i=t.ef;if(null!==i){var e=t.uf;if(null!==e&&isNaN(t.curviness)){for(var n=t.ff,o=t.vf,r=t=null,s=i.jb.s,a=s.length,h=0;ho&&(o=a.right),a.bottom>r&&(r=a.bottom)}}return isFinite(e)&&isFinite(n)?t.h(e,n,o-e,r-n):(i=i.location,t.h(i.x,i.y,0,0)),t},f.Object.defineProperties(bc.prototype,{padding:{get:function(){return this.yb},set:function(t){"number"==typeof t&&(t=new Wt(t));var i=this.yb;i.D(t)||(this.yb=t=t.J(),this.g("padding",i,t),this.v())}}}),bc.className="Placeholder",c(wc,ku),wc.prototype.cloneProtected=function(t){ku.prototype.cloneProtected.call(this,t),t.Qa=-113&this.Qa,t.ff=this.ff,t.gn=this.gn,t.vf=this.vf,t.uo=this.uo,t.qk=this.qk,t.Om=this.Om,t.Qm=this.Qm,t.Rm=this.Rm,t.qj=this.qj,t.po=this.po,null!==this.ba&&(t.ba=this.ba.copy())},(i=wc.prototype).Af=function(t){ku.prototype.Af.call(this,t),this.ff=t.ff,this.vf=t.vf,t.Mg=null,t.bb(),t.Sf=this.Sf;var i=t.fromPort;null!==i&&tc(i),null!==(t=t.toPort)&&tc(t)},i.qb=function(t){t.classType===wc?2==(2&t.value)?this.routing=t:t===Jc||t===Zc||t===_c?this.curve=t:t===$c||t===Qc||t===tf?this.adjusting=t:t!==Uc&&t!==Wc&&w("Unknown Link enum value for a Link property: "+t):ku.prototype.qb.call(this,t)},i.Xc=function(){null===this.ba&&(this.ba=new pa)},i.si=function(){var t=this.fromNode;if(null!==t){var i=t.findVisibleNode();if(null!==i&&(t=i),na(t)||Iu(t))return!1}return null===(t=this.toNode)||(null!==(i=t.findVisibleNode())&&(t=i),!na(t)&&!Iu(t))},i.zv=function(){return!1},i.Av=function(){},i.Zc=function(){return!1},wc.prototype.computeAngle=function(t,i,e){return wc.computeAngle(i,e)},wc.computeAngle=function(t,i){switch(t){default:case Wc:t=0;break;case ef:t=i;break;case nf:t=i+90;break;case of:t=i-90;break;case rf:t=i+180;break;case sf:90<(t=Xi.bp(i))&&270>t&&(t-=180);break;case af:90<(t=Xi.bp(i+90))&&270>t&&(t-=180);break;case hf:90<(t=Xi.bp(i-90))&&270>t&&(t-=180);break;case lf:if(45<(t=Xi.bp(i))&&135>t||225t)return 0;90t&&(t-=180)}return Xi.bp(t)},(i=wc.prototype).oh=function(){var t=this.containingGroup;null!==t&&this.fromNode!==t&&this.toNode!==t&&t.computesBoundsIncludingLinks&&ku.prototype.oh.call(this)},i.To=function(t){var i=this.fromNode;return t===i?this.toNode:i},i.Cz=function(t){var i=this.fromPort;return t===i?this.toPort:i},i.Vo=function(t){if(ku.prototype.Vo.call(this,t),zc(this)&&this.Xo(this.actualBounds),!t){var i=null;null!==(t=this.ef)&&ec(t,this,i=this.fromPort);var e=this.uf;if(null!==e){var n=this.toPort;e===t&&n===i||ec(e,this,n)}Vc(this)}},i.Wo=function(t){if(ku.prototype.Wo.call(this,t),zc(this)&&this.Xo(this.actualBounds),!t){var i=null;null!==(t=this.ef)&&nc(t,this,i=this.fromPort);var e=this.uf;if(null!==e){var n=this.toPort;e===t&&n===i||nc(e,this,n)}Yc(this)}},i.Lj=function(){if(this.fd=!0,null!==this.wd){var t=this.diagram;if(null!==t)for(var i=this.wd.copy().iterator;i.next();)t.remove(i.value)}null!==this.data&&(null!==(t=this.diagram)&&t.partManager.removeDataForLink(this))},wc.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var t=this.diagram;null!==t&&t.partManager.updateRelationshipsFromData(this)}},wc.prototype.move=function(t,i){var e=i?this.location:this.position,n=e.x;isNaN(n)&&(n=0);var o=e.y;for(isNaN(o)&&(o=0),n=t.x-n,o=t.y-o,!0===i?ku.prototype.move.call(this,t,!1):(t=pt.allocAt(e.x+n,e.y+o),ku.prototype.move.call(this,t,!1),pt.free(t)),Sc(this,n,o),t=this.labelNodes;t.next();)e=(i=t.value).position,i.moveTo(e.x+n,e.y+o)},wc.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var t=this.layer;return null===t||!!t.allowRelink&&!(null!==(t=t.diagram)&&!t.allowRelink)},wc.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var t=this.layer;return null===t||!!t.allowRelink&&!(null!==(t=t.diagram)&&!t.allowRelink)},wc.prototype.computeMidPoint=function(t){var i=this.pointsCount;if(0===i)return t.assign(st),t;if(1===i)return t.assign(this.i(0)),t;if(2===i){var e=this.i(0),n=this.i(1);return t.h((e.x+n.x)/2,(e.y+n.y)/2),t}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Jc))return this.ua.Pu(.5,t),t.add(this.i(0)),e=this.ua.figures.first(),t.offset(-e.startX,-e.startY),t;if(this.computeCurve()===Jc){if(3===i){e=this.i(0),n=this.i(1);var o=this.i(2);return Xi.ax(e.x,e.y,n.x,n.y,n.x,n.y,o.x,o.y,t),t}if(e=3*((n=(i-1)/3|0)/2|0),1==n%2){n=this.i(e),o=this.i(e+1);var r=this.i(e+2);e=this.i(e+3),Xi.ax(n.x,n.y,o.x,o.y,r.x,r.y,e.x,e.y,t)}else t.assign(this.i(e));return t}var s=this.flattenedLengths;for(e=this.flattenedTotalLength,o=r=n=0;ne/2);)n+=o,r++;return i=this.i(r),r=this.i(r+1),1>Math.abs(i.x-r.x)?i.y>r.y?t.h(i.x,i.y-(e/2-n)):t.h(i.x,i.y+(e/2-n)):1>Math.abs(i.y-r.y)?i.x>r.x?t.h(i.x-(e/2-n),i.y):t.h(i.x+(e/2-n),i.y):(e=(e/2-n)/o,t.h(i.x+e*(r.x-i.x),i.y+e*(r.y-i.y))),t},wc.prototype.computeMidAngle=function(){var t=this.pointsCount;if(2>t)return NaN;if(2===t)return this.i(0).ab(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Jc))return this.ua.wx(.5);if(this.computeCurve()===Jc&&4<=t){var i=(t-1)/3|0,e=3*(i/2|0);if(1==i%2){e=Math.floor(e),t=this.i(e),i=this.i(e+1);var n=this.i(e+2);return e=this.i(e+3),Xi.My(t.x,t.y,i.x,i.y,n.x,n.y,e.x,e.y)}if(0n/2);)r+=o,e++;if(i=this.i(e),n=this.i(e+1),1>Math.abs(i.x-n.x)&&1>Math.abs(i.y-n.y)){if(0Math.abs(i.x-n.x))return i.y>n.y?270:90;if(1>Math.abs(i.y-n.y))return i.x>n.x?180:0}return i.ab(n)},(i=wc.prototype).i=function(t){return this.Nb.s[t]},i.dd=function(t,i){this.Nb.cd(t,i)},i.L=function(t,i,e){this.Nb.cd(t,new pt(i,e))},i.Kz=function(t,i){this.Nb.Gb(t,i)},i.m=function(t,i,e){this.Nb.Gb(t,new pt(i,e))},i.ne=function(t){this.Nb.add(t)},i.yf=function(t,i){this.Nb.add(new pt(t,i))},i.pv=function(t){this.Nb.mb(t)},i.Fj=function(){this.Nb.clear()},i.uh=function(){null===this.Mg&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},i.zf=function(){if(null!==this.Mg){for(var t=this.Mg,i=this.Nb,e=1/0,n=1/0,o=t.s,r=o.length,s=0;sl&&(c=-c),m=u*((g=(0>h?-1:1)*c+d)-d)+p);var y=d=r.x+2*a/3,v=p=r.y+2*h/3;Xi.B(h,0)?v=0h?-1:1)*c+d)-d)+p,this.Fj(),this.ne(r),this.yf(g,m),this.yf(y,v),this.ne(f),this.dd(0,this.getLinkPoint(t,i,s,!0,!1,n,o)),this.dd(3,this.getLinkPoint(n,o,e,!1,!1,t,i))}else r=n,f=o,n=this.getLinkPoint(t,i,s,!0,!1,r,f),o=this.getLinkPoint(r,f,e,!1,!1,t,i),this.hasCurviness()?(f=o.x-n.x,e=o.y-n.y,s=this.computeCurviness(),r=t=n.x+f/2,a=i=n.y+e/2,Xi.B(e,0)?a=0s&&(r=-r),a=f*((r=(0>e?-1:1)*r+t)-t)+i),this.ne(n),this.yf(r,a),this.ne(o)):(this.ne(n),this.ne(o),a=Bt.alloc(),i.mi(a),h=a.ca(o),f.mi(a),l=a.ca(n),(h||l)&&(s=i.ga(Lc(s),new pt),this.dd(0,this.getLinkPointFromPoint(t,i,s,o,!0,s)),e=f.ga(Lc(e),new pt),this.dd(1,this.getLinkPointFromPoint(r,f,e,n,!1,e))),Bt.free(a))}else{c=this.isAvoiding,f&&(u&&c||l)&&this.Fj();var x=l?this.computeCurviness():0;c=this.getLinkPoint(t,i,s,!0,u,n,o),d=g=p=0,(u||!a||l)&&(m=this.computeEndSegmentLength(t,i,s,!0),d=this.getLinkDirection(t,i,c,s,!0,u,n,o),l&&(a||s.D(e)||!u&&1===s.x+e.x&&1===s.y+e.y)&&(d-=u?90:30,0>x&&(d-=180)),0>d?d+=360:360<=d&&(d-=360),l&&(m+=Math.abs(x)*(u?1:2)),0===d?p=m:90===d?g=m:180===d?p=-m:270===d?g=-m:(p=m*Math.cos(d*Math.PI/180),g=m*Math.sin(d*Math.PI/180)),s.Mc()&&l&&(m=i.ga(oi,pt.alloc()),y=pt.allocAt(m.x+1e3*p,m.y+1e3*g),this.getLinkPointFromPoint(t,i,m,y,!0,c),pt.free(m),pt.free(y))),m=this.getLinkPoint(n,o,e,!1,u,t,i);var b=v=y=0;if(u||!h||l){var w=this.computeEndSegmentLength(n,o,e,!1);b=this.getLinkDirection(n,o,m,e,!1,u,t,i),l&&(h||s.D(e)||!u&&1===s.x+e.x&&1===s.y+e.y)&&(b+=u?0:30,0>x&&(b+=180)),0>b?b+=360:360<=b&&(b-=360),l&&(w+=Math.abs(x)*(u?1:2)),0===b?y=w:90===b?v=w:180===b?y=-w:270===b?v=-w:(y=w*Math.cos(b*Math.PI/180),v=w*Math.sin(b*Math.PI/180)),e.Mc()&&l&&(e=o.ga(oi,pt.alloc()),s=pt.allocAt(e.x+1e3*y,e.y+1e3*v),this.getLinkPointFromPoint(n,o,e,s,!1,m),pt.free(e),pt.free(s))}e=c,(u||!a||l)&&(e=new pt(c.x+p,c.y+g)),s=m,(u||!h||l)&&(s=new pt(m.x+y,m.y+v)),!f&&!u&&a&&3=u.y&&t.y<=u.y+u.height?a.y=t.y:(e.Hf(li)||e.Hf(fi))&&t.x>=u.x&&t.x<=u.x+u.width&&(a.x=t.x),pt.free(h),pt.free(l)}}return a}}return e=i.ga(Lc(e),pt.alloc()),this.pointsCount>(o?6:2)?(s=n?this.i(1):this.i(this.pointsCount-2),o&&(s=Pc(e,s.copy()))):(h=this.computeSpot(!n,s),r=pt.alloc(),s=s.ga(Lc(h),r),o&&(s=Pc(e,s)),pt.free(r)),this.getLinkPointFromPoint(t,i,e,s,n,a),pt.free(e),a},wc.prototype.getLinkDirection=function(t,i,e,n,o,r,s,a){t:if(n.sb())var h=n.x>n.y?n.x>1-n.y?0:n.x<1-n.y?270:315:n.x1-n.y?90:n.x<1-n.y?180:135:.5>n.x?225:.5(r?6:2)?(a=o?this.i(1):this.i(this.pointsCount-2),a=r?Pc(h,a.copy()):e):(e=pt.alloc(),a=a.ga(oi,e),pt.free(e)),e=Math.abs(a.x-h.x)>Math.abs(a.y-h.y)?a.x>=h.x?0:180:a.y>=h.y?90:270,pt.free(h),h=e}return n.Mc()&&s.Td(t)&&(360<=(h+=180)&&(h-=360)),Tc(n)||0===(t=i.li())||(45<=t&&135>t?h+=90:135<=t&&225>t?h+=180:225<=t&&315>t&&(h+=270),360<=h&&(h-=360)),h},wc.prototype.computeEndSegmentLength=function(t,i,e,n){return null!==i&&e.$c()&&null!==(t=Cc(this,i))?t.Ju:(t=n?this.fromEndSegmentLength:this.toEndSegmentLength,null!==i&&isNaN(t)&&(t=n?i.fromEndSegmentLength:i.toEndSegmentLength),isNaN(t)&&(t=10),t)},wc.prototype.computeSpot=function(t,i){return void 0===i&&(i=null),t?null===(t=i||this.fromPort)?t=oi:((i=this.fromSpot).Xb()&&(i=t.fromSpot),t=i===Si?Qt:i):null===(t=i||this.toPort)?t=oi:((i=this.toSpot).Xb()&&(i=t.toSpot),t=i===Si?Qt:i),t},wc.prototype.computeOtherPoint=function(t,i){return this.computeAdjusting()!==Wc&&4f.width||c.y>f.height||0>c.x+c.width||0>c.y+c.height)){if((c=Yi.alloc()).set(s),u instanceof Ch)a=u.Cf(t,i,e,n,o,c);else if(this.path===u){if(u instanceof pl)if(a=t,f=n,!1===u.pickable)a=!1;else if(c.multiply(u.transform),f)t:{var d=a,p=c;if(u.fh(d,p))a=!0;else{if(void 0===p&&(p=u.transform,d.Re(u.actualBounds))){a=!0;break t}a=d.left,f=d.right;var g=d.top;d=d.bottom;var m=pt.alloc(),y=pt.alloc(),v=pt.alloc(),x=Yi.alloc();x.set(p),x.bv(u.transform),x.Vj(),y.x=f,y.y=g,y.transform(x),m.x=a,m.y=g,m.transform(x),p=!1,bl(u,m,y,v)?p=!0:(m.x=f,m.y=d,m.transform(x),bl(u,m,y,v)?p=!0:(y.x=a,y.y=d,y.transform(x),bl(u,m,y,v)?p=!0:(m.x=a,m.y=g,m.transform(x),bl(u,m,y,v)&&(p=!0)))),Yi.free(x),pt.free(m),pt.free(y),pt.free(v),a=p}}else a=u.fh(a,c)}else a=Is(u,t,n,c);a&&(f=u,null!==i&&(f=i(u)),f&&(null===e||e(f))&&o.add(f)),Yi.free(c)}}}return void 0===r&&Yi.free(s),a||null!==this.background||null!==this.areaBackground}return void 0===r&&Yi.free(s),!1},wc.prototype.computeCurve=function(){if(null===this.Wf){var t=this.fromPort,i=this.isOrthogonal;this.Wf=null!==t&&t===this.toPort&&!i}return this.Wf?Jc:this.curve},wc.prototype.computeCorner=function(){if(this.curve===Jc)return 0;var t=this.corner;return(isNaN(t)||0>t)&&(t=10),t},wc.prototype.findMidLabel=function(){for(var t=this.path,i=this.O.s,e=i.length,n=0;nh?-Math.PI/2:Math.PI/2;else u=Math.atan(h/Math.abs(a)),0>a&&(u=Math.PI-u);s=i.x;var c=i.y;a=n.x-s;var f=n.y-c;for(h=Math.sqrt(a*a+f*f),Xi.$(a,0)?f=0>f?-Math.PI/2:Math.PI/2:(f=Math.atan(f/Math.abs(a)),0>a&&(f=Math.PI-f)),l=h/l,u=f-u,this.dd(t,i),t+=1;th?-Math.PI/2:Math.PI/2:(h=Math.atan(h/Math.abs(a)),0>a&&(h=Math.PI-h)),a=h+u,i*=l,this.L(t,s+i*Math.cos(a),c+i*Math.sin(a)));this.dd(e,n)}}return!0;case tf:if(r=this.i(t),c=this.i(e),!r.Xa(i)||!c.Xa(n)){o=r.x,r=r.y,l=((s=c.x)-o)*(s-o)+((c=c.y)-r)*(c-r),a=i.x,u=i.y,h=n.x,f=n.y;var d=1;if(0!=h-a){var p=(f-u)/(h-a);d=Math.sqrt(1+1/(p*p))}else p=9e9;for(this.dd(t,i),t+=1;ti?i+=360:360<=i&&(i-=360),0>n?n+=360:360<=n&&(n-=360);var s=n;i=315<=i||45>i?0:45<=i&&135>i?90:135<=i&&225>i?180:270,n=315<=n||45>n?0:45<=n&&135>n?90:135<=n&&225>n?180:270;var a=o.actualBounds.copy(),h=r.actualBounds.copy();if(a.w()&&h.w()){a.Bc(ff,ff),h.Bc(ff,ff),a.Ye(t),h.Ye(e);var l=pt.alloc(),u=pt.alloc();0===i?e.x>t.x||270===n&&e.yt.x||90===n&&e.y>t.y&&h.right>t.x?(l.h(e.x,t.y),u.h(e.x,(t.y+e.y)/2),180===n?(l.x=this.computeMidOrthoPosition(t.x,t.y,e.x,e.y,!1),u.x=l.x,u.y=e.y):270===n&&e.yt.y?(l.x=t.xh.bottom)?this.computeMidOrthoPosition(t.x,t.y,e.x,e.y,!1):h.right,u.x=l.x,u.y=e.y):0===n&&t.xh.top&&t.ya.bottom)&&(180===n&&(h.ca(t)||a.ca(e))?l.y=this.computeMidOrthoPosition(t.x,t.y,e.x,e.y,!0):e.yt.y&&(180===n||270===n)&&(l.y=this.computeMidOrthoPosition(t.x,a.bottom,e.x,Math.min(e.y,h.top),!0)),u.x=e.x,u.y=l.y),l.y>a.top&&l.y=a.left&&e.x<=t.x||t.x<=h.right&&t.x>=e.x?90!==n&&270!==n||(l.h(Math.max((t.x+e.x)/2,t.x),t.y),u.h(l.x,e.y)):(l.y=270===n||(0===n||180===n)&&e.yt.y&&h.leftt.y?(l.x=t.x>h.right?this.computeMidOrthoPosition(t.x,t.y,h.right,e.y,!1):t.x>h.left&&(270===n&&t.yh.bottom)?this.computeMidOrthoPosition(t.x,t.y,e.x,e.y,!1):h.left,u.x=l.x,u.y=e.y):180===n&&t.x>h.right&&t.y>h.top&&t.ya.bottom)&&(0===n&&(h.ca(t)||a.ca(e))?l.y=this.computeMidOrthoPosition(t.x,t.y,e.x,e.y,!0):e.yt.y&&(0===n||270===n)&&(l.y=this.computeMidOrthoPosition(t.x,a.bottom,e.x,Math.min(e.y,h.top),!0)),u.x=e.x,u.y=l.y),l.y>a.top&&l.y=t.x||t.x>=h.left&&t.x<=e.x?90!==n&&270!==n||(l.h(Math.min((t.x+e.x)/2,t.x),t.y),u.h(l.x,e.y)):(l.y=270===n||(0===n||180===n)&&e.yt.y||180===n&&e.xt.y||0===n&&e.x>t.x&&h.bottom>t.y?(l.h(t.x,e.y),u.h((t.x+e.x)/2,e.y),270===n?(l.y=this.computeMidOrthoPosition(t.x,t.y,e.x,e.y,!0),u.x=e.x,u.y=l.y):180===n&&e.xt.x?(l.y=t.yh.right)?this.computeMidOrthoPosition(t.x,t.y,e.x,e.y,!0):h.bottom,u.x=e.x,u.y=l.y):90===n&&t.yh.left&&t.xa.right)&&(270===n&&(h.ca(t)||a.ca(e))?l.x=this.computeMidOrthoPosition(t.x,t.y,e.x,e.y,!1):e.xt.x&&(270===n||180===n)&&(l.x=this.computeMidOrthoPosition(a.right,t.y,Math.min(e.x,h.left),e.y,!1)),u.x=l.x,u.y=e.y),l.x>a.left&&l.x=a.top&&e.y<=t.y||t.y<=h.bottom&&t.y>=e.y?0!==n&&180!==n||(l.h(t.x,Math.max((t.y+e.y)/2,t.y)),u.h(e.x,l.y)):(l.x=180===n||(90===n||270===n)&&e.xt.x&&h.top=t.x?(l.y=t.y>h.bottom?this.computeMidOrthoPosition(t.x,t.y,e.x,h.bottom,!0):t.y>h.top&&(180===n&&t.xh.right)?this.computeMidOrthoPosition(t.x,t.y,e.x,e.y,!0):h.top,u.x=e.x,u.y=l.y):270===n&&t.y>h.bottom&&t.x>h.left&&t.xa.right)&&(90===n&&(h.ca(t)||a.ca(e))?l.x=this.computeMidOrthoPosition(t.x,t.y,e.x,e.y,!1):e.xt.x&&(90===n||180===n)&&(l.x=this.computeMidOrthoPosition(a.right,t.y,Math.min(e.x,h.left),e.y,!1)),u.x=l.x,u.y=e.y),l.x>a.left&&l.x=t.y||t.y>=h.top&&t.y<=e.y?0!==n&&180!==n||(l.h(t.x,Math.min((t.y+e.y)/2,t.y)),u.h(e.x,l.y)):(l.x=180===n||(90===n||270===n)&&e.x=Nf&&(yf(d),a.Bc(d.Ho*d.Hx,d.Go*d.Ix),wf(d,t,i,c,n,a,!1),h=mf(d,c.x,c.y)),!d.abort&&hthis.pointsCount?(0===i||180===i?(a.x=t.x,a.y=c.y):(a.x=c.x,a.y=t.y),this.L(2,a.x,a.y),this.m(3,a.x,a.y)):(s=this.i(3),0===i||180===i?Xi.B(a.x,s.x)?(a=0===i?Math.max(a.x,t.x):Math.min(a.x,t.x),this.L(2,a,t.y),this.L(3,a,s.y)):Xi.B(a.y,s.y)?(Math.abs(t.y-a.y)<=d.Go/2&&(this.L(2,a.x,t.y),this.L(3,s.x,t.y)),this.m(2,a.x,t.y)):this.L(2,t.x,a.y):90!==i&&270!==i||(Xi.B(a.y,s.y)?(a=90===i?Math.max(a.y,t.y):Math.min(a.y,t.y),this.L(2,t.x,a),this.L(3,s.x,a)):Xi.B(a.x,s.x)?(Math.abs(t.x-a.x)<=d.Ho/2&&(this.L(2,t.x,a.y),this.L(3,t.x,s.y)),this.m(2,t.x,a.y)):this.L(2,a.x,t.y))),null!==e&&(t=this.i(1),s=this.i(2),t.x!==s.x&&t.y!==s.y?0===i||180===i?this.m(2,t.x,s.y):this.m(2,s.x,t.y):0===i||180===i?this.m(2,o.x,e.y):this.m(2,e.x,o.y)),null!==p&&(0===n||180===n?this.yf(r.x,p.y):this.yf(p.x,r.y)),i=!0):i=!1}}}else i=!1;i||(this.ne(l.copy()),this.ne(u.copy())),pt.free(l),pt.free(u)}},wc.prototype.computeMidOrthoPosition=function(t,i,e,n,o){var r=0;return!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(r=this.computeCurviness()),o?(i+n)/2+r:(t+e)/2+r},wc.prototype.ez=function(t){var i=t.x;t=t.y;for(var e=this.i(0),n=this.i(1),o=xt(i,t,e.x,e.y,n.x,n.y),r=0,s=1;sthis.pointsCount?this.lk=!0:this.ua=this.makeGeometry(),null!==(t=this.path)){t.ua=this.ua;for(var i=this.O.s,e=i.length,n=0;n=i&&(n=i-1),h=this.i(n),r.x=Math.min(h.x,r.x),r.y=Math.min(h.y,r.y);n=r.x,h=r.y}else{for(h=0;hm?p>d?(r.x=y-x,r.y=d-x,o.x=y+g,o.y=d+g):(r.x=y-x,r.y=d+x,o.x=y+g,o.y=d-g):p>d?(r.x=y+x,r.y=d-x,o.x=y-g,o.y=d+g):(r.x=y+x,r.y=d+x,o.x=y-g,o.y=d-g)),Xi.$(m,y)&&Xi.$(d,p)&&(d>f?(v>y?(r.x=y-x,r.y=d-x,o.x=y+g):(r.x=y+x,r.y=d-x,o.x=y-g),o.y=d+g):(v>y?(r.x=y-x,r.y=d+x,o.x=y+g):(r.x=y+x,r.y=d+x,o.x=y-g),o.y=d-g)),(Xi.$(m,y)&&Xi.$(y,v)||Xi.$(f,d)&&Xi.$(d,p))&&(m=.5*(m+v),f=.5*(f+p),r.x=m,r.y=f,o.x=m,o.y=f),(1===c||2===c&&Xi.$(s.x,this.i(0).x)&&Xi.$(s.y,this.i(0).y))&&(e.x=.5*(s.x+l.x),e.y=.5*(s.y+l.y)),gu(a,e.x-n,e.y-h,r.x-n,r.y-h,l.x-n,l.y-h),i.set(r),e.set(o),s=l}}l=s.x,s=s.y,u=this.i(this.pointsCount-1),0!==this.computeShortLength(!1)&&(u=Dc(this,u.copy(),!1,et)),l=.5*(l+u.x),s=.5*(s+u.y),gu(a,o.x-n,o.y-h,l-n,s-h,u.x-n,u.y-h),pt.free(i),pt.free(e),pt.free(r),pt.free(o)}else for(e=3;e=i&&(e=i-1),o=this.i(e-1),s=this.i(e),e===i-1&&0!==this.computeShortLength(!1)&&(s=Dc(this,s.copy(),!1,et)),gu(a,r.x-n,r.y-h,o.x-n,o.y-h,s.x-n,s.y-h);else{for((r=pt.alloc()).assign(this.i(0)),(o=pt.alloc()).assign(r),s=this.computeCorner(),c=1,l=0;c=i-1){if(r.D(u)){if(0===l)for(c=1;cr.x?f.x-p:f.x+p,v=y.y>f.y?f.y+x:f.y-x,Oc(this,a,c,m,r,y=pt.allocAt(b,w),g),pt.free(y),mu(a,f.x+c,f.y+m,d+c,v+m),r.h(d,v)}else Xi.B(r.x,f.x)&&Xi.B(f.y,y.y)?(p=Math.min(s,Math.abs(f.y-o.y)/2),p=x=Math.min(p,Math.abs(y.x-f.x)/2),Xi.B(x,0)?(Oc(this,a,c,m,r,f,g),r.assign(f)):(d=b=f.x,v=w=f.y,w=f.y>r.y?f.y-p:f.y+p,d=y.x>f.x?f.x+x:f.x-x,Oc(this,a,c,m,r,y=pt.allocAt(b,w),g),pt.free(y),mu(a,f.x+c,f.y+m,d+c,v+m),r.h(d,v))):(Oc(this,a,c,m,r,f,g),r.assign(f));o.assign(u),c=l}pt.free(r)}xu=a}else(a=this.i(1).copy()).x-=n,a.y-=h,0!==this.computeShortLength(!0)&&(o=Dc(this,o,!0,r)),0!==this.computeShortLength(!1)&&(a=Dc(this,a,!1,r)),t.type=Ui.j,t.startX=o.x,t.startY=o.y,t.endX=a.x,t.endY=a.y;return this.lk=!0,t},wc.prototype.computeJumpLength=function(){return 10},wc.prototype.Xo=function(t){var i=this.layer;if(null!==i&&i.visible&&!i.isTemporary){var e=i.diagram;if(null!==e&&!e.animationManager.isTicking){var n=!1;for(e=e.layers;e.next();){var o=e.value;if(o.visible)if(o===i){n=!0;for(var r=!1,s=(o=o.Pa.s).length,a=0;at&&M(t,">= 0",wc,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=t,this.g("fromEndSegmentLength",i,t),this.bb())}},fromShortLength:{get:function(){return null!==this.ba?this.ba.Wi:NaN},set:function(t){var i=this.fromShortLength;i!==t&&(this.Xc(),this.ba.Wi=t,this.qc(),this.g("fromShortLength",i,t))}},toSpot:{get:function(){return null!==this.ba?this.ba.yj:Si},set:function(t){var i=this.toSpot;i.D(t)||(t=t.J(),this.Xc(),this.ba.yj=t,this.g("toSpot",i,t),(i.$c()||t.$c())&&null!==this.toNode&&tc(this.toPort),this.bb())}},toEndSegmentLength:{get:function(){return null!==this.ba?this.ba.wj:NaN},set:function(t){var i=this.toEndSegmentLength;i!==t&&(0>t&&M(t,">= 0",wc,"toEndSegmentLength"),this.Xc(),this.ba.wj=t,this.g("toEndSegmentLength",i,t),this.bb())}},toShortLength:{get:function(){return null!==this.ba?this.ba.xj:NaN},set:function(t){var i=this.toShortLength;i!==t&&(this.Xc(),this.ba.xj=t,this.qc(),this.g("toShortLength",i,t))}},isLabeledLink:{get:function(){return null!==this.wd&&0=n&&(r=n-1);var a=this.i(r-1),h=this.i(r);Xi.Dl(o.x,o.y,s.x,s.y,a.x,a.y,h.x,h.y,.5,t),i=Math.min(h.x,i),e=Math.min(h.y,e),o=h}else for(o=this.i(0),r=this.i(1),i=Math.min(o.x,r.x),e=Math.min(o.y,r.y),t.h(o.x,o.y,0,0),t.Ye(r),o=2;o(n=o.y-n.y)&&(n=-n):Xi.$(n.y,o.y)?0>(n=o.x-n.x)&&(n=-n):n=Math.sqrt(n.Bf(o)),t.push(n)}}return this.cq}},flattenedTotalLength:{get:function(){var t=this.vt;if(isNaN(t)){for(var i=this.flattenedLengths,e=i.length,n=t=0;nthis.pointsCount)return this.lk=!0,this.ua;this.ua=this.makeGeometry()}return this.ua}},firstPickIndex:{get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!Tc(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var t=this.pointsCount;return 0===t?0:2>=t?t-1:this.isOrthogonal||!Tc(this.computeSpot(!1))?t-2:t-1}},adjusting:{get:function(){return this.qk},set:function(t){var i=this.qk;i!==t&&(this.qk=t,this.g("adjusting",i,t))}},corner:{get:function(){return this.Om},set:function(t){var i=this.Om;i!==t&&(this.Om=t,this.qc(),this.g("corner",i,t))}},curve:{get:function(){return this.Qm},set:function(t){var i=this.Qm;i!==t&&(this.Qm=t,this.bb(),this.qc(),Rc(this,i===Zc||i===_c||t===Zc||t===_c),this.g("curve",i,t))}},curviness:{get:function(){return this.Rm},set:function(t){var i=this.Rm;i!==t&&(this.Rm=t,this.bb(),this.qc(),this.g("curviness",i,t))}},routing:{get:function(){return this.qj},set:function(t){var i=this.qj;i!==t&&(this.qj=t,this.Wf=null,this.bb(),Rc(this,2==(2&i.value)||2==(2&t.value)),this.g("routing",i,t))}},smoothness:{get:function(){return this.po},set:function(t){var i=this.po;i!==t&&(this.po=t,this.qc(),this.g("smoothness",i,t))}},key:{get:function(){var t=this.diagram;if(null!==t&&t.model.ri())return t.model.Ac(this.data)}}}),wc.prototype.invalidateOtherJumpOvers=wc.prototype.Xo,wc.prototype.findClosestSegment=wc.prototype.ez,wc.prototype.updateRoute=wc.prototype.vg,wc.prototype.invalidateRoute=wc.prototype.bb,wc.prototype.rollbackRoute=wc.prototype.rv,wc.prototype.commitRoute=wc.prototype.zf,wc.prototype.startRoute=wc.prototype.uh,wc.prototype.clearPoints=wc.prototype.Fj,wc.prototype.removePoint=wc.prototype.pv,wc.prototype.addPointAt=wc.prototype.yf,wc.prototype.addPoint=wc.prototype.ne,wc.prototype.insertPointAt=wc.prototype.m,wc.prototype.insertPoint=wc.prototype.Kz,wc.prototype.setPointAt=wc.prototype.L,wc.prototype.setPoint=wc.prototype.dd,wc.prototype.getPoint=wc.prototype.i,wc.prototype.getOtherPort=wc.prototype.Cz,wc.prototype.getOtherNode=wc.prototype.To;var Gc=null,Xc=null,Uc=new V(wc,"Normal",1),qc=new V(wc,"Orthogonal",2),Kc=new V(wc,"AvoidsNodes",6),Hc=new V(wc,"AvoidsNodesStraight",7),Wc=new V(wc,"None",0),Jc=new V(wc,"Bezier",9),Zc=new V(wc,"JumpGap",10),_c=new V(wc,"JumpOver",11),$c=new V(wc,"End",17),Qc=new V(wc,"Scale",18),tf=new V(wc,"Stretch",19),ef=new V(wc,"OrientAlong",21),nf=new V(wc,"OrientPlus90",22),of=new V(wc,"OrientMinus90",23),rf=new V(wc,"OrientOpposite",24),sf=new V(wc,"OrientUpright",25),af=new V(wc,"OrientPlus90Upright",26),hf=new V(wc,"OrientMinus90Upright",27),lf=new V(wc,"OrientUpright45",28),uf=16,cf=14,ff=8;function df(t,i,e,n){Q(this),this.Fe=this.qq=!1,this.Ds=t,this.Ox=i,this.cv=e,this.Px=n,this.links=[]}function pf(t){Q(this),this.Yx=this.group=null,this.vs=!0,this.abort=!1,this.Od=this.Nd=1,this.Fn=this.En=-1,this.rc=t.width,this.sc=t.height,this.ac=null,this.ei=this.di=0,this.Os=11,this.Ix=this.Hx=22}function gf(t,i,e){return t.Nd<=i&&i<=t.En&&t.Od<=e&&e<=t.Fn}function mf(t,i,e){return gf(t,i,e)?(i-=t.Nd,i/=t.rc,e-=t.Od,e/=t.sc,t.ac[0|i][0|e]):Pf}function yf(t){if(null!==t.ac)for(var i=0;i<=t.di;i++)for(var e=t.ac[i],n=0;n<=t.ei;n++)e[n]>=Sf&&(e[n]=Pf)}function vf(t,i,e,n,o,r,s,a,h){if(!(is||eh)){var l=0|i,u=0|e,c=t.ac[l][u];if(c>=Sf&&c=t.ac[l][u]);)t.ac[l][u]=c,c+=1,o?u+=n:l+=n;if(l=o?u:l,o)if(0l;e+=n)vf(t,i,e,1,!o,r,s,a,h),vf(t,i,e,-1,!o,r,s,a,h);else if(0l;i+=n)vf(t,i,e,1,!o,r,s,a,h),vf(t,i,e,-1,!o,r,s,a,h)}}function xf(t,i,e,n,o,r,s,a,h){i|=0,e|=0;var l=Mf,u=Sf;for(t.ac[i][e]=u;l===Mf&&i>r&&ia&&er&&ia&&e=Math.abs(a-l)&&1>=Math.abs(h-u))t.abort=!0;else{var c=r.x;n=r.y,i=r.x+r.width;var f=r.y+r.height;c-=t.Nd,c/=t.rc,n-=t.Od,n/=t.sc,i-=t.Nd,i/=t.rc,f-=t.Od,f/=t.sc,r=Math.max(0,Math.min(t.di,0|c)),i=Math.min(t.di,Math.max(0,0|i)),c=Math.max(0,Math.min(t.ei,0|n)),f=Math.min(t.ei,Math.max(0,0|f)),h|=0,l|=0,u|=0;var d=0===e||90===e?1:-1;if(e=90===e||270===e,(n=t.ac)[a|=0][h]===Mf?(xf(t,a,h,d,e,r,i,c,f),xf(t,a,h,1,!e,r,i,c,f),xf(t,a,h,-1,!e,r,i,c,f)):xf(t,a,h,d,e,a,h,a,h),n[l][u]===Mf?(bf(t,l,u,0===o||90===o?1:-1,90===o||270===o,r,i,c,f),bf(t,l,u,1,!(90===o||270===o),r,i,c,f),bf(t,l,u,-1,!(90===o||270===o),r,i,c,f)):bf(t,l,u,d,e,l,u,l,u),e=A(),s&&kf(t,l,u,o,a,h,e))for(e[0]===l&&e[1]===u||(e.unshift(u),e.unshift(l)),e[e.length-2]===a&&e[e.length-1]===h||(e.push(a),e.push(h)),t=Sf,o=e[e.length-2],s=e[e.length-1],n[o][s]=t++,r=e.length-4;0<=r;r-=2)for(o=e[r+2],s=e[r+3],i=e[r],l=e[r+1];i>o?o++:is?s++:lo))break;u--}else{if(!(c>r))break;c--}var f=a[u][c];if(0===f||f===Cf)break;h=u,l=c}for(;;){if(u=n,c=h,f=l,0===n?fr&&(u=270,f--):90===n?co&&(u=180,c--):180===n?fr&&(u=270,f--):co&&(u=180,c--),c=a[c][f],u!==n&&0!==c&&c!==Cf){if(s.push(h),s.push(l),kf(t,h,l,u,o,r,s))return!0;s.pop(),s.pop()}if(a[h][l]=Cf,0===n){if(h===i)return!1;h--}else if(90===n){if(l===e)return!1;l--}else if(180===n){if(h===i)return!1;h++}else{if(l===e)return!1;l++}}}wc.className="Link",wc.Normal=Uc,wc.Orthogonal=qc,wc.AvoidsNodes=Kc,wc.AvoidsNodesStraight=Hc,wc.None=Wc,wc.Bezier=Jc,wc.JumpGap=Zc,wc.JumpOver=_c,wc.End=$c,wc.Scale=Qc,wc.Stretch=tf,wc.OrientAlong=ef,wc.OrientPlus90=nf,wc.OrientMinus90=of,wc.OrientOpposite=rf,wc.OrientUpright=sf,wc.OrientPlus90Upright=af,wc.OrientMinus90Upright=hf,wc.OrientUpright45=lf,wc.EndSegmentStep=8,wc.CurvinessStart=uf,wc.SpacingMin=cf,wc.OrthoShortCut=ff,df.prototype.Sl=function(){if(!this.qq){var t=this.links;0=t.width||0>=t.height)){var i=t.y,e=t.x+t.width,n=t.y+t.height;if(this.Nd=Math.floor((t.x-this.rc)/this.rc)*this.rc,this.Od=Math.floor((i-this.sc)/this.sc)*this.sc,this.En=Math.ceil((e+2*this.rc)/this.rc)*this.rc,this.Fn=Math.ceil((n+2*this.sc)/this.sc)*this.sc,t=1+(0|Math.ceil((this.En-this.Nd)/this.rc)),i=1+(0|Math.ceil((this.Fn-this.Od)/this.sc)),null===this.ac||this.dithis.En||t+ethis.Fn||i+nt&&(e+=t,t=0),0>i&&(o+=i,i=0),0>e||0>o)return!0;for(n=0|Math.min(t+e-1,this.di),e=0|Math.min(i+o-1,this.ei);t<=n;t++){o=this.ac[t];for(var r=i;r<=e;r++)if(o[r]===Mf)return!1}return!0},f.Object.defineProperties(pf.prototype,{bounds:{get:function(){return new Bt(this.Nd,this.Od,this.En-this.Nd,this.Fn-this.Od)}},Ho:{get:function(){return this.rc},set:function(t){0=e?180:0}switch(t=180*Math.atan2(t.height,t.width)/Math.PI,i){case 3:return e>t&&e<=180+t?180:270;case 5:return e>180-t&&e<=360-t?270:0;case 12:return e>t&&e<=180+t?90:0;case 10:return e>180-t&&e<=360-t?180:90;case 7:return 90180+t&&e<=360-t?270:0;case 13:return 180t&&180>=e?90:0;case 14:return e>t&&e<=180-t?90:e>180-t&&270>=e?180:0;case 11:return e>180-t&&e<=180+t?180:e>180+t?270:90}return n&&15!==i&&(0>(e-=15)&&(e+=360)),e>t&&e<180-t?90:e>=180-t&&e<=180+t?180:e>180+t&&e<360-t?270:0}function Af(t,i){var e=t.pe;if(0===e.length){t:if(!t.ap){e=t.ap,t.ap=!0;var n=null,o=t.node,r=o instanceof gc?o:null;if(null===r||r.isSubGraphExpanded)var s=o.isTreeExpanded?o.findLinksConnected(t.port.portId):o.qx();else{if(!r.actualBounds.w()){t.ap=e;break t}s=(n=r).Lu()}r=t.pe.length=0;var a=t.port.ga(ti,pt.alloc()),h=t.port.ga(hi,pt.alloc());for((o=Bt.allocAt(a.x,a.y,0,0)).Ye(h),pt.free(a),pt.free(h),a=pt.allocAt(o.x+o.width/2,o.y+o.height/2),h=t.port.li(),s=s.iterator;s.next();){var l=s.value;if(l.isVisible()&&l.fromPort!==l.toPort){var u=l.fromPort===t.port||null!==l.fromNode&&l.fromNode.Td(n),c=l.computeSpot(u,t.port);if(c.$c()&&null!==(u=u?l.toPort:l.fromPort)){var f=u.part;if(null!==f){var d=f.findVisibleNode();null!==d&&d!==f&&(u=(f=d).port),u=l.computeOtherPoint(f,u),f=a.ab(u),0>(f-=h)?f+=360:360<=f&&(f-=360),0===(c=Lf(o,c,f,l.isOrthogonal))?(c=4,180f&&(f+=360)),void 0===(d=t.pe[r])?(d=new jf(l,f,c),t.pe[r]=d):(d.link=l,d.angle=f,d.Nc=c),d.hv.set(u),r++}}}}for(pt.free(a),t.pe.sort(Tf.prototype.j),h=t.pe.length,n=-1,r=a=0;rMath.abs(g)?(v=Math.abs(g)/f,f=Math.abs(g)):v=1;break;case 2:d>Math.abs(x)?(v=Math.abs(x)/d,d=Math.abs(x)):v=1;break;case 1:c>Math.abs(g)?(v=Math.abs(g)/c,c=Math.abs(g)):v=1;break;default:u>Math.abs(x)?(v=Math.abs(x)/u,u=Math.abs(x)):v=1}y=0}var k=b.Zo;if(n===pc){switch(b=b.link.computeThickness(),b*=v,k.set(w),p){case 8:k.x=w.x+g/2+f/2-y-b/2;break;case 2:k.y=w.y+x/2+d/2-y-b/2;break;case 1:k.x=w.x+g/2-c/2+y+b/2;break;default:k.y=w.y+x/2-u/2+y+b/2}y+=b}else{var M=.5;n===dc&&(M=(b.Uo+1)/(b.Gl+1)),k.x=w.x+g*M,k.y=w.y+x*M}}}for(pt.free(a),pt.free(h),pt.free(s),pt.free(l),w=t.pe,r=0;ri?1:0:1:null!==i?-1:0}function Gf(t){Q(this),this.nb=t,this.qd=this.kd=this.$k=this.ub=null}function Xf(t){Ff.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new At(NaN,NaN).freeze(),this.tf=new At(10,10).freeze(),this.Jb=Kf,this.Rb=Hf,this.nd=_f,this.hd=Uf,t&&Object.assign(this,t)}function Uf(t,i){return(t=t.text)<(i=i.text)?-1:t>i?1:0}pf.className="PositionArray",Tf.prototype.toString=function(){for(var t=this.pe,i=this.node.toString()+" "+t.length.toString()+":",e=0;ei.Nc?1:t.anglei.angle?1:0},Tf.prototype.computeEndSegmentLength=function(t){var i=t.link,e=i.computeEndSegmentLength(this.node,this.port,Qt,i.fromPort===this.port),n=t.Uo;if(0>n)return e;var o=t.Gl;if(1>=o||!i.isOrthogonal)return e;i=t.hv;var r=t.Zo;return 2!==t.Nc&&8!==t.Nc||(n=o-1-n),((t=2===t.Nc||4===t.Nc)?i.y=i-1?(r=0,n=e,o+=s+20,s=0):r++}},Ff.prototype.doMinimalNetworkLayout=function(){var t=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var i=this.arrangementOrigin.x,e=i,n=this.arrangementOrigin.y,o=0,r=0,s=this.network.vertexes.iterator;s.next();){var a=s.value.node;if(!(null===a||a instanceof wc)&&(Bf(a),this.rh(a))){var h=a.measuredBounds,l=h.width;h=h.height,a.moveTo(e,n),a instanceof gc&&(a.rh=!1),e+=Math.max(l,50)+20,r=Math.max(r,Math.max(h,50)),o>=t-1?(o=0,e=i,n+=r+20,r=0):o++}}},Ff.prototype.rh=function(t){return!(t.location.w()&&!(t instanceof gc&&t.rh))},Ff.prototype.ni=function(t,i){var e=this.boundsComputation;return null!==e?(i||(i=new Bt),e(t,this,i)):i?(i.set(t.actualBounds),i):t.actualBounds},Ff.prototype.ex=function(t){var i=new $;return t instanceof To?(Df(this,i,t.nodes,!0,null,!0,!0,!0),Df(this,i,t.links,!0,null,!0,!0,!0),Df(this,i,t.parts,!0,null,!0,!0,!0)):Df(this,i,t instanceof gc?t.memberParts:t.iterator,!1,null,!0,!0,!0),i},Ff.prototype.initialOrigin=function(t){var i=this.group;if(null!==i){var e=i.position.copy();return(isNaN(e.x)||isNaN(e.y))&&e.set(t),null!==(i=i.placeholder)&&(e=i.ga(ti),(isNaN(e.x)||isNaN(e.y))&&e.set(t),t=i.padding,e.x+=t.left,e.y+=t.top),e}return t},f.Object.defineProperties(Ff.prototype,{diagram:{get:function(){return this.H},set:function(t){this.H=t}},group:{get:function(){return this.o},set:function(t){this.o!==t&&(this.o=t,null!==t&&(this.H=t.diagram))}},isOngoing:{get:function(){return this.sn},set:function(t){this.sn!==t&&(this.sn=t)}},isInitial:{get:function(){return this.Gh},set:function(t){this.Gh=t,t||(this.xn=!0)}},isViewportSized:{get:function(){return this.yn},set:function(t){this.yn!==t&&(this.yn=t)&&this.C()}},isRouting:{get:function(){return this.vn},set:function(t){this.vn!==t&&(this.vn=t)}},isRealtime:{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t)}},isValidLayout:{get:function(){return this.xn},set:function(t){this.xn!==t&&(this.xn=t,t||null!==(t=this.diagram)&&(t.xh=!0))}},network:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,null!==t&&(t.layout=this))}},boundsComputation:{get:function(){return this.Em},set:function(t){this.Em!==t&&(this.Em=t,this.C())}},arrangementOrigin:{get:function(){return this.Am},set:function(t){this.Am.D(t)||(this.Am.assign(t),this.C())}}}),Ff.prototype.collectParts=Ff.prototype.ex,Ff.prototype.getLayoutBounds=Ff.prototype.ni,Ff.prototype.invalidateLayout=Ff.prototype.C,Ff.className="Layout",Of.prototype.clear=function(){if(this.wf)for(var t=this.wf.iterator;t.next();)t.value.clear();if(this.ye)for(t=this.ye.iterator;t.next();)t.value.clear();this.wf=new $,this.ye=new $,this.Es=new dt,this.zs=new dt},Of.prototype.toString=function(t){void 0===t&&(t=0);var i="LayoutNetwork"+(null!==this.layout?"("+this.layout.toString()+")":"");if(0>=t)return i;if(i+=" vertexes: "+this.wf.count+" edges: "+this.ye.count,1=r&&0>=s&&(r=1),i=this.spacing.width,isFinite(i)||(i=0),e=this.spacing.height,isFinite(e)||(e=0),null!==t&&t.Ea("Layout"),n=[],this.alignment){case qf:var a=i,h=e,l=Bt.alloc(),u=Math.max(this.cellSize.width,1);if(!isFinite(u))for(var c=u=0;cr-1||0s)&&(n.push(new Bt(0,g,s+a,y)),m=0,p=d,g+=y,y=0),y=Math.max(y,k),f===Wf)b=-b.width;else b=0;if(x.moveTo(p+b,g),f===Wf)p-=w;else p+=w;m++}n.push(new Bt(0,g,s+a,y)),Bt.free(l);break;case Kf:for(h=s,u=r,c=i,f=e,s=Bt.alloc(),d=Math.max(this.cellSize.width,1),r=g=l=0,a=pt.alloc(),p=0;p=l&&(h-=l),l=x=0,w=Math.max(this.cellSize.height,1),b=r=0,k=!0,m=pt.alloc(),M=0;Mu-1||0h){for(n.push(new Bt(0,k?v-r:v,h+c,b+r+f)),S=0;Sl&&(r.width+=r.x-l,r.x=l);Bt.free(s)}for(a=r=s=o=0;ac)){var g=c+Jh(p);p.pc(g,!0),$h(p,g,c)}}i.isModified=!0}}finally{i.aa=!0}}}}},Qf.prototype.updateAllTargetBindings=function(t){void 0===t&&(t="");for(var i=this.parts.iterator;i.next();)i.value.La(t);for(i=this.nodes.iterator;i.next();)i.value.La(t);for(i=this.links.iterator;i.next();)i.value.La(t)},Qf.prototype.rp=function(){for(var t=this.H.model,i=new $,e=t.nodeDataArray,n=0;n=n)return"[]";var o=new G;o.add("["),e&&1n)return;L(t.Tc,n)}Cd(t,"nodeDataArray",pe,"nodeDataArray",t,i,null,n,null),t.qp(i)}function jd(t,i,e){if(void 0!==i){var n=t.Vf.I(i);null===n&&(n=new $,t.Vf.add(i,n)),n.add(e)}}function Fd(t,i,e){if(void 0!==i){var n=t.Vf.I(i);n instanceof $&&(null==e?t.Vf.remove(i):(n.remove(e),0===n.count&&t.Vf.remove(i)))}}function Dd(t,i){return void 0===i?null:(t=t.Vf.I(i))instanceof $?t:null}function Bd(t,i,e){if(t.copiesArrays&&Array.isArray(i)){var n=[];for(e=0;ei&&(i=t.length),T(t,i,e),Cd(this,"",de,"",t,null,e,null,i)},i.ov=function(t,i){void 0===i&&(i=-1),t===this.Tc&&w("Model.removeArrayItem should not be called on the Model.nodeDataArray"),-1===i&&(i=t.length-1);var e=t[i];L(t,i),Cd(this,"",pe,"",t,e,null,i,null)},i.Ro=function(t){if(null===t)return"";var i=this.lj;return""===i||void 0===(i=Rd(t,i))?"":"string"==typeof i?i:void w("getCategoryForNodeData found a non-string category for "+t+": "+i)},i.jm=function(t,i){if(null!==t){var e=this.lj;if(""!==e)if(this.lb(t)){var n=Rd(t,e);void 0===n&&(n=""),n!==i&&(Ed(t,e,i),Cd(this,"nodeCategory",fe,e,t,n,i))}else Ed(t,e,i)}},i.lm=function(t,i){this.jm(i,this.Ro(t))},i.Tl=function(){return!1},i.Wj=function(){return!1},i.ri=function(){return!1},i.xs=function(){return!1},i.Xj=function(){return!1},f.Object.defineProperties(md.prototype,{name:{get:function(){return this.xa},set:function(t){var i=this.xa;i!==t&&(this.xa=t,this.g("name",i,t))}},dataFormat:{get:function(){return this.Sm},set:function(t){var i=this.Sm;i!==t&&(this.Sm=t,this.g("dataFormat",i,t))}},isReadOnly:{get:function(){return this.Gg},set:function(t){var i=this.Gg;i!==t&&(this.Gg=t,this.g("isReadOnly",i,t))}},modelData:{get:function(){return this.j},set:function(t){var i=this.j;i!==t&&(this.j=t,this.g("modelData",i,t),this.La(t))}},undoManager:{get:function(){return this.o},set:function(t){var i=this.o;i!==t&&(null!==i&&i.Rx(this),this.o=t,null!==t&&t.Xw(this))}},skipsUndoManager:{get:function(){return this.Wg},set:function(t){this.Wg=t}},nodeKeyProperty:{get:function(){return this.Th},set:function(t){var i=this.Th;i!==t&&(""===t&&w("Model.nodeKeyProperty may not be the empty string"),0(n=t.md.indexOf(i)))return;t.md.splice(n,1)}if(Cd(t,"linkDataArray",pe,"linkDataArray",t,i,null,n,null),Fd(t,e=Jd(t,i,!0),i),Fd(t,e=Jd(t,i,!1),i),n=t.Ef(i),Array.isArray(n))for(var o=n.length,r=0;rn.indexOf(t.newValue)&&n.splice(e,0,t.newValue)))}else if(t.change===pe){if(e=t.oldParam,"linkDataArray"===t.modelChange)return void(N(t=t.oldValue)&&"number"==typeof e&&(n=this.Ac(t),i?(this.$f.add(t),this.md[e]!==t&&this.md.splice(e,0,t),void 0!==n&&this.wb.add(n,t)):(this.$f.remove(t),this.md[e]===t&&this.md.splice(e,1),void 0!==n&&this.wb.remove(n))));if("linkLabelKeys"===t.modelChange)return n=this.Ef(t.object),void(Array.isArray(n)&&"number"==typeof e&&(i?0>n.indexOf(t.newValue)&&n.splice(e,0,t.newValue):(e=n.indexOf(t.newValue),0<=e&&n.splice(e,1))))}md.prototype.changeState.call(this,t,i)}},(i=Hd.prototype).Vl=function(t){if(void 0!==t){var i=this.Ri;if(null!==i){var e=this.hc(t);null===e&&(Ed(e=this.copyNodeData(i),this.nodeKeyProperty,t),this.xf(e))}return t}},i.yx=function(t){return Jd(this,t,!0)},i.wv=function(t,i){Zd(this,t,i,!0)},i.Bx=function(t){return Jd(this,t,!1)},i.Bv=function(t,i){Zd(this,t,i,!1)},i.zx=function(t){return _d(this,t,!0)},i.xv=function(t,i){$d(this,t,i,!0)},i.Cx=function(t){return _d(this,t,!1)},i.Cv=function(t,i){$d(this,t,i,!1)},i.Ef=function(t){if(null===t)return np;var i=this.je;return""===i||void 0===(t=Rd(t,i))?np:t},i.Ls=function(t,i){if(null!==t){var e=this.je;if(""!==e)if(this.Jc(t)){var n=Rd(t,e);if(void 0===n&&(n=np),n!==i){if(Array.isArray(n))for(var o=n.length,r=0;ro||(n.splice(o,1),this.Jc(t)&&(Fd(this,i,t),Cd(this,"linkLabelKeys",pe,e,t,i,null,o,null)))}else void 0!==n&&w(e+" property is not an Array; cannot removeLabelKeyforLinkData: "+t)}}},i.Ac=function(t){if(null!==t){var i=this.Jh;if(""!==i&&void 0!==(i=Rd(t,i))){if(Td(i))return i;w("Key value for link data "+t+" is not a number or a string: "+i)}}},i.Ks=function(t,i){if(null!==t){var e=this.Jh;if(""!==e)if(this.Jc(t)){var n=Rd(t,e);n!==i&&null===this.jh(i)&&(Ed(t,e,i),void 0!==n&&this.wb.remove(n),this.wb.add(i,t),Cd(this,"linkKey",fe,e,t,n,i),"string"==typeof e&&this.La(t,e))}else Ed(t,e,i)}},i.jh=function(t){return null===t&&w("GraphLinksModel.findLinkDataForKey:key must not be null"),void 0!==t&&Td(t)?this.wb.I(t):null},i.Bs=function(t){if(null!==t){var i=this.Jh;if(""!==i){var e=this.Ac(t);if(void 0===e||this.wb.contains(e)){var n=this.cl;if(null!==n&&(null!=(e=n(this,t))&&!this.wb.contains(e)))return void Ed(t,i,e);if("string"==typeof e){for(n=2;this.wb.contains(e+n);)n++;Ed(t,i,e+n)}else if(void 0===e||"number"==typeof e){for(e=-this.wb.count-1;this.wb.contains(e);)e--;Ed(t,i,e)}}}}},i.Jc=function(t){return null!==t&&this.$f.contains(t)},i.fi=function(t){null!==t&&(tt(t),this.Jc(t)||Qd(this,t,!0))},i.Ey=function(t){if(Array.isArray(t))for(var i=t.length,e=0;ee){for(r=n+(o===wp?r:-r);0>r;)r+=360;180<(r%=360)&&(r-=360),r*=Math.PI/180,t.gt=r,cp(t,i,e,n,o)}else up(t,i,e,n,o);t.Xr.commit(i)}function up(t,i,e,n,o){var r=t.lc,s=t.Ti,a=t.Zm,h=r*Math.cos(n*Math.PI/180),l=t.me*Math.sin(n*Math.PI/180),u=i.Fa();if(3===u.length)u[0].centerX=r,u[0].centerY=0,u[1].centerX=u[0].centerX-u[0].width/2-u[1].width/2-s,u[1].y=u[0].y,u[2].centerX=(u[0].centerX+u[1].centerX)/2,u[2].y=u[0].y-u[2].height-s;else if(4===u.length)u[0].centerX=r,u[0].centerY=0,u[2].centerX=-u[0].centerX,u[2].centerY=u[0].centerY,u[1].centerX=0,u[1].y=Math.min(u[0].y,u[2].y)-u[1].height-s,u[3].centerX=0,u[3].y=Math.max(u[0].y+u[0].height+s,u[2].y+u[2].height+s);else{r=pt.alloc();for(var c=0;c=u.length-1));c++)fp(t,h,l,u,c,o,r)||dp(t,h,l,u,c,o,r),h=r.x,l=r.y;if(pt.free(r),t.mj++,!(23Math.abs(d)?Math.abs(h-r)<(u[0].width+u[u.length-1].width)/2&&(s=0):s=0Math.abs(f)?0:f,h=Math.abs(r)>Math.abs(c)?0c:0t.mj?t.lc-s/(2*Math.PI):5>u.length&&10=c.length-1));f++)fp(t,h,l,c,f,o,u)||dp(t,h,l,c,f,o,u),h=u.x,l=u.y;if(pt.free(u),t.mj++,!(23t.mj?t.lc-r/(2*Math.PI):t.lc-(0a){if((r=i-t)<-a)return s.x=r,s.y=l,!1;u=!0}}else if((r=i-t)<-a){if((r=i+t)>a)return s.x=r,s.y=l,!1;u=!0}return l=Math.sqrt(1-Math.min(1,r*r/(a*a)))*h,0>e!==u&&(l=-l),Math.abs(e-l)>(n[o].height+n[o+1].height)/2?(s.x=r,s.y=l,!1):(s.x=r,s.y=l,!0)}function dp(t,i,e,n,o,r,s){var a=t.lc,h=t.me,l=0;if(t=(n[o].height+n[o+1].height)/2+t.Ti,n=!1,0<=i!=(r===wp)){if((r=e-t)<-h){if((r=e+t)>h)return s.x=l,void(s.y=r);n=!0}}else if((r=e+t)>h){if((r=e-t)<-h)return s.x=l,void(s.y=r);n=!0}l=Math.sqrt(1-Math.min(1,r*r/(h*h)))*a,0>i!==n&&(l=-l),s.x=l,s.y=r}function pp(t,i,e,n,o){var r=t.ty;if(.001>Math.abs(t.Zm-1))return void 0!==n&&void 0!==o?o*i:2*Math.PI*i;t=i>e?Math.sqrt(i*i-e*e)/i:Math.sqrt(e*e-i*i)/e;for(var s=0,a=void 0!==n&&void 0!==o?o/(r+1):Math.PI/(2*(r+1)),h=0,l=0;l<=r;l++){h=void 0!==n&&void 0!==o?n+l*o/r:l*Math.PI/(2*r);var u=Math.sin(h);s+=Math.sqrt(1-t*t*u*u)*a}return void 0!==n&&void 0!==o?(i>e?i:e)*s:4*(i>e?i:e)*s}function gp(t,i,e,n,o){return i/(void 0!==n&&void 0!==o?pp(t,1,e,n,o):pp(t,1,e))}function mp(t,i,e,n,o){if(.001>Math.abs(t.Zm-1))return o/i;var r=i>e?Math.sqrt(i*i-e*e)/i:Math.sqrt(e*e-i*i)/e,s=0;t=2*Math.PI/(700*t.network.vertexes.count),i>e&&(n+=Math.PI/2);for(var a=0;;a++){var h=Math.sin(n+a*t);if((s+=(i>e?i:e)*Math.sqrt(1-r*r*h*h)*t)>=o)return a*t}}Hd.className="GraphLinksModel",Yd.GraphLinksModel=Hd,md.constructGraphLinksModel=md.constructGraphLinksModel=function(){return new Hd},md.initDiagramModel=Od=function(){return new Hd},c(op,md),op.constructGraphLinksModel=md.constructGraphLinksModel,op.prototype.cloneProtected=function(t){md.prototype.cloneProtected.call(this,t),t.Ke=this.Ke,t.Nm=this.Nm,t.nj=this.nj},(i=op.prototype).toString=function(t){if(void 0===t&&(t=0),2<=t)return this.np();var i=(""!==this.name?this.name:"")+" TreeModel";if(0=(t=this.network.vertexes).count)1===t.count&&((t=t.first()).centerX=0,t.centerY=0);else{var i=new Z;i.addAll(t.iterator),t=new Z;var e,n,o=new Z,r=this.sort(i),s=this.Jp,a=this.arrangement,h=this.nodeDiameterFormula,l=this.radius;(!isFinite(l)||0>=l)&&(l=NaN);var u=this.aspectRatio;(!isFinite(u)||0>=u)&&(u=1);var c=this.startAngle;isFinite(c)||(c=0);var f=this.sweepAngle;if((!isFinite(f)||360f)&&(f=360),i=this.spacing,isFinite(i)||(i=NaN),a===bp&&h===jp?a=yp:a===bp&&h!==jp&&(a=this.arrangement),(this.direction===Mp||this.direction===Sp)&&this.sorting!==Lp){for(h=0;!(h>=r.length)&&(t.add(r.M(h)),!(h+1>=r.length));h+=2)o.add(r.M(h+1));this.direction===Mp?(this.arrangement===bp&&t.reverse(),(r=new Z).addAll(t),r.addAll(o)):(this.arrangement===bp&&o.reverse(),(r=new Z).addAll(o),r.addAll(t))}h=r.length;for(var d=n=e=0;df&&(0===d||d===r.length-1)&&(g/=2),e+=g,n++}if(isNaN(l)||a===bp){if(isNaN(i)&&(i=6),a!==yp&&a!==bp){for(n=-1/0,s=0;sl?n=(l=e)*u:s=d/(360<=f?h:h-1)}if(this.kw=a,this.lc=l,this.Zm=u,this.lw=c,this.Wp=f,this.Ti=i,this.me=n,this.Jp=s,i=r,r=this.kw,a=this.lc,l=this.lw,u=this.Wp,c=this.Ti,f=this.me,h=this.Jp,this.direction!==Mp&&this.direction!==Sp||r!==bp)if(this.direction===Mp||this.direction===Sp){switch(s=0,r){case vp:s=180*mp(this,a,f,l,h)/Math.PI;break;case yp:h=i=0,null!==(s=t.first())&&(i=Op(s,Math.PI/2)),null!==(s=o.first())&&(h=Op(s,Math.PI/2)),s=180*mp(this,a,f,l,c+(i+h)/2)/Math.PI;break;case xp:s=u/i.length}if(this.direction===Mp){switch(r){case vp:hp(this,t,l,kp);break;case yp:ap(this,t,l,kp);break;case xp:sp(this,t,u/2,l,kp)}switch(r){case vp:hp(this,o,l+s,wp);break;case yp:ap(this,o,l+s,wp);break;case xp:sp(this,o,u/2,l+s,wp)}}else{switch(r){case vp:hp(this,o,l,kp);break;case yp:ap(this,o,l,kp);break;case xp:sp(this,o,u/2,l,kp)}switch(r){case vp:hp(this,t,l+s,wp);break;case yp:ap(this,t,l+s,wp);break;case xp:sp(this,t,u/2,l+s,wp)}}}else switch(r){case vp:hp(this,i,l,this.direction);break;case yp:ap(this,i,l,this.direction);break;case xp:sp(this,i,u,l,this.direction);break;case bp:lp(this,i,u,l,this.direction)}else lp(this,i,u,l-u/2,wp)}this.updateParts(),this.network=null,this.isValidLayout=!0},rp.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},rp.prototype.commitNodes=function(){var t=null!==this.group&&null!==this.group.placeholder&&this.group.isSubGraphExpanded,i=t?this.group.location.copy():null,e=this.actualCenter;t?e=new pt(0,0):(e.x=this.arrangementOrigin.x+this.lc,e.y=this.arrangementOrigin.y+this.me);for(var n=this.network.vertexes.iterator;n.next();){var o=n.value;o.x+=e.x,o.y+=e.y,o.commit()}t&&(this.group.Va(),t=this.group.position.copy(),e=this.group.location.copy(),i=i.re(e.re(t)),this.group.move(i),this.Zv=i.re(t))},rp.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()},rp.prototype.sort=function(t){switch(this.sorting){case Np:break;case Pp:t.reverse();break;case Cp:t.sort(this.comparer);break;case Tp:t.sort(this.comparer),t.reverse();break;case Lp:return this.ak(function(t){for(var i=[],e=0;eo&&(o=a,r=s)}else for(s=0;so&&(o=a,r=s);for(e.add(t.M(r)),i[r]=-1,s=(r=t.M(r)).sourceEdges;s.next();)0>(o=t.indexOf(s.value.fromVertex))||0<=i[o]&&i[o]++;for(r=r.destinationEdges;r.next();)0>(o=t.indexOf(r.value.toVertex))||0<=i[o]&&i[o]++}return e}(t));default:w("Invalid sorting type.")}return t},rp.prototype.ak=function(t){for(var i=[],e=0;ei[e].indexOf(o)&&i[e].push(o);for(n=n.sourceEdges;n.next();)(o=t.indexOf(n.value.fromVertex))!==e&&0>i[e].indexOf(o)&&i[e].push(o)}for(r=[],e=0;ei[e[p]].indexOf(e[p===e.length-1?0:p+1])&&d.push(p===e.length-1?0:p+1);if(0===d.length)for(p=0;pe.indexOf(k)||we.indexOf(k)||w=g?w+1:w)))=g&&w++,(x=r[a[v]])>=g&&x++,w>x&&(b=x,x=w,w=b),x-w<(e.length+2)/2==(w(d=e.indexOf(i[l][f]))||d===u||(c+=du?d-u:u-d)>s-p?1:-1);e.splice(0>c?u:u+1,0,h),n.splice(a,1),a--}else r=!1;if(r)break;e.push(n[0]),n.splice(0,1)}for(i=0;i=t?t:360,this.C())}},arrangement:{get:function(){return this.Rb},set:function(t){this.Rb===t||t!==bp&&t!==yp&&t!==vp&&t!==xp||(this.Rb=t,this.C())}},direction:{get:function(){return this.K},set:function(t){this.K===t||t!==wp&&t!==kp&&t!==Mp&&t!==Sp||(this.K=t,this.C())}},sorting:{get:function(){return this.nd},set:function(t){this.nd===t||t!==Np&&t!==Pp&&t!==Cp&&!Tp&&t!==Lp||(this.nd=t,this.C())}},comparer:{get:function(){return this.hd},set:function(t){this.hd!==t&&(this.hd=t,this.C())}},spacing:{get:function(){return this.tf},set:function(t){this.tf!==t&&(this.tf=t,this.C())}},nodeDiameterFormula:{get:function(){return this.Nn},set:function(t){this.Nn===t||t!==Ap&&t!==jp||(this.Nn=t,this.C())}},actualXRadius:{get:function(){return this.lc}},actualYRadius:{get:function(){return this.me}},actualSpacing:{get:function(){return this.Ti}},actualCenter:{get:function(){return this.Zv}}});var yp=new V(rp,"ConstantSpacing",0),vp=new V(rp,"ConstantDistance",1),xp=new V(rp,"ConstantAngle",2),bp=new V(rp,"Packed",3),wp=new V(rp,"Clockwise",4),kp=new V(rp,"Counterclockwise",5),Mp=new V(rp,"BidirectionalLeft",6),Sp=new V(rp,"BidirectionalRight",7),Np=new V(rp,"Forwards",8),Pp=new V(rp,"Reverse",9),Cp=new V(rp,"Ascending",10),Tp=new V(rp,"Descending",11),Lp=new V(rp,"Optimized",12),Ap=new V(rp,"Pythagorean",13),jp=new V(rp,"Circular",14);function Fp(){this.Pl=-1/0,this.tm=this.mk=null}function Dp(t){Of.call(this,t)}function Bp(t){Vf.call(this,t),this.u=this.Si=NaN}function Op(t,i){var e=t.network;if(null===e)return NaN;if(null===(e=e.layout))return NaN;if(e.arrangement===bp)if(e.nodeDiameterFormula===jp)t.Si=Math.max(t.width,t.height);else{if(e=Math.abs(Math.sin(i)),i=Math.abs(Math.cos(i)),0===e)return t.width;if(0===i)return t.height;t.Si=Math.min(t.height/e,t.width/i)}else t.Si=e.nodeDiameterFormula===jp?Math.max(t.width,t.height):Math.sqrt(t.width*t.width+t.height*t.height);return t.Si}function Ip(t){Gf.call(this,t)}function zp(t){Ff.call(this),this.ah=null,this.An=0,this.$d=new At(100,100).freeze(),this.Bm=!1,this.sf=!0,this.td=!1,this.dl=100,this.$m=1,this.Zf=1e3,this.In=10,this.fo=Math,this.Hk=.05,this.Gk=50,this.Ek=150,this.Fk=0,this.Vm=10,this.Um=5,t&&Object.assign(this,t)}function Rp(t,i,e){if(function(t,i){if(10t.network.vertexes.count)return!1;for(t.ah=t.network.vertexes.Fa(),(t=t.ah).sort((function(t,i){return null===t||null===i||t===i?0:i.Vd-t.Vd})),i=t.length-1;0<=i&&1>=t[i].Vd;)i--;return 1=(s=o.We.M(o.We.count-1).Rs-o.Vd))){for(var l=a=0,u=h.count-s;u(d=u*c)&&(d=1),s=((a=Xi.sqrt((a+d+l*l*4/(s*s))/d))-1)*u/2,a=(a-1)*c/2,o.bounds=new Bt(r-f.x-s,h-f.y-a,u+2*s,c+2*a),o.focus=new pt(f.x+s,f.y+a)}}return t.network=n,e}(t,i),r=Math.max(0,Math.max(Math.min(t.network.vertexes.count,e*(i+1)/11),10));for(t.maxIterations+=r,Rp(t,i+1,e),Gp(t,r),function(t,i){for(var e=t.network.vertexes.iterator;e.next();){var n=e.value;if(n.network=i,null!==n.We){var o=n.We.M(n.sv);n.Vd=o.Rs;var r=o.Sv,s=o.Tv;n.bounds=new Bt(n.centerX-r,n.centerY-s,o.Ss,o.Qs),n.focus=new pt(r,s),n.sv--}}for(e=t.network.edges.iterator;e.next();)e.value.network=i;t.network=i}(t,o),(i=o.vertexes.Fa()).sort((function(t,i){return null===t||null===i||t===i?0:i.Vd-t.Vd})),e=0;e=c.Vd?h++:(a=!0,l++,s+=Math.atan2(i.centerY-c.centerY,i.centerX-c.centerX))}if(0!==h)for(0>1)+l)*(0==a%2?1:-1),h.centerX=n+u*Math.cos(c),h.centerY=o+u*Math.sin(c),a++}}}function Vp(t,i,e,n,o,r,s){var a=9e19,h=-1,l=0;t:for(;lu.y&&t[f].x-u.xu.x&&t[f].y-u.yi+r?(e=n+o-s,t=t-i-r,Xi.sqrt(e*e+t*t)):t+es+a?t>i+r?(e=n-s-a,t=t-i-r,Xi.sqrt(e*e+t*t)):t+ei+r?t-(i+r):t+e=i.length)return!1;var e=i[0];e.forceX=0,e.forceY=0;for(var n=e.centerX,o=n,r=e=e.centerY,s=1;sr-e)?i.sort((function(t,i){return null===t||null===i||t===i?0:t.centerX-i.centerX})):i.sort((function(t,i){return null===t||null===i||t===i?0:t.centerY-i.centerY})),e=t.Zf;var l=n=a=0;for(r=0;re||l-h>e){if(o)break}else if(u-d>e||d-u>e){if(!o)break}else{var p=Yp(s,f);1>p?(null===(n=t.randomNumberGenerator)&&(t.randomNumberGenerator=n=new Wp),p=n.random(),a=n.random(),h>l?n=(1+(n=Math.abs(f.bounds.right-s.bounds.x)))*p:hd?l=(1+(l=Math.abs(f.bounds.bottom-s.bounds.y)))*a:h(c=Yp(e,r))?(null===(c=t.randomNumberGenerator)&&(t.randomNumberGenerator=c=new Wp),a=c.random(),c=c.random(),n=(n>h?1:-1)*(1+(r.width>e.width?r.width:e.width))*a,l=(s>u?1:-1)*(1+(r.height>e.height?r.height:e.height))*c):(n=(h-n)/c*(a=a.stiffness*(c-a.length)),l=(u-s)/c*a),e.forceX+=n,e.forceY+=l,r.forceX-=n,r.forceY-=l;for(o=n=0;ot.epsilonDistance*t.epsilonDistance}function Up(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}function qp(t){Of.call(this,t)}function Kp(t){Vf.call(this,t),this.ia=!1,this.Ha=this.u=NaN,this.sh=this.Vd=this.V=this.F=0,this.We=this.Hj=null,this.sv=0}function Hp(t){Gf.call(this,t),this.j=this.o=NaN}function Wp(){var t=0;void 0===t&&(t=42),this.seed=t,this.ay=48271,this.ey=2147483647,this.Q=44488.07041494893,this.gy=3399,this.by=1/2147483647,this.random()}function Jp(t){Ff.call(this),this.kc=this.ie=25,this.K=0,this.Dk=Fg,this.Zk=Og,this.Qk=Rg,this.bj=4,this.rk=Gg,this.bg=15,this.sf=!0,this.Cn=4,this.Ra=this.Iq=this.Ia=-1,this.Md=this.Hn=0,this.Ta=this.Kd=this.Ld=this.he=this.tc=null,this.Kn=0,this.Jn=this.kj=null,this.le=0,this.fl=null,this.Rf=new pt,this.He=[],this.He.length=100,this.xw=this.ve=0,t&&Object.assign(this,t)}function Zp(t){var i=t.fromVertex.node||t.fromVertex.data;return t=t.toVertex.node||t.toVertex.data,null===i&&null===t?8:null===i||null===t?4:1}function _p(t){null===t.kj&&(t.kj=[]);for(var i=0,e=t.network.vertexes.iterator;e.next();){var n=e.value;t.kj[i]=n.layer,i++,t.kj[i]=n.column,i++,t.kj[i]=n.index,i++}return t.kj}function $p(t,i){var e=0;for(t=t.network.vertexes.iterator;t.next();){var n=t.value;n.layer=i[e],e++,n.column=i[e],e++,n.index=i[e],e++}}function Qp(t,i,e){var n=Ag(t,i),o=t.tc[i];(null===t.Jn||t.Jn.lengths)for(var c=s+1;cl;c--)(f=n[c]).near===u&&f.Dj===u.Dj||h++;if(0<=e)for(l=n[s].sourceEdgesArrayAccess,u=0;ug||f===g&&d>p)&&h++,mf||g===f&&p>d)&&h++}}}if(0>=e)for(l=n[s].destinationEdgesArrayAccess,u=0;ug||f===g&&c>m)&&h++,pf||g===f&&m>c)&&h++);for(r[s*o+s]=h,l=s+1;l=e)for(h=n[s].destinationEdgesArrayAccess,x=n[l].destinationEdgesArrayAccess,u=0;u=e&&(h=a.sourceEdgesArrayAccess);var l=null;0<=e&&(l=a.destinationEdgesArrayAccess);var u=0,c=0,f=a.near;if(null!==f&&f.layer===a.layer&&(u+=f.column-1,c++),null!==h)for(f=0;f=e&&(h=a.sourceEdgesArrayAccess);var l=null;0<=e&&(l=a.destinationEdgesArrayAccess);var u=0,c=[],f=a.near;if(null!==f&&f.layer===a.layer&&(c[u]=f.column-1,u++),a=void 0,null!==h)for(f=0;f>1,r[s]=0!=(1&u)?c[l]:c[l-1]+c[l]>>1)}return jg(t,i,n),r}function ng(t,i,e,n,o,r){if(i.component===n){if(i.component=e,o)for(var s=i.destinationEdges;s.next();){var a=s.value,h=a.toVertex,l=i.layer-h.layer;l===(a=t.linkMinLength(a))&&ng(t,h,e,n,o,r)}if(r)for(s=i.sourceEdges;s.next();)(l=(h=(a=s.value).fromVertex).layer-i.layer)===(a=t.linkMinLength(a))&&ng(t,h,e,n,o,r)}}function og(t,i,e,n,o,r){if(i.component===n){if(i.component=e,o)for(var s=i.destinationEdges;s.next();)og(t,s.value.toVertex,e,n,o,r);if(r)for(i=i.sourceEdges;i.next();)og(t,i.value.fromVertex,e,n,o,r)}}function rg(t){for(t=t.vertexes.iterator;t.next();){var i=t.value;if(i.valid)return i}return null}function sg(t){for(t=t.vertexes.iterator;t.next();){var i=t.value;if(i.valid){for(var e=!0,n=i.destinationEdges;n.next();)if(n.value.toVertex.valid){e=!1;break}if(e)return i}}return null}function ag(t){for(t=t.vertexes.iterator;t.next();){var i=t.value;if(i.valid){for(var e=!0,n=i.sourceEdges;n.next();)if(n.value.fromVertex.valid){e=!1;break}if(e)return i}}return null}function hg(t,i){i.Ll=t.Kn,t.Kn++;for(var e=i.destinationEdges;e.next();){var n=e.value,o=n.toVertex;-1===o.Ll&&(n.forest=!0,hg(t,o))}i.finish=t.Kn,t.Kn++}function lg(t){for(var i=t.network.vertexes.iterator;i.next();){var e=ug(t,i.value);t.Ia=Math.max(e,t.Ia)}}function ug(t,i){var e=0;if(-1===i.layer){for(var n=i.destinationEdges;n.next();){var o=n.value,r=o.toVertex;o=t.linkMinLength(o),e=Math.max(e,ug(t,r)+o)}i.layer=e}else e=i.layer;return e}function cg(t,i){var e=0;if(-1===i.layer){for(var n=i.sourceEdges;n.next();){var o=n.value,r=o.fromVertex;o=t.linkMinLength(o),e=Math.max(e,cg(t,r)+o)}i.layer=e}else e=i.layer;return e}function fg(t,i){if(!i.valid){i.valid=!0;for(var e=i.destinationEdges;e.next();)fg(t,e.value.toVertex);for(e=t.network.vertexes.iterator;e.next();)e.value.component=-1;for(var n=i.sourceEdgesArrayAccess,o=n.length,r=0;rs&&ng(t,a,0,-1,!0,!1)}for(ng(t,i,1,-1,!0,!0);0!==i.component;){for(r=0,n=1/0,a=0,h=null,s=t.network.vertexes.iterator;s.next();){var l=s.value;if(1===l.component){var u=0,c=!1,f=l.sourceEdgesArrayAccess;o=f.length;for(var d=0;dr)&&!u&&(a=s,r=l)}if(0>n){for(e.reset();e.next();)1===(n=e.value).component&&(n.layer-=o);i.component=0}else a.component=0}}}function dg(t,i,e){return 90===t.K?e&&!i.rev||!e&&i.rev?270:90:180===t.K?e&&!i.rev||!e&&i.rev?0:180:270===t.K?e&&!i.rev||!e&&i.rev?90:270:e&&!i.rev||!e&&i.rev?180:0}function pg(t,i){var e=i.layer;for(i.index=t.tc[e],t.tc[e]++,i=i.destinationEdgesArrayAccess,e=!0;e;){e=!1;for(var n=0;nr.portFromColOffset&&(e=!0,i[n]=r,i[n+1]=o)}}for(e=0;er.portToColOffset&&(n=!0,i[e]=r,i[e+1]=o)}for(e=0;en+1&&(f+=4*(v-n),d+=4*(v-(n+1)))}for((b=o[n].destinationEdges.iterator).reset();b.next();)if(x=(v=b.value).toVertex,v.valid&&x.layer===i){for(v=0;o[v]!==x;)v++;v===n+1&&(d+=1)}for((b=o[n+1].sourceEdges.iterator).reset();b.next();)if(x=(v=b.value).fromVertex,v.valid&&x.layer===i){for(v=0;o[v]!==x;)v++;vn+1&&(f+=4*(v-(n+1)),d+=4*(v-n))}for((b=o[n+1].destinationEdges.iterator).reset();b.next();)if(x=(v=b.value).toVertex,v.valid&&x.layer===i){for(v=0;o[v]!==x;)v++;v===n&&(f+=1)}v=x=0,b=s[o[n].index];var w=a[o[n].index],k=s[o[n+1].index],M=a[o[n+1].index];-1!==b&&(x+=Math.abs(b-p),v+=Math.abs(b-y)),-1!==w&&(x+=Math.abs(w-p),v+=Math.abs(w-y)),-1!==k&&(x+=Math.abs(k-g),v+=Math.abs(k-m)),-1!==M&&(x+=Math.abs(M-g),v+=Math.abs(M-m)),(de)for(n=0;nn-1||u-o[n-1].column-1>c+t.nodeMinColumnSpace(o[n-1],!1)?u-1:u,c=n+1>=r||o[n+1].column-u-1>f+t.nodeMinColumnSpace(o[n+1],!0)?u+1:u;var p=f=0,g=0;if(0>=e)for(var m=o[n].sourceEdges.iterator;m.next();){var y=m.value,v=y.fromVertex;if(y.valid&&v.layer!==i){var x=Zp(y),b=y.portFromColOffset;y=y.portToColOffset,v=v.column,f+=(Math.abs(u+y-(v+b))+1)*x,p+=(Math.abs(d+y-(v+b))+1)*x,g+=(Math.abs(c+y-(v+b))+1)*x}}if(0<=e)for(m=o[n].destinationEdges.iterator;m.next();)v=(y=m.value).toVertex,y.valid&&v.layer!==i&&(x=Zp(y),b=y.portFromColOffset,y=y.portToColOffset,v=v.column,f+=(Math.abs(u+b-(v+y))+1)*x,p+=(Math.abs(d+b-(v+y))+1)*x,g+=(Math.abs(c+b-(v+y))+1)*x);y=b=x=0,m=s[o[n].index],v=a[o[n].index],-1!==m&&(x+=Math.abs(m-u),b+=Math.abs(m-d),y+=Math.abs(m-c)),-1!==v&&(x+=Math.abs(v-u),b+=Math.abs(v-d),y+=Math.abs(v-c)),p=s[e]?u=h:l<=s[e]&&(u=l));u!==a&&(r=!0,n[e].column=u)}jg(t,i,n),t.normalize()}function wg(t,i){for(var e=!0,n=t.network.vertexes.iterator;n.next();){var o=n.value,r=t.nodeMinColumnSpace(o,!0),s=t.nodeMinColumnSpace(o,!1);if(o.column-r<=i&&o.column+s>=i){e=!1;break}}if(t=!1,e)for(n.reset();n.next();)(e=n.value).column>i&&(--e.column,t=!0);return t}function kg(t,i){var e,n=i+1,o=[],r=[];for(e=0;e<=t.Ia;e++)o[e]=!1,r[e]=!1;for(var s=t.network.vertexes.iterator;s.next();){var a=(e=s.value).column-t.nodeMinColumnSpace(e,!0),h=e.column+t.nodeMinColumnSpace(e,!1);a<=i&&h>=i&&(o[e.layer]=!0),a<=n&&h>=n&&(r[e.layer]=!0)}for(a=!0,n=!1,e=0;e<=t.Ia;e++)a=a&&!(o[e]&&r[e]);if(a)for(s.reset();s.next();)(t=s.value).column>i&&(--t.column,n=!0);return n}function Mg(t,i){for(var e=0;e<=t.Ra;e++)for(;wg(t,e););for(t.normalize(),e=0;er?$p(t,o):si)for(e=t.Ra;0<=e;e--)for(o=_p(t),n=(r=tg(t))+1;rr?$p(t,o):se)for(n.reset();n.next();)(o=n.value).column+t.nodeMinColumnSpace(o,!1)>=i&&(o.component=t.le);for(t.le++,n.reset();n.next();)-1===(i=n.value).component&&(og(t,i,t.le,-1,!0,!0),t.le++);var r;for(i=[],r=0;re)for(s=t.Ra;0e)for(n.reset();n.next();)o[(e=n.value).component]&&(e.column+=1)}function Ng(t,i,e,n){for(var r=90===t.K||270===t.K,s=o(i),a=s.next();!a.done;a=s.next()){var h=o(a.value);for(a=h.next();!a.done;a=h.next())(a=a.value).sd=a,a.shift=1/0,a.zc=NaN,a.qg=0}for(a=90===t.K||270===t.K,h=(s=o(i)).next();!h.done;h=s.next())for(var l=(h=o(h.value)).next();!l.done;l=h.next())if((l=l.value).root===l){for(var u=0,c=l;c.align!==l;){var f=c.align,d=a?c.width:c.height,p=a?f.width:f.height;if(e){var g=Jg(c,f),m=g.portFromPos,y=g.portToPos;null!==g.link&&(c.node&&c.node!==g.link.fromNode&&(m=a?c.focusX:c.focusY),f.node&&f.node!==g.link.toNode&&(y=a?f.focusX:f.focusY))}else m=(g=Jg(f,c)).portToPos,y=g.portFromPos,null!==g.link&&(c.node&&c.node!==g.link.toNode&&(m=a?c.focusX:c.focusY),f.node&&f.node!==g.link.fromNode&&(y=a?f.focusX:f.focusY));d=n?c.qg+(d-m)-(p-y):c.qg+m-y,f.qg=d,u=Math.min(u,d),c=c.align}c=l;do{c.qg=c.qg-u,c=c.align}while(c!==l)}for(a=(e=o(i)).next();!a.done;a=e.next())for(a=(s=o(a.value)).next();!a.done;a=s.next())(a=a.value).root===a&&Pg(t,a,i);for(e=0;e=i[e].length)&&(a=i[e][0]).sd===a){1/0===a.sd.shift&&(a.sd.shift=0),a=e,h=0;do{for(s=i[a][h];s.align!==s.root;)a++,0<(s=s.align).vi&&((h=Cg(s,i)).sd.shift=Math.min(h.sd.shift,s.sd.shift+s.zc+s.qg-(h.zc+h.qg+(r?h.width:h.height)+t.columnSpacing)));h=s.vi+1}while(a(t=t.vi)&&w("Could not determine previous vertex in layer"),i[e][t-1]}function Tg(t,i,e,n,o){if(!i||0===i.count)return e[o]=0,n[o]=0,1/0;var r=1/0,s=-1/0;return i.each((function(i){var e=i.key;i=i.value,e=90===t.K||270===t.K?e.width:e.height,is&&(s=i+e)})),e[o]=r,n[o]=s,s-r}function Lg(t,i){return 270===t.K?i?Li:Fi:90===t.K?i?Fi:Li:180===t.K?i?Ai:ji:i?ji:Ai}function Ag(t,i){var e=t.tc[i];if(e>=t.He.length){for(var n=[],o=0;othis.Pl||Math.abs(t)t&&0a?(o=f.x+f.width/2,r=f.y+f.height/2,l[0]=new pt(f.x+f.width+n.width,f.y),l[1]=new pt(f.x,f.y+f.height+n.height),a=2):(d=new pt((c=l[h=Vp(l,a,o,r,f.width,f.height,n)]).x+f.width+n.width,c.y),f=new pt(c.x,c.y+f.height+n.height),h+1this.network.vertexes.count)return!1;for(var t=0,i=0,e=this.network.vertexes.first().bounds,n=this.network.vertexes.iterator;n.next();){if(n.value.bounds.Yc(e)&&2<++t)return!0;if(10n&&(i=n),e<-n?e=-n:e>n&&(e=n),t.centerX+=i,t.centerY+=e,i*i+e*e},zp.prototype.moveFixedVertex=function(){},zp.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},zp.prototype.yv=function(){if(this.setsPortSpots)for(var t=this.network.edges.iterator;t.next();){var i=t.value.link;null!==i&&(i.fromSpot=Si,i.toSpot=Si)}},zp.prototype.commitNodes=function(){var t=0,i=0;if(this.arrangesToOrigin){var e=Bt.alloc();this.computeBounds(this.network,e),t=(i=this.arrangementOrigin).x-e.x,i=i.y-e.y,Bt.free(e)}e=Bt.alloc();for(var n=this.network.vertexes.iterator;n.next();){var o=n.value;0===t&&0===i||(e.assign(o.bounds),e.x+=t,e.y+=i,o.bounds=e),o.commit()}Bt.free(e)},zp.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()},zp.prototype.springStiffness=function(t){return t=t.stiffness,isNaN(t)?this.Hk:t},zp.prototype.springLength=function(t){return t=t.length,isNaN(t)?this.Gk:t},zp.prototype.electricalCharge=function(t){return t=t.charge,isNaN(t)?this.Ek:t},zp.prototype.electricalFieldX=function(){return 0},zp.prototype.electricalFieldY=function(){return 0},zp.prototype.gravitationalMass=function(t){return t=t.mass,isNaN(t)?this.Fk:t},zp.prototype.gravitationalFieldX=function(){return 0},zp.prototype.gravitationalFieldY=function(){return 0},zp.prototype.isFixed=function(t){return t.isFixed},f.Object.defineProperties(zp.prototype,{currentIteration:{get:function(){return this.An}},arrangementSpacing:{get:function(){return this.$d},set:function(t){this.$d.D(t)||(this.$d.assign(t),this.C())}},arrangesToOrigin:{get:function(){return this.Bm},set:function(t){this.Bm!==t&&(this.Bm=t,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(t){this.sf!==t&&(this.sf=t,this.C())}},comments:{get:function(){return this.td},set:function(t){this.td!==t&&(this.td=t,this.C())}},maxIterations:{get:function(){return this.dl},set:function(t){this.dl!==t&&0<=t&&(this.dl=t,this.C())}},epsilonDistance:{get:function(){return this.$m},set:function(t){this.$m!==t&&0g&&0g&&0t[this.Md]&&(this.Iq=t[e]-1,this.Md=e),t[e]i.toVertex.index&&(t.gm(i),i.rev=!0);break;case Fg:for(n=this.network.vertexes.iterator;n.next();)(t=n.value).Ll=-1,t.finish=-1;for(t=this.network.edges.iterator;t.next();)t.value.forest=!1;for(this.Kn=0,n.reset();n.next();)0===(i=n.value).sourceEdges.count&&hg(this,i);for(n.reset();n.next();)-1===(i=n.value).Ll&&hg(this,i);for(t.reset();t.next();)(n=t.value).forest||(e=(i=n.fromVertex).finish,r=(o=n.toVertex).finish,o.Lln){if(0>n)for(i.reset();i.next();)i.value.layer-=n;for(n=[],i.reset();i.next();)void 0===(o=n[(e=i.value).layer])?n[e.layer]=[e]:o.push(e);for(e=i=0;e=n;i--)e=yg(this,i,-1)||e;for((a=this.countCrossings())>=r?$p(this,s):(r=a,s=_p(this)),e=!0;e;)for(e=!1,i=t;i>=n;i--)e=yg(this,i,1)||e;for((a=this.countCrossings())>=r?$p(this,s):(r=a,s=_p(this)),e=!0;e;)for(e=!1,i=n;i<=t;i++)e=yg(this,i,1)||e;for(a>=r?$p(this,s):(r=a,s=_p(this)),e=!0;e;)for(e=!1,i=n;i<=t;i++)e=yg(this,i,-1)||e;for(a>=r?$p(this,s):(r=a,s=_p(this)),e=!0;e;)for(e=!1,i=t;i>=n;i--)e=yg(this,i,0)||e;for(a>=r?$p(this,s):(r=a,s=_p(this)),e=!0;e;)for(e=!1,i=n;i<=t;i++)e=yg(this,i,0)||e;a>=r?$p(this,s):(r=a,s=_p(this))}break;default:for(t=this.Ia,n=0,o=r+1;(i=this.countCrossings())=n;i--)e=yg(this,i,-1)||e;for((a=this.countCrossings())>=r?$p(this,s):(r=a,s=_p(this)),e=!0;e;)for(e=!1,i=t;i>=n;i--)e=yg(this,i,1)||e;for((a=this.countCrossings())>=r?$p(this,s):(r=a,s=_p(this)),e=!0;e;)for(e=!1,i=n;i<=t;i++)e=yg(this,i,1)||e;for(a>=r?$p(this,s):(r=a,s=_p(this)),e=!0;e;)for(e=!1,i=n;i<=t;i++)e=yg(this,i,-1)||e;for(a>=r?$p(this,s):(r=a,s=_p(this)),e=!0;e;)for(e=!1,i=t;i>=n;i--)e=yg(this,i,0)||e;for(a>=r?$p(this,s):(r=a,s=_p(this)),e=!0;e;)for(e=!1,i=n;i<=t;i++)e=yg(this,i,0)||e;a>=r?$p(this,s):(r=a,s=_p(this))}}$p(this,s)},Jp.prototype.straightenAndPack=function(){if(0===this.ve){var t=0!=(1&this.bg),i=0!=(this.bg&Ug);if(1e3>1)+8*n;this.Ra*=8}if(0!=(2&this.bg))for(e=!0;e;){for(e=!1,i=this.Md+1;i<=this.Ia;i++)e=vg(this,i,1)||e;for(i=this.Md-1;0<=i;i--)e=vg(this,i,-1)||e;e=vg(this,this.Md,0)||e}if(0!=(4&this.bg)){for(i=this.Md+1;i<=this.Ia;i++)bg(this,i,1);for(i=this.Md-1;0<=i;i--)bg(this,i,-1);bg(this,this.Md,0)}if(t&&(Mg(this,-1),Mg(this,1)),0!=(2&this.bg))for(e=!0;e;){for(e=!1,e=vg(this,this.Md,0)||e,i=this.Md+1;i<=this.Ia;i++)e=vg(this,i,0)||e;for(i=this.Md-1;0<=i;i--)e=vg(this,i,0)||e}}else!function(t){for(var i=A(),e=t.fl.length,n=0;n<=e;n++)i[n]=[];for(n=t.network.vertexes.iterator;n.next();){var r=n.value;i[e-r.layer][r.index]=r}e=new $,function(t,i){for(var e=t.length,n=1;nc)&&i.add(f);s++}r=c}}}(i,e);var s=null,a=null,h=null,l=null,u=0!=(1&t.ve),c=0!=(2&t.ve),f=0!=(4&t.ve),d=0!=(8&t.ve);for(u&&(t.verticalAlignment(i,e,!0),s=Ng(t,i,!0,!1)),i.reverse(),f&&(t.verticalAlignment(i,e,!1),h=Ng(t,i,!1,!1)),n=o(i),r=n.next();!r.done;r=n.next())r.value.reverse();d&&(t.verticalAlignment(i,e,!1),l=Ng(t,i,!1,!0)),i.reverse(),c&&(t.verticalAlignment(i,e,!0),a=Ng(t,i,!0,!0)),j(i),t.u(s,a,h,l),t.network.vertexes.each((function(t){var i=A();u&&i.push(s.get(t)),c&&i.push(a.get(t)),f&&i.push(h.get(t)),d&&i.push(l.get(t)),i.sort((function(t,i){return t-i}));var e=i.length;e=(i[Math.floor((e-1)/2)]+i[Math.ceil((e-1)/2)])/2,j(i),t.zc=e}))}(this)},Jp.prototype.verticalAlignment=function(t,i,e){!function(t){for(var i=0;is;s++)if(i[s]){var a=Tg(this,i[s],n,o,s);as;r={delta:r.delta},s++)i[s]&&(r.delta=0===s||2===s?n[e]-n[s]:o[e]-o[s],0!==r.delta&&i[s].each(function(t){return function(i){i.value+=t.delta}}(r)));j(n),j(o)},Jp.prototype.commitLayout=function(){if(this.setsPortSpots)for(var t=Lg(this,!0),i=Lg(this,!1),e=this.network.edges.iterator;e.next();){var n=e.value.link;null!==n&&(n.fromSpot=t,n.toSpot=i)}this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},Jp.prototype.commitNodes=function(){this.he=[],this.Ld=[],this.Kd=[],this.Ta=[];for(var t=0;t<=this.Ia;t++)this.he[t]=0,this.Ld[t]=0,this.Kd[t]=0,this.Ta[t]=0;for(t=this.network.vertexes.iterator;t.next();){var i=t.value,e=i.layer;this.he[e]=Math.max(this.he[e],this.nodeMinLayerSpace(i,!0)),this.Ld[e]=Math.max(this.Ld[e],this.nodeMinLayerSpace(i,!1))}i=0,e=this.ie;for(var n=0;n<=this.Ia;n++){var o=e;0>=this.he[n]+this.Ld[n]&&(o=0),0=c.bounds.bottom?(c=c.bounds.y+c.bounds.height,t.m(g++,b,c+k),t.m(g++,b,c),t.m(g++,b,c-x)):(t.m(g++,b,w+k),t.m(g++,b,w),t.m(g++,b,w-x)):270===this.K?w<=c.bounds.y?(c=c.bounds.y,t.m(g++,b,c-x),t.m(g++,b,c),t.m(g++,b,c+k)):(t.m(g++,b,w-x),t.m(g++,b,w),t.m(g++,b,w+k)):0===this.K&&(b>=c.bounds.right?(c=c.bounds.x+c.bounds.width,t.m(g++,c+k,w),t.m(g++,c,w),t.m(g++,c-x,w)):(t.m(g++,b+k,w),t.m(g++,b,w),t.m(g++,b-x,w)));else{t.m(g++,y,v);var M=0;180===this.K||0===this.K?((180===this.K?b>=c.bounds.right:b<=c.bounds.x)&&(M=(0===this.K?-x:k)/2),t.m(g++,y+M,w)):((270===this.K?w>=c.bounds.bottom:w<=c.bounds.y)&&(M=(90===this.K?-x:k)/2),t.m(g++,b,v+M)),t.m(g++,b,w)}}else x=Math.max(10,this.he[m.layer]),k=Math.max(10,this.Ld[m.layer]),f?180===this.K?(t.m(g++,b-x-p,w),t.m(g++,Math.min(b-x+p/2,b),w),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,Math.max(b+k-p/2,b),w),t.m(g++,b+k+p,w)):90===this.K?(t.m(g++,b,w+k+p),t.m(g++,b,Math.max(w+k-p/2,w)),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,b,Math.min(w-x+p/2,w)),t.m(g++,b,w-x-p)):270===this.K?(t.m(g++,b,w-x-p),t.m(g++,b,Math.min(w-x+p/2,w)),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,b,Math.max(w+k-p/2,w)),t.m(g++,b,w+k+p)):(t.m(g++,b+k+p,w),t.m(g++,Math.max(b+k-p/2,b),w),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,Math.min(b-x+p/2,b),w),t.m(g++,b-x-p,w)):t.m(g++,b,w)}c=m}(null===a||l!==Qt||d)&&(y=t.i(g-1).x,v=t.i(g-1).y,b=t.i(g).x,w=t.i(g).y,d?(p=this.Ld[u.layer],180===this.K||0===this.K?((d=v)>=u.bounds.y&&d<=u.bounds.bottom&&(180===this.K?b>=u.bounds.x:b<=u.bounds.right)&&(c=u.centerX+(180===this.K?-p:p),d=d=u.bounds.x&&d<=u.bounds.right&&(270===this.K?w>=u.bounds.y:w<=u.bounds.bottom)&&(c=u.centerY+(270===this.K?-p:p),d=d=u.bounds.x?(c=u.bounds.x+u.bounds.width,t.L(g-2,c,v),t.L(g-1,c+k,v)):90===this.K&&w<=u.bounds.bottom?(c=u.bounds.y,t.L(g-2,y,c),t.L(g-1,y,c-x)):270===this.K&&w>=u.bounds.y?(c=u.bounds.y+u.bounds.height,t.L(g-2,y,c),t.L(g-1,y,c+k)):0===this.K&&b<=u.bounds.right&&(c=u.bounds.x,t.L(g-2,c,v),t.L(g-1,c-x,v))):(x=Math.max(10,this.he[u.layer]),k=Math.max(10,this.Ld[u.layer]),d=0,180===this.K||0===this.K?((180===this.K?b<=u.bounds.x:b>=u.bounds.right)&&(d=(0===this.K?k:-x)/2),t.m(g++,b+d,v)):((270===this.K?w<=u.bounds.y:w>=u.bounds.bottom)&&(d=(90===this.K?k:-x)/2),t.m(g++,y,w+d)),t.m(g++,b,w)))}else{for(;null!==u&&u!==c;){for(x=m=null,u=u.destinationEdges.iterator;u.next()&&((y=u.value).link!==e.link||(m=y.toVertex,null!==(x=y.fromVertex).node&&(x=null),null!==m.node)););if(null===m)break;m!==c&&(y=t.i(g-1).x,v=t.i(g-1).y,b=m.centerX,w=m.centerY,d?180===this.K||0===this.K?(null!==x?x.centerY:v)!==w&&(x=this.Ta[m.layer]+this.Rf.x,g===t.firstPickIndex+1&&(x=0===this.K?Math.max(x,y):Math.min(x,y)),t.m(g++,x,v),t.m(g++,x,w)):(null!==x?x.centerX:y)!==b&&(x=this.Ta[m.layer]+this.Rf.y,g===t.firstPickIndex+1&&(x=90===this.K?Math.max(x,v):Math.min(x,v)),t.m(g++,y,x),t.m(g++,b,x)):(x=Math.max(10,this.he[m.layer]),k=Math.max(10,this.Ld[m.layer]),f?180===this.K?(t.m(g++,b+k+p,w),t.m(g++,Math.max(b+k-p/2,b),w),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,Math.min(b-x+p/2,b),w),t.m(g++,b-x-p,w)):90===this.K?(t.m(g++,b,w-x-p),t.m(g++,b,Math.min(w-x+p/2,w)),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,b,Math.max(w+k-p/2,w)),t.m(g++,b,w+k+p)):270===this.K?(t.m(g++,b,w+k+p),t.m(g++,b,Math.max(w+k-p/2,w)),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,b,Math.min(w-x+p/2,w)),t.m(g++,b,w-x-p)):(t.m(g++,b-x-p,w),t.m(g++,Math.min(b-x+p/2,b),w),t.m(g++,b,w),t.m(g++,b,w),t.m(g++,Math.max(b+k-p/2,b),w),t.m(g++,b+k+p,w)):180===this.K?(t.m(g++,b+k,w),t.m(g++,b-x,w)):90===this.K?(t.m(g++,b,w-x),t.m(g++,b,w+k)):270===this.K?(t.m(g++,b,w+k),t.m(g++,b,w-x)):(t.m(g++,b-x,w),t.m(g++,b+k,w)))),u=m}d&&(y=t.i(g-1).x,v=t.i(g-1).y,b=t.i(g).x,w=t.i(g).y,180===this.K||0===this.K?v!==w&&(x=0===this.K?Math.min(Math.max((b+y)/2,this.Ta[c.layer]+this.Rf.x),b):Math.max(Math.min((b+y)/2,this.Ta[c.layer]+this.Rf.x),b),t.m(g++,x,v),t.m(g++,x,w)):y!==b&&(x=90===this.K?Math.min(Math.max((w+v)/2,this.Ta[c.layer]+this.Rf.y),w):Math.max(Math.min((w+v)/2,this.Ta[c.layer]+this.Rf.y),w),t.m(g++,y,x),t.m(g++,b,x)))}null!==n&&f&&4<=t.pointsCount&&(null!==s&&(s=l===Qt?t.getLinkPointFromPoint(o,s,s.ga(oi),t.i(3),!0):t.i(0),l===Qt&&(l=t.i(2),n=t.i(3),90===this.direction||270===this.direction?(t.L(1,(s.x+l.x)/2,l.y),t.L(2,n.x,(l.y+n.y)/2)):(t.L(1,l.x,(s.y+l.y)/2),t.L(2,(l.x+n.x)/2,n.y))),s.w()||s.set(o.actualBounds.center),t.L(0,s.x,s.y)),null!==a&&(o=h===Qt?t.getLinkPointFromPoint(r,a,a.ga(oi),t.i(t.pointsCount-4),!1):t.i(t.pointsCount-1),h===Qt&&(a=t.i(t.pointsCount-3),h=t.i(t.pointsCount-4),90===this.direction||270===this.direction?(t.L(t.pointsCount-2,(o.x+a.x)/2,a.y),t.L(t.pointsCount-2,h.x,(a.y+h.y)/2)):(t.L(t.pointsCount-2,a.x,(o.y+a.y)/2),t.L(t.pointsCount-3,(a.x+h.x)/2,h.y))),o.w()||o.set(r.actualBounds.center),t.L(t.pointsCount-1,o.x,o.y))),t.zf(),e.commit()}}}this.avoidOrthogonalOverlaps()},Jp.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var t=new Z,i=this.network.edges.iterator;i.next();){var e=i.value.link;null!==e&&e.isOrthogonal&&!t.contains(e)&&t.add(e)}if(0r.y&&(u=l.y>r.y?0:s.xr.x&&(u=l.x>r.x?0:s.yi.layer?1:t.rdi.rd?1:t.Ici.Ic?1:0:0},i.Ux=function(t,i){return t instanceof qg&&i instanceof qg&&t!==i?t.firsti.first||t.ji.j||t.rdi.rd?1:t.Ici.Ic?1:0:0},i.Js=function(t,i){return t instanceof qg&&i instanceof qg&&t!==i?t.jci.jc||t.ji.j||t.rdi.rd?1:t.Ici.Ic?1:0:0},i.B=function(t,i){return-1<(t-=i)&&1>t},i.zi=function(t,i,e,n){var o=t.length,r=n-e;if(!(1>=r))if((0>e||e>=o-1)&&w("not in range 0 <= from < length: "+e),2===r)0=o)t.sort(i);else for((e=t.slice(0,n)).sort(i),i=0;i=o)for((n=t.slice(e)).sort(i),i=e;it&&(this.bg=t,this.C())}},alignOption:{get:function(){return this.ve},set:function(t){this.ve!==t&&0<=t&&16>t&&(this.ve=t,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(t){this.sf!==t&&(this.sf=t,this.C())}},linkSpacing:{get:function(){return this.Cn},set:function(t){this.Cn!==t&&0<=t&&(this.Cn=t,this.C())}},maxLayer:{get:function(){return this.Ia}},maxIndex:{get:function(){return this.Iq}},maxColumn:{get:function(){return this.Ra}},minIndexLayer:{get:function(){return this.Hn}},maxIndexLayer:{get:function(){return this.Md}}});var Fg=new V(Jp,"CycleDepthFirst",0),Dg=new V(Jp,"CycleGreedy",1),Bg=new V(Jp,"CycleFromLayers",2),Og=new V(Jp,"LayerOptimalLinkLength",0),Ig=new V(Jp,"LayerLongestPathSink",1),zg=new V(Jp,"LayerLongestPathSource",2),Rg=new V(Jp,"InitDepthFirstOut",0),Eg=new V(Jp,"InitDepthFirstIn",1),Vg=new V(Jp,"InitNaive",2),Yg=new V(Jp,"AggressiveNone",0),Gg=new V(Jp,"AggressiveLess",1),Xg=new V(Jp,"AggressiveMore",2),Ug=8;function qg(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}function Kg(t){Of.call(this,t)}function Hg(t){Vf.call(this,t),this.$n=this.bo=this.ao=this.co=null,this.Za=this.Ag=this.Ig=-1,this.u=NaN,this.F=null,this.valid=!1,this.finish=this.Ll=NaN,this.Dj=0,this.dv=this.ev=null}function Wg(t,i){return t.index-i.index}function Jg(t,i){if(!t.$n){for(var e=[],n=o(t.destinationEdgesArrayAccess),r=n.next();!r.done;r=n.next())(r=r.value).valid&&e.push(r);t.$n=e}for(e=(t=o(t.$n)).next();!e.done;e=t.next())if((e=e.value).toVertex===i)return e;w("Unable to find destination edge to given vertex")}function Zg(t){if(!t.co){for(var i=[],e=o(t.sourceEdgesArrayAccess),n=e.next();!n.done;n=e.next())(n=n.value).valid&&i.push(n.fromVertex);i.sort(Wg),t.co=i}return t.co}function _g(t){if(!t.ao){for(var i=[],e=o(t.destinationEdgesArrayAccess),n=e.next();!n.done;n=e.next())(n=n.value).valid&&i.push(n.toVertex);i.sort(Wg),t.ao=i}return t.ao}function $g(t){Gf.call(this,t),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}function Qg(t){Ff.call(this),this.Ub=new $,this.Wn=Cm,this.ud=Tm,this.vo=Um,this.Bq=_m,this.$v=[],this.td=!0,this.Rb=Wm,this.$d=new At(10,10).freeze();var i=new ty(this);this.W=new iy(i),this.Y=new iy(i),this.ru=[],t&&Object.assign(this,t)}function tm(t){var i=new $;for(t=t.iterator;t.next();){var e=t.value;e.initialized||i.add(e)}return i}function im(t,i){var e=999999,n=null;for(i=i.iterator;i.next();){var o=i.value;switch(t.ud){case Tm:o.sourceEdges.counti.level)return!1;t.removeChild(e.parent,e)}return!0}function om(t,i){if(null!==i){t.initializeTreeVertexValues(i),i.alignment===Em&&t.sortTreeVertexChildren(i);for(var e=0,n=i.childrenCount,o=0,r=i.children,s=r.length,a=0;an?cm(t,i,o,C,x,b):fm(t,i,o,C,x,b)).x,x=b.width,b=b.height;break;case Vm:for(f=0;ff&&(kf&&(Mc&&(c=0),135y&&(y=0)),i.la.h(c,y),i.Da.h(x,b)}}function cm(t,i,e,n,o,r){var s=e.length;if(0===s)return new Bt(n,0,o,r);if(1===s)return new Bt(n,0,o=(i=e[0]).Da.width,r=i.Da.height);for(var a=i.nodeSpacing,h=i.rowSpacing,l=90===Pm(i),u=0,c=0,f=0,d=0;dl&&(o-=l),r=Math.max(r,Math.max(d,f)+t+s.height),0>e.S.x&&(n=dm(i,e.S.x,!1,n,a))):(e.S.h(o+t,n+a/2-e.focus.y-e.la.y),o=Math.max(o,Math.max(p,c)+t+s.width),f=n+a/2-e.focus.y-e.la.y,r=Math.max(r,f+s.height),0>f&&(r-=f),0>e.S.y&&(n=dm(i,e.S.y,!0,n,a)))),new Bt(n,0,o,r)}function fm(t,i,e,n,o,r){var s=e.length;if(0===s)return new Bt(n,0,o,r);if(1===s)return new Bt(n,0,o=(e=e[0]).Da.width,r=e.Da.height);for(var a=i.nodeSpacing,h=i.rowSpacing,l=270===Pm(i),u=0,c=0,f=0,d=0;dc&&(o-=c),r=Math.max(r,Math.abs(Math.min(d,f))+t+u.height),0>h.S.x&&(n=dm(i,h.S.x,!1,n,a))):(h.S.h(-o-u.width-t,n+a/2-h.focus.y-h.la.y),o=Math.max(o,Math.abs(Math.min(p,c))+t+u.width),f=n+a/2-h.focus.y-h.la.y,r=Math.max(r,f+u.height),0>f&&(r-=f),0>h.S.y&&(n=dm(i,h.S.y,!0,n,a)))),i=0;ii&&(i=e+t.width),0>e&&(i-=e),i;case Im:return t.width>i?t.width:i;case zm:return 2*t.focus.x>i?t.width:i+t.width-2*t.focus.x;case Rm:case Em:return Math.max(t.width,Math.max(i,e+t.width)-Math.min(0,e));case Vm:return t.width-t.focus.x+t.nodeSpacing/2+i;case Ym:return Math.max(t.width,t.focus.x+t.nodeSpacing/2+i);default:return i}}function gm(t,i,e){switch(t.alignment){case Om:case Bm:return e+t.height>i&&(i=e+t.height),0>e&&(i-=e),i;case Im:return t.height>i?t.height:i;case zm:return 2*t.focus.y>i?t.height:i+t.height-2*t.focus.y;case Rm:case Em:return Math.max(t.height,Math.max(i,e+t.height)-Math.min(0,e));case Vm:return t.height-t.focus.y+t.nodeSpacing/2+i;case Ym:return Math.max(t.height,t.focus.y+t.nodeSpacing/2+i);default:return i}}function mm(t,i,e){switch(t){case Bm:case Om:i/=2,e/=2;break;case Im:e=i=0;break;case zm:break;default:w("Unhandled alignment value "+t.toString())}return new pt(i,e)}function ym(t,i,e,n,o,r){vm(t,(i=mm(i,e,n)).x,i.y,o,r)}function vm(t,i,e,n,o){if(0!==i||0!==e)for(t=t.children;n<=o;n++){var r=t[n].S;r.x+=i,r.y+=e}}function xm(t,i,e,n){var o=i.parent;switch(t.ud){case Tm:for(t=i.sourceEdges;t.next();)(i=t.value).fromVertex===o&&i.relativePoint.h(e,n);break;case Lm:for(t=i.destinationEdges;t.next();)(i=t.value).toVertex===o&&i.relativePoint.h(e,n);break;default:w("Unhandled path value "+t.ud.toString())}}function bm(t,i,e){for(var n=0;nc.length||null===d||2>d.length))for(o=e=0;el&&r.yr.y&&li.length||null===e||2>e.length)n=null;else{for(u=km(t,i.length+e.length),n=r=h=0;rh;)l=e[r++],u[n++].h(l.x+o,l.y);for(e=km(t,n),h=0;hc.length||null===r||2>r.length)o=null;else{for(u=km(t,c.length+r.length),o=l=e=0;er;)h=c[e++],u[o++].h(h.x,h.y);for(r=km(t,o),e=0;ec.length||null===d||2>d.length))for(o=e=0;eh&&r.xr.x&&hi.length||null===e||2>e.length)n=null;else{for(u=km(t,i.length+e.length),n=r=h=0;rh;)l=e[r++],u[n++].h(l.x,l.y+o);for(e=km(t,n),h=0;hc.length||null===r||2>r.length)o=null;else{for(u=km(t,c.length+r.length),o=l=e=0;er;)h=c[e++],u[o++].h(h.x,h.y);for(r=km(t,o),e=0;e=(t=t.angle)?0:135>=t?90:225>=t?180:315>=t?270:0}Jp.className="LayeredDigraphLayout",Jp.CycleDepthFirst=Fg,Jp.CycleGreedy=Dg,Jp.CycleFromLayers=Bg,Jp.LayerOptimalLinkLength=Og,Jp.LayerLongestPathSink=Ig,Jp.LayerLongestPathSource=zg,Jp.InitDepthFirstOut=Rg,Jp.InitDepthFirstIn=Eg,Jp.InitNaive=Vg,Jp.AggressiveNone=Yg,Jp.AggressiveLess=Gg,Jp.AggressiveMore=Xg,Jp.PackNone=0,Jp.PackExpand=1,Jp.PackStraighten=2,Jp.PackMedian=4,Jp.PackAll=15,Jp.AlignNone=0,Jp.AlignUpperLeft=1,Jp.AlignUpperRight=2,Jp.AlignLowerLeft=4,Jp.AlignLowerRight=8,Jp.AlignAll=15,qg.className="SegInfo",c(Kg,Of),Kg.prototype.createVertex=function(){return new Hg(this)},Kg.prototype.createEdge=function(){return new $g(this)},Kg.className="LayeredDigraphNetwork",c(Hg,Vf),Hg.prototype.Cl=function(t){Vf.prototype.Cl.call(this,t),this.bo=this.co=null},Hg.prototype.Kl=function(t){Vf.prototype.Kl.call(this,t),this.bo=this.co=null},Hg.prototype.zl=function(t){Vf.prototype.zl.call(this,t),this.$n=this.ao=null},Hg.prototype.Jl=function(t){Vf.prototype.Jl.call(this,t),this.$n=this.ao=null},f.Object.defineProperties(Hg.prototype,{layer:{get:function(){return this.Ig},set:function(t){this.Ig!==t&&(this.Ig=t)}},column:{get:function(){return this.Ag},set:function(t){this.Ag!==t&&(this.Ag=t)}},index:{get:function(){return this.Za},set:function(t){this.Za!==t&&(this.Za=t)}},component:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},near:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t)}}}),Hg.prototype.deleteDestinationEdge=Hg.prototype.Jl,Hg.prototype.addDestinationEdge=Hg.prototype.zl,Hg.prototype.deleteSourceEdge=Hg.prototype.Kl,Hg.prototype.addSourceEdge=Hg.prototype.Cl,Hg.className="LayeredDigraphVertex",c($g,Gf),f.Object.defineProperties($g.prototype,{fromVertex:{get:function(){return this.kd},set:function(t){this.kd!==t&&(this.kd=t)}},toVertex:{get:function(){return this.qd},set:function(t){this.qd!==t&&(this.qd=t)}},valid:{get:function(){return this.Ha},set:function(t){this.Ha!==t&&(this.Ha=t)}},rev:{get:function(){return this.ia},set:function(t){this.ia!==t&&(this.ia=t)}},forest:{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t)}},portFromPos:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},portToPos:{get:function(){return this.V},set:function(t){this.V!==t&&(this.V=t)}},portFromColOffset:{get:function(){return this.o},set:function(t){this.o!==t&&(this.o=t)}},portToColOffset:{get:function(){return this.F},set:function(t){this.F!==t&&(this.F=t)}}}),$g.className="LayeredDigraphEdge",c(Qg,Ff),Qg.prototype.cloneProtected=function(t){Ff.prototype.cloneProtected.call(this,t),t.Wn=this.Wn,t.vo=this.vo,t.Bq=this.Bq,t.td=this.td,t.Rb=this.Rb,t.$d.assign(this.$d),t.W.copyInheritedPropertiesFrom(this.W),t.Y.copyInheritedPropertiesFrom(this.Y)},Qg.prototype.qb=function(t){t.classType===Qg?0===t.name.indexOf("Alignment")?this.alignment=t:0===t.name.indexOf("Arrangement")?this.arrangement=t:0===t.name.indexOf("Compaction")?this.compaction=t:0===t.name.indexOf("Path")?this.path=t:0===t.name.indexOf("Sorting")?this.sorting=t:0===t.name.indexOf("Style")?this.treeStyle=t:w("Unknown enum value: "+t):Ff.prototype.qb.call(this,t)},Qg.prototype.createNetwork=function(){return new ty(this)},Qg.prototype.makeNetwork=function(t){function i(t){if(t instanceof Ju)return!t.isLinkLabel&&"Comment"!==t.category;if(t instanceof wc){var i=t.fromNode;return null!==i&&!i.isLinkLabel&&"Comment"!==i.category&&(null!==(t=t.toNode)&&!t.isLinkLabel&&"Comment"!==t.category)}return!1}var e=this.createNetwork();return t instanceof To?(e.lg(t.nodes,!0,i),e.lg(t.links,!0,i)):t instanceof gc?e.lg(t.memberParts,!1,i):e.lg(t.iterator,!1,i),e},Qg.prototype.doLayout=function(t){null===this.network&&(this.network=this.makeNetwork(t)),this.arrangement!==Zm&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var i=this.diagram;if(null===i&&t instanceof To&&(i=t),this.path===Cm&&null!==i?this.ud=i.isTreePathToChildren?Tm:Lm:this.ud=this.path===Cm?Tm:this.path,0o?cm(this,t,s,F,y,v):fm(this,t,s,F,y,v)).x,y=v.width,v=v.height;break;case Vm:for(b=0;bc&&(NI&&(vm(t,-I,0,L,D-1),bm(b,-I,0),bm(k,-I,0),I=0)}B.S.h(I,P),y=Math.max(y,M),v=Math.max(v,x+(0===C?0:p)+O.height),N=M}else 0c&&(PI&&(vm(t,0,-I,L,D-1),bm(b,0,-I),bm(k,0,-I),I=0)),B.S.h(N,I),v=Math.max(v,S),y=Math.max(y,x+(0===C?0:p)+O.width),P=S;T++}switch(0l&&(l=0),135g&&(g=0),h===Ym&&(a+=f/2+t.focus.y),s+=n+e):i?(null===t.comments?n>y&&(s=(y=mm(h,n-y,0)).x,a=y.y,y=n,l=0):y=pm(t,y,l),0>l&&(s-=l,l=0),135v&&(s=(v=mm(h,0,m-v)).x,a=v.y,v=m,g=0):v=gm(t,v,g),0>g&&(a-=g,g=0),s+=n+e),0o[0].x?o[2].assign(o[1]):o[1].assign(o[2])),o[3].yo[0].x?o[3].assign(o[2]):o[2].assign(o[3])),C[0].h(l+n,0),C[1].h(C[0].x,m),C[2].yo[0].y?o[2].assign(o[1]):o[1].assign(o[2])),o[3].xo[0].y?o[3].assign(o[2]):o[2].assign(o[3])),C[0].h(0,g+m),C[1].h(n,C[0].y),C[2].x=t&&(this.W.nodeIndentPastParent=t,this.C())}},nodeSpacing:{get:function(){return this.W.nodeSpacing},set:function(t){this.W.nodeSpacing!==t&&(this.W.nodeSpacing=t,this.C())}},layerSpacing:{get:function(){return this.W.layerSpacing},set:function(t){this.W.layerSpacing!==t&&(this.W.layerSpacing=t,this.C())}},layerSpacingParentOverlap:{get:function(){return this.W.layerSpacingParentOverlap},set:function(t){this.W.layerSpacingParentOverlap!==t&&0<=t&&1>=t&&(this.W.layerSpacingParentOverlap=t,this.C())}},compaction:{get:function(){return this.W.compaction},set:function(t){this.W.compaction===t||t!==Gm&&t!==Xm||(this.W.compaction=t,this.C())}},breadthLimit:{get:function(){return this.W.breadthLimit},set:function(t){this.W.breadthLimit!==t&&0<=t&&(this.W.breadthLimit=t,this.C())}},rowSpacing:{get:function(){return this.W.rowSpacing},set:function(t){this.W.rowSpacing!==t&&(this.W.rowSpacing=t,this.C())}},rowIndent:{get:function(){return this.W.rowIndent},set:function(t){this.W.rowIndent!==t&&0<=t&&(this.W.rowIndent=t,this.C())}},commentSpacing:{get:function(){return this.W.commentSpacing},set:function(t){this.W.commentSpacing!==t&&(this.W.commentSpacing=t,this.C())}},commentMargin:{get:function(){return this.W.commentMargin},set:function(t){this.W.commentMargin!==t&&(this.W.commentMargin=t,this.C())}},setsPortSpot:{get:function(){return this.W.setsPortSpot},set:function(t){this.W.setsPortSpot!==t&&(this.W.setsPortSpot=t,this.C())}},portSpot:{get:function(){return this.W.portSpot},set:function(t){this.W.portSpot.D(t)||(this.W.portSpot=t,this.C())}},setsChildPortSpot:{get:function(){return this.W.setsChildPortSpot},set:function(t){this.W.setsChildPortSpot!==t&&(this.W.setsChildPortSpot=t,this.C())}},childPortSpot:{get:function(){return this.W.childPortSpot},set:function(t){this.W.childPortSpot.D(t)||(this.W.childPortSpot=t,this.C())}},alternateSorting:{get:function(){return this.Y.sorting},set:function(t){this.Y.sorting===t||t!==Am&&t!==jm&&t!==Fm&&!Dm||(this.Y.sorting=t,this.C())}},alternateComparer:{get:function(){return this.Y.comparer},set:function(t){this.Y.comparer!==t&&(this.Y.comparer=t,this.C())}},alternateAngle:{get:function(){return this.Y.angle},set:function(t){this.Y.angle===t||0!==t&&90!==t&&180!==t&&270!==t||(this.Y.angle=t,this.C())}},alternateAlignment:{get:function(){return this.Y.alignment},set:function(t){this.Y.alignment!==t&&(this.Y.alignment=t,this.C())}},alternateNodeIndent:{get:function(){return this.Y.nodeIndent},set:function(t){this.Y.nodeIndent!==t&&0<=t&&(this.Y.nodeIndent=t,this.C())}},alternateNodeIndentPastParent:{get:function(){return this.Y.nodeIndentPastParent},set:function(t){this.Y.nodeIndentPastParent!==t&&0<=t&&1>=t&&(this.Y.nodeIndentPastParent=t,this.C())}},alternateNodeSpacing:{get:function(){return this.Y.nodeSpacing},set:function(t){this.Y.nodeSpacing!==t&&(this.Y.nodeSpacing=t,this.C())}},alternateLayerSpacing:{get:function(){return this.Y.layerSpacing},set:function(t){this.Y.layerSpacing!==t&&(this.Y.layerSpacing=t,this.C())}},alternateLayerSpacingParentOverlap:{get:function(){return this.Y.layerSpacingParentOverlap},set:function(t){this.Y.layerSpacingParentOverlap!==t&&0<=t&&1>=t&&(this.Y.layerSpacingParentOverlap=t,this.C())}},alternateCompaction:{get:function(){return this.Y.compaction},set:function(t){this.Y.compaction===t||t!==Gm&&t!==Xm||(this.Y.compaction=t,this.C())}},alternateBreadthLimit:{get:function(){return this.Y.breadthLimit},set:function(t){this.Y.breadthLimit!==t&&0<=t&&(this.Y.breadthLimit=t,this.C())}},alternateRowSpacing:{get:function(){return this.Y.rowSpacing},set:function(t){this.Y.rowSpacing!==t&&(this.Y.rowSpacing=t,this.C())}},alternateRowIndent:{get:function(){return this.Y.rowIndent},set:function(t){this.Y.rowIndent!==t&&0<=t&&(this.Y.rowIndent=t,this.C())}},alternateCommentSpacing:{get:function(){return this.Y.commentSpacing},set:function(t){this.Y.commentSpacing!==t&&(this.Y.commentSpacing=t,this.C())}},alternateCommentMargin:{get:function(){return this.Y.commentMargin},set:function(t){this.Y.commentMargin!==t&&(this.Y.commentMargin=t,this.C())}},alternateSetsPortSpot:{get:function(){return this.Y.setsPortSpot},set:function(t){this.Y.setsPortSpot!==t&&(this.Y.setsPortSpot=t,this.C())}},alternatePortSpot:{get:function(){return this.Y.portSpot},set:function(t){this.Y.portSpot.D(t)||(this.Y.portSpot=t,this.C())}},alternateSetsChildPortSpot:{get:function(){return this.Y.setsChildPortSpot},set:function(t){this.Y.setsChildPortSpot!==t&&(this.Y.setsChildPortSpot=t,this.C())}},alternateChildPortSpot:{get:function(){return this.Y.childPortSpot},set:function(t){this.Y.childPortSpot.D(t)||(this.Y.childPortSpot=t,this.C())}}});var Cm=new V(Qg,"PathDefault",-1),Tm=new V(Qg,"PathDestination",0),Lm=new V(Qg,"PathSource",1),Am=new V(Qg,"SortingForwards",10),jm=new V(Qg,"SortingReverse",11),Fm=new V(Qg,"SortingAscending",12),Dm=new V(Qg,"SortingDescending",13),Bm=new V(Qg,"AlignmentCenterSubtrees",20),Om=new V(Qg,"AlignmentCenterChildren",21),Im=new V(Qg,"AlignmentStart",22),zm=new V(Qg,"AlignmentEnd",23),Rm=new V(Qg,"AlignmentBus",24),Em=new V(Qg,"AlignmentBusBranching",25),Vm=new V(Qg,"AlignmentTopLeftBus",26),Ym=new V(Qg,"AlignmentBottomRightBus",27),Gm=new V(Qg,"CompactionNone",30),Xm=new V(Qg,"CompactionBlock",31),Um=new V(Qg,"StyleLayered",40),qm=new V(Qg,"StyleLastParents",41),Km=new V(Qg,"StyleAlternating",42),Hm=new V(Qg,"StyleRootOnly",43),Wm=new V(Qg,"ArrangementVertical",50),Jm=new V(Qg,"ArrangementHorizontal",51),Zm=new V(Qg,"ArrangementFixedRoots",52),_m=new V(Qg,"LayerIndividual",60),$m=new V(Qg,"LayerSiblings",61),Qm=new V(Qg,"LayerUniform",62);function ty(t){Of.call(this,t)}function iy(t){Vf.call(this,t),this.V=!1,this.hb=null,this.u=[],this.nb=this.Ha=this.F=this.ia=0,this.td=null,this.S=new pt(0,0),this.Da=new At(0,0),this.la=new pt(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=Am,this.hd=Yf,this.Kb=0,this.Jb=Om,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=Xm,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=Si,this.wr=!0,this.Dp=Si}function ey(t){Gf.call(this,t),this.$t=new pt(0,0)}Qg.className="TreeLayout",Qg.PathDefault=Cm,Qg.PathDestination=Tm,Qg.PathSource=Lm,Qg.SortingForwards=Am,Qg.SortingReverse=jm,Qg.SortingAscending=Fm,Qg.SortingDescending=Dm,Qg.AlignmentCenterSubtrees=Bm,Qg.AlignmentCenterChildren=Om,Qg.AlignmentStart=Im,Qg.AlignmentEnd=zm,Qg.AlignmentBus=Rm,Qg.AlignmentBusBranching=Em,Qg.AlignmentTopLeftBus=Vm,Qg.AlignmentBottomRightBus=Ym,Qg.CompactionNone=Gm,Qg.CompactionBlock=Xm,Qg.StyleLayered=Um,Qg.StyleLastParents=qm,Qg.StyleAlternating=Km,Qg.StyleRootOnly=Hm,Qg.ArrangementVertical=Wm,Qg.ArrangementHorizontal=Jm,Qg.ArrangementFixedRoots=Zm,Qg.LayerIndividual=_m,Qg.LayerSiblings=$m,Qg.LayerUniform=Qm,c(ty,Of),ty.prototype.createVertex=function(){return new iy(this)},ty.prototype.createEdge=function(){return new ey(this)},ty.className="TreeNetwork",c(iy,Vf),iy.prototype.copyInheritedPropertiesFrom=function(t){null!==t&&(this.nd=t.sorting,this.hd=t.comparer,this.Kb=t.angle,this.Jb=t.alignment,this.Uq=t.nodeIndent,this.Vq=t.nodeIndentPastParent,this.Wq=t.nodeSpacing,this.ie=t.layerSpacing,this.Aq=t.layerSpacingParentOverlap,this.Hp=t.compaction,this.Ap=t.breadthLimit,this.nr=t.rowSpacing,this.mr=t.rowIndent,this.Gp=t.commentSpacing,this.Fp=t.commentMargin,this.xr=t.setsPortSpot,this.dr=t.portSpot,this.wr=t.setsChildPortSpot,this.Dp=t.childPortSpot)},f.Object.defineProperties(iy.prototype,{initialized:{get:function(){return this.V},set:function(t){this.V!==t&&(this.V=t)}},parent:{get:function(){return this.hb},set:function(t){this.hb!==t&&(this.hb=t)}},children:{get:function(){return this.u},set:function(t){if(this.u!==t){if(null!==t)for(var i=t.length,e=0;ed.y+e.rowIndent&&(r=Math.min(r,Math.max(c.y,r-i.computeNodeIndent(e))))):e.alignment===Im?(r=n.top+o.y,0===o.y&&c.yd.x+e.rowIndent&&(r=Math.min(r,Math.max(c.x,r-i.computeNodeIndent(e))))):e.alignment===Im?(r=n.left+o.x,0===o.x&&c.xd.y+e.rowIndent&&(r=Math.min(r,Math.max(c.y,r-i.computeNodeIndent(e))))):e.alignment===Im?(r=n.top+o.y,0===o.y&&c.yd.x+e.rowIndent&&(r=Math.min(r,Math.max(c.x,r-i.computeNodeIndent(e))))):e.alignment===Im?(r=n.left+o.x,0===o.x&&c.x