diff --git a/app.yml b/app.yml index f0cd49fbe6..9f37147d67 100644 --- a/app.yml +++ b/app.yml @@ -6,7 +6,7 @@ is_use_celery: True author: 蓝鲸智云 introduction: 标准运维是通过一套成熟稳定的任务调度引擎,把在多系统间的工作整合到一个流程,助力运维实现跨系统调度自动化的SaaS应用。 introduction_en: SOPS is a SaaS application that utilizes a set of mature and stable task scheduling engines to help realize cross-system scheduling automation, and integrates the work among multiple systems into a single process. -version: 3.30.2 +version: 3.31.0 category: 运维工具 language_support: 中文 desktop: diff --git a/app_desc.yaml b/app_desc.yaml index f399ae89cf..c45cea3485 100644 --- a/app_desc.yaml +++ b/app_desc.yaml @@ -1,5 +1,5 @@ spec_version: 2 -app_version: "3.30.2" +app_version: "3.31.0" app: region: default bk_app_code: bk_sops diff --git a/config/default.py b/config/default.py index 7f446844e6..e797d76236 100644 --- a/config/default.py +++ b/config/default.py @@ -211,7 +211,7 @@ # mako模板中: # 如果静态资源修改了以后,上线前改这个版本号即可 -STATIC_VERSION = "3.30.2" +STATIC_VERSION = "3.31.0" DEPLOY_DATETIME = datetime.datetime.now().strftime("%Y%m%d%H%M%S") STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")] @@ -766,7 +766,6 @@ def monitor_report_config(): MAX_EXPIRED_SESSION_CLEAN_NUM = env.MAX_EXPIRED_SESSION_CLEAN_NUM EXPIRED_SESSION_CLEAN_CRON = env.EXPIRED_SESSION_CLEAN_CRON - # V2引擎任务清理配置 ENABLE_CLEAN_EXPIRED_V2_TASK = env.ENABLE_CLEAN_EXPIRED_V2_TASK CLEAN_EXPIRED_V2_TASK_CRON = env.CLEAN_EXPIRED_V2_TASK_CRON @@ -829,3 +828,6 @@ def check_engine_admin_permission(request, *args, **kwargs): "SYMMETRIC_CIPHER_TYPE": bkcrypto_constants.SymmetricCipherType.AES.value, } ) + +# 任务列表过滤失败任务最大天数 +TASK_LIST_STATUS_FILTER_DAYS = env.BKPAAS_TASK_LIST_STATUS_FILTER_DAYS diff --git a/docs/develop/tag_usage_dev.md b/docs/develop/tag_usage_dev.md index 91d69ab65f..fd4aec2b71 100644 --- a/docs/develop/tag_usage_dev.md +++ b/docs/develop/tag_usage_dev.md @@ -526,6 +526,7 @@ ip 选择器,支持静态 ip 或动态 ip 的单选和多选。 - `showMiniMap`: 显示小地图,默认 false - `showLanguageSwitch`: 显示语言切换,默认 true - `readOnly`: 只读模式,默认 false + - `variable_render`: 是否开启变量渲染,默认 false **方法** diff --git a/en_docs/develop/tag_usage_dev.md b/en_docs/develop/tag_usage_dev.md index 2d0568e069..4086d96641 100644 --- a/en_docs/develop/tag_usage_dev.md +++ b/en_docs/develop/tag_usage_dev.md @@ -527,6 +527,7 @@ Code editor - `showMiniMap`: show minimap. Default: false - `showLanguageSwitch`: show language switch. Default: true - `readOnly`: read only mode. Default: false + - `variable_render`: enable variable render. Default: false **Methods** diff --git a/env.py b/env.py index b93eea8150..85c1af5bf0 100644 --- a/env.py +++ b/env.py @@ -117,3 +117,6 @@ or os.getenv("BK_CRYPTO_TYPE") or "CLASSIC" ) + +# 默认六个月 +BKPAAS_TASK_LIST_STATUS_FILTER_DAYS = int(os.getenv("BKPAAS_TASK_LIST_STATUS_FILTER_DAYS", 180)) diff --git a/frontend/desktop/package.json b/frontend/desktop/package.json index 475b52a17d..b9cfec0a97 100644 --- a/frontend/desktop/package.json +++ b/frontend/desktop/package.json @@ -19,7 +19,7 @@ "ajv": "^6.10.2", "art-template": "^4.13.0", "axios": "^0.18.0", - "bk-magic-vue": "2.5.2", + "bk-magic-vue": "2.5.8-beta.10", "cron-parser-custom": "^2.13.0", "dom-to-image": "^2.6.0", "element-ui": "^2.4.1", diff --git a/frontend/desktop/src/assets/fonts/bksops-icon.eot b/frontend/desktop/src/assets/fonts/bksops-icon.eot index c453f074e4..0ed6cf8ed2 100644 Binary files a/frontend/desktop/src/assets/fonts/bksops-icon.eot and b/frontend/desktop/src/assets/fonts/bksops-icon.eot differ diff --git a/frontend/desktop/src/assets/fonts/bksops-icon.svg b/frontend/desktop/src/assets/fonts/bksops-icon.svg index f4715b9d89..e1c5106cd9 100644 --- a/frontend/desktop/src/assets/fonts/bksops-icon.svg +++ b/frontend/desktop/src/assets/fonts/bksops-icon.svg @@ -563,6 +563,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/desktop/src/assets/fonts/bksops-icon.ttf b/frontend/desktop/src/assets/fonts/bksops-icon.ttf index 7b4c3a1a45..59bf7604dd 100644 Binary files a/frontend/desktop/src/assets/fonts/bksops-icon.ttf and b/frontend/desktop/src/assets/fonts/bksops-icon.ttf differ diff --git a/frontend/desktop/src/assets/fonts/bksops-icon.woff b/frontend/desktop/src/assets/fonts/bksops-icon.woff index c564651373..d89befc02a 100644 Binary files a/frontend/desktop/src/assets/fonts/bksops-icon.woff and b/frontend/desktop/src/assets/fonts/bksops-icon.woff differ diff --git a/frontend/desktop/src/assets/html/index.html b/frontend/desktop/src/assets/html/index.html index 829cbe110d..5de8ded620 100644 --- a/frontend/desktop/src/assets/html/index.html +++ b/frontend/desktop/src/assets/html/index.html @@ -51,6 +51,7 @@ var MAX_NODE_EXECUTE_TIMEOUT = {{MAX_NODE_EXECUTE_TIMEOUT}}; var BK_DOMAIN = '{{BK_DOMAIN}}'; var BK_PAAS_ESB_HOST = '{{BK_PAAS_ESB_HOST}}' + var TASK_LIST_STATUS_FILTER_DAYS = {{TASK_LIST_STATUS_FILTER_DAYS}} function getCookie(name) { var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); return (arr = document.cookie.match(reg)) ? unescape(arr[2]) : null; diff --git a/frontend/desktop/src/assets/js/flow.js b/frontend/desktop/src/assets/js/flow.js index 78e2ba464d..e74216eda0 100644 --- a/frontend/desktop/src/assets/js/flow.js +++ b/frontend/desktop/src/assets/js/flow.js @@ -1 +1 @@ -function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function e(e){for(var i=1;it.length)&&(e=t.length);for(var n=0,i=new Array(e);n0?1:-1});var t=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},n=function(t,e){return t.x*e.x+t.y*e.y},i=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},o=function(t,e){return{x:t.x*e,y:t.y*e}},s=Math.pow(2,-65),r=function(e,n){for(var o=[],s=a(e,n),r=n.length-1,u=l(s,2*r-1,o,0),c=t(e,n[0]),h=i(c),p=0,f=0;f=64)return n[0]=(t[0].x+t[e].x)/2,1;if(c(t,e))return n[0]=h(t,e),1}d(t,e,.5,r,a),o=l(r,e,p,i+1),s=l(a,e,f,i+1);for(var g=0;gc?c=p:p0?1:-1,a=null;o=0)o=x(c+Math.sqrt(h))*Math.pow(Math.abs(c+Math.sqrt(h)),1/3),s=x(c-Math.sqrt(h))*Math.pow(Math.abs(c-Math.sqrt(h)),1/3),d[0]=-r/3+(o+s),d[1]=-r/3-(o+s)/2,d[2]=-r/3-(o+s)/2,0!==Math.abs(Math.sqrt(3)*(o-s)/2)&&(d[1]=-1,d[2]=-1);else{var p=Math.acos(c/Math.sqrt(-Math.pow(u,3)));d[0]=2*Math.sqrt(-u)*Math.cos(p/3)-r/3,d[1]=2*Math.sqrt(-u)*Math.cos((p+2*Math.PI)/3)-r/3,d[2]=2*Math.sqrt(-u)*Math.cos((p+4*Math.PI)/3)-r/3}for(var f=0;f<3;f++)(d[f]<0||d[f]>1)&&(d[f]=-1);return d}.apply(null,u),h=[];if(null!=c)for(var d=0;d<3;d++){var p,f=c[d],g=Math.pow(f,2),m=Math.pow(f,3),v=[l[0][0]*m+l[0][1]*g+l[0][2]*f+l[0][3],l[1][0]*m+l[1][1]*g+l[1][2]*f+l[1][3]];p=n-t!=0?(v[0]-t)/(n-t):(v[1]-e)/(i-e),f>=0&&f<=1&&p>=0&&p<=1&&h.push(v)}return h};function P(t,e){return[-t[0][e]+3*t[1][e]+-3*t[2][e]+t[3][e],3*t[0][e]-6*t[1][e]+3*t[2][e],-3*t[0][e]+3*t[1][e],t[0][e]]}function x(t){return t<0?-1:t>0?1:0}var C=this.jsBezier={distanceFromCurve:r,gradientAtPoint:y,gradientAtPointAlongCurveFrom:function(t,e,n){var i=v(t,e,n);return i.location>1&&(i.location=1),i.location<0&&(i.location=0),y(t,i.location)},nearestPointOnCurve:function(t,e){var n=r(t,e);return{point:d(e,e.length-1,n.location,null,null),location:n.location}},pointOnCurve:f,pointAlongCurveFrom:function(t,e,n){return v(t,e,n).point},perpendicularToCurveAt:function(t,e,n,i){var o=v(t,e,i=null==i?0:i),s=y(t,o.location),r=Math.atan(-1/s),a=n/2*Math.sin(r),l=n/2*Math.cos(r);return[{x:o.point.x+l,y:o.point.y+a},{x:o.point.x-l,y:o.point.y-a}]},locationAlongCurveFrom:function(t,e,n){return v(t,e,n).location},getLength:function(t){var e=(new Date).getTime();if(m(t))return 0;for(var n=f(t,0),i=0,o=0,s=null;o<1;)s=f(t,o+=.005),i+=g(s,n),n=s;return console.log("length",(new Date).getTime()-e),i},lineIntersection:b,boxIntersection:function(t,e,n,i,o){var s=[];return s.push.apply(s,b(t,e,t+n,e,o)),s.push.apply(s,b(t+n,e,t+n,e+i,o)),s.push.apply(s,b(t+n,e+i,t,e+i,o)),s.push.apply(s,b(t,e+i,t,e,o)),s},boundingBoxIntersection:function(t,e){var n=[];return n.push.apply(n,b(t.x,t.y,t.x+t.w,t.y,e)),n.push.apply(n,b(t.x+t.w,t.y,t.x+t.w,t.y+t.h,e)),n.push.apply(n,b(t.x+t.w,t.y+t.h,t.x,t.y+t.h,e)),n.push.apply(n,b(t.x,t.y+t.h,t.x,t.y,e)),n},version:"0.9.0"};e.jsBezier=C}).call("undefined"!=typeof window?window:s),function(){var t=this.Biltong={version:"0.4.0"};e.Biltong=t;var n=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=function(t,e,i){return i(t=n(t)?t:[t.x,t.y],e=n(e)?e:[e.x,e.y])},o=t.gradient=function(t,e){return i(t,e,function(t,e){return e[0]==t[0]?e[1]>t[1]?1/0:-1/0:e[1]==t[1]?e[0]>t[0]?0:-0:(e[1]-t[1])/(e[0]-t[0])})},s=(t.normal=function(t,e){return-1/o(t,e)},t.lineLength=function(t,e){return i(t,e,function(t,e){return Math.sqrt(Math.pow(e[1]-t[1],2)+Math.pow(e[0]-t[0],2))})},t.quadrant=function(t,e){return i(t,e,function(t,e){return e[0]>t[0]?e[1]>t[1]?2:1:e[0]==t[0]?e[1]>t[1]?2:1:e[1]>t[1]?3:4})}),r=(t.theta=function(t,e){return i(t,e,function(t,e){var n=o(t,e),i=Math.atan(n),r=s(t,e);return 4!=r&&3!=r||(i+=Math.PI),i<0&&(i+=2*Math.PI),i})},t.intersects=function(t,e){var n=t.x,i=t.x+t.w,o=t.y,s=t.y+t.h,r=e.x,a=e.x+e.w,l=e.y,u=e.y+e.h;return n<=r&&r<=i&&o<=l&&l<=s||n<=a&&a<=i&&o<=l&&l<=s||n<=r&&r<=i&&o<=u&&u<=s||n<=a&&r<=i&&o<=u&&u<=s||r<=n&&n<=a&&l<=o&&o<=u||r<=i&&i<=a&&l<=o&&o<=u||r<=n&&n<=a&&l<=s&&s<=u||r<=i&&n<=a&&l<=s&&s<=u},t.encloses=function(t,e,n){var i=t.x,o=t.x+t.w,s=t.y,r=t.y+t.h,a=e.x,l=e.x+e.w,u=e.y,c=e.y+e.h,h=function(t,e,i,o){return n?t<=e&&i>=o:to};return h(i,a,o,l)&&h(s,u,r,c)},[null,[1,-1],[1,1],[-1,1],[-1,-1]]),a=[null,[-1,-1],[-1,1],[1,1],[1,-1]];t.pointOnLine=function(t,e,n){var i=o(t,e),l=s(t,e),u=n>0?r[l]:a[l],c=Math.atan(i),h=Math.abs(n*Math.sin(c))*u[1],d=Math.abs(n*Math.cos(c))*u[0];return{x:t.x+d,y:t.y+h}},t.perpendicularLineTo=function(t,e,n){var i=o(t,e),s=Math.atan(-1/i),r=n/2*Math.sin(s),a=n/2*Math.cos(s);return[{x:e.x+a,y:e.y+r},{x:e.x-a,y:e.y-r}]}}.call("undefined"!=typeof window?window:s),function(){function t(t,e,n,i,o,s,r,a){return function(){var t=[];return Array.prototype.push.apply(t,arguments),t.item=function(t){return this[t]},t}(function(t,e,n,i,o,s,r,a){return new Touch({target:e,identifier:A(),pageX:n,pageY:i,screenX:o,screenY:s,clientX:r||o,clientY:a||s})}.apply(null,arguments))}var n=function(t,e,n){for(var i=(n=n||t.parentNode).querySelectorAll(e),o=0;o-1&&b<9,x=function(t,e){if(null==t)return[0,0];var n=j(t),i=_(n,0);return[i[e+"X"],i[e+"Y"]]},C=function(t){return null==t?[0,0]:P?[t.clientX+document.documentElement.scrollLeft,t.clientY+document.documentElement.scrollTop]:x(t,"page")},_=function(t,e){return t.item?t.item(e):t[e]},j=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},E=function(t){return j(t).length},S=function(t,e,n,i){if(l(t,e,n),i.__tauid=n.__tauid,t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent){var o=e+n.__tauid;t["e"+o]=n,t[o]=function(){t["e"+o]&&t["e"+o](window.event)},t.attachEvent("on"+e,t[o])}},w=function(t,e,n){null!=n&&D(t,function(){var o=i(this);if(function(t,e,n){if(t.__ta&&t.__ta[e]&&delete t.__ta[e][n.__tauid],n.__taExtra){for(var i=0;i-1&&r<9,l=9===r,u=function(t){if(a)return[t.clientX+document.documentElement.scrollLeft,t.clientY+document.documentElement.scrollTop];var e=h(t),n=c(e,0);return l?[n.pageX||n.clientX,n.pageY||n.clientY]:[n.pageX,n.pageY]},c=function(t,e){return t.item?t.item(e):t[e]},h=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},d={delegatedDraggable:"katavorio-delegated-draggable",draggable:"katavorio-draggable",droppable:"katavorio-droppable",drag:"katavorio-drag",selected:"katavorio-drag-selected",active:"katavorio-drag-active",hover:"katavorio-drag-hover",noSelect:"katavorio-drag-no-select",ghostProxy:"katavorio-ghost-proxy",clonedDrag:"katavorio-clone-drag"},p=["stop","start","drag","drop","over","out","beforeStart"],f=function(){},g=function(){return!0},m=function(t,e,n){for(var i=0;i0){var m=function(t,e,n){for(var i=null,r=e.getAttribute("katavorio-draggable"),a=null!=r?"[katavorio-draggable='"+r+"'] ":"",l=0;l0)for(var s=0;s0&&K&&e.setPosition(F,K),J.sort(S);for(var o=0;oe.rank?-1:0},w=function(t){return null==t?null:null==(t="string"==typeof t||t.constructor===String?document.getElementById(t):t)?null:(t._katavorio=t._katavorio||E(),t)};this.Katavorio=function(e){var o=[],s={};this._dragsByScope={},this._dropsByScope={};var r=1,a=function(t,e){y(t,function(t){for(var n=0;n0},u=(this.getMatchingDroppables=function(t){for(var e=[],n={},i=0;i=0&&o.splice(i,1),l(t[e],n)&&y(t[e],function(t){t.destroy()}),delete t[e]}},D=function(t,e,n,i){(t=w(t))[e]&&t[e].off(n,i)};this.elementRemoved=function(t){t._katavorioDrag&&this.destroyDraggable(t),t._katavorioDrop&&this.destroyDroppable(t)},this.destroyDraggable=function(t,e,n){1===arguments.length?E(t,"_katavorioDrag",this._dragsByScope):D(t,"_katavorioDrag",e,n)},this.destroyDroppable=function(t,e,n){1===arguments.length?E(t,"_katavorioDrop",this._dropsByScope):D(t,"_katavorioDrop",e,n)},this.reset=function(){this._dragsByScope={},this._dropsByScope={},o=[],s={},A={}};var A={},I=function(e,n,o){var s,r=i(n)?n:n.id,a=!!i(n)||!1!==n.active,l=A[r]||(s={name:r,members:[]},A[r]=s,s);return y(e,function(e){if(e._katavorioDrag){if(o&&null!=e._katavorioDrag.posseRoles[l.name])return;t(l.members,e._katavorioDrag),t(e._katavorioDrag.posses,l.name),e._katavorioDrag.posseRoles[l.name]=a}}),l};this.addToPosse=function(t,e){for(var n=[],i=1;i-1&&t.splice(n,1),-1!==n}function d(t,e,n,i){var o=t[e];return null==o&&(o=[],t[e]=o),o[i?"unshift":"push"](n),o}e.jsPlumbUtil=t,t.isArray=n,t.isNumber=function(t){return"[object Number]"===Object.prototype.toString.call(t)},t.isString=i,t.isBoolean=o,t.isNull=function(t){return null==t},t.isObject=s,t.isDate=r,t.isFunction=a,t.isNamedFunction=function(t){return a(t)&&null!=t.name&&t.name.length>0},t.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},t.clone=l,t.merge=u,t.replace=function(t,e,n){if(null!=t){var i=t;return e.replace(/([^\.])+/g,function(t,e,o,s){var r=t.match(/([^\[0-9]+){1}(\[)([0-9+])/),a=function(){return i[r[1]]||(i[r[1]]=[],i[r[1]])};if(o+t.length>=s.length)r?a()[r[3]]=n:i[t]=n;else if(r){var l=a();i=l[r[3]]||(l[r[3]]={},l[r[3]])}else i=i[t]||(i[t]={},i[t]);return""}),t}},t.functionChain=function(t,e,n){for(var i=0;i-1&&t.splice(n,1),-1!==n},t.remove=h,t.addWithFunction=function(t,e,n){-1===c(t,n)&&t.push(e)},t.addToList=d,t.suggest=function(t,e,n){return-1===t.indexOf(e)&&(n?t.unshift(e):t.push(e),!0)},t.extend=function(t,e,i){var o;e=n(e)?e:[e];var s=function(e){for(var n=e.__proto__;null!=n;)if(null!=n.prototype){for(var i in n.prototype)n.prototype.hasOwnProperty(i)&&!t.prototype.hasOwnProperty(i)&&(t.prototype[i]=n.prototype[i]);n=n.prototype.__proto__}else n=null};for(o=0;o2)for(o=2;o>8&255]+p[t>>16&255]+p[t>>24&255]+"-"+p[255&e]+p[e>>8&255]+"-"+p[e>>16&15|64]+p[e>>24&255]+"-"+p[63&n|128]+p[n>>8&255]+"-"+p[n>>16&255]+p[n>>24&255]+p[255&i]+p[i>>8&255]+p[i>>16&255]+p[i>>24&255]}function m(){for(var e=[],n=0;ne.scrollTop+e.offsetHeight)i[a]._jsPlumbProxies||(i[a]._jsPlumbProxies=i[a]._jsPlumbProxies||[],t.select({source:i[a]}).each(function(n){t.proxyConnection(n,0,e,r,function(){return s("bottom",0,n.endpoints[0],n)},function(){return o("bottom",0,n.endpoints[0],n)}),i[a]._jsPlumbProxies.push([n,0])}),t.select({target:i[a]}).each(function(n){t.proxyConnection(n,1,e,r,function(){return s("bottom",1,n.endpoints[1],n)},function(){return o("bottom",1,n.endpoints[1],n)}),i[a]._jsPlumbProxies.push([n,1])}));else if(i[a]._jsPlumbProxies){for(var l=0;l0)for(var t=0;t0){var r=Array.prototype.slice.call(arguments,1);try{for(var a=0,l=o.length;a0?-1!==t.indexOf(e):!n)};this.getConnections=function(t,e){t?t.constructor===String&&(t={scope:t}):t={};for(var n=t.scope||i.getDefaultScope(),o=W(n,!0),s=W(t.source),r=W(t.target),a=!e&&o.length>1?{}:[],l=function(t,n){if(!e&&o.length>1){var i=a[t];null==i&&(i=a[t]=[]),i.push(n)}else a.push(n)},u=0,c=y.length;u0&&!g.isSource,v=d&&o.length>0&&!g.isTarget;if(m||v)continue t;r.push(g)}}}return Q(r)},this.getAllConnections=function(){return y},this.getDefaultScope=function(){return D},this.getEndpoint=M,this.getEndpoints=function(t){return b[h(t).id]||[]},this.getDefaultEndpointType=function(){return d.Endpoint},this.getDefaultConnectionType=function(){return d.Connection},this.getId=B,this.draw=O,this.info=h,this.appendElement=k;var tt=!1;this.isHoverSuspended=function(){return tt},this.setHoverSuspended=function(t){tt=t},this.hide=function(t,e){return G(t,"none",e),i},this.idstamp=I;var et=function(t){if(!f&&t){var e=i.getElement(t);e.offsetParent&&i.setContainer(e.offsetParent)}},nt=i.manage=function(t,e,n,o){return x[t]?o&&(x[t].info=it({elId:t,timestamp:w,recalc:!0})):(x[t]={el:e,endpoints:[],connections:[],rotation:0},x[t].info=it({elId:t,timestamp:w}),i.addClass(e,"jtk-managed"),n||i.fire("manageElement",{id:t,info:x[t].info,el:e})),x[t]};this.unmanage=function(t){if(x[t]){var e=x[t].el;i.removeClass(e,"jtk-managed"),delete x[t],i.fire("unmanageElement",{id:t,el:e})}},this.rotate=function(t,e,n){return x[t]&&(x[t].rotation=e,x[t].el.style.transform="rotate("+e+"deg)",x[t].el.style.transformOrigin="center center",!0!==n)?this.revalidate(t):{c:[],e:[]}},this.getRotation=function(t){return x[t]&&x[t].rotation||0};var it=function(t){var e,n=t.timestamp,o=t.recalc,s=t.offset,r=t.elId;return S&&!n&&(n=w),!o&&n&&n===_[r]?{o:t.offset||C[r],s:E[r]}:(o||!s&&null==C[r]?null!=(e=x[r]?x[r].el:null)&&(E[r]=i.getSize(e),C[r]=i.getOffset(e),_[r]=n):(C[r]=s||C[r],null==E[r]&&null!=(e=x[r].el)&&(E[r]=i.getSize(e)),_[r]=n),C[r]&&!C[r].right&&(C[r].right=C[r].left+E[r][0],C[r].bottom=C[r].top+E[r][1],C[r].width=E[r][0],C[r].height=E[r][1],C[r].centerx=C[r].left+C[r].width/2,C[r].centery=C[r].top+C[r].height/2),{o:C[r],s:E[r]})};this.updateOffset=it,this.init=function(){v||(i.Defaults.Container&&i.setContainer(i.Defaults.Container),i.router=new t.jsPlumb.DefaultRouter(i),i.anchorManager=i.router.anchorManager,v=!0,i.fire("ready",i))}.bind(this),this.log=m,this.jsPlumbUIComponent=l,this.makeAnchor=function(){var e,o=function(e,n){if(t.jsPlumb.Anchors[e])return new t.jsPlumb.Anchors[e](n);if(!i.Defaults.DoNotThrowErrors)throw{msg:"jsPlumb: unknown anchor type '"+e+"'"}};if(0===arguments.length)return null;var s=arguments[0],r=arguments[1],a=null;if(s.compute&&s.getOrientation)return s;if("string"==typeof s)a=o(arguments[0],{elementId:r,jsPlumbInstance:i});else if(n.isArray(s))if(n.isArray(s[0])||n.isString(s[0]))2===s.length&&n.isObject(s[1])?n.isString(s[0])?(e=t.jsPlumb.extend({elementId:r,jsPlumbInstance:i},s[1]),a=o(s[0],e)):(e=t.jsPlumb.extend({elementId:r,jsPlumbInstance:i,anchors:s[0]},s[1]),a=new t.jsPlumb.DynamicAnchor(e)):a=new d.DynamicAnchor({anchors:s,selector:null,elementId:r,jsPlumbInstance:i});else{var l={x:s[0],y:s[1],orientation:s.length>=4?[s[2],s[3]]:[0,0],offsets:s.length>=6?[s[4],s[5]]:[0,0],elementId:r,jsPlumbInstance:i,cssClass:7===s.length?s[6]:null};(a=new t.jsPlumb.Anchor(l)).clone=function(){return new t.jsPlumb.Anchor(l)}}return a.id||(a.id="anchor_"+I()),a},this.makeAnchors=function(e,o,s){for(var r=[],a=0,l=e.length;a0&&t>=e.def.maxConnections},element:e.el,elementId:e.id,isSource:r,isTarget:a,addClass:function(t){i.addClass(e.el,t)},removeClass:function(t){i.removeClass(e.el,t)},onDrop:function(t){t.endpoints[0].anchor.locked=!1},isDropAllowed:function(){return u.isDropAllowed.apply(u,arguments)},isRedrop:function(t){return null!=t.suspendedElement&&null!=t.suspendedEndpoint&&t.suspendedEndpoint.element===e.el},getEndpoint:function(n){var s=e.def.endpoint;if(null==s||null==s._jsPlumb){var r=i.deriveEndpointAndAnchorSpec(n.getType().join(" "),!0),a=r.endpoints?t.jsPlumb.extend(o,{endpoint:e.def.def.endpoint||r.endpoints[1]}):o;r.anchors&&(a=t.jsPlumb.extend(a,{anchor:e.def.def.anchor||r.anchors[1]})),(s=i.addEndpoint(e.el,a))._mtNew=!0}if(o.uniqueEndpoint&&(e.def.endpoint=s),s.setDeleteOnEmpty(!0),n.isDetachable()&&s.initDraggable(),null!=s.anchor.positionFinder){var l=i.getUIPosition(arguments,i.getZoom()),u=i.getOffset(e.el),c=i.getSize(e.el),h=null==l?[0,0]:s.anchor.positionFinder(l,u,c,s.anchor.constructorParams);s.anchor.x=h[0],s.anchor.y=h[1]}return s},maybeCleanup:function(t){t._mtNew&&0===t.connections.length?i.deleteObject({endpoint:t}):delete t._mtNew}}),h=t.jsPlumb.dragEvents.drop;return s.scope=s.scope||o.scope||i.Defaults.Scope,s[h]=n.wrap(s[h],c,!0),s.rank=o.rank||0,a&&(s[t.jsPlumb.dragEvents.over]=function(){return!0}),!1===o.allowLoopback&&(s.canDrop=function(t){return t.getDragElement()._jsPlumbRelatedElement!==e.el}),i.initDroppable(e.el,s,"internal"),c};this.makeTarget=function(e,n,o){var s=t.jsPlumb.extend({_jsPlumb:this},o);t.jsPlumb.extend(s,n);for(var r=s.maxConnections||-1,a=function(e){var n=h(e),o=n.id,a=t.jsPlumb.extend({},s.dropOptions||{}),l=s.connectionType||"default";this.targetEndpointDefinitions[o]=this.targetEndpointDefinitions[o]||{},et(o),n.el._isJsPlumbGroup&&null==a.rank&&(a.rank=-1);var u={def:t.jsPlumb.extend({},s),uniqueEndpoint:s.uniqueEndpoint,maxConnections:r,enabled:!0};s.createEndpoint&&(u.uniqueEndpoint=!0,u.endpoint=i.addEndpoint(e,u.def),u.endpoint.setDeleteOnEmpty(!1)),n.def=u,this.targetEndpointDefinitions[o][l]=u,ot(n,s,a,!0===s.isSource,!0),n.el._katavorioDrop[n.el._katavorioDrop.length-1].targetDef=u}.bind(this),l=e.length&&e.constructor!==String?e:[e],u=0,c=l.length;u=0&&p>=h.maxConnections)return d&&d({element:o.el,maxConnections:c},e),!1;var f=t.jsPlumb.getPositionOnElement(e,l,u),m={};t.jsPlumb.extend(m,h.def),m.isTemporarySource=!0,m.anchor=[f[0],f[1],0,0],m.dragOptions=g,h.def.scope&&(m.scope=h.def.scope),y=this.addEndpoint(s,m),b=!0,y.setDeleteOnEmpty(!0),h.uniqueEndpoint&&(h.endpoint?y.finalEndpoint=h.endpoint:(h.endpoint=y,y.setDeleteOnEmpty(!1)));var v=function(){i.off(y.canvas,"mouseup",v),i.off(o.el,"mouseup",v),b&&(b=!1,i.deleteEndpoint(y))};i.on(y.canvas,"mouseup",v),i.on(o.el,"mouseup",v);var P={};if(h.def.extract)for(var x in h.def.extract){var C=(e.srcElement||e.target).getAttribute(x);C&&(P[h.def.extract[x]]=C)}i.trigger(y.canvas,"mousedown",e,P),n.consume(e)}}}.bind(this);this.on(o.el,"mousedown",P),h.trigger=P,r.filter&&(n.isString(r.filter)||n.isFunction(r.filter))&&i.setDragFilter(o.el,r.filter);var x=t.jsPlumb.extend({},r.dropOptions||{});ot(o,r,x,!0,!0===r.isTarget)}.bind(this),f=e.length&&e.constructor!==String?e:[e],g=0,m=f.length;g0;)o(i.el.childNodes[0]);e||ut(i,n)}};return i.batch(function(){o(t,!0)},!1===e),i},this.reset=function(t){i.silently(function(){tt=!1,i.removeAllGroups(),i.removeGroupManager(),i.deleteEveryEndpoint(),t||i.unbind(),this.targetEndpointDefinitions={},this.sourceEndpointDefinitions={},y.length=0,this.doReset&&this.doReset()}.bind(this))},this.destroy=function(){this.reset(),f=null,g=null};var ct=function(t){t.canvas&&t.canvas.parentNode&&t.canvas.parentNode.removeChild(t.canvas),t.cleanup(),t.destroy()};this.clear=function(){i.select().each(ct),i.selectEndpoints().each(ct),b={},P={}},this.setDefaultScope=function(t){return D=t,i},this.deriveEndpointAndAnchorSpec=function(t,e){for(var n=((e?"":"default ")+t).split(/[\s]/),o=null,s=null,r=null,a=null,l=0;l0)for(var e=0;e0?"add":"remove")+"Class"](o.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](o.endpointFullClass)},this.detachFromConnection=function(t,e,n){(e=null==e?this.connections.indexOf(t):e)>=0&&(this.connections.splice(e,1),this[(this.connections.length>0?"add":"remove")+"Class"](o.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](o.endpointFullClass)),!n&&a&&0===this.connections.length&&o.deleteObject({endpoint:this,fireEvent:!1,deleteAttachedObjects:!0!==n})},this.deleteEveryConnection=function(t){for(var e=this.connections.length,n=0;n0){var c=function(t,e){var n=0;if(null!=e)for(var i=0;i0&&(u.connection=this.connections[0]);u.rotation=o.getRotation(this.elementId),r=this.anchor.compute(u)}for(var m in this.endpoint.compute(r,this.anchor.getOrientation(this),this._jsPlumb.paintStyleInUse,a||this.paintStyleInUse),this.endpoint.paint(this._jsPlumb.paintStyleInUse,this.anchor),this.timestamp=e,this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(m)){var v=this._jsPlumb.overlays[m];v.isVisible()&&(this._jsPlumb.overlayPlacements[m]=v.draw(this.endpoint,this._jsPlumb.paintStyleInUse),v.paint(this._jsPlumb.overlayPlacements[m]))}}}},this.getTypeDescriptor=function(){return"endpoint"},this.isVisible=function(){return this._jsPlumb.visible},this.repaint=this.paint;var c=!1;this.initDraggable=function(){if(!c&&t.isDragSupported(this.element)){var n,a={id:null,element:null},l=null,u=!1,h=null,d=function(t,e,n){var i=!1;return{drag:function(){if(i)return i=!1,!0;if(e.element){var o=n.getUIPosition(arguments,n.getZoom());null!=o&&n.setPosition(e.element,o),n.repaint(e.element,o),t.paint({anchorPoint:t.anchor.getCurrentLocation({element:t})})}},stopDrag:function(){i=!0}}}(this,a,o),p=i.dragOptions||{},f=t.dragEvents.start,g=t.dragEvents.stop,m=t.dragEvents.drag,v=t.dragEvents.beforeStart,y=function(e){l=this.connectorSelector();var c=!0;this.isEnabled()||(c=!1),null!=l||this.isSource||this.isTemporarySource||(c=!1),!this.isSource||!this.isFull()||null!=l&&this.dragAllowedWhenFull||(c=!1),null==l||l.isDetachable(this)||(this.isFull()?c=!1:l=null);var p=o.checkCondition(null==l?"beforeDrag":"beforeStartDetach",{endpoint:this,source:this.element,sourceId:this.elementId,connection:l});if(!1===p?c=!1:"object"==typeof p?t.extend(p,n||{}):p=n||{},!1===c)return o.stopDrag&&o.stopDrag(this.canvas),d.stopDrag(),!1;for(var f=0;f0&&!1!==this.connectionsDetachable}.bind(this),o.initDraggable(this.canvas,p,"internal"),this.canvas._jsPlumbRelatedElement=this.element,c=!0}};var h=i.endpoint||this._jsPlumb.instance.Defaults.Endpoint||t.Defaults.Endpoint;this.setEndpoint(h,!0);var d=i.anchor?i.anchor:i.anchors?i.anchors:o.Defaults.Anchor||"Top";this.setAnchor(d,!0);var p=["default",i.type||""].join(" ");this.addType(p,i.data,!0),this.canvas=this.endpoint.canvas,this.canvas._jsPlumb=this,this.initDraggable();var f=function(n,s,r,a){if(t.isDropSupported(this.element)){var l=i.dropOptions||o.Defaults.DropOptions||t.Defaults.DropOptions;(l=t.extend({},l)).scope=l.scope||this.scope;var u=t.dragEvents.drop,c=t.dragEvents.over,h=t.dragEvents.out,d=this,p=o.EndpointDropHandler({getEndpoint:function(){return d},jsPlumb:o,enabled:function(){return null==r||r.isEnabled()},isFull:function(){return r.isFull()},element:this.element,elementId:this.elementId,isSource:this.isSource,isTarget:this.isTarget,addClass:function(t){d.addClass(t)},removeClass:function(t){d.removeClass(t)},isDropAllowed:function(){return d.isDropAllowed.apply(d,arguments)},reference:a,isRedrop:function(t,e){return t.suspendedEndpoint&&e.reference&&t.suspendedEndpoint.id===e.reference.id}});l[u]=e.wrap(l[u],p,!0),l[c]=e.wrap(l[c],function(){var e=t.getDragObject(arguments),n=o.getAttribute(t.getElement(e),"dragId"),i=o.getFloatingConnectionFor(n);if(null!=i){var s=o.getFloatingAnchorIndex(i);if(this.isTarget&&0!==s||i.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id===i.suspendedEndpoint.id){var r=o.checkCondition("checkDropAllowed",{sourceEndpoint:i.endpoints[s],targetEndpoint:this,connection:i});this[(r?"add":"remove")+"Class"](o.endpointDropAllowedClass),this[(r?"remove":"add")+"Class"](o.endpointDropForbiddenClass),i.endpoints[s].anchor.over(this.anchor,this)}}}.bind(this)),l[h]=e.wrap(l[h],function(){var e=t.getDragObject(arguments),n=null==e?null:o.getAttribute(t.getElement(e),"dragId"),i=n?o.getFloatingConnectionFor(n):null;if(null!=i){var s=o.getFloatingAnchorIndex(i);(this.isTarget&&0!==s||i.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id===i.suspendedEndpoint.id)&&(this.removeClass(o.endpointDropAllowedClass),this.removeClass(o.endpointDropForbiddenClass),i.endpoints[s].anchor.out())}}.bind(this)),o.initDroppable(n,l,"internal",s)}}.bind(this);return this.anchor.isFloating||f(this.canvas,!(i._transient||this.anchor.isFloating),this,i.reference),this},e.extend(t.Endpoint,t.OverlayCapableJsPlumbUIComponent,{setVisible:function(t,e,n){if(this._jsPlumb.visible=t,this.canvas&&(this.canvas.style.display=t?"block":"none"),this[t?"showOverlays":"hideOverlays"](),!e)for(var i=0;i0)for(var h=function(t,e,n,i,o,s,r,a){for(var l=[],u=e[o?0:1]/(i.length+1),c=0;c-1&&(r[o.targetId][l][0]=o,r[o.targetId][l][1]=o.endpoints[0],r[o.targetId][l][2]=o.endpoints[0].anchor.constructor===e.DynamicAnchor),t.addToList(r,i,[o,o.endpoints[1],o.endpoints[1].anchor.constructor===e.DynamicAnchor]),o.endpoints[1].anchor.isContinuous&&(o.source===o.target?o._jsPlumb.instance.removeElement(o.endpoints[1].canvas):null==o.endpoints[1].canvas.parentNode&&o._jsPlumb.instance.appendElement(o.endpoints[1].canvas)),o.updateConnectedClass()}}else if(1===a){var u=o.endpoints[0].elementId;o.target=s,o.targetId=i;var c=t.findWithFunction(r[u],function(t){return t[0].id===o.id}),h=t.findWithFunction(r[n],function(t){return t[0].id===o.id});-1!==c&&(r[u][c][0]=o,r[u][c][1]=o.endpoints[1],r[u][c][2]=o.endpoints[1].anchor.constructor===e.DynamicAnchor),h>-1&&(r[n].splice(h,1),t.addToList(r,i,[o,o.endpoints[0],o.endpoints[0].anchor.constructor===e.DynamicAnchor])),o.updateConnectedClass()}},this.rehomeEndpoint=function(t,e,n){var o=i[e]||[],s=u.getId(n);if(s!==e){var r=o.indexOf(t);if(r>-1){var l=o.splice(r,1)[0];a.add(l,s)}}for(var c=0;ce.dist?1:0});for(var m=d[0].source,v=d[0].target,y=0;y0?this.anchors[0]:null,a=r,l=function(t,e,n,i,o,s,r){var a=i[0]+t.x*o[0],l=i[1]+t.y*o[1],u=i[0]+o[0]/2,c=i[1]+o[1]/2;if(null!=s&&0!==s){var h=jsPlumbUtil.rotatePoint([a,l],[u,c],s);a=h[0],l=h[1]}return Math.sqrt(Math.pow(e-a,2)+Math.pow(n-l,2))+Math.sqrt(Math.pow(u-a,2)+Math.pow(c-l,2))},u=t.selector||function(t,e,n,i,o,s,r){for(var a=n[0]+i[0]/2,u=n[1]+i[1]/2,c=-1,h=1/0,d=0;d0?t:n+t:t*n;return i.pointOnLine({x:r,y:l},{x:a,y:u},o)}return{x:a,y:u}}return{x:r,y:l}},this.gradientAtPoint=function(t){return o},this.pointAlongPathFrom=function(t,e,n){var o=this.pointOnPath(t,n),s=e<=0?{x:r,y:l}:{x:a,y:u};return e<=0&&Math.abs(e)>1&&(e*=-1),i.pointOnLine(o,s,e)};var c=function(t,e,n){return n>=Math.min(t,e)&&n<=Math.max(t,e)},h=function(t,e,n){return Math.abs(n-t)e?e<=t&&t<=n:e>=t&&t>=n};this.lineIntersection=function(t,e,n,s){var c=Math.abs(i.gradient({x:t,y:e},{x:n,y:s})),h=Math.abs(o),p=h===1/0?r:l-h*r,f=[],g=c===1/0?t:e-c*t;if(c!==h)if(c===1/0&&0===h)d(t,r,a)&&d(l,e,s)&&(f=[t,l]);else if(0===c&&h===1/0)d(e,l,u)&&d(r,t,n)&&(f=[r,e]);else{var m,v;c===1/0?d(m=t,r,a)&&d(v=h*t+p,e,s)&&(f=[m,v]):0===c?d(v=e,l,u)&&d(m=(e-p)/h,t,n)&&(f=[m,v]):(v=h*(m=(g-p)/(h-c))+p,d(m,r,a)&&d(v,l,u)&&(f=[m,v]))}return f},this.boxIntersection=function(t,e,n,i){var o=[];return o.push.apply(o,this.lineIntersection(t,e,t+n,e)),o.push.apply(o,this.lineIntersection(t+n,e,t+n,e+i)),o.push.apply(o,this.lineIntersection(t+n,e+i,t,e+i)),o.push.apply(o,this.lineIntersection(t,e+i,t,e)),o},this.boundingBoxIntersection=function(t){return this.boxIntersection(t.x,t.y,t.w,t.h)}},Arc:function(t){e.Segments.AbstractSegment.apply(this,arguments);var n=function(e,n){return i.theta([t.cx,t.cy],[e,n])},o=2*Math.PI;this.radius=t.r,this.anticlockwise=t.ac,this.type="Arc",t.startAngle&&t.endAngle?(this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.x1=t.cx+this.radius*Math.cos(t.startAngle),this.y1=t.cy+this.radius*Math.sin(t.startAngle),this.x2=t.cx+this.radius*Math.cos(t.endAngle),this.y2=t.cy+this.radius*Math.sin(t.endAngle)):(this.startAngle=n(t.x1,t.y1),this.endAngle=n(t.x2,t.y2),this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2),this.endAngle<0&&(this.endAngle+=o),this.startAngle<0&&(this.startAngle+=o);var s=this.endAngle0?0:1,n)),n};this.pointOnPath=function(e,n){return e=s(this.curve,e,n),t.jsBezier.pointOnCurve(this.curve,e)},this.gradientAtPoint=function(e,n){return e=s(this.curve,e,n),t.jsBezier.gradientAtPoint(this.curve,e)},this.pointAlongPathFrom=function(e,n,i){return e=s(this.curve,e,i),t.jsBezier.pointAlongCurveFrom(this.curve,e,n)},this.getLength=function(){return this.length},this.getBounds=function(){return this.bounds},this.findClosestPointOnPath=function(e,n){var i=t.jsBezier.nearestPointOnCurve({x:e,y:n},this.curve);return{d:Math.sqrt(Math.pow(i.point.x-e,2)+Math.pow(i.point.y-n,2)),x:i.point.x,y:i.point.y,l:1-i.location,s:this}},this.lineIntersection=function(e,n,i,o){return t.jsBezier.lineIntersection(e,n,i,o,this.curve)}}},e.SegmentRenderer={getPath:function(t,e){return{Straight:function(e){var n=t.getCoordinates();return(e?"M "+n.x1+" "+n.y1+" ":"")+"L "+n.x2+" "+n.y2},Bezier:function(e){var n=t.params;return(e?"M "+n.x2+" "+n.y2+" ":"")+"C "+n.cp2x+" "+n.cp2y+" "+n.cp1x+" "+n.cp1y+" "+n.x1+" "+n.y1},Arc:function(e){var n=t.params,i=t.sweep>Math.PI?1:0,o=t.anticlockwise?0:1;return(e?"M"+t.x1+" "+t.y1+" ":"")+"A "+t.radius+" "+n.r+" 0 "+i+","+o+" "+t.x2+" "+t.y2}}[t.type](e)}};var o=function(){this.resetBounds=function(){this.bounds={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}},this.resetBounds()};e.Connectors.AbstractConnector=function(t){o.apply(this,arguments);var s=[],r=0,a=[],l=[],u=t.stub||0,c=n.isArray(u)?u[0]:u,h=n.isArray(u)?u[1]:u,d=t.gap||0,p=n.isArray(d)?d[0]:d,f=n.isArray(d)?d[1]:d,g=null,m=null;this.getPathData=function(){for(var t="",n=0;n0?t/r:(r+t)/r),1===t)n=s.length-1,o=1;else if(0===t)o=0,n=0;else if(t>=.5){for(n=0,o=0,i=a.length-1;i>-1;i--)if(a[i][1]>=t&&a[i][0]<=t){n=i,o=(t-a[i][0])/l[i];break}}else for(n=a.length-1,o=1,i=0;i=t){n=i,o=(t-a[i][0])/l[i];break}return{segment:s[n],proportion:o,index:n}};this.setSegments=function(t){g=[],r=0;for(var e=0;eg?0:1,v=[1,0][m];a=[],(r=[])[m]=t.sourcePos[m]>t.targetPos[m]?-1:1,a[m]=t.sourcePos[m]>t.targetPos[m]?1:-1,r[v]=0,a[v]=0}var y=n?d+p*r[0]:p*r[0],b=o?g+p*r[1]:p*r[1],P=n?f*a[0]:d+f*a[0],x=o?f*a[1]:g+f*a[1],C=r[0]*a[0]+r[1]*a[1],_={sx:y,sy:b,tx:P,ty:x,lw:s,xSpan:Math.abs(P-y),ySpan:Math.abs(x-b),mx:(y+P)/2,my:(b+x)/2,so:r,to:a,x:l,y:u,w:d,h:g,segment:e,startStubX:y+r[0]*c,startStubY:b+r[1]*c,endStubX:P+a[0]*h,endStubY:x+a[1]*h,isXGreaterThanStubTimes2:Math.abs(y-P)>c+h,isYGreaterThanStubTimes2:Math.abs(b-x)>c+h,opposite:-1===C,perpendicular:0===C,orthogonal:1===C,sourceAxis:0===r[0]?"y":"x",points:[l,u,d,g,y,b,P,x],stubs:[c,h]};return _.anchorOrientation=_.opposite?"opposite":_.orthogonal?"orthogonal":"perpendicular",_};return this.getSegments=function(){return s},this.updateBounds=function(t){var e=t.getBounds();this.bounds.minX=Math.min(this.bounds.minX,e.minX),this.bounds.maxX=Math.max(this.bounds.maxX,e.maxX),this.bounds.minY=Math.min(this.bounds.minY,e.minY),this.bounds.maxY=Math.max(this.bounds.maxY,e.maxY)},this.pointOnPath=function(t,e){var n=v(t,e);return n.segment&&n.segment.pointOnPath(n.proportion,!1)||[0,0]},this.gradientAtPoint=function(t,e){var n=v(t,e);return n.segment&&n.segment.gradientAtPoint(n.proportion,!1)||0},this.pointAlongPathFrom=function(t,e,n){var i=v(t,n);return i.segment&&i.segment.pointAlongPathFrom(i.proportion,e,!1)||[0,0]},this.compute=function(t){m=y.call(this,t),r=s.length=a.length=l.length=0,this._compute(m,t),this.x=m.points[0],this.y=m.points[1],this.w=m.points[2],this.h=m.points[3],this.segment=m.segment,function(){for(var t=0,e=0;e1||this.loc<0){var c=parseInt(this.loc,10),h=this.loc<0?1:0;o=t.pointAlongPathFrom(h,c,!1),r=t.pointAlongPathFrom(h,c-this.direction*this.length/2,!1),l=i.pointOnLine(o,r,this.length)}else if(1===this.loc){if(o=t.pointOnPath(this.loc),r=t.pointAlongPathFrom(this.loc,-this.length),l=i.pointOnLine(o,r,this.length),-1===this.direction){var d=l;l=o,o=d}}else if(0===this.loc){if(l=t.pointOnPath(this.loc),r=t.pointAlongPathFrom(this.loc,this.length),o=i.pointOnLine(l,r,this.length),-1===this.direction){var p=l;l=o,o=p}}else o=t.pointAlongPathFrom(this.loc,this.direction*this.length/2),r=t.pointOnPath(this.loc),l=i.pointOnLine(o,r,this.length);var f={hxy:o,tail:u=i.perpendicularLineTo(o,l,this.width),cxy:i.pointOnLine(o,l,a*this.length)},g=s.stroke||e.stroke,m=s.fill||e.stroke;return{component:t,d:f,"stroke-width":s.strokeWidth||e.strokeWidth,stroke:g,fill:m,minX:Math.min(o.x,u[0].x,u[1].x),maxX:Math.max(o.x,u[0].x,u[1].x),minY:Math.min(o.y,u[0].y,u[1].y),maxY:Math.max(o.y,u[0].y,u[1].y)}}return{component:t,minX:0,maxX:0,minY:0,maxY:0}}},n.extend(e.Overlays.Arrow,r,{updateFrom:function(t){this.length=t.length||this.length,this.width=t.width||this.width,this.direction=null!=t.direction?t.direction:this.direction,this.foldback=t.foldback||this.foldback},cleanup:function(){this.path&&this.path.parentNode&&this.path.parentNode.removeChild(this.path)}}),e.Overlays.PlainArrow=function(t){t=t||{};var n=e.extend(t,{foldback:1});e.Overlays.Arrow.call(this,n),this.type="PlainArrow"},n.extend(e.Overlays.PlainArrow,e.Overlays.Arrow),e.Overlays.Diamond=function(t){var n=(t=t||{}).length||40,i=e.extend(t,{length:n/2,foldback:2});e.Overlays.Arrow.call(this,i),this.type="Diamond"},n.extend(e.Overlays.Diamond,e.Overlays.Arrow);var a=function(t,e){return(null==t._jsPlumb.cachedDimensions||e)&&(t._jsPlumb.cachedDimensions=t.getDimensions()),t._jsPlumb.cachedDimensions},l=function(t){e.jsPlumbUIComponent.apply(this,arguments),r.apply(this,arguments);var i=this.fire;this.fire=function(){i.apply(this,arguments),this.component&&this.component.fire.apply(this.component,arguments)},this.detached=!1,this.id=t.id,this._jsPlumb.div=null,this._jsPlumb.initialised=!1,this._jsPlumb.component=t.component,this._jsPlumb.cachedDimensions=null,this._jsPlumb.create=t.create,this._jsPlumb.initiallyInvisible=!1===t.visible,this.getElement=function(){if(null==this._jsPlumb.div){var n=this._jsPlumb.div=e.getElement(this._jsPlumb.create(this._jsPlumb.component));n.style.position="absolute",jsPlumb.addClass(n,this._jsPlumb.instance.overlayClass+" "+(this.cssClass?this.cssClass:t.cssClass?t.cssClass:"")),this._jsPlumb.instance.appendElement(n),this._jsPlumb.instance.getId(n),this.canvas=n;var i="translate(-50%, -50%)";n.style.webkitTransform=i,n.style.mozTransform=i,n.style.msTransform=i,n.style.oTransform=i,n.style.transform=i,n._jsPlumb=this,!1===t.visible&&(n.style.display="none")}return this._jsPlumb.div},this.draw=function(t,e,i){var o=a(this);if(null!=o&&2===o.length){var s={x:0,y:0};if(i)s={x:i[0],y:i[1]};else if(t.pointOnPath){var r=this.loc,l=!1;(n.isString(this.loc)||this.loc<0||this.loc>1)&&(r=parseInt(this.loc,10),l=!0),s=t.pointOnPath(r,l)}else{var u=this.loc.constructor===Array?this.loc:this.endpointLoc;s={x:u[0]*t.w,y:u[1]*t.h}}var c=s.x-o[0]/2,h=s.y-o[1]/2;return{component:t,d:{minx:c,miny:h,td:o,cxy:s},minX:c,maxX:c+o[0],minY:h,maxY:h+o[1]}}return{minX:0,maxX:0,minY:0,maxY:0}}};n.extend(l,[e.jsPlumbUIComponent,r],{getDimensions:function(){return[1,1]},setVisible:function(t){this._jsPlumb.div&&(this._jsPlumb.div.style.display=t?"block":"none",t&&this._jsPlumb.initiallyInvisible&&(a(this,!0),this.component.repaint(),this._jsPlumb.initiallyInvisible=!1))},clearCachedDimensions:function(){this._jsPlumb.cachedDimensions=null},cleanup:function(t){t?null!=this._jsPlumb.div&&(this._jsPlumb.div._jsPlumb=null,this._jsPlumb.instance.removeElement(this._jsPlumb.div)):(this._jsPlumb&&this._jsPlumb.div&&this._jsPlumb.div.parentNode&&this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div),this.detached=!0)},reattach:function(t,e){null!=this._jsPlumb.div&&t.getContainer().appendChild(this._jsPlumb.div),this.detached=!1},computeMaxSize:function(){var t=a(this);return Math.max(t[0],t[1])},paint:function(t,e){this._jsPlumb.initialised||(this.getElement(),t.component.appendDisplayElement(this._jsPlumb.div),this._jsPlumb.initialised=!0,this.detached&&this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div)),this._jsPlumb.div.style.left=t.component.x+t.d.minx+"px",this._jsPlumb.div.style.top=t.component.y+t.d.miny+"px"}}),e.Overlays.Custom=function(t){this.type="Custom",l.apply(this,arguments)},n.extend(e.Overlays.Custom,l),e.Overlays.GuideLines=function(){var t=this;t.length=50,t.strokeWidth=5,this.type="GuideLines",r.apply(this,arguments),e.jsPlumbUIComponent.apply(this,arguments),this.draw=function(e,n){var o=e.pointAlongPathFrom(t.loc,t.length/2),s=e.pointOnPath(t.loc),r=i.pointOnLine(o,s,t.length),a=i.perpendicularLineTo(o,r,40),l=i.perpendicularLineTo(r,o,20);return{connector:e,head:o,tail:r,headLine:l,tailLine:a,minX:Math.min(o.x,r.x,l[0].x,l[1].x),minY:Math.min(o.y,r.y,l[0].y,l[1].y),maxX:Math.max(o.x,r.x,l[0].x,l[1].x),maxY:Math.max(o.y,r.y,l[0].y,l[1].y)}}},e.Overlays.Label=function(t){this.labelStyle=t.labelStyle,this.cssClass=null!=this.labelStyle?this.labelStyle.cssClass:null;var n=e.extend({create:function(){return e.createElement("div")}},t);if(e.Overlays.Custom.call(this,n),this.type="Label",this.label=t.label||"",this.labelText=null,this.labelStyle){var i=this.getElement();if(this.labelStyle.font=this.labelStyle.font||"12px sans-serif",i.style.font=this.labelStyle.font,i.style.color=this.labelStyle.color||"black",this.labelStyle.fill&&(i.style.background=this.labelStyle.fill),this.labelStyle.borderWidth>0){var o=this.labelStyle.borderStyle?this.labelStyle.borderStyle:"black";i.style.border=this.labelStyle.borderWidth+"px solid "+o}this.labelStyle.padding&&(i.style.padding=this.labelStyle.padding)}},n.extend(e.Overlays.Label,e.Overlays.Custom,{cleanup:function(t){t&&(this.div=null,this.label=null,this.labelText=null,this.cssClass=null,this.labelStyle=null)},getLabel:function(){return this.label},setLabel:function(t){this.label=t,this.labelText=null,this.clearCachedDimensions(),this.update(),this.component.repaint()},getDimensions:function(){return this.update(),l.prototype.getDimensions.apply(this,arguments)},update:function(){if("function"==typeof this.label){var t=this.label(this);this.getElement().innerHTML=t.replace(/\r\n/g,"
")}else null==this.labelText&&(this.labelText=this.label,this.getElement().innerHTML=this.labelText.replace(/\r\n/g,"
"))},updateFrom:function(t){null!=t.label&&this.setLabel(t.label)}})}.call("undefined"!=typeof window?window:s),function(){var t=this,e=t.jsPlumbUtil,n=t.jsPlumbInstance,i="stop",o="revert",s="_jsPlumbGroup",r="show",a="hide",l=function(t){var n={},i={},o={},l=this;function u(e,n){for(var i=t.getContainer();;){if(null==e||e===i)return!1;if(e===n)return!0;e=e.parentNode}}function c(e,n){for(var i=e.getEl().querySelectorAll(".jtk-managed"),o=0;o0?t[0]:l},c=!0===r.ghost,h=c||!0===r.constrain,d=!1!==r.revert,p=!0===r.orphan,f=!0===r.prune,g=!0===r.dropOverride,m=!1!==r.proxied,v=[];if(this.connections={source:[],target:[],internal:[]},this.getAnchor=function(t,e){return r.anchor||"Continuous"},this.getEndpoint=function(t,e){return r.endpoint||["Dot",{radius:10}]},this.collapsed=!1,!1!==r.draggable){var y={drag:function(){for(var t=0;t0&&r0&&ln.endStubX&&n.tx>n.startStubX||n.sx>n.endStubX&&n.tx>n.sx)||-1===n.so[i]&&(n.startStubXn.endStubY&&n.ty>n.startStubY||n.sy>n.endStubY&&n.ty>n.sy)||-1===n.so[i]&&(n.startStubYl[e][0],f=i[e][h][0],g=i[e][h][1],m={x:[[[1,2,3,4],null,[2,1,4,3]],null,[[4,3,2,1],null,[3,4,1,2]]],y:[[[3,2,1,4],null,[2,3,4,1]],null,[[4,1,2,3],null,[1,4,3,2]]]}[e][h][d];return n.segment===m[3]||n.segment===m[2]&&p?o[e]:n.segment===m[2]&&g=f||n.segment===m[1]&&!p?a[e]:n.segment===m[0]||n.segment===m[1]&&p?r[e]:void 0},orthogonal:function(e,n,i,o,s){var r=t,a={x:-1===r.so[0]?Math.min(n,o):Math.max(n,o),y:-1===r.so[1]?Math.min(n,o):Math.max(n,o)}[e];return{x:[[a,i],[a,s],[o,s]],y:[[i,a],[s,a],[s,o]]}[e]},opposite:function(n,o,s,r){var a=t,l={x:"y",y:"x"}[n],u={x:"height",y:"width"}[n],c=a["is"+n.toUpperCase()+"GreaterThanStubTimes2"];if(e.sourceEndpoint.elementId===e.targetEndpoint.elementId){var h=s+(1-e.sourceEndpoint.anchor[l])*e.sourceInfo[u]+i.maxStub;return{x:[[o,h],[r,h]],y:[[h,o],[h,r]]}[n]}return!c||1===a.so[g]&&o>r||-1===a.so[g]&&or?{x:[[x,a.sy],[x,a.ty]],y:[[a.sx,C],[a.tx,C]]}[n]:void 0}}[t.anchorOrientation](t.sourceAxis,v,y,b,P);if(j)for(var E=0;E0&&a[4]!==o[4]){var h=Math.min(d(a),d(o)),f=Math.min(l,h/2);a[2]-=s[0]*f,a[3]-=s[1]*f,o[0]+=r[0]*f,o[1]+=r[1]*f;var g=s[1]===r[0]&&1===r[0]||s[1]===r[0]&&0===r[0]&&s[0]!==r[1]||s[1]===r[0]&&-1===r[0],m=(o[1]>a[3]?1:-1)==(o[0]>a[2]?1:-1),v=m&&g||!m&&!g?o[0]:a[2],y=m&&g||!m&&!g?a[3]:o[1];i.addSegment(t,"Straight",{x1:a[0],y1:a[1],x2:a[2],y2:a[3]}),i.addSegment(t,"Arc",{r:f,x1:a[2],y1:a[3],x2:o[0],y2:o[1],cx:v,cy:y,ac:g})}else{var b=a[2]===a[0]?0:a[2]>a[0]?n.lw/2:-n.lw/2,P=a[3]===a[1]?0:a[3]>a[1]?n.lw/2:-n.lw/2;i.addSegment(t,"Straight",{x1:a[0]-b,y1:a[1]-P,x2:a[2]+b,y2:a[3]+P})}a=o}null!=o&&i.addSegment(t,"Straight",{x1:o[0],y1:o[1],x2:o[2],y2:o[3]})}(this,n,t)}},e.extend(t.Connectors.Flowchart,t.Connectors.AbstractConnector)}.call("undefined"!=typeof window?window:s),function(){var t=this.jsPlumb,e=this.jsPlumbUtil;t.Connectors.AbstractBezierConnector=function(e){var n,i=!1!==(e=e||{}).showLoopback,o=(e.curviness,e.margin||5),s=(e.proximityLimit,e.orientation&&"clockwise"===e.orientation),r=e.loopbackRadius||25;return this._compute=function(t,e){var a=e.sourcePos,l=e.targetPos,u=Math.abs(a[0]-l[0]),c=Math.abs(a[1]-l[1]);if(i&&e.sourceEndpoint.elementId===e.targetEndpoint.elementId){var h=e.sourcePos[0],d=e.sourcePos[1]-o,p=h,f=d-r,g=p-r,m=f-r;u=2*r,c=2*r,t.points[0]=g,t.points[1]=m,t.points[2]=u,t.points[3]=c,n.addSegment(this,"Arc",{loopback:!0,x1:h-g+4,y1:d-m,startAngle:0,endAngle:2*Math.PI,r:r,ac:!s,x2:h-g-4,y2:d-m,cx:p-g,cy:f-m})}else this._computeBezier(t,e,a,l,u,c)},n=t.Connectors.AbstractConnector.apply(this,arguments)},e.extend(t.Connectors.AbstractBezierConnector,t.Connectors.AbstractConnector);var n=function(e){e=e||{},this.type="Bezier";var n=t.Connectors.AbstractBezierConnector.apply(this,arguments),i=e.curviness||150;this.getCurviness=function(){return i},this._findControlPoint=function(t,e,n,o,s,r,a){var l=[];return r[0]!==a[0]||r[1]===a[1]?(0===a[0]?l.push(n[0]=P?3:4),S=Math.sqrt(Math.pow(p-h,2)+Math.pow(f-d,2));g=(n=function(t,e,n,i,o,s,r,a,l){return a<=l?[t,e]:1===n?i[3]<=0&&o[3]>=1?[t+(i[2]<.5?-1*s:s),e]:i[2]>=1&&o[2]<=0?[t,e+(i[3]<.5?-1*r:r)]:[t+-1*s,e+-1*r]:2===n?i[3]>=1&&o[3]<=0?[t+(i[2]<.5?-1*s:s),e]:i[2]>=1&&o[2]<=0?[t,e+(i[3]<.5?-1*r:r)]:[t+s,e+-1*r]:3===n?i[3]>=1&&o[3]<=0?[t+(i[2]<.5?-1*s:s),e]:i[2]<=0&&o[2]>=1?[t,e+(i[3]<.5?-1*r:r)]:[t+-1*s,e+-1*r]:4===n?i[3]<=0&&o[3]>=1?[t+(i[2]<.5?-1*s:s),e]:i[2]<=0&&o[2]>=1?[t,e+(i[3]<.5?-1*r:r)]:[t+s,e+-1*r]:void 0}(_,j,E,e.sourcePos,e.targetPos,o,o,S,r))[0],m=n[0],v=n[1],y=n[1],i.addSegment(this,"Bezier",{x1:p,y1:f,x2:h,y2:d,cp1x:g,cp1y:v,cp2x:m,cp2y:y})}};t.Connectors.StateMachine=n,e.extend(n,t.Connectors.AbstractBezierConnector)}.call("undefined"!=typeof window?window:s),function(){var t=this.jsPlumb,e=this.jsPlumbUtil,n=function(e){this.type="Straight";var n=t.Connectors.AbstractConnector.apply(this,arguments);this._compute=function(t,e){n.addSegment(this,"Straight",{x1:t.sx,y1:t.sy,x2:t.startStubX,y2:t.startStubY}),n.addSegment(this,"Straight",{x1:t.startStubX,y1:t.startStubY,x2:t.endStubX,y2:t.endStubY}),n.addSegment(this,"Straight",{x1:t.endStubX,y1:t.endStubY,x2:t.tx,y2:t.ty})}};t.Connectors.Straight=n,e.extend(n,t.Connectors.AbstractConnector)}.call("undefined"!=typeof window?window:s),function(){var t=this.jsPlumb,e=this.jsPlumbUtil,n={"stroke-linejoin":"stroke-linejoin","stroke-dashoffset":"stroke-dashoffset","stroke-linecap":"stroke-linecap"},i="http://www.w3.org/2000/svg",o=function(t,e){for(var n in e)t.setAttribute(n,""+e[n])},s=function(e,n){return(n=n||{}).version="1.1",n.xmlns=i,t.createElementNS(i,e,null,null,n)},r=function(t){return"position:absolute;left:"+t[0]+"px;top:"+t[1]+"px"},a=function(t){for(var e=t.querySelectorAll(" defs,linearGradient,radialGradient"),n=0;nn?t.insertBefore(e,t.childNodes[n]):t.appendChild(e)};e.svg={node:s,attr:o,pos:r};var c=function(n){var i=n.pointerEventsSpec||"all",a={};t.jsPlumbUIComponent.apply(this,n.originalArgs),this.canvas=null,this.path=null,this.svg=null,this.bgCanvas=null;var l=n.cssClass+" "+(n.originalArgs[0].cssClass||""),u={style:"",width:0,height:0,"pointer-events":i,position:"absolute"};this.svg=s("svg",u),n.useDivWrapper?(this.canvas=t.createElement("div",{position:"absolute"}),e.sizeElement(this.canvas,0,0,1,1),this.canvas.className=l):(o(this.svg,{class:l}),this.canvas=this.svg),n._jsPlumb.appendElement(this.canvas,n.originalArgs[0].parent),n.useDivWrapper&&this.canvas.appendChild(this.svg);var c=[this.canvas];return this.getDisplayElements=function(){return c},this.appendDisplayElement=function(t){c.push(t)},this.paint=function(t,i,s){if(null!=t){var l,u=[this.x,this.y],c=[this.w,this.h];null!=s&&(s.xmin<0&&(u[0]+=s.xmin),s.ymin<0&&(u[1]+=s.ymin),c[0]=s.xmax+(s.xmin<0?-s.xmin:0),c[1]=s.ymax+(s.ymin<0?-s.ymin:0)),n.useDivWrapper?(e.sizeElement(this.canvas,u[0],u[1],c[0]>0?c[0]:1,c[1]>0?c[1]:1),u[0]=0,u[1]=0,l=r([0,0])):l=r([u[0],u[1]]),a.paint.apply(this,arguments),o(this.svg,{style:l,width:c[0]||1,height:c[1]||1})}},{renderer:a}};e.extend(c,t.jsPlumbUIComponent,{cleanup:function(t){t||null==this.typeId?(this.canvas&&(this.canvas._jsPlumb=null),this.svg&&(this.svg._jsPlumb=null),this.bgCanvas&&(this.bgCanvas._jsPlumb=null),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.bgCanvas&&this.bgCanvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.svg=null,this.canvas=null,this.path=null,this.group=null,this._jsPlumb=null):(this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.bgCanvas&&this.bgCanvas.parentNode&&this.bgCanvas.parentNode.removeChild(this.bgCanvas))},reattach:function(t){var e=t.getContainer();this.canvas&&null==this.canvas.parentNode&&e.appendChild(this.canvas),this.bgCanvas&&null==this.bgCanvas.parentNode&&e.appendChild(this.bgCanvas)},setVisible:function(t){this.canvas&&(this.canvas.style.display=t?"block":"none")}}),t.ConnectorRenderers.svg=function(e){var n=this;c.apply(this,[{cssClass:e._jsPlumb.connectorClass,originalArgs:arguments,pointerEventsSpec:"none",_jsPlumb:e._jsPlumb}]).renderer.paint=function(i,r,a){var c=n.getSegments(),h=[0,0];if(a.xmin<0&&(h[0]=-a.xmin),a.ymin<0&&(h[1]=-a.ymin),c.length>0){var d={d:n.getPathData(),transform:"translate("+h[0]+","+h[1]+")","pointer-events":e["pointer-events"]||"visibleStroke"},p=null;n.x,n.y,n.w,n.h;if(i.outlineStroke){var f=i.outlineWidth||1,g=i.strokeWidth+2*f;delete(p=t.extend({},i)).gradient,p.stroke=i.outlineStroke,p.strokeWidth=g,null==n.bgPath?(n.bgPath=s("path",d),t.addClass(n.bgPath,t.connectorOutlineClass),u(n.svg,n.bgPath,0)):o(n.bgPath,d),l(n.svg,n.bgPath,p,0,n)}null==n.path?(n.path=s("path",d),u(n.svg,n.path,i.outlineStroke?1:0)):o(n.path,d),l(n.svg,n.path,i,0,n)}}},e.extend(t.ConnectorRenderers.svg,c);var h=t.SvgEndpoint=function(e){c.apply(this,[{cssClass:e._jsPlumb.endpointClass,originalArgs:arguments,pointerEventsSpec:"all",useDivWrapper:!0,_jsPlumb:e._jsPlumb}]).renderer.paint=function(e){var n=t.extend({},e);n.outlineStroke&&(n.stroke=n.outlineStroke),null==this.node?(this.node=this.makeNode(n),this.svg.appendChild(this.node)):null!=this.updateNode&&this.updateNode(this.node),l(this.svg,this.node,n,(this.x,this.y,this.w,this.h),this),r(this.node,(this.x,this.y))}.bind(this)};e.extend(h,c),t.Endpoints.svg.Dot=function(){t.Endpoints.Dot.apply(this,arguments),h.apply(this,arguments),this.makeNode=function(t){return s("circle",{cx:this.w/2,cy:this.h/2,r:this.radius})},this.updateNode=function(t){o(t,{cx:this.w/2,cy:this.h/2,r:this.radius})}},e.extend(t.Endpoints.svg.Dot,[t.Endpoints.Dot,h]),t.Endpoints.svg.Rectangle=function(){t.Endpoints.Rectangle.apply(this,arguments),h.apply(this,arguments),this.makeNode=function(t){return s("rect",{width:this.w,height:this.h})},this.updateNode=function(t){o(t,{width:this.w,height:this.h})}},e.extend(t.Endpoints.svg.Rectangle,[t.Endpoints.Rectangle,h]),t.Endpoints.svg.Image=t.Endpoints.Image,t.Endpoints.svg.Blank=t.Endpoints.Blank,t.Overlays.svg.Label=t.Overlays.Label,t.Overlays.svg.Custom=t.Overlays.Custom;var d=function(e,n){e.apply(this,n),t.jsPlumbUIComponent.apply(this,n),this.isAppendedAtTopLevel=!1,this.path=null,this.paint=function(t,e){if(t.component.svg&&e){null==this.path&&(this.path=s("path",{"pointer-events":"all"}),t.component.svg.appendChild(this.path),this.elementCreated&&this.elementCreated(this.path,t.component),this.canvas=t.component.svg);var r=n&&1===n.length&&n[0].cssClass||"",a=[0,0];e.xmin<0&&(a[0]=-e.xmin),e.ymin<0&&(a[1]=-e.ymin),o(this.path,{d:i(t.d),class:r,stroke:t.stroke?t.stroke:null,fill:t.fill?t.fill:null,transform:"translate("+a[0]+","+a[1]+")"})}};var i=function(t){return isNaN(t.cxy.x)||isNaN(t.cxy.y)?"":"M"+t.hxy.x+","+t.hxy.y+" L"+t.tail[0].x+","+t.tail[0].y+" L"+t.cxy.x+","+t.cxy.y+" L"+t.tail[1].x+","+t.tail[1].y+" L"+t.hxy.x+","+t.hxy.y};this.transfer=function(t){t.canvas&&this.path&&this.path.parentNode&&(this.path.parentNode.removeChild(this.path),t.canvas.appendChild(this.path))}},p={cleanup:function(t){null!=this.path&&(t?this._jsPlumb.instance.removeElement(this.path):this.path.parentNode&&this.path.parentNode.removeChild(this.path))},reattach:function(t,e){this.path&&e.canvas&&e.canvas.appendChild(this.path)},setVisible:function(t){null!=this.path&&(this.path.style.display=t?"block":"none")}};e.extend(d,[t.jsPlumbUIComponent,t.Overlays.AbstractOverlay]),t.Overlays.svg.Arrow=function(){d.apply(this,[t.Overlays.Arrow,arguments])},e.extend(t.Overlays.svg.Arrow,[t.Overlays.Arrow,d],p),t.Overlays.svg.PlainArrow=function(){d.apply(this,[t.Overlays.PlainArrow,arguments])},e.extend(t.Overlays.svg.PlainArrow,[t.Overlays.PlainArrow,d],p),t.Overlays.svg.Diamond=function(){d.apply(this,[t.Overlays.Diamond,arguments])},e.extend(t.Overlays.svg.Diamond,[t.Overlays.Diamond,d],p),t.Overlays.svg.GuideLines=function(){var e,n,i=null,r=this;t.Overlays.GuideLines.apply(this,arguments),this.paint=function(t,l){null==i&&(i=s("path"),t.connector.svg.appendChild(i),r.attachListeners(i,t.connector),r.attachListeners(i,r),e=s("path"),t.connector.svg.appendChild(e),r.attachListeners(e,t.connector),r.attachListeners(e,r),n=s("path"),t.connector.svg.appendChild(n),r.attachListeners(n,t.connector),r.attachListeners(n,r));var u=[0,0];l.xmin<0&&(u[0]=-l.xmin),l.ymin<0&&(u[1]=-l.ymin),o(i,{d:a(t.head,t.tail),stroke:"red",fill:null,transform:"translate("+u[0]+","+u[1]+")"}),o(e,{d:a(t.tailLine[0],t.tailLine[1]),stroke:"blue",fill:null,transform:"translate("+u[0]+","+u[1]+")"}),o(n,{d:a(t.headLine[0],t.headLine[1]),stroke:"green",fill:null,transform:"translate("+u[0]+","+u[1]+")"})};var a=function(t,e){return"M "+t.x+","+t.y+" L"+e.x+","+e.y}},e.extend(t.Overlays.svg.GuideLines,t.Overlays.GuideLines)}.call("undefined"!=typeof window?window:s),function(){var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=t.Katavorio,o=t.Biltong,s=function(t,n){var s="_katavorio_"+(n=n||"main"),r=t[s],a=t.getEventManager();return r||((r=new i({bind:a.on,unbind:a.off,getSize:e.getSize,getConstrainingRectangle:function(t){return[t.parentNode.scrollWidth,t.parentNode.scrollHeight]},getPosition:function(e,n){var i=t.getOffset(e,n,e._katavorioDrag?e.offsetParent:null);return[i.left,i.top]},setPosition:function(t,e){t.style.left=e[0]+"px",t.style.top=e[1]+"px"},addClass:e.addClass,removeClass:e.removeClass,intersects:o.intersects,indexOf:function(t,e){return t.indexOf(e)},scope:t.getDefaultScope(),css:{noSelect:t.dragSelectClass,droppable:"jtk-droppable",draggable:"jtk-draggable",drag:"jtk-drag",selected:"jtk-drag-selected",active:"jtk-drag-active",hover:"jtk-drag-hover",ghostProxy:"jtk-ghost-proxy"}})).setZoom(t.getZoom()),t[s]=r,t.bind("zoom",r.setZoom)),r},r=function(t,e){if(null==e)return[0,0];var n=h(e),i=c(n,0);return[i[t+"X"],i[t+"Y"]]},a=r.bind(this,"page"),l=r.bind(this,"screen"),u=r.bind(this,"client"),c=function(t,e){return t.item?t.item(e):t[e]},h=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},d=function(t){var e={},n=[],i={},o={},s={};this.register=function(r){var a,l=t.getId(r);e[l]||(e[l]=r,n.push(r),i[l]={});var u=function(e){if(e)for(var n=0;n0){a||(a=t.getOffset(r));var d=t.getOffset(c);i[l][h]={id:h,offset:{left:d.left-a.left,top:d.top-a.top}},s[h]=l}u(e.childNodes[n])}};u(r)},this.updateOffsets=function(e,n){if(null!=e){n=n||{};var o,r=jsPlumb.getElement(e),a=t.getId(r),l=i[a];if(l)for(var u in l)if(l.hasOwnProperty(u)){var c=jsPlumb.getElement(u),h=n[u]||t.getOffset(c);if(null==c.offsetParent&&null!=i[a][u])continue;o||(o=t.getOffset(r)),i[a][u]={id:u,offset:{left:h.left-o.left,top:h.top-o.top}},s[u]=a}}},this.endpointAdded=function(n,r){r=r||t.getId(n);var a=document.body,l=n.parentNode;for(o[r]=o[r]?o[r]+1:1;null!=l&&l!==a;){var u=t.getId(l,null,!0);if(u&&e[u]){var c=t.getOffset(l);if(null==i[u][r]){var h=t.getOffset(n);i[u][r]={id:r,offset:{left:h.left-c.left,top:h.top-c.top}},s[r]=u}break}l=l.parentNode}},this.endpointDeleted=function(t){if(o[t.elementId]&&(o[t.elementId]--,o[t.elementId]<=0))for(var e in i)i.hasOwnProperty(e)&&i[e]&&(delete i[e][t.elementId],delete s[t.elementId])},this.changeId=function(t,e){i[e]=i[t],i[t]={},s[e]=s[t],s[t]=null},this.getElementsForDraggable=function(t){return i[t]},this.elementRemoved=function(t){var e=s[t];e&&(i[e]&&delete i[e][t],delete s[t])},this.reset=function(){e={},n=[],i={},o={}},this.dragEnded=function(e){if(null!=e.offsetParent){var n=t.getId(e),i=s[n];i&&this.updateOffsets(i)}},this.setParent=function(e,n,o,r,a){var l=s[n];i[r]||(i[r]={});var u=t.getOffset(o),c=a||t.getOffset(e);l&&i[l]&&delete i[l][n],i[r][n]={id:n,offset:{left:c.left-u.left,top:c.top-u.top}},s[n]=r},this.clearParent=function(t,e){var n=s[e];n&&(delete i[n][e],delete s[e])},this.revalidateParent=function(e,n,i){var o=s[n];if(o){var r={};r[n]=i,this.updateOffsets(o,r),t.revalidate(o)}},this.getDragAncestor=function(e){var n=jsPlumb.getElement(e),i=t.getId(n),o=s[i];return o?jsPlumb.getElement(o):null}},p=function(t,e,i){e=n.fastTrim(e),void 0!==t.className.baseVal?t.className.baseVal=e:t.className=e;try{var o=t.classList;if(null!=o){for(;o.length>0;)o.remove(o.item(0));for(var s=0;s0||t.scrollLeft>0)&&(i.left-=t.scrollLeft,i.top-=t.scrollTop)}.bind(this);null!=o;)i.left+=o.offsetLeft,i.top+=o.offsetTop,s(o),o=e?o.offsetParent:o.offsetParent===n?null:o.offsetParent;if(null!=n&&!e&&(n.scrollTop>0||n.scrollLeft>0)){var r=null!=t.offsetParent?this.getStyle(t.offsetParent,"position"):"static",a=this.getStyle(t,"position");"absolute"!==a&&"fixed"!==a&&"absolute"!==r&&"fixed"!==r&&(i.left-=n.scrollLeft,i.top-=n.scrollTop)}return i},getPositionOnElement:function(t,e,n){var i=void 0!==e.getBoundingClientRect?e.getBoundingClientRect():{left:0,top:0,width:0,height:0},o=document.body,s=document.documentElement,r=window.pageYOffset||s.scrollTop||o.scrollTop,a=window.pageXOffset||s.scrollLeft||o.scrollLeft,l=s.clientTop||o.clientTop||0,u=s.clientLeft||o.clientLeft||0,c=i.top+r-l+0*n,h=i.left+a-u+0*n,d=jsPlumb.pageLocation(t),p=i.width||e.offsetWidth*n,f=i.height||e.offsetHeight*n;return[(d[0]-h)/p,(d[1]-c)/f]},getAbsolutePosition:function(t){var e=function(e){var n=t.style[e];if(n)return parseFloat(n.substring(0,n.length-2))};return[e("left"),e("top")]},setAbsolutePosition:function(t,e,n,i){n?this.animate(t,{left:"+="+(e[0]-n[0]),top:"+="+(e[1]-n[1])},i):(t.style.left=e[0]+"px",t.style.top=e[1]+"px")},getSize:function(t){return[t.offsetWidth,t.offsetHeight]},getWidth:function(t){return t.offsetWidth},getHeight:function(t){return t.offsetHeight},getRenderMode:function(){return"svg"},draggable:function(t,e){var i;return t=n.isArray(t)||null!=t.length&&!n.isString(t)?t:[t],Array.prototype.slice.call(t).forEach(function(t){(i=this.info(t)).el&&this._initDraggableIfNecessary(i.el,!0,e,i.id,!0)}.bind(this)),this},snapToGrid:function(t,e,n){var i=[],o=function(t){var o=this.info(t);if(null!=o.el&&o.el._katavorioDrag){var s=o.el._katavorioDrag.snap(e,n);this.revalidate(o.el),i.push([o.el,s])}}.bind(this);if(1===arguments.length||3===arguments.length)o(t,e,n);else{var s=this.getManagedElements();for(var r in s)o(r,arguments[0],arguments[1])}return i},initDraggable:function(t,e,n){s(this,n).draggable(t,e),t._jsPlumbDragOptions=e},destroyDraggable:function(t,e){s(this,e).destroyDraggable(t),t._jsPlumbDragOptions=null,t._jsPlumbRelatedElement=null},unbindDraggable:function(t,e,n,i){s(this,i).destroyDraggable(t,e,n)},setDraggable:function(t,e){return jsPlumb.each(t,function(t){this.isDragSupported(t)&&(this._draggableStates[this.getAttribute(t,"id")]=e,this.setElementDraggable(t,e))}.bind(this))},_draggableStates:{},toggleDraggable:function(t){var e;return jsPlumb.each(t,function(t){var n=this.getAttribute(t,"id");return e=!(e=null!=this._draggableStates[n]&&this._draggableStates[n]),this._draggableStates[n]=e,this.setDraggable(t,e),e}.bind(this)),e},_initDraggableIfNecessary:function(t,e,i,o,s){if(!jsPlumb.headless&&(null!=e&&e&&jsPlumb.isDragSupported(t,this))){var r=i||this.Defaults.DragOptions;if(r=jsPlumb.extend({},r),jsPlumb.isAlreadyDraggable(t,this))i.force&&this.initDraggable(t,r);else{var a=jsPlumb.dragEvents.drag,l=jsPlumb.dragEvents.stop,u=jsPlumb.dragEvents.start;this.manage(o,t),r[u]=n.wrap(r[u],function(t){var e=t.el._jsPlumbDragOptions,n=!0;return e.canDrag&&(n=e.canDrag()),n&&(this.setHoverSuspended(!0),this.select({source:t.el}).addClass(this.elementDraggingClass+" "+this.sourceElementDraggingClass,!0),this.select({target:t.el}).addClass(this.elementDraggingClass+" "+this.targetElementDraggingClass,!0),this.setConnectionBeingDragged(!0)),n}.bind(this)),r[a]=n.wrap(r[a],function(t){var e=this.getUIPosition(arguments,this.getZoom());if(null!=e){var n=t.el._jsPlumbDragOptions;this.draw(t.el,e,null,!0),n._dragging&&this.addClass(t.el,"jtk-dragged"),n._dragging=!0}}.bind(this)),r[l]=n.wrap(r[l],function(t){for(var e,n=t.selection,i=function(n){var i;null!=n[1]&&(e=this.getUIPosition([{el:n[2].el,pos:[n[1].left,n[1].top]}]),i=this.draw(n[2].el,e)),null!=n[0]._jsPlumbDragOptions&&delete n[0]._jsPlumbDragOptions._dragging,this.removeClass(n[0],"jtk-dragged"),this.select({source:n[2].el}).removeClass(this.elementDraggingClass+" "+this.sourceElementDraggingClass,!0),this.select({target:n[2].el}).removeClass(this.elementDraggingClass+" "+this.targetElementDraggingClass,!0),t.e._drawResult=t.e._drawResult||{c:[],e:[],a:[]},Array.prototype.push.apply(t.e._drawResult.c,i.c),Array.prototype.push.apply(t.e._drawResult.e,i.e),Array.prototype.push.apply(t.e._drawResult.a,i.a),this.getDragManager().dragEnded(n[2].el)}.bind(this),o=0;o=c&&(window.clearInterval(f),null!=o.complete&&o.complete())},15)},destroyDroppable:function(t,e){s(this,e).destroyDroppable(t)},unbindDroppable:function(t,e,n,i){s(this,i).destroyDroppable(t,e,n)},droppable:function(t,e){var i;return t=n.isArray(t)||null!=t.length&&!n.isString(t)?t:[t],(e=e||{}).allowLoopback=!1,Array.prototype.slice.call(t).forEach(function(t){(i=this.info(t)).el&&this.initDroppable(i.el,e)}.bind(this)),this},initDroppable:function(t,e,n){s(this,n).droppable(t,e)},isAlreadyDraggable:function(t){return null!=t._katavorioDrag},isDragSupported:function(t,e){return!0},isDropSupported:function(t,e){return!0},isElementDraggable:function(t){return(t=e.getElement(t))._katavorioDrag&&t._katavorioDrag.isEnabled()},getDragObject:function(t){return t[0].drag.getDragElement()},getDragScope:function(t){return t._katavorioDrag&&t._katavorioDrag.scopes.join(" ")||""},getDropEvent:function(t){return t[0].e},getUIPosition:function(t,e){var n=t[0].el;if(null==n.offsetParent)return null;var i=t[0].finalPos||t[0].pos,o={left:i[0],top:i[1]};if(n._katavorioDrag&&n.offsetParent!==this.getContainer()){var s=this.getOffset(n.offsetParent);o.left+=s.left,o.top+=s.top}return o},setDragFilter:function(t,e,n){t._katavorioDrag&&t._katavorioDrag.setFilter(e,n)},setElementDraggable:function(t,n){(t=e.getElement(t))._katavorioDrag&&t._katavorioDrag.setEnabled(n)},setDragScope:function(t,e){t._katavorioDrag&&t._katavorioDrag.k.setDragScope(t,e)},setDropScope:function(t,e){t._katavorioDrop&&t._katavorioDrop.length>0&&t._katavorioDrop[0].k.setDropScope(t,e)},addToPosse:function(t,n){var i=Array.prototype.slice.call(arguments,1),o=s(this);e.each(t,function(t){(t=[e.getElement(t)]).push.apply(t,i),o.addToPosse.apply(o,t)})},setPosse:function(t,n){var i=Array.prototype.slice.call(arguments,1),o=s(this);e.each(t,function(t){(t=[e.getElement(t)]).push.apply(t,i),o.setPosse.apply(o,t)})},removeFromPosse:function(t,n){var i=Array.prototype.slice.call(arguments,1),o=s(this);e.each(t,function(t){(t=[e.getElement(t)]).push.apply(t,i),o.removeFromPosse.apply(o,t)})},removeFromAllPosses:function(t){var n=s(this);e.each(t,function(t){n.removeFromAllPosses(e.getElement(t))})},setPosseState:function(t,n,i){var o=s(this);e.each(t,function(t){o.setPosseState(e.getElement(t),n,i)})},dragEvents:{start:"start",stop:"stop",drag:"drag",step:"step",over:"over",out:"out",drop:"drop",complete:"complete",beforeStart:"beforeStart"},animEvents:{step:"step",complete:"complete"},stopDrag:function(t){t._katavorioDrag&&t._katavorioDrag.abort()},addToDragSelection:function(t){var e=this.getElement(t);null==e||!e._isJsPlumbGroup&&null!=e._jsPlumbGroup||s(this).select(t)},removeFromDragSelection:function(t){s(this).deselect(t)},getDragSelection:function(){return s(this).getSelection()},clearDragSelection:function(){s(this).deselectAll()},trigger:function(t,e,n,i){this.getEventManager().trigger(t,e,n,i)},doReset:function(){for(var t in this)0===t.indexOf("_katavorio_")&&this[t].reset()},getEventManager:function(){return(n=(e=this)._mottle)||(n=e._mottle=new t.Mottle),n;var e,n},on:function(t,e,n){return this.getEventManager().on.apply(this,arguments),this},off:function(t,e,n){return this.getEventManager().off.apply(this,arguments),this}});var m,v;m=e.init,(v=function(){/complete|loaded|interactive/.test(document.readyState)&&void 0!==document.body&&null!=document.body?m():setTimeout(v,9)})()}.call("undefined"!=typeof window?window:s)}(r={exports:{}},r.exports),r.exports),l=(a.jsBezier,a.Biltong,a.Mottle,a.Katavorio,a.jsPlumbUtil,a.jsPlumb);var u=function(t,e,n,i,o,s,r,a,l,u){"boolean"!=typeof r&&(l=a,a=r,r=!1);var c,h="function"==typeof n?n.options:n;if(t&&t.render&&(h.render=t.render,h.staticRenderFns=t.staticRenderFns,h._compiled=!0,o&&(h.functional=!0)),i&&(h._scopeId=i),s?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(s)},h._ssrRegister=c):e&&(c=r?function(){e.call(this,u(this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(h.functional){var d=h.render;h.render=function(t,e){return c.call(e),d(t,e)}}else{var p=h.beforeCreate;h.beforeCreate=p?[].concat(p,c):[c]}return n},c="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());var h=document.head||document.getElementsByTagName("head")[0],d={};var p=function(t){return function(t,e){return function(t,e){var n=c?e.media||"default":t,i=d[n]||(d[n]={ids:new Set,styles:[]});if(!i.ids.has(t)){i.ids.add(t);var o=e.source;if(e.map&&(o+="\n/*# sourceURL="+e.map.sources[0]+" */",o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),i.element||(i.element=document.createElement("style"),i.element.type="text/css",e.media&&i.element.setAttribute("media",e.media),h.appendChild(i.element)),"styleSheet"in i.element)i.styles.push(o),i.element.styleSheet.cssText=i.styles.filter(Boolean).join("\n");else{var s=i.ids.size-1,r=document.createTextNode(o),a=i.element.childNodes;a[s]&&i.element.removeChild(a[s]),a.length?i.element.insertBefore(r,a[s]):i.element.appendChild(r)}}}(t,e)}},f=u({render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"palette-panel"},[t._t("palette",function(){return[t._m(0)]})],2)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("ul",{staticClass:"palette-group"},[e("li",[e("div",{staticClass:"palette-default-item startpoint",attrs:{"data-type":"startpoint"}})]),e("li",[e("div",{staticClass:"palette-default-item endpoint",attrs:{"data-type":"endpoint"}})]),e("li",[e("div",{staticClass:"palette-default-item tasknode",attrs:{"data-type":"tasknode"}})]),e("li",[e("div",{staticClass:"palette-default-item gateway",attrs:{"data-type":"gateway"}})])])}]},function(t){t&&t("data-v-09b6e314_0",{source:".palette-group{margin:0;padding:0;background:#fcfcfc;text-align:center;list-style:none}.palette-group>li{padding:14px 0}.palette-default-item{display:inline-block;width:40px;height:40px;font-size:12px;color:#888;border:1px solid #999;border-radius:2px;cursor:pointer;user-select:none}.palette-default-item:hover{box-shadow:0 0 8px rgba(50,50,50,.3)}.startpoint{border-radius:50%;border:4px solid #6a6c8a}.endpoint{border-radius:50%;background:#6a6c8a}.tasknode{height:30px;border:2px solid #33d0c6}.gateway{width:30px;height:30px;background:#7c68fc;transform:rotate(-45deg)}",map:void 0,media:void 0})},{name:"PalettePanel",props:["selector"],data:function(){return{}}},void 0,!1,void 0,p,void 0),g=u({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"tool-panel"},t._l(t.tools,function(e,i){return n("div",{key:i,class:["tool-item",e.cls,{actived:"frameSelect"===e.type&&t.isFrameSelecting}],on:{click:function(n){return t.onToolClick(e)}}},[t._v("\n "+t._s(e.name)+"\n ")])}),0)},staticRenderFns:[]},function(t){t&&t("data-v-2c518942_0",{source:".tool-item{display:inline-block;margin-right:10px;user-select:none;cursor:pointer}.tool-item:last-child{margin-right:0}.tool-item.actived{color:#3a84ff}",map:void 0,media:void 0})},{name:"ToolPanel",props:["tools","isFrameSelecting"],data:function(){return{}},methods:{onToolClick:function(t){this.$emit("onToolClick",t)}}},void 0,!1,void 0,p,void 0),m=u({render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"bk-flow-location",on:{mousedown:this.onMouseDown,mouseup:this.onMouseUp}},["startpoint"===this.node.type?e("div",{staticClass:"circle-node startpoint"}):"endpoint"===this.node.type?e("div",{staticClass:"circle-node endpoint"}):"tasknode"===this.node.type?e("div",{staticClass:"tasknode"}):"gateway"===this.node.type?e("div",{staticClass:"gateway"}):e("div",{staticClass:"node-default"})])},staticRenderFns:[]},function(t){t&&t("data-v-0604134d_0",{source:".bk-flow-location .circle-node{width:30px;height:30px;border-radius:50%;text-align:center}.bk-flow-location .startpoint{border:4px solid #6a6c8a}.bk-flow-location .endpoint{background:#6a6c8a}.bk-flow-location .tasknode{width:80px;height:50px;border:2px solid #33d0c6}.bk-flow-location .gateway{width:30px;height:30px;background:#7c68fc;transform:rotate(-45deg)}.bk-flow-location .node-default{width:120px;height:80px;line-height:80px;border:1px solid #ccc;border-radius:2px;text-align:center}.bk-flow-location .node-default.selected{border:1px solid #3a84ff}",map:void 0,media:void 0})},{name:"NodeTemplate",props:{node:{type:Object,default:function(){return{}}}},data:function(){return{moveFlag:{x:0,y:0,moved:!1}}},methods:{onMouseDown:function(t){this.moveFlag={x:t.pageX,y:t.pageY,moved:!1},this.$el.addEventListener("mousemove",this.mouseMoveHandler)},onMouseUp:function(t){var e=t.pageX,n=t.pageY;this.moveFlag.x=e,this.moveFlag.y=n,this.moveFlag.moved?(console.log("drag event"),this.moveFlag.moved=!1):console.log("click event"),this.$el.removeEventListener("mousemove",this.mouseMoveHandler)},mouseMoveHandler:function(t){var e=t.pageX,n=t.pageY;(Math.abs(e-this.moveFlag.x)>2||Math.abs(n-this.moveFlag.y)>2)&&(this.moveFlag.moved=!0)}}},void 0,!1,void 0,p,void 0);function v(t){return"touches"in t?t.touches[0]:t}var y={grid:[5,5]},b={connector:["Bezier",{curviness:30}],paintStyle:{strokeWidth:2,stroke:"#567567",outlineStroke:"tranparent",outlineWidth:6},hoverPaintStyle:{fill:"transparent",stroke:"#3a84ff"}},P={endpoint:"Dot",connector:["Flowchart",{stub:[1,6],alwaysRespectStub:!0,gap:8,cornerRadius:2}],connectorOverlays:[["PlainArrow",{width:8,length:6,location:1,id:"arrow"}]],paintStyle:{fill:"#3a84ff",radius:5},anchor:["Left","Right","Top","Bottom"],isSource:!0,isTarget:!0};function x(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e="",n=0;n<7;n++)e+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return t+e}var C={showPalette:{type:Boolean,default:!0},showTool:{type:Boolean,default:!0},tools:{type:Array,default:function(){return[{type:"zoomIn",name:"放大",cls:"tool-item"},{type:"zoomOut",name:"缩小",cls:"tool-item"},{type:"resetPosition",name:"重置",cls:"tool-item"}]}},editable:{type:Boolean,default:!0},selector:{type:String,default:"palette-default-item"},data:{type:Object,default:function(){return{nodes:[],lines:[]}}},nodeOptions:{type:Object,default:function(){return e({},y)}},connectorOptions:{type:Object,default:function(){return e({},b)}},endpointOptions:{type:Object,default:function(){return e({},P)}}},_={mousedown:"ontouchstart"in document.documentElement?"touchstart":"mousedown",mousemove:"ontouchmove"in document.documentElement?"touchmove":"mousemove",mouseup:"ontouchend"in document.documentElement?"touchend":"mouseup"},j=u({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["jsflow",{editable:t.editable}]},[n("div",{staticClass:"canvas-area"},[t.showTool?n("div",{staticClass:"tool-panel-wrap"},[t._t("toolPanel",function(){return[n("tool-panel",{attrs:{tools:t.tools,"is-frame-selecting":t.isFrameSelecting},on:{onToolClick:t.onToolClick}})]})],2):t._e(),t.showPalette?n("div",{ref:"palettePanel",staticClass:"palette-panel-wrap"},[t._t("palettePanel",function(){return[n("palette-panel",{attrs:{selector:t.selector}})]})],2):t._e(),n("div",{ref:"canvasFlowWrap",staticClass:"canvas-flow-wrap",style:t.canvasWrapStyle,on:t._d({},[t.mousedown,t.onCanvasMouseDown,t.mouseup,t.onCanvasMouseUp])},[n("div",{ref:"canvasFlow",staticClass:"canvas-flow",attrs:{id:"canvas-flow"}},[t._l(t.nodes,function(e){return n("div",{key:e.id},[n("div",{staticClass:"jsflow-node canvas-node",attrs:{id:e.id},on:{mouseenter:function(n){return t.toggleHighLight(e,!0)},mouseleave:function(n){return t.toggleHighLight(e,!1)}}},[t._t("nodeTemplate",function(){return[n("node-template",{attrs:{node:e}})]},{node:e})],2)])}),n("div",{staticClass:"reference-line-vertical"}),n("div",{staticClass:"reference-line-horizontal"})],2),t.isFrameSelecting?n("div",{staticClass:"canvas-frame-selector",style:t.frameSelectorStyle}):t._e()]),t.showAddingNode?n("div",{staticClass:"jsflow-node adding-node",style:t.setNodeInitialPos(t.addingNodeConfig)},[t._t("nodeTemplate",function(){return[n("node-template",{attrs:{node:t.addingNodeConfig}})]},{node:t.addingNodeConfig})],2):t._e()])])},staticRenderFns:[]},function(t){t&&t("data-v-5d6d430f_0",{source:".jsflow{height:100%;border:1px solid #ccc}.jsflow .canvas-area{position:relative;height:100%}.jsflow .tool-panel-wrap{position:absolute;top:20px;left:70px;padding:10px 20px;background:#c4c6cc;opacity:.65;border-radius:4px;z-index:4}.jsflow .palette-panel-wrap{float:left;width:60px;height:100%;border-right:1px solid #ccc}.jsflow .canvas-flow-wrap{position:relative;height:100%;overflow:hidden}.jsflow .canvas-flow{position:relative;min-width:100%;min-height:100%}.jsflow .canvas-frame-selector{position:absolute;border:1px solid #3a84ff;background:rgba(58,132,255,.15)}.jsflow .jsflow-node{position:absolute;user-select:none}.jsflow .jtk-endpoint{z-index:1;cursor:pointer}.jsflow .adding-node{opacity:.8}.jsflow .jtk-endpoint.jtk-dragging{z-index:0}.jsflow .jtk-connector{cursor:pointer}.jsflow .reference-line-vertical{display:none;position:absolute;top:-100000px;bottom:-100000px;left:0;width:2px;background:rgba(30,144,255,.8);z-index:1}.jsflow .reference-line-horizontal{display:none;position:absolute;left:-100000px;right:-100000px;top:0;height:2px;background:rgba(30,144,255,.8);z-index:1}",map:void 0,media:void 0})},{name:"JsFlow",components:{PalettePanel:f,ToolPanel:g,NodeTemplate:m},model:{prop:"data",event:"change"},props:C,data:function(){var t=this.data;return e({nodes:t.nodes,lines:t.lines,canvasGrabbing:!1,isFrameSelecting:!1,frameMoving:null,mouseDownPos:{},canvasPos:{x:0,y:0},canvasOffset:{x:0,y:0},frameSelectorPos:{x:0,y:0},frameSelectorRect:{width:0,height:0},selectedNodes:[],showAddingNode:!1,addingNodeConfig:{},addingNodeRect:{},canvasRect:{},paletteRect:{},zoom:1,moveTimer:null},_)},computed:{canvasWrapStyle:function(){return{cursor:this.isFrameSelecting?"crosshair":this.canvasGrabbing?"-webkit-grabbing":"-webkit-grab"}},frameSelectorStyle:function(){return{left:"".concat(this.frameSelectorPos.x,"px"),top:"".concat(this.frameSelectorPos.y,"px"),width:"".concat(this.frameSelectorRect.width,"px"),height:"".concat(this.frameSelectorRect.height,"px")}}},watch:{"data.nodes":{handler:function(t){this.nodes=t},deep:!0},editable:function(t){var e=this.$el.querySelectorAll(".canvas-node");this.toggleNodeDraggable(e,t)}},mounted:function(){this.initCanvas(),this.registerEvent(),this.renderData(),this.$refs.palettePanel&&(this.paletteRect=this.$refs.palettePanel.getBoundingClientRect(),this.registerPaletteEvent())},beforeDestroy:function(){this.$refs.palettePanel&&this.$refs.palettePanel.removeEventListener(this.mousedown,this.nodeCreateHandler),this.$el.removeEventListener(this.mousemove,this.nodeMovingHandler),document.removeEventListener(this.mouseup,this.nodeMoveEndHandler)},methods:{initCanvas:function(){var t={},n=e(e({},this.endpointOptions),this.connectorOptions);for(var i in n){var o=i[0].toUpperCase();t["".concat(o).concat(i.slice(1))]=n[i]}this.instance=l.getInstance(e({Container:"canvas-flow"},t))},registerEvent:function(){var t=this;this.instance.bind("beforeDrag",function(e){return!!t.editable&&("function"!=typeof t.$listeners.onBeforeDrag||t.$listeners.onBeforeDrag(e))}),this.instance.bind("connectionDrag",function(e){"function"==typeof t.$listeners.onConnectionDrag&&t.$emit("onConnectionDrag",e)}),this.instance.bind("beforeDrop",function(e){return!!t.editable&&("function"!=typeof t.$listeners.onBeforeDrop||t.$listeners.onBeforeDrop(e))}),this.instance.bind("connection",function(e){"function"==typeof t.$listeners.onConnection&&t.$emit("onConnection",e)}),this.instance.bind("connectionDragStop",function(e,n){if(!e.target||!e.target.classList.contains("jsflow-node")){var i=t.getNodeByEvent(n.target);if(i){var o=t.nodes.find(function(t){return i.id===t.id});if("function"==typeof t.$listeners.onConnectionDragStop){var s={id:e.source.id,arrow:e.endpoints[0].anchor.type||e.endpoints[0].anchor.cssClass};t.$emit("onConnectionDragOnNode",s,o.id,n)}}"function"==typeof t.$listeners.onConnectionDragStop&&t.$emit("onConnectionDragStop",e)}}),this.instance.bind("beforeDetach",function(e){return"function"!=typeof t.$listeners.onBeforeDetach||t.$listeners.onBeforeDetach(e)}),this.instance.bind("connectionDetached",function(e,n){var i=t.lines.filter(function(t){return t.source.id!==e.sourceId&&t.target.id!==e.targetId});t.lines=i,"function"==typeof t.$listeners.onConnectionDetached&&t.$emit("onConnectionDetached",e)}),this.instance.bind("connectionMoved",function(e,n){"function"==typeof t.$listeners.onConnectionMoved&&t.$emit("onConnectionMoved",lines)}),this.instance.bind("click",function(e,n){"function"==typeof t.$listeners.onConnectionClick&&t.$emit("onConnectionClick",e,n)}),this.instance.bind("dblclick",function(e,n){"function"==typeof t.$listeners.onConnectionDbClick&&t.$emit("onConnectionDbClick",e,n)}),this.instance.bind("endpointClick",function(e,n){"function"==typeof t.$listeners.onEndpointClick&&t.$emit("onEndpointClick",e,n)}),this.instance.bind("endpointDblClick",function(e,n){"function"==typeof t.$listeners.onEndpointDbClick&&t.$emit("onEndpointDbClick",e,n)})},renderData:function(){var t=this;this.instance.batch(function(){t.nodes.forEach(function(e){t.initNode(e)}),t.lines.forEach(function(e){t.createConnector(e,t.connectorOptions)})})},updateCanvas:function(t){this.removeAllConnector(),this.lines=t.lines,this.nodes=t.nodes,this.renderData()},createNode:function(t){var e=this;("function"!=typeof this.$listeners.onCreateNodeBefore||this.$listeners.onCreateNodeBefore(t))&&(this.nodes.push(t),this.$nextTick(function(){e.initNode(t)}))},initNode:function(t){var e=document.getElementById(t.id);e.style.left="".concat(t.x,"px"),e.style.top="".concat(t.y,"px"),this.setNodeDraggable(t,this.nodeOptions),this.setNodeEndPoint(t,this.endpointOptions),"function"==typeof this.$listeners.onCreateNodeAfter&&this.$emit("onCreateNodeAfter",t)},removeNode:function(t){var e=this.nodes.findIndex(function(e){return e.id===t.id});this.nodes.splice(e,1),this.instance.remove(t.id)},setNodeEndPoint:function(t,n){var i=this,o=n.anchors||{Top:[.5,0,0,-1,"Top"],Right:[1,.5,1,0,"Right"],Bottom:[.5,1,0,1,"Bottom"],Left:[0,.5,-1,0,"Left"]};Object.keys(o).forEach(function(s){var r=o[s],a=i.instance.addEndpoint(t.id,e({anchor:r,uuid:s+t.id},n));a&&a.endpoint.canvas&&(a.endpoint.canvas.dataset.pos=s)})},setNodeDraggable:function(t,n){if(this.editable){var o=this;this.instance.draggable(t.id,e({grid:[20,20],drag:function(e){var n=o.instance.getDragSelection().map(function(t){return t.el.id}),i=o.nodes.find(function(e){return t.id===e.id}),s=Object.assign({},i);if(o.toggleHighLight(t,!1),0===n.length)o.setReferenceLine(t.id,e),o.setBoundaryOffset(e);else if(n.some(function(e){return e===t.id})){var r;if(!o.frameMoving){var a,l,u=Math.min.apply(null,o.selectedNodes.map(function(t){return t.x})),c=Math.min.apply(null,o.selectedNodes.map(function(t){return t.y}));o.selectedNodes.some(function(t){if(t.x===u)return a=t,!0}),o.selectedNodes.some(function(t){if(t.y===c)return l=t,!0}),o.frameMoving={left:a,top:l}}(null===(r=o.frameMoving.left)||void 0===r?void 0:r.id)===t.id&&o.setFrameReferLine()}else o.cancelFrameSelectorHandler();o.$emit("onNodeMoving",s,e)},stop:function(e){var n=-1,s=i(e.pos,2),r=s[0],a=s[1],l=o.nodes.find(function(e,i){if(e.id===t.id)return n=i,!0}),u=Object.assign({},l,{x:r,y:a});o.nodes.splice(n,1,u),o.frameMoving=null,o.$emit("onNodeMoveStop",u,e);var c=o.$refs.canvasFlow.querySelector(".reference-line-vertical"),h=o.$refs.canvasFlow.querySelector(".reference-line-horizontal");c.setAttribute("style","display: none; left: 0"),h.setAttribute("style","display: none; top: 0"),clearTimeout(this.moveTimer)}},n))}},setReferenceLine:function(t,e){var n=this,o=e.el,s=o.clientWidth,r=o.clientHeight,a=i(e.pos,2),l=[a[0]+s/2,a[1]+r/2],u=this.$refs.canvasFlow.querySelector(".reference-line-vertical"),c=this.$refs.canvasFlow.querySelector(".reference-line-horizontal");u.setAttribute("style","display: none; left: 0"),c.setAttribute("style","display: none; top: 0");var h=!1,d=!1;this.data.nodes.some(function(e){if(e.id!==t){var i=n.$refs.canvasFlow.querySelector("#".concat(e.id)),o=window.getComputedStyle(i),s=o.width,r=o.height,a=[e.x+Number(s.replace("px",""))/2,e.y+Number(r.replace("px",""))/2];return h||a[0]!==l[0]||(u.setAttribute("style","display: inline-block; left: ".concat(a[0]-1,"px;")),h=!0),d||a[1]!==l[1]||(c.setAttribute("style","display: inline-block; top: ".concat(a[1]-1,"px;")),d=!0),!(!h||!d)||void 0}})},setFrameReferLine:function(){var t=this,e=this.$refs.canvasFlow.querySelector("#".concat(this.frameMoving.left.id)),n=this.$refs.canvasFlow.querySelector("#".concat(this.frameMoving.top.id)),i=Number(window.getComputedStyle(e).left.replace("px","")),o=Number(window.getComputedStyle(n).top.replace("px","")),s=this.$refs.canvasFlow.querySelector(".reference-line-vertical"),r=this.$refs.canvasFlow.querySelector(".reference-line-horizontal");s.setAttribute("style","display: none; left: 0"),r.setAttribute("style","display: none; top: 0");var a=!1,l=!1;this.data.nodes.some(function(e){if(!t.selectedNodes.find(function(t){return t.id===e.id})){var n=[e.x,e.y];return a||n[0]!==i||(s.setAttribute("style","display: inline-block; left: ".concat(i,"px;")),a=!0),l||n[1]!==o||(r.setAttribute("style","display: inline-block; top: ".concat(o,"px;")),l=!0),!(!a||!l)||void 0}})},setBoundaryOffset:function(t){var e=this.$refs.canvasFlowWrap.getBoundingClientRect(),n=e.left,i=e.top,o=e.width,s=e.height;t.e.pageXn+o&&this.intervalMoveCanvas("horizontal",-20),t.e.pageYi+s&&this.intervalMoveCanvas("vertical",-20)},intervalMoveCanvas:function(t,e){var n=this;this.moveTimer&&clearTimeout(this.moveTimer),this.moveTimer=setTimeout(function(){var i=n.canvasOffset,o=i.x,s=i.y;"horizontal"===t?o+=e:s+=e,n.setCanvasPosition(o,s),n.moveTimer||n.intervalMoveCanvas(t,e)},16)},setNodePosition:function(t){var e=document.getElementById(t.id);e.style.left="".concat(t.x,"px"),e.style.top="".concat(t.y,"px"),this.instance.revalidate(e)},toggleNodeDraggable:function(t,e){this.instance.setDraggable(t,e)},setNodeInitialPos:function(t){var e={left:"".concat(t.x,"px"),top:"".concat(t.y,"px"),visibility:t.visible?"initial":"hidden"};return 1!==this.zoom&&(e.transform="matrix(".concat(this.zoom,", 0, 0, ").concat(this.zoom,", 0, 0)")),e},createConnector:function(t,n){var i=t.options||{};return this.instance.connect({source:t.source.id,target:t.target.id,uuids:[t.source.arrow+t.source.id,t.target.arrow+t.target.id]},e(e({},n),i))},setConnector:function(t,e,n){var i=this;this.instance.getAllConnections().filter(function(n){return n.sourceId===t&&n.targetId===e}).forEach(function(t){t.setConnector(n),i.endpointOptions&&i.endpointOptions.connectorOverlays&&i.endpointOptions.connectorOverlays.forEach(function(e){t.addOverlay(e)})})},removeConnector:function(t){var e=this;this.instance.getConnections({source:t.source.id,target:t.target.id}).forEach(function(t){e.instance.deleteConnection(t)})},removeAllConnector:function(){this.instance.deleteEveryConnection(),this.lines=[]},getConnectorsByNodeId:function(t){return this.instance.getAllConnections().filter(function(e){return e.sourceId===t||e.targetId===t})},getNodeByEvent:function(t){var e=t.parentNode;return!(!e||"HTML"===e.nodeName)&&(e.classList.contains("jsflow-node")?e:this.getNodeByEvent(e))},addLineOverlay:function(t,e){var n=this;this.instance.getConnections({source:t.source.id,target:t.target.id}).forEach(function(t){t.addOverlay([e.type,{label:e.name,location:e.location,cssClass:e.cls,id:e.id,events:{click:function(t,e){n.$emit("onOverlayClick",t,e)}}}])})},removeLineOverlay:function(t,e){this.instance.getConnections({source:t.source.id,target:t.target.id}).forEach(function(t){t.removeOverlay(e)})},onCanvasMouseDown:function(t){"touchstart"!==t.type&&0!==t.button||(t=v(t),this.isFrameSelecting?this.frameSelectHandler(t):(this.canvasGrabbing=!0,this.mouseDownPos={x:t.pageX,y:t.pageY},this.$refs.canvasFlowWrap.addEventListener(this.mousemove,this.canvasFlowMoveHandler,!1)))},canvasFlowMoveHandler:function(t){t=v(t),this.canvasOffset={x:this.canvasPos.x+t.pageX-this.mouseDownPos.x,y:this.canvasPos.y+t.pageY-this.mouseDownPos.y},this.$refs.canvasFlow.style.left="".concat(this.canvasOffset.x,"px"),this.$refs.canvasFlow.style.top="".concat(this.canvasOffset.y,"px"),this.$emit("onCanvasMove",{left:this.canvasOffset.x,top:this.canvasOffset.y})},onCanvasMouseUp:function(t){this.isFrameSelecting?this.frameSelectEndHandler(t):(this.canvasGrabbing=!1,this.$refs.canvasFlowWrap.removeEventListener(this.mousemove,this.canvasFlowMoveHandler),this.canvasPos={x:this.canvasOffset.x,y:this.canvasOffset.y})},registerPaletteEvent:function(){this.$refs.palettePanel.addEventListener(this.mousedown,this.nodeCreateHandler,!1)},nodeCreateHandler:function(t){var n=this,i=function t(e,n){return 1===e.nodeType&&e.classList.contains(n)?e:"HTML"!==e.parentNode.nodeName?t(e.parentNode,n):null}(t.target,this.selector);if(i){var o=i.dataset.type?i.dataset.type:"",s={};for(var r in i.dataset){var a=r.match(/(config)(\w*)/);if(a&&""!==a[2]){var l=a[2],u=l[0].toLowerCase()+l.slice(1);s[u]=i.dataset[r]}}this.showAddingNode=!0,this.addingNodeConfig.id=x("node"),this.addingNodeConfig.type=o,this.$nextTick(function(){var i=n.$el.querySelector(".adding-node");n.addingNodeRect=i.getBoundingClientRect();var r=n.getAddingNodePos(t);n.addingNodeConfig=e({id:x("node"),type:o,x:r.x,y:r.y,adding:!0,visible:!1},s),n.$el.addEventListener(n.mousemove,n.nodeMovingHandler,!1),document.addEventListener(n.mouseup,n.nodeMoveEndHandler,!1)})}},nodeMovingHandler:function(t){var e=this.getAddingNodePos(t);this.$set(this.addingNodeConfig,"x",e.x),this.$set(this.addingNodeConfig,"y",e.y),this.$set(this.addingNodeConfig,"visible",!0),"function"==typeof this.$listeners.onAddNodeMoving&&this.$emit("onAddNodeMoving",{type:this.addingNodeConfig.type,x:e.x,y:e.y})},nodeMoveEndHandler:function(t){if(this.$el.removeEventListener(this.mousemove,this.nodeMovingHandler),document.removeEventListener(this.mouseup,this.nodeMoveEndHandler),this.showAddingNode=!1,t.pageX>this.paletteRect.left+this.paletteRect.width){var e=this.canvasOffset.x,n=this.canvasOffset.y;if("function"==typeof DOMMatrixReadOnly){var i=window.getComputedStyle(this.$refs.canvasFlow),o=new DOMMatrixReadOnly(i.transform);e+=o.e,n+=o.f}var s=(this.addingNodeConfig.x-this.paletteRect.width-e+this.addingNodeRect.width*(1-this.zoom)/2)/this.zoom,r=(this.addingNodeConfig.y-n+this.addingNodeRect.height*(1-this.zoom)/2)/this.zoom;this.$set(this.addingNodeConfig,"x",s),this.$set(this.addingNodeConfig,"y",r),delete this.addingNodeConfig.adding,delete this.addingNodeConfig.visible,this.createNode(this.addingNodeConfig)}this.addingNodeConfig={},this.addingNodeRect={}},getAddingNodePos:function(t){return{x:t.pageX-this.paletteRect.left-this.addingNodeRect.width/this.zoom/2,y:t.pageY-this.paletteRect.top-this.addingNodeRect.height/this.zoom/2}},toggleHighLight:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.editable){var i=document.getElementById(t.id);this.instance.selectEndpoints({source:i}).each(function(t){var i;n?(i=e.endpointOptions.hoverPaintStyle,t.endpoint.canvas.classList.add("jtk-endpoint-highlight")):(i=e.endpointOptions.paintStyle,t.endpoint.canvas.classList.remove("jtk-endpoint-highlight")),i&&t.setStyle(i)})}},onToolClick:function(t){"function"==typeof this[t.type]&&this[t.type](),this.$emit("onToolClick",t)},setZoom:function(t,e,n){this.instance.setContainer("canvas-flow"),this.$refs.canvasFlow.style.transform="matrix("+t+",0,0,"+t+","+e+","+n+")",this.$refs.canvasFlow.style.transformOrigin="0 0",this.$refs.canvasFlow.zoom=t,this.zoom=t,this.instance.setZoom(t)},zoomIn:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1.1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.zoom*t,o=e-e*i,s=n-n*i;i>2||this.setZoom(i,o,s)},zoomOut:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.9,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.zoom*t,o=e-e*i,s=n-n*i;i<.1||this.setZoom(i,o,s)},resetPosition:function(){this.setZoom(1,0,0),this.setCanvasPosition(0,0)},setCanvasPosition:function(t,e){this.canvasOffset={x:t,y:e},this.canvasPos={x:t,y:e},this.$refs.canvasFlow.style.left=this.canvasOffset.x+"px",this.$refs.canvasFlow.style.top=this.canvasOffset.y+"px"},frameSelect:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.isFrameSelecting=t},onOpenFrameSelect:function(){this.frameSelect()},onCloseFrameSelect:function(){this.frameSelect(!1)},frameSelectHandler:function(t){this.canvasRect=this.$refs.canvasFlowWrap.getBoundingClientRect(),this.mouseDownPos={x:t.clientX-this.canvasRect.left,y:t.clientY-this.canvasRect.top},this.$refs.canvasFlowWrap.addEventListener(this.mousemove,this.frameSelectMovingHandler,!1)},frameSelectMovingHandler:function(t){var e=t.clientX-this.mouseDownPos.x-this.canvasRect.left,n=t.clientY-this.mouseDownPos.y-this.canvasRect.top;this.frameSelectorRect={width:Math.abs(e),height:Math.abs(n)},this.frameSelectorPos={x:e>0?this.mouseDownPos.x:this.mouseDownPos.x+e,y:n>0?this.mouseDownPos.y:this.mouseDownPos.y+n}},frameSelectEndHandler:function(t){this.$refs.canvasFlowWrap.removeEventListener(this.mousemove,this.frameSelectMovingHandler),this.$refs.canvasFlowWrap.removeEventListener(this.mouseup,this.frameSelectEndHandler),document.addEventListener(this.mousedown,this.cancelFrameSelectorHandler,{capture:!1,once:!0});var e=this.getSelectedNodes(),n=e.map(function(t){return t.id}),i=this.mouseDownPos,o=i.x,s=i.y;this.isFrameSelecting=!1,this.frameSelectorPos={x:0,y:0},this.frameSelectorRect={width:0,height:0},this.selectedNodes=e,this.clearNodesDragSelection(),this.addNodesToDragSelection(n),this.$emit("onFrameSelectEnd",e.slice(0),o,s)},getSelectedNodes:function(){var t=this,e=this.frameSelectorPos,n=e.x,i=e.y,o=this.frameSelectorRect,s=o.width,r=o.height;return this.nodes.filter(function(e){var o=document.querySelector("#".concat(e.id)).getBoundingClientRect(),a=o.left-t.canvasRect.left,l=o.top-t.canvasRect.top;if(na&&il)return!0})},cancelFrameSelectorHandler:function(t){this.selectedNodes=[],this.clearNodesDragSelection(),this.$emit("onCloseFrameSelect")},addNodesToDragSelection:function(t){t.forEach(function(t){var e=document.querySelector("#".concat(t));e&&e.classList.add("selected")}),this.instance.addToDragSelection(t)},clearNodesDragSelection:function(){document.querySelectorAll(".jsflow-node.selected").forEach(function(t){t.classList.remove("selected")}),this.instance.clearDragSelection()}}},void 0,!1,void 0,p,void 0);"undefined"!=typeof window&&"Vue"in window&&window.Vue.component("js-flow",j);export default j; +function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function e(e){for(var i=1;it.length)&&(e=t.length);for(var n=0,i=new Array(e);n0?1:-1});var t=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},n=function(t,e){return t.x*e.x+t.y*e.y},i=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},o=function(t,e){return{x:t.x*e,y:t.y*e}},s=Math.pow(2,-65),r=function(e,n){for(var o=[],s=a(e,n),r=n.length-1,u=l(s,2*r-1,o,0),c=t(e,n[0]),h=i(c),p=0,f=0;f=64)return n[0]=(t[0].x+t[e].x)/2,1;if(c(t,e))return n[0]=h(t,e),1}d(t,e,.5,r,a),o=l(r,e,p,i+1),s=l(a,e,f,i+1);for(var g=0;gc?c=p:p0?1:-1,a=null;o=0)o=x(c+Math.sqrt(h))*Math.pow(Math.abs(c+Math.sqrt(h)),1/3),s=x(c-Math.sqrt(h))*Math.pow(Math.abs(c-Math.sqrt(h)),1/3),d[0]=-r/3+(o+s),d[1]=-r/3-(o+s)/2,d[2]=-r/3-(o+s)/2,0!==Math.abs(Math.sqrt(3)*(o-s)/2)&&(d[1]=-1,d[2]=-1);else{var p=Math.acos(c/Math.sqrt(-Math.pow(u,3)));d[0]=2*Math.sqrt(-u)*Math.cos(p/3)-r/3,d[1]=2*Math.sqrt(-u)*Math.cos((p+2*Math.PI)/3)-r/3,d[2]=2*Math.sqrt(-u)*Math.cos((p+4*Math.PI)/3)-r/3}for(var f=0;f<3;f++)(d[f]<0||d[f]>1)&&(d[f]=-1);return d}.apply(null,u),h=[];if(null!=c)for(var d=0;d<3;d++){var p,f=c[d],g=Math.pow(f,2),m=Math.pow(f,3),v=[l[0][0]*m+l[0][1]*g+l[0][2]*f+l[0][3],l[1][0]*m+l[1][1]*g+l[1][2]*f+l[1][3]];p=n-t!=0?(v[0]-t)/(n-t):(v[1]-e)/(i-e),f>=0&&f<=1&&p>=0&&p<=1&&h.push(v)}return h};function P(t,e){return[-t[0][e]+3*t[1][e]+-3*t[2][e]+t[3][e],3*t[0][e]-6*t[1][e]+3*t[2][e],-3*t[0][e]+3*t[1][e],t[0][e]]}function x(t){return t<0?-1:t>0?1:0}var C=this.jsBezier={distanceFromCurve:r,gradientAtPoint:y,gradientAtPointAlongCurveFrom:function(t,e,n){var i=v(t,e,n);return i.location>1&&(i.location=1),i.location<0&&(i.location=0),y(t,i.location)},nearestPointOnCurve:function(t,e){var n=r(t,e);return{point:d(e,e.length-1,n.location,null,null),location:n.location}},pointOnCurve:f,pointAlongCurveFrom:function(t,e,n){return v(t,e,n).point},perpendicularToCurveAt:function(t,e,n,i){var o=v(t,e,i=null==i?0:i),s=y(t,o.location),r=Math.atan(-1/s),a=n/2*Math.sin(r),l=n/2*Math.cos(r);return[{x:o.point.x+l,y:o.point.y+a},{x:o.point.x-l,y:o.point.y-a}]},locationAlongCurveFrom:function(t,e,n){return v(t,e,n).location},getLength:function(t){var e=(new Date).getTime();if(m(t))return 0;for(var n=f(t,0),i=0,o=0,s=null;o<1;)s=f(t,o+=.005),i+=g(s,n),n=s;return console.log("length",(new Date).getTime()-e),i},lineIntersection:b,boxIntersection:function(t,e,n,i,o){var s=[];return s.push.apply(s,b(t,e,t+n,e,o)),s.push.apply(s,b(t+n,e,t+n,e+i,o)),s.push.apply(s,b(t+n,e+i,t,e+i,o)),s.push.apply(s,b(t,e+i,t,e,o)),s},boundingBoxIntersection:function(t,e){var n=[];return n.push.apply(n,b(t.x,t.y,t.x+t.w,t.y,e)),n.push.apply(n,b(t.x+t.w,t.y,t.x+t.w,t.y+t.h,e)),n.push.apply(n,b(t.x+t.w,t.y+t.h,t.x,t.y+t.h,e)),n.push.apply(n,b(t.x,t.y+t.h,t.x,t.y,e)),n},version:"0.9.0"};e.jsBezier=C}).call("undefined"!=typeof window?window:s),function(){var t=this.Biltong={version:"0.4.0"};e.Biltong=t;var n=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i=function(t,e,i){return i(t=n(t)?t:[t.x,t.y],e=n(e)?e:[e.x,e.y])},o=t.gradient=function(t,e){return i(t,e,function(t,e){return e[0]==t[0]?e[1]>t[1]?1/0:-1/0:e[1]==t[1]?e[0]>t[0]?0:-0:(e[1]-t[1])/(e[0]-t[0])})},s=(t.normal=function(t,e){return-1/o(t,e)},t.lineLength=function(t,e){return i(t,e,function(t,e){return Math.sqrt(Math.pow(e[1]-t[1],2)+Math.pow(e[0]-t[0],2))})},t.quadrant=function(t,e){return i(t,e,function(t,e){return e[0]>t[0]?e[1]>t[1]?2:1:e[0]==t[0]?e[1]>t[1]?2:1:e[1]>t[1]?3:4})}),r=(t.theta=function(t,e){return i(t,e,function(t,e){var n=o(t,e),i=Math.atan(n),r=s(t,e);return 4!=r&&3!=r||(i+=Math.PI),i<0&&(i+=2*Math.PI),i})},t.intersects=function(t,e){var n=t.x,i=t.x+t.w,o=t.y,s=t.y+t.h,r=e.x,a=e.x+e.w,l=e.y,u=e.y+e.h;return n<=r&&r<=i&&o<=l&&l<=s||n<=a&&a<=i&&o<=l&&l<=s||n<=r&&r<=i&&o<=u&&u<=s||n<=a&&r<=i&&o<=u&&u<=s||r<=n&&n<=a&&l<=o&&o<=u||r<=i&&i<=a&&l<=o&&o<=u||r<=n&&n<=a&&l<=s&&s<=u||r<=i&&n<=a&&l<=s&&s<=u},t.encloses=function(t,e,n){var i=t.x,o=t.x+t.w,s=t.y,r=t.y+t.h,a=e.x,l=e.x+e.w,u=e.y,c=e.y+e.h,h=function(t,e,i,o){return n?t<=e&&i>=o:to};return h(i,a,o,l)&&h(s,u,r,c)},[null,[1,-1],[1,1],[-1,1],[-1,-1]]),a=[null,[-1,-1],[-1,1],[1,1],[1,-1]];t.pointOnLine=function(t,e,n){var i=o(t,e),l=s(t,e),u=n>0?r[l]:a[l],c=Math.atan(i),h=Math.abs(n*Math.sin(c))*u[1],d=Math.abs(n*Math.cos(c))*u[0];return{x:t.x+d,y:t.y+h}},t.perpendicularLineTo=function(t,e,n){var i=o(t,e),s=Math.atan(-1/i),r=n/2*Math.sin(s),a=n/2*Math.cos(s);return[{x:e.x+a,y:e.y+r},{x:e.x-a,y:e.y-r}]}}.call("undefined"!=typeof window?window:s),function(){function t(t,e,n,i,o,s,r,a){return function(){var t=[];return Array.prototype.push.apply(t,arguments),t.item=function(t){return this[t]},t}(function(t,e,n,i,o,s,r,a){return new Touch({target:e,identifier:A(),pageX:n,pageY:i,screenX:o,screenY:s,clientX:r||o,clientY:a||s})}.apply(null,arguments))}var n=function(t,e,n){for(var i=(n=n||t.parentNode).querySelectorAll(e),o=0;o-1&&b<9,x=function(t,e){if(null==t)return[0,0];var n=j(t),i=_(n,0);return[i[e+"X"],i[e+"Y"]]},C=function(t){return null==t?[0,0]:P?[t.clientX+document.documentElement.scrollLeft,t.clientY+document.documentElement.scrollTop]:x(t,"page")},_=function(t,e){return t.item?t.item(e):t[e]},j=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},E=function(t){return j(t).length},S=function(t,e,n,i){if(l(t,e,n),i.__tauid=n.__tauid,t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent){var o=e+n.__tauid;t["e"+o]=n,t[o]=function(){t["e"+o]&&t["e"+o](window.event)},t.attachEvent("on"+e,t[o])}},w=function(t,e,n){null!=n&&D(t,function(){var o=i(this);if(function(t,e,n){if(t.__ta&&t.__ta[e]&&delete t.__ta[e][n.__tauid],n.__taExtra){for(var i=0;i-1&&r<9,l=9===r,u=function(t){if(a)return[t.clientX+document.documentElement.scrollLeft,t.clientY+document.documentElement.scrollTop];var e=h(t),n=c(e,0);return l?[n.pageX||n.clientX,n.pageY||n.clientY]:[n.pageX,n.pageY]},c=function(t,e){return t.item?t.item(e):t[e]},h=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},d={delegatedDraggable:"katavorio-delegated-draggable",draggable:"katavorio-draggable",droppable:"katavorio-droppable",drag:"katavorio-drag",selected:"katavorio-drag-selected",active:"katavorio-drag-active",hover:"katavorio-drag-hover",noSelect:"katavorio-drag-no-select",ghostProxy:"katavorio-ghost-proxy",clonedDrag:"katavorio-clone-drag"},p=["stop","start","drag","drop","over","out","beforeStart"],f=function(){},g=function(){return!0},m=function(t,e,n){for(var i=0;i0){var m=function(t,e,n){for(var i=null,r=e.getAttribute("katavorio-draggable"),a=null!=r?"[katavorio-draggable='"+r+"'] ":"",l=0;l0)for(var s=0;s0&&K&&e.setPosition(F,K),J.sort(S);for(var o=0;oe.rank?-1:0},w=function(t){return null==t?null:null==(t="string"==typeof t||t.constructor===String?document.getElementById(t):t)?null:(t._katavorio=t._katavorio||E(),t)};this.Katavorio=function(e){var o=[],s={};this._dragsByScope={},this._dropsByScope={};var r=1,a=function(t,e){y(t,function(t){for(var n=0;n0},u=(this.getMatchingDroppables=function(t){for(var e=[],n={},i=0;i=0&&o.splice(i,1),l(t[e],n)&&y(t[e],function(t){t.destroy()}),delete t[e]}},D=function(t,e,n,i){(t=w(t))[e]&&t[e].off(n,i)};this.elementRemoved=function(t){t._katavorioDrag&&this.destroyDraggable(t),t._katavorioDrop&&this.destroyDroppable(t)},this.destroyDraggable=function(t,e,n){1===arguments.length?E(t,"_katavorioDrag",this._dragsByScope):D(t,"_katavorioDrag",e,n)},this.destroyDroppable=function(t,e,n){1===arguments.length?E(t,"_katavorioDrop",this._dropsByScope):D(t,"_katavorioDrop",e,n)},this.reset=function(){this._dragsByScope={},this._dropsByScope={},o=[],s={},A={}};var A={},I=function(e,n,o){var s,r=i(n)?n:n.id,a=!!i(n)||!1!==n.active,l=A[r]||(s={name:r,members:[]},A[r]=s,s);return y(e,function(e){if(e._katavorioDrag){if(o&&null!=e._katavorioDrag.posseRoles[l.name])return;t(l.members,e._katavorioDrag),t(e._katavorioDrag.posses,l.name),e._katavorioDrag.posseRoles[l.name]=a}}),l};this.addToPosse=function(t,e){for(var n=[],i=1;i-1&&t.splice(n,1),-1!==n}function d(t,e,n,i){var o=t[e];return null==o&&(o=[],t[e]=o),o[i?"unshift":"push"](n),o}e.jsPlumbUtil=t,t.isArray=n,t.isNumber=function(t){return"[object Number]"===Object.prototype.toString.call(t)},t.isString=i,t.isBoolean=o,t.isNull=function(t){return null==t},t.isObject=s,t.isDate=r,t.isFunction=a,t.isNamedFunction=function(t){return a(t)&&null!=t.name&&t.name.length>0},t.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},t.clone=l,t.merge=u,t.replace=function(t,e,n){if(null!=t){var i=t;return e.replace(/([^\.])+/g,function(t,e,o,s){var r=t.match(/([^\[0-9]+){1}(\[)([0-9+])/),a=function(){return i[r[1]]||(i[r[1]]=[],i[r[1]])};if(o+t.length>=s.length)r?a()[r[3]]=n:i[t]=n;else if(r){var l=a();i=l[r[3]]||(l[r[3]]={},l[r[3]])}else i=i[t]||(i[t]={},i[t]);return""}),t}},t.functionChain=function(t,e,n){for(var i=0;i-1&&t.splice(n,1),-1!==n},t.remove=h,t.addWithFunction=function(t,e,n){-1===c(t,n)&&t.push(e)},t.addToList=d,t.suggest=function(t,e,n){return-1===t.indexOf(e)&&(n?t.unshift(e):t.push(e),!0)},t.extend=function(t,e,i){var o;e=n(e)?e:[e];var s=function(e){for(var n=e.__proto__;null!=n;)if(null!=n.prototype){for(var i in n.prototype)n.prototype.hasOwnProperty(i)&&!t.prototype.hasOwnProperty(i)&&(t.prototype[i]=n.prototype[i]);n=n.prototype.__proto__}else n=null};for(o=0;o2)for(o=2;o>8&255]+p[t>>16&255]+p[t>>24&255]+"-"+p[255&e]+p[e>>8&255]+"-"+p[e>>16&15|64]+p[e>>24&255]+"-"+p[63&n|128]+p[n>>8&255]+"-"+p[n>>16&255]+p[n>>24&255]+p[255&i]+p[i>>8&255]+p[i>>16&255]+p[i>>24&255]}function m(){for(var e=[],n=0;ne.scrollTop+e.offsetHeight)i[a]._jsPlumbProxies||(i[a]._jsPlumbProxies=i[a]._jsPlumbProxies||[],t.select({source:i[a]}).each(function(n){t.proxyConnection(n,0,e,r,function(){return s("bottom",0,n.endpoints[0],n)},function(){return o("bottom",0,n.endpoints[0],n)}),i[a]._jsPlumbProxies.push([n,0])}),t.select({target:i[a]}).each(function(n){t.proxyConnection(n,1,e,r,function(){return s("bottom",1,n.endpoints[1],n)},function(){return o("bottom",1,n.endpoints[1],n)}),i[a]._jsPlumbProxies.push([n,1])}));else if(i[a]._jsPlumbProxies){for(var l=0;l0)for(var t=0;t0){var r=Array.prototype.slice.call(arguments,1);try{for(var a=0,l=o.length;a0?-1!==t.indexOf(e):!n)};this.getConnections=function(t,e){t?t.constructor===String&&(t={scope:t}):t={};for(var n=t.scope||i.getDefaultScope(),o=W(n,!0),s=W(t.source),r=W(t.target),a=!e&&o.length>1?{}:[],l=function(t,n){if(!e&&o.length>1){var i=a[t];null==i&&(i=a[t]=[]),i.push(n)}else a.push(n)},u=0,c=y.length;u0&&!g.isSource,v=d&&o.length>0&&!g.isTarget;if(m||v)continue t;r.push(g)}}}return Q(r)},this.getAllConnections=function(){return y},this.getDefaultScope=function(){return D},this.getEndpoint=M,this.getEndpoints=function(t){return b[h(t).id]||[]},this.getDefaultEndpointType=function(){return d.Endpoint},this.getDefaultConnectionType=function(){return d.Connection},this.getId=B,this.draw=O,this.info=h,this.appendElement=k;var tt=!1;this.isHoverSuspended=function(){return tt},this.setHoverSuspended=function(t){tt=t},this.hide=function(t,e){return G(t,"none",e),i},this.idstamp=I;var et=function(t){if(!f&&t){var e=i.getElement(t);e.offsetParent&&i.setContainer(e.offsetParent)}},nt=i.manage=function(t,e,n,o){return x[t]?o&&(x[t].info=it({elId:t,timestamp:w,recalc:!0})):(x[t]={el:e,endpoints:[],connections:[],rotation:0},x[t].info=it({elId:t,timestamp:w}),i.addClass(e,"jtk-managed"),n||i.fire("manageElement",{id:t,info:x[t].info,el:e})),x[t]};this.unmanage=function(t){if(x[t]){var e=x[t].el;i.removeClass(e,"jtk-managed"),delete x[t],i.fire("unmanageElement",{id:t,el:e})}},this.rotate=function(t,e,n){return x[t]&&(x[t].rotation=e,x[t].el.style.transform="rotate("+e+"deg)",x[t].el.style.transformOrigin="center center",!0!==n)?this.revalidate(t):{c:[],e:[]}},this.getRotation=function(t){return x[t]&&x[t].rotation||0};var it=function(t){var e,n=t.timestamp,o=t.recalc,s=t.offset,r=t.elId;return S&&!n&&(n=w),!o&&n&&n===_[r]?{o:t.offset||C[r],s:E[r]}:(o||!s&&null==C[r]?null!=(e=x[r]?x[r].el:null)&&(E[r]=i.getSize(e),C[r]=i.getOffset(e),_[r]=n):(C[r]=s||C[r],null==E[r]&&null!=(e=x[r].el)&&(E[r]=i.getSize(e)),_[r]=n),C[r]&&!C[r].right&&(C[r].right=C[r].left+E[r][0],C[r].bottom=C[r].top+E[r][1],C[r].width=E[r][0],C[r].height=E[r][1],C[r].centerx=C[r].left+C[r].width/2,C[r].centery=C[r].top+C[r].height/2),{o:C[r],s:E[r]})};this.updateOffset=it,this.init=function(){v||(i.Defaults.Container&&i.setContainer(i.Defaults.Container),i.router=new t.jsPlumb.DefaultRouter(i),i.anchorManager=i.router.anchorManager,v=!0,i.fire("ready",i))}.bind(this),this.log=m,this.jsPlumbUIComponent=l,this.makeAnchor=function(){var e,o=function(e,n){if(t.jsPlumb.Anchors[e])return new t.jsPlumb.Anchors[e](n);if(!i.Defaults.DoNotThrowErrors)throw{msg:"jsPlumb: unknown anchor type '"+e+"'"}};if(0===arguments.length)return null;var s=arguments[0],r=arguments[1],a=null;if(s.compute&&s.getOrientation)return s;if("string"==typeof s)a=o(arguments[0],{elementId:r,jsPlumbInstance:i});else if(n.isArray(s))if(n.isArray(s[0])||n.isString(s[0]))2===s.length&&n.isObject(s[1])?n.isString(s[0])?(e=t.jsPlumb.extend({elementId:r,jsPlumbInstance:i},s[1]),a=o(s[0],e)):(e=t.jsPlumb.extend({elementId:r,jsPlumbInstance:i,anchors:s[0]},s[1]),a=new t.jsPlumb.DynamicAnchor(e)):a=new d.DynamicAnchor({anchors:s,selector:null,elementId:r,jsPlumbInstance:i});else{var l={x:s[0],y:s[1],orientation:s.length>=4?[s[2],s[3]]:[0,0],offsets:s.length>=6?[s[4],s[5]]:[0,0],elementId:r,jsPlumbInstance:i,cssClass:7===s.length?s[6]:null};(a=new t.jsPlumb.Anchor(l)).clone=function(){return new t.jsPlumb.Anchor(l)}}return a.id||(a.id="anchor_"+I()),a},this.makeAnchors=function(e,o,s){for(var r=[],a=0,l=e.length;a0&&t>=e.def.maxConnections},element:e.el,elementId:e.id,isSource:r,isTarget:a,addClass:function(t){i.addClass(e.el,t)},removeClass:function(t){i.removeClass(e.el,t)},onDrop:function(t){t.endpoints[0].anchor.locked=!1},isDropAllowed:function(){return u.isDropAllowed.apply(u,arguments)},isRedrop:function(t){return null!=t.suspendedElement&&null!=t.suspendedEndpoint&&t.suspendedEndpoint.element===e.el},getEndpoint:function(n){var s=e.def.endpoint;if(null==s||null==s._jsPlumb){var r=i.deriveEndpointAndAnchorSpec(n.getType().join(" "),!0),a=r.endpoints?t.jsPlumb.extend(o,{endpoint:e.def.def.endpoint||r.endpoints[1]}):o;r.anchors&&(a=t.jsPlumb.extend(a,{anchor:e.def.def.anchor||r.anchors[1]})),(s=i.addEndpoint(e.el,a))._mtNew=!0}if(o.uniqueEndpoint&&(e.def.endpoint=s),s.setDeleteOnEmpty(!0),n.isDetachable()&&s.initDraggable(),null!=s.anchor.positionFinder){var l=i.getUIPosition(arguments,i.getZoom()),u=i.getOffset(e.el),c=i.getSize(e.el),h=null==l?[0,0]:s.anchor.positionFinder(l,u,c,s.anchor.constructorParams);s.anchor.x=h[0],s.anchor.y=h[1]}return s},maybeCleanup:function(t){t._mtNew&&0===t.connections.length?i.deleteObject({endpoint:t}):delete t._mtNew}}),h=t.jsPlumb.dragEvents.drop;return s.scope=s.scope||o.scope||i.Defaults.Scope,s[h]=n.wrap(s[h],c,!0),s.rank=o.rank||0,a&&(s[t.jsPlumb.dragEvents.over]=function(){return!0}),!1===o.allowLoopback&&(s.canDrop=function(t){return t.getDragElement()._jsPlumbRelatedElement!==e.el}),i.initDroppable(e.el,s,"internal"),c};this.makeTarget=function(e,n,o){var s=t.jsPlumb.extend({_jsPlumb:this},o);t.jsPlumb.extend(s,n);for(var r=s.maxConnections||-1,a=function(e){var n=h(e),o=n.id,a=t.jsPlumb.extend({},s.dropOptions||{}),l=s.connectionType||"default";this.targetEndpointDefinitions[o]=this.targetEndpointDefinitions[o]||{},et(o),n.el._isJsPlumbGroup&&null==a.rank&&(a.rank=-1);var u={def:t.jsPlumb.extend({},s),uniqueEndpoint:s.uniqueEndpoint,maxConnections:r,enabled:!0};s.createEndpoint&&(u.uniqueEndpoint=!0,u.endpoint=i.addEndpoint(e,u.def),u.endpoint.setDeleteOnEmpty(!1)),n.def=u,this.targetEndpointDefinitions[o][l]=u,ot(n,s,a,!0===s.isSource,!0),n.el._katavorioDrop[n.el._katavorioDrop.length-1].targetDef=u}.bind(this),l=e.length&&e.constructor!==String?e:[e],u=0,c=l.length;u=0&&p>=h.maxConnections)return d&&d({element:o.el,maxConnections:c},e),!1;var f=t.jsPlumb.getPositionOnElement(e,l,u),m={};t.jsPlumb.extend(m,h.def),m.isTemporarySource=!0,m.anchor=[f[0],f[1],0,0],m.dragOptions=g,h.def.scope&&(m.scope=h.def.scope),y=this.addEndpoint(s,m),b=!0,y.setDeleteOnEmpty(!0),h.uniqueEndpoint&&(h.endpoint?y.finalEndpoint=h.endpoint:(h.endpoint=y,y.setDeleteOnEmpty(!1)));var v=function(){i.off(y.canvas,"mouseup",v),i.off(o.el,"mouseup",v),b&&(b=!1,i.deleteEndpoint(y))};i.on(y.canvas,"mouseup",v),i.on(o.el,"mouseup",v);var P={};if(h.def.extract)for(var x in h.def.extract){var C=(e.srcElement||e.target).getAttribute(x);C&&(P[h.def.extract[x]]=C)}i.trigger(y.canvas,"mousedown",e,P),n.consume(e)}}}.bind(this);this.on(o.el,"mousedown",P),h.trigger=P,r.filter&&(n.isString(r.filter)||n.isFunction(r.filter))&&i.setDragFilter(o.el,r.filter);var x=t.jsPlumb.extend({},r.dropOptions||{});ot(o,r,x,!0,!0===r.isTarget)}.bind(this),f=e.length&&e.constructor!==String?e:[e],g=0,m=f.length;g0;)o(i.el.childNodes[0]);e||ut(i,n)}};return i.batch(function(){o(t,!0)},!1===e),i},this.reset=function(t){i.silently(function(){tt=!1,i.removeAllGroups(),i.removeGroupManager(),i.deleteEveryEndpoint(),t||i.unbind(),this.targetEndpointDefinitions={},this.sourceEndpointDefinitions={},y.length=0,this.doReset&&this.doReset()}.bind(this))},this.destroy=function(){this.reset(),f=null,g=null};var ct=function(t){t.canvas&&t.canvas.parentNode&&t.canvas.parentNode.removeChild(t.canvas),t.cleanup(),t.destroy()};this.clear=function(){i.select().each(ct),i.selectEndpoints().each(ct),b={},P={}},this.setDefaultScope=function(t){return D=t,i},this.deriveEndpointAndAnchorSpec=function(t,e){for(var n=((e?"":"default ")+t).split(/[\s]/),o=null,s=null,r=null,a=null,l=0;l0)for(var e=0;e0?"add":"remove")+"Class"](o.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](o.endpointFullClass)},this.detachFromConnection=function(t,e,n){(e=null==e?this.connections.indexOf(t):e)>=0&&(this.connections.splice(e,1),this[(this.connections.length>0?"add":"remove")+"Class"](o.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](o.endpointFullClass)),!n&&a&&0===this.connections.length&&o.deleteObject({endpoint:this,fireEvent:!1,deleteAttachedObjects:!0!==n})},this.deleteEveryConnection=function(t){for(var e=this.connections.length,n=0;n0){var c=function(t,e){var n=0;if(null!=e)for(var i=0;i0&&(u.connection=this.connections[0]);u.rotation=o.getRotation(this.elementId),r=this.anchor.compute(u)}for(var m in this.endpoint.compute(r,this.anchor.getOrientation(this),this._jsPlumb.paintStyleInUse,a||this.paintStyleInUse),this.endpoint.paint(this._jsPlumb.paintStyleInUse,this.anchor),this.timestamp=e,this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(m)){var v=this._jsPlumb.overlays[m];v.isVisible()&&(this._jsPlumb.overlayPlacements[m]=v.draw(this.endpoint,this._jsPlumb.paintStyleInUse),v.paint(this._jsPlumb.overlayPlacements[m]))}}}},this.getTypeDescriptor=function(){return"endpoint"},this.isVisible=function(){return this._jsPlumb.visible},this.repaint=this.paint;var c=!1;this.initDraggable=function(){if(!c&&t.isDragSupported(this.element)){var n,a={id:null,element:null},l=null,u=!1,h=null,d=function(t,e,n){var i=!1;return{drag:function(){if(i)return i=!1,!0;if(e.element){var o=n.getUIPosition(arguments,n.getZoom());null!=o&&n.setPosition(e.element,o),n.repaint(e.element,o),t.paint({anchorPoint:t.anchor.getCurrentLocation({element:t})})}},stopDrag:function(){i=!0}}}(this,a,o),p=i.dragOptions||{},f=t.dragEvents.start,g=t.dragEvents.stop,m=t.dragEvents.drag,v=t.dragEvents.beforeStart,y=function(e){l=this.connectorSelector();var c=!0;this.isEnabled()||(c=!1),null!=l||this.isSource||this.isTemporarySource||(c=!1),!this.isSource||!this.isFull()||null!=l&&this.dragAllowedWhenFull||(c=!1),null==l||l.isDetachable(this)||(this.isFull()?c=!1:l=null);var p=o.checkCondition(null==l?"beforeDrag":"beforeStartDetach",{endpoint:this,source:this.element,sourceId:this.elementId,connection:l});if(!1===p?c=!1:"object"==typeof p?t.extend(p,n||{}):p=n||{},!1===c)return o.stopDrag&&o.stopDrag(this.canvas),d.stopDrag(),!1;for(var f=0;f0&&!1!==this.connectionsDetachable}.bind(this),o.initDraggable(this.canvas,p,"internal"),this.canvas._jsPlumbRelatedElement=this.element,c=!0}};var h=i.endpoint||this._jsPlumb.instance.Defaults.Endpoint||t.Defaults.Endpoint;this.setEndpoint(h,!0);var d=i.anchor?i.anchor:i.anchors?i.anchors:o.Defaults.Anchor||"Top";this.setAnchor(d,!0);var p=["default",i.type||""].join(" ");this.addType(p,i.data,!0),this.canvas=this.endpoint.canvas,this.canvas._jsPlumb=this,this.initDraggable();var f=function(n,s,r,a){if(t.isDropSupported(this.element)){var l=i.dropOptions||o.Defaults.DropOptions||t.Defaults.DropOptions;(l=t.extend({},l)).scope=l.scope||this.scope;var u=t.dragEvents.drop,c=t.dragEvents.over,h=t.dragEvents.out,d=this,p=o.EndpointDropHandler({getEndpoint:function(){return d},jsPlumb:o,enabled:function(){return null==r||r.isEnabled()},isFull:function(){return r.isFull()},element:this.element,elementId:this.elementId,isSource:this.isSource,isTarget:this.isTarget,addClass:function(t){d.addClass(t)},removeClass:function(t){d.removeClass(t)},isDropAllowed:function(){return d.isDropAllowed.apply(d,arguments)},reference:a,isRedrop:function(t,e){return t.suspendedEndpoint&&e.reference&&t.suspendedEndpoint.id===e.reference.id}});l[u]=e.wrap(l[u],p,!0),l[c]=e.wrap(l[c],function(){var e=t.getDragObject(arguments),n=o.getAttribute(t.getElement(e),"dragId"),i=o.getFloatingConnectionFor(n);if(null!=i){var s=o.getFloatingAnchorIndex(i);if(this.isTarget&&0!==s||i.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id===i.suspendedEndpoint.id){var r=o.checkCondition("checkDropAllowed",{sourceEndpoint:i.endpoints[s],targetEndpoint:this,connection:i});this[(r?"add":"remove")+"Class"](o.endpointDropAllowedClass),this[(r?"remove":"add")+"Class"](o.endpointDropForbiddenClass),i.endpoints[s].anchor.over(this.anchor,this)}}}.bind(this)),l[h]=e.wrap(l[h],function(){var e=t.getDragObject(arguments),n=null==e?null:o.getAttribute(t.getElement(e),"dragId"),i=n?o.getFloatingConnectionFor(n):null;if(null!=i){var s=o.getFloatingAnchorIndex(i);(this.isTarget&&0!==s||i.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id===i.suspendedEndpoint.id)&&(this.removeClass(o.endpointDropAllowedClass),this.removeClass(o.endpointDropForbiddenClass),i.endpoints[s].anchor.out())}}.bind(this)),o.initDroppable(n,l,"internal",s)}}.bind(this);return this.anchor.isFloating||f(this.canvas,!(i._transient||this.anchor.isFloating),this,i.reference),this},e.extend(t.Endpoint,t.OverlayCapableJsPlumbUIComponent,{setVisible:function(t,e,n){if(this._jsPlumb.visible=t,this.canvas&&(this.canvas.style.display=t?"block":"none"),this[t?"showOverlays":"hideOverlays"](),!e)for(var i=0;i0)for(var h=function(t,e,n,i,o,s,r,a){for(var l=[],u=e[o?0:1]/(i.length+1),c=0;c-1&&(r[o.targetId][l][0]=o,r[o.targetId][l][1]=o.endpoints[0],r[o.targetId][l][2]=o.endpoints[0].anchor.constructor===e.DynamicAnchor),t.addToList(r,i,[o,o.endpoints[1],o.endpoints[1].anchor.constructor===e.DynamicAnchor]),o.endpoints[1].anchor.isContinuous&&(o.source===o.target?o._jsPlumb.instance.removeElement(o.endpoints[1].canvas):null==o.endpoints[1].canvas.parentNode&&o._jsPlumb.instance.appendElement(o.endpoints[1].canvas)),o.updateConnectedClass()}}else if(1===a){var u=o.endpoints[0].elementId;o.target=s,o.targetId=i;var c=t.findWithFunction(r[u],function(t){return t[0].id===o.id}),h=t.findWithFunction(r[n],function(t){return t[0].id===o.id});-1!==c&&(r[u][c][0]=o,r[u][c][1]=o.endpoints[1],r[u][c][2]=o.endpoints[1].anchor.constructor===e.DynamicAnchor),h>-1&&(r[n].splice(h,1),t.addToList(r,i,[o,o.endpoints[0],o.endpoints[0].anchor.constructor===e.DynamicAnchor])),o.updateConnectedClass()}},this.rehomeEndpoint=function(t,e,n){var o=i[e]||[],s=u.getId(n);if(s!==e){var r=o.indexOf(t);if(r>-1){var l=o.splice(r,1)[0];a.add(l,s)}}for(var c=0;ce.dist?1:0});for(var m=d[0].source,v=d[0].target,y=0;y0?this.anchors[0]:null,a=r,l=function(t,e,n,i,o,s,r){var a=i[0]+t.x*o[0],l=i[1]+t.y*o[1],u=i[0]+o[0]/2,c=i[1]+o[1]/2;if(null!=s&&0!==s){var h=jsPlumbUtil.rotatePoint([a,l],[u,c],s);a=h[0],l=h[1]}return Math.sqrt(Math.pow(e-a,2)+Math.pow(n-l,2))+Math.sqrt(Math.pow(u-a,2)+Math.pow(c-l,2))},u=t.selector||function(t,e,n,i,o,s,r){for(var a=n[0]+i[0]/2,u=n[1]+i[1]/2,c=-1,h=1/0,d=0;d0?t:n+t:t*n;return i.pointOnLine({x:r,y:l},{x:a,y:u},o)}return{x:a,y:u}}return{x:r,y:l}},this.gradientAtPoint=function(t){return o},this.pointAlongPathFrom=function(t,e,n){var o=this.pointOnPath(t,n),s=e<=0?{x:r,y:l}:{x:a,y:u};return e<=0&&Math.abs(e)>1&&(e*=-1),i.pointOnLine(o,s,e)};var c=function(t,e,n){return n>=Math.min(t,e)&&n<=Math.max(t,e)},h=function(t,e,n){return Math.abs(n-t)e?e<=t&&t<=n:e>=t&&t>=n};this.lineIntersection=function(t,e,n,s){var c=Math.abs(i.gradient({x:t,y:e},{x:n,y:s})),h=Math.abs(o),p=h===1/0?r:l-h*r,f=[],g=c===1/0?t:e-c*t;if(c!==h)if(c===1/0&&0===h)d(t,r,a)&&d(l,e,s)&&(f=[t,l]);else if(0===c&&h===1/0)d(e,l,u)&&d(r,t,n)&&(f=[r,e]);else{var m,v;c===1/0?d(m=t,r,a)&&d(v=h*t+p,e,s)&&(f=[m,v]):0===c?d(v=e,l,u)&&d(m=(e-p)/h,t,n)&&(f=[m,v]):(v=h*(m=(g-p)/(h-c))+p,d(m,r,a)&&d(v,l,u)&&(f=[m,v]))}return f},this.boxIntersection=function(t,e,n,i){var o=[];return o.push.apply(o,this.lineIntersection(t,e,t+n,e)),o.push.apply(o,this.lineIntersection(t+n,e,t+n,e+i)),o.push.apply(o,this.lineIntersection(t+n,e+i,t,e+i)),o.push.apply(o,this.lineIntersection(t,e+i,t,e)),o},this.boundingBoxIntersection=function(t){return this.boxIntersection(t.x,t.y,t.w,t.h)}},Arc:function(t){e.Segments.AbstractSegment.apply(this,arguments);var n=function(e,n){return i.theta([t.cx,t.cy],[e,n])},o=2*Math.PI;this.radius=t.r,this.anticlockwise=t.ac,this.type="Arc",t.startAngle&&t.endAngle?(this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.x1=t.cx+this.radius*Math.cos(t.startAngle),this.y1=t.cy+this.radius*Math.sin(t.startAngle),this.x2=t.cx+this.radius*Math.cos(t.endAngle),this.y2=t.cy+this.radius*Math.sin(t.endAngle)):(this.startAngle=n(t.x1,t.y1),this.endAngle=n(t.x2,t.y2),this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2),this.endAngle<0&&(this.endAngle+=o),this.startAngle<0&&(this.startAngle+=o);var s=this.endAngle0?0:1,n)),n};this.pointOnPath=function(e,n){return e=s(this.curve,e,n),t.jsBezier.pointOnCurve(this.curve,e)},this.gradientAtPoint=function(e,n){return e=s(this.curve,e,n),t.jsBezier.gradientAtPoint(this.curve,e)},this.pointAlongPathFrom=function(e,n,i){return e=s(this.curve,e,i),t.jsBezier.pointAlongCurveFrom(this.curve,e,n)},this.getLength=function(){return this.length},this.getBounds=function(){return this.bounds},this.findClosestPointOnPath=function(e,n){var i=t.jsBezier.nearestPointOnCurve({x:e,y:n},this.curve);return{d:Math.sqrt(Math.pow(i.point.x-e,2)+Math.pow(i.point.y-n,2)),x:i.point.x,y:i.point.y,l:1-i.location,s:this}},this.lineIntersection=function(e,n,i,o){return t.jsBezier.lineIntersection(e,n,i,o,this.curve)}}},e.SegmentRenderer={getPath:function(t,e){return{Straight:function(e){var n=t.getCoordinates();return(e?"M "+n.x1+" "+n.y1+" ":"")+"L "+n.x2+" "+n.y2},Bezier:function(e){var n=t.params;return(e?"M "+n.x2+" "+n.y2+" ":"")+"C "+n.cp2x+" "+n.cp2y+" "+n.cp1x+" "+n.cp1y+" "+n.x1+" "+n.y1},Arc:function(e){var n=t.params,i=t.sweep>Math.PI?1:0,o=t.anticlockwise?0:1;return(e?"M"+t.x1+" "+t.y1+" ":"")+"A "+t.radius+" "+n.r+" 0 "+i+","+o+" "+t.x2+" "+t.y2}}[t.type](e)}};var o=function(){this.resetBounds=function(){this.bounds={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}},this.resetBounds()};e.Connectors.AbstractConnector=function(t){o.apply(this,arguments);var s=[],r=0,a=[],l=[],u=t.stub||0,c=n.isArray(u)?u[0]:u,h=n.isArray(u)?u[1]:u,d=t.gap||0,p=n.isArray(d)?d[0]:d,f=n.isArray(d)?d[1]:d,g=null,m=null;this.getPathData=function(){for(var t="",n=0;n0?t/r:(r+t)/r),1===t)n=s.length-1,o=1;else if(0===t)o=0,n=0;else if(t>=.5){for(n=0,o=0,i=a.length-1;i>-1;i--)if(a[i][1]>=t&&a[i][0]<=t){n=i,o=(t-a[i][0])/l[i];break}}else for(n=a.length-1,o=1,i=0;i=t){n=i,o=(t-a[i][0])/l[i];break}return{segment:s[n],proportion:o,index:n}};this.setSegments=function(t){g=[],r=0;for(var e=0;eg?0:1,v=[1,0][m];a=[],(r=[])[m]=t.sourcePos[m]>t.targetPos[m]?-1:1,a[m]=t.sourcePos[m]>t.targetPos[m]?1:-1,r[v]=0,a[v]=0}var y=n?d+p*r[0]:p*r[0],b=o?g+p*r[1]:p*r[1],P=n?f*a[0]:d+f*a[0],x=o?f*a[1]:g+f*a[1],C=r[0]*a[0]+r[1]*a[1],_={sx:y,sy:b,tx:P,ty:x,lw:s,xSpan:Math.abs(P-y),ySpan:Math.abs(x-b),mx:(y+P)/2,my:(b+x)/2,so:r,to:a,x:l,y:u,w:d,h:g,segment:e,startStubX:y+r[0]*c,startStubY:b+r[1]*c,endStubX:P+a[0]*h,endStubY:x+a[1]*h,isXGreaterThanStubTimes2:Math.abs(y-P)>c+h,isYGreaterThanStubTimes2:Math.abs(b-x)>c+h,opposite:-1===C,perpendicular:0===C,orthogonal:1===C,sourceAxis:0===r[0]?"y":"x",points:[l,u,d,g,y,b,P,x],stubs:[c,h]};return _.anchorOrientation=_.opposite?"opposite":_.orthogonal?"orthogonal":"perpendicular",_};return this.getSegments=function(){return s},this.updateBounds=function(t){var e=t.getBounds();this.bounds.minX=Math.min(this.bounds.minX,e.minX),this.bounds.maxX=Math.max(this.bounds.maxX,e.maxX),this.bounds.minY=Math.min(this.bounds.minY,e.minY),this.bounds.maxY=Math.max(this.bounds.maxY,e.maxY)},this.pointOnPath=function(t,e){var n=v(t,e);return n.segment&&n.segment.pointOnPath(n.proportion,!1)||[0,0]},this.gradientAtPoint=function(t,e){var n=v(t,e);return n.segment&&n.segment.gradientAtPoint(n.proportion,!1)||0},this.pointAlongPathFrom=function(t,e,n){var i=v(t,n);return i.segment&&i.segment.pointAlongPathFrom(i.proportion,e,!1)||[0,0]},this.compute=function(t){m=y.call(this,t),r=s.length=a.length=l.length=0,this._compute(m,t),this.x=m.points[0],this.y=m.points[1],this.w=m.points[2],this.h=m.points[3],this.segment=m.segment,function(){for(var t=0,e=0;e1||this.loc<0){var c=parseInt(this.loc,10),h=this.loc<0?1:0;o=t.pointAlongPathFrom(h,c,!1),r=t.pointAlongPathFrom(h,c-this.direction*this.length/2,!1),l=i.pointOnLine(o,r,this.length)}else if(1===this.loc){if(o=t.pointOnPath(this.loc),r=t.pointAlongPathFrom(this.loc,-this.length),l=i.pointOnLine(o,r,this.length),-1===this.direction){var d=l;l=o,o=d}}else if(0===this.loc){if(l=t.pointOnPath(this.loc),r=t.pointAlongPathFrom(this.loc,this.length),o=i.pointOnLine(l,r,this.length),-1===this.direction){var p=l;l=o,o=p}}else o=t.pointAlongPathFrom(this.loc,this.direction*this.length/2),r=t.pointOnPath(this.loc),l=i.pointOnLine(o,r,this.length);var f={hxy:o,tail:u=i.perpendicularLineTo(o,l,this.width),cxy:i.pointOnLine(o,l,a*this.length)},g=s.stroke||e.stroke,m=s.fill||e.stroke;return{component:t,d:f,"stroke-width":s.strokeWidth||e.strokeWidth,stroke:g,fill:m,minX:Math.min(o.x,u[0].x,u[1].x),maxX:Math.max(o.x,u[0].x,u[1].x),minY:Math.min(o.y,u[0].y,u[1].y),maxY:Math.max(o.y,u[0].y,u[1].y)}}return{component:t,minX:0,maxX:0,minY:0,maxY:0}}},n.extend(e.Overlays.Arrow,r,{updateFrom:function(t){this.length=t.length||this.length,this.width=t.width||this.width,this.direction=null!=t.direction?t.direction:this.direction,this.foldback=t.foldback||this.foldback},cleanup:function(){this.path&&this.path.parentNode&&this.path.parentNode.removeChild(this.path)}}),e.Overlays.PlainArrow=function(t){t=t||{};var n=e.extend(t,{foldback:1});e.Overlays.Arrow.call(this,n),this.type="PlainArrow"},n.extend(e.Overlays.PlainArrow,e.Overlays.Arrow),e.Overlays.Diamond=function(t){var n=(t=t||{}).length||40,i=e.extend(t,{length:n/2,foldback:2});e.Overlays.Arrow.call(this,i),this.type="Diamond"},n.extend(e.Overlays.Diamond,e.Overlays.Arrow);var a=function(t,e){return(null==t._jsPlumb.cachedDimensions||e)&&(t._jsPlumb.cachedDimensions=t.getDimensions()),t._jsPlumb.cachedDimensions},l=function(t){e.jsPlumbUIComponent.apply(this,arguments),r.apply(this,arguments);var i=this.fire;this.fire=function(){i.apply(this,arguments),this.component&&this.component.fire.apply(this.component,arguments)},this.detached=!1,this.id=t.id,this._jsPlumb.div=null,this._jsPlumb.initialised=!1,this._jsPlumb.component=t.component,this._jsPlumb.cachedDimensions=null,this._jsPlumb.create=t.create,this._jsPlumb.initiallyInvisible=!1===t.visible,this.getElement=function(){if(null==this._jsPlumb.div){var n=this._jsPlumb.div=e.getElement(this._jsPlumb.create(this._jsPlumb.component));n.style.position="absolute",jsPlumb.addClass(n,this._jsPlumb.instance.overlayClass+" "+(this.cssClass?this.cssClass:t.cssClass?t.cssClass:"")),this._jsPlumb.instance.appendElement(n),this._jsPlumb.instance.getId(n),this.canvas=n;var i="translate(-50%, -50%)";n.style.webkitTransform=i,n.style.mozTransform=i,n.style.msTransform=i,n.style.oTransform=i,n.style.transform=i,n._jsPlumb=this,!1===t.visible&&(n.style.display="none")}return this._jsPlumb.div},this.draw=function(t,e,i){var o=a(this);if(null!=o&&2===o.length){var s={x:0,y:0};if(i)s={x:i[0],y:i[1]};else if(t.pointOnPath){var r=this.loc,l=!1;(n.isString(this.loc)||this.loc<0||this.loc>1)&&(r=parseInt(this.loc,10),l=!0),s=t.pointOnPath(r,l)}else{var u=this.loc.constructor===Array?this.loc:this.endpointLoc;s={x:u[0]*t.w,y:u[1]*t.h}}var c=s.x-o[0]/2,h=s.y-o[1]/2;return{component:t,d:{minx:c,miny:h,td:o,cxy:s},minX:c,maxX:c+o[0],minY:h,maxY:h+o[1]}}return{minX:0,maxX:0,minY:0,maxY:0}}};n.extend(l,[e.jsPlumbUIComponent,r],{getDimensions:function(){return[1,1]},setVisible:function(t){this._jsPlumb.div&&(this._jsPlumb.div.style.display=t?"block":"none",t&&this._jsPlumb.initiallyInvisible&&(a(this,!0),this.component.repaint(),this._jsPlumb.initiallyInvisible=!1))},clearCachedDimensions:function(){this._jsPlumb.cachedDimensions=null},cleanup:function(t){t?null!=this._jsPlumb.div&&(this._jsPlumb.div._jsPlumb=null,this._jsPlumb.instance.removeElement(this._jsPlumb.div)):(this._jsPlumb&&this._jsPlumb.div&&this._jsPlumb.div.parentNode&&this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div),this.detached=!0)},reattach:function(t,e){null!=this._jsPlumb.div&&t.getContainer().appendChild(this._jsPlumb.div),this.detached=!1},computeMaxSize:function(){var t=a(this);return Math.max(t[0],t[1])},paint:function(t,e){this._jsPlumb.initialised||(this.getElement(),t.component.appendDisplayElement(this._jsPlumb.div),this._jsPlumb.initialised=!0,this.detached&&this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div)),this._jsPlumb.div.style.left=t.component.x+t.d.minx+"px",this._jsPlumb.div.style.top=t.component.y+t.d.miny+"px"}}),e.Overlays.Custom=function(t){this.type="Custom",l.apply(this,arguments)},n.extend(e.Overlays.Custom,l),e.Overlays.GuideLines=function(){var t=this;t.length=50,t.strokeWidth=5,this.type="GuideLines",r.apply(this,arguments),e.jsPlumbUIComponent.apply(this,arguments),this.draw=function(e,n){var o=e.pointAlongPathFrom(t.loc,t.length/2),s=e.pointOnPath(t.loc),r=i.pointOnLine(o,s,t.length),a=i.perpendicularLineTo(o,r,40),l=i.perpendicularLineTo(r,o,20);return{connector:e,head:o,tail:r,headLine:l,tailLine:a,minX:Math.min(o.x,r.x,l[0].x,l[1].x),minY:Math.min(o.y,r.y,l[0].y,l[1].y),maxX:Math.max(o.x,r.x,l[0].x,l[1].x),maxY:Math.max(o.y,r.y,l[0].y,l[1].y)}}},e.Overlays.Label=function(t){this.labelStyle=t.labelStyle,this.cssClass=null!=this.labelStyle?this.labelStyle.cssClass:null;var n=e.extend({create:function(){return e.createElement("div")}},t);if(e.Overlays.Custom.call(this,n),this.type="Label",this.label=t.label||"",this.labelText=null,this.labelStyle){var i=this.getElement();if(this.labelStyle.font=this.labelStyle.font||"12px sans-serif",i.style.font=this.labelStyle.font,i.style.color=this.labelStyle.color||"black",this.labelStyle.fill&&(i.style.background=this.labelStyle.fill),this.labelStyle.borderWidth>0){var o=this.labelStyle.borderStyle?this.labelStyle.borderStyle:"black";i.style.border=this.labelStyle.borderWidth+"px solid "+o}this.labelStyle.padding&&(i.style.padding=this.labelStyle.padding)}},n.extend(e.Overlays.Label,e.Overlays.Custom,{cleanup:function(t){t&&(this.div=null,this.label=null,this.labelText=null,this.cssClass=null,this.labelStyle=null)},getLabel:function(){return this.label},setLabel:function(t){this.label=t,this.labelText=null,this.clearCachedDimensions(),this.update(),this.component.repaint()},getDimensions:function(){return this.update(),l.prototype.getDimensions.apply(this,arguments)},update:function(){if("function"==typeof this.label){var t=this.label(this);this.getElement().innerHTML=t.replace(/\r\n/g,"
")}else null==this.labelText&&(this.labelText=this.label,this.getElement().innerHTML=this.labelText.replace(/\r\n/g,"
"))},updateFrom:function(t){null!=t.label&&this.setLabel(t.label)}})}.call("undefined"!=typeof window?window:s),function(){var t=this,e=t.jsPlumbUtil,n=t.jsPlumbInstance,i="stop",o="revert",s="_jsPlumbGroup",r="show",a="hide",l=function(t){var n={},i={},o={},l=this;function u(e,n){for(var i=t.getContainer();;){if(null==e||e===i)return!1;if(e===n)return!0;e=e.parentNode}}function c(e,n){for(var i=e.getEl().querySelectorAll(".jtk-managed"),o=0;o0?t[0]:l},c=!0===r.ghost,h=c||!0===r.constrain,d=!1!==r.revert,p=!0===r.orphan,f=!0===r.prune,g=!0===r.dropOverride,m=!1!==r.proxied,v=[];if(this.connections={source:[],target:[],internal:[]},this.getAnchor=function(t,e){return r.anchor||"Continuous"},this.getEndpoint=function(t,e){return r.endpoint||["Dot",{radius:10}]},this.collapsed=!1,!1!==r.draggable){var y={drag:function(){for(var t=0;t0&&r0&&ln.endStubX&&n.tx>n.startStubX||n.sx>n.endStubX&&n.tx>n.sx)||-1===n.so[i]&&(n.startStubXn.endStubY&&n.ty>n.startStubY||n.sy>n.endStubY&&n.ty>n.sy)||-1===n.so[i]&&(n.startStubYl[e][0],f=i[e][h][0],g=i[e][h][1],m={x:[[[1,2,3,4],null,[2,1,4,3]],null,[[4,3,2,1],null,[3,4,1,2]]],y:[[[3,2,1,4],null,[2,3,4,1]],null,[[4,1,2,3],null,[1,4,3,2]]]}[e][h][d];return n.segment===m[3]||n.segment===m[2]&&p?o[e]:n.segment===m[2]&&g=f||n.segment===m[1]&&!p?a[e]:n.segment===m[0]||n.segment===m[1]&&p?r[e]:void 0},orthogonal:function(e,n,i,o,s){var r=t,a={x:-1===r.so[0]?Math.min(n,o):Math.max(n,o),y:-1===r.so[1]?Math.min(n,o):Math.max(n,o)}[e];return{x:[[a,i],[a,s],[o,s]],y:[[i,a],[s,a],[s,o]]}[e]},opposite:function(n,o,s,r){var a=t,l={x:"y",y:"x"}[n],u={x:"height",y:"width"}[n],c=a["is"+n.toUpperCase()+"GreaterThanStubTimes2"];if(e.sourceEndpoint.elementId===e.targetEndpoint.elementId){var h=s+(1-e.sourceEndpoint.anchor[l])*e.sourceInfo[u]+i.maxStub;return{x:[[o,h],[r,h]],y:[[h,o],[h,r]]}[n]}return!c||1===a.so[g]&&o>r||-1===a.so[g]&&or?{x:[[x,a.sy],[x,a.ty]],y:[[a.sx,C],[a.tx,C]]}[n]:void 0}}[t.anchorOrientation](t.sourceAxis,v,y,b,P);if(j)for(var E=0;E0&&a[4]!==o[4]){var h=Math.min(d(a),d(o)),f=Math.min(l,h/2);a[2]-=s[0]*f,a[3]-=s[1]*f,o[0]+=r[0]*f,o[1]+=r[1]*f;var g=s[1]===r[0]&&1===r[0]||s[1]===r[0]&&0===r[0]&&s[0]!==r[1]||s[1]===r[0]&&-1===r[0],m=(o[1]>a[3]?1:-1)==(o[0]>a[2]?1:-1),v=m&&g||!m&&!g?o[0]:a[2],y=m&&g||!m&&!g?a[3]:o[1];i.addSegment(t,"Straight",{x1:a[0],y1:a[1],x2:a[2],y2:a[3]}),i.addSegment(t,"Arc",{r:f,x1:a[2],y1:a[3],x2:o[0],y2:o[1],cx:v,cy:y,ac:g})}else{var b=a[2]===a[0]?0:a[2]>a[0]?n.lw/2:-n.lw/2,P=a[3]===a[1]?0:a[3]>a[1]?n.lw/2:-n.lw/2;i.addSegment(t,"Straight",{x1:a[0]-b,y1:a[1]-P,x2:a[2]+b,y2:a[3]+P})}a=o}null!=o&&i.addSegment(t,"Straight",{x1:o[0],y1:o[1],x2:o[2],y2:o[3]})}(this,n,t)}},e.extend(t.Connectors.Flowchart,t.Connectors.AbstractConnector)}.call("undefined"!=typeof window?window:s),function(){var t=this.jsPlumb,e=this.jsPlumbUtil;t.Connectors.AbstractBezierConnector=function(e){var n,i=!1!==(e=e||{}).showLoopback,o=(e.curviness,e.margin||5),s=(e.proximityLimit,e.orientation&&"clockwise"===e.orientation),r=e.loopbackRadius||25;return this._compute=function(t,e){var a=e.sourcePos,l=e.targetPos,u=Math.abs(a[0]-l[0]),c=Math.abs(a[1]-l[1]);if(i&&e.sourceEndpoint.elementId===e.targetEndpoint.elementId){var h=e.sourcePos[0],d=e.sourcePos[1]-o,p=h,f=d-r,g=p-r,m=f-r;u=2*r,c=2*r,t.points[0]=g,t.points[1]=m,t.points[2]=u,t.points[3]=c,n.addSegment(this,"Arc",{loopback:!0,x1:h-g+4,y1:d-m,startAngle:0,endAngle:2*Math.PI,r:r,ac:!s,x2:h-g-4,y2:d-m,cx:p-g,cy:f-m})}else this._computeBezier(t,e,a,l,u,c)},n=t.Connectors.AbstractConnector.apply(this,arguments)},e.extend(t.Connectors.AbstractBezierConnector,t.Connectors.AbstractConnector);var n=function(e){e=e||{},this.type="Bezier";var n=t.Connectors.AbstractBezierConnector.apply(this,arguments),i=e.curviness||150;this.getCurviness=function(){return i},this._findControlPoint=function(t,e,n,o,s,r,a){var l=[];return r[0]!==a[0]||r[1]===a[1]?(0===a[0]?l.push(n[0]=P?3:4),S=Math.sqrt(Math.pow(p-h,2)+Math.pow(f-d,2));g=(n=function(t,e,n,i,o,s,r,a,l){return a<=l?[t,e]:1===n?i[3]<=0&&o[3]>=1?[t+(i[2]<.5?-1*s:s),e]:i[2]>=1&&o[2]<=0?[t,e+(i[3]<.5?-1*r:r)]:[t+-1*s,e+-1*r]:2===n?i[3]>=1&&o[3]<=0?[t+(i[2]<.5?-1*s:s),e]:i[2]>=1&&o[2]<=0?[t,e+(i[3]<.5?-1*r:r)]:[t+s,e+-1*r]:3===n?i[3]>=1&&o[3]<=0?[t+(i[2]<.5?-1*s:s),e]:i[2]<=0&&o[2]>=1?[t,e+(i[3]<.5?-1*r:r)]:[t+-1*s,e+-1*r]:4===n?i[3]<=0&&o[3]>=1?[t+(i[2]<.5?-1*s:s),e]:i[2]<=0&&o[2]>=1?[t,e+(i[3]<.5?-1*r:r)]:[t+s,e+-1*r]:void 0}(_,j,E,e.sourcePos,e.targetPos,o,o,S,r))[0],m=n[0],v=n[1],y=n[1],i.addSegment(this,"Bezier",{x1:p,y1:f,x2:h,y2:d,cp1x:g,cp1y:v,cp2x:m,cp2y:y})}};t.Connectors.StateMachine=n,e.extend(n,t.Connectors.AbstractBezierConnector)}.call("undefined"!=typeof window?window:s),function(){var t=this.jsPlumb,e=this.jsPlumbUtil,n=function(e){this.type="Straight";var n=t.Connectors.AbstractConnector.apply(this,arguments);this._compute=function(t,e){n.addSegment(this,"Straight",{x1:t.sx,y1:t.sy,x2:t.startStubX,y2:t.startStubY}),n.addSegment(this,"Straight",{x1:t.startStubX,y1:t.startStubY,x2:t.endStubX,y2:t.endStubY}),n.addSegment(this,"Straight",{x1:t.endStubX,y1:t.endStubY,x2:t.tx,y2:t.ty})}};t.Connectors.Straight=n,e.extend(n,t.Connectors.AbstractConnector)}.call("undefined"!=typeof window?window:s),function(){var t=this.jsPlumb,e=this.jsPlumbUtil,n={"stroke-linejoin":"stroke-linejoin","stroke-dashoffset":"stroke-dashoffset","stroke-linecap":"stroke-linecap"},i="http://www.w3.org/2000/svg",o=function(t,e){for(var n in e)t.setAttribute(n,""+e[n])},s=function(e,n){return(n=n||{}).version="1.1",n.xmlns=i,t.createElementNS(i,e,null,null,n)},r=function(t){return"position:absolute;left:"+t[0]+"px;top:"+t[1]+"px"},a=function(t){for(var e=t.querySelectorAll(" defs,linearGradient,radialGradient"),n=0;nn?t.insertBefore(e,t.childNodes[n]):t.appendChild(e)};e.svg={node:s,attr:o,pos:r};var c=function(n){var i=n.pointerEventsSpec||"all",a={};t.jsPlumbUIComponent.apply(this,n.originalArgs),this.canvas=null,this.path=null,this.svg=null,this.bgCanvas=null;var l=n.cssClass+" "+(n.originalArgs[0].cssClass||""),u={style:"",width:0,height:0,"pointer-events":i,position:"absolute"};this.svg=s("svg",u),n.useDivWrapper?(this.canvas=t.createElement("div",{position:"absolute"}),e.sizeElement(this.canvas,0,0,1,1),this.canvas.className=l):(o(this.svg,{class:l}),this.canvas=this.svg),n._jsPlumb.appendElement(this.canvas,n.originalArgs[0].parent),n.useDivWrapper&&this.canvas.appendChild(this.svg);var c=[this.canvas];return this.getDisplayElements=function(){return c},this.appendDisplayElement=function(t){c.push(t)},this.paint=function(t,i,s){if(null!=t){var l,u=[this.x,this.y],c=[this.w,this.h];null!=s&&(s.xmin<0&&(u[0]+=s.xmin),s.ymin<0&&(u[1]+=s.ymin),c[0]=s.xmax+(s.xmin<0?-s.xmin:0),c[1]=s.ymax+(s.ymin<0?-s.ymin:0)),n.useDivWrapper?(e.sizeElement(this.canvas,u[0],u[1],c[0]>0?c[0]:1,c[1]>0?c[1]:1),u[0]=0,u[1]=0,l=r([0,0])):l=r([u[0],u[1]]),a.paint.apply(this,arguments),o(this.svg,{style:l,width:c[0]||1,height:c[1]||1})}},{renderer:a}};e.extend(c,t.jsPlumbUIComponent,{cleanup:function(t){t||null==this.typeId?(this.canvas&&(this.canvas._jsPlumb=null),this.svg&&(this.svg._jsPlumb=null),this.bgCanvas&&(this.bgCanvas._jsPlumb=null),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.bgCanvas&&this.bgCanvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.svg=null,this.canvas=null,this.path=null,this.group=null,this._jsPlumb=null):(this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.bgCanvas&&this.bgCanvas.parentNode&&this.bgCanvas.parentNode.removeChild(this.bgCanvas))},reattach:function(t){var e=t.getContainer();this.canvas&&null==this.canvas.parentNode&&e.appendChild(this.canvas),this.bgCanvas&&null==this.bgCanvas.parentNode&&e.appendChild(this.bgCanvas)},setVisible:function(t){this.canvas&&(this.canvas.style.display=t?"block":"none")}}),t.ConnectorRenderers.svg=function(e){var n=this;c.apply(this,[{cssClass:e._jsPlumb.connectorClass,originalArgs:arguments,pointerEventsSpec:"none",_jsPlumb:e._jsPlumb}]).renderer.paint=function(i,r,a){var c=n.getSegments(),h=[0,0];if(a.xmin<0&&(h[0]=-a.xmin),a.ymin<0&&(h[1]=-a.ymin),c.length>0){var d={d:n.getPathData(),transform:"translate("+h[0]+","+h[1]+")","pointer-events":e["pointer-events"]||"visibleStroke"},p=null;n.x,n.y,n.w,n.h;if(i.outlineStroke){var f=i.outlineWidth||1,g=i.strokeWidth+2*f;delete(p=t.extend({},i)).gradient,p.stroke=i.outlineStroke,p.strokeWidth=g,null==n.bgPath?(n.bgPath=s("path",d),t.addClass(n.bgPath,t.connectorOutlineClass),u(n.svg,n.bgPath,0)):o(n.bgPath,d),l(n.svg,n.bgPath,p,0,n)}null==n.path?(n.path=s("path",d),u(n.svg,n.path,i.outlineStroke?1:0)):o(n.path,d),l(n.svg,n.path,i,0,n)}}},e.extend(t.ConnectorRenderers.svg,c);var h=t.SvgEndpoint=function(e){c.apply(this,[{cssClass:e._jsPlumb.endpointClass,originalArgs:arguments,pointerEventsSpec:"all",useDivWrapper:!0,_jsPlumb:e._jsPlumb}]).renderer.paint=function(e){var n=t.extend({},e);n.outlineStroke&&(n.stroke=n.outlineStroke),null==this.node?(this.node=this.makeNode(n),this.svg.appendChild(this.node)):null!=this.updateNode&&this.updateNode(this.node),l(this.svg,this.node,n,(this.x,this.y,this.w,this.h),this),r(this.node,(this.x,this.y))}.bind(this)};e.extend(h,c),t.Endpoints.svg.Dot=function(){t.Endpoints.Dot.apply(this,arguments),h.apply(this,arguments),this.makeNode=function(t){return s("circle",{cx:this.w/2,cy:this.h/2,r:this.radius})},this.updateNode=function(t){o(t,{cx:this.w/2,cy:this.h/2,r:this.radius})}},e.extend(t.Endpoints.svg.Dot,[t.Endpoints.Dot,h]),t.Endpoints.svg.Rectangle=function(){t.Endpoints.Rectangle.apply(this,arguments),h.apply(this,arguments),this.makeNode=function(t){return s("rect",{width:this.w,height:this.h})},this.updateNode=function(t){o(t,{width:this.w,height:this.h})}},e.extend(t.Endpoints.svg.Rectangle,[t.Endpoints.Rectangle,h]),t.Endpoints.svg.Image=t.Endpoints.Image,t.Endpoints.svg.Blank=t.Endpoints.Blank,t.Overlays.svg.Label=t.Overlays.Label,t.Overlays.svg.Custom=t.Overlays.Custom;var d=function(e,n){e.apply(this,n),t.jsPlumbUIComponent.apply(this,n),this.isAppendedAtTopLevel=!1,this.path=null,this.paint=function(t,e){if(t.component.svg&&e){null==this.path&&(this.path=s("path",{"pointer-events":"all"}),t.component.svg.appendChild(this.path),this.elementCreated&&this.elementCreated(this.path,t.component),this.canvas=t.component.svg);var r=n&&1===n.length&&n[0].cssClass||"",a=[0,0];e.xmin<0&&(a[0]=-e.xmin),e.ymin<0&&(a[1]=-e.ymin),o(this.path,{d:i(t.d),class:r,stroke:t.stroke?t.stroke:null,fill:t.fill?t.fill:null,transform:"translate("+a[0]+","+a[1]+")"})}};var i=function(t){return isNaN(t.cxy.x)||isNaN(t.cxy.y)?"":"M"+t.hxy.x+","+t.hxy.y+" L"+t.tail[0].x+","+t.tail[0].y+" L"+t.cxy.x+","+t.cxy.y+" L"+t.tail[1].x+","+t.tail[1].y+" L"+t.hxy.x+","+t.hxy.y};this.transfer=function(t){t.canvas&&this.path&&this.path.parentNode&&(this.path.parentNode.removeChild(this.path),t.canvas.appendChild(this.path))}},p={cleanup:function(t){null!=this.path&&(t?this._jsPlumb.instance.removeElement(this.path):this.path.parentNode&&this.path.parentNode.removeChild(this.path))},reattach:function(t,e){this.path&&e.canvas&&e.canvas.appendChild(this.path)},setVisible:function(t){null!=this.path&&(this.path.style.display=t?"block":"none")}};e.extend(d,[t.jsPlumbUIComponent,t.Overlays.AbstractOverlay]),t.Overlays.svg.Arrow=function(){d.apply(this,[t.Overlays.Arrow,arguments])},e.extend(t.Overlays.svg.Arrow,[t.Overlays.Arrow,d],p),t.Overlays.svg.PlainArrow=function(){d.apply(this,[t.Overlays.PlainArrow,arguments])},e.extend(t.Overlays.svg.PlainArrow,[t.Overlays.PlainArrow,d],p),t.Overlays.svg.Diamond=function(){d.apply(this,[t.Overlays.Diamond,arguments])},e.extend(t.Overlays.svg.Diamond,[t.Overlays.Diamond,d],p),t.Overlays.svg.GuideLines=function(){var e,n,i=null,r=this;t.Overlays.GuideLines.apply(this,arguments),this.paint=function(t,l){null==i&&(i=s("path"),t.connector.svg.appendChild(i),r.attachListeners(i,t.connector),r.attachListeners(i,r),e=s("path"),t.connector.svg.appendChild(e),r.attachListeners(e,t.connector),r.attachListeners(e,r),n=s("path"),t.connector.svg.appendChild(n),r.attachListeners(n,t.connector),r.attachListeners(n,r));var u=[0,0];l.xmin<0&&(u[0]=-l.xmin),l.ymin<0&&(u[1]=-l.ymin),o(i,{d:a(t.head,t.tail),stroke:"red",fill:null,transform:"translate("+u[0]+","+u[1]+")"}),o(e,{d:a(t.tailLine[0],t.tailLine[1]),stroke:"blue",fill:null,transform:"translate("+u[0]+","+u[1]+")"}),o(n,{d:a(t.headLine[0],t.headLine[1]),stroke:"green",fill:null,transform:"translate("+u[0]+","+u[1]+")"})};var a=function(t,e){return"M "+t.x+","+t.y+" L"+e.x+","+e.y}},e.extend(t.Overlays.svg.GuideLines,t.Overlays.GuideLines)}.call("undefined"!=typeof window?window:s),function(){var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=t.Katavorio,o=t.Biltong,s=function(t,n){var s="_katavorio_"+(n=n||"main"),r=t[s],a=t.getEventManager();return r||((r=new i({bind:a.on,unbind:a.off,getSize:e.getSize,getConstrainingRectangle:function(t){return[t.parentNode.scrollWidth,t.parentNode.scrollHeight]},getPosition:function(e,n){var i=t.getOffset(e,n,e._katavorioDrag?e.offsetParent:null);return[i.left,i.top]},setPosition:function(t,e){t.style.left=e[0]+"px",t.style.top=e[1]+"px"},addClass:e.addClass,removeClass:e.removeClass,intersects:o.intersects,indexOf:function(t,e){return t.indexOf(e)},scope:t.getDefaultScope(),css:{noSelect:t.dragSelectClass,droppable:"jtk-droppable",draggable:"jtk-draggable",drag:"jtk-drag",selected:"jtk-drag-selected",active:"jtk-drag-active",hover:"jtk-drag-hover",ghostProxy:"jtk-ghost-proxy"}})).setZoom(t.getZoom()),t[s]=r,t.bind("zoom",r.setZoom)),r},r=function(t,e){if(null==e)return[0,0];var n=h(e),i=c(n,0);return[i[t+"X"],i[t+"Y"]]},a=r.bind(this,"page"),l=r.bind(this,"screen"),u=r.bind(this,"client"),c=function(t,e){return t.item?t.item(e):t[e]},h=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},d=function(t){var e={},n=[],i={},o={},s={};this.register=function(r){var a,l=t.getId(r);e[l]||(e[l]=r,n.push(r),i[l]={});var u=function(e){if(e)for(var n=0;n0){a||(a=t.getOffset(r));var d=t.getOffset(c);i[l][h]={id:h,offset:{left:d.left-a.left,top:d.top-a.top}},s[h]=l}u(e.childNodes[n])}};u(r)},this.updateOffsets=function(e,n){if(null!=e){n=n||{};var o,r=jsPlumb.getElement(e),a=t.getId(r),l=i[a];if(l)for(var u in l)if(l.hasOwnProperty(u)){var c=jsPlumb.getElement(u),h=n[u]||t.getOffset(c);if(null==c.offsetParent&&null!=i[a][u])continue;o||(o=t.getOffset(r)),i[a][u]={id:u,offset:{left:h.left-o.left,top:h.top-o.top}},s[u]=a}}},this.endpointAdded=function(n,r){r=r||t.getId(n);var a=document.body,l=n.parentNode;for(o[r]=o[r]?o[r]+1:1;null!=l&&l!==a;){var u=t.getId(l,null,!0);if(u&&e[u]){var c=t.getOffset(l);if(null==i[u][r]){var h=t.getOffset(n);i[u][r]={id:r,offset:{left:h.left-c.left,top:h.top-c.top}},s[r]=u}break}l=l.parentNode}},this.endpointDeleted=function(t){if(o[t.elementId]&&(o[t.elementId]--,o[t.elementId]<=0))for(var e in i)i.hasOwnProperty(e)&&i[e]&&(delete i[e][t.elementId],delete s[t.elementId])},this.changeId=function(t,e){i[e]=i[t],i[t]={},s[e]=s[t],s[t]=null},this.getElementsForDraggable=function(t){return i[t]},this.elementRemoved=function(t){var e=s[t];e&&(i[e]&&delete i[e][t],delete s[t])},this.reset=function(){e={},n=[],i={},o={}},this.dragEnded=function(e){if(null!=e.offsetParent){var n=t.getId(e),i=s[n];i&&this.updateOffsets(i)}},this.setParent=function(e,n,o,r,a){var l=s[n];i[r]||(i[r]={});var u=t.getOffset(o),c=a||t.getOffset(e);l&&i[l]&&delete i[l][n],i[r][n]={id:n,offset:{left:c.left-u.left,top:c.top-u.top}},s[n]=r},this.clearParent=function(t,e){var n=s[e];n&&(delete i[n][e],delete s[e])},this.revalidateParent=function(e,n,i){var o=s[n];if(o){var r={};r[n]=i,this.updateOffsets(o,r),t.revalidate(o)}},this.getDragAncestor=function(e){var n=jsPlumb.getElement(e),i=t.getId(n),o=s[i];return o?jsPlumb.getElement(o):null}},p=function(t,e,i){e=n.fastTrim(e),void 0!==t.className.baseVal?t.className.baseVal=e:t.className=e;try{var o=t.classList;if(null!=o){for(;o.length>0;)o.remove(o.item(0));for(var s=0;s0||t.scrollLeft>0)&&(i.left-=t.scrollLeft,i.top-=t.scrollTop)}.bind(this);null!=o;)i.left+=o.offsetLeft,i.top+=o.offsetTop,s(o),o=e?o.offsetParent:o.offsetParent===n?null:o.offsetParent;if(null!=n&&!e&&(n.scrollTop>0||n.scrollLeft>0)){var r=null!=t.offsetParent?this.getStyle(t.offsetParent,"position"):"static",a=this.getStyle(t,"position");"absolute"!==a&&"fixed"!==a&&"absolute"!==r&&"fixed"!==r&&(i.left-=n.scrollLeft,i.top-=n.scrollTop)}return i},getPositionOnElement:function(t,e,n){var i=void 0!==e.getBoundingClientRect?e.getBoundingClientRect():{left:0,top:0,width:0,height:0},o=document.body,s=document.documentElement,r=window.pageYOffset||s.scrollTop||o.scrollTop,a=window.pageXOffset||s.scrollLeft||o.scrollLeft,l=s.clientTop||o.clientTop||0,u=s.clientLeft||o.clientLeft||0,c=i.top+r-l+0*n,h=i.left+a-u+0*n,d=jsPlumb.pageLocation(t),p=i.width||e.offsetWidth*n,f=i.height||e.offsetHeight*n;return[(d[0]-h)/p,(d[1]-c)/f]},getAbsolutePosition:function(t){var e=function(e){var n=t.style[e];if(n)return parseFloat(n.substring(0,n.length-2))};return[e("left"),e("top")]},setAbsolutePosition:function(t,e,n,i){n?this.animate(t,{left:"+="+(e[0]-n[0]),top:"+="+(e[1]-n[1])},i):(t.style.left=e[0]+"px",t.style.top=e[1]+"px")},getSize:function(t){return[t.offsetWidth,t.offsetHeight]},getWidth:function(t){return t.offsetWidth},getHeight:function(t){return t.offsetHeight},getRenderMode:function(){return"svg"},draggable:function(t,e){var i;return t=n.isArray(t)||null!=t.length&&!n.isString(t)?t:[t],Array.prototype.slice.call(t).forEach(function(t){(i=this.info(t)).el&&this._initDraggableIfNecessary(i.el,!0,e,i.id,!0)}.bind(this)),this},snapToGrid:function(t,e,n){var i=[],o=function(t){var o=this.info(t);if(null!=o.el&&o.el._katavorioDrag){var s=o.el._katavorioDrag.snap(e,n);this.revalidate(o.el),i.push([o.el,s])}}.bind(this);if(1===arguments.length||3===arguments.length)o(t,e,n);else{var s=this.getManagedElements();for(var r in s)o(r,arguments[0],arguments[1])}return i},initDraggable:function(t,e,n){s(this,n).draggable(t,e),t._jsPlumbDragOptions=e},destroyDraggable:function(t,e){s(this,e).destroyDraggable(t),t._jsPlumbDragOptions=null,t._jsPlumbRelatedElement=null},unbindDraggable:function(t,e,n,i){s(this,i).destroyDraggable(t,e,n)},setDraggable:function(t,e){return jsPlumb.each(t,function(t){this.isDragSupported(t)&&(this._draggableStates[this.getAttribute(t,"id")]=e,this.setElementDraggable(t,e))}.bind(this))},_draggableStates:{},toggleDraggable:function(t){var e;return jsPlumb.each(t,function(t){var n=this.getAttribute(t,"id");return e=!(e=null!=this._draggableStates[n]&&this._draggableStates[n]),this._draggableStates[n]=e,this.setDraggable(t,e),e}.bind(this)),e},_initDraggableIfNecessary:function(t,e,i,o,s){if(!jsPlumb.headless&&(null!=e&&e&&jsPlumb.isDragSupported(t,this))){var r=i||this.Defaults.DragOptions;if(r=jsPlumb.extend({},r),jsPlumb.isAlreadyDraggable(t,this))i.force&&this.initDraggable(t,r);else{var a=jsPlumb.dragEvents.drag,l=jsPlumb.dragEvents.stop,u=jsPlumb.dragEvents.start;this.manage(o,t),r[u]=n.wrap(r[u],function(t){var e=t.el._jsPlumbDragOptions,n=!0;return e.canDrag&&(n=e.canDrag()),n&&(this.setHoverSuspended(!0),this.select({source:t.el}).addClass(this.elementDraggingClass+" "+this.sourceElementDraggingClass,!0),this.select({target:t.el}).addClass(this.elementDraggingClass+" "+this.targetElementDraggingClass,!0),this.setConnectionBeingDragged(!0)),n}.bind(this)),r[a]=n.wrap(r[a],function(t){var e=this.getUIPosition(arguments,this.getZoom());if(null!=e){var n=t.el._jsPlumbDragOptions;this.draw(t.el,e,null,!0),n._dragging&&this.addClass(t.el,"jtk-dragged"),n._dragging=!0}}.bind(this)),r[l]=n.wrap(r[l],function(t){for(var e,n=t.selection,i=function(n){var i;null!=n[1]&&(e=this.getUIPosition([{el:n[2].el,pos:[n[1].left,n[1].top]}]),i=this.draw(n[2].el,e)),null!=n[0]._jsPlumbDragOptions&&delete n[0]._jsPlumbDragOptions._dragging,this.removeClass(n[0],"jtk-dragged"),this.select({source:n[2].el}).removeClass(this.elementDraggingClass+" "+this.sourceElementDraggingClass,!0),this.select({target:n[2].el}).removeClass(this.elementDraggingClass+" "+this.targetElementDraggingClass,!0),t.e._drawResult=t.e._drawResult||{c:[],e:[],a:[]},Array.prototype.push.apply(t.e._drawResult.c,i.c),Array.prototype.push.apply(t.e._drawResult.e,i.e),Array.prototype.push.apply(t.e._drawResult.a,i.a),this.getDragManager().dragEnded(n[2].el)}.bind(this),o=0;o=c&&(window.clearInterval(f),null!=o.complete&&o.complete())},15)},destroyDroppable:function(t,e){s(this,e).destroyDroppable(t)},unbindDroppable:function(t,e,n,i){s(this,i).destroyDroppable(t,e,n)},droppable:function(t,e){var i;return t=n.isArray(t)||null!=t.length&&!n.isString(t)?t:[t],(e=e||{}).allowLoopback=!1,Array.prototype.slice.call(t).forEach(function(t){(i=this.info(t)).el&&this.initDroppable(i.el,e)}.bind(this)),this},initDroppable:function(t,e,n){s(this,n).droppable(t,e)},isAlreadyDraggable:function(t){return null!=t._katavorioDrag},isDragSupported:function(t,e){return!0},isDropSupported:function(t,e){return!0},isElementDraggable:function(t){return(t=e.getElement(t))._katavorioDrag&&t._katavorioDrag.isEnabled()},getDragObject:function(t){return t[0].drag.getDragElement()},getDragScope:function(t){return t._katavorioDrag&&t._katavorioDrag.scopes.join(" ")||""},getDropEvent:function(t){return t[0].e},getUIPosition:function(t,e){var n=t[0].el;if(null==n.offsetParent)return null;var i=t[0].finalPos||t[0].pos,o={left:i[0],top:i[1]};if(n._katavorioDrag&&n.offsetParent!==this.getContainer()){var s=this.getOffset(n.offsetParent);o.left+=s.left,o.top+=s.top}return o},setDragFilter:function(t,e,n){t._katavorioDrag&&t._katavorioDrag.setFilter(e,n)},setElementDraggable:function(t,n){(t=e.getElement(t))._katavorioDrag&&t._katavorioDrag.setEnabled(n)},setDragScope:function(t,e){t._katavorioDrag&&t._katavorioDrag.k.setDragScope(t,e)},setDropScope:function(t,e){t._katavorioDrop&&t._katavorioDrop.length>0&&t._katavorioDrop[0].k.setDropScope(t,e)},addToPosse:function(t,n){var i=Array.prototype.slice.call(arguments,1),o=s(this);e.each(t,function(t){(t=[e.getElement(t)]).push.apply(t,i),o.addToPosse.apply(o,t)})},setPosse:function(t,n){var i=Array.prototype.slice.call(arguments,1),o=s(this);e.each(t,function(t){(t=[e.getElement(t)]).push.apply(t,i),o.setPosse.apply(o,t)})},removeFromPosse:function(t,n){var i=Array.prototype.slice.call(arguments,1),o=s(this);e.each(t,function(t){(t=[e.getElement(t)]).push.apply(t,i),o.removeFromPosse.apply(o,t)})},removeFromAllPosses:function(t){var n=s(this);e.each(t,function(t){n.removeFromAllPosses(e.getElement(t))})},setPosseState:function(t,n,i){var o=s(this);e.each(t,function(t){o.setPosseState(e.getElement(t),n,i)})},dragEvents:{start:"start",stop:"stop",drag:"drag",step:"step",over:"over",out:"out",drop:"drop",complete:"complete",beforeStart:"beforeStart"},animEvents:{step:"step",complete:"complete"},stopDrag:function(t){t._katavorioDrag&&t._katavorioDrag.abort()},addToDragSelection:function(t){var e=this.getElement(t);null==e||!e._isJsPlumbGroup&&null!=e._jsPlumbGroup||s(this).select(t)},removeFromDragSelection:function(t){s(this).deselect(t)},getDragSelection:function(){return s(this).getSelection()},clearDragSelection:function(){s(this).deselectAll()},trigger:function(t,e,n,i){this.getEventManager().trigger(t,e,n,i)},doReset:function(){for(var t in this)0===t.indexOf("_katavorio_")&&this[t].reset()},getEventManager:function(){return(n=(e=this)._mottle)||(n=e._mottle=new t.Mottle),n;var e,n},on:function(t,e,n){return this.getEventManager().on.apply(this,arguments),this},off:function(t,e,n){return this.getEventManager().off.apply(this,arguments),this}});var m,v;m=e.init,(v=function(){/complete|loaded|interactive/.test(document.readyState)&&void 0!==document.body&&null!=document.body?m():setTimeout(v,9)})()}.call("undefined"!=typeof window?window:s)}(r={exports:{}},r.exports),r.exports),l=(a.jsBezier,a.Biltong,a.Mottle,a.Katavorio,a.jsPlumbUtil,a.jsPlumb);var u=function(t,e,n,i,o,s,r,a,l,u){"boolean"!=typeof r&&(l=a,a=r,r=!1);var c,h="function"==typeof n?n.options:n;if(t&&t.render&&(h.render=t.render,h.staticRenderFns=t.staticRenderFns,h._compiled=!0,o&&(h.functional=!0)),i&&(h._scopeId=i),s?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(s)},h._ssrRegister=c):e&&(c=r?function(){e.call(this,u(this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(h.functional){var d=h.render;h.render=function(t,e){return c.call(e),d(t,e)}}else{var p=h.beforeCreate;h.beforeCreate=p?[].concat(p,c):[c]}return n},c="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());var h=document.head||document.getElementsByTagName("head")[0],d={};var p=function(t){return function(t,e){return function(t,e){var n=c?e.media||"default":t,i=d[n]||(d[n]={ids:new Set,styles:[]});if(!i.ids.has(t)){i.ids.add(t);var o=e.source;if(e.map&&(o+="\n/*# sourceURL="+e.map.sources[0]+" */",o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),i.element||(i.element=document.createElement("style"),i.element.type="text/css",e.media&&i.element.setAttribute("media",e.media),h.appendChild(i.element)),"styleSheet"in i.element)i.styles.push(o),i.element.styleSheet.cssText=i.styles.filter(Boolean).join("\n");else{var s=i.ids.size-1,r=document.createTextNode(o),a=i.element.childNodes;a[s]&&i.element.removeChild(a[s]),a.length?i.element.insertBefore(r,a[s]):i.element.appendChild(r)}}}(t,e)}},f=u({render:function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{staticClass:"palette-panel"},[t._t("palette",function(){return[t._m(0)]})],2)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("ul",{staticClass:"palette-group"},[e("li",[e("div",{staticClass:"palette-default-item startpoint",attrs:{"data-type":"startpoint"}})]),e("li",[e("div",{staticClass:"palette-default-item endpoint",attrs:{"data-type":"endpoint"}})]),e("li",[e("div",{staticClass:"palette-default-item tasknode",attrs:{"data-type":"tasknode"}})]),e("li",[e("div",{staticClass:"palette-default-item gateway",attrs:{"data-type":"gateway"}})])])}]},function(t){t&&t("data-v-09b6e314_0",{source:".palette-group{margin:0;padding:0;background:#fcfcfc;text-align:center;list-style:none}.palette-group>li{padding:14px 0}.palette-default-item{display:inline-block;width:40px;height:40px;font-size:12px;color:#888;border:1px solid #999;border-radius:2px;cursor:pointer;user-select:none}.palette-default-item:hover{box-shadow:0 0 8px rgba(50,50,50,.3)}.startpoint{border-radius:50%;border:4px solid #6a6c8a}.endpoint{border-radius:50%;background:#6a6c8a}.tasknode{height:30px;border:2px solid #33d0c6}.gateway{width:30px;height:30px;background:#7c68fc;transform:rotate(-45deg)}",map:void 0,media:void 0})},{name:"PalettePanel",props:["selector"],data:function(){return{}}},void 0,!1,void 0,p,void 0),g=u({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"tool-panel"},t._l(t.tools,function(e,i){return n("div",{key:i,class:["tool-item",e.cls,{actived:"frameSelect"===e.type&&t.isFrameSelecting}],on:{click:function(n){return t.onToolClick(e)}}},[t._v("\n "+t._s(e.name)+"\n ")])}),0)},staticRenderFns:[]},function(t){t&&t("data-v-2c518942_0",{source:".tool-item{display:inline-block;margin-right:10px;user-select:none;cursor:pointer}.tool-item:last-child{margin-right:0}.tool-item.actived{color:#3a84ff}",map:void 0,media:void 0})},{name:"ToolPanel",props:["tools","isFrameSelecting"],data:function(){return{}},methods:{onToolClick:function(t){this.$emit("onToolClick",t)}}},void 0,!1,void 0,p,void 0),m=u({render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"bk-flow-location",on:{mousedown:this.onMouseDown,mouseup:this.onMouseUp}},["startpoint"===this.node.type?e("div",{staticClass:"circle-node startpoint"}):"endpoint"===this.node.type?e("div",{staticClass:"circle-node endpoint"}):"tasknode"===this.node.type?e("div",{staticClass:"tasknode"}):"gateway"===this.node.type?e("div",{staticClass:"gateway"}):e("div",{staticClass:"node-default"})])},staticRenderFns:[]},function(t){t&&t("data-v-0604134d_0",{source:".bk-flow-location .circle-node{width:30px;height:30px;border-radius:50%;text-align:center}.bk-flow-location .startpoint{border:4px solid #6a6c8a}.bk-flow-location .endpoint{background:#6a6c8a}.bk-flow-location .tasknode{width:80px;height:50px;border:2px solid #33d0c6}.bk-flow-location .gateway{width:30px;height:30px;background:#7c68fc;transform:rotate(-45deg)}.bk-flow-location .node-default{width:120px;height:80px;line-height:80px;border:1px solid #ccc;border-radius:2px;text-align:center}.bk-flow-location .node-default.selected{border:1px solid #3a84ff}",map:void 0,media:void 0})},{name:"NodeTemplate",props:{node:{type:Object,default:function(){return{}}}},data:function(){return{moveFlag:{x:0,y:0,moved:!1}}},methods:{onMouseDown:function(t){this.moveFlag={x:t.pageX,y:t.pageY,moved:!1},this.$el.addEventListener("mousemove",this.mouseMoveHandler)},onMouseUp:function(t){var e=t.pageX,n=t.pageY;this.moveFlag.x=e,this.moveFlag.y=n,this.moveFlag.moved?(console.log("drag event"),this.moveFlag.moved=!1):console.log("click event"),this.$el.removeEventListener("mousemove",this.mouseMoveHandler)},mouseMoveHandler:function(t){var e=t.pageX,n=t.pageY;(Math.abs(e-this.moveFlag.x)>2||Math.abs(n-this.moveFlag.y)>2)&&(this.moveFlag.moved=!0)}}},void 0,!1,void 0,p,void 0);function v(t){return"touches"in t?t.touches[0]:t}var y={grid:[5,5]},b={connector:["Bezier",{curviness:30}],paintStyle:{strokeWidth:2,stroke:"#567567",outlineStroke:"tranparent",outlineWidth:6},hoverPaintStyle:{fill:"transparent",stroke:"#3a84ff"}},P={endpoint:"Dot",connector:["Flowchart",{stub:[1,6],alwaysRespectStub:!0,gap:8,cornerRadius:2}],connectorOverlays:[["PlainArrow",{width:8,length:6,location:1,id:"arrow"}]],paintStyle:{fill:"#3a84ff",radius:5},anchor:["Left","Right","Top","Bottom"],isSource:!0,isTarget:!0};function x(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e="",n=0;n<7;n++)e+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return t+e}var C={showPalette:{type:Boolean,default:!0},showTool:{type:Boolean,default:!0},tools:{type:Array,default:function(){return[{type:"zoomIn",name:"放大",cls:"tool-item"},{type:"zoomOut",name:"缩小",cls:"tool-item"},{type:"resetPosition",name:"重置",cls:"tool-item"}]}},editable:{type:Boolean,default:!0},selector:{type:String,default:"palette-default-item"},data:{type:Object,default:function(){return{nodes:[],lines:[]}}},nodeOptions:{type:Object,default:function(){return e({},y)}},connectorOptions:{type:Object,default:function(){return e({},b)}},endpointOptions:{type:Object,default:function(){return e({},P)}}},_={mousedown:"ontouchstart"in document.documentElement?"touchstart":"mousedown",mousemove:"ontouchmove"in document.documentElement?"touchmove":"mousemove",mouseup:"ontouchend"in document.documentElement?"touchend":"mouseup"},j=u({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["jsflow",{editable:t.editable}]},[n("div",{staticClass:"canvas-area"},[t.showTool?n("div",{staticClass:"tool-panel-wrap"},[t._t("toolPanel",function(){return[n("tool-panel",{attrs:{tools:t.tools,"is-frame-selecting":t.isFrameSelecting},on:{onToolClick:t.onToolClick}})]})],2):t._e(),t.showPalette?n("div",{ref:"palettePanel",staticClass:"palette-panel-wrap"},[t._t("palettePanel",function(){return[n("palette-panel",{attrs:{selector:t.selector}})]})],2):t._e(),n("div",{ref:"canvasFlowWrap",staticClass:"canvas-flow-wrap",style:t.canvasWrapStyle,on:t._d({},[t.mousedown,t.onCanvasMouseDown,t.mouseup,t.onCanvasMouseUp])},[n("div",{ref:"canvasFlow",staticClass:"canvas-flow",attrs:{id:"canvas-flow"}},[t._l(t.nodes,function(e){return n("div",{key:e.id},[n("div",{staticClass:"jsflow-node canvas-node",attrs:{id:e.id},on:{mouseenter:function(n){return t.toggleHighLight(e,!0)},mouseleave:function(n){return t.toggleHighLight(e,!1)}}},[t._t("nodeTemplate",function(){return[n("node-template",{attrs:{node:e}})]},{node:e})],2)])}),n("div",{staticClass:"reference-line-vertical"}),n("div",{staticClass:"reference-line-horizontal"})],2),t.isFrameSelecting?n("div",{staticClass:"canvas-frame-selector",style:t.frameSelectorStyle}):t._e()]),t.showAddingNode?n("div",{staticClass:"jsflow-node adding-node",style:t.setNodeInitialPos(t.addingNodeConfig)},[t._t("nodeTemplate",function(){return[n("node-template",{attrs:{node:t.addingNodeConfig}})]},{node:t.addingNodeConfig})],2):t._e()])])},staticRenderFns:[]},function(t){t&&t("data-v-6bebbff3_0",{source:".jsflow{height:100%;border:1px solid #ccc}.jsflow .canvas-area{position:relative;height:100%}.jsflow .tool-panel-wrap{position:absolute;top:20px;left:70px;padding:10px 20px;background:#c4c6cc;opacity:.65;border-radius:4px;z-index:4}.jsflow .palette-panel-wrap{float:left;width:60px;height:100%;border-right:1px solid #ccc}.jsflow .canvas-flow-wrap{position:relative;height:100%;overflow:hidden}.jsflow .canvas-flow{position:relative;min-width:100%;min-height:100%}.jsflow .canvas-frame-selector{position:absolute;border:1px solid #3a84ff;background:rgba(58,132,255,.15)}.jsflow .jsflow-node{position:absolute;user-select:none}.jsflow .jtk-endpoint{z-index:1;cursor:pointer}.jsflow .adding-node{opacity:.8}.jsflow .jtk-endpoint.jtk-dragging{z-index:0}.jsflow .jtk-connector{cursor:pointer}.jsflow .reference-line-vertical{display:none;position:absolute;top:-100000px;bottom:-100000px;left:0;width:2px;background:rgba(30,144,255,.8);z-index:1}.jsflow .reference-line-horizontal{display:none;position:absolute;left:-100000px;right:-100000px;top:0;height:2px;background:rgba(30,144,255,.8);z-index:1}",map:void 0,media:void 0})},{name:"JsFlow",components:{PalettePanel:f,ToolPanel:g,NodeTemplate:m},model:{prop:"data",event:"change"},props:C,data:function(){var t=this.data;return e({nodes:t.nodes,lines:t.lines,canvasGrabbing:!1,isFrameSelecting:!1,frameMoving:null,mouseDownPos:{},canvasPos:{x:0,y:0},canvasOffset:{x:0,y:0},frameSelectorPos:{x:0,y:0},frameSelectorRect:{width:0,height:0},selectedNodes:[],showAddingNode:!1,addingNodeConfig:{},addingNodeRect:{},canvasRect:{},paletteRect:{},zoom:1,moveTimer:null},_)},computed:{canvasWrapStyle:function(){return{cursor:this.isFrameSelecting?"crosshair":this.canvasGrabbing?"-webkit-grabbing":"-webkit-grab"}},frameSelectorStyle:function(){return{left:"".concat(this.frameSelectorPos.x,"px"),top:"".concat(this.frameSelectorPos.y,"px"),width:"".concat(this.frameSelectorRect.width,"px"),height:"".concat(this.frameSelectorRect.height,"px")}}},watch:{"data.nodes":{handler:function(t){this.nodes=t},deep:!0},editable:function(t){var e=this.$el.querySelectorAll(".canvas-node");this.toggleNodeDraggable(e,t)}},mounted:function(){this.initCanvas(),this.registerEvent(),this.renderData(),this.$refs.palettePanel&&(this.paletteRect=this.$refs.palettePanel.getBoundingClientRect(),this.registerPaletteEvent())},beforeDestroy:function(){this.$refs.palettePanel&&this.$refs.palettePanel.removeEventListener(this.mousedown,this.nodeCreateHandler),this.$el.removeEventListener(this.mousemove,this.nodeMovingHandler),document.removeEventListener(this.mouseup,this.nodeMoveEndHandler)},methods:{initCanvas:function(){var t={},n=e(e({},this.endpointOptions),this.connectorOptions);for(var i in n){var o=i[0].toUpperCase();t["".concat(o).concat(i.slice(1))]=n[i]}this.instance=l.getInstance(e({Container:this.$refs.canvasFlow},t))},registerEvent:function(){var t=this;this.instance.bind("beforeDrag",function(e){return!!t.editable&&("function"!=typeof t.$listeners.onBeforeDrag||t.$listeners.onBeforeDrag(e))}),this.instance.bind("connectionDrag",function(e){"function"==typeof t.$listeners.onConnectionDrag&&t.$emit("onConnectionDrag",e)}),this.instance.bind("beforeDrop",function(e){return!!t.editable&&("function"!=typeof t.$listeners.onBeforeDrop||t.$listeners.onBeforeDrop(e))}),this.instance.bind("connection",function(e){"function"==typeof t.$listeners.onConnection&&t.$emit("onConnection",e)}),this.instance.bind("connectionDragStop",function(e,n){if(!e.target||!e.target.classList.contains("jsflow-node")){var i=t.getNodeByEvent(n.target);if(i){var o=t.nodes.find(function(t){return i.id===t.id});if("function"==typeof t.$listeners.onConnectionDragStop){var s={id:e.source.id,arrow:e.endpoints[0].anchor.type||e.endpoints[0].anchor.cssClass};t.$emit("onConnectionDragOnNode",s,o.id,n)}}"function"==typeof t.$listeners.onConnectionDragStop&&t.$emit("onConnectionDragStop",e)}}),this.instance.bind("beforeDetach",function(e){return"function"!=typeof t.$listeners.onBeforeDetach||t.$listeners.onBeforeDetach(e)}),this.instance.bind("connectionDetached",function(e,n){var i=t.lines.filter(function(t){return t.source.id!==e.sourceId&&t.target.id!==e.targetId});t.lines=i,"function"==typeof t.$listeners.onConnectionDetached&&t.$emit("onConnectionDetached",e)}),this.instance.bind("connectionMoved",function(e,n){"function"==typeof t.$listeners.onConnectionMoved&&t.$emit("onConnectionMoved",lines)}),this.instance.bind("click",function(e,n){"function"==typeof t.$listeners.onConnectionClick&&t.$emit("onConnectionClick",e,n)}),this.instance.bind("dblclick",function(e,n){"function"==typeof t.$listeners.onConnectionDbClick&&t.$emit("onConnectionDbClick",e,n)}),this.instance.bind("endpointClick",function(e,n){"function"==typeof t.$listeners.onEndpointClick&&t.$emit("onEndpointClick",e,n)}),this.instance.bind("endpointDblClick",function(e,n){"function"==typeof t.$listeners.onEndpointDbClick&&t.$emit("onEndpointDbClick",e,n)})},renderData:function(){var t=this;this.instance.batch(function(){t.nodes.forEach(function(e){t.initNode(e)}),t.lines.forEach(function(e){t.createConnector(e,t.connectorOptions)})})},updateCanvas:function(t){this.removeAllConnector(),this.lines=t.lines,this.nodes=t.nodes,this.renderData()},createNode:function(t){var e=this;("function"!=typeof this.$listeners.onCreateNodeBefore||this.$listeners.onCreateNodeBefore(t))&&(this.nodes.push(t),this.$nextTick(function(){e.initNode(t)}))},initNode:function(t){var e=this.$el.querySelector("#".concat(t.id));e.style.left="".concat(t.x,"px"),e.style.top="".concat(t.y,"px"),this.setNodeDraggable(t,this.nodeOptions),this.setNodeEndPoint(t,this.endpointOptions),"function"==typeof this.$listeners.onCreateNodeAfter&&this.$emit("onCreateNodeAfter",t)},removeNode:function(t){var e=this.nodes.findIndex(function(e){return e.id===t.id});this.nodes.splice(e,1),this.instance.remove(t.id)},setNodeEndPoint:function(t,n){var i=this,o=n.anchors||{Top:[.5,0,0,-1,"Top"],Right:[1,.5,1,0,"Right"],Bottom:[.5,1,0,1,"Bottom"],Left:[0,.5,-1,0,"Left"]};Object.keys(o).forEach(function(s){var r=o[s],a=i.instance.addEndpoint(i.$el.querySelector("#".concat(t.id)),e({anchor:r,uuid:s+t.id},n));a&&a.endpoint.canvas&&(a.endpoint.canvas.dataset.pos=s)})},setNodeDraggable:function(t,n){if(this.editable){var o=this;this.instance.draggable(t.id,e({grid:[20,20],drag:function(e){var n=o.instance.getDragSelection().map(function(t){return t.el.id}),i=o.nodes.find(function(e){return t.id===e.id}),s=Object.assign({},i);if(o.toggleHighLight(t,!1),0===n.length)o.setReferenceLine(t.id,e),o.setBoundaryOffset(e);else if(n.some(function(e){return e===t.id})){var r;if(!o.frameMoving){var a,l,u=Math.min.apply(null,o.selectedNodes.map(function(t){return t.x})),c=Math.min.apply(null,o.selectedNodes.map(function(t){return t.y}));o.selectedNodes.some(function(t){if(t.x===u)return a=t,!0}),o.selectedNodes.some(function(t){if(t.y===c)return l=t,!0}),o.frameMoving={left:a,top:l}}(null===(r=o.frameMoving.left)||void 0===r?void 0:r.id)===t.id&&o.setFrameReferLine()}else o.cancelFrameSelectorHandler();o.$emit("onNodeMoving",s,e)},stop:function(e){var n=-1,s=i(e.pos,2),r=s[0],a=s[1],l=o.nodes.find(function(e,i){if(e.id===t.id)return n=i,!0}),u=Object.assign({},l,{x:r,y:a});o.nodes.splice(n,1,u),o.frameMoving=null,o.$emit("onNodeMoveStop",u,e);var c=o.$refs.canvasFlow.querySelector(".reference-line-vertical"),h=o.$refs.canvasFlow.querySelector(".reference-line-horizontal");c.setAttribute("style","display: none; left: 0"),h.setAttribute("style","display: none; top: 0"),clearTimeout(this.moveTimer)}},n))}},setReferenceLine:function(t,e){var n=this,o=e.el,s=o.clientWidth,r=o.clientHeight,a=i(e.pos,2),l=[a[0]+s/2,a[1]+r/2],u=this.$refs.canvasFlow.querySelector(".reference-line-vertical"),c=this.$refs.canvasFlow.querySelector(".reference-line-horizontal");u.setAttribute("style","display: none; left: 0"),c.setAttribute("style","display: none; top: 0");var h=!1,d=!1;this.data.nodes.some(function(e){if(e.id!==t){var i=n.$refs.canvasFlow.querySelector("#".concat(e.id)),o=window.getComputedStyle(i),s=o.width,r=o.height,a=[e.x+Number(s.replace("px",""))/2,e.y+Number(r.replace("px",""))/2];return h||a[0]!==l[0]||(u.setAttribute("style","display: inline-block; left: ".concat(a[0]-1,"px;")),h=!0),d||a[1]!==l[1]||(c.setAttribute("style","display: inline-block; top: ".concat(a[1]-1,"px;")),d=!0),!(!h||!d)||void 0}})},setFrameReferLine:function(){var t=this,e=this.$refs.canvasFlow.querySelector("#".concat(this.frameMoving.left.id)),n=this.$refs.canvasFlow.querySelector("#".concat(this.frameMoving.top.id)),i=Number(window.getComputedStyle(e).left.replace("px","")),o=Number(window.getComputedStyle(n).top.replace("px","")),s=this.$refs.canvasFlow.querySelector(".reference-line-vertical"),r=this.$refs.canvasFlow.querySelector(".reference-line-horizontal");s.setAttribute("style","display: none; left: 0"),r.setAttribute("style","display: none; top: 0");var a=!1,l=!1;this.data.nodes.some(function(e){if(!t.selectedNodes.find(function(t){return t.id===e.id})){var n=[e.x,e.y];return a||n[0]!==i||(s.setAttribute("style","display: inline-block; left: ".concat(i,"px;")),a=!0),l||n[1]!==o||(r.setAttribute("style","display: inline-block; top: ".concat(o,"px;")),l=!0),!(!a||!l)||void 0}})},setBoundaryOffset:function(t){var e=this.$refs.canvasFlowWrap.getBoundingClientRect(),n=e.left,i=e.top,o=e.width,s=e.height;t.e.pageXn+o&&this.intervalMoveCanvas("horizontal",-20),t.e.pageYi+s&&this.intervalMoveCanvas("vertical",-20)},intervalMoveCanvas:function(t,e){var n=this;this.moveTimer&&clearTimeout(this.moveTimer),this.moveTimer=setTimeout(function(){var i=n.canvasOffset,o=i.x,s=i.y;"horizontal"===t?o+=e:s+=e,n.setCanvasPosition(o,s),n.moveTimer||n.intervalMoveCanvas(t,e)},16)},setNodePosition:function(t){var e=this.$el.querySelector("#".concat(t.id));e.style.left="".concat(t.x,"px"),e.style.top="".concat(t.y,"px"),this.instance.revalidate(e)},toggleNodeDraggable:function(t,e){this.instance.setDraggable(t,e)},setNodeInitialPos:function(t){var e={left:"".concat(t.x,"px"),top:"".concat(t.y,"px"),visibility:t.visible?"initial":"hidden"};return 1!==this.zoom&&(e.transform="matrix(".concat(this.zoom,", 0, 0, ").concat(this.zoom,", 0, 0)")),e},createConnector:function(t,n){var i=t.options||{};return this.instance.connect({source:this.$el.querySelector("#".concat(t.source.id)),target:this.$el.querySelector("#".concat(t.target.id)),uuids:[t.source.arrow+t.source.id,t.target.arrow+t.target.id]},e(e({},n),i))},setConnector:function(t,e,n){var i=this;this.instance.getAllConnections().filter(function(n){return n.sourceId===t&&n.targetId===e}).forEach(function(t){t.setConnector(n),i.endpointOptions&&i.endpointOptions.connectorOverlays&&i.endpointOptions.connectorOverlays.forEach(function(e){t.addOverlay(e)})})},removeConnector:function(t){var e=this;this.instance.getConnections({source:t.source.id,target:t.target.id}).forEach(function(t){e.instance.deleteConnection(t)})},removeAllConnector:function(){this.instance.deleteEveryConnection(),this.lines=[]},getConnectorsByNodeId:function(t){return this.instance.getAllConnections().filter(function(e){return e.sourceId===t||e.targetId===t})},getNodeByEvent:function(t){var e=t.parentNode;return!(!e||"HTML"===e.nodeName)&&(e.classList.contains("jsflow-node")?e:this.getNodeByEvent(e))},addLineOverlay:function(t,e){var n=this;this.instance.getConnections({source:t.source.id,target:t.target.id}).forEach(function(t){t.addOverlay([e.type,{label:e.name,location:e.location,cssClass:e.cls,id:e.id,events:{click:function(t,e){n.$emit("onOverlayClick",t,e)}}}])})},removeLineOverlay:function(t,e){this.instance.getConnections({source:t.source.id,target:t.target.id}).forEach(function(t){t.removeOverlay(e)})},onCanvasMouseDown:function(t){"touchstart"!==t.type&&0!==t.button||(t=v(t),this.isFrameSelecting?this.frameSelectHandler(t):(this.canvasGrabbing=!0,this.mouseDownPos={x:t.pageX,y:t.pageY},this.$refs.canvasFlowWrap.addEventListener(this.mousemove,this.canvasFlowMoveHandler,!1)))},canvasFlowMoveHandler:function(t){t=v(t),this.canvasOffset={x:this.canvasPos.x+t.pageX-this.mouseDownPos.x,y:this.canvasPos.y+t.pageY-this.mouseDownPos.y},this.$refs.canvasFlow.style.left="".concat(this.canvasOffset.x,"px"),this.$refs.canvasFlow.style.top="".concat(this.canvasOffset.y,"px"),this.$emit("onCanvasMove",{left:this.canvasOffset.x,top:this.canvasOffset.y})},onCanvasMouseUp:function(t){this.isFrameSelecting?this.frameSelectEndHandler(t):(this.canvasGrabbing=!1,this.$refs.canvasFlowWrap.removeEventListener(this.mousemove,this.canvasFlowMoveHandler),this.canvasPos={x:this.canvasOffset.x,y:this.canvasOffset.y})},registerPaletteEvent:function(){this.$refs.palettePanel.addEventListener(this.mousedown,this.nodeCreateHandler,!1)},nodeCreateHandler:function(t){var n=this,i=function t(e,n){return 1===e.nodeType&&e.classList.contains(n)?e:"HTML"!==e.parentNode.nodeName?t(e.parentNode,n):null}(t.target,this.selector);if(i){var o=i.dataset.type?i.dataset.type:"",s={};for(var r in i.dataset){var a=r.match(/(config)(\w*)/);if(a&&""!==a[2]){var l=a[2],u=l[0].toLowerCase()+l.slice(1);s[u]=i.dataset[r]}}this.showAddingNode=!0,this.addingNodeConfig.id=x("node"),this.addingNodeConfig.type=o,this.$nextTick(function(){var i=n.$el.querySelector(".adding-node");n.addingNodeRect=i.getBoundingClientRect();var r=n.getAddingNodePos(t);n.addingNodeConfig=e({id:x("node"),type:o,x:r.x,y:r.y,adding:!0,visible:!1},s),n.$el.addEventListener(n.mousemove,n.nodeMovingHandler,!1),document.addEventListener(n.mouseup,n.nodeMoveEndHandler,!1)})}},nodeMovingHandler:function(t){var e=this.getAddingNodePos(t);this.$set(this.addingNodeConfig,"x",e.x),this.$set(this.addingNodeConfig,"y",e.y),this.$set(this.addingNodeConfig,"visible",!0),"function"==typeof this.$listeners.onAddNodeMoving&&this.$emit("onAddNodeMoving",{type:this.addingNodeConfig.type,x:e.x,y:e.y})},nodeMoveEndHandler:function(t){if(this.$el.removeEventListener(this.mousemove,this.nodeMovingHandler),document.removeEventListener(this.mouseup,this.nodeMoveEndHandler),this.showAddingNode=!1,t.pageX>this.paletteRect.left+this.paletteRect.width){var e=(this.addingNodeConfig.x-this.paletteRect.width-this.canvasOffset.x+this.addingNodeRect.width*(1-this.zoom)/2)/this.zoom,n=(this.addingNodeConfig.y-this.canvasOffset.y+this.addingNodeRect.height*(1-this.zoom)/2)/this.zoom;this.$set(this.addingNodeConfig,"x",e),this.$set(this.addingNodeConfig,"y",n),delete this.addingNodeConfig.adding,delete this.addingNodeConfig.visible,this.createNode(this.addingNodeConfig)}this.addingNodeConfig={},this.addingNodeRect={}},getAddingNodePos:function(t){return{x:t.pageX-this.paletteRect.left-this.addingNodeRect.width/this.zoom/2,y:t.pageY-this.paletteRect.top-this.addingNodeRect.height/this.zoom/2}},toggleHighLight:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.editable){var i=this.$el.querySelector("#".concat(t.id));this.instance.selectEndpoints({source:i}).each(function(t){var i;n?(i=e.endpointOptions.hoverPaintStyle,t.endpoint.canvas.classList.add("jtk-endpoint-highlight")):(i=e.endpointOptions.paintStyle,t.endpoint.canvas.classList.remove("jtk-endpoint-highlight")),i&&t.setStyle(i)})}},onToolClick:function(t){"function"==typeof this[t.type]&&this[t.type](),this.$emit("onToolClick",t)},setZoom:function(t,e,n){this.instance.setContainer(this.$refs.canvasFlow),this.$refs.canvasFlow.style.transform="matrix("+t+",0,0,"+t+","+e+","+n+")",this.$refs.canvasFlow.style.transformOrigin="0 0",this.$refs.canvasFlow.zoom=t,this.zoom=t,this.instance.setZoom(t)},zoomIn:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1.1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.zoom*t,o=e-e*i,s=n-n*i;i>2||this.setZoom(i,o,s)},zoomOut:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.9,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.zoom*t,o=e-e*i,s=n-n*i;i<.1||this.setZoom(i,o,s)},resetPosition:function(){this.setZoom(1,0,0),this.setCanvasPosition(0,0)},setCanvasPosition:function(t,e){this.canvasOffset={x:t,y:e},this.canvasPos={x:t,y:e},this.$refs.canvasFlow.style.left=this.canvasOffset.x+"px",this.$refs.canvasFlow.style.top=this.canvasOffset.y+"px"},frameSelect:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.isFrameSelecting=t},onOpenFrameSelect:function(){this.frameSelect()},onCloseFrameSelect:function(){this.frameSelect(!1)},frameSelectHandler:function(t){this.canvasRect=this.$refs.canvasFlowWrap.getBoundingClientRect(),this.mouseDownPos={x:t.clientX-this.canvasRect.left,y:t.clientY-this.canvasRect.top},this.$refs.canvasFlowWrap.addEventListener(this.mousemove,this.frameSelectMovingHandler,!1)},frameSelectMovingHandler:function(t){var e=t.clientX-this.mouseDownPos.x-this.canvasRect.left,n=t.clientY-this.mouseDownPos.y-this.canvasRect.top;this.frameSelectorRect={width:Math.abs(e),height:Math.abs(n)},this.frameSelectorPos={x:e>0?this.mouseDownPos.x:this.mouseDownPos.x+e,y:n>0?this.mouseDownPos.y:this.mouseDownPos.y+n}},frameSelectEndHandler:function(t){this.$refs.canvasFlowWrap.removeEventListener(this.mousemove,this.frameSelectMovingHandler),this.$refs.canvasFlowWrap.removeEventListener(this.mouseup,this.frameSelectEndHandler),document.addEventListener(this.mousedown,this.cancelFrameSelectorHandler,{capture:!1,once:!0});var e=this.getSelectedNodes(),n=e.map(function(t){return t.id}),i=this.mouseDownPos,o=i.x,s=i.y;this.isFrameSelecting=!1,this.frameSelectorPos={x:0,y:0},this.frameSelectorRect={width:0,height:0},this.selectedNodes=e,this.clearNodesDragSelection(),this.addNodesToDragSelection(n),this.$emit("onFrameSelectEnd",e.slice(0),o,s)},getSelectedNodes:function(){var t=this,e=this.frameSelectorPos,n=e.x,i=e.y,o=this.frameSelectorRect,s=o.width,r=o.height;return this.nodes.filter(function(e){var o=t.$el.querySelector("#".concat(e.id)).getBoundingClientRect(),a=o.left-t.canvasRect.left,l=o.top-t.canvasRect.top;if(na&&il)return!0})},cancelFrameSelectorHandler:function(t){this.selectedNodes=[],this.clearNodesDragSelection(),this.$emit("onCloseFrameSelect")},addNodesToDragSelection:function(t){var e=this;t.forEach(function(t){var n=e.$el.querySelector("#".concat(t));n&&n.classList.add("selected")}),this.instance.addToDragSelection(t)},clearNodesDragSelection:function(){this.$el.querySelectorAll(".jsflow-node.selected").forEach(function(t){t.classList.remove("selected")}),this.instance.clearDragSelection()}}},void 0,!1,void 0,p,void 0);"undefined"!=typeof window&&"Vue"in window&&window.Vue.component("js-flow",j);export default j; diff --git a/frontend/desktop/src/components/common/FullCodeEditor.vue b/frontend/desktop/src/components/common/FullCodeEditor.vue index 9838bd1481..d32fe7d74b 100644 --- a/frontend/desktop/src/components/common/FullCodeEditor.vue +++ b/frontend/desktop/src/components/common/FullCodeEditor.vue @@ -31,6 +31,7 @@ -
+
{{scheme.name || scheme.attrs.name}} - {{ scheme.tag_code }} + {{ scheme.tag_code }} +
.rf-form-group { position: relative; + margin-top: 15px; &.added { background: rgba(220,255,226,0.30); } @@ -376,7 +425,15 @@ background: #ffeeec; } &.rf-has-hook .rf-tag-form { - margin-right: 64px; + margin-right: 40px; + } + &.show-render { + > .rf-tag-form { + margin-right: 58px; + } + .hook-icon { + padding-right: 3px !important; + } } .rf-group-name { display: block @@ -392,22 +449,22 @@ } .rf-tag-hook { position: absolute; - top: 0; + top: 30px; right: 0; display: flex; align-items: center; - justify-content: space-between; - padding: 0 8px; - width: 56px; + justify-content: center; height: 32px; background: #f0f1f5; border-radius: 2px; + cursor: pointer; z-index: 1; .hook-icon, .render-skip-icon { - font-size: 16px; + height: 32px; + line-height: 32px; + font-size: 12px; color: #979ba5; - cursor: pointer; &.disabled { color: #c4c6cc; cursor: not-allowed; @@ -417,7 +474,20 @@ } } .hook-icon { - font-size: 19px; + line-height: 33px; + padding: 0 8px; + font-size: 16px; + } + .render-skip-icon { + padding: 0 8px 0 3px; + } + .icon-angle-up-fill { + font-size: 12px; + color: #c4c6cc; + margin: 3px 0 0 6px; + } + &.hide-render-icon { + justify-content: center; } } .tag-label-tips { diff --git a/frontend/desktop/src/components/common/RenderForm/FormItem.vue b/frontend/desktop/src/components/common/RenderForm/FormItem.vue index c48778ccde..6d53b47681 100644 --- a/frontend/desktop/src/components/common/RenderForm/FormItem.vue +++ b/frontend/desktop/src/components/common/RenderForm/FormItem.vue @@ -20,6 +20,7 @@ { 'rf-has-hook': option.showHook, 'show-label': option.showLabel, + 'show-render': isShowRenderIcon, 'rf-view-mode': !option.formMode, 'rf-col-layout': scheme.attrs.cols, 'rf-section-item': scheme.type === 'section' @@ -39,8 +40,8 @@
{{scheme.name || scheme.attrs.name}} - - {{ scheme.tag_code }} + * + {{ scheme.tag_code }} -
+
.rf-form-item { position: relative; - margin: 15px 0; + margin-top: 15px; min-height: 32px; font-size: 12px; color: #63656e; @@ -550,14 +477,21 @@ } &.rf-has-hook { & > .rf-tag-form { - margin-right: 64px; + margin-right: 40px; + } + } + &.show-render { + > .rf-tag-form { + margin-right: 58px; + } + .hook-icon { + padding-right: 3px !important; } } &.rf-col-layout { display: inline-block; - margin: 0; padding-right: 10px; - vertical-align: top; + vertical-align: text-bottom; } &.rf-view-mode { margin: 8px 0; @@ -571,6 +505,11 @@ &.deleted { background: #ffeeec; } + .required { + color: #F00; + margin-left: 5px; + font-family: "SimSun"; + } .rf-tag-label { float: left; position: relative; @@ -581,14 +520,6 @@ text-align: right; word-wrap: break-word; word-break: break-all; - .required { - position: absolute; - top: 2px; - right: -10px; - color: #F00; - margin-left: 5px; - font-family: "SimSun"; - } .tag-label-tips { position: relative; &::after { @@ -620,17 +551,17 @@ display: flex; align-items: center; justify-content: space-between; - padding: 0 8px; - width: 56px; height: 32px; background: #f0f1f5; border-radius: 2px; z-index: 1; + cursor: pointer; .hook-icon, .render-skip-icon { - font-size: 14px; + height: 32px; + line-height: 32px; + font-size: 12px; color: #979ba5; - cursor: pointer; &.disabled { color: #c4c6cc; cursor: not-allowed; @@ -640,7 +571,20 @@ } } .hook-icon { - font-size: 19px; + line-height: 31px; + padding: 0 8px; + font-size: 16px; + } + .render-skip-icon { + padding: 0 8px 0 3px; + } + .icon-angle-up-fill { + font-size: 12px; + color: #c4c6cc; + margin: 3px 0 0 6px; + } + &.hide-render-icon { + justify-content: center; } } .rf-view-value { diff --git a/frontend/desktop/src/components/common/RenderForm/IpSelector/DynamicGroup.vue b/frontend/desktop/src/components/common/RenderForm/IpSelector/DynamicGroup.vue index 0b97fa3192..ac7b02848a 100644 --- a/frontend/desktop/src/components/common/RenderForm/IpSelector/DynamicGroup.vue +++ b/frontend/desktop/src/components/common/RenderForm/IpSelector/DynamicGroup.vue @@ -44,7 +44,8 @@ :class="['selected-item', { 'disabled': !editable }]" v-for="item in selectedGroups" :key="item.id"> - {{ item.name }} +
{{ item.name }}
+ {{ $t('失效') }}
@@ -179,6 +180,25 @@ position: relative; padding: 0 28px 0 8px; line-height: 32px; + display: flex; + align-items: center; + .group-name { + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + } + .invalid { + flex-shrink: 0; + height: 20px; + line-height: 15px; + padding: 2px 5px; + margin-left: 5px; + transform: scale(0.8); + color: #63656e; + background: #f0f1f5; + border: 1px solid #c4c6cc; + border-radius: 2px; + } &.disabled { color: #ccc; cursor: not-allowed; @@ -188,6 +208,11 @@ color: #dcdee6; } } + .invalid { + color: #ccc; + background-color: #fafbfd; + border-color: #dcdee5; + } } } .common-icon-dark-circle-close { diff --git a/frontend/desktop/src/components/common/RenderForm/IpSelector/DynamicIp.vue b/frontend/desktop/src/components/common/RenderForm/IpSelector/DynamicIp.vue index fca0b65c1e..9a47fd2859 100644 --- a/frontend/desktop/src/components/common/RenderForm/IpSelector/DynamicIp.vue +++ b/frontend/desktop/src/components/common/RenderForm/IpSelector/DynamicIp.vue @@ -44,10 +44,10 @@
- {{ item.namePath }} - +
{{ item.namePath }}
+ {{ $t('失效') }} +
@@ -90,8 +90,12 @@ this.$refs.topoTree.setChecked(item, { checked: false }) this.getCheckedNodeInfo(this.topoList, item) if (this.checkedNode) { - this.checkedNode.id = this.checkedNode.uniqueId - this.onNodeCheckClick(this.selectedIps, this.checkedNode, false) + if (this.checkedNode.id !== this.checkedNode.uniqueId) { + this.checkedNode.id = this.checkedNode.uniqueId + this.onNodeCheckClick(this.selectedIps, this.checkedNode, false) + } else { + this.selectedNodeList.push(item) + } } }) }) @@ -157,6 +161,8 @@ if (selectedNode) { const namePath = this.getNodeNamePath(selectedNode) selectedIpsPath.push({ key, namePath }) + } else { + selectedIpsPath.push({ key, namePath: key.split('_').join('/'), diff: true }) } }) this.selectedIpsPath = selectedIpsPath @@ -333,9 +339,25 @@ position: relative; padding: 0 28px 0 8px; line-height: 32px; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; + display: flex; + align-items: center; + .ip-path { + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + } + .invalid { + flex-shrink: 0; + height: 20px; + line-height: 15px; + padding: 2px 5px; + margin-left: 5px; + transform: scale(0.8); + color: #63656e; + background: #f0f1f5; + border: 1px solid #c4c6cc; + border-radius: 2px; + } &.disabled { color: #ccc; cursor: not-allowed; @@ -345,6 +367,11 @@ color: #dcdee6; } } + .invalid { + color: #ccc; + background-color: #fafbfd; + border-color: #dcdee5; + } } } .common-icon-dark-circle-close { diff --git a/frontend/desktop/src/components/common/RenderForm/IpSelector/IpSelectorTable.vue b/frontend/desktop/src/components/common/RenderForm/IpSelector/IpSelectorTable.vue index 42db940faa..f433b6446d 100644 --- a/frontend/desktop/src/components/common/RenderForm/IpSelector/IpSelectorTable.vue +++ b/frontend/desktop/src/components/common/RenderForm/IpSelector/IpSelectorTable.vue @@ -21,11 +21,15 @@ :sortable="columnInfo.sortable" :prop="columnInfo.id">