import{_ as Xb}from"./Dialog-f2c6d513.js";import{cS as gr,cQ as Yh,dr as Kb,d as ke,r as X,q as ja,e as vl,ds as Yb,b as fo,h as wn,a1 as Jb,o as nt,c as Nt,C as Ot,aL as Zb,F as qe,f as R,B as V,a as D,A as St,E as Tt,G as dt,D as Jh,l as Va,a0 as We,bg as Qb,bh as br,bc as t0,dt as e0,L as xr,x as n0,w as le,cu as Bt,a6 as hn,S as dn,U as Vn,n as Ne,as as Zh,v as yl,Q as Er,R as _r,P as wr,aZ as vo,aQ as i0,bS as r0,Z as o0,am as Qh,i as Sr,_ as Fa,V as za,W as $a,cg as gl,aE as a0,aw as s0}from"./index-b9299550.js";import{_ as c0}from"./XTextButton-02e014ca.js";import{_ as Cr}from"./XButton-eeb68bf5.js";import{E as l0,a as u0}from"./el-collapse-item-a9544d23.js";import{E as bl}from"./el-link-db0f9114.js";import{u as td}from"./useMessage-903d430d.js";import{E as ed}from"./el-drawer-1f465c5d.js";import{a as nd,D as id}from"./dict-fc5218c3.js";import{f as Tr}from"./formatTime-988372b6.js";var xl={exports:{}};typeof Object.create=="function"?xl.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:xl.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}};const rt=gr(xl.exports);var rd,El,p0=(rd=function(t){var e=t.exports=function(n,i){if(i||(i=16),n===void 0&&(n=128),n<=0)return"0";for(var r=Math.log(Math.pow(2,n))/Math.log(i),o=2;r===1/0;o*=2)r=Math.log(Math.pow(2,n/o))/Math.log(i)*o;var a=r-Math.floor(r),c="";for(o=0;o=Math.pow(2,n)?e(n,i):c};e.rack=function(n,i,r){var o=function(c){var l=0;do{if(l++>10){if(!r)throw new Error("too many ID collisions, use more bits");n+=r}var u=e(n,i)}while(Object.hasOwnProperty.call(a,u));return a[u]=c,u},a=o.hats={};return o.get=function(c){return o.hats[c]},o.set=function(c,l){return o.hats[c]=l,o},o.bits=n||128,o.base=i||16,o}},rd(El={exports:{}},El.exports),El.exports);function Sn(t){if(!(this instanceof Sn))return new Sn(t);t=t||[128,36,1],this._seed=t.length?p0.rack(t[0],t[1],t[2]):t}function yo(t){return Array.prototype.concat.apply([],t)}Sn.prototype.next=function(t){return this._seed(t||!0)},Sn.prototype.nextPrefixed=function(t,e){var n;do n=t+this.next(!0);while(this.assigned(n));return this.claim(n,e),n},Sn.prototype.claim=function(t,e){this._seed.set(t,e||!0)},Sn.prototype.assigned=function(t){return this._seed.get(t)||!1},Sn.prototype.unclaim=function(t){delete this._seed.hats[t]},Sn.prototype.clear=function(){var t,e=this._seed.hats;for(t in e)this.unclaim(t)};var go=Object.prototype.toString,h0=Object.prototype.hasOwnProperty;function Fn(t){return t===void 0}function Xe(t){return t!==void 0}function bo(t){return t==null}function gt(t){return go.call(t)==="[object Array]"}function Jt(t){return go.call(t)==="[object Object]"}function ht(t){return go.call(t)==="[object Number]"}function fe(t){var e=go.call(t);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"||e==="[object Proxy]"}function Ie(t){return go.call(t)==="[object String]"}function od(t){if(!gt(t))throw new Error("must supply array")}function Cn(t,e){return h0.call(t,e)}function kt(t,e){var n;return e=Cl(e),L(t,function(i,r){if(e(i,r))return n=i,!1}),n}function _l(t,e){e=Cl(e);var n=gt(t)?-1:void 0;return L(t,function(i,r){if(e(i,r))return n=r,!1}),n}function mt(t,e){var n=[];return L(t,function(i,r){e(i,r)&&n.push(i)}),n}function L(t,e){var n;if(!Fn(t)){var i=gt(t)?m0:d0;for(var r in t)if(Cn(t,r)&&e(n=t[r],i(r))===!1)return n}}function ad(t,e){return Fn(t)?[]:(od(t),e=Cl(e),t.filter(function(n,i){return!e(n,i)}))}function De(t,e,n){return L(t,function(i,r){n=e(n,i,r)}),n}function $i(t,e){return!!De(t,function(n,i,r){return n&&e(i,r)},!0)}function ui(t,e){return!!kt(t,e)}function ae(t,e){var n=[];return L(t,function(i,r){n.push(e(i,r))}),n}function xo(t){return t&&Object.keys(t)||[]}function Ar(t){return xo(t).length}function Ga(t){return ae(t,function(e){return e})}function Gi(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e=Sl(e),L(t,function(i){var r=e(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function wl(t){t=Sl(t);for(var e={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r0)return c(y);t.apply(r,i),l()}function c(p){n=setTimeout(a,p)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function u(){o=Date.now();for(var p=arguments.length,d=new Array(p),y=0;y1?e-1:0),i=1;i1?n-1:0),r=1;r
a',hd=!Ml.getElementsByTagName("link").length,Ml=void 0);var ie={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:hd?[1,"X
","
"]:[0,"",""]};function Ut(t,e){return(e=e||document).querySelector(t)}function Rl(t,e){return(e=e||document).querySelectorAll(t)}function Tn(t){t.parentNode&&t.parentNode.removeChild(t)}function dd(t,e){return e.appendChild(function(n,i){if(n.ownerDocument!==i.ownerDocument)try{return i.ownerDocument.importNode(n,!0)}catch{}return n}(t,e))}function lt(t,e){return dd(e,t),t}ie.td=ie.th=[3,"","
"],ie.option=ie.optgroup=[1,'"],ie.thead=ie.tbody=ie.colgroup=ie.caption=ie.tfoot=[1,"","
"],ie.polyline=ie.ellipse=ie.polygon=ie.circle=ie.text=ie.line=ie.path=ie.rect=ie.g=[1,'',""];var md={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function fd(t,e,n){var i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=md[i];r?(r===2&&typeof n=="number"&&(n=String(n)+"px"),t.style[i]=n):t.setAttributeNS(null,e,n)}function K(t,e,n){if(typeof e=="string"){if(n===void 0)return function(i,r){return md[r]?i.style[r]:i.getAttributeNS(null,r)}(t,e);fd(t,e,n)}else(function(i,r){var o,a,c=Object.keys(r);for(o=0;a=c[o];o++)fd(i,a,r[a])})(t,e);return t}function Nl(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n"+t+"",e=!0);var n=function(o){var a;return(a=new DOMParser).async=!1,a.parseFromString(o,"text/xml")}(t);if(!e)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function ot(t,e){var n;return t.charAt(0)==="<"?(n=gd(t).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Bl,t),e&&K(n,e),n}var Ol=null;function Ll(){return Ol===null&&(Ol=ot("svg")),Ol}function bd(t,e){var n,i,r=Object.keys(e);for(n=0;i=r[n];n++)t[i]=e[i];return t}function Eo(t){return t?Ll().createSVGTransformFromMatrix(t):Ll().createSVGTransform()}var xd=/([&<>]{1})/g,_0=/([\n\r"]{1})/g,w0={"&":"&","<":"<",">":">",'"':"'"};function jl(t,e){return t.replace(e,function(n,i){return w0[i]||i})}function Ed(t,e){var n,i,r,o,a;switch(t.nodeType){case 3:e.push(jl(t.textContent,xd));break;case 1:if(e.push("<",t.tagName),t.hasAttributes())for(n=0,i=(r=t.attributes).length;n"),n=0,i=(a=t.childNodes).length;n")}else e.push("/>");break;case 8:e.push("");break;case 4:e.push("");break;default:throw new Error("unable to handle node "+t.nodeType)}return e}function S0(t,e){var n=gd(e);if(Dl(t),e){(function(a){return a.nodeName==="#document-fragment"})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o ");return n.length=0,new Error(v?f+" (Resolving: "+v+")":f)},c=function(f,v){if(!i[f]&&f.indexOf(".")!==-1){for(var g=f.split("."),b=c(g.shift());g.length;)b=b[g.shift()];return b}if(Fl(r,f))return r[f];if(Fl(i,f)){if(n.indexOf(f)!==-1)throw n.push(f),a("Cannot resolve circular dependency!");return n.push(f),r[f]=i[f][0](i[f][1]),n.pop(),r[f]}return e.get(f,v)},l=function(f,v){if(v===void 0&&(v={}),typeof f!="function"){if(!Vl(f))throw new Error('Cannot invoke "'+f+'". Expected a function!');f=qa(f.slice())}return{fn:f,dependencies:(f.$inject||M0(f)).map(function(g){return Fl(v,g)?v[g]:c(g)})}},u=function(f){var v=l(f),g=v.fn,b=v.dependencies;return new(Function.prototype.bind.apply(g,[null].concat(b)))},p=function(f,v,g){var b=l(f,g),E=b.fn,S=b.dependencies;return E.apply(v,S)},d=function(f){return qa(function(v){return f.get(v)})},y={factory:p,type:u,value:function(f){return f}};t.forEach(function(f){function v(S,w){return S!=="value"&&Vl(w)&&(w=qa(w.slice())),w}if(f instanceof R0)f.forEach(function(S){var w=S[0],C=S[1],B=S[2];i[w]=[y[C],v(C,B),C]});else if(typeof f=="object")if(f.__exports__){var g=Object.keys(f).reduce(function(S,w){return w.substring(0,2)!=="__"&&(S[w]=f[w]),S},Object.create(null)),b=new zl((f.__modules__||[]).concat([g]),o),E=qa(function(S){return b.get(S)});f.__exports__.forEach(function(S){i[S]=[E,S,"private",b]})}else Object.keys(f).forEach(function(S){if(f[S][2]!=="private"){var w=f[S][0],C=f[S][1];i[S]=[y[w],v(w,C),w]}else i[S]=f[S]})}),this.get=c,this.invoke=p,this.instantiate=u,this.createChild=function(f,v){if(v&&v.length){var g,b,E,S,w=Object.create(null),C=Object.create(null),B=[],s=[],h=[];for(var m in i)g=i[m],v.indexOf(m)!==-1&&(g[2]==="private"?(b=B.indexOf(g[3]))===-1?(E=g[3].createChild([],v),S=d(E),B.push(g[3]),s.push(E),h.push(S),w[m]=[S,m,"private",E]):w[m]=[h[b],m,"private",s[b]]:w[m]=[g[2],g[1]],C[m]=!0),g[2]!=="factory"&&g[2]!=="type"||!g[1].$scope||v.forEach(function(_){g[1].$scope.indexOf(_)!==-1&&(w[m]=[g[2],g[1]],C[_]=!0)});v.forEach(function(_){if(!C[_])throw new Error('No provider for "'+_+'". Cannot use provider from the parent!')}),f.unshift(w)}return new zl(f,o)}}function $n(t,e){var n=this;e=e||1e3,t.on(["render.shape","render.connection"],e,function(i,r){var o=i.type,a=r.element,c=r.gfx,l=r.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(c,a,l):n.drawConnection(c,a,l)}),t.on(["render.getShapePath","render.getConnectionPath"],e,function(i,r){if(n.canRender(r))return i.type==="render.getShapePath"?n.getShapePath(r):n.getConnectionPath(r)})}function Pr(t){return t.join(",").replace(/,?([A-z]),?/g,"$1")}function wd(t){for(var e,n="",i=0;e=t[i];i++)n+=e.x+","+e.y+" ";return n}function $l(t,e){var n=ot("polyline");return K(n,{points:wd(t)}),e&&K(n,e),n}function Sd(t){return mt(t,function(e){return!kt(t,function(n){return n!==e&&Cd(e,n)})})}function Cd(t,e){if(e){if(t===e)return e;if(t.parent)return Cd(t.parent,e)}}function Td(t,e,n){var i=!n||t.indexOf(e)===-1;return i&&t.push(e),i}function Hi(t,e,n){n=n||0,gt(t)||(t=[t]),L(t,function(i,r){var o=e(i,r,n);gt(o)&&o.length&&Hi(o,e,n+1)})}function Wa(t,e){return function(n,i,r){var o=[],a=[];return Hi(n,function(c,l,u){Td(o,c,i);var p=c.children;if((r===-1||ur||r===void 0)&&(r=l+d),(u+p>o||o===void 0)&&(o=u+p)}),{x:n,y:i,height:o-i,width:r-n}}function Ad(t){return"waypoints"in t?"connection":"x"in t?"shape":"root"}function kd(t){return!(!t||!t.isFrame)}function wo(t,e){return z({},t||{},e||{})}$n.prototype.canRender=function(){},$n.prototype.drawShape=function(){},$n.prototype.drawConnection=function(){},$n.prototype.getShapePath=function(){},$n.prototype.getConnectionPath=function(){};function di(t,e){$n.call(this,t,1),this.CONNECTION_STYLE=e.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=e.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=e.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}rt(di,$n),di.prototype.canRender=function(){return!0},di.prototype.drawShape=function(t,e,n){var i=ot("rect");return K(i,{x:0,y:0,width:e.width||0,height:e.height||0}),kd(e)?K(i,z({},this.FRAME_STYLE,n||{})):K(i,z({},this.SHAPE_STYLE,n||{})),lt(t,i),i},di.prototype.drawConnection=function(t,e,n){var i=$l(e.waypoints,z({},this.CONNECTION_STYLE,n||{}));return lt(t,i),i},di.prototype.getShapePath=function(t){var e=t.x,n=t.y,i=t.width;return Pr([["M",e,n],["l",i,0],["l",0,t.height],["l",-i,0],["z"]])},di.prototype.getConnectionPath=function(t){var e,n,i=t.waypoints,r=[];for(e=0;n=i[e];e++)n=n.original||n,r.push([e===0?"M":"L",n.x,n.y]);return Pr(r)},di.$inject=["eventBus","styles"];const N0={__init__:["defaultRenderer"],defaultRenderer:["type",di],styles:["type",function(){var t={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},e=this;this.cls=function(n,i,r){return z(this.style(i,r),{class:n})},this.style=function(n,i){gt(n)||i||(i=n,n=[]);var r=De(n,function(o,a){return z(o,t[a]||{})},{});return i?z(r,i):r},this.computeStyle=function(n,i,r){return gt(i)||(r=i,i=[]),e.style(i||[],z({},r,n||{}))}}]};function Wt(t,e){if(!t||!e)return-1;var n=t.indexOf(e);return n!==-1&&t.splice(n,1),n}function Xt(t,e,n){if(t&&e){typeof n!="number"&&(n=-1);var i=t.indexOf(e);if(i!==-1){if(i===n||n===-1)return;t.splice(i,1)}n!==-1?t.splice(n,0,e):t.push(e)}}function Gl(t,e){return t&&e?t.indexOf(e):-1}function So(t,e){return t&&e?Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):-1}function Ul(t,e,n,i){if(i===void 0&&(i=5),!t||!e||!n)return!1;var r=(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x),o=So(t,e);return Math.abs(r/o)<=i}function Gn(t,e){var n;return function(i,r){var o;o=gt(i)?i:[i,r];var a=o.slice().shift();return $i(o,function(c){return Math.abs(a.y-c.y)<=2})}(n=gt(t)?t:[t,e])?"h":!!function(i,r){var o;o=gt(i)?i:[i,r];var a=o.slice().shift();return $i(o,function(c){return Math.abs(a.x-c.x)<=2})}(n)&&"v"}function Pd(t,e,n){return n=n||0,t.x>e.x-n&&t.y>e.y-n&&t.x=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height}function Bd(t,e,n,i,r){return t*(t*(-3*e+9*n-9*i+3*r)+6*e-12*n+6*i)-3*e+3*n}function Od(t,e,n,i,r,o,a,c,l){l==null&&(l=1);for(var u=(l=l>1?1:l<0?0:l)/2,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],y=0,f=0;f<12;f++){var v=u*p[f]+u,g=Bd(v,t,n,r,a),b=Bd(v,e,i,o,c),E=g*g+b*b;y+=d[f]*Kt.sqrt(E)}return u*y}function O0(t,e,n,i,r,o,a,c){if(!(kn(t,n)kn(r,a)||kn(e,i)kn(o,c))){var l=(t*i-e*n)*(o-c)-(e-i)*(r*c-o*a),u=(t-n)*(o-c)-(e-i)*(r-a);if(u){var p=Ya(((t*i-e*n)*(r-a)-(t-n)*(r*c-o*a))/u),d=Ya(l/u),y=+p.toFixed(2),f=+d.toFixed(2);if(!(y<+An(t,n).toFixed(2)||y>+kn(t,n).toFixed(2)||y<+An(r,a).toFixed(2)||y>+kn(r,a).toFixed(2)||f<+An(e,i).toFixed(2)||f>+kn(e,i).toFixed(2)||f<+An(o,c).toFixed(2)||f>+kn(o,c).toFixed(2)))return{x:p,y:d}}}}function Ya(t){return Math.round(1e11*t)/1e11}function L0(t,e,n){if(!function(m,_){return m=Wl(m),vi(_=Wl(_),m.x,m.y)||vi(_,m.x2,m.y)||vi(_,m.x,m.y2)||vi(_,m.x2,m.y2)||vi(m,_.x,_.y)||vi(m,_.x2,_.y)||vi(m,_.x,_.y2)||vi(m,_.x2,_.y2)||(m.x<_.x2&&m.x>_.x||_.xm.x)&&(m.y<_.y2&&m.y>_.y||_.ym.y)}(Dd(t),Dd(e)))return n?0:[];for(var i=Od.apply(0,t),r=Od.apply(0,e),o=Ld(t)?1:~~(i/5)||1,a=Ld(e)?1:~~(r/5)||1,c=[],l=[],u={},p=n?0:[],d=0;d=0&&s<=1&&h>=0&&h<=1&&(n?p++:p.push({x:B.x,y:B.y,t1:s,t2:h}))}}return p}function j0(t){var e=Mr(t);if(e.abs)return Ka(e.abs);if(Xa(t)&&Xa(t&&t[0])||(t=function(E){if(!E)return null;var S=Mr(E);if(S.arr)return Co(S.arr);var w={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},C=[];return Xa(E)&&Xa(E[0])&&(C=Co(E)),C.length||String(E).replace(D0,function(B,s,h){var m=[],_=s.toLowerCase();for(h.replace(B0,function(T,M){M&&m.push(+M)}),_=="m"&&m.length>2&&(C.push([s].concat(m.splice(0,2))),_="l",s=s=="m"?"l":"L");m.length>=w[_]&&(C.push([s].concat(m.splice(0,w[_]))),w[_]););}),C.toString=Mr.toString,S.arr=Co(C),C}(t)),!t||!t.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,c=0,l=0;t[0][0]=="M"&&(a=r=+t[0][1],c=o=+t[0][2],l++,i[0]=["M",r,o]);for(var u,p,d=l,y=t.length;d=1e3&&delete oe[se.shift()],se.push(Et),oe[Et]=d.apply(0,qt),oe[Et])});if(u)m=u[0],_=u[1],s=u[2],h=u[3];else{t=(p=g(t,e,-f)).x,e=p.y;var b=(t-(c=(p=g(c,l,-f)).x))/2,E=(e-(l=p.y))/2,S=b*b/(n*n)+E*E/(i*i);S>1&&(n*=S=Kt.sqrt(S),i*=S);var w=n*n,C=i*i,B=(o==a?-1:1)*Kt.sqrt(fi((w*C-w*E*E-C*b*b)/(w*E*E+C*b*b))),s=B*n*E/i+(t+c)/2,h=B*-i*b/n+(e+l)/2,m=Kt.asin(((e-h)/i).toFixed(9)),_=Kt.asin(((l-h)/i).toFixed(9));(m=t_&&(m-=2*mi),!a&&_>m&&(_-=2*mi)}var T=_-m;if(fi(T)>y){var M=_,I=c,$=l;_=m+y*(a&&_>m?1:-1),v=Vd(c=s+n*Kt.cos(_),l=h+i*Kt.sin(_),n,i,r,0,a,I,$,[_,M,s,h])}T=_-m;var P=Kt.cos(m),x=Kt.sin(m),N=Kt.cos(_),j=Kt.sin(_),G=Kt.tan(T/4),W=4/3*n*G,tt=4/3*i*G,it=[t,e],at=[t+W*x,e-tt*P],H=[c+W*j,l-tt*N],q=[c,l];if(at[0]=2*it[0]-at[0],at[1]=2*it[1]-at[1],u)return[at,H,q].concat(v);for(var jt=[],Ht=0,he=(v=[at,H,q].concat(v).join().split(",")).length;Ht7){f[v].shift();for(var g=f[v];g.length;)a[v]="A",f.splice(v++,0,["C"].concat(g.splice(0,6)));f.splice(v,1),p=n.length}},a=[],c="",l="",u=0,p=n.length;u=r.right,c=i.top-n.y>=r.bottom,l=o?"top":c?"bottom":null,u=i.right+n.x<=r.left?"left":a?"right":null;return u&&l?l+"-"+u:u||l||"intersect"}function Kl(t,e,n){var i=zd(t,e);return i.length===1||i.length===2&&So(i[0],i[1])<1?qi(i[0]):i.length>1?(i=Ke(i,function(r){var o=Math.floor(100*r.t2)||1;return o=((o=100-o)<10?"0":"")+o,r.segment2+"#"+o}),qi(i[n?0:i.length-1])):null}function Za(t,e){return Math.round(t*e)/e}function Gd(t){return ht(t)?t+"px":t}function Ud(t,e,n){var i=ot("g");bt(i).add(e);var r=n!==void 0?n:t.childNodes.length-1;return t.insertBefore(i,t.childNodes[r]||null),i}var Qa="base",Yl="djs-element-hidden",F0={shape:["x","y","width","height"],connection:["waypoints"]};function yt(t,e,n,i){this._eventBus=e,this._elementRegistry=i,this._graphicsFactory=n,this._init(t||{})}function Hd(t,e){var n="matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")";t.setAttribute("transform",n)}yt.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],yt.prototype._init=function(t){var e=this._eventBus,n=this._container=function(o){var a=(o=z({},{width:"100%",height:"100%"},o)).container||document.body,c=document.createElement("div");return c.setAttribute("class","djs-container"),z(c.style,{position:"relative",overflow:"hidden",width:Gd(o.width),height:Gd(o.height)}),a.appendChild(c),c}(t),i=this._svg=ot("svg");K(i,{width:"100%",height:"100%"}),lt(n,i);var r=this._viewport=Ud(i,"viewport");this._layers={},this._planes={},t.deferUpdate!==!1&&(this._viewboxChanged=Tl(_e(this._viewboxChanged,this),300)),e.on("diagram.init",function(){e.fire("canvas.init",{svg:i,viewport:r})},this),e.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","plane.set"],function(){delete this._cachedViewbox},this),e.on("diagram.destroy",500,this._destroy,this),e.on("diagram.clear",500,this._clear,this)},yt.prototype._destroy=function(t){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._activePlane,delete this._viewport},yt.prototype._clear=function(){var t=this;this._elementRegistry.getAll().forEach(function(e){var n=Ad(e);n==="root"?t.setRootElementForPlane(null,t.findPlane(e),!0):t._removeElement(e,n)}),this._activePlane=null,this._planes={},delete this._cachedViewbox},yt.prototype.getDefaultLayer=function(){return this.getLayer(Qa,0)},yt.prototype.getLayer=function(t,e){if(!t)throw new Error("must specify a name");var n=this._layers[t];if(n||(n=this._layers[t]=this._createLayer(t,e)),e!==void 0&&n.index!==e)throw new Error("layer <"+t+"> already created at index <"+e+">");return n.group},yt.prototype._createLayer=function(t,e){e===void 0&&(e=1);var n=De(this._layers,function(i,r){return e>=r.index&&i++,i},0);return{group:Ud(this._viewport,"layer-"+t,n),index:e}},yt.prototype.getPlane=function(t){if(!t)throw new Error("must specify a name");return this._planes[t]},yt.prototype.createPlane=function(t,e){if(!t)throw new Error("must specify a name");if(this._planes[t])throw new Error("plane "+t+" already exists");e||(e={id:"__implicitroot"+t,children:[],isImplicit:!0});var n=this.getLayer(t,0);bt(n).add(Yl);var i=this._planes[t]={layer:n,name:t,rootElement:null};return this.setRootElementForPlane(e,i),i},yt.prototype.setActivePlane=function(t){if(!t)throw new Error("must specify a plane");return typeof t=="string"&&(t=this.getPlane(t)),this._activePlane&&bt(this._activePlane.layer).add(Yl),this._activePlane=t,bt(t.layer).remove(Yl),t.rootElement&&this._elementRegistry.updateGraphics(t.rootElement,this._svg,!0),this._eventBus.fire("plane.set",{plane:t}),t},yt.prototype.getActiveLayer=function(){return this.getActivePlane().layer},yt.prototype.getActivePlane=function(){var t=this._activePlane;return t||(t=this.createPlane(Qa),this.setActivePlane(Qa)),t},yt.prototype.findPlane=function(t){typeof t=="string"&&(t=this._elementRegistry.get(t));var e=function(n){for(;n.parent;)n=n.parent;return n}(t);return kt(this._planes,function(n){return n.rootElement===e})},yt.prototype.getContainer=function(){return this._container},yt.prototype._updateMarker=function(t,e,n){var i;t.id||(t=this._elementRegistry.get(t)),(i=this._elementRegistry._elements[t.id])&&(L([i.gfx,i.secondaryGfx],function(r){r&&(n?bt(r).add(e):bt(r).remove(e))}),this._eventBus.fire("element.marker.update",{element:t,gfx:i.gfx,marker:e,add:!!n}))},yt.prototype.addMarker=function(t,e){this._updateMarker(t,e,!0)},yt.prototype.removeMarker=function(t,e){this._updateMarker(t,e,!1)},yt.prototype.hasMarker=function(t,e){return t.id||(t=this._elementRegistry.get(t)),bt(this.getGraphics(t)).has(e)},yt.prototype.toggleMarker=function(t,e){this.hasMarker(t,e)?this.removeMarker(t,e):this.addMarker(t,e)},yt.prototype.getRootElement=function(){return this.getActivePlane().rootElement},yt.prototype.setRootElement=function(t,e){var n=this._activePlane;if(n)return this.setRootElementForPlane(t,n,e);var i=this.createPlane(Qa,t);return this.setActivePlane(i),i.rootElement},yt.prototype.setRootElementForPlane=function(t,e,n){typeof e=="string"&&(e=this.getPlane(e)),t&&this._ensureValid("root",t);var i=e.rootElement,r=this._elementRegistry,o=this._eventBus;if(i){if(!n)throw new Error("rootElement already set, need to specify override");o.fire("root.remove",{element:i}),o.fire("root.removed",{element:i}),r.remove(i)}if(t){var a=e.layer;o.fire("root.add",{element:t}),r.add(t,a),o.fire("root.added",{element:t,gfx:a}),e===this._activePlane&&this._elementRegistry.updateGraphics(t,this._svg,!0)}return e.rootElement=t,t},yt.prototype._ensureValid=function(t,e){if(!e.id)throw new Error("element must have an id");if(this._elementRegistry.get(e.id))throw new Error("element with id "+e.id+" already exists");var n=F0[t],i=$i(n,function(r){return e[r]!==void 0});if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+t)},yt.prototype._setParent=function(t,e,n){Xt(e.children,t,n),t.parent=e},yt.prototype._addElement=function(t,e,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(t,e),r.fire(t+".add",{element:e,parent:n}),this._setParent(e,n,i);var a=o.create(t,e,i);return this._elementRegistry.add(e,a),o.update(t,e,a),r.fire(t+".added",{element:e,gfx:a}),e},yt.prototype.addShape=function(t,e,n){return this._addElement("shape",t,e,n)},yt.prototype.addConnection=function(t,e,n){return this._addElement("connection",t,e,n)},yt.prototype._removeElement=function(t,e){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(t=n.get(t.id||t))return r.fire(e+".remove",{element:t}),i.remove(t),Wt(t.parent&&t.parent.children,t),t.parent=null,r.fire(e+".removed",{element:t}),n.remove(t),t},yt.prototype.removeShape=function(t){return this._removeElement(t,"shape")},yt.prototype.removeConnection=function(t){return this._removeElement(t,"connection")},yt.prototype.getGraphics=function(t,e){return this._elementRegistry.getGraphics(t,e)},yt.prototype._changeViewbox=function(t){this._eventBus.fire("canvas.viewbox.changing"),t.apply(this),this._cachedViewbox=null,this._viewboxChanged()},yt.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},yt.prototype.viewbox=function(t){if(t===void 0&&this._cachedViewbox)return this._cachedViewbox;var e,n,i,r,o,a,c=this._viewport,l=this.getSize();return t?(this._changeViewbox(function(){r=Math.min(l.width/t.width,l.height/t.height);var u=this._svg.createSVGMatrix().scale(r).translate(-t.x,-t.y);_o(c,u)}),t):(e=this._activePlane&&this._activePlane.layer.getBBox()||{},n=(i=_o(c))?i.matrix:function(u,p,d,y,f,v){var g=Ll().createSVGMatrix();switch(arguments.length){case 0:return g;case 1:return bd(g,u);case 6:return bd(g,{a:u,b:p,c:d,d:y,e:f,f:v})}}(),r=Za(n.a,1e3),o=Za(-n.e||0,1e3),a=Za(-n.f||0,1e3),t=this._cachedViewbox={x:o?o/r:0,y:a?a/r:0,width:l.width/r,height:l.height/r,scale:r,inner:{width:e.width||0,height:e.height||0,x:e.x||0,y:e.y||0},outer:l})},yt.prototype.scroll=function(t){var e=this._viewport,n=e.getCTM();return t&&this._changeViewbox(function(){t=z({dx:0,dy:0},t||{}),n=this._svg.createSVGMatrix().translate(t.dx,t.dy).multiply(n),Hd(e,n)}),{x:n.e,y:n.f}},yt.prototype.scrollToElement=function(t,e){var n=100;typeof t=="string"&&(t=this._elementRegistry.get(t));var i=this.findPlane(t);i!==this._activePlane&&this.setActivePlane(i),e||(e={}),typeof e=="number"&&(n=e),e={top:e.top||n,right:e.right||n,bottom:e.bottom||n,left:e.left||n};var r,o,a=ve(t),c=st(a),l=this.viewbox(),u=this.zoom();l.y+=e.top/u,l.x+=e.left/u,l.width-=(e.right+e.left)/u,l.height-=(e.bottom+e.top)/u;var p=st(l);if(a.width=0&&o.y>=0&&o.x+o.width<=r.width&&o.y+o.height<=r.height&&!t?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(e=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(t?o.width/2-r.width/e/2:0),y:o.y+(t?o.height/2-r.height/e/2:0),width:r.width/e,height:r.height/e}),this.viewbox(n),this.viewbox(!1).scale},yt.prototype._setZoom=function(t,e){var n,i,r,o,a=this._svg,c=this._viewport,l=a.createSVGMatrix(),u=a.createSVGPoint(),p=(i=c.getCTM()).a;return e?(n=z(u,e).matrixTransform(i.inverse()),r=l.translate(n.x,n.y).scale(1/p*t).translate(-n.x,-n.y),o=i.multiply(r)):o=l.scale(t),Hd(this._viewport,o),o},yt.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},yt.prototype.getAbsoluteBBox=function(t){var e,n=this.viewbox();return t.waypoints?e=this.getGraphics(t).getBBox():e=t,{x:e.x*n.scale-n.x*n.scale,y:e.y*n.scale-n.y*n.scale,width:e.width*n.scale,height:e.height*n.scale}},yt.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Rr="data-element-id";function Ge(t){this._elements={},this._eventBus=t}Ge.$inject=["eventBus"],Ge.prototype.add=function(t,e,n){var i=t.id;this._validateId(i),K(e,Rr,i),n&&K(n,Rr,i),this._elements[i]={element:t,gfx:e,secondaryGfx:n}},Ge.prototype.remove=function(t){var e=this._elements,n=t.id||t,i=n&&e[n];i&&(K(i.gfx,Rr,""),i.secondaryGfx&&K(i.secondaryGfx,Rr,""),delete e[n])},Ge.prototype.updateId=function(t,e){this._validateId(e),typeof t=="string"&&(t=this.get(t)),this._eventBus.fire("element.updateId",{element:t,newId:e});var n=this.getGraphics(t),i=this.getGraphics(t,!0);this.remove(t),t.id=e,this.add(t,n,i)},Ge.prototype.updateGraphics=function(t,e,n){var i=t.id||t,r=this._elements[i];return n?r.secondaryGfx=e:r.gfx=e,K(e,Rr,i),e},Ge.prototype.get=function(t){var e;e=typeof t=="string"?t:t&&K(t,Rr);var n=this._elements[e];return n&&n.element},Ge.prototype.filter=function(t){var e=[];return this.forEach(function(n,i){t(n,i)&&e.push(n)}),e},Ge.prototype.find=function(t){for(var e=this._elements,n=Object.keys(e),i=0;i in ref");e=this.props[e]}e.collection?Wd(this,e,t):function(n,i,r){var o=i.inverse,a=r[i.name];Object.defineProperty(r,i.name,{configurable:i.configurable,enumerable:i.enumerable,get:function(){return a},set:function(c){if(c!==a){var l=a;a=null,l&&n.unset(l,o,r),a=c,n.set(a,o,r)}}})}(this,e,t)},yi.prototype.ensureRefsCollection=function(t,e){var n=t[e.name];return qd.isExtended(n)||Wd(this,e,t),n},yi.prototype.ensureBound=function(t,e){(function(n,i){return Object.prototype.hasOwnProperty.call(n,i.name||i)})(t,e)||this.bind(t,e)},yi.prototype.unset=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?this.ensureRefsCollection(t,e).remove(n):t[e.name]=void 0)},yi.prototype.set=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?this.ensureRefsCollection(t,e).add(n):t[e.name]=n)};var z0=yi;Jl.exports=z0,Jl.exports.Collection=ts;const Nr=gr(Jl.exports);var Xd=new Nr({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Kd=new Nr({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Yd=new Nr({name:"attachers",collection:!0},{name:"host"}),Jd=new Nr({name:"outgoing",collection:!0},{name:"source"}),Zd=new Nr({name:"incoming",collection:!0},{name:"target"});function To(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(t){var e=this.label,n=this.labels;!t&&e?n.remove(e):n.add(t,0)}}),Xd.bind(this,"parent"),Kd.bind(this,"labels"),Jd.bind(this,"outgoing"),Zd.bind(this,"incoming")}function Ir(){To.call(this),Xd.bind(this,"children"),Yd.bind(this,"host"),Yd.bind(this,"attachers")}function Qd(){Ir.call(this)}function es(){Ir.call(this),Kd.bind(this,"labelTarget")}function tm(){To.call(this),Jd.bind(this,"source"),Zd.bind(this,"target")}rt(Ir,To),rt(Qd,Ir),rt(es,Ir),rt(tm,To);var $0={connection:tm,shape:Ir,label:es,root:Qd};function Un(){this._uid=12}Un.prototype.createRoot=function(t){return this.create("root",t)},Un.prototype.createLabel=function(t){return this.create("label",t)},Un.prototype.createShape=function(t){return this.create("shape",t)},Un.prototype.createConnection=function(t){return this.create("connection",t)},Un.prototype.create=function(t,e){return(e=z({},e||{})).id||(e.id=t+"_"+this._uid++),function(n,i){var r=$0[n];if(!r)throw new Error("unknown type: <"+n+">");return z(new r,i)}(t,e)};var ns="__fn",G0=Array.prototype.slice;function Be(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Ao(){}function is(t){return t.childNodes[0]}function Zl(t,e,n,i,r){var o=Eo();o.setTranslate(e,n);var a=Eo();a.setRotate(i||0,0,0);var c=Eo();c.setScale(r||1,r||1),_o(t,[o,a,c])}function Oe(t,e,n){var i=Eo();i.setTranslate(e,n),_o(t,i)}function em(t,e){var n=Eo();n.setRotate(e,0,0),_o(t,n)}function Ue(t,e){this._eventBus=t,this._elementRegistry=e}function nm(t,e,n){var i=n||e.firstChild;t!==i&&e.insertBefore(t,i)}Be.prototype.on=function(t,e,n,i){if(t=gt(t)?t:[t],fe(e)&&(i=n,n=e,e=1e3),!ht(e))throw new Error("priority must be a number");var r=n;i&&((r=_e(n,i))[ns]=n[ns]||n);var o=this;t.forEach(function(a){o._addListener(a,{priority:e,callback:r,next:null})})},Be.prototype.once=function(t,e,n,i){var r=this;if(fe(e)&&(i=n,n=e,e=1e3),!ht(e))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(i,arguments);return r.off(t,o),a}o[ns]=n,this.on(t,e,o)},Be.prototype.off=function(t,e){t=gt(t)?t:[t];var n=this;t.forEach(function(i){n._removeListener(i,e)})},Be.prototype.createEvent=function(t){var e=new Ao;return e.init(t),e},Be.prototype.fire=function(t,e){var n,i,r,o;if(o=G0.call(arguments),typeof t=="object"&&(t=(e=t).type),!t)throw new Error("no event type specified");if(i=this._listeners[t]){n=e instanceof Ao?e:this.createEvent(e),o[0]=n;var a=n.type;t!==a&&(n.type=t);try{r=this._invokeListeners(n,o,i)}finally{t!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},Be.prototype.handleError=function(t){return this.fire("error",{error:t})===!1},Be.prototype._destroy=function(){this._listeners={}},Be.prototype._invokeListeners=function(t,e,n){for(var i;n&&!t.cancelBubble;)i=this._invokeListener(t,e,n),n=n.next;return i},Be.prototype._invokeListener=function(t,e,n){var i;if(n.callback.__isTomb)return i;try{i=function(r,o){return r.apply(null,o)}(n.callback,e),i!==void 0&&(t.returnValue=i,t.stopPropagation()),i===!1&&t.preventDefault()}catch(r){if(!this.handleError(r))throw r}return i},Be.prototype._addListener=function(t,e){var n,i=this._getListeners(t);if(i){for(;i;){if(i.priority=0}t.forEach(function o(a){i(a)||((a.__depends__||[]).forEach(o),i(a)||(function(c){e.push(c)}(a),(a.__init__||[]).forEach(function(c){n.push(c)})))});var r=new zl(e);return n.forEach(function(o){try{r[typeof o=="string"?"get":"invoke"](o)}catch(a){throw a}}),r}function Dr(t,e){this.injector=e=e||function(n){return H0([{config:["value",n=n||{}]},U0].concat(n.modules||[]))}(t),this.get=e.get,this.invoke=e.invoke,this.get("eventBus").fire("diagram.init")}function Ql(){}function im(t,e){this.model=t,this.properties=e}Dr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Dr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Ql.prototype.get=function(t){return this.$model.properties.get(this,t)},Ql.prototype.set=function(t,e){this.$model.properties.set(this,t,e)},im.prototype.createType=function(t){var e=this.model,n=this.properties,i=Object.create(Ql.prototype);L(t.properties,function(a){a.isMany||a.default===void 0||(i[a.name]=a.default)}),n.defineModel(i,e),n.defineDescriptor(i,t);var r=t.ns.name;function o(a){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),L(a,_e(function(c,l){this.set(l,c)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,e),n.defineDescriptor(o,t),o};var q0={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},rm={String:function(t){return t},Boolean:function(t){return t==="true"},Integer:function(t){return parseInt(t,10)},Real:function(t){return parseFloat(t)}};function tu(t,e){var n=rm[t];return n?n(e):e}function eu(t){return!!q0[t]}function om(t){return!!rm[t]}function Pe(t,e){var n,i,r=t.split(/:/);if(r.length===1)n=t,i=e;else{if(r.length!==2)throw new Error("expected or , got "+t);n=r[1],i=r[0]}return{name:t=(i?i+":":"")+n,prefix:i,localName:n}}function Ze(t){this.ns=t,this.name=t.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function gi(t,e){this.packageMap={},this.typeMap={},this.packages=[],this.properties=e,L(t,_e(this.registerPackage,this))}function am(t,e,n){var i=e[n];if(i in t)throw new Error("package with "+n+" <"+i+"> already defined")}function Br(t){this.model=t}function sm(t,e,n){Object.defineProperty(t,e.name,{enumerable:!e.isReference,writable:!0,value:n,configurable:!0})}function Qe(t){this.properties=new Br(this),this.factory=new im(this,this.properties),this.registry=new gi(t,this.properties),this.typeCache={}}Ze.prototype.build=function(){return Je(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Ze.prototype.addProperty=function(t,e,n){typeof e=="boolean"&&(n=e,e=void 0),this.addNamedProperty(t,n!==!1);var i=this.properties;e!==void 0?i.splice(e,0,t):i.push(t)},Ze.prototype.replaceProperty=function(t,e,n){var i=t.ns,r=this.properties,o=this.propertiesByName,a=t.name!==e.name;if(t.isId){if(!e.isId)throw new Error("property <"+e.ns.name+"> must be id property to refine <"+t.ns.name+">");this.setIdProperty(e,!1)}if(t.isBody){if(!e.isBody)throw new Error("property <"+e.ns.name+"> must be body property to refine <"+t.ns.name+">");this.setBodyProperty(e,!1)}var c=r.indexOf(t);if(c===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(c,1),this.addProperty(e,n?void 0:c,a),o[i.name]=o[i.localName]=e},Ze.prototype.redefineProperty=function(t,e,n){var i=t.ns.prefix,r=e.split("#"),o=Pe(r[0],i),a=Pe(r[1],o.prefix).name,c=this.propertiesByName[a];if(!c)throw new Error("refined property <"+a+"> not found");this.replaceProperty(c,t,n),delete t.redefines},Ze.prototype.addNamedProperty=function(t,e){var n=t.ns,i=this.propertiesByName;e&&(this.assertNotDefined(t,n.name),this.assertNotDefined(t,n.localName)),i[n.name]=i[n.localName]=t},Ze.prototype.removeNamedProperty=function(t){var e=t.ns,n=this.propertiesByName;delete n[e.name],delete n[e.localName]},Ze.prototype.setBodyProperty=function(t,e){if(e&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+t.ns.name+">)");this.bodyProperty=t},Ze.prototype.setIdProperty=function(t,e){if(e&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+t.ns.name+">)");this.idProperty=t},Ze.prototype.assertNotDefined=function(t,e){var n=t.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+t.definedBy.ns.name+"#"+t.ns.name+"> not allowed without redefines")},Ze.prototype.hasProperty=function(t){return this.propertiesByName[t]},Ze.prototype.addTrait=function(t,e){var n=this.allTypesByName,i=this.allTypes,r=t.name;r in n||(L(t.properties,_e(function(o){o=z({},o,{name:o.ns.localName,inherited:e}),Object.defineProperty(o,"definedBy",{value:t});var a=o.replaces,c=o.redefines;a||c?this.redefineProperty(o,a||c,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(t),n[r]=t)},gi.prototype.getPackage=function(t){return this.packageMap[t]},gi.prototype.getPackages=function(){return this.packages},gi.prototype.registerPackage=function(t){t=z({},t);var e=this.packageMap;am(e,t,"prefix"),am(e,t,"uri"),L(t.types,_e(function(n){this.registerType(n,t)},this)),e[t.uri]=e[t.prefix]=t,this.packages.push(t)},gi.prototype.registerType=function(t,e){var n=Pe((t=z({},t,{superClass:(t.superClass||[]).slice(),extends:(t.extends||[]).slice(),properties:(t.properties||[]).slice(),meta:z(t.meta||{})})).name,e.prefix),i=n.name,r={};L(t.properties,_e(function(o){var a=Pe(o.name,n.prefix),c=a.name;eu(o.type)||(o.type=Pe(o.type,a.prefix).name),z(o,{ns:a,name:c}),r[c]=o},this)),z(t,{ns:n,name:i,propertiesByName:r}),L(t.extends,_e(function(o){var a=this.typeMap[o];a.traits=a.traits||[],a.traits.push(i)},this)),this.definePackage(t,e),this.typeMap[i]=t},gi.prototype.mapTypes=function(t,e,n){var i=eu(t.name)?{name:t.name}:this.typeMap[t.name],r=this;function o(c){return a(c,!0)}function a(c,l){var u=Pe(c,eu(c)?"":t.prefix);r.mapTypes(u,e,l)}if(!i)throw new Error("unknown type <"+t.name+">");L(i.superClass,n?o:a),e(i,!n),L(i.traits,o)},gi.prototype.getEffectiveDescriptor=function(t){var e=Pe(t),n=new Ze(e);this.mapTypes(e,function(r,o){n.addTrait(r,o)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},gi.prototype.definePackage=function(t,e){this.properties.define(t,"$pkg",{value:e})},Br.prototype.set=function(t,e,n){if(!Ie(e)||!e.length)throw new TypeError("property name must be a non-empty string");var i=this.model.getPropertyDescriptor(t,e),r=i&&i.name;n===void 0?i?delete t[r]:delete t.$attrs[e]:i?r in t?t[r]=n:sm(t,i,n):t.$attrs[e]=n},Br.prototype.get=function(t,e){var n=this.model.getPropertyDescriptor(t,e);if(!n)return t.$attrs[e];var i=n.name;return!t[i]&&n.isMany&&sm(t,n,[]),t[i]},Br.prototype.define=function(t,e,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(t,e,n)},Br.prototype.defineDescriptor=function(t,e){this.define(t,"$descriptor",{value:e})},Br.prototype.defineModel=function(t,e){this.define(t,"$model",{value:e})},Qe.prototype.create=function(t,e){var n=this.getType(t);if(!n)throw new Error("unknown type <"+t+">");return new n(e)},Qe.prototype.getType=function(t){var e=this.typeCache,n=Ie(t)?t:t.ns.name,i=e[n];return i||(t=this.registry.getEffectiveDescriptor(n),i=e[n]=this.factory.createType(t)),i},Qe.prototype.createAny=function(t,e,n){var i=Pe(t),r={$type:t,$instanceOf:function(a){return a===this.$type}},o={name:t,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:e}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),L(n,function(a,c){Jt(a)&&a.value!==void 0?r[a.name]=a.value:r[c]=a}),r},Qe.prototype.getPackage=function(t){return this.registry.getPackage(t)},Qe.prototype.getPackages=function(){return this.registry.getPackages()},Qe.prototype.getElementDescriptor=function(t){return t.$descriptor},Qe.prototype.hasType=function(t,e){return e===void 0&&(e=t,t=this),e in t.$model.getElementDescriptor(t).allTypesByName},Qe.prototype.getPropertyDescriptor=function(t,e){return this.getElementDescriptor(t).propertiesByName[e]},Qe.prototype.getTypeDescriptor=function(t){return this.registry.typeMap[t]};var W0=String.fromCharCode,X0=Object.prototype.hasOwnProperty,K0=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,ko={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Y0(t,e,n,i){return i?X0.call(ko,i)?ko[i]:"&"+i+";":W0(e||parseInt(n,16))}function Wi(t){return t.length>3&&t.indexOf("&")!==-1?t.replace(K0,Y0):t}Object.keys(ko).forEach(function(t){ko[t.toUpperCase()]=ko[t]});var cm="xsi:type",lm="non-whitespace outside of root node";function Or(t){return new Error(t)}function um(t){return"missing namespace for prefix <"+t+">"}function rs(t){return{get:t,enumerable:!0}}function J0(t){var e,n={};for(e in t)n[e]=t[e];return n}function nu(t){return t+"$uri"}function pm(){return{line:0,column:0}}function Z0(t){throw t}function hm(t){if(!this)return new hm(t);var e,n,i,r,o,a,c,l,u,p=t&&t.proxy,d=Z0,y=pm,f=!1,v=!1,g=null,b=!1;function E(w){w instanceof Error||(w=Or(w)),g=w,d(w,y)}function S(w){o&&(w instanceof Error||(w=Or(w)),o(w,y))}this.on=function(w,C){if(typeof C!="function")throw Or("required args ");switch(w){case"openTag":n=C;break;case"text":e=C;break;case"closeTag":i=C;break;case"error":d=C;break;case"warn":o=C;break;case"cdata":r=C;break;case"attention":l=C;break;case"question":c=C;break;case"comment":a=C;break;default:throw Or("unsupported event: "+w)}return this},this.ns=function(w){if(w===void 0&&(w={}),typeof w!="object")throw Or("required args ");var C,B={};for(C in w)B[C]=w[C];return B["http://www.w3.org/2001/XMLSchema-instance"]="xsi",v=!0,u=B,this},this.parse=function(w){if(typeof w!="string")throw Or("required args ");return g=null,function(C){var B,s,h,m,_,T,M,I,$,P,x,N=v?[]:null,j=v?function(Vt){var qt,Et,oe={};for(qt in Vt)oe[Et=Vt[qt]]=Et,oe[nu(Et)]=qt;return oe}(u):null,G=[],W=0,tt=!1,it=!1,at=0,H=0,q="",jt=0;function Ht(){if(x!==null)return x;var Vt,qt,Et,oe,se,Mt,de,_t,Te,pt,It,ii=v&&j.xmlns,ri=v&&f?[]:null,Yt=jt,Ae=q,Ln=Ae.length,oi={},Ra={};t:for(;Yt8)){for((pt<65||pt>122||pt>90&&pt<97)&&pt!==95&&pt!==58&&(S("illegal first char attribute name"),Te=!0),It=Yt+1;It96&&pt<123||pt>64&&pt<91||pt>47&&pt<59||pt===46||pt===45||pt===95)){if(pt===32||pt<14&&pt>8){S("missing attribute value"),Yt=It;continue t}if(pt===61)break;S("illegal attribute name char"),Te=!0}if((_t=Ae.substring(Yt,It))==="xmlns:xmlns"&&(S("illegal declaration of xmlns"),Te=!0),(pt=Ae.charCodeAt(It+1))===34)(It=Ae.indexOf('"',Yt=It+2))===-1&&(It=Ae.indexOf("'",Yt))!==-1&&(S("attribute value quote missmatch"),Te=!0);else if(pt===39)(It=Ae.indexOf("'",Yt=It+2))===-1&&(It=Ae.indexOf('"',Yt))!==-1&&(S("attribute value quote missmatch"),Te=!0);else for(S("missing attribute value quotes"),Te=!0,It+=1;It8);It++);for(It===-1&&(S("missing closing quotes"),It=Ln,Te=!0),Te||(Mt=Ae.substring(Yt,It)),Yt=It;It+18);It++)Yt===It&&(S("illegal character after attribute end"),Te=!0);if(Yt=It+1,!Te)if(_t in Ra)S("attribute <"+_t+"> already defined");else if(Ra[_t]=!0,v)if(f){if((se=_t==="xmlns"?"xmlns":_t.charCodeAt(0)===120&&_t.substr(0,6)==="xmlns:"?_t.substr(6):null)!==null){if(Vt=Wi(Mt),qt=nu(se),!(de=u[Vt])){if(se==="xmlns"||qt in j&&j[qt]!==Vt)do de="ns"+W++;while(j[de]!==void 0);else de=se;u[Vt]=de}j[se]!==de&&(oe||(j=J0(j),oe=!0),j[se]=de,se==="xmlns"&&(j[nu(de)]=Vt,ii=de),j[qt]=Vt),oi[_t]=Mt;continue}ri.push(_t,Mt)}else(pt=_t.indexOf(":"))!==-1?(Et=j[_t.substring(0,pt)])?((_t=ii===Et?_t.substr(pt+1):Et+_t.substr(pt))===cm&&((pt=Mt.indexOf(":"))!==-1?(Et=Mt.substring(0,pt),Mt=(Et=j[Et]||Et)+Mt.substring(pt)):Mt=ii+":"+Mt),oi[_t]=Mt):S(um(_t.substring(0,pt))):oi[_t]=Mt;else oi[_t]=Mt}if(f)for(Yt=0,Ln=ri.length;Yt=Mt&&(Vt=Et.exec(C))&&!((de=Vt[0].length+Vt.index)>at);)oe+=1,Mt=de;return at==-1?(se=de,qt=C.substring(H)):H===0?qt=C.substring(H,at):(se=at-Mt,qt=H==-1?C.substring(at):C.substring(at,H+1)),{data:qt,line:oe,column:se}}for(y=he,p&&(P=Object.create({},{name:rs(function(){return I}),originalName:rs(function(){return $}),attrs:rs(Ht),ns:rs(function(){return j})}));H!==-1;){if((at=C.charCodeAt(H)===60?H:C.indexOf("<",H))===-1)return G.length?E("unexpected end of file"):H===0?E("missing start tag"):void(H",at))===-1)return E("unclosed cdata");if(r&&(r(C.substring(at+9,H),y),b))return;H+=3;continue}if(m===45&&C.charCodeAt(at+3)===45){if((H=C.indexOf("-->",at))===-1)return E("unclosed comment");if(a&&(a(C.substring(at+4,H),Wi,y),b))return;H+=3;continue}}if(_!==63){for(s=at+1;;s++){if(T=C.charCodeAt(s),isNaN(T))return H=-1,E("unclosed tag");if(T===34)s=(m=C.indexOf('"',s+1))!==-1?m:s;else if(T===39)s=(m=C.indexOf("'",s+1))!==-1?m:s;else if(T===62){H=s;break}}if(_!==33){if(x={},_===47){if(tt=!1,it=!0,!G.length)return E("missing open tag");if(s=I=G.pop(),m=at+2+s.length,C.substring(at+2,m)!==s)return E("closing tag mismatch");for(;m8&&_<14))return E("close tag")}else{if(C.charCodeAt(H-1)===47?(s=I=C.substring(at+1,H-1),tt=!0,it=!0):(s=I=C.substring(at+1,H),tt=!0,it=!1),!(_>96&&_<123||_>64&&_<91||_===95||_===58))return E("illegal first char nodeName");for(m=1,h=s.length;m96&&_<123||_>64&&_<91||_>47&&_<59||_===45||_===95||_==46)){if(_===32||_<14&&_>8){I=s.substring(0,m),x=null;break}return E("invalid nodeName")}it||G.push(I)}if(v){if(B=j,tt&&(it||N.push(B),x===null&&(f=s.indexOf("xmlns",m)!==-1)&&(jt=m,q=s,Ht(),f=!1)),$=I,(_=I.indexOf(":"))!==-1){if(!(M=j[I.substring(0,_)]))return E("missing namespace on <"+$+">");I=I.substr(_+1)}else M=j.xmlns;M&&(I=M+":"+I)}if(tt&&(jt=m,q=s,n&&(p?n(P,Wi,it,y):n(I,Ht,Wi,it,y),b)))return;if(it){if(i&&(i(p?P:I,Wi,tt,y),b))return;v&&(j=tt?B:N.pop())}H+=1}else{if(l&&(l(C.substring(at,H+1),Wi,y),b))return;H+=1}}else{if((H=C.indexOf("?>",at))===-1)return E("unclosed question");if(c&&(c(C.substring(at,H+2),y),b))return;H+=2}}}(w),y=pm,b=!1,g},this.stop=function(){b=!0}}function dm(t){return t.xml&&t.xml.tagAlias==="lowerCase"}var Q0={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},os="xsi:type";function mm(t){return t.xml&&t.xml.serialize}function fm(t){return mm(t)===os}function vm(t,e){return dm(e)?t.prefix+":"+((n=t.localName).charAt(0).toUpperCase()+n.slice(1)):t.name;var n}function bi(t){return new Error(t)}function Hn(t){return t.$descriptor}function tx(t){z(this,t),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw bi("expected element");var n,i=this.elementsById,r=Hn(e).idProperty;if(r&&(n=e.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(n))throw new Error("illegal ID <"+n+">");if(i[n])throw bi("duplicate ID <"+n+">");i[n]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Po(){}function iu(){}function Lr(){}function Mo(t,e){this.property=t,this.context=e}function ru(t,e){this.element=e,this.propertyDesc=t}function as(){}function we(t,e,n){this.model=t,this.type=t.getType(e),this.context=n}function ou(t,e,n){we.call(this,t,e,n)}function jr(t,e,n){this.model=t,this.context=n}function au(t){t instanceof Qe&&(t={model:t}),z(this,{lax:!1},t)}Po.prototype.handleEnd=function(){},Po.prototype.handleText=function(){},Po.prototype.handleNode=function(){},iu.prototype=Object.create(Po.prototype),iu.prototype.handleNode=function(){return this},Lr.prototype=Object.create(Po.prototype),Lr.prototype.handleText=function(t){this.body=(this.body||"")+t},Mo.prototype=Object.create(Lr.prototype),Mo.prototype.handleNode=function(t){if(this.element)throw bi("expected no sub nodes");return this.element=this.createReference(t),this},Mo.prototype.handleEnd=function(){this.element.id=this.body},Mo.prototype.createReference=function(t){return{property:this.property.ns.name,id:""}},ru.prototype=Object.create(Lr.prototype),ru.prototype.handleEnd=function(){var t=this.body||"",e=this.element,n=this.propertyDesc;t=tu(n.type,t),n.isMany?e.get(n.name).push(t):e.set(n.name,t)},as.prototype=Object.create(Lr.prototype),as.prototype.handleNode=function(t){var e=this,n=this.element;return n?e=this.handleChild(t):(n=this.element=this.createElement(t),this.context.addElement(n)),e},we.prototype=Object.create(as.prototype),we.prototype.addReference=function(t){this.context.addReference(t)},we.prototype.handleText=function(t){if(!Hn(this.element).bodyProperty)throw bi("unexpected body text <"+t+">");Lr.prototype.handleText.call(this,t)},we.prototype.handleEnd=function(){var t=this.body,e=this.element,n=Hn(e).bodyProperty;n&&t!==void 0&&(t=tu(n.type,t),e.set(n.name,t))},we.prototype.createElement=function(t){var e,n=t.attributes,i=this.type,r=Hn(i),o=this.context,a=new i({}),c=this.model;return L(n,function(l,u){var p=r.propertiesByName[u];p&&p.isReference?p.isMany?L(l.split(" "),function(d){o.addReference({element:a,property:p.ns.name,id:d})}):o.addReference({element:a,property:p.ns.name,id:l}):(p?l=tu(p.type,l):u!=="xmlns"&&(e=Pe(u,r.ns.prefix),c.getPackage(e.prefix)&&o.addWarning({message:"unknown attribute <"+u+">",element:a,property:u,value:l})),a.set(u,l))}),a},we.prototype.getPropertyForNode=function(t){var e,n,i=Pe(t.name),r=this.type,o=this.model,a=Hn(r),c=i.name,l=a.propertiesByName[c];if(l&&!l.isAttr)return fm(l)&&(e=t.attributes[os])?(e=function(p,d){var y=Pe(p);return function(f,v){var g=f.name,b=f.localName,E=v.xml&&v.xml.typePrefix;return E&&b.indexOf(E)===0?f.prefix+":"+b.slice(E.length):g}(y,d.getPackage(y.prefix))}(e,o),z({},l,{effectiveType:Hn(n=o.getType(e)).name})):l;var u=o.getPackage(i.prefix);if(u){if(e=vm(i,u),n=o.getType(e),l=kt(a.properties,function(p){return!p.isVirtual&&!p.isReference&&!p.isAttribute&&n.hasType(p.type)}))return z({},l,{effectiveType:Hn(n).name})}else if(l=kt(a.properties,function(p){return!p.isReference&&!p.isAttribute&&p.type==="Element"}))return l;throw bi("unrecognized element <"+i.name+">")},we.prototype.toString=function(){return"ElementDescriptor["+Hn(this.type).name+"]"},we.prototype.valueHandler=function(t,e){return new ru(t,e)},we.prototype.referenceHandler=function(t){return new Mo(t,this.context)},we.prototype.handler=function(t){return t==="Element"?new jr(this.model,t,this.context):new we(this.model,t,this.context)},we.prototype.handleChild=function(t){var e,n,i,r;if(e=this.getPropertyForNode(t),i=this.element,om(n=e.effectiveType||e.type))return this.valueHandler(e,i);var o=(r=e.isReference?this.referenceHandler(e).handleNode(t):this.handler(n).handleNode(t)).element;return o!==void 0&&(e.isMany?i.get(e.name).push(o):i.set(e.name,o),e.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},ou.prototype=Object.create(we.prototype),ou.prototype.createElement=function(t){var e=t.name,n=Pe(e),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&vm(n,o)||e;if(!r.hasType(a))throw bi("unexpected element <"+t.originalName+">");return we.prototype.createElement.call(this,t)},jr.prototype=Object.create(as.prototype),jr.prototype.createElement=function(t){var e=t.name,n=Pe(e).prefix,i=t.ns[n+"$uri"],r=t.attributes;return this.model.createAny(e,i,r)},jr.prototype.handleChild=function(t){var e=new jr(this.model,"Element",this.context).handleNode(t),n=this.element,i=e.element;return i!==void 0&&((n.$children=n.$children||[]).push(i),i.$parent=n),e},jr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},au.prototype.fromXML=function(t,e,n){var i=e.rootHandler;e instanceof we?(i=e,e={}):typeof e=="string"?(i=this.handler(e),e={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,a=new tx(z({},e,{rootHandler:i})),c=new hm({proxy:!0}),l=function(){var b=[];return Object.defineProperty(b,"peek",{value:function(){return this[this.length-1]}}),b}();function u(b,E,S){var w=E(),C=w.line,B=w.column,s=w.data;s.charAt(0)==="<"&&s.indexOf(" ")!==-1&&(s=s.slice(0,s.indexOf(" "))+">");var h="unparsable content "+(s?s+" ":"")+`detected line: `+C+` column: `+B+` nested error: `+b.message;if(S)return a.addWarning({message:h,error:b}),!0;throw bi(h)}function p(b,E){return u(b,E,!0)}i.context=a,l.push(i);var d=/^<\?xml /i,y=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function v(b,E){try{l.peek().handleText(b)}catch(S){p(S,E)}}var g=r.getPackages().reduce(function(b,E){return b[E.uri]=E.prefix,b},{"http://www.w3.org/XML/1998/namespace":"xml"});return c.ns(g).on("openTag",function(b,E,S,w){var C=b.attrs||{},B=Object.keys(C).reduce(function(s,h){var m=E(C[h]);return s[h]=m,s},{});(function(s,h){var m=l.peek();try{l.push(m.handleNode(s))}catch(_){u(_,h,o)&&l.push(new iu)}})({name:b.name,originalName:b.originalName,attributes:B,ns:b.ns},w)}).on("question",function(b){if(d.test(b)){var E=y.exec(b),S=E&&E[1];S&&!f.test(S)&&a.addWarning({message:"unsupported document encoding <"+S+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",v).on("text",function(b,E,S){(function(w,C){w.trim()&&v(w,C)})(E(b),S)}).on("error",u).on("warn",p),new Promise(function(b,E){var S;try{c.parse(t),function(){var h,m,_=a.elementsById,T=a.references;for(h=0;m=T[h];h++){var M=m.element,I=_[m.id],$=Hn(M).propertiesByName[m.property];if(I||a.addWarning({message:"unresolved reference <"+m.id+">",element:m.element,property:m.property,value:m.id}),$.isMany){var P=M.get($.name),x=P.indexOf(m);x===-1&&(x=P.length),I?P[x]=I:P.splice(x,1)}else M.set($.name,I)}}()}catch(h){S=h}var w=i.element;S||w||(S=bi("failed to parse document as <"+i.type.$descriptor.name+">"));var C=a.warnings,B=a.references,s=a.elementsById;return S?(S.warnings=C,E(S)):b({rootElement:w,elementsById:s,references:B,warnings:C})})},au.prototype.handler=function(t){return new ou(this.model,t)};var ex=/<|>|'|"|&|\n\r|\n/g,ym=/<|>|&/g;function nx(t){var e={},n={},i={},r=[],o=[];this.byUri=function(a){return n[a]||t&&t.byUri(a)},this.add=function(a,c){n[a.uri]=a,c?r.push(a):o.push(a),this.mapPrefix(a.prefix,a.uri)},this.uriByPrefix=function(a){return e[a||"xmlns"]},this.mapPrefix=function(a,c){e[a||"xmlns"]=c},this.getNSKey=function(a){return a.prefix!==void 0?a.uri+"|"+a.prefix:a.uri},this.logUsed=function(a){var c=a.uri,l=this.getNSKey(a);i[l]=this.byUri(c),t&&t.logUsed(a)},this.getUsed=function(a){var c=this;return[].concat(r,o).filter(function(l){var u=c.getNSKey(l);return i[u]})}}function ix(t,e){return dm(e)?(n=t).charAt(0).toLowerCase()+n.slice(1):t;var n}function gm(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}function bm(t){return Ie(t)?t:(t.prefix?t.prefix+":":"")+t.localName}var rx={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},ox={"<":"lt",">":"gt","&":"amp"};function xm(t,e,n){return(t=Ie(t)?t:""+t).replace(e,function(i){return"&"+n[i]+";"})}function su(t){this.tagName=t}function Xi(){}function cu(t){this.tagName=t}function zt(t,e){this.body=[],this.attrs=[],this.parent=t,this.propertyDescriptor=e}function ss(t,e){zt.call(this,t,e)}function ax(){this.value="",this.write=function(t){this.value+=t}}function sx(t,e){var n=[""];this.append=function(i){return t.write(i),this},this.appendNewLine=function(){return e&&t.write(` `),this},this.appendIndent=function(){return e&&t.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function cx(t){return t=z({format:!1,preamble:!0},t||{}),{toXML:function(e,n){var i=n||new ax,r=new sx(i,t.format);if(t.preamble&&r.append(` `),new zt().build(e).serializeTo(r),!n)return i.value}}}function cs(t,e){Qe.call(this,t,e)}su.prototype.build=function(t){return this.element=t,this},su.prototype.serializeTo=function(t){t.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()},Xi.prototype.serializeValue=Xi.prototype.serializeTo=function(t){t.append(this.escape?xm(this.value,ym,ox):this.value)},Xi.prototype.build=function(t,e){return this.value=e,t.type==="String"&&e.search(ym)!==-1&&(this.escape=!0),this},gm(cu,Xi),cu.prototype.serializeTo=function(t){t.appendIndent().append("<"+this.tagName+">"),this.serializeValue(t),t.append("").appendNewLine()},zt.prototype.build=function(t){this.element=t;var e,n,i=t.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return e=o?this.parseGeneric(t):this.parseNsAttributes(t),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(a){return mt(a.$descriptor.properties,function(c){var l=c.name;if(c.isVirtual||!Cn(a,l))return!1;var u=a[l];return u!==c.default&&u!==null&&(!c.isMany||u.length)})}(t),this.parseAttributes(mt(n,function(a){return a.isAttr})),this.parseContainments(function(a){return mt(a,function(c){return!c.isAttr})}(n))),this.parseGenericAttributes(t,e),this},zt.prototype.nsTagName=function(t){return function(e,n){return n.isGeneric?z({localName:n.ns.localName},e):z({localName:ix(n.ns.localName,n.$pkg)},e)}(this.logNamespaceUsed(t.ns),t)},zt.prototype.nsPropertyTagName=function(t){return function(e,n){return z({localName:n.ns.localName},e)}(this.logNamespaceUsed(t.ns),t)},zt.prototype.isLocalNs=function(t){return t.uri===this.ns.uri},zt.prototype.nsAttributeName=function(t){var e;if(e=Ie(t)?Pe(t):t.ns,t.inherited)return{localName:e.localName};var n=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:e.localName}:z({localName:e.localName},n)},zt.prototype.parseGeneric=function(t){var e=this,n=this.body,i=[];return L(t,function(r,o){o==="$body"?n.push(new Xi().build({type:"String"},r)):o==="$children"?L(r,function(a){n.push(new zt(e).build(a))}):o.indexOf("$")!==0&&e.parseNsAttribute(t,o,r)&&i.push({name:o,value:r})}),i},zt.prototype.parseNsAttribute=function(t,e,n){var i,r=t.$model,o=Pe(e);if(o.prefix==="xmlns"&&(i={prefix:o.localName,uri:n}),o.prefix||o.localName!=="xmlns"||(i={uri:n}),!i)return{name:e,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},zt.prototype.parseNsAttributes=function(t,e){var n=this,i=t.$attrs,r=[];return L(i,function(o,a){var c=n.parseNsAttribute(t,a,o);c&&r.push(c)}),r},zt.prototype.parseGenericAttributes=function(t,e){var n=this;L(e,function(i){if(i.name!==os)try{n.addAttribute(n.nsAttributeName(i.name),i.value)}catch{}})},zt.prototype.parseContainments=function(t){var e=this,n=this.body,i=this.element;L(t,function(r){var o=i.get(r.name),a=r.isReference;if(r.isMany||(o=[o]),r.isBody)n.push(new Xi().build(r,o[0]));else if(om(r.type))L(o,function(u){n.push(new cu(e.addTagName(e.nsPropertyTagName(r))).build(r,u))});else if(a)L(o,function(u){n.push(new su(e.addTagName(e.nsPropertyTagName(r))).build(u))});else{var c=fm(r),l=function(u){return mm(u)==="property"}(r);L(o,function(u){var p;p=c?new ss(e,r):l?new zt(e,r):new zt(e),n.push(p.build(u))})}})},zt.prototype.getNamespaces=function(t){var e,n=this.namespaces,i=this.parent;return n||(e=i&&i.getNamespaces(),t||!e?this.namespaces=n=new nx(e):n=e),n},zt.prototype.logNamespace=function(t,e,n){var i=this.getNamespaces(n),r=t.uri,o=t.prefix;return i.byUri(r)&&!n||i.add(t,e),i.mapPrefix(o,r),t},zt.prototype.logNamespaceUsed=function(t,e){var n,i,r,o=this.element.$model,a=this.getNamespaces(e),c=t.prefix,l=t.uri;if(!c&&!l)return{localName:t.localName};if(r=Q0[c]||o&&(o.getPackage(c)||{}).uri,!(l=l||r||a.uriByPrefix(c)))throw new Error("no namespace uri given for prefix <"+c+">");if(!(t=a.byUri(l))){for(n=c,i=1;a.uriByPrefix(n);)n=c+"_"+i++;t=this.logNamespace({prefix:n,uri:l},r===l)}return c&&a.mapPrefix(c,l),t},zt.prototype.parseAttributes=function(t){var e=this,n=this.element;L(t,function(i){var r=n.get(i.name);if(i.isReference)if(i.isMany){var o=[];L(r,function(a){o.push(a.id)}),r=o.join(" ")}else r=r.id;e.addAttribute(e.nsAttributeName(i),r)})},zt.prototype.addTagName=function(t){var e=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(e),bm(t)},zt.prototype.addAttribute=function(t,e){var n=this.attrs;Ie(e)&&(e=xm(e,ex,rx));var i=_l(n,function(o){return o.name.localName===t.localName&&o.name.uri===t.uri&&o.name.prefix===t.prefix}),r={name:t,value:e};i!==-1?n.splice(i,1,r):n.push(r)},zt.prototype.serializeAttributes=function(t){var e=this.attrs,n=this.namespaces;n&&(e=function(i){return i.getUsed().filter(function(r){return r.prefix!=="xml"}).map(function(r){return{name:"xmlns"+(r.prefix?":"+r.prefix:""),value:r.uri}})}(n).concat(e)),L(e,function(i){t.append(" ").append(bm(i.name)).append('="').append(i.value).append('"')})},zt.prototype.serializeTo=function(t){var e=this.body[0],n=e&&e.constructor!==Xi;t.appendIndent().append("<"+this.tagName),this.serializeAttributes(t),t.append(e?">":" />"),e&&(n&&t.appendNewLine().indent(),L(this.body,function(i){i.serializeTo(t)}),n&&t.unindent().appendIndent(),t.append("")),t.appendNewLine()},gm(ss,zt),ss.prototype.parseNsAttributes=function(t){var e=zt.prototype.parseNsAttributes.call(this,t),n=t.$descriptor;if(n.name===this.propertyDescriptor.type)return e;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=t.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(os),(i.prefix?i.prefix+":":"")+o+n.ns.localName),e},ss.prototype.isLocalNs=function(t){return t.uri===(this.typeNs||this.ns).uri},cs.prototype=Object.create(Qe.prototype),cs.prototype.fromXML=function(t,e,n){Ie(e)||(n=e,e="bpmn:Definitions");var i=new au(z({model:this,lax:!0},n)),r=i.handler(e);return i.fromXML(t,r)},cs.prototype.toXML=function(t,e){var n=new cx(e);return new Promise(function(i,r){try{return i({xml:n.toXML(t)})}catch(o){return r(o)}})};var lx={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function ux(t,e){return new cs(z({},lx,t),e)}function Se(t){return t?"<"+t.$type+(t.id?' id="'+t.id:"")+'" />':""}var px=new Nr({name:"bpmnElement",enumerable:!0},{name:"di",configurable:!0});function Le(t,e){return t.$instanceOf(e)}function hx(t,e){var n={},i=[];function r(M,I){return function($){M($,I)}}function o(M){n[M.id]=M}function a(M,I){try{var $=M.di&&function(P,x){if(P.gfx)throw new Error(e("already rendered {element}",{element:Se(P)}));return t.element(P,x)}(M,I);return o(M),$}catch(P){c(P.message,{element:M,error:P})}}function c(M,I){t.error(M,I)}function l(M){var I=M.bpmnElement;I?I.di?c(e("multiple DI elements defined for {element}",{element:Se(I)}),{element:I}):(px.bind(I,"di"),I.di=M):c(e("no bpmnElement referenced in {element}",{element:Se(M)}),{element:M})}function u(M){var I;l(I=M.plane),L(I.planeElement,p)}function p(M){l(M)}function d(){for(;i.length;)i.shift()()}function y(M,I){_(M,I),w(M.ioSpecification,I),S(M.artifacts,I),o(M)}function f(M,I){a(M,I)}function v(M,I){a(M,I)}function g(M,I){a(M,I)}function b(M,I){a(M,I)}function E(M,I){a(M,I)}function S(M,I){L(M,function($){Le($,"bpmn:Association")?i.push(function(){E($,I)}):E($,I)})}function w(M,I){M&&(L(M.dataInputs,r(g,I)),L(M.dataOutputs,r(b,I)))}function C(M,I){_(M,I),S(M.artifacts,I)}function B(M,I){var $=a(M,I);Le(M,"bpmn:SubProcess")&&C(M,$||I),Le(M,"bpmn:Activity")&&w(M.ioSpecification,I),i.push(function(){L(M.dataInputAssociations,r(v,I)),L(M.dataOutputAssociations,r(v,I))})}function s(M,I){a(M,I)}function h(M,I){i.push(function(){var $=a(M,I);M.childLaneSet&&m(M.childLaneSet,$||I),function(P){L(P.flowNodeRef,function(x){var N=x.get("lanes");N&&N.push(P)})}(M)})}function m(M,I){L(M.lanes,r(h,I))}function _(M,I){(function($,P){L($,function(x){Le(x,"bpmn:SequenceFlow")?i.push(function(){(function(N,j){a(N,j)})(x,P)}):Le(x,"bpmn:BoundaryEvent")?i.unshift(function(){B(x,P)}):Le(x,"bpmn:FlowNode")?B(x,P):Le(x,"bpmn:DataObject")||(Le(x,"bpmn:DataStoreReference")||Le(x,"bpmn:DataObjectReference")?s(x,P):c(e("unrecognized flowElement {element} in context {context}",{element:Se(x),context:P?Se(P.businessObject):"null"}),{element:x,context:P}))})})(M.flowElements,I),M.laneSets&&function($,P){L($,r(m,P))}(M.laneSets,I)}function T(M,I){var $=a(M,I),P=M.processRef;P&&y(P,$||I)}return{handleDeferred:d,handleDefinitions:function(M,I){var $=M.diagrams;if(I&&$.indexOf(I)===-1)throw new Error(e("diagram not part of bpmn:Definitions"));if(!I&&$&&$.length&&(I=$[0]),!I)throw new Error(e("no diagram to display"));u(I);var P=I.plane;if(!P)throw new Error(e("no plane for {element}",{element:Se(I)}));var x=P.bpmnElement;if(!x){if(x=function(G){return kt(G.rootElements,function(W){return Le(W,"bpmn:Process")||Le(W,"bpmn:Collaboration")})}(M),!x)throw new Error(e("no process or collaboration to display"));c(e("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Se(P),rootElement:Se(x)})),P.bpmnElement=x,l(P)}var N,j=function(G,W){return t.root(G,W)}(x,P);if(Le(x,"bpmn:Process"))y(x,j);else{if(!Le(x,"bpmn:Collaboration"))throw new Error(e("unsupported bpmnElement for {plane}: {rootElement}",{plane:Se(P),rootElement:Se(x)}));L((N=x).participants,r(T)),S(N.artifacts),i.push(function(){var G;L(N.messageFlows,r(f,G))}),function(G,W){mt(G,function(tt){return!n[tt.id]&&Le(tt,"bpmn:Process")&&tt.laneSets}).forEach(r(y,W))}(M.rootElements,j)}d()},handleSubProcess:C,registerDi:l}}function dx(t,e,n){var i,r,o,a=[];return new Promise(function(c,l){try{return i=t.get("bpmnImporter"),r=t.get("eventBus"),o=t.get("translate"),r.fire("import.render.start",{definitions:e}),function(u,p){new hx({root:function(d){return i.add(d)},element:function(d,y){return i.add(d,y)},error:function(d,y){a.push({message:d,context:y})}},o).handleDefinitions(u,p)}(e,n),r.fire("import.render.complete",{error:void 0,warnings:a}),c({warnings:a})}catch(u){return u.warnings=a,l(u)}})}function Vr(t){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var e=arguments.length;if(!(e>=1&&fe(arguments[e-1])))return t.apply(this,arguments);var n=arguments[e-1],i=Array.prototype.slice.call(arguments,0,-1);t.apply(this,i).then(function(r){var o=Object.keys(r)[0];return n(null,r[o])},function(r){return n(r,r.warnings)})}}var Em='';function ls(t){return t.join(";")}var Ro,_m=ls(["color: #404040"]),mx='
'+Em+'Web-based tooling for BPMN, DMN and CMMN diagrams powered by bpmn.io.
';function $t(t){var e,n;t=z({},fx,t),this._moddle=this._createModdle(t),this._container=this._createContainer(t),e=this._container,n=Lt(''+Em+""),e.appendChild(n),ct.bind(n,"click",function(i){Ro||(Ro=Lt(mx),$e.bind(Ro,".backdrop","click",function(r){document.body.removeChild(Ro)})),document.body.appendChild(Ro),i.preventDefault()}),this._init(this._container,this._moddle,t)}function us(t,e){return t.warnings=e,t}rt($t,Dr),$t.prototype.importXML=Vr(function(t,e){var n=this;return new Promise(function(i,r){t=n._emit("import.parse.start",{xml:t})||t,n._moddle.fromXML(t,"bpmn:Definitions").then(function(o){var a=o.rootElement,c=o.references,l=o.warnings,u=o.elementsById;a=n._emit("import.parse.complete",function(p){var d=n.get("eventBus").createEvent(p);return Object.defineProperty(d,"context",{enumerable:!0,get:function(){return{warnings:p.warnings,references:p.references,elementsById:p.elementsById}}}),d}({error:null,definitions:a,elementsById:u,references:c,warnings:l}))||a,n.importDefinitions(a,e).then(function(p){var d=[].concat(l,p.warnings||[]);return n._emit("import.done",{error:null,warnings:d}),i({warnings:d})}).catch(function(p){var d=[].concat(l,p.warnings||[]);return n._emit("import.done",{error:p,warnings:d}),r(us(p,d))})}).catch(function(o){return n._emit("import.parse.complete",{error:o}),o=function(a){var c=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(a.message);return c&&(a.message="unparsable content <"+c[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+c[2]),a}(o),n._emit("import.done",{error:o,warnings:o.warnings}),r(o)})})}),$t.prototype.importDefinitions=Vr(function(t,e){var n=this;return new Promise(function(i,r){n._setDefinitions(t),n.open(e).then(function(o){var a=o.warnings;return i({warnings:a})}).catch(function(o){return r(o)})})}),$t.prototype.open=Vr(function(t){var e=this._definitions,n=t,i=this;return new Promise(function(r,o){if(!e){var a=new Error("no XML imported");return o(us(a,[]))}if(typeof t=="string"&&(n=function(l,u){return u&&kt(l.diagrams,function(p){return p.id===u})||null}(e,t),!n)){var c=new Error("BPMNDiagram <"+t+"> not found");return o(us(c,[]))}try{i.clear()}catch(l){return o(us(l,[]))}dx(i,e,n).then(function(l){var u=l.warnings;return r({warnings:u})}).catch(function(l){return o(l)})})}),$t.prototype.saveXML=Vr(function(t){t=t||{};var e=this,n=this._definitions;return new Promise(function(i){if(!n)return i({error:new Error("no definitions loaded")});n=e._emit("saveXML.start",{definitions:n})||n,e._moddle.toXML(n,t).then(function(r){var o=r.xml;return o=e._emit("saveXML.serialized",{xml:o})||o,i({xml:o})})}).catch(function(i){return{error:i}}).then(function(i){e._emit("saveXML.done",i);var r=i.error;return r?Promise.reject(r):i})}),$t.prototype.saveSVG=Vr(function(t){var e=this;return new Promise(function(n,i){var r,o;e._emit("saveSVG.start");try{var a=e.get("canvas"),c=a.getDefaultLayer(),l=Ut("defs",a._svg),u=_d(c),p=l?""+_d(l)+"":"",d=c.getBBox();r=` '+p+u+""}catch(y){o=y}return e._emit("saveSVG.done",{error:o,svg:r}),o?i(o):n({svg:r})})}),$t.prototype._setDefinitions=function(t){this._definitions=t},$t.prototype.getModules=function(){return this._modules},$t.prototype.clear=function(){this.getDefinitions()&&(this.get("elementRegistry").forEach(function(t){var e=t.businessObject;e&&e.di&&delete e.di}),Dr.prototype.clear.call(this))},$t.prototype.destroy=function(){Dr.prototype.destroy.call(this),Tn(this._container)},$t.prototype.on=function(t,e,n,i){return this.get("eventBus").on(t,e,n,i)},$t.prototype.off=function(t,e){this.get("eventBus").off(t,e)},$t.prototype.attachTo=function(t){if(!t)throw new Error("parentNode required");this.detach(),t.get&&t.constructor.prototype.jquery&&(t=t.get(0)),typeof t=="string"&&(t=Ut(t)),t.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},$t.prototype.getDefinitions=function(){return this._definitions},$t.prototype.detach=function(){var t=this._container,e=t.parentNode;e&&(this._emit("detach",{}),e.removeChild(t))},$t.prototype._init=function(t,e,n){var i=n.modules||this.getModules(),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",e]}],i,r),a=z(zn(n,["additionalModules"]),{canvas:z({},n.canvas,{container:t}),modules:o});Dr.call(this,a),n&&n.container&&this.attachTo(n.container)},$t.prototype._emit=function(t,e){return this.get("eventBus").fire(t,e)},$t.prototype._createContainer=function(t){var e=Lt('
');return z(e.style,{width:wm(t.width),height:wm(t.height),position:t.position}),e},$t.prototype._createModdle=function(t){return new ux(z({},this._moddleExtensions,t.moddleExtensions))},$t.prototype._modules=[];var fx={width:"100%",height:"100%",position:"relative"};function wm(t){return t+(ht(t)?"px":"")}function No(t){$t.call(this,t),this.on("import.parse.complete",function(e){e.error||this._collectIds(e.definitions,e.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}function A(t,e){var n=et(t);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(e)}function et(t){return t&&t.businessObject||t}function Pt(t){return!A(t,"bpmn:CallActivity")&&(A(t,"bpmn:SubProcess")?et(t).di&&!!et(t).di.isExpanded:!A(t,"bpmn:Participant")||!!et(t).processRef)}function je(t){return t&&!!et(t).triggeredByEvent}function ps(t,e){var n=et(t),i=!1;return n.eventDefinitions&&L(n.eventDefinitions,function(r){A(r,e)&&(i=!0)}),i}function Sm(t){return A(t,"bpmn:FlowElement")||A(t,"bpmn:Participant")||A(t,"bpmn:Lane")||A(t,"bpmn:SequenceFlow")||A(t,"bpmn:MessageFlow")||A(t,"bpmn:DataInput")||A(t,"bpmn:DataOutput")?"name":A(t,"bpmn:TextAnnotation")?"text":A(t,"bpmn:Group")?"categoryValueRef":void 0}function mn(t){var e=t.businessObject,n=Sm(e);if(n)return n==="categoryValueRef"?function(i){var r=i.categoryValueRef;return r&&r.value||""}(e):e[n]||""}function Pn(t,e,n){return ui(t.eventDefinitions,function(i){return i.$type===e&&function(r,o){return $i(o,function(a,c){return r[c]==a})}(t,n)})}function Fr(t){return t.businessObject.di}function Ce(t){return t.businessObject}function xt(t,e){var n=Fr(t);return n.get("color:background-color")||n.get("bioc:fill")||e||"white"}function Z(t,e){var n=Fr(t);return n.get("color:border-color")||n.get("bioc:stroke")||e||"black"}function Io(t,e,n){var i=Fr(t).get("label");return i&&i.get("color:color")||e||Z(t,n)}rt(No,$t),No.prototype._createModdle=function(t){var e=$t.prototype._createModdle.call(this,t);return e.ids=new Sn([32,36,1]),e},No.prototype._collectIds=function(t,e){var n,i=t.$model.ids;for(n in i.clear(),e)i.claim(n,e[n])};var vx=new Sn,zr=.95;function Ki(t,e,n,i,r,o,a){$n.call(this,e,a);var c=t&&t.defaultFillColor,l=t&&t.defaultStrokeColor,u=t&&t.defaultLabelColor,p=vx.next(),d={},y=n.computeStyle;function f(P,x){var N=z({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},x.attrs),j=x.ref||{x:0,y:0},G=x.scale||1;N.strokeDasharray==="none"&&(N.strokeDasharray=[1e4,1]);var W=ot("marker");K(x.element,N),lt(W,x.element),K(W,{id:P,viewBox:"0 0 20 20",refX:j.x,refY:j.y,markerWidth:20*G,markerHeight:20*G,orient:"auto"});var tt=Ut("defs",r._svg);tt||(tt=ot("defs"),lt(r._svg,tt)),lt(tt,W),d[P]=W}function v(P){return P.replace(/[^0-9a-zA-z]+/g,"_")}function g(P,x,N){var j=P+"-"+v(x)+"-"+v(N)+"-"+p;return d[j]||function(G,W,tt,it){if(W==="sequenceflow-end"){var at=ot("path");K(at,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(G,{element:at,ref:{x:11,y:10},scale:.5,attrs:{fill:it,stroke:it}})}if(W==="messageflow-start"){var H=ot("circle");K(H,{cx:6,cy:6,r:3.5}),f(G,{element:H,attrs:{fill:tt,stroke:it},ref:{x:6,y:6}})}if(W==="messageflow-end"){var q=ot("path");K(q,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(G,{element:q,attrs:{fill:tt,stroke:it,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if(W==="association-start"){var jt=ot("path");K(jt,{d:"M 11 5 L 1 10 L 11 15"}),f(G,{element:jt,attrs:{fill:"none",stroke:it,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if(W==="association-end"){var Ht=ot("path");K(Ht,{d:"M 1 5 L 11 10 L 1 15"}),f(G,{element:Ht,attrs:{fill:"none",stroke:it,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if(W==="conditional-flow-marker"){var he=ot("path");K(he,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(G,{element:he,attrs:{fill:tt,stroke:it},ref:{x:-1,y:10},scale:.5})}if(W==="conditional-default-flow-marker"){var Vt=ot("path");K(Vt,{d:"M 6 4 L 10 16"}),f(G,{element:Vt,attrs:{stroke:it},ref:{x:0,y:10},scale:.5})}}(j,P,x,N),"url(#"+j+")"}function b(P,x,N,j,G){Jt(j)&&(G=j,j=0),j=j||0,(G=y(G,{stroke:"black",strokeWidth:2,fill:"white"})).fill==="none"&&delete G.fillOpacity;var W=x/2,tt=N/2,it=ot("circle");return K(it,{cx:W,cy:tt,r:Math.round((x+N)/4-j)}),K(it,G),lt(P,it),it}function E(P,x,N,j,G,W){Jt(G)&&(W=G,G=0),G=G||0,W=y(W,{stroke:"black",strokeWidth:2,fill:"white"});var tt=ot("rect");return K(tt,{x:G,y:G,width:x-2*G,height:N-2*G,rx:j,ry:j}),K(tt,W),lt(P,tt),tt}function S(P,x,N){var j=$l(x,N=y(N,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return lt(P,j),j}function w(P,x,N){N=y(N,["no-fill"],{strokeWidth:2,stroke:"black"});var j=ot("path");return K(j,{d:x}),K(j,N),lt(P,j),j}function C(P,x,N,j){return w(x,N,z({"data-marker":P},j))}function B(P){return function(x,N){return I[P](x,N)}}function s(P){return I[P]}function h(P,x){var N=Ce(P),j=function(G){return G.$type==="bpmn:IntermediateThrowEvent"||G.$type==="bpmn:EndEvent"}(N);return N.eventDefinitions&&N.eventDefinitions.length>1?N.parallelMultiple?s("bpmn:ParallelMultipleEventDefinition")(x,P,j):s("bpmn:MultipleEventDefinition")(x,P,j):Pn(N,"bpmn:MessageEventDefinition")?s("bpmn:MessageEventDefinition")(x,P,j):Pn(N,"bpmn:TimerEventDefinition")?s("bpmn:TimerEventDefinition")(x,P,j):Pn(N,"bpmn:ConditionalEventDefinition")?s("bpmn:ConditionalEventDefinition")(x,P):Pn(N,"bpmn:SignalEventDefinition")?s("bpmn:SignalEventDefinition")(x,P,j):Pn(N,"bpmn:EscalationEventDefinition")?s("bpmn:EscalationEventDefinition")(x,P,j):Pn(N,"bpmn:LinkEventDefinition")?s("bpmn:LinkEventDefinition")(x,P,j):Pn(N,"bpmn:ErrorEventDefinition")?s("bpmn:ErrorEventDefinition")(x,P,j):Pn(N,"bpmn:CancelEventDefinition")?s("bpmn:CancelEventDefinition")(x,P,j):Pn(N,"bpmn:CompensateEventDefinition")?s("bpmn:CompensateEventDefinition")(x,P,j):Pn(N,"bpmn:TerminateEventDefinition")?s("bpmn:TerminateEventDefinition")(x,P,j):null}function m(P,x,N){N=z({size:{width:100}},N);var j=o.createText(x||"",N);return bt(j).add("djs-label"),lt(P,j),j}function _(P,x,N){return m(P,Ce(x).name,{box:x,align:N,padding:5,style:{fill:Io(x,u,l)}})}function T(P,x,N){Zl(m(P,x,{box:{height:30,width:N.height},align:"center-middle",style:{fill:Io(N,u,l)}}),0,-(-1*N.height),270)}function M(P){for(var x=P.waypoints,N="m "+x[0].x+","+x[0].y,j=1;j1)for(;c=l.shift();){if(!(c.length+pb?E.width:b},0),v=o.top;r.vertical==="middle"&&(v+=(n.height-y)/2),v-=(c||u[0].height)/4;var g=ot("text");return K(g,i),L(u,function(b){var E;switch(v+=c||b.height,r.horizontal){case"left":E=o.left;break;case"right":E=(a?f:p)-o.right-b.width;break;default:E=Math.max(((a?f:p)-b.width)/2+o.left,0)}var S=ot("tspan");K(S,{x:E,y:v}),S.textContent=b.text,lt(g,S)}),Zt(d),{dimensions:{width:f,height:y},element:g}};function Tm(t){var e=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},t&&t.defaultStyle||{}),n=parseInt(e.fontSize,10)-1,i=z({},e,{fontSize:n},t&&t.externalStyle||{}),r=new hs({style:e});this.getExternalLabelBounds=function(o,a){var c=r.getDimensions(a,{box:{width:90,height:30,x:o.width/2+o.x,y:o.height/2+o.y},style:i});return{x:Math.round(o.x+o.width/2-c.width/2),y:Math.round(o.y),width:Math.ceil(c.width),height:Math.ceil(c.height)}},this.getTextAnnotationBounds=function(o,a){var c=r.getDimensions(a,{box:o,style:e,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(30,Math.round(c.height))}},this.createText=function(o,a){return r.createText(o,a||{})},this.getDefaultStyle=function(){return e},this.getExternalStyle=function(){return i}}Tm.$inject=["config.textRenderer"];var _x=/\{([^{}]+)\}/g,wx=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const Sx={__init__:["bpmnRenderer"],bpmnRenderer:["type",Ki],textRenderer:["type",Tm],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,e){var n,i,r=this.pathMap[t];e.abspos?(n=e.abspos.x,i=e.abspos.y):(n=e.containerWidth*e.position.mx,i=e.containerHeight*e.position.my);var o={};if(e.position){for(var a=e.containerHeight/r.height*e.yScaleFactor,c=e.containerWidth/r.width*e.xScaleFactor,l=0;l=o.x&&c<=o.x+o.width&&l>=o.y&&l<=o.y+o.height||(e=this._canvas.getRootElement())),this._canvas.addShape(n,e,r)}else{if(!A(u,"bpmndi:BPMNEdge"))throw new Error(p("unknown di {di} for element {semantic}",{di:Se(u),semantic:Se(t)}));var v=this._getSource(t),g=this._getTarget(t);i=e&&(e.hidden||e.collapsed),n=this._elementFactory.createConnection(vs(t,{hidden:i,source:v,target:g,waypoints:Tx(t,v,g)})),A(t,"bpmn:DataAssociation")&&(e=null),A(t,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,e,r)}return $r(t)&&mn(n)&&this.addLabel(t,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},qn.prototype._attachBoundary=function(t,e){var n=this._translate,i=t.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Se(t)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw Am(n,t,i,"attachedToRef");e.host=r,o||(r.attachers=o=[]),o.indexOf(e)===-1&&o.push(e)},qn.prototype.addLabel=function(t,e){var n,i,r;return n=function(o,a){var c,l,u,p=o.di.label;return p&&p.bounds?(u=p.bounds,l={width:Math.max(Do.width,u.width),height:u.height},c={x:u.x+u.width/2,y:u.y+u.height/2}):(c=fs(a),l=Do),z({x:c.x-l.width/2,y:c.y-l.height/2},l)}(t,e),(i=mn(e))&&(n=this._textRenderer.getExternalLabelBounds(n,i)),r=this._elementFactory.createLabel(vs(t,{id:t.id+"_label",labelTarget:e,type:"label",hidden:e.hidden||!mn(e),x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,e.parent)},qn.prototype._getEnd=function(t,e){var n,i,r=t.$type,o=this._translate;if(i=t[e+"Ref"],e==="source"&&r==="bpmn:DataInputAssociation"&&(i=i&&i[0]),(e==="source"&&r==="bpmn:DataOutputAssociation"||e==="target"&&r==="bpmn:DataInputAssociation")&&(i=t.$parent),n=i&&this._getElement(i))return n;throw i?Am(o,t,i,e+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:Se(t),side:e}))},qn.prototype._getSource=function(t){return this._getEnd(t,"source")},qn.prototype._getTarget=function(t){return this._getEnd(t,"target")},qn.prototype._getElement=function(t){return this._elementRegistry.get(t.id)};const Ax={__depends__:[Sx,{__depends__:[ds],bpmnImporter:["type",qn]}]};function km(t){t&&typeof t.stopPropagation=="function"&&t.stopPropagation()}function Gr(t){return t.originalEvent||t.srcEvent}function lu(t,e){km(t),km(Gr(t))}function xi(t){return t.pointers&&t.pointers.length&&(t=t.pointers[0]),t.touches&&t.touches.length&&(t=t.touches[0]),t?{x:t.clientX,y:t.clientY}:null}function Pm(t,e){return(Gr(t)||t).button===e}function Ei(t){return Pm(t,0)}function Ur(t){var e=Gr(t)||t;return!!Ei(t)&&(/mac/i.test(navigator.platform)?e.metaKey:e.ctrlKey)}function Mm(t){var e=Gr(t)||t;return Ei(t)&&e.shiftKey}function kx(t){return!0}function ys(t){return Ei(t)||function(e){return Pm(e,1)}(t)}function Rm(t,e,n){var i=this;function r(E,S,w){var C,B;(function(s,h){var m=l[s]||Ei;return!m(h)})(E,S)||(w?B=e.getGraphics(w):(C=S.delegateTarget||S.target)&&(B=C,w=e.get(B)),B&&w&&t.fire(E,{element:w,gfx:B,originalEvent:S})===!1&&(S.stopPropagation(),S.preventDefault()))}var o={};function a(E){return o[E]}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":kx,"element.mousedown":ys,"element.mouseup":ys,"element.click":ys,"element.dblclick":ys};function u(E,S,w,C){var B=o[w]=function(s){r(w,s)};C&&(l[w]=C),B.$delegate=$e.bind(E,"svg, .djs-element",S,B)}function p(E,S,w){var C=a(w);C&&$e.unbind(E,S,C.$delegate)}t.on("canvas.destroy",function(E){(function(S){L(c,function(w,C){p(S,C,w)})})(E.svg)}),t.on("canvas.init",function(E){(function(S){L(c,function(w,C){u(S,C,w)})})(E.svg)}),t.on(["shape.added","connection.added"],function(E){var S=E.element,w=E.gfx;t.fire("interactionEvents.createHit",{element:S,gfx:w})}),t.on(["shape.changed","connection.changed"],500,function(E){var S=E.element,w=E.gfx;t.fire("interactionEvents.updateHit",{element:S,gfx:w})}),t.on("interactionEvents.createHit",500,function(E){var S=E.element,w=E.gfx;i.createDefaultHit(S,w)}),t.on("interactionEvents.updateHit",function(E){var S=E.element,w=E.gfx;i.updateDefaultHit(S,w)});var d=v("djs-hit djs-hit-stroke"),y=v("djs-hit djs-hit-click-stroke"),f={all:v("djs-hit djs-hit-all"),"click-stroke":y,stroke:d};function v(E,S){return S=z({stroke:"white",strokeWidth:15},S||{}),n.cls(E,["no-fill","no-border"],S)}function g(E,S){var w=f[S];if(!w)throw new Error("invalid hit type <"+S+">");return K(E,w),E}function b(E,S){lt(E,S)}this.removeHits=function(E){L(Rl(".djs-hit",E),Zt)},this.createDefaultHit=function(E,S){var w,C=E.waypoints,B=E.isFrame;return C?this.createWaypointsHit(S,C):(w=B?"stroke":"all",this.createBoxHit(S,w,{width:E.width,height:E.height}))},this.createWaypointsHit=function(E,S){var w=$l(S);return g(w,"stroke"),b(E,w),w},this.createBoxHit=function(E,S,w){w=z({x:0,y:0},w);var C=ot("rect");return g(C,S),K(C,w),b(E,C),C},this.updateDefaultHit=function(E,S){var w=Ut(".djs-hit",S);if(w)return E.waypoints?function(C,B){K(C,{points:wd(B)})}(w,E.waypoints):K(w,{width:E.width,height:E.height}),w},this.fire=r,this.triggerMouseEvent=function(E,S,w){var C=c[E];if(!C)throw new Error("unmapped DOM event name <"+E+">");return r(C,S,w)},this.mouseHandler=a,this.registerEvent=u,this.unregisterEvent=p}Rm.$inject=["eventBus","elementRegistry","styles"];const Bo={__init__:["interactionEvents"],interactionEvents:["type",Rm]};function gs(t,e,n){this.offset=6;var i=e.cls("djs-outline",["no-fill"]),r=this;function o(a,c){var l=ot("rect");return K(l,z({x:10,y:10,width:100,height:100},i)),lt(a,l),l}t.on(["shape.added","shape.changed"],500,function(a){var c=a.element,l=a.gfx,u=Ut(".djs-outline",l);u||(u=o(l)),r.updateShapeOutline(u,c)}),t.on(["connection.added","connection.changed"],function(a){var c=a.element,l=a.gfx,u=Ut(".djs-outline",l);u||(u=o(l)),r.updateConnectionOutline(u,c)})}gs.prototype.updateShapeOutline=function(t,e){K(t,{x:-this.offset,y:-this.offset,width:e.width+2*this.offset,height:e.height+2*this.offset})},gs.prototype.updateConnectionOutline=function(t,e){var n=ve(e);K(t,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},gs.$inject=["eventBus","styles","elementRegistry"];const Nm={__init__:["outline"],outline:["type",gs]};function Hr(t,e){this._eventBus=t,this._canvas=e,this._selectedElements=[];var n=this;t.on(["shape.remove","connection.remove"],function(i){var r=i.element;n.deselect(r)}),t.on(["diagram.clear","plane.set"],function(i){n.select(null)})}Hr.$inject=["eventBus","canvas"],Hr.prototype.deselect=function(t){var e=this._selectedElements,n=e.indexOf(t);if(n!==-1){var i=e.slice();e.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:e})}},Hr.prototype.get=function(){return this._selectedElements},Hr.prototype.isSelected=function(t){return this._selectedElements.indexOf(t)!==-1},Hr.prototype.select=function(t,e){var n=this._selectedElements,i=n.slice();gt(t)||(t=t?[t]:[]);var r=this._canvas;t=t.filter(function(o){return r.findPlane(o)===r.getActivePlane()}),e?L(t,function(o){n.indexOf(o)===-1&&n.push(o)}):this._selectedElements=n=t.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Im="hover",Dm="selected";function Bm(t,e,n,i){function r(a,c){e.addMarker(a,c)}function o(a,c){e.removeMarker(a,c)}this._multiSelectionBox=null,t.on("element.hover",function(a){r(a.element,Im)}),t.on("element.out",function(a){o(a.element,Im)}),t.on("selection.changed",function(a){var c=a.oldSelection,l=a.newSelection;L(c,function(u){l.indexOf(u)===-1&&o(u,Dm)}),L(l,function(u){c.indexOf(u)===-1&&r(u,Dm)})})}function Om(t,e,n,i){t.on("create.end",500,function(r){var o=r.context,a=o.canExecute,c=o.elements,l=(o.hints||{}).autoSelect;if(a){if(l===!1)return;gt(l)?e.select(l):e.select(c.filter(Px))}}),t.on("connect.end",500,function(r){var o=r.context,a=o.canExecute,c=o.hover;a&&c&&e.select(c)}),t.on("shape.move.end",500,function(r){var o=r.previousSelection||[],a=i.get(r.context.shape.id);kt(o,function(c){return a.id===c.id})||e.select(a)}),t.on("element.click",function(r){if(Ei(r)){var o=r.element;o===n.getRootElement()&&(o=null);var a=e.isSelected(o),c=e.get().length>1,l=Ur(r)||Mm(r);if(a&&c)return l?e.deselect(o):e.select(o);a?e.deselect(o):e.select(o,l)}})}function Px(t){return!t.hidden}Bm.$inject=["eventBus","canvas","selection","styles"],Om.$inject=["eventBus","selection","canvas","elementRegistry"];const Mn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Bo,Nm],selection:["type",Hr],selectionVisuals:["type",Bm],selectionBehavior:["type",Om]};function uu(t){this._counter=0,this._prefix=(t?t+"-":"")+Math.floor(1e9*Math.random())+"-"}uu.prototype.next=function(){return this._prefix+ ++this._counter};var Mx=new uu("ov");function ue(t,e,n,i){var r,o;this._eventBus=e,this._canvas=n,this._elementRegistry=i,this._ids=Mx,this._overlayDefaults=z({show:null,scale:!0},t&&t.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),o=Lt('
'),r.insertBefore(o,r.firstChild),o),this._init()}function Lm(t,e,n){z(t.style,{left:e+"px",top:n+"px"})}function Oo(t,e){t.style.display=e===!1?"none":""}function jm(t,e){t.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){t.style[n+"transform"]=e})}ue.$inject=["config.overlays","eventBus","canvas","elementRegistry"],ue.prototype.get=function(t){if(Ie(t)&&(t={id:t}),Ie(t.element)&&(t.element=this._elementRegistry.get(t.element)),t.element){var e=this._getOverlayContainer(t.element,!0);return e?t.type?mt(e.overlays,Ye({type:t.type})):e.overlays.slice():[]}return t.type?mt(this._overlays,Ye({type:t.type})):t.id?this._overlays[t.id]:null},ue.prototype.add=function(t,e,n){if(Jt(e)&&(n=e,e=null),t.id||(t=this._elementRegistry.get(t)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!t)throw new Error("invalid element specified");var i=this._ids.next();return n=z({},this._overlayDefaults,n,{id:i,type:e,element:t,html:n.html}),this._addOverlay(n),i},ue.prototype.remove=function(t){var e=this.get(t)||[];gt(e)||(e=[e]);var n=this;L(e,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(Tn(i.html),Tn(i.htmlContainer),delete i.htmlContainer,delete i.element,delete n._overlays[i.id]),r){var o=r.overlays.indexOf(i);o!==-1&&r.overlays.splice(o,1)}})},ue.prototype.show=function(){Oo(this._overlayRoot)},ue.prototype.hide=function(){Oo(this._overlayRoot,!1)},ue.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Ua(this._overlayRoot)},ue.prototype._updateOverlayContainer=function(t){var e=t.element,n=t.html,i=e.x,r=e.y;if(e.waypoints){var o=ve(e);i=o.x,r=o.y}Lm(n,i,r),ze(t.html,"data-container-id",e.id)},ue.prototype._updateOverlay=function(t){var e,n,i=t.position,r=t.htmlContainer,o=t.element,a=i.left,c=i.top;i.right!==void 0&&(e=o.waypoints?ve(o).width:o.width,a=-1*i.right+e),i.bottom!==void 0&&(n=o.waypoints?ve(o).height:o.height,c=-1*i.bottom+n),Lm(r,a||0,c||0)},ue.prototype._createOverlayContainer=function(t){var e=Lt('
');this._overlayRoot.appendChild(e);var n={html:e,element:t,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},ue.prototype._updateRoot=function(t){var e=t.scale||1,n="matrix("+[e,0,0,e,-1*t.x*e,-1*t.y*e].join(",")+")";jm(this._overlayRoot,n)},ue.prototype._getOverlayContainer=function(t,e){var n=kt(this._overlayContainers,function(i){return i.element===t});return n||e?n:this._createOverlayContainer(t)},ue.prototype._addOverlay=function(t){var e,n,i=t.id,r=t.element,o=t.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),Ie(o)&&(o=Lt(o)),n=this._getOverlayContainer(r),(e=Lt('
')).appendChild(o),t.type&&ne(e).add("djs-overlay-"+t.type);var a=this._canvas.findPlane(r),c=this._canvas.getActivePlane();t.plane=a,a!==c&&Oo(e,!1),t.htmlContainer=e,n.overlays.push(t),n.html.appendChild(e),this._overlays[i]=t,this._updateOverlay(t),this._updateOverlayVisibilty(t,this._canvas.viewbox())},ue.prototype._updateOverlayVisibilty=function(t,e){var n=t.show,i=t.plane,r=n&&n.minZoom,o=n&&n.maxZoom,a=t.htmlContainer,c=!0;(i!==this._canvas.getActivePlane()||n&&(Xe(r)&&r>e.scale||Xe(o)&&oi&&(r=(1/e.scale||1)*i)),Xe(r)&&(c="scale("+r+","+r+")"),jm(a,c)},ue.prototype._updateOverlaysVisibilty=function(t){var e=this;L(this._overlays,function(n){e._updateOverlayVisibilty(n,t)})},ue.prototype._init=function(){var t=this._eventBus,e=this;t.on("canvas.viewbox.changing",function(n){e.hide()}),t.on("canvas.viewbox.changed",function(n){var i;i=n.viewbox,e._updateRoot(i),e._updateOverlaysVisibilty(i),e.show()}),t.on(["shape.remove","connection.remove"],function(n){var i=n.element;L(e.get({element:i}),function(a){e.remove(a.id)});var r=e._getOverlayContainer(i);if(r){Tn(r.html);var o=e._overlayContainers.indexOf(r);o!==-1&&e._overlayContainers.splice(o,1)}}),t.on("element.changed",500,function(n){var i=n.element,r=e._getOverlayContainer(i,!0);r&&(L(r.overlays,function(o){e._updateOverlay(o)}),e._updateOverlayContainer(r))}),t.on("element.marker.update",function(n){var i=e._getOverlayContainer(n.element,!0);i&&ne(i.html)[n.add?"add":"remove"](n.marker)}),t.on("plane.set",function(n){L(e._overlays,function(i){Oo(i.htmlContainer,i.plane===n.plane)})}),t.on("diagram.clear",this.clear,this)};const pu={__init__:["overlays"],overlays:["type",ue]};function Wn(t){$t.call(this,t)}rt(Wn,$t),Wn.prototype._modules=[Ax,ds,Mn,pu],Wn.prototype._moddleExtensions={};var Rx=["c","C",67],Nx=["v","V",86],Ix=["y","Y",89],Vm=["z","Z",90];function He(t){return!t.altKey&&(t.ctrlKey||t.metaKey)}function fn(t,e){return(t=gt(t)?t:[t]).indexOf(e.key)!==-1||t.indexOf(e.keyCode)!==-1}function hu(t){return t.shiftKey}var bs="keyboard.keydown",Fm="input-handle-modified-keys";function pe(t,e){var n=this;this._config=t||{},this._eventBus=e,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),e.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.on("diagram.init",function(){n._fire("init")}),e.on("attach",function(){t&&t.bindTo&&n.bind(t.bindTo)}),e.on("detach",function(){n.unbind()})}pe.$inject=["config.keyboard","eventBus"],pe.prototype._keydownHandler=function(t){this._keyHandler(t,bs)},pe.prototype._keyupHandler=function(t){this._keyHandler(t,"keyboard.keyup")},pe.prototype._keyHandler=function(t,e){if(!this._isEventIgnored(t)){var n={keyEvent:t};this._eventBus.fire(e||bs,n)&&t.preventDefault()}},pe.prototype._isEventIgnored=function(t){return(e=t.target)&&(Ha(e,"input, textarea")||e.contentEditable==="true")&&this._isModifiedKeyIgnored(t);var e},pe.prototype._isModifiedKeyIgnored=function(t){return!He(t)||!this._getAllowedModifiers(t.target).includes(t.key)},pe.prototype._getAllowedModifiers=function(t){var e=Ui(t,"["+Fm+"]",!0);return!e||this._node&&!this._node.contains(e)?[]:e.getAttribute(Fm).split(",")},pe.prototype.bind=function(t){this.unbind(),this._node=t,ct.bind(t,"keydown",this._keydownHandler,!0),ct.bind(t,"keyup",this._keyupHandler,!0),this._fire("bind")},pe.prototype.getBinding=function(){return this._node},pe.prototype.unbind=function(){var t=this._node;t&&(this._fire("unbind"),ct.unbind(t,"keydown",this._keydownHandler,!0),ct.unbind(t,"keyup",this._keyupHandler,!0)),this._node=null},pe.prototype._fire=function(t){this._eventBus.fire("keyboard."+t,{node:this._node})},pe.prototype.addListener=function(t,e,n){fe(t)&&(n=e,e=t,t=1e3),this._eventBus.on(n||bs,t,e)},pe.prototype.removeListener=function(t,e){this._eventBus.off(e||bs,t)},pe.prototype.hasModifier=function(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey},pe.prototype.isCmd=He,pe.prototype.isShift=hu,pe.prototype.isKey=fn;function qr(t,e){var n=this;t.on("editorActions.init",500,function(i){var r=i.editorActions;n.registerBindings(e,r)})}qr.$inject=["eventBus","keyboard"],qr.prototype.registerBindings=function(t,e){function n(i,r){e.isRegistered(i)&&t.addListener(r)}n("undo",function(i){if(function(r){return He(r)&&!hu(r)&&fn(Vm,r)}(i.keyEvent))return e.trigger("undo"),!0}),n("redo",function(i){if(function(r){return He(r)&&(fn(Ix,r)||fn(Vm,r)&&hu(r))}(i.keyEvent))return e.trigger("redo"),!0}),n("copy",function(i){if(function(r){return He(r)&&fn(Rx,r)}(i.keyEvent))return e.trigger("copy"),!0}),n("paste",function(i){if(function(r){return He(r)&&fn(Nx,r)}(i.keyEvent))return e.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(fn(["+","Add","="],r)&&He(r))return e.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(fn(["-","Subtract"],r)&&He(r))return e.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(fn("0",r)&&He(r))return e.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){if(fn(["Backspace","Delete","Del"],i.keyEvent))return e.trigger("removeSelection"),!0})};const du={__init__:["keyboard","keyboardBindings"],keyboard:["type",pe],keyboardBindings:["type",qr]};var Dx={moveSpeed:50,moveSpeedAccelerated:200};function zm(t,e,n){var i=this;this._config=z({},Dx,t||{}),e.addListener(function(r){var o=r.keyEvent,a=i._config;if(e.isCmd(o)&&e.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],o)){var c,l=e.isShift(o)?a.moveSpeedAccelerated:a.moveSpeed;switch(o.key){case"ArrowLeft":case"Left":c="left";break;case"ArrowUp":case"Up":c="up";break;case"ArrowRight":case"Right":c="right";break;case"ArrowDown":case"Down":c="down"}return i.moveCanvas({speed:l,direction:c}),!0}}),this.moveCanvas=function(r){var o=0,a=0,c=r.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(r.direction){case"left":o=c;break;case"up":a=c;break;case"right":o=-c;break;case"down":a=-c}n.scroll({dx:o,dy:a})}}zm.$inject=["config.keyboardMove","keyboard","canvas"];const $m={__depends__:[du],__init__:["keyboardMove"],keyboardMove:["type",zm]};var Bx=/^djs-cursor-.*$/;function xs(t){var e=ne(document.body);e.removeMatching(Bx),t&&e.add("djs-cursor-"+t)}function Gm(){xs(null)}function Um(t,e){function n(){return!1}return e=e||"element.click",t.once(e,5e3,n),function(){t.off(e,n)}}function Lo(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Rn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Hm(t,e){var n;function i(o){var a,c=n.start,l=n.button,u=xi(o),p=Rn(u,c);!n.dragging&&(a=p,Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2))>15)&&(n.dragging=!0,l===0&&Um(t),xs("grab")),n.dragging&&(p=Rn(u,n.last||n.start),e.scroll({dx:p.x,dy:p.y}),n.last=u),o.preventDefault()}function r(o){ct.unbind(document,"mousemove",i),ct.unbind(document,"mouseup",r),n=null,Gm()}t.on("element.mousedown",500,function(o){return function(a){if(!Ui(a.target,".djs-draggable")){var c=a.button;if(!(c>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:c,start:xi(a)},ct.bind(document,"mousemove",i),ct.bind(document,"mouseup",r),!0}}(o.originalEvent)}),this.isActive=function(){return!!n}}Hm.$inject=["eventBus","canvas"];const qm={__init__:["moveCanvas"],moveCanvas:["type",Hm]};function mu(t){return Math.log(t)/Math.log(10)}function Wm(t,e){var n=mu(t.min),i=mu(t.max);return(Math.abs(n)+Math.abs(i))/e}var Ox=Math.sign||function(t){return t>=0?1:-1},fu={min:.2,max:4};function Nn(t,e,n){t=t||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=_e(this._handleWheel,this),this._totalDelta=0,this._scale=t.scale||.75;var i=this;e.on("canvas.init",function(r){i._init(t.enabled!==!1)})}Nn.$inject=["config.zoomScroll","eventBus","canvas"],Nn.prototype.scroll=function(t){this._canvas.scroll(t)},Nn.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Nn.prototype.zoom=function(t,e){var n=Wm(fu,20);this._totalDelta+=t,Math.abs(this._totalDelta)>.1&&(this._zoom(t,e,n),this._totalDelta=0)},Nn.prototype._handleWheel=function(t){if(!Ui(t.target,".djs-scrollable",!0)){var e=this._container;t.preventDefault();var n,i=t.ctrlKey,r=t.shiftKey,o=-1*this._scale;if(o*=i?t.deltaMode===0?.02:.32:t.deltaMode===0?1:16,i){var a=e.getBoundingClientRect(),c={x:t.clientX-a.left,y:t.clientY-a.top};n=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*Ox(t.deltaY)*o,this.zoom(n,c)}else n=r?{dx:o*t.deltaY,dy:0}:{dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(n)}},Nn.prototype.stepZoom=function(t,e){var n=Wm(fu,10);this._zoom(t,e,n)},Nn.prototype._zoom=function(t,e,n){var i=this._canvas,r=t>0?1:-1,o=mu(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var c,l,u=Math.pow(10,a);i.zoom((c=fu,l=u,Math.max(c.min,Math.min(c.max,l))),e)},Nn.prototype.toggle=function(t){var e=this._container,n=this._handleWheel,i=this._enabled;return t===void 0&&(t=!i),i!==t&&ct[t?"bind":"unbind"](e,"wheel",n,!1),this._enabled=t,t},Nn.prototype._init=function(t){this.toggle(t)};const Xm={__init__:["zoomScroll"],zoomScroll:["type",Nn]};function jo(t){Wn.call(this,t)}rt(jo,Wn),jo.prototype._navigationModules=[$m,qm,Xm],jo.prototype._modules=[].concat(Wn.prototype._modules,jo.prototype._navigationModules);var Km={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */(function(t){(function(e,n,i,r){var o,a=["","webkit","Moz","MS","ms","o"],c=n.createElement("div"),l=Math.round,u=Math.abs,p=Date.now;function d(k,O,F){return setTimeout(S(k,F),O)}function y(k,O,F){return!!Array.isArray(k)&&(f(k,F[O],F),!0)}function f(k,O,F){var U;if(k)if(k.forEach)k.forEach(O,F);else if(k.length!==r)for(U=0;U\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Dt=e.console&&(e.console.warn||e.console.log);return Dt&&Dt.call(e.console,U,ft),k.apply(this,arguments)}}o=typeof Object.assign!="function"?function(k){if(k===r||k===null)throw new TypeError("Cannot convert undefined or null to object");for(var O=Object(k),F=1;F-1}function _(k){return k.trim().split(/\s+/g)}function T(k,O,F){if(k.indexOf&&!F)return k.indexOf(O);for(var U=0;UCt[O]}):U.sort()),U}function $(k,O){for(var F,U,Y=O[0].toUpperCase()+O.slice(1),ft=0;ft1&&!Ee.firstMultiple?Ee.firstMultiple=Ht(Ct):Gh===1&&(Ee.firstMultiple=!1);var Uh=Ee.firstInput,fr=Ee.firstMultiple,Hh=fr?fr.center:Uh.center,qh=Ct.center=he(La);Ct.timeStamp=p(),Ct.deltaTime=Ct.timeStamp-Uh.timeStamp,Ct.angle=oe(Hh,qh),Ct.distance=Et(Hh,qh),function(pn,ce){var ci=ce.center,Vi=pn.offsetDelta||{},Fi=pn.prevDelta||{},zi=pn.prevInput||{};ce.eventType!==1&&zi.eventType!==4||(Fi=pn.prevDelta={x:zi.deltaX||0,y:zi.deltaY||0},Vi=pn.offsetDelta={x:ci.x,y:ci.y}),ce.deltaX=Fi.x+(ci.x-Vi.x),ce.deltaY=Fi.y+(ci.y-Vi.y)}(Ee,Ct),Ct.offsetDirection=qt(Ct.deltaX,Ct.deltaY);var vr=Vt(Ct.deltaTime,Ct.deltaX,Ct.deltaY);Ct.overallVelocityX=vr.x,Ct.overallVelocityY=vr.y,Ct.overallVelocity=u(vr.x)>u(vr.y)?vr.x:vr.y,Ct.scale=fr?(dl=fr.pointers,ml=La,Et(ml[0],ml[1],H)/Et(dl[0],dl[1],H)):1,Ct.rotation=fr?function(pn,ce){return oe(ce[1],ce[0],H)+oe(pn[1],pn[0],H)}(fr.pointers,La):0,Ct.maxPointers=Ee.prevInput?Ct.pointers.length>Ee.prevInput.maxPointers?Ct.pointers.length:Ee.prevInput.maxPointers:Ct.pointers.length,function(pn,ce){var ci,Vi,Fi,zi,li=pn.lastInterval||ce,Wh=ce.timeStamp-li.timeStamp;if(ce.eventType!=8&&(Wh>25||li.velocity===r)){var Xh=ce.deltaX-li.deltaX,Kh=ce.deltaY-li.deltaY,yr=Vt(Wh,Xh,Kh);Vi=yr.x,Fi=yr.y,ci=u(yr.x)>u(yr.y)?yr.x:yr.y,zi=qt(Xh,Kh),pn.lastInterval=ce}else ci=li.velocity,Vi=li.velocityX,Fi=li.velocityY,zi=li.direction;ce.velocity=ci,ce.velocityX=Vi,ce.velocityY=Fi,ce.direction=zi}(Ee,Ct);var dl,ml,fl=me.element;h(Ct.srcEvent.target,fl)&&(fl=Ct.srcEvent.target),Ct.target=fl}(k,F),k.emit("hammer.input",F),k.recognize(F),k.session.prevInput=F}function Ht(k){for(var O=[],F=0;F=u(O)?k<0?2:4:O<0?8:16}function Et(k,O,F){F||(F=at);var U=O[F[0]]-k[F[0]],Y=O[F[1]]-k[F[1]];return Math.sqrt(U*U+Y*Y)}function oe(k,O,F){F||(F=at);var U=O[F[0]]-k[F[0]],Y=O[F[1]]-k[F[1]];return 180*Math.atan2(Y,U)/Math.PI}q.prototype={handler:function(){},init:function(){this.evEl&&B(this.element,this.evEl,this.domHandler),this.evTarget&&B(this.target,this.evTarget,this.domHandler),this.evWin&&B(x(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&s(this.element,this.evEl,this.domHandler),this.evTarget&&s(this.target,this.evTarget,this.domHandler),this.evWin&&s(x(this.element),this.evWin,this.domHandler)}};var se={mousedown:1,mousemove:2,mouseup:4},Mt="mousedown",de="mousemove mouseup";function _t(){this.evEl=Mt,this.evWin=de,this.pressed=!1,q.apply(this,arguments)}E(_t,q,{handler:function(k){var O=se[k.type];1&O&&k.button===0&&(this.pressed=!0),2&O&&k.which!==1&&(O=4),this.pressed&&(4&O&&(this.pressed=!1),this.callback(this.manager,O,{pointers:[k],changedPointers:[k],pointerType:tt,srcEvent:k}))}});var Te={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},pt={2:W,3:"pen",4:tt,5:"kinect"},It="pointerdown",ii="pointermove pointerup pointercancel";function ri(){this.evEl=It,this.evWin=ii,q.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&(It="MSPointerDown",ii="MSPointerMove MSPointerUp MSPointerCancel"),E(ri,q,{handler:function(k){var O=this.store,F=!1,U=k.type.toLowerCase().replace("ms",""),Y=Te[U],ft=pt[k.pointerType]||k.pointerType,Dt=ft==W,me=T(O,k.pointerId,"pointerId");1&Y&&(k.button===0||Dt)?me<0&&(O.push(k),me=O.length-1):12&Y&&(F=!0),me<0||(O[me]=k,this.callback(this.manager,Y,{pointers:O,changedPointers:[k],pointerType:ft,srcEvent:k}),F&&O.splice(me,1))}});var Yt={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function Ae(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,q.apply(this,arguments)}function Ln(k,O){var F=M(k.touches),U=M(k.changedTouches);return 12&O&&(F=I(F.concat(U),"identifier",!0)),[F,U]}E(Ae,q,{handler:function(k){var O=Yt[k.type];if(O===1&&(this.started=!0),this.started){var F=Ln.call(this,k,O);12&O&&F[0].length-F[1].length==0&&(this.started=!1),this.callback(this.manager,O,{pointers:F[0],changedPointers:F[1],pointerType:W,srcEvent:k})}}});var oi={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Ra="touchstart touchmove touchend touchcancel";function Na(){this.evTarget=Ra,this.targetIds={},q.apply(this,arguments)}function Hb(k,O){var F=M(k.touches),U=this.targetIds;if(3&O&&F.length===1)return U[F[0].identifier]=!0,[F,F];var Y,ft,Dt=M(k.changedTouches),me=[],Ct=this.target;if(ft=F.filter(function(Ee){return h(Ee.target,Ct)}),O===1)for(Y=0;Y-1&&U.splice(Y,1)},2500)}}function Wb(k){for(var O=k.srcEvent.clientX,F=k.srcEvent.clientY,U=0;U-1&&this.requireFail.splice(O,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(k){return!!this.simultaneous[k.id]},emit:function(k){var O=this,F=this.state;function U(Y){O.manager.emit(Y,k)}F<8&&U(O.options.event+Fh(F)),U(O.options.event),k.additionalEvent&&U(k.additionalEvent),F>=8&&U(O.options.event+Fh(F))},tryEmit:function(k){if(this.canEmit())return this.emit(k);this.state=ai},canEmit:function(){for(var k=0;kO.threshold&&Y&O.direction},attrTest:function(k){return un.prototype.attrTest.call(this,k)&&(2&this.state||!(2&this.state)&&this.directionTest(k))},emit:function(k){this.pX=k.deltaX,this.pY=k.deltaY;var O=zh(k.direction);O&&(k.additionalEvent=this.options.event+O),this._super.emit.call(this,k)}}),E(cl,un,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ji]},attrTest:function(k){return this._super.attrTest.call(this,k)&&(Math.abs(k.scale-1)>this.options.threshold||2&this.state)},emit:function(k){if(k.scale!==1){var O=k.scale<1?"in":"out";k.additionalEvent=this.options.event+O}this._super.emit.call(this,k)}}),E(ll,jn,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Vh]},process:function(k){var O=this.options,F=k.pointers.length===O.pointers,U=k.distanceO.time;if(this._input=k,!U||!F||12&k.eventType&&!Y)this.reset();else if(1&k.eventType)this.reset(),this._timer=d(function(){this.state=8,this.tryEmit()},O.time,this);else if(4&k.eventType)return 8;return ai},reset:function(){clearTimeout(this._timer)},emit:function(k){this.state===8&&(k&&4&k.eventType?this.manager.emit(this.options.event+"up",k):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),E(ul,un,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ji]},attrTest:function(k){return this._super.attrTest.call(this,k)&&(Math.abs(k.rotation)>this.options.threshold||2&this.state)}}),E(pl,un,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ba.prototype.getTouchAction.call(this)},attrTest:function(k){var O,F=this.options.direction;return 30&F?O=k.overallVelocity:6&F?O=k.overallVelocityX:F&it&&(O=k.overallVelocityY),this._super.attrTest.call(this,k)&&F&k.offsetDirection&&k.distance>this.options.threshold&&k.maxPointers==this.options.pointers&&u(O)>this.options.velocity&&4&k.eventType},emit:function(k){var O=zh(k.offsetDirection);O&&this.manager.emit(this.options.event+O,k),this.manager.emit(this.options.event,k)}}),E(Oa,jn,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[al]},process:function(k){var O=this.options,F=k.pointers.length===O.pointers,U=k.distance1&&(p=!0),d.elements.length}),p)return l[t]=bu(n).center,l;i=e[0],r=bu(e=Ke(e,function(d){return d[a]+d[c]})),l[t]=function(d,y){return Math.round((d[a]+y[a]+y[c])/2)}(i,r)}return l},Wr.prototype.trigger=function(t,e){var n=this._modeling,i=mt(t,function(a){return!(a.waypoints||a.host||a.labelTarget)});if(!(i.length<2)){var r=Ke(i,jx[e]),o=this._alignmentPosition(e,r);n.alignElements(r,o)}};const Vx={__init__:["alignElements"],alignElements:["type",Wr]};function xu(t,e,n,i){for(var r;r=Fx(t,n,e);)n=i(e,n,r);return n}function Eu(t){return function(e,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=t[o];if(a){var c=o==="x"?"width":"height",l=a.margin,u=a.minDistance;r[o]=l<0?Math.min(i[o]+l-e[c]/2,n[o]-u+l):Math.max(i[o]+i[c]+l+e[c]/2,n[o]+u+l)}}),r}}function Fx(t,e,n){var i={x:e.x-n.width/2,y:e.y-n.height/2,width:n.width,height:n.height},r=function(o){var a=_u(o);return o.host&&(a=a.concat(_u(o.host))),o.attachers&&(a=a.concat(o.attachers.reduce(function(c,l){return c.concat(_u(l))},[]))),a}(t);return kt(r,function(o){return o!==n&&ye(o,i,10)==="intersect"})}function _u(t){return(e=t,e.outgoing.map(function(n){return n.target})).concat(function(n){return n.incoming.map(function(i){return i.source})}(t));var e}function zx(){return!0}function tf(t,e,n){t.on("autoPlace",100,function(i){var r=i.shape;return function(o,a,c){c||(c={});var l=c.defaultDistance||50,u=vt(o),p=st(o);return{x:p.right+l+a.width/2,y:u.y}}(i.source,r)}),t.on("autoPlace.end",function(i){n.scrollToElement(i.shape)}),this.append=function(i,r,o){t.fire("autoPlace.start",{source:i,shape:r});var a=t.fire("autoPlace",{source:i,shape:r}),c=e.appendShape(i,r,a,i.parent,o);return t.fire("autoPlace.end",{source:i,shape:c}),c}}function ef(t,e){t.on("autoPlace.end",500,function(n){e.select(n.shape)})}tf.$inject=["eventBus","modeling","canvas"],ef.$inject=["eventBus","selection"];const $x={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",tf],autoPlaceSelectionBehavior:["type",ef]};function wt(t,e){return ui(e,function(n){return A(t,n)})}function _s(t,e){for(typeof e=="string"&&(e=[e]);t=t.parent;)if(wt(t,e))return t;return null}function nf(t,e){return A(e,"bpmn:TextAnnotation")?function(n,i){var r=st(n),o={x:r.right+i.width/2,y:r.top-50-i.height/2};return xu(n,i,o,Eu({y:{margin:-30,minDistance:20}}))}(t,e):wt(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(n,i){var r=st(n),o={x:r.right-10+i.width/2,y:r.bottom+40+i.width/2};return xu(n,i,o,Eu({x:{margin:30,minDistance:30}}))}(t,e):A(e,"bpmn:FlowNode")?function(n,i){var r=st(n),o=vt(n),a=function(d,y){y||(y={});var f=y.defaultDistance||50,v=y.direction||"e",g=y.filter,b=y.getWeight||function(h){return h.source===d?1:-1},E=y.maxDistance||250,S=y.reference||"start";function w(h,m){return v==="n"?S==="start"?st(h).top-st(m).bottom:S==="center"?st(h).top-vt(m).y:st(h).top-st(m).top:v==="w"?S==="start"?st(h).left-st(m).right:S==="center"?st(h).left-vt(m).x:st(h).left-st(m).left:v==="s"?S==="start"?st(m).top-st(h).bottom:S==="center"?vt(m).y-st(h).bottom:st(m).bottom-st(h).bottom:S==="start"?st(m).left-st(h).right:S==="center"?vt(m).x-st(h).right:st(m).right-st(h).right}g||(g=zx);var C=d.incoming.filter(g).map(function(h){var m=b(h),_=m<0?w(h.source,d):w(d,h.source);return{id:h.source.id,distance:_,weight:m}}),B=d.outgoing.filter(g).map(function(h){var m=b(h),_=m>0?w(d,h.target):w(h.target,d);return{id:h.target.id,distance:_,weight:m}}),s=De(C.concat(B).reduce(function(h,m){return h[m.id+"__weight_"+m.weight]=m,h},{}),function(h,m){var _=m.distance,T=m.weight;return _<0||_>E||(h[String(_)]||(h[String(_)]=0),h[String(_)]+=1*T,(!h.distance||h[h.distance]a.top&&(c=c.concat("n")),o.righta.left&&(c=c.concat("e")),c}(Je(e,["x","y","width","height"]),n);this.resize(e,n,{autoResize:i});var r=e.parent;r&&this._expand([e],r)}}},Xn.prototype.getOffset=function(t){return{top:60,bottom:60,left:100,right:100}},Xn.prototype.getPadding=function(t){return{top:2,bottom:2,left:15,right:15}},Xn.prototype.resize=function(t,e,n){this._modeling.resizeShape(t,e,null,n)},ws.$inject=["injector"],rt(ws,Xn),ws.prototype.resize=function(t,e,n){A(t,"bpmn:Participant")?this._modeling.resizeLane(t,e,null,n):this._modeling.resizeShape(t,e,null,n)},_i.$inject=["eventBus"],rt(_i,Q),_i.prototype.addRule=function(t,e,n){var i=this;typeof t=="string"&&(t=[t]),t.forEach(function(r){i.canExecute(r,e,function(o,a,c){return n(o)},!0)})},_i.prototype.init=function(){},Vo.$inject=["eventBus"],rt(Vo,_i),Vo.prototype.canResize=function(t,e){return!1},rt(Ss,Vo),Ss.$inject=["eventBus","modeling"],Ss.prototype.canResize=function(t,e){if(!A(e,"bpmn:Participant")&&!A(e,"bpmn:Lane")&&!A(e,"bpmn:SubProcess"))return!1;var n=!0;return L(t,function(i){(A(i,"bpmn:Lane")||i.labelTarget)&&(n=!1)}),n};const Hx={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",ws],bpmnAutoResizeProvider:["type",Ss]};function of(t,e,n){var i,r,o=this,a=n.get("dragging",!1);a&&e.on("drag.start",function(c){e.once("drag.move",1500,function(l){(function(u){if(!u.hover){var p=u.originalEvent,d=o._findTargetGfx(p),y=d&&t.get(d);d&&y&&(u.stopPropagation(),a.hover({element:y,gfx:d}),a.move(p))}})(l)})}),e.on("element.hover",function(c){i=c.gfx,r=c.element}),e.on("element.hover",1500,function(c){r&&e.fire("element.out",{element:r,gfx:i})}),e.on("element.out",function(){i=null,r=null}),this._findTargetGfx=function(c){var l;if(c instanceof MouseEvent)return l=xi(c),function(u){return Ui(u,"svg, .djs-element",!0)}(document.elementFromPoint(l.x,l.y))}}of.$inject=["elementRegistry","eventBus","injector"];const qx={__init__:["hoverFix"],hoverFix:["type",of]};var Xr=Math.round,af="djs-drag-active";function Ji(t){t.preventDefault()}function sf(t,e,n,i){var r,o={threshold:5,trapClick:!0};function a(E){var S=e.viewbox(),w=e._container.getBoundingClientRect();return{x:S.x+(E.x-w.left)/S.scale,y:S.y+(E.y-w.top)/S.scale}}function c(E,S){S=S||r;var w=t.createEvent(z({},S.payload,S.data,{isTouch:S.isTouch}));return t.fire("drag."+E,w)!==!1&&t.fire(S.prefix+"."+E,w)}function l(E,S){var w,C=r.payload,B=r.displacement,s=r.globalStart,h=xi(E),m=Rn(h,s),_=r.localStart,T=a(h),M=Rn(T,_);if(!r.active&&(S||(w=m,Math.sqrt(Math.pow(w.x,2)+Math.pow(w.y,2))>r.threshold))){if(z(C,{x:Xr(_.x+B.x),y:Xr(_.y+B.y),dx:0,dy:0},{originalEvent:E}),c("start")===!1)return g();r.active=!0,r.keepSelection||(C.previousSelection=n.get(),n.select(null)),r.cursor&&xs(r.cursor),e.addMarker(e.getRootElement(),af)}lu(E),r.active&&(z(C,{x:Xr(T.x+B.x),y:Xr(T.y+B.y),dx:Xr(M.x),dy:Xr(M.y)},{originalEvent:E}),c("move"))}function u(E){var S=!0;r.active&&(E&&(r.payload.originalEvent=E,lu(E)),S=c("end")),S===!1&&c("rejected"),c("ended",b(S!==!0))}function p(E){E.which===27&&(Ji(E),g())}function d(E){var S;r.active&&(S=Um(t),setTimeout(S,400),Ji(E)),u(E)}function y(E){l(E)}function f(E){var S=r.payload;S.hoverGfx=E.gfx,S.hover=E.element,c("hover")}function v(E){c("out");var S=r.payload;S.hoverGfx=null,S.hover=null}function g(E){var S;if(r){var w=r.active;w&&c("cancel"),S=b(E),w&&c("canceled",S)}}function b(E){var S,w;c("cleanup"),Gm(),w=r.trapClick?d:u,ct.unbind(document,"mousemove",l),ct.unbind(document,"dragstart",Ji),ct.unbind(document,"selectstart",Ji),ct.unbind(document,"mousedown",w,!0),ct.unbind(document,"mouseup",w,!0),ct.unbind(document,"keyup",p),ct.unbind(document,"touchstart",y,!0),ct.unbind(document,"touchcancel",g,!0),ct.unbind(document,"touchmove",l,!0),ct.unbind(document,"touchend",u,!0),t.off("element.hover",f),t.off("element.out",v),e.removeMarker(e.getRootElement(),af);var C=r.payload.previousSelection;return E!==!1&&C&&!n.get().length&&function(B){var s=B.filter(function(h){return i.get(h.id)});s.length&&n.select(s)}(C),S=r,r=null,S}t.on("diagram.destroy",g),this.init=function(E,S,w,C){r&&g(!1),typeof S=="string"&&(C=w,w=S,S=null);var B,s,h,m,_,T=(C=z({},o,C||{})).data||{};m=C.trapClick?d:u,E?(B=Gr(E)||E,s=xi(E),lu(E),B.type==="dragstart"&&Ji(B)):(B=null,s={x:0,y:0}),h=a(s),S||(S=h),_=function(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}(B),r=z({prefix:w,data:T,payload:{},globalStart:s,displacement:Rn(S,h),localStart:h,isTouch:_},C),C.manual||(_?(ct.bind(document,"touchstart",y,!0),ct.bind(document,"touchcancel",g,!0),ct.bind(document,"touchmove",l,!0),ct.bind(document,"touchend",u,!0)):(ct.bind(document,"mousemove",l),ct.bind(document,"dragstart",Ji),ct.bind(document,"selectstart",Ji),ct.bind(document,"mousedown",m,!0),ct.bind(document,"mouseup",m,!0)),ct.bind(document,"keyup",p),t.on("element.hover",f),t.on("element.out",v)),c("init"),C.autoActivate&&l(E,!0)},this.move=l,this.hover=f,this.out=v,this.end=u,this.cancel=g,this.context=function(){return r},this.setOptions=function(E){z(o,E)}}sf.$inject=["eventBus","canvas","selection","elementRegistry"];const Kn={__depends__:[qx,Mn],dragging:["type",sf]};function Kr(t,e,n){this._canvas=n,this._opts=z({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},t);var i=this;e.on("drag.move",function(r){var o=i._toBorderPoint(r);i.startScroll(o)}),e.on(["drag.cleanup"],function(){i.stopScroll()})}function Wx(t,e,n){return e=1&&i<=31||i==127||a==0&&i>=48&&i<=57||a==1&&i>=48&&i<=57&&l==45?"\\"+i.toString(16)+" ":a==0&&o==1&&i==45||!(i>=128||i==45||i==95||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122)?"\\"+r.charAt(a):r.charAt(a):c+="\uFFFD";return c};return t.CSS||(t.CSS={}),t.CSS.escape=e,e}(Yh);const Au=gr(hf.exports);var Jx={"&":"&","<":"<",">":">",'"':""","'":"'"};function df(t){return(t=""+t)&&t.replace(/[&<>"']/g,function(e){return Jx[e]})}function mf(t,e,n,i,r){function o(v,g){var b,E=g.waypoints,S=Cu(e,E,v);if(S)return b=function(w,C){var B,s,h=w.waypoints;return C.index<=0||C.bendpoint?null:(s=Gn((B={start:h[C.index-1],end:h[C.index]}).start,B.end))?pf(s==="h"?B.end.x-B.start.x:B.end.y-B.start.y)/2:null}(g,S),function(w,C,B){var s,h,m,_,T,M,I=w.index,$=w.point;return!(I<=0||w.bendpoint)&&(m=Hl(s=C[I-1],h=C[I]),_=Gn(s,h),T=Math.abs($.x-m.x),M=Math.abs($.y-m.y),_&&T<=B&&M<=B)}(S,E,b)?r.start(v,g,S.index):i.start(v,g,S.index,!S.bendpoint),!0}function a(v,g,b){ct.bind(v,g,function(E){n.triggerMouseEvent(g,E,b),E.stopPropagation()})}function c(v,g){var b=e.getLayer("overlays"),E=Ut('.djs-bendpoints[data-element-id="'+Au(v.id)+'"]',b);return!E&&g&&(K(E=ot("g"),{"data-element-id":v.id}),bt(E).add("djs-bendpoints"),lt(b,E),a(E,"mousedown",v),a(E,"click",v),a(E,"dblclick",v)),E}function l(v,g){return Ut('.djs-segment-dragger[data-segment-idx="'+v+'"]',g)}function u(v,g){g.waypoints.forEach(function(b,E){var S=Tu(v);lt(v,S),Oe(S,b.x,b.y)}),Tu(v,"floating")}function p(v,g){for(var b,E,S,w=g.waypoints,C=1;Ch-3&&(y=ye(v.target,s),b===h-2?y==="intersect"&&(C.pop(),C[C.length-1]=s):y!=="intersect"&&C.push(S)),f.newWaypoints=v.waypoints=c(v,C),u(f,m,p),f.newSegmentStartIndex=g+m,l(p)}),e.on("connectionSegment.move.hover",function(p){p.context.hover=p.hover,n.addMarker(p.hover,Ef)}),e.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(p){var d=p.context.hover;d&&n.removeMarker(d,Ef)}),e.on("connectionSegment.move.cleanup",function(p){var d=p.context,y=d.connection;d.draggerGfx&&Zt(d.draggerGfx),n.removeMarker(y,_f)}),e.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(p){var d=p.context;d.connection.waypoints=d.originalWaypoints,l(p)}),e.on("connectionSegment.move.end",function(p){var d=p.context,y=d.connection,f=d.newWaypoints,v=d.newSegmentStartIndex,g=function(w,C){var B=0;return{waypoints:w.filter(function(s,h){return!Ul(w[h-1],w[h+1],s)||(B=h<=C?B-1:B,!1)}),segmentOffset:B}}(f=f.map(function(w){return{original:w.original,x:Math.round(w.x),y:Math.round(w.y)}}),v),b=c(y,g.waypoints),E=g.segmentOffset,S={segmentMove:{segmentStartIndex:d.segmentStartIndex,newSegmentStartIndex:v+E}};o.updateWaypoints(y,b,S)})}Tf.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var Zx=Math.abs,Af=Math.round;function kf(t){return{x:t.x,y:t.y}}function Pf(t){return{x:t.x+t.width,y:t.y+t.height}}function tn(t,e){return!t||isNaN(t.x)||isNaN(t.y)?e:{x:Af(t.x+t.width/2),y:Af(t.y+t.height/2)}}function Yr(t,e){var n=t.snapped;return!!n&&(typeof e=="string"?n[e]:n.x&&n.y)}function re(t,e,n){if(typeof e!="string")throw new Error("axis must be in [x, y]");if(typeof n!="number"&&n!==!1)throw new Error("value must be Number or false");var i,r=t[e],o=t.snapped=t.snapped||{};return n===!1?o[e]=!1:(o[e]=!0,i=n-r,t[e]+=i,t["d"+e]+=i),r}function Mf(t){return t.children||[]}var Qx=Math.abs,Rf=Math.round;function Nf(t){function e(i,r){if(gt(i)){for(var o=i.length;o--;)if(Qx(i[o]-r)<=10)return i[o]}else{var a=r%(i=+i);if(a<10)return r-a;if(a>i-10)return r-a+i}return r}function n(i){if(i.width)return{x:Rf(i.width/2+i.x),y:Rf(i.height/2+i.y)}}t.on("connectionSegment.move.move",1500,function(i){var r,o,a=function(d){var y=d.snapPoints,f=d.connection,v=f.waypoints,g=d.segmentStart,b=d.segmentStartIndex,E=d.segmentEnd,S=d.segmentEndIndex,w=d.axis;if(y)return y;var C=[v[b-1],g,E,v[S+1]];return b<2&&C.unshift(n(f.source)),S>v.length-3&&C.unshift(n(f.target)),d.snapPoints=y={horizontal:[],vertical:[]},L(C,function(B){B&&(B=B.original||B,w==="y"&&y.horizontal.push(B.y),w==="x"&&y.vertical.push(B.x))}),y}(i.context),c=i.x,l=i.y;if(a){var u=c-(r=e(a.vertical,c)),p=l-(o=e(a.horizontal,l));z(i,{dx:i.dx-u,dy:i.dy-p,x:r,y:o}),(u||a.vertical.indexOf(c)!==-1)&&re(i,"x",r),(p||a.horizontal.indexOf(l)!==-1)&&re(i,"y",o)}}),t.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(i){var r,o,a=i.context,c=function(v){var g=v.snapPoints,b=v.connection.waypoints,E=v.bendpointIndex;if(g)return g;var S=[b[E-1],b[E+1]];return v.snapPoints=g={horizontal:[],vertical:[]},L(S,function(w){w&&(w=w.original||w,g.horizontal.push(w.y),g.vertical.push(w.x))}),g}(a),l=a.hover,u=l&&n(l),p=i.x,d=i.y;if(c){var y=p-(r=e(u?c.vertical.concat([u.x]):c.vertical,p)),f=d-(o=e(u?c.horizontal.concat([u.y]):c.horizontal,d));z(i,{dx:i.dx-y,dy:i.dy-f,x:i.x-y,y:i.y-f}),(y||c.vertical.indexOf(p)!==-1)&&re(i,"x",r),(f||c.horizontal.indexOf(d)!==-1)&&re(i,"y",o)}})}Nf.$inject=["eventBus"];const tE={__depends__:[Kn,In],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",mf],bendpointMove:["type",ku],bendpointMovePreview:["type",xf],connectionSegmentMove:["type",Tf],bendpointSnapping:["type",Nf]};function If(t,e,n,i){function r(o,a){return i.allowed("connection.create",{source:o,target:a})}t.on("connect.hover",function(o){var a,c=o.context,l=c.start,u=o.hover;if(c.hover=u,!bo(a=c.canExecute=r(l,u))){if(a!==!1)return c.source=l,void(c.target=u);bo(a=c.canExecute=r(u,l))||a!==!1&&(c.source=u,c.target=l)}}),t.on(["connect.out","connect.cleanup"],function(o){var a=o.context;a.hover=null,a.source=null,a.target=null,a.canExecute=!1}),t.on("connect.end",function(o){var a=o.context,c=a.canExecute,l=a.connectionStart,u={x:o.x,y:o.y},p=a.source,d=a.target;if(!c)return!1;var y=null,f={connectionStart:Mu(a)?u:l,connectionEnd:Mu(a)?l:u};Jt(c)&&(y=c),n.connect(p,d,y,f)}),this.start=function(o,a,c,l){Jt(c)||(l=c,c=vt(a)),e.init(o,"connect",{autoActivate:l,data:{shape:a,context:{start:a,connectionStart:c}}})}}function Mu(t){var e=t.hover,n=t.source,i=t.target;return e&&n&&e===n&&n!==i}If.$inject=["eventBus","dragging","modeling","rules"];var Df="connect-ok",Bf="connect-not-ok";function Of(t,e,n){var i=t.get("connectionPreview",!1);i&&e.on("connect.move",function(r){var o=r.context,a=o.canExecute,c=o.hover,l=o.source,u=o.start,p=o.startPosition,d=o.target,y=o.connectionStart||p,f=o.connectionEnd||{x:r.x,y:r.y},v=y,g=f;Mu(o)&&(v=f,g=y),i.drawPreview(o,a,{source:l||u,target:d||c,connectionStart:v,connectionEnd:g})}),e.on("connect.hover",900,function(r){var o=r.context,a=r.hover,c=o.canExecute;c!==null&&n.addMarker(a,c?Df:Bf)}),e.on(["connect.out","connect.cleanup"],1100,function(r){var o=r.hover;o&&(n.removeMarker(o,Df),n.removeMarker(o,Bf))}),i&&e.on("connect.cleanup",function(r){i.cleanUp(r.context)})}Of.$inject=["injector","eventBus","canvas"];const Ru={__depends__:[Mn,In,Kn],__init__:["connectPreview"],connect:["type",If],connectPreview:["type",Of]};function Yn(t,e,n,i){this._canvas=e,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=t.get("connectionDocking",!1),this._layouter=t.get("layouter",!1)}Yn.$inject=["injector","canvas","graphicsFactory","elementFactory"],Yn.prototype.drawPreview=function(t,e,n){n=n||{};var i,r=t.connectionPreviewGfx,o=t.getConnection,a=n.source,c=n.target,l=n.waypoints,u=n.connectionStart,p=n.connectionEnd,d=n.noLayout,y=n.noCropping,f=n.noNoop,v=this;r||(r=t.connectionPreviewGfx=this.createConnectionPreviewGfx()),Dl(r),o||(o=t.getConnection=function(g){var b={};return function(E){var S=JSON.stringify(E),w=b[S];return w||(w=b[S]=g.apply(null,arguments)),w}}(function(g,b,E){return v.getConnection(g,b,E)})),e&&(i=o(e,a,c)),i?(i.waypoints=l||[],this._layouter&&!d&&(i.waypoints=this._layouter.layoutConnection(i,{source:a,target:c,connectionStart:u,connectionEnd:p,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[a?vt(a):u,c?vt(c):p]),this._connectionDocking&&(a||c)&&!y&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,a,c)),this._graphicsFactory.drawConnection(r,i)):!f&&this.drawNoopPreview(r,n)},Yn.prototype.drawNoopPreview=function(t,e){var n=e.source,i=e.target,r=e.connectionStart||vt(n),o=e.connectionEnd||vt(i),a=this.cropWaypoints(r,o,n,i);lt(t,this.createNoopConnection(a[0],a[1]))},Yn.prototype.cropWaypoints=function(t,e,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),c=r.getConnectionPath({waypoints:[t,e]});return[t=n&&Kl(o,c,!0)||t,e=i&&Kl(a,c,!1)||e]},Yn.prototype.cleanUp=function(t){t&&t.connectionPreviewGfx&&Zt(t.connectionPreviewGfx)},Yn.prototype.getConnection=function(t){var e=function(n){return Jt(n)?n:{}}(t);return this._elementFactory.createConnection(e)},Yn.prototype.createConnectionPreviewGfx=function(){var t=ot("g");return K(t,{pointerEvents:"none"}),bt(t).add("djs-connection-preview"),lt(this._canvas.getActiveLayer(),t),t},Yn.prototype.createNoopConnection=function(t,e){var n=ot("polyline");return K(n,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),K(n,{points:[t.x,t.y,e.x,e.y]}),n};const eE={__init__:["connectionPreview"],connectionPreview:["type",Yn]};var Lf=Math.min,jf=Math.max;function Nu(t){t.preventDefault()}function $o(t){t.stopPropagation()}function vn(t){this.container=t.container,this.parent=Lt('
'),this.content=Ut("[contenteditable]",this.parent),this.keyHandler=t.keyHandler||function(){},this.resizeHandler=t.resizeHandler||function(){},this.autoResize=_e(this.autoResize,this),this.handlePaste=_e(this.handlePaste,this)}function en(t,e){this._eventBus=t,this._providers=[],this._textbox=new vn({container:e.getContainer(),keyHandler:_e(this._handleKey,this),resizeHandler:_e(this._handleResize,this)})}vn.prototype.create=function(t,e,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{};var c=Je(e=this.style=e||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);z(r.style,{width:t.width+"px",height:t.height+"px",maxWidth:t.maxWidth+"px",maxHeight:t.maxHeight+"px",minWidth:t.minWidth+"px",minHeight:t.minHeight+"px",left:t.x+"px",top:t.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var l=Je(e,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return z(o.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),i.centerVertically&&z(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),o.innerText=n,ct.bind(o,"keydown",this.keyHandler),ct.bind(o,"mousedown",$o),ct.bind(o,"paste",this.handlePaste),i.autoResize&&ct.bind(o,"input",this.autoResize),i.resizable&&this.resizable(e),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},vn.prototype.handlePaste=function(t){var e,n=this.options,i=this.style;if(t.preventDefault(),e=t.clipboardData?t.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(e),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},vn.prototype.insertText=function(t){t=t.replace(/\r\n|\r|\n/g,` `),document.execCommand("insertText",!1,t)||this._insertTextIE(t)},vn.prototype._insertTextIE=function(t){var e,n,i,r=this.getSelection(),o=r.startContainer,a=r.endContainer,c=r.startOffset,l=r.endOffset,u=r.commonAncestorContainer,p=(e=u.childNodes,[].slice.call(e));if(function(g){return g.nodeType===Node.TEXT_NODE}(u)){var d=o.textContent;o.textContent=d.substring(0,c)+t+d.substring(l),n=o,i=c+t.length}else if(o===this.content&&a===this.content){var y=document.createTextNode(t);this.content.insertBefore(y,p[c]),n=y,i=y.textContent.length}else{var f=p.indexOf(o),v=p.indexOf(a);p.forEach(function(g,b){b===f?g.textContent=o.textContent.substring(0,c)+t+a.textContent.substring(l):b>f&&b<=v&&Tn(g)}),n=o,i=c+t.length}n&&i!==void 0&&setTimeout(function(){self.setSelection(n,i)})},vn.prototype.autoResize=function(){var t=this.parent,e=this.content,n=parseInt(this.style.fontSize)||12;if(e.scrollHeight>t.offsetHeight||e.scrollHeight
');var d=function(f){Nu(f),$o(f);var v=Lf(jf(u+f.clientX-c,i),o),g=Lf(jf(p+f.clientY-l,r),a);e.style.width=v+"px",e.style.height=g+"px",t.resizeHandler({width:u,height:p,dx:f.clientX-c,dy:f.clientY-l})},y=function(f){Nu(f),$o(f),ct.unbind(document,"mousemove",d,!1),ct.unbind(document,"mouseup",y,!1)};ct.bind(n,"mousedown",function(f){Nu(f),$o(f),c=f.clientX,l=f.clientY;var v=e.getBoundingClientRect();u=v.width,p=v.height,ct.bind(document,"mousemove",d),ct.bind(document,"mouseup",y)})}z(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),e.appendChild(n)},vn.prototype.destroy=function(){var t=this.parent,e=this.content,n=this.resizeHandle;e.innerText="",t.removeAttribute("style"),e.removeAttribute("style"),ct.unbind(e,"keydown",this.keyHandler),ct.unbind(e,"mousedown",$o),ct.unbind(e,"input",this.autoResize),ct.unbind(e,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Tn(n)),Tn(t)},vn.prototype.getValue=function(){return this.content.innerText.trim()},vn.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},vn.prototype.setSelection=function(t,e){var n=document.createRange();t===null?n.selectNodeContents(this.content):(n.setStart(t,e),n.setEnd(t,e));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},en.$inject=["eventBus","canvas"],en.prototype.registerProvider=function(t){this._providers.push(t)},en.prototype.isActive=function(t){return!(!this._active||t&&this._active.element!==t)},en.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},en.prototype._fire=function(t,e){this._eventBus.fire("directEditing."+t,e||{active:this._active})},en.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},en.prototype.complete=function(){var t=this._active;if(t){var e,n=t.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue();r===t.context.text&&i.height===n.height&&i.width===n.width||(e=this._textbox.container.getBoundingClientRect(),t.provider.update(t.element,r,t.context.text,{x:i.left-e.left,y:i.top-e.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},en.prototype.getValue=function(){return this._textbox.getValue()},en.prototype._handleKey=function(t){t.stopPropagation();var e=t.keyCode||t.charCode;return e===27?(t.preventDefault(),this.cancel()):e!==13||t.shiftKey?void 0:(t.preventDefault(),this.complete())},en.prototype._handleResize=function(t){this._fire("resize",t)},en.prototype.activate=function(t){var e;this.isActive()&&this.cancel();var n=kt(this._providers,function(i){return(e=i.activate(t))?i:null});return e&&(this.$textbox=this._textbox.create(e.bounds,e.style,e.text,e.options),this._active={element:t,context:e,provider:n},e.options&&e.options.resizable&&(this.resizable=!0),this._fire("activate")),!!e};const Vf={__depends__:[Bo],__init__:["directEditing"],directEditing:["type",en]};var Ff=".entry";function nn(t,e,n){this._eventBus=e,this._overlays=n;var i=Xe(t&&t.scale)?t.scale:{min:1,max:1.5};this._overlaysConfig={position:{right:-9,top:-6},scale:i},this._current=null,this._init()}nn.$inject=["config.contextPad","eventBus","overlays"],nn.prototype._init=function(){var t=this._eventBus,e=this;t.on("selection.changed",function(n){var i=n.newSelection;i.length===1?e.open(i[0]):e.close()}),t.on("elements.delete",function(n){L(n.elements,function(i){e.isOpen(i)&&e.close()})}),t.on("element.changed",function(n){var i=n.element,r=e._current;r&&r.element===i&&e.open(i,!0)})},nn.prototype.registerProvider=function(t,e){e||(e=t,t=1e3),this._eventBus.on("contextPad.getProviders",t,function(n){n.providers.push(e)})},nn.prototype.getEntries=function(t){var e=this._getProviders(),n={};return L(e,function(i){var r=i.getContextPadEntries(t);fe(r)?n=r(n):L(r,function(o,a){n[a]=o})}),n},nn.prototype.trigger=function(t,e,n){var i,r,o=this._current.element,a=this._current.entries,c=e.delegateTarget||e.target;if(!c)return e.preventDefault();if(i=a[ze(c,"data-action")].action,r=e.originalEvent||e,fe(i)){if(t==="click")return i(r,o,n)}else if(i[t])return i[t](r,o,n);e.preventDefault()},nn.prototype.open=function(t,e){!e&&this.isOpen(t)||(this.close(),this._updateAndOpen(t))},nn.prototype._getProviders=function(){var t=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},nn.prototype._updateAndOpen=function(t){var e=this.getEntries(t),n=this.getPad(t),i=n.html;L(e,function(r,o){var a,c=r.group||"default",l=Lt(r.html||'
');ze(l,"data-action",o),(a=Ut("[data-group="+c+"]",i))||(a=Lt('
'),i.appendChild(a)),a.appendChild(l),r.className&&function(u,p){var d=ne(u);(gt(p)?p:p.split(/\s+/g)).forEach(function(y){d.add(y)})}(l,r.className),r.title&&ze(l,"title",r.title),r.imageUrl&&l.appendChild(Lt(''))}),ne(i).add("open"),this._current={element:t,pad:n,entries:e},this._eventBus.fire("contextPad.open",{current:this._current})},nn.prototype.getPad=function(t){if(this.isOpen())return this._current.pad;var e=this,n=this._overlays,i=Lt('
'),r=z({html:i},this._overlaysConfig);$e.bind(i,Ff,"click",function(a){e.trigger("click",a)}),$e.bind(i,Ff,"dragstart",function(a){e.trigger("dragstart",a)}),ct.bind(i,"mousedown",function(a){a.stopPropagation()}),this._overlayId=n.add(t,"context-pad",r);var o=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{element:t,pad:o}),o},nn.prototype.close=function(){this.isOpen()&&(this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},nn.prototype.isOpen=function(t){return!(!this._current||t&&this._current.element!==t)};const nE={__depends__:[Bo,pu],contextPad:["type",nn]};var iE=["marker-start","marker-mid","marker-end"],rE=["circle","ellipse","line","path","polygon","polyline","rect"];function tr(t,e,n,i){this._elementRegistry=t,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;e.on("drag.cleanup",function(){L(r._clonedMarkers,function(o){Zt(o)}),r._clonedMarkers={}})}tr.$inject=["elementRegistry","eventBus","canvas","styles"],tr.prototype.getGfx=function(t){return this._elementRegistry.getGraphics(t)},tr.prototype.addDragger=function(t,e,n){var i=vd(n=n||this.getGfx(t)),r=n.getBoundingClientRect();return this._cloneMarkers(is(i)),K(i,this._styles.cls("djs-dragger",[],{x:r.top,y:r.left})),lt(e,i),i},tr.prototype.addFrame=function(t,e){var n=ot("rect",{class:"djs-resize-overlay",width:t.width,height:t.height,x:t.x,y:t.y});return lt(e,n),n},tr.prototype._cloneMarkers=function(t){var e=this;if(t.childNodes)for(var n=0;n0,a=r&&Ar(r)>0;return!o&&!a},Qt.prototype.open=function(t,e,n){var i=this._getProviders(e);if(!t)throw new Error("Element is missing");if(!i||!i.length)throw new Error("No registered providers for: "+e);if(!n)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");var r=this._current={className:e,element:t,position:n},o=this._getEntries(t,i),a=this._getHeaderEntries(t,i);r.entries=z({},o,a),r.container=this._createContainer(),Ar(a)&&r.container.appendChild(this._createEntries(a,"djs-popup-header")),Ar(o)&&r.container.appendChild(this._createEntries(o,"djs-popup-body"));var c=this._canvas.getContainer();this._attachContainer(r.container,c,n.cursor),this._bindAutoClose()},Qt.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindAutoClose(),Tn(this._current.container),this._current.container=null)},Qt.prototype.isOpen=function(){return!!this._current.container},Qt.prototype.trigger=function(t){t.preventDefault();var e=ze(t.delegateTarget||t.target,Kf),n=this._getEntry(e);if(n.action)return n.action.call(null,t,n)},Qt.prototype._getProviders=function(t){var e=this._eventBus.createEvent({type:"popupMenu.getProviders."+t,providers:[]});return this._eventBus.fire(e),e.providers},Qt.prototype._getEntries=function(t,e){var n={};return L(e,function(i){if(i.getPopupMenuEntries){var r=i.getPopupMenuEntries(t);fe(r)?n=r(n):L(r,function(o,a){n[a]=o})}else L(i.getEntries(t),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=zn(o,["id"])})}),n},Qt.prototype._getHeaderEntries=function(t,e){var n={};return L(e,function(i){if(i.getPopupMenuHeaderEntries){var r=i.getPopupMenuHeaderEntries(t);fe(r)?n=r(n):L(r,function(o,a){n[a]=o})}else{if(!i.getHeaderEntries)return;L(i.getHeaderEntries(t),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=zn(o,["id"])})}}),n},Qt.prototype._getEntry=function(t){var e=this._current.entries[t];if(!e)throw new Error("entry not found");return e},Qt.prototype._emit=function(t){this._eventBus.fire("popupMenu."+t)},Qt.prototype._createContainer=function(){var t=Lt('
'),e=this._current.position,n=this._current.className;return z(t.style,{position:"absolute",left:e.x+"px",top:e.y+"px",visibility:"hidden"}),ne(t).add(n),t},Qt.prototype._attachContainer=function(t,e,n){var i=this;$e.bind(t,".entry","click",function(r){i.trigger(r)}),this._updateScale(t),e.appendChild(t),n&&this._assureIsInbounds(t,n)},Qt.prototype._updateScale=function(t){var e,n,i=this._canvas.zoom(),r=this._config.scale,o=i;r!==!0&&(r===!1?(e=1,n=1):(e=r.min,n=r.max),Xe(e)&&in&&(o=n)),function(a,c){a.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(l){a.style[l+"transform"]=c})}(t,"scale("+o+")")},Qt.prototype._assureIsInbounds=function(t,e){var n,i,r=this._canvas._container.getBoundingClientRect(),o=t.offsetLeft,a=t.offsetTop,c=t.scrollWidth,l=t.scrollHeight,u={},p=e.x-r.left,d=e.y-r.top;o+c>r.width&&(u.x=!0),a+l>r.height&&(u.y=!0),u.x&&u.y?(n=p-c+"px",i=d-l+"px"):u.x?(n=p-c+"px",i=d+"px"):u.y&&d"),i=this;return ne(n).add(e),L(t,function(r,o){var a=i._createEntry(r,o);n.appendChild(a)}),n},Qt.prototype._createEntry=function(t,e){var n=Lt("
"),i=ne(n);if(i.add("entry"),t.className&&t.className.split(" ").forEach(function(o){i.add(o)}),ze(n,Kf,e),t.label){var r=Lt("");r.textContent=t.label,n.appendChild(r)}return t.imageUrl&&n.appendChild(Lt('')),t.active===!0&&i.add("active"),t.disabled===!0&&i.add("disabled"),t.title&&(n.title=t.title),n},Qt.prototype._bindAutoClose=function(){this._eventBus.once(Yf,this.close,this)},Qt.prototype._unbindAutoClose=function(){this._eventBus.off(Yf,this.close,this)};const aE={__init__:["popupMenu"],popupMenu:["type",Qt]};function Ho(){}Ho.prototype.get=function(){return this._data},Ho.prototype.set=function(t){this._data=t},Ho.prototype.clear=function(){var t=this._data;return delete this._data,t},Ho.prototype.isEmpty=function(){return!this._data};const sE={clipboard:["type",Ho]};function Iu(t){var e=this;function n(i){e._lastMoveEvent=i}this._lastMoveEvent=null,t.on("canvas.init",function(i){(e._svg=i.svg).addEventListener("mousemove",n)}),t.on("canvas.destroy",function(){e._lastMouseEvent=null,e._svg.removeEventListener("mousemove",n)})}Iu.$inject=["eventBus"],Iu.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(t,e){var n=document.createEvent("MouseEvent"),i=t,r=e,o=t,a=e;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null),n}(0,0)};const qo={__init__:["mouse"],mouse:["type",Iu]};function yn(t,e,n,i,r,o,a,c){this._canvas=t,this._create=e,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=c,r.on("copyPaste.copyElement",function(l){var u=l.descriptor,p=l.element,d=l.elements;u.priority=1,u.id=p.id,kt(d,function(y){return y===p.parent})&&(u.parent=p.parent.id),function(y){return!!y.host}(p)&&(u.priority=2,u.host=p.host.id),Ps(p)&&(u.priority=3,u.source=p.source.id,u.target=p.target.id,u.waypoints=function(y){return ae(y.waypoints,function(f){return(f=Jf(f)).original&&(f.original=Jf(f.original)),f})}(p)),Ms(p)&&(u.priority=4,u.labelTarget=p.labelTarget.id),L(["x","y","width","height"],function(y){ht(p[y])&&(u[y]=p[y])}),u.hidden=p.hidden,u.collapsed=p.collapsed}),r.on("copyPaste.pasteElements",function(l){z(l.hints,{createElementsBehavior:!1})})}function Ps(t){return!!t.waypoints}function Ms(t){return!!t.labelTarget}function Jf(t){return z({},t)}function Zf(t,e){var n=e.indexOf(t);return n===-1?e:e.splice(n,1)}yn.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],yn.prototype.copy=function(t){var e,n;return gt(t)||(t=t?[t]:[]),n=(e=this._eventBus.fire("copyPaste.canCopyElements",{elements:t}))===!1?{}:this.createTree(gt(e)?e:t),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:t,tree:n}),n},yn.prototype.paste=function(t){var e=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=t&&t.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(e);if(t&&t.element&&t.point)return this._paste(i,t.element,t.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},yn.prototype._paste=function(t,e,n,i){L(t,function(o){ht(o.x)||(o.x=0),ht(o.y)||(o.y=0)});var r=ve(t);return L(t,function(o){Ps(o)&&(o.waypoints=ae(o.waypoints,function(a){return{x:a.x-r.x-r.width/2,y:a.y-r.y-r.height/2}})),z(o,{x:o.x-r.x-r.width/2,y:o.y-r.y-r.height/2})}),this._modeling.createElements(t,n,e,z({},i))},yn.prototype._createElements=function(t){var e=this,n=this._eventBus,i={},r=[];return L(t,function(o,a){L(o=Ke(o,"priority"),function(c){var l,u=z({},zn(c,["priority"]));return i[c.parent]?u.parent=i[c.parent]:delete u.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:u}),Ps(u)?(u.source=i[c.source],u.target=i[c.target],l=i[c.id]=e.createConnection(u),void r.push(l)):Ms(u)?(u.labelTarget=i[u.labelTarget],l=i[c.id]=e.createLabel(u),void r.push(l)):(u.host&&(u.host=i[u.host]),l=i[c.id]=e.createShape(u),void r.push(l))})}),r},yn.prototype.createConnection=function(t){return this._elementFactory.createConnection(zn(t,["id"]))},yn.prototype.createLabel=function(t){return this._elementFactory.createLabel(zn(t,["id"]))},yn.prototype.createShape=function(t){return this._elementFactory.createShape(zn(t,["id"]))},yn.prototype.hasRelations=function(t,e){var n,i;return!(Ps(t)&&(n=kt(e,Ye({id:t.source.id})),i=kt(e,Ye({id:t.target.id})),!n||!i))&&!(Ms(t)&&!kt(e,Ye({id:t.labelTarget.id})))},yn.prototype.createTree=function(t){var e=this._rules,n=this,i={},r=[];function o(a,c){var l=kt(r,function(u){return a===u.element});l?l.depth=120&&z(d,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:p("Divide into two Lanes"),action:{click:g(2)}}}),t.height>=180&&z(d,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:p("Divide into three Lanes"),action:{click:g(3)}}})),z(d,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:p("Add Lane below"),action:{click:function(S,w){n.addLane(w,"bottom")}}}})}A(y,"bpmn:FlowNode")&&(A(y,"bpmn:EventBasedGateway")?z(d,{"append.receive-task":v("bpmn:ReceiveTask","bpmn-icon-receive-task",p("Append ReceiveTask")),"append.message-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",p("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",p("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",p("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",p("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):uv(y,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?z(d,{"append.compensation-activity":v("bpmn:Task","bpmn-icon-task",p("Append compensation activity"),{isForCompensation:!0})}):A(y,"bpmn:EndEvent")||y.isForCompensation||uv(y,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||je(y)||z(d,{"append.end-event":v("bpmn:EndEvent","bpmn-icon-end-event-none",p("Append EndEvent")),"append.gateway":v("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",p("Append Gateway")),"append.append-task":v("bpmn:Task","bpmn-icon-task",p("Append Task")),"append.intermediate-event":v("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",p("Append Intermediate/Boundary Event"))})),a.isEmpty(t,"bpmn-replace")||z(d,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:p("Change type"),action:{click:function(S,w){var C=z(function(B){var s=c.getContainer(),h=e.getPad(B).html,m=s.getBoundingClientRect(),_=h.getBoundingClientRect(),T=_.top-m.top;return{x:_.left-m.left,y:T+_.height+5}}(w),{cursor:{x:S.x,y:S.y}});a.open(w,"bpmn-replace",C)}}}}),wt(y,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(d,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using "+(y.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:f,dragstart:f}}}),A(y,"bpmn:TextAnnotation")&&z(d,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using Association"),action:{click:f,dragstart:f}}}),wt(y,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(d,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using DataInputAssociation"),action:{click:f,dragstart:f}}}),A(y,"bpmn:Group")&&z(d,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation")});var E=l.allowed("elements.delete",{elements:[t]});return gt(E)&&(E=E[0]===t),E&&z(d,{delete:{group:"edit",className:"bpmn-icon-trash",title:p("Remove"),action:{click:function(S){n.removeElements([t])}}}}),d};const ME={__depends__:[Vf,nE,Mn,Ru,ks,TE],__init__:["contextPadProvider"],contextPadProvider:["type",Ou]};var RE={horizontal:["x","width"],vertical:["y","height"]};function Jn(t){this._modeling=t,this._filters=[],this.registerFilter(function(e,n,i){var r,o=0,a=0;return L(e,function(c){c.waypoints||c.labelTarget||(o+=c[i],a+=1)}),r=Math.round(o/a),mt(e,function(c){return c[i]=Math.min(e.min,e.max)&&Math.min(t.min,t.max)<=Math.max(e.min,e.max)},Jn.prototype._findRange=function(t){var e=t[this._axis];return{min:e+5,max:e+t[this._dimension]-5}};const NE={__init__:["distributeElements"],distributeElements:["type",Jn]};function pv(t){t.registerFilter(function(e){return mt(e,function(n){var i=wt(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:Participant","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)})})}pv.$inject=["distributeElements"];const IE={__depends__:[NE],__init__:["bpmnDistributeElements"],bpmnDistributeElements:["type",pv]};var hv="is not a registered action";function on(t,e){this._actions={};var n=this;t.on("diagram.init",function(){n._registerDefaultActions(e),t.fire("editorActions.init",{editorActions:n})})}function Lu(t,e){return new Error(t+" "+e)}on.$inject=["eventBus","injector"],on.prototype._registerDefaultActions=function(t){var e=t.get("commandStack",!1),n=t.get("modeling",!1),i=t.get("selection",!1),r=t.get("zoomScroll",!1),o=t.get("copyPaste",!1),a=t.get("canvas",!1),c=t.get("rules",!1),l=t.get("keyboardMove",!1),u=t.get("keyboardMoveSelection",!1);e&&(this.register("undo",function(){e.undo()}),this.register("redo",function(){e.redo()})),o&&i&&this.register("copy",function(){var p=i.get();o.copy(p)}),o&&this.register("paste",function(){o.paste()}),r&&this.register("stepZoom",function(p){r.stepZoom(p.value)}),a&&this.register("zoom",function(p){a.zoom(p.value)}),n&&i&&c&&this.register("removeSelection",function(){var p=i.get();if(p.length){var d,y=c.allowed("elements.delete",{elements:p});y!==!1&&(d=gt(y)?y:p).length&&n.removeElements(d.slice())}}),l&&this.register("moveCanvas",function(p){l.moveCanvas(p)}),u&&this.register("moveSelection",function(p){u.moveSelection(p.direction,p.accelerated)})},on.prototype.trigger=function(t,e){if(!this._actions[t])throw Lu(t,hv);return this._actions[t](e)},on.prototype.register=function(t,e){var n=this;if(typeof t=="string")return this._registerAction(t,e);L(t,function(i,r){n._registerAction(r,i)})},on.prototype._registerAction=function(t,e){if(this.isRegistered(t))throw Lu(t,"is already registered");this._actions[t]=e},on.prototype.unregister=function(t){if(!this.isRegistered(t))throw Lu(t,hv);this._actions[t]=void 0},on.prototype.getActions=function(){return Object.keys(this._actions)},on.prototype.isRegistered=function(t){return!!this._actions[t]};const DE={__init__:["editorActions"],editorActions:["type",on]};function js(t){t.invoke(on,this)}rt(js,on),js.$inject=["injector"],js.prototype._registerDefaultActions=function(t){on.prototype._registerDefaultActions.call(this,t);var e=t.get("canvas",!1),n=t.get("elementRegistry",!1),i=t.get("selection",!1),r=t.get("spaceTool",!1),o=t.get("lassoTool",!1),a=t.get("handTool",!1),c=t.get("globalConnect",!1),l=t.get("distributeElements",!1),u=t.get("alignElements",!1),p=t.get("directEditing",!1),d=t.get("searchPad",!1),y=t.get("modeling",!1);e&&n&&i&&this._registerAction("selectElements",function(){var f=e.getRootElement(),v=n.filter(function(g){return g!==f});return i.select(v),v}),r&&this._registerAction("spaceTool",function(){r.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),c&&this._registerAction("globalConnectTool",function(){c.toggle()}),i&&l&&this._registerAction("distributeElements",function(f){var v=i.get(),g=f.type;v.length&&l.trigger(v,g)}),i&&u&&this._registerAction("alignElements",function(f){var v=i.get(),g=[],b=f.type;v.length&&(g=mt(v,function(E){return!A(E,"bpmn:Lane")}),u.trigger(g,b))}),i&&y&&this._registerAction("setColor",function(f){var v=i.get();v.length&&y.setColor(v,f)}),i&&p&&this._registerAction("directEditing",function(){var f=i.get();f.length&&p.activate(f[0])}),d&&this._registerAction("find",function(){d.toggle()}),e&&y&&this._registerAction("moveToOrigin",function(){var f,v,g=e.getRootElement();f=ve(v=A(g,"bpmn:Collaboration")?n.filter(function(b){return A(b.parent,"bpmn:Collaboration")}):n.filter(function(b){return b!==g&&!A(b.parent,"bpmn:SubProcess")})),y.moveElements(v,{x:-f.x,y:-f.y},g)})};const BE={__depends__:[DE],editorActions:["type",js]};function dv(t){t.on(["create.init","shape.move.init"],function(e){var n=e.context;wt(e.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}dv.$inject=["eventBus"];function ju(t,e,n){return n||(n="round"),Math[n](t/e)*e}function Si(t,e,n){var i=!n||n.active!==!1;this._eventBus=e;var r=this;e.on("diagram.init",800,function(){r.setActive(i)}),e.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],1200,function(o){var a=o.originalEvent;if(!(!r.active||a&&He(a))){var c=o.context,l=c.gridSnappingContext;l||(l=c.gridSnappingContext={}),["x","y"].forEach(function(u){var p={},d=function(f,v,g){var b=f.context,E=f.shape,S=b.gridSnappingContext,w=S.snapLocation,C=S.snapOffset;return C&&ht(C[v])||(C||(C=S.snapOffset={}),ht(C[v])||(C[v]=0),!E)||(g.get(E.id)||(Vs(v)?C[v]+=E[v]+E.width/2:C[v]+=E[v]+E.height/2),!w)||(v==="x"?/left/.test(w)?C[v]-=E.width/2:/right/.test(w)&&(C[v]+=E.width/2):/top/.test(w)?C[v]-=E.height/2:/bottom/.test(w)&&(C[v]+=E.height/2)),C[v]}(o,u,t);d&&(p.offset=d);var y=function(f,v){var g=f.context,b=g.createConstraints,E=g.resizeConstraints||{},S=g.gridSnappingContext,w=S.snapConstraints;if(w&&w[v])return w[v];w||(w=S.snapConstraints={}),w[v]||(w[v]={});var C=g.direction;b&&(Vs(v)?(w.x.min=b.left,w.x.max=b.right):(w.y.min=b.top,w.y.max=b.bottom));var B=E.min,s=E.max;return B&&(Vs(v)?fv(C)?w.x.max=B.left:w.x.min=B.right:mv(C)?w.y.max=B.top:w.y.min=B.bottom),s&&(Vs(v)?fv(C)?w.x.min=s.left:w.x.max=s.right:mv(C)?w.y.min=s.top:w.y.max=s.bottom),w[v]}(o,u);y&&z(p,y),Yr(o,u)||r.snapEvent(o,u,p)})}})}function Vs(t){return t==="x"}function mv(t){return t.indexOf("n")!==-1}function fv(t){return t.indexOf("w")!==-1}function er(t,e){Q.call(this,t),this._gridSnapping=e;var n=this;this.preExecute("shape.resize",function(i){var r=i.context,o=(r.hints||{}).autoResize;if(o){var a=r.shape,c=r.newBounds;Ie(o)?r.newBounds=n.snapComplex(c,o):r.newBounds=n.snapSimple(a,c)}})}Si.prototype.snapEvent=function(t,e,n){re(t,e,this.snapValue(t[e],n))},Si.prototype.getGridSpacing=function(){return 10},Si.prototype.snapValue=function(t,e){var n,i,r=0;return e&&e.offset&&(r=e.offset),t=ju(t+=r,10),e&&e.min&&ht(n=e.min)&&(n=ju(n+r,10,"ceil"),t=Math.max(t,n)),e&&e.max&&ht(i=e.max)&&(i=ju(i+r,10,"floor"),t=Math.min(t,i)),t-=r},Si.prototype.isActive=function(){return this.active},Si.prototype.setActive=function(t){this.active=t,this._eventBus.fire("gridSnapping.toggle",{active:t})},Si.prototype.toggleActive=function(){this.setActive(!this.active)},Si.$inject=["elementRegistry","eventBus","config.gridSnapping"],er.$inject=["eventBus","gridSnapping","modeling"],rt(er,Q),er.prototype.snapSimple=function(t,e){var n=this._gridSnapping;return e.width=n.snapValue(e.width,{min:e.width}),e.height=n.snapValue(e.height,{min:e.height}),e.x=t.x+t.width/2-e.width/2,e.y=t.y+t.height/2-e.height/2,e},er.prototype.snapComplex=function(t,e){return/w|e/.test(e)&&(t=this.snapHorizontally(t,e)),/n|s/.test(e)&&(t=this.snapVertically(t,e)),t},er.prototype.snapHorizontally=function(t,e){var n=this._gridSnapping,i=/w/.test(e),r=/e/.test(e),o={};return o.width=n.snapValue(t.width,{min:t.width}),r&&(i?(o.x=n.snapValue(t.x,{max:t.x}),o.width+=n.snapValue(t.x-o.x,{min:t.x-o.x})):t.x=t.x+t.width-o.width),z(t,o),t},er.prototype.snapVertically=function(t,e){var n=this._gridSnapping,i=/n/.test(e),r=/s/.test(e),o={};return o.height=n.snapValue(t.height,{min:t.height}),i&&(r?(o.y=n.snapValue(t.y,{max:t.y}),o.height+=n.snapValue(t.y-o.y,{min:t.y-o.y})):t.y=t.y+t.height-o.height),z(t,o),t};function vv(t,e){t.on(["spaceTool.move","spaceTool.end"],2e3,function(n){var i,r=n.context;r.initialized&&(r.axis==="x"?(i=e.snapValue(n.dx),n.x=n.x+i-n.dx,n.dx=i):(i=e.snapValue(n.dy),n.y=n.y+i-n.dy,n.dy=i))})}vv.$inject=["eventBus","gridSnapping"];const OE={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",er],gridSnappingSpaceToolBehavior:["type",vv]}],__init__:["gridSnapping"],gridSnapping:["type",Si]};function yv(t,e){t.on("autoPlace",2e3,function(n){var i=n.source,r=vt(i),o=n.shape,a=nf(i,o);return["x","y"].forEach(function(c){var l={};a[c]!==r[c]&&(a[c]>r[c]?l.min=a[c]:l.max=a[c],A(o,"bpmn:TextAnnotation")&&(function(u){return u==="x"}(c)?l.offset=-o.width/2:l.offset=-o.height/2),a[c]=e.snapValue(a[c],l))}),a})}yv.$inject=["eventBus","gridSnapping"];function gv(t,e,n){e.on(["create.start","shape.move.start"],1750,function(i){var r=i.context,o=r.shape,a=t.getRootElement();A(o,"bpmn:Participant")&&A(a,"bpmn:Process")&&a.children.length&&r.createConstraints&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))})}gv.$inject=["canvas","eventBus","gridSnapping"];function Fs(t,e,n){Q.call(this,t),this._gridSnapping=e;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,function(r){var o=r.context,a=o.connection,c=o.hints||{},l=a.waypoints;c.connectionStart||c.connectionEnd||c.createElementsBehavior===!1||function(u){return u.length>3}(l)&&n.updateWaypoints(a,i.snapMiddleSegments(l))})}function LE(t,e,n){var i=Gn(e,n),r={};return function(o){return o==="h"}(i)&&(r.y=t.snapValue(e.y)),function(o){return o==="v"}(i)&&(r.x=t.snapValue(e.x)),("x"in r||"y"in r)&&(e=z({},e,r),n=z({},n,r)),[e,n]}Fs.$inject=["eventBus","gridSnapping","modeling"],rt(Fs,Q),Fs.prototype.snapMiddleSegments=function(t){var e,n=this._gridSnapping;t=t.slice();for(var i=1;i5&&K(c,{x:a.x,width:a.width}),a.height>5&&K(c,{y:a.y,height:a.height}),r.canExecute?bt(c).remove(Av):bt(c).add(Av)}),t.on("resize.cleanup",function(i){var r,o;r=i.context,o=r.shape,r.frame&&Zt(r.frame),e.removeMarker(o,Tv)})}kv.$inject=["eventBus","canvas","previewSupport"];var Pv=-6,Jo="djs-resizer",qE=["n","w","s","e","nw","ne","se","sw"];function Ci(t,e,n,i){this._resize=i,this._canvas=e;var r=this;t.on("selection.changed",function(o){var a=o.newSelection;r.removeResizers(),a.length===1&&L(a,_e(r.addResizer,r))}),t.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}Ci.prototype.makeDraggable=function(t,e,n){var i=this._resize;function r(o){Ei(o)&&i.activate(o,t,n)}ct.bind(e,"mousedown",r),ct.bind(e,"touchstart",r)},Ci.prototype._createResizer=function(t,e,n,i){var r=this._getResizersParent(),o=function(u){var p={x:0,y:0};return u.indexOf("e")!==-1?p.x=6:u.indexOf("w")!==-1&&(p.x=Pv),u.indexOf("s")!==-1?p.y=6:u.indexOf("n")!==-1&&(p.y=Pv),p}(i),a=ot("g");bt(a).add(Jo),bt(a).add(Jo+"-"+t.id),bt(a).add(Jo+"-"+i),lt(r,a);var c=ot("rect");K(c,{x:-2+o.x,y:-2+o.y,width:4,height:4}),bt(c).add(Jo+"-visual"),lt(a,c);var l=ot("rect");return K(l,{x:-10+o.x,y:-10+o.y,width:20,height:20}),bt(l).add(Jo+"-hit"),lt(a,l),Zl(a,e,n),a},Ci.prototype.createResizer=function(t,e){var n=Cv(t,e),i=this._createResizer(t,n.x,n.y,e);this.makeDraggable(t,i,e)},Ci.prototype.addResizer=function(t){var e=this;this._resize.canResize({shape:t})&&L(qE,function(n){e.createResizer(t,n)})},Ci.prototype.removeResizers=function(){Dl(this._getResizersParent())},Ci.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},Ci.$inject=["eventBus","canvas","selection","resize"];const Mv={__depends__:[In,Kn,Go],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Yo],resizePreview:["type",kv],resizeHandles:["type",Ci]};function Vu(t,e){var n=e.create("bpmn:CategoryValue"),i=e.create("bpmn:Category",{categoryValue:[n]});return Xt(t.get("rootElements"),i),et(i).$parent=t,et(n).$parent=i,n}function Zo(t,e,n,i,r,o,a){function c(l,u){(u||wt(l,["bpmn:Task","bpmn:TextAnnotation"])||Fu(l))&&i.activate(l)}this._bpmnFactory=e,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),t.on("element.dblclick",function(l){c(l.element,!0)}),t.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open"],function(l){i.isActive()&&i.complete()}),t.on(["commandStack.changed"],function(l){i.isActive()&&i.cancel()}),t.on("directEditing.activate",function(l){o.removeResizers()}),t.on("create.end",500,function(l){var u=l.context,p=u.shape,d=l.context.canExecute;l.isTouch||d&&(u.hints&&u.hints.createElementsBehavior===!1||c(p))}),t.on("autoPlace.end",500,function(l){c(l.shape)})}function Fu(t){return A(t,"bpmn:SubProcess")&&!Pt(t)}Zo.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],Zo.prototype.activate=function(t){var e=mn(t);if(e!==void 0){var n={text:e};z(n,this.getEditingBBox(t));var i={};return(wt(t,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||Fu(t))&&z(i,{centerVertically:!0}),$r(t)&&z(i,{autoResize:!0}),A(t,"bpmn:TextAnnotation")&&z(i,{resizable:!0,autoResize:!0}),z(n,{options:i}),n}},Zo.prototype.getEditingBBox=function(t){var e=this._canvas,n=t.label||t,i=e.getAbsoluteBBox(n),r=i.x+i.width/2,o=i.y+i.height/2,a={x:i.x,y:i.y},c=e.zoom(),l=this._textRenderer.getDefaultStyle(),u=this._textRenderer.getExternalStyle(),p=u.fontSize*c,d=u.lineHeight,y=l.fontSize*c,f=l.lineHeight,v={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(A(t,"bpmn:Lane")||function(B){return A(B,"bpmn:Participant")&&Pt(B)}(t))&&(z(a,{width:i.height,height:30*c,x:i.x-i.height/2+15*c,y:o-30*c/2}),z(v,{fontSize:y+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px",transform:"rotate(-90deg)"})),(wt(t,["bpmn:Task","bpmn:CallActivity"])||function(B){return A(B,"bpmn:Participant")&&!Pt(B)}(t)||Fu(t))&&(z(a,{width:i.width,height:i.height}),z(v,{fontSize:y+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"})),function(B){return A(B,"bpmn:SubProcess")&&Pt(B)}(t)&&(z(a,{width:i.width,x:i.x}),z(v,{fontSize:y+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"}));var g=90*c,b=7*c,E=4*c;if(n.labelTarget&&(z(a,{width:g,height:i.height+b+E,x:r-g/2,y:i.y-b}),z(v,{fontSize:p+"px",lineHeight:d,paddingTop:b+"px",paddingBottom:E+"px"})),$r(n)&&!ms(n)&&!ge(n)){var S=fs(t),w=e.getAbsoluteBBox({x:S.x,y:S.y,width:0,height:0}),C=p+b+E;z(a,{width:g,height:C,x:w.x-g/2,y:w.y-C/2}),z(v,{fontSize:p+"px",lineHeight:d,paddingTop:b+"px",paddingBottom:E+"px"})}return A(t,"bpmn:TextAnnotation")&&(z(a,{width:i.width,height:i.height,minWidth:30*c,minHeight:10*c}),z(v,{textAlign:"left",paddingTop:5*c+"px",paddingBottom:7*c+"px",paddingLeft:7*c+"px",paddingRight:5*c+"px",fontSize:y+"px",lineHeight:f})),{bounds:a,style:v}},Zo.prototype.update=function(t,e,n,i){var r,o,a;if(A(t,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(t),r={x:t.x,y:t.y,width:t.width/o.width*i.width,height:t.height/o.height*i.height}),A(t,"bpmn:Group")&&!et(t).categoryValueRef){var c=Vu(et(this._canvas.getRootElement()).$parent,this._bpmnFactory);et(t).categoryValueRef=c}(a=e)&&a.trim()||(e=null),this._modeling.updateLabel(t,e,r)};var Rv="djs-element-hidden",Nv="djs-label-hidden";function Iv(t,e,n,i){var r,o,a,c=this,l=e.getDefaultLayer();t.on("directEditing.activate",function(u){var p=u.active;if(A(r=p.element.label||p.element,"bpmn:TextAnnotation")){o=e.getAbsoluteBBox(r),a=ot("g");var d=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:r.height,position:{mx:0,my:0}}),y=c.path=ot("path");K(y,{d,strokeWidth:2,stroke:WE(r)}),lt(a,y),lt(l,a),Oe(a,r.x,r.y)}A(r,"bpmn:TextAnnotation")||r.labelTarget?e.addMarker(r,Rv):(A(r,"bpmn:Task")||A(r,"bpmn:CallActivity")||A(r,"bpmn:SubProcess")||A(r,"bpmn:Participant"))&&e.addMarker(r,Nv)}),t.on("directEditing.resize",function(u){if(A(r,"bpmn:TextAnnotation")){var p=u.height,d=u.dy,y=Math.max(r.height/o.height*(p+d),0),f=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:y,position:{mx:0,my:0}});K(c.path,{d:f})}}),t.on(["directEditing.complete","directEditing.cancel"],function(u){var p=u.active;p&&(e.removeMarker(p.element.label||p.element,Rv),e.removeMarker(r,Nv)),r=void 0,o=void 0,a&&(Zt(a),a=void 0)})}function WE(t,e){return et(t).di.get("stroke")||e||"black"}Iv.$inject=["eventBus","canvas","elementRegistry","pathMap"];const XE={__depends__:[Sv,Mv,Vf],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Zo],labelEditingPreview:["type",Iv]};var zu=["top","bottom","left","right"],$s=10;function $u(t,e){function n(i){if(ms(i)){var r=function(o){var a=vt(o.label),c=vt(o),l=Dv(c,a);if(u=l,zu.indexOf(u)!==-1){var u,p=function(f){var v=vt(f),g=[].concat(f.incoming.map(function(b){return b.waypoints[b.waypoints.length-2]}),f.outgoing.map(function(b){return b.waypoints[1]})).map(function(b){return Dv(v,b)});return g}(o);if(o.host){var d=function(f){var v,g=f.host,b=vt(f),E=ye(b,g);v=E.indexOf("-")>=0?E.split("-"):[E];var S=zu.filter(function(w){return v.indexOf(w)===-1});return S}(o);p=p.concat(d)}var y=zu.filter(function(f){return p.indexOf(f)===-1});if(y.indexOf(l)===-1)return y[0]}}(i);r&&function(o,a){var c=vt(o),l=o.label,u=vt(l);if(l.parent){var p,d=st(o);switch(a){case"top":p={x:c.x,y:d.top-$s-l.height/2};break;case"left":p={x:d.left-$s-l.width/2,y:c.y};break;case"bottom":p={x:c.x,y:d.bottom+$s+l.height/2};break;case"right":p={x:d.right+$s+l.width/2,y:c.y}}var y=Rn(p,u);e.moveShape(l,y)}}(i,r)}}Q.call(this,t),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(i){var r=i.context,o=r.connection,a=o.source,c=o.target;(r.hints||{}).createElementsBehavior!==!1&&(n(a),n(c))}),this.postExecuted(["label.create"],function(i){var r=i.context,o=r.shape;(r.hints||{}).createElementsBehavior!==!1&&n(o.labelTarget)}),this.postExecuted(["elements.create"],function(i){var r=i.context,o=r.elements;(r.hints||{}).createElementsBehavior!==!1&&o.forEach(function(a){n(a)})})}function Dv(t,e){return ye(e,t,5)}function Gu(t,e,n){Q.call(this,t),this.preExecute("shape.append",function(i){var r=i.source,o=i.shape;i.position||(A(o,"bpmn:TextAnnotation")?i.position={x:r.x+r.width/2+75,y:r.y-50-o.height/2}:i.position={x:r.x+r.width+80+o.width/2,y:r.y+r.height/2})},!0)}function Uu(t,e){t.invoke(Q,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape;L(mt(r.incoming.concat(r.outgoing),function(o){return A(o,"bpmn:Association")}),function(o){e.moveConnection(o,{x:0,y:0},i)})},!0)}rt($u,Q),$u.$inject=["eventBus","modeling"],rt(Gu,Q),Gu.$inject=["eventBus","elementFactory","bpmnRules"],rt(Uu,Q),Uu.$inject=["injector","modeling"];function Gs(t,e){e.invoke(Q,this),this._bpmnReplace=t;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;(r=r.filter(function(o){return Bv(o,o.host)})).length===1&&r.map(function(o){return r.indexOf(o)}).forEach(function(o){var a=r[o];i.elements[o]=n.replaceShape(r[o],a)})},!0),this.preExecute("elements.move",500,function(i){var r=i.shapes,o=i.newHost;if(r.length===1){var a=r[0];Bv(a,o)&&(i.shapes=[n.replaceShape(a,o)])}},!0)}function Bv(t,e){return!ge(t)&&wt(t,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!e}Gs.$inject=["bpmnReplace","injector"],rt(Gs,Q),Gs.prototype.replaceShape=function(t,e){var n,i=(n=et(t).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:e};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(t,r,{layoutConnection:!1})};function Hu(t,e,n){function i(r){return mt(r.attachers,function(o){return A(o,"bpmn:BoundaryEvent")})}Q.call(this,t),this.postExecute("connection.create",function(r){var o=r.context.source,a=r.context.target,c=i(a);A(o,"bpmn:EventBasedGateway")&&A(a,"bpmn:ReceiveTask")&&c.length>0&&n.removeElements(c)}),this.postExecute("connection.reconnect",function(r){var o=r.context.oldSource,a=r.context.newSource;A(o,"bpmn:Gateway")&&A(a,"bpmn:EventBasedGateway")&&L(a.outgoing,function(c){var l=c.target,u=i(l);A(l,"bpmn:ReceiveTask")&&u.length>0&&n.removeElements(u)})}),t.on("moddleCopy.canCopyProperty",2e3,function(r){var o=r.parent,a=r.property,c=r.propertyName,l=e.getPropertyDescriptor(o,c);l&&l.isReference&&A(a,"bpmn:RootElement")&&o.set(c,a)})}Hu.$inject=["eventBus","moddle","modeling"],rt(Hu,Q);function qu(t,e,n,i,r){function o(u){return wt(u,["bpmn:ReceiveTask","bpmn:SendTask"])||function(p,d){return gt(d)||(d=[d]),ui(d,function(y){return ps(p,y)})}(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){return!!kt(t.getDefinitions().get("rootElements"),Ye({id:u.id}))}function c(u){return A(u,"bpmn:ErrorEventDefinition")?"errorRef":A(u,"bpmn:EscalationEventDefinition")?"escalationRef":A(u,"bpmn:MessageEventDefinition")?"messageRef":A(u,"bpmn:SignalEventDefinition")?"signalRef":void 0}function l(u){if(wt(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.get("messageRef");var p=u.get("eventDefinitions")[0];return p.get(c(p))}n.invoke(Q,this),this.executed("shape.create",function(u){var p=u.shape;if(o(p)){var d=l(et(p));d&&!a(d)&&(Xt(t.getDefinitions().get("rootElements"),d),u.addedRootElement=d)}},!0),this.reverted("shape.create",function(u){var p=u.addedRootElement;p&&Wt(t.getDefinitions().get("rootElements"),p)},!0),e.on("copyPaste.copyElement",function(u){var p=u.descriptor,d=u.element;if(o(d)){var y=l(et(d));y&&(p.referencedRootElement=y)}}),e.on("copyPaste.pasteElement",500,function(u){var p=u.descriptor,d=p.businessObject;if(o(d)){var y=p.referencedRootElement;y&&(a(y)||(y=i.copyElement(y,r.create(y.$type))),function(f,v){if(wt(f,["bpmn:ReceiveTask","bpmn:SendTask"]))return f.set("messageRef",v);var g=f.get("eventDefinitions")[0];g.set(c(g),v)}(d,y))}})}function Wu(t){t.invoke(Q,this),this.preExecute("shape.create",1500,function(e){var n=e.context,i=n.parent,r=n.shape;A(i,"bpmn:Lane")&&!A(r,"bpmn:Lane")&&(n.parent=_s(i,"bpmn:Participant"))})}qu.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],rt(qu,Q),Wu.$inject=["injector"],rt(Wu,Q);var Us=1500;function Ov(t,e,n){e.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],Us,function(i){var r=i.context.shape||i.shape,o=i.hover;A(o,"bpmn:Lane")&&!wt(r,["bpmn:Lane","bpmn:Participant"])&&(i.hover=gn(o),i.hoverGfx=t.getGraphics(i.hover));var a=n.getRootElement();o!==a&&(r.labelTarget||A(r,"bpmn:Group"))&&(i.hover=a,i.hoverGfx=t.getGraphics(i.hover))}),e.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],Us,function(i){var r=i.hover;A(r,"bpmn:Lane")&&(i.hover=gn(r)||r,i.hoverGfx=t.getGraphics(i.hover))}),e.on(["bendpoint.move.hover"],Us,function(i){var r=i.context,o=i.hover,a=r.type;A(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=gn(o)||o,i.hoverGfx=t.getGraphics(i.hover))}),e.on(["connect.start"],Us,function(i){var r=i.context,o=r.start;A(o,"bpmn:Lane")&&(r.start=gn(o)||o)}),e.on("shape.move.start",2e3,function(i){var r=i.shape;A(r,"bpmn:Lane")&&(i.shape=gn(r)||r)})}function Xu(t,e,n){Q.call(this,t),this.preExecute("shape.create",function(i){var r=i.context.shape;if(A(r,"bpmn:DataObjectReference")&&r.type!=="label"){var o=e.create("bpmn:DataObject");r.businessObject.dataObjectRef=o}})}Ov.$inject=["elementRegistry","eventBus","canvas"],Xu.$inject=["eventBus","bpmnFactory","moddle"],rt(Xu,Q);var Lv=20,jv=20,Hs=2e3;function Ku(t,e,n){function i(r){var o,a=r.parent,c=t.getRootElement();A(c,"bpmn:Collaboration")?o=c:(o=n.makeCollaboration(),r.process=a),r.parent=o}Q.call(this,e),e.on(["create.start","shape.move.start"],Hs,function(r){var o=r.context,a=o.shape,c=t.getRootElement();if(A(a,"bpmn:Participant")&&A(c,"bpmn:Process")&&c.children.length){var l=c.children.filter(function(d){return!A(d,"bpmn:Group")&&!ge(d)&&!function(y){return!!y.waypoints}(d)});if(l.length){var u=ve(l),p=function(d,y){y={width:y.width+40+30,height:y.height+40};var f=Math.max(d.width,y.width),v=Math.max(d.height,y.height);return{x:-f/2,y:-v/2,width:f,height:v}}(a,u);z(a,p),o.createConstraints=function(d,y){return y=st(y),{bottom:y.top+d.height/2-jv,left:y.right-d.width/2+Lv,top:y.bottom-d.height/2+jv,right:y.left+d.width/2-Lv-30}}(a,u)}}}),e.on("create.start",Hs,function(r){var o=r.context.shape,a=t.getRootElement(),c=t.getGraphics(a);function l(u){u.element=a,u.gfx=c}A(o,"bpmn:Participant")&&A(a,"bpmn:Process")&&(e.on("element.hover",Hs,l),e.once("create.cleanup",function(){e.off("element.hover",l)}))}),this.preExecute("shape.create",function(r){var o=r.parent;A(r.shape,"bpmn:Participant")&&A(o,"bpmn:Process")&&i(r)},!0),this.execute("shape.create",function(r){var o=r.process,a=r.shape;o&&(r.oldProcessRef=a.businessObject.processRef,a.businessObject.processRef=o.businessObject)},!0),this.revert("shape.create",function(r){var o=r.process,a=r.shape;o&&(a.businessObject.processRef=r.oldProcessRef)},!0),this.postExecute("shape.create",function(r){var o=r.process,a=r.shape;if(o){var c=o.children.slice();n.moveElements(c,{x:0,y:0},a)}},!0),this.preExecute("elements.create",Hs,function(r){var o,a=r.elements,c=r.parent;qs(a)&&A(c,"bpmn:Process")&&(i(r),o=qs(a),r.oldProcessRef=o.businessObject.processRef,o.businessObject.processRef=c.businessObject)},!0),this.revert("elements.create",function(r){var o=r.elements;r.process&&(qs(o).businessObject.processRef=r.oldProcessRef)},!0),this.postExecute("elements.create",function(r){var o,a=r.elements,c=r.process;if(c){o=qs(a);var l=c.children.slice();n.moveElements(l,{x:0,y:0},o)}},!0)}function qs(t){return kt(t,function(e){return A(e,"bpmn:Participant")})}Ku.$inject=["canvas","eventBus","modeling"],rt(Ku,Q);var Vv="__targetRef_placeholder";function Yu(t,e){function n(o,a){var c=o.get("properties"),l=kt(c,function(u){return u.name===Vv});return!l&&a&&Xt(c,l=e.create("bpmn:Property",{name:Vv})),l}function i(o,a){var c=n(o);c&&(function(l,u,p){return kt(l.get("dataInputAssociations"),function(d){return d!==p&&d.targetRef===u})}(o,c,a)||Wt(o.get("properties"),c))}function r(o){var a,c=o.context,l=c.connection,u=l.businessObject,p=l.target,d=p&&p.businessObject,y=c.newTarget,f=y&&y.businessObject,v=c.oldTarget||c.target,g=v&&v.businessObject,b=l.businessObject;g&&g!==d&&i(g,u),f&&f!==d&&i(f,u),d?(a=n(d,!0),b.targetRef=a):b.targetRef=null}Q.call(this,t),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Fv(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Fv(r))}function Fv(t){return function(e){if(A(e.context.connection,"bpmn:DataInputAssociation"))return t(e)}}function Ws(t){this._bpmnUpdater=t}function Ju(t,e,n,i){function r(a){return a.children.filter(function(c){return A(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function o(a,c){var l=a.businessObject||a;if(c=c||n.filter(function(p){return A(p,"bpmn:Participant")&&et(p).processRef})[0]){var u=c.businessObject||c;e.execute("dataStore.updateContainment",{dataStoreBo:l,newSemanticParent:u.processRef||u,newDiParent:u.di})}}Q.call(this,i),e.registerHandler("dataStore.updateContainment",Ws),this.preExecute("shape.create",function(a){var c=a.context,l=c.shape;A(l,"bpmn:DataStoreReference")&&l.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(a){var c=a.context,l=c.shapes;l.filter(function(u){return A(u,"bpmn:DataStoreReference")}).length&&(c.hints||(c.hints={}),c.hints.autoResize=l.filter(function(u){return!A(u,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(a){var c=a.context.shape,l=c.parent;A(c,"bpmn:DataStoreReference")&&c.type!=="label"&&A(l,"bpmn:Collaboration")&&o(c)}),this.postExecute("shape.move",function(a){var c=a.context,l=c.shape,u=c.oldParent,p=l.parent;A(u,"bpmn:Collaboration")||A(l,"bpmn:DataStoreReference")&&l.type!=="label"&&A(p,"bpmn:Collaboration")&&o(l,A(u,"bpmn:Participant")?u:function(d,y){for(;d.parent;){if(A(d.parent,y))return d.parent;d=d.parent}}(u,"bpmn:Participant"))}),this.postExecute("shape.delete",function(a){var c=a.context.shape,l=t.getRootElement();wt(c,["bpmn:Participant","bpmn:SubProcess"])&&A(l,"bpmn:Collaboration")&&r(l).filter(function(u){return function(p,d){for(var y=p.businessObject||p,f=d.businessObject||d;y.$parent;){if(y.$parent===f.processRef||f)return!0;y=y.$parent}return!1}(u,c)}).forEach(function(u){o(u)})}),this.postExecute("canvas.updateRoot",function(a){var c=a.context,l=c.oldRoot,u=c.newRoot;r(l).forEach(function(p){A(u,"bpmn:Process")&&o(p,u)})})}Yu.$inject=["eventBus","bpmnFactory"],rt(Yu,Q),Ws.$inject=["bpmnUpdater"],Ws.prototype.execute=function(t){var e=t.dataStoreBo,n=t.newSemanticParent,i=t.newDiParent;t.oldSemanticParent=e.$parent,t.oldDiParent=e.di.$parent,this._bpmnUpdater.updateSemanticParent(e,n),this._bpmnUpdater.updateDiParent(e.di,i)},Ws.prototype.revert=function(t){var e=t.dataStoreBo,n=t.oldSemanticParent,i=t.oldDiParent;this._bpmnUpdater.updateSemanticParent(e,n),this._bpmnUpdater.updateDiParent(e.di,i)},Ju.$inject=["canvas","commandStack","elementRegistry","eventBus"],rt(Ju,Q);function Zu(t,e,n){Q.call(this,t),this.postExecuted("shape.delete",500,function(i){var r=i.context,o=r.hints,a=r.shape,c=r.oldParent;A(a,"bpmn:Lane")&&(o&&o.nested||function(l,u){var p,d,y,f=wi(u),v=[],g=[];Hi(f,function(b){return b.y>l.y?g.push(b):v.push(b),b.children}),f.length&&(p=g.length&&v.length?l.height/2:l.height,v.length&&(d=n.calculateAdjustments(v,"y",p,l.y-10),n.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:p},"s")),g.length&&(y=n.calculateAdjustments(g,"y",-p,l.y+l.height+10),n.makeSpace(y.movingShapes,y.resizingShapes,{x:0,y:-p},"n")))}(a,c))})}Zu.$inject=["eventBus","modeling","spaceTool"],rt(Zu,Q);function Xs(t,e){e.invoke(Q,this),this._bpmnReplace=t;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;r.filter(function(o){return zv(o,o.host)}).map(function(o){return r.indexOf(o)}).forEach(function(o){i.elements[o]=n.replaceShape(r[o])})},!0),this.preExecute("elements.move",500,function(i){var r=i.shapes,o=i.newHost;r.forEach(function(a,c){var l,u=a.host;zv(a,(l=u,r.indexOf(l)!==-1?u:o))&&(r[c]=n.replaceShape(a))})},!0)}function zv(t,e){return!ge(t)&&A(t,"bpmn:BoundaryEvent")&&!e}function Qu(t,e,n){function i(r,o,a){var c,l,u,p,d,y,f,v,g=o.waypoints,b=r.outgoing.slice(),E=r.incoming.slice(),S=Su(g,v=ht(a.width)?vt(a):a);if(S){if(c=g.slice(0,S.index),l=g.slice(S.index+(S.bendpoint?1:0)),!c.length||!l.length)return;u=S.bendpoint?g[S.index]:v,c.length!==1&&$v(r,c[c.length-1])||c.push(Gv(u)),l.length!==1&&$v(r,l[0])||l.unshift(Gv(u))}p=o.source,d=o.target,e.canConnect(p,r,o)&&(n.reconnectEnd(o,r,c||v),y=o),e.canConnect(r,d,o)&&(y?f=n.connect(r,d,{type:o.type,waypoints:l}):(n.reconnectStart(o,r,l||v),f=o));var w=[].concat(y&&mt(E,function(C){return C.source===y.source})||[],f&&mt(b,function(C){return C.target===f.target})||[]);w.length&&n.removeElements(w)}Q.call(this,t),this.preExecute("elements.move",function(r){var o=r.newParent,a=r.shapes,c=r.delta,l=a[0];if(l&&o){o&&o.waypoints&&(r.newParent=o=o.parent);var u=vt(l),p={x:u.x+c.x,y:u.y+c.y},d=kt(o.children,function(y){return e.canInsert(a,y)&&Su(y.waypoints,p)});d&&(r.targetFlow=d,r.position=p)}},!0),this.postExecuted("elements.move",function(r){var o=r.shapes,a=r.targetFlow,c=r.position;a&&i(o[0],a,c)},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;e.canInsert(a,o)&&(r.targetFlow=o,r.parent=o.parent)},!0),this.postExecuted("shape.create",function(r){var o=r.shape,a=r.targetFlow,c=r.position;a&&i(o,a,c)},!0)}function $v(t,e){var n=e.x,i=e.y;return n>=t.x&&n<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function Gv(t){return z({},t)}function tp(t,e){Q.call(this,t),this.preExecuted("connection.create",function(n){var i=n.context,r=i.source,o=i.target,a=o.incoming.slice();i.hints&&i.hints.createElementsBehavior===!1||A(r,"bpmn:EventBasedGateway")&&o.incoming.length&&a.filter(ep).forEach(function(c){e.removeConnection(c)})}),this.preExecuted("shape.replace",function(n){var i=n.context.newShape;A(i,"bpmn:EventBasedGateway")&&i.outgoing.filter(ep).map(function(r){return r.target}).reduce(function(r,o){var a=o.incoming.filter(ep);return r.concat(a)},[]).forEach(function(r){r.source!==i&&e.removeConnection(r)})})}function ep(t){return A(t,"bpmn:SequenceFlow")}Xs.$inject=["bpmnReplace","injector"],rt(Xs,Q),Xs.prototype.replaceShape=function(t){var e,n,i=(n=et(t).eventDefinitions)&&n[0];return e=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(t,e,{layoutConnection:!1})},rt(Qu,Q),Qu.$inject=["eventBus","bpmnRules","modeling"],tp.$inject=["eventBus","modeling"],rt(tp,Q);function np(t,e,n,i,r,o){function a(){return et(e.getRootElement()).$parent}function c(l){var u=et(l).categoryValueRef;if(u){var p=u.$parent;u&&(Wt(p.categoryValue,u),p&&!p.categoryValue.length&&function(d){Wt(a().get("rootElements"),d)}(p))}}r.invoke(Q,this),this.executed("shape.delete",function(l){var u,p=l.context.shape;if(A(p,"bpmn:Group")){var d=et(p).categoryValueRef,y=n.filter(function(f){return A(f,"bpmn:Group")});u=d,y.some(function(f){var v=et(f);return v.categoryValueRef&&v.categoryValueRef===u})||c(p)}}),this.reverted("shape.delete",function(l){var u=l.context.shape;if(A(u,"bpmn:Group")){var p=et(u).categoryValueRef,d=a(),y=p?p.$parent:null;Xt(y.get("categoryValue"),p),Xt(d.get("rootElements"),y)}}),this.execute("shape.create",function(l){var u=et(l.context.shape);if(A(u,"bpmn:Group")&&!u.categoryValueRef){var p=Vu(a(),t);u.categoryValueRef=p}}),this.revert("shape.create",function(l){var u=l.context.shape;A(u,"bpmn:Group")&&(c(u),delete et(u).categoryValueRef)}),i.on("moddleCopy.canCopyProperty",2e3,function(l){var u,p=l.property;if(A(p,"bpmn:CategoryValue"))return u=Vu(a(),t),o.copyElement(p,u)})}function ip(t,e,n,i){var r,o,a,c;return(r=(i.y-n.y)*(e.x-t.x)-(i.x-n.x)*(e.y-t.y))==0?null:(o=t.y-n.y,a=t.x-n.x,c=((i.x-n.x)*o-(i.y-n.y)*a)/r,{x:Math.round(t.x+c*(e.x-t.x)),y:Math.round(t.y+c*(e.y-t.y))})}function Uv(t){function e(n,i,r){var o,a={x:r.x,y:r.y-50},c={x:r.x-50,y:r.y},l=ip(n,i,r,a),u=ip(n,i,r,c);o=l&&u?Hv(l,r)>Hv(u,r)?u:l:l||u,n.original=o}t.on("bpmnElement.added",function(n){var i,r,o=n.element;o.waypoints&&(e((r=(i=o).waypoints)[0],r[1],vt(i.source)),e(r[r.length-1],r[r.length-2],vt(i.target)))})}function Hv(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function rp(t){Q.call(this,t);var e=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=et(n.context.shape);wt(i,e)&&!i.di.get("isHorizontal")&&i.di.set("isHorizontal",!0)})}function qv(t){return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}function Wv(t){return Math.atan((t[1].y-t[0].y)/(t[1].x-t[0].x))}function Xv(t,e){var n=e[0],i=e[1],r={x:i.x-n.x,y:i.y-n.y},o=function(a,c,l){var u=[{n:a[0]-l[0],lambda:c[0]},{n:a[1]-l[1],lambda:c[1]}];return-(u[0].n*c[0]+u[1].n*c[1])/(u[0].lambda*c[0]+u[1].lambda*c[1])}([n.x,n.y],[r.x,r.y],[t.x,t.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function KE(t,e){var n=Xv(t,e);return qv({x:n.x-t.x,y:n.y-t.y})}function Ks(t,e){return qv({x:t.x-e.x,y:t.y-e.y})}np.$inject=["bpmnFactory","canvas","elementRegistry","eventBus","injector","moddleCopy"],rt(np,Q),Uv.$inject=["eventBus"],rp.$inject=["eventBus"],rt(rp,Q);var Kv=Math.sqrt,Yv=Math.min,YE=Math.max,Jv=Math.abs;function Zv(t){return Math.pow(t,2)}function Qo(t,e){return Kv(Zv(t.x-e.x)+Zv(t.y-e.y))}function JE(t,e,n,i){var r=e.x-t.x,o=e.y-t.y,a=n.x-t.x,c=n.y-t.y,l=r*r+o*o,u=(r*a+o*c)/l,p=u*u-(a*a+c*c-i*i)/l;if(p<0&&p>-1e-6&&(p=0),p<0)return[];var d=Kv(p),y=-u+d,f=-u-d,v={x:t.x-r*y,y:t.y-o*y};return p===0?[v]:[v,{x:t.x-r*f,y:t.y-o*f}].filter(function(g){return function(b,E,S){return Qv(b.x,E.x,S.x)&&Qv(b.y,E.y,S.y)}(g,t,e)})}function Qv(t,e,n){return t>=Yv(e,n)-Ys&&t<=YE(e,n)+Ys}var Ys=.1;function ty(t,e){return Jv(t.x-e.x)<=Ys&&Jv(t.y-e.y)<=Ys}function ZE(t,e,n,i){var r=0,o=0,a=function(T){return{x:T.x+T.width/2,y:T.y+T.height/2}}(t),c=function(T,M){var I,$,P,x,N,j,G,W,tt,it,at,H,q=0;for(q=0;q line intersections");j.length===1&&(G={type:"bendpoint",position:j[0],segmentIndex:q,bendpointIndex:ty(I,j[0])?q:q+1}),j.length===2&&(at=j[0],H=j[1],G={type:"segment",position:N={x:(at.x+H.x)/2,y:(at.y+H.y)/2},segmentIndex:q,relativeLocation:Qo(I,N)/Qo(I,$)}),W=Qo(G.position,T),(!it||tt>W)&&(it=G,tt=W)}return it}(a,n),l=c.segmentIndex,u=function(T,M,I,$){var P=I.segmentIndex,x=M.length-T.length;if($.segmentMove){var N=$.segmentMove.segmentStartIndex,j=$.segmentMove.newSegmentStartIndex;return P===N?j:P>=j?P+x=tt&&(G=W?P+1:P-1),Pe.length-2)return{x:r,y:o};var p,d,y=ny(n,l),f=ny(e,u),v=c.position,g=function(T,M){var I=Ks(T[0],T[1]),$=Ks(T[0],M);return I===0?0:$/I}(y,v),b=(p=f,d=Wv(y),Wv(p)-d);if(c.type==="bendpoint"){var E=e.length-n.length,S=c.bendpointIndex,w=n[S];if(e.indexOf(w)!==-1)return{x:r,y:o};if(E===0){var C=e[S];return{x:C.x-c.position.x,y:C.y-c.position.y}}E<0&&S!==0&&S"+o+"
"}))})}function lp(t,e,n,i){Q.call(this,t);var r=i.get("dragging",!1);function o(a){var c,l,u=a.source,p=a.target;a.parent&&(A(a,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(u,p)||(l=!0),n.canConnectMessageFlow(u,p)&&(c="bpmn:MessageFlow")),A(a,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(u,p)||(l=!0),n.canConnectSequenceFlow(u,p)&&(c="bpmn:SequenceFlow")),A(a,"bpmn:Association")&&!n.canConnectAssociation(u,p)&&(l=!0),l&&e.removeConnection(a),c&&e.connect(u,p,{type:c,waypoints:a.waypoints.slice()}))}this.postExecuted("elements.move",function(a){L(a.closure.allConnections,o)},!0),this.preExecute("connection.reconnect",function(a){var c,l,u=a.context,p=u.connection,d=u.newSource||p.source,y=u.newTarget||p.target;(c=n.canConnect(d,y))&&c.type!==p.type&&(l=e.connect(d,y,{type:c.type,waypoints:p.waypoints.slice()}),e.removeConnection(p),u.connection=l,r&&function(f,v){var g,b=r.context(),E=b&&b.payload.previousSelection;!E||!E.length||(g=E.indexOf(f),g!==-1&&E.splice(g,1,v))}(p,l))}),this.postExecuted("element.updateProperties",function(a){var c,l=a.context,u=l.properties,p=l.element,d=p.businessObject;u.default&&(c=kt(p.outgoing,Ye({id:p.businessObject.default.id})))&&e.updateProperties(c,{conditionExpression:void 0}),u.conditionExpression&&d.sourceRef.default===d&&e.updateProperties(p.source,{default:void 0})})}function up(t,e){Q.call(this,t),this.preExecute("shape.delete",function(n){var i=n.shape,r=i.parent;A(i,"bpmn:Participant")&&(n.collaborationRoot=r)},!0),this.postExecute("shape.delete",function(n){var i=n.collaborationRoot;i&&!i.businessObject.participants.length&&e.makeProcess()},!0)}function tc(t,e,n,i,r,o){i.invoke(Q,this),this._bpmnReplace=t,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var c=a.context,l=c.parent,u=c.elements,p=e.canReplace(u,l);p&&this.replaceElements(u,p.replacements)},this),this.postExecuted(["elements.move"],500,function(a){var c=a.context,l=c.newParent,u=c.newHost,p=[];L(c.closure.topLevel,function(y){p=je(y)?p.concat(y.children):p.concat(y)}),p.length===1&&u&&(l=u);var d=e.canReplace(p,l);d&&this.replaceElements(p,d.replacements,u)},this),this.postExecute(["shape.replace"],1500,function(a){var c,l=a.context,u=l.oldShape,p=l.newShape,d=u.attachers;d&&d.length&&(c=e.canReplace(d,p),this.replaceElements(d,c.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var c=a.context,l=c.oldShape,u=c.newShape;r.unclaimId(l.businessObject.id,l.businessObject),r.updateProperties(u,{id:l.id})})}cy.$inject=["eventBus","tooltips","translate"],rt(lp,Q),lp.$inject=["eventBus","modeling","bpmnRules","injector"],up.$inject=["eventBus","modeling"],rt(up,Q),rt(tc,Q),tc.prototype.replaceElements=function(t,e){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;L(e,function(o){var a={type:o.newElementType},c=n.get(o.oldElementId),l=t.indexOf(c);t[l]=i.replaceElement(c,a,{select:!1})}),e&&r.select(t)},tc.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var ly=300,ea=60,na={width:300,height:150},uy={width:140,height:120},py={width:50,height:30};function hy(t){t.on("resize.start",1500,function(e){var n=e.context,i=n.shape,r=n.direction,o=n.balanced;(A(i,"bpmn:Lane")||A(i,"bpmn:Participant"))&&(n.resizeConstraints=function(a,c,l){var u=gn(a),p=!0,d=!0,y=Ls(u,[u]),f=st(a),v={},g={};return/e/.test(c)?g.right=f.left+ly:/w/.test(c)&&(g.left=f.right-ly),y.forEach(function(b){var E=st(b);/n/.test(c)&&(E.topf.bottom+10&&(d=!1),l&&ec(f.bottom-E.top)<10&&nc(v,"bottom",E.bottom-ea),ec(f.bottom-E.bottom)<5&&ic(g,"bottom",E.top+ea))}),u.children.filter(function(b){return!b.hidden&&!b.waypoints&&(A(b,"bpmn:FlowElement")||A(b,"bpmn:Artifact"))}).forEach(function(b){var E=st(b);p&&/n/.test(c)&&nc(g,"top",E.top-a_),/e/.test(c)&&ic(g,"right",E.right+r_),d&&/s/.test(c)&&ic(g,"bottom",E.bottom+s_),/w/.test(c)&&nc(g,"left",E.left-o_)}),{min:g,max:v}}(i,r,o)),A(i,"bpmn:Participant")&&(n.minDimensions=na),A(i,"bpmn:SubProcess")&&Pt(i)&&(n.minDimensions=uy),A(i,"bpmn:TextAnnotation")&&(n.minDimensions=py)})}hy.$inject=["eventBus"];var ec=Math.abs,n_=Math.min,i_=Math.max;function dy(t,e,n,i){var r=t[e];t[e]=r===void 0?n:i(n,r)}function nc(t,e,n){return dy(t,e,n,n_)}function ic(t,e,n){return dy(t,e,n,i_)}var r_=20,o_=50,a_=20,s_=20;function my(t,e){t.on("resize.start",1501,function(n){var i=n.context,r=i.shape;(A(r,"bpmn:Lane")||A(r,"bpmn:Participant"))&&(i.balanced=!Ur(n))}),t.on("resize.end",1001,function(n){var i=n.context,r=i.shape,o=i.canExecute,a=i.newBounds;if(A(r,"bpmn:Lane")||A(r,"bpmn:Participant"))return o&&(a=$d(a),e.resizeLane(r,a,i.balanced)),!1})}function pp(t,e,n){Q.call(this,t),this.preExecute("shape.delete",function(i){var r=i.context.shape;if(r.incoming.length===1&&r.outgoing.length===1){var o=r.incoming[0],a=r.outgoing[0];if(A(o,"bpmn:SequenceFlow")&&A(a,"bpmn:SequenceFlow")&&e.canConnect(o.source,a.target,o)){var c=function(l,u){var p=ip(Zr(l[l.length-2]),Zr(l[l.length-1]),Zr(u[1]),Zr(u[0]));return p?[].concat(l.slice(0,l.length-1),[p],u.slice(1)):[Zr(l[0]),Zr(u[u.length-1])]}(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,c)}}})}function Zr(t){return t.original||t}my.$inject=["eventBus","modeling"],rt(pp,Q),pp.$inject=["eventBus","bpmnRules","modeling"];var c_=Math.max;function fy(t){t.on("spaceTool.getMinDimensions",function(e){var n=e.shapes,i=e.axis,r=e.start,o={};return L(n,function(a){var c=a.id;A(a,"bpmn:Participant")&&(function(l){return l==="x"}(i)?o[c]=na:o[c]={width:na.width,height:l_(a,r)}),A(a,"bpmn:SubProcess")&&Pt(a)&&(o[c]=uy),A(a,"bpmn:TextAnnotation")&&(o[c]=py)}),o})}function l_(t,e){var n;return wi(t).length?(n=function(i,r){var o,a=wi(i);return o=vy(a,r),i.height-o.height+ea}(t,e),c_(na.height,n)):na.height}function vy(t,e){var n,i,r;for(n=0;n=(i=t[n]).y&&e<=i.y+i.height)return(r=wi(i)).length?vy(r,e):i}function hp(t,e){t.invoke(Q,this),this.postExecuted("shape.replace",function(n){var i=n.context.oldShape,r=n.context.newShape;if(A(r,"bpmn:SubProcess")&&A(i,"bpmn:Task")&&Pt(r)){var o,a={x:(o=r).x+o.width/6,y:o.y+o.height/2};e.createShape({type:"bpmn:StartEvent"},a,r)}})}fy.$inject=["eventBus"],hp.$inject=["injector","modeling"],rt(hp,Q);function dp(t,e,n,i){Q.call(this,t),this.executed(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape;A(a,"bpmn:SubProcess")&&(a.collapsed?et(a).di.isExpanded=!1:((o=a.children).length&&o.forEach(function(c){c.type!=="label"||c.businessObject.name||(c.hidden=!0)}),et(a).di.isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],500,function(r){var o=r.context.shape;o.collapsed?et(o).di.isExpanded=!1:et(o).di.isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape,c=e._getDefaultSize(a);o=a.collapsed?function(l,u){return{x:l.x+(l.width-u.width)/2,y:l.y+(l.height-u.height)/2,width:u.width,height:u.height}}(a,c):function(l,u){var p,d,y=l.children,f=u;return(p=lv((d=y,d.filter(function(v){return!v.hidden})).concat([l])))?(f.width=Math.max(p.width,f.width),f.height=Math.max(p.height,f.height),f.x=p.x+(p.width-f.width)/2,f.y=p.y+(p.height-f.height)/2):(f.x=l.x+(l.width-f.width)/2,f.y=l.y+(l.height-f.height)/2),f}(a,c),n.resizeShape(a,o,null,{autoResize:!a.collapsed&&"nwse"})})}function mp(t,e,n,i){e.invoke(Q,this),this.preExecute("shape.delete",function(r){var o=r.context.shape,a=o.businessObject;ge(o)||(A(o,"bpmn:Participant")&&Pt(o)&&n.ids.unclaim(a.processRef.id),i.unclaimId(a.id,a))}),this.preExecute("connection.delete",function(r){var o=r.context.connection.businessObject;i.unclaimId(o.id,o)}),this.preExecute("canvas.updateRoot",function(){var r=t.getRootElement().businessObject;n.ids.unclaim(r.id)})}rt(dp,Q),dp.$inject=["eventBus","elementFactory","modeling"],rt(mp,Q),mp.$inject=["canvas","injector","moddle","modeling"];function fp(t,e,n){var i;function r(){if(!i)throw new Error(n("out of bounds release"));return i}Q.call(this,t);var o=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(o,5e3,function(a){(i=i||new u_).enter()}),this.postExecuted(o,500,function(a){(function(){if(!i)throw new Error(n("out of bounds release"));var c=i.leave();c&&(e.updateLaneRefs(i.flowNodes,i.lanes),i=null)})()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(a){var c=a.context.shape,l=r();c.labelTarget||(A(c,"bpmn:Lane")&&l.addLane(c),A(c,"bpmn:FlowNode")&&l.addFlowNode(c))})}function u_(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(t){this.lanes.push(t)},this.addFlowNode=function(t){this.flowNodes.push(t)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function vp(t,e){Q.call(this,t),this.preExecute("connection.delete",function(n){var i=n.context.connection,r=i.source;(function(o,a){if(!A(o,"bpmn:SequenceFlow"))return!1;var c=et(a),l=et(o);return c.get("default")===l})(i,r)&&e.updateProperties(r,{default:null})})}fp.$inject=["eventBus","modeling","translate"],rt(fp,Q),rt(vp,Q),vp.$inject=["eventBus","modeling"];const p_={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","rootElementReferenceBehavior","createBehavior","fixHoverBehavior","createDataObjectBehavior","createParticipantBehavior","dataStoreBehavior","dataInputAssociationBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","messageFlowBehavior","modelingFeedback","removeElementBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","toggleElementCollapseBehaviour","spaceToolBehavior","subProcessStartEventBehavior","unclaimIdBehavior","unsetDefaultFlowBehavior","updateFlowNodeRefsBehavior"],adaptiveLabelPositioningBehavior:["type",$u],appendBehavior:["type",Gu],associationBehavior:["type",Uu],attachEventBehavior:["type",Gs],boundaryEventBehavior:["type",Hu],rootElementReferenceBehavior:["type",qu],createBehavior:["type",Wu],fixHoverBehavior:["type",Ov],createDataObjectBehavior:["type",Xu],createParticipantBehavior:["type",Ku],dataInputAssociationBehavior:["type",Yu],dataStoreBehavior:["type",Ju],deleteLaneBehavior:["type",Zu],detachEventBehavior:["type",Xs],dropOnFlowBehavior:["type",Qu],eventBasedGatewayBehavior:["type",tp],groupBehavior:["type",np],importDockingFix:["type",Uv],isHorizontalFix:["type",rp],labelBehavior:["type",op],messageFlowBehavior:["type",cp],modelingFeedback:["type",cy],replaceConnectionBehavior:["type",lp],removeParticipantBehavior:["type",up],replaceElementBehaviour:["type",tc],resizeBehavior:["type",hy],resizeLaneBehavior:["type",my],removeElementBehavior:["type",pp],toggleElementCollapseBehaviour:["type",dp],spaceToolBehavior:["type",fy],subProcessStartEventBehavior:["type",hp],unclaimIdBehavior:["type",mp],updateFlowNodeRefsBehavior:["type",fp],unsetDefaultFlowBehavior:["type",vp]};function yy(t,e){var n=ye(t,e,-15);return n!=="intersect"?n:null}function be(t){_i.call(this,t)}function yp(t){return!t||ge(t)}function gy(t){do{if(A(t,"bpmn:Process"))return et(t);if(A(t,"bpmn:Participant"))return et(t).processRef||et(t)}while(t=t.parent)}function gp(t){return A(t,"bpmn:TextAnnotation")}function bp(t){return A(t,"bpmn:Group")&&!t.labelTarget}function xp(t){return A(t,"bpmn:BoundaryEvent")&&Dn(t,"bpmn:CompensateEventDefinition")}function Qr(t){return et(t).isForCompensation}function by(t){for(var e=t;e=e.parent;){if(A(e,"bpmn:FlowElementsContainer"))return et(e);if(A(e,"bpmn:Participant"))return et(e).processRef}return null}function Dn(t,e){return!!kt(et(t).eventDefinitions||[],function(n){return A(n,e)})}function xy(t,e){return(et(t).eventDefinitions||[]).every(function(n){return A(n,e)})}function Ey(t){return A(t,"bpmn:ReceiveTask")||A(t,"bpmn:IntermediateCatchEvent")&&(Dn(t,"bpmn:MessageEventDefinition")||Dn(t,"bpmn:TimerEventDefinition")||Dn(t,"bpmn:ConditionalEventDefinition")||Dn(t,"bpmn:SignalEventDefinition"))}function rc(t){return t.waypoints}function Ep(t,e){var n=function(i){for(var r=[];i;)(i=i.parent)&&r.push(i);return r}(e);return n.indexOf(t)!==-1}function oc(t,e,n){if(yp(t)||yp(e))return null;if(!A(n,"bpmn:DataAssociation")){if(Py(t,e))return{type:"bpmn:MessageFlow"};if(My(t,e))return{type:"bpmn:SequenceFlow"}}var i=wp(t,e);return i||(xp(t)&&Qr(e)?{type:"bpmn:Association",associationDirection:"One"}:!!ky(t,e)&&{type:"bpmn:Association"})}function to(t,e,n){return!(!ge(t)&&!bp(t))||!(A(e,"bpmn:Participant")&&!Pt(e))&&(A(t,"bpmn:Participant")?A(e,"bpmn:Process")||A(e,"bpmn:Collaboration"):wt(t,["bpmn:DataInput","bpmn:DataOutput"])&&t.parent?e===t.parent:A(t,"bpmn:Lane")?A(e,"bpmn:Participant")||A(e,"bpmn:Lane"):!(A(t,"bpmn:BoundaryEvent")&&!function(i){return et(i).cancelActivity&&(_y(i)||wy(i))}(t))&&(A(t,"bpmn:FlowElement")&&!A(t,"bpmn:DataStoreReference")?A(e,"bpmn:FlowElementsContainer")?Pt(e):wt(e,["bpmn:Participant","bpmn:Lane"]):A(t,"bpmn:DataStoreReference")&&A(e,"bpmn:Collaboration")?ui(et(e).get("participants"),function(i){return!!i.get("processRef")}):wt(t,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?wt(e,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!A(t,"bpmn:MessageFlow")&&(A(e,"bpmn:Collaboration")||t.source.parent==e||t.target.parent==e)))}function h_(t){return A(t,"bpmn:Lane")}function d_(t){return!!function(e){return!ge(e)&&A(e,"bpmn:BoundaryEvent")}(t)||!(!A(t,"bpmn:IntermediateThrowEvent")||!_y(t))||A(t,"bpmn:IntermediateCatchEvent")&&wy(t)}function _y(t){var e=et(t);return e&&!(e.eventDefinitions&&e.eventDefinitions.length)}function wy(t){return Sy(t,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function Sy(t,e){return e.some(function(n){return Dn(t,n)})}function ia(t,e,n,i){if(Array.isArray(t)||(t=[t]),t.length!==1)return!1;var r=t[0];return!ge(r)&&!!d_(r)&&!je(e)&&!(!A(e,"bpmn:Activity")||Qr(e))&&!(i&&!yy(i,e))&&!function(o){return A(o,"bpmn:ReceiveTask")&&kt(o.incoming,function(a){return A(a.source,"bpmn:EventBasedGateway")})}(e)&&"attach"}function Cy(t,e,n){if(!e)return!1;var i={replacements:[]};return L(t,function(r){je(e)||A(r,"bpmn:StartEvent")&&r.type!=="label"&&to(r,e)&&(function(o){return o&&et(o).isInterrupting!==!1}(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(function(o){return ps(o,"bpmn:ErrorEventDefinition")}(r)||function(o){return ps(o,"bpmn:EscalationEventDefinition")}(r)||function(o){return ps(o,"bpmn:CompensateEventDefinition")}(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),Sy(r,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&A(e,"bpmn:SubProcess")&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"})),A(e,"bpmn:Transaction")||Dn(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(A(r,"bpmn:EndEvent")&&to(r,e)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),A(r,"bpmn:BoundaryEvent")&&ia(r,e,0,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),!!i.replacements.length&&i}function Ty(t,e){return!ui(t,h_)&&(!e||t.every(function(n){return to(n,e)}))}function _p(t,e,n,i){return!!e&&(!(!ge(t)&&!bp(t))||n!==e&&(!n||!Ep(n,e))&&(to(t,e)||ac(t,e)))}function Ay(t,e){return A(t,"bpmn:SubProcess")?Pt(t)&&(!e||e.width>=100&&e.height>=80):A(t,"bpmn:Lane")?!e||e.width>=130&&e.height>=60:A(t,"bpmn:Participant")?!e||e.width>=250&&e.height>=50:!!gp(t)||!!bp(t)}function ky(t,e){return!rc(t)&&!rc(e)&&(!(!xp(t)||!Qr(e))||!Ep(e,t)&&!Ep(t,e)&&(!!function(n,i){var r=gp(n),o=gp(i);return(r||o)&&r!==o}(t,e)||!!wp(t,e)))}function Py(t,e){return!(Ny(t)&&!Ny(e))&&A(i=t,"bpmn:InteractionNode")&&!A(i,"bpmn:BoundaryEvent")&&(!A(i,"bpmn:Event")||A(i,"bpmn:ThrowEvent")&&xy(i,"bpmn:MessageEventDefinition"))&&function(r){return A(r,"bpmn:InteractionNode")&&!Qr(r)&&(!A(r,"bpmn:Event")||A(r,"bpmn:CatchEvent")&&xy(r,"bpmn:MessageEventDefinition"))&&!(A(r,"bpmn:BoundaryEvent")&&!Dn(r,"bpmn:MessageEventDefinition"))}(e)&&(n=e,gy(t)!==gy(n));var n,i}function My(t,e){return!(Ey(e)&&e.incoming.length>0&&(n=e.incoming,(n=n||[]).some(m_))&&!A(t,"bpmn:EventBasedGateway"))&&A(r=t,"bpmn:FlowNode")&&!A(r,"bpmn:EndEvent")&&!je(r)&&!(A(r,"bpmn:IntermediateThrowEvent")&&Dn(r,"bpmn:LinkEventDefinition"))&&!xp(r)&&!Qr(r)&&function(o){return A(o,"bpmn:FlowNode")&&!A(o,"bpmn:StartEvent")&&!A(o,"bpmn:BoundaryEvent")&&!je(o)&&!(A(o,"bpmn:IntermediateCatchEvent")&&Dn(o,"bpmn:LinkEventDefinition"))&&!Qr(o)}(e)&&(i=e,by(t)===by(i))&&!(A(t,"bpmn:EventBasedGateway")&&!Ey(e));var n,i,r}function wp(t,e){return wt(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&wt(e,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!wt(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!wt(t,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function ac(t,e,n){if(!e)return!1;if(Array.isArray(t)){if(t.length!==1)return!1;t=t[0]}return e.source!==t&&e.target!==t&&wt(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!ge(e)&&A(t,"bpmn:FlowNode")&&!A(t,"bpmn:BoundaryEvent")&&to(t,e.parent)}function Ry(t,e){return!!ge(e)||!(A(e,"bpmn:Lane")&&!function(n,i){return n&&i&&n.indexOf(i)!==-1}(t,e.parent))}function m_(t){if(t&&t.source)return A(t.source,"bpmn:EventBasedGateway")}function Ny(t){return _s(t,"bpmn:Process")||_s(t,"bpmn:Collaboration")}rt(be,_i),be.$inject=["eventBus"],be.prototype.init=function(){this.addRule("connection.start",function(t){return function(e){return yp(e)?null:wt(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}(t.source)}),this.addRule("connection.create",function(t){var e=t.source,n=t.target,i=t.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return oc(e,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(t){var e=t.connection;return oc(t.source,t.target,e)}),this.addRule("connection.updateWaypoints",function(t){return{type:t.connection.type}}),this.addRule("shape.resize",function(t){return Ay(t.shape,t.newBounds)}),this.addRule("elements.create",function(t){var e=t.elements,n=t.position,i=t.target;return!(rc(i)&&!ac(e,i))&&$i(e,function(r){return rc(r)?oc(r.source,r.target,r):r.host?ia(r,r.host,null,n):_p(r,i,null)})}),this.addRule("elements.move",function(t){var e=t.target,n=t.shapes,i=t.position;return ia(n,e,null,i)||Cy(n,e,i)||Ty(n,e)||ac(n,e)}),this.addRule("shape.create",function(t){return _p(t.shape,t.target,t.source,t.position)}),this.addRule("shape.attach",function(t){return ia(t.shape,t.target,null,t.position)}),this.addRule("element.copy",function(t){var e=t.element;return Ry(t.elements,e)})},be.prototype.canConnectMessageFlow=Py,be.prototype.canConnectSequenceFlow=My,be.prototype.canConnectDataAssociation=wp,be.prototype.canConnectAssociation=ky,be.prototype.canMove=Ty,be.prototype.canAttach=ia,be.prototype.canReplace=Cy,be.prototype.canDrop=to,be.prototype.canInsert=ac,be.prototype.canCreate=_p,be.prototype.canConnect=oc,be.prototype.canResize=Ay,be.prototype.canCopy=Ry;const f_={__depends__:[In],__init__:["bpmnRules"],bpmnRules:["type",be]};function Iy(t,e){t.on("saveXML.start",2e3,function(){var n,i,r=e.getRootElement(),o=et(r).di;n=mt(n=Wa([r],!1),function(a){return a!==r&&!a.labelTarget}),i=ae(n,Fr),o.set("planeElement",i)})}Iy.$inject=["eventBus","canvas"];const v_={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Iy]};function sc(t){Q.call(this,t);var e=this;this.preExecute(["shape.create","connection.create"],function(n){var i=n.context,r=i.shape||i.connection,o=i.parent,a=e.getOrdering(r,o);a&&(a.parent!==void 0&&(i.parent=a.parent),i.parentIndex=a.index)}),this.preExecute(["shape.move","connection.move"],function(n){var i=n.context,r=i.shape||i.connection,o=i.newParent||r.parent,a=e.getOrdering(r,o);a&&(a.parent!==void 0&&(i.newParent=a.parent),i.newParentIndex=a.index)})}function Sp(t,e,n){sc.call(this,t);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:3,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:Process"]}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:Process"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(o){var a=o.order;if(a||(o.order=a=function(c){if(c.labelTarget)return{level:10};var l=kt(i,function(u){return wt(c,[u.type])});return l&&l.order||{level:1}}(o)),!a)throw new Error("no order for <"+o.id+">");return a}this.getOrdering=function(o,a){if(o.labelTarget)return{parent:e.getRootElement(),index:-1};var c=r(o);c.containers&&(a=function(p,d,y){for(var f=d;f&&!wt(f,y);)f=f.parent;if(!f)throw new Error("no parent for <"+p.id+"> in <"+(d&&d.id)+">");return f}(o,a,c.containers));var l=a.children.indexOf(o),u=_l(a.children,function(p){return!(!o.labelTarget&&p.labelTarget)&&c.level");this._pushAction(t),e||(this._fire(i,"preExecute",t),o.preExecute&&o.preExecute(r),this._fire(i,"preExecuted",t)),this._atomicDo(function(){n._fire(i,"execute",t),o.execute&&n._markDirty(o.execute(r)),n._executedAction(t,e),n._fire(i,"executed",t)}),e||(this._fire(i,"postExecute",t),o.postExecute&&o.postExecute(r),this._fire(i,"postExecuted",t)),this._popAction(t)},Gt.prototype._pushAction=function(t){var e=this._currentExecution,n=e.actions,i=n[0];if(e.atomic)throw new Error("illegal invocation in or phase (action: "+t.command+")");t.id||(t.id=i&&i.id||this._createId()),n.push(t)},Gt.prototype._popAction=function(){var t=this._currentExecution,e=t.trigger,n=t.actions,i=t.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:wl("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:e}),t.trigger=null)},Gt.prototype._markDirty=function(t){var e=this._currentExecution;t&&(t=gt(t)?t:[t],e.dirty=e.dirty.concat(t))},Gt.prototype._executedAction=function(t,e){var n=++this._stackIdx;e||this._stack.splice(n,this._stack.length,t)},Gt.prototype._revertedAction=function(t){this._stackIdx--},Gt.prototype._getHandler=function(t){return this._handlerMap[t]},Gt.prototype._setHandler=function(t,e){if(!t||!e)throw new Error("command and handler required");if(this._handlerMap[t])throw new Error("overriding handler for command <"+t+">");this._handlerMap[t]=e};const g_={commandStack:["type",Gt]};var b_=new uu("tt");function Cp(t,e){t.style.display=e===!1?"none":""}var Dy="djs-tooltip",Tp="."+Dy;function Me(t,e){var n,i;this._eventBus=t,this._canvas=e,this._ids=b_,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(n=e.getContainer(),i=Lt('
'),n.insertBefore(i,n.firstChild),i);var r=this;$e.bind(this._tooltipRoot,Tp,"mousedown",function(o){o.stopPropagation()}),$e.bind(this._tooltipRoot,Tp,"mouseover",function(o){r.trigger("mouseover",o)}),$e.bind(this._tooltipRoot,Tp,"mouseout",function(o){r.trigger("mouseout",o)}),this._init()}Me.$inject=["eventBus","canvas"],Me.prototype.add=function(t){if(!t.position)throw new Error("must specifiy tooltip position");if(!t.html)throw new Error("must specifiy tooltip html");var e=this._ids.next();return t=z({},this._tooltipDefaults,t,{id:e}),this._addTooltip(t),t.timeout&&this.setTimeout(t),e},Me.prototype.trigger=function(t,e){var n=e.delegateTarget||e.target,i=this.get(ze(n,"data-tooltip-id"));i&&(t==="mouseover"&&i.timeout&&this.clearTimeout(i),t==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},Me.prototype.get=function(t){return typeof t!="string"&&(t=t.id),this._tooltips[t]},Me.prototype.clearTimeout=function(t){if(t=this.get(t)){var e=t.removeTimer;e&&(clearTimeout(e),t.removeTimer=null)}},Me.prototype.setTimeout=function(t){if(t=this.get(t)){this.clearTimeout(t);var e=this;t.removeTimer=setTimeout(function(){e.remove(t)},t.timeout)}},Me.prototype.remove=function(t){var e=this.get(t);e&&(Tn(e.html),Tn(e.htmlContainer),delete e.htmlContainer,delete this._tooltips[e.id])},Me.prototype.show=function(){Cp(this._tooltipRoot)},Me.prototype.hide=function(){Cp(this._tooltipRoot,!1)},Me.prototype._updateRoot=function(t){var e=t.scale||1,n=t.scale||1,i="matrix("+e+",0,0,"+n+","+-1*t.x*e+","+-1*t.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},Me.prototype._addTooltip=function(t){var e,n=t.id,i=t.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Ie(i)&&(i=Lt(i)),(e=Lt('
')).appendChild(i),t.type&&ne(e).add("djs-tooltip-"+t.type),t.className&&ne(e).add(t.className),t.htmlContainer=e,r.appendChild(e),this._tooltips[n]=t,this._updateTooltip(t)},Me.prototype._updateTooltip=function(t){var e,n,i,r=t.position,o=t.htmlContainer;e=o,n=r.x,i=r.y,z(e.style,{left:n+"px",top:i+"px"})},Me.prototype._updateTooltipVisibilty=function(t){L(this._tooltips,function(e){var n=e.show,i=e.htmlContainer,r=!0;n&&((n.minZoom>t.scale||n.maxZoomMp(t.dy)?"x":"y",i=t["d"+n],r=t[n]-i;if(Mp(i)<5)return!1;i<0&&(i*=-1),Ur(t)&&(i*=-1);var o=function(u,p){if(u==="x"){if(p>0)return"e";if(p<0)return"w"}if(u==="y"){if(p>0)return"s";if(p<0)return"n"}return null}(n,i),a=Wa(this._canvas.getRootElement(),!0),c=this.calculateAdjustments(a,n,i,r),l=function(u,p,d,y,f){var v=u.movingShapes,g=u.resizingShapes;if(g.length){var b,E,S={};return L(g,function(w){var C,B,s,h=st(w),m=mt(w.children,function(M){return!(Np(M)||zy(M)||Rp(v,M)||Rp(g,M))}),_=mt(w.children,function(M){return!Np(M)&&!zy(M)&&Rp(v,M)});m.length&&(B=Vy(st(ve(m))),C=y-h[lc[d]]+B[lc[d]],d==="n"?S.bottom=E=ht(E)?Math.min(E,C):C:d==="w"?S.right=E=ht(E)?Math.min(E,C):C:d==="s"?S.top=b=ht(b)?Math.max(b,C):C:d==="e"&&(S.left=b=ht(b)?Math.max(b,C):C)),_.length&&(s=Vy(st(ve(_))),C=y-s[lc[jy[d]]]+h[lc[jy[d]]],d==="n"?S.bottom=E=ht(E)?Math.min(E,C):C:d==="w"?S.right=E=ht(E)?Math.min(E,C):C:d==="s"?S.top=b=ht(b)?Math.max(b,C):C:d==="e"&&(S.left=b=ht(b)?Math.max(b,C):C));var T=f&&f[w.id];T&&(d==="n"?(C=y+w[Zn[p]]-T[Zn[p]],S.bottom=E=ht(E)?Math.min(E,C):C):d==="w"?(C=y+w[Zn[p]]-T[Zn[p]],S.right=E=ht(E)?Math.min(E,C):C):d==="s"?(C=y-w[Zn[p]]+T[Zn[p]],S.top=b=ht(b)?Math.max(b,C):C):d==="e"&&(C=y-w[Zn[p]]+T[Zn[p]],S.left=b=ht(b)?Math.max(b,C):C))}),S}}(c,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}));return z(e,c,{axis:n,direction:o,spaceToolConstraints:l,start:r}),xs("resize-"+(n==="x"?"ew":"ns")),!0},Qn.prototype.calculateAdjustments=function(t,e,n,i){var r=this._rules,o=[],a=[];return L(t,function(c){if(c.parent&&!Np(c)){var l=c[e],u=l+c[Zn[e]];return n>0&&l>i||n<0&&ui&&r.allowed("shape.resize",{shape:c})?a.push(c):void 0}}),{movingShapes:o,resizingShapes:a}},Qn.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();this.activateSelection(t,!!t)},Qn.prototype.isActive=function(){var t=this._dragging.context();return t&&/^spaceTool/.test(t.prefix)};var Ip="djs-dragging",$y="djs-resizing",uc=Math.max;function Gy(t,e,n,i,r){function o(a,c){L(a,function(l){r.addDragger(l,c),n.addMarker(l,Ip)})}t.on("spaceTool.selection.start",function(a){var c=n.getLayer("space"),l=a.context,u="M 0,-10000 L 0,10000",p="M -10000,0 L 10000,0",d=ot("g");K(d,i.cls("djs-crosshair-group",["no-events"])),lt(c,d);var y=ot("path");K(y,"d",u),bt(y).add("djs-crosshair"),lt(d,y);var f=ot("path");K(f,"d",p),bt(f).add("djs-crosshair"),lt(d,f),l.crosshairGroup=d}),t.on("spaceTool.selection.move",function(a){Oe(a.context.crosshairGroup,a.x,a.y)}),t.on("spaceTool.selection.cleanup",function(a){var c=a.context.crosshairGroup;c&&Zt(c)}),t.on("spaceTool.move",250,function(a){var c=a.context,l=c.line,u=c.axis,p=c.movingShapes,d=c.resizingShapes;if(c.initialized){if(!c.dragGroup){var y=n.getLayer("space");K(l=ot("path"),"d","M0,0 L0,0"),bt(l).add("djs-crosshair"),lt(y,l),c.line=l;var f=ot("g");K(f,i.cls("djs-drag-group",["no-events"])),lt(n.getActiveLayer(),f),o(p,f),o(c.movingConnections=e.filter(function(E){var S=!1;L(p,function(s){L(s.outgoing,function(h){E===h&&(S=!0)})});var w=!1;L(p,function(s){L(s.incoming,function(h){E===h&&(w=!0)})});var C=!1;L(d,function(s){L(s.outgoing,function(h){E===h&&(C=!0)})});var B=!1;return L(d,function(s){L(s.incoming,function(h){E===h&&(B=!0)})}),function(s){return s.waypoints}(E)&&(S||C)&&(w||B)}),f),c.dragGroup=f}if(!c.frameGroup){var v=ot("g");K(v,i.cls("djs-frame-group",["no-events"])),lt(n.getActiveLayer(),v);var g=[];L(d,function(E){var S=r.addFrame(E,v),w=S.getBBox();g.push({element:S,initialBounds:w}),n.addMarker(E,$y)}),c.frameGroup=v,c.frames=g}K(l,{d:{x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y}[u]});var b={x:a.dx,y:a.dy};b[{x:"y",y:"x"}[c.axis]]=0,Oe(c.dragGroup,b.x,b.y),L(c.frames,function(E){var S,w,C=E.element,B=E.initialBounds;c.direction==="e"?K(C,{width:uc(B.width+b.x,5)}):K(C,{width:S=uc(B.width-b.x,5),x:B.x+B.width-S}),c.direction==="s"?K(C,{height:uc(B.height+b.y,5)}):K(C,{height:w=uc(B.height-b.y,5),y:B.y+B.height-w})})}}),t.on("spaceTool.cleanup",function(a){var c=a.context,l=c.movingShapes,u=c.movingConnections,p=c.resizingShapes,d=c.line,y=c.dragGroup,f=c.frameGroup;L(l,function(v){n.removeMarker(v,Ip)}),L(u,function(v){n.removeMarker(v,Ip)}),y&&(Zt(d),Zt(y)),L(p,function(v){n.removeMarker(v,$y)}),f&&Zt(f)})}Gy.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const Uy={__init__:["spaceToolPreview"],__depends__:[Kn,In,cc,Go,qo],spaceTool:["type",Qn],spaceToolPreview:["type",Gy]};function an(t){this._model=t}function Ve(t,e,n,i){Q.call(this,t),this._bpmnFactory=e,this._translate=i;var r=this;function o(p){L(p.context.oldRoot.children,function(d){A(d,"bpmn:BaseElement")&&r.updateParent(d)})}function a(p){var d=p.context.shape;A(d,"bpmn:BaseElement")&&r.updateBounds(d)}function c(p){r.updateConnection(p.context)}function l(p){r.updateConnectionWaypoints(p.context.connection)}function u(p){r.updateAttachment(p.context)}this.executed(["connection.layout","connection.create"],function(p){var d,y=p.context,f=y.hints||{};y.cropped||f.createElementsBehavior===!1||((d=y.connection).waypoints=n.getCroppedWaypoints(d),y.cropped=!0)}),this.reverted(["connection.layout"],function(p){delete p.context.cropped}),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],sn(function(p){var d=p.context;r.updateParent(d.shape||d.connection,d.oldParent)})),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],sn(function(p){var d=p.context,y=d.shape||d.connection,f=d.parent||d.newParent;r.updateParent(y,f)})),this.executed(["canvas.updateRoot"],o),this.reverted(["canvas.updateRoot"],o),this.executed(["shape.move","shape.create","shape.resize"],sn(function(p){p.context.shape.type!=="label"&&a(p)})),this.reverted(["shape.move","shape.create","shape.resize"],sn(function(p){p.context.shape.type!=="label"&&a(p)})),t.on("shape.changed",function(p){p.element.type==="label"&&a({context:{shape:p.element}})}),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],sn(c)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],sn(c)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],sn(l)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],sn(l)),this.executed("connection.reconnect",sn(function(p){var d=p.context,y=d.connection,f=d.oldSource,v=d.newSource,g=et(y),b=et(f),E=et(v);g.conditionExpression&&!wt(E,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(d.oldConditionExpression=g.conditionExpression,delete g.conditionExpression),f!==v&&b.default===g&&(d.oldDefault=b.default,delete b.default)})),this.reverted("connection.reconnect",sn(function(p){var d=p.context,y=d.connection,f=d.oldSource,v=d.newSource,g=et(y),b=et(f),E=et(v);d.oldConditionExpression&&(g.conditionExpression=d.oldConditionExpression),d.oldDefault&&(b.default=d.oldDefault,delete E.default)})),this.executed(["element.updateAttachment"],sn(u)),this.reverted(["element.updateAttachment"],sn(u))}function sn(t){return function(e){var n=e.context;A(n.shape||n.connection,"bpmn:BaseElement")&&t(e)}}function Ti(t,e,n){Un.call(this),this._bpmnFactory=t,this._moddle=e,this._translate=n}function Hy(t,e,n){t[n]=e[n],delete e[n]}function pc(t,e){this._modeling=t,this._canvas=e}function hc(t){this._modeling=t}function dc(t,e){this._canvas=t,this._layouter=e}an.$inject=["moddle"],an.prototype._needsId=function(t){return wt(t,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},an.prototype._ensureId=function(t){var e;e=A(t,"bpmn:Activity")?"Activity":A(t,"bpmn:Event")?"Event":A(t,"bpmn:Gateway")?"Gateway":wt(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(t.$type||"").replace(/^[^:]*:/g,""),e+="_",!t.id&&this._needsId(t)&&(t.id=this._model.ids.nextPrefixed(e,t))},an.prototype.create=function(t,e){var n=this._model.create(t,e||{});return this._ensureId(n),n},an.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},an.prototype.createDiShape=function(t,e,n){return this.create("bpmndi:BPMNShape",z({bpmnElement:t,bounds:this.createDiBounds(e)},n))},an.prototype.createDiBounds=function(t){return this.create("dc:Bounds",t)},an.prototype.createDiWaypoints=function(t){var e=this;return ae(t,function(n){return e.createDiWaypoint(n)})},an.prototype.createDiWaypoint=function(t){return this.create("dc:Point",Je(t,["x","y"]))},an.prototype.createDiEdge=function(t,e,n){return this.create("bpmndi:BPMNEdge",z({bpmnElement:t,waypoint:this.createDiWaypoints(e)},n))},an.prototype.createDiPlane=function(t){return this.create("bpmndi:BPMNPlane",{bpmnElement:t})},rt(Ve,Q),Ve.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],Ve.prototype.updateAttachment=function(t){var e=t.shape,n=e.businessObject,i=e.host;n.attachedToRef=i&&i.businessObject},Ve.prototype.updateParent=function(t,e){if(!(t instanceof es||A(t,"bpmn:DataStoreReference")&&t.parent&&A(t.parent,"bpmn:Collaboration"))){var n=t.parent,i=t.businessObject,r=n&&n.businessObject,o=r&&r.di;A(t,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,r,e&&e.businessObject),A(t,"bpmn:DataOutputAssociation")&&(r=t.source?t.source.businessObject:null),A(t,"bpmn:DataInputAssociation")&&(r=t.target?t.target.businessObject:null),this.updateSemanticParent(i,r),A(t,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,r),this.updateDiParent(i.di,o)}},Ve.prototype.updateBounds=function(t){var e=t.businessObject.di,n=t instanceof es?this._getLabel(e):e,i=n.bounds;i||(i=this._bpmnFactory.createDiBounds(),n.set("bounds",i)),z(i,{x:t.x,y:t.y,width:t.width,height:t.height})},Ve.prototype.updateFlowNodeRefs=function(t,e,n){n!==e&&(A(n,"bpmn:Lane")&&Wt(n.get("flowNodeRef"),t),A(e,"bpmn:Lane")&&Xt(e.get("flowNodeRef"),t))},Ve.prototype.updateDiConnection=function(t,e,n){t.sourceElement&&t.sourceElement.bpmnElement!==e&&(t.sourceElement=e&&e.di),t.targetElement&&t.targetElement.bpmnElement!==n&&(t.targetElement=n&&n.di)},Ve.prototype.updateDiParent=function(t,e){if(e&&!A(e,"bpmndi:BPMNPlane")&&(e=e.$parent),t.$parent!==e){var n=(e||t.$parent).get("planeElement");e?(n.push(t),t.$parent=e):(Wt(n,t),t.$parent=null)}},Ve.prototype.getLaneSet=function(t){var e,n;return A(t,"bpmn:Lane")?((e=t.childLaneSet)||(e=this._bpmnFactory.create("bpmn:LaneSet"),t.childLaneSet=e,e.$parent=t),e):(A(t,"bpmn:Participant")&&(t=t.processRef),(e=(n=t.get("laneSets"))[0])||((e=this._bpmnFactory.create("bpmn:LaneSet")).$parent=t,n.push(e)),e)},Ve.prototype.updateSemanticParent=function(t,e,n){var i,r=this._translate;if(t.$parent!==e&&(!A(t,"bpmn:DataInput")&&!A(t,"bpmn:DataOutput")||(A(e,"bpmn:Participant")&&"processRef"in e&&(e=e.processRef),!("ioSpecification"in e)||e.ioSpecification!==t.$parent))){if(A(t,"bpmn:Lane"))e&&(e=this.getLaneSet(e)),i="lanes";else if(A(t,"bpmn:FlowElement")){if(e){if(A(e,"bpmn:Participant"))e=e.processRef;else if(A(e,"bpmn:Lane"))do e=e.$parent.$parent;while(A(e,"bpmn:Lane"))}i="flowElements"}else if(A(t,"bpmn:Artifact")){for(;e&&!A(e,"bpmn:Process")&&!A(e,"bpmn:SubProcess")&&!A(e,"bpmn:Collaboration");){if(A(e,"bpmn:Participant")){e=e.processRef;break}e=e.$parent}i="artifacts"}else if(A(t,"bpmn:MessageFlow"))i="messageFlows";else if(A(t,"bpmn:Participant")){i="participants";var o,a=t.processRef;a&&(o=function(u){for(;u&&!A(u,"bpmn:Definitions");)u=u.$parent;return u}(t.$parent||e),t.$parent&&(Wt(o.get("rootElements"),a),a.$parent=null),e&&(Xt(o.get("rootElements"),a),a.$parent=o))}else A(t,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":A(t,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:t.id,parent:e.id}));var c;if(t.$parent&&Wt(c=t.$parent.get(i),t),e?((c=e.get(i)).push(t),t.$parent=e):t.$parent=null,n){var l=n.get(i);Wt(c,t),e&&(l||(l=[],e.set(i,l)),l.push(t))}}},Ve.prototype.updateConnectionWaypoints=function(t){t.businessObject.di.set("waypoint",this._bpmnFactory.createDiWaypoints(t.waypoints))},Ve.prototype.updateConnection=function(t){var e,n=t.connection,i=et(n),r=et(n.source),o=et(n.target);if(A(i,"bpmn:DataAssociation"))A(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=r,e=t.parent||t.newParent||o,this.updateSemanticParent(i,o,e)):A(i,"bpmn:DataOutputAssociation")&&(e=t.parent||t.newParent||r,this.updateSemanticParent(i,r,e),i.targetRef=o);else{var a=A(i,"bpmn:SequenceFlow");i.sourceRef!==r&&(a&&(Wt(i.sourceRef&&i.sourceRef.get("outgoing"),i),r&&r.get("outgoing")&&r.get("outgoing").push(i)),i.sourceRef=r),i.targetRef!==o&&(a&&(Wt(i.targetRef&&i.targetRef.get("incoming"),i),o&&o.get("incoming")&&o.get("incoming").push(i)),i.targetRef=o)}this.updateConnectionWaypoints(n),this.updateDiConnection(i.di,r,o)},Ve.prototype._getLabel=function(t){return t.label||(t.label=this._bpmnFactory.createDiLabel()),t.label},rt(Ti,Un),Ti.$inject=["bpmnFactory","moddle","translate"],Ti.prototype.baseCreate=Un.prototype.create,Ti.prototype.create=function(t,e){return t==="label"?this.baseCreate(t,z({type:"label"},Do,e)):this.createBpmnElement(t,e)},Ti.prototype.createBpmnElement=function(t,e){var n,i,r,o=this._translate,a=(e=e||{}).businessObject;if(!a){if(!e.type)throw new Error(o("no shape type specified"));a=this._bpmnFactory.create(e.type)}return a.di||(a.di=t==="root"?this._bpmnFactory.createDiPlane(a,[],{id:a.id+"_di"}):t==="connection"?this._bpmnFactory.createDiEdge(a,[],{id:a.id+"_di"}):this._bpmnFactory.createDiShape(a,{},{id:a.id+"_di"})),A(a,"bpmn:Group")&&(e=z({isFrame:!0},e)),e.di&&(z(a.di,e.di),delete e.di),function(c,l,u){L(u,function(p){l[p]!==void 0&&Hy(c,l,p)})}(a,e,["processRef","isInterrupting","associationDirection","isForCompensation"]),e.isExpanded&&Hy(a.di,e,"isExpanded"),A(a,"bpmn:ExclusiveGateway")&&(a.di.isMarkerVisible=!0),e.eventDefinitionType&&(i=a.get("eventDefinitions")||[],r=this._bpmnFactory.create(e.eventDefinitionType,e.eventDefinitionAttrs),e.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(r.condition=this._bpmnFactory.create("bpmn:FormalExpression")),i.push(r),r.$parent=a,a.eventDefinitions=i,delete e.eventDefinitionType),n=this._getDefaultSize(a),e=z({businessObject:a,id:a.id},n,e),this.baseCreate(t,e)},Ti.prototype._getDefaultSize=function(t){return A(t,"bpmn:SubProcess")?Pt(t)?{width:350,height:200}:{width:100,height:80}:A(t,"bpmn:Task")?{width:100,height:80}:A(t,"bpmn:Gateway")?{width:50,height:50}:A(t,"bpmn:Event")?{width:36,height:36}:A(t,"bpmn:Participant")?Pt(t)?{width:600,height:250}:{width:400,height:60}:A(t,"bpmn:Lane")?{width:400,height:100}:A(t,"bpmn:DataObjectReference")?{width:36,height:50}:A(t,"bpmn:DataStoreReference")?{width:50,height:50}:A(t,"bpmn:TextAnnotation")?{width:100,height:30}:A(t,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},Ti.prototype.createParticipantShape=function(t){return Jt(t)||(t={isExpanded:t}),(t=z({type:"bpmn:Participant"},t||{})).isExpanded!==!1&&(t.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(t)},pc.$inject=["modeling","canvas"],pc.prototype.preExecute=function(t){var e=this._modeling,n=t.elements,i=t.alignment;L(n,function(r){var o={x:0,y:0};i.left?o.x=i.left-r.x:i.right?o.x=i.right-r.width-r.x:i.center?o.x=i.center-Math.round(r.width/2)-r.x:i.top?o.y=i.top-r.y:i.bottom?o.y=i.bottom-r.height-r.y:i.middle&&(o.y=i.middle-Math.round(r.height/2)-r.y),e.moveElements([r],o,r.parent)})},pc.prototype.postExecute=function(t){},hc.$inject=["modeling"],hc.prototype.preExecute=function(t){var e=t.source;if(!e)throw new Error("source required");var n=t.target||e.parent,i=t.shape,r=t.hints||{};i=t.shape=this._modeling.createShape(i,t.position,n,{attach:r.attach}),t.shape=i},hc.prototype.postExecute=function(t){var e,n,i=t.hints||{};e=t.source,n=t.shape,ui(e.outgoing,function(r){return r.target===n})||(i.connectionTarget===t.source?this._modeling.connect(t.shape,t.source,t.connection):this._modeling.connect(t.source,t.shape,t.connection))},dc.$inject=["canvas","layouter"],dc.prototype.execute=function(t){var e=t.connection,n=t.source,i=t.target,r=t.parent,o=t.parentIndex,a=t.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return e.source=n,e.target=i,e.waypoints||(e.waypoints=this._layouter.layoutConnection(e,a)),this._canvas.addConnection(e,r,o),e},dc.prototype.revert=function(t){var e=t.connection;return this._canvas.removeConnection(e),e.source=null,e.target=null,e};var mc=Math.round;function Dp(t){this._modeling=t}function qy(t){return!!t.waypoints}Dp.$inject=["modeling"],Dp.prototype.preExecute=function(t){var e=t.elements,n=t.parent,i=t.parentIndex,r=t.position,o=t.hints,a=this._modeling;L(e,function(p){ht(p.x)||(p.x=0),ht(p.y)||(p.y=0)});var c=ve(e);L(e,function(p){qy(p)&&(p.waypoints=ae(p.waypoints,function(d){return{x:mc(d.x-c.x-c.width/2+r.x),y:mc(d.y-c.y-c.height/2+r.y)}})),z(p,{x:mc(p.x-c.x-c.width/2+r.x),y:mc(p.y-c.y-c.height/2+r.y)})});var l=Sd(e),u={};L(e,function(p){if(qy(p))u[p.id]=ht(i)?a.createConnection(u[p.source.id],u[p.target.id],i,p,p.parent||n,o):a.createConnection(u[p.source.id],u[p.target.id],p,p.parent||n,o);else{var d=z({},o);l.indexOf(p)===-1&&(d.autoResize=!1),u[p.id]=ht(i)?a.createShape(p,Je(p,["x","y","width","height"]),p.parent||n,i,d):a.createShape(p,Je(p,["x","y","width","height"]),p.parent||n,d)}}),t.elements=Ga(u)};var Wy=Math.round;function Ai(t){this._canvas=t}function oa(t){Ai.call(this,t)}Ai.$inject=["canvas"],Ai.prototype.execute=function(t){var e=t.shape,n=t.position,i=t.parent,r=t.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?z(e,n):z(e,{x:n.x-Wy(e.width/2),y:n.y-Wy(e.height/2)}),this._canvas.addShape(e,i,r),e},Ai.prototype.revert=function(t){var e=t.shape;return this._canvas.removeShape(e),e},rt(oa,Ai),oa.$inject=["canvas"];var S_=Ai.prototype.execute;oa.prototype.execute=function(t){var e=t.shape;return function(n){["width","height"].forEach(function(i){n[i]===void 0&&(n[i]=0)})}(e),e.labelTarget=t.labelTarget,S_.call(this,t)};var C_=Ai.prototype.revert;function fc(t,e){this._canvas=t,this._modeling=e}function Bp(t,e){this._modeling=t,this._elementRegistry=e}function aa(t,e){this._canvas=t,this._modeling=e}function vc(t){this._modeling=t}oa.prototype.revert=function(t){return t.shape.labelTarget=null,C_.call(this,t)},fc.$inject=["canvas","modeling"],fc.prototype.execute=function(t){var e=t.connection,n=e.parent;return t.parent=n,t.parentIndex=Gl(n.children,e),t.source=e.source,t.target=e.target,this._canvas.removeConnection(e),e.source=null,e.target=null,e},fc.prototype.revert=function(t){var e=t.connection,n=t.parent,i=t.parentIndex;return e.source=t.source,e.target=t.target,Xt(n.children,e,i),this._canvas.addConnection(e,n),e},Bp.$inject=["modeling","elementRegistry"],Bp.prototype.postExecute=function(t){var e=this._modeling,n=this._elementRegistry;L(t.elements,function(i){n.get(i.id)&&(i.waypoints?e.removeConnection(i):e.removeShape(i))})},aa.$inject=["canvas","modeling"],aa.prototype.preExecute=function(t){var e=this._modeling,n=t.shape;eo(n.incoming,function(i){e.removeConnection(i,{nested:!0})}),eo(n.outgoing,function(i){e.removeConnection(i,{nested:!0})}),eo(n.children,function(i){i.waypoints?e.removeConnection(i,{nested:!0}):e.removeShape(i,{nested:!0})})},aa.prototype.execute=function(t){var e=this._canvas,n=t.shape,i=n.parent;return t.oldParent=i,t.oldParentIndex=Gl(i.children,n),e.removeShape(n),n},aa.prototype.revert=function(t){var e=this._canvas,n=t.shape,i=t.oldParent,r=t.oldParentIndex;return Xt(i.children,n,r),e.addShape(n,i),n},vc.$inject=["modeling"];var Xy={x:"y",y:"x"};function yc(t,e){this._layouter=t,this._canvas=e}function Op(){}function Lp(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function sa(t){this._modeling=t}function gc(t){this._helper=new sa(t)}function ir(t){this._modeling=t,this._helper=new sa(t)}function ca(t){this._modeling=t}function Ky(t){return t.original||t}function ti(t,e){this._modeling=t,this._rules=e}function la(t){this._modeling=t}function ki(t){this._modeling=t}function Yy(t){return z({},t)}function Jy(t){switch(t){case"n":case"s":return"y";case"w":case"e":return"x"}}function Zy(t,e,n){var i=Jy(n);return/e|s/.test(n)?t[i]>e:/n|w/.test(n)?t[i] required");var r=t.changed||this.getVisualReferences(n).concat(e),o=t.oldProperties||function(a,c){return De(c,function(l,u){return l[u]=a.get(u),l},{})}(n,xo(i));return rg(n,i),t.oldProperties=o,t.changed=r,r},ua.prototype.revert=function(t){var e=t.oldProperties,n=t.moddleElement,i=t.changed;return rg(n,e),i},ua.prototype.getVisualReferences=function(t){var e=this._elementRegistry;return A(t,"bpmn:DataObject")?function(n,i){return i.filter(function(r){return A(r,"bpmn:DataObjectReference")&&et(r).dataObjectRef===n})}(t,e):[]};var pa="default",ei="id",og="di",T_={width:0,height:0};function ha(t,e,n,i,r){this._elementRegistry=t,this._moddle=e,this._translate=n,this._modeling=i,this._textRenderer=r}function ag(t,e){return ei in t&&t[ei]!==e[ei]}function sg(t,e){L(e,function(n,i){i!==og?t.set(i,n):t.di&&function(r,o){L(o,function(a,c){r.set(c,a)})}(t.di,n)})}ha.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],ha.prototype.execute=function(t){var e=t.element,n=[e],i=this._translate;if(!e)throw new Error(i("element required"));var r=this._elementRegistry,o=this._moddle.ids,a=e.businessObject,c=function(u){var p=z({},u);return A_.forEach(function(d){d in u&&(p[d]=et(p[d]))}),p}(t.properties),l=t.oldProperties||function(u,p){var d=xo(p);return De(d,function(y,f){return y[f]=f!==og?u.get(f):function(v,g){return De(g,function(b,E){return b[E]=v.get(E),b},{})}(u.di,xo(p.di)),y},{})}(a,c);return ag(c,a)&&(o.unclaim(a[ei]),r.updateId(e,c[ei]),o.claim(c[ei],a)),pa in c&&(c[pa]&&n.push(r.get(c[pa].id)),a[pa]&&n.push(r.get(a[pa].id))),sg(a,c),t.oldProperties=l,t.changed=n,n},ha.prototype.postExecute=function(t){var e=t.element.label,n=e&&et(e).name;if(n){var i=this._textRenderer.getExternalLabelBounds(e,n);this._modeling.resizeShape(e,i,T_)}},ha.prototype.revert=function(t){var e=t.element,n=t.properties,i=t.oldProperties,r=e.businessObject,o=this._elementRegistry,a=this._moddle.ids;return sg(r,i),ag(n,r)&&(a.unclaim(n[ei]),o.updateId(e,i[ei]),a.claim(i[ei],r)),t.changed};var A_=["default"];function Ec(t,e){this._canvas=t,this._modeling=e}function Vp(t,e){this._modeling=t,this._spaceTool=e}function Fp(t,e){this._modeling=t,this._translate=e}function da(t,e){this._modeling=t,this._spaceTool=e}Ec.$inject=["canvas","modeling"],Ec.prototype.execute=function(t){var e=this._canvas,n=t.newRoot,i=n.businessObject,r=e.getRootElement(),o=r.businessObject,a=o.$parent,c=o.di;e.setRootElement(n,!0),Xt(a.rootElements,i),i.$parent=a,Wt(a.rootElements,o),o.$parent=null,o.di=null,c.bpmnElement=i,i.di=c,t.oldRoot=r},Ec.prototype.revert=function(t){var e=this._canvas,n=t.newRoot.businessObject,i=t.oldRoot,r=i.businessObject,o=n.$parent,a=n.di;e.setRootElement(i,!0),Wt(o.rootElements,n),n.$parent=null,Xt(o.rootElements,r),r.$parent=o,n.di=null,a.bpmnElement=r,r.di=a},Vp.$inject=["modeling","spaceTool"],Vp.prototype.preExecute=function(t){var e=this._spaceTool,n=this._modeling,i=t.shape,r=t.location,o=gn(i),a=o===i,c=a?i:i.parent;wi(c).length||n.createShape({type:"bpmn:Lane"},{x:i.x+Jr,y:i.y,width:i.width-Jr,height:i.height},c);var l=[];Hi(o,function(v){return l.push(v),v.label&&l.push(v.label),v===i?[]:mt(v.children,function(g){return g!==i})});var u=r==="top"?-120:120,p=r==="top"?i.y:i.y+i.height,d=p+(r==="top"?10:-10),y=r==="top"?"n":"s",f=e.calculateAdjustments(l,"y",u,d);e.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:u},y,d),t.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?Jr:0),y:p-(r==="top"?120:0),width:i.width-(a?Jr:0),height:120},c)},Fp.$inject=["modeling","translate"],Fp.prototype.preExecute=function(t){var e=this._modeling,n=this._translate,i=t.shape,r=t.count,o=wi(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var c,l,u,p,d,y=Math.round(i.height/r);for(d=0;d0||u.bottom<0?-n:n,a=c.calculateAdjustments(d,"y",o,i),c.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},r)),(u.left||u.right)&&(n=u.right||u.left,i=t.x+(u.right?t.width:0)+(u.right?-10:100),r=u.right?"e":"w",o=u.left>0||u.right<0?-n:n,a=c.calculateAdjustments(y,"x",o,i),c.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var ma="flowNodeRef",zp="lanes";function fa(t){this._elementRegistry=t}function _c(t){this._moddle=t}fa.$inject=["elementRegistry"],fa.prototype.computeUpdates=function(t,e){var n=[],i=[],r={},o=[];function a(l){n.indexOf(l)===-1&&(o.push(l),n.push(l))}function c(l){if(!l.parent)return[];var u=function(p){var d=gn(p);return r[d.id]||(r[d.id]=Ls(d)),r[d.id]}(l);return u.filter(function(p){return d=l,y=st(p),f=d.x+d.width/2,v=d.y+d.height/2,f>y.left&&fy.top&&v: must be specified as : with start/end in { h,v,t,r,b,l }");if(mg(n)){var i=function(a,c,l){return pg(a,c,l)}(t,e,n),r=function(a,c,l){var u=pg(c,a,hg(l));return{waypoints:u.waypoints.slice().reverse(),directions:hg(u.directions),turnNextDirections:u.turnNextDirections}}(t,e,n),o=function(a,c){var l=a.directions.split(":")[1],u=c.directions.split(":")[0];a.turnNextDirections&&(l=l=="h"?"v":"h"),c.turnNextDirections&&(u=u=="h"?"v":"h");var p=l+":"+u;return{waypoints:Gp(a.waypoints[a.waypoints.length-1],c.waypoints[0],p),directions:p}}(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return function(a,c,l){var u=wc((c.x-a.x)/2+a.x),p=wc((c.y-a.y)/2+a.y);if(l==="h:v")return[{x:c.x,y:a.y}];if(l==="v:h")return[{x:a.x,y:c.y}];if(l==="h:h")return[{x:u,y:a.y},{x:u,y:c.y}];if(l==="v:v")return[{x:a.x,y:p},{x:c.x,y:p}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}(t,e,n)}function R_(t,e,n,i,r){var o=ad(r&&r.preferredLayouts||[],"straight")[0]||"h:h",a=ye(t,e,M_[o]||0),c=function(p,d){if(mg(d))return d;switch(p){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return d}}(a,o);n=n||vt(t),i=i||vt(e);var l=c.split(":"),u=fg(n,t,l[0],function(p){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[p]}(a));return function(p,d,y){var f=Gp(p,d,y);return f.unshift(p),f.push(d),vg(f)}(u,fg(i,e,l[1],a),c)}function N_(t,e,n,i,r,o){var a;return gt(n)&&(r=n,o=i,n=vt(t),i=vt(e)),r=r||[],a=(o=z({preferredLayouts:[]},o)).preferredLayouts.indexOf("straight")!==-1&&function(c,l,u,p,d){var y,f,v={};return f=ye(c,l),/^(top|bottom|left|right)$/.test(f)?(/top|bottom/.test(f)&&(y="x"),/left|right/.test(f)&&(y="y"),d.preserveDocking==="target"?dg(y,p,c)?(v[y]=p[y],[{x:v.x!==void 0?v.x:u.x,y:v.y!==void 0?v.y:u.y,original:{x:v.x!==void 0?v.x:u.x,y:v.y!==void 0?v.y:u.y}},{x:p.x,y:p.y}]):null:dg(y,u,l)?(v[y]=u[y],[{x:u.x,y:u.y},{x:v.x!==void 0?v.x:p.x,y:v.y!==void 0?v.y:p.y,original:{x:v.x!==void 0?v.x:p.x,y:v.y!==void 0?v.y:p.y}}]):null):null}(t,e,n,i,o),a||(a=o.connectionEnd&&function(c,l,u,p){var d=p.slice().reverse();return d=Up(c,l,u,d),d?d.reverse():null}(e,t,i,r),a||(a=o.connectionStart&&Up(t,e,n,r))||(!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:R_(t,e,n,i,o)))}function dg(t,e,n){return function(i,r,o){return i>=r&&i<=o}(e[t],n[t],n[t]+n[{x:"width",y:"height"}[t]])}function Up(t,e,n,i){if(function(c){return c.length<3||!(c.length>4)&&!!kt(c,function(l,u){var p=c[u-1];return p&&So(l,p)<3})}(i))return null;var r,o=i[0],a=i.slice();return a[0]=n,a[1]=function(c,l,u){switch(Gn(l,c)){case"v":return{x:u.x,y:c.y};case"h":return{x:c.x,y:u.y}}return{x:c.x,y:c.y}}(a[1],o,n),r=function(c,l,u){var p;for(p=c.length-2;p!==0;p--)if(Pd(c[p],l,20)||Pd(c[p],u,20))return c.slice(p);return c}(a,t,e),r!==a&&(a=Up(t,e,n,r)),a&&Gn(a)?null:a}function mg(t){return t&&/t|r|b|l/.test(t)}function fg(t,e,n,i){if(n==="h"&&(n=/left/.test(i)?"l":"r"),n==="v"&&(n=/top/.test(i)?"t":"b"),n==="t")return{original:t,x:t.x,y:e.y};if(n==="r")return{original:t,x:e.x+e.width,y:t.y};if(n==="b")return{original:t,x:t.x,y:e.y+e.height};if(n==="l")return{original:t,x:e.x,y:t.y};throw new Error("unexpected dockingDirection: <"+n+">")}function vg(t){return t.reduce(function(e,n,i){return Ul(e[e.length-1],t[i+1],n,0)||e.push(n),e},[])}var Hp={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},Sc={top:"t",right:"r",bottom:"b",left:"l"};function qp(){}function I_(t,e){return A(e,"bpmn:Participant")?"source":A(t,"bpmn:Participant")?"target":va(e)?"source":va(t)||A(e,"bpmn:Event")?"target":A(t,"bpmn:Event")?"source":null}function D_(t){return va(t)?"target":"source"}function yg(t,e){return t?t.original||t:vt(e)}function gg(t,e){return A(e,"bpmn:Activity")&&A(t,"bpmn:BoundaryEvent")&&e.businessObject.isForCompensation}function va(t){return A(t,"bpmn:SubProcess")&&Pt(t)}function ya(t,e){return t===e}function ga(t){var e=/right|left/.exec(t);return e&&e[0]}function rr(t){var e=/top|bottom/.exec(t);return e&&e[0]}function Wp(t){return t==="right"||t==="left"}function B_(t,e){var n=e.waypoints,i=n&&n.length&&ye(n[0],t);return i==="top"?["t:r"]:i==="right"?["r:b"]:i==="left"?["l:t"]:["b:l"]}function O_(t,e,n){var i,r,o,a,c=vt(t),l=vt(e),u=(a=(o=t).host,ye(vt(o),a,-10)),p=ya(t.host,e),d=["top","right","bottom","left"].indexOf(u)!==-1,y=ye(l,c,{x:t.width/2+e.width/2,y:t.height/2+e.height/2});return p?function(f,v,g,b,E){var S,w=v?f:rr(f),C=Sc[w];return S=v?Wp(f)?bg("y",g,b,E)?"h":"b":bg("x",g,b,E)?"v":"l":"v",[C+":"+S]}(u,d,t,e,n):(i=function(f,v,g){if(g)return Sc[f];if(ya(rr(f),rr(v))||(b=ga(f),E=ga(v),Hp[b]===E))return Sc[rr(f)];var b,E;return Sc[ga(f)]}(u,y,d),r=function(f,v,g){if(g)return Wp(f)?(b=v,E=ga(f),S=Hp[E],b.indexOf(S)!==-1||ya(f,v)?"h":"v"):function(w,C){var B=rr(w),s=Hp[B];return C.indexOf(s)!==-1}(f,v)||ya(f,v)?"v":"h";var b,E,S;return Wp(v)||ya(rr(f),rr(v))&&ga(v)?"h":"v"}(u,y,d),[i+":"+r])}function bg(t,e,n,i){return!(Xp(t,i,n,40)||Xp(t,i,{x:n.x+n.width,y:n.y+n.height},40)||Xp(t,i,vt(e),40))}function Xp(t,e,n,i){return Math.abs(e[t]-n[t])
'),t.appendChild(o));var a=n.html||(n.separator?'
':'
'),c=Lt(a);o.appendChild(c),n.separator||(ze(c,"data-action",i),n.title&&ze(c,"title",n.title),n.className&&function(l,u){var p=ne(l);(gt(u)?u:u.split(/\s+/g)).forEach(function(d){p.add(d)})}(c,n.className),n.imageUrl&&c.appendChild(Lt('')))}),this.open()},te.prototype.trigger=function(t,e,n){var i,r,o,a=this._entries,c=e.delegateTarget||e.target;if(!c)return e.preventDefault();(i=a[ze(c,"data-action")])&&(r=i.action,o=e.originalEvent||e,fe(r)?t==="click"&&r(o,n):r[t]&&r[t](o,n),e.preventDefault())},te.prototype._layoutChanged=function(){this._toggleState({})},te.prototype._needsCollapse=function(t,e){return t<46*Object.keys(e).length+50},te.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},te.prototype.open=function(){this._toggleState({open:!0})},te.prototype.toggle=function(t){this.isOpen()?this.close():this.open()},te.prototype.isActiveTool=function(t){return t&&this._activeTool===t},te.prototype.updateToolHighlight=function(t){var e;this._toolsContainer||(e=Ut(".djs-palette-entries",this._container),this._toolsContainer=Ut("[data-group=tools]",e)),L(this._toolsContainer.children,function(n){var i=n.getAttribute("data-action");if(i){var r=ne(n);i=i.replace("-tool",""),r.contains("entry")&&i===t?r.add("highlighted-entry"):r.remove("highlighted-entry")}})},te.prototype.isOpen=function(){return ne(this._container).has(Jp)},te.prototype._getParentContainer=function(){return this._canvas.getContainer()},te.HTML_MARKUP='
';const z_={__init__:["palette"],palette:["type",te]};var Mg="crosshair";function or(t,e,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var c=this,l=function(d){var y,f=e.getActiveLayer();K(y=d.frame=ot("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),lt(f,y)},u=function(d){var y=d.frame,f=d.bbox;K(y,{x:f.x,y:f.y,width:f.width,height:f.height})},p=function(d){d.frame&&Zt(d.frame)};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),t.on("lasso.selection.end",function(d){var y=d.originalEvent.target;(d.hover||y instanceof SVGElement)&&t.once("lasso.selection.ended",function(){c.activateLasso(d.originalEvent,!0)})}),t.on("lasso.end",function(d){var y=Zp(d),f=i.filter(function(v){return v});c.select(f,y)}),t.on("lasso.start",function(d){var y=d.context;y.bbox=Zp(d),l(y)}),t.on("lasso.move",function(d){var y=d.context;y.bbox=Zp(d),u(y)}),t.on("lasso.cleanup",function(d){var y=d.context;p(y)}),t.on("element.mousedown",1500,function(d){if(Mm(d))return c.activateLasso(d.originalEvent),!0})}function Zp(t){var e={x:t.x-t.dx,y:t.y-t.dy},n={x:t.x,y:t.y};return e.x<=n.x&&e.y=n.x&&e.yn.x&&e.y<=n.y?{x:n.x,y:e.y,width:e.x-n.x,height:n.y-e.y}:e.x<=n.x&&e.y>n.y||e.x=n.y?{x:e.x,y:n.y,width:n.x-e.x,height:e.y-n.y}:e.x>=n.x&&e.y>n.y||e.x>n.x&&e.y>=n.y?{x:n.x,y:n.y,width:e.x-n.x,height:e.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}or.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],or.prototype.activateLasso=function(t,e){this._dragging.init(t,"lasso",{autoActivate:e,cursor:Mg,data:{context:{}}})},or.prototype.activateSelection=function(t,e){this._dragging.init(t,"lasso.selection",{trapClick:!1,autoActivate:e,cursor:Mg,data:{context:{}}})},or.prototype.select=function(t,e){var n=function(i,r){var o={};return L(i,function(a){var c=a;c.waypoints&&(c=ve(c)),!ht(r.y)&&c.x>r.x&&(o[a.id]=a),!ht(r.x)&&c.y>r.y&&(o[a.id]=a),c.x>r.x&&c.y>r.y&&(ht(r.width)&&ht(r.height)&&c.width+c.xu[d]+y-p&&re(l,d,u[d]+y-p)})}(e,o,function(l){return A(l,"bpmn:Task")?10:20}(o)),o&&function(l,u){return ui(u,function(p){return jg(l,p)})}(i,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=tn(r),wt(o,["bpmn:Event","bpmn:Gateway"])&&Lg(e,tn(o)),wt(o,["bpmn:Task","bpmn:SubProcess"])&&function(l,u){var p=tn(u);Bg.forEach(function(d){(function(y,f,v){return y[v]>f[v]+20&&y[v]y[g]?y[g]+eh:y[g]-eh,re(l,g,b))})}}(e)):jg(i,"bpmn:MessageFlow")?(A(r,"bpmn:Event")&&(n.connectionStart=tn(r)),A(o,"bpmn:Event")&&Lg(e,tn(o))):n.connectionStart=n.initialConnectionStart)})}function Lg(t,e){re(t,"x",e.x),re(t,"y",e.y)}function jg(t,e){return t&&t.type===e}function Vg(t,e){return t==="x"?e.width:e.height}function Ri(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function Ac(t){this._snapValues={}}Og.$inject=["eventBus"],Ri.prototype.getSnapOrigin=function(t){return this._snapOrigins[t]},Ri.prototype.setSnapOrigin=function(t,e){this._snapOrigins[t]=e,this._snapLocations.indexOf(t)===-1&&this._snapLocations.push(t)},Ri.prototype.addDefaultSnap=function(t,e){var n=this._defaultSnaps[t];n||(n=this._defaultSnaps[t]=[]),n.push(e)},Ri.prototype.getSnapLocations=function(){return this._snapLocations},Ri.prototype.setSnapLocations=function(t){this._snapLocations=t},Ri.prototype.pointsForTarget=function(t){var e=t.id||t,n=this._targets[e];return n||(n=this._targets[e]=new Ac).initDefaults(this._defaultSnaps),n},Ac.prototype.add=function(t,e){var n=this._snapValues[t];n||(n=this._snapValues[t]={x:[],y:[]}),n.x.indexOf(e.x)===-1&&n.x.push(e.x),n.y.indexOf(e.y)===-1&&n.y.push(e.y)},Ac.prototype.snap=function(t,e,n,i){var r=this._snapValues[e];return r&&function(o,a,c){var l,u;for(c=c===void 0?10:c,l=0;l=t.x||i&&i<=t.x)&&re(t,"x",t.x),(n&&n>=t.y||r&&r<=t.y)&&re(t,"y",t.y)}}function Fg(t,e){return t.indexOf(e)!==-1}function zg(t,e,n){return e?{x:t.x-n.x,y:t.y-n.y}:{x:t.x,y:t.y}}rt(ro,Bn),ro.$inject=["eventBus","injector"],ro.prototype.initSnap=function(t){var e=Bn.prototype.initSnap.call(this,t),n=t.shape,i=!!this._elementRegistry.get(n.id);return L(n.outgoing,function(r){var o=r.waypoints[0];o=o.original||o,e.setSnapOrigin(r.id+"-docking",zg(o,i,t))}),L(n.incoming,function(r){var o=r.waypoints[r.waypoints.length-1];o=o.original||o,e.setSnapOrigin(r.id+"-docking",zg(o,i,t))}),A(n,"bpmn:Participant")&&e.setSnapLocations(["top-left","bottom-right","mid"]),e},ro.prototype.addSnapTargetPoints=function(t,e,n){Bn.prototype.addSnapTargetPoints.call(this,t,e,n);var i=this.getSnapTargets(e,n);L(i,function(o){var a;(function(c){return A(c,"bpmn:SubProcess")&&Pt(c)?!0:A(c,"bpmn:Participant")}(o)||(a="bpmn:TextAnnotation",[e,o].every(function(c){return A(c,a)})))&&(t.add("top-left",kf(o)),t.add("bottom-right",Pf(o)))});var r=this._elementRegistry;return L(e.incoming,function(o){if(r.get(e.id)){Fg(i,o.source)||t.add("mid",vt(o.source));var a=o.waypoints[0];t.add(o.id+"-docking",a.original||a)}}),L(e.outgoing,function(o){if(r.get(e.id)){Fg(i,o.target)||t.add("mid",vt(o.target));var a=o.waypoints[o.waypoints.length-1];t.add(o.id+"-docking",a.original||a)}}),A(n,"bpmn:SequenceFlow")&&(t=this.addSnapTargetPoints(t,e,n.parent)),t},ro.prototype.getSnapTargets=function(t,e){return Bn.prototype.getSnapTargets.call(this,t,e).filter(function(n){return!A(n,"bpmn:Lane")})};function ba(t,e){var n=this;t.on(["resize.start"],function(i){n.initSnap(i)}),t.on(["resize.move","resize.end"],1250,function(i){var r=i.context,o=r.shape,a=o.parent,c=r.direction,l=r.snapContext;if(!(i.originalEvent&&He(i.originalEvent)||Yr(i))){var u=l.pointsForTarget(a);u.initialized||((u=n.addSnapTargetPoints(u,o,a,c)).initialized=!0),function(p){return p==="n"||p==="s"}(c)&&re(i,"x",i.x),function(p){return p==="e"||p==="w"}(c)&&re(i,"y",i.y),e.snap(i,u)}}),t.on(["resize.cleanup"],function(){e.hide()})}function $g(t,e){var n=vt(t),i=st(t),r={x:n.x,y:n.y};return e.indexOf("n")!==-1?r.y=i.top:e.indexOf("s")!==-1&&(r.y=i.bottom),e.indexOf("e")!==-1?r.x=i.right:e.indexOf("w")!==-1&&(r.x=i.left),r}ba.prototype.initSnap=function(t){var e=t.context,n=e.shape,i=e.direction,r=e.snapContext;r||(r=e.snapContext=new Ri);var o=$g(n,i);return r.setSnapOrigin("corner",{x:o.x-t.x,y:o.y-t.y}),r},ba.prototype.addSnapTargetPoints=function(t,e,n,i){return L(this.getSnapTargets(e,n),function(r){t.add("corner",Pf(r)),t.add("corner",kf(r))}),t.add("corner",$g(e,i)),t},ba.$inject=["eventBus","snapping"],ba.prototype.getSnapTargets=function(t,e){return Mf(e).filter(function(n){return i=n,r=t,!(i.host===r||function(o){return!!o.waypoints}(n)||function(o){return!!o.hidden}(n)||function(o){return!!o.labelTarget}(n));var i,r})};function Ni(t){this._canvas=t,this._asyncHide=Tl(_e(this.hide,this),1e3)}Ni.$inject=["canvas"],Ni.prototype.snap=function(t,e){var n=t.context.snapContext,i=n.getSnapLocations(),r={x:Yr(t,"x"),y:Yr(t,"y")};L(i,function(o){var a=n.getSnapOrigin(o),c={x:t.x+a.x,y:t.y+a.y};if(L(["x","y"],function(l){var u;r[l]||(u=e.snap(c,o,l,7))!==void 0&&(r[l]={value:u,originValue:u-a[l]})}),r.x&&r.y)return!1}),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),L(["x","y"],function(o){var a=r[o];Jt(a)&&re(t,o,a.originValue)})},Ni.prototype._createLine=function(t){var e=this._canvas.getLayer("snap"),n=ot("path");return K(n,{d:"M0,0 L0,0"}),bt(n).add("djs-snap-line"),lt(e,n),{update:function(i){ht(i)?K(n,t==="horizontal"?{d:"M-100000,"+i+" L+100000,"+i,display:""}:{d:"M "+i+",-100000 L "+i+", +100000",display:""}):K(n,{display:"none"})}}},Ni.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},Ni.prototype.showSnapLine=function(t,e){var n=this.getSnapLine(t);n&&n.update(e),this._asyncHide()},Ni.prototype.getSnapLine=function(t){return this._snapLines||this._createSnapLines(),this._snapLines[t]},Ni.prototype.hide=function(){L(this._snapLines,function(t){t.update()})};const K_={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Bn],resizeSnapping:["type",ba],snapping:["type",Ni]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Og],createMoveSnapping:["type",ro]};function ut(t,e,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=t,this._eventBus=e,this._overlays=n,this._selection=i,this._container=Lt(ut.BOX_HTML),this._searchInput=Ut(ut.INPUT_SELECTOR,this._container),this._resultsContainer=Ut(ut.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),e.on(["canvas.destroy","diagram.destroy"],this.close,this)}function Gg(t,e,n){var i=function(o){var a="";return o.forEach(function(c){c.matched?a+=''+df(c.matched)+"":a+=df(c.normal)}),a!==""?a:null}(e),r=Lt(n);r.innerHTML=i,t.appendChild(r)}ut.$inject=["canvas","eventBus","overlays","selection"],ut.prototype._bindEvents=function(){var t=this;function e(n,i,r,o){t._eventMaps.push({el:n,type:r,listener:$e.bind(n,i,r,o)})}e(document,"html","click",function(n){t.close()}),e(this._container,ut.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),e(this._container,ut.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),t._scrollToNode(n.delegateTarget),t._preselect(n.delegateTarget)}),e(this._container,ut.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),t._select(n.delegateTarget)}),e(this._container,ut.INPUT_SELECTOR,"keydown",function(n){n.keyCode===38&&n.preventDefault(),n.keyCode===40&&n.preventDefault()}),e(this._container,ut.INPUT_SELECTOR,"keyup",function(n){if(n.keyCode===27)return t.close();if(n.keyCode===13){var i=t._getCurrentResult();return i?t._select(i):t.close()}return n.keyCode===38?t._scrollToDirection(!0):n.keyCode===40?t._scrollToDirection():void(n.keyCode!==37&&n.keyCode!==39&&t._search(n.delegateTarget.value))})},ut.prototype._unbindEvents=function(){this._eventMaps.forEach(function(t){$e.unbind(t.el,t.type,t.listener)})},ut.prototype._search=function(t){var e=this;if(this._clearResults(),t&&t!==""){var n=this._searchProvider.find(t);if(n.length){n.forEach(function(r){var o=r.element.id,a=e._createResultNode(r,o);e._results[o]={element:r.element,node:a}});var i=Ut(ut.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},ut.prototype._scrollToDirection=function(t){var e=this._getCurrentResult();if(e){var n=t?e.previousElementSibling:e.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},ut.prototype._scrollToNode=function(t){if(t&&t!==this._getCurrentResult()){var e=t.offsetTop,n=this._resultsContainer.scrollTop,i=e-this._resultsContainer.clientHeight+t.clientHeight;e0&&Gg(n,t.primaryTokens,ut.RESULT_PRIMARY_HTML),Gg(n,t.secondaryTokens,ut.RESULT_SECONDARY_HTML),ze(n,ut.RESULT_ID_ATTRIBUTE,e),this._resultsContainer.appendChild(n),n},ut.prototype.registerProvider=function(t){this._searchProvider=t},ut.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,ne(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},ut.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,ne(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},ut.prototype.toggle=function(){this.isOpen()?this.close():this.open()},ut.prototype.isOpen=function(){return this._open},ut.prototype._preselect=function(t){var e=this._getCurrentResult();if(t!==e){e&&ne(e).remove(ut.RESULT_SELECTED_CLASS);var n=ze(t,ut.RESULT_ID_ATTRIBUTE),i=this._results[n].element;ne(t).add(ut.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},ut.prototype._select=function(t){var e=ze(t,ut.RESULT_ID_ATTRIBUTE),n=this._results[e].element;this.close(),this._resetOverlay(),this._canvas.scrollToElement(n,{top:400}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},ut.prototype._resetOverlay=function(t){if(this._overlayId&&this._overlays.remove(this._overlayId),t){var e=function(n){var i=6,r=n.width+2*i,o=n.height+2*i,a=["width: "+r+"px","height: "+o+"px"].join("; ");return{position:{bottom:o-i,right:r-i},show:!0,html:'
'}}(ve(t));this._overlayId=this._overlays.add(t,e)}},ut.CONTAINER_SELECTOR=".djs-search-container",ut.INPUT_SELECTOR=".djs-search-input input",ut.RESULTS_CONTAINER_SELECTOR=".djs-search-results",ut.RESULT_SELECTOR=".djs-search-result",ut.RESULT_SELECTED_CLASS="djs-search-result-selected",ut.RESULT_SELECTED_SELECTOR="."+ut.RESULT_SELECTED_CLASS,ut.RESULT_ID_ATTRIBUTE="data-result-id",ut.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",ut.OVERLAY_CLASS="djs-search-overlay",ut.BOX_HTML='
',ut.RESULT_HTML='
',ut.RESULT_PRIMARY_HTML='
',ut.RESULT_SECONDARY_HTML='

';const Y_={__depends__:[pu,Mn],searchPad:["type",ut]};function ih(t,e,n){this._elementRegistry=t,this._canvas=n,e.registerProvider(this)}function Ug(t){return mt(t,function(e){return!!e.matched}).length>0}function Hg(t,e){var n=[],i=t;if(!t)return n;t=t.toLowerCase(),e=e.toLowerCase();var r=t.indexOf(e);return r>-1?(r!==0&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,e.length)}),e.length+r')}),On.prototype._interactionModules=[$m,qm,Lx,Xm],On.prototype._modelingModules=[Vx,Ux,Xx,Hx,tE,Ru,eE,ME,ev,ks,IE,BE,jE,VE,FE,UE,XE,L_,j_,H_,q_,Mv,K_,J_],On.prototype._modules=[].concat(Wn.prototype._modules,On.prototype._interactionModules,On.prototype._modelingModules);const qg=(t,e,n)=>(n||(n="camunda"),` `),Z_={"Append EndEvent":"\u8FFD\u52A0\u7ED3\u675F\u4E8B\u4EF6","Append Gateway":"\u8FFD\u52A0\u7F51\u5173","Append Task":"\u8FFD\u52A0\u4EFB\u52A1","Append Intermediate/Boundary Event":"\u8FFD\u52A0\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6/\u8FB9\u754C\u4E8B\u4EF6","Activate the global connect tool":"\u6FC0\u6D3B\u5168\u5C40\u8FDE\u63A5\u5DE5\u5177","Append {type}":"\u6DFB\u52A0 {type}","Add Lane above":"\u5728\u4E0A\u9762\u6DFB\u52A0\u9053","Divide into two Lanes":"\u5206\u5272\u6210\u4E24\u4E2A\u9053","Divide into three Lanes":"\u5206\u5272\u6210\u4E09\u4E2A\u9053","Add Lane below":"\u5728\u4E0B\u9762\u6DFB\u52A0\u9053","Append compensation activity":"\u8FFD\u52A0\u8865\u507F\u6D3B\u52A8","Change type":"\u4FEE\u6539\u7C7B\u578B","Connect using Association":"\u4F7F\u7528\u5173\u8054\u8FDE\u63A5","Connect using Sequence/MessageFlow or Association":"\u4F7F\u7528\u987A\u5E8F/\u6D88\u606F\u6D41\u6216\u8005\u5173\u8054\u8FDE\u63A5","Connect using DataInputAssociation":"\u4F7F\u7528\u6570\u636E\u8F93\u5165\u5173\u8054\u8FDE\u63A5",Remove:"\u79FB\u9664","Activate the hand tool":"\u6FC0\u6D3B\u6293\u624B\u5DE5\u5177","Activate the lasso tool":"\u6FC0\u6D3B\u5957\u7D22\u5DE5\u5177","Activate the create/remove space tool":"\u6FC0\u6D3B\u521B\u5EFA/\u5220\u9664\u7A7A\u95F4\u5DE5\u5177","Create expanded SubProcess":"\u521B\u5EFA\u6269\u5C55\u5B50\u8FC7\u7A0B","Create IntermediateThrowEvent/BoundaryEvent":"\u521B\u5EFA\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6/\u8FB9\u754C\u4E8B\u4EF6","Create Pool/Participant":"\u521B\u5EFA\u6C60/\u53C2\u4E0E\u8005","Parallel Multi Instance":"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6","Sequential Multi Instance":"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",DataObjectReference:"\u6570\u636E\u5BF9\u8C61\u53C2\u8003",DataStoreReference:"\u6570\u636E\u5B58\u50A8\u53C2\u8003",Loop:"\u5FAA\u73AF","Ad-hoc":"\u5373\u5E2D","Create {type}":"\u521B\u5EFA {type}",Task:"\u4EFB\u52A1","Send Task":"\u53D1\u9001\u4EFB\u52A1","Receive Task":"\u63A5\u6536\u4EFB\u52A1","User Task":"\u7528\u6237\u4EFB\u52A1","Manual Task":"\u624B\u5DE5\u4EFB\u52A1","Business Rule Task":"\u4E1A\u52A1\u89C4\u5219\u4EFB\u52A1","Service Task":"\u670D\u52A1\u4EFB\u52A1","Script Task":"\u811A\u672C\u4EFB\u52A1","Call Activity":"\u8C03\u7528\u6D3B\u52A8","Sub Process (collapsed)":"\u5B50\u6D41\u7A0B\uFF08\u6298\u53E0\u7684\uFF09","Sub Process (expanded)":"\u5B50\u6D41\u7A0B\uFF08\u5C55\u5F00\u7684\uFF09","Start Event":"\u5F00\u59CB\u4E8B\u4EF6",StartEvent:"\u5F00\u59CB\u4E8B\u4EF6","Intermediate Throw Event":"\u4E2D\u95F4\u4E8B\u4EF6","End Event":"\u7ED3\u675F\u4E8B\u4EF6",EndEvent:"\u7ED3\u675F\u4E8B\u4EF6","Create StartEvent":"\u521B\u5EFA\u5F00\u59CB\u4E8B\u4EF6","Create EndEvent":"\u521B\u5EFA\u7ED3\u675F\u4E8B\u4EF6","Create Task":"\u521B\u5EFA\u4EFB\u52A1","Create User Task":"\u521B\u5EFA\u7528\u6237\u4EFB\u52A1","Create Gateway":"\u521B\u5EFA\u7F51\u5173","Create DataObjectReference":"\u521B\u5EFA\u6570\u636E\u5BF9\u8C61","Create DataStoreReference":"\u521B\u5EFA\u6570\u636E\u5B58\u50A8","Create Group":"\u521B\u5EFA\u5206\u7EC4","Create Intermediate/Boundary Event":"\u521B\u5EFA\u4E2D\u95F4/\u8FB9\u754C\u4E8B\u4EF6","Message Start Event":"\u6D88\u606F\u5F00\u59CB\u4E8B\u4EF6","Timer Start Event":"\u5B9A\u65F6\u5F00\u59CB\u4E8B\u4EF6","Conditional Start Event":"\u6761\u4EF6\u5F00\u59CB\u4E8B\u4EF6","Signal Start Event":"\u4FE1\u53F7\u5F00\u59CB\u4E8B\u4EF6","Error Start Event":"\u9519\u8BEF\u5F00\u59CB\u4E8B\u4EF6","Escalation Start Event":"\u5347\u7EA7\u5F00\u59CB\u4E8B\u4EF6","Compensation Start Event":"\u8865\u507F\u5F00\u59CB\u4E8B\u4EF6","Message Start Event (non-interrupting)":"\u6D88\u606F\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Timer Start Event (non-interrupting)":"\u5B9A\u65F6\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Conditional Start Event (non-interrupting)":"\u6761\u4EF6\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Signal Start Event (non-interrupting)":"\u4FE1\u53F7\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Escalation Start Event (non-interrupting)":"\u5347\u7EA7\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Message Intermediate Catch Event":"\u6D88\u606F\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Message Intermediate Throw Event":"\u6D88\u606F\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Timer Intermediate Catch Event":"\u5B9A\u65F6\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Escalation Intermediate Throw Event":"\u5347\u7EA7\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Conditional Intermediate Catch Event":"\u6761\u4EF6\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Link Intermediate Catch Event":"\u94FE\u63A5\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Link Intermediate Throw Event":"\u94FE\u63A5\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Compensation Intermediate Throw Event":"\u8865\u507F\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Signal Intermediate Catch Event":"\u4FE1\u53F7\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Signal Intermediate Throw Event":"\u4FE1\u53F7\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Message End Event":"\u6D88\u606F\u7ED3\u675F\u4E8B\u4EF6","Escalation End Event":"\u5B9A\u65F6\u7ED3\u675F\u4E8B\u4EF6","Error End Event":"\u9519\u8BEF\u7ED3\u675F\u4E8B\u4EF6","Cancel End Event":"\u53D6\u6D88\u7ED3\u675F\u4E8B\u4EF6","Compensation End Event":"\u8865\u507F\u7ED3\u675F\u4E8B\u4EF6","Signal End Event":"\u4FE1\u53F7\u7ED3\u675F\u4E8B\u4EF6","Terminate End Event":"\u7EC8\u6B62\u7ED3\u675F\u4E8B\u4EF6","Message Boundary Event":"\u6D88\u606F\u8FB9\u754C\u4E8B\u4EF6","Message Boundary Event (non-interrupting)":"\u6D88\u606F\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Timer Boundary Event":"\u5B9A\u65F6\u8FB9\u754C\u4E8B\u4EF6","Timer Boundary Event (non-interrupting)":"\u5B9A\u65F6\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Escalation Boundary Event":"\u5347\u7EA7\u8FB9\u754C\u4E8B\u4EF6","Escalation Boundary Event (non-interrupting)":"\u5347\u7EA7\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Conditional Boundary Event":"\u6761\u4EF6\u8FB9\u754C\u4E8B\u4EF6","Conditional Boundary Event (non-interrupting)":"\u6761\u4EF6\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Error Boundary Event":"\u9519\u8BEF\u8FB9\u754C\u4E8B\u4EF6","Cancel Boundary Event":"\u53D6\u6D88\u8FB9\u754C\u4E8B\u4EF6","Signal Boundary Event":"\u4FE1\u53F7\u8FB9\u754C\u4E8B\u4EF6","Signal Boundary Event (non-interrupting)":"\u4FE1\u53F7\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Compensation Boundary Event":"\u8865\u507F\u8FB9\u754C\u4E8B\u4EF6","Exclusive Gateway":"\u4E92\u65A5\u7F51\u5173","Parallel Gateway":"\u5E76\u884C\u7F51\u5173","Inclusive Gateway":"\u76F8\u5BB9\u7F51\u5173","Complex Gateway":"\u590D\u6742\u7F51\u5173","Event based Gateway":"\u4E8B\u4EF6\u7F51\u5173",Transaction:"\u8F6C\u8FD0","Sub Process":"\u5B50\u6D41\u7A0B","Event Sub Process":"\u4E8B\u4EF6\u5B50\u6D41\u7A0B","Collapsed Pool":"\u6298\u53E0\u6C60","Expanded Pool":"\u5C55\u5F00\u6C60","no parent for {element} in {parent}":"\u5728{parent}\u91CC\uFF0C{element}\u6CA1\u6709\u7236\u7C7B","no shape type specified":"\u6CA1\u6709\u6307\u5B9A\u7684\u5F62\u72B6\u7C7B\u578B","flow elements must be children of pools/participants":"\u6D41\u5143\u7D20\u5FC5\u987B\u662F\u6C60/\u53C2\u4E0E\u8005\u7684\u5B50\u7C7B","out of bounds release":"out of bounds release","more than {count} child lanes":"\u5B50\u9053\u5927\u4E8E{count} ","element required":"\u5143\u7D20\u4E0D\u80FD\u4E3A\u7A7A","diagram not part of bpmn:Definitions":"\u6D41\u7A0B\u56FE\u4E0D\u7B26\u5408bpmn\u89C4\u8303","no diagram to display":"\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u6D41\u7A0B\u56FE","no process or collaboration to display":"\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u6D41\u7A0B/\u534F\u4F5C","element {element} referenced by {referenced}#{property} not yet drawn":"\u7531{referenced}#{property}\u5F15\u7528\u7684{element}\u5143\u7D20\u4ECD\u672A\u7ED8\u5236","already rendered {element}":"{element} \u5DF2\u88AB\u6E32\u67D3","failed to import {element}":"\u5BFC\u5165{element}\u5931\u8D25",Id:"\u7F16\u53F7",Name:"\u540D\u79F0",General:"\u5E38\u89C4",Details:"\u8BE6\u60C5","Message Name":"\u6D88\u606F\u540D\u79F0",Message:"\u6D88\u606F",Initiator:"\u521B\u5EFA\u8005","Asynchronous Continuations":"\u6301\u7EED\u5F02\u6B65","Asynchronous Before":"\u5F02\u6B65\u524D","Asynchronous After":"\u5F02\u6B65\u540E","Job Configuration":"\u5DE5\u4F5C\u914D\u7F6E",Exclusive:"\u6392\u9664","Job Priority":"\u5DE5\u4F5C\u4F18\u5148\u7EA7","Retry Time Cycle":"\u91CD\u8BD5\u65F6\u95F4\u5468\u671F",Documentation:"\u6587\u6863","Element Documentation":"\u5143\u7D20\u6587\u6863","History Configuration":"\u5386\u53F2\u914D\u7F6E","History Time To Live":"\u5386\u53F2\u7684\u751F\u5B58\u65F6\u95F4",Forms:"\u8868\u5355","Form Key":"\u8868\u5355key","Form Fields":"\u8868\u5355\u5B57\u6BB5","Business Key":"\u4E1A\u52A1key","Form Field":"\u8868\u5355\u5B57\u6BB5",ID:"\u7F16\u53F7",Type:"\u7C7B\u578B",Label:"\u540D\u79F0","Default Value":"\u9ED8\u8BA4\u503C","Default Flow":"\u9ED8\u8BA4\u6D41\u8F6C\u8DEF\u5F84","Conditional Flow":"\u6761\u4EF6\u6D41\u8F6C\u8DEF\u5F84","Sequence Flow":"\u666E\u901A\u6D41\u8F6C\u8DEF\u5F84",Validation:"\u6821\u9A8C","Add Constraint":"\u6DFB\u52A0\u7EA6\u675F",Config:"\u914D\u7F6E",Properties:"\u5C5E\u6027","Add Property":"\u6DFB\u52A0\u5C5E\u6027",Value:"\u503C",Listeners:"\u76D1\u542C\u5668","Execution Listener":"\u6267\u884C\u76D1\u542C","Event Type":"\u4E8B\u4EF6\u7C7B\u578B","Listener Type":"\u76D1\u542C\u5668\u7C7B\u578B","Java Class":"Java\u7C7B",Expression:"\u8868\u8FBE\u5F0F","Must provide a value":"\u5FC5\u987B\u63D0\u4F9B\u4E00\u4E2A\u503C","Delegate Expression":"\u4EE3\u7406\u8868\u8FBE\u5F0F",Script:"\u811A\u672C","Script Format":"\u811A\u672C\u683C\u5F0F","Script Type":"\u811A\u672C\u7C7B\u578B","Inline Script":"\u5185\u8054\u811A\u672C","External Script":"\u5916\u90E8\u811A\u672C",Resource:"\u8D44\u6E90","Field Injection":"\u5B57\u6BB5\u6CE8\u5165",Extensions:"\u6269\u5C55","Input/Output":"\u8F93\u5165/\u8F93\u51FA","Input Parameters":"\u8F93\u5165\u53C2\u6570","Output Parameters":"\u8F93\u51FA\u53C2\u6570",Parameters:"\u53C2\u6570","Output Parameter":"\u8F93\u51FA\u53C2\u6570","Timer Definition Type":"\u5B9A\u65F6\u5668\u5B9A\u4E49\u7C7B\u578B","Timer Definition":"\u5B9A\u65F6\u5668\u5B9A\u4E49",Date:"\u65E5\u671F",Duration:"\u6301\u7EED",Cycle:"\u5FAA\u73AF",Signal:"\u4FE1\u53F7","Signal Name":"\u4FE1\u53F7\u540D\u79F0",Escalation:"\u5347\u7EA7",Error:"\u9519\u8BEF","Link Name":"\u94FE\u63A5\u540D\u79F0",Condition:"\u6761\u4EF6\u540D\u79F0","Variable Name":"\u53D8\u91CF\u540D\u79F0","Variable Event":"\u53D8\u91CF\u4E8B\u4EF6","Specify more than one variable change event as a comma separated list.":"\u591A\u4E2A\u53D8\u91CF\u4E8B\u4EF6\u4EE5\u9017\u53F7\u9694\u5F00","Wait for Completion":"\u7B49\u5F85\u5B8C\u6210","Activity Ref":"\u6D3B\u52A8\u53C2\u8003","Version Tag":"\u7248\u672C\u6807\u7B7E",Executable:"\u53EF\u6267\u884C\u6587\u4EF6","External Task Configuration":"\u6269\u5C55\u4EFB\u52A1\u914D\u7F6E","Task Priority":"\u4EFB\u52A1\u4F18\u5148\u7EA7",External:"\u5916\u90E8",Connector:"\u8FDE\u63A5\u5668","Must configure Connector":"\u5FC5\u987B\u914D\u7F6E\u8FDE\u63A5\u5668","Connector Id":"\u8FDE\u63A5\u5668\u7F16\u53F7",Implementation:"\u5B9E\u73B0\u65B9\u5F0F","Field Injections":"\u5B57\u6BB5\u6CE8\u5165",Fields:"\u5B57\u6BB5","Result Variable":"\u7ED3\u679C\u53D8\u91CF",Topic:"\u4E3B\u9898","Configure Connector":"\u914D\u7F6E\u8FDE\u63A5\u5668","Input Parameter":"\u8F93\u5165\u53C2\u6570",Assignee:"\u4EE3\u7406\u4EBA","Candidate Users":"\u5019\u9009\u7528\u6237","Candidate Groups":"\u5019\u9009\u7EC4","Due Date":"\u5230\u671F\u65F6\u95F4","Follow Up Date":"\u8DDF\u8E2A\u65E5\u671F",Priority:"\u4F18\u5148\u7EA7","The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"\u8DDF\u8E2A\u65E5\u671F\u5FC5\u987B\u7B26\u5408EL\u8868\u8FBE\u5F0F\uFF0C\u5982\uFF1A ${someDate} ,\u6216\u8005\u4E00\u4E2AISO\u6807\u51C6\u65E5\u671F\uFF0C\u5982\uFF1A2015-06-26T09:54:00","The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"\u8DDF\u8E2A\u65E5\u671F\u5FC5\u987B\u7B26\u5408EL\u8868\u8FBE\u5F0F\uFF0C\u5982\uFF1A ${someDate} ,\u6216\u8005\u4E00\u4E2AISO\u6807\u51C6\u65E5\u671F\uFF0C\u5982\uFF1A2015-06-26T09:54:00",Variables:"\u53D8\u91CF","Candidate Starter Configuration":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u914D\u7F6E","Candidate Starter Groups":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u7EC4","This maps to the process definition key.":"\u8FD9\u6620\u5C04\u5230\u6D41\u7A0B\u5B9A\u4E49\u952E\u3002","Candidate Starter Users":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u7684\u7528\u6237","Specify more than one user as a comma separated list.":"\u6307\u5B9A\u591A\u4E2A\u7528\u6237\u4F5C\u4E3A\u9017\u53F7\u5206\u9694\u7684\u5217\u8868\u3002","Tasklist Configuration":"Tasklist\u914D\u7F6E",Startable:"\u542F\u52A8","Specify more than one group as a comma separated list.":"\u6307\u5B9A\u591A\u4E2A\u7EC4\u4F5C\u4E3A\u9017\u53F7\u5206\u9694\u7684\u5217\u8868\u3002"};var kc,rh,Q_={exports:{}};/*! * svg.js - A lightweight library for manipulating and animating SVG. * @version 2.7.1 * https://svgdotjs.github.io/ * * @copyright Wout Fierens * @license MIT * * BUILT: Fri Nov 30 2018 10:01:55 GMT+0100 (GMT+01:00) */kc=typeof window<"u"?window:Yh,rh=function(t,e){var n=(this!==void 0?this:t).SVG=function(s){if(n.supported)return s=new n.Doc(s),n.parser.draw||n.prepare(),s};if(n.ns="http://www.w3.org/2000/svg",n.xmlns="http://www.w3.org/2000/xmlns/",n.xlink="http://www.w3.org/1999/xlink",n.svgjs="http://svgjs.com/svgjs",n.supported=!!e.createElementNS&&!!e.createElementNS(n.ns,"svg").createSVGRect,!n.supported)return!1;n.did=1e3,n.eid=function(s){return"Svgjs"+d(s)+n.did++},n.create=function(s){var h=e.createElementNS(this.ns,s);return h.setAttribute("id",this.eid(s)),h},n.extend=function(){var s,h,m,_;for(h=(s=[].slice.call(arguments)).pop(),_=s.length-1;_>=0;_--)if(s[_])for(m in h)s[_].prototype[m]=h[m];n.Set&&n.Set.inherit&&n.Set.inherit()},n.invent=function(s){var h=typeof s.create=="function"?s.create:function(){this.constructor.call(this,n.create(s.create))};return s.inherit&&(h.prototype=new s.inherit),s.extend&&n.extend(h,s.extend),s.construct&&n.extend(s.parent||n.Container,s.construct),h},n.adopt=function(s){return s?s.instance?s.instance:((h=s.nodeName=="svg"?s.parentNode instanceof t.SVGElement?new n.Nested:new n.Doc:s.nodeName=="linearGradient"?new n.Gradient("linear"):s.nodeName=="radialGradient"?new n.Gradient("radial"):n[d(s.nodeName)]?new n[d(s.nodeName)]:new n.Element(s)).type=s.nodeName,h.node=s,s.instance=h,h instanceof n.Doc&&h.namespace().defs(),h.setData(JSON.parse(s.getAttribute("svgjs:data"))||{}),h):null;var h},n.prepare=function(){var s=e.getElementsByTagName("body")[0],h=(s?new n.Doc(s):n.adopt(e.documentElement).nested()).size(2,0);n.parser={body:s||e.documentElement,draw:h.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:h.polyline().node,path:h.path().node,native:n.create("svg")}},n.parser={native:n.create("svg")},e.addEventListener("DOMContentLoaded",function(){n.parser.draw||n.prepare()},!1),n.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},n.utils={map:function(s,h){var m,_=s.length,T=[];for(m=0;m<_;m++)T.push(h(s[m]));return T},filter:function(s,h){var m,_=s.length,T=[];for(m=0;m<_;m++)h(s[m])&&T.push(s[m]);return T},radians:function(s){return s%360*Math.PI/180},degrees:function(s){return 180*s/Math.PI%360},filterSVGElements:function(s){return this.filter(s,function(h){return h instanceof t.SVGElement})}},n.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},n.Color=function(s){var h,m;this.r=0,this.g=0,this.b=0,s&&(typeof s=="string"?n.regex.isRgb.test(s)?(h=n.regex.rgb.exec(s.replace(n.regex.whitespace,"")),this.r=parseInt(h[1]),this.g=parseInt(h[2]),this.b=parseInt(h[3])):n.regex.isHex.test(s)&&(h=n.regex.hex.exec((m=s).length==4?["#",m.substring(1,2),m.substring(1,2),m.substring(2,3),m.substring(2,3),m.substring(3,4),m.substring(3,4)].join(""):m),this.r=parseInt(h[1],16),this.g=parseInt(h[2],16),this.b=parseInt(h[3],16)):typeof s=="object"&&(this.r=s.r,this.g=s.g,this.b=s.b))},n.extend(n.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+y(this.r)+y(this.g)+y(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(s){return this.destination=new n.Color(s),this},at:function(s){return this.destination?(s=s<0?0:s>1?1:s,new n.Color({r:~~(this.r+(this.destination.r-this.r)*s),g:~~(this.g+(this.destination.g-this.g)*s),b:~~(this.b+(this.destination.b-this.b)*s)})):this}}),n.Color.test=function(s){return s+="",n.regex.isHex.test(s)||n.regex.isRgb.test(s)},n.Color.isRgb=function(s){return s&&typeof s.r=="number"&&typeof s.g=="number"&&typeof s.b=="number"},n.Color.isColor=function(s){return n.Color.isRgb(s)||n.Color.test(s)},n.Array=function(s,h){(s=(s||[]).valueOf()).length==0&&h&&(s=h.valueOf()),this.value=this.parse(s)},n.extend(n.Array,{morph:function(s){if(this.destination=this.parse(s),this.value.length!=this.destination.length){for(var h=this.value[this.value.length-1],m=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(m);for(;this.value.length=0;_--)this.value[_]=[this.value[_][0]+s,this.value[_][1]+h];return this},size:function(s,h){var m,_=this.bbox();for(m=this.value.length-1;m>=0;m--)_.width&&(this.value[m][0]=(this.value[m][0]-_.x)*s/_.width+_.x),_.height&&(this.value[m][1]=(this.value[m][1]-_.y)*h/_.height+_.y);return this},bbox:function(){return n.parser.poly.setAttribute("points",this.toString()),n.parser.poly.getBBox()}});for(var i={M:function(s,h,m){return h.x=m.x=s[0],h.y=m.y=s[1],["M",h.x,h.y]},L:function(s,h){return h.x=s[0],h.y=s[1],["L",s[0],s[1]]},H:function(s,h){return h.x=s[0],["H",s[0]]},V:function(s,h){return h.y=s[0],["V",s[0]]},C:function(s,h){return h.x=s[4],h.y=s[5],["C",s[0],s[1],s[2],s[3],s[4],s[5]]},S:function(s,h){return h.x=s[2],h.y=s[3],["S",s[0],s[1],s[2],s[3]]},Q:function(s,h){return h.x=s[2],h.y=s[3],["Q",s[0],s[1],s[2],s[3]]},T:function(s,h){return h.x=s[0],h.y=s[1],["T",s[0],s[1]]},Z:function(s,h,m){return h.x=m.x,h.y=m.y,["Z"]},A:function(s,h){return h.x=s[5],h.y=s[6],["A",s[0],s[1],s[2],s[3],s[4],s[5],s[6]]}},r="mlhvqtcsaz".split(""),o=0,a=r.length;o=0;T--)(_=this.value[T][0])=="M"||_=="L"||_=="T"?(this.value[T][1]+=s,this.value[T][2]+=h):_=="H"?this.value[T][1]+=s:_=="V"?this.value[T][1]+=h:_=="C"||_=="S"||_=="Q"?(this.value[T][1]+=s,this.value[T][2]+=h,this.value[T][3]+=s,this.value[T][4]+=h,_=="C"&&(this.value[T][5]+=s,this.value[T][6]+=h)):_=="A"&&(this.value[T][6]+=s,this.value[T][7]+=h);return this},size:function(s,h){var m,_,T=this.bbox();for(m=this.value.length-1;m>=0;m--)(_=this.value[m][0])=="M"||_=="L"||_=="T"?(this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x,this.value[m][2]=(this.value[m][2]-T.y)*h/T.height+T.y):_=="H"?this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x:_=="V"?this.value[m][1]=(this.value[m][1]-T.y)*h/T.height+T.y:_=="C"||_=="S"||_=="Q"?(this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x,this.value[m][2]=(this.value[m][2]-T.y)*h/T.height+T.y,this.value[m][3]=(this.value[m][3]-T.x)*s/T.width+T.x,this.value[m][4]=(this.value[m][4]-T.y)*h/T.height+T.y,_=="C"&&(this.value[m][5]=(this.value[m][5]-T.x)*s/T.width+T.x,this.value[m][6]=(this.value[m][6]-T.y)*h/T.height+T.y)):_=="A"&&(this.value[m][1]=this.value[m][1]*s/T.width,this.value[m][2]=this.value[m][2]*h/T.height,this.value[m][6]=(this.value[m][6]-T.x)*s/T.width+T.x,this.value[m][7]=(this.value[m][7]-T.y)*h/T.height+T.y);return this},equalCommands:function(s){var h,m,_;for(s=new n.PathArray(s),_=this.value.length===s.value.length,h=0,m=this.value.length;_&&hI);return _},bbox:function(){return n.parser.path.setAttribute("d",this.toString()),n.parser.path.getBBox()}}),n.Number=n.invent({create:function(s,h){this.value=0,this.unit=h||"",typeof s=="number"?this.value=isNaN(s)?0:isFinite(s)?s:s<0?-34e37:34e37:typeof s=="string"?(h=s.match(n.regex.numberAndUnit))&&(this.value=parseFloat(h[1]),h[5]=="%"?this.value/=100:h[5]=="s"&&(this.value*=1e3),this.unit=h[5]):s instanceof n.Number&&(this.value=s.valueOf(),this.unit=s.unit)},extend:{toString:function(){return(this.unit=="%"?~~(1e8*this.value)/1e6:this.unit=="s"?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(s){return s=new n.Number(s),new n.Number(this+s,this.unit||s.unit)},minus:function(s){return s=new n.Number(s),new n.Number(this-s,this.unit||s.unit)},times:function(s){return s=new n.Number(s),new n.Number(this*s,this.unit||s.unit)},divide:function(s){return s=new n.Number(s),new n.Number(this/s,this.unit||s.unit)},to:function(s){var h=new n.Number(this);return typeof s=="string"&&(h.unit=s),h},morph:function(s){return this.destination=new n.Number(s),s.relative&&(this.destination.value+=this.value),this},at:function(s){return this.destination?new n.Number(this.destination).minus(this).times(s).plus(this):this}}}),n.Element=n.invent({create:function(s){this._stroke=n.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=s)&&(this.type=s.nodeName,this.node.instance=this,this._events=s._events||{},this._stroke=s.getAttribute("stroke")||this._stroke)},extend:{x:function(s){return this.attr("x",s)},y:function(s){return this.attr("y",s)},cx:function(s){return s==null?this.x()+this.width()/2:this.x(s-this.width()/2)},cy:function(s){return s==null?this.y()+this.height()/2:this.y(s-this.height()/2)},move:function(s,h){return this.x(s).y(h)},center:function(s,h){return this.cx(s).cy(h)},width:function(s){return this.attr("width",s)},height:function(s){return this.attr("height",s)},size:function(s,h){var m=f(this,s,h);return this.width(new n.Number(m.width)).height(new n.Number(m.height))},clone:function(s){this.writeDataToDom();var h=E(this.node.cloneNode(!0));return s?s.add(h):this.after(h),h},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(s){return this.after(s).remove(),s},addTo:function(s){return s.put(this)},putIn:function(s){return s.add(this)},id:function(s){return this.attr("id",s)},inside:function(s,h){var m=this.bbox();return s>m.x&&h>m.y&&s/,"").replace(/<\/svg>$/,"");h.innerHTML=""+s.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2>")+"";for(var m=0,_=h.firstChild.childNodes.length;m<_;m++)this.node.appendChild(h.firstChild.firstChild);return this},writeDataToDom:function(){return(this.each||this.lines)&&(this.each?this:this.lines()).each(function(){this.writeDataToDom()}),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(s){return this.dom=s,this},is:function(s){return function(h,m){return h instanceof m}(this,s)}}}),n.easing={"-":function(s){return s},"<>":function(s){return-Math.cos(s*Math.PI)/2+.5},">":function(s){return Math.sin(s*Math.PI/2)},"<":function(s){return 1-Math.cos(s*Math.PI/2)}},n.morph=function(s){return function(h,m){return new n.MorphObj(h,m).at(s)}},n.Situation=n.invent({create:function(s){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new n.Number(s.duration).valueOf(),this.delay=new n.Number(s.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=s.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),n.FX=n.invent({create:function(s){this._target=s,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(s,h,m){typeof s=="object"&&(h=s.ease,m=s.delay,s=s.duration);var _=new n.Situation({duration:s||1e3,delay:m||0,ease:n.easing[h||"-"]||h});return this.queue(_),this},delay:function(s){var h=new n.Situation({duration:s,delay:0,ease:n.easing["-"]});return this.queue(h)},target:function(s){return s&&s instanceof n.Element?(this._target=s,this):this._target},timeToAbsPos:function(s){return(s-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(s){return this.situation.duration/this._speed*s+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=t.requestAnimationFrame((function(){this.step()}).bind(this))},stopAnimFrame:function(){t.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(s){return(typeof s=="function"||s instanceof n.Situation)&&this.situations.push(s),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof n.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var s,h,m,_=this.situation;if(_.init)return this;for(s in _.animations)for(m=this.target()[s](),Array.isArray(m)||(m=[m]),Array.isArray(_.animations[s])||(_.animations[s]=[_.animations[s]]),h=m.length;h--;)_.animations[s][h]instanceof n.Number&&(m[h]=new n.Number(m[h])),_.animations[s][h]=m[h].morph(_.animations[s][h]);for(s in _.attrs)_.attrs[s]=new n.MorphObj(this.target().attr(s),_.attrs[s]);for(s in _.styles)_.styles[s]=new n.MorphObj(this.target().style(s),_.styles[s]);return _.initialTransformation=this.target().matrixify(),_.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(s,h){var m=this.active;return this.active=!1,h&&this.clearQueue(),s&&this.situation&&(!m&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var s=this.situation;this.stop(),this.situation=s,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return this.situation.loops===!0&&(this.situation.loops=this.situation.loop+1),typeof this.situation.loops=="number"?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(s,h){var m=this.situation.duration/this._speed;return this.absPos=s,h||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*m,this.situation.finish=this.situation.start+m,this.step(!0)},speed:function(s){return s===0?this.pause():s?(this._speed=s,this.at(this.absPos,!0)):this._speed},loop:function(s,h){var m=this.last();return m.loops=s==null||s,m.loop=0,h&&(m.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(s){var h=this.last();return h.reversed=s===void 0?!h.reversed:s,this},progress:function(s){return s?this.situation.ease(this.pos):this.pos},after:function(s){var h=this.last();return this.target().on("finished.fx",function m(_){_.detail.situation==h&&(s.call(this,h),this.off("finished.fx",m))}),this._callStart()},during:function(s){var h=this.last(),m=function(_){_.detail.situation==h&&s.call(this,_.detail.pos,n.morph(_.detail.pos),_.detail.eased,h)};return this.target().off("during.fx",m).on("during.fx",m),this.after(function(){this.off("during.fx",m)}),this._callStart()},afterAll:function(s){var h=function m(_){s.call(this),this.off("allfinished.fx",m)};return this.target().off("allfinished.fx",h).on("allfinished.fx",h),this._callStart()},duringAll:function(s){var h=function(m){s.call(this,m.detail.pos,n.morph(m.detail.pos),m.detail.eased,m.detail.situation)};return this.target().off("during.fx",h).on("during.fx",h),this.afterAll(function(){this.off("during.fx",h)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(s,h,m){return this.last()[m||"animations"][s]=h,this._callStart()},step:function(s){var h,m,_;s||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1?(h=Math.max(this.absPos,0),m=Math.floor(h),this.situation.loops===!0||mthis.lastPos&&M<=T&&(this.situation.once[M].call(this.target(),this.pos,T),delete this.situation.once[M]);return this.active&&this.target().fire("during",{pos:this.pos,eased:T,fx:this,situation:this.situation}),this.situation?(this.eachAt(),this.pos==1&&!this.situation.reversed||this.situation.reversed&&this.pos==0?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=T,this):this},eachAt:function(){var s,h,m,_=this,T=this.target(),M=this.situation;for(s in M.animations)m=[].concat(M.animations[s]).map(function($){return typeof $!="string"&&$.at?$.at(M.ease(_.pos),_.pos):$}),T[s].apply(T,m);for(s in M.attrs)m=[s].concat(M.attrs[s]).map(function($){return typeof $!="string"&&$.at?$.at(M.ease(_.pos),_.pos):$}),T.attr.apply(T,m);for(s in M.styles)m=[s].concat(M.styles[s]).map(function($){return typeof $!="string"&&$.at?$.at(M.ease(_.pos),_.pos):$}),T.style.apply(T,m);if(M.transforms.length){for(m=M.initialTransformation,s=0,h=M.transforms.length;s=0;--h)this[C[h]]=s[C[h]]!=null?s[C[h]]:m[C[h]]},extend:{extract:function(){var s=v(this,0,1),h=v(this,1,0),m=180/Math.PI*Math.atan2(s.y,s.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(m*Math.PI/180)+this.f*Math.sin(m*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(m*Math.PI/180)+this.e*Math.sin(-m*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-m,skewY:180/Math.PI*Math.atan2(h.y,h.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:m,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new n.Matrix(this)}},clone:function(){return new n.Matrix(this)},morph:function(s){return this.destination=new n.Matrix(s),this},at:function(s){return this.destination?new n.Matrix({a:this.a+(this.destination.a-this.a)*s,b:this.b+(this.destination.b-this.b)*s,c:this.c+(this.destination.c-this.c)*s,d:this.d+(this.destination.d-this.d)*s,e:this.e+(this.destination.e-this.e)*s,f:this.f+(this.destination.f-this.f)*s}):this},multiply:function(s){return new n.Matrix(this.native().multiply(function(h){return h instanceof n.Matrix||(h=new n.Matrix(h)),h}(s).native()))},inverse:function(){return new n.Matrix(this.native().inverse())},translate:function(s,h){return new n.Matrix(this.native().translate(s||0,h||0))},scale:function(s,h,m,_){return arguments.length==1?h=s:arguments.length==3&&(_=m,m=h,h=s),this.around(m,_,new n.Matrix(s,0,0,h,0,0))},rotate:function(s,h,m){return s=n.utils.radians(s),this.around(h,m,new n.Matrix(Math.cos(s),Math.sin(s),-Math.sin(s),Math.cos(s),0,0))},flip:function(s,h){return s=="x"?this.scale(-1,1,h,0):s=="y"?this.scale(1,-1,0,h):this.scale(-1,-1,s,h??s)},skew:function(s,h,m,_){return arguments.length==1?h=s:arguments.length==3&&(_=m,m=h,h=s),s=n.utils.radians(s),h=n.utils.radians(h),this.around(m,_,new n.Matrix(1,Math.tan(h),Math.tan(s),1,0,0))},skewX:function(s,h,m){return this.skew(s,0,h,m)},skewY:function(s,h,m){return this.skew(0,s,h,m)},around:function(s,h,m){return this.multiply(new n.Matrix(1,0,0,1,s||0,h||0)).multiply(m).multiply(new n.Matrix(1,0,0,1,-s||0,-h||0))},native:function(){for(var s=n.parser.native.createSVGMatrix(),h=C.length-1;h>=0;h--)s[C[h]]=this[C[h]];return s},toString:function(){return"matrix("+w(this.a)+","+w(this.b)+","+w(this.c)+","+w(this.d)+","+w(this.e)+","+w(this.f)+")"}},parent:n.Element,construct:{ctm:function(){return new n.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof n.Nested){var s=this.rect(1,1),h=s.node.getScreenCTM();return s.remove(),new n.Matrix(h)}return new n.Matrix(this.node.getScreenCTM())}}}),n.Point=n.invent({create:function(s,h){var m;m=Array.isArray(s)?{x:s[0],y:s[1]}:typeof s=="object"?{x:s.x,y:s.y}:s!=null?{x:s,y:h??s}:{x:0,y:0},this.x=m.x,this.y=m.y},extend:{clone:function(){return new n.Point(this)},morph:function(s,h){return this.destination=new n.Point(s,h),this},at:function(s){return this.destination?new n.Point({x:this.x+(this.destination.x-this.x)*s,y:this.y+(this.destination.y-this.y)*s}):this},native:function(){var s=n.parser.native.createSVGPoint();return s.x=this.x,s.y=this.y,s},transform:function(s){return new n.Point(this.native().matrixTransform(s.native()))}}}),n.extend(n.Element,{point:function(s,h){return new n.Point(s,h).transform(this.screenCTM().inverse())}}),n.extend(n.Element,{attr:function(s,h,m){if(s==null){for(s={},m=(h=this.node.attributes).length-1;m>=0;m--)s[h[m].nodeName]=n.regex.isNumber.test(h[m].nodeValue)?parseFloat(h[m].nodeValue):h[m].nodeValue;return s}if(typeof s=="object")for(h in s)this.attr(h,s[h]);else if(h===null)this.node.removeAttribute(s);else{if(h==null)return(h=this.node.getAttribute(s))==null?n.defaults.attrs[s]:n.regex.isNumber.test(h)?parseFloat(h):h;s=="stroke-width"?this.attr("stroke",parseFloat(h)>0?this._stroke:null):s=="stroke"&&(this._stroke=h),s!="fill"&&s!="stroke"||(n.regex.isImage.test(h)&&(h=this.doc().defs().image(h,0,0)),h instanceof n.Image&&(h=this.doc().defs().pattern(0,0,function(){this.add(h)}))),typeof h=="number"?h=new n.Number(h):n.Color.isColor(h)?h=new n.Color(h):Array.isArray(h)&&(h=new n.Array(h)),s=="leading"?this.leading&&this.leading(h):typeof m=="string"?this.node.setAttributeNS(m,s,h.toString()):this.node.setAttribute(s,h.toString()),!this.rebuild||s!="font-size"&&s!="x"||this.rebuild(s,h)}return this}}),n.extend(n.Element,{transform:function(s,h){var m,_,T=this;if(typeof s!="object")return m=new n.Matrix(T).extract(),typeof s=="string"?m[s]:m;if(m=new n.Matrix(T),h=!!h||!!s.relative,s.a!=null)m=h?m.multiply(new n.Matrix(s)):new n.Matrix(s);else if(s.rotation!=null)b(s,T),m=h?m.rotate(s.rotation,s.cx,s.cy):m.rotate(s.rotation-m.extract().rotation,s.cx,s.cy);else if(s.scale!=null||s.scaleX!=null||s.scaleY!=null){if(b(s,T),s.scaleX=s.scale!=null?s.scale:s.scaleX!=null?s.scaleX:1,s.scaleY=s.scale!=null?s.scale:s.scaleY!=null?s.scaleY:1,!h){var M=m.extract();s.scaleX=1*s.scaleX/M.scaleX,s.scaleY=1*s.scaleY/M.scaleY}m=m.scale(s.scaleX,s.scaleY,s.cx,s.cy)}else s.skew!=null||s.skewX!=null||s.skewY!=null?(b(s,T),s.skewX=s.skew!=null?s.skew:s.skewX!=null?s.skewX:0,s.skewY=s.skew!=null?s.skew:s.skewY!=null?s.skewY:0,h||(M=m.extract(),m=m.multiply(new n.Matrix().skew(M.skewX,M.skewY,s.cx,s.cy).inverse())),m=m.skew(s.skewX,s.skewY,s.cx,s.cy)):s.flip?(s.flip=="x"||s.flip=="y"?s.offset=s.offset==null?T.bbox()["c"+s.flip]:s.offset:s.offset==null?(_=T.bbox(),s.flip=_.cx,s.offset=_.cy):s.flip=s.offset,m=new n.Matrix().flip(s.flip,s.offset)):s.x==null&&s.y==null||(h?m=m.translate(s.x,s.y):(s.x!=null&&(m.e=s.x),s.y!=null&&(m.f=s.y)));return this.attr("transform",m)}}),n.extend(n.FX,{transform:function(s,h){var m,_,T=this.target();return typeof s!="object"?(m=new n.Matrix(T).extract(),typeof s=="string"?m[s]:m):(h=!!h||!!s.relative,s.a!=null?m=new n.Matrix(s):s.rotation!=null?(b(s,T),m=new n.Rotate(s.rotation,s.cx,s.cy)):s.scale!=null||s.scaleX!=null||s.scaleY!=null?(b(s,T),s.scaleX=s.scale!=null?s.scale:s.scaleX!=null?s.scaleX:1,s.scaleY=s.scale!=null?s.scale:s.scaleY!=null?s.scaleY:1,m=new n.Scale(s.scaleX,s.scaleY,s.cx,s.cy)):s.skewX!=null||s.skewY!=null?(b(s,T),s.skewX=s.skewX!=null?s.skewX:0,s.skewY=s.skewY!=null?s.skewY:0,m=new n.Skew(s.skewX,s.skewY,s.cx,s.cy)):s.flip?(s.flip=="x"||s.flip=="y"?s.offset=s.offset==null?T.bbox()["c"+s.flip]:s.offset:s.offset==null?(_=T.bbox(),s.flip=_.cx,s.offset=_.cy):s.flip=s.offset,m=new n.Matrix().flip(s.flip,s.offset)):s.x==null&&s.y==null||(m=new n.Translate(s.x,s.y)),m?(m.relative=h,this.last().transforms.push(m),this._callStart()):this)}}),n.extend(n.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){var s=(this.attr("transform")||"").split(n.regex.transforms).slice(0,-1).map(function(h){var m=h.trim().split("(");return[m[0],m[1].split(n.regex.delimiter).map(function(_){return parseFloat(_)})]}).reduce(function(h,m){return m[0]=="matrix"?h.multiply(g(m[1])):h[m[0]].apply(h,m[1])},new n.Matrix);return s},toParent:function(s){if(this==s)return this;var h=this.screenCTM(),m=s.screenCTM().inverse();return this.addTo(s).untransform().transform(m.multiply(h)),this},toDoc:function(){return this.toParent(this.doc())}}),n.Transformation=n.invent({create:function(s,h){if(arguments.length>1&&typeof h!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(s))for(var m=0,_=this.arguments.length;m<_;++m)this[this.arguments[m]]=s[m];else if(typeof s=="object")for(m=0,_=this.arguments.length;m<_;++m)this[this.arguments[m]]=s[this.arguments[m]];this.inversed=!1,h===!0&&(this.inversed=!0)},extend:{arguments:[],method:"",at:function(s){for(var h=[],m=0,_=this.arguments.length;m<_;++m)h.push(this[this.arguments[m]]);var T=this._undo||new n.Matrix;return T=new n.Matrix().morph(n.Matrix.prototype[this.method].apply(T,h)).at(s),this.inversed?T.inverse():T},undo:function(s){for(var h=0,m=this.arguments.length;h=0},index:function(s){return[].slice.call(this.node.childNodes).indexOf(s.node)},get:function(s){return n.adopt(this.node.childNodes[s])},first:function(){return this.get(0)},last:function(){return this.get(this.node.childNodes.length-1)},each:function(s,h){var m,_,T=this.children();for(m=0,_=T.length;m<_;m++)T[m]instanceof n.Element&&s.apply(T[m],[m,T]),h&&T[m]instanceof n.Container&&T[m].each(s,h);return this},removeElement:function(s){return this.node.removeChild(s.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),n.extend(n.Parent,{ungroup:function(s,h){return h===0||this instanceof n.Defs||this.node==n.parser.draw||(s=s||(this instanceof n.Doc?this:this.parent(n.Parent)),h=h||1/0,this.each(function(){return this instanceof n.Defs?this:this instanceof n.Parent?this.ungroup(s,h-1):this.toParent(s)}),this.node.firstChild||this.remove()),this},flatten:function(s,h){return this.ungroup(s,h)}}),n.Container=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Parent}),n.ViewBox=n.invent({create:function(s){var h,m,_,T,M,I,$,P=1,x=1,N=/[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/gi;if(s instanceof n.Element){for(I=s,$=s,M=(s.attr("viewBox")||"").match(N),s.bbox,_=new n.Number(s.width()),T=new n.Number(s.height());_.unit=="%";)P*=_.value,_=new n.Number(I instanceof n.Doc?I.parent().offsetWidth:I.parent().width()),I=I.parent();for(;T.unit=="%";)x*=T.value,T=new n.Number($ instanceof n.Doc?$.parent().offsetHeight:$.parent().height()),$=$.parent();this.x=0,this.y=0,this.width=_*P,this.height=T*x,this.zoom=1,M&&(h=parseFloat(M[0]),m=parseFloat(M[1]),_=parseFloat(M[2]),T=parseFloat(M[3]),this.zoom=this.width/this.height>_/T?this.height/T:this.width/_,this.x=h,this.y=m,this.width=_,this.height=T)}else s=typeof s=="string"?s.match(N).map(function(j){return parseFloat(j)}):Array.isArray(s)?s:typeof s=="object"?[s.x,s.y,s.width,s.height]:arguments.length==4?[].slice.call(arguments):[0,0,0,0],this.x=s[0],this.y=s[1],this.width=s[2],this.height=s[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(s,h,m,_){return this.destination=new n.ViewBox(s,h,m,_),this},at:function(s){return this.destination?new n.ViewBox([this.x+(this.destination.x-this.x)*s,this.y+(this.destination.y-this.y)*s,this.width+(this.destination.width-this.width)*s,this.height+(this.destination.height-this.height)*s]):this}},parent:n.Container,construct:{viewbox:function(s,h,m,_){return arguments.length==0?new n.ViewBox(this):this.attr("viewBox",new n.ViewBox(s,h,m,_))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(s){n.Element.prototype[s]=function(h){return h==null?n.off(this,s):n.on(this,s,h),this}}),n.listenerId=0,n.on=function(s,h,m,_,T){var M=m.bind(_||s),I=s instanceof n.Element?s.node:s;I.instance=I.instance||{_events:{}};var $=I.instance._events;m._svgjsListenerId||(m._svgjsListenerId=++n.listenerId),h.split(n.regex.delimiter).forEach(function(P){var x=P.split(".")[0],N=P.split(".")[1]||"*";$[x]=$[x]||{},$[x][N]=$[x][N]||{},$[x][N][m._svgjsListenerId]=M,I.addEventListener(x,M,T||!1)})},n.off=function(s,h,m,_){var T=s instanceof n.Element?s.node:s;if(T.instance&&(typeof m!="function"||(m=m._svgjsListenerId))){var M=T.instance._events;(h||"").split(n.regex.delimiter).forEach(function(I){var $,P,x=I&&I.split(".")[0],N=I&&I.split(".")[1];if(m)M[x]&&M[x][N||"*"]&&(T.removeEventListener(x,M[x][N||"*"][m],_||!1),delete M[x][N||"*"][m]);else if(x&&N){if(M[x]&&M[x][N]){for(P in M[x][N])n.off(T,[x,N].join("."),P);delete M[x][N]}}else if(N)for(I in M)for($ in M[I])N===$&&n.off(T,[I,N].join("."));else if(x){if(M[x]){for($ in M[x])n.off(T,[x,$].join("."));delete M[x]}}else{for(I in M)n.off(T,I);T.instance._events={}}})}},n.extend(n.Element,{on:function(s,h,m,_){return n.on(this,s,h,m,_),this},off:function(s,h){return n.off(this.node,s,h),this},fire:function(s,h){return s instanceof t.Event?this.node.dispatchEvent(s):this.node.dispatchEvent(s=new n.CustomEvent(s,{detail:h,cancelable:!0})),this._event=s,this},event:function(){return this._event}}),n.Defs=n.invent({create:"defs",inherit:n.Container}),n.G=n.invent({create:"g",inherit:n.Container,extend:{x:function(s){return s==null?this.transform("x"):this.transform({x:s-this.x()},!0)},y:function(s){return s==null?this.transform("y"):this.transform({y:s-this.y()},!0)},cx:function(s){return s==null?this.gbox().cx:this.x(s-this.gbox().width/2)},cy:function(s){return s==null?this.gbox().cy:this.y(s-this.gbox().height/2)},gbox:function(){var s=this.bbox(),h=this.transform();return s.x+=h.x,s.x2+=h.x,s.cx+=h.x,s.y+=h.y,s.y2+=h.y,s.cy+=h.y,s}},construct:{group:function(){return this.put(new n.G)}}}),n.Doc=n.invent({create:function(s){s&&((s=typeof s=="string"?e.getElementById(s):s).nodeName=="svg"?this.constructor.call(this,s):(this.constructor.call(this,n.create("svg")),s.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:n.Container,extend:{namespace:function(){return this.attr({xmlns:n.ns,version:"1.1"}).attr("xmlns:xlink",n.xlink,n.xmlns).attr("xmlns:svgjs",n.svgjs,n.xmlns)},defs:function(){var s;return this._defs||((s=this.node.getElementsByTagName("defs")[0])?this._defs=n.adopt(s):this._defs=new n.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&this.node.parentNode.nodeName!="#document"&&this.node.parentNode.nodeName!="#document-fragment"?this.node.parentNode:null},spof:function(){var s=this.node.getScreenCTM();return s&&this.style("left",-s.e%1+"px").style("top",-s.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,n.parser.draw.parentNode||this.node.appendChild(n.parser.draw),this},clone:function(s){this.writeDataToDom();var h=this.node,m=E(h.cloneNode(!0));return s?(s.node||s).appendChild(m.node):h.parentNode.insertBefore(m.node,h.nextSibling),m}}}),n.extend(n.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var s=this.position()+1,h=this.parent();return h.removeElement(this).add(this,s),h instanceof n.Doc&&h.node.appendChild(h.defs().node),this},backward:function(){var s=this.position();return s>0&&this.parent().removeElement(this).add(this,s-1),this},front:function(){var s=this.parent();return s.node.appendChild(this.node),s instanceof n.Doc&&s.node.appendChild(s.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(s){s.remove();var h=this.position();return this.parent().add(s,h),this},after:function(s){s.remove();var h=this.position();return this.parent().add(s,h+1),this}}),n.Mask=n.invent({create:function(){this.constructor.call(this,n.create("mask")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var s=this.targets.length-1;s>=0;s--)this.targets[s]&&this.targets[s].unmask();return this.targets=[],n.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new n.Mask)}}}),n.extend(n.Element,{maskWith:function(s){return this.masker=s instanceof n.Mask?s:this.parent().mask().add(s),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),n.ClipPath=n.invent({create:function(){this.constructor.call(this,n.create("clipPath")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var s=this.targets.length-1;s>=0;s--)this.targets[s]&&this.targets[s].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new n.ClipPath)}}}),n.extend(n.Element,{clipWith:function(s){return this.clipper=s instanceof n.ClipPath?s:this.parent().clip().add(s),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),n.Gradient=n.invent({create:function(s){this.constructor.call(this,n.create(s+"Gradient")),this.type=s},inherit:n.Container,extend:{at:function(s,h,m){return this.put(new n.Stop).update(s,h,m)},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(s,h,m){return s=="transform"&&(s="gradientTransform"),n.Container.prototype.attr.call(this,s,h,m)}},construct:{gradient:function(s,h){return this.defs().gradient(s,h)}}}),n.extend(n.Gradient,n.FX,{from:function(s,h){return(this._target||this).type=="radial"?this.attr({fx:new n.Number(s),fy:new n.Number(h)}):this.attr({x1:new n.Number(s),y1:new n.Number(h)})},to:function(s,h){return(this._target||this).type=="radial"?this.attr({cx:new n.Number(s),cy:new n.Number(h)}):this.attr({x2:new n.Number(s),y2:new n.Number(h)})}}),n.extend(n.Defs,{gradient:function(s,h){return this.put(new n.Gradient(s)).update(h)}}),n.Stop=n.invent({create:"stop",inherit:n.Element,extend:{update:function(s){return(typeof s=="number"||s instanceof n.Number)&&(s={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),s.opacity!=null&&this.attr("stop-opacity",s.opacity),s.color!=null&&this.attr("stop-color",s.color),s.offset!=null&&this.attr("offset",new n.Number(s.offset)),this}}}),n.Pattern=n.invent({create:"pattern",inherit:n.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},toString:function(){return this.fill()},attr:function(s,h,m){return s=="transform"&&(s="patternTransform"),n.Container.prototype.attr.call(this,s,h,m)}},construct:{pattern:function(s,h,m){return this.defs().pattern(s,h,m)}}}),n.extend(n.Defs,{pattern:function(s,h,m){return this.put(new n.Pattern).update(m).attr({x:0,y:0,width:s,height:h,patternUnits:"userSpaceOnUse"})}}),n.Shape=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Element}),n.Bare=n.invent({create:function(s,h){if(this.constructor.call(this,n.create(s)),h)for(var m in h.prototype)typeof h.prototype[m]=="function"&&(this[m]=h.prototype[m])},inherit:n.Element,extend:{words:function(s){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(e.createTextNode(s)),this}}}),n.extend(n.Parent,{element:function(s,h){return this.put(new n.Bare(s,h))}}),n.Symbol=n.invent({create:"symbol",inherit:n.Container,construct:{symbol:function(){return this.put(new n.Symbol)}}}),n.Use=n.invent({create:"use",inherit:n.Shape,extend:{element:function(s,h){return this.attr("href",(h||"")+"#"+s,n.xlink)}},construct:{use:function(s,h){return this.put(new n.Use).element(s,h)}}}),n.Rect=n.invent({create:"rect",inherit:n.Shape,construct:{rect:function(s,h){return this.put(new n.Rect).size(s,h)}}}),n.Circle=n.invent({create:"circle",inherit:n.Shape,construct:{circle:function(s){return this.put(new n.Circle).rx(new n.Number(s).divide(2)).move(0,0)}}}),n.extend(n.Circle,n.FX,{rx:function(s){return this.attr("r",s)},ry:function(s){return this.rx(s)}}),n.Ellipse=n.invent({create:"ellipse",inherit:n.Shape,construct:{ellipse:function(s,h){return this.put(new n.Ellipse).size(s,h).move(0,0)}}}),n.extend(n.Ellipse,n.Rect,n.FX,{rx:function(s){return this.attr("rx",s)},ry:function(s){return this.attr("ry",s)}}),n.extend(n.Circle,n.Ellipse,{x:function(s){return s==null?this.cx()-this.rx():this.cx(s+this.rx())},y:function(s){return s==null?this.cy()-this.ry():this.cy(s+this.ry())},cx:function(s){return s==null?this.attr("cx"):this.attr("cx",s)},cy:function(s){return s==null?this.attr("cy"):this.attr("cy",s)},width:function(s){return s==null?2*this.rx():this.rx(new n.Number(s).divide(2))},height:function(s){return s==null?2*this.ry():this.ry(new n.Number(s).divide(2))},size:function(s,h){var m=f(this,s,h);return this.rx(new n.Number(m.width).divide(2)).ry(new n.Number(m.height).divide(2))}}),n.Line=n.invent({create:"line",inherit:n.Shape,extend:{array:function(){return new n.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(s,h,m,_){return s==null?this.array():(s=h!==void 0?{x1:s,y1:h,x2:m,y2:_}:new n.PointArray(s).toLine(),this.attr(s))},move:function(s,h){return this.attr(this.array().move(s,h).toLine())},size:function(s,h){var m=f(this,s,h);return this.attr(this.array().size(m.width,m.height).toLine())}},construct:{line:function(s,h,m,_){return n.Line.prototype.plot.apply(this.put(new n.Line),s!=null?[s,h,m,_]:[0,0,0,0])}}}),n.Polyline=n.invent({create:"polyline",inherit:n.Shape,construct:{polyline:function(s){return this.put(new n.Polyline).plot(s||new n.PointArray)}}}),n.Polygon=n.invent({create:"polygon",inherit:n.Shape,construct:{polygon:function(s){return this.put(new n.Polygon).plot(s||new n.PointArray)}}}),n.extend(n.Polyline,n.Polygon,{array:function(){return this._array||(this._array=new n.PointArray(this.attr("points")))},plot:function(s){return s==null?this.array():this.clear().attr("points",typeof s=="string"?s:this._array=new n.PointArray(s))},clear:function(){return delete this._array,this},move:function(s,h){return this.attr("points",this.array().move(s,h))},size:function(s,h){var m=f(this,s,h);return this.attr("points",this.array().size(m.width,m.height))}}),n.extend(n.Line,n.Polyline,n.Polygon,{morphArray:n.PointArray,x:function(s){return s==null?this.bbox().x:this.move(s,this.bbox().y)},y:function(s){return s==null?this.bbox().y:this.move(this.bbox().x,s)},width:function(s){var h=this.bbox();return s==null?h.width:this.size(s,h.height)},height:function(s){var h=this.bbox();return s==null?h.height:this.size(h.width,s)}}),n.Path=n.invent({create:"path",inherit:n.Shape,extend:{morphArray:n.PathArray,array:function(){return this._array||(this._array=new n.PathArray(this.attr("d")))},plot:function(s){return s==null?this.array():this.clear().attr("d",typeof s=="string"?s:this._array=new n.PathArray(s))},clear:function(){return delete this._array,this},move:function(s,h){return this.attr("d",this.array().move(s,h))},x:function(s){return s==null?this.bbox().x:this.move(s,this.bbox().y)},y:function(s){return s==null?this.bbox().y:this.move(this.bbox().x,s)},size:function(s,h){var m=f(this,s,h);return this.attr("d",this.array().size(m.width,m.height))},width:function(s){return s==null?this.bbox().width:this.size(s,this.bbox().height)},height:function(s){return s==null?this.bbox().height:this.size(this.bbox().width,s)}},construct:{path:function(s){return this.put(new n.Path).plot(s||new n.PathArray)}}}),n.Image=n.invent({create:"image",inherit:n.Shape,extend:{load:function(s){if(!s)return this;var h=this,m=new t.Image;return n.on(m,"load",function(){n.off(m);var _=h.parent(n.Pattern);_!==null&&(h.width()==0&&h.height()==0&&h.size(m.width,m.height),_&&_.width()==0&&_.height()==0&&_.size(h.width(),h.height()),typeof h._loaded=="function"&&h._loaded.call(h,{width:m.width,height:m.height,ratio:m.width/m.height,url:s}))}),n.on(m,"error",function(_){n.off(m),typeof h._error=="function"&&h._error.call(h,_)}),this.attr("href",m.src=this.src=s,n.xlink)},loaded:function(s){return this._loaded=s,this},error:function(s){return this._error=s,this}},construct:{image:function(s,h,m){return this.put(new n.Image).load(s).size(h||0,m||h||0)}}}),n.Text=n.invent({create:function(){this.constructor.call(this,n.create("text")),this.dom.leading=new n.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",n.defaults.attrs["font-family"])},inherit:n.Shape,extend:{x:function(s){return s==null?this.attr("x"):this.attr("x",s)},y:function(s){var h=this.attr("y"),m=typeof h=="number"?h-this.bbox().y:0;return s==null?typeof h=="number"?h-m:h:this.attr("y",typeof s.valueOf()=="number"?s+m:s)},cx:function(s){return s==null?this.bbox().cx:this.x(s-this.bbox().width/2)},cy:function(s){return s==null?this.bbox().cy:this.y(s-this.bbox().height/2)},text:function(s){if(s===void 0){s="";for(var h=this.node.childNodes,m=0,_=h.length;m<_;++m)m!=0&&h[m].nodeType!=3&&n.adopt(h[m]).dom.newLined==1&&(s+=` `),s+=h[m].textContent;return s}if(this.clear().build(!0),typeof s=="function")s.call(this,this);else{m=0;for(var T=(s=s.split(` `)).length;m=0;h--)s.childNodes[h]instanceof t.SVGElement&&E(s.childNodes[h]);return n.adopt(s).id(n.eid(s.nodeName))}function S(s){return s.x==null&&(s.x=0,s.y=0,s.width=0,s.height=0),s.w=s.width,s.h=s.height,s.x2=s.x+s.width,s.y2=s.y+s.height,s.cx=s.x+s.width/2,s.cy=s.y+s.height/2,s}function w(s){return Math.abs(s)>1e-37?s:0}["fill","stroke"].forEach(function(s){var h,m={};m[s]=function(_){if(_===void 0)return this;if(typeof _=="string"||n.Color.isRgb(_)||_&&typeof _.fill=="function")this.attr(s,_);else for(h=c[s].length-1;h>=0;h--)_[c[s][h]]!=null&&this.attr(c.prefix(s,c[s][h]),_[c[s][h]]);return this},n.extend(n.Element,n.FX,m)}),n.extend(n.Element,n.FX,{rotate:function(s,h,m){return this.transform({rotation:s,cx:h,cy:m})},skew:function(s,h,m,_){return arguments.length==1||arguments.length==3?this.transform({skew:s,cx:h,cy:m}):this.transform({skewX:s,skewY:h,cx:m,cy:_})},scale:function(s,h,m,_){return arguments.length==1||arguments.length==3?this.transform({scale:s,cx:h,cy:m}):this.transform({scaleX:s,scaleY:h,cx:m,cy:_})},translate:function(s,h){return this.transform({x:s,y:h})},flip:function(s,h){return h=typeof s=="number"?s:h,this.transform({flip:s||"both",offset:h})},matrix:function(s){return this.attr("transform",new n.Matrix(arguments.length==6?[].slice.call(arguments):s))},opacity:function(s){return this.attr("opacity",s)},dx:function(s){return this.x(new n.Number(s).plus(this instanceof n.FX?0:this.x()),!0)},dy:function(s){return this.y(new n.Number(s).plus(this instanceof n.FX?0:this.y()),!0)},dmove:function(s,h){return this.dx(s).dy(h)}}),n.extend(n.Rect,n.Ellipse,n.Circle,n.Gradient,n.FX,{radius:function(s,h){var m=(this._target||this).type;return m=="radial"||m=="circle"?this.attr("r",new n.Number(s)):this.rx(s).ry(h??s)}}),n.extend(n.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(s){return this.node.getPointAtLength(s)}}),n.extend(n.Parent,n.Text,n.Tspan,n.FX,{font:function(s,h){if(typeof s=="object")for(h in s)this.font(h,s[h]);return s=="leading"?this.leading(h):s=="anchor"?this.attr("text-anchor",h):s=="size"||s=="family"||s=="weight"||s=="stretch"||s=="variant"||s=="style"?this.attr("font-"+s,h):this.attr(s,h)}}),n.Set=n.invent({create:function(s){s instanceof n.Set?this.members=s.members.slice():Array.isArray(s)?this.members=s:this.clear()},extend:{add:function(){var s,h,m=[].slice.call(arguments);for(s=0,h=m.length;s-1&&this.members.splice(h,1),this},each:function(s){for(var h=0,m=this.members.length;h=0},index:function(s){return this.members.indexOf(s)},get:function(s){return this.members[s]},first:function(){return this.get(0)},last:function(){return this.get(this.members.length-1)},valueOf:function(){return this.members},bbox:function(){if(this.members.length==0)return new n.RBox;var s=this.members[0].rbox(this.members[0].doc());return this.each(function(){s=s.merge(this.rbox(this.doc()))}),s}},construct:{set:function(s){return new n.Set(s)}}}),n.FX.Set=n.invent({create:function(s){this.set=s}}),n.Set.inherit=function(){var s=[];for(var h in n.Shape.prototype)typeof n.Shape.prototype[h]=="function"&&typeof n.Set.prototype[h]!="function"&&s.push(h);for(var h in s.forEach(function(_){n.Set.prototype[_]=function(){for(var T=0,M=this.members.length;T=0;s--)delete this.memory()[arguments[s]];return this},memory:function(){return this._memory||(this._memory={})}}),n.get=function(s){var h=e.getElementById(function(m){var _=(m||"").toString().match(n.regex.reference);if(_)return _[1]}(s)||s);return n.adopt(h)},n.select=function(s,h){return new n.Set(n.utils.map((h||e).querySelectorAll(s),function(m){return n.adopt(m)}))},n.extend(n.Parent,{select:function(s){return n.select(s,this.node)}});var C="abcdef".split("");if(typeof t.CustomEvent!="function"){var B=function(s,h){h=h||{bubbles:!1,cancelable:!1,detail:void 0};var m=e.createEvent("CustomEvent");return m.initCustomEvent(s,h.bubbles,h.cancelable,h.detail),m};B.prototype=t.Event.prototype,n.CustomEvent=B}else n.CustomEvent=t.CustomEvent;return function(s){for(var h=0,m=["moz","webkit"],_=0;_0){var a=r.x-10,c=r.y-10,l=function(p){return p===1}(o)?"<":"-";(function(p){return p.length==2})(e)&&(l="<>");var u=20*pw(e[o-1],r);i=i.animate(u,l,0).move(a,c)}}),i.after(function(){t.remove(),n()})},Ea.prototype.play=function(){this.gfx.play()},Ea.prototype.pause=function(){this.gfx.pause()},Ea.prototype.stop=function(){this.fx.stop(),this.gfx.remove()};var ah,mw=function(t,e){if(typeof t!="string")throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body")return(r=e.createElement("html")).innerHTML=t,r.removeChild(r.lastChild);var r,o=Object.prototype.hasOwnProperty.call(ee,i)?ee[i]:ee._default,a=o[0],c=o[1],l=o[2];for((r=e.createElement("div")).innerHTML=c+t+l;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=e.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},Zg=!1;typeof document<"u"&&((ah=document.createElement("div")).innerHTML='
a',Zg=!ah.getElementsByTagName("link").length,ah=void 0);var ee={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:Zg?[1,"X
","
"]:[0,"",""]};ee.td=ee.th=[3,"","
"],ee.option=ee.optgroup=[1,'"],ee.thead=ee.tbody=ee.colgroup=ee.caption=ee.tfoot=[1,"","
"],ee.polyline=ee.ellipse=ee.polygon=ee.circle=ee.text=ee.line=ee.path=ee.rect=ee.g=[1,'',""];var Re=mw,sh={},Qg=window.addEventListener?"addEventListener":"attachEvent",fw=window.removeEventListener?"removeEventListener":"detachEvent",tb=Qg!=="addEventListener"?"on":"";sh.bind=function(t,e,n,i){return t[Qg](tb+e,n,i||!1),n},sh.unbind=function(t,e,n,i){return t[fw](tb+e,n,i||!1),n};var bn=sh,vw=Re,yw=bn,eb=Ft.is,gw=J.GENERATE_TOKEN_EVENT,bw=J.UPDATE_ELEMENT_EVENT;function ch(t,e,n){this._eventBus=t,this._processInstances=e,this._processInstanceSettings=n}ch.prototype.createContextPads=function(t){if(t.attachers.length&&this._processInstances.getProcessInstances(t).length){var e=t.incoming.filter(function(r){return eb(r,"bpmn:SequenceFlow")}),n=this,i=[];return t.attachers.forEach(function(r){var o=r.outgoing.filter(function(c){return eb(c,"bpmn:SequenceFlow")});if(e.length&&o.length){var a=vw('
');i.push({element:r,html:a}),yw.bind(a,"click",function(){n._processInstances.getProcessInstances(t).forEach(function(c){var l=c.parentProcessInstanceId;r.businessObject.cancelActivity&&(t.children.forEach(function(u){u.tokenCount&&u.tokenCount[c.processInstanceId]&&u.tokenCount[c.processInstanceId]--}),n._processInstances.finish(c.processInstanceId),n._eventBus.fire(bw,{element:t})),n._eventBus.fire(gw,{element:r,processInstanceId:l})})})}}),i}},ch.$inject=["eventBus","processInstances","processInstanceSettings"];var xw=ch,Ew=Ft.is,_w=Re,ww=bn;function lh(t){this._exclusiveGatewaySettings=t}lh.prototype.createContextPads=function(t){var e=this;if(!(t.outgoing.filter(function(i){return Ew(i,"bpmn:SequenceFlow")}).length<2)){var n=_w('
');return ww.bind(n,"click",function(){e._exclusiveGatewaySettings.setSequenceFlow(t)}),[{element:t,html:n}]}},lh.$inject=["exclusiveGatewaySettings"];var Sw=lh,nb=Re,ib=bn,uh=Ft.is,rb=J.GENERATE_TOKEN_EVENT;function ph(t){this._eventBus=t}ph.prototype.createContextPads=function(t){var e=t.parent.shownProcessInstance,n=t.incoming.filter(function(c){return uh(c,"bpmn:SequenceFlow")}),i=[];n.forEach(function(c){var l=c.source;uh(l,"bpmn:EventBasedGateway")&&l.tokenCount&&l.tokenCount[e]&&i.push(l)});var r=t.outgoing.filter(function(c){return uh(c,"bpmn:SequenceFlow")});if(n.length&&r.length){var o,a=this;if(t.tokenCount&&t.tokenCount[e])o=nb('
'),ib.bind(o,"click",function(){t.tokenCount[e]--,a._eventBus.fire(rb,{element:t,processInstanceId:e})});else{if(!i.length)return;o=nb('
'),ib.bind(o,"click",function(){i.forEach(function(c){c.tokenCount[e]--}),a._eventBus.fire(rb,{element:t,processInstanceId:e})})}return[{element:t,html:o}]}},ph.$inject=["eventBus"];var Cw=ph,Tw=Re,Aw=bn;function hh(t,e){this._processInstances=t,this._processInstanceSettings=e}hh.prototype.createContextPads=function(t){var e=this;if(!(this._processInstances.getProcessInstances(t).filter(function(i){return!i.isFinished}).length<2)){var n=Tw('
');return Aw.bind(n,"click",function(){e._processInstanceSettings.showNext(t)}),[{element:t,html:n}]}},hh.$inject=["processInstances","processInstanceSettings"];var kw=hh,Pw=Re,Mw=bn,Rw=Ft.is,Nw=J.GENERATE_TOKEN_EVENT;function dh(t,e,n){this._eventBus=t,this._elementRegistry=e,this._animation=n}dh.prototype.createContextPads=function(t){var e=!1;if(this._elementRegistry.forEach(function(r){r.tokenCount&&Object.values(r.tokenCount).forEach(function(o){o&&(e=!0)})}),!(Rw(t.parent,"bpmn:SubProcess")||e||this._animation.animations.length)){var n=this,i=Pw('
');return Mw.bind(i,"click",function(){n._eventBus.fire(Nw,{element:t})}),[{element:t,html:i}]}},dh.$inject=["eventBus","elementRegistry","animation"];var Iw=dh,ob=Ft.isAncestor,Dw=J.TOGGLE_MODE_EVENT,Bw=J.RESET_SIMULATION_EVENT,Ow=J.TERMINATE_EVENT,Lw=J.UPDATE_ELEMENTS_EVENT,jw=J.UPDATE_ELEMENT_EVENT,Vw=J.PROCESS_INSTANCE_SHOWN_EVENT,Fw=xw,zw=Sw,$w=Cw,Gw=kw,Uw=Iw,_a=500;function sr(t,e,n,i,r,o){var a=this;this._elementRegistry=e,this._overlays=n,this._injector=i,this._canvas=r,this._processInstances=o,this.overlayIds={},this.handlers={},this.registerHandler("bpmn:ExclusiveGateway",zw),this.registerHandler("bpmn:IntermediateCatchEvent",$w),this.registerHandler("bpmn:SubProcess",Gw),this.registerHandler("bpmn:SubProcess",Fw),this.registerHandler("bpmn:StartEvent",Uw),t.on(Dw,_a,function(c){c.simulationModeActive?a.openContextPads():a.closeContextPads()}),t.on(Bw,_a,function(){a.closeContextPads(),a.openContextPads()}),t.on(Ow,_a,function(c){var l=c.element.parent;a.closeContextPads(l)}),t.on(Lw,_a,function(c){c.elements.forEach(function(l){a.closeElementContextPads(l),a.openElementContextPads(l)})}),t.on(jw,_a,function(c){var l=c.element;a.closeElementContextPads(l),a.openElementContextPads(l)}),t.on(Vw,function(c){var l=c.processInstanceId,u=o.getProcessInstance(l).parent;a.closeContextPads(u),a.openContextPads(u)})}sr.prototype.registerHandler=function(t,e){var n=this._injector.instantiate(e);this.handlers[t]||(this.handlers[t]=[]),this.handlers[t].push(n)},sr.prototype.openContextPads=function(t){var e=this;t||(t=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){e.handlers[n.type]&&ob(t,n)&&e.openElementContextPads(n)})},sr.prototype.openElementContextPads=function(t){if(this.handlers[t.type]){var e=[];this.handlers[t.type].forEach(function(i){var r=i.createContextPads(t);r&&r.forEach(function(o){o&&e.push(o)})});var n=this;e.forEach(function(i){var r={top:-15,left:-15},o=n._overlays.add(i.element,"context-menu",{position:r,html:i.html,show:{minZoom:.5}});n.overlayIds[i.element.id]=o})}},sr.prototype.closeContextPads=function(t){var e=this;t||(t=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){ob(t,n)&&e.closeElementContextPads(n)})},sr.prototype.closeElementContextPads=function(t){var e=this;t.attachers&&t.attachers.length>0&&t.attachers.forEach(function(i){e.closeElementContextPads(i)}),t.children&&t.children.length>0&&t.children.forEach(function(i){e.closeElementContextPads(i)});var n=this.overlayIds[t.id];n&&(this._overlays.remove(n),delete this.overlayIds[t.id])},sr.$inject=["eventBus","elementRegistry","overlays","injector","canvas","processInstances"];var Hw=sr,qw=J.TOGGLE_MODE_EVENT;function ab(t,e,n,i,r,o,a,c){var l=this;function u(y,f,v){var g=y[f];y[f]=function(){return v.call(this,g,arguments)}}function p(y,f){u(y,f,function(v,g){if(!l.modelingDisabled)return v.apply(this,g)})}function d(y,f){u(y,f,function(v,g){if(l.modelingDisabled)throw new Error("model is read-only");return v.apply(this,g)})}this._eventBus=t,this.modelingDisabled=!1,t.on(qw,10001,function(y){var f=y.simulationModeActive;l.modelingDisabled=f,l.modelingDisabled&&(i.cancel(),e.close(),n.cancel()),a._update()}),p(e,"open"),p(n,"init"),p(i,"activate"),p(n,"init"),p(i,"activate"),d(o,"moveShape"),d(o,"updateAttachment"),d(o,"moveElements"),d(o,"moveConnection"),d(o,"layoutConnection"),d(o,"createConnection"),d(o,"createShape"),d(o,"createLabel"),d(o,"appendShape"),d(o,"removeElements"),d(o,"distributeElements"),d(o,"removeShape"),d(o,"removeConnection"),d(o,"replaceShape"),d(o,"pasteElements"),d(o,"alignElements"),d(o,"resizeShape"),d(o,"createSpace"),d(o,"updateWaypoints"),d(o,"reconnectStart"),d(o,"reconnectEnd"),u(r,"trigger",function(y,f){var v=f[0];if(!l.modelingDisabled||!function(g,b){return g.indexOf(b)>-1}(["undo","redo","copy","paste","removeSelection","spaceTool","lassoTool","globalConnectTool","distributeElements","alignElements","directEditing"],v))return y.apply(this,f)})}ab.$inject=["eventBus","contextPad","dragging","directEditing","editorActions","modeling","palette","paletteProvider"];var Ww=ab,Xw=Re,Kw=J.TOGGLE_MODE_EVENT,Yw=J.RESET_SIMULATION_EVENT,Jw=J.GENERATE_TOKEN_EVENT;function oo(t,e){var n=this;this._overlays=t,e.on(Kw,function(i){i.simulationModeActive||n.removeElementNotifications()}),e.on([Yw,Jw],function(){n.removeElementNotifications()})}oo.prototype.addElementNotifications=function(t,e){var n=this;t.forEach(function(i){n.addElementNotification(i,e)})},oo.prototype.addElementNotification=function(t,e){var n={top:-15,right:15},i='
'+(e.icon?'':"")+(''+e.text+""||"")+"
",r=Xw(i);this._overlays.add(t,"element-notification",{position:n,html:r,show:{minZoom:.5}})},oo.prototype.removeElementNotifications=function(t){var e=this;t?t.forEach(function(n){e.removeElementNotification(n)}):this._overlays.remove({type:"element-notification"})},oo.prototype.removeElementNotification=function(t){this._overlays.remove({element:t})},oo.$inject=["overlays","eventBus"];var sb,cb,Zw=oo;function lb(){return cb?sb:(cb=1,sb=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n
'),U1.bind(this.paletteEntry,"click",function(){t.resetSimulation(),t._notifications.showNotification("Reset Simulation","info")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,2)},Ic.prototype.resetSimulation=function(){yb(this.paletteEntry).add("disabled"),this._elementRegistry.forEach(function(t){t.tokenCount!==void 0&&delete t.tokenCount}),this._eventBus.fire(X1)},Ic.$inject=["eventBus","tokenSimulationPalette","notifications","elementRegistry"];var K1=Ic,Y1=Re,Dc=Di,yh=bn,Bc=xa,J1=J.TOGGLE_MODE_EVENT;function Oc(t,e,n){var i=this;this._canvas=t,this._animation=e,this._eventBus=n,this._init(),n.on(J1,function(r){r.simulationModeActive?Dc(i.container).remove("hidden"):Dc(i.container).add("hidden")})}Oc.prototype._init=function(){var t=this;this.container=Y1('');var e=Bc("#animation-speed-1",this.container),n=Bc("#animation-speed-2",this.container),i=Bc("#animation-speed-3",this.container);yh.bind(e,"click",function(){t.setActive(e),t._animation.setAnimationSpeed(.5)}),yh.bind(n,"click",function(){t.setActive(n),t._animation.setAnimationSpeed(1)}),yh.bind(i,"click",function(){t.setActive(i),t._animation.setAnimationSpeed(1.5)}),this._canvas.getContainer().appendChild(this.container)},Oc.prototype.setActive=function(t){Bc.all(".animation-speed-button",this.container).forEach(function(e){Dc(e).remove("active")}),Dc(t).add("active")},Oc.$inject=["canvas","animation","eventBus"];var Z1=Oc,gb=Re,so=Di,gh=bn,bh=xa,Q1=function(t){for(var e;t.childNodes.length;)e=t.childNodes[0],t.removeChild(e);return t},tS=J.TOGGLE_MODE_EVENT,eS=J.PROCESS_INSTANCE_CREATED_EVENT,nS=J.PROCESS_INSTANCE_FINISHED_EVENT,iS=J.PROCESS_INSTANCE_SHOWN_EVENT,rS=J.PROCESS_INSTANCE_HIDDEN_EVENT,oS=J.RESET_SIMULATION_EVENT,aS=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-silver-base-97"),sS=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44");function bb(t){return t===null}function xn(t,e,n,i,r,o){var a=this;this._eventBus=t,this._canvas=e,this._processInstanceSettings=n,this._processInstances=i,this._graphicsFactory=r,this._elementRegistry=o,this.highlightedElement=null,this._init(),t.on(tS,function(c){c.simulationModeActive?so(a.container).remove("hidden"):(so(a.container).add("hidden"),Q1(a.container),bb(a.highlightedElement)||(a.removeHighlightFromProcess(a.highlightedElement.element),a.highlightedElement=null))}),t.on(eS,function(c){a.addInstance(c)}),t.on(nS,function(c){a.removeInstance(c)}),t.on(iS,function(c){a.setInstanceShown(c.processInstanceId)}),t.on(rS,function(c){a.setInstanceHidden(c.processInstanceId)}),t.on(oS,function(){a.removeAllInstances()})}xn.prototype._init=function(){this.container=gb(''),this._canvas.getContainer().appendChild(this.container)},xn.prototype.addInstance=function(t){var e=this,n=t.processInstanceId,i=t.parent,r=gb('
'+n+"
");gh.bind(r,"click",function(){e._processInstances.getProcessInstances(i).forEach(function(o){e._processInstanceSettings.hideProcessInstance(o.processInstanceId)}),e._processInstanceSettings.showProcessInstance(n,i)}),gh.bind(r,"mouseenter",function(){e.highlightedElement={element:i,stroke:i.businessObject.di.get("stroke"),fill:i.businessObject.di.get("fill")},e.addHighlightToProcess(i)}),gh.bind(r,"mouseleave",function(){e.removeHighlightFromProcess(i),e.highlightedElement=null}),this.container.appendChild(r)},xn.prototype.removeInstance=function(t){var e=t.processInstanceId,n=bh("#instance-"+e,this.container);n&&n.remove()},xn.prototype.removeAllInstances=function(){this.container.innerHTML=""},xn.prototype.setInstanceShown=function(t){var e=bh("#instance-"+t,this.container);e&&so(e).add("active")},xn.prototype.setInstanceHidden=function(t){var e=bh("#instance-"+t,this.container);e&&so(e).remove("active")},xn.prototype.addHighlightToProcess=function(t){this.setColor(t,sS,aS),t.parent||so(this._canvas.getContainer()).add("highlight")},xn.prototype.removeHighlightFromProcess=function(t){bb(this.highlightedElement)||(this.setColor(t,this.highlightedElement.stroke,this.highlightedElement.fill),t.parent||so(this._canvas.getContainer()).remove("highlight"))},xn.prototype.setColor=function(t,e,n){var i=t.businessObject;i.di.set("stroke",e),i.di.set("fill",n);var r=this._elementRegistry.getGraphics(t);this._graphicsFactory.update("connection",t,r)},xn.$inject=["eventBus","canvas","processInstanceSettings","processInstances","graphicsFactory","elementRegistry"];var cS=xn,Lc=Ft,lS=Lc.getBusinessObject,jc=Lc.is,uS=Lc.isAncestor,pS=Lc.isTypedEvent,hS=J.CONSUME_TOKEN_EVENT;function Vc(t,e,n,i,r,o,a){this._animation=e,this._elementRegistry=n,this._log=i,this._elementNotifications=r,this._canvas=o,this._processInstances=a,t.on(hS,250,function(){})}Vc.prototype.isDeadlock=function(){var t=this,e=[];this._elementRegistry.forEach(function(r){r.tokenCount&&e.push(r)});var n=[],i=[];e.forEach(function(r){r.outgoing.filter(function(a){return jc(a,"bpmn:SequenceFlow")}).length||n.push(r),jc(r,"bpmn:ParallelGateway")&&r.incoming.filter(function(a){return jc(a,"bpmn:SequenceFlow")}).length>r.tokenCount&&n.push(r);var o=[];(function a(c){c.outgoing.forEach(function(l){o.indexOf(l.target)===-1&&(o.push(l.target),pS(lS(l.target),"bpmn:TerminateEventDefinition")&&i.push(c),a(l.target))})})(r)}),e.length&&!i.length&&n.length&&!this._animation.animations.length&&(t._log.log("Deadlock","warning","fa-exclamation-triangle"),n.forEach(function(r){t._elementNotifications.addElementNotification(r,{type:"warning",icon:"fa-exclamation-triangle",text:"Deadlock"})}))},Vc.prototype.isFinished=function(t,e){var n=this._processInstances.getProcessInstance(e).parent,i=!1;n||(n=this._canvas.getRootElement()),n.children.forEach(function(o){o.tokenCount&&o.tokenCount[e]&&o.tokenCount[e].length&&(i=!0)});var r=!1;if(this._animation.animations.forEach(function(o){uS(n,o.element)&&o.processInstanceId===e&&(r=!0)}),!i&&!r)return jc(n,"bpmn:SubProcess")?this._log.log("Subprocess "+e+" finished","info","fa-check-circle"):(this._log.log("Process "+e+" finished","success","fa-check-circle"),this._elementNotifications.addElementNotification(t,{type:"success",icon:"fa-check-circle",text:"Finished"})),!0},Vc.$inject=["eventBus","animation","elementRegistry","log","elementNotifications","canvas","processInstances"];var dS=Vc,mS=Re,Fc=Di,fS=bn,vS=xa,xb=J.TOGGLE_MODE_EVENT;function zc(t,e,n,i){var r=this;this._eventBus=t,this._canvas=e,this._selection=n,this._contextPad=i,this.simulationModeActive=!1,t.on("import.done",function(){r.canvasParent=r._canvas.getContainer().parentNode,r.palette=vS(".djs-palette",r._canvas.getContainer()),r._init()})}zc.prototype._init=function(){this.container=mS(`
Token Simulation
`),fS.bind(this.container,"click",this.toggleMode.bind(this)),this._canvas.getContainer().appendChild(this.container)},zc.prototype.toggleMode=function(){if(this.simulationModeActive){this.container.innerHTML='Token Simulation ',Fc(this.canvasParent).remove("simulation"),Fc(this.palette).remove("hidden"),this._eventBus.fire(xb,{simulationModeActive:!1});var t=this._selection.get();t.length===1&&this._contextPad.open(t[0])}else this.container.innerHTML='Token Simulation ',Fc(this.canvasParent).add("simulation"),Fc(this.palette).add("hidden"),this._eventBus.fire(xb,{simulationModeActive:!0});this.simulationModeActive=!this.simulationModeActive},zc.$inject=["eventBus","canvas","selection","contextPad"];var yS=zc,gS=Re,Eb=Ft.isAncestor,bS=J.TOGGLE_MODE_EVENT,xS=J.GENERATE_TOKEN_EVENT,ES=J.CONSUME_TOKEN_EVENT,_S=J.RESET_SIMULATION_EVENT,wS=J.TERMINATE_EVENT,SS=J.PROCESS_INSTANCE_SHOWN_EVENT;function pr(t,e,n,i,r){var o=this;this._overlays=e,this._elementRegistry=n,this._canvas=i,this._processInstances=r,this.overlayIds={},t.on(bS,function(a){a.simulationModeActive||o.removeTokenCounts()}),t.on(_S,function(){o.removeTokenCounts()}),t.on(wS,function(a){var c=a.element.parent;o.removeTokenCounts(c)}),t.on([xS,ES],500,function(a){var c=a.element.parent;o.removeTokenCounts(c),o.addTokenCounts(c)}),t.on(SS,function(a){var c=a.processInstanceId,l=r.getProcessInstance(c).parent;o.removeTokenCounts(l),o.addTokenCounts(l)})}pr.prototype.addTokenCounts=function(t){var e=this;t||(t=this._canvas.getRootElement());var n=t.shownProcessInstance;if(!n){var i=this._processInstances.getProcessInstances(t);if(!i.length)return;n=i[0].processInstanceId}this._elementRegistry.forEach(function(r){Eb(t,r)&&e.addTokenCount(r,n)})},pr.prototype.addTokenCount=function(t,e){var n=t.tokenCount&&t.tokenCount[e];if(n){var i=this.createTokenCount(n),r={bottom:10,left:-15},o=this._overlays.add(t,"token-count",{position:r,html:i,show:{minZoom:.5}});this.overlayIds[t.id]=o}},pr.prototype.createTokenCount=function(t){return gS('
'+t+"
")},pr.prototype.removeTokenCounts=function(t){var e=this;t||(t=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){Eb(t,n)&&e.removeTokenCount(n)})},pr.prototype.removeTokenCount=function(t){var e=this.overlayIds[t.id];e&&(this._overlays.remove(e),delete this.overlayIds[t.id])},pr.$inject=["eventBus","overlays","elementRegistry","canvas","processInstances"];var CS=pr,Ma=Ft,TS=Ma.getBusinessObject,AS=Ma.is,kS=Ma.isAncestor,PS=Ma.getDescendants,MS=Ma.isTypedEvent,RS=J.GENERATE_TOKEN_EVENT,NS=J.TERMINATE_EVENT,IS=J.UPDATE_ELEMENTS_EVENT;function $c(t,e,n,i,r,o){this._animation=t,this._eventBus=e,this._log=n,this._simulationState=i,this._elementRegistry=r,this._processInstances=o}$c.prototype.consume=function(t){var e=t.element,n=t.processInstanceId,i=MS(TS(e),"bpmn:TerminateEventDefinition"),r=AS(e.parent,"bpmn:SubProcess");i&&(this._eventBus.fire(NS,t),this._elementRegistry.forEach(function(c){kS(e.parent,c)&&c.tokenCount&&c.tokenCount[n]&&delete c.tokenCount[n]}),this._processInstances.finish(n));var o=this._simulationState.isFinished(e,n);if(o&&this._processInstances.finish(n),(o||i)&&r){var a=this._processInstances.getProcessInstance(n);this._eventBus.fire(RS,{element:e.parent,processInstanceId:a.parentProcessInstanceId})}this._eventBus.fire(IS,{elements:PS(this._elementRegistry.getAll(),e.parent)})},$c.prototype.generate=function(t){},$c.$inject=["animation","eventBus","log","simulationState","elementRegistry","processInstances"];var DS=$c,BS=Ft.is,OS=J.UPDATE_ELEMENTS_EVENT;function Gc(t,e){this._eventBus=t,this._animation=e}Gc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId;e.tokenCount||(e.tokenCount={}),e.tokenCount[n]||(e.tokenCount[n]=0),e.tokenCount[n]++;var i=e.outgoing,r=[];i.forEach(function(o){var a=o.target;BS(a,"bpmn:IntermediateCatchEvent")&&r.push(a)}),this._eventBus.fire(OS,{elements:r})},Gc.prototype.generate=function(){},Gc.$inject=["eventBus","animation"];var LS=Gc,jS=J.CONSUME_TOKEN_EVENT,VS=J.GENERATE_TOKEN_EVENT;function Uc(t,e,n){this._eventBus=t,this._animation=e,this._elementRegistry=n}Uc.prototype.consume=function(t){var e=t.element;if(!e.sequenceFlow)throw new Error("no sequence flow configured for element "+e.id);this._eventBus.fire(VS,t)},Uc.prototype.generate=function(t){var e=t.element,n=t.processInstanceId;if(!e.sequenceFlow)throw new Error("no sequence flow configured for element "+e.id);var i=this,r=this._elementRegistry.get(e.sequenceFlow.id);this._animation.createAnimation(r,n,function(){i._eventBus.fire(jS,{element:r.target,processInstanceId:n})})},Uc.$inject=["eventBus","animation","elementRegistry"];var FS=Uc,_b=Ft.is,zS=J.CONSUME_TOKEN_EVENT,$S=J.UPDATE_ELEMENT_EVENT,GS=J.UPDATE_ELEMENTS_EVENT;function Hc(t,e,n){this._animation=t,this._eventBus=e,this._elementRegistry=n}Hc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId;e.tokenCount||(e.tokenCount={}),e.tokenCount[n]||(e.tokenCount[n]=0),e.tokenCount[n]++,this._eventBus.fire($S,{element:e})},Hc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(a){return _b(a,"bpmn:SequenceFlow")}).forEach(function(a){e._animation.createAnimation(a,i,function(){e._eventBus.fire(zS,{element:a.target,processInstanceId:i})})});var r=n.parent,o=this._elementRegistry.filter(function(a){return _b(a,"bpmn:IntermediateCatchEvent")&&a.parent===r});this._eventBus.fire(GS,{elements:o})},Hc.$inject=["animation","eventBus","elementRegistry"];var US=Hc,HS=Ft.is,qS=J.CONSUME_TOKEN_EVENT,WS=J.GENERATE_TOKEN_EVENT;function qc(t,e){this._animation=t,this._eventBus=e}qc.prototype.consume=function(t){this._eventBus.fire(WS,{element:t})},qc.prototype.generate=function(t){var e=this;t.outgoing.filter(function(n){return HS(n,"bpmn:SequenceFlow")}).forEach(function(n){e._animation.createAnimation(n,function(){e._eventBus.fire(qS,{element:n.target})})})},qc.$inject=["animation","eventBus"];var XS=qc,KS=Ft.is,YS=J.CONSUME_TOKEN_EVENT,JS=J.GENERATE_TOKEN_EVENT;function Wc(t,e){this._animation=t,this._eventBus=e}Wc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId;e.tokenCount||(e.tokenCount={}),e.tokenCount[n]||(e.tokenCount[n]=0),e.tokenCount[n]++,e.incoming.length===e.tokenCount[n]&&(this._eventBus.fire(JS,t),e.tokenCount[n]=0)},Wc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(r){return KS(r,"bpmn:SequenceFlow")}).forEach(function(r){e._animation.createAnimation(r,i,function(){e._eventBus.fire(YS,{element:r.target,processInstanceId:i})})})},Wc.$inject=["animation","eventBus"];var ZS=Wc,xh=Ft.is,QS=J.CONSUME_TOKEN_EVENT,tC=J.UPDATE_ELEMENTS_EVENT;function Xc(t,e,n,i){this._animation=t,this._eventBus=e,this._elementRegistry=n,this._processInstances=i}Xc.prototype.consume=function(){},Xc.prototype.generate=function(t){var e=this,n=t.element,i=t.parentProcessInstanceId,r=n.outgoing.filter(function(l){return xh(l,"bpmn:SequenceFlow")}),o=n.parent,a=this._processInstances.create(o,i);if(r.forEach(function(l){e._animation.createAnimation(l,a,function(){e._eventBus.fire(QS,{element:l.target,processInstanceId:a})})}),!xh(n.parent,"bpmn:SubProcess")){var c=this._elementRegistry.filter(function(l){return xh(l,"bpmn:StartEvent")});this._eventBus.fire(tC,{elements:c})}},Xc.$inject=["animation","eventBus","elementRegistry","processInstances"];var eC=Xc,wb=Ft.is,nC=J.CONSUME_TOKEN_EVENT,Sb=J.GENERATE_TOKEN_EVENT,Cb=J.UPDATE_ELEMENT_EVENT;function Kc(t,e,n){this._animation=t,this._eventBus=e,this._log=n}Kc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId,i=e.children.filter(function(r){return wb(r,"bpmn:StartEvent")})[0];i?(this._log.log("Starting Subprocess","info","fa-sign-in"),this._eventBus.fire(Sb,{element:i,parentProcessInstanceId:n})):(this._log.log("Skipping Subprocess","info","fa-angle-double-right"),this._eventBus.fire(Sb,t)),this._eventBus.fire(Cb,{element:e})},Kc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(r){return wb(r,"bpmn:SequenceFlow")}).forEach(function(r){e._animation.createAnimation(r,i,function(){e._eventBus.fire(nC,{element:r.target,processInstanceId:i})})}),this._eventBus.fire(Cb,{element:n})},Kc.$inject=["animation","eventBus","log"];var iC=Kc,rC=Ft.is,oC=J.CONSUME_TOKEN_EVENT,aC=J.UPDATE_ELEMENT_EVENT;function Yc(t,e,n){this._animation=t,this._eventBus=e,this._elementRegistry=n}Yc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId;e.tokenCount||(e.tokenCount={}),e.tokenCount[n]||(e.tokenCount[n]=0),e.tokenCount[n]++,this._eventBus.fire(aC,{element:e})},Yc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(r){return rC(r,"bpmn:SequenceFlow")}).forEach(function(r){e._animation.createAnimation(r,i,function(){e._eventBus.fire(oC,{element:r.target,processInstanceId:i})})})},Yc.$inject=["animation","eventBus","elementRegistry"];var sC=Yc,cC=Ft.is,lC=J.CONSUME_TOKEN_EVENT,uC=J.GENERATE_TOKEN_EVENT;function Jc(t,e){this._animation=t,this._eventBus=e}Jc.prototype.consume=function(t){this._eventBus.fire(uC,t)},Jc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(r){return cC(r,"bpmn:SequenceFlow")}).forEach(function(r){e._animation.createAnimation(r,i,function(){e._eventBus.fire(lC,{element:r.target,processInstanceId:i})})})},Jc.$inject=["animation","eventBus"];var pC=DS,hC=LS,dC=FS,mC=US,fC=XS,vC=ZS,yC=eC,gC=iC,bC=sC,xC=Jc,EC=J.GENERATE_TOKEN_EVENT,_C=J.CONSUME_TOKEN_EVENT;function Eh(t,e,n){var i=this;this._injector=n,this.handlers={},this.registerHandler("bpmn:EndEvent",pC),this.registerHandler("bpmn:EventBasedGateway",hC),this.registerHandler("bpmn:ExclusiveGateway",dC),this.registerHandler("bpmn:IntermediateCatchEvent",mC),this.registerHandler("bpmn:IntermediateThrowEvent",fC),this.registerHandler("bpmn:ParallelGateway",vC),this.registerHandler("bpmn:StartEvent",yC),this.registerHandler("bpmn:SubProcess",gC),this.registerHandler("bpmn:BoundaryEvent",bC),this.registerHandler(["bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:Task","bpmn:UserTask"],xC),t.on(EC,function(r){var o=r.element;if(!i.handlers[o.type])throw new Error("no handler for type "+o.type);i.handlers[o.type].generate(r)}),t.on(_C,function(r){var o=r.element;if(!i.handlers[o.type])throw new Error("no handler for type "+o.type);i.handlers[o.type].consume(r)})}Eh.prototype.registerHandler=function(t,e){var n=this,i=this._injector.instantiate(e);Array.isArray(t)||(t=[t]),t.forEach(function(r){n.handlers[r]=i})},Eh.$inject=["eventBus","animation","injector"];var wC=Eh;function Tb(t,e,n,i,r,o){o.register({toggleTokenSimulation:function(){e.toggleMode()}}),o.register({togglePauseTokenSimulation:function(){n.toggle()}}),o.register({resetTokenSimulation:function(){r.resetSimulation()}}),o.register({toggleTokenSimulationLog:function(){i.toggle()}})}Tb.$inject=["eventBus","toggleMode","pauseSimulation","log","resetSimulation","editorActions"];var SC=Tb,CC=J.TOGGLE_MODE_EVENT;function Ab(t,e){var n=e.get("editorActions",!1),i=e.get("keyboard",!1);if(i&&n){var r=!1;t.on("keyboard.init",function(){i.addListener(1e4,function(o){(function(a){Zc(["t","T"],a)?n.trigger("toggleTokenSimulation"):r&&(Zc(["l","L"],a)?n.trigger("toggleTokenSimulationLog"):Zc([" ","Spacebar"],a)?n.trigger("togglePauseTokenSimulation"):Zc(["r","R"],a)&&n.trigger("resetTokenSimulation"))})(o.keyEvent)})}),t.on(CC,function(o){var a=o.simulationModeActive;r=!!a})}}function Zc(t,e){return t.indexOf(e.key)>-1}Ab.$inject=["eventBus","injector"];var TC=Ab,AC=Re,kb=Di,kC=J.TOGGLE_MODE_EVENT;function Qc(t,e){var n=this;this._canvas=e,this.entries=[],this._init(),t.on(kC,function(i){i.simulationModeActive?kb(n.container).remove("hidden"):kb(n.container).add("hidden")})}Qc.prototype._init=function(){this.container=AC(''),this._canvas.getContainer().appendChild(this.container)},Qc.prototype.addEntry=function(t,e){var n=0;this.entries.forEach(function(i){e>=i.index&&n++}),this.container.insertBefore(t,this.container.childNodes[n]),this.entries.push({entry:t,index:e})},Qc.$inject=["eventBus","canvas"];const PC=gr({__init__:["animation","contextPads","disableModeling","elementNotifications","elementSupport","exclusiveGatewaySettings","log","notifications","pauseSimulation","preserveElementColors","processInstanceIds","processInstanceSettings","processInstances","resetSimulation","setAnimationSpeed","showProcessInstance","simulationState","toggleMode","tokenCount","tokenSimulationBehavior","tokenSimulationEditorActions","tokenSimulationKeyboardBindings","tokenSimulationPalette"],animation:["type",dw],contextPads:["type",Hw],disableModeling:["type",Ww],elementNotifications:["type",Zw],elementSupport:["type",i1],exclusiveGatewaySettings:["type",s1],log:["type",f1],notifications:["type",y1],pauseSimulation:["type",T1],preserveElementColors:["type",k1],processInstanceIds:["type",R1],processInstanceSettings:["type",L1],processInstances:["type",$1],resetSimulation:["type",K1],setAnimationSpeed:["type",Z1],showProcessInstance:["type",cS],simulationState:["type",dS],toggleMode:["type",yS],tokenCount:["type",CS],tokenSimulationBehavior:["type",wC],tokenSimulationEditorActions:["type",SC],tokenSimulationKeyboardBindings:["type",TC],tokenSimulationPalette:["type",Qc]}),MC={name:"Camunda",uri:"http://camunda.org/schema/1.0/bpmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity","bpmn:SignalEventDefinition"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","camunda:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"camunda:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["camunda:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","camunda:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","camunda:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike","camunda:ExecutionListener","camunda:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["camunda:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["camunda:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0},{name:"id",type:"String",isAttr:!0},{name:"eventDefinitions",type:"bpmn:TimerEventDefinition",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvents",isAttr:!0,type:"String"}]}],emumerations:[]},RC={name:"Activiti",uri:"http://activiti.org/bpmn",prefix:"activiti",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","activiti:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"activiti:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0},{name:"executionListener",isAbstract:!0,type:"Expression"}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"multiinstance_type",superClass:["Element"]},{name:"multiinstance_condition",superClass:["Element"]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"multiinstance_condition",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["activiti:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","activiti:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["activiti:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","activiti:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["activiti:ServiceTaskLike","activiti:ExecutionListener","activiti:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["activiti:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["activiti:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormProperty",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]}],emumerations:[]},NC={name:"Flowable",uri:"http://flowable.org/bpmn",prefix:"flowable",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","flowable:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"flowable:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"},{name:"formType",isAttr:!0,type:"String"},{name:"formReadOnly",isAttr:!0,type:"Boolean",default:!1},{name:"formInit",isAttr:!0,type:"Boolean",default:!0}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"}]},{name:"Assignee",supperClass:"Element",meta:{allowedIn:["*"]},properties:[{name:"label",type:"String",isAttr:!0},{name:"viewId",type:"Number",isAttr:!0}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["flowable:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","flowable:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Button",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"code",type:"String",isAttr:!0},{name:"isHide",type:"String",isAttr:!0},{name:"next",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"Assignee",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"condition",type:"String",isAttr:!0},{name:"operationType",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","flowable:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike","flowable:ExecutionListener","flowable:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"ChildField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["flowable:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["flowable:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0},{name:"children",type:"ChildField",isMany:!0},{name:"extensionElements",type:"bpmn:ExtensionElements",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]},{name:"Condition",superClass:["Element"],meta:{allowedIn:["bpmn:SequenceFlow"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"field",type:"String",isAttr:!0},{name:"compare",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"logic",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]}],emumerations:[]},_h=Object.prototype.toString,IC=Object.prototype.hasOwnProperty;function Pb(t){return _h.call(t)==="[object Array]"}function Mb(t){const e=_h.call(t);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"||e==="[object Proxy]"}function DC(t,e){return t!=null&&IC.call(t,e)}function BC(t,e){const n=function(r){return Mb(r)?r:o=>o===r}(e);let i;return Rb(t,function(r,o){if(n(r,o))return i=r,!1}),i}function Rb(t,e){let n,i;if(t===void 0)return;const r=Pb(t)?LC:OC;for(let o in t)if(DC(t,o)&&(n=t[o],i=e(n,r(o)),i===!1))return n}function co(t,e){return!!BC(t,e)}function OC(t){return t}function LC(t){return Number(t)}function jC(t,...e){return Object.assign(t,...e)}function lo(t){const e=this;t.on("moddleCopy.canCopyProperty",function(n){const i=n.property,r=n.parent;return e.canCopyProperty(i,r)})}function uo(t,e){return t&&Mb(t.$instanceOf)&&t.$instanceOf(e)}function Nb(t,e){return co(e,function(n){return uo(t,n)})}function En(t,e){return e?uo(t,e)?t:t.$parent?En(t.$parent,e):void 0:t.$parent}lo.$inject=["eventBus"],lo.prototype.canCopyProperty=function(t,e){return n=t,!(_h.call(n)==="[object Object]"&&!function(i,r){const o=i.$type&&i.$model.getTypeDescriptor(i.$type),a=o&&o.meta&&o.meta.allowedIn;return!a||function(c){return c.indexOf("*")!==-1}(a)?!0:co(a,function(c){return En(r,c)})}(t,e))&&!(uo(t,"camunda:InputOutput")&&!this.canHostInputOutput(e))&&!(Nb(t,["camunda:Connector","camunda:Field"])&&!this.canHostConnector(e))&&!(uo(t,"camunda:In")&&!this.canHostIn(e))&&void 0;var n},lo.prototype.canHostInputOutput=function(t){if(En(t,"camunda:Connector"))return!0;const e=En(t,"bpmn:FlowNode");return!!e&&!Nb(e,["bpmn:StartEvent","bpmn:Gateway","bpmn:BoundaryEvent"])&&!(uo(e,"bpmn:SubProcess")&&e.get("triggeredByEvent"))},lo.prototype.canHostConnector=function(t){return!uo(En(t,"camunda:ServiceTaskLike"),"bpmn:MessageEventDefinition")||En(t,"bpmn:IntermediateThrowEvent")||En(t,"bpmn:EndEvent")},lo.prototype.canHostIn=function(t){return En(t,"bpmn:CallActivity")?!0:!En(t,"bpmn:SignalEventDefinition")||En(t,"bpmn:IntermediateThrowEvent")||En(t,"bpmn:EndEvent")};const VC={__init__:["camundaModdleExtension"],camundaModdleExtension:["type",lo]},FC={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function wh(t,e){return t&&typeof t.$instanceOf=="function"&&t.$instanceOf(e)}function Sh(t,e){return(n=t)&&n.length&&co(t,function(i){return wh(i,e)});var n}function Ch(t,e,n){const i=e.name,r=FC[i.replace(/activiti:/,"")];return i===t&&function(o,a){return co(a,function(c){return wh(o,c)})}(n,r)}function Th(t){t.on("property.clone",function(e){const n=e.newElement,i=e.propertyDescriptor;this.canCloneProperty(n,i)},this)}Th.$inject=["eventBus"],Th.prototype.canCloneProperty=function(t,e){return Ch("activiti:FailedJobRetryTimeCycle",e,t)?Sh(t.eventDefinitions,"bpmn:TimerEventDefinition")||Sh(t.eventDefinitions,"bpmn:SignalEventDefinition")||wh(t.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):Ch("activiti:Connector",e,t)||Ch("activiti:Field",e,t)?Sh(t.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const zC={__init__:["ActivitiModdleExtension"],ActivitiModdleExtension:["type",Th]},$C={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function Ah(t,e){return t&&typeof t.$instanceOf=="function"&&t.$instanceOf(e)}function kh(t,e){return(n=t)&&n.length&&co(t,function(i){return Ah(i,e)});var n}function Ph(t,e,n){const i=e.name,r=$C[i.replace(/flowable:/,"")];return i===t&&function(o,a){return co(a,function(c){return Ah(o,c)})}(n,r)}function Mh(t){t.on("property.clone",function(e){const n=e.newElement,i=e.propertyDescriptor;this.canCloneProperty(n,i)},this)}Mh.$inject=["eventBus"],Mh.prototype.canCloneProperty=function(t,e){return Ph("flowable:FailedJobRetryTimeCycle",e,t)?kh(t.eventDefinitions,"bpmn:TimerEventDefinition")||kh(t.eventDefinitions,"bpmn:SignalEventDefinition")||Ah(t.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):Ph("flowable:Connector",e,t)||Ph("flowable:Field",e,t)?kh(t.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const GC={__init__:["FlowableModdleExtension"],FlowableModdleExtension:["type",Mh]};var At,Oi,UC=Object.defineProperty,tl=Object.getOwnPropertySymbols,Ib=Object.prototype.hasOwnProperty,Db=Object.prototype.propertyIsEnumerable,Rh=(t,e,n)=>e in t?UC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Bb=(t,e)=>{for(var n in e||(e={}))Ib.call(e,n)&&Rh(t,n,e[n]);if(tl)for(var n of tl(e))Db.call(e,n)&&Rh(t,n,e[n]);return t},Li=(t,e,n)=>(Rh(t,typeof e!="symbol"?e+"":e,n),n);function _n(t){return t==null}function Nh(t){return typeof t=="string"}(Oi=At||(At={})).Root="Root",Oi.Declaration="Declaration",Oi.Comment="Comment",Oi.DocumentType="DocumentType",Oi.Element="Element",Oi.Text="Text",Oi.Instruction="Instruction",Oi.CDATA="CDATA";var ln=class{constructor(t,e=null,n=null){Li(this,"name"),Li(this,"type"),Li(this,"parent"),Li(this,"children"),Li(this,"attributes"),Li(this,"value"),Li(this,"selfClosing"),Li(this,"prefix"),this.name="",this.type=t,this.parent=e,this.value=n,this.children=null,this.attributes={},this.selfClosing=!1,this.prefix=""}setName(t){return this.name=t,this}setType(t){return this.type=t,this}setParent(t){return this.parent=t,this}setChildren(t){return this.children=t&&Array.from(t),this}setAttributes(t){return this.attributes=Bb({},t),this}setValue(t){return this.value=t,this}setSelfClosing(t){return this.selfClosing=t,this}setPrefix(t){return this.prefix=t,this}addAttribute(t,e){return this.attributes[t]=e,this}removeAttribute(t){return delete this.attributes[t],this}addChild(t){return t===this||(this.children||(this.children=[]),this.children.push(t),t.parent!==this&&(t.parent=this)),this}removeChild(t){if(this.children&&this.children.length){const e=this.children.findIndex(n=>n===t);~e&&(this.children.splice(e,1),t.parent=null)}return this}toJsObject(){return{name:this.name||void 0,prefix:this.prefix||void 0,type:this.type,attributes:Object.keys(this.attributes).length?this.attributes:void 0,value:_n(this.value)?void 0:this.value,selfClosing:this.selfClosing||void 0,children:(this.type===At.Element||this.type===At.Root)&&this.children&&this.children.length?this.children.map(t=>t.toJSON()):void 0}}toXmlString(t=" ",e=` `,n=0){const i=t.repeat(n);let r="";switch(this.type){case At.Root:r+=this.children&&this.children.length?this.children.map(o=>o.toXmlString(t,e,n)).join(e):"";break;case At.Element:{if(!this.name)return"";const o=this.prefix?`${this.prefix}:${this.name}`:this.name;r+=`${i}<${o}`;const a=Ob(this.attributes||{});a&&(r+=` ${a}`),this.children&&this.children.length?r+=`>${e}${this.children.map(c=>c.toXmlString(t,e,n+1)).join(e)}${e}${i}`:r+=this.selfClosing?" />":`>`;break}case At.CDATA:r+=`${i}`;break;case At.Text:r+=_n(this.value)?"":`${i}${this.value}`;break;case At.DocumentType:r+=_n(this.value)?"":`${i}`;break;case At.Comment:r+=`${i}`;break;case At.Declaration:if(r+=`${i}{var l={};for(var u in a)Ib.call(a,u)&&c.indexOf(u)<0&&(l[u]=a[u]);if(a!=null&&tl)for(var u of tl(a))c.indexOf(u)<0&&Db.call(a,u)&&(l[u]=a[u]);return l})(this.attributes,["version"]);o&&(r+=Ob(o))}r+="?>";break;case At.Instruction:r+=_n(this.value)?"":`${i}`}return r}toJSON(){return this.toJsObject()}toString(){return this.toXmlString("","")}};function Ob(t){return Object.keys(t).map(e=>{const n=t[e];return _n(n)?null:function(i){return typeof i=="boolean"}(n)?n?e:null:`${e}="${n}"`}).filter(Boolean).join(" ")}var Lb=t=>t,jb={ignoreAttributes:!1,parseNodeValue:!0,trimValues:!0,prefixInName:!1,valueProcessor:Lb,attributeProcessor:Lb},HC=Object.keys(jb),hr="Tag is not closed.";function qC(t,e={}){const n=t.replace(/\r\n?/g,` `),i=function(l={}){const u=Bb({},l);return HC.forEach(p=>{_n(u[p])&&(u[p]=jb[p])}),u}(e),r=n.length,o=new ln(At.Root);let a=o,c="";for(let l=0;l",l,`Element End ${hr}`);let d=n.substring(l+2,p),y="";if(!i.prefixInName){const f=d.indexOf(":");~f&&(y=d.substring(0,f),d=d.substring(f+1))}if(a.prefix!==y||a.name!==d)throw new Error("End Tag is incorrect.");if(c){const f=Ih(dr("",At.Text,c,i));f&&a.addChild(new ln(At.Text,a,f))}a=a.parent,c="",l=p}else if(n[l+1]==="?"){const p=po(n,"?>",l,`Processing Instruction ${hr}`),d=n.substring(l+2,p-1);if(a)if(d.startsWith("xml ")&&d.includes("version=")&&a.type===At.Root){const y=new ln(At.Declaration,a);y.attributes=Dh(d.substr(4),At.Declaration,i),a.addChild(y)}else a.addChild(new ln(At.Instruction,a,dr("",At.Instruction,d,i)));l=p}else if(n.substr(l+1,3)==="!--"){const p=po(n,"-->",l,`Comment ${hr}`),d=n.substring(l+4,p-2);a&&a.addChild(new ln(At.Comment,a,dr("",At.Comment,d,i))),l=p}else if(n.substr(l+1,8)==="!DOCTYPE"){let p=po(n,">",l,`Document Type ${hr}`),d=n.substring(l+9,p);d.includes("[")&&(p=po(n,"]>",l,`Document Type ${hr}`),d=n.substring(l+9,p)),a&&a.addChild(new ln(At.DocumentType,a,dr("",At.DocumentType,d,i))),l=p}else if(n.substr(l+1,8)==="![CDATA["){const p=po(n,"]]>",l,`CDATA Section ${hr}`),d=n.substring(l+9,p-2);if(a&&c){const y=Ih(dr("",At.Text,c,i));y&&a.addChild(new ln(At.Text,a,y))}a.addChild(new ln(At.CDATA,a,dr("",At.CDATA,d,i))),c="",l=p}else{let p="",d="",y=l+1;for(;y<=r;){let b=n[y];if(p)b===p&&(p="");else if(b==='"'||b==="'")p=b;else if(b===" ")b=" ";else if(b===">")break;d+=b,y++}if(y>r)throw new Error(`Element ${hr}`);d=d.trim();const f=d.indexOf(" ");let v=d,g="";if(~f?(v=d.substr(0,f),d=d.substr(f+1)):d="",!i.prefixInName){const b=v.indexOf(":");~b&&(g=v.substring(0,b),v=v.substring(b+1))}if(a&&c){const b=Ih(dr("",At.Text,c,i));b&&a.addChild(new ln(At.Text,a,b))}if(d.length&&d.lastIndexOf("/")===d.length-1){v[v.length-1]==="/"?(v=v.substr(0,v.length-1),d=""):d=d.substr(0,d.length-1);const b=new ln(At.Element,a);b.name=v,b.selfClosing=!0,b.prefix=g,d&&!i.ignoreAttributes&&(b.attributes=Dh(d,At.Element,i)),a.addChild(b)}else{const b=new ln(At.Element,a);d&&!i.ignoreAttributes&&(b.attributes=Dh(d,At.Element,i)),b.name=v,b.prefix=g,a.addChild(b),a=b}c="",l=y}}return o}function po(t,e,n,i){const r=t.indexOf(e,n);if(!~r)throw new Error(i);return r+e.length-1}function dr(t,e,n,i){return n?(i.trimValues&&(n=n.trim()),Vb(i.valueProcessor(n,e,t),i.parseNodeValue)):null}function Vb(t,e){return e&&Nh(t)?(t=t.trim())==="true"||t!=="false"&&function(n){const i=parseFloat(n);return Number.isNaN(i)?n:i}(t):_n(t)?null:t}function Ih(t){return _n(t)?"":Nh(t)?t:String(t)}var WC=/[^\s=]+\s*(=\s*['"][\s\S]*?['"])?/g;function Dh(t,e,n){const i=(t=t.replace(/\r?\n/g," ")).match(WC)||[],r={};for(let o=0;o{}},additionalModel:[Object,Array],moddleExtension:{type:Object,default:()=>{}},onlyCustomizeAddi:{type:Boolean,default:!1},onlyCustomizeModdle:{type:Boolean,default:!1},simulation:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},prefix:{type:String,default:"camunda"},events:{type:Array,default:()=>["element.click"]},headerButtonSize:{type:String,default:"small",validator:t=>["default","medium","small","mini"].indexOf(t)!==-1},headerButtonType:{type:String,default:"primary",validator:t=>["default","primary","success","warning","danger","info"].indexOf(t)!==-1}},emits:["destroy","init-finished","save","commandStack-changed","input","change","canvas-viewbox-changed","element-click"],setup(t,{emit:e}){const n=X(),i=X(),r=e,o=t;ja("configGlobal",o);let a=null;const c=X(1),l=X(!1),u=X(!1),p=X(""),d=X("xml"),y=X(!1),f=X(!1),v=vl(()=>{const T=[];if(o.onlyCustomizeAddi)return Object.prototype.toString.call(o.additionalModel)=="[object Array]"?o.additionalModel||[]:[o.additionalModel];Object.prototype.toString.call(o.additionalModel)=="[object Array]"?T.push(...o.additionalModel):o.additionalModel&&T.push(o.additionalModel);const M={translate:["value",(I=o.translations||Z_,function($,P){return P=P||{},($=I[$]||$).replace(/{([^}]+)}/g,function(x,N){let j=P[N];return I[P[N]]!==null&&I[P[N]]!==void 0&&(j=I[P[N]]),j||"{"+N+"}"})})]};var I;return T.push(M),o.simulation&&T.push(PC),o.prefix==="camunda"&&T.push(VC),o.prefix==="flowable"&&T.push(GC),o.prefix==="activiti"&&T.push(zC),T}),g=vl(()=>{const T={};if(o.onlyCustomizeModdle)return o.moddleExtension||null;if(o.moddleExtension)for(let M in o.moddleExtension)T[M]=o.moddleExtension[M];return o.prefix==="activiti"&&(T.activiti=RC),o.prefix==="flowable"&&(T.flowable=NC),o.prefix==="camunda"&&(T.camunda=MC),T}),b=()=>{const T=a.get("eventBus");o.events.forEach(M=>{T.on(M,function(I){M.replace(/\./g,"-");let $=I?I.element:null;r("element-click",$,I)})}),T.on("commandStack.changed",async M=>{try{y.value=a.get("commandStack").canRedo(),f.value=a.get("commandStack").canUndo();let{xml:I}=await a.saveXML({format:!0});r("commandStack-changed",M),r("input",I),r("change",I)}catch{}}),a.on("canvas.viewbox.changed",({viewbox:M})=>{r("canvas-viewbox-changed",{viewbox:M});const{scale:I}=M;c.value=Math.floor(100*I)/100})},E=async T=>{let M=o.processId||`Process_${new Date().getTime()}`,I=o.processName||`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,$=T||qg(M,I,o.prefix);try{let{warnings:P}=await a.importXML($);P&&P.length&&P.forEach(x=>{})}catch{}},S=async T=>{try{if(T==="xml"||T==="bpmn"){const{err:I,xml:$}=await a.saveXML();let{href:P,filename:x}=w(T.toUpperCase(),$);M(P,x)}else{const{err:I,svg:$}=await a.saveSVG();if(I)return;let{href:P,filename:x}=w("SVG",$);M(P,x)}}catch{}function M(I,$){if(I&&$){let P=document.createElement("a");P.download=$,P.href=I,P.click(),URL.revokeObjectURL(P.href)}}},w=(T,M)=>({filename:`diagram.${T}`,href:`data:application/${T==="svg"?"text/xml":"bpmn20-xml"};charset=UTF-8,${encodeURIComponent(M)}`,data:M}),C=()=>{const T=i.value.files[0],M=new FileReader;M.readAsText(T),M.onload=function(){let I=this.result;E(I)}},B=()=>{u.value=!u.value,o.simulation&&a.get("toggleMode","strict").toggleMode()},s=T=>{const M=a.get("alignElements"),I=a.get("selection").get();!I||I.length<=1?Qb.warning("\u8BF7\u6309\u4F4F Shift \u952E\u9009\u62E9\u591A\u4E2A\u5143\u7D20\u5BF9\u9F50"):br.confirm("\u81EA\u52A8\u5BF9\u9F50\u53EF\u80FD\u9020\u6210\u56FE\u5F62\u53D8\u5F62\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F","\u8B66\u544A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{M.trigger(I,T)})},h=()=>{a.saveXML({format:!0}).then(({xml:T})=>{p.value=T,d.value="xml",l.value=!0})},m=()=>{a.saveXML({format:!0}).then(({xml:T})=>{var I;const M=new ln(At.Root,qC(T));p.value=(I=M.parent)==null?void 0:I.toJSON(),d.value="json",l.value=!0})},_=async()=>{const{err:T,xml:M}=await a.saveXML();T?alert("\u4FDD\u5B58\u6A21\u578B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01"):r("save",M)};return Yb(()=>{}),fo(()=>{(()=>{if(a)return;let T=document.getElementById("bpmnCanvas");a=new On({container:T,keyboard:o.keyboard?{bindTo:document}:null,additionalModules:v.value,moddleExtensions:g.value}),r("init-finished",a),b()})(),E(o.value)}),wn(()=>{a&&a.destroy(),r("destroy",a),a=null}),(T,M)=>{const I=Cr,$=c0,P=t0,x=e0,N=xr,j=Xb,G=Jb("highlight");return nt(),Nt("div",XC,[Ot("div",KC,[Zb(T.$slots,"control-header"),T.$slots["control-header"]?Tt("",!0):(nt(),Nt(qe,{key:0},[R(x,{key:"file-control"},{default:V(()=>[R(I,{preIcon:"ep:folder-opened",title:"\u6253\u5F00\u6587\u4EF6",onClick:M[0]||(M[0]=W=>D(i).click())}),R(P,{effect:"light",placement:"bottom"},{content:V(()=>[Ot("div",YC,[R($,{title:"\u4E0B\u8F7D\u4E3AXML\u6587\u4EF6",onClick:M[1]||(M[1]=W=>{S("xml")})}),M[17]||(M[17]=Ot("br",null,null,-1)),R($,{title:"\u4E0B\u8F7D\u4E3ASVG\u6587\u4EF6",onClick:M[2]||(M[2]=W=>{S("svg")})}),M[18]||(M[18]=Ot("br",null,null,-1)),R($,{title:"\u4E0B\u8F7D\u4E3ABPMN\u6587\u4EF6",onClick:M[3]||(M[3]=W=>{S("bpmn")})})])]),default:V(()=>[R(I,{title:"\u4E0B\u8F7D\u6587\u4EF6",preIcon:"ep:download"})]),_:1}),R(P,{effect:"light"},{content:V(()=>[R($,{title:"\u9884\u89C8XML",onClick:h}),M[19]||(M[19]=Ot("br",null,null,-1)),R($,{title:"\u9884\u89C8JSON",onClick:m})]),default:V(()=>[R(I,{preIcon:"ep:view",title:"\u6D4F\u89C8"})]),_:1}),o.simulation?(nt(),St(P,{key:0,effect:"light",content:D(u)?"\u9000\u51FA\u6A21\u62DF":"\u5F00\u542F\u6A21\u62DF"},{default:V(()=>[R(I,{preIcon:"ep:cpu",title:"\u6A21\u62DF",onClick:B})]),_:1},8,["content"])):Tt("",!0)]),_:1}),R(x,{key:"align-control"},{default:V(()=>[R(P,{effect:"light",content:"\u5411\u5DE6\u5BF9\u9F50"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-bottom",onClick:M[4]||(M[4]=W=>s("left"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u53F3\u5BF9\u9F50"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-top",onClick:M[5]||(M[5]=W=>s("right"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u4E0A\u5BF9\u9F50"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-left",onClick:M[6]||(M[6]=W=>s("top"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u4E0B\u5BF9\u9F50"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-right",onClick:M[7]||(M[7]=W=>s("bottom"))})]),_:1}),R(P,{effect:"light",content:"\u6C34\u5E73\u5C45\u4E2D"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-center",onClick:M[8]||(M[8]=W=>s("center"))})]),_:1}),R(P,{effect:"light",content:"\u5782\u76F4\u5C45\u4E2D"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-middle",onClick:M[9]||(M[9]=W=>s("middle"))})]),_:1})]),_:1}),R(x,{key:"scale-control"},{default:V(()=>[R(P,{effect:"light",content:"\u7F29\u5C0F\u89C6\u56FE"},{default:V(()=>[R(I,{preIcon:"ep:zoom-out",onClick:M[10]||(M[10]=W=>((tt=.1)=>{let it=Math.floor(100*c.value-100*tt)/100;if(it<.2)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");c.value=it,a.get("canvas").zoom(c.value)})()),disabled:D(c)<.2},null,8,["disabled"])]),_:1}),R(N,null,{default:V(()=>[dt(Jh(Math.floor(10*D(c)*10)+"%"),1)]),_:1}),R(P,{effect:"light",content:"\u653E\u5927\u89C6\u56FE"},{default:V(()=>[R(I,{preIcon:"ep:zoom-in",onClick:M[11]||(M[11]=W=>((tt=.1)=>{let it=Math.floor(100*c.value+100*tt)/100;if(it>4)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");c.value=it,a.get("canvas").zoom(c.value)})()),disabled:D(c)>4},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u91CD\u7F6E\u89C6\u56FE\u5E76\u5C45\u4E2D"},{default:V(()=>[R(I,{preIcon:"ep:scale-to-original",onClick:M[12]||(M[12]=W=>(c.value=1,void a.get("canvas").zoom("fit-viewport","auto")))})]),_:1})]),_:1}),R(x,{key:"stack-control"},{default:V(()=>[R(P,{effect:"light",content:"\u64A4\u9500"},{default:V(()=>[R(I,{preIcon:"ep:refresh-left",onClick:M[13]||(M[13]=W=>{a.get("commandStack").undo()}),disabled:!D(f)},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u6062\u590D"},{default:V(()=>[R(I,{preIcon:"ep:refresh-right",onClick:M[14]||(M[14]=W=>{a.get("commandStack").redo()}),disabled:!D(y)},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u91CD\u65B0\u7ED8\u5236"},{default:V(()=>[R(I,{preIcon:"ep:refresh",onClick:M[15]||(M[15]=W=>(y.value=!1,f.value=!1,void E(null)))})]),_:1})]),_:1}),R(I,{preIcon:"ep:plus",title:"\u4FDD\u5B58\u6A21\u578B",onClick:_,type:o.headerButtonType,disabled:D(u)},null,8,["type","disabled"])],64)),Ot("input",{type:"file",id:"files",ref_key:"refFile",ref:i,style:{display:"none"},accept:".xml, .bpmn",onChange:C},null,544)]),Ot("div",JC,[Ot("div",{class:"my-process-designer__canvas",ref_key:"bpmnCanvas",ref:n,id:"bpmnCanvas",style:{width:"1680px",height:"800px"}},null,512)]),R(j,{title:"\u9884\u89C8",modelValue:D(l),"onUpdate:modelValue":M[16]||(M[16]=W=>We(l)?l.value=W:null),width:"80%",scroll:!0,"max-height":"600px"},{default:V(()=>[Va((nt(),Nt("div",null,[Ot("code",ZC,Jh(D(p)),1)])),[[G]])]),_:1},8,["modelValue"])])}}});el.install=function(t){t.component(el.name,el)};const QC={class:"panel-tab__content"},tT={key:0},eT={key:1},nT=ke({name:"ElementBaseInfo",__name:"ElementBaseInfo",props:{businessObject:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}}},setup(t){const e=t,n=X({}),i=X(),r=X({}),o=n0({id:[{required:!0,message:"\u6D41\u7A0B\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],name:[{required:!0,message:"\u6D41\u7A0B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),a=()=>window==null?void 0:window.bpmnInstances,c=p=>{p&&p.match(/[a-zA-Z_][\-_.0-9a-zA-Z$]*/)&&(r.value.id=p,setTimeout(()=>{u("id")},100))},l=p=>{p&&(r.value.name=p,setTimeout(()=>{u("name")},100))},u=p=>{const d=Object.create(null);d[p]=r.value[p],n.value={...r.value,...n.value},p==="id"?a().modeling.updateProperties(Bt(i.value),{id:r.value[p],di:{id:`${r.value[p]}_di`}}):a().modeling.updateProperties(Bt(i.value),d)};return fo(()=>{setTimeout(()=>{c(e.model.key),l(e.model.name)},1e3)}),le(()=>e.businessObject,p=>{var d;p&&(i.value=(d=a())==null?void 0:d.bpmnElement,r.value=i.value.businessObject,n.value.type=i.value.businessObject.$type)}),wn(()=>{i.value=null}),(p,d)=>{const y=bl,f=hn,v=dn,g=Vn;return nt(),Nt("div",QC,[R(g,{"label-width":"90px",model:D(n),rules:D(o)},{default:V(()=>[D(n).type=="bpmn:Process"?(nt(),Nt("div",tT,[R(y,{href:"https://doc.iocoder.cn/bpm/#_3-%E6%B5%81%E7%A8%8B%E5%9B%BE%E7%A4%BA%E4%BE%8B",type:"danger",target:"_blank"},{default:V(()=>d[6]||(d[6]=[dt(" \u5982\u4F55\u5B9E\u73B0\u5B9E\u73B0\u4F1A\u7B7E\u3001\u6216\u7B7E\uFF1F ")])),_:1}),R(v,{label:"\u6D41\u7A0B\u6807\u8BC6",prop:"id"},{default:V(()=>[R(f,{modelValue:D(n).id,"onUpdate:modelValue":d[0]||(d[0]=b=>D(n).id=b),placeholder:"\u8BF7\u8F93\u5165\u6D41\u6807\u6807\u8BC6",disabled:D(n).id!==void 0&&D(n).id.length>0,onChange:c},null,8,["modelValue","disabled"])]),_:1}),R(v,{label:"\u6D41\u7A0B\u540D\u79F0",prop:"name"},{default:V(()=>[R(f,{modelValue:D(n).name,"onUpdate:modelValue":d[1]||(d[1]=b=>D(n).name=b),placeholder:"\u8BF7\u8F93\u5165\u6D41\u7A0B\u540D\u79F0",clearable:"",onChange:l},null,8,["modelValue"])]),_:1})])):(nt(),Nt("div",eT,[R(v,{label:"ID"},{default:V(()=>[R(f,{modelValue:D(r).id,"onUpdate:modelValue":d[2]||(d[2]=b=>D(r).id=b),clearable:"",onChange:d[3]||(d[3]=b=>u("id"))},null,8,["modelValue"])]),_:1}),R(v,{label:"\u540D\u79F0"},{default:V(()=>[R(f,{modelValue:D(r).name,"onUpdate:modelValue":d[4]||(d[4]=b=>D(r).name=b),clearable:"",onChange:d[5]||(d[5]=b=>u("name"))},null,8,["modelValue"])]),_:1})]))]),_:1},8,["model","rules"])])}}}),iT={class:"panel-tab__content"},rT={class:"element-property input-property"},oT={class:"element-property__value"},aT=ke({name:"ElementOtherConfig",__name:"ElementOtherConfig",props:{id:String},setup(t){const e=t,n=X(""),i=X(),r=()=>window.bpmnInstances,o=()=>{i.value&&i.value.id===e.id||(i.value=r().elementRegistry.get(e.id));const a=r().bpmnFactory.create("bpmn:Documentation",{text:n.value});r().modeling.updateProperties(Bt(i.value),{documentation:[a]})};return wn(()=>{i.value=null}),le(()=>e.id,a=>{a&&a.length?Ne(()=>{var l;const c=(l=r().bpmnElement.businessObject)==null?void 0:l.documentation;n.value=c&&c.length?c[0].text:""}):n.value=""},{immediate:!0}),(a,c)=>{const l=hn;return nt(),Nt("div",iT,[Ot("div",rT,[c[1]||(c[1]=Ot("div",{class:"element-property__label"},"\u5143\u7D20\u6587\u6863\uFF1A",-1)),Ot("div",oT,[R(l,{type:"textarea",modelValue:D(n),"onUpdate:modelValue":c[0]||(c[0]=u=>We(n)?n.value=u:null),resize:"vertical",autosize:{minRows:2,maxRows:4},onInput:o,onBlur:o},null,8,["modelValue"])])])])}}}),sT={style:{"margin-top":"16px"}},cT=ke({name:"UserTask",__name:"UserTask",props:{id:String,type:String},setup(t){const e=t,n=X({assignee:"",candidateUsers:[],candidateGroups:[],dueDate:"",followUpDate:"",priority:""}),i=X({}),r=X(),o=()=>window==null?void 0:window.bpmnInstances,a=c=>{const l=Object.create(null);l[c]=c==="candidateUsers"||c==="candidateGroups"?i.value[c]&&i.value[c].length?i.value[c].join():null:i.value[c]||null,o().modeling.updateProperties(Bt(r.value),l)};return le(()=>e.id,()=>{r.value=o().bpmnElement,Ne(()=>{(()=>{var c,l;for(let u in n.value){let p;p=u==="candidateUsers"||u==="candidateGroups"?(c=r.value)!=null&&c.businessObject[u]?r.value.businessObject[u].split(","):[]:((l=r.value)==null?void 0:l.businessObject[u])||n.value[u],i.value[u]=p}})()})},{immediate:!0}),wn(()=>{r.value=null}),(c,l)=>{const u=hn,p=dn,d=bl,y=Zh("router-link");return nt(),Nt("div",sT,[R(p,{label:"\u5230\u671F\u65F6\u95F4"},{default:V(()=>[R(u,{modelValue:D(i).dueDate,"onUpdate:modelValue":l[0]||(l[0]=f=>D(i).dueDate=f),clearable:"",onChange:l[1]||(l[1]=f=>a("dueDate"))},null,8,["modelValue"])]),_:1}),R(p,{label:"\u8DDF\u8E2A\u65F6\u95F4"},{default:V(()=>[R(u,{modelValue:D(i).followUpDate,"onUpdate:modelValue":l[2]||(l[2]=f=>D(i).followUpDate=f),clearable:"",onChange:l[3]||(l[3]=f=>a("followUpDate"))},null,8,["modelValue"])]),_:1}),R(p,{label:"\u4F18\u5148\u7EA7"},{default:V(()=>[R(u,{modelValue:D(i).priority,"onUpdate:modelValue":l[4]||(l[4]=f=>D(i).priority=f),clearable:"",onChange:l[5]||(l[5]=f=>a("priority"))},null,8,["modelValue"])]),_:1}),l[7]||(l[7]=dt(" \u53CB\u60C5\u63D0\u793A\uFF1A\u4EFB\u52A1\u7684\u5206\u914D\u89C4\u5219\uFF0C\u4F7F\u7528 ")),R(y,{target:"_blank",to:{path:"/bpm/manager/model"}},{default:V(()=>[R(d,{type:"danger"},{default:V(()=>l[6]||(l[6]=[dt("\u6D41\u7A0B\u6A21\u578B")])),_:1})]),_:1}),l[8]||(l[8]=dt(" \u4E0B\u7684\u3010\u5206\u914D\u89C4\u5219\u3011\u66FF\u4EE3\uFF0C\u63D0\u4F9B\u6307\u5B9A\u89D2\u8272\u3001\u90E8\u95E8\u8D1F\u8D23\u4EBA\u3001\u90E8\u95E8\u6210\u5458\u3001\u5C97\u4F4D\u3001\u5DE5\u4F5C\u7EC4\u3001\u81EA\u5B9A\u4E49\u811A\u672C\u7B49 7 \u79CD\u7EF4\u62A4\u7684\u4EFB\u52A1\u5206\u914D\u7EF4\u5EA6\uFF0C\u66F4\u52A0\u7075\u6D3B\uFF01 "))])}}}),lT={style:{"margin-top":"16px"}},uT=ke({name:"ScriptTask",__name:"ScriptTask",props:{id:String,type:String},setup(t){const e=t,n=X({scriptFormat:"",script:"",resource:"",resultVariable:""}),i=X({}),r=X(),o=()=>window==null?void 0:window.bpmnInstances,a=()=>{let c=Object.create(null);c.scriptFormat=i.value.scriptFormat||null,c.resultVariable=i.value.resultVariable||null,i.value.scriptType==="inline"?(c.script=i.value.script||null,c.resource=null):(c.resource=i.value.resource||null,c.script=null),o().modeling.updateProperties(Bt(r.value),c)};return wn(()=>{r.value=null}),le(()=>e.id,()=>{r.value=o().bpmnElement,Ne(()=>{(()=>{var c;for(let l in n.value){let u=((c=r.value)==null?void 0:c.businessObject[l])||n.value[l];i.value[l]=u}i.value.scriptType=i.value.script?"inline":"external"})()})},{immediate:!0}),(c,l)=>{const u=hn,p=dn,d=Er,y=_r;return nt(),Nt("div",lT,[R(p,{label:"\u811A\u672C\u683C\u5F0F"},{default:V(()=>[R(u,{modelValue:D(i).scriptFormat,"onUpdate:modelValue":l[0]||(l[0]=f=>D(i).scriptFormat=f),clearable:"",onInput:l[1]||(l[1]=f=>a()),onChange:l[2]||(l[2]=f=>a())},null,8,["modelValue"])]),_:1}),R(p,{label:"\u811A\u672C\u7C7B\u578B"},{default:V(()=>[R(y,{modelValue:D(i).scriptType,"onUpdate:modelValue":l[3]||(l[3]=f=>D(i).scriptType=f)},{default:V(()=>[R(d,{label:"\u5185\u8054\u811A\u672C",value:"inline"}),R(d,{label:"\u5916\u90E8\u8D44\u6E90",value:"external"})]),_:1},8,["modelValue"])]),_:1}),Va(R(p,{label:"\u811A\u672C"},{default:V(()=>[R(u,{modelValue:D(i).script,"onUpdate:modelValue":l[4]||(l[4]=f=>D(i).script=f),type:"textarea",resize:"vertical",autosize:{minRows:2,maxRows:4},clearable:"",onInput:l[5]||(l[5]=f=>a()),onChange:l[6]||(l[6]=f=>a())},null,8,["modelValue"])]),_:1},512),[[yl,D(i).scriptType==="inline"]]),Va(R(p,{label:"\u8D44\u6E90\u5730\u5740"},{default:V(()=>[R(u,{modelValue:D(i).resource,"onUpdate:modelValue":l[7]||(l[7]=f=>D(i).resource=f),clearable:"",onInput:l[8]||(l[8]=f=>a()),onChange:l[9]||(l[9]=f=>a())},null,8,["modelValue"])]),_:1},512),[[yl,D(i).scriptType==="external"]]),R(p,{label:"\u7ED3\u679C\u53D8\u91CF"},{default:V(()=>[R(u,{modelValue:D(i).resultVariable,"onUpdate:modelValue":l[10]||(l[10]=f=>D(i).resultVariable=f),clearable:"",onInput:l[11]||(l[11]=f=>a()),onChange:l[12]||(l[12]=f=>a())},null,8,["modelValue"])]),_:1})])}}}),pT={style:{"margin-top":"16px"}},hT={style:{display:"flex","align-items":"center","justify-content":"space-between","flex-wrap":"nowrap"}},dT=ke({name:"ReceiveTask",__name:"ReceiveTask",props:{id:String,type:String},setup(t){const e=t,n=td(),i=X(""),r=X({}),o=X({}),a=X(!1),c=X(),l=X(),u=X(),p=()=>window.bpmnInstances,d=()=>{a.value=!0,r.value={}},y=()=>{if(o.value[r.value.id])return void n.error("\u8BE5\u6D88\u606F\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const v=p().moddle.create("bpmn:Message",r.value);u.value.push(v),o.value[r.value.id]=r.value.name,l.value[r.value.id]=v,a.value=!1},f=v=>{v==="-1"?p().modeling.updateProperties(Bt(c.value),{messageRef:null}):p().modeling.updateProperties(Bt(c.value),{messageRef:l.value[v]})};return fo(()=>{l.value=Object.create(null),u.value=p().modeler.getDefinitions().rootElements,u.value.filter(v=>v.$type==="bpmn:Message").forEach(v=>{l.value[v.id]=v,o.value[v.id]=v.name}),o.value[-1]="\u65E0"}),wn(()=>{c.value=null}),le(()=>e.id,()=>{Ne(()=>{var v,g;c.value=p().bpmnElement,i.value=((g=(v=c.value.businessObject)==null?void 0:v.messageRef)==null?void 0:g.id)||"-1"})},{immediate:!0}),(v,g)=>{const b=Er,E=_r,S=Cr,w=dn,C=hn,B=Vn,s=xr,h=vo;return nt(),Nt("div",pT,[R(w,{label:"\u6D88\u606F\u5B9E\u4F8B"},{default:V(()=>[Ot("div",hT,[R(E,{modelValue:D(i),"onUpdate:modelValue":g[0]||(g[0]=m=>We(i)?i.value=m:null),onChange:f},{default:V(()=>[(nt(!0),Nt(qe,null,wr(Object.keys(D(o)),m=>(nt(),St(b,{value:m,label:D(o)[m],key:m},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),R(S,{type:"primary",preIcon:"ep:plus",style:{"margin-left":"8px"},onClick:d})])]),_:1}),R(h,{modelValue:D(a),"onUpdate:modelValue":g[3]||(g[3]=m=>We(a)?a.value=m:null),"close-on-click-modal":!1,title:"\u521B\u5EFA\u65B0\u6D88\u606F",width:"400px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(s,{size:"small",type:"primary",onClick:y},{default:V(()=>g[4]||(g[4]=[dt("\u786E \u8BA4")])),_:1})]),default:V(()=>[R(B,{model:D(r),size:"small","label-width":"90px"},{default:V(()=>[R(w,{label:"\u6D88\u606FID"},{default:V(()=>[R(C,{modelValue:D(r).id,"onUpdate:modelValue":g[1]||(g[1]=m=>D(r).id=m),clearable:""},null,8,["modelValue"])]),_:1}),R(w,{label:"\u6D88\u606F\u540D\u79F0"},{default:V(()=>[R(C,{modelValue:D(r).name,"onUpdate:modelValue":g[2]||(g[2]=m=>D(r).name=m),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),mT={class:"panel-tab__content"},fT=ke({name:"ElementTaskConfig",__name:"ElementTask",props:{id:String,type:String},setup(t){const e=t,n=X({asyncAfter:!1,asyncBefore:!1,exclusive:!1}),i=X(),r=X({UserTask:"UserTask",ScriptTask:"ScriptTask",ReceiveTask:"ReceiveTask"}),o=X(),a=()=>window.bpmnInstances,c=()=>{n.value.asyncBefore||n.value.asyncAfter||(n.value.exclusive=!1),a().modeling.updateProperties(a().bpmnElement,{...n.value})};return le(()=>e.id,()=>{var l,u,p,d,y,f;o.value=a().bpmnElement,n.value.asyncBefore=(u=(l=o.value)==null?void 0:l.businessObject)==null?void 0:u.asyncBefore,n.value.asyncAfter=(d=(p=o.value)==null?void 0:p.businessObject)==null?void 0:d.asyncAfter,n.value.exclusive=(f=(y=o.value)==null?void 0:y.businessObject)==null?void 0:f.exclusive},{immediate:!0}),le(()=>e.type,()=>{e.type==r.value.UserTask&&(i.value=cT),e.type==r.value.ScriptTask&&(i.value=uT),e.type==r.value.ReceiveTask&&(i.value=dT)},{immediate:!0}),(l,u)=>{const p=Qh,d=dn,y=Vn;return nt(),Nt("div",mT,[R(y,{size:"small","label-width":"90px"},{default:V(()=>[R(d,{label:"\u5F02\u6B65\u5EF6\u7EED"},{default:V(()=>[R(p,{modelValue:D(n).asyncBefore,"onUpdate:modelValue":u[0]||(u[0]=f=>D(n).asyncBefore=f),label:"\u5F02\u6B65\u524D",onChange:c},null,8,["modelValue"]),R(p,{modelValue:D(n).asyncAfter,"onUpdate:modelValue":u[1]||(u[1]=f=>D(n).asyncAfter=f),label:"\u5F02\u6B65\u540E",onChange:c},null,8,["modelValue"]),D(n).asyncAfter||D(n).asyncBefore?(nt(),St(p,{key:0,modelValue:D(n).exclusive,"onUpdate:modelValue":u[2]||(u[2]=f=>D(n).exclusive=f),label:"\u6392\u9664",onChange:c},null,8,["modelValue"])):Tt("",!0)]),_:1}),(nt(),St(o0(D(i)),i0(r0(l.$props)),null,16))]),_:1})])}}}),vT={class:"panel-tab__content"},yT=ke({name:"ElementMultiInstance",__name:"ElementMultiInstance",props:{businessObject:Object,type:String},setup(t){const e=t,n=Sr("prefix"),i=X(""),r=X({completionCondition:"",loopCardinality:"",extensionElements:[],asyncAfter:!1,asyncBefore:!1,exclusive:!1}),o=X({}),a=X(null),c=X(null),l=()=>window==null?void 0:window.bpmnInstances,u=g=>{if(g!=="Null"){if(g==="StandardLoop"){const b=l().moddle.create("bpmn:StandardLoopCharacteristics");return l().modeling.updateProperties(Bt(a.value),{loopCharacteristics:b}),void(c.value=null)}c.value=g==="SequentialMultiInstance"?l().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{isSequential:!0}):l().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{collection:"${coll_userList}"}),l().modeling.updateProperties(Bt(a.value),{loopCharacteristics:Bt(c.value)})}else l().modeling.updateProperties(Bt(a.value),{loopCharacteristics:null})},p=g=>{let b=null;g&&g.length&&(b=l().moddle.create("bpmn:FormalExpression",{body:g})),l().modeling.updateModdleProperties(Bt(a.value),c.value,{loopCardinality:b})},d=g=>{let b=null;g&&g.length&&(b=l().moddle.create("bpmn:FormalExpression",{body:g})),l().modeling.updateModdleProperties(Bt(a.value),c.value,{completionCondition:b})},y=g=>{const b=l().moddle.create("bpmn:ExtensionElements",{values:[l().moddle.create(`${n}:FailedJobRetryTimeCycle`,{body:g})]});l().modeling.updateModdleProperties(Bt(a.value),c.value,{extensionElements:b})},f=()=>{l().modeling.updateModdleProperties(Bt(a.value),c.value,{collection:o.value.collection||null,elementVariable:o.value.elementVariable||null})},v=g=>{const{asyncBefore:b,asyncAfter:E}=o.value;let S=Object.create(null);b||E?S[g]=o.value[g]:(o.value.exclusive=!1,S={asyncBefore:!1,asyncAfter:!1,exclusive:!1,extensionElements:null}),l().modeling.updateModdleProperties(Bt(a.value),c.value,S)};return wn(()=>{c.value=null,a.value=null}),le(()=>e.businessObject,g=>{var E,S,w,C;var b;a.value=l().bpmnElement,(b=g).loopCharacteristics?b.loopCharacteristics.$type==="bpmn:StandardLoopCharacteristics"?(i.value="StandardLoop",o.value={}):(b.loopCharacteristics.isSequential?i.value="SequentialMultiInstance":i.value="ParallelMultiInstance",o.value={...r.value,...b.loopCharacteristics,completionCondition:((S=(E=b.loopCharacteristics)==null?void 0:E.completionCondition)==null?void 0:S.body)??"",loopCardinality:((C=(w=b.loopCharacteristics)==null?void 0:w.loopCardinality)==null?void 0:C.body)??""},c.value=l().bpmnElement.businessObject.loopCharacteristics,b.loopCharacteristics.extensionElements&&b.loopCharacteristics.extensionElements.values&&b.loopCharacteristics.extensionElements.values.length&&(o.value.timeCycle=b.loopCharacteristics.extensionElements.values[0].body)):(i.value="Null",o.value={})},{immediate:!0}),(g,b)=>{const E=Er,S=_r,w=dn,C=hn,B=Qh,s=Vn;return nt(),Nt("div",vT,[R(s,{"label-width":"90px"},{default:V(()=>[R(w,{label:"\u56DE\u8DEF\u7279\u6027"},{default:V(()=>[R(S,{modelValue:D(i),"onUpdate:modelValue":b[0]||(b[0]=h=>We(i)?i.value=h:null),onChange:u},{default:V(()=>[R(E,{label:"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6",value:"ParallelMultiInstance"}),R(E,{label:"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",value:"SequentialMultiInstance"}),R(E,{label:"\u5FAA\u73AF\u4E8B\u4EF6",value:"StandardLoop"}),R(E,{label:"\u65E0",value:"Null"})]),_:1},8,["modelValue"])]),_:1}),D(i)==="ParallelMultiInstance"||D(i)==="SequentialMultiInstance"?(nt(),Nt(qe,{key:0},[R(w,{label:"\u5FAA\u73AF\u57FA\u6570",key:"loopCardinality"},{default:V(()=>[R(C,{modelValue:D(o).loopCardinality,"onUpdate:modelValue":b[1]||(b[1]=h=>D(o).loopCardinality=h),clearable:"",onChange:p},null,8,["modelValue"])]),_:1}),Va(R(w,{label:"\u96C6\u5408",key:"collection"},{default:V(()=>[R(C,{modelValue:D(o).collection,"onUpdate:modelValue":b[2]||(b[2]=h=>D(o).collection=h),clearable:"",onChange:f},null,8,["modelValue"])]),_:1},512),[[yl,!1]]),R(w,{label:"\u5143\u7D20\u53D8\u91CF",key:"elementVariable"},{default:V(()=>[R(C,{modelValue:D(o).elementVariable,"onUpdate:modelValue":b[3]||(b[3]=h=>D(o).elementVariable=h),clearable:"",onChange:f},null,8,["modelValue"])]),_:1}),R(w,{label:"\u5B8C\u6210\u6761\u4EF6",key:"completionCondition"},{default:V(()=>[R(C,{modelValue:D(o).completionCondition,"onUpdate:modelValue":b[4]||(b[4]=h=>D(o).completionCondition=h),clearable:"",onChange:d},null,8,["modelValue"])]),_:1}),R(w,{label:"\u5F02\u6B65\u72B6\u6001",key:"async"},{default:V(()=>[R(B,{modelValue:D(o).asyncBefore,"onUpdate:modelValue":b[5]||(b[5]=h=>D(o).asyncBefore=h),label:"\u5F02\u6B65\u524D",onChange:b[6]||(b[6]=h=>v("asyncBefore"))},null,8,["modelValue"]),R(B,{modelValue:D(o).asyncAfter,"onUpdate:modelValue":b[7]||(b[7]=h=>D(o).asyncAfter=h),label:"\u5F02\u6B65\u540E",onChange:b[8]||(b[8]=h=>v("asyncAfter"))},null,8,["modelValue"]),D(o).asyncAfter||D(o).asyncBefore?(nt(),St(B,{key:0,modelValue:D(o).exclusive,"onUpdate:modelValue":b[9]||(b[9]=h=>D(o).exclusive=h),label:"\u6392\u9664",onChange:b[10]||(b[10]=h=>v("exclusive"))},null,8,["modelValue"])):Tt("",!0)]),_:1}),D(o).asyncAfter||D(o).asyncBefore?(nt(),St(w,{label:"\u91CD\u8BD5\u5468\u671F",prop:"timeCycle",key:"timeCycle"},{default:V(()=>[R(C,{modelValue:D(o).timeCycle,"onUpdate:modelValue":b[11]||(b[11]=h=>D(o).timeCycle=h),clearable:"",onChange:y},null,8,["modelValue"])]),_:1})):Tt("",!0)],64)):Tt("",!0)]),_:1})])}}}),gT={class:"panel-tab__content"},bT=ke({name:"FlowCondition",__name:"FlowCondition",props:{businessObject:Object,type:String},setup(t){const e=t,n=X({}),i=X(),r=X(),o=X(),a=X(),c=()=>window==null?void 0:window.bpmnInstances,l=p=>p==="condition"?(a.value=c().moddle.create("bpmn:FormalExpression"),void c().modeling.updateProperties(Bt(i.value),{conditionExpression:a.value})):p==="default"?(c().modeling.updateProperties(Bt(i.value),{conditionExpression:null}),void c().modeling.updateProperties(Bt(r.value),{default:i.value})):(o.value.default&&o.value.default.id===i.value.id&&c().modeling.updateProperties(Bt(r.value),{default:null}),void c().modeling.updateProperties(Bt(i.value),{conditionExpression:null})),u=()=>{let p,{conditionType:d,scriptType:y,body:f,resource:v,language:g}=n.value;d==="expression"?p=c().moddle.create("bpmn:FormalExpression",{body:f}):y==="inlineScript"?(p=c().moddle.create("bpmn:FormalExpression",{body:f,language:g}),n.value.resource=""):(n.value.body="",p=c().moddle.create("bpmn:FormalExpression",{resource:v,language:g})),c().modeling.updateProperties(Bt(i.value),{conditionExpression:p})};return wn(()=>{i.value=null,r.value=null,o.value=null}),le(()=>e.businessObject,p=>{Ne(()=>{(()=>{if(i.value=c().bpmnElement,r.value=i.value.source,o.value=i.value.businessObject.sourceRef,o.value&&o.value.default&&o.value.default.id===i.value.id&&n.value.type=="default")n.value={type:"default"};else if(i.value.businessObject.conditionExpression){const d=i.value.businessObject.conditionExpression;if(n.value={...d,type:"condition"},n.value.resource)return n.value.conditionType="script",void(n.value.scriptType="externalScript");if(d.language)return n.value.conditionType="script",void(n.value.scriptType="inlineScript");n.value.conditionType="expression"}else n.value={type:"normal"}})()})},{immediate:!0}),(p,d)=>{const y=Er,f=_r,v=dn,g=hn,b=Vn;return nt(),Nt("div",gT,[R(b,{model:D(n),"label-width":"90px",size:"small"},{default:V(()=>[R(v,{label:"\u6D41\u8F6C\u7C7B\u578B"},{default:V(()=>[R(f,{modelValue:D(n).type,"onUpdate:modelValue":d[0]||(d[0]=E=>D(n).type=E),onChange:l},{default:V(()=>[R(y,{label:"\u666E\u901A\u6D41\u8F6C\u8DEF\u5F84",value:"normal"}),R(y,{label:"\u9ED8\u8BA4\u6D41\u8F6C\u8DEF\u5F84",value:"default"}),R(y,{label:"\u6761\u4EF6\u6D41\u8F6C\u8DEF\u5F84",value:"condition"})]),_:1},8,["modelValue"])]),_:1}),D(n).type==="condition"?(nt(),St(v,{label:"\u6761\u4EF6\u683C\u5F0F",key:"condition"},{default:V(()=>[R(f,{modelValue:D(n).conditionType,"onUpdate:modelValue":d[1]||(d[1]=E=>D(n).conditionType=E)},{default:V(()=>[R(y,{label:"\u8868\u8FBE\u5F0F",value:"expression"}),R(y,{label:"\u811A\u672C",value:"script"})]),_:1},8,["modelValue"])]),_:1})):Tt("",!0),D(n).conditionType&&D(n).conditionType==="expression"?(nt(),St(v,{label:"\u8868\u8FBE\u5F0F",key:"express"},{default:V(()=>[R(g,{modelValue:D(n).body,"onUpdate:modelValue":d[2]||(d[2]=E=>D(n).body=E),style:{width:"192px"},clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):Tt("",!0),D(n).conditionType&&D(n).conditionType==="script"?(nt(),Nt(qe,{key:2},[R(v,{label:"\u811A\u672C\u8BED\u8A00",key:"language"},{default:V(()=>[R(g,{modelValue:D(n).language,"onUpdate:modelValue":d[3]||(d[3]=E=>D(n).language=E),clearable:"",onChange:u},null,8,["modelValue"])]),_:1}),R(v,{label:"\u811A\u672C\u7C7B\u578B",key:"scriptType"},{default:V(()=>[R(f,{modelValue:D(n).scriptType,"onUpdate:modelValue":d[4]||(d[4]=E=>D(n).scriptType=E)},{default:V(()=>[R(y,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(y,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(n).scriptType==="inlineScript"?(nt(),St(v,{label:"\u811A\u672C",key:"body"},{default:V(()=>[R(g,{modelValue:D(n).body,"onUpdate:modelValue":d[5]||(d[5]=E=>D(n).body=E),type:"textarea",clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):Tt("",!0),D(n).scriptType==="externalScript"?(nt(),St(v,{label:"\u8D44\u6E90\u5730\u5740",key:"resource"},{default:V(()=>[R(g,{modelValue:D(n).resource,"onUpdate:modelValue":d[6]||(d[6]=E=>D(n).resource=E),clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):Tt("",!0)],64)):Tt("",!0)]),_:1},8,["model"])])}}}),xT={class:"panel-tab__content"},ET={class:"panel-tab__content--title"},_T={class:"panel-tab__content--title",style:{"padding-top":"8px","margin-top":"8px","border-top":"1px solid #eee"}},wT=ke({name:"SignalAndMassage",__name:"SignalAndMessage",setup(t){const e=td(),n=X([]),i=X([]),r=X(!1),o=X(""),a=X({}),c=X(),l=X(),u=X(),p=vl(()=>o.value==="message"?{title:"\u521B\u5EFA\u6D88\u606F",idLabel:"\u6D88\u606FID",nameLabel:"\u6D88\u606F\u540D\u79F0"}:{title:"\u521B\u5EFA\u4FE1\u53F7",idLabel:"\u4FE1\u53F7ID",nameLabel:"\u4FE1\u53F7\u540D\u79F0"}),d=()=>window==null?void 0:window.bpmnInstances,y=()=>{c.value=d().modeler.getDefinitions().rootElements,l.value={},u.value={},i.value=[],n.value=[],c.value.forEach(g=>{g.$type==="bpmn:Message"&&(l.value[g.id]=!0,i.value.push({...g})),g.$type==="bpmn:Signal"&&(u.value[g.id]=!0,n.value.push({...g}))})},f=g=>{o.value=g,a.value={},r.value=!0},v=()=>{if(o.value==="message"){l.value[a.value.id]&&e.error("\u8BE5\u6D88\u606F\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const g=d().moddle.create("bpmn:Message",a.value);c.value.push(g)}else{u.value[a.value.id]&&e.error("\u8BE5\u4FE1\u53F7\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const g=d().moddle.create("bpmn:Signal",a.value);c.value.push(g)}r.value=!1,y()};return fo(()=>{y()}),(g,b)=>{const E=Fa,S=Cr,w=za,C=$a,B=hn,s=dn,h=Vn,m=xr,_=vo;return nt(),Nt("div",xT,[Ot("div",ET,[Ot("span",null,[R(E,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),b[6]||(b[6]=dt("\u6D88\u606F\u5217\u8868"))]),R(S,{type:"primary",title:"\u521B\u5EFA\u65B0\u6D88\u606F",preIcon:"ep:plus",onClick:b[0]||(b[0]=T=>f("message"))})]),R(C,{data:D(i),border:""},{default:V(()=>[R(w,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),R(w,{label:"\u6D88\u606FID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),R(w,{label:"\u6D88\u606F\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),Ot("div",_T,[Ot("span",null,[R(E,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),b[7]||(b[7]=dt("\u4FE1\u53F7\u5217\u8868"))]),R(S,{type:"primary",title:"\u521B\u5EFA\u65B0\u4FE1\u53F7",preIcon:"ep:plus",onClick:b[1]||(b[1]=T=>f("signal"))})]),R(C,{data:D(n),border:""},{default:V(()=>[R(w,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),R(w,{label:"\u4FE1\u53F7ID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),R(w,{label:"\u4FE1\u53F7\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),R(_,{modelValue:D(r),"onUpdate:modelValue":b[5]||(b[5]=T=>We(r)?r.value=T:null),title:D(p).title,"close-on-click-modal":!1,width:"400px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(m,{onClick:b[4]||(b[4]=T=>r.value=!1)},{default:V(()=>b[8]||(b[8]=[dt("\u53D6 \u6D88")])),_:1}),R(m,{type:"primary",onClick:v},{default:V(()=>b[9]||(b[9]=[dt("\u4FDD \u5B58")])),_:1})]),default:V(()=>[R(h,{model:D(a),"label-width":"90px"},{default:V(()=>[R(s,{label:D(p).idLabel},{default:V(()=>[R(B,{modelValue:D(a).id,"onUpdate:modelValue":b[2]||(b[2]=T=>D(a).id=T),clearable:""},null,8,["modelValue"])]),_:1},8,["label"]),R(s,{label:D(p).nameLabel},{default:V(()=>[R(B,{modelValue:D(a).name,"onUpdate:modelValue":b[3]||(b[3]=T=>D(a).name=T),clearable:""},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["modelValue","title"])])}}}),mr=()=>window==null?void 0:window.bpmnInstances;function Fb(t,e,n){const i=Object.create(null);switch(i.event=t.event,e&&(i.id=t.id),t.listenerType){case"scriptListener":i.script=function(r,o){const{scriptType:a,scriptFormat:c,value:l,resource:u}=r,p=a==="inlineScript"?{scriptFormat:c,value:l}:{scriptFormat:c,resource:u};return mr().moddle.create(`${o}:Script`,p)}(t,n);break;case"expressionListener":i.expression=t.expression;break;case"delegateExpressionListener":i.delegateExpression=t.delegateExpression;break;default:i.class=t.class}if(t.fields&&(i.fields=t.fields.map(r=>function(o,a){const{name:c,fieldType:l,string:u,expression:p}=o,d=l==="string"?{name:c,string:u}:{name:c,expression:p};return mr().moddle.create(`${a}:Field`,d)}(r,n))),e&&t.event==="timeout"&&t.eventDefinitionType){const r=mr().moddle.create("bpmn:FormalExpression",{body:t.eventTimeDefinitions}),o=mr().moddle.create("bpmn:TimerEventDefinition",{id:`TimerEventDefinition_${ST(8)}`,[`time${t.eventDefinitionType.replace(/^\S/,a=>a.toUpperCase())}`]:r});i.eventDefinitions=[o]}return mr().moddle.create(`${n}:${e?"TaskListener":"ExecutionListener"}`,i)}function nl(t,e){const n=mr().moddle.create("bpmn:ExtensionElements",{values:e});mr().modeling.updateProperties(Bt(t),{extensionElements:n})}function ST(t=8,e){let n="";const i=e||"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=t;r>0;--r)n+=i[Math.floor(Math.random()*i.length)];return n}function zb(t){let e={...t};if(t.script&&(e={...t,...t.script,scriptType:t.script.resource?"externalScript":"inlineScript"}),t.event==="timeout"&&t.eventDefinitions&&t.eventDefinitions.length){let n="";for(const i in t.eventDefinitions[0])i.indexOf("time")!==-1&&(n=i,e.eventDefinitionType=i.replace("time","").toLowerCase());e.eventTimeDefinitions=t.eventDefinitions[0][n].body}return e}function $b(t){let e;return t.class&&(e="classListener"),t.expression&&(e="expressionListener"),t.delegateExpression&&(e="delegateExpressionListener"),t.script&&(e="scriptListener"),{...JSON.parse(JSON.stringify(t)),...t.script??{},listenerType:e}}const Gb={classListener:"Java \u7C7B",expressionListener:"\u8868\u8FBE\u5F0F",delegateExpressionListener:"\u4EE3\u7406\u8868\u8FBE\u5F0F",scriptListener:"\u811A\u672C"},CT={create:"\u521B\u5EFA",assignment:"\u6307\u6D3E",complete:"\u5B8C\u6210",delete:"\u5220\u9664",update:"\u66F4\u65B0",timeout:"\u8D85\u65F6"},Ub={string:"\u5B57\u7B26\u4E32",expression:"\u8868\u8FBE\u5F0F"},TT={class:"panel-tab__content"},AT={class:"element-drawer__button"},kT={class:"listener-filed__title"},PT={class:"element-drawer__button"},MT=ke({name:"ElementListeners",__name:"ElementListeners",props:{id:String,type:String},setup(t){const e=t,n=Sr("prefix"),i=Sr("width"),r=X([]),o=X({}),a=X(!1),c=X([]),l=X({}),u=X(!1),p=X(-1),d=X(-1),y=X(Gb),f=X(Ub),v=X(),g=X(),b=X(),E=X(),S=X(),w=()=>{var m,_,T;v.value=(window==null?void 0:window.bpmnInstances).bpmnElement,g.value=[],b.value=((T=(_=(m=v.value.businessObject)==null?void 0:m.extensionElements)==null?void 0:_.values)==null?void 0:T.filter(M=>M.$type===`${n}:ExecutionListener`))??[],r.value=b.value.map(M=>$b(M))},C=(m,_)=>{m?(o.value=zb(m),p.value=_):(o.value={},p.value=-1),m&&m.fields?c.value=m.fields.map(T=>({...T,fieldType:T.string?"string":"expression"})):(c.value=[],o.value.fields=[]),a.value=!0,Ne(()=>{E.value&&E.value.clearValidate()})},B=(m,_)=>{l.value=m?JSON.parse(JSON.stringify(m)):{},d.value=m?_:-1,u.value=!0,Ne(()=>{S.value&&S.value.clearValidate()})},s=async()=>{await S.value.validate()&&(d.value===-1?(c.value.push(l.value),o.value.fields.push(l.value)):(c.value.splice(d.value,1,l.value),o.value.fields.splice(d.value,1,l.value)),u.value=!1,Ne(()=>{l.value={}}))},h=async()=>{var _,T,M;if(!await E.value.validate())return;const m=Fb(o.value,!1,n);p.value===-1?(b.value.push(m),r.value.push(o.value)):(b.value.splice(p.value,1,m),r.value.splice(p.value,1,o.value)),g.value=((M=(T=(_=v.value.businessObject)==null?void 0:_.extensionElements)==null?void 0:T.values)==null?void 0:M.filter(I=>I.$type!==`${n}:ExecutionListener`))??[],nl(v.value,g.value.concat(b.value)),a.value=!1,o.value={}};return le(()=>e.id,m=>{m&&m.length&&Ne(()=>{w()})},{immediate:!0}),(m,_)=>{const T=za,M=xr,I=gl,$=$a,P=Cr,x=Er,N=_r,j=dn,G=hn,W=Vn,tt=Fa,it=ed,at=vo;return nt(),Nt("div",TT,[R($,{data:D(r),size:"small",border:""},{default:V(()=>[R(T,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(T,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"100px",prop:"event"}),R(T,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"100px","show-overflow-tooltip":"",formatter:H=>D(y)[H.listenerType]},null,8,["formatter"]),R(T,{label:"\u64CD\u4F5C",width:"100px"},{default:V(H=>[R(M,{size:"small",link:"",onClick:q=>C(H.row,H.$index)},{default:V(()=>_[19]||(_[19]=[dt("\u7F16\u8F91")])),_:2},1032,["onClick"]),R(I,{direction:"vertical"}),R(M,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:q=>(jt=>{br.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{b.value.splice(jt,1),r.value.splice(jt,1),nl(v.value,g.value.concat(b.value))}).catch(()=>{})})(H.$index)},{default:V(()=>_[20]||(_[20]=[dt("\u79FB\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ot("div",AT,[R(P,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:_[0]||(_[0]=H=>C(null))})]),R(it,{modelValue:D(a),"onUpdate:modelValue":_[12]||(_[12]=H=>We(a)?a.value=H:null),title:"\u6267\u884C\u76D1\u542C\u5668",size:`${D(i)}px`,"append-to-body":"","destroy-on-close":""},{default:V(()=>[R(W,{model:D(o),"label-width":"96px",ref_key:"listenerFormRef",ref:E},{default:V(()=>[R(j,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(N,{modelValue:D(o).event,"onUpdate:modelValue":_[1]||(_[1]=H=>D(o).event=H)},{default:V(()=>[R(x,{label:"start",value:"start"}),R(x,{label:"end",value:"end"})]),_:1},8,["modelValue"])]),_:1}),R(j,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(N,{modelValue:D(o).listenerType,"onUpdate:modelValue":_[2]||(_[2]=H=>D(o).listenerType=H)},{default:V(()=>[(nt(!0),Nt(qe,null,wr(Object.keys(D(y)),H=>(nt(),St(x,{key:H,label:D(y)[H],value:H},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(o).listenerType==="classListener"?(nt(),St(j,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(o).class,"onUpdate:modelValue":_[3]||(_[3]=H=>D(o).class=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(o).listenerType==="expressionListener"?(nt(),St(j,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(o).expression,"onUpdate:modelValue":_[4]||(_[4]=H=>D(o).expression=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(o).listenerType==="delegateExpressionListener"?(nt(),St(j,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(o).delegateExpression,"onUpdate:modelValue":_[5]||(_[5]=H=>D(o).delegateExpression=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(o).listenerType==="scriptListener"?(nt(),Nt(qe,{key:3},[R(j,{label:"\u811A\u672C\u683C\u5F0F",prop:"scriptFormat",key:"listener-script-format",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u683C\u5F0F"}},{default:V(()=>[R(G,{modelValue:D(o).scriptFormat,"onUpdate:modelValue":_[6]||(_[6]=H=>D(o).scriptFormat=H),clearable:""},null,8,["modelValue"])]),_:1}),R(j,{label:"\u811A\u672C\u7C7B\u578B",prop:"scriptType",key:"listener-script-type",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u9009\u62E9\u811A\u672C\u7C7B\u578B"}},{default:V(()=>[R(N,{modelValue:D(o).scriptType,"onUpdate:modelValue":_[7]||(_[7]=H=>D(o).scriptType=H)},{default:V(()=>[R(x,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(x,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(o).scriptType==="inlineScript"?(nt(),St(j,{label:"\u811A\u672C\u5185\u5BB9",prop:"value",key:"listener-script",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u5185\u5BB9"}},{default:V(()=>[R(G,{modelValue:D(o).value,"onUpdate:modelValue":_[8]||(_[8]=H=>D(o).value=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(o).scriptType==="externalScript"?(nt(),St(j,{label:"\u8D44\u6E90\u5730\u5740",prop:"resource",key:"listener-resource",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u8D44\u6E90\u5730\u5740"}},{default:V(()=>[R(G,{modelValue:D(o).resource,"onUpdate:modelValue":_[9]||(_[9]=H=>D(o).resource=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0)],64)):Tt("",!0)]),_:1},8,["model"]),R(I),Ot("p",kT,[Ot("span",null,[R(tt,{icon:"ep:menu"}),_[21]||(_[21]=dt("\u6CE8\u5165\u5B57\u6BB5\uFF1A"))]),R(P,{type:"primary",onClick:_[10]||(_[10]=H=>B(null)),title:"\u6DFB\u52A0\u5B57\u6BB5"})]),R($,{data:D(c),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:V(()=>[R(T,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(T,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),R(T,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:H=>D(f)[H.fieldType]},null,8,["formatter"]),R(T,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:H=>H.string||H.expression},null,8,["formatter"]),R(T,{label:"\u64CD\u4F5C",width:"130px"},{default:V(H=>[R(M,{size:"small",link:"",onClick:q=>B(H.row,H.$index)},{default:V(()=>_[22]||(_[22]=[dt("\u7F16\u8F91")])),_:2},1032,["onClick"]),R(I,{direction:"vertical"}),R(M,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:q=>(jt=>{br.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{c.value.splice(jt,1),o.value.fields.splice(jt,1)}).catch(()=>{})})(H.$index)},{default:V(()=>_[23]||(_[23]=[dt("\u79FB\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ot("div",PT,[R(M,{onClick:_[11]||(_[11]=H=>a.value=!1)},{default:V(()=>_[24]||(_[24]=[dt("\u53D6 \u6D88")])),_:1}),R(M,{type:"primary",onClick:h},{default:V(()=>_[25]||(_[25]=[dt("\u4FDD \u5B58")])),_:1})])]),_:1},8,["modelValue","size"]),R(at,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:D(u),"onUpdate:modelValue":_[18]||(_[18]=H=>We(u)?u.value=H:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(M,{size:"small",onClick:_[17]||(_[17]=H=>u.value=!1)},{default:V(()=>_[26]||(_[26]=[dt("\u53D6 \u6D88")])),_:1}),R(M,{size:"small",type:"primary",onClick:s},{default:V(()=>_[27]||(_[27]=[dt("\u786E \u5B9A")])),_:1})]),default:V(()=>[R(W,{model:D(l),"label-width":"96spx",ref_key:"listenerFieldFormRef",ref:S,style:{height:"136px"}},{default:V(()=>[R(j,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(l).name,"onUpdate:modelValue":_[13]||(_[13]=H=>D(l).name=H),clearable:""},null,8,["modelValue"])]),_:1}),R(j,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(N,{modelValue:D(l).fieldType,"onUpdate:modelValue":_[14]||(_[14]=H=>D(l).fieldType=H)},{default:V(()=>[(nt(!0),Nt(qe,null,wr(Object.keys(D(f)),H=>(nt(),St(x,{key:H,label:D(f)[H],value:H},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(l).fieldType==="string"?(nt(),St(j,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(l).string,"onUpdate:modelValue":_[15]||(_[15]=H=>D(l).string=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(l).fieldType==="expression"?(nt(),St(j,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(l).expression,"onUpdate:modelValue":_[16]||(_[16]=H=>D(l).expression=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),RT={class:"panel-tab__content"},NT={class:"element-drawer__button"},IT=ke({name:"ElementProperties",__name:"ElementProperties",props:{id:String,type:String},setup(t){const e=t,n=Sr("prefix"),i=X([]),r=X({}),o=X(-1),a=X(!1),c=X(),l=X(),u=X(),p=X(),d=X(),y=()=>window==null?void 0:window.bpmnInstances,f=()=>{var E,S;c.value=y().bpmnElement,l.value=[],u.value=((S=(E=c.value.businessObject)==null?void 0:E.extensionElements)==null?void 0:S.values.filter(w=>(w.$type!==`${n}:Properties`&&l.value.push(w),w.$type===`${n}:Properties`)))??[],p.value=u.value.reduce((w,C)=>w.concat(C.values),[]),i.value=JSON.parse(JSON.stringify(p.value??[]))},v=(E,S)=>{o.value=S,r.value=S===-1?{}:JSON.parse(JSON.stringify(E)),a.value=!0,Ne(()=>{d.value&&d.value.clearValidate()})},g=()=>{const{name:E,value:S}=r.value;if(o.value!==-1)y().modeling.updateModdleProperties(Bt(c.value),Bt(p.value)[Bt(o.value)],{name:E,value:S});else{const w=y().moddle.create(`${n}:Property`,{name:E,value:S}),C=y().moddle.create(`${n}:Properties`,{values:p.value.concat([w])});b(C)}a.value=!1,f()},b=E=>{const S=y().moddle.create("bpmn:ExtensionElements",{values:l.value.concat([E])});y().modeling.updateProperties(Bt(c.value),{extensionElements:S})};return le(()=>e.id,E=>{E&&E&&E.length&&f()},{immediate:!0}),(E,S)=>{const w=za,C=xr,B=gl,s=$a,h=Cr,m=hn,_=dn,T=Vn,M=vo;return nt(),Nt("div",RT,[R(s,{data:D(i),"max-height":"240",fit:"",border:""},{default:V(()=>[R(w,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(w,{label:"\u5C5E\u6027\u540D",prop:"name","min-width":"100px","show-overflow-tooltip":""}),R(w,{label:"\u5C5E\u6027\u503C",prop:"value","min-width":"100px","show-overflow-tooltip":""}),R(w,{label:"\u64CD\u4F5C",width:"110px"},{default:V(I=>[R(C,{link:"",onClick:$=>v(I.row,I.$index),size:"small"},{default:V(()=>S[5]||(S[5]=[dt(" \u7F16\u8F91 ")])),_:2},1032,["onClick"]),R(B,{direction:"vertical"}),R(C,{link:"",size:"small",style:{color:"#ff4d4f"},onClick:$=>((P,x)=>{br.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5C5E\u6027\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{i.value.splice(x,1),p.value.splice(x,1);const N=y().moddle.create(`${n}:Properties`,{values:p.value});b(N),f()}).catch(()=>{})})(I.row,I.$index)},{default:V(()=>S[6]||(S[6]=[dt(" \u79FB\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ot("div",NT,[R(h,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u5C5E\u6027",onClick:S[0]||(S[0]=I=>v(null,-1))})]),R(M,{modelValue:D(a),"onUpdate:modelValue":S[4]||(S[4]=I=>We(a)?a.value=I:null),title:"\u5C5E\u6027\u914D\u7F6E",width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(C,{onClick:S[3]||(S[3]=I=>a.value=!1)},{default:V(()=>S[7]||(S[7]=[dt("\u53D6 \u6D88")])),_:1}),R(C,{type:"primary",onClick:g},{default:V(()=>S[8]||(S[8]=[dt("\u786E \u5B9A")])),_:1})]),default:V(()=>[R(T,{model:D(r),"label-width":"80px",ref_key:"attributeFormRef",ref:d},{default:V(()=>[R(_,{label:"\u5C5E\u6027\u540D\uFF1A",prop:"name"},{default:V(()=>[R(m,{modelValue:D(r).name,"onUpdate:modelValue":S[1]||(S[1]=I=>D(r).name=I),clearable:""},null,8,["modelValue"])]),_:1}),R(_,{label:"\u5C5E\u6027\u503C\uFF1A",prop:"value"},{default:V(()=>[R(m,{modelValue:D(r).value,"onUpdate:modelValue":S[2]||(S[2]=I=>D(r).value=I),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),DT={class:"panel-tab__content"},BT={class:"element-drawer__button"},OT={class:"listener-filed__title"},LT={class:"element-drawer__button"},jT=ke({name:"UserTaskListeners",__name:"UserTaskListeners",props:{id:String,type:String},setup(t){const e=t,n=Sr("prefix"),i=Sr("width"),r=X([]),o=X(CT),a=X(Gb),c=X(!1),l=X({}),u=X(Ub),p=X([]),d=X(!1),y=X(-1),f=X(-1),v=X({}),g=X(),b=X(),E=X(),S=X(),w=X(),C=()=>{var _,T;g.value=(window==null?void 0:window.bpmnInstances).bpmnElement,E.value=[],b.value=((T=(_=g.value.businessObject)==null?void 0:_.extensionElements)==null?void 0:T.values.filter(M=>M.$type===`${n}:TaskListener`))??[],r.value=b.value.map(M=>$b(M))},B=(_,T)=>{_?(l.value=zb(_),y.value=T):(l.value={},y.value=-1),_&&_.fields?p.value=_.fields.map(M=>({...M,fieldType:M.string?"string":"expression"})):(p.value=[],l.value.fields=[]),c.value=!0,Ne(()=>{S.value&&S.value.clearValidate()})},s=async()=>{var T,M,I;if(!await S.value.validate())return;const _=Fb(l.value,!0,n);y.value===-1?(b.value.push(_),r.value.push(l.value)):(b.value.splice(y.value,1,_),r.value.splice(y.value,1,l.value)),E.value=((I=(M=(T=g.value.businessObject)==null?void 0:T.extensionElements)==null?void 0:M.values)==null?void 0:I.filter($=>$.$type!==`${n}:TaskListener`))??[],nl(g.value,E.value.concat(b.value)),c.value=!1,l.value={}},h=(_,T)=>{v.value=_?JSON.parse(JSON.stringify(_)):{},f.value=_?T:-1,d.value=!0,Ne(()=>{w.value&&w.value.clearValidate()})},m=async()=>{await w.value.validate()&&(f.value===-1?(p.value.push(v.value),l.value.fields.push(v.value)):(p.value.splice(f.value,1,v.value),l.value.fields.splice(f.value,1,v.value)),d.value=!1,Ne(()=>{v.value={}}))};return le(()=>e.id,_=>{_&&_.length&&Ne(()=>{C()})},{immediate:!0}),(_,T)=>{const M=za,I=xr,$=gl,P=$a,x=Cr,N=Er,j=_r,G=dn,W=hn,tt=Vn,it=Fa,at=ed,H=vo;return nt(),Nt("div",DT,[R(P,{data:D(r),size:"small",border:""},{default:V(()=>[R(M,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(M,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:q=>D(o)[q.event]},null,8,["formatter"]),R(M,{label:"\u4E8B\u4EF6id","min-width":"80px",prop:"id","show-overflow-tooltip":""}),R(M,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:q=>D(a)[q.listenerType]},null,8,["formatter"]),R(M,{label:"\u64CD\u4F5C",width:"90px"},{default:V(q=>[R(I,{size:"small",link:"",onClick:jt=>B(q.row,q.$index)},{default:V(()=>T[22]||(T[22]=[dt("\u7F16\u8F91")])),_:2},1032,["onClick"]),R($,{direction:"vertical"}),R(I,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:jt=>((Ht,he)=>{br.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{b.value.splice(he,1),r.value.splice(he,1),nl(g.value,E.value.concat(b.value))}).catch(()=>{})})(q.row,q.$index)},{default:V(()=>T[23]||(T[23]=[dt("\u79FB\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ot("div",BT,[R(x,{size:"small",type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:T[0]||(T[0]=q=>B(null))})]),R(at,{modelValue:D(c),"onUpdate:modelValue":T[15]||(T[15]=q=>We(c)?c.value=q:null),title:"\u4EFB\u52A1\u76D1\u542C\u5668",size:`${D(i)}px`,"append-to-body":"","destroy-on-close":""},{default:V(()=>[R(tt,{size:"small",model:D(l),"label-width":"96px",ref_key:"listenerFormRef",ref:S},{default:V(()=>[R(G,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(j,{modelValue:D(l).event,"onUpdate:modelValue":T[1]||(T[1]=q=>D(l).event=q)},{default:V(()=>[(nt(!0),Nt(qe,null,wr(Object.keys(D(o)),q=>(nt(),St(N,{key:q,label:D(o)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),R(G,{label:"\u76D1\u542C\u5668ID",prop:"id",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(l).id,"onUpdate:modelValue":T[2]||(T[2]=q=>D(l).id=q),clearable:""},null,8,["modelValue"])]),_:1}),R(G,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(j,{modelValue:D(l).listenerType,"onUpdate:modelValue":T[3]||(T[3]=q=>D(l).listenerType=q)},{default:V(()=>[(nt(!0),Nt(qe,null,wr(Object.keys(D(a)),q=>(nt(),St(N,{key:q,label:D(a)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(l).listenerType==="classListener"?(nt(),St(G,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(l).class,"onUpdate:modelValue":T[4]||(T[4]=q=>D(l).class=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(l).listenerType==="expressionListener"?(nt(),St(G,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(l).expression,"onUpdate:modelValue":T[5]||(T[5]=q=>D(l).expression=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(l).listenerType==="delegateExpressionListener"?(nt(),St(G,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(l).delegateExpression,"onUpdate:modelValue":T[6]||(T[6]=q=>D(l).delegateExpression=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(l).listenerType==="scriptListener"?(nt(),Nt(qe,{key:3},[R(G,{label:"\u811A\u672C\u683C\u5F0F",prop:"scriptFormat",key:"listener-script-format",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u683C\u5F0F"}},{default:V(()=>[R(W,{modelValue:D(l).scriptFormat,"onUpdate:modelValue":T[7]||(T[7]=q=>D(l).scriptFormat=q),clearable:""},null,8,["modelValue"])]),_:1}),R(G,{label:"\u811A\u672C\u7C7B\u578B",prop:"scriptType",key:"listener-script-type",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u9009\u62E9\u811A\u672C\u7C7B\u578B"}},{default:V(()=>[R(j,{modelValue:D(l).scriptType,"onUpdate:modelValue":T[8]||(T[8]=q=>D(l).scriptType=q)},{default:V(()=>[R(N,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(N,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(l).scriptType==="inlineScript"?(nt(),St(G,{label:"\u811A\u672C\u5185\u5BB9",prop:"value",key:"listener-script",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u5185\u5BB9"}},{default:V(()=>[R(W,{modelValue:D(l).value,"onUpdate:modelValue":T[9]||(T[9]=q=>D(l).value=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(l).scriptType==="externalScript"?(nt(),St(G,{label:"\u8D44\u6E90\u5730\u5740",prop:"resource",key:"listener-resource",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u8D44\u6E90\u5730\u5740"}},{default:V(()=>[R(W,{modelValue:D(l).resource,"onUpdate:modelValue":T[10]||(T[10]=q=>D(l).resource=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0)],64)):Tt("",!0),D(l).event==="timeout"?(nt(),Nt(qe,{key:4},[R(G,{label:"\u5B9A\u65F6\u5668\u7C7B\u578B",prop:"eventDefinitionType",key:"eventDefinitionType"},{default:V(()=>[R(j,{modelValue:D(l).eventDefinitionType,"onUpdate:modelValue":T[11]||(T[11]=q=>D(l).eventDefinitionType=q)},{default:V(()=>[R(N,{label:"\u65E5\u671F",value:"date"}),R(N,{label:"\u6301\u7EED\u65F6\u957F",value:"duration"}),R(N,{label:"\u5FAA\u73AF",value:"cycle"}),R(N,{label:"\u65E0",value:"null"})]),_:1},8,["modelValue"])]),_:1}),D(l).eventDefinitionType&&D(l).eventDefinitionType!=="null"?(nt(),St(G,{label:"\u5B9A\u65F6\u5668",prop:"eventTimeDefinitions",key:"eventTimeDefinitions",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u5B9A\u65F6\u5668\u914D\u7F6E"}},{default:V(()=>[R(W,{modelValue:D(l).eventTimeDefinitions,"onUpdate:modelValue":T[12]||(T[12]=q=>D(l).eventTimeDefinitions=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0)],64)):Tt("",!0)]),_:1},8,["model"]),R($),Ot("p",OT,[Ot("span",null,[R(it,{icon:"ep:menu"}),T[24]||(T[24]=dt("\u6CE8\u5165\u5B57\u6BB5\uFF1A"))]),R(I,{size:"small",type:"primary",onClick:T[13]||(T[13]=q=>h(null))},{default:V(()=>T[25]||(T[25]=[dt("\u6DFB\u52A0\u5B57\u6BB5")])),_:1})]),R(P,{data:D(p),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:V(()=>[R(M,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(M,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),R(M,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:q=>D(u)[q.fieldType]},null,8,["formatter"]),R(M,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:q=>q.string||q.expression},null,8,["formatter"]),R(M,{label:"\u64CD\u4F5C",width:"100px"},{default:V(q=>[R(I,{size:"small",link:"",onClick:jt=>h(q.row,q.$index)},{default:V(()=>T[26]||(T[26]=[dt("\u7F16\u8F91")])),_:2},1032,["onClick"]),R($,{direction:"vertical"}),R(I,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:jt=>((Ht,he)=>{br.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{p.value.splice(he,1),l.value.fields.splice(he,1)}).catch(()=>{})})(q.row,q.$index)},{default:V(()=>T[27]||(T[27]=[dt("\u79FB\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ot("div",LT,[R(I,{size:"small",onClick:T[14]||(T[14]=q=>c.value=!1)},{default:V(()=>T[28]||(T[28]=[dt("\u53D6 \u6D88")])),_:1}),R(I,{size:"small",type:"primary",onClick:s},{default:V(()=>T[29]||(T[29]=[dt("\u4FDD \u5B58")])),_:1})])]),_:1},8,["modelValue","size"]),R(H,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:D(d),"onUpdate:modelValue":T[21]||(T[21]=q=>We(d)?d.value=q:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(I,{size:"small",onClick:T[20]||(T[20]=q=>d.value=!1)},{default:V(()=>T[30]||(T[30]=[dt("\u53D6 \u6D88")])),_:1}),R(I,{size:"small",type:"primary",onClick:m},{default:V(()=>T[31]||(T[31]=[dt("\u786E \u5B9A")])),_:1})]),default:V(()=>[R(tt,{model:D(v),size:"small","label-width":"96px",ref_key:"listenerFieldFormRef",ref:w,style:{height:"136px"}},{default:V(()=>[R(G,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(v).name,"onUpdate:modelValue":T[16]||(T[16]=q=>D(v).name=q),clearable:""},null,8,["modelValue"])]),_:1}),R(G,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(j,{modelValue:D(v).fieldType,"onUpdate:modelValue":T[17]||(T[17]=q=>D(v).fieldType=q)},{default:V(()=>[(nt(!0),Nt(qe,null,wr(Object.keys(D(u)),q=>(nt(),St(N,{key:q,label:D(u)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(v).fieldType==="string"?(nt(),St(G,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(v).string,"onUpdate:modelValue":T[18]||(T[18]=q=>D(v).string=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(v).fieldType==="expression"?(nt(),St(G,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(v).expression,"onUpdate:modelValue":T[19]||(T[19]=q=>D(v).expression=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),il=ke({name:"MyPropertiesPanel",__name:"PropertiesPanel",props:{bpmnModeler:{type:Object,default:()=>{}},prefix:{type:String,default:"camunda"},width:{type:Number,default:480},idEditDisabled:{type:Boolean,default:!1},model:Object},setup(t){const e=t,n=X("base"),i=X(""),r=X(""),o=X({}),a=X(!1),c=X(!1),l=X();ja("prefix",e.prefix),ja("width",e.width);const u=()=>window==null?void 0:window.bpmnInstances,p=le(()=>e.bpmnModeler,()=>{e.bpmnModeler&&(window.bpmnInstances={modeler:e.bpmnModeler,modeling:e.bpmnModeler.get("modeling"),moddle:e.bpmnModeler.get("moddle"),eventBus:e.bpmnModeler.get("eventBus"),bpmnFactory:e.bpmnModeler.get("bpmnFactory"),elementFactory:e.bpmnModeler.get("elementFactory"),elementRegistry:e.bpmnModeler.get("elementRegistry"),replace:e.bpmnModeler.get("replace"),selection:e.bpmnModeler.get("selection")},d(),p())},{immediate:!0}),d=()=>{y(null),e.bpmnModeler.on("import.done",f=>{y(null)}),e.bpmnModeler.on("selection.changed",({newSelection:f})=>{y(f[0]||null)}),e.bpmnModeler.on("element.changed",({element:f})=>{f&&f.id===i.value&&y(f)})},y=f=>{let v=f;v||(v=u().elementRegistry.find(g=>g.type==="bpmn:Process")??u().elementRegistry.find(g=>g.type==="bpmn:Collaboration")),v&&(u().bpmnElement=v,l.value=v,i.value=v.id,r.value=v.type.split(":")[1]||"",o.value=JSON.parse(JSON.stringify(v.businessObject)),a.value=!(r.value!=="SequenceFlow"||!v.source||v.source.type.indexOf("StartEvent")!==-1),c.value=r.value==="UserTask"||r.value==="StartEvent")};return wn(()=>{window.bpmnInstances=null}),le(()=>i.value,()=>{n.value="base"}),(f,v)=>{const g=Fa,b=l0,E=bl,S=Zh("router-link"),w=u0;return nt(),Nt("div",{class:"process-panel__container",style:a0({width:`${t.width}px`})},[R(w,{modelValue:D(n),"onUpdate:modelValue":v[0]||(v[0]=C=>We(n)?n.value=C:null)},{default:V(()=>[R(b,{name:"base"},{title:V(()=>[R(g,{icon:"ep:info-filled"}),v[1]||(v[1]=dt(" \u5E38\u89C4"))]),default:V(()=>[R(nT,{"id-edit-disabled":t.idEditDisabled,"business-object":D(o),type:D(r),model:t.model},null,8,["id-edit-disabled","business-object","type","model"])]),_:1}),D(r)==="Process"?(nt(),St(b,{name:"condition",key:"message"},{title:V(()=>[R(g,{icon:"ep:comment"}),v[2]||(v[2]=dt("\u6D88\u606F\u4E0E\u4FE1\u53F7"))]),default:V(()=>[R(wT)]),_:1})):Tt("",!0),D(a)?(nt(),St(b,{name:"condition",key:"condition"},{title:V(()=>[R(g,{icon:"ep:promotion"}),v[3]||(v[3]=dt("\u6D41\u8F6C\u6761\u4EF6"))]),default:V(()=>[R(bT,{"business-object":D(o),type:D(r)},null,8,["business-object","type"])]),_:1})):Tt("",!0),D(c)?(nt(),St(b,{name:"condition",key:"form"},{title:V(()=>[R(g,{icon:"ep:list"}),v[4]||(v[4]=dt("\u8868\u5355"))]),default:V(()=>[v[6]||(v[6]=dt(" \u53CB\u60C5\u63D0\u793A\uFF1A\u4F7F\u7528 ")),R(S,{to:{path:"/bpm/manager/form"}},{default:V(()=>[R(E,{type:"danger"},{default:V(()=>v[5]||(v[5]=[dt("\u6D41\u7A0B\u8868\u5355")])),_:1})]),_:1}),v[7]||(v[7]=dt(" \u66FF\u4EE3\uFF0C\u63D0\u4F9B\u66F4\u597D\u7684\u8868\u5355\u8BBE\u8BA1\u529F\u80FD "))]),_:1})):Tt("",!0),D(r).indexOf("Task")!==-1?(nt(),St(b,{name:"task",key:"task"},{title:V(()=>[R(g,{icon:"ep:checked"}),v[8]||(v[8]=dt("\u4EFB\u52A1"))]),default:V(()=>[R(fT,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1})):Tt("",!0),D(r).indexOf("Task")!==-1?(nt(),St(b,{name:"multiInstance",key:"multiInstance"},{title:V(()=>[R(g,{icon:"ep:help-filled"}),v[9]||(v[9]=dt("\u591A\u5B9E\u4F8B"))]),default:V(()=>[R(yT,{"business-object":D(o),type:D(r)},null,8,["business-object","type"])]),_:1})):Tt("",!0),R(b,{name:"listeners",key:"listeners"},{title:V(()=>[R(g,{icon:"ep:bell-filled"}),v[10]||(v[10]=dt("\u6267\u884C\u76D1\u542C\u5668"))]),default:V(()=>[R(MT,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1}),D(r)==="UserTask"?(nt(),St(b,{name:"taskListeners",key:"taskListeners"},{title:V(()=>[R(g,{icon:"ep:bell-filled"}),v[11]||(v[11]=dt("\u4EFB\u52A1\u76D1\u542C\u5668"))]),default:V(()=>[R(jT,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1})):Tt("",!0),R(b,{name:"extensions",key:"extensions"},{title:V(()=>[R(g,{icon:"ep:circle-plus-filled"}),v[12]||(v[12]=dt("\u6269\u5C55\u5C5E\u6027"))]),default:V(()=>[R(IT,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1}),R(b,{name:"other",key:"other"},{title:V(()=>[R(g,{icon:"ep:promotion"}),v[13]||(v[13]=dt("\u5176\u4ED6"))]),default:V(()=>[R(aT,{id:D(i)},null,8,["id"])]),_:1})]),_:1},8,["modelValue"])],4)}}});il.install=function(t){t.component(il.name,il)};const VT={class:"my-process-designer"},FT={class:"my-process-designer__container"},rl=ke({name:"MyProcessViewer",__name:"ProcessViewer",props:{value:{type:String,default:""},prefix:{type:String,default:"camunda"},activityData:{type:Array,default:()=>[]},processInstanceData:{type:Object,default:()=>{}},taskData:{type:Array,default:()=>[]}},emits:["destroy"],setup(t,{emit:e}){const n=t;ja("configGlobal",n);const i=e;let r;const o=X(""),a=X([]),c=X(void 0),l=X([]),u=X(),p=X(null),d=X(null),y=async w=>{let C=`Process_${new Date().getTime()}`,B=`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,s=w||qg(C,B,n.prefix);try{let{warnings:h}=await r.importXML(s);h&&h.length&&h.forEach(m=>{}),await f(),r.get("canvas").zoom("fit-viewport","auto")}catch{}},f=async()=>{var _;const w=a.value;if(w.length===0)return;let C=r.get("canvas"),B=w.find(T=>!T.endTime),s=w[w.length-1],h=!1,m=[];(_=r.getDefinitions().rootElements[0].flowElements)==null||_.forEach(T=>{var I,$,P;let M=w.find(x=>x.key===T.id);if(M){if(T.$type==="bpmn:UserTask"){const x=l.value.find(j=>j.id===M.taskId);if(!x)return;if(h)return void m.push(T.id);if(C.addMarker(T.id,g(x.result)),x.result===1&&(h=!0),x.result!==2)return;const N=b(M);N==null||N.forEach(j=>{let G=w.find(W=>W.key===j.targetRef.id);G?C.addMarker(j.id,G.endTime?"highlight":"highlight-todo"):j.targetRef.$type==="bpmn:ExclusiveGateway"?(C.addMarker(j.id,M.endTime?"highlight":"highlight-todo"),C.addMarker(j.targetRef.id,M.endTime?"highlight":"highlight-todo")):j.targetRef.$type==="bpmn:EndEvent"&&(B||s.key!==T.id||(C.addMarker(j.id,"highlight"),C.addMarker(j.targetRef.id,"highlight")),M.endTime||(C.addMarker(j.id,"highlight-todo"),C.addMarker(j.targetRef.id,"highlight-todo")))})}else if(T.$type==="bpmn:ExclusiveGateway"){let x,N;C.addMarker(T.id,v(M)),(I=T.outgoing)==null||I.forEach(j=>{let G=w.find(W=>W.key===j.targetRef.id);G&&(N&&N.type!=="endEvent"||(x=j,N=G))}),x&&N&&C.addMarker(x.id,v(N))}else if(T.$type==="bpmn:ParallelGateway")C.addMarker(T.id,v(M)),($=T.outgoing)==null||$.forEach(x=>{const N=w.find(j=>j.key===x.targetRef.id);N&&(C.addMarker(x.id,v(N)),C.addMarker(x.targetRef.id,v(N)))});else if(T.$type==="bpmn:StartEvent")(P=T.outgoing)==null||P.forEach(x=>{w.find(N=>N.key===x.targetRef.id)&&(C.addMarker(x.id,"highlight"),C.addMarker(T.id,"highlight"))});else if(T.$type==="bpmn:EndEvent"){if(!c.value||c.value.result===1)return;C.addMarker(T.id,g(c.value.result))}else if(T.$type==="bpmn:ServiceTask"&&(M.startTime>0&&M.endTime===0&&C.addMarker(T.id,g(1)),M.endTime>0)){C.addMarker(T.id,g(2));const x=b(M);x==null||x.forEach(N=>{C.addMarker(N.id,g(2))})}}}),s0(m)||(l.value=l.value.filter(T=>!m.includes(T.definitionKey)))},v=w=>w.endTime?"highlight":"highlight-todo",g=w=>w===1?"highlight-todo":w===2?"highlight":w===3?"highlight-reject":w===4?"highlight-cancel":w===5||w===6||w===7||w===8||w===9?"highlight-return":"",b=w=>{if(w.outgoing&&w.outgoing.length>0)return w.outgoing;const C=r.getDefinitions().rootElements[0].flowElements,B=[];return C.forEach(s=>{s.$type==="bpmn:SequenceFlow"&&s.sourceRef.id===w.key&&B.push(s)}),B},E=w=>{var B;w.value=w,!p.value&&(p.value={}),!d.value&&(d.value=r.get("overlays"));const C=a.value.find(s=>s.key===w.value.id);if(C&&!p.value[w.value.id]&&w.value.type!=="bpmn:Process"){let s=`

Elemet id: ${w.value.id}

Elemet type: ${w.value.type}

`;if(w.value.type==="bpmn:StartEvent"&&c.value)s=`

\u53D1\u8D77\u4EBA\uFF1A${c.value.startUser.nickname}

\u90E8\u95E8\uFF1A${c.value.startUser.deptName}

\u521B\u5EFA\u65F6\u95F4\uFF1A${Tr(c.value.createTime)}`;else if(w.value.type==="bpmn:UserTask"){let h=l.value.find(T=>T.id===C.taskId);if(!h)return;let m=nd(id.BPM_PROCESS_INSTANCE_RESULT),_="";m.forEach(T=>{T.value==h.result&&(_=T.label)}),s=`

\u5BA1\u6279\u4EBA\uFF1A${h.assigneeUser.nickname}

\u90E8\u95E8\uFF1A${h.assigneeUser.deptName}

\u7ED3\u679C\uFF1A${_}

\u521B\u5EFA\u65F6\u95F4\uFF1A${Tr(h.createTime)}

`,h.endTime&&(s+=`

\u7ED3\u675F\u65F6\u95F4\uFF1A${Tr(h.endTime)}

`),h.reason&&(s+=`

\u5BA1\u6279\u5EFA\u8BAE\uFF1A${h.reason}

`)}else if(w.value.type==="bpmn:ServiceTask"&&c.value)C.startTime>0&&(s=`

\u521B\u5EFA\u65F6\u95F4\uFF1A${Tr(C.startTime)}

`),C.endTime>0&&(s+=`

\u7ED3\u675F\u65F6\u95F4\uFF1A${Tr(C.endTime)}

`);else if(w.value.type==="bpmn:EndEvent"&&c.value){let h=nd(id.BPM_PROCESS_INSTANCE_RESULT),m="";h.forEach(_=>{_.value==c.value.result&&(m=_.label)}),s=`

\u7ED3\u679C\uFF1A${m}

`,c.value.endTime&&(s+=`

\u7ED3\u675F\u65F6\u95F4\uFF1A${Tr(c.value.endTime)}

`)}p.value[w.value.id]=(B=Bt(d.value))==null?void 0:B.add(w.value,{position:{left:0,bottom:0},html:`
${s}
`})}},S=w=>{Bt(d.value).remove({element:w}),p.value[w.id]=null};return fo(()=>{o.value=n.value,a.value=n.activityData,r||(r=new Wn({container:u.value,bpmnRenderer:{}})),y(o.value),(()=>{const w=r.get("eventBus");w.on("element.hover",function(C){let B=C?C.element:null;E(B)}),w.on("element.out",function(C){let B=C?C.element:null;S(B)})})()}),wn(()=>{r&&r.destroy(),i("destroy",r),r=null}),le(()=>n.value,w=>{o.value=w,y(o.value)}),le(()=>n.activityData,w=>{a.value=w,y(o.value)}),le(()=>n.processInstanceData,w=>{c.value=w,y(o.value)}),le(()=>n.taskData,w=>{l.value=w,y(o.value)}),(w,C)=>(nt(),Nt("div",VT,[Ot("div",FT,[Ot("div",{class:"my-process-designer__canvas",style:{height:"760px"},ref_key:"bpmnCanvas",ref:u},null,512)])]))}});rl.install=function(t){t.component(rl.name,rl)};export{Tc as P,el as _,A as a,jC as b,je as c,Pb as d,Pt as e,Rb as f,wi as g,il as h,wt as i,rl as j};