dx-diagram.min.js 496 KB

123456789
  1. /*!
  2. * DevExpress Diagram (dx-diagram.min)
  3. * Version: 0.0.30
  4. * Build date: Tue Jul 23 2019
  5. *
  6. * Copyright (c) 2012 - 2019 Developer Express Inc. ALL RIGHTS RESERVED
  7. * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
  8. */
  9. !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.diagram=e():(t.DevExpress=t.DevExpress||{},t.DevExpress.diagram=e())}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=46)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){this.width=t,this.height=e}return t.prototype.clone=function(){return new t(this.width,this.height)},t.prototype.toString=function(){return JSON.stringify(this)},t.prototype.offset=function(e,n){return void 0===e&&(e=0),void 0===n&&(n=0),new t(Math.max(0,this.width+e),Math.max(0,this.height+n))},t.prototype.multiply=function(e,n){return void 0===e&&(e=1),void 0===n&&(n=e),new t(this.width*e,this.height*n)},t.prototype.equals=function(t){return t.width===this.width&&t.height===this.height},t}();e.Size=o;var i=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.toString=function(){return JSON.stringify(this)},t.prototype.offset=function(e,n){return void 0===e&&(e=0),void 0===n&&(n=0),new t(this.x+e,this.y+n)},t.prototype.multiply=function(e,n){return void 0===e&&(e=1),void 0===n&&(n=e),new t(this.x*e,this.y*n)},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.empty=function(){return new t(-1,-1)},t.plus=function(e,n){return new t(e.x+n.x,e.y+n.y)},t.minus=function(e,n){return new t(e.x-n.x,e.y-n.y)},t}();e.Point=i;var r=function(){function t(t,e,n,o){this.left=t,this.top=e,this.right=n,this.bottom=o}return t.prototype.clone=function(){return new t(this.left,this.top,this.right,this.bottom)},t}();e.Offset=r;var s=function(){function t(t,e){this.position=t,this.size=e}return Object.defineProperty(t.prototype,"left",{get:function(){return this.position.x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.position.y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.position.x+this.size.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.position.y+this.size.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return new i(this.position.x+this.size.width/2,this.position.y+this.size.height/2)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.size.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.size.height},enumerable:!0,configurable:!0}),t.prototype.clone=function(){return new t(this.position.clone(),this.size.clone())},t.prototype.toString=function(){return JSON.stringify(this)},t.prototype.contains=function(t){return this.left<=t.x&&t.x<=this.right&&this.top<=t.y&&t.y<=this.bottom},t.prototype.intersectX=function(t){return!(this.left>t.right||t.left>this.right)},t.prototype.intersectY=function(t){return!(this.top>t.bottom||t.top>this.bottom)},t.prototype.intersect=function(t){return this.intersectX(t)&&this.intersectY(t)},t.prototype.inflate=function(e,n){return n=void 0===n?e:n,new t(this.position.offset(-e,-n),this.size.offset(2*e,2*n))},t.prototype.resize=function(e,n){return new t(this.position,this.size.offset(e,n))},t.prototype.offset=function(e,n){return new t(this.position.offset(e,n),this.size)},t.prototype.multiply=function(e){return new t(this.position.multiply(e),this.size.multiply(e))},t.create=function(e,n,r,s){return new t(new i(e,n),new o(r,s))},t.createByPoints=function(e,n){return t.createByPositions(e.x,e.y,n.x,n.y)},t.createByPositions=function(e,n,o,i){var r=Math.min(e,o),s=Math.min(n,i),a=Math.abs(o-e),c=Math.abs(i-n);return t.create(r,s,a,c)},t}();e.Rectangle=s;var a=function(){function t(t,e){this.startPoint=t,this.endPoint=e}return Object.defineProperty(t.prototype,"distance",{get:function(){return p.getDistance(this.startPoint,this.endPoint)},enumerable:!0,configurable:!0}),t.prototype.intersect=function(t){return!!(this.startPoint.equals(t.startPoint)||this.endPoint.equals(t.startPoint)||this.startPoint.equals(t.endPoint)||this.endPoint.equals(t.endPoint))||this.intersectCore(t)&&t.intersectCore(this)},t.prototype.intersectRect=function(e){var n=e.position,o=new i(e.left,e.bottom),r=new i(e.right,e.top),s=new i(e.right,e.bottom);return e.contains(this.startPoint)||e.contains(this.endPoint)||this.intersect(new t(n,o))||this.intersect(new t(o,s))||this.intersect(new t(s,r))||this.intersect(new t(r,n))},t.prototype.intersectCore=function(t){if(this.startPoint.x===this.endPoint.x){if(this.startPoint.x-t.endPoint.x!=0)return(this.startPoint.x-t.startPoint.x)/(this.startPoint.x-t.endPoint.x)<=0;if(t.endPoint.y-this.endPoint.y!=0)return(t.endPoint.y-this.startPoint.y)/(t.endPoint.y-this.endPoint.y)<=0}if(this.startPoint.y===this.endPoint.y){if(this.startPoint.y-t.endPoint.y!=0)return(this.startPoint.y-t.startPoint.y)/(this.startPoint.y-t.endPoint.y)<=0;if(t.endPoint.x-this.endPoint.x!=0)return(t.endPoint.x-this.startPoint.x)/(t.endPoint.x-this.endPoint.x)<=0}var e=(this.endPoint.y-this.startPoint.y)/(this.endPoint.x-this.startPoint.x),n=this.startPoint.y+(t.startPoint.x-this.startPoint.x)*e,o=this.startPoint.y+(t.endPoint.x-this.startPoint.x)*e,i=t.startPoint.y-n,r=t.endPoint.y-o;return 0===i&&0===r?(this.startPoint.y-n)/(this.endPoint.y-n)<=0||(this.startPoint.y-o)/(this.endPoint.y-o)<=0:0===i||0===r||i/r<0},t.create=function(e,n,o,r){return new t(new i(e,n),new i(o,r))},t.createByPoints=function(e,n){return t.create(e.x,e.y,n.x,n.y)},t}();e.Segment=a;var c=function(){function t(){this.listeners=[]}return t.prototype.add=function(t){if(!t)throw new Error("Not Implemented");this.hasEventListener(t)||this.listeners.push(t)},t.prototype.remove=function(t){for(var e,n=0;e=this.listeners[n];n++)if(e===t){this.listeners.splice(n,1);break}},t.prototype.raise=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o,i=0;o=this.listeners[i];i++)o[t].apply(o,e)},t.prototype.raise1=function(t){for(var e,n=0;e=this.listeners[n];n++)t(e)},t.prototype.hasEventListener=function(t){for(var e=0,n=this.listeners.length;e<n;e++)if(this.listeners[e]===t)return!0;return!1},t}();e.EventDispatcher=c;var u=function(){function t(){}return t.binaryIndexOf=function(t,e,n,o){void 0===n&&(n=0),void 0===o&&(o=-2);var i=0==n;for(-2==o&&(o=t.length-1);n<=o;){var r=n+(o-n>>1),s=e(t[r]);if(s<0)n=r+1;else{if(!(s>0))return r;o=r-1}}return i?~n:-1},t.normedBinaryIndexOf=function(e,n,o,i){void 0===o&&(o=0),void 0===i&&(i=-2);var r=t.binaryIndexOf(e,n,o,i);return t.binaryIndexNormalizator(r)},t.binaryIndexNormalizator=function(t){return t<0?~t-1:t},t}();e.Utils=u;var p=function(){function t(){}return t.getCommonRectangle=function(t){if(!t.length)return s.create(0,0,0,0);var e=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,i=-Number.MAX_VALUE;return t.forEach(function(t){e=Math.min(e,t.left),n=Math.max(n,t.right),o=Math.min(o,t.top),i=Math.max(i,t.bottom)}),s.create(e,o,n-e,i-o)},t.findFreeSpace=function(t,e,n){var o=[0],r=[0];t.forEach(function(t){o.push(t.left),o.push(t.right),r.push(t.top),r.push(t.bottom)}),o=o.sort(function(t,e){return t-e}).reduce(function(t,e,n){return o[n-1]!==e&&t.push(e)&&t||t},[]);for(var s=(r=r.sort(function(t,e){return t-e}).reduce(function(t,e,n){return r[n-1]!==e&&t.push(e)&&t||t},[])).map(function(t){return o.map(function(t,e){return o[e+1]-t})}),a=function(t,e){for(var n=u.binaryIndexOf(o,function(t){return t-e.left}),i=u.binaryIndexOf(o,function(t){return t-e.right}),a=u.binaryIndexOf(r,function(t){return t-e.top}),c=u.binaryIndexOf(r,function(t){return t-e.bottom}),p=a;p<c;p++)for(var h=n;h<i;h++)s[p][h]*=-1},c=0,p=void 0;p=t[c];c++)a(0,p);for(var h=0;h<r.length;h++)for(var l=0;l<o.length-1;l++){var d=this.checkRect(s,r,o,h,l,e,n);if(d>0)l=d;else if(0===d)return new i(o[l],r[h])}return null},t.checkRect=function(t,e,n,o,i,r,s){for(var a=0,c=0,u=n.length-2,p=o;p<e.length;p++){a=e[p+1]-e[o];for(var h=i;h<=u;h++){if(t[p][h]<0)return 0===h?-1:h;if(c=n[h+1]-n[i],r.width<=c||!s&&h===n.length-2&&r.width/2<=c){if(r.height<=a||!s&&p===e.length-2&&r.height/2<=a)return 0;u=h}}}},t.getArrowPoints=function(t,e,n,o){if(t.x===e.x&&t.y===e.y)return{point1:t.clone(),point2:t.clone()};var r=e.x-t.x,s=e.y-t.y,a=Math.sqrt(Math.pow(r,2)+Math.pow(s,2)),c=r/a,u=s/a,p=t.x+n*c+o*u,h=t.y+n*u-o*c,l=t.x+n*c-o*u,d=t.y+n*u+o*c;return{point1:new i(p,h),point2:new i(l,d)}},t.removeUnnecessaryLinePoints=function(t,e,n){void 0===n&&(n=function(t){return void 0!==t}),this.removeDuplicatedPoints(t,e,n),this.removeOneLinePoints(t,e,n),this.removeBackwardPoints(t,e,n)},t.removeBackwardPoints=function(t,e,n){void 0===n&&(n=function(t){return void 0!==t});for(var o,i=0;(o=t[i])&&!(t.length<=2);){var r=this.getNextPoint(t,i,!0,n),s=this.getNextPoint(t,i,!1,n);if(s&&r){if(o.x==s.x&&o.x==r.x&&(o.y>s.y&&o.y>r.y||o.y<s.y&&o.y<r.y)&&e(t[i],i))continue;if(o.y==s.y&&o.y==r.y&&(o.x>s.x&&o.x>r.x||o.x<s.x&&o.x<r.x)&&e(t[i],i))continue}i++}},t.removeOneLinePoints=function(t,e,n){void 0===n&&(n=function(t){return void 0!==t});for(var o,i=0;(o=t[i])&&!(t.length<=2);){var r=this.getNextPoint(t,i,!0,n),s=this.getNextPoint(t,i,!1,n);if(s&&r){if((o.x==s.x&&o.x==r.x||o.y==s.y&&o.y==r.y)&&e(t[i],i))continue;var a=(r.y-s.y)/(r.x-s.x);if(r.y-t[i].y==(r.x-t[i].x)*a&&e(t[i],i))continue}i++}},t.removeDuplicatedPoints=function(t,e,n){void 0===n&&(n=function(t){return void 0!==t});for(var o,i=0;(o=t[i])&&!(t.length<=2);){var r=this.getNextPoint(t,i,!0,n);if(r&&o.x==r.x&&o.y==r.y){var s=i+1;if(s===t.length-1&&s--,e(t[s],s))continue}i++}},t.getNextPoint=function(t,e,n,o){for(var i,r=e+(n?1:-1);i=t[r];){if(o(i))return i;r+=n?1:-1}},t.getDistance=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},t.getPathLength=function(e){var n,o=0;return e.forEach(function(e){if(void 0!==n){var i=t.getDistance(e,n);o+=i}n=e}),o},t.getPathPointByPosition=function(e,n){if(!e.length)throw new Error("Invalid points");if(0>n||n>1)throw new Error("Invalid relative position");var o=this.getPathLength(e);if(e.length<=2&&0===o)return e[0];for(var r=o*n,s=0,a=1;a<e.length;a++){var c=t.getDistance(e[a],e[a-1]);if(s+c>=r){var u=r-s,p=(e[a].x-e[a-1].x)/c,h=(e[a].y-e[a-1].y)/c;return new i(e[a-1].x+p*u,e[a-1].y+h*u)}s+=c}return e[e.length-1]},t.getLineAngle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},t.getTriangleBeginAngle=function(t,e,n){var o=this.getLineAngle(t,e),i=this.getLineAngle(t,n);return Math.abs(i-o)},t.getTriangleEndAngle=function(t,e,n){var o=this.getLineAngle(t,e),i=this.getLineAngle(n,e);return Math.abs(o-i)},t.getPathPointByPoint=function(e,n){if(!e.length)throw new Error("Invalid points");if(1===e.length)return e[0];for(var o,i=Number.MAX_VALUE,r=1;r<e.length;r++){var s=e[r-1],a=e[r];if(n.equals(s)){o=s.clone();break}if(n.equals(a)){o=a.clone();break}var c=this.getTriangleBeginAngle(s,a,n),u=this.getTriangleEndAngle(s,a,n),p=t.getDistance(n,s),h=t.getDistance(n,a),l=p*Math.sin(c),d=void 0;if((d=Math.PI/2<=c&&c<=3*Math.PI/2?p:Math.PI/2<=u&&u<=3*Math.PI/2?h:Math.abs(l))<i)if(i=d,Math.PI/2<=c&&c<=3*Math.PI/2)o=s.clone();else if(Math.PI/2<=u&&u<=3*Math.PI/2)o=a.clone();else{var f=this.getLineAngle(s,a),y=Math.fround(Math.abs(l*Math.sin(f))),m=Math.fround(Math.abs(l*Math.cos(f))),g=n.y-s.y<Math.fround((n.x-s.x)*Math.tan(f));0<=f&&f<=Math.PI/2?(y*=g?-1:1,m*=g?1:-1):Math.PI/2<=f&&f<=Math.PI?(y*=g?1:-1,m*=g?1:-1):0>=f&&f>=-Math.PI/2?(y*=g?1:-1,m*=g?1:-1):-Math.PI/2>=f&&f>=-Math.PI&&(y*=g?-1:1,m*=g?1:-1),o=n.offset(y,m)}}return o},t.getPathPositionByPoint=function(e,n,o){void 0===o&&(o=100),n=this.getPathPointByPoint(e,n);for(var i=this.getPathLength(e),r=0,s=1;s<e.length;s++){var a=e[s-1],c=e[s],u=t.getDistance(c,a),p=Math.atan((c.y-a.y)/(c.x-a.x));if(n.x===c.x&&n.x===a.x||n.y===c.y&&n.y===a.y||Math.fround(n.y-a.y)===Math.fround((n.x-a.x)*Math.tan(p)))return 0!==Math.sin(p)?r+=Math.abs((n.y-a.y)/Math.sin(p)):r+=Math.abs(n.x-a.x),Math.round(r*o/i)/o;r+=u}return 1},t.arePointsEqual=function(t,e){var n=t.length;if(n!=e.length)return!1;for(var o=0;o<n;o++)if(!t[o].equals(e[o]))return!1;return!0},t}();e.GeometryUtils=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.Undefined=0]="Undefined",t[t.General=1]="General",t[t.Flowchart=2]="Flowchart",t[t.Custom=3]="Custom"}(e.ShapeCategory||(e.ShapeCategory={})),function(t){t[t.Text=0]="Text",t[t.Rectangle=1]="Rectangle",t[t.Ellipsis=2]="Ellipsis",t[t.Cross=3]="Cross",t[t.Triangle=4]="Triangle",t[t.Diamond=5]="Diamond",t[t.Heart=6]="Heart",t[t.Pentagon=7]="Pentagon",t[t.Hexagon=8]="Hexagon",t[t.Octagon=9]="Octagon",t[t.Star=10]="Star",t[t.ArrowLeft=11]="ArrowLeft",t[t.ArrowTop=12]="ArrowTop",t[t.ArrowRight=13]="ArrowRight",t[t.ArrowBottom=14]="ArrowBottom",t[t.ArrowNorthSouth=15]="ArrowNorthSouth",t[t.ArrowEastWest=16]="ArrowEastWest",t[t.Process=17]="Process",t[t.Decision=18]="Decision",t[t.Terminator=19]="Terminator",t[t.PredefinedProcess=20]="PredefinedProcess",t[t.Document=21]="Document",t[t.MultipleDocuments=22]="MultipleDocuments",t[t.ManualInput=23]="ManualInput",t[t.Preparation=24]="Preparation",t[t.Data=25]="Data",t[t.Database=26]="Database",t[t.HardDisk=27]="HardDisk",t[t.InternalStorage=28]="InternalStorage",t[t.PaperTape=29]="PaperTape",t[t.ManualOperation=30]="ManualOperation",t[t.Delay=31]="Delay",t[t.StoredData=32]="StoredData",t[t.Display=33]="Display",t[t.Merge=34]="Merge",t[t.Or=35]="Or",t[t.SummingJunction=36]="SummingJunction",t[t.Custom=37]="Custom"}(e.ShapeType||(e.ShapeType={}))},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(13),s=n(10),a=function(t){function e(e,n,o,i,r){var s=t.call(this,n,o,i,r)||this;return s.commands=e,s}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(s.svgNS,"path")},e.prototype.applyElementProperties=function(e){e.setAttribute("d",this.commands.map(function(t){return t.toString()}).join(" ")),t.prototype.applyElementProperties.call(this,e)},e}(n(15).SvgPrimitive);e.PathPrimitive=a;var c=function(){function t(){}return t.prototype.getUnitVaue=function(t){return"number"==typeof t?r.UnitConverter.twipsToPixels(t).toString():t},t}();e.PathPrimitiveCommand=c;var u=function(t){function e(e,n){var o=t.call(this)||this;return o.x=e,o.y=n,o}return i(e,t),e.prototype.toString=function(){return"M "+this.getUnitVaue(this.x)+" "+this.getUnitVaue(this.y)},e}(c);e.PathPrimitiveMoveToCommand=u;var p=function(t){function e(e,n){var o=t.call(this)||this;return o.x=e,o.y=n,o}return i(e,t),e.prototype.toString=function(){return"L "+this.getUnitVaue(this.x)+" "+this.getUnitVaue(this.y)},e}(c);e.PathPrimitiveLineToCommand=p;var h=function(t){function e(e,n,o,i,r,s){var a=t.call(this)||this;return a.x1=e,a.y1=n,a.x2=o,a.y2=i,a.x3=r,a.y3=s,a}return i(e,t),e.prototype.toString=function(){return"C "+this.getUnitVaue(this.x1)+" "+this.getUnitVaue(this.y1)+","+this.getUnitVaue(this.x2)+" "+this.getUnitVaue(this.y2)+","+this.getUnitVaue(this.x3)+" "+this.getUnitVaue(this.y3)},e}(c);e.PathPrimitiveCubicCurveToCommand=h;var l=function(t){function e(e,n,o,i){var r=t.call(this)||this;return r.x1=e,r.y1=n,r.x2=o,r.y2=i,r}return i(e,t),e.prototype.toString=function(){return"Q "+this.getUnitVaue(this.x1)+" "+this.getUnitVaue(this.y1)+","+this.getUnitVaue(this.x2)+" "+this.getUnitVaue(this.y2)},e}(c);e.PathPrimitiveQuadraticCurveToCommand=l;var d=function(t){function e(e,n,o,i,r,s,a){var c=t.call(this)||this;return c.rx=e,c.ry=n,c.xAxisRotation=o,c.largeArcFlag=i,c.sweepFag=r,c.x=s,c.y=a,c}return i(e,t),e.prototype.toString=function(){return"A "+this.getUnitVaue(this.rx)+" "+this.getUnitVaue(this.ry)+" "+this.getUnitVaue(this.xAxisRotation)+" "+(this.largeArcFlag?"1":"0")+" "+(this.sweepFag?"1":"0")+this.getUnitVaue(this.x)+","+this.getUnitVaue(this.y)},e}(c);e.PathPrimitiveArcToCommand=d;var f=function(t){function e(){return t.call(this)||this}return i(e,t),e.prototype.toString=function(){return"z"},e}(c);e.PathPrimitiveClosePathCommand=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o,i=n(0),r=n(47);!function(t){t[t.Undefined=-1]="Undefined",t[t.North=0]="North",t[t.East=1]="East",t[t.South=2]="South",t[t.West=3]="West"}(o=e.ConnectionPointSide||(e.ConnectionPointSide={}));var s=function(){function t(){this.key=void 0,this.dataKey=void 0,this.attachedConnectors=[],this.zIndex=0,this.locked=!1,this.style=new r.Style,this.styleText=new r.StyleText}return t.prototype.assign=function(t){t.key=this.key,t.dataKey=this.dataKey,t.locked=this.locked,t.attachedConnectors=this.attachedConnectors.slice(),t.style=this.style.clone(),t.styleText=this.styleText.clone(),t.zIndex=this.zIndex},t.prototype.invalidatePrimitives=function(){delete this.primitives,delete this.selectorPrimitives},t.prototype.getPrimitives=function(){return this.primitives||(this.primitives=this.createPrimitives()),this.primitives},t.prototype.getSelectorPrimitives=function(){return this.selectorPrimitives||(this.selectorPrimitives=this.createSelectorPrimitives()),this.selectorPrimitives},t.prototype.getConnectionPoint=function(t,e){return this.getConnectionPointCore(t,e).toPoint()},t.prototype.getConnectionPointCore=function(t,e){return t<0&&e&&(t=this.getNearestConnectionPoint(e)),this.getConnectionPoints()[t]},t.prototype.getNearestConnectionPoint=function(t){var e,n=Number.MAX_VALUE;return this.getConnectionPoints().forEach(function(o,r){var s=i.GeometryUtils.getDistance(o,t);s<n&&(n=s,e=r)}),e},t.prototype.getConnectionPointIndex=function(t){var e=this.getConnectionPoints();return e.reduce(function(n,i,r){return t===o.North&&i.y<e[n].y?r:t===o.South&&i.y>e[n].y?r:t===o.West&&i.x<e[n].x?r:t===o.East&&i.x>e[n].x?r:n},0)},Object.defineProperty(t.prototype,"isVisible",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowHasText",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.intersectedByRect=function(t){return this.rectangle.intersect(t)},t}();e.DiagramItem=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.uniqueId=-1}return t.prototype.changeModified=function(){return!0},t.prototype.getName=function(){return this.constructor.name},t}();e.HistoryItem=r;var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.historyItems=[],e}return i(e,t),e.prototype.changeModified=function(){for(var t,e=0;t=this.historyItems[e];e++)if(t.changeModified())return!0;return!1},e.prototype.redo=function(t){for(var e,n=0;e=this.historyItems[n];n++)e.redo(t)},e.prototype.undo=function(t){for(var e,n=this.historyItems.length-1;e=this.historyItems[n];n--)e.undo(t)},e.prototype.add=function(t){if(null==t)throw new Error("cannot be null");this.historyItems.push(t)},e}(r);e.CompositionHistoryItem=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,s=n(3),a=n(0),c=n(13),u=n(69),p=n(105),h=n(106),l=n(28),d=n(112),f=n(50),y=n(72),m=n(14),g=n(26);!function(t){t[t.Begin=0]="Begin",t[t.End=1]="End"}(r=e.ConnectorPosition||(e.ConnectorPosition={}));var v=function(t){function e(e){var n=t.call(this)||this;if(n.beginConnectionPointIndex=-1,n.endConnectionPointIndex=-1,n.properties=new l.ConnectorProperties,n.points=e.map(function(t){return t.clone()}),e.length<2)throw Error("Points count should be greater than 1");return n.texts=new d.ConnectorTexts,n}return i(e,t),e.prototype.assign=function(e){t.prototype.assign.call(this,e),e.beginItem=this.beginItem,e.beginConnectionPointIndex=this.beginConnectionPointIndex,e.endItem=this.endItem,e.endConnectionPointIndex=this.endConnectionPointIndex,e.properties=this.properties.clone(),e.texts=this.texts.clone()},e.prototype.clone=function(){var t=new e(this.points);return this.assign(t),t},e.prototype.getRenderPoints=function(t){return void 0===t&&(t=!1),void 0===this.renderPoints&&(this.renderPoints=this.getCalculator().getPoints(),this.renderPointsWithoutSkipped=this.renderPoints.filter(function(t){return!t.skipped})),t?this.renderPoints:this.renderPointsWithoutSkipped},e.prototype.getText=function(t){var e=this.texts.get(t);return e?e.value:""},e.prototype.setText=function(t,e){e&&""!==e?this.texts.set(t,new d.ConnectorText(t,e)):this.texts.remove(t)},e.prototype.getTextPoint=function(t){var e=this.getRenderPoints();return a.GeometryUtils.getPathPointByPosition(e,t)},e.prototype.getTextPositionByPoint=function(t){var e=this.getRenderPoints(),n=a.GeometryUtils.getPathLength(e),o=a.GeometryUtils.getPathPositionByPoint(e,t),i=c.UnitConverter.pointsToTwips(parseInt(this.styleText["font-size"]));return i>o*n?i/n:i>n-o*n?(n-i)/n:o},e.prototype.getTextRectangle=function(t){return new a.Rectangle(this.getTextPoint(t),new a.Size(0,0))},e.prototype.getCalculator=function(){return this.properties.lineOption===l.ConnectorLineOption.Straight?new p.ConnectorPointsCalculator(this):new h.ConnectorPointsOrthogonalCalculator(this)},e.prototype.invalidateRenderPoints=function(){delete this.renderPoints,delete this.renderPointsWithoutSkipped},e.prototype.createPrimitives=function(){var t=this,e=[],n=this.getRenderPoints();return n.forEach(function(o,i){i>0&&e.push(t.createSegmentPrimitive(n[i-1],o,t.style,null))}),n.length>1&&(this.properties.startLineEnding!==l.ConnectorLineEnding.None&&(e=e.concat(this.createLineEndingPrimitives(n[0],n[1]))),this.properties.endLineEnding!==l.ConnectorLineEnding.None&&(e=e.concat(this.createLineEndingPrimitives(n[n.length-1],n[n.length-2])))),e.concat(this.createTextPrimitives())},e.prototype.createSelectorPrimitives=function(){var t=this,e=[],n=this.getRenderPoints();return n.forEach(function(o,i){i>0&&e.push(t.createSegmentPrimitive(n[i-1],o,null,"selector"))}),e},e.prototype.createTextPrimitives=function(){var t=this;if(!this.allowHasText)return[];var e=[];return this.texts.forEach(function(n){var o=t.getText(n.position);if(o&&""!==o){var i=t.getTextPoint(n.position),r="filter"+t.key;e=e.concat([new f.TextPrimitive(i.x,i.y,o,void 0,t.styleText,!0,null,r,function(e){g.RenderUtils.setElementEventData(e,m.MouseEventElementType.ConnectorText,t.key,n.position)}),new y.TextFilterPrimitive(r)])}}),e},e.prototype.createSegmentPrimitive=function(t,e,n,o){return new u.LinePrimitive(t.x,t.y,e.x,e.y,n,o)},e.prototype.createLineEndingPrimitives=function(t,n){var o,i=e.arrowHeight;t.x===n.x&&((o=Math.abs(t.y-n.y))<i&&(i=o));t.y===n.y&&((o=Math.abs(t.x-n.x))<i&&(i=o));var r=a.GeometryUtils.getArrowPoints(t,n,i,e.arrowWidth);return[new u.LinePrimitive(r.point1.x,r.point1.y,t.x,t.y,this.style),new u.LinePrimitive(r.point2.x,r.point2.y,t.x,t.y,this.style)]},e.prototype.getExtremeItem=function(t){return t===r.Begin?this.beginItem:t===r.End?this.endItem:null},e.prototype.getExtremeConnectionPointIndex=function(t){return t===r.Begin?this.beginConnectionPointIndex:t===r.End?this.endConnectionPointIndex:-1},Object.defineProperty(e.prototype,"rectangle",{get:function(){var t=this.getRenderPoints(),e=t.map(function(t){return t.x}),n=t.map(function(t){return t.y}),o=e.reduce(function(t,e){return Math.min(t,e)},Number.MAX_VALUE),i=e.reduce(function(t,e){return Math.max(t,e)},-Number.MAX_VALUE),r=n.reduce(function(t,e){return Math.min(t,e)},Number.MAX_VALUE),s=n.reduce(function(t,e){return Math.max(t,e)},-Number.MAX_VALUE);return a.Rectangle.create(o,r,i-o,s-r)},enumerable:!0,configurable:!0}),e.prototype.getConnectionPoints=function(){return[]},e.prototype.getConnectionPointsForSelection=function(){return[]},e.prototype.getConnectionPointSide=function(t,e){return s.ConnectionPointSide.Undefined},e.prototype.getConnectionPointForSelectionSide=function(t){return s.ConnectionPointSide.Undefined},e.prototype.getSegments=function(){var t=this.getRenderPoints(),e=[];return t.forEach(function(n,o){o>0&&e.push(a.Segment.createByPoints(t[o-1],n))}),e},e.prototype.intersectedByRect=function(t){var e=!1;return this.getSegments().forEach(function(n){n.intersectRect(t)&&(e=!0)}),e},e.arrowHeight=c.UnitConverter.pixelsToTwips(8),e.arrowWidth=c.UnitConverter.pixelsToTwips(2),e.minOffset=c.UnitConverter.pixelsToTwips(18),e.minTextHeight=c.UnitConverter.pixelsToTwips(12),e}(s.DiagramItem);e.Connector=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(t,e,n){this.visible=!0,this.denyUpdateValue=!1,this.enabled=t,this.value=e,this.items=n};e.SimpleCommandState=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this.control=t}return t.prototype.execute=function(t){var e=this.getState();if(!e.enabled)return!1;this.control.beginUpdate();var n=this.executeCore(e,t);return this.control.endUpdate(),n},t.prototype.updateControlState=function(){this.lockUIUpdating()||this.control.barManager.updateItemsState()},t.prototype.lockUIUpdating=function(){return!1},t.prototype.isEnabled=function(){return!0},t}();e.CommandBase=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(101),i=n(35),r=n(36),s=n(114),a=n(115),c=n(5),u=n(3),p=n(0),h=n(116),l=n(117),d=n(73),f=n(74),y=n(118),m=n(29),g=n(9),v=n(28),P=n(13),C=n(37),S=n(51),_=n(58),w=n(59),x=n(34),b=n(61),O=n(40),M=n(18),E=n(19),T=n(154),I=n(155),A=function(){function t(){}return t.setShapePosition=function(t,e,n,i,r){e.findShape(n).position.equals(i)||r.call(t,new o.MoveShapeHistoryItem(n,i))},t.setShapeSize=function(t,e,n,o,i,r){var s=e.findShape(n);s.size.equals(i)&&s.position.equals(o)||r.call(t,new l.ResizeShapeHistoryItem(n,o,i))},t.setConnectorPoint=function(t,e,n,o,i,s){e.findConnector(n).points[o].equals(i)||s.call(t,new r.MoveConnectorPointHistoryItem(n,o,i))},t.getSymmetricDifference=function(t,e){return e.filter(function(e){return e instanceof c.Connector?!(e.beginItem&&t[e.beginItem.key]||e.endItem&&t[e.endItem.key]):!t[e.key]})},t.offsetLayoutToFreeSpace=function(t,e){var n=t.getRectangle(!0),o=p.GeometryUtils.findFreeSpace(e,n.size.offset(this.spacing,this.spacing),!1);if(o)return t.offsetNodes(o.x+this.spacing,o.y+this.spacing);var i=e.reduce(function(t,e){return e.right>t?e.right:t},-1);return t.offsetNodes(i+this.spacing,0===n.top?this.spacing:0)},t.applyLayoutToNodes=function(e,n,o,i){var s=i.reduce(function(t,e){return t[e.key]=t},{});o.forEachNode(function(o,i){var a=n.findShape(i),c=o.position.offset(-a.position.x,-a.position.y);t.setShapePosition(e,n,i,o.position,e.addAndRedo),c.x&&c.y&&a.attachedConnectors.filter(function(t){return!s[t.key]}).forEach(function(n){t.updateConnectorAttachedPoints(e,n,e.addOrModifyAndRedo);for(var o=n.beginItem?1:0,i=n.endItem?n.points.length-2:n.points.length-1,s=o;s<=i;s++)e.addAndRedo(new r.MoveConnectorPointHistoryItem(n.key,s,n.points[s].offset(c.x,c.y)))})})},t.applyLayoutToConnectors=function(t,e,n){var o=this;n.filter(function(t){return t.beginItem&&t.endItem}).forEach(function(n){var r=e.edgeToPosition[n.key];if(r&&(r.beginIndex!==n.beginConnectionPointIndex&&t.addAndRedo(new i.SetConnectionPointIndexHistoryItem(n,r.beginIndex,c.ConnectorPosition.Begin)),r.endIndex!==n.endConnectionPointIndex&&t.addAndRedo(new i.SetConnectionPointIndexHistoryItem(n,r.endIndex,c.ConnectorPosition.End))),o.updateConnectorAttachedPoints(t,n,t.addAndRedo),r)for(;n.points.length>2;)t.addAndRedo(new h.DeleteConnectorPointHistoryItem(n.key,1))})},t.adjustLayoutToSnapGrid=function(t,e){var n=this;e.nodeKeys.forEach(function(o){e.nodeToLayout[o].position.x=n.getSnappedPos(t,e.nodeToLayout[o].position.x),e.nodeToLayout[o].position.y=n.getSnappedPos(t,e.nodeToLayout[o].position.y)})},t.updateConnectorAttachedPoints=function(t,e,n){if(e.beginItem){var o=e.beginItem.getConnectionPoint(e.beginConnectionPointIndex,e.points[1]);e.points[0].equals(o)||n.call(t,new r.MoveConnectorPointHistoryItem(e.key,0,o))}if(e.endItem){o=e.endItem.getConnectionPoint(e.endConnectionPointIndex,e.points[e.points.length-2]);e.points[e.points.length-1].equals(o)||n.call(t,new r.MoveConnectorPointHistoryItem(e.key,e.points.length-1,o))}},t.removeUnnecessaryConnectorPoints=function(t,e,n,o){p.GeometryUtils.removeUnnecessaryLinePoints(e.points,function(i,r){var s=!0;if(n&&n.forEach(function(t){t&&t.equals(i)&&(s=!1)}),s)return t.addOrModifyAndRedo(new h.DeleteConnectorPointHistoryItem(e.key,r)),void 0!==o&&o(r),!0})},t.removeConnectorIntermediatePoints=function(t,e){if(!(e.properties.lineOption!==v.ConnectorLineOption.Orthogonal||e.points.length<=2)){var n=!1;if(this.isShapeIntersectConnectorPointsLine(e.beginItem,e)&&(n=!0),this.isShapeIntersectConnectorPointsLine(e.endItem,e)&&(n=!0),n)for(;e.points.length>2;)t.addOrModifyAndRedo(new h.DeleteConnectorPointHistoryItem(e.key,1))}},t.isShapeIntersectConnectorPointsLine=function(t,e){if(void 0===t)return!1;for(var n,o=c.Connector.minOffset-P.UnitConverter.pixelsToTwips(1),i=t.rectangle.inflate(o,o),r=1;r<e.points.length-1;r++){if(void 0!==n){if(n.x===e.points[r].x&&i.left<=n.x&&n.x<=i.right)return!0;if(n.y===e.points[r].y&&i.top<=n.y&&n.y<=i.bottom)return!0}n=e.points[r]}return!1},t.getSnappedPos=function(t,e){return Math.round(e/t.gridSize)*t.gridSize},t.tryUpdateModelSize=function(t,e,n){var o=this.getRequiredPageSizeChanges(e);(o.bottom||o.left||o.right||o.top)&&(t.addOrModifyAndRedo(new s.ModelResizeHistoryItem(o)),(o.left||o.top)&&(t.addOrModifyAndRedo(new a.UpdatePositionsOnPageResizeHistoryItem(o.left,o.top)),void 0!==n&&n(o.left,o.top)))},t.deleteItems=function(t,e,n,o){t.beginTransaction(),o.forEach(function(e){if(e instanceof g.Shape){for(var n=e;n.attachedConnectors.length>0;){var o=n.attachedConnectors[0];t.addAndRedo(new d.DeleteConnectionHistoryItem(o,o.beginItem===n?c.ConnectorPosition.Begin:c.ConnectorPosition.End))}t.addAndRedo(new f.DeleteShapeHistoryItem(n.key))}e instanceof c.Connector&&((o=e).beginItem&&t.addAndRedo(new d.DeleteConnectionHistoryItem(o,c.ConnectorPosition.Begin)),o.endItem&&t.addAndRedo(new d.DeleteConnectionHistoryItem(o,c.ConnectorPosition.End)),t.addAndRedo(new y.DeleteConnectorHistoryItem(o.key)))}),this.tryUpdateModelSize(t,e),t.addAndRedo(new m.SetSelectionHistoryItem(n,[])),t.endTransaction()},t.deleteAllItems=function(t,e,n){this.deleteItems(t,e,n,e.items.slice())},t.deleteSelection=function(t,e,n){this.deleteItems(t,e,n,n.getSelectedItems())},t.cloneSelectionToOffset=function(e,n,o,i,r){e.beginTransaction();var s=o.getSelectedShapes(),a={},c=[];s.forEach(function(t,n){var o=t.clone();o.position=o.position.offset(i,r),e.addOrModifyAndRedo(new T.CloneShapeHistoryItem(o)),a[t.key]=o,c.push(o.key)}),o.getSelectedConnectors().forEach(function(t,n){var o=t.clone();o.points.forEach(function(t){t.x+=i,t.y+=r}),e.addOrModifyAndRedo(new I.CloneConnectorHistoryItem(o,t.beginItem?a[t.beginItem.key]:null,t.endItem?a[t.endItem.key]:null)),c.push(o.key)}),e.addOrModifyAndRedo(new m.SetSelectionHistoryItem(o,c)),t.tryUpdateModelSize(e,n),e.endTransaction()},t.createItemsByDataSource=function(e,n,o,r,s,a){var u=0,h=0,l={},d=[],f=[];e.beginTransaction(),r.nodes.forEach(function(t){var o=new p.Point(2e3*h++,2e3*u),i=a?t.key:void 0,r=new S.AddShapeHistoryItem(t.type,o,t.text,i);e.addAndRedo(r),void 0!==t.key&&(l[t.key]=r.shapeKey),h>4&&(h=0,u++),d.push(n.findShape(r.shapeKey))}),r.edges.forEach(function(t){var o=n.findShape(l[t.to]),r=n.findShape(l[t.from]);if(o&&void 0!==r){var s=a?t.key:void 0,u=new _.AddConnectorHistoryItem([o.position.clone(),r.position.clone()],s);e.addAndRedo(u);var p=n.findConnector(u.connectorKey);e.addAndRedo(new i.AddConnectionHistoryItem(p,r,0,c.ConnectorPosition.Begin)),e.addAndRedo(new i.AddConnectionHistoryItem(p,o,0,c.ConnectorPosition.End)),f.push(n.findConnector(u.connectorKey))}});var y=x.Graph.create(d,f).cast(w.LayoutUtils.shapeToLayout),g=s===C.DataLayoutType.Tree?new b.TreeLayoutBuilder(new M.TreeLayoutSettings,y).build():new O.SugiyamaLayoutBuilder(new M.LayoutSettings,y).build(),v=t.getSymmetricDifference(g.nodeToLayout,n.items);g=t.offsetLayoutToFreeSpace(g,v.map(function(t){return t.rectangle})),t.applyLayoutToNodes(e,n,g,f),t.applyLayoutToConnectors(e,g,f);var P=f.map(function(t){return t.key}).concat(d.map(function(t){return t.key}));e.addAndRedo(new m.SetSelectionHistoryItem(o,P)),t.tryUpdateModelSize(e,n),e.endTransaction()},t.getRequiredPageSizeChanges=function(t){var e=t.getRectangle(),n=-Math.floor(e.left/t.pageWidth),o=-Math.floor(e.top/t.pageHeight),i=-Math.floor((t.size.width-e.right)/t.pageWidth),r=-Math.floor((t.size.height-e.bottom)/t.pageHeight);return new p.Offset(n*t.pageWidth,o*t.pageHeight,i*t.pageWidth,r*t.pageHeight)},t.getPositionByDirection=function(t,e,n){return e*=t?1:-1,(n*=t?1:-1)>0?u.ConnectionPointSide.South:n<0?u.ConnectionPointSide.North:e>0?u.ConnectionPointSide.East:e<0?u.ConnectionPointSide.West:u.ConnectionPointSide.Undefined},t.getNextItemKey=function(t,e,n){if(!t.length&&void 0===n)return"0";for(var o=t.length-1;o>=0&&null==(n=n||t[o]);o--);for(var i=this.generateNextItemKey(n||"0");!e(i);)i=this.generateNextItemKey(i);return i},t.generateNextItemKey=function(t){for(var e=t.length-1;e>=0;e--){if(!this.isDigit(t[e])){e===t.length-1&&(t+="0");break}var n=t.charCodeAt(e),o=String.fromCharCode(n+1);if(o>"9"&&(o="0",0!==e&&this.isDigit(t[e-1])||(o="1"+o)),t=t.substr(0,e)+o+t.substr(e+1),"0"!==o&&"10"!==o)break;"10"===o&&e--}return t},t.isDigit=function(t){return"0"<=t&&t<="9"},t.getGuidItemKey=function(){return E.CreateGuid()},t.spacing=200,t}();e.ModelUtils=A},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=n(25),a=n(13),c=n(3),u=n(32),p=function(t){function e(e,n){var o=t.call(this)||this;return o.description=e,o.position=n.clone(),o.size=e.defaultSize.clone(),o.text=e.defualtText,o.parameters=new s.ShapeParameters,e.createParameters(o.parameters),o}return i(e,t),e.prototype.assign=function(e){t.prototype.assign.call(this,e),e.size=this.size.clone(),e.text=this.text,e.parameters=this.parameters.clone()},e.prototype.clone=function(){var t=new e(this.description,this.position.clone());return this.assign(t),t},Object.defineProperty(e.prototype,"allowHasText",{get:function(){return this.description.allowHasText},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(){return this.description.createPrimitives(this)},e.prototype.createSelectorPrimitives=function(){return this.description.createSelectorPrimitives(this)},e.prototype.normalizeX=function(t){return Math.max(this.position.x,Math.min(t,this.position.x+this.size.width))},e.prototype.normalizeY=function(t){return Math.max(this.position.y,Math.min(t,this.position.y+this.size.height))},e.prototype.getConnectionPoints=function(){var t=this;return this.description.getConnectionPoints().map(function(e,n){var o=new u.ConnectionPoint(t.position.x+e.x*t.size.width,t.position.y+e.y*t.size.height,e.side);return t.description.processConnectionPoint(t,o,n),o})},e.prototype.getConnectionPointsForSelection=function(){var t=this;return this.description.getConnectionPointsForSelection().map(function(e,n){return new u.ConnectionPoint(t.position.x+e.x*t.size.width,t.position.y+e.y*t.size.height,e.side)})},e.prototype.getConnectionPointSide=function(t,e){var n=this.getConnectionPointCore(t,e);return n.side!==c.ConnectionPointSide.Undefined?n.side:this.getConnectionPointSideByGeometry(n)},e.prototype.getConnectionPointForSelectionSide=function(t){var e=this.getConnectionPointsForSelection()[t];return e.side!==c.ConnectionPointSide.Undefined?e.side:this.getConnectionPointSideByGeometry(e)},e.prototype.getConnectionPointSideByGeometry=function(t){var e=t.offset(-this.position.x,-this.position.y).multiply(1/this.size.width,1/this.size.height);return e.x>=e.y&&(e.x>0||e.y>0)?e.x<.5||1-e.x>=e.y?c.ConnectionPointSide.North:c.ConnectionPointSide.East:e.x>.5||1-e.x<=e.y?c.ConnectionPointSide.South:c.ConnectionPointSide.West},Object.defineProperty(e.prototype,"rectangle",{get:function(){return new r.Rectangle(this.position,this.size)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textRectangle",{get:function(){return this.description.getTextRectangle(this.rectangle)},enumerable:!0,configurable:!0}),e.lineWidth=a.UnitConverter.pixelsToTwips(2),e}(c.DiagramItem);e.Shape=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(48),i=n(14),r=n(49),s=n(0),a=n(19),c=n(13),u=n(16),p=n(20),h=n(9),l=n(5),d=n(26),f=n(70);e.svgNS="http://www.w3.org/2000/svg";var y=function(){function t(t,e){this.scrollYVisible=!1,this.scrollXVisible=!1,this.scrollTimer=-1,this.allowChangeScrolling=!1,this.zoomLevel=1,this.moveLocked=!1,this.focusLocked=!1,this.focused=!1,this.eventManager=e,this.createElements(t),window.addEventListener("resize",this.onWindowResize.bind(this))}return t.prototype.createElements=function(e){if(!this.mainElement){var n=document.createElement("DIV");n.setAttribute("class","dxdi-control"),n.addEventListener(f.TouchUIHelper.touchMouseDownEventName,this.onMouseDown.bind(this)),document.addEventListener(f.TouchUIHelper.touchMouseMoveEventName,this.onMouseMove.bind(this)),n.addEventListener(f.TouchUIHelper.touchMouseUpEventName,this.onMouseUp.bind(this)),n.addEventListener("mouseenter",this.onMouseEnter.bind(this)),n.addEventListener("mouseleave",this.onMouseLeave.bind(this)),n.addEventListener("dblclick",this.onDblClick.bind(this)),document.addEventListener("paste",this.onPaste.bind(this)),e.appendChild(n),this.mainElement=n,(n=document.createElement("DIV")).setAttribute("class","dxdi-canvas-container"),this.mainElement.appendChild(n),this.containerElement=n;var o=t.createSvgElement();this.containerElement.appendChild(o),this.svgElement=o,this.updateMainElementSize(),this.createInputElement(this.mainElement),this.createClipboardInputElement(this.mainElement),this.setInputElementFocusHandlerMode()}},t.createSvgElement=function(t){void 0===t&&(t=!1);var n=document.createElementNS(e.svgNS,"svg");return n.className.baseVal="dxdi-canvas"+(t?" export":""),n},t.prototype.createInputElement=function(t){this.inputElementContainer=document.createElement("div"),t.appendChild(this.inputElementContainer),this.inputElement=document.createElement("div"),this.inputElement.setAttribute("contenteditable","true"),this.inputElementContainer.appendChild(this.inputElement),this.inputElement.addEventListener("blur",this.onInputBlur.bind(this)),this.inputElement.addEventListener("focus",this.onInputFocus.bind(this)),this.inputElement.addEventListener("keydown",this.onKeyDown.bind(this))},t.prototype.createClipboardInputElement=function(t){this.clipboardInputElement=document.createElement("textarea"),this.clipboardInputElement.setAttribute("class","dxdi-clipboard-input"),t.appendChild(this.clipboardInputElement)},t.prototype.setInputElementFocusHandlerMode=function(){this.inputElementContainer.setAttribute("class","dxdi-input focus")},t.prototype.setInputElementTextInputMode=function(t,e,n,o,i){this.inputElementContainer.setAttribute("class","dxdi-input "+i),this.inputElement.innerText=t,this.setTextInputElementBounds(e,n),this.setTextInputElementStyle(o),this.captureFocus(!0)},t.prototype.setTextInputElementBounds=function(t,e){var n=a.GetAbsolutePositionX(this.svgElement)+c.UnitConverter.twipsToPixels(t.x)*this.zoomLevel;a.SetAbsoluteX(this.inputElementContainer,n);var o=a.GetAbsolutePositionY(this.svgElement)+c.UnitConverter.twipsToPixels(t.y)*this.zoomLevel;a.SetAbsoluteY(this.inputElementContainer,o),this.inputElementContainer.style.width=void 0!==e?c.UnitConverter.twipsToPixels(e.width)+"px":"0px",this.inputElementContainer.style.height=void 0!==e?c.UnitConverter.twipsToPixels(e.height)+"px":"0px",this.inputElementContainer.style.transform="scale("+this.zoomLevel+")",this.inputElement.style.width=void 0!==e?c.UnitConverter.twipsToPixels(e.width)+"px":"",this.inputElement.style.height=void 0!==e?c.UnitConverter.twipsToPixels(e.height)+"px":"auto"},t.prototype.setTextInputElementStyle=function(t){d.RenderUtils.applyStyleToElement(t,this.inputElement)},t.prototype.applyPageChange=function(t){var e=this.zoomLevel!==t.model.zoomLevel;this.zoomLevel=t.model.zoomLevel,this.updateSvgElementSize(t.model.size),this.initializeSvgPositionProperties(t.type===o.PageChangeType.Create||e),void 0!==t.offset&&this.changeSvgPositionProperties(t.offset),this.updateSvgElementPosition(),this.normalizeSvgElementPosition()},t.prototype.setClipboardData=function(t){this.clipboardInputElement.value=t,this.clipboardInputElement.focus(),this.clipboardInputElement.select(),document.execCommand("copy"),this.captureFocus()},t.prototype.getClipboardData=function(t){var e=this;navigator&&navigator.clipboard?navigator.clipboard.readText().then(function(n){t(n),e.captureFocus()}).catch(function(){t(""),e.captureFocus()}):(this.clipboardInputElement.value="",this.clipboardInputElement.focus(),this.clipboardInputElement.select(),document.execCommand("Paste"),t(this.clipboardInputElement.value),this.captureFocus())},t.prototype.initializeSvgPositionProperties=function(e){var n=parseInt(this.svgElement.style.width),o=parseInt(this.svgElement.style.height);if(e||void 0===this.svgPositionProperties){var i=Math.max((this.mainElement.clientWidth-n)/2,t.minPadding),r=Math.max((this.mainElement.clientHeight-o)/2,t.minPadding);this.svgPositionProperties={width:n,height:o,containerPaddingLeft:i,containerPaddingTop:r,containerPaddingRight:i,containerPaddingBottom:r,containerScrollLeft:this.mainElement.scrollLeft,containerScrollTop:this.mainElement.scrollTop}}else this.svgPositionProperties.width=n,this.svgPositionProperties.height=o,this.svgPositionProperties.containerScrollLeft=this.mainElement.scrollLeft,this.svgPositionProperties.containerScrollTop=this.mainElement.scrollTop},t.prototype.changeSvgPositionProperties=function(e){var n=c.UnitConverter.twipsToPixels(e.left)*this.zoomLevel;n<0?this.svgPositionProperties.containerScrollLeft>-n?this.svgPositionProperties.containerScrollLeft+=n:this.svgPositionProperties.containerPaddingLeft-=n:n>0&&(this.svgPositionProperties.containerScrollLeft+=n);var o=c.UnitConverter.twipsToPixels(e.right)*this.zoomLevel;o<0?(this.svgPositionProperties.containerPaddingRight-=o,this.svgPositionProperties.containerScrollLeft,this.svgPositionProperties.containerPaddingRight):o>0&&(this.svgPositionProperties.containerPaddingRight=this.svgPositionProperties.containerPaddingLeft,this.svgPositionProperties.containerScrollLeft>this.svgPositionProperties.containerPaddingLeft&&(this.svgPositionProperties.containerScrollLeft-=this.svgPositionProperties.containerPaddingLeft-t.minPadding,this.svgPositionProperties.containerPaddingLeft=t.minPadding));var i=c.UnitConverter.twipsToPixels(e.top)*this.zoomLevel;e.top<0&&(this.svgPositionProperties.containerScrollTop>-i?this.svgPositionProperties.containerScrollTop+=i:this.svgPositionProperties.containerPaddingTop-=i),i>0&&(this.svgPositionProperties.containerScrollTop+=i);var r=c.UnitConverter.twipsToPixels(e.bottom)*this.zoomLevel;r<0?this.svgPositionProperties.containerPaddingBottom-=r:r>0&&(this.svgPositionProperties.containerPaddingBottom=this.svgPositionProperties.containerPaddingTop,this.svgPositionProperties.containerScrollTop>this.svgPositionProperties.containerPaddingTop&&(this.svgPositionProperties.containerScrollTop-=this.svgPositionProperties.containerPaddingTop-t.minPadding,this.svgPositionProperties.containerPaddingTop=t.minPadding))},t.prototype.updateMainElementSize=function(){var t=this.mainElement.parentNode;this.mainElement.style.width="0px",this.mainElement.style.width=t.offsetWidth+"px",this.mainElement.style.height="0px",this.mainElement.style.height=t.offsetHeight+"px"},t.prototype.updateSvgElementSize=function(t){var e=c.UnitConverter.twipsToPixels(t.width)*this.zoomLevel,n=c.UnitConverter.twipsToPixels(t.height)*this.zoomLevel;d.RenderUtils.updateSvgElementSize(this.svgElement,e,n)},t.prototype.getSvgContainerWidth=function(){return this.svgPositionProperties.width+this.svgPositionProperties.containerPaddingLeft+this.svgPositionProperties.containerPaddingRight},t.prototype.getSvgContainerHeight=function(){return this.svgPositionProperties.height+this.svgPositionProperties.containerPaddingTop+this.svgPositionProperties.containerPaddingBottom},t.prototype.updateSvgElementPosition=function(){this.containerElement.style.paddingLeft=this.svgPositionProperties.containerPaddingLeft+"px",this.containerElement.style.paddingRight=this.svgPositionProperties.containerPaddingRight+"px",this.containerElement.style.paddingTop=this.svgPositionProperties.containerPaddingTop+"px",this.containerElement.style.paddingBottom=this.svgPositionProperties.containerPaddingBottom+"px",this.containerElement.style.width=this.getSvgContainerWidth()+"px",this.containerElement.style.height=this.getSvgContainerHeight()+"px",this.mainElement.scrollLeft=this.svgPositionProperties.containerScrollLeft,this.mainElement.scrollTop=this.svgPositionProperties.containerScrollTop},t.prototype.normalizeSvgElementPosition=function(){var e=this.mainElement.scrollWidth-this.mainElement.offsetWidth-this.mainElement.scrollLeft;if(e>0){var n=this.svgPositionProperties.containerPaddingRight-e;this.svgPositionProperties.containerPaddingRight=Math.max(n,t.minPadding),this.containerElement.style.paddingRight=this.svgPositionProperties.containerPaddingRight+"px",this.containerElement.style.width=this.getSvgContainerWidth()+"px"}var o=this.mainElement.scrollHeight-this.mainElement.offsetHeight-this.mainElement.scrollTop;if(o>0){n=this.svgPositionProperties.containerPaddingBottom-o;this.svgPositionProperties.containerPaddingBottom=Math.max(n,t.minPadding),this.containerElement.style.paddingBottom=this.svgPositionProperties.containerPaddingBottom+"px",this.containerElement.style.height=this.getSvgContainerHeight()+"px"}},t.prototype.changeScrollPosition=function(e,n){var o=e.pageX-a.GetAbsolutePositionX(this.mainElement),i=e.pageY-a.GetAbsolutePositionY(this.mainElement),r=this.mainElement.offsetWidth;this.mainElement.offsetWidth<this.mainElement.scrollWidth&&(r-=t.scrollBarWidth);var s=this.mainElement.offsetHeight;this.mainElement.offsetHeight<this.mainElement.scrollHeight&&(s-=t.scrollBarWidth);var c=!1;o<=t.scrollEdge?(this.mainElement.scrollLeft-=this.getScrollingOffset(o),c=!0):r-t.scrollEdge<=o&&(this.mainElement.scrollLeft+=this.getScrollingOffset(r-o),c=!0),i<=t.scrollEdge?(this.mainElement.scrollTop-=this.getScrollingOffset(i),c=!0):s-t.scrollEdge<=i&&(this.mainElement.scrollTop+=this.getScrollingOffset(s-i),c=!0),c&&(this.scrollTimer=window.setTimeout(function(){this.changeScrollPosition(e,!0)}.bind(this),t.scrollDelay)),n&&this.onMouseMoveCore(e)},t.prototype.clearScrollTimer=function(){this.scrollTimer>-1&&(window.clearTimeout(this.scrollTimer),this.scrollTimer=-1)},t.prototype.getScrollingOffset=function(e){var n=Math.pow((t.scrollEdge-e)/t.scrollRatio,2);return Math.min(n,t.scrollMaxOffset)},t.prototype.captureFocus=function(t){if(void 0===t&&(t=!1),this.inputElement.focus(),t){var e=this.inputElement;window.setTimeout(function(){var t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)},100)}},t.prototype.updateLayout=function(){this.updateMainElementSize(),this.initializeSvgPositionProperties(!0),this.updateSvgElementPosition()},t.prototype.isFocused=function(){return this.focused},t.prototype.NotifyTextInputStart=function(t,e,n,o){var i="";t instanceof h.Shape?i="shape-text":t instanceof l.Connector&&(i="connector-text"),this.setInputElementTextInputMode(e,n,o,t.styleText,i)},t.prototype.NotifyTextInputEnd=function(t){this.setInputElementFocusHandlerMode()},t.prototype.NotifyModelChanged=function(t){for(var e=0,n=void 0;n=t[e];e++)n instanceof o.PageChange&&this.applyPageChange(n)},t.prototype.onWindowResize=function(t){this.updateLayout()},t.prototype.onMouseDown=function(t){var e=this;this.lockMouseMove(),this.lockFocus(),this.allowChangeScrolling=!0,this.raiseEvent(t,this.getDiagramMouseEvent(t),function(t){return e.eventManager.onMouseDown(t)}),this.captureFocus()},t.prototype.onMouseMove=function(t){this.moveLocked||(this.clearScrollTimer(),r.Evt.IsLeftButtonPressed(t)||(this.allowChangeScrolling=!1),this.allowChangeScrolling&&this.changeScrollPosition(t,!1),this.onMouseMoveCore(t))},t.prototype.onMouseMoveCore=function(t){var e=this;this.raiseEvent(t,this.getDiagramMouseEvent(t),function(t){return e.eventManager.onMouseMove(t)})},t.prototype.onMouseUp=function(t){var e=this;this.lockMouseMove(),this.clearScrollTimer(),this.raiseEvent(t,this.getDiagramMouseEvent(t),function(t){return e.eventManager.onMouseUp(t)}),this.allowChangeScrolling=!1,this.captureFocus()},t.prototype.onMouseEnter=function(t){var e=this;r.Evt.IsLeftButtonPressed(t)&&setTimeout(function(){e.allowChangeScrolling=!0},500),this.raiseEvent(t,this.getDiagramEvent(t),function(t){return e.eventManager.onMouseEnter(t)})},t.prototype.onMouseLeave=function(t){var e=this;this.raiseEvent(t,this.getDiagramEvent(t),function(t){return e.eventManager.onMouseLeave(t)})},t.prototype.onDblClick=function(t){var e=this;this.raiseEvent(t,this.getDiagramMouseEvent(t),function(t){return e.eventManager.onDblClick(t)})},t.prototype.onKeyDown=function(t){var e=this;this.raiseEvent(t,this.getDiagramKeyboardEvent(t),function(t){return e.eventManager.onKeyDown(t)})},t.prototype.onInputBlur=function(t){var e=this;this.focusLocked||(this.focused=!1,a.RemoveClassNameFromElement(this.mainElement,"focused")),this.raiseEvent(t,this.getDiagramInputEvent(t),function(t){return e.eventManager.onInputBlur(t)})},t.prototype.onInputFocus=function(t){var e=this;this.focused=!0,this.focusLocked=!1,a.AddClassNameToElement(this.mainElement,"focused"),this.raiseEvent(t,this.getDiagramEvent(t),function(t){return e.eventManager.onInputFocus(t)})},t.prototype.onPaste=function(t){var e=this;this.raiseEvent(t,this.getDiagramClipboardEvent(t),function(t){return e.eventManager.onPaste(t)})},t.prototype.raiseEvent=function(t,e,n){n(e),e.preventDefault&&t.preventDefault()},t.prototype.getDiagramEvent=function(t){return new i.DiagramEvent(this.getKeyModifiers(t))},t.prototype.getDiagramInputEvent=function(t){return new i.DiagramInputEvent(this.getKeyModifiers(t),t.srcElement.innerText)},t.prototype.getDiagramMouseEvent=function(t){var e=this.getKeyModifiers(t),n=this.isLeftButtonPressed(t)?i.MouseButton.Left:i.MouseButton.Right;return new i.DiagramMouseEvent(e,n,this.getLayoutPoint(t,!0),this.getEventSource(t))},t.prototype.getDiagramKeyboardEvent=function(t){return new i.DiagramKeyboardEvent(this.getKeyModifiers(t),r.Evt.GetKeyCode(t),t.srcElement.innerText)},t.prototype.getDiagramClipboardEvent=function(t){var e;return e=void 0!==t.clipboardData?t.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),new i.DiagramClipboardEvent(this.getKeyModifiers(t),e)},t.prototype.isLeftButtonPressed=function(t){return p.Browser.MSTouchUI?2!=t.button:r.Evt.IsLeftButtonPressed(t)},t.prototype.getKeyModifiers=function(t){var e=0;return t.altKey&&(e|=u.ModifierKey.Alt),t.ctrlKey&&(e|=u.ModifierKey.Ctrl),t.shiftKey&&(e|=u.ModifierKey.Shift),t.metaKey&&(e|=u.ModifierKey.Meta),e},t.prototype.getEventSource=function(t){for(var e=t.srcElement;e&&!this.isDocumentContainer(e);){var n=d.RenderUtils.getElementEventData(e);if(void 0!==n)return n;e=e.parentNode}var o=new i.MouseEventSource;return e&&this.isDocumentContainer(e)&&(o.type=i.MouseEventElementType.Document),o},t.prototype.isDocumentContainer=function(t){return a.ElementHasCssClass(t,"dxdi-control")||a.ElementHasCssClass(t,"dxdi-canvas")},t.prototype.lockMouseMove=function(){var t=this;this.moveLocked=!0,setTimeout(function(){return t.moveLocked=!1},10)},t.prototype.lockFocus=function(){var t=this;this.focusLocked=!0,setTimeout(function(){return t.focusLocked=!1},10)},t.prototype.getLayoutPoint=function(t,e){var n=r.Evt.GetEventX(t),o=r.Evt.GetEventY(t),i=a.GetAbsolutePositionX(this.svgElement),u=a.GetAbsolutePositionY(this.svgElement);if(e){if(this.scrollYVisible&&i+this.mainElement.offsetWidth-n<0)return s.Point.empty();if(this.scrollXVisible&&u+this.mainElement.offsetHeight-o<0)return s.Point.empty()}return new s.Point(c.UnitConverter.pixelsToTwipsF(n-i)/this.zoomLevel,c.UnitConverter.pixelsToTwipsF(o-u)/this.zoomLevel)},t.minPadding=8,t.scrollEdge=40,t.scrollRatio=5,t.scrollMaxOffset=60,t.scrollDelay=100,t.scrollBarWidth=16,t}();e.RenderManager=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=n(50),r=n(52),s=n(53),a=n(3),c=n(13),u=n(26),p=n(32);e.ShapeDefaultDimension=1440,e.ShapeDefaultSize=new o.Size(e.ShapeDefaultDimension,e.ShapeDefaultDimension);var h=function(){function t(t,n,o){void 0===o&&(o=e.ShapeDefaultSize.clone()),this.title=t,this.defualtText=n,this.defaultSize=o,this.connectionPoints=this.createConnectionPoints(),this.connectionPointsWhileSelected=this.createConnectionPointsForSelection()}return Object.defineProperty(t.prototype,"allowHasText",{get:function(){return!0},enumerable:!0,configurable:!0}),t.prototype.getConnectionPoints=function(){return this.connectionPoints},t.prototype.createConnectionPoints=function(){return[new p.ConnectionPoint(.5,0,a.ConnectionPointSide.North),new p.ConnectionPoint(1,.5,a.ConnectionPointSide.East),new p.ConnectionPoint(.5,1,a.ConnectionPointSide.South),new p.ConnectionPoint(0,.5,a.ConnectionPointSide.West)]},t.prototype.getConnectionPointsForSelection=function(){return this.connectionPointsWhileSelected},t.prototype.createConnectionPointsForSelection=function(){return[new p.ConnectionPoint(.5,0,a.ConnectionPointSide.North),new p.ConnectionPoint(1,.5,a.ConnectionPointSide.East),new p.ConnectionPoint(.5,1,a.ConnectionPointSide.South),new p.ConnectionPoint(0,.5,a.ConnectionPointSide.West)]},t.prototype.processConnectionPoint=function(t,e,n){},t.prototype.createParameters=function(t){},t.prototype.normalizeParameters=function(t,e){},t.prototype.modifyParameters=function(t,e,n,o){throw Error("Not implemented")},t.prototype.changeParameterValue=function(t,e,n){var o=t.get(e);o.value=n(o)},t.prototype.getParameterPoints=function(t){return[]},t.prototype.createTextPrimitives=function(t,e){if(!this.allowHasText||void 0===t.text||""===t.text)return[];var n=this.getTextRectangle(t.rectangle),o=!e&&u.RenderUtils.generateSvgElementId("clipText"),a=this.getTextPosition(n,t.styleText["text-anchor"]);return[new i.TextPrimitive(a.x,a.y,t.text,n.width,t.styleText,!1,o),new r.ClipPathPrimitive(o,[new s.RectanglePrimitive(n.left,n.top,n.width,n.height)])]},t.prototype.getTextRectangle=function(t){return t},t.prototype.createSelectorPrimitives=function(t){return[new s.RectanglePrimitive(t.position.x,t.position.y,t.size.width,t.size.height,null,"selector")]},t.prototype.getTextPosition=function(e,n){var i=new o.Point(e.left,e.top+e.height/2);return n&&"middle"!==n?"end"===n?i.x=e.left+e.width-t.textSpacing:"start"===n&&(i.x=e.left+t.textSpacing):i.x=e.left+e.width/2,i},t.textSpacing=c.UnitConverter.pixelsToTwips(2),t}();e.ShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),s=n(0),a=n(53),c=n(1),u=function(t){function e(e,n,o){return void 0===e&&(e="Rectangle"),void 0===n&&(n=""),void 0===o&&(o=new s.Size(r.ShapeDefaultDimension,.75*r.ShapeDefaultDimension)),t.call(this,e,n,o)||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return c.ShapeType.Rectangle},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return c.ShapeCategory.General},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.width,r=e.height;return[].concat([new a.RectanglePrimitive(n,o,i,r,t.style)]).concat(this.createTextPrimitives(t))},e}(r.ShapeDescription);e.RectangleShapeDescription=u},function(t,e,n){"use strict";var o,i,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.Centimeter=0]="Centimeter",t[t.Inch=1]="Inch"}(i=e.RichEditUnit||(e.RichEditUnit={}));var s=function(){function t(){}return t.getConverter=function(t){switch(t){case i.Centimeter:return new a;case i.Inch:return new c;default:throw new Error}},t.pixelsToTwips=function(e){return Math.round(t.pixelsToTwipsF(e))},t.inchesToTwips=function(e){return Math.round(t.inchesToTwipsF(e))},t.pointsToTwips=function(e){return Math.round(t.pointsToTwipsF(e))},t.picasToTwips=function(e){return Math.round(1440*e/t.PICAS_PER_INCH)},t.centimetersToTwips=function(e){return Math.round(t.centimetersToTwipsF(e))},t.pixelsToTwipsF=function(e){return 1440*e/t.DPI},t.inchesToTwipsF=function(t){return 1440*t},t.pointsToTwipsF=function(t){return 20*t},t.centimetersToTwipsF=function(e){return 1440*e/t.CENTIMETERS_PER_INCH},t.modelUnitsToDegrees=function(t){return t/6e4},t.modelUnitsToRadians=function(t){return t/6e4*Math.PI/180},t.degreesToModelUnits=function(t){return 6e4*t},t.radiansToModelUnits=function(t){return 6e4*t/Math.PI*180},t.radiansToDegrees=function(t){return t/Math.PI*180},t.fdToModelUnits=function(t){return Math.round(1875*t/2048)},t.emuToTwips=function(t){return t/635},t.twipsToPixels=function(e){return Math.round(t.twipsToPixelsF(e))},t.inchesToPixels=function(e){return Math.round(t.DPI*e)},t.centimeterToPixel=function(e){return Math.round(e/(t.CENTIMETERS_PER_INCH/t.DPI))},t.pointsToPixels=function(e){return Math.round(e*t.DPI/72)},t.pointsToPixelsF=function(e){return e*t.DPI/72},t.twipsToPixelsF=function(e){return e*t.DPI/1440},t.pixelsToPoints=function(e){return Math.round(72*e/t.DPI)},t.twipsToPoints=function(t){return Math.round(this.twipsToPointsF(t))},t.twipsToPointsF=function(t){return t/20},t.twipsToInches=function(t){return t/1440},t.pixelsToInches=function(e){return e/t.DPI},t.twipsToCentimeters=function(e){return e*t.CENTIMETERS_PER_INCH/1440},t.pixelToCentimeters=function(e){return e*t.CENTIMETERS_PER_INCH/t.DPI},t.hundredthsOfMillimeterToModelUnits=function(t){return 15*t/127},t.twipsToEmu=function(t){return 635*t},t.twipsToDegree=function(t){return t/6e4},t.DPI=96,t.CENTIMETERS_PER_INCH=2.54,t.PICAS_PER_INCH=6,t}();e.UnitConverter=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getUnits=function(){return i.Centimeter},e.prototype.twipsToUI=function(t){return s.twipsToCentimeters(t)},e.prototype.UIToTwips=function(t){return s.centimetersToTwips(t)},e}(s);e.UIUnitConverterCentimeter=a;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.getUnits=function(){return i.Inch},e.prototype.twipsToUI=function(t){return s.twipsToInches(t)},e.prototype.UIToTwips=function(t){return s.inchesToTwips(t)},e}(s);e.UIUnitConverterInch=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Middle=4]="Middle"}(e.MouseButton||(e.MouseButton={})),function(t){t[t.Undefined=0]="Undefined",t[t.Connector=1]="Connector",t[t.ConnectorPoint=2]="ConnectorPoint",t[t.ConnectorSide=3]="ConnectorSide",t[t.ConnectorOrthogonalSide=4]="ConnectorOrthogonalSide",t[t.ConnectorText=5]="ConnectorText",t[t.Shape=6]="Shape",t[t.ShapeResizeBox=7]="ShapeResizeBox",t[t.ShapeParameterBox=8]="ShapeParameterBox",t[t.SelectionRect=9]="SelectionRect",t[t.ShapeConnectionPoint=10]="ShapeConnectionPoint",t[t.ShapeConnection=11]="ShapeConnection",t[t.Document=12]="Document"}(e.MouseEventElementType||(e.MouseEventElementType={}));var r=function(t,e,n){this.type=t,this.key=e,this.value=n};e.MouseEventSource=r,function(t){t[t.Undefined=0]="Undefined",t[t.ResizeBox_NW=1]="ResizeBox_NW",t[t.ResizeBox_NE=2]="ResizeBox_NE",t[t.ResizeBox_SE=3]="ResizeBox_SE",t[t.ResizeBox_SW=4]="ResizeBox_SW",t[t.ResizeBox_N=5]="ResizeBox_N",t[t.ResizeBox_E=6]="ResizeBox_E",t[t.ResizeBox_S=7]="ResizeBox_S",t[t.ResizeBox_W=8]="ResizeBox_W"}(e.ResizeEventSource||(e.ResizeEventSource={}));var s=function(t){this.modifiers=t};e.DiagramEvent=s;var a=function(t){function e(e,n){var o=t.call(this,e)||this;return o.inputText=n,o}return i(e,t),e}(s);e.DiagramInputEvent=a;var c=function(t){function e(e,n,o,i){var r=t.call(this,e)||this;return r.button=n,r.layoutPoint=o,r.source=i,r.scrollX=0,r.scrollY=0,r}return i(e,t),e}(s);e.DiagramMouseEvent=c;var u=function(t){function e(e,n,o){var i=t.call(this,e,o)||this;return i.keyCode=n,i}return i(e,t),e.prototype.getShortcutCode=function(){return this.modifiers|this.keyCode},e}(a);e.DiagramKeyboardEvent=u;var p=function(t){function e(e,n){var o=t.call(this,e)||this;return o.clipboardData=n,o}return i(e,t),e}(s);e.DiagramClipboardEvent=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(13),i=n(26),r=function(){function t(t,e,n,o){this.style=t,this.className=e,this.clipPathId=n,this.onApplyProperties=o,this.children=[]}return t.prototype.createElement=function(){var t=this.createMainElement();return this.createChildElements(t),t},t.prototype.createChildElements=function(t){for(var e=0;e<this.children.length;e++)t.appendChild(this.children[e].createElement())},t.prototype.applyElementProperties=function(t){this.applyElementStyleProperties(t),this.className&&t.setAttribute("class",this.className),this.clipPathId&&t.setAttribute("clip-path","url(#"+this.clipPathId+")"),this.onApplyProperties&&this.onApplyProperties(t),this.applyChildrenProperties(t)},t.prototype.applyChildrenProperties=function(t){for(var e=0;e<this.children.length;e++)this.children[e].applyElementProperties(t.childNodes[e])},t.prototype.applyElementStyleProperties=function(t){this.applyElementStylePropertiesCore(t)},t.prototype.applyElementStylePropertiesCore=function(t,e){void 0===e&&(e=!1),this.style&&i.RenderUtils.applyStyleToElement(this.style,t,e)},t.prototype.setUnitAttribute=function(t,e,n){if(null!=n){var i="number"==typeof n?o.UnitConverter.twipsToPixels(n).toString():n;t.setAttribute(e,i)}},t}();e.SvgPrimitive=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.None=0]="None",t[t.Ctrl=65536]="Ctrl",t[t.Shift=262144]="Shift",t[t.Alt=1048576]="Alt",t[t.Meta=16777216]="Meta"}(e.ModifierKey||(e.ModifierKey={})),function(t){t[t.Backspace=8]="Backspace",t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Pause=19]="Pause",t[t.CapsLock=20]="CapsLock",t[t.Esc=27]="Esc",t[t.Space=32]="Space",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.End=35]="End",t[t.Home=36]="Home",t[t.Left=37]="Left",t[t.Up=38]="Up",t[t.Right=39]="Right",t[t.Down=40]="Down",t[t.Insert=45]="Insert",t[t.Delete=46]="Delete",t[t.Key_0=48]="Key_0",t[t.Key_1=49]="Key_1",t[t.Key_2=50]="Key_2",t[t.Key_3=51]="Key_3",t[t.Key_4=52]="Key_4",t[t.Key_5=53]="Key_5",t[t.Key_6=54]="Key_6",t[t.Key_7=55]="Key_7",t[t.Key_8=56]="Key_8",t[t.Key_9=57]="Key_9",t[t.Key_a=65]="Key_a",t[t.Key_b=66]="Key_b",t[t.Key_c=67]="Key_c",t[t.Key_d=68]="Key_d",t[t.Key_e=69]="Key_e",t[t.Key_f=70]="Key_f",t[t.Key_g=71]="Key_g",t[t.Key_h=72]="Key_h",t[t.Key_i=73]="Key_i",t[t.Key_j=74]="Key_j",t[t.Key_k=75]="Key_k",t[t.Key_l=76]="Key_l",t[t.Key_m=77]="Key_m",t[t.Key_n=78]="Key_n",t[t.Key_o=79]="Key_o",t[t.Key_p=80]="Key_p",t[t.Key_q=81]="Key_q",t[t.Key_r=82]="Key_r",t[t.Key_s=83]="Key_s",t[t.Key_t=84]="Key_t",t[t.Key_u=85]="Key_u",t[t.Key_v=86]="Key_v",t[t.Key_w=87]="Key_w",t[t.Key_x=88]="Key_x",t[t.Key_y=89]="Key_y",t[t.Key_z=90]="Key_z",t[t.Windows=91]="Windows",t[t.ContextMenu=93]="ContextMenu",t[t.Numpad_0=96]="Numpad_0",t[t.Numpad_1=97]="Numpad_1",t[t.Numpad_2=98]="Numpad_2",t[t.Numpad_3=99]="Numpad_3",t[t.Numpad_4=100]="Numpad_4",t[t.Numpad_5=101]="Numpad_5",t[t.Numpad_6=102]="Numpad_6",t[t.Numpad_7=103]="Numpad_7",t[t.Numpad_8=104]="Numpad_8",t[t.Numpad_9=105]="Numpad_9",t[t.Multiply=106]="Multiply",t[t.Add=107]="Add",t[t.Subtract=109]="Subtract",t[t.Decimal=110]="Decimal",t[t.Divide=111]="Divide",t[t.F1=112]="F1",t[t.F2=113]="F2",t[t.F3=114]="F3",t[t.F4=115]="F4",t[t.F5=116]="F5",t[t.F6=117]="F6",t[t.F7=118]="F7",t[t.F8=119]="F8",t[t.F9=120]="F9",t[t.F10=121]="F10",t[t.F11=122]="F11",t[t.F12=123]="F12",t[t.NumLock=144]="NumLock",t[t.ScrollLock=145]="ScrollLock",t[t.Semicolon=186]="Semicolon",t[t.Equals=187]="Equals",t[t.Comma=188]="Comma",t[t.Dash=189]="Dash",t[t.Period=190]="Period",t[t.ForwardSlash=191]="ForwardSlash",t[t.GraveAccent=192]="GraveAccent",t[t.OpenBracket=219]="OpenBracket",t[t.BackSlash=220]="BackSlash",t[t.CloseBracket=221]="CloseBracket",t[t.SingleQuote=222]="SingleQuote"}(e.KeyCode||(e.KeyCode={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(t,e){this.key=t,this.point=e};e.ShapeParameterPoint=o},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),s=function(t){this.orientation=c.Vertical,this.direction=a.Forward,this.componentSpacing=t&&2*t>800?2*t:800;var e=t&&t>r.Connector.minOffset?t:r.Connector.minOffset;this.layerSpacing=2*e,this.columnSpacing=e};e.LayoutSettings=s;var a,c,u,p=function(t){function e(e){var n=t.call(this,e)||this;return n.alignment=u.Center,n.subTreeColumnSpacing=n.componentSpacing/2,n}return i(e,t),e}(s);e.TreeLayoutSettings=p,function(t){t[t.Backward=0]="Backward",t[t.Forward=1]="Forward"}(a=e.LogicalDirectionKind||(e.LogicalDirectionKind={})),function(t){t[t.Horizontal=0]="Horizontal",t[t.Vertical=1]="Vertical"}(c=e.OrientationKind||(e.OrientationKind={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center"}(u=e.Alignment||(e.Alignment={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(20),i=n(102),r=n(103),s=n(104),a=n(16),c=n(49);function u(t){return void 0!==t&&null!=t}function p(t,e,n,o){if(o){var i=e.search("[A-Z]");-1!=i&&(e=e.replace(e.charAt(i),"-"+e.charAt(i).toLowerCase())),t.style.setProperty?t.style.setProperty(e,n,"important"):t.style.cssText+=";"+e+":"+n+"!important"}else t.style[e]=n}function h(){var t=o.Browser.IE&&"hidden"==d(document.body).overflow&&document.body.scrollTop>0;return o.Browser.WebKitFamily||o.Browser.Edge||t?o.Browser.MacOSMobilePlatform?window.pageYOffset:o.Browser.WebKitFamily&&document.documentElement.scrollTop||document.body.scrollTop:document.documentElement.scrollTop}function l(t){if("object"!=typeof t||null==t)return t;var e={};for(var n in t)e[n]=t[n];return e}function d(t){if(t.currentStyle)return t.currentStyle;if(document.defaultView&&document.defaultView.getComputedStyle){var e=document.defaultView.getComputedStyle(t,null);if(!e&&o.Browser.Firefox&&window.frameElement){for(var n=[],i=window.frameElement;!(e=document.defaultView.getComputedStyle(t,null));)n.push([i,i.style.display]),p(i,"display","block",!0),i="BODY"==i.tagName?i.ownerDocument.defaultView.frameElement:i.parentNode;e=l(e);for(var r,s=0;r=n[s];s++)p(r[0],"display",r[1],!1);document.body.offsetWidth}return e}return window.getComputedStyle(t,null)}function f(){var t=o.Browser.IE&&"hidden"==d(document.body).overflow&&document.body.scrollLeft>0;return o.Browser.Edge||t?document.body?document.body.scrollLeft:document.documentElement.scrollLeft:o.Browser.WebKitFamily?document.documentElement.scrollLeft||document.body.scrollLeft:document.documentElement.scrollLeft}function y(){try{return document.activeElement}catch(t){return null}}function m(t,e){try{if(t.focus(),o.Browser.IE&&document.activeElement!=t&&t.focus(),e){var n=Selection.GetInfo(t);if(n.startPos==n.endPos)switch(e){case"start":Selection.SetCaretPosition(t,0);break;case"all":Selection.Set(t)}}}catch(t){}}function g(t,e){try{return!!t.className&&-1!=t.className.indexOf(e)}catch(t){return!1}}function v(t,e){try{var n,o=t.classList;if(!o){if(!t.className)return!1;n=t.className.split(" ")}for(var r=e.split(" "),s=r.length-1;s>=0;s--)if(o){if(!o.contains(r[s]))return!1}else if(i.Data.ArrayIndexOf(n,r[s])<0)return!1;return!0}catch(t){return!1}}function P(t){return o.Browser.IE?function(t){return null==t||o.Browser.IE&&null==t.parentNode?0:t.getBoundingClientRect().top+h()}(t):o.Browser.Firefox&&o.Browser.Version>=3?C(t):o.Browser.Opera?function(t){var e=!0;t&&"TR"==t.tagName&&t.cells.length>0&&(t=t.cells[0]);var n=S(t,!1);for(;null!=t;)n+=t.offsetTop,e||(n-=t.scrollTop),t=t.offsetParent,e=!1;return n+=document.body.scrollTop}(t):o.Browser.NetscapeFamily&&(!o.Browser.Firefox||o.Browser.Version<3)?function(t){var e=S(t,!1),n=!0;for(;null!=t;){if(e+=t.offsetTop,n||null==t.offsetParent||(e-=t.scrollTop),!n&&o.Browser.Firefox){var i=d(t);"DIV"==t.tagName&&"visible"!=i.overflow&&(e+=_(i.borderTopWidth))}n=!1,t=t.offsetParent}return e}(t):o.Browser.WebKitFamily||o.Browser.Edge?C(t):function(t){var e=0,n=!0;for(;null!=t;)e+=t.offsetTop,n||null==t.offsetParent||(e-=t.scrollTop),n=!1,t=t.offsetParent;return e}(t)}function C(t){if(null==t)return 0;var e=t.getBoundingClientRect().top+h();return Math.round(e)}function S(t,e){for(var n=0,o=!0;null!=t&&"BODY"!=t.tagName;){var i=d(t);if("absolute"==i.position)break;o||"DIV"!=t.tagName||""!=i.position&&"static"!=i.position||(n-=e?t.scrollLeft:t.scrollTop),t=t.parentNode,o=!1}return n}function _(t){return x(t,parseInt)}function w(t){return x(t,parseFloat)}function x(t,e){var n=0;if(null!=t&&""!=t)try{var o=t.indexOf("px");o>-1&&(n=e(t.substr(0,o)))}catch(t){}return n}function b(t){return o.Browser.IE?function(t){return null==t||o.Browser.IE&&null==t.parentNode?0:t.getBoundingClientRect().left+f()}(t):o.Browser.Firefox&&o.Browser.Version>=3?O(t):o.Browser.Opera?function(t){var e=!0,n=S(t,!0);for(;null!=t;)n+=t.offsetLeft,e||(n-=t.scrollLeft),t=t.offsetParent,e=!1;return n+=document.body.scrollLeft}(t):o.Browser.NetscapeFamily&&(!o.Browser.Firefox||o.Browser.Version<3)?function(t){var e=S(t,!0),n=!0;for(;null!=t;){if(e+=t.offsetLeft,n||null==t.offsetParent||(e-=t.scrollLeft),!n&&o.Browser.Firefox){var i=d(t);"DIV"==t.tagName&&"visible"!=i.overflow&&(e+=_(i.borderLeftWidth))}n=!1,t=t.offsetParent}return e}(t):o.Browser.WebKitFamily||o.Browser.Edge?O(t):function(t){var e=0,n=!0;for(;null!=t;)e+=t.offsetLeft,n||null==t.offsetParent||(e-=t.scrollLeft),n=!1,t=t.offsetParent;return e}(t)}function O(t){if(null==t)return 0;var e=t.getBoundingClientRect().left+f();return Math.round(e)}function M(t,e,n){return t-=function(t,e){var n=function(t){var e=document.createElement("DIV");return e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.position=d(t).position,e}(t);"static"==n.style.position&&(n.style.position="absolute");t.parentNode.appendChild(n);var o=e?b(n):P(n);return t.parentNode.removeChild(n),Math.round(o)}(e,n)}function E(t,e){return I(t.childNodes,e)}function T(t,e){return I(t.all||t.getElementsByTagName("*"),e)}function I(t,e){for(var n=[],o=0;o<t.length;o++){var i=t[o];e&&!e(i)||n.push(i)}return n}function A(t,e){for(var n,o=[],i=0;n=t[i];i++)e&&!e(n)||o.push(n);return o}e.IsExists=u,e.IsNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},e.SetStyles=function(t,e,n){for(var i in u(e.cssText)&&(t.style.cssText=e.cssText),u(e.className)&&(t.className=e.className),e)if(e.hasOwnProperty(i)){var r=e[i];switch(i){case"cssText":case"className":break;case"float":R(t,r);break;case"opacity":N(t,r);break;case"zIndex":p(t,i,r,n);break;case"fontWeight":o.Browser.IE&&o.Browser.Version<9&&"number"==typeof e[i]&&(r=e[i].toString());default:p(t,i,r+("number"==typeof r?"px":""),n)}}},e.SetStylesCore=p,e.GetDocumentScrollTop=h,e.CloneObject=l,e.GetCurrentStyle=d,e.GetDocumentScrollLeft=f,e.focusedElement=null,e.GetFocusedElement=function(){var t=y();return t||e.focusedElement},e.GetActiveElement=y,e.SetFocus=function(t,e){o.Browser.MacOSMobilePlatform?m(t,e):window.setTimeout(function(){m(t,e)},100)},e.GetIsParent=function(t,e){if(!t||!e)return!1;for(;e;){if(e===t)return!0;if("BODY"===e.tagName)return!1;e=e.parentNode}return!1},e.ElementContainsCssClass=g,e.AddClassNameToElement=function(t,e){t&&"string"==typeof e&&(v(t,e=e.trim())||""===e||(t.className=""===t.className?e:t.className+" "+e))},e.ElementHasCssClass=v,e.RemoveClassNameFromElement=function(t,e){if(t){var n=" "+t.className+" ",o=n.replace(" "+e+" "," ");n.length!=o.length&&(t.className=r.Str.Trim(o))}},e.GetAbsolutePositionY=P,e.PxToInt=_,e.PxToFloat=w,e.GetAbsolutePositionX=b,e.SetAbsoluteX=function(t,e){t.style.left=M(e,t,!0)+"px"},e.SetAbsoluteY=function(t,e){t.style.top=M(e,t,!1)+"px"},e.IsPercentageSize=function(t){return t&&-1!=t.indexOf("%")},e.GetChildNodes=E,e.GetNodes=T,e.RetrieveByPredicate=I,e.GetChildNodesByClassName=function(t,e){return t?t.querySelectorAll?A(t.querySelectorAll("."+e),function(e){return e.parentNode===t}):E(t,function(t){return t.className&&v(t,e)}):[]},e.GetNodesByClassName=function(t,e){return t.querySelectorAll?A(t.querySelectorAll("."+e),null):T(t,function(t){return t.className&&v(t,e)})},e.GetParentByClassName=function(t,e){for(;null!=t;){if("BODY"==t.tagName||"#document"==t.nodeName)return null;if(g(t,e))return t;t=t.parentNode}return null},e.GetParentByTagName=function(t,e){for(e=e.toUpperCase();t;){if("BODY"===t.tagName)return null;if(t.tagName===e)return t;t=t.parentNode}return null};var D,L=null;function k(t,e){t.innerHTML=e}function j(t,e,n,o){if(t)if("string"==typeof e)t.style.display=e;else if(e){if(t.style.display="",n&&"none"===d(t).display){var i=o?"inline-":"";switch(t.tagName){case"TABLE":t.style.display=i+"table";break;default:t.style.display=i+"block"}}}else t.style.display="none"}function z(t,e){u(e)||(e=o.Browser.IE&&9!=o.Browser.MajorVersion&&window.getComputedStyle?window.getComputedStyle(t):d(t));var n=0;return"none"!=e.borderTopStyle&&(n+=w(e.borderTopWidth)),"none"!=e.borderBottomStyle&&(n+=w(e.borderBottomWidth)),n}function R(t,e){u(t.style.cssFloat)?t.style.cssFloat=e:u(t.style.styleFloat)?t.style.styleFloat=e:s.Attr.SetAttribute(t.style,"float",e)}function N(t,e){!o.Browser.IE||o.Browser.Version>8?t.style.opacity=e:"object"==typeof t.filters&&t.filters["DXImageTransform.Microsoft.Alpha"]?t.filters.item("DXImageTransform.Microsoft.Alpha").Opacity=100*e:t.style.filter="alpha(opacity="+100*e+")"}function U(t){return t&&B(t)}function B(t){if(!t)return!1;if(!(o.Browser.Firefox&&o.Browser.Version<4)&&t.ownerDocument&&t.ownerDocument.body&&t.ownerDocument.body.compareDocumentPosition)return t.ownerDocument.body.compareDocumentPosition(t)%2==0;if(!o.Browser.Opera&&!(o.Browser.IE&&o.Browser.Version<9)&&t.offsetParent&&t.parentNode.tagName)return!0;for(;null!=t;){if("BODY"==t.tagName)return!0;t=t.parentNode}return!1}function K(t,e){void 0===e&&(e=function(){return!1});for(var n=t;n&&1==n.nodeType;){if(n==t||!e(n)){var o=n.tagName.toUpperCase();if("BODY"==o)return!0;if(-1!==["INPUT","BUTTON","TEXTAREA","SELECT","OPTION"].indexOf(o)&&n.disabled||!H(n,!1)||!V(n,!1))return!1}n=n.parentNode}return!0}function H(t,e){return e?"none"!=d(t).display:"none"!=t.style.display}function V(t,e){return e?"hidden"!=d(t).visibility:"hidden"!=t.style.visibility}function F(t,e){return W(t,e)+z(t,e)}function W(t,e){var n=e||d(t);return _(n.paddingTop)+_(n.paddingBottom)}function G(t){u(t=r.Str.DecodeHtmlViaTextArea(t))&&""!==t&&alert(t)}function X(t,e,n,o,i){var r=t;return r|=e?a.ModifierKey.Ctrl:0,r|=n?a.ModifierKey.Shift:0,r|=o?a.ModifierKey.Alt:0,r|=i?a.ModifierKey.Meta:0}e.setInnerHtmlInternal=k,e.SetElementDisplay=j,e.GetInnerText=function(t){if(o.Browser.Safari&&o.Browser.MajorVersion<=5){var e=(null==L&&((L=document.createElement("DIV")).style.width="0",L.style.height="0",L.style.overflow="visible",j(L,!1,!1,!1),document.body.appendChild(L)),L);k(e,t.innerHTML),j(e,!0,!1,!1);var n=e.innerText;return j(e,!1,!1,!1),n}return o.Browser.NetscapeFamily||o.Browser.WebKitFamily||o.Browser.IE&&o.Browser.Version>=9||o.Browser.Edge?t.textContent:t.innerText},e.GetVerticalScrollBarWidth=function(){if(void 0===D){var t=document.createElement("DIV");t.style.cssText="position: absolute; top: 0px; left: 0px; visibility: hidden; width: 200px; height: 150px; overflow: hidden; box-sizing: content-box",document.body.appendChild(t);var e=document.createElement("P");t.appendChild(e),e.style.cssText="width: 100%; height: 200px;";var n=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;n==o&&(o=t.clientWidth),D=n-o,document.body.removeChild(t)}return D},e.GetHorizontalBordersWidth=function(t,e){u(e)||(e=o.Browser.IE&&window.getComputedStyle?window.getComputedStyle(t):d(t));var n=0;return"none"!=e.borderLeftStyle&&(n+=w(e.borderLeftWidth)),"none"!=e.borderRightStyle&&(n+=w(e.borderRightWidth)),n},e.GetVerticalBordersWidth=z,e.SetElementVisibility=function(t,e){t&&(t.style.visibility="string"==typeof e?e:e?"visible":"hidden")},e.SetElementFloat=R,e.SetElementOpacity=N,e.CreateGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},e.IsUrlContainsClientScript=function(t){return-1!==t.toLowerCase().indexOf("javascript:")},e.IsExistsElement=U,e.IsValidElement=B,e.IsInteractiveControl=function(t){return i.Data.ArrayIndexOf(["A","INPUT","SELECT","OPTION","TEXTAREA","BUTTON","IFRAME"],t.tagName)>-1},e.IsActionElement=function(t){if(!U(t))return!1;var e=parseInt(s.Attr.GetAttribute(t,s.Attr.GetTabIndexAttributeName())),n=!isNaN(e),o=n&&e>-1,i=n&&e<0,r=t.tagName,a=K(t),c=-1!==["BUTTON","SELECT","TEXTAREA","OPTION","IFRAME"].indexOf(r),u="A"===r&&(!!t.href||o),p="INPUT"===r&&"hidden"!==t.type.toLowerCase(),h="INPUT"!==r&&o,l="DIV"==r&&"true"===t.contentEditable;return a&&!i&&(c||u||p||h||l)},e.IsFocusable=K,e.GetElementDisplay=H,e.GetElementVisibility=V,e.GetClearClientHeight=function(t){return t.offsetHeight-F(t)},e.GetTopBottomBordersAndPaddingsSummaryValue=F,e.GetTopBottomPaddings=W,e.ParseShortcutString=function(t){if(!t)return 0;var e=!1,n=!1,o=!1,i=!1,s=null,c=t.toString().split("+");if(c.length>0)for(var u=0;u<c.length;u++){var p=r.Str.Trim(c[u].toUpperCase());switch(p){case"CONTROL":case"CONTROLKEY":case"CTRL":e=!0;break;case"SHIFT":case"SHIFTKEY":n=!0;break;case"ALT":o=!0;break;case"CMD":i=!0;break;case"F1":s=a.KeyCode.F1;break;case"F2":s=a.KeyCode.F2;break;case"F3":s=a.KeyCode.F3;break;case"F4":s=a.KeyCode.F4;break;case"F5":s=a.KeyCode.F5;break;case"F6":s=a.KeyCode.F6;break;case"F7":s=a.KeyCode.F7;break;case"F8":s=a.KeyCode.F8;break;case"F9":s=a.KeyCode.F9;break;case"F10":s=a.KeyCode.F10;break;case"F11":s=a.KeyCode.F11;break;case"F12":s=a.KeyCode.F12;break;case"RETURN":case"ENTER":s=a.KeyCode.Enter;break;case"HOME":s=a.KeyCode.Home;break;case"END":s=a.KeyCode.End;break;case"LEFT":s=a.KeyCode.Left;break;case"RIGHT":s=a.KeyCode.Right;break;case"UP":s=a.KeyCode.Up;break;case"DOWN":s=a.KeyCode.Down;break;case"PAGEUP":s=a.KeyCode.PageUp;break;case"PAGEDOWN":s=a.KeyCode.PageDown;break;case"SPACE":s=a.KeyCode.Space;break;case"TAB":s=a.KeyCode.Tab;break;case"BACKSPACE":case"BACK":s=a.KeyCode.Backspace;break;case"CONTEXT":s=a.KeyCode.ContextMenu;break;case"ESCAPE":case"ESC":s=a.KeyCode.Esc;break;case"DELETE":case"DEL":s=a.KeyCode.Delete;break;case"INSERT":case"INS":s=a.KeyCode.Insert;break;case"PLUS":s="+".charCodeAt(0);break;default:s=p.charCodeAt(0)}}else G("Invalid shortcut");return X(s,e,n,o,i)},e.ShowErrorAlert=G,e.GetShortcutCode=X,e.GetShortcutCodeByEvent=function(t){return X(c.Evt.GetKeyCode(t),t.ctrlKey,t.shiftKey,t.altKey,!!o.Browser.MacOSPlatform&&t.metaKey)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){}return t.IdentUserAgent=function(e,n){void 0===n&&(n=!1);var o=["Mozilla","IE","Firefox","Netscape","Safari","Chrome","Opera","Opera10","Edge"],i={Safari:2,Chrome:.1,Mozilla:1.9,Netscape:8,Firefox:2,Opera:9,IE:6,Edge:12};if(e&&0!=e.length){e=e.toLowerCase(),t.indentPlatformMajorVersion(e);try{for(var r,s={Windows:"Win",Macintosh:"Mac","Mac OS":"Mac",Mac_PowerPC:"Mac","cpu os":"MacMobile","cpu iphone os":"MacMobile",Android:"Android","!Windows Phone":"WinPhone","!WPDesktop":"WinPhone","!ZuneWP":"WinPhone"},a="(?:(\\d+)(?:\\.((?:\\d+?[1-9])|\\d)0*?)?)?",c={Safari:"applewebkit(?:.*?(?:version/(\\d+)(?:\\.((?:\\d+?[1-9])|\\d)0*?)?[\\.\\w\\d]*?(?:\\s+mobile/\\S*)?\\s+safari))?",Chrome:"(?:chrome|crios)(?!frame)(?:/|\\s*)?"+a,Mozilla:"mozilla(?:.*rv:"+a+".*Gecko)?",Netscape:"(?:netscape|navigator)\\d*/?\\s*"+a,Firefox:"firefox(?:/|\\s*)?"+a,Opera:"(?:opera|sopr)(?:/|\\s*)?"+a,Opera10:"opera.*\\s*version(?:/|\\s*)?"+a,IE:"msie\\s*"+a,Edge:"edge(?:/|\\s*)?"+a},u=-1,p=0;p<o.length;p++){var h=o[p],l=new RegExp(c[h],"i");l.compile&&l.compile(c[h],"i");var d=l.exec(e);if(d&&d.index>=0){if("IE"==r&&u>=11&&"Safari"==h)continue;"Opera10"==(r=h)&&(r="Opera");u=t.GetBrowserVersion(e,d,"trident(?:/|\\s*)?(?:(\\d+)(?:\\.((?:\\d+?[1-9])|\\d)0*?)?)?",t.getIECompatibleVersionString()),"Mozilla"==r&&u>=11&&(r="IE")}}r||(r="IE");var f,y=-1!=u;y||(u=i[r]);var m=Number.MAX_VALUE;for(var g in s)if(s.hasOwnProperty(g)){var v="!"==g.substr(0,1),P=e.indexOf((v?g.substr(1):g).toLowerCase());P>=0&&(P<m||v)&&(m=v?0:P,f=s[g])}var C=e.toUpperCase().match("SM-[A-Z]"),S=C&&C.length>0;"WinPhone"==f&&u<9&&(u=Math.floor(t.getVersionFromTrident(e,"trident(?:/|\\s*)?"+a))),!n&&"IE"==r&&u>7&&document.documentMode<u&&(u=document.documentMode),"WinPhone"==f&&(u=Math.max(9,u)),f||(f="Win"),f!=s["cpu os"]||y||(u=4),t.fillUserAgentInfo(o,r,u,f,S)}catch(e){t.fillUserAgentInfo(o,"IE",i.IE,"Win")}}else t.fillUserAgentInfo(o,"IE",i.IE,"Win")},t.GetBrowserVersion=function(e,n,o,i){var r=t.getVersionFromMatches(n);if(i){var s=t.getVersionFromTrident(e,o);if("edge"===i||parseInt(i)===s)return s}return r},t.getIECompatibleVersionString=function(){if(document.compatible)for(var t=0;t<document.compatible.length;t++)if("IE"===document.compatible[t].userAgent&&document.compatible[t].version)return document.compatible[t].version.toLowerCase();return""},t.fillUserAgentInfo=function(e,n,o,i,r){void 0===r&&(r=!1);for(var s=0;s<e.length;s++){var a=e[s];t[a]=a==n}t.Version=Math.floor(10*o)/10,t.MajorVersion=Math.floor(t.Version),t.WindowsPlatform="Win"==i||"WinPhone"==i,t.MacOSPlatform="Mac"==i,t.MacOSMobilePlatform="MacMobile"==i,t.AndroidMobilePlatform="Android"==i,t.WindowsPhonePlatform="WinPhone"==i,t.WebKitFamily=t.Safari||t.Chrome||t.Opera&&t.MajorVersion>=15,t.NetscapeFamily=t.Netscape||t.Mozilla||t.Firefox,t.HardwareAcceleration=t.IE&&t.MajorVersion>=9||t.Firefox&&t.MajorVersion>=4||t.AndroidMobilePlatform&&t.Chrome||t.Chrome&&t.MajorVersion>=37||t.Safari&&!t.WindowsPlatform||t.Edge||t.Opera&&t.MajorVersion>=46,t.WebKitTouchUI=t.MacOSMobilePlatform||t.AndroidMobilePlatform;var c=t.IE&&t.MajorVersion>9&&t.WindowsPlatform&&t.UserAgent.toLowerCase().indexOf("touch")>=0;if(t.MSTouchUI=c||t.Edge&&!!window.navigator.maxTouchPoints,t.TouchUI=t.WebKitTouchUI||t.MSTouchUI,t.MobileUI=t.WebKitTouchUI||t.WindowsPhonePlatform,t.AndroidDefaultBrowser=t.AndroidMobilePlatform&&!t.Chrome,t.AndroidChromeBrowser=t.AndroidMobilePlatform&&t.Chrome,r&&(t.SamsungAndroidDevice=r),t.MSTouchUI){var u=t.UserAgent.toLowerCase().indexOf("arm;")>-1;t.VirtualKeyboardSupported=u||t.WindowsPhonePlatform}else t.VirtualKeyboardSupported=t.WebKitTouchUI;t.fillDocumentElementBrowserTypeClassNames(e)},t.indentPlatformMajorVersion=function(e){var n=/(?:(?:windows nt|macintosh|mac os|cpu os|cpu iphone os|android|windows phone|linux) )(\d+)(?:[-0-9_.])*/.exec(e);n&&(t.PlaformMajorVersion=n[1])},t.prototype.GetBrowserVersion=function(e,n,o,i){var r=t.getVersionFromMatches(n);if(i){var s=t.getVersionFromTrident(e,o);if("edge"===i||parseInt(i)===s)return s}return r},t.getVersionFromMatches=function(t){var e=-1,n="";return t[1]&&(n+=t[1],t[2]&&(n+="."+t[2])),""!=n&&(e=parseFloat(n),isNaN(e)&&(e=-1)),e},t.getVersionFromTrident=function(e,n){var o=new RegExp(n,"i").exec(e);return t.getVersionFromMatches(o)+4},t.fillDocumentElementBrowserTypeClassNames=function(e){for(var n="",o=e.concat(["WindowsPlatform","MacOSPlatform","MacOSMobilePlatform","AndroidMobilePlatform","WindowsPhonePlatform","WebKitFamily","WebKitTouchUI","MSTouchUI","TouchUI","AndroidDefaultBrowser"]),i=0;i<o.length;i++){var r=o[i];t[r]&&(n+="dx"+r+" ")}n+="dxBrowserVersion-"+t.MajorVersion,document&&document.documentElement&&(""!=document.documentElement.className&&(n=" "+n),document.documentElement.className+=n,t.Info=n)},t.UserAgent=window.navigator.userAgent.toLowerCase(),t._foo=t.IdentUserAgent(t.UserAgent),t}();e.Browser=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o,i=n(9),r=n(5),s=n(0),a=n(13),c=n(8);!function(t){t[t.In=0]="In",t[t.Cm=1]="Cm",t[t.Px=2]="Px"}(o=e.DiagramUnit||(e.DiagramUnit={}));var u=function(){function t(){this.items=[],this.itemIndexByKey={},this.pageSize=new s.Size(8391,11906),this.pageLandscape=!1,this.pageColor=t.defaultPageColor,this.gridSize=180,this.showGrid=!0,this.snapToGrid=!0,this.units=o.Cm,this.zoomLevel=1,this.size=this.pageSize.clone()}return Object.defineProperty(t.prototype,"pageWidth",{get:function(){return this.pageLandscape?this.pageSize.height:this.pageSize.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageHeight",{get:function(){return this.pageLandscape?this.pageSize.width:this.pageSize.height},enumerable:!0,configurable:!0}),t.prototype.getRectangle=function(){return t.getRectangle(this.items)},t.getRectangle=function(t){return s.GeometryUtils.getCommonRectangle(t.map(function(t){return t.rectangle}))},t.prototype.pushItem=function(t){var e=this.items.push(t);this.itemIndexByKey[t.key]=e-1},t.prototype.removeItem=function(t){var e=this.getItemIndex(t);delete this.itemIndexByKey[t.key],this.items.splice(e,1),this.updateIndicesHash(e)},t.prototype.reorderItem=function(t,e){var n=this.getItemIndex(t);this.items.splice(n,1),this.items.splice(e,0,t),this.updateIndicesHash(Math.min(n,e))},t.prototype.updateIndicesHash=function(t){for(var e=t;e<this.items.length;e++)this.itemIndexByKey[this.items[e].key]=e},t.prototype.getItemIndex=function(t){return this.itemIndexByKey[t.key]},t.prototype.findShape=function(t){var e=this.findItem(t);return e instanceof i.Shape?e:void 0},t.prototype.findShapeCore=function(t){var e;return this.items.forEach(function(n){n instanceof i.Shape&&t(n)&&(e=n)}),e},t.prototype.findShapeAtPosition=function(t){return this.findShapeCore(function(e){return e.position.equals(t)})},t.prototype.findShapeByDataKey=function(t){return this.findShapeCore(function(e){return e.dataKey===t})},t.prototype.findConnector=function(t){var e=this.findItem(t);return e instanceof r.Connector?e:void 0},t.prototype.findConnectorCore=function(t){var e;return this.items.forEach(function(n){n instanceof r.Connector&&t(n)&&(e=n)}),e},t.prototype.findConnectorAtPoints=function(t){return this.findConnectorCore(function(e){return s.GeometryUtils.arePointsEqual(e.points,t)})},t.prototype.findConnectorByDataKey=function(t){return this.findConnectorCore(function(e){return e.dataKey===t})},t.prototype.findItem=function(t){return this.items[this.itemIndexByKey[t]]},t.isIntersectedItems=function(t,e){var n=!1;return t instanceof i.Shape?n=e.intersectedByRect(t.rectangle):t instanceof r.Connector&&t.getSegments().forEach(function(t){e instanceof i.Shape?n=n||t.intersectRect(e.rectangle):e instanceof r.Connector&&e.getSegments().forEach(function(e){n=n||t.intersect(e)})}),n},t.prototype.getIntersectItems=function(e){var n=[];return this.items.forEach(function(o){e===o||o instanceof r.Connector&&-1!==e.attachedConnectors.indexOf(o)||!t.isIntersectedItems(o,e)||n.push(o)}),n},t.prototype.getIntersectItemsMinZIndex=function(t){return this.getIntersectItems(t).map(function(t){return t.zIndex}).reduce(function(t,e){return Math.min(t,e)},Number.MAX_VALUE)},t.prototype.getIntersectItemsMaxZIndex=function(t){return this.getIntersectItems(t).map(function(t){return t.zIndex}).reduce(function(t,e){return Math.max(t,e)},-Number.MAX_VALUE)},t.prototype.iterateItems=function(t){this.items.forEach(t)},t.prototype.invalidateItems=function(){this.iterateItems(function(t){t.invalidatePrimitives(),t instanceof r.Connector&&t.invalidateRenderPoints()})},t.prototype.getNextKey=function(t){var e=this;return c.ModelUtils.getNextItemKey(this.items.map(function(t){return t.key}),function(t){return void 0===e.itemIndexByKey[t]},t)},t.prototype.getModelUnit=function(t){switch(this.units){case o.Cm:return a.UnitConverter.twipsToCentimeters(t);case o.In:return a.UnitConverter.twipsToInches(t);case o.Px:return a.UnitConverter.twipsToPixels(t)}},t.prototype.getModelUnitText=function(t,e){switch(void 0===e&&(e=2),this.units){case o.Cm:return+this.getModelUnit(t).toFixed(e)+" cm";case o.In:return+this.getModelUnit(t).toFixed(e)+" in";case o.Px:return this.getModelUnit(t).toFixed(0)+" px"}},t.prototype.getTwipsUnit=function(t){switch(this.units){case o.Cm:return a.UnitConverter.centimetersToTwips(t);case o.In:return a.UnitConverter.inchesToTwips(t);case o.Px:return a.UnitConverter.pixelsToTwips(t)}},t.defaultPageColor="white",t}();e.DiagramModel=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e,n,o){void 0===o&&(o=1),this.weight=o,this.key=t,this.from=e,this.to=n}return t.prototype.getHashKey=function(){return this.from+"_"+this.to},t.prototype.reverse=function(){return new t(this.key,this.to,this.from,this.weight)},t}();e.Edge=o;var i=function(t,e){this.item=t,this.position=e};e.PositionInfo=i,function(t){t[t.Outgoing=1]="Outgoing",t[t.Incoming=2]="Incoming",t[t.OutgoingAndIncoming=3]="OutgoingAndIncoming"}(e.ConnectionMode||(e.ConnectionMode={}))},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(175),c=n(8),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!0,this.control.model[this.getPropertyName()],this.getPropertyOptions())},e.prototype.executeCore=function(t,e){var n=this;this.control.history.beginTransaction();var o=this.getPropertyName();return this.createHistoryItems(o,e).forEach(function(t){n.control.history.addAndRedo(t)}),c.ModelUtils.tryUpdateModelSize(this.control.history,this.control.model),this.control.history.endTransaction(),!0},e.prototype.createHistoryItems=function(t,e){return[new a.ChangePagePropertyHistoryItem(t,e)]},e.prototype.getPropertyOptions=function(){return null},e}(r.CommandBase);e.ChangePagePropertyCommand=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(45),s=n(14),a=function(t){function e(e,n){var o=t.call(this,e)||this;return o.history=n,o}return i(e,t),e.prototype.onMouseMove=function(t){t.button!==s.MouseButton.Left?(this.cancelChanges(),this.handler.switchToDefaultState()):(this.onApplyChanges(t),this.modified||this.handler.raiseDragStart(this.getDraggingElementKeys()),this.modified=!0)},e.prototype.cancelChanges=function(){this.history.undoTransaction(),this.modified=!1},e.prototype.onMouseUp=function(t){this.handler.switchToDefaultState()},e.prototype.start=function(){this.history.beginTransaction()},e.prototype.finish=function(){this.modified?(this.onFinishWithChanges(),this.modified=!1,this.history.endTransaction(),this.handler.raiseDragEnd(this.getDraggingElementKeys())):this.history.endTransaction()},e.prototype.onFinishWithChanges=function(){},e.prototype.getSnappedPoint=function(t,e){return this.handler.getSnappedPoint(t,e)},e}(r.MouseHandlerCancellableState);e.MouseHandlerDraggingState=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(t,e){this.key=t,this.value=e};e.ShapeParameter=o;var i=function(){function t(){this.items={}}return t.prototype.add=function(t){this.items[t.key]=t},t.prototype.addRange=function(t){for(var e=0;e<t.length;e++)this.add(t[e])},t.prototype.get=function(t){return this.items[t]},t.prototype.forEach=function(t){for(var e in this.items)this.items.hasOwnProperty(e)&&t(this.items[e])},t.prototype.clone=function(){var e=new t;return this.forEach(function(t){e.add(new o(t.key,t.value))}),e},t.prototype.toObject=function(){var t={},e=!1;return this.forEach(function(n){t[n.key]={value:n.value},e=!0}),e?t:null},t.prototype.fromObject=function(t){this.forEach(function(e){var n=t[e.key];n&&"number"==typeof n.value&&(e.value=n.value)})},t}();e.ShapeParameters=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(14),i=n(46),r=n(0),s=n(19),a=function(){function t(){}return t.updateSvgElementSize=function(t,e,n){t.style.width=e+"px",t.style.height=n+"px",t.setAttribute("viewBox","0 0 "+e+" "+n)},t.removeContent=function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},t.setElementEventData=function(t,e,n,i){e!==o.MouseEventElementType.Undefined&&(t.setAttribute("data-type",e.toString()),void 0!==n&&t.setAttribute("data-key",n.toString()),void 0!==i&&t.setAttribute("data-value",i.toString()))},t.getElementEventData=function(t){if(t.getAttribute&&t.getAttribute("data-type"))return new o.MouseEventSource(parseInt(t.getAttribute("data-type")),t.getAttribute("data-key"),t.getAttribute("data-value"))},t.getHtmlElementStylePropertyName=function(t){switch(t){case"fill":return"color";case"text-anchor":return"text-align"}return t},t.getStylePropertyValue=function(t,e,n){if(void 0===n&&(n=!1),"text-anchor"===t&&n){if("start"===e)return"end";if("end"===e)return"start"}return e},t.applyStyleToElement=function(t,e,n){var o=this;void 0===n&&(n=!1);var i=t.getDefaultInstance();t.forEach(function(r){var s=t[r],a=e instanceof HTMLElement?o.getHtmlElementStylePropertyName(r):r;void 0!==s&&""!==s&&s!==i[r]?e.style.setProperty(a,o.getStylePropertyValue(r,s,n)):e.style.setProperty(a,"")})},t.generateSvgElementId=function(t){return t+"_"+s.CreateGuid()},t.getSvgTextRectangle=function(t,e){var n;void 0===e&&(e=0);try{n=t.getBBox()}catch(t){}if(n){var o=i.UnitConverter.pixelsToTwips(Math.round(n.x))-e,s=i.UnitConverter.pixelsToTwips(Math.round(n.y))-e,a=i.UnitConverter.pixelsToTwips(Math.round(n.width))+2*e,c=i.UnitConverter.pixelsToTwips(Math.round(n.height))+2*e;return r.Rectangle.create(o,s,a,c)}},t}();e.RenderUtils=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,o,i){void 0===o&&(o=-1),void 0===i&&(i=!1);var r=t.call(this,e,n)||this;return r.pointIndex=o,r.skipped=i,r}return i(e,t),e.prototype.offset=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=0),new e(this.x+t,this.y+n)},e.prototype.multiply=function(t,n){return void 0===t&&(t=1),void 0===n&&(n=t),new e(this.x*t,this.y*n)},e.prototype.clone=function(){return new e(this.x,this.y,this.pointIndex)},e}(n(0).Point);e.ConnectorRenderPoint=r},function(t,e,n){"use strict";var o,i;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.Straight=0]="Straight",t[t.Orthogonal=1]="Orthogonal"}(o=e.ConnectorLineOption||(e.ConnectorLineOption={})),function(t){t[t.None=0]="None",t[t.Arrow=1]="Arrow"}(i=e.ConnectorLineEnding||(e.ConnectorLineEnding={}));var r=function(){function t(){this.lineOption=o.Orthogonal,this.startLineEnding=i.None,this.endLineEnding=i.Arrow}return t.prototype.clone=function(){var e=new t;return e.lineOption=this.lineOption,e.startLineEnding=this.startLineEnding,e.endLineEnding=this.endLineEnding,e},t.prototype.forEach=function(t){for(var e in this)this.hasOwnProperty(e)&&t(e)},t.prototype.toObject=function(){var t={},e=!1;return this.lineOption!==o.Orthogonal&&(t.lineOption=this.lineOption,e=!0),this.startLineEnding!==i.None&&(t.startLineEnding=this.startLineEnding,e=!0),this.endLineEnding!==i.Arrow&&(t.endLineEnding=this.endLineEnding,e=!0),e?t:null},t.prototype.fromObject=function(t){"number"==typeof t.lineOption&&(this.lineOption=t.lineOption),"number"==typeof t.startLineEnding&&(this.startLineEnding=t.startLineEnding),"number"==typeof t.endLineEnding&&(this.endLineEnding=t.endLineEnding)},t}();e.ConnectorProperties=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var o=t.call(this)||this;return o.selectedKeys=n,o.selection=e,o}return i(e,t),e.prototype.redo=function(){this.oldSelection=this.selection.getKeys().slice(0),this.selection.set(this.selectedKeys)},e.prototype.undo=function(){this.selection.set(this.oldSelection)},e}(n(4).HistoryItem);e.SetSelectionHistoryItem=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),i=n(120),r=n(121),s=n(122),a=n(123),c=n(124),u=n(125),p=n(126),h=n(127),l=n(128),d=n(129),f=n(75),y=n(56),m=n(130),g=n(12),v=n(76),P=n(77),C=n(78),S=n(131),_=n(132),w=n(133),x=n(134),b=n(135),O=n(79),M=n(80),E=n(136),T=n(137),I=n(138),A=n(139),D=n(140),L=n(141),k=n(142),j=n(143),z=n(144),R=n(145),N=n(146),U=n(147),B=n(148),K=n(149),H=function(){function t(){}return t.get=function(t){return this.descriptions[t]},t.getTypesByCategory=function(e){var n=[];for(var o in this.descriptions)t.descriptions.hasOwnProperty(o)&&(e&&this.descriptions[o].category!==e||n.push(parseInt(o)));return n},t.register=function(t){if(void 0!==this.descriptions[t.key])throw Error("Description key is duplicated");this.descriptions[t.key]=t},t.unregister=function(t){delete this.descriptions[t]},t.registerCustomShape=function(t){if(void 0===t.id)throw Error("Custom shape id is not defined");if(void 0!==this.descriptions[o.ShapeType.Custom+t.id])throw Error("Custom shape id is duplicated");this.register(new K.CustomShapeDescription(o.ShapeType.Custom+t.id,t.title,t.svgUrl,t.svgLeft,t.svgTop,t.svgWidth,t.svgHeight,t.defaultWidth,t.defaultHeight,t.defaultText,t.allowHasText,t.textLeft,t.textTop,t.textWidth,t.textHeight,t.connectionPoints,t.category))},t.unregisterCustomShape=function(t){this.unregister(o.ShapeType.Custom+t)},t.descriptions={},t}();e.ShapeDescriptionManager=H,H.register(new w.ArrowBottomShapeDescription),H.register(new x.ArrowEastWestShapeDescription),H.register(new b.ArrowLeftShapeDescription),H.register(new p.ArrowNorthSouthShapeDescription),H.register(new h.ArrowRightShapeDescription),H.register(new l.ArrowTopShapeDescription),H.register(new d.CrossShapeDescription),H.register(new f.DiamondShapeDescription),H.register(new y.EllipseShapeDescription),H.register(new m.HeartShapeDescription),H.register(new g.RectangleShapeDescription),H.register(new O.TriangleShapeDescription),H.register(new v.TextShapeDescription),H.register(new P.PentagonShapeDescription),H.register(new C.HexagonShapeDescription),H.register(new S.OctagonShapeDescription),H.register(new _.StarShapeDescription),H.register(new i.ProcessShapeDescription),H.register(new r.DecisionShapeDescription),H.register(new c.TerminatorShapeDescription),H.register(new u.PredefinedProcessShapeDescription),H.register(new M.DocumentShapeDescription),H.register(new E.MultipleDocumentsShapeDescription),H.register(new s.ManualInputShapeDescription),H.register(new T.PreparationShapeDescription),H.register(new a.DataShapeDescription),H.register(new A.DatabaseShapeDescription),H.register(new I.HardDiskShapeDescription),H.register(new D.InternalStorageShapeDescription),H.register(new L.PaperTapeShapeDescription),H.register(new k.ManualOperationShapeDescription),H.register(new j.DelayShapeDescription),H.register(new z.StoredDataShapeDescription),H.register(new N.DisplayShapeDescription),H.register(new R.MergeShapeDescription),H.register(new U.OrShapeDescription),H.register(new B.SummingJunctionShapeDescription)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(9),i=n(5),r=function(){function t(){}return t.export=function(t){var e={page:{},connectors:[],shapes:[]};return e.page={width:t.size.width,height:t.size.height,pageColor:t.pageColor,pageWidth:t.pageSize.width,pageHeight:t.pageSize.height,pageLandscape:t.pageLandscape,gridSize:t.gridSize,showGrid:t.showGrid,snapToGrid:t.snapToGrid,units:t.units},this.exportItemsCore(t.items,e),JSON.stringify(e)},t.exportItems=function(t){var e={connectors:[],shapes:[]};return this.exportItemsCore(t,e),JSON.stringify(e)},t.exportItemsCore=function(t,e){var n=this;t.forEach(function(t){if(t instanceof o.Shape&&e.shapes.push(n.exportShape(t)),t instanceof i.Connector){var r=n.exportConnector(t);t.beginItem&&(r.beginItemKey=t.beginItem.key,r.beginConnectionPointIndex=t.beginConnectionPointIndex),t.endItem&&(r.endItemKey=t.endItem.key,r.endConnectionPointIndex=t.endConnectionPointIndex),e.connectors.push(r)}})},t.exportItem=function(t){return{key:t.key,dataKey:t.dataKey,locked:t.locked,zIndex:t.zIndex}},t.exportShape=function(t){var e=this.exportItem(t);e.type=t.description.key,e.text=t.text,e.x=t.position.x,e.y=t.position.y,e.width=t.size.width,e.height=t.size.height;var n=t.parameters.toObject();n&&(e.parameters=n);var o=t.style.toObject();o&&(e.style=o);var i=t.styleText.toObject();return i&&(e.styleText=i),e},t.exportConnector=function(t){var e=this.exportItem(t);e.points=t.points.map(function(t){return{x:t.x,y:t.y}});var n=t.texts.toObject();n&&(e.texts=n);var o=t.properties.toObject();o&&(e.properties=o);var i=t.style.toObject();i&&(e.style=i);var r=t.styleText.toObject();return r&&(e.styleText=r),e},t.exportSvg=function(t,e){t.exportSvgImage(e)},t.exportPng=function(t,e){t.exportPngImage(e)},t.exportJpg=function(t,e){t.exportJpgImage(e)},t}();e.Exporter=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=n(3),a=function(t){function e(e,n,o){void 0===o&&(o=s.ConnectionPointSide.Undefined);var i=t.call(this,e,n)||this;return i.side=o,i}return i(e,t),e.prototype.offset=function(t,n){return void 0===t&&(t=0),void 0===n&&(n=0),new e(this.x+t,this.y+n)},e.prototype.multiply=function(t,n){return void 0===t&&(t=1),void 0===n&&(n=t),new e(this.x*t,this.y*n)},e.prototype.clone=function(){return new e(this.x,this.y,this.side)},e.prototype.toPoint=function(){return new r.Point(this.x,this.y)},e}(r.Point);e.ConnectionPoint=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),i=n(5),r=function(){function t(t){this.parent=t}return Object.defineProperty(t.prototype,"connector",{get:function(){return this.parent.connector},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"beginRect",{get:function(){return this.parent.beginRect},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"endRect",{get:function(){return this.parent.endRect},enumerable:!0,configurable:!0}),t.prototype.getBeginOffsetPoints=function(t,e,n,i){if(e=this.getCorrectOriginPoint(e,i),t!==o.ConnectionPointSide.Undefined){if(this.isBeginEndSame())return this.getSameShapeOffsetPoints(t,e,n,i);if(this.isBeginEndOverlappedPoints(e,n))return this.getOverlappedPointsOffsetPoints(t,e,n,i);if(this.isBeginEndOverlapped())return this.getBeginOverlappedShapeOffsetPoints(t,e,n,i)}else if(this.isOriginRectContainsTargetPoint(i,n))return this.getOverlappedPointsOffsetPoints(t,e,n,i);return this.isOnSidePoint(e,n)?this.getBeginOnSideOffsetPoints(t,e,n,i):this.getBeginOffSideOffsetPoints(t,e,n,i)},t.prototype.getEndOffsetPoints=function(t,e,n,i){if(e=this.getCorrectOriginPoint(e,i),t!==o.ConnectionPointSide.Undefined){if(this.isBeginEndSame())return this.getSameShapeOffsetPoints(t,e,n,i);if(this.isBeginEndOverlappedPoints(n,e))return this.getOverlappedPointsOffsetPoints(t,e,n,i);if(this.isBeginEndOverlapped())return this.getEndOverlappedShapeOffsetPoints(t,e,n,i)}else if(this.isOriginRectContainsTargetPoint(i,n))return this.getOverlappedPointsOffsetPoints(t,e,n,i);return this.isOnSidePoint(e,n)?this.getEndOnSideOffsetPoints(t,e,n,i):this.getEndOffSideOffsetPoints(t,e,n,i)},t.prototype.getSide=function(t,e){return Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?e.x>t.x?o.ConnectionPointSide.East:o.ConnectionPointSide.West:e.y>t.y?o.ConnectionPointSide.South:o.ConnectionPointSide.North},t.prototype.getSideCalculator=function(t,e){return this.parent.getSideCalculator(this.getSide(t,e))},t.prototype.getMinOffset=function(){return i.Connector.minOffset},t.prototype.isBeginEndSame=function(){return this.connector.beginItem===this.connector.endItem},t.prototype.isBeginEndOverlapped=function(){return this.beginRect&&this.endRect&&this.beginRect.intersect(this.endRect)},t.prototype.isBeginEndOverlappedX=function(){return this.beginRect&&this.endRect&&this.beginRect.intersectX(this.endRect)},t.prototype.isBeginEndOverlappedY=function(){return this.beginRect&&this.endRect&&this.beginRect.intersectY(this.endRect)},t.prototype.isBeginEndOverlappedPoints=function(t,e){return this.beginRect&&this.endRect&&(this.beginRect.contains(e)||this.endRect.contains(t))},t.prototype.isOriginRectContainsTargetPoint=function(t,e){return t&&t.contains(e)},t}();e.ConnectorPointsOrthogonalSideCalculatorBase=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(22),s=n(9),a=n(0),c=n(60),u=function(){function t(t,e){this.nodeMap={},this.edgeMap={},this.nodes=[],this.edges=[],this.onInit(),t.forEach(this.addNode.bind(this)),e.forEach(this.addEdge.bind(this))}return Object.defineProperty(t.prototype,"items",{get:function(){return this.nodes.map(this.getNode.bind(this))},enumerable:!0,configurable:!0}),t.prototype.onInit=function(){},t.prototype.addEdge=function(t){this.edgeMap[t.key]=t,this.edges.push(t)},t.prototype.addNode=function(t){this.nodeMap[t.key]=t,this.nodes.push(t.key)},t.prototype.getNode=function(t){return this.nodeMap[t]},t.prototype.getEdge=function(t){return this.edgeMap[t]},t.prototype.isEmpty=function(){return!this.nodes.length&&!this.edges.length},t.prototype.getAdjacentEdges=function(t,e){return void 0===e&&(e=r.ConnectionMode.OutgoingAndIncoming),this.edges.filter(function(n){return e&r.ConnectionMode.Incoming&&n.to===t||e&r.ConnectionMode.Outgoing&&n.from===t})},t}(),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.cast=function(t,n){var o=this;return new e(this.nodes.map(function(e){return t(o.getNode(e))}),this.edges.map(function(t){return n?n(t):t}))},e.prototype.getConnectedComponents=function(){var t=this.createIterator(r.ConnectionMode.OutgoingAndIncoming);t.visitEachEdgeOnce=!0;for(var n=[],o=function(o){var r=[],s=[];t.onNode=function(t){return r.push(t)},t.onEdge=function(t){return s.push(t)},t.iterate(i.nodes[o]),r.length&&n.push(new e(r,s))},i=this,s=0;s<this.nodes.length;s++)o(s);return n},e.prototype.createIterator=function(t){var e=new l(this,t);return e.comparer=function(t,e){return t.weight-e.weight},e},e.prototype.getSpanningGraph=function(t,n,o){var i=this;if(void 0===o&&(o=void 0),!this.nodes.length)return new e([],[]);o||(o=function(t){return t.weight});var r=[],s=new c.HashSet,a=new c.HashSet([],function(t){return t.getHashKey()});for(this.addNodeToSpanningGraph(t,n,r,s,a,o);r.length&&s.length!==this.nodes.length;){var u=r.shift();a.tryPush(u);var p=s.contains(u.from)?u.to:u.from;this.addNodeToSpanningGraph(p,n,r,s,a,o),r=r.filter(function(t){return!s.contains(t.from)||!s.contains(t.to)})}return new e(s.list().map(function(t){return i.getNode(t)}),a.list())},e.prototype.addNodeToSpanningGraph=function(t,e,n,o,i,s){o.tryPush(t),this.getAdjacentEdges(t,e).filter(function(t){return!i.contains(t)}).forEach(function(t){var e=s(t),o=a.Utils.binaryIndexOf(n,function(t){return t.weight-e});for(o=o<0?~o:o;o<n.length&&s(n[o])===e;)o++;n.splice(o,0,new r.Edge(t.key,t.from,t.to,e))})},e.create=function(t,n){return new e(t,n.filter(function(t){return t.beginItem&&t.endItem instanceof s.Shape&&t.endItem&&t.endItem instanceof s.Shape&&t.beginItem!==t.endItem}).map(function(t){return new r.Edge(t.key,t.beginItem&&t.beginItem.key,t.endItem&&t.endItem.key)}))},e}(u);e.Graph=p;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.onInit=function(){this.parentToChildren={},this.childToParents={}},e.prototype.addEdge=function(e){t.prototype.addEdge.call(this,e),(this.parentToChildren[e.from]||(this.parentToChildren[e.from]=[])).push(e.to),(this.childToParents[e.to]||(this.childToParents[e.to]=[])).push(e.from)},e.prototype.getChildren=function(t){return this.parentToChildren[t]||[]},e.prototype.getParents=function(t){return this.childToParents[t]||[]},e.prototype.createIterator=function(t){return new l(this,t)},e}(u);e.FastGraph=h;var l=function(){function t(t,e){void 0===e&&(e=r.ConnectionMode.OutgoingAndIncoming),this.graph=t,this.connectionMode=e,this.visitEachEdgeOnce=!0,this.visitEachNodeOnce=!0,this.visitedNodes={},this.visitedEdges={}}return t.prototype.iterate=function(t){if(!this.visitEachNodeOnce&&!this.visitEachEdgeOnce&&!this.skipNode)throw"skipNode or visitEachNodeOnce or visitEachEdgeOnce must be set to avoid SOF";this.iterateCore(t)},t.prototype.iterateCore=function(t){var e=this,n=this.graph.getNode(t);if(!(this.skipNode&&this.skipNode(n)||this.visitEachNodeOnce&&this.isNodeVisited(t))){this.visitedNodes[t]=!0,this.onNode&&this.onNode(n);var o=this.graph.getAdjacentEdges(t,this.connectionMode);if(this.skipEdge&&(o=o.filter(function(t){return!e.skipEdge(t)})),this.connectionMode&r.ConnectionMode.Outgoing){var i=o.filter(function(e){return e.from===t});this.comparer&&i.sort(this.comparer),i.forEach(function(t){e.visitEachEdgeOnce&&e.visitedEdges[t.key]||(e.visitedEdges[t.key]=!0,e.onEdge&&e.onEdge(t,!0),e.iterateCore(t.to),e.onAfterEdge&&e.onAfterEdge(t,!0))})}if(this.onAllEdges&&this.onAllEdges(n,!0),this.connectionMode&r.ConnectionMode.Incoming){var s=o.filter(function(e){return e.to===t});this.comparer&&s.sort(this.comparer),s.forEach(function(t){e.visitEachEdgeOnce&&e.visitedEdges[t.key]||(e.visitedEdges[t.key]=!0,e.onEdge&&e.onEdge(t,!1),e.iterateCore(t.from),e.onAfterEdge&&e.onAfterEdge(t,!1))})}this.onAllEdges&&this.onAllEdges(n,!1)}},t.prototype.isNodeVisited=function(t){return!!this.visitedNodes[t]},t.prototype.isEdgeVisited=function(t){return!!this.visitedEdges[t]},t}();e.GraphIterator=l},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),s=n(5),a=function(t){function e(e,n,o,i){var r=t.call(this)||this;return r.connectorKey=e.key,r.itemKey=n.key,r.connectionPointIndex=o,r.position=i,r}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey),n=t.model.findItem(this.itemKey);t.addConnection(e,n,this.connectionPointIndex,this.position)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.deleteConnection(e,this.position)},e}(r.HistoryItem);e.AddConnectionHistoryItem=a;var c=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connectorKey=e.key,i.connectionPointIndex=n,i.position=o,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);this.oldConnectionPointIndex=this.position===s.ConnectorPosition.Begin?e.beginConnectionPointIndex:e.endConnectionPointIndex,t.setConnectionPointIndex(e,this.connectionPointIndex,this.position)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.setConnectionPointIndex(e,this.oldConnectionPointIndex,this.position)},e}(r.HistoryItem);e.SetConnectionPointIndexHistoryItem=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connectorKey=e,i.pointIndex=n,i.point=o,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);this.oldPoint=e.points[this.pointIndex].clone(),t.moveConnectorPoint(e,this.pointIndex,this.point)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.moveConnectorPoint(e,this.pointIndex,this.oldPoint)},e}(n(4).HistoryItem);e.MoveConnectorPointHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),s=n(8),a=n(119);!function(t){t[t.Tree=0]="Tree",t[t.Sugiyama=1]="Sugiyama"}(e.DataLayoutType||(e.DataLayoutType={}));var c=function(){function t(t,e,n,o,i,r){if(this.nodes=[],this.edges=[],this.nodeKeyMap={},this.edgeKeyMap={},this.useNodeParentId=!1,this.useNodeItems=!1,null==t)throw new Error("DataSource key must be specified");this.key=t.toString(),this.name=e,this.nodeDataImporter=this.createNodeDataImporter(i),this.edgeDataImporter=this.createEdgeDataImporter(r),this.nodeDataSource=n||[],this.edgeDataSource=o||[],this.fetchData()}return t.prototype.fetchData=function(){var t=this;this.useNodeParentId=!1,this.useNodeItems=!1,this.nodeDataSource.forEach(function(e){t.addNode(e)}),this.useEdgesArray()?this.edgeDataSource.forEach(function(e){t.addEdge(e)}):this.nodes.forEach(function(e){t.addNodeEdgesByParentId(e)})},t.prototype.useEdgesArray=function(){return Array.isArray(this.edgeDataSource)&&this.edgeDataSource.length},t.prototype.addNode=function(t,e){var n=this,o=this.addNodeInternal(t,this.nodeDataImporter.getText(t),this.nodeDataImporter.getType(t),e);if(!this.useNodeParentId&&!this.useEdgesArray()){var i=this.nodeDataImporter.getItems(t);Array.isArray(i)&&i.length&&i.forEach(function(e){var i=n.addNode(e,t);n.addEdgeInternal(void 0,o.key,i.key),n.useNodeItems=!0})}return o},t.prototype.addNodeEdgesByParentId=function(t){if(!this.useNodeItems&&!this.useEdgesArray()){var e=this.nodeDataImporter.getParentKey(t.dataObj);null!=e&&(this.addEdgeInternal(void 0,this.getNodeKey(t.dataObj,this.nodeDataImporter.getParentKey),this.getNodeKey(t.dataObj,this.nodeDataImporter.getKey)),this.useNodeParentId=!0)}},t.prototype.addNodeInternal=function(t,e,n,o){var i=this.nodeDataImporter.getKey(t),a=null!=i?i.toString():s.ModelUtils.getGuidItemKey(),c=new p(this.key,a,t,e,n||r.ShapeType.Rectangle,o);return this.nodes.push(c),null==i&&(i=a,this.nodeDataImporter.setKey(t,a)),null!=i&&(this.nodeKeyMap[i]=a),c},t.prototype.addEdge=function(t){return this.addEdgeInternal(t,this.getNodeKey(t,this.edgeDataImporter.getFrom),this.getNodeKey(t,this.edgeDataImporter.getTo))},t.prototype.addEdgeInternal=function(t,e,n){var o=t&&this.edgeDataImporter.getKey(t),i=null!=o?o.toString():s.ModelUtils.getGuidItemKey(),r=new h(this.key,i,t,e,n);return this.edges.push(r),null==o&&(o=i,t&&this.edgeDataImporter.setKey(t,i)),null!=o&&(this.edgeKeyMap[o]=i),r},t.prototype.findNode=function(t){return this.nodes.filter(function(e){return void 0!==t&&e.key===t})[0]},t.prototype.findEdge=function(t){return this.edges.filter(function(e){return void 0!==t&&e.key===t})[0]},t.prototype.getNodeKey=function(t,e){return this.nodeKeyMap[e(t)]},t.prototype.createModelItems=function(t,e,n,o){s.ModelUtils.createItemsByDataSource(t,e,n,this,o)},t.prototype.createNodeDataImporter=function(t){var e=new a.DataSourceNodeDataImporter;return t&&(t.getKey&&(e.getKey=t.getKey),t.setKey&&(e.setKey=t.setKey),t.getText&&(e.getText=t.getText),t.setText&&(e.setText=t.setText),t.getType&&(e.getType=t.getType),t.setType&&(e.setType=t.setType),t.getParentKey&&(e.getParentKey=t.getParentKey),t.setParentKey&&(e.setParentKey=t.setParentKey),t.getItems&&(e.getItems=t.getItems),t.setItems&&(e.setItems=t.setItems)),e},t.prototype.createEdgeDataImporter=function(t){var e=new a.DataSourceEdgeDataImporter;return t&&(t.getKey&&(e.getKey=t.getKey),t.setKey&&(e.setKey=t.setKey),t.getFrom&&(e.getFrom=t.getFrom),t.setFrom&&(e.setFrom=t.setFrom),t.getTo&&(e.getTo=t.getTo),t.setTo&&(e.setTo=t.setTo)),e},t}();e.DataSource=c;var u=function(t,e,n){this.sourceKey=t,this.key=e,this.dataObj=n};e.DataSourceItem=u;var p=function(t){function e(e,n,o,i,r,s){var a=t.call(this,e,n,o)||this;return a.text=i,a.type=r,a.parentDataObj=s,a}return i(e,t),e}(u);e.DataSourceNodeItem=p;var h=function(t){function e(e,n,o,i,r){var s=t.call(this,e,n,o)||this;return s.sourceKey=e,s.from=i,s.to=r,s}return i(e,t),e}(u);e.DataSourceEdgeItem=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=function(t){function e(e,n,o,i,r,s){var a=t.call(this,r,s)||this;return a.cx=e,a.cy=n,a.rx=o,a.ry=i,a}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"ellipse")},e.prototype.applyElementProperties=function(e){this.setUnitAttribute(e,"cx",this.cx),this.setUnitAttribute(e,"cy",this.cy),this.setUnitAttribute(e,"rx",this.rx),this.setUnitAttribute(e,"ry",this.ry),t.prototype.applyElementProperties.call(this,e)},e}(n(15).SvgPrimitive);e.EllipsePrimitive=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=function(t,e,n,o){void 0===o&&(o=[]),this.key=t,this.margin=e,this.size=n,this.connectionPoints=o};e.NodeInfo=i;var r=function(){function t(t,e){this.info=t,this.position=e}return Object.defineProperty(t.prototype,"key",{get:function(){return this.info.key},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rectangle",{get:function(){return new o.Rectangle(this.position,this.info.size)},enumerable:!0,configurable:!0}),t}();e.NodeLayout=r;var s=function(t,e,n){this.key=t,this.beginIndex=e,this.endIndex=n};e.EdgeLayout=s;var a=function(){function t(t,e,n,o){void 0===e&&(e=t),void 0===n&&(n=t),void 0===o&&(o=t),this.top=t,this.right=e,this.bottom=n,this.left=o}return t.empty=function(){return new t(0)},t}();e.Margin=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(82),s=n(34),a=n(39),c=n(22),u=n(60),p=n(0),h=n(18),l=n(81),d=n(5),f=n(153),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.build=function(){var t=this,e=0,n=new l.GraphLayout,o=new g;return this.graph.getConnectedComponents().forEach(function(i){var r=f.CycleRemover.removeCycles(i),s=m.getLayers(r.graph),a=o.orderNodes(r.graph,s),c=Object.keys(r.removedEdges).map(function(t){return i.getEdge(t)}),u=o.assignAbsCoordinates(a),p=t.createInfoGraphLayout(u,r.reversedEdges,c);n.extend(t.setComponentOffset(p,e)),e+=t.getComponentOffset(p)}),n},e.prototype.createInfoGraphLayout=function(t,e,n){for(var o=this,i=new p.Point(0,0),r=t.items,s=new u.HashSet(r.map(function(t){return t.layer}).sort()),a=this.getAbsOffsetInfo(t.items),c={},d=0,f=Number.MAX_SAFE_INTEGER,y=Number.MIN_SAFE_INTEGER,m=function(t){var e=s.item(t),n=0;r.filter(function(t){return t.layer===e}).sort(function(t,e){return t.position-e.position}).forEach(function(t){var e=o.getDepthNodeSize(t),r=o.chooseDirectionValue(0,e),s=o.getAbsPosition(t.position,o.getBreadthNodeSize(t),a);i=o.setBreadth(i,s);var u=o.setDepthOffset(i,-r);if(c[t.key]=u,!t.isDummy){var p=o.settings.orientation===h.OrientationKind.Horizontal?u.y:u.x;f=Math.min(f,p),y=Math.max(y,p+o.getBreadthNodeSize(t)),n=Math.max(n,o.getDepthNodeSize(t))}}),d+=n,i=g.setBreadth(i,0),i=g.setDepthOffset(i,g.getDirectionValue(n+g.settings.layerSpacing))},g=this,v=0;v<s.length;v++)m(v);d+=(s.length-1)*this.settings.layerSpacing;var P=new l.GraphLayout;return this.createNodesLayout(t,P,f,d,c),this.createEdgesLayout(t,P,e,n),P},e.prototype.createNodesLayout=function(t,e,n,o,i){var r=this,s=this.settings.orientation===h.OrientationKind.Vertical?new p.Point(-n,this.chooseDirectionValue(0,o)):new p.Point(this.chooseDirectionValue(0,o),-n);t.items.forEach(function(t){if(!t.isDummy){var n=r.graph.getNode(t.key);e.addNode(new a.NodeLayout(n,i[t.key].offset(s.x,s.y)))}})},e.prototype.createEdgesLayout=function(t,e,n,o){var i=this.getDirectEdgeLayout(),r=this.getDiffLevelEdgeLayout(!0),s=this.getDiffLevelEdgeLayout(!1),c=this.getSameLevelEdgeLayout(!0),u=this.getSameLevelEdgeLayout(!1),p={};t.edges.filter(function(t){return!t.isDummy}).concat(o.map(function(t){return new C(t.key,!1,t.from,t.to)})).sort(function(e,n){return t.getNode(e.originFrom).layer-t.getNode(n.originFrom).layer||t.getNode(e.to).layer-t.getNode(n.to).layer}).forEach(function(o){var h=n[o.key],l=t.getNode(h?o.to:o.originFrom),f=t.getNode(h?o.originFrom:o.to);if(f.layer-l.layer==1)e.addEdge(new a.EdgeLayout(o.key,i.from,i.to));else{var y=[];if(f.position-l.position>=1)y.push(r),y.push({from:i.from,to:r.to}),y.push({from:r.from,to:i.to});else if(f.position-l.position<=-1)y.push(s),y.push({from:i.from,to:s.to}),y.push({from:s.from,to:i.to});else{var m=l.position===f.position&&0===f.position?[c,u]:[u,c];m.forEach(function(t){return y.push(t)}),m.forEach(function(t){y.push({from:t.from,to:i.to}),y.push({from:i.from,to:t.to})})}y.push(i);for(var g=0,v=void 0;v=y[g];g++){var P=l.key+"_"+v.from,C=f.key+"_"+v.to;if(p[P]!==d.ConnectorPosition.End&&p[C]!==d.ConnectorPosition.Begin){e.addEdge(new a.EdgeLayout(o.key,v.from,v.to)),p[P]=d.ConnectorPosition.Begin,p[C]=d.ConnectorPosition.End;break}}}})},e.prototype.getDirectEdgeLayout=function(){return this.settings.orientation===h.OrientationKind.Horizontal?this.settings.direction===h.LogicalDirectionKind.Forward?{from:1,to:3}:{from:3,to:1}:this.settings.direction===h.LogicalDirectionKind.Forward?{from:2,to:0}:{from:0,to:2}},e.prototype.getDiffLevelEdgeLayout=function(t){return this.settings.orientation===h.OrientationKind.Horizontal?t?{from:2,to:0}:{from:0,to:2}:t?{from:3,to:1}:{from:1,to:3}},e.prototype.getSameLevelEdgeLayout=function(t){return this.settings.orientation===h.OrientationKind.Horizontal?t?{from:0,to:0}:{from:2,to:2}:t?{from:3,to:3}:{from:1,to:1}},e.prototype.getAbsOffsetInfo=function(t){var e=this,n={},o=function(t,o){void 0===n[o]&&(n[o]=e.getBreadthNodeSize(t)),n[o]=Math.max(n[o],e.getBreadthNodeSize(t))};t.forEach(function(t){var e=Math.trunc(t.position);o(t,e),n[e]%1!=0&&o(t,e+1)});var i={},r=0;return Object.keys(n).sort().forEach(function(t){i[t]={leftOffset:r,width:n[t]},r+=n[t]+e.settings.columnSpacing}),i},e.prototype.setBreadth=function(t,e){return this.settings.orientation===h.OrientationKind.Vertical?new p.Point(e,t.y):new p.Point(t.x,e)},e.prototype.setDepthOffset=function(t,e){return this.settings.orientation===h.OrientationKind.Horizontal?new p.Point(t.x+e,t.y):new p.Point(t.x,t.y+e)},e.prototype.getAbsPosition=function(t,e,n){var o=Math.trunc(t),i=n[o].leftOffset,r=n[o].width;return t%1==0?i+(r-e)/2:i+r-(e-this.settings.columnSpacing)/2},e.prototype.getBreadthNodeSize=function(t){return t.isDummy?0:this.getBreadthNodeSizeCore(this.graph.getNode(t.key))},e.prototype.getDepthNodeSize=function(t){return t.isDummy?0:this.getDepthNodeSizeCore(this.graph.getNode(t.key))},e}(r.LayoutBuilder);e.SugiyamaLayoutBuilder=y;var m=function(){function t(){}return t.getLayers=function(t){var e=this.getFeasibleTree(t);return this.calcNodesLayers(e)},t.getFeasibleTree=function(t){var e=this.initLayerAssignment(t);return t.getSpanningGraph(t.nodes[0],c.ConnectionMode.OutgoingAndIncoming,function(t){return e[t.to]-e[t.from]})},t.initLayerAssignment=function(t){for(var e={},n=0,o={},i=t.nodes.filter(function(e){return!t.getAdjacentEdges(e,c.ConnectionMode.Incoming).length}),r=function(){i.forEach(function(t){e[t]=n,o[t]=!0}),Object.keys(o).forEach(function(n){0===t.getAdjacentEdges(n,c.ConnectionMode.Outgoing).filter(function(t){return void 0===e[t.to]}).length&&delete o[n]});var r={};Object.keys(o).forEach(function(n){t.getAdjacentEdges(n,c.ConnectionMode.Outgoing).map(function(t){return t.to}).filter(function(n){return void 0===e[n]&&t.getAdjacentEdges(n,c.ConnectionMode.Incoming).reduce(function(t,n){return t&&void 0!==e[n.from]},!0)}).forEach(function(t){return r[t]=!0})}),i=Object.keys(r),n++};i.length;)r();return e},t.calcNodesLayers=function(t){var e={},n=Number.MAX_SAFE_INTEGER,o=0,i=t.createIterator(c.ConnectionMode.OutgoingAndIncoming);for(var r in i.visitEachEdgeOnce=!1,i.onNode=function(t){e[t.key]=o,n=Math.min(n,o)},i.skipNode=function(t){return void 0!==e[t.key]},i.skipEdge=function(t){return void 0!==e[t.from]&&void 0!==e[t.to]},i.onEdge=function(t,n){o=n?e[t.from]+1:e[t.to]-1},i.iterate(t.nodes[0]),e)e.hasOwnProperty(r)&&(e[r]-=n);return e},t}();e.SugiyamaLayerDistributor=m;var g=function(){function t(){this.idCounter=-1e4}return t.prototype.orderNodes=function(t,e){for(var n=1,o=this.initGraphInfo(t,e),i=o.items,r=this.initOrder(i),s=this.getNodeToPositionMap(i),a=this.getCrossCount(r,o),c=!0;n<14&&0!=a;){r=this.getNodesOrder(r,o,c);var u=this.getCrossCount(r,o);u<a&&(s=this.getNodeToPositionMap(o.items),a=u),c=!c,n++}return o.items.forEach(function(t){return t.position=s[t.key]}),o},t.prototype.getNodesOrder=function(t,e,n){var o=this,i={},r=function(r){if(!t.hasOwnProperty(r))return"continue";var a={};t[r].forEach(function(t){var i=(n?e.getChildren(t.key):e.getParents(t.key)).map(function(t){return e.getNode(t).position});a[t.key]=o.getNodePosition(i)}),i[r]=s.sortNodes(a,e)},s=this;for(var a in t)r(a);return i},t.prototype.sortNodes=function(t,e){return Object.keys(t).sort(function(e,n){return t[e]-t[n]}).map(function(t,n){var o=e.getNode(t);return o.position=n,o})},t.prototype.getNodePosition=function(t){if(!(t=t.sort()).length)return 0;var e=Math.floor(t.length/2);if(2===t.length||t.length%2==1)return t[e];var n=t[e-1]-t[0],o=t[t.length-1]-t[e];return Math.floor((t[e-1]*o+t[e]*n)/(n+o))},t.prototype.initOrder=function(t){var e={};return t.forEach(function(t){return(e[t.layer]||(e[t.layer]=[])).push(t)}),e},t.prototype.getCrossCount=function(t,e){var n=0,o=function(o){if(!t.hasOwnProperty(o))return"continue";var i=[];t[o].forEach(function(t){var o=e.getChildren(t.key).map(function(t){return e.getNode(t).position});o.forEach(function(t){n+=i.filter(function(e){return t<e}).length}),i.push.apply(i,o)})};for(var i in t)o(i);return n},t.prototype.initGraphInfo=function(t,e){var n=this,o={},i={},r=[],a=[];return t.nodes.forEach(function(t){var n=e[t];void 0===o[n]&&(o[n]=0);var s=new v(t,!1,n,o[n]++);i[t]=s,r.push(s)}),t.edges.forEach(function(t){var s=e[t.to]-e[t.from];if(s>1){for(var c=i[t.from],u=1;u<s;u++){var p=new v(n.createDummyID(),!0,e[t.from]+u,o[e[t.from]+u]++);a.push(new C(n.createDummyID(),!0,c.key,p.key)),r.push(p),c=p}a.push(new C(t.key,!1,c.key,i[t.to].key,i[t.from].key))}else a.push(new C(t.key,!1,i[t.from].key,i[t.to].key))}),new s.FastGraph(r,a)},t.prototype.createDummyID=function(){return"dummy_"+--this.idCounter},t.prototype.getNodeToPositionMap=function(t){return t.reduce(function(t,e){return t[e.key]=e.position,t},{})},t.prototype.assignAbsCoordinates=function(t){var e=this.getAbsCoodinate(t);return new s.FastGraph(t.items.map(function(t){return new v(t.key,t.isDummy,t.layer,e[t.key])}),t.edges.slice(0))},t.prototype.getAbsCoodinate=function(t){var e=this,n=t.items.reduce(function(t,e){t[e.layer]=t[e.layer]||[];var n=p.Utils.binaryIndexOf(t[e.layer],function(t){return t.position-e.position});return t[e.layer].splice(n<0?~n:n,0,e),t},{}),o=[P.TopLeft,P.TopRight,P.BottomLeft,P.BottomRight].map(function(o){return e.getPositionByMedian(t,o,n)}),i={};return t.items.forEach(function(t){var e=o.map(function(e){return e[t.key]}).sort();i[t.key]=(e[1]+e[2])/2}),i},t.prototype.getPositionByMedian=function(t,e,n){var o=t.items,i=this.getNodeToPositionMap(o),r=this.getMedians(t,o,e);return r=this.resolveMedianConflicts(t,n,r,e),this.getSortedBlocks(t,o,r,e).forEach(function(t){var e=t.reduce(function(t,e){return i[e.key]>t?i[e.key]:t},-2);t.forEach(function(t){var o=e-i[t.key];o>0&&n[t.layer].filter(function(e){return e.position>t.position}).forEach(function(t){return i[t.key]+=o}),i[t.key]=e})}),i},t.prototype.getSortedBlocks=function(t,e,n,o){for(var i=[],r=o===P.BottomLeft||o===P.BottomRight,s=new u.HashSet(e.slice(0).sort(function(t,e){return r?t.layer-e.layer:e.layer-t.layer}),function(t){return t.key});s.length;){var a=s.item(0),c=this.getBlock(t,a,n,o);i.push(c),c.forEach(function(t){return s.remove(t)})}return i.sort(function(t,e){var n=t.reduce(function(t,e){return e.position<t.position?e:t},t[0]),o=e.filter(function(t){return t.layer==n.layer})[0];if(o)return n.position-o.position;var i=e.reduce(function(t,e){return e.position<t.position?e:t},e[0]),r=t.filter(function(t){return t.layer==i.layer})[0];return r?r.position-i.position:n.layer-i.layer}),i},t.prototype.getBlock=function(t,e,n,o){var i=[],r=null;do{r&&(e=o===P.TopLeft||o===P.TopRight?t.getNode(r.from):t.getNode(r.to)),i.push(e),r=n[e.key]}while(r);return i},t.prototype.resolveMedianConflicts=function(t,e,n,o){var i=this,r={},s=function(s){var a=void 0,c=void 0;if(!e.hasOwnProperty(s))return"continue";var u=e[s];o!==P.TopRight&&o!==P.BottomRight||(u=u.slice(0).sort(function(t,e){return e.position-t.position})),u.forEach(function(e){var s=n[e.key];if(s){var u=o===P.TopLeft||o===P.TopRight?s.from:s.to,p=t.getNode(u).position;i.checkMedianConfict(a,c,p,o)?r[e.key]=null:(a=void 0===a?p:Math.min(a,p),c=void 0===c?p:Math.max(c,p),r[e.key]=s)}else r[e.key]=null})};for(var a in e)s(a);return r},t.prototype.checkMedianConfict=function(t,e,n,o){return void 0!==t&&void 0!==e&&(o===P.TopLeft||o===P.BottomLeft?e>=n:t<=n)},t.prototype.getMedians=function(t,e,n){var o=this,i={};return e.forEach(function(e){var r=o.getActualAdjacentEdges(t,e,n),s=o.getMedianPosition(r.length,n);i[e.key]=r[s]}),i},t.prototype.getMedianPosition=function(t,e){if(0===t)return-1;if(t%2!=0)return Math.floor(t/2);if(e===P.TopLeft||e===P.BottomLeft)return Math.floor(t/2)-1;if(e===P.TopRight||e===P.BottomRight)return Math.floor(t/2);throw new Error("Invalid Operation")},t.prototype.getActualAdjacentEdges=function(t,e,n){return n===P.TopLeft||n===P.TopRight?t.getAdjacentEdges(e.key,c.ConnectionMode.Incoming).sort(function(e,n){return t.getNode(e.from).position-t.getNode(n.from).position}):t.getAdjacentEdges(e.key,c.ConnectionMode.Outgoing).sort(function(e,n){return t.getNode(e.to).position-t.getNode(n.to).position})},t}();e.SugiyamaNodesOrderer=g;var v=function(){function t(t,e,n,o){this.key=t,this.isDummy=e,this.layer=n,this.position=o}return t.prototype.getHashCode=function(){return this.key.toString()},t}();e.NodeOnLayer=v;var P,C=function(){function t(t,e,n,o,i){this.key=t,this.isDummy=e,this.from=n,this.to=o,this._originFrom=i}return t.prototype.getHashCode=function(){return this.from+"-"+this.to},Object.defineProperty(t.prototype,"originFrom",{get:function(){return void 0!==this._originFrom?this._originFrom:this.from},enumerable:!0,configurable:!0}),t}();e.EdgeOnLayer=C,function(t){t[t.TopLeft=0]="TopLeft",t[t.TopRight=1]="TopRight",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight"}(P||(P={}))},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(85),s=n(42),a=n(47),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStateValue=function(){return this.control.selection.inputPosition.getStyleTextPropertyValue(this.getStyleProperty())===this.getStylePropertyValue()},e.prototype.executeCore=function(t){var e=this;this.control.history.beginTransaction();var n=this.getStyleProperty(),o=t.value?a.StyleText.defaultInstace[n]:this.getStylePropertyValue();return this.control.selection.getSelectedItems().forEach(function(t){e.control.history.addAndRedo(new s.ChangeStyleTextHistoryItem(t.key,n,o))}),this.control.selection.inputPosition.setStyleTextPropertyValue(this.getStyleProperty(),o),this.control.history.endTransaction(),!0},e.prototype.getStyleObj=function(t){return t.styleText},e}(r.StylePropertyCommandBase);e.ToggleStyleTextPropertyCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,o){return t.call(this,e,n,o)||this}return i(e,t),e.prototype.redo=function(t){var e=t.model.findItem(this.itemKey);this.oldStyleValue=e.styleText[this.styleProperty],t.changeStyleText(e,this.styleProperty,this.styleValue)},e.prototype.undo=function(t){var e=t.model.findItem(this.itemKey);t.changeStyleText(e,this.styleProperty,this.oldStyleValue)},e}(n(86).ChangeStyleHistoryItemBase);e.ChangeStyleTextHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(34),c=n(9),u=n(5),p=n(22),h=n(8),l=n(59),d=n(18),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!this.control.selection.isEmpty())},e.prototype.executeCore=function(t,e){var n=this;this.control.history.beginTransaction();var o=this.getGraphBySelection(),i=this.createLayout(o),r=h.ModelUtils.getSymmetricDifference(i.nodeToLayout,this.control.model.items);return i=h.ModelUtils.offsetLayoutToFreeSpace(i,r.map(function(t){return t.rectangle})),this.control.model.snapToGrid&&h.ModelUtils.adjustLayoutToSnapGrid(this.control.model,i),h.ModelUtils.applyLayoutToNodes(this.control.history,this.control.model,i,o.edges.map(function(t){return n.control.model.findConnector(t.key)})),h.ModelUtils.applyLayoutToConnectors(this.control.history,i,o.edges.map(function(t){return n.control.model.findConnector(t.key)})),h.ModelUtils.tryUpdateModelSize(this.control.history,this.control.model),this.control.history.endTransaction(),!0},e.prototype.getGraphBySelection=function(){var t=this,e=this.control.selection.getSelectedItems(),n=new a.Graph([],[]),o={};return e.forEach(function(e){return t.extendByConnectedComponents(e,n,o)}),n.nodes=n.nodes.sort(function(e,n){return t.control.model.findShape(e).key.localeCompare(t.control.model.findShape(n).key)}),n},e.prototype.extendByConnectedComponents=function(t,e,n){var o=this;t&&!n[t.key]&&(n[t.key]=!0,t instanceof u.Connector&&t.beginItem&&t.endItem&&t.beginItem!==t.endItem?(e.addEdge(new p.Edge(t.key,t.beginItem&&t.beginItem.key,t.endItem&&t.endItem.key)),this.extendByConnectedComponents(t.beginItem,e,n),this.extendByConnectedComponents(t.endItem,e,n)):t instanceof c.Shape&&(e.addNode(l.LayoutUtils.shapeToLayout(t)),t.attachedConnectors.forEach(function(t){return o.extendByConnectedComponents(t,e,n)})))},e.prototype.createLayoutSettings=function(){return this.control.model.snapToGrid?new d.TreeLayoutSettings(this.control.model.gridSize):new d.TreeLayoutSettings},e}(r.CommandBase);e.AutoLayoutCommandBase=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(48),i=n(9),r=n(14),s=n(5),a=n(0),c=n(13),u=n(21),p=n(28),h=n(3),l=n(50),d=n(53),f=n(38),y=n(52),m=n(182),g=n(2),v=n(183),P=n(184),C=n(72),S=n(10),_=n(20),w=n(69),x=n(92),b=n(26),O=n(19),M=function(){function t(t){this.itemSelectorGroupContainers={},this.itemSelectorElements={},this.itemGroupContainers={},this.itemElements={},this.itemSelectionRectElements={},this.connectorSelectionElements={},this.connectorSelectionTextElements={},this.connectorSelectionMaskTextElements={},this.selectionMarkElements=[],this.lockedSelectionMarkElements={},this.parameterPointMarkElements={},this.connectionPointElements=[],this.connectionTargetElements=[],this.connectionMarkElements=[],this.extensionLineElements=[],this.gridPatternId=b.RenderUtils.generateSvgElementId("gridPattern"),this.pagesGridPatternId=b.RenderUtils.generateSvgElementId("pagesGridPattern"),this.pagesGridClipId=b.RenderUtils.generateSvgElementId("pagesGridClip"),this.initializeContainerElements(t)}return t.prototype.initializeContainerElements=function(t){this.svgElement=t,this.backgroundContainer=this.createAndChangePrimitiveElement(new v.GroupPrimitive([],null),this.svgElement),this.itemSelectorsContainer=this.createAndChangePrimitiveElement(new v.GroupPrimitive([],null),this.svgElement),this.itemsContainer=this.createAndChangePrimitiveElement(new v.GroupPrimitive([],null),this.svgElement),this.itemSelectionContainer=this.createAndChangePrimitiveElement(new v.GroupPrimitive([],null),this.svgElement),this.visualizersContainer=this.createAndChangePrimitiveElement(new v.GroupPrimitive([],null),this.svgElement),this.selectionMarksContainer=this.createAndChangePrimitiveElement(new v.GroupPrimitive([],null),this.svgElement)},t.prototype.clear=function(){b.RenderUtils.removeContent(this.itemSelectorsContainer),b.RenderUtils.removeContent(this.itemsContainer),b.RenderUtils.removeContent(this.itemSelectionContainer),b.RenderUtils.removeContent(this.selectionMarksContainer),b.RenderUtils.removeContent(this.visualizersContainer),this.itemSelectorGroupContainers={},this.itemSelectorElements={},this.itemGroupContainers={},this.itemElements={},this.itemSelectionRectElements={},this.connectorSelectionElements={},this.connectorSelectionTextElements={},this.connectorSelectionMaskTextElements={},this.selectionMarkElements=[],this.lockedSelectionMarkElements={},this.parameterPointMarkElements={},this.selectionRectElement=void 0,this.resizeInfoElement=void 0,this.connectionPointElements=[],this.connectionTargetElements=[],this.connectionMarkElements=[],this.extensionLineElements=[]},t.prototype.NotifyModelChanged=function(t){for(var e=0,n=void 0;n=t[e];e++)n instanceof o.ShapeChange?this.applyShapeChange(n):n instanceof o.ConnectorChange?this.applyConnectorChange(n):n instanceof o.PageChange&&this.applyPageChange(n)},t.prototype.NotifyRedrawSelection=function(e){var n=this;this.hideSelection();var o=e.getSelectedItems(!0),i=e.getSelectedShapes(!0),s=e.getSelectedConnectors(!0);if(o.length<=1)i.forEach(function(e){if(e.locked)n.showLockedSelectionMarks(e);else{var o=n.correctShapeSelectionRect(e.rectangle.multiply(n.zoomLevel),t.selectionRectLineWidth);n.showShapeSelectionRect(e,o,r.MouseEventElementType.SelectionRect,"item-selection-rect"),n.showShapeSelectionMarks(e),n.showShapeParameterPoints(e)}}),s.forEach(function(t){t.locked?n.showLockedSelectionMarks(t):(n.showConnectorSelection(t,"connector-selection"),n.showConnectorSelectionMarks(t))});else{var a=this.correctShapeSelectionRect(u.DiagramModel.getRectangle(o.filter(function(t){return!t.locked})).multiply(this.zoomLevel),t.selectionRectLineWidth);this.showShapeSelectionRect(null,a,r.MouseEventElementType.SelectionRect,"items-selection-rect"),i.forEach(function(e){if(e.locked)n.showLockedSelectionMarks(e);else{var o=n.correctShapeSelectionRect(e.rectangle.multiply(n.zoomLevel),t.multiSelectionRectLineWidth);n.showShapeSelectionRect(e,o,r.MouseEventElementType.SelectionRect,"item-multi-selection-rect"),n.showShapeParameterPoints(e)}}),s.forEach(function(t){t.locked?n.showLockedSelectionMarks(t):n.showConnectorSelection(t,"connector-multi-selection")}),i.length>0&&this.showSelectionMarks(a,"-1")}},t.prototype.NotifySelectionRectShow=function(t){this.showSelectionRect(t.multiply(this.zoomLevel))},t.prototype.NotifySelectionRectHide=function(){this.hideSelectionRect()},t.prototype.NotifyResizeInfoShow=function(t,e){this.showResizeInfo(t.multiply(this.zoomLevel),e)},t.prototype.NotifyResizeInfoHide=function(){this.hideResizeInfo()},t.prototype.NotifyConnectionPointsShow=function(t,e,n){var o=this;e.forEach(function(e,i){o.showConnectionPoint(i,e.point.multiply(o.zoomLevel),e.side,t,i,i===n)})},t.prototype.NotifyConnectionPointsHide=function(){this.hideConnectionPoints()},t.prototype.NotifyConnectionMarksShow=function(e,n,o){var i=this;n.forEach(function(n,r){var s=n.point.multiply(i.zoomLevel);switch(n.side){case h.ConnectionPointSide.North:s.y-=t.connectionMarkShift;break;case h.ConnectionPointSide.South:s.y+=t.connectionMarkShift;break;case h.ConnectionPointSide.East:s.x+=t.connectionMarkShift;break;case h.ConnectionPointSide.West:s.x-=t.connectionMarkShift}i.showConnectionMark(r,s,n.side,e,r,r===o)})},t.prototype.NotifyConnectionMarksHide=function(){this.hideConnectionMarks()},t.prototype.NotifyConnectionTargetShow=function(e,n){var o=this.correctShapeSelectionRect(n.multiply(this.zoomLevel),t.connectionTargetBorderWidth);this.showConnectionTarget(0,o)},t.prototype.NotifyConnectionTargetHide=function(){this.hideConnectionTarget()},t.prototype.NotifyExtensionLinesShow=function(t){var e=this;this.hideExtensionLines(),t.forEach(function(t,n){e.showExtensionLine(n,t.type,t.segment.startPoint.multiply(e.zoomLevel),t.segment.endPoint.multiply(e.zoomLevel),t.text)})},t.prototype.NotifyExtensionLinesHide=function(){this.hideExtensionLines()},t.prototype.NotifyDragStart=function(t){var e=this;t.forEach(function(t){e.itemSelectorElements[t]&&(e.itemSelectorElements[t].style.pointerEvents="none"),e.itemElements[t]&&(e.itemElements[t].style.pointerEvents="none")}),this.selectionMarksContainer.style.display="none"},t.prototype.NotifyDragEnd=function(t){var e=this;t.forEach(function(t){e.itemSelectorElements[t]&&(e.itemSelectorElements[t].style.pointerEvents=""),e.itemElements[t]&&(e.itemElements[t].style.pointerEvents="")}),this.selectionMarksContainer.style.display=""},t.prototype.NotifyTextInputStart=function(t,e,n,o){var i=this.itemElements[t.key],r=i.getAttribute("class");i.setAttribute("class",r+" text-input"),this.visualizersContainer.style.display="none"},t.prototype.NotifyTextInputEnd=function(t){var e=this.itemElements[t.key],n=e.getAttribute("class");e.setAttribute("class",n.replace(" text-input","")),this.visualizersContainer.style.display=""},t.prototype.applyShapeChange=function(t){var e=t.shape,n=e.key,i=this.getItemGroupContainer(e.zIndex),s=this.getItemSelectorGroupContainer(e.zIndex);switch(t.type){case o.ItemChangeType.Create:this.itemElements[n]=this.createItemElements(n,e.getPrimitives(),i,"shape",r.MouseEventElementType.Shape),this.itemSelectorElements[n]=this.createItemElements(n,e.getSelectorPrimitives(),s,"shape",r.MouseEventElementType.Shape);break;case o.ItemChangeType.Remove:this.removeItemElements(i,this.itemElements[n]),delete this.itemElements[n],this.removeItemElements(s,this.itemSelectorElements[n]),delete this.itemSelectorElements[n];break;case o.ItemChangeType.UpdateStructure:this.changeItemElements(e.getPrimitives(),this.itemElements[n],!0),this.changeItemElements(e.getSelectorPrimitives(),this.itemSelectorElements[n],!0);break;case o.ItemChangeType.Update:this.changeItemElements(e.getPrimitives(),this.itemElements[n]),this.changeItemElements(e.getSelectorPrimitives(),this.itemSelectorElements[n]);break;case o.ItemChangeType.UpdateZIndex:this.moveItemElements(i,this.itemElements[n]),this.moveItemElements(s,this.itemSelectorElements[n])}},t.prototype.applyConnectorChange=function(t){var e=t.connector,n=e.key,i=this.getItemGroupContainer(e.zIndex),s=this.getItemSelectorGroupContainer(e.zIndex);switch(t.type){case o.ItemChangeType.Create:this.itemElements[n]=this.createItemElements(n,e.getPrimitives(),i,"connector",r.MouseEventElementType.Connector),this.itemSelectorElements[n]=this.createItemElements(n,e.getSelectorPrimitives(),s,"connector",r.MouseEventElementType.Connector);break;case o.ItemChangeType.Remove:this.removeItemElements(i,this.itemElements[n]),delete this.itemElements[n],this.removeItemElements(s,this.itemSelectorElements[n]),delete this.itemSelectorElements[n],this.invalidateConnectorSelectionTextElements(n);break;case o.ItemChangeType.UpdateStructure:this.changeItemElements(e.getPrimitives(),this.itemElements[n],!0),this.changeItemElements(e.getSelectorPrimitives(),this.itemSelectorElements[n],!0),this.invalidateConnectorSelectionTextElements(n);break;case o.ItemChangeType.Update:this.changeItemElements(e.getPrimitives(),this.itemElements[n]),this.changeItemElements(e.getSelectorPrimitives(),this.itemSelectorElements[n]);break;case o.ItemChangeType.UpdateZIndex:this.moveItemElements(i,this.itemElements[n]),this.moveItemElements(s,this.itemSelectorElements[n])}},t.prototype.createItemElements=function(t,e,n,o,i){var r=this.createAndChangePrimitiveElement(new v.GroupPrimitive([],o),n);return b.RenderUtils.setElementEventData(r,i,t),this.createAndChangePrimitivesElements(e,r),r},t.prototype.changeItemElements=function(t,e,n){void 0===n&&(n=!1),n?(b.RenderUtils.removeContent(e),this.createAndChangePrimitivesElements(t,e)):this.changePrimitivesElements(t,e)},t.prototype.removeItemElements=function(t,e){e&&t.removeChild(e)},t.prototype.moveItemElements=function(t,e,n){e&&(void 0!==n?t.insertBefore(e,n):t.appendChild(e))},t.prototype.getItemGroupContainer=function(t){return void 0===this.itemGroupContainers[t]&&(this.itemGroupContainers[t]=this.createAndChangePrimitiveElement(new v.GroupPrimitive([],null),this.itemsContainer,this.itemGroupContainers[t+1])),this.itemGroupContainers[t]},t.prototype.getItemSelectorGroupContainer=function(t){return void 0===this.itemSelectorGroupContainers[t]&&(this.itemSelectorGroupContainers[t]=this.createAndChangePrimitiveElement(new v.GroupPrimitive([],null),this.itemSelectorsContainer,this.itemSelectorGroupContainers[t+1])),this.itemSelectorGroupContainers[t]},t.prototype.applyPageChange=function(t){this.zoomLevel=t.model.zoomLevel,this.itemsContainer.style.transform="scale("+this.zoomLevel+")",this.itemSelectorsContainer.style.transform="scale("+this.zoomLevel+")",this.svgWidth=c.UnitConverter.twipsToPixels(t.model.size.width)*this.zoomLevel,this.svgHeight=c.UnitConverter.twipsToPixels(t.model.size.height)*this.zoomLevel,this.updateGridElements(t.model.showGrid,c.UnitConverter.twipsToPixels(t.model.gridSize)*this.zoomLevel),this.updatePagesGridElements(c.UnitConverter.twipsToPixels(t.model.pageWidth)*this.zoomLevel,c.UnitConverter.twipsToPixels(t.model.pageHeight)*this.zoomLevel),this.svgElement.style.backgroundColor=t.model.pageColor;for(var e=O.GetNodesByClassName(this.svgElement,"text-filter-flood"),n=0;n<e.length;n++)e[n].style.setProperty("flood-color",t.model.pageColor)},t.prototype.getGridRectElement=function(t){return void 0===this.gridRectElement&&(this.gridRectElement=this.createPrimitiveElement(t,this.backgroundContainer)),this.gridRectElement},t.prototype.getGridPatternElement=function(t){return void 0===this.gridPatternElement&&(this.gridPatternElement=this.createPrimitiveElement(t,this.backgroundContainer)),this.gridPatternElement},t.prototype.updateGridElements=function(t,e){var n=this,o=new d.RectanglePrimitive("0","0","100%","100%",null,null,null,function(t){t.style.setProperty("fill","url('#"+n.gridPatternId+"')")}),i=this.getGridRectElement(o);if(t){i.style.display="",this.changePrimitiveElement(o,i);for(var r=[0,1,2,3,4].map(function(t){return Math.round(e*t)}),s=[new g.PathPrimitiveMoveToCommand(r[4].toString(),"0"),new g.PathPrimitiveLineToCommand(r[4].toString(),r[4].toString()),new g.PathPrimitiveLineToCommand("0",r[4].toString())],a=[],c=1;c<=3;c++)a.push(new g.PathPrimitiveMoveToCommand(r[c].toString(),"0")),a.push(new g.PathPrimitiveLineToCommand(r[c].toString(),r[4].toString()));for(c=1;c<=3;c++)a.push(new g.PathPrimitiveMoveToCommand("0",r[c].toString())),a.push(new g.PathPrimitiveLineToCommand(r[4].toString(),r[c].toString()));var u=new m.PatternPrimitive(this.gridPatternId,[new g.PathPrimitive(s,null,"grid-outer-line"),new g.PathPrimitive(a,null,"grid-inner-line")],0,0,(4*e/this.svgWidth).toString(),(4*e/this.svgHeight).toString());this.changePrimitiveElement(u,this.getGridPatternElement(u))}else i.style.display="none"},t.prototype.getPagesGridRectElement=function(t){return void 0===this.pagesGridRectElement&&(this.pagesGridRectElement=this.createPrimitiveElement(t,this.backgroundContainer)),this.pagesGridRectElement},t.prototype.getPagesGridClipPathElement=function(t){return void 0===this.pagesGridClipPathElement&&(this.pagesGridClipPathElement=this.createPrimitiveElement(t,this.backgroundContainer)),this.pagesGridClipPathElement},t.prototype.getPagesGridPatternElement=function(t){return void 0===this.pagesGridPatternElement&&(this.pagesGridPatternElement=this.createPrimitiveElement(t,this.backgroundContainer)),this.pagesGridPatternElement},t.prototype.updatePagesGridElements=function(e,n){var o=this,i=new d.RectanglePrimitive("0","0","100%","100%",null,null,this.pagesGridClipId,function(t){t.style.setProperty("fill","url('#"+o.pagesGridPatternId+"')")});this.changePrimitiveElement(i,this.getPagesGridRectElement(i));var r=Math.round(this.svgWidth/e),s=Math.round(this.svgHeight/n),a=[new g.PathPrimitiveMoveToCommand((e-t.pagesGridLineWidth/2).toString(),"0"),new g.PathPrimitiveLineToCommand((e-t.pagesGridLineWidth/2).toString(),(n-t.pagesGridLineWidth/2).toString()),new g.PathPrimitiveLineToCommand("0",(n-t.pagesGridLineWidth/2).toString())],c=new m.PatternPrimitive(this.pagesGridPatternId,[new g.PathPrimitive(a,null,"pages-grid-line")],0,0,(r>1?1/r:1).toString(),(s>1?1/s:1).toString());this.changePrimitiveElement(c,this.getPagesGridPatternElement(c));var u=new y.ClipPathPrimitive(this.pagesGridClipId,[new d.RectanglePrimitive(0,0,(this.svgWidth-2*t.pagesGridLineWidth).toString(),(this.svgHeight-2*t.pagesGridLineWidth).toString())]);this.changePrimitiveElement(u,this.getPagesGridClipPathElement(u))},t.prototype.hideSelection=function(){this.hideItemSelectionRects(),this.hideConnectorSelection(),this.hideSelectionMarkElements(),this.hideLockedSelectionMarkElements(),this.hideParameterPointMarkElements()},t.prototype.showShapeSelectionMarks=function(t){var e=new a.Rectangle(t.position,t.size).multiply(this.zoomLevel);this.showSelectionMarks(e,t.key)},t.prototype.showConnectorSelectionMarks=function(e){var n=this;e.points.forEach(function(o,i){var s=0===i||i===e.points.length-1,a=s?"selection-mark":"connector-point-mark",c=s?t.selectionMarkSize:t.connectorPointMarkSize;s||e.properties.lineOption===p.ConnectorLineOption.Straight?n.showSelectionMark(i,o.multiply(n.zoomLevel),c,r.MouseEventElementType.ConnectorPoint,e.key,i,a):n.showSelectionMark(i,o.multiply(n.zoomLevel),c,r.MouseEventElementType.Undefined,"-1",-1,a+" disabled")}),this.showConnectorSideMarks(e)},t.prototype.showConnectorSideMarks=function(e){var n,o,i=this,s=e.getRenderPoints(!0),c=e.properties.lineOption===p.ConnectorLineOption.Straight?r.MouseEventElementType.ConnectorSide:r.MouseEventElementType.ConnectorOrthogonalSide;s.forEach(function(r,s){if(!r.skipped){if(void 0!==n&&i.canShowConnectorSideMark(e,r,n)){var u=e.properties.lineOption===p.ConnectorLineOption.Orthogonal?r.x-n.x==0?"vertical":"horizontal":"";i.showSelectionMark(e.points.length+s-1,new a.Point(n.x+(r.x-n.x)/2,n.y+(r.y-n.y)/2).multiply(i.zoomLevel),t.connectorSideMarkSize,c,e.key,o+"_"+s,"connector-side-mark "+u)}n=r,o=s}})},t.prototype.canShowConnectorSideMark=function(e,n,o){if(e.properties.lineOption===p.ConnectorLineOption.Straight){var i=t.selectionMarkSize+t.connectorSideMarkSize;return a.GeometryUtils.getDistance(n,o)>i}return e.properties.lineOption===p.ConnectorLineOption.Orthogonal&&((n.x-o.x==0||Math.abs(n.x-o.x)>s.Connector.minOffset)&&(n.y-o.y==0||Math.abs(n.y-o.y)>s.Connector.minOffset))},t.prototype.showSelectionMarks=function(e,n){this.showSelectionMark(0,new a.Point(e.left,e.top),t.selectionMarkSize,r.MouseEventElementType.ShapeResizeBox,n,r.ResizeEventSource.ResizeBox_NW,"selection-mark"),this.showSelectionMark(1,new a.Point(e.left+e.size.width/2,e.top),t.selectionMarkSize,r.MouseEventElementType.ShapeResizeBox,n,r.ResizeEventSource.ResizeBox_N,"selection-mark"),this.showSelectionMark(2,new a.Point(e.right,e.top),t.selectionMarkSize,r.MouseEventElementType.ShapeResizeBox,n,r.ResizeEventSource.ResizeBox_NE,"selection-mark"),this.showSelectionMark(3,new a.Point(e.right,e.top+e.size.height/2),t.selectionMarkSize,r.MouseEventElementType.ShapeResizeBox,n,r.ResizeEventSource.ResizeBox_E,"selection-mark"),this.showSelectionMark(4,new a.Point(e.right,e.bottom),t.selectionMarkSize,r.MouseEventElementType.ShapeResizeBox,n,r.ResizeEventSource.ResizeBox_SE,"selection-mark"),this.showSelectionMark(5,new a.Point(e.left+e.size.width/2,e.bottom),t.selectionMarkSize,r.MouseEventElementType.ShapeResizeBox,n,r.ResizeEventSource.ResizeBox_S,"selection-mark"),this.showSelectionMark(6,new a.Point(e.left,e.bottom),t.selectionMarkSize,r.MouseEventElementType.ShapeResizeBox,n,r.ResizeEventSource.ResizeBox_SW,"selection-mark"),this.showSelectionMark(7,new a.Point(e.left,e.top+e.size.height/2),t.selectionMarkSize,r.MouseEventElementType.ShapeResizeBox,n,r.ResizeEventSource.ResizeBox_W,"selection-mark")},t.prototype.showSelectionMark=function(t,e,n,o,i,r,s){var a=new d.RectanglePrimitive(e.x-n/2,e.y-n/2,n,n,null,s),c=this.getSelectionMarkElement(a,t);this.changePrimitiveElement(a,c),b.RenderUtils.setElementEventData(c,o,i,r)},t.prototype.hideSelectionMarkElements=function(){for(var t=0;t<this.selectionMarkElements.length;t++)this.selectionMarkElements[t]&&(this.selectionMarkElements[t].style.display="none")},t.prototype.getSelectionMarkElement=function(t,e){var n=this.selectionMarkElements[e];return void 0!==n?n.style.display="":(n=this.createPrimitiveElement(t,this.selectionMarksContainer),this.selectionMarkElements[e]=n),n},t.prototype.showLockedSelectionMarks=function(e){var n=e.rectangle.multiply(this.zoomLevel);this.showLockedSelectionMark(e.key,0,new a.Point(n.left,n.top),t.lockedSelectionMarkSize,"locked-selection-mark"),this.showLockedSelectionMark(e.key,1,new a.Point(n.right,n.top),t.lockedSelectionMarkSize,"locked-selection-mark"),this.showLockedSelectionMark(e.key,2,new a.Point(n.right,n.bottom),t.lockedSelectionMarkSize,"locked-selection-mark"),this.showLockedSelectionMark(e.key,3,new a.Point(n.left,n.bottom),t.lockedSelectionMarkSize,"locked-selection-mark")},t.prototype.showLockedSelectionMark=function(t,e,n,o,i){var r=new g.PathPrimitive([new g.PathPrimitiveMoveToCommand(n.x-o/2,n.y-o/2),new g.PathPrimitiveLineToCommand(n.x+o/2,n.y+o/2),new g.PathPrimitiveMoveToCommand(n.x+o/2,n.y-o/2),new g.PathPrimitiveLineToCommand(n.x-o/2,n.y+o/2)],null,i),s=this.getLockedSelectionMarkElement(r,t,e);this.changePrimitiveElement(r,s)},t.prototype.hideLockedSelectionMarkElements=function(){for(var t in this.lockedSelectionMarkElements)if(this.lockedSelectionMarkElements.hasOwnProperty(t))for(var e=0;e<this.lockedSelectionMarkElements[t].length;e++)this.lockedSelectionMarkElements[t][e].style.display="none"},t.prototype.getLockedSelectionMarkElement=function(t,e,n){var o=void 0!==this.lockedSelectionMarkElements[e]?this.lockedSelectionMarkElements[e][n]:void 0;return void 0!==o?o.style.display="":(void 0===this.lockedSelectionMarkElements[e]&&(this.lockedSelectionMarkElements[e]=[]),o=this.createPrimitiveElement(t,this.selectionMarksContainer),this.lockedSelectionMarkElements[e][n]=o),o},t.prototype.showShapeParameterPoints=function(e){var n=this;e.description.getParameterPoints(e).forEach(function(o,i){var s=t.geomertyMarkSize,a=o.point.multiply(n.zoomLevel),c=new d.RectanglePrimitive(a.x-s/2,a.y-s/2,s,s,null,"geometry-mark"),u=n.getParameterPointMarkElement(c,e.key,i);n.changePrimitiveElement(c,u),b.RenderUtils.setElementEventData(u,r.MouseEventElementType.ShapeParameterBox,e.key,o.key)})},t.prototype.hideParameterPointMarkElements=function(){for(var t in this.parameterPointMarkElements)if(this.parameterPointMarkElements.hasOwnProperty(t))for(var e=0;e<this.parameterPointMarkElements[t].length;e++)this.parameterPointMarkElements[t][e].style.display="none"},t.prototype.getParameterPointMarkElement=function(t,e,n){var o=void 0!==this.parameterPointMarkElements[e]?this.parameterPointMarkElements[e][n]:void 0;return void 0!==o?o.style.display="":(void 0===this.parameterPointMarkElements[e]&&(this.parameterPointMarkElements[e]=[]),o=this.createPrimitiveElement(t,this.selectionMarksContainer),this.parameterPointMarkElements[e][n]=o),o},t.prototype.showShapeSelectionRect=function(t,e,n,o){var i=new d.RectanglePrimitive(e.left,e.top,e.width,e.height,null,o),r=this.getItemSelectionRectElement(i,t?t.key:"-1");this.changePrimitiveElement(i,r),b.RenderUtils.setElementEventData(r,n,"-1",-1)},t.prototype.hideItemSelectionRects=function(){for(var t in this.itemSelectionRectElements)this.itemSelectionRectElements.hasOwnProperty(t)&&(this.itemSelectionRectElements[t].style.display="none")},t.prototype.getItemSelectionRectElement=function(t,e){var n=this.itemSelectionRectElements[e];return void 0!==n?n.style.display="":(n=this.createPrimitiveElement(t,this.itemSelectionContainer),this.itemSelectionRectElements[e]=n),n},t.prototype.showSelectionRect=function(t){var e=new d.RectanglePrimitive(t.left,t.top,t.size.width,t.size.height,null,"selection-rect"),n=this.getSelectionRectElement(e);this.changePrimitiveElement(e,n)},t.prototype.hideSelectionRect=function(){void 0!==this.selectionRectElement&&(this.selectionRectElement.style.display="none")},t.prototype.getSelectionRectElement=function(t){return void 0!==this.selectionRectElement?this.selectionRectElement.style.display="":this.selectionRectElement=this.createPrimitiveElement(t,this.visualizersContainer),this.selectionRectElement},t.prototype.showResizeInfo=function(e,n){var o=new d.RectanglePrimitive(e.x,e.y,0,0),i=new v.GroupPrimitive([o,new l.TextPrimitive(e.x,e.y,n)],"resize-info"),r=this.getResizeInfoElement(i);this.changePrimitiveElement(i,r);var s=b.RenderUtils.getSvgTextRectangle(r.childNodes[1],t.resizeInfoLineWidth).inflate(t.resizeInfoTextOffset,t.resizeInfoTextOffset);o.x=s.left,o.y=s.top,o.width=s.width,o.height=s.height,this.changePrimitiveElement(i,r)},t.prototype.hideResizeInfo=function(){void 0!==this.resizeInfoElement&&(this.resizeInfoElement.style.display="none")},t.prototype.getResizeInfoElement=function(t){return void 0!==this.resizeInfoElement?this.resizeInfoElement.style.display="":this.resizeInfoElement=this.createPrimitiveElement(t,this.visualizersContainer),this.resizeInfoElement},t.prototype.showConnectorSelection=function(e,n){var o,i,r,s=this,a=e.getRenderPoints(),c=[],u=0,p=0;if(a.forEach(function(t){t=t.multiply(s.zoomLevel),void 0===o?(i=t,c.push(new g.PathPrimitiveMoveToCommand(t.x,t.y))):(c.push(new g.PathPrimitiveLineToCommand(t.x,t.y)),u=Math.max(u,Math.abs(o.x-t.x)),p=Math.max(p,Math.abs(o.y-t.y))),o=t}),r=o,u<t.connectorSelectionLineWidth||p<t.connectorSelectionLineWidth){var h=u<t.connectorSelectionLineWidth?t.connectorSelectionLineWidth:0,l=p<t.connectorSelectionLineWidth?t.connectorSelectionLineWidth:0;c.push(new g.PathPrimitiveLineToCommand(r.x-h,r.y-l))}var f=b.RenderUtils.generateSvgElementId("maskSel"),y=b.RenderUtils.generateSvgElementId("clipSel"),m=new v.GroupPrimitive([new g.PathPrimitive(c,null,n,y,function(t){t.setAttribute("mask","url(#"+f+")")}),new P.MaskPrimitive(f,[new d.RectanglePrimitive("0","0","100%","100%",null,"background"),new g.PathPrimitive(c),new d.RectanglePrimitive(i.x-t.connectorSelectionWidth/2,i.y-t.connectorSelectionWidth/2,t.connectorSelectionWidth,t.connectorSelectionWidth),new d.RectanglePrimitive(r.x-t.connectorSelectionWidth/2,r.y-t.connectorSelectionWidth/2,t.connectorSelectionWidth,t.connectorSelectionWidth),new v.GroupPrimitive([])],"connector-selection-mask","-1000%","-1000%","2100%","2100%")]),C=this.getConnectorSelectionElement(m,e.key);this.changePrimitiveElement(m,C),this.showConnectorTextsSelection(e,C,C.querySelector("g"),n,f)},t.prototype.showConnectorTextsSelection=function(e,n,o,i,r){var s=this,a=[];if(o&&e.allowHasText){var c=0;e.texts.forEach(function(n){var i=e.getText(n.position);if(i&&""!==i){var r=e.getTextPoint(n.position),u=b.RenderUtils.generateSvgElementId("filterSel"),p=new v.GroupPrimitive([new l.TextPrimitive(r.x,r.y,i,void 0,e.styleText,!0,null,u),new C.TextFilterPrimitive(u,!1)]),h=s.getConnectorSelectionMaskTextElement(p,o,e.key,c);s.changePrimitiveElement(p,h);var d=h.querySelector("text"),f=b.RenderUtils.getSvgTextRectangle(d,t.connectorSelectionLineWidth);f&&a.push(f.multiply(s.zoomLevel))}c++})}for(var u=0;u<a.length;u++){var p=new d.RectanglePrimitive(a[u].left,a[u].top,a[u].width,a[u].height,null,i+" text",null),h=this.getConnectorSelectionTextElement(p,n,e.key,u);this.changePrimitiveElement(p,h)}},t.prototype.hideConnectorSelection=function(){for(var t in this.connectorSelectionElements)this.connectorSelectionElements.hasOwnProperty(t)&&(this.connectorSelectionElements[t].style.display="none");for(var t in this.connectorSelectionMaskTextElements)if(this.connectorSelectionMaskTextElements.hasOwnProperty(t))for(var e=0;e<this.connectorSelectionMaskTextElements[t].length;e++)this.connectorSelectionMaskTextElements[t][e].style.display="none";for(var t in this.connectorSelectionTextElements)if(this.connectorSelectionTextElements.hasOwnProperty(t))for(e=0;e<this.connectorSelectionTextElements[t].length;e++)this.connectorSelectionTextElements[t][e].style.display="none"},t.prototype.getConnectorSelectionElement=function(t,e){var n=this.connectorSelectionElements[e];return void 0!==n?n.style.display="":(n=this.createPrimitiveElement(t,this.itemSelectionContainer),this.connectorSelectionElements[e]=n),n},t.prototype.getConnectorSelectionTextElement=function(t,e,n,o){var i=void 0!==this.connectorSelectionTextElements[n]?this.connectorSelectionTextElements[n][o]:void 0;return void 0!==i?i.style.display="":(void 0===this.connectorSelectionTextElements[n]&&(this.connectorSelectionTextElements[n]=[]),i=this.createPrimitiveElement(t,e),this.connectorSelectionTextElements[n][o]=i),i},t.prototype.getConnectorSelectionMaskTextElement=function(t,e,n,o){var i=void 0!==this.connectorSelectionMaskTextElements[n]?this.connectorSelectionMaskTextElements[n][o]:void 0;return void 0!==i?i.style.display="":(void 0===this.connectorSelectionMaskTextElements[n]&&(this.connectorSelectionMaskTextElements[n]=[]),i=this.createPrimitiveElement(t,e),this.connectorSelectionMaskTextElements[n][o]=i),i},t.prototype.invalidateConnectorSelectionTextElements=function(t){var e=this.connectorSelectionElements[t];if(e){var n=e.querySelector("g");b.RenderUtils.removeContent(n),this.connectorSelectionMaskTextElements[t]&&delete this.connectorSelectionMaskTextElements[t]}},t.prototype.showConnectionPoint=function(e,n,o,i,s,a){this.showConnectionPointCore(2*e,n.x,n.y,t.connectionPointLargeSize,t.connectionPointLargeSize,r.MouseEventElementType.ShapeConnectionPoint,i,s,"connection-point selector"),this.showConnectionPointCore(2*e+1,n.x,n.y,t.connectionPointSmallSize,t.connectionPointSmallSize,r.MouseEventElementType.ShapeConnectionPoint,i,s,"connection-point"+(a?" active":""))},t.prototype.showConnectionPointCore=function(t,e,n,o,i,r,s,a,c){var u=new f.EllipsePrimitive(e,n,o,i,null,c),p=this.getConnectionPointElement(u,t);this.changePrimitiveElement(u,p),b.RenderUtils.setElementEventData(p,r,s,a)},t.prototype.hideConnectionPoints=function(){for(var t=0;t<this.connectionPointElements.length;t++)this.connectionPointElements[t].style.display="none"},t.prototype.getConnectionPointElement=function(t,e){var n=this.connectionPointElements[e];return void 0!==n?n.style.display="":(n=this.createPrimitiveElement(t,this.visualizersContainer),this.connectionPointElements[e]=n),n},t.prototype.showConnectionTarget=function(t,e){var n=new d.RectanglePrimitive(e.left,e.top,e.width,e.height,null,"connection-target"),o=this.getConnectionTargetElement(n,t);this.changePrimitiveElement(n,o)},t.prototype.hideConnectionTarget=function(){for(var t=0;t<this.connectionTargetElements.length;t++)this.connectionTargetElements[t].style.display="none"},t.prototype.getConnectionTargetElement=function(t,e){var n=this.connectionTargetElements[e];return void 0!==n?n.style.display="":(n=this.createPrimitiveElement(t,this.itemSelectionContainer),this.connectionTargetElements[e]=n),n},t.prototype.showConnectionMark=function(e,n,o,i,s,a){this.showConnectionMarkSelector(2*e,n.x-t.connectionMarkLargeSize/2,n.y-t.connectionMarkLargeSize/2,t.connectionMarkLargeSize,t.connectionMarkLargeSize,r.MouseEventElementType.ShapeConnection,i,s,"connection-mark selector"),this.showConnectionMarkArrow(2*e+1,n.x-t.connectionMarkSmallSize/2,n.y-t.connectionMarkSmallSize/2,t.connectionMarkSmallSize,t.connectionMarkSmallSize,o,r.MouseEventElementType.ShapeConnection,i,s,"connection-mark"+(a?" active":""))},t.prototype.showConnectionMarkArrow=function(t,e,n,o,i,s,a,c,u,p){var l=[];switch(s){case h.ConnectionPointSide.East:l=[new g.PathPrimitiveMoveToCommand(e,n+i/3),new g.PathPrimitiveLineToCommand(e+o/2,n+i/3),new g.PathPrimitiveLineToCommand(e+o/2,n),new g.PathPrimitiveLineToCommand(e+o,n+i/2),new g.PathPrimitiveLineToCommand(e+o/2,n+i),new g.PathPrimitiveLineToCommand(e+o/2,n+2*i/3),new g.PathPrimitiveLineToCommand(e,n+2*i/3),new g.PathPrimitiveClosePathCommand];break;case h.ConnectionPointSide.West:l=[new g.PathPrimitiveMoveToCommand(e+o,n+i/3),new g.PathPrimitiveLineToCommand(e+o/2,n+i/3),new g.PathPrimitiveLineToCommand(e+o/2,n),new g.PathPrimitiveLineToCommand(e,n+i/2),new g.PathPrimitiveLineToCommand(e+o/2,n+i),new g.PathPrimitiveLineToCommand(e+o/2,n+2*i/3),new g.PathPrimitiveLineToCommand(e+o,n+2*i/3),new g.PathPrimitiveClosePathCommand];break;case h.ConnectionPointSide.South:l=[new g.PathPrimitiveMoveToCommand(e+2*o/3,n),new g.PathPrimitiveLineToCommand(e+2*o/3,n+i/2),new g.PathPrimitiveLineToCommand(e+o,n+i/2),new g.PathPrimitiveLineToCommand(e+o/2,n+i),new g.PathPrimitiveLineToCommand(e,n+i/2),new g.PathPrimitiveLineToCommand(e+o/3,n+i/2),new g.PathPrimitiveLineToCommand(e+o/3,n),new g.PathPrimitiveClosePathCommand];break;case h.ConnectionPointSide.North:l=[new g.PathPrimitiveMoveToCommand(e+o/3,n+i),new g.PathPrimitiveLineToCommand(e+o/3,n+i/2),new g.PathPrimitiveLineToCommand(e,n+i/2),new g.PathPrimitiveLineToCommand(e+o/2,n),new g.PathPrimitiveLineToCommand(e+o,n+i/2),new g.PathPrimitiveLineToCommand(e+2*o/3,n+i/2),new g.PathPrimitiveLineToCommand(e+2*o/3,n+i),new g.PathPrimitiveClosePathCommand]}var d=new g.PathPrimitive(l,null,p),f=this.getConnectionMarkElement(d,t);this.changePrimitiveElement(d,f),b.RenderUtils.setElementEventData(f,r.MouseEventElementType.ShapeConnection,c,u)},t.prototype.showConnectionMarkSelector=function(t,e,n,o,i,s,a,c,u){var p=new d.RectanglePrimitive(e,n,o,i,null,u),h=this.getConnectionMarkElement(p,t);this.changePrimitiveElement(p,h),b.RenderUtils.setElementEventData(h,r.MouseEventElementType.ShapeConnection,a,c)},t.prototype.hideConnectionMarks=function(){for(var t=0;t<this.connectionMarkElements.length;t++)this.connectionMarkElements[t].style.display="none"},t.prototype.getConnectionMarkElement=function(t,e){var n=this.connectionMarkElements[e];return void 0!==n?n.style.display="":(n=this.createPrimitiveElement(t,this.visualizersContainer),this.connectionMarkElements[e]=n),n},t.prototype.showExtensionLine=function(e,n,o,i,r){var s="extension-line";n!==x.ExtensionLineType.VerticalCenterAfter&&n!==x.ExtensionLineType.VerticalCenterBefore&&n!==x.ExtensionLineType.HorizontalCenterAbove&&n!==x.ExtensionLineType.HorizontalCenterBelow||(s+=" center"),n!==x.ExtensionLineType.VerticalCenterToPageCenter&&n!==x.ExtensionLineType.HorizontalCenterToPageCenter&&n!==x.ExtensionLineType.LeftToPageCenter&&n!==x.ExtensionLineType.RightToPageCenter&&n!==x.ExtensionLineType.TopToPageCenter&&n!==x.ExtensionLineType.BottomToPageCenter||(s+=" page");var a="filterEL"+e,c=0,u=0,p=0,h=0,d=0,f=0,y=0,m=0;o.y===i.y?(c=o.x,u=o.y-t.extensionLineEndingSize,p=o.x,h=o.y+t.extensionLineEndingSize,d=i.x,f=o.y-t.extensionLineEndingSize,y=i.x,m=o.y+t.extensionLineEndingSize):o.x===i.x&&(c=o.x-t.extensionLineEndingSize,u=o.y,p=o.x+t.extensionLineEndingSize,h=o.y,d=o.x-t.extensionLineEndingSize,f=i.y,y=o.x+t.extensionLineEndingSize,m=i.y);var g=[new w.LinePrimitive(o.x,o.y,i.x,i.y),new w.LinePrimitive(c,u,p,h),new w.LinePrimitive(d,f,y,m),new l.TextPrimitive((i.x+o.x)/2,(i.y+o.y)/2,r,void 0,null,!1,null,a,function(t){t.style.display=r&&""!==r?"inherit":"none"}),new C.TextFilterPrimitive(a)],P=new v.GroupPrimitive(g,s),S=this.getExtensionLineElement(P,e);this.changePrimitiveElement(P,S)},t.prototype.hideExtensionLines=function(){for(var t=0;t<this.extensionLineElements.length;t++)this.extensionLineElements[t]&&(this.extensionLineElements[t].style.display="none")},t.prototype.getExtensionLineElement=function(t,e){var n=this.extensionLineElements[e];return void 0!==n?n.style.display="":(n=this.createPrimitiveElement(t,this.visualizersContainer),this.extensionLineElements[e]=n),n},t.prototype.getSvgImage=function(){var t=this.svgElement.cloneNode();b.RenderUtils.updateSvgElementSize(t,this.svgWidth/this.zoomLevel,this.svgHeight/this.zoomLevel);var e=this.getExportCssRules(),n=e&&!_.Browser.IE;if(n){var o=document.createElementNS(S.svgNS,"style");o.innerHTML=e,t.appendChild(o)}for(var i=0;i<this.itemsContainer.childNodes.length;i++){var r=this.itemsContainer.childNodes[i].cloneNode(!0);n||this.inlineStyle(r,this.itemsContainer.childNodes[i]),t.appendChild(r)}return this.getSvgBase64String(t)},t.prototype.getSvgBase64String=function(e){var n=(new XMLSerializer).serializeToString(e);return t.base64Start+this.getBase64EncodeUnicode(n)},t.prototype.getBase64EncodeUnicode=function(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode(parseInt("0x"+e,16))}))},t.prototype.getExportCssRules=function(){for(var t=0;t<document.styleSheets.length;t++){var e=this.getRules(document.styleSheets[t]);if(e){for(var n="",o=0;o<e.length;o++){var i=e[o],r=this.isCSSStyleRule(i)?i.selectorText:null;r&&this.checkSelector(r)&&(n+=i.cssText+"\n")}if(n.length>0)return"\n"+n}}},t.prototype.checkSelector=function(e){for(var n=0;n<t.exportStyleRules.length;n++)if(0===e.indexOf(t.exportStyleRules[n]))return!0;return!1},t.prototype.getRules=function(t){try{return this.isCSSStyleSheet(t)?t.rules||t.cssRules:null}catch(t){}},t.prototype.isCSSStyleSheet=function(t){return void 0!==t.rules},t.prototype.isCSSStyleRule=function(t){return void 0!==t.selectorText},t.prototype.inlineStyle=function(e,n){for(var o=0;o<e.childNodes.length;o++){var i=e.childNodes[o];if(i.tagName)if("g"===i.tagName)this.inlineStyle(i,n.childNodes[o]);else if(i.style){var r=window.getComputedStyle(n.childNodes[o]);if(void 0!==r)for(var s=0;s<t.exportStyleAttributes.length;s++){var a=t.exportStyleAttributes[s];i.style.setProperty(a,r.getPropertyValue(a))}}}},t.prototype.exportSvgImage=function(t){t(this.getSvgImage())},t.prototype.exportBinaryImage=function(t,e,n,o){var i=document.createElement("canvas");i.width=e,i.height=n;var r=document.createElement("img");r.width=e,r.height=n,r.setAttribute("crossOrigin","anonymous"),r.onload=function(){var s=i.getContext("2d");s.fillStyle="white",s.fillRect(0,0,e,n),s.drawImage(r,0,0),o(i.toDataURL(t))},r.src=this.getSvgImage()},t.prototype.exportPngImage=function(t){this.exportBinaryImage("image/png",this.svgWidth,this.svgHeight,t)},t.prototype.exportJpgImage=function(t){this.exportBinaryImage("image/jpeg",this.svgWidth,this.svgHeight,t)},t.prototype.createAndChangePrimitivesElements=function(t,e){var n=this;t.forEach(function(t){n.createAndChangePrimitiveElement(t,e)})},t.prototype.changePrimitivesElements=function(t,e){var n=this;t.forEach(function(t,o){var i=e.childNodes[o];n.changePrimitiveElement(t,i)})},t.prototype.createPrimitiveElement=function(t,e,n){var o=t.createElement();return void 0!==n?e.insertBefore(o,n):e.appendChild(o),o},t.prototype.createAndChangePrimitiveElement=function(t,e,n){var o=this.createPrimitiveElement(t,e,n);return this.changePrimitiveElement(t,o),o},t.prototype.changePrimitiveElement=function(t,e){t.applyElementProperties(e)},t.prototype.correctShapeSelectionRect=function(t,e){var n=Math.ceil(i.Shape.lineWidth/2*this.zoomLevel);t=t.inflate(n,n);var o=Math.floor(e/2);return t.position.x-=o,t.position.y-=o,t.size.width+=e,t.size.height+=e,t},t.selectionMarkSize=c.UnitConverter.pixelsToTwips(10),t.lockedSelectionMarkSize=c.UnitConverter.pixelsToTwips(8),t.selectionRectLineWidth=c.UnitConverter.pixelsToTwips(1),t.multiSelectionRectLineWidth=c.UnitConverter.pixelsToTwips(1),t.connectionPointSmallSize=c.UnitConverter.pixelsToTwips(5),t.connectionPointLargeSize=c.UnitConverter.pixelsToTwips(8),t.connectionMarkSmallSize=c.UnitConverter.pixelsToTwips(12),t.connectionMarkLargeSize=c.UnitConverter.pixelsToTwips(16),t.connectionMarkShift=c.UnitConverter.pixelsToTwips(16),t.connectionTargetBorderWidth=c.UnitConverter.pixelsToTwips(2),t.connectorSelectionLineWidth=c.UnitConverter.pixelsToTwips(1),t.connectorSelectionWidth=c.UnitConverter.pixelsToTwips(6),t.geomertyMarkSize=c.UnitConverter.pixelsToTwips(8),t.connectorPointMarkSize=c.UnitConverter.pixelsToTwips(6),t.connectorSideMarkSize=c.UnitConverter.pixelsToTwips(6),t.extensionLineWidth=c.UnitConverter.pixelsToTwips(1),t.extensionLineOffset=c.UnitConverter.pixelsToTwips(1),t.extensionLineEndingSize=c.UnitConverter.pixelsToTwips(6),t.resizeInfoOffset=c.UnitConverter.pixelsToTwips(16),t.resizeInfoTextOffset=c.UnitConverter.pixelsToTwips(2),t.resizeInfoLineWidth=c.UnitConverter.pixelsToTwips(1),t.pagesGridLineWidth=2,t.base64Start="data:image/svg+xml;base64,",t.exportStyleRules=[".dxdi-canvas .shape ",".dxdi-canvas .connector "],t.exportStyleAttributes=["fill","stroke","stroke-width","shape-rendering","font-family","font-size","font-weight","font-style","text-decoration","text-anchor"],t}();e.CanvasManager=M},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(16),s=function(){function t(t){this.handler=t}return t.prototype.start=function(){},t.prototype.finish=function(){},t.prototype.onMouseDoubleClick=function(t){},t.prototype.onMouseDown=function(t){},t.prototype.onMouseUp=function(t){},t.prototype.onMouseMove=function(t){},t.prototype.onMouseWheel=function(t){},t.prototype.onDragStart=function(t){},t.prototype.onDragEnd=function(t){},t.prototype.onShortcut=function(t){return!1},t}();e.MouseHandlerStateBase=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.onShortcut=function(t){return t===r.KeyCode.Esc&&(this.cancelChanges(),this.handler.switchToDefaultState(),!0)},e}(s);e.MouseHandlerCancellableState=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(68);e.DiagramCommand=o.DiagramCommand;var i=n(213);e.DiagramControl=i.DiagramControl;var r=n(0);e.EventDispatcher=r.EventDispatcher;var s=n(1);e.ShapeType=s.ShapeType,e.ShapeCategory=s.ShapeCategory;var a=n(13);e.UnitConverter=a.UnitConverter;var c=n(20);e.Browser=c.Browser;var u=n(37);e.DataLayoutType=u.DataLayoutType,n(247)},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.prototype.clone=function(){var t=this,e=this.createInstance();return this.forEach(function(n){e[n]=t[n]}),e},t.prototype.forEach=function(t){for(var e in this)this.hasOwnProperty(e)&&t(e)},t.prototype.toObject=function(){var t=this,e={},n=!1,o=this.getDefaultInstance();return this.forEach(function(i){t[i]!==o[i]&&(e[i]=t[i],n=!0)}),n?e:null},t.prototype.fromObject=function(t){for(var e in t)t.hasOwnProperty(e)&&void 0!==this[e]&&(this[e]=t[e])},t}();e.StyleBase=r;var s=function(t){function e(){var e=t.call(this)||this;return e.fill="white",e.stroke="black",e}return i(e,t),e.prototype.createInstance=function(){return new e},e.prototype.getDefaultInstance=function(){return e.defaultInstace},e.defaultInstace=new e,e}(r);e.Style=s;var a=function(t){function e(){var e=t.call(this)||this;return e.fill="black",e["font-family"]="Arial",e["font-size"]="10pt",e["font-weight"]="",e["font-style"]="",e["text-decoration"]="",e["text-anchor"]="middle",e}return i(e,t),e.prototype.createInstance=function(){return new e},e.prototype.getDefaultInstance=function(){return e.defaultInstace},e.defaultInstace=new e,e}(r);e.StyleText=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.Create=0]="Create",t[t.Update=1]="Update",t[t.UpdateStructure=2]="UpdateStructure",t[t.UpdateZIndex=3]="UpdateZIndex",t[t.Remove=4]="Remove"}(e.ItemChangeType||(e.ItemChangeType={})),function(t){t[t.Create=0]="Create",t[t.Update=1]="Update",t[t.Remove=2]="Remove"}(e.PageChangeType||(e.PageChangeType={}));var r=function(t,e){this.key=t,this.type=e};e.ChangeBase=r;var s=function(t){function e(e,n){var o=t.call(this,e.key,n)||this;return o.shape=e,o}return i(e,t),e}(r);e.ShapeChange=s;var a=function(t){function e(e,n){var o=t.call(this,e.key,n)||this;return o.connector=e,o}return i(e,t),e}(r);e.ConnectorChange=a;var c=function(t){function e(e,n,o){var i=t.call(this,"-1",n)||this;return i.model=e,i.offset=o,i}return i(e,t),e}(r);e.PageChange=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(20),i=n(70),r=n(19),s=function(){function t(){}return t.GetEvent=function(t){return"undefined"!=typeof event&&null!=event&&o.Browser.IE?event:t},t.AttachEventToElement=function(t,e,n,o){void 0===o&&(o=!1),t.addEventListener?t.addEventListener(e,n,!o):t.attachEvent("on"+e,n)},t.AttachEventToDocument=function(e,n){i.TouchUIHelper.onEventAttachingToDocument(e,n)&&t.AttachEventToElement(document,e,n)},t.PreventEvent=function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,!1},t.GetKeyCode=function(t){return o.Browser.NetscapeFamily||o.Browser.Opera?t.which:t.keyCode},t.GetEventSource=function(t){return r.IsExists(t)?t.srcElement?t.srcElement:t.target:null},t.GetMouseWheelEventName=function(){return o.Browser.Safari?"mousewheel":o.Browser.NetscapeFamily&&o.Browser.MajorVersion<17?"DOMMouseScroll":"wheel"},t.IsLeftButtonPressed=function(e){return!!i.TouchUIHelper.isTouchEvent(e)||!!(e=t.GetEvent(e))&&(o.Browser.IE&&o.Browser.Version<11?!!o.Browser.MSTouchUI||e.button%2==1:o.Browser.WebKitFamily?"pointermove"===e.type?1===e.buttons:1==e.which:o.Browser.NetscapeFamily||o.Browser.Edge||o.Browser.IE&&o.Browser.Version>=11?e.type===i.TouchUIHelper.touchMouseMoveEventName?1===e.buttons:1==e.which:!o.Browser.Opera||0==e.button)},t.PreventEventAndBubble=function(e){return t.PreventEvent(e),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,!1},t.clientEventRequiresDocScrollCorrection=function(){var t=o.Browser.Safari&&o.Browser.Version<3,e=o.Browser.MacOSMobilePlatform&&o.Browser.Version<5.1;return o.Browser.AndroidDefaultBrowser||o.Browser.AndroidChromeBrowser||!(t||e)},t.GetEventX=function(e){return i.TouchUIHelper.isTouchEvent(e)?i.TouchUIHelper.getEventX(e):e.clientX+(t.clientEventRequiresDocScrollCorrection()?r.GetDocumentScrollLeft():0)},t.GetEventY=function(e){return i.TouchUIHelper.isTouchEvent(e)?i.TouchUIHelper.getEventY(e):e.clientY+(t.clientEventRequiresDocScrollCorrection()?r.GetDocumentScrollTop():0)},t.CancelBubble=function(t){return t.cancelBubble=!0,!1},t}();e.Evt=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=n(15),a=n(26),c=function(t){function e(e,n,o,i,r,s,a,c,u){var p=t.call(this,r,"",a,u)||this;return p.x=e,p.y=n,p.text=o,p.width=i,p.reverseTextAhchor=s,p.filterId=c,p.textSegmens=p.text.split("\n").filter(function(t){return t}),p}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"text")},e.prototype.applyElementProperties=function(e){this.setUnitAttribute(e,"x",this.x),this.setUnitAttribute(e,"y",this.y),this.filterId&&e.setAttribute("filter","url(#"+this.filterId+")"),t.prototype.applyElementProperties.call(this,e),this.applyElementText(e)},e.prototype.applyElementText=function(t){var n=this;a.RenderUtils.removeContent(t);var o=0;this.textSegmens.forEach(function(e,i){var r=n.createTSpanElement(t);if(o++,n.width)for(var s=e.split(" "),c="",u="",p=0;p<s.length;p++){c+=(c.length?" ":"")+s[p],r.textContent=c,a.RenderUtils.getSvgTextRectangle(t).width>=n.width&&""!==u?(r.textContent=u,u=c=s[p],(r=n.createTSpanElement(t)).textContent=c,o++):u=c}else r.textContent=e});var i=t.firstChild;if(i){var r=-(o-1)/2+e.baselineCorrection;i.setAttribute("dy",r.toFixed(2)+"em")}},e.prototype.createTSpanElement=function(t){var e=document.createElementNS(r.svgNS,"tspan");return t.appendChild(e),this.setUnitAttribute(e,"x",this.x),e.setAttribute("dy","1.05em"),e},e.prototype.applyElementStyleProperties=function(t){this.applyElementStylePropertiesCore(t,this.reverseTextAhchor)},e.baselineCorrection=.35,e}(s.SvgPrimitive);e.TextPrimitive=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),s=n(30),a=n(9),c=function(t){function e(e,n,o,i){var r=t.call(this)||this;return r.shapeType=e,r.position=n,r.text=o,r.dataKey=i,r}return i(e,t),e.prototype.redo=function(t){var e=new a.Shape(s.ShapeDescriptionManager.get(this.shapeType),this.position);"string"==typeof this.text&&(e.text=this.text),void 0!==this.dataKey&&(e.dataKey=this.dataKey),t.addShape(e,this.shapeKey),this.shapeKey=e.key},e.prototype.undo=function(t){t.deleteShape(t.model.findShape(this.shapeKey))},e}(r.HistoryItem);e.AddShapeHistoryItem=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=function(t){function e(e,n){var o=t.call(this)||this;return o.id=e,o.children=n,o}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"clipPath")},e.prototype.applyElementProperties=function(e){this.id&&e.setAttribute("id",this.id),t.prototype.applyElementProperties.call(this,e)},e}(n(15).SvgPrimitive);e.ClipPathPrimitive=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=function(t){function e(e,n,o,i,r,s,a,c){var u=t.call(this,r,s,a,c)||this;return u.x=e,u.y=n,u.width=o,u.height=i,u}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"rect")},e.prototype.applyElementProperties=function(e){this.setUnitAttribute(e,"x",this.x),this.setUnitAttribute(e,"y",this.y),this.setUnitAttribute(e,"width",this.width),this.setUnitAttribute(e,"height",this.height),t.prototype.applyElementProperties.call(this,e)},e}(n(15).SvgPrimitive);e.RectanglePrimitive=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),s=n(0),a=n(25),c=n(1),u=n(3);e.ArrowVerticalTriangleHeightParameterName="th",e.ArrowVerticalLineWidthParameterName="lw";var p=function(t){function n(e){return t.call(this,e,"",new s.Size(.375*r.ShapeDefaultDimension,r.ShapeDefaultDimension))||this}return i(n,t),Object.defineProperty(n.prototype,"category",{get:function(){return c.ShapeCategory.General},enumerable:!0,configurable:!0}),n.prototype.createParameters=function(t){t.addRange([new a.ShapeParameter(e.ArrowVerticalTriangleHeightParameterName,Math.sqrt(Math.pow(this.defaultSize.width,2)-Math.pow(this.defaultSize.width/2,2))),new a.ShapeParameter(e.ArrowVerticalLineWidthParameterName,this.defaultSize.width/3)])},n.prototype.normalizeParameters=function(t,n){this.changeParameterValue(n,e.ArrowVerticalTriangleHeightParameterName,function(e){return Math.max(0,Math.min(t.size.height,e.value))}),this.changeParameterValue(n,e.ArrowVerticalLineWidthParameterName,function(e){return Math.max(0,Math.min(t.size.width,e.value))})},n.prototype.processConnectionPoint=function(t,n,o){var i=(t.size.width-t.parameters.get(e.ArrowVerticalLineWidthParameterName).value)/2,r=t.getConnectionPointSide(o);r===u.ConnectionPointSide.East?n.x-=i:r===u.ConnectionPointSide.West&&(n.x+=i)},n}(r.ShapeDescription);e.ArrowVerticalShapeDescription=p},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),s=n(0),a=n(25),c=n(1),u=n(3);e.ArrowVerticalTriangleWidthParameterName="tw",e.ArrowVerticalLineHeightParameterName="lh";var p=function(t){function n(e){return t.call(this,e,"",new s.Size(r.ShapeDefaultDimension,.375*r.ShapeDefaultDimension))||this}return i(n,t),Object.defineProperty(n.prototype,"category",{get:function(){return c.ShapeCategory.General},enumerable:!0,configurable:!0}),n.prototype.createParameters=function(t){t.addRange([new a.ShapeParameter(e.ArrowVerticalTriangleWidthParameterName,Math.sqrt(Math.pow(this.defaultSize.height,2)-Math.pow(this.defaultSize.height/2,2))),new a.ShapeParameter(e.ArrowVerticalLineHeightParameterName,this.defaultSize.height/3)])},n.prototype.normalizeParameters=function(t,n){this.changeParameterValue(n,e.ArrowVerticalTriangleWidthParameterName,function(e){return Math.max(0,Math.min(t.size.width,e.value))}),this.changeParameterValue(n,e.ArrowVerticalLineHeightParameterName,function(e){return Math.max(0,Math.min(t.size.height,e.value))})},n.prototype.processConnectionPoint=function(t,n,o){var i=(t.size.height-t.parameters.get(e.ArrowVerticalLineHeightParameterName).value)/2,r=t.getConnectionPointSide(o);r===u.ConnectionPointSide.North?n.y+=i:r===u.ConnectionPointSide.South&&(n.y-=i)},n}(r.ShapeDescription);e.ArrowHorizontalShapeDescription=p},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),s=n(0),a=n(38),c=n(1),u=function(t){function e(e,n){return void 0===e&&(e="Ellipse"),void 0===n&&(n=""),t.call(this,e,n,new s.Size(r.ShapeDefaultDimension,.75*r.ShapeDefaultDimension))||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return c.ShapeType.Ellipsis},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return c.ShapeCategory.General},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.width,o=e.height,i=e.center,r=i.x,s=i.y;return[].concat([new a.EllipsePrimitive(r,s,n/2,o/2,t.style)]).concat(this.createTextPrimitives(t))},e}(r.ShapeDescription);e.EllipseShapeDescription=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),s=n(1),a=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.defaultSize.height=o.calculateHeight(r.ShapeDefaultDimension),o}return i(e,t),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.General},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return Math.PI*(this.angleCount-2)/this.angleCount},enumerable:!0,configurable:!0}),e}(r.ShapeDescription);e.PolygonShapeDescription=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),s=n(5),a=function(t){function e(e,n){var o=t.call(this)||this;return o.points=e,o.dataKey=n,o}return i(e,t),e.prototype.redo=function(t){var e=new s.Connector(this.points);void 0!==this.dataKey&&(e.dataKey=this.dataKey),t.addConnector(e,this.connectorKey),this.connectorKey=e.key},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.deleteConnector(e)},e}(r.HistoryItem);e.AddConnectorHistoryItem=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(5),i=n(39),r=n(30),s=function(){function t(){}return t.shapeToLayout=function(t){var e=new i.Margin(0),n=t.rectangle;t.attachedConnectors.filter(function(t){return!t.beginItem||!t.endItem}).forEach(function(t){var i=t.rectangle;e.left=Math.max(e.left,n.left-i.left+o.Connector.minOffset),e.right=Math.max(e.right,i.right-n.right+o.Connector.minOffset),e.top=Math.max(e.top,n.top-i.top+o.Connector.minOffset),e.bottom=Math.max(e.bottom,i.bottom-n.bottom+o.Connector.minOffset)});var r=new i.NodeInfo(t.key,e,t.size.clone());return r.connectionPoints=t.description.getConnectionPoints(),r},t.importNodeToLayout=function(t){var e=new i.Margin(0),n=r.ShapeDescriptionManager.get(t.type),o=new i.NodeInfo(t.key,e,n.defaultSize.clone());return o.connectionPoints=n.getConnectionPoints(),o},t}();e.LayoutUtils=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=function(t){return t.toString()});var n=this;this.items=[],this.map={},this.getHashCode=e,t.forEach(function(t){return n.tryPush(t)})}return t.prototype.tryPush=function(t){var e=this.getHashCode(t);return void 0===this.map[e]&&(this.map[e]=this.items.push(t)-1,!0)},t.prototype.contains=function(t){return void 0!==this.map[this.getHashCode(t)]},t.prototype.forEach=function(t){this.items.forEach(t)},t.prototype.filter=function(t){return this.items.filter(t)},t.prototype.list=function(){return this.items.slice(0)},t.prototype.item=function(t){return this.items[t]},t.prototype.first=function(){return this.items[0]},t.prototype.remove=function(t){var e=this.getHashCode(t),n=this.map[e];if("number"!=typeof n)throw"Item not found";delete this.map[e],this.items.splice(n,1);for(var o=n;o<this.items.length;o++)this.map[this.getHashCode(this.items[o])]--},Object.defineProperty(t.prototype,"length",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),t}();e.HashSet=o},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(151),s=n(81),a=n(39),c=n(0),u=n(82),p=n(22),h=n(3),l=n(18),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.build=function(){for(var t=r.Forest.create(this.graph),e=[],n=void 0,o=0;n=t.trees[o];o++){var i=this.processTree(n);e.push(i)}var a=0,c=new s.GraphLayout,u=void 0;for(o=0;u=e[o];o++)c.extend(this.setComponentOffset(u,a)),a+=this.getComponentOffset(u);return c},e.prototype.processTree=function(t){var e=new s.GraphLayout,n=new a.NodeLayout(t.root,new c.Point(t.root.margin.left,t.root.margin.top));return e.addNode(n),this.processChildren(n,t,e,0),this.settings.alignment===l.Alignment.Center&&this.processParents(e,n,t),e},e.prototype.processChildren=function(t,e,n,o){for(var i,r=this,s=e.getChildren(t.info),u=this.graph.getAdjacentEdges(t.key,p.ConnectionMode.Outgoing),l=o,d=function(o,s){var p=f.isVertical()?o.margin.left:o.margin.top;if(i){var d=f.getChangingCoordinateForLayer(i.position)+f.getSizeMeasurement(i.info.size),y=l-d;p=Math.max(0,p-y),p+=f.settings.columnSpacing}var m=f.isVertical()?Math.max(t.info.margin.bottom,o.margin.top):Math.max(t.info.margin.right,o.margin.left),g=f.isVertical()?new c.Point(l+p,t.position.y+t.info.size.height+m+f.settings.layerSpacing):new c.Point(t.position.x+t.info.size.width+m+f.settings.layerSpacing,l+p),v=new a.NodeLayout(o,g);l=Math.max(f.getChangingCoordinateForLayer(v.position)+f.getSizeMeasurement(v.info.size),f.processChildren(v,e,n,l)),n.addNode(v),u.filter(function(t){return t.to===o.key}).forEach(function(t){var e=r.isVertical()?h.ConnectionPointSide.South:h.ConnectionPointSide.East,o=r.isVertical()?h.ConnectionPointSide.North:h.ConnectionPointSide.West;n.addEdge(new a.EdgeLayout(t.key,e,o))}),i=v},f=this,y=void 0,m=0;y=s[m];m++)d(y);return l+this.settings.subTreeColumnSpacing},e.prototype.processParents=function(t,e,n,o){for(var i=n.getChildren(e.info),r=void 0,s=i.length-1;r=i[s];s--)this.processParents(t,t.nodeToLayout[r.key],n,i[s+1]);if(i.length){var a=this.getChangingCoordinateForLayer(t.nodeToLayout[i[0].key].position),c=a+(this.getRectangleDistantEdge(t.nodeToLayout[i[i.length-1].key].rectangle)-a)/2-this.getSizeMeasurement(e.info.size)/2;c=Math.max(this.getChangingCoordinateForLayer(e.position),this.correctByMargin(c,e,o&&t.nodeToLayout[o.key])),this.isVertical()?e.position.x=c:e.position.y=c}},e.prototype.getChangingCoordinateForLayer=function(t){return this.isVertical()?t.x:t.y},e.prototype.getRectangleDistantEdge=function(t){return this.isVertical()?t.right:t.bottom},e.prototype.getSizeMeasurement=function(t){return this.isVertical()?t.width:t.height},e.prototype.correctByMargin=function(t,e,n){if(n){var o=this.isVertical()?Math.max(n.info.margin.left,e.info.margin.right):Math.max(n.info.margin.top,e.info.margin.bottom);t=Math.min(t,this.getChangingCoordinateForLayer(n.position)-o-this.getSizeMeasurement(e.info.size))}return t},e.prototype.isVertical=function(){return this.settings.orientation===l.OrientationKind.Vertical},e}(u.LayoutBuilder);e.TreeLayoutBuilder=d},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(87),s=n(42),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStateValue=function(){return this.control.selection.inputPosition.getStyleTextPropertyValue(this.getStyleProperty())},e.prototype.getStyleObj=function(t){return t.styleText},e.prototype.createHistoryItem=function(t,e,n){return new s.ChangeStyleTextHistoryItem(t.key,e,n)},e.prototype.updateInputPosition=function(t){this.control.selection.inputPosition.setStyleTextPropertyValue(this.getStyleProperty(),t)},e}(r.ChangeStylePropertyCommandBase);e.ChangeStyleTextPropertyCommand=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,o){return t.call(this,e,n,o)||this}return i(e,t),e.prototype.redo=function(t){var e=t.model.findItem(this.itemKey);this.oldStyleValue=e.style[this.styleProperty],t.changeStyle(e,this.styleProperty,this.styleValue)},e.prototype.undo=function(t){var e=t.model.findItem(this.itemKey);t.changeStyle(e,this.styleProperty,this.oldStyleValue)},e}(n(86).ChangeStyleHistoryItemBase);e.ChangeStyleHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(44),c=n(10),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!0)},e.prototype.executeCore=function(t,e){var n=this;try{var o=this.getCanvasManager();this.getExportFunc()(o,function(t){e(t),n.tryDisposeCanvasManager()})}catch(t){throw this.tryDisposeCanvasManager(),t}return!0},e.prototype.getCanvasManager=function(){return void 0!==this.control.canvasManager?this.control.canvasManager:(void 0===this.canvasManager&&(this.canvasManager=this.createCanvasManager()),this.canvasManager)},e.prototype.createCanvasManager=function(){var t=c.RenderManager.createSvgElement(!0);document.body.appendChild(t);var e=new a.CanvasManager(t);return this.control.modelManipulator.onModelChanged.add(e),this.control.modelManipulator.onLoad(),e},e.prototype.tryDisposeCanvasManager=function(){this.canvasManager&&(document.body.removeChild(this.canvasManager.svgElement),delete this.canvasManager)},e}(r.CommandBase);e.ExportImageCommand=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.setClipboardData=function(t){this.control.renderManager?this.control.renderManager.setClipboardData(t):e.clipboardData=t},e.prototype.getClipboardData=function(t){this.control.renderManager?this.control.renderManager.getClipboardData(t):t(e.clipboardData)},e}(n(7).CommandBase);e.ClipboardCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),s=n(95),a=n(16),c=function(t){function e(e,n,o,i,r){var s=t.call(this,e,n,o,i)||this;return s.model=o,s.selection=i,s.moveStartPoint=r,s}return i(e,t),e.prototype.onMouseDown=function(e){var n=this.moveStartPoint?e.layoutPoint.x-this.moveStartPoint.x:0,o=this.moveStartPoint?e.layoutPoint.y-this.moveStartPoint.y:0;r.ModelUtils.cloneSelectionToOffset(this.history,this.model,this.selection,n,o),t.prototype.onMouseDown.call(this,e)},e.isMoveClonedShapeEvent=function(t){return t.modifiers&a.ModifierKey.Ctrl&&t.modifiers&a.ModifierKey.Shift},e}(s.MouseHandlerMoveShapeStateBase);e.MouseHandlerMoveClonedShapeState=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(t,e){this.point=t,this.side=e};e.ConnectionPointInfo=o;var i=function(){function t(t){this.dispatcher=t}return t.prototype.getKey=function(){return this.key},t.prototype.setPoints=function(t,e,n){this.key===t&&this.pointIndex===n||(this.key=t,this.points=e,this.pointIndex=n,this.raiseShow())},t.prototype.setPointIndex=function(t){0<=t&&t<this.points.length&&this.pointIndex!==t&&(this.pointIndex=t,this.raiseShow())},t.prototype.update=function(){this.raiseShow()},t.prototype.reset=function(){"-1"!==this.key&&(this.key="-1",this.points=[],this.pointIndex=-1,this.raiseHide())},t}();e.ConnectionPointsVisualizerBase=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o,i=n(100),r=n(156),s=n(157),a=n(158),c=n(159),u=n(160),p=n(161),h=n(162),l=n(163),d=n(164),f=n(165),y=n(166),m=n(167),g=n(168),v=n(169),P=n(170),C=n(171),S=n(172),_=n(16),w=n(173),x=n(174),b=n(176),O=n(177),M=n(179),E=n(181),T=n(185),I=n(186),A=n(187),D=n(188),L=n(189),k=n(192),j=n(194),z=n(195),R=n(196),N=n(197),U=n(198),B=n(199),K=n(201),H=n(202),V=n(203),F=n(204),W=n(205),G=n(207),X=n(208),Y=n(209),q=n(210),Z=n(211),J=n(212);!function(t){t[t.Undo=0]="Undo",t[t.Redo=1]="Redo",t[t.Cut=2]="Cut",t[t.Copy=3]="Copy",t[t.Paste=4]="Paste",t[t.SelectAll=5]="SelectAll",t[t.Delete=6]="Delete",t[t.Import=7]="Import",t[t.ImportBPMN=8]="ImportBPMN",t[t.Export=9]="Export",t[t.ExportSvg=10]="ExportSvg",t[t.ExportPng=11]="ExportPng",t[t.ExportJpg=12]="ExportJpg",t[t.ImportDataSource=13]="ImportDataSource",t[t.CloseDataSource=14]="CloseDataSource",t[t.BindDocument=15]="BindDocument",t[t.UnbindDocument=16]="UnbindDocument",t[t.Bold=17]="Bold",t[t.Italic=18]="Italic",t[t.Underline=19]="Underline",t[t.FontName=20]="FontName",t[t.FontSize=21]="FontSize",t[t.FontColor=22]="FontColor",t[t.FillColor=23]="FillColor",t[t.StrokeColor=24]="StrokeColor",t[t.TextLeftAlign=25]="TextLeftAlign",t[t.TextCenterAlign=26]="TextCenterAlign",t[t.TextRightAlign=27]="TextRightAlign",t[t.ConnectorLineOption=28]="ConnectorLineOption",t[t.ConnectorStartLineEnding=29]="ConnectorStartLineEnding",t[t.ConnectorEndLineEnding=30]="ConnectorEndLineEnding",t[t.BringToFront=31]="BringToFront",t[t.SendToBack=32]="SendToBack",t[t.MoveLeft=33]="MoveLeft",t[t.MoveStepLeft=34]="MoveStepLeft",t[t.MoveRight=35]="MoveRight",t[t.MoveStepRight=36]="MoveStepRight",t[t.MoveUp=37]="MoveUp",t[t.MoveStepUp=38]="MoveStepUp",t[t.MoveDown=39]="MoveDown",t[t.MoveStepDown=40]="MoveStepDown",t[t.CloneLeft=41]="CloneLeft",t[t.CloneRight=42]="CloneRight",t[t.CloneUp=43]="CloneUp",t[t.CloneDown=44]="CloneDown",t[t.AutoLayoutTree=45]="AutoLayoutTree",t[t.AutoLayoutFlow=46]="AutoLayoutFlow",t[t.AutoLayoutTreeVertical=47]="AutoLayoutTreeVertical",t[t.AutoLayoutTreeHorizontal=48]="AutoLayoutTreeHorizontal",t[t.AutoLayoutLayeredVertical=49]="AutoLayoutLayeredVertical",t[t.AutoLayoutLayeredHorizontal=50]="AutoLayoutLayeredHorizontal",t[t.Lock=51]="Lock",t[t.Unlock=52]="Unlock",t[t.Units=53]="Units",t[t.PageSize=54]="PageSize",t[t.PageLandscape=55]="PageLandscape",t[t.PageColor=56]="PageColor",t[t.GridSize=57]="GridSize",t[t.ShowGrid=58]="ShowGrid",t[t.SnapToGrid=59]="SnapToGrid",t[t.ZoomLevel=60]="ZoomLevel",t[t.Fullscreen=61]="Fullscreen"}(o=e.DiagramCommand||(e.DiagramCommand={}));var Q=function(){function t(t){this.commands={},this.shortcutsToCommand={},this.lastCommandsChain=[],this.executingCommandsChain=[],this.executingCommandCounter=0,this.isPublicApiCall=!1,this.createCommand(t,o.Undo,r.UndoCommand,_.ModifierKey.Ctrl|_.KeyCode.Key_z,_.ModifierKey.Meta|_.KeyCode.Key_z),this.createCommand(t,o.Redo,s.RedoCommand,_.ModifierKey.Ctrl|_.KeyCode.Key_y,_.ModifierKey.Ctrl|_.ModifierKey.Shift|_.KeyCode.Key_z,_.ModifierKey.Meta|_.ModifierKey.Shift|_.KeyCode.Key_z),this.createCommand(t,o.Cut,D.CutSelectionCommand,_.KeyCode.Key_x|_.ModifierKey.Ctrl,_.KeyCode.Key_x|_.ModifierKey.Meta),this.createCommand(t,o.Copy,A.CopySelectionCommand,_.KeyCode.Key_c|_.ModifierKey.Ctrl,_.KeyCode.Key_c|_.ModifierKey.Meta),this.createCommand(t,o.Paste,L.PasteSelectionCommand),this.createCommand(t,o.SelectAll,S.SelectAllCommand,_.KeyCode.Key_a|_.ModifierKey.Ctrl,_.KeyCode.Key_a|_.ModifierKey.Meta),this.createCommand(t,o.Delete,i.DeleteCommand,_.KeyCode.Delete,_.KeyCode.Backspace),this.createCommand(t,o.Import,a.ImportCommand),this.createCommand(t,o.ImportBPMN,k.ImportBPMNCommand),this.createCommand(t,o.Export,c.ExportCommand),this.createCommand(t,o.ExportSvg,T.ExportSvgCommand),this.createCommand(t,o.ExportPng,E.ExportPngCommand),this.createCommand(t,o.ExportJpg,I.ExportJpgCommand),this.createCommand(t,o.ImportDataSource,g.ImportDataSourceCommand),this.createCommand(t,o.CloseDataSource,F.CloseDataSourceCommand),this.createCommand(t,o.BindDocument,B.BindDocumentCommand),this.createCommand(t,o.UnbindDocument,K.UnbindDocumentCommand),this.createCommand(t,o.Bold,u.ToggleFontBoldCommand,_.ModifierKey.Ctrl|_.KeyCode.Key_b,_.ModifierKey.Meta|_.KeyCode.Key_b),this.createCommand(t,o.Italic,p.ToggleFontItalicCommand,_.ModifierKey.Ctrl|_.KeyCode.Key_i,_.ModifierKey.Meta|_.KeyCode.Key_i),this.createCommand(t,o.Underline,h.ToggleFontUnderlineCommand,_.ModifierKey.Ctrl|_.KeyCode.Key_u,_.ModifierKey.Meta|_.KeyCode.Key_u),this.createCommand(t,o.FontName,l.ChangeFontNameCommand),this.createCommand(t,o.FontSize,d.ChangeFontSizeCommand),this.createCommand(t,o.FontColor,f.ChangeFontColorCommand),this.createCommand(t,o.FillColor,y.ChangeFillColorCommand),this.createCommand(t,o.StrokeColor,m.ChangeStrokeColorCommand),this.createCommand(t,o.TextLeftAlign,v.TextLeftAlignCommand),this.createCommand(t,o.TextCenterAlign,v.TextCenterAlignCommand),this.createCommand(t,o.TextRightAlign,v.TextRightAlignCommand),this.createCommand(t,o.ConnectorLineOption,C.ChangeConnectorLineOptionCommand),this.createCommand(t,o.ConnectorStartLineEnding,P.ChangeConnectorStartLineEndingCommand),this.createCommand(t,o.ConnectorEndLineEnding,P.ChangeConnectorEndLineEndingCommand),this.createCommand(t,o.BringToFront,z.BringToFrontCommand),this.createCommand(t,o.SendToBack,j.SendToBackCommand),this.createCommand(t,o.MoveLeft,N.MoveLeftCommand,_.ModifierKey.Shift|_.KeyCode.Left),this.createCommand(t,o.MoveStepLeft,N.MoveStepLeftCommand,_.KeyCode.Left),this.createCommand(t,o.MoveRight,N.MoveRightCommand,_.ModifierKey.Shift|_.KeyCode.Right),this.createCommand(t,o.MoveStepRight,N.MoveStepRightCommand,_.KeyCode.Right),this.createCommand(t,o.MoveUp,N.MoveUpCommand,_.ModifierKey.Shift|_.KeyCode.Up),this.createCommand(t,o.MoveStepUp,N.MoveStepUpCommand,_.KeyCode.Up),this.createCommand(t,o.MoveDown,N.MoveDownCommand,_.ModifierKey.Shift|_.KeyCode.Down),this.createCommand(t,o.MoveStepDown,N.MoveStepDownCommand,_.KeyCode.Down),this.createCommand(t,o.CloneLeft,X.CloneLeftCommand,_.ModifierKey.Ctrl|_.ModifierKey.Shift|_.KeyCode.Left),this.createCommand(t,o.CloneRight,X.CloneRightCommand,_.ModifierKey.Ctrl|_.ModifierKey.Shift|_.KeyCode.Right),this.createCommand(t,o.CloneUp,X.CloneUpCommand,_.ModifierKey.Ctrl|_.ModifierKey.Shift|_.KeyCode.Up),this.createCommand(t,o.CloneDown,X.CloneDownCommand,_.ModifierKey.Ctrl|_.ModifierKey.Shift|_.KeyCode.Down),this.createCommand(t,o.Lock,W.LockCommand),this.createCommand(t,o.Unlock,G.UnLockCommand),this.createCommand(t,o.AutoLayoutTree,w.AutoLayoutTreeVerticalCommand),this.createCommand(t,o.AutoLayoutFlow,R.AutoLayoutLayeredHorizontalCommand),this.createCommand(t,o.Units,Y.ChangeUnitsCommand),this.createCommand(t,o.PageSize,M.ChangePageSizeCommand),this.createCommand(t,o.PageLandscape,O.ChangePageLandscapeCommand),this.createCommand(t,o.PageColor,q.ChangePageColorCommand),this.createCommand(t,o.GridSize,b.ChangeGridSizeCommand),this.createCommand(t,o.ShowGrid,Z.ChangeShowGridCommand),this.createCommand(t,o.SnapToGrid,x.ChangeSnapToGridCommand),this.createCommand(t,o.ZoomLevel,U.ChangeZoomLevelCommand),this.createCommand(t,o.AutoLayoutTreeVertical,w.AutoLayoutTreeVerticalCommand),this.createCommand(t,o.AutoLayoutTreeHorizontal,H.AutoLayoutTreeHorizontalCommand),this.createCommand(t,o.AutoLayoutLayeredVertical,V.AutoLayoutLayeredVerticalCommand),this.createCommand(t,o.AutoLayoutLayeredHorizontal,R.AutoLayoutLayeredHorizontalCommand),this.createCommand(t,o.Fullscreen,J.ToggleFullscreenCommand,_.KeyCode.F11)}return t.prototype.getCommand=function(t){return this.commands[t]},t.prototype.beforeExecuting=function(t){this.executingCommandsChain.push(t),this.executingCommandCounter++},t.prototype.afterExecuting=function(){this.executingCommandCounter--,0===this.executingCommandCounter&&(this.lastCommandsChain=this.executingCommandsChain,this.executingCommandsChain=[])},t.prototype.assertLastExecutedCommandsChain=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t&&this.lastCommandsChain.length!==e.length)return!1;for(var o,i=0;o=e[i];i++)if(!(this.lastCommandsChain[i]&&this.lastCommandsChain[i]instanceof o))return!1;return!0},t.prototype.processShortcut=function(t){var e=this.shortcutsToCommand[t];return!!e&&e.execute()},t.prototype.processPaste=function(t){var e=this.getCommand(o.Paste);return e&&e.performPaste(t),!0},t.prototype.NotifySelectionChanged=function(t){this.lastCommandsChain=[]},t.prototype.NotifyScrollPositionChanged=function(){},t.prototype.createCommand=function(t,e,n){for(var o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];this.commands[e]=new n(t);for(var r=0;r<o.length;r++){var s=o[r];"number"==typeof s&&(this.shortcutsToCommand[s]=this.commands[e])}},t}();e.CommandManager=Q},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=function(t){function e(e,n,o,i,r,s,a,c){var u=t.call(this,r,s,a,c)||this;return u.x1=e,u.y1=n,u.x2=o,u.y2=i,u}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"line")},e.prototype.applyElementProperties=function(e){this.setUnitAttribute(e,"x1",this.x1),this.setUnitAttribute(e,"y1",this.y1),this.setUnitAttribute(e,"x2",this.x2),this.setUnitAttribute(e,"y2",this.y2),t.prototype.applyElementProperties.call(this,e)},e}(n(15).SvgPrimitive);e.LinePrimitive=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(20),i=n(19),r=function(){function t(){}return t.onEventAttachingToDocument=function(e,n){return!o.Browser.MacOSMobilePlatform||!t.isTouchEventName(e)||(t.documentTouchHandlers[e]||(t.documentTouchHandlers[e]=[]),t.documentTouchHandlers[e].push(n),t.documentEventAttachingAllowed)},t.isTouchEventName=function(t){return o.Browser.WebKitTouchUI&&(t.indexOf("touch")>-1||t.indexOf("gesture")>-1)},t.isTouchEvent=function(t){return!!t&&(o.Browser.WebKitTouchUI&&i.IsExists(t.changedTouches))},t.getEventX=function(t){return o.Browser.IE?t.pageX:t.changedTouches[0].pageX},t.getEventY=function(t){return o.Browser.IE?t.pageY:t.changedTouches[0].pageY},t.touchMouseDownEventName=o.Browser.WebKitTouchUI?"touchstart":o.Browser.Edge&&o.Browser.MSTouchUI&&window.PointerEvent?"pointerdown":"mousedown",t.touchMouseUpEventName=o.Browser.WebKitTouchUI?"touchend":o.Browser.Edge&&o.Browser.MSTouchUI&&window.PointerEvent?"pointerup":"mouseup",t.touchMouseMoveEventName=o.Browser.WebKitTouchUI?"touchmove":o.Browser.Edge&&o.Browser.MSTouchUI&&window.PointerEvent?"pointermove":"mousemove",t.msTouchDraggableClassName="dxMSTouchDraggable",t.documentTouchHandlers={},t.documentEventAttachingAllowed=!0,t}();e.TouchUIHelper=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){this.connector=t};e.ConnectorPointsCalculatorBase=o},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=n(113),a=n(21),c=function(t){function e(e,n,o,i,r,s){void 0===n&&(n=!0),void 0===o&&(o="-0.05"),void 0===i&&(i="-0.05"),void 0===r&&(r="1.1"),void 0===s&&(s="1.1");var a=t.call(this,e,o,i,r,s)||this;return a.id=e,a.useFloodColor=n,a.x=o,a.y=i,a.width=r,a.height=s,a}return i(e,t),e.prototype.createChildElements=function(t){var e=this.getFloodColor(t.parentElement),n=document.createElementNS(r.svgNS,"feFlood");this.useFloodColor&&(n.setAttribute("flood-color",e),n.setAttribute("class","text-filter-flood"),e!==a.DiagramModel.defaultPageColor&&n.style.setProperty("flood-color",e)),t.appendChild(n);var o=document.createElementNS(r.svgNS,"feComposite");o.setAttribute("in","SourceGraphic"),o.setAttribute("operator","atop"),t.appendChild(o)},e.prototype.getFloodColor=function(t){for(;null!=t&&"BODY"!=t.tagName&&"#document"!=t.nodeName;){if("svg"===t.tagName&&""!==t.style.backgroundColor)return t.style.backgroundColor;t=t.parentNode}return a.DiagramModel.defaultPageColor},e}(s.FilterPrimitive);e.TextFilterPrimitive=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),s=n(5),a=function(t){function e(e,n){var o=t.call(this)||this;return o.connectorKey=e.key,o.position=n,o.itemKey=e.getExtremeItem(o.position).key,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);this.oldConnectionPointIndex=this.position===s.ConnectorPosition.Begin?e.beginConnectionPointIndex:e.endConnectionPointIndex,t.deleteConnection(e,this.position)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey),n=t.model.findItem(this.itemKey);t.addConnection(e,n,this.oldConnectionPointIndex,this.position)},e}(r.HistoryItem);e.DeleteConnectionHistoryItem=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){var n=t.call(this)||this;return n.shapeKey=e,n}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);this.shape=e.clone(),t.deleteShape(e)},e.prototype.undo=function(t){t.addShape(this.shape,this.shape.key)},e}(n(4).HistoryItem);e.DeleteShapeHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),s=n(2),a=n(1),c=function(t){function e(e,n,o){return void 0===e&&(e="Diamond"),void 0===n&&(n=""),void 0===o&&(o=r.ShapeDefaultSize.clone()),t.call(this,e,n,o)||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return a.ShapeType.Diamond},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return a.ShapeCategory.General},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,r=e.bottom,a=e.center,c=a.x,u=a.y;return[].concat([new s.PathPrimitive([new s.PathPrimitiveMoveToCommand(c,o),new s.PathPrimitiveLineToCommand(i,u),new s.PathPrimitiveLineToCommand(c,r),new s.PathPrimitiveLineToCommand(n,u),new s.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e}(r.ShapeDescription);e.DiamondShapeDescription=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),s=n(0),a=n(1),c=function(t){function e(){return t.call(this,"Text","Text",new s.Size(r.ShapeDefaultDimension,.5*r.ShapeDefaultDimension))||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return a.ShapeType.Text},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return a.ShapeCategory.General},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t,e){return this.createTextPrimitives(t,e)},e}(r.ShapeDescription);e.TextShapeDescription=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),s=n(1),a=n(57),c=n(3),u=function(t){function e(e,n){void 0===e&&(e="Pentagon"),void 0===n&&(n="");var o=t.call(this,e,n)||this;return o.defaultRatio=o.defaultSize.height/o.defaultSize.width,o}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.Pentagon},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"angleCount",{get:function(){return 5},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,s=e.bottom,a=e.width,c=e.height,u=e.center.x,p=c/a/this.defaultRatio,h=Math.PI-this.angle,l=a/2*Math.tan(h/2)*p,d=o+l,f=(c-l)/Math.tan(h)/p,y=n+f,m=i-f;return[].concat([new r.PathPrimitive([new r.PathPrimitiveMoveToCommand(u,o),new r.PathPrimitiveLineToCommand(i,d),new r.PathPrimitiveLineToCommand(m,s),new r.PathPrimitiveLineToCommand(y,s),new r.PathPrimitiveLineToCommand(n,d),new r.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.processConnectionPoint=function(t,e,n){var o=t.getConnectionPointSide(n);if(o===c.ConnectionPointSide.East||o===c.ConnectionPointSide.West){var i=t.rectangle,r=i.top,s=i.width,a=i.height/s/this.defaultRatio,u=Math.PI-this.angle,p=r+s/2*Math.tan(u/2)*a;o===c.ConnectionPointSide.East?e.y=p:o===c.ConnectionPointSide.West&&(e.y=p)}},e.prototype.calculateHeight=function(t){var e=Math.PI-this.angle;return t/2*Math.tan(e/2)+t/2/Math.cos(e/2)*Math.sin(e)},e}(a.PolygonShapeDescription);e.PentagonShapeDescription=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),s=n(1),a=function(t){function e(e,n){return void 0===e&&(e="Hexagon"),void 0===n&&(n=""),t.call(this,e,n)||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.Hexagon},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"angleCount",{get:function(){return 6},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,s=e.bottom,a=e.width,c=(e.height,e.center.y),u=Math.PI-this.angle,p=a/(1+2*Math.cos(u)),h=n+(a-p)/2,l=h+p;return[].concat([new r.PathPrimitive([new r.PathPrimitiveMoveToCommand(h,o),new r.PathPrimitiveLineToCommand(l,o),new r.PathPrimitiveLineToCommand(i,c),new r.PathPrimitiveLineToCommand(l,s),new r.PathPrimitiveLineToCommand(h,s),new r.PathPrimitiveLineToCommand(n,c),new r.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.calculateHeight=function(t){var e=Math.PI-this.angle;return 2*(t/(1+2*Math.cos(e)))*Math.sin(e)},e}(n(57).PolygonShapeDescription);e.HexagonShapeDescription=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),s=n(2),a=n(1),c=n(32),u=n(3),p=function(t){function e(e,n){void 0===e&&(e="Triangle"),void 0===n&&(n="");var o=t.call(this,e,n)||this;return o.defaultSize.height=o.calculateHeight(r.ShapeDefaultDimension),o}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return a.ShapeType.Triangle},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return a.ShapeCategory.General},enumerable:!0,configurable:!0}),e.prototype.createConnectionPoints=function(){return[new c.ConnectionPoint(.5,0,u.ConnectionPointSide.North),new c.ConnectionPoint(.75,.5,u.ConnectionPointSide.East),new c.ConnectionPoint(.5,1,u.ConnectionPointSide.South),new c.ConnectionPoint(.25,.5,u.ConnectionPointSide.West)]},e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,r=e.bottom;return[].concat([new s.PathPrimitive([new s.PathPrimitiveMoveToCommand(e.center.x,o),new s.PathPrimitiveLineToCommand(i,r),new s.PathPrimitiveLineToCommand(n,r),new s.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.calculateHeight=function(t){return Math.sqrt(Math.pow(t,2)-Math.pow(t/2,2))},e}(r.ShapeDescription);e.TriangleShapeDescription=p},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(2),c=n(3),u=function(t){function e(e,n){return void 0===e&&(e="Document"),void 0===n&&(n="Document"),t.call(this,e,n)||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.Document},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){return[].concat(this.createDocumentPrimitives(t.rectangle,t.style)).concat(this.createTextPrimitives(t))},e.prototype.createDocumentPrimitives=function(t,n){var o=t.left,i=t.top,r=t.right,s=t.bottom,c=t.width,u=t.height,p=t.center.x,h=u*e.curveOffsetRatio;return[].concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(o,i),new a.PathPrimitiveLineToCommand(r,i),new a.PathPrimitiveLineToCommand(r,s),new a.PathPrimitiveQuadraticCurveToCommand(r-.25*c,s-2*h,p,s-h),new a.PathPrimitiveQuadraticCurveToCommand(o+.25*c,s+h,o,s-h),new a.PathPrimitiveClosePathCommand],n)])},e.prototype.processConnectionPoint=function(t,n,o){t.getConnectionPointSide(o)===c.ConnectionPointSide.South&&(n.y-=t.size.height*e.curveOffsetRatio)},e.prototype.getTextRectangle=function(t){return t.resize(0,-t.height*e.curveOffsetRatio)},e.curveOffsetRatio=.1,e}(r.RectangleShapeDescription);e.DocumentShapeDescription=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=n(39),r=function(){function t(){this.nodeKeys=[],this.nodeToLayout={},this.edgeToPosition={}}return t.prototype.forEachNode=function(t){var e=this;this.nodeKeys.forEach(function(n){return t(e.nodeToLayout[n],n)})},t.prototype.addNode=function(t){if(this.nodeToLayout[t.key])throw Error("Node layout is already registered");this.nodeKeys.push(t.key),this.nodeToLayout[t.key]=t},t.prototype.addEdge=function(t){if(this.edgeToPosition[t.key])throw Error("Edge layout is already registered");this.edgeToPosition[t.key]=t},t.prototype.getRectangle=function(t){var e=this;return o.GeometryUtils.getCommonRectangle(this.nodeKeys.map(function(t){return e.nodeToLayout[t].rectangle}))},t.prototype.offsetNodes=function(e,n){var o=this;void 0===e&&(e=0),void 0===n&&(n=0);var r=new t;return this.nodeKeys.forEach(function(t){var s=o.nodeToLayout[t];r.addNode(new i.NodeLayout(s.info,s.position.offset(e,n)))}),r.copyEdges(this),r},t.prototype.extend=function(t){var e=this;t.forEachNode(function(t){return e.addNode(t)}),this.copyEdges(t)},t.prototype.copyEdges=function(t){var e=this;Object.keys(t.edgeToPosition).forEach(function(n){var o=t.edgeToPosition[n];e.addEdge(new i.EdgeLayout(o.key,o.beginIndex,o.endIndex))})},t}();e.GraphLayout=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(18),i=function(){function t(t,e){this.settings=t,this.graph=e}return t.prototype.getBreadthNodeSizeCore=function(t){return this.settings.orientation===o.OrientationKind.Vertical?t.size.width+t.margin.left+t.margin.right:t.size.height+t.margin.top+t.margin.bottom},t.prototype.getDepthNodeSizeCore=function(t){return this.settings.orientation===o.OrientationKind.Horizontal?t.size.width+t.margin.left+t.margin.right:t.size.height+t.margin.top+t.margin.bottom},t.prototype.chooseDirectionValue=function(t,e){return this.settings.direction===o.LogicalDirectionKind.Forward?t:e},t.prototype.getDirectionValue=function(t){return this.settings.direction===o.LogicalDirectionKind.Forward?t:-t},t.prototype.getComponentOffset=function(t){var e=t.getRectangle(!0);return(this.settings.orientation===o.OrientationKind.Vertical?e.width:e.height)+this.settings.componentSpacing},t.prototype.setComponentOffset=function(t,e){return this.settings.orientation===o.OrientationKind.Vertical?t.offsetNodes(e):t.offsetNodes(0,e)},t}();e.LayoutBuilder=i},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){var n=t.call(this)||this;return n.item=e,n}return i(e,t),e.prototype.redo=function(t){this.clearConnections(this.item),this.addItem(this.item,t)},e.prototype.undo=function(t){var e=t.model.findItem(this.item.key);this.clearConnections(e),this.deleteItem(e,t)},e}(n(4).HistoryItem);e.CloneHistoryItem=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(21),i=n(9),r=n(0),s=n(30),a=n(5),c=n(1),u=function(){function t(){}return t.import=function(t){var e=new o.DiagramModel,n=this.parseJSON(t);this.importPageSettings(e,n.page);for(var i=this.importShapes(n.shapes),r=0;r<i.length;r++){var s=i[r];if(e.findItem(s.key))throw Error("Item key is duplicated");e.pushItem(s)}var a=this.importConnectors(n.connectors);for(r=0;r<a.length;r++){var c=a[r];if(c.endItem=e.findItem(c.endItemKey)||void 0,delete c.endItemKey,c.beginItem=e.findItem(c.beginItemKey)||void 0,delete c.beginItemKey,e.findItem(c.key))throw Error("Item key is duplicated");e.pushItem(c),this.updateConnections(c)}return e},t.importItems=function(t,e){for(var n,o=[],i=this.parseJSON(t),r={},s=this.importShapes(i.shapes),a=0;a<s.length;a++){var c=s[a],u=c.key;n=e.getNextKey(n),c.key=n,r[u]=c,o.push(c)}var p=this.importConnectors(i.connectors);for(a=0;a<p.length;a++){var h=p[a];u=h.key;n=e.getNextKey(n),h.key=n,r[u]=h;var l=h.endItemKey;h.endItem=r[l],delete h.endItemKey;var d=h.beginItemKey;h.beginItem=r[d],delete h.beginItemKey,o.push(h),this.updateConnections(h)}return o},t.importItemsData=function(t,e){for(var n=this.parseJSON(t),o=this.importShapes(n.shapes),i=0;i<o.length;i++){var r=o[i],s=void 0;void 0!==r.dataKey&&(s=e.findShapeByDataKey(r.dataKey)),s||(s=e.findShape(r.key)),s&&(s.dataKey=r.dataKey,s.locked=r.locked,s.position=r.position.clone(),s.size=r.size.clone(),s.parameters=r.parameters.clone(),s.style=r.style.clone(),s.styleText=r.styleText.clone(),s.zIndex=r.zIndex)}var a=this.importConnectors(n.connectors);for(i=0;i<a.length;i++){var c=a[i],u=void 0;void 0!==c.dataKey&&(u=e.findConnectorByDataKey(c.dataKey)),u||(u=e.findConnector(c.key)),u&&(u.dataKey=c.dataKey,u.locked=c.locked,u.points=c.points.slice(),u.properties=c.properties.clone(),u.style=c.style.clone(),u.styleText=c.styleText.clone(),u.zIndex=c.zIndex)}},t.canImport=function(t){var e=this.parseJSON(t);return Array.isArray(e.shapes)||Array.isArray(e.connectors)},t.importPageSettings=function(t,e){e&&(this.assert(e.width,"number"),this.assert(e.height,"number"),"number"==typeof e.width&&(t.size.width=e.width),"number"==typeof e.height&&(t.size.height=e.height),"string"==typeof e.pageColor&&(t.pageColor=e.pageColor),"number"==typeof e.pageWidth&&(t.pageSize.width=e.pageWidth),"number"==typeof e.pageHeight&&(t.pageSize.height=e.pageHeight),"boolean"==typeof e.pageLandscape&&(t.pageLandscape=e.pageLandscape),"number"==typeof e.gridSize&&(t.gridSize=e.gridSize),"boolean"==typeof e.showGrid&&(t.showGrid=e.showGrid),"boolean"==typeof e.snapToGrid&&(t.snapToGrid=e.snapToGrid),"number"==typeof e.units&&(t.units=e.units))},t.importShapes=function(t){var e=[];if(!t)return e;if(!Array.isArray(t))throw Error("Invalid Format");for(var n=0;n<t.length;n++){var o=t[n];e.push(this.importShape(o))}return e},t.importShape=function(t){this.assert(t.key,"string"),this.assert(t.x,"number"),this.assert(t.y,"number");var e=new r.Point(t.x,t.y);this.assert(t.type,"number");var n=t.type,o=s.ShapeDescriptionManager.get(n),a=new i.Shape(o||s.ShapeDescriptionManager.get(c.ShapeType.Rectangle),e);return a.key=t.key,"string"==typeof t.dataKey&&(a.dataKey=t.dataKey),"boolean"==typeof t.locked&&(a.locked=t.locked),"number"==typeof t.width&&(a.size.width=t.width),"number"==typeof t.height&&(a.size.height=t.height),"string"==typeof t.text&&(a.text=t.text),t.parameters&&(a.parameters.fromObject(t.parameters),a.description.normalizeParameters(a,a.parameters)),t.style&&a.style.fromObject(t.style),t.styleText&&a.styleText.fromObject(t.styleText),"number"==typeof t.zIndex&&(a.zIndex=t.zIndex),a},t.importConnectors=function(t){var e=[];if(!t)return e;if(!Array.isArray(t))throw Error("Invalid Format");for(var n=0;n<t.length;n++){var o=t[n];e.push(this.importConnector(o))}return e},t.importConnector=function(t){var e=this;if(this.assert(t.key,"string"),!Array.isArray(t.points))throw Error("Invalid Format");var n=t.points.map(function(t){return e.assert(t.x,"number"),e.assert(t.y,"number"),new r.Point(t.x,t.y)}),o=new a.Connector(n);return o.key=t.key,"string"==typeof t.dataKey&&(o.dataKey=t.dataKey),"boolean"==typeof t.locked&&(o.locked=t.locked),o.endConnectionPointIndex="number"==typeof t.endConnectionPointIndex?t.endConnectionPointIndex:-1,o.beginConnectionPointIndex="number"==typeof t.beginConnectionPointIndex?t.beginConnectionPointIndex:-1,void 0!==t.endItemKey&&this.assert(t.endItemKey,"string"),void 0!==t.beginItemKey&&this.assert(t.beginItemKey,"string"),o.endItemKey=t.endItemKey,o.beginItemKey=t.beginItemKey,t.texts&&o.texts.fromObject(t.texts),t.properties&&o.properties.fromObject(t.properties),t.style&&o.style.fromObject(t.style),t.styleText&&o.styleText.fromObject(t.styleText),"number"==typeof t.zIndex&&(o.zIndex=t.zIndex),o},t.updateConnections=function(t){t.endItem&&(t.endItem.attachedConnectors.push(t),t.points[t.points.length-1]=t.endItem.getConnectionPoint(t.endConnectionPointIndex,t.points[t.points.length-2])),t.beginItem&&(t.beginItem.attachedConnectors.push(t),t.points[0]=t.beginItem.getConnectionPoint(t.beginConnectionPointIndex,t.points[1]))},t.parseJSON=function(t){if(!t||""===t)return{};try{return JSON.parse(t)}catch(t){return{}}},t.assert=function(t,e){if(void 0===t)throw Error("Invalid Format");if(void 0!==e&&typeof t!==e)throw Error("Invalid Format")},t}();e.Importer=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!0,this.getStateValue())},e}(r.CommandBase);e.StylePropertyCommandBase=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.itemKey=e,i.styleProperty=n,i.styleValue=o,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findItem(this.itemKey);this.oldStyleValue=e.style[this.styleProperty],t.changeStyle(e,this.styleProperty,this.styleValue)},e.prototype.undo=function(t){var e=t.model.findItem(this.itemKey);t.changeStyle(e,this.styleProperty,this.oldStyleValue)},e}(n(4).HistoryItem);e.ChangeStyleHistoryItemBase=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(t,e){var n=this;return this.control.history.beginTransaction(),this.control.selection.getSelectedItems().forEach(function(t){var o=n.getStyleProperty();n.control.history.addAndRedo(n.createHistoryItem(t,o,e))}),this.updateInputPosition(e),this.control.history.endTransaction(),!0},e}(n(85).StylePropertyCommandBase);e.ChangeStylePropertyCommandBase=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(87),s=n(63),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStateValue=function(){return this.control.selection.inputPosition.getStylePropertyValue(this.getStyleProperty())},e.prototype.getStyleObj=function(t){return t.style},e.prototype.createHistoryItem=function(t,e,n){return new s.ChangeStyleHistoryItem(t.key,e,n)},e.prototype.updateInputPosition=function(t){this.control.selection.inputPosition.setStylePropertyValue(this.getStyleProperty(),t)},e}(r.ChangeStylePropertyCommandBase);e.ChangeStylePropertyCommand=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!0)},e.prototype.executeCore=function(t,e){if(!e||!Array.isArray(e.nodeDataSource))throw Error("Format exception");return this.performImportData(e),this.control.renderManager&&this.control.renderManager.onWindowResize(null),!0},e.prototype.createItems=function(t,e){t.createModelItems(this.control.history,this.control.model,this.control.selection,e)},e}(r.CommandBase);e.ImportDataCommandBase=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(91),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!0,this.getStateValue())},e.prototype.getStateValue=function(){return this.control.selection.inputPosition.getConnectorPropertyValue(this.getPropertyName())},e.prototype.executeCore=function(t,e){var n=this;return this.control.history.beginTransaction(),this.control.selection.getSelectedConnectors().forEach(function(t){var o=n.getPropertyName();n.control.history.addAndRedo(new a.ChangeConnectorPropertyHistoryItem(t.key,o,e))}),this.control.selection.inputPosition.setConnectorPropertyValue(this.getPropertyName(),e),this.control.history.endTransaction(),!0},e}(r.CommandBase);e.ChangeConnectorPropertyCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connectorKey=e,i.propertyName=n,i.value=o,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);this.oldValue=e.properties[this.propertyName],t.changeConnectorProperty(e,this.propertyName,this.value)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.changeConnectorProperty(e,this.propertyName,this.oldValue)},e}(n(4).HistoryItem);e.ChangeConnectorPropertyHistoryItem=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.LeftToLeftAbove=0]="LeftToLeftAbove",t[t.LeftToLeftBelow=1]="LeftToLeftBelow",t[t.RightToRightAbove=2]="RightToRightAbove",t[t.RightToRightBelow=3]="RightToRightBelow",t[t.LeftToRightAbove=4]="LeftToRightAbove",t[t.LeftToRightBelow=5]="LeftToRightBelow",t[t.RightToLeftAbove=6]="RightToLeftAbove",t[t.RightToLeftBelow=7]="RightToLeftBelow",t[t.TopToTopBefore=8]="TopToTopBefore",t[t.TopToTopAfter=9]="TopToTopAfter",t[t.BottomToBottomBefore=10]="BottomToBottomBefore",t[t.BottomToBottomAfter=11]="BottomToBottomAfter",t[t.TopToBottomBefore=12]="TopToBottomBefore",t[t.TopToBottomAfter=13]="TopToBottomAfter",t[t.BottomToTopBefore=14]="BottomToTopBefore",t[t.BottomToTopAfter=15]="BottomToTopAfter",t[t.HorizontalCenterAbove=16]="HorizontalCenterAbove",t[t.HorizontalCenterBelow=17]="HorizontalCenterBelow",t[t.VerticalCenterBefore=18]="VerticalCenterBefore",t[t.VerticalCenterAfter=19]="VerticalCenterAfter",t[t.VerticalCenterToPageCenter=20]="VerticalCenterToPageCenter",t[t.HorizontalCenterToPageCenter=21]="HorizontalCenterToPageCenter",t[t.LeftToPageCenter=22]="LeftToPageCenter",t[t.RightToPageCenter=23]="RightToPageCenter",t[t.TopToPageCenter=24]="TopToPageCenter",t[t.BottomToPageCenter=25]="BottomToPageCenter"}(e.ExtensionLineType||(e.ExtensionLineType={}));var o=function(t,e,n){this.type=t,this.segment=e,this.text=n};e.ExtensionLine=o;var i=function(){function t(t){this.dispatcher=t,this.lines=[],this.lineIndexByType={}}return t.prototype.addSegment=function(t,e,n){var i=this.lineIndexByType[t];if(void 0===i){var r=new o(t,e,n),s=this.lines.push(r);this.lineIndexByType[r.type]=s-1,this.raiseShow()}else if(e.distance<this.lines[i].segment.distance){r=new o(t,e,n);this.lines.splice(i,1,r),this.raiseShow()}},t.prototype.update=function(){this.raiseShow()},t.prototype.reset=function(){this.lines.length&&(this.lines=[],this.lineIndexByType={},this.raiseHide())},t.prototype.raiseShow=function(){var t=this;this.dispatcher.raise1(function(e){return e.NotifyExtensionLinesShow(t.lines)})},t.prototype.raiseHide=function(){this.dispatcher.raise1(function(t){return t.NotifyExtensionLinesHide()})},t}();e.ExtensionLinesVisualizer=i},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var o=t.call(this)||this;return o.itemKey=e.key,o.zIndex=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findItem(this.itemKey);this.oldZIndex=e.zIndex,t.changeZIndex(e,this.zIndex)},e.prototype.undo=function(t){var e=t.model.findItem(this.itemKey);t.changeZIndex(e,this.oldZIndex)},e}(n(4).HistoryItem);e.ChangeZindexHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(206),c=n(29),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){var t=this,e=this.control.selection.getSelectedItems(!0),n=!1;return e.forEach(function(e){e.locked!==t.getLockState()&&(n=!0)}),new s.SimpleCommandState(n)},e.prototype.executeCore=function(t,e){var n=this;return this.control.history.beginTransaction(),this.control.selection.getSelectedItems(!0).forEach(function(t){n.control.history.addAndRedo(new a.ChangeLockedHistoryItem(t,n.getLockState()))}),this.control.history.addAndRedo(new c.SetSelectionHistoryItem(this.control.selection,this.control.selection.getKeys())),this.control.history.endTransaction(),!0},e}(r.CommandBase);e.ChangeLockedCommand=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=n(24),a=n(8),c=function(t){function e(e,n,o,i){var r=t.call(this,e,n)||this;return r.model=o,r.selection=i,r.startScrollLeft=0,r.startScrollTop=0,r}return i(e,t),e.prototype.finish=function(){this.handler.resetExtensionLines(),t.prototype.finish.call(this)},e.prototype.onMouseDown=function(e){this.startPoint=e.layoutPoint,this.shapes=this.selection.getSelectedShapes(),this.connectors=this.selection.getSelectedConnectors(),0!==this.shapes.length?(this.startShapePositions=this.shapes.map(function(t){return t.position.clone()}),this.startConnectorPoints=this.connectors.map(function(t){return t.points.map(function(t){return t.clone()})}),t.prototype.onMouseDown.call(this,e)):this.handler.switchToDefaultState()},e.prototype.onMouseMove=function(e){t.prototype.onMouseMove.call(this,e),this.handler.setExtensionLines(this.selection.getSelectedShapes())},e.prototype.onApplyChanges=function(t){var e=this;this.shapes.forEach(function(n,o){var i=e.getPosition(t,e.startShapePositions[o]);a.ModelUtils.setShapePosition(e.history,e.model,n.key,i,e.history.addOrModifyAndRedo),n.attachedConnectors.forEach(function(t){a.ModelUtils.removeConnectorIntermediatePoints(e.history,t),a.ModelUtils.updateConnectorAttachedPoints(e.history,t,e.history.addOrModifyAndRedo)})}),this.connectors.forEach(function(t,n){var o=e.startShapePositions[0].offset(-e.shapes[0].position.x,-e.shapes[0].position.y);if(0!==o.x||0!==o.y)for(var i=t.beginItem?1:0,r=t.endItem?t.points.length-2:t.points.length-1,s=i;s<=r;s++)a.ModelUtils.setConnectorPoint(e.history,e.model,t.key,s,e.startConnectorPoints[n][s].offset(-o.x,-o.y),e.history.addOrModifyAndRedo)}),this.handler.tryUpdateModelSize()},e.prototype.getDraggingElementKeys=function(){return this.shapes.map(function(t){return t.key})},e.prototype.getXPosition=function(t,e){return e+t.layoutPoint.x-this.startPoint.x},e.prototype.getYPosition=function(t,e){return e+t.layoutPoint.y-this.startPoint.y},e.prototype.getPosition=function(t,e){return new r.Point(this.handler.getSnappedPos(t,this.getXPosition(t,e.x)),this.handler.getSnappedPos(t,this.getYPosition(t,e.y)))},e}(s.MouseHandlerDraggingState);e.MouseHandlerMoveShapeStateBase=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),s=n(14),a=n(24),c=n(73),u=n(35),p=n(36),h=n(8),l=function(t){function e(e,n,o){var i=t.call(this,e,n)||this;return i.model=o,i}return i(e,t),e.prototype.finish=function(){this.handler.resetConnectionTarget(),this.handler.resetConnectionPoints(),t.prototype.finish.call(this)},e.prototype.onMouseMove=function(e){t.prototype.onMouseMove.call(this,e);var n=this.connector.getExtremeItem(this.pointPosition);this.handler.setConnectionTarget(n,e.source.type);var o=this.connector.getExtremeConnectionPointIndex(this.pointPosition);n||-1===this.connector.getExtremeConnectionPointIndex(this.oppositePointPosition)||(n=this.model.findItem(e.source.key)),this.handler.setConnectionPoints(n,e.source.type,o)},e.prototype.onApplyChanges=function(t){var e=this.getSnappedPoint(t,t.layoutPoint);if(void 0!==this.pointPosition){var n=this.model.findItem(t.source.key),o=-1;t.source.type===s.MouseEventElementType.ShapeConnectionPoint&&(o=parseInt(t.source.value)),!n||n.locked||t.source.type!==s.MouseEventElementType.Shape&&t.source.type!==s.MouseEventElementType.ShapeConnectionPoint||this.connector.getExtremeItem(this.oppositePointPosition)===n&&(-1===o||-1===this.connector.getExtremeConnectionPointIndex(this.oppositePointPosition)||o===this.connector.getExtremeConnectionPointIndex(this.oppositePointPosition))?this.connector.getExtremeItem(this.pointPosition)&&this.history.addOrModifyAndRedo(new c.DeleteConnectionHistoryItem(this.connector,this.pointPosition)):(this.connector.getExtremeItem(this.pointPosition)===n&&this.connector.getExtremeConnectionPointIndex(this.pointPosition)===o||(this.connector.getExtremeItem(this.pointPosition)&&this.history.addOrModifyAndRedo(new c.DeleteConnectionHistoryItem(this.connector,this.pointPosition)),this.history.addOrModifyAndRedo(new u.AddConnectionHistoryItem(this.connector,n,o,this.pointPosition))),e=n.getConnectionPoint(o,this.connector.points[this.pointIndex+(this.pointPosition===r.ConnectorPosition.End?-1:1)]),this.handler.setConnectionPointIndex(o))}this.history.addOrModifyAndRedo(new p.MoveConnectorPointHistoryItem(this.connector.key,this.pointIndex,e)),h.ModelUtils.updateConnectorAttachedPoints(this.history,this.connector,this.history.addOrModifyAndRedo),this.handler.tryUpdateModelSize()},e.prototype.onFinishWithChanges=function(){h.ModelUtils.removeUnnecessaryConnectorPoints(this.history,this.connector)},e.prototype.getDraggingElementKeys=function(){return this.connector?[this.connector.key]:[]},Object.defineProperty(e.prototype,"oppositePointPosition",{get:function(){return this.pointPosition===r.ConnectorPosition.Begin?r.ConnectorPosition.End:r.ConnectorPosition.Begin},enumerable:!0,configurable:!0}),e}(a.MouseHandlerDraggingState);e.MouseHandlerMoveConnectorPointStateBase=l},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connectorKey=e,i.pointIndex=n,i.point=o,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);t.addConnectorPoint(e,this.pointIndex,this.point.clone())},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.deleteConnectorPoint(e,this.pointIndex)},e}(n(4).HistoryItem);e.AddConnectorPointHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connectorKey=e.key,i.text=o,i.position=n,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);this.oldText=e.getText(this.position),t.changeConnectorText(e,this.position,this.text)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.changeConnectorText(e,this.position,this.oldText)},e}(n(4).HistoryItem);e.ChangeConnectorTextHistoryItem=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=n(49),r=n(19),s=function(){function t(){this.dragStartLimit=3,this.onDragOperation=new o.EventDispatcher}return t.prototype.initialize=function(t,e){t.addEventListener("mousedown",this.onMouseDown.bind(this)),document.addEventListener("mousemove",this.onMouseMove.bind(this)),document.addEventListener("mouseup",this.onMouseUp.bind(this))},t.prototype.onMouseDown=function(t){this.mouseDownPoint=new o.Point(t.pageX,t.pageY),this.draggingObject=this.createDraggingObject(t.target),this.draggingObject&&(this.draggingObject.evt.onFinishDragging=this.finishDragging.bind(this),this.draggingObject.evt.onCaptured=this.capture.bind(this),this.onDragStart())},t.prototype.onMouseMove=function(t){i.Evt.IsLeftButtonPressed(t)?this.draggingObject&&(!this.draggingObject.element&&(Math.abs(t.pageX-this.mouseDownPoint.x)>this.dragStartLimit||Math.abs(t.pageY-this.mouseDownPoint.y)>this.dragStartLimit)&&(this.draggingObject.element=this.createDraggingElement(this.draggingObject),void 0!==this.draggingObject.captured&&this.capture(this.draggingObject.captured,!0)),this.draggingObject.element&&this.updateDraggingElementPosition(t)):this.finishDragging()},t.prototype.onMouseUp=function(t){this.finishDragging()},t.prototype.updateDraggingElementPosition=function(t){var e=this.draggingObject.element,n=t.pageX-e.offsetWidth/2,o=t.pageY-e.offsetHeight/2;r.SetAbsoluteX(e,n),r.SetAbsoluteY(e,o)},t.prototype.finishDragging=function(){if(this.draggingObject){this.onDragEnd();var t=this.draggingObject.element;t&&t.parentNode.removeChild(t)}delete this.draggingObject},t.prototype.capture=function(t,e){this.draggingObject&&(this.draggingObject.captured!==t||e)&&(this.draggingObject.captured=t,this.draggingObject.element&&this.draggingObject.element.classList.toggle("dxdi-tb-drag-captured",t))},t.prototype.onDragEnd=function(){this.onDragOperation.raise("NotifyToolboxDragEnd")},t.prototype.onDragStart=function(){this.onDragOperation.raise("NotifyToolboxDragStart")},t}();e.Toolbox=s;var a=function(t){this.evt=t};e.ToolboxDraggingObject=a;var c=function(){};e.DiagramDraggingEvent=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(8),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!this.control.selection.isEmpty())},e.prototype.executeCore=function(t){return a.ModelUtils.deleteSelection(this.control.history,this.control.model,this.control.selection),!0},e}(r.CommandBase);e.DeleteCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var o=t.call(this)||this;return o.shapeKey=e,o.position=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);this.oldPosition=e.position.clone(),t.moveShape(e,this.position)},e.prototype.undo=function(t){var e=t.model.findShape(this.shapeKey);t.moveShape(e,this.oldPosition)},e}(n(4).HistoryItem);e.MoveShapeHistoryItem=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(19),i=function(){function t(){}return t.ArrayInsert=function(t,e,n){if(0<=n&&n<t.length){for(var o=t.length;o>n;o--)t[o]=t[o-1];t[n]=e}else t.push(e)},t.ArrayRemove=function(e,n){var o=t.ArrayIndexOf(e,n);o>-1&&t.ArrayRemoveAt(e,o)},t.ArrayRemoveAt=function(t,e){if(e>=0&&e<t.length){for(var n=e;n<t.length-1;n++)t[n]=t[n+1];t.pop()}},t.ArrayClear=function(t){for(;t.length>0;)t.pop()},t.ArrayIndexOf=function(t,e,n){if(n){for(o=0;o<t.length;o++)if(n(t[o],e))return o}else for(var o=0;o<t.length;o++)if(t[o]==e)return o;return-1},t.ArrayContains=function(e,n){return t.ArrayIndexOf(e,n)>=0},t.ArrayEqual=function(t,e){var n=t.length;if(n!=e.length)return!1;for(var o=0;o<n;o++)if(t[o]!=e[o])return!1;return!0},t.ArraySame=function(e,n){return e.length===n.length&&e.every(function(e){return t.ArrayContains(n,e)})},t.ArrayGetIntegerEdgeValues=function(e){var n=t.CollectionToArray(e);return t.ArrayIntegerAscendingSort(n),{start:n[0],end:n[n.length-1]}},t.ArrayIntegerAscendingSort=function(e){t.ArrayIntegerSort(e,!1)},t.ArrayIntegerSort=function(t,e){t.sort(function(t,n){var o=0;return t>n?o=1:t<n&&(o=-1),e&&(o*=-1),o})},t.CollectionsUnionToArray=function(t,e){for(var n=[],o=t.length,i=e.length,r=0;r<o+i;r++)r<o?n.push(t[r]):n.push(e[r-o]);return n},t.CollectionToArray=function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e},t.CreateHashTableFromArray=function(t){for(var e=[],n=0;n<t.length;n++)e[t[n]]=1;return e},t.CreateIndexHashTableFromArray=function(t){for(var e=[],n=0;n<t.length;n++)e[t[n]]=n;return e},t.ArrayToHash=function(t,e,n){return t instanceof Array?t.reduce(function(t,o,i){var r=e(o,i),s=n(o,i);return t[r]=s,t},{}):{}},t.Sum=function(t,e){return t instanceof Array?t.reduce(function(t,n){var i=e?e(n):n;return o.IsNumber(i)||(i=0),t+i},0):0},t.Min=function(e,n){return t.CalculateArrayMinMax(e,n,!1)},t.Max=function(e,n){return t.CalculateArrayMinMax(e,n,!0)},t.NearestLeftBinarySearchComparer=function(t,e,n){var o=t[e],i=o<n;return i&&e==t.length-1||i&&t[e+1]>=n?0:o<n?-1:1},t.ArrayBinarySearch=function(e,n,i,r,s){i||(i=t.defaultBinarySearchComparer),o.IsExists(r)||(r=0),o.IsExists(s)||(s=e.length-r);for(var a=r+s-1;r<=a;){var c=r+(a-r>>1),u=i(e,c,n);if(0==u)return c;u<0?r=c+1:a=c-1}return-(r+1)},t.ArrayFlatten=function(t){return[].concat.apply([],t)},t.GetDistinctArray=function(e){for(var n=[],o=0;o<e.length;o++){var i=e[o];-1==t.ArrayIndexOf(n,i)&&n.push(i)}return n},t.ForEach=function(t,e){if(Array.prototype.forEach)Array.prototype.forEach.call(t,e);else for(var n=0,o=t.length;n<o;n++)e(t[n],n,t)},t.MergeHashTables=function(t,e){if(!e||"string"==typeof e)return t;for(var n in t||(t={}),e)!n||n in t||(t[n]=e[n]);return t},t.Range=function(t,e){return(t=parseInt(t)||0)<0&&(t=0),(e=parseInt(e)||0)<0&&(e=0),Array.apply(null,Array(t)).map(function(t,n){return e+n})},t.CalculateArrayMinMax=function(t,e,n){if(!(t instanceof Array))return 0;var i=n?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;return t.reduce(function(t,r){var s=e?e(r):r;return o.IsNumber(s)||(s=i),(n?Math.max:Math.min)(s,t)},i)},t.defaultBinarySearchComparer=function(t,e,n){var o=t[e];return o==n?0:o<n?-1:1},t}();e.Data=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(19),i=function(){function t(){}return t.TrimStart=function(e){return t.trimInternal(e,!0,!1)},t.TrimEnd=function(e){return t.trimInternal(e,!1,!0)},t.Trim=function(e){return t.trimInternal(e,!0,!0)},t.EncodeHtml=function(e){return t.ApplyReplacement(e,[[/&amp;/g,"&ampx;"],[/&/g,"&amp;"],[/&quot;/g,"&quotx;"],[/"/g,"&quot;"],[/&lt;/g,"&ltx;"],[/</g,"&lt;"],[/&gt;/g,"&gtx;"],[/>/g,"&gt;"]])},t.trimInternal=function(e,n,o){var i=e.length;if(!i)return e;if(i<764833){var r=e;return n&&(r=r.replace(/^\s+/,"")),o&&(r=r.replace(/\s+$/,"")),r}var s=0;if(o)for(;i>0&&t.whiteSpaces[e.charCodeAt(i-1)];)i--;if(n&&i>0)for(;s<i&&t.whiteSpaces[e.charCodeAt(s)];)s++;return e.substring(s,i)},t.ApplyReplacement=function(t,e){for(var n=0;n<e.length;n++){var o=e[n];t=t.replace(o[0],o[1])}return t},t.DecodeHtmlViaTextArea=function(t){var e=document.createElement("TEXTAREA");return o.setInnerHtmlInternal(e,t),e.value},t.whiteSpaces={9:1,10:1,11:1,12:1,13:1,32:1,133:1,160:1,5760:1,6158:1,8192:1,8193:1,8194:1,8195:1,8196:1,8197:1,8198:1,8199:1,8200:1,8201:1,8202:1,8203:1,8232:1,8233:1,8239:1,8287:1,12288:1},t}();e.Str=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(20),i=function(){function t(){}return t.SetAttribute=function(e,n,o){e.setAttribute?(t.isSourceResetRequired()&&"src"===n.toLowerCase()&&e.setAttribute(n,""),e.setAttribute(n,o)):e.setProperty&&e.setProperty(n,o,"")},t.GetAttribute=function(t,e){if(t.getAttribute)return t.getAttribute(e);if(t.getPropertyValue){if(o.Browser.Firefox)try{return t.getPropertyValue(e)}catch(n){return t[e]}return t.getPropertyValue(e)}return null},t.GetTabIndexAttributeName=function(){return o.Browser.IE?"tabIndex":"tabindex"},t.ChangeStyleAttribute=function(e,n,o){t.ChangeAttributeExtended(e.style,n,e,"saved"+n,o)},t.ChangeAttributeExtended=function(e,n,o,i,r){t.SaveAttribute(e,n,o,i),t.SetAttribute(e,n,r)},t.SaveAttribute=function(e,n,o,i){if(!t.IsExistsAttribute(o,i)){var r=t.IsExistsAttribute(e,n)?t.GetAttribute(e,n):t.EmptyObject;t.SetAttribute(o,i,r)}},t.RestoreAttributeExtended=function(e,n,o,i){if(t.IsExistsAttribute(o,i)){var r=t.GetAttribute(o,i);return r!=t.EmptyObject?t.SetAttribute(e,n,r):t.RemoveAttribute(e,n),t.RemoveAttribute(o,i),!0}return!1},t.RemoveAttribute=function(t,e){t.removeAttribute?t.removeAttribute(e):t.removeProperty&&t.removeProperty(e)},t.IsExistsAttribute=function(e,n){var o=t.GetAttribute(e,n);return null!=o&&""!==o},t.isSourceResetRequired=function(){return o.Browser.IE&&o.Browser.MajorVersion>=11},t.EmptyObject={},t.RestoreStyleAttribute=function(e,n){return t.RestoreAttributeExtended(e.style,n,e,"saved"+n)},t}();e.Attr=i},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(71),s=n(27),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPoints=function(){return this.connector.points.map(function(t,e){return new s.ConnectorRenderPoint(t.x,t.y,e)})},e}(r.ConnectorPointsCalculatorBase);e.ConnectorPointsCalculator=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=n(3),a=n(71),c=n(107),u=n(108),p=n(109),h=n(110),l=n(111),d=n(27),f=function(t){function e(e){var n=t.call(this,e)||this;return n.sideCalculators={},n.sideCalculators[s.ConnectionPointSide.Undefined]=new c.ConnectorPointsOrthogonalUndefinedSideCalculator(n),n.sideCalculators[s.ConnectionPointSide.South]=new u.ConnectorPointsOrthogonalSouthSideCalculator(n),n.sideCalculators[s.ConnectionPointSide.North]=new p.ConnectorPointsOrthogonalNorthSideCalculator(n),n.sideCalculators[s.ConnectionPointSide.East]=new h.ConnectorPointsOrthogonalEastSideCalculator(n),n.sideCalculators[s.ConnectionPointSide.West]=new l.ConnectorPointsOrthogonalWestSideCalculator(n),n}return i(e,t),Object.defineProperty(e.prototype,"beginRect",{get:function(){return this.connector.beginItem?this.connector.beginItem.rectangle:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endRect",{get:function(){return this.connector.endItem?this.connector.endItem.rectangle:void 0},enumerable:!0,configurable:!0}),e.prototype.getPoints=function(){var t=this.connector.points.map(function(t,e){return new d.ConnectorRenderPoint(t.x,t.y,e)});this.removeUnnecessaryLinePoints(t);var e=0,n=t.length-1,o=this.getPointSide(t,0),i=this.getPointSide(t,1),r=this.getPointSide(t,t.length-1),s=this.getPointSide(t,t.length-1-1),a=this.getSideCalculator(o),c=this.getSideCalculator(r),u=this.beginRect,p=a.getCorrectOriginPoint(t[e],u),h=t[e+1];if(2===t.length&&a.isOnSidePoint(p,h)&&a.isDirectConnectionAllowed(i,p,h)){a.getDirectConnectionPoints(p,h).forEach(function(o){t.splice(e+1,0,o),e++,n++})}else{var l=a.getBeginOffsetPoints(i,t[e],t[e+1],this.beginRect);l.forEach(function(n){t.splice(e+1,0,n)}),e+=l.length,n+=l.length,c.getEndOffsetPoints(s,t[n],t[n-1],this.endRect).forEach(function(e,o){t.splice(n+o,0,e)});for(var f=e;f<n;f++){var y=f+1,m=this.getMiddlePoint(t[f],t[f-1],f-1==0,t[y],t[y+1],y+1===t.length-1);void 0!==m&&(t.splice(f+1,0,m),f++,n++)}}return this.removeUnnecessaryLinePoints(t),t},e.prototype.getSideCalculator=function(t){return this.sideCalculators[t]},e.prototype.getPointSide=function(t,e){if(0===e&&this.connector.beginItem){var n=this.connector.beginConnectionPointIndex;return this.connector.beginItem.getConnectionPointSide(n,t[1])}if(e===t.length-1&&this.connector.endItem){n=this.connector.endConnectionPointIndex;return this.connector.endItem.getConnectionPointSide(n,t[t.length-2])}return s.ConnectionPointSide.Undefined},e.prototype.getMiddlePoints=function(t,e){return t.x===e.x||t.y===e.y?[]:[new d.ConnectorRenderPoint(t.x,e.y),new d.ConnectorRenderPoint(e.x,t.y)]},e.prototype.getMiddlePoint=function(t,e,n,o,i,r){var s,a=this,c=this.getMiddlePoints(t,o);return c.forEach(function(n){var r=a.createPointsRect(t,n),c=a.createPointsRect(n,o),u=a.connector.beginItem?a.connector.beginItem.rectangle:void 0,p=a.connector.endItem?a.connector.endItem.rectangle:void 0;u&&(u.intersect(r)||u.intersect(c))||p&&(p.intersect(r)||p.intersect(c))||a.isReturnPoint(n,t,e)&&!a.isIntermediatePoints(t,e)||a.isReturnPoint(n,o,i)&&!a.isIntermediatePoints(o,i)||(void 0===s?s=n:a.isPriorMiddlePoint(n,t,e,o,i)&&(s=n))}),void 0===s&&c.length>0&&(s=c[0]),s},e.prototype.createPointsRect=function(t,e){var n=r.Rectangle.createByPoints(t,e);return n.width>0&&(n=n.inflate(-1,0)),n.height>0&&(n=n.inflate(0,-1)),n},e.prototype.isPriorMiddlePoint=function(t,e,n,o,i){return!(!n||t.x!==n.x&&t.y!==n.y)||!(!i||t.x!==i.x&&t.y!==i.y)},e.prototype.isReturnPoint=function(t,e,n){if(void 0!==e&&void 0!==n){if(t.x===n.x&&(e.y<t.y&&t.y<n.y||e.y>t.y&&t.y>n.y))return!0;if(t.y===n.y&&(e.x<t.x&&t.x<n.x||e.x>t.x&&t.x>n.x))return!0}return!1},e.prototype.isIntermediatePoints=function(t,e){return 0<t.pointIndex&&t.pointIndex<this.connector.points.length-1&&0<e.pointIndex&&e.pointIndex<this.connector.points.length-1},e.prototype.removeUnnecessaryLinePoints=function(t){r.GeometryUtils.removeUnnecessaryLinePoints(t,function(e,n){return-1===e.pointIndex?(t.splice(n,1),!0):(e.skipped=!0,!1)},function(t){return void 0!==t&&!t.skipped})},e}(a.ConnectorPointsCalculatorBase);e.ConnectorPointsOrthogonalCalculator=f},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(33),s=n(27),a=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getCorrectOriginPoint=function(t,e){return t},e.prototype.getSameShapeOffsetPoints=function(t,e,n,o){return[]},e.prototype.getOverlappedPointsOffsetPoints=function(t,e,n,o){return[]},e.prototype.getBeginOverlappedShapeOffsetPoints=function(t,e,n,o){return[]},e.prototype.getEndOverlappedShapeOffsetPoints=function(t,e,n,o){return[]},e.prototype.getBeginOnSideOffsetPoints=function(t,e,n,o){return[]},e.prototype.getEndOnSideOffsetPoints=function(t,e,n,o){return[]},e.prototype.getBeginOffSideOffsetPoints=function(t,e,n,o){return[]},e.prototype.getEndOffSideOffsetPoints=function(t,e,n,o){return[]},e.prototype.isOnSidePoint=function(t,e){return!0},e.prototype.isDirectConnectionAllowed=function(t,e,n){var o=this.getSideCalculator(e,n);return void 0===o||o.isDirectConnectionAllowed(t,e,n)},e.prototype.getDirectConnectionPoints=function(t,e){var n=Math.abs(e.x-t.x),o=Math.abs(e.y-t.y);if(n>o){var i=Math.min(t.x,e.x)+n/2;return[new s.ConnectorRenderPoint(i,t.y),new s.ConnectorRenderPoint(i,e.y)]}var r=Math.min(t.y,e.y)+o/2;return[new s.ConnectorRenderPoint(t.x,r),new s.ConnectorRenderPoint(e.x,r)]},e}(r.ConnectorPointsOrthogonalSideCalculatorBase);e.ConnectorPointsOrthogonalUndefinedSideCalculator=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),s=n(33),a=n(27),c=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getCorrectOriginPoint=function(t,e){return t.y<e.bottom&&(t=t.offset(0,e.bottom-t.y)),t},e.prototype.getSameShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:case r.ConnectionPointSide.West:case r.ConnectionPointSide.South:return[e.offset(0,this.getMinOffset())];case r.ConnectionPointSide.North:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset())}},e.prototype.getOverlappedPointsOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.South:return[e.offset(0,this.getMinOffset())];case r.ConnectionPointSide.North:return[e.offset(0,-this.getMinOffset())]}return[]},e.prototype.getBeginOverlappedShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:return e.y<n.y?e.x>n.x?[]:[e.offset(0,this.getMinOffset())]:e.y>this.endRect.bottom?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):[e.offset(0,this.getMinOffset())];case r.ConnectionPointSide.West:return e.y<n.y?e.x<n.x?[]:[e.offset(0,this.getMinOffset())]:e.y>this.endRect.bottom?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):[e.offset(0,this.getMinOffset())];case r.ConnectionPointSide.South:return[e.offset(0,this.getMinOffset())];case r.ConnectionPointSide.North:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),e.x<n.x)}},e.prototype.getEndOverlappedShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:return n.y<e.y?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):e.x<n.x?[e.offset(0,this.getMinOffset())]:[];case r.ConnectionPointSide.West:return n.y<e.y?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):e.x>n.x?[e.offset(0,this.getMinOffset())]:[];case r.ConnectionPointSide.South:return[e.offset(0,this.getMinOffset())];case r.ConnectionPointSide.North:var i=this.getMinOffset();return this.beginRect.bottom>e.y&&(i+=this.beginRect.bottom-e.y),[e.offset(0,i)]}},e.prototype.getBeginOnSideOffsetPoints=function(t,e,n,o){return[e.offset(0,this.getScaleableOffsetY(e,n,!1))]},e.prototype.getEndOnSideOffsetPoints=function(t,e,n,o){return[e.offset(0,this.getScaleableOffsetY(e,n,!0))]},e.prototype.getBeginOffSideOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:if(this.isBeginEndOverlappedX())return this.getScaleableAsideOffsetPoints(e,n,o,!1,!1);break;case r.ConnectionPointSide.West:if(this.isBeginEndOverlappedX())return this.getScaleableAsideOffsetPoints(e,n,o,!1,!0);break;case r.ConnectionPointSide.South:if(this.isBeginEndOverlappedX())return this.getScaleableAsideOffsetPoints(e,n,o,!1);break;case r.ConnectionPointSide.Undefined:case r.ConnectionPointSide.North:return this.getScaleableAsideOffsetPoints(e,n,o,!1)}return[e.offset(0,this.getScaleableOffsetY(e,n,!1))]},e.prototype.getEndOffSideOffsetPoints=function(t,e,n,o){if(t===r.ConnectionPointSide.Undefined)return this.getScaleableAsideOffsetPoints(e,n,o,!0);if(this.isBeginEndOverlappedX()){var i=this.beginRect.center.x>this.endRect.center.x;return this.getScaleableAsideOffsetPoints(e,n,o,!0,i)}return[e.offset(0,this.getScaleableOffsetY(e,n,!0))]},e.prototype.getAsideOffsetPoints=function(t,e,n,o,i,r){var s=[];return void 0!==n&&(void 0===r&&(r=e.x<t.x),r?s.push(t.offset(-(t.x-n.left+i),o)):s.push(t.offset(n.right-t.x+i,o))),s.push(t.offset(0,o)),s},e.prototype.getScaleableAsideOffsetPoints=function(t,e,n,o,i){var r=this.getScaleableOffsetY(t,e,o),s=this.getScaleableOffsetX(t,e,o);return this.getAsideOffsetPoints(t,e,n,r,s,i)},e.prototype.getScaleableOffsetX=function(t,e,n){if(this.beginRect&&this.endRect&&!n&&!this.isBeginEndOverlappedX()){var o=void 0;if((o=e.x<t.x?this.beginRect.left-this.endRect.right:this.endRect.left-this.beginRect.right)<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.getScaleableOffsetY=function(t,e,n){if(this.beginRect&&this.endRect){var o=n?this.beginRect.top-t.y:this.endRect.top-t.y;if(o>0&&o<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.isOnSidePoint=function(t,e){return e.y>t.y},e.prototype.isDirectConnectionAllowed=function(t,e,n){return t===r.ConnectionPointSide.North||t===r.ConnectionPointSide.Undefined},e.prototype.getDirectConnectionPoints=function(t,e){var n=t.y+(e.y-t.y)/2;return[new a.ConnectorRenderPoint(t.x,n),new a.ConnectorRenderPoint(e.x,n)]},e}(s.ConnectorPointsOrthogonalSideCalculatorBase);e.ConnectorPointsOrthogonalSouthSideCalculator=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),s=n(33),a=n(27),c=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getCorrectOriginPoint=function(t,e){return t.y>e.top&&(t=t.offset(0,e.top-t.y)),t},e.prototype.getSameShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:case r.ConnectionPointSide.West:case r.ConnectionPointSide.North:return[e.offset(0,-this.getMinOffset())];case r.ConnectionPointSide.South:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset())}},e.prototype.getOverlappedPointsOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.South:return[e.offset(0,this.getMinOffset())];case r.ConnectionPointSide.North:return[e.offset(0,-this.getMinOffset())]}return[]},e.prototype.getBeginOverlappedShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:return e.y>n.y?e.x>n.x?[]:[e.offset(0,-this.getMinOffset())]:e.y<this.endRect.top?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):[e.offset(0,-this.getMinOffset())];case r.ConnectionPointSide.West:return e.y>n.y?e.x<n.x?[]:[e.offset(0,-this.getMinOffset())]:e.y<this.endRect.top?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):[e.offset(0,-this.getMinOffset())];case r.ConnectionPointSide.North:return[e.offset(0,-this.getMinOffset())];case r.ConnectionPointSide.South:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),e.x<n.x)}},e.prototype.getEndOverlappedShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:return n.y>e.y?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):e.x<n.x?[e.offset(0,-this.getMinOffset())]:[];case r.ConnectionPointSide.West:return n.y>e.y?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):e.x>n.x?[e.offset(0,-this.getMinOffset())]:[];case r.ConnectionPointSide.North:return[e.offset(0,-this.getMinOffset())];case r.ConnectionPointSide.South:var i=-this.getMinOffset();return this.beginRect.top<e.y&&(i-=e.y-this.beginRect.top),[e.offset(0,i)]}},e.prototype.getBeginOnSideOffsetPoints=function(t,e,n,o){return[e.offset(0,-this.getScaleableOffsetY(e,n,!1))]},e.prototype.getEndOnSideOffsetPoints=function(t,e,n,o){return[e.offset(0,-this.getScaleableOffsetY(e,n,!0))]},e.prototype.getBeginOffSideOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:if(this.isBeginEndOverlappedX())return this.getScaleableAsideOffsetPoints(e,n,o,!1,!1);break;case r.ConnectionPointSide.West:if(this.isBeginEndOverlappedX())return this.getScaleableAsideOffsetPoints(e,n,o,!1,!0);break;case r.ConnectionPointSide.North:if(this.isBeginEndOverlappedX())return this.getScaleableAsideOffsetPoints(e,n,o,!1);break;case r.ConnectionPointSide.Undefined:case r.ConnectionPointSide.South:return this.getScaleableAsideOffsetPoints(e,n,o,!1)}return[e.offset(0,-this.getScaleableOffsetY(e,n,!1))]},e.prototype.getEndOffSideOffsetPoints=function(t,e,n,o){if(t===r.ConnectionPointSide.Undefined)return this.getScaleableAsideOffsetPoints(e,n,o,!0);if(this.isBeginEndOverlappedX()){var i=this.beginRect.center.x>this.endRect.center.x;return this.getScaleableAsideOffsetPoints(e,n,o,!0,i)}return[e.offset(0,-this.getScaleableOffsetY(e,n,!0))]},e.prototype.getAsideOffsetPoints=function(t,e,n,o,i,r){var s=[];return void 0!==n&&(void 0===r&&(r=e.x<t.x),r?s.push(t.offset(-(t.x-n.left+i),-o)):s.push(t.offset(n.right-t.x+i,-o))),s.push(t.offset(0,-o)),s},e.prototype.getScaleableAsideOffsetPoints=function(t,e,n,o,i){var r=this.getScaleableOffsetY(t,e,o),s=this.getScaleableOffsetX(t,e,o);return this.getAsideOffsetPoints(t,e,n,r,s,i)},e.prototype.getScaleableOffsetX=function(t,e,n){if(this.beginRect&&this.endRect&&!n&&!this.isBeginEndOverlappedX()){var o=void 0;if((o=e.x<t.x?this.beginRect.left-this.endRect.right:this.endRect.left-this.beginRect.right)<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.getScaleableOffsetY=function(t,e,n){if(this.beginRect&&this.endRect){var o=n?t.y-this.beginRect.bottom:t.y-this.endRect.bottom;if(o>0&&o<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.isOnSidePoint=function(t,e){return e.y<t.y},e.prototype.isDirectConnectionAllowed=function(t,e,n){return t===r.ConnectionPointSide.South||t===r.ConnectionPointSide.Undefined},e.prototype.getDirectConnectionPoints=function(t,e){var n=e.y+(t.y-e.y)/2;return[new a.ConnectorRenderPoint(t.x,n),new a.ConnectorRenderPoint(e.x,n)]},e}(s.ConnectorPointsOrthogonalSideCalculatorBase);e.ConnectorPointsOrthogonalNorthSideCalculator=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),s=n(33),a=n(27),c=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getCorrectOriginPoint=function(t,e){return t.x<e.right&&(t=t.offset(e.right-t.x,0)),t},e.prototype.getSameShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.North:case r.ConnectionPointSide.South:case r.ConnectionPointSide.East:return[e.offset(this.getMinOffset(),0)];case r.ConnectionPointSide.West:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset())}},e.prototype.getOverlappedPointsOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:return[e.offset(this.getMinOffset(),0)];case r.ConnectionPointSide.West:return[e.offset(-this.getMinOffset(),0)]}return[]},e.prototype.getBeginOverlappedShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.North:return e.x<n.x?e.y<n.y?[]:[e.offset(this.getMinOffset(),0)]:e.x>this.endRect.right?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):[e.offset(this.getMinOffset(),0)];case r.ConnectionPointSide.South:return e.x<n.x?e.y>n.y?[]:[e.offset(this.getMinOffset(),0)]:e.x>this.endRect.right?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):[e.offset(this.getMinOffset(),0)];case r.ConnectionPointSide.East:return[e.offset(this.getMinOffset(),0)];case r.ConnectionPointSide.West:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),e.y<n.y)}},e.prototype.getEndOverlappedShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:return[e.offset(this.getMinOffset(),0)];case r.ConnectionPointSide.West:var i=this.getMinOffset();return this.beginRect.right>e.x&&(i+=this.beginRect.right-e.x),[e.offset(i,0)];case r.ConnectionPointSide.North:return n.x<e.x?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):e.y>n.y?[e.offset(this.getMinOffset(),0)]:[];case r.ConnectionPointSide.South:return n.x<e.x?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):e.y<n.y?[e.offset(this.getMinOffset(),0)]:[]}},e.prototype.getBeginOnSideOffsetPoints=function(t,e,n,o){return[e.offset(this.getScaleableOffsetX(e,n,!1),0)]},e.prototype.getEndOnSideOffsetPoints=function(t,e,n,o){return[e.offset(this.getScaleableOffsetX(e,n,!0),0)]},e.prototype.getBeginOffSideOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.South:if(this.isBeginEndOverlappedY())return this.getScaleableAsideOffsetPoints(e,n,o,!1,!1);break;case r.ConnectionPointSide.North:if(this.isBeginEndOverlappedY())return this.getScaleableAsideOffsetPoints(e,n,o,!1,!0);break;case r.ConnectionPointSide.East:if(this.isBeginEndOverlappedY())return this.getScaleableAsideOffsetPoints(e,n,o,!1);break;case r.ConnectionPointSide.Undefined:case r.ConnectionPointSide.West:return this.getScaleableAsideOffsetPoints(e,n,o,!1)}return[e.offset(this.getScaleableOffsetX(e,n,!1),0)]},e.prototype.getEndOffSideOffsetPoints=function(t,e,n,o){if(t===r.ConnectionPointSide.Undefined)return this.getScaleableAsideOffsetPoints(e,n,o,!0);if(this.isBeginEndOverlappedY()){var i=this.beginRect.center.y>this.endRect.center.y;return this.getScaleableAsideOffsetPoints(e,n,o,!0,i)}return[e.offset(this.getScaleableOffsetX(e,n,!0),0)]},e.prototype.getAsideOffsetPoints=function(t,e,n,o,i,r){var s=[];return void 0!==n&&(void 0===r&&(r=e.y<t.y),r?s.push(t.offset(o,-(t.y-n.top+i))):s.push(t.offset(o,n.bottom-t.y+i))),s.push(t.offset(o,0)),s},e.prototype.getScaleableAsideOffsetPoints=function(t,e,n,o,i){var r=this.getScaleableOffsetX(t,e,o),s=this.getScaleableOffsetY(t,e,o);return this.getAsideOffsetPoints(t,e,n,r,s,i)},e.prototype.getScaleableOffsetX=function(t,e,n){if(this.beginRect&&this.endRect){var o=n?this.beginRect.left-t.x:this.endRect.left-t.x;if(o>0&&o<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.getScaleableOffsetY=function(t,e,n){if(this.beginRect&&this.endRect&&!n&&!this.isBeginEndOverlappedY()){var o=void 0;if((o=e.y<t.y?this.beginRect.top-this.endRect.bottom:this.endRect.top-this.beginRect.bottom)<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.isOnSidePoint=function(t,e){return e.x>t.x},e.prototype.isDirectConnectionAllowed=function(t,e,n){return t===r.ConnectionPointSide.West||t===r.ConnectionPointSide.Undefined},e.prototype.getDirectConnectionPoints=function(t,e){var n=t.x+(e.x-t.x)/2;return[new a.ConnectorRenderPoint(n,t.y),new a.ConnectorRenderPoint(n,e.y)]},e}(s.ConnectorPointsOrthogonalSideCalculatorBase);e.ConnectorPointsOrthogonalEastSideCalculator=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),s=n(33),a=n(27),c=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getCorrectOriginPoint=function(t,e){return t.x>e.left&&(t=t.offset(e.left-t.x,0)),t},e.prototype.getSameShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.North:case r.ConnectionPointSide.South:case r.ConnectionPointSide.West:return[e.offset(-this.getMinOffset(),0)];case r.ConnectionPointSide.East:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset())}},e.prototype.getOverlappedPointsOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:return[e.offset(this.getMinOffset(),0)];case r.ConnectionPointSide.West:return[e.offset(-this.getMinOffset(),0)]}return[]},e.prototype.getBeginOverlappedShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.North:return e.x>n.x?e.y<n.y?[]:[e.offset(-this.getMinOffset(),0)]:e.x<this.endRect.left?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):[e.offset(-this.getMinOffset(),0)];case r.ConnectionPointSide.South:return e.x>n.x?e.y>n.y?[]:[e.offset(-this.getMinOffset(),0)]:e.x<this.endRect.left?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):[e.offset(-this.getMinOffset(),0)];case r.ConnectionPointSide.West:return[e.offset(-this.getMinOffset(),0)];case r.ConnectionPointSide.East:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),e.y<n.y)}},e.prototype.getEndOverlappedShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:var i=-this.getMinOffset();return this.beginRect.left<e.x&&(i-=e.x-this.beginRect.left),[e.offset(i,0)];case r.ConnectionPointSide.West:return[e.offset(-this.getMinOffset(),0)];case r.ConnectionPointSide.North:return n.x>e.x?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):e.y>n.y?[e.offset(-this.getMinOffset(),0)]:[];case r.ConnectionPointSide.South:return n.x>e.x?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):e.y<n.y?[e.offset(-this.getMinOffset(),0)]:[]}},e.prototype.getBeginOnSideOffsetPoints=function(t,e,n,o){return[e.offset(-this.getScaleableOffsetX(e,n,!1),0)]},e.prototype.getEndOnSideOffsetPoints=function(t,e,n,o){return[e.offset(-this.getScaleableOffsetX(e,n,!0),0)]},e.prototype.getBeginOffSideOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.South:if(this.isBeginEndOverlappedY())return this.getScaleableAsideOffsetPoints(e,n,o,!1,!1);break;case r.ConnectionPointSide.North:if(this.isBeginEndOverlappedY())return this.getScaleableAsideOffsetPoints(e,n,o,!1,!0);break;case r.ConnectionPointSide.West:if(this.isBeginEndOverlappedY())return this.getScaleableAsideOffsetPoints(e,n,o,!1);break;case r.ConnectionPointSide.Undefined:case r.ConnectionPointSide.East:return this.getScaleableAsideOffsetPoints(e,n,o,!1)}return[e.offset(-this.getScaleableOffsetX(e,n,!1),0)]},e.prototype.getEndOffSideOffsetPoints=function(t,e,n,o){if(t===r.ConnectionPointSide.Undefined)return this.getScaleableAsideOffsetPoints(e,n,o,!0);if(this.isBeginEndOverlappedY()){var i=this.beginRect.center.y>this.endRect.center.y;return this.getScaleableAsideOffsetPoints(e,n,o,!0,i)}return[e.offset(-this.getScaleableOffsetX(e,n,!0),0)]},e.prototype.getAsideOffsetPoints=function(t,e,n,o,i,r){var s=[];return void 0!==n&&(void 0===r&&(r=e.y<t.y),r?s.push(t.offset(-o,-(t.y-n.top+i))):s.push(t.offset(-o,n.bottom-t.y+i))),s.push(t.offset(-o,0)),s},e.prototype.getScaleableAsideOffsetPoints=function(t,e,n,o,i){var r=this.getScaleableOffsetX(t,e,o),s=this.getScaleableOffsetY(t,e,o);return this.getAsideOffsetPoints(t,e,n,r,s,i)},e.prototype.getScaleableOffsetX=function(t,e,n){if(this.beginRect&&this.endRect){var o=n?t.x-this.beginRect.right:t.x-this.endRect.right;if(o>0&&o<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.getScaleableOffsetY=function(t,e,n){if(this.beginRect&&this.endRect&&!n&&!this.isBeginEndOverlappedY()){var o=void 0;if((o=e.y<t.y?this.beginRect.top-this.endRect.bottom:this.endRect.top-this.beginRect.bottom)<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.isOnSidePoint=function(t,e){return e.x<t.x},e.prototype.isDirectConnectionAllowed=function(t,e,n){return t===r.ConnectionPointSide.East||t===r.ConnectionPointSide.Undefined},e.prototype.getDirectConnectionPoints=function(t,e){var n=e.x+(t.x-e.x)/2;return[new a.ConnectorRenderPoint(n,t.y),new a.ConnectorRenderPoint(n,e.y)]},e}(s.ConnectorPointsOrthogonalSideCalculatorBase);e.ConnectorPointsOrthogonalWestSideCalculator=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(t,e){this.position=t,this.value=e};e.ConnectorText=o;var i=function(){function t(){this.items={}}return t.prototype.get=function(t){return this.items[t]},t.prototype.set=function(t,e){this.items[t]=e},t.prototype.remove=function(t){delete this.items[t]},t.prototype.forEach=function(t){for(var e in this.items)this.items.hasOwnProperty(e)&&t(this.items[e])},t.prototype.clone=function(){var e=new t;return this.forEach(function(t){e.set(t.position,new o(t.position,t.value))}),e},t.prototype.toObject=function(){var t={},e=!1;return this.forEach(function(n){t[n.position]=n.value,e=!0}),e?t:null},t.prototype.fromObject=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=parseFloat(e);isNaN(n)||"string"!=typeof t[e]||this.set(n,new o(n,t[e]))}},t}();e.ConnectorTexts=i},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=function(t){function e(e,n,o,i,r){var s=t.call(this)||this;return s.id=e,s.x=n,s.y=o,s.width=i,s.height=r,s}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"filter")},e.prototype.applyElementProperties=function(e){this.id&&e.setAttribute("id",this.id),this.setUnitAttribute(e,"x",this.x),this.setUnitAttribute(e,"y",this.y),this.setUnitAttribute(e,"width",this.width),this.setUnitAttribute(e,"height",this.height),t.prototype.applyElementProperties.call(this,e)},e}(n(15).SvgPrimitive);e.FilterPrimitive=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),s=n(0),a=function(t){function e(e){var n=t.call(this)||this;return n.offset=e,n}return i(e,t),e.prototype.redo=function(t){this.oldSize=t.model.size.clone(),this.backOffset=new s.Offset(-this.offset.left,-this.offset.top,-this.offset.right,-this.offset.bottom);var e=Math.max(this.oldSize.width+this.offset.left+this.offset.right,t.model.pageWidth),n=Math.max(this.oldSize.height+this.offset.top+this.offset.bottom,t.model.pageHeight);t.changeModelSize(new s.Size(e,n),this.offset)},e.prototype.undo=function(t){t.changeModelSize(this.oldSize,this.backOffset)},e}(r.HistoryItem);e.ModelResizeHistoryItem=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),s=n(9),a=n(5),c=function(t){function e(e,n){var o=t.call(this)||this;return o.offsetX=e,o.offsetY=n,o}return i(e,t),e.prototype.redo=function(t){var e=this;t.model.iterateItems(function(n){n instanceof s.Shape&&t.moveShape(n,n.position.offset(e.offsetX,e.offsetY)),n instanceof a.Connector&&n.points.forEach(function(o,i){return t.moveConnectorPoint(n,i,o.offset(e.offsetX,e.offsetY))})})},e.prototype.undo=function(t){var e=this;t.model.iterateItems(function(n){n instanceof s.Shape&&t.moveShape(n,n.position.offset(-e.offsetX,-e.offsetY)),n instanceof a.Connector&&n.points.forEach(function(o,i){return t.moveConnectorPoint(n,i,o.offset(-e.offsetX,-e.offsetY))})})},e}(r.HistoryItem);e.UpdatePositionsOnPageResizeHistoryItem=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var o=t.call(this)||this;return o.connectorKey=e,o.pointIndex=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);this.point=e.points[this.pointIndex].clone(),t.deleteConnectorPoint(e,this.pointIndex)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.addConnectorPoint(e,this.pointIndex,this.point)},e}(n(4).HistoryItem);e.DeleteConnectorPointHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.shapeKey=e,i.position=n,i.size=o,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);this.oldPosition=e.position.clone(),this.oldSize=e.size.clone(),t.resizeShape(e,this.position,this.size)},e.prototype.undo=function(t){var e=t.model.findShape(this.shapeKey);t.resizeShape(e,this.oldPosition,this.oldSize)},e}(n(4).HistoryItem);e.ResizeShapeHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){var n=t.call(this)||this;return n.connectorKey=e,n}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);this.connector=e.clone(),t.deleteConnector(e)},e.prototype.undo=function(t){t.addConnector(this.connector,this.connector.key)},e}(n(4).HistoryItem);e.DeleteConnectorHistoryItem=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){this.getKey=function(t){return t.id},this.setKey=function(t,e){t.id=e},this.getText=function(t){return t.text},this.setText=function(t,e){t.text=e},this.getType=function(t){return t.type},this.setType=function(t,e){t.type=e},this.getParentKey=function(t){return t.parentId},this.setParentKey=function(t,e){t.parentId=e},this.getItems=function(t){return t.items},this.setItems=function(t,e){t.items=e}};e.DataSourceNodeDataImporter=o;var i=function(){this.getKey=function(t){return t.id},this.setKey=function(t,e){t.id=e},this.getFrom=function(t){return t.from},this.setFrom=function(t,e){t.from=e},this.getTo=function(t){return t.to},this.setTo=function(t,e){t.to=e}};e.DataSourceEdgeDataImporter=i},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=function(t){function e(){return t.call(this,"Process","Process")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.Process},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e}(r.RectangleShapeDescription);e.ProcessShapeDescription=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(75),s=n(1),a=n(0),c=n(11),u=function(t){function e(){return t.call(this,"Decision","Decision",new a.Size(c.ShapeDefaultDimension,.75*c.ShapeDefaultDimension))||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.Decision},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e}(r.DiamondShapeDescription);e.DecisionShapeDescription=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(2),c=n(3),u=function(t){function e(){return t.call(this,"Manual Input","Manual Input")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.ManualInput},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var n=t.rectangle,o=n.left,i=n.top,r=n.right,s=n.bottom,c=(n.width,i+n.height*e.slopeHeightRatio);return[].concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(o,c),new a.PathPrimitiveLineToCommand(r,i),new a.PathPrimitiveLineToCommand(r,s),new a.PathPrimitiveLineToCommand(o,s),new a.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.processConnectionPoint=function(t,n,o){t.getConnectionPointSide(o)===c.ConnectionPointSide.North&&(n.y+=e.slopeHeightRatio/2*t.size.height)},e.slopeHeightRatio=.1,e}(r.RectangleShapeDescription);e.ManualInputShapeDescription=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(2),c=n(3),u=function(t){function e(){return t.call(this,"Data","Data")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.Data},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var n=t.rectangle,o=n.left,i=n.top,r=n.right,s=n.bottom,c=n.width,u=n.height,p=Math.min(Math.max(0,u/Math.tan(e.slopeAngle)),c),h=o+p,l=r-p;return[].concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(h,i),new a.PathPrimitiveLineToCommand(r,i),new a.PathPrimitiveLineToCommand(l,s),new a.PathPrimitiveLineToCommand(o,s),new a.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.processConnectionPoint=function(t,n,o){var i=t.size.height/Math.tan(e.slopeAngle),r=t.getConnectionPointSide(o);r===c.ConnectionPointSide.East?n.x-=i/2:r===c.ConnectionPointSide.West&&(n.x+=i/2)},e.slopeAngle=81*Math.PI/180,e}(r.RectangleShapeDescription);e.DataShapeDescription=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(2),c=n(0),u=n(11),p=function(t){function e(){return t.call(this,"Terminator","Terminator",new c.Size(u.ShapeDefaultDimension,.5*u.ShapeDefaultDimension))||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.Terminator},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var n=t.rectangle,o=n.left,i=n.top,r=n.right,s=n.bottom,c=n.width,u=(n.height,n.center.y),p=o+c*e.curveWidthRatio,h=o+c*(1-e.curveWidthRatio);return[].concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(p,i),new a.PathPrimitiveLineToCommand(h,i),new a.PathPrimitiveQuadraticCurveToCommand(r,i,r,u),new a.PathPrimitiveQuadraticCurveToCommand(r,s,h,s),new a.PathPrimitiveLineToCommand(p,s),new a.PathPrimitiveQuadraticCurveToCommand(o,s,o,u),new a.PathPrimitiveQuadraticCurveToCommand(o,i,p,i),new a.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.curveWidthRatio=.3,e}(r.RectangleShapeDescription);e.TerminatorShapeDescription=p},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(25),c=n(17),u=n(0),p=n(2);e.PredefinedProcessEdgeParameterName="e";var h=function(t){function n(){return t.call(this,"Predefined Process","Predefined\nProcess")||this}return i(n,t),Object.defineProperty(n.prototype,"key",{get:function(){return s.ShapeType.PredefinedProcess},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),n.prototype.createPrimitives=function(n){var o=n.rectangle,i=o.left,r=o.top,s=o.right,a=o.bottom,c=(o.width,o.height,i+n.parameters.get(e.PredefinedProcessEdgeParameterName).value),u=s-n.parameters.get(e.PredefinedProcessEdgeParameterName).value;return t.prototype.createPrimitives.call(this,n).concat([new p.PathPrimitive([new p.PathPrimitiveMoveToCommand(c,r),new p.PathPrimitiveLineToCommand(c,a),new p.PathPrimitiveMoveToCommand(u,r),new p.PathPrimitiveLineToCommand(u,a)],n.style)])},n.prototype.createParameters=function(t){t.add(new a.ShapeParameter(e.PredefinedProcessEdgeParameterName,.1*this.defaultSize.width))},n.prototype.normalizeParameters=function(t,o){this.changeParameterValue(o,e.PredefinedProcessEdgeParameterName,function(e){return Math.max(n.minEdge,Math.min(.3*t.size.width,e.value))})},n.prototype.modifyParameters=function(t,n,o,i){this.changeParameterValue(n,e.PredefinedProcessEdgeParameterName,function(t){return t.value+o}),this.normalizeParameters(t,n)},n.prototype.getParameterPoints=function(t){return[new c.ShapeParameterPoint("c",new u.Point(t.normalizeX(t.position.x+t.parameters.get(e.PredefinedProcessEdgeParameterName).value),t.position.y))]},n.minEdge=72,n}(r.RectangleShapeDescription);e.PredefinedProcessShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),s=n(2),a=n(17),c=n(0),u=n(54),p=n(1),h=function(t){function e(){return t.call(this,"North-South Arrow")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return p.ShapeType.ArrowNorthSouth},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,r=e.bottom,a=e.width,c=(e.height,e.center.x),p=(a-t.parameters.get(u.ArrowVerticalLineWidthParameterName).value)/2,h=t.parameters.get(u.ArrowVerticalTriangleHeightParameterName).value,l=t.normalizeX(n+p),d=t.normalizeY(o+h),f=t.normalizeX(i-p),y=t.normalizeY(r-h);return[].concat([new s.PathPrimitive([new s.PathPrimitiveMoveToCommand(c,o),new s.PathPrimitiveLineToCommand(i,d),new s.PathPrimitiveLineToCommand(f,d),new s.PathPrimitiveLineToCommand(f,y),new s.PathPrimitiveLineToCommand(i,y),new s.PathPrimitiveLineToCommand(c,r),new s.PathPrimitiveLineToCommand(n,y),new s.PathPrimitiveLineToCommand(l,y),new s.PathPrimitiveLineToCommand(l,d),new s.PathPrimitiveLineToCommand(n,d),new s.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.normalizeParameters=function(t,e){this.changeParameterValue(e,u.ArrowVerticalTriangleHeightParameterName,function(e){return Math.max(0,Math.min(t.size.height/2-2*r.Shape.lineWidth,e.value))}),this.changeParameterValue(e,u.ArrowVerticalLineWidthParameterName,function(e){return Math.max(0,Math.min(t.size.width,e.value))})},e.prototype.modifyParameters=function(t,e,n,o){this.changeParameterValue(e,u.ArrowVerticalTriangleHeightParameterName,function(t){return t.value+o}),this.changeParameterValue(e,u.ArrowVerticalLineWidthParameterName,function(t){return t.value-2*n}),this.normalizeParameters(t,e)},e.prototype.getParameterPoints=function(t){return[new a.ShapeParameterPoint("c",new c.Point(t.normalizeX(t.position.x+(t.size.width-t.parameters.get(u.ArrowVerticalLineWidthParameterName).value)/2),t.normalizeY(t.position.y+t.parameters.get(u.ArrowVerticalTriangleHeightParameterName).value)))]},e}(u.ArrowVerticalShapeDescription);e.ArrowNorthSouthShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),s=n(55),a=n(17),c=n(0),u=n(1),p=n(3),h=function(t){function e(){return t.call(this,"Right Arrow")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return u.ShapeType.ArrowRight},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,a=e.bottom,c=e.width,u=e.height,p=e.center.y,h=c-t.parameters.get(s.ArrowVerticalTriangleWidthParameterName).value,l=(u-t.parameters.get(s.ArrowVerticalLineHeightParameterName).value)/2,d=t.normalizeX(n+h),f=t.normalizeY(o+l),y=t.normalizeY(a-l);return[].concat([new r.PathPrimitive([new r.PathPrimitiveMoveToCommand(n,f),new r.PathPrimitiveLineToCommand(d,f),new r.PathPrimitiveLineToCommand(d,o),new r.PathPrimitiveLineToCommand(i,p),new r.PathPrimitiveLineToCommand(d,a),new r.PathPrimitiveLineToCommand(d,y),new r.PathPrimitiveLineToCommand(n,y),new r.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.modifyParameters=function(t,e,n,o){this.changeParameterValue(e,s.ArrowVerticalTriangleWidthParameterName,function(t){return t.value-n}),this.changeParameterValue(e,s.ArrowVerticalLineHeightParameterName,function(t){return t.value-2*o}),this.normalizeParameters(t,e)},e.prototype.getParameterPoints=function(t){return[new a.ShapeParameterPoint("c",new c.Point(t.normalizeX(t.position.x+t.size.width-t.parameters.get(s.ArrowVerticalTriangleWidthParameterName).value),t.normalizeY(t.position.y+(t.size.height-t.parameters.get(s.ArrowVerticalLineHeightParameterName).value)/2)))]},e.prototype.processConnectionPoint=function(e,n,o){var i=e.parameters.get(s.ArrowVerticalTriangleWidthParameterName).value;if(n.x>e.position.x+e.size.width-i){var r=e.size.height/2/i,a=(n.x-(e.position.x+e.size.width-i))*r,c=e.getConnectionPointSide(o);c===p.ConnectionPointSide.North?n.y+=a:c===p.ConnectionPointSide.South&&(n.y-=a)}else t.prototype.processConnectionPoint.call(this,e,n,o)},e}(s.ArrowHorizontalShapeDescription);e.ArrowRightShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),s=n(17),a=n(0),c=n(54),u=n(1),p=n(3),h=function(t){function e(){return t.call(this,"Top Arrow")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return u.ShapeType.ArrowTop},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,s=e.bottom,a=e.width,u=(e.height,e.center.x),p=(a-t.parameters.get(c.ArrowVerticalLineWidthParameterName).value)/2,h=t.parameters.get(c.ArrowVerticalTriangleHeightParameterName).value,l=t.normalizeX(n+p),d=t.normalizeY(o+h),f=t.normalizeX(i-p);return[].concat([new r.PathPrimitive([new r.PathPrimitiveMoveToCommand(u,o),new r.PathPrimitiveLineToCommand(i,d),new r.PathPrimitiveLineToCommand(f,d),new r.PathPrimitiveLineToCommand(f,s),new r.PathPrimitiveLineToCommand(l,s),new r.PathPrimitiveLineToCommand(l,d),new r.PathPrimitiveLineToCommand(n,d),new r.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.modifyParameters=function(t,e,n,o){this.changeParameterValue(e,c.ArrowVerticalTriangleHeightParameterName,function(t){return t.value+o}),this.changeParameterValue(e,c.ArrowVerticalLineWidthParameterName,function(t){return t.value-2*n}),this.normalizeParameters(t,e)},e.prototype.getParameterPoints=function(t){return[new s.ShapeParameterPoint("c",new a.Point(t.normalizeX(t.position.x+(t.size.width-t.parameters.get(c.ArrowVerticalLineWidthParameterName).value)/2),t.normalizeY(t.position.y+t.parameters.get(c.ArrowVerticalTriangleHeightParameterName).value)))]},e.prototype.processConnectionPoint=function(e,n,o){var i=e.parameters.get(c.ArrowVerticalTriangleHeightParameterName).value;if(n.y<e.position.y+i){var r=e.size.width/2/i,s=(e.position.y+i-n.y)*r,a=e.getConnectionPointSide(o);a===p.ConnectionPointSide.East?n.x-=s:a===p.ConnectionPointSide.West&&(n.x+=s)}else t.prototype.processConnectionPoint.call(this,e,n,o)},e}(c.ArrowVerticalShapeDescription);e.ArrowTopShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),s=n(0),a=n(25),c=n(17),u=n(2),p=n(1);e.CrossHorizontalWidthParameterName="chw",e.CrossVerticalWidthParameterName="cvw";var h=function(t){function n(){return t.call(this,"Cross","")||this}return i(n,t),Object.defineProperty(n.prototype,"key",{get:function(){return p.ShapeType.Cross},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"category",{get:function(){return p.ShapeCategory.General},enumerable:!0,configurable:!0}),n.prototype.createPrimitives=function(t){var n=t.rectangle,o=n.left,i=n.top,r=n.right,s=n.bottom,a=n.width,c=n.height,p=(a-t.parameters.get(e.CrossHorizontalWidthParameterName).value)/2,h=(c-t.parameters.get(e.CrossVerticalWidthParameterName).value)/2,l=t.normalizeX(o+p),d=t.normalizeY(i+h),f=t.normalizeX(r-p),y=t.normalizeY(s-h);return[].concat([new u.PathPrimitive([new u.PathPrimitiveMoveToCommand(o,d),new u.PathPrimitiveLineToCommand(l,d),new u.PathPrimitiveLineToCommand(l,i),new u.PathPrimitiveLineToCommand(f,i),new u.PathPrimitiveLineToCommand(f,d),new u.PathPrimitiveLineToCommand(r,d),new u.PathPrimitiveLineToCommand(r,y),new u.PathPrimitiveLineToCommand(f,y),new u.PathPrimitiveLineToCommand(f,s),new u.PathPrimitiveLineToCommand(l,s),new u.PathPrimitiveLineToCommand(l,y),new u.PathPrimitiveLineToCommand(o,y),new u.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},n.prototype.createParameters=function(t){t.addRange([new a.ShapeParameter(e.CrossHorizontalWidthParameterName,.2*this.defaultSize.width),new a.ShapeParameter(e.CrossVerticalWidthParameterName,.2*this.defaultSize.height)])},n.prototype.normalizeParameters=function(t,n){this.changeParameterValue(n,e.CrossHorizontalWidthParameterName,function(e){return Math.max(0,Math.min(t.size.width,e.value))}),this.changeParameterValue(n,e.CrossVerticalWidthParameterName,function(e){return Math.max(0,Math.min(t.size.height,e.value))})},n.prototype.modifyParameters=function(t,n,o,i){this.changeParameterValue(n,e.CrossHorizontalWidthParameterName,function(t){return t.value-2*o}),this.changeParameterValue(n,e.CrossVerticalWidthParameterName,function(t){return t.value-2*i}),this.normalizeParameters(t,n)},n.prototype.getParameterPoints=function(t){return[new c.ShapeParameterPoint("c",new s.Point(t.normalizeX(t.position.x+(t.size.width-t.parameters.get(e.CrossHorizontalWidthParameterName).value)/2),t.normalizeY(t.position.y+(t.size.height-t.parameters.get(e.CrossVerticalWidthParameterName).value)/2)))]},n}(r.ShapeDescription);e.CrossShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),s=n(2),a=n(1),c=n(32),u=n(3),p=function(t){function e(){return t.call(this,"Heart","")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return a.ShapeType.Heart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return a.ShapeCategory.General},enumerable:!0,configurable:!0}),e.prototype.createConnectionPoints=function(){return[new c.ConnectionPoint(.5,.15,u.ConnectionPointSide.North),new c.ConnectionPoint(1,.25,u.ConnectionPointSide.East),new c.ConnectionPoint(.5,1,u.ConnectionPointSide.South),new c.ConnectionPoint(0,.25,u.ConnectionPointSide.West)]},e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,r=e.bottom,a=e.width,c=e.height;return[].concat([new s.PathPrimitive([new s.PathPrimitiveMoveToCommand(i-.25*a,o),new s.PathPrimitiveCubicCurveToCommand(i-.15*a,o,i,o+.1*c,i,o+.25*c),new s.PathPrimitiveCubicCurveToCommand(i,o+.3*c,i-.02*a,o+.35*c,i-.05*a,o+.4*c),new s.PathPrimitiveLineToCommand(e.center.x,r),new s.PathPrimitiveLineToCommand(n+.05*a,o+.4*c),new s.PathPrimitiveCubicCurveToCommand(n+.02*a,o+.35*c,n,o+.3*c,n,o+.25*c),new s.PathPrimitiveCubicCurveToCommand(n,o+.1*c,n+.15*a,o,n+.25*a,o),new s.PathPrimitiveCubicCurveToCommand(n+.3*a,o,n+.45*a,o+.03*c,n+.5*a,o+.15*c),new s.PathPrimitiveCubicCurveToCommand(i-.45*a,o+.03*c,i-.3*a,o,i-.25*a,o),new s.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e}(r.ShapeDescription);e.HeartShapeDescription=p},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),s=n(1),a=function(t){function e(){return t.call(this,"Octagon","")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.Octagon},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"angleCount",{get:function(){return 8},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,s=e.bottom,a=e.width,c=e.height,u=Math.PI-this.angle,p=a/(1+2*Math.cos(u)),h=c/(1+2*Math.cos(u)),l=n+(a-p)/2,d=l+p,f=o+(c-h)/2,y=f+h;return[].concat([new r.PathPrimitive([new r.PathPrimitiveMoveToCommand(l,o),new r.PathPrimitiveLineToCommand(d,o),new r.PathPrimitiveLineToCommand(i,f),new r.PathPrimitiveLineToCommand(i,y),new r.PathPrimitiveLineToCommand(d,s),new r.PathPrimitiveLineToCommand(l,s),new r.PathPrimitiveLineToCommand(n,y),new r.PathPrimitiveLineToCommand(n,f),new r.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.calculateHeight=function(t){return t},e}(n(57).PolygonShapeDescription);e.OctagonShapeDescription=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),s=n(1),a=n(77),c=n(25),u=n(17),p=n(0),h=n(3);e.StarConvexParameterName="sc";var l=function(t){function n(){return t.call(this,"Star","")||this}return i(n,t),Object.defineProperty(n.prototype,"key",{get:function(){return s.ShapeType.Star},enumerable:!0,configurable:!0}),n.prototype.createPrimitives=function(t){var n=t.rectangle,o=n.left,i=n.top,s=n.right,a=n.bottom,c=n.width,u=n.height;a=this.getActualBottom(i,a,c,u);var p=n.center.x,h=i+(a-i)/2,l=u/c,d=Math.PI-this.angle,f=c/2*Math.tan(d/2)*l,y=i+f,m=(u-f)/Math.tan(d)/l,g=o+m,v=s-m,P=t.parameters.get(e.StarConvexParameterName).value,C=this.getInnerPointDistance(p,p,s,h,i,y);return[].concat([new r.PathPrimitive([new r.PathPrimitiveMoveToCommand(p,i),new r.PathPrimitiveLineToCommand(this.getInnerPointPos(p,p,s,P,C),this.getInnerPointPos(h,i,y,P,C)),new r.PathPrimitiveLineToCommand(s,y),new r.PathPrimitiveLineToCommand(this.getInnerPointPos(p,s,v,P,C),this.getInnerPointPos(h,y,a,P,C)),new r.PathPrimitiveLineToCommand(v,a),new r.PathPrimitiveLineToCommand(this.getInnerPointPos(p,v,g,P,C),this.getInnerPointPos(h,a,a,P,C)),new r.PathPrimitiveLineToCommand(g,a),new r.PathPrimitiveLineToCommand(this.getInnerPointPos(p,g,o,P,C),this.getInnerPointPos(h,a,y,P,C)),new r.PathPrimitiveLineToCommand(o,y),new r.PathPrimitiveLineToCommand(this.getInnerPointPos(p,o,p,P,C),this.getInnerPointPos(h,y,i,P,C)),new r.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},n.prototype.createParameters=function(t){t.addRange([new c.ShapeParameter(e.StarConvexParameterName,300)])},n.prototype.normalizeParameters=function(t,n){var o=t.rectangle,i=o.top,r=o.right,s=o.bottom,a=o.width,c=o.height;s=this.getActualBottom(i,s,a,c);var u=o.center.x,p=i+(s-i)/2,h=c/a,l=Math.PI-this.angle,d=i+a/2*Math.tan(l/2)*h,f=this.getInnerPointDistance(u,u,r,p,i,d);this.changeParameterValue(n,e.StarConvexParameterName,function(t){return Math.max(0,Math.min(f,t.value))})},n.prototype.modifyParameters=function(t,n,o,i){var r=Math.sqrt(Math.pow(o,2)+Math.pow(i,2));(o<0||i>0)&&(r=-r),this.changeParameterValue(n,e.StarConvexParameterName,function(t){return t.value+r}),this.normalizeParameters(t,n)},n.prototype.getParameterPoints=function(t){var n=t.rectangle,o=n.top,i=n.right,r=n.bottom,s=n.width,a=n.height;r=this.getActualBottom(o,r,s,a);var c=n.center.x,h=o+(r-o)/2,l=a/s,d=Math.PI-this.angle,f=o+s/2*Math.tan(d/2)*l,y=t.parameters.get(e.StarConvexParameterName).value,m=this.getInnerPointDistance(c,c,i,h,o,f),g=this.getInnerPointPos(c,c,i,y,m),v=this.getInnerPointPos(h,o,f,y,m);return[new u.ShapeParameterPoint("c",new p.Point(g,v))]},n.prototype.processConnectionPoint=function(n,o,i){if(t.prototype.processConnectionPoint.call(this,n,o,i),n.getConnectionPointSide(i)===h.ConnectionPointSide.South){var r=n.rectangle,s=r.top,a=r.right,c=r.bottom,u=r.width,p=r.height;c=this.getActualBottom(s,c,u,p);var l=r.center.x,d=s+(c-s)/2,f=p/u,y=Math.PI-this.angle,m=s+u/2*Math.tan(y/2)*f,g=n.parameters.get(e.StarConvexParameterName).value,v=this.getInnerPointDistance(l,l,a,d,s,m);o.y=this.getInnerPointPos(d,c,c,g,v)}},n.prototype.getInnerPointDistanceByAxis=function(t,e,n){return Math.min(e,n)+Math.abs(e-n)/2-t},n.prototype.getInnerPointPos=function(t,e,n,o,i){var r=Math.min(1,o/i);return t+this.getInnerPointDistanceByAxis(t,e,n)*r},n.prototype.getInnerPointDistance=function(t,e,n,o,i,r){var s=this.getInnerPointDistanceByAxis(t,e,n),a=this.getInnerPointDistanceByAxis(o,i,r);return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))},n.prototype.getActualBottom=function(e,n,o,i){var r=e+t.prototype.calculateHeight.call(this,o)*i/o;return r<n?r:n},n.prototype.calculateHeight=function(t){return t},n}(a.PentagonShapeDescription);e.StarShapeDescription=l},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),s=n(17),a=n(0),c=n(54),u=n(1),p=n(3),h=function(t){function e(){return t.call(this,"Bottom Arrow")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return u.ShapeType.ArrowBottom},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,s=e.bottom,a=e.width,u=e.height,p=e.center.x,h=(a-t.parameters.get(c.ArrowVerticalLineWidthParameterName).value)/2,l=u-t.parameters.get(c.ArrowVerticalTriangleHeightParameterName).value,d=t.normalizeX(n+h),f=t.normalizeY(o+l),y=t.normalizeX(i-h);return[].concat([new r.PathPrimitive([new r.PathPrimitiveMoveToCommand(d,o),new r.PathPrimitiveLineToCommand(y,o),new r.PathPrimitiveLineToCommand(y,f),new r.PathPrimitiveLineToCommand(i,f),new r.PathPrimitiveLineToCommand(p,s),new r.PathPrimitiveLineToCommand(n,f),new r.PathPrimitiveLineToCommand(d,f),new r.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.modifyParameters=function(t,e,n,o){this.changeParameterValue(e,c.ArrowVerticalTriangleHeightParameterName,function(t){return t.value-o}),this.changeParameterValue(e,c.ArrowVerticalLineWidthParameterName,function(t){return t.value-2*n}),this.normalizeParameters(t,e)},e.prototype.getParameterPoints=function(t){return[new s.ShapeParameterPoint("c",new a.Point(t.normalizeX(t.position.x+(t.size.width-t.parameters.get(c.ArrowVerticalLineWidthParameterName).value)/2),t.normalizeY(t.position.y+t.size.height-t.parameters.get(c.ArrowVerticalTriangleHeightParameterName).value)))]},e.prototype.processConnectionPoint=function(e,n,o){var i=e.parameters.get(c.ArrowVerticalTriangleHeightParameterName).value;if(n.y>e.position.y+e.size.height-i){var r=e.size.width/2/i,s=(n.y-(e.position.y+e.size.height-i))*r,a=e.getConnectionPointSide(o);a===p.ConnectionPointSide.East?n.x-=s:a===p.ConnectionPointSide.West&&(n.x+=s)}else t.prototype.processConnectionPoint.call(this,e,n,o)},e}(c.ArrowVerticalShapeDescription);e.ArrowBottomShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),s=n(2),a=n(55),c=n(17),u=n(0),p=n(1),h=function(t){function e(){return t.call(this,"East-West Arrow")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return p.ShapeType.ArrowEastWest},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,r=e.bottom,c=(e.width,e.height),u=e.center.y,p=t.parameters.get(a.ArrowVerticalTriangleWidthParameterName).value,h=(c-t.parameters.get(a.ArrowVerticalLineHeightParameterName).value)/2,l=t.normalizeX(n+p),d=t.normalizeY(o+h),f=t.normalizeX(i-p),y=t.normalizeY(r-h);return[].concat([new s.PathPrimitive([new s.PathPrimitiveMoveToCommand(n,u),new s.PathPrimitiveLineToCommand(l,o),new s.PathPrimitiveLineToCommand(l,d),new s.PathPrimitiveLineToCommand(f,d),new s.PathPrimitiveLineToCommand(f,o),new s.PathPrimitiveLineToCommand(i,u),new s.PathPrimitiveLineToCommand(f,r),new s.PathPrimitiveLineToCommand(f,y),new s.PathPrimitiveLineToCommand(l,y),new s.PathPrimitiveLineToCommand(l,r),new s.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.normalizeParameters=function(t,e){this.changeParameterValue(e,a.ArrowVerticalTriangleWidthParameterName,function(e){return Math.max(0,Math.min(t.size.width/2-2*r.Shape.lineWidth,e.value))}),this.changeParameterValue(e,a.ArrowVerticalLineHeightParameterName,function(e){return Math.max(0,Math.min(t.size.height,e.value))})},e.prototype.modifyParameters=function(t,e,n,o){this.changeParameterValue(e,a.ArrowVerticalTriangleWidthParameterName,function(t){return t.value+n}),this.changeParameterValue(e,a.ArrowVerticalLineHeightParameterName,function(t){return t.value-2*o}),this.normalizeParameters(t,e)},e.prototype.getParameterPoints=function(t){return[new c.ShapeParameterPoint("c",new u.Point(t.normalizeX(t.position.x+t.parameters.get(a.ArrowVerticalTriangleWidthParameterName).value),t.normalizeY(t.position.y+(t.size.height-t.parameters.get(a.ArrowVerticalLineHeightParameterName).value)/2)))]},e}(a.ArrowHorizontalShapeDescription);e.ArrowEastWestShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),s=n(55),a=n(17),c=n(0),u=n(1),p=n(3),h=function(t){function e(){return t.call(this,"Left Arrow")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return u.ShapeType.ArrowLeft},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,a=e.bottom,c=(e.width,e.height),u=e.center.y,p=t.parameters.get(s.ArrowVerticalTriangleWidthParameterName).value,h=(c-t.parameters.get(s.ArrowVerticalLineHeightParameterName).value)/2,l=t.normalizeX(n+p),d=t.normalizeY(o+h),f=t.normalizeY(a-h);return[].concat([new r.PathPrimitive([new r.PathPrimitiveMoveToCommand(n,u),new r.PathPrimitiveLineToCommand(l,o),new r.PathPrimitiveLineToCommand(l,d),new r.PathPrimitiveLineToCommand(i,d),new r.PathPrimitiveLineToCommand(i,f),new r.PathPrimitiveLineToCommand(l,f),new r.PathPrimitiveLineToCommand(l,a),new r.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.modifyParameters=function(t,e,n,o){this.changeParameterValue(e,s.ArrowVerticalTriangleWidthParameterName,function(t){return t.value+n}),this.changeParameterValue(e,s.ArrowVerticalLineHeightParameterName,function(t){return t.value-2*o}),this.normalizeParameters(t,e)},e.prototype.getParameterPoints=function(t){return[new a.ShapeParameterPoint("c",new c.Point(t.normalizeX(t.position.x+t.parameters.get(s.ArrowVerticalTriangleWidthParameterName).value),t.normalizeY(t.position.y+(t.size.height-t.parameters.get(s.ArrowVerticalLineHeightParameterName).value)/2)))]},e.prototype.processConnectionPoint=function(e,n,o){var i=e.parameters.get(s.ArrowVerticalTriangleWidthParameterName).value;if(n.x<e.position.x+i){var r=e.size.height/2/i,a=(e.position.x+i-n.x)*r,c=e.getConnectionPointSide(o);c===p.ConnectionPointSide.North?n.y+=a:c===p.ConnectionPointSide.South&&(n.y-=a)}else t.prototype.processConnectionPoint.call(this,e,n,o)},e}(s.ArrowHorizontalShapeDescription);e.ArrowLeftShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),s=n(9),a=n(2),c=n(80),u=n(52),p=n(26),h=function(t){function e(){return t.call(this,"Multiple Documents","Multiple\nDocuments")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return r.ShapeType.MultipleDocuments},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var n=t.rectangle,o=t.rectangle,i=(o.left,o.top,o.right,o.bottom,o.width),r=o.height,s=i*e.documentsOffsetRatio,a=r*e.documentsOffsetRatio,c=(n=n.inflate(-s,-a).offset(-s,-a)).offset(s,a),u=n.offset(2*s,2*a),h=p.RenderUtils.generateSvgElementId("clipRect");return[].concat(this.createDocumentPrimitives(n,t.style,h+"1",c)).concat(this.createDocumentPrimitives(c,t.style,h+"2",u)).concat(this.createDocumentPrimitives(u,t.style)).concat(this.createTextPrimitives(t))},e.prototype.createDocumentPrimitives=function(t,e,n,o){var i=t.left,r=t.top,p=t.right,h=t.bottom,l=t.width,d=t.height,f=t.center.x,y=d*c.DocumentShapeDescription.curveOffsetRatio,m=[];return m=m.concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(i,r),new a.PathPrimitiveLineToCommand(p,r),new a.PathPrimitiveLineToCommand(p,h),new a.PathPrimitiveQuadraticCurveToCommand(p-.25*l,h-2*y,f,h-y),new a.PathPrimitiveQuadraticCurveToCommand(i+.25*l,h+y,i,h-y),new a.PathPrimitiveClosePathCommand],e,void 0,o&&n)]),o&&n&&(m=m.concat([new u.ClipPathPrimitive(n,[new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(i-s.Shape.lineWidth,r-s.Shape.lineWidth),new a.PathPrimitiveLineToCommand(p+s.Shape.lineWidth,r-s.Shape.lineWidth),new a.PathPrimitiveLineToCommand(p+s.Shape.lineWidth,o.top),new a.PathPrimitiveLineToCommand(o.left,o.top),new a.PathPrimitiveLineToCommand(o.left,h+s.Shape.lineWidth),new a.PathPrimitiveLineToCommand(i-s.Shape.lineWidth,h+s.Shape.lineWidth),new a.PathPrimitiveClosePathCommand])])])),m},e.prototype.getTextRectangle=function(t){var n=t.width*e.documentsOffsetRatio,o=t.height*e.documentsOffsetRatio;return(t=t.inflate(-n,-o).offset(-n,-o)).offset(2*n,2*o).resize(0,-t.height*c.DocumentShapeDescription.curveOffsetRatio)},e.documentsOffsetRatio=.1,e}(c.DocumentShapeDescription);e.MultipleDocumentsShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),s=n(0),a=n(11),c=function(t){function e(){var e=t.call(this,"Preparation","Preparation")||this;return e.defaultSize=new s.Size(a.ShapeDefaultDimension,.75*a.ShapeDefaultDimension),e}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return r.ShapeType.Preparation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return r.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e}(n(78).HexagonShapeDescription);e.PreparationShapeDescription=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(2),c=n(38),u=function(t){function e(){return t.call(this,"Hard Disk","Hard Disk")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.HardDisk},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var n=t.rectangle,o=n.left,i=n.top,r=n.right,s=n.bottom,u=n.width,p=(n.height,n.center.y),h=u*e.arcWidthRatio;return[].concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(r-h/2,i),new a.PathPrimitiveLineToCommand(o+h/2,i),new a.PathPrimitiveArcToCommand(h/2,(s-i)/2,0,!1,!1,o+h/2,s),new a.PathPrimitiveLineToCommand(r-h/2,s)],t.style),new c.EllipsePrimitive(r-h/2,p,h/2,(s-i)/2,t.style)]).concat(this.createTextPrimitives(t))},e.prototype.getTextRectangle=function(t){var n=t.width*e.arcWidthRatio;return t.resize(-n,0)},e.arcWidthRatio=.2,e}(r.RectangleShapeDescription);e.HardDiskShapeDescription=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(2),c=n(38),u=function(t){function e(){var e=t.call(this,"Database","Database")||this;return e.defaultSize.width=e.defaultSize.height,e}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.Database},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var n=t.rectangle,o=n.left,i=n.top,r=n.right,s=n.bottom,u=(n.width,n.height),p=n.center.x,h=u*e.arcWidthRatio;return[].concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(r,i+h/2),new a.PathPrimitiveLineToCommand(r,s-h/2),new a.PathPrimitiveArcToCommand((r-o)/2,h/2,0,!1,!0,o,s-h/2),new a.PathPrimitiveLineToCommand(o,i+h/2)],t.style),new c.EllipsePrimitive(p,i+h/2,(r-o)/2,h/2,t.style)]).concat(this.createTextPrimitives(t))},e.prototype.getTextRectangle=function(t){var n=t.height*e.arcWidthRatio;return t.resize(0,-n).offset(0,n)},e.arcWidthRatio=.2,e}(r.RectangleShapeDescription);e.DatabaseShapeDescription=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(25),c=n(17),u=n(0),p=n(2);e.InternalStorageHorizontalEdgeParameterName="he",e.InternalStorageVerticalEdgeParameterName="ve";var h=function(t){function n(){return t.call(this,"Internal Storage","Internal\nStorage")||this}return i(n,t),Object.defineProperty(n.prototype,"key",{get:function(){return s.ShapeType.InternalStorage},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),n.prototype.createPrimitives=function(n){var o=n.rectangle,i=o.left,r=o.top,s=o.right,a=o.bottom,c=(o.width,o.height,i+n.parameters.get(e.InternalStorageHorizontalEdgeParameterName).value),u=r+n.parameters.get(e.InternalStorageVerticalEdgeParameterName).value;return t.prototype.createPrimitives.call(this,n).concat([new p.PathPrimitive([new p.PathPrimitiveMoveToCommand(c,r),new p.PathPrimitiveLineToCommand(c,a),new p.PathPrimitiveMoveToCommand(i,u),new p.PathPrimitiveLineToCommand(s,u)],n.style)])},n.prototype.createParameters=function(t){t.addRange([new a.ShapeParameter(e.InternalStorageHorizontalEdgeParameterName,.1*this.defaultSize.width),new a.ShapeParameter(e.InternalStorageVerticalEdgeParameterName,.1*this.defaultSize.width)])},n.prototype.normalizeParameters=function(t,o){this.changeParameterValue(o,e.InternalStorageHorizontalEdgeParameterName,function(e){return Math.max(n.minEdge,Math.min(.3*t.size.width,e.value))}),this.changeParameterValue(o,e.InternalStorageVerticalEdgeParameterName,function(e){return Math.max(n.minEdge,Math.min(.3*t.size.height,e.value))})},n.prototype.modifyParameters=function(t,n,o,i){this.changeParameterValue(n,e.InternalStorageHorizontalEdgeParameterName,function(t){return t.value+o}),this.changeParameterValue(n,e.InternalStorageVerticalEdgeParameterName,function(t){return t.value+i}),this.normalizeParameters(t,n)},n.prototype.getParameterPoints=function(t){return[new c.ShapeParameterPoint("c",new u.Point(t.normalizeX(t.position.x+t.parameters.get(e.InternalStorageHorizontalEdgeParameterName).value),t.normalizeY(t.position.y+t.parameters.get(e.InternalStorageVerticalEdgeParameterName).value)))]},n.minEdge=72,n}(r.RectangleShapeDescription);e.InternalStorageShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(2),c=n(3),u=function(t){function e(e,n){return void 0===e&&(e="Paper Tape"),void 0===n&&(n="Paper Tape"),t.call(this,e,n)||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.PaperTape},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){return[].concat(this.createDocumentPrimitives(t.rectangle,t.style)).concat(this.createTextPrimitives(t))},e.prototype.createDocumentPrimitives=function(t,n){var o=t.left,i=t.top,r=t.right,s=t.bottom,c=t.width,u=t.height,p=t.center.x,h=u*e.curveOffsetRatio;return[].concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(o,i),new a.PathPrimitiveQuadraticCurveToCommand(o+.25*c,i+2*h,p,i+h),new a.PathPrimitiveQuadraticCurveToCommand(r-.25*c,i-h,r,i+h),new a.PathPrimitiveLineToCommand(r,s),new a.PathPrimitiveQuadraticCurveToCommand(r-.25*c,s-2*h,p,s-h),new a.PathPrimitiveQuadraticCurveToCommand(o+.25*c,s+h,o,s-h),new a.PathPrimitiveClosePathCommand],n)])},e.prototype.processConnectionPoint=function(t,n,o){var i=t.getConnectionPointSide(o);i===c.ConnectionPointSide.North&&(n.y+=t.size.height*e.curveOffsetRatio),i===c.ConnectionPointSide.South&&(n.y-=t.size.height*e.curveOffsetRatio)},e.prototype.getTextRectangle=function(t){return t.inflate(0,-t.height*e.curveOffsetRatio)},e.curveOffsetRatio=.1,e}(r.RectangleShapeDescription);e.PaperTapeShapeDescription=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(2),c=n(3),u=function(t){function e(){return t.call(this,"Manual Operation","Manual\nOperation")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.ManualOperation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var n=t.rectangle,o=t.rectangle,i=o.left,r=o.top,s=o.right,c=o.bottom,u=o.width,p=o.height,h=Math.min(Math.max(0,p/Math.tan(e.slopeAngle)),u),l=n.center.x,d=Math.min(i+h,l),f=Math.max(s-h,l);return[].concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(i,r),new a.PathPrimitiveLineToCommand(s,r),new a.PathPrimitiveLineToCommand(f,c),new a.PathPrimitiveLineToCommand(d,c),new a.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.processConnectionPoint=function(t,n,o){var i=t.size.height/Math.tan(e.slopeAngle),r=t.getConnectionPointSide(o);r===c.ConnectionPointSide.East?n.x-=i/2:r===c.ConnectionPointSide.West&&(n.x+=i/2)},e.slopeAngle=81*Math.PI/180,e}(r.RectangleShapeDescription);e.ManualOperationShapeDescription=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(2),c=function(t){function e(){var e=t.call(this,"Delay","Delay")||this;return e.defaultSize.width=e.defaultSize.height,e}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.Delay},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,r=e.bottom,s=e.center.x;return[].concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(n,o),new a.PathPrimitiveLineToCommand(s,o),new a.PathPrimitiveArcToCommand((i-n)/2,(r-o)/2,0,!1,!0,s,r),new a.PathPrimitiveLineToCommand(n,r),new a.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.arcWidthRatio=.2,e}(r.RectangleShapeDescription);e.DelayShapeDescription=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(2),c=function(t){function e(){return t.call(this,"Stored Data","Stored Data")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.StoredData},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var n=t.rectangle,o=n.left,i=n.top,r=n.right,s=n.bottom,c=n.width,u=(n.height,n.center.y,c*e.arcWidthRatio);return[].concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(r,i),new a.PathPrimitiveLineToCommand(o+u/2,i),new a.PathPrimitiveArcToCommand(u/2,(s-i)/2,0,!1,!1,o+u/2,s),new a.PathPrimitiveLineToCommand(r,s),new a.PathPrimitiveArcToCommand(u/2,(s-i)/2,0,!1,!0,r,i)],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.getTextRectangle=function(t){var n=t.width*e.arcWidthRatio;return t.resize(-n,0)},e.arcWidthRatio=.2,e}(r.RectangleShapeDescription);e.StoredDataShapeDescription=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),s=n(79),a=n(2),c=function(t){function e(){return t.call(this,"Merge","Merge")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return r.ShapeType.Merge},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return r.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,r=e.bottom;e.width;return[].concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(n,o),new a.PathPrimitiveLineToCommand(i,o),new a.PathPrimitiveLineToCommand(e.center.x,r),new a.PathPrimitiveClosePathCommand],t.style)]).concat(this.createTextPrimitives(t))},e.prototype.calculateHeight=function(t){return.75*t},e.prototype.getTextRectangle=function(t){return t.resize(0,.25*-t.width)},e}(s.TriangleShapeDescription);e.MergeShapeDescription=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=n(1),a=n(2),c=function(t){function e(){return t.call(this,"Display","Display")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return s.ShapeType.Display},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return s.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(t){var n=t.rectangle,o=n.left,i=n.top,r=n.right,s=n.bottom,c=n.width,u=(n.height,n.center.y),p=c*e.arcWidthRatio;return[].concat([new a.PathPrimitive([new a.PathPrimitiveMoveToCommand(r-p/2,i),new a.PathPrimitiveLineToCommand(o+p/2,i),new a.PathPrimitiveLineToCommand(o,u),new a.PathPrimitiveLineToCommand(o+p/2,s),new a.PathPrimitiveLineToCommand(r-p/2,s),new a.PathPrimitiveArcToCommand(p/2,(s-i)/2,0,!1,!1,r-p/2,i)],t.style)]).concat(this.createTextPrimitives(t))},e.arcWidthRatio=.2,e}(r.RectangleShapeDescription);e.DisplayShapeDescription=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),s=n(0),a=n(11),c=n(56),u=n(2),p=function(t){function e(){var e=t.call(this,"Or","")||this;return e.defaultSize=new s.Size(.5*a.ShapeDefaultDimension,.5*a.ShapeDefaultDimension),e}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return r.ShapeType.Or},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return r.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowHasText",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(e){var n=e.rectangle,o=n.left,i=n.top,r=n.right,s=n.bottom,a=n.center,c=a.x,p=a.y;return[].concat(t.prototype.createPrimitives.call(this,e)).concat([new u.PathPrimitive([new u.PathPrimitiveMoveToCommand(c,i),new u.PathPrimitiveLineToCommand(c,s),new u.PathPrimitiveMoveToCommand(o,p),new u.PathPrimitiveLineToCommand(r,p)],e.style)])},e}(c.EllipseShapeDescription);e.OrShapeDescription=p},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),s=n(0),a=n(11),c=n(56),u=n(2),p=function(t){function e(){var e=t.call(this,"Summing Junction","")||this;return e.defaultSize=new s.Size(.5*a.ShapeDefaultDimension,.5*a.ShapeDefaultDimension),e}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return r.ShapeType.SummingJunction},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return r.ShapeCategory.Flowchart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowHasText",{get:function(){return!1},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(e){var n=e.rectangle,o=(n.left,n.top,n.right,n.bottom,n.width),i=n.height,r=n.center,s=r.x,a=r.y,c=o/2,p=i/2,h=Math.atan(p/c),l=1/Math.sqrt(1/Math.pow(c,2)+Math.pow(Math.tan(h),2)/Math.pow(p,2)),d=l*Math.tan(h);return[].concat(t.prototype.createPrimitives.call(this,e)).concat([new u.PathPrimitive([new u.PathPrimitiveMoveToCommand(s-l,a-d),new u.PathPrimitiveLineToCommand(s+l,a+d),new u.PathPrimitiveMoveToCommand(s-l,a+d),new u.PathPrimitiveLineToCommand(s+l,a-d)],e.style)])},e}(c.EllipseShapeDescription);e.SummingJunctionShapeDescription=p},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),s=n(11),a=n(150),c=n(0),u=n(32),p=n(3),h=function(t){function e(e,n,o,i,r,s,a,u,p,h,l,d,f,y,m,g,v){var P=t.call(this,n,h,new c.Size(u||1440,p||1440))||this;return P.shapeType=e,P.svgUrl=o,P.svgLeft=i,P.svgTop=r,P.svgWidth=s,P.svgHeight=a,P.shapeAllowHasText=l,P.textLeft=d,P.textTop=f,P.textWidth=y,P.textHeight=m,P.shapeConnectionPoints=g,P.shapeCategory=v,P.connectionPoints=P.createConnectionPoints(),P}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return this.shapeType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"category",{get:function(){return this.shapeCategory||r.ShapeCategory.Custom},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowHasText",{get:function(){return!!this.shapeAllowHasText},enumerable:!0,configurable:!0}),e.prototype.createConnectionPoints=function(){return this.shapeConnectionPoints&&this.shapeConnectionPoints.length?this.shapeConnectionPoints.map(function(t){if(t&&"number"==typeof t.x&&"number"==typeof t.y){var e="number"==typeof t.side?t.side:p.ConnectionPointSide.Undefined;return new u.ConnectionPoint(t.x,t.y,e)}}).filter(function(t){return t}):t.prototype.createConnectionPoints.call(this)},e.prototype.createPrimitives=function(t,e){var n=t.rectangle,o=n.left,i=n.top,r=n.width,s=n.height,c=t.description.svgUrl;return[].concat([new a.ImagePrimitive(o+(this.svgLeft&&!e?this.svgLeft*r:0),i+(this.svgTop&&!e?this.svgTop*s:0),this.svgWidth&&!e?this.svgWidth*r:r,this.svgHeight&&!e?this.svgHeight*s:s,c)]).concat(this.createTextPrimitives(t,e))},e.prototype.getTextRectangle=function(t){var e=t.left,n=t.top,o=t.width,i=t.height;return c.Rectangle.create(e+(this.textLeft?this.textLeft*o:0),n+(this.textTop?this.textTop*i:0),this.textWidth?this.textWidth*o:o,this.textHeight?this.textHeight*i:i)},e}(s.ShapeDescription);e.CustomShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=function(t){function e(e,n,o,i,r,s,a,c){void 0===s&&(s="none");var u=t.call(this,a,c)||this;return u.x=e,u.y=n,u.width=o,u.height=i,u.url=r,u.preserveAspectRatio=s,u}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"image")},e.prototype.applyElementProperties=function(e){this.setUnitAttribute(e,"x",this.x),this.setUnitAttribute(e,"y",this.y),this.setUnitAttribute(e,"width",this.width),this.setUnitAttribute(e,"height",this.height),this.setUnitAttribute(e,"href",this.url),this.setUnitAttribute(e,"preserveAspectRatio",this.preserveAspectRatio),t.prototype.applyElementProperties.call(this,e)},e}(n(15).SvgPrimitive);e.ImagePrimitive=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(152),i=function(){function t(t){this.trees=t}return t.create=function(e){return new t(e.getConnectedComponents().map(o.Tree.createSpanningTree))},t}();e.Forest=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(22),i=function(){function t(t,e){var n=this;this.childToParent={},this.root=t,this.parentToChildren=e;var o=function(t){if(!e.hasOwnProperty(t))return"continue";e[t].forEach(function(e){return n.childToParent[e.key]=t})};for(var i in e)o(i)}return t.prototype.getChildren=function(t){return t&&this.parentToChildren[t.key]?this.parentToChildren[t.key]:[]},t.prototype.hasChildren=function(t){return this.parentToChildren[t.key]&&this.parentToChildren[t.key].length>0},t.prototype.iterate=function(t){this.iterateCore(this.root,0,t)},t.createSpanningTree=function(e){var n=t.findRoot(e),i=e.createIterator(o.ConnectionMode.Outgoing),r={};return i.skipEdge=function(t){return void 0===t.to||i.isNodeVisited(t.to)},i.onNode=function(t){return r[t.key]=[]},i.onEdge=function(t){return r[t.from].push(e.getNode(t.to))},i.iterate(n),new t(e.getNode(n),r)},t.prototype.iterateCore=function(t,e,n){var o=this;n(t,e),this.getChildren(t).forEach(function(t){return o.iterateCore(t,e+1,n)})},t.findRoot=function(t){return t.nodes.reduce(function(e,n){var o=t.getAdjacentEdges(n),i=o.filter(function(t){return t.to===n}).length,r=o.filter(function(t){return t.from===n}).length;return(void 0===e.candidate||0===i&&(e.inc>0||e.out<r)||i>0&&e.out-e.inc<r-i)&&(e.candidate=n,e.inc=i,e.out=r),e},{inc:-1,out:-1,candidate:void 0}).candidate},t}();e.Tree=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(34),i=n(22),r=n(60),s=function(){function t(){}return t.removeCycles=function(t){var e=this.getFeedbackSet(t);return this.reverseEdges(t,e)},t.getFeedbackSet=function(t){for(var e=this,n={},o=this.getNonTrivialStronglyConnectedComponents(t);o.length;)o.forEach(function(t){var o=e.getMaxCyclicEdges(t);o.forEach(function(t){return delete n[t.reverse().getHashKey()]}),o.forEach(function(t){return n[t.getHashKey()]=!0})}),o=this.getNonTrivialStronglyConnectedComponents(this.reverseEdges(t,n).graph);return n},t.getMaxCyclicEdges=function(t){var e={},n={},o={},s=[],a=[],c=t.createIterator(i.ConnectionMode.Outgoing);c.visitEachEdgeOnce=!1,c.onNode=function(t){n[t.key]=!0},c.skipNode=function(t){if(n[t.key]){for(var i=[],r=0;r<s.length;r++){var c=s[r];if(void 0===o[c.key]&&(o[c.key]=0),o[c.key]++,i.push(c),c.from===t.key)break}a.push(i)}return n[t.key]||e[t.key]},c.skipEdge=function(t){return!1},c.onEdge=function(t){s.splice(0,0,t)},c.onAfterEdge=function(t){s.splice(0,1)},c.onAllEdges=function(t){e[t.key]=!0,n[t.key]=!1},c.iterate(t.nodes[0]);var u=new r.HashSet([],function(t){return t.key});return a.forEach(function(t){u.tryPush(t.reduce(function(t,e){return o[e.key]>o[t.key]?e:t},t[0]))}),u.list()},t.reverseEdges=function(t,e){var n=new r.HashSet([],function(t){return t.getHashKey()}),i={},s={};return t.edges.forEach(function(t){e[t.getHashKey()]&&(t=t.reverse(),i[t.key]=!0),n.tryPush(t)||(s[t.key]=!0,delete i[t.key])}),{graph:new o.Graph(t.nodes.map(function(e){return t.getNode(e)}),n.list()),reversedEdges:i,removedEdges:s}},t.getNonTrivialStronglyConnectedComponents=function(t){return this.getStronglyConnectedComponents(t).filter(function(t){return t.edges.length})},t.getStronglyConnectedComponents=function(t){for(var e=this,n=[],o=0,r={},s={},a={},c=[],u={},p=0;p<t.nodes.length;p++){var h=t.nodes[p],l=t.createIterator(i.ConnectionMode.Outgoing);l.visitEachEdgeOnce=!1,l.visitEachNodeOnce=!1,l.onNode=function(t){u[t.key]=!0,n.push(t),a[t.key]=!0,s[t.key]=o,r[t.key]=o,o++},l.skipNode=function(t){return u[t.key]},l.skipEdge=function(t){var e=u[t.to];return e&&a[t.to]&&(s[t.from]=Math.min(s[t.from],r[t.to])),e},l.onAfterEdge=function(t){s[t.from]=Math.min(s[t.from],s[t.to])},l.onAllEdges=function(o,i){i&&s[o.key]===r[o.key]&&c.push(e.getStronglyConnectedComponent(t,o,n,a))},l.iterate(h)}return c},t.getStronglyConnectedComponent=function(t,e,n,r){var s,a={},c=[],u=[];do{s=n.pop(),a[s.key]||c.push(s),a[s.key]=!0,r[s.key]=!1}while(s!==e);return c.forEach(function(e){var n=t.getAdjacentEdges(e.key,i.ConnectionMode.Outgoing);u.push.apply(u,n.filter(function(t){return!a[t.key]&&a[t.to]})),n.forEach(function(t){return a[t.key]=!0})}),new o.Graph(c,u)},t}();e.CycleRemover=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.clearConnections=function(t){t.attachedConnectors=[]},e.prototype.addItem=function(t,e){e.addShape(t)},e.prototype.deleteItem=function(t,e){e.deleteShape(t)},e}(n(83).CloneHistoryItem);e.CloneShapeHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),s=function(t){function e(e,n,o){var i=t.call(this,e)||this;return i.beginItem=n,i.endItem=o,i}return i(e,t),e.prototype.clearConnections=function(t){t.beginItem=void 0,t.endItem=void 0},e.prototype.addItem=function(t,e){e.addConnector(t),this.beginItem&&e.addConnection(t,this.beginItem,t.beginConnectionPointIndex,r.ConnectorPosition.Begin),this.endItem&&e.addConnection(t,this.endItem,t.endConnectionPointIndex,r.ConnectorPosition.End)},e.prototype.deleteItem=function(t,e){e.deleteConnector(t)},e}(n(83).CloneHistoryItem);e.CloneConnectorHistoryItem=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(t){return this.control.history.undo(),!0},e.prototype.getState=function(){return new s.SimpleCommandState(this.isEnabled()&&this.control.history.canUndo())},e}(r.CommandBase);e.UndoCommand=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(t){return this.control.history.redo(),!0},e.prototype.getState=function(){return new s.SimpleCommandState(this.isEnabled()&&this.control.history.canRedo())},e}(r.CommandBase);e.RedoCommand=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(84),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!0)},e.prototype.executeCore=function(t,e){var n=e.data?e.data:e;if(!0===e.keepExistingItems)a.Importer.importItemsData(n,this.control.model),this.control.importItemsData();else{var o=a.Importer.import(n);this.control.importModel(o)}return!0},e}(r.CommandBase);e.ImportCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(31),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!0)},e.prototype.executeCore=function(t,e){return e(a.Exporter.export(this.control.model)),!0},e}(r.CommandBase);e.ExportCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStyleProperty=function(){return"font-weight"},e.prototype.getStylePropertyValue=function(){return"bold"},e}(n(41).ToggleStyleTextPropertyCommand);e.ToggleFontBoldCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStyleProperty=function(){return"font-style"},e.prototype.getStylePropertyValue=function(){return"italic"},e}(n(41).ToggleStyleTextPropertyCommand);e.ToggleFontItalicCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStyleProperty=function(){return"text-decoration"},e.prototype.getStylePropertyValue=function(){return"underline"},e}(n(41).ToggleStyleTextPropertyCommand);e.ToggleFontUnderlineCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStyleProperty=function(){return"font-family"},e}(n(62).ChangeStyleTextPropertyCommand);e.ChangeFontNameCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStyleProperty=function(){return"font-size"},e}(n(62).ChangeStyleTextPropertyCommand);e.ChangeFontSizeCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStyleProperty=function(){return"fill"},e}(n(62).ChangeStyleTextPropertyCommand);e.ChangeFontColorCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStyleProperty=function(){return"fill"},e}(n(88).ChangeStylePropertyCommand);e.ChangeFillColorCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStyleProperty=function(){return"stroke"},e}(n(88).ChangeStylePropertyCommand);e.ChangeStrokeColorCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(37),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.performImportData=function(t){var e=new r.DataSource(t.key||"0",t.name,t.nodeDataSource,t.edgeDataSource,t.nodeDataImporter,t.edgeDataImporter);this.control.registerDataSource(e),void 0!==t.layoutType&&this.createItems(e,t.layoutType)},e}(n(89).ImportDataCommandBase);e.ImportDataSourceCommand=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStyleProperty=function(){return"text-anchor"},e}(n(41).ToggleStyleTextPropertyCommand);e.ChangeTextAlignCommand=r;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStylePropertyValue=function(){return"start"},e}(r);e.TextLeftAlignCommand=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStylePropertyValue=function(){return"middle"},e}(r);e.TextCenterAlignCommand=a;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getStylePropertyValue=function(){return"end"},e}(r);e.TextRightAlignCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(90),s=n(28),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPropertyName=function(){return"startLineEnding"},e.prototype.getPropertyDefaultValue=function(){return s.ConnectorLineEnding.None},e}(r.ChangeConnectorPropertyCommand);e.ChangeConnectorStartLineEndingCommand=a;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPropertyName=function(){return"endLineEnding"},e.prototype.getPropertyDefaultValue=function(){return s.ConnectorLineEnding.Arrow},e}(r.ChangeConnectorPropertyCommand);e.ChangeConnectorEndLineEndingCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(90),s=n(28),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPropertyName=function(){return"lineOption"},e.prototype.getPropertyDefaultValue=function(){return s.ConnectorLineOption.Straight},e}(r.ChangeConnectorPropertyCommand);e.ChangeConnectorLineOptionCommand=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!0)},e.prototype.executeCore=function(t,e){var n=[];return this.control.model.iterateItems(function(t){return n.push(t.key)}),this.control.selection.set(n),!0},e}(r.CommandBase);e.SelectAllCommand=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(43),s=n(61),a=n(18),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createLayout=function(t){var e=this.createLayoutSettings();return e.orientation=a.OrientationKind.Vertical,new s.TreeLayoutBuilder(e,t).build()},e}(r.AutoLayoutCommandBase);e.AutoLayoutTreeVerticalCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPropertyName=function(){return"snapToGrid"},e}(n(23).ChangePagePropertyCommand);e.ChangeSnapToGridCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var o=t.call(this)||this;return o.propertyName=e,o.value=n,o}return i(e,t),e.prototype.redo=function(t){this.oldValue=t.model[this.propertyName],t.changePageProperty(this.propertyName,this.value)},e.prototype.undo=function(t){t.changePageProperty(this.propertyName,this.oldValue)},e}(n(4).HistoryItem);e.ChangePagePropertyHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPropertyName=function(){return"gridSize"},e.prototype.getPropertyOptions=function(){return[{value:90,text:this.control.model.getModelUnitText(90)},{value:180,text:this.control.model.getModelUnitText(180)},{value:360,text:this.control.model.getModelUnitText(360)},{value:720,text:this.control.model.getModelUnitText(720)}]},e}(n(23).ChangePagePropertyCommand);e.ChangeGridSizeCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(23),s=n(178),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPropertyName=function(){return"pageLandscape"},e.prototype.createHistoryItems=function(t,e){return[new s.ChangePageLandscapeHistoryItem(e)]},e}(r.ChangePagePropertyCommand);e.ChangePageLandscapeCommand=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return i(e,t),e.prototype.redo=function(t){this.oldValue=t.model.pageLandscape,t.changePageLandscape(this.value)},e.prototype.undo=function(t){t.changePageLandscape(this.oldValue)},e}(n(4).HistoryItem);e.ChangePageLandscapeHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(23),s=n(0),a=n(180),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPropertyName=function(){return"pageSize"},e.prototype.createHistoryItems=function(t,e){return[new a.ChangePageSizeHistoryItem(new s.Size(e.width,e.height))]},e.prototype.getPropertyOptions=function(){return[{value:new s.Size(12240,15840),text:"US-Letter ("+this.control.model.getModelUnitText(12240)+" x "+this.control.model.getModelUnitText(15840)+")"},{value:new s.Size(12240,20160),text:"US-Legal ("+this.control.model.getModelUnitText(12240)+" x "+this.control.model.getModelUnitText(20160)+")"},{value:new s.Size(15817,24491),text:"US-Tabloid ("+this.control.model.getModelUnitText(15817)+" x "+this.control.model.getModelUnitText(24491)+")"},{value:new s.Size(47679,67408),text:"A0 ("+this.control.model.getModelUnitText(47679)+" x "+this.control.model.getModelUnitText(67408)+")"},{value:new s.Size(33676,47679),text:"A1 ("+this.control.model.getModelUnitText(33676)+" x "+this.control.model.getModelUnitText(47679)+")"},{value:new s.Size(23811,33676),text:"A2 ("+this.control.model.getModelUnitText(23811)+" x "+this.control.model.getModelUnitText(33676)+")"},{value:new s.Size(16838,23811),text:"A3 ("+this.control.model.getModelUnitText(16838)+" x "+this.control.model.getModelUnitText(23811)+")"},{value:new s.Size(11906,16838),text:"A4 ("+this.control.model.getModelUnitText(11906)+" x "+this.control.model.getModelUnitText(16838)+")"},{value:new s.Size(8391,11906),text:"A5 ("+this.control.model.getModelUnitText(8391)+" x "+this.control.model.getModelUnitText(11906)+")"},{value:new s.Size(5953,8391),text:"A6 ("+this.control.model.getModelUnitText(5953)+" x "+this.control.model.getModelUnitText(8391)+")"},{value:new s.Size(4195,5953),text:"A7 ("+this.control.model.getModelUnitText(4195)+" x "+this.control.model.getModelUnitText(5953)+")"}]},e}(r.ChangePagePropertyCommand);e.ChangePageSizeCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){var n=t.call(this)||this;return n.size=e,n}return i(e,t),e.prototype.redo=function(t){this.oldSize=t.model.pageSize,t.changePageSize(this.size)},e.prototype.undo=function(t){t.changePageSize(this.oldSize)},e}(n(4).HistoryItem);e.ChangePageSizeHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(31),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getExportFunc=function(){return r.Exporter.exportPng},e}(n(64).ExportImageCommand);e.ExportPngCommand=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=function(t){function e(e,n,o,i,r,s){var a=t.call(this)||this;return a.id=e,a.x=o,a.y=i,a.width=r,a.height=s,a.children=n,a}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"pattern")},e.prototype.applyElementProperties=function(e){this.id&&e.setAttribute("id",this.id),this.setUnitAttribute(e,"x",this.x),this.setUnitAttribute(e,"y",this.y),this.setUnitAttribute(e,"width",this.width),this.setUnitAttribute(e,"height",this.height),t.prototype.applyElementProperties.call(this,e)},e}(n(15).SvgPrimitive);e.PatternPrimitive=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=function(t){function e(e,n,o){var i=t.call(this,null,n)||this;return i.zIndex=o,i.children=e,i}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"g")},e.prototype.applyElementProperties=function(e){this.zIndex&&e.style.setProperty("z-index",this.zIndex.toString()),t.prototype.applyElementProperties.call(this,e)},e}(n(15).SvgPrimitive);e.GroupPrimitive=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=function(t){function e(e,n,o,i,r,s,a){var c=t.call(this,null,o)||this;return c.id=e,c.x=i,c.y=r,c.width=s,c.height=a,c.children=n,c}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"mask")},e.prototype.applyElementProperties=function(e){this.id&&e.setAttribute("id",this.id),this.setUnitAttribute(e,"x",this.x),this.setUnitAttribute(e,"y",this.y),this.setUnitAttribute(e,"width",this.width),this.setUnitAttribute(e,"height",this.height),t.prototype.applyElementProperties.call(this,e)},e}(n(15).SvgPrimitive);e.MaskPrimitive=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(31),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getExportFunc=function(){return r.Exporter.exportSvg},e}(n(64).ExportImageCommand);e.ExportSvgCommand=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(31),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getExportFunc=function(){return r.Exporter.exportJpg},e}(n(64).ExportImageCommand);e.ExportJpgCommand=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),s=n(31),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new r.SimpleCommandState(!this.control.selection.isEmpty(!0))},e.prototype.executeCore=function(t){var e=s.Exporter.exportItems(this.control.selection.getSelectedItems());return this.setClipboardData(e),!0},e}(n(65).ClipboardCommand);e.CopySelectionCommand=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),s=n(31),a=n(8),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new r.SimpleCommandState(!this.control.selection.isEmpty())},e.prototype.executeCore=function(t){var e=s.Exporter.exportItems(this.control.selection.getSelectedItems());return this.setClipboardData(e),a.ModelUtils.deleteSelection(this.control.history,this.control.model,this.control.selection),!0},e}(n(65).ClipboardCommand);e.CutSelectionCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),s=n(84),a=n(9),c=n(190),u=n(5),p=n(191),h=n(29),l=n(65),d=n(13),f=n(8),y=n(20),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new r.SimpleCommandState(y.Browser.IE||y.Browser.WebKitFamily&&navigator&&void 0!==navigator.clipboard)},e.prototype.executeCore=function(t){var e=this;return this.getClipboardData(function(t){e.performPaste(t)}),!0},e.prototype.performPaste=function(t){this.control.beginUpdate(),this.control.history.beginTransaction();for(var n=[],o=s.Importer.importItems(t,this.control.model),i=0;i<o.length;i++){var r=o[i];if(r instanceof a.Shape){for(;this.control.model.findShapeAtPosition(r.position);)r.position.x+=e.positionOffset,r.position.y+=e.positionOffset;this.control.history.addOrModifyAndRedo(new c.ImportShapeHistoryItem(r))}else if(r instanceof u.Connector){for(;this.control.model.findConnectorAtPoints(r.points);)r.points.forEach(function(t){t.x+=e.positionOffset,t.y+=e.positionOffset});this.control.history.addOrModifyAndRedo(new p.ImportConnectorHistoryItem(r))}n.push(r.key)}f.ModelUtils.tryUpdateModelSize(this.control.history,this.control.model),this.control.history.addOrModifyAndRedo(new h.SetSelectionHistoryItem(this.control.selection,n)),this.control.history.endTransaction(),this.control.endUpdate()},e.positionOffset=d.UnitConverter.pixelsToTwips(10),e}(l.ClipboardCommand);e.PasteSelectionCommand=m},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){var n=t.call(this)||this;return n.shape=e,n}return i(e,t),e.prototype.redo=function(t){this.shapeKey=this.shape.key,t.insertShape(this.shape)},e.prototype.undo=function(t){t.removeShape(t.model.findShape(this.shapeKey))},e}(n(4).HistoryItem);e.ImportShapeHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){var n=t.call(this)||this;return n.connector=e,n}return i(e,t),e.prototype.redo=function(t){this.connectorKey=this.connector.key,t.insertConnector(this.connector)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.removeConnector(e)},e}(n(4).HistoryItem);e.ImportConnectorHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(193),c=n(59),u=n(8),p=n(51),h=n(0),l=n(5),d=n(58),f=n(35),y=n(22),m=n(40),g=n(18),v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!0)},e.prototype.executeCore=function(t,e){var n=this,o=(new DOMParser).parseFromString(e,"application/xml"),i=new a.BPMNImporter(o),r={},s=[],v=i.import().cast(function(t){var e=new p.AddShapeHistoryItem(t.type,new h.Point(0,0),t.text,t.key);return n.control.history.addAndRedo(e),r[t.key]=e.shapeKey,c.LayoutUtils.shapeToLayout(n.control.model.findShape(e.shapeKey))},function(t){var e=n.control.model.findShape(r[t.from]),o=n.control.model.findShape(r[t.to]),i=new d.AddConnectorHistoryItem([e.getConnectionPoint(0),o.getConnectionPoint(0)]);n.control.history.addAndRedo(i);var a=n.control.model.findConnector(i.connectorKey);return s.push(a),n.control.history.addAndRedo(new f.AddConnectionHistoryItem(a,e,0,l.ConnectorPosition.Begin)),n.control.history.addAndRedo(new f.AddConnectionHistoryItem(a,o,0,l.ConnectorPosition.End)),new y.Edge(a.key,e.key,o.key)}),P=new m.SugiyamaLayoutBuilder(new g.LayoutSettings,v).build(),C=u.ModelUtils.getSymmetricDifference(P.nodeToLayout,this.control.model.items);return P=u.ModelUtils.offsetLayoutToFreeSpace(P,C.map(function(t){return t.rectangle})),u.ModelUtils.applyLayoutToNodes(this.control.history,this.control.model,P,s),u.ModelUtils.applyLayoutToConnectors(this.control.history,P,s),u.ModelUtils.tryUpdateModelSize(this.control.history,this.control.model),!0},e}(r.CommandBase);e.ImportBPMNCommand=v},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(34),s=n(1),a=n(22),c=function(){function t(t){this.doc=t,this.graph=new r.Graph([],[])}return t.prototype.import=function(){for(var t=void 0,e=0;t=this.doc.children[e];e++)"DEFINITIONS"===t.nodeName.toUpperCase()&&this.onDefinitionsElement(t);return this.validate(),this.graph},t.prototype.validate=function(){var t={};this.graph.nodes.forEach(function(e){return t[e]=!0});for(var e=0,n=void 0;n=this.graph.edges[e];e++)t[n.from]&&t[n.to]||(this.graph.edges.splice(e,1),e--)},t.prototype.onDefinitionsElement=function(t){this.dataSourceKey=t.getAttribute("id");for(var e=void 0,n=0;e=t.children[n];n++)"PROCESS"===e.nodeName.toUpperCase()&&this.onProcessElement(e)},t.prototype.onProcessElement=function(t){for(var e=void 0,n=0;e=t.children[n];n++)switch(e.nodeName.toUpperCase()){case"STARTEVENT":this.onStartEventElement(e);break;case"SEQUENCEFLOW":this.onSequenceFlowElement(e);break;case"SCRIPTTASK":this.onScriptTaskElement(e);break;case"USERTASK":this.onUserTaskElement(e);break;case"SERVICETASK":this.onServiceTaskElement(e);break;case"SENDTASK":this.onSendTaskElement(e);break;case"EXCLUSIVEGATEWAY":this.onExclusiveGateway(e);break;case"ENDEVENT":this.onEndEventGateway(e)}},t.prototype.onStartEventElement=function(t){var e=this.createNode(t);e.type=s.ShapeType.Ellipsis,e.text=t.getAttribute("name"),this.graph.addNode(e)},t.prototype.onSequenceFlowElement=function(t){var e=t.getAttribute("sourceRef"),n=t.getAttribute("targetRef"),o=this.createEdge(t,e,n);t.hasAttribute("name")&&(o.text=t.getAttribute("name")),this.graph.addEdge(o)},t.prototype.onScriptTaskElement=function(t){var e=this.createNode(t);e.text=t.getAttribute("name"),this.graph.addNode(e)},t.prototype.onUserTaskElement=function(t){var e=this.createNode(t);e.text=t.getAttribute("name"),this.graph.addNode(e)},t.prototype.onServiceTaskElement=function(t){var e=this.createNode(t);e.text=t.getAttribute("name"),this.graph.addNode(e)},t.prototype.onSendTaskElement=function(t){var e=this.createNode(t);e.text=t.getAttribute("name"),this.graph.addNode(e)},t.prototype.onExclusiveGateway=function(t){var e=this.createNode(t);e.text=t.getAttribute("name"),e.type=s.ShapeType.Decision,this.graph.addNode(e)},t.prototype.onEndEventGateway=function(t){var e=this.createNode(t);e.text=t.getAttribute("name"),e.type=s.ShapeType.Ellipsis,this.graph.addNode(e)},t.prototype.createNode=function(t){return new u(this.dataSourceKey,t.getAttribute("id"))},t.prototype.createEdge=function(t,e,n){return new p(this.dataSourceKey,t.getAttribute("id"),e,n)},t}();e.BPMNImporter=c;var u=function(t,e){this.sourceKey=t,this.key=e,this.type=s.ShapeType.Rectangle},p=function(t){function e(e,n,o,i){var r=t.call(this,n,o,i)||this;return r.sourceKey=e,r}return i(e,t),e}(a.Edge)},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(93),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){var t=this.control.selection.getSelectedItems();return new s.SimpleCommandState(t.length&&this.needSendToBack(t))},e.prototype.executeCore=function(t,e){var n=this;return this.control.history.beginTransaction(),this.control.selection.getSelectedItems().forEach(function(t){var e=n.control.model.getIntersectItemsMinZIndex(t)-1;n.control.history.addAndRedo(new a.ChangeZindexHistoryItem(t,e))}),this.control.history.endTransaction(),!0},e.prototype.needSendToBack=function(t){for(var e=this,n=function(n){var i=o.control.model.getIntersectItemsMinZIndex(t[n]);if(i<t[n].zIndex)return{value:!0};if(i===t[n].zIndex){var r=!1;return o.control.model.getIntersectItems(t[n]).filter(function(e){return e.zIndex===t[n].zIndex}).forEach(function(o){e.control.model.getItemIndex(o)<e.control.model.getItemIndex(t[n])&&(r=!0)}),{value:r}}},o=this,i=0;i<t.length;i++){var r=n(i);if("object"==typeof r)return r.value}return!1},e}(r.CommandBase);e.SendToBackCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(93),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){var t=this.control.selection.getSelectedItems();return new s.SimpleCommandState(t.length&&this.needBringToFront(t))},e.prototype.executeCore=function(t,e){var n=this;return this.control.history.beginTransaction(),this.control.selection.getSelectedItems().forEach(function(t){var e=n.control.model.getIntersectItemsMaxZIndex(t)+1;n.control.history.addAndRedo(new a.ChangeZindexHistoryItem(t,e))}),this.control.history.endTransaction(),!0},e.prototype.needBringToFront=function(t){for(var e=this,n=function(n){var i=o.control.model.getIntersectItemsMaxZIndex(t[n]);if(i>t[n].zIndex)return{value:!0};if(i===t[n].zIndex){var r=!1;return o.control.model.getIntersectItems(t[n]).filter(function(e){return e.zIndex===t[n].zIndex}).forEach(function(o){e.control.model.getItemIndex(o)>e.control.model.getItemIndex(t[n])&&(r=!0)}),{value:r}}},o=this,i=0;i<t.length;i++){var r=n(i);if("object"==typeof r)return r.value}return!1},e}(r.CommandBase);e.BringToFrontCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(43),s=n(40),a=n(18),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createLayout=function(t){var e=this.createLayoutSettings();return e.orientation=a.OrientationKind.Horizontal,new s.SugiyamaLayoutBuilder(e,t).build()},e}(r.AutoLayoutCommandBase);e.AutoLayoutLayeredHorizontalCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(0),c=n(8),u=n(13),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!this.control.selection.isEmpty())},e.prototype.executeCore=function(t,e){var n=this;return this.control.history.beginTransaction(),this.control.selection.getSelectedShapes().forEach(function(t,e){var o=n.getPosition(t.position);c.ModelUtils.setShapePosition(n.control.history,n.control.model,t.key,o,n.control.history.addOrModifyAndRedo),t.attachedConnectors.forEach(function(t){c.ModelUtils.removeConnectorIntermediatePoints(n.control.history,t),c.ModelUtils.updateConnectorAttachedPoints(n.control.history,t,n.control.history.addOrModifyAndRedo)})}),this.control.selection.getSelectedConnectors().forEach(function(t,e){for(var o=t.beginItem?1:0,i=t.endItem?t.points.length-2:t.points.length-1,r=o;r<=i;r++){var s=n.getPosition(t.points[r]);c.ModelUtils.setConnectorPoint(n.control.history,n.control.model,t.key,r,s,n.control.history.addOrModifyAndRedo)}}),c.ModelUtils.tryUpdateModelSize(this.control.history,this.control.model),this.control.history.endTransaction(),!0},e}(r.CommandBase);e.MoveCommand=p;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return t.offset(-u.UnitConverter.pixelsToTwips(1),0)},e}(p);e.MoveLeftCommand=h;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return this.control.model.snapToGrid?new a.Point(c.ModelUtils.getSnappedPos(this.control.model,t.x-(this.control.model.gridSize/2+2)),t.y):t.offset(-this.control.model.gridSize,0)},e}(p);e.MoveStepLeftCommand=l;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return t.offset(u.UnitConverter.pixelsToTwips(1),0)},e}(p);e.MoveRightCommand=d;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return this.control.model.snapToGrid?new a.Point(c.ModelUtils.getSnappedPos(this.control.model,t.x+(this.control.model.gridSize/2+2)),t.y):t.offset(this.control.model.gridSize,0)},e}(p);e.MoveStepRightCommand=f;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return t.offset(0,-u.UnitConverter.pixelsToTwips(1))},e}(p);e.MoveUpCommand=y;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return this.control.model.snapToGrid?new a.Point(t.x,c.ModelUtils.getSnappedPos(this.control.model,t.y-(this.control.model.gridSize/2+2))):t.offset(0,-this.control.model.gridSize)},e}(p);e.MoveStepUpCommand=m;var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return t.offset(0,u.UnitConverter.pixelsToTwips(1))},e}(p);e.MoveDownCommand=g;var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return this.control.model.snapToGrid?new a.Point(t.x,c.ModelUtils.getSnappedPos(this.control.model,t.y+(this.control.model.gridSize/2+2))):t.offset(0,this.control.model.gridSize)},e}(p);e.MoveStepDownCommand=v},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(23),s=n(29),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPropertyName=function(){return"zoomLevel"},e.prototype.createHistoryItems=function(e,n){return t.prototype.createHistoryItems.call(this,e,n).concat([new s.SetSelectionHistoryItem(this.control.selection,[])])},e.prototype.getPropertyOptions=function(){return[{value:.5,text:"50%"},{value:.75,text:"75%"},{value:1,text:"100%"},{value:1.25,text:"125%"},{value:1.5,text:"150%"},{value:2,text:"200%"},{value:3,text:"300%"}]},e}(r.ChangePagePropertyCommand);e.ChangeZoomLevelCommand=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),s=n(89),a=n(200),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.performImportData=function(t){var e=new a.DocumentDataSource(t.nodeDataSource,t.edgeDataSource,t.nodeDataImporter,t.edgeDataImporter);this.control.registerDocumentDataSource(e),void 0!==t.layoutType&&(this.control.history.beginTransaction(),r.ModelUtils.deleteAllItems(this.control.history,this.control.model,this.control.selection),this.createItems(e,t.layoutType),this.control.history.endTransaction()),this.control.history.clear()},e}(s.ImportDataCommandBase);e.BindDocumentCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),s=n(9),a=n(5),c=n(8),u=function(t){function e(e,n,o,i){return t.call(this,"Document","Document Data Source",e,n,o,i)||this}return i(e,t),e.prototype.createModelItems=function(t,e,n,o){c.ModelUtils.createItemsByDataSource(t,e,n,this,o,!0)},e.prototype.updateItems=function(t,e){var n=this;this.deleteNodes(t,e),this.deleteEdges(t,e),t.items.forEach(function(t){t instanceof s.Shape&&n.updateNode(t,e),t instanceof a.Connector&&n.updateEdge(t,e)})},e.prototype.updateNode=function(t,e){var n=this,o=this.findNode(t.dataKey);if(o)this.isNodeObjectModified(o,t)&&(this.updateNodeObject(o,t),e.NotifyNodeUpdated.call(e,this.nodeDataImporter.getKey(o.dataObj||o.key),o.dataObj,function(t,e){}));else{var i={};o=this.addNodeInternal(i,t.text,t.description.key),this.nodeDataSource.push(o.dataObj),this.nodeDataImporter.setKey(i,o.key),this.updateNodeObject(o,t),this.updateNodeObjectKey(o,o.dataObj,t),e.NotifyNodeInserted.call(e,o.dataObj,function(e){n.updateNodeObjectKey(o,e,t)})}if(this.useNodeParentId){var r=this.getParentShapeKey(t),s=this.findNode(r);this.updateNodeObjectParentKey(o,s,e)}if(this.useNodeItems){r=this.getParentShapeKey(t),s=this.findNode(r);this.updateNodeObjectItems(o,s,e)}},e.prototype.isNodeObjectModified=function(t,e){return t.text!==e.text||t.type!==e.description.key&&!(void 0===t.type&&e.description.key===r.ShapeType.Rectangle)},e.prototype.updateNodeObject=function(t,e){t.text=e.text,this.nodeDataImporter.setText(t.dataObj,e.text),t.type=e.description.key,this.nodeDataImporter.setType(t.dataObj,e.description.key)},e.prototype.updateNodeObjectParentKey=function(t,e,n){var o=this.nodeDataImporter.getParentKey(t.dataObj),i=e?this.nodeDataImporter.getKey(e.dataObj):void 0;o!==i&&(this.nodeDataImporter.setParentKey(t.dataObj,i),n.NotifyNodeUpdated.call(n,this.nodeDataImporter.getKey(t.dataObj)||t.key,t.dataObj,function(t,e){}))},e.prototype.updateNodeObjectItems=function(t,e,n){if((e&&t.parentDataObj!==e.dataObj||!e&&t.parentDataObj)&&(!e||!this.checkNodeCyrcleItems(t.dataObj,e.dataObj))){var o=t.parentDataObj?this.nodeDataImporter.getItems(t.parentDataObj):this.nodeDataSource,i=o.indexOf(t.dataObj);o.splice(i,1);var r=e?this.nodeDataImporter.getItems(e.dataObj):this.nodeDataSource;r?r.push(t.dataObj):this.nodeDataImporter.setItems(e.dataObj,[t.dataObj]),t.parentDataObj=e&&e.dataObj,n.NotifyNodeUpdated.call(n,this.nodeDataImporter.getKey(t.dataObj)||t.key,t.dataObj,function(t,e){})}},e.prototype.checkNodeCyrcleItems=function(t,e){var n=this,o=!1,i=this.nodeDataImporter.getItems(t);return i&&i.forEach(function(t){o=o||t===e||n.checkNodeCyrcleItems(t,e)}),o},e.prototype.updateNodeObjectKey=function(t,e,n){var o=this.nodeDataImporter.getKey(e);null!=o&&o!==t.key&&(t.key=o.toString(),delete this.nodeKeyMap[t.key],this.nodeKeyMap[o]=t.key),n.dataKey=t.key,t.dataObj=e},e.prototype.updateEdge=function(t,e){var n=this,o=t.beginItem?t.beginItem.dataKey:void 0,i=t.endItem?t.endItem.dataKey:void 0,r=this.findEdge(t.dataKey);if(r)this.isEdgeObjectModified(r,t)&&(this.updateEdgeObject(r,t),r.dataObj&&e.NotifyEdgeUpdated.call(e,this.edgeDataImporter.getKey(r.dataObj)||r.key,r.dataObj,function(t,e){}));else{var s=this.useEdgesArray()?{}:void 0;r=this.addEdgeInternal(s,o,i),s&&(this.edgeDataImporter.setKey(s,r.key),this.edgeDataSource.push(r.dataObj)),this.updateEdgeObject(r,t),this.updateEdgeObjectKey(r,r.dataObj,t),s&&e.NotifyEdgeInserted.call(e,r.dataObj,function(e){n.updateEdgeObjectKey(r,e,t)})}},e.prototype.isEdgeObjectModified=function(t,e){return t.from!==(e.beginItem?e.beginItem.dataKey:void 0)||t.to!==(e.endItem?e.endItem.dataKey:void 0)},e.prototype.updateEdgeObject=function(t,e){var n=this.findNode(e.beginItem&&e.beginItem.dataKey);t.from=n&&n.key,t.dataObj&&this.edgeDataImporter.setFrom(t.dataObj,n&&n.dataObj&&this.nodeDataImporter.getKey(n.dataObj));var o=this.findNode(e.endItem&&e.endItem.dataKey);t.to=o&&o.key,t.dataObj&&this.edgeDataImporter.setTo(t.dataObj,o&&o.dataObj&&this.nodeDataImporter.getKey(o.dataObj))},e.prototype.updateEdgeObjectKey=function(t,e,n){var o=e&&this.edgeDataImporter.getKey(e);null!=o&&o!==t.key&&(t.key=o.toString(),delete this.edgeKeyMap[t.key],this.edgeKeyMap[o]=t.key),n.dataKey=t.key,t.dataObj=e},e.prototype.deleteNodes=function(t,e){var n=this;this.deleteItems(this.nodes,function(e){return t.findShapeByDataKey(e)},function(t){return n.getNodeParentArray(t)},function(t,o){var i=t.dataObj&&n.nodeDataImporter.getKey(t.dataObj)||t.key,r=n.nodeKeyMap[i];r&&delete n.nodeKeyMap[i];var s=n.findNode(r);s&&n.nodes.splice(n.nodes.indexOf(s),1),o&&e.NotifyNodeRemoved.call(e,i,function(t){})})},e.prototype.deleteEdges=function(t,e){var n=this;this.deleteItems(this.edges,function(e){return t.findConnectorByDataKey(e)},function(t){return n.edgeDataSource},function(t,o){var i=t.dataObj&&n.edgeDataImporter.getKey(t.dataObj)||t.key,r=n.edgeKeyMap[i];r&&delete n.edgeKeyMap[i];var s=n.findEdge(r);s&&n.edges.splice(n.edges.indexOf(s),1),o&&e.NotifyEdgeRemoved.call(e,i,function(t){})})},e.prototype.deleteItems=function(t,e,n,o){t.slice().forEach(function(t){if(t.key&&!e(t.key)){var i=n(t),r=i.indexOf(t.dataObj);i.splice(r,1),o(t,r>-1)}})},e.prototype.getParentShapeKey=function(t){for(var e,n=0;n<t.attachedConnectors.length;n++)if(t.attachedConnectors[n].endItem===t){var o=t.attachedConnectors[n].beginItem;e=o&&o.dataKey;break}return e},e.prototype.getNodeParentArray=function(t){var e;return this.useNodeItems&&t.parentDataObj&&(e=this.nodeDataImporter.getItems(t.parentDataObj)),e||this.nodeDataSource},e}(n(37).DataSource);e.DocumentDataSource=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),s=n(8),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new r.SimpleCommandState(!0)},e.prototype.executeCore=function(t){return this.control.unregisterDocumentDataSource(),s.ModelUtils.deleteAllItems(this.control.history,this.control.model,this.control.selection),this.control.history.clear(),this.control.renderManager&&this.control.renderManager.onWindowResize(null),!0},e}(n(7).CommandBase);e.UnbindDocumentCommand=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(43),s=n(61),a=n(18),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createLayout=function(t){var e=this.createLayoutSettings();return e.orientation=a.OrientationKind.Horizontal,new s.TreeLayoutBuilder(e,t).build()},e}(r.AutoLayoutCommandBase);e.AutoLayoutTreeHorizontalCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(43),s=n(40),a=n(18),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createLayout=function(t){var e=this.createLayoutSettings();return e.orientation=a.OrientationKind.Vertical,new s.SugiyamaLayoutBuilder(e,t).build()},e}(r.AutoLayoutCommandBase);e.AutoLayoutLayeredVerticalCommand=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new r.SimpleCommandState(!0)},e.prototype.executeCore=function(t,e){return this.control.unregisterDataSource(e),!0},e}(n(7).CommandBase);e.CloseDataSourceCommand=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getLockState=function(){return!0},e}(n(94).ChangeLockedCommand);e.LockCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var o=t.call(this)||this;return o.itemKey=e.key,o.locked=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findItem(this.itemKey);this.oldLocked=e.locked,t.changeLocked(e,this.locked)},e.prototype.undo=function(t){var e=t.model.findItem(this.itemKey);t.changeLocked(e,this.oldLocked)},e}(n(4).HistoryItem);e.ChangeLockedHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getLockState=function(){return!1},e}(n(94).ChangeLockedCommand);e.UnLockCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=n(21),c=n(8),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!this.control.selection.isEmpty())},e.prototype.executeCore=function(t,e){var n=a.DiagramModel.getRectangle(this.control.selection.getSelectedItems());return c.ModelUtils.cloneSelectionToOffset(this.control.history,this.control.model,this.control.selection,this.getOffsetX(n),this.getOffsetY(n)),!0},e.prototype.getOffsetX=function(t){return 0},e.prototype.getOffsetY=function(t){return 0},e}(r.CommandBase);e.CloneCommand=u;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getOffsetX=function(t){return-t.width},e}(u);e.CloneLeftCommand=p;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getOffsetX=function(t){return t.width},e}(u);e.CloneRightCommand=h;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getOffsetY=function(t){return-t.height},e}(u);e.CloneUpCommand=l;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getOffsetY=function(t){return t.height},e}(u);e.CloneDownCommand=d},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(23),s=n(21),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPropertyName=function(){return"units"},e.prototype.getPropertyOptions=function(){return[{value:s.DiagramUnit.In,text:"in"},{value:s.DiagramUnit.Cm,text:"cm"},{value:s.DiagramUnit.Px,text:"px"}]},e}(r.ChangePagePropertyCommand);e.ChangeUnitsCommand=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPropertyName=function(){return"pageColor"},e}(n(23).ChangePagePropertyCommand);e.ChangePageColorCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPropertyName=function(){return"showGrid"},e}(n(23).ChangePagePropertyCommand);e.ChangeShowGridCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(7),s=n(6),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(!0,this.control.settings.fullscreen)},e.prototype.executeCore=function(t,e){return this.control.settings.fullscreen=!this.control.settings.fullscreen,this.control.NotifyToggleFullscreen(this.control.settings.fullscreen),!0},e}(r.CommandBase);e.ToggleFullscreenCommand=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(214),i=n(44),r=n(68),s=n(215),a=n(238),c=n(21),u=n(239),p=n(241),h=n(242),l=n(10),d=n(244),f=n(245),y=n(30),m=n(246),g=function(){function t(){this.dataSources=[],this.settings=new m.DiagramSettings,this.model=new c.DiagramModel,this.selection=new u.Selection(this.model),this.modelManipulator=new o.ModelManipulator(this.model),this.modelManipulator.initialize(this.model),this.history=new p.History(this.modelManipulator),this.commandManager=new r.CommandManager(this),this.eventManager=new s.EventManager(this),this.barManager=new h.BarManager(this),this.selection.onChanged.add(this.barManager),this.modelManipulator.onLoad(),this.history.onChanged.add(this)}return t.prototype.createDocument=function(t){if(this.renderManager)this.renderManager.mainElement.parentNode!==t&&t.appendChild(this.renderManager.mainElement);else{this.renderManager=new l.RenderManager(t,this.eventManager),this.canvasManager=new i.CanvasManager(this.renderManager.svgElement),this.eventManager.onTextInputOperation.add(this.renderManager),this.eventManager.onTextInputOperation.add(this.canvasManager),this.eventManager.onMouseOperation.add(this.canvasManager),this.eventManager.onVisualizersUpdate.add(this.canvasManager),this.modelManipulator.onModelChanged.add(this.renderManager),this.modelManipulator.onModelChanged.add(this.canvasManager);var e=new a.SelectionController(this.selection);this.modelManipulator.onModelChanged.add(e),e.onSelectionChanged.add(this.canvasManager),this.modelManipulator.onLoad()}},t.prototype.createToolbox=function(t,e,n,o,i){var r=new d.ShapeToolboxManager;r.initialize(t,{shapeIconSize:e,shapeIconSpacing:n,shapeIconAttributes:o,shapes:i}),r.onDragOperation.add(this),this.eventManager.registerToolbox(r)},t.prototype.createDataSourceToolbox=function(t,e){if(null==t)throw new Error("Data source toolbox key must be specified");var n=this.getDataSource(t);if(!n)throw Error("Data source with the specified key cannot be found");var o=new f.DataToolboxManager(t);o.initialize(e,n),o.onDragOperation.add(this),this.eventManager.registerToolbox(o)},t.prototype.updateLayout=function(){this.renderManager&&this.renderManager.updateLayout()},t.prototype.captureFocus=function(){this.renderManager&&this.renderManager.captureFocus()},t.prototype.isFocused=function(){return!this.renderManager||this.renderManager.isFocused()},t.prototype.addCustomShapes=function(t){var e=this;t.forEach(function(t){t.defaultWidth&&(t.defaultWidth=e.model.getTwipsUnit(t.defaultWidth)),t.defaultHeight&&(t.defaultHeight=e.model.getTwipsUnit(t.defaultHeight)),y.ShapeDescriptionManager.registerCustomShape(t)})},t.prototype.removeCustomShapes=function(t){t.forEach(function(t){y.ShapeDescriptionManager.unregisterCustomShape(t)})},t.prototype.getUnitText=function(t,e){return void 0===e&&(e=2),this.model.getModelUnitText(t,e)},t.prototype.importModel=function(t){this.model=t,this.importData()},t.prototype.importItemsData=function(){this.model.invalidateItems(),this.importData()},t.prototype.importData=function(){void 0!==this.canvasManager&&this.canvasManager.clear(),this.selection.initialize(this.model),this.modelManipulator.initialize(this.model),this.history.clear(),this.eventManager.initialize(),this.modelManipulator.onLoad()},t.prototype.registerDataSource=function(t){if(this.getDataSource(t.key))throw Error("Data Source key is duplicated");this.dataSources.push(t)},t.prototype.unregisterDataSource=function(t){var e=this.getDataSource(t);e&&this.dataSources.splice(this.dataSources.indexOf(e),1)},t.prototype.getDataSource=function(t){return this.dataSources.filter(function(e){return e.key===t})[0]},t.prototype.registerDocumentDataSource=function(t){this.documentDataSource=t},t.prototype.unregisterDocumentDataSource=function(){delete this.documentDataSource},t.prototype.beginUpdate=function(){this.barManager.beginUpdate()},t.prototype.endUpdate=function(){this.barManager.endUpdate()},t.prototype.NotifyEdgeInserted=function(t,e){this.onEdgeInserted&&this.onEdgeInserted(t,e)},t.prototype.NotifyEdgeUpdated=function(t,e,n){this.onEdgeUpdated&&this.onEdgeUpdated(t,e,n)},t.prototype.NotifyEdgeRemoved=function(t,e){this.onEdgeUpdated&&this.onEdgeRemoved(t,e)},t.prototype.NotifyNodeInserted=function(t,e){this.onNodeInserted&&this.onNodeInserted(t,e)},t.prototype.NotifyNodeUpdated=function(t,e,n){this.onNodeUpdated&&this.onNodeUpdated(t,e,n)},t.prototype.NotifyNodeRemoved=function(t,e){this.onNodeRemoved&&this.onNodeRemoved(t,e)},t.prototype.NotifyHistoryChanged=function(){this.documentDataSource&&this.documentDataSource.updateItems(this.model,this),this.onChanged&&this.onChanged()},t.prototype.NotifyToolboxDragStart=function(){this.onToolboxDragStart&&this.onToolboxDragStart()},t.prototype.NotifyToolboxDragEnd=function(){this.onToolboxDragEnd&&this.onToolboxDragEnd()},t.prototype.NotifyToggleFullscreen=function(t){this.onToggleFullscreen&&this.onToggleFullscreen(t)},t}();e.DiagramControl=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(9),i=n(48),r=n(0),s=n(5),a=function(){function t(t){this.onModelChanged=new r.EventDispatcher,this.model=t}return t.prototype.initialize=function(t){this.model=t},t.prototype.onLoad=function(){var t=this,e=[];this.model.iterateItems(function(n){e.push(t.createItemChange(n,i.ItemChangeType.Create))}),this.raiseModelChanged([new i.PageChange(this.model,i.PageChangeType.Create)]),this.raiseModelChanged(e)},t.prototype.changeStyle=function(t,e,n){this.changeStyleCore(t,t.style,e,n)},t.prototype.changeStyleText=function(t,e,n){this.changeStyleCore(t,t.styleText,e,n)},t.prototype.changeStyleCore=function(t,e,n,o){void 0!==o?e[n]=o:delete e[n],t.invalidatePrimitives(),this.raiseModelChanged([this.createItemChange(t,i.ItemChangeType.Update)])},t.prototype.changeZIndex=function(t,e){t.zIndex=e,this.raiseModelChanged([this.createItemChange(t,i.ItemChangeType.UpdateZIndex)])},t.prototype.changeLocked=function(t,e){t.locked=e,this.raiseModelChanged([this.createItemChange(t,i.ItemChangeType.Update)])},t.prototype.addShape=function(t,e){if(t.attachedConnectors.length)throw Error("A creating shape should not contain existing connectors.");return t.key=void 0!==e?e:this.model.getNextKey(),this.insertShape(t)},t.prototype.insertShape=function(t){return this.model.pushItem(t),this.raiseModelChanged([new i.ShapeChange(t,i.ItemChangeType.Create)]),t},t.prototype.resizeShape=function(t,e,n){t.position=e,t.size=n,t.invalidatePrimitives(),this.raiseModelChanged([new i.ShapeChange(t,i.ItemChangeType.Update)])},t.prototype.moveShape=function(t,e){t.position=e,t.invalidatePrimitives(),this.raiseModelChanged([new i.ShapeChange(t,i.ItemChangeType.Update)])},t.prototype.changeShapeParameters=function(t,e){t.parameters.forEach(function(t){var n=e.get(t.key);n&&(t.value=n.value)}),t.invalidatePrimitives(),this.raiseModelChanged([new i.ShapeChange(t,i.ItemChangeType.Update)])},t.prototype.changeShapeText=function(t,e){t.text=e,t.invalidatePrimitives(),this.raiseModelChanged([new i.ShapeChange(t,i.ItemChangeType.UpdateStructure)])},t.prototype.deleteShape=function(t){if(t.attachedConnectors.length)throw Error("A removing shape should not contain existing connectors.");this.removeShape(t)},t.prototype.removeShape=function(t){this.model.removeItem(t),this.raiseModelChanged([new i.ShapeChange(t,i.ItemChangeType.Remove)])},t.prototype.addConnector=function(t,e){if(t.beginItem||t.endItem)throw Error("Creating connector should not contain begin/end items");return t.key=void 0!==e?e:this.model.getNextKey(),this.insertConnector(t)},t.prototype.insertConnector=function(t){return this.model.pushItem(t),this.raiseModelChanged([new i.ConnectorChange(t,i.ItemChangeType.Create)]),t},t.prototype.deleteConnector=function(t){if(t.beginItem||t.endItem)throw Error("Creating connector should not contain begin/end items");this.removeConnector(t)},t.prototype.removeConnector=function(t){this.model.removeItem(t),this.raiseModelChanged([new i.ConnectorChange(t,i.ItemChangeType.Remove)])},t.prototype.moveConnectorPoint=function(t,e,n){t.points[e]=n,t.invalidateRenderPoints(),t.invalidatePrimitives(),this.raiseModelChanged([new i.ConnectorChange(t,i.ItemChangeType.UpdateStructure)])},t.prototype.addConnectorPoint=function(t,e,n){t.points.splice(e,0,n),t.invalidateRenderPoints(),t.invalidatePrimitives(),this.raiseModelChanged([new i.ConnectorChange(t,i.ItemChangeType.UpdateStructure)])},t.prototype.deleteConnectorPoint=function(t,e){t.points.splice(e,1),t.invalidateRenderPoints(),t.invalidatePrimitives(),this.raiseModelChanged([new i.ConnectorChange(t,i.ItemChangeType.UpdateStructure)])},t.prototype.addConnection=function(t,e,n,o){var r=t.getExtremeItem(o);if(r!==e){if(r)throw Error("Connector is already connected");e.attachedConnectors.push(t),o===s.ConnectorPosition.Begin?(t.beginItem=e,t.beginConnectionPointIndex=n):(t.endItem=e,t.endConnectionPointIndex=n),this.raiseModelChanged([new i.ConnectorChange(t,i.ItemChangeType.Update)])}},t.prototype.setConnectionPointIndex=function(t,e,n){if(!t.getExtremeItem(n))throw Error("Connection should be connected");n===s.ConnectorPosition.Begin?t.beginConnectionPointIndex=e:t.endConnectionPointIndex=e,this.raiseModelChanged([new i.ConnectorChange(t,i.ItemChangeType.Update)])},t.prototype.deleteConnection=function(t,e){var n=t.getExtremeItem(e);n&&(n.attachedConnectors.splice(n.attachedConnectors.indexOf(t),1),e===s.ConnectorPosition.Begin?(t.beginItem=null,t.beginConnectionPointIndex=-1):(t.endItem=null,t.endConnectionPointIndex=-1),this.raiseModelChanged([new i.ConnectorChange(t,i.ItemChangeType.Update)]))},t.prototype.changeConnectorProperty=function(t,e,n){t.properties[e]=n,t.invalidateRenderPoints(),t.invalidatePrimitives(),this.raiseModelChanged([new i.ConnectorChange(t,i.ItemChangeType.UpdateStructure)])},t.prototype.changeConnectorText=function(t,e,n){t.setText(e,n),t.invalidatePrimitives(),this.raiseModelChanged([new i.ConnectorChange(t,i.ItemChangeType.UpdateStructure)])},t.prototype.changeConnectorTextPosition=function(t,e,n){var o=t.getText(e);t.setText(e,null),t.setText(n,o),t.invalidatePrimitives(),this.raiseModelChanged([new i.ConnectorChange(t,i.ItemChangeType.UpdateStructure)])},t.prototype.changeModelSize=function(t,e){this.model.size.width=t.width,this.model.size.height=t.height,this.raiseModelChanged([new i.PageChange(this.model,i.PageChangeType.Update,e)])},t.prototype.changePageSize=function(t){this.model.pageSize=t,this.model.size=new r.Size(this.model.pageWidth,this.model.pageHeight),this.raiseModelChanged([new i.PageChange(this.model,i.PageChangeType.Update)])},t.prototype.changePageLandscape=function(t){this.model.pageLandscape=t,this.model.size=new r.Size(this.model.pageWidth,this.model.pageHeight),this.raiseModelChanged([new i.PageChange(this.model,i.PageChangeType.Update)])},t.prototype.changePageProperty=function(t,e){this.model[t]=e,this.raiseModelChanged([new i.PageChange(this.model,i.PageChangeType.Update)])},t.prototype.createItemChange=function(t,e){return t instanceof o.Shape?new i.ShapeChange(t,e):t instanceof s.Connector?new i.ConnectorChange(t,e):void 0},t.prototype.raiseModelChanged=function(t){this.onModelChanged.raise("NotifyModelChanged",t)},t}();e.ModelManipulator=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(216),i=n(0),r=n(236),s=function(){function t(t){this.onMouseOperation=new i.EventDispatcher,this.onTextInputOperation=new i.EventDispatcher,this.toolboxes=[],this.control=t,this.mouseHandler=new o.MouseHandler(t.history,t.selection,t.model,this),this.textInputHandler=new r.TextInputHandler(t)}return Object.defineProperty(t.prototype,"onVisualizersUpdate",{get:function(){return this.mouseHandler.onVisualizersUpdate},enumerable:!0,configurable:!0}),t.prototype.registerToolbox=function(t){this.toolboxes.push(t)},t.prototype.initialize=function(){this.mouseHandler.initialize(this.control.model)},t.prototype.onMouseDown=function(t){this.mouseHandler.onMouseDown(t)},t.prototype.onMouseMove=function(t){var e=this.getDraggingEvent();e&&!this.draggingEvent?(this.draggingEvent=e,this.mouseHandler.onDragStart(this.draggingEvent),this.control.captureFocus()):!e&&this.draggingEvent&&(delete this.draggingEvent,this.mouseHandler.onDragEnd(t)),this.mouseHandler.onMouseMove(t)},t.prototype.onMouseUp=function(t){this.mouseHandler.onMouseUp(t)},t.prototype.onMouseEnter=function(t){this.mouseHandler.onMouseEnter(t)},t.prototype.onMouseLeave=function(t){this.mouseHandler.onMouseLeave(t)},t.prototype.onDblClick=function(t){this.mouseHandler.onMouseDoubleClick(t),this.textInputHandler.onMouseDoubleClick(t)},t.prototype.onKeyDown=function(t){if(this.textInputHandler.isTextInputActive())this.textInputHandler.onKeyDown(t);else{var e=t.getShortcutCode();this.onShortcut(e)&&(this.mouseHandler.updateConnectionPoints(),this.mouseHandler.updateConnectionMarks(),t.preventDefault=!0)}},t.prototype.onInputBlur=function(t){this.textInputHandler.onInputBlur(t)},t.prototype.onInputFocus=function(t){this.textInputHandler.onInputFocus(t)},t.prototype.onShortcut=function(t){return!!this.control.commandManager.processShortcut(t)||(!!this.mouseHandler.onShortcut(t)||void 0)},t.prototype.onPaste=function(t){!this.textInputHandler.isTextInputActive()&&this.control.commandManager.processPaste(t.clipboardData)&&(this.mouseHandler.updateConnectionPoints(),this.mouseHandler.updateConnectionMarks(),t.preventDefault=!0)},t.prototype.isFocused=function(){return this.control.isFocused()},t.prototype.getDraggingEvent=function(){return this.toolboxes.filter(function(t){return t.draggingObject}).map(function(t){return t.draggingObject.evt})[0]},t.prototype.onDocumentDragEnd=function(t){this.onMouseOperation.raise("NotifyDragEnd",t),this.control.endUpdate()},t.prototype.onDocumentDragStart=function(t){this.control.beginUpdate(),this.control.captureFocus(),this.onMouseOperation.raise("NotifyDragStart",t)},t.prototype.raiseTextInputStart=function(t,e,n,o){this.onTextInputOperation.raise("NotifyTextInputStart",t,e,n,o)},t.prototype.raiseTextInputEnd=function(t){this.onTextInputOperation.raise("NotifyTextInputEnd",t)},t}();e.EventManager=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(217),i=n(14),r=n(0),s=n(233),a=n(16),c=n(8),u=n(21),p=n(92),h=n(9),l=n(44),d=n(234),f=n(235),y=n(67),m=n(66),g=function(){function t(t,e,n,o){this.history=t,this.selection=e,this.model=n,this.eventManager=o,this.onVisualizersUpdate=new r.EventDispatcher,this.initialize(n),this.connectionPointsVisualizer=new s.ConnectionPointsVisualizer(this.onVisualizersUpdate),this.connectionMarksVisualizer=new d.ConnectionMarksVisualizer(this.onVisualizersUpdate),this.connectionPointsVisualizer=new s.ConnectionPointsVisualizer(this.onVisualizersUpdate),this.connectionTargetVisualizer=new f.ConnectionTargetVisualizer(this.onVisualizersUpdate),this.extensionLinesVisualizer=new p.ExtensionLinesVisualizer(this.onVisualizersUpdate)}return t.prototype.initialize=function(t){this.model=t,this.defaultState=new o.MouseHandlerDefaultState(this,this.history,this.selection,this.model),this.switchToDefaultState()},t.prototype.onMouseDown=function(t){this.state.onMouseDown(t)},t.prototype.onMouseMove=function(t){this.state.onMouseMove(t)},t.prototype.onMouseUp=function(t){this.state.onMouseUp(t)},t.prototype.onMouseDoubleClick=function(t){this.state.onMouseDoubleClick(t),this.switchToDefaultState()},t.prototype.onMouseEnter=function(t){},t.prototype.onMouseLeave=function(t){this.resetConnectionPoints(),this.resetConnectionMarks(),this.resetConnectionTarget(),this.resetExtensionLines()},t.prototype.onShortcut=function(t){return this.state.onShortcut(t)},t.prototype.onDragStart=function(t){this.state.onDragStart(t)},t.prototype.onDragEnd=function(t){this.state.onDragEnd(t)},t.prototype.getSnappedPos=function(t,e){return!this.model.snapToGrid||t.modifiers&a.ModifierKey.Ctrl?e:c.ModelUtils.getSnappedPos(this.model,e)},t.prototype.getSnappedPoint=function(t,e,n){var o=this.getSnappedPos(t,e.x),i=this.getSnappedPos(t,e.y);return void 0===n?new r.Point(o,i):Math.pow(e.x-o,2)+Math.pow(e.y-i,2)<Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2)?new r.Point(o,i):n},t.prototype.tryUpdateModelSize=function(t){c.ModelUtils.tryUpdateModelSize(this.history,this.model,t)},t.prototype.setConnectionPoints=function(t,e,n){if(this.eventManager.isFocused())if(!t||t.locked||e!==i.MouseEventElementType.Shape&&e!==i.MouseEventElementType.ShapeConnectionPoint&&e!==i.MouseEventElementType.ShapeConnection||void 0===t)this.connectionPointsVisualizer.reset();else{var o=t.key;if(!this.selection.hasKey(o)){var r=t.getConnectionPoints();this.connectionPointsVisualizer.setPoints(o,r.map(function(e,n){return new y.ConnectionPointInfo(e,t.getConnectionPointSide(n))}),n)}}},t.prototype.setConnectionPointIndex=function(t){this.connectionPointsVisualizer.setPointIndex(t)},t.prototype.updateConnectionPoints=function(){void 0!==this.model.findItem(this.connectionPointsVisualizer.getKey())?this.connectionPointsVisualizer.update():this.connectionPointsVisualizer.reset()},t.prototype.resetConnectionPoints=function(){this.connectionPointsVisualizer.reset()},t.prototype.setConnectionMarks=function(t,e,n){if(this.eventManager.isFocused())if(!t||t.locked||e!==i.MouseEventElementType.Shape&&e!==i.MouseEventElementType.ShapeConnectionPoint&&e!==i.MouseEventElementType.ShapeConnection||void 0===t)this.connectionMarksVisualizer.reset();else{var o=t.key,r=t.getConnectionPointsForSelection();this.connectionMarksVisualizer.setPoints(o,r.map(function(e,n){return new y.ConnectionPointInfo(e,t.getConnectionPointForSelectionSide(n))}),n)}},t.prototype.updateConnectionMarks=function(){void 0!==this.model.findItem(this.connectionMarksVisualizer.getKey())?this.connectionMarksVisualizer.update():this.connectionMarksVisualizer.reset()},t.prototype.resetConnectionMarks=function(){this.connectionMarksVisualizer.reset()},t.prototype.setConnectionTarget=function(t,e){!t||t.locked||e!==i.MouseEventElementType.Shape&&e!==i.MouseEventElementType.ShapeConnectionPoint&&e!==i.MouseEventElementType.ShapeConnection?this.connectionTargetVisualizer.reset():this.connectionTargetVisualizer.setTargetRect(t.key,t.rectangle)},t.prototype.resetConnectionTarget=function(){this.connectionTargetVisualizer.reset()},t.prototype.setExtensionLines=function(t){var e=this;if(this.eventManager.isFocused()){this.extensionLinesVisualizer.reset();var n=u.DiagramModel.getRectangle(t.filter(function(t){return t&&!t.locked}));this.addPageExtensionLines(n),this.model.items.forEach(function(o){o.locked||t.indexOf(o)>-1||o instanceof h.Shape&&e.addShapeExtensionLines(o,n)})}},t.prototype.addPageExtensionLines=function(t){for(var e=Math.round(this.model.size.width/this.model.pageWidth),n=Math.round(this.model.size.height/this.model.pageHeight),o=0;o<e;o++)for(var i=0;i<n;i++){var s=new r.Point(o*this.model.pageWidth+this.model.pageWidth/2,i*this.model.pageHeight+this.model.pageHeight/2);if(Math.abs(t.center.x-s.x)<this.model.gridSize/2){var a=new r.Segment(new r.Point(t.center.x,0),new r.Point(t.center.x,this.model.size.height));this.extensionLinesVisualizer.addSegment(p.ExtensionLineType.HorizontalCenterToPageCenter,a,"")}if(Math.abs(t.center.y-s.y)<this.model.gridSize/2){a=new r.Segment(new r.Point(0,t.center.y),new r.Point(this.model.size.width,t.center.y));this.extensionLinesVisualizer.addSegment(p.ExtensionLineType.VerticalCenterToPageCenter,a,"")}if(Math.abs(t.left-s.x)<this.model.gridSize/2){a=new r.Segment(new r.Point(t.left,0),new r.Point(t.left,this.model.size.height));this.extensionLinesVisualizer.addSegment(p.ExtensionLineType.LeftToPageCenter,a,"")}if(Math.abs(t.top-s.y)<this.model.gridSize/2){a=new r.Segment(new r.Point(0,t.top),new r.Point(this.model.size.width,t.top));this.extensionLinesVisualizer.addSegment(p.ExtensionLineType.TopToPageCenter,a,"")}if(Math.abs(t.right-s.x)<this.model.gridSize/2){a=new r.Segment(new r.Point(t.right,0),new r.Point(t.right,this.model.size.height));this.extensionLinesVisualizer.addSegment(p.ExtensionLineType.RightToPageCenter,a,"")}if(Math.abs(t.bottom-s.y)<this.model.gridSize/2){a=new r.Segment(new r.Point(0,t.bottom),new r.Point(this.model.size.width,t.bottom));this.extensionLinesVisualizer.addSegment(p.ExtensionLineType.BottomToPageCenter,a,"")}}},t.prototype.addShapeExtensionLines=function(t,e){var n,o,i,s,a=t.rectangle,c=h.Shape.lineWidth-l.CanvasManager.extensionLineWidth,u=!0;if(e.right<a.left?(n=e.right+c+l.CanvasManager.extensionLineOffset,i=a.left-l.CanvasManager.extensionLineOffset):e.left>a.right&&(n=e.left-l.CanvasManager.extensionLineOffset,i=a.right+c+l.CanvasManager.extensionLineOffset),e.bottom<a.top?(o=e.bottom+c+l.CanvasManager.extensionLineOffset,s=a.top-l.CanvasManager.extensionLineOffset):e.top>a.bottom&&(o=e.top-l.CanvasManager.extensionLineOffset,s=a.bottom+c+l.CanvasManager.extensionLineOffset),null!=n&&void 0!==i){if(e.center.y===a.center.y){var d=new r.Segment(new r.Point(n,e.center.y),new r.Point(i,a.center.y));this.extensionLinesVisualizer.addSegment(n>i?p.ExtensionLineType.VerticalCenterAfter:p.ExtensionLineType.VerticalCenterBefore,d,u?this.model.getModelUnitText(d.distance):""),u=!1}if(e.top===a.top){d=new r.Segment(new r.Point(n,e.top),new r.Point(i,a.top));this.extensionLinesVisualizer.addSegment(n>i?p.ExtensionLineType.TopToTopAfter:p.ExtensionLineType.TopToTopBefore,d,u?this.model.getModelUnitText(d.distance):"")}if(e.bottom===a.bottom){d=new r.Segment(new r.Point(n,e.bottom+c),new r.Point(i,a.bottom+c));this.extensionLinesVisualizer.addSegment(n>i?p.ExtensionLineType.BottomToBottomAfter:p.ExtensionLineType.BottomToBottomBefore,d,u?this.model.getModelUnitText(d.distance):"")}if(e.top===a.bottom){d=new r.Segment(new r.Point(n,e.top),new r.Point(i,a.bottom+c));this.extensionLinesVisualizer.addSegment(n>i?p.ExtensionLineType.TopToBottomAfter:p.ExtensionLineType.TopToBottomBefore,d,u?this.model.getModelUnitText(d.distance):"")}if(e.bottom===a.top){d=new r.Segment(new r.Point(n,e.bottom+c),new r.Point(i,a.top));this.extensionLinesVisualizer.addSegment(n>i?p.ExtensionLineType.BottomToTopAfter:p.ExtensionLineType.BottomToTopBefore,d,u?this.model.getModelUnitText(d.distance):"")}}if(null!=o&&void 0!==s){if(e.center.x===a.center.x){d=new r.Segment(new r.Point(e.center.x,o),new r.Point(a.center.x,s));this.extensionLinesVisualizer.addSegment(o>s?p.ExtensionLineType.HorizontalCenterBelow:p.ExtensionLineType.HorizontalCenterAbove,d,u?this.model.getModelUnitText(d.distance):""),u=!1}if(e.left===a.left){d=new r.Segment(new r.Point(e.left,o),new r.Point(a.left,s));this.extensionLinesVisualizer.addSegment(o>s?p.ExtensionLineType.LeftToLeftBelow:p.ExtensionLineType.LeftToLeftAbove,d,u?this.model.getModelUnitText(d.distance):"")}if(e.right===a.right){d=new r.Segment(new r.Point(e.right+c,o),new r.Point(a.right+c,s));this.extensionLinesVisualizer.addSegment(o>s?p.ExtensionLineType.RightToRightBelow:p.ExtensionLineType.RightToRightAbove,d,u?this.model.getModelUnitText(d.distance):"")}if(e.left===a.right){d=new r.Segment(new r.Point(e.left,o),new r.Point(a.right+c,s));this.extensionLinesVisualizer.addSegment(o>s?p.ExtensionLineType.LeftToRightBelow:p.ExtensionLineType.LeftToRightAbove,d,u?this.model.getModelUnitText(d.distance):"")}if(e.right===a.left){d=new r.Segment(new r.Point(e.right+c,o),new r.Point(a.left,s));this.extensionLinesVisualizer.addSegment(o>s?p.ExtensionLineType.RightToLeftBelow:p.ExtensionLineType.RightToLeftAbove,d,u?this.model.getModelUnitText(d.distance):"")}}},t.prototype.resetExtensionLines=function(){this.extensionLinesVisualizer.reset()},t.prototype.raiseDragStart=function(t){this.eventManager.onDocumentDragStart(t)},t.prototype.raiseDragEnd=function(t){this.eventManager.onDocumentDragEnd(t)},t.prototype.switchToDefaultState=function(){this.switchState(this.defaultState)},t.prototype.switchToMoveClonedShapeState=function(t){this.switchState(new m.MouseHandlerMoveClonedShapeState(this,this.history,this.model,this.selection,t))},t.prototype.switchState=function(t){this.state&&this.state.finish(),this.state=t,this.state.start()},t}();e.MouseHandler=g},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(45),s=n(14),a=n(218),c=n(220),u=n(221),p=n(223),h=n(224),l=n(16),d=n(226),f=n(228),y=n(13),m=n(229),g=n(230),v=n(231),P=n(66),C=function(t){function e(e,n,o,i){var r=t.call(this,e)||this;return r.history=n,r.selection=o,r.model=i,r}return i(e,t),e.prototype.finish=function(){this.handler.resetConnectionPoints(),this.handler.resetConnectionMarks(),t.prototype.finish.call(this)},e.prototype.onMouseDown=function(t){if(t.source.type===s.MouseEventElementType.Shape){var e=t.source.key;P.MouseHandlerMoveClonedShapeState.isMoveClonedShapeEvent(t)?(this.selection.add(e),this.handler.switchToMoveClonedShapeState()):(this.modifySelection(t,e),this.handler.switchState(new a.MouseHandlerMoveShapeState(this.handler,this.history,this.model,this.selection))),this.handler.state.onMouseDown(t)}else if(t.source.type===s.MouseEventElementType.Connector){var n=t.source.key;this.modifySelection(t,n)}else if(t.source.type===s.MouseEventElementType.ConnectorText){n=t.source.key;this.modifySelection(t,n),this.handler.switchState(new v.MouseHandlerMoveConnectorTextState(this.handler,this.history,this.model)),this.handler.state.onMouseDown(t)}else t.source.type===s.MouseEventElementType.ShapeResizeBox?(this.handler.switchState(new u.MouseHandlerResizeShapeState(this.handler,this.history,this.model,this.selection)),this.handler.state.onMouseDown(t)):t.source.type===s.MouseEventElementType.ShapeParameterBox?(this.handler.switchState(new h.MouseHandlerDragParameterPointState(this.handler,this.history,this.model)),this.handler.state.onMouseDown(t)):t.source.type===s.MouseEventElementType.ConnectorPoint?(this.handler.switchState(new c.MouseHandlerMoveConnectorPointState(this.handler,this.history,this.model)),this.handler.state.onMouseDown(t)):t.source.type===s.MouseEventElementType.ConnectorSide?(this.handler.switchState(new p.MouseHandlerMoveConnectorSideState(this.handler,this.history,this.model)),this.handler.state.onMouseDown(t)):t.source.type===s.MouseEventElementType.ConnectorOrthogonalSide?(this.handler.switchState(new m.MouseHandlerMoveConnectorOrthogonalSideState(this.handler,this.history,this.model)),this.handler.state.onMouseDown(t)):t.source.type===s.MouseEventElementType.ShapeConnectionPoint?(this.handler.switchState(new f.MouseHandlerCreateConnectorState(this.handler,this.history,this.model,this.selection)),this.handler.state.onMouseDown(t)):t.source.type===s.MouseEventElementType.ShapeConnection?(this.handler.switchState(new f.MouseHandlerCreateConnectorState(this.handler,this.history,this.model,this.selection,-1)),this.handler.state.onMouseDown(t)):(this.handler.switchState(new d.MouseHandlerSelectionState(this.handler,this.selection)),this.handler.state.onMouseDown(t))},e.prototype.onDragStart=function(t){this.handler.switchState(new g.MouseHandlerBeforeToolboxDraggingState(this.handler,this.history,this.model,this.selection)),this.handler.state.onDragStart(t)},e.prototype.onMouseMove=function(t){var e=this.model.findItem(t.source.key),n=-1;t.source.value&&t.source.type===s.MouseEventElementType.ShapeConnectionPoint&&(n=parseInt(t.source.value)),this.handler.setConnectionPoints(e,t.source.type,n);var o=-1;t.source.value&&t.source.type===s.MouseEventElementType.ShapeConnection&&(o=parseInt(t.source.value)),this.handler.setConnectionMarks(e,t.source.type,o)},e.prototype.modifySelection=function(t,e){t.modifiers&l.ModifierKey.Ctrl||t.modifiers&l.ModifierKey.Shift?this.selection.hasKey(e)?this.selection.remove(e):this.selection.add(e):this.selection.hasKey(e)||this.selection.set([e])},e.itemEdge=y.UnitConverter.pixelsToTwips(10),e}(r.MouseHandlerStateBase);e.MouseHandlerDefaultState=C},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(66),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.onMouseMove=function(e){t.prototype.onMouseMove.call(this,e),this.switchToMoveClonedShapeState(e)},e.prototype.switchToMoveClonedShapeState=function(t){r.MouseHandlerMoveClonedShapeState.isMoveClonedShapeEvent(t)&&(this.cancelChanges(),this.handler.switchToMoveClonedShapeState(this.startPoint),this.handler.onMouseDown(t))},e}(n(219).MouseHandlerMoveShapeOrthogonallyState);e.MouseHandlerMoveShapeState=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(16),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.onApplyChanges=function(e){this.calculateFixedPosition(e),t.prototype.onApplyChanges.call(this,e)},e.prototype.getXPosition=function(e,n){return this.fixedX?n:t.prototype.getXPosition.call(this,e,n)},e.prototype.getYPosition=function(e,n){return this.fixedY?n:t.prototype.getYPosition.call(this,e,n)},e.prototype.calculateFixedPosition=function(t){(this.fixedX=!1,this.fixedY=!1,t.modifiers&r.ModifierKey.Shift)&&(Math.abs(this.startPoint.x-t.layoutPoint.x)<Math.abs(this.startPoint.y-t.layoutPoint.y)?this.fixedX=!0:this.fixedY=!0)},e}(n(95).MouseHandlerMoveShapeStateBase);e.MouseHandlerMoveShapeOrthogonallyState=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(96),s=n(5),a=n(8),c=n(0),u=n(28),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.onMouseDown=function(e){this.connector=this.model.findConnector(e.source.key),this.pointIndex=parseInt(e.source.value),0===this.pointIndex?this.pointPosition=s.ConnectorPosition.Begin:this.pointIndex===this.connector.points.length-1&&(this.pointPosition=s.ConnectorPosition.End),t.prototype.onMouseDown.call(this,e)},e.prototype.onApplyChanges=function(e){this.connector.properties.lineOption===u.ConnectorLineOption.Orthogonal&&0!==this.pointIndex&&this.pointIndex!==this.connector.points.length-1||t.prototype.onApplyChanges.call(this,e)},e.prototype.onFinishWithChanges=function(){a.ModelUtils.removeUnnecessaryConnectorPoints(this.history,this.connector)},e.prototype.getSnappedPoint=function(t,e){var n=this.connector.points,o=this.pointIndex;if(0<o&&o<n.length-1){var i=(n[o+1].y-n[o-1].y)/(n[o+1].x-n[o-1].x),r=e.x,s=n[o+1].y-(n[o+1].x-r)*i;return this.handler.getSnappedPoint(t,e,new c.Point(r,s))}return this.handler.getSnappedPoint(t,e)},e}(r.MouseHandlerMoveConnectorPointStateBase);e.MouseHandlerMoveConnectorPointState=p},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=n(14),a=n(16),c=n(24),u=n(21),p=n(8),h=n(222),l=n(44),d=function(t){function e(e,n,o,i){var r=t.call(this,e,n)||this;return r.model=o,r.selection=i,r.startScrollLeft=0,r.startScrollTop=0,r.rotation=0,r}return i(e,t),e.prototype.start=function(){this.resizeInfoVisualizer=new h.ResizeInfoVisualizer(this.handler.onVisualizersUpdate),t.prototype.start.call(this)},e.prototype.finish=function(){this.resetResizeInfo(),this.handler.resetExtensionLines(),t.prototype.finish.call(this)},e.prototype.onMouseDown=function(e){var n=parseInt(e.source.value);this.resizeEventSource=n,this.startPoint=e.layoutPoint,this.lockH=n==s.ResizeEventSource.ResizeBox_S||n==s.ResizeEventSource.ResizeBox_N,this.lockV=n==s.ResizeEventSource.ResizeBox_E||n==s.ResizeEventSource.ResizeBox_W,this.sideH=n==s.ResizeEventSource.ResizeBox_E||n==s.ResizeEventSource.ResizeBox_NE||n==s.ResizeEventSource.ResizeBox_SE,this.sideV=n==s.ResizeEventSource.ResizeBox_SE||n==s.ResizeEventSource.ResizeBox_S||n==s.ResizeEventSource.ResizeBox_SW,this.shapes=this.selection.getSelectedShapes(),0!==this.shapes.length?(this.connectors=this.selection.getSelectedConnectors(),this.startRectangle=u.DiagramModel.getRectangle(this.shapes),this.startShapeSizes=this.shapes.map(function(t){return t.size.clone()}),this.startShapePositions=this.shapes.map(function(t){return t.position.clone()}),this.startConnectorPoints=this.connectors.map(function(t){return t.points.map(function(t){return t.clone()})}),this.lockAspectRatio=!!(e.modifiers&a.ModifierKey.Shift),t.prototype.onMouseDown.call(this,e)):this.handler.switchToDefaultState()},e.prototype.onMouseMove=function(e){t.prototype.onMouseMove.call(this,e);this.selection.getSelectedItems();this.handler.setExtensionLines(this.selection.getSelectedShapes())},e.prototype.onApplyChanges=function(t){var e=this,n=u.DiagramModel.getRectangle(this.shapes),o=this.getSize(t,n.position,this.startRectangle.size),i=this.getPosition(t,o,this.startRectangle.size,this.startRectangle.position),s=o.width/this.startRectangle.width,a=o.height/this.startRectangle.height;this.shapes.forEach(function(t,n){var o=new r.Size(e.startShapeSizes[n].width*s,e.startShapeSizes[n].height*a),c=new r.Point(i.x+(e.startShapePositions[n].x-e.startRectangle.left)*s,i.y+(e.startShapePositions[n].y-e.startRectangle.top)*a);p.ModelUtils.setShapeSize(e.history,e.model,t.key,c,o,e.history.addOrModifyAndRedo),t.attachedConnectors.forEach(function(t){p.ModelUtils.updateConnectorAttachedPoints(e.history,t,e.history.addOrModifyAndRedo)})}),this.connectors.forEach(function(t,n){for(var o=t.beginItem?1:0,c=t.endItem?t.points.length-2:t.points.length-1,u=o;u<=c;u++){var h=new r.Point(i.x+(e.startConnectorPoints[n][u].x-e.startRectangle.left)*s,i.y+(e.startConnectorPoints[n][u].y-e.startRectangle.top)*a);p.ModelUtils.setConnectorPoint(e.history,e.model,t.key,u,h,e.history.addOrModifyAndRedo)}}),this.tryUpdateModelSize(),this.setResizeInfo()},e.prototype.tryUpdateModelSize=function(){var t=this;this.handler.tryUpdateModelSize(function(e,n){t.startShapePositions.forEach(function(t){t.x+=e,t.y+=n}),t.startConnectorPoints.forEach(function(t){t.forEach(function(t){t.x+=e,t.y+=n})}),t.startRectangle.position.x+=e,t.startRectangle.position.y+=n,t.startPoint.x+=e,t.startPoint.y+=n})},e.prototype.setResizeInfo=function(){var t=u.DiagramModel.getRectangle(this.shapes),e=new r.Point(t.center.x,t.bottom+l.CanvasManager.resizeInfoOffset),n=this.model.getModelUnitText(t.width)+" x "+this.model.getModelUnitText(t.height);this.resizeInfoVisualizer.set(e,n)},e.prototype.resetResizeInfo=function(){this.resizeInfoVisualizer.reset()},e.prototype.getDraggingElementKeys=function(){return this.shapes.map(function(t){return t.key})},e.prototype.getSize=function(t,n,o){var i,s,a=t.layoutPoint.x-(this.startScrollLeft-t.scrollX)-this.startPoint.x,c=t.layoutPoint.y-(this.startScrollTop-t.scrollY)-this.startPoint.y,u=a*Math.cos(this.rotation)- -c*Math.sin(this.rotation),p=-(a*Math.sin(this.rotation)+-c*Math.cos(this.rotation));return p=!this.sideV&&p>0?Math.min(o.height+1,p):p,u=!this.sideH&&u>0?Math.min(o.width+1,u):u,this.lockH||this.lockV||!this.lockAspectRatio?(u=this.lockH?0:u,p=this.lockV?0:p,i=Math.max(e.minSize,this.sideH?o.width+u:o.width-u),s=Math.max(e.minSize,this.sideV?o.height+p:o.height-p)):Math.abs(u)>Math.abs(p)?(i=this.sideH?Math.max(e.minSize,o.width+u):o.width-u,s=o.height*(i/o.width)):(s=this.sideV?Math.max(e.minSize,o.height+p):o.height-p,i=o.width*(s/o.height)),this.lockH||(i=this.handler.getSnappedPos(t,n.x+i)-n.x),this.lockV||(s=this.handler.getSnappedPos(t,n.y+s)-n.y),new r.Size(i,s)},e.prototype.getPosition=function(t,e,n,o){var i=o.x,a=o.y;if(this.resizeEventSource===s.ResizeEventSource.ResizeBox_N||this.resizeEventSource===s.ResizeEventSource.ResizeBox_NE||this.resizeEventSource===s.ResizeEventSource.ResizeBox_NW){a+=n.height-e.height;var c=this.handler.getSnappedPos(t,a);e.height+=a-c,a=c}if(this.resizeEventSource===s.ResizeEventSource.ResizeBox_W||this.resizeEventSource===s.ResizeEventSource.ResizeBox_NW||this.resizeEventSource===s.ResizeEventSource.ResizeBox_SW){i+=n.width-e.width;var u=this.handler.getSnappedPos(t,i);e.width+=i-u,i=u}return new r.Point(i,a)},e.minSize=360,e}(c.MouseHandlerDraggingState);e.MouseHandlerResizeShapeState=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this.dispatcher=t}return t.prototype.set=function(t,e){this.point=t,this.text=e,this.raiseShow()},t.prototype.reset=function(){void 0!==this.point&&(this.point=void 0,this.text=void 0,this.raiseHide())},t.prototype.raiseShow=function(){var t=this;this.dispatcher.raise1(function(e){return e.NotifyResizeInfoShow(t.point,t.text)})},t.prototype.raiseHide=function(){this.dispatcher.raise1(function(t){return t.NotifyResizeInfoHide()})},t}();e.ResizeInfoVisualizer=o},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),s=n(97),a=n(36),c=n(8),u=function(t){function e(e,n,o){var i=t.call(this,e,n)||this;return i.model=o,i}return i(e,t),e.prototype.onMouseDown=function(e){this.startPoint=e.layoutPoint,this.connectorKey=e.source.key,this.pointIndex=parseInt(e.source.value),t.prototype.onMouseDown.call(this,e)},e.prototype.onApplyChanges=function(t){var e=this.getSnappedPoint(t,t.layoutPoint);this.pointCreated?this.history.addOrModifyAndRedo(new a.MoveConnectorPointHistoryItem(this.connectorKey,this.pointIndex,e)):(this.history.addOrModifyAndRedo(new s.AddConnectorPointHistoryItem(this.connectorKey,this.pointIndex,e)),this.pointCreated=!0),this.handler.tryUpdateModelSize()},e.prototype.onFinishWithChanges=function(){c.ModelUtils.removeUnnecessaryConnectorPoints(this.history,this.model.findConnector(this.connectorKey))},e.prototype.getDraggingElementKeys=function(){return[this.connectorKey]},e}(r.MouseHandlerDraggingState);e.MouseHandlerMoveConnectorSideState=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),s=n(225),a=function(t){function e(e,n,o){var i=t.call(this,e,n)||this;return i.model=o,i.startScrollLeft=0,i.startScrollTop=0,i}return i(e,t),e.prototype.onMouseDown=function(e){this.startPoint=e.layoutPoint,this.shape=this.model.findShape(e.source.key),this.parameterPointKey=e.source.value,this.startParameters=this.shape.parameters.clone(),t.prototype.onMouseDown.call(this,e)},e.prototype.onApplyChanges=function(t){var e=this.handler.getSnappedPos(t,t.layoutPoint.x-this.startPoint.x),n=this.handler.getSnappedPos(t,t.layoutPoint.y-this.startPoint.y),o=this.startParameters.clone();this.shape.description.modifyParameters(this.shape,o,e,n),this.history.addOrModifyAndRedo(new s.ChangeShapeParametersHistoryItem(this.shape.key,o))},e.prototype.getDraggingElementKeys=function(){return[this.shape.key]},e}(r.MouseHandlerDraggingState);e.MouseHandlerDragParameterPointState=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var o=t.call(this)||this;return o.shapeKey=e,o.parameters=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);this.oldParameters=e.parameters.clone(),t.changeShapeParameters(e,this.parameters)},e.prototype.undo=function(t){var e=t.model.findShape(this.shapeKey);t.changeShapeParameters(e,this.oldParameters)},e}(n(4).HistoryItem);e.ChangeShapeParametersHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(14),s=n(0),a=n(227),c=function(t){function e(e,n){var o=t.call(this,e)||this;return o.selection=n,o}return i(e,t),e.prototype.cancelChanges=function(){},e.prototype.start=function(){this.selectionRectangleVisualizer=new a.SelectionRectVisualizer(this.handler.onVisualizersUpdate),t.prototype.start.call(this)},e.prototype.finish=function(){this.selectionRectangleVisualizer.reset(),t.prototype.finish.call(this)},e.prototype.onMouseDown=function(t){this.startPoint=t.layoutPoint},e.prototype.onMouseMove=function(t){if(t.button===r.MouseButton.Left){var e=s.Rectangle.createByPoints(this.startPoint,t.layoutPoint);this.selectionRectangleVisualizer.setRectangle(e)}else this.handler.switchToDefaultState()},e.prototype.onMouseUp=function(t){var e=this.selectionRectangleVisualizer.getRectangle();void 0!==e?this.selection.selectRect(e):this.selection.set([]),this.handler.switchToDefaultState()},e}(n(45).MouseHandlerCancellableState);e.MouseHandlerSelectionState=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this.dispatcher=t}return t.prototype.getRectangle=function(){return this.rect},t.prototype.setRectangle=function(t){this.rect=t,this.raiseShow()},t.prototype.reset=function(){this.rect=void 0,this.raiseHide()},t.prototype.raiseShow=function(){var t=this;this.dispatcher.raise1(function(e){return e.NotifySelectionRectShow(t.rect)})},t.prototype.raiseHide=function(){this.dispatcher.raise1(function(t){return t.NotifySelectionRectHide()})},t}();e.SelectionRectVisualizer=o},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),s=n(35),a=n(58),c=n(96),u=n(29),p=n(91),h=n(63),l=n(42),d=function(t){function e(e,n,o,i,r){var s=t.call(this,e,n,o)||this;return s.selection=i,s.connectionPointIndex=r,s}return i(e,t),e.prototype.onMouseDown=function(e){void 0===this.connectionPointIndex&&(this.connectionPointIndex=parseInt(e.source.value)),this.connectedItem=this.model.findItem(e.source.key),this.pointIndex=1,this.pointPosition=r.ConnectorPosition.End,t.prototype.onMouseDown.call(this,e)},e.prototype.onApplyChanges=function(e){var n=this,o=this.getSnappedPoint(e,e.layoutPoint);if(this.connector)t.prototype.onApplyChanges.call(this,e);else{var i=new a.AddConnectorHistoryItem([this.connectedItem.getConnectionPoint(this.connectionPointIndex,o),o]);this.history.addOrModifyAndRedo(i),this.connector=this.model.findConnector(i.connectorKey),this.connector.properties.forEach(function(t){n.history.addOrModifyAndRedo(new p.ChangeConnectorPropertyHistoryItem(n.connector.key,t,n.selection.inputPosition.getConnectorPropertyDefaultValue(t)))}),this.connector.style.forEach(function(t){n.history.addOrModifyAndRedo(new h.ChangeStyleHistoryItem(n.connector.key,t,n.selection.inputPosition.getStylePropertyDefaultValue(t)))}),this.connector.styleText.forEach(function(t){n.history.addOrModifyAndRedo(new l.ChangeStyleTextHistoryItem(n.connector.key,t,n.selection.inputPosition.getStyleTextPropertyDefaultValue(t)))}),this.history.addOrModifyAndRedo(new s.AddConnectionHistoryItem(this.connector,this.connectedItem,this.connectionPointIndex,r.ConnectorPosition.Begin))}},e.prototype.onFinishWithChanges=function(){this.history.addAndRedo(new u.SetSelectionHistoryItem(this.selection,[this.connector.key]))},e}(c.MouseHandlerMoveConnectorPointStateBase);e.MouseHandlerCreateConnectorState=d},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=n(5),a=n(24),c=n(97),u=n(36),p=n(8),h=n(3),l=function(t){function e(e,n,o){var i=t.call(this,e,n)||this;return i.model=o,i}return i(e,t),e.prototype.onMouseDown=function(e){this.startPoint=e.layoutPoint,this.connector=this.model.findConnector(e.source.key);var n=e.source.value.split("_"),o=parseInt(n[0]),i=parseInt(n[1]),r=this.connector.getRenderPoints(!0);this.renderPoint1=r[o].clone(),this.renderPoint2=r[i].clone(),this.isVerticalOrientation=this.renderPoint1.x===this.renderPoint2.x,-1!==this.renderPoint1.pointIndex?(this.pointIndex1=this.renderPoint1.pointIndex,0===this.pointIndex1?(this.pointIndex1++,this.correctEdgePoint(this.renderPoint1,this.renderPoint2,this.connector.beginItem,this.connector.beginConnectionPointIndex)):this.point1=this.connector.points[this.pointIndex1]):this.pointIndex1=this.findPointIndex(r,o,!1)+1,-1!==this.renderPoint2.pointIndex?(this.pointIndex2=this.renderPoint2.pointIndex,this.pointIndex2===this.connector.points.length-1?this.correctEdgePoint(this.renderPoint2,this.renderPoint1,this.connector.endItem,this.connector.endConnectionPointIndex):this.point2=this.connector.points[this.pointIndex2]):this.pointIndex2=this.findPointIndex(r,i,!0),t.prototype.onMouseDown.call(this,e)},e.prototype.onApplyChanges=function(t){var e=this;if(!this.pointCreated){var n=void 0,o=void 0;void 0===this.point1&&(this.point1=new r.Point(this.renderPoint1.x,this.renderPoint1.y),this.history.addOrModifyAndRedo(new c.AddConnectorPointHistoryItem(this.connector.key,this.pointIndex1,this.point1)),n=this.point1,this.pointIndex2++),void 0===this.point2&&(this.point2=new r.Point(this.renderPoint2.x,this.renderPoint2.y),this.history.addOrModifyAndRedo(new c.AddConnectorPointHistoryItem(this.connector.key,this.pointIndex2,this.point2)),o=this.point2),p.ModelUtils.removeUnnecessaryConnectorPoints(this.history,this.connector,[n,o],function(t){t<e.pointIndex1&&e.pointIndex1--,t<e.pointIndex2&&e.pointIndex2--}),this.pointCreated=!0}var i=this.getSnappedPoint(t,t.layoutPoint);this.isVerticalOrientation?(this.point1.x=i.x,this.point2.x=i.x):(this.point1.y=i.y,this.point2.y=i.y),this.history.addOrModifyAndRedo(new u.MoveConnectorPointHistoryItem(this.connector.key,this.pointIndex1,this.point1)),this.history.addOrModifyAndRedo(new u.MoveConnectorPointHistoryItem(this.connector.key,this.pointIndex2,this.point2)),this.handler.tryUpdateModelSize()},e.prototype.onFinishWithChanges=function(){p.ModelUtils.removeUnnecessaryConnectorPoints(this.history,this.connector)},e.prototype.findPointIndex=function(t,e,n){for(var o;o=t[e];){if(-1!==o.pointIndex)return o.pointIndex;e+=n?1:-1}},e.prototype.correctEdgePoint=function(t,e,n,o){var i=0;if(void 0!==n){var r=n.getConnectionPointSide(o),a=n.rectangle;switch(i=s.Connector.minOffset,r){case h.ConnectionPointSide.South:i+=a.bottom-t.y;break;case h.ConnectionPointSide.North:i+=t.y-a.top;break;case h.ConnectionPointSide.East:i+=a.right-t.x;break;case h.ConnectionPointSide.West:i+=t.x-a.left}}this.isVerticalOrientation?t.y>e.y?t.y-=Math.min(i,t.y-e.y):t.y+=Math.min(i,e.y-t.y):t.x>e.x?t.x-=Math.min(i,t.x-e.x):t.x+=Math.min(i,e.x-t.x)},e.prototype.getDraggingElementKeys=function(){return[this.connector.key]},e}(a.MouseHandlerDraggingState);e.MouseHandlerMoveConnectorOrthogonalSideState=l},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(30),s=n(0),a=n(51),c=n(29),u=n(63),p=n(42),h=n(24),l=n(74),d=n(8),f=n(45),y=300,m=function(t){function e(e,n,o,i){var r=t.call(this,e)||this;return r.history=n,r.model=o,r.selection=i,r}return i(e,t),e.prototype.cancelChanges=function(){this.tryRemoveTimer()},e.prototype.onDragStart=function(t){this.dragging=t},e.prototype.onDragEnd=function(t){this.cancelChanges(),this.handler.switchToDefaultState()},e.prototype.onMouseMove=function(t){var e=this;this.canSwitchToDraggingState(t)?(this.tryRemoveTimer(),this.switchToDraggingState(t,!1)):void 0!==t.source.type?(this.savedEvt=t,void 0===this.nonPageAreaTimer&&(this.nonPageAreaTimer=setTimeout(function(){return e.switchToDraggingState(e.savedEvt,!0)},500))):void 0!==this.nonPageAreaTimer&&this.tryRemoveTimer()},e.prototype.switchToDraggingState=function(t,e){this.handler.switchState(new g(this.handler,this.history,this.model,this.selection,e)),this.handler.state.onDragStart(this.dragging),this.handler.state.onMouseMove(t)},e.prototype.canSwitchToDraggingState=function(t){return void 0!==t.source.type&&t.layoutPoint.x>=0&&t.layoutPoint.x<=this.model.size.width&&t.layoutPoint.y>=0&&t.layoutPoint.y<=this.model.size.height},e.prototype.tryRemoveTimer=function(){void 0!==this.nonPageAreaTimer&&(clearTimeout(this.nonPageAreaTimer),delete this.nonPageAreaTimer)},e.prototype.finish=function(){this.tryRemoveTimer()},e}(f.MouseHandlerCancellableState);e.MouseHandlerBeforeToolboxDraggingState=m;var g=function(t){function e(e,n,o,i,r){var s=t.call(this,e,n)||this;return s.model=o,s.selection=i,r||(s.updatePageSizeTimer=setTimeout(function(){s.handler.tryUpdateModelSize(),delete s.updatePageSizeTimer},y)),s}return i(e,t),e.prototype.onMouseMove=function(e){t.prototype.onMouseMove.call(this,e);var n=this.model.findShape(this.shapeKey);n&&this.handler.setExtensionLines([n])},e.prototype.getDraggingElementKeys=function(){return void 0===this.shapeKey?[]:[this.shapeKey]},e.prototype.onApplyChanges=function(t){if(void 0===t.source.type)return this.dragging.onCaptured(!1),void(void 0===this.shapeKey||this.deleteHistoryItem||(this.deleteHistoryItem=new l.DeleteShapeHistoryItem(this.shapeKey),this.history.addOrModifyAndRedo(this.deleteHistoryItem)));this.dragging.onCaptured(!0),void 0===this.shapeKey&&(this.startPoint=t.layoutPoint,this.shapeKey=this.insertToolboxItem(t)),this.deleteHistoryItem&&(this.history.undoTransactionTo(this.deleteHistoryItem),delete this.deleteHistoryItem);var e=this.getPosition(t,this.startShapePosition);d.ModelUtils.setShapePosition(this.history,this.model,this.shapeKey,e,this.history.addOrModifyAndRedo),void 0===this.updatePageSizeTimer&&this.handler.tryUpdateModelSize()},e.prototype.onFinishWithChanges=function(){this.history.addOrModifyAndRedo(new c.SetSelectionHistoryItem(this.selection,[this.shapeKey]))},e.prototype.onDragStart=function(t){this.dragging=t},e.prototype.onDragEnd=function(t){void 0!==this.shapeKey&&void 0===t.source.type&&this.cancelChanges(),this.handler.switchToDefaultState()},e.prototype.finish=function(){this.handler.resetExtensionLines(),this.dragging.onFinishDragging(),t.prototype.finish.call(this)},e.prototype.updateShapeProperties=function(t){var e=this;this.selection.inputPosition.stylePropertiesDefault.forEach(function(n){e.history.addOrModifyAndRedo(new u.ChangeStyleHistoryItem(t,n,e.selection.inputPosition.getStylePropertyDefaultValue(n)))}),this.selection.inputPosition.styleTextPropertiesDefault.forEach(function(n){e.history.addOrModifyAndRedo(new p.ChangeStyleTextHistoryItem(t,n,e.selection.inputPosition.getStyleTextPropertyValue(n)))})},e.prototype.insertToolboxItem=function(t){var e=r.ShapeDescriptionManager.get(this.dragging.shapeType);this.startShapePosition=this.getSnappedPoint(t,new s.Point(t.layoutPoint.x-e.defaultSize.width/2,t.layoutPoint.y-e.defaultSize.height/2));var n=new a.AddShapeHistoryItem(this.dragging.shapeType,this.startShapePosition,this.dragging.item&&this.dragging.item.text);return this.history.addOrModifyAndRedo(n),this.updateShapeProperties(n.shapeKey),n.shapeKey},e.prototype.getPosition=function(t,e){return this.getSnappedPoint(t,new s.Point(e.x+t.layoutPoint.x-this.startPoint.x,e.y+t.layoutPoint.y-this.startPoint.y))},e}(h.MouseHandlerDraggingState);e.MouseHandlerToolboxDraggingState=g},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(24),s=n(232),a=n(98),c=function(t){function e(e,n,o){var i=t.call(this,e,n)||this;return i.model=o,i}return i(e,t),e.prototype.onMouseDown=function(e){this.connector=this.model.findConnector(e.source.key),this.position=parseFloat(e.source.value),this.text=this.connector.getText(this.position),this.savedText="",t.prototype.onMouseDown.call(this,e)},e.prototype.onApplyChanges=function(t){var e=this.connector.getTextPositionByPoint(t.layoutPoint);if(e!=this.position){var n=this.connector.getText(e);""!==n&&n!==this.text&&(this.history.addAndRedo(new a.ChangeConnectorTextHistoryItem(this.connector,e,"")),this.savedText=n),this.history.addOrModifyAndRedo(new s.ChangeConnectorTextPositionHistoryItem(this.connector,this.position,e)),""!==this.savedText&&this.savedText!==n&&(this.history.addAndRedo(new a.ChangeConnectorTextHistoryItem(this.connector,this.position,this.savedText)),this.savedText=""),this.position=e}},e.prototype.getDraggingElementKeys=function(){return[this.connector.key]},e}(r.MouseHandlerDraggingState);e.MouseHandlerMoveConnectorTextState=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connectorKey=e.key,i.position=n,i.newPosition=o,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);t.changeConnectorTextPosition(e,this.position,this.newPosition)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.changeConnectorTextPosition(e,this.newPosition,this.position)},e}(n(4).HistoryItem);e.ChangeConnectorTextPositionHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.raiseShow=function(){var t=this;this.dispatcher.raise1(function(e){return e.NotifyConnectionPointsShow(t.key,t.points,t.pointIndex)})},e.prototype.raiseHide=function(){this.dispatcher.raise1(function(t){return t.NotifyConnectionPointsHide()})},e}(n(67).ConnectionPointsVisualizerBase);e.ConnectionPointsVisualizer=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.raiseShow=function(){var t=this;this.dispatcher.raise1(function(e){return e.NotifyConnectionMarksShow(t.key,t.points,t.pointIndex)})},e.prototype.raiseHide=function(){this.dispatcher.raise1(function(t){return t.NotifyConnectionMarksHide()})},e}(n(67).ConnectionPointsVisualizerBase);e.ConnectionMarksVisualizer=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this.dispatcher=t}return t.prototype.getKey=function(){return this.key},t.prototype.setTargetRect=function(t,e){this.key!==t&&(this.key=t,this.targetRect=e,this.raiseShow())},t.prototype.reset=function(){"-1"!==this.key&&(this.key="-1",this.targetRect=void 0,this.raiseHide())},t.prototype.raiseShow=function(){var t=this;this.dispatcher.raise1(function(e){return e.NotifyConnectionTargetShow(t.key,t.targetRect)})},t.prototype.raiseHide=function(){this.dispatcher.raise1(function(t){return t.NotifyConnectionTargetHide()})},t}();e.ConnectionTargetVisualizer=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(237),i=n(14),r=n(16),s=n(9),a=n(5),c=n(98),u=function(){function t(t){this.control=t}return t.prototype.startTextInput=function(t,e){if(!t.locked&&t.allowHasText){if(this.control.beginUpdate(),this.textInputItem=t,this.textInputItem instanceof s.Shape){var n=this.textInputItem.textRectangle;this.control.eventManager.raiseTextInputStart(this.textInputItem,this.textInputItem.text,n.position,n.size)}this.textInputItem instanceof a.Connector&&(this.textInputPosition=e,this.control.eventManager.raiseTextInputStart(this.textInputItem,this.textInputItem.getText(this.textInputPosition),this.textInputItem.getTextPoint(this.textInputPosition)))}},t.prototype.endTextInput=function(){this.control.eventManager.raiseTextInputEnd(this.textInputItem),delete this.textInputItem,this.control.endUpdate()},t.prototype.applyTextInput=function(t){var e=this.textInputItem,n=this.textInputPosition;this.endTextInput(),e instanceof s.Shape?e.text!==t&&this.control.history.addOrModifyAndRedo(new o.ChangeShapeTextHistoryItem(e,t)):e instanceof a.Connector&&e.getText(n)!==t&&this.control.history.addOrModifyAndRedo(new c.ChangeConnectorTextHistoryItem(e,n,t))},t.prototype.cancelTextInput=function(){this.endTextInput()},t.prototype.isTextInputActive=function(){return void 0!==this.textInputItem},t.prototype.onMouseDoubleClick=function(t){if(t.source.type===i.MouseEventElementType.Shape){var e=this.control.model.findShape(t.source.key);this.startTextInput(e)}else if(t.source.type===i.MouseEventElementType.Connector){var n=(o=this.control.model.findConnector(t.source.key)).getTextPositionByPoint(t.layoutPoint);this.startTextInput(o,n)}else if(t.source.type===i.MouseEventElementType.ConnectorText){var o=this.control.model.findConnector(t.source.key);n=parseFloat(t.source.value);this.startTextInput(o,n)}},t.prototype.onKeyDown=function(t){this.isTextInputActive()&&(13===t.keyCode&&t.modifiers&r.ModifierKey.Ctrl&&(t.preventDefault=!0,this.applyTextInput(t.inputText)),27===t.keyCode&&this.cancelTextInput())},t.prototype.onInputBlur=function(t){this.isTextInputActive()&&this.applyTextInput(t.inputText)},t.prototype.onInputFocus=function(t){},t}();e.TextInputHandler=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var o=t.call(this)||this;return o.shapeKey=e.key,o.text=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);this.oldText=e.text,t.changeShapeText(e,this.text)},e.prototype.undo=function(t){var e=t.model.findShape(this.shapeKey);t.changeShapeText(e,this.oldText)},e}(n(4).HistoryItem);e.ChangeShapeTextHistoryItem=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=function(){function t(t){this.onSelectionChanged=new o.EventDispatcher,this.selection=t,this.selection.onChanged.add(this)}return t.prototype.NotifyModelChanged=function(t){for(var e,n=0;e=t[n];n++)if(this.selection.hasKey(e.key))return void this.raiseUpdateSelection()},t.prototype.NotifySelectionChanged=function(t){this.raiseUpdateSelection()},t.prototype.raiseUpdateSelection=function(){this.onSelectionChanged.raise("NotifyRedrawSelection",this.selection)},t}();e.SelectionController=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=n(240),r=function(){function t(t){this.onChanged=new o.EventDispatcher,this.inputPosition=new i.InputPosition(this),this.onChanged.add(this.inputPosition),this.initialize(t)}return t.prototype.initialize=function(t){this.model=t,this.keys=[],this.inputPosition.initialize()},t.prototype.add=function(t){this.keys.indexOf(t)<0&&(this.keys.push(t),this.raiseSelectionChanged())},t.prototype.remove=function(t){this.keys.indexOf(t)>=0&&(this.keys.splice(this.keys.indexOf(t),1),this.raiseSelectionChanged())},t.prototype.clear=function(){this.keys=[],this.raiseSelectionChanged()},t.prototype.set=function(t){this.keys=t,this.raiseSelectionChanged()},t.prototype.getKeys=function(){return this.keys},t.prototype.getKey=function(t){return this.keys[t]},t.prototype.getSelectedItems=function(t){var e=this;return this.keys.map(function(t){return e.model.findItem(t)}).filter(function(e){return e&&(t||!e.locked)})},t.prototype.getSelectedShapes=function(t){var e=this;return this.keys.map(function(t){return e.model.findShape(t)}).filter(function(e){return e&&(t||!e.locked)})},t.prototype.getSelectedConnectors=function(t){var e=this;return this.keys.map(function(t){return e.model.findConnector(t)}).filter(function(e){return e&&(t||!e.locked)})},t.prototype.hasKey=function(t){return this.keys.indexOf(t)>=0},t.prototype.isEmpty=function(t){return!this.getSelectedItems(t).length},t.prototype.selectRect=function(t){var e=[];this.model.iterateItems(function(n){n.intersectedByRect(t)&&e.push(n.key)}),this.set(e),this.raiseSelectionChanged()},t.prototype.raiseSelectionChanged=function(){this.onChanged.raise("NotifySelectionChanged",this)},t}();e.Selection=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(28),i=n(47),r=function(){function t(t){this.selection=t,this.initialize()}return t.prototype.initialize=function(){this.reset(),this.connectorPropertiesDefault=new o.ConnectorProperties,this.stylePropertiesDefault=new i.Style,this.styleTextPropertiesDefault=new i.StyleText},t.prototype.reset=function(){this.connectorPropertiesCurrent=null,this.stylePropertiesCurrent=null,this.styleTextPropertiesCurrent=null},t.prototype.getConnectorProperties=function(){return this.connectorPropertiesCurrent||(this.connectorPropertiesCurrent=this.connectorPropertiesDefault.clone(),this.updateConnectorProperties(this.connectorPropertiesCurrent)),this.connectorPropertiesCurrent},t.prototype.getConnectorPropertyValue=function(t){return this.getConnectorProperties()[t]},t.prototype.getConnectorPropertyDefaultValue=function(t){return this.connectorPropertiesDefault[t]},t.prototype.setConnectorPropertyValue=function(t,e){this.getConnectorProperties()[t]=e,this.connectorPropertiesDefault[t]=e},t.prototype.updateConnectorProperties=function(t){var e=this,n=this.selection.getSelectedConnectors();t.forEach(function(o){e.updatePropertyValue(t,n,function(t){return t.properties},o)})},t.prototype.getStyleProperties=function(){return this.stylePropertiesCurrent||(this.stylePropertiesCurrent=this.stylePropertiesDefault.clone(),this.updateStyleProperties(this.stylePropertiesCurrent,"style")),this.stylePropertiesCurrent},t.prototype.getStyleTextProperties=function(){return this.styleTextPropertiesCurrent||(this.styleTextPropertiesCurrent=this.styleTextPropertiesDefault.clone(),this.updateStyleProperties(this.styleTextPropertiesCurrent,"styleText")),this.styleTextPropertiesCurrent},t.prototype.getStylePropertyValue=function(t){return this.getStyleProperties()[t]},t.prototype.getStylePropertyDefaultValue=function(t){return this.stylePropertiesDefault[t]},t.prototype.getStyleTextPropertyValue=function(t){return this.getStyleTextProperties()[t]},t.prototype.getStyleTextPropertyDefaultValue=function(t){return this.styleTextPropertiesDefault[t]},t.prototype.setStylePropertyValue=function(t,e){this.getStyleProperties()[t]=e,this.stylePropertiesDefault[t]=e},t.prototype.setStyleTextPropertyValue=function(t,e){this.getStyleTextProperties()[t]=e,this.styleTextPropertiesDefault[t]=e},t.prototype.updateStyleProperties=function(t,e){var n=this,o=this.selection.getSelectedItems();t.forEach(function(i){n.updatePropertyValue(t,o,function(t){return t[e]},i)})},t.prototype.updatePropertyValue=function(t,e,n,o){var i=void 0,r=!1;e.forEach(function(t){var e=n(t)[o];if(void 0===i&&null!=e)i=e,r=!0;else if(r&&i!==e)return void(i=void 0)}),r&&(t[o]=i)},t.prototype.NotifySelectionChanged=function(t){this.reset()},t}();e.InputPosition=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(4),i=n(46),r=function(){function t(t){this.historyItems=[],this.currentIndex=-1,this.incrementalId=-1,this.transactionLevel=-1,this.unmodifiedIndex=-1,this.currTransactionId=0,this.onChanged=new i.EventDispatcher,this.modelManipulator=t}return t.prototype.isModified=function(){if(this.unmodifiedIndex==this.currentIndex)return!1;for(var t=Math.min(this.unmodifiedIndex,this.currentIndex),e=Math.max(this.unmodifiedIndex,this.currentIndex),n=t+1;n<=e;n++)if(this.historyItems[n].changeModified())return!0;return!1},t.prototype.undo=function(){this.canUndo()&&(this.historyItems[this.currentIndex].undo(this.modelManipulator),this.currentIndex--,this.raiseChanged())},t.prototype.redo=function(){this.canRedo()&&(this.currentIndex++,this.historyItems[this.currentIndex].redo(this.modelManipulator),this.raiseChanged())},t.prototype.canUndo=function(){return this.currentIndex>=0},t.prototype.canRedo=function(){return this.currentIndex<this.historyItems.length-1},t.prototype.beginTransaction=function(){return this.transactionLevel++,0==this.transactionLevel&&(this.transaction=new o.CompositionHistoryItem),this.currTransactionId++},t.prototype.endTransaction=function(){if(!(--this.transactionLevel>=0)){var t=this.transaction.historyItems.length;t>1?this.addInternal(this.transaction):1==t&&this.addInternal(this.transaction.historyItems.pop()),this.transaction.historyItems.length>0&&this.raiseChanged(),delete this.transaction}},t.prototype.addAndRedo=function(t){this.add(t),t.redo(this.modelManipulator),this.raiseChanged()},t.prototype.add=function(t){this.transactionLevel>=0?this.transaction.add(t):this.addInternal(t)},t.prototype.addInternal=function(t){this.currentIndex<this.historyItems.length-1&&(this.historyItems.splice(this.currentIndex+1),this.unmodifiedIndex=Math.min(this.unmodifiedIndex,this.currentIndex)),this.historyItems.push(t),this.currentIndex++,this.deleteOldItems()},t.prototype.deleteOldItems=function(){var e=this.historyItems.length-t.MAX_HISTORY_ITEM_COUNT;e>0&&this.currentIndex>e&&(this.historyItems.splice(0,e),this.currentIndex-=e)},t.prototype.getNextId=function(){return this.incrementalId++,this.incrementalId},t.prototype.clear=function(){this.currentIndex=-1,this.unmodifiedIndex=-1,this.incrementalId=-1,this.historyItems=[],delete this.transaction,this.transactionLevel=-1},t.prototype.resetModified=function(){this.unmodifiedIndex=this.currentIndex},t.prototype.getCurrentItemId=function(){if(-1==this.currentIndex)return-1;var t=this.historyItems[this.currentIndex];return-1==t.uniqueId&&(t.uniqueId=this.getNextId()),t.uniqueId},t.prototype.addOrModifyAndRedo=function(t){this.addAndRedo(t)},t.prototype.undoTransaction=function(){for(var t=this.transaction.historyItems;t.length;)t.pop().undo(this.modelManipulator);this.raiseChanged()},t.prototype.undoTransactionTo=function(t){for(var e=this.transaction.historyItems;e.length;){var n=e.pop();if(n.undo(this.modelManipulator),n===t)return}this.raiseChanged()},t.prototype.raiseChanged=function(){-1===this.transactionLevel&&this.onChanged.raise("NotifyHistoryChanged")},t.MAX_HISTORY_ITEM_COUNT=100,t}();e.History=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){var n=t.call(this)||this;return n.bars=[],n.control=e,n}return i(e,t),e.prototype.registerBar=function(t){this.bars.push(t),t.onChanged.add(this),this.updateBarItemsState(t)},e.prototype.updateItemsState=function(t){if(!this.isUpdateLocked())for(var e,n=0;e=this.bars[n];n++)this.updateBarItemsState(e,t)},e.prototype.updateBarItemsState=function(t,e){if(!this.isUpdateLocked()&&t.isVisible())for(var n=e||t.getCommandKeys(),o=n.length,i=0;i<o;i++)this.updateBarItem(t,n[i])},e.prototype.updateBarItem=function(t,e){var n=this.control.commandManager.getCommand(e);if(n){var o=n.getState();if(t.setItemVisible(e,o.visible),o.visible&&(t.setItemEnabled(e,o.enabled),!o.denyUpdateValue)){var i=this.getItemValue(o.value);o.items&&t.setItemSubItems(e,o.items),t.setItemValue(e,i)}}},e.prototype.setEnabled=function(t){for(var e,n=0;e=this.bars[n];n++)e.setEnabled(t)},e.prototype.NotifyBarCommandExecuted=function(t,e){this.control.commandManager.getCommand(t).execute(e)||this.updateItemsState([t]),this.control.captureFocus()},e.prototype.NotifyBarUpdateRequested=function(){this.updateItemsState()},e.prototype.NotifySelectionChanged=function(t){this.updateItemsState()},e.prototype.onUpdateUnlocked=function(t){this.updateItemsState()},e.prototype.getItemValue=function(t){return t},e}(n(243).BatchUpdatableObject);e.BarManager=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){this.suspendUpdateCount=0,this.occurredEvents=0}return t.prototype.beginUpdate=function(){0===this.suspendUpdateCount&&this.onUpdateLocked(),this.suspendUpdateCount<0?this.suspendUpdateCount--:this.suspendUpdateCount++},t.prototype.endUpdate=function(){if(this.suspendUpdateCount<0?this.suspendUpdateCount++:this.suspendUpdateCount>0&&this.suspendUpdateCount--,!this.isUpdateLocked()){var t=this.occurredEvents;this.occurredEvents=0,this.onUpdateUnlocked(t)}},t.prototype.suspendUpdate=function(){if(this.suspendUpdateCount>0){this.suspendUpdateCount*=-1;var t=this.occurredEvents;this.occurredEvents=0,this.onUpdateUnlocked(t)}},t.prototype.continueUpdate=function(){this.suspendUpdateCount<0&&(this.suspendUpdateCount*=-1)},t.prototype.isUpdateLocked=function(){return this.suspendUpdateCount>0},t.prototype.onUpdateLocked=function(){},t.prototype.registerOccurredEvent=function(t){this.occurredEvents|=t},t.prototype.isLocked=function(){return 0!=this.suspendUpdateCount},t}();e.BatchUpdatableObject=o},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(99),s=n(30),a=n(10),c=n(9),u=n(13),p=n(0),h=n(76),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.initialize=function(e,n){if(e){var o=document.createElement("div");o.setAttribute("class","dxdi-toolbox"),e.appendChild(o),this.shapeIconSize=n.shapeIconSize,this.shapeIconSpacing=n.shapeIconSpacing,this.shapeIconAttributes=n.shapeIconAttributes,this.createElements(o,this.getDefaultDescriptions(n.shapes)),t.prototype.initialize.call(this,o,n)}},e.prototype.getDefaultDescriptions=function(t){return Array.isArray(t)?t:s.ShapeDescriptionManager.getTypesByCategory(t)},e.prototype.createElements=function(t,e){var n=document.createElementNS(a.svgNS,"svg");n.className.baseVal="dxdi-canvas",t.appendChild(n),this.drawShapeIcons(n,e,n.getBoundingClientRect().width)},e.prototype.drawShapeIcons=function(t,e,n){var o=this,i=u.UnitConverter.twipsToPixels(c.Shape.lineWidth);n-=2*i;for(var r=1,a=this.shapeIconSize;a<n;)(a+=this.shapeIconSpacing+this.shapeIconSize)<n&&r++;var p=(n-this.shapeIconSize*r)/(r-1),h=i,l=i;e.forEach(function(e,n){n>0&&n%r==0&&(h=i,l+=o.shapeIconSize+p);var a=s.ShapeDescriptionManager.get(e),c=o.createShape(a,h,l);o.updateShapeIconBounds(c),o.drawShape(t,c),h+=o.shapeIconSize+p}),t.style.height=l+this.shapeIconSize+i+"px"},e.prototype.drawShape=function(t,e){var n=e.description.createPrimitives(e,!0),o=document.createElementNS(a.svgNS,"g");for(var i in o.setAttribute("data-tb-type",e.description.key.toString()),o.setAttribute("class","toolbox-item"),o.setAttribute("title",e.description.title),this.shapeIconAttributes)this.shapeIconAttributes.hasOwnProperty(i)&&o.setAttribute(i,this.shapeIconAttributes[i]);t.appendChild(o),n.forEach(function(t){var e=t.createElement();o.appendChild(e),t.applyElementProperties(e)})},e.prototype.createShape=function(t,e,n){var o=u.UnitConverter.pixelsToTwips(e),i=u.UnitConverter.pixelsToTwips(n),r=new c.Shape(t,new p.Point(o,i));return t instanceof h.TextShapeDescription||(r.text=""),r},e.prototype.updateShapeIconBounds=function(t){var e=u.UnitConverter.pixelsToTwips(this.shapeIconSize);if(t.size.width>t.size.height){var n=t.size.height/t.size.width;t.size.width=e,t.size.height=e*n,t.position.y=t.position.y+(e-t.size.height)/2,t.parameters.forEach(function(n){n.value=n.value*e/t.description.defaultSize.width})}else if(t.size.width<t.size.height){n=t.size.width/t.size.height;t.size.height=e,t.size.width=e*n,t.position.x=t.position.x+(e-t.size.width)/2,t.parameters.forEach(function(n){n.value=n.value*e/t.description.defaultSize.height})}else t.size.width=e,t.size.height=e,t.parameters.forEach(function(n){n.value=n.value*e/t.description.defaultSize.width})},e.prototype.createDraggingObject=function(t){var e=this.getDragShapeType(t);if(void 0!==e){var n=new r.DiagramDraggingEvent;return n.shapeType=e,new r.ToolboxDraggingObject(n)}},e.prototype.createDraggingElement=function(t){var e=document.createElement("DIV");e.setAttribute("class","dxdi-toolbox-drag-item"),document.body.appendChild(e);var n=document.createElementNS(a.svgNS,"svg");n.className.baseVal="dxdi-canvas",e.appendChild(n);var o=s.ShapeDescriptionManager.get(t.evt.shapeType),i=this.createShape(o,u.UnitConverter.twipsToPixels(c.Shape.lineWidth),u.UnitConverter.twipsToPixels(c.Shape.lineWidth));return this.drawShape(n,i),e.style.width=u.UnitConverter.twipsToPixels(i.size.width+2*c.Shape.lineWidth)+"px",e.style.height=u.UnitConverter.twipsToPixels(i.size.height+2*c.Shape.lineWidth)+"px",e},e.prototype.getDragShapeType=function(t){for(;t&&t instanceof SVGElement;){if(t.getAttribute("data-tb-type"))return parseInt(t.getAttribute("data-tb-type"));t=t.parentNode instanceof SVGElement?t.parentNode:void 0}},e}(r.Toolbox);e.ShapeToolboxManager=l},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(99),s=n(1),a=function(t){function e(e){var n=t.call(this)||this;return n.key=e,n}return i(e,t),e.prototype.initialize=function(e,n){t.prototype.initialize.call(this,e,n),this.dataSource=n,this.createDataSourceElement(e)},e.prototype.createDataSourceElement=function(t){var e=this,n=document.createElement("div");if(n.setAttribute("class","dxdi-datasource"),t.appendChild(n),this.dataSource.name&&""!==this.dataSource.name){var o=document.createElement("div");o.setAttribute("class","dxdi-datasource-title"),o.innerHTML=this.dataSource.name,n.appendChild(o)}this.dataSource.nodes.forEach(function(t,o){var i=document.createElement("div");i.setAttribute("class","dxdi-datasource-item"),i.setAttribute("data-ds-key",e.dataSource.key),i.setAttribute("data-ds-index",o.toString()),i.innerHTML=t.text||t.key,n.appendChild(i)})},e.prototype.createDraggingElement=function(t){var e=document.createElement("DIV");return e.setAttribute("class","dxdi-datasource-drag-item"),e.innerHTML=t.evt.item.text,document.body.appendChild(e),e},e.prototype.createDraggingObject=function(t){if(t.hasAttribute("data-ds-key")&&this.dataSource){var e=t.getAttribute("data-ds-index"),n=this.dataSource.nodes[e];if(n){var o=new r.DiagramDraggingEvent;return o.item=n,o.shapeType=n.type||s.ShapeType.Rectangle,o.dataSource=this.dataSource,new r.ToolboxDraggingObject(o)}}},e}(r.Toolbox);e.DataToolboxManager=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){this._fullscreen=!1}return Object.defineProperty(t.prototype,"fullscreen",{get:function(){return this._fullscreen},set:function(t){this._fullscreen=t},enumerable:!0,configurable:!0}),t}();e.DiagramSettings=o},function(t,e,n){}])});