/*! * DevExpress Diagram (dx-diagram.min) * Version: 0.0.30 * Build date: Tue Jul 23 2019 * * Copyright (c) 2012 - 2019 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs */ !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>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;p0)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;ps.y&&o.y>r.y||o.ys.x&&o.x>r.x||o.xn||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=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=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;se[n].y?r:t===o.West&&i.xe[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))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;r0;){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-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;e800?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;o8?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=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&&(P0;"WinPhone"==f&&u<9&&(u=Math.floor(t.getVersionFromTrident(e,"trident(?:/|\\s*)?"+a))),!n&&"IE"==r&&u>7&&document.documentMode=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;iMath.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=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);u1){for(var c=i[t.from],u=1;ut?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=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;n1?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;t0)return"\n"+n}}},t.prototype.checkSelector=function(e){for(var n=0;n=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=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-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;rthis.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&&nn;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&&e0;)t.pop()},t.ArrayIndexOf=function(t,e,n){if(n){for(o=0;o=0},t.ArrayEqual=function(t,e){var n=t.length;if(n!=e.length)return!1;for(var o=0;on?o=1:t=n?0:o>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/g,">"]])},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=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;f0&&(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.yt.y&&t.y>n.y))return!0;if(t.y===n.y&&(e.xt.x&&t.x>n.x))return!0}return!1},e.prototype.isIntermediatePoints=function(t,e){return 0o){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.yn.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.ythis.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.xn.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.x0&&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.yn.y?e.xe.y?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):e.xe.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.topthis.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.x0&&o<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.isOnSidePoint=function(t,e){return e.ythis.endRect.right?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):[e.offset(this.getMinOffset(),0)];case r.ConnectionPointSide.South:return e.xn.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.ye.x&&(i+=this.beginRect.right-e.x),[e.offset(i,0)];case r.ConnectionPointSide.North:return n.xn.y?[e.offset(this.getMinOffset(),0)]:[];case r.ConnectionPointSide.South:return n.xthis.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.y0&&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.yt.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.yn.x?e.y>n.y?[]:[e.offset(-this.getMinOffset(),0)]:e.xe.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.ythis.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.y0&&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.ye.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.y0)&&(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 re.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.x0},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.out0&&e.out-e.inco[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;pt[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-1)}})},e.prototype.getParentShapeKey=function(t){for(var e,n=0;n-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;oa.right&&(n=e.left-l.CanvasManager.extensionLineOffset,i=a.right+c+l.CanvasManager.extensionLineOffset),e.bottoma.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)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){te.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=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.currentIndex0&&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;i0&&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;a0&&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