/*! * filename: ej2-drawings.min.js * version : 19.1.63 * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ this.ej=this.ej||{},this.ej.drawings=function(t,e){"use strict";function i(){return new Pt(1,0,0,1,0,0,t.MatrixTypes.Identity)}function r(t,e){var i=c(t,e.x,e.y);return{x:Math.round(100*i.x)/100,y:Math.round(100*i.y)/100}}function o(t,e){for(var i=[],o=0,n=e;o=t.width&&i.length>0)o[o.length]={text:i,x:0,dy:0,width:r},i="";else{var s=W(i+=a[n+1]||"",t);(Math.ceil(s)+2>=t.width&&i.length>0||i.indexOf("\n")>-1)&&(o[o.length]={text:i,x:0,dy:0,width:s},i=""),n===a.length-1&&i.length>0&&(o[o.length]={text:i,x:0,dy:0,width:s},i="")}else o=v(t,e);else o[o.length]={text:a,x:0,dy:0,width:W(a,t)};return o}function v(t,e){var i,r,o,n,a=[],s="",h=0,d=0,c="nowrap"!==t.whiteSpace,l=(e||t.content).split("\n");for(h=0;h0?" ":"")+i[d])+(i[d+1]||""),t);Math.floor(u)>t.width-2&&s.length>0?(a[a.length]={text:s,x:0,dy:0,width:r===s?u:s===n?o:W(s,t)},s=""):d===i.length-1&&(a[a.length]={text:s,x:0,dy:0,width:u},s=""),n=r,o=u}return a}function w(t,e){var i,r,o={x:0,width:0},n=0;for(n=0;nt.width&&("Ellipsis"===t.textOverflow||"Clip"===t.textOverflow)?0:-i/2:"right"===t.textAlign?-i:e.length>1?0:-i/2,e[n].dy=1.2*t.fontSize,e[n].x=i,o?(o.x=Math.min(o.x,i),o.width=Math.max(o.width,r)):o={x:i,width:r};return o}function b(t,e,i,r,o){var n,a,s=new Mt(0,0),h=m(t,r);return t.childNodes=n=x(h,o),t.wrapBounds=a=w(h,n),s.width=a.width,t.wrapBounds.width>=r&&"Wrap"!==h.textOverflow&&(s.width=r),s.height=n.length*t.style.fontSize*1.2,s}function S(t,e){var i;return e&&(i=document.getElementById(e)),i?i.querySelector("#"+t):document.getElementById(t)}function A(t,i){var r=e.createElement(t);return k(r,i),r}function k(t,e){for(var i=Object.keys(e),r=0;r0)for(var o=0;oIt.findLength(i,t)?i:e;var o=It.findAngle(e,i),n=It.findAngle(r,t),a=It.findLength(r,t),s=n+2*(o-n);return{x:r.x+a*Math.cos(s*Math.PI/180),y:r.y+a*Math.sin(s*Math.PI/180)}}function it(t,e,i){return rt(t.wrapper,e,i)}function rt(t,e,i){for(var r=t.children.length-1;r>=0;r--){var o=t.children[r];if(o&&o.bounds.containsPoint(e,0)){if(o instanceof Rt){var n=this.findTargetElement(o,e);if(n)return n}if(o.bounds.containsPoint(e,0))return o}}return t.bounds.containsPoint(e,i)&&"none"!==t.style.fill?t:null}function ot(t,e){var i={x:0,y:0},r=t,o=e,n=(o.y2-o.y1)*(r.x2-r.x1)-(o.x2-o.x1)*(r.y2-r.y1),a=(o.x2-o.x1)*(r.y1-o.y1)-(o.y2-o.y1)*(r.x1-o.x1),s=(r.x2-r.x1)*(r.y1-o.y1)-(r.y2-r.y1)*(r.x1-o.x1);if(0===n)return{enabled:!1,intersectPt:i};var h=a/n,d=s/n;return h>=0&&h<=1&&d>=0&&d<=1?(i.x=r.x1+h*(r.x2-r.x1),i.y=r.y1+h*(r.y2-r.y1),{enabled:!0,intersectPt:i}):{enabled:!1,intersectPt:i}}function nt(t,e,i,r){var o={x:0,y:0},n=ot(at(t.x,t.y,e.x,e.y),at(i.x,i.y,r.x,r.y));return n.enabled?n.intersectPt:o}function at(t,e,i,r){return{x1:Number(t)||0,y1:Number(e)||0,x2:Number(i)||0,y2:Number(r)||0}}function st(t,e,i){var r=[];i=i||0;var o={x:e.topLeft.x-i,y:e.topLeft.y},n={x:e.topRight.x+i,y:e.topRight.y},a={x:e.bottomRight.x,y:e.bottomRight.y-i},s={x:e.bottomLeft.x,y:e.bottomLeft.y+i};return r.push(o),r.push(n),r.push(a),r.push(s),r}function ht(t,e){return Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?t.x=e.x-i&&t.x<=e.x+i&&t.y>=e.y-i&&t.y<=e.y+i}function ut(t,e,o,a,s,h,d,c){var l={x:0,y:0},u=i();switch(n(u,s,h,d),c.x){case 0:switch(c.y){case 0:l=r(u,{x:t,y:e});break;case.5:l=r(u,{x:t,y:e+a/2});break;case 1:l=r(u,{x:t,y:e+a})}break;case.5:switch(c.y){case 0:l=r(u,{x:t+o/2,y:e});break;case.5:l=r(u,{x:t+o/2,y:e+a/2});break;case 1:l=r(u,{x:t+o/2,y:e+a})}break;case 1:switch(c.y){case 0:l=r(u,{x:t+o,y:e});break;case.5:l=r(u,{x:t+o,y:e+a/2});break;case 1:l=r(u,{x:t+o,y:e+a})}}return{x:l.x,y:l.y}}var yt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ft=function(t,e,i,r){var o,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,i,a):o(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a},pt=function(t){switch(t.type){case"Linear":return wt;case"Radial":return bt;default:return wt}},gt=function(){function t(t,e,i,r){this.left=t,this.right=e,this.top=i,this.bottom=r}return t}(),mt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return yt(i,t),ft([e.Property(0)],i.prototype,"left",void 0),ft([e.Property(0)],i.prototype,"right",void 0),ft([e.Property(0)],i.prototype,"top",void 0),ft([e.Property(0)],i.prototype,"bottom",void 0),i}(e.ChildProperty),xt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return yt(i,t),i.prototype.getClassName=function(){return"Stop"},ft([e.Property("")],i.prototype,"color",void 0),ft([e.Property(0)],i.prototype,"offset",void 0),ft([e.Property(1)],i.prototype,"opacity",void 0),i}(e.ChildProperty),vt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return yt(i,t),ft([e.Collection([],xt)],i.prototype,"stops",void 0),ft([e.Property("None")],i.prototype,"type",void 0),ft([e.Property("")],i.prototype,"id",void 0),i}(e.ChildProperty),wt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return yt(i,t),ft([e.Property(0)],i.prototype,"x1",void 0),ft([e.Property(0)],i.prototype,"x2",void 0),ft([e.Property(0)],i.prototype,"y1",void 0),ft([e.Property(0)],i.prototype,"y2",void 0),i}(vt),bt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return yt(i,t),ft([e.Property(0)],i.prototype,"cx",void 0),ft([e.Property(0)],i.prototype,"cy",void 0),ft([e.Property(0)],i.prototype,"fx",void 0),ft([e.Property(0)],i.prototype,"fy",void 0),ft([e.Property(50)],i.prototype,"r",void 0),i}(vt),St=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return yt(i,t),ft([e.Property("white")],i.prototype,"fill",void 0),ft([e.Property("black")],i.prototype,"strokeColor",void 0),ft([e.Property("")],i.prototype,"strokeDashArray",void 0),ft([e.Property(1)],i.prototype,"strokeWidth",void 0),ft([e.Property(1)],i.prototype,"opacity",void 0),ft([e.ComplexFactory(pt)],i.prototype,"gradient",void 0),i}(e.ChildProperty),At=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return yt(i,t),ft([e.Property("transparent")],i.prototype,"fill",void 0),i}(St),kt=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return yt(i,t),ft([e.Property("black")],i.prototype,"color",void 0),ft([e.Property("Arial")],i.prototype,"fontFamily",void 0),ft([e.Property(12)],i.prototype,"fontSize",void 0),ft([e.Property(!1)],i.prototype,"italic",void 0),ft([e.Property(!1)],i.prototype,"bold",void 0),ft([e.Property("CollapseSpace")],i.prototype,"whiteSpace",void 0),ft([e.Property("WrapWithOverflow")],i.prototype,"textWrapping",void 0),ft([e.Property("Center")],i.prototype,"textAlign",void 0),ft([e.Property("None")],i.prototype,"textDecoration",void 0),ft([e.Property("Wrap")],i.prototype,"textOverflow",void 0),ft([e.Property("transparent")],i.prototype,"fill",void 0),i}(St);!function(t){t[t.Self=1]="Self",t[t.Parent=2]="Parent"}(t.RotateTransform||(t.RotateTransform={})),function(t){t[t.None=0]="None",t[t.ElementIsPort=2]="ElementIsPort",t[t.ElementIsGroup=4]="ElementIsGroup"}(t.ElementAction||(t.ElementAction={})),function(t){t[t.None=1]="None",t[t.Select=2]="Select",t[t.Delete=4]="Delete",t[t.Drag=8]="Drag",t[t.DragSourceEnd=16]="DragSourceEnd",t[t.DragTargetEnd=32]="DragTargetEnd",t[t.DragSegmentThumb=64]="DragSegmentThumb",t[t.AllowDrop=128]="AllowDrop",t[t.Bridging=256]="Bridging",t[t.BridgeObstacle=512]="BridgeObstacle",t[t.InheritBridging=1024]="InheritBridging",t[t.PointerEvents=2048]="PointerEvents",t[t.Tooltip=4096]="Tooltip",t[t.InheritTooltip=8192]="InheritTooltip",t[t.Interaction=4218]="Interaction",t[t.ReadOnly=16384]="ReadOnly",t[t.Default=11838]="Default"}(t.ConnectorConstraints||(t.ConnectorConstraints={})),function(t){t[t.Rotate=2]="Rotate",t[t.ConnectorSource=4]="ConnectorSource",t[t.ConnectorTarget=8]="ConnectorTarget",t[t.ResizeNorthEast=16]="ResizeNorthEast",t[t.ResizeEast=32]="ResizeEast",t[t.ResizeSouthEast=64]="ResizeSouthEast",t[t.ResizeSouth=128]="ResizeSouth",t[t.ResizeSouthWest=256]="ResizeSouthWest",t[t.ResizeWest=512]="ResizeWest",t[t.ResizeNorthWest=1024]="ResizeNorthWest",t[t.ResizeNorth=2048]="ResizeNorth",t[t.Default=4094]="Default"}(t.ThumbsConstraints||(t.ThumbsConstraints={})),function(t){t[t.None=1]="None",t[t.ConnectorSourceThumb=2]="ConnectorSourceThumb",t[t.ConnectorTargetThumb=4]="ConnectorTargetThumb",t[t.ResizeSouthEast=8]="ResizeSouthEast",t[t.ResizeSouthWest=16]="ResizeSouthWest",t[t.ResizeNorthEast=32]="ResizeNorthEast",t[t.ResizeNorthWest=64]="ResizeNorthWest",t[t.ResizeEast=128]="ResizeEast",t[t.ResizeWest=256]="ResizeWest",t[t.ResizeSouth=512]="ResizeSouth",t[t.ResizeNorth=1024]="ResizeNorth",t[t.Rotate=2048]="Rotate",t[t.UserHandle=4096]="UserHandle",t[t.ToolTip=8192]="ToolTip",t[t.ResizeAll=2046]="ResizeAll",t[t.All=16382]="All"}(t.SelectorConstraints||(t.SelectorConstraints={})),function(t){t[t.Zero=0]="Zero",t[t.One=1]="One",t[t.Two=2]="Two",t[t.Three=3]="Three",t[t.Four=4]="Four",t[t.Five=5]="Five"}(t.NoOfSegments||(t.NoOfSegments={}));var Mt=function(){function t(t,e){this.width=t,this.height=e}return t.prototype.clone=function(){return new t(this.width,this.height)},t}(),zt=function(){function t(t,e,i,r){this.x=Number.MAX_VALUE,this.y=Number.MAX_VALUE,this.width=0,this.height=0,void 0===t||void 0===e?(t=e=Number.MAX_VALUE,i=r=0):(void 0===i&&(i=0),void 0===r&&(r=0)),this.x=t,this.y=e,this.width=i,this.height=r}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topLeft",{get:function(){return{x:this.left,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topRight",{get:function(){return{x:this.right,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottomLeft",{get:function(){return{x:this.left,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottomRight",{get:function(){return{x:this.right,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"middleLeft",{get:function(){return{x:this.left,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"middleRight",{get:function(){return{x:this.right,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topCenter",{get:function(){return{x:this.x+this.width/2,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottomCenter",{get:function(){return{x:this.x+this.width/2,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return{x:this.x+this.width/2,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),t.prototype.equals=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},t.prototype.uniteRect=function(t){var e=Math.max(Number.NaN===this.right||this.x===Number.MAX_VALUE?t.right:this.right,t.right),i=Math.max(Number.NaN===this.bottom||this.y===Number.MAX_VALUE?t.bottom:this.bottom,t.bottom);return this.x=Math.min(this.left,t.left),this.y=Math.min(this.top,t.top),this.width=e-this.x,this.height=i-this.y,this},t.prototype.unitePoint=function(t){if(this.x===Number.MAX_VALUE)return this.x=t.x,void(this.y=t.y);var e=Math.min(this.left,t.x),i=Math.min(this.top,t.y),r=Math.max(this.right,t.x),o=Math.max(this.bottom,t.y);this.x=e,this.y=i,this.width=r-this.x,this.height=o-this.y},t.prototype.intersection=function(e){if(this.intersects(e)){var i=Math.max(this.left,e.left),r=Math.max(this.top,e.top);return new t(i,r,Math.min(this.right,e.right)-i,Math.min(this.bottom,e.bottom)-r)}return t.empty},t.prototype.Inflate=function(t){return this.x-=t,this.y-=t,this.width+=2*t,this.height+=2*t,this},t.prototype.intersects=function(t){return!(this.rightt.right||this.top>t.bottom||this.bottom=t.right&&this.top<=t.top&&this.bottom>=t.bottom},t.prototype.containsPoint=function(t,e){return void 0===e&&(e=0),this.left-e<=t.x&&this.right+e>=t.x&&this.top-e<=t.y&&this.bottom+e>=t.y},t.prototype.toPoints=function(){var t=[];return t.push(this.topLeft),t.push(this.topRight),t.push(this.bottomLeft),t.push(this.bottomRight),t},t.toBounds=function(e){for(var i=new t,r=0,o=e;r0},e.prototype.measure=function(t){this.desiredBounds=void 0;var i,r,o=void 0;if(this.hasChildren()){for(var n=0;n=0;s--)(o=t[s])&&(a=(n<3?o(a):n>3?o(e,i,a):o(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a},It=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return Lt(i,t),i.equals=function(t,e){return t===e||!(!t||!e)&&(!t||!e||t.x===e.x&&t.y===e.y)},i.isEmptyPoint=function(t){return!t.x||!t.y},i.transform=function(t,e,i){var r={x:0,y:0};return r.x=Math.round(100*(t.x+i*Math.cos(e*Math.PI/180)))/100,r.y=Math.round(100*(t.y+i*Math.sin(e*Math.PI/180)))/100,r},i.findLength=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},i.findAngle=function(t,e){var i=Math.atan2(e.y-t.y,e.x-t.x);return i=180*i/Math.PI,(i%=360)<0&&(i+=360),i},i.distancePoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},i.getLengthFromListOfPoints=function(t){for(var e=0,i=0;ie.y&&!i?n.y+=r:n.y-=r:t.y===e.y?t.xe.x&&!i?n.x+=r:n.x-=r:i?(o=this.findAngle(t,e),n=this.transform(t,o,r)):(o=this.findAngle(e,t),n=this.transform(e,o,r)),n},i.direction=function(t,e){return Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?t.x1&&(v*=Math.sqrt(z),w*=Math.sqrt(z));var P=Math.pow(w,2)*Math.pow(M.x,2),C=(S===A?-1:1)*Math.sqrt((Math.pow(v,2)*Math.pow(w,2)-Math.pow(v,2)*Math.pow(M.y,2)-P)/(Math.pow(v,2)*Math.pow(M.y,2)+Math.pow(w,2)*Math.pow(M.x,2)));isNaN(C)&&(C=0);var T={x:C*v*M.y/w,y:C*-w*M.x/v},R={x:(x.x+k.x)/2+Math.cos(b)*T.x-Math.sin(b)*T.y,y:(x.y+k.y)/2+Math.sin(b)*T.x+Math.cos(b)*T.y},B=this.a([1,0],[(M.x-T.x)/v,(M.y-T.y)/w]),O=[(M.x-T.x)/v,(M.y-T.y)/w],E=[(-M.x-T.x)/v,(-M.y-T.y)/w],N=this.a(O,E);if(this.r(O,E)<=-1&&(N=Math.PI),this.r(O,E)>=1&&(N=0),g.centp=R,g.xAxisRotation=b,g.rx=v,g.ry=w,g.a1=B,g.ad=N,g.sweep=A,null!=n){var W=v>w?v:w,D=v>w?1:v/w,X=v>w?w/v:1;n.save(),n.translate(R.x,R.y),n.rotate(b),n.scale(D,X),n.arc(0,0,W,B,B+N,!A),n.scale(1/D,1/X),n.rotate(-b),n.translate(-R.x,-R.y),n.restore()}break;case"Z":case"z":n.closePath(),u=a,y=s}a=u,s=y}}},t.prototype.drawText=function(e,i){if(i.content&&!0===i.visible){var r=t.getContext(e);r.save(),this.setStyle(e,i);var o=i.x+i.width*i.pivotX,n=i.y+i.height*i.pivotY;this.rotateContext(e,i.angle,o,n),this.setFontStyle(e,i);var a=0,s=[];s=i.childNodes;var h=i.wrapBounds;if(r.fillStyle=i.color,h){var d=this.labelAlign(i,h,s);for(a=0;ac?(p(),c>u&&g()):d===c?s>h?g():p():(g(),d>l&&p());var m=this.getSliceOffset(y,l,d,s),x=this.getSliceOffset(f,u,c,h),v=s-m,w=h-x,b=l-m*(l/s),S=u-x*(u/h),k=A("canvas",{width:o.toString(),height:n.toString()});k.getContext("2d").drawImage(e,m,x,v,w,0,0,b,S),t.drawImage(k,i,r,o,n)}else if("Meet"===a.scale){var M=h/s,z=c/d;l=z>M?d:c/M,u=z>M?d*M:c,i+=this.getMeetOffset(y,l,d),r+=this.getMeetOffset(f,u,c),t.drawImage(e,0,0,s,h,i,r,l,u)}else t.drawImage(e,i,r,o,n)}else if(e.complete)t.drawImage(e,i,r,o,n);else{var P=t.getTransform();e.onload=function(){t.setTransform(P.a,P.b,P.c,P.d,P.e,P.f),t.drawImage(e,i,r,o,n)}}t.closePath()},t.prototype.loadImage=function(t,e,i,r,o){this.rotateContext(i,e.angle,r,o);var n=new Image;n.src=e.source,this.image(t,n,e.x,e.y,e.width,e.height,e)},t.prototype.drawImage=function(e,i,r,o){var n=this;if(i.visible){var a=t.getContext(e);a.save();var s=i.x+i.width*i.pivotX,h=i.y+i.height*i.pivotY,d=new Image;d.src=i.source;var c=a.canvas.id.split("_");c[c.length-1];o?d.onload=function(){n.loadImage(a,i,e,s,h)}:this.loadImage(a,i,e,s,h),a.restore()}},t.prototype.labelAlign=function(t,e,i){var r=new Mt(e.width,i.length*(1.2*t.fontSize)),o={x:0,y:0},n=t.x,a=t.y,s=.5*t.width,h=.5*t.height;return"left"===t.textAlign?s=0:"center"===t.textAlign?s=e.width>t.width&&("Ellipsis"===t.textOverflow||"Clip"===t.textOverflow)?0:.5*t.width:"right"===t.textAlign&&(s=1*t.width),o.x=n+s+(e?e.x:0),o.y=a+h-r.height/2,o},t}(),Ft=function(){function t(t,e){this.renderer=null,this.isSvgMode=!0,this.diagramId=t,this.element=S(this.diagramId),this.isSvgMode=e,this.renderer=new jt}return t.prototype.renderElement=function(t,e,i,r,o,n,a,s){t instanceof Rt?this.renderContainer(t,e,i,r,o,n,a,s):t instanceof Dt?this.renderImageElement(t,e,r,o,a):t instanceof _t?this.renderPathElement(t,e,r,o,a):t instanceof Ot?this.renderTextElement(t,e,r,o,a):this.renderRect(t,e,r,o)},t.prototype.renderImageElement=function(t,e,i,r,o){var n=this.getBaseAttributes(t,i);n.cornerRadius=0,this.renderer.drawRectangle(e,n);var a,s,h,d;if("Stretch"===t.stretch)a=t.actualSize.width,s=t.actualSize.height;else{var c=t.contentSize.width,l=t.contentSize.height,u=n.width/c,y=n.height/l,f=void 0;switch(t.stretch){case"Meet":a=c*(f=Math.min(u,y)),s=l*f,n.x+=Math.abs(n.width-a)/2,n.y+=Math.abs(n.height-s)/2;break;case"Slice":u=n.width/c,y=n.height/l,a=c*(f=Math.max(u,y)),s=l*f,h=n.width/a*c,d=n.height/s*l;break;case"None":a=c,s=l}}n.width=a,n.height=s,n.sourceWidth=h,n.sourceHeight=d,n.source=t.source,n.alignment=t.imageAlign,n.scale=t.imageScale,this.renderer.drawImage(e,n,r,o)},t.prototype.renderPathElement=function(t,e,i,r,o){var n=this.getBaseAttributes(t,i);n.data=t.absolutePath,n.data=t.absolutePath;t.id;this.isSvgMode||(n.x=n.x,n.y=n.y),this.renderer.drawPath(e,n)},t.prototype.renderTextElement=function(t,e,i,r,o){var n=this.getBaseAttributes(t,i);n.cornerRadius=0,n.whiteSpace=X(t.style.whiteSpace,t.style.textWrapping),n.content=t.content,n.breakWord=N(t.style.textWrapping),n.textAlign=E(t.style.textAlign),n.color=t.style.color,n.italic=t.style.italic,n.bold=t.style.bold,n.fontSize=t.style.fontSize,n.fontFamily=t.style.fontFamily,n.textOverflow=t.style.textOverflow,n.textDecoration=t.style.textDecoration,n.doWrap=t.doWrap,n.wrapBounds=t.wrapBounds,n.childNodes=t.childNodes,n.dashArray="",n.strokeWidth=0,n.fill=t.style.fill;t.content?t.content:t.id;this.renderer.drawRectangle(e,n),this.renderer.drawText(e,n)},t.prototype.renderContainer=function(t,e,i,r,o,n,a,s){if(r={tx:0,ty:0,scale:1},this.diagramId&&(o=o),this.renderRect(t,e,r,o),t.hasChildren())for(var h=0,d=t.children;ht.width&&("Ellipsis"===t.textOverflow||"Clip"===t.textOverflow)?0:.5*t.width:"right"===t.textAlign&&(n=1*t.width),o.x=0+n+(e?e.x:0),o.y=1.2+a-r.height/2,o},t.prototype.drawLine=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","line");this.setSvgStyle(i,e);var r=e.x+e.width*e.pivotX,o=e.y+e.height*e.pivotY,n={id:e.id,x1:e.startPoint.x+e.x,y1:e.startPoint.y+e.y,x2:e.endPoint.x+e.x,y2:e.endPoint.y+e.y,stroke:e.stroke,"stroke-width":e.strokeWidth.toString(),opacity:e.opacity.toString(),transform:"rotate("+e.angle+" "+r+" "+o+")",visibility:e.visible?"visible":"hidden"};e.class&&(n.class=e.class),J(i,n),t.appendChild(i)},t.prototype.drawPath=function(t,e,i,r,o,n){var a=Math.floor(10*Math.random()+1);t.id,a.toString();var s=[];s=F(s=Y(e.data));var h;o&&(h=o.getElementById(e.id+"_groupElement_shadow"))&&h.parentNode.removeChild(h);var d;o&&(d=o.getElementById(e.id)),d&&!r||(d=document.createElementNS("http://www.w3.org/2000/svg","path"),t.appendChild(d)),this.renderPath(d,e,s);var c={id:e.id,transform:"rotate("+e.angle+","+(e.x+e.width*e.pivotX)+","+(e.y+e.height*e.pivotY)+")translate("+e.x+","+e.y+")",visibility:e.visible?"visible":"hidden",opacity:e.opacity,"aria-label":n||""};e.class&&(c.class=e.class),J(d,c),this.setSvgStyle(d,e,i)},t.prototype.renderPath=function(t,e,i){var r,o,n,a,s,h,d,c,l=i,u="";for(s=0,h=0,c=0,d=l.length;c