!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("lodash")):"function"==typeof define&&define.amd?define(["react","_"],e):"object"==typeof exports?exports["storm-react-diagrams"]=e(require("react"),require("lodash")):t["storm-react-diagrams"]=e(t.react,t._)}(this,function(t,e){return function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=22)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){"use strict";var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(3),r=n(1),s=function(t){function e(){var e=t.call(this)||this;return e.selected=!1,e}return o(e,t),e.prototype.deSerialize=function(e){t.prototype.deSerialize.call(this,e),this.selected=e.selected},e.prototype.serialize=function(){return r.merge(t.prototype.serialize.call(this),{_class:this.constructor.name,selected:this.selected})},e.prototype.getID=function(){return this.id},e.prototype.isSelected=function(){return this.selected},e.prototype.setSelected=function(t){this.selected=t,this.itterateListeners(function(t){t.selectionChanged&&t.selectionChanged()})},e.prototype.remove=function(){console.log("removing: ",this),this.itterateListeners(function(t){t.entityRemoved&&t.entityRemoved()})},e}(i.BaseEntity);e.BaseModel=s;var a=function(t){function e(e,n){var o=t.call(this)||this;return o.x=n.x,o.y=n.y,o.link=e,o}return o(e,t),e.prototype.deSerialize=function(e){t.prototype.deSerialize.call(this,e),this.x=e.x,this.y=e.y},e.prototype.serialize=function(){return r.extend(t.prototype.serialize.call(this),{x:this.x,y:this.y})},e.prototype.remove=function(){t.prototype.remove.call(this),this.link&&this.link.removePoint(this)},e.prototype.updateLocation=function(t){this.x=t.x,this.y=t.y},e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e.prototype.getLink=function(){return this.link},e}(s);e.PointModel=a;var c=function(t){function e(){var e=t.call(this)||this;return e.linkType="default",e.points=[new a(e,{x:0,y:0}),new a(e,{x:0,y:0})],e.extras={},e.sourcePort=null,e.targetPort=null,e}return o(e,t),e.prototype.deSerialize=function(e){var n=this;t.prototype.deSerialize.call(this,e),this.linkType=e.type,this.points=r.map(e.points,function(t){var e=new a(n,{x:t.x,y:t.y});return e.deSerialize(t),e})},e.prototype.serialize=function(){return r.merge(t.prototype.serialize.call(this),{type:this.linkType,source:this.sourcePort?this.sourcePort.getParent().id:null,sourcePort:this.sourcePort?this.sourcePort.id:null,target:this.targetPort?this.targetPort.getParent().id:null,targetPort:this.targetPort?this.targetPort.id:null,points:r.map(this.points,function(t){return t.serialize()}),extras:this.extras})},e.prototype.remove=function(){t.prototype.remove.call(this),this.sourcePort&&this.sourcePort.removeLink(this),this.targetPort&&this.targetPort.removeLink(this)},e.prototype.isLastPoint=function(t){var e=this.getPointIndex(t);return e===this.points.length-1},e.prototype.getPointIndex=function(t){return this.points.indexOf(t)},e.prototype.getPointModel=function(t){for(var e=0;ea.x&&(s=e[1],a=e[0]),n.push(this.generateLink({id:0,onMouseDown:function(e){if(!e.shiftKey){var n=new r.PointModel(t.props.link,t.props.diagramEngine.getRelativeMousePoint(e));n.setSelected(!0),t.forceUpdate(),t.props.link.addPoint(n,1),t.props.pointAdded(n,e)}},d:" M"+s.x+" "+s.y+" C"+(s.x+o)+" "+s.y+" "+(a.x-o)+" "+a.y+" "+a.x+" "+a.y})),null===this.props.link.targetPort&&n.push(this.generatePoint(1))}else{var c=[];if(this.props.smooth){c.push(" M"+e[0].x+" "+e[0].y+" C "+(e[0].x+50)+" "+e[0].y+" "+e[1].x+" "+e[1].y+" "+e[1].x+" "+e[1].y);for(var p=1;pthis.mouseX&&(t+n.getOffsetX())*othis.mouseY&&(e+n.getOffsetY())*o