diff --git a/CHANGELOG b/CHANGELOG index 027ad03f9..378a47e90 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +1-8-2018 (v2.1.4) + * reconfigure eslint + * add .editorconfig + * dia.Element - fix hasPorts() when no items defined + * dia.LinkView - stop preventing propagation for legacy link tools events + 29-6-2018 (v2.1.3) * dia.CellView - fix ambigious magnet selector * dia.LinkView - trigger missing link:pointerdown event on label pointerdown diff --git a/dist/geometry.js b/dist/geometry.js index 6eb3e40ee..1ad8b3885 100644 --- a/dist/geometry.js +++ b/dist/geometry.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -30,9 +30,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. // Geometry library. // ----------------- -var g = (function() { +var g = {}; - var g = {}; +(function(g) { // Declare shorthands to the most used math functions. var math = Math; @@ -4873,9 +4873,7 @@ var g = (function() { return this.regexSupportedData.test(d); } - return g; - -})(); +})(g); return g; diff --git a/dist/geometry.min.js b/dist/geometry.min.js index ac7859ea8..f45f4eb33 100644 --- a/dist/geometry.min.js +++ b/dist/geometry.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -27,8 +27,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. }(this, function() { -var g=function(){function a(a,b){return b.unshift(null),new(Function.prototype.bind.apply(a,b))}function b(a){var b,c,d=[];for(c=arguments.length,b=1;b=1)return[new q(b,c,d,e),new q(e,e,e,e)];var f=this.getSkeletonPoints(a),g=f.startControlPoint1,h=f.startControlPoint2,i=f.divider,j=f.dividerControlPoint1,k=f.dividerControlPoint2;return[new q(b,g,h,i),new q(i,j,k,e)]},endpointDistance:function(){return this.start.distance(this.end)},equals:function(a){return!!a&&this.start.x===a.start.x&&this.start.y===a.start.y&&this.controlPoint1.x===a.controlPoint1.x&&this.controlPoint1.y===a.controlPoint1.y&&this.controlPoint2.x===a.controlPoint2.x&&this.controlPoint2.y===a.controlPoint2.y&&this.end.x===a.end.x&&this.end.y===a.end.y},getSkeletonPoints:function(a){var b=this.start,c=this.controlPoint1,d=this.controlPoint2,e=this.end;if(a<=0)return{startControlPoint1:b.clone(),startControlPoint2:b.clone(),divider:b.clone(),dividerControlPoint1:c.clone(),dividerControlPoint2:d.clone()};if(a>=1)return{startControlPoint1:c.clone(),startControlPoint2:d.clone(),divider:e.clone(),dividerControlPoint1:e.clone(),dividerControlPoint2:e.clone()};var f=new s(b,c).pointAt(a),g=new s(c,d).pointAt(a),h=new s(d,e).pointAt(a),i=new s(f,g).pointAt(a),j=new s(g,h).pointAt(a),k=new s(i,j).pointAt(a),l={startControlPoint1:f,startControlPoint2:i,divider:k,dividerControlPoint1:j,dividerControlPoint2:h};return l},getSubdivisions:function(a){a=a||{};var b=void 0===a.precision?this.PRECISION:a.precision,c=[new q(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===b)return c;for(var d=this.endpointDistance(),e=p(10,-b),f=0;;){f+=1;for(var g=[],h=c.length,i=0;i1&&r=1)return this.end.clone();var c=this.tAt(a,b);return this.pointAtT(c)},pointAtLength:function(a,b){var c=this.tAtLength(a,b);return this.pointAtT(c)},pointAtT:function(a){return a<=0?this.start.clone():a>=1?this.end.clone():this.getSkeletonPoints(a).divider},PRECISION:3,scale:function(a,b,c){return this.start.scale(a,b,c),this.controlPoint1.scale(a,b,c),this.controlPoint2.scale(a,b,c),this.end.scale(a,b,c),this},tangentAt:function(a,b){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var c=this.tAt(a,b);return this.tangentAtT(c)},tangentAtLength:function(a,b){if(!this.isDifferentiable())return null;var c=this.tAtLength(a,b);return this.tangentAtT(c)},tangentAtT:function(a){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var b=this.getSkeletonPoints(a),c=b.startControlPoint2,d=b.dividerControlPoint1,e=b.divider,f=new s(c,d);return f.translate(e.x-c.x,e.y-c.y),f},tAt:function(a,b){if(a<=0)return 0;if(a>=1)return 1;b=b||{};var c=void 0===b.precision?this.PRECISION:b.precision,d=void 0===b.subdivisions?this.getSubdivisions({precision:c}):b.subdivisions,e={precision:c,subdivisions:d},f=this.length(e),g=f*a;return this.tAtLength(g,e)},tAtLength:function(a,b){var c=!0;a<0&&(c=!1,a=-a),b=b||{};for(var d,e,f,g,h,i=void 0===b.precision?this.PRECISION:b.precision,j=void 0===b.subdivisions?this.getSubdivisions({precision:i}):b.subdivisions,k={precision:i,subdivisions:j},l=0,m=j.length,n=1/m,o=c?0:m-1;c?o=0;c?o++:o--){var q=j[o],r=q.endpointDistance();if(a<=l+r){d=q,e=o*n,f=(o+1)*n,g=c?a-l:r+l-a,h=c?r+l-a:a-l;break}l+=r}if(!d)return c?1:0;for(var s=this.length(k),t=p(10,-i);;){var u;if(u=0!==s?g/s:0,ui.x+g/2,m=ei.x?f-d:f+d,c=g*g/(e-j)-g*g*(f-k)*(b-k)/(h*h*(e-j))+j):(c=f>i.y?e+d:e-d,b=h*h/(f-k)-h*h*(e-j)*(c-j)/(g*g*(f-k))+k),new u(c,b).theta(a)},equals:function(a){return!!a&&a.x===this.x&&a.y===this.y&&a.a===this.a&&a.b===this.b},intersectionWithLine:function(a){var b=[],c=a.start,d=a.end,e=this.a,f=this.b,g=a.vector(),i=c.difference(new u(this)),j=new u(g.x/(e*e),g.y/(f*f)),k=new u(i.x/(e*e),i.y/(f*f)),l=g.dot(j),m=g.dot(k),n=i.dot(k)-1,o=m*m-l*n;if(o<0)return null;if(o>0){var p=h(o),q=(-m-p)/l,r=(-m+p)/l;if((q<0||10){if(f>d||g>d)return null}else if(f=1?c.clone():b.lerp(c,a)},pointAtLength:function(a){var b=this.start,c=this.end,d=!0;a<0&&(d=!1,a=-a);var e=this.length();return a>=e?d?c.clone():b.clone():this.pointAt((d?a:e-a)/e)},pointOffset:function(a){a=new c.Point(a);var b=this.start,d=this.end,e=(d.x-b.x)*(a.y-b.y)-(d.y-b.y)*(a.x-b.x);return e/this.length()},rotate:function(a,b){return this.start.rotate(a,b),this.end.rotate(a,b),this},round:function(a){var b=p(10,a||0);return this.start.x=l(this.start.x*b)/b,this.start.y=l(this.start.y*b)/b,this.end.x=l(this.end.x*b)/b,this.end.y=l(this.end.y*b)/b,this},scale:function(a,b,c){return this.start.scale(a,b,c),this.end.scale(a,b,c),this},setLength:function(a){var b=this.length();if(!b)return this;var c=a/b;return this.scale(c,c,this.start)},squaredLength:function(){var a=this.start.x,b=this.start.y,c=this.end.x,d=this.end.y;return(a-=c)*a+(b-=d)*b},tangentAt:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAt(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},tangentAtLength:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAtLength(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},translate:function(a,b){return this.start.translate(a,b),this.end.translate(a,b),this},vector:function(){return new u(this.end.x-this.start.x,this.end.y-this.start.y)},toString:function(){return this.start.toString()+" "+this.end.toString()}},s.prototype.intersection=s.prototype.intersect;var t=c.Path=function(a){if(!(this instanceof t))return new t(a);if("string"==typeof a)return new t.parse(a);this.segments=[];var b,c;if(a){if(Array.isArray(a)&&0!==a.length)if(c=a.length,a[0].isSegment)for(b=0;b=c||a<0)throw new Error("Index out of range.");return b[a]},getSegmentSubdivisions:function(a){var b=this.segments,c=b.length;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=[],f=0;fd||a<0)throw new Error("Index out of range.");var e,f=null,g=null;if(0!==d&&(a>=1?(f=c[a-1],g=f.nextSegment):g=c[0]),Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");for(var h=b.length,i=0;i=d?(e=d-1,f=1):f<0?f=0:f>1&&(f=1),b=b||{};for(var g,h=void 0===b.precision?this.PRECISION:b.precision,i=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:h}):b.segmentSubdivisions,j=0,k=0;k=1)return this.end.clone();b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.pointAtLength(i,g)},pointAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;if(0===a)return this.start.clone();var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isVisible){if(a<=i+m)return k.pointAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f)return e?f.end:f.start;var n=c[d-1];return n.end.clone()},pointAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].pointAtT(0);if(d>=c)return b[c-1].pointAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].pointAtT(e)},prepareSegment:function(a,b,c){a.previousSegment=b,a.nextSegment=c,b&&(b.nextSegment=a),c&&(c.previousSegment=a);var d=a;return a.isSubpathStart&&(a.subpathStartSegment=a,d=c),d&&this.updateSubpathStartSegment(d),a},PRECISION:3,removeSegment:function(a){var b=this.segments,c=b.length;if(0===c)throw new Error("Path has no segments.");if(a<0&&(a=c+a),a>=c||a<0)throw new Error("Index out of range.");var d=b.splice(a,1)[0],e=d.previousSegment,f=d.nextSegment;e&&(e.nextSegment=f),f&&(f.previousSegment=e),d.isSubpathStart&&f&&this.updateSubpathStartSegment(f)},replaceSegment:function(a,b){var c=this.segments,d=c.length;if(0===d)throw new Error("Path has no segments.");if(a<0&&(a=d+a),a>=d||a<0)throw new Error("Index out of range.");var e,f=c[a],g=f.previousSegment,h=f.nextSegment,i=f.isSubpathStart;if(Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");c.splice(a,1);for(var j=b.length,k=0;k1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.segmentIndexAtLength(i,g)},toPoints:function(a){var b=this.segments,c=b.length;if(0===c)return null;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=void 0===a.segmentSubdivisions?this.getSegmentSubdivisions({precision:d}):a.segmentSubdivisions,f=[],g=[],h=0;h0){var k=j.map(function(a){return a.start});Array.prototype.push.apply(g,k)}else g.push(i.start)}else g.length>0&&(g.push(b[h-1].end),f.push(g),g=[])}return g.length>0&&(g.push(this.end),f.push(g)),f},toPolylines:function(a){var b=[],c=this.toPoints(a);if(!c)return null;for(var d=0,e=c.length;d=0;e?j++:j--){var k=c[j],l=g[j],m=k.length({precision:f,subdivisions:l});if(k.isVisible){if(a<=i+m)return j;h=j}i+=m}return h},tangentAt:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;a<0&&(a=0),a>1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.tangentAtLength(i,g)},tangentAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isDifferentiable()){if(a<=i+m)return k.tangentAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f){var n=e?1:0;return f.tangentAtT(n)}return null},tangentAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].tangentAtT(0);if(d>=c)return b[c-1].tangentAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].tangentAtT(e)},translate:function(a,b){for(var c=this.segments,d=c.length,e=0;e=0;c--){var d=a[c];if(d.isVisible)return d.end}return a[b-1].end}});var u=c.Point=function(a,b){if(!(this instanceof u))return new u(a,b);if("string"==typeof a){var c=a.split(a.indexOf("@")===-1?" ":"@");a=parseFloat(c[0]),b=parseFloat(c[1])}else Object(a)===a&&(b=a.y,a=a.x);this.x=void 0===a?0:a,this.y=void 0===b?0:b};u.fromPolar=function(a,b,c){c=c&&new u(c)||new u(0,0);var d=e(a*f(b)),h=e(a*g(b)),i=x(z(b));return i<90?h=-h:i<180?(d=-d,h=-h):i<270&&(d=-d),new u(c.x+d,c.y+h)},u.random=function(a,b,c,d){return new u(m(o()*(b-a+1)+a),m(o()*(d-c+1)+c))},u.prototype={adhereToRect:function(a){return a.containsPoint(this)?this:(this.x=i(j(this.x,a.x),a.x+a.width),this.y=i(j(this.y,a.y),a.y+a.height),this)},bearing:function(a){return new s(this,a).bearing()},changeInAngle:function(a,b,c){return this.clone().offset(-a,-b).theta(c)-this.theta(c)},clone:function(){return new u(this)},difference:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),new u(this.x-(a||0),this.y-(b||0))},distance:function(a){return new s(this,a).length()},squaredDistance:function(a){return new s(this,a).squaredLength()},equals:function(a){return!!a&&this.x===a.x&&this.y===a.y},magnitude:function(){return h(this.x*this.x+this.y*this.y)||.01},manhattanDistance:function(a){return e(a.x-this.x)+e(a.y-this.y)},move:function(a,b){var c=A(new u(a).theta(this)),d=this.offset(f(c)*b,-g(c)*b);return d},normalize:function(a){var b=(a||1)/this.magnitude();return this.scale(b,b)},offset:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),this.x+=a||0,this.y+=b||0,this},reflection:function(a){return new u(a).move(this,this.distance(a))},rotate:function(a,b){a=a||new c.Point(0,0),b=A(x(-b));var d=f(b),e=g(b),h=d*(this.x-a.x)-e*(this.y-a.y)+a.x,i=e*(this.x-a.x)+d*(this.y-a.y)+a.y;return this.x=h,this.y=i,this},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this},scale:function(a,b,c){return c=c&&new u(c)||new u(0,0),this.x=c.x+a*(this.x-c.x),this.y=c.y+b*(this.y-c.y),this},snapToGrid:function(a,b){return this.x=y(this.x,a),this.y=y(this.y,b||a),this},theta:function(a){a=new u(a);var b=-(a.y-this.y),c=a.x-this.x,d=k(b,c);return d<0&&(d=2*n+d),180*d/n},angleBetween:function(a,b){var c=this.equals(a)||this.equals(b)?NaN:this.theta(b)-this.theta(a);return c<0&&(c+=360),c},vectorAngle:function(a){var b=new u(0,0);return b.angleBetween(this,a)},toJSON:function(){return{x:this.x,y:this.y}},toPolar:function(a){a=a&&new u(a)||new u(0,0);var b=this.x,c=this.y;return this.x=h((b-a.x)*(b-a.x)+(c-a.y)*(c-a.y)),this.y=A(a.theta(new u(b,c))),this},toString:function(){return this.x+"@"+this.y},update:function(a,b){return this.x=a||0,this.y=b||0,this},dot:function(a){return a?this.x*a.x+this.y*a.y:NaN},cross:function(a,b){return a&&b?(b.x-this.x)*(a.y-this.y)-(b.y-this.y)*(a.x-this.x):NaN},lerp:function(a,b){var c=this.x,d=this.y;return new u((1-b)*c+b*a.x,(1-b)*d+b*a.y)}},u.prototype.translate=u.prototype.offset;var v=c.Rect=function(a,b,c,d){return this instanceof v?(Object(a)===a&&(b=a.y,c=a.width,d=a.height,a=a.x),this.x=void 0===a?0:a,this.y=void 0===b?0:b,this.width=void 0===c?0:c,void(this.height=void 0===d?0:d)):new v(a,b,c,d)};v.fromEllipse=function(a){return a=new r(a),new v(a.x-a.a,a.y-a.b,2*a.a,2*a.b)},v.prototype={bbox:function(a){if(!a)return this.clone();var b=A(a||0),c=e(g(b)),d=e(f(b)),h=this.width*d+this.height*c,i=this.width*c+this.height*d;return new v(this.x+(this.width-h)/2,this.y+(this.height-i)/2,h,i)},bottomLeft:function(){return new u(this.x,this.y+this.height)},bottomLine:function(){return new s(this.bottomLeft(),this.bottomRight())},bottomMiddle:function(){return new u(this.x+this.width/2,this.y+this.height); -},center:function(){return new u(this.x+this.width/2,this.y+this.height/2)},clone:function(){return new v(this)},containsPoint:function(a){return a=new u(a),a.x>=this.x&&a.x<=this.x+this.width&&a.y>=this.y&&a.y<=this.y+this.height},containsRect:function(a){var b=new v(this).normalize(),c=new v(a).normalize(),d=b.width,e=b.height,f=c.width,g=c.height;if(!(d&&e&&f&&g))return!1;var h=b.x,i=b.y,j=c.x,k=c.y;return f+=j,d+=h,g+=k,e+=i,h<=j&&f<=d&&i<=k&&g<=e},corner:function(){return new u(this.x+this.width,this.y+this.height)},equals:function(a){var b=new v(this).normalize(),c=new v(a).normalize();return b.x===c.x&&b.y===c.y&&b.width===c.width&&b.height===c.height},intersect:function(a){var b=this.origin(),c=this.corner(),d=a.origin(),e=a.corner();if(e.x<=b.x||e.y<=b.y||d.x>=c.x||d.y>=c.y)return null;var f=j(b.x,d.x),g=j(b.y,d.y);return new v(f,g,i(c.x,e.x)-f,i(c.y,e.y)-g)},intersectionWithLine:function(a){var b,c,d=this,e=[d.topLine(),d.rightLine(),d.bottomLine(),d.leftLine()],f=[],g=[],h=e.length;for(c=0;c0?f:null},intersectionWithLineFromCenterToPoint:function(a,b){a=new u(a);var c,d=new u(this.x+this.width/2,this.y+this.height/2);b&&a.rotate(d,b);for(var e=[this.topLine(),this.rightLine(),this.bottomLine(),this.leftLine()],f=new s(d,a),g=e.length-1;g>=0;--g){var h=e[g].intersection(f);if(null!==h){c=h;break}}return c&&b&&c.rotate(d,-b),c},leftLine:function(){return new s(this.topLeft(),this.bottomLeft())},leftMiddle:function(){return new u(this.x,this.y+this.height/2)},moveAndExpand:function(a){return this.x+=a.x||0,this.y+=a.y||0,this.width+=a.width||0,this.height+=a.height||0,this},offset:function(a,b){return u.prototype.offset.call(this,a,b)},inflate:function(a,b){return void 0===a&&(a=0),void 0===b&&(b=a),this.x-=a,this.y-=b,this.width+=2*a,this.height+=2*b,this},normalize:function(){var a=this.x,b=this.y,c=this.width,d=this.height;return this.width<0&&(a=this.x+this.width,c=-this.width),this.height<0&&(b=this.y+this.height,d=-this.height),this.x=a,this.y=b,this.width=c,this.height=d,this},origin:function(){return new u(this.x,this.y)},pointNearestToPoint:function(a){if(a=new u(a),this.containsPoint(a)){var b=this.sideNearestToPoint(a);switch(b){case"right":return new u(this.x+this.width,a.y);case"left":return new u(this.x,a.y);case"bottom":return new u(a.x,this.y+this.height);case"top":return new u(a.x,this.y)}}return a.adhereToRect(this)},rightLine:function(){return new s(this.topRight(),this.bottomRight())},rightMiddle:function(){return new u(this.x+this.width,this.y+this.height/2)},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this.width=l(this.width*b)/b,this.height=l(this.height*b)/b,this},scale:function(a,b,c){return c=this.origin().scale(a,b,c),this.x=c.x,this.y=c.y,this.width*=a,this.height*=b,this},maxRectScaleToFit:function(a,b){a=new v(a),b||(b=a.center());var c,d,e,f,g,h,j,k,l=b.x,m=b.y;c=d=e=f=g=h=j=k=1/0;var n=a.topLeft();n.xl&&(d=(this.x+this.width-l)/(o.x-l)),o.y>m&&(h=(this.y+this.height-m)/(o.y-m));var p=a.topRight();p.x>l&&(e=(this.x+this.width-l)/(p.x-l)),p.ym&&(k=(this.y+this.height-m)/(q.y-m)),{sx:i(c,d,e,f),sy:i(g,h,j,k)}},maxRectUniformScaleToFit:function(a,b){var c=this.maxRectScaleToFit(a,b);return i(c.sx,c.sy)},sideNearestToPoint:function(a){a=new u(a);var b=a.x-this.x,c=this.x+this.width-a.x,d=a.y-this.y,e=this.y+this.height-a.y,f=b,g="left";return cb&&(b=i),jd&&(d=j)}return new v(a,c,b-a,d-c)},clone:function(){var a=this.points,b=a.length;if(0===b)return new w;for(var c=[],d=0;df.x&&(f=c[a]);var g=[];for(a=0;a2){var j=g[g.length-1];g.unshift(j)}for(var k,l,m,n,o,p,q={},r=[];0!==g.length;)if(k=g.pop(),l=k[0],!q.hasOwnProperty(k[0]+"@@"+k[1]))for(var s=!1;!s;)if(r.length<2)r.push(k),s=!0;else{m=r.pop(),n=m[0],o=r.pop(),p=o[0];var t=p.cross(n,l);if(t<0)r.push(o),r.push(m),r.push(k),s=!0;else if(0===t){var u=1e-10,v=n.angleBetween(p,l);e(v-180)2&&r.pop();var x,y=-1;for(b=r.length,a=0;a0){var B=r.slice(y),C=r.slice(0,y);A=B.concat(C)}else A=r;var D=[];for(b=A.length,a=0;a=1)return b[c-1].clone();var d=this.length(),e=d*a;return this.pointAtLength(e)},pointAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return b[0].clone();var d=!0;a<0&&(d=!1,a=-a);for(var e=0,f=c-1,g=d?0:f-1;d?g=0;d?g++:g--){var h=b[g],i=b[g+1],j=new s(h,i),k=h.distance(i);if(a<=e+k)return j.pointAtLength((d?1:-1)*(a-e));e+=k}var l=d?b[c-1]:b[0];return l.clone()},scale:function(a,b,c){var d=this.points,e=d.length;if(0===e)return this;for(var f=0;f1&&(a=1);var d=this.length(),e=d*a;return this.tangentAtLength(e)},tangentAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return null;var d=!0;a<0&&(d=!1,a=-a);for(var e,f=0,g=c-1,h=d?0:g-1;d?h=0;d?h++:h--){var i=b[h],j=b[h+1],k=new s(i,j),l=i.distance(j);if(k.isDifferentiable()){if(a<=f+l)return k.tangentAtLength((d?1:-1)*(a-f));e=k}f+=l}if(e){var m=d?1:0;return e.tangentAt(m)}return null},intersectionWithLine:function(a){for(var b=new s(a),c=[],d=this.points,e=0,f=d.length-1;e0?c:null},translate:function(a,b){var c=this.points,d=c.length;if(0===d)return this;for(var e=0;e=1?b:b*a},pointAtT:function(a){if(this.pointAt)return this.pointAt(a);throw new Error("Neither pointAtT() nor pointAt() function is implemented.")},previousSegment:null,subpathStartSegment:null,tangentAtT:function(a){if(this.tangentAt)return this.tangentAt(a);throw new Error("Neither tangentAtT() nor tangentAt() function is implemented.")},bbox:function(){throw new Error("Declaration missing for virtual function.")},clone:function(){throw new Error("Declaration missing for virtual function.")},closestPoint:function(){throw new Error("Declaration missing for virtual function.")},closestPointLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointNormalizedLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointTangent:function(){throw new Error("Declaration missing for virtual function.")},equals:function(){throw new Error("Declaration missing for virtual function.")},getSubdivisions:function(){throw new Error("Declaration missing for virtual function.")},isDifferentiable:function(){throw new Error("Declaration missing for virtual function.")},length:function(){throw new Error("Declaration missing for virtual function.")},pointAt:function(){throw new Error("Declaration missing for virtual function.")},pointAtLength:function(){throw new Error("Declaration missing for virtual function.")},scale:function(){throw new Error("Declaration missing for virtual function.")},tangentAt:function(){throw new Error("Declaration missing for virtual function.")},tangentAtLength:function(){throw new Error("Declaration missing for virtual function.")},translate:function(){throw new Error("Declaration missing for virtual function.")},serialize:function(){throw new Error("Declaration missing for virtual function.")},toString:function(){throw new Error("Declaration missing for virtual function.")}},C=function(){for(var b=[],c=arguments.length,d=0;d0)throw new Error("Closepath constructor expects no arguments.");return this},J={clone:function(){return new I},getSubdivisions:function(){return[]},isDifferentiable:function(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)},scale:function(){return this},translate:function(){return this},type:"Z",serialize:function(){return this.type},toString:function(){return this.type+" "+this.start+" "+this.end}};Object.defineProperty(J,"start",{configurable:!0,enumerable:!0,get:function(){if(!this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path; OR segment has not yet been added to a path.)");return this.previousSegment.end}}),Object.defineProperty(J,"end",{configurable:!0,enumerable:!0,get:function(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. Moveto); OR segment has not yet been added to a path.)");return this.subpathStartSegment.end}}),I.prototype=b(B,s.prototype,J);var K=t.segmentTypes={L:C,C:E,M:G,Z:I,z:I};return t.regexSupportedData=new RegExp("^[\\s\\d"+Object.keys(K).join("")+",.]*$"),t.isDataSupported=function(a){return"string"==typeof a&&this.regexSupportedData.test(a)},c}(); +var g={};!function(a){function b(a,b){return b.unshift(null),new(Function.prototype.bind.apply(a,b))}function c(a){var b,c,d=[];for(c=arguments.length,b=1;b=1)return[new q(b,c,d,e),new q(e,e,e,e)];var f=this.getSkeletonPoints(a),g=f.startControlPoint1,h=f.startControlPoint2,i=f.divider,j=f.dividerControlPoint1,k=f.dividerControlPoint2;return[new q(b,g,h,i),new q(i,j,k,e)]},endpointDistance:function(){return this.start.distance(this.end)},equals:function(a){return!!a&&this.start.x===a.start.x&&this.start.y===a.start.y&&this.controlPoint1.x===a.controlPoint1.x&&this.controlPoint1.y===a.controlPoint1.y&&this.controlPoint2.x===a.controlPoint2.x&&this.controlPoint2.y===a.controlPoint2.y&&this.end.x===a.end.x&&this.end.y===a.end.y},getSkeletonPoints:function(a){var b=this.start,c=this.controlPoint1,d=this.controlPoint2,e=this.end;if(a<=0)return{startControlPoint1:b.clone(),startControlPoint2:b.clone(),divider:b.clone(),dividerControlPoint1:c.clone(),dividerControlPoint2:d.clone()};if(a>=1)return{startControlPoint1:c.clone(),startControlPoint2:d.clone(),divider:e.clone(),dividerControlPoint1:e.clone(),dividerControlPoint2:e.clone()};var f=new s(b,c).pointAt(a),g=new s(c,d).pointAt(a),h=new s(d,e).pointAt(a),i=new s(f,g).pointAt(a),j=new s(g,h).pointAt(a),k=new s(i,j).pointAt(a),l={startControlPoint1:f,startControlPoint2:i,divider:k,dividerControlPoint1:j,dividerControlPoint2:h};return l},getSubdivisions:function(a){a=a||{};var b=void 0===a.precision?this.PRECISION:a.precision,c=[new q(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===b)return c;for(var d=this.endpointDistance(),e=p(10,-b),f=0;;){f+=1;for(var g=[],h=c.length,i=0;i1&&r=1)return this.end.clone();var c=this.tAt(a,b);return this.pointAtT(c)},pointAtLength:function(a,b){var c=this.tAtLength(a,b);return this.pointAtT(c)},pointAtT:function(a){return a<=0?this.start.clone():a>=1?this.end.clone():this.getSkeletonPoints(a).divider},PRECISION:3,scale:function(a,b,c){return this.start.scale(a,b,c),this.controlPoint1.scale(a,b,c),this.controlPoint2.scale(a,b,c),this.end.scale(a,b,c),this},tangentAt:function(a,b){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var c=this.tAt(a,b);return this.tangentAtT(c)},tangentAtLength:function(a,b){if(!this.isDifferentiable())return null;var c=this.tAtLength(a,b);return this.tangentAtT(c)},tangentAtT:function(a){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var b=this.getSkeletonPoints(a),c=b.startControlPoint2,d=b.dividerControlPoint1,e=b.divider,f=new s(c,d);return f.translate(e.x-c.x,e.y-c.y),f},tAt:function(a,b){if(a<=0)return 0;if(a>=1)return 1;b=b||{};var c=void 0===b.precision?this.PRECISION:b.precision,d=void 0===b.subdivisions?this.getSubdivisions({precision:c}):b.subdivisions,e={precision:c,subdivisions:d},f=this.length(e),g=f*a;return this.tAtLength(g,e)},tAtLength:function(a,b){var c=!0;a<0&&(c=!1,a=-a),b=b||{};for(var d,e,f,g,h,i=void 0===b.precision?this.PRECISION:b.precision,j=void 0===b.subdivisions?this.getSubdivisions({precision:i}):b.subdivisions,k={precision:i,subdivisions:j},l=0,m=j.length,n=1/m,o=c?0:m-1;c?o=0;c?o++:o--){var q=j[o],r=q.endpointDistance();if(a<=l+r){d=q,e=o*n,f=(o+1)*n,g=c?a-l:r+l-a,h=c?r+l-a:a-l;break}l+=r}if(!d)return c?1:0;for(var s=this.length(k),t=p(10,-i);;){var u;if(u=0!==s?g/s:0,ui.x+g/2,m=ei.x?f-d:f+d,c=g*g/(e-j)-g*g*(f-k)*(b-k)/(h*h*(e-j))+j):(c=f>i.y?e+d:e-d,b=h*h/(f-k)-h*h*(e-j)*(c-j)/(g*g*(f-k))+k),new u(c,b).theta(a)},equals:function(a){return!!a&&a.x===this.x&&a.y===this.y&&a.a===this.a&&a.b===this.b},intersectionWithLine:function(a){var b=[],c=a.start,d=a.end,e=this.a,f=this.b,g=a.vector(),i=c.difference(new u(this)),j=new u(g.x/(e*e),g.y/(f*f)),k=new u(i.x/(e*e),i.y/(f*f)),l=g.dot(j),m=g.dot(k),n=i.dot(k)-1,o=m*m-l*n;if(o<0)return null;if(o>0){var p=h(o),q=(-m-p)/l,r=(-m+p)/l;if((q<0||10){if(f>d||g>d)return null}else if(f=1?c.clone():b.lerp(c,a)},pointAtLength:function(a){var b=this.start,c=this.end,d=!0;a<0&&(d=!1,a=-a);var e=this.length();return a>=e?d?c.clone():b.clone():this.pointAt((d?a:e-a)/e)},pointOffset:function(b){b=new a.Point(b);var c=this.start,d=this.end,e=(d.x-c.x)*(b.y-c.y)-(d.y-c.y)*(b.x-c.x);return e/this.length()},rotate:function(a,b){return this.start.rotate(a,b),this.end.rotate(a,b),this},round:function(a){var b=p(10,a||0);return this.start.x=l(this.start.x*b)/b,this.start.y=l(this.start.y*b)/b,this.end.x=l(this.end.x*b)/b,this.end.y=l(this.end.y*b)/b,this},scale:function(a,b,c){return this.start.scale(a,b,c),this.end.scale(a,b,c),this},setLength:function(a){var b=this.length();if(!b)return this;var c=a/b;return this.scale(c,c,this.start)},squaredLength:function(){var a=this.start.x,b=this.start.y,c=this.end.x,d=this.end.y;return(a-=c)*a+(b-=d)*b},tangentAt:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAt(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},tangentAtLength:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAtLength(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},translate:function(a,b){return this.start.translate(a,b),this.end.translate(a,b),this},vector:function(){return new u(this.end.x-this.start.x,this.end.y-this.start.y)},toString:function(){return this.start.toString()+" "+this.end.toString()}},s.prototype.intersection=s.prototype.intersect;var t=a.Path=function(a){if(!(this instanceof t))return new t(a);if("string"==typeof a)return new t.parse(a);this.segments=[];var b,c;if(a){if(Array.isArray(a)&&0!==a.length)if(c=a.length,a[0].isSegment)for(b=0;b=c||a<0)throw new Error("Index out of range.");return b[a]},getSegmentSubdivisions:function(a){var b=this.segments,c=b.length;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=[],f=0;fd||a<0)throw new Error("Index out of range.");var e,f=null,g=null;if(0!==d&&(a>=1?(f=c[a-1],g=f.nextSegment):g=c[0]),Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");for(var h=b.length,i=0;i=d?(e=d-1,f=1):f<0?f=0:f>1&&(f=1),b=b||{};for(var g,h=void 0===b.precision?this.PRECISION:b.precision,i=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:h}):b.segmentSubdivisions,j=0,k=0;k=1)return this.end.clone();b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.pointAtLength(i,g)},pointAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;if(0===a)return this.start.clone();var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isVisible){if(a<=i+m)return k.pointAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f)return e?f.end:f.start;var n=c[d-1];return n.end.clone()},pointAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].pointAtT(0);if(d>=c)return b[c-1].pointAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].pointAtT(e)},prepareSegment:function(a,b,c){a.previousSegment=b,a.nextSegment=c,b&&(b.nextSegment=a),c&&(c.previousSegment=a);var d=a;return a.isSubpathStart&&(a.subpathStartSegment=a,d=c),d&&this.updateSubpathStartSegment(d),a},PRECISION:3,removeSegment:function(a){var b=this.segments,c=b.length;if(0===c)throw new Error("Path has no segments.");if(a<0&&(a=c+a),a>=c||a<0)throw new Error("Index out of range.");var d=b.splice(a,1)[0],e=d.previousSegment,f=d.nextSegment;e&&(e.nextSegment=f),f&&(f.previousSegment=e),d.isSubpathStart&&f&&this.updateSubpathStartSegment(f)},replaceSegment:function(a,b){var c=this.segments,d=c.length;if(0===d)throw new Error("Path has no segments.");if(a<0&&(a=d+a),a>=d||a<0)throw new Error("Index out of range.");var e,f=c[a],g=f.previousSegment,h=f.nextSegment,i=f.isSubpathStart;if(Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");c.splice(a,1);for(var j=b.length,k=0;k1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.segmentIndexAtLength(i,g)},toPoints:function(a){var b=this.segments,c=b.length;if(0===c)return null;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=void 0===a.segmentSubdivisions?this.getSegmentSubdivisions({precision:d}):a.segmentSubdivisions,f=[],g=[],h=0;h0){var k=j.map(function(a){return a.start});Array.prototype.push.apply(g,k)}else g.push(i.start)}else g.length>0&&(g.push(b[h-1].end),f.push(g),g=[])}return g.length>0&&(g.push(this.end),f.push(g)),f},toPolylines:function(a){var b=[],c=this.toPoints(a);if(!c)return null;for(var d=0,e=c.length;d=0;e?j++:j--){var k=c[j],l=g[j],m=k.length({precision:f,subdivisions:l});if(k.isVisible){if(a<=i+m)return j;h=j}i+=m}return h},tangentAt:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;a<0&&(a=0),a>1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.tangentAtLength(i,g)},tangentAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isDifferentiable()){if(a<=i+m)return k.tangentAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f){var n=e?1:0;return f.tangentAtT(n)}return null},tangentAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].tangentAtT(0);if(d>=c)return b[c-1].tangentAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].tangentAtT(e)},translate:function(a,b){for(var c=this.segments,d=c.length,e=0;e=0;c--){var d=a[c];if(d.isVisible)return d.end}return a[b-1].end}});var u=a.Point=function(a,b){if(!(this instanceof u))return new u(a,b);if("string"==typeof a){var c=a.split(a.indexOf("@")===-1?" ":"@");a=parseFloat(c[0]),b=parseFloat(c[1])}else Object(a)===a&&(b=a.y,a=a.x);this.x=void 0===a?0:a,this.y=void 0===b?0:b};u.fromPolar=function(a,b,c){c=c&&new u(c)||new u(0,0);var d=e(a*f(b)),h=e(a*g(b)),i=x(z(b));return i<90?h=-h:i<180?(d=-d,h=-h):i<270&&(d=-d),new u(c.x+d,c.y+h)},u.random=function(a,b,c,d){return new u(m(o()*(b-a+1)+a),m(o()*(d-c+1)+c))},u.prototype={adhereToRect:function(a){return a.containsPoint(this)?this:(this.x=i(j(this.x,a.x),a.x+a.width),this.y=i(j(this.y,a.y),a.y+a.height),this)},bearing:function(a){return new s(this,a).bearing()},changeInAngle:function(a,b,c){return this.clone().offset(-a,-b).theta(c)-this.theta(c)},clone:function(){return new u(this)},difference:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),new u(this.x-(a||0),this.y-(b||0))},distance:function(a){return new s(this,a).length()},squaredDistance:function(a){return new s(this,a).squaredLength()},equals:function(a){return!!a&&this.x===a.x&&this.y===a.y},magnitude:function(){return h(this.x*this.x+this.y*this.y)||.01},manhattanDistance:function(a){return e(a.x-this.x)+e(a.y-this.y)},move:function(a,b){var c=A(new u(a).theta(this)),d=this.offset(f(c)*b,-g(c)*b);return d},normalize:function(a){var b=(a||1)/this.magnitude();return this.scale(b,b)},offset:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),this.x+=a||0,this.y+=b||0,this},reflection:function(a){return new u(a).move(this,this.distance(a))},rotate:function(b,c){b=b||new a.Point(0,0),c=A(x(-c));var d=f(c),e=g(c),h=d*(this.x-b.x)-e*(this.y-b.y)+b.x,i=e*(this.x-b.x)+d*(this.y-b.y)+b.y;return this.x=h,this.y=i,this},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this},scale:function(a,b,c){return c=c&&new u(c)||new u(0,0),this.x=c.x+a*(this.x-c.x),this.y=c.y+b*(this.y-c.y),this},snapToGrid:function(a,b){return this.x=y(this.x,a),this.y=y(this.y,b||a),this},theta:function(a){a=new u(a);var b=-(a.y-this.y),c=a.x-this.x,d=k(b,c);return d<0&&(d=2*n+d),180*d/n},angleBetween:function(a,b){var c=this.equals(a)||this.equals(b)?NaN:this.theta(b)-this.theta(a);return c<0&&(c+=360),c},vectorAngle:function(a){var b=new u(0,0);return b.angleBetween(this,a)},toJSON:function(){return{x:this.x,y:this.y}},toPolar:function(a){a=a&&new u(a)||new u(0,0);var b=this.x,c=this.y;return this.x=h((b-a.x)*(b-a.x)+(c-a.y)*(c-a.y)),this.y=A(a.theta(new u(b,c))),this},toString:function(){return this.x+"@"+this.y},update:function(a,b){return this.x=a||0,this.y=b||0,this},dot:function(a){return a?this.x*a.x+this.y*a.y:NaN},cross:function(a,b){return a&&b?(b.x-this.x)*(a.y-this.y)-(b.y-this.y)*(a.x-this.x):NaN},lerp:function(a,b){var c=this.x,d=this.y;return new u((1-b)*c+b*a.x,(1-b)*d+b*a.y)}},u.prototype.translate=u.prototype.offset;var v=a.Rect=function(a,b,c,d){return this instanceof v?(Object(a)===a&&(b=a.y,c=a.width,d=a.height,a=a.x),this.x=void 0===a?0:a,this.y=void 0===b?0:b,this.width=void 0===c?0:c,void(this.height=void 0===d?0:d)):new v(a,b,c,d)};v.fromEllipse=function(a){return a=new r(a),new v(a.x-a.a,a.y-a.b,2*a.a,2*a.b)},v.prototype={bbox:function(a){if(!a)return this.clone();var b=A(a||0),c=e(g(b)),d=e(f(b)),h=this.width*d+this.height*c,i=this.width*c+this.height*d;return new v(this.x+(this.width-h)/2,this.y+(this.height-i)/2,h,i)},bottomLeft:function(){return new u(this.x,this.y+this.height)},bottomLine:function(){return new s(this.bottomLeft(),this.bottomRight())},bottomMiddle:function(){return new u(this.x+this.width/2,this.y+this.height); +},center:function(){return new u(this.x+this.width/2,this.y+this.height/2)},clone:function(){return new v(this)},containsPoint:function(a){return a=new u(a),a.x>=this.x&&a.x<=this.x+this.width&&a.y>=this.y&&a.y<=this.y+this.height},containsRect:function(a){var b=new v(this).normalize(),c=new v(a).normalize(),d=b.width,e=b.height,f=c.width,g=c.height;if(!(d&&e&&f&&g))return!1;var h=b.x,i=b.y,j=c.x,k=c.y;return f+=j,d+=h,g+=k,e+=i,h<=j&&f<=d&&i<=k&&g<=e},corner:function(){return new u(this.x+this.width,this.y+this.height)},equals:function(a){var b=new v(this).normalize(),c=new v(a).normalize();return b.x===c.x&&b.y===c.y&&b.width===c.width&&b.height===c.height},intersect:function(a){var b=this.origin(),c=this.corner(),d=a.origin(),e=a.corner();if(e.x<=b.x||e.y<=b.y||d.x>=c.x||d.y>=c.y)return null;var f=j(b.x,d.x),g=j(b.y,d.y);return new v(f,g,i(c.x,e.x)-f,i(c.y,e.y)-g)},intersectionWithLine:function(a){var b,c,d=this,e=[d.topLine(),d.rightLine(),d.bottomLine(),d.leftLine()],f=[],g=[],h=e.length;for(c=0;c0?f:null},intersectionWithLineFromCenterToPoint:function(a,b){a=new u(a);var c,d=new u(this.x+this.width/2,this.y+this.height/2);b&&a.rotate(d,b);for(var e=[this.topLine(),this.rightLine(),this.bottomLine(),this.leftLine()],f=new s(d,a),g=e.length-1;g>=0;--g){var h=e[g].intersection(f);if(null!==h){c=h;break}}return c&&b&&c.rotate(d,-b),c},leftLine:function(){return new s(this.topLeft(),this.bottomLeft())},leftMiddle:function(){return new u(this.x,this.y+this.height/2)},moveAndExpand:function(a){return this.x+=a.x||0,this.y+=a.y||0,this.width+=a.width||0,this.height+=a.height||0,this},offset:function(a,b){return u.prototype.offset.call(this,a,b)},inflate:function(a,b){return void 0===a&&(a=0),void 0===b&&(b=a),this.x-=a,this.y-=b,this.width+=2*a,this.height+=2*b,this},normalize:function(){var a=this.x,b=this.y,c=this.width,d=this.height;return this.width<0&&(a=this.x+this.width,c=-this.width),this.height<0&&(b=this.y+this.height,d=-this.height),this.x=a,this.y=b,this.width=c,this.height=d,this},origin:function(){return new u(this.x,this.y)},pointNearestToPoint:function(a){if(a=new u(a),this.containsPoint(a)){var b=this.sideNearestToPoint(a);switch(b){case"right":return new u(this.x+this.width,a.y);case"left":return new u(this.x,a.y);case"bottom":return new u(a.x,this.y+this.height);case"top":return new u(a.x,this.y)}}return a.adhereToRect(this)},rightLine:function(){return new s(this.topRight(),this.bottomRight())},rightMiddle:function(){return new u(this.x+this.width,this.y+this.height/2)},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this.width=l(this.width*b)/b,this.height=l(this.height*b)/b,this},scale:function(a,b,c){return c=this.origin().scale(a,b,c),this.x=c.x,this.y=c.y,this.width*=a,this.height*=b,this},maxRectScaleToFit:function(a,b){a=new v(a),b||(b=a.center());var c,d,e,f,g,h,j,k,l=b.x,m=b.y;c=d=e=f=g=h=j=k=1/0;var n=a.topLeft();n.xl&&(d=(this.x+this.width-l)/(o.x-l)),o.y>m&&(h=(this.y+this.height-m)/(o.y-m));var p=a.topRight();p.x>l&&(e=(this.x+this.width-l)/(p.x-l)),p.ym&&(k=(this.y+this.height-m)/(q.y-m)),{sx:i(c,d,e,f),sy:i(g,h,j,k)}},maxRectUniformScaleToFit:function(a,b){var c=this.maxRectScaleToFit(a,b);return i(c.sx,c.sy)},sideNearestToPoint:function(a){a=new u(a);var b=a.x-this.x,c=this.x+this.width-a.x,d=a.y-this.y,e=this.y+this.height-a.y,f=b,g="left";return cb&&(b=i),jd&&(d=j)}return new v(a,c,b-a,d-c)},clone:function(){var a=this.points,b=a.length;if(0===b)return new w;for(var c=[],d=0;df.x&&(f=c[a]);var g=[];for(a=0;a2){var j=g[g.length-1];g.unshift(j)}for(var k,l,m,n,o,p,q={},r=[];0!==g.length;)if(k=g.pop(),l=k[0],!q.hasOwnProperty(k[0]+"@@"+k[1]))for(var s=!1;!s;)if(r.length<2)r.push(k),s=!0;else{m=r.pop(),n=m[0],o=r.pop(),p=o[0];var t=p.cross(n,l);if(t<0)r.push(o),r.push(m),r.push(k),s=!0;else if(0===t){var u=1e-10,v=n.angleBetween(p,l);e(v-180)2&&r.pop();var x,y=-1;for(b=r.length,a=0;a0){var B=r.slice(y),C=r.slice(0,y);A=B.concat(C)}else A=r;var D=[];for(b=A.length,a=0;a=1)return b[c-1].clone();var d=this.length(),e=d*a;return this.pointAtLength(e)},pointAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return b[0].clone();var d=!0;a<0&&(d=!1,a=-a);for(var e=0,f=c-1,g=d?0:f-1;d?g=0;d?g++:g--){var h=b[g],i=b[g+1],j=new s(h,i),k=h.distance(i);if(a<=e+k)return j.pointAtLength((d?1:-1)*(a-e));e+=k}var l=d?b[c-1]:b[0];return l.clone()},scale:function(a,b,c){var d=this.points,e=d.length;if(0===e)return this;for(var f=0;f1&&(a=1);var d=this.length(),e=d*a;return this.tangentAtLength(e)},tangentAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return null;var d=!0;a<0&&(d=!1,a=-a);for(var e,f=0,g=c-1,h=d?0:g-1;d?h=0;d?h++:h--){var i=b[h],j=b[h+1],k=new s(i,j),l=i.distance(j);if(k.isDifferentiable()){if(a<=f+l)return k.tangentAtLength((d?1:-1)*(a-f));e=k}f+=l}if(e){var m=d?1:0;return e.tangentAt(m)}return null},intersectionWithLine:function(a){for(var b=new s(a),c=[],d=this.points,e=0,f=d.length-1;e0?c:null},translate:function(a,b){var c=this.points,d=c.length;if(0===d)return this;for(var e=0;e=1?b:b*a},pointAtT:function(a){if(this.pointAt)return this.pointAt(a);throw new Error("Neither pointAtT() nor pointAt() function is implemented.")},previousSegment:null,subpathStartSegment:null,tangentAtT:function(a){if(this.tangentAt)return this.tangentAt(a);throw new Error("Neither tangentAtT() nor tangentAt() function is implemented.")},bbox:function(){throw new Error("Declaration missing for virtual function.")},clone:function(){throw new Error("Declaration missing for virtual function.")},closestPoint:function(){throw new Error("Declaration missing for virtual function.")},closestPointLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointNormalizedLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointTangent:function(){throw new Error("Declaration missing for virtual function.")},equals:function(){throw new Error("Declaration missing for virtual function.")},getSubdivisions:function(){throw new Error("Declaration missing for virtual function.")},isDifferentiable:function(){throw new Error("Declaration missing for virtual function.")},length:function(){throw new Error("Declaration missing for virtual function.")},pointAt:function(){throw new Error("Declaration missing for virtual function.")},pointAtLength:function(){throw new Error("Declaration missing for virtual function.")},scale:function(){throw new Error("Declaration missing for virtual function.")},tangentAt:function(){throw new Error("Declaration missing for virtual function.")},tangentAtLength:function(){throw new Error("Declaration missing for virtual function.")},translate:function(){throw new Error("Declaration missing for virtual function.")},serialize:function(){throw new Error("Declaration missing for virtual function.")},toString:function(){throw new Error("Declaration missing for virtual function.")}},C=function(){for(var a=[],c=arguments.length,d=0;d0)throw new Error("Closepath constructor expects no arguments.");return this},J={clone:function(){return new I},getSubdivisions:function(){return[]},isDifferentiable:function(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)},scale:function(){return this},translate:function(){return this},type:"Z",serialize:function(){return this.type},toString:function(){return this.type+" "+this.start+" "+this.end}};Object.defineProperty(J,"start",{configurable:!0,enumerable:!0,get:function(){if(!this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path; OR segment has not yet been added to a path.)");return this.previousSegment.end}}),Object.defineProperty(J,"end",{configurable:!0,enumerable:!0,get:function(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. Moveto); OR segment has not yet been added to a path.)");return this.subpathStartSegment.end}}),I.prototype=c(B,s.prototype,J);var K=t.segmentTypes={L:C,C:E,M:G,Z:I,z:I};t.regexSupportedData=new RegExp("^[\\s\\d"+Object.keys(K).join("")+",.]*$"),t.isDataSupported=function(a){return"string"==typeof a&&this.regexSupportedData.test(a)}}(g); return g; diff --git a/dist/joint.core.css b/dist/joint.core.css index 6c2b58123..22227b39c 100644 --- a/dist/joint.core.css +++ b/dist/joint.core.css @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.core.js b/dist/joint.core.js index 5fb450faa..455e19c32 100644 --- a/dist/joint.core.js +++ b/dist/joint.core.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -77,7 +77,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. ) { charCode = str.charCodeAt(idx += 3 / 4); if (charCode > 0xFF) { - throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); + throw new InvalidCharacterError('\'btoa\' failed: The string to be encoded contains characters outside of the Latin1 range.'); } block = block << 8 | charCode; } @@ -90,7 +90,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. object.atob = function(input) { var str = String(input).replace(/=+$/, ''); if (str.length % 4 == 1) { - throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded."); + throw new InvalidCharacterError('\'atob\' failed: The string to be decoded is not correctly encoded.'); } for ( // initialize result and counters @@ -100,8 +100,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. buffer = str.charAt(idx++); // character found in table? initialize bit storage and add its ascii value; ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - // and if not first of each 4 characters, - // convert the first 8 bits to one ascii character + // and if not first of each 4 characters, + // convert the first 8 bits to one ascii character bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 ) { // try to find character in table (0-63, not found => -1) @@ -178,6 +178,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. Object.defineProperty(XMLHttpRequest.prototype, 'response', { get: function() { + /* global VBArray:true */ return new Uint8Array(new VBArray(this.responseBody).toArray()); } }); @@ -282,19 +283,19 @@ if (!Array.prototype.find) { // Production steps of ECMA-262, Edition 6, 22.1.2.1 if (!Array.from) { - Array.from = (function () { + Array.from = (function() { var toStr = Object.prototype.toString; - var isCallable = function (fn) { + var isCallable = function(fn) { return typeof fn === 'function' || toStr.call(fn) === '[object Function]'; }; - var toInteger = function (value) { + var toInteger = function(value) { var number = Number(value); if (isNaN(number)) { return 0; } if (number === 0 || !isFinite(number)) { return number; } return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number)); }; var maxSafeInteger = Math.pow(2, 53) - 1; - var toLength = function (value) { + var toLength = function(value) { var len = toInteger(value); return Math.min(Math.max(len, 0), maxSafeInteger); }; @@ -438,9 +439,9 @@ Number.isNaN = Number.isNaN || function(value) { // Geometry library. // ----------------- -var g = (function() { +var g = {}; - var g = {}; +(function(g) { // Declare shorthands to the most used math functions. var math = Math; @@ -5281,9 +5282,7 @@ var g = (function() { return this.regexSupportedData.test(d); } - return g; - -})(); +})(g); // Vectorizer. // ----------- @@ -5291,8 +5290,8 @@ var g = (function() { // A tiny library for making your life easier when dealing with SVG. // The only Vectorizer dependency is the Geometry library. -var V; -var Vectorizer; +var V; // eslint-disable-line no-unused-vars +var Vectorizer; // eslint-disable-line no-unused-vars V = Vectorizer = (function() { @@ -5455,7 +5454,7 @@ V = Vectorizer = (function() { return transform.translate; } - transformAttr = transformAttr.replace(/translate\([^\)]*\)/g, '').trim(); + transformAttr = transformAttr.replace(/translate\([^)]*\)/g, '').trim(); var newTx = opt.absolute ? tx : transform.translate.tx + tx; var newTy = opt.absolute ? ty : transform.translate.ty + ty; @@ -5480,7 +5479,7 @@ V = Vectorizer = (function() { return transform.rotate; } - transformAttr = transformAttr.replace(/rotate\([^\)]*\)/g, '').trim(); + transformAttr = transformAttr.replace(/rotate\([^)]*\)/g, '').trim(); angle %= 360; @@ -5506,7 +5505,7 @@ V = Vectorizer = (function() { return transform.scale; } - transformAttr = transformAttr.replace(/scale\([^\)]*\)/g, '').trim(); + transformAttr = transformAttr.replace(/scale\([^)]*\)/g, '').trim(); var newScale = 'scale(' + sx + ',' + sy + ')'; @@ -6266,7 +6265,7 @@ V = Vectorizer = (function() { // Fallback for IE 9. // Run the animation programatically if FakeSmile (`http://leunen.me/fakesmile/`) present if (document.documentElement.getAttribute('smiling') === 'fake') { - + /* global getTargets:true, Animator:true, animators:true id2anim:true */ // Register the animation. (See `https://answers.launchpad.net/smil/+question/203333`) var animation = animateMotion.node; animation.animators = []; @@ -6383,7 +6382,7 @@ V = Vectorizer = (function() { }; V.prototype.toGeometryShape = function() { - var x, y, width, height, cx, cy, r, rx, ry, points, d; + var x, y, width, height, cx, cy, r, rx, ry, points, d, x1, x2, y1, y2; switch (this.tagName()) { case 'RECT': @@ -6990,27 +6989,27 @@ V = Vectorizer = (function() { return (da >= svgArcMax) ? (r0 - ? 'M0,' + r1 - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 - + 'M0,' + r0 - + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + (-r0) - + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + r0 - + 'Z' - : 'M0,' + r1 - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 - + 'Z') + ? 'M0,' + r1 + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 + + 'M0,' + r0 + + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + (-r0) + + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + r0 + + 'Z' + : 'M0,' + r1 + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 + + 'Z') : (r0 - ? 'M' + r1 * c0 + ',' + r1 * s0 - + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 - + 'L' + r0 * c1 + ',' + r0 * s1 - + 'A' + r0 + ',' + r0 + ' 0 ' + df + ',0 ' + r0 * c0 + ',' + r0 * s0 - + 'Z' - : 'M' + r1 * c0 + ',' + r1 * s0 - + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 - + 'L0,0' - + 'Z'); + ? 'M' + r1 * c0 + ',' + r1 * s0 + + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 + + 'L' + r0 * c1 + ',' + r0 * s1 + + 'A' + r0 + ',' + r0 + ' 0 ' + df + ',0 ' + r0 * c0 + ',' + r0 * s0 + + 'Z' + : 'M' + r1 * c0 + ',' + r1 * s0 + + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 + + 'L0,0' + + 'Z'); }; // Merge attributes from object `b` with attributes in object `a`. @@ -7745,7 +7744,7 @@ V = Vectorizer = (function() { var joint = { - version: '2.1.3', + version: '2.1.4', config: { // The class name prefix config is for advanced use only. @@ -7979,24 +7978,6 @@ var joint = { return string.replace(/[A-Z]/g, '-$&').toLowerCase(); }, - // Copy all the properties to the first argument from the following arguments. - // All the properties will be overwritten by the properties from the following - // arguments. Inherited properties are ignored. - mixin: _.assign, - - // Copy all properties to the first argument from the following - // arguments only in case if they don't exists in the first argument. - // All the function propererties in the first argument will get - // additional property base pointing to the extenders same named - // property function's call method. - supplement: _.defaults, - - // Same as `mixin()` but deep version. - deepMixin: _.mixin, - - // Same as `supplement()` but deep version. - deepSupplement: _.defaultsDeep, - normalizeEvent: function(evt) { var touchEvt = evt.originalEvent && evt.originalEvent.changedTouches && evt.originalEvent.changedTouches[0]; @@ -8434,7 +8415,7 @@ var joint = { decodedString = unescape(encodeURIComponent(data)); } // write the bytes of the string to a typed array - var ia = new window.Uint8Array(decodedString.length); + var ia = new Uint8Array(decodedString.length); for (var i = 0; i < decodedString.length; i++) { ia[i] = decodedString.charCodeAt(i); } @@ -9075,9 +9056,9 @@ var joint = { value = before + after; return (align === '<' ? negative + value + padding - : align === '>' ? padding + negative + value + : align === '>' ? padding + negative + value : align === '^' ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) - : negative + (zcomma ? value : padding + value)) + fullSuffix; + : negative + (zcomma ? value : padding + value)) + fullSuffix; }, // Formatting string via the Python Format string. @@ -9110,7 +9091,8 @@ var joint = { formattedStringArray.push(pieceFormatedString); formatString = formatString.slice(fieldDelimiterIndex + 1); - fieldDelimiter = (endPlaceholder = !endPlaceholder) ? '}' : '{'; + endPlaceholder = !endPlaceholder; + fieldDelimiter = (endPlaceholder) ? '}' : '{'; } formattedStringArray.push(formatString); @@ -9175,7 +9157,7 @@ var joint = { Must support the variation in templating syntax found here: https://lodash.com/docs#template */ - var regex = /<%= ([^ ]+) %>|\$\{ ?([^\{\} ]+) ?\}|\{\{([^\{\} ]+)\}\}/g; + var regex = /<%= ([^ ]+) %>|\$\{ ?([^{} ]+) ?\}|\{\{([^{} ]+)\}\}/g; return function(data) { @@ -9201,7 +9183,7 @@ var joint = { }, /** - * @param {Element=} el Element, which content is intent to display in full-screen mode, 'window.top.document.body' is default. + * @param {Element} el Element, which content is intent to display in full-screen mode, 'window.top.document.body' is default. */ toggleFullScreen: function(el) { @@ -9375,6 +9357,26 @@ var joint = { } }, + /* global _:true */ + + // Copy all the properties to the first argument from the following arguments. + // All the properties will be overwritten by the properties from the following + // arguments. Inherited properties are ignored. + mixin: _.assign, + + // Copy all properties to the first argument from the following + // arguments only in case if they don't exists in the first argument. + // All the function propererties in the first argument will get + // additional property base pointing to the extenders same named + // property function's call method. + supplement: _.defaults, + + // Same as `mixin()` but deep version. + deepMixin: _.mixin, + + // Same as `supplement()` but deep version. + deepSupplement: _.defaultsDeep, + // lodash 3 vs 4 incompatible sortedIndex: _.sortedIndexBy || _.sortedIndex, uniq: _.uniqBy || _.uniq, @@ -9396,7 +9398,6 @@ var joint = { isPlainObject: _.isPlainObject, isEmpty: _.isEmpty, isEqual: _.isEqual, - noop: function() {}, cloneDeep: _.cloneDeep, toArray: _.toArray, flattenDeep: _.flattenDeep, @@ -9407,25 +9408,6 @@ var joint = { debounce: _.debounce, clone: _.clone, - isBoolean: function(value) { - var toString = Object.prototype.toString; - return value === true || value === false || (!!value && typeof value === 'object' && toString.call(value) === '[object Boolean]'); - }, - - isObject: function(value) { - return !!value && (typeof value === 'object' || typeof value === 'function'); - }, - - isNumber: function(value) { - var toString = Object.prototype.toString; - return typeof value === 'number' || (!!value && typeof value === 'object' && toString.call(value) === '[object Number]'); - }, - - isString: function(value) { - var toString = Object.prototype.toString; - return typeof value === 'string' || (!!value && typeof value === 'object' && toString.call(value) === '[object String]'); - }, - merge: function() { if (_.mergeWith) { var args = Array.from(arguments); @@ -9446,6 +9428,29 @@ var joint = { return _.mergeWith.apply(this, args) } return _.merge.apply(this, arguments); + }, + + /* global _:false */ + + noop: function() {}, + + isBoolean: function(value) { + var toString = Object.prototype.toString; + return value === true || value === false || (!!value && typeof value === 'object' && toString.call(value) === '[object Boolean]'); + }, + + isObject: function(value) { + return !!value && (typeof value === 'object' || typeof value === 'function'); + }, + + isNumber: function(value) { + var toString = Object.prototype.toString; + return typeof value === 'number' || (!!value && typeof value === 'object' && toString.call(value) === '[object Number]'); + }, + + isString: function(value) { + var toString = Object.prototype.toString; + return typeof value === 'string' || (!!value && typeof value === 'object' && toString.call(value) === '[object String]'); } } }; @@ -12403,8 +12408,8 @@ joint.dia.CellView = joint.mvc.View.extend({ can: function(feature) { var interactive = joint.util.isFunction(this.options.interactive) - ? this.options.interactive(this) - : this.options.interactive; + ? this.options.interactive(this) + : this.options.interactive; return (joint.util.isObject(interactive) && interactive[feature] !== false) || (joint.util.isBoolean(interactive) && interactive !== false); @@ -14731,14 +14736,14 @@ joint.dia.Link = joint.dia.Cell.extend({ return label; } -}, - { - endsEqual: function(a, b) { +}, { - var portsEqual = a.port === b.port || !a.port && !b.port; - return a.id === b.id && portsEqual; - } - }); + endsEqual: function(a, b) { + + var portsEqual = a.port === b.port || !a.port && !b.port; + return a.id === b.id && portsEqual; + } +}); // joint.dia.Link base view and controller. @@ -15003,7 +15008,7 @@ joint.dia.LinkView = joint.dia.CellView.extend({ } } - return { fragment: fragment, selectors: {} }; // no selectors + return { fragment: fragment, selectors: {}}; // no selectors }, // Label markup fragment may come wrapped in , or not. @@ -15592,8 +15597,8 @@ joint.dia.LinkView = joint.dia.CellView.extend({ this.targetAnchor.offset(tx, ty); }, - // if label position is a number, normalize it to a position object - // this makes sure that label positions can be merged properly + // if label position is a number, normalize it to a position object + // this makes sure that label positions can be merged properly _normalizeLabelPosition: function(labelPosition) { if (typeof labelPosition === 'number') return { distance: labelPosition, offset: null, args: null }; @@ -16432,12 +16437,11 @@ joint.dia.LinkView = joint.dia.CellView.extend({ // Backwards compatibility var linkTool = V(evt.target).findParentByClass('link-tool', this.el); if (linkTool) { - // No further action to be executed - evt.stopPropagation(); - // Allow `interactive.useLinkTools=false` if (this.can('useLinkTools')) { if (eventName === 'remove') { + // No further action to be executed + evt.stopPropagation(); // Built-in remove event this.model.remove({ ui: true }); @@ -17350,7 +17354,7 @@ joint.dia.Paper = joint.mvc.View.extend({ // Setter: ctm = V.createSVGMatrix(ctm); - ctmString = V.matrixToTransformString(ctm); + var ctmString = V.matrixToTransformString(ctm); viewport.setAttribute('transform', ctmString); this.tools.setAttribute('transform', ctmString); @@ -18549,7 +18553,7 @@ joint.dia.Paper = joint.mvc.View.extend({ add: function(id, vel) { V(this.root.node.childNodes[0]).append(vel); this.patterns[id] = vel; - this.root.append(V('rect', { width: "100%", height: "100%", fill: 'url(#' + id + ')' })); + this.root.append(V('rect', { width: '100%', height: '100%', fill: 'url(#' + id + ')' })); }, get: function(id) { return this.patterns[id] @@ -19108,7 +19112,7 @@ joint.dia.Paper = joint.mvc.View.extend({ } }); -(function(joint, _, util) { +(function(joint, util) { var PortData = function(data) { @@ -19346,7 +19350,8 @@ joint.dia.Paper = joint.mvc.View.extend({ */ hasPorts: function() { - return this.prop('ports/items').length > 0; + var ports = this.prop('ports/items'); + return Array.isArray(ports) && ports.length > 0; }, /** @@ -19372,7 +19377,7 @@ joint.dia.Paper = joint.mvc.View.extend({ */ getPort: function(id) { - return util.cloneDeep(util.toArray(this.prop('ports/items')).find( function(port) { + return util.cloneDeep(util.toArray(this.prop('ports/items')).find(function(port) { return port.id && port.id === id; })); }, @@ -19893,7 +19898,7 @@ joint.dia.Paper = joint.mvc.View.extend({ } }); -}(joint, _, joint.util)); +}(joint, joint.util)); joint.dia.Element.define('basic.Generic', { attrs: { @@ -20178,7 +20183,7 @@ joint.shapes.basic.PortsModelInterface = { selector = '.outPorts'; index = this.get('outPorts').indexOf(name); - if (index < 0) throw new Error("getPortSelector(): Port doesn't exist."); + if (index < 0) throw new Error('getPortSelector(): Port doesn\'t exist.'); } return selector + '>g:nth-child(' + (index + 1) + ')>.port-body'; @@ -20853,6 +20858,8 @@ joint.shapes.basic.TextBlockView = joint.dia.ElementView.extend({ } }; + var labelMarkup = (env.test('svgforeignobject')) ? foLabelMarkup : svgLabelMarkup; + Element.define('standard.TextBlock', { attrs: { body: { @@ -20876,9 +20883,7 @@ joint.shapes.basic.TextBlockView = joint.dia.ElementView.extend({ markup: [{ tagName: 'rect', selector: 'body' - }, - (env.test('svgforeignobject')) ? foLabelMarkup : svgLabelMarkup - ] + }, labelMarkup] }, { attributes: { text: { @@ -21036,7 +21041,7 @@ joint.shapes.basic.TextBlockView = joint.dia.ElementView.extend({ })(joint.dia, joint.util, joint.env, V); -joint.routers.manhattan = (function(g, _, joint, util) { +joint.routers.manhattan = (function(g, joint, util) { 'use strict'; @@ -21835,7 +21840,7 @@ joint.routers.manhattan = (function(g, _, joint, util) { return router(vertices, util.assign({}, config, opt), linkView); }; -})(g, _, joint, joint.util); +})(g, joint, joint.util); joint.routers.metro = (function(util) { @@ -22414,7 +22419,7 @@ joint.connectors.smooth = function(sourcePoint, targetPoint, route, opt) { return (raw) ? path : path.serialize(); }; -joint.connectors.jumpover = (function(_, g, util) { +joint.connectors.jumpover = (function(g, util) { // default size of jump if not specified in options var JUMP_SIZE = 5; @@ -22776,9 +22781,9 @@ joint.connectors.jumpover = (function(_, g, util) { var path = buildPath(jumpingLines, jumpSize, jumpType); return (raw) ? path : path.serialize(); }; -}(_, g, joint.util)); +}(g, joint.util)); -(function(_, g, joint, util) { +(function(g, joint, util) { function portTransformAttrs(point, angle, opt) { @@ -22958,9 +22963,9 @@ joint.connectors.jumpover = (function(_, g, util) { } }; -})(_, g, joint, joint.util); +})(g, joint, joint.util); -(function(_, g, joint, util) { +(function(g, joint, util) { function labelAttributes(opt1, opt2) { @@ -23151,19 +23156,19 @@ joint.connectors.jumpover = (function(_, g, util) { }, left: function(portPosition, elBBox, opt) { - return labelAttributes(opt, { x: -15, attrs: { '.': { y: '.3em', 'text-anchor': 'end' } } }); + return labelAttributes(opt, { x: -15, attrs: { '.': { y: '.3em', 'text-anchor': 'end' }}}); }, right: function(portPosition, elBBox, opt) { - return labelAttributes(opt, { x: 15, attrs: { '.': { y: '.3em', 'text-anchor': 'start' } } }); + return labelAttributes(opt, { x: 15, attrs: { '.': { y: '.3em', 'text-anchor': 'start' }}}); }, top: function(portPosition, elBBox, opt) { - return labelAttributes(opt, { y: -15, attrs: { '.': { 'text-anchor': 'middle' } } }); + return labelAttributes(opt, { y: -15, attrs: { '.': { 'text-anchor': 'middle' }}}); }, bottom: function(portPosition, elBBox, opt) { - return labelAttributes(opt, { y: 15, attrs: { '.': { y: '.6em', 'text-anchor': 'middle' } } }); + return labelAttributes(opt, { y: 15, attrs: { '.': { y: '.6em', 'text-anchor': 'middle' }}}); }, outsideOriented: function(portPosition, elBBox, opt) { @@ -23191,7 +23196,7 @@ joint.connectors.jumpover = (function(_, g, util) { } }; -})(_, g, joint, joint.util); +})(g, joint, joint.util); joint.highlighters.addClass = { @@ -23485,7 +23490,7 @@ joint.highlighters.stroke = { var portId = view.findAttribute('port', magnet); if (portId) { - portGroup = model.portProp(portId, 'group'); + var portGroup = model.portProp(portId, 'group'); var portsPositions = model.getPortsPositions(portGroup); var anchor = new g.Point(portsPositions[portId]).offset(bbox.origin()); anchor.rotate(center, -angle); @@ -23620,7 +23625,6 @@ joint.highlighters.stroke = { if (localShape instanceof g.Path) { var precision = opt.precision || 2; if (!data[BNDR_SUBDIVISIONS]) data[BNDR_SUBDIVISIONS] = localShape.getSegmentSubdivisions({ precision: precision }); - segmentSubdivisions = data[BNDR_SUBDIVISIONS]; pathOpt = { precision: precision, segmentSubdivisions: data[BNDR_SUBDIVISIONS] @@ -24128,7 +24132,7 @@ joint.highlighters.stroke = { // we left the area of the source magnet for the first time vertices.unshift(vertex); this.shiftHandleIndexes(1); - delateSourceAnchor = true; + deleteSourceAnchor = true; } } else if (index === 0) { if (sourceBBox.containsPoint(vertex)) { diff --git a/dist/joint.core.min.css b/dist/joint.core.min.css index d1eefe6d2..8ce44b34d 100644 --- a/dist/joint.core.min.css +++ b/dist/joint.core.min.css @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.core.min.js b/dist/joint.core.min.js index ca7a400d2..f5582c436 100644 --- a/dist/joint.core.min.js +++ b/dist/joint.core.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -44,16 +44,16 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. }(this, function(root, Backbone, _, $) { !function(){function a(a){this.message=a}var b="undefined"!=typeof exports?exports:this,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";a.prototype=new Error,a.prototype.name="InvalidCharacterError",b.btoa||(b.btoa=function(b){for(var d,e,f=String(b),g=0,h=c,i="";f.charAt(0|g)||(h="=",g%1);i+=h.charAt(63&d>>8-g%1*8)){if(e=f.charCodeAt(g+=.75),e>255)throw new a("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");d=d<<8|e}return i}),b.atob||(b.atob=function(b){var d=String(b).replace(/=+$/,"");if(d.length%4==1)throw new a("'atob' failed: The string to be decoded is not correctly encoded.");for(var e,f,g=0,h=0,i="";f=d.charAt(h++);~f&&(e=g%4?64*e+f:f,g++%4)?i+=String.fromCharCode(255&e>>(-2*g&6)):0)f=c.indexOf(f);return i})}(),function(){function a(a,b){return this.slice(a,b)}function b(a,b){arguments.length<2&&(b=0);for(var c=0,d=a.length;c>>0;if(0===e)return!1;for(var f=0|b,g=Math.max(f>=0?f:e-Math.abs(f),0);g>>0;if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var d=arguments[1],e=0;e0?1:-1)*Math.floor(Math.abs(b)):b},d=Math.pow(2,53)-1,e=function(a){var b=c(a);return Math.min(Math.max(b,0),d)};return function(a){var c=this,d=Object(a);if(null==a)throw new TypeError("Array.from requires an array-like object - not null or undefined");var f,g=arguments.length>1?arguments[1]:void 0;if("undefined"!=typeof g){if(!b(g))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(f=arguments[2])}for(var h,i=e(d.length),j=b(c)?Object(new c(i)):new Array(i),k=0;k>>0;if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var d=arguments[1],e=0;ethis.length)&&this.indexOf(a,b)!==-1}),String.prototype.startsWith||(String.prototype.startsWith=function(a,b){return this.substr(b||0,a.length)===a}),Number.isFinite=Number.isFinite||function(a){return"number"==typeof a&&isFinite(a)},Number.isNaN=Number.isNaN||function(a){return a!==a}; -var g=function(){function a(a,b){return b.unshift(null),new(Function.prototype.bind.apply(a,b))}function b(a){var b,c,d=[];for(c=arguments.length,b=1;b=1)return[new q(b,c,d,e),new q(e,e,e,e)];var f=this.getSkeletonPoints(a),g=f.startControlPoint1,h=f.startControlPoint2,i=f.divider,j=f.dividerControlPoint1,k=f.dividerControlPoint2;return[new q(b,g,h,i),new q(i,j,k,e)]},endpointDistance:function(){return this.start.distance(this.end)},equals:function(a){return!!a&&this.start.x===a.start.x&&this.start.y===a.start.y&&this.controlPoint1.x===a.controlPoint1.x&&this.controlPoint1.y===a.controlPoint1.y&&this.controlPoint2.x===a.controlPoint2.x&&this.controlPoint2.y===a.controlPoint2.y&&this.end.x===a.end.x&&this.end.y===a.end.y},getSkeletonPoints:function(a){var b=this.start,c=this.controlPoint1,d=this.controlPoint2,e=this.end;if(a<=0)return{startControlPoint1:b.clone(),startControlPoint2:b.clone(),divider:b.clone(),dividerControlPoint1:c.clone(),dividerControlPoint2:d.clone()};if(a>=1)return{startControlPoint1:c.clone(),startControlPoint2:d.clone(),divider:e.clone(),dividerControlPoint1:e.clone(),dividerControlPoint2:e.clone()};var f=new s(b,c).pointAt(a),g=new s(c,d).pointAt(a),h=new s(d,e).pointAt(a),i=new s(f,g).pointAt(a),j=new s(g,h).pointAt(a),k=new s(i,j).pointAt(a),l={startControlPoint1:f,startControlPoint2:i,divider:k,dividerControlPoint1:j,dividerControlPoint2:h};return l},getSubdivisions:function(a){a=a||{};var b=void 0===a.precision?this.PRECISION:a.precision,c=[new q(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===b)return c;for(var d=this.endpointDistance(),e=p(10,-b),f=0;;){f+=1;for(var g=[],h=c.length,i=0;i1&&r=1)return this.end.clone();var c=this.tAt(a,b);return this.pointAtT(c)},pointAtLength:function(a,b){var c=this.tAtLength(a,b);return this.pointAtT(c)},pointAtT:function(a){return a<=0?this.start.clone():a>=1?this.end.clone():this.getSkeletonPoints(a).divider},PRECISION:3,scale:function(a,b,c){return this.start.scale(a,b,c),this.controlPoint1.scale(a,b,c),this.controlPoint2.scale(a,b,c),this.end.scale(a,b,c),this},tangentAt:function(a,b){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var c=this.tAt(a,b);return this.tangentAtT(c)},tangentAtLength:function(a,b){if(!this.isDifferentiable())return null;var c=this.tAtLength(a,b);return this.tangentAtT(c)},tangentAtT:function(a){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var b=this.getSkeletonPoints(a),c=b.startControlPoint2,d=b.dividerControlPoint1,e=b.divider,f=new s(c,d);return f.translate(e.x-c.x,e.y-c.y),f},tAt:function(a,b){if(a<=0)return 0;if(a>=1)return 1;b=b||{};var c=void 0===b.precision?this.PRECISION:b.precision,d=void 0===b.subdivisions?this.getSubdivisions({precision:c}):b.subdivisions,e={precision:c,subdivisions:d},f=this.length(e),g=f*a;return this.tAtLength(g,e)},tAtLength:function(a,b){var c=!0;a<0&&(c=!1,a=-a),b=b||{};for(var d,e,f,g,h,i=void 0===b.precision?this.PRECISION:b.precision,j=void 0===b.subdivisions?this.getSubdivisions({precision:i}):b.subdivisions,k={precision:i,subdivisions:j},l=0,m=j.length,n=1/m,o=c?0:m-1;c?o=0;c?o++:o--){var q=j[o],r=q.endpointDistance();if(a<=l+r){d=q,e=o*n,f=(o+1)*n,g=c?a-l:r+l-a,h=c?r+l-a:a-l;break}l+=r}if(!d)return c?1:0;for(var s=this.length(k),t=p(10,-i);;){var u;if(u=0!==s?g/s:0,ui.x+g/2,m=ei.x?f-d:f+d,c=g*g/(e-j)-g*g*(f-k)*(b-k)/(h*h*(e-j))+j):(c=f>i.y?e+d:e-d,b=h*h/(f-k)-h*h*(e-j)*(c-j)/(g*g*(f-k))+k),new u(c,b).theta(a)},equals:function(a){return!!a&&a.x===this.x&&a.y===this.y&&a.a===this.a&&a.b===this.b},intersectionWithLine:function(a){var b=[],c=a.start,d=a.end,e=this.a,f=this.b,g=a.vector(),i=c.difference(new u(this)),j=new u(g.x/(e*e),g.y/(f*f)),k=new u(i.x/(e*e),i.y/(f*f)),l=g.dot(j),m=g.dot(k),n=i.dot(k)-1,o=m*m-l*n;if(o<0)return null;if(o>0){var p=h(o),q=(-m-p)/l,r=(-m+p)/l;if((q<0||10){if(f>d||g>d)return null}else if(f=1?c.clone():b.lerp(c,a)},pointAtLength:function(a){var b=this.start,c=this.end,d=!0;a<0&&(d=!1,a=-a);var e=this.length();return a>=e?d?c.clone():b.clone():this.pointAt((d?a:e-a)/e)},pointOffset:function(a){a=new c.Point(a);var b=this.start,d=this.end,e=(d.x-b.x)*(a.y-b.y)-(d.y-b.y)*(a.x-b.x);return e/this.length()},rotate:function(a,b){return this.start.rotate(a,b),this.end.rotate(a,b),this},round:function(a){var b=p(10,a||0);return this.start.x=l(this.start.x*b)/b,this.start.y=l(this.start.y*b)/b,this.end.x=l(this.end.x*b)/b,this.end.y=l(this.end.y*b)/b,this},scale:function(a,b,c){return this.start.scale(a,b,c),this.end.scale(a,b,c),this},setLength:function(a){var b=this.length();if(!b)return this;var c=a/b;return this.scale(c,c,this.start)},squaredLength:function(){var a=this.start.x,b=this.start.y,c=this.end.x,d=this.end.y;return(a-=c)*a+(b-=d)*b},tangentAt:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAt(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},tangentAtLength:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAtLength(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},translate:function(a,b){return this.start.translate(a,b),this.end.translate(a,b),this},vector:function(){return new u(this.end.x-this.start.x,this.end.y-this.start.y)},toString:function(){return this.start.toString()+" "+this.end.toString()}},s.prototype.intersection=s.prototype.intersect;var t=c.Path=function(a){if(!(this instanceof t))return new t(a);if("string"==typeof a)return new t.parse(a);this.segments=[];var b,c;if(a){if(Array.isArray(a)&&0!==a.length)if(c=a.length,a[0].isSegment)for(b=0;b=c||a<0)throw new Error("Index out of range.");return b[a]},getSegmentSubdivisions:function(a){var b=this.segments,c=b.length;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=[],f=0;fd||a<0)throw new Error("Index out of range.");var e,f=null,g=null;if(0!==d&&(a>=1?(f=c[a-1],g=f.nextSegment):g=c[0]),Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");for(var h=b.length,i=0;i=d?(e=d-1,f=1):f<0?f=0:f>1&&(f=1),b=b||{};for(var g,h=void 0===b.precision?this.PRECISION:b.precision,i=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:h}):b.segmentSubdivisions,j=0,k=0;k=1)return this.end.clone();b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.pointAtLength(i,g)},pointAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;if(0===a)return this.start.clone();var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isVisible){if(a<=i+m)return k.pointAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f)return e?f.end:f.start;var n=c[d-1];return n.end.clone()},pointAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].pointAtT(0);if(d>=c)return b[c-1].pointAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].pointAtT(e)},prepareSegment:function(a,b,c){a.previousSegment=b,a.nextSegment=c,b&&(b.nextSegment=a),c&&(c.previousSegment=a);var d=a;return a.isSubpathStart&&(a.subpathStartSegment=a,d=c),d&&this.updateSubpathStartSegment(d),a},PRECISION:3,removeSegment:function(a){var b=this.segments,c=b.length;if(0===c)throw new Error("Path has no segments.");if(a<0&&(a=c+a),a>=c||a<0)throw new Error("Index out of range.");var d=b.splice(a,1)[0],e=d.previousSegment,f=d.nextSegment;e&&(e.nextSegment=f),f&&(f.previousSegment=e),d.isSubpathStart&&f&&this.updateSubpathStartSegment(f)},replaceSegment:function(a,b){var c=this.segments,d=c.length;if(0===d)throw new Error("Path has no segments.");if(a<0&&(a=d+a),a>=d||a<0)throw new Error("Index out of range.");var e,f=c[a],g=f.previousSegment,h=f.nextSegment,i=f.isSubpathStart;if(Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");c.splice(a,1);for(var j=b.length,k=0;k1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.segmentIndexAtLength(i,g)},toPoints:function(a){var b=this.segments,c=b.length;if(0===c)return null;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=void 0===a.segmentSubdivisions?this.getSegmentSubdivisions({precision:d}):a.segmentSubdivisions,f=[],g=[],h=0;h0){var k=j.map(function(a){return a.start});Array.prototype.push.apply(g,k)}else g.push(i.start)}else g.length>0&&(g.push(b[h-1].end),f.push(g),g=[])}return g.length>0&&(g.push(this.end),f.push(g)),f},toPolylines:function(a){var b=[],c=this.toPoints(a);if(!c)return null;for(var d=0,e=c.length;d=0;e?j++:j--){var k=c[j],l=g[j],m=k.length({precision:f,subdivisions:l});if(k.isVisible){if(a<=i+m)return j;h=j}i+=m}return h},tangentAt:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;a<0&&(a=0),a>1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.tangentAtLength(i,g)},tangentAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isDifferentiable()){if(a<=i+m)return k.tangentAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f){var n=e?1:0;return f.tangentAtT(n)}return null},tangentAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].tangentAtT(0);if(d>=c)return b[c-1].tangentAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].tangentAtT(e)},translate:function(a,b){for(var c=this.segments,d=c.length,e=0;e=0;c--){var d=a[c];if(d.isVisible)return d.end}return a[b-1].end}});var u=c.Point=function(a,b){if(!(this instanceof u))return new u(a,b);if("string"==typeof a){var c=a.split(a.indexOf("@")===-1?" ":"@");a=parseFloat(c[0]),b=parseFloat(c[1])}else Object(a)===a&&(b=a.y,a=a.x);this.x=void 0===a?0:a,this.y=void 0===b?0:b};u.fromPolar=function(a,b,c){c=c&&new u(c)||new u(0,0);var d=e(a*f(b)),h=e(a*g(b)),i=x(z(b));return i<90?h=-h:i<180?(d=-d,h=-h):i<270&&(d=-d),new u(c.x+d,c.y+h)},u.random=function(a,b,c,d){return new u(m(o()*(b-a+1)+a),m(o()*(d-c+1)+c))},u.prototype={adhereToRect:function(a){return a.containsPoint(this)?this:(this.x=i(j(this.x,a.x),a.x+a.width),this.y=i(j(this.y,a.y),a.y+a.height),this)},bearing:function(a){return new s(this,a).bearing()},changeInAngle:function(a,b,c){return this.clone().offset(-a,-b).theta(c)-this.theta(c)},clone:function(){return new u(this)},difference:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),new u(this.x-(a||0),this.y-(b||0))},distance:function(a){return new s(this,a).length()},squaredDistance:function(a){return new s(this,a).squaredLength()},equals:function(a){return!!a&&this.x===a.x&&this.y===a.y},magnitude:function(){return h(this.x*this.x+this.y*this.y)||.01},manhattanDistance:function(a){return e(a.x-this.x)+e(a.y-this.y)},move:function(a,b){var c=A(new u(a).theta(this)),d=this.offset(f(c)*b,-g(c)*b);return d},normalize:function(a){var b=(a||1)/this.magnitude();return this.scale(b,b)},offset:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),this.x+=a||0,this.y+=b||0,this},reflection:function(a){return new u(a).move(this,this.distance(a))},rotate:function(a,b){a=a||new c.Point(0,0),b=A(x(-b));var d=f(b),e=g(b),h=d*(this.x-a.x)-e*(this.y-a.y)+a.x,i=e*(this.x-a.x)+d*(this.y-a.y)+a.y;return this.x=h,this.y=i,this},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this},scale:function(a,b,c){return c=c&&new u(c)||new u(0,0),this.x=c.x+a*(this.x-c.x),this.y=c.y+b*(this.y-c.y),this},snapToGrid:function(a,b){return this.x=y(this.x,a),this.y=y(this.y,b||a),this},theta:function(a){a=new u(a);var b=-(a.y-this.y),c=a.x-this.x,d=k(b,c);return d<0&&(d=2*n+d),180*d/n},angleBetween:function(a,b){var c=this.equals(a)||this.equals(b)?NaN:this.theta(b)-this.theta(a);return c<0&&(c+=360),c},vectorAngle:function(a){var b=new u(0,0);return b.angleBetween(this,a)},toJSON:function(){return{x:this.x,y:this.y}},toPolar:function(a){a=a&&new u(a)||new u(0,0);var b=this.x,c=this.y;return this.x=h((b-a.x)*(b-a.x)+(c-a.y)*(c-a.y)),this.y=A(a.theta(new u(b,c))),this},toString:function(){return this.x+"@"+this.y},update:function(a,b){return this.x=a||0,this.y=b||0,this},dot:function(a){return a?this.x*a.x+this.y*a.y:NaN},cross:function(a,b){return a&&b?(b.x-this.x)*(a.y-this.y)-(b.y-this.y)*(a.x-this.x):NaN},lerp:function(a,b){var c=this.x,d=this.y;return new u((1-b)*c+b*a.x,(1-b)*d+b*a.y)}},u.prototype.translate=u.prototype.offset;var v=c.Rect=function(a,b,c,d){return this instanceof v?(Object(a)===a&&(b=a.y,c=a.width,d=a.height,a=a.x),this.x=void 0===a?0:a,this.y=void 0===b?0:b,this.width=void 0===c?0:c,void(this.height=void 0===d?0:d)):new v(a,b,c,d)};v.fromEllipse=function(a){return a=new r(a),new v(a.x-a.a,a.y-a.b,2*a.a,2*a.b)},v.prototype={bbox:function(a){if(!a)return this.clone();var b=A(a||0),c=e(g(b)),d=e(f(b)),h=this.width*d+this.height*c,i=this.width*c+this.height*d;return new v(this.x+(this.width-h)/2,this.y+(this.height-i)/2,h,i)},bottomLeft:function(){return new u(this.x,this.y+this.height)},bottomLine:function(){return new s(this.bottomLeft(),this.bottomRight())},bottomMiddle:function(){return new u(this.x+this.width/2,this.y+this.height); -},center:function(){return new u(this.x+this.width/2,this.y+this.height/2)},clone:function(){return new v(this)},containsPoint:function(a){return a=new u(a),a.x>=this.x&&a.x<=this.x+this.width&&a.y>=this.y&&a.y<=this.y+this.height},containsRect:function(a){var b=new v(this).normalize(),c=new v(a).normalize(),d=b.width,e=b.height,f=c.width,g=c.height;if(!(d&&e&&f&&g))return!1;var h=b.x,i=b.y,j=c.x,k=c.y;return f+=j,d+=h,g+=k,e+=i,h<=j&&f<=d&&i<=k&&g<=e},corner:function(){return new u(this.x+this.width,this.y+this.height)},equals:function(a){var b=new v(this).normalize(),c=new v(a).normalize();return b.x===c.x&&b.y===c.y&&b.width===c.width&&b.height===c.height},intersect:function(a){var b=this.origin(),c=this.corner(),d=a.origin(),e=a.corner();if(e.x<=b.x||e.y<=b.y||d.x>=c.x||d.y>=c.y)return null;var f=j(b.x,d.x),g=j(b.y,d.y);return new v(f,g,i(c.x,e.x)-f,i(c.y,e.y)-g)},intersectionWithLine:function(a){var b,c,d=this,e=[d.topLine(),d.rightLine(),d.bottomLine(),d.leftLine()],f=[],g=[],h=e.length;for(c=0;c0?f:null},intersectionWithLineFromCenterToPoint:function(a,b){a=new u(a);var c,d=new u(this.x+this.width/2,this.y+this.height/2);b&&a.rotate(d,b);for(var e=[this.topLine(),this.rightLine(),this.bottomLine(),this.leftLine()],f=new s(d,a),g=e.length-1;g>=0;--g){var h=e[g].intersection(f);if(null!==h){c=h;break}}return c&&b&&c.rotate(d,-b),c},leftLine:function(){return new s(this.topLeft(),this.bottomLeft())},leftMiddle:function(){return new u(this.x,this.y+this.height/2)},moveAndExpand:function(a){return this.x+=a.x||0,this.y+=a.y||0,this.width+=a.width||0,this.height+=a.height||0,this},offset:function(a,b){return u.prototype.offset.call(this,a,b)},inflate:function(a,b){return void 0===a&&(a=0),void 0===b&&(b=a),this.x-=a,this.y-=b,this.width+=2*a,this.height+=2*b,this},normalize:function(){var a=this.x,b=this.y,c=this.width,d=this.height;return this.width<0&&(a=this.x+this.width,c=-this.width),this.height<0&&(b=this.y+this.height,d=-this.height),this.x=a,this.y=b,this.width=c,this.height=d,this},origin:function(){return new u(this.x,this.y)},pointNearestToPoint:function(a){if(a=new u(a),this.containsPoint(a)){var b=this.sideNearestToPoint(a);switch(b){case"right":return new u(this.x+this.width,a.y);case"left":return new u(this.x,a.y);case"bottom":return new u(a.x,this.y+this.height);case"top":return new u(a.x,this.y)}}return a.adhereToRect(this)},rightLine:function(){return new s(this.topRight(),this.bottomRight())},rightMiddle:function(){return new u(this.x+this.width,this.y+this.height/2)},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this.width=l(this.width*b)/b,this.height=l(this.height*b)/b,this},scale:function(a,b,c){return c=this.origin().scale(a,b,c),this.x=c.x,this.y=c.y,this.width*=a,this.height*=b,this},maxRectScaleToFit:function(a,b){a=new v(a),b||(b=a.center());var c,d,e,f,g,h,j,k,l=b.x,m=b.y;c=d=e=f=g=h=j=k=1/0;var n=a.topLeft();n.xl&&(d=(this.x+this.width-l)/(o.x-l)),o.y>m&&(h=(this.y+this.height-m)/(o.y-m));var p=a.topRight();p.x>l&&(e=(this.x+this.width-l)/(p.x-l)),p.ym&&(k=(this.y+this.height-m)/(q.y-m)),{sx:i(c,d,e,f),sy:i(g,h,j,k)}},maxRectUniformScaleToFit:function(a,b){var c=this.maxRectScaleToFit(a,b);return i(c.sx,c.sy)},sideNearestToPoint:function(a){a=new u(a);var b=a.x-this.x,c=this.x+this.width-a.x,d=a.y-this.y,e=this.y+this.height-a.y,f=b,g="left";return cb&&(b=i),jd&&(d=j)}return new v(a,c,b-a,d-c)},clone:function(){var a=this.points,b=a.length;if(0===b)return new w;for(var c=[],d=0;df.x&&(f=c[a]);var g=[];for(a=0;a2){var j=g[g.length-1];g.unshift(j)}for(var k,l,m,n,o,p,q={},r=[];0!==g.length;)if(k=g.pop(),l=k[0],!q.hasOwnProperty(k[0]+"@@"+k[1]))for(var s=!1;!s;)if(r.length<2)r.push(k),s=!0;else{m=r.pop(),n=m[0],o=r.pop(),p=o[0];var t=p.cross(n,l);if(t<0)r.push(o),r.push(m),r.push(k),s=!0;else if(0===t){var u=1e-10,v=n.angleBetween(p,l);e(v-180)2&&r.pop();var x,y=-1;for(b=r.length,a=0;a0){var B=r.slice(y),C=r.slice(0,y);A=B.concat(C)}else A=r;var D=[];for(b=A.length,a=0;a=1)return b[c-1].clone();var d=this.length(),e=d*a;return this.pointAtLength(e)},pointAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return b[0].clone();var d=!0;a<0&&(d=!1,a=-a);for(var e=0,f=c-1,g=d?0:f-1;d?g=0;d?g++:g--){var h=b[g],i=b[g+1],j=new s(h,i),k=h.distance(i);if(a<=e+k)return j.pointAtLength((d?1:-1)*(a-e));e+=k}var l=d?b[c-1]:b[0];return l.clone()},scale:function(a,b,c){var d=this.points,e=d.length;if(0===e)return this;for(var f=0;f1&&(a=1);var d=this.length(),e=d*a;return this.tangentAtLength(e)},tangentAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return null;var d=!0;a<0&&(d=!1,a=-a);for(var e,f=0,g=c-1,h=d?0:g-1;d?h=0;d?h++:h--){var i=b[h],j=b[h+1],k=new s(i,j),l=i.distance(j);if(k.isDifferentiable()){if(a<=f+l)return k.tangentAtLength((d?1:-1)*(a-f));e=k}f+=l}if(e){var m=d?1:0;return e.tangentAt(m)}return null},intersectionWithLine:function(a){for(var b=new s(a),c=[],d=this.points,e=0,f=d.length-1;e0?c:null},translate:function(a,b){var c=this.points,d=c.length;if(0===d)return this;for(var e=0;e=1?b:b*a},pointAtT:function(a){if(this.pointAt)return this.pointAt(a);throw new Error("Neither pointAtT() nor pointAt() function is implemented.")},previousSegment:null,subpathStartSegment:null,tangentAtT:function(a){if(this.tangentAt)return this.tangentAt(a);throw new Error("Neither tangentAtT() nor tangentAt() function is implemented.")},bbox:function(){throw new Error("Declaration missing for virtual function.")},clone:function(){throw new Error("Declaration missing for virtual function.")},closestPoint:function(){throw new Error("Declaration missing for virtual function.")},closestPointLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointNormalizedLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointTangent:function(){throw new Error("Declaration missing for virtual function.")},equals:function(){throw new Error("Declaration missing for virtual function.")},getSubdivisions:function(){throw new Error("Declaration missing for virtual function.")},isDifferentiable:function(){throw new Error("Declaration missing for virtual function.")},length:function(){throw new Error("Declaration missing for virtual function.")},pointAt:function(){throw new Error("Declaration missing for virtual function.")},pointAtLength:function(){throw new Error("Declaration missing for virtual function.")},scale:function(){throw new Error("Declaration missing for virtual function.")},tangentAt:function(){throw new Error("Declaration missing for virtual function.")},tangentAtLength:function(){throw new Error("Declaration missing for virtual function.")},translate:function(){throw new Error("Declaration missing for virtual function.")},serialize:function(){throw new Error("Declaration missing for virtual function.")},toString:function(){throw new Error("Declaration missing for virtual function.")}},C=function(){for(var b=[],c=arguments.length,d=0;d0)throw new Error("Closepath constructor expects no arguments.");return this},J={clone:function(){return new I},getSubdivisions:function(){return[]},isDifferentiable:function(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)},scale:function(){return this},translate:function(){return this},type:"Z",serialize:function(){return this.type},toString:function(){return this.type+" "+this.start+" "+this.end}};Object.defineProperty(J,"start",{configurable:!0,enumerable:!0,get:function(){if(!this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path; OR segment has not yet been added to a path.)");return this.previousSegment.end}}),Object.defineProperty(J,"end",{configurable:!0,enumerable:!0,get:function(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. Moveto); OR segment has not yet been added to a path.)");return this.subpathStartSegment.end}}),I.prototype=b(B,s.prototype,J);var K=t.segmentTypes={L:C,C:E,M:G,Z:I,z:I};return t.regexSupportedData=new RegExp("^[\\s\\d"+Object.keys(K).join("")+",.]*$"),t.isDataSupported=function(a){return"string"==typeof a&&this.regexSupportedData.test(a)},c}(); -var V,Vectorizer;V=Vectorizer=function(){"use strict";function a(a,b){a||(a={});var c=q("textPath"),d=a.d;if(d&&void 0===a["xlink:href"]){var e=q("path").attr("d",d).appendTo(b.defs());c.attr("xlink:href","#"+e.id)}return q.isObject(a)&&c.attr(a),c.node}function b(a,b,c){c||(c={});for(var d=c.includeAnnotationIndices,e=c.eol,f=c.lineHeight,g=c.baseSize,h=0,i={},j=b.length-1,k=0;k<=j;k++){var l=b[k],m=null;if(q.isObject(l)){var n=l.attrs,o=q("tspan",n),p=o.node,r=l.t;e&&k===j&&(r+=e),p.textContent=r;var s=n.class;s&&o.addClass(s),d&&o.attr("annotations",l.annotations),m=parseFloat(n["font-size"]),void 0===m&&(m=g),m&&m>h&&(h=m)}else e&&k===j&&(l+=e),p=document.createTextNode(l||" "),g&&g>h&&(h=g);a.appendChild(p)}return h&&(i.maxFontSize=h),f?i.lineHeight=f:h&&(i.lineHeight=1.2*h),i}function c(a,b){var c=parseFloat(a);return s.test(a)?c*b:c}function d(a,b,d,e){if(!Array.isArray(b))return 0;var f=b.length;if(!f)return 0;for(var g=b[0],h=c(g.maxFontSize,d)||d,i=0,j=c(e,d),k=1;k1){var e,g,h=[];for(e=0,g=d.childNodes.length;e0&&D.setAttribute("dy",B),(y>0||g)&&D.setAttribute("x",j),D.className.baseVal=C,r.appendChild(D),v+=E.length+1}if(i)if(l)B=d(h,x,p,o);else if("top"===h)B="0.8em";else{var I;switch(z>0?(I=parseFloat(o)||1,I*=z,s.test(o)||(I/=p)):I=0,h){case"middle":B=.3-I/2+"em";break;case"bottom":B=-I-.3+"em"}}else 0===h?B="0em":h?B=h:(B=0,null===this.attr("y")&&this.attr("y",u||"0.8em"));return r.firstChild.setAttribute("dy",B),this.append(r),this},r.removeAttr=function(a){var b=q.qualifyAttr(a),c=this.node;return b.ns?c.hasAttributeNS(b.ns,b.local)&&c.removeAttributeNS(b.ns,b.local):c.hasAttribute(a)&&c.removeAttribute(a),this},r.attr=function(a,b){if(q.isUndefined(a)){for(var c=this.node.attributes,d={},e=0;e1&&k.push(k[0]),new g.Polyline(k);case"PATH":return l=this.attr("d"),g.Path.isDataSupported(l)||(l=q.normalizePathData(l)),new g.Path(l);case"LINE":return x1=parseFloat(this.attr("x1"))||0,y1=parseFloat(this.attr("y1"))||0,x2=parseFloat(this.attr("x2"))||0,y2=parseFloat(this.attr("y2"))||0,new g.Line({x:x1,y:y1},{x:x2,y:y2})}return this.getBBox()},r.findIntersection=function(a,b){var c=this.svg().node;b=b||c;var d=this.getBBox({target:b}),e=d.center();if(d.intersectionWithLineFromCenterToPoint(a)){var f,h=this.tagName();if("RECT"===h){var i=new g.Rect(parseFloat(this.attr("x")||0),parseFloat(this.attr("y")||0),parseFloat(this.attr("width")),parseFloat(this.attr("height"))),j=this.getTransformToElement(b),k=q.decomposeMatrix(j),l=c.createSVGTransform();l.setRotate(-k.rotation,e.x,e.y);var m=q.transformRect(i,l.matrix.multiply(j));f=new g.Rect(m).intersectionWithLineFromCenterToPoint(a,k.rotation)}else if("PATH"===h||"POLYGON"===h||"POLYLINE"===h||"CIRCLE"===h||"ELLIPSE"===h){var n,o,p,r,s,t,u="PATH"===h?this:this.convertToPath(),v=u.sample(),w=1/0,x=[];for(n=0;n'+(a||"")+"",c=q.parseXML(b,{async:!1});return c.documentElement},q.idCounter=0,q.uniqueId=function(){return"v-"+ ++q.idCounter},q.toNode=function(a){return q.isV(a)?a.node:a.nodeName&&a||a[0]},q.ensureId=function(a){return a=q.toNode(a),a.id||(a.id=q.uniqueId())},q.sanitizeText=function(a){return(a||"").replace(/ /g,"\xa0")},q.isUndefined=function(a){return"undefined"==typeof a},q.isString=function(a){return"string"==typeof a},q.isObject=function(a){return a&&"object"==typeof a},q.isArray=Array.isArray,q.parseXML=function(a,b){b=b||{};var c;try{var d=new DOMParser;q.isUndefined(b.async)||(d.async=b.async),c=d.parseFromString(a,"text/xml")}catch(a){c=void 0}if(!c||c.getElementsByTagName("parsererror").length)throw new Error("Invalid XML: "+a);return c},q.qualifyAttr=function(a){if(a.indexOf(":")!==-1){var b=a.split(":");return{ns:f[b[0]],local:b[1]}}return{ns:null,local:a}},q.transformRegex=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,q.transformSeparatorRegex=/[ ,]+/,q.transformationListRegex=/^(\w+)\((.*)\)/,q.transformStringToMatrix=function(a){var b=q.createSVGMatrix(),c=a&&a.match(q.transformRegex);if(!c)return b;for(var d=0,e=c.length;d=0){var f=q.transformStringToMatrix(a),g=q.decomposeMatrix(f);b=[g.translateX,g.translateY],d=[g.scaleX,g.scaleY],c=[g.rotation];var h=[];0===b[0]&&0===b[0]||h.push("translate("+b+")"),1===d[0]&&1===d[1]||h.push("scale("+d+")"),0!==c[0]&&h.push("rotate("+c+")"),a=h.join(" ")}else{var i=a.match(/translate\((.*?)\)/);i&&(b=i[1].split(e));var j=a.match(/rotate\((.*?)\)/);j&&(c=j[1].split(e));var k=a.match(/scale\((.*?)\)/);k&&(d=k[1].split(e))}}var l=d&&d[0]?parseFloat(d[0]):1;return{value:a,translate:{tx:b&&b[0]?parseInt(b[0],10):0,ty:b&&b[1]?parseInt(b[1],10):0},rotate:{angle:c&&c[0]?parseInt(c[0],10):0,cx:c&&c[1]?parseInt(c[1],10):void 0,cy:c&&c[2]?parseInt(c[2],10):void 0},scale:{sx:l,sy:d&&d[1]?parseFloat(d[1]):l}}},q.deltaTransformPoint=function(a,b){var c=b.x*a.a+b.y*a.c+0,d=b.x*a.b+b.y*a.d+0;return{x:c,y:d}},q.decomposeMatrix=function(a){var b=q.deltaTransformPoint(a,{x:0,y:1}),c=q.deltaTransformPoint(a,{x:1,y:0}),d=180/j*k(b.y,b.x)-90,e=180/j*k(c.y,c.x);return{translateX:a.e,translateY:a.f,scaleX:l(a.a*a.a+a.b*a.b),scaleY:l(a.c*a.c+a.d*a.d),skewX:d,skewY:e,rotation:d}},q.matrixToScale=function(a){var b,c,d,e;return a?(b=q.isUndefined(a.a)?1:a.a,e=q.isUndefined(a.d)?1:a.d,c=a.b,d=a.c):b=e=1,{sx:c?l(b*b+c*c):b,sy:d?l(d*d+e*e):e}},q.matrixToRotate=function(a){var b={x:0,y:1};return a&&(b=q.deltaTransformPoint(a,b)),{angle:g.normalizeAngle(g.toDeg(k(b.y,b.x))-90)}},q.matrixToTranslate=function(a){return{tx:a&&a.e||0,ty:a&&a.f||0}},q.isV=function(a){return a instanceof q},q.isVElement=q.isV;var t=q("svg").node;return q.createSVGMatrix=function(a){var b=t.createSVGMatrix();for(var c in a)b[c]=a[c];return b},q.createSVGTransform=function(a){return q.isUndefined(a)?t.createSVGTransform():(a instanceof SVGMatrix||(a=q.createSVGMatrix(a)),t.createSVGTransformFromMatrix(a))},q.createSVGPoint=function(a,b){var c=t.createSVGPoint();return c.x=a,c.y=b,c},q.transformRect=function(a,b){var c=t.createSVGPoint();c.x=a.x,c.y=a.y;var d=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y;var e=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y+a.height;var f=c.matrixTransform(b);c.x=a.x,c.y=a.y+a.height;var h=c.matrixTransform(b),i=m(d.x,e.x,f.x,h.x),j=n(d.x,e.x,f.x,h.x),k=m(d.y,e.y,f.y,h.y),l=n(d.y,e.y,f.y,h.y);return new g.Rect(i,k,j-i,l-k)},q.transformPoint=function(a,b){return new g.Point(q.createSVGPoint(a.x,a.y).matrixTransform(b))},q.transformLine=function(a,b){return new g.Line(q.transformPoint(a.start,b),q.transformPoint(a.end,b))},q.transformPolyline=function(a,b){var c=a instanceof g.Polyline?a.points:a;q.isArray(c)||(c=[]);for(var d=[],e=0,f=c.length;e=e?f?"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"M0,"+f+"A"+f+","+f+" 0 1,0 0,"+-f+"A"+f+","+f+" 0 1,0 0,"+f+"Z":"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z":f?"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L"+f*q+","+f*r+"A"+f+","+f+" 0 "+l+",0 "+f*m+","+f*n+"Z":"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L0,0Z"},q.mergeAttrs=function(a,b){for(var c in b)"class"===c?a[c]=a[c]?a[c]+" "+b[c]:b[c]:"style"===c?q.isObject(a[c])&&q.isObject(b[c])?a[c]=q.mergeAttrs(a[c],b[c]):q.isObject(a[c])?a[c]=q.mergeAttrs(a[c],q.styleToObject(b[c])):q.isObject(b[c])?a[c]=q.mergeAttrs(q.styleToObject(a[c]),b[c]):a[c]=q.mergeAttrs(q.styleToObject(a[c]),q.styleToObject(b[c])):a[c]=b[c];return a},q.annotateString=function(a,b,c){b=b||[],c=c||{};for(var d,e,f,g=c.offset||0,h=[],i=[],j=0;j=m&&j=a.start&&ba.start&&c<=a.end||a.start>=b&&a.end=b?a.end+=c:a.start>=b&&(a.start+=c,a.end+=c)}),a},q.convertLineToPathData=function(a){a=q(a);var b=["M",a.attr("x1"),a.attr("y1"),"L",a.attr("x2"),a.attr("y2")].join(" ");return b},q.convertPolygonToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)+" Z"},q.convertPolylineToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)},q.svgPointsToPath=function(a){for(var b=0,c=a.length;b1&&(z=o(z),d*=z,e*=z);var A=d*d,B=e*e,C=(g==h?-1:1)*o(p((A*B-A*y*y-B*x*x)/(A*y*y+B*x*x))),D=C*d*y/e+(a+i)/2,E=C*-e*x/d+(c+q)/2,F=n(((c-E)/e).toFixed(9)),G=n(((q-E)/e).toFixed(9));F=aG&&(F-=2*j),(!h&&G)>F&&(G-=2*j)}var H=G-F;if(p(H)>t){var I=G,J=i,K=q;G=F+t*((h&&G)>F?1:-1),i=D+d*l(G),q=E+e*k(G),v=b(i,q,d,e,f,0,h,J,K,[G,I,D,E])}H=G-F;var L=l(F),M=k(F),N=l(G),O=k(G),P=m(H/4),Q=4/3*(d*P),R=4/3*(e*P),S=[a,c],T=[a+Q*M,c-R*L],U=[i+Q*O,q-R*N],V=[i,q];if(T[0]=2*S[0]-T[0],T[1]=2*S[1]-T[1],r)return[T,U,V].concat(v);v=[T,U,V].concat(v).join().split(",");for(var W=[],X=v.length,Y=0;Y2&&(c.push([d].concat(f.splice(0,2))),g="l",d="m"===d?"l":"L");f.length>=b[g]&&(c.push([d].concat(f.splice(0,b[g]))),b[g]););}),c}function d(a){if(Array.isArray(a)&&Array.isArray(a&&a[0])||(a=c(a)),!a||!a.length)return[["M",0,0]];for(var b,d=[],e=0,f=0,g=0,h=0,i=0,j=a.length,k=i;k7){a[b].shift();for(var c=a[b];c.length;)i[b]="A",a.splice(b++,0,["C"].concat(c.splice(0,6)));a.splice(b,1),l=g.length}}for(var g=d(c),h={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=[],j="",k="",l=g.length,m=0;m0&&(k=i[m-1])),g[m]=e(g[m],h,k),"A"!==i[m]&&"C"===j&&(i[m]="C"),f(g,m);var n=g[m],o=n.length;h.x=n[o-2],h.y=n[o-1],h.bx=parseFloat(n[o-4])||h.x,h.by=parseFloat(n[o-3])||h.y}return g[0][0]&&"M"===g[0][0]||g.unshift(["M",0,0]),g}var f="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",g=new RegExp("([a-z])["+f+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+f+"]*,?["+f+"]*)+)","ig"),h=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+f+"]*,?["+f+"]*","ig"),i=Math,j=i.PI,k=i.sin,l=i.cos,m=i.tan,n=i.asin,o=i.sqrt,p=i.abs;return function(a){return e(a).join(",").split(",").join(" ")}}(),q.namespace=f,q}(); -var joint={version:"2.1.3",config:{classNamePrefix:"joint-",defaultTheme:"default"},dia:{},ui:{},layout:{},shapes:{},format:{},connectors:{},highlighters:{},routers:{},anchors:{},connectionPoints:{},connectionStrategies:{},linkTools:{},mvc:{views:{}},setTheme:function(a,b){b=b||{},joint.util.invoke(joint.mvc.views,"setTheme",a,b),joint.mvc.View.prototype.defaultTheme=a},env:{_results:{},_tests:{svgforeignobject:function(){return!!document.createElementNS&&/SVGForeignObject/.test({}.toString.call(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")))}},addTest:function(a,b){return joint.env._tests[a]=b},test:function(a){var b=joint.env._tests[a];if(!b)throw new Error('Test not defined ("'+a+'"). Use `joint.env.addTest(name, fn) to add a new test.`');var c=joint.env._results[a];if("undefined"!=typeof c)return c;try{c=b()}catch(a){c=!1}return joint.env._results[a]=c,c}},util:{hashCode:function(a){var b=0;if(0==a.length)return b;for(var c=0;c0){var f=joint.util.getByPath(a,d,c);f&&delete f[e]}else delete a[e];return a},flattenObject:function(a,b,c){b=b||"/";var d={};for(var e in a)if(a.hasOwnProperty(e)){var f="object"==typeof a[e];if(f&&c&&c(a[e])&&(f=!1),f){var g=this.flattenObject(a[e],b,c);for(var h in g)g.hasOwnProperty(h)&&(d[e+b+h]=g[h])}else d[e]=a[e]}return d},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)})},guid:function(a){return this.guid.id=this.guid.id||1,a.id=void 0===a.id?"j_"+this.guid.id++:a.id,a.id},toKebabCase:function(a){return a.replace(/[A-Z]/g,"-$&").toLowerCase()},mixin:_.assign,supplement:_.defaults,deepMixin:_.mixin,deepSupplement:_.defaultsDeep,normalizeEvent:function(a){var b=a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches[0];if(b){for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return a},nextFrame:function(){var a;if("undefined"!=typeof window&&(a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame),!a){var b=0;a=function(a){var c=(new Date).getTime(),d=Math.max(0,16-(c-b)),e=setTimeout(function(){a(c+d)},d);return b=c+d,e}}return function(b,c){return a(c?b.bind(c):b)}}(),cancelFrame:function(){var a,b="undefined"!=typeof window;return b&&(a=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.msCancelRequestAnimationFrame||window.oCancelAnimationFrame||window.oCancelRequestAnimationFrame||window.mozCancelAnimationFrame||window.mozCancelRequestAnimationFrame),a=a||clearTimeout,b?a.bind(window):a}(),shapePerimeterConnectionPoint:function(a,b,c,d){var e,f;if(!c){var g=b.$(".scalable")[0],h=b.$(".rotatable")[0];g&&g.firstChild?c=g.firstChild:h&&h.firstChild&&(c=h.firstChild)}return c?(f=V(c).findIntersection(d,a.paper.viewport),f||(e=V(c).getBBox({target:a.paper.viewport}))):(e=b.model.getBBox(),f=e.intersectionWithLineFromCenterToPoint(d)),f||e.center()},isPercentage:function(a){return joint.util.isString(a)&&"%"===a.slice(-1)},parseCssNumeric:function(a,b){b=b||[];var c={value:parseFloat(a)};if(Number.isNaN(c.value))return null;var d=b.join("|");if(joint.util.isString(a)){var e=new RegExp("(\\d+)("+d+")$").exec(a);if(!e)return null;e[2]&&(c.unit=e[2])}return c},breakText:function(a,b,c,d){d=d||{},c=c||{};var e=b.width,f=b.height,g=d.svgDocument||V("svg").node,h=V("tspan").node,i=V("text").attr(c).append(h).node,j=document.createTextNode("");i.style.opacity=0,i.style.display="block",h.style.display="block",h.appendChild(j),g.appendChild(i),d.svgDocument||document.body.appendChild(g);for(var k,l,m=d.separator||" ",n=d.eol||"\n",o=a.split(m),p=[],q=[],r=0,s=0,t=o.length;r=0)if(u.length>1){for(var v=u.split(n),w=0,x=v.length-1;wf){q.splice(Math.floor(f/l));break}}}}return d.svgDocument?g.removeChild(i):document.body.removeChild(g),q.join(n)},sanitizeHTML:function(a){var b=$($.parseHTML("
"+a+"
",null,!1));return b.find("*").each(function(){var a=this;$.each(a.attributes,function(){var b=this,c=b.name,d=b.value;0!==c.indexOf("on")&&0!==d.indexOf("javascript:")||$(a).removeAttr(c)})}),b.html()},downloadBlob:function(a,b){if(window.navigator.msSaveBlob)window.navigator.msSaveBlob(a,b);else{var c=window.URL.createObjectURL(a),d=document.createElement("a");d.href=c,d.download=b,document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c)}},downloadDataUri:function(a,b){var c=joint.util.dataUriToBlob(a);joint.util.downloadBlob(c,b)},dataUriToBlob:function(a){a=a.replace(/\s/g,""),a=decodeURIComponent(a);var b,c=a.indexOf(","),d=a.slice(0,c),e=d.split(":")[1].split(";")[0],f=a.slice(c+1);b=d.indexOf("base64")>=0?atob(f):unescape(encodeURIComponent(f));for(var g=new window.Uint8Array(b.length),h=0;h=1)return 1;var b=a*a,c=b*a;return 4*(a<.5?c:3*(a-b)+c-.75)},exponential:function(a){return Math.pow(2,10*(a-1))},bounce:function(a){for(var b=0,c=1;1;b+=c,c/=2)if(a>=(7-4*b)/11){var d=(11-6*b-11*a)/4;return-d*d+c*c}},reverse:function(a){return function(b){return 1-a(1-b)}},reflect:function(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}},clamp:function(a,b,c){return b=b||0,c=c||1,function(d){var e=a(d);return ec?c:e}},back:function(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}},elastic:function(a){return a||(a=1.5),function(b){return Math.pow(2,10*(b-1))*Math.cos(20*Math.PI*a/3*b)}}},interpolate:{number:function(a,b){var c=b-a;return function(b){return a+c*b}},object:function(a,b){var c=Object.keys(a);return function(d){var e,f,g={};for(e=c.length-1;e!=-1;e--)f=c[e],g[f]=a[f]+(b[f]-a[f])*d;return g}},hexColor:function(a,b){var c=parseInt(a.slice(1),16),d=parseInt(b.slice(1),16),e=255&c,f=(255&d)-e,g=65280&c,h=(65280&d)-g,i=16711680&c,j=(16711680&d)-i;return function(a){var b=e+f*a&255,c=g+h*a&65280,d=i+j*a&16711680;return"#"+(1<<24|b|c|d).toString(16).slice(1)}},unit:function(a,b){var c=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,d=c.exec(a),e=c.exec(b),f=e[1].indexOf("."),g=f>0?e[1].length-f-1:0;a=+d[1];var h=+e[1]-a,i=d[2];return function(b){return(a+h*b).toFixed(g)+i}}},filter:{outline:function(a){var b='',c=Number.isFinite(a.margin)?a.margin:2,d=Number.isFinite(a.width)?a.width:1;return joint.util.template(b)({color:a.color||"blue",opacity:Number.isFinite(a.opacity)?a.opacity:1,outerRadius:c+d,innerRadius:c})},highlight:function(a){var b='';return joint.util.template(b)({color:a.color||"red",width:Number.isFinite(a.width)?a.width:1,blur:Number.isFinite(a.blur)?a.blur:0,opacity:Number.isFinite(a.opacity)?a.opacity:1})},blur:function(a){var b=Number.isFinite(a.x)?a.x:2;return joint.util.template('')({stdDeviation:Number.isFinite(a.y)?[b,a.y]:b})},dropShadow:function(a){var b="SVGFEDropShadowElement"in window?'':'';return joint.util.template(b)({dx:a.dx||0,dy:a.dy||0,opacity:Number.isFinite(a.opacity)?a.opacity:1,color:a.color||"black",blur:Number.isFinite(a.blur)?a.blur:4})},grayscale:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({a:.2126+.7874*(1-b),b:.7152-.7152*(1-b),c:.0722-.0722*(1-b),d:.2126-.2126*(1-b),e:.7152+.2848*(1-b),f:.0722-.0722*(1-b),g:.2126-.2126*(1-b),h:.0722+.9278*(1-b)})},sepia:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({a:.393+.607*(1-b),b:.769-.769*(1-b),c:.189-.189*(1-b),d:.349-.349*(1-b),e:.686+.314*(1-b),f:.168-.168*(1-b),g:.272-.272*(1-b),h:.534-.534*(1-b),i:.131+.869*(1-b)})},saturate:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:1-b})},hueRotate:function(a){return joint.util.template('')({angle:a.angle||0})},invert:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:b,amount2:1-b})},brightness:function(a){return joint.util.template('')({amount:Number.isFinite(a.amount)?a.amount:1})},contrast:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:b,amount2:.5-b/2})}},format:{number:function(a,b,c){function d(a){for(var b=a.length,d=[],e=0,f=c.grouping[0];b>0&&f>0;)d.push(a.substring(b-=f,b+f)),f=c.grouping[e=(e+1)%c.grouping.length];return d.reverse().join(c.thousands)}c=c||{currency:["$",""],decimal:".",thousands:",",grouping:[3]};var e=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,f=e.exec(a),g=f[1]||" ",h=f[2]||">",i=f[3]||"",j=f[4]||"",k=f[5],l=+f[6],m=f[7],n=f[8],o=f[9],p=1,q="",r="",s=!1;switch(n&&(n=+n.substring(1)),(k||"0"===g&&"="===h)&&(k=g="0",h="=",m&&(l-=Math.floor((l-1)/4))),o){case"n":m=!0,o="g";break;case"%":p=100,r="%",o="f";break;case"p":p=100,r="%",o="r";break;case"b":case"o":case"x":case"X":"#"===j&&(q="0"+o.toLowerCase());break;case"c":case"d":s=!0,n=0;break;case"s":p=-1,o="r"}"$"===j&&(q=c.currency[0],r=c.currency[1]),"r"!=o||n||(o="g"),null!=n&&("g"==o?n=Math.max(1,Math.min(21,n)):"e"!=o&&"f"!=o||(n=Math.max(0,Math.min(20,n))));var t=k&&m;if(s&&b%1)return"";var u=b<0||0===b&&1/b<0?(b=-b,"-"):i,v=r;if(p<0){var w=this.prefix(b,n);b=w.scale(b),v=w.symbol+r}else b*=p;b=this.convert(o,b,n);var x=b.lastIndexOf("."),y=x<0?b:b.substring(0,x),z=x<0?"":c.decimal+b.substring(x+1);!k&&m&&c.grouping&&(y=d(y));var A=q.length+y.length+z.length+(t?0:u.length),B=A"===h?B+u+b:"^"===h?B.substring(0,A>>=1)+u+b+B.substring(A):u+(t?b:B+b))+v},string:function(a,b){for(var c,d="{",e=!1,f=[];(c=a.indexOf(d))!==-1;){var g,h,i;if(g=a.slice(0,c),e){h=g.split(":"),i=h.shift().split("."),g=b;for(var j=0;j8?function(a){return a/c}:function(a){return a*c},symbol:a}}),d=0;return a&&(a<0&&(a*=-1),b&&(a=this.round(a,this.precision(a,b))),d=1+Math.floor(1e-12+Math.log(a)/Math.LN10),d=Math.max(-24,Math.min(24,3*Math.floor((d<=0?d+1:d-1)/3)))),c[8+d/3]}},template:function(a){var b=/<%= ([^ ]+) %>|\$\{ ?([^\{\} ]+) ?\}|\{\{([^\{\} ]+)\}\}/g;return function(c){return c=c||{},a.replace(b,function(a){for(var b=Array.from(arguments),d=b.slice(1,4).find(function(a){return!!a}),e=d.split("."),f=c[e.shift()];void 0!==f&&e.length;)f=f[e.shift()];return void 0!==f?f:""})}},toggleFullScreen:function(a){function b(a,b){for(var c=["webkit","moz","ms","o",""],d=0;d0&&b[0]||[],e=c>1&&b[c-1]||{};return Array.isArray(d)||(e instanceof joint.dia.Cell?d=b:d instanceof joint.dia.Cell&&(b.length>1&&b.pop(),d=b)),e instanceof joint.dia.Cell&&(e={}),a.call(this,d,e)}}},parseDOMJSON:function(a,b){for(var c={},d=V.namespace.xmlns,e=b||d,f=document.createDocumentFragment(),g=[a,f,e];g.length>0;){e=g.pop();for(var h=g.pop(),i=g.pop(),j=0,k=i.length;j0);return this.stopBatch("clear"),this},_prepareCell:function(a,b){var c;if(a instanceof Backbone.Model?(c=a.attributes,a.graph||b&&b.dry||(a.graph=this)):c=a,!joint.util.isString(c.type))throw new TypeError("dia.Graph: cell type must be a string.");return a},minZIndex:function(){var a=this.get("cells").first();return a?a.get("z")||0:0},maxZIndex:function(){var a=this.get("cells").last();return a?a.get("z")||0:0},addCell:function(a,b){return Array.isArray(a)?this.addCells(a,b):(a instanceof Backbone.Model?a.has("z")||a.set("z",this.maxZIndex()+1):void 0===a.z&&(a.z=this.maxZIndex()+1),this.get("cells").add(this._prepareCell(a,b),b||{}),this)},addCells:function(a,b){return a.length&&(a=joint.util.flattenDeep(a),b.position=a.length,this.startBatch("add"),a.forEach(function(a){b.position--,this.addCell(a,b)},this),this.stopBatch("add")),this},resetCells:function(a,b){var c=joint.util.toArray(a).map(function(a){return this._prepareCell(a,b)},this);return this.get("cells").reset(c,b),this},removeCells:function(a,b){return a.length&&(this.startBatch("remove"),joint.util.invoke(a,"remove",b),this.stopBatch("remove")),this},_removeCell:function(a,b,c){c=c||{},c.clear||(c.disconnectLinks?this.disconnectLinks(a,c):this.removeLinks(a,c)),this.get("cells").remove(a,{silent:!0}),a.graph===this&&(a.graph=null)},getCell:function(a){return this.get("cells").get(a)},getCells:function(){return this.get("cells").toArray()},getElements:function(){return Object.keys(this._nodes).map(this.getCell,this)},getLinks:function(){return Object.keys(this._edges).map(this.getCell,this)},getFirstCell:function(){return this.get("cells").first()},getLastCell:function(){return this.get("cells").last()},getConnectedLinks:function(a,b){b=b||{};var c=b.inbound,d=b.outbound;void 0===c&&void 0===d&&(c=d=!0);var e=[],f={};if(d&&joint.util.forIn(this.getOutboundEdges(a.id),function(a,b){f[b]||(e.push(this.getCell(b)),f[b]=!0)}.bind(this)),c&&joint.util.forIn(this.getInboundEdges(a.id),function(a,b){f[b]||(e.push(this.getCell(b)),f[b]=!0)}.bind(this)),b.deep){var g=a.getEmbeddedCells({deep:!0}),h={};g.forEach(function(a){a.isElement()&&(h[a.id]=!0)}),g.forEach(function(a){a.isLink()||(d&&joint.util.forIn(this.getOutboundEdges(a.id),function(a,c){if(!f[c]){var d=this.getCell(c),g=d.source().id,i=d.target().id;if(!b.includeEnclosed&&g&&h[g]&&i&&h[i])return;e.push(this.getCell(c)),f[c]=!0}}.bind(this)),c&&joint.util.forIn(this.getInboundEdges(a.id),function(a,c){if(!f[c]){var d=this.getCell(c),g=d.source().id,i=d.target().id;if(!b.includeEnclosed&&g&&h[g]&&i&&h[i])return;e.push(this.getCell(c)),f[c]=!0}}.bind(this)))},this)}return e},getNeighbors:function(a,b){b=b||{};var c=b.inbound,d=b.outbound;void 0===c&&void 0===d&&(c=d=!0);var e=this.getConnectedLinks(a,b).reduce(function(e,f){var g=f.source(),h=f.target(),i=f.hasLoop(b);if(c&&joint.util.has(g,"id")&&!e[g.id]){var j=this.getCell(g.id);!i&&(!j||j===a||b.deep&&j.isEmbeddedIn(a))||(e[g.id]=j)}if(d&&joint.util.has(h,"id")&&!e[h.id]){var k=this.getCell(h.id);!i&&(!k||k===a||b.deep&&k.isEmbeddedIn(a))||(e[h.id]=k)}return e}.bind(this),{});return joint.util.toArray(e)},getCommonAncestor:function(){var a=Array.from(arguments).map(function(a){for(var b=[],c=a.get("parent");c;)b.push(c),c=this.getCell(c).get("parent");return b},this);a=a.sort(function(a,b){return a.length-b.length});var b=joint.util.toArray(a.shift()).find(function(b){return a.every(function(a){return a.includes(b)})});return this.getCell(b)},getSuccessors:function(a,b){b=b||{};var c=[];return this.search(a,function(b){b!==a&&c.push(b)},joint.util.assign({},b,{outbound:!0})),c},cloneCells:function(a){a=joint.util.uniq(a);var b=joint.util.toArray(a).reduce(function(a,b){return a[b.id]=b.clone(),a},{});return joint.util.toArray(a).forEach(function(a){var c=b[a.id];if(c.isLink()){var d=c.source(),e=c.target();d.id&&b[d.id]&&c.prop("source/id",b[d.id].id),e.id&&b[e.id]&&c.prop("target/id",b[e.id].id)}var f=a.get("parent");f&&b[f]&&c.set("parent",b[f].id);var g=joint.util.toArray(a.get("embeds")).reduce(function(a,c){return b[c]&&a.push(b[c].id),a},[]);joint.util.isEmpty(g)||c.set("embeds",g)}),b},cloneSubgraph:function(a,b){var c=this.getSubgraph(a,b);return this.cloneCells(c)},getSubgraph:function(a,b){b=b||{};var c=[],d={},e=[],f=[];return joint.util.toArray(a).forEach(function(a){if(d[a.id]||(c.push(a),d[a.id]=a,a.isLink()?f.push(a):e.push(a)),b.deep){var g=a.getEmbeddedCells({deep:!0});g.forEach(function(a){d[a.id]||(c.push(a),d[a.id]=a,a.isLink()?f.push(a):e.push(a))})}}),f.forEach(function(a){var b=a.source(),f=a.target(); +var g={};!function(a){function b(a,b){return b.unshift(null),new(Function.prototype.bind.apply(a,b))}function c(a){var b,c,d=[];for(c=arguments.length,b=1;b=1)return[new q(b,c,d,e),new q(e,e,e,e)];var f=this.getSkeletonPoints(a),g=f.startControlPoint1,h=f.startControlPoint2,i=f.divider,j=f.dividerControlPoint1,k=f.dividerControlPoint2;return[new q(b,g,h,i),new q(i,j,k,e)]},endpointDistance:function(){return this.start.distance(this.end)},equals:function(a){return!!a&&this.start.x===a.start.x&&this.start.y===a.start.y&&this.controlPoint1.x===a.controlPoint1.x&&this.controlPoint1.y===a.controlPoint1.y&&this.controlPoint2.x===a.controlPoint2.x&&this.controlPoint2.y===a.controlPoint2.y&&this.end.x===a.end.x&&this.end.y===a.end.y},getSkeletonPoints:function(a){var b=this.start,c=this.controlPoint1,d=this.controlPoint2,e=this.end;if(a<=0)return{startControlPoint1:b.clone(),startControlPoint2:b.clone(),divider:b.clone(),dividerControlPoint1:c.clone(),dividerControlPoint2:d.clone()};if(a>=1)return{startControlPoint1:c.clone(),startControlPoint2:d.clone(),divider:e.clone(),dividerControlPoint1:e.clone(),dividerControlPoint2:e.clone()};var f=new s(b,c).pointAt(a),g=new s(c,d).pointAt(a),h=new s(d,e).pointAt(a),i=new s(f,g).pointAt(a),j=new s(g,h).pointAt(a),k=new s(i,j).pointAt(a),l={startControlPoint1:f,startControlPoint2:i,divider:k,dividerControlPoint1:j,dividerControlPoint2:h};return l},getSubdivisions:function(a){a=a||{};var b=void 0===a.precision?this.PRECISION:a.precision,c=[new q(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===b)return c;for(var d=this.endpointDistance(),e=p(10,-b),f=0;;){f+=1;for(var g=[],h=c.length,i=0;i1&&r=1)return this.end.clone();var c=this.tAt(a,b);return this.pointAtT(c)},pointAtLength:function(a,b){var c=this.tAtLength(a,b);return this.pointAtT(c)},pointAtT:function(a){return a<=0?this.start.clone():a>=1?this.end.clone():this.getSkeletonPoints(a).divider},PRECISION:3,scale:function(a,b,c){return this.start.scale(a,b,c),this.controlPoint1.scale(a,b,c),this.controlPoint2.scale(a,b,c),this.end.scale(a,b,c),this},tangentAt:function(a,b){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var c=this.tAt(a,b);return this.tangentAtT(c)},tangentAtLength:function(a,b){if(!this.isDifferentiable())return null;var c=this.tAtLength(a,b);return this.tangentAtT(c)},tangentAtT:function(a){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var b=this.getSkeletonPoints(a),c=b.startControlPoint2,d=b.dividerControlPoint1,e=b.divider,f=new s(c,d);return f.translate(e.x-c.x,e.y-c.y),f},tAt:function(a,b){if(a<=0)return 0;if(a>=1)return 1;b=b||{};var c=void 0===b.precision?this.PRECISION:b.precision,d=void 0===b.subdivisions?this.getSubdivisions({precision:c}):b.subdivisions,e={precision:c,subdivisions:d},f=this.length(e),g=f*a;return this.tAtLength(g,e)},tAtLength:function(a,b){var c=!0;a<0&&(c=!1,a=-a),b=b||{};for(var d,e,f,g,h,i=void 0===b.precision?this.PRECISION:b.precision,j=void 0===b.subdivisions?this.getSubdivisions({precision:i}):b.subdivisions,k={precision:i,subdivisions:j},l=0,m=j.length,n=1/m,o=c?0:m-1;c?o=0;c?o++:o--){var q=j[o],r=q.endpointDistance();if(a<=l+r){d=q,e=o*n,f=(o+1)*n,g=c?a-l:r+l-a,h=c?r+l-a:a-l;break}l+=r}if(!d)return c?1:0;for(var s=this.length(k),t=p(10,-i);;){var u;if(u=0!==s?g/s:0,ui.x+g/2,m=ei.x?f-d:f+d,c=g*g/(e-j)-g*g*(f-k)*(b-k)/(h*h*(e-j))+j):(c=f>i.y?e+d:e-d,b=h*h/(f-k)-h*h*(e-j)*(c-j)/(g*g*(f-k))+k),new u(c,b).theta(a)},equals:function(a){return!!a&&a.x===this.x&&a.y===this.y&&a.a===this.a&&a.b===this.b},intersectionWithLine:function(a){var b=[],c=a.start,d=a.end,e=this.a,f=this.b,g=a.vector(),i=c.difference(new u(this)),j=new u(g.x/(e*e),g.y/(f*f)),k=new u(i.x/(e*e),i.y/(f*f)),l=g.dot(j),m=g.dot(k),n=i.dot(k)-1,o=m*m-l*n;if(o<0)return null;if(o>0){var p=h(o),q=(-m-p)/l,r=(-m+p)/l;if((q<0||10){if(f>d||g>d)return null}else if(f=1?c.clone():b.lerp(c,a)},pointAtLength:function(a){var b=this.start,c=this.end,d=!0;a<0&&(d=!1,a=-a);var e=this.length();return a>=e?d?c.clone():b.clone():this.pointAt((d?a:e-a)/e)},pointOffset:function(b){b=new a.Point(b);var c=this.start,d=this.end,e=(d.x-c.x)*(b.y-c.y)-(d.y-c.y)*(b.x-c.x);return e/this.length()},rotate:function(a,b){return this.start.rotate(a,b),this.end.rotate(a,b),this},round:function(a){var b=p(10,a||0);return this.start.x=l(this.start.x*b)/b,this.start.y=l(this.start.y*b)/b,this.end.x=l(this.end.x*b)/b,this.end.y=l(this.end.y*b)/b,this},scale:function(a,b,c){return this.start.scale(a,b,c),this.end.scale(a,b,c),this},setLength:function(a){var b=this.length();if(!b)return this;var c=a/b;return this.scale(c,c,this.start)},squaredLength:function(){var a=this.start.x,b=this.start.y,c=this.end.x,d=this.end.y;return(a-=c)*a+(b-=d)*b},tangentAt:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAt(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},tangentAtLength:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAtLength(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},translate:function(a,b){return this.start.translate(a,b),this.end.translate(a,b),this},vector:function(){return new u(this.end.x-this.start.x,this.end.y-this.start.y)},toString:function(){return this.start.toString()+" "+this.end.toString()}},s.prototype.intersection=s.prototype.intersect;var t=a.Path=function(a){if(!(this instanceof t))return new t(a);if("string"==typeof a)return new t.parse(a);this.segments=[];var b,c;if(a){if(Array.isArray(a)&&0!==a.length)if(c=a.length,a[0].isSegment)for(b=0;b=c||a<0)throw new Error("Index out of range.");return b[a]},getSegmentSubdivisions:function(a){var b=this.segments,c=b.length;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=[],f=0;fd||a<0)throw new Error("Index out of range.");var e,f=null,g=null;if(0!==d&&(a>=1?(f=c[a-1],g=f.nextSegment):g=c[0]),Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");for(var h=b.length,i=0;i=d?(e=d-1,f=1):f<0?f=0:f>1&&(f=1),b=b||{};for(var g,h=void 0===b.precision?this.PRECISION:b.precision,i=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:h}):b.segmentSubdivisions,j=0,k=0;k=1)return this.end.clone();b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.pointAtLength(i,g)},pointAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;if(0===a)return this.start.clone();var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isVisible){if(a<=i+m)return k.pointAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f)return e?f.end:f.start;var n=c[d-1];return n.end.clone()},pointAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].pointAtT(0);if(d>=c)return b[c-1].pointAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].pointAtT(e)},prepareSegment:function(a,b,c){a.previousSegment=b,a.nextSegment=c,b&&(b.nextSegment=a),c&&(c.previousSegment=a);var d=a;return a.isSubpathStart&&(a.subpathStartSegment=a,d=c),d&&this.updateSubpathStartSegment(d),a},PRECISION:3,removeSegment:function(a){var b=this.segments,c=b.length;if(0===c)throw new Error("Path has no segments.");if(a<0&&(a=c+a),a>=c||a<0)throw new Error("Index out of range.");var d=b.splice(a,1)[0],e=d.previousSegment,f=d.nextSegment;e&&(e.nextSegment=f),f&&(f.previousSegment=e),d.isSubpathStart&&f&&this.updateSubpathStartSegment(f)},replaceSegment:function(a,b){var c=this.segments,d=c.length;if(0===d)throw new Error("Path has no segments.");if(a<0&&(a=d+a),a>=d||a<0)throw new Error("Index out of range.");var e,f=c[a],g=f.previousSegment,h=f.nextSegment,i=f.isSubpathStart;if(Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");c.splice(a,1);for(var j=b.length,k=0;k1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.segmentIndexAtLength(i,g)},toPoints:function(a){var b=this.segments,c=b.length;if(0===c)return null;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=void 0===a.segmentSubdivisions?this.getSegmentSubdivisions({precision:d}):a.segmentSubdivisions,f=[],g=[],h=0;h0){var k=j.map(function(a){return a.start});Array.prototype.push.apply(g,k)}else g.push(i.start)}else g.length>0&&(g.push(b[h-1].end),f.push(g),g=[])}return g.length>0&&(g.push(this.end),f.push(g)),f},toPolylines:function(a){var b=[],c=this.toPoints(a);if(!c)return null;for(var d=0,e=c.length;d=0;e?j++:j--){var k=c[j],l=g[j],m=k.length({precision:f,subdivisions:l});if(k.isVisible){if(a<=i+m)return j;h=j}i+=m}return h},tangentAt:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;a<0&&(a=0),a>1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.tangentAtLength(i,g)},tangentAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isDifferentiable()){if(a<=i+m)return k.tangentAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f){var n=e?1:0;return f.tangentAtT(n)}return null},tangentAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].tangentAtT(0);if(d>=c)return b[c-1].tangentAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].tangentAtT(e)},translate:function(a,b){for(var c=this.segments,d=c.length,e=0;e=0;c--){var d=a[c];if(d.isVisible)return d.end}return a[b-1].end}});var u=a.Point=function(a,b){if(!(this instanceof u))return new u(a,b);if("string"==typeof a){var c=a.split(a.indexOf("@")===-1?" ":"@");a=parseFloat(c[0]),b=parseFloat(c[1])}else Object(a)===a&&(b=a.y,a=a.x);this.x=void 0===a?0:a,this.y=void 0===b?0:b};u.fromPolar=function(a,b,c){c=c&&new u(c)||new u(0,0);var d=e(a*f(b)),h=e(a*g(b)),i=x(z(b));return i<90?h=-h:i<180?(d=-d,h=-h):i<270&&(d=-d),new u(c.x+d,c.y+h)},u.random=function(a,b,c,d){return new u(m(o()*(b-a+1)+a),m(o()*(d-c+1)+c))},u.prototype={adhereToRect:function(a){return a.containsPoint(this)?this:(this.x=i(j(this.x,a.x),a.x+a.width),this.y=i(j(this.y,a.y),a.y+a.height),this)},bearing:function(a){return new s(this,a).bearing()},changeInAngle:function(a,b,c){return this.clone().offset(-a,-b).theta(c)-this.theta(c)},clone:function(){return new u(this)},difference:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),new u(this.x-(a||0),this.y-(b||0))},distance:function(a){return new s(this,a).length()},squaredDistance:function(a){return new s(this,a).squaredLength()},equals:function(a){return!!a&&this.x===a.x&&this.y===a.y},magnitude:function(){return h(this.x*this.x+this.y*this.y)||.01},manhattanDistance:function(a){return e(a.x-this.x)+e(a.y-this.y)},move:function(a,b){var c=A(new u(a).theta(this)),d=this.offset(f(c)*b,-g(c)*b);return d},normalize:function(a){var b=(a||1)/this.magnitude();return this.scale(b,b)},offset:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),this.x+=a||0,this.y+=b||0,this},reflection:function(a){return new u(a).move(this,this.distance(a))},rotate:function(b,c){b=b||new a.Point(0,0),c=A(x(-c));var d=f(c),e=g(c),h=d*(this.x-b.x)-e*(this.y-b.y)+b.x,i=e*(this.x-b.x)+d*(this.y-b.y)+b.y;return this.x=h,this.y=i,this},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this},scale:function(a,b,c){return c=c&&new u(c)||new u(0,0),this.x=c.x+a*(this.x-c.x),this.y=c.y+b*(this.y-c.y),this},snapToGrid:function(a,b){return this.x=y(this.x,a),this.y=y(this.y,b||a),this},theta:function(a){a=new u(a);var b=-(a.y-this.y),c=a.x-this.x,d=k(b,c);return d<0&&(d=2*n+d),180*d/n},angleBetween:function(a,b){var c=this.equals(a)||this.equals(b)?NaN:this.theta(b)-this.theta(a);return c<0&&(c+=360),c},vectorAngle:function(a){var b=new u(0,0);return b.angleBetween(this,a)},toJSON:function(){return{x:this.x,y:this.y}},toPolar:function(a){a=a&&new u(a)||new u(0,0);var b=this.x,c=this.y;return this.x=h((b-a.x)*(b-a.x)+(c-a.y)*(c-a.y)),this.y=A(a.theta(new u(b,c))),this},toString:function(){return this.x+"@"+this.y},update:function(a,b){return this.x=a||0,this.y=b||0,this},dot:function(a){return a?this.x*a.x+this.y*a.y:NaN},cross:function(a,b){return a&&b?(b.x-this.x)*(a.y-this.y)-(b.y-this.y)*(a.x-this.x):NaN},lerp:function(a,b){var c=this.x,d=this.y;return new u((1-b)*c+b*a.x,(1-b)*d+b*a.y)}},u.prototype.translate=u.prototype.offset;var v=a.Rect=function(a,b,c,d){return this instanceof v?(Object(a)===a&&(b=a.y,c=a.width,d=a.height,a=a.x),this.x=void 0===a?0:a,this.y=void 0===b?0:b,this.width=void 0===c?0:c,void(this.height=void 0===d?0:d)):new v(a,b,c,d)};v.fromEllipse=function(a){return a=new r(a),new v(a.x-a.a,a.y-a.b,2*a.a,2*a.b)},v.prototype={bbox:function(a){if(!a)return this.clone();var b=A(a||0),c=e(g(b)),d=e(f(b)),h=this.width*d+this.height*c,i=this.width*c+this.height*d;return new v(this.x+(this.width-h)/2,this.y+(this.height-i)/2,h,i)},bottomLeft:function(){return new u(this.x,this.y+this.height)},bottomLine:function(){return new s(this.bottomLeft(),this.bottomRight())},bottomMiddle:function(){return new u(this.x+this.width/2,this.y+this.height); +},center:function(){return new u(this.x+this.width/2,this.y+this.height/2)},clone:function(){return new v(this)},containsPoint:function(a){return a=new u(a),a.x>=this.x&&a.x<=this.x+this.width&&a.y>=this.y&&a.y<=this.y+this.height},containsRect:function(a){var b=new v(this).normalize(),c=new v(a).normalize(),d=b.width,e=b.height,f=c.width,g=c.height;if(!(d&&e&&f&&g))return!1;var h=b.x,i=b.y,j=c.x,k=c.y;return f+=j,d+=h,g+=k,e+=i,h<=j&&f<=d&&i<=k&&g<=e},corner:function(){return new u(this.x+this.width,this.y+this.height)},equals:function(a){var b=new v(this).normalize(),c=new v(a).normalize();return b.x===c.x&&b.y===c.y&&b.width===c.width&&b.height===c.height},intersect:function(a){var b=this.origin(),c=this.corner(),d=a.origin(),e=a.corner();if(e.x<=b.x||e.y<=b.y||d.x>=c.x||d.y>=c.y)return null;var f=j(b.x,d.x),g=j(b.y,d.y);return new v(f,g,i(c.x,e.x)-f,i(c.y,e.y)-g)},intersectionWithLine:function(a){var b,c,d=this,e=[d.topLine(),d.rightLine(),d.bottomLine(),d.leftLine()],f=[],g=[],h=e.length;for(c=0;c0?f:null},intersectionWithLineFromCenterToPoint:function(a,b){a=new u(a);var c,d=new u(this.x+this.width/2,this.y+this.height/2);b&&a.rotate(d,b);for(var e=[this.topLine(),this.rightLine(),this.bottomLine(),this.leftLine()],f=new s(d,a),g=e.length-1;g>=0;--g){var h=e[g].intersection(f);if(null!==h){c=h;break}}return c&&b&&c.rotate(d,-b),c},leftLine:function(){return new s(this.topLeft(),this.bottomLeft())},leftMiddle:function(){return new u(this.x,this.y+this.height/2)},moveAndExpand:function(a){return this.x+=a.x||0,this.y+=a.y||0,this.width+=a.width||0,this.height+=a.height||0,this},offset:function(a,b){return u.prototype.offset.call(this,a,b)},inflate:function(a,b){return void 0===a&&(a=0),void 0===b&&(b=a),this.x-=a,this.y-=b,this.width+=2*a,this.height+=2*b,this},normalize:function(){var a=this.x,b=this.y,c=this.width,d=this.height;return this.width<0&&(a=this.x+this.width,c=-this.width),this.height<0&&(b=this.y+this.height,d=-this.height),this.x=a,this.y=b,this.width=c,this.height=d,this},origin:function(){return new u(this.x,this.y)},pointNearestToPoint:function(a){if(a=new u(a),this.containsPoint(a)){var b=this.sideNearestToPoint(a);switch(b){case"right":return new u(this.x+this.width,a.y);case"left":return new u(this.x,a.y);case"bottom":return new u(a.x,this.y+this.height);case"top":return new u(a.x,this.y)}}return a.adhereToRect(this)},rightLine:function(){return new s(this.topRight(),this.bottomRight())},rightMiddle:function(){return new u(this.x+this.width,this.y+this.height/2)},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this.width=l(this.width*b)/b,this.height=l(this.height*b)/b,this},scale:function(a,b,c){return c=this.origin().scale(a,b,c),this.x=c.x,this.y=c.y,this.width*=a,this.height*=b,this},maxRectScaleToFit:function(a,b){a=new v(a),b||(b=a.center());var c,d,e,f,g,h,j,k,l=b.x,m=b.y;c=d=e=f=g=h=j=k=1/0;var n=a.topLeft();n.xl&&(d=(this.x+this.width-l)/(o.x-l)),o.y>m&&(h=(this.y+this.height-m)/(o.y-m));var p=a.topRight();p.x>l&&(e=(this.x+this.width-l)/(p.x-l)),p.ym&&(k=(this.y+this.height-m)/(q.y-m)),{sx:i(c,d,e,f),sy:i(g,h,j,k)}},maxRectUniformScaleToFit:function(a,b){var c=this.maxRectScaleToFit(a,b);return i(c.sx,c.sy)},sideNearestToPoint:function(a){a=new u(a);var b=a.x-this.x,c=this.x+this.width-a.x,d=a.y-this.y,e=this.y+this.height-a.y,f=b,g="left";return cb&&(b=i),jd&&(d=j)}return new v(a,c,b-a,d-c)},clone:function(){var a=this.points,b=a.length;if(0===b)return new w;for(var c=[],d=0;df.x&&(f=c[a]);var g=[];for(a=0;a2){var j=g[g.length-1];g.unshift(j)}for(var k,l,m,n,o,p,q={},r=[];0!==g.length;)if(k=g.pop(),l=k[0],!q.hasOwnProperty(k[0]+"@@"+k[1]))for(var s=!1;!s;)if(r.length<2)r.push(k),s=!0;else{m=r.pop(),n=m[0],o=r.pop(),p=o[0];var t=p.cross(n,l);if(t<0)r.push(o),r.push(m),r.push(k),s=!0;else if(0===t){var u=1e-10,v=n.angleBetween(p,l);e(v-180)2&&r.pop();var x,y=-1;for(b=r.length,a=0;a0){var B=r.slice(y),C=r.slice(0,y);A=B.concat(C)}else A=r;var D=[];for(b=A.length,a=0;a=1)return b[c-1].clone();var d=this.length(),e=d*a;return this.pointAtLength(e)},pointAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return b[0].clone();var d=!0;a<0&&(d=!1,a=-a);for(var e=0,f=c-1,g=d?0:f-1;d?g=0;d?g++:g--){var h=b[g],i=b[g+1],j=new s(h,i),k=h.distance(i);if(a<=e+k)return j.pointAtLength((d?1:-1)*(a-e));e+=k}var l=d?b[c-1]:b[0];return l.clone()},scale:function(a,b,c){var d=this.points,e=d.length;if(0===e)return this;for(var f=0;f1&&(a=1);var d=this.length(),e=d*a;return this.tangentAtLength(e)},tangentAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return null;var d=!0;a<0&&(d=!1,a=-a);for(var e,f=0,g=c-1,h=d?0:g-1;d?h=0;d?h++:h--){var i=b[h],j=b[h+1],k=new s(i,j),l=i.distance(j);if(k.isDifferentiable()){if(a<=f+l)return k.tangentAtLength((d?1:-1)*(a-f));e=k}f+=l}if(e){var m=d?1:0;return e.tangentAt(m)}return null},intersectionWithLine:function(a){for(var b=new s(a),c=[],d=this.points,e=0,f=d.length-1;e0?c:null},translate:function(a,b){var c=this.points,d=c.length;if(0===d)return this;for(var e=0;e=1?b:b*a},pointAtT:function(a){if(this.pointAt)return this.pointAt(a);throw new Error("Neither pointAtT() nor pointAt() function is implemented.")},previousSegment:null,subpathStartSegment:null,tangentAtT:function(a){if(this.tangentAt)return this.tangentAt(a);throw new Error("Neither tangentAtT() nor tangentAt() function is implemented.")},bbox:function(){throw new Error("Declaration missing for virtual function.")},clone:function(){throw new Error("Declaration missing for virtual function.")},closestPoint:function(){throw new Error("Declaration missing for virtual function.")},closestPointLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointNormalizedLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointTangent:function(){throw new Error("Declaration missing for virtual function.")},equals:function(){throw new Error("Declaration missing for virtual function.")},getSubdivisions:function(){throw new Error("Declaration missing for virtual function.")},isDifferentiable:function(){throw new Error("Declaration missing for virtual function.")},length:function(){throw new Error("Declaration missing for virtual function.")},pointAt:function(){throw new Error("Declaration missing for virtual function.")},pointAtLength:function(){throw new Error("Declaration missing for virtual function.")},scale:function(){throw new Error("Declaration missing for virtual function.")},tangentAt:function(){throw new Error("Declaration missing for virtual function.")},tangentAtLength:function(){throw new Error("Declaration missing for virtual function.")},translate:function(){throw new Error("Declaration missing for virtual function.")},serialize:function(){throw new Error("Declaration missing for virtual function.")},toString:function(){throw new Error("Declaration missing for virtual function.")}},C=function(){for(var a=[],c=arguments.length,d=0;d0)throw new Error("Closepath constructor expects no arguments.");return this},J={clone:function(){return new I},getSubdivisions:function(){return[]},isDifferentiable:function(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)},scale:function(){return this},translate:function(){return this},type:"Z",serialize:function(){return this.type},toString:function(){return this.type+" "+this.start+" "+this.end}};Object.defineProperty(J,"start",{configurable:!0,enumerable:!0,get:function(){if(!this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path; OR segment has not yet been added to a path.)");return this.previousSegment.end}}),Object.defineProperty(J,"end",{configurable:!0,enumerable:!0,get:function(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. Moveto); OR segment has not yet been added to a path.)");return this.subpathStartSegment.end}}),I.prototype=c(B,s.prototype,J);var K=t.segmentTypes={L:C,C:E,M:G,Z:I,z:I};t.regexSupportedData=new RegExp("^[\\s\\d"+Object.keys(K).join("")+",.]*$"),t.isDataSupported=function(a){return"string"==typeof a&&this.regexSupportedData.test(a)}}(g); +var V,Vectorizer;V=Vectorizer=function(){"use strict";function a(a,b){a||(a={});var c=q("textPath"),d=a.d;if(d&&void 0===a["xlink:href"]){var e=q("path").attr("d",d).appendTo(b.defs());c.attr("xlink:href","#"+e.id)}return q.isObject(a)&&c.attr(a),c.node}function b(a,b,c){c||(c={});for(var d=c.includeAnnotationIndices,e=c.eol,f=c.lineHeight,g=c.baseSize,h=0,i={},j=b.length-1,k=0;k<=j;k++){var l=b[k],m=null;if(q.isObject(l)){var n=l.attrs,o=q("tspan",n),p=o.node,r=l.t;e&&k===j&&(r+=e),p.textContent=r;var s=n.class;s&&o.addClass(s),d&&o.attr("annotations",l.annotations),m=parseFloat(n["font-size"]),void 0===m&&(m=g),m&&m>h&&(h=m)}else e&&k===j&&(l+=e),p=document.createTextNode(l||" "),g&&g>h&&(h=g);a.appendChild(p)}return h&&(i.maxFontSize=h),f?i.lineHeight=f:h&&(i.lineHeight=1.2*h),i}function c(a,b){var c=parseFloat(a);return s.test(a)?c*b:c}function d(a,b,d,e){if(!Array.isArray(b))return 0;var f=b.length;if(!f)return 0;for(var g=b[0],h=c(g.maxFontSize,d)||d,i=0,j=c(e,d),k=1;k1){var e,g,h=[];for(e=0,g=d.childNodes.length;e0&&D.setAttribute("dy",B),(y>0||g)&&D.setAttribute("x",j),D.className.baseVal=C,r.appendChild(D),v+=E.length+1}if(i)if(l)B=d(h,x,p,o);else if("top"===h)B="0.8em";else{var I;switch(z>0?(I=parseFloat(o)||1,I*=z,s.test(o)||(I/=p)):I=0,h){case"middle":B=.3-I/2+"em";break;case"bottom":B=-I-.3+"em"}}else 0===h?B="0em":h?B=h:(B=0,null===this.attr("y")&&this.attr("y",u||"0.8em"));return r.firstChild.setAttribute("dy",B),this.append(r),this},r.removeAttr=function(a){var b=q.qualifyAttr(a),c=this.node;return b.ns?c.hasAttributeNS(b.ns,b.local)&&c.removeAttributeNS(b.ns,b.local):c.hasAttribute(a)&&c.removeAttribute(a),this},r.attr=function(a,b){if(q.isUndefined(a)){for(var c=this.node.attributes,d={},e=0;e1&&k.push(k[0]),new g.Polyline(k);case"PATH":return l=this.attr("d"),g.Path.isDataSupported(l)||(l=q.normalizePathData(l)),new g.Path(l);case"LINE":return m=parseFloat(this.attr("x1"))||0,o=parseFloat(this.attr("y1"))||0,n=parseFloat(this.attr("x2"))||0,p=parseFloat(this.attr("y2"))||0,new g.Line({x:m,y:o},{x:n,y:p})}return this.getBBox()},r.findIntersection=function(a,b){var c=this.svg().node;b=b||c;var d=this.getBBox({target:b}),e=d.center();if(d.intersectionWithLineFromCenterToPoint(a)){var f,h=this.tagName();if("RECT"===h){var i=new g.Rect(parseFloat(this.attr("x")||0),parseFloat(this.attr("y")||0),parseFloat(this.attr("width")),parseFloat(this.attr("height"))),j=this.getTransformToElement(b),k=q.decomposeMatrix(j),l=c.createSVGTransform();l.setRotate(-k.rotation,e.x,e.y);var m=q.transformRect(i,l.matrix.multiply(j));f=new g.Rect(m).intersectionWithLineFromCenterToPoint(a,k.rotation)}else if("PATH"===h||"POLYGON"===h||"POLYLINE"===h||"CIRCLE"===h||"ELLIPSE"===h){var n,o,p,r,s,t,u="PATH"===h?this:this.convertToPath(),v=u.sample(),w=1/0,x=[];for(n=0;n'+(a||"")+"",c=q.parseXML(b,{async:!1});return c.documentElement},q.idCounter=0,q.uniqueId=function(){return"v-"+ ++q.idCounter},q.toNode=function(a){return q.isV(a)?a.node:a.nodeName&&a||a[0]},q.ensureId=function(a){return a=q.toNode(a),a.id||(a.id=q.uniqueId())},q.sanitizeText=function(a){return(a||"").replace(/ /g,"\xa0")},q.isUndefined=function(a){return"undefined"==typeof a},q.isString=function(a){return"string"==typeof a},q.isObject=function(a){return a&&"object"==typeof a},q.isArray=Array.isArray,q.parseXML=function(a,b){b=b||{};var c;try{var d=new DOMParser;q.isUndefined(b.async)||(d.async=b.async),c=d.parseFromString(a,"text/xml")}catch(a){c=void 0}if(!c||c.getElementsByTagName("parsererror").length)throw new Error("Invalid XML: "+a);return c},q.qualifyAttr=function(a){if(a.indexOf(":")!==-1){var b=a.split(":");return{ns:f[b[0]],local:b[1]}}return{ns:null,local:a}},q.transformRegex=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,q.transformSeparatorRegex=/[ ,]+/,q.transformationListRegex=/^(\w+)\((.*)\)/,q.transformStringToMatrix=function(a){var b=q.createSVGMatrix(),c=a&&a.match(q.transformRegex);if(!c)return b;for(var d=0,e=c.length;d=0){var f=q.transformStringToMatrix(a),g=q.decomposeMatrix(f);b=[g.translateX,g.translateY],d=[g.scaleX,g.scaleY],c=[g.rotation];var h=[];0===b[0]&&0===b[0]||h.push("translate("+b+")"),1===d[0]&&1===d[1]||h.push("scale("+d+")"),0!==c[0]&&h.push("rotate("+c+")"),a=h.join(" ")}else{var i=a.match(/translate\((.*?)\)/);i&&(b=i[1].split(e));var j=a.match(/rotate\((.*?)\)/);j&&(c=j[1].split(e));var k=a.match(/scale\((.*?)\)/);k&&(d=k[1].split(e))}}var l=d&&d[0]?parseFloat(d[0]):1;return{value:a,translate:{tx:b&&b[0]?parseInt(b[0],10):0,ty:b&&b[1]?parseInt(b[1],10):0},rotate:{angle:c&&c[0]?parseInt(c[0],10):0,cx:c&&c[1]?parseInt(c[1],10):void 0,cy:c&&c[2]?parseInt(c[2],10):void 0},scale:{sx:l,sy:d&&d[1]?parseFloat(d[1]):l}}},q.deltaTransformPoint=function(a,b){var c=b.x*a.a+b.y*a.c+0,d=b.x*a.b+b.y*a.d+0;return{x:c,y:d}},q.decomposeMatrix=function(a){var b=q.deltaTransformPoint(a,{x:0,y:1}),c=q.deltaTransformPoint(a,{x:1,y:0}),d=180/j*k(b.y,b.x)-90,e=180/j*k(c.y,c.x);return{translateX:a.e,translateY:a.f,scaleX:l(a.a*a.a+a.b*a.b),scaleY:l(a.c*a.c+a.d*a.d),skewX:d,skewY:e,rotation:d}},q.matrixToScale=function(a){var b,c,d,e;return a?(b=q.isUndefined(a.a)?1:a.a,e=q.isUndefined(a.d)?1:a.d,c=a.b,d=a.c):b=e=1,{sx:c?l(b*b+c*c):b,sy:d?l(d*d+e*e):e}},q.matrixToRotate=function(a){var b={x:0,y:1};return a&&(b=q.deltaTransformPoint(a,b)),{angle:g.normalizeAngle(g.toDeg(k(b.y,b.x))-90)}},q.matrixToTranslate=function(a){return{tx:a&&a.e||0,ty:a&&a.f||0}},q.isV=function(a){return a instanceof q},q.isVElement=q.isV;var t=q("svg").node;return q.createSVGMatrix=function(a){var b=t.createSVGMatrix();for(var c in a)b[c]=a[c];return b},q.createSVGTransform=function(a){return q.isUndefined(a)?t.createSVGTransform():(a instanceof SVGMatrix||(a=q.createSVGMatrix(a)),t.createSVGTransformFromMatrix(a))},q.createSVGPoint=function(a,b){var c=t.createSVGPoint();return c.x=a,c.y=b,c},q.transformRect=function(a,b){var c=t.createSVGPoint();c.x=a.x,c.y=a.y;var d=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y;var e=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y+a.height;var f=c.matrixTransform(b);c.x=a.x,c.y=a.y+a.height;var h=c.matrixTransform(b),i=m(d.x,e.x,f.x,h.x),j=n(d.x,e.x,f.x,h.x),k=m(d.y,e.y,f.y,h.y),l=n(d.y,e.y,f.y,h.y);return new g.Rect(i,k,j-i,l-k)},q.transformPoint=function(a,b){return new g.Point(q.createSVGPoint(a.x,a.y).matrixTransform(b))},q.transformLine=function(a,b){return new g.Line(q.transformPoint(a.start,b),q.transformPoint(a.end,b))},q.transformPolyline=function(a,b){var c=a instanceof g.Polyline?a.points:a;q.isArray(c)||(c=[]);for(var d=[],e=0,f=c.length;e=e?f?"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"M0,"+f+"A"+f+","+f+" 0 1,0 0,"+-f+"A"+f+","+f+" 0 1,0 0,"+f+"Z":"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z":f?"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L"+f*q+","+f*r+"A"+f+","+f+" 0 "+l+",0 "+f*m+","+f*n+"Z":"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L0,0Z"},q.mergeAttrs=function(a,b){for(var c in b)"class"===c?a[c]=a[c]?a[c]+" "+b[c]:b[c]:"style"===c?q.isObject(a[c])&&q.isObject(b[c])?a[c]=q.mergeAttrs(a[c],b[c]):q.isObject(a[c])?a[c]=q.mergeAttrs(a[c],q.styleToObject(b[c])):q.isObject(b[c])?a[c]=q.mergeAttrs(q.styleToObject(a[c]),b[c]):a[c]=q.mergeAttrs(q.styleToObject(a[c]),q.styleToObject(b[c])):a[c]=b[c];return a},q.annotateString=function(a,b,c){b=b||[],c=c||{};for(var d,e,f,g=c.offset||0,h=[],i=[],j=0;j=m&&j=a.start&&ba.start&&c<=a.end||a.start>=b&&a.end=b?a.end+=c:a.start>=b&&(a.start+=c,a.end+=c)}),a},q.convertLineToPathData=function(a){a=q(a);var b=["M",a.attr("x1"),a.attr("y1"),"L",a.attr("x2"),a.attr("y2")].join(" ");return b},q.convertPolygonToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)+" Z"},q.convertPolylineToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)},q.svgPointsToPath=function(a){for(var b=0,c=a.length;b1&&(z=o(z),d*=z,e*=z);var A=d*d,B=e*e,C=(g==h?-1:1)*o(p((A*B-A*y*y-B*x*x)/(A*y*y+B*x*x))),D=C*d*y/e+(a+i)/2,E=C*-e*x/d+(c+q)/2,F=n(((c-E)/e).toFixed(9)),G=n(((q-E)/e).toFixed(9));F=aG&&(F-=2*j),(!h&&G)>F&&(G-=2*j)}var H=G-F;if(p(H)>t){var I=G,J=i,K=q;G=F+t*((h&&G)>F?1:-1),i=D+d*l(G),q=E+e*k(G),v=b(i,q,d,e,f,0,h,J,K,[G,I,D,E])}H=G-F;var L=l(F),M=k(F),N=l(G),O=k(G),P=m(H/4),Q=4/3*(d*P),R=4/3*(e*P),S=[a,c],T=[a+Q*M,c-R*L],U=[i+Q*O,q-R*N],V=[i,q];if(T[0]=2*S[0]-T[0],T[1]=2*S[1]-T[1],r)return[T,U,V].concat(v);v=[T,U,V].concat(v).join().split(",");for(var W=[],X=v.length,Y=0;Y2&&(c.push([d].concat(f.splice(0,2))),g="l",d="m"===d?"l":"L");f.length>=b[g]&&(c.push([d].concat(f.splice(0,b[g]))),b[g]););}),c}function d(a){if(Array.isArray(a)&&Array.isArray(a&&a[0])||(a=c(a)),!a||!a.length)return[["M",0,0]];for(var b,d=[],e=0,f=0,g=0,h=0,i=0,j=a.length,k=i;k7){a[b].shift();for(var c=a[b];c.length;)i[b]="A",a.splice(b++,0,["C"].concat(c.splice(0,6)));a.splice(b,1),l=g.length}}for(var g=d(c),h={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=[],j="",k="",l=g.length,m=0;m0&&(k=i[m-1])),g[m]=e(g[m],h,k),"A"!==i[m]&&"C"===j&&(i[m]="C"),f(g,m);var n=g[m],o=n.length;h.x=n[o-2],h.y=n[o-1],h.bx=parseFloat(n[o-4])||h.x,h.by=parseFloat(n[o-3])||h.y}return g[0][0]&&"M"===g[0][0]||g.unshift(["M",0,0]),g}var f="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",g=new RegExp("([a-z])["+f+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+f+"]*,?["+f+"]*)+)","ig"),h=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+f+"]*,?["+f+"]*","ig"),i=Math,j=i.PI,k=i.sin,l=i.cos,m=i.tan,n=i.asin,o=i.sqrt,p=i.abs;return function(a){return e(a).join(",").split(",").join(" ")}}(),q.namespace=f,q}(); +var joint={version:"2.1.4",config:{classNamePrefix:"joint-",defaultTheme:"default"},dia:{},ui:{},layout:{},shapes:{},format:{},connectors:{},highlighters:{},routers:{},anchors:{},connectionPoints:{},connectionStrategies:{},linkTools:{},mvc:{views:{}},setTheme:function(a,b){b=b||{},joint.util.invoke(joint.mvc.views,"setTheme",a,b),joint.mvc.View.prototype.defaultTheme=a},env:{_results:{},_tests:{svgforeignobject:function(){return!!document.createElementNS&&/SVGForeignObject/.test({}.toString.call(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")))}},addTest:function(a,b){return joint.env._tests[a]=b},test:function(a){var b=joint.env._tests[a];if(!b)throw new Error('Test not defined ("'+a+'"). Use `joint.env.addTest(name, fn) to add a new test.`');var c=joint.env._results[a];if("undefined"!=typeof c)return c;try{c=b()}catch(a){c=!1}return joint.env._results[a]=c,c}},util:{hashCode:function(a){var b=0;if(0==a.length)return b;for(var c=0;c0){var f=joint.util.getByPath(a,d,c);f&&delete f[e]}else delete a[e];return a},flattenObject:function(a,b,c){b=b||"/";var d={};for(var e in a)if(a.hasOwnProperty(e)){var f="object"==typeof a[e];if(f&&c&&c(a[e])&&(f=!1),f){var g=this.flattenObject(a[e],b,c);for(var h in g)g.hasOwnProperty(h)&&(d[e+b+h]=g[h])}else d[e]=a[e]}return d},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)})},guid:function(a){return this.guid.id=this.guid.id||1,a.id=void 0===a.id?"j_"+this.guid.id++:a.id,a.id},toKebabCase:function(a){return a.replace(/[A-Z]/g,"-$&").toLowerCase()},normalizeEvent:function(a){var b=a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches[0];if(b){for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return a},nextFrame:function(){var a;if("undefined"!=typeof window&&(a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame),!a){var b=0;a=function(a){var c=(new Date).getTime(),d=Math.max(0,16-(c-b)),e=setTimeout(function(){a(c+d)},d);return b=c+d,e}}return function(b,c){return a(c?b.bind(c):b)}}(),cancelFrame:function(){var a,b="undefined"!=typeof window;return b&&(a=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.msCancelRequestAnimationFrame||window.oCancelAnimationFrame||window.oCancelRequestAnimationFrame||window.mozCancelAnimationFrame||window.mozCancelRequestAnimationFrame),a=a||clearTimeout,b?a.bind(window):a}(),shapePerimeterConnectionPoint:function(a,b,c,d){var e,f;if(!c){var g=b.$(".scalable")[0],h=b.$(".rotatable")[0];g&&g.firstChild?c=g.firstChild:h&&h.firstChild&&(c=h.firstChild)}return c?(f=V(c).findIntersection(d,a.paper.viewport),f||(e=V(c).getBBox({target:a.paper.viewport}))):(e=b.model.getBBox(),f=e.intersectionWithLineFromCenterToPoint(d)),f||e.center()},isPercentage:function(a){return joint.util.isString(a)&&"%"===a.slice(-1)},parseCssNumeric:function(a,b){b=b||[];var c={value:parseFloat(a)};if(Number.isNaN(c.value))return null;var d=b.join("|");if(joint.util.isString(a)){var e=new RegExp("(\\d+)("+d+")$").exec(a);if(!e)return null;e[2]&&(c.unit=e[2])}return c},breakText:function(a,b,c,d){d=d||{},c=c||{};var e=b.width,f=b.height,g=d.svgDocument||V("svg").node,h=V("tspan").node,i=V("text").attr(c).append(h).node,j=document.createTextNode("");i.style.opacity=0,i.style.display="block",h.style.display="block",h.appendChild(j),g.appendChild(i),d.svgDocument||document.body.appendChild(g);for(var k,l,m=d.separator||" ",n=d.eol||"\n",o=a.split(m),p=[],q=[],r=0,s=0,t=o.length;r=0)if(u.length>1){for(var v=u.split(n),w=0,x=v.length-1;wf){q.splice(Math.floor(f/l));break}}}}return d.svgDocument?g.removeChild(i):document.body.removeChild(g),q.join(n)},sanitizeHTML:function(a){var b=$($.parseHTML("
"+a+"
",null,!1));return b.find("*").each(function(){var a=this;$.each(a.attributes,function(){var b=this,c=b.name,d=b.value;0!==c.indexOf("on")&&0!==d.indexOf("javascript:")||$(a).removeAttr(c)})}),b.html()},downloadBlob:function(a,b){if(window.navigator.msSaveBlob)window.navigator.msSaveBlob(a,b);else{var c=window.URL.createObjectURL(a),d=document.createElement("a");d.href=c,d.download=b,document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c)}},downloadDataUri:function(a,b){var c=joint.util.dataUriToBlob(a);joint.util.downloadBlob(c,b)},dataUriToBlob:function(a){a=a.replace(/\s/g,""),a=decodeURIComponent(a);var b,c=a.indexOf(","),d=a.slice(0,c),e=d.split(":")[1].split(";")[0],f=a.slice(c+1);b=d.indexOf("base64")>=0?atob(f):unescape(encodeURIComponent(f));for(var g=new Uint8Array(b.length),h=0;h=1)return 1;var b=a*a,c=b*a;return 4*(a<.5?c:3*(a-b)+c-.75)},exponential:function(a){return Math.pow(2,10*(a-1))},bounce:function(a){for(var b=0,c=1;1;b+=c,c/=2)if(a>=(7-4*b)/11){var d=(11-6*b-11*a)/4;return-d*d+c*c}},reverse:function(a){return function(b){return 1-a(1-b)}},reflect:function(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}},clamp:function(a,b,c){return b=b||0,c=c||1,function(d){var e=a(d);return ec?c:e}},back:function(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}},elastic:function(a){return a||(a=1.5),function(b){return Math.pow(2,10*(b-1))*Math.cos(20*Math.PI*a/3*b)}}},interpolate:{number:function(a,b){var c=b-a;return function(b){return a+c*b}},object:function(a,b){var c=Object.keys(a);return function(d){var e,f,g={};for(e=c.length-1;e!=-1;e--)f=c[e],g[f]=a[f]+(b[f]-a[f])*d;return g}},hexColor:function(a,b){var c=parseInt(a.slice(1),16),d=parseInt(b.slice(1),16),e=255&c,f=(255&d)-e,g=65280&c,h=(65280&d)-g,i=16711680&c,j=(16711680&d)-i;return function(a){var b=e+f*a&255,c=g+h*a&65280,d=i+j*a&16711680;return"#"+(1<<24|b|c|d).toString(16).slice(1)}},unit:function(a,b){var c=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,d=c.exec(a),e=c.exec(b),f=e[1].indexOf("."),g=f>0?e[1].length-f-1:0;a=+d[1];var h=+e[1]-a,i=d[2];return function(b){return(a+h*b).toFixed(g)+i}}},filter:{outline:function(a){var b='',c=Number.isFinite(a.margin)?a.margin:2,d=Number.isFinite(a.width)?a.width:1;return joint.util.template(b)({color:a.color||"blue",opacity:Number.isFinite(a.opacity)?a.opacity:1,outerRadius:c+d,innerRadius:c})},highlight:function(a){var b='';return joint.util.template(b)({color:a.color||"red",width:Number.isFinite(a.width)?a.width:1,blur:Number.isFinite(a.blur)?a.blur:0,opacity:Number.isFinite(a.opacity)?a.opacity:1})},blur:function(a){var b=Number.isFinite(a.x)?a.x:2;return joint.util.template('')({stdDeviation:Number.isFinite(a.y)?[b,a.y]:b})},dropShadow:function(a){var b="SVGFEDropShadowElement"in window?'':'';return joint.util.template(b)({dx:a.dx||0,dy:a.dy||0,opacity:Number.isFinite(a.opacity)?a.opacity:1,color:a.color||"black",blur:Number.isFinite(a.blur)?a.blur:4})},grayscale:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({a:.2126+.7874*(1-b),b:.7152-.7152*(1-b),c:.0722-.0722*(1-b),d:.2126-.2126*(1-b),e:.7152+.2848*(1-b),f:.0722-.0722*(1-b),g:.2126-.2126*(1-b),h:.0722+.9278*(1-b)})},sepia:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({a:.393+.607*(1-b),b:.769-.769*(1-b),c:.189-.189*(1-b),d:.349-.349*(1-b),e:.686+.314*(1-b),f:.168-.168*(1-b),g:.272-.272*(1-b),h:.534-.534*(1-b),i:.131+.869*(1-b)})},saturate:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:1-b})},hueRotate:function(a){return joint.util.template('')({angle:a.angle||0})},invert:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:b,amount2:1-b})},brightness:function(a){return joint.util.template('')({amount:Number.isFinite(a.amount)?a.amount:1})},contrast:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:b,amount2:.5-b/2})}},format:{number:function(a,b,c){function d(a){for(var b=a.length,d=[],e=0,f=c.grouping[0];b>0&&f>0;)d.push(a.substring(b-=f,b+f)),f=c.grouping[e=(e+1)%c.grouping.length];return d.reverse().join(c.thousands)}c=c||{currency:["$",""],decimal:".",thousands:",",grouping:[3]};var e=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,f=e.exec(a),g=f[1]||" ",h=f[2]||">",i=f[3]||"",j=f[4]||"",k=f[5],l=+f[6],m=f[7],n=f[8],o=f[9],p=1,q="",r="",s=!1;switch(n&&(n=+n.substring(1)),(k||"0"===g&&"="===h)&&(k=g="0",h="=",m&&(l-=Math.floor((l-1)/4))),o){case"n":m=!0,o="g";break;case"%":p=100,r="%",o="f";break;case"p":p=100,r="%",o="r";break;case"b":case"o":case"x":case"X":"#"===j&&(q="0"+o.toLowerCase());break;case"c":case"d":s=!0,n=0;break;case"s":p=-1,o="r"}"$"===j&&(q=c.currency[0],r=c.currency[1]),"r"!=o||n||(o="g"),null!=n&&("g"==o?n=Math.max(1,Math.min(21,n)):"e"!=o&&"f"!=o||(n=Math.max(0,Math.min(20,n))));var t=k&&m;if(s&&b%1)return"";var u=b<0||0===b&&1/b<0?(b=-b,"-"):i,v=r;if(p<0){var w=this.prefix(b,n);b=w.scale(b),v=w.symbol+r}else b*=p;b=this.convert(o,b,n);var x=b.lastIndexOf("."),y=x<0?b:b.substring(0,x),z=x<0?"":c.decimal+b.substring(x+1);!k&&m&&c.grouping&&(y=d(y));var A=q.length+y.length+z.length+(t?0:u.length),B=A"===h?B+u+b:"^"===h?B.substring(0,A>>=1)+u+b+B.substring(A):u+(t?b:B+b))+v},string:function(a,b){for(var c,d="{",e=!1,f=[];(c=a.indexOf(d))!==-1;){var g,h,i;if(g=a.slice(0,c),e){h=g.split(":"),i=h.shift().split("."),g=b;for(var j=0;j8?function(a){return a/c}:function(a){return a*c},symbol:a}}),d=0;return a&&(a<0&&(a*=-1),b&&(a=this.round(a,this.precision(a,b))),d=1+Math.floor(1e-12+Math.log(a)/Math.LN10),d=Math.max(-24,Math.min(24,3*Math.floor((d<=0?d+1:d-1)/3)))),c[8+d/3]}},template:function(a){var b=/<%= ([^ ]+) %>|\$\{ ?([^{} ]+) ?\}|\{\{([^{} ]+)\}\}/g;return function(c){return c=c||{},a.replace(b,function(a){for(var b=Array.from(arguments),d=b.slice(1,4).find(function(a){return!!a}),e=d.split("."),f=c[e.shift()];void 0!==f&&e.length;)f=f[e.shift()];return void 0!==f?f:""})}},toggleFullScreen:function(a){function b(a,b){for(var c=["webkit","moz","ms","o",""],d=0;d0&&b[0]||[],e=c>1&&b[c-1]||{};return Array.isArray(d)||(e instanceof joint.dia.Cell?d=b:d instanceof joint.dia.Cell&&(b.length>1&&b.pop(),d=b)),e instanceof joint.dia.Cell&&(e={}),a.call(this,d,e)}}},parseDOMJSON:function(a,b){for(var c={},d=V.namespace.xmlns,e=b||d,f=document.createDocumentFragment(),g=[a,f,e];g.length>0;){e=g.pop();for(var h=g.pop(),i=g.pop(),j=0,k=i.length;j0);return this.stopBatch("clear"),this},_prepareCell:function(a,b){var c;if(a instanceof Backbone.Model?(c=a.attributes,a.graph||b&&b.dry||(a.graph=this)):c=a,!joint.util.isString(c.type))throw new TypeError("dia.Graph: cell type must be a string.");return a},minZIndex:function(){var a=this.get("cells").first();return a?a.get("z")||0:0},maxZIndex:function(){var a=this.get("cells").last();return a?a.get("z")||0:0},addCell:function(a,b){return Array.isArray(a)?this.addCells(a,b):(a instanceof Backbone.Model?a.has("z")||a.set("z",this.maxZIndex()+1):void 0===a.z&&(a.z=this.maxZIndex()+1),this.get("cells").add(this._prepareCell(a,b),b||{}),this)},addCells:function(a,b){return a.length&&(a=joint.util.flattenDeep(a),b.position=a.length,this.startBatch("add"),a.forEach(function(a){b.position--,this.addCell(a,b)},this),this.stopBatch("add")),this},resetCells:function(a,b){var c=joint.util.toArray(a).map(function(a){return this._prepareCell(a,b)},this);return this.get("cells").reset(c,b),this},removeCells:function(a,b){return a.length&&(this.startBatch("remove"),joint.util.invoke(a,"remove",b),this.stopBatch("remove")),this},_removeCell:function(a,b,c){c=c||{},c.clear||(c.disconnectLinks?this.disconnectLinks(a,c):this.removeLinks(a,c)),this.get("cells").remove(a,{silent:!0}),a.graph===this&&(a.graph=null)},getCell:function(a){return this.get("cells").get(a)},getCells:function(){return this.get("cells").toArray()},getElements:function(){return Object.keys(this._nodes).map(this.getCell,this)},getLinks:function(){return Object.keys(this._edges).map(this.getCell,this)},getFirstCell:function(){return this.get("cells").first()},getLastCell:function(){return this.get("cells").last()},getConnectedLinks:function(a,b){b=b||{};var c=b.inbound,d=b.outbound;void 0===c&&void 0===d&&(c=d=!0);var e=[],f={};if(d&&joint.util.forIn(this.getOutboundEdges(a.id),function(a,b){f[b]||(e.push(this.getCell(b)),f[b]=!0)}.bind(this)),c&&joint.util.forIn(this.getInboundEdges(a.id),function(a,b){f[b]||(e.push(this.getCell(b)),f[b]=!0)}.bind(this)),b.deep){var g=a.getEmbeddedCells({deep:!0}),h={};g.forEach(function(a){a.isElement()&&(h[a.id]=!0)}),g.forEach(function(a){a.isLink()||(d&&joint.util.forIn(this.getOutboundEdges(a.id),function(a,c){if(!f[c]){var d=this.getCell(c),g=d.source().id,i=d.target().id;if(!b.includeEnclosed&&g&&h[g]&&i&&h[i])return;e.push(this.getCell(c)),f[c]=!0}}.bind(this)),c&&joint.util.forIn(this.getInboundEdges(a.id),function(a,c){if(!f[c]){var d=this.getCell(c),g=d.source().id,i=d.target().id;if(!b.includeEnclosed&&g&&h[g]&&i&&h[i])return;e.push(this.getCell(c)),f[c]=!0}}.bind(this)))},this)}return e},getNeighbors:function(a,b){b=b||{};var c=b.inbound,d=b.outbound;void 0===c&&void 0===d&&(c=d=!0);var e=this.getConnectedLinks(a,b).reduce(function(e,f){var g=f.source(),h=f.target(),i=f.hasLoop(b);if(c&&joint.util.has(g,"id")&&!e[g.id]){var j=this.getCell(g.id);!i&&(!j||j===a||b.deep&&j.isEmbeddedIn(a))||(e[g.id]=j)}if(d&&joint.util.has(h,"id")&&!e[h.id]){var k=this.getCell(h.id);!i&&(!k||k===a||b.deep&&k.isEmbeddedIn(a))||(e[h.id]=k)}return e}.bind(this),{});return joint.util.toArray(e)},getCommonAncestor:function(){var a=Array.from(arguments).map(function(a){for(var b=[],c=a.get("parent");c;)b.push(c),c=this.getCell(c).get("parent");return b},this);a=a.sort(function(a,b){return a.length-b.length});var b=joint.util.toArray(a.shift()).find(function(b){return a.every(function(a){return a.includes(b)})});return this.getCell(b)},getSuccessors:function(a,b){b=b||{};var c=[];return this.search(a,function(b){b!==a&&c.push(b)},joint.util.assign({},b,{outbound:!0})),c},cloneCells:function(a){a=joint.util.uniq(a);var b=joint.util.toArray(a).reduce(function(a,b){return a[b.id]=b.clone(),a},{});return joint.util.toArray(a).forEach(function(a){var c=b[a.id];if(c.isLink()){var d=c.source(),e=c.target();d.id&&b[d.id]&&c.prop("source/id",b[d.id].id),e.id&&b[e.id]&&c.prop("target/id",b[e.id].id)}var f=a.get("parent");f&&b[f]&&c.set("parent",b[f].id);var g=joint.util.toArray(a.get("embeds")).reduce(function(a,c){return b[c]&&a.push(b[c].id),a},[]);joint.util.isEmpty(g)||c.set("embeds",g)}),b},cloneSubgraph:function(a,b){var c=this.getSubgraph(a,b);return this.cloneCells(c)},getSubgraph:function(a,b){b=b||{};var c=[],d={},e=[],f=[];return joint.util.toArray(a).forEach(function(a){if(d[a.id]||(c.push(a),d[a.id]=a,a.isLink()?f.push(a):e.push(a)),b.deep){var g=a.getEmbeddedCells({deep:!0});g.forEach(function(a){d[a.id]||(c.push(a),d[a.id]=a,a.isLink()?f.push(a):e.push(a))})}}),f.forEach(function(a){var b=a.source(),f=a.target(); if(b.id&&!d[b.id]){var g=this.getCell(b.id);c.push(g),d[g.id]=g,e.push(g)}if(f.id&&!d[f.id]){var h=this.getCell(f.id);c.push(this.getCell(f.id)),d[h.id]=h,e.push(h)}},this),e.forEach(function(a){var e=this.getConnectedLinks(a,b);e.forEach(function(a){var b=a.source(),e=a.target();!d[a.id]&&b.id&&d[b.id]&&e.id&&d[e.id]&&(c.push(a),d[a.id]=a)})},this),c},getPredecessors:function(a,b){b=b||{};var c=[];return this.search(a,function(b){b!==a&&c.push(b)},joint.util.assign({},b,{inbound:!0})),c},search:function(a,b,c){c=c||{},c.breadthFirst?this.bfs(a,b,c):this.dfs(a,b,c)},bfs:function(a,b,c){c=c||{};var d={},e={},f=[];for(f.push(a),e[a.id]=0;f.length>0;){var g=f.shift();if(!d[g.id]){if(d[g.id]=!0,b(g,e[g.id])===!1)return;this.getNeighbors(g,c).forEach(function(a){e[a.id]=e[g.id]+1,f.push(a)})}}},dfs:function(a,b,c,d,e){c=c||{};var f=d||{},g=e||0;b(a,g)!==!1&&(f[a.id]=!0,this.getNeighbors(a,c).forEach(function(a){f[a.id]||this.dfs(a,b,c,f,g+1)},this))},getSources:function(){var a=[];return joint.util.forIn(this._nodes,function(b,c){this._in[c]&&!joint.util.isEmpty(this._in[c])||a.push(this.getCell(c))}.bind(this)),a},getSinks:function(){var a=[];return joint.util.forIn(this._nodes,function(b,c){this._out[c]&&!joint.util.isEmpty(this._out[c])||a.push(this.getCell(c))}.bind(this)),a},isSource:function(a){return!this._in[a.id]||joint.util.isEmpty(this._in[a.id])},isSink:function(a){return!this._out[a.id]||joint.util.isEmpty(this._out[a.id])},isSuccessor:function(a,b){var c=!1;return this.search(a,function(d){if(d===b&&d!==a)return c=!0,!1},{outbound:!0}),c},isPredecessor:function(a,b){var c=!1;return this.search(a,function(d){if(d===b&&d!==a)return c=!0,!1},{inbound:!0}),c},isNeighbor:function(a,b,c){c=c||{};var d=c.inbound,e=c.outbound;void 0===d&&void 0===e&&(d=e=!0);var f=!1;return this.getConnectedLinks(a,c).forEach(function(a){var c=a.source(),g=a.target();return d&&joint.util.has(c,"id")&&c.id===b.id?(f=!0,!1):e&&joint.util.has(g,"id")&&g.id===b.id?(f=!0,!1):void 0}),f},disconnectLinks:function(a,b){this.getConnectedLinks(a).forEach(function(c){c.set(c.source().id===a.id?"source":"target",{x:0,y:0},b)})},removeLinks:function(a,b){joint.util.invoke(this.getConnectedLinks(a),"remove",b)},findModelsFromPoint:function(a){return this.getElements().filter(function(b){return b.getBBox().containsPoint(a)})},findModelsInArea:function(a,b){a=g.rect(a),b=joint.util.defaults(b||{},{strict:!1});var c=b.strict?"containsRect":"intersect";return this.getElements().filter(function(b){return a[c](b.getBBox())})},findModelsUnderElement:function(a,b){b=joint.util.defaults(b||{},{searchBy:"bbox"});var c=a.getBBox(),d="bbox"===b.searchBy?this.findModelsInArea(c):this.findModelsFromPoint(c[b.searchBy]());return d.filter(function(b){return a.id!==b.id&&!b.isEmbeddedIn(a)})},getBBox:function(a,b){return this.getCellsBBox(a||this.getElements(),b)},getCellsBBox:function(a,b){return joint.util.toArray(a).reduce(function(a,c){return c.isLink()?a:a?a.union(c.getBBox(b)):c.getBBox(b)},null)},translate:function(a,b,c){var d=this.getCells().filter(function(a){return!a.isEmbedded()});return joint.util.invoke(d,"translate",a,b,c),this},resize:function(a,b,c){return this.resizeCells(a,b,this.getCells(),c)},resizeCells:function(a,b,c,d){var e=this.getCellsBBox(c);if(e){var f=Math.max(a/e.width,0),g=Math.max(b/e.height,0);joint.util.invoke(c,"scale",f,g,e.origin(),d)}return this},startBatch:function(a,b){return b=b||{},this._batches[a]=(this._batches[a]||0)+1,this.trigger("batch:start",joint.util.assign({},b,{batchName:a}))},stopBatch:function(a,b){return b=b||{},this._batches[a]=(this._batches[a]||0)-1,this.trigger("batch:stop",joint.util.assign({},b,{batchName:a}))},hasActiveBatch:function(a){return 0===arguments.length?joint.util.toArray(this._batches).some(function(a){return a>0}):Array.isArray(a)?a.some(function(a){return!!this._batches[a]},this):!!this._batches[a]}},{validations:{multiLinks:function(a,b){var c=b.source(),d=b.target();if(c.id&&d.id){var e=b.getSourceElement();if(e){var f=a.getConnectedLinks(e,{outbound:!0}),g=f.filter(function(a){var b=a.source(),e=a.target();return b&&b.id===c.id&&(!b.port||b.port===c.port)&&e&&e.id===d.id&&(!e.port||e.port===d.port)});if(g.length>1)return!1}}return!0},linkPinning:function(a,b){return b.source().id&&b.target().id}}}),joint.util.wrapWith(joint.dia.Graph.prototype,["resetCells","addCells","removeCells"],"cells"),function(a,b,c,d,e){function f(a,b){return function(c,d){var f=e.isPercentage(c);c=parseFloat(c),f&&(c/=100);var g={};if(isFinite(c)){var h=f||c>=0&&c<=1?c*d[b]:Math.max(c+d[b],0);g[a]=h}return g}}function g(a,b,d){return function(f,g){var h=e.isPercentage(f);f=parseFloat(f),h&&(f/=100);var i;if(isFinite(f)){var j=g[d]();i=h||f>0&&f<1?j[a]+g[b]*f:j[a]+f}var k=c.Point();return k[a]=i||0,k}}function h(a,b,d){return function(f,g){var h;h="middle"===f?g[b]/2:f===d?g[b]:isFinite(f)?f>-1&&f<1?-g[b]*f:-f:e.isPercentage(f)?g[b]*parseFloat(f)/100:0;var i=c.Point();return i[a]=-(g[a]+h),i}}function i(a,b){var c="joint-shape",e=b&&b.resetOffset;return function(b,f,g){var h=d(g),i=h.data(c);if(!i||i.value!==b){var j=a(b);i={value:b,shape:j,shapeBBox:j.bbox()},h.data(c,i)}var k=i.shape.clone(),l=i.shapeBBox.clone(),m=l.origin(),n=f.origin();l.x=n.x,l.y=n.y;var o=f.maxRectScaleToFit(l,n),p=0===l.width||0===f.width?1:o.sx,q=0===l.height||0===f.height?1:o.sy;return k.scale(p,q,m),e&&k.translate(-m.x,-m.y),k}}function j(a){function d(a){return new c.Path(b.normalizePathData(a))}var e=i(d,a);return function(a,b,c){var d=e(a,b,c);return{d:d.serialize()}}}function k(a){var b=i(c.Polyline,a);return function(a,c,d){var e=b(a,c,d);return{points:e.serialize()}}}function l(a,b){var d=new c.Point(1,0);return function(c){var e,f,g=this[a](c);return g?(f=b.rotate?g.vector().vectorAngle(d):0,e=g.start):(e=this.path.start,f=0),0===f?{transform:"translate("+e.x+","+e.y+")"}:{transform:"translate("+e.x+","+e.y+") rotate("+f+")"}}}function m(a,b,c){return void 0!==c.text}function n(){return this instanceof a.dia.LinkView}function o(a){var b={},c=a.stroke;"string"==typeof c&&(b.stroke=c,b.fill=c);var d=a.strokeOpacity;return void 0===d&&(d=a["stroke-opacity"]),void 0===d&&(d=a.opacity),void 0!==d&&(b["stroke-opacity"]=d,b["fill-opacity"]=d),b}var p=a.dia.attributes={xlinkHref:{set:"xlink:href"},xlinkShow:{set:"xlink:show"},xlinkRole:{set:"xlink:role"},xlinkType:{set:"xlink:type"},xlinkArcrole:{set:"xlink:arcrole"},xlinkTitle:{set:"xlink:title"},xlinkActuate:{set:"xlink:actuate"},xmlSpace:{set:"xml:space"},xmlBase:{set:"xml:base"},xmlLang:{set:"xml:lang"},preserveAspectRatio:{set:"preserveAspectRatio"},requiredExtension:{set:"requiredExtension"},requiredFeatures:{set:"requiredFeatures"},systemLanguage:{set:"systemLanguage"},externalResourcesRequired:{set:"externalResourceRequired"},filter:{qualify:e.isPlainObject,set:function(a){return"url(#"+this.paper.defineFilter(a)+")"}},fill:{qualify:e.isPlainObject,set:function(a){return"url(#"+this.paper.defineGradient(a)+")"}},stroke:{qualify:e.isPlainObject,set:function(a){return"url(#"+this.paper.defineGradient(a)+")"}},sourceMarker:{qualify:e.isPlainObject,set:function(a,b,c,d){return a=e.assign(o(d),a),{"marker-start":"url(#"+this.paper.defineMarker(a)+")"}}},targetMarker:{qualify:e.isPlainObject,set:function(a,b,c,d){return a=e.assign(o(d),{transform:"rotate(180)"},a),{"marker-end":"url(#"+this.paper.defineMarker(a)+")"}}},vertexMarker:{qualify:e.isPlainObject,set:function(a,b,c,d){return a=e.assign(o(d),a),{"marker-mid":"url(#"+this.paper.defineMarker(a)+")"}}},text:{qualify:function(a,b,c){return!c.textWrap||!e.isPlainObject(c.textWrap)},set:function(c,f,g,h){var i=d(g),j="joint-text",k=i.data(j),l=a.util.pick(h,"lineHeight","annotations","textPath","x","textVerticalAnchor","eol"),m=l.fontSize=h["font-size"]||h.fontSize,n=JSON.stringify([c,l]);if(void 0===k||k!==n){m&&g.setAttribute("font-size",m);var o=l.textPath;if(e.isObject(o)){var p=o.selector;if("string"==typeof p){var q=this.findBySelector(p)[0];q instanceof SVGPathElement&&(l.textPath=e.assign({"xlink:href":"#"+q.id},o))}}b(g).text(""+c,l),i.data(j,n)}}},textWrap:{qualify:e.isPlainObject,set:function(b,c,d,f){var g=b.width||0;e.isPercentage(g)?c.width*=parseFloat(g)/100:g<=0?c.width+=g:c.width=g;var h=b.height||0;e.isPercentage(h)?c.height*=parseFloat(h)/100:h<=0?c.height+=h:c.height=h;var i,j=b.text;void 0===j&&(j=f.text),i=void 0!==j?a.util.breakText(""+j,c,{"font-weight":f["font-weight"]||f.fontWeight,"font-size":f["font-size"]||f.fontSize,"font-family":f["font-family"]||f.fontFamily,lineHeight:f.lineHeight},{svgDocument:this.paper.svg}):"",a.dia.attributes.text.set.call(this,i,c,d,f)}},title:{qualify:function(a,b){return b instanceof SVGElement},set:function(a,b,c){var e=d(c),f="joint-title",g=e.data(f);if(void 0===g||g!==a){e.data(f,a);var h=c.firstChild;if(h&&"TITLE"===h.tagName.toUpperCase())h.textContent=a;else{var i=document.createElementNS(c.namespaceURI,"title");i.textContent=a,c.insertBefore(i,h)}}}},lineHeight:{qualify:m},textVerticalAnchor:{qualify:m},textPath:{qualify:m},annotations:{qualify:m},port:{set:function(a){return null===a||void 0===a.id?a:a.id}},style:{qualify:e.isPlainObject,set:function(a,b,c){d(c).css(a)}},html:{set:function(a,b,c){d(c).html(a+"")}},ref:{},refX:{position:g("x","width","origin")},refY:{position:g("y","height","origin")},refDx:{position:g("x","width","corner")},refDy:{position:g("y","height","corner")},refWidth:{set:f("width","width")},refHeight:{set:f("height","height")},refRx:{set:f("rx","width")},refRy:{set:f("ry","height")},refRInscribed:{set:function(a){var b=f(a,"width"),c=f(a,"height");return function(a,d){var e=d.height>d.width?b:c;return e(a,d)}}("r")},refRCircumscribed:{set:function(a,b){var c=e.isPercentage(a);a=parseFloat(a),c&&(a/=100);var d,f=Math.sqrt(b.height*b.height+b.width*b.width);return isFinite(a)&&(d=c||a>=0&&a<=1?a*f:Math.max(a+f,0)),{r:d}}},refCx:{set:f("cx","width")},refCy:{set:f("cy","height")},xAlignment:{offset:h("x","width","right")},yAlignment:{offset:h("y","height","bottom")},resetOffset:{offset:function(a,b){return a?{x:-b.x,y:-b.y}:{x:0,y:0}}},refDResetOffset:{set:j({resetOffset:!0})},refDKeepOffset:{set:j({resetOffset:!1})},refPointsResetOffset:{set:k({resetOffset:!0})},refPointsKeepOffset:{set:k({resetOffset:!1})},connection:{qualify:n,set:function(){return{d:this.getSerializedConnection()}}},atConnectionLengthKeepGradient:{qualify:n,set:l("getTangentAtLength",{rotate:!0})},atConnectionLengthIgnoreGradient:{qualify:n,set:l("getTangentAtLength",{rotate:!1})},atConnectionRatioKeepGradient:{qualify:n,set:l("getTangentAtRatio",{rotate:!0})},atConnectionRatioIgnoreGradient:{qualify:n,set:l("getTangentAtRatio",{rotate:!1})}};p.refR=p.refRInscribed,p.refD=p.refDResetOffset,p.refPoints=p.refPointsResetOffset,p.atConnectionLength=p.atConnectionLengthKeepGradient,p.atConnectionRatio=p.atConnectionRatioKeepGradient,p.refX2=p.refX,p.refY2=p.refY,p["ref-x"]=p.refX,p["ref-y"]=p.refY,p["ref-dy"]=p.refDy,p["ref-dx"]=p.refDx,p["ref-width"]=p.refWidth,p["ref-height"]=p.refHeight,p["x-alignment"]=p.xAlignment,p["y-alignment"]=p.yAlignment}(joint,V,g,$,joint.util),function(a,b){var c=a.mvc.View.extend({name:null,tagName:"g",className:"tool",svgElement:!0,_visible:!0,init:function(){var a=this.name;a&&this.vel.attr("data-tool-name",a)},configure:function(a,b){return this.relatedView=a,this.paper=a.paper,this.parentView=b,this.simulateRelatedView(this.el),this},simulateRelatedView:function(a){a&&a.setAttribute("model-id",this.relatedView.model.id)},getName:function(){return this.name},show:function(){this.el.style.display="",this._visible=!0},hide:function(){this.el.style.display="none",this._visible=!1},isVisible:function(){return!!this._visible},focus:function(){var a=this.options.focusOpacity;isFinite(a)&&(this.el.style.opacity=a),this.parentView.focusTool(this)},blur:function(){this.el.style.opacity="",this.parentView.blurTool(this)},update:function(){}}),d=a.mvc.View.extend({tagName:"g",className:"tools",svgElement:!0,tools:null,options:{tools:null,relatedView:null,name:null,component:!1},configure:function(d){d=b.assign(this.options,d);var e=d.tools;if(!Array.isArray(e))return this;var f=d.relatedView;if(!(f instanceof a.dia.CellView))return this;for(var g=this.tools=[],h=0,i=e.length;h0;){var d=c.shift();b.push(d),c.push.apply(c,d.getEmbeddedCells())}}else b=this.getEmbeddedCells(),b.forEach(function(c){b.push.apply(b,c.getEmbeddedCells(a))});else b=joint.util.toArray(this.get("embeds")).map(this.graph.getCell,this.graph);return b}return[]},isEmbeddedIn:function(a,b){var c=joint.util.isString(a)?a:a.id,d=this.parent();if(b=joint.util.defaults({deep:!0},b),this.graph&&b.deep){for(;d;){if(d===c)return!0;d=this.graph.getCell(d).parent()}return!1}return d===c},isEmbedded:function(){return!!this.parent()},clone:function(a){if(a=a||{},a.deep)return joint.util.toArray(joint.dia.Graph.prototype.cloneCells.call(null,[this].concat(this.getEmbeddedCells({deep:!0}))));var b=Backbone.Model.prototype.clone.apply(this,arguments);return b.set("id",joint.util.uuid()),b.unset("embeds"),b.unset("parent"),b},prop:function(a,b,c){var d="/",e=joint.util.isString(a);if(e||Array.isArray(a)){if(arguments.length>1){var f,g;e?(f=a,g=f.split("/")):(f=a.join(d),g=a.slice());var h=g[0],i=g.length;if(c=c||{},c.propertyPath=f,c.propertyValue=b,c.propertyPathArray=g,1===i)return this.set(h,b,c);for(var j={},k=j,l=h,m=1;m0)},getSelector:function(a,b){var c;if(a===this.el)return"string"==typeof b&&(c="> "+b),c;if(a){var d=V(a).index()+1;c=a.tagName+":nth-child("+d+")",b&&(c+=" > "+b),c=this.getSelector(a.parentNode,c)}return c},getLinkEnd:function(a,b,c,d,e){var f=this.model,h=f.id,i=this.findAttribute("port",a),j=a.getAttribute("joint-selector"),k={id:h};null!=j&&(k.magnet=j),null!=i?(k.port=i,f.hasPort(i)||j||(k.selector=this.getSelector(a))):null==j&&this.el!==a&&(k.selector=this.getSelector(a));var l=this.paper,m=l.options.connectionStrategy;if("function"==typeof m){var n=m.call(l,k,this,a,new g.Point(b,c),d,e);n&&(k=n)}return k},getMagnetFromLinkEnd:function(a){var b,c=this.el,d=a.port,e=a.magnet;return null!=d&&this.model.hasPort(d)?b=this.findPortNode(d,e)||c:(e||(e=a.selector),e||null==d||(e='[port="'+d+'"]'),b=this.findBySelector(e,c,this.selectors)[0]),b},findAttribute:function(a,b){if(!b)return null;var c=b.getAttribute(a);if(null===c){if(b===this.el)return null;for(var d=b.parentNode;d&&d!==this.el&&1===d.nodeType&&(c=d.getAttribute(a),null===c);)d=d.parentNode}return c},getAttributeDefinition:function(a){return this.model.constructor.getAttributeDefinition(a)},setNodeAttributes:function(a,b){joint.util.isEmpty(b)||(a instanceof SVGElement?V(a).attr(b):$(a).attr(b))},processNodeAttributes:function(a,b){var c,d,e,f,g,h,i,j,k,l=[];for(c in b)b.hasOwnProperty(c)&&(d=b[c],e=this.getAttributeDefinition(c),!e||joint.util.isFunction(e.qualify)&&!e.qualify.call(this,d,a,b)?(h||(h={}),h[joint.util.toKebabCase(c)]=d):(joint.util.isString(e.set)&&(h||(h={}),h[e.set]=d),null!==d&&l.push(c,e)));for(f=0,g=l.length;f0&&x.height>0){var y=V.transformRect(a.getBBox(),p).scale(1/r,1/s);for(e in m)f=m[e],h=this.getAttributeDefinition(e),t=h.offset.call(this,f,y,a,i),t&&(q.offset(g.Point(t).scale(r,s)),w||(w=!0))}}(void 0!==o||v||w)&&(q.round(1),p.e=q.x,p.f=q.y,a.setAttribute("transform",V.matrixToTransformString(p)))},getNodeScale:function(a,b){var c,d;if(b&&b.contains(a)){var e=b.scale();c=1/e.sx,d=1/e.sy}else c=1,d=1;return{sx:c,sy:d}},findNodesAttributes:function(a,b,c,d){var e={};for(var f in a)if(a.hasOwnProperty(f))for(var g=c[f]=this.findBySelector(f,b,d),h=0,i=g.length;h-1?l.splice(t,0,d):l.push(d)}else this.setNodeAttributes(e,i.normal);for(var u=0,v=l.length;u0){this.startBatch("fit-embeds",a),a.deep&&joint.util.invoke(b,"fitEmbeds",a);var c=this.graph.getCellsBBox(b),d=joint.util.normalizeSides(a.padding);c.moveAndExpand({x:-d.left,y:-d.top,width:d.right+d.left,height:d.bottom+d.top}),this.set({position:{x:c.x,y:c.y},size:{width:c.width,height:c.height}},a),this.stopBatch("fit-embeds")}return this},rotate:function(a,b,c,d){if(c){var e=this.getBBox().center(),f=this.get("size"),g=this.get("position");e.rotate(c,this.get("angle")-a);var h=e.x-f.width/2-g.x,i=e.y-f.height/2-g.y;this.startBatch("rotate",{angle:a,absolute:b,origin:c}),this.position(g.x+h,g.y+i,d),this.rotate(a,b,null,d),this.stopBatch("rotate")}else this.set("angle",b?a:(this.get("angle")+a)%360,d);return this},angle:function(){return g.normalizeAngle(this.get("angle")||0)},getBBox:function(a){if(a=a||{},a.deep&&this.graph){var b=this.getEmbeddedCells({deep:!0,breadthFirst:!0});return b.push(this),this.graph.getCellsBBox(b)}var c=this.get("position"),d=this.get("size");return new g.Rect(c.x,c.y,d.width,d.height)}}),joint.dia.ElementView=joint.dia.CellView.extend({_removePorts:function(){},_renderPorts:function(){},className:function(){var a=joint.dia.CellView.prototype.className.apply(this).split(" ");return a.push("element"),a.join(" ")},metrics:null,initialize:function(){joint.dia.CellView.prototype.initialize.apply(this,arguments);var a=this.model;this.listenTo(a,"change:position",this.translate),this.listenTo(a,"change:size",this.resize),this.listenTo(a,"change:angle",this.rotate),this.listenTo(a,"change:markup",this.render),this._initializePorts(),this.metrics={}},_initializePorts:function(){},update:function(a,b){this.metrics={},this._removePorts();var c=this.model,d=c.attr();this.updateDOMSubtreeAttributes(this.el,d,{rootBBox:new g.Rect(c.size()),selectors:this.selectors,scalableNode:this.scalableNode,rotatableNode:this.rotatableNode,roAttributes:b===d?null:b}),this._renderPorts()},rotatableSelector:"rotatable",scalableSelector:"scalable",scalableNode:null,rotatableNode:null,renderMarkup:function(){var a=this.model,b=a.get("markup")||a.markup;if(!b)throw new Error("dia.ElementView: markup required");if(Array.isArray(b))return this.renderJSONMarkup(b);if("string"==typeof b)return this.renderStringMarkup(b);throw new Error("dia.ElementView: invalid markup")},renderJSONMarkup:function(a){var b=joint.util.parseDOMJSON(a),c=this.selectors=b.selectors,d=this.selector;if(c[d])throw new Error("dia.ElementView: ambiguous root selector.");c[d]=this.el,this.rotatableNode=V(c[this.rotatableSelector])||null,this.scalableNode=V(c[this.scalableSelector])||null,this.vel.append(b.fragment)},renderStringMarkup:function(a){var b=this.vel;b.append(V(a)),this.rotatableNode=b.findOne(".rotatable"),this.scalableNode=b.findOne(".scalable");var c=this.selectors={};c[this.selector]=this.el},render:function(){return this.vel.empty(),this.renderMarkup(),this.scalableNode&&this.update(),this.resize(),this.rotatableNode?(this.rotate(),this.translate(),this):(this.updateTransformation(),this)},resize:function(){return this.scalableNode?this.sgResize.apply(this,arguments):(this.model.attributes.angle&&this.rotate(),void this.update())},translate:function(){return this.rotatableNode?this.rgTranslate():void this.updateTransformation()},rotate:function(){return this.rotatableNode?this.rgRotate():void this.updateTransformation()},updateTransformation:function(){var a=this.getTranslateString(),b=this.getRotateString();b&&(a+=" "+b),this.vel.attr("transform",a)},getTranslateString:function(){var a=this.model.attributes.position;return"translate("+a.x+","+a.y+")"},getRotateString:function(){var a=this.model.attributes,b=a.angle;if(!b)return null;var c=a.size;return"rotate("+b+","+c.width/2+","+c.height/2+")"},getBBox:function(a){var b;if(a&&a.useModelGeometry){var c=this.model;b=c.getBBox().bbox(c.angle())}else b=this.getNodeBBox(this.el);return this.paper.localToPaperRect(b)},nodeCache:function(a){var b=V.ensureId(a),c=this.metrics[b];return c||(c=this.metrics[b]={}),c},getNodeData:function(a){var b=this.nodeCache(a);return b.data||(b.data={}),b.data},getNodeBBox:function(a){var b=this.getNodeBoundingRect(a),c=this.getNodeMatrix(a),d=this.getRootTranslateMatrix(),e=this.getRootRotateMatrix();return V.transformRect(b,d.multiply(e).multiply(c))},getNodeBoundingRect:function(a){var b=this.nodeCache(a);return void 0===b.boundingRect&&(b.boundingRect=V(a).getBBox()),new g.Rect(b.boundingRect)},getNodeUnrotatedBBox:function(a){var b=this.getNodeBoundingRect(a),c=this.getNodeMatrix(a),d=this.getRootTranslateMatrix();return V.transformRect(b,d.multiply(c))},getNodeShape:function(a){var b=this.nodeCache(a);return void 0===b.geometryShape&&(b.geometryShape=V(a).toGeometryShape()),b.geometryShape.clone()},getNodeMatrix:function(a){var b=this.nodeCache(a);if(void 0===b.magnetMatrix){var c=this.rotatableNode||this.el;b.magnetMatrix=V(a).getTransformToElement(c)}return V.createSVGMatrix(b.magnetMatrix)},getRootTranslateMatrix:function(){var a=this.model,b=a.position(),c=V.createSVGMatrix().translate(b.x,b.y);return c},getRootRotateMatrix:function(){var a=V.createSVGMatrix(),b=this.model,c=b.angle();if(c){var d=b.getBBox(),e=d.width/2,f=d.height/2;a=a.translate(e,f).rotate(c).translate(-e,-f)}return a},rgRotate:function(){this.rotatableNode.attr("transform",this.getRotateString())},rgTranslate:function(){this.vel.attr("transform",this.getTranslateString())},sgResize:function(a,b,c){var d=this.model,e=d.get("angle")||0,f=d.get("size")||{width:1,height:1},g=this.scalableNode,h=!1;g.node.getElementsByTagName("path").length>0&&(h=!0);var i=g.getBBox({recursive:h}),j=f.width/(i.width||1),k=f.height/(i.height||1);g.attr("transform","scale("+j+","+k+")");var l=this.rotatableNode,m=l&&l.attr("transform");if(m&&null!==m){l.attr("transform",m+" rotate("+-e+","+f.width/2+","+f.height/2+")");var n=g.getBBox({target:this.paper.viewport});d.set("position",{x:n.x,y:n.y},c),this.rotate()}this.update()},prepareEmbedding:function(a){a||(a={});var b=a.model||this.model,c=a.paper||this.paper,d=c.model;b.startBatch("to-front"),b.toFront({deep:!0,ui:!0});var e=d.get("cells").max("z").get("z"),f=d.getConnectedLinks(b,{deep:!0,includeEnclosed:!0});joint.util.invoke(f,"set","z",e+1,{ui:!0}),b.stopBatch("to-front");var g=b.parent();g&&d.getCell(g).unembed(b,{ui:!0})},processEmbedding:function(a){a||(a={});var b=a.model||this.model,c=a.paper||this.paper,d=c.options,e=[];if(joint.util.isFunction(d.findParentBy)){var f=joint.util.toArray(d.findParentBy.call(c.model,this));e=f.filter(function(a){return a instanceof joint.dia.Cell&&this.model.id!==a.id&&!a.isEmbeddedIn(this.model)}.bind(this))}else e=c.model.findModelsUnderElement(b,{searchBy:d.findParentBy});d.frontParentOnly&&(e=e.slice(-1));for(var g=null,h=a.candidateEmbedView,i=e.length-1;i>=0;i--){var j=e[i];if(h&&h.model.id==j.id){g=h;break}var k=j.findView(c);if(d.validateEmbedding.call(c,this,k)){g=k;break}}g&&g!=h&&(this.clearEmbedding(a),a.candidateEmbedView=g.highlight(null,{embedding:!0})),!g&&h&&this.clearEmbedding(a)},clearEmbedding:function(a){a||(a={});var b=a.candidateEmbedView;b&&(b.unhighlight(null,{embedding:!0}),a.candidateEmbedView=null)},finalizeEmbedding:function(a){a||(a={});var b=a.candidateEmbedView,c=a.model||this.model,d=a.paper||this.paper;b&&(b.model.embed(c,{ui:!0}),b.unhighlight(null,{embedding:!0}),a.candidateEmbedView=null),joint.util.invoke(d.model.getConnectedLinks(c,{deep:!0}),"reparent",{ui:!0})},pointerdblclick:function(a,b,c){joint.dia.CellView.prototype.pointerdblclick.apply(this,arguments),this.notify("element:pointerdblclick",a,b,c)},pointerclick:function(a,b,c){joint.dia.CellView.prototype.pointerclick.apply(this,arguments),this.notify("element:pointerclick",a,b,c)},contextmenu:function(a,b,c){joint.dia.CellView.prototype.contextmenu.apply(this,arguments),this.notify("element:contextmenu",a,b,c)},pointerdown:function(a,b,c){joint.dia.CellView.prototype.pointerdown.apply(this,arguments),this.notify("element:pointerdown",a,b,c),this.dragStart(a,b,c)},pointermove:function(a,b,c){var d=this.eventData(a);switch(d.action){case"move":this.drag(a,b,c);break;case"magnet":this.dragMagnet(a,b,c)}d.stopPropagation||(joint.dia.CellView.prototype.pointermove.apply(this,arguments),this.notify("element:pointermove",a,b,c)),this.eventData(a,d)},pointerup:function(a,b,c){var d=this.eventData(a);switch(d.action){case"move":this.dragEnd(a,b,c);break;case"magnet":return void this.dragMagnetEnd(a,b,c)}d.stopPropagation||(this.notify("element:pointerup",a,b,c),joint.dia.CellView.prototype.pointerup.apply(this,arguments))},mouseover:function(a){joint.dia.CellView.prototype.mouseover.apply(this,arguments),this.notify("element:mouseover",a)},mouseout:function(a){joint.dia.CellView.prototype.mouseout.apply(this,arguments),this.notify("element:mouseout",a)},mouseenter:function(a){joint.dia.CellView.prototype.mouseenter.apply(this,arguments),this.notify("element:mouseenter",a)},mouseleave:function(a){joint.dia.CellView.prototype.mouseleave.apply(this,arguments),this.notify("element:mouseleave",a)},mousewheel:function(a,b,c,d){joint.dia.CellView.prototype.mousewheel.apply(this,arguments),this.notify("element:mousewheel",a,b,c,d)},onmagnet:function(a,b,c){this.dragMagnetStart(a,b,c);var d=this.eventData(a).stopPropagation;d&&a.stopPropagation()},dragStart:function(a,b,c){this.can("elementMove")&&this.eventData(a,{action:"move",x:b,y:c,restrictedArea:this.paper.getRestrictedArea(this)})},dragMagnetStart:function(a,b,c){if(this.can("addLinkFromMagnet")){this.model.startBatch("add-link");var d=this.paper,e=d.model,f=a.target,g=d.getDefaultLink(this,f),h=this.getLinkEnd(f,b,c,g,"source"),i={x:b,y:c};g.set({source:h,target:i}),g.addTo(e,{async:!1,ui:!0});var j=g.findView(d);joint.dia.CellView.prototype.pointerdown.apply(j,arguments),j.notify("link:pointerdown",a,b,c);var k=j.startArrowheadMove("target",{whenNotAllowed:"remove"});j.eventData(a,k),this.eventData(a,{action:"magnet",linkView:j,stopPropagation:!0}),this.paper.delegateDragEvents(this,a.data)}},drag:function(a,b,c){var d=this.paper,e=d.options.gridSize,f=this.model,h=f.position(),i=this.eventData(a),j=g.snapToGrid(h.x,e)-h.x+g.snapToGrid(b-i.x,e),k=g.snapToGrid(h.y,e)-h.y+g.snapToGrid(c-i.y,e);f.translate(j,k,{restrictedArea:i.restrictedArea,ui:!0});var l=!!i.embedding;d.options.embeddingMode&&(l||(this.prepareEmbedding(i),l=!0),this.processEmbedding(i)),this.eventData(a,{x:g.snapToGrid(b,e),y:g.snapToGrid(c,e),embedding:l})},dragMagnet:function(a,b,c){var d=this.eventData(a),e=d.linkView;e&&e.pointermove(a,b,c)},dragEnd:function(a,b,c){var d=this.eventData(a);d.embedding&&this.finalizeEmbedding(d)},dragMagnetEnd:function(a,b,c){var d=this.eventData(a),e=d.linkView;e&&e.pointerup(a,b,c),this.model.stopBatch("add-link")}}),joint.dia.Link=joint.dia.Cell.extend({markup:['','','','','','','',''].join(""),toolMarkup:['','','','',"Remove link.","",'','','',"Link options.","",""].join(""),doubleToolMarkup:void 0,vertexMarkup:['','','','',"Remove vertex.","",""].join(""),arrowheadMarkup:['','',""].join(""),defaultLabel:void 0,labelMarkup:void 0,_builtins:{defaultLabel:{markup:[{tagName:"rect",selector:"rect"},{tagName:"text",selector:"text"}],attrs:{text:{fill:"#000000",fontSize:14,textAnchor:"middle",yAlignment:"middle",pointerEvents:"none"},rect:{ref:"text",fill:"#ffffff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}}},defaults:{type:"link",source:{},target:{}},isLink:function(){return!0},disconnect:function(a){return this.set({source:{x:0,y:0},target:{x:0,y:0}},a)},source:function(a,b,c){if(void 0===a)return joint.util.clone(this.get("source"));var d,e,f=a instanceof joint.dia.Cell;if(f)return d=joint.util.clone(b)||{},d.id=a.id,e=c,this.set("source",d,e);var h=a instanceof g.Point;return h?(d=joint.util.clone(b)||{},d.x=a.x,d.y=a.y,e=c,this.set("source",d,e)):(d=a,e=b,this.set("source",d,e))},target:function(a,b,c){if(void 0===a)return joint.util.clone(this.get("target"));var d,e,f=a instanceof joint.dia.Cell;if(f)return d=joint.util.clone(b)||{},d.id=a.id,e=c,this.set("target",d,e);var h=a instanceof g.Point;return h?(d=joint.util.clone(b)||{},d.x=a.x,d.y=a.y,e=c,this.set("target",d,e)):(d=a,e=b,this.set("target",d,e))},router:function(a,b,c){if(void 0===a){var d=this.get("router");return d?"object"==typeof d?joint.util.clone(d):d:this.get("manhattan")?{name:"orthogonal"}:null}var e="object"==typeof a||"function"==typeof a,f=e?a:{name:a,args:b},g=e?b:c;return this.set("router",f,g)},connector:function(a,b,c){if(void 0===a){var d=this.get("connector");return d?"object"==typeof d?joint.util.clone(d):d:this.get("smooth")?{name:"smooth"}:null}var e="object"==typeof a||"function"==typeof a,f=e?a:{name:a,args:b},g=e?b:c;return this.set("connector",f,g)},label:function(a,b,c){var d=this.labels();return a=isFinite(a)&&null!==a?0|a:0,a<0&&(a=d.length+a),arguments.length<=1?this.prop(["labels",a]):this.prop(["labels",a],b,c)},labels:function(a,b){return 0===arguments.length?(a=this.get("labels"),Array.isArray(a)?a.slice():[]):(Array.isArray(a)||(a=[]),this.set("labels",a,b))},insertLabel:function(a,b,c){if(!b)throw new Error("dia.Link: no label provided");var d=this.labels(),e=d.length;return a=isFinite(a)&&null!==a?0|a:e,a<0&&(a=e+a+1),d.splice(a,0,b),this.labels(d,c)},appendLabel:function(a,b){return this.insertLabel(-1,a,b)},removeLabel:function(a,b){var c=this.labels();return a=isFinite(a)&&null!==a?0|a:-1,c.splice(a,1),this.labels(c,b)},vertex:function(a,b,c){var d=this.vertices();return a=isFinite(a)&&null!==a?0|a:0,a<0&&(a=d.length+a),arguments.length<=1?this.prop(["vertices",a]):this.prop(["vertices",a],b,c)},vertices:function(a,b){return 0===arguments.length?(a=this.get("vertices"),Array.isArray(a)?a.slice():[]):(Array.isArray(a)||(a=[]),this.set("vertices",a,b))},insertVertex:function(a,b,c){if(!b)throw new Error("dia.Link: no vertex provided");var d=this.vertices(),e=d.length;return a=isFinite(a)&&null!==a?0|a:e,a<0&&(a=e+a+1),d.splice(a,0,b),this.vertices(d,c)},removeVertex:function(a,b){var c=this.vertices();return a=isFinite(a)&&null!==a?0|a:-1,c.splice(a,1),this.vertices(c,b)},translate:function(a,b,c){return c=c||{},c.translateBy=c.translateBy||this.id,c.tx=a,c.ty=b,this.applyToPoints(function(c){return{x:(c.x||0)+a,y:(c.y||0)+b}},c)},scale:function(a,b,c,d){return this.applyToPoints(function(d){return g.point(d).scale(a,b,c).toJSON()},d)},applyToPoints:function(a,b){if(!joint.util.isFunction(a))throw new TypeError("dia.Link: applyToPoints expects its first parameter to be a function.");var c={},d=this.source();d.id||(c.source=a(d));var e=this.target();e.id||(c.target=a(e));var f=this.vertices();return f.length>0&&(c.vertices=f.map(a)),this.set(c,b)},reparent:function(a){var b;if(this.graph){var c=this.getSourceElement(),d=this.getTargetElement(),e=this.getParentCell();c&&d&&(b=c===d||c.isEmbeddedIn(d)?d:d.isEmbeddedIn(c)?c:this.graph.getCommonAncestor(c,d)),!e||b&&b.id===e.id||e.unembed(this,a),b&&b.embed(this,a)}return b},hasLoop:function(a){a=a||{};var b=this.source().id,c=this.target().id;if(!b||!c)return!1;var d=b===c;if(!d&&a.deep&&this.graph){var e=this.getSourceElement(),f=this.getTargetElement();d=e.isEmbeddedIn(f)||f.isEmbeddedIn(e)}return d},getSourceElement:function(){var a=this.source(),b=this.graph;return a&&a.id&&b&&b.getCell(a.id)||null},getTargetElement:function(){var a=this.target(),b=this.graph;return a&&a.id&&b&&b.getCell(a.id)||null},getRelationshipAncestor:function(){var a;if(this.graph){var b=[this,this.getSourceElement(),this.getTargetElement()].filter(function(a){return!!a});a=this.graph.getCommonAncestor.apply(this.graph,b)}return a||null},isRelationshipEmbeddedIn:function(a){var b=joint.util.isString(a)||joint.util.isNumber(a)?a:a.id,c=this.getRelationshipAncestor();return!!c&&(c.id===b||c.isEmbeddedIn(b))},_getDefaultLabel:function(){var a=this.get("defaultLabel")||this.defaultLabel||{},b={};return b.markup=a.markup||this.get("labelMarkup")||this.labelMarkup,b.position=a.position,b.attrs=a.attrs,b.size=a.size,b}},{endsEqual:function(a,b){var c=a.port===b.port||!a.port&&!b.port;return a.id===b.id&&c}}),joint.dia.LinkView=joint.dia.CellView.extend({className:function(){var a=joint.dia.CellView.prototype.className.apply(this).split(" ");return a.push("link"),a.join(" ")},options:{shortLinkLength:105,doubleLinkTools:!1,longLinkLength:155,linkToolsOffset:40,doubleLinkToolsOffset:65,sampleInterval:50},_labelCache:null,_labelSelectors:null,_markerCache:null,_V:null,_dragData:null,metrics:null,decimalsRounding:2,initialize:function(a){joint.dia.CellView.prototype.initialize.apply(this,arguments),"function"!=typeof this.constructor.prototype.watchSource&&(this.constructor.prototype.watchSource=this.createWatcher("source"),this.constructor.prototype.watchTarget=this.createWatcher("target")),this._labelCache={},this._labelSelectors={},this._markerCache={},this._V={},this.metrics={},this.startListening()},startListening:function(){var a=this.model;this.listenTo(a,"change:markup",this.render),this.listenTo(a,"change:smooth change:manhattan change:router change:connector",this.update),this.listenTo(a,"change:toolMarkup",this.onToolsChange),this.listenTo(a,"change:labels change:labelMarkup",this.onLabelsChange),this.listenTo(a,"change:vertices change:vertexMarkup",this.onVerticesChange),this.listenTo(a,"change:source",this.onSourceChange),this.listenTo(a,"change:target",this.onTargetChange)},onSourceChange:function(a,b,c){this.watchSource(a,b);var d=this.model;c.translateBy&&d.get("target").id&&b.id||this.update(d,null,c)},onTargetChange:function(a,b,c){this.watchTarget(a,b);var d=this.model;(!c.translateBy||d.get("source").id&&!b.id&&joint.util.isEmpty(d.get("vertices")))&&this.update(d,null,c)},onVerticesChange:function(a,b,c){this.renderVertexMarkers(),c.translateBy&&c.translateBy!==this.model.id&&!this.model.hasLoop()||this.update(a,null,c)},onToolsChange:function(){this.renderTools().updateToolsPosition()},onLabelsChange:function(a,b,c){var d=!0,e=this.model.previous("labels");if(e&&"propertyPathArray"in c&&"propertyValue"in c){var f=c.propertyPathArray||[],g=f.length;if(g>1){var h=!!e[f[1]];h&&(2===g?d="markup"in Object(c.propertyValue):"markup"!==f[2]&&(d=!1))}}d?this.renderLabels():this.updateLabels(),this.updateLabelPositions()},render:function(){this.vel.empty(),this._V={},this.renderMarkup(),this.renderLabels();var a=this.model;return this.watchSource(a,a.source()).watchTarget(a,a.target()).update(),this},renderMarkup:function(){var a=this.model,b=a.get("markup")||a.markup;if(!b)throw new Error("dia.LinkView: markup required");if(Array.isArray(b))return this.renderJSONMarkup(b);if("string"==typeof b)return this.renderStringMarkup(b);throw new Error("dia.LinkView: invalid markup")},renderJSONMarkup:function(a){var b=joint.util.parseDOMJSON(a),c=this.selectors=b.selectors,d=this.selector;if(c[d])throw new Error("dia.LinkView: ambiguous root selector.");c[d]=this.el,this.vel.append(b.fragment)},renderStringMarkup:function(a){var b=V(a);Array.isArray(b)||(b=[b]);for(var c=this._V,d=0,e=b.length;d1||"G"!==d[0].nodeName.toUpperCase()?(c=V("g"),c.append(b),c.addClass("label")):(c=V(d[0]),c.addClass("label")),{node:c.node,selectors:a.selectors}}},renderLabels:function(){var a=this._V,b=a.labels,c=this._labelCache={},d=this._labelSelectors={};b&&b.empty();var e=this.model,f=e.get("labels")||[],g=f.length;if(0===g)return this;b||(b=a.labels=V("g").addClass("labels").appendTo(this.el));for(var h=0;h=this.options.longLinkLength){var e=this.options.doubleLinkToolsOffset||b;d=this.getPointAtLength(c-e),this._tool2Cache.attr("transform","translate("+d.x+", "+d.y+") "+a),this._tool2Cache.attr("visibility","visible")}else this.options.doubleLinkTools&&this._tool2Cache.attr("visibility","hidden")}return this},updateArrowheadMarkers:function(){if(!this._V.markerArrowheads)return this;if("none"===$.css(this._V.markerArrowheads.node,"display"))return this;var a=this.getConnectionLength()0&&b<=1,d=0,e={x:0,y:0};if(a.offset){var f=a.offset;"number"==typeof f&&(d=f),f.x&&(e.x=f.x),f.y&&(e.y=f.y)}var g,h=0!==e.x||0!==e.y||0===d,i=this.path,j={segmentSubdivisions:this.getConnectionSubdivisions()},k=c?b*this.getConnectionLength():b;if(h)g=i.pointAtLength(k,j),g.offset(e);else{var l=i.tangentAtLength(k,j);l?(l.rotate(l.start,-90),l.setLength(d),g=l.end):g=i.start}return g},getVertexIndex:function(a,b){for(var c=this.model,d=c.vertices(),e=this.getClosestPointLength(new g.Point(a,b)),f=0,h=d.length;f0){for(var j=0,k=i.length;j").addClass(joint.util.addClassNamePrefix("paper-background")),this.options.background&&this.drawBackground(this.options.background),this.$grid=$("
").addClass(joint.util.addClassNamePrefix("paper-grid")),this.options.drawGrid&&this.drawGrid(),this.$el.append(this.$background,this.$grid,this.svg),this},update:function(){return this.options.drawGrid&&this.drawGrid(),this._background&&this.updateBackgroundImage(this._background),this},_viewportMatrix:null,_viewportTransformString:null,matrix:function(a){var b=this.viewport;if(void 0===a){var c=b.getAttribute("transform");return(this._viewportTransformString||null)===c?a=this._viewportMatrix:(a=b.getCTM(),this._viewportMatrix=a,this._viewportTransformString=c),V.createSVGMatrix(a)}return a=V.createSVGMatrix(a),ctmString=V.matrixToTransformString(a),b.setAttribute("transform",ctmString),this.tools.setAttribute("transform",ctmString),this._viewportMatrix=a,this._viewportTransformString=b.getAttribute("transform"),this},clientMatrix:function(){return V.createSVGMatrix(this.viewport.getScreenCTM())},_sortDelayingBatches:["add","to-front","to-back"],_onSort:function(){this.model.hasActiveBatch(this._sortDelayingBatches)||this.sortViews()},_onBatchStop:function(a){var b=a&&a.batchName;this._sortDelayingBatches.includes(b)&&!this.model.hasActiveBatch(this._sortDelayingBatches)&&this.sortViews()},onRemove:function(){this.removeViews()},setDimensions:function(a,b){a=this.options.width=a||this.options.width,b=this.options.height=b||this.options.height,this.$el.css({width:Math.round(a),height:Math.round(b)}),this.trigger("resize",a,b)},setOrigin:function(a,b){return this.translate(a||0,b||0,{absolute:!0})},fitToContent:function(a,b,c,d){joint.util.isObject(a)?(d=a,a=d.gridWidth||1,b=d.gridHeight||1,c=d.padding||0):(d=d||{},a=a||1,b=b||1,c=c||0),c=joint.util.normalizeSides(c);var e=V(this.viewport).getBBox(),f=this.scale(),g=this.translate();e.x*=f.sx,e.y*=f.sy,e.width*=f.sx,e.height*=f.sy;var h=Math.max(Math.ceil((e.width+e.x)/a),1)*a,i=Math.max(Math.ceil((e.height+e.y)/b),1)*b,j=0,k=0;("negative"==d.allowNewOrigin&&e.x<0||"positive"==d.allowNewOrigin&&e.x>=0||"any"==d.allowNewOrigin)&&(j=Math.ceil(-e.x/a)*a,j+=c.left,h+=j),("negative"==d.allowNewOrigin&&e.y<0||"positive"==d.allowNewOrigin&&e.y>=0||"any"==d.allowNewOrigin)&&(k=Math.ceil(-e.y/b)*b,k+=c.top,i+=k),h+=c.right,i+=c.bottom,h=Math.max(h,d.minWidth||0),i=Math.max(i,d.minHeight||0),h=Math.min(h,d.maxWidth||Number.MAX_VALUE),i=Math.min(i,d.maxHeight||Number.MAX_VALUE);var l=h!=this.options.width||i!=this.options.height,m=j!=g.tx||k!=g.ty;m&&this.translate(j,k),l&&this.setDimensions(h,i)},scaleContentToFit:function(a){var b=this.getContentBBox();if(b.width&&b.height){a=a||{},joint.util.defaults(a,{padding:0,preserveAspectRatio:!0,scaleGrid:null,minScale:0,maxScale:Number.MAX_VALUE});var c,d=a.padding,e=a.minScaleX||a.minScale,f=a.maxScaleX||a.maxScale,h=a.minScaleY||a.minScale,i=a.maxScaleY||a.maxScale;if(a.fittingBBox)c=a.fittingBBox;else{var j=this.translate();c={x:j.tx,y:j.ty,width:this.options.width,height:this.options.height}}c=g.rect(c).moveAndExpand({x:d,y:d,width:-2*d,height:-2*d});var k=this.scale(),l=c.width/b.width*k.sx,m=c.height/b.height*k.sy;if(a.preserveAspectRatio&&(l=m=Math.min(l,m)),a.scaleGrid){var n=a.scaleGrid;l=n*Math.floor(l/n),m=n*Math.floor(m/n)}l=Math.min(f,Math.max(e,l)),m=Math.min(i,Math.max(h,m)),this.scale(l,m);var o=this.getContentBBox(),p=c.x-o.x,q=c.y-o.y;this.translate(p,q)}},getContentArea:function(){return V(this.viewport).getBBox()},getContentBBox:function(){var a=this.viewport.getBoundingClientRect(),b=this.clientMatrix(),c=this.translate();return g.rect({x:a.left-b.e+c.tx,y:a.top-b.f+c.ty,width:a.width,height:a.height})},getArea:function(){return this.paperToLocalRect({x:0,y:0,width:this.options.width,height:this.options.height})},getRestrictedArea:function(){var a;return a=joint.util.isFunction(this.options.restrictTranslate)?this.options.restrictTranslate.apply(this,arguments):this.options.restrictTranslate===!0?this.getArea():this.options.restrictTranslate||null},createViewForModel:function(a){var b,c,d=this.options.cellViewNamespace,e=a.get("type")+"View",f=joint.util.getByPath(d,e,".");a.isLink()?(b=this.options.linkView,c=joint.dia.LinkView):(b=this.options.elementView,c=joint.dia.ElementView);var g=b.prototype instanceof Backbone.View?f||b:b.call(this,a)||f||c;return new g({model:a,interactive:this.options.interactive})},onCellAdded:function(a,b,c){if(this.options.async&&c.async!==!1&&joint.util.isNumber(c.position)){if(this._asyncCells=this._asyncCells||[],this._asyncCells.push(a),0==c.position){if(this._frameId)throw new Error("another asynchronous rendering in progress");this.asyncRenderViews(this._asyncCells,c),delete this._asyncCells}}else this.renderView(a)},removeView:function(a){var b=this._views[a.id];return b&&(b.remove(),delete this._views[a.id]),b},renderView:function(a){var b=this._views[a.id]=this.createViewForModel(a);return V(this.viewport).append(b.el),b.paper=this,b.render(),b},onImageDragStart:function(){return!1},beforeRenderViews:function(a){return a.sort(function(a){return a.isLink()?1:-1}),a},afterRenderViews:function(){this.sortViews()},resetViews:function(a,b){this.removeViews();var c=a.models.slice();if(c=this.beforeRenderViews(c,b)||c,this.cancelRenderViews(),this.options.async)this.asyncRenderViews(c,b);else{for(var d=0,e=c.length;d(e.get("z")||0)?1:-1})},scale:function(a,b,c,d){if(void 0===a)return V.matrixToScale(this.matrix());void 0===b&&(b=a),void 0===c&&(c=0,d=0);var e=this.translate();if(c||d||e.tx||e.ty){var f=e.tx-c*(a-1),g=e.ty-d*(b-1);this.translate(f,g)}var h=this.matrix();return h.a=a||0,h.d=b||0,this.matrix(h),this.trigger("scale",a,b,c,d),this},rotate:function(a,b,c){if(void 0===a)return V.matrixToRotate(this.matrix());if(void 0===b){var d=this.viewport.getBBox();b=d.width/2,c=d.height/2}var e=this.matrix().translate(b,c).rotate(a).translate(-b,-c);return this.matrix(e),this},translate:function(a,b){if(void 0===a)return V.matrixToTranslate(this.matrix());var c=this.matrix();c.e=a||0,c.f=b||0,this.matrix(c);var d=this.translate(),e=this.options.origin;return e.x=d.tx,e.y=d.ty,this.trigger("translate",d.tx,d.ty),this.options.drawGrid&&this.drawGrid(),this},findView:function(a){for(var b=joint.util.isString(a)?this.viewport.querySelector(a):a instanceof $?a[0]:a;b&&b!==this.el&&b!==document;){var c=b.getAttribute("model-id");if(c)return this._views[c];b=b.parentNode}},findViewByModel:function(a){var b=joint.util.isString(a)||joint.util.isNumber(a)?a:a&&a.id;return this._views[b]},findViewsFromPoint:function(a){a=g.point(a);var b=this.model.getElements().map(this.findViewByModel,this);return b.filter(function(b){return b&&b.vel.getBBox({target:this.viewport}).containsPoint(a)},this)},findViewsInArea:function(a,b){b=joint.util.defaults(b||{},{strict:!1}),a=g.rect(a);var c=this.model.getElements().map(this.findViewByModel,this),d=b.strict?"containsRect":"intersect";return c.filter(function(b){return b&&a[d](b.vel.getBBox({target:this.viewport}))},this)},removeTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"remove"),this},hideTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"hide"),this},showTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"show"),this},getModelById:function(a){return this.model.getCell(a)},snapToGrid:function(a,b){return this.clientToLocalPoint(a,b).snapToGrid(this.options.gridSize)},localToPaperPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.matrix());return g.Point(d)},localToPaperRect:function(a,b,c,d){var e=g.Rect(a,b),f=V.transformRect(e,this.matrix());return g.Rect(f)},paperToLocalPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.matrix().inverse());return g.Point(d)},paperToLocalRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.matrix().inverse());return g.Rect(f)},localToClientPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.clientMatrix());return g.Point(d)},localToClientRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.clientMatrix());return g.Rect(f)},clientToLocalPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.clientMatrix().inverse());return g.Point(d)},clientToLocalRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.clientMatrix().inverse());return g.Rect(f)},localToPagePoint:function(a,b){return this.localToPaperPoint(a,b).offset(this.pageOffset())},localToPageRect:function(a,b,c,d){return this.localToPaperRect(a,b,c,d).moveAndExpand(this.pageOffset())},pageToLocalPoint:function(a,b){var c=g.Point(a,b),d=c.difference(this.pageOffset());return this.paperToLocalPoint(d)},pageToLocalRect:function(a,b,c,d){var e=this.pageOffset(),f=g.Rect(a,b,c,d);return f.x-=e.x,f.y-=e.y,this.paperToLocalRect(f)},clientOffset:function(){var a=this.svg.getBoundingClientRect();return g.Point(a.left,a.top)},pageOffset:function(){return this.clientOffset().offset(window.scrollX,window.scrollY)},linkAllowed:function(a){if(!(a instanceof joint.dia.LinkView))throw new Error("Must provide a linkView.");var b=a.model,c=this.options,d=this.model,e=d.constructor.validations;return!(!c.multiLinks&&!e.multiLinks.call(this,d,b))&&(!(!c.linkPinning&&!e.linkPinning.call(this,d,b))&&!("function"==typeof c.allowLink&&!c.allowLink.call(this,a,this)))},getDefaultLink:function(a,b){return joint.util.isFunction(this.options.defaultLink)?this.options.defaultLink.call(this,a,b):this.options.defaultLink.clone()},resolveHighlighter:function(a){a=a||{};var b=a.highlighter,c=this.options;if(void 0===b){var d=["embedding","connecting","magnetAvailability","elementAvailability"].find(function(b){return!!a[b]});b=d&&c.highlighting[d]||c.highlighting.default}if(!b)return!1;joint.util.isString(b)&&(b={name:b});var e=b.name,f=c.highlighterNamespace[e];if(!f)throw new Error('Unknown highlighter ("'+e+'")');if("function"!=typeof f.highlight)throw new Error('Highlighter ("'+e+'") is missing required highlight() method');if("function"!=typeof f.unhighlight)throw new Error('Highlighter ("'+e+'") is missing required unhighlight() method');return{highlighter:f,options:b.options||{},name:e}},onCellHighlight:function(a,b,c){if(c=this.resolveHighlighter(c)){b.id||(b.id=V.uniqueId());var d=c.name+b.id+JSON.stringify(c.options);if(!this._highlights[d]){var e=c.highlighter;e.highlight(a,b,joint.util.assign({},c.options)),this._highlights[d]={cellView:a,magnetEl:b,opt:c.options,highlighter:e}}}},onCellUnhighlight:function(a,b,c){if(c=this.resolveHighlighter(c)){var d=c.name+b.id+JSON.stringify(c.options),e=this._highlights[d];e&&(e.highlighter.unhighlight(e.cellView,e.magnetEl,e.opt),this._highlights[d]=null)}},pointerdblclick:function(a){a.preventDefault(),a=joint.util.normalizeEvent(a); -var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerdblclick(a,c.x,c.y):this.trigger("blank:pointerdblclick",a,c.x,c.y)}},pointerclick:function(a){if(this._mousemoved<=this.options.clickThreshold){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(this.guard(a,b))return;var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerclick(a,c.x,c.y):this.trigger("blank:pointerclick",a,c.x,c.y)}},contextmenu:function(a){this.options.preventContextMenu&&a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.contextmenu(a,c.x,c.y):this.trigger("blank:contextmenu",a,c.x,c.y)}},pointerdown:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?(a.preventDefault(),b.pointerdown(a,c.x,c.y)):(this.options.preventDefaultBlankAction&&a.preventDefault(),this.trigger("blank:pointerdown",a,c.x,c.y)),this.delegateDragEvents(b,a.data)}},pointermove:function(a){a.preventDefault();var b=this.eventData(a);b.mousemoved||(b.mousemoved=0);var c=++b.mousemoved;if(!(c<=this.options.moveThreshold)){a=joint.util.normalizeEvent(a);var d=this.snapToGrid({x:a.clientX,y:a.clientY}),e=b.sourceView;e?e.pointermove(a,d.x,d.y):this.trigger("blank:pointermove",a,d.x,d.y),this.eventData(a,b)}},pointerup:function(a){this.undelegateDocumentEvents(),a=joint.util.normalizeEvent(a);var b=this.snapToGrid({x:a.clientX,y:a.clientY}),c=this.eventData(a).sourceView;c?c.pointerup(a,b.x,b.y):this.trigger("blank:pointerup",a,b.x,b.y),this.delegateEvents()},mouseover:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b))if(b)b.mouseover(a);else{if(this.el===a.target)return;this.trigger("blank:mouseover",a)}},mouseout:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b))if(b)b.mouseout(a);else{if(this.el===a.target)return;this.trigger("blank:mouseout",a)}},mouseenter:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.findView(a.relatedTarget);if(b){if(c===b)return;b.mouseenter(a)}else{if(c)return;this.trigger("paper:mouseenter",a)}}},mouseleave:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.findView(a.relatedTarget);if(b){if(c===b)return;b.mouseleave(a)}else{if(c)return;this.trigger("paper:mouseleave",a)}}},mousewheel:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=a.originalEvent,d=this.snapToGrid({x:c.clientX,y:c.clientY}),e=Math.max(-1,Math.min(1,c.wheelDelta||-c.detail));b?b.mousewheel(a,d.x,d.y,e):this.trigger("blank:mousewheel",a,d.x,d.y,e)}},onevent:function(a){var b=a.currentTarget,c=b.getAttribute("event");if(c){var d=this.findView(b);if(d){if(a=joint.util.normalizeEvent(a),this.guard(a,d))return;var e=this.snapToGrid({x:a.clientX,y:a.clientY});d.onevent(a,c,e.x,e.y)}}},onmagnet:function(a){var b=a.currentTarget,c=b.getAttribute("magnet");if(c){var d=this.findView(b);if(d){if(a=joint.util.normalizeEvent(a),this.guard(a,d))return;if(!this.options.validateMagnet(d,b))return;var e=this.snapToGrid(a.clientX,a.clientY);d.onmagnet(a,e.x,e.y)}}},onlabel:function(a){var b=a.currentTarget,c=this.findView(b);if(c){if(a=joint.util.normalizeEvent(a),this.guard(a,c))return;var d=this.snapToGrid(a.clientX,a.clientY);c.onlabel(a,d.x,d.y)}},delegateDragEvents:function(a,b){b||(b={}),this.eventData({data:b},{sourceView:a||null,mousemoved:0}),this.delegateDocumentEvents(null,b),this.undelegateEvents()},guard:function(a,b){return"mousedown"===a.type&&2===a.button||(!(!this.options.guard||!this.options.guard(a,b))||(a.data&&void 0!==a.data.guarded?a.data.guarded:!(b&&b.model&&b.model instanceof joint.dia.Cell)&&(this.svg!==a.target&&this.el!==a.target&&!$.contains(this.svg,a.target))))},setGridSize:function(a){return this.options.gridSize=a,this.options.drawGrid&&this.drawGrid(),this},clearGrid:function(){return this.$grid&&this.$grid.css("backgroundImage","none"),this},_getGriRefs:function(){return this._gridCache||(this._gridCache={root:V("svg",{width:"100%",height:"100%"},V("defs")),patterns:{},add:function(a,b){V(this.root.node.childNodes[0]).append(b),this.patterns[a]=b,this.root.append(V("rect",{width:"100%",height:"100%",fill:"url(#"+a+")"}))},get:function(a){return this.patterns[a]},exist:function(a){return void 0!==this.patterns[a]}}),this._gridCache},setGrid:function(a){this.clearGrid(),this._gridCache=null,this._gridSettings=[];var b=Array.isArray(a)?a:[a||{}];return b.forEach(function(a){this._gridSettings.push.apply(this._gridSettings,this._resolveDrawGridOption(a))},this),this},_resolveDrawGridOption:function(a){var b=this.constructor.gridPatterns;if(joint.util.isString(a)&&Array.isArray(b[a]))return b[a].map(function(a){return joint.util.assign({},a)});var c=a||{args:[{}]},d=Array.isArray(c),e=c.name;if(d||e||c.markup||(e="dot"),e&&Array.isArray(b[e])){var f=b[e].map(function(a){return joint.util.assign({},a)}),g=Array.isArray(c.args)?c.args:[c.args||{}];joint.util.defaults(g[0],joint.util.omit(a,"args"));for(var h=0;h'),f=joint.util.toArray(d).map(function(a){return e({offset:a.offset,color:a.color,opacity:Number.isFinite(a.opacity)?a.opacity:1})}),g=["<"+c+">",f.join(""),""].join(""),h=joint.util.assign({id:b},a.attrs);V(g,h).appendTo(this.defs)}return b},defineMarker:function(a){if(!joint.util.isObject(a))throw new TypeError("dia.Paper: defineMarker() requires 1. argument to be an object.");var b=a.id;if(b||(b=this.svg.id+joint.util.hashCode(JSON.stringify(a))),!this.isDefined(b)){var c=joint.util.omit(a,"type","userSpaceOnUse"),d=V("marker",{id:b,orient:"auto",overflow:"visible",markerUnits:a.markerUnits||"userSpaceOnUse"},[V(a.type||"path",c)]);d.appendTo(this.defs)}return b}},{backgroundPatterns:{flipXy:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=2*c,b.height=2*d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.setTransform(-1,0,0,-1,b.width,b.height),e.drawImage(a,0,0,c,d),e.setTransform(-1,0,0,1,b.width,0),e.drawImage(a,0,0,c,d),e.setTransform(1,0,0,-1,0,b.height),e.drawImage(a,0,0,c,d),b},flipX:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=2*c,b.height=d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.translate(2*c,0),e.scale(-1,1),e.drawImage(a,0,0,c,d),b},flipY:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=c,b.height=2*d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.translate(0,2*d),e.scale(1,-1),e.drawImage(a,0,0,c,d),b},watermark:function(a,b){b=b||{};var c=a.width,d=a.height,e=document.createElement("canvas");e.width=3*c,e.height=3*d;for(var f=e.getContext("2d"),h=joint.util.isNumber(b.watermarkAngle)?-b.watermarkAngle:-20,i=g.toRad(h),j=e.width/4,k=e.height/4,l=0;l<4;l++)for(var m=0;m<4;m++)(l+m)%2>0&&(f.setTransform(1,0,0,1,(2*l-1)*j,(2*m-1)*k),f.rotate(i),f.drawImage(a,-c/2,-d/2,c,d));return e}},gridPatterns:{dot:[{color:"#AAAAAA",thickness:1,markup:"rect",update:function(a,b){V(a).attr({width:b.thickness*b.sx,height:b.thickness*b.sy,fill:b.color})}}],fixedDot:[{color:"#AAAAAA",thickness:1,markup:"rect",update:function(a,b){var c=b.sx<=1?b.thickness*b.sx:b.thickness;V(a).attr({width:c,height:c,fill:b.color})}}],mesh:[{color:"#AAAAAA",thickness:1,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}}],doubleMesh:[{color:"#AAAAAA",thickness:1,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}},{color:"#000000",thickness:3,scaleFactor:4,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}}]}}),function(a,b,c){var d=function(b){var d=c.cloneDeep(b)||{};this.ports=[],this.groups={},this.portLayoutNamespace=a.layout.Port,this.portLabelLayoutNamespace=a.layout.PortLabel,this._init(d)};d.prototype={getPorts:function(){return this.ports},getGroup:function(a){return this.groups[a]||{}},getPortsByGroup:function(a){return this.ports.filter(function(b){return b.group===a})},getGroupPortsMetrics:function(a,b){var d=this.getGroup(a),e=this.getPortsByGroup(a),f=d.position||{},h=f.name,i=this.portLayoutNamespace;i[h]||(h="left");var j=f.args||{},k=e.map(function(a){return a&&a.position&&a.position.args}),l=i[h](k,b,j),m={ports:e,result:[]};return c.toArray(l).reduce(function(a,c,d){var e=a.ports[d];return a.result.push({portId:e.id,portTransformation:c,labelTransformation:this._getPortLabelLayout(e,g.Point(c),b),portAttrs:e.attrs,portSize:e.size,labelSize:e.label.size}),a}.bind(this),m),m.result},_getPortLabelLayout:function(a,b,c){var d=this.portLabelLayoutNamespace,e=a.label.position.name||"left";return d[e]?d[e](b,c,a.label.position.args):null},_init:function(a){if(c.isObject(a.groups))for(var b=Object.keys(a.groups),d=0,e=b.length;d0},hasPort:function(a){return this.getPortIndex(a)!==-1},getPorts:function(){return c.cloneDeep(this.prop("ports/items"))||[]},getPort:function(a){return c.cloneDeep(c.toArray(this.prop("ports/items")).find(function(b){return b.id&&b.id===a}))},getPortsPositions:function(a){var b=this._portSettingsData.getGroupPortsMetrics(a,g.Rect(this.size()));return b.reduce(function(a,b){var c=b.portTransformation;return a[b.portId]={x:c.x,y:c.y,angle:c.angle},a},{})},getPortIndex:function(a){var b=c.isObject(a)?a.id:a;return this._isValidPortId(b)?c.toArray(this.prop("ports/items")).findIndex(function(a){return a.id===b}):-1},addPort:function(a,b){if(!c.isObject(a)||Array.isArray(a))throw new Error("Element: addPort requires an object.");var d=c.assign([],this.prop("ports/items"));return d.push(a),this.prop("ports/items",d,b),this},portProp:function(a,b,d,e){var f=this.getPortIndex(a);if(f===-1)throw new Error("Element: unable to find port with id "+a);var g=Array.prototype.slice.call(arguments,1);return Array.isArray(b)?g[0]=["ports","items",f].concat(b):c.isString(b)?g[0]=["ports/items/",f,"/",b].join(""):(g=["ports/items/"+f],c.isPlainObject(b)&&(g.push(b),g.push(d))),this.prop.apply(this,g)},_validatePorts:function(){var b=this.get("ports")||{},d=[];b=b||{};var e=c.toArray(b.items);return e.forEach(function(a){"object"!=typeof a&&d.push("Element: invalid port ",a),this._isValidPortId(a.id)||(a.id=c.uuid())},this),a.util.uniq(e,"id").length!==e.length&&d.push("Element: found id duplicities in ports."),d},_isValidPortId:function(a){return null!==a&&void 0!==a&&!c.isObject(a)},addPorts:function(a,b){return a.length&&this.prop("ports/items",c.assign([],this.prop("ports/items")).concat(a),b),this},removePort:function(a,b){var d=b||{},e=c.assign([],this.prop("ports/items")),f=this.getPortIndex(a);return f!==-1&&(e.splice(f,1),d.rewrite=!0,this.prop("ports/items",e,d)),this},_createPortData:function(){var a=this._validatePorts();if(a.length>0)throw this.set("ports",this.previous("ports")),new Error(a.join(" "));var b;this._portSettingsData&&(b=this._portSettingsData.getPorts()),this._portSettingsData=new d(this.get("ports"));var c=this._portSettingsData.getPorts();if(b){var e=c.filter(function(a){if(!b.find(function(b){return b.id===a.id}))return a}),f=b.filter(function(a){if(!c.find(function(b){return b.id===a.id}))return a});f.length>0&&this.trigger("ports:remove",this,f),e.length>0&&this.trigger("ports:add",this,e)}}}),c.assign(a.dia.ElementView.prototype,{portContainerMarkup:"g",portMarkup:[{tagName:"circle",selector:"circle",attributes:{r:10,fill:"#FFFFFF",stroke:"#000000"}}],portLabelMarkup:[{tagName:"text",selector:"text",attributes:{fill:"#000000"}}],_portElementsCache:null,_initializePorts:function(){this._portElementsCache={},this.listenTo(this.model,"change:ports",function(){this._refreshPorts()})},_refreshPorts:function(){this._removePorts(),this._portElementsCache={},this._renderPorts()},_renderPorts:function(){for(var a=[],b=this._getContainerElement(),d=0,e=b.node.childNodes.length;d1?V("g").append(h):V(h.firstChild),e=g.selectors}else b=V(f),Array.isArray(b)&&(b=V("g").append(b));if(!b)throw new Error("ElementView: Invalid port markup.");b.attr({port:a.id,"port-group":a.group});var i,j=this._getPortLabelMarkup(a.label);if(Array.isArray(j)){var k=c.parseDOMJSON(j),l=k.fragment;d=l.childNodes.length>1?V("g").append(l):V(l.firstChild),i=k.selectors}else d=V(j),Array.isArray(d)&&(d=V("g").append(d));if(!d)throw new Error("ElementView: Invalid port label markup.");var m;if(e&&i){for(var n in i)if(e[n])throw new Error("ElementView: selectors within port must be unique.");m=c.assign({},e,i)}else m=e||i;var o=V(this.portContainerMarkup).addClass("joint-port").append([b.addClass("joint-port-body"),d.addClass("joint-port-label")]);return this._portElementsCache[a.id]={portElement:o,portLabelElement:d,portSelectors:m,portLabelSelectors:i,portContentElement:b,portContentSelectors:e},o},_updatePortGroup:function(a){for(var b=g.Rect(this.model.size()),c=this.model._portSettingsData.getGroupPortsMetrics(a,b),d=0,e=c.length;d'}),joint.shapes.basic.TextView=joint.dia.ElementView.extend({initialize:function(){joint.dia.ElementView.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:attrs",this.resize)}}),joint.shapes.basic.Generic.define("basic.Text",{attrs:{text:{"font-size":18,fill:"#000000"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Circle",{size:{width:60,height:60},attrs:{circle:{fill:"#ffffff",stroke:"#000000",r:30,cx:30,cy:30},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Ellipse",{size:{width:60,height:40},attrs:{ellipse:{fill:"#ffffff",stroke:"#000000",rx:30,ry:20,cx:30,cy:20},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Polygon",{size:{width:60,height:40},attrs:{polygon:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Polyline",{size:{width:60,height:40},attrs:{polyline:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Image",{attrs:{text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Path",{size:{width:60,height:60},attrs:{path:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle",ref:"path","ref-x":.5,"ref-dy":10,fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Path.define("basic.Rhombus",{attrs:{path:{d:"M 30 0 L 60 30 30 60 0 30 z"},text:{"ref-y":.5,"ref-dy":null,"y-alignment":"middle"}}}),joint.shapes.basic.PortsModelInterface={initialize:function(){this.updatePortsAttrs(),this.on("change:inPorts change:outPorts",this.updatePortsAttrs,this),this.constructor.__super__.constructor.__super__.initialize.apply(this,arguments)},updatePortsAttrs:function(a){if(this._portSelectors){var b=joint.util.omit(this.get("attrs"),this._portSelectors);this.set("attrs",b,{silent:!0})}this._portSelectors=[];var c={};joint.util.toArray(this.get("inPorts")).forEach(function(a,b,d){var e=this.getPortAttrs(a,b,d.length,".inPorts","in");this._portSelectors=this._portSelectors.concat(Object.keys(e)),joint.util.assign(c,e)},this),joint.util.toArray(this.get("outPorts")).forEach(function(a,b,d){var e=this.getPortAttrs(a,b,d.length,".outPorts","out");this._portSelectors=this._portSelectors.concat(Object.keys(e)),joint.util.assign(c,e)},this),this.attr(c,{silent:!0}),this.processPorts(),this.trigger("process:ports")},getPortSelector:function(a){var b=".inPorts",c=this.get("inPorts").indexOf(a);if(c<0&&(b=".outPorts",c=this.get("outPorts").indexOf(a),c<0))throw new Error("getPortSelector(): Port doesn't exist.");return b+">g:nth-child("+(c+1)+")>.port-body"}},joint.shapes.basic.PortsViewInterface={initialize:function(){this.listenTo(this.model,"process:ports",this.update),joint.dia.ElementView.prototype.initialize.apply(this,arguments)},update:function(){this.renderPorts(),joint.dia.ElementView.prototype.update.apply(this,arguments)},renderPorts:function(){var a=this.$(".inPorts").empty(),b=this.$(".outPorts").empty(),c=joint.util.template(this.model.portMarkup),d=this.model.ports||[];d.filter(function(a){return"in"===a.type}).forEach(function(b,d){a.append(V(c({id:d,port:b})).node)}),d.filter(function(a){return"out"===a.type}).forEach(function(a,d){b.append(V(c({id:d,port:a})).node)})}},joint.shapes.basic.Generic.define("basic.TextBlock",{attrs:{rect:{fill:"#ffffff",stroke:"#000000",width:80,height:100},text:{fill:"#000000","font-size":14,"font-family":"Arial, helvetica, sans-serif"},".content":{text:"","ref-x":.5,"ref-y":.5,"y-alignment":"middle","x-alignment":"middle"}},content:""},{markup:['','',joint.env.test("svgforeignobject")?'
':'',""].join(""),initialize:function(){this.listenTo(this,"change:size",this.updateSize),this.listenTo(this,"change:content",this.updateContent),this.updateSize(this,this.get("size")),this.updateContent(this,this.get("content")),joint.shapes.basic.Generic.prototype.initialize.apply(this,arguments)},updateSize:function(a,b){this.attr({".fobj":joint.util.assign({},b),div:{style:joint.util.assign({},b)}})},updateContent:function(a,b){joint.env.test("svgforeignobject")?this.attr({".content":{html:joint.util.sanitizeHTML(b)}}):this.attr({".content":{text:b}})},setForeignObjectSize:function(){this.updateSize.apply(this,arguments)},setDivContent:function(){this.updateContent.apply(this,arguments)}}),joint.shapes.basic.TextBlockView=joint.dia.ElementView.extend({initialize:function(){joint.dia.ElementView.prototype.initialize.apply(this,arguments),this.noSVGForeignObjectElement=!joint.env.test("svgforeignobject"),joint.env.test("svgforeignobject")||this.listenTo(this.model,"change:content change:size",function(a){this.updateContent(a)})},update:function(a,b){var c=this.model;if(joint.env.test("svgforeignobject"))joint.dia.ElementView.prototype.update.call(this,c,b);else{var d=joint.util.omit(b||c.get("attrs"),".content");joint.dia.ElementView.prototype.update.call(this,c,d),b&&!joint.util.has(b,".content")||this.updateContent(c,b)}},updateContent:function(a,b){var c=joint.util.merge({},(b||a.get("attrs"))[".content"]);c=joint.util.omit(c,"text");var d=joint.util.breakText(a.get("content"),a.get("size"),c,{svgDocument:this.paper.svg}),e=joint.util.setByPath({},".content",c,"/");e[".content"].text=d,joint.dia.ElementView.prototype.update.call(this,a,e)}}),function(a,b,c,d){"use strict";var e=a.Element;e.define("standard.Rectangle",{attrs:{body:{refWidth:"100%",refHeight:"100%",strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"circle",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"ellipse",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Path",{attrs:{body:{refD:"M 0 0 L 10 0 10 10 0 10 Z",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Polygon",{attrs:{body:{refPoints:"0 0 10 0 10 10 0 10",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"polygon",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Polyline",{attrs:{body:{refPoints:"0 0 10 0 10 10 0 10 0 0",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"polyline",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Image",{attrs:{image:{refWidth:"100%",refHeight:"100%"},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"100%",refY2:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}]}),e.define("standard.BorderedImage",{attrs:{border:{refWidth:"100%",refHeight:"100%",stroke:"#333333",strokeWidth:2},image:{refWidth:-1,refHeight:-1,x:.5,y:.5},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"100%",refY2:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"image",selector:"image"},{tagName:"rect",selector:"border",attributes:{fill:"none"}},{tagName:"text",selector:"label"}]}),e.define("standard.EmbeddedImage",{attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#FFFFFF",strokeWidth:2},image:{refWidth:"30%",refHeight:-20,x:10,y:10,preserveAspectRatio:"xMidYMin"},label:{textVerticalAnchor:"top",textAnchor:"left",refX:"30%",refX2:20,refY:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}]}),e.define("standard.HeaderedRectangle",{attrs:{body:{refWidth:"100%",refHeight:"100%",strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},header:{refWidth:"100%",height:30,strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},headerText:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:15,fontSize:16,fill:"#333333"},bodyText:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",refY2:15,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"header"},{tagName:"text",selector:"headerText"},{tagName:"text",selector:"bodyText"}]});var f=10;joint.dia.Element.define("standard.Cylinder",{attrs:{body:{lateralArea:f,fill:"#FFFFFF",stroke:"#333333",strokeWidth:2},top:{refCx:"50%",cy:f,refRx:"50%",ry:f,fill:"#FFFFFF",stroke:"#333333",strokeWidth:2},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"100%",refY2:15,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],topRy:function(a,c){ -if(void 0===a)return this.attr("body/lateralArea");var d=b.isPercentage(a),e={lateralArea:a},f=d?{refCy:a,refRy:a,cy:null,ry:null}:{refCy:null,refRy:null,cy:a,ry:a};return this.attr({body:e,top:f},c)}},{attributes:{lateralArea:{set:function(a,c){var e=b.isPercentage(a);e&&(a=parseFloat(a)/100);var f=c.x,g=c.y,h=c.width,i=c.height,j=h/2,k=e?i*a:a,l=d.KAPPA,m=l*j,n=l*(e?i*a:a),o=f,p=f+h/2,q=f+h,r=g+k,s=r-k,t=g+i-k,u=g+i,v=["M",o,r,"L",o,t,"C",f,t+n,p-m,u,p,u,"C",p+m,u,q,t+n,q,t,"L",q,r,"C",q,r-n,p+m,s,p,s,"C",p-m,s,o,r-n,o,r,"Z"];return{d:v.join(" ")}}}}});var g={tagName:"foreignObject",selector:"foreignObject",attributes:{overflow:"hidden"},children:[{tagName:"div",namespaceURI:"http://www.w3.org/1999/xhtml",selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]},h={tagName:"text",selector:"label",attributes:{"text-anchor":"middle"}};e.define("standard.TextBlock",{attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#ffffff",strokeWidth:2},foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}}},{markup:[{tagName:"rect",selector:"body"},c.test("svgforeignobject")?g:h]},{attributes:{text:{set:function(c,d,e,f){if(!(e instanceof HTMLElement)){var g=f.style||{},h={text:c,width:-5,height:"100%"},i=b.assign({textVerticalAnchor:"middle"},g);return a.attributes.textWrap.set.call(this,h,d,e,i),{fill:g.color||null}}e.textContent=c},position:function(a,b,c){if(c instanceof SVGElement)return b.center()}}}});var i=a.Link;i.define("standard.Link",{attrs:{line:{connection:!0,stroke:"#333333",strokeWidth:2,strokeLinejoin:"round",targetMarker:{type:"path",d:"M 10 -5 0 0 10 5 z"}},wrapper:{connection:!0,strokeWidth:10,strokeLinejoin:"round"}}},{markup:[{tagName:"path",selector:"wrapper",attributes:{fill:"none",cursor:"pointer",stroke:"transparent"}},{tagName:"path",selector:"line",attributes:{fill:"none","pointer-events":"none"}}]}),i.define("standard.DoubleLink",{attrs:{line:{connection:!0,stroke:"#DDDDDD",strokeWidth:4,strokeLinejoin:"round",targetMarker:{type:"path",stroke:"#000000",d:"M 10 -3 10 -10 -2 0 10 10 10 3"}},outline:{connection:!0,stroke:"#000000",strokeWidth:6,strokeLinejoin:"round"}}},{markup:[{tagName:"path",selector:"outline",attributes:{fill:"none"}},{tagName:"path",selector:"line",attributes:{fill:"none"}}]}),i.define("standard.ShadowLink",{attrs:{line:{connection:!0,stroke:"#FF0000",strokeWidth:20,strokeLinejoin:"round",targetMarker:{type:"path",stroke:"none",d:"M 0 -10 -10 0 0 10 z"},sourceMarker:{type:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z"}},shadow:{connection:!0,refX:3,refY:6,stroke:"#000000",strokeOpacity:.2,strokeWidth:20,strokeLinejoin:"round",targetMarker:{type:"path",d:"M 0 -10 -10 0 0 10 z",stroke:"none"},sourceMarker:{type:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z"}}}},{markup:[{tagName:"path",selector:"shadow",attributes:{fill:"none"}},{tagName:"path",selector:"line",attributes:{fill:"none"}}]})}(joint.dia,joint.util,joint.env,V),joint.routers.manhattan=function(a,b,c,d){"use strict";function e(a){this.map={},this.options=a,this.mapGridSize=100}function f(){this.items=[],this.hash={},this.values={},this.OPEN=1,this.CLOSE=2}function g(a,b){return b&&b.paddingBox?a.sourceBBox.clone().moveAndExpand(b.paddingBox):a.sourceBBox.clone()}function h(a,b){return b&&b.paddingBox?a.targetBBox.clone().moveAndExpand(b.paddingBox):a.targetBBox.clone()}function i(a,b){if(a.sourceAnchor)return a.sourceAnchor;var c=g(a,b);return c.center()}function j(a,b){if(a.targetAnchor)return a.targetAnchor;var c=h(a,b);return c.center()}function k(b,c,d,e,f){var g=360/d,h=b.theta(l(b,c,e,f)),i=a.normalizeAngle(h+g/2);return g*Math.floor(i/g)}function l(b,c,d,e){var f=e.step,g=c.x-b.x,h=c.y-b.y,i=g/d.x,j=h/d.y,k=i*f,l=j*f;return new a.Point(b.x+k,b.y+l)}function m(a,b){var c=Math.abs(a-b);return c>180?360-c:c}function n(a,b,c){var e=c.step;d.toArray(c.directions).forEach(function(a){a.gridOffsetX=a.offsetX/e*b.x,a.gridOffsetY=a.offsetY/e*b.y})}function o(a,b,c){return{source:b.clone(),x:p(c.x-b.x,a),y:p(c.y-b.y,a)}}function p(a,b){if(!a)return b;var c=Math.abs(a),d=Math.round(c/b);if(!d)return c;var e=d*b,f=c-e,g=f/d;return b+g}function q(b,c){var d=c.source,e=a.snapToGrid(b.x-d.x,c.x)+d.x,f=a.snapToGrid(b.y-d.y,c.y)+d.y;return new a.Point(e,f)}function r(a,b){return a?a.round(b.precision):a}function s(a){return a.clone().round().toString()}function t(b){return new a.Point(0===b.x?0:Math.abs(b.x)/b.x,0===b.y?0:Math.abs(b.y)/b.y)}function u(a,b,c,d,e,f){for(var g,h=[],i=t(e.difference(c)),j=s(c),k=a[j];k;){g=r(b[j],f);var l=t(g.difference(r(k.clone(),f)));l.equals(i)||(h.unshift(g),i=l),j=s(k),k=a[j]}var m=r(b[j],f),n=t(m.difference(d));return n.equals(i)||h.unshift(m),h}function v(a,b){for(var c=1/0,d=0,e=b.length;dj)&&(j=w,t=q(v,f))}var x=r(t,g);x&&(c.containsPoint(x)&&r(x.offset(l.x*f.x,l.y*f.y),g),d.push(x))}return d},[]);return c.containsPoint(i)||n.push(i),n}function x(b,c,e,g){var h,l;h=b instanceof a.Rect?i(this,g).clone():b.clone(),l=c instanceof a.Rect?j(this,g).clone():c.clone();var p,t,x,y,z=o(g.step,h,l);if(b instanceof a.Rect?(p=r(q(h,z),g),x=w(p,b,g.startDirections,z,g)):(p=r(q(h,z),g),x=[p]),c instanceof a.Rect?(t=r(q(l,z),g),y=w(l,c,g.endDirections,z,g)):(t=r(q(l,z),g),y=[t]),x=x.filter(e.isPointAccessible,e),y=y.filter(e.isPointAccessible,e),x.length>0&&y.length>0){for(var A=new f,B={},C={},D={},E=0,F=x.length;E0;){var Q,R=A.pop(),S=B[R],T=C[R],U=D[R],V=void 0===T,W=S.equals(p);if(Q=V?L?W?null:k(p,S,N,z,g):K:k(T,S,N,z,g),O.indexOf(R)>=0)return g.previousDirectionAngle=Q,u(C,B,S,p,t,g);for(E=0;Eg.maxAllowedDirectionChange)){var Y=S.clone().offset(I.gridOffsetX,I.gridOffsetY),Z=s(Y);if(!A.isClose(Z)&&e.isPointAccessible(Y)){if(O.indexOf(Z)>=0){r(Y,g);var $=Y.equals(t);if(!$){var _=k(Y,t,N,z,g),aa=m(X,_);if(aa>g.maxAllowedDirectionChange)continue}}var ba=I.cost,ca=W?0:g.penalties[J],da=U+ba+ca;(!A.isOpen(Z)||da90){var i=f;f=h,h=i}var j=d%90<45?f:h,k=new g.Line(a,j),l=90*Math.ceil(d/90),m=g.Point.fromPolar(k.squaredLength(),g.toRad(l+135),j),n=new g.Line(b,m),o=k.intersection(n),p=o?o:b,q=o?p:a,r=360/c.directions.length,s=q.theta(b),t=g.normalizeAngle(s+r/2),u=r*Math.floor(t/r);return c.previousDirectionAngle=u,p&&e.push(p.round()),e.push(b),e}};return function(c,d,e){if(!a.isFunction(joint.routers.manhattan))throw new Error("Metro requires the manhattan router.");return joint.routers.manhattan(c,a.assign({},b,d),e)}}(joint.util),joint.routers.normal=function(a,b,c){return a},joint.routers.oneSide=function(a,b,c){var d,e,f,g=b.side||"bottom",h=b.padding||40,i=c.sourceBBox,j=c.targetBBox,k=i.center(),l=j.center();switch(g){case"bottom":f=1,d="y",e="height";break;case"top":f=-1,d="y",e="height";break;case"left":f=-1,d="x",e="width";break;case"right":f=1,d="x",e="width";break;default:throw new Error("Router: invalid side")}return k[d]+=f*(i[e]/2+h),l[d]+=f*(j[e]/2+h),f*(k[d]-l[d])>0?l[d]=k[d]:k[d]=l[d],[k].concat(a,l)},joint.routers.orthogonal=function(a){function b(a,b,c){var d=new g.Point(a.x,b.y);return c.containsPoint(d)&&(d=new g.Point(b.x,a.y)),d}function c(a,b){return a["W"===b||"E"===b?"width":"height"]}function d(a,b){return a.x===b.x?a.y>b.y?"N":"S":a.y===b.y?a.x>b.x?"W":"E":null}function e(a){return new g.Rect(a.x,a.y,0,0)}function f(a,b){var c=b&&b.elementPadding||20;return a.sourceBBox.clone().inflate(c)}function h(a,b){var c=b&&b.elementPadding||20;return a.targetBBox.clone().inflate(c)}function i(a,b){if(a.sourceAnchor)return a.sourceAnchor;var c=f(a,b);return c.center()}function j(a,b){if(a.targetAnchor)return a.targetAnchor;var c=h(a,b);return c.center()}function k(a,b,c){var e=new g.Point(a.x,b.y),f=new g.Point(b.x,a.y),h=d(a,e),i=d(a,f),j=q[c],k=h===c||h!==j&&(i===j||i!==c)?e:f;return{points:[k],direction:d(k,b)}}function l(a,c,e){var f=b(a,c,e);return{points:[f],direction:d(f,c)}}function m(e,f,h,i){var j,k={},l=[new g.Point(e.x,f.y),new g.Point(f.x,e.y)],m=l.filter(function(a){return!h.containsPoint(a)}),n=m.filter(function(a){return d(a,e)!==i});if(n.length>0)j=n.filter(function(a){return d(e,a)===i}).pop(),j=j||n[0],k.points=[j],k.direction=d(j,f);else{j=a.difference(l,m)[0];var o=new g.Point(f).move(j,-c(h,i)/2),p=b(o,e,h);k.points=[p,o],k.direction=d(o,f)}return k}function n(a,b,e,f){var h=l(b,a,f),i=h.points[0];if(e.containsPoint(i)){h=l(a,b,e);var j=h.points[0];if(f.containsPoint(j)){var m=new g.Point(a).move(j,-c(e,d(a,j))/2),n=new g.Point(b).move(i,-c(f,d(b,i))/2),o=new g.Line(m,n).midpoint(),p=l(a,o,e),q=k(o,b,p.direction);h.points=[p.points[0],q.points[0]],h.direction=q.direction}}return h}function o(a,c,e,f,h){var i,j,k,l={},m=e.union(f).inflate(1),n=m.center().distance(c)>m.center().distance(a),o=n?c:a,p=n?a:c;return h?(i=g.Point.fromPolar(m.width+m.height,r[h],o),i=m.pointNearestToPoint(i).move(i,-1)):i=m.pointNearestToPoint(o).move(o,1),j=b(i,p,m),i.round().equals(j.round())?(j=g.Point.fromPolar(m.width+m.height,g.toRad(i.theta(o))+Math.PI/2,p),j=m.pointNearestToPoint(j).move(p,1).round(),k=b(i,j,m),l.points=n?[j,k,i]:[i,k,j]):l.points=n?[j,i]:[i,j],l.direction=n?d(i,c):d(j,c),l}function p(b,c,p){var q=c.elementPadding||20,r=f(p,c),s=h(p,c),t=i(p,c),u=j(p,c);r=r.union(e(t)),s=s.union(e(u)),b=a.toArray(b).map(g.Point),b.unshift(t),b.push(u);for(var v,w=[],x=0,y=b.length-1;x=Math.abs(a.y-b.y)){var k=(a.x+b.x)/2;j=g.Path.createSegment("C",k,a.y,k,b.y,b.x,b.y),e.appendSegment(j)}else{var l=(a.y+b.y)/2;j=g.Path.createSegment("C",a.x,l,b.x,l,b.x,b.y),e.appendSegment(j)}}return f?e:e.serialize()},joint.connectors.jumpover=function(a,b,c){function d(a,c,d){var e=[].concat(a,d,c);return e.reduce(function(a,c,d){var f=e[d+1];return null!=f&&(a[d]=b.line(c,f)),a},[])}function e(a){var b=a.paper._jumpOverUpdateList;null==b&&(b=a.paper._jumpOverUpdateList=[],a.paper.on("cell:pointerup",f),a.paper.model.on("reset",function(){b=a.paper._jumpOverUpdateList=[]})),b.indexOf(a)<0&&(b.push(a),a.listenToOnce(a.model,"change:connector remove",function(){b.splice(b.indexOf(a),1)}))}function f(){for(var a=this._jumpOverUpdateList,b=0;bw)||"jumpover"!==d.name)}),z=y.map(function(a){return s.findViewByModel(a)}),A=d(a,b,f),B=z.map(function(a){return null==a?[]:a===this?A:d(a.sourcePoint,a.targetPoint,a.route)},this),C=A.reduce(function(a,b){var c=y.reduce(function(a,c,d){if(c!==v){var e=g(b,B[d]);a.push.apply(a,e)}return a},[]).sort(function(a,c){return h(b.start,a)-h(b.start,c)});return c.length>0?a.push.apply(a,i(b,c,p)):a.push(b),a},[]),D=j(C,p,q);return o?D:D.serialize()}}(_,g,joint.util),function(a,b,c,d){function e(a,b,d){var e=a.toJSON();return e.angle=b||0,c.util.defaults({},d,e)}function f(a,c,d){return a.map(function(a,b,c){var d=this.pointAt((b+.5)/c.length);return(a.dx||a.dy)&&d.offset(a.dx||0,a.dy||0),e(d.round(),0,a)},b.line(c,d))}function g(a,c,d,f){var g=c.center(),h=c.width/c.height,i=c.topMiddle(),j=b.Ellipse.fromRect(c);return a.map(function(a,b,c){var k=d+f(b,c.length),l=i.clone().rotate(g,-k).scale(h,1,g),m=a.compensateRotation?-j.tangentTheta(l):0;return(a.dx||a.dy)&&l.offset(a.dx||0,a.dy||0),a.dr&&l.move(g,a.dr),e(l.round(),m,a)})}function h(a,c){var e=c.x;d.isString(e)&&(e=parseFloat(e)/100*a.width);var f=c.y;return d.isString(f)&&(f=parseFloat(f)/100*a.height),b.point(e||0,f||0)}c.layout.Port={absolute:function(a,b,c){return a.map(h.bind(null,b))},fn:function(a,b,c){return c.fn(a,b,c)},line:function(a,b,c){var d=h(b,c.start||b.origin()),e=h(b,c.end||b.corner());return f(a,d,e)},left:function(a,b,c){return f(a,b.origin(),b.bottomLeft())},right:function(a,b,c){return f(a,b.topRight(),b.corner())},top:function(a,b,c){return f(a,b.origin(),b.topRight())},bottom:function(a,b,c){return f(a,b.bottomLeft(),b.corner())},ellipseSpread:function(a,b,c){var d=c.startAngle||0,e=c.step||360/a.length;return g(a,b,d,function(a){return a*e})},ellipse:function(a,b,c){var d=c.startAngle||0,e=c.step||20;return g(a,b,d,function(a,b){return(a+.5-b/2)*e})}}}(_,g,joint,joint.util),function(a,b,c,d){function e(a,b){return d.defaultsDeep({},a,b,{x:0,y:0,angle:0,attrs:{".":{y:"0","text-anchor":"start"}}})}function f(a,b,c,f){f=d.defaults({},f,{offset:15});var h,i,j,k,l=b.center().theta(a),m=g(b),n=f.offset,o=0;lm[2]?(j=".3em",h=n,i=0,k="start"):lo[2]?(k=".3em",i=-m,j=0,l="end"):h-270&&i<-90?(g="start",j=i-180):g="end";var m=Math.round;return e({x:m(k.x),y:m(k.y),angle:c?j:0,attrs:{".":{y:l,"text-anchor":g}}})}c.layout.PortLabel={manual:function(a,b,c){return e(c,b)},left:function(a,b,c){return e(c,{x:-15,attrs:{".":{y:".3em","text-anchor":"end"}}})},right:function(a,b,c){return e(c,{x:15,attrs:{".":{y:".3em","text-anchor":"start"}}})},top:function(a,b,c){return e(c,{y:-15,attrs:{".":{"text-anchor":"middle"}}})},bottom:function(a,b,c){return e(c,{y:15,attrs:{".":{y:".6em","text-anchor":"middle"}}})},outsideOriented:function(a,b,c){return f(a,b,!0,c)},outside:function(a,b,c){return f(a,b,!1,c)},insideOriented:function(a,b,c){return h(a,b,!0,c)},inside:function(a,b,c){return h(a,b,!1,c)},radial:function(a,b,c){return i(a.difference(b.center()),!1,c)},radialOriented:function(a,b,c){return i(a.difference(b.center()),!0,c)}}}(_,g,joint,joint.util),joint.highlighters.addClass={className:joint.util.addClassNamePrefix("highlighted"),highlight:function(a,b,c){var d=c||{},e=d.className||this.className;V(b).addClass(e)},unhighlight:function(a,b,c){var d=c||{},e=d.className||this.className;V(b).removeClass(e)}},joint.highlighters.opacity={highlight:function(a,b){V(b).addClass(joint.util.addClassNamePrefix("highlight-opacity"))},unhighlight:function(a,b){V(b).removeClass(joint.util.addClassNamePrefix("highlight-opacity"))}},joint.highlighters.stroke={defaultOptions:{padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},_views:{},getHighlighterId:function(a,b){return a.id+JSON.stringify(b)},removeHighlighter:function(a){this._views[a]&&(this._views[a].remove(),this._views[a]=null)},highlight:function(a,b,c){var d=this.getHighlighterId(b,c);if(!this._views[d]){var e,f=joint.util.defaults(c||{},this.defaultOptions),g=V(b);try{var h=g.convertToPathData()}catch(a){e=g.bbox(!0),h=V.rectToPath(joint.util.assign({},f,e))}var i=V("path").attr({d:h,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"}).attr(f.attrs),j=g.getTransformToElement(a.el),k=f.padding;if(k){e||(e=g.bbox(!0));var l=e.x+e.width/2,m=e.y+e.height/2;e=V.transformRect(e,j);var n=Math.max(e.width,1),o=Math.max(e.height,1),p=(n+k)/n,q=(o+k)/o,r=V.createSVGMatrix({a:p,b:0,c:0,d:q,e:l-p*l,f:m-q*m});j=j.multiply(r)}i.transform(j);var s=this._views[d]=new joint.mvc.View({svgElement:!0,className:"highlight-stroke",el:i.node}),t=this.removeHighlighter.bind(this,d),u=a.model;s.listenTo(u,"remove",t),s.listenTo(u.graph,"reset",t),a.vel.append(i)}},unhighlight:function(a,b,c){this.removeHighlighter(this.getHighlighterId(b,c))}},function(a,b){function c(a){return function(c,d,e,f){var g=!!f.rotate,h=g?c.getNodeUnrotatedBBox(d):c.getNodeBBox(d),i=h[a](),j=f.dx;if(j){var k=b.isPercentage(j);j=parseFloat(j),isFinite(j)&&(k&&(j/=100,j*=h.width),i.x+=j)}var l=f.dy;if(l){var m=b.isPercentage(l);l=parseFloat(l),isFinite(l)&&(m&&(l/=100,l*=h.height),i.y+=l)}return g?i.rotate(c.model.getBBox().center(),-c.model.angle()):i}}function d(a){return function(b,c,d,e){if(d instanceof Element){var f=this.paper.findView(d),h=f?f.getNodeBBox(d).center():new g.Point;return a.call(this,b,c,h,e)}return a.apply(this,arguments)}}function e(a,b,c,d){var e=a.model.angle(),f=a.getNodeBBox(b),h=f.center(),i=f.origin(),j=f.corner(),k=d.padding;if(isFinite(k)||(k=0),i.y+k<=c.y&&c.y<=j.y-k){var l=c.y-h.y;h.x+=0===e||180===e?0:1*l/Math.tan(g.toRad(e)),h.y+=l}else if(i.x+k<=c.x&&c.x<=j.x-k){var m=c.x-h.x;h.y+=90===e||270===e?0:m*Math.tan(g.toRad(e)),h.x+=m}return h}function f(a,b,c,d){var e,f,g,h=!!d.rotate;h?(e=a.getNodeUnrotatedBBox(b),g=a.model.getBBox().center(),f=a.model.angle()):e=a.getNodeBBox(b);var i=d.padding;isFinite(i)&&e.inflate(i),h&&c.rotate(g,f);var j,k=e.sideNearestToPoint(c);switch(k){case"left":j=e.leftMiddle();break;case"right":j=e.rightMiddle();break;case"top":j=e.topMiddle();break;case"bottom":j=e.bottomMiddle()}return h?j.rotate(g,-f):j}function h(a,b){var c=a.model,d=c.getBBox(),e=d.center(),f=c.angle(),h=a.findAttribute("port",b);if(h){portGroup=c.portProp(h,"group");var i=c.getPortsPositions(portGroup),j=new g.Point(i[h]).offset(d.origin());return j.rotate(e,-f),j}return e}a.anchors={center:c("center"),top:c("topMiddle"),bottom:c("bottomMiddle"),left:c("leftMiddle"),right:c("rightMiddle"),topLeft:c("origin"),topRight:c("topRight"),bottomLeft:c("bottomLeft"),bottomRight:c("corner"),perpendicular:d(e),midSide:d(f),modelCenter:h}}(joint,joint.util),function(a,b,c,d){function e(a,c){return 1===a.length?a[0]:b.sortBy(a,function(a){return a.squaredDistance(c)})[0]}function f(a,b,c){if(!isFinite(c))return a;var d=a.distance(b);return 0===c&&d>0?a:a.move(b,-Math.min(c,d-1))}function g(a){var b=a.getAttribute("stroke-width");return null===b?0:parseFloat(b)||0}function h(a,b,c,d){return f(a.end,a.start,d.offset)}function i(a,b,c,d){var h=b.getNodeBBox(c);d.stroke&&h.inflate(g(c)/2);var i=a.intersect(h),j=i?e(i,a.start):a.end;return f(j,a.start,d.offset)}function j(a,b,c,d){var h=b.model.angle();if(0===h)return i(a,b,c,d);var j=b.getNodeUnrotatedBBox(c);d.stroke&&j.inflate(g(c)/2);var k=j.center(),l=a.clone().rotate(k,h),m=l.setLength(1e6).intersect(j),n=m?e(m,l.start).rotate(k,-h):a.end;return f(n,a.start,d.offset)}function k(a,h,i,j){var k,n,o=j.selector,p=a.end;if("string"==typeof o)k=h.findBySelector(o)[0];else if(Array.isArray(o))k=b.getByPath(i,o);else{k=i;do{var q=k.tagName.toUpperCase();if("G"===q)k=k.firstChild;else{if("TITLE"!==q)break;k=k.nextSibling}}while(k)}if(!(k instanceof Element))return p;var r=h.getNodeShape(k),s=h.getNodeMatrix(k),t=h.getRootTranslateMatrix(),u=h.getRootRotateMatrix(),v=t.multiply(u).multiply(s),w=v.inverse(),x=d.transformLine(a,w),y=x.start.clone(),z=h.getNodeData(k);if(j.insideout===!1){z[m]||(z[m]=r.bbox());var A=z[m];if(A.containsPoint(y))return p}var B;if(r instanceof c.Path){var C=j.precision||2;z[l]||(z[l]=r.getSegmentSubdivisions({precision:C})),segmentSubdivisions=z[l],B={precision:C,segmentSubdivisions:z[l]}}j.extrapolate===!0&&x.setLength(1e6),n=x.intersect(r,B),n?d.isArray(n)&&(n=e(n,y)):j.sticky===!0&&(n=r instanceof c.Rect?r.pointNearestToPoint(y):r instanceof c.Ellipse?r.intersectionWithLineFromCenterToPoint(y):r.closestPoint(y,B));var D=n?d.transformPoint(n,v):p,E=j.offset||0;return j.stroke&&(E+=g(k)/2),f(D,a.start,E)}var l="segmentSubdivisons",m="shapeBBox";a.connectionPoints={anchor:h,bbox:i,rectangle:j,boundary:k}}(joint,joint.util,g,V),function(a,b){function c(a,b){return 0===b?"0%":Math.round(a/b*100)+"%"}function d(a){return function(b,d,e,f){var g=d.model.angle(),h=d.getNodeUnrotatedBBox(e),i=d.model.getBBox().center();f.rotate(i,g);var j=f.x-h.x,k=f.y-h.y;return a&&(j=c(j,h.width),k=c(k,h.height)),b.anchor={name:"topLeft",args:{dx:j,dy:k,rotate:!0}},b}}a.connectionStrategies={useDefaults:b.noop,pinAbsolute:d(!1),pinRelative:d(!0)}}(joint,joint.util),function(a,b,c,d){function e(b,c,d){var e=a.connectionStrategies.pinRelative.call(this.paper,{},c,d,b,this.model);return e.anchor}function f(a,b,c,d,e,f){var g=f.options.snapRadius,h="source"===d,i=h?0:-1,j=this.model.vertex(i)||this.getEndAnchor(h?"target":"source");return j&&(Math.abs(j.x-a.x)0?c[a-1]:b.sourceAnchor,f=a0){var d=this.getNeighborPoints(b),e=d.prev,f=d.next;Math.abs(a.x-e.x)0&&b<=1,d=0,e={x:0,y:0};if(a.offset){var f=a.offset;"number"==typeof f&&(d=f),f.x&&(e.x=f.x),f.y&&(e.y=f.y)}var g,h=0!==e.x||0!==e.y||0===d,i=this.path,j={segmentSubdivisions:this.getConnectionSubdivisions()},k=c?b*this.getConnectionLength():b;if(h)g=i.pointAtLength(k,j),g.offset(e);else{var l=i.tangentAtLength(k,j);l?(l.rotate(l.start,-90),l.setLength(d),g=l.end):g=i.start}return g},getVertexIndex:function(a,b){for(var c=this.model,d=c.vertices(),e=this.getClosestPointLength(new g.Point(a,b)),f=0,h=d.length;f0){for(var j=0,k=i.length;j").addClass(joint.util.addClassNamePrefix("paper-background")),this.options.background&&this.drawBackground(this.options.background),this.$grid=$("
").addClass(joint.util.addClassNamePrefix("paper-grid")),this.options.drawGrid&&this.drawGrid(),this.$el.append(this.$background,this.$grid,this.svg),this},update:function(){return this.options.drawGrid&&this.drawGrid(),this._background&&this.updateBackgroundImage(this._background),this},_viewportMatrix:null,_viewportTransformString:null,matrix:function(a){var b=this.viewport;if(void 0===a){var c=b.getAttribute("transform");return(this._viewportTransformString||null)===c?a=this._viewportMatrix:(a=b.getCTM(),this._viewportMatrix=a,this._viewportTransformString=c),V.createSVGMatrix(a)}a=V.createSVGMatrix(a);var d=V.matrixToTransformString(a);return b.setAttribute("transform",d),this.tools.setAttribute("transform",d),this._viewportMatrix=a,this._viewportTransformString=b.getAttribute("transform"),this},clientMatrix:function(){return V.createSVGMatrix(this.viewport.getScreenCTM())},_sortDelayingBatches:["add","to-front","to-back"],_onSort:function(){this.model.hasActiveBatch(this._sortDelayingBatches)||this.sortViews()},_onBatchStop:function(a){var b=a&&a.batchName;this._sortDelayingBatches.includes(b)&&!this.model.hasActiveBatch(this._sortDelayingBatches)&&this.sortViews()},onRemove:function(){this.removeViews()},setDimensions:function(a,b){a=this.options.width=a||this.options.width,b=this.options.height=b||this.options.height,this.$el.css({width:Math.round(a),height:Math.round(b)}),this.trigger("resize",a,b)},setOrigin:function(a,b){return this.translate(a||0,b||0,{absolute:!0})},fitToContent:function(a,b,c,d){joint.util.isObject(a)?(d=a,a=d.gridWidth||1,b=d.gridHeight||1,c=d.padding||0):(d=d||{},a=a||1,b=b||1,c=c||0),c=joint.util.normalizeSides(c);var e=V(this.viewport).getBBox(),f=this.scale(),g=this.translate();e.x*=f.sx,e.y*=f.sy,e.width*=f.sx,e.height*=f.sy;var h=Math.max(Math.ceil((e.width+e.x)/a),1)*a,i=Math.max(Math.ceil((e.height+e.y)/b),1)*b,j=0,k=0;("negative"==d.allowNewOrigin&&e.x<0||"positive"==d.allowNewOrigin&&e.x>=0||"any"==d.allowNewOrigin)&&(j=Math.ceil(-e.x/a)*a,j+=c.left,h+=j),("negative"==d.allowNewOrigin&&e.y<0||"positive"==d.allowNewOrigin&&e.y>=0||"any"==d.allowNewOrigin)&&(k=Math.ceil(-e.y/b)*b,k+=c.top,i+=k),h+=c.right,i+=c.bottom,h=Math.max(h,d.minWidth||0),i=Math.max(i,d.minHeight||0),h=Math.min(h,d.maxWidth||Number.MAX_VALUE),i=Math.min(i,d.maxHeight||Number.MAX_VALUE);var l=h!=this.options.width||i!=this.options.height,m=j!=g.tx||k!=g.ty;m&&this.translate(j,k),l&&this.setDimensions(h,i)},scaleContentToFit:function(a){var b=this.getContentBBox();if(b.width&&b.height){a=a||{},joint.util.defaults(a,{padding:0,preserveAspectRatio:!0,scaleGrid:null,minScale:0,maxScale:Number.MAX_VALUE});var c,d=a.padding,e=a.minScaleX||a.minScale,f=a.maxScaleX||a.maxScale,h=a.minScaleY||a.minScale,i=a.maxScaleY||a.maxScale;if(a.fittingBBox)c=a.fittingBBox;else{var j=this.translate();c={x:j.tx,y:j.ty,width:this.options.width,height:this.options.height}}c=g.rect(c).moveAndExpand({x:d,y:d,width:-2*d,height:-2*d});var k=this.scale(),l=c.width/b.width*k.sx,m=c.height/b.height*k.sy;if(a.preserveAspectRatio&&(l=m=Math.min(l,m)),a.scaleGrid){var n=a.scaleGrid;l=n*Math.floor(l/n),m=n*Math.floor(m/n)}l=Math.min(f,Math.max(e,l)),m=Math.min(i,Math.max(h,m)),this.scale(l,m);var o=this.getContentBBox(),p=c.x-o.x,q=c.y-o.y;this.translate(p,q)}},getContentArea:function(){return V(this.viewport).getBBox()},getContentBBox:function(){var a=this.viewport.getBoundingClientRect(),b=this.clientMatrix(),c=this.translate();return g.rect({x:a.left-b.e+c.tx,y:a.top-b.f+c.ty,width:a.width,height:a.height})},getArea:function(){return this.paperToLocalRect({x:0,y:0,width:this.options.width,height:this.options.height})},getRestrictedArea:function(){var a;return a=joint.util.isFunction(this.options.restrictTranslate)?this.options.restrictTranslate.apply(this,arguments):this.options.restrictTranslate===!0?this.getArea():this.options.restrictTranslate||null},createViewForModel:function(a){var b,c,d=this.options.cellViewNamespace,e=a.get("type")+"View",f=joint.util.getByPath(d,e,".");a.isLink()?(b=this.options.linkView,c=joint.dia.LinkView):(b=this.options.elementView,c=joint.dia.ElementView);var g=b.prototype instanceof Backbone.View?f||b:b.call(this,a)||f||c;return new g({model:a,interactive:this.options.interactive})},onCellAdded:function(a,b,c){if(this.options.async&&c.async!==!1&&joint.util.isNumber(c.position)){if(this._asyncCells=this._asyncCells||[],this._asyncCells.push(a),0==c.position){if(this._frameId)throw new Error("another asynchronous rendering in progress");this.asyncRenderViews(this._asyncCells,c),delete this._asyncCells}}else this.renderView(a)},removeView:function(a){var b=this._views[a.id];return b&&(b.remove(),delete this._views[a.id]),b},renderView:function(a){var b=this._views[a.id]=this.createViewForModel(a);return V(this.viewport).append(b.el),b.paper=this,b.render(),b},onImageDragStart:function(){return!1},beforeRenderViews:function(a){return a.sort(function(a){return a.isLink()?1:-1}),a},afterRenderViews:function(){this.sortViews()},resetViews:function(a,b){this.removeViews();var c=a.models.slice();if(c=this.beforeRenderViews(c,b)||c,this.cancelRenderViews(),this.options.async)this.asyncRenderViews(c,b);else{for(var d=0,e=c.length;d(e.get("z")||0)?1:-1})},scale:function(a,b,c,d){if(void 0===a)return V.matrixToScale(this.matrix());void 0===b&&(b=a),void 0===c&&(c=0,d=0);var e=this.translate();if(c||d||e.tx||e.ty){var f=e.tx-c*(a-1),g=e.ty-d*(b-1);this.translate(f,g)}var h=this.matrix();return h.a=a||0,h.d=b||0,this.matrix(h),this.trigger("scale",a,b,c,d),this},rotate:function(a,b,c){if(void 0===a)return V.matrixToRotate(this.matrix());if(void 0===b){var d=this.viewport.getBBox();b=d.width/2,c=d.height/2}var e=this.matrix().translate(b,c).rotate(a).translate(-b,-c);return this.matrix(e),this},translate:function(a,b){if(void 0===a)return V.matrixToTranslate(this.matrix());var c=this.matrix();c.e=a||0,c.f=b||0,this.matrix(c);var d=this.translate(),e=this.options.origin;return e.x=d.tx,e.y=d.ty,this.trigger("translate",d.tx,d.ty),this.options.drawGrid&&this.drawGrid(),this},findView:function(a){for(var b=joint.util.isString(a)?this.viewport.querySelector(a):a instanceof $?a[0]:a;b&&b!==this.el&&b!==document;){var c=b.getAttribute("model-id");if(c)return this._views[c];b=b.parentNode}},findViewByModel:function(a){var b=joint.util.isString(a)||joint.util.isNumber(a)?a:a&&a.id;return this._views[b]},findViewsFromPoint:function(a){a=g.point(a);var b=this.model.getElements().map(this.findViewByModel,this);return b.filter(function(b){return b&&b.vel.getBBox({target:this.viewport}).containsPoint(a)},this)},findViewsInArea:function(a,b){b=joint.util.defaults(b||{},{strict:!1}),a=g.rect(a);var c=this.model.getElements().map(this.findViewByModel,this),d=b.strict?"containsRect":"intersect";return c.filter(function(b){return b&&a[d](b.vel.getBBox({target:this.viewport}))},this)},removeTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"remove"),this},hideTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"hide"),this},showTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"show"),this},getModelById:function(a){return this.model.getCell(a)},snapToGrid:function(a,b){return this.clientToLocalPoint(a,b).snapToGrid(this.options.gridSize)},localToPaperPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.matrix());return g.Point(d)},localToPaperRect:function(a,b,c,d){var e=g.Rect(a,b),f=V.transformRect(e,this.matrix());return g.Rect(f)},paperToLocalPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.matrix().inverse());return g.Point(d)},paperToLocalRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.matrix().inverse());return g.Rect(f)},localToClientPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.clientMatrix());return g.Point(d)},localToClientRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.clientMatrix());return g.Rect(f)},clientToLocalPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.clientMatrix().inverse());return g.Point(d)},clientToLocalRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.clientMatrix().inverse());return g.Rect(f)},localToPagePoint:function(a,b){return this.localToPaperPoint(a,b).offset(this.pageOffset())},localToPageRect:function(a,b,c,d){return this.localToPaperRect(a,b,c,d).moveAndExpand(this.pageOffset())},pageToLocalPoint:function(a,b){var c=g.Point(a,b),d=c.difference(this.pageOffset());return this.paperToLocalPoint(d)},pageToLocalRect:function(a,b,c,d){var e=this.pageOffset(),f=g.Rect(a,b,c,d);return f.x-=e.x,f.y-=e.y,this.paperToLocalRect(f)},clientOffset:function(){var a=this.svg.getBoundingClientRect();return g.Point(a.left,a.top)},pageOffset:function(){return this.clientOffset().offset(window.scrollX,window.scrollY)},linkAllowed:function(a){if(!(a instanceof joint.dia.LinkView))throw new Error("Must provide a linkView.");var b=a.model,c=this.options,d=this.model,e=d.constructor.validations;return!(!c.multiLinks&&!e.multiLinks.call(this,d,b))&&(!(!c.linkPinning&&!e.linkPinning.call(this,d,b))&&!("function"==typeof c.allowLink&&!c.allowLink.call(this,a,this)))},getDefaultLink:function(a,b){return joint.util.isFunction(this.options.defaultLink)?this.options.defaultLink.call(this,a,b):this.options.defaultLink.clone()},resolveHighlighter:function(a){a=a||{};var b=a.highlighter,c=this.options;if(void 0===b){var d=["embedding","connecting","magnetAvailability","elementAvailability"].find(function(b){return!!a[b]});b=d&&c.highlighting[d]||c.highlighting.default}if(!b)return!1;joint.util.isString(b)&&(b={name:b});var e=b.name,f=c.highlighterNamespace[e];if(!f)throw new Error('Unknown highlighter ("'+e+'")');if("function"!=typeof f.highlight)throw new Error('Highlighter ("'+e+'") is missing required highlight() method');if("function"!=typeof f.unhighlight)throw new Error('Highlighter ("'+e+'") is missing required unhighlight() method');return{highlighter:f,options:b.options||{},name:e}},onCellHighlight:function(a,b,c){if(c=this.resolveHighlighter(c)){b.id||(b.id=V.uniqueId());var d=c.name+b.id+JSON.stringify(c.options);if(!this._highlights[d]){var e=c.highlighter;e.highlight(a,b,joint.util.assign({},c.options)),this._highlights[d]={cellView:a,magnetEl:b,opt:c.options,highlighter:e}}}},onCellUnhighlight:function(a,b,c){if(c=this.resolveHighlighter(c)){var d=c.name+b.id+JSON.stringify(c.options),e=this._highlights[d];e&&(e.highlighter.unhighlight(e.cellView,e.magnetEl,e.opt),this._highlights[d]=null)}},pointerdblclick:function(a){a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target); +if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerdblclick(a,c.x,c.y):this.trigger("blank:pointerdblclick",a,c.x,c.y)}},pointerclick:function(a){if(this._mousemoved<=this.options.clickThreshold){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(this.guard(a,b))return;var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerclick(a,c.x,c.y):this.trigger("blank:pointerclick",a,c.x,c.y)}},contextmenu:function(a){this.options.preventContextMenu&&a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.contextmenu(a,c.x,c.y):this.trigger("blank:contextmenu",a,c.x,c.y)}},pointerdown:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?(a.preventDefault(),b.pointerdown(a,c.x,c.y)):(this.options.preventDefaultBlankAction&&a.preventDefault(),this.trigger("blank:pointerdown",a,c.x,c.y)),this.delegateDragEvents(b,a.data)}},pointermove:function(a){a.preventDefault();var b=this.eventData(a);b.mousemoved||(b.mousemoved=0);var c=++b.mousemoved;if(!(c<=this.options.moveThreshold)){a=joint.util.normalizeEvent(a);var d=this.snapToGrid({x:a.clientX,y:a.clientY}),e=b.sourceView;e?e.pointermove(a,d.x,d.y):this.trigger("blank:pointermove",a,d.x,d.y),this.eventData(a,b)}},pointerup:function(a){this.undelegateDocumentEvents(),a=joint.util.normalizeEvent(a);var b=this.snapToGrid({x:a.clientX,y:a.clientY}),c=this.eventData(a).sourceView;c?c.pointerup(a,b.x,b.y):this.trigger("blank:pointerup",a,b.x,b.y),this.delegateEvents()},mouseover:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b))if(b)b.mouseover(a);else{if(this.el===a.target)return;this.trigger("blank:mouseover",a)}},mouseout:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b))if(b)b.mouseout(a);else{if(this.el===a.target)return;this.trigger("blank:mouseout",a)}},mouseenter:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.findView(a.relatedTarget);if(b){if(c===b)return;b.mouseenter(a)}else{if(c)return;this.trigger("paper:mouseenter",a)}}},mouseleave:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.findView(a.relatedTarget);if(b){if(c===b)return;b.mouseleave(a)}else{if(c)return;this.trigger("paper:mouseleave",a)}}},mousewheel:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=a.originalEvent,d=this.snapToGrid({x:c.clientX,y:c.clientY}),e=Math.max(-1,Math.min(1,c.wheelDelta||-c.detail));b?b.mousewheel(a,d.x,d.y,e):this.trigger("blank:mousewheel",a,d.x,d.y,e)}},onevent:function(a){var b=a.currentTarget,c=b.getAttribute("event");if(c){var d=this.findView(b);if(d){if(a=joint.util.normalizeEvent(a),this.guard(a,d))return;var e=this.snapToGrid({x:a.clientX,y:a.clientY});d.onevent(a,c,e.x,e.y)}}},onmagnet:function(a){var b=a.currentTarget,c=b.getAttribute("magnet");if(c){var d=this.findView(b);if(d){if(a=joint.util.normalizeEvent(a),this.guard(a,d))return;if(!this.options.validateMagnet(d,b))return;var e=this.snapToGrid(a.clientX,a.clientY);d.onmagnet(a,e.x,e.y)}}},onlabel:function(a){var b=a.currentTarget,c=this.findView(b);if(c){if(a=joint.util.normalizeEvent(a),this.guard(a,c))return;var d=this.snapToGrid(a.clientX,a.clientY);c.onlabel(a,d.x,d.y)}},delegateDragEvents:function(a,b){b||(b={}),this.eventData({data:b},{sourceView:a||null,mousemoved:0}),this.delegateDocumentEvents(null,b),this.undelegateEvents()},guard:function(a,b){return"mousedown"===a.type&&2===a.button||(!(!this.options.guard||!this.options.guard(a,b))||(a.data&&void 0!==a.data.guarded?a.data.guarded:!(b&&b.model&&b.model instanceof joint.dia.Cell)&&(this.svg!==a.target&&this.el!==a.target&&!$.contains(this.svg,a.target))))},setGridSize:function(a){return this.options.gridSize=a,this.options.drawGrid&&this.drawGrid(),this},clearGrid:function(){return this.$grid&&this.$grid.css("backgroundImage","none"),this},_getGriRefs:function(){return this._gridCache||(this._gridCache={root:V("svg",{width:"100%",height:"100%"},V("defs")),patterns:{},add:function(a,b){V(this.root.node.childNodes[0]).append(b),this.patterns[a]=b,this.root.append(V("rect",{width:"100%",height:"100%",fill:"url(#"+a+")"}))},get:function(a){return this.patterns[a]},exist:function(a){return void 0!==this.patterns[a]}}),this._gridCache},setGrid:function(a){this.clearGrid(),this._gridCache=null,this._gridSettings=[];var b=Array.isArray(a)?a:[a||{}];return b.forEach(function(a){this._gridSettings.push.apply(this._gridSettings,this._resolveDrawGridOption(a))},this),this},_resolveDrawGridOption:function(a){var b=this.constructor.gridPatterns;if(joint.util.isString(a)&&Array.isArray(b[a]))return b[a].map(function(a){return joint.util.assign({},a)});var c=a||{args:[{}]},d=Array.isArray(c),e=c.name;if(d||e||c.markup||(e="dot"),e&&Array.isArray(b[e])){var f=b[e].map(function(a){return joint.util.assign({},a)}),g=Array.isArray(c.args)?c.args:[c.args||{}];joint.util.defaults(g[0],joint.util.omit(a,"args"));for(var h=0;h'),f=joint.util.toArray(d).map(function(a){return e({offset:a.offset,color:a.color,opacity:Number.isFinite(a.opacity)?a.opacity:1})}),g=["<"+c+">",f.join(""),""].join(""),h=joint.util.assign({id:b},a.attrs);V(g,h).appendTo(this.defs)}return b},defineMarker:function(a){if(!joint.util.isObject(a))throw new TypeError("dia.Paper: defineMarker() requires 1. argument to be an object.");var b=a.id;if(b||(b=this.svg.id+joint.util.hashCode(JSON.stringify(a))),!this.isDefined(b)){var c=joint.util.omit(a,"type","userSpaceOnUse"),d=V("marker",{id:b,orient:"auto",overflow:"visible",markerUnits:a.markerUnits||"userSpaceOnUse"},[V(a.type||"path",c)]);d.appendTo(this.defs)}return b}},{backgroundPatterns:{flipXy:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=2*c,b.height=2*d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.setTransform(-1,0,0,-1,b.width,b.height),e.drawImage(a,0,0,c,d),e.setTransform(-1,0,0,1,b.width,0),e.drawImage(a,0,0,c,d),e.setTransform(1,0,0,-1,0,b.height),e.drawImage(a,0,0,c,d),b},flipX:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=2*c,b.height=d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.translate(2*c,0),e.scale(-1,1),e.drawImage(a,0,0,c,d),b},flipY:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=c,b.height=2*d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.translate(0,2*d),e.scale(1,-1),e.drawImage(a,0,0,c,d),b},watermark:function(a,b){b=b||{};var c=a.width,d=a.height,e=document.createElement("canvas");e.width=3*c,e.height=3*d;for(var f=e.getContext("2d"),h=joint.util.isNumber(b.watermarkAngle)?-b.watermarkAngle:-20,i=g.toRad(h),j=e.width/4,k=e.height/4,l=0;l<4;l++)for(var m=0;m<4;m++)(l+m)%2>0&&(f.setTransform(1,0,0,1,(2*l-1)*j,(2*m-1)*k),f.rotate(i),f.drawImage(a,-c/2,-d/2,c,d));return e}},gridPatterns:{dot:[{color:"#AAAAAA",thickness:1,markup:"rect",update:function(a,b){V(a).attr({width:b.thickness*b.sx,height:b.thickness*b.sy,fill:b.color})}}],fixedDot:[{color:"#AAAAAA",thickness:1,markup:"rect",update:function(a,b){var c=b.sx<=1?b.thickness*b.sx:b.thickness;V(a).attr({width:c,height:c,fill:b.color})}}],mesh:[{color:"#AAAAAA",thickness:1,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}}],doubleMesh:[{color:"#AAAAAA",thickness:1,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}},{color:"#000000",thickness:3,scaleFactor:4,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}}]}}),function(a,b){var c=function(c){var d=b.cloneDeep(c)||{};this.ports=[],this.groups={},this.portLayoutNamespace=a.layout.Port,this.portLabelLayoutNamespace=a.layout.PortLabel,this._init(d)};c.prototype={getPorts:function(){return this.ports},getGroup:function(a){return this.groups[a]||{}},getPortsByGroup:function(a){return this.ports.filter(function(b){return b.group===a})},getGroupPortsMetrics:function(a,c){var d=this.getGroup(a),e=this.getPortsByGroup(a),f=d.position||{},h=f.name,i=this.portLayoutNamespace;i[h]||(h="left");var j=f.args||{},k=e.map(function(a){return a&&a.position&&a.position.args}),l=i[h](k,c,j),m={ports:e,result:[]};return b.toArray(l).reduce(function(a,b,d){var e=a.ports[d];return a.result.push({portId:e.id,portTransformation:b,labelTransformation:this._getPortLabelLayout(e,g.Point(b),c),portAttrs:e.attrs,portSize:e.size,labelSize:e.label.size}),a}.bind(this),m),m.result},_getPortLabelLayout:function(a,b,c){var d=this.portLabelLayoutNamespace,e=a.label.position.name||"left";return d[e]?d[e](b,c,a.label.position.args):null},_init:function(a){if(b.isObject(a.groups))for(var c=Object.keys(a.groups),d=0,e=c.length;d0},hasPort:function(a){return this.getPortIndex(a)!==-1},getPorts:function(){return b.cloneDeep(this.prop("ports/items"))||[]},getPort:function(a){return b.cloneDeep(b.toArray(this.prop("ports/items")).find(function(b){return b.id&&b.id===a}))},getPortsPositions:function(a){var b=this._portSettingsData.getGroupPortsMetrics(a,g.Rect(this.size()));return b.reduce(function(a,b){var c=b.portTransformation;return a[b.portId]={x:c.x,y:c.y,angle:c.angle},a},{})},getPortIndex:function(a){var c=b.isObject(a)?a.id:a;return this._isValidPortId(c)?b.toArray(this.prop("ports/items")).findIndex(function(a){return a.id===c}):-1},addPort:function(a,c){if(!b.isObject(a)||Array.isArray(a))throw new Error("Element: addPort requires an object.");var d=b.assign([],this.prop("ports/items"));return d.push(a),this.prop("ports/items",d,c),this},portProp:function(a,c,d,e){var f=this.getPortIndex(a);if(f===-1)throw new Error("Element: unable to find port with id "+a);var g=Array.prototype.slice.call(arguments,1);return Array.isArray(c)?g[0]=["ports","items",f].concat(c):b.isString(c)?g[0]=["ports/items/",f,"/",c].join(""):(g=["ports/items/"+f],b.isPlainObject(c)&&(g.push(c),g.push(d))),this.prop.apply(this,g)},_validatePorts:function(){var c=this.get("ports")||{},d=[];c=c||{};var e=b.toArray(c.items);return e.forEach(function(a){"object"!=typeof a&&d.push("Element: invalid port ",a),this._isValidPortId(a.id)||(a.id=b.uuid())},this),a.util.uniq(e,"id").length!==e.length&&d.push("Element: found id duplicities in ports."),d},_isValidPortId:function(a){return null!==a&&void 0!==a&&!b.isObject(a)},addPorts:function(a,c){return a.length&&this.prop("ports/items",b.assign([],this.prop("ports/items")).concat(a),c),this},removePort:function(a,c){var d=c||{},e=b.assign([],this.prop("ports/items")),f=this.getPortIndex(a);return f!==-1&&(e.splice(f,1),d.rewrite=!0,this.prop("ports/items",e,d)),this},_createPortData:function(){var a=this._validatePorts();if(a.length>0)throw this.set("ports",this.previous("ports")),new Error(a.join(" "));var b;this._portSettingsData&&(b=this._portSettingsData.getPorts()),this._portSettingsData=new c(this.get("ports"));var d=this._portSettingsData.getPorts();if(b){var e=d.filter(function(a){if(!b.find(function(b){return b.id===a.id}))return a}),f=b.filter(function(a){if(!d.find(function(b){return b.id===a.id}))return a});f.length>0&&this.trigger("ports:remove",this,f),e.length>0&&this.trigger("ports:add",this,e)}}}),b.assign(a.dia.ElementView.prototype,{portContainerMarkup:"g",portMarkup:[{tagName:"circle",selector:"circle",attributes:{r:10,fill:"#FFFFFF",stroke:"#000000"}}],portLabelMarkup:[{tagName:"text",selector:"text",attributes:{fill:"#000000"}}],_portElementsCache:null,_initializePorts:function(){this._portElementsCache={},this.listenTo(this.model,"change:ports",function(){this._refreshPorts()})},_refreshPorts:function(){this._removePorts(),this._portElementsCache={},this._renderPorts()},_renderPorts:function(){for(var a=[],c=this._getContainerElement(),d=0,e=c.node.childNodes.length;d1?V("g").append(h):V(h.firstChild),e=g.selectors}else c=V(f),Array.isArray(c)&&(c=V("g").append(c));if(!c)throw new Error("ElementView: Invalid port markup.");c.attr({port:a.id,"port-group":a.group});var i,j=this._getPortLabelMarkup(a.label);if(Array.isArray(j)){var k=b.parseDOMJSON(j),l=k.fragment;d=l.childNodes.length>1?V("g").append(l):V(l.firstChild),i=k.selectors}else d=V(j),Array.isArray(d)&&(d=V("g").append(d));if(!d)throw new Error("ElementView: Invalid port label markup.");var m;if(e&&i){for(var n in i)if(e[n])throw new Error("ElementView: selectors within port must be unique.");m=b.assign({},e,i)}else m=e||i;var o=V(this.portContainerMarkup).addClass("joint-port").append([c.addClass("joint-port-body"),d.addClass("joint-port-label")]);return this._portElementsCache[a.id]={portElement:o,portLabelElement:d,portSelectors:m,portLabelSelectors:i,portContentElement:c,portContentSelectors:e},o},_updatePortGroup:function(a){for(var b=g.Rect(this.model.size()),c=this.model._portSettingsData.getGroupPortsMetrics(a,b),d=0,e=c.length;d'}),joint.shapes.basic.TextView=joint.dia.ElementView.extend({initialize:function(){joint.dia.ElementView.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:attrs",this.resize)}}),joint.shapes.basic.Generic.define("basic.Text",{attrs:{text:{"font-size":18,fill:"#000000"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Circle",{size:{width:60,height:60},attrs:{circle:{fill:"#ffffff",stroke:"#000000",r:30,cx:30,cy:30},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Ellipse",{size:{width:60,height:40},attrs:{ellipse:{fill:"#ffffff",stroke:"#000000",rx:30,ry:20,cx:30,cy:20},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Polygon",{size:{width:60,height:40},attrs:{polygon:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Polyline",{size:{width:60,height:40},attrs:{polyline:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Image",{attrs:{text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Path",{size:{width:60,height:60},attrs:{path:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle",ref:"path","ref-x":.5,"ref-dy":10,fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Path.define("basic.Rhombus",{attrs:{path:{d:"M 30 0 L 60 30 30 60 0 30 z"},text:{"ref-y":.5,"ref-dy":null,"y-alignment":"middle"}}}),joint.shapes.basic.PortsModelInterface={initialize:function(){this.updatePortsAttrs(),this.on("change:inPorts change:outPorts",this.updatePortsAttrs,this),this.constructor.__super__.constructor.__super__.initialize.apply(this,arguments)},updatePortsAttrs:function(a){if(this._portSelectors){var b=joint.util.omit(this.get("attrs"),this._portSelectors);this.set("attrs",b,{silent:!0})}this._portSelectors=[];var c={};joint.util.toArray(this.get("inPorts")).forEach(function(a,b,d){var e=this.getPortAttrs(a,b,d.length,".inPorts","in");this._portSelectors=this._portSelectors.concat(Object.keys(e)),joint.util.assign(c,e)},this),joint.util.toArray(this.get("outPorts")).forEach(function(a,b,d){var e=this.getPortAttrs(a,b,d.length,".outPorts","out");this._portSelectors=this._portSelectors.concat(Object.keys(e)),joint.util.assign(c,e)},this),this.attr(c,{silent:!0}),this.processPorts(),this.trigger("process:ports")},getPortSelector:function(a){var b=".inPorts",c=this.get("inPorts").indexOf(a);if(c<0&&(b=".outPorts",c=this.get("outPorts").indexOf(a),c<0))throw new Error("getPortSelector(): Port doesn't exist.");return b+">g:nth-child("+(c+1)+")>.port-body"}},joint.shapes.basic.PortsViewInterface={initialize:function(){this.listenTo(this.model,"process:ports",this.update),joint.dia.ElementView.prototype.initialize.apply(this,arguments)},update:function(){this.renderPorts(),joint.dia.ElementView.prototype.update.apply(this,arguments)},renderPorts:function(){var a=this.$(".inPorts").empty(),b=this.$(".outPorts").empty(),c=joint.util.template(this.model.portMarkup),d=this.model.ports||[];d.filter(function(a){return"in"===a.type}).forEach(function(b,d){a.append(V(c({id:d,port:b})).node)}),d.filter(function(a){return"out"===a.type}).forEach(function(a,d){b.append(V(c({id:d,port:a})).node)})}},joint.shapes.basic.Generic.define("basic.TextBlock",{attrs:{rect:{fill:"#ffffff",stroke:"#000000",width:80,height:100},text:{fill:"#000000","font-size":14,"font-family":"Arial, helvetica, sans-serif"},".content":{text:"","ref-x":.5,"ref-y":.5,"y-alignment":"middle","x-alignment":"middle"}},content:""},{markup:['','',joint.env.test("svgforeignobject")?'
':'',""].join(""),initialize:function(){this.listenTo(this,"change:size",this.updateSize),this.listenTo(this,"change:content",this.updateContent),this.updateSize(this,this.get("size")),this.updateContent(this,this.get("content")),joint.shapes.basic.Generic.prototype.initialize.apply(this,arguments)},updateSize:function(a,b){this.attr({".fobj":joint.util.assign({},b),div:{style:joint.util.assign({},b)}})},updateContent:function(a,b){joint.env.test("svgforeignobject")?this.attr({".content":{html:joint.util.sanitizeHTML(b)}}):this.attr({".content":{text:b}})},setForeignObjectSize:function(){this.updateSize.apply(this,arguments)},setDivContent:function(){this.updateContent.apply(this,arguments)}}),joint.shapes.basic.TextBlockView=joint.dia.ElementView.extend({initialize:function(){joint.dia.ElementView.prototype.initialize.apply(this,arguments),this.noSVGForeignObjectElement=!joint.env.test("svgforeignobject"),joint.env.test("svgforeignobject")||this.listenTo(this.model,"change:content change:size",function(a){this.updateContent(a)})},update:function(a,b){var c=this.model;if(joint.env.test("svgforeignobject"))joint.dia.ElementView.prototype.update.call(this,c,b);else{var d=joint.util.omit(b||c.get("attrs"),".content");joint.dia.ElementView.prototype.update.call(this,c,d),b&&!joint.util.has(b,".content")||this.updateContent(c,b)}},updateContent:function(a,b){var c=joint.util.merge({},(b||a.get("attrs"))[".content"]);c=joint.util.omit(c,"text");var d=joint.util.breakText(a.get("content"),a.get("size"),c,{svgDocument:this.paper.svg}),e=joint.util.setByPath({},".content",c,"/");e[".content"].text=d,joint.dia.ElementView.prototype.update.call(this,a,e)}}),function(a,b,c,d){"use strict";var e=a.Element;e.define("standard.Rectangle",{attrs:{body:{refWidth:"100%",refHeight:"100%",strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"circle",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"ellipse",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Path",{attrs:{body:{refD:"M 0 0 L 10 0 10 10 0 10 Z",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Polygon",{attrs:{body:{refPoints:"0 0 10 0 10 10 0 10",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"polygon",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Polyline",{attrs:{body:{refPoints:"0 0 10 0 10 10 0 10 0 0",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"polyline",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Image",{attrs:{image:{refWidth:"100%",refHeight:"100%"},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"100%",refY2:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}]}),e.define("standard.BorderedImage",{attrs:{border:{refWidth:"100%",refHeight:"100%",stroke:"#333333",strokeWidth:2},image:{refWidth:-1,refHeight:-1,x:.5,y:.5},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"100%",refY2:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"image",selector:"image"},{tagName:"rect",selector:"border",attributes:{fill:"none"}},{tagName:"text",selector:"label"}]}),e.define("standard.EmbeddedImage",{attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#FFFFFF",strokeWidth:2},image:{refWidth:"30%",refHeight:-20,x:10,y:10,preserveAspectRatio:"xMidYMin"},label:{textVerticalAnchor:"top",textAnchor:"left",refX:"30%",refX2:20,refY:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}]}),e.define("standard.HeaderedRectangle",{attrs:{body:{refWidth:"100%",refHeight:"100%",strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},header:{refWidth:"100%",height:30,strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},headerText:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:15,fontSize:16,fill:"#333333"},bodyText:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",refY2:15,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"header"},{tagName:"text",selector:"headerText"},{tagName:"text",selector:"bodyText"}]});var f=10;joint.dia.Element.define("standard.Cylinder",{attrs:{body:{lateralArea:f,fill:"#FFFFFF",stroke:"#333333",strokeWidth:2},top:{refCx:"50%",cy:f,refRx:"50%",ry:f,fill:"#FFFFFF",stroke:"#333333",strokeWidth:2},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"100%",refY2:15,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],topRy:function(a,c){ +if(void 0===a)return this.attr("body/lateralArea");var d=b.isPercentage(a),e={lateralArea:a},f=d?{refCy:a,refRy:a,cy:null,ry:null}:{refCy:null,refRy:null,cy:a,ry:a};return this.attr({body:e,top:f},c)}},{attributes:{lateralArea:{set:function(a,c){var e=b.isPercentage(a);e&&(a=parseFloat(a)/100);var f=c.x,g=c.y,h=c.width,i=c.height,j=h/2,k=e?i*a:a,l=d.KAPPA,m=l*j,n=l*(e?i*a:a),o=f,p=f+h/2,q=f+h,r=g+k,s=r-k,t=g+i-k,u=g+i,v=["M",o,r,"L",o,t,"C",f,t+n,p-m,u,p,u,"C",p+m,u,q,t+n,q,t,"L",q,r,"C",q,r-n,p+m,s,p,s,"C",p-m,s,o,r-n,o,r,"Z"];return{d:v.join(" ")}}}}});var g={tagName:"foreignObject",selector:"foreignObject",attributes:{overflow:"hidden"},children:[{tagName:"div",namespaceURI:"http://www.w3.org/1999/xhtml",selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]},h={tagName:"text",selector:"label",attributes:{"text-anchor":"middle"}},i=c.test("svgforeignobject")?g:h;e.define("standard.TextBlock",{attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#ffffff",strokeWidth:2},foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}}},{markup:[{tagName:"rect",selector:"body"},i]},{attributes:{text:{set:function(c,d,e,f){if(!(e instanceof HTMLElement)){var g=f.style||{},h={text:c,width:-5,height:"100%"},i=b.assign({textVerticalAnchor:"middle"},g);return a.attributes.textWrap.set.call(this,h,d,e,i),{fill:g.color||null}}e.textContent=c},position:function(a,b,c){if(c instanceof SVGElement)return b.center()}}}});var j=a.Link;j.define("standard.Link",{attrs:{line:{connection:!0,stroke:"#333333",strokeWidth:2,strokeLinejoin:"round",targetMarker:{type:"path",d:"M 10 -5 0 0 10 5 z"}},wrapper:{connection:!0,strokeWidth:10,strokeLinejoin:"round"}}},{markup:[{tagName:"path",selector:"wrapper",attributes:{fill:"none",cursor:"pointer",stroke:"transparent"}},{tagName:"path",selector:"line",attributes:{fill:"none","pointer-events":"none"}}]}),j.define("standard.DoubleLink",{attrs:{line:{connection:!0,stroke:"#DDDDDD",strokeWidth:4,strokeLinejoin:"round",targetMarker:{type:"path",stroke:"#000000",d:"M 10 -3 10 -10 -2 0 10 10 10 3"}},outline:{connection:!0,stroke:"#000000",strokeWidth:6,strokeLinejoin:"round"}}},{markup:[{tagName:"path",selector:"outline",attributes:{fill:"none"}},{tagName:"path",selector:"line",attributes:{fill:"none"}}]}),j.define("standard.ShadowLink",{attrs:{line:{connection:!0,stroke:"#FF0000",strokeWidth:20,strokeLinejoin:"round",targetMarker:{type:"path",stroke:"none",d:"M 0 -10 -10 0 0 10 z"},sourceMarker:{type:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z"}},shadow:{connection:!0,refX:3,refY:6,stroke:"#000000",strokeOpacity:.2,strokeWidth:20,strokeLinejoin:"round",targetMarker:{type:"path",d:"M 0 -10 -10 0 0 10 z",stroke:"none"},sourceMarker:{type:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z"}}}},{markup:[{tagName:"path",selector:"shadow",attributes:{fill:"none"}},{tagName:"path",selector:"line",attributes:{fill:"none"}}]})}(joint.dia,joint.util,joint.env,V),joint.routers.manhattan=function(a,b,c){"use strict";function d(a){this.map={},this.options=a,this.mapGridSize=100}function e(){this.items=[],this.hash={},this.values={},this.OPEN=1,this.CLOSE=2}function f(a,b){return b&&b.paddingBox?a.sourceBBox.clone().moveAndExpand(b.paddingBox):a.sourceBBox.clone()}function g(a,b){return b&&b.paddingBox?a.targetBBox.clone().moveAndExpand(b.paddingBox):a.targetBBox.clone()}function h(a,b){if(a.sourceAnchor)return a.sourceAnchor;var c=f(a,b);return c.center()}function i(a,b){if(a.targetAnchor)return a.targetAnchor;var c=g(a,b);return c.center()}function j(b,c,d,e,f){var g=360/d,h=b.theta(k(b,c,e,f)),i=a.normalizeAngle(h+g/2);return g*Math.floor(i/g)}function k(b,c,d,e){var f=e.step,g=c.x-b.x,h=c.y-b.y,i=g/d.x,j=h/d.y,k=i*f,l=j*f;return new a.Point(b.x+k,b.y+l)}function l(a,b){var c=Math.abs(a-b);return c>180?360-c:c}function m(a,b,d){var e=d.step;c.toArray(d.directions).forEach(function(a){a.gridOffsetX=a.offsetX/e*b.x,a.gridOffsetY=a.offsetY/e*b.y})}function n(a,b,c){return{source:b.clone(),x:o(c.x-b.x,a),y:o(c.y-b.y,a)}}function o(a,b){if(!a)return b;var c=Math.abs(a),d=Math.round(c/b);if(!d)return c;var e=d*b,f=c-e,g=f/d;return b+g}function p(b,c){var d=c.source,e=a.snapToGrid(b.x-d.x,c.x)+d.x,f=a.snapToGrid(b.y-d.y,c.y)+d.y;return new a.Point(e,f)}function q(a,b){return a?a.round(b.precision):a}function r(a){return a.clone().round().toString()}function s(b){return new a.Point(0===b.x?0:Math.abs(b.x)/b.x,0===b.y?0:Math.abs(b.y)/b.y)}function t(a,b,c,d,e,f){for(var g,h=[],i=s(e.difference(c)),j=r(c),k=a[j];k;){g=q(b[j],f);var l=s(g.difference(q(k.clone(),f)));l.equals(i)||(h.unshift(g),i=l),j=r(k),k=a[j]}var m=q(b[j],f),n=s(m.difference(d));return n.equals(i)||h.unshift(m),h}function u(a,b){for(var c=1/0,d=0,e=b.length;dj)&&(j=w,t=p(v,f))}var x=q(t,g);x&&(d.containsPoint(x)&&q(x.offset(l.x*f.x,l.y*f.y),g),c.push(x))}return c},[]);return d.containsPoint(i)||n.push(i),n}function w(b,d,f,g){var k,o;k=b instanceof a.Rect?h(this,g).clone():b.clone(),o=d instanceof a.Rect?i(this,g).clone():d.clone();var s,w,x,y,z=n(g.step,k,o);if(b instanceof a.Rect?(s=q(p(k,z),g),x=v(s,b,g.startDirections,z,g)):(s=q(p(k,z),g),x=[s]),d instanceof a.Rect?(w=q(p(o,z),g),y=v(o,d,g.endDirections,z,g)):(w=q(p(o,z),g),y=[w]),x=x.filter(f.isPointAccessible,f),y=y.filter(f.isPointAccessible,f),x.length>0&&y.length>0){for(var A=new e,B={},C={},D={},E=0,F=x.length;E0;){var Q,R=A.pop(),S=B[R],T=C[R],U=D[R],V=void 0===T,W=S.equals(s);if(Q=V?L?W?null:j(s,S,N,z,g):K:j(T,S,N,z,g),O.indexOf(R)>=0)return g.previousDirectionAngle=Q,t(C,B,S,s,w,g);for(E=0;Eg.maxAllowedDirectionChange)){var Y=S.clone().offset(I.gridOffsetX,I.gridOffsetY),Z=r(Y);if(!A.isClose(Z)&&f.isPointAccessible(Y)){if(O.indexOf(Z)>=0){q(Y,g);var $=Y.equals(w);if(!$){var _=j(Y,w,N,z,g),aa=l(X,_);if(aa>g.maxAllowedDirectionChange)continue}}var ba=I.cost,ca=W?0:g.penalties[J],da=U+ba+ca;(!A.isOpen(Z)||da90){var i=f;f=h,h=i}var j=d%90<45?f:h,k=new g.Line(a,j),l=90*Math.ceil(d/90),m=g.Point.fromPolar(k.squaredLength(),g.toRad(l+135),j),n=new g.Line(b,m),o=k.intersection(n),p=o?o:b,q=o?p:a,r=360/c.directions.length,s=q.theta(b),t=g.normalizeAngle(s+r/2),u=r*Math.floor(t/r);return c.previousDirectionAngle=u,p&&e.push(p.round()),e.push(b),e}};return function(c,d,e){if(!a.isFunction(joint.routers.manhattan))throw new Error("Metro requires the manhattan router.");return joint.routers.manhattan(c,a.assign({},b,d),e)}}(joint.util),joint.routers.normal=function(a,b,c){return a},joint.routers.oneSide=function(a,b,c){var d,e,f,g=b.side||"bottom",h=b.padding||40,i=c.sourceBBox,j=c.targetBBox,k=i.center(),l=j.center();switch(g){case"bottom":f=1,d="y",e="height";break;case"top":f=-1,d="y",e="height";break;case"left":f=-1,d="x",e="width";break;case"right":f=1,d="x",e="width";break;default:throw new Error("Router: invalid side")}return k[d]+=f*(i[e]/2+h),l[d]+=f*(j[e]/2+h),f*(k[d]-l[d])>0?l[d]=k[d]:k[d]=l[d],[k].concat(a,l)},joint.routers.orthogonal=function(a){function b(a,b,c){var d=new g.Point(a.x,b.y);return c.containsPoint(d)&&(d=new g.Point(b.x,a.y)),d}function c(a,b){return a["W"===b||"E"===b?"width":"height"]}function d(a,b){return a.x===b.x?a.y>b.y?"N":"S":a.y===b.y?a.x>b.x?"W":"E":null}function e(a){return new g.Rect(a.x,a.y,0,0)}function f(a,b){var c=b&&b.elementPadding||20;return a.sourceBBox.clone().inflate(c)}function h(a,b){var c=b&&b.elementPadding||20;return a.targetBBox.clone().inflate(c)}function i(a,b){if(a.sourceAnchor)return a.sourceAnchor;var c=f(a,b);return c.center()}function j(a,b){if(a.targetAnchor)return a.targetAnchor;var c=h(a,b);return c.center()}function k(a,b,c){var e=new g.Point(a.x,b.y),f=new g.Point(b.x,a.y),h=d(a,e),i=d(a,f),j=q[c],k=h===c||h!==j&&(i===j||i!==c)?e:f;return{points:[k],direction:d(k,b)}}function l(a,c,e){var f=b(a,c,e);return{points:[f],direction:d(f,c)}}function m(e,f,h,i){var j,k={},l=[new g.Point(e.x,f.y),new g.Point(f.x,e.y)],m=l.filter(function(a){return!h.containsPoint(a)}),n=m.filter(function(a){return d(a,e)!==i});if(n.length>0)j=n.filter(function(a){return d(e,a)===i}).pop(),j=j||n[0],k.points=[j],k.direction=d(j,f);else{j=a.difference(l,m)[0];var o=new g.Point(f).move(j,-c(h,i)/2),p=b(o,e,h);k.points=[p,o],k.direction=d(o,f)}return k}function n(a,b,e,f){var h=l(b,a,f),i=h.points[0];if(e.containsPoint(i)){h=l(a,b,e);var j=h.points[0];if(f.containsPoint(j)){var m=new g.Point(a).move(j,-c(e,d(a,j))/2),n=new g.Point(b).move(i,-c(f,d(b,i))/2),o=new g.Line(m,n).midpoint(),p=l(a,o,e),q=k(o,b,p.direction);h.points=[p.points[0],q.points[0]],h.direction=q.direction}}return h}function o(a,c,e,f,h){var i,j,k,l={},m=e.union(f).inflate(1),n=m.center().distance(c)>m.center().distance(a),o=n?c:a,p=n?a:c;return h?(i=g.Point.fromPolar(m.width+m.height,r[h],o),i=m.pointNearestToPoint(i).move(i,-1)):i=m.pointNearestToPoint(o).move(o,1),j=b(i,p,m),i.round().equals(j.round())?(j=g.Point.fromPolar(m.width+m.height,g.toRad(i.theta(o))+Math.PI/2,p),j=m.pointNearestToPoint(j).move(p,1).round(),k=b(i,j,m),l.points=n?[j,k,i]:[i,k,j]):l.points=n?[j,i]:[i,j],l.direction=n?d(i,c):d(j,c),l}function p(b,c,p){var q=c.elementPadding||20,r=f(p,c),s=h(p,c),t=i(p,c),u=j(p,c);r=r.union(e(t)),s=s.union(e(u)),b=a.toArray(b).map(g.Point),b.unshift(t),b.push(u);for(var v,w=[],x=0,y=b.length-1;x=Math.abs(a.y-b.y)){var k=(a.x+b.x)/2;j=g.Path.createSegment("C",k,a.y,k,b.y,b.x,b.y),e.appendSegment(j)}else{var l=(a.y+b.y)/2;j=g.Path.createSegment("C",a.x,l,b.x,l,b.x,b.y),e.appendSegment(j)}}return f?e:e.serialize()},joint.connectors.jumpover=function(a,b){function c(b,c,d){var e=[].concat(b,d,c);return e.reduce(function(b,c,d){var f=e[d+1];return null!=f&&(b[d]=a.line(c,f)),b},[])}function d(a){var b=a.paper._jumpOverUpdateList;null==b&&(b=a.paper._jumpOverUpdateList=[],a.paper.on("cell:pointerup",e),a.paper.model.on("reset",function(){b=a.paper._jumpOverUpdateList=[]})),b.indexOf(a)<0&&(b.push(a),a.listenToOnce(a.model,"change:connector remove",function(){b.splice(b.indexOf(a),1)}))}function e(){for(var a=this._jumpOverUpdateList,b=0;bw)||"jumpover"!==d.name)}),z=y.map(function(a){return s.findViewByModel(a)}),A=c(a,e,l),B=z.map(function(a){return null==a?[]:a===this?A:c(a.sourcePoint,a.targetPoint,a.route)},this),C=A.reduce(function(a,b){var c=y.reduce(function(a,c,d){if(c!==v){var e=f(b,B[d]);a.push.apply(a,e)}return a},[]).sort(function(a,c){return g(b.start,a)-g(b.start,c)});return c.length>0?a.push.apply(a,h(b,c,p)):a.push(b),a},[]),D=i(C,p,q);return o?D:D.serialize()}}(g,joint.util),function(a,b,c){function d(a,c,d){var e=a.toJSON();return e.angle=c||0,b.util.defaults({},d,e)}function e(b,c,e){return b.map(function(a,b,c){var e=this.pointAt((b+.5)/c.length);return(a.dx||a.dy)&&e.offset(a.dx||0,a.dy||0),d(e.round(),0,a)},a.line(c,e))}function f(b,c,e,f){var g=c.center(),h=c.width/c.height,i=c.topMiddle(),j=a.Ellipse.fromRect(c);return b.map(function(a,b,c){var k=e+f(b,c.length),l=i.clone().rotate(g,-k).scale(h,1,g),m=a.compensateRotation?-j.tangentTheta(l):0;return(a.dx||a.dy)&&l.offset(a.dx||0,a.dy||0),a.dr&&l.move(g,a.dr),d(l.round(),m,a)})}function g(b,d){var e=d.x;c.isString(e)&&(e=parseFloat(e)/100*b.width);var f=d.y;return c.isString(f)&&(f=parseFloat(f)/100*b.height),a.point(e||0,f||0)}b.layout.Port={absolute:function(a,b,c){return a.map(g.bind(null,b))},fn:function(a,b,c){return c.fn(a,b,c)},line:function(a,b,c){var d=g(b,c.start||b.origin()),f=g(b,c.end||b.corner());return e(a,d,f)},left:function(a,b,c){return e(a,b.origin(),b.bottomLeft())},right:function(a,b,c){return e(a,b.topRight(),b.corner())},top:function(a,b,c){return e(a,b.origin(),b.topRight())},bottom:function(a,b,c){return e(a,b.bottomLeft(),b.corner())},ellipseSpread:function(a,b,c){var d=c.startAngle||0,e=c.step||360/a.length;return f(a,b,d,function(a){return a*e})},ellipse:function(a,b,c){var d=c.startAngle||0,e=c.step||20;return f(a,b,d,function(a,b){return(a+.5-b/2)*e})}}}(g,joint,joint.util),function(a,b,c){function d(a,b){return c.defaultsDeep({},a,b,{x:0,y:0,angle:0,attrs:{".":{y:"0","text-anchor":"start"}}})}function e(a,b,e,g){g=c.defaults({},g,{offset:15});var h,i,j,k,l=b.center().theta(a),m=f(b),n=g.offset,o=0;lm[2]?(j=".3em",h=n,i=0,k="start"):lo[2]?(k=".3em",i=-m,j=0,l="end"):h-270&&i<-90?(g="start",j=i-180):g="end";var m=Math.round;return d({x:m(k.x),y:m(k.y),angle:e?j:0,attrs:{".":{y:l,"text-anchor":g}}})}b.layout.PortLabel={manual:function(a,b,c){return d(c,b)},left:function(a,b,c){return d(c,{x:-15,attrs:{".":{y:".3em","text-anchor":"end"}}})},right:function(a,b,c){return d(c,{x:15,attrs:{".":{y:".3em","text-anchor":"start"}}})},top:function(a,b,c){return d(c,{y:-15,attrs:{".":{"text-anchor":"middle"}}})},bottom:function(a,b,c){return d(c,{y:15,attrs:{".":{y:".6em","text-anchor":"middle"}}})},outsideOriented:function(a,b,c){return e(a,b,!0,c)},outside:function(a,b,c){return e(a,b,!1,c)},insideOriented:function(a,b,c){return g(a,b,!0,c)},inside:function(a,b,c){return g(a,b,!1,c)},radial:function(a,b,c){return h(a.difference(b.center()),!1,c)},radialOriented:function(a,b,c){return h(a.difference(b.center()),!0,c)}}}(g,joint,joint.util),joint.highlighters.addClass={className:joint.util.addClassNamePrefix("highlighted"),highlight:function(a,b,c){var d=c||{},e=d.className||this.className;V(b).addClass(e)},unhighlight:function(a,b,c){var d=c||{},e=d.className||this.className;V(b).removeClass(e)}},joint.highlighters.opacity={highlight:function(a,b){V(b).addClass(joint.util.addClassNamePrefix("highlight-opacity"))},unhighlight:function(a,b){V(b).removeClass(joint.util.addClassNamePrefix("highlight-opacity"))}},joint.highlighters.stroke={defaultOptions:{padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},_views:{},getHighlighterId:function(a,b){return a.id+JSON.stringify(b)},removeHighlighter:function(a){this._views[a]&&(this._views[a].remove(),this._views[a]=null)},highlight:function(a,b,c){var d=this.getHighlighterId(b,c);if(!this._views[d]){var e,f=joint.util.defaults(c||{},this.defaultOptions),g=V(b);try{var h=g.convertToPathData()}catch(a){e=g.bbox(!0),h=V.rectToPath(joint.util.assign({},f,e))}var i=V("path").attr({d:h,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"}).attr(f.attrs),j=g.getTransformToElement(a.el),k=f.padding;if(k){e||(e=g.bbox(!0));var l=e.x+e.width/2,m=e.y+e.height/2;e=V.transformRect(e,j);var n=Math.max(e.width,1),o=Math.max(e.height,1),p=(n+k)/n,q=(o+k)/o,r=V.createSVGMatrix({a:p,b:0,c:0,d:q,e:l-p*l,f:m-q*m});j=j.multiply(r)}i.transform(j);var s=this._views[d]=new joint.mvc.View({svgElement:!0,className:"highlight-stroke",el:i.node}),t=this.removeHighlighter.bind(this,d),u=a.model;s.listenTo(u,"remove",t),s.listenTo(u.graph,"reset",t),a.vel.append(i)}},unhighlight:function(a,b,c){this.removeHighlighter(this.getHighlighterId(b,c))}},function(a,b){function c(a){return function(c,d,e,f){var g=!!f.rotate,h=g?c.getNodeUnrotatedBBox(d):c.getNodeBBox(d),i=h[a](),j=f.dx;if(j){var k=b.isPercentage(j);j=parseFloat(j),isFinite(j)&&(k&&(j/=100,j*=h.width),i.x+=j)}var l=f.dy;if(l){var m=b.isPercentage(l);l=parseFloat(l),isFinite(l)&&(m&&(l/=100,l*=h.height),i.y+=l)}return g?i.rotate(c.model.getBBox().center(),-c.model.angle()):i}}function d(a){return function(b,c,d,e){if(d instanceof Element){var f=this.paper.findView(d),h=f?f.getNodeBBox(d).center():new g.Point;return a.call(this,b,c,h,e)}return a.apply(this,arguments)}}function e(a,b,c,d){var e=a.model.angle(),f=a.getNodeBBox(b),h=f.center(),i=f.origin(),j=f.corner(),k=d.padding;if(isFinite(k)||(k=0),i.y+k<=c.y&&c.y<=j.y-k){var l=c.y-h.y;h.x+=0===e||180===e?0:1*l/Math.tan(g.toRad(e)),h.y+=l}else if(i.x+k<=c.x&&c.x<=j.x-k){var m=c.x-h.x;h.y+=90===e||270===e?0:m*Math.tan(g.toRad(e)),h.x+=m}return h}function f(a,b,c,d){var e,f,g,h=!!d.rotate;h?(e=a.getNodeUnrotatedBBox(b),g=a.model.getBBox().center(),f=a.model.angle()):e=a.getNodeBBox(b);var i=d.padding;isFinite(i)&&e.inflate(i),h&&c.rotate(g,f);var j,k=e.sideNearestToPoint(c);switch(k){case"left":j=e.leftMiddle();break;case"right":j=e.rightMiddle();break;case"top":j=e.topMiddle();break;case"bottom":j=e.bottomMiddle()}return h?j.rotate(g,-f):j}function h(a,b){var c=a.model,d=c.getBBox(),e=d.center(),f=c.angle(),h=a.findAttribute("port",b);if(h){var i=c.portProp(h,"group"),j=c.getPortsPositions(i),k=new g.Point(j[h]).offset(d.origin());return k.rotate(e,-f),k}return e}a.anchors={center:c("center"),top:c("topMiddle"),bottom:c("bottomMiddle"),left:c("leftMiddle"),right:c("rightMiddle"),topLeft:c("origin"),topRight:c("topRight"),bottomLeft:c("bottomLeft"),bottomRight:c("corner"),perpendicular:d(e),midSide:d(f),modelCenter:h}}(joint,joint.util),function(a,b,c,d){function e(a,c){return 1===a.length?a[0]:b.sortBy(a,function(a){return a.squaredDistance(c)})[0]}function f(a,b,c){if(!isFinite(c))return a;var d=a.distance(b);return 0===c&&d>0?a:a.move(b,-Math.min(c,d-1))}function g(a){var b=a.getAttribute("stroke-width");return null===b?0:parseFloat(b)||0}function h(a,b,c,d){return f(a.end,a.start,d.offset)}function i(a,b,c,d){var h=b.getNodeBBox(c);d.stroke&&h.inflate(g(c)/2);var i=a.intersect(h),j=i?e(i,a.start):a.end;return f(j,a.start,d.offset)}function j(a,b,c,d){var h=b.model.angle();if(0===h)return i(a,b,c,d);var j=b.getNodeUnrotatedBBox(c);d.stroke&&j.inflate(g(c)/2);var k=j.center(),l=a.clone().rotate(k,h),m=l.setLength(1e6).intersect(j),n=m?e(m,l.start).rotate(k,-h):a.end;return f(n,a.start,d.offset)}function k(a,h,i,j){var k,n,o=j.selector,p=a.end;if("string"==typeof o)k=h.findBySelector(o)[0];else if(Array.isArray(o))k=b.getByPath(i,o);else{k=i;do{var q=k.tagName.toUpperCase();if("G"===q)k=k.firstChild;else{if("TITLE"!==q)break;k=k.nextSibling}}while(k)}if(!(k instanceof Element))return p;var r=h.getNodeShape(k),s=h.getNodeMatrix(k),t=h.getRootTranslateMatrix(),u=h.getRootRotateMatrix(),v=t.multiply(u).multiply(s),w=v.inverse(),x=d.transformLine(a,w),y=x.start.clone(),z=h.getNodeData(k);if(j.insideout===!1){z[m]||(z[m]=r.bbox());var A=z[m];if(A.containsPoint(y))return p}var B;if(r instanceof c.Path){var C=j.precision||2;z[l]||(z[l]=r.getSegmentSubdivisions({precision:C})),B={precision:C,segmentSubdivisions:z[l]}}j.extrapolate===!0&&x.setLength(1e6),n=x.intersect(r,B),n?d.isArray(n)&&(n=e(n,y)):j.sticky===!0&&(n=r instanceof c.Rect?r.pointNearestToPoint(y):r instanceof c.Ellipse?r.intersectionWithLineFromCenterToPoint(y):r.closestPoint(y,B));var D=n?d.transformPoint(n,v):p,E=j.offset||0;return j.stroke&&(E+=g(k)/2),f(D,a.start,E)}var l="segmentSubdivisons",m="shapeBBox";a.connectionPoints={anchor:h,bbox:i,rectangle:j,boundary:k}}(joint,joint.util,g,V),function(a,b){function c(a,b){return 0===b?"0%":Math.round(a/b*100)+"%"}function d(a){return function(b,d,e,f){var g=d.model.angle(),h=d.getNodeUnrotatedBBox(e),i=d.model.getBBox().center();f.rotate(i,g);var j=f.x-h.x,k=f.y-h.y;return a&&(j=c(j,h.width),k=c(k,h.height)),b.anchor={name:"topLeft",args:{dx:j,dy:k,rotate:!0}},b}}a.connectionStrategies={useDefaults:b.noop,pinAbsolute:d(!1),pinRelative:d(!0)}}(joint,joint.util),function(a,b,c,d){function e(b,c,d){var e=a.connectionStrategies.pinRelative.call(this.paper,{},c,d,b,this.model);return e.anchor}function f(a,b,c,d,e,f){var g=f.options.snapRadius,h="source"===d,i=h?0:-1,j=this.model.vertex(i)||this.getEndAnchor(h?"target":"source");return j&&(Math.abs(j.x-a.x)0?c[a-1]:b.sourceAnchor,f=a0){var d=this.getNeighborPoints(b),e=d.prev,f=d.next;Math.abs(a.x-e.x) 0xFF) { - throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); + throw new InvalidCharacterError('\'btoa\' failed: The string to be encoded contains characters outside of the Latin1 range.'); } block = block << 8 | charCode; } @@ -90,7 +90,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. object.atob = function(input) { var str = String(input).replace(/=+$/, ''); if (str.length % 4 == 1) { - throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded."); + throw new InvalidCharacterError('\'atob\' failed: The string to be decoded is not correctly encoded.'); } for ( // initialize result and counters @@ -100,8 +100,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. buffer = str.charAt(idx++); // character found in table? initialize bit storage and add its ascii value; ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - // and if not first of each 4 characters, - // convert the first 8 bits to one ascii character + // and if not first of each 4 characters, + // convert the first 8 bits to one ascii character bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 ) { // try to find character in table (0-63, not found => -1) @@ -178,6 +178,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. Object.defineProperty(XMLHttpRequest.prototype, 'response', { get: function() { + /* global VBArray:true */ return new Uint8Array(new VBArray(this.responseBody).toArray()); } }); @@ -282,19 +283,19 @@ if (!Array.prototype.find) { // Production steps of ECMA-262, Edition 6, 22.1.2.1 if (!Array.from) { - Array.from = (function () { + Array.from = (function() { var toStr = Object.prototype.toString; - var isCallable = function (fn) { + var isCallable = function(fn) { return typeof fn === 'function' || toStr.call(fn) === '[object Function]'; }; - var toInteger = function (value) { + var toInteger = function(value) { var number = Number(value); if (isNaN(number)) { return 0; } if (number === 0 || !isFinite(number)) { return number; } return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number)); }; var maxSafeInteger = Math.pow(2, 53) - 1; - var toLength = function (value) { + var toLength = function(value) { var len = toInteger(value); return Math.min(Math.max(len, 0), maxSafeInteger); }; @@ -438,9 +439,9 @@ Number.isNaN = Number.isNaN || function(value) { // Geometry library. // ----------------- -var g = (function() { +var g = {}; - var g = {}; +(function(g) { // Declare shorthands to the most used math functions. var math = Math; @@ -5281,9 +5282,7 @@ var g = (function() { return this.regexSupportedData.test(d); } - return g; - -})(); +})(g); // Vectorizer. // ----------- @@ -5291,8 +5290,8 @@ var g = (function() { // A tiny library for making your life easier when dealing with SVG. // The only Vectorizer dependency is the Geometry library. -var V; -var Vectorizer; +var V; // eslint-disable-line no-unused-vars +var Vectorizer; // eslint-disable-line no-unused-vars V = Vectorizer = (function() { @@ -5455,7 +5454,7 @@ V = Vectorizer = (function() { return transform.translate; } - transformAttr = transformAttr.replace(/translate\([^\)]*\)/g, '').trim(); + transformAttr = transformAttr.replace(/translate\([^)]*\)/g, '').trim(); var newTx = opt.absolute ? tx : transform.translate.tx + tx; var newTy = opt.absolute ? ty : transform.translate.ty + ty; @@ -5480,7 +5479,7 @@ V = Vectorizer = (function() { return transform.rotate; } - transformAttr = transformAttr.replace(/rotate\([^\)]*\)/g, '').trim(); + transformAttr = transformAttr.replace(/rotate\([^)]*\)/g, '').trim(); angle %= 360; @@ -5506,7 +5505,7 @@ V = Vectorizer = (function() { return transform.scale; } - transformAttr = transformAttr.replace(/scale\([^\)]*\)/g, '').trim(); + transformAttr = transformAttr.replace(/scale\([^)]*\)/g, '').trim(); var newScale = 'scale(' + sx + ',' + sy + ')'; @@ -6266,7 +6265,7 @@ V = Vectorizer = (function() { // Fallback for IE 9. // Run the animation programatically if FakeSmile (`http://leunen.me/fakesmile/`) present if (document.documentElement.getAttribute('smiling') === 'fake') { - + /* global getTargets:true, Animator:true, animators:true id2anim:true */ // Register the animation. (See `https://answers.launchpad.net/smil/+question/203333`) var animation = animateMotion.node; animation.animators = []; @@ -6383,7 +6382,7 @@ V = Vectorizer = (function() { }; V.prototype.toGeometryShape = function() { - var x, y, width, height, cx, cy, r, rx, ry, points, d; + var x, y, width, height, cx, cy, r, rx, ry, points, d, x1, x2, y1, y2; switch (this.tagName()) { case 'RECT': @@ -6990,27 +6989,27 @@ V = Vectorizer = (function() { return (da >= svgArcMax) ? (r0 - ? 'M0,' + r1 - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 - + 'M0,' + r0 - + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + (-r0) - + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + r0 - + 'Z' - : 'M0,' + r1 - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 - + 'Z') + ? 'M0,' + r1 + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 + + 'M0,' + r0 + + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + (-r0) + + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + r0 + + 'Z' + : 'M0,' + r1 + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 + + 'Z') : (r0 - ? 'M' + r1 * c0 + ',' + r1 * s0 - + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 - + 'L' + r0 * c1 + ',' + r0 * s1 - + 'A' + r0 + ',' + r0 + ' 0 ' + df + ',0 ' + r0 * c0 + ',' + r0 * s0 - + 'Z' - : 'M' + r1 * c0 + ',' + r1 * s0 - + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 - + 'L0,0' - + 'Z'); + ? 'M' + r1 * c0 + ',' + r1 * s0 + + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 + + 'L' + r0 * c1 + ',' + r0 * s1 + + 'A' + r0 + ',' + r0 + ' 0 ' + df + ',0 ' + r0 * c0 + ',' + r0 * s0 + + 'Z' + : 'M' + r1 * c0 + ',' + r1 * s0 + + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 + + 'L0,0' + + 'Z'); }; // Merge attributes from object `b` with attributes in object `a`. @@ -7745,7 +7744,7 @@ V = Vectorizer = (function() { var joint = { - version: '2.1.3', + version: '2.1.4', config: { // The class name prefix config is for advanced use only. @@ -7979,24 +7978,6 @@ var joint = { return string.replace(/[A-Z]/g, '-$&').toLowerCase(); }, - // Copy all the properties to the first argument from the following arguments. - // All the properties will be overwritten by the properties from the following - // arguments. Inherited properties are ignored. - mixin: _.assign, - - // Copy all properties to the first argument from the following - // arguments only in case if they don't exists in the first argument. - // All the function propererties in the first argument will get - // additional property base pointing to the extenders same named - // property function's call method. - supplement: _.defaults, - - // Same as `mixin()` but deep version. - deepMixin: _.mixin, - - // Same as `supplement()` but deep version. - deepSupplement: _.defaultsDeep, - normalizeEvent: function(evt) { var touchEvt = evt.originalEvent && evt.originalEvent.changedTouches && evt.originalEvent.changedTouches[0]; @@ -8434,7 +8415,7 @@ var joint = { decodedString = unescape(encodeURIComponent(data)); } // write the bytes of the string to a typed array - var ia = new window.Uint8Array(decodedString.length); + var ia = new Uint8Array(decodedString.length); for (var i = 0; i < decodedString.length; i++) { ia[i] = decodedString.charCodeAt(i); } @@ -9075,9 +9056,9 @@ var joint = { value = before + after; return (align === '<' ? negative + value + padding - : align === '>' ? padding + negative + value + : align === '>' ? padding + negative + value : align === '^' ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) - : negative + (zcomma ? value : padding + value)) + fullSuffix; + : negative + (zcomma ? value : padding + value)) + fullSuffix; }, // Formatting string via the Python Format string. @@ -9110,7 +9091,8 @@ var joint = { formattedStringArray.push(pieceFormatedString); formatString = formatString.slice(fieldDelimiterIndex + 1); - fieldDelimiter = (endPlaceholder = !endPlaceholder) ? '}' : '{'; + endPlaceholder = !endPlaceholder; + fieldDelimiter = (endPlaceholder) ? '}' : '{'; } formattedStringArray.push(formatString); @@ -9175,7 +9157,7 @@ var joint = { Must support the variation in templating syntax found here: https://lodash.com/docs#template */ - var regex = /<%= ([^ ]+) %>|\$\{ ?([^\{\} ]+) ?\}|\{\{([^\{\} ]+)\}\}/g; + var regex = /<%= ([^ ]+) %>|\$\{ ?([^{} ]+) ?\}|\{\{([^{} ]+)\}\}/g; return function(data) { @@ -9201,7 +9183,7 @@ var joint = { }, /** - * @param {Element=} el Element, which content is intent to display in full-screen mode, 'window.top.document.body' is default. + * @param {Element} el Element, which content is intent to display in full-screen mode, 'window.top.document.body' is default. */ toggleFullScreen: function(el) { @@ -9375,6 +9357,26 @@ var joint = { } }, + /* global _:true */ + + // Copy all the properties to the first argument from the following arguments. + // All the properties will be overwritten by the properties from the following + // arguments. Inherited properties are ignored. + mixin: _.assign, + + // Copy all properties to the first argument from the following + // arguments only in case if they don't exists in the first argument. + // All the function propererties in the first argument will get + // additional property base pointing to the extenders same named + // property function's call method. + supplement: _.defaults, + + // Same as `mixin()` but deep version. + deepMixin: _.mixin, + + // Same as `supplement()` but deep version. + deepSupplement: _.defaultsDeep, + // lodash 3 vs 4 incompatible sortedIndex: _.sortedIndexBy || _.sortedIndex, uniq: _.uniqBy || _.uniq, @@ -9396,7 +9398,6 @@ var joint = { isPlainObject: _.isPlainObject, isEmpty: _.isEmpty, isEqual: _.isEqual, - noop: function() {}, cloneDeep: _.cloneDeep, toArray: _.toArray, flattenDeep: _.flattenDeep, @@ -9407,25 +9408,6 @@ var joint = { debounce: _.debounce, clone: _.clone, - isBoolean: function(value) { - var toString = Object.prototype.toString; - return value === true || value === false || (!!value && typeof value === 'object' && toString.call(value) === '[object Boolean]'); - }, - - isObject: function(value) { - return !!value && (typeof value === 'object' || typeof value === 'function'); - }, - - isNumber: function(value) { - var toString = Object.prototype.toString; - return typeof value === 'number' || (!!value && typeof value === 'object' && toString.call(value) === '[object Number]'); - }, - - isString: function(value) { - var toString = Object.prototype.toString; - return typeof value === 'string' || (!!value && typeof value === 'object' && toString.call(value) === '[object String]'); - }, - merge: function() { if (_.mergeWith) { var args = Array.from(arguments); @@ -9446,6 +9428,29 @@ var joint = { return _.mergeWith.apply(this, args) } return _.merge.apply(this, arguments); + }, + + /* global _:false */ + + noop: function() {}, + + isBoolean: function(value) { + var toString = Object.prototype.toString; + return value === true || value === false || (!!value && typeof value === 'object' && toString.call(value) === '[object Boolean]'); + }, + + isObject: function(value) { + return !!value && (typeof value === 'object' || typeof value === 'function'); + }, + + isNumber: function(value) { + var toString = Object.prototype.toString; + return typeof value === 'number' || (!!value && typeof value === 'object' && toString.call(value) === '[object Number]'); + }, + + isString: function(value) { + var toString = Object.prototype.toString; + return typeof value === 'string' || (!!value && typeof value === 'object' && toString.call(value) === '[object String]'); } } }; @@ -12403,8 +12408,8 @@ joint.dia.CellView = joint.mvc.View.extend({ can: function(feature) { var interactive = joint.util.isFunction(this.options.interactive) - ? this.options.interactive(this) - : this.options.interactive; + ? this.options.interactive(this) + : this.options.interactive; return (joint.util.isObject(interactive) && interactive[feature] !== false) || (joint.util.isBoolean(interactive) && interactive !== false); @@ -14731,14 +14736,14 @@ joint.dia.Link = joint.dia.Cell.extend({ return label; } -}, - { - endsEqual: function(a, b) { +}, { - var portsEqual = a.port === b.port || !a.port && !b.port; - return a.id === b.id && portsEqual; - } - }); + endsEqual: function(a, b) { + + var portsEqual = a.port === b.port || !a.port && !b.port; + return a.id === b.id && portsEqual; + } +}); // joint.dia.Link base view and controller. @@ -15003,7 +15008,7 @@ joint.dia.LinkView = joint.dia.CellView.extend({ } } - return { fragment: fragment, selectors: {} }; // no selectors + return { fragment: fragment, selectors: {}}; // no selectors }, // Label markup fragment may come wrapped in , or not. @@ -15592,8 +15597,8 @@ joint.dia.LinkView = joint.dia.CellView.extend({ this.targetAnchor.offset(tx, ty); }, - // if label position is a number, normalize it to a position object - // this makes sure that label positions can be merged properly + // if label position is a number, normalize it to a position object + // this makes sure that label positions can be merged properly _normalizeLabelPosition: function(labelPosition) { if (typeof labelPosition === 'number') return { distance: labelPosition, offset: null, args: null }; @@ -16432,12 +16437,11 @@ joint.dia.LinkView = joint.dia.CellView.extend({ // Backwards compatibility var linkTool = V(evt.target).findParentByClass('link-tool', this.el); if (linkTool) { - // No further action to be executed - evt.stopPropagation(); - // Allow `interactive.useLinkTools=false` if (this.can('useLinkTools')) { if (eventName === 'remove') { + // No further action to be executed + evt.stopPropagation(); // Built-in remove event this.model.remove({ ui: true }); @@ -17350,7 +17354,7 @@ joint.dia.Paper = joint.mvc.View.extend({ // Setter: ctm = V.createSVGMatrix(ctm); - ctmString = V.matrixToTransformString(ctm); + var ctmString = V.matrixToTransformString(ctm); viewport.setAttribute('transform', ctmString); this.tools.setAttribute('transform', ctmString); @@ -18549,7 +18553,7 @@ joint.dia.Paper = joint.mvc.View.extend({ add: function(id, vel) { V(this.root.node.childNodes[0]).append(vel); this.patterns[id] = vel; - this.root.append(V('rect', { width: "100%", height: "100%", fill: 'url(#' + id + ')' })); + this.root.append(V('rect', { width: '100%', height: '100%', fill: 'url(#' + id + ')' })); }, get: function(id) { return this.patterns[id] @@ -19108,7 +19112,7 @@ joint.dia.Paper = joint.mvc.View.extend({ } }); -(function(joint, _, util) { +(function(joint, util) { var PortData = function(data) { @@ -19346,7 +19350,8 @@ joint.dia.Paper = joint.mvc.View.extend({ */ hasPorts: function() { - return this.prop('ports/items').length > 0; + var ports = this.prop('ports/items'); + return Array.isArray(ports) && ports.length > 0; }, /** @@ -19372,7 +19377,7 @@ joint.dia.Paper = joint.mvc.View.extend({ */ getPort: function(id) { - return util.cloneDeep(util.toArray(this.prop('ports/items')).find( function(port) { + return util.cloneDeep(util.toArray(this.prop('ports/items')).find(function(port) { return port.id && port.id === id; })); }, @@ -19893,7 +19898,7 @@ joint.dia.Paper = joint.mvc.View.extend({ } }); -}(joint, _, joint.util)); +}(joint, joint.util)); joint.dia.Element.define('basic.Generic', { attrs: { @@ -20178,7 +20183,7 @@ joint.shapes.basic.PortsModelInterface = { selector = '.outPorts'; index = this.get('outPorts').indexOf(name); - if (index < 0) throw new Error("getPortSelector(): Port doesn't exist."); + if (index < 0) throw new Error('getPortSelector(): Port doesn\'t exist.'); } return selector + '>g:nth-child(' + (index + 1) + ')>.port-body'; @@ -20853,6 +20858,8 @@ joint.shapes.basic.TextBlockView = joint.dia.ElementView.extend({ } }; + var labelMarkup = (env.test('svgforeignobject')) ? foLabelMarkup : svgLabelMarkup; + Element.define('standard.TextBlock', { attrs: { body: { @@ -20876,9 +20883,7 @@ joint.shapes.basic.TextBlockView = joint.dia.ElementView.extend({ markup: [{ tagName: 'rect', selector: 'body' - }, - (env.test('svgforeignobject')) ? foLabelMarkup : svgLabelMarkup - ] + }, labelMarkup] }, { attributes: { text: { @@ -21036,7 +21041,7 @@ joint.shapes.basic.TextBlockView = joint.dia.ElementView.extend({ })(joint.dia, joint.util, joint.env, V); -joint.routers.manhattan = (function(g, _, joint, util) { +joint.routers.manhattan = (function(g, joint, util) { 'use strict'; @@ -21835,7 +21840,7 @@ joint.routers.manhattan = (function(g, _, joint, util) { return router(vertices, util.assign({}, config, opt), linkView); }; -})(g, _, joint, joint.util); +})(g, joint, joint.util); joint.routers.metro = (function(util) { @@ -22414,7 +22419,7 @@ joint.connectors.smooth = function(sourcePoint, targetPoint, route, opt) { return (raw) ? path : path.serialize(); }; -joint.connectors.jumpover = (function(_, g, util) { +joint.connectors.jumpover = (function(g, util) { // default size of jump if not specified in options var JUMP_SIZE = 5; @@ -22776,9 +22781,9 @@ joint.connectors.jumpover = (function(_, g, util) { var path = buildPath(jumpingLines, jumpSize, jumpType); return (raw) ? path : path.serialize(); }; -}(_, g, joint.util)); +}(g, joint.util)); -(function(_, g, joint, util) { +(function(g, joint, util) { function portTransformAttrs(point, angle, opt) { @@ -22958,9 +22963,9 @@ joint.connectors.jumpover = (function(_, g, util) { } }; -})(_, g, joint, joint.util); +})(g, joint, joint.util); -(function(_, g, joint, util) { +(function(g, joint, util) { function labelAttributes(opt1, opt2) { @@ -23151,19 +23156,19 @@ joint.connectors.jumpover = (function(_, g, util) { }, left: function(portPosition, elBBox, opt) { - return labelAttributes(opt, { x: -15, attrs: { '.': { y: '.3em', 'text-anchor': 'end' } } }); + return labelAttributes(opt, { x: -15, attrs: { '.': { y: '.3em', 'text-anchor': 'end' }}}); }, right: function(portPosition, elBBox, opt) { - return labelAttributes(opt, { x: 15, attrs: { '.': { y: '.3em', 'text-anchor': 'start' } } }); + return labelAttributes(opt, { x: 15, attrs: { '.': { y: '.3em', 'text-anchor': 'start' }}}); }, top: function(portPosition, elBBox, opt) { - return labelAttributes(opt, { y: -15, attrs: { '.': { 'text-anchor': 'middle' } } }); + return labelAttributes(opt, { y: -15, attrs: { '.': { 'text-anchor': 'middle' }}}); }, bottom: function(portPosition, elBBox, opt) { - return labelAttributes(opt, { y: 15, attrs: { '.': { y: '.6em', 'text-anchor': 'middle' } } }); + return labelAttributes(opt, { y: 15, attrs: { '.': { y: '.6em', 'text-anchor': 'middle' }}}); }, outsideOriented: function(portPosition, elBBox, opt) { @@ -23191,7 +23196,7 @@ joint.connectors.jumpover = (function(_, g, util) { } }; -})(_, g, joint, joint.util); +})(g, joint, joint.util); joint.highlighters.addClass = { @@ -23485,7 +23490,7 @@ joint.highlighters.stroke = { var portId = view.findAttribute('port', magnet); if (portId) { - portGroup = model.portProp(portId, 'group'); + var portGroup = model.portProp(portId, 'group'); var portsPositions = model.getPortsPositions(portGroup); var anchor = new g.Point(portsPositions[portId]).offset(bbox.origin()); anchor.rotate(center, -angle); @@ -23620,7 +23625,6 @@ joint.highlighters.stroke = { if (localShape instanceof g.Path) { var precision = opt.precision || 2; if (!data[BNDR_SUBDIVISIONS]) data[BNDR_SUBDIVISIONS] = localShape.getSegmentSubdivisions({ precision: precision }); - segmentSubdivisions = data[BNDR_SUBDIVISIONS]; pathOpt = { precision: precision, segmentSubdivisions: data[BNDR_SUBDIVISIONS] @@ -24128,7 +24132,7 @@ joint.highlighters.stroke = { // we left the area of the source magnet for the first time vertices.unshift(vertex); this.shiftHandleIndexes(1); - delateSourceAnchor = true; + deleteSourceAnchor = true; } } else if (index === 0) { if (sourceBBox.containsPoint(vertex)) { @@ -24763,7 +24767,7 @@ joint.shapes.erd.Attribute.define('erd.Key', { }); joint.shapes.erd.Attribute.define('erd.Normal', { - attrs: { text: { text: 'Normal' } } + attrs: { text: { text: 'Normal' }} }); joint.dia.Element.define('erd.ISA', { @@ -24786,7 +24790,7 @@ joint.dia.Element.define('erd.ISA', { joint.dia.Link.define('erd.Line', {}, { cardinality: function(value) { - this.set('labels', [{ position: -20, attrs: { text: { dy: -8, text: value } } }]); + this.set('labels', [{ position: -20, attrs: { text: { dy: -8, text: value }}}]); } }); @@ -24831,7 +24835,7 @@ joint.dia.Element.define('fsa.EndState', { }); joint.dia.Link.define('fsa.Arrow', { - attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' } }, + attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' }}, smooth: true }); @@ -24870,7 +24874,7 @@ joint.dia.Element.define('org.Member', { joint.dia.Link.define('org.Arrow', { source: { selector: '.card' }, target: { selector: '.card' }, - attrs: { '.connection': { stroke: '#585858', 'stroke-width': 3 } }, + attrs: { '.connection': { stroke: '#585858', 'stroke-width': 3 }}, z: -1 }); @@ -25065,7 +25069,7 @@ joint.shapes.basic.Generic.define('pn.Transition', { }); joint.dia.Link.define('pn.Link', { - attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' } } + attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' }} }); /** @@ -25397,7 +25401,7 @@ joint.shapes.uml.Class.define('uml.Interface', { joint.shapes.uml.InterfaceView = joint.shapes.uml.ClassView; joint.dia.Link.define('uml.Generalization', { - attrs: { '.marker-target': { d: 'M 20 0 L 0 10 L 20 20 z', fill: 'white' } } + attrs: { '.marker-target': { d: 'M 20 0 L 0 10 L 20 20 z', fill: 'white' }} }); joint.dia.Link.define('uml.Implementation', { @@ -25408,11 +25412,11 @@ joint.dia.Link.define('uml.Implementation', { }); joint.dia.Link.define('uml.Aggregation', { - attrs: { '.marker-target': { d: 'M 40 10 L 20 20 L 0 10 L 20 0 z', fill: 'white' } } + attrs: { '.marker-target': { d: 'M 40 10 L 20 20 L 0 10 L 20 0 z', fill: 'white' }} }); joint.dia.Link.define('uml.Composition', { - attrs: { '.marker-target': { d: 'M 40 10 L 20 20 L 0 10 L 20 0 z', fill: 'black' } } + attrs: { '.marker-target': { d: 'M 40 10 L 20 20 L 0 10 L 20 0 z', fill: 'black' }} }); joint.dia.Link.define('uml.Association'); @@ -25491,7 +25495,7 @@ joint.shapes.basic.Generic.define('uml.State', { joint.shapes.basic.Circle.define('uml.StartState', { type: 'uml.StartState', - attrs: { circle: { 'fill': '#34495e', 'stroke': '#2c3e50', 'stroke-width': 2, 'rx': 1 } } + attrs: { circle: { 'fill': '#34495e', 'stroke': '#2c3e50', 'stroke-width': 2, 'rx': 1 }} }); joint.shapes.basic.Generic.define('uml.EndState', { @@ -25589,7 +25593,7 @@ joint.shapes.logic.Gate.define('logic.Gate21', { }); joint.shapes.logic.Gate11.define('logic.Repeater', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHdpZHRoPSIxMDAiCiAgIGhlaWdodD0iNTAiCiAgIGlkPSJzdmcyIgogICBzb2RpcG9kaTp2ZXJzaW9uPSIwLjMyIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjQ2IgogICB2ZXJzaW9uPSIxLjAiCiAgIHNvZGlwb2RpOmRvY25hbWU9Ik5PV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@ -25597,7 +25601,7 @@ joint.shapes.logic.Gate11.define('logic.Repeater', { }); joint.shapes.logic.Gate11.define('logic.Not', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHdpZHRoPSIxMDAiCiAgIGhlaWdodD0iNTAiCiAgIGlkPSJzdmcyIgogICBzb2RpcG9kaTp2ZXJzaW9uPSIwLjMyIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjQ2IgogICB2ZXJzaW9uPSIxLjAiCiAgIHNvZGlwb2RpOmRvY25hbWU9Ik5PVCBBTlNJLnN2ZyIKICAgaW5rc2NhcGU6b3V0cHV0X2V4dGVuc2lvbj0ib3JnLmlua3NjYXBlLm91dHB1dC5zdmcuaW5rc2NhcGUiPgogIDxkZWZzCiAgICAgaWQ9ImRlZn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apes.logic.Gate11.define('logic.Not', { }); joint.shapes.logic.Gate21.define('logic.Or', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHdpZHRoPSIxMDAiCiAgIGhlaWdodD0iNTAiCiAgIGlkPSJzdmcyIgogICBzb2RpcG9kaTp2ZXJzaW9uPSIwLjMyIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjQ2IgogICB2ZXJzaW9uPSIxLjAiCiAgIHNvZGlwb2RpOmRvY25hbWU9Ik9SIEFOU0kuc3ZnIgogICBpbmtzY2FwZTpvdXRwdXRfZXh0ZW5zaW9uPSJvcmcuaW5rc2NhcGUub3V0cHV0LnN2Zy5pbmtzY2FwZSI+CiAgPGRlZnMKICAgICBpZD0iZGVmczQiPgogICAgPGlua3NjYXBlOnBl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TU5IDE5LjUwNjU3NCw0NC41IDE0Ljc1LDQ0LjUgTCAwLjc1LDQ0LjUgTCAtMi40MDYyNSw0NC41IHogTSAzLjQ2ODc1LDQ3LjUgTCAxNC43NSw0Ny41IEMgMTkuNDM0MTczLDQ3LjUgMzMuMDM2ODUsNDcuMzY5NzkzIDQyLjcxODc1LDY0LjUgQyAzNy45NTE5NjQsNzIuOTI5MDc1IDMyLjE5NzQ2OSw3Ny4xODM5MSAyNyw3OS4zMTI1IEMgMjEuNjM5MzM5LDgxLjUwNzkyNCAxNy4xNTgwNzUsODEuNTAwMDAxIDE0Ljc1LDgxLjUgTCAzLjUsODEuNSBDIDUuMzczNTg4NCw3OC4zOTE1NjYgOC4yNSw3Mi40NTA2NSA4LjI1LDY0LjUgQyA4LjI1LDU2LjUyNjY0NiA1LjM0MTQ2ODYsNTAuNTk5ODE1IDMuNDY4NzUsNDcuNSB6IgogICAgICAgICBpZD0icGF0aDQ5NzMiCiAgICAgICAgIHNvZGlwb2RpOm5vZGV0eXBlcz0iY2NzY2NjY3NjY2NjY2NjY2NzY2NzYyIgLz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo=' }} }, { operation: function(input1, input2) { return input1 || input2; @@ -25613,7 +25617,7 @@ joint.shapes.logic.Gate21.define('logic.Or', { }); joint.shapes.logic.Gate21.define('logic.And', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd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ICAgICAgaWQ9InBhdGgyODg0IgogICAgICAgc29kaXBvZGk6bm9kZXR5cGVzPSJjY2NjY2NzY2NjY3Nzc3NzY2NjIiAvPgogIDwvZz4KPC9zdmc+Cg==' }} }, { operation: function(input1, input2) { @@ -25622,7 +25626,7 @@ joint.shapes.logic.Gate21.define('logic.And', { }); joint.shapes.logic.Gate21.define('logic.Nor', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHdpZHRoPSIxMDAiCiAgIGhlaWdodD0iNTAiCiAgIGlkPSJzdmcyIgogICBzb2RpcG9kaTp2ZXJzaW9uPSIwLjMyIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjQ2IgogICB2ZXJzaW9uPSIxLjAiCiAgIHNvZGlwb2RpOmRvY25hbWU9Ik5PU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Sw4MS41IEwgMy41LDgxLjUgQyA1LjM3MzU4ODQsNzguMzkxNTY2IDguMjUsNzIuNDUwNjUgOC4yNSw2NC41IEMgOC4yNSw1Ni41MjY2NDYgNS4zNDE0Njg2LDUwLjU5OTgxNSAzLjQ2ODc1LDQ3LjUgeiIKICAgICAgICAgaWQ9InBhdGg0OTczIgogICAgICAgICBzb2RpcG9kaTpub2RldHlwZXM9ImNjc2NjY2NzY2NjY2NjY2Njc2Njc2MiIC8+CiAgICAgIDxwYXRoCiAgICAgICAgIHNvZGlwb2RpOnR5cGU9ImFyYyIKICAgICAgICAgc3R5bGU9ImZpbGw6bm9uZTtmaWxsLW9wYWNpdHk6MTtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MztzdHJva2UtbGluZWpvaW46bWl0ZXI7bWFya2VyOm5vbmU7c3Ryb2tlLW9wYWNpdHk6MTt2aXNpYmlsaXR5OnZpc2libGU7ZGlzcGxheTppbmxpbmU7b3ZlcmZsb3c6dmlzaWJsZTtlbmFibGUtYmFja2dyb3VuZDphY2N1bXVsYXRlIgogICAgICAgICBpZD0icGF0aDI2MDQiCiAgICAgICAgIHNvZGlwb2RpOmN4PSI3NSIKICAgICAgICAgc29kaXBvZGk6Y3k9IjI1IgogICAgICAgICBzb2RpcG9kaTpyeD0iNCIKICAgICAgICAgc29kaXBvZGk6cnk9IjQiCiAgICAgICAgIGQ9Ik0gNzksMjUgQSA0LDQgMCAxIDEgNzEsMjUgQSA0LDQgMCAxIDEgNzksMjUgeiIKICAgICAgICAgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI2LjUsMzkuNSkiIC8+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K' }} }, { operation: function(input1, input2) { return !(input1 || input2); @@ -25630,7 +25634,7 @@ joint.shapes.logic.Gate21.define('logic.Nor', { }); joint.shapes.logic.Gate21.define('logic.Nand', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4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mMiCiAgICAgICBzdHlsZT0iZmlsbDpub25lO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDozO3N0cm9rZS1saW5lam9pbjptaXRlcjttYXJrZXI6bm9uZTtzdHJva2Utb3BhY2l0eToxO3Zpc2liaWxpdHk6dmlzaWJsZTtkaXNwbGF5OmlubGluZTtvdmVyZmxvdzp2aXNpYmxlO2VuYWJsZS1iYWNrZ3JvdW5kOmFjY3VtdWxhdGUiCiAgICAgICBpZD0icGF0aDQwMDgiCiAgICAgICBzb2RpcG9kaTpjeD0iNzUiCiAgICAgICBzb2RpcG9kaTpjeT0iMjUiCiAgICAgICBzb2RpcG9kaTpyeD0iNCIKICAgICAgIHNvZGlwb2RpOnJ5PSI0IgogICAgICAgZD0iTSA3OSwyNSBBIDQsNCAwIDEgMSA3MSwyNSBBIDQsNCAwIDEgMSA3OSwyNSB6IiAvPgogIDwvZz4KPC9zdmc+Cg==' }} }, { operation: function(input1, input2) { return !(input1 && input2); @@ -25638,7 +25642,7 @@ joint.shapes.logic.Gate21.define('logic.Nand', { }); joint.shapes.logic.Gate21.define('logic.Xor', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3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OTM4MTE2IgogICAgIGlua3NjYXBlOmN5PSIxNy4yMzAwNSIKICAgICBpbmtzY2FwZTpkb2N1bWVudC11bml0cz0icHgiCiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0ibGF5ZXIxIgogICAgIHNob3dncmlkPSJ0cnVlIgogICAgIGlua3NjYXBlOmdyaWQtYmJveD0idHJ1ZSIKICAgICBpbmtzY2FwZTpncmlkLXBvaW50cz0idHJ1ZSIKICAgICBncmlkdG9sZXJhbmNlPSIxMDAwMCIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjEzOTkiCiAgICAgaW5rc2NhcGU6d2luZG93LWhlaWdodD0iODc0IgogICAgIGlua3NjYXBlOndpbmRvdy14PSIzMyIKICAgICBpbmtzY2FwZTp3aW5kb3cteT0iMCIKICAgICBpbmtzY2FwZTpzbmFwLWJib3g9InRydWUiPgogICAgPGlua3NjYXBlOmdyaWQKICAgICAgIGlkPSJHcmlkRnJvbVByZTA0NlNldHRpbmdzIgogICAgICAgdHlwZT0ieHlncmlkIgogICAgICAgb3JpZ2lueD0iMHB4IgogICAgICAgb3JpZ2lueT0iMHB4IgogICAgICAgc3BhY2luZ3g9IjFweCIKICAgICAgIHNwYWNpbmd5PSIxcHgiCiAgICAgICBjb2xvcj0iIzAwMDBmZiIKICAgICAgIGVtcGNvbG9yPSIjMDAwMGZmIgogICAgICAgb3BhY2l0eT0iMC4yIgogICAgICAgZW1wb3BhY2l0eT0iMC40IgogICAgICAgZW1wc3BhY2luZz0iNSIKICAgICAgIHZpc2libGU9InRydWUiCiAgICAgICBlbmFibGVkPSJ0cnVlIiAvPgogIDwvc29kaXBvZGk6bmFtZWR2aWV3PgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTciPgogICAgPHJkZjpSREY+CiAgICAgIDxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj4KICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZv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Dg0LjUgQyAxNy4xNTgwNzYsODQuNTAwMDAxIDIyLjQzOTY5OSw4NC41MjQ1MTQgMjguMzc1LDgyLjA5Mzc1IEMgMzQuMzEwMzAxLDc5LjY2Mjk4NiA0MC45MTE1MzYsNzQuNzUwNDg0IDQ2LjA2MjUsNjUuMjE4NzUgTCA0NC43NSw2NC41IEwgNDYuMDYyNSw2My43ODEyNSBDIDM1Ljc1OTM4Nyw0NC43MTU1OSAxOS41MDY1NzQsNDQuNSAxNC43NSw0NC41IEwgMC43NSw0NC41IEwgLTIuNDA2MjUsNDQuNSB6IE0gMy40Njg3NSw0Ny41IEwgMTQuNzUsNDcuNSBDIDE5LjQzNDE3Myw0Ny41IDMzLjAzNjg1LDQ3LjM2OTc5MyA0Mi43MTg3NSw2NC41IEMgMzcuOTUxOTY0LDcyLjkyOTA3NSAzMi4xOTc0NjksNzcuMTgzOTEgMjcsNzkuMzEyNSBDIDIxLjYzOTMzOSw4MS41MDc5MjQgMTcuMTU4MDc1LDgxLjUwMDAwMSAxNC43NSw4MS41IEwgMy41LDgxLjUgQyA1LjM3MzU4ODQsNzguMzkxNTY2IDguMjUsNzIuNDUwNjUgOC4yNSw2NC41IEMgOC4yNSw1Ni41MjY2NDYgNS4zNDE0Njg2LDUwLjU5OTgxNSAzLjQ2ODc1LDQ3LjUgeiIKICAgICAgICAgaWQ9InBhdGg0OTczIgogICAgICAgICBzb2RpcG9kaTpub2RldHlwZXM9ImNjc2NjY2NzY2NjY2NjY2Njc2Njc2MiIC8+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K' }} }, { operation: function(input1, input2) { return (!input1 || input2) && (input1 || !input2); @@ -25646,7 +25650,7 @@ joint.shapes.logic.Gate21.define('logic.Xor', { }); joint.shapes.logic.Gate21.define('logic.Xnor', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjw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CIKICAgICAgIHNvZGlwb2RpOnJ5PSI0IgogICAgICAgZD0iTSA3OSwyNSBBIDQsNCAwIDEgMSA3MSwyNSBBIDQsNCAwIDEgMSA3OSwyNSB6IiAvPgogIDwvZz4KPC9zdmc+Cg==' }} }, { operation: function(input1, input2) { return (!input1 || !input2) && (input1 || input2); @@ -25660,7 +25664,7 @@ joint.dia.Link.define('logic.Wire', { }, router: { name: 'orthogonal' }, - connector: { name: 'rounded', args: { radius: 10 } } + connector: { name: 'rounded', args: { radius: 10 }} }, { arrowheadMarkup: [ '', @@ -25758,7 +25762,7 @@ joint.layout.DirectedGraph = { } if (opt.setLabels && ('x' in glEdge) && ('y' in glEdge)) { - var labelPosition = { x: glEdge.x, y: glEdge.y}; + var labelPosition = { x: glEdge.x, y: glEdge.y }; if (joint.util.isFunction(opt.setLabels)) { opt.setLabels(link, labelPosition, points); } else { diff --git a/dist/joint.layout.DirectedGraph.js b/dist/joint.layout.DirectedGraph.js index 01ee20895..457c98154 100644 --- a/dist/joint.layout.DirectedGraph.js +++ b/dist/joint.layout.DirectedGraph.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -82,7 +82,7 @@ joint.layout.DirectedGraph = { } if (opt.setLabels && ('x' in glEdge) && ('y' in glEdge)) { - var labelPosition = { x: glEdge.x, y: glEdge.y}; + var labelPosition = { x: glEdge.x, y: glEdge.y }; if (joint.util.isFunction(opt.setLabels)) { opt.setLabels(link, labelPosition, points); } else { diff --git a/dist/joint.layout.DirectedGraph.min.js b/dist/joint.layout.DirectedGraph.min.js index c7a9bfa8c..2f3e0e02f 100644 --- a/dist/joint.layout.DirectedGraph.min.js +++ b/dist/joint.layout.DirectedGraph.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.min.css b/dist/joint.min.css index d1eefe6d2..8ce44b34d 100644 --- a/dist/joint.min.css +++ b/dist/joint.min.css @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.min.js b/dist/joint.min.js index 13c70510b..00589ac4c 100644 --- a/dist/joint.min.js +++ b/dist/joint.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -44,16 +44,16 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. }(this, function(root, Backbone, _, $) { !function(){function a(a){this.message=a}var b="undefined"!=typeof exports?exports:this,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";a.prototype=new Error,a.prototype.name="InvalidCharacterError",b.btoa||(b.btoa=function(b){for(var d,e,f=String(b),g=0,h=c,i="";f.charAt(0|g)||(h="=",g%1);i+=h.charAt(63&d>>8-g%1*8)){if(e=f.charCodeAt(g+=.75),e>255)throw new a("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");d=d<<8|e}return i}),b.atob||(b.atob=function(b){var d=String(b).replace(/=+$/,"");if(d.length%4==1)throw new a("'atob' failed: The string to be decoded is not correctly encoded.");for(var e,f,g=0,h=0,i="";f=d.charAt(h++);~f&&(e=g%4?64*e+f:f,g++%4)?i+=String.fromCharCode(255&e>>(-2*g&6)):0)f=c.indexOf(f);return i})}(),function(){function a(a,b){return this.slice(a,b)}function b(a,b){arguments.length<2&&(b=0);for(var c=0,d=a.length;c>>0;if(0===e)return!1;for(var f=0|b,g=Math.max(f>=0?f:e-Math.abs(f),0);g>>0;if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var d=arguments[1],e=0;e0?1:-1)*Math.floor(Math.abs(b)):b},d=Math.pow(2,53)-1,e=function(a){var b=c(a);return Math.min(Math.max(b,0),d)};return function(a){var c=this,d=Object(a);if(null==a)throw new TypeError("Array.from requires an array-like object - not null or undefined");var f,g=arguments.length>1?arguments[1]:void 0;if("undefined"!=typeof g){if(!b(g))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(f=arguments[2])}for(var h,i=e(d.length),j=b(c)?Object(new c(i)):new Array(i),k=0;k>>0;if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var d=arguments[1],e=0;ethis.length)&&this.indexOf(a,b)!==-1}),String.prototype.startsWith||(String.prototype.startsWith=function(a,b){return this.substr(b||0,a.length)===a}),Number.isFinite=Number.isFinite||function(a){return"number"==typeof a&&isFinite(a)},Number.isNaN=Number.isNaN||function(a){return a!==a}; -var g=function(){function a(a,b){return b.unshift(null),new(Function.prototype.bind.apply(a,b))}function b(a){var b,c,d=[];for(c=arguments.length,b=1;b=1)return[new q(b,c,d,e),new q(e,e,e,e)];var f=this.getSkeletonPoints(a),g=f.startControlPoint1,h=f.startControlPoint2,i=f.divider,j=f.dividerControlPoint1,k=f.dividerControlPoint2;return[new q(b,g,h,i),new q(i,j,k,e)]},endpointDistance:function(){return this.start.distance(this.end)},equals:function(a){return!!a&&this.start.x===a.start.x&&this.start.y===a.start.y&&this.controlPoint1.x===a.controlPoint1.x&&this.controlPoint1.y===a.controlPoint1.y&&this.controlPoint2.x===a.controlPoint2.x&&this.controlPoint2.y===a.controlPoint2.y&&this.end.x===a.end.x&&this.end.y===a.end.y},getSkeletonPoints:function(a){var b=this.start,c=this.controlPoint1,d=this.controlPoint2,e=this.end;if(a<=0)return{startControlPoint1:b.clone(),startControlPoint2:b.clone(),divider:b.clone(),dividerControlPoint1:c.clone(),dividerControlPoint2:d.clone()};if(a>=1)return{startControlPoint1:c.clone(),startControlPoint2:d.clone(),divider:e.clone(),dividerControlPoint1:e.clone(),dividerControlPoint2:e.clone()};var f=new s(b,c).pointAt(a),g=new s(c,d).pointAt(a),h=new s(d,e).pointAt(a),i=new s(f,g).pointAt(a),j=new s(g,h).pointAt(a),k=new s(i,j).pointAt(a),l={startControlPoint1:f,startControlPoint2:i,divider:k,dividerControlPoint1:j,dividerControlPoint2:h};return l},getSubdivisions:function(a){a=a||{};var b=void 0===a.precision?this.PRECISION:a.precision,c=[new q(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===b)return c;for(var d=this.endpointDistance(),e=p(10,-b),f=0;;){f+=1;for(var g=[],h=c.length,i=0;i1&&r=1)return this.end.clone();var c=this.tAt(a,b);return this.pointAtT(c)},pointAtLength:function(a,b){var c=this.tAtLength(a,b);return this.pointAtT(c)},pointAtT:function(a){return a<=0?this.start.clone():a>=1?this.end.clone():this.getSkeletonPoints(a).divider},PRECISION:3,scale:function(a,b,c){return this.start.scale(a,b,c),this.controlPoint1.scale(a,b,c),this.controlPoint2.scale(a,b,c),this.end.scale(a,b,c),this},tangentAt:function(a,b){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var c=this.tAt(a,b);return this.tangentAtT(c)},tangentAtLength:function(a,b){if(!this.isDifferentiable())return null;var c=this.tAtLength(a,b);return this.tangentAtT(c)},tangentAtT:function(a){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var b=this.getSkeletonPoints(a),c=b.startControlPoint2,d=b.dividerControlPoint1,e=b.divider,f=new s(c,d);return f.translate(e.x-c.x,e.y-c.y),f},tAt:function(a,b){if(a<=0)return 0;if(a>=1)return 1;b=b||{};var c=void 0===b.precision?this.PRECISION:b.precision,d=void 0===b.subdivisions?this.getSubdivisions({precision:c}):b.subdivisions,e={precision:c,subdivisions:d},f=this.length(e),g=f*a;return this.tAtLength(g,e)},tAtLength:function(a,b){var c=!0;a<0&&(c=!1,a=-a),b=b||{};for(var d,e,f,g,h,i=void 0===b.precision?this.PRECISION:b.precision,j=void 0===b.subdivisions?this.getSubdivisions({precision:i}):b.subdivisions,k={precision:i,subdivisions:j},l=0,m=j.length,n=1/m,o=c?0:m-1;c?o=0;c?o++:o--){var q=j[o],r=q.endpointDistance();if(a<=l+r){d=q,e=o*n,f=(o+1)*n,g=c?a-l:r+l-a,h=c?r+l-a:a-l;break}l+=r}if(!d)return c?1:0;for(var s=this.length(k),t=p(10,-i);;){var u;if(u=0!==s?g/s:0,ui.x+g/2,m=ei.x?f-d:f+d,c=g*g/(e-j)-g*g*(f-k)*(b-k)/(h*h*(e-j))+j):(c=f>i.y?e+d:e-d,b=h*h/(f-k)-h*h*(e-j)*(c-j)/(g*g*(f-k))+k),new u(c,b).theta(a)},equals:function(a){return!!a&&a.x===this.x&&a.y===this.y&&a.a===this.a&&a.b===this.b},intersectionWithLine:function(a){var b=[],c=a.start,d=a.end,e=this.a,f=this.b,g=a.vector(),i=c.difference(new u(this)),j=new u(g.x/(e*e),g.y/(f*f)),k=new u(i.x/(e*e),i.y/(f*f)),l=g.dot(j),m=g.dot(k),n=i.dot(k)-1,o=m*m-l*n;if(o<0)return null;if(o>0){var p=h(o),q=(-m-p)/l,r=(-m+p)/l;if((q<0||10){if(f>d||g>d)return null}else if(f=1?c.clone():b.lerp(c,a)},pointAtLength:function(a){var b=this.start,c=this.end,d=!0;a<0&&(d=!1,a=-a);var e=this.length();return a>=e?d?c.clone():b.clone():this.pointAt((d?a:e-a)/e)},pointOffset:function(a){a=new c.Point(a);var b=this.start,d=this.end,e=(d.x-b.x)*(a.y-b.y)-(d.y-b.y)*(a.x-b.x);return e/this.length()},rotate:function(a,b){return this.start.rotate(a,b),this.end.rotate(a,b),this},round:function(a){var b=p(10,a||0);return this.start.x=l(this.start.x*b)/b,this.start.y=l(this.start.y*b)/b,this.end.x=l(this.end.x*b)/b,this.end.y=l(this.end.y*b)/b,this},scale:function(a,b,c){return this.start.scale(a,b,c),this.end.scale(a,b,c),this},setLength:function(a){var b=this.length();if(!b)return this;var c=a/b;return this.scale(c,c,this.start)},squaredLength:function(){var a=this.start.x,b=this.start.y,c=this.end.x,d=this.end.y;return(a-=c)*a+(b-=d)*b},tangentAt:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAt(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},tangentAtLength:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAtLength(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},translate:function(a,b){return this.start.translate(a,b),this.end.translate(a,b),this},vector:function(){return new u(this.end.x-this.start.x,this.end.y-this.start.y)},toString:function(){return this.start.toString()+" "+this.end.toString()}},s.prototype.intersection=s.prototype.intersect;var t=c.Path=function(a){if(!(this instanceof t))return new t(a);if("string"==typeof a)return new t.parse(a);this.segments=[];var b,c;if(a){if(Array.isArray(a)&&0!==a.length)if(c=a.length,a[0].isSegment)for(b=0;b=c||a<0)throw new Error("Index out of range.");return b[a]},getSegmentSubdivisions:function(a){var b=this.segments,c=b.length;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=[],f=0;fd||a<0)throw new Error("Index out of range.");var e,f=null,g=null;if(0!==d&&(a>=1?(f=c[a-1],g=f.nextSegment):g=c[0]),Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");for(var h=b.length,i=0;i=d?(e=d-1,f=1):f<0?f=0:f>1&&(f=1),b=b||{};for(var g,h=void 0===b.precision?this.PRECISION:b.precision,i=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:h}):b.segmentSubdivisions,j=0,k=0;k=1)return this.end.clone();b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.pointAtLength(i,g)},pointAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;if(0===a)return this.start.clone();var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isVisible){if(a<=i+m)return k.pointAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f)return e?f.end:f.start;var n=c[d-1];return n.end.clone()},pointAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].pointAtT(0);if(d>=c)return b[c-1].pointAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].pointAtT(e)},prepareSegment:function(a,b,c){a.previousSegment=b,a.nextSegment=c,b&&(b.nextSegment=a),c&&(c.previousSegment=a);var d=a;return a.isSubpathStart&&(a.subpathStartSegment=a,d=c),d&&this.updateSubpathStartSegment(d),a},PRECISION:3,removeSegment:function(a){var b=this.segments,c=b.length;if(0===c)throw new Error("Path has no segments.");if(a<0&&(a=c+a),a>=c||a<0)throw new Error("Index out of range.");var d=b.splice(a,1)[0],e=d.previousSegment,f=d.nextSegment;e&&(e.nextSegment=f),f&&(f.previousSegment=e),d.isSubpathStart&&f&&this.updateSubpathStartSegment(f)},replaceSegment:function(a,b){var c=this.segments,d=c.length;if(0===d)throw new Error("Path has no segments.");if(a<0&&(a=d+a),a>=d||a<0)throw new Error("Index out of range.");var e,f=c[a],g=f.previousSegment,h=f.nextSegment,i=f.isSubpathStart;if(Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");c.splice(a,1);for(var j=b.length,k=0;k1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.segmentIndexAtLength(i,g)},toPoints:function(a){var b=this.segments,c=b.length;if(0===c)return null;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=void 0===a.segmentSubdivisions?this.getSegmentSubdivisions({precision:d}):a.segmentSubdivisions,f=[],g=[],h=0;h0){var k=j.map(function(a){return a.start});Array.prototype.push.apply(g,k)}else g.push(i.start)}else g.length>0&&(g.push(b[h-1].end),f.push(g),g=[])}return g.length>0&&(g.push(this.end),f.push(g)),f},toPolylines:function(a){var b=[],c=this.toPoints(a);if(!c)return null;for(var d=0,e=c.length;d=0;e?j++:j--){var k=c[j],l=g[j],m=k.length({precision:f,subdivisions:l});if(k.isVisible){if(a<=i+m)return j;h=j}i+=m}return h},tangentAt:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;a<0&&(a=0),a>1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.tangentAtLength(i,g)},tangentAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isDifferentiable()){if(a<=i+m)return k.tangentAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f){var n=e?1:0;return f.tangentAtT(n)}return null},tangentAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].tangentAtT(0);if(d>=c)return b[c-1].tangentAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].tangentAtT(e)},translate:function(a,b){for(var c=this.segments,d=c.length,e=0;e=0;c--){var d=a[c];if(d.isVisible)return d.end}return a[b-1].end}});var u=c.Point=function(a,b){if(!(this instanceof u))return new u(a,b);if("string"==typeof a){var c=a.split(a.indexOf("@")===-1?" ":"@");a=parseFloat(c[0]),b=parseFloat(c[1])}else Object(a)===a&&(b=a.y,a=a.x);this.x=void 0===a?0:a,this.y=void 0===b?0:b};u.fromPolar=function(a,b,c){c=c&&new u(c)||new u(0,0);var d=e(a*f(b)),h=e(a*g(b)),i=x(z(b));return i<90?h=-h:i<180?(d=-d,h=-h):i<270&&(d=-d),new u(c.x+d,c.y+h)},u.random=function(a,b,c,d){return new u(m(o()*(b-a+1)+a),m(o()*(d-c+1)+c))},u.prototype={adhereToRect:function(a){return a.containsPoint(this)?this:(this.x=i(j(this.x,a.x),a.x+a.width),this.y=i(j(this.y,a.y),a.y+a.height),this)},bearing:function(a){return new s(this,a).bearing()},changeInAngle:function(a,b,c){return this.clone().offset(-a,-b).theta(c)-this.theta(c)},clone:function(){return new u(this)},difference:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),new u(this.x-(a||0),this.y-(b||0))},distance:function(a){return new s(this,a).length()},squaredDistance:function(a){return new s(this,a).squaredLength()},equals:function(a){return!!a&&this.x===a.x&&this.y===a.y},magnitude:function(){return h(this.x*this.x+this.y*this.y)||.01},manhattanDistance:function(a){return e(a.x-this.x)+e(a.y-this.y)},move:function(a,b){var c=A(new u(a).theta(this)),d=this.offset(f(c)*b,-g(c)*b);return d},normalize:function(a){var b=(a||1)/this.magnitude();return this.scale(b,b)},offset:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),this.x+=a||0,this.y+=b||0,this},reflection:function(a){return new u(a).move(this,this.distance(a))},rotate:function(a,b){a=a||new c.Point(0,0),b=A(x(-b));var d=f(b),e=g(b),h=d*(this.x-a.x)-e*(this.y-a.y)+a.x,i=e*(this.x-a.x)+d*(this.y-a.y)+a.y;return this.x=h,this.y=i,this},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this},scale:function(a,b,c){return c=c&&new u(c)||new u(0,0),this.x=c.x+a*(this.x-c.x),this.y=c.y+b*(this.y-c.y),this},snapToGrid:function(a,b){return this.x=y(this.x,a),this.y=y(this.y,b||a),this},theta:function(a){a=new u(a);var b=-(a.y-this.y),c=a.x-this.x,d=k(b,c);return d<0&&(d=2*n+d),180*d/n},angleBetween:function(a,b){var c=this.equals(a)||this.equals(b)?NaN:this.theta(b)-this.theta(a);return c<0&&(c+=360),c},vectorAngle:function(a){var b=new u(0,0);return b.angleBetween(this,a)},toJSON:function(){return{x:this.x,y:this.y}},toPolar:function(a){a=a&&new u(a)||new u(0,0);var b=this.x,c=this.y;return this.x=h((b-a.x)*(b-a.x)+(c-a.y)*(c-a.y)),this.y=A(a.theta(new u(b,c))),this},toString:function(){return this.x+"@"+this.y},update:function(a,b){return this.x=a||0,this.y=b||0,this},dot:function(a){return a?this.x*a.x+this.y*a.y:NaN},cross:function(a,b){return a&&b?(b.x-this.x)*(a.y-this.y)-(b.y-this.y)*(a.x-this.x):NaN},lerp:function(a,b){var c=this.x,d=this.y;return new u((1-b)*c+b*a.x,(1-b)*d+b*a.y)}},u.prototype.translate=u.prototype.offset;var v=c.Rect=function(a,b,c,d){return this instanceof v?(Object(a)===a&&(b=a.y,c=a.width,d=a.height,a=a.x),this.x=void 0===a?0:a,this.y=void 0===b?0:b,this.width=void 0===c?0:c,void(this.height=void 0===d?0:d)):new v(a,b,c,d)};v.fromEllipse=function(a){return a=new r(a),new v(a.x-a.a,a.y-a.b,2*a.a,2*a.b)},v.prototype={bbox:function(a){if(!a)return this.clone();var b=A(a||0),c=e(g(b)),d=e(f(b)),h=this.width*d+this.height*c,i=this.width*c+this.height*d;return new v(this.x+(this.width-h)/2,this.y+(this.height-i)/2,h,i)},bottomLeft:function(){return new u(this.x,this.y+this.height)},bottomLine:function(){return new s(this.bottomLeft(),this.bottomRight())},bottomMiddle:function(){return new u(this.x+this.width/2,this.y+this.height); -},center:function(){return new u(this.x+this.width/2,this.y+this.height/2)},clone:function(){return new v(this)},containsPoint:function(a){return a=new u(a),a.x>=this.x&&a.x<=this.x+this.width&&a.y>=this.y&&a.y<=this.y+this.height},containsRect:function(a){var b=new v(this).normalize(),c=new v(a).normalize(),d=b.width,e=b.height,f=c.width,g=c.height;if(!(d&&e&&f&&g))return!1;var h=b.x,i=b.y,j=c.x,k=c.y;return f+=j,d+=h,g+=k,e+=i,h<=j&&f<=d&&i<=k&&g<=e},corner:function(){return new u(this.x+this.width,this.y+this.height)},equals:function(a){var b=new v(this).normalize(),c=new v(a).normalize();return b.x===c.x&&b.y===c.y&&b.width===c.width&&b.height===c.height},intersect:function(a){var b=this.origin(),c=this.corner(),d=a.origin(),e=a.corner();if(e.x<=b.x||e.y<=b.y||d.x>=c.x||d.y>=c.y)return null;var f=j(b.x,d.x),g=j(b.y,d.y);return new v(f,g,i(c.x,e.x)-f,i(c.y,e.y)-g)},intersectionWithLine:function(a){var b,c,d=this,e=[d.topLine(),d.rightLine(),d.bottomLine(),d.leftLine()],f=[],g=[],h=e.length;for(c=0;c0?f:null},intersectionWithLineFromCenterToPoint:function(a,b){a=new u(a);var c,d=new u(this.x+this.width/2,this.y+this.height/2);b&&a.rotate(d,b);for(var e=[this.topLine(),this.rightLine(),this.bottomLine(),this.leftLine()],f=new s(d,a),g=e.length-1;g>=0;--g){var h=e[g].intersection(f);if(null!==h){c=h;break}}return c&&b&&c.rotate(d,-b),c},leftLine:function(){return new s(this.topLeft(),this.bottomLeft())},leftMiddle:function(){return new u(this.x,this.y+this.height/2)},moveAndExpand:function(a){return this.x+=a.x||0,this.y+=a.y||0,this.width+=a.width||0,this.height+=a.height||0,this},offset:function(a,b){return u.prototype.offset.call(this,a,b)},inflate:function(a,b){return void 0===a&&(a=0),void 0===b&&(b=a),this.x-=a,this.y-=b,this.width+=2*a,this.height+=2*b,this},normalize:function(){var a=this.x,b=this.y,c=this.width,d=this.height;return this.width<0&&(a=this.x+this.width,c=-this.width),this.height<0&&(b=this.y+this.height,d=-this.height),this.x=a,this.y=b,this.width=c,this.height=d,this},origin:function(){return new u(this.x,this.y)},pointNearestToPoint:function(a){if(a=new u(a),this.containsPoint(a)){var b=this.sideNearestToPoint(a);switch(b){case"right":return new u(this.x+this.width,a.y);case"left":return new u(this.x,a.y);case"bottom":return new u(a.x,this.y+this.height);case"top":return new u(a.x,this.y)}}return a.adhereToRect(this)},rightLine:function(){return new s(this.topRight(),this.bottomRight())},rightMiddle:function(){return new u(this.x+this.width,this.y+this.height/2)},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this.width=l(this.width*b)/b,this.height=l(this.height*b)/b,this},scale:function(a,b,c){return c=this.origin().scale(a,b,c),this.x=c.x,this.y=c.y,this.width*=a,this.height*=b,this},maxRectScaleToFit:function(a,b){a=new v(a),b||(b=a.center());var c,d,e,f,g,h,j,k,l=b.x,m=b.y;c=d=e=f=g=h=j=k=1/0;var n=a.topLeft();n.xl&&(d=(this.x+this.width-l)/(o.x-l)),o.y>m&&(h=(this.y+this.height-m)/(o.y-m));var p=a.topRight();p.x>l&&(e=(this.x+this.width-l)/(p.x-l)),p.ym&&(k=(this.y+this.height-m)/(q.y-m)),{sx:i(c,d,e,f),sy:i(g,h,j,k)}},maxRectUniformScaleToFit:function(a,b){var c=this.maxRectScaleToFit(a,b);return i(c.sx,c.sy)},sideNearestToPoint:function(a){a=new u(a);var b=a.x-this.x,c=this.x+this.width-a.x,d=a.y-this.y,e=this.y+this.height-a.y,f=b,g="left";return cb&&(b=i),jd&&(d=j)}return new v(a,c,b-a,d-c)},clone:function(){var a=this.points,b=a.length;if(0===b)return new w;for(var c=[],d=0;df.x&&(f=c[a]);var g=[];for(a=0;a2){var j=g[g.length-1];g.unshift(j)}for(var k,l,m,n,o,p,q={},r=[];0!==g.length;)if(k=g.pop(),l=k[0],!q.hasOwnProperty(k[0]+"@@"+k[1]))for(var s=!1;!s;)if(r.length<2)r.push(k),s=!0;else{m=r.pop(),n=m[0],o=r.pop(),p=o[0];var t=p.cross(n,l);if(t<0)r.push(o),r.push(m),r.push(k),s=!0;else if(0===t){var u=1e-10,v=n.angleBetween(p,l);e(v-180)2&&r.pop();var x,y=-1;for(b=r.length,a=0;a0){var B=r.slice(y),C=r.slice(0,y);A=B.concat(C)}else A=r;var D=[];for(b=A.length,a=0;a=1)return b[c-1].clone();var d=this.length(),e=d*a;return this.pointAtLength(e)},pointAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return b[0].clone();var d=!0;a<0&&(d=!1,a=-a);for(var e=0,f=c-1,g=d?0:f-1;d?g=0;d?g++:g--){var h=b[g],i=b[g+1],j=new s(h,i),k=h.distance(i);if(a<=e+k)return j.pointAtLength((d?1:-1)*(a-e));e+=k}var l=d?b[c-1]:b[0];return l.clone()},scale:function(a,b,c){var d=this.points,e=d.length;if(0===e)return this;for(var f=0;f1&&(a=1);var d=this.length(),e=d*a;return this.tangentAtLength(e)},tangentAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return null;var d=!0;a<0&&(d=!1,a=-a);for(var e,f=0,g=c-1,h=d?0:g-1;d?h=0;d?h++:h--){var i=b[h],j=b[h+1],k=new s(i,j),l=i.distance(j);if(k.isDifferentiable()){if(a<=f+l)return k.tangentAtLength((d?1:-1)*(a-f));e=k}f+=l}if(e){var m=d?1:0;return e.tangentAt(m)}return null},intersectionWithLine:function(a){for(var b=new s(a),c=[],d=this.points,e=0,f=d.length-1;e0?c:null},translate:function(a,b){var c=this.points,d=c.length;if(0===d)return this;for(var e=0;e=1?b:b*a},pointAtT:function(a){if(this.pointAt)return this.pointAt(a);throw new Error("Neither pointAtT() nor pointAt() function is implemented.")},previousSegment:null,subpathStartSegment:null,tangentAtT:function(a){if(this.tangentAt)return this.tangentAt(a);throw new Error("Neither tangentAtT() nor tangentAt() function is implemented.")},bbox:function(){throw new Error("Declaration missing for virtual function.")},clone:function(){throw new Error("Declaration missing for virtual function.")},closestPoint:function(){throw new Error("Declaration missing for virtual function.")},closestPointLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointNormalizedLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointTangent:function(){throw new Error("Declaration missing for virtual function.")},equals:function(){throw new Error("Declaration missing for virtual function.")},getSubdivisions:function(){throw new Error("Declaration missing for virtual function.")},isDifferentiable:function(){throw new Error("Declaration missing for virtual function.")},length:function(){throw new Error("Declaration missing for virtual function.")},pointAt:function(){throw new Error("Declaration missing for virtual function.")},pointAtLength:function(){throw new Error("Declaration missing for virtual function.")},scale:function(){throw new Error("Declaration missing for virtual function.")},tangentAt:function(){throw new Error("Declaration missing for virtual function.")},tangentAtLength:function(){throw new Error("Declaration missing for virtual function.")},translate:function(){throw new Error("Declaration missing for virtual function.")},serialize:function(){throw new Error("Declaration missing for virtual function.")},toString:function(){throw new Error("Declaration missing for virtual function.")}},C=function(){for(var b=[],c=arguments.length,d=0;d0)throw new Error("Closepath constructor expects no arguments.");return this},J={clone:function(){return new I},getSubdivisions:function(){return[]},isDifferentiable:function(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)},scale:function(){return this},translate:function(){return this},type:"Z",serialize:function(){return this.type},toString:function(){return this.type+" "+this.start+" "+this.end}};Object.defineProperty(J,"start",{configurable:!0,enumerable:!0,get:function(){if(!this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path; OR segment has not yet been added to a path.)");return this.previousSegment.end}}),Object.defineProperty(J,"end",{configurable:!0,enumerable:!0,get:function(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. Moveto); OR segment has not yet been added to a path.)");return this.subpathStartSegment.end}}),I.prototype=b(B,s.prototype,J);var K=t.segmentTypes={L:C,C:E,M:G,Z:I,z:I};return t.regexSupportedData=new RegExp("^[\\s\\d"+Object.keys(K).join("")+",.]*$"),t.isDataSupported=function(a){return"string"==typeof a&&this.regexSupportedData.test(a)},c}(); -var V,Vectorizer;V=Vectorizer=function(){"use strict";function a(a,b){a||(a={});var c=q("textPath"),d=a.d;if(d&&void 0===a["xlink:href"]){var e=q("path").attr("d",d).appendTo(b.defs());c.attr("xlink:href","#"+e.id)}return q.isObject(a)&&c.attr(a),c.node}function b(a,b,c){c||(c={});for(var d=c.includeAnnotationIndices,e=c.eol,f=c.lineHeight,g=c.baseSize,h=0,i={},j=b.length-1,k=0;k<=j;k++){var l=b[k],m=null;if(q.isObject(l)){var n=l.attrs,o=q("tspan",n),p=o.node,r=l.t;e&&k===j&&(r+=e),p.textContent=r;var s=n.class;s&&o.addClass(s),d&&o.attr("annotations",l.annotations),m=parseFloat(n["font-size"]),void 0===m&&(m=g),m&&m>h&&(h=m)}else e&&k===j&&(l+=e),p=document.createTextNode(l||" "),g&&g>h&&(h=g);a.appendChild(p)}return h&&(i.maxFontSize=h),f?i.lineHeight=f:h&&(i.lineHeight=1.2*h),i}function c(a,b){var c=parseFloat(a);return s.test(a)?c*b:c}function d(a,b,d,e){if(!Array.isArray(b))return 0;var f=b.length;if(!f)return 0;for(var g=b[0],h=c(g.maxFontSize,d)||d,i=0,j=c(e,d),k=1;k1){var e,g,h=[];for(e=0,g=d.childNodes.length;e0&&D.setAttribute("dy",B),(y>0||g)&&D.setAttribute("x",j),D.className.baseVal=C,r.appendChild(D),v+=E.length+1}if(i)if(l)B=d(h,x,p,o);else if("top"===h)B="0.8em";else{var I;switch(z>0?(I=parseFloat(o)||1,I*=z,s.test(o)||(I/=p)):I=0,h){case"middle":B=.3-I/2+"em";break;case"bottom":B=-I-.3+"em"}}else 0===h?B="0em":h?B=h:(B=0,null===this.attr("y")&&this.attr("y",u||"0.8em"));return r.firstChild.setAttribute("dy",B),this.append(r),this},r.removeAttr=function(a){var b=q.qualifyAttr(a),c=this.node;return b.ns?c.hasAttributeNS(b.ns,b.local)&&c.removeAttributeNS(b.ns,b.local):c.hasAttribute(a)&&c.removeAttribute(a),this},r.attr=function(a,b){if(q.isUndefined(a)){for(var c=this.node.attributes,d={},e=0;e1&&k.push(k[0]),new g.Polyline(k);case"PATH":return l=this.attr("d"),g.Path.isDataSupported(l)||(l=q.normalizePathData(l)),new g.Path(l);case"LINE":return x1=parseFloat(this.attr("x1"))||0,y1=parseFloat(this.attr("y1"))||0,x2=parseFloat(this.attr("x2"))||0,y2=parseFloat(this.attr("y2"))||0,new g.Line({x:x1,y:y1},{x:x2,y:y2})}return this.getBBox()},r.findIntersection=function(a,b){var c=this.svg().node;b=b||c;var d=this.getBBox({target:b}),e=d.center();if(d.intersectionWithLineFromCenterToPoint(a)){var f,h=this.tagName();if("RECT"===h){var i=new g.Rect(parseFloat(this.attr("x")||0),parseFloat(this.attr("y")||0),parseFloat(this.attr("width")),parseFloat(this.attr("height"))),j=this.getTransformToElement(b),k=q.decomposeMatrix(j),l=c.createSVGTransform();l.setRotate(-k.rotation,e.x,e.y);var m=q.transformRect(i,l.matrix.multiply(j));f=new g.Rect(m).intersectionWithLineFromCenterToPoint(a,k.rotation)}else if("PATH"===h||"POLYGON"===h||"POLYLINE"===h||"CIRCLE"===h||"ELLIPSE"===h){var n,o,p,r,s,t,u="PATH"===h?this:this.convertToPath(),v=u.sample(),w=1/0,x=[];for(n=0;n'+(a||"")+"",c=q.parseXML(b,{async:!1});return c.documentElement},q.idCounter=0,q.uniqueId=function(){return"v-"+ ++q.idCounter},q.toNode=function(a){return q.isV(a)?a.node:a.nodeName&&a||a[0]},q.ensureId=function(a){return a=q.toNode(a),a.id||(a.id=q.uniqueId())},q.sanitizeText=function(a){return(a||"").replace(/ /g,"\xa0")},q.isUndefined=function(a){return"undefined"==typeof a},q.isString=function(a){return"string"==typeof a},q.isObject=function(a){return a&&"object"==typeof a},q.isArray=Array.isArray,q.parseXML=function(a,b){b=b||{};var c;try{var d=new DOMParser;q.isUndefined(b.async)||(d.async=b.async),c=d.parseFromString(a,"text/xml")}catch(a){c=void 0}if(!c||c.getElementsByTagName("parsererror").length)throw new Error("Invalid XML: "+a);return c},q.qualifyAttr=function(a){if(a.indexOf(":")!==-1){var b=a.split(":");return{ns:f[b[0]],local:b[1]}}return{ns:null,local:a}},q.transformRegex=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,q.transformSeparatorRegex=/[ ,]+/,q.transformationListRegex=/^(\w+)\((.*)\)/,q.transformStringToMatrix=function(a){var b=q.createSVGMatrix(),c=a&&a.match(q.transformRegex);if(!c)return b;for(var d=0,e=c.length;d=0){var f=q.transformStringToMatrix(a),g=q.decomposeMatrix(f);b=[g.translateX,g.translateY],d=[g.scaleX,g.scaleY],c=[g.rotation];var h=[];0===b[0]&&0===b[0]||h.push("translate("+b+")"),1===d[0]&&1===d[1]||h.push("scale("+d+")"),0!==c[0]&&h.push("rotate("+c+")"),a=h.join(" ")}else{var i=a.match(/translate\((.*?)\)/);i&&(b=i[1].split(e));var j=a.match(/rotate\((.*?)\)/);j&&(c=j[1].split(e));var k=a.match(/scale\((.*?)\)/);k&&(d=k[1].split(e))}}var l=d&&d[0]?parseFloat(d[0]):1;return{value:a,translate:{tx:b&&b[0]?parseInt(b[0],10):0,ty:b&&b[1]?parseInt(b[1],10):0},rotate:{angle:c&&c[0]?parseInt(c[0],10):0,cx:c&&c[1]?parseInt(c[1],10):void 0,cy:c&&c[2]?parseInt(c[2],10):void 0},scale:{sx:l,sy:d&&d[1]?parseFloat(d[1]):l}}},q.deltaTransformPoint=function(a,b){var c=b.x*a.a+b.y*a.c+0,d=b.x*a.b+b.y*a.d+0;return{x:c,y:d}},q.decomposeMatrix=function(a){var b=q.deltaTransformPoint(a,{x:0,y:1}),c=q.deltaTransformPoint(a,{x:1,y:0}),d=180/j*k(b.y,b.x)-90,e=180/j*k(c.y,c.x);return{translateX:a.e,translateY:a.f,scaleX:l(a.a*a.a+a.b*a.b),scaleY:l(a.c*a.c+a.d*a.d),skewX:d,skewY:e,rotation:d}},q.matrixToScale=function(a){var b,c,d,e;return a?(b=q.isUndefined(a.a)?1:a.a,e=q.isUndefined(a.d)?1:a.d,c=a.b,d=a.c):b=e=1,{sx:c?l(b*b+c*c):b,sy:d?l(d*d+e*e):e}},q.matrixToRotate=function(a){var b={x:0,y:1};return a&&(b=q.deltaTransformPoint(a,b)),{angle:g.normalizeAngle(g.toDeg(k(b.y,b.x))-90)}},q.matrixToTranslate=function(a){return{tx:a&&a.e||0,ty:a&&a.f||0}},q.isV=function(a){return a instanceof q},q.isVElement=q.isV;var t=q("svg").node;return q.createSVGMatrix=function(a){var b=t.createSVGMatrix();for(var c in a)b[c]=a[c];return b},q.createSVGTransform=function(a){return q.isUndefined(a)?t.createSVGTransform():(a instanceof SVGMatrix||(a=q.createSVGMatrix(a)),t.createSVGTransformFromMatrix(a))},q.createSVGPoint=function(a,b){var c=t.createSVGPoint();return c.x=a,c.y=b,c},q.transformRect=function(a,b){var c=t.createSVGPoint();c.x=a.x,c.y=a.y;var d=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y;var e=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y+a.height;var f=c.matrixTransform(b);c.x=a.x,c.y=a.y+a.height;var h=c.matrixTransform(b),i=m(d.x,e.x,f.x,h.x),j=n(d.x,e.x,f.x,h.x),k=m(d.y,e.y,f.y,h.y),l=n(d.y,e.y,f.y,h.y);return new g.Rect(i,k,j-i,l-k)},q.transformPoint=function(a,b){return new g.Point(q.createSVGPoint(a.x,a.y).matrixTransform(b))},q.transformLine=function(a,b){return new g.Line(q.transformPoint(a.start,b),q.transformPoint(a.end,b))},q.transformPolyline=function(a,b){var c=a instanceof g.Polyline?a.points:a;q.isArray(c)||(c=[]);for(var d=[],e=0,f=c.length;e=e?f?"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"M0,"+f+"A"+f+","+f+" 0 1,0 0,"+-f+"A"+f+","+f+" 0 1,0 0,"+f+"Z":"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z":f?"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L"+f*q+","+f*r+"A"+f+","+f+" 0 "+l+",0 "+f*m+","+f*n+"Z":"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L0,0Z"},q.mergeAttrs=function(a,b){for(var c in b)"class"===c?a[c]=a[c]?a[c]+" "+b[c]:b[c]:"style"===c?q.isObject(a[c])&&q.isObject(b[c])?a[c]=q.mergeAttrs(a[c],b[c]):q.isObject(a[c])?a[c]=q.mergeAttrs(a[c],q.styleToObject(b[c])):q.isObject(b[c])?a[c]=q.mergeAttrs(q.styleToObject(a[c]),b[c]):a[c]=q.mergeAttrs(q.styleToObject(a[c]),q.styleToObject(b[c])):a[c]=b[c];return a},q.annotateString=function(a,b,c){b=b||[],c=c||{};for(var d,e,f,g=c.offset||0,h=[],i=[],j=0;j=m&&j=a.start&&ba.start&&c<=a.end||a.start>=b&&a.end=b?a.end+=c:a.start>=b&&(a.start+=c,a.end+=c)}),a},q.convertLineToPathData=function(a){a=q(a);var b=["M",a.attr("x1"),a.attr("y1"),"L",a.attr("x2"),a.attr("y2")].join(" ");return b},q.convertPolygonToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)+" Z"},q.convertPolylineToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)},q.svgPointsToPath=function(a){for(var b=0,c=a.length;b1&&(z=o(z),d*=z,e*=z);var A=d*d,B=e*e,C=(g==h?-1:1)*o(p((A*B-A*y*y-B*x*x)/(A*y*y+B*x*x))),D=C*d*y/e+(a+i)/2,E=C*-e*x/d+(c+q)/2,F=n(((c-E)/e).toFixed(9)),G=n(((q-E)/e).toFixed(9));F=aG&&(F-=2*j),(!h&&G)>F&&(G-=2*j)}var H=G-F;if(p(H)>t){var I=G,J=i,K=q;G=F+t*((h&&G)>F?1:-1),i=D+d*l(G),q=E+e*k(G),v=b(i,q,d,e,f,0,h,J,K,[G,I,D,E])}H=G-F;var L=l(F),M=k(F),N=l(G),O=k(G),P=m(H/4),Q=4/3*(d*P),R=4/3*(e*P),S=[a,c],T=[a+Q*M,c-R*L],U=[i+Q*O,q-R*N],V=[i,q];if(T[0]=2*S[0]-T[0],T[1]=2*S[1]-T[1],r)return[T,U,V].concat(v);v=[T,U,V].concat(v).join().split(",");for(var W=[],X=v.length,Y=0;Y2&&(c.push([d].concat(f.splice(0,2))),g="l",d="m"===d?"l":"L");f.length>=b[g]&&(c.push([d].concat(f.splice(0,b[g]))),b[g]););}),c}function d(a){if(Array.isArray(a)&&Array.isArray(a&&a[0])||(a=c(a)),!a||!a.length)return[["M",0,0]];for(var b,d=[],e=0,f=0,g=0,h=0,i=0,j=a.length,k=i;k7){a[b].shift();for(var c=a[b];c.length;)i[b]="A",a.splice(b++,0,["C"].concat(c.splice(0,6)));a.splice(b,1),l=g.length}}for(var g=d(c),h={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=[],j="",k="",l=g.length,m=0;m0&&(k=i[m-1])),g[m]=e(g[m],h,k),"A"!==i[m]&&"C"===j&&(i[m]="C"),f(g,m);var n=g[m],o=n.length;h.x=n[o-2],h.y=n[o-1],h.bx=parseFloat(n[o-4])||h.x,h.by=parseFloat(n[o-3])||h.y}return g[0][0]&&"M"===g[0][0]||g.unshift(["M",0,0]),g}var f="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",g=new RegExp("([a-z])["+f+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+f+"]*,?["+f+"]*)+)","ig"),h=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+f+"]*,?["+f+"]*","ig"),i=Math,j=i.PI,k=i.sin,l=i.cos,m=i.tan,n=i.asin,o=i.sqrt,p=i.abs;return function(a){return e(a).join(",").split(",").join(" ")}}(),q.namespace=f,q}(); -var joint={version:"2.1.3",config:{classNamePrefix:"joint-",defaultTheme:"default"},dia:{},ui:{},layout:{},shapes:{},format:{},connectors:{},highlighters:{},routers:{},anchors:{},connectionPoints:{},connectionStrategies:{},linkTools:{},mvc:{views:{}},setTheme:function(a,b){b=b||{},joint.util.invoke(joint.mvc.views,"setTheme",a,b),joint.mvc.View.prototype.defaultTheme=a},env:{_results:{},_tests:{svgforeignobject:function(){return!!document.createElementNS&&/SVGForeignObject/.test({}.toString.call(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")))}},addTest:function(a,b){return joint.env._tests[a]=b},test:function(a){var b=joint.env._tests[a];if(!b)throw new Error('Test not defined ("'+a+'"). Use `joint.env.addTest(name, fn) to add a new test.`');var c=joint.env._results[a];if("undefined"!=typeof c)return c;try{c=b()}catch(a){c=!1}return joint.env._results[a]=c,c}},util:{hashCode:function(a){var b=0;if(0==a.length)return b;for(var c=0;c0){var f=joint.util.getByPath(a,d,c);f&&delete f[e]}else delete a[e];return a},flattenObject:function(a,b,c){b=b||"/";var d={};for(var e in a)if(a.hasOwnProperty(e)){var f="object"==typeof a[e];if(f&&c&&c(a[e])&&(f=!1),f){var g=this.flattenObject(a[e],b,c);for(var h in g)g.hasOwnProperty(h)&&(d[e+b+h]=g[h])}else d[e]=a[e]}return d},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)})},guid:function(a){return this.guid.id=this.guid.id||1,a.id=void 0===a.id?"j_"+this.guid.id++:a.id,a.id},toKebabCase:function(a){return a.replace(/[A-Z]/g,"-$&").toLowerCase()},mixin:_.assign,supplement:_.defaults,deepMixin:_.mixin,deepSupplement:_.defaultsDeep,normalizeEvent:function(a){var b=a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches[0];if(b){for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return a},nextFrame:function(){var a;if("undefined"!=typeof window&&(a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame),!a){var b=0;a=function(a){var c=(new Date).getTime(),d=Math.max(0,16-(c-b)),e=setTimeout(function(){a(c+d)},d);return b=c+d,e}}return function(b,c){return a(c?b.bind(c):b)}}(),cancelFrame:function(){var a,b="undefined"!=typeof window;return b&&(a=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.msCancelRequestAnimationFrame||window.oCancelAnimationFrame||window.oCancelRequestAnimationFrame||window.mozCancelAnimationFrame||window.mozCancelRequestAnimationFrame),a=a||clearTimeout,b?a.bind(window):a}(),shapePerimeterConnectionPoint:function(a,b,c,d){var e,f;if(!c){var g=b.$(".scalable")[0],h=b.$(".rotatable")[0];g&&g.firstChild?c=g.firstChild:h&&h.firstChild&&(c=h.firstChild)}return c?(f=V(c).findIntersection(d,a.paper.viewport),f||(e=V(c).getBBox({target:a.paper.viewport}))):(e=b.model.getBBox(),f=e.intersectionWithLineFromCenterToPoint(d)),f||e.center()},isPercentage:function(a){return joint.util.isString(a)&&"%"===a.slice(-1)},parseCssNumeric:function(a,b){b=b||[];var c={value:parseFloat(a)};if(Number.isNaN(c.value))return null;var d=b.join("|");if(joint.util.isString(a)){var e=new RegExp("(\\d+)("+d+")$").exec(a);if(!e)return null;e[2]&&(c.unit=e[2])}return c},breakText:function(a,b,c,d){d=d||{},c=c||{};var e=b.width,f=b.height,g=d.svgDocument||V("svg").node,h=V("tspan").node,i=V("text").attr(c).append(h).node,j=document.createTextNode("");i.style.opacity=0,i.style.display="block",h.style.display="block",h.appendChild(j),g.appendChild(i),d.svgDocument||document.body.appendChild(g);for(var k,l,m=d.separator||" ",n=d.eol||"\n",o=a.split(m),p=[],q=[],r=0,s=0,t=o.length;r=0)if(u.length>1){for(var v=u.split(n),w=0,x=v.length-1;wf){q.splice(Math.floor(f/l));break}}}}return d.svgDocument?g.removeChild(i):document.body.removeChild(g),q.join(n)},sanitizeHTML:function(a){var b=$($.parseHTML("
"+a+"
",null,!1));return b.find("*").each(function(){var a=this;$.each(a.attributes,function(){var b=this,c=b.name,d=b.value;0!==c.indexOf("on")&&0!==d.indexOf("javascript:")||$(a).removeAttr(c)})}),b.html()},downloadBlob:function(a,b){if(window.navigator.msSaveBlob)window.navigator.msSaveBlob(a,b);else{var c=window.URL.createObjectURL(a),d=document.createElement("a");d.href=c,d.download=b,document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c)}},downloadDataUri:function(a,b){var c=joint.util.dataUriToBlob(a);joint.util.downloadBlob(c,b)},dataUriToBlob:function(a){a=a.replace(/\s/g,""),a=decodeURIComponent(a);var b,c=a.indexOf(","),d=a.slice(0,c),e=d.split(":")[1].split(";")[0],f=a.slice(c+1);b=d.indexOf("base64")>=0?atob(f):unescape(encodeURIComponent(f));for(var g=new window.Uint8Array(b.length),h=0;h=1)return 1;var b=a*a,c=b*a;return 4*(a<.5?c:3*(a-b)+c-.75)},exponential:function(a){return Math.pow(2,10*(a-1))},bounce:function(a){for(var b=0,c=1;1;b+=c,c/=2)if(a>=(7-4*b)/11){var d=(11-6*b-11*a)/4;return-d*d+c*c}},reverse:function(a){return function(b){return 1-a(1-b)}},reflect:function(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}},clamp:function(a,b,c){return b=b||0,c=c||1,function(d){var e=a(d);return ec?c:e}},back:function(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}},elastic:function(a){return a||(a=1.5),function(b){return Math.pow(2,10*(b-1))*Math.cos(20*Math.PI*a/3*b)}}},interpolate:{number:function(a,b){var c=b-a;return function(b){return a+c*b}},object:function(a,b){var c=Object.keys(a);return function(d){var e,f,g={};for(e=c.length-1;e!=-1;e--)f=c[e],g[f]=a[f]+(b[f]-a[f])*d;return g}},hexColor:function(a,b){var c=parseInt(a.slice(1),16),d=parseInt(b.slice(1),16),e=255&c,f=(255&d)-e,g=65280&c,h=(65280&d)-g,i=16711680&c,j=(16711680&d)-i;return function(a){var b=e+f*a&255,c=g+h*a&65280,d=i+j*a&16711680;return"#"+(1<<24|b|c|d).toString(16).slice(1)}},unit:function(a,b){var c=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,d=c.exec(a),e=c.exec(b),f=e[1].indexOf("."),g=f>0?e[1].length-f-1:0;a=+d[1];var h=+e[1]-a,i=d[2];return function(b){return(a+h*b).toFixed(g)+i}}},filter:{outline:function(a){var b='',c=Number.isFinite(a.margin)?a.margin:2,d=Number.isFinite(a.width)?a.width:1;return joint.util.template(b)({color:a.color||"blue",opacity:Number.isFinite(a.opacity)?a.opacity:1,outerRadius:c+d,innerRadius:c})},highlight:function(a){var b='';return joint.util.template(b)({color:a.color||"red",width:Number.isFinite(a.width)?a.width:1,blur:Number.isFinite(a.blur)?a.blur:0,opacity:Number.isFinite(a.opacity)?a.opacity:1})},blur:function(a){var b=Number.isFinite(a.x)?a.x:2;return joint.util.template('')({stdDeviation:Number.isFinite(a.y)?[b,a.y]:b})},dropShadow:function(a){var b="SVGFEDropShadowElement"in window?'':'';return joint.util.template(b)({dx:a.dx||0,dy:a.dy||0,opacity:Number.isFinite(a.opacity)?a.opacity:1,color:a.color||"black",blur:Number.isFinite(a.blur)?a.blur:4})},grayscale:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({a:.2126+.7874*(1-b),b:.7152-.7152*(1-b),c:.0722-.0722*(1-b),d:.2126-.2126*(1-b),e:.7152+.2848*(1-b),f:.0722-.0722*(1-b),g:.2126-.2126*(1-b),h:.0722+.9278*(1-b)})},sepia:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({a:.393+.607*(1-b),b:.769-.769*(1-b),c:.189-.189*(1-b),d:.349-.349*(1-b),e:.686+.314*(1-b),f:.168-.168*(1-b),g:.272-.272*(1-b),h:.534-.534*(1-b),i:.131+.869*(1-b)})},saturate:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:1-b})},hueRotate:function(a){return joint.util.template('')({angle:a.angle||0})},invert:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:b,amount2:1-b})},brightness:function(a){return joint.util.template('')({amount:Number.isFinite(a.amount)?a.amount:1})},contrast:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:b,amount2:.5-b/2})}},format:{number:function(a,b,c){function d(a){for(var b=a.length,d=[],e=0,f=c.grouping[0];b>0&&f>0;)d.push(a.substring(b-=f,b+f)),f=c.grouping[e=(e+1)%c.grouping.length];return d.reverse().join(c.thousands)}c=c||{currency:["$",""],decimal:".",thousands:",",grouping:[3]};var e=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,f=e.exec(a),g=f[1]||" ",h=f[2]||">",i=f[3]||"",j=f[4]||"",k=f[5],l=+f[6],m=f[7],n=f[8],o=f[9],p=1,q="",r="",s=!1;switch(n&&(n=+n.substring(1)),(k||"0"===g&&"="===h)&&(k=g="0",h="=",m&&(l-=Math.floor((l-1)/4))),o){case"n":m=!0,o="g";break;case"%":p=100,r="%",o="f";break;case"p":p=100,r="%",o="r";break;case"b":case"o":case"x":case"X":"#"===j&&(q="0"+o.toLowerCase());break;case"c":case"d":s=!0,n=0;break;case"s":p=-1,o="r"}"$"===j&&(q=c.currency[0],r=c.currency[1]),"r"!=o||n||(o="g"),null!=n&&("g"==o?n=Math.max(1,Math.min(21,n)):"e"!=o&&"f"!=o||(n=Math.max(0,Math.min(20,n))));var t=k&&m;if(s&&b%1)return"";var u=b<0||0===b&&1/b<0?(b=-b,"-"):i,v=r;if(p<0){var w=this.prefix(b,n);b=w.scale(b),v=w.symbol+r}else b*=p;b=this.convert(o,b,n);var x=b.lastIndexOf("."),y=x<0?b:b.substring(0,x),z=x<0?"":c.decimal+b.substring(x+1);!k&&m&&c.grouping&&(y=d(y));var A=q.length+y.length+z.length+(t?0:u.length),B=A"===h?B+u+b:"^"===h?B.substring(0,A>>=1)+u+b+B.substring(A):u+(t?b:B+b))+v},string:function(a,b){for(var c,d="{",e=!1,f=[];(c=a.indexOf(d))!==-1;){var g,h,i;if(g=a.slice(0,c),e){h=g.split(":"),i=h.shift().split("."),g=b;for(var j=0;j8?function(a){return a/c}:function(a){return a*c},symbol:a}}),d=0;return a&&(a<0&&(a*=-1),b&&(a=this.round(a,this.precision(a,b))),d=1+Math.floor(1e-12+Math.log(a)/Math.LN10),d=Math.max(-24,Math.min(24,3*Math.floor((d<=0?d+1:d-1)/3)))),c[8+d/3]}},template:function(a){var b=/<%= ([^ ]+) %>|\$\{ ?([^\{\} ]+) ?\}|\{\{([^\{\} ]+)\}\}/g;return function(c){return c=c||{},a.replace(b,function(a){for(var b=Array.from(arguments),d=b.slice(1,4).find(function(a){return!!a}),e=d.split("."),f=c[e.shift()];void 0!==f&&e.length;)f=f[e.shift()];return void 0!==f?f:""})}},toggleFullScreen:function(a){function b(a,b){for(var c=["webkit","moz","ms","o",""],d=0;d0&&b[0]||[],e=c>1&&b[c-1]||{};return Array.isArray(d)||(e instanceof joint.dia.Cell?d=b:d instanceof joint.dia.Cell&&(b.length>1&&b.pop(),d=b)),e instanceof joint.dia.Cell&&(e={}),a.call(this,d,e)}}},parseDOMJSON:function(a,b){for(var c={},d=V.namespace.xmlns,e=b||d,f=document.createDocumentFragment(),g=[a,f,e];g.length>0;){e=g.pop();for(var h=g.pop(),i=g.pop(),j=0,k=i.length;j0);return this.stopBatch("clear"),this},_prepareCell:function(a,b){var c;if(a instanceof Backbone.Model?(c=a.attributes,a.graph||b&&b.dry||(a.graph=this)):c=a,!joint.util.isString(c.type))throw new TypeError("dia.Graph: cell type must be a string.");return a},minZIndex:function(){var a=this.get("cells").first();return a?a.get("z")||0:0},maxZIndex:function(){var a=this.get("cells").last();return a?a.get("z")||0:0},addCell:function(a,b){return Array.isArray(a)?this.addCells(a,b):(a instanceof Backbone.Model?a.has("z")||a.set("z",this.maxZIndex()+1):void 0===a.z&&(a.z=this.maxZIndex()+1),this.get("cells").add(this._prepareCell(a,b),b||{}),this)},addCells:function(a,b){return a.length&&(a=joint.util.flattenDeep(a),b.position=a.length,this.startBatch("add"),a.forEach(function(a){b.position--,this.addCell(a,b)},this),this.stopBatch("add")),this},resetCells:function(a,b){var c=joint.util.toArray(a).map(function(a){return this._prepareCell(a,b)},this);return this.get("cells").reset(c,b),this},removeCells:function(a,b){return a.length&&(this.startBatch("remove"),joint.util.invoke(a,"remove",b),this.stopBatch("remove")),this},_removeCell:function(a,b,c){c=c||{},c.clear||(c.disconnectLinks?this.disconnectLinks(a,c):this.removeLinks(a,c)),this.get("cells").remove(a,{silent:!0}),a.graph===this&&(a.graph=null)},getCell:function(a){return this.get("cells").get(a)},getCells:function(){return this.get("cells").toArray()},getElements:function(){return Object.keys(this._nodes).map(this.getCell,this)},getLinks:function(){return Object.keys(this._edges).map(this.getCell,this)},getFirstCell:function(){return this.get("cells").first()},getLastCell:function(){return this.get("cells").last()},getConnectedLinks:function(a,b){b=b||{};var c=b.inbound,d=b.outbound;void 0===c&&void 0===d&&(c=d=!0);var e=[],f={};if(d&&joint.util.forIn(this.getOutboundEdges(a.id),function(a,b){f[b]||(e.push(this.getCell(b)),f[b]=!0)}.bind(this)),c&&joint.util.forIn(this.getInboundEdges(a.id),function(a,b){f[b]||(e.push(this.getCell(b)),f[b]=!0)}.bind(this)),b.deep){var g=a.getEmbeddedCells({deep:!0}),h={};g.forEach(function(a){a.isElement()&&(h[a.id]=!0)}),g.forEach(function(a){a.isLink()||(d&&joint.util.forIn(this.getOutboundEdges(a.id),function(a,c){if(!f[c]){var d=this.getCell(c),g=d.source().id,i=d.target().id;if(!b.includeEnclosed&&g&&h[g]&&i&&h[i])return;e.push(this.getCell(c)),f[c]=!0}}.bind(this)),c&&joint.util.forIn(this.getInboundEdges(a.id),function(a,c){if(!f[c]){var d=this.getCell(c),g=d.source().id,i=d.target().id;if(!b.includeEnclosed&&g&&h[g]&&i&&h[i])return;e.push(this.getCell(c)),f[c]=!0}}.bind(this)))},this)}return e},getNeighbors:function(a,b){b=b||{};var c=b.inbound,d=b.outbound;void 0===c&&void 0===d&&(c=d=!0);var e=this.getConnectedLinks(a,b).reduce(function(e,f){var g=f.source(),h=f.target(),i=f.hasLoop(b);if(c&&joint.util.has(g,"id")&&!e[g.id]){var j=this.getCell(g.id);!i&&(!j||j===a||b.deep&&j.isEmbeddedIn(a))||(e[g.id]=j)}if(d&&joint.util.has(h,"id")&&!e[h.id]){var k=this.getCell(h.id);!i&&(!k||k===a||b.deep&&k.isEmbeddedIn(a))||(e[h.id]=k)}return e}.bind(this),{});return joint.util.toArray(e)},getCommonAncestor:function(){var a=Array.from(arguments).map(function(a){for(var b=[],c=a.get("parent");c;)b.push(c),c=this.getCell(c).get("parent");return b},this);a=a.sort(function(a,b){return a.length-b.length});var b=joint.util.toArray(a.shift()).find(function(b){return a.every(function(a){return a.includes(b)})});return this.getCell(b)},getSuccessors:function(a,b){b=b||{};var c=[];return this.search(a,function(b){b!==a&&c.push(b)},joint.util.assign({},b,{outbound:!0})),c},cloneCells:function(a){a=joint.util.uniq(a);var b=joint.util.toArray(a).reduce(function(a,b){return a[b.id]=b.clone(),a},{});return joint.util.toArray(a).forEach(function(a){var c=b[a.id];if(c.isLink()){var d=c.source(),e=c.target();d.id&&b[d.id]&&c.prop("source/id",b[d.id].id),e.id&&b[e.id]&&c.prop("target/id",b[e.id].id)}var f=a.get("parent");f&&b[f]&&c.set("parent",b[f].id);var g=joint.util.toArray(a.get("embeds")).reduce(function(a,c){return b[c]&&a.push(b[c].id),a},[]);joint.util.isEmpty(g)||c.set("embeds",g)}),b},cloneSubgraph:function(a,b){var c=this.getSubgraph(a,b);return this.cloneCells(c)},getSubgraph:function(a,b){b=b||{};var c=[],d={},e=[],f=[];return joint.util.toArray(a).forEach(function(a){if(d[a.id]||(c.push(a),d[a.id]=a,a.isLink()?f.push(a):e.push(a)),b.deep){var g=a.getEmbeddedCells({deep:!0});g.forEach(function(a){d[a.id]||(c.push(a),d[a.id]=a,a.isLink()?f.push(a):e.push(a))})}}),f.forEach(function(a){var b=a.source(),f=a.target(); +var g={};!function(a){function b(a,b){return b.unshift(null),new(Function.prototype.bind.apply(a,b))}function c(a){var b,c,d=[];for(c=arguments.length,b=1;b=1)return[new q(b,c,d,e),new q(e,e,e,e)];var f=this.getSkeletonPoints(a),g=f.startControlPoint1,h=f.startControlPoint2,i=f.divider,j=f.dividerControlPoint1,k=f.dividerControlPoint2;return[new q(b,g,h,i),new q(i,j,k,e)]},endpointDistance:function(){return this.start.distance(this.end)},equals:function(a){return!!a&&this.start.x===a.start.x&&this.start.y===a.start.y&&this.controlPoint1.x===a.controlPoint1.x&&this.controlPoint1.y===a.controlPoint1.y&&this.controlPoint2.x===a.controlPoint2.x&&this.controlPoint2.y===a.controlPoint2.y&&this.end.x===a.end.x&&this.end.y===a.end.y},getSkeletonPoints:function(a){var b=this.start,c=this.controlPoint1,d=this.controlPoint2,e=this.end;if(a<=0)return{startControlPoint1:b.clone(),startControlPoint2:b.clone(),divider:b.clone(),dividerControlPoint1:c.clone(),dividerControlPoint2:d.clone()};if(a>=1)return{startControlPoint1:c.clone(),startControlPoint2:d.clone(),divider:e.clone(),dividerControlPoint1:e.clone(),dividerControlPoint2:e.clone()};var f=new s(b,c).pointAt(a),g=new s(c,d).pointAt(a),h=new s(d,e).pointAt(a),i=new s(f,g).pointAt(a),j=new s(g,h).pointAt(a),k=new s(i,j).pointAt(a),l={startControlPoint1:f,startControlPoint2:i,divider:k,dividerControlPoint1:j,dividerControlPoint2:h};return l},getSubdivisions:function(a){a=a||{};var b=void 0===a.precision?this.PRECISION:a.precision,c=[new q(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===b)return c;for(var d=this.endpointDistance(),e=p(10,-b),f=0;;){f+=1;for(var g=[],h=c.length,i=0;i1&&r=1)return this.end.clone();var c=this.tAt(a,b);return this.pointAtT(c)},pointAtLength:function(a,b){var c=this.tAtLength(a,b);return this.pointAtT(c)},pointAtT:function(a){return a<=0?this.start.clone():a>=1?this.end.clone():this.getSkeletonPoints(a).divider},PRECISION:3,scale:function(a,b,c){return this.start.scale(a,b,c),this.controlPoint1.scale(a,b,c),this.controlPoint2.scale(a,b,c),this.end.scale(a,b,c),this},tangentAt:function(a,b){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var c=this.tAt(a,b);return this.tangentAtT(c)},tangentAtLength:function(a,b){if(!this.isDifferentiable())return null;var c=this.tAtLength(a,b);return this.tangentAtT(c)},tangentAtT:function(a){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var b=this.getSkeletonPoints(a),c=b.startControlPoint2,d=b.dividerControlPoint1,e=b.divider,f=new s(c,d);return f.translate(e.x-c.x,e.y-c.y),f},tAt:function(a,b){if(a<=0)return 0;if(a>=1)return 1;b=b||{};var c=void 0===b.precision?this.PRECISION:b.precision,d=void 0===b.subdivisions?this.getSubdivisions({precision:c}):b.subdivisions,e={precision:c,subdivisions:d},f=this.length(e),g=f*a;return this.tAtLength(g,e)},tAtLength:function(a,b){var c=!0;a<0&&(c=!1,a=-a),b=b||{};for(var d,e,f,g,h,i=void 0===b.precision?this.PRECISION:b.precision,j=void 0===b.subdivisions?this.getSubdivisions({precision:i}):b.subdivisions,k={precision:i,subdivisions:j},l=0,m=j.length,n=1/m,o=c?0:m-1;c?o=0;c?o++:o--){var q=j[o],r=q.endpointDistance();if(a<=l+r){d=q,e=o*n,f=(o+1)*n,g=c?a-l:r+l-a,h=c?r+l-a:a-l;break}l+=r}if(!d)return c?1:0;for(var s=this.length(k),t=p(10,-i);;){var u;if(u=0!==s?g/s:0,ui.x+g/2,m=ei.x?f-d:f+d,c=g*g/(e-j)-g*g*(f-k)*(b-k)/(h*h*(e-j))+j):(c=f>i.y?e+d:e-d,b=h*h/(f-k)-h*h*(e-j)*(c-j)/(g*g*(f-k))+k),new u(c,b).theta(a)},equals:function(a){return!!a&&a.x===this.x&&a.y===this.y&&a.a===this.a&&a.b===this.b},intersectionWithLine:function(a){var b=[],c=a.start,d=a.end,e=this.a,f=this.b,g=a.vector(),i=c.difference(new u(this)),j=new u(g.x/(e*e),g.y/(f*f)),k=new u(i.x/(e*e),i.y/(f*f)),l=g.dot(j),m=g.dot(k),n=i.dot(k)-1,o=m*m-l*n;if(o<0)return null;if(o>0){var p=h(o),q=(-m-p)/l,r=(-m+p)/l;if((q<0||10){if(f>d||g>d)return null}else if(f=1?c.clone():b.lerp(c,a)},pointAtLength:function(a){var b=this.start,c=this.end,d=!0;a<0&&(d=!1,a=-a);var e=this.length();return a>=e?d?c.clone():b.clone():this.pointAt((d?a:e-a)/e)},pointOffset:function(b){b=new a.Point(b);var c=this.start,d=this.end,e=(d.x-c.x)*(b.y-c.y)-(d.y-c.y)*(b.x-c.x);return e/this.length()},rotate:function(a,b){return this.start.rotate(a,b),this.end.rotate(a,b),this},round:function(a){var b=p(10,a||0);return this.start.x=l(this.start.x*b)/b,this.start.y=l(this.start.y*b)/b,this.end.x=l(this.end.x*b)/b,this.end.y=l(this.end.y*b)/b,this},scale:function(a,b,c){return this.start.scale(a,b,c),this.end.scale(a,b,c),this},setLength:function(a){var b=this.length();if(!b)return this;var c=a/b;return this.scale(c,c,this.start)},squaredLength:function(){var a=this.start.x,b=this.start.y,c=this.end.x,d=this.end.y;return(a-=c)*a+(b-=d)*b},tangentAt:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAt(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},tangentAtLength:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAtLength(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},translate:function(a,b){return this.start.translate(a,b),this.end.translate(a,b),this},vector:function(){return new u(this.end.x-this.start.x,this.end.y-this.start.y)},toString:function(){return this.start.toString()+" "+this.end.toString()}},s.prototype.intersection=s.prototype.intersect;var t=a.Path=function(a){if(!(this instanceof t))return new t(a);if("string"==typeof a)return new t.parse(a);this.segments=[];var b,c;if(a){if(Array.isArray(a)&&0!==a.length)if(c=a.length,a[0].isSegment)for(b=0;b=c||a<0)throw new Error("Index out of range.");return b[a]},getSegmentSubdivisions:function(a){var b=this.segments,c=b.length;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=[],f=0;fd||a<0)throw new Error("Index out of range.");var e,f=null,g=null;if(0!==d&&(a>=1?(f=c[a-1],g=f.nextSegment):g=c[0]),Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");for(var h=b.length,i=0;i=d?(e=d-1,f=1):f<0?f=0:f>1&&(f=1),b=b||{};for(var g,h=void 0===b.precision?this.PRECISION:b.precision,i=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:h}):b.segmentSubdivisions,j=0,k=0;k=1)return this.end.clone();b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.pointAtLength(i,g)},pointAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;if(0===a)return this.start.clone();var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isVisible){if(a<=i+m)return k.pointAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f)return e?f.end:f.start;var n=c[d-1];return n.end.clone()},pointAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].pointAtT(0);if(d>=c)return b[c-1].pointAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].pointAtT(e)},prepareSegment:function(a,b,c){a.previousSegment=b,a.nextSegment=c,b&&(b.nextSegment=a),c&&(c.previousSegment=a);var d=a;return a.isSubpathStart&&(a.subpathStartSegment=a,d=c),d&&this.updateSubpathStartSegment(d),a},PRECISION:3,removeSegment:function(a){var b=this.segments,c=b.length;if(0===c)throw new Error("Path has no segments.");if(a<0&&(a=c+a),a>=c||a<0)throw new Error("Index out of range.");var d=b.splice(a,1)[0],e=d.previousSegment,f=d.nextSegment;e&&(e.nextSegment=f),f&&(f.previousSegment=e),d.isSubpathStart&&f&&this.updateSubpathStartSegment(f)},replaceSegment:function(a,b){var c=this.segments,d=c.length;if(0===d)throw new Error("Path has no segments.");if(a<0&&(a=d+a),a>=d||a<0)throw new Error("Index out of range.");var e,f=c[a],g=f.previousSegment,h=f.nextSegment,i=f.isSubpathStart;if(Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");c.splice(a,1);for(var j=b.length,k=0;k1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.segmentIndexAtLength(i,g)},toPoints:function(a){var b=this.segments,c=b.length;if(0===c)return null;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=void 0===a.segmentSubdivisions?this.getSegmentSubdivisions({precision:d}):a.segmentSubdivisions,f=[],g=[],h=0;h0){var k=j.map(function(a){return a.start});Array.prototype.push.apply(g,k)}else g.push(i.start)}else g.length>0&&(g.push(b[h-1].end),f.push(g),g=[])}return g.length>0&&(g.push(this.end),f.push(g)),f},toPolylines:function(a){var b=[],c=this.toPoints(a);if(!c)return null;for(var d=0,e=c.length;d=0;e?j++:j--){var k=c[j],l=g[j],m=k.length({precision:f,subdivisions:l});if(k.isVisible){if(a<=i+m)return j;h=j}i+=m}return h},tangentAt:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;a<0&&(a=0),a>1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.tangentAtLength(i,g)},tangentAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isDifferentiable()){if(a<=i+m)return k.tangentAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f){var n=e?1:0;return f.tangentAtT(n)}return null},tangentAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].tangentAtT(0);if(d>=c)return b[c-1].tangentAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].tangentAtT(e)},translate:function(a,b){for(var c=this.segments,d=c.length,e=0;e=0;c--){var d=a[c];if(d.isVisible)return d.end}return a[b-1].end}});var u=a.Point=function(a,b){if(!(this instanceof u))return new u(a,b);if("string"==typeof a){var c=a.split(a.indexOf("@")===-1?" ":"@");a=parseFloat(c[0]),b=parseFloat(c[1])}else Object(a)===a&&(b=a.y,a=a.x);this.x=void 0===a?0:a,this.y=void 0===b?0:b};u.fromPolar=function(a,b,c){c=c&&new u(c)||new u(0,0);var d=e(a*f(b)),h=e(a*g(b)),i=x(z(b));return i<90?h=-h:i<180?(d=-d,h=-h):i<270&&(d=-d),new u(c.x+d,c.y+h)},u.random=function(a,b,c,d){return new u(m(o()*(b-a+1)+a),m(o()*(d-c+1)+c))},u.prototype={adhereToRect:function(a){return a.containsPoint(this)?this:(this.x=i(j(this.x,a.x),a.x+a.width),this.y=i(j(this.y,a.y),a.y+a.height),this)},bearing:function(a){return new s(this,a).bearing()},changeInAngle:function(a,b,c){return this.clone().offset(-a,-b).theta(c)-this.theta(c)},clone:function(){return new u(this)},difference:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),new u(this.x-(a||0),this.y-(b||0))},distance:function(a){return new s(this,a).length()},squaredDistance:function(a){return new s(this,a).squaredLength()},equals:function(a){return!!a&&this.x===a.x&&this.y===a.y},magnitude:function(){return h(this.x*this.x+this.y*this.y)||.01},manhattanDistance:function(a){return e(a.x-this.x)+e(a.y-this.y)},move:function(a,b){var c=A(new u(a).theta(this)),d=this.offset(f(c)*b,-g(c)*b);return d},normalize:function(a){var b=(a||1)/this.magnitude();return this.scale(b,b)},offset:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),this.x+=a||0,this.y+=b||0,this},reflection:function(a){return new u(a).move(this,this.distance(a))},rotate:function(b,c){b=b||new a.Point(0,0),c=A(x(-c));var d=f(c),e=g(c),h=d*(this.x-b.x)-e*(this.y-b.y)+b.x,i=e*(this.x-b.x)+d*(this.y-b.y)+b.y;return this.x=h,this.y=i,this},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this},scale:function(a,b,c){return c=c&&new u(c)||new u(0,0),this.x=c.x+a*(this.x-c.x),this.y=c.y+b*(this.y-c.y),this},snapToGrid:function(a,b){return this.x=y(this.x,a),this.y=y(this.y,b||a),this},theta:function(a){a=new u(a);var b=-(a.y-this.y),c=a.x-this.x,d=k(b,c);return d<0&&(d=2*n+d),180*d/n},angleBetween:function(a,b){var c=this.equals(a)||this.equals(b)?NaN:this.theta(b)-this.theta(a);return c<0&&(c+=360),c},vectorAngle:function(a){var b=new u(0,0);return b.angleBetween(this,a)},toJSON:function(){return{x:this.x,y:this.y}},toPolar:function(a){a=a&&new u(a)||new u(0,0);var b=this.x,c=this.y;return this.x=h((b-a.x)*(b-a.x)+(c-a.y)*(c-a.y)),this.y=A(a.theta(new u(b,c))),this},toString:function(){return this.x+"@"+this.y},update:function(a,b){return this.x=a||0,this.y=b||0,this},dot:function(a){return a?this.x*a.x+this.y*a.y:NaN},cross:function(a,b){return a&&b?(b.x-this.x)*(a.y-this.y)-(b.y-this.y)*(a.x-this.x):NaN},lerp:function(a,b){var c=this.x,d=this.y;return new u((1-b)*c+b*a.x,(1-b)*d+b*a.y)}},u.prototype.translate=u.prototype.offset;var v=a.Rect=function(a,b,c,d){return this instanceof v?(Object(a)===a&&(b=a.y,c=a.width,d=a.height,a=a.x),this.x=void 0===a?0:a,this.y=void 0===b?0:b,this.width=void 0===c?0:c,void(this.height=void 0===d?0:d)):new v(a,b,c,d)};v.fromEllipse=function(a){return a=new r(a),new v(a.x-a.a,a.y-a.b,2*a.a,2*a.b)},v.prototype={bbox:function(a){if(!a)return this.clone();var b=A(a||0),c=e(g(b)),d=e(f(b)),h=this.width*d+this.height*c,i=this.width*c+this.height*d;return new v(this.x+(this.width-h)/2,this.y+(this.height-i)/2,h,i)},bottomLeft:function(){return new u(this.x,this.y+this.height)},bottomLine:function(){return new s(this.bottomLeft(),this.bottomRight())},bottomMiddle:function(){return new u(this.x+this.width/2,this.y+this.height); +},center:function(){return new u(this.x+this.width/2,this.y+this.height/2)},clone:function(){return new v(this)},containsPoint:function(a){return a=new u(a),a.x>=this.x&&a.x<=this.x+this.width&&a.y>=this.y&&a.y<=this.y+this.height},containsRect:function(a){var b=new v(this).normalize(),c=new v(a).normalize(),d=b.width,e=b.height,f=c.width,g=c.height;if(!(d&&e&&f&&g))return!1;var h=b.x,i=b.y,j=c.x,k=c.y;return f+=j,d+=h,g+=k,e+=i,h<=j&&f<=d&&i<=k&&g<=e},corner:function(){return new u(this.x+this.width,this.y+this.height)},equals:function(a){var b=new v(this).normalize(),c=new v(a).normalize();return b.x===c.x&&b.y===c.y&&b.width===c.width&&b.height===c.height},intersect:function(a){var b=this.origin(),c=this.corner(),d=a.origin(),e=a.corner();if(e.x<=b.x||e.y<=b.y||d.x>=c.x||d.y>=c.y)return null;var f=j(b.x,d.x),g=j(b.y,d.y);return new v(f,g,i(c.x,e.x)-f,i(c.y,e.y)-g)},intersectionWithLine:function(a){var b,c,d=this,e=[d.topLine(),d.rightLine(),d.bottomLine(),d.leftLine()],f=[],g=[],h=e.length;for(c=0;c0?f:null},intersectionWithLineFromCenterToPoint:function(a,b){a=new u(a);var c,d=new u(this.x+this.width/2,this.y+this.height/2);b&&a.rotate(d,b);for(var e=[this.topLine(),this.rightLine(),this.bottomLine(),this.leftLine()],f=new s(d,a),g=e.length-1;g>=0;--g){var h=e[g].intersection(f);if(null!==h){c=h;break}}return c&&b&&c.rotate(d,-b),c},leftLine:function(){return new s(this.topLeft(),this.bottomLeft())},leftMiddle:function(){return new u(this.x,this.y+this.height/2)},moveAndExpand:function(a){return this.x+=a.x||0,this.y+=a.y||0,this.width+=a.width||0,this.height+=a.height||0,this},offset:function(a,b){return u.prototype.offset.call(this,a,b)},inflate:function(a,b){return void 0===a&&(a=0),void 0===b&&(b=a),this.x-=a,this.y-=b,this.width+=2*a,this.height+=2*b,this},normalize:function(){var a=this.x,b=this.y,c=this.width,d=this.height;return this.width<0&&(a=this.x+this.width,c=-this.width),this.height<0&&(b=this.y+this.height,d=-this.height),this.x=a,this.y=b,this.width=c,this.height=d,this},origin:function(){return new u(this.x,this.y)},pointNearestToPoint:function(a){if(a=new u(a),this.containsPoint(a)){var b=this.sideNearestToPoint(a);switch(b){case"right":return new u(this.x+this.width,a.y);case"left":return new u(this.x,a.y);case"bottom":return new u(a.x,this.y+this.height);case"top":return new u(a.x,this.y)}}return a.adhereToRect(this)},rightLine:function(){return new s(this.topRight(),this.bottomRight())},rightMiddle:function(){return new u(this.x+this.width,this.y+this.height/2)},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this.width=l(this.width*b)/b,this.height=l(this.height*b)/b,this},scale:function(a,b,c){return c=this.origin().scale(a,b,c),this.x=c.x,this.y=c.y,this.width*=a,this.height*=b,this},maxRectScaleToFit:function(a,b){a=new v(a),b||(b=a.center());var c,d,e,f,g,h,j,k,l=b.x,m=b.y;c=d=e=f=g=h=j=k=1/0;var n=a.topLeft();n.xl&&(d=(this.x+this.width-l)/(o.x-l)),o.y>m&&(h=(this.y+this.height-m)/(o.y-m));var p=a.topRight();p.x>l&&(e=(this.x+this.width-l)/(p.x-l)),p.ym&&(k=(this.y+this.height-m)/(q.y-m)),{sx:i(c,d,e,f),sy:i(g,h,j,k)}},maxRectUniformScaleToFit:function(a,b){var c=this.maxRectScaleToFit(a,b);return i(c.sx,c.sy)},sideNearestToPoint:function(a){a=new u(a);var b=a.x-this.x,c=this.x+this.width-a.x,d=a.y-this.y,e=this.y+this.height-a.y,f=b,g="left";return cb&&(b=i),jd&&(d=j)}return new v(a,c,b-a,d-c)},clone:function(){var a=this.points,b=a.length;if(0===b)return new w;for(var c=[],d=0;df.x&&(f=c[a]);var g=[];for(a=0;a2){var j=g[g.length-1];g.unshift(j)}for(var k,l,m,n,o,p,q={},r=[];0!==g.length;)if(k=g.pop(),l=k[0],!q.hasOwnProperty(k[0]+"@@"+k[1]))for(var s=!1;!s;)if(r.length<2)r.push(k),s=!0;else{m=r.pop(),n=m[0],o=r.pop(),p=o[0];var t=p.cross(n,l);if(t<0)r.push(o),r.push(m),r.push(k),s=!0;else if(0===t){var u=1e-10,v=n.angleBetween(p,l);e(v-180)2&&r.pop();var x,y=-1;for(b=r.length,a=0;a0){var B=r.slice(y),C=r.slice(0,y);A=B.concat(C)}else A=r;var D=[];for(b=A.length,a=0;a=1)return b[c-1].clone();var d=this.length(),e=d*a;return this.pointAtLength(e)},pointAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return b[0].clone();var d=!0;a<0&&(d=!1,a=-a);for(var e=0,f=c-1,g=d?0:f-1;d?g=0;d?g++:g--){var h=b[g],i=b[g+1],j=new s(h,i),k=h.distance(i);if(a<=e+k)return j.pointAtLength((d?1:-1)*(a-e));e+=k}var l=d?b[c-1]:b[0];return l.clone()},scale:function(a,b,c){var d=this.points,e=d.length;if(0===e)return this;for(var f=0;f1&&(a=1);var d=this.length(),e=d*a;return this.tangentAtLength(e)},tangentAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return null;var d=!0;a<0&&(d=!1,a=-a);for(var e,f=0,g=c-1,h=d?0:g-1;d?h=0;d?h++:h--){var i=b[h],j=b[h+1],k=new s(i,j),l=i.distance(j);if(k.isDifferentiable()){if(a<=f+l)return k.tangentAtLength((d?1:-1)*(a-f));e=k}f+=l}if(e){var m=d?1:0;return e.tangentAt(m)}return null},intersectionWithLine:function(a){for(var b=new s(a),c=[],d=this.points,e=0,f=d.length-1;e0?c:null},translate:function(a,b){var c=this.points,d=c.length;if(0===d)return this;for(var e=0;e=1?b:b*a},pointAtT:function(a){if(this.pointAt)return this.pointAt(a);throw new Error("Neither pointAtT() nor pointAt() function is implemented.")},previousSegment:null,subpathStartSegment:null,tangentAtT:function(a){if(this.tangentAt)return this.tangentAt(a);throw new Error("Neither tangentAtT() nor tangentAt() function is implemented.")},bbox:function(){throw new Error("Declaration missing for virtual function.")},clone:function(){throw new Error("Declaration missing for virtual function.")},closestPoint:function(){throw new Error("Declaration missing for virtual function.")},closestPointLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointNormalizedLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointTangent:function(){throw new Error("Declaration missing for virtual function.")},equals:function(){throw new Error("Declaration missing for virtual function.")},getSubdivisions:function(){throw new Error("Declaration missing for virtual function.")},isDifferentiable:function(){throw new Error("Declaration missing for virtual function.")},length:function(){throw new Error("Declaration missing for virtual function.")},pointAt:function(){throw new Error("Declaration missing for virtual function.")},pointAtLength:function(){throw new Error("Declaration missing for virtual function.")},scale:function(){throw new Error("Declaration missing for virtual function.")},tangentAt:function(){throw new Error("Declaration missing for virtual function.")},tangentAtLength:function(){throw new Error("Declaration missing for virtual function.")},translate:function(){throw new Error("Declaration missing for virtual function.")},serialize:function(){throw new Error("Declaration missing for virtual function.")},toString:function(){throw new Error("Declaration missing for virtual function.")}},C=function(){for(var a=[],c=arguments.length,d=0;d0)throw new Error("Closepath constructor expects no arguments.");return this},J={clone:function(){return new I},getSubdivisions:function(){return[]},isDifferentiable:function(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)},scale:function(){return this},translate:function(){return this},type:"Z",serialize:function(){return this.type},toString:function(){return this.type+" "+this.start+" "+this.end}};Object.defineProperty(J,"start",{configurable:!0,enumerable:!0,get:function(){if(!this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path; OR segment has not yet been added to a path.)");return this.previousSegment.end}}),Object.defineProperty(J,"end",{configurable:!0,enumerable:!0,get:function(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. Moveto); OR segment has not yet been added to a path.)");return this.subpathStartSegment.end}}),I.prototype=c(B,s.prototype,J);var K=t.segmentTypes={L:C,C:E,M:G,Z:I,z:I};t.regexSupportedData=new RegExp("^[\\s\\d"+Object.keys(K).join("")+",.]*$"),t.isDataSupported=function(a){return"string"==typeof a&&this.regexSupportedData.test(a)}}(g); +var V,Vectorizer;V=Vectorizer=function(){"use strict";function a(a,b){a||(a={});var c=q("textPath"),d=a.d;if(d&&void 0===a["xlink:href"]){var e=q("path").attr("d",d).appendTo(b.defs());c.attr("xlink:href","#"+e.id)}return q.isObject(a)&&c.attr(a),c.node}function b(a,b,c){c||(c={});for(var d=c.includeAnnotationIndices,e=c.eol,f=c.lineHeight,g=c.baseSize,h=0,i={},j=b.length-1,k=0;k<=j;k++){var l=b[k],m=null;if(q.isObject(l)){var n=l.attrs,o=q("tspan",n),p=o.node,r=l.t;e&&k===j&&(r+=e),p.textContent=r;var s=n.class;s&&o.addClass(s),d&&o.attr("annotations",l.annotations),m=parseFloat(n["font-size"]),void 0===m&&(m=g),m&&m>h&&(h=m)}else e&&k===j&&(l+=e),p=document.createTextNode(l||" "),g&&g>h&&(h=g);a.appendChild(p)}return h&&(i.maxFontSize=h),f?i.lineHeight=f:h&&(i.lineHeight=1.2*h),i}function c(a,b){var c=parseFloat(a);return s.test(a)?c*b:c}function d(a,b,d,e){if(!Array.isArray(b))return 0;var f=b.length;if(!f)return 0;for(var g=b[0],h=c(g.maxFontSize,d)||d,i=0,j=c(e,d),k=1;k1){var e,g,h=[];for(e=0,g=d.childNodes.length;e0&&D.setAttribute("dy",B),(y>0||g)&&D.setAttribute("x",j),D.className.baseVal=C,r.appendChild(D),v+=E.length+1}if(i)if(l)B=d(h,x,p,o);else if("top"===h)B="0.8em";else{var I;switch(z>0?(I=parseFloat(o)||1,I*=z,s.test(o)||(I/=p)):I=0,h){case"middle":B=.3-I/2+"em";break;case"bottom":B=-I-.3+"em"}}else 0===h?B="0em":h?B=h:(B=0,null===this.attr("y")&&this.attr("y",u||"0.8em"));return r.firstChild.setAttribute("dy",B),this.append(r),this},r.removeAttr=function(a){var b=q.qualifyAttr(a),c=this.node;return b.ns?c.hasAttributeNS(b.ns,b.local)&&c.removeAttributeNS(b.ns,b.local):c.hasAttribute(a)&&c.removeAttribute(a),this},r.attr=function(a,b){if(q.isUndefined(a)){for(var c=this.node.attributes,d={},e=0;e1&&k.push(k[0]),new g.Polyline(k);case"PATH":return l=this.attr("d"),g.Path.isDataSupported(l)||(l=q.normalizePathData(l)),new g.Path(l);case"LINE":return m=parseFloat(this.attr("x1"))||0,o=parseFloat(this.attr("y1"))||0,n=parseFloat(this.attr("x2"))||0,p=parseFloat(this.attr("y2"))||0,new g.Line({x:m,y:o},{x:n,y:p})}return this.getBBox()},r.findIntersection=function(a,b){var c=this.svg().node;b=b||c;var d=this.getBBox({target:b}),e=d.center();if(d.intersectionWithLineFromCenterToPoint(a)){var f,h=this.tagName();if("RECT"===h){var i=new g.Rect(parseFloat(this.attr("x")||0),parseFloat(this.attr("y")||0),parseFloat(this.attr("width")),parseFloat(this.attr("height"))),j=this.getTransformToElement(b),k=q.decomposeMatrix(j),l=c.createSVGTransform();l.setRotate(-k.rotation,e.x,e.y);var m=q.transformRect(i,l.matrix.multiply(j));f=new g.Rect(m).intersectionWithLineFromCenterToPoint(a,k.rotation)}else if("PATH"===h||"POLYGON"===h||"POLYLINE"===h||"CIRCLE"===h||"ELLIPSE"===h){var n,o,p,r,s,t,u="PATH"===h?this:this.convertToPath(),v=u.sample(),w=1/0,x=[];for(n=0;n'+(a||"")+"",c=q.parseXML(b,{async:!1});return c.documentElement},q.idCounter=0,q.uniqueId=function(){return"v-"+ ++q.idCounter},q.toNode=function(a){return q.isV(a)?a.node:a.nodeName&&a||a[0]},q.ensureId=function(a){return a=q.toNode(a),a.id||(a.id=q.uniqueId())},q.sanitizeText=function(a){return(a||"").replace(/ /g,"\xa0")},q.isUndefined=function(a){return"undefined"==typeof a},q.isString=function(a){return"string"==typeof a},q.isObject=function(a){return a&&"object"==typeof a},q.isArray=Array.isArray,q.parseXML=function(a,b){b=b||{};var c;try{var d=new DOMParser;q.isUndefined(b.async)||(d.async=b.async),c=d.parseFromString(a,"text/xml")}catch(a){c=void 0}if(!c||c.getElementsByTagName("parsererror").length)throw new Error("Invalid XML: "+a);return c},q.qualifyAttr=function(a){if(a.indexOf(":")!==-1){var b=a.split(":");return{ns:f[b[0]],local:b[1]}}return{ns:null,local:a}},q.transformRegex=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,q.transformSeparatorRegex=/[ ,]+/,q.transformationListRegex=/^(\w+)\((.*)\)/,q.transformStringToMatrix=function(a){var b=q.createSVGMatrix(),c=a&&a.match(q.transformRegex);if(!c)return b;for(var d=0,e=c.length;d=0){var f=q.transformStringToMatrix(a),g=q.decomposeMatrix(f);b=[g.translateX,g.translateY],d=[g.scaleX,g.scaleY],c=[g.rotation];var h=[];0===b[0]&&0===b[0]||h.push("translate("+b+")"),1===d[0]&&1===d[1]||h.push("scale("+d+")"),0!==c[0]&&h.push("rotate("+c+")"),a=h.join(" ")}else{var i=a.match(/translate\((.*?)\)/);i&&(b=i[1].split(e));var j=a.match(/rotate\((.*?)\)/);j&&(c=j[1].split(e));var k=a.match(/scale\((.*?)\)/);k&&(d=k[1].split(e))}}var l=d&&d[0]?parseFloat(d[0]):1;return{value:a,translate:{tx:b&&b[0]?parseInt(b[0],10):0,ty:b&&b[1]?parseInt(b[1],10):0},rotate:{angle:c&&c[0]?parseInt(c[0],10):0,cx:c&&c[1]?parseInt(c[1],10):void 0,cy:c&&c[2]?parseInt(c[2],10):void 0},scale:{sx:l,sy:d&&d[1]?parseFloat(d[1]):l}}},q.deltaTransformPoint=function(a,b){var c=b.x*a.a+b.y*a.c+0,d=b.x*a.b+b.y*a.d+0;return{x:c,y:d}},q.decomposeMatrix=function(a){var b=q.deltaTransformPoint(a,{x:0,y:1}),c=q.deltaTransformPoint(a,{x:1,y:0}),d=180/j*k(b.y,b.x)-90,e=180/j*k(c.y,c.x);return{translateX:a.e,translateY:a.f,scaleX:l(a.a*a.a+a.b*a.b),scaleY:l(a.c*a.c+a.d*a.d),skewX:d,skewY:e,rotation:d}},q.matrixToScale=function(a){var b,c,d,e;return a?(b=q.isUndefined(a.a)?1:a.a,e=q.isUndefined(a.d)?1:a.d,c=a.b,d=a.c):b=e=1,{sx:c?l(b*b+c*c):b,sy:d?l(d*d+e*e):e}},q.matrixToRotate=function(a){var b={x:0,y:1};return a&&(b=q.deltaTransformPoint(a,b)),{angle:g.normalizeAngle(g.toDeg(k(b.y,b.x))-90)}},q.matrixToTranslate=function(a){return{tx:a&&a.e||0,ty:a&&a.f||0}},q.isV=function(a){return a instanceof q},q.isVElement=q.isV;var t=q("svg").node;return q.createSVGMatrix=function(a){var b=t.createSVGMatrix();for(var c in a)b[c]=a[c];return b},q.createSVGTransform=function(a){return q.isUndefined(a)?t.createSVGTransform():(a instanceof SVGMatrix||(a=q.createSVGMatrix(a)),t.createSVGTransformFromMatrix(a))},q.createSVGPoint=function(a,b){var c=t.createSVGPoint();return c.x=a,c.y=b,c},q.transformRect=function(a,b){var c=t.createSVGPoint();c.x=a.x,c.y=a.y;var d=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y;var e=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y+a.height;var f=c.matrixTransform(b);c.x=a.x,c.y=a.y+a.height;var h=c.matrixTransform(b),i=m(d.x,e.x,f.x,h.x),j=n(d.x,e.x,f.x,h.x),k=m(d.y,e.y,f.y,h.y),l=n(d.y,e.y,f.y,h.y);return new g.Rect(i,k,j-i,l-k)},q.transformPoint=function(a,b){return new g.Point(q.createSVGPoint(a.x,a.y).matrixTransform(b))},q.transformLine=function(a,b){return new g.Line(q.transformPoint(a.start,b),q.transformPoint(a.end,b))},q.transformPolyline=function(a,b){var c=a instanceof g.Polyline?a.points:a;q.isArray(c)||(c=[]);for(var d=[],e=0,f=c.length;e=e?f?"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"M0,"+f+"A"+f+","+f+" 0 1,0 0,"+-f+"A"+f+","+f+" 0 1,0 0,"+f+"Z":"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z":f?"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L"+f*q+","+f*r+"A"+f+","+f+" 0 "+l+",0 "+f*m+","+f*n+"Z":"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L0,0Z"},q.mergeAttrs=function(a,b){for(var c in b)"class"===c?a[c]=a[c]?a[c]+" "+b[c]:b[c]:"style"===c?q.isObject(a[c])&&q.isObject(b[c])?a[c]=q.mergeAttrs(a[c],b[c]):q.isObject(a[c])?a[c]=q.mergeAttrs(a[c],q.styleToObject(b[c])):q.isObject(b[c])?a[c]=q.mergeAttrs(q.styleToObject(a[c]),b[c]):a[c]=q.mergeAttrs(q.styleToObject(a[c]),q.styleToObject(b[c])):a[c]=b[c];return a},q.annotateString=function(a,b,c){b=b||[],c=c||{};for(var d,e,f,g=c.offset||0,h=[],i=[],j=0;j=m&&j=a.start&&ba.start&&c<=a.end||a.start>=b&&a.end=b?a.end+=c:a.start>=b&&(a.start+=c,a.end+=c)}),a},q.convertLineToPathData=function(a){a=q(a);var b=["M",a.attr("x1"),a.attr("y1"),"L",a.attr("x2"),a.attr("y2")].join(" ");return b},q.convertPolygonToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)+" Z"},q.convertPolylineToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)},q.svgPointsToPath=function(a){for(var b=0,c=a.length;b1&&(z=o(z),d*=z,e*=z);var A=d*d,B=e*e,C=(g==h?-1:1)*o(p((A*B-A*y*y-B*x*x)/(A*y*y+B*x*x))),D=C*d*y/e+(a+i)/2,E=C*-e*x/d+(c+q)/2,F=n(((c-E)/e).toFixed(9)),G=n(((q-E)/e).toFixed(9));F=aG&&(F-=2*j),(!h&&G)>F&&(G-=2*j)}var H=G-F;if(p(H)>t){var I=G,J=i,K=q;G=F+t*((h&&G)>F?1:-1),i=D+d*l(G),q=E+e*k(G),v=b(i,q,d,e,f,0,h,J,K,[G,I,D,E])}H=G-F;var L=l(F),M=k(F),N=l(G),O=k(G),P=m(H/4),Q=4/3*(d*P),R=4/3*(e*P),S=[a,c],T=[a+Q*M,c-R*L],U=[i+Q*O,q-R*N],V=[i,q];if(T[0]=2*S[0]-T[0],T[1]=2*S[1]-T[1],r)return[T,U,V].concat(v);v=[T,U,V].concat(v).join().split(",");for(var W=[],X=v.length,Y=0;Y2&&(c.push([d].concat(f.splice(0,2))),g="l",d="m"===d?"l":"L");f.length>=b[g]&&(c.push([d].concat(f.splice(0,b[g]))),b[g]););}),c}function d(a){if(Array.isArray(a)&&Array.isArray(a&&a[0])||(a=c(a)),!a||!a.length)return[["M",0,0]];for(var b,d=[],e=0,f=0,g=0,h=0,i=0,j=a.length,k=i;k7){a[b].shift();for(var c=a[b];c.length;)i[b]="A",a.splice(b++,0,["C"].concat(c.splice(0,6)));a.splice(b,1),l=g.length}}for(var g=d(c),h={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=[],j="",k="",l=g.length,m=0;m0&&(k=i[m-1])),g[m]=e(g[m],h,k),"A"!==i[m]&&"C"===j&&(i[m]="C"),f(g,m);var n=g[m],o=n.length;h.x=n[o-2],h.y=n[o-1],h.bx=parseFloat(n[o-4])||h.x,h.by=parseFloat(n[o-3])||h.y}return g[0][0]&&"M"===g[0][0]||g.unshift(["M",0,0]),g}var f="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",g=new RegExp("([a-z])["+f+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+f+"]*,?["+f+"]*)+)","ig"),h=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+f+"]*,?["+f+"]*","ig"),i=Math,j=i.PI,k=i.sin,l=i.cos,m=i.tan,n=i.asin,o=i.sqrt,p=i.abs;return function(a){return e(a).join(",").split(",").join(" ")}}(),q.namespace=f,q}(); +var joint={version:"2.1.4",config:{classNamePrefix:"joint-",defaultTheme:"default"},dia:{},ui:{},layout:{},shapes:{},format:{},connectors:{},highlighters:{},routers:{},anchors:{},connectionPoints:{},connectionStrategies:{},linkTools:{},mvc:{views:{}},setTheme:function(a,b){b=b||{},joint.util.invoke(joint.mvc.views,"setTheme",a,b),joint.mvc.View.prototype.defaultTheme=a},env:{_results:{},_tests:{svgforeignobject:function(){return!!document.createElementNS&&/SVGForeignObject/.test({}.toString.call(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")))}},addTest:function(a,b){return joint.env._tests[a]=b},test:function(a){var b=joint.env._tests[a];if(!b)throw new Error('Test not defined ("'+a+'"). Use `joint.env.addTest(name, fn) to add a new test.`');var c=joint.env._results[a];if("undefined"!=typeof c)return c;try{c=b()}catch(a){c=!1}return joint.env._results[a]=c,c}},util:{hashCode:function(a){var b=0;if(0==a.length)return b;for(var c=0;c0){var f=joint.util.getByPath(a,d,c);f&&delete f[e]}else delete a[e];return a},flattenObject:function(a,b,c){b=b||"/";var d={};for(var e in a)if(a.hasOwnProperty(e)){var f="object"==typeof a[e];if(f&&c&&c(a[e])&&(f=!1),f){var g=this.flattenObject(a[e],b,c);for(var h in g)g.hasOwnProperty(h)&&(d[e+b+h]=g[h])}else d[e]=a[e]}return d},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)})},guid:function(a){return this.guid.id=this.guid.id||1,a.id=void 0===a.id?"j_"+this.guid.id++:a.id,a.id},toKebabCase:function(a){return a.replace(/[A-Z]/g,"-$&").toLowerCase()},normalizeEvent:function(a){var b=a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches[0];if(b){for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return a},nextFrame:function(){var a;if("undefined"!=typeof window&&(a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame),!a){var b=0;a=function(a){var c=(new Date).getTime(),d=Math.max(0,16-(c-b)),e=setTimeout(function(){a(c+d)},d);return b=c+d,e}}return function(b,c){return a(c?b.bind(c):b)}}(),cancelFrame:function(){var a,b="undefined"!=typeof window;return b&&(a=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.msCancelRequestAnimationFrame||window.oCancelAnimationFrame||window.oCancelRequestAnimationFrame||window.mozCancelAnimationFrame||window.mozCancelRequestAnimationFrame),a=a||clearTimeout,b?a.bind(window):a}(),shapePerimeterConnectionPoint:function(a,b,c,d){var e,f;if(!c){var g=b.$(".scalable")[0],h=b.$(".rotatable")[0];g&&g.firstChild?c=g.firstChild:h&&h.firstChild&&(c=h.firstChild)}return c?(f=V(c).findIntersection(d,a.paper.viewport),f||(e=V(c).getBBox({target:a.paper.viewport}))):(e=b.model.getBBox(),f=e.intersectionWithLineFromCenterToPoint(d)),f||e.center()},isPercentage:function(a){return joint.util.isString(a)&&"%"===a.slice(-1)},parseCssNumeric:function(a,b){b=b||[];var c={value:parseFloat(a)};if(Number.isNaN(c.value))return null;var d=b.join("|");if(joint.util.isString(a)){var e=new RegExp("(\\d+)("+d+")$").exec(a);if(!e)return null;e[2]&&(c.unit=e[2])}return c},breakText:function(a,b,c,d){d=d||{},c=c||{};var e=b.width,f=b.height,g=d.svgDocument||V("svg").node,h=V("tspan").node,i=V("text").attr(c).append(h).node,j=document.createTextNode("");i.style.opacity=0,i.style.display="block",h.style.display="block",h.appendChild(j),g.appendChild(i),d.svgDocument||document.body.appendChild(g);for(var k,l,m=d.separator||" ",n=d.eol||"\n",o=a.split(m),p=[],q=[],r=0,s=0,t=o.length;r=0)if(u.length>1){for(var v=u.split(n),w=0,x=v.length-1;wf){q.splice(Math.floor(f/l));break}}}}return d.svgDocument?g.removeChild(i):document.body.removeChild(g),q.join(n)},sanitizeHTML:function(a){var b=$($.parseHTML("
"+a+"
",null,!1));return b.find("*").each(function(){var a=this;$.each(a.attributes,function(){var b=this,c=b.name,d=b.value;0!==c.indexOf("on")&&0!==d.indexOf("javascript:")||$(a).removeAttr(c)})}),b.html()},downloadBlob:function(a,b){if(window.navigator.msSaveBlob)window.navigator.msSaveBlob(a,b);else{var c=window.URL.createObjectURL(a),d=document.createElement("a");d.href=c,d.download=b,document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c)}},downloadDataUri:function(a,b){var c=joint.util.dataUriToBlob(a);joint.util.downloadBlob(c,b)},dataUriToBlob:function(a){a=a.replace(/\s/g,""),a=decodeURIComponent(a);var b,c=a.indexOf(","),d=a.slice(0,c),e=d.split(":")[1].split(";")[0],f=a.slice(c+1);b=d.indexOf("base64")>=0?atob(f):unescape(encodeURIComponent(f));for(var g=new Uint8Array(b.length),h=0;h=1)return 1;var b=a*a,c=b*a;return 4*(a<.5?c:3*(a-b)+c-.75)},exponential:function(a){return Math.pow(2,10*(a-1))},bounce:function(a){for(var b=0,c=1;1;b+=c,c/=2)if(a>=(7-4*b)/11){var d=(11-6*b-11*a)/4;return-d*d+c*c}},reverse:function(a){return function(b){return 1-a(1-b)}},reflect:function(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}},clamp:function(a,b,c){return b=b||0,c=c||1,function(d){var e=a(d);return ec?c:e}},back:function(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}},elastic:function(a){return a||(a=1.5),function(b){return Math.pow(2,10*(b-1))*Math.cos(20*Math.PI*a/3*b)}}},interpolate:{number:function(a,b){var c=b-a;return function(b){return a+c*b}},object:function(a,b){var c=Object.keys(a);return function(d){var e,f,g={};for(e=c.length-1;e!=-1;e--)f=c[e],g[f]=a[f]+(b[f]-a[f])*d;return g}},hexColor:function(a,b){var c=parseInt(a.slice(1),16),d=parseInt(b.slice(1),16),e=255&c,f=(255&d)-e,g=65280&c,h=(65280&d)-g,i=16711680&c,j=(16711680&d)-i;return function(a){var b=e+f*a&255,c=g+h*a&65280,d=i+j*a&16711680;return"#"+(1<<24|b|c|d).toString(16).slice(1)}},unit:function(a,b){var c=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,d=c.exec(a),e=c.exec(b),f=e[1].indexOf("."),g=f>0?e[1].length-f-1:0;a=+d[1];var h=+e[1]-a,i=d[2];return function(b){return(a+h*b).toFixed(g)+i}}},filter:{outline:function(a){var b='',c=Number.isFinite(a.margin)?a.margin:2,d=Number.isFinite(a.width)?a.width:1;return joint.util.template(b)({color:a.color||"blue",opacity:Number.isFinite(a.opacity)?a.opacity:1,outerRadius:c+d,innerRadius:c})},highlight:function(a){var b='';return joint.util.template(b)({color:a.color||"red",width:Number.isFinite(a.width)?a.width:1,blur:Number.isFinite(a.blur)?a.blur:0,opacity:Number.isFinite(a.opacity)?a.opacity:1})},blur:function(a){var b=Number.isFinite(a.x)?a.x:2;return joint.util.template('')({stdDeviation:Number.isFinite(a.y)?[b,a.y]:b})},dropShadow:function(a){var b="SVGFEDropShadowElement"in window?'':'';return joint.util.template(b)({dx:a.dx||0,dy:a.dy||0,opacity:Number.isFinite(a.opacity)?a.opacity:1,color:a.color||"black",blur:Number.isFinite(a.blur)?a.blur:4})},grayscale:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({a:.2126+.7874*(1-b),b:.7152-.7152*(1-b),c:.0722-.0722*(1-b),d:.2126-.2126*(1-b),e:.7152+.2848*(1-b),f:.0722-.0722*(1-b),g:.2126-.2126*(1-b),h:.0722+.9278*(1-b)})},sepia:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({a:.393+.607*(1-b),b:.769-.769*(1-b),c:.189-.189*(1-b),d:.349-.349*(1-b),e:.686+.314*(1-b),f:.168-.168*(1-b),g:.272-.272*(1-b),h:.534-.534*(1-b),i:.131+.869*(1-b)})},saturate:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:1-b})},hueRotate:function(a){return joint.util.template('')({angle:a.angle||0})},invert:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:b,amount2:1-b})},brightness:function(a){return joint.util.template('')({amount:Number.isFinite(a.amount)?a.amount:1})},contrast:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:b,amount2:.5-b/2})}},format:{number:function(a,b,c){function d(a){for(var b=a.length,d=[],e=0,f=c.grouping[0];b>0&&f>0;)d.push(a.substring(b-=f,b+f)),f=c.grouping[e=(e+1)%c.grouping.length];return d.reverse().join(c.thousands)}c=c||{currency:["$",""],decimal:".",thousands:",",grouping:[3]};var e=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,f=e.exec(a),g=f[1]||" ",h=f[2]||">",i=f[3]||"",j=f[4]||"",k=f[5],l=+f[6],m=f[7],n=f[8],o=f[9],p=1,q="",r="",s=!1;switch(n&&(n=+n.substring(1)),(k||"0"===g&&"="===h)&&(k=g="0",h="=",m&&(l-=Math.floor((l-1)/4))),o){case"n":m=!0,o="g";break;case"%":p=100,r="%",o="f";break;case"p":p=100,r="%",o="r";break;case"b":case"o":case"x":case"X":"#"===j&&(q="0"+o.toLowerCase());break;case"c":case"d":s=!0,n=0;break;case"s":p=-1,o="r"}"$"===j&&(q=c.currency[0],r=c.currency[1]),"r"!=o||n||(o="g"),null!=n&&("g"==o?n=Math.max(1,Math.min(21,n)):"e"!=o&&"f"!=o||(n=Math.max(0,Math.min(20,n))));var t=k&&m;if(s&&b%1)return"";var u=b<0||0===b&&1/b<0?(b=-b,"-"):i,v=r;if(p<0){var w=this.prefix(b,n);b=w.scale(b),v=w.symbol+r}else b*=p;b=this.convert(o,b,n);var x=b.lastIndexOf("."),y=x<0?b:b.substring(0,x),z=x<0?"":c.decimal+b.substring(x+1);!k&&m&&c.grouping&&(y=d(y));var A=q.length+y.length+z.length+(t?0:u.length),B=A"===h?B+u+b:"^"===h?B.substring(0,A>>=1)+u+b+B.substring(A):u+(t?b:B+b))+v},string:function(a,b){for(var c,d="{",e=!1,f=[];(c=a.indexOf(d))!==-1;){var g,h,i;if(g=a.slice(0,c),e){h=g.split(":"),i=h.shift().split("."),g=b;for(var j=0;j8?function(a){return a/c}:function(a){return a*c},symbol:a}}),d=0;return a&&(a<0&&(a*=-1),b&&(a=this.round(a,this.precision(a,b))),d=1+Math.floor(1e-12+Math.log(a)/Math.LN10),d=Math.max(-24,Math.min(24,3*Math.floor((d<=0?d+1:d-1)/3)))),c[8+d/3]}},template:function(a){var b=/<%= ([^ ]+) %>|\$\{ ?([^{} ]+) ?\}|\{\{([^{} ]+)\}\}/g;return function(c){return c=c||{},a.replace(b,function(a){for(var b=Array.from(arguments),d=b.slice(1,4).find(function(a){return!!a}),e=d.split("."),f=c[e.shift()];void 0!==f&&e.length;)f=f[e.shift()];return void 0!==f?f:""})}},toggleFullScreen:function(a){function b(a,b){for(var c=["webkit","moz","ms","o",""],d=0;d0&&b[0]||[],e=c>1&&b[c-1]||{};return Array.isArray(d)||(e instanceof joint.dia.Cell?d=b:d instanceof joint.dia.Cell&&(b.length>1&&b.pop(),d=b)),e instanceof joint.dia.Cell&&(e={}),a.call(this,d,e)}}},parseDOMJSON:function(a,b){for(var c={},d=V.namespace.xmlns,e=b||d,f=document.createDocumentFragment(),g=[a,f,e];g.length>0;){e=g.pop();for(var h=g.pop(),i=g.pop(),j=0,k=i.length;j0);return this.stopBatch("clear"),this},_prepareCell:function(a,b){var c;if(a instanceof Backbone.Model?(c=a.attributes,a.graph||b&&b.dry||(a.graph=this)):c=a,!joint.util.isString(c.type))throw new TypeError("dia.Graph: cell type must be a string.");return a},minZIndex:function(){var a=this.get("cells").first();return a?a.get("z")||0:0},maxZIndex:function(){var a=this.get("cells").last();return a?a.get("z")||0:0},addCell:function(a,b){return Array.isArray(a)?this.addCells(a,b):(a instanceof Backbone.Model?a.has("z")||a.set("z",this.maxZIndex()+1):void 0===a.z&&(a.z=this.maxZIndex()+1),this.get("cells").add(this._prepareCell(a,b),b||{}),this)},addCells:function(a,b){return a.length&&(a=joint.util.flattenDeep(a),b.position=a.length,this.startBatch("add"),a.forEach(function(a){b.position--,this.addCell(a,b)},this),this.stopBatch("add")),this},resetCells:function(a,b){var c=joint.util.toArray(a).map(function(a){return this._prepareCell(a,b)},this);return this.get("cells").reset(c,b),this},removeCells:function(a,b){return a.length&&(this.startBatch("remove"),joint.util.invoke(a,"remove",b),this.stopBatch("remove")),this},_removeCell:function(a,b,c){c=c||{},c.clear||(c.disconnectLinks?this.disconnectLinks(a,c):this.removeLinks(a,c)),this.get("cells").remove(a,{silent:!0}),a.graph===this&&(a.graph=null)},getCell:function(a){return this.get("cells").get(a)},getCells:function(){return this.get("cells").toArray()},getElements:function(){return Object.keys(this._nodes).map(this.getCell,this)},getLinks:function(){return Object.keys(this._edges).map(this.getCell,this)},getFirstCell:function(){return this.get("cells").first()},getLastCell:function(){return this.get("cells").last()},getConnectedLinks:function(a,b){b=b||{};var c=b.inbound,d=b.outbound;void 0===c&&void 0===d&&(c=d=!0);var e=[],f={};if(d&&joint.util.forIn(this.getOutboundEdges(a.id),function(a,b){f[b]||(e.push(this.getCell(b)),f[b]=!0)}.bind(this)),c&&joint.util.forIn(this.getInboundEdges(a.id),function(a,b){f[b]||(e.push(this.getCell(b)),f[b]=!0)}.bind(this)),b.deep){var g=a.getEmbeddedCells({deep:!0}),h={};g.forEach(function(a){a.isElement()&&(h[a.id]=!0)}),g.forEach(function(a){a.isLink()||(d&&joint.util.forIn(this.getOutboundEdges(a.id),function(a,c){if(!f[c]){var d=this.getCell(c),g=d.source().id,i=d.target().id;if(!b.includeEnclosed&&g&&h[g]&&i&&h[i])return;e.push(this.getCell(c)),f[c]=!0}}.bind(this)),c&&joint.util.forIn(this.getInboundEdges(a.id),function(a,c){if(!f[c]){var d=this.getCell(c),g=d.source().id,i=d.target().id;if(!b.includeEnclosed&&g&&h[g]&&i&&h[i])return;e.push(this.getCell(c)),f[c]=!0}}.bind(this)))},this)}return e},getNeighbors:function(a,b){b=b||{};var c=b.inbound,d=b.outbound;void 0===c&&void 0===d&&(c=d=!0);var e=this.getConnectedLinks(a,b).reduce(function(e,f){var g=f.source(),h=f.target(),i=f.hasLoop(b);if(c&&joint.util.has(g,"id")&&!e[g.id]){var j=this.getCell(g.id);!i&&(!j||j===a||b.deep&&j.isEmbeddedIn(a))||(e[g.id]=j)}if(d&&joint.util.has(h,"id")&&!e[h.id]){var k=this.getCell(h.id);!i&&(!k||k===a||b.deep&&k.isEmbeddedIn(a))||(e[h.id]=k)}return e}.bind(this),{});return joint.util.toArray(e)},getCommonAncestor:function(){var a=Array.from(arguments).map(function(a){for(var b=[],c=a.get("parent");c;)b.push(c),c=this.getCell(c).get("parent");return b},this);a=a.sort(function(a,b){return a.length-b.length});var b=joint.util.toArray(a.shift()).find(function(b){return a.every(function(a){return a.includes(b)})});return this.getCell(b)},getSuccessors:function(a,b){b=b||{};var c=[];return this.search(a,function(b){b!==a&&c.push(b)},joint.util.assign({},b,{outbound:!0})),c},cloneCells:function(a){a=joint.util.uniq(a);var b=joint.util.toArray(a).reduce(function(a,b){return a[b.id]=b.clone(),a},{});return joint.util.toArray(a).forEach(function(a){var c=b[a.id];if(c.isLink()){var d=c.source(),e=c.target();d.id&&b[d.id]&&c.prop("source/id",b[d.id].id),e.id&&b[e.id]&&c.prop("target/id",b[e.id].id)}var f=a.get("parent");f&&b[f]&&c.set("parent",b[f].id);var g=joint.util.toArray(a.get("embeds")).reduce(function(a,c){return b[c]&&a.push(b[c].id),a},[]);joint.util.isEmpty(g)||c.set("embeds",g)}),b},cloneSubgraph:function(a,b){var c=this.getSubgraph(a,b);return this.cloneCells(c)},getSubgraph:function(a,b){b=b||{};var c=[],d={},e=[],f=[];return joint.util.toArray(a).forEach(function(a){if(d[a.id]||(c.push(a),d[a.id]=a,a.isLink()?f.push(a):e.push(a)),b.deep){var g=a.getEmbeddedCells({deep:!0});g.forEach(function(a){d[a.id]||(c.push(a),d[a.id]=a,a.isLink()?f.push(a):e.push(a))})}}),f.forEach(function(a){var b=a.source(),f=a.target(); if(b.id&&!d[b.id]){var g=this.getCell(b.id);c.push(g),d[g.id]=g,e.push(g)}if(f.id&&!d[f.id]){var h=this.getCell(f.id);c.push(this.getCell(f.id)),d[h.id]=h,e.push(h)}},this),e.forEach(function(a){var e=this.getConnectedLinks(a,b);e.forEach(function(a){var b=a.source(),e=a.target();!d[a.id]&&b.id&&d[b.id]&&e.id&&d[e.id]&&(c.push(a),d[a.id]=a)})},this),c},getPredecessors:function(a,b){b=b||{};var c=[];return this.search(a,function(b){b!==a&&c.push(b)},joint.util.assign({},b,{inbound:!0})),c},search:function(a,b,c){c=c||{},c.breadthFirst?this.bfs(a,b,c):this.dfs(a,b,c)},bfs:function(a,b,c){c=c||{};var d={},e={},f=[];for(f.push(a),e[a.id]=0;f.length>0;){var g=f.shift();if(!d[g.id]){if(d[g.id]=!0,b(g,e[g.id])===!1)return;this.getNeighbors(g,c).forEach(function(a){e[a.id]=e[g.id]+1,f.push(a)})}}},dfs:function(a,b,c,d,e){c=c||{};var f=d||{},g=e||0;b(a,g)!==!1&&(f[a.id]=!0,this.getNeighbors(a,c).forEach(function(a){f[a.id]||this.dfs(a,b,c,f,g+1)},this))},getSources:function(){var a=[];return joint.util.forIn(this._nodes,function(b,c){this._in[c]&&!joint.util.isEmpty(this._in[c])||a.push(this.getCell(c))}.bind(this)),a},getSinks:function(){var a=[];return joint.util.forIn(this._nodes,function(b,c){this._out[c]&&!joint.util.isEmpty(this._out[c])||a.push(this.getCell(c))}.bind(this)),a},isSource:function(a){return!this._in[a.id]||joint.util.isEmpty(this._in[a.id])},isSink:function(a){return!this._out[a.id]||joint.util.isEmpty(this._out[a.id])},isSuccessor:function(a,b){var c=!1;return this.search(a,function(d){if(d===b&&d!==a)return c=!0,!1},{outbound:!0}),c},isPredecessor:function(a,b){var c=!1;return this.search(a,function(d){if(d===b&&d!==a)return c=!0,!1},{inbound:!0}),c},isNeighbor:function(a,b,c){c=c||{};var d=c.inbound,e=c.outbound;void 0===d&&void 0===e&&(d=e=!0);var f=!1;return this.getConnectedLinks(a,c).forEach(function(a){var c=a.source(),g=a.target();return d&&joint.util.has(c,"id")&&c.id===b.id?(f=!0,!1):e&&joint.util.has(g,"id")&&g.id===b.id?(f=!0,!1):void 0}),f},disconnectLinks:function(a,b){this.getConnectedLinks(a).forEach(function(c){c.set(c.source().id===a.id?"source":"target",{x:0,y:0},b)})},removeLinks:function(a,b){joint.util.invoke(this.getConnectedLinks(a),"remove",b)},findModelsFromPoint:function(a){return this.getElements().filter(function(b){return b.getBBox().containsPoint(a)})},findModelsInArea:function(a,b){a=g.rect(a),b=joint.util.defaults(b||{},{strict:!1});var c=b.strict?"containsRect":"intersect";return this.getElements().filter(function(b){return a[c](b.getBBox())})},findModelsUnderElement:function(a,b){b=joint.util.defaults(b||{},{searchBy:"bbox"});var c=a.getBBox(),d="bbox"===b.searchBy?this.findModelsInArea(c):this.findModelsFromPoint(c[b.searchBy]());return d.filter(function(b){return a.id!==b.id&&!b.isEmbeddedIn(a)})},getBBox:function(a,b){return this.getCellsBBox(a||this.getElements(),b)},getCellsBBox:function(a,b){return joint.util.toArray(a).reduce(function(a,c){return c.isLink()?a:a?a.union(c.getBBox(b)):c.getBBox(b)},null)},translate:function(a,b,c){var d=this.getCells().filter(function(a){return!a.isEmbedded()});return joint.util.invoke(d,"translate",a,b,c),this},resize:function(a,b,c){return this.resizeCells(a,b,this.getCells(),c)},resizeCells:function(a,b,c,d){var e=this.getCellsBBox(c);if(e){var f=Math.max(a/e.width,0),g=Math.max(b/e.height,0);joint.util.invoke(c,"scale",f,g,e.origin(),d)}return this},startBatch:function(a,b){return b=b||{},this._batches[a]=(this._batches[a]||0)+1,this.trigger("batch:start",joint.util.assign({},b,{batchName:a}))},stopBatch:function(a,b){return b=b||{},this._batches[a]=(this._batches[a]||0)-1,this.trigger("batch:stop",joint.util.assign({},b,{batchName:a}))},hasActiveBatch:function(a){return 0===arguments.length?joint.util.toArray(this._batches).some(function(a){return a>0}):Array.isArray(a)?a.some(function(a){return!!this._batches[a]},this):!!this._batches[a]}},{validations:{multiLinks:function(a,b){var c=b.source(),d=b.target();if(c.id&&d.id){var e=b.getSourceElement();if(e){var f=a.getConnectedLinks(e,{outbound:!0}),g=f.filter(function(a){var b=a.source(),e=a.target();return b&&b.id===c.id&&(!b.port||b.port===c.port)&&e&&e.id===d.id&&(!e.port||e.port===d.port)});if(g.length>1)return!1}}return!0},linkPinning:function(a,b){return b.source().id&&b.target().id}}}),joint.util.wrapWith(joint.dia.Graph.prototype,["resetCells","addCells","removeCells"],"cells"),function(a,b,c,d,e){function f(a,b){return function(c,d){var f=e.isPercentage(c);c=parseFloat(c),f&&(c/=100);var g={};if(isFinite(c)){var h=f||c>=0&&c<=1?c*d[b]:Math.max(c+d[b],0);g[a]=h}return g}}function g(a,b,d){return function(f,g){var h=e.isPercentage(f);f=parseFloat(f),h&&(f/=100);var i;if(isFinite(f)){var j=g[d]();i=h||f>0&&f<1?j[a]+g[b]*f:j[a]+f}var k=c.Point();return k[a]=i||0,k}}function h(a,b,d){return function(f,g){var h;h="middle"===f?g[b]/2:f===d?g[b]:isFinite(f)?f>-1&&f<1?-g[b]*f:-f:e.isPercentage(f)?g[b]*parseFloat(f)/100:0;var i=c.Point();return i[a]=-(g[a]+h),i}}function i(a,b){var c="joint-shape",e=b&&b.resetOffset;return function(b,f,g){var h=d(g),i=h.data(c);if(!i||i.value!==b){var j=a(b);i={value:b,shape:j,shapeBBox:j.bbox()},h.data(c,i)}var k=i.shape.clone(),l=i.shapeBBox.clone(),m=l.origin(),n=f.origin();l.x=n.x,l.y=n.y;var o=f.maxRectScaleToFit(l,n),p=0===l.width||0===f.width?1:o.sx,q=0===l.height||0===f.height?1:o.sy;return k.scale(p,q,m),e&&k.translate(-m.x,-m.y),k}}function j(a){function d(a){return new c.Path(b.normalizePathData(a))}var e=i(d,a);return function(a,b,c){var d=e(a,b,c);return{d:d.serialize()}}}function k(a){var b=i(c.Polyline,a);return function(a,c,d){var e=b(a,c,d);return{points:e.serialize()}}}function l(a,b){var d=new c.Point(1,0);return function(c){var e,f,g=this[a](c);return g?(f=b.rotate?g.vector().vectorAngle(d):0,e=g.start):(e=this.path.start,f=0),0===f?{transform:"translate("+e.x+","+e.y+")"}:{transform:"translate("+e.x+","+e.y+") rotate("+f+")"}}}function m(a,b,c){return void 0!==c.text}function n(){return this instanceof a.dia.LinkView}function o(a){var b={},c=a.stroke;"string"==typeof c&&(b.stroke=c,b.fill=c);var d=a.strokeOpacity;return void 0===d&&(d=a["stroke-opacity"]),void 0===d&&(d=a.opacity),void 0!==d&&(b["stroke-opacity"]=d,b["fill-opacity"]=d),b}var p=a.dia.attributes={xlinkHref:{set:"xlink:href"},xlinkShow:{set:"xlink:show"},xlinkRole:{set:"xlink:role"},xlinkType:{set:"xlink:type"},xlinkArcrole:{set:"xlink:arcrole"},xlinkTitle:{set:"xlink:title"},xlinkActuate:{set:"xlink:actuate"},xmlSpace:{set:"xml:space"},xmlBase:{set:"xml:base"},xmlLang:{set:"xml:lang"},preserveAspectRatio:{set:"preserveAspectRatio"},requiredExtension:{set:"requiredExtension"},requiredFeatures:{set:"requiredFeatures"},systemLanguage:{set:"systemLanguage"},externalResourcesRequired:{set:"externalResourceRequired"},filter:{qualify:e.isPlainObject,set:function(a){return"url(#"+this.paper.defineFilter(a)+")"}},fill:{qualify:e.isPlainObject,set:function(a){return"url(#"+this.paper.defineGradient(a)+")"}},stroke:{qualify:e.isPlainObject,set:function(a){return"url(#"+this.paper.defineGradient(a)+")"}},sourceMarker:{qualify:e.isPlainObject,set:function(a,b,c,d){return a=e.assign(o(d),a),{"marker-start":"url(#"+this.paper.defineMarker(a)+")"}}},targetMarker:{qualify:e.isPlainObject,set:function(a,b,c,d){return a=e.assign(o(d),{transform:"rotate(180)"},a),{"marker-end":"url(#"+this.paper.defineMarker(a)+")"}}},vertexMarker:{qualify:e.isPlainObject,set:function(a,b,c,d){return a=e.assign(o(d),a),{"marker-mid":"url(#"+this.paper.defineMarker(a)+")"}}},text:{qualify:function(a,b,c){return!c.textWrap||!e.isPlainObject(c.textWrap)},set:function(c,f,g,h){var i=d(g),j="joint-text",k=i.data(j),l=a.util.pick(h,"lineHeight","annotations","textPath","x","textVerticalAnchor","eol"),m=l.fontSize=h["font-size"]||h.fontSize,n=JSON.stringify([c,l]);if(void 0===k||k!==n){m&&g.setAttribute("font-size",m);var o=l.textPath;if(e.isObject(o)){var p=o.selector;if("string"==typeof p){var q=this.findBySelector(p)[0];q instanceof SVGPathElement&&(l.textPath=e.assign({"xlink:href":"#"+q.id},o))}}b(g).text(""+c,l),i.data(j,n)}}},textWrap:{qualify:e.isPlainObject,set:function(b,c,d,f){var g=b.width||0;e.isPercentage(g)?c.width*=parseFloat(g)/100:g<=0?c.width+=g:c.width=g;var h=b.height||0;e.isPercentage(h)?c.height*=parseFloat(h)/100:h<=0?c.height+=h:c.height=h;var i,j=b.text;void 0===j&&(j=f.text),i=void 0!==j?a.util.breakText(""+j,c,{"font-weight":f["font-weight"]||f.fontWeight,"font-size":f["font-size"]||f.fontSize,"font-family":f["font-family"]||f.fontFamily,lineHeight:f.lineHeight},{svgDocument:this.paper.svg}):"",a.dia.attributes.text.set.call(this,i,c,d,f)}},title:{qualify:function(a,b){return b instanceof SVGElement},set:function(a,b,c){var e=d(c),f="joint-title",g=e.data(f);if(void 0===g||g!==a){e.data(f,a);var h=c.firstChild;if(h&&"TITLE"===h.tagName.toUpperCase())h.textContent=a;else{var i=document.createElementNS(c.namespaceURI,"title");i.textContent=a,c.insertBefore(i,h)}}}},lineHeight:{qualify:m},textVerticalAnchor:{qualify:m},textPath:{qualify:m},annotations:{qualify:m},port:{set:function(a){return null===a||void 0===a.id?a:a.id}},style:{qualify:e.isPlainObject,set:function(a,b,c){d(c).css(a)}},html:{set:function(a,b,c){d(c).html(a+"")}},ref:{},refX:{position:g("x","width","origin")},refY:{position:g("y","height","origin")},refDx:{position:g("x","width","corner")},refDy:{position:g("y","height","corner")},refWidth:{set:f("width","width")},refHeight:{set:f("height","height")},refRx:{set:f("rx","width")},refRy:{set:f("ry","height")},refRInscribed:{set:function(a){var b=f(a,"width"),c=f(a,"height");return function(a,d){var e=d.height>d.width?b:c;return e(a,d)}}("r")},refRCircumscribed:{set:function(a,b){var c=e.isPercentage(a);a=parseFloat(a),c&&(a/=100);var d,f=Math.sqrt(b.height*b.height+b.width*b.width);return isFinite(a)&&(d=c||a>=0&&a<=1?a*f:Math.max(a+f,0)),{r:d}}},refCx:{set:f("cx","width")},refCy:{set:f("cy","height")},xAlignment:{offset:h("x","width","right")},yAlignment:{offset:h("y","height","bottom")},resetOffset:{offset:function(a,b){return a?{x:-b.x,y:-b.y}:{x:0,y:0}}},refDResetOffset:{set:j({resetOffset:!0})},refDKeepOffset:{set:j({resetOffset:!1})},refPointsResetOffset:{set:k({resetOffset:!0})},refPointsKeepOffset:{set:k({resetOffset:!1})},connection:{qualify:n,set:function(){return{d:this.getSerializedConnection()}}},atConnectionLengthKeepGradient:{qualify:n,set:l("getTangentAtLength",{rotate:!0})},atConnectionLengthIgnoreGradient:{qualify:n,set:l("getTangentAtLength",{rotate:!1})},atConnectionRatioKeepGradient:{qualify:n,set:l("getTangentAtRatio",{rotate:!0})},atConnectionRatioIgnoreGradient:{qualify:n,set:l("getTangentAtRatio",{rotate:!1})}};p.refR=p.refRInscribed,p.refD=p.refDResetOffset,p.refPoints=p.refPointsResetOffset,p.atConnectionLength=p.atConnectionLengthKeepGradient,p.atConnectionRatio=p.atConnectionRatioKeepGradient,p.refX2=p.refX,p.refY2=p.refY,p["ref-x"]=p.refX,p["ref-y"]=p.refY,p["ref-dy"]=p.refDy,p["ref-dx"]=p.refDx,p["ref-width"]=p.refWidth,p["ref-height"]=p.refHeight,p["x-alignment"]=p.xAlignment,p["y-alignment"]=p.yAlignment}(joint,V,g,$,joint.util),function(a,b){var c=a.mvc.View.extend({name:null,tagName:"g",className:"tool",svgElement:!0,_visible:!0,init:function(){var a=this.name;a&&this.vel.attr("data-tool-name",a)},configure:function(a,b){return this.relatedView=a,this.paper=a.paper,this.parentView=b,this.simulateRelatedView(this.el),this},simulateRelatedView:function(a){a&&a.setAttribute("model-id",this.relatedView.model.id)},getName:function(){return this.name},show:function(){this.el.style.display="",this._visible=!0},hide:function(){this.el.style.display="none",this._visible=!1},isVisible:function(){return!!this._visible},focus:function(){var a=this.options.focusOpacity;isFinite(a)&&(this.el.style.opacity=a),this.parentView.focusTool(this)},blur:function(){this.el.style.opacity="",this.parentView.blurTool(this)},update:function(){}}),d=a.mvc.View.extend({tagName:"g",className:"tools",svgElement:!0,tools:null,options:{tools:null,relatedView:null,name:null,component:!1},configure:function(d){d=b.assign(this.options,d);var e=d.tools;if(!Array.isArray(e))return this;var f=d.relatedView;if(!(f instanceof a.dia.CellView))return this;for(var g=this.tools=[],h=0,i=e.length;h0;){var d=c.shift();b.push(d),c.push.apply(c,d.getEmbeddedCells())}}else b=this.getEmbeddedCells(),b.forEach(function(c){b.push.apply(b,c.getEmbeddedCells(a))});else b=joint.util.toArray(this.get("embeds")).map(this.graph.getCell,this.graph);return b}return[]},isEmbeddedIn:function(a,b){var c=joint.util.isString(a)?a:a.id,d=this.parent();if(b=joint.util.defaults({deep:!0},b),this.graph&&b.deep){for(;d;){if(d===c)return!0;d=this.graph.getCell(d).parent()}return!1}return d===c},isEmbedded:function(){return!!this.parent()},clone:function(a){if(a=a||{},a.deep)return joint.util.toArray(joint.dia.Graph.prototype.cloneCells.call(null,[this].concat(this.getEmbeddedCells({deep:!0}))));var b=Backbone.Model.prototype.clone.apply(this,arguments);return b.set("id",joint.util.uuid()),b.unset("embeds"),b.unset("parent"),b},prop:function(a,b,c){var d="/",e=joint.util.isString(a);if(e||Array.isArray(a)){if(arguments.length>1){var f,g;e?(f=a,g=f.split("/")):(f=a.join(d),g=a.slice());var h=g[0],i=g.length;if(c=c||{},c.propertyPath=f,c.propertyValue=b,c.propertyPathArray=g,1===i)return this.set(h,b,c);for(var j={},k=j,l=h,m=1;m0)},getSelector:function(a,b){var c;if(a===this.el)return"string"==typeof b&&(c="> "+b),c;if(a){var d=V(a).index()+1;c=a.tagName+":nth-child("+d+")",b&&(c+=" > "+b),c=this.getSelector(a.parentNode,c)}return c},getLinkEnd:function(a,b,c,d,e){var f=this.model,h=f.id,i=this.findAttribute("port",a),j=a.getAttribute("joint-selector"),k={id:h};null!=j&&(k.magnet=j),null!=i?(k.port=i,f.hasPort(i)||j||(k.selector=this.getSelector(a))):null==j&&this.el!==a&&(k.selector=this.getSelector(a));var l=this.paper,m=l.options.connectionStrategy;if("function"==typeof m){var n=m.call(l,k,this,a,new g.Point(b,c),d,e);n&&(k=n)}return k},getMagnetFromLinkEnd:function(a){var b,c=this.el,d=a.port,e=a.magnet;return null!=d&&this.model.hasPort(d)?b=this.findPortNode(d,e)||c:(e||(e=a.selector),e||null==d||(e='[port="'+d+'"]'),b=this.findBySelector(e,c,this.selectors)[0]),b},findAttribute:function(a,b){if(!b)return null;var c=b.getAttribute(a);if(null===c){if(b===this.el)return null;for(var d=b.parentNode;d&&d!==this.el&&1===d.nodeType&&(c=d.getAttribute(a),null===c);)d=d.parentNode}return c},getAttributeDefinition:function(a){return this.model.constructor.getAttributeDefinition(a)},setNodeAttributes:function(a,b){joint.util.isEmpty(b)||(a instanceof SVGElement?V(a).attr(b):$(a).attr(b))},processNodeAttributes:function(a,b){var c,d,e,f,g,h,i,j,k,l=[];for(c in b)b.hasOwnProperty(c)&&(d=b[c],e=this.getAttributeDefinition(c),!e||joint.util.isFunction(e.qualify)&&!e.qualify.call(this,d,a,b)?(h||(h={}),h[joint.util.toKebabCase(c)]=d):(joint.util.isString(e.set)&&(h||(h={}),h[e.set]=d),null!==d&&l.push(c,e)));for(f=0,g=l.length;f0&&x.height>0){var y=V.transformRect(a.getBBox(),p).scale(1/r,1/s);for(e in m)f=m[e],h=this.getAttributeDefinition(e),t=h.offset.call(this,f,y,a,i),t&&(q.offset(g.Point(t).scale(r,s)),w||(w=!0))}}(void 0!==o||v||w)&&(q.round(1),p.e=q.x,p.f=q.y,a.setAttribute("transform",V.matrixToTransformString(p)))},getNodeScale:function(a,b){var c,d;if(b&&b.contains(a)){var e=b.scale();c=1/e.sx,d=1/e.sy}else c=1,d=1;return{sx:c,sy:d}},findNodesAttributes:function(a,b,c,d){var e={};for(var f in a)if(a.hasOwnProperty(f))for(var g=c[f]=this.findBySelector(f,b,d),h=0,i=g.length;h-1?l.splice(t,0,d):l.push(d)}else this.setNodeAttributes(e,i.normal);for(var u=0,v=l.length;u0){this.startBatch("fit-embeds",a),a.deep&&joint.util.invoke(b,"fitEmbeds",a);var c=this.graph.getCellsBBox(b),d=joint.util.normalizeSides(a.padding);c.moveAndExpand({x:-d.left,y:-d.top,width:d.right+d.left,height:d.bottom+d.top}),this.set({position:{x:c.x,y:c.y},size:{width:c.width,height:c.height}},a),this.stopBatch("fit-embeds")}return this},rotate:function(a,b,c,d){if(c){var e=this.getBBox().center(),f=this.get("size"),g=this.get("position");e.rotate(c,this.get("angle")-a);var h=e.x-f.width/2-g.x,i=e.y-f.height/2-g.y;this.startBatch("rotate",{angle:a,absolute:b,origin:c}),this.position(g.x+h,g.y+i,d),this.rotate(a,b,null,d),this.stopBatch("rotate")}else this.set("angle",b?a:(this.get("angle")+a)%360,d);return this},angle:function(){return g.normalizeAngle(this.get("angle")||0)},getBBox:function(a){if(a=a||{},a.deep&&this.graph){var b=this.getEmbeddedCells({deep:!0,breadthFirst:!0});return b.push(this),this.graph.getCellsBBox(b)}var c=this.get("position"),d=this.get("size");return new g.Rect(c.x,c.y,d.width,d.height)}}),joint.dia.ElementView=joint.dia.CellView.extend({_removePorts:function(){},_renderPorts:function(){},className:function(){var a=joint.dia.CellView.prototype.className.apply(this).split(" ");return a.push("element"),a.join(" ")},metrics:null,initialize:function(){joint.dia.CellView.prototype.initialize.apply(this,arguments);var a=this.model;this.listenTo(a,"change:position",this.translate),this.listenTo(a,"change:size",this.resize),this.listenTo(a,"change:angle",this.rotate),this.listenTo(a,"change:markup",this.render),this._initializePorts(),this.metrics={}},_initializePorts:function(){},update:function(a,b){this.metrics={},this._removePorts();var c=this.model,d=c.attr();this.updateDOMSubtreeAttributes(this.el,d,{rootBBox:new g.Rect(c.size()),selectors:this.selectors,scalableNode:this.scalableNode,rotatableNode:this.rotatableNode,roAttributes:b===d?null:b}),this._renderPorts()},rotatableSelector:"rotatable",scalableSelector:"scalable",scalableNode:null,rotatableNode:null,renderMarkup:function(){var a=this.model,b=a.get("markup")||a.markup;if(!b)throw new Error("dia.ElementView: markup required");if(Array.isArray(b))return this.renderJSONMarkup(b);if("string"==typeof b)return this.renderStringMarkup(b);throw new Error("dia.ElementView: invalid markup")},renderJSONMarkup:function(a){var b=joint.util.parseDOMJSON(a),c=this.selectors=b.selectors,d=this.selector;if(c[d])throw new Error("dia.ElementView: ambiguous root selector.");c[d]=this.el,this.rotatableNode=V(c[this.rotatableSelector])||null,this.scalableNode=V(c[this.scalableSelector])||null,this.vel.append(b.fragment)},renderStringMarkup:function(a){var b=this.vel;b.append(V(a)),this.rotatableNode=b.findOne(".rotatable"),this.scalableNode=b.findOne(".scalable");var c=this.selectors={};c[this.selector]=this.el},render:function(){return this.vel.empty(),this.renderMarkup(),this.scalableNode&&this.update(),this.resize(),this.rotatableNode?(this.rotate(),this.translate(),this):(this.updateTransformation(),this)},resize:function(){return this.scalableNode?this.sgResize.apply(this,arguments):(this.model.attributes.angle&&this.rotate(),void this.update())},translate:function(){return this.rotatableNode?this.rgTranslate():void this.updateTransformation()},rotate:function(){return this.rotatableNode?this.rgRotate():void this.updateTransformation()},updateTransformation:function(){var a=this.getTranslateString(),b=this.getRotateString();b&&(a+=" "+b),this.vel.attr("transform",a)},getTranslateString:function(){var a=this.model.attributes.position;return"translate("+a.x+","+a.y+")"},getRotateString:function(){var a=this.model.attributes,b=a.angle;if(!b)return null;var c=a.size;return"rotate("+b+","+c.width/2+","+c.height/2+")"},getBBox:function(a){var b;if(a&&a.useModelGeometry){var c=this.model;b=c.getBBox().bbox(c.angle())}else b=this.getNodeBBox(this.el);return this.paper.localToPaperRect(b)},nodeCache:function(a){var b=V.ensureId(a),c=this.metrics[b];return c||(c=this.metrics[b]={}),c},getNodeData:function(a){var b=this.nodeCache(a);return b.data||(b.data={}),b.data},getNodeBBox:function(a){var b=this.getNodeBoundingRect(a),c=this.getNodeMatrix(a),d=this.getRootTranslateMatrix(),e=this.getRootRotateMatrix();return V.transformRect(b,d.multiply(e).multiply(c))},getNodeBoundingRect:function(a){var b=this.nodeCache(a);return void 0===b.boundingRect&&(b.boundingRect=V(a).getBBox()),new g.Rect(b.boundingRect)},getNodeUnrotatedBBox:function(a){var b=this.getNodeBoundingRect(a),c=this.getNodeMatrix(a),d=this.getRootTranslateMatrix();return V.transformRect(b,d.multiply(c))},getNodeShape:function(a){var b=this.nodeCache(a);return void 0===b.geometryShape&&(b.geometryShape=V(a).toGeometryShape()),b.geometryShape.clone()},getNodeMatrix:function(a){var b=this.nodeCache(a);if(void 0===b.magnetMatrix){var c=this.rotatableNode||this.el;b.magnetMatrix=V(a).getTransformToElement(c)}return V.createSVGMatrix(b.magnetMatrix)},getRootTranslateMatrix:function(){var a=this.model,b=a.position(),c=V.createSVGMatrix().translate(b.x,b.y);return c},getRootRotateMatrix:function(){var a=V.createSVGMatrix(),b=this.model,c=b.angle();if(c){var d=b.getBBox(),e=d.width/2,f=d.height/2;a=a.translate(e,f).rotate(c).translate(-e,-f)}return a},rgRotate:function(){this.rotatableNode.attr("transform",this.getRotateString())},rgTranslate:function(){this.vel.attr("transform",this.getTranslateString())},sgResize:function(a,b,c){var d=this.model,e=d.get("angle")||0,f=d.get("size")||{width:1,height:1},g=this.scalableNode,h=!1;g.node.getElementsByTagName("path").length>0&&(h=!0);var i=g.getBBox({recursive:h}),j=f.width/(i.width||1),k=f.height/(i.height||1);g.attr("transform","scale("+j+","+k+")");var l=this.rotatableNode,m=l&&l.attr("transform");if(m&&null!==m){l.attr("transform",m+" rotate("+-e+","+f.width/2+","+f.height/2+")");var n=g.getBBox({target:this.paper.viewport});d.set("position",{x:n.x,y:n.y},c),this.rotate()}this.update()},prepareEmbedding:function(a){a||(a={});var b=a.model||this.model,c=a.paper||this.paper,d=c.model;b.startBatch("to-front"),b.toFront({deep:!0,ui:!0});var e=d.get("cells").max("z").get("z"),f=d.getConnectedLinks(b,{deep:!0,includeEnclosed:!0});joint.util.invoke(f,"set","z",e+1,{ui:!0}),b.stopBatch("to-front");var g=b.parent();g&&d.getCell(g).unembed(b,{ui:!0})},processEmbedding:function(a){a||(a={});var b=a.model||this.model,c=a.paper||this.paper,d=c.options,e=[];if(joint.util.isFunction(d.findParentBy)){var f=joint.util.toArray(d.findParentBy.call(c.model,this));e=f.filter(function(a){return a instanceof joint.dia.Cell&&this.model.id!==a.id&&!a.isEmbeddedIn(this.model)}.bind(this))}else e=c.model.findModelsUnderElement(b,{searchBy:d.findParentBy});d.frontParentOnly&&(e=e.slice(-1));for(var g=null,h=a.candidateEmbedView,i=e.length-1;i>=0;i--){var j=e[i];if(h&&h.model.id==j.id){g=h;break}var k=j.findView(c);if(d.validateEmbedding.call(c,this,k)){g=k;break}}g&&g!=h&&(this.clearEmbedding(a),a.candidateEmbedView=g.highlight(null,{embedding:!0})),!g&&h&&this.clearEmbedding(a)},clearEmbedding:function(a){a||(a={});var b=a.candidateEmbedView;b&&(b.unhighlight(null,{embedding:!0}),a.candidateEmbedView=null)},finalizeEmbedding:function(a){a||(a={});var b=a.candidateEmbedView,c=a.model||this.model,d=a.paper||this.paper;b&&(b.model.embed(c,{ui:!0}),b.unhighlight(null,{embedding:!0}),a.candidateEmbedView=null),joint.util.invoke(d.model.getConnectedLinks(c,{deep:!0}),"reparent",{ui:!0})},pointerdblclick:function(a,b,c){joint.dia.CellView.prototype.pointerdblclick.apply(this,arguments),this.notify("element:pointerdblclick",a,b,c)},pointerclick:function(a,b,c){joint.dia.CellView.prototype.pointerclick.apply(this,arguments),this.notify("element:pointerclick",a,b,c)},contextmenu:function(a,b,c){joint.dia.CellView.prototype.contextmenu.apply(this,arguments),this.notify("element:contextmenu",a,b,c)},pointerdown:function(a,b,c){joint.dia.CellView.prototype.pointerdown.apply(this,arguments),this.notify("element:pointerdown",a,b,c),this.dragStart(a,b,c)},pointermove:function(a,b,c){var d=this.eventData(a);switch(d.action){case"move":this.drag(a,b,c);break;case"magnet":this.dragMagnet(a,b,c)}d.stopPropagation||(joint.dia.CellView.prototype.pointermove.apply(this,arguments),this.notify("element:pointermove",a,b,c)),this.eventData(a,d)},pointerup:function(a,b,c){var d=this.eventData(a);switch(d.action){case"move":this.dragEnd(a,b,c);break;case"magnet":return void this.dragMagnetEnd(a,b,c)}d.stopPropagation||(this.notify("element:pointerup",a,b,c),joint.dia.CellView.prototype.pointerup.apply(this,arguments))},mouseover:function(a){joint.dia.CellView.prototype.mouseover.apply(this,arguments),this.notify("element:mouseover",a)},mouseout:function(a){joint.dia.CellView.prototype.mouseout.apply(this,arguments),this.notify("element:mouseout",a)},mouseenter:function(a){joint.dia.CellView.prototype.mouseenter.apply(this,arguments),this.notify("element:mouseenter",a)},mouseleave:function(a){joint.dia.CellView.prototype.mouseleave.apply(this,arguments),this.notify("element:mouseleave",a)},mousewheel:function(a,b,c,d){joint.dia.CellView.prototype.mousewheel.apply(this,arguments),this.notify("element:mousewheel",a,b,c,d)},onmagnet:function(a,b,c){this.dragMagnetStart(a,b,c);var d=this.eventData(a).stopPropagation;d&&a.stopPropagation()},dragStart:function(a,b,c){this.can("elementMove")&&this.eventData(a,{action:"move",x:b,y:c,restrictedArea:this.paper.getRestrictedArea(this)})},dragMagnetStart:function(a,b,c){if(this.can("addLinkFromMagnet")){this.model.startBatch("add-link");var d=this.paper,e=d.model,f=a.target,g=d.getDefaultLink(this,f),h=this.getLinkEnd(f,b,c,g,"source"),i={x:b,y:c};g.set({source:h,target:i}),g.addTo(e,{async:!1,ui:!0});var j=g.findView(d);joint.dia.CellView.prototype.pointerdown.apply(j,arguments),j.notify("link:pointerdown",a,b,c);var k=j.startArrowheadMove("target",{whenNotAllowed:"remove"});j.eventData(a,k),this.eventData(a,{action:"magnet",linkView:j,stopPropagation:!0}),this.paper.delegateDragEvents(this,a.data)}},drag:function(a,b,c){var d=this.paper,e=d.options.gridSize,f=this.model,h=f.position(),i=this.eventData(a),j=g.snapToGrid(h.x,e)-h.x+g.snapToGrid(b-i.x,e),k=g.snapToGrid(h.y,e)-h.y+g.snapToGrid(c-i.y,e);f.translate(j,k,{restrictedArea:i.restrictedArea,ui:!0});var l=!!i.embedding;d.options.embeddingMode&&(l||(this.prepareEmbedding(i),l=!0),this.processEmbedding(i)),this.eventData(a,{x:g.snapToGrid(b,e),y:g.snapToGrid(c,e),embedding:l})},dragMagnet:function(a,b,c){var d=this.eventData(a),e=d.linkView;e&&e.pointermove(a,b,c)},dragEnd:function(a,b,c){var d=this.eventData(a);d.embedding&&this.finalizeEmbedding(d)},dragMagnetEnd:function(a,b,c){var d=this.eventData(a),e=d.linkView;e&&e.pointerup(a,b,c),this.model.stopBatch("add-link")}}),joint.dia.Link=joint.dia.Cell.extend({markup:['','','','','','','',''].join(""),toolMarkup:['','','','',"Remove link.","",'','','',"Link options.","",""].join(""),doubleToolMarkup:void 0,vertexMarkup:['','','','',"Remove vertex.","",""].join(""),arrowheadMarkup:['','',""].join(""),defaultLabel:void 0,labelMarkup:void 0,_builtins:{defaultLabel:{markup:[{tagName:"rect",selector:"rect"},{tagName:"text",selector:"text"}],attrs:{text:{fill:"#000000",fontSize:14,textAnchor:"middle",yAlignment:"middle",pointerEvents:"none"},rect:{ref:"text",fill:"#ffffff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}}},defaults:{type:"link",source:{},target:{}},isLink:function(){return!0},disconnect:function(a){return this.set({source:{x:0,y:0},target:{x:0,y:0}},a)},source:function(a,b,c){if(void 0===a)return joint.util.clone(this.get("source"));var d,e,f=a instanceof joint.dia.Cell;if(f)return d=joint.util.clone(b)||{},d.id=a.id,e=c,this.set("source",d,e);var h=a instanceof g.Point;return h?(d=joint.util.clone(b)||{},d.x=a.x,d.y=a.y,e=c,this.set("source",d,e)):(d=a,e=b,this.set("source",d,e))},target:function(a,b,c){if(void 0===a)return joint.util.clone(this.get("target"));var d,e,f=a instanceof joint.dia.Cell;if(f)return d=joint.util.clone(b)||{},d.id=a.id,e=c,this.set("target",d,e);var h=a instanceof g.Point;return h?(d=joint.util.clone(b)||{},d.x=a.x,d.y=a.y,e=c,this.set("target",d,e)):(d=a,e=b,this.set("target",d,e))},router:function(a,b,c){if(void 0===a){var d=this.get("router");return d?"object"==typeof d?joint.util.clone(d):d:this.get("manhattan")?{name:"orthogonal"}:null}var e="object"==typeof a||"function"==typeof a,f=e?a:{name:a,args:b},g=e?b:c;return this.set("router",f,g)},connector:function(a,b,c){if(void 0===a){var d=this.get("connector");return d?"object"==typeof d?joint.util.clone(d):d:this.get("smooth")?{name:"smooth"}:null}var e="object"==typeof a||"function"==typeof a,f=e?a:{name:a,args:b},g=e?b:c;return this.set("connector",f,g)},label:function(a,b,c){var d=this.labels();return a=isFinite(a)&&null!==a?0|a:0,a<0&&(a=d.length+a),arguments.length<=1?this.prop(["labels",a]):this.prop(["labels",a],b,c)},labels:function(a,b){return 0===arguments.length?(a=this.get("labels"),Array.isArray(a)?a.slice():[]):(Array.isArray(a)||(a=[]),this.set("labels",a,b))},insertLabel:function(a,b,c){if(!b)throw new Error("dia.Link: no label provided");var d=this.labels(),e=d.length;return a=isFinite(a)&&null!==a?0|a:e,a<0&&(a=e+a+1),d.splice(a,0,b),this.labels(d,c)},appendLabel:function(a,b){return this.insertLabel(-1,a,b)},removeLabel:function(a,b){var c=this.labels();return a=isFinite(a)&&null!==a?0|a:-1,c.splice(a,1),this.labels(c,b)},vertex:function(a,b,c){var d=this.vertices();return a=isFinite(a)&&null!==a?0|a:0,a<0&&(a=d.length+a),arguments.length<=1?this.prop(["vertices",a]):this.prop(["vertices",a],b,c)},vertices:function(a,b){return 0===arguments.length?(a=this.get("vertices"),Array.isArray(a)?a.slice():[]):(Array.isArray(a)||(a=[]),this.set("vertices",a,b))},insertVertex:function(a,b,c){if(!b)throw new Error("dia.Link: no vertex provided");var d=this.vertices(),e=d.length;return a=isFinite(a)&&null!==a?0|a:e,a<0&&(a=e+a+1),d.splice(a,0,b),this.vertices(d,c)},removeVertex:function(a,b){var c=this.vertices();return a=isFinite(a)&&null!==a?0|a:-1,c.splice(a,1),this.vertices(c,b)},translate:function(a,b,c){return c=c||{},c.translateBy=c.translateBy||this.id,c.tx=a,c.ty=b,this.applyToPoints(function(c){return{x:(c.x||0)+a,y:(c.y||0)+b}},c)},scale:function(a,b,c,d){return this.applyToPoints(function(d){return g.point(d).scale(a,b,c).toJSON()},d)},applyToPoints:function(a,b){if(!joint.util.isFunction(a))throw new TypeError("dia.Link: applyToPoints expects its first parameter to be a function.");var c={},d=this.source();d.id||(c.source=a(d));var e=this.target();e.id||(c.target=a(e));var f=this.vertices();return f.length>0&&(c.vertices=f.map(a)),this.set(c,b)},reparent:function(a){var b;if(this.graph){var c=this.getSourceElement(),d=this.getTargetElement(),e=this.getParentCell();c&&d&&(b=c===d||c.isEmbeddedIn(d)?d:d.isEmbeddedIn(c)?c:this.graph.getCommonAncestor(c,d)),!e||b&&b.id===e.id||e.unembed(this,a),b&&b.embed(this,a)}return b},hasLoop:function(a){a=a||{};var b=this.source().id,c=this.target().id;if(!b||!c)return!1;var d=b===c;if(!d&&a.deep&&this.graph){var e=this.getSourceElement(),f=this.getTargetElement();d=e.isEmbeddedIn(f)||f.isEmbeddedIn(e)}return d},getSourceElement:function(){var a=this.source(),b=this.graph;return a&&a.id&&b&&b.getCell(a.id)||null},getTargetElement:function(){var a=this.target(),b=this.graph;return a&&a.id&&b&&b.getCell(a.id)||null},getRelationshipAncestor:function(){var a;if(this.graph){var b=[this,this.getSourceElement(),this.getTargetElement()].filter(function(a){return!!a});a=this.graph.getCommonAncestor.apply(this.graph,b)}return a||null},isRelationshipEmbeddedIn:function(a){var b=joint.util.isString(a)||joint.util.isNumber(a)?a:a.id,c=this.getRelationshipAncestor();return!!c&&(c.id===b||c.isEmbeddedIn(b))},_getDefaultLabel:function(){var a=this.get("defaultLabel")||this.defaultLabel||{},b={};return b.markup=a.markup||this.get("labelMarkup")||this.labelMarkup,b.position=a.position,b.attrs=a.attrs,b.size=a.size,b}},{endsEqual:function(a,b){var c=a.port===b.port||!a.port&&!b.port;return a.id===b.id&&c}}),joint.dia.LinkView=joint.dia.CellView.extend({className:function(){var a=joint.dia.CellView.prototype.className.apply(this).split(" ");return a.push("link"),a.join(" ")},options:{shortLinkLength:105,doubleLinkTools:!1,longLinkLength:155,linkToolsOffset:40,doubleLinkToolsOffset:65,sampleInterval:50},_labelCache:null,_labelSelectors:null,_markerCache:null,_V:null,_dragData:null,metrics:null,decimalsRounding:2,initialize:function(a){joint.dia.CellView.prototype.initialize.apply(this,arguments),"function"!=typeof this.constructor.prototype.watchSource&&(this.constructor.prototype.watchSource=this.createWatcher("source"),this.constructor.prototype.watchTarget=this.createWatcher("target")),this._labelCache={},this._labelSelectors={},this._markerCache={},this._V={},this.metrics={},this.startListening()},startListening:function(){var a=this.model;this.listenTo(a,"change:markup",this.render),this.listenTo(a,"change:smooth change:manhattan change:router change:connector",this.update),this.listenTo(a,"change:toolMarkup",this.onToolsChange),this.listenTo(a,"change:labels change:labelMarkup",this.onLabelsChange),this.listenTo(a,"change:vertices change:vertexMarkup",this.onVerticesChange),this.listenTo(a,"change:source",this.onSourceChange),this.listenTo(a,"change:target",this.onTargetChange)},onSourceChange:function(a,b,c){this.watchSource(a,b);var d=this.model;c.translateBy&&d.get("target").id&&b.id||this.update(d,null,c)},onTargetChange:function(a,b,c){this.watchTarget(a,b);var d=this.model;(!c.translateBy||d.get("source").id&&!b.id&&joint.util.isEmpty(d.get("vertices")))&&this.update(d,null,c)},onVerticesChange:function(a,b,c){this.renderVertexMarkers(),c.translateBy&&c.translateBy!==this.model.id&&!this.model.hasLoop()||this.update(a,null,c)},onToolsChange:function(){this.renderTools().updateToolsPosition()},onLabelsChange:function(a,b,c){var d=!0,e=this.model.previous("labels");if(e&&"propertyPathArray"in c&&"propertyValue"in c){var f=c.propertyPathArray||[],g=f.length;if(g>1){var h=!!e[f[1]];h&&(2===g?d="markup"in Object(c.propertyValue):"markup"!==f[2]&&(d=!1))}}d?this.renderLabels():this.updateLabels(),this.updateLabelPositions()},render:function(){this.vel.empty(),this._V={},this.renderMarkup(),this.renderLabels();var a=this.model;return this.watchSource(a,a.source()).watchTarget(a,a.target()).update(),this},renderMarkup:function(){var a=this.model,b=a.get("markup")||a.markup;if(!b)throw new Error("dia.LinkView: markup required");if(Array.isArray(b))return this.renderJSONMarkup(b);if("string"==typeof b)return this.renderStringMarkup(b);throw new Error("dia.LinkView: invalid markup")},renderJSONMarkup:function(a){var b=joint.util.parseDOMJSON(a),c=this.selectors=b.selectors,d=this.selector;if(c[d])throw new Error("dia.LinkView: ambiguous root selector.");c[d]=this.el,this.vel.append(b.fragment)},renderStringMarkup:function(a){var b=V(a);Array.isArray(b)||(b=[b]);for(var c=this._V,d=0,e=b.length;d1||"G"!==d[0].nodeName.toUpperCase()?(c=V("g"),c.append(b),c.addClass("label")):(c=V(d[0]),c.addClass("label")),{node:c.node,selectors:a.selectors}}},renderLabels:function(){var a=this._V,b=a.labels,c=this._labelCache={},d=this._labelSelectors={};b&&b.empty();var e=this.model,f=e.get("labels")||[],g=f.length;if(0===g)return this;b||(b=a.labels=V("g").addClass("labels").appendTo(this.el));for(var h=0;h=this.options.longLinkLength){var e=this.options.doubleLinkToolsOffset||b;d=this.getPointAtLength(c-e),this._tool2Cache.attr("transform","translate("+d.x+", "+d.y+") "+a),this._tool2Cache.attr("visibility","visible")}else this.options.doubleLinkTools&&this._tool2Cache.attr("visibility","hidden")}return this},updateArrowheadMarkers:function(){if(!this._V.markerArrowheads)return this;if("none"===$.css(this._V.markerArrowheads.node,"display"))return this;var a=this.getConnectionLength()0&&b<=1,d=0,e={x:0,y:0};if(a.offset){var f=a.offset;"number"==typeof f&&(d=f),f.x&&(e.x=f.x),f.y&&(e.y=f.y)}var g,h=0!==e.x||0!==e.y||0===d,i=this.path,j={segmentSubdivisions:this.getConnectionSubdivisions()},k=c?b*this.getConnectionLength():b;if(h)g=i.pointAtLength(k,j),g.offset(e);else{var l=i.tangentAtLength(k,j);l?(l.rotate(l.start,-90),l.setLength(d),g=l.end):g=i.start}return g},getVertexIndex:function(a,b){for(var c=this.model,d=c.vertices(),e=this.getClosestPointLength(new g.Point(a,b)),f=0,h=d.length;f0){for(var j=0,k=i.length;j").addClass(joint.util.addClassNamePrefix("paper-background")),this.options.background&&this.drawBackground(this.options.background),this.$grid=$("
").addClass(joint.util.addClassNamePrefix("paper-grid")),this.options.drawGrid&&this.drawGrid(),this.$el.append(this.$background,this.$grid,this.svg),this},update:function(){return this.options.drawGrid&&this.drawGrid(),this._background&&this.updateBackgroundImage(this._background),this},_viewportMatrix:null,_viewportTransformString:null,matrix:function(a){var b=this.viewport;if(void 0===a){var c=b.getAttribute("transform");return(this._viewportTransformString||null)===c?a=this._viewportMatrix:(a=b.getCTM(),this._viewportMatrix=a,this._viewportTransformString=c),V.createSVGMatrix(a)}return a=V.createSVGMatrix(a),ctmString=V.matrixToTransformString(a),b.setAttribute("transform",ctmString),this.tools.setAttribute("transform",ctmString),this._viewportMatrix=a,this._viewportTransformString=b.getAttribute("transform"),this},clientMatrix:function(){return V.createSVGMatrix(this.viewport.getScreenCTM())},_sortDelayingBatches:["add","to-front","to-back"],_onSort:function(){this.model.hasActiveBatch(this._sortDelayingBatches)||this.sortViews()},_onBatchStop:function(a){var b=a&&a.batchName;this._sortDelayingBatches.includes(b)&&!this.model.hasActiveBatch(this._sortDelayingBatches)&&this.sortViews()},onRemove:function(){this.removeViews()},setDimensions:function(a,b){a=this.options.width=a||this.options.width,b=this.options.height=b||this.options.height,this.$el.css({width:Math.round(a),height:Math.round(b)}),this.trigger("resize",a,b)},setOrigin:function(a,b){return this.translate(a||0,b||0,{absolute:!0})},fitToContent:function(a,b,c,d){joint.util.isObject(a)?(d=a,a=d.gridWidth||1,b=d.gridHeight||1,c=d.padding||0):(d=d||{},a=a||1,b=b||1,c=c||0),c=joint.util.normalizeSides(c);var e=V(this.viewport).getBBox(),f=this.scale(),g=this.translate();e.x*=f.sx,e.y*=f.sy,e.width*=f.sx,e.height*=f.sy;var h=Math.max(Math.ceil((e.width+e.x)/a),1)*a,i=Math.max(Math.ceil((e.height+e.y)/b),1)*b,j=0,k=0;("negative"==d.allowNewOrigin&&e.x<0||"positive"==d.allowNewOrigin&&e.x>=0||"any"==d.allowNewOrigin)&&(j=Math.ceil(-e.x/a)*a,j+=c.left,h+=j),("negative"==d.allowNewOrigin&&e.y<0||"positive"==d.allowNewOrigin&&e.y>=0||"any"==d.allowNewOrigin)&&(k=Math.ceil(-e.y/b)*b,k+=c.top,i+=k),h+=c.right,i+=c.bottom,h=Math.max(h,d.minWidth||0),i=Math.max(i,d.minHeight||0),h=Math.min(h,d.maxWidth||Number.MAX_VALUE),i=Math.min(i,d.maxHeight||Number.MAX_VALUE);var l=h!=this.options.width||i!=this.options.height,m=j!=g.tx||k!=g.ty;m&&this.translate(j,k),l&&this.setDimensions(h,i)},scaleContentToFit:function(a){var b=this.getContentBBox();if(b.width&&b.height){a=a||{},joint.util.defaults(a,{padding:0,preserveAspectRatio:!0,scaleGrid:null,minScale:0,maxScale:Number.MAX_VALUE});var c,d=a.padding,e=a.minScaleX||a.minScale,f=a.maxScaleX||a.maxScale,h=a.minScaleY||a.minScale,i=a.maxScaleY||a.maxScale;if(a.fittingBBox)c=a.fittingBBox;else{var j=this.translate();c={x:j.tx,y:j.ty,width:this.options.width,height:this.options.height}}c=g.rect(c).moveAndExpand({x:d,y:d,width:-2*d,height:-2*d});var k=this.scale(),l=c.width/b.width*k.sx,m=c.height/b.height*k.sy;if(a.preserveAspectRatio&&(l=m=Math.min(l,m)),a.scaleGrid){var n=a.scaleGrid;l=n*Math.floor(l/n),m=n*Math.floor(m/n)}l=Math.min(f,Math.max(e,l)),m=Math.min(i,Math.max(h,m)),this.scale(l,m);var o=this.getContentBBox(),p=c.x-o.x,q=c.y-o.y;this.translate(p,q)}},getContentArea:function(){return V(this.viewport).getBBox()},getContentBBox:function(){var a=this.viewport.getBoundingClientRect(),b=this.clientMatrix(),c=this.translate();return g.rect({x:a.left-b.e+c.tx,y:a.top-b.f+c.ty,width:a.width,height:a.height})},getArea:function(){return this.paperToLocalRect({x:0,y:0,width:this.options.width,height:this.options.height})},getRestrictedArea:function(){var a;return a=joint.util.isFunction(this.options.restrictTranslate)?this.options.restrictTranslate.apply(this,arguments):this.options.restrictTranslate===!0?this.getArea():this.options.restrictTranslate||null},createViewForModel:function(a){var b,c,d=this.options.cellViewNamespace,e=a.get("type")+"View",f=joint.util.getByPath(d,e,".");a.isLink()?(b=this.options.linkView,c=joint.dia.LinkView):(b=this.options.elementView,c=joint.dia.ElementView);var g=b.prototype instanceof Backbone.View?f||b:b.call(this,a)||f||c;return new g({model:a,interactive:this.options.interactive})},onCellAdded:function(a,b,c){if(this.options.async&&c.async!==!1&&joint.util.isNumber(c.position)){if(this._asyncCells=this._asyncCells||[],this._asyncCells.push(a),0==c.position){if(this._frameId)throw new Error("another asynchronous rendering in progress");this.asyncRenderViews(this._asyncCells,c),delete this._asyncCells}}else this.renderView(a)},removeView:function(a){var b=this._views[a.id];return b&&(b.remove(),delete this._views[a.id]),b},renderView:function(a){var b=this._views[a.id]=this.createViewForModel(a);return V(this.viewport).append(b.el),b.paper=this,b.render(),b},onImageDragStart:function(){return!1},beforeRenderViews:function(a){return a.sort(function(a){return a.isLink()?1:-1}),a},afterRenderViews:function(){this.sortViews()},resetViews:function(a,b){this.removeViews();var c=a.models.slice();if(c=this.beforeRenderViews(c,b)||c,this.cancelRenderViews(),this.options.async)this.asyncRenderViews(c,b);else{for(var d=0,e=c.length;d(e.get("z")||0)?1:-1})},scale:function(a,b,c,d){if(void 0===a)return V.matrixToScale(this.matrix());void 0===b&&(b=a),void 0===c&&(c=0,d=0);var e=this.translate();if(c||d||e.tx||e.ty){var f=e.tx-c*(a-1),g=e.ty-d*(b-1);this.translate(f,g)}var h=this.matrix();return h.a=a||0,h.d=b||0,this.matrix(h),this.trigger("scale",a,b,c,d),this},rotate:function(a,b,c){if(void 0===a)return V.matrixToRotate(this.matrix());if(void 0===b){var d=this.viewport.getBBox();b=d.width/2,c=d.height/2}var e=this.matrix().translate(b,c).rotate(a).translate(-b,-c);return this.matrix(e),this},translate:function(a,b){if(void 0===a)return V.matrixToTranslate(this.matrix());var c=this.matrix();c.e=a||0,c.f=b||0,this.matrix(c);var d=this.translate(),e=this.options.origin;return e.x=d.tx,e.y=d.ty,this.trigger("translate",d.tx,d.ty),this.options.drawGrid&&this.drawGrid(),this},findView:function(a){for(var b=joint.util.isString(a)?this.viewport.querySelector(a):a instanceof $?a[0]:a;b&&b!==this.el&&b!==document;){var c=b.getAttribute("model-id");if(c)return this._views[c];b=b.parentNode}},findViewByModel:function(a){var b=joint.util.isString(a)||joint.util.isNumber(a)?a:a&&a.id;return this._views[b]},findViewsFromPoint:function(a){a=g.point(a);var b=this.model.getElements().map(this.findViewByModel,this);return b.filter(function(b){return b&&b.vel.getBBox({target:this.viewport}).containsPoint(a)},this)},findViewsInArea:function(a,b){b=joint.util.defaults(b||{},{strict:!1}),a=g.rect(a);var c=this.model.getElements().map(this.findViewByModel,this),d=b.strict?"containsRect":"intersect";return c.filter(function(b){return b&&a[d](b.vel.getBBox({target:this.viewport}))},this)},removeTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"remove"),this},hideTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"hide"),this},showTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"show"),this},getModelById:function(a){return this.model.getCell(a)},snapToGrid:function(a,b){return this.clientToLocalPoint(a,b).snapToGrid(this.options.gridSize)},localToPaperPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.matrix());return g.Point(d)},localToPaperRect:function(a,b,c,d){var e=g.Rect(a,b),f=V.transformRect(e,this.matrix());return g.Rect(f)},paperToLocalPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.matrix().inverse());return g.Point(d)},paperToLocalRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.matrix().inverse());return g.Rect(f)},localToClientPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.clientMatrix());return g.Point(d)},localToClientRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.clientMatrix());return g.Rect(f)},clientToLocalPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.clientMatrix().inverse());return g.Point(d)},clientToLocalRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.clientMatrix().inverse());return g.Rect(f)},localToPagePoint:function(a,b){return this.localToPaperPoint(a,b).offset(this.pageOffset())},localToPageRect:function(a,b,c,d){return this.localToPaperRect(a,b,c,d).moveAndExpand(this.pageOffset())},pageToLocalPoint:function(a,b){var c=g.Point(a,b),d=c.difference(this.pageOffset());return this.paperToLocalPoint(d)},pageToLocalRect:function(a,b,c,d){var e=this.pageOffset(),f=g.Rect(a,b,c,d);return f.x-=e.x,f.y-=e.y,this.paperToLocalRect(f)},clientOffset:function(){var a=this.svg.getBoundingClientRect();return g.Point(a.left,a.top)},pageOffset:function(){return this.clientOffset().offset(window.scrollX,window.scrollY)},linkAllowed:function(a){if(!(a instanceof joint.dia.LinkView))throw new Error("Must provide a linkView.");var b=a.model,c=this.options,d=this.model,e=d.constructor.validations;return!(!c.multiLinks&&!e.multiLinks.call(this,d,b))&&(!(!c.linkPinning&&!e.linkPinning.call(this,d,b))&&!("function"==typeof c.allowLink&&!c.allowLink.call(this,a,this)))},getDefaultLink:function(a,b){return joint.util.isFunction(this.options.defaultLink)?this.options.defaultLink.call(this,a,b):this.options.defaultLink.clone()},resolveHighlighter:function(a){a=a||{};var b=a.highlighter,c=this.options;if(void 0===b){var d=["embedding","connecting","magnetAvailability","elementAvailability"].find(function(b){return!!a[b]});b=d&&c.highlighting[d]||c.highlighting.default}if(!b)return!1;joint.util.isString(b)&&(b={name:b});var e=b.name,f=c.highlighterNamespace[e];if(!f)throw new Error('Unknown highlighter ("'+e+'")');if("function"!=typeof f.highlight)throw new Error('Highlighter ("'+e+'") is missing required highlight() method');if("function"!=typeof f.unhighlight)throw new Error('Highlighter ("'+e+'") is missing required unhighlight() method');return{highlighter:f,options:b.options||{},name:e}},onCellHighlight:function(a,b,c){if(c=this.resolveHighlighter(c)){b.id||(b.id=V.uniqueId());var d=c.name+b.id+JSON.stringify(c.options);if(!this._highlights[d]){var e=c.highlighter;e.highlight(a,b,joint.util.assign({},c.options)),this._highlights[d]={cellView:a,magnetEl:b,opt:c.options,highlighter:e}}}},onCellUnhighlight:function(a,b,c){if(c=this.resolveHighlighter(c)){var d=c.name+b.id+JSON.stringify(c.options),e=this._highlights[d];e&&(e.highlighter.unhighlight(e.cellView,e.magnetEl,e.opt),this._highlights[d]=null)}},pointerdblclick:function(a){a.preventDefault(),a=joint.util.normalizeEvent(a); -var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerdblclick(a,c.x,c.y):this.trigger("blank:pointerdblclick",a,c.x,c.y)}},pointerclick:function(a){if(this._mousemoved<=this.options.clickThreshold){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(this.guard(a,b))return;var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerclick(a,c.x,c.y):this.trigger("blank:pointerclick",a,c.x,c.y)}},contextmenu:function(a){this.options.preventContextMenu&&a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.contextmenu(a,c.x,c.y):this.trigger("blank:contextmenu",a,c.x,c.y)}},pointerdown:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?(a.preventDefault(),b.pointerdown(a,c.x,c.y)):(this.options.preventDefaultBlankAction&&a.preventDefault(),this.trigger("blank:pointerdown",a,c.x,c.y)),this.delegateDragEvents(b,a.data)}},pointermove:function(a){a.preventDefault();var b=this.eventData(a);b.mousemoved||(b.mousemoved=0);var c=++b.mousemoved;if(!(c<=this.options.moveThreshold)){a=joint.util.normalizeEvent(a);var d=this.snapToGrid({x:a.clientX,y:a.clientY}),e=b.sourceView;e?e.pointermove(a,d.x,d.y):this.trigger("blank:pointermove",a,d.x,d.y),this.eventData(a,b)}},pointerup:function(a){this.undelegateDocumentEvents(),a=joint.util.normalizeEvent(a);var b=this.snapToGrid({x:a.clientX,y:a.clientY}),c=this.eventData(a).sourceView;c?c.pointerup(a,b.x,b.y):this.trigger("blank:pointerup",a,b.x,b.y),this.delegateEvents()},mouseover:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b))if(b)b.mouseover(a);else{if(this.el===a.target)return;this.trigger("blank:mouseover",a)}},mouseout:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b))if(b)b.mouseout(a);else{if(this.el===a.target)return;this.trigger("blank:mouseout",a)}},mouseenter:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.findView(a.relatedTarget);if(b){if(c===b)return;b.mouseenter(a)}else{if(c)return;this.trigger("paper:mouseenter",a)}}},mouseleave:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.findView(a.relatedTarget);if(b){if(c===b)return;b.mouseleave(a)}else{if(c)return;this.trigger("paper:mouseleave",a)}}},mousewheel:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=a.originalEvent,d=this.snapToGrid({x:c.clientX,y:c.clientY}),e=Math.max(-1,Math.min(1,c.wheelDelta||-c.detail));b?b.mousewheel(a,d.x,d.y,e):this.trigger("blank:mousewheel",a,d.x,d.y,e)}},onevent:function(a){var b=a.currentTarget,c=b.getAttribute("event");if(c){var d=this.findView(b);if(d){if(a=joint.util.normalizeEvent(a),this.guard(a,d))return;var e=this.snapToGrid({x:a.clientX,y:a.clientY});d.onevent(a,c,e.x,e.y)}}},onmagnet:function(a){var b=a.currentTarget,c=b.getAttribute("magnet");if(c){var d=this.findView(b);if(d){if(a=joint.util.normalizeEvent(a),this.guard(a,d))return;if(!this.options.validateMagnet(d,b))return;var e=this.snapToGrid(a.clientX,a.clientY);d.onmagnet(a,e.x,e.y)}}},onlabel:function(a){var b=a.currentTarget,c=this.findView(b);if(c){if(a=joint.util.normalizeEvent(a),this.guard(a,c))return;var d=this.snapToGrid(a.clientX,a.clientY);c.onlabel(a,d.x,d.y)}},delegateDragEvents:function(a,b){b||(b={}),this.eventData({data:b},{sourceView:a||null,mousemoved:0}),this.delegateDocumentEvents(null,b),this.undelegateEvents()},guard:function(a,b){return"mousedown"===a.type&&2===a.button||(!(!this.options.guard||!this.options.guard(a,b))||(a.data&&void 0!==a.data.guarded?a.data.guarded:!(b&&b.model&&b.model instanceof joint.dia.Cell)&&(this.svg!==a.target&&this.el!==a.target&&!$.contains(this.svg,a.target))))},setGridSize:function(a){return this.options.gridSize=a,this.options.drawGrid&&this.drawGrid(),this},clearGrid:function(){return this.$grid&&this.$grid.css("backgroundImage","none"),this},_getGriRefs:function(){return this._gridCache||(this._gridCache={root:V("svg",{width:"100%",height:"100%"},V("defs")),patterns:{},add:function(a,b){V(this.root.node.childNodes[0]).append(b),this.patterns[a]=b,this.root.append(V("rect",{width:"100%",height:"100%",fill:"url(#"+a+")"}))},get:function(a){return this.patterns[a]},exist:function(a){return void 0!==this.patterns[a]}}),this._gridCache},setGrid:function(a){this.clearGrid(),this._gridCache=null,this._gridSettings=[];var b=Array.isArray(a)?a:[a||{}];return b.forEach(function(a){this._gridSettings.push.apply(this._gridSettings,this._resolveDrawGridOption(a))},this),this},_resolveDrawGridOption:function(a){var b=this.constructor.gridPatterns;if(joint.util.isString(a)&&Array.isArray(b[a]))return b[a].map(function(a){return joint.util.assign({},a)});var c=a||{args:[{}]},d=Array.isArray(c),e=c.name;if(d||e||c.markup||(e="dot"),e&&Array.isArray(b[e])){var f=b[e].map(function(a){return joint.util.assign({},a)}),g=Array.isArray(c.args)?c.args:[c.args||{}];joint.util.defaults(g[0],joint.util.omit(a,"args"));for(var h=0;h'),f=joint.util.toArray(d).map(function(a){return e({offset:a.offset,color:a.color,opacity:Number.isFinite(a.opacity)?a.opacity:1})}),g=["<"+c+">",f.join(""),""].join(""),h=joint.util.assign({id:b},a.attrs);V(g,h).appendTo(this.defs)}return b},defineMarker:function(a){if(!joint.util.isObject(a))throw new TypeError("dia.Paper: defineMarker() requires 1. argument to be an object.");var b=a.id;if(b||(b=this.svg.id+joint.util.hashCode(JSON.stringify(a))),!this.isDefined(b)){var c=joint.util.omit(a,"type","userSpaceOnUse"),d=V("marker",{id:b,orient:"auto",overflow:"visible",markerUnits:a.markerUnits||"userSpaceOnUse"},[V(a.type||"path",c)]);d.appendTo(this.defs)}return b}},{backgroundPatterns:{flipXy:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=2*c,b.height=2*d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.setTransform(-1,0,0,-1,b.width,b.height),e.drawImage(a,0,0,c,d),e.setTransform(-1,0,0,1,b.width,0),e.drawImage(a,0,0,c,d),e.setTransform(1,0,0,-1,0,b.height),e.drawImage(a,0,0,c,d),b},flipX:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=2*c,b.height=d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.translate(2*c,0),e.scale(-1,1),e.drawImage(a,0,0,c,d),b},flipY:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=c,b.height=2*d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.translate(0,2*d),e.scale(1,-1),e.drawImage(a,0,0,c,d),b},watermark:function(a,b){b=b||{};var c=a.width,d=a.height,e=document.createElement("canvas");e.width=3*c,e.height=3*d;for(var f=e.getContext("2d"),h=joint.util.isNumber(b.watermarkAngle)?-b.watermarkAngle:-20,i=g.toRad(h),j=e.width/4,k=e.height/4,l=0;l<4;l++)for(var m=0;m<4;m++)(l+m)%2>0&&(f.setTransform(1,0,0,1,(2*l-1)*j,(2*m-1)*k),f.rotate(i),f.drawImage(a,-c/2,-d/2,c,d));return e}},gridPatterns:{dot:[{color:"#AAAAAA",thickness:1,markup:"rect",update:function(a,b){V(a).attr({width:b.thickness*b.sx,height:b.thickness*b.sy,fill:b.color})}}],fixedDot:[{color:"#AAAAAA",thickness:1,markup:"rect",update:function(a,b){var c=b.sx<=1?b.thickness*b.sx:b.thickness;V(a).attr({width:c,height:c,fill:b.color})}}],mesh:[{color:"#AAAAAA",thickness:1,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}}],doubleMesh:[{color:"#AAAAAA",thickness:1,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}},{color:"#000000",thickness:3,scaleFactor:4,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}}]}}),function(a,b,c){var d=function(b){var d=c.cloneDeep(b)||{};this.ports=[],this.groups={},this.portLayoutNamespace=a.layout.Port,this.portLabelLayoutNamespace=a.layout.PortLabel,this._init(d)};d.prototype={getPorts:function(){return this.ports},getGroup:function(a){return this.groups[a]||{}},getPortsByGroup:function(a){return this.ports.filter(function(b){return b.group===a})},getGroupPortsMetrics:function(a,b){var d=this.getGroup(a),e=this.getPortsByGroup(a),f=d.position||{},h=f.name,i=this.portLayoutNamespace;i[h]||(h="left");var j=f.args||{},k=e.map(function(a){return a&&a.position&&a.position.args}),l=i[h](k,b,j),m={ports:e,result:[]};return c.toArray(l).reduce(function(a,c,d){var e=a.ports[d];return a.result.push({portId:e.id,portTransformation:c,labelTransformation:this._getPortLabelLayout(e,g.Point(c),b),portAttrs:e.attrs,portSize:e.size,labelSize:e.label.size}),a}.bind(this),m),m.result},_getPortLabelLayout:function(a,b,c){var d=this.portLabelLayoutNamespace,e=a.label.position.name||"left";return d[e]?d[e](b,c,a.label.position.args):null},_init:function(a){if(c.isObject(a.groups))for(var b=Object.keys(a.groups),d=0,e=b.length;d0},hasPort:function(a){return this.getPortIndex(a)!==-1},getPorts:function(){return c.cloneDeep(this.prop("ports/items"))||[]},getPort:function(a){return c.cloneDeep(c.toArray(this.prop("ports/items")).find(function(b){return b.id&&b.id===a}))},getPortsPositions:function(a){var b=this._portSettingsData.getGroupPortsMetrics(a,g.Rect(this.size()));return b.reduce(function(a,b){var c=b.portTransformation;return a[b.portId]={x:c.x,y:c.y,angle:c.angle},a},{})},getPortIndex:function(a){var b=c.isObject(a)?a.id:a;return this._isValidPortId(b)?c.toArray(this.prop("ports/items")).findIndex(function(a){return a.id===b}):-1},addPort:function(a,b){if(!c.isObject(a)||Array.isArray(a))throw new Error("Element: addPort requires an object.");var d=c.assign([],this.prop("ports/items"));return d.push(a),this.prop("ports/items",d,b),this},portProp:function(a,b,d,e){var f=this.getPortIndex(a);if(f===-1)throw new Error("Element: unable to find port with id "+a);var g=Array.prototype.slice.call(arguments,1);return Array.isArray(b)?g[0]=["ports","items",f].concat(b):c.isString(b)?g[0]=["ports/items/",f,"/",b].join(""):(g=["ports/items/"+f],c.isPlainObject(b)&&(g.push(b),g.push(d))),this.prop.apply(this,g)},_validatePorts:function(){var b=this.get("ports")||{},d=[];b=b||{};var e=c.toArray(b.items);return e.forEach(function(a){"object"!=typeof a&&d.push("Element: invalid port ",a),this._isValidPortId(a.id)||(a.id=c.uuid())},this),a.util.uniq(e,"id").length!==e.length&&d.push("Element: found id duplicities in ports."),d},_isValidPortId:function(a){return null!==a&&void 0!==a&&!c.isObject(a)},addPorts:function(a,b){return a.length&&this.prop("ports/items",c.assign([],this.prop("ports/items")).concat(a),b),this},removePort:function(a,b){var d=b||{},e=c.assign([],this.prop("ports/items")),f=this.getPortIndex(a);return f!==-1&&(e.splice(f,1),d.rewrite=!0,this.prop("ports/items",e,d)),this},_createPortData:function(){var a=this._validatePorts();if(a.length>0)throw this.set("ports",this.previous("ports")),new Error(a.join(" "));var b;this._portSettingsData&&(b=this._portSettingsData.getPorts()),this._portSettingsData=new d(this.get("ports"));var c=this._portSettingsData.getPorts();if(b){var e=c.filter(function(a){if(!b.find(function(b){return b.id===a.id}))return a}),f=b.filter(function(a){if(!c.find(function(b){return b.id===a.id}))return a});f.length>0&&this.trigger("ports:remove",this,f),e.length>0&&this.trigger("ports:add",this,e)}}}),c.assign(a.dia.ElementView.prototype,{portContainerMarkup:"g",portMarkup:[{tagName:"circle",selector:"circle",attributes:{r:10,fill:"#FFFFFF",stroke:"#000000"}}],portLabelMarkup:[{tagName:"text",selector:"text",attributes:{fill:"#000000"}}],_portElementsCache:null,_initializePorts:function(){this._portElementsCache={},this.listenTo(this.model,"change:ports",function(){this._refreshPorts()})},_refreshPorts:function(){this._removePorts(),this._portElementsCache={},this._renderPorts()},_renderPorts:function(){for(var a=[],b=this._getContainerElement(),d=0,e=b.node.childNodes.length;d1?V("g").append(h):V(h.firstChild),e=g.selectors}else b=V(f),Array.isArray(b)&&(b=V("g").append(b));if(!b)throw new Error("ElementView: Invalid port markup.");b.attr({port:a.id,"port-group":a.group});var i,j=this._getPortLabelMarkup(a.label);if(Array.isArray(j)){var k=c.parseDOMJSON(j),l=k.fragment;d=l.childNodes.length>1?V("g").append(l):V(l.firstChild),i=k.selectors}else d=V(j),Array.isArray(d)&&(d=V("g").append(d));if(!d)throw new Error("ElementView: Invalid port label markup.");var m;if(e&&i){for(var n in i)if(e[n])throw new Error("ElementView: selectors within port must be unique.");m=c.assign({},e,i)}else m=e||i;var o=V(this.portContainerMarkup).addClass("joint-port").append([b.addClass("joint-port-body"),d.addClass("joint-port-label")]);return this._portElementsCache[a.id]={portElement:o,portLabelElement:d,portSelectors:m,portLabelSelectors:i,portContentElement:b,portContentSelectors:e},o},_updatePortGroup:function(a){for(var b=g.Rect(this.model.size()),c=this.model._portSettingsData.getGroupPortsMetrics(a,b),d=0,e=c.length;d'}),joint.shapes.basic.TextView=joint.dia.ElementView.extend({initialize:function(){joint.dia.ElementView.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:attrs",this.resize)}}),joint.shapes.basic.Generic.define("basic.Text",{attrs:{text:{"font-size":18,fill:"#000000"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Circle",{size:{width:60,height:60},attrs:{circle:{fill:"#ffffff",stroke:"#000000",r:30,cx:30,cy:30},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Ellipse",{size:{width:60,height:40},attrs:{ellipse:{fill:"#ffffff",stroke:"#000000",rx:30,ry:20,cx:30,cy:20},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Polygon",{size:{width:60,height:40},attrs:{polygon:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Polyline",{size:{width:60,height:40},attrs:{polyline:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Image",{attrs:{text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Path",{size:{width:60,height:60},attrs:{path:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle",ref:"path","ref-x":.5,"ref-dy":10,fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Path.define("basic.Rhombus",{attrs:{path:{d:"M 30 0 L 60 30 30 60 0 30 z"},text:{"ref-y":.5,"ref-dy":null,"y-alignment":"middle"}}}),joint.shapes.basic.PortsModelInterface={initialize:function(){this.updatePortsAttrs(),this.on("change:inPorts change:outPorts",this.updatePortsAttrs,this),this.constructor.__super__.constructor.__super__.initialize.apply(this,arguments)},updatePortsAttrs:function(a){if(this._portSelectors){var b=joint.util.omit(this.get("attrs"),this._portSelectors);this.set("attrs",b,{silent:!0})}this._portSelectors=[];var c={};joint.util.toArray(this.get("inPorts")).forEach(function(a,b,d){var e=this.getPortAttrs(a,b,d.length,".inPorts","in");this._portSelectors=this._portSelectors.concat(Object.keys(e)),joint.util.assign(c,e)},this),joint.util.toArray(this.get("outPorts")).forEach(function(a,b,d){var e=this.getPortAttrs(a,b,d.length,".outPorts","out");this._portSelectors=this._portSelectors.concat(Object.keys(e)),joint.util.assign(c,e)},this),this.attr(c,{silent:!0}),this.processPorts(),this.trigger("process:ports")},getPortSelector:function(a){var b=".inPorts",c=this.get("inPorts").indexOf(a);if(c<0&&(b=".outPorts",c=this.get("outPorts").indexOf(a),c<0))throw new Error("getPortSelector(): Port doesn't exist.");return b+">g:nth-child("+(c+1)+")>.port-body"}},joint.shapes.basic.PortsViewInterface={initialize:function(){this.listenTo(this.model,"process:ports",this.update),joint.dia.ElementView.prototype.initialize.apply(this,arguments)},update:function(){this.renderPorts(),joint.dia.ElementView.prototype.update.apply(this,arguments)},renderPorts:function(){var a=this.$(".inPorts").empty(),b=this.$(".outPorts").empty(),c=joint.util.template(this.model.portMarkup),d=this.model.ports||[];d.filter(function(a){return"in"===a.type}).forEach(function(b,d){a.append(V(c({id:d,port:b})).node)}),d.filter(function(a){return"out"===a.type}).forEach(function(a,d){b.append(V(c({id:d,port:a})).node)})}},joint.shapes.basic.Generic.define("basic.TextBlock",{attrs:{rect:{fill:"#ffffff",stroke:"#000000",width:80,height:100},text:{fill:"#000000","font-size":14,"font-family":"Arial, helvetica, sans-serif"},".content":{text:"","ref-x":.5,"ref-y":.5,"y-alignment":"middle","x-alignment":"middle"}},content:""},{markup:['','',joint.env.test("svgforeignobject")?'
':'',""].join(""),initialize:function(){this.listenTo(this,"change:size",this.updateSize),this.listenTo(this,"change:content",this.updateContent),this.updateSize(this,this.get("size")),this.updateContent(this,this.get("content")),joint.shapes.basic.Generic.prototype.initialize.apply(this,arguments)},updateSize:function(a,b){this.attr({".fobj":joint.util.assign({},b),div:{style:joint.util.assign({},b)}})},updateContent:function(a,b){joint.env.test("svgforeignobject")?this.attr({".content":{html:joint.util.sanitizeHTML(b)}}):this.attr({".content":{text:b}})},setForeignObjectSize:function(){this.updateSize.apply(this,arguments)},setDivContent:function(){this.updateContent.apply(this,arguments)}}),joint.shapes.basic.TextBlockView=joint.dia.ElementView.extend({initialize:function(){joint.dia.ElementView.prototype.initialize.apply(this,arguments),this.noSVGForeignObjectElement=!joint.env.test("svgforeignobject"),joint.env.test("svgforeignobject")||this.listenTo(this.model,"change:content change:size",function(a){this.updateContent(a)})},update:function(a,b){var c=this.model;if(joint.env.test("svgforeignobject"))joint.dia.ElementView.prototype.update.call(this,c,b);else{var d=joint.util.omit(b||c.get("attrs"),".content");joint.dia.ElementView.prototype.update.call(this,c,d),b&&!joint.util.has(b,".content")||this.updateContent(c,b)}},updateContent:function(a,b){var c=joint.util.merge({},(b||a.get("attrs"))[".content"]);c=joint.util.omit(c,"text");var d=joint.util.breakText(a.get("content"),a.get("size"),c,{svgDocument:this.paper.svg}),e=joint.util.setByPath({},".content",c,"/");e[".content"].text=d,joint.dia.ElementView.prototype.update.call(this,a,e)}}),function(a,b,c,d){"use strict";var e=a.Element;e.define("standard.Rectangle",{attrs:{body:{refWidth:"100%",refHeight:"100%",strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"circle",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"ellipse",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Path",{attrs:{body:{refD:"M 0 0 L 10 0 10 10 0 10 Z",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Polygon",{attrs:{body:{refPoints:"0 0 10 0 10 10 0 10",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"polygon",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Polyline",{attrs:{body:{refPoints:"0 0 10 0 10 10 0 10 0 0",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"polyline",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Image",{attrs:{image:{refWidth:"100%",refHeight:"100%"},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"100%",refY2:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}]}),e.define("standard.BorderedImage",{attrs:{border:{refWidth:"100%",refHeight:"100%",stroke:"#333333",strokeWidth:2},image:{refWidth:-1,refHeight:-1,x:.5,y:.5},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"100%",refY2:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"image",selector:"image"},{tagName:"rect",selector:"border",attributes:{fill:"none"}},{tagName:"text",selector:"label"}]}),e.define("standard.EmbeddedImage",{attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#FFFFFF",strokeWidth:2},image:{refWidth:"30%",refHeight:-20,x:10,y:10,preserveAspectRatio:"xMidYMin"},label:{textVerticalAnchor:"top",textAnchor:"left",refX:"30%",refX2:20,refY:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}]}),e.define("standard.HeaderedRectangle",{attrs:{body:{refWidth:"100%",refHeight:"100%",strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},header:{refWidth:"100%",height:30,strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},headerText:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:15,fontSize:16,fill:"#333333"},bodyText:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",refY2:15,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"header"},{tagName:"text",selector:"headerText"},{tagName:"text",selector:"bodyText"}]});var f=10;joint.dia.Element.define("standard.Cylinder",{attrs:{body:{lateralArea:f,fill:"#FFFFFF",stroke:"#333333",strokeWidth:2},top:{refCx:"50%",cy:f,refRx:"50%",ry:f,fill:"#FFFFFF",stroke:"#333333",strokeWidth:2},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"100%",refY2:15,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],topRy:function(a,c){ -if(void 0===a)return this.attr("body/lateralArea");var d=b.isPercentage(a),e={lateralArea:a},f=d?{refCy:a,refRy:a,cy:null,ry:null}:{refCy:null,refRy:null,cy:a,ry:a};return this.attr({body:e,top:f},c)}},{attributes:{lateralArea:{set:function(a,c){var e=b.isPercentage(a);e&&(a=parseFloat(a)/100);var f=c.x,g=c.y,h=c.width,i=c.height,j=h/2,k=e?i*a:a,l=d.KAPPA,m=l*j,n=l*(e?i*a:a),o=f,p=f+h/2,q=f+h,r=g+k,s=r-k,t=g+i-k,u=g+i,v=["M",o,r,"L",o,t,"C",f,t+n,p-m,u,p,u,"C",p+m,u,q,t+n,q,t,"L",q,r,"C",q,r-n,p+m,s,p,s,"C",p-m,s,o,r-n,o,r,"Z"];return{d:v.join(" ")}}}}});var g={tagName:"foreignObject",selector:"foreignObject",attributes:{overflow:"hidden"},children:[{tagName:"div",namespaceURI:"http://www.w3.org/1999/xhtml",selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]},h={tagName:"text",selector:"label",attributes:{"text-anchor":"middle"}};e.define("standard.TextBlock",{attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#ffffff",strokeWidth:2},foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}}},{markup:[{tagName:"rect",selector:"body"},c.test("svgforeignobject")?g:h]},{attributes:{text:{set:function(c,d,e,f){if(!(e instanceof HTMLElement)){var g=f.style||{},h={text:c,width:-5,height:"100%"},i=b.assign({textVerticalAnchor:"middle"},g);return a.attributes.textWrap.set.call(this,h,d,e,i),{fill:g.color||null}}e.textContent=c},position:function(a,b,c){if(c instanceof SVGElement)return b.center()}}}});var i=a.Link;i.define("standard.Link",{attrs:{line:{connection:!0,stroke:"#333333",strokeWidth:2,strokeLinejoin:"round",targetMarker:{type:"path",d:"M 10 -5 0 0 10 5 z"}},wrapper:{connection:!0,strokeWidth:10,strokeLinejoin:"round"}}},{markup:[{tagName:"path",selector:"wrapper",attributes:{fill:"none",cursor:"pointer",stroke:"transparent"}},{tagName:"path",selector:"line",attributes:{fill:"none","pointer-events":"none"}}]}),i.define("standard.DoubleLink",{attrs:{line:{connection:!0,stroke:"#DDDDDD",strokeWidth:4,strokeLinejoin:"round",targetMarker:{type:"path",stroke:"#000000",d:"M 10 -3 10 -10 -2 0 10 10 10 3"}},outline:{connection:!0,stroke:"#000000",strokeWidth:6,strokeLinejoin:"round"}}},{markup:[{tagName:"path",selector:"outline",attributes:{fill:"none"}},{tagName:"path",selector:"line",attributes:{fill:"none"}}]}),i.define("standard.ShadowLink",{attrs:{line:{connection:!0,stroke:"#FF0000",strokeWidth:20,strokeLinejoin:"round",targetMarker:{type:"path",stroke:"none",d:"M 0 -10 -10 0 0 10 z"},sourceMarker:{type:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z"}},shadow:{connection:!0,refX:3,refY:6,stroke:"#000000",strokeOpacity:.2,strokeWidth:20,strokeLinejoin:"round",targetMarker:{type:"path",d:"M 0 -10 -10 0 0 10 z",stroke:"none"},sourceMarker:{type:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z"}}}},{markup:[{tagName:"path",selector:"shadow",attributes:{fill:"none"}},{tagName:"path",selector:"line",attributes:{fill:"none"}}]})}(joint.dia,joint.util,joint.env,V),joint.routers.manhattan=function(a,b,c,d){"use strict";function e(a){this.map={},this.options=a,this.mapGridSize=100}function f(){this.items=[],this.hash={},this.values={},this.OPEN=1,this.CLOSE=2}function g(a,b){return b&&b.paddingBox?a.sourceBBox.clone().moveAndExpand(b.paddingBox):a.sourceBBox.clone()}function h(a,b){return b&&b.paddingBox?a.targetBBox.clone().moveAndExpand(b.paddingBox):a.targetBBox.clone()}function i(a,b){if(a.sourceAnchor)return a.sourceAnchor;var c=g(a,b);return c.center()}function j(a,b){if(a.targetAnchor)return a.targetAnchor;var c=h(a,b);return c.center()}function k(b,c,d,e,f){var g=360/d,h=b.theta(l(b,c,e,f)),i=a.normalizeAngle(h+g/2);return g*Math.floor(i/g)}function l(b,c,d,e){var f=e.step,g=c.x-b.x,h=c.y-b.y,i=g/d.x,j=h/d.y,k=i*f,l=j*f;return new a.Point(b.x+k,b.y+l)}function m(a,b){var c=Math.abs(a-b);return c>180?360-c:c}function n(a,b,c){var e=c.step;d.toArray(c.directions).forEach(function(a){a.gridOffsetX=a.offsetX/e*b.x,a.gridOffsetY=a.offsetY/e*b.y})}function o(a,b,c){return{source:b.clone(),x:p(c.x-b.x,a),y:p(c.y-b.y,a)}}function p(a,b){if(!a)return b;var c=Math.abs(a),d=Math.round(c/b);if(!d)return c;var e=d*b,f=c-e,g=f/d;return b+g}function q(b,c){var d=c.source,e=a.snapToGrid(b.x-d.x,c.x)+d.x,f=a.snapToGrid(b.y-d.y,c.y)+d.y;return new a.Point(e,f)}function r(a,b){return a?a.round(b.precision):a}function s(a){return a.clone().round().toString()}function t(b){return new a.Point(0===b.x?0:Math.abs(b.x)/b.x,0===b.y?0:Math.abs(b.y)/b.y)}function u(a,b,c,d,e,f){for(var g,h=[],i=t(e.difference(c)),j=s(c),k=a[j];k;){g=r(b[j],f);var l=t(g.difference(r(k.clone(),f)));l.equals(i)||(h.unshift(g),i=l),j=s(k),k=a[j]}var m=r(b[j],f),n=t(m.difference(d));return n.equals(i)||h.unshift(m),h}function v(a,b){for(var c=1/0,d=0,e=b.length;dj)&&(j=w,t=q(v,f))}var x=r(t,g);x&&(c.containsPoint(x)&&r(x.offset(l.x*f.x,l.y*f.y),g),d.push(x))}return d},[]);return c.containsPoint(i)||n.push(i),n}function x(b,c,e,g){var h,l;h=b instanceof a.Rect?i(this,g).clone():b.clone(),l=c instanceof a.Rect?j(this,g).clone():c.clone();var p,t,x,y,z=o(g.step,h,l);if(b instanceof a.Rect?(p=r(q(h,z),g),x=w(p,b,g.startDirections,z,g)):(p=r(q(h,z),g),x=[p]),c instanceof a.Rect?(t=r(q(l,z),g),y=w(l,c,g.endDirections,z,g)):(t=r(q(l,z),g),y=[t]),x=x.filter(e.isPointAccessible,e),y=y.filter(e.isPointAccessible,e),x.length>0&&y.length>0){for(var A=new f,B={},C={},D={},E=0,F=x.length;E0;){var Q,R=A.pop(),S=B[R],T=C[R],U=D[R],V=void 0===T,W=S.equals(p);if(Q=V?L?W?null:k(p,S,N,z,g):K:k(T,S,N,z,g),O.indexOf(R)>=0)return g.previousDirectionAngle=Q,u(C,B,S,p,t,g);for(E=0;Eg.maxAllowedDirectionChange)){var Y=S.clone().offset(I.gridOffsetX,I.gridOffsetY),Z=s(Y);if(!A.isClose(Z)&&e.isPointAccessible(Y)){if(O.indexOf(Z)>=0){r(Y,g);var $=Y.equals(t);if(!$){var _=k(Y,t,N,z,g),aa=m(X,_);if(aa>g.maxAllowedDirectionChange)continue}}var ba=I.cost,ca=W?0:g.penalties[J],da=U+ba+ca;(!A.isOpen(Z)||da90){var i=f;f=h,h=i}var j=d%90<45?f:h,k=new g.Line(a,j),l=90*Math.ceil(d/90),m=g.Point.fromPolar(k.squaredLength(),g.toRad(l+135),j),n=new g.Line(b,m),o=k.intersection(n),p=o?o:b,q=o?p:a,r=360/c.directions.length,s=q.theta(b),t=g.normalizeAngle(s+r/2),u=r*Math.floor(t/r);return c.previousDirectionAngle=u,p&&e.push(p.round()),e.push(b),e}};return function(c,d,e){if(!a.isFunction(joint.routers.manhattan))throw new Error("Metro requires the manhattan router.");return joint.routers.manhattan(c,a.assign({},b,d),e)}}(joint.util),joint.routers.normal=function(a,b,c){return a},joint.routers.oneSide=function(a,b,c){var d,e,f,g=b.side||"bottom",h=b.padding||40,i=c.sourceBBox,j=c.targetBBox,k=i.center(),l=j.center();switch(g){case"bottom":f=1,d="y",e="height";break;case"top":f=-1,d="y",e="height";break;case"left":f=-1,d="x",e="width";break;case"right":f=1,d="x",e="width";break;default:throw new Error("Router: invalid side")}return k[d]+=f*(i[e]/2+h),l[d]+=f*(j[e]/2+h),f*(k[d]-l[d])>0?l[d]=k[d]:k[d]=l[d],[k].concat(a,l)},joint.routers.orthogonal=function(a){function b(a,b,c){var d=new g.Point(a.x,b.y);return c.containsPoint(d)&&(d=new g.Point(b.x,a.y)),d}function c(a,b){return a["W"===b||"E"===b?"width":"height"]}function d(a,b){return a.x===b.x?a.y>b.y?"N":"S":a.y===b.y?a.x>b.x?"W":"E":null}function e(a){return new g.Rect(a.x,a.y,0,0)}function f(a,b){var c=b&&b.elementPadding||20;return a.sourceBBox.clone().inflate(c)}function h(a,b){var c=b&&b.elementPadding||20;return a.targetBBox.clone().inflate(c)}function i(a,b){if(a.sourceAnchor)return a.sourceAnchor;var c=f(a,b);return c.center()}function j(a,b){if(a.targetAnchor)return a.targetAnchor;var c=h(a,b);return c.center()}function k(a,b,c){var e=new g.Point(a.x,b.y),f=new g.Point(b.x,a.y),h=d(a,e),i=d(a,f),j=q[c],k=h===c||h!==j&&(i===j||i!==c)?e:f;return{points:[k],direction:d(k,b)}}function l(a,c,e){var f=b(a,c,e);return{points:[f],direction:d(f,c)}}function m(e,f,h,i){var j,k={},l=[new g.Point(e.x,f.y),new g.Point(f.x,e.y)],m=l.filter(function(a){return!h.containsPoint(a)}),n=m.filter(function(a){return d(a,e)!==i});if(n.length>0)j=n.filter(function(a){return d(e,a)===i}).pop(),j=j||n[0],k.points=[j],k.direction=d(j,f);else{j=a.difference(l,m)[0];var o=new g.Point(f).move(j,-c(h,i)/2),p=b(o,e,h);k.points=[p,o],k.direction=d(o,f)}return k}function n(a,b,e,f){var h=l(b,a,f),i=h.points[0];if(e.containsPoint(i)){h=l(a,b,e);var j=h.points[0];if(f.containsPoint(j)){var m=new g.Point(a).move(j,-c(e,d(a,j))/2),n=new g.Point(b).move(i,-c(f,d(b,i))/2),o=new g.Line(m,n).midpoint(),p=l(a,o,e),q=k(o,b,p.direction);h.points=[p.points[0],q.points[0]],h.direction=q.direction}}return h}function o(a,c,e,f,h){var i,j,k,l={},m=e.union(f).inflate(1),n=m.center().distance(c)>m.center().distance(a),o=n?c:a,p=n?a:c;return h?(i=g.Point.fromPolar(m.width+m.height,r[h],o),i=m.pointNearestToPoint(i).move(i,-1)):i=m.pointNearestToPoint(o).move(o,1),j=b(i,p,m),i.round().equals(j.round())?(j=g.Point.fromPolar(m.width+m.height,g.toRad(i.theta(o))+Math.PI/2,p),j=m.pointNearestToPoint(j).move(p,1).round(),k=b(i,j,m),l.points=n?[j,k,i]:[i,k,j]):l.points=n?[j,i]:[i,j],l.direction=n?d(i,c):d(j,c),l}function p(b,c,p){var q=c.elementPadding||20,r=f(p,c),s=h(p,c),t=i(p,c),u=j(p,c);r=r.union(e(t)),s=s.union(e(u)),b=a.toArray(b).map(g.Point),b.unshift(t),b.push(u);for(var v,w=[],x=0,y=b.length-1;x=Math.abs(a.y-b.y)){var k=(a.x+b.x)/2;j=g.Path.createSegment("C",k,a.y,k,b.y,b.x,b.y),e.appendSegment(j)}else{var l=(a.y+b.y)/2;j=g.Path.createSegment("C",a.x,l,b.x,l,b.x,b.y),e.appendSegment(j)}}return f?e:e.serialize()},joint.connectors.jumpover=function(a,b,c){function d(a,c,d){var e=[].concat(a,d,c);return e.reduce(function(a,c,d){var f=e[d+1];return null!=f&&(a[d]=b.line(c,f)),a},[])}function e(a){var b=a.paper._jumpOverUpdateList;null==b&&(b=a.paper._jumpOverUpdateList=[],a.paper.on("cell:pointerup",f),a.paper.model.on("reset",function(){b=a.paper._jumpOverUpdateList=[]})),b.indexOf(a)<0&&(b.push(a),a.listenToOnce(a.model,"change:connector remove",function(){b.splice(b.indexOf(a),1)}))}function f(){for(var a=this._jumpOverUpdateList,b=0;bw)||"jumpover"!==d.name)}),z=y.map(function(a){return s.findViewByModel(a)}),A=d(a,b,f),B=z.map(function(a){return null==a?[]:a===this?A:d(a.sourcePoint,a.targetPoint,a.route)},this),C=A.reduce(function(a,b){var c=y.reduce(function(a,c,d){if(c!==v){var e=g(b,B[d]);a.push.apply(a,e)}return a},[]).sort(function(a,c){return h(b.start,a)-h(b.start,c)});return c.length>0?a.push.apply(a,i(b,c,p)):a.push(b),a},[]),D=j(C,p,q);return o?D:D.serialize()}}(_,g,joint.util),function(a,b,c,d){function e(a,b,d){var e=a.toJSON();return e.angle=b||0,c.util.defaults({},d,e)}function f(a,c,d){return a.map(function(a,b,c){var d=this.pointAt((b+.5)/c.length);return(a.dx||a.dy)&&d.offset(a.dx||0,a.dy||0),e(d.round(),0,a)},b.line(c,d))}function g(a,c,d,f){var g=c.center(),h=c.width/c.height,i=c.topMiddle(),j=b.Ellipse.fromRect(c);return a.map(function(a,b,c){var k=d+f(b,c.length),l=i.clone().rotate(g,-k).scale(h,1,g),m=a.compensateRotation?-j.tangentTheta(l):0;return(a.dx||a.dy)&&l.offset(a.dx||0,a.dy||0),a.dr&&l.move(g,a.dr),e(l.round(),m,a)})}function h(a,c){var e=c.x;d.isString(e)&&(e=parseFloat(e)/100*a.width);var f=c.y;return d.isString(f)&&(f=parseFloat(f)/100*a.height),b.point(e||0,f||0)}c.layout.Port={absolute:function(a,b,c){return a.map(h.bind(null,b))},fn:function(a,b,c){return c.fn(a,b,c)},line:function(a,b,c){var d=h(b,c.start||b.origin()),e=h(b,c.end||b.corner());return f(a,d,e)},left:function(a,b,c){return f(a,b.origin(),b.bottomLeft())},right:function(a,b,c){return f(a,b.topRight(),b.corner())},top:function(a,b,c){return f(a,b.origin(),b.topRight())},bottom:function(a,b,c){return f(a,b.bottomLeft(),b.corner())},ellipseSpread:function(a,b,c){var d=c.startAngle||0,e=c.step||360/a.length;return g(a,b,d,function(a){return a*e})},ellipse:function(a,b,c){var d=c.startAngle||0,e=c.step||20;return g(a,b,d,function(a,b){return(a+.5-b/2)*e})}}}(_,g,joint,joint.util),function(a,b,c,d){function e(a,b){return d.defaultsDeep({},a,b,{x:0,y:0,angle:0,attrs:{".":{y:"0","text-anchor":"start"}}})}function f(a,b,c,f){f=d.defaults({},f,{offset:15});var h,i,j,k,l=b.center().theta(a),m=g(b),n=f.offset,o=0;lm[2]?(j=".3em",h=n,i=0,k="start"):lo[2]?(k=".3em",i=-m,j=0,l="end"):h-270&&i<-90?(g="start",j=i-180):g="end";var m=Math.round;return e({x:m(k.x),y:m(k.y),angle:c?j:0,attrs:{".":{y:l,"text-anchor":g}}})}c.layout.PortLabel={manual:function(a,b,c){return e(c,b)},left:function(a,b,c){return e(c,{x:-15,attrs:{".":{y:".3em","text-anchor":"end"}}})},right:function(a,b,c){return e(c,{x:15,attrs:{".":{y:".3em","text-anchor":"start"}}})},top:function(a,b,c){return e(c,{y:-15,attrs:{".":{"text-anchor":"middle"}}})},bottom:function(a,b,c){return e(c,{y:15,attrs:{".":{y:".6em","text-anchor":"middle"}}})},outsideOriented:function(a,b,c){return f(a,b,!0,c)},outside:function(a,b,c){return f(a,b,!1,c)},insideOriented:function(a,b,c){return h(a,b,!0,c)},inside:function(a,b,c){return h(a,b,!1,c)},radial:function(a,b,c){return i(a.difference(b.center()),!1,c)},radialOriented:function(a,b,c){return i(a.difference(b.center()),!0,c)}}}(_,g,joint,joint.util),joint.highlighters.addClass={className:joint.util.addClassNamePrefix("highlighted"),highlight:function(a,b,c){var d=c||{},e=d.className||this.className;V(b).addClass(e)},unhighlight:function(a,b,c){var d=c||{},e=d.className||this.className;V(b).removeClass(e)}},joint.highlighters.opacity={highlight:function(a,b){V(b).addClass(joint.util.addClassNamePrefix("highlight-opacity"))},unhighlight:function(a,b){V(b).removeClass(joint.util.addClassNamePrefix("highlight-opacity"))}},joint.highlighters.stroke={defaultOptions:{padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},_views:{},getHighlighterId:function(a,b){return a.id+JSON.stringify(b)},removeHighlighter:function(a){this._views[a]&&(this._views[a].remove(),this._views[a]=null)},highlight:function(a,b,c){var d=this.getHighlighterId(b,c);if(!this._views[d]){var e,f=joint.util.defaults(c||{},this.defaultOptions),g=V(b);try{var h=g.convertToPathData()}catch(a){e=g.bbox(!0),h=V.rectToPath(joint.util.assign({},f,e))}var i=V("path").attr({d:h,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"}).attr(f.attrs),j=g.getTransformToElement(a.el),k=f.padding;if(k){e||(e=g.bbox(!0));var l=e.x+e.width/2,m=e.y+e.height/2;e=V.transformRect(e,j);var n=Math.max(e.width,1),o=Math.max(e.height,1),p=(n+k)/n,q=(o+k)/o,r=V.createSVGMatrix({a:p,b:0,c:0,d:q,e:l-p*l,f:m-q*m});j=j.multiply(r)}i.transform(j);var s=this._views[d]=new joint.mvc.View({svgElement:!0,className:"highlight-stroke",el:i.node}),t=this.removeHighlighter.bind(this,d),u=a.model;s.listenTo(u,"remove",t),s.listenTo(u.graph,"reset",t),a.vel.append(i)}},unhighlight:function(a,b,c){this.removeHighlighter(this.getHighlighterId(b,c))}},function(a,b){function c(a){return function(c,d,e,f){var g=!!f.rotate,h=g?c.getNodeUnrotatedBBox(d):c.getNodeBBox(d),i=h[a](),j=f.dx;if(j){var k=b.isPercentage(j);j=parseFloat(j),isFinite(j)&&(k&&(j/=100,j*=h.width),i.x+=j)}var l=f.dy;if(l){var m=b.isPercentage(l);l=parseFloat(l),isFinite(l)&&(m&&(l/=100,l*=h.height),i.y+=l)}return g?i.rotate(c.model.getBBox().center(),-c.model.angle()):i}}function d(a){return function(b,c,d,e){if(d instanceof Element){var f=this.paper.findView(d),h=f?f.getNodeBBox(d).center():new g.Point;return a.call(this,b,c,h,e)}return a.apply(this,arguments)}}function e(a,b,c,d){var e=a.model.angle(),f=a.getNodeBBox(b),h=f.center(),i=f.origin(),j=f.corner(),k=d.padding;if(isFinite(k)||(k=0),i.y+k<=c.y&&c.y<=j.y-k){var l=c.y-h.y;h.x+=0===e||180===e?0:1*l/Math.tan(g.toRad(e)),h.y+=l}else if(i.x+k<=c.x&&c.x<=j.x-k){var m=c.x-h.x;h.y+=90===e||270===e?0:m*Math.tan(g.toRad(e)),h.x+=m}return h}function f(a,b,c,d){var e,f,g,h=!!d.rotate;h?(e=a.getNodeUnrotatedBBox(b),g=a.model.getBBox().center(),f=a.model.angle()):e=a.getNodeBBox(b);var i=d.padding;isFinite(i)&&e.inflate(i),h&&c.rotate(g,f);var j,k=e.sideNearestToPoint(c);switch(k){case"left":j=e.leftMiddle();break;case"right":j=e.rightMiddle();break;case"top":j=e.topMiddle();break;case"bottom":j=e.bottomMiddle()}return h?j.rotate(g,-f):j}function h(a,b){var c=a.model,d=c.getBBox(),e=d.center(),f=c.angle(),h=a.findAttribute("port",b);if(h){portGroup=c.portProp(h,"group");var i=c.getPortsPositions(portGroup),j=new g.Point(i[h]).offset(d.origin());return j.rotate(e,-f),j}return e}a.anchors={center:c("center"),top:c("topMiddle"),bottom:c("bottomMiddle"),left:c("leftMiddle"),right:c("rightMiddle"),topLeft:c("origin"),topRight:c("topRight"),bottomLeft:c("bottomLeft"),bottomRight:c("corner"),perpendicular:d(e),midSide:d(f),modelCenter:h}}(joint,joint.util),function(a,b,c,d){function e(a,c){return 1===a.length?a[0]:b.sortBy(a,function(a){return a.squaredDistance(c)})[0]}function f(a,b,c){if(!isFinite(c))return a;var d=a.distance(b);return 0===c&&d>0?a:a.move(b,-Math.min(c,d-1))}function g(a){var b=a.getAttribute("stroke-width");return null===b?0:parseFloat(b)||0}function h(a,b,c,d){return f(a.end,a.start,d.offset)}function i(a,b,c,d){var h=b.getNodeBBox(c);d.stroke&&h.inflate(g(c)/2);var i=a.intersect(h),j=i?e(i,a.start):a.end;return f(j,a.start,d.offset)}function j(a,b,c,d){var h=b.model.angle();if(0===h)return i(a,b,c,d);var j=b.getNodeUnrotatedBBox(c);d.stroke&&j.inflate(g(c)/2);var k=j.center(),l=a.clone().rotate(k,h),m=l.setLength(1e6).intersect(j),n=m?e(m,l.start).rotate(k,-h):a.end;return f(n,a.start,d.offset)}function k(a,h,i,j){var k,n,o=j.selector,p=a.end;if("string"==typeof o)k=h.findBySelector(o)[0];else if(Array.isArray(o))k=b.getByPath(i,o);else{k=i;do{var q=k.tagName.toUpperCase();if("G"===q)k=k.firstChild;else{if("TITLE"!==q)break;k=k.nextSibling}}while(k)}if(!(k instanceof Element))return p;var r=h.getNodeShape(k),s=h.getNodeMatrix(k),t=h.getRootTranslateMatrix(),u=h.getRootRotateMatrix(),v=t.multiply(u).multiply(s),w=v.inverse(),x=d.transformLine(a,w),y=x.start.clone(),z=h.getNodeData(k);if(j.insideout===!1){z[m]||(z[m]=r.bbox());var A=z[m];if(A.containsPoint(y))return p}var B;if(r instanceof c.Path){var C=j.precision||2;z[l]||(z[l]=r.getSegmentSubdivisions({precision:C})),segmentSubdivisions=z[l],B={precision:C,segmentSubdivisions:z[l]}}j.extrapolate===!0&&x.setLength(1e6),n=x.intersect(r,B),n?d.isArray(n)&&(n=e(n,y)):j.sticky===!0&&(n=r instanceof c.Rect?r.pointNearestToPoint(y):r instanceof c.Ellipse?r.intersectionWithLineFromCenterToPoint(y):r.closestPoint(y,B));var D=n?d.transformPoint(n,v):p,E=j.offset||0;return j.stroke&&(E+=g(k)/2),f(D,a.start,E)}var l="segmentSubdivisons",m="shapeBBox";a.connectionPoints={anchor:h,bbox:i,rectangle:j,boundary:k}}(joint,joint.util,g,V),function(a,b){function c(a,b){return 0===b?"0%":Math.round(a/b*100)+"%"}function d(a){return function(b,d,e,f){var g=d.model.angle(),h=d.getNodeUnrotatedBBox(e),i=d.model.getBBox().center();f.rotate(i,g);var j=f.x-h.x,k=f.y-h.y;return a&&(j=c(j,h.width),k=c(k,h.height)),b.anchor={name:"topLeft",args:{dx:j,dy:k,rotate:!0}},b}}a.connectionStrategies={useDefaults:b.noop,pinAbsolute:d(!1),pinRelative:d(!0)}}(joint,joint.util),function(a,b,c,d){function e(b,c,d){var e=a.connectionStrategies.pinRelative.call(this.paper,{},c,d,b,this.model);return e.anchor}function f(a,b,c,d,e,f){var g=f.options.snapRadius,h="source"===d,i=h?0:-1,j=this.model.vertex(i)||this.getEndAnchor(h?"target":"source");return j&&(Math.abs(j.x-a.x)0?c[a-1]:b.sourceAnchor,f=a0){var d=this.getNeighborPoints(b),e=d.prev,f=d.next;Math.abs(a.x-e.x)0&&b<=1,d=0,e={x:0,y:0};if(a.offset){var f=a.offset;"number"==typeof f&&(d=f),f.x&&(e.x=f.x),f.y&&(e.y=f.y)}var g,h=0!==e.x||0!==e.y||0===d,i=this.path,j={segmentSubdivisions:this.getConnectionSubdivisions()},k=c?b*this.getConnectionLength():b;if(h)g=i.pointAtLength(k,j),g.offset(e);else{var l=i.tangentAtLength(k,j);l?(l.rotate(l.start,-90),l.setLength(d),g=l.end):g=i.start}return g},getVertexIndex:function(a,b){for(var c=this.model,d=c.vertices(),e=this.getClosestPointLength(new g.Point(a,b)),f=0,h=d.length;f0){for(var j=0,k=i.length;j").addClass(joint.util.addClassNamePrefix("paper-background")),this.options.background&&this.drawBackground(this.options.background),this.$grid=$("
").addClass(joint.util.addClassNamePrefix("paper-grid")),this.options.drawGrid&&this.drawGrid(),this.$el.append(this.$background,this.$grid,this.svg),this},update:function(){return this.options.drawGrid&&this.drawGrid(),this._background&&this.updateBackgroundImage(this._background),this},_viewportMatrix:null,_viewportTransformString:null,matrix:function(a){var b=this.viewport;if(void 0===a){var c=b.getAttribute("transform");return(this._viewportTransformString||null)===c?a=this._viewportMatrix:(a=b.getCTM(),this._viewportMatrix=a,this._viewportTransformString=c),V.createSVGMatrix(a)}a=V.createSVGMatrix(a);var d=V.matrixToTransformString(a);return b.setAttribute("transform",d),this.tools.setAttribute("transform",d),this._viewportMatrix=a,this._viewportTransformString=b.getAttribute("transform"),this},clientMatrix:function(){return V.createSVGMatrix(this.viewport.getScreenCTM())},_sortDelayingBatches:["add","to-front","to-back"],_onSort:function(){this.model.hasActiveBatch(this._sortDelayingBatches)||this.sortViews()},_onBatchStop:function(a){var b=a&&a.batchName;this._sortDelayingBatches.includes(b)&&!this.model.hasActiveBatch(this._sortDelayingBatches)&&this.sortViews()},onRemove:function(){this.removeViews()},setDimensions:function(a,b){a=this.options.width=a||this.options.width,b=this.options.height=b||this.options.height,this.$el.css({width:Math.round(a),height:Math.round(b)}),this.trigger("resize",a,b)},setOrigin:function(a,b){return this.translate(a||0,b||0,{absolute:!0})},fitToContent:function(a,b,c,d){joint.util.isObject(a)?(d=a,a=d.gridWidth||1,b=d.gridHeight||1,c=d.padding||0):(d=d||{},a=a||1,b=b||1,c=c||0),c=joint.util.normalizeSides(c);var e=V(this.viewport).getBBox(),f=this.scale(),g=this.translate();e.x*=f.sx,e.y*=f.sy,e.width*=f.sx,e.height*=f.sy;var h=Math.max(Math.ceil((e.width+e.x)/a),1)*a,i=Math.max(Math.ceil((e.height+e.y)/b),1)*b,j=0,k=0;("negative"==d.allowNewOrigin&&e.x<0||"positive"==d.allowNewOrigin&&e.x>=0||"any"==d.allowNewOrigin)&&(j=Math.ceil(-e.x/a)*a,j+=c.left,h+=j),("negative"==d.allowNewOrigin&&e.y<0||"positive"==d.allowNewOrigin&&e.y>=0||"any"==d.allowNewOrigin)&&(k=Math.ceil(-e.y/b)*b,k+=c.top,i+=k),h+=c.right,i+=c.bottom,h=Math.max(h,d.minWidth||0),i=Math.max(i,d.minHeight||0),h=Math.min(h,d.maxWidth||Number.MAX_VALUE),i=Math.min(i,d.maxHeight||Number.MAX_VALUE);var l=h!=this.options.width||i!=this.options.height,m=j!=g.tx||k!=g.ty;m&&this.translate(j,k),l&&this.setDimensions(h,i)},scaleContentToFit:function(a){var b=this.getContentBBox();if(b.width&&b.height){a=a||{},joint.util.defaults(a,{padding:0,preserveAspectRatio:!0,scaleGrid:null,minScale:0,maxScale:Number.MAX_VALUE});var c,d=a.padding,e=a.minScaleX||a.minScale,f=a.maxScaleX||a.maxScale,h=a.minScaleY||a.minScale,i=a.maxScaleY||a.maxScale;if(a.fittingBBox)c=a.fittingBBox;else{var j=this.translate();c={x:j.tx,y:j.ty,width:this.options.width,height:this.options.height}}c=g.rect(c).moveAndExpand({x:d,y:d,width:-2*d,height:-2*d});var k=this.scale(),l=c.width/b.width*k.sx,m=c.height/b.height*k.sy;if(a.preserveAspectRatio&&(l=m=Math.min(l,m)),a.scaleGrid){var n=a.scaleGrid;l=n*Math.floor(l/n),m=n*Math.floor(m/n)}l=Math.min(f,Math.max(e,l)),m=Math.min(i,Math.max(h,m)),this.scale(l,m);var o=this.getContentBBox(),p=c.x-o.x,q=c.y-o.y;this.translate(p,q)}},getContentArea:function(){return V(this.viewport).getBBox()},getContentBBox:function(){var a=this.viewport.getBoundingClientRect(),b=this.clientMatrix(),c=this.translate();return g.rect({x:a.left-b.e+c.tx,y:a.top-b.f+c.ty,width:a.width,height:a.height})},getArea:function(){return this.paperToLocalRect({x:0,y:0,width:this.options.width,height:this.options.height})},getRestrictedArea:function(){var a;return a=joint.util.isFunction(this.options.restrictTranslate)?this.options.restrictTranslate.apply(this,arguments):this.options.restrictTranslate===!0?this.getArea():this.options.restrictTranslate||null},createViewForModel:function(a){var b,c,d=this.options.cellViewNamespace,e=a.get("type")+"View",f=joint.util.getByPath(d,e,".");a.isLink()?(b=this.options.linkView,c=joint.dia.LinkView):(b=this.options.elementView,c=joint.dia.ElementView);var g=b.prototype instanceof Backbone.View?f||b:b.call(this,a)||f||c;return new g({model:a,interactive:this.options.interactive})},onCellAdded:function(a,b,c){if(this.options.async&&c.async!==!1&&joint.util.isNumber(c.position)){if(this._asyncCells=this._asyncCells||[],this._asyncCells.push(a),0==c.position){if(this._frameId)throw new Error("another asynchronous rendering in progress");this.asyncRenderViews(this._asyncCells,c),delete this._asyncCells}}else this.renderView(a)},removeView:function(a){var b=this._views[a.id];return b&&(b.remove(),delete this._views[a.id]),b},renderView:function(a){var b=this._views[a.id]=this.createViewForModel(a);return V(this.viewport).append(b.el),b.paper=this,b.render(),b},onImageDragStart:function(){return!1},beforeRenderViews:function(a){return a.sort(function(a){return a.isLink()?1:-1}),a},afterRenderViews:function(){this.sortViews()},resetViews:function(a,b){this.removeViews();var c=a.models.slice();if(c=this.beforeRenderViews(c,b)||c,this.cancelRenderViews(),this.options.async)this.asyncRenderViews(c,b);else{for(var d=0,e=c.length;d(e.get("z")||0)?1:-1})},scale:function(a,b,c,d){if(void 0===a)return V.matrixToScale(this.matrix());void 0===b&&(b=a),void 0===c&&(c=0,d=0);var e=this.translate();if(c||d||e.tx||e.ty){var f=e.tx-c*(a-1),g=e.ty-d*(b-1);this.translate(f,g)}var h=this.matrix();return h.a=a||0,h.d=b||0,this.matrix(h),this.trigger("scale",a,b,c,d),this},rotate:function(a,b,c){if(void 0===a)return V.matrixToRotate(this.matrix());if(void 0===b){var d=this.viewport.getBBox();b=d.width/2,c=d.height/2}var e=this.matrix().translate(b,c).rotate(a).translate(-b,-c);return this.matrix(e),this},translate:function(a,b){if(void 0===a)return V.matrixToTranslate(this.matrix());var c=this.matrix();c.e=a||0,c.f=b||0,this.matrix(c);var d=this.translate(),e=this.options.origin;return e.x=d.tx,e.y=d.ty,this.trigger("translate",d.tx,d.ty),this.options.drawGrid&&this.drawGrid(),this},findView:function(a){for(var b=joint.util.isString(a)?this.viewport.querySelector(a):a instanceof $?a[0]:a;b&&b!==this.el&&b!==document;){var c=b.getAttribute("model-id");if(c)return this._views[c];b=b.parentNode}},findViewByModel:function(a){var b=joint.util.isString(a)||joint.util.isNumber(a)?a:a&&a.id;return this._views[b]},findViewsFromPoint:function(a){a=g.point(a);var b=this.model.getElements().map(this.findViewByModel,this);return b.filter(function(b){return b&&b.vel.getBBox({target:this.viewport}).containsPoint(a)},this)},findViewsInArea:function(a,b){b=joint.util.defaults(b||{},{strict:!1}),a=g.rect(a);var c=this.model.getElements().map(this.findViewByModel,this),d=b.strict?"containsRect":"intersect";return c.filter(function(b){return b&&a[d](b.vel.getBBox({target:this.viewport}))},this)},removeTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"remove"),this},hideTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"hide"),this},showTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"show"),this},getModelById:function(a){return this.model.getCell(a)},snapToGrid:function(a,b){return this.clientToLocalPoint(a,b).snapToGrid(this.options.gridSize)},localToPaperPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.matrix());return g.Point(d)},localToPaperRect:function(a,b,c,d){var e=g.Rect(a,b),f=V.transformRect(e,this.matrix());return g.Rect(f)},paperToLocalPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.matrix().inverse());return g.Point(d)},paperToLocalRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.matrix().inverse());return g.Rect(f)},localToClientPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.clientMatrix());return g.Point(d)},localToClientRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.clientMatrix());return g.Rect(f)},clientToLocalPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.clientMatrix().inverse());return g.Point(d)},clientToLocalRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.clientMatrix().inverse());return g.Rect(f)},localToPagePoint:function(a,b){return this.localToPaperPoint(a,b).offset(this.pageOffset())},localToPageRect:function(a,b,c,d){return this.localToPaperRect(a,b,c,d).moveAndExpand(this.pageOffset())},pageToLocalPoint:function(a,b){var c=g.Point(a,b),d=c.difference(this.pageOffset());return this.paperToLocalPoint(d)},pageToLocalRect:function(a,b,c,d){var e=this.pageOffset(),f=g.Rect(a,b,c,d);return f.x-=e.x,f.y-=e.y,this.paperToLocalRect(f)},clientOffset:function(){var a=this.svg.getBoundingClientRect();return g.Point(a.left,a.top)},pageOffset:function(){return this.clientOffset().offset(window.scrollX,window.scrollY)},linkAllowed:function(a){if(!(a instanceof joint.dia.LinkView))throw new Error("Must provide a linkView.");var b=a.model,c=this.options,d=this.model,e=d.constructor.validations;return!(!c.multiLinks&&!e.multiLinks.call(this,d,b))&&(!(!c.linkPinning&&!e.linkPinning.call(this,d,b))&&!("function"==typeof c.allowLink&&!c.allowLink.call(this,a,this)))},getDefaultLink:function(a,b){return joint.util.isFunction(this.options.defaultLink)?this.options.defaultLink.call(this,a,b):this.options.defaultLink.clone()},resolveHighlighter:function(a){a=a||{};var b=a.highlighter,c=this.options;if(void 0===b){var d=["embedding","connecting","magnetAvailability","elementAvailability"].find(function(b){return!!a[b]});b=d&&c.highlighting[d]||c.highlighting.default}if(!b)return!1;joint.util.isString(b)&&(b={name:b});var e=b.name,f=c.highlighterNamespace[e];if(!f)throw new Error('Unknown highlighter ("'+e+'")');if("function"!=typeof f.highlight)throw new Error('Highlighter ("'+e+'") is missing required highlight() method');if("function"!=typeof f.unhighlight)throw new Error('Highlighter ("'+e+'") is missing required unhighlight() method');return{highlighter:f,options:b.options||{},name:e}},onCellHighlight:function(a,b,c){if(c=this.resolveHighlighter(c)){b.id||(b.id=V.uniqueId());var d=c.name+b.id+JSON.stringify(c.options);if(!this._highlights[d]){var e=c.highlighter;e.highlight(a,b,joint.util.assign({},c.options)),this._highlights[d]={cellView:a,magnetEl:b,opt:c.options,highlighter:e}}}},onCellUnhighlight:function(a,b,c){if(c=this.resolveHighlighter(c)){var d=c.name+b.id+JSON.stringify(c.options),e=this._highlights[d];e&&(e.highlighter.unhighlight(e.cellView,e.magnetEl,e.opt),this._highlights[d]=null)}},pointerdblclick:function(a){a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target); +if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerdblclick(a,c.x,c.y):this.trigger("blank:pointerdblclick",a,c.x,c.y)}},pointerclick:function(a){if(this._mousemoved<=this.options.clickThreshold){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(this.guard(a,b))return;var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerclick(a,c.x,c.y):this.trigger("blank:pointerclick",a,c.x,c.y)}},contextmenu:function(a){this.options.preventContextMenu&&a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.contextmenu(a,c.x,c.y):this.trigger("blank:contextmenu",a,c.x,c.y)}},pointerdown:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?(a.preventDefault(),b.pointerdown(a,c.x,c.y)):(this.options.preventDefaultBlankAction&&a.preventDefault(),this.trigger("blank:pointerdown",a,c.x,c.y)),this.delegateDragEvents(b,a.data)}},pointermove:function(a){a.preventDefault();var b=this.eventData(a);b.mousemoved||(b.mousemoved=0);var c=++b.mousemoved;if(!(c<=this.options.moveThreshold)){a=joint.util.normalizeEvent(a);var d=this.snapToGrid({x:a.clientX,y:a.clientY}),e=b.sourceView;e?e.pointermove(a,d.x,d.y):this.trigger("blank:pointermove",a,d.x,d.y),this.eventData(a,b)}},pointerup:function(a){this.undelegateDocumentEvents(),a=joint.util.normalizeEvent(a);var b=this.snapToGrid({x:a.clientX,y:a.clientY}),c=this.eventData(a).sourceView;c?c.pointerup(a,b.x,b.y):this.trigger("blank:pointerup",a,b.x,b.y),this.delegateEvents()},mouseover:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b))if(b)b.mouseover(a);else{if(this.el===a.target)return;this.trigger("blank:mouseover",a)}},mouseout:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b))if(b)b.mouseout(a);else{if(this.el===a.target)return;this.trigger("blank:mouseout",a)}},mouseenter:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.findView(a.relatedTarget);if(b){if(c===b)return;b.mouseenter(a)}else{if(c)return;this.trigger("paper:mouseenter",a)}}},mouseleave:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.findView(a.relatedTarget);if(b){if(c===b)return;b.mouseleave(a)}else{if(c)return;this.trigger("paper:mouseleave",a)}}},mousewheel:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=a.originalEvent,d=this.snapToGrid({x:c.clientX,y:c.clientY}),e=Math.max(-1,Math.min(1,c.wheelDelta||-c.detail));b?b.mousewheel(a,d.x,d.y,e):this.trigger("blank:mousewheel",a,d.x,d.y,e)}},onevent:function(a){var b=a.currentTarget,c=b.getAttribute("event");if(c){var d=this.findView(b);if(d){if(a=joint.util.normalizeEvent(a),this.guard(a,d))return;var e=this.snapToGrid({x:a.clientX,y:a.clientY});d.onevent(a,c,e.x,e.y)}}},onmagnet:function(a){var b=a.currentTarget,c=b.getAttribute("magnet");if(c){var d=this.findView(b);if(d){if(a=joint.util.normalizeEvent(a),this.guard(a,d))return;if(!this.options.validateMagnet(d,b))return;var e=this.snapToGrid(a.clientX,a.clientY);d.onmagnet(a,e.x,e.y)}}},onlabel:function(a){var b=a.currentTarget,c=this.findView(b);if(c){if(a=joint.util.normalizeEvent(a),this.guard(a,c))return;var d=this.snapToGrid(a.clientX,a.clientY);c.onlabel(a,d.x,d.y)}},delegateDragEvents:function(a,b){b||(b={}),this.eventData({data:b},{sourceView:a||null,mousemoved:0}),this.delegateDocumentEvents(null,b),this.undelegateEvents()},guard:function(a,b){return"mousedown"===a.type&&2===a.button||(!(!this.options.guard||!this.options.guard(a,b))||(a.data&&void 0!==a.data.guarded?a.data.guarded:!(b&&b.model&&b.model instanceof joint.dia.Cell)&&(this.svg!==a.target&&this.el!==a.target&&!$.contains(this.svg,a.target))))},setGridSize:function(a){return this.options.gridSize=a,this.options.drawGrid&&this.drawGrid(),this},clearGrid:function(){return this.$grid&&this.$grid.css("backgroundImage","none"),this},_getGriRefs:function(){return this._gridCache||(this._gridCache={root:V("svg",{width:"100%",height:"100%"},V("defs")),patterns:{},add:function(a,b){V(this.root.node.childNodes[0]).append(b),this.patterns[a]=b,this.root.append(V("rect",{width:"100%",height:"100%",fill:"url(#"+a+")"}))},get:function(a){return this.patterns[a]},exist:function(a){return void 0!==this.patterns[a]}}),this._gridCache},setGrid:function(a){this.clearGrid(),this._gridCache=null,this._gridSettings=[];var b=Array.isArray(a)?a:[a||{}];return b.forEach(function(a){this._gridSettings.push.apply(this._gridSettings,this._resolveDrawGridOption(a))},this),this},_resolveDrawGridOption:function(a){var b=this.constructor.gridPatterns;if(joint.util.isString(a)&&Array.isArray(b[a]))return b[a].map(function(a){return joint.util.assign({},a)});var c=a||{args:[{}]},d=Array.isArray(c),e=c.name;if(d||e||c.markup||(e="dot"),e&&Array.isArray(b[e])){var f=b[e].map(function(a){return joint.util.assign({},a)}),g=Array.isArray(c.args)?c.args:[c.args||{}];joint.util.defaults(g[0],joint.util.omit(a,"args"));for(var h=0;h'),f=joint.util.toArray(d).map(function(a){return e({offset:a.offset,color:a.color,opacity:Number.isFinite(a.opacity)?a.opacity:1})}),g=["<"+c+">",f.join(""),""].join(""),h=joint.util.assign({id:b},a.attrs);V(g,h).appendTo(this.defs)}return b},defineMarker:function(a){if(!joint.util.isObject(a))throw new TypeError("dia.Paper: defineMarker() requires 1. argument to be an object.");var b=a.id;if(b||(b=this.svg.id+joint.util.hashCode(JSON.stringify(a))),!this.isDefined(b)){var c=joint.util.omit(a,"type","userSpaceOnUse"),d=V("marker",{id:b,orient:"auto",overflow:"visible",markerUnits:a.markerUnits||"userSpaceOnUse"},[V(a.type||"path",c)]);d.appendTo(this.defs)}return b}},{backgroundPatterns:{flipXy:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=2*c,b.height=2*d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.setTransform(-1,0,0,-1,b.width,b.height),e.drawImage(a,0,0,c,d),e.setTransform(-1,0,0,1,b.width,0),e.drawImage(a,0,0,c,d),e.setTransform(1,0,0,-1,0,b.height),e.drawImage(a,0,0,c,d),b},flipX:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=2*c,b.height=d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.translate(2*c,0),e.scale(-1,1),e.drawImage(a,0,0,c,d),b},flipY:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=c,b.height=2*d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.translate(0,2*d),e.scale(1,-1),e.drawImage(a,0,0,c,d),b},watermark:function(a,b){b=b||{};var c=a.width,d=a.height,e=document.createElement("canvas");e.width=3*c,e.height=3*d;for(var f=e.getContext("2d"),h=joint.util.isNumber(b.watermarkAngle)?-b.watermarkAngle:-20,i=g.toRad(h),j=e.width/4,k=e.height/4,l=0;l<4;l++)for(var m=0;m<4;m++)(l+m)%2>0&&(f.setTransform(1,0,0,1,(2*l-1)*j,(2*m-1)*k),f.rotate(i),f.drawImage(a,-c/2,-d/2,c,d));return e}},gridPatterns:{dot:[{color:"#AAAAAA",thickness:1,markup:"rect",update:function(a,b){V(a).attr({width:b.thickness*b.sx,height:b.thickness*b.sy,fill:b.color})}}],fixedDot:[{color:"#AAAAAA",thickness:1,markup:"rect",update:function(a,b){var c=b.sx<=1?b.thickness*b.sx:b.thickness;V(a).attr({width:c,height:c,fill:b.color})}}],mesh:[{color:"#AAAAAA",thickness:1,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}}],doubleMesh:[{color:"#AAAAAA",thickness:1,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}},{color:"#000000",thickness:3,scaleFactor:4,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}}]}}),function(a,b){var c=function(c){var d=b.cloneDeep(c)||{};this.ports=[],this.groups={},this.portLayoutNamespace=a.layout.Port,this.portLabelLayoutNamespace=a.layout.PortLabel,this._init(d)};c.prototype={getPorts:function(){return this.ports},getGroup:function(a){return this.groups[a]||{}},getPortsByGroup:function(a){return this.ports.filter(function(b){return b.group===a})},getGroupPortsMetrics:function(a,c){var d=this.getGroup(a),e=this.getPortsByGroup(a),f=d.position||{},h=f.name,i=this.portLayoutNamespace;i[h]||(h="left");var j=f.args||{},k=e.map(function(a){return a&&a.position&&a.position.args}),l=i[h](k,c,j),m={ports:e,result:[]};return b.toArray(l).reduce(function(a,b,d){var e=a.ports[d];return a.result.push({portId:e.id,portTransformation:b,labelTransformation:this._getPortLabelLayout(e,g.Point(b),c),portAttrs:e.attrs,portSize:e.size,labelSize:e.label.size}),a}.bind(this),m),m.result},_getPortLabelLayout:function(a,b,c){var d=this.portLabelLayoutNamespace,e=a.label.position.name||"left";return d[e]?d[e](b,c,a.label.position.args):null},_init:function(a){if(b.isObject(a.groups))for(var c=Object.keys(a.groups),d=0,e=c.length;d0},hasPort:function(a){return this.getPortIndex(a)!==-1},getPorts:function(){return b.cloneDeep(this.prop("ports/items"))||[]},getPort:function(a){return b.cloneDeep(b.toArray(this.prop("ports/items")).find(function(b){return b.id&&b.id===a}))},getPortsPositions:function(a){var b=this._portSettingsData.getGroupPortsMetrics(a,g.Rect(this.size()));return b.reduce(function(a,b){var c=b.portTransformation;return a[b.portId]={x:c.x,y:c.y,angle:c.angle},a},{})},getPortIndex:function(a){var c=b.isObject(a)?a.id:a;return this._isValidPortId(c)?b.toArray(this.prop("ports/items")).findIndex(function(a){return a.id===c}):-1},addPort:function(a,c){if(!b.isObject(a)||Array.isArray(a))throw new Error("Element: addPort requires an object.");var d=b.assign([],this.prop("ports/items"));return d.push(a),this.prop("ports/items",d,c),this},portProp:function(a,c,d,e){var f=this.getPortIndex(a);if(f===-1)throw new Error("Element: unable to find port with id "+a);var g=Array.prototype.slice.call(arguments,1);return Array.isArray(c)?g[0]=["ports","items",f].concat(c):b.isString(c)?g[0]=["ports/items/",f,"/",c].join(""):(g=["ports/items/"+f],b.isPlainObject(c)&&(g.push(c),g.push(d))),this.prop.apply(this,g)},_validatePorts:function(){var c=this.get("ports")||{},d=[];c=c||{};var e=b.toArray(c.items);return e.forEach(function(a){"object"!=typeof a&&d.push("Element: invalid port ",a),this._isValidPortId(a.id)||(a.id=b.uuid())},this),a.util.uniq(e,"id").length!==e.length&&d.push("Element: found id duplicities in ports."),d},_isValidPortId:function(a){return null!==a&&void 0!==a&&!b.isObject(a)},addPorts:function(a,c){return a.length&&this.prop("ports/items",b.assign([],this.prop("ports/items")).concat(a),c),this},removePort:function(a,c){var d=c||{},e=b.assign([],this.prop("ports/items")),f=this.getPortIndex(a);return f!==-1&&(e.splice(f,1),d.rewrite=!0,this.prop("ports/items",e,d)),this},_createPortData:function(){var a=this._validatePorts();if(a.length>0)throw this.set("ports",this.previous("ports")),new Error(a.join(" "));var b;this._portSettingsData&&(b=this._portSettingsData.getPorts()),this._portSettingsData=new c(this.get("ports"));var d=this._portSettingsData.getPorts();if(b){var e=d.filter(function(a){if(!b.find(function(b){return b.id===a.id}))return a}),f=b.filter(function(a){if(!d.find(function(b){return b.id===a.id}))return a});f.length>0&&this.trigger("ports:remove",this,f),e.length>0&&this.trigger("ports:add",this,e)}}}),b.assign(a.dia.ElementView.prototype,{portContainerMarkup:"g",portMarkup:[{tagName:"circle",selector:"circle",attributes:{r:10,fill:"#FFFFFF",stroke:"#000000"}}],portLabelMarkup:[{tagName:"text",selector:"text",attributes:{fill:"#000000"}}],_portElementsCache:null,_initializePorts:function(){this._portElementsCache={},this.listenTo(this.model,"change:ports",function(){this._refreshPorts()})},_refreshPorts:function(){this._removePorts(),this._portElementsCache={},this._renderPorts()},_renderPorts:function(){for(var a=[],c=this._getContainerElement(),d=0,e=c.node.childNodes.length;d1?V("g").append(h):V(h.firstChild),e=g.selectors}else c=V(f),Array.isArray(c)&&(c=V("g").append(c));if(!c)throw new Error("ElementView: Invalid port markup.");c.attr({port:a.id,"port-group":a.group});var i,j=this._getPortLabelMarkup(a.label);if(Array.isArray(j)){var k=b.parseDOMJSON(j),l=k.fragment;d=l.childNodes.length>1?V("g").append(l):V(l.firstChild),i=k.selectors}else d=V(j),Array.isArray(d)&&(d=V("g").append(d));if(!d)throw new Error("ElementView: Invalid port label markup.");var m;if(e&&i){for(var n in i)if(e[n])throw new Error("ElementView: selectors within port must be unique.");m=b.assign({},e,i)}else m=e||i;var o=V(this.portContainerMarkup).addClass("joint-port").append([c.addClass("joint-port-body"),d.addClass("joint-port-label")]);return this._portElementsCache[a.id]={portElement:o,portLabelElement:d,portSelectors:m,portLabelSelectors:i,portContentElement:c,portContentSelectors:e},o},_updatePortGroup:function(a){for(var b=g.Rect(this.model.size()),c=this.model._portSettingsData.getGroupPortsMetrics(a,b),d=0,e=c.length;d'}),joint.shapes.basic.TextView=joint.dia.ElementView.extend({initialize:function(){joint.dia.ElementView.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:attrs",this.resize)}}),joint.shapes.basic.Generic.define("basic.Text",{attrs:{text:{"font-size":18,fill:"#000000"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Circle",{size:{width:60,height:60},attrs:{circle:{fill:"#ffffff",stroke:"#000000",r:30,cx:30,cy:30},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Ellipse",{size:{width:60,height:40},attrs:{ellipse:{fill:"#ffffff",stroke:"#000000",rx:30,ry:20,cx:30,cy:20},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Polygon",{size:{width:60,height:40},attrs:{polygon:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Polyline",{size:{width:60,height:40},attrs:{polyline:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Image",{attrs:{text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Path",{size:{width:60,height:60},attrs:{path:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle",ref:"path","ref-x":.5,"ref-dy":10,fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Path.define("basic.Rhombus",{attrs:{path:{d:"M 30 0 L 60 30 30 60 0 30 z"},text:{"ref-y":.5,"ref-dy":null,"y-alignment":"middle"}}}),joint.shapes.basic.PortsModelInterface={initialize:function(){this.updatePortsAttrs(),this.on("change:inPorts change:outPorts",this.updatePortsAttrs,this),this.constructor.__super__.constructor.__super__.initialize.apply(this,arguments)},updatePortsAttrs:function(a){if(this._portSelectors){var b=joint.util.omit(this.get("attrs"),this._portSelectors);this.set("attrs",b,{silent:!0})}this._portSelectors=[];var c={};joint.util.toArray(this.get("inPorts")).forEach(function(a,b,d){var e=this.getPortAttrs(a,b,d.length,".inPorts","in");this._portSelectors=this._portSelectors.concat(Object.keys(e)),joint.util.assign(c,e)},this),joint.util.toArray(this.get("outPorts")).forEach(function(a,b,d){var e=this.getPortAttrs(a,b,d.length,".outPorts","out");this._portSelectors=this._portSelectors.concat(Object.keys(e)),joint.util.assign(c,e)},this),this.attr(c,{silent:!0}),this.processPorts(),this.trigger("process:ports")},getPortSelector:function(a){var b=".inPorts",c=this.get("inPorts").indexOf(a);if(c<0&&(b=".outPorts",c=this.get("outPorts").indexOf(a),c<0))throw new Error("getPortSelector(): Port doesn't exist.");return b+">g:nth-child("+(c+1)+")>.port-body"}},joint.shapes.basic.PortsViewInterface={initialize:function(){this.listenTo(this.model,"process:ports",this.update),joint.dia.ElementView.prototype.initialize.apply(this,arguments)},update:function(){this.renderPorts(),joint.dia.ElementView.prototype.update.apply(this,arguments)},renderPorts:function(){var a=this.$(".inPorts").empty(),b=this.$(".outPorts").empty(),c=joint.util.template(this.model.portMarkup),d=this.model.ports||[];d.filter(function(a){return"in"===a.type}).forEach(function(b,d){a.append(V(c({id:d,port:b})).node)}),d.filter(function(a){return"out"===a.type}).forEach(function(a,d){b.append(V(c({id:d,port:a})).node)})}},joint.shapes.basic.Generic.define("basic.TextBlock",{attrs:{rect:{fill:"#ffffff",stroke:"#000000",width:80,height:100},text:{fill:"#000000","font-size":14,"font-family":"Arial, helvetica, sans-serif"},".content":{text:"","ref-x":.5,"ref-y":.5,"y-alignment":"middle","x-alignment":"middle"}},content:""},{markup:['','',joint.env.test("svgforeignobject")?'
':'',""].join(""),initialize:function(){this.listenTo(this,"change:size",this.updateSize),this.listenTo(this,"change:content",this.updateContent),this.updateSize(this,this.get("size")),this.updateContent(this,this.get("content")),joint.shapes.basic.Generic.prototype.initialize.apply(this,arguments)},updateSize:function(a,b){this.attr({".fobj":joint.util.assign({},b),div:{style:joint.util.assign({},b)}})},updateContent:function(a,b){joint.env.test("svgforeignobject")?this.attr({".content":{html:joint.util.sanitizeHTML(b)}}):this.attr({".content":{text:b}})},setForeignObjectSize:function(){this.updateSize.apply(this,arguments)},setDivContent:function(){this.updateContent.apply(this,arguments)}}),joint.shapes.basic.TextBlockView=joint.dia.ElementView.extend({initialize:function(){joint.dia.ElementView.prototype.initialize.apply(this,arguments),this.noSVGForeignObjectElement=!joint.env.test("svgforeignobject"),joint.env.test("svgforeignobject")||this.listenTo(this.model,"change:content change:size",function(a){this.updateContent(a)})},update:function(a,b){var c=this.model;if(joint.env.test("svgforeignobject"))joint.dia.ElementView.prototype.update.call(this,c,b);else{var d=joint.util.omit(b||c.get("attrs"),".content");joint.dia.ElementView.prototype.update.call(this,c,d),b&&!joint.util.has(b,".content")||this.updateContent(c,b)}},updateContent:function(a,b){var c=joint.util.merge({},(b||a.get("attrs"))[".content"]);c=joint.util.omit(c,"text");var d=joint.util.breakText(a.get("content"),a.get("size"),c,{svgDocument:this.paper.svg}),e=joint.util.setByPath({},".content",c,"/");e[".content"].text=d,joint.dia.ElementView.prototype.update.call(this,a,e)}}),function(a,b,c,d){"use strict";var e=a.Element;e.define("standard.Rectangle",{attrs:{body:{refWidth:"100%",refHeight:"100%",strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"circle",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"ellipse",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Path",{attrs:{body:{refD:"M 0 0 L 10 0 10 10 0 10 Z",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Polygon",{attrs:{body:{refPoints:"0 0 10 0 10 10 0 10",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"polygon",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Polyline",{attrs:{body:{refPoints:"0 0 10 0 10 10 0 10 0 0",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"polyline",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Image",{attrs:{image:{refWidth:"100%",refHeight:"100%"},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"100%",refY2:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}]}),e.define("standard.BorderedImage",{attrs:{border:{refWidth:"100%",refHeight:"100%",stroke:"#333333",strokeWidth:2},image:{refWidth:-1,refHeight:-1,x:.5,y:.5},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"100%",refY2:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"image",selector:"image"},{tagName:"rect",selector:"border",attributes:{fill:"none"}},{tagName:"text",selector:"label"}]}),e.define("standard.EmbeddedImage",{attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#FFFFFF",strokeWidth:2},image:{refWidth:"30%",refHeight:-20,x:10,y:10,preserveAspectRatio:"xMidYMin"},label:{textVerticalAnchor:"top",textAnchor:"left",refX:"30%",refX2:20,refY:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}]}),e.define("standard.HeaderedRectangle",{attrs:{body:{refWidth:"100%",refHeight:"100%",strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},header:{refWidth:"100%",height:30,strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},headerText:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:15,fontSize:16,fill:"#333333"},bodyText:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",refY2:15,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"header"},{tagName:"text",selector:"headerText"},{tagName:"text",selector:"bodyText"}]});var f=10;joint.dia.Element.define("standard.Cylinder",{attrs:{body:{lateralArea:f,fill:"#FFFFFF",stroke:"#333333",strokeWidth:2},top:{refCx:"50%",cy:f,refRx:"50%",ry:f,fill:"#FFFFFF",stroke:"#333333",strokeWidth:2},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"100%",refY2:15,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],topRy:function(a,c){ +if(void 0===a)return this.attr("body/lateralArea");var d=b.isPercentage(a),e={lateralArea:a},f=d?{refCy:a,refRy:a,cy:null,ry:null}:{refCy:null,refRy:null,cy:a,ry:a};return this.attr({body:e,top:f},c)}},{attributes:{lateralArea:{set:function(a,c){var e=b.isPercentage(a);e&&(a=parseFloat(a)/100);var f=c.x,g=c.y,h=c.width,i=c.height,j=h/2,k=e?i*a:a,l=d.KAPPA,m=l*j,n=l*(e?i*a:a),o=f,p=f+h/2,q=f+h,r=g+k,s=r-k,t=g+i-k,u=g+i,v=["M",o,r,"L",o,t,"C",f,t+n,p-m,u,p,u,"C",p+m,u,q,t+n,q,t,"L",q,r,"C",q,r-n,p+m,s,p,s,"C",p-m,s,o,r-n,o,r,"Z"];return{d:v.join(" ")}}}}});var g={tagName:"foreignObject",selector:"foreignObject",attributes:{overflow:"hidden"},children:[{tagName:"div",namespaceURI:"http://www.w3.org/1999/xhtml",selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]},h={tagName:"text",selector:"label",attributes:{"text-anchor":"middle"}},i=c.test("svgforeignobject")?g:h;e.define("standard.TextBlock",{attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#ffffff",strokeWidth:2},foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}}},{markup:[{tagName:"rect",selector:"body"},i]},{attributes:{text:{set:function(c,d,e,f){if(!(e instanceof HTMLElement)){var g=f.style||{},h={text:c,width:-5,height:"100%"},i=b.assign({textVerticalAnchor:"middle"},g);return a.attributes.textWrap.set.call(this,h,d,e,i),{fill:g.color||null}}e.textContent=c},position:function(a,b,c){if(c instanceof SVGElement)return b.center()}}}});var j=a.Link;j.define("standard.Link",{attrs:{line:{connection:!0,stroke:"#333333",strokeWidth:2,strokeLinejoin:"round",targetMarker:{type:"path",d:"M 10 -5 0 0 10 5 z"}},wrapper:{connection:!0,strokeWidth:10,strokeLinejoin:"round"}}},{markup:[{tagName:"path",selector:"wrapper",attributes:{fill:"none",cursor:"pointer",stroke:"transparent"}},{tagName:"path",selector:"line",attributes:{fill:"none","pointer-events":"none"}}]}),j.define("standard.DoubleLink",{attrs:{line:{connection:!0,stroke:"#DDDDDD",strokeWidth:4,strokeLinejoin:"round",targetMarker:{type:"path",stroke:"#000000",d:"M 10 -3 10 -10 -2 0 10 10 10 3"}},outline:{connection:!0,stroke:"#000000",strokeWidth:6,strokeLinejoin:"round"}}},{markup:[{tagName:"path",selector:"outline",attributes:{fill:"none"}},{tagName:"path",selector:"line",attributes:{fill:"none"}}]}),j.define("standard.ShadowLink",{attrs:{line:{connection:!0,stroke:"#FF0000",strokeWidth:20,strokeLinejoin:"round",targetMarker:{type:"path",stroke:"none",d:"M 0 -10 -10 0 0 10 z"},sourceMarker:{type:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z"}},shadow:{connection:!0,refX:3,refY:6,stroke:"#000000",strokeOpacity:.2,strokeWidth:20,strokeLinejoin:"round",targetMarker:{type:"path",d:"M 0 -10 -10 0 0 10 z",stroke:"none"},sourceMarker:{type:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z"}}}},{markup:[{tagName:"path",selector:"shadow",attributes:{fill:"none"}},{tagName:"path",selector:"line",attributes:{fill:"none"}}]})}(joint.dia,joint.util,joint.env,V),joint.routers.manhattan=function(a,b,c){"use strict";function d(a){this.map={},this.options=a,this.mapGridSize=100}function e(){this.items=[],this.hash={},this.values={},this.OPEN=1,this.CLOSE=2}function f(a,b){return b&&b.paddingBox?a.sourceBBox.clone().moveAndExpand(b.paddingBox):a.sourceBBox.clone()}function g(a,b){return b&&b.paddingBox?a.targetBBox.clone().moveAndExpand(b.paddingBox):a.targetBBox.clone()}function h(a,b){if(a.sourceAnchor)return a.sourceAnchor;var c=f(a,b);return c.center()}function i(a,b){if(a.targetAnchor)return a.targetAnchor;var c=g(a,b);return c.center()}function j(b,c,d,e,f){var g=360/d,h=b.theta(k(b,c,e,f)),i=a.normalizeAngle(h+g/2);return g*Math.floor(i/g)}function k(b,c,d,e){var f=e.step,g=c.x-b.x,h=c.y-b.y,i=g/d.x,j=h/d.y,k=i*f,l=j*f;return new a.Point(b.x+k,b.y+l)}function l(a,b){var c=Math.abs(a-b);return c>180?360-c:c}function m(a,b,d){var e=d.step;c.toArray(d.directions).forEach(function(a){a.gridOffsetX=a.offsetX/e*b.x,a.gridOffsetY=a.offsetY/e*b.y})}function n(a,b,c){return{source:b.clone(),x:o(c.x-b.x,a),y:o(c.y-b.y,a)}}function o(a,b){if(!a)return b;var c=Math.abs(a),d=Math.round(c/b);if(!d)return c;var e=d*b,f=c-e,g=f/d;return b+g}function p(b,c){var d=c.source,e=a.snapToGrid(b.x-d.x,c.x)+d.x,f=a.snapToGrid(b.y-d.y,c.y)+d.y;return new a.Point(e,f)}function q(a,b){return a?a.round(b.precision):a}function r(a){return a.clone().round().toString()}function s(b){return new a.Point(0===b.x?0:Math.abs(b.x)/b.x,0===b.y?0:Math.abs(b.y)/b.y)}function t(a,b,c,d,e,f){for(var g,h=[],i=s(e.difference(c)),j=r(c),k=a[j];k;){g=q(b[j],f);var l=s(g.difference(q(k.clone(),f)));l.equals(i)||(h.unshift(g),i=l),j=r(k),k=a[j]}var m=q(b[j],f),n=s(m.difference(d));return n.equals(i)||h.unshift(m),h}function u(a,b){for(var c=1/0,d=0,e=b.length;dj)&&(j=w,t=p(v,f))}var x=q(t,g);x&&(d.containsPoint(x)&&q(x.offset(l.x*f.x,l.y*f.y),g),c.push(x))}return c},[]);return d.containsPoint(i)||n.push(i),n}function w(b,d,f,g){var k,o;k=b instanceof a.Rect?h(this,g).clone():b.clone(),o=d instanceof a.Rect?i(this,g).clone():d.clone();var s,w,x,y,z=n(g.step,k,o);if(b instanceof a.Rect?(s=q(p(k,z),g),x=v(s,b,g.startDirections,z,g)):(s=q(p(k,z),g),x=[s]),d instanceof a.Rect?(w=q(p(o,z),g),y=v(o,d,g.endDirections,z,g)):(w=q(p(o,z),g),y=[w]),x=x.filter(f.isPointAccessible,f),y=y.filter(f.isPointAccessible,f),x.length>0&&y.length>0){for(var A=new e,B={},C={},D={},E=0,F=x.length;E0;){var Q,R=A.pop(),S=B[R],T=C[R],U=D[R],V=void 0===T,W=S.equals(s);if(Q=V?L?W?null:j(s,S,N,z,g):K:j(T,S,N,z,g),O.indexOf(R)>=0)return g.previousDirectionAngle=Q,t(C,B,S,s,w,g);for(E=0;Eg.maxAllowedDirectionChange)){var Y=S.clone().offset(I.gridOffsetX,I.gridOffsetY),Z=r(Y);if(!A.isClose(Z)&&f.isPointAccessible(Y)){if(O.indexOf(Z)>=0){q(Y,g);var $=Y.equals(w);if(!$){var _=j(Y,w,N,z,g),aa=l(X,_);if(aa>g.maxAllowedDirectionChange)continue}}var ba=I.cost,ca=W?0:g.penalties[J],da=U+ba+ca;(!A.isOpen(Z)||da90){var i=f;f=h,h=i}var j=d%90<45?f:h,k=new g.Line(a,j),l=90*Math.ceil(d/90),m=g.Point.fromPolar(k.squaredLength(),g.toRad(l+135),j),n=new g.Line(b,m),o=k.intersection(n),p=o?o:b,q=o?p:a,r=360/c.directions.length,s=q.theta(b),t=g.normalizeAngle(s+r/2),u=r*Math.floor(t/r);return c.previousDirectionAngle=u,p&&e.push(p.round()),e.push(b),e}};return function(c,d,e){if(!a.isFunction(joint.routers.manhattan))throw new Error("Metro requires the manhattan router.");return joint.routers.manhattan(c,a.assign({},b,d),e)}}(joint.util),joint.routers.normal=function(a,b,c){return a},joint.routers.oneSide=function(a,b,c){var d,e,f,g=b.side||"bottom",h=b.padding||40,i=c.sourceBBox,j=c.targetBBox,k=i.center(),l=j.center();switch(g){case"bottom":f=1,d="y",e="height";break;case"top":f=-1,d="y",e="height";break;case"left":f=-1,d="x",e="width";break;case"right":f=1,d="x",e="width";break;default:throw new Error("Router: invalid side")}return k[d]+=f*(i[e]/2+h),l[d]+=f*(j[e]/2+h),f*(k[d]-l[d])>0?l[d]=k[d]:k[d]=l[d],[k].concat(a,l)},joint.routers.orthogonal=function(a){function b(a,b,c){var d=new g.Point(a.x,b.y);return c.containsPoint(d)&&(d=new g.Point(b.x,a.y)),d}function c(a,b){return a["W"===b||"E"===b?"width":"height"]}function d(a,b){return a.x===b.x?a.y>b.y?"N":"S":a.y===b.y?a.x>b.x?"W":"E":null}function e(a){return new g.Rect(a.x,a.y,0,0)}function f(a,b){var c=b&&b.elementPadding||20;return a.sourceBBox.clone().inflate(c)}function h(a,b){var c=b&&b.elementPadding||20;return a.targetBBox.clone().inflate(c)}function i(a,b){if(a.sourceAnchor)return a.sourceAnchor;var c=f(a,b);return c.center()}function j(a,b){if(a.targetAnchor)return a.targetAnchor;var c=h(a,b);return c.center()}function k(a,b,c){var e=new g.Point(a.x,b.y),f=new g.Point(b.x,a.y),h=d(a,e),i=d(a,f),j=q[c],k=h===c||h!==j&&(i===j||i!==c)?e:f;return{points:[k],direction:d(k,b)}}function l(a,c,e){var f=b(a,c,e);return{points:[f],direction:d(f,c)}}function m(e,f,h,i){var j,k={},l=[new g.Point(e.x,f.y),new g.Point(f.x,e.y)],m=l.filter(function(a){return!h.containsPoint(a)}),n=m.filter(function(a){return d(a,e)!==i});if(n.length>0)j=n.filter(function(a){return d(e,a)===i}).pop(),j=j||n[0],k.points=[j],k.direction=d(j,f);else{j=a.difference(l,m)[0];var o=new g.Point(f).move(j,-c(h,i)/2),p=b(o,e,h);k.points=[p,o],k.direction=d(o,f)}return k}function n(a,b,e,f){var h=l(b,a,f),i=h.points[0];if(e.containsPoint(i)){h=l(a,b,e);var j=h.points[0];if(f.containsPoint(j)){var m=new g.Point(a).move(j,-c(e,d(a,j))/2),n=new g.Point(b).move(i,-c(f,d(b,i))/2),o=new g.Line(m,n).midpoint(),p=l(a,o,e),q=k(o,b,p.direction);h.points=[p.points[0],q.points[0]],h.direction=q.direction}}return h}function o(a,c,e,f,h){var i,j,k,l={},m=e.union(f).inflate(1),n=m.center().distance(c)>m.center().distance(a),o=n?c:a,p=n?a:c;return h?(i=g.Point.fromPolar(m.width+m.height,r[h],o),i=m.pointNearestToPoint(i).move(i,-1)):i=m.pointNearestToPoint(o).move(o,1),j=b(i,p,m),i.round().equals(j.round())?(j=g.Point.fromPolar(m.width+m.height,g.toRad(i.theta(o))+Math.PI/2,p),j=m.pointNearestToPoint(j).move(p,1).round(),k=b(i,j,m),l.points=n?[j,k,i]:[i,k,j]):l.points=n?[j,i]:[i,j],l.direction=n?d(i,c):d(j,c),l}function p(b,c,p){var q=c.elementPadding||20,r=f(p,c),s=h(p,c),t=i(p,c),u=j(p,c);r=r.union(e(t)),s=s.union(e(u)),b=a.toArray(b).map(g.Point),b.unshift(t),b.push(u);for(var v,w=[],x=0,y=b.length-1;x=Math.abs(a.y-b.y)){var k=(a.x+b.x)/2;j=g.Path.createSegment("C",k,a.y,k,b.y,b.x,b.y),e.appendSegment(j)}else{var l=(a.y+b.y)/2;j=g.Path.createSegment("C",a.x,l,b.x,l,b.x,b.y),e.appendSegment(j)}}return f?e:e.serialize()},joint.connectors.jumpover=function(a,b){function c(b,c,d){var e=[].concat(b,d,c);return e.reduce(function(b,c,d){var f=e[d+1];return null!=f&&(b[d]=a.line(c,f)),b},[])}function d(a){var b=a.paper._jumpOverUpdateList;null==b&&(b=a.paper._jumpOverUpdateList=[],a.paper.on("cell:pointerup",e),a.paper.model.on("reset",function(){b=a.paper._jumpOverUpdateList=[]})),b.indexOf(a)<0&&(b.push(a),a.listenToOnce(a.model,"change:connector remove",function(){b.splice(b.indexOf(a),1)}))}function e(){for(var a=this._jumpOverUpdateList,b=0;bw)||"jumpover"!==d.name)}),z=y.map(function(a){return s.findViewByModel(a)}),A=c(a,e,l),B=z.map(function(a){return null==a?[]:a===this?A:c(a.sourcePoint,a.targetPoint,a.route)},this),C=A.reduce(function(a,b){var c=y.reduce(function(a,c,d){if(c!==v){var e=f(b,B[d]);a.push.apply(a,e)}return a},[]).sort(function(a,c){return g(b.start,a)-g(b.start,c)});return c.length>0?a.push.apply(a,h(b,c,p)):a.push(b),a},[]),D=i(C,p,q);return o?D:D.serialize()}}(g,joint.util),function(a,b,c){function d(a,c,d){var e=a.toJSON();return e.angle=c||0,b.util.defaults({},d,e)}function e(b,c,e){return b.map(function(a,b,c){var e=this.pointAt((b+.5)/c.length);return(a.dx||a.dy)&&e.offset(a.dx||0,a.dy||0),d(e.round(),0,a)},a.line(c,e))}function f(b,c,e,f){var g=c.center(),h=c.width/c.height,i=c.topMiddle(),j=a.Ellipse.fromRect(c);return b.map(function(a,b,c){var k=e+f(b,c.length),l=i.clone().rotate(g,-k).scale(h,1,g),m=a.compensateRotation?-j.tangentTheta(l):0;return(a.dx||a.dy)&&l.offset(a.dx||0,a.dy||0),a.dr&&l.move(g,a.dr),d(l.round(),m,a)})}function g(b,d){var e=d.x;c.isString(e)&&(e=parseFloat(e)/100*b.width);var f=d.y;return c.isString(f)&&(f=parseFloat(f)/100*b.height),a.point(e||0,f||0)}b.layout.Port={absolute:function(a,b,c){return a.map(g.bind(null,b))},fn:function(a,b,c){return c.fn(a,b,c)},line:function(a,b,c){var d=g(b,c.start||b.origin()),f=g(b,c.end||b.corner());return e(a,d,f)},left:function(a,b,c){return e(a,b.origin(),b.bottomLeft())},right:function(a,b,c){return e(a,b.topRight(),b.corner())},top:function(a,b,c){return e(a,b.origin(),b.topRight())},bottom:function(a,b,c){return e(a,b.bottomLeft(),b.corner())},ellipseSpread:function(a,b,c){var d=c.startAngle||0,e=c.step||360/a.length;return f(a,b,d,function(a){return a*e})},ellipse:function(a,b,c){var d=c.startAngle||0,e=c.step||20;return f(a,b,d,function(a,b){return(a+.5-b/2)*e})}}}(g,joint,joint.util),function(a,b,c){function d(a,b){return c.defaultsDeep({},a,b,{x:0,y:0,angle:0,attrs:{".":{y:"0","text-anchor":"start"}}})}function e(a,b,e,g){g=c.defaults({},g,{offset:15});var h,i,j,k,l=b.center().theta(a),m=f(b),n=g.offset,o=0;lm[2]?(j=".3em",h=n,i=0,k="start"):lo[2]?(k=".3em",i=-m,j=0,l="end"):h-270&&i<-90?(g="start",j=i-180):g="end";var m=Math.round;return d({x:m(k.x),y:m(k.y),angle:e?j:0,attrs:{".":{y:l,"text-anchor":g}}})}b.layout.PortLabel={manual:function(a,b,c){return d(c,b)},left:function(a,b,c){return d(c,{x:-15,attrs:{".":{y:".3em","text-anchor":"end"}}})},right:function(a,b,c){return d(c,{x:15,attrs:{".":{y:".3em","text-anchor":"start"}}})},top:function(a,b,c){return d(c,{y:-15,attrs:{".":{"text-anchor":"middle"}}})},bottom:function(a,b,c){return d(c,{y:15,attrs:{".":{y:".6em","text-anchor":"middle"}}})},outsideOriented:function(a,b,c){return e(a,b,!0,c)},outside:function(a,b,c){return e(a,b,!1,c)},insideOriented:function(a,b,c){return g(a,b,!0,c)},inside:function(a,b,c){return g(a,b,!1,c)},radial:function(a,b,c){return h(a.difference(b.center()),!1,c)},radialOriented:function(a,b,c){return h(a.difference(b.center()),!0,c)}}}(g,joint,joint.util),joint.highlighters.addClass={className:joint.util.addClassNamePrefix("highlighted"),highlight:function(a,b,c){var d=c||{},e=d.className||this.className;V(b).addClass(e)},unhighlight:function(a,b,c){var d=c||{},e=d.className||this.className;V(b).removeClass(e)}},joint.highlighters.opacity={highlight:function(a,b){V(b).addClass(joint.util.addClassNamePrefix("highlight-opacity"))},unhighlight:function(a,b){V(b).removeClass(joint.util.addClassNamePrefix("highlight-opacity"))}},joint.highlighters.stroke={defaultOptions:{padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},_views:{},getHighlighterId:function(a,b){return a.id+JSON.stringify(b)},removeHighlighter:function(a){this._views[a]&&(this._views[a].remove(),this._views[a]=null)},highlight:function(a,b,c){var d=this.getHighlighterId(b,c);if(!this._views[d]){var e,f=joint.util.defaults(c||{},this.defaultOptions),g=V(b);try{var h=g.convertToPathData()}catch(a){e=g.bbox(!0),h=V.rectToPath(joint.util.assign({},f,e))}var i=V("path").attr({d:h,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"}).attr(f.attrs),j=g.getTransformToElement(a.el),k=f.padding;if(k){e||(e=g.bbox(!0));var l=e.x+e.width/2,m=e.y+e.height/2;e=V.transformRect(e,j);var n=Math.max(e.width,1),o=Math.max(e.height,1),p=(n+k)/n,q=(o+k)/o,r=V.createSVGMatrix({a:p,b:0,c:0,d:q,e:l-p*l,f:m-q*m});j=j.multiply(r)}i.transform(j);var s=this._views[d]=new joint.mvc.View({svgElement:!0,className:"highlight-stroke",el:i.node}),t=this.removeHighlighter.bind(this,d),u=a.model;s.listenTo(u,"remove",t),s.listenTo(u.graph,"reset",t),a.vel.append(i)}},unhighlight:function(a,b,c){this.removeHighlighter(this.getHighlighterId(b,c))}},function(a,b){function c(a){return function(c,d,e,f){var g=!!f.rotate,h=g?c.getNodeUnrotatedBBox(d):c.getNodeBBox(d),i=h[a](),j=f.dx;if(j){var k=b.isPercentage(j);j=parseFloat(j),isFinite(j)&&(k&&(j/=100,j*=h.width),i.x+=j)}var l=f.dy;if(l){var m=b.isPercentage(l);l=parseFloat(l),isFinite(l)&&(m&&(l/=100,l*=h.height),i.y+=l)}return g?i.rotate(c.model.getBBox().center(),-c.model.angle()):i}}function d(a){return function(b,c,d,e){if(d instanceof Element){var f=this.paper.findView(d),h=f?f.getNodeBBox(d).center():new g.Point;return a.call(this,b,c,h,e)}return a.apply(this,arguments)}}function e(a,b,c,d){var e=a.model.angle(),f=a.getNodeBBox(b),h=f.center(),i=f.origin(),j=f.corner(),k=d.padding;if(isFinite(k)||(k=0),i.y+k<=c.y&&c.y<=j.y-k){var l=c.y-h.y;h.x+=0===e||180===e?0:1*l/Math.tan(g.toRad(e)),h.y+=l}else if(i.x+k<=c.x&&c.x<=j.x-k){var m=c.x-h.x;h.y+=90===e||270===e?0:m*Math.tan(g.toRad(e)),h.x+=m}return h}function f(a,b,c,d){var e,f,g,h=!!d.rotate;h?(e=a.getNodeUnrotatedBBox(b),g=a.model.getBBox().center(),f=a.model.angle()):e=a.getNodeBBox(b);var i=d.padding;isFinite(i)&&e.inflate(i),h&&c.rotate(g,f);var j,k=e.sideNearestToPoint(c);switch(k){case"left":j=e.leftMiddle();break;case"right":j=e.rightMiddle();break;case"top":j=e.topMiddle();break;case"bottom":j=e.bottomMiddle()}return h?j.rotate(g,-f):j}function h(a,b){var c=a.model,d=c.getBBox(),e=d.center(),f=c.angle(),h=a.findAttribute("port",b);if(h){var i=c.portProp(h,"group"),j=c.getPortsPositions(i),k=new g.Point(j[h]).offset(d.origin());return k.rotate(e,-f),k}return e}a.anchors={center:c("center"),top:c("topMiddle"),bottom:c("bottomMiddle"),left:c("leftMiddle"),right:c("rightMiddle"),topLeft:c("origin"),topRight:c("topRight"),bottomLeft:c("bottomLeft"),bottomRight:c("corner"),perpendicular:d(e),midSide:d(f),modelCenter:h}}(joint,joint.util),function(a,b,c,d){function e(a,c){return 1===a.length?a[0]:b.sortBy(a,function(a){return a.squaredDistance(c)})[0]}function f(a,b,c){if(!isFinite(c))return a;var d=a.distance(b);return 0===c&&d>0?a:a.move(b,-Math.min(c,d-1))}function g(a){var b=a.getAttribute("stroke-width");return null===b?0:parseFloat(b)||0}function h(a,b,c,d){return f(a.end,a.start,d.offset)}function i(a,b,c,d){var h=b.getNodeBBox(c);d.stroke&&h.inflate(g(c)/2);var i=a.intersect(h),j=i?e(i,a.start):a.end;return f(j,a.start,d.offset)}function j(a,b,c,d){var h=b.model.angle();if(0===h)return i(a,b,c,d);var j=b.getNodeUnrotatedBBox(c);d.stroke&&j.inflate(g(c)/2);var k=j.center(),l=a.clone().rotate(k,h),m=l.setLength(1e6).intersect(j),n=m?e(m,l.start).rotate(k,-h):a.end;return f(n,a.start,d.offset)}function k(a,h,i,j){var k,n,o=j.selector,p=a.end;if("string"==typeof o)k=h.findBySelector(o)[0];else if(Array.isArray(o))k=b.getByPath(i,o);else{k=i;do{var q=k.tagName.toUpperCase();if("G"===q)k=k.firstChild;else{if("TITLE"!==q)break;k=k.nextSibling}}while(k)}if(!(k instanceof Element))return p;var r=h.getNodeShape(k),s=h.getNodeMatrix(k),t=h.getRootTranslateMatrix(),u=h.getRootRotateMatrix(),v=t.multiply(u).multiply(s),w=v.inverse(),x=d.transformLine(a,w),y=x.start.clone(),z=h.getNodeData(k);if(j.insideout===!1){z[m]||(z[m]=r.bbox());var A=z[m];if(A.containsPoint(y))return p}var B;if(r instanceof c.Path){var C=j.precision||2;z[l]||(z[l]=r.getSegmentSubdivisions({precision:C})),B={precision:C,segmentSubdivisions:z[l]}}j.extrapolate===!0&&x.setLength(1e6),n=x.intersect(r,B),n?d.isArray(n)&&(n=e(n,y)):j.sticky===!0&&(n=r instanceof c.Rect?r.pointNearestToPoint(y):r instanceof c.Ellipse?r.intersectionWithLineFromCenterToPoint(y):r.closestPoint(y,B));var D=n?d.transformPoint(n,v):p,E=j.offset||0;return j.stroke&&(E+=g(k)/2),f(D,a.start,E)}var l="segmentSubdivisons",m="shapeBBox";a.connectionPoints={anchor:h,bbox:i,rectangle:j,boundary:k}}(joint,joint.util,g,V),function(a,b){function c(a,b){return 0===b?"0%":Math.round(a/b*100)+"%"}function d(a){return function(b,d,e,f){var g=d.model.angle(),h=d.getNodeUnrotatedBBox(e),i=d.model.getBBox().center();f.rotate(i,g);var j=f.x-h.x,k=f.y-h.y;return a&&(j=c(j,h.width),k=c(k,h.height)),b.anchor={name:"topLeft",args:{dx:j,dy:k,rotate:!0}},b}}a.connectionStrategies={useDefaults:b.noop,pinAbsolute:d(!1),pinRelative:d(!0)}}(joint,joint.util),function(a,b,c,d){function e(b,c,d){var e=a.connectionStrategies.pinRelative.call(this.paper,{},c,d,b,this.model);return e.anchor}function f(a,b,c,d,e,f){var g=f.options.snapRadius,h="source"===d,i=h?0:-1,j=this.model.vertex(i)||this.getEndAnchor(h?"target":"source");return j&&(Math.abs(j.x-a.x)0?c[a-1]:b.sourceAnchor,f=a0){var d=this.getNeighborPoints(b),e=d.prev,f=d.next;Math.abs(a.x-e.x)'}),joint.shapes.erd.Entity.define("erd.WeakEntity",{attrs:{".inner":{display:"auto"},text:{text:"Weak Entity"}}}),joint.dia.Element.define("erd.Relationship",{size:{width:80,height:80},attrs:{".outer":{fill:"#3498DB",stroke:"#2980B9","stroke-width":2,points:"40,0 80,40 40,80 0,40"},".inner":{fill:"#3498DB",stroke:"#2980B9","stroke-width":2,points:"40,5 75,40 40,75 5,40",display:"none"},text:{text:"Relationship","font-family":"Arial","font-size":12,"ref-x":.5,"ref-y":.5,"y-alignment":"middle","text-anchor":"middle"}}},{markup:''}),joint.shapes.erd.Relationship.define("erd.IdentifyingRelationship",{attrs:{".inner":{display:"auto"},text:{text:"Identifying"}}}),joint.dia.Element.define("erd.Attribute",{size:{width:100,height:50},attrs:{ellipse:{transform:"translate(50, 25)"},".outer":{stroke:"#D35400","stroke-width":2,cx:0,cy:0,rx:50,ry:25,fill:"#E67E22"},".inner":{stroke:"#D35400","stroke-width":2,cx:0,cy:0,rx:45,ry:20,fill:"#E67E22",display:"none"},text:{"font-family":"Arial","font-size":14,"ref-x":.5,"ref-y":.5,"y-alignment":"middle","text-anchor":"middle"}}},{markup:''}),joint.shapes.erd.Attribute.define("erd.Multivalued",{attrs:{".inner":{display:"block"},text:{text:"multivalued"}}}),joint.shapes.erd.Attribute.define("erd.Derived",{attrs:{".outer":{"stroke-dasharray":"3,5"},text:{text:"derived"}}}),joint.shapes.erd.Attribute.define("erd.Key",{attrs:{ellipse:{"stroke-width":4},text:{text:"key","font-weight":"800","text-decoration":"underline"}}}),joint.shapes.erd.Attribute.define("erd.Normal",{attrs:{text:{text:"Normal"}}}),joint.dia.Element.define("erd.ISA",{type:"erd.ISA",size:{width:100,height:50},attrs:{polygon:{points:"0,0 50,50 100,0",fill:"#F1C40F",stroke:"#F39C12","stroke-width":2},text:{text:"ISA","font-size":18,"ref-x":.5,"ref-y":.3,"y-alignment":"middle","text-anchor":"middle"}}},{markup:''}),joint.dia.Link.define("erd.Line",{},{cardinality:function(a){this.set("labels",[{position:-20,attrs:{text:{dy:-8,text:a}}}])}}); joint.shapes.basic.Circle.define("fsa.State",{attrs:{circle:{"stroke-width":3},text:{"font-weight":"800"}}}),joint.dia.Element.define("fsa.StartState",{size:{width:20,height:20},attrs:{circle:{transform:"translate(10, 10)",r:10,fill:"#000000"}}},{markup:''}),joint.dia.Element.define("fsa.EndState",{size:{width:20,height:20},attrs:{".outer":{transform:"translate(10, 10)",r:10,fill:"#ffffff",stroke:"#000000"},".inner":{transform:"translate(10, 10)",r:6,fill:"#000000"}}},{markup:''}),joint.dia.Link.define("fsa.Arrow",{attrs:{".marker-target":{d:"M 10 0 L 0 5 L 10 10 z"}},smooth:!0}); joint.dia.Element.define("org.Member",{size:{width:180,height:70},attrs:{rect:{width:170,height:60},".card":{fill:"#FFFFFF",stroke:"#000000","stroke-width":2,"pointer-events":"visiblePainted",rx:10,ry:10},image:{width:48,height:48,ref:".card","ref-x":10,"ref-y":5},".rank":{"text-decoration":"underline",ref:".card","ref-x":.9,"ref-y":.2,"font-family":"Courier New","font-size":14,"text-anchor":"end"},".name":{"font-weight":"800",ref:".card","ref-x":.9,"ref-y":.6,"font-family":"Courier New","font-size":14,"text-anchor":"end"}}},{markup:''}),joint.dia.Link.define("org.Arrow",{source:{selector:".card"},target:{selector:".card"},attrs:{".connection":{stroke:"#585858","stroke-width":3}},z:-1}); diff --git a/dist/joint.nowrap.js b/dist/joint.nowrap.js index 0902ae527..31680202c 100644 --- a/dist/joint.nowrap.js +++ b/dist/joint.nowrap.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -39,7 +39,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. ) { charCode = str.charCodeAt(idx += 3 / 4); if (charCode > 0xFF) { - throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); + throw new InvalidCharacterError('\'btoa\' failed: The string to be encoded contains characters outside of the Latin1 range.'); } block = block << 8 | charCode; } @@ -52,7 +52,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. object.atob = function(input) { var str = String(input).replace(/=+$/, ''); if (str.length % 4 == 1) { - throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded."); + throw new InvalidCharacterError('\'atob\' failed: The string to be decoded is not correctly encoded.'); } for ( // initialize result and counters @@ -62,8 +62,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. buffer = str.charAt(idx++); // character found in table? initialize bit storage and add its ascii value; ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - // and if not first of each 4 characters, - // convert the first 8 bits to one ascii character + // and if not first of each 4 characters, + // convert the first 8 bits to one ascii character bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 ) { // try to find character in table (0-63, not found => -1) @@ -140,6 +140,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. Object.defineProperty(XMLHttpRequest.prototype, 'response', { get: function() { + /* global VBArray:true */ return new Uint8Array(new VBArray(this.responseBody).toArray()); } }); @@ -244,19 +245,19 @@ if (!Array.prototype.find) { // Production steps of ECMA-262, Edition 6, 22.1.2.1 if (!Array.from) { - Array.from = (function () { + Array.from = (function() { var toStr = Object.prototype.toString; - var isCallable = function (fn) { + var isCallable = function(fn) { return typeof fn === 'function' || toStr.call(fn) === '[object Function]'; }; - var toInteger = function (value) { + var toInteger = function(value) { var number = Number(value); if (isNaN(number)) { return 0; } if (number === 0 || !isFinite(number)) { return number; } return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number)); }; var maxSafeInteger = Math.pow(2, 53) - 1; - var toLength = function (value) { + var toLength = function(value) { var len = toInteger(value); return Math.min(Math.max(len, 0), maxSafeInteger); }; @@ -400,9 +401,9 @@ Number.isNaN = Number.isNaN || function(value) { // Geometry library. // ----------------- -var g = (function() { +var g = {}; - var g = {}; +(function(g) { // Declare shorthands to the most used math functions. var math = Math; @@ -5243,9 +5244,7 @@ var g = (function() { return this.regexSupportedData.test(d); } - return g; - -})(); +})(g); // Vectorizer. // ----------- @@ -5253,8 +5252,8 @@ var g = (function() { // A tiny library for making your life easier when dealing with SVG. // The only Vectorizer dependency is the Geometry library. -var V; -var Vectorizer; +var V; // eslint-disable-line no-unused-vars +var Vectorizer; // eslint-disable-line no-unused-vars V = Vectorizer = (function() { @@ -5417,7 +5416,7 @@ V = Vectorizer = (function() { return transform.translate; } - transformAttr = transformAttr.replace(/translate\([^\)]*\)/g, '').trim(); + transformAttr = transformAttr.replace(/translate\([^)]*\)/g, '').trim(); var newTx = opt.absolute ? tx : transform.translate.tx + tx; var newTy = opt.absolute ? ty : transform.translate.ty + ty; @@ -5442,7 +5441,7 @@ V = Vectorizer = (function() { return transform.rotate; } - transformAttr = transformAttr.replace(/rotate\([^\)]*\)/g, '').trim(); + transformAttr = transformAttr.replace(/rotate\([^)]*\)/g, '').trim(); angle %= 360; @@ -5468,7 +5467,7 @@ V = Vectorizer = (function() { return transform.scale; } - transformAttr = transformAttr.replace(/scale\([^\)]*\)/g, '').trim(); + transformAttr = transformAttr.replace(/scale\([^)]*\)/g, '').trim(); var newScale = 'scale(' + sx + ',' + sy + ')'; @@ -6228,7 +6227,7 @@ V = Vectorizer = (function() { // Fallback for IE 9. // Run the animation programatically if FakeSmile (`http://leunen.me/fakesmile/`) present if (document.documentElement.getAttribute('smiling') === 'fake') { - + /* global getTargets:true, Animator:true, animators:true id2anim:true */ // Register the animation. (See `https://answers.launchpad.net/smil/+question/203333`) var animation = animateMotion.node; animation.animators = []; @@ -6345,7 +6344,7 @@ V = Vectorizer = (function() { }; V.prototype.toGeometryShape = function() { - var x, y, width, height, cx, cy, r, rx, ry, points, d; + var x, y, width, height, cx, cy, r, rx, ry, points, d, x1, x2, y1, y2; switch (this.tagName()) { case 'RECT': @@ -6952,27 +6951,27 @@ V = Vectorizer = (function() { return (da >= svgArcMax) ? (r0 - ? 'M0,' + r1 - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 - + 'M0,' + r0 - + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + (-r0) - + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + r0 - + 'Z' - : 'M0,' + r1 - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 - + 'Z') + ? 'M0,' + r1 + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 + + 'M0,' + r0 + + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + (-r0) + + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + r0 + + 'Z' + : 'M0,' + r1 + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 + + 'Z') : (r0 - ? 'M' + r1 * c0 + ',' + r1 * s0 - + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 - + 'L' + r0 * c1 + ',' + r0 * s1 - + 'A' + r0 + ',' + r0 + ' 0 ' + df + ',0 ' + r0 * c0 + ',' + r0 * s0 - + 'Z' - : 'M' + r1 * c0 + ',' + r1 * s0 - + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 - + 'L0,0' - + 'Z'); + ? 'M' + r1 * c0 + ',' + r1 * s0 + + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 + + 'L' + r0 * c1 + ',' + r0 * s1 + + 'A' + r0 + ',' + r0 + ' 0 ' + df + ',0 ' + r0 * c0 + ',' + r0 * s0 + + 'Z' + : 'M' + r1 * c0 + ',' + r1 * s0 + + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 + + 'L0,0' + + 'Z'); }; // Merge attributes from object `b` with attributes in object `a`. @@ -7707,7 +7706,7 @@ V = Vectorizer = (function() { var joint = { - version: '2.1.3', + version: '2.1.4', config: { // The class name prefix config is for advanced use only. @@ -7941,24 +7940,6 @@ var joint = { return string.replace(/[A-Z]/g, '-$&').toLowerCase(); }, - // Copy all the properties to the first argument from the following arguments. - // All the properties will be overwritten by the properties from the following - // arguments. Inherited properties are ignored. - mixin: _.assign, - - // Copy all properties to the first argument from the following - // arguments only in case if they don't exists in the first argument. - // All the function propererties in the first argument will get - // additional property base pointing to the extenders same named - // property function's call method. - supplement: _.defaults, - - // Same as `mixin()` but deep version. - deepMixin: _.mixin, - - // Same as `supplement()` but deep version. - deepSupplement: _.defaultsDeep, - normalizeEvent: function(evt) { var touchEvt = evt.originalEvent && evt.originalEvent.changedTouches && evt.originalEvent.changedTouches[0]; @@ -8396,7 +8377,7 @@ var joint = { decodedString = unescape(encodeURIComponent(data)); } // write the bytes of the string to a typed array - var ia = new window.Uint8Array(decodedString.length); + var ia = new Uint8Array(decodedString.length); for (var i = 0; i < decodedString.length; i++) { ia[i] = decodedString.charCodeAt(i); } @@ -9037,9 +9018,9 @@ var joint = { value = before + after; return (align === '<' ? negative + value + padding - : align === '>' ? padding + negative + value + : align === '>' ? padding + negative + value : align === '^' ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) - : negative + (zcomma ? value : padding + value)) + fullSuffix; + : negative + (zcomma ? value : padding + value)) + fullSuffix; }, // Formatting string via the Python Format string. @@ -9072,7 +9053,8 @@ var joint = { formattedStringArray.push(pieceFormatedString); formatString = formatString.slice(fieldDelimiterIndex + 1); - fieldDelimiter = (endPlaceholder = !endPlaceholder) ? '}' : '{'; + endPlaceholder = !endPlaceholder; + fieldDelimiter = (endPlaceholder) ? '}' : '{'; } formattedStringArray.push(formatString); @@ -9137,7 +9119,7 @@ var joint = { Must support the variation in templating syntax found here: https://lodash.com/docs#template */ - var regex = /<%= ([^ ]+) %>|\$\{ ?([^\{\} ]+) ?\}|\{\{([^\{\} ]+)\}\}/g; + var regex = /<%= ([^ ]+) %>|\$\{ ?([^{} ]+) ?\}|\{\{([^{} ]+)\}\}/g; return function(data) { @@ -9163,7 +9145,7 @@ var joint = { }, /** - * @param {Element=} el Element, which content is intent to display in full-screen mode, 'window.top.document.body' is default. + * @param {Element} el Element, which content is intent to display in full-screen mode, 'window.top.document.body' is default. */ toggleFullScreen: function(el) { @@ -9337,6 +9319,26 @@ var joint = { } }, + /* global _:true */ + + // Copy all the properties to the first argument from the following arguments. + // All the properties will be overwritten by the properties from the following + // arguments. Inherited properties are ignored. + mixin: _.assign, + + // Copy all properties to the first argument from the following + // arguments only in case if they don't exists in the first argument. + // All the function propererties in the first argument will get + // additional property base pointing to the extenders same named + // property function's call method. + supplement: _.defaults, + + // Same as `mixin()` but deep version. + deepMixin: _.mixin, + + // Same as `supplement()` but deep version. + deepSupplement: _.defaultsDeep, + // lodash 3 vs 4 incompatible sortedIndex: _.sortedIndexBy || _.sortedIndex, uniq: _.uniqBy || _.uniq, @@ -9358,7 +9360,6 @@ var joint = { isPlainObject: _.isPlainObject, isEmpty: _.isEmpty, isEqual: _.isEqual, - noop: function() {}, cloneDeep: _.cloneDeep, toArray: _.toArray, flattenDeep: _.flattenDeep, @@ -9369,25 +9370,6 @@ var joint = { debounce: _.debounce, clone: _.clone, - isBoolean: function(value) { - var toString = Object.prototype.toString; - return value === true || value === false || (!!value && typeof value === 'object' && toString.call(value) === '[object Boolean]'); - }, - - isObject: function(value) { - return !!value && (typeof value === 'object' || typeof value === 'function'); - }, - - isNumber: function(value) { - var toString = Object.prototype.toString; - return typeof value === 'number' || (!!value && typeof value === 'object' && toString.call(value) === '[object Number]'); - }, - - isString: function(value) { - var toString = Object.prototype.toString; - return typeof value === 'string' || (!!value && typeof value === 'object' && toString.call(value) === '[object String]'); - }, - merge: function() { if (_.mergeWith) { var args = Array.from(arguments); @@ -9408,6 +9390,29 @@ var joint = { return _.mergeWith.apply(this, args) } return _.merge.apply(this, arguments); + }, + + /* global _:false */ + + noop: function() {}, + + isBoolean: function(value) { + var toString = Object.prototype.toString; + return value === true || value === false || (!!value && typeof value === 'object' && toString.call(value) === '[object Boolean]'); + }, + + isObject: function(value) { + return !!value && (typeof value === 'object' || typeof value === 'function'); + }, + + isNumber: function(value) { + var toString = Object.prototype.toString; + return typeof value === 'number' || (!!value && typeof value === 'object' && toString.call(value) === '[object Number]'); + }, + + isString: function(value) { + var toString = Object.prototype.toString; + return typeof value === 'string' || (!!value && typeof value === 'object' && toString.call(value) === '[object String]'); } } }; @@ -12365,8 +12370,8 @@ joint.dia.CellView = joint.mvc.View.extend({ can: function(feature) { var interactive = joint.util.isFunction(this.options.interactive) - ? this.options.interactive(this) - : this.options.interactive; + ? this.options.interactive(this) + : this.options.interactive; return (joint.util.isObject(interactive) && interactive[feature] !== false) || (joint.util.isBoolean(interactive) && interactive !== false); @@ -14693,14 +14698,14 @@ joint.dia.Link = joint.dia.Cell.extend({ return label; } -}, - { - endsEqual: function(a, b) { +}, { - var portsEqual = a.port === b.port || !a.port && !b.port; - return a.id === b.id && portsEqual; - } - }); + endsEqual: function(a, b) { + + var portsEqual = a.port === b.port || !a.port && !b.port; + return a.id === b.id && portsEqual; + } +}); // joint.dia.Link base view and controller. @@ -14965,7 +14970,7 @@ joint.dia.LinkView = joint.dia.CellView.extend({ } } - return { fragment: fragment, selectors: {} }; // no selectors + return { fragment: fragment, selectors: {}}; // no selectors }, // Label markup fragment may come wrapped in , or not. @@ -15554,8 +15559,8 @@ joint.dia.LinkView = joint.dia.CellView.extend({ this.targetAnchor.offset(tx, ty); }, - // if label position is a number, normalize it to a position object - // this makes sure that label positions can be merged properly + // if label position is a number, normalize it to a position object + // this makes sure that label positions can be merged properly _normalizeLabelPosition: function(labelPosition) { if (typeof labelPosition === 'number') return { distance: labelPosition, offset: null, args: null }; @@ -16394,12 +16399,11 @@ joint.dia.LinkView = joint.dia.CellView.extend({ // Backwards compatibility var linkTool = V(evt.target).findParentByClass('link-tool', this.el); if (linkTool) { - // No further action to be executed - evt.stopPropagation(); - // Allow `interactive.useLinkTools=false` if (this.can('useLinkTools')) { if (eventName === 'remove') { + // No further action to be executed + evt.stopPropagation(); // Built-in remove event this.model.remove({ ui: true }); @@ -17312,7 +17316,7 @@ joint.dia.Paper = joint.mvc.View.extend({ // Setter: ctm = V.createSVGMatrix(ctm); - ctmString = V.matrixToTransformString(ctm); + var ctmString = V.matrixToTransformString(ctm); viewport.setAttribute('transform', ctmString); this.tools.setAttribute('transform', ctmString); @@ -18511,7 +18515,7 @@ joint.dia.Paper = joint.mvc.View.extend({ add: function(id, vel) { V(this.root.node.childNodes[0]).append(vel); this.patterns[id] = vel; - this.root.append(V('rect', { width: "100%", height: "100%", fill: 'url(#' + id + ')' })); + this.root.append(V('rect', { width: '100%', height: '100%', fill: 'url(#' + id + ')' })); }, get: function(id) { return this.patterns[id] @@ -19070,7 +19074,7 @@ joint.dia.Paper = joint.mvc.View.extend({ } }); -(function(joint, _, util) { +(function(joint, util) { var PortData = function(data) { @@ -19308,7 +19312,8 @@ joint.dia.Paper = joint.mvc.View.extend({ */ hasPorts: function() { - return this.prop('ports/items').length > 0; + var ports = this.prop('ports/items'); + return Array.isArray(ports) && ports.length > 0; }, /** @@ -19334,7 +19339,7 @@ joint.dia.Paper = joint.mvc.View.extend({ */ getPort: function(id) { - return util.cloneDeep(util.toArray(this.prop('ports/items')).find( function(port) { + return util.cloneDeep(util.toArray(this.prop('ports/items')).find(function(port) { return port.id && port.id === id; })); }, @@ -19855,7 +19860,7 @@ joint.dia.Paper = joint.mvc.View.extend({ } }); -}(joint, _, joint.util)); +}(joint, joint.util)); joint.dia.Element.define('basic.Generic', { attrs: { @@ -20140,7 +20145,7 @@ joint.shapes.basic.PortsModelInterface = { selector = '.outPorts'; index = this.get('outPorts').indexOf(name); - if (index < 0) throw new Error("getPortSelector(): Port doesn't exist."); + if (index < 0) throw new Error('getPortSelector(): Port doesn\'t exist.'); } return selector + '>g:nth-child(' + (index + 1) + ')>.port-body'; @@ -20815,6 +20820,8 @@ joint.shapes.basic.TextBlockView = joint.dia.ElementView.extend({ } }; + var labelMarkup = (env.test('svgforeignobject')) ? foLabelMarkup : svgLabelMarkup; + Element.define('standard.TextBlock', { attrs: { body: { @@ -20838,9 +20845,7 @@ joint.shapes.basic.TextBlockView = joint.dia.ElementView.extend({ markup: [{ tagName: 'rect', selector: 'body' - }, - (env.test('svgforeignobject')) ? foLabelMarkup : svgLabelMarkup - ] + }, labelMarkup] }, { attributes: { text: { @@ -20998,7 +21003,7 @@ joint.shapes.basic.TextBlockView = joint.dia.ElementView.extend({ })(joint.dia, joint.util, joint.env, V); -joint.routers.manhattan = (function(g, _, joint, util) { +joint.routers.manhattan = (function(g, joint, util) { 'use strict'; @@ -21797,7 +21802,7 @@ joint.routers.manhattan = (function(g, _, joint, util) { return router(vertices, util.assign({}, config, opt), linkView); }; -})(g, _, joint, joint.util); +})(g, joint, joint.util); joint.routers.metro = (function(util) { @@ -22376,7 +22381,7 @@ joint.connectors.smooth = function(sourcePoint, targetPoint, route, opt) { return (raw) ? path : path.serialize(); }; -joint.connectors.jumpover = (function(_, g, util) { +joint.connectors.jumpover = (function(g, util) { // default size of jump if not specified in options var JUMP_SIZE = 5; @@ -22738,9 +22743,9 @@ joint.connectors.jumpover = (function(_, g, util) { var path = buildPath(jumpingLines, jumpSize, jumpType); return (raw) ? path : path.serialize(); }; -}(_, g, joint.util)); +}(g, joint.util)); -(function(_, g, joint, util) { +(function(g, joint, util) { function portTransformAttrs(point, angle, opt) { @@ -22920,9 +22925,9 @@ joint.connectors.jumpover = (function(_, g, util) { } }; -})(_, g, joint, joint.util); +})(g, joint, joint.util); -(function(_, g, joint, util) { +(function(g, joint, util) { function labelAttributes(opt1, opt2) { @@ -23113,19 +23118,19 @@ joint.connectors.jumpover = (function(_, g, util) { }, left: function(portPosition, elBBox, opt) { - return labelAttributes(opt, { x: -15, attrs: { '.': { y: '.3em', 'text-anchor': 'end' } } }); + return labelAttributes(opt, { x: -15, attrs: { '.': { y: '.3em', 'text-anchor': 'end' }}}); }, right: function(portPosition, elBBox, opt) { - return labelAttributes(opt, { x: 15, attrs: { '.': { y: '.3em', 'text-anchor': 'start' } } }); + return labelAttributes(opt, { x: 15, attrs: { '.': { y: '.3em', 'text-anchor': 'start' }}}); }, top: function(portPosition, elBBox, opt) { - return labelAttributes(opt, { y: -15, attrs: { '.': { 'text-anchor': 'middle' } } }); + return labelAttributes(opt, { y: -15, attrs: { '.': { 'text-anchor': 'middle' }}}); }, bottom: function(portPosition, elBBox, opt) { - return labelAttributes(opt, { y: 15, attrs: { '.': { y: '.6em', 'text-anchor': 'middle' } } }); + return labelAttributes(opt, { y: 15, attrs: { '.': { y: '.6em', 'text-anchor': 'middle' }}}); }, outsideOriented: function(portPosition, elBBox, opt) { @@ -23153,7 +23158,7 @@ joint.connectors.jumpover = (function(_, g, util) { } }; -})(_, g, joint, joint.util); +})(g, joint, joint.util); joint.highlighters.addClass = { @@ -23447,7 +23452,7 @@ joint.highlighters.stroke = { var portId = view.findAttribute('port', magnet); if (portId) { - portGroup = model.portProp(portId, 'group'); + var portGroup = model.portProp(portId, 'group'); var portsPositions = model.getPortsPositions(portGroup); var anchor = new g.Point(portsPositions[portId]).offset(bbox.origin()); anchor.rotate(center, -angle); @@ -23582,7 +23587,6 @@ joint.highlighters.stroke = { if (localShape instanceof g.Path) { var precision = opt.precision || 2; if (!data[BNDR_SUBDIVISIONS]) data[BNDR_SUBDIVISIONS] = localShape.getSegmentSubdivisions({ precision: precision }); - segmentSubdivisions = data[BNDR_SUBDIVISIONS]; pathOpt = { precision: precision, segmentSubdivisions: data[BNDR_SUBDIVISIONS] @@ -24090,7 +24094,7 @@ joint.highlighters.stroke = { // we left the area of the source magnet for the first time vertices.unshift(vertex); this.shiftHandleIndexes(1); - delateSourceAnchor = true; + deleteSourceAnchor = true; } } else if (index === 0) { if (sourceBBox.containsPoint(vertex)) { @@ -24725,7 +24729,7 @@ joint.shapes.erd.Attribute.define('erd.Key', { }); joint.shapes.erd.Attribute.define('erd.Normal', { - attrs: { text: { text: 'Normal' } } + attrs: { text: { text: 'Normal' }} }); joint.dia.Element.define('erd.ISA', { @@ -24748,7 +24752,7 @@ joint.dia.Element.define('erd.ISA', { joint.dia.Link.define('erd.Line', {}, { cardinality: function(value) { - this.set('labels', [{ position: -20, attrs: { text: { dy: -8, text: value } } }]); + this.set('labels', [{ position: -20, attrs: { text: { dy: -8, text: value }}}]); } }); @@ -24793,7 +24797,7 @@ joint.dia.Element.define('fsa.EndState', { }); joint.dia.Link.define('fsa.Arrow', { - attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' } }, + attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' }}, smooth: true }); @@ -24832,7 +24836,7 @@ joint.dia.Element.define('org.Member', { joint.dia.Link.define('org.Arrow', { source: { selector: '.card' }, target: { selector: '.card' }, - attrs: { '.connection': { stroke: '#585858', 'stroke-width': 3 } }, + attrs: { '.connection': { stroke: '#585858', 'stroke-width': 3 }}, z: -1 }); @@ -25027,7 +25031,7 @@ joint.shapes.basic.Generic.define('pn.Transition', { }); joint.dia.Link.define('pn.Link', { - attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' } } + attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' }} }); /** @@ -25359,7 +25363,7 @@ joint.shapes.uml.Class.define('uml.Interface', { joint.shapes.uml.InterfaceView = joint.shapes.uml.ClassView; joint.dia.Link.define('uml.Generalization', { - attrs: { '.marker-target': { d: 'M 20 0 L 0 10 L 20 20 z', fill: 'white' } } + attrs: { '.marker-target': { d: 'M 20 0 L 0 10 L 20 20 z', fill: 'white' }} }); joint.dia.Link.define('uml.Implementation', { @@ -25370,11 +25374,11 @@ joint.dia.Link.define('uml.Implementation', { }); joint.dia.Link.define('uml.Aggregation', { - attrs: { '.marker-target': { d: 'M 40 10 L 20 20 L 0 10 L 20 0 z', fill: 'white' } } + attrs: { '.marker-target': { d: 'M 40 10 L 20 20 L 0 10 L 20 0 z', fill: 'white' }} }); joint.dia.Link.define('uml.Composition', { - attrs: { '.marker-target': { d: 'M 40 10 L 20 20 L 0 10 L 20 0 z', fill: 'black' } } + attrs: { '.marker-target': { d: 'M 40 10 L 20 20 L 0 10 L 20 0 z', fill: 'black' }} }); joint.dia.Link.define('uml.Association'); @@ -25453,7 +25457,7 @@ joint.shapes.basic.Generic.define('uml.State', { joint.shapes.basic.Circle.define('uml.StartState', { type: 'uml.StartState', - attrs: { circle: { 'fill': '#34495e', 'stroke': '#2c3e50', 'stroke-width': 2, 'rx': 1 } } + attrs: { circle: { 'fill': '#34495e', 'stroke': '#2c3e50', 'stroke-width': 2, 'rx': 1 }} }); joint.shapes.basic.Generic.define('uml.EndState', { @@ -25551,7 +25555,7 @@ joint.shapes.logic.Gate.define('logic.Gate21', { }); joint.shapes.logic.Gate11.define('logic.Repeater', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTg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ODEsMjUiCiAgICAgICBpZD0icGF0aDMwNjEiIC8+CiAgICA8cGF0aAogICAgICAgc3R5bGU9ImZpbGw6IzAwMDAwMDtmaWxsLW9wYWNpdHk6MTtzdHJva2U6bm9uZTtzdHJva2Utd2lkdGg6MztzdHJva2UtbGluZWpvaW46bWl0ZXI7bWFya2VyOm5vbmU7c3Ryb2tlLW9wYWNpdHk6MTt2aXNpYmlsaXR5OnZpc2libGU7ZGlzcGxheTppbmxpbmU7b3ZlcmZsb3c6dmlzaWJsZTtlbmFibGUtYmFja2dyb3VuZDphY2N1bXVsYXRlIgogICAgICAgZD0iTSAyOC45Njg3NSwyLjU5Mzc1IEwgMjguOTY4NzUsNSBMIDI4Ljk2ODc1LDQ1IEwgMjguOTY4NzUsNDcuNDA2MjUgTCAzMS4xMjUsNDYuMzQzNzUgTCA3Mi4xNTYyNSwyNi4zNDM3NSBMIDcyLjE1NjI1LDIzLjY1NjI1IEwgMzEuMTI1LDMuNjU2MjUgTCAyOC45Njg3NSwyLjU5Mzc1IHogTSAzMS45Njg3NSw3LjQwNjI1IEwgNjguMDkzNzUsMjUgTCAzMS45Njg3NSw0Mi41OTM3NSBMIDMxLjk2ODc1LDcuNDA2MjUgeiIKICAgICAgIGlkPSJwYXRoMjYzOCIKICAgICAgIHNvZGlwb2RpOm5vZGV0eXBlcz0iY2NjY2NjY2NjY2NjYyIgLz4KICA8L2c+Cjwvc3ZnPgo=' }} }, { operation: function(input) { return input; @@ -25559,7 +25563,7 @@ joint.shapes.logic.Gate11.define('logic.Repeater', { }); joint.shapes.logic.Gate11.define('logic.Not', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJ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Sw0Mi41OTM3NSBMIDMxLjk2ODc1LDcuNDA2MjUgeiIKICAgICAgIGlkPSJwYXRoMjYzOCIKICAgICAgIHNvZGlwb2RpOm5vZGV0eXBlcz0iY2NjY2NjY2NjY2NjYyIgLz4KICAgIDxwYXRoCiAgICAgICBzb2RpcG9kaTp0eXBlPSJhcmMiCiAgICAgICBzdHlsZT0iZmlsbDpub25lO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDozO3N0cm9rZS1saW5lam9pbjptaXRlcjttYXJrZXI6bm9uZTtzdHJva2Utb3BhY2l0eToxO3Zpc2liaWxpdHk6dmlzaWJsZTtkaXNwbGF5OmlubGluZTtvdmVyZmxvdzp2aXNpYmxlO2VuYWJsZS1iYWNrZ3JvdW5kOmFjY3VtdWxhdGUiCiAgICAgICBpZD0icGF0aDI2NzEiCiAgICAgICBzb2RpcG9kaTpjeD0iNzYiCiAgICAgICBzb2RpcG9kaTpjeT0iMjUiCiAgICAgICBzb2RpcG9kaTpyeD0iNCIKICAgICAgIHNvZGlwb2RpOnJ5PSI0IgogICAgICAgZD0iTSA4MCwyNSBBIDQsNCAwIDEgMSA3MiwyNSBBIDQsNCAwIDEgMSA4MCwyNSB6IgogICAgICAgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEsMCkiIC8+CiAgPC9nPgo8L3N2Zz4K' }} }, { operation: function(input) { return !input; @@ -25567,7 +25571,7 @@ joint.shapes.logic.Gate11.define('logic.Not', { }); joint.shapes.logic.Gate21.define('logic.Or', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMv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UwNzkyNCAxNy4xNTgwNzUsODEuNTAwMDAxIDE0Ljc1LDgxLjUgTCAzLjUsODEuNSBDIDUuMzczNTg4NCw3OC4zOTE1NjYgOC4yNSw3Mi40NTA2NSA4LjI1LDY0LjUgQyA4LjI1LDU2LjUyNjY0NiA1LjM0MTQ2ODYsNTAuNTk5ODE1IDMuNDY4NzUsNDcuNSB6IgogICAgICAgICBpZD0icGF0aDQ5NzMiCiAgICAgICAgIHNvZGlwb2RpOm5vZGV0eXBlcz0iY2NzY2NjY3NjY2NjY2NjY2NzY2NzYyIgLz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo=' }} }, { operation: function(input1, input2) { return input1 || input2; @@ -25575,7 +25579,7 @@ joint.shapes.logic.Gate21.define('logic.Or', { }); joint.shapes.logic.Gate21.define('logic.And', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3c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1IEMgNjEuNzQ0MDk4LDQ1IDcwLjQ3NjE5LDM1Ljk5OTk1NSA3MC40NzYxOSwyNSBDIDcwLjQ3NjE5LDE0LjAwMDA0NSA2MS43NDQwOTksNS4wMDAwMDAyIDUwLjQ3NjE5LDUgQyA1MC40NzYxOSw1IDUwLjQ3NjE5LDUgMzEuNDI4NTcxLDUgTCAzMCw1IHogTSAzMi44NTcxNDMsNy44NTcxNDI5IEMgNDAuODM0MjY0LDcuODU3MTQyOSA0NS45MTgzNjgsNy44NTcxNDI5IDQ4LjA5NTIzOCw3Ljg1NzE0MjkgQyA0OS4yODU3MTQsNy44NTcxNDI5IDQ5Ljg4MDk1Miw3Ljg1NzE0MjkgNTAuMTc4NTcxLDcuODU3MTQyOSBDIDUwLjMyNzM4MSw3Ljg1NzE0MjkgNTAuNDA5MjI3LDcuODU3MTQyOSA1MC40NDY0MjksNy44NTcxNDI5IEMgNTAuNDY1MDI5LDcuODU3MTQyOSA1MC40NzE1NDMsNy44NTcxNDI5IDUwLjQ3NjE5LDcuODU3MTQyOSBDIDYwLjIzNjg1Myw3Ljg1NzE0MyA2Ny4xNDI4NTcsMTUuNDk3MDk4IDY3LjE0Mjg1NywyNSBDIDY3LjE0Mjg1NywzNC41MDI5MDIgNTkuNzYwNjYyLDQyLjE0Mjg1NyA1MCw0Mi4xNDI4NTcgTCAzMi44NTcxNDMsNDIuMTQyODU3IEwgMzIuODU3MTQzLDcuODU3MTQyOSB6IgogICAgICAgaWQ9InBhdGgyODg0IgogICAgICAgc29kaXBvZGk6bm9kZXR5cGVzPSJjY2NjY2NzY2NjY3Nzc3NzY2NjIiAvPgogIDwvZz4KPC9zdmc+Cg==' }} }, { operation: function(input1, input2) { @@ -25584,7 +25588,7 @@ joint.shapes.logic.Gate21.define('logic.And', { }); joint.shapes.logic.Gate21.define('logic.Nor', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTg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HNvZGlwb2RpOnR5cGU9ImFyYyIKICAgICAgICAgc3R5bGU9ImZpbGw6bm9uZTtmaWxsLW9wYWNpdHk6MTtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MztzdHJva2UtbGluZWpvaW46bWl0ZXI7bWFya2VyOm5vbmU7c3Ryb2tlLW9wYWNpdHk6MTt2aXNpYmlsaXR5OnZpc2libGU7ZGlzcGxheTppbmxpbmU7b3ZlcmZsb3c6dmlzaWJsZTtlbmFibGUtYmFja2dyb3VuZDphY2N1bXVsYXRlIgogICAgICAgICBpZD0icGF0aDI2MDQiCiAgICAgICAgIHNvZGlwb2RpOmN4PSI3NSIKICAgICAgICAgc29kaXBvZGk6Y3k9IjI1IgogICAgICAgICBzb2RpcG9kaTpyeD0iNCIKICAgICAgICAgc29kaXBvZGk6cnk9IjQiCiAgICAgICAgIGQ9Ik0gNzksMjUgQSA0LDQgMCAxIDEgNzEsMjUgQSA0LDQgMCAxIDEgNzksMjUgeiIKICAgICAgICAgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI2LjUsMzkuNSkiIC8+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K' }} }, { operation: function(input1, input2) { return !(input1 || input2); @@ -25592,7 +25596,7 @@ joint.shapes.logic.Gate21.define('logic.Nor', { }); joint.shapes.logic.Gate21.define('logic.Nand', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHR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F0aDQwMDgiCiAgICAgICBzb2RpcG9kaTpjeD0iNzUiCiAgICAgICBzb2RpcG9kaTpjeT0iMjUiCiAgICAgICBzb2RpcG9kaTpyeD0iNCIKICAgICAgIHNvZGlwb2RpOnJ5PSI0IgogICAgICAgZD0iTSA3OSwyNSBBIDQsNCAwIDEgMSA3MSwyNSBBIDQsNCAwIDEgMSA3OSwyNSB6IiAvPgogIDwvZz4KPC9zdmc+Cg==' }} }, { operation: function(input1, input2) { return !(input1 && input2); @@ -25600,7 +25604,7 @@ joint.shapes.logic.Gate21.define('logic.Nand', { }); joint.shapes.logic.Gate21.define('logic.Xor', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHdpZHRoPSIxMDAiCiAgIGhlaWdodD0iNTAiCiAgIGlkPSJzd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NC41IEwgLTIuNDA2MjUsNDQuNSB6IE0gMy40Njg3NSw0Ny41IEwgMTQuNzUsNDcuNSBDIDE5LjQzNDE3Myw0Ny41IDMzLjAzNjg1LDQ3LjM2OTc5MyA0Mi43MTg3NSw2NC41IEMgMzcuOTUxOTY0LDcyLjkyOTA3NSAzMi4xOTc0NjksNzcuMTgzOTEgMjcsNzkuMzEyNSBDIDIxLjYzOTMzOSw4MS41MDc5MjQgMTcuMTU4MDc1LDgxLjUwMDAwMSAxNC43NSw4MS41IEwgMy41LDgxLjUgQyA1LjM3MzU4ODQsNzguMzkxNTY2IDguMjUsNzIuNDUwNjUgOC4yNSw2NC41IEMgOC4yNSw1Ni41MjY2NDYgNS4zNDE0Njg2LDUwLjU5OTgxNSAzLjQ2ODc1LDQ3LjUgeiIKICAgICAgICAgaWQ9InBhdGg0OTczIgogICAgICAgICBzb2RpcG9kaTpub2RldHlwZXM9ImNjc2NjY2NzY2NjY2NjY2Njc2Njc2MiIC8+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K' }} }, { operation: function(input1, input2) { return (!input1 || input2) && (input1 || !input2); @@ -25608,7 +25612,7 @@ joint.shapes.logic.Gate21.define('logic.Xor', { }); joint.shapes.logic.Gate21.define('logic.Xnor', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMj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tzY2FwZTp6b29tPSI0IgogICAgIGlua3NjYXBlOmN4PSI5NS43MjM2NiIKICAgICBpbmtzY2FwZTpjeT0iLTI2Ljc3NTAyMyIKICAgICBpbmtzY2FwZTpkb2N1bWVudC11bml0cz0icHgiCiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0ibGF5ZXIxIgogICAgIHNob3dncmlkPSJ0cnVlIgogICAgIGlua3NjYXBlOmdyaWQtYmJveD0idHJ1ZSIKICAgICBpbmtzY2FwZTpncmlkLXBvaW50cz0idHJ1ZSIKICAgICBncmlkdG9sZXJhbmNlPSIxMDAwMCIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjEzOTkiCiAgICAgaW5rc2NhcGU6d2luZG93LWhlaWdodD0iODc0IgogICAgIGlua3NjYXBlOndpbmRvdy14PSIzMyIKICAgICBpbmtzY2FwZTp3aW5kb3cteT0iMCIKICAgICBpbmtzY2FwZTpzbmFwLWJib3g9InRydWUiPgogICAgPGlua3NjYXBlOmdyaWQKICAgICAgIGlkPSJHcmlkRnJvbVByZTA0NlNldHRpbmdzIgogICAgICAgdHlwZT0ieHlncmlkIgogICAgICAgb3JpZ2lueD0iMHB4IgogICAgICAgb3JpZ2lueT0iMHB4IgogICAgICAgc3BhY2luZ3g9IjFweCIKICAgICAgIHNwYWNpbmd5PSIxcHgiCiAgICAgICBjb2xvcj0iIzAwMDBmZiIKICAgICAgIGVtcGNvbG9yPSIjMDAwMGZmIgogICAgICAgb3BhY2l0eT0iMC4yIgogICAgICAgZW1wb3BhY2l0eT0iMC40IgogICAgICAgZW1wc3BhY2luZz0iNSIKICAgICAgIHZpc2libGU9InRydWUiCiAgICAgICBlbmFibGVkPSJ0cnVlIiAvPgogIDwvc29kaXBvZGk6bmFtZWR2aWV3PgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTciPgogICAgPHJkZjpSREY+CiAgICAgIDxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj4KICAgIC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yNyw3OS4zMTI1IEMgMjEuNjM5MzM5LDgxLjUwNzkyNCAxNy4xNTgwNzUsODEuNTAwMDAxIDE0Ljc1LDgxLjUgTCAzLjUsODEuNSBDIDUuMzczNTg4NCw3OC4zOTE1NjYgOC4yNSw3Mi40NTA2NSA4LjI1LDY0LjUgQyA4LjI1LDU2LjUyNjY0NiA1LjM0MTQ2ODYsNTAuNTk5ODE1IDMuNDY4NzUsNDcuNSB6IgogICAgICAgICBpZD0icGF0aDQ5NzMiCiAgICAgICAgIHNvZGlwb2RpOm5vZGV0eXBlcz0iY2NzY2NjY3NjY2NjY2NjY2NzY2NzYyIgLz4KICAgIDwvZz4KICAgIDxwYXRoCiAgICAgICBzb2RpcG9kaTp0eXBlPSJhcmMiCiAgICAgICBzdHlsZT0iZmlsbDpub25lO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDozO3N0cm9rZS1saW5lam9pbjptaXRlcjttYXJrZXI6bm9uZTtzdHJva2Utb3BhY2l0eToxO3Zpc2liaWxpdHk6dmlzaWJsZTtkaXNwbGF5OmlubGluZTtvdmVyZmxvdzp2aXNpYmxlO2VuYWJsZS1iYWNrZ3JvdW5kOmFjY3VtdWxhdGUiCiAgICAgICBpZD0icGF0aDM1NTEiCiAgICAgICBzb2RpcG9kaTpjeD0iNzUiCiAgICAgICBzb2RpcG9kaTpjeT0iMjUiCiAgICAgICBzb2RpcG9kaTpyeD0iNCIKICAgICAgIHNvZGlwb2RpOnJ5PSI0IgogICAgICAgZD0iTSA3OSwyNSBBIDQsNCAwIDEgMSA3MSwyNSBBIDQsNCAwIDEgMSA3OSwyNSB6IiAvPgogIDwvZz4KPC9zdmc+Cg==' }} }, { operation: function(input1, input2) { return (!input1 || !input2) && (input1 || input2); @@ -25622,7 +25626,7 @@ joint.dia.Link.define('logic.Wire', { }, router: { name: 'orthogonal' }, - connector: { name: 'rounded', args: { radius: 10 } } + connector: { name: 'rounded', args: { radius: 10 }} }, { arrowheadMarkup: [ '', @@ -25720,7 +25724,7 @@ joint.layout.DirectedGraph = { } if (opt.setLabels && ('x' in glEdge) && ('y' in glEdge)) { - var labelPosition = { x: glEdge.x, y: glEdge.y}; + var labelPosition = { x: glEdge.x, y: glEdge.y }; if (joint.util.isFunction(opt.setLabels)) { opt.setLabels(link, labelPosition, points); } else { diff --git a/dist/joint.nowrap.min.js b/dist/joint.nowrap.min.js index 2ab254998..43eefcd1b 100644 --- a/dist/joint.nowrap.min.js +++ b/dist/joint.nowrap.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -6,16 +6,16 @@ License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ !function(){function a(a){this.message=a}var b="undefined"!=typeof exports?exports:this,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";a.prototype=new Error,a.prototype.name="InvalidCharacterError",b.btoa||(b.btoa=function(b){for(var d,e,f=String(b),g=0,h=c,i="";f.charAt(0|g)||(h="=",g%1);i+=h.charAt(63&d>>8-g%1*8)){if(e=f.charCodeAt(g+=.75),e>255)throw new a("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");d=d<<8|e}return i}),b.atob||(b.atob=function(b){var d=String(b).replace(/=+$/,"");if(d.length%4==1)throw new a("'atob' failed: The string to be decoded is not correctly encoded.");for(var e,f,g=0,h=0,i="";f=d.charAt(h++);~f&&(e=g%4?64*e+f:f,g++%4)?i+=String.fromCharCode(255&e>>(-2*g&6)):0)f=c.indexOf(f);return i})}(),function(){function a(a,b){return this.slice(a,b)}function b(a,b){arguments.length<2&&(b=0);for(var c=0,d=a.length;c>>0;if(0===e)return!1;for(var f=0|b,g=Math.max(f>=0?f:e-Math.abs(f),0);g>>0;if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var d=arguments[1],e=0;e0?1:-1)*Math.floor(Math.abs(b)):b},d=Math.pow(2,53)-1,e=function(a){var b=c(a);return Math.min(Math.max(b,0),d)};return function(a){var c=this,d=Object(a);if(null==a)throw new TypeError("Array.from requires an array-like object - not null or undefined");var f,g=arguments.length>1?arguments[1]:void 0;if("undefined"!=typeof g){if(!b(g))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(f=arguments[2])}for(var h,i=e(d.length),j=b(c)?Object(new c(i)):new Array(i),k=0;k>>0;if("function"!=typeof a)throw new TypeError("predicate must be a function");for(var d=arguments[1],e=0;ethis.length)&&this.indexOf(a,b)!==-1}),String.prototype.startsWith||(String.prototype.startsWith=function(a,b){return this.substr(b||0,a.length)===a}),Number.isFinite=Number.isFinite||function(a){return"number"==typeof a&&isFinite(a)},Number.isNaN=Number.isNaN||function(a){return a!==a}; -var g=function(){function a(a,b){return b.unshift(null),new(Function.prototype.bind.apply(a,b))}function b(a){var b,c,d=[];for(c=arguments.length,b=1;b=1)return[new q(b,c,d,e),new q(e,e,e,e)];var f=this.getSkeletonPoints(a),g=f.startControlPoint1,h=f.startControlPoint2,i=f.divider,j=f.dividerControlPoint1,k=f.dividerControlPoint2;return[new q(b,g,h,i),new q(i,j,k,e)]},endpointDistance:function(){return this.start.distance(this.end)},equals:function(a){return!!a&&this.start.x===a.start.x&&this.start.y===a.start.y&&this.controlPoint1.x===a.controlPoint1.x&&this.controlPoint1.y===a.controlPoint1.y&&this.controlPoint2.x===a.controlPoint2.x&&this.controlPoint2.y===a.controlPoint2.y&&this.end.x===a.end.x&&this.end.y===a.end.y},getSkeletonPoints:function(a){var b=this.start,c=this.controlPoint1,d=this.controlPoint2,e=this.end;if(a<=0)return{startControlPoint1:b.clone(),startControlPoint2:b.clone(),divider:b.clone(),dividerControlPoint1:c.clone(),dividerControlPoint2:d.clone()};if(a>=1)return{startControlPoint1:c.clone(),startControlPoint2:d.clone(),divider:e.clone(),dividerControlPoint1:e.clone(),dividerControlPoint2:e.clone()};var f=new s(b,c).pointAt(a),g=new s(c,d).pointAt(a),h=new s(d,e).pointAt(a),i=new s(f,g).pointAt(a),j=new s(g,h).pointAt(a),k=new s(i,j).pointAt(a),l={startControlPoint1:f,startControlPoint2:i,divider:k,dividerControlPoint1:j,dividerControlPoint2:h};return l},getSubdivisions:function(a){a=a||{};var b=void 0===a.precision?this.PRECISION:a.precision,c=[new q(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===b)return c;for(var d=this.endpointDistance(),e=p(10,-b),f=0;;){f+=1;for(var g=[],h=c.length,i=0;i1&&r=1)return this.end.clone();var c=this.tAt(a,b);return this.pointAtT(c)},pointAtLength:function(a,b){var c=this.tAtLength(a,b);return this.pointAtT(c)},pointAtT:function(a){return a<=0?this.start.clone():a>=1?this.end.clone():this.getSkeletonPoints(a).divider},PRECISION:3,scale:function(a,b,c){return this.start.scale(a,b,c),this.controlPoint1.scale(a,b,c),this.controlPoint2.scale(a,b,c),this.end.scale(a,b,c),this},tangentAt:function(a,b){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var c=this.tAt(a,b);return this.tangentAtT(c)},tangentAtLength:function(a,b){if(!this.isDifferentiable())return null;var c=this.tAtLength(a,b);return this.tangentAtT(c)},tangentAtT:function(a){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var b=this.getSkeletonPoints(a),c=b.startControlPoint2,d=b.dividerControlPoint1,e=b.divider,f=new s(c,d);return f.translate(e.x-c.x,e.y-c.y),f},tAt:function(a,b){if(a<=0)return 0;if(a>=1)return 1;b=b||{};var c=void 0===b.precision?this.PRECISION:b.precision,d=void 0===b.subdivisions?this.getSubdivisions({precision:c}):b.subdivisions,e={precision:c,subdivisions:d},f=this.length(e),g=f*a;return this.tAtLength(g,e)},tAtLength:function(a,b){var c=!0;a<0&&(c=!1,a=-a),b=b||{};for(var d,e,f,g,h,i=void 0===b.precision?this.PRECISION:b.precision,j=void 0===b.subdivisions?this.getSubdivisions({precision:i}):b.subdivisions,k={precision:i,subdivisions:j},l=0,m=j.length,n=1/m,o=c?0:m-1;c?o=0;c?o++:o--){var q=j[o],r=q.endpointDistance();if(a<=l+r){d=q,e=o*n,f=(o+1)*n,g=c?a-l:r+l-a,h=c?r+l-a:a-l;break}l+=r}if(!d)return c?1:0;for(var s=this.length(k),t=p(10,-i);;){var u;if(u=0!==s?g/s:0,ui.x+g/2,m=ei.x?f-d:f+d,c=g*g/(e-j)-g*g*(f-k)*(b-k)/(h*h*(e-j))+j):(c=f>i.y?e+d:e-d,b=h*h/(f-k)-h*h*(e-j)*(c-j)/(g*g*(f-k))+k),new u(c,b).theta(a)},equals:function(a){return!!a&&a.x===this.x&&a.y===this.y&&a.a===this.a&&a.b===this.b},intersectionWithLine:function(a){var b=[],c=a.start,d=a.end,e=this.a,f=this.b,g=a.vector(),i=c.difference(new u(this)),j=new u(g.x/(e*e),g.y/(f*f)),k=new u(i.x/(e*e),i.y/(f*f)),l=g.dot(j),m=g.dot(k),n=i.dot(k)-1,o=m*m-l*n;if(o<0)return null;if(o>0){var p=h(o),q=(-m-p)/l,r=(-m+p)/l;if((q<0||10){if(f>d||g>d)return null}else if(f=1?c.clone():b.lerp(c,a)},pointAtLength:function(a){var b=this.start,c=this.end,d=!0;a<0&&(d=!1,a=-a);var e=this.length();return a>=e?d?c.clone():b.clone():this.pointAt((d?a:e-a)/e)},pointOffset:function(a){a=new c.Point(a);var b=this.start,d=this.end,e=(d.x-b.x)*(a.y-b.y)-(d.y-b.y)*(a.x-b.x);return e/this.length()},rotate:function(a,b){return this.start.rotate(a,b),this.end.rotate(a,b),this},round:function(a){var b=p(10,a||0);return this.start.x=l(this.start.x*b)/b,this.start.y=l(this.start.y*b)/b,this.end.x=l(this.end.x*b)/b,this.end.y=l(this.end.y*b)/b,this},scale:function(a,b,c){return this.start.scale(a,b,c),this.end.scale(a,b,c),this},setLength:function(a){var b=this.length();if(!b)return this;var c=a/b;return this.scale(c,c,this.start)},squaredLength:function(){var a=this.start.x,b=this.start.y,c=this.end.x,d=this.end.y;return(a-=c)*a+(b-=d)*b},tangentAt:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAt(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},tangentAtLength:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAtLength(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},translate:function(a,b){return this.start.translate(a,b),this.end.translate(a,b),this},vector:function(){return new u(this.end.x-this.start.x,this.end.y-this.start.y)},toString:function(){return this.start.toString()+" "+this.end.toString()}},s.prototype.intersection=s.prototype.intersect;var t=c.Path=function(a){if(!(this instanceof t))return new t(a);if("string"==typeof a)return new t.parse(a);this.segments=[];var b,c;if(a){if(Array.isArray(a)&&0!==a.length)if(c=a.length,a[0].isSegment)for(b=0;b=c||a<0)throw new Error("Index out of range.");return b[a]},getSegmentSubdivisions:function(a){var b=this.segments,c=b.length;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=[],f=0;fd||a<0)throw new Error("Index out of range.");var e,f=null,g=null;if(0!==d&&(a>=1?(f=c[a-1],g=f.nextSegment):g=c[0]),Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");for(var h=b.length,i=0;i=d?(e=d-1,f=1):f<0?f=0:f>1&&(f=1),b=b||{};for(var g,h=void 0===b.precision?this.PRECISION:b.precision,i=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:h}):b.segmentSubdivisions,j=0,k=0;k=1)return this.end.clone();b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.pointAtLength(i,g)},pointAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;if(0===a)return this.start.clone();var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isVisible){if(a<=i+m)return k.pointAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f)return e?f.end:f.start;var n=c[d-1];return n.end.clone()},pointAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].pointAtT(0);if(d>=c)return b[c-1].pointAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].pointAtT(e)},prepareSegment:function(a,b,c){a.previousSegment=b,a.nextSegment=c,b&&(b.nextSegment=a),c&&(c.previousSegment=a);var d=a;return a.isSubpathStart&&(a.subpathStartSegment=a,d=c),d&&this.updateSubpathStartSegment(d),a},PRECISION:3,removeSegment:function(a){var b=this.segments,c=b.length;if(0===c)throw new Error("Path has no segments.");if(a<0&&(a=c+a),a>=c||a<0)throw new Error("Index out of range.");var d=b.splice(a,1)[0],e=d.previousSegment,f=d.nextSegment;e&&(e.nextSegment=f),f&&(f.previousSegment=e),d.isSubpathStart&&f&&this.updateSubpathStartSegment(f)},replaceSegment:function(a,b){var c=this.segments,d=c.length;if(0===d)throw new Error("Path has no segments.");if(a<0&&(a=d+a),a>=d||a<0)throw new Error("Index out of range.");var e,f=c[a],g=f.previousSegment,h=f.nextSegment,i=f.isSubpathStart;if(Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");c.splice(a,1);for(var j=b.length,k=0;k1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.segmentIndexAtLength(i,g)},toPoints:function(a){var b=this.segments,c=b.length;if(0===c)return null;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=void 0===a.segmentSubdivisions?this.getSegmentSubdivisions({precision:d}):a.segmentSubdivisions,f=[],g=[],h=0;h0){var k=j.map(function(a){return a.start});Array.prototype.push.apply(g,k)}else g.push(i.start)}else g.length>0&&(g.push(b[h-1].end),f.push(g),g=[])}return g.length>0&&(g.push(this.end),f.push(g)),f},toPolylines:function(a){var b=[],c=this.toPoints(a);if(!c)return null;for(var d=0,e=c.length;d=0;e?j++:j--){var k=c[j],l=g[j],m=k.length({precision:f,subdivisions:l});if(k.isVisible){if(a<=i+m)return j;h=j}i+=m}return h},tangentAt:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;a<0&&(a=0),a>1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.tangentAtLength(i,g)},tangentAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isDifferentiable()){if(a<=i+m)return k.tangentAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f){var n=e?1:0;return f.tangentAtT(n)}return null},tangentAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].tangentAtT(0);if(d>=c)return b[c-1].tangentAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].tangentAtT(e)},translate:function(a,b){for(var c=this.segments,d=c.length,e=0;e=0;c--){var d=a[c];if(d.isVisible)return d.end}return a[b-1].end}});var u=c.Point=function(a,b){if(!(this instanceof u))return new u(a,b);if("string"==typeof a){var c=a.split(a.indexOf("@")===-1?" ":"@");a=parseFloat(c[0]),b=parseFloat(c[1])}else Object(a)===a&&(b=a.y,a=a.x);this.x=void 0===a?0:a,this.y=void 0===b?0:b};u.fromPolar=function(a,b,c){c=c&&new u(c)||new u(0,0);var d=e(a*f(b)),h=e(a*g(b)),i=x(z(b));return i<90?h=-h:i<180?(d=-d,h=-h):i<270&&(d=-d),new u(c.x+d,c.y+h)},u.random=function(a,b,c,d){return new u(m(o()*(b-a+1)+a),m(o()*(d-c+1)+c))},u.prototype={adhereToRect:function(a){return a.containsPoint(this)?this:(this.x=i(j(this.x,a.x),a.x+a.width),this.y=i(j(this.y,a.y),a.y+a.height),this)},bearing:function(a){return new s(this,a).bearing()},changeInAngle:function(a,b,c){return this.clone().offset(-a,-b).theta(c)-this.theta(c)},clone:function(){return new u(this)},difference:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),new u(this.x-(a||0),this.y-(b||0))},distance:function(a){return new s(this,a).length()},squaredDistance:function(a){return new s(this,a).squaredLength()},equals:function(a){return!!a&&this.x===a.x&&this.y===a.y},magnitude:function(){return h(this.x*this.x+this.y*this.y)||.01},manhattanDistance:function(a){return e(a.x-this.x)+e(a.y-this.y)},move:function(a,b){var c=A(new u(a).theta(this)),d=this.offset(f(c)*b,-g(c)*b);return d},normalize:function(a){var b=(a||1)/this.magnitude();return this.scale(b,b)},offset:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),this.x+=a||0,this.y+=b||0,this},reflection:function(a){return new u(a).move(this,this.distance(a))},rotate:function(a,b){a=a||new c.Point(0,0),b=A(x(-b));var d=f(b),e=g(b),h=d*(this.x-a.x)-e*(this.y-a.y)+a.x,i=e*(this.x-a.x)+d*(this.y-a.y)+a.y;return this.x=h,this.y=i,this},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this},scale:function(a,b,c){return c=c&&new u(c)||new u(0,0),this.x=c.x+a*(this.x-c.x),this.y=c.y+b*(this.y-c.y),this},snapToGrid:function(a,b){return this.x=y(this.x,a),this.y=y(this.y,b||a),this},theta:function(a){a=new u(a);var b=-(a.y-this.y),c=a.x-this.x,d=k(b,c);return d<0&&(d=2*n+d),180*d/n},angleBetween:function(a,b){var c=this.equals(a)||this.equals(b)?NaN:this.theta(b)-this.theta(a);return c<0&&(c+=360),c},vectorAngle:function(a){var b=new u(0,0);return b.angleBetween(this,a)},toJSON:function(){return{x:this.x,y:this.y}},toPolar:function(a){a=a&&new u(a)||new u(0,0);var b=this.x,c=this.y;return this.x=h((b-a.x)*(b-a.x)+(c-a.y)*(c-a.y)),this.y=A(a.theta(new u(b,c))),this},toString:function(){return this.x+"@"+this.y},update:function(a,b){return this.x=a||0,this.y=b||0,this},dot:function(a){return a?this.x*a.x+this.y*a.y:NaN},cross:function(a,b){return a&&b?(b.x-this.x)*(a.y-this.y)-(b.y-this.y)*(a.x-this.x):NaN},lerp:function(a,b){var c=this.x,d=this.y;return new u((1-b)*c+b*a.x,(1-b)*d+b*a.y)}},u.prototype.translate=u.prototype.offset;var v=c.Rect=function(a,b,c,d){return this instanceof v?(Object(a)===a&&(b=a.y,c=a.width,d=a.height,a=a.x),this.x=void 0===a?0:a,this.y=void 0===b?0:b,this.width=void 0===c?0:c,void(this.height=void 0===d?0:d)):new v(a,b,c,d)};v.fromEllipse=function(a){return a=new r(a),new v(a.x-a.a,a.y-a.b,2*a.a,2*a.b)},v.prototype={bbox:function(a){if(!a)return this.clone();var b=A(a||0),c=e(g(b)),d=e(f(b)),h=this.width*d+this.height*c,i=this.width*c+this.height*d;return new v(this.x+(this.width-h)/2,this.y+(this.height-i)/2,h,i)},bottomLeft:function(){return new u(this.x,this.y+this.height)},bottomLine:function(){return new s(this.bottomLeft(),this.bottomRight())},bottomMiddle:function(){return new u(this.x+this.width/2,this.y+this.height); -},center:function(){return new u(this.x+this.width/2,this.y+this.height/2)},clone:function(){return new v(this)},containsPoint:function(a){return a=new u(a),a.x>=this.x&&a.x<=this.x+this.width&&a.y>=this.y&&a.y<=this.y+this.height},containsRect:function(a){var b=new v(this).normalize(),c=new v(a).normalize(),d=b.width,e=b.height,f=c.width,g=c.height;if(!(d&&e&&f&&g))return!1;var h=b.x,i=b.y,j=c.x,k=c.y;return f+=j,d+=h,g+=k,e+=i,h<=j&&f<=d&&i<=k&&g<=e},corner:function(){return new u(this.x+this.width,this.y+this.height)},equals:function(a){var b=new v(this).normalize(),c=new v(a).normalize();return b.x===c.x&&b.y===c.y&&b.width===c.width&&b.height===c.height},intersect:function(a){var b=this.origin(),c=this.corner(),d=a.origin(),e=a.corner();if(e.x<=b.x||e.y<=b.y||d.x>=c.x||d.y>=c.y)return null;var f=j(b.x,d.x),g=j(b.y,d.y);return new v(f,g,i(c.x,e.x)-f,i(c.y,e.y)-g)},intersectionWithLine:function(a){var b,c,d=this,e=[d.topLine(),d.rightLine(),d.bottomLine(),d.leftLine()],f=[],g=[],h=e.length;for(c=0;c0?f:null},intersectionWithLineFromCenterToPoint:function(a,b){a=new u(a);var c,d=new u(this.x+this.width/2,this.y+this.height/2);b&&a.rotate(d,b);for(var e=[this.topLine(),this.rightLine(),this.bottomLine(),this.leftLine()],f=new s(d,a),g=e.length-1;g>=0;--g){var h=e[g].intersection(f);if(null!==h){c=h;break}}return c&&b&&c.rotate(d,-b),c},leftLine:function(){return new s(this.topLeft(),this.bottomLeft())},leftMiddle:function(){return new u(this.x,this.y+this.height/2)},moveAndExpand:function(a){return this.x+=a.x||0,this.y+=a.y||0,this.width+=a.width||0,this.height+=a.height||0,this},offset:function(a,b){return u.prototype.offset.call(this,a,b)},inflate:function(a,b){return void 0===a&&(a=0),void 0===b&&(b=a),this.x-=a,this.y-=b,this.width+=2*a,this.height+=2*b,this},normalize:function(){var a=this.x,b=this.y,c=this.width,d=this.height;return this.width<0&&(a=this.x+this.width,c=-this.width),this.height<0&&(b=this.y+this.height,d=-this.height),this.x=a,this.y=b,this.width=c,this.height=d,this},origin:function(){return new u(this.x,this.y)},pointNearestToPoint:function(a){if(a=new u(a),this.containsPoint(a)){var b=this.sideNearestToPoint(a);switch(b){case"right":return new u(this.x+this.width,a.y);case"left":return new u(this.x,a.y);case"bottom":return new u(a.x,this.y+this.height);case"top":return new u(a.x,this.y)}}return a.adhereToRect(this)},rightLine:function(){return new s(this.topRight(),this.bottomRight())},rightMiddle:function(){return new u(this.x+this.width,this.y+this.height/2)},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this.width=l(this.width*b)/b,this.height=l(this.height*b)/b,this},scale:function(a,b,c){return c=this.origin().scale(a,b,c),this.x=c.x,this.y=c.y,this.width*=a,this.height*=b,this},maxRectScaleToFit:function(a,b){a=new v(a),b||(b=a.center());var c,d,e,f,g,h,j,k,l=b.x,m=b.y;c=d=e=f=g=h=j=k=1/0;var n=a.topLeft();n.xl&&(d=(this.x+this.width-l)/(o.x-l)),o.y>m&&(h=(this.y+this.height-m)/(o.y-m));var p=a.topRight();p.x>l&&(e=(this.x+this.width-l)/(p.x-l)),p.ym&&(k=(this.y+this.height-m)/(q.y-m)),{sx:i(c,d,e,f),sy:i(g,h,j,k)}},maxRectUniformScaleToFit:function(a,b){var c=this.maxRectScaleToFit(a,b);return i(c.sx,c.sy)},sideNearestToPoint:function(a){a=new u(a);var b=a.x-this.x,c=this.x+this.width-a.x,d=a.y-this.y,e=this.y+this.height-a.y,f=b,g="left";return cb&&(b=i),jd&&(d=j)}return new v(a,c,b-a,d-c)},clone:function(){var a=this.points,b=a.length;if(0===b)return new w;for(var c=[],d=0;df.x&&(f=c[a]);var g=[];for(a=0;a2){var j=g[g.length-1];g.unshift(j)}for(var k,l,m,n,o,p,q={},r=[];0!==g.length;)if(k=g.pop(),l=k[0],!q.hasOwnProperty(k[0]+"@@"+k[1]))for(var s=!1;!s;)if(r.length<2)r.push(k),s=!0;else{m=r.pop(),n=m[0],o=r.pop(),p=o[0];var t=p.cross(n,l);if(t<0)r.push(o),r.push(m),r.push(k),s=!0;else if(0===t){var u=1e-10,v=n.angleBetween(p,l);e(v-180)2&&r.pop();var x,y=-1;for(b=r.length,a=0;a0){var B=r.slice(y),C=r.slice(0,y);A=B.concat(C)}else A=r;var D=[];for(b=A.length,a=0;a=1)return b[c-1].clone();var d=this.length(),e=d*a;return this.pointAtLength(e)},pointAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return b[0].clone();var d=!0;a<0&&(d=!1,a=-a);for(var e=0,f=c-1,g=d?0:f-1;d?g=0;d?g++:g--){var h=b[g],i=b[g+1],j=new s(h,i),k=h.distance(i);if(a<=e+k)return j.pointAtLength((d?1:-1)*(a-e));e+=k}var l=d?b[c-1]:b[0];return l.clone()},scale:function(a,b,c){var d=this.points,e=d.length;if(0===e)return this;for(var f=0;f1&&(a=1);var d=this.length(),e=d*a;return this.tangentAtLength(e)},tangentAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return null;var d=!0;a<0&&(d=!1,a=-a);for(var e,f=0,g=c-1,h=d?0:g-1;d?h=0;d?h++:h--){var i=b[h],j=b[h+1],k=new s(i,j),l=i.distance(j);if(k.isDifferentiable()){if(a<=f+l)return k.tangentAtLength((d?1:-1)*(a-f));e=k}f+=l}if(e){var m=d?1:0;return e.tangentAt(m)}return null},intersectionWithLine:function(a){for(var b=new s(a),c=[],d=this.points,e=0,f=d.length-1;e0?c:null},translate:function(a,b){var c=this.points,d=c.length;if(0===d)return this;for(var e=0;e=1?b:b*a},pointAtT:function(a){if(this.pointAt)return this.pointAt(a);throw new Error("Neither pointAtT() nor pointAt() function is implemented.")},previousSegment:null,subpathStartSegment:null,tangentAtT:function(a){if(this.tangentAt)return this.tangentAt(a);throw new Error("Neither tangentAtT() nor tangentAt() function is implemented.")},bbox:function(){throw new Error("Declaration missing for virtual function.")},clone:function(){throw new Error("Declaration missing for virtual function.")},closestPoint:function(){throw new Error("Declaration missing for virtual function.")},closestPointLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointNormalizedLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointTangent:function(){throw new Error("Declaration missing for virtual function.")},equals:function(){throw new Error("Declaration missing for virtual function.")},getSubdivisions:function(){throw new Error("Declaration missing for virtual function.")},isDifferentiable:function(){throw new Error("Declaration missing for virtual function.")},length:function(){throw new Error("Declaration missing for virtual function.")},pointAt:function(){throw new Error("Declaration missing for virtual function.")},pointAtLength:function(){throw new Error("Declaration missing for virtual function.")},scale:function(){throw new Error("Declaration missing for virtual function.")},tangentAt:function(){throw new Error("Declaration missing for virtual function.")},tangentAtLength:function(){throw new Error("Declaration missing for virtual function.")},translate:function(){throw new Error("Declaration missing for virtual function.")},serialize:function(){throw new Error("Declaration missing for virtual function.")},toString:function(){throw new Error("Declaration missing for virtual function.")}},C=function(){for(var b=[],c=arguments.length,d=0;d0)throw new Error("Closepath constructor expects no arguments.");return this},J={clone:function(){return new I},getSubdivisions:function(){return[]},isDifferentiable:function(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)},scale:function(){return this},translate:function(){return this},type:"Z",serialize:function(){return this.type},toString:function(){return this.type+" "+this.start+" "+this.end}};Object.defineProperty(J,"start",{configurable:!0,enumerable:!0,get:function(){if(!this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path; OR segment has not yet been added to a path.)");return this.previousSegment.end}}),Object.defineProperty(J,"end",{configurable:!0,enumerable:!0,get:function(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. Moveto); OR segment has not yet been added to a path.)");return this.subpathStartSegment.end}}),I.prototype=b(B,s.prototype,J);var K=t.segmentTypes={L:C,C:E,M:G,Z:I,z:I};return t.regexSupportedData=new RegExp("^[\\s\\d"+Object.keys(K).join("")+",.]*$"),t.isDataSupported=function(a){return"string"==typeof a&&this.regexSupportedData.test(a)},c}(); -var V,Vectorizer;V=Vectorizer=function(){"use strict";function a(a,b){a||(a={});var c=q("textPath"),d=a.d;if(d&&void 0===a["xlink:href"]){var e=q("path").attr("d",d).appendTo(b.defs());c.attr("xlink:href","#"+e.id)}return q.isObject(a)&&c.attr(a),c.node}function b(a,b,c){c||(c={});for(var d=c.includeAnnotationIndices,e=c.eol,f=c.lineHeight,g=c.baseSize,h=0,i={},j=b.length-1,k=0;k<=j;k++){var l=b[k],m=null;if(q.isObject(l)){var n=l.attrs,o=q("tspan",n),p=o.node,r=l.t;e&&k===j&&(r+=e),p.textContent=r;var s=n.class;s&&o.addClass(s),d&&o.attr("annotations",l.annotations),m=parseFloat(n["font-size"]),void 0===m&&(m=g),m&&m>h&&(h=m)}else e&&k===j&&(l+=e),p=document.createTextNode(l||" "),g&&g>h&&(h=g);a.appendChild(p)}return h&&(i.maxFontSize=h),f?i.lineHeight=f:h&&(i.lineHeight=1.2*h),i}function c(a,b){var c=parseFloat(a);return s.test(a)?c*b:c}function d(a,b,d,e){if(!Array.isArray(b))return 0;var f=b.length;if(!f)return 0;for(var g=b[0],h=c(g.maxFontSize,d)||d,i=0,j=c(e,d),k=1;k1){var e,g,h=[];for(e=0,g=d.childNodes.length;e0&&D.setAttribute("dy",B),(y>0||g)&&D.setAttribute("x",j),D.className.baseVal=C,r.appendChild(D),v+=E.length+1}if(i)if(l)B=d(h,x,p,o);else if("top"===h)B="0.8em";else{var I;switch(z>0?(I=parseFloat(o)||1,I*=z,s.test(o)||(I/=p)):I=0,h){case"middle":B=.3-I/2+"em";break;case"bottom":B=-I-.3+"em"}}else 0===h?B="0em":h?B=h:(B=0,null===this.attr("y")&&this.attr("y",u||"0.8em"));return r.firstChild.setAttribute("dy",B),this.append(r),this},r.removeAttr=function(a){var b=q.qualifyAttr(a),c=this.node;return b.ns?c.hasAttributeNS(b.ns,b.local)&&c.removeAttributeNS(b.ns,b.local):c.hasAttribute(a)&&c.removeAttribute(a),this},r.attr=function(a,b){if(q.isUndefined(a)){for(var c=this.node.attributes,d={},e=0;e1&&k.push(k[0]),new g.Polyline(k);case"PATH":return l=this.attr("d"),g.Path.isDataSupported(l)||(l=q.normalizePathData(l)),new g.Path(l);case"LINE":return x1=parseFloat(this.attr("x1"))||0,y1=parseFloat(this.attr("y1"))||0,x2=parseFloat(this.attr("x2"))||0,y2=parseFloat(this.attr("y2"))||0,new g.Line({x:x1,y:y1},{x:x2,y:y2})}return this.getBBox()},r.findIntersection=function(a,b){var c=this.svg().node;b=b||c;var d=this.getBBox({target:b}),e=d.center();if(d.intersectionWithLineFromCenterToPoint(a)){var f,h=this.tagName();if("RECT"===h){var i=new g.Rect(parseFloat(this.attr("x")||0),parseFloat(this.attr("y")||0),parseFloat(this.attr("width")),parseFloat(this.attr("height"))),j=this.getTransformToElement(b),k=q.decomposeMatrix(j),l=c.createSVGTransform();l.setRotate(-k.rotation,e.x,e.y);var m=q.transformRect(i,l.matrix.multiply(j));f=new g.Rect(m).intersectionWithLineFromCenterToPoint(a,k.rotation)}else if("PATH"===h||"POLYGON"===h||"POLYLINE"===h||"CIRCLE"===h||"ELLIPSE"===h){var n,o,p,r,s,t,u="PATH"===h?this:this.convertToPath(),v=u.sample(),w=1/0,x=[];for(n=0;n'+(a||"")+"",c=q.parseXML(b,{async:!1});return c.documentElement},q.idCounter=0,q.uniqueId=function(){return"v-"+ ++q.idCounter},q.toNode=function(a){return q.isV(a)?a.node:a.nodeName&&a||a[0]},q.ensureId=function(a){return a=q.toNode(a),a.id||(a.id=q.uniqueId())},q.sanitizeText=function(a){return(a||"").replace(/ /g,"\xa0")},q.isUndefined=function(a){return"undefined"==typeof a},q.isString=function(a){return"string"==typeof a},q.isObject=function(a){return a&&"object"==typeof a},q.isArray=Array.isArray,q.parseXML=function(a,b){b=b||{};var c;try{var d=new DOMParser;q.isUndefined(b.async)||(d.async=b.async),c=d.parseFromString(a,"text/xml")}catch(a){c=void 0}if(!c||c.getElementsByTagName("parsererror").length)throw new Error("Invalid XML: "+a);return c},q.qualifyAttr=function(a){if(a.indexOf(":")!==-1){var b=a.split(":");return{ns:f[b[0]],local:b[1]}}return{ns:null,local:a}},q.transformRegex=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,q.transformSeparatorRegex=/[ ,]+/,q.transformationListRegex=/^(\w+)\((.*)\)/,q.transformStringToMatrix=function(a){var b=q.createSVGMatrix(),c=a&&a.match(q.transformRegex);if(!c)return b;for(var d=0,e=c.length;d=0){var f=q.transformStringToMatrix(a),g=q.decomposeMatrix(f);b=[g.translateX,g.translateY],d=[g.scaleX,g.scaleY],c=[g.rotation];var h=[];0===b[0]&&0===b[0]||h.push("translate("+b+")"),1===d[0]&&1===d[1]||h.push("scale("+d+")"),0!==c[0]&&h.push("rotate("+c+")"),a=h.join(" ")}else{var i=a.match(/translate\((.*?)\)/);i&&(b=i[1].split(e));var j=a.match(/rotate\((.*?)\)/);j&&(c=j[1].split(e));var k=a.match(/scale\((.*?)\)/);k&&(d=k[1].split(e))}}var l=d&&d[0]?parseFloat(d[0]):1;return{value:a,translate:{tx:b&&b[0]?parseInt(b[0],10):0,ty:b&&b[1]?parseInt(b[1],10):0},rotate:{angle:c&&c[0]?parseInt(c[0],10):0,cx:c&&c[1]?parseInt(c[1],10):void 0,cy:c&&c[2]?parseInt(c[2],10):void 0},scale:{sx:l,sy:d&&d[1]?parseFloat(d[1]):l}}},q.deltaTransformPoint=function(a,b){var c=b.x*a.a+b.y*a.c+0,d=b.x*a.b+b.y*a.d+0;return{x:c,y:d}},q.decomposeMatrix=function(a){var b=q.deltaTransformPoint(a,{x:0,y:1}),c=q.deltaTransformPoint(a,{x:1,y:0}),d=180/j*k(b.y,b.x)-90,e=180/j*k(c.y,c.x);return{translateX:a.e,translateY:a.f,scaleX:l(a.a*a.a+a.b*a.b),scaleY:l(a.c*a.c+a.d*a.d),skewX:d,skewY:e,rotation:d}},q.matrixToScale=function(a){var b,c,d,e;return a?(b=q.isUndefined(a.a)?1:a.a,e=q.isUndefined(a.d)?1:a.d,c=a.b,d=a.c):b=e=1,{sx:c?l(b*b+c*c):b,sy:d?l(d*d+e*e):e}},q.matrixToRotate=function(a){var b={x:0,y:1};return a&&(b=q.deltaTransformPoint(a,b)),{angle:g.normalizeAngle(g.toDeg(k(b.y,b.x))-90)}},q.matrixToTranslate=function(a){return{tx:a&&a.e||0,ty:a&&a.f||0}},q.isV=function(a){return a instanceof q},q.isVElement=q.isV;var t=q("svg").node;return q.createSVGMatrix=function(a){var b=t.createSVGMatrix();for(var c in a)b[c]=a[c];return b},q.createSVGTransform=function(a){return q.isUndefined(a)?t.createSVGTransform():(a instanceof SVGMatrix||(a=q.createSVGMatrix(a)),t.createSVGTransformFromMatrix(a))},q.createSVGPoint=function(a,b){var c=t.createSVGPoint();return c.x=a,c.y=b,c},q.transformRect=function(a,b){var c=t.createSVGPoint();c.x=a.x,c.y=a.y;var d=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y;var e=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y+a.height;var f=c.matrixTransform(b);c.x=a.x,c.y=a.y+a.height;var h=c.matrixTransform(b),i=m(d.x,e.x,f.x,h.x),j=n(d.x,e.x,f.x,h.x),k=m(d.y,e.y,f.y,h.y),l=n(d.y,e.y,f.y,h.y);return new g.Rect(i,k,j-i,l-k)},q.transformPoint=function(a,b){return new g.Point(q.createSVGPoint(a.x,a.y).matrixTransform(b))},q.transformLine=function(a,b){return new g.Line(q.transformPoint(a.start,b),q.transformPoint(a.end,b))},q.transformPolyline=function(a,b){var c=a instanceof g.Polyline?a.points:a;q.isArray(c)||(c=[]);for(var d=[],e=0,f=c.length;e=e?f?"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"M0,"+f+"A"+f+","+f+" 0 1,0 0,"+-f+"A"+f+","+f+" 0 1,0 0,"+f+"Z":"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z":f?"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L"+f*q+","+f*r+"A"+f+","+f+" 0 "+l+",0 "+f*m+","+f*n+"Z":"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L0,0Z"},q.mergeAttrs=function(a,b){for(var c in b)"class"===c?a[c]=a[c]?a[c]+" "+b[c]:b[c]:"style"===c?q.isObject(a[c])&&q.isObject(b[c])?a[c]=q.mergeAttrs(a[c],b[c]):q.isObject(a[c])?a[c]=q.mergeAttrs(a[c],q.styleToObject(b[c])):q.isObject(b[c])?a[c]=q.mergeAttrs(q.styleToObject(a[c]),b[c]):a[c]=q.mergeAttrs(q.styleToObject(a[c]),q.styleToObject(b[c])):a[c]=b[c];return a},q.annotateString=function(a,b,c){b=b||[],c=c||{};for(var d,e,f,g=c.offset||0,h=[],i=[],j=0;j=m&&j=a.start&&ba.start&&c<=a.end||a.start>=b&&a.end=b?a.end+=c:a.start>=b&&(a.start+=c,a.end+=c)}),a},q.convertLineToPathData=function(a){a=q(a);var b=["M",a.attr("x1"),a.attr("y1"),"L",a.attr("x2"),a.attr("y2")].join(" ");return b},q.convertPolygonToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)+" Z"},q.convertPolylineToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)},q.svgPointsToPath=function(a){for(var b=0,c=a.length;b1&&(z=o(z),d*=z,e*=z);var A=d*d,B=e*e,C=(g==h?-1:1)*o(p((A*B-A*y*y-B*x*x)/(A*y*y+B*x*x))),D=C*d*y/e+(a+i)/2,E=C*-e*x/d+(c+q)/2,F=n(((c-E)/e).toFixed(9)),G=n(((q-E)/e).toFixed(9));F=aG&&(F-=2*j),(!h&&G)>F&&(G-=2*j)}var H=G-F;if(p(H)>t){var I=G,J=i,K=q;G=F+t*((h&&G)>F?1:-1),i=D+d*l(G),q=E+e*k(G),v=b(i,q,d,e,f,0,h,J,K,[G,I,D,E])}H=G-F;var L=l(F),M=k(F),N=l(G),O=k(G),P=m(H/4),Q=4/3*(d*P),R=4/3*(e*P),S=[a,c],T=[a+Q*M,c-R*L],U=[i+Q*O,q-R*N],V=[i,q];if(T[0]=2*S[0]-T[0],T[1]=2*S[1]-T[1],r)return[T,U,V].concat(v);v=[T,U,V].concat(v).join().split(",");for(var W=[],X=v.length,Y=0;Y2&&(c.push([d].concat(f.splice(0,2))),g="l",d="m"===d?"l":"L");f.length>=b[g]&&(c.push([d].concat(f.splice(0,b[g]))),b[g]););}),c}function d(a){if(Array.isArray(a)&&Array.isArray(a&&a[0])||(a=c(a)),!a||!a.length)return[["M",0,0]];for(var b,d=[],e=0,f=0,g=0,h=0,i=0,j=a.length,k=i;k7){a[b].shift();for(var c=a[b];c.length;)i[b]="A",a.splice(b++,0,["C"].concat(c.splice(0,6)));a.splice(b,1),l=g.length}}for(var g=d(c),h={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=[],j="",k="",l=g.length,m=0;m0&&(k=i[m-1])),g[m]=e(g[m],h,k),"A"!==i[m]&&"C"===j&&(i[m]="C"),f(g,m);var n=g[m],o=n.length;h.x=n[o-2],h.y=n[o-1],h.bx=parseFloat(n[o-4])||h.x,h.by=parseFloat(n[o-3])||h.y}return g[0][0]&&"M"===g[0][0]||g.unshift(["M",0,0]),g}var f="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",g=new RegExp("([a-z])["+f+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+f+"]*,?["+f+"]*)+)","ig"),h=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+f+"]*,?["+f+"]*","ig"),i=Math,j=i.PI,k=i.sin,l=i.cos,m=i.tan,n=i.asin,o=i.sqrt,p=i.abs;return function(a){return e(a).join(",").split(",").join(" ")}}(),q.namespace=f,q}(); -var joint={version:"2.1.3",config:{classNamePrefix:"joint-",defaultTheme:"default"},dia:{},ui:{},layout:{},shapes:{},format:{},connectors:{},highlighters:{},routers:{},anchors:{},connectionPoints:{},connectionStrategies:{},linkTools:{},mvc:{views:{}},setTheme:function(a,b){b=b||{},joint.util.invoke(joint.mvc.views,"setTheme",a,b),joint.mvc.View.prototype.defaultTheme=a},env:{_results:{},_tests:{svgforeignobject:function(){return!!document.createElementNS&&/SVGForeignObject/.test({}.toString.call(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")))}},addTest:function(a,b){return joint.env._tests[a]=b},test:function(a){var b=joint.env._tests[a];if(!b)throw new Error('Test not defined ("'+a+'"). Use `joint.env.addTest(name, fn) to add a new test.`');var c=joint.env._results[a];if("undefined"!=typeof c)return c;try{c=b()}catch(a){c=!1}return joint.env._results[a]=c,c}},util:{hashCode:function(a){var b=0;if(0==a.length)return b;for(var c=0;c0){var f=joint.util.getByPath(a,d,c);f&&delete f[e]}else delete a[e];return a},flattenObject:function(a,b,c){b=b||"/";var d={};for(var e in a)if(a.hasOwnProperty(e)){var f="object"==typeof a[e];if(f&&c&&c(a[e])&&(f=!1),f){var g=this.flattenObject(a[e],b,c);for(var h in g)g.hasOwnProperty(h)&&(d[e+b+h]=g[h])}else d[e]=a[e]}return d},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)})},guid:function(a){return this.guid.id=this.guid.id||1,a.id=void 0===a.id?"j_"+this.guid.id++:a.id,a.id},toKebabCase:function(a){return a.replace(/[A-Z]/g,"-$&").toLowerCase()},mixin:_.assign,supplement:_.defaults,deepMixin:_.mixin,deepSupplement:_.defaultsDeep,normalizeEvent:function(a){var b=a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches[0];if(b){for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return a},nextFrame:function(){var a;if("undefined"!=typeof window&&(a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame),!a){var b=0;a=function(a){var c=(new Date).getTime(),d=Math.max(0,16-(c-b)),e=setTimeout(function(){a(c+d)},d);return b=c+d,e}}return function(b,c){return a(c?b.bind(c):b)}}(),cancelFrame:function(){var a,b="undefined"!=typeof window;return b&&(a=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.msCancelRequestAnimationFrame||window.oCancelAnimationFrame||window.oCancelRequestAnimationFrame||window.mozCancelAnimationFrame||window.mozCancelRequestAnimationFrame),a=a||clearTimeout,b?a.bind(window):a}(),shapePerimeterConnectionPoint:function(a,b,c,d){var e,f;if(!c){var g=b.$(".scalable")[0],h=b.$(".rotatable")[0];g&&g.firstChild?c=g.firstChild:h&&h.firstChild&&(c=h.firstChild)}return c?(f=V(c).findIntersection(d,a.paper.viewport),f||(e=V(c).getBBox({target:a.paper.viewport}))):(e=b.model.getBBox(),f=e.intersectionWithLineFromCenterToPoint(d)),f||e.center()},isPercentage:function(a){return joint.util.isString(a)&&"%"===a.slice(-1)},parseCssNumeric:function(a,b){b=b||[];var c={value:parseFloat(a)};if(Number.isNaN(c.value))return null;var d=b.join("|");if(joint.util.isString(a)){var e=new RegExp("(\\d+)("+d+")$").exec(a);if(!e)return null;e[2]&&(c.unit=e[2])}return c},breakText:function(a,b,c,d){d=d||{},c=c||{};var e=b.width,f=b.height,g=d.svgDocument||V("svg").node,h=V("tspan").node,i=V("text").attr(c).append(h).node,j=document.createTextNode("");i.style.opacity=0,i.style.display="block",h.style.display="block",h.appendChild(j),g.appendChild(i),d.svgDocument||document.body.appendChild(g);for(var k,l,m=d.separator||" ",n=d.eol||"\n",o=a.split(m),p=[],q=[],r=0,s=0,t=o.length;r=0)if(u.length>1){for(var v=u.split(n),w=0,x=v.length-1;wf){q.splice(Math.floor(f/l));break}}}}return d.svgDocument?g.removeChild(i):document.body.removeChild(g),q.join(n)},sanitizeHTML:function(a){var b=$($.parseHTML("
"+a+"
",null,!1));return b.find("*").each(function(){var a=this;$.each(a.attributes,function(){var b=this,c=b.name,d=b.value;0!==c.indexOf("on")&&0!==d.indexOf("javascript:")||$(a).removeAttr(c)})}),b.html()},downloadBlob:function(a,b){if(window.navigator.msSaveBlob)window.navigator.msSaveBlob(a,b);else{var c=window.URL.createObjectURL(a),d=document.createElement("a");d.href=c,d.download=b,document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c)}},downloadDataUri:function(a,b){var c=joint.util.dataUriToBlob(a);joint.util.downloadBlob(c,b)},dataUriToBlob:function(a){a=a.replace(/\s/g,""),a=decodeURIComponent(a);var b,c=a.indexOf(","),d=a.slice(0,c),e=d.split(":")[1].split(";")[0],f=a.slice(c+1);b=d.indexOf("base64")>=0?atob(f):unescape(encodeURIComponent(f));for(var g=new window.Uint8Array(b.length),h=0;h=1)return 1;var b=a*a,c=b*a;return 4*(a<.5?c:3*(a-b)+c-.75)},exponential:function(a){return Math.pow(2,10*(a-1))},bounce:function(a){for(var b=0,c=1;1;b+=c,c/=2)if(a>=(7-4*b)/11){var d=(11-6*b-11*a)/4;return-d*d+c*c}},reverse:function(a){return function(b){return 1-a(1-b)}},reflect:function(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}},clamp:function(a,b,c){return b=b||0,c=c||1,function(d){var e=a(d);return ec?c:e}},back:function(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}},elastic:function(a){return a||(a=1.5),function(b){return Math.pow(2,10*(b-1))*Math.cos(20*Math.PI*a/3*b)}}},interpolate:{number:function(a,b){var c=b-a;return function(b){return a+c*b}},object:function(a,b){var c=Object.keys(a);return function(d){var e,f,g={};for(e=c.length-1;e!=-1;e--)f=c[e],g[f]=a[f]+(b[f]-a[f])*d;return g}},hexColor:function(a,b){var c=parseInt(a.slice(1),16),d=parseInt(b.slice(1),16),e=255&c,f=(255&d)-e,g=65280&c,h=(65280&d)-g,i=16711680&c,j=(16711680&d)-i;return function(a){var b=e+f*a&255,c=g+h*a&65280,d=i+j*a&16711680;return"#"+(1<<24|b|c|d).toString(16).slice(1)}},unit:function(a,b){var c=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,d=c.exec(a),e=c.exec(b),f=e[1].indexOf("."),g=f>0?e[1].length-f-1:0;a=+d[1];var h=+e[1]-a,i=d[2];return function(b){return(a+h*b).toFixed(g)+i}}},filter:{outline:function(a){var b='',c=Number.isFinite(a.margin)?a.margin:2,d=Number.isFinite(a.width)?a.width:1;return joint.util.template(b)({color:a.color||"blue",opacity:Number.isFinite(a.opacity)?a.opacity:1,outerRadius:c+d,innerRadius:c})},highlight:function(a){var b='';return joint.util.template(b)({color:a.color||"red",width:Number.isFinite(a.width)?a.width:1,blur:Number.isFinite(a.blur)?a.blur:0,opacity:Number.isFinite(a.opacity)?a.opacity:1})},blur:function(a){var b=Number.isFinite(a.x)?a.x:2;return joint.util.template('')({stdDeviation:Number.isFinite(a.y)?[b,a.y]:b})},dropShadow:function(a){var b="SVGFEDropShadowElement"in window?'':'';return joint.util.template(b)({dx:a.dx||0,dy:a.dy||0,opacity:Number.isFinite(a.opacity)?a.opacity:1,color:a.color||"black",blur:Number.isFinite(a.blur)?a.blur:4})},grayscale:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({a:.2126+.7874*(1-b),b:.7152-.7152*(1-b),c:.0722-.0722*(1-b),d:.2126-.2126*(1-b),e:.7152+.2848*(1-b),f:.0722-.0722*(1-b),g:.2126-.2126*(1-b),h:.0722+.9278*(1-b)})},sepia:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({a:.393+.607*(1-b),b:.769-.769*(1-b),c:.189-.189*(1-b),d:.349-.349*(1-b),e:.686+.314*(1-b),f:.168-.168*(1-b),g:.272-.272*(1-b),h:.534-.534*(1-b),i:.131+.869*(1-b)})},saturate:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:1-b})},hueRotate:function(a){return joint.util.template('')({angle:a.angle||0})},invert:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:b,amount2:1-b})},brightness:function(a){return joint.util.template('')({amount:Number.isFinite(a.amount)?a.amount:1})},contrast:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:b,amount2:.5-b/2})}},format:{number:function(a,b,c){function d(a){for(var b=a.length,d=[],e=0,f=c.grouping[0];b>0&&f>0;)d.push(a.substring(b-=f,b+f)),f=c.grouping[e=(e+1)%c.grouping.length];return d.reverse().join(c.thousands)}c=c||{currency:["$",""],decimal:".",thousands:",",grouping:[3]};var e=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,f=e.exec(a),g=f[1]||" ",h=f[2]||">",i=f[3]||"",j=f[4]||"",k=f[5],l=+f[6],m=f[7],n=f[8],o=f[9],p=1,q="",r="",s=!1;switch(n&&(n=+n.substring(1)),(k||"0"===g&&"="===h)&&(k=g="0",h="=",m&&(l-=Math.floor((l-1)/4))),o){case"n":m=!0,o="g";break;case"%":p=100,r="%",o="f";break;case"p":p=100,r="%",o="r";break;case"b":case"o":case"x":case"X":"#"===j&&(q="0"+o.toLowerCase());break;case"c":case"d":s=!0,n=0;break;case"s":p=-1,o="r"}"$"===j&&(q=c.currency[0],r=c.currency[1]),"r"!=o||n||(o="g"),null!=n&&("g"==o?n=Math.max(1,Math.min(21,n)):"e"!=o&&"f"!=o||(n=Math.max(0,Math.min(20,n))));var t=k&&m;if(s&&b%1)return"";var u=b<0||0===b&&1/b<0?(b=-b,"-"):i,v=r;if(p<0){var w=this.prefix(b,n);b=w.scale(b),v=w.symbol+r}else b*=p;b=this.convert(o,b,n);var x=b.lastIndexOf("."),y=x<0?b:b.substring(0,x),z=x<0?"":c.decimal+b.substring(x+1);!k&&m&&c.grouping&&(y=d(y));var A=q.length+y.length+z.length+(t?0:u.length),B=A"===h?B+u+b:"^"===h?B.substring(0,A>>=1)+u+b+B.substring(A):u+(t?b:B+b))+v},string:function(a,b){for(var c,d="{",e=!1,f=[];(c=a.indexOf(d))!==-1;){var g,h,i;if(g=a.slice(0,c),e){h=g.split(":"),i=h.shift().split("."),g=b;for(var j=0;j8?function(a){return a/c}:function(a){return a*c},symbol:a}}),d=0;return a&&(a<0&&(a*=-1),b&&(a=this.round(a,this.precision(a,b))),d=1+Math.floor(1e-12+Math.log(a)/Math.LN10),d=Math.max(-24,Math.min(24,3*Math.floor((d<=0?d+1:d-1)/3)))),c[8+d/3]}},template:function(a){var b=/<%= ([^ ]+) %>|\$\{ ?([^\{\} ]+) ?\}|\{\{([^\{\} ]+)\}\}/g;return function(c){return c=c||{},a.replace(b,function(a){for(var b=Array.from(arguments),d=b.slice(1,4).find(function(a){return!!a}),e=d.split("."),f=c[e.shift()];void 0!==f&&e.length;)f=f[e.shift()];return void 0!==f?f:""})}},toggleFullScreen:function(a){function b(a,b){for(var c=["webkit","moz","ms","o",""],d=0;d0&&b[0]||[],e=c>1&&b[c-1]||{};return Array.isArray(d)||(e instanceof joint.dia.Cell?d=b:d instanceof joint.dia.Cell&&(b.length>1&&b.pop(),d=b)),e instanceof joint.dia.Cell&&(e={}),a.call(this,d,e)}}},parseDOMJSON:function(a,b){for(var c={},d=V.namespace.xmlns,e=b||d,f=document.createDocumentFragment(),g=[a,f,e];g.length>0;){e=g.pop();for(var h=g.pop(),i=g.pop(),j=0,k=i.length;j0);return this.stopBatch("clear"),this},_prepareCell:function(a,b){var c;if(a instanceof Backbone.Model?(c=a.attributes,a.graph||b&&b.dry||(a.graph=this)):c=a,!joint.util.isString(c.type))throw new TypeError("dia.Graph: cell type must be a string.");return a},minZIndex:function(){var a=this.get("cells").first();return a?a.get("z")||0:0},maxZIndex:function(){var a=this.get("cells").last();return a?a.get("z")||0:0},addCell:function(a,b){return Array.isArray(a)?this.addCells(a,b):(a instanceof Backbone.Model?a.has("z")||a.set("z",this.maxZIndex()+1):void 0===a.z&&(a.z=this.maxZIndex()+1),this.get("cells").add(this._prepareCell(a,b),b||{}),this)},addCells:function(a,b){return a.length&&(a=joint.util.flattenDeep(a),b.position=a.length,this.startBatch("add"),a.forEach(function(a){b.position--,this.addCell(a,b)},this),this.stopBatch("add")),this},resetCells:function(a,b){var c=joint.util.toArray(a).map(function(a){return this._prepareCell(a,b)},this);return this.get("cells").reset(c,b),this},removeCells:function(a,b){return a.length&&(this.startBatch("remove"),joint.util.invoke(a,"remove",b),this.stopBatch("remove")),this},_removeCell:function(a,b,c){c=c||{},c.clear||(c.disconnectLinks?this.disconnectLinks(a,c):this.removeLinks(a,c)),this.get("cells").remove(a,{silent:!0}),a.graph===this&&(a.graph=null)},getCell:function(a){return this.get("cells").get(a)},getCells:function(){return this.get("cells").toArray()},getElements:function(){return Object.keys(this._nodes).map(this.getCell,this)},getLinks:function(){return Object.keys(this._edges).map(this.getCell,this)},getFirstCell:function(){return this.get("cells").first()},getLastCell:function(){return this.get("cells").last()},getConnectedLinks:function(a,b){b=b||{};var c=b.inbound,d=b.outbound;void 0===c&&void 0===d&&(c=d=!0);var e=[],f={};if(d&&joint.util.forIn(this.getOutboundEdges(a.id),function(a,b){f[b]||(e.push(this.getCell(b)),f[b]=!0)}.bind(this)),c&&joint.util.forIn(this.getInboundEdges(a.id),function(a,b){f[b]||(e.push(this.getCell(b)),f[b]=!0)}.bind(this)),b.deep){var g=a.getEmbeddedCells({deep:!0}),h={};g.forEach(function(a){a.isElement()&&(h[a.id]=!0)}),g.forEach(function(a){a.isLink()||(d&&joint.util.forIn(this.getOutboundEdges(a.id),function(a,c){if(!f[c]){var d=this.getCell(c),g=d.source().id,i=d.target().id;if(!b.includeEnclosed&&g&&h[g]&&i&&h[i])return;e.push(this.getCell(c)),f[c]=!0}}.bind(this)),c&&joint.util.forIn(this.getInboundEdges(a.id),function(a,c){if(!f[c]){var d=this.getCell(c),g=d.source().id,i=d.target().id;if(!b.includeEnclosed&&g&&h[g]&&i&&h[i])return;e.push(this.getCell(c)),f[c]=!0}}.bind(this)))},this)}return e},getNeighbors:function(a,b){b=b||{};var c=b.inbound,d=b.outbound;void 0===c&&void 0===d&&(c=d=!0);var e=this.getConnectedLinks(a,b).reduce(function(e,f){var g=f.source(),h=f.target(),i=f.hasLoop(b);if(c&&joint.util.has(g,"id")&&!e[g.id]){var j=this.getCell(g.id);!i&&(!j||j===a||b.deep&&j.isEmbeddedIn(a))||(e[g.id]=j)}if(d&&joint.util.has(h,"id")&&!e[h.id]){var k=this.getCell(h.id);!i&&(!k||k===a||b.deep&&k.isEmbeddedIn(a))||(e[h.id]=k)}return e}.bind(this),{});return joint.util.toArray(e)},getCommonAncestor:function(){var a=Array.from(arguments).map(function(a){for(var b=[],c=a.get("parent");c;)b.push(c),c=this.getCell(c).get("parent");return b},this);a=a.sort(function(a,b){return a.length-b.length});var b=joint.util.toArray(a.shift()).find(function(b){return a.every(function(a){return a.includes(b)})});return this.getCell(b)},getSuccessors:function(a,b){b=b||{};var c=[];return this.search(a,function(b){b!==a&&c.push(b)},joint.util.assign({},b,{outbound:!0})),c},cloneCells:function(a){a=joint.util.uniq(a);var b=joint.util.toArray(a).reduce(function(a,b){return a[b.id]=b.clone(),a},{});return joint.util.toArray(a).forEach(function(a){var c=b[a.id];if(c.isLink()){var d=c.source(),e=c.target();d.id&&b[d.id]&&c.prop("source/id",b[d.id].id),e.id&&b[e.id]&&c.prop("target/id",b[e.id].id)}var f=a.get("parent");f&&b[f]&&c.set("parent",b[f].id);var g=joint.util.toArray(a.get("embeds")).reduce(function(a,c){return b[c]&&a.push(b[c].id),a},[]);joint.util.isEmpty(g)||c.set("embeds",g)}),b},cloneSubgraph:function(a,b){var c=this.getSubgraph(a,b);return this.cloneCells(c)},getSubgraph:function(a,b){b=b||{};var c=[],d={},e=[],f=[];return joint.util.toArray(a).forEach(function(a){if(d[a.id]||(c.push(a),d[a.id]=a,a.isLink()?f.push(a):e.push(a)),b.deep){var g=a.getEmbeddedCells({deep:!0});g.forEach(function(a){d[a.id]||(c.push(a),d[a.id]=a,a.isLink()?f.push(a):e.push(a))})}}),f.forEach(function(a){var b=a.source(),f=a.target(); +var g={};!function(a){function b(a,b){return b.unshift(null),new(Function.prototype.bind.apply(a,b))}function c(a){var b,c,d=[];for(c=arguments.length,b=1;b=1)return[new q(b,c,d,e),new q(e,e,e,e)];var f=this.getSkeletonPoints(a),g=f.startControlPoint1,h=f.startControlPoint2,i=f.divider,j=f.dividerControlPoint1,k=f.dividerControlPoint2;return[new q(b,g,h,i),new q(i,j,k,e)]},endpointDistance:function(){return this.start.distance(this.end)},equals:function(a){return!!a&&this.start.x===a.start.x&&this.start.y===a.start.y&&this.controlPoint1.x===a.controlPoint1.x&&this.controlPoint1.y===a.controlPoint1.y&&this.controlPoint2.x===a.controlPoint2.x&&this.controlPoint2.y===a.controlPoint2.y&&this.end.x===a.end.x&&this.end.y===a.end.y},getSkeletonPoints:function(a){var b=this.start,c=this.controlPoint1,d=this.controlPoint2,e=this.end;if(a<=0)return{startControlPoint1:b.clone(),startControlPoint2:b.clone(),divider:b.clone(),dividerControlPoint1:c.clone(),dividerControlPoint2:d.clone()};if(a>=1)return{startControlPoint1:c.clone(),startControlPoint2:d.clone(),divider:e.clone(),dividerControlPoint1:e.clone(),dividerControlPoint2:e.clone()};var f=new s(b,c).pointAt(a),g=new s(c,d).pointAt(a),h=new s(d,e).pointAt(a),i=new s(f,g).pointAt(a),j=new s(g,h).pointAt(a),k=new s(i,j).pointAt(a),l={startControlPoint1:f,startControlPoint2:i,divider:k,dividerControlPoint1:j,dividerControlPoint2:h};return l},getSubdivisions:function(a){a=a||{};var b=void 0===a.precision?this.PRECISION:a.precision,c=[new q(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===b)return c;for(var d=this.endpointDistance(),e=p(10,-b),f=0;;){f+=1;for(var g=[],h=c.length,i=0;i1&&r=1)return this.end.clone();var c=this.tAt(a,b);return this.pointAtT(c)},pointAtLength:function(a,b){var c=this.tAtLength(a,b);return this.pointAtT(c)},pointAtT:function(a){return a<=0?this.start.clone():a>=1?this.end.clone():this.getSkeletonPoints(a).divider},PRECISION:3,scale:function(a,b,c){return this.start.scale(a,b,c),this.controlPoint1.scale(a,b,c),this.controlPoint2.scale(a,b,c),this.end.scale(a,b,c),this},tangentAt:function(a,b){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var c=this.tAt(a,b);return this.tangentAtT(c)},tangentAtLength:function(a,b){if(!this.isDifferentiable())return null;var c=this.tAtLength(a,b);return this.tangentAtT(c)},tangentAtT:function(a){if(!this.isDifferentiable())return null;a<0?a=0:a>1&&(a=1);var b=this.getSkeletonPoints(a),c=b.startControlPoint2,d=b.dividerControlPoint1,e=b.divider,f=new s(c,d);return f.translate(e.x-c.x,e.y-c.y),f},tAt:function(a,b){if(a<=0)return 0;if(a>=1)return 1;b=b||{};var c=void 0===b.precision?this.PRECISION:b.precision,d=void 0===b.subdivisions?this.getSubdivisions({precision:c}):b.subdivisions,e={precision:c,subdivisions:d},f=this.length(e),g=f*a;return this.tAtLength(g,e)},tAtLength:function(a,b){var c=!0;a<0&&(c=!1,a=-a),b=b||{};for(var d,e,f,g,h,i=void 0===b.precision?this.PRECISION:b.precision,j=void 0===b.subdivisions?this.getSubdivisions({precision:i}):b.subdivisions,k={precision:i,subdivisions:j},l=0,m=j.length,n=1/m,o=c?0:m-1;c?o=0;c?o++:o--){var q=j[o],r=q.endpointDistance();if(a<=l+r){d=q,e=o*n,f=(o+1)*n,g=c?a-l:r+l-a,h=c?r+l-a:a-l;break}l+=r}if(!d)return c?1:0;for(var s=this.length(k),t=p(10,-i);;){var u;if(u=0!==s?g/s:0,ui.x+g/2,m=ei.x?f-d:f+d,c=g*g/(e-j)-g*g*(f-k)*(b-k)/(h*h*(e-j))+j):(c=f>i.y?e+d:e-d,b=h*h/(f-k)-h*h*(e-j)*(c-j)/(g*g*(f-k))+k),new u(c,b).theta(a)},equals:function(a){return!!a&&a.x===this.x&&a.y===this.y&&a.a===this.a&&a.b===this.b},intersectionWithLine:function(a){var b=[],c=a.start,d=a.end,e=this.a,f=this.b,g=a.vector(),i=c.difference(new u(this)),j=new u(g.x/(e*e),g.y/(f*f)),k=new u(i.x/(e*e),i.y/(f*f)),l=g.dot(j),m=g.dot(k),n=i.dot(k)-1,o=m*m-l*n;if(o<0)return null;if(o>0){var p=h(o),q=(-m-p)/l,r=(-m+p)/l;if((q<0||10){if(f>d||g>d)return null}else if(f=1?c.clone():b.lerp(c,a)},pointAtLength:function(a){var b=this.start,c=this.end,d=!0;a<0&&(d=!1,a=-a);var e=this.length();return a>=e?d?c.clone():b.clone():this.pointAt((d?a:e-a)/e)},pointOffset:function(b){b=new a.Point(b);var c=this.start,d=this.end,e=(d.x-c.x)*(b.y-c.y)-(d.y-c.y)*(b.x-c.x);return e/this.length()},rotate:function(a,b){return this.start.rotate(a,b),this.end.rotate(a,b),this},round:function(a){var b=p(10,a||0);return this.start.x=l(this.start.x*b)/b,this.start.y=l(this.start.y*b)/b,this.end.x=l(this.end.x*b)/b,this.end.y=l(this.end.y*b)/b,this},scale:function(a,b,c){return this.start.scale(a,b,c),this.end.scale(a,b,c),this},setLength:function(a){var b=this.length();if(!b)return this;var c=a/b;return this.scale(c,c,this.start)},squaredLength:function(){var a=this.start.x,b=this.start.y,c=this.end.x,d=this.end.y;return(a-=c)*a+(b-=d)*b},tangentAt:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAt(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},tangentAtLength:function(a){if(!this.isDifferentiable())return null;var b=this.start,c=this.end,d=this.pointAtLength(a),e=new s(b,c);return e.translate(d.x-b.x,d.y-b.y),e},translate:function(a,b){return this.start.translate(a,b),this.end.translate(a,b),this},vector:function(){return new u(this.end.x-this.start.x,this.end.y-this.start.y)},toString:function(){return this.start.toString()+" "+this.end.toString()}},s.prototype.intersection=s.prototype.intersect;var t=a.Path=function(a){if(!(this instanceof t))return new t(a);if("string"==typeof a)return new t.parse(a);this.segments=[];var b,c;if(a){if(Array.isArray(a)&&0!==a.length)if(c=a.length,a[0].isSegment)for(b=0;b=c||a<0)throw new Error("Index out of range.");return b[a]},getSegmentSubdivisions:function(a){var b=this.segments,c=b.length;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=[],f=0;fd||a<0)throw new Error("Index out of range.");var e,f=null,g=null;if(0!==d&&(a>=1?(f=c[a-1],g=f.nextSegment):g=c[0]),Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");for(var h=b.length,i=0;i=d?(e=d-1,f=1):f<0?f=0:f>1&&(f=1),b=b||{};for(var g,h=void 0===b.precision?this.PRECISION:b.precision,i=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:h}):b.segmentSubdivisions,j=0,k=0;k=1)return this.end.clone();b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.pointAtLength(i,g)},pointAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;if(0===a)return this.start.clone();var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isVisible){if(a<=i+m)return k.pointAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f)return e?f.end:f.start;var n=c[d-1];return n.end.clone()},pointAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].pointAtT(0);if(d>=c)return b[c-1].pointAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].pointAtT(e)},prepareSegment:function(a,b,c){a.previousSegment=b,a.nextSegment=c,b&&(b.nextSegment=a),c&&(c.previousSegment=a);var d=a;return a.isSubpathStart&&(a.subpathStartSegment=a,d=c),d&&this.updateSubpathStartSegment(d),a},PRECISION:3,removeSegment:function(a){var b=this.segments,c=b.length;if(0===c)throw new Error("Path has no segments.");if(a<0&&(a=c+a),a>=c||a<0)throw new Error("Index out of range.");var d=b.splice(a,1)[0],e=d.previousSegment,f=d.nextSegment;e&&(e.nextSegment=f),f&&(f.previousSegment=e),d.isSubpathStart&&f&&this.updateSubpathStartSegment(f)},replaceSegment:function(a,b){var c=this.segments,d=c.length;if(0===d)throw new Error("Path has no segments.");if(a<0&&(a=d+a),a>=d||a<0)throw new Error("Index out of range.");var e,f=c[a],g=f.previousSegment,h=f.nextSegment,i=f.isSubpathStart;if(Array.isArray(b)){if(!b[0].isSegment)throw new Error("Segments required.");c.splice(a,1);for(var j=b.length,k=0;k1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.segmentIndexAtLength(i,g)},toPoints:function(a){var b=this.segments,c=b.length;if(0===c)return null;a=a||{};for(var d=void 0===a.precision?this.PRECISION:a.precision,e=void 0===a.segmentSubdivisions?this.getSegmentSubdivisions({precision:d}):a.segmentSubdivisions,f=[],g=[],h=0;h0){var k=j.map(function(a){return a.start});Array.prototype.push.apply(g,k)}else g.push(i.start)}else g.length>0&&(g.push(b[h-1].end),f.push(g),g=[])}return g.length>0&&(g.push(this.end),f.push(g)),f},toPolylines:function(a){var b=[],c=this.toPoints(a);if(!c)return null;for(var d=0,e=c.length;d=0;e?j++:j--){var k=c[j],l=g[j],m=k.length({precision:f,subdivisions:l});if(k.isVisible){if(a<=i+m)return j;h=j}i+=m}return h},tangentAt:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;a<0&&(a=0),a>1&&(a=1),b=b||{};var e=void 0===b.precision?this.PRECISION:b.precision,f=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:e}):b.segmentSubdivisions,g={precision:e,segmentSubdivisions:f},h=this.length(g),i=h*a;return this.tangentAtLength(i,g)},tangentAtLength:function(a,b){var c=this.segments,d=c.length;if(0===d)return null;var e=!0;a<0&&(e=!1,a=-a),b=b||{};for(var f,g=void 0===b.precision?this.PRECISION:b.precision,h=void 0===b.segmentSubdivisions?this.getSegmentSubdivisions({precision:g}):b.segmentSubdivisions,i=0,j=e?0:d-1;e?j=0;e?j++:j--){var k=c[j],l=h[j],m=k.length({precision:g,subdivisions:l});if(k.isDifferentiable()){if(a<=i+m)return k.tangentAtLength((e?1:-1)*(a-i),{precision:g,subdivisions:l});f=k}i+=m}if(f){var n=e?1:0;return f.tangentAtT(n)}return null},tangentAtT:function(a){var b=this.segments,c=b.length;if(0===c)return null;var d=a.segmentIndex;if(d<0)return b[0].tangentAtT(0);if(d>=c)return b[c-1].tangentAtT(1);var e=a.value;return e<0?e=0:e>1&&(e=1),b[d].tangentAtT(e)},translate:function(a,b){for(var c=this.segments,d=c.length,e=0;e=0;c--){var d=a[c];if(d.isVisible)return d.end}return a[b-1].end}});var u=a.Point=function(a,b){if(!(this instanceof u))return new u(a,b);if("string"==typeof a){var c=a.split(a.indexOf("@")===-1?" ":"@");a=parseFloat(c[0]),b=parseFloat(c[1])}else Object(a)===a&&(b=a.y,a=a.x);this.x=void 0===a?0:a,this.y=void 0===b?0:b};u.fromPolar=function(a,b,c){c=c&&new u(c)||new u(0,0);var d=e(a*f(b)),h=e(a*g(b)),i=x(z(b));return i<90?h=-h:i<180?(d=-d,h=-h):i<270&&(d=-d),new u(c.x+d,c.y+h)},u.random=function(a,b,c,d){return new u(m(o()*(b-a+1)+a),m(o()*(d-c+1)+c))},u.prototype={adhereToRect:function(a){return a.containsPoint(this)?this:(this.x=i(j(this.x,a.x),a.x+a.width),this.y=i(j(this.y,a.y),a.y+a.height),this)},bearing:function(a){return new s(this,a).bearing()},changeInAngle:function(a,b,c){return this.clone().offset(-a,-b).theta(c)-this.theta(c)},clone:function(){return new u(this)},difference:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),new u(this.x-(a||0),this.y-(b||0))},distance:function(a){return new s(this,a).length()},squaredDistance:function(a){return new s(this,a).squaredLength()},equals:function(a){return!!a&&this.x===a.x&&this.y===a.y},magnitude:function(){return h(this.x*this.x+this.y*this.y)||.01},manhattanDistance:function(a){return e(a.x-this.x)+e(a.y-this.y)},move:function(a,b){var c=A(new u(a).theta(this)),d=this.offset(f(c)*b,-g(c)*b);return d},normalize:function(a){var b=(a||1)/this.magnitude();return this.scale(b,b)},offset:function(a,b){return Object(a)===a&&(b=a.y,a=a.x),this.x+=a||0,this.y+=b||0,this},reflection:function(a){return new u(a).move(this,this.distance(a))},rotate:function(b,c){b=b||new a.Point(0,0),c=A(x(-c));var d=f(c),e=g(c),h=d*(this.x-b.x)-e*(this.y-b.y)+b.x,i=e*(this.x-b.x)+d*(this.y-b.y)+b.y;return this.x=h,this.y=i,this},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this},scale:function(a,b,c){return c=c&&new u(c)||new u(0,0),this.x=c.x+a*(this.x-c.x),this.y=c.y+b*(this.y-c.y),this},snapToGrid:function(a,b){return this.x=y(this.x,a),this.y=y(this.y,b||a),this},theta:function(a){a=new u(a);var b=-(a.y-this.y),c=a.x-this.x,d=k(b,c);return d<0&&(d=2*n+d),180*d/n},angleBetween:function(a,b){var c=this.equals(a)||this.equals(b)?NaN:this.theta(b)-this.theta(a);return c<0&&(c+=360),c},vectorAngle:function(a){var b=new u(0,0);return b.angleBetween(this,a)},toJSON:function(){return{x:this.x,y:this.y}},toPolar:function(a){a=a&&new u(a)||new u(0,0);var b=this.x,c=this.y;return this.x=h((b-a.x)*(b-a.x)+(c-a.y)*(c-a.y)),this.y=A(a.theta(new u(b,c))),this},toString:function(){return this.x+"@"+this.y},update:function(a,b){return this.x=a||0,this.y=b||0,this},dot:function(a){return a?this.x*a.x+this.y*a.y:NaN},cross:function(a,b){return a&&b?(b.x-this.x)*(a.y-this.y)-(b.y-this.y)*(a.x-this.x):NaN},lerp:function(a,b){var c=this.x,d=this.y;return new u((1-b)*c+b*a.x,(1-b)*d+b*a.y)}},u.prototype.translate=u.prototype.offset;var v=a.Rect=function(a,b,c,d){return this instanceof v?(Object(a)===a&&(b=a.y,c=a.width,d=a.height,a=a.x),this.x=void 0===a?0:a,this.y=void 0===b?0:b,this.width=void 0===c?0:c,void(this.height=void 0===d?0:d)):new v(a,b,c,d)};v.fromEllipse=function(a){return a=new r(a),new v(a.x-a.a,a.y-a.b,2*a.a,2*a.b)},v.prototype={bbox:function(a){if(!a)return this.clone();var b=A(a||0),c=e(g(b)),d=e(f(b)),h=this.width*d+this.height*c,i=this.width*c+this.height*d;return new v(this.x+(this.width-h)/2,this.y+(this.height-i)/2,h,i)},bottomLeft:function(){return new u(this.x,this.y+this.height)},bottomLine:function(){return new s(this.bottomLeft(),this.bottomRight())},bottomMiddle:function(){return new u(this.x+this.width/2,this.y+this.height); +},center:function(){return new u(this.x+this.width/2,this.y+this.height/2)},clone:function(){return new v(this)},containsPoint:function(a){return a=new u(a),a.x>=this.x&&a.x<=this.x+this.width&&a.y>=this.y&&a.y<=this.y+this.height},containsRect:function(a){var b=new v(this).normalize(),c=new v(a).normalize(),d=b.width,e=b.height,f=c.width,g=c.height;if(!(d&&e&&f&&g))return!1;var h=b.x,i=b.y,j=c.x,k=c.y;return f+=j,d+=h,g+=k,e+=i,h<=j&&f<=d&&i<=k&&g<=e},corner:function(){return new u(this.x+this.width,this.y+this.height)},equals:function(a){var b=new v(this).normalize(),c=new v(a).normalize();return b.x===c.x&&b.y===c.y&&b.width===c.width&&b.height===c.height},intersect:function(a){var b=this.origin(),c=this.corner(),d=a.origin(),e=a.corner();if(e.x<=b.x||e.y<=b.y||d.x>=c.x||d.y>=c.y)return null;var f=j(b.x,d.x),g=j(b.y,d.y);return new v(f,g,i(c.x,e.x)-f,i(c.y,e.y)-g)},intersectionWithLine:function(a){var b,c,d=this,e=[d.topLine(),d.rightLine(),d.bottomLine(),d.leftLine()],f=[],g=[],h=e.length;for(c=0;c0?f:null},intersectionWithLineFromCenterToPoint:function(a,b){a=new u(a);var c,d=new u(this.x+this.width/2,this.y+this.height/2);b&&a.rotate(d,b);for(var e=[this.topLine(),this.rightLine(),this.bottomLine(),this.leftLine()],f=new s(d,a),g=e.length-1;g>=0;--g){var h=e[g].intersection(f);if(null!==h){c=h;break}}return c&&b&&c.rotate(d,-b),c},leftLine:function(){return new s(this.topLeft(),this.bottomLeft())},leftMiddle:function(){return new u(this.x,this.y+this.height/2)},moveAndExpand:function(a){return this.x+=a.x||0,this.y+=a.y||0,this.width+=a.width||0,this.height+=a.height||0,this},offset:function(a,b){return u.prototype.offset.call(this,a,b)},inflate:function(a,b){return void 0===a&&(a=0),void 0===b&&(b=a),this.x-=a,this.y-=b,this.width+=2*a,this.height+=2*b,this},normalize:function(){var a=this.x,b=this.y,c=this.width,d=this.height;return this.width<0&&(a=this.x+this.width,c=-this.width),this.height<0&&(b=this.y+this.height,d=-this.height),this.x=a,this.y=b,this.width=c,this.height=d,this},origin:function(){return new u(this.x,this.y)},pointNearestToPoint:function(a){if(a=new u(a),this.containsPoint(a)){var b=this.sideNearestToPoint(a);switch(b){case"right":return new u(this.x+this.width,a.y);case"left":return new u(this.x,a.y);case"bottom":return new u(a.x,this.y+this.height);case"top":return new u(a.x,this.y)}}return a.adhereToRect(this)},rightLine:function(){return new s(this.topRight(),this.bottomRight())},rightMiddle:function(){return new u(this.x+this.width,this.y+this.height/2)},round:function(a){var b=p(10,a||0);return this.x=l(this.x*b)/b,this.y=l(this.y*b)/b,this.width=l(this.width*b)/b,this.height=l(this.height*b)/b,this},scale:function(a,b,c){return c=this.origin().scale(a,b,c),this.x=c.x,this.y=c.y,this.width*=a,this.height*=b,this},maxRectScaleToFit:function(a,b){a=new v(a),b||(b=a.center());var c,d,e,f,g,h,j,k,l=b.x,m=b.y;c=d=e=f=g=h=j=k=1/0;var n=a.topLeft();n.xl&&(d=(this.x+this.width-l)/(o.x-l)),o.y>m&&(h=(this.y+this.height-m)/(o.y-m));var p=a.topRight();p.x>l&&(e=(this.x+this.width-l)/(p.x-l)),p.ym&&(k=(this.y+this.height-m)/(q.y-m)),{sx:i(c,d,e,f),sy:i(g,h,j,k)}},maxRectUniformScaleToFit:function(a,b){var c=this.maxRectScaleToFit(a,b);return i(c.sx,c.sy)},sideNearestToPoint:function(a){a=new u(a);var b=a.x-this.x,c=this.x+this.width-a.x,d=a.y-this.y,e=this.y+this.height-a.y,f=b,g="left";return cb&&(b=i),jd&&(d=j)}return new v(a,c,b-a,d-c)},clone:function(){var a=this.points,b=a.length;if(0===b)return new w;for(var c=[],d=0;df.x&&(f=c[a]);var g=[];for(a=0;a2){var j=g[g.length-1];g.unshift(j)}for(var k,l,m,n,o,p,q={},r=[];0!==g.length;)if(k=g.pop(),l=k[0],!q.hasOwnProperty(k[0]+"@@"+k[1]))for(var s=!1;!s;)if(r.length<2)r.push(k),s=!0;else{m=r.pop(),n=m[0],o=r.pop(),p=o[0];var t=p.cross(n,l);if(t<0)r.push(o),r.push(m),r.push(k),s=!0;else if(0===t){var u=1e-10,v=n.angleBetween(p,l);e(v-180)2&&r.pop();var x,y=-1;for(b=r.length,a=0;a0){var B=r.slice(y),C=r.slice(0,y);A=B.concat(C)}else A=r;var D=[];for(b=A.length,a=0;a=1)return b[c-1].clone();var d=this.length(),e=d*a;return this.pointAtLength(e)},pointAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return b[0].clone();var d=!0;a<0&&(d=!1,a=-a);for(var e=0,f=c-1,g=d?0:f-1;d?g=0;d?g++:g--){var h=b[g],i=b[g+1],j=new s(h,i),k=h.distance(i);if(a<=e+k)return j.pointAtLength((d?1:-1)*(a-e));e+=k}var l=d?b[c-1]:b[0];return l.clone()},scale:function(a,b,c){var d=this.points,e=d.length;if(0===e)return this;for(var f=0;f1&&(a=1);var d=this.length(),e=d*a;return this.tangentAtLength(e)},tangentAtLength:function(a){var b=this.points,c=b.length;if(0===c)return null;if(1===c)return null;var d=!0;a<0&&(d=!1,a=-a);for(var e,f=0,g=c-1,h=d?0:g-1;d?h=0;d?h++:h--){var i=b[h],j=b[h+1],k=new s(i,j),l=i.distance(j);if(k.isDifferentiable()){if(a<=f+l)return k.tangentAtLength((d?1:-1)*(a-f));e=k}f+=l}if(e){var m=d?1:0;return e.tangentAt(m)}return null},intersectionWithLine:function(a){for(var b=new s(a),c=[],d=this.points,e=0,f=d.length-1;e0?c:null},translate:function(a,b){var c=this.points,d=c.length;if(0===d)return this;for(var e=0;e=1?b:b*a},pointAtT:function(a){if(this.pointAt)return this.pointAt(a);throw new Error("Neither pointAtT() nor pointAt() function is implemented.")},previousSegment:null,subpathStartSegment:null,tangentAtT:function(a){if(this.tangentAt)return this.tangentAt(a);throw new Error("Neither tangentAtT() nor tangentAt() function is implemented.")},bbox:function(){throw new Error("Declaration missing for virtual function.")},clone:function(){throw new Error("Declaration missing for virtual function.")},closestPoint:function(){throw new Error("Declaration missing for virtual function.")},closestPointLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointNormalizedLength:function(){throw new Error("Declaration missing for virtual function.")},closestPointTangent:function(){throw new Error("Declaration missing for virtual function.")},equals:function(){throw new Error("Declaration missing for virtual function.")},getSubdivisions:function(){throw new Error("Declaration missing for virtual function.")},isDifferentiable:function(){throw new Error("Declaration missing for virtual function.")},length:function(){throw new Error("Declaration missing for virtual function.")},pointAt:function(){throw new Error("Declaration missing for virtual function.")},pointAtLength:function(){throw new Error("Declaration missing for virtual function.")},scale:function(){throw new Error("Declaration missing for virtual function.")},tangentAt:function(){throw new Error("Declaration missing for virtual function.")},tangentAtLength:function(){throw new Error("Declaration missing for virtual function.")},translate:function(){throw new Error("Declaration missing for virtual function.")},serialize:function(){throw new Error("Declaration missing for virtual function.")},toString:function(){throw new Error("Declaration missing for virtual function.")}},C=function(){for(var a=[],c=arguments.length,d=0;d0)throw new Error("Closepath constructor expects no arguments.");return this},J={clone:function(){return new I},getSubdivisions:function(){return[]},isDifferentiable:function(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)},scale:function(){return this},translate:function(){return this},type:"Z",serialize:function(){return this.type},toString:function(){return this.type+" "+this.start+" "+this.end}};Object.defineProperty(J,"start",{configurable:!0,enumerable:!0,get:function(){if(!this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path; OR segment has not yet been added to a path.)");return this.previousSegment.end}}),Object.defineProperty(J,"end",{configurable:!0,enumerable:!0,get:function(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. Moveto); OR segment has not yet been added to a path.)");return this.subpathStartSegment.end}}),I.prototype=c(B,s.prototype,J);var K=t.segmentTypes={L:C,C:E,M:G,Z:I,z:I};t.regexSupportedData=new RegExp("^[\\s\\d"+Object.keys(K).join("")+",.]*$"),t.isDataSupported=function(a){return"string"==typeof a&&this.regexSupportedData.test(a)}}(g); +var V,Vectorizer;V=Vectorizer=function(){"use strict";function a(a,b){a||(a={});var c=q("textPath"),d=a.d;if(d&&void 0===a["xlink:href"]){var e=q("path").attr("d",d).appendTo(b.defs());c.attr("xlink:href","#"+e.id)}return q.isObject(a)&&c.attr(a),c.node}function b(a,b,c){c||(c={});for(var d=c.includeAnnotationIndices,e=c.eol,f=c.lineHeight,g=c.baseSize,h=0,i={},j=b.length-1,k=0;k<=j;k++){var l=b[k],m=null;if(q.isObject(l)){var n=l.attrs,o=q("tspan",n),p=o.node,r=l.t;e&&k===j&&(r+=e),p.textContent=r;var s=n.class;s&&o.addClass(s),d&&o.attr("annotations",l.annotations),m=parseFloat(n["font-size"]),void 0===m&&(m=g),m&&m>h&&(h=m)}else e&&k===j&&(l+=e),p=document.createTextNode(l||" "),g&&g>h&&(h=g);a.appendChild(p)}return h&&(i.maxFontSize=h),f?i.lineHeight=f:h&&(i.lineHeight=1.2*h),i}function c(a,b){var c=parseFloat(a);return s.test(a)?c*b:c}function d(a,b,d,e){if(!Array.isArray(b))return 0;var f=b.length;if(!f)return 0;for(var g=b[0],h=c(g.maxFontSize,d)||d,i=0,j=c(e,d),k=1;k1){var e,g,h=[];for(e=0,g=d.childNodes.length;e0&&D.setAttribute("dy",B),(y>0||g)&&D.setAttribute("x",j),D.className.baseVal=C,r.appendChild(D),v+=E.length+1}if(i)if(l)B=d(h,x,p,o);else if("top"===h)B="0.8em";else{var I;switch(z>0?(I=parseFloat(o)||1,I*=z,s.test(o)||(I/=p)):I=0,h){case"middle":B=.3-I/2+"em";break;case"bottom":B=-I-.3+"em"}}else 0===h?B="0em":h?B=h:(B=0,null===this.attr("y")&&this.attr("y",u||"0.8em"));return r.firstChild.setAttribute("dy",B),this.append(r),this},r.removeAttr=function(a){var b=q.qualifyAttr(a),c=this.node;return b.ns?c.hasAttributeNS(b.ns,b.local)&&c.removeAttributeNS(b.ns,b.local):c.hasAttribute(a)&&c.removeAttribute(a),this},r.attr=function(a,b){if(q.isUndefined(a)){for(var c=this.node.attributes,d={},e=0;e1&&k.push(k[0]),new g.Polyline(k);case"PATH":return l=this.attr("d"),g.Path.isDataSupported(l)||(l=q.normalizePathData(l)),new g.Path(l);case"LINE":return m=parseFloat(this.attr("x1"))||0,o=parseFloat(this.attr("y1"))||0,n=parseFloat(this.attr("x2"))||0,p=parseFloat(this.attr("y2"))||0,new g.Line({x:m,y:o},{x:n,y:p})}return this.getBBox()},r.findIntersection=function(a,b){var c=this.svg().node;b=b||c;var d=this.getBBox({target:b}),e=d.center();if(d.intersectionWithLineFromCenterToPoint(a)){var f,h=this.tagName();if("RECT"===h){var i=new g.Rect(parseFloat(this.attr("x")||0),parseFloat(this.attr("y")||0),parseFloat(this.attr("width")),parseFloat(this.attr("height"))),j=this.getTransformToElement(b),k=q.decomposeMatrix(j),l=c.createSVGTransform();l.setRotate(-k.rotation,e.x,e.y);var m=q.transformRect(i,l.matrix.multiply(j));f=new g.Rect(m).intersectionWithLineFromCenterToPoint(a,k.rotation)}else if("PATH"===h||"POLYGON"===h||"POLYLINE"===h||"CIRCLE"===h||"ELLIPSE"===h){var n,o,p,r,s,t,u="PATH"===h?this:this.convertToPath(),v=u.sample(),w=1/0,x=[];for(n=0;n'+(a||"")+"",c=q.parseXML(b,{async:!1});return c.documentElement},q.idCounter=0,q.uniqueId=function(){return"v-"+ ++q.idCounter},q.toNode=function(a){return q.isV(a)?a.node:a.nodeName&&a||a[0]},q.ensureId=function(a){return a=q.toNode(a),a.id||(a.id=q.uniqueId())},q.sanitizeText=function(a){return(a||"").replace(/ /g,"\xa0")},q.isUndefined=function(a){return"undefined"==typeof a},q.isString=function(a){return"string"==typeof a},q.isObject=function(a){return a&&"object"==typeof a},q.isArray=Array.isArray,q.parseXML=function(a,b){b=b||{};var c;try{var d=new DOMParser;q.isUndefined(b.async)||(d.async=b.async),c=d.parseFromString(a,"text/xml")}catch(a){c=void 0}if(!c||c.getElementsByTagName("parsererror").length)throw new Error("Invalid XML: "+a);return c},q.qualifyAttr=function(a){if(a.indexOf(":")!==-1){var b=a.split(":");return{ns:f[b[0]],local:b[1]}}return{ns:null,local:a}},q.transformRegex=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,q.transformSeparatorRegex=/[ ,]+/,q.transformationListRegex=/^(\w+)\((.*)\)/,q.transformStringToMatrix=function(a){var b=q.createSVGMatrix(),c=a&&a.match(q.transformRegex);if(!c)return b;for(var d=0,e=c.length;d=0){var f=q.transformStringToMatrix(a),g=q.decomposeMatrix(f);b=[g.translateX,g.translateY],d=[g.scaleX,g.scaleY],c=[g.rotation];var h=[];0===b[0]&&0===b[0]||h.push("translate("+b+")"),1===d[0]&&1===d[1]||h.push("scale("+d+")"),0!==c[0]&&h.push("rotate("+c+")"),a=h.join(" ")}else{var i=a.match(/translate\((.*?)\)/);i&&(b=i[1].split(e));var j=a.match(/rotate\((.*?)\)/);j&&(c=j[1].split(e));var k=a.match(/scale\((.*?)\)/);k&&(d=k[1].split(e))}}var l=d&&d[0]?parseFloat(d[0]):1;return{value:a,translate:{tx:b&&b[0]?parseInt(b[0],10):0,ty:b&&b[1]?parseInt(b[1],10):0},rotate:{angle:c&&c[0]?parseInt(c[0],10):0,cx:c&&c[1]?parseInt(c[1],10):void 0,cy:c&&c[2]?parseInt(c[2],10):void 0},scale:{sx:l,sy:d&&d[1]?parseFloat(d[1]):l}}},q.deltaTransformPoint=function(a,b){var c=b.x*a.a+b.y*a.c+0,d=b.x*a.b+b.y*a.d+0;return{x:c,y:d}},q.decomposeMatrix=function(a){var b=q.deltaTransformPoint(a,{x:0,y:1}),c=q.deltaTransformPoint(a,{x:1,y:0}),d=180/j*k(b.y,b.x)-90,e=180/j*k(c.y,c.x);return{translateX:a.e,translateY:a.f,scaleX:l(a.a*a.a+a.b*a.b),scaleY:l(a.c*a.c+a.d*a.d),skewX:d,skewY:e,rotation:d}},q.matrixToScale=function(a){var b,c,d,e;return a?(b=q.isUndefined(a.a)?1:a.a,e=q.isUndefined(a.d)?1:a.d,c=a.b,d=a.c):b=e=1,{sx:c?l(b*b+c*c):b,sy:d?l(d*d+e*e):e}},q.matrixToRotate=function(a){var b={x:0,y:1};return a&&(b=q.deltaTransformPoint(a,b)),{angle:g.normalizeAngle(g.toDeg(k(b.y,b.x))-90)}},q.matrixToTranslate=function(a){return{tx:a&&a.e||0,ty:a&&a.f||0}},q.isV=function(a){return a instanceof q},q.isVElement=q.isV;var t=q("svg").node;return q.createSVGMatrix=function(a){var b=t.createSVGMatrix();for(var c in a)b[c]=a[c];return b},q.createSVGTransform=function(a){return q.isUndefined(a)?t.createSVGTransform():(a instanceof SVGMatrix||(a=q.createSVGMatrix(a)),t.createSVGTransformFromMatrix(a))},q.createSVGPoint=function(a,b){var c=t.createSVGPoint();return c.x=a,c.y=b,c},q.transformRect=function(a,b){var c=t.createSVGPoint();c.x=a.x,c.y=a.y;var d=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y;var e=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y+a.height;var f=c.matrixTransform(b);c.x=a.x,c.y=a.y+a.height;var h=c.matrixTransform(b),i=m(d.x,e.x,f.x,h.x),j=n(d.x,e.x,f.x,h.x),k=m(d.y,e.y,f.y,h.y),l=n(d.y,e.y,f.y,h.y);return new g.Rect(i,k,j-i,l-k)},q.transformPoint=function(a,b){return new g.Point(q.createSVGPoint(a.x,a.y).matrixTransform(b))},q.transformLine=function(a,b){return new g.Line(q.transformPoint(a.start,b),q.transformPoint(a.end,b))},q.transformPolyline=function(a,b){var c=a instanceof g.Polyline?a.points:a;q.isArray(c)||(c=[]);for(var d=[],e=0,f=c.length;e=e?f?"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"M0,"+f+"A"+f+","+f+" 0 1,0 0,"+-f+"A"+f+","+f+" 0 1,0 0,"+f+"Z":"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z":f?"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L"+f*q+","+f*r+"A"+f+","+f+" 0 "+l+",0 "+f*m+","+f*n+"Z":"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L0,0Z"},q.mergeAttrs=function(a,b){for(var c in b)"class"===c?a[c]=a[c]?a[c]+" "+b[c]:b[c]:"style"===c?q.isObject(a[c])&&q.isObject(b[c])?a[c]=q.mergeAttrs(a[c],b[c]):q.isObject(a[c])?a[c]=q.mergeAttrs(a[c],q.styleToObject(b[c])):q.isObject(b[c])?a[c]=q.mergeAttrs(q.styleToObject(a[c]),b[c]):a[c]=q.mergeAttrs(q.styleToObject(a[c]),q.styleToObject(b[c])):a[c]=b[c];return a},q.annotateString=function(a,b,c){b=b||[],c=c||{};for(var d,e,f,g=c.offset||0,h=[],i=[],j=0;j=m&&j=a.start&&ba.start&&c<=a.end||a.start>=b&&a.end=b?a.end+=c:a.start>=b&&(a.start+=c,a.end+=c)}),a},q.convertLineToPathData=function(a){a=q(a);var b=["M",a.attr("x1"),a.attr("y1"),"L",a.attr("x2"),a.attr("y2")].join(" ");return b},q.convertPolygonToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)+" Z"},q.convertPolylineToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)},q.svgPointsToPath=function(a){for(var b=0,c=a.length;b1&&(z=o(z),d*=z,e*=z);var A=d*d,B=e*e,C=(g==h?-1:1)*o(p((A*B-A*y*y-B*x*x)/(A*y*y+B*x*x))),D=C*d*y/e+(a+i)/2,E=C*-e*x/d+(c+q)/2,F=n(((c-E)/e).toFixed(9)),G=n(((q-E)/e).toFixed(9));F=aG&&(F-=2*j),(!h&&G)>F&&(G-=2*j)}var H=G-F;if(p(H)>t){var I=G,J=i,K=q;G=F+t*((h&&G)>F?1:-1),i=D+d*l(G),q=E+e*k(G),v=b(i,q,d,e,f,0,h,J,K,[G,I,D,E])}H=G-F;var L=l(F),M=k(F),N=l(G),O=k(G),P=m(H/4),Q=4/3*(d*P),R=4/3*(e*P),S=[a,c],T=[a+Q*M,c-R*L],U=[i+Q*O,q-R*N],V=[i,q];if(T[0]=2*S[0]-T[0],T[1]=2*S[1]-T[1],r)return[T,U,V].concat(v);v=[T,U,V].concat(v).join().split(",");for(var W=[],X=v.length,Y=0;Y2&&(c.push([d].concat(f.splice(0,2))),g="l",d="m"===d?"l":"L");f.length>=b[g]&&(c.push([d].concat(f.splice(0,b[g]))),b[g]););}),c}function d(a){if(Array.isArray(a)&&Array.isArray(a&&a[0])||(a=c(a)),!a||!a.length)return[["M",0,0]];for(var b,d=[],e=0,f=0,g=0,h=0,i=0,j=a.length,k=i;k7){a[b].shift();for(var c=a[b];c.length;)i[b]="A",a.splice(b++,0,["C"].concat(c.splice(0,6)));a.splice(b,1),l=g.length}}for(var g=d(c),h={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=[],j="",k="",l=g.length,m=0;m0&&(k=i[m-1])),g[m]=e(g[m],h,k),"A"!==i[m]&&"C"===j&&(i[m]="C"),f(g,m);var n=g[m],o=n.length;h.x=n[o-2],h.y=n[o-1],h.bx=parseFloat(n[o-4])||h.x,h.by=parseFloat(n[o-3])||h.y}return g[0][0]&&"M"===g[0][0]||g.unshift(["M",0,0]),g}var f="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",g=new RegExp("([a-z])["+f+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+f+"]*,?["+f+"]*)+)","ig"),h=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+f+"]*,?["+f+"]*","ig"),i=Math,j=i.PI,k=i.sin,l=i.cos,m=i.tan,n=i.asin,o=i.sqrt,p=i.abs;return function(a){return e(a).join(",").split(",").join(" ")}}(),q.namespace=f,q}(); +var joint={version:"2.1.4",config:{classNamePrefix:"joint-",defaultTheme:"default"},dia:{},ui:{},layout:{},shapes:{},format:{},connectors:{},highlighters:{},routers:{},anchors:{},connectionPoints:{},connectionStrategies:{},linkTools:{},mvc:{views:{}},setTheme:function(a,b){b=b||{},joint.util.invoke(joint.mvc.views,"setTheme",a,b),joint.mvc.View.prototype.defaultTheme=a},env:{_results:{},_tests:{svgforeignobject:function(){return!!document.createElementNS&&/SVGForeignObject/.test({}.toString.call(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")))}},addTest:function(a,b){return joint.env._tests[a]=b},test:function(a){var b=joint.env._tests[a];if(!b)throw new Error('Test not defined ("'+a+'"). Use `joint.env.addTest(name, fn) to add a new test.`');var c=joint.env._results[a];if("undefined"!=typeof c)return c;try{c=b()}catch(a){c=!1}return joint.env._results[a]=c,c}},util:{hashCode:function(a){var b=0;if(0==a.length)return b;for(var c=0;c0){var f=joint.util.getByPath(a,d,c);f&&delete f[e]}else delete a[e];return a},flattenObject:function(a,b,c){b=b||"/";var d={};for(var e in a)if(a.hasOwnProperty(e)){var f="object"==typeof a[e];if(f&&c&&c(a[e])&&(f=!1),f){var g=this.flattenObject(a[e],b,c);for(var h in g)g.hasOwnProperty(h)&&(d[e+b+h]=g[h])}else d[e]=a[e]}return d},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)})},guid:function(a){return this.guid.id=this.guid.id||1,a.id=void 0===a.id?"j_"+this.guid.id++:a.id,a.id},toKebabCase:function(a){return a.replace(/[A-Z]/g,"-$&").toLowerCase()},normalizeEvent:function(a){var b=a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches[0];if(b){for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return a},nextFrame:function(){var a;if("undefined"!=typeof window&&(a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame),!a){var b=0;a=function(a){var c=(new Date).getTime(),d=Math.max(0,16-(c-b)),e=setTimeout(function(){a(c+d)},d);return b=c+d,e}}return function(b,c){return a(c?b.bind(c):b)}}(),cancelFrame:function(){var a,b="undefined"!=typeof window;return b&&(a=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.msCancelRequestAnimationFrame||window.oCancelAnimationFrame||window.oCancelRequestAnimationFrame||window.mozCancelAnimationFrame||window.mozCancelRequestAnimationFrame),a=a||clearTimeout,b?a.bind(window):a}(),shapePerimeterConnectionPoint:function(a,b,c,d){var e,f;if(!c){var g=b.$(".scalable")[0],h=b.$(".rotatable")[0];g&&g.firstChild?c=g.firstChild:h&&h.firstChild&&(c=h.firstChild)}return c?(f=V(c).findIntersection(d,a.paper.viewport),f||(e=V(c).getBBox({target:a.paper.viewport}))):(e=b.model.getBBox(),f=e.intersectionWithLineFromCenterToPoint(d)),f||e.center()},isPercentage:function(a){return joint.util.isString(a)&&"%"===a.slice(-1)},parseCssNumeric:function(a,b){b=b||[];var c={value:parseFloat(a)};if(Number.isNaN(c.value))return null;var d=b.join("|");if(joint.util.isString(a)){var e=new RegExp("(\\d+)("+d+")$").exec(a);if(!e)return null;e[2]&&(c.unit=e[2])}return c},breakText:function(a,b,c,d){d=d||{},c=c||{};var e=b.width,f=b.height,g=d.svgDocument||V("svg").node,h=V("tspan").node,i=V("text").attr(c).append(h).node,j=document.createTextNode("");i.style.opacity=0,i.style.display="block",h.style.display="block",h.appendChild(j),g.appendChild(i),d.svgDocument||document.body.appendChild(g);for(var k,l,m=d.separator||" ",n=d.eol||"\n",o=a.split(m),p=[],q=[],r=0,s=0,t=o.length;r=0)if(u.length>1){for(var v=u.split(n),w=0,x=v.length-1;wf){q.splice(Math.floor(f/l));break}}}}return d.svgDocument?g.removeChild(i):document.body.removeChild(g),q.join(n)},sanitizeHTML:function(a){var b=$($.parseHTML("
"+a+"
",null,!1));return b.find("*").each(function(){var a=this;$.each(a.attributes,function(){var b=this,c=b.name,d=b.value;0!==c.indexOf("on")&&0!==d.indexOf("javascript:")||$(a).removeAttr(c)})}),b.html()},downloadBlob:function(a,b){if(window.navigator.msSaveBlob)window.navigator.msSaveBlob(a,b);else{var c=window.URL.createObjectURL(a),d=document.createElement("a");d.href=c,d.download=b,document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(c)}},downloadDataUri:function(a,b){var c=joint.util.dataUriToBlob(a);joint.util.downloadBlob(c,b)},dataUriToBlob:function(a){a=a.replace(/\s/g,""),a=decodeURIComponent(a);var b,c=a.indexOf(","),d=a.slice(0,c),e=d.split(":")[1].split(";")[0],f=a.slice(c+1);b=d.indexOf("base64")>=0?atob(f):unescape(encodeURIComponent(f));for(var g=new Uint8Array(b.length),h=0;h=1)return 1;var b=a*a,c=b*a;return 4*(a<.5?c:3*(a-b)+c-.75)},exponential:function(a){return Math.pow(2,10*(a-1))},bounce:function(a){for(var b=0,c=1;1;b+=c,c/=2)if(a>=(7-4*b)/11){var d=(11-6*b-11*a)/4;return-d*d+c*c}},reverse:function(a){return function(b){return 1-a(1-b)}},reflect:function(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}},clamp:function(a,b,c){return b=b||0,c=c||1,function(d){var e=a(d);return ec?c:e}},back:function(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}},elastic:function(a){return a||(a=1.5),function(b){return Math.pow(2,10*(b-1))*Math.cos(20*Math.PI*a/3*b)}}},interpolate:{number:function(a,b){var c=b-a;return function(b){return a+c*b}},object:function(a,b){var c=Object.keys(a);return function(d){var e,f,g={};for(e=c.length-1;e!=-1;e--)f=c[e],g[f]=a[f]+(b[f]-a[f])*d;return g}},hexColor:function(a,b){var c=parseInt(a.slice(1),16),d=parseInt(b.slice(1),16),e=255&c,f=(255&d)-e,g=65280&c,h=(65280&d)-g,i=16711680&c,j=(16711680&d)-i;return function(a){var b=e+f*a&255,c=g+h*a&65280,d=i+j*a&16711680;return"#"+(1<<24|b|c|d).toString(16).slice(1)}},unit:function(a,b){var c=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,d=c.exec(a),e=c.exec(b),f=e[1].indexOf("."),g=f>0?e[1].length-f-1:0;a=+d[1];var h=+e[1]-a,i=d[2];return function(b){return(a+h*b).toFixed(g)+i}}},filter:{outline:function(a){var b='',c=Number.isFinite(a.margin)?a.margin:2,d=Number.isFinite(a.width)?a.width:1;return joint.util.template(b)({color:a.color||"blue",opacity:Number.isFinite(a.opacity)?a.opacity:1,outerRadius:c+d,innerRadius:c})},highlight:function(a){var b='';return joint.util.template(b)({color:a.color||"red",width:Number.isFinite(a.width)?a.width:1,blur:Number.isFinite(a.blur)?a.blur:0,opacity:Number.isFinite(a.opacity)?a.opacity:1})},blur:function(a){var b=Number.isFinite(a.x)?a.x:2;return joint.util.template('')({stdDeviation:Number.isFinite(a.y)?[b,a.y]:b})},dropShadow:function(a){var b="SVGFEDropShadowElement"in window?'':'';return joint.util.template(b)({dx:a.dx||0,dy:a.dy||0,opacity:Number.isFinite(a.opacity)?a.opacity:1,color:a.color||"black",blur:Number.isFinite(a.blur)?a.blur:4})},grayscale:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({a:.2126+.7874*(1-b),b:.7152-.7152*(1-b),c:.0722-.0722*(1-b),d:.2126-.2126*(1-b),e:.7152+.2848*(1-b),f:.0722-.0722*(1-b),g:.2126-.2126*(1-b),h:.0722+.9278*(1-b)})},sepia:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({a:.393+.607*(1-b),b:.769-.769*(1-b),c:.189-.189*(1-b),d:.349-.349*(1-b),e:.686+.314*(1-b),f:.168-.168*(1-b),g:.272-.272*(1-b),h:.534-.534*(1-b),i:.131+.869*(1-b)})},saturate:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:1-b})},hueRotate:function(a){return joint.util.template('')({angle:a.angle||0})},invert:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:b,amount2:1-b})},brightness:function(a){return joint.util.template('')({amount:Number.isFinite(a.amount)?a.amount:1})},contrast:function(a){var b=Number.isFinite(a.amount)?a.amount:1;return joint.util.template('')({amount:b,amount2:.5-b/2})}},format:{number:function(a,b,c){function d(a){for(var b=a.length,d=[],e=0,f=c.grouping[0];b>0&&f>0;)d.push(a.substring(b-=f,b+f)),f=c.grouping[e=(e+1)%c.grouping.length];return d.reverse().join(c.thousands)}c=c||{currency:["$",""],decimal:".",thousands:",",grouping:[3]};var e=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,f=e.exec(a),g=f[1]||" ",h=f[2]||">",i=f[3]||"",j=f[4]||"",k=f[5],l=+f[6],m=f[7],n=f[8],o=f[9],p=1,q="",r="",s=!1;switch(n&&(n=+n.substring(1)),(k||"0"===g&&"="===h)&&(k=g="0",h="=",m&&(l-=Math.floor((l-1)/4))),o){case"n":m=!0,o="g";break;case"%":p=100,r="%",o="f";break;case"p":p=100,r="%",o="r";break;case"b":case"o":case"x":case"X":"#"===j&&(q="0"+o.toLowerCase());break;case"c":case"d":s=!0,n=0;break;case"s":p=-1,o="r"}"$"===j&&(q=c.currency[0],r=c.currency[1]),"r"!=o||n||(o="g"),null!=n&&("g"==o?n=Math.max(1,Math.min(21,n)):"e"!=o&&"f"!=o||(n=Math.max(0,Math.min(20,n))));var t=k&&m;if(s&&b%1)return"";var u=b<0||0===b&&1/b<0?(b=-b,"-"):i,v=r;if(p<0){var w=this.prefix(b,n);b=w.scale(b),v=w.symbol+r}else b*=p;b=this.convert(o,b,n);var x=b.lastIndexOf("."),y=x<0?b:b.substring(0,x),z=x<0?"":c.decimal+b.substring(x+1);!k&&m&&c.grouping&&(y=d(y));var A=q.length+y.length+z.length+(t?0:u.length),B=A"===h?B+u+b:"^"===h?B.substring(0,A>>=1)+u+b+B.substring(A):u+(t?b:B+b))+v},string:function(a,b){for(var c,d="{",e=!1,f=[];(c=a.indexOf(d))!==-1;){var g,h,i;if(g=a.slice(0,c),e){h=g.split(":"),i=h.shift().split("."),g=b;for(var j=0;j8?function(a){return a/c}:function(a){return a*c},symbol:a}}),d=0;return a&&(a<0&&(a*=-1),b&&(a=this.round(a,this.precision(a,b))),d=1+Math.floor(1e-12+Math.log(a)/Math.LN10),d=Math.max(-24,Math.min(24,3*Math.floor((d<=0?d+1:d-1)/3)))),c[8+d/3]}},template:function(a){var b=/<%= ([^ ]+) %>|\$\{ ?([^{} ]+) ?\}|\{\{([^{} ]+)\}\}/g;return function(c){return c=c||{},a.replace(b,function(a){for(var b=Array.from(arguments),d=b.slice(1,4).find(function(a){return!!a}),e=d.split("."),f=c[e.shift()];void 0!==f&&e.length;)f=f[e.shift()];return void 0!==f?f:""})}},toggleFullScreen:function(a){function b(a,b){for(var c=["webkit","moz","ms","o",""],d=0;d0&&b[0]||[],e=c>1&&b[c-1]||{};return Array.isArray(d)||(e instanceof joint.dia.Cell?d=b:d instanceof joint.dia.Cell&&(b.length>1&&b.pop(),d=b)),e instanceof joint.dia.Cell&&(e={}),a.call(this,d,e)}}},parseDOMJSON:function(a,b){for(var c={},d=V.namespace.xmlns,e=b||d,f=document.createDocumentFragment(),g=[a,f,e];g.length>0;){e=g.pop();for(var h=g.pop(),i=g.pop(),j=0,k=i.length;j0);return this.stopBatch("clear"),this},_prepareCell:function(a,b){var c;if(a instanceof Backbone.Model?(c=a.attributes,a.graph||b&&b.dry||(a.graph=this)):c=a,!joint.util.isString(c.type))throw new TypeError("dia.Graph: cell type must be a string.");return a},minZIndex:function(){var a=this.get("cells").first();return a?a.get("z")||0:0},maxZIndex:function(){var a=this.get("cells").last();return a?a.get("z")||0:0},addCell:function(a,b){return Array.isArray(a)?this.addCells(a,b):(a instanceof Backbone.Model?a.has("z")||a.set("z",this.maxZIndex()+1):void 0===a.z&&(a.z=this.maxZIndex()+1),this.get("cells").add(this._prepareCell(a,b),b||{}),this)},addCells:function(a,b){return a.length&&(a=joint.util.flattenDeep(a),b.position=a.length,this.startBatch("add"),a.forEach(function(a){b.position--,this.addCell(a,b)},this),this.stopBatch("add")),this},resetCells:function(a,b){var c=joint.util.toArray(a).map(function(a){return this._prepareCell(a,b)},this);return this.get("cells").reset(c,b),this},removeCells:function(a,b){return a.length&&(this.startBatch("remove"),joint.util.invoke(a,"remove",b),this.stopBatch("remove")),this},_removeCell:function(a,b,c){c=c||{},c.clear||(c.disconnectLinks?this.disconnectLinks(a,c):this.removeLinks(a,c)),this.get("cells").remove(a,{silent:!0}),a.graph===this&&(a.graph=null)},getCell:function(a){return this.get("cells").get(a)},getCells:function(){return this.get("cells").toArray()},getElements:function(){return Object.keys(this._nodes).map(this.getCell,this)},getLinks:function(){return Object.keys(this._edges).map(this.getCell,this)},getFirstCell:function(){return this.get("cells").first()},getLastCell:function(){return this.get("cells").last()},getConnectedLinks:function(a,b){b=b||{};var c=b.inbound,d=b.outbound;void 0===c&&void 0===d&&(c=d=!0);var e=[],f={};if(d&&joint.util.forIn(this.getOutboundEdges(a.id),function(a,b){f[b]||(e.push(this.getCell(b)),f[b]=!0)}.bind(this)),c&&joint.util.forIn(this.getInboundEdges(a.id),function(a,b){f[b]||(e.push(this.getCell(b)),f[b]=!0)}.bind(this)),b.deep){var g=a.getEmbeddedCells({deep:!0}),h={};g.forEach(function(a){a.isElement()&&(h[a.id]=!0)}),g.forEach(function(a){a.isLink()||(d&&joint.util.forIn(this.getOutboundEdges(a.id),function(a,c){if(!f[c]){var d=this.getCell(c),g=d.source().id,i=d.target().id;if(!b.includeEnclosed&&g&&h[g]&&i&&h[i])return;e.push(this.getCell(c)),f[c]=!0}}.bind(this)),c&&joint.util.forIn(this.getInboundEdges(a.id),function(a,c){if(!f[c]){var d=this.getCell(c),g=d.source().id,i=d.target().id;if(!b.includeEnclosed&&g&&h[g]&&i&&h[i])return;e.push(this.getCell(c)),f[c]=!0}}.bind(this)))},this)}return e},getNeighbors:function(a,b){b=b||{};var c=b.inbound,d=b.outbound;void 0===c&&void 0===d&&(c=d=!0);var e=this.getConnectedLinks(a,b).reduce(function(e,f){var g=f.source(),h=f.target(),i=f.hasLoop(b);if(c&&joint.util.has(g,"id")&&!e[g.id]){var j=this.getCell(g.id);!i&&(!j||j===a||b.deep&&j.isEmbeddedIn(a))||(e[g.id]=j)}if(d&&joint.util.has(h,"id")&&!e[h.id]){var k=this.getCell(h.id);!i&&(!k||k===a||b.deep&&k.isEmbeddedIn(a))||(e[h.id]=k)}return e}.bind(this),{});return joint.util.toArray(e)},getCommonAncestor:function(){var a=Array.from(arguments).map(function(a){for(var b=[],c=a.get("parent");c;)b.push(c),c=this.getCell(c).get("parent");return b},this);a=a.sort(function(a,b){return a.length-b.length});var b=joint.util.toArray(a.shift()).find(function(b){return a.every(function(a){return a.includes(b)})});return this.getCell(b)},getSuccessors:function(a,b){b=b||{};var c=[];return this.search(a,function(b){b!==a&&c.push(b)},joint.util.assign({},b,{outbound:!0})),c},cloneCells:function(a){a=joint.util.uniq(a);var b=joint.util.toArray(a).reduce(function(a,b){return a[b.id]=b.clone(),a},{});return joint.util.toArray(a).forEach(function(a){var c=b[a.id];if(c.isLink()){var d=c.source(),e=c.target();d.id&&b[d.id]&&c.prop("source/id",b[d.id].id),e.id&&b[e.id]&&c.prop("target/id",b[e.id].id)}var f=a.get("parent");f&&b[f]&&c.set("parent",b[f].id);var g=joint.util.toArray(a.get("embeds")).reduce(function(a,c){return b[c]&&a.push(b[c].id),a},[]);joint.util.isEmpty(g)||c.set("embeds",g)}),b},cloneSubgraph:function(a,b){var c=this.getSubgraph(a,b);return this.cloneCells(c)},getSubgraph:function(a,b){b=b||{};var c=[],d={},e=[],f=[];return joint.util.toArray(a).forEach(function(a){if(d[a.id]||(c.push(a),d[a.id]=a,a.isLink()?f.push(a):e.push(a)),b.deep){var g=a.getEmbeddedCells({deep:!0});g.forEach(function(a){d[a.id]||(c.push(a),d[a.id]=a,a.isLink()?f.push(a):e.push(a))})}}),f.forEach(function(a){var b=a.source(),f=a.target(); if(b.id&&!d[b.id]){var g=this.getCell(b.id);c.push(g),d[g.id]=g,e.push(g)}if(f.id&&!d[f.id]){var h=this.getCell(f.id);c.push(this.getCell(f.id)),d[h.id]=h,e.push(h)}},this),e.forEach(function(a){var e=this.getConnectedLinks(a,b);e.forEach(function(a){var b=a.source(),e=a.target();!d[a.id]&&b.id&&d[b.id]&&e.id&&d[e.id]&&(c.push(a),d[a.id]=a)})},this),c},getPredecessors:function(a,b){b=b||{};var c=[];return this.search(a,function(b){b!==a&&c.push(b)},joint.util.assign({},b,{inbound:!0})),c},search:function(a,b,c){c=c||{},c.breadthFirst?this.bfs(a,b,c):this.dfs(a,b,c)},bfs:function(a,b,c){c=c||{};var d={},e={},f=[];for(f.push(a),e[a.id]=0;f.length>0;){var g=f.shift();if(!d[g.id]){if(d[g.id]=!0,b(g,e[g.id])===!1)return;this.getNeighbors(g,c).forEach(function(a){e[a.id]=e[g.id]+1,f.push(a)})}}},dfs:function(a,b,c,d,e){c=c||{};var f=d||{},g=e||0;b(a,g)!==!1&&(f[a.id]=!0,this.getNeighbors(a,c).forEach(function(a){f[a.id]||this.dfs(a,b,c,f,g+1)},this))},getSources:function(){var a=[];return joint.util.forIn(this._nodes,function(b,c){this._in[c]&&!joint.util.isEmpty(this._in[c])||a.push(this.getCell(c))}.bind(this)),a},getSinks:function(){var a=[];return joint.util.forIn(this._nodes,function(b,c){this._out[c]&&!joint.util.isEmpty(this._out[c])||a.push(this.getCell(c))}.bind(this)),a},isSource:function(a){return!this._in[a.id]||joint.util.isEmpty(this._in[a.id])},isSink:function(a){return!this._out[a.id]||joint.util.isEmpty(this._out[a.id])},isSuccessor:function(a,b){var c=!1;return this.search(a,function(d){if(d===b&&d!==a)return c=!0,!1},{outbound:!0}),c},isPredecessor:function(a,b){var c=!1;return this.search(a,function(d){if(d===b&&d!==a)return c=!0,!1},{inbound:!0}),c},isNeighbor:function(a,b,c){c=c||{};var d=c.inbound,e=c.outbound;void 0===d&&void 0===e&&(d=e=!0);var f=!1;return this.getConnectedLinks(a,c).forEach(function(a){var c=a.source(),g=a.target();return d&&joint.util.has(c,"id")&&c.id===b.id?(f=!0,!1):e&&joint.util.has(g,"id")&&g.id===b.id?(f=!0,!1):void 0}),f},disconnectLinks:function(a,b){this.getConnectedLinks(a).forEach(function(c){c.set(c.source().id===a.id?"source":"target",{x:0,y:0},b)})},removeLinks:function(a,b){joint.util.invoke(this.getConnectedLinks(a),"remove",b)},findModelsFromPoint:function(a){return this.getElements().filter(function(b){return b.getBBox().containsPoint(a)})},findModelsInArea:function(a,b){a=g.rect(a),b=joint.util.defaults(b||{},{strict:!1});var c=b.strict?"containsRect":"intersect";return this.getElements().filter(function(b){return a[c](b.getBBox())})},findModelsUnderElement:function(a,b){b=joint.util.defaults(b||{},{searchBy:"bbox"});var c=a.getBBox(),d="bbox"===b.searchBy?this.findModelsInArea(c):this.findModelsFromPoint(c[b.searchBy]());return d.filter(function(b){return a.id!==b.id&&!b.isEmbeddedIn(a)})},getBBox:function(a,b){return this.getCellsBBox(a||this.getElements(),b)},getCellsBBox:function(a,b){return joint.util.toArray(a).reduce(function(a,c){return c.isLink()?a:a?a.union(c.getBBox(b)):c.getBBox(b)},null)},translate:function(a,b,c){var d=this.getCells().filter(function(a){return!a.isEmbedded()});return joint.util.invoke(d,"translate",a,b,c),this},resize:function(a,b,c){return this.resizeCells(a,b,this.getCells(),c)},resizeCells:function(a,b,c,d){var e=this.getCellsBBox(c);if(e){var f=Math.max(a/e.width,0),g=Math.max(b/e.height,0);joint.util.invoke(c,"scale",f,g,e.origin(),d)}return this},startBatch:function(a,b){return b=b||{},this._batches[a]=(this._batches[a]||0)+1,this.trigger("batch:start",joint.util.assign({},b,{batchName:a}))},stopBatch:function(a,b){return b=b||{},this._batches[a]=(this._batches[a]||0)-1,this.trigger("batch:stop",joint.util.assign({},b,{batchName:a}))},hasActiveBatch:function(a){return 0===arguments.length?joint.util.toArray(this._batches).some(function(a){return a>0}):Array.isArray(a)?a.some(function(a){return!!this._batches[a]},this):!!this._batches[a]}},{validations:{multiLinks:function(a,b){var c=b.source(),d=b.target();if(c.id&&d.id){var e=b.getSourceElement();if(e){var f=a.getConnectedLinks(e,{outbound:!0}),g=f.filter(function(a){var b=a.source(),e=a.target();return b&&b.id===c.id&&(!b.port||b.port===c.port)&&e&&e.id===d.id&&(!e.port||e.port===d.port)});if(g.length>1)return!1}}return!0},linkPinning:function(a,b){return b.source().id&&b.target().id}}}),joint.util.wrapWith(joint.dia.Graph.prototype,["resetCells","addCells","removeCells"],"cells"),function(a,b,c,d,e){function f(a,b){return function(c,d){var f=e.isPercentage(c);c=parseFloat(c),f&&(c/=100);var g={};if(isFinite(c)){var h=f||c>=0&&c<=1?c*d[b]:Math.max(c+d[b],0);g[a]=h}return g}}function g(a,b,d){return function(f,g){var h=e.isPercentage(f);f=parseFloat(f),h&&(f/=100);var i;if(isFinite(f)){var j=g[d]();i=h||f>0&&f<1?j[a]+g[b]*f:j[a]+f}var k=c.Point();return k[a]=i||0,k}}function h(a,b,d){return function(f,g){var h;h="middle"===f?g[b]/2:f===d?g[b]:isFinite(f)?f>-1&&f<1?-g[b]*f:-f:e.isPercentage(f)?g[b]*parseFloat(f)/100:0;var i=c.Point();return i[a]=-(g[a]+h),i}}function i(a,b){var c="joint-shape",e=b&&b.resetOffset;return function(b,f,g){var h=d(g),i=h.data(c);if(!i||i.value!==b){var j=a(b);i={value:b,shape:j,shapeBBox:j.bbox()},h.data(c,i)}var k=i.shape.clone(),l=i.shapeBBox.clone(),m=l.origin(),n=f.origin();l.x=n.x,l.y=n.y;var o=f.maxRectScaleToFit(l,n),p=0===l.width||0===f.width?1:o.sx,q=0===l.height||0===f.height?1:o.sy;return k.scale(p,q,m),e&&k.translate(-m.x,-m.y),k}}function j(a){function d(a){return new c.Path(b.normalizePathData(a))}var e=i(d,a);return function(a,b,c){var d=e(a,b,c);return{d:d.serialize()}}}function k(a){var b=i(c.Polyline,a);return function(a,c,d){var e=b(a,c,d);return{points:e.serialize()}}}function l(a,b){var d=new c.Point(1,0);return function(c){var e,f,g=this[a](c);return g?(f=b.rotate?g.vector().vectorAngle(d):0,e=g.start):(e=this.path.start,f=0),0===f?{transform:"translate("+e.x+","+e.y+")"}:{transform:"translate("+e.x+","+e.y+") rotate("+f+")"}}}function m(a,b,c){return void 0!==c.text}function n(){return this instanceof a.dia.LinkView}function o(a){var b={},c=a.stroke;"string"==typeof c&&(b.stroke=c,b.fill=c);var d=a.strokeOpacity;return void 0===d&&(d=a["stroke-opacity"]),void 0===d&&(d=a.opacity),void 0!==d&&(b["stroke-opacity"]=d,b["fill-opacity"]=d),b}var p=a.dia.attributes={xlinkHref:{set:"xlink:href"},xlinkShow:{set:"xlink:show"},xlinkRole:{set:"xlink:role"},xlinkType:{set:"xlink:type"},xlinkArcrole:{set:"xlink:arcrole"},xlinkTitle:{set:"xlink:title"},xlinkActuate:{set:"xlink:actuate"},xmlSpace:{set:"xml:space"},xmlBase:{set:"xml:base"},xmlLang:{set:"xml:lang"},preserveAspectRatio:{set:"preserveAspectRatio"},requiredExtension:{set:"requiredExtension"},requiredFeatures:{set:"requiredFeatures"},systemLanguage:{set:"systemLanguage"},externalResourcesRequired:{set:"externalResourceRequired"},filter:{qualify:e.isPlainObject,set:function(a){return"url(#"+this.paper.defineFilter(a)+")"}},fill:{qualify:e.isPlainObject,set:function(a){return"url(#"+this.paper.defineGradient(a)+")"}},stroke:{qualify:e.isPlainObject,set:function(a){return"url(#"+this.paper.defineGradient(a)+")"}},sourceMarker:{qualify:e.isPlainObject,set:function(a,b,c,d){return a=e.assign(o(d),a),{"marker-start":"url(#"+this.paper.defineMarker(a)+")"}}},targetMarker:{qualify:e.isPlainObject,set:function(a,b,c,d){return a=e.assign(o(d),{transform:"rotate(180)"},a),{"marker-end":"url(#"+this.paper.defineMarker(a)+")"}}},vertexMarker:{qualify:e.isPlainObject,set:function(a,b,c,d){return a=e.assign(o(d),a),{"marker-mid":"url(#"+this.paper.defineMarker(a)+")"}}},text:{qualify:function(a,b,c){return!c.textWrap||!e.isPlainObject(c.textWrap)},set:function(c,f,g,h){var i=d(g),j="joint-text",k=i.data(j),l=a.util.pick(h,"lineHeight","annotations","textPath","x","textVerticalAnchor","eol"),m=l.fontSize=h["font-size"]||h.fontSize,n=JSON.stringify([c,l]);if(void 0===k||k!==n){m&&g.setAttribute("font-size",m);var o=l.textPath;if(e.isObject(o)){var p=o.selector;if("string"==typeof p){var q=this.findBySelector(p)[0];q instanceof SVGPathElement&&(l.textPath=e.assign({"xlink:href":"#"+q.id},o))}}b(g).text(""+c,l),i.data(j,n)}}},textWrap:{qualify:e.isPlainObject,set:function(b,c,d,f){var g=b.width||0;e.isPercentage(g)?c.width*=parseFloat(g)/100:g<=0?c.width+=g:c.width=g;var h=b.height||0;e.isPercentage(h)?c.height*=parseFloat(h)/100:h<=0?c.height+=h:c.height=h;var i,j=b.text;void 0===j&&(j=f.text),i=void 0!==j?a.util.breakText(""+j,c,{"font-weight":f["font-weight"]||f.fontWeight,"font-size":f["font-size"]||f.fontSize,"font-family":f["font-family"]||f.fontFamily,lineHeight:f.lineHeight},{svgDocument:this.paper.svg}):"",a.dia.attributes.text.set.call(this,i,c,d,f)}},title:{qualify:function(a,b){return b instanceof SVGElement},set:function(a,b,c){var e=d(c),f="joint-title",g=e.data(f);if(void 0===g||g!==a){e.data(f,a);var h=c.firstChild;if(h&&"TITLE"===h.tagName.toUpperCase())h.textContent=a;else{var i=document.createElementNS(c.namespaceURI,"title");i.textContent=a,c.insertBefore(i,h)}}}},lineHeight:{qualify:m},textVerticalAnchor:{qualify:m},textPath:{qualify:m},annotations:{qualify:m},port:{set:function(a){return null===a||void 0===a.id?a:a.id}},style:{qualify:e.isPlainObject,set:function(a,b,c){d(c).css(a)}},html:{set:function(a,b,c){d(c).html(a+"")}},ref:{},refX:{position:g("x","width","origin")},refY:{position:g("y","height","origin")},refDx:{position:g("x","width","corner")},refDy:{position:g("y","height","corner")},refWidth:{set:f("width","width")},refHeight:{set:f("height","height")},refRx:{set:f("rx","width")},refRy:{set:f("ry","height")},refRInscribed:{set:function(a){var b=f(a,"width"),c=f(a,"height");return function(a,d){var e=d.height>d.width?b:c;return e(a,d)}}("r")},refRCircumscribed:{set:function(a,b){var c=e.isPercentage(a);a=parseFloat(a),c&&(a/=100);var d,f=Math.sqrt(b.height*b.height+b.width*b.width);return isFinite(a)&&(d=c||a>=0&&a<=1?a*f:Math.max(a+f,0)),{r:d}}},refCx:{set:f("cx","width")},refCy:{set:f("cy","height")},xAlignment:{offset:h("x","width","right")},yAlignment:{offset:h("y","height","bottom")},resetOffset:{offset:function(a,b){return a?{x:-b.x,y:-b.y}:{x:0,y:0}}},refDResetOffset:{set:j({resetOffset:!0})},refDKeepOffset:{set:j({resetOffset:!1})},refPointsResetOffset:{set:k({resetOffset:!0})},refPointsKeepOffset:{set:k({resetOffset:!1})},connection:{qualify:n,set:function(){return{d:this.getSerializedConnection()}}},atConnectionLengthKeepGradient:{qualify:n,set:l("getTangentAtLength",{rotate:!0})},atConnectionLengthIgnoreGradient:{qualify:n,set:l("getTangentAtLength",{rotate:!1})},atConnectionRatioKeepGradient:{qualify:n,set:l("getTangentAtRatio",{rotate:!0})},atConnectionRatioIgnoreGradient:{qualify:n,set:l("getTangentAtRatio",{rotate:!1})}};p.refR=p.refRInscribed,p.refD=p.refDResetOffset,p.refPoints=p.refPointsResetOffset,p.atConnectionLength=p.atConnectionLengthKeepGradient,p.atConnectionRatio=p.atConnectionRatioKeepGradient,p.refX2=p.refX,p.refY2=p.refY,p["ref-x"]=p.refX,p["ref-y"]=p.refY,p["ref-dy"]=p.refDy,p["ref-dx"]=p.refDx,p["ref-width"]=p.refWidth,p["ref-height"]=p.refHeight,p["x-alignment"]=p.xAlignment,p["y-alignment"]=p.yAlignment}(joint,V,g,$,joint.util),function(a,b){var c=a.mvc.View.extend({name:null,tagName:"g",className:"tool",svgElement:!0,_visible:!0,init:function(){var a=this.name;a&&this.vel.attr("data-tool-name",a)},configure:function(a,b){return this.relatedView=a,this.paper=a.paper,this.parentView=b,this.simulateRelatedView(this.el),this},simulateRelatedView:function(a){a&&a.setAttribute("model-id",this.relatedView.model.id)},getName:function(){return this.name},show:function(){this.el.style.display="",this._visible=!0},hide:function(){this.el.style.display="none",this._visible=!1},isVisible:function(){return!!this._visible},focus:function(){var a=this.options.focusOpacity;isFinite(a)&&(this.el.style.opacity=a),this.parentView.focusTool(this)},blur:function(){this.el.style.opacity="",this.parentView.blurTool(this)},update:function(){}}),d=a.mvc.View.extend({tagName:"g",className:"tools",svgElement:!0,tools:null,options:{tools:null,relatedView:null,name:null,component:!1},configure:function(d){d=b.assign(this.options,d);var e=d.tools;if(!Array.isArray(e))return this;var f=d.relatedView;if(!(f instanceof a.dia.CellView))return this;for(var g=this.tools=[],h=0,i=e.length;h0;){var d=c.shift();b.push(d),c.push.apply(c,d.getEmbeddedCells())}}else b=this.getEmbeddedCells(),b.forEach(function(c){b.push.apply(b,c.getEmbeddedCells(a))});else b=joint.util.toArray(this.get("embeds")).map(this.graph.getCell,this.graph);return b}return[]},isEmbeddedIn:function(a,b){var c=joint.util.isString(a)?a:a.id,d=this.parent();if(b=joint.util.defaults({deep:!0},b),this.graph&&b.deep){for(;d;){if(d===c)return!0;d=this.graph.getCell(d).parent()}return!1}return d===c},isEmbedded:function(){return!!this.parent()},clone:function(a){if(a=a||{},a.deep)return joint.util.toArray(joint.dia.Graph.prototype.cloneCells.call(null,[this].concat(this.getEmbeddedCells({deep:!0}))));var b=Backbone.Model.prototype.clone.apply(this,arguments);return b.set("id",joint.util.uuid()),b.unset("embeds"),b.unset("parent"),b},prop:function(a,b,c){var d="/",e=joint.util.isString(a);if(e||Array.isArray(a)){if(arguments.length>1){var f,g;e?(f=a,g=f.split("/")):(f=a.join(d),g=a.slice());var h=g[0],i=g.length;if(c=c||{},c.propertyPath=f,c.propertyValue=b,c.propertyPathArray=g,1===i)return this.set(h,b,c);for(var j={},k=j,l=h,m=1;m0)},getSelector:function(a,b){var c;if(a===this.el)return"string"==typeof b&&(c="> "+b),c;if(a){var d=V(a).index()+1;c=a.tagName+":nth-child("+d+")",b&&(c+=" > "+b),c=this.getSelector(a.parentNode,c)}return c},getLinkEnd:function(a,b,c,d,e){var f=this.model,h=f.id,i=this.findAttribute("port",a),j=a.getAttribute("joint-selector"),k={id:h};null!=j&&(k.magnet=j),null!=i?(k.port=i,f.hasPort(i)||j||(k.selector=this.getSelector(a))):null==j&&this.el!==a&&(k.selector=this.getSelector(a));var l=this.paper,m=l.options.connectionStrategy;if("function"==typeof m){var n=m.call(l,k,this,a,new g.Point(b,c),d,e);n&&(k=n)}return k},getMagnetFromLinkEnd:function(a){var b,c=this.el,d=a.port,e=a.magnet;return null!=d&&this.model.hasPort(d)?b=this.findPortNode(d,e)||c:(e||(e=a.selector),e||null==d||(e='[port="'+d+'"]'),b=this.findBySelector(e,c,this.selectors)[0]),b},findAttribute:function(a,b){if(!b)return null;var c=b.getAttribute(a);if(null===c){if(b===this.el)return null;for(var d=b.parentNode;d&&d!==this.el&&1===d.nodeType&&(c=d.getAttribute(a),null===c);)d=d.parentNode}return c},getAttributeDefinition:function(a){return this.model.constructor.getAttributeDefinition(a)},setNodeAttributes:function(a,b){joint.util.isEmpty(b)||(a instanceof SVGElement?V(a).attr(b):$(a).attr(b))},processNodeAttributes:function(a,b){var c,d,e,f,g,h,i,j,k,l=[];for(c in b)b.hasOwnProperty(c)&&(d=b[c],e=this.getAttributeDefinition(c),!e||joint.util.isFunction(e.qualify)&&!e.qualify.call(this,d,a,b)?(h||(h={}),h[joint.util.toKebabCase(c)]=d):(joint.util.isString(e.set)&&(h||(h={}),h[e.set]=d),null!==d&&l.push(c,e)));for(f=0,g=l.length;f0&&x.height>0){var y=V.transformRect(a.getBBox(),p).scale(1/r,1/s);for(e in m)f=m[e],h=this.getAttributeDefinition(e),t=h.offset.call(this,f,y,a,i),t&&(q.offset(g.Point(t).scale(r,s)),w||(w=!0))}}(void 0!==o||v||w)&&(q.round(1),p.e=q.x,p.f=q.y,a.setAttribute("transform",V.matrixToTransformString(p)))},getNodeScale:function(a,b){var c,d;if(b&&b.contains(a)){var e=b.scale();c=1/e.sx,d=1/e.sy}else c=1,d=1;return{sx:c,sy:d}},findNodesAttributes:function(a,b,c,d){var e={};for(var f in a)if(a.hasOwnProperty(f))for(var g=c[f]=this.findBySelector(f,b,d),h=0,i=g.length;h-1?l.splice(t,0,d):l.push(d)}else this.setNodeAttributes(e,i.normal);for(var u=0,v=l.length;u0){this.startBatch("fit-embeds",a),a.deep&&joint.util.invoke(b,"fitEmbeds",a);var c=this.graph.getCellsBBox(b),d=joint.util.normalizeSides(a.padding);c.moveAndExpand({x:-d.left,y:-d.top,width:d.right+d.left,height:d.bottom+d.top}),this.set({position:{x:c.x,y:c.y},size:{width:c.width,height:c.height}},a),this.stopBatch("fit-embeds")}return this},rotate:function(a,b,c,d){if(c){var e=this.getBBox().center(),f=this.get("size"),g=this.get("position");e.rotate(c,this.get("angle")-a);var h=e.x-f.width/2-g.x,i=e.y-f.height/2-g.y;this.startBatch("rotate",{angle:a,absolute:b,origin:c}),this.position(g.x+h,g.y+i,d),this.rotate(a,b,null,d),this.stopBatch("rotate")}else this.set("angle",b?a:(this.get("angle")+a)%360,d);return this},angle:function(){return g.normalizeAngle(this.get("angle")||0)},getBBox:function(a){if(a=a||{},a.deep&&this.graph){var b=this.getEmbeddedCells({deep:!0,breadthFirst:!0});return b.push(this),this.graph.getCellsBBox(b)}var c=this.get("position"),d=this.get("size");return new g.Rect(c.x,c.y,d.width,d.height)}}),joint.dia.ElementView=joint.dia.CellView.extend({_removePorts:function(){},_renderPorts:function(){},className:function(){var a=joint.dia.CellView.prototype.className.apply(this).split(" ");return a.push("element"),a.join(" ")},metrics:null,initialize:function(){joint.dia.CellView.prototype.initialize.apply(this,arguments);var a=this.model;this.listenTo(a,"change:position",this.translate),this.listenTo(a,"change:size",this.resize),this.listenTo(a,"change:angle",this.rotate),this.listenTo(a,"change:markup",this.render),this._initializePorts(),this.metrics={}},_initializePorts:function(){},update:function(a,b){this.metrics={},this._removePorts();var c=this.model,d=c.attr();this.updateDOMSubtreeAttributes(this.el,d,{rootBBox:new g.Rect(c.size()),selectors:this.selectors,scalableNode:this.scalableNode,rotatableNode:this.rotatableNode,roAttributes:b===d?null:b}),this._renderPorts()},rotatableSelector:"rotatable",scalableSelector:"scalable",scalableNode:null,rotatableNode:null,renderMarkup:function(){var a=this.model,b=a.get("markup")||a.markup;if(!b)throw new Error("dia.ElementView: markup required");if(Array.isArray(b))return this.renderJSONMarkup(b);if("string"==typeof b)return this.renderStringMarkup(b);throw new Error("dia.ElementView: invalid markup")},renderJSONMarkup:function(a){var b=joint.util.parseDOMJSON(a),c=this.selectors=b.selectors,d=this.selector;if(c[d])throw new Error("dia.ElementView: ambiguous root selector.");c[d]=this.el,this.rotatableNode=V(c[this.rotatableSelector])||null,this.scalableNode=V(c[this.scalableSelector])||null,this.vel.append(b.fragment)},renderStringMarkup:function(a){var b=this.vel;b.append(V(a)),this.rotatableNode=b.findOne(".rotatable"),this.scalableNode=b.findOne(".scalable");var c=this.selectors={};c[this.selector]=this.el},render:function(){return this.vel.empty(),this.renderMarkup(),this.scalableNode&&this.update(),this.resize(),this.rotatableNode?(this.rotate(),this.translate(),this):(this.updateTransformation(),this)},resize:function(){return this.scalableNode?this.sgResize.apply(this,arguments):(this.model.attributes.angle&&this.rotate(),void this.update())},translate:function(){return this.rotatableNode?this.rgTranslate():void this.updateTransformation()},rotate:function(){return this.rotatableNode?this.rgRotate():void this.updateTransformation()},updateTransformation:function(){var a=this.getTranslateString(),b=this.getRotateString();b&&(a+=" "+b),this.vel.attr("transform",a)},getTranslateString:function(){var a=this.model.attributes.position;return"translate("+a.x+","+a.y+")"},getRotateString:function(){var a=this.model.attributes,b=a.angle;if(!b)return null;var c=a.size;return"rotate("+b+","+c.width/2+","+c.height/2+")"},getBBox:function(a){var b;if(a&&a.useModelGeometry){var c=this.model;b=c.getBBox().bbox(c.angle())}else b=this.getNodeBBox(this.el);return this.paper.localToPaperRect(b)},nodeCache:function(a){var b=V.ensureId(a),c=this.metrics[b];return c||(c=this.metrics[b]={}),c},getNodeData:function(a){var b=this.nodeCache(a);return b.data||(b.data={}),b.data},getNodeBBox:function(a){var b=this.getNodeBoundingRect(a),c=this.getNodeMatrix(a),d=this.getRootTranslateMatrix(),e=this.getRootRotateMatrix();return V.transformRect(b,d.multiply(e).multiply(c))},getNodeBoundingRect:function(a){var b=this.nodeCache(a);return void 0===b.boundingRect&&(b.boundingRect=V(a).getBBox()),new g.Rect(b.boundingRect)},getNodeUnrotatedBBox:function(a){var b=this.getNodeBoundingRect(a),c=this.getNodeMatrix(a),d=this.getRootTranslateMatrix();return V.transformRect(b,d.multiply(c))},getNodeShape:function(a){var b=this.nodeCache(a);return void 0===b.geometryShape&&(b.geometryShape=V(a).toGeometryShape()),b.geometryShape.clone()},getNodeMatrix:function(a){var b=this.nodeCache(a);if(void 0===b.magnetMatrix){var c=this.rotatableNode||this.el;b.magnetMatrix=V(a).getTransformToElement(c)}return V.createSVGMatrix(b.magnetMatrix)},getRootTranslateMatrix:function(){var a=this.model,b=a.position(),c=V.createSVGMatrix().translate(b.x,b.y);return c},getRootRotateMatrix:function(){var a=V.createSVGMatrix(),b=this.model,c=b.angle();if(c){var d=b.getBBox(),e=d.width/2,f=d.height/2;a=a.translate(e,f).rotate(c).translate(-e,-f)}return a},rgRotate:function(){this.rotatableNode.attr("transform",this.getRotateString())},rgTranslate:function(){this.vel.attr("transform",this.getTranslateString())},sgResize:function(a,b,c){var d=this.model,e=d.get("angle")||0,f=d.get("size")||{width:1,height:1},g=this.scalableNode,h=!1;g.node.getElementsByTagName("path").length>0&&(h=!0);var i=g.getBBox({recursive:h}),j=f.width/(i.width||1),k=f.height/(i.height||1);g.attr("transform","scale("+j+","+k+")");var l=this.rotatableNode,m=l&&l.attr("transform");if(m&&null!==m){l.attr("transform",m+" rotate("+-e+","+f.width/2+","+f.height/2+")");var n=g.getBBox({target:this.paper.viewport});d.set("position",{x:n.x,y:n.y},c),this.rotate()}this.update()},prepareEmbedding:function(a){a||(a={});var b=a.model||this.model,c=a.paper||this.paper,d=c.model;b.startBatch("to-front"),b.toFront({deep:!0,ui:!0});var e=d.get("cells").max("z").get("z"),f=d.getConnectedLinks(b,{deep:!0,includeEnclosed:!0});joint.util.invoke(f,"set","z",e+1,{ui:!0}),b.stopBatch("to-front");var g=b.parent();g&&d.getCell(g).unembed(b,{ui:!0})},processEmbedding:function(a){a||(a={});var b=a.model||this.model,c=a.paper||this.paper,d=c.options,e=[];if(joint.util.isFunction(d.findParentBy)){var f=joint.util.toArray(d.findParentBy.call(c.model,this));e=f.filter(function(a){return a instanceof joint.dia.Cell&&this.model.id!==a.id&&!a.isEmbeddedIn(this.model)}.bind(this))}else e=c.model.findModelsUnderElement(b,{searchBy:d.findParentBy});d.frontParentOnly&&(e=e.slice(-1));for(var g=null,h=a.candidateEmbedView,i=e.length-1;i>=0;i--){var j=e[i];if(h&&h.model.id==j.id){g=h;break}var k=j.findView(c);if(d.validateEmbedding.call(c,this,k)){g=k;break}}g&&g!=h&&(this.clearEmbedding(a),a.candidateEmbedView=g.highlight(null,{embedding:!0})),!g&&h&&this.clearEmbedding(a)},clearEmbedding:function(a){a||(a={});var b=a.candidateEmbedView;b&&(b.unhighlight(null,{embedding:!0}),a.candidateEmbedView=null)},finalizeEmbedding:function(a){a||(a={});var b=a.candidateEmbedView,c=a.model||this.model,d=a.paper||this.paper;b&&(b.model.embed(c,{ui:!0}),b.unhighlight(null,{embedding:!0}),a.candidateEmbedView=null),joint.util.invoke(d.model.getConnectedLinks(c,{deep:!0}),"reparent",{ui:!0})},pointerdblclick:function(a,b,c){joint.dia.CellView.prototype.pointerdblclick.apply(this,arguments),this.notify("element:pointerdblclick",a,b,c)},pointerclick:function(a,b,c){joint.dia.CellView.prototype.pointerclick.apply(this,arguments),this.notify("element:pointerclick",a,b,c)},contextmenu:function(a,b,c){joint.dia.CellView.prototype.contextmenu.apply(this,arguments),this.notify("element:contextmenu",a,b,c)},pointerdown:function(a,b,c){joint.dia.CellView.prototype.pointerdown.apply(this,arguments),this.notify("element:pointerdown",a,b,c),this.dragStart(a,b,c)},pointermove:function(a,b,c){var d=this.eventData(a);switch(d.action){case"move":this.drag(a,b,c);break;case"magnet":this.dragMagnet(a,b,c)}d.stopPropagation||(joint.dia.CellView.prototype.pointermove.apply(this,arguments),this.notify("element:pointermove",a,b,c)),this.eventData(a,d)},pointerup:function(a,b,c){var d=this.eventData(a);switch(d.action){case"move":this.dragEnd(a,b,c);break;case"magnet":return void this.dragMagnetEnd(a,b,c)}d.stopPropagation||(this.notify("element:pointerup",a,b,c),joint.dia.CellView.prototype.pointerup.apply(this,arguments))},mouseover:function(a){joint.dia.CellView.prototype.mouseover.apply(this,arguments),this.notify("element:mouseover",a)},mouseout:function(a){joint.dia.CellView.prototype.mouseout.apply(this,arguments),this.notify("element:mouseout",a)},mouseenter:function(a){joint.dia.CellView.prototype.mouseenter.apply(this,arguments),this.notify("element:mouseenter",a)},mouseleave:function(a){joint.dia.CellView.prototype.mouseleave.apply(this,arguments),this.notify("element:mouseleave",a)},mousewheel:function(a,b,c,d){joint.dia.CellView.prototype.mousewheel.apply(this,arguments),this.notify("element:mousewheel",a,b,c,d)},onmagnet:function(a,b,c){this.dragMagnetStart(a,b,c);var d=this.eventData(a).stopPropagation;d&&a.stopPropagation()},dragStart:function(a,b,c){this.can("elementMove")&&this.eventData(a,{action:"move",x:b,y:c,restrictedArea:this.paper.getRestrictedArea(this)})},dragMagnetStart:function(a,b,c){if(this.can("addLinkFromMagnet")){this.model.startBatch("add-link");var d=this.paper,e=d.model,f=a.target,g=d.getDefaultLink(this,f),h=this.getLinkEnd(f,b,c,g,"source"),i={x:b,y:c};g.set({source:h,target:i}),g.addTo(e,{async:!1,ui:!0});var j=g.findView(d);joint.dia.CellView.prototype.pointerdown.apply(j,arguments),j.notify("link:pointerdown",a,b,c);var k=j.startArrowheadMove("target",{whenNotAllowed:"remove"});j.eventData(a,k),this.eventData(a,{action:"magnet",linkView:j,stopPropagation:!0}),this.paper.delegateDragEvents(this,a.data)}},drag:function(a,b,c){var d=this.paper,e=d.options.gridSize,f=this.model,h=f.position(),i=this.eventData(a),j=g.snapToGrid(h.x,e)-h.x+g.snapToGrid(b-i.x,e),k=g.snapToGrid(h.y,e)-h.y+g.snapToGrid(c-i.y,e);f.translate(j,k,{restrictedArea:i.restrictedArea,ui:!0});var l=!!i.embedding;d.options.embeddingMode&&(l||(this.prepareEmbedding(i),l=!0),this.processEmbedding(i)),this.eventData(a,{x:g.snapToGrid(b,e),y:g.snapToGrid(c,e),embedding:l})},dragMagnet:function(a,b,c){var d=this.eventData(a),e=d.linkView;e&&e.pointermove(a,b,c)},dragEnd:function(a,b,c){var d=this.eventData(a);d.embedding&&this.finalizeEmbedding(d)},dragMagnetEnd:function(a,b,c){var d=this.eventData(a),e=d.linkView;e&&e.pointerup(a,b,c),this.model.stopBatch("add-link")}}),joint.dia.Link=joint.dia.Cell.extend({markup:['','','','','','','',''].join(""),toolMarkup:['','','','',"Remove link.","",'','','',"Link options.","",""].join(""),doubleToolMarkup:void 0,vertexMarkup:['','','','',"Remove vertex.","",""].join(""),arrowheadMarkup:['','',""].join(""),defaultLabel:void 0,labelMarkup:void 0,_builtins:{defaultLabel:{markup:[{tagName:"rect",selector:"rect"},{tagName:"text",selector:"text"}],attrs:{text:{fill:"#000000",fontSize:14,textAnchor:"middle",yAlignment:"middle",pointerEvents:"none"},rect:{ref:"text",fill:"#ffffff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}}},defaults:{type:"link",source:{},target:{}},isLink:function(){return!0},disconnect:function(a){return this.set({source:{x:0,y:0},target:{x:0,y:0}},a)},source:function(a,b,c){if(void 0===a)return joint.util.clone(this.get("source"));var d,e,f=a instanceof joint.dia.Cell;if(f)return d=joint.util.clone(b)||{},d.id=a.id,e=c,this.set("source",d,e);var h=a instanceof g.Point;return h?(d=joint.util.clone(b)||{},d.x=a.x,d.y=a.y,e=c,this.set("source",d,e)):(d=a,e=b,this.set("source",d,e))},target:function(a,b,c){if(void 0===a)return joint.util.clone(this.get("target"));var d,e,f=a instanceof joint.dia.Cell;if(f)return d=joint.util.clone(b)||{},d.id=a.id,e=c,this.set("target",d,e);var h=a instanceof g.Point;return h?(d=joint.util.clone(b)||{},d.x=a.x,d.y=a.y,e=c,this.set("target",d,e)):(d=a,e=b,this.set("target",d,e))},router:function(a,b,c){if(void 0===a){var d=this.get("router");return d?"object"==typeof d?joint.util.clone(d):d:this.get("manhattan")?{name:"orthogonal"}:null}var e="object"==typeof a||"function"==typeof a,f=e?a:{name:a,args:b},g=e?b:c;return this.set("router",f,g)},connector:function(a,b,c){if(void 0===a){var d=this.get("connector");return d?"object"==typeof d?joint.util.clone(d):d:this.get("smooth")?{name:"smooth"}:null}var e="object"==typeof a||"function"==typeof a,f=e?a:{name:a,args:b},g=e?b:c;return this.set("connector",f,g)},label:function(a,b,c){var d=this.labels();return a=isFinite(a)&&null!==a?0|a:0,a<0&&(a=d.length+a),arguments.length<=1?this.prop(["labels",a]):this.prop(["labels",a],b,c)},labels:function(a,b){return 0===arguments.length?(a=this.get("labels"),Array.isArray(a)?a.slice():[]):(Array.isArray(a)||(a=[]),this.set("labels",a,b))},insertLabel:function(a,b,c){if(!b)throw new Error("dia.Link: no label provided");var d=this.labels(),e=d.length;return a=isFinite(a)&&null!==a?0|a:e,a<0&&(a=e+a+1),d.splice(a,0,b),this.labels(d,c)},appendLabel:function(a,b){return this.insertLabel(-1,a,b)},removeLabel:function(a,b){var c=this.labels();return a=isFinite(a)&&null!==a?0|a:-1,c.splice(a,1),this.labels(c,b)},vertex:function(a,b,c){var d=this.vertices();return a=isFinite(a)&&null!==a?0|a:0,a<0&&(a=d.length+a),arguments.length<=1?this.prop(["vertices",a]):this.prop(["vertices",a],b,c)},vertices:function(a,b){return 0===arguments.length?(a=this.get("vertices"),Array.isArray(a)?a.slice():[]):(Array.isArray(a)||(a=[]),this.set("vertices",a,b))},insertVertex:function(a,b,c){if(!b)throw new Error("dia.Link: no vertex provided");var d=this.vertices(),e=d.length;return a=isFinite(a)&&null!==a?0|a:e,a<0&&(a=e+a+1),d.splice(a,0,b),this.vertices(d,c)},removeVertex:function(a,b){var c=this.vertices();return a=isFinite(a)&&null!==a?0|a:-1,c.splice(a,1),this.vertices(c,b)},translate:function(a,b,c){return c=c||{},c.translateBy=c.translateBy||this.id,c.tx=a,c.ty=b,this.applyToPoints(function(c){return{x:(c.x||0)+a,y:(c.y||0)+b}},c)},scale:function(a,b,c,d){return this.applyToPoints(function(d){return g.point(d).scale(a,b,c).toJSON()},d)},applyToPoints:function(a,b){if(!joint.util.isFunction(a))throw new TypeError("dia.Link: applyToPoints expects its first parameter to be a function.");var c={},d=this.source();d.id||(c.source=a(d));var e=this.target();e.id||(c.target=a(e));var f=this.vertices();return f.length>0&&(c.vertices=f.map(a)),this.set(c,b)},reparent:function(a){var b;if(this.graph){var c=this.getSourceElement(),d=this.getTargetElement(),e=this.getParentCell();c&&d&&(b=c===d||c.isEmbeddedIn(d)?d:d.isEmbeddedIn(c)?c:this.graph.getCommonAncestor(c,d)),!e||b&&b.id===e.id||e.unembed(this,a),b&&b.embed(this,a)}return b},hasLoop:function(a){a=a||{};var b=this.source().id,c=this.target().id;if(!b||!c)return!1;var d=b===c;if(!d&&a.deep&&this.graph){var e=this.getSourceElement(),f=this.getTargetElement();d=e.isEmbeddedIn(f)||f.isEmbeddedIn(e)}return d},getSourceElement:function(){var a=this.source(),b=this.graph;return a&&a.id&&b&&b.getCell(a.id)||null},getTargetElement:function(){var a=this.target(),b=this.graph;return a&&a.id&&b&&b.getCell(a.id)||null},getRelationshipAncestor:function(){var a;if(this.graph){var b=[this,this.getSourceElement(),this.getTargetElement()].filter(function(a){return!!a});a=this.graph.getCommonAncestor.apply(this.graph,b)}return a||null},isRelationshipEmbeddedIn:function(a){var b=joint.util.isString(a)||joint.util.isNumber(a)?a:a.id,c=this.getRelationshipAncestor();return!!c&&(c.id===b||c.isEmbeddedIn(b))},_getDefaultLabel:function(){var a=this.get("defaultLabel")||this.defaultLabel||{},b={};return b.markup=a.markup||this.get("labelMarkup")||this.labelMarkup,b.position=a.position,b.attrs=a.attrs,b.size=a.size,b}},{endsEqual:function(a,b){var c=a.port===b.port||!a.port&&!b.port;return a.id===b.id&&c}}),joint.dia.LinkView=joint.dia.CellView.extend({className:function(){var a=joint.dia.CellView.prototype.className.apply(this).split(" ");return a.push("link"),a.join(" ")},options:{shortLinkLength:105,doubleLinkTools:!1,longLinkLength:155,linkToolsOffset:40,doubleLinkToolsOffset:65,sampleInterval:50},_labelCache:null,_labelSelectors:null,_markerCache:null,_V:null,_dragData:null,metrics:null,decimalsRounding:2,initialize:function(a){joint.dia.CellView.prototype.initialize.apply(this,arguments),"function"!=typeof this.constructor.prototype.watchSource&&(this.constructor.prototype.watchSource=this.createWatcher("source"),this.constructor.prototype.watchTarget=this.createWatcher("target")),this._labelCache={},this._labelSelectors={},this._markerCache={},this._V={},this.metrics={},this.startListening()},startListening:function(){var a=this.model;this.listenTo(a,"change:markup",this.render),this.listenTo(a,"change:smooth change:manhattan change:router change:connector",this.update),this.listenTo(a,"change:toolMarkup",this.onToolsChange),this.listenTo(a,"change:labels change:labelMarkup",this.onLabelsChange),this.listenTo(a,"change:vertices change:vertexMarkup",this.onVerticesChange),this.listenTo(a,"change:source",this.onSourceChange),this.listenTo(a,"change:target",this.onTargetChange)},onSourceChange:function(a,b,c){this.watchSource(a,b);var d=this.model;c.translateBy&&d.get("target").id&&b.id||this.update(d,null,c)},onTargetChange:function(a,b,c){this.watchTarget(a,b);var d=this.model;(!c.translateBy||d.get("source").id&&!b.id&&joint.util.isEmpty(d.get("vertices")))&&this.update(d,null,c)},onVerticesChange:function(a,b,c){this.renderVertexMarkers(),c.translateBy&&c.translateBy!==this.model.id&&!this.model.hasLoop()||this.update(a,null,c)},onToolsChange:function(){this.renderTools().updateToolsPosition()},onLabelsChange:function(a,b,c){var d=!0,e=this.model.previous("labels");if(e&&"propertyPathArray"in c&&"propertyValue"in c){var f=c.propertyPathArray||[],g=f.length;if(g>1){var h=!!e[f[1]];h&&(2===g?d="markup"in Object(c.propertyValue):"markup"!==f[2]&&(d=!1))}}d?this.renderLabels():this.updateLabels(),this.updateLabelPositions()},render:function(){this.vel.empty(),this._V={},this.renderMarkup(),this.renderLabels();var a=this.model;return this.watchSource(a,a.source()).watchTarget(a,a.target()).update(),this},renderMarkup:function(){var a=this.model,b=a.get("markup")||a.markup;if(!b)throw new Error("dia.LinkView: markup required");if(Array.isArray(b))return this.renderJSONMarkup(b);if("string"==typeof b)return this.renderStringMarkup(b);throw new Error("dia.LinkView: invalid markup")},renderJSONMarkup:function(a){var b=joint.util.parseDOMJSON(a),c=this.selectors=b.selectors,d=this.selector;if(c[d])throw new Error("dia.LinkView: ambiguous root selector.");c[d]=this.el,this.vel.append(b.fragment)},renderStringMarkup:function(a){var b=V(a);Array.isArray(b)||(b=[b]);for(var c=this._V,d=0,e=b.length;d1||"G"!==d[0].nodeName.toUpperCase()?(c=V("g"),c.append(b),c.addClass("label")):(c=V(d[0]),c.addClass("label")),{node:c.node,selectors:a.selectors}}},renderLabels:function(){var a=this._V,b=a.labels,c=this._labelCache={},d=this._labelSelectors={};b&&b.empty();var e=this.model,f=e.get("labels")||[],g=f.length;if(0===g)return this;b||(b=a.labels=V("g").addClass("labels").appendTo(this.el));for(var h=0;h=this.options.longLinkLength){var e=this.options.doubleLinkToolsOffset||b;d=this.getPointAtLength(c-e),this._tool2Cache.attr("transform","translate("+d.x+", "+d.y+") "+a),this._tool2Cache.attr("visibility","visible")}else this.options.doubleLinkTools&&this._tool2Cache.attr("visibility","hidden")}return this},updateArrowheadMarkers:function(){if(!this._V.markerArrowheads)return this;if("none"===$.css(this._V.markerArrowheads.node,"display"))return this;var a=this.getConnectionLength()0&&b<=1,d=0,e={x:0,y:0};if(a.offset){var f=a.offset;"number"==typeof f&&(d=f),f.x&&(e.x=f.x),f.y&&(e.y=f.y)}var g,h=0!==e.x||0!==e.y||0===d,i=this.path,j={segmentSubdivisions:this.getConnectionSubdivisions()},k=c?b*this.getConnectionLength():b;if(h)g=i.pointAtLength(k,j),g.offset(e);else{var l=i.tangentAtLength(k,j);l?(l.rotate(l.start,-90),l.setLength(d),g=l.end):g=i.start}return g},getVertexIndex:function(a,b){for(var c=this.model,d=c.vertices(),e=this.getClosestPointLength(new g.Point(a,b)),f=0,h=d.length;f0){for(var j=0,k=i.length;j").addClass(joint.util.addClassNamePrefix("paper-background")),this.options.background&&this.drawBackground(this.options.background),this.$grid=$("
").addClass(joint.util.addClassNamePrefix("paper-grid")),this.options.drawGrid&&this.drawGrid(),this.$el.append(this.$background,this.$grid,this.svg),this},update:function(){return this.options.drawGrid&&this.drawGrid(),this._background&&this.updateBackgroundImage(this._background),this},_viewportMatrix:null,_viewportTransformString:null,matrix:function(a){var b=this.viewport;if(void 0===a){var c=b.getAttribute("transform");return(this._viewportTransformString||null)===c?a=this._viewportMatrix:(a=b.getCTM(),this._viewportMatrix=a,this._viewportTransformString=c),V.createSVGMatrix(a)}return a=V.createSVGMatrix(a),ctmString=V.matrixToTransformString(a),b.setAttribute("transform",ctmString),this.tools.setAttribute("transform",ctmString),this._viewportMatrix=a,this._viewportTransformString=b.getAttribute("transform"),this},clientMatrix:function(){return V.createSVGMatrix(this.viewport.getScreenCTM())},_sortDelayingBatches:["add","to-front","to-back"],_onSort:function(){this.model.hasActiveBatch(this._sortDelayingBatches)||this.sortViews()},_onBatchStop:function(a){var b=a&&a.batchName;this._sortDelayingBatches.includes(b)&&!this.model.hasActiveBatch(this._sortDelayingBatches)&&this.sortViews()},onRemove:function(){this.removeViews()},setDimensions:function(a,b){a=this.options.width=a||this.options.width,b=this.options.height=b||this.options.height,this.$el.css({width:Math.round(a),height:Math.round(b)}),this.trigger("resize",a,b)},setOrigin:function(a,b){return this.translate(a||0,b||0,{absolute:!0})},fitToContent:function(a,b,c,d){joint.util.isObject(a)?(d=a,a=d.gridWidth||1,b=d.gridHeight||1,c=d.padding||0):(d=d||{},a=a||1,b=b||1,c=c||0),c=joint.util.normalizeSides(c);var e=V(this.viewport).getBBox(),f=this.scale(),g=this.translate();e.x*=f.sx,e.y*=f.sy,e.width*=f.sx,e.height*=f.sy;var h=Math.max(Math.ceil((e.width+e.x)/a),1)*a,i=Math.max(Math.ceil((e.height+e.y)/b),1)*b,j=0,k=0;("negative"==d.allowNewOrigin&&e.x<0||"positive"==d.allowNewOrigin&&e.x>=0||"any"==d.allowNewOrigin)&&(j=Math.ceil(-e.x/a)*a,j+=c.left,h+=j),("negative"==d.allowNewOrigin&&e.y<0||"positive"==d.allowNewOrigin&&e.y>=0||"any"==d.allowNewOrigin)&&(k=Math.ceil(-e.y/b)*b,k+=c.top,i+=k),h+=c.right,i+=c.bottom,h=Math.max(h,d.minWidth||0),i=Math.max(i,d.minHeight||0),h=Math.min(h,d.maxWidth||Number.MAX_VALUE),i=Math.min(i,d.maxHeight||Number.MAX_VALUE);var l=h!=this.options.width||i!=this.options.height,m=j!=g.tx||k!=g.ty;m&&this.translate(j,k),l&&this.setDimensions(h,i)},scaleContentToFit:function(a){var b=this.getContentBBox();if(b.width&&b.height){a=a||{},joint.util.defaults(a,{padding:0,preserveAspectRatio:!0,scaleGrid:null,minScale:0,maxScale:Number.MAX_VALUE});var c,d=a.padding,e=a.minScaleX||a.minScale,f=a.maxScaleX||a.maxScale,h=a.minScaleY||a.minScale,i=a.maxScaleY||a.maxScale;if(a.fittingBBox)c=a.fittingBBox;else{var j=this.translate();c={x:j.tx,y:j.ty,width:this.options.width,height:this.options.height}}c=g.rect(c).moveAndExpand({x:d,y:d,width:-2*d,height:-2*d});var k=this.scale(),l=c.width/b.width*k.sx,m=c.height/b.height*k.sy;if(a.preserveAspectRatio&&(l=m=Math.min(l,m)),a.scaleGrid){var n=a.scaleGrid;l=n*Math.floor(l/n),m=n*Math.floor(m/n)}l=Math.min(f,Math.max(e,l)),m=Math.min(i,Math.max(h,m)),this.scale(l,m);var o=this.getContentBBox(),p=c.x-o.x,q=c.y-o.y;this.translate(p,q)}},getContentArea:function(){return V(this.viewport).getBBox()},getContentBBox:function(){var a=this.viewport.getBoundingClientRect(),b=this.clientMatrix(),c=this.translate();return g.rect({x:a.left-b.e+c.tx,y:a.top-b.f+c.ty,width:a.width,height:a.height})},getArea:function(){return this.paperToLocalRect({x:0,y:0,width:this.options.width,height:this.options.height})},getRestrictedArea:function(){var a;return a=joint.util.isFunction(this.options.restrictTranslate)?this.options.restrictTranslate.apply(this,arguments):this.options.restrictTranslate===!0?this.getArea():this.options.restrictTranslate||null},createViewForModel:function(a){var b,c,d=this.options.cellViewNamespace,e=a.get("type")+"View",f=joint.util.getByPath(d,e,".");a.isLink()?(b=this.options.linkView,c=joint.dia.LinkView):(b=this.options.elementView,c=joint.dia.ElementView);var g=b.prototype instanceof Backbone.View?f||b:b.call(this,a)||f||c;return new g({model:a,interactive:this.options.interactive})},onCellAdded:function(a,b,c){if(this.options.async&&c.async!==!1&&joint.util.isNumber(c.position)){if(this._asyncCells=this._asyncCells||[],this._asyncCells.push(a),0==c.position){if(this._frameId)throw new Error("another asynchronous rendering in progress");this.asyncRenderViews(this._asyncCells,c),delete this._asyncCells}}else this.renderView(a)},removeView:function(a){var b=this._views[a.id];return b&&(b.remove(),delete this._views[a.id]),b},renderView:function(a){var b=this._views[a.id]=this.createViewForModel(a);return V(this.viewport).append(b.el),b.paper=this,b.render(),b},onImageDragStart:function(){return!1},beforeRenderViews:function(a){return a.sort(function(a){return a.isLink()?1:-1}),a},afterRenderViews:function(){this.sortViews()},resetViews:function(a,b){this.removeViews();var c=a.models.slice();if(c=this.beforeRenderViews(c,b)||c,this.cancelRenderViews(),this.options.async)this.asyncRenderViews(c,b);else{for(var d=0,e=c.length;d(e.get("z")||0)?1:-1})},scale:function(a,b,c,d){if(void 0===a)return V.matrixToScale(this.matrix());void 0===b&&(b=a),void 0===c&&(c=0,d=0);var e=this.translate();if(c||d||e.tx||e.ty){var f=e.tx-c*(a-1),g=e.ty-d*(b-1);this.translate(f,g)}var h=this.matrix();return h.a=a||0,h.d=b||0,this.matrix(h),this.trigger("scale",a,b,c,d),this},rotate:function(a,b,c){if(void 0===a)return V.matrixToRotate(this.matrix());if(void 0===b){var d=this.viewport.getBBox();b=d.width/2,c=d.height/2}var e=this.matrix().translate(b,c).rotate(a).translate(-b,-c);return this.matrix(e),this},translate:function(a,b){if(void 0===a)return V.matrixToTranslate(this.matrix());var c=this.matrix();c.e=a||0,c.f=b||0,this.matrix(c);var d=this.translate(),e=this.options.origin;return e.x=d.tx,e.y=d.ty,this.trigger("translate",d.tx,d.ty),this.options.drawGrid&&this.drawGrid(),this},findView:function(a){for(var b=joint.util.isString(a)?this.viewport.querySelector(a):a instanceof $?a[0]:a;b&&b!==this.el&&b!==document;){var c=b.getAttribute("model-id");if(c)return this._views[c];b=b.parentNode}},findViewByModel:function(a){var b=joint.util.isString(a)||joint.util.isNumber(a)?a:a&&a.id;return this._views[b]},findViewsFromPoint:function(a){a=g.point(a);var b=this.model.getElements().map(this.findViewByModel,this);return b.filter(function(b){return b&&b.vel.getBBox({target:this.viewport}).containsPoint(a)},this)},findViewsInArea:function(a,b){b=joint.util.defaults(b||{},{strict:!1}),a=g.rect(a);var c=this.model.getElements().map(this.findViewByModel,this),d=b.strict?"containsRect":"intersect";return c.filter(function(b){return b&&a[d](b.vel.getBBox({target:this.viewport}))},this)},removeTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"remove"),this},hideTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"hide"),this},showTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"show"),this},getModelById:function(a){return this.model.getCell(a)},snapToGrid:function(a,b){return this.clientToLocalPoint(a,b).snapToGrid(this.options.gridSize)},localToPaperPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.matrix());return g.Point(d)},localToPaperRect:function(a,b,c,d){var e=g.Rect(a,b),f=V.transformRect(e,this.matrix());return g.Rect(f)},paperToLocalPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.matrix().inverse());return g.Point(d)},paperToLocalRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.matrix().inverse());return g.Rect(f)},localToClientPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.clientMatrix());return g.Point(d)},localToClientRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.clientMatrix());return g.Rect(f)},clientToLocalPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.clientMatrix().inverse());return g.Point(d)},clientToLocalRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.clientMatrix().inverse());return g.Rect(f)},localToPagePoint:function(a,b){return this.localToPaperPoint(a,b).offset(this.pageOffset())},localToPageRect:function(a,b,c,d){return this.localToPaperRect(a,b,c,d).moveAndExpand(this.pageOffset())},pageToLocalPoint:function(a,b){var c=g.Point(a,b),d=c.difference(this.pageOffset());return this.paperToLocalPoint(d)},pageToLocalRect:function(a,b,c,d){var e=this.pageOffset(),f=g.Rect(a,b,c,d);return f.x-=e.x,f.y-=e.y,this.paperToLocalRect(f)},clientOffset:function(){var a=this.svg.getBoundingClientRect();return g.Point(a.left,a.top)},pageOffset:function(){return this.clientOffset().offset(window.scrollX,window.scrollY)},linkAllowed:function(a){if(!(a instanceof joint.dia.LinkView))throw new Error("Must provide a linkView.");var b=a.model,c=this.options,d=this.model,e=d.constructor.validations;return!(!c.multiLinks&&!e.multiLinks.call(this,d,b))&&(!(!c.linkPinning&&!e.linkPinning.call(this,d,b))&&!("function"==typeof c.allowLink&&!c.allowLink.call(this,a,this)))},getDefaultLink:function(a,b){return joint.util.isFunction(this.options.defaultLink)?this.options.defaultLink.call(this,a,b):this.options.defaultLink.clone()},resolveHighlighter:function(a){a=a||{};var b=a.highlighter,c=this.options;if(void 0===b){var d=["embedding","connecting","magnetAvailability","elementAvailability"].find(function(b){return!!a[b]});b=d&&c.highlighting[d]||c.highlighting.default}if(!b)return!1;joint.util.isString(b)&&(b={name:b});var e=b.name,f=c.highlighterNamespace[e];if(!f)throw new Error('Unknown highlighter ("'+e+'")');if("function"!=typeof f.highlight)throw new Error('Highlighter ("'+e+'") is missing required highlight() method');if("function"!=typeof f.unhighlight)throw new Error('Highlighter ("'+e+'") is missing required unhighlight() method');return{highlighter:f,options:b.options||{},name:e}},onCellHighlight:function(a,b,c){if(c=this.resolveHighlighter(c)){b.id||(b.id=V.uniqueId());var d=c.name+b.id+JSON.stringify(c.options);if(!this._highlights[d]){var e=c.highlighter;e.highlight(a,b,joint.util.assign({},c.options)),this._highlights[d]={cellView:a,magnetEl:b,opt:c.options,highlighter:e}}}},onCellUnhighlight:function(a,b,c){if(c=this.resolveHighlighter(c)){var d=c.name+b.id+JSON.stringify(c.options),e=this._highlights[d];e&&(e.highlighter.unhighlight(e.cellView,e.magnetEl,e.opt),this._highlights[d]=null)}},pointerdblclick:function(a){a.preventDefault(),a=joint.util.normalizeEvent(a); -var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerdblclick(a,c.x,c.y):this.trigger("blank:pointerdblclick",a,c.x,c.y)}},pointerclick:function(a){if(this._mousemoved<=this.options.clickThreshold){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(this.guard(a,b))return;var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerclick(a,c.x,c.y):this.trigger("blank:pointerclick",a,c.x,c.y)}},contextmenu:function(a){this.options.preventContextMenu&&a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.contextmenu(a,c.x,c.y):this.trigger("blank:contextmenu",a,c.x,c.y)}},pointerdown:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?(a.preventDefault(),b.pointerdown(a,c.x,c.y)):(this.options.preventDefaultBlankAction&&a.preventDefault(),this.trigger("blank:pointerdown",a,c.x,c.y)),this.delegateDragEvents(b,a.data)}},pointermove:function(a){a.preventDefault();var b=this.eventData(a);b.mousemoved||(b.mousemoved=0);var c=++b.mousemoved;if(!(c<=this.options.moveThreshold)){a=joint.util.normalizeEvent(a);var d=this.snapToGrid({x:a.clientX,y:a.clientY}),e=b.sourceView;e?e.pointermove(a,d.x,d.y):this.trigger("blank:pointermove",a,d.x,d.y),this.eventData(a,b)}},pointerup:function(a){this.undelegateDocumentEvents(),a=joint.util.normalizeEvent(a);var b=this.snapToGrid({x:a.clientX,y:a.clientY}),c=this.eventData(a).sourceView;c?c.pointerup(a,b.x,b.y):this.trigger("blank:pointerup",a,b.x,b.y),this.delegateEvents()},mouseover:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b))if(b)b.mouseover(a);else{if(this.el===a.target)return;this.trigger("blank:mouseover",a)}},mouseout:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b))if(b)b.mouseout(a);else{if(this.el===a.target)return;this.trigger("blank:mouseout",a)}},mouseenter:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.findView(a.relatedTarget);if(b){if(c===b)return;b.mouseenter(a)}else{if(c)return;this.trigger("paper:mouseenter",a)}}},mouseleave:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.findView(a.relatedTarget);if(b){if(c===b)return;b.mouseleave(a)}else{if(c)return;this.trigger("paper:mouseleave",a)}}},mousewheel:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=a.originalEvent,d=this.snapToGrid({x:c.clientX,y:c.clientY}),e=Math.max(-1,Math.min(1,c.wheelDelta||-c.detail));b?b.mousewheel(a,d.x,d.y,e):this.trigger("blank:mousewheel",a,d.x,d.y,e)}},onevent:function(a){var b=a.currentTarget,c=b.getAttribute("event");if(c){var d=this.findView(b);if(d){if(a=joint.util.normalizeEvent(a),this.guard(a,d))return;var e=this.snapToGrid({x:a.clientX,y:a.clientY});d.onevent(a,c,e.x,e.y)}}},onmagnet:function(a){var b=a.currentTarget,c=b.getAttribute("magnet");if(c){var d=this.findView(b);if(d){if(a=joint.util.normalizeEvent(a),this.guard(a,d))return;if(!this.options.validateMagnet(d,b))return;var e=this.snapToGrid(a.clientX,a.clientY);d.onmagnet(a,e.x,e.y)}}},onlabel:function(a){var b=a.currentTarget,c=this.findView(b);if(c){if(a=joint.util.normalizeEvent(a),this.guard(a,c))return;var d=this.snapToGrid(a.clientX,a.clientY);c.onlabel(a,d.x,d.y)}},delegateDragEvents:function(a,b){b||(b={}),this.eventData({data:b},{sourceView:a||null,mousemoved:0}),this.delegateDocumentEvents(null,b),this.undelegateEvents()},guard:function(a,b){return"mousedown"===a.type&&2===a.button||(!(!this.options.guard||!this.options.guard(a,b))||(a.data&&void 0!==a.data.guarded?a.data.guarded:!(b&&b.model&&b.model instanceof joint.dia.Cell)&&(this.svg!==a.target&&this.el!==a.target&&!$.contains(this.svg,a.target))))},setGridSize:function(a){return this.options.gridSize=a,this.options.drawGrid&&this.drawGrid(),this},clearGrid:function(){return this.$grid&&this.$grid.css("backgroundImage","none"),this},_getGriRefs:function(){return this._gridCache||(this._gridCache={root:V("svg",{width:"100%",height:"100%"},V("defs")),patterns:{},add:function(a,b){V(this.root.node.childNodes[0]).append(b),this.patterns[a]=b,this.root.append(V("rect",{width:"100%",height:"100%",fill:"url(#"+a+")"}))},get:function(a){return this.patterns[a]},exist:function(a){return void 0!==this.patterns[a]}}),this._gridCache},setGrid:function(a){this.clearGrid(),this._gridCache=null,this._gridSettings=[];var b=Array.isArray(a)?a:[a||{}];return b.forEach(function(a){this._gridSettings.push.apply(this._gridSettings,this._resolveDrawGridOption(a))},this),this},_resolveDrawGridOption:function(a){var b=this.constructor.gridPatterns;if(joint.util.isString(a)&&Array.isArray(b[a]))return b[a].map(function(a){return joint.util.assign({},a)});var c=a||{args:[{}]},d=Array.isArray(c),e=c.name;if(d||e||c.markup||(e="dot"),e&&Array.isArray(b[e])){var f=b[e].map(function(a){return joint.util.assign({},a)}),g=Array.isArray(c.args)?c.args:[c.args||{}];joint.util.defaults(g[0],joint.util.omit(a,"args"));for(var h=0;h'),f=joint.util.toArray(d).map(function(a){return e({offset:a.offset,color:a.color,opacity:Number.isFinite(a.opacity)?a.opacity:1})}),g=["<"+c+">",f.join(""),""].join(""),h=joint.util.assign({id:b},a.attrs);V(g,h).appendTo(this.defs)}return b},defineMarker:function(a){if(!joint.util.isObject(a))throw new TypeError("dia.Paper: defineMarker() requires 1. argument to be an object.");var b=a.id;if(b||(b=this.svg.id+joint.util.hashCode(JSON.stringify(a))),!this.isDefined(b)){var c=joint.util.omit(a,"type","userSpaceOnUse"),d=V("marker",{id:b,orient:"auto",overflow:"visible",markerUnits:a.markerUnits||"userSpaceOnUse"},[V(a.type||"path",c)]);d.appendTo(this.defs)}return b}},{backgroundPatterns:{flipXy:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=2*c,b.height=2*d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.setTransform(-1,0,0,-1,b.width,b.height),e.drawImage(a,0,0,c,d),e.setTransform(-1,0,0,1,b.width,0),e.drawImage(a,0,0,c,d),e.setTransform(1,0,0,-1,0,b.height),e.drawImage(a,0,0,c,d),b},flipX:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=2*c,b.height=d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.translate(2*c,0),e.scale(-1,1),e.drawImage(a,0,0,c,d),b},flipY:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=c,b.height=2*d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.translate(0,2*d),e.scale(1,-1),e.drawImage(a,0,0,c,d),b},watermark:function(a,b){b=b||{};var c=a.width,d=a.height,e=document.createElement("canvas");e.width=3*c,e.height=3*d;for(var f=e.getContext("2d"),h=joint.util.isNumber(b.watermarkAngle)?-b.watermarkAngle:-20,i=g.toRad(h),j=e.width/4,k=e.height/4,l=0;l<4;l++)for(var m=0;m<4;m++)(l+m)%2>0&&(f.setTransform(1,0,0,1,(2*l-1)*j,(2*m-1)*k),f.rotate(i),f.drawImage(a,-c/2,-d/2,c,d));return e}},gridPatterns:{dot:[{color:"#AAAAAA",thickness:1,markup:"rect",update:function(a,b){V(a).attr({width:b.thickness*b.sx,height:b.thickness*b.sy,fill:b.color})}}],fixedDot:[{color:"#AAAAAA",thickness:1,markup:"rect",update:function(a,b){var c=b.sx<=1?b.thickness*b.sx:b.thickness;V(a).attr({width:c,height:c,fill:b.color})}}],mesh:[{color:"#AAAAAA",thickness:1,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}}],doubleMesh:[{color:"#AAAAAA",thickness:1,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}},{color:"#000000",thickness:3,scaleFactor:4,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}}]}}),function(a,b,c){var d=function(b){var d=c.cloneDeep(b)||{};this.ports=[],this.groups={},this.portLayoutNamespace=a.layout.Port,this.portLabelLayoutNamespace=a.layout.PortLabel,this._init(d)};d.prototype={getPorts:function(){return this.ports},getGroup:function(a){return this.groups[a]||{}},getPortsByGroup:function(a){return this.ports.filter(function(b){return b.group===a})},getGroupPortsMetrics:function(a,b){var d=this.getGroup(a),e=this.getPortsByGroup(a),f=d.position||{},h=f.name,i=this.portLayoutNamespace;i[h]||(h="left");var j=f.args||{},k=e.map(function(a){return a&&a.position&&a.position.args}),l=i[h](k,b,j),m={ports:e,result:[]};return c.toArray(l).reduce(function(a,c,d){var e=a.ports[d];return a.result.push({portId:e.id,portTransformation:c,labelTransformation:this._getPortLabelLayout(e,g.Point(c),b),portAttrs:e.attrs,portSize:e.size,labelSize:e.label.size}),a}.bind(this),m),m.result},_getPortLabelLayout:function(a,b,c){var d=this.portLabelLayoutNamespace,e=a.label.position.name||"left";return d[e]?d[e](b,c,a.label.position.args):null},_init:function(a){if(c.isObject(a.groups))for(var b=Object.keys(a.groups),d=0,e=b.length;d0},hasPort:function(a){return this.getPortIndex(a)!==-1},getPorts:function(){return c.cloneDeep(this.prop("ports/items"))||[]},getPort:function(a){return c.cloneDeep(c.toArray(this.prop("ports/items")).find(function(b){return b.id&&b.id===a}))},getPortsPositions:function(a){var b=this._portSettingsData.getGroupPortsMetrics(a,g.Rect(this.size()));return b.reduce(function(a,b){var c=b.portTransformation;return a[b.portId]={x:c.x,y:c.y,angle:c.angle},a},{})},getPortIndex:function(a){var b=c.isObject(a)?a.id:a;return this._isValidPortId(b)?c.toArray(this.prop("ports/items")).findIndex(function(a){return a.id===b}):-1},addPort:function(a,b){if(!c.isObject(a)||Array.isArray(a))throw new Error("Element: addPort requires an object.");var d=c.assign([],this.prop("ports/items"));return d.push(a),this.prop("ports/items",d,b),this},portProp:function(a,b,d,e){var f=this.getPortIndex(a);if(f===-1)throw new Error("Element: unable to find port with id "+a);var g=Array.prototype.slice.call(arguments,1);return Array.isArray(b)?g[0]=["ports","items",f].concat(b):c.isString(b)?g[0]=["ports/items/",f,"/",b].join(""):(g=["ports/items/"+f],c.isPlainObject(b)&&(g.push(b),g.push(d))),this.prop.apply(this,g)},_validatePorts:function(){var b=this.get("ports")||{},d=[];b=b||{};var e=c.toArray(b.items);return e.forEach(function(a){"object"!=typeof a&&d.push("Element: invalid port ",a),this._isValidPortId(a.id)||(a.id=c.uuid())},this),a.util.uniq(e,"id").length!==e.length&&d.push("Element: found id duplicities in ports."),d},_isValidPortId:function(a){return null!==a&&void 0!==a&&!c.isObject(a)},addPorts:function(a,b){return a.length&&this.prop("ports/items",c.assign([],this.prop("ports/items")).concat(a),b),this},removePort:function(a,b){var d=b||{},e=c.assign([],this.prop("ports/items")),f=this.getPortIndex(a);return f!==-1&&(e.splice(f,1),d.rewrite=!0,this.prop("ports/items",e,d)),this},_createPortData:function(){var a=this._validatePorts();if(a.length>0)throw this.set("ports",this.previous("ports")),new Error(a.join(" "));var b;this._portSettingsData&&(b=this._portSettingsData.getPorts()),this._portSettingsData=new d(this.get("ports"));var c=this._portSettingsData.getPorts();if(b){var e=c.filter(function(a){if(!b.find(function(b){return b.id===a.id}))return a}),f=b.filter(function(a){if(!c.find(function(b){return b.id===a.id}))return a});f.length>0&&this.trigger("ports:remove",this,f),e.length>0&&this.trigger("ports:add",this,e)}}}),c.assign(a.dia.ElementView.prototype,{portContainerMarkup:"g",portMarkup:[{tagName:"circle",selector:"circle",attributes:{r:10,fill:"#FFFFFF",stroke:"#000000"}}],portLabelMarkup:[{tagName:"text",selector:"text",attributes:{fill:"#000000"}}],_portElementsCache:null,_initializePorts:function(){this._portElementsCache={},this.listenTo(this.model,"change:ports",function(){this._refreshPorts()})},_refreshPorts:function(){this._removePorts(),this._portElementsCache={},this._renderPorts()},_renderPorts:function(){for(var a=[],b=this._getContainerElement(),d=0,e=b.node.childNodes.length;d1?V("g").append(h):V(h.firstChild),e=g.selectors}else b=V(f),Array.isArray(b)&&(b=V("g").append(b));if(!b)throw new Error("ElementView: Invalid port markup.");b.attr({port:a.id,"port-group":a.group});var i,j=this._getPortLabelMarkup(a.label);if(Array.isArray(j)){var k=c.parseDOMJSON(j),l=k.fragment;d=l.childNodes.length>1?V("g").append(l):V(l.firstChild),i=k.selectors}else d=V(j),Array.isArray(d)&&(d=V("g").append(d));if(!d)throw new Error("ElementView: Invalid port label markup.");var m;if(e&&i){for(var n in i)if(e[n])throw new Error("ElementView: selectors within port must be unique.");m=c.assign({},e,i)}else m=e||i;var o=V(this.portContainerMarkup).addClass("joint-port").append([b.addClass("joint-port-body"),d.addClass("joint-port-label")]);return this._portElementsCache[a.id]={portElement:o,portLabelElement:d,portSelectors:m,portLabelSelectors:i,portContentElement:b,portContentSelectors:e},o},_updatePortGroup:function(a){for(var b=g.Rect(this.model.size()),c=this.model._portSettingsData.getGroupPortsMetrics(a,b),d=0,e=c.length;d'}),joint.shapes.basic.TextView=joint.dia.ElementView.extend({initialize:function(){joint.dia.ElementView.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:attrs",this.resize)}}),joint.shapes.basic.Generic.define("basic.Text",{attrs:{text:{"font-size":18,fill:"#000000"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Circle",{size:{width:60,height:60},attrs:{circle:{fill:"#ffffff",stroke:"#000000",r:30,cx:30,cy:30},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Ellipse",{size:{width:60,height:40},attrs:{ellipse:{fill:"#ffffff",stroke:"#000000",rx:30,ry:20,cx:30,cy:20},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Polygon",{size:{width:60,height:40},attrs:{polygon:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Polyline",{size:{width:60,height:40},attrs:{polyline:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Image",{attrs:{text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Path",{size:{width:60,height:60},attrs:{path:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle",ref:"path","ref-x":.5,"ref-dy":10,fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Path.define("basic.Rhombus",{attrs:{path:{d:"M 30 0 L 60 30 30 60 0 30 z"},text:{"ref-y":.5,"ref-dy":null,"y-alignment":"middle"}}}),joint.shapes.basic.PortsModelInterface={initialize:function(){this.updatePortsAttrs(),this.on("change:inPorts change:outPorts",this.updatePortsAttrs,this),this.constructor.__super__.constructor.__super__.initialize.apply(this,arguments)},updatePortsAttrs:function(a){if(this._portSelectors){var b=joint.util.omit(this.get("attrs"),this._portSelectors);this.set("attrs",b,{silent:!0})}this._portSelectors=[];var c={};joint.util.toArray(this.get("inPorts")).forEach(function(a,b,d){var e=this.getPortAttrs(a,b,d.length,".inPorts","in");this._portSelectors=this._portSelectors.concat(Object.keys(e)),joint.util.assign(c,e)},this),joint.util.toArray(this.get("outPorts")).forEach(function(a,b,d){var e=this.getPortAttrs(a,b,d.length,".outPorts","out");this._portSelectors=this._portSelectors.concat(Object.keys(e)),joint.util.assign(c,e)},this),this.attr(c,{silent:!0}),this.processPorts(),this.trigger("process:ports")},getPortSelector:function(a){var b=".inPorts",c=this.get("inPorts").indexOf(a);if(c<0&&(b=".outPorts",c=this.get("outPorts").indexOf(a),c<0))throw new Error("getPortSelector(): Port doesn't exist.");return b+">g:nth-child("+(c+1)+")>.port-body"}},joint.shapes.basic.PortsViewInterface={initialize:function(){this.listenTo(this.model,"process:ports",this.update),joint.dia.ElementView.prototype.initialize.apply(this,arguments)},update:function(){this.renderPorts(),joint.dia.ElementView.prototype.update.apply(this,arguments)},renderPorts:function(){var a=this.$(".inPorts").empty(),b=this.$(".outPorts").empty(),c=joint.util.template(this.model.portMarkup),d=this.model.ports||[];d.filter(function(a){return"in"===a.type}).forEach(function(b,d){a.append(V(c({id:d,port:b})).node)}),d.filter(function(a){return"out"===a.type}).forEach(function(a,d){b.append(V(c({id:d,port:a})).node)})}},joint.shapes.basic.Generic.define("basic.TextBlock",{attrs:{rect:{fill:"#ffffff",stroke:"#000000",width:80,height:100},text:{fill:"#000000","font-size":14,"font-family":"Arial, helvetica, sans-serif"},".content":{text:"","ref-x":.5,"ref-y":.5,"y-alignment":"middle","x-alignment":"middle"}},content:""},{markup:['','',joint.env.test("svgforeignobject")?'
':'',""].join(""),initialize:function(){this.listenTo(this,"change:size",this.updateSize),this.listenTo(this,"change:content",this.updateContent),this.updateSize(this,this.get("size")),this.updateContent(this,this.get("content")),joint.shapes.basic.Generic.prototype.initialize.apply(this,arguments)},updateSize:function(a,b){this.attr({".fobj":joint.util.assign({},b),div:{style:joint.util.assign({},b)}})},updateContent:function(a,b){joint.env.test("svgforeignobject")?this.attr({".content":{html:joint.util.sanitizeHTML(b)}}):this.attr({".content":{text:b}})},setForeignObjectSize:function(){this.updateSize.apply(this,arguments)},setDivContent:function(){this.updateContent.apply(this,arguments)}}),joint.shapes.basic.TextBlockView=joint.dia.ElementView.extend({initialize:function(){joint.dia.ElementView.prototype.initialize.apply(this,arguments),this.noSVGForeignObjectElement=!joint.env.test("svgforeignobject"),joint.env.test("svgforeignobject")||this.listenTo(this.model,"change:content change:size",function(a){this.updateContent(a)})},update:function(a,b){var c=this.model;if(joint.env.test("svgforeignobject"))joint.dia.ElementView.prototype.update.call(this,c,b);else{var d=joint.util.omit(b||c.get("attrs"),".content");joint.dia.ElementView.prototype.update.call(this,c,d),b&&!joint.util.has(b,".content")||this.updateContent(c,b)}},updateContent:function(a,b){var c=joint.util.merge({},(b||a.get("attrs"))[".content"]);c=joint.util.omit(c,"text");var d=joint.util.breakText(a.get("content"),a.get("size"),c,{svgDocument:this.paper.svg}),e=joint.util.setByPath({},".content",c,"/");e[".content"].text=d,joint.dia.ElementView.prototype.update.call(this,a,e)}}),function(a,b,c,d){"use strict";var e=a.Element;e.define("standard.Rectangle",{attrs:{body:{refWidth:"100%",refHeight:"100%",strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"circle",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"ellipse",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Path",{attrs:{body:{refD:"M 0 0 L 10 0 10 10 0 10 Z",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Polygon",{attrs:{body:{refPoints:"0 0 10 0 10 10 0 10",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"polygon",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Polyline",{attrs:{body:{refPoints:"0 0 10 0 10 10 0 10 0 0",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"polyline",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Image",{attrs:{image:{refWidth:"100%",refHeight:"100%"},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"100%",refY2:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}]}),e.define("standard.BorderedImage",{attrs:{border:{refWidth:"100%",refHeight:"100%",stroke:"#333333",strokeWidth:2},image:{refWidth:-1,refHeight:-1,x:.5,y:.5},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"100%",refY2:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"image",selector:"image"},{tagName:"rect",selector:"border",attributes:{fill:"none"}},{tagName:"text",selector:"label"}]}),e.define("standard.EmbeddedImage",{attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#FFFFFF",strokeWidth:2},image:{refWidth:"30%",refHeight:-20,x:10,y:10,preserveAspectRatio:"xMidYMin"},label:{textVerticalAnchor:"top",textAnchor:"left",refX:"30%",refX2:20,refY:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}]}),e.define("standard.HeaderedRectangle",{attrs:{body:{refWidth:"100%",refHeight:"100%",strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},header:{refWidth:"100%",height:30,strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},headerText:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:15,fontSize:16,fill:"#333333"},bodyText:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",refY2:15,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"header"},{tagName:"text",selector:"headerText"},{tagName:"text",selector:"bodyText"}]});var f=10;joint.dia.Element.define("standard.Cylinder",{attrs:{body:{lateralArea:f,fill:"#FFFFFF",stroke:"#333333",strokeWidth:2},top:{refCx:"50%",cy:f,refRx:"50%",ry:f,fill:"#FFFFFF",stroke:"#333333",strokeWidth:2},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"100%",refY2:15,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],topRy:function(a,c){ -if(void 0===a)return this.attr("body/lateralArea");var d=b.isPercentage(a),e={lateralArea:a},f=d?{refCy:a,refRy:a,cy:null,ry:null}:{refCy:null,refRy:null,cy:a,ry:a};return this.attr({body:e,top:f},c)}},{attributes:{lateralArea:{set:function(a,c){var e=b.isPercentage(a);e&&(a=parseFloat(a)/100);var f=c.x,g=c.y,h=c.width,i=c.height,j=h/2,k=e?i*a:a,l=d.KAPPA,m=l*j,n=l*(e?i*a:a),o=f,p=f+h/2,q=f+h,r=g+k,s=r-k,t=g+i-k,u=g+i,v=["M",o,r,"L",o,t,"C",f,t+n,p-m,u,p,u,"C",p+m,u,q,t+n,q,t,"L",q,r,"C",q,r-n,p+m,s,p,s,"C",p-m,s,o,r-n,o,r,"Z"];return{d:v.join(" ")}}}}});var g={tagName:"foreignObject",selector:"foreignObject",attributes:{overflow:"hidden"},children:[{tagName:"div",namespaceURI:"http://www.w3.org/1999/xhtml",selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]},h={tagName:"text",selector:"label",attributes:{"text-anchor":"middle"}};e.define("standard.TextBlock",{attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#ffffff",strokeWidth:2},foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}}},{markup:[{tagName:"rect",selector:"body"},c.test("svgforeignobject")?g:h]},{attributes:{text:{set:function(c,d,e,f){if(!(e instanceof HTMLElement)){var g=f.style||{},h={text:c,width:-5,height:"100%"},i=b.assign({textVerticalAnchor:"middle"},g);return a.attributes.textWrap.set.call(this,h,d,e,i),{fill:g.color||null}}e.textContent=c},position:function(a,b,c){if(c instanceof SVGElement)return b.center()}}}});var i=a.Link;i.define("standard.Link",{attrs:{line:{connection:!0,stroke:"#333333",strokeWidth:2,strokeLinejoin:"round",targetMarker:{type:"path",d:"M 10 -5 0 0 10 5 z"}},wrapper:{connection:!0,strokeWidth:10,strokeLinejoin:"round"}}},{markup:[{tagName:"path",selector:"wrapper",attributes:{fill:"none",cursor:"pointer",stroke:"transparent"}},{tagName:"path",selector:"line",attributes:{fill:"none","pointer-events":"none"}}]}),i.define("standard.DoubleLink",{attrs:{line:{connection:!0,stroke:"#DDDDDD",strokeWidth:4,strokeLinejoin:"round",targetMarker:{type:"path",stroke:"#000000",d:"M 10 -3 10 -10 -2 0 10 10 10 3"}},outline:{connection:!0,stroke:"#000000",strokeWidth:6,strokeLinejoin:"round"}}},{markup:[{tagName:"path",selector:"outline",attributes:{fill:"none"}},{tagName:"path",selector:"line",attributes:{fill:"none"}}]}),i.define("standard.ShadowLink",{attrs:{line:{connection:!0,stroke:"#FF0000",strokeWidth:20,strokeLinejoin:"round",targetMarker:{type:"path",stroke:"none",d:"M 0 -10 -10 0 0 10 z"},sourceMarker:{type:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z"}},shadow:{connection:!0,refX:3,refY:6,stroke:"#000000",strokeOpacity:.2,strokeWidth:20,strokeLinejoin:"round",targetMarker:{type:"path",d:"M 0 -10 -10 0 0 10 z",stroke:"none"},sourceMarker:{type:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z"}}}},{markup:[{tagName:"path",selector:"shadow",attributes:{fill:"none"}},{tagName:"path",selector:"line",attributes:{fill:"none"}}]})}(joint.dia,joint.util,joint.env,V),joint.routers.manhattan=function(a,b,c,d){"use strict";function e(a){this.map={},this.options=a,this.mapGridSize=100}function f(){this.items=[],this.hash={},this.values={},this.OPEN=1,this.CLOSE=2}function g(a,b){return b&&b.paddingBox?a.sourceBBox.clone().moveAndExpand(b.paddingBox):a.sourceBBox.clone()}function h(a,b){return b&&b.paddingBox?a.targetBBox.clone().moveAndExpand(b.paddingBox):a.targetBBox.clone()}function i(a,b){if(a.sourceAnchor)return a.sourceAnchor;var c=g(a,b);return c.center()}function j(a,b){if(a.targetAnchor)return a.targetAnchor;var c=h(a,b);return c.center()}function k(b,c,d,e,f){var g=360/d,h=b.theta(l(b,c,e,f)),i=a.normalizeAngle(h+g/2);return g*Math.floor(i/g)}function l(b,c,d,e){var f=e.step,g=c.x-b.x,h=c.y-b.y,i=g/d.x,j=h/d.y,k=i*f,l=j*f;return new a.Point(b.x+k,b.y+l)}function m(a,b){var c=Math.abs(a-b);return c>180?360-c:c}function n(a,b,c){var e=c.step;d.toArray(c.directions).forEach(function(a){a.gridOffsetX=a.offsetX/e*b.x,a.gridOffsetY=a.offsetY/e*b.y})}function o(a,b,c){return{source:b.clone(),x:p(c.x-b.x,a),y:p(c.y-b.y,a)}}function p(a,b){if(!a)return b;var c=Math.abs(a),d=Math.round(c/b);if(!d)return c;var e=d*b,f=c-e,g=f/d;return b+g}function q(b,c){var d=c.source,e=a.snapToGrid(b.x-d.x,c.x)+d.x,f=a.snapToGrid(b.y-d.y,c.y)+d.y;return new a.Point(e,f)}function r(a,b){return a?a.round(b.precision):a}function s(a){return a.clone().round().toString()}function t(b){return new a.Point(0===b.x?0:Math.abs(b.x)/b.x,0===b.y?0:Math.abs(b.y)/b.y)}function u(a,b,c,d,e,f){for(var g,h=[],i=t(e.difference(c)),j=s(c),k=a[j];k;){g=r(b[j],f);var l=t(g.difference(r(k.clone(),f)));l.equals(i)||(h.unshift(g),i=l),j=s(k),k=a[j]}var m=r(b[j],f),n=t(m.difference(d));return n.equals(i)||h.unshift(m),h}function v(a,b){for(var c=1/0,d=0,e=b.length;dj)&&(j=w,t=q(v,f))}var x=r(t,g);x&&(c.containsPoint(x)&&r(x.offset(l.x*f.x,l.y*f.y),g),d.push(x))}return d},[]);return c.containsPoint(i)||n.push(i),n}function x(b,c,e,g){var h,l;h=b instanceof a.Rect?i(this,g).clone():b.clone(),l=c instanceof a.Rect?j(this,g).clone():c.clone();var p,t,x,y,z=o(g.step,h,l);if(b instanceof a.Rect?(p=r(q(h,z),g),x=w(p,b,g.startDirections,z,g)):(p=r(q(h,z),g),x=[p]),c instanceof a.Rect?(t=r(q(l,z),g),y=w(l,c,g.endDirections,z,g)):(t=r(q(l,z),g),y=[t]),x=x.filter(e.isPointAccessible,e),y=y.filter(e.isPointAccessible,e),x.length>0&&y.length>0){for(var A=new f,B={},C={},D={},E=0,F=x.length;E0;){var Q,R=A.pop(),S=B[R],T=C[R],U=D[R],V=void 0===T,W=S.equals(p);if(Q=V?L?W?null:k(p,S,N,z,g):K:k(T,S,N,z,g),O.indexOf(R)>=0)return g.previousDirectionAngle=Q,u(C,B,S,p,t,g);for(E=0;Eg.maxAllowedDirectionChange)){var Y=S.clone().offset(I.gridOffsetX,I.gridOffsetY),Z=s(Y);if(!A.isClose(Z)&&e.isPointAccessible(Y)){if(O.indexOf(Z)>=0){r(Y,g);var $=Y.equals(t);if(!$){var _=k(Y,t,N,z,g),aa=m(X,_);if(aa>g.maxAllowedDirectionChange)continue}}var ba=I.cost,ca=W?0:g.penalties[J],da=U+ba+ca;(!A.isOpen(Z)||da90){var i=f;f=h,h=i}var j=d%90<45?f:h,k=new g.Line(a,j),l=90*Math.ceil(d/90),m=g.Point.fromPolar(k.squaredLength(),g.toRad(l+135),j),n=new g.Line(b,m),o=k.intersection(n),p=o?o:b,q=o?p:a,r=360/c.directions.length,s=q.theta(b),t=g.normalizeAngle(s+r/2),u=r*Math.floor(t/r);return c.previousDirectionAngle=u,p&&e.push(p.round()),e.push(b),e}};return function(c,d,e){if(!a.isFunction(joint.routers.manhattan))throw new Error("Metro requires the manhattan router.");return joint.routers.manhattan(c,a.assign({},b,d),e)}}(joint.util),joint.routers.normal=function(a,b,c){return a},joint.routers.oneSide=function(a,b,c){var d,e,f,g=b.side||"bottom",h=b.padding||40,i=c.sourceBBox,j=c.targetBBox,k=i.center(),l=j.center();switch(g){case"bottom":f=1,d="y",e="height";break;case"top":f=-1,d="y",e="height";break;case"left":f=-1,d="x",e="width";break;case"right":f=1,d="x",e="width";break;default:throw new Error("Router: invalid side")}return k[d]+=f*(i[e]/2+h),l[d]+=f*(j[e]/2+h),f*(k[d]-l[d])>0?l[d]=k[d]:k[d]=l[d],[k].concat(a,l)},joint.routers.orthogonal=function(a){function b(a,b,c){var d=new g.Point(a.x,b.y);return c.containsPoint(d)&&(d=new g.Point(b.x,a.y)),d}function c(a,b){return a["W"===b||"E"===b?"width":"height"]}function d(a,b){return a.x===b.x?a.y>b.y?"N":"S":a.y===b.y?a.x>b.x?"W":"E":null}function e(a){return new g.Rect(a.x,a.y,0,0)}function f(a,b){var c=b&&b.elementPadding||20;return a.sourceBBox.clone().inflate(c)}function h(a,b){var c=b&&b.elementPadding||20;return a.targetBBox.clone().inflate(c)}function i(a,b){if(a.sourceAnchor)return a.sourceAnchor;var c=f(a,b);return c.center()}function j(a,b){if(a.targetAnchor)return a.targetAnchor;var c=h(a,b);return c.center()}function k(a,b,c){var e=new g.Point(a.x,b.y),f=new g.Point(b.x,a.y),h=d(a,e),i=d(a,f),j=q[c],k=h===c||h!==j&&(i===j||i!==c)?e:f;return{points:[k],direction:d(k,b)}}function l(a,c,e){var f=b(a,c,e);return{points:[f],direction:d(f,c)}}function m(e,f,h,i){var j,k={},l=[new g.Point(e.x,f.y),new g.Point(f.x,e.y)],m=l.filter(function(a){return!h.containsPoint(a)}),n=m.filter(function(a){return d(a,e)!==i});if(n.length>0)j=n.filter(function(a){return d(e,a)===i}).pop(),j=j||n[0],k.points=[j],k.direction=d(j,f);else{j=a.difference(l,m)[0];var o=new g.Point(f).move(j,-c(h,i)/2),p=b(o,e,h);k.points=[p,o],k.direction=d(o,f)}return k}function n(a,b,e,f){var h=l(b,a,f),i=h.points[0];if(e.containsPoint(i)){h=l(a,b,e);var j=h.points[0];if(f.containsPoint(j)){var m=new g.Point(a).move(j,-c(e,d(a,j))/2),n=new g.Point(b).move(i,-c(f,d(b,i))/2),o=new g.Line(m,n).midpoint(),p=l(a,o,e),q=k(o,b,p.direction);h.points=[p.points[0],q.points[0]],h.direction=q.direction}}return h}function o(a,c,e,f,h){var i,j,k,l={},m=e.union(f).inflate(1),n=m.center().distance(c)>m.center().distance(a),o=n?c:a,p=n?a:c;return h?(i=g.Point.fromPolar(m.width+m.height,r[h],o),i=m.pointNearestToPoint(i).move(i,-1)):i=m.pointNearestToPoint(o).move(o,1),j=b(i,p,m),i.round().equals(j.round())?(j=g.Point.fromPolar(m.width+m.height,g.toRad(i.theta(o))+Math.PI/2,p),j=m.pointNearestToPoint(j).move(p,1).round(),k=b(i,j,m),l.points=n?[j,k,i]:[i,k,j]):l.points=n?[j,i]:[i,j],l.direction=n?d(i,c):d(j,c),l}function p(b,c,p){var q=c.elementPadding||20,r=f(p,c),s=h(p,c),t=i(p,c),u=j(p,c);r=r.union(e(t)),s=s.union(e(u)),b=a.toArray(b).map(g.Point),b.unshift(t),b.push(u);for(var v,w=[],x=0,y=b.length-1;x=Math.abs(a.y-b.y)){var k=(a.x+b.x)/2;j=g.Path.createSegment("C",k,a.y,k,b.y,b.x,b.y),e.appendSegment(j)}else{var l=(a.y+b.y)/2;j=g.Path.createSegment("C",a.x,l,b.x,l,b.x,b.y),e.appendSegment(j)}}return f?e:e.serialize()},joint.connectors.jumpover=function(a,b,c){function d(a,c,d){var e=[].concat(a,d,c);return e.reduce(function(a,c,d){var f=e[d+1];return null!=f&&(a[d]=b.line(c,f)),a},[])}function e(a){var b=a.paper._jumpOverUpdateList;null==b&&(b=a.paper._jumpOverUpdateList=[],a.paper.on("cell:pointerup",f),a.paper.model.on("reset",function(){b=a.paper._jumpOverUpdateList=[]})),b.indexOf(a)<0&&(b.push(a),a.listenToOnce(a.model,"change:connector remove",function(){b.splice(b.indexOf(a),1)}))}function f(){for(var a=this._jumpOverUpdateList,b=0;bw)||"jumpover"!==d.name)}),z=y.map(function(a){return s.findViewByModel(a)}),A=d(a,b,f),B=z.map(function(a){return null==a?[]:a===this?A:d(a.sourcePoint,a.targetPoint,a.route)},this),C=A.reduce(function(a,b){var c=y.reduce(function(a,c,d){if(c!==v){var e=g(b,B[d]);a.push.apply(a,e)}return a},[]).sort(function(a,c){return h(b.start,a)-h(b.start,c)});return c.length>0?a.push.apply(a,i(b,c,p)):a.push(b),a},[]),D=j(C,p,q);return o?D:D.serialize()}}(_,g,joint.util),function(a,b,c,d){function e(a,b,d){var e=a.toJSON();return e.angle=b||0,c.util.defaults({},d,e)}function f(a,c,d){return a.map(function(a,b,c){var d=this.pointAt((b+.5)/c.length);return(a.dx||a.dy)&&d.offset(a.dx||0,a.dy||0),e(d.round(),0,a)},b.line(c,d))}function g(a,c,d,f){var g=c.center(),h=c.width/c.height,i=c.topMiddle(),j=b.Ellipse.fromRect(c);return a.map(function(a,b,c){var k=d+f(b,c.length),l=i.clone().rotate(g,-k).scale(h,1,g),m=a.compensateRotation?-j.tangentTheta(l):0;return(a.dx||a.dy)&&l.offset(a.dx||0,a.dy||0),a.dr&&l.move(g,a.dr),e(l.round(),m,a)})}function h(a,c){var e=c.x;d.isString(e)&&(e=parseFloat(e)/100*a.width);var f=c.y;return d.isString(f)&&(f=parseFloat(f)/100*a.height),b.point(e||0,f||0)}c.layout.Port={absolute:function(a,b,c){return a.map(h.bind(null,b))},fn:function(a,b,c){return c.fn(a,b,c)},line:function(a,b,c){var d=h(b,c.start||b.origin()),e=h(b,c.end||b.corner());return f(a,d,e)},left:function(a,b,c){return f(a,b.origin(),b.bottomLeft())},right:function(a,b,c){return f(a,b.topRight(),b.corner())},top:function(a,b,c){return f(a,b.origin(),b.topRight())},bottom:function(a,b,c){return f(a,b.bottomLeft(),b.corner())},ellipseSpread:function(a,b,c){var d=c.startAngle||0,e=c.step||360/a.length;return g(a,b,d,function(a){return a*e})},ellipse:function(a,b,c){var d=c.startAngle||0,e=c.step||20;return g(a,b,d,function(a,b){return(a+.5-b/2)*e})}}}(_,g,joint,joint.util),function(a,b,c,d){function e(a,b){return d.defaultsDeep({},a,b,{x:0,y:0,angle:0,attrs:{".":{y:"0","text-anchor":"start"}}})}function f(a,b,c,f){f=d.defaults({},f,{offset:15});var h,i,j,k,l=b.center().theta(a),m=g(b),n=f.offset,o=0;lm[2]?(j=".3em",h=n,i=0,k="start"):lo[2]?(k=".3em",i=-m,j=0,l="end"):h-270&&i<-90?(g="start",j=i-180):g="end";var m=Math.round;return e({x:m(k.x),y:m(k.y),angle:c?j:0,attrs:{".":{y:l,"text-anchor":g}}})}c.layout.PortLabel={manual:function(a,b,c){return e(c,b)},left:function(a,b,c){return e(c,{x:-15,attrs:{".":{y:".3em","text-anchor":"end"}}})},right:function(a,b,c){return e(c,{x:15,attrs:{".":{y:".3em","text-anchor":"start"}}})},top:function(a,b,c){return e(c,{y:-15,attrs:{".":{"text-anchor":"middle"}}})},bottom:function(a,b,c){return e(c,{y:15,attrs:{".":{y:".6em","text-anchor":"middle"}}})},outsideOriented:function(a,b,c){return f(a,b,!0,c)},outside:function(a,b,c){return f(a,b,!1,c)},insideOriented:function(a,b,c){return h(a,b,!0,c)},inside:function(a,b,c){return h(a,b,!1,c)},radial:function(a,b,c){return i(a.difference(b.center()),!1,c)},radialOriented:function(a,b,c){return i(a.difference(b.center()),!0,c)}}}(_,g,joint,joint.util),joint.highlighters.addClass={className:joint.util.addClassNamePrefix("highlighted"),highlight:function(a,b,c){var d=c||{},e=d.className||this.className;V(b).addClass(e)},unhighlight:function(a,b,c){var d=c||{},e=d.className||this.className;V(b).removeClass(e)}},joint.highlighters.opacity={highlight:function(a,b){V(b).addClass(joint.util.addClassNamePrefix("highlight-opacity"))},unhighlight:function(a,b){V(b).removeClass(joint.util.addClassNamePrefix("highlight-opacity"))}},joint.highlighters.stroke={defaultOptions:{padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},_views:{},getHighlighterId:function(a,b){return a.id+JSON.stringify(b)},removeHighlighter:function(a){this._views[a]&&(this._views[a].remove(),this._views[a]=null)},highlight:function(a,b,c){var d=this.getHighlighterId(b,c);if(!this._views[d]){var e,f=joint.util.defaults(c||{},this.defaultOptions),g=V(b);try{var h=g.convertToPathData()}catch(a){e=g.bbox(!0),h=V.rectToPath(joint.util.assign({},f,e))}var i=V("path").attr({d:h,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"}).attr(f.attrs),j=g.getTransformToElement(a.el),k=f.padding;if(k){e||(e=g.bbox(!0));var l=e.x+e.width/2,m=e.y+e.height/2;e=V.transformRect(e,j);var n=Math.max(e.width,1),o=Math.max(e.height,1),p=(n+k)/n,q=(o+k)/o,r=V.createSVGMatrix({a:p,b:0,c:0,d:q,e:l-p*l,f:m-q*m});j=j.multiply(r)}i.transform(j);var s=this._views[d]=new joint.mvc.View({svgElement:!0,className:"highlight-stroke",el:i.node}),t=this.removeHighlighter.bind(this,d),u=a.model;s.listenTo(u,"remove",t),s.listenTo(u.graph,"reset",t),a.vel.append(i)}},unhighlight:function(a,b,c){this.removeHighlighter(this.getHighlighterId(b,c))}},function(a,b){function c(a){return function(c,d,e,f){var g=!!f.rotate,h=g?c.getNodeUnrotatedBBox(d):c.getNodeBBox(d),i=h[a](),j=f.dx;if(j){var k=b.isPercentage(j);j=parseFloat(j),isFinite(j)&&(k&&(j/=100,j*=h.width),i.x+=j)}var l=f.dy;if(l){var m=b.isPercentage(l);l=parseFloat(l),isFinite(l)&&(m&&(l/=100,l*=h.height),i.y+=l)}return g?i.rotate(c.model.getBBox().center(),-c.model.angle()):i}}function d(a){return function(b,c,d,e){if(d instanceof Element){var f=this.paper.findView(d),h=f?f.getNodeBBox(d).center():new g.Point;return a.call(this,b,c,h,e)}return a.apply(this,arguments)}}function e(a,b,c,d){var e=a.model.angle(),f=a.getNodeBBox(b),h=f.center(),i=f.origin(),j=f.corner(),k=d.padding;if(isFinite(k)||(k=0),i.y+k<=c.y&&c.y<=j.y-k){var l=c.y-h.y;h.x+=0===e||180===e?0:1*l/Math.tan(g.toRad(e)),h.y+=l}else if(i.x+k<=c.x&&c.x<=j.x-k){var m=c.x-h.x;h.y+=90===e||270===e?0:m*Math.tan(g.toRad(e)),h.x+=m}return h}function f(a,b,c,d){var e,f,g,h=!!d.rotate;h?(e=a.getNodeUnrotatedBBox(b),g=a.model.getBBox().center(),f=a.model.angle()):e=a.getNodeBBox(b);var i=d.padding;isFinite(i)&&e.inflate(i),h&&c.rotate(g,f);var j,k=e.sideNearestToPoint(c);switch(k){case"left":j=e.leftMiddle();break;case"right":j=e.rightMiddle();break;case"top":j=e.topMiddle();break;case"bottom":j=e.bottomMiddle()}return h?j.rotate(g,-f):j}function h(a,b){var c=a.model,d=c.getBBox(),e=d.center(),f=c.angle(),h=a.findAttribute("port",b);if(h){portGroup=c.portProp(h,"group");var i=c.getPortsPositions(portGroup),j=new g.Point(i[h]).offset(d.origin());return j.rotate(e,-f),j}return e}a.anchors={center:c("center"),top:c("topMiddle"),bottom:c("bottomMiddle"),left:c("leftMiddle"),right:c("rightMiddle"),topLeft:c("origin"),topRight:c("topRight"),bottomLeft:c("bottomLeft"),bottomRight:c("corner"),perpendicular:d(e),midSide:d(f),modelCenter:h}}(joint,joint.util),function(a,b,c,d){function e(a,c){return 1===a.length?a[0]:b.sortBy(a,function(a){return a.squaredDistance(c)})[0]}function f(a,b,c){if(!isFinite(c))return a;var d=a.distance(b);return 0===c&&d>0?a:a.move(b,-Math.min(c,d-1))}function g(a){var b=a.getAttribute("stroke-width");return null===b?0:parseFloat(b)||0}function h(a,b,c,d){return f(a.end,a.start,d.offset)}function i(a,b,c,d){var h=b.getNodeBBox(c);d.stroke&&h.inflate(g(c)/2);var i=a.intersect(h),j=i?e(i,a.start):a.end;return f(j,a.start,d.offset)}function j(a,b,c,d){var h=b.model.angle();if(0===h)return i(a,b,c,d);var j=b.getNodeUnrotatedBBox(c);d.stroke&&j.inflate(g(c)/2);var k=j.center(),l=a.clone().rotate(k,h),m=l.setLength(1e6).intersect(j),n=m?e(m,l.start).rotate(k,-h):a.end;return f(n,a.start,d.offset)}function k(a,h,i,j){var k,n,o=j.selector,p=a.end;if("string"==typeof o)k=h.findBySelector(o)[0];else if(Array.isArray(o))k=b.getByPath(i,o);else{k=i;do{var q=k.tagName.toUpperCase();if("G"===q)k=k.firstChild;else{if("TITLE"!==q)break;k=k.nextSibling}}while(k)}if(!(k instanceof Element))return p;var r=h.getNodeShape(k),s=h.getNodeMatrix(k),t=h.getRootTranslateMatrix(),u=h.getRootRotateMatrix(),v=t.multiply(u).multiply(s),w=v.inverse(),x=d.transformLine(a,w),y=x.start.clone(),z=h.getNodeData(k);if(j.insideout===!1){z[m]||(z[m]=r.bbox());var A=z[m];if(A.containsPoint(y))return p}var B;if(r instanceof c.Path){var C=j.precision||2;z[l]||(z[l]=r.getSegmentSubdivisions({precision:C})),segmentSubdivisions=z[l],B={precision:C,segmentSubdivisions:z[l]}}j.extrapolate===!0&&x.setLength(1e6),n=x.intersect(r,B),n?d.isArray(n)&&(n=e(n,y)):j.sticky===!0&&(n=r instanceof c.Rect?r.pointNearestToPoint(y):r instanceof c.Ellipse?r.intersectionWithLineFromCenterToPoint(y):r.closestPoint(y,B));var D=n?d.transformPoint(n,v):p,E=j.offset||0;return j.stroke&&(E+=g(k)/2),f(D,a.start,E)}var l="segmentSubdivisons",m="shapeBBox";a.connectionPoints={anchor:h,bbox:i,rectangle:j,boundary:k}}(joint,joint.util,g,V),function(a,b){function c(a,b){return 0===b?"0%":Math.round(a/b*100)+"%"}function d(a){return function(b,d,e,f){var g=d.model.angle(),h=d.getNodeUnrotatedBBox(e),i=d.model.getBBox().center();f.rotate(i,g);var j=f.x-h.x,k=f.y-h.y;return a&&(j=c(j,h.width),k=c(k,h.height)),b.anchor={name:"topLeft",args:{dx:j,dy:k,rotate:!0}},b}}a.connectionStrategies={useDefaults:b.noop,pinAbsolute:d(!1),pinRelative:d(!0)}}(joint,joint.util),function(a,b,c,d){function e(b,c,d){var e=a.connectionStrategies.pinRelative.call(this.paper,{},c,d,b,this.model);return e.anchor}function f(a,b,c,d,e,f){var g=f.options.snapRadius,h="source"===d,i=h?0:-1,j=this.model.vertex(i)||this.getEndAnchor(h?"target":"source");return j&&(Math.abs(j.x-a.x)0?c[a-1]:b.sourceAnchor,f=a0){var d=this.getNeighborPoints(b),e=d.prev,f=d.next;Math.abs(a.x-e.x)0&&b<=1,d=0,e={x:0,y:0};if(a.offset){var f=a.offset;"number"==typeof f&&(d=f),f.x&&(e.x=f.x),f.y&&(e.y=f.y)}var g,h=0!==e.x||0!==e.y||0===d,i=this.path,j={segmentSubdivisions:this.getConnectionSubdivisions()},k=c?b*this.getConnectionLength():b;if(h)g=i.pointAtLength(k,j),g.offset(e);else{var l=i.tangentAtLength(k,j);l?(l.rotate(l.start,-90),l.setLength(d),g=l.end):g=i.start}return g},getVertexIndex:function(a,b){for(var c=this.model,d=c.vertices(),e=this.getClosestPointLength(new g.Point(a,b)),f=0,h=d.length;f0){for(var j=0,k=i.length;j").addClass(joint.util.addClassNamePrefix("paper-background")),this.options.background&&this.drawBackground(this.options.background),this.$grid=$("
").addClass(joint.util.addClassNamePrefix("paper-grid")),this.options.drawGrid&&this.drawGrid(),this.$el.append(this.$background,this.$grid,this.svg),this},update:function(){return this.options.drawGrid&&this.drawGrid(),this._background&&this.updateBackgroundImage(this._background),this},_viewportMatrix:null,_viewportTransformString:null,matrix:function(a){var b=this.viewport;if(void 0===a){var c=b.getAttribute("transform");return(this._viewportTransformString||null)===c?a=this._viewportMatrix:(a=b.getCTM(),this._viewportMatrix=a,this._viewportTransformString=c),V.createSVGMatrix(a)}a=V.createSVGMatrix(a);var d=V.matrixToTransformString(a);return b.setAttribute("transform",d),this.tools.setAttribute("transform",d),this._viewportMatrix=a,this._viewportTransformString=b.getAttribute("transform"),this},clientMatrix:function(){return V.createSVGMatrix(this.viewport.getScreenCTM())},_sortDelayingBatches:["add","to-front","to-back"],_onSort:function(){this.model.hasActiveBatch(this._sortDelayingBatches)||this.sortViews()},_onBatchStop:function(a){var b=a&&a.batchName;this._sortDelayingBatches.includes(b)&&!this.model.hasActiveBatch(this._sortDelayingBatches)&&this.sortViews()},onRemove:function(){this.removeViews()},setDimensions:function(a,b){a=this.options.width=a||this.options.width,b=this.options.height=b||this.options.height,this.$el.css({width:Math.round(a),height:Math.round(b)}),this.trigger("resize",a,b)},setOrigin:function(a,b){return this.translate(a||0,b||0,{absolute:!0})},fitToContent:function(a,b,c,d){joint.util.isObject(a)?(d=a,a=d.gridWidth||1,b=d.gridHeight||1,c=d.padding||0):(d=d||{},a=a||1,b=b||1,c=c||0),c=joint.util.normalizeSides(c);var e=V(this.viewport).getBBox(),f=this.scale(),g=this.translate();e.x*=f.sx,e.y*=f.sy,e.width*=f.sx,e.height*=f.sy;var h=Math.max(Math.ceil((e.width+e.x)/a),1)*a,i=Math.max(Math.ceil((e.height+e.y)/b),1)*b,j=0,k=0;("negative"==d.allowNewOrigin&&e.x<0||"positive"==d.allowNewOrigin&&e.x>=0||"any"==d.allowNewOrigin)&&(j=Math.ceil(-e.x/a)*a,j+=c.left,h+=j),("negative"==d.allowNewOrigin&&e.y<0||"positive"==d.allowNewOrigin&&e.y>=0||"any"==d.allowNewOrigin)&&(k=Math.ceil(-e.y/b)*b,k+=c.top,i+=k),h+=c.right,i+=c.bottom,h=Math.max(h,d.minWidth||0),i=Math.max(i,d.minHeight||0),h=Math.min(h,d.maxWidth||Number.MAX_VALUE),i=Math.min(i,d.maxHeight||Number.MAX_VALUE);var l=h!=this.options.width||i!=this.options.height,m=j!=g.tx||k!=g.ty;m&&this.translate(j,k),l&&this.setDimensions(h,i)},scaleContentToFit:function(a){var b=this.getContentBBox();if(b.width&&b.height){a=a||{},joint.util.defaults(a,{padding:0,preserveAspectRatio:!0,scaleGrid:null,minScale:0,maxScale:Number.MAX_VALUE});var c,d=a.padding,e=a.minScaleX||a.minScale,f=a.maxScaleX||a.maxScale,h=a.minScaleY||a.minScale,i=a.maxScaleY||a.maxScale;if(a.fittingBBox)c=a.fittingBBox;else{var j=this.translate();c={x:j.tx,y:j.ty,width:this.options.width,height:this.options.height}}c=g.rect(c).moveAndExpand({x:d,y:d,width:-2*d,height:-2*d});var k=this.scale(),l=c.width/b.width*k.sx,m=c.height/b.height*k.sy;if(a.preserveAspectRatio&&(l=m=Math.min(l,m)),a.scaleGrid){var n=a.scaleGrid;l=n*Math.floor(l/n),m=n*Math.floor(m/n)}l=Math.min(f,Math.max(e,l)),m=Math.min(i,Math.max(h,m)),this.scale(l,m);var o=this.getContentBBox(),p=c.x-o.x,q=c.y-o.y;this.translate(p,q)}},getContentArea:function(){return V(this.viewport).getBBox()},getContentBBox:function(){var a=this.viewport.getBoundingClientRect(),b=this.clientMatrix(),c=this.translate();return g.rect({x:a.left-b.e+c.tx,y:a.top-b.f+c.ty,width:a.width,height:a.height})},getArea:function(){return this.paperToLocalRect({x:0,y:0,width:this.options.width,height:this.options.height})},getRestrictedArea:function(){var a;return a=joint.util.isFunction(this.options.restrictTranslate)?this.options.restrictTranslate.apply(this,arguments):this.options.restrictTranslate===!0?this.getArea():this.options.restrictTranslate||null},createViewForModel:function(a){var b,c,d=this.options.cellViewNamespace,e=a.get("type")+"View",f=joint.util.getByPath(d,e,".");a.isLink()?(b=this.options.linkView,c=joint.dia.LinkView):(b=this.options.elementView,c=joint.dia.ElementView);var g=b.prototype instanceof Backbone.View?f||b:b.call(this,a)||f||c;return new g({model:a,interactive:this.options.interactive})},onCellAdded:function(a,b,c){if(this.options.async&&c.async!==!1&&joint.util.isNumber(c.position)){if(this._asyncCells=this._asyncCells||[],this._asyncCells.push(a),0==c.position){if(this._frameId)throw new Error("another asynchronous rendering in progress");this.asyncRenderViews(this._asyncCells,c),delete this._asyncCells}}else this.renderView(a)},removeView:function(a){var b=this._views[a.id];return b&&(b.remove(),delete this._views[a.id]),b},renderView:function(a){var b=this._views[a.id]=this.createViewForModel(a);return V(this.viewport).append(b.el),b.paper=this,b.render(),b},onImageDragStart:function(){return!1},beforeRenderViews:function(a){return a.sort(function(a){return a.isLink()?1:-1}),a},afterRenderViews:function(){this.sortViews()},resetViews:function(a,b){this.removeViews();var c=a.models.slice();if(c=this.beforeRenderViews(c,b)||c,this.cancelRenderViews(),this.options.async)this.asyncRenderViews(c,b);else{for(var d=0,e=c.length;d(e.get("z")||0)?1:-1})},scale:function(a,b,c,d){if(void 0===a)return V.matrixToScale(this.matrix());void 0===b&&(b=a),void 0===c&&(c=0,d=0);var e=this.translate();if(c||d||e.tx||e.ty){var f=e.tx-c*(a-1),g=e.ty-d*(b-1);this.translate(f,g)}var h=this.matrix();return h.a=a||0,h.d=b||0,this.matrix(h),this.trigger("scale",a,b,c,d),this},rotate:function(a,b,c){if(void 0===a)return V.matrixToRotate(this.matrix());if(void 0===b){var d=this.viewport.getBBox();b=d.width/2,c=d.height/2}var e=this.matrix().translate(b,c).rotate(a).translate(-b,-c);return this.matrix(e),this},translate:function(a,b){if(void 0===a)return V.matrixToTranslate(this.matrix());var c=this.matrix();c.e=a||0,c.f=b||0,this.matrix(c);var d=this.translate(),e=this.options.origin;return e.x=d.tx,e.y=d.ty,this.trigger("translate",d.tx,d.ty),this.options.drawGrid&&this.drawGrid(),this},findView:function(a){for(var b=joint.util.isString(a)?this.viewport.querySelector(a):a instanceof $?a[0]:a;b&&b!==this.el&&b!==document;){var c=b.getAttribute("model-id");if(c)return this._views[c];b=b.parentNode}},findViewByModel:function(a){var b=joint.util.isString(a)||joint.util.isNumber(a)?a:a&&a.id;return this._views[b]},findViewsFromPoint:function(a){a=g.point(a);var b=this.model.getElements().map(this.findViewByModel,this);return b.filter(function(b){return b&&b.vel.getBBox({target:this.viewport}).containsPoint(a)},this)},findViewsInArea:function(a,b){b=joint.util.defaults(b||{},{strict:!1}),a=g.rect(a);var c=this.model.getElements().map(this.findViewByModel,this),d=b.strict?"containsRect":"intersect";return c.filter(function(b){return b&&a[d](b.vel.getBBox({target:this.viewport}))},this)},removeTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"remove"),this},hideTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"hide"),this},showTools:function(){return joint.dia.CellView.dispatchToolsEvent(this,"show"),this},getModelById:function(a){return this.model.getCell(a)},snapToGrid:function(a,b){return this.clientToLocalPoint(a,b).snapToGrid(this.options.gridSize)},localToPaperPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.matrix());return g.Point(d)},localToPaperRect:function(a,b,c,d){var e=g.Rect(a,b),f=V.transformRect(e,this.matrix());return g.Rect(f)},paperToLocalPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.matrix().inverse());return g.Point(d)},paperToLocalRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.matrix().inverse());return g.Rect(f)},localToClientPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.clientMatrix());return g.Point(d)},localToClientRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.clientMatrix());return g.Rect(f)},clientToLocalPoint:function(a,b){var c=g.Point(a,b),d=V.transformPoint(c,this.clientMatrix().inverse());return g.Point(d)},clientToLocalRect:function(a,b,c,d){var e=g.Rect(a,b,c,d),f=V.transformRect(e,this.clientMatrix().inverse());return g.Rect(f)},localToPagePoint:function(a,b){return this.localToPaperPoint(a,b).offset(this.pageOffset())},localToPageRect:function(a,b,c,d){return this.localToPaperRect(a,b,c,d).moveAndExpand(this.pageOffset())},pageToLocalPoint:function(a,b){var c=g.Point(a,b),d=c.difference(this.pageOffset());return this.paperToLocalPoint(d)},pageToLocalRect:function(a,b,c,d){var e=this.pageOffset(),f=g.Rect(a,b,c,d);return f.x-=e.x,f.y-=e.y,this.paperToLocalRect(f)},clientOffset:function(){var a=this.svg.getBoundingClientRect();return g.Point(a.left,a.top)},pageOffset:function(){return this.clientOffset().offset(window.scrollX,window.scrollY)},linkAllowed:function(a){if(!(a instanceof joint.dia.LinkView))throw new Error("Must provide a linkView.");var b=a.model,c=this.options,d=this.model,e=d.constructor.validations;return!(!c.multiLinks&&!e.multiLinks.call(this,d,b))&&(!(!c.linkPinning&&!e.linkPinning.call(this,d,b))&&!("function"==typeof c.allowLink&&!c.allowLink.call(this,a,this)))},getDefaultLink:function(a,b){return joint.util.isFunction(this.options.defaultLink)?this.options.defaultLink.call(this,a,b):this.options.defaultLink.clone()},resolveHighlighter:function(a){a=a||{};var b=a.highlighter,c=this.options;if(void 0===b){var d=["embedding","connecting","magnetAvailability","elementAvailability"].find(function(b){return!!a[b]});b=d&&c.highlighting[d]||c.highlighting.default}if(!b)return!1;joint.util.isString(b)&&(b={name:b});var e=b.name,f=c.highlighterNamespace[e];if(!f)throw new Error('Unknown highlighter ("'+e+'")');if("function"!=typeof f.highlight)throw new Error('Highlighter ("'+e+'") is missing required highlight() method');if("function"!=typeof f.unhighlight)throw new Error('Highlighter ("'+e+'") is missing required unhighlight() method');return{highlighter:f,options:b.options||{},name:e}},onCellHighlight:function(a,b,c){if(c=this.resolveHighlighter(c)){b.id||(b.id=V.uniqueId());var d=c.name+b.id+JSON.stringify(c.options);if(!this._highlights[d]){var e=c.highlighter;e.highlight(a,b,joint.util.assign({},c.options)),this._highlights[d]={cellView:a,magnetEl:b,opt:c.options,highlighter:e}}}},onCellUnhighlight:function(a,b,c){if(c=this.resolveHighlighter(c)){var d=c.name+b.id+JSON.stringify(c.options),e=this._highlights[d];e&&(e.highlighter.unhighlight(e.cellView,e.magnetEl,e.opt),this._highlights[d]=null)}},pointerdblclick:function(a){a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target); +if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerdblclick(a,c.x,c.y):this.trigger("blank:pointerdblclick",a,c.x,c.y)}},pointerclick:function(a){if(this._mousemoved<=this.options.clickThreshold){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(this.guard(a,b))return;var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.pointerclick(a,c.x,c.y):this.trigger("blank:pointerclick",a,c.x,c.y)}},contextmenu:function(a){this.options.preventContextMenu&&a.preventDefault(),a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?b.contextmenu(a,c.x,c.y):this.trigger("blank:contextmenu",a,c.x,c.y)}},pointerdown:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.snapToGrid({x:a.clientX,y:a.clientY});b?(a.preventDefault(),b.pointerdown(a,c.x,c.y)):(this.options.preventDefaultBlankAction&&a.preventDefault(),this.trigger("blank:pointerdown",a,c.x,c.y)),this.delegateDragEvents(b,a.data)}},pointermove:function(a){a.preventDefault();var b=this.eventData(a);b.mousemoved||(b.mousemoved=0);var c=++b.mousemoved;if(!(c<=this.options.moveThreshold)){a=joint.util.normalizeEvent(a);var d=this.snapToGrid({x:a.clientX,y:a.clientY}),e=b.sourceView;e?e.pointermove(a,d.x,d.y):this.trigger("blank:pointermove",a,d.x,d.y),this.eventData(a,b)}},pointerup:function(a){this.undelegateDocumentEvents(),a=joint.util.normalizeEvent(a);var b=this.snapToGrid({x:a.clientX,y:a.clientY}),c=this.eventData(a).sourceView;c?c.pointerup(a,b.x,b.y):this.trigger("blank:pointerup",a,b.x,b.y),this.delegateEvents()},mouseover:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b))if(b)b.mouseover(a);else{if(this.el===a.target)return;this.trigger("blank:mouseover",a)}},mouseout:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b))if(b)b.mouseout(a);else{if(this.el===a.target)return;this.trigger("blank:mouseout",a)}},mouseenter:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.findView(a.relatedTarget);if(b){if(c===b)return;b.mouseenter(a)}else{if(c)return;this.trigger("paper:mouseenter",a)}}},mouseleave:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=this.findView(a.relatedTarget);if(b){if(c===b)return;b.mouseleave(a)}else{if(c)return;this.trigger("paper:mouseleave",a)}}},mousewheel:function(a){a=joint.util.normalizeEvent(a);var b=this.findView(a.target);if(!this.guard(a,b)){var c=a.originalEvent,d=this.snapToGrid({x:c.clientX,y:c.clientY}),e=Math.max(-1,Math.min(1,c.wheelDelta||-c.detail));b?b.mousewheel(a,d.x,d.y,e):this.trigger("blank:mousewheel",a,d.x,d.y,e)}},onevent:function(a){var b=a.currentTarget,c=b.getAttribute("event");if(c){var d=this.findView(b);if(d){if(a=joint.util.normalizeEvent(a),this.guard(a,d))return;var e=this.snapToGrid({x:a.clientX,y:a.clientY});d.onevent(a,c,e.x,e.y)}}},onmagnet:function(a){var b=a.currentTarget,c=b.getAttribute("magnet");if(c){var d=this.findView(b);if(d){if(a=joint.util.normalizeEvent(a),this.guard(a,d))return;if(!this.options.validateMagnet(d,b))return;var e=this.snapToGrid(a.clientX,a.clientY);d.onmagnet(a,e.x,e.y)}}},onlabel:function(a){var b=a.currentTarget,c=this.findView(b);if(c){if(a=joint.util.normalizeEvent(a),this.guard(a,c))return;var d=this.snapToGrid(a.clientX,a.clientY);c.onlabel(a,d.x,d.y)}},delegateDragEvents:function(a,b){b||(b={}),this.eventData({data:b},{sourceView:a||null,mousemoved:0}),this.delegateDocumentEvents(null,b),this.undelegateEvents()},guard:function(a,b){return"mousedown"===a.type&&2===a.button||(!(!this.options.guard||!this.options.guard(a,b))||(a.data&&void 0!==a.data.guarded?a.data.guarded:!(b&&b.model&&b.model instanceof joint.dia.Cell)&&(this.svg!==a.target&&this.el!==a.target&&!$.contains(this.svg,a.target))))},setGridSize:function(a){return this.options.gridSize=a,this.options.drawGrid&&this.drawGrid(),this},clearGrid:function(){return this.$grid&&this.$grid.css("backgroundImage","none"),this},_getGriRefs:function(){return this._gridCache||(this._gridCache={root:V("svg",{width:"100%",height:"100%"},V("defs")),patterns:{},add:function(a,b){V(this.root.node.childNodes[0]).append(b),this.patterns[a]=b,this.root.append(V("rect",{width:"100%",height:"100%",fill:"url(#"+a+")"}))},get:function(a){return this.patterns[a]},exist:function(a){return void 0!==this.patterns[a]}}),this._gridCache},setGrid:function(a){this.clearGrid(),this._gridCache=null,this._gridSettings=[];var b=Array.isArray(a)?a:[a||{}];return b.forEach(function(a){this._gridSettings.push.apply(this._gridSettings,this._resolveDrawGridOption(a))},this),this},_resolveDrawGridOption:function(a){var b=this.constructor.gridPatterns;if(joint.util.isString(a)&&Array.isArray(b[a]))return b[a].map(function(a){return joint.util.assign({},a)});var c=a||{args:[{}]},d=Array.isArray(c),e=c.name;if(d||e||c.markup||(e="dot"),e&&Array.isArray(b[e])){var f=b[e].map(function(a){return joint.util.assign({},a)}),g=Array.isArray(c.args)?c.args:[c.args||{}];joint.util.defaults(g[0],joint.util.omit(a,"args"));for(var h=0;h'),f=joint.util.toArray(d).map(function(a){return e({offset:a.offset,color:a.color,opacity:Number.isFinite(a.opacity)?a.opacity:1})}),g=["<"+c+">",f.join(""),""].join(""),h=joint.util.assign({id:b},a.attrs);V(g,h).appendTo(this.defs)}return b},defineMarker:function(a){if(!joint.util.isObject(a))throw new TypeError("dia.Paper: defineMarker() requires 1. argument to be an object.");var b=a.id;if(b||(b=this.svg.id+joint.util.hashCode(JSON.stringify(a))),!this.isDefined(b)){var c=joint.util.omit(a,"type","userSpaceOnUse"),d=V("marker",{id:b,orient:"auto",overflow:"visible",markerUnits:a.markerUnits||"userSpaceOnUse"},[V(a.type||"path",c)]);d.appendTo(this.defs)}return b}},{backgroundPatterns:{flipXy:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=2*c,b.height=2*d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.setTransform(-1,0,0,-1,b.width,b.height),e.drawImage(a,0,0,c,d),e.setTransform(-1,0,0,1,b.width,0),e.drawImage(a,0,0,c,d),e.setTransform(1,0,0,-1,0,b.height),e.drawImage(a,0,0,c,d),b},flipX:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=2*c,b.height=d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.translate(2*c,0),e.scale(-1,1),e.drawImage(a,0,0,c,d),b},flipY:function(a){var b=document.createElement("canvas"),c=a.width,d=a.height;b.width=c,b.height=2*d;var e=b.getContext("2d");return e.drawImage(a,0,0,c,d),e.translate(0,2*d),e.scale(1,-1),e.drawImage(a,0,0,c,d),b},watermark:function(a,b){b=b||{};var c=a.width,d=a.height,e=document.createElement("canvas");e.width=3*c,e.height=3*d;for(var f=e.getContext("2d"),h=joint.util.isNumber(b.watermarkAngle)?-b.watermarkAngle:-20,i=g.toRad(h),j=e.width/4,k=e.height/4,l=0;l<4;l++)for(var m=0;m<4;m++)(l+m)%2>0&&(f.setTransform(1,0,0,1,(2*l-1)*j,(2*m-1)*k),f.rotate(i),f.drawImage(a,-c/2,-d/2,c,d));return e}},gridPatterns:{dot:[{color:"#AAAAAA",thickness:1,markup:"rect",update:function(a,b){V(a).attr({width:b.thickness*b.sx,height:b.thickness*b.sy,fill:b.color})}}],fixedDot:[{color:"#AAAAAA",thickness:1,markup:"rect",update:function(a,b){var c=b.sx<=1?b.thickness*b.sx:b.thickness;V(a).attr({width:c,height:c,fill:b.color})}}],mesh:[{color:"#AAAAAA",thickness:1,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}}],doubleMesh:[{color:"#AAAAAA",thickness:1,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}},{color:"#000000",thickness:3,scaleFactor:4,markup:"path",update:function(a,b){var c,d=b.width,e=b.height,f=b.thickness;c=d-f>=0&&e-f>=0?["M",d,0,"H0 M0 0 V0",e].join(" "):"M 0 0 0 0",V(a).attr({d:c,stroke:b.color,"stroke-width":b.thickness})}}]}}),function(a,b){var c=function(c){var d=b.cloneDeep(c)||{};this.ports=[],this.groups={},this.portLayoutNamespace=a.layout.Port,this.portLabelLayoutNamespace=a.layout.PortLabel,this._init(d)};c.prototype={getPorts:function(){return this.ports},getGroup:function(a){return this.groups[a]||{}},getPortsByGroup:function(a){return this.ports.filter(function(b){return b.group===a})},getGroupPortsMetrics:function(a,c){var d=this.getGroup(a),e=this.getPortsByGroup(a),f=d.position||{},h=f.name,i=this.portLayoutNamespace;i[h]||(h="left");var j=f.args||{},k=e.map(function(a){return a&&a.position&&a.position.args}),l=i[h](k,c,j),m={ports:e,result:[]};return b.toArray(l).reduce(function(a,b,d){var e=a.ports[d];return a.result.push({portId:e.id,portTransformation:b,labelTransformation:this._getPortLabelLayout(e,g.Point(b),c),portAttrs:e.attrs,portSize:e.size,labelSize:e.label.size}),a}.bind(this),m),m.result},_getPortLabelLayout:function(a,b,c){var d=this.portLabelLayoutNamespace,e=a.label.position.name||"left";return d[e]?d[e](b,c,a.label.position.args):null},_init:function(a){if(b.isObject(a.groups))for(var c=Object.keys(a.groups),d=0,e=c.length;d0},hasPort:function(a){return this.getPortIndex(a)!==-1},getPorts:function(){return b.cloneDeep(this.prop("ports/items"))||[]},getPort:function(a){return b.cloneDeep(b.toArray(this.prop("ports/items")).find(function(b){return b.id&&b.id===a}))},getPortsPositions:function(a){var b=this._portSettingsData.getGroupPortsMetrics(a,g.Rect(this.size()));return b.reduce(function(a,b){var c=b.portTransformation;return a[b.portId]={x:c.x,y:c.y,angle:c.angle},a},{})},getPortIndex:function(a){var c=b.isObject(a)?a.id:a;return this._isValidPortId(c)?b.toArray(this.prop("ports/items")).findIndex(function(a){return a.id===c}):-1},addPort:function(a,c){if(!b.isObject(a)||Array.isArray(a))throw new Error("Element: addPort requires an object.");var d=b.assign([],this.prop("ports/items"));return d.push(a),this.prop("ports/items",d,c),this},portProp:function(a,c,d,e){var f=this.getPortIndex(a);if(f===-1)throw new Error("Element: unable to find port with id "+a);var g=Array.prototype.slice.call(arguments,1);return Array.isArray(c)?g[0]=["ports","items",f].concat(c):b.isString(c)?g[0]=["ports/items/",f,"/",c].join(""):(g=["ports/items/"+f],b.isPlainObject(c)&&(g.push(c),g.push(d))),this.prop.apply(this,g)},_validatePorts:function(){var c=this.get("ports")||{},d=[];c=c||{};var e=b.toArray(c.items);return e.forEach(function(a){"object"!=typeof a&&d.push("Element: invalid port ",a),this._isValidPortId(a.id)||(a.id=b.uuid())},this),a.util.uniq(e,"id").length!==e.length&&d.push("Element: found id duplicities in ports."),d},_isValidPortId:function(a){return null!==a&&void 0!==a&&!b.isObject(a)},addPorts:function(a,c){return a.length&&this.prop("ports/items",b.assign([],this.prop("ports/items")).concat(a),c),this},removePort:function(a,c){var d=c||{},e=b.assign([],this.prop("ports/items")),f=this.getPortIndex(a);return f!==-1&&(e.splice(f,1),d.rewrite=!0,this.prop("ports/items",e,d)),this},_createPortData:function(){var a=this._validatePorts();if(a.length>0)throw this.set("ports",this.previous("ports")),new Error(a.join(" "));var b;this._portSettingsData&&(b=this._portSettingsData.getPorts()),this._portSettingsData=new c(this.get("ports"));var d=this._portSettingsData.getPorts();if(b){var e=d.filter(function(a){if(!b.find(function(b){return b.id===a.id}))return a}),f=b.filter(function(a){if(!d.find(function(b){return b.id===a.id}))return a});f.length>0&&this.trigger("ports:remove",this,f),e.length>0&&this.trigger("ports:add",this,e)}}}),b.assign(a.dia.ElementView.prototype,{portContainerMarkup:"g",portMarkup:[{tagName:"circle",selector:"circle",attributes:{r:10,fill:"#FFFFFF",stroke:"#000000"}}],portLabelMarkup:[{tagName:"text",selector:"text",attributes:{fill:"#000000"}}],_portElementsCache:null,_initializePorts:function(){this._portElementsCache={},this.listenTo(this.model,"change:ports",function(){this._refreshPorts()})},_refreshPorts:function(){this._removePorts(),this._portElementsCache={},this._renderPorts()},_renderPorts:function(){for(var a=[],c=this._getContainerElement(),d=0,e=c.node.childNodes.length;d1?V("g").append(h):V(h.firstChild),e=g.selectors}else c=V(f),Array.isArray(c)&&(c=V("g").append(c));if(!c)throw new Error("ElementView: Invalid port markup.");c.attr({port:a.id,"port-group":a.group});var i,j=this._getPortLabelMarkup(a.label);if(Array.isArray(j)){var k=b.parseDOMJSON(j),l=k.fragment;d=l.childNodes.length>1?V("g").append(l):V(l.firstChild),i=k.selectors}else d=V(j),Array.isArray(d)&&(d=V("g").append(d));if(!d)throw new Error("ElementView: Invalid port label markup.");var m;if(e&&i){for(var n in i)if(e[n])throw new Error("ElementView: selectors within port must be unique.");m=b.assign({},e,i)}else m=e||i;var o=V(this.portContainerMarkup).addClass("joint-port").append([c.addClass("joint-port-body"),d.addClass("joint-port-label")]);return this._portElementsCache[a.id]={portElement:o,portLabelElement:d,portSelectors:m,portLabelSelectors:i,portContentElement:c,portContentSelectors:e},o},_updatePortGroup:function(a){for(var b=g.Rect(this.model.size()),c=this.model._portSettingsData.getGroupPortsMetrics(a,b),d=0,e=c.length;d'}),joint.shapes.basic.TextView=joint.dia.ElementView.extend({initialize:function(){joint.dia.ElementView.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:attrs",this.resize)}}),joint.shapes.basic.Generic.define("basic.Text",{attrs:{text:{"font-size":18,fill:"#000000"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Circle",{size:{width:60,height:60},attrs:{circle:{fill:"#ffffff",stroke:"#000000",r:30,cx:30,cy:30},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Ellipse",{size:{width:60,height:40},attrs:{ellipse:{fill:"#ffffff",stroke:"#000000",rx:30,ry:20,cx:30,cy:20},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-y":.5,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Polygon",{size:{width:60,height:40},attrs:{polygon:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Polyline",{size:{width:60,height:40},attrs:{polyline:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Image",{attrs:{text:{"font-size":14,text:"","text-anchor":"middle","ref-x":.5,"ref-dy":20,"y-alignment":"middle",fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Generic.define("basic.Path",{size:{width:60,height:60},attrs:{path:{fill:"#ffffff",stroke:"#000000"},text:{"font-size":14,text:"","text-anchor":"middle",ref:"path","ref-x":.5,"ref-dy":10,fill:"#000000","font-family":"Arial, helvetica, sans-serif"}}},{markup:''}),joint.shapes.basic.Path.define("basic.Rhombus",{attrs:{path:{d:"M 30 0 L 60 30 30 60 0 30 z"},text:{"ref-y":.5,"ref-dy":null,"y-alignment":"middle"}}}),joint.shapes.basic.PortsModelInterface={initialize:function(){this.updatePortsAttrs(),this.on("change:inPorts change:outPorts",this.updatePortsAttrs,this),this.constructor.__super__.constructor.__super__.initialize.apply(this,arguments)},updatePortsAttrs:function(a){if(this._portSelectors){var b=joint.util.omit(this.get("attrs"),this._portSelectors);this.set("attrs",b,{silent:!0})}this._portSelectors=[];var c={};joint.util.toArray(this.get("inPorts")).forEach(function(a,b,d){var e=this.getPortAttrs(a,b,d.length,".inPorts","in");this._portSelectors=this._portSelectors.concat(Object.keys(e)),joint.util.assign(c,e)},this),joint.util.toArray(this.get("outPorts")).forEach(function(a,b,d){var e=this.getPortAttrs(a,b,d.length,".outPorts","out");this._portSelectors=this._portSelectors.concat(Object.keys(e)),joint.util.assign(c,e)},this),this.attr(c,{silent:!0}),this.processPorts(),this.trigger("process:ports")},getPortSelector:function(a){var b=".inPorts",c=this.get("inPorts").indexOf(a);if(c<0&&(b=".outPorts",c=this.get("outPorts").indexOf(a),c<0))throw new Error("getPortSelector(): Port doesn't exist.");return b+">g:nth-child("+(c+1)+")>.port-body"}},joint.shapes.basic.PortsViewInterface={initialize:function(){this.listenTo(this.model,"process:ports",this.update),joint.dia.ElementView.prototype.initialize.apply(this,arguments)},update:function(){this.renderPorts(),joint.dia.ElementView.prototype.update.apply(this,arguments)},renderPorts:function(){var a=this.$(".inPorts").empty(),b=this.$(".outPorts").empty(),c=joint.util.template(this.model.portMarkup),d=this.model.ports||[];d.filter(function(a){return"in"===a.type}).forEach(function(b,d){a.append(V(c({id:d,port:b})).node)}),d.filter(function(a){return"out"===a.type}).forEach(function(a,d){b.append(V(c({id:d,port:a})).node)})}},joint.shapes.basic.Generic.define("basic.TextBlock",{attrs:{rect:{fill:"#ffffff",stroke:"#000000",width:80,height:100},text:{fill:"#000000","font-size":14,"font-family":"Arial, helvetica, sans-serif"},".content":{text:"","ref-x":.5,"ref-y":.5,"y-alignment":"middle","x-alignment":"middle"}},content:""},{markup:['','',joint.env.test("svgforeignobject")?'
':'',""].join(""),initialize:function(){this.listenTo(this,"change:size",this.updateSize),this.listenTo(this,"change:content",this.updateContent),this.updateSize(this,this.get("size")),this.updateContent(this,this.get("content")),joint.shapes.basic.Generic.prototype.initialize.apply(this,arguments)},updateSize:function(a,b){this.attr({".fobj":joint.util.assign({},b),div:{style:joint.util.assign({},b)}})},updateContent:function(a,b){joint.env.test("svgforeignobject")?this.attr({".content":{html:joint.util.sanitizeHTML(b)}}):this.attr({".content":{text:b}})},setForeignObjectSize:function(){this.updateSize.apply(this,arguments)},setDivContent:function(){this.updateContent.apply(this,arguments)}}),joint.shapes.basic.TextBlockView=joint.dia.ElementView.extend({initialize:function(){joint.dia.ElementView.prototype.initialize.apply(this,arguments),this.noSVGForeignObjectElement=!joint.env.test("svgforeignobject"),joint.env.test("svgforeignobject")||this.listenTo(this.model,"change:content change:size",function(a){this.updateContent(a)})},update:function(a,b){var c=this.model;if(joint.env.test("svgforeignobject"))joint.dia.ElementView.prototype.update.call(this,c,b);else{var d=joint.util.omit(b||c.get("attrs"),".content");joint.dia.ElementView.prototype.update.call(this,c,d),b&&!joint.util.has(b,".content")||this.updateContent(c,b)}},updateContent:function(a,b){var c=joint.util.merge({},(b||a.get("attrs"))[".content"]);c=joint.util.omit(c,"text");var d=joint.util.breakText(a.get("content"),a.get("size"),c,{svgDocument:this.paper.svg}),e=joint.util.setByPath({},".content",c,"/");e[".content"].text=d,joint.dia.ElementView.prototype.update.call(this,a,e)}}),function(a,b,c,d){"use strict";var e=a.Element;e.define("standard.Rectangle",{attrs:{body:{refWidth:"100%",refHeight:"100%",strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"circle",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"ellipse",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Path",{attrs:{body:{refD:"M 0 0 L 10 0 10 10 0 10 Z",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Polygon",{attrs:{body:{refPoints:"0 0 10 0 10 10 0 10",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"polygon",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Polyline",{attrs:{body:{refPoints:"0 0 10 0 10 10 0 10 0 0",strokeWidth:2,stroke:"#333333",fill:"#FFFFFF"},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",fontSize:14,fill:"#333333"}}},{markup:[{tagName:"polyline",selector:"body"},{tagName:"text",selector:"label"}]}),e.define("standard.Image",{attrs:{image:{refWidth:"100%",refHeight:"100%"},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"100%",refY2:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}]}),e.define("standard.BorderedImage",{attrs:{border:{refWidth:"100%",refHeight:"100%",stroke:"#333333",strokeWidth:2},image:{refWidth:-1,refHeight:-1,x:.5,y:.5},label:{textVerticalAnchor:"top",textAnchor:"middle",refX:"50%",refY:"100%",refY2:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"image",selector:"image"},{tagName:"rect",selector:"border",attributes:{fill:"none"}},{tagName:"text",selector:"label"}]}),e.define("standard.EmbeddedImage",{attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#FFFFFF",strokeWidth:2},image:{refWidth:"30%",refHeight:-20,x:10,y:10,preserveAspectRatio:"xMidYMin"},label:{textVerticalAnchor:"top",textAnchor:"left",refX:"30%",refX2:20,refY:10,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}]}),e.define("standard.HeaderedRectangle",{attrs:{body:{refWidth:"100%",refHeight:"100%",strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},header:{refWidth:"100%",height:30,strokeWidth:2,stroke:"#000000",fill:"#FFFFFF"},headerText:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:15,fontSize:16,fill:"#333333"},bodyText:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"50%",refY2:15,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"header"},{tagName:"text",selector:"headerText"},{tagName:"text",selector:"bodyText"}]});var f=10;joint.dia.Element.define("standard.Cylinder",{attrs:{body:{lateralArea:f,fill:"#FFFFFF",stroke:"#333333",strokeWidth:2},top:{refCx:"50%",cy:f,refRx:"50%",ry:f,fill:"#FFFFFF",stroke:"#333333",strokeWidth:2},label:{textVerticalAnchor:"middle",textAnchor:"middle",refX:"50%",refY:"100%",refY2:15,fontSize:14,fill:"#333333"}}},{markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],topRy:function(a,c){ +if(void 0===a)return this.attr("body/lateralArea");var d=b.isPercentage(a),e={lateralArea:a},f=d?{refCy:a,refRy:a,cy:null,ry:null}:{refCy:null,refRy:null,cy:a,ry:a};return this.attr({body:e,top:f},c)}},{attributes:{lateralArea:{set:function(a,c){var e=b.isPercentage(a);e&&(a=parseFloat(a)/100);var f=c.x,g=c.y,h=c.width,i=c.height,j=h/2,k=e?i*a:a,l=d.KAPPA,m=l*j,n=l*(e?i*a:a),o=f,p=f+h/2,q=f+h,r=g+k,s=r-k,t=g+i-k,u=g+i,v=["M",o,r,"L",o,t,"C",f,t+n,p-m,u,p,u,"C",p+m,u,q,t+n,q,t,"L",q,r,"C",q,r-n,p+m,s,p,s,"C",p-m,s,o,r-n,o,r,"Z"];return{d:v.join(" ")}}}}});var g={tagName:"foreignObject",selector:"foreignObject",attributes:{overflow:"hidden"},children:[{tagName:"div",namespaceURI:"http://www.w3.org/1999/xhtml",selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]},h={tagName:"text",selector:"label",attributes:{"text-anchor":"middle"}},i=c.test("svgforeignobject")?g:h;e.define("standard.TextBlock",{attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#ffffff",strokeWidth:2},foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}}},{markup:[{tagName:"rect",selector:"body"},i]},{attributes:{text:{set:function(c,d,e,f){if(!(e instanceof HTMLElement)){var g=f.style||{},h={text:c,width:-5,height:"100%"},i=b.assign({textVerticalAnchor:"middle"},g);return a.attributes.textWrap.set.call(this,h,d,e,i),{fill:g.color||null}}e.textContent=c},position:function(a,b,c){if(c instanceof SVGElement)return b.center()}}}});var j=a.Link;j.define("standard.Link",{attrs:{line:{connection:!0,stroke:"#333333",strokeWidth:2,strokeLinejoin:"round",targetMarker:{type:"path",d:"M 10 -5 0 0 10 5 z"}},wrapper:{connection:!0,strokeWidth:10,strokeLinejoin:"round"}}},{markup:[{tagName:"path",selector:"wrapper",attributes:{fill:"none",cursor:"pointer",stroke:"transparent"}},{tagName:"path",selector:"line",attributes:{fill:"none","pointer-events":"none"}}]}),j.define("standard.DoubleLink",{attrs:{line:{connection:!0,stroke:"#DDDDDD",strokeWidth:4,strokeLinejoin:"round",targetMarker:{type:"path",stroke:"#000000",d:"M 10 -3 10 -10 -2 0 10 10 10 3"}},outline:{connection:!0,stroke:"#000000",strokeWidth:6,strokeLinejoin:"round"}}},{markup:[{tagName:"path",selector:"outline",attributes:{fill:"none"}},{tagName:"path",selector:"line",attributes:{fill:"none"}}]}),j.define("standard.ShadowLink",{attrs:{line:{connection:!0,stroke:"#FF0000",strokeWidth:20,strokeLinejoin:"round",targetMarker:{type:"path",stroke:"none",d:"M 0 -10 -10 0 0 10 z"},sourceMarker:{type:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z"}},shadow:{connection:!0,refX:3,refY:6,stroke:"#000000",strokeOpacity:.2,strokeWidth:20,strokeLinejoin:"round",targetMarker:{type:"path",d:"M 0 -10 -10 0 0 10 z",stroke:"none"},sourceMarker:{type:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z"}}}},{markup:[{tagName:"path",selector:"shadow",attributes:{fill:"none"}},{tagName:"path",selector:"line",attributes:{fill:"none"}}]})}(joint.dia,joint.util,joint.env,V),joint.routers.manhattan=function(a,b,c){"use strict";function d(a){this.map={},this.options=a,this.mapGridSize=100}function e(){this.items=[],this.hash={},this.values={},this.OPEN=1,this.CLOSE=2}function f(a,b){return b&&b.paddingBox?a.sourceBBox.clone().moveAndExpand(b.paddingBox):a.sourceBBox.clone()}function g(a,b){return b&&b.paddingBox?a.targetBBox.clone().moveAndExpand(b.paddingBox):a.targetBBox.clone()}function h(a,b){if(a.sourceAnchor)return a.sourceAnchor;var c=f(a,b);return c.center()}function i(a,b){if(a.targetAnchor)return a.targetAnchor;var c=g(a,b);return c.center()}function j(b,c,d,e,f){var g=360/d,h=b.theta(k(b,c,e,f)),i=a.normalizeAngle(h+g/2);return g*Math.floor(i/g)}function k(b,c,d,e){var f=e.step,g=c.x-b.x,h=c.y-b.y,i=g/d.x,j=h/d.y,k=i*f,l=j*f;return new a.Point(b.x+k,b.y+l)}function l(a,b){var c=Math.abs(a-b);return c>180?360-c:c}function m(a,b,d){var e=d.step;c.toArray(d.directions).forEach(function(a){a.gridOffsetX=a.offsetX/e*b.x,a.gridOffsetY=a.offsetY/e*b.y})}function n(a,b,c){return{source:b.clone(),x:o(c.x-b.x,a),y:o(c.y-b.y,a)}}function o(a,b){if(!a)return b;var c=Math.abs(a),d=Math.round(c/b);if(!d)return c;var e=d*b,f=c-e,g=f/d;return b+g}function p(b,c){var d=c.source,e=a.snapToGrid(b.x-d.x,c.x)+d.x,f=a.snapToGrid(b.y-d.y,c.y)+d.y;return new a.Point(e,f)}function q(a,b){return a?a.round(b.precision):a}function r(a){return a.clone().round().toString()}function s(b){return new a.Point(0===b.x?0:Math.abs(b.x)/b.x,0===b.y?0:Math.abs(b.y)/b.y)}function t(a,b,c,d,e,f){for(var g,h=[],i=s(e.difference(c)),j=r(c),k=a[j];k;){g=q(b[j],f);var l=s(g.difference(q(k.clone(),f)));l.equals(i)||(h.unshift(g),i=l),j=r(k),k=a[j]}var m=q(b[j],f),n=s(m.difference(d));return n.equals(i)||h.unshift(m),h}function u(a,b){for(var c=1/0,d=0,e=b.length;dj)&&(j=w,t=p(v,f))}var x=q(t,g);x&&(d.containsPoint(x)&&q(x.offset(l.x*f.x,l.y*f.y),g),c.push(x))}return c},[]);return d.containsPoint(i)||n.push(i),n}function w(b,d,f,g){var k,o;k=b instanceof a.Rect?h(this,g).clone():b.clone(),o=d instanceof a.Rect?i(this,g).clone():d.clone();var s,w,x,y,z=n(g.step,k,o);if(b instanceof a.Rect?(s=q(p(k,z),g),x=v(s,b,g.startDirections,z,g)):(s=q(p(k,z),g),x=[s]),d instanceof a.Rect?(w=q(p(o,z),g),y=v(o,d,g.endDirections,z,g)):(w=q(p(o,z),g),y=[w]),x=x.filter(f.isPointAccessible,f),y=y.filter(f.isPointAccessible,f),x.length>0&&y.length>0){for(var A=new e,B={},C={},D={},E=0,F=x.length;E0;){var Q,R=A.pop(),S=B[R],T=C[R],U=D[R],V=void 0===T,W=S.equals(s);if(Q=V?L?W?null:j(s,S,N,z,g):K:j(T,S,N,z,g),O.indexOf(R)>=0)return g.previousDirectionAngle=Q,t(C,B,S,s,w,g);for(E=0;Eg.maxAllowedDirectionChange)){var Y=S.clone().offset(I.gridOffsetX,I.gridOffsetY),Z=r(Y);if(!A.isClose(Z)&&f.isPointAccessible(Y)){if(O.indexOf(Z)>=0){q(Y,g);var $=Y.equals(w);if(!$){var _=j(Y,w,N,z,g),aa=l(X,_);if(aa>g.maxAllowedDirectionChange)continue}}var ba=I.cost,ca=W?0:g.penalties[J],da=U+ba+ca;(!A.isOpen(Z)||da90){var i=f;f=h,h=i}var j=d%90<45?f:h,k=new g.Line(a,j),l=90*Math.ceil(d/90),m=g.Point.fromPolar(k.squaredLength(),g.toRad(l+135),j),n=new g.Line(b,m),o=k.intersection(n),p=o?o:b,q=o?p:a,r=360/c.directions.length,s=q.theta(b),t=g.normalizeAngle(s+r/2),u=r*Math.floor(t/r);return c.previousDirectionAngle=u,p&&e.push(p.round()),e.push(b),e}};return function(c,d,e){if(!a.isFunction(joint.routers.manhattan))throw new Error("Metro requires the manhattan router.");return joint.routers.manhattan(c,a.assign({},b,d),e)}}(joint.util),joint.routers.normal=function(a,b,c){return a},joint.routers.oneSide=function(a,b,c){var d,e,f,g=b.side||"bottom",h=b.padding||40,i=c.sourceBBox,j=c.targetBBox,k=i.center(),l=j.center();switch(g){case"bottom":f=1,d="y",e="height";break;case"top":f=-1,d="y",e="height";break;case"left":f=-1,d="x",e="width";break;case"right":f=1,d="x",e="width";break;default:throw new Error("Router: invalid side")}return k[d]+=f*(i[e]/2+h),l[d]+=f*(j[e]/2+h),f*(k[d]-l[d])>0?l[d]=k[d]:k[d]=l[d],[k].concat(a,l)},joint.routers.orthogonal=function(a){function b(a,b,c){var d=new g.Point(a.x,b.y);return c.containsPoint(d)&&(d=new g.Point(b.x,a.y)),d}function c(a,b){return a["W"===b||"E"===b?"width":"height"]}function d(a,b){return a.x===b.x?a.y>b.y?"N":"S":a.y===b.y?a.x>b.x?"W":"E":null}function e(a){return new g.Rect(a.x,a.y,0,0)}function f(a,b){var c=b&&b.elementPadding||20;return a.sourceBBox.clone().inflate(c)}function h(a,b){var c=b&&b.elementPadding||20;return a.targetBBox.clone().inflate(c)}function i(a,b){if(a.sourceAnchor)return a.sourceAnchor;var c=f(a,b);return c.center()}function j(a,b){if(a.targetAnchor)return a.targetAnchor;var c=h(a,b);return c.center()}function k(a,b,c){var e=new g.Point(a.x,b.y),f=new g.Point(b.x,a.y),h=d(a,e),i=d(a,f),j=q[c],k=h===c||h!==j&&(i===j||i!==c)?e:f;return{points:[k],direction:d(k,b)}}function l(a,c,e){var f=b(a,c,e);return{points:[f],direction:d(f,c)}}function m(e,f,h,i){var j,k={},l=[new g.Point(e.x,f.y),new g.Point(f.x,e.y)],m=l.filter(function(a){return!h.containsPoint(a)}),n=m.filter(function(a){return d(a,e)!==i});if(n.length>0)j=n.filter(function(a){return d(e,a)===i}).pop(),j=j||n[0],k.points=[j],k.direction=d(j,f);else{j=a.difference(l,m)[0];var o=new g.Point(f).move(j,-c(h,i)/2),p=b(o,e,h);k.points=[p,o],k.direction=d(o,f)}return k}function n(a,b,e,f){var h=l(b,a,f),i=h.points[0];if(e.containsPoint(i)){h=l(a,b,e);var j=h.points[0];if(f.containsPoint(j)){var m=new g.Point(a).move(j,-c(e,d(a,j))/2),n=new g.Point(b).move(i,-c(f,d(b,i))/2),o=new g.Line(m,n).midpoint(),p=l(a,o,e),q=k(o,b,p.direction);h.points=[p.points[0],q.points[0]],h.direction=q.direction}}return h}function o(a,c,e,f,h){var i,j,k,l={},m=e.union(f).inflate(1),n=m.center().distance(c)>m.center().distance(a),o=n?c:a,p=n?a:c;return h?(i=g.Point.fromPolar(m.width+m.height,r[h],o),i=m.pointNearestToPoint(i).move(i,-1)):i=m.pointNearestToPoint(o).move(o,1),j=b(i,p,m),i.round().equals(j.round())?(j=g.Point.fromPolar(m.width+m.height,g.toRad(i.theta(o))+Math.PI/2,p),j=m.pointNearestToPoint(j).move(p,1).round(),k=b(i,j,m),l.points=n?[j,k,i]:[i,k,j]):l.points=n?[j,i]:[i,j],l.direction=n?d(i,c):d(j,c),l}function p(b,c,p){var q=c.elementPadding||20,r=f(p,c),s=h(p,c),t=i(p,c),u=j(p,c);r=r.union(e(t)),s=s.union(e(u)),b=a.toArray(b).map(g.Point),b.unshift(t),b.push(u);for(var v,w=[],x=0,y=b.length-1;x=Math.abs(a.y-b.y)){var k=(a.x+b.x)/2;j=g.Path.createSegment("C",k,a.y,k,b.y,b.x,b.y),e.appendSegment(j)}else{var l=(a.y+b.y)/2;j=g.Path.createSegment("C",a.x,l,b.x,l,b.x,b.y),e.appendSegment(j)}}return f?e:e.serialize()},joint.connectors.jumpover=function(a,b){function c(b,c,d){var e=[].concat(b,d,c);return e.reduce(function(b,c,d){var f=e[d+1];return null!=f&&(b[d]=a.line(c,f)),b},[])}function d(a){var b=a.paper._jumpOverUpdateList;null==b&&(b=a.paper._jumpOverUpdateList=[],a.paper.on("cell:pointerup",e),a.paper.model.on("reset",function(){b=a.paper._jumpOverUpdateList=[]})),b.indexOf(a)<0&&(b.push(a),a.listenToOnce(a.model,"change:connector remove",function(){b.splice(b.indexOf(a),1)}))}function e(){for(var a=this._jumpOverUpdateList,b=0;bw)||"jumpover"!==d.name)}),z=y.map(function(a){return s.findViewByModel(a)}),A=c(a,e,l),B=z.map(function(a){return null==a?[]:a===this?A:c(a.sourcePoint,a.targetPoint,a.route)},this),C=A.reduce(function(a,b){var c=y.reduce(function(a,c,d){if(c!==v){var e=f(b,B[d]);a.push.apply(a,e)}return a},[]).sort(function(a,c){return g(b.start,a)-g(b.start,c)});return c.length>0?a.push.apply(a,h(b,c,p)):a.push(b),a},[]),D=i(C,p,q);return o?D:D.serialize()}}(g,joint.util),function(a,b,c){function d(a,c,d){var e=a.toJSON();return e.angle=c||0,b.util.defaults({},d,e)}function e(b,c,e){return b.map(function(a,b,c){var e=this.pointAt((b+.5)/c.length);return(a.dx||a.dy)&&e.offset(a.dx||0,a.dy||0),d(e.round(),0,a)},a.line(c,e))}function f(b,c,e,f){var g=c.center(),h=c.width/c.height,i=c.topMiddle(),j=a.Ellipse.fromRect(c);return b.map(function(a,b,c){var k=e+f(b,c.length),l=i.clone().rotate(g,-k).scale(h,1,g),m=a.compensateRotation?-j.tangentTheta(l):0;return(a.dx||a.dy)&&l.offset(a.dx||0,a.dy||0),a.dr&&l.move(g,a.dr),d(l.round(),m,a)})}function g(b,d){var e=d.x;c.isString(e)&&(e=parseFloat(e)/100*b.width);var f=d.y;return c.isString(f)&&(f=parseFloat(f)/100*b.height),a.point(e||0,f||0)}b.layout.Port={absolute:function(a,b,c){return a.map(g.bind(null,b))},fn:function(a,b,c){return c.fn(a,b,c)},line:function(a,b,c){var d=g(b,c.start||b.origin()),f=g(b,c.end||b.corner());return e(a,d,f)},left:function(a,b,c){return e(a,b.origin(),b.bottomLeft())},right:function(a,b,c){return e(a,b.topRight(),b.corner())},top:function(a,b,c){return e(a,b.origin(),b.topRight())},bottom:function(a,b,c){return e(a,b.bottomLeft(),b.corner())},ellipseSpread:function(a,b,c){var d=c.startAngle||0,e=c.step||360/a.length;return f(a,b,d,function(a){return a*e})},ellipse:function(a,b,c){var d=c.startAngle||0,e=c.step||20;return f(a,b,d,function(a,b){return(a+.5-b/2)*e})}}}(g,joint,joint.util),function(a,b,c){function d(a,b){return c.defaultsDeep({},a,b,{x:0,y:0,angle:0,attrs:{".":{y:"0","text-anchor":"start"}}})}function e(a,b,e,g){g=c.defaults({},g,{offset:15});var h,i,j,k,l=b.center().theta(a),m=f(b),n=g.offset,o=0;lm[2]?(j=".3em",h=n,i=0,k="start"):lo[2]?(k=".3em",i=-m,j=0,l="end"):h-270&&i<-90?(g="start",j=i-180):g="end";var m=Math.round;return d({x:m(k.x),y:m(k.y),angle:e?j:0,attrs:{".":{y:l,"text-anchor":g}}})}b.layout.PortLabel={manual:function(a,b,c){return d(c,b)},left:function(a,b,c){return d(c,{x:-15,attrs:{".":{y:".3em","text-anchor":"end"}}})},right:function(a,b,c){return d(c,{x:15,attrs:{".":{y:".3em","text-anchor":"start"}}})},top:function(a,b,c){return d(c,{y:-15,attrs:{".":{"text-anchor":"middle"}}})},bottom:function(a,b,c){return d(c,{y:15,attrs:{".":{y:".6em","text-anchor":"middle"}}})},outsideOriented:function(a,b,c){return e(a,b,!0,c)},outside:function(a,b,c){return e(a,b,!1,c)},insideOriented:function(a,b,c){return g(a,b,!0,c)},inside:function(a,b,c){return g(a,b,!1,c)},radial:function(a,b,c){return h(a.difference(b.center()),!1,c)},radialOriented:function(a,b,c){return h(a.difference(b.center()),!0,c)}}}(g,joint,joint.util),joint.highlighters.addClass={className:joint.util.addClassNamePrefix("highlighted"),highlight:function(a,b,c){var d=c||{},e=d.className||this.className;V(b).addClass(e)},unhighlight:function(a,b,c){var d=c||{},e=d.className||this.className;V(b).removeClass(e)}},joint.highlighters.opacity={highlight:function(a,b){V(b).addClass(joint.util.addClassNamePrefix("highlight-opacity"))},unhighlight:function(a,b){V(b).removeClass(joint.util.addClassNamePrefix("highlight-opacity"))}},joint.highlighters.stroke={defaultOptions:{padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},_views:{},getHighlighterId:function(a,b){return a.id+JSON.stringify(b)},removeHighlighter:function(a){this._views[a]&&(this._views[a].remove(),this._views[a]=null)},highlight:function(a,b,c){var d=this.getHighlighterId(b,c);if(!this._views[d]){var e,f=joint.util.defaults(c||{},this.defaultOptions),g=V(b);try{var h=g.convertToPathData()}catch(a){e=g.bbox(!0),h=V.rectToPath(joint.util.assign({},f,e))}var i=V("path").attr({d:h,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"}).attr(f.attrs),j=g.getTransformToElement(a.el),k=f.padding;if(k){e||(e=g.bbox(!0));var l=e.x+e.width/2,m=e.y+e.height/2;e=V.transformRect(e,j);var n=Math.max(e.width,1),o=Math.max(e.height,1),p=(n+k)/n,q=(o+k)/o,r=V.createSVGMatrix({a:p,b:0,c:0,d:q,e:l-p*l,f:m-q*m});j=j.multiply(r)}i.transform(j);var s=this._views[d]=new joint.mvc.View({svgElement:!0,className:"highlight-stroke",el:i.node}),t=this.removeHighlighter.bind(this,d),u=a.model;s.listenTo(u,"remove",t),s.listenTo(u.graph,"reset",t),a.vel.append(i)}},unhighlight:function(a,b,c){this.removeHighlighter(this.getHighlighterId(b,c))}},function(a,b){function c(a){return function(c,d,e,f){var g=!!f.rotate,h=g?c.getNodeUnrotatedBBox(d):c.getNodeBBox(d),i=h[a](),j=f.dx;if(j){var k=b.isPercentage(j);j=parseFloat(j),isFinite(j)&&(k&&(j/=100,j*=h.width),i.x+=j)}var l=f.dy;if(l){var m=b.isPercentage(l);l=parseFloat(l),isFinite(l)&&(m&&(l/=100,l*=h.height),i.y+=l)}return g?i.rotate(c.model.getBBox().center(),-c.model.angle()):i}}function d(a){return function(b,c,d,e){if(d instanceof Element){var f=this.paper.findView(d),h=f?f.getNodeBBox(d).center():new g.Point;return a.call(this,b,c,h,e)}return a.apply(this,arguments)}}function e(a,b,c,d){var e=a.model.angle(),f=a.getNodeBBox(b),h=f.center(),i=f.origin(),j=f.corner(),k=d.padding;if(isFinite(k)||(k=0),i.y+k<=c.y&&c.y<=j.y-k){var l=c.y-h.y;h.x+=0===e||180===e?0:1*l/Math.tan(g.toRad(e)),h.y+=l}else if(i.x+k<=c.x&&c.x<=j.x-k){var m=c.x-h.x;h.y+=90===e||270===e?0:m*Math.tan(g.toRad(e)),h.x+=m}return h}function f(a,b,c,d){var e,f,g,h=!!d.rotate;h?(e=a.getNodeUnrotatedBBox(b),g=a.model.getBBox().center(),f=a.model.angle()):e=a.getNodeBBox(b);var i=d.padding;isFinite(i)&&e.inflate(i),h&&c.rotate(g,f);var j,k=e.sideNearestToPoint(c);switch(k){case"left":j=e.leftMiddle();break;case"right":j=e.rightMiddle();break;case"top":j=e.topMiddle();break;case"bottom":j=e.bottomMiddle()}return h?j.rotate(g,-f):j}function h(a,b){var c=a.model,d=c.getBBox(),e=d.center(),f=c.angle(),h=a.findAttribute("port",b);if(h){var i=c.portProp(h,"group"),j=c.getPortsPositions(i),k=new g.Point(j[h]).offset(d.origin());return k.rotate(e,-f),k}return e}a.anchors={center:c("center"),top:c("topMiddle"),bottom:c("bottomMiddle"),left:c("leftMiddle"),right:c("rightMiddle"),topLeft:c("origin"),topRight:c("topRight"),bottomLeft:c("bottomLeft"),bottomRight:c("corner"),perpendicular:d(e),midSide:d(f),modelCenter:h}}(joint,joint.util),function(a,b,c,d){function e(a,c){return 1===a.length?a[0]:b.sortBy(a,function(a){return a.squaredDistance(c)})[0]}function f(a,b,c){if(!isFinite(c))return a;var d=a.distance(b);return 0===c&&d>0?a:a.move(b,-Math.min(c,d-1))}function g(a){var b=a.getAttribute("stroke-width");return null===b?0:parseFloat(b)||0}function h(a,b,c,d){return f(a.end,a.start,d.offset)}function i(a,b,c,d){var h=b.getNodeBBox(c);d.stroke&&h.inflate(g(c)/2);var i=a.intersect(h),j=i?e(i,a.start):a.end;return f(j,a.start,d.offset)}function j(a,b,c,d){var h=b.model.angle();if(0===h)return i(a,b,c,d);var j=b.getNodeUnrotatedBBox(c);d.stroke&&j.inflate(g(c)/2);var k=j.center(),l=a.clone().rotate(k,h),m=l.setLength(1e6).intersect(j),n=m?e(m,l.start).rotate(k,-h):a.end;return f(n,a.start,d.offset)}function k(a,h,i,j){var k,n,o=j.selector,p=a.end;if("string"==typeof o)k=h.findBySelector(o)[0];else if(Array.isArray(o))k=b.getByPath(i,o);else{k=i;do{var q=k.tagName.toUpperCase();if("G"===q)k=k.firstChild;else{if("TITLE"!==q)break;k=k.nextSibling}}while(k)}if(!(k instanceof Element))return p;var r=h.getNodeShape(k),s=h.getNodeMatrix(k),t=h.getRootTranslateMatrix(),u=h.getRootRotateMatrix(),v=t.multiply(u).multiply(s),w=v.inverse(),x=d.transformLine(a,w),y=x.start.clone(),z=h.getNodeData(k);if(j.insideout===!1){z[m]||(z[m]=r.bbox());var A=z[m];if(A.containsPoint(y))return p}var B;if(r instanceof c.Path){var C=j.precision||2;z[l]||(z[l]=r.getSegmentSubdivisions({precision:C})),B={precision:C,segmentSubdivisions:z[l]}}j.extrapolate===!0&&x.setLength(1e6),n=x.intersect(r,B),n?d.isArray(n)&&(n=e(n,y)):j.sticky===!0&&(n=r instanceof c.Rect?r.pointNearestToPoint(y):r instanceof c.Ellipse?r.intersectionWithLineFromCenterToPoint(y):r.closestPoint(y,B));var D=n?d.transformPoint(n,v):p,E=j.offset||0;return j.stroke&&(E+=g(k)/2),f(D,a.start,E)}var l="segmentSubdivisons",m="shapeBBox";a.connectionPoints={anchor:h,bbox:i,rectangle:j,boundary:k}}(joint,joint.util,g,V),function(a,b){function c(a,b){return 0===b?"0%":Math.round(a/b*100)+"%"}function d(a){return function(b,d,e,f){var g=d.model.angle(),h=d.getNodeUnrotatedBBox(e),i=d.model.getBBox().center();f.rotate(i,g);var j=f.x-h.x,k=f.y-h.y;return a&&(j=c(j,h.width),k=c(k,h.height)),b.anchor={name:"topLeft",args:{dx:j,dy:k,rotate:!0}},b}}a.connectionStrategies={useDefaults:b.noop,pinAbsolute:d(!1),pinRelative:d(!0)}}(joint,joint.util),function(a,b,c,d){function e(b,c,d){var e=a.connectionStrategies.pinRelative.call(this.paper,{},c,d,b,this.model);return e.anchor}function f(a,b,c,d,e,f){var g=f.options.snapRadius,h="source"===d,i=h?0:-1,j=this.model.vertex(i)||this.getEndAnchor(h?"target":"source");return j&&(Math.abs(j.x-a.x)0?c[a-1]:b.sourceAnchor,f=a0){var d=this.getNeighborPoints(b),e=d.prev,f=d.next;Math.abs(a.x-e.x)'}),joint.shapes.erd.Entity.define("erd.WeakEntity",{attrs:{".inner":{display:"auto"},text:{text:"Weak Entity"}}}),joint.dia.Element.define("erd.Relationship",{size:{width:80,height:80},attrs:{".outer":{fill:"#3498DB",stroke:"#2980B9","stroke-width":2,points:"40,0 80,40 40,80 0,40"},".inner":{fill:"#3498DB",stroke:"#2980B9","stroke-width":2,points:"40,5 75,40 40,75 5,40",display:"none"},text:{text:"Relationship","font-family":"Arial","font-size":12,"ref-x":.5,"ref-y":.5,"y-alignment":"middle","text-anchor":"middle"}}},{markup:''}),joint.shapes.erd.Relationship.define("erd.IdentifyingRelationship",{attrs:{".inner":{display:"auto"},text:{text:"Identifying"}}}),joint.dia.Element.define("erd.Attribute",{size:{width:100,height:50},attrs:{ellipse:{transform:"translate(50, 25)"},".outer":{stroke:"#D35400","stroke-width":2,cx:0,cy:0,rx:50,ry:25,fill:"#E67E22"},".inner":{stroke:"#D35400","stroke-width":2,cx:0,cy:0,rx:45,ry:20,fill:"#E67E22",display:"none"},text:{"font-family":"Arial","font-size":14,"ref-x":.5,"ref-y":.5,"y-alignment":"middle","text-anchor":"middle"}}},{markup:''}),joint.shapes.erd.Attribute.define("erd.Multivalued",{attrs:{".inner":{display:"block"},text:{text:"multivalued"}}}),joint.shapes.erd.Attribute.define("erd.Derived",{attrs:{".outer":{"stroke-dasharray":"3,5"},text:{text:"derived"}}}),joint.shapes.erd.Attribute.define("erd.Key",{attrs:{ellipse:{"stroke-width":4},text:{text:"key","font-weight":"800","text-decoration":"underline"}}}),joint.shapes.erd.Attribute.define("erd.Normal",{attrs:{text:{text:"Normal"}}}),joint.dia.Element.define("erd.ISA",{type:"erd.ISA",size:{width:100,height:50},attrs:{polygon:{points:"0,0 50,50 100,0",fill:"#F1C40F",stroke:"#F39C12","stroke-width":2},text:{text:"ISA","font-size":18,"ref-x":.5,"ref-y":.3,"y-alignment":"middle","text-anchor":"middle"}}},{markup:''}),joint.dia.Link.define("erd.Line",{},{cardinality:function(a){this.set("labels",[{position:-20,attrs:{text:{dy:-8,text:a}}}])}}); joint.shapes.basic.Circle.define("fsa.State",{attrs:{circle:{"stroke-width":3},text:{"font-weight":"800"}}}),joint.dia.Element.define("fsa.StartState",{size:{width:20,height:20},attrs:{circle:{transform:"translate(10, 10)",r:10,fill:"#000000"}}},{markup:''}),joint.dia.Element.define("fsa.EndState",{size:{width:20,height:20},attrs:{".outer":{transform:"translate(10, 10)",r:10,fill:"#ffffff",stroke:"#000000"},".inner":{transform:"translate(10, 10)",r:6,fill:"#000000"}}},{markup:''}),joint.dia.Link.define("fsa.Arrow",{attrs:{".marker-target":{d:"M 10 0 L 0 5 L 10 10 z"}},smooth:!0}); joint.dia.Element.define("org.Member",{size:{width:180,height:70},attrs:{rect:{width:170,height:60},".card":{fill:"#FFFFFF",stroke:"#000000","stroke-width":2,"pointer-events":"visiblePainted",rx:10,ry:10},image:{width:48,height:48,ref:".card","ref-x":10,"ref-y":5},".rank":{"text-decoration":"underline",ref:".card","ref-x":.9,"ref-y":.2,"font-family":"Courier New","font-size":14,"text-anchor":"end"},".name":{"font-weight":"800",ref:".card","ref-x":.9,"ref-y":.6,"font-family":"Courier New","font-size":14,"text-anchor":"end"}}},{markup:''}),joint.dia.Link.define("org.Arrow",{source:{selector:".card"},target:{selector:".card"},attrs:{".connection":{stroke:"#585858","stroke-width":3}},z:-1}); diff --git a/dist/joint.shapes.chess.js b/dist/joint.shapes.chess.js index b058a258e..3300bf37e 100644 --- a/dist/joint.shapes.chess.js +++ b/dist/joint.shapes.chess.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.shapes.chess.min.js b/dist/joint.shapes.chess.min.js index 92e4ab3a3..759da5050 100644 --- a/dist/joint.shapes.chess.min.js +++ b/dist/joint.shapes.chess.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.shapes.devs.js b/dist/joint.shapes.devs.js index 33267f921..03f175c25 100644 --- a/dist/joint.shapes.devs.js +++ b/dist/joint.shapes.devs.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.shapes.devs.min.js b/dist/joint.shapes.devs.min.js index 2affefd88..12b98456c 100644 --- a/dist/joint.shapes.devs.min.js +++ b/dist/joint.shapes.devs.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.shapes.erd.js b/dist/joint.shapes.erd.js index e54c1bce5..fe1396bb6 100644 --- a/dist/joint.shapes.erd.js +++ b/dist/joint.shapes.erd.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -114,7 +114,7 @@ joint.shapes.erd.Attribute.define('erd.Key', { }); joint.shapes.erd.Attribute.define('erd.Normal', { - attrs: { text: { text: 'Normal' } } + attrs: { text: { text: 'Normal' }} }); joint.dia.Element.define('erd.ISA', { @@ -137,6 +137,6 @@ joint.dia.Element.define('erd.ISA', { joint.dia.Link.define('erd.Line', {}, { cardinality: function(value) { - this.set('labels', [{ position: -20, attrs: { text: { dy: -8, text: value } } }]); + this.set('labels', [{ position: -20, attrs: { text: { dy: -8, text: value }}}]); } }); diff --git a/dist/joint.shapes.erd.min.js b/dist/joint.shapes.erd.min.js index 0d83d6237..9ca70a462 100644 --- a/dist/joint.shapes.erd.min.js +++ b/dist/joint.shapes.erd.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.shapes.fsa.js b/dist/joint.shapes.fsa.js index 2aadfcaad..003651e48 100644 --- a/dist/joint.shapes.fsa.js +++ b/dist/joint.shapes.fsa.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -46,6 +46,6 @@ joint.dia.Element.define('fsa.EndState', { }); joint.dia.Link.define('fsa.Arrow', { - attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' } }, + attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' }}, smooth: true }); diff --git a/dist/joint.shapes.fsa.min.js b/dist/joint.shapes.fsa.min.js index 91e365531..9c31faf8d 100644 --- a/dist/joint.shapes.fsa.min.js +++ b/dist/joint.shapes.fsa.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.shapes.logic.js b/dist/joint.shapes.logic.js index 9d8e0498f..5f790516b 100644 --- a/dist/joint.shapes.logic.js +++ b/dist/joint.shapes.logic.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -73,7 +73,7 @@ joint.shapes.logic.Gate.define('logic.Gate21', { }); joint.shapes.logic.Gate11.define('logic.Repeater', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHdpZHRoPSIxM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w0Mi41OTM3NSBMIDMxLjk2ODc1LDcuNDA2MjUgeiIKICAgICAgIGlkPSJwYXRoMjYzOCIKICAgICAgIHNvZGlwb2RpOm5vZGV0eXBlcz0iY2NjY2NjY2NjY2NjYyIgLz4KICA8L2c+Cjwvc3ZnPgo=' }} }, { operation: function(input) { return input; @@ -81,7 +81,7 @@ joint.shapes.logic.Gate11.define('logic.Repeater', { }); joint.shapes.logic.Gate11.define('logic.Not', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHdpZHRoPSIxMDAiCiAgIGhlaWdodD0iNTAiCiAgIGlkPSJzdmcyIgogICBzb2RpcG9kaTp2ZXJzaW9uPSIwLjMyIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjQ2IgogICB2ZXJzaW9uPSIx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NSBBIDQsNCAwIDEgMSA3MiwyNSBBIDQsNCAwIDEgMSA4MCwyNSB6IgogICAgICAgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEsMCkiIC8+CiAgPC9nPgo8L3N2Zz4K' }} }, { operation: function(input) { return !input; @@ -89,7 +89,7 @@ joint.shapes.logic.Gate11.define('logic.Not', { }); joint.shapes.logic.Gate21.define('logic.Or', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHdpZHRoPSIxMDAiCiAgIGhlaWdodD0iNTAiCiAgIGlkPSJzdmcyIgogICBzb2RpcG9kaTp2ZXJzaW9uPSIwLjMyIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjQ2IgogICB2ZXJzaW9uPSIxLjAiCiAgIHNvZGlwb2RpOmRvY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sODIuMDkzNzUgQyAzNC4zMTAzMDEsNzkuNjYyOTg2IDQwLjkxMTUzNiw3NC43NTA0ODQgNDYuMDYyNSw2NS4yMTg3NSBMIDQ0Ljc1LDY0LjUgTCA0Ni4wNjI1LDYzLjc4MTI1IEMgMzUuNzU5Mzg3LDQ0LjcxNTU5IDE5LjUwNjU3NCw0NC41IDE0Ljc1LDQ0LjUgTCAwLjc1LDQ0LjUgTCAtMi40MDYyNSw0NC41IHogTSAzLjQ2ODc1LDQ3LjUgTCAxNC43NSw0Ny41IEMgMTkuNDM0MTczLDQ3LjUgMzMuMDM2ODUsNDcuMzY5NzkzIDQyLjcxODc1LDY0LjUgQyAzNy45NTE5NjQsNzIuOTI5MDc1IDMyLjE5NzQ2OSw3Ny4xODM5MSAyNyw3OS4zMTI1IEMgMjEuNjM5MzM5LDgxLjUwNzkyNCAxNy4xNTgwNzUsODEuNTAwMDAxIDE0Ljc1LDgxLjUgTCAzLjUsODEuNSBDIDUuMzczNTg4NCw3OC4zOTE1NjYgOC4yNSw3Mi40NTA2NSA4LjI1LDY0LjUgQyA4LjI1LDU2LjUyNjY0NiA1LjM0MTQ2ODYsNTAuNTk5ODE1IDMuNDY4NzUsNDcuNSB6IgogICAgICAgICBpZD0icGF0aDQ5NzMiCiAgICAgICAgIHNvZGlwb2RpOm5vZGV0eXBlcz0iY2NzY2NjY3NjY2NjY2NjY2NzY2NzYyIgLz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo=' }} }, { operation: function(input1, input2) { return input1 || input2; @@ -97,7 +97,7 @@ joint.shapes.logic.Gate21.define('logic.Or', { }); joint.shapes.logic.Gate21.define('logic.And', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC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WVudC11bml0cz0icHgiCiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0ibGF5ZXIxIgogICAgIHNob3dncmlkPSJ0cnVlIgogICAgIGlua3NjYXBlOmdyaWQtYmJveD0idHJ1ZSIKICAgICBpbmtzY2FwZTpncmlkLXBvaW50cz0idHJ1ZSIKICAgICBncmlkdG9sZXJhbmNlPSIxMDAwMCIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjEzOTkiCiAgICAgaW5rc2NhcGU6d2luZG93LWhlaWdodD0iODc0IgogICAgIGlua3NjYXBlOndpbmRvdy14PSIzMyIKICAgICBpbmtzY2FwZTp3aW5kb3cteT0iMCIKICAgICBpbmtzY2FwZTpzbmFwLWJib3g9InRydWUiPgogICAgPGlua3NjYXBlOmdyaWQKICAgICAgIGlkPSJHcmlkRnJvbVByZTA0NlNldHRpbmdzIgogICAgICAgdHlwZT0ieHlncmlkIgogICAgICAgb3JpZ2lueD0iMHB4IgogICAgICAgb3JpZ2lueT0iMHB4IgogICAgICAgc3BhY2luZ3g9IjFweCIKICAgICAgIHNwYWNpbmd5PSIxcHgiCiAgICAgICBjb2xvcj0iIzAwMDBmZiIKICAgICAgIGVtcGNvbG9yPSIjMDAwMGZmIgogICAgICAgb3BhY2l0eT0iMC4yIgogICAgICAgZW1wb3BhY2l0eT0iMC40IgogICAgICAgZW1wc3BhY2luZz0iNSIKICAgICAgIHZpc2libGU9InRydWUiCiAgICAgICBlbmFibGVkPSJ0cnVlIiAvPgogIDwvc29kaXBvZGk6bmFtZWR2aWV3PgogIDxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTciPgogICAgPHJkZjpSREY+CiAgICAgIDxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj4KICAgICAgICA8ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD4KICAgICAgICA8ZGM6dHlwZQogICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL3B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Dk3MDk4IDY3LjE0Mjg1NywyNSBDIDY3LjE0Mjg1NywzNC41MDI5MDIgNTkuNzYwNjYyLDQyLjE0Mjg1NyA1MCw0Mi4xNDI4NTcgTCAzMi44NTcxNDMsNDIuMTQyODU3IEwgMzIuODU3MTQzLDcuODU3MTQyOSB6IgogICAgICAgaWQ9InBhdGgyODg0IgogICAgICAgc29kaXBvZGk6bm9kZXR5cGVzPSJjY2NjY2NzY2NjY3Nzc3NzY2NjIiAvPgogIDwvZz4KPC9zdmc+Cg==' }} }, { operation: function(input1, input2) { @@ -106,7 +106,7 @@ joint.shapes.logic.Gate21.define('logic.And', { }); joint.shapes.logic.Gate21.define('logic.Nor', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHdpZHRoPSIxMDAiCiAgI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Zz4K' }} }, { operation: function(input1, input2) { return !(input1 || input2); @@ -114,7 +114,7 @@ joint.shapes.logic.Gate21.define('logic.Nor', { }); joint.shapes.logic.Gate21.define('logic.Nand', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHdpZHRoPSIxMDAiCiAgIGhlaWdodD0iNTAiCiAgIGlkPSJzdmcyIgogICBzb2RpcG9kaTp2ZXJzaW9uPSIwLjMyIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjQ2IgogICB2ZXJzaW9uPSIxLjAiCiAgIHNvZGlwb2RpOmRvY25hbWU9Ik5BTkQgQU5TSS5zdmciCiAgIGlua3NjYXBlOm91dHB1dF9leHRlbnNpb249Im9yZy5pbmtzY2FwZS5vdXRwdXQuc3ZnLmlua3NjYXBlI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w3Ljg1NzE0MjkgeiIKICAgICAgIGlkPSJwYXRoMjg4NCIKICAgICAgIHNvZGlwb2RpOm5vZGV0eXBlcz0iY2NjY2Njc2NjY2Nzc3Nzc2NjYyIgLz4KICAgIDxwYXRoCiAgICAgICBzb2RpcG9kaTp0eXBlPSJhcmMiCiAgICAgICBzdHlsZT0iZmlsbDpub25lO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDozO3N0cm9rZS1saW5lam9pbjptaXRlcjttYXJrZXI6bm9uZTtzdHJva2Utb3BhY2l0eToxO3Zpc2liaWxpdHk6dmlzaWJsZTtkaXNwbGF5OmlubGluZTtvdmVyZmxvdzp2aXNpYmxlO2VuYWJsZS1iYWNrZ3JvdW5kOmFjY3VtdWxhdGUiCiAgICAgICBpZD0icGF0aDQwMDgiCiAgICAgICBzb2RpcG9kaTpjeD0iNzUiCiAgICAgICBzb2RpcG9kaTpjeT0iMjUiCiAgICAgICBzb2RpcG9kaTpyeD0iNCIKICAgICAgIHNvZGlwb2RpOnJ5PSI0IgogICAgICAgZD0iTSA3OSwyNSBBIDQsNCAwIDEgMSA3MSwyNSBBIDQsNCAwIDEgMSA3OSwyNSB6IiAvPgogIDwvZz4KPC9zdmc+Cg==' }} }, { operation: function(input1, input2) { return !(input1 && input2); @@ -122,7 +122,7 @@ joint.shapes.logic.Gate21.define('logic.Nand', { }); joint.shapes.logic.Gate21.define('logic.Xor', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9j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logic.Gate21.define('logic.Xor', { }); joint.shapes.logic.Gate21.define('logic.Xnor', { - attrs: { image: { 'xlink:href': 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgo8c3ZnCiAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIKICAgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIKICAgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHdpZHRoPSIxMDAiCiAgIGhlaWdodD0iNTAiCiAgIGlkPSJzdmcyIgogICBzb2RpcG9kaTp2ZXJzaW9uPSIwLjMyIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjQ2IgogICB2ZXJzaW9uPSIxLjAiCiAgIHNvZGlwb2RpOmRvY25hbWU9IlhOT1IgQU5TSS5zdmciCiAgIGlua3NjYXBlOm91dHB1dF9leHRlbnNpb249Im9yZy5pbmtzY2FwZS5vdXRwdXQuc3ZnLmlua3NjYXBlIj4KICA8ZGVmcwogICAgIGlkPSJkZWZzNCI+CiAgICA8aW5rc2NhcGU6cGVy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VuYWJsZS1iYWNrZ3JvdW5kOmFjY3VtdWxhdGUiCiAgICAgICBpZD0icGF0aDM1NTEiCiAgICAgICBzb2RpcG9kaTpjeD0iNzUiCiAgICAgICBzb2RpcG9kaTpjeT0iMjUiCiAgICAgICBzb2RpcG9kaTpyeD0iNCIKICAgICAgIHNvZGlwb2RpOnJ5PSI0IgogICAgICAgZD0iTSA3OSwyNSBBIDQsNCAwIDEgMSA3MSwyNSBBIDQsNCAwIDEgMSA3OSwyNSB6IiAvPgogIDwvZz4KPC9zdmc+Cg==' }} }, { operation: function(input1, input2) { return (!input1 || !input2) && (input1 || input2); @@ -144,7 +144,7 @@ joint.dia.Link.define('logic.Wire', { }, router: { name: 'orthogonal' }, - connector: { name: 'rounded', args: { radius: 10 } } + connector: { name: 'rounded', args: { radius: 10 }} }, { arrowheadMarkup: [ '', diff --git a/dist/joint.shapes.logic.min.js b/dist/joint.shapes.logic.min.js index 9d77cad63..34e2146f4 100644 --- a/dist/joint.shapes.logic.min.js +++ b/dist/joint.shapes.logic.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.shapes.org.js b/dist/joint.shapes.org.js index 6f3c1da7f..98bd1af1e 100644 --- a/dist/joint.shapes.org.js +++ b/dist/joint.shapes.org.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -40,6 +40,6 @@ joint.dia.Element.define('org.Member', { joint.dia.Link.define('org.Arrow', { source: { selector: '.card' }, target: { selector: '.card' }, - attrs: { '.connection': { stroke: '#585858', 'stroke-width': 3 } }, + attrs: { '.connection': { stroke: '#585858', 'stroke-width': 3 }}, z: -1 }); diff --git a/dist/joint.shapes.org.min.js b/dist/joint.shapes.org.min.js index 9b6478027..aa489178a 100644 --- a/dist/joint.shapes.org.min.js +++ b/dist/joint.shapes.org.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.shapes.pn.js b/dist/joint.shapes.pn.js index bbe5a0763..ddac8734f 100644 --- a/dist/joint.shapes.pn.js +++ b/dist/joint.shapes.pn.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -124,5 +124,5 @@ joint.shapes.basic.Generic.define('pn.Transition', { }); joint.dia.Link.define('pn.Link', { - attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' } } + attrs: { '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' }} }); diff --git a/dist/joint.shapes.pn.min.js b/dist/joint.shapes.pn.min.js index 0e89ccd49..bac0467f1 100644 --- a/dist/joint.shapes.pn.min.js +++ b/dist/joint.shapes.pn.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/joint.shapes.uml.js b/dist/joint.shapes.uml.js index a1c280a5c..522c22540 100644 --- a/dist/joint.shapes.uml.js +++ b/dist/joint.shapes.uml.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -132,7 +132,7 @@ joint.shapes.uml.Class.define('uml.Interface', { joint.shapes.uml.InterfaceView = joint.shapes.uml.ClassView; joint.dia.Link.define('uml.Generalization', { - attrs: { '.marker-target': { d: 'M 20 0 L 0 10 L 20 20 z', fill: 'white' } } + attrs: { '.marker-target': { d: 'M 20 0 L 0 10 L 20 20 z', fill: 'white' }} }); joint.dia.Link.define('uml.Implementation', { @@ -143,11 +143,11 @@ joint.dia.Link.define('uml.Implementation', { }); joint.dia.Link.define('uml.Aggregation', { - attrs: { '.marker-target': { d: 'M 40 10 L 20 20 L 0 10 L 20 0 z', fill: 'white' } } + attrs: { '.marker-target': { d: 'M 40 10 L 20 20 L 0 10 L 20 0 z', fill: 'white' }} }); joint.dia.Link.define('uml.Composition', { - attrs: { '.marker-target': { d: 'M 40 10 L 20 20 L 0 10 L 20 0 z', fill: 'black' } } + attrs: { '.marker-target': { d: 'M 40 10 L 20 20 L 0 10 L 20 0 z', fill: 'black' }} }); joint.dia.Link.define('uml.Association'); @@ -226,7 +226,7 @@ joint.shapes.basic.Generic.define('uml.State', { joint.shapes.basic.Circle.define('uml.StartState', { type: 'uml.StartState', - attrs: { circle: { 'fill': '#34495e', 'stroke': '#2c3e50', 'stroke-width': 2, 'rx': 1 } } + attrs: { circle: { 'fill': '#34495e', 'stroke': '#2c3e50', 'stroke-width': 2, 'rx': 1 }} }); joint.shapes.basic.Generic.define('uml.EndState', { diff --git a/dist/joint.shapes.uml.min.js b/dist/joint.shapes.uml.min.js index a0daabbb4..c6c09f780 100644 --- a/dist/joint.shapes.uml.min.js +++ b/dist/joint.shapes.uml.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public diff --git a/dist/vectorizer.js b/dist/vectorizer.js index e942ac188..045d62634 100644 --- a/dist/vectorizer.js +++ b/dist/vectorizer.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -39,8 +39,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. // A tiny library for making your life easier when dealing with SVG. // The only Vectorizer dependency is the Geometry library. -var V; -var Vectorizer; +var V; // eslint-disable-line no-unused-vars +var Vectorizer; // eslint-disable-line no-unused-vars V = Vectorizer = (function() { @@ -203,7 +203,7 @@ V = Vectorizer = (function() { return transform.translate; } - transformAttr = transformAttr.replace(/translate\([^\)]*\)/g, '').trim(); + transformAttr = transformAttr.replace(/translate\([^)]*\)/g, '').trim(); var newTx = opt.absolute ? tx : transform.translate.tx + tx; var newTy = opt.absolute ? ty : transform.translate.ty + ty; @@ -228,7 +228,7 @@ V = Vectorizer = (function() { return transform.rotate; } - transformAttr = transformAttr.replace(/rotate\([^\)]*\)/g, '').trim(); + transformAttr = transformAttr.replace(/rotate\([^)]*\)/g, '').trim(); angle %= 360; @@ -254,7 +254,7 @@ V = Vectorizer = (function() { return transform.scale; } - transformAttr = transformAttr.replace(/scale\([^\)]*\)/g, '').trim(); + transformAttr = transformAttr.replace(/scale\([^)]*\)/g, '').trim(); var newScale = 'scale(' + sx + ',' + sy + ')'; @@ -1014,7 +1014,7 @@ V = Vectorizer = (function() { // Fallback for IE 9. // Run the animation programatically if FakeSmile (`http://leunen.me/fakesmile/`) present if (document.documentElement.getAttribute('smiling') === 'fake') { - + /* global getTargets:true, Animator:true, animators:true id2anim:true */ // Register the animation. (See `https://answers.launchpad.net/smil/+question/203333`) var animation = animateMotion.node; animation.animators = []; @@ -1131,7 +1131,7 @@ V = Vectorizer = (function() { }; V.prototype.toGeometryShape = function() { - var x, y, width, height, cx, cy, r, rx, ry, points, d; + var x, y, width, height, cx, cy, r, rx, ry, points, d, x1, x2, y1, y2; switch (this.tagName()) { case 'RECT': @@ -1738,27 +1738,27 @@ V = Vectorizer = (function() { return (da >= svgArcMax) ? (r0 - ? 'M0,' + r1 - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 - + 'M0,' + r0 - + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + (-r0) - + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + r0 - + 'Z' - : 'M0,' + r1 - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) - + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 - + 'Z') + ? 'M0,' + r1 + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 + + 'M0,' + r0 + + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + (-r0) + + 'A' + r0 + ',' + r0 + ' 0 1,0 0,' + r0 + + 'Z' + : 'M0,' + r1 + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + (-r1) + + 'A' + r1 + ',' + r1 + ' 0 1,1 0,' + r1 + + 'Z') : (r0 - ? 'M' + r1 * c0 + ',' + r1 * s0 - + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 - + 'L' + r0 * c1 + ',' + r0 * s1 - + 'A' + r0 + ',' + r0 + ' 0 ' + df + ',0 ' + r0 * c0 + ',' + r0 * s0 - + 'Z' - : 'M' + r1 * c0 + ',' + r1 * s0 - + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 - + 'L0,0' - + 'Z'); + ? 'M' + r1 * c0 + ',' + r1 * s0 + + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 + + 'L' + r0 * c1 + ',' + r0 * s1 + + 'A' + r0 + ',' + r0 + ' 0 ' + df + ',0 ' + r0 * c0 + ',' + r0 * s0 + + 'Z' + : 'M' + r1 * c0 + ',' + r1 * s0 + + 'A' + r1 + ',' + r1 + ' 0 ' + df + ',1 ' + r1 * c1 + ',' + r1 * s1 + + 'L0,0' + + 'Z'); }; // Merge attributes from object `b` with attributes in object `a`. diff --git a/dist/vectorizer.min.js b/dist/vectorizer.min.js index 09e3fa453..685c6a48b 100644 --- a/dist/vectorizer.min.js +++ b/dist/vectorizer.min.js @@ -1,4 +1,4 @@ -/*! JointJS v2.1.3 (2018-06-29) - JavaScript diagramming library +/*! JointJS v2.1.4 (2018-08-01) - JavaScript diagramming library This Source Code Form is subject to the terms of the Mozilla Public @@ -33,7 +33,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. }(this, function(g) { -var V,Vectorizer;V=Vectorizer=function(){"use strict";function a(a,b){a||(a={});var c=q("textPath"),d=a.d;if(d&&void 0===a["xlink:href"]){var e=q("path").attr("d",d).appendTo(b.defs());c.attr("xlink:href","#"+e.id)}return q.isObject(a)&&c.attr(a),c.node}function b(a,b,c){c||(c={});for(var d=c.includeAnnotationIndices,e=c.eol,f=c.lineHeight,g=c.baseSize,h=0,i={},j=b.length-1,k=0;k<=j;k++){var l=b[k],m=null;if(q.isObject(l)){var n=l.attrs,o=q("tspan",n),p=o.node,r=l.t;e&&k===j&&(r+=e),p.textContent=r;var s=n.class;s&&o.addClass(s),d&&o.attr("annotations",l.annotations),m=parseFloat(n["font-size"]),void 0===m&&(m=g),m&&m>h&&(h=m)}else e&&k===j&&(l+=e),p=document.createTextNode(l||" "),g&&g>h&&(h=g);a.appendChild(p)}return h&&(i.maxFontSize=h),f?i.lineHeight=f:h&&(i.lineHeight=1.2*h),i}function c(a,b){var c=parseFloat(a);return s.test(a)?c*b:c}function d(a,b,d,e){if(!Array.isArray(b))return 0;var f=b.length;if(!f)return 0;for(var g=b[0],h=c(g.maxFontSize,d)||d,i=0,j=c(e,d),k=1;k1){var e,g,h=[];for(e=0,g=d.childNodes.length;e0&&D.setAttribute("dy",B),(y>0||g)&&D.setAttribute("x",j),D.className.baseVal=C,r.appendChild(D),v+=E.length+1}if(i)if(l)B=d(h,x,p,o);else if("top"===h)B="0.8em";else{var I;switch(z>0?(I=parseFloat(o)||1,I*=z,s.test(o)||(I/=p)):I=0,h){case"middle":B=.3-I/2+"em";break;case"bottom":B=-I-.3+"em"}}else 0===h?B="0em":h?B=h:(B=0,null===this.attr("y")&&this.attr("y",u||"0.8em"));return r.firstChild.setAttribute("dy",B),this.append(r),this},r.removeAttr=function(a){var b=q.qualifyAttr(a),c=this.node;return b.ns?c.hasAttributeNS(b.ns,b.local)&&c.removeAttributeNS(b.ns,b.local):c.hasAttribute(a)&&c.removeAttribute(a),this},r.attr=function(a,b){if(q.isUndefined(a)){for(var c=this.node.attributes,d={},e=0;e1&&k.push(k[0]),new g.Polyline(k);case"PATH":return l=this.attr("d"),g.Path.isDataSupported(l)||(l=q.normalizePathData(l)),new g.Path(l);case"LINE":return x1=parseFloat(this.attr("x1"))||0,y1=parseFloat(this.attr("y1"))||0,x2=parseFloat(this.attr("x2"))||0,y2=parseFloat(this.attr("y2"))||0,new g.Line({x:x1,y:y1},{x:x2,y:y2})}return this.getBBox()},r.findIntersection=function(a,b){var c=this.svg().node;b=b||c;var d=this.getBBox({target:b}),e=d.center();if(d.intersectionWithLineFromCenterToPoint(a)){var f,h=this.tagName();if("RECT"===h){var i=new g.Rect(parseFloat(this.attr("x")||0),parseFloat(this.attr("y")||0),parseFloat(this.attr("width")),parseFloat(this.attr("height"))),j=this.getTransformToElement(b),k=q.decomposeMatrix(j),l=c.createSVGTransform();l.setRotate(-k.rotation,e.x,e.y);var m=q.transformRect(i,l.matrix.multiply(j));f=new g.Rect(m).intersectionWithLineFromCenterToPoint(a,k.rotation)}else if("PATH"===h||"POLYGON"===h||"POLYLINE"===h||"CIRCLE"===h||"ELLIPSE"===h){var n,o,p,r,s,t,u="PATH"===h?this:this.convertToPath(),v=u.sample(),w=1/0,x=[];for(n=0;n'+(a||"")+"",c=q.parseXML(b,{async:!1});return c.documentElement},q.idCounter=0,q.uniqueId=function(){return"v-"+ ++q.idCounter},q.toNode=function(a){return q.isV(a)?a.node:a.nodeName&&a||a[0]},q.ensureId=function(a){return a=q.toNode(a),a.id||(a.id=q.uniqueId())},q.sanitizeText=function(a){return(a||"").replace(/ /g,"\xa0")},q.isUndefined=function(a){return"undefined"==typeof a},q.isString=function(a){return"string"==typeof a},q.isObject=function(a){return a&&"object"==typeof a},q.isArray=Array.isArray,q.parseXML=function(a,b){b=b||{};var c;try{var d=new DOMParser;q.isUndefined(b.async)||(d.async=b.async),c=d.parseFromString(a,"text/xml")}catch(a){c=void 0}if(!c||c.getElementsByTagName("parsererror").length)throw new Error("Invalid XML: "+a);return c},q.qualifyAttr=function(a){if(a.indexOf(":")!==-1){var b=a.split(":");return{ns:f[b[0]],local:b[1]}}return{ns:null,local:a}},q.transformRegex=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,q.transformSeparatorRegex=/[ ,]+/,q.transformationListRegex=/^(\w+)\((.*)\)/,q.transformStringToMatrix=function(a){var b=q.createSVGMatrix(),c=a&&a.match(q.transformRegex);if(!c)return b;for(var d=0,e=c.length;d=0){var f=q.transformStringToMatrix(a),g=q.decomposeMatrix(f);b=[g.translateX,g.translateY],d=[g.scaleX,g.scaleY],c=[g.rotation];var h=[];0===b[0]&&0===b[0]||h.push("translate("+b+")"),1===d[0]&&1===d[1]||h.push("scale("+d+")"),0!==c[0]&&h.push("rotate("+c+")"),a=h.join(" ")}else{var i=a.match(/translate\((.*?)\)/);i&&(b=i[1].split(e));var j=a.match(/rotate\((.*?)\)/);j&&(c=j[1].split(e));var k=a.match(/scale\((.*?)\)/);k&&(d=k[1].split(e))}}var l=d&&d[0]?parseFloat(d[0]):1;return{value:a,translate:{tx:b&&b[0]?parseInt(b[0],10):0,ty:b&&b[1]?parseInt(b[1],10):0},rotate:{angle:c&&c[0]?parseInt(c[0],10):0,cx:c&&c[1]?parseInt(c[1],10):void 0,cy:c&&c[2]?parseInt(c[2],10):void 0},scale:{sx:l,sy:d&&d[1]?parseFloat(d[1]):l}}},q.deltaTransformPoint=function(a,b){var c=b.x*a.a+b.y*a.c+0,d=b.x*a.b+b.y*a.d+0;return{x:c,y:d}},q.decomposeMatrix=function(a){var b=q.deltaTransformPoint(a,{x:0,y:1}),c=q.deltaTransformPoint(a,{x:1,y:0}),d=180/j*k(b.y,b.x)-90,e=180/j*k(c.y,c.x);return{translateX:a.e,translateY:a.f,scaleX:l(a.a*a.a+a.b*a.b),scaleY:l(a.c*a.c+a.d*a.d),skewX:d,skewY:e,rotation:d}},q.matrixToScale=function(a){var b,c,d,e;return a?(b=q.isUndefined(a.a)?1:a.a,e=q.isUndefined(a.d)?1:a.d,c=a.b,d=a.c):b=e=1,{sx:c?l(b*b+c*c):b,sy:d?l(d*d+e*e):e}},q.matrixToRotate=function(a){var b={x:0,y:1};return a&&(b=q.deltaTransformPoint(a,b)),{angle:g.normalizeAngle(g.toDeg(k(b.y,b.x))-90)}},q.matrixToTranslate=function(a){return{tx:a&&a.e||0,ty:a&&a.f||0}},q.isV=function(a){return a instanceof q},q.isVElement=q.isV;var t=q("svg").node;return q.createSVGMatrix=function(a){var b=t.createSVGMatrix();for(var c in a)b[c]=a[c];return b},q.createSVGTransform=function(a){return q.isUndefined(a)?t.createSVGTransform():(a instanceof SVGMatrix||(a=q.createSVGMatrix(a)),t.createSVGTransformFromMatrix(a))},q.createSVGPoint=function(a,b){var c=t.createSVGPoint();return c.x=a,c.y=b,c},q.transformRect=function(a,b){var c=t.createSVGPoint();c.x=a.x,c.y=a.y;var d=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y;var e=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y+a.height;var f=c.matrixTransform(b);c.x=a.x,c.y=a.y+a.height;var h=c.matrixTransform(b),i=m(d.x,e.x,f.x,h.x),j=n(d.x,e.x,f.x,h.x),k=m(d.y,e.y,f.y,h.y),l=n(d.y,e.y,f.y,h.y);return new g.Rect(i,k,j-i,l-k)},q.transformPoint=function(a,b){return new g.Point(q.createSVGPoint(a.x,a.y).matrixTransform(b))},q.transformLine=function(a,b){return new g.Line(q.transformPoint(a.start,b),q.transformPoint(a.end,b))},q.transformPolyline=function(a,b){var c=a instanceof g.Polyline?a.points:a;q.isArray(c)||(c=[]);for(var d=[],e=0,f=c.length;e=e?f?"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"M0,"+f+"A"+f+","+f+" 0 1,0 0,"+-f+"A"+f+","+f+" 0 1,0 0,"+f+"Z":"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z":f?"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L"+f*q+","+f*r+"A"+f+","+f+" 0 "+l+",0 "+f*m+","+f*n+"Z":"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L0,0Z"},q.mergeAttrs=function(a,b){for(var c in b)"class"===c?a[c]=a[c]?a[c]+" "+b[c]:b[c]:"style"===c?q.isObject(a[c])&&q.isObject(b[c])?a[c]=q.mergeAttrs(a[c],b[c]):q.isObject(a[c])?a[c]=q.mergeAttrs(a[c],q.styleToObject(b[c])):q.isObject(b[c])?a[c]=q.mergeAttrs(q.styleToObject(a[c]),b[c]):a[c]=q.mergeAttrs(q.styleToObject(a[c]),q.styleToObject(b[c])):a[c]=b[c];return a},q.annotateString=function(a,b,c){b=b||[],c=c||{};for(var d,e,f,g=c.offset||0,h=[],i=[],j=0;j=m&&j=a.start&&ba.start&&c<=a.end||a.start>=b&&a.end=b?a.end+=c:a.start>=b&&(a.start+=c,a.end+=c)}),a},q.convertLineToPathData=function(a){a=q(a);var b=["M",a.attr("x1"),a.attr("y1"),"L",a.attr("x2"),a.attr("y2")].join(" ");return b},q.convertPolygonToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)+" Z"},q.convertPolylineToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)},q.svgPointsToPath=function(a){for(var b=0,c=a.length;b1&&(z=o(z),d*=z,e*=z);var A=d*d,B=e*e,C=(g==h?-1:1)*o(p((A*B-A*y*y-B*x*x)/(A*y*y+B*x*x))),D=C*d*y/e+(a+i)/2,E=C*-e*x/d+(c+q)/2,F=n(((c-E)/e).toFixed(9)),G=n(((q-E)/e).toFixed(9));F=aG&&(F-=2*j),(!h&&G)>F&&(G-=2*j)}var H=G-F;if(p(H)>t){var I=G,J=i,K=q;G=F+t*((h&&G)>F?1:-1),i=D+d*l(G),q=E+e*k(G),v=b(i,q,d,e,f,0,h,J,K,[G,I,D,E])}H=G-F;var L=l(F),M=k(F),N=l(G),O=k(G),P=m(H/4),Q=4/3*(d*P),R=4/3*(e*P),S=[a,c],T=[a+Q*M,c-R*L],U=[i+Q*O,q-R*N],V=[i,q];if(T[0]=2*S[0]-T[0],T[1]=2*S[1]-T[1],r)return[T,U,V].concat(v);v=[T,U,V].concat(v).join().split(",");for(var W=[],X=v.length,Y=0;Y2&&(c.push([d].concat(f.splice(0,2))),g="l",d="m"===d?"l":"L");f.length>=b[g]&&(c.push([d].concat(f.splice(0,b[g]))),b[g]););}),c}function d(a){if(Array.isArray(a)&&Array.isArray(a&&a[0])||(a=c(a)),!a||!a.length)return[["M",0,0]];for(var b,d=[],e=0,f=0,g=0,h=0,i=0,j=a.length,k=i;k7){a[b].shift();for(var c=a[b];c.length;)i[b]="A",a.splice(b++,0,["C"].concat(c.splice(0,6)));a.splice(b,1),l=g.length}}for(var g=d(c),h={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=[],j="",k="",l=g.length,m=0;m0&&(k=i[m-1])),g[m]=e(g[m],h,k),"A"!==i[m]&&"C"===j&&(i[m]="C"),f(g,m);var n=g[m],o=n.length;h.x=n[o-2],h.y=n[o-1],h.bx=parseFloat(n[o-4])||h.x,h.by=parseFloat(n[o-3])||h.y}return g[0][0]&&"M"===g[0][0]||g.unshift(["M",0,0]),g}var f="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",g=new RegExp("([a-z])["+f+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+f+"]*,?["+f+"]*)+)","ig"),h=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+f+"]*,?["+f+"]*","ig"),i=Math,j=i.PI,k=i.sin,l=i.cos,m=i.tan,n=i.asin,o=i.sqrt,p=i.abs;return function(a){return e(a).join(",").split(",").join(" ")}}(),q.namespace=f,q}(); +var V,Vectorizer;V=Vectorizer=function(){"use strict";function a(a,b){a||(a={});var c=q("textPath"),d=a.d;if(d&&void 0===a["xlink:href"]){var e=q("path").attr("d",d).appendTo(b.defs());c.attr("xlink:href","#"+e.id)}return q.isObject(a)&&c.attr(a),c.node}function b(a,b,c){c||(c={});for(var d=c.includeAnnotationIndices,e=c.eol,f=c.lineHeight,g=c.baseSize,h=0,i={},j=b.length-1,k=0;k<=j;k++){var l=b[k],m=null;if(q.isObject(l)){var n=l.attrs,o=q("tspan",n),p=o.node,r=l.t;e&&k===j&&(r+=e),p.textContent=r;var s=n.class;s&&o.addClass(s),d&&o.attr("annotations",l.annotations),m=parseFloat(n["font-size"]),void 0===m&&(m=g),m&&m>h&&(h=m)}else e&&k===j&&(l+=e),p=document.createTextNode(l||" "),g&&g>h&&(h=g);a.appendChild(p)}return h&&(i.maxFontSize=h),f?i.lineHeight=f:h&&(i.lineHeight=1.2*h),i}function c(a,b){var c=parseFloat(a);return s.test(a)?c*b:c}function d(a,b,d,e){if(!Array.isArray(b))return 0;var f=b.length;if(!f)return 0;for(var g=b[0],h=c(g.maxFontSize,d)||d,i=0,j=c(e,d),k=1;k1){var e,g,h=[];for(e=0,g=d.childNodes.length;e0&&D.setAttribute("dy",B),(y>0||g)&&D.setAttribute("x",j),D.className.baseVal=C,r.appendChild(D),v+=E.length+1}if(i)if(l)B=d(h,x,p,o);else if("top"===h)B="0.8em";else{var I;switch(z>0?(I=parseFloat(o)||1,I*=z,s.test(o)||(I/=p)):I=0,h){case"middle":B=.3-I/2+"em";break;case"bottom":B=-I-.3+"em"}}else 0===h?B="0em":h?B=h:(B=0,null===this.attr("y")&&this.attr("y",u||"0.8em"));return r.firstChild.setAttribute("dy",B),this.append(r),this},r.removeAttr=function(a){var b=q.qualifyAttr(a),c=this.node;return b.ns?c.hasAttributeNS(b.ns,b.local)&&c.removeAttributeNS(b.ns,b.local):c.hasAttribute(a)&&c.removeAttribute(a),this},r.attr=function(a,b){if(q.isUndefined(a)){for(var c=this.node.attributes,d={},e=0;e1&&k.push(k[0]),new g.Polyline(k);case"PATH":return l=this.attr("d"),g.Path.isDataSupported(l)||(l=q.normalizePathData(l)),new g.Path(l);case"LINE":return m=parseFloat(this.attr("x1"))||0,o=parseFloat(this.attr("y1"))||0,n=parseFloat(this.attr("x2"))||0,p=parseFloat(this.attr("y2"))||0,new g.Line({x:m,y:o},{x:n,y:p})}return this.getBBox()},r.findIntersection=function(a,b){var c=this.svg().node;b=b||c;var d=this.getBBox({target:b}),e=d.center();if(d.intersectionWithLineFromCenterToPoint(a)){var f,h=this.tagName();if("RECT"===h){var i=new g.Rect(parseFloat(this.attr("x")||0),parseFloat(this.attr("y")||0),parseFloat(this.attr("width")),parseFloat(this.attr("height"))),j=this.getTransformToElement(b),k=q.decomposeMatrix(j),l=c.createSVGTransform();l.setRotate(-k.rotation,e.x,e.y);var m=q.transformRect(i,l.matrix.multiply(j));f=new g.Rect(m).intersectionWithLineFromCenterToPoint(a,k.rotation)}else if("PATH"===h||"POLYGON"===h||"POLYLINE"===h||"CIRCLE"===h||"ELLIPSE"===h){var n,o,p,r,s,t,u="PATH"===h?this:this.convertToPath(),v=u.sample(),w=1/0,x=[];for(n=0;n'+(a||"")+"",c=q.parseXML(b,{async:!1});return c.documentElement},q.idCounter=0,q.uniqueId=function(){return"v-"+ ++q.idCounter},q.toNode=function(a){return q.isV(a)?a.node:a.nodeName&&a||a[0]},q.ensureId=function(a){return a=q.toNode(a),a.id||(a.id=q.uniqueId())},q.sanitizeText=function(a){return(a||"").replace(/ /g,"\xa0")},q.isUndefined=function(a){return"undefined"==typeof a},q.isString=function(a){return"string"==typeof a},q.isObject=function(a){return a&&"object"==typeof a},q.isArray=Array.isArray,q.parseXML=function(a,b){b=b||{};var c;try{var d=new DOMParser;q.isUndefined(b.async)||(d.async=b.async),c=d.parseFromString(a,"text/xml")}catch(a){c=void 0}if(!c||c.getElementsByTagName("parsererror").length)throw new Error("Invalid XML: "+a);return c},q.qualifyAttr=function(a){if(a.indexOf(":")!==-1){var b=a.split(":");return{ns:f[b[0]],local:b[1]}}return{ns:null,local:a}},q.transformRegex=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,q.transformSeparatorRegex=/[ ,]+/,q.transformationListRegex=/^(\w+)\((.*)\)/,q.transformStringToMatrix=function(a){var b=q.createSVGMatrix(),c=a&&a.match(q.transformRegex);if(!c)return b;for(var d=0,e=c.length;d=0){var f=q.transformStringToMatrix(a),g=q.decomposeMatrix(f);b=[g.translateX,g.translateY],d=[g.scaleX,g.scaleY],c=[g.rotation];var h=[];0===b[0]&&0===b[0]||h.push("translate("+b+")"),1===d[0]&&1===d[1]||h.push("scale("+d+")"),0!==c[0]&&h.push("rotate("+c+")"),a=h.join(" ")}else{var i=a.match(/translate\((.*?)\)/);i&&(b=i[1].split(e));var j=a.match(/rotate\((.*?)\)/);j&&(c=j[1].split(e));var k=a.match(/scale\((.*?)\)/);k&&(d=k[1].split(e))}}var l=d&&d[0]?parseFloat(d[0]):1;return{value:a,translate:{tx:b&&b[0]?parseInt(b[0],10):0,ty:b&&b[1]?parseInt(b[1],10):0},rotate:{angle:c&&c[0]?parseInt(c[0],10):0,cx:c&&c[1]?parseInt(c[1],10):void 0,cy:c&&c[2]?parseInt(c[2],10):void 0},scale:{sx:l,sy:d&&d[1]?parseFloat(d[1]):l}}},q.deltaTransformPoint=function(a,b){var c=b.x*a.a+b.y*a.c+0,d=b.x*a.b+b.y*a.d+0;return{x:c,y:d}},q.decomposeMatrix=function(a){var b=q.deltaTransformPoint(a,{x:0,y:1}),c=q.deltaTransformPoint(a,{x:1,y:0}),d=180/j*k(b.y,b.x)-90,e=180/j*k(c.y,c.x);return{translateX:a.e,translateY:a.f,scaleX:l(a.a*a.a+a.b*a.b),scaleY:l(a.c*a.c+a.d*a.d),skewX:d,skewY:e,rotation:d}},q.matrixToScale=function(a){var b,c,d,e;return a?(b=q.isUndefined(a.a)?1:a.a,e=q.isUndefined(a.d)?1:a.d,c=a.b,d=a.c):b=e=1,{sx:c?l(b*b+c*c):b,sy:d?l(d*d+e*e):e}},q.matrixToRotate=function(a){var b={x:0,y:1};return a&&(b=q.deltaTransformPoint(a,b)),{angle:g.normalizeAngle(g.toDeg(k(b.y,b.x))-90)}},q.matrixToTranslate=function(a){return{tx:a&&a.e||0,ty:a&&a.f||0}},q.isV=function(a){return a instanceof q},q.isVElement=q.isV;var t=q("svg").node;return q.createSVGMatrix=function(a){var b=t.createSVGMatrix();for(var c in a)b[c]=a[c];return b},q.createSVGTransform=function(a){return q.isUndefined(a)?t.createSVGTransform():(a instanceof SVGMatrix||(a=q.createSVGMatrix(a)),t.createSVGTransformFromMatrix(a))},q.createSVGPoint=function(a,b){var c=t.createSVGPoint();return c.x=a,c.y=b,c},q.transformRect=function(a,b){var c=t.createSVGPoint();c.x=a.x,c.y=a.y;var d=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y;var e=c.matrixTransform(b);c.x=a.x+a.width,c.y=a.y+a.height;var f=c.matrixTransform(b);c.x=a.x,c.y=a.y+a.height;var h=c.matrixTransform(b),i=m(d.x,e.x,f.x,h.x),j=n(d.x,e.x,f.x,h.x),k=m(d.y,e.y,f.y,h.y),l=n(d.y,e.y,f.y,h.y);return new g.Rect(i,k,j-i,l-k)},q.transformPoint=function(a,b){return new g.Point(q.createSVGPoint(a.x,a.y).matrixTransform(b))},q.transformLine=function(a,b){return new g.Line(q.transformPoint(a.start,b),q.transformPoint(a.end,b))},q.transformPolyline=function(a,b){var c=a instanceof g.Polyline?a.points:a;q.isArray(c)||(c=[]);for(var d=[],e=0,f=c.length;e=e?f?"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"M0,"+f+"A"+f+","+f+" 0 1,0 0,"+-f+"A"+f+","+f+" 0 1,0 0,"+f+"Z":"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z":f?"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L"+f*q+","+f*r+"A"+f+","+f+" 0 "+l+",0 "+f*m+","+f*n+"Z":"M"+g*m+","+g*n+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*r+"L0,0Z"},q.mergeAttrs=function(a,b){for(var c in b)"class"===c?a[c]=a[c]?a[c]+" "+b[c]:b[c]:"style"===c?q.isObject(a[c])&&q.isObject(b[c])?a[c]=q.mergeAttrs(a[c],b[c]):q.isObject(a[c])?a[c]=q.mergeAttrs(a[c],q.styleToObject(b[c])):q.isObject(b[c])?a[c]=q.mergeAttrs(q.styleToObject(a[c]),b[c]):a[c]=q.mergeAttrs(q.styleToObject(a[c]),q.styleToObject(b[c])):a[c]=b[c];return a},q.annotateString=function(a,b,c){b=b||[],c=c||{};for(var d,e,f,g=c.offset||0,h=[],i=[],j=0;j=m&&j=a.start&&ba.start&&c<=a.end||a.start>=b&&a.end=b?a.end+=c:a.start>=b&&(a.start+=c,a.end+=c)}),a},q.convertLineToPathData=function(a){a=q(a);var b=["M",a.attr("x1"),a.attr("y1"),"L",a.attr("x2"),a.attr("y2")].join(" ");return b},q.convertPolygonToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)+" Z"},q.convertPolylineToPathData=function(a){var b=q.getPointsFromSvgNode(a);return 0===b.length?null:q.svgPointsToPath(b)},q.svgPointsToPath=function(a){for(var b=0,c=a.length;b1&&(z=o(z),d*=z,e*=z);var A=d*d,B=e*e,C=(g==h?-1:1)*o(p((A*B-A*y*y-B*x*x)/(A*y*y+B*x*x))),D=C*d*y/e+(a+i)/2,E=C*-e*x/d+(c+q)/2,F=n(((c-E)/e).toFixed(9)),G=n(((q-E)/e).toFixed(9));F=aG&&(F-=2*j),(!h&&G)>F&&(G-=2*j)}var H=G-F;if(p(H)>t){var I=G,J=i,K=q;G=F+t*((h&&G)>F?1:-1),i=D+d*l(G),q=E+e*k(G),v=b(i,q,d,e,f,0,h,J,K,[G,I,D,E])}H=G-F;var L=l(F),M=k(F),N=l(G),O=k(G),P=m(H/4),Q=4/3*(d*P),R=4/3*(e*P),S=[a,c],T=[a+Q*M,c-R*L],U=[i+Q*O,q-R*N],V=[i,q];if(T[0]=2*S[0]-T[0],T[1]=2*S[1]-T[1],r)return[T,U,V].concat(v);v=[T,U,V].concat(v).join().split(",");for(var W=[],X=v.length,Y=0;Y2&&(c.push([d].concat(f.splice(0,2))),g="l",d="m"===d?"l":"L");f.length>=b[g]&&(c.push([d].concat(f.splice(0,b[g]))),b[g]););}),c}function d(a){if(Array.isArray(a)&&Array.isArray(a&&a[0])||(a=c(a)),!a||!a.length)return[["M",0,0]];for(var b,d=[],e=0,f=0,g=0,h=0,i=0,j=a.length,k=i;k7){a[b].shift();for(var c=a[b];c.length;)i[b]="A",a.splice(b++,0,["C"].concat(c.splice(0,6)));a.splice(b,1),l=g.length}}for(var g=d(c),h={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},i=[],j="",k="",l=g.length,m=0;m0&&(k=i[m-1])),g[m]=e(g[m],h,k),"A"!==i[m]&&"C"===j&&(i[m]="C"),f(g,m);var n=g[m],o=n.length;h.x=n[o-2],h.y=n[o-1],h.bx=parseFloat(n[o-4])||h.x,h.by=parseFloat(n[o-3])||h.y}return g[0][0]&&"M"===g[0][0]||g.unshift(["M",0,0]),g}var f="\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029",g=new RegExp("([a-z])["+f+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+f+"]*,?["+f+"]*)+)","ig"),h=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+f+"]*,?["+f+"]*","ig"),i=Math,j=i.PI,k=i.sin,l=i.cos,m=i.tan,n=i.asin,o=i.sqrt,p=i.abs;return function(a){return e(a).join(",").split(",").join(" ")}}(),q.namespace=f,q}(); return V; diff --git a/package.json b/package.json index c9e303d3e..cf2de8487 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "scripts": { "test": "grunt test" }, - "version": "2.1.3", + "version": "2.1.4", "main": "./dist/joint.min.js", "style": "./dist/joint.min.css", "types": "./dist/joint.d.ts",