!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("platform"),require("dagreD3")):"function"==typeof define&&define.amd?define(["platform","dagreD3"],b):"object"==typeof exports?exports.LineageHelper=b(require("platform"),require("dagreD3")):a.LineageHelper=b(a.platform,a.dagreD3)}(window,function(a,b){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if(1&c&&(a=b(a)),8&c)return a;if(4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a.default}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=10)}([,function(b,c){b.exports=a},function(a,c){a.exports=b},,,,,,,function(a,b,c){},function(a,b,c){"use strict";function d(){}function e(){return[]}function f(a,b){this.ownerDocument=a.ownerDocument,this.namespaceURI=a.namespaceURI,this._next=null,this._parent=a,this.__data__=b}function g(a,b,c,d,e,g){for(var h,i=0,j=b.length,k=g.length;ib?1:a>=b?0:NaN}function j(a){return function(){this.removeAttribute(a)}}function k(a){return function(){this.removeAttributeNS(a.space,a.local)}}function l(a,b){return function(){this.setAttribute(a,b)}}function m(a,b){return function(){this.setAttributeNS(a.space,a.local,b)}}function n(a,b){return function(){var c=b.apply(this,arguments);null==c?this.removeAttribute(a):this.setAttribute(a,c)}}function o(a,b){return function(){var c=b.apply(this,arguments);null==c?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}}function p(a){return function(){this.style.removeProperty(a)}}function q(a,b,c){return function(){this.style.setProperty(a,b,c)}}function r(a,b,c){return function(){var d=b.apply(this,arguments);null==d?this.style.removeProperty(a):this.style.setProperty(a,d,c)}}function s(a,b){return a.style.getPropertyValue(b)||ec(a).getComputedStyle(a,null).getPropertyValue(b)}function t(a){return function(){delete this[a]}}function u(a,b){return function(){this[a]=b}}function v(a,b){return function(){var c=b.apply(this,arguments);null==c?delete this[a]:this[a]=c}}function w(a){return a.trim().split(/^|\s+/)}function x(a){return a.classList||new y(a)}function y(a){this._node=a,this._names=w(a.getAttribute("class")||"")}function z(a,b){for(var c=x(a),d=-1,e=b.length;++d=0&&(b=a.slice(c+1),a=a.slice(0,c)),{type:a,name:b}})}function V(a){return function(){var b=this.__on;if(b){for(var c,d=0,e=-1,f=b.length;d=0&&(c=a.slice(d+1),a=a.slice(0,d)),a&&!b.hasOwnProperty(a))throw new Error("unknown type: "+a);return{type:a,name:c}})}function ha(a,b){for(var c,d=0,e=a.length;d=0&&b._call.call(null,a),b=b._next;--yc}()}finally{yc=0,function(){for(var a,b,c=nc,d=1/0;c;)c._call?(d>c._time&&(d=c._time),a=c,c=c._next):(b=c._next,c._next=null,c=a?a._next=b:nc=b);oc=a,sa(d)}(),Cc=0}}function ra(){var a=Ec.now(),b=a-Bc;b>1e3&&(Dc-=b,Bc=a)}function sa(a){yc||(zc&&(zc=clearTimeout(zc)),a-Cc>24?(a<1/0&&(zc=setTimeout(qa,a-Ec.now()-Dc)),Ac&&(Ac=clearInterval(Ac))):(Ac||(Bc=Ec.now(),Ac=setInterval(ra,1e3)),yc=1,Fc(qa)))}function ta(a,b){var c=va(a,b);if(c.state>0)throw new Error("too late; already scheduled");return c}function ua(a,b){var c=va(a,b);if(c.state>3)throw new Error("too late; already running");return c}function va(a,b){var c=a.__transition;if(!c||!(c=c[b]))throw new Error("transition not found");return c}function wa(a,b,c,d){function e(a){return a.length?a.pop()+" ":""}return function(f,g){var h=[],i=[];return f=a(f),g=a(g),function(a,d,e,f,g,h){if(a!==e||d!==f){var i=g.push("translate(",null,b,null,c);h.push({i:i-4,x:Pc(a,e)},{i:i-2,x:Pc(d,f)})}else(e||f)&&g.push("translate("+e+b+f+c)}(f.translateX,f.translateY,g.translateX,g.translateY,h,i),function(a,b,c,f){a!==b?(a-b>180?b+=360:b-a>180&&(a+=360),f.push({i:c.push(e(c)+"rotate(",null,d)-2,x:Pc(a,b)})):b&&c.push(e(c)+"rotate("+b+d)}(f.rotate,g.rotate,h,i),function(a,b,c,f){a!==b?f.push({i:c.push(e(c)+"skewX(",null,d)-2,x:Pc(a,b)}):b&&c.push(e(c)+"skewX("+b+d)}(f.skewX,g.skewX,h,i),function(a,b,c,d,f,g){if(a!==c||b!==d){var h=f.push(e(f)+"scale(",null,",",null,")");g.push({i:h-4,x:Pc(a,c)},{i:h-2,x:Pc(b,d)})}else 1===c&&1===d||f.push(e(f)+"scale("+c+","+d+")")}(f.scaleX,f.scaleY,g.scaleX,g.scaleY,h,i),f=g=null,function(a){for(var b,c=-1,d=i.length;++c>8&15|b>>4&240,b>>4&15|240&b,(15&b)<<4|15&b,1):8===c?Ga(b>>24&255,b>>16&255,b>>8&255,(255&b)/255):4===c?Ga(b>>12&15|b>>8&240,b>>8&15|b>>4&240,b>>4&15|240&b,((15&b)<<4|15&b)/255):null):(b=$c.exec(a))?new Ja(b[1],b[2],b[3],1):(b=_c.exec(a))?new Ja(255*b[1]/100,255*b[2]/100,255*b[3]/100,1):(b=ad.exec(a))?Ga(b[1],b[2],b[3],b[4]):(b=bd.exec(a))?Ga(255*b[1]/100,255*b[2]/100,255*b[3]/100,b[4]):(b=cd.exec(a))?Na(b[1],b[2]/100,b[3]/100,1):(b=dd.exec(a))?Na(b[1],b[2]/100,b[3]/100,b[4]):ed.hasOwnProperty(a)?Fa(ed[a]):"transparent"===a?new Ja(NaN,NaN,NaN,0):null}function Fa(a){return new Ja(a>>16&255,a>>8&255,255&a,1)}function Ga(a,b,c,d){return d<=0&&(a=b=c=NaN),new Ja(a,b,c,d)}function Ha(a){return a instanceof Ba||(a=Ea(a)),a?new Ja((a=a.rgb()).r,a.g,a.b,a.opacity):new Ja}function Ia(a,b,c,d){return 1===arguments.length?Ha(a):new Ja(a,b,c,null==d?1:d)}function Ja(a,b,c,d){this.r=+a,this.g=+b,this.b=+c,this.opacity=+d}function Ka(){return"#"+Ma(this.r)+Ma(this.g)+Ma(this.b)}function La(){var a=this.opacity;return(1===(a=isNaN(a)?1:Math.max(0,Math.min(1,a)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===a?")":", "+a+")")}function Ma(a){return((a=Math.max(0,Math.min(255,Math.round(a)||0)))<16?"0":"")+a.toString(16)}function Na(a,b,c,d){return d<=0?a=b=c=NaN:c<=0||c>=1?a=b=NaN:b<=0&&(a=NaN),new Pa(a,b,c,d)}function Oa(a){if(a instanceof Pa)return new Pa(a.h,a.s,a.l,a.opacity);if(a instanceof Ba||(a=Ea(a)),!a)return new Pa;if(a instanceof Pa)return a;var b=(a=a.rgb()).r/255,c=a.g/255,d=a.b/255,e=Math.min(b,c,d),f=Math.max(b,c,d),g=NaN,h=f-e,i=(f+e)/2;return h?(g=b===f?(c-d)/h+6*(c0&&i<1?0:g,new Pa(g,h,i,a.opacity)}function Pa(a,b,c,d){this.h=+a,this.s=+b,this.l=+c,this.opacity=+d}function Qa(a,b,c){return 255*(a<60?b+(c-b)*a/60:a<180?c:a<240?b+(c-b)*(240-a)/60:b)}function Ra(a,b,c,d,e){var f=a*a,g=f*a;return((1-3*a+3*f-g)*b+(4-6*f+3*g)*c+(1+3*a+3*f-3*g)*d+g*e)/6}function Sa(a,b){return function(c){return a+c*b}}function Ta(a){return 1==(a=+a)?Ua:function(b,c){return c-b?function(a,b,c){return a=Math.pow(a,c),b=Math.pow(b,c)-a,c=1/c,function(d){return Math.pow(a+d*b,c)}}(b,c,a):fd(isNaN(b)?c:b)}}function Ua(a,b){var c=b-a;return c?Sa(a,c):fd(isNaN(a)?b:a)}function Va(a){return function(b){var c,d,e=b.length,f=new Array(e),g=new Array(e),h=new Array(e);for(c=0;c=0&&(a=a.slice(0,b)),!a||"start"===a})}(b)?ta:ua;return function(){var g=f(this,a),h=g.on;h!==d&&(e=(d=h).copy()).on(b,c),g.on=e}}function kb(a){return function(){this.style.removeProperty(a)}}function lb(a,b,c){return function(d){this.style.setProperty(a,b.call(this,d),c)}}function mb(a,b,c){function d(){var d=b.apply(this,arguments);return d!==f&&(e=(f=d)&&lb(a,d,c)),e}var e,f;return d._value=b,d}function nb(a){return function(b){this.textContent=a.call(this,b)}}function ob(a){function b(){var b=a.apply(this,arguments);return b!==d&&(c=(d=b)&&nb(b)),c}var c,d;return b._value=a,b}function pb(a,b,c,d){this._groups=a,this._parents=b,this._name=c,this._id=d}function qb(){return++md}function rb(a,b){for(var c;!(c=a.__transition)||!(c=c[b]);)if(!(a=a.parentNode))return od.time=ma(),od;return c}function sb(a,b,c){this.target=a,this.type=b,this.transform=c}function tb(a,b,c){this.k=a,this.x=b,this.y=c}function ub(){hc.stopImmediatePropagation()}function vb(){return!hc.ctrlKey&&!hc.button}function wb(){var a=this;return a instanceof SVGElement?(a=a.ownerSVGElement||a).hasAttribute("viewBox")?[[(a=a.viewBox.baseVal).x,a.y],[a.x+a.width,a.y+a.height]]:[[0,0],[a.width.baseVal.value,a.height.baseVal.value]]:[[0,0],[a.clientWidth,a.clientHeight]]}function xb(){return this.__zoom||qd}function yb(){return-hc.deltaY*(1===hc.deltaMode?.05:hc.deltaMode?1:.002)}function zb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ab(a,b,c){var d=a.invertX(b[0][0])-c[0][0],e=a.invertX(b[1][0])-c[1][0],f=a.invertY(b[0][1])-c[0][1],g=a.invertY(b[1][1])-c[1][1];return a.translate(e>d?(d+e)/2:Math.min(0,d)||Math.max(0,e),g>f?(f+g)/2:Math.min(0,f)||Math.max(0,g))}function Bb(a,b,c,d,e,f,g,h,i,j){this.target=a,this.type=b,this.subject=c,this.identifier=d,this.active=e,this.x=f,this.y=g,this.dx=h,this.dy=i,this._=j}function Cb(){return!hc.ctrlKey&&!hc.button}function Db(){return this.parentNode}function Eb(a){return null==a?{x:hc.x,y:hc.y}:a}function Fb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gb(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Hb(){return new Gb}function Ib(a){this._context=a}function Jb(a){return a[0]}function Kb(a){return a[1]}function Lb(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function Mb(a){for(var b=1;b=0&&"xmlns"!==(b=a.slice(0,c))&&(a=a.slice(c+1)),cc.hasOwnProperty(b)?{space:cc[b],local:a}:a},ec=function(a){return a.ownerDocument&&a.ownerDocument.defaultView||a.document&&a||a.defaultView};y.prototype={add:function(a){this._names.indexOf(a)<0&&(this._names.push(a),this._node.setAttribute("class",this._names.join(" ")))},remove:function(a){var b=this._names.indexOf(a);b>=0&&(this._names.splice(b,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(a){return this._names.indexOf(a)>=0}};var fc=function(a){var b=dc(a);return(b.local?N:M)(b)},gc={},hc=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(gc={mouseenter:"mouseover",mouseleave:"mouseout"}));var ic=[null];aa.prototype=ba.prototype={constructor:aa,select:function(a){"function"!=typeof a&&(a=Zb(a));for(var b=this._groups,c=b.length,d=new Array(c),e=0;e=x&&(x=w+1);!(v=t[x])&&++x=0;)(d=e[f])&&(g&&4^d.compareDocumentPosition(g)&&g.parentNode.insertBefore(d,g),g=d);return this},sort:function(a){function b(b,c){return b&&c?a(b.__data__,c.__data__):!b-!c}a||(a=i);for(var c=this._groups,d=c.length,e=new Array(d),f=0;f1?this.each((null==b?p:"function"==typeof b?r:q)(a,b,null==c?"":c)):s(this.node(),a)},property:function(a,b){return arguments.length>1?this.each((null==b?t:"function"==typeof b?v:u)(a,b)):this.node()[a]},classed:function(a,b){var c=w(a+"");if(arguments.length<2){for(var d=x(this.node()),e=-1,f=c.length;++e0)for(var c,d,e=new Array(c),f=0;f2&&c.state<5,c.state=6,c.timer.stop(),c.on.call(d?"interrupt":"cancel",a,a.__data__,c.index,c.group),delete f[e]):g=!1;g&&delete a.__transition}},Pc=function(a,b){return a=+a,b=+b,function(c){return a*(1-c)+b*c}},Qc=180/Math.PI,Rc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},Sc=function(a,b,c,d,e,f){var g,h,i;return(g=Math.sqrt(a*a+b*b))&&(a/=g,b/=g),(i=a*c+b*d)&&(c-=a*i,d-=b*i),(h=Math.sqrt(c*c+d*d))&&(c/=h,d/=h,i/=h),a*d=240?a-240:a+120,e,d),Qa(a,e,d),Qa(a<120?a+240:a-120,e,d),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var a=this.opacity;return(1===(a=isNaN(a)?1:Math.max(0,Math.min(1,a)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===a?")":", "+a+")")}}));var fd=function(a){return function(){return a}},gd=function a(b){function c(a,b){var c=d((a=Ia(a)).r,(b=Ia(b)).r),e=d(a.g,b.g),f=d(a.b,b.b),g=Ua(a.opacity,b.opacity);return function(b){return a.r=c(b),a.g=e(b),a.b=f(b),a.opacity=g(b),a+""}}var d=Ta(b);return c.gamma=a,c}(1);Va(function(a){var b=a.length-1;return function(c){var d=c<=0?c=0:c>=1?(c=1,b-1):Math.floor(c*b),e=a[d],f=a[d+1],g=d>0?a[d-1]:2*e-f,h=df&&(e=b.slice(f,e),h[g]?h[g]+=e:h[++g]=e),(c=c[0])===(d=d[0])?h[g]?h[g]+=d:h[++g]=d:(h[++g]=null,i.push({i:g,x:Pc(c,d)})),f=id.lastIndex;return ft}q.mouse("drag")}function d(){kc(hc.view).on("mousemove.drag mouseup.drag",null),ka(hc.view,k),qc(),q.mouse("end")}function e(){if(m.apply(this,arguments)){var a,b,c=hc.changedTouches,d=n.apply(this,arguments),e=c.length;for(a=0;a1e-6)if(Math.abs(k*h-i*j)>1e-6&&e){var m=c-f,n=d-g,o=h*h+i*i,p=m*m+n*n,q=Math.sqrt(o),r=Math.sqrt(l),s=e*Math.tan((ud-Math.acos((o+l-p)/(2*q*r)))/2),t=s/r,u=s/q;Math.abs(t-1)>1e-6&&(this._+="L"+(a+t*j)+","+(b+t*k)),this._+="A"+e+","+e+",0,0,"+ +(k*m>j*n)+","+(this._x1=a+u*h)+","+(this._y1=b+u*i)}else this._+="L"+(this._x1=a)+","+(this._y1=b)},arc:function(a,b,c,d,e,f){a=+a,b=+b,f=!!f;var g=(c=+c)*Math.cos(d),h=c*Math.sin(d),i=a+g,j=b+h,k=1^f,l=f?d-e:e-d;if(c<0)throw new Error("negative radius: "+c);null===this._x1?this._+="M"+i+","+j:(Math.abs(this._x1-i)>1e-6||Math.abs(this._y1-j)>1e-6)&&(this._+="L"+i+","+j),c&&(l<0&&(l=l%vd+vd),l>wd?this._+="A"+c+","+c+",0,1,"+k+","+(a-g)+","+(b-h)+"A"+c+","+c+",0,1,"+k+","+(this._x1=i)+","+(this._y1=j):l>1e-6&&(this._+="A"+c+","+c+",0,"+ +(l>=ud)+","+k+","+(this._x1=a+c*Math.cos(e))+","+(this._y1=b+c*Math.sin(e))))},rect:function(a,b,c,d){this._+="M"+(this._x0=this._x1=+a)+","+(this._y0=this._y1=+b)+"h"+ +c+"v"+ +d+"h"+-c+"Z"},toString:function(){return this._}};var xd=Hb,yd=function(a){return function(){return a}};Ib.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(a,b){switch(a=+a,b=+b,this._point){case 0:this._point=1,this._line?this._context.lineTo(a,b):this._context.moveTo(a,b);break;case 1:this._point=2;default:this._context.lineTo(a,b)}}};var zd=function(a){return new Ib(a)},Ad=c(1),Bd=c.n(Ad),Cd={entityStateReadOnly:{ACTIVE:!1,DELETED:!0,STATUS_ACTIVE:!1,STATUS_DELETED:!0}},Dd={nodeArrowDistance:24,refreshGraphForSafari:function(a){a.edgeEl.each(function(a){var b=this,c=$(this).find("pattern");setTimeout(function(a){$(b).find("defs").append(c)},500)})},refreshGraphForIE:function(a){var b=a.edgePathEl,c=0;b.each(function(a){var b=$(this).find("marker");$(this).find("marker").remove();var d=this;++c,setTimeout(function(a){$(d).find("defs").append(b),0===--c&&(this.$(".fontLoader").hide(),this.$("svg").fadeTo(1e3,1))},1e3)})},dragNode:function(a){var b=this,c=a.g,d=a.svg,e=a.guid,f=(a.edgePathEl,{dragmove:function(a,b){var d=this,e=kc(a),f=c.node(b),g=f.x,h=f.y;f.x+=hc.dx,f.y+=hc.dy,e.attr("transform","translate("+f.x+","+f.y+")");var i=f.x-g,j=f.y-h;c.edges().forEach(function(a){if(a.v==b||a.w==b){var e=c.edge(a.v,a.w);d.translateEdge(e,i,j),kc(e.elem).select("path").attr("d",d.calcPoints(a))}})},translateEdge:function(a,b,c){a.points.forEach(function(a){a.x=a.x+b,a.y=a.y+c})},calcPoints:function(a){var b=c.edge(a.v,a.w),d=c.node(a.v),e=c.node(a.w),f=b.points.slice(1,b.points.length-1);return b.points.slice(1,b.points.length-1),f.unshift(this.intersectRect(d,f[0])),f.push(this.intersectRect(e,f[f.length-1])),function(){function a(a){var h,i,j,k=a.length,l=!1;for(null==e&&(g=f(j=xd())),h=0;h<=k;++h)!(hMath.abs(g)*k?(h<0&&(k=-k),l=0===h?0:k*g/h,m=k):(g<0&&(j=-j),l=j,m=0===g?0:j*h/g),{x:d+l,y:f+m}}}),g=td().on("drag",function(a){f.dragmove.call(f,this,a)}),h=td().on("drag",function(a){f.translateEdge(c.edge(a.v,a.w),hc.dx,hc.dy);var b=c.edge(a.v,a.w);kc(b.elem).select("path").attr("d",f.calcPoints(a))});g(d.selectAll("g.node")),h(d.selectAll("g.edgePath"))},zoomIn:function(a){var b=a.svg,c=a.scaleFactor,d=void 0===c?1.3:c;this.d3Zoom.scaleBy(b.transition().duration(750),d)},zoomOut:function(a){var b=a.svg,c=a.scaleFactor,d=void 0===c?.8:c;this.d3Zoom.scaleBy(b.transition().duration(750),d)},zoom:function(a){var b=a.svg,c=a.xa,d=a.ya,e=a.scale;b.transition().duration(750).call(this.d3Zoom.transform,qd.translate(c,d).scale(e))},fitToScreen:function(a){var b=a.svg,c=b.node(),d=c.getBBox(),e=c.parentElement,f=e.clientWidth,g=e.clientHeight,h=d.width,i=d.height,j=d.x+h/2,k=d.y+i/2,l=(l||.95)/Math.max(h/f,i/g),m=f/2-l*j,n=g/2-l*k;this.zoom({svg:b,xa:m,ya:n,scale:l})},centerNode:function(a){var b=a.guid,c=a.g,d=a.svg,e=a.svgGroupEl,f=(a.edgePathEl,a.width),g=a.height,h=a.fitToScreen,i=a.onCenterZoomed,j=a.isSelected;this.d3Zoom=function(){function a(a){a.property("__zoom",xb).on("wheel.zoom",h).on("mousedown.zoom",i).on("dblclick.zoom",j).filter(t).on("touchstart.zoom",k).on("touchmove.zoom",l).on("touchend.zoom touchcancel.zoom",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(a,b){return(b=Math.max(u[0],Math.min(u[1],b)))===a.k?a:new tb(b,a.x,a.y)}function c(a,b,c){var d=b[0]-c[0]*a.k,e=b[1]-c[1]*a.k;return d===a.x&&e===a.y?a:new tb(a.k,d,e)}function d(a){return[(+a[0][0]+ +a[1][0])/2,(+a[0][1]+ +a[1][1])/2]}function e(a,b,c){a.on("start.zoom",function(){f(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){f(this,arguments).end()}).tween("zoom",function(){var a=this,e=arguments,g=f(a,e),h=q.apply(a,e),i=null==c?d(h):"function"==typeof c?c.apply(a,e):c,j=Math.max(h[1][0]-h[0][0],h[1][1]-h[0][1]),k=a.__zoom,l="function"==typeof b?b.apply(a,e):b,m=x(k.invert(i).concat(j/k.k),l.invert(i).concat(j/l.k));return function(a){if(1===a)a=l;else{var b=m(a),c=j/b[2];a=new tb(c,i[0]-b[0]*c,i[1]-b[1]*c)}g.zoom(null,a)}})}function f(a,b,c){return!c&&a.__zooming||new g(a,b)}function g(a,b){this.that=a,this.args=b,this.active=0,this.extent=q.apply(a,b),this.taps=0}function h(){function a(){d.wheel=null,d.end()}if(p.apply(this,arguments)){var d=f(this,arguments),e=this.__zoom,g=Math.max(u[0],Math.min(u[1],e.k*Math.pow(2,s.apply(this,arguments)))),h=wc(this);if(d.wheel)d.mouse[0][0]===h[0]&&d.mouse[0][1]===h[1]||(d.mouse[1]=e.invert(d.mouse[0]=h)),clearTimeout(d.wheel);else{if(e.k===g)return;d.mouse=[h,e.invert(h)],Oc(this),d.start()}rd(),d.wheel=setTimeout(a,150),d.zoom("mouse",r(c(b(e,g),d.mouse[0],d.mouse[1]),d.extent,v))}}function i(){function a(){if(rd(),!d.moved){var a=hc.clientX-h,b=hc.clientY-i;d.moved=a*a+b*b>z}d.zoom("mouse",r(c(d.that.__zoom,d.mouse[0]=wc(d.that),d.mouse[1]),d.extent,v))}function b(){e.on("mousemove.zoom mouseup.zoom",null),ka(hc.view,d.moved),rd(),d.end()}if(!o&&p.apply(this,arguments)){var d=f(this,arguments,!0),e=kc(hc.view).on("mousemove.zoom",a,!0).on("mouseup.zoom",b,!0),g=wc(this),h=hc.clientX,i=hc.clientY;rc(hc.view),ub(),d.mouse=[g,this.__zoom.invert(g)],Oc(this),d.start()}}function j(){if(p.apply(this,arguments)){var d=this.__zoom,f=wc(this),g=d.invert(f),h=d.k*(hc.shiftKey?.5:2),i=r(c(b(d,h),f,g),q.apply(this,arguments),v);rd(),w>0?kc(this).transition().duration(w).call(e,i,f):kc(this).call(a.transform,i)}}function k(){if(p.apply(this,arguments)){var a,b,c,d,e=hc.touches,g=e.length,h=f(this,arguments,hc.changedTouches.length===g);for(ub(),b=0;bg[id='"+b+"']"),l=(this.d3Zoom.scaleExtent([.01,50]).on("zoom",function(){e.attr("transform",hc.transform)}),null),m=null;if(k.empty()){if(h)return void this.fitToScreen({svg:d});l=c.graph().width/2,m=c.graph().height/2}else{var n=k.attr("transform").replace(/[^0-9\-.,]/g,"").split(",");l=n[0],m=n[1]}var o=-(1.2*l-f/2),p=-(1.2*m-g/2);this.zoom({svg:d,xa:o,ya:p,scale:1.2}),j?d.transition().duration(750).call(this.d3Zoom.transform,qd.translate(o,p).scale(1.2)):d.call(this.d3Zoom.transform,qd.translate(o,p).scale(1.2)),i&&i({newScale:1.2,newTranslate:[o,p],d3Zoom:this.d3Zoom,selectedNodeEl:k})},getToolTipDirection:function(a){var b=a.el,c=kc("body").node().getBoundingClientRect().width,d=kc(b).node().getBoundingClientRect(),e="e";return c-d.left<330?(e=c-d.left<330&&d.top<400?"sw":"w",c-d.left<330&&d.top>600&&(e="nw")):d.top>600?(e=c-d.left<330&&d.top>600?"nw":"n",d.left<50&&(e="ne")):d.top<400&&(e=d.left<50?"se":"s"),e},onHoverFade:function(a){var b=a.svg,c=a.g,d=a.mouseenter,e=a.nodesToHighlight,f=a.hoveredNode;return function(a){var e=b.selectAll(".node"),g=b.selectAll(".edgePath");if(d){b.classed("hover",!0);var h=c.successors(f),i=c.predecessors(f);a=h.concat(i),e.classed("hover-active-node",function(b,c,d){return!!function(a,b,c){if(a===c||b&&b.length&&-1!=b.indexOf(c))return!0}(f,a,b)}),g.classed("hover-active-path",function(a){return!!(a.v===f||a.w===f?1:0)})}else b.classed("hover",!1),e.classed("hover-active-node",!1),g.classed("hover-active-path",!1)}(e)},getBaseUrl:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.pathname;return a.replace(/\/[\w-]+.(jsp|html)|\/+$/gi,"")},getEntityIconPath:function(a){var b=a.entityData,c=a.errorUrl,d=a.imgBasePath,e=this.getBaseUrl()+(d||"/img/entity-icon/");if(b){var f=function(a){return e+(Cd.entityStateReadOnly[j]?"disabled/"+a:a)},g=function(){return k?Cd.entityStateReadOnly[j]?e+"disabled/process.png":e+"process.png":Cd.entityStateReadOnly[j]?e+"disabled/table.png":e+"table.png"},h=b.typeName,i=b.serviceType,j=b.status,k=b.isProcess;if(c){if(c.indexOf("table.png")>-1||c.indexOf("process.png")>-1)return null;var l=!(!c||!c.match("entity-icon/"+h+".png|disabled/"+h+".png"));return i&&l?f(i+".png"):g()}return h?f(h+".png"):i?f(i+".png"):g()}},base64Encode:function(a,b){var c=new FileReader;c.addEventListener("load",function(){return b(c.result)}),c.readAsDataURL(a)},imgShapeRender:function(a,b,c,d){function e(a){g.select('pattern[id="img_'+a.imgName+'"]').empty()&&g.append("pattern").attr("x","0%").attr("y","0%").attr("patternUnits","objectBoundingBox").attr("id","img_"+a.imgName).attr("width","100%").attr("height","100%").append("image").attr("href",function(b){var d=this;c&&!function b(e){var f=e.imagePath,g={url:f,method:"GET",cache:!0};p.attr("data-iconpath",f);var h=new XMLHttpRequest;h.onreadystatechange=function(){if(4===h.readyState)if(200===h.status)"IE"!==Bd.a.name?k.base64Encode(this.response,function(b){k.imageObject[a.imageIconPath]=b,kc(d).attr("xlink:href",b)}):k.imageObject[a.imageIconPath]=f,a.imageIconPath!==p.attr("data-iconpath")&&p.attr("data-iconpathorigin",a.imageIconPath);else if(404===h.status){var e=k.getEntityIconPath({entityData:c,errorUrl:f});if(null===e){var g=kc(d.parentElement);g.select("image").remove(),g.attr("patternContentUnits","objectBoundingBox").append("circle").attr("r","24px").attr("fill","#e8e8e8")}else b({imagePath:e})}},h.responseType="blob",h.open(g.method,g.url,!0),h.send(null)}({imagePath:a.imageIconPath})}).attr("x",a.leftPosition).attr("y",a.topPosition).attr("width",a.width).attr("height",a.height)}var f=d.dagreD3,g=d.defsEl,h=d.imgBasePath,i=d.guid,j=d.isRankdirToBottom,k=this,l=i,m=this.getEntityIconPath({entityData:c,imgBasePath:h}),n=m.split("/").pop();if(void 0===this.imageObject&&(this.imageObject={}),c.isDeleted&&(n="deleted_"+n),c.id==l)var o=!0;var p=a.append("circle").attr("fill","url(#img_"+n+")").attr("r",j?"30px":"24px").attr("data-stroke",c.id).attr("stroke-width","2px").attr("class","nodeImage "+(o?"currentNode":c.isProcess?"process":"node"));return o&&p.attr("stroke","#fb4200"),!0===c.isIncomplete&&(a.attr("class","node isIncomplete show"),a.insert("rect").attr("x","-5").attr("y","-23").attr("width","14").attr("height","16").attr("fill","url(#img_hourglass.svg)").attr("data-stroke",c.id).attr("stroke-width","2px"),e({imgName:"hourglass.svg",imageIconPath:"/img/entity-icon/hourglass.svg",leftPosition:"0",topPosition:"0",width:"12",height:"14"})),e({imgName:n,imageIconPath:m,leftPosition:j?"11":"4",topPosition:j?"20":o?"3":"4",width:"40",height:"40"}),c.intersect=function(a){return f.intersect.circle(c,o?k.nodeArrowDistance+3:k.nodeArrowDistance,a)},p},arrowPointRender:function(a,b,c,d,e){var f=e.dagreD3,g=a.node(),h=g?g.parentNode:a;kc(h).select("path.path").attr("marker-end","url(#"+b+")");var i=a.append("marker").attr("id",b).attr("viewBox","0 0 10 10").attr("refX",8).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",4).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",c.styleObj.stroke);f.util.applyStyle(i,c[d+"Style"]); },saveSvg:function(a){var b=a.svg,c=a.width,d=a.height,e=a.downloadFileName,f=a.onExportLineage,g=this,h=b.clone(!0).node();setTimeout(function(){"Firefox"===Bd.a.name&&(h.setAttribute("width",c),h.setAttribute("height",d));var a=kc("body").append("div");a.classed("hidden-svg",!0),a.node().appendChild(h);var b=kc(".hidden-svg svg");b.select("g").attr("transform","scale(1)"),b.select("foreignObject").remove();var i=150,j=150,k=h.getBBox().width+i,l=h.getBBox().height+j,m=h.getBBox().x,n=h.getBBox().y;h.attributes.viewBox.value=m+","+n+","+k+","+l;var o=document.createElement("canvas");o.id="canvas",o.style.display="none",o.width=1*h.getBBox().width+i,o.height=1*h.getBBox().height+j,kc("body").node().appendChild(o);var p=o.getContext("2d"),q=(new XMLSerializer).serializeToString(h),r=window.URL||window.webkitURL||window;p.fillStyle="#FFFFFF",p.fillRect(0,0,o.width,o.height),p.strokeRect(0,0,o.width,o.height),p.restore();var s=new Image(o.width,o.height),t=new Blob([q],{type:"image/svg+xml;base64"});"Safari"===Bd.a.name&&(t=new Blob([q],{type:"image/svg+xml"})),p.drawImage(s,50,50,o.width,o.height);var u=r.createObjectURL(t);s.onload=function(){try{var b=document.createElement("a");b.download=e,document.body.appendChild(b),p.drawImage(s,50,50,o.width,o.height),o.toBlob(function(a){a?(b.href=r.createObjectURL(a),a.size>1e7&&f({status:"failed",message:"The Image size is huge, please open the image in a browser!"}),b.click(),f({status:"Success",message:"Successful"}),"Safari"===Bd.a.name&&g.refreshGraphForSafari({edgeEl:g.$("svg g.node")})):f({status:"failed",message:"There was an error in downloading Lineage!"})},"image/png"),a.remove(),o.remove()}catch(a){f({status:"failed",message:"There was an error in downloading Lineage!"})}},s.src=u},0)}},Ed={getBaseUrl:function(a){return a.replace(/\/[\w-]+.(jsp|html)|\/+$/gi,"")},getEntityIconPath:function(){function a(a){return i+(Cd.entityStateReadOnly[d]?"disabled/"+a:a)}function b(){return g.isProcess?Cd.entityStateReadOnly[d]?i+"disabled/process.png":i+"process.png":Cd.entityStateReadOnly[d]?i+"disabled/table.png":i+"table.png"}var c,d,e,f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},g=f.entityData,h=f.errorUrl,i=this.getBaseUrl(window.location.pathname)+Globals.entityImgPath;if(g&&(e=g.typeName,c=g&&g.serviceType,d=g&&g.status),g){if(h){var j=!(!h||!h.match("entity-icon/"+e+".png|disabled/"+e+".png"));return c&&j?a(c+".png"):b()}return g.typeName?a(g.typeName+".png"):b()}},isProcess:function(a){var b=a.typeName,c=a.superTypes;return a.entityDef,"Process"==b||c.indexOf("Process")>-1},isDeleted:function(a){if(void 0!==a)return Cd.entityStateReadOnly[a.status]},isNodeToBeUpdated:function(a,b){var c=b.isProcessHideCheck,d=b.isDeletedEntityHideCheck,e={isProcess:c&&a.isProcess,isDeleted:d&&a.isDeleted};return e.update=e.isProcess||e.isDeleted,e},getServiceType:function(a){var b=a.typeName,c=a.entityDef,d=null;return b&&c&&(d=c.serviceType||null),d},getEntityDef:function(a){var b=a.typeName,c=a.entityDefCollection,d=null;return b&&(d=c.find(function(a){return a.name==b})),d},getNestedSuperTypes:function(a){var b=a.entityDef,c=a.entityDefCollection,d=new Set;return function a(b,c){b&&b.superTypes&&b.superTypes.length&&b.superTypes.forEach(function(b){d.add(b);var e=c.find(function(a){a.name});e&&a(e,c)})}(b,c),Array.from(d)},generateData:function(a){var b=this,c=a.data,d=void 0===c?{}:c,e=a.filterObj,f=a.entityDefCollection,g=a.g,h=a.guid,i=a.setGraphEdge,j=a.setGraphNode;return new Promise(function(a,c){try{var k=d.relations||{},l=d.guidEntityMap||{},m=e.isProcessHideCheck||e.isDeletedEntityHideCheck,n={fill:"none",stroke:"#ffb203",width:3},o=function(a){if(a){if(a.updatedValues)return a;var c=a.displayText?a.displayText:" ",d=Object.assign(a,{shape:"img",updatedValues:!0,label:c.trunc(18),toolTipLabel:c,id:a.guid,isLineage:!0,isIncomplete:a.isIncomplete,entityDef:b.getEntityDef({typeName:a.typeName,entityDefCollection:f})});return d.serviceType=b.getServiceType(d),d.superTypes=b.getNestedSuperTypes(Mb(Mb({},d),{},{entityDefCollection:f})),d.isProcess=b.isProcess(d),d.isDeleted=b.isDeleted(d),d}},p=function(a){return"fill:"+a.fill+";stroke:"+a.stroke+";stroke-width:"+a.width},q=function(a,c,d){var e=[];return a.forEach(function(a){if(b.isNodeToBeUpdated(o(l[a]),d).update)if(u[a])e=e.concat(u[a]);else{var c=function a(c,d){if(c&&v[c]){var e=[];return v[c].forEach(function(c){if(b.isNodeToBeUpdated(o(l[c]),d).update){var f=a(c,d);f&&(e=e.concat(f))}else e.push(c)}),e}return null}(a,d);c&&(e=e.concat(c))}else e.push(a)}),e},r=function(a){if(g._nodes[a])return g._nodes[a];var b=o(l[a]);return j(a,b),b},s=function(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i(a,b,Mb({arrowhead:"arrowPoint",curve:lc,style:p(n),styleObj:n},c))},t=function(a,b){r(a),r(b),s(a,b)},u={};if(m){var v=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=a.relations,c={};return b.forEach(function(a){c[a.fromEntityId]?c[a.fromEntityId].push(a.toEntityId):c[a.fromEntityId]=[a.toEntityId]}),c}(d);Object.keys(v).forEach(function(a){var c=v[a],d=b.isNodeToBeUpdated(o(l[a]),e),f=q(c,0,e);d.update?u[a]?u[a]=u[a].concat(f):u[a]=f:f.forEach(function(b){t(a,b)})})}else k.forEach(function(a){t(a.fromEntityId,a.toEntityId)});g._nodes[h]&&(g._nodes[h]&&(g._nodes[h].isLineage=!1),b.findImpactNodeAndUpdateData({guid:h,g:g,setEdge:s,getStyleObjStr:p})),a(g)}catch(a){c(a)}})},findImpactNodeAndUpdateData:function(a){var b=a.guid,c=a.getStyleObjStr,d=a.g,e=a.setEdge,f={},g={fill:"none",stroke:"#fb4200",width:3};!function a(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},h=arguments.length>1?arguments[1]:void 0,i=Object.keys(b);i.length&&(f[h]||(f[h]=!0,i.forEach(function(b){d._nodes[b]&&(d._nodes[b].isLineage=!1),e(h,b,{style:c(g),styleObj:g}),a(d._sucs[b],b)})))}(d._sucs[b],b)}};String.prototype.trunc=String.prototype.trunc||function(a){return this.length>a?this.substr(0,a-1)+"...":this},Ob.prototype=Pb.prototype={constructor:Ob,has:function(a){return"$"+a in this},get:function(a){return this["$"+a]},set:function(a,b){return this["$"+a]=b,this},remove:function(a){var b="$"+a;return b in this&&delete this[b]},clear:function(){for(var a in this)"$"===a[0]&&delete this[a]},keys:function(){var a=[];for(var b in this)"$"===b[0]&&a.push(b.slice(1));return a},values:function(){var a=[];for(var b in this)"$"===b[0]&&a.push(this[b]);return a},entries:function(){var a=[];for(var b in this)"$"===b[0]&&a.push({key:b.slice(1),value:this[b]});return a},size:function(){var a=0;for(var b in this)"$"===b[0]&&++a;return a},empty:function(){for(var a in this)if("$"===a[0])return!1;return!0},each:function(a){for(var b in this)"$"===b[0]&&a(this[b],b.slice(1),this)}};var Fd=Pb,Gd=Fd.prototype;Qb.prototype=Rb.prototype={constructor:Qb,has:Gd.has,add:function(a){return this["$"+(a+="")]=a,this},remove:Gd.remove,clear:Gd.clear,values:Gd.keys,size:Gd.size,empty:Gd.empty,each:Gd.each},c(9);var Hd=function(){function a(b){var c=this;!function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}(this,a),this._setGraphNode=function(a,b){c.actualData[a]=Object.assign({},b),c.g.setNode(a,b)},this._setGraphEdge=function(a,b,d){c.g.setEdge(a,b,Ub({curve:lc},d))},this.options={},this._updateOptions(b);var d=this.options,e=d.el,f=d.manualTrigger,g=void 0!==f&&f;if(void 0===e)throw new Error("LineageHelper requires el propety to render the graph");return this.initReturnObj={init:function(a){return c.init(a)},updateOptions:function(a){return c._updateAllOptions(a)},createGraph:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return c._createGraph(c.options,c.graphOptions,a)},clear:function(a){return c.clear(a)},refresh:function(a){return c.refresh(a)},centerAlign:function(a){return c.centerAlign(a)},exportLineage:function(a){return c.exportLineage(a)},zoomIn:function(a){return c.zoomIn(a)},zoomOut:function(a){return c.zoomOut(a)},zoom:function(a){return c.zoom(a)},fullScreen:function(a){return c.fullScreen(a)},searchNode:function(a){return c.searchNode(a)},displayFullName:function(a){return c.displayFullName(a)},removeNodeSelection:function(a){return c.removeNodeSelection(a)},getGraphOptions:function(){return c.graphOptions},getNode:function(a,b){var d=null;return(d=b?c.actualData[a]:c.g._nodes[a])&&(d=Object.assign({},d)),d},getNodes:function(a,b){var d=null;return(d=b?c.actualData:c.g._nodes)&&(d=Object.assign({},d)),d},setNode:this._setGraphNode,setEdge:this._setGraphEdge},!1===g&&this.init(),this.initReturnObj}var b,c,d;return b=a,(c=[{key:"_updateAllOptions",value:function(a){Object.assign(this.options,a);var b=this.svg.node().getBoundingClientRect();this.graphOptions.width=this.options.width||b.width,this.graphOptions.height=this.options.height||b.height;var c=this.graphOptions,d=c.svg,e=c.width,f=c.height,g=c.guid,h=this.options.fitToScreen;d.select("g").node().removeAttribute("transform"),d.attr("viewBox","0 0 "+e+" "+f).attr("enable-background","new 0 0 "+e+" "+f),this.centerAlign({fitToScreen:h,guid:g})}},{key:"_updateOptions",value:function(a){Object.assign(this.options,{filterObj:{isProcessHideCheck:!1,isDeletedEntityHideCheck:!1}},a)}},{key:"init",value:function(){var a=this.options.data,b=void 0===a?{}:a;b.baseEntityGuid&&(this.guid=b.baseEntityGuid),this._initializeGraph(),this._initGraph()}},{key:"clear",value:function(){this.options.el||(this.svg.remove(),this.svg=null),this.g=null,this.graphOptions={}}},{key:"centerAlign",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=this.svg.select("g"),c=b.selectAll("g.edgePath");Dd.centerNode(Ub(Ub({},this.graphOptions),{},{svgGroupEl:b,edgePathEl:c},a))}},{key:"zoomIn",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Dd.zoomIn(Ub(Ub({},this.graphOptions),a))}},{key:"zoomOut",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Dd.zoomOut(Ub(Ub({},this.graphOptions),a))}},{key:"zoom",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Dd.zoom(Ub(Ub({},this.graphOptions),a))}},{key:"displayFullName",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=this;this.g.nodes().forEach(function(c){var d=b.svg.selectAll("g.nodes>g[id='"+c+"']"),e=b.g.node(c).toolTipLabel;1==a.bLabelFullText?d.select("tspan").text(e):d.select("tspan").text(e.trunc(18))}),this.selectedNode&&this.searchNode({guid:this.selectedNode})}},{key:"refresh",value:function(){this.clear(),this._initializeGraph(),this._initGraph({refresh:!0}),this.selectedNode=""}},{key:"removeNodeSelection",value:function(){this.svg.selectAll("g.node>circle").classed("node-detail-highlight",!1)}},{key:"searchNode",value:function(a){var b=a.guid,c=a.onSearchNode;this.svg.selectAll(".serach-rect").remove(),this.svg.selectAll(".label").attr("stroke","none"),this.selectedNode=b,this.centerAlign({guid:b,onCenterZoomed:function(a){var b=a.selectedNodeEl,d=b.node().getBBox(),e=d.width+10,f=d.x-5;b.select(".label").attr("stroke","#316132"),b.select("circle").classed("wobble",!0),b.insert("rect","circle").attr("class","serach-rect").attr("stroke","#37bb9b").attr("stroke-width","2.5px").attr("fill","none").attr("x",f).attr("y",-27.5).attr("width",e).attr("height",60),c&&"function"==typeof c&&c(a)},isSelected:!0})}},{key:"exportLineage",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=a.downloadFileName;if(void 0===b){var c=this.g._nodes[this.guid];b=c&&c.attributes?"".concat(c.attributes.qualifiedName||c.attributes.name||"lineage_export",".png"):"export.png"}Dd.saveSvg(Ub(Ub({},this.graphOptions),{},{downloadFileName:b,onExportLineage:function(a){function b(b){return a.apply(this,arguments)}return b.toString=function(){return a.toString()},b}(function(b){a.onExportLineage&&onExportLineage(b)})}))}},{key:"fullScreen",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=a.el;if(void 0===b)throw new Error("LineageHelper requires el propety to apply fullScreen class");var c=kc(b);return c.classed("fullscreen-mode")?(c.classed("fullscreen-mode",!1),!1):(c.classed("fullscreen-mode",!0),!0)}},{key:"_getValueFromUser",value:function(a){if(void 0!==a)return"function"==typeof a?a():a}},{key:"_initializeGraph",value:function(){var a=this.options,b=a.width,c=void 0===b?"100%":b,d=a.height,e=void 0===d?"100%":d,f=a.el;this.svg=kc(f),f instanceof SVGElement||(this.svg.selectAll("*").remove(),this.svg=this.svg.append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr(" xmlns:xlink","http://www.w3.org/1999/xlink").attr("version","1.1").attr("width",c).attr("height",e)),this.g=(new Yb.a.graphlib.Graph).setGraph(Object.assign({nodesep:50,ranksep:90,rankdir:"LR",marginx:20,marginy:20,transition:function(a){return a.transition().duration(500)}},this.options.dagreOptions)).setDefaultEdgeLabel(function(){return{}});var g=this.svg.node().getBoundingClientRect();this.actualData={},this.graphOptions={svg:this.svg,g:this.g,dagreD3:Yb.a,guid:this.guid,width:this.options.width||g.width,height:this.options.height||g.height}}},{key:"_initGraph",value:function(){var a=this,b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=b.refresh;this.svg&&this.svg.select("g").remove();var d=this.options.filterObj;if(this.options.getFilterObj){var e=this.options.getFilterObj();if(void 0!==e||null!==e){if("object"!==Sb(e))throw new Error("getFilterObj expect return type `object`,`null` or `Undefined`");d=e}}if(!0!==this.options.setDataManually)return void 0===this.options.data||this.options.data&&0===this.options.data.relations.length?(this.options.beforeRender&&this.options.beforeRender(),this.svg.append("text").attr("x","50%").attr("y","50%").attr("alignment-baseline","middle").attr("text-anchor","middle").text("没有血缘数据"),void(this.options.afterRender&&this.options.afterRender())):Ed.generateData(Ub(Ub(Ub({},this.options),{},{filterObj:d},this.graphOptions),{},{setGraphNode:this._setGraphNode,setGraphEdge:this._setGraphEdge})).then(function(b){a._createGraph(a.options,a.graphOptions,{refresh:c})})}},{key:"_createGraph",value:function(a,b,c){var d=this,e=a.data,f=void 0===e?{}:e,g=a.imgBasePath,h=a.isShowTooltip,i=a.isShowHoverPath,j=a.onLabelClick,k=a.onPathClick,l=a.onNodeClick,m=a.zoom,n=a.fitToScreen,o=a.getToolTipContent,p=a.toolTipTitle,q=c.refresh;this.options.beforeRender&&this.options.beforeRender(),this.selectedNode="";var r=this,s=b.svg,t=b.g,u=b.width,v=b.height,w=this.options.dagreOptions&&"tb"===this.options.dagreOptions.rankdir;if(s instanceof jc==0)throw new Error("svg is not initialized or something went wrong while creatig graph instance");if(void 0!==t._nodes&&0!==t._nodes.length){t.nodes().forEach(function(a){var b=t.node(a);b&&(b.rx=b.ry=5)}),s.attr("viewBox","0 0 "+u+" "+v).attr("enable-background","new 0 0 "+u+" "+v);var x=s.append("g"),y=s.append("defs"),z=new Yb.a.render;z.arrows().arrowPoint=function(){return Dd.arrowPointRender.apply(Dd,Array.prototype.slice.call(arguments).concat([Ub({},b)]))},z.shapes().img=function(){return Dd.imgShapeRender.apply(Dd,Array.prototype.slice.call(arguments).concat([Ub(Ub({},b),{},{isRankdirToBottom:w,imgBasePath:r._getValueFromUser(g),defsEl:y})]))};var A=function(){function a(a){(k=function(a){var b=a.node();return b?"svg"===b.tagName.toLowerCase()?b:b.ownerSVGElement:null}(a))&&(l=k.createSVGPoint(),i.appendChild(j))}function b(){var a=kc(document.createElement("div"));return a.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),a.node()}function c(){return null==j&&(j=b(),i.appendChild(j)),kc(j)}function d(a){for(var b=m||a;null==b.getScreenCTM&&null!=b.parentNode;)b=b.parentNode;var c={},d=b.getScreenCTM(),e=b.getBBox(),f=e.width,g=e.height,h=e.x,i=e.y;return l.x=h,l.y=i,c.nw=l.matrixTransform(d),l.x+=f,c.ne=l.matrixTransform(d),l.y+=g,c.se=l.matrixTransform(d),l.x-=f,c.sw=l.matrixTransform(d),l.y-=g/2,c.w=l.matrixTransform(d),l.x+=f,c.e=l.matrixTransform(d),l.x-=f/2,l.y-=g/2,c.n=l.matrixTransform(d),l.y+=g,c.s=l.matrixTransform(d),c}function e(a){return"function"==typeof a?a:function(){return a}}var f=function(){return"n"},g=function(){return[0,0]},h=function(){return" "},i=document.body,j=b(),k=null,l=null,m=null;a.show=function(){var b=Array.prototype.slice.call(arguments);b[b.length-1]instanceof SVGElement&&(m=b.pop());var d,e=h.apply(this,b),j=g.apply(this,b),k=f.apply(this,b),l=c(),p=o.length,q=document.documentElement.scrollTop||i.scrollTop,r=document.documentElement.scrollLeft||i.scrollLeft;for(l.html(e).style("opacity",1).style("pointer-events","all");p--;)l.classed(o[p],!1);return d=n.get(k).apply(this),l.classed(k,!0).style("top",d.top+j[0]+q+"px").style("left",d.left+j[1]+r+"px"),a},a.hide=function(){return c().style("opacity",0).style("pointer-events","none"),a},a.attr=function(b,d){if(arguments.length<2&&"string"==typeof b)return c().attr(b);var e=Array.prototype.slice.call(arguments);return jc.prototype.attr.apply(c(),e),a},a.style=function(b,d){if(arguments.length<2&&"string"==typeof b)return c().style(b);var e=Array.prototype.slice.call(arguments);return jc.prototype.style.apply(c(),e),a},a.direction=function(b){return arguments.length?(f=null==b?b:e(b),a):f},a.offset=function(b){return arguments.length?(g=null==b?b:e(b),a):g},a.html=function(b){return arguments.length?(h=null==b?b:e(b),a):h},a.rootElement=function(b){return arguments.length?(i=null==b?b:e(b),a):i},a.destroy=function(){return j&&(c().remove(),j=null),a};var n=Fd({n:function(){var a=d(this);return{top:a.n.y-j.offsetHeight,left:a.n.x-j.offsetWidth/2}},s:function(){var a=d(this);return{top:a.s.y,left:a.s.x-j.offsetWidth/2}},e:function(){var a=d(this);return{top:a.e.y-j.offsetHeight/2,left:a.e.x}},w:function(){var a=d(this);return{top:a.w.y-j.offsetHeight/2,left:a.w.x-j.offsetWidth}},nw:function(){var a=d(this);return{top:a.nw.y-j.offsetHeight,left:a.nw.x-j.offsetWidth}},ne:function(){var a=d(this);return{top:a.ne.y-j.offsetHeight,left:a.ne.x}},sw:function(){var a=d(this);return{top:a.sw.y,left:a.sw.x-j.offsetWidth}},se:function(){var a=d(this);return{top:a.se.y,left:a.se.x}}}),o=n.keys();return a}().attr("class","d3-tip").offset([10,0]).html(function(a){if(o&&"function"==typeof o)return o(a,t.node(a));var b=t.node(a),c="";return p?c="
"+p+"
":b.id!==d.guid&&(c="
"+(b.isLineage?"Lineage":"Impact")+"
"),c+="
"+b.toolTipLabel+"
",b.typeName&&(c+="
("+b.typeName+")
"),b.queryText&&(c+="
Query: "+b.queryText+"
"),"
"+c+"
"});s.call(A),z(x,t),x.selectAll("g.nodes g.label").attr("transform",function(){return w?"translate(2,-20)":"translate(2,-38)"}).attr("font-size","10px").on("mouseenter",function(a){hc.preventDefault(),kc(this).classed("highlight",!0)}).on("mouseleave",function(a){hc.preventDefault(),kc(this).classed("highlight",!1)}).on("click",function(a){hc.preventDefault(),j&&"function"==typeof j&&j({clickedData:a}),A.hide(a)}),x.selectAll("g.nodes g.node circle").on("mouseenter",function(a,c,d){if(r.activeNode=!0,this.getScreenCTM().translate(+this.getAttribute("cx"),+this.getAttribute("cy")),r.svg.selectAll(".node").classed("active",!1),kc(this).classed("active",!0),r._getValueFromUser(h)){var e=Dd.getToolTipDirection({el:this});A.direction(e).show(a,this)}!1!==r._getValueFromUser(i)&&Dd.onHoverFade(Ub({opacity:.3,mouseenter:!0,hoveredNode:a},b))}).on("mouseleave",function(a){r.activeNode=!1;var c=this;setTimeout(function(b){r.activeTip||r.activeNode||(kc(c).classed("active",!1),r._getValueFromUser(h)&&A.hide(a))},150),!1!==r._getValueFromUser(i)&&Dd.onHoverFade(Ub({mouseenter:!1,hoveredNode:a},b))}).on("click",function(a){hc.defaultPrevented||(hc.preventDefault(),A.hide(a),s.selectAll("g.node>circle").classed("node-detail-highlight",!1),kc(this).classed("node-detail-highlight",!0),l&&"function"==typeof l&&l({clickedData:a,el:this}))});var B=x.selectAll("g.edgePath");B.selectAll("path.path").on("click",function(a){if(k&&"function"==typeof k){var b=f.relations.find(function(b){if(b.fromEntityId===a.v&&b.toEntityId===a.w)return!0});k({pathRelationObj:b,clickedData:a})}}),!1!==m&&Dd.centerNode(Ub(Ub({},b),{},{fitToScreen:n,svgGroupEl:x,edgePathEl:B})),Dd.dragNode(Ub(Ub({},b),{},{edgePathEl:B})),!0!==q&&this._addLegend(),this.options.afterRender&&this.options.afterRender()}else s.html('No relations to display')}},{key:"_addLegend",value:function(){if(!1!==this.options.legends){var a=kc(this.options.legendsEl||this.options.el).insert("div",":first-child").classed("legends",!0),b=a.append("span").style("color","#fb4200");b.append("i").classed("fa fa-circle-o fa-fw",!0),b.append("span").html("当前实体"),(b=a.append("span").style("color","#686868")).append("i").classed("fa fa-hourglass-half fa-fw",!0),b.append("span").html("进行中"),(b=a.append("span").style("color","#df9b00")).append("i").classed("fa fa-long-arrow-right fa-fw",!0),b.append("span").html("血缘"),(b=a.append("span").style("color","#fb4200")).append("i").classed("fa fa-long-arrow-right fa-fw",!0),b.append("span").html("影响")}}}])&&Wb(b.prototype,c),d&&Wb(b,d),a}()}])});