import{_ as AA,__tla as kA}from"./Dialog-172e53a1.js";import{dx as oo,dv as P0,dF as PA,d as Rt,r as W,bd as ol,Y as $h,dG as MA,q as Ma,aW as jn,M as RA,o as ne,c as De,g as Ve,aC as NA,F as ln,f as R,w as V,a as D,x as Ce,a0 as ke,y as me,t as M0,z as al,l as un,aq as IA,by as ao,at as DA,aF as BA,G as so,_ as Nt,e as OA,aM as mt,bQ as Be,R as wn,C as Sn,H as oi,aj as zt,ag as R0,$ as Gh,A as co,B as lo,v as uo,bk as Ra,aD as LA,aE as jA,aK as VA,a9 as N0,aR as po,I as sl,J as cl,j as ll,bS as Uh,ao as FA,al as zA,__tla as $A}from"./index-327f993b.js";import{_ as GA,__tla as UA}from"./XTextButton-d3c3713c.js";import{_ as ho,__tla as HA}from"./XButton-abaf5fb8.js";import{E as qA,a as WA,__tla as XA}from"./el-collapse-item-a3f6e5f9.js";import{E as Hh,__tla as KA}from"./el-link-5500c0f4.js";import{u as I0,__tla as YA}from"./useMessage-b42f14d5.js";import{E as D0,__tla as JA}from"./el-drawer-9adcf15c.js";import{a as B0,D as O0,__tla as ZA}from"./dict-2cfe41e3.js";import{f as mo,__tla as QA}from"./formatTime-63676a29.js";let Na,Ia,A,L0,It,qh,Me,Wh,ai,Da,we,Ba,ek=Promise.all([(()=>{try{return kA}catch{}})(),(()=>{try{return $A}catch{}})(),(()=>{try{return UA}catch{}})(),(()=>{try{return HA}catch{}})(),(()=>{try{return XA}catch{}})(),(()=>{try{return KA}catch{}})(),(()=>{try{return YA}catch{}})(),(()=>{try{return JA}catch{}})(),(()=>{try{return ZA}catch{}})(),(()=>{try{return QA}catch{}})()]).then(async()=>{var ul={exports:{}};typeof Object.create=="function"?ul.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ul.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};const ie=oo(ul.exports);var Xh,pl,j0=(Xh=function(e){var t=e.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)?t(n,i):c};t.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=t(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}},Xh(pl={exports:{}},pl.exports),pl.exports);function Cn(e){if(!(this instanceof Cn))return new Cn(e);e=e||[128,36,1],this._seed=e.length?j0.rack(e[0],e[1],e[2]):e}function fo(e){return Array.prototype.concat.apply([],e)}Cn.prototype.next=function(e){return this._seed(e||!0)},Cn.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},Cn.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Cn.prototype.assigned=function(e){return this._seed.get(e)||!1},Cn.prototype.unclaim=function(e){delete this._seed.hats[e]},Cn.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var vo=Object.prototype.toString,V0=Object.prototype.hasOwnProperty;function Vn(e){return e===void 0}function Wt(e){return e!==void 0}function yo(e){return e==null}function ge(e){return vo.call(e)==="[object Array]"}function et(e){return vo.call(e)==="[object Object]"}function pe(e){return vo.call(e)==="[object Number]"}function ft(e){var t=vo.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Dt(e){return vo.call(e)==="[object String]"}function Kh(e){if(!ge(e))throw new Error("must supply array")}function Tn(e,t){return V0.call(e,t)}function Pe(e,t){var n;return t=fl(t),L(e,function(i,r){if(t(i,r))return n=i,!1}),n}function hl(e,t){t=fl(t);var n=ge(e)?-1:void 0;return L(e,function(i,r){if(t(i,r))return n=r,!1}),n}function de(e,t){var n=[];return L(e,function(i,r){t(i,r)&&n.push(i)}),n}function L(e,t){var n;if(!Vn(e)){var i=ge(e)?z0:F0;for(var r in e)if(Tn(e,r)&&t(n=e[r],i(r))===!1)return n}}function Yh(e,t){return Vn(e)?[]:(Kh(e),t=fl(t),e.filter(function(n,i){return!t(n,i)}))}function Bt(e,t,n){return L(e,function(i,r){n=t(n,i,r)}),n}function ji(e,t){return!!Bt(e,function(n,i,r){return n&&t(i,r)},!0)}function si(e,t){return!!Pe(e,t)}function lt(e,t){var n=[];return L(e,function(i,r){n.push(t(i,r))}),n}function go(e){return e&&Object.keys(e)||[]}function yr(e){return go(e).length}function Oa(e){return lt(e,function(t){return t})}function Vi(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=ml(t),L(e,function(i){var r=t(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function dl(e){e=ml(e);for(var t={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r0)return c(y);e.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?t-1:0),i=1;i1?n-1:0),r=1;r
a',nd=!xl.getElementsByTagName("link").length,xl=void 0);var at={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:nd?[1,"X
","
"]:[0,"",""]};function Xe(e,t){return(t=t||document).querySelector(e)}function El(e,t){return(t=t||document).querySelectorAll(e)}function An(e){e.parentNode&&e.parentNode.removeChild(e)}function id(e,t){return t.appendChild(function(n,i){if(n.ownerDocument!==i.ownerDocument)try{return i.ownerDocument.importNode(n,!0)}catch{}return n}(e,t))}function le(e,t){return id(t,e),e}at.td=at.th=[3,"","
"],at.option=at.optgroup=[1,'"],at.thead=at.tbody=at.colgroup=at.caption=at.tfoot=[1,"","
"],at.polyline=at.ellipse=at.polygon=at.circle=at.text=at.line=at.path=at.rect=at.g=[1,'',""];var _l=2,rd={"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":_l,"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":_l,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function od(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=rd[i];r?(r===_l&&typeof n=="number"&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function K(e,t,n){if(typeof t=="string"){if(n===void 0)return function(i,r){return rd[r]?i.style[r]:i.getAttributeNS(null,r)}(e,t);od(e,t,n)}else(function(i,r){var o,a,c=Object.keys(r);for(o=0;a=c[o];o++)od(i,a,r[a])})(e,t);return e}function wl(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n"+e+"",t=!0);var n=function(o){var a;return(a=new DOMParser).async=!1,a.parseFromString(o,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function oe(e,t){var n;return e.charAt(0)==="<"?(n=cd(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Tl.svg,e),t&&K(n,t),n}var Al=null;function kl(){return Al===null&&(Al=oe("svg")),Al}function ld(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function bo(e){return e?kl().createSVGTransformFromMatrix(e):kl().createSVGTransform()}var ud=/([&<>]{1})/g,K0=/([\n\r"]{1})/g,Y0={"&":"&","<":"<",">":">",'"':"'"};function Pl(e,t){return e.replace(t,function(n,i){return Y0[i]||i})}function pd(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(Pl(e.textContent,ud));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n"),n=0,i=(a=e.childNodes).length;n")}else t.push("/>");break;case 8:t.push("");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function J0(e,t){var n=cd(t);if(Cl(e),t){(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(Rl(r,f))return r[f];if(Rl(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 t.get(f,v)},l=function(f,v){if(v===void 0&&(v={}),typeof f!="function"){if(!Ml(f))throw new Error('Cannot invoke "'+f+'". Expected a function!');f=Va(f.slice())}return{fn:f,dependencies:(f.$inject||ix(f)).map(function(g){return Rl(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),S=b.fn,w=b.dependencies;return S.apply(v,w)},d=function(f){return Va(function(v){return f.get(v)})},y={factory:p,type:u,value:function(f){return f}};e.forEach(function(f){function v(w,_){return w!=="value"&&Ml(_)&&(_=Va(_.slice())),_}if(f instanceof rx)f.forEach(function(w){var _=w[0],C=w[1],B=w[2];i[_]=[y[C],v(C,B),C]});else if(typeof f=="object")if(f.__exports__){var g=Object.keys(f).reduce(function(w,_){return _.substring(0,2)!=="__"&&(w[_]=f[_]),w},Object.create(null)),b=new Nl((f.__modules__||[]).concat([g]),o),S=Va(function(w){return b.get(w)});f.__exports__.forEach(function(w){i[w]=[S,w,"private",b]})}else Object.keys(f).forEach(function(w){if(f[w][2]!=="private"){var _=f[w][0],C=f[w][1];i[w]=[y[_],v(_,C),_]}else i[w]=f[w]})}),this.get=c,this.invoke=p,this.instantiate=u,this.createChild=function(f,v){if(v&&v.length){var g,b,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?(S=g[3].createChild([],v),w=d(S),B.push(g[3]),s.push(S),h.push(w),_[m]=[w,m,"private",S]):_[m]=[h[b],m,"private",s[b]]:_[m]=[g[2],g[1]],C[m]=!0),g[2]!=="factory"&&g[2]!=="type"||!g[1].$scope||v.forEach(function(E){g[1].$scope.indexOf(E)!==-1&&(_[m]=[g[2],g[1]],C[E]=!0)});v.forEach(function(E){if(!C[E])throw new Error('No provider for "'+E+'". Cannot use provider from the parent!')}),f.unshift(_)}return new Nl(f,o)}}var ox=1e3;function zn(e,t){var n=this;t=t||ox,e.on(["render.shape","render.connection"],t,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)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(i,r){if(n.canRender(r))return i.type==="render.getShapePath"?n.getShapePath(r):n.getConnectionPath(r)})}function br(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function dd(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function Il(e,t){var n=oe("polyline");return K(n,{points:dd(e)}),t&&K(n,t),n}function md(e){return de(e,function(t){return!Pe(e,function(n){return n!==t&&fd(t,n)})})}function fd(e,t){if(t){if(e===t)return t;if(e.parent)return fd(e.parent,t)}}function vd(e,t,n){var i=!n||e.indexOf(t)===-1;return i&&e.push(t),i}function zi(e,t,n){n=n||0,ge(e)||(e=[e]),L(e,function(i,r){var o=t(i,r,n);ge(o)&&o.length&&zi(o,t,n+1)})}function Fa(e,t){return function(n,i,r){var o=[],a=[];return zi(n,function(c,l,u){vd(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 yd(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function gd(e){return!(!e||!e.isFrame)}function Eo(e,t){return z({},e||{},t||{})}zn.prototype.canRender=function(){},zn.prototype.drawShape=function(){},zn.prototype.drawConnection=function(){},zn.prototype.getShapePath=function(){},zn.prototype.getConnectionPath=function(){};function ui(e,t){zn.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}ie(ui,zn),ui.prototype.canRender=function(){return!0},ui.prototype.drawShape=function(e,t,n){var i=oe("rect");return K(i,{x:0,y:0,width:t.width||0,height:t.height||0}),gd(t)?K(i,z({},this.FRAME_STYLE,n||{})):K(i,z({},this.SHAPE_STYLE,n||{})),le(e,i),i},ui.prototype.drawConnection=function(e,t,n){var i=Il(t.waypoints,z({},this.CONNECTION_STYLE,n||{}));return le(e,i),i},ui.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return br([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},ui.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([t===0?"M":"L",n.x,n.y]);return br(r)},ui.$inject=["eventBus","styles"];const ax={__init__:["defaultRenderer"],defaultRenderer:["type",ui],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(n,i,r){return z(this.style(i,r),{class:n})},this.style=function(n,i){ge(n)||i||(i=n,n=[]);var r=Bt(n,function(o,a){return z(o,e[a]||{})},{});return i?z(r,i):r},this.computeStyle=function(n,i,r){return ge(i)||(r=i,i=[]),t.style(i||[],z({},r,n||{}))}}]};function Ye(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function Je(e,t,n){if(e&&t){typeof n!="number"&&(n=-1);var i=e.indexOf(t);if(i!==-1){if(i===n||n===-1)return;e.splice(i,1)}n!==-1?e.splice(n,0,t):e.push(t)}}function Dl(e,t){return e&&t?e.indexOf(t):-1}function _o(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function Bl(e,t,n,i){if(i===void 0&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=_o(e,t);return Math.abs(r/o)<=i}var bd=2;function $n(e,t){var n;return function(i,r){var o;o=ge(i)?i:[i,r];var a=o.slice().shift();return ji(o,function(c){return Math.abs(a.y-c.y)<=bd})}(n=ge(e)?e:[e,t])?"h":!!function(i,r){var o;o=ge(i)?i:[i,r];var a=o.slice().shift();return ji(o,function(c){return Math.abs(a.x-c.x)<=bd})}(n)&&"v"}function xd(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Td(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function Ad(e,t,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=Td(v,e,n,r,a),b=Td(v,t,i,o,c),S=g*g+b*b;y+=d[f]*Ze.sqrt(S)}return u*y}function ux(e,t,n,i,r,o,a,c){if(!(Pn(e,n)Pn(r,a)||Pn(t,i)Pn(o,c))){var l=(e*i-t*n)*(o-c)-(t-i)*(r*c-o*a),u=(e-n)*(o-c)-(t-i)*(r-a);if(u){var p=Ga(((e*i-t*n)*(r-a)-(e-n)*(r*c-o*a))/u),d=Ga(l/u),y=+p.toFixed(2),f=+d.toFixed(2);if(!(y<+kn(e,n).toFixed(2)||y>+Pn(e,n).toFixed(2)||y<+kn(r,a).toFixed(2)||y>+Pn(r,a).toFixed(2)||f<+kn(t,i).toFixed(2)||f>+Pn(t,i).toFixed(2)||f<+kn(o,c).toFixed(2)||f>+Pn(o,c).toFixed(2)))return{x:p,y:d}}}}function Ga(e){return Math.round(1e11*e)/1e11}function px(e,t,n){if(!function(m,E){return m=jl(m),di(E=jl(E),m.x,m.y)||di(E,m.x2,m.y)||di(E,m.x,m.y2)||di(E,m.x2,m.y2)||di(m,E.x,E.y)||di(m,E.x2,E.y)||di(m,E.x,E.y2)||di(m,E.x2,E.y2)||(m.xE.x||E.xm.x)&&(m.yE.y||E.ym.y)}(Cd(e),Cd(t)))return n?0:[];for(var i=Ad.apply(0,e),r=Ad.apply(0,t),o=kd(e)?1:~~(i/5)||1,a=kd(t)?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 hx(e){var t=xr(e);if(t.abs)return $a(t.abs);if(za(e)&&za(e&&e[0])||(e=function(S){if(!S)return null;var w=xr(S);if(w.arr)return wo(w.arr);var _={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},C=[];return za(S)&&za(S[0])&&(C=wo(S)),C.length||String(S).replace(cx,function(B,s,h){var m=[],E=s.toLowerCase();for(h.replace(lx,function(T,M){M&&m.push(+M)}),E=="m"&&m.length>2&&(C.push([s].concat(m.splice(0,2))),E="l",s=s=="m"?"l":"L");m.length>=_[E]&&(C.push([s].concat(m.splice(0,_[E]))),_[E]););}),C.toString=xr.toString,w.arr=wo(C),C}(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,c=0,l=0;e[0][0]=="M"&&(a=r=+e[0][1],c=o=+e[0][2],l++,i[0]=["M",r,o]);for(var u,p,d=l,y=e.length;d=1e3&&delete $e[Ke.shift()],Ke.push(_e),$e[_e]=d.apply(0,We),$e[_e])});if(u)m=u[0],E=u[1],s=u[2],h=u[3];else{e=(p=g(e,t,-f)).x,t=p.y;var b=(e-(c=(p=g(c,l,-f)).x))/2,S=(t-(l=p.y))/2,w=b*b/(n*n)+S*S/(i*i);w>1&&(n*=w=Ze.sqrt(w),i*=w);var _=n*n,C=i*i,B=(o==a?-1:1)*Ze.sqrt(hi((_*C-_*S*S-C*b*b)/(_*S*S+C*b*b))),s=B*n*S/i+(e+c)/2,h=B*-i*b/n+(t+l)/2,m=Ze.asin(((t-h)/i).toFixed(9)),E=Ze.asin(((l-h)/i).toFixed(9));(m=eE&&(m-=2*pi),!a&&E>m&&(E-=2*pi)}var T=E-m;if(hi(T)>y){var M=E,N=c,$=l;E=m+y*(a&&E>m?1:-1),v=Md(c=s+n*Ze.cos(E),l=h+i*Ze.sin(E),n,i,r,0,a,N,$,[E,M,s,h])}T=E-m;var P=Ze.cos(m),x=Ze.sin(m),I=Ze.cos(E),j=Ze.sin(E),G=Ze.tan(T/4),X=4/3*n*G,ee=4/3*i*G,re=[e,t],se=[e+X*x,t-ee*P],H=[c+X*j,l-ee*I],q=[c,l];if(se[0]=2*re[0]-se[0],se[1]=2*re[1]-se[1],u)return[se,H,q].concat(v);for(var xe=[],ze=0,ct=(v=[se,H,q].concat(v).join().split(",")).length;ze7){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 Fl(e,t,n){var i=Nd(e,t);return i.length===1||i.length===2&&_o(i[0],i[1])<1?$i(i[0]):i.length>1?(i=Xt(i,function(r){var o=Math.floor(100*r.t2)||1;return o=((o=100-o)<10?"0":"")+o,r.segment2+"#"+o}),$i(i[n?0:i.length-1])):null}function Ha(e,t){return Math.round(e*t)/t}function Dd(e){return pe(e)?e+"px":e}function Bd(e,t,n){var i=oe("g");be(i).add(t);var r=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}var qa="base",zl="djs-element-hidden",mx={shape:["x","y","width","height"],connection:["waypoints"]};function ve(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}function Od(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}ve.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],ve.prototype._init=function(e){var t=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:Dd(o.width),height:Dd(o.height)}),a.appendChild(c),c}(e),i=this._svg=oe("svg");K(i,{width:"100%",height:"100%"}),le(n,i);var r=this._viewport=Bd(i,"viewport");this._layers={},this._planes={},e.deferUpdate!==!1&&(this._viewboxChanged=vl(St(this._viewboxChanged,this),300)),t.on("diagram.init",function(){t.fire("canvas.init",{svg:i,viewport:r})},this),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","plane.set"],function(){delete this._cachedViewbox},this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},ve.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._activePlane,delete this._viewport},ve.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=yd(t);n==="root"?e.setRootElementForPlane(null,e.findPlane(t),!0):e._removeElement(t,n)}),this._activePlane=null,this._planes={},delete this._cachedViewbox},ve.prototype.getDefaultLayer=function(){return this.getLayer(qa,0)},ve.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),t!==void 0&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},ve.prototype._createLayer=function(e,t){t===void 0&&(t=1);var n=Bt(this._layers,function(i,r){return t>=r.index&&i++,i},0);return{group:Bd(this._viewport,"layer-"+e,n),index:t}},ve.prototype.getPlane=function(e){if(!e)throw new Error("must specify a name");return this._planes[e]},ve.prototype.createPlane=function(e,t){if(!e)throw new Error("must specify a name");if(this._planes[e])throw new Error("plane "+e+" already exists");t||(t={id:"__implicitroot"+e,children:[],isImplicit:!0});var n=this.getLayer(e,0);be(n).add(zl);var i=this._planes[e]={layer:n,name:e,rootElement:null};return this.setRootElementForPlane(t,i),i},ve.prototype.setActivePlane=function(e){if(!e)throw new Error("must specify a plane");return typeof e=="string"&&(e=this.getPlane(e)),this._activePlane&&be(this._activePlane.layer).add(zl),this._activePlane=e,be(e.layer).remove(zl),e.rootElement&&this._elementRegistry.updateGraphics(e.rootElement,this._svg,!0),this._eventBus.fire("plane.set",{plane:e}),e},ve.prototype.getActiveLayer=function(){return this.getActivePlane().layer},ve.prototype.getActivePlane=function(){var e=this._activePlane;return e||(e=this.createPlane(qa),this.setActivePlane(qa)),e},ve.prototype.findPlane=function(e){typeof e=="string"&&(e=this._elementRegistry.get(e));var t=function(n){for(;n.parent;)n=n.parent;return n}(e);return Pe(this._planes,function(n){return n.rootElement===t})},ve.prototype.getContainer=function(){return this._container},ve.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(L([i.gfx,i.secondaryGfx],function(r){r&&(n?be(r).add(t):be(r).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},ve.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},ve.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},ve.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),be(this.getGraphics(e)).has(t)},ve.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},ve.prototype.getRootElement=function(){return this.getActivePlane().rootElement},ve.prototype.setRootElement=function(e,t){var n=this._activePlane;if(n)return this.setRootElementForPlane(e,n,t);var i=this.createPlane(qa,e);return this.setActivePlane(i),i.rootElement},ve.prototype.setRootElementForPlane=function(e,t,n){typeof t=="string"&&(t=this.getPlane(t)),e&&this._ensureValid("root",e);var i=t.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(e){var a=t.layer;o.fire("root.add",{element:e}),r.add(e,a),o.fire("root.added",{element:e,gfx:a}),t===this._activePlane&&this._elementRegistry.updateGraphics(e,this._svg,!0)}return t.rootElement=e,e},ve.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element with id "+t.id+" already exists");var n=mx[e],i=ji(n,function(r){return t[r]!==void 0});if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},ve.prototype._setParent=function(e,t,n){Je(t.children,e,n),e.parent=t},ve.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);var a=o.create(e,t,i);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},ve.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},ve.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},ve.prototype._removeElement=function(e,t){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),Ye(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},ve.prototype.removeShape=function(e){return this._removeElement(e,"shape")},ve.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},ve.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},ve.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},ve.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},ve.prototype.viewbox=function(e){if(e===void 0&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,o,a,c=this._viewport,l=this.getSize();return e?(this._changeViewbox(function(){r=Math.min(l.width/e.width,l.height/e.height);var u=this._svg.createSVGMatrix().scale(r).translate(-e.x,-e.y);xo(c,u)}),e):(t=this._activePlane&&this._activePlane.layer.getBBox()||{},n=(i=xo(c))?i.matrix:function(u,p,d,y,f,v){var g=kl().createSVGMatrix();switch(arguments.length){case 0:return g;case 1:return ld(g,u);case 6:return ld(g,{a:u,b:p,c:d,d:y,e:f,f:v})}}(),r=Ha(n.a,1e3),o=Ha(-n.e||0,1e3),a=Ha(-n.f||0,1e3),e=this._cachedViewbox={x:o?o/r:0,y:a?a/r:0,width:l.width/r,height:l.height/r,scale:r,inner:{width:t.width||0,height:t.height||0,x:t.x||0,y:t.y||0},outer:l})},ve.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=z({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Od(t,n)}),{x:n.e,y:n.f}},ve.prototype.scrollToElement=function(e,t){var n=100;typeof e=="string"&&(e=this._elementRegistry.get(e));var i=this.findPlane(e);i!==this._activePlane&&this.setActivePlane(i),t||(t={}),typeof t=="number"&&(n=t),t={top:t.top||n,right:t.right||n,bottom:t.bottom||n,left:t.left||n};var r,o,a=vt(e),c=ae(a),l=this.viewbox(),u=this.zoom();l.y+=t.top/u,l.x+=t.left/u,l.width-=(t.right+t.left)/u,l.height-=(t.bottom+t.top)/u;var p=ae(l);if(a.width=0&&o.y>=0&&o.x+o.width<=r.width&&o.y+o.height<=r.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(t=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(e?o.width/2-r.width/t/2:0),y:o.y+(e?o.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},ve.prototype._setZoom=function(e,t){var n,i,r,o,a=this._svg,c=this._viewport,l=a.createSVGMatrix(),u=a.createSVGPoint(),p=(i=c.getCTM()).a;return t?(n=z(u,t).matrixTransform(i.inverse()),r=l.translate(n.x,n.y).scale(1/p*e).translate(-n.x,-n.y),o=i.multiply(r)):o=l.scale(e),Od(this._viewport,o),o},ve.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},ve.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();return e.waypoints?t=this.getGraphics(e).getBBox():t=e,{x:t.x*n.scale-n.x*n.scale,y:t.y*n.scale-n.y*n.scale,width:t.width*n.scale,height:t.height*n.scale}},ve.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Er="data-element-id";function Ut(e){this._elements={},this._eventBus=e}Ut.$inject=["eventBus"],Ut.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),K(t,Er,i),n&&K(n,Er,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Ut.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(K(i.gfx,Er,""),i.secondaryGfx&&K(i.secondaryGfx,Er,""),delete t[n])},Ut.prototype.updateId=function(e,t){this._validateId(t),typeof e=="string"&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},Ut.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,K(t,Er,i),t},Ut.prototype.get=function(e){var t;t=typeof e=="string"?e:e&&K(e,Er);var n=this._elements[t];return n&&n.element},Ut.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},Ut.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i in ref");t=this.props[t]}t.collection?jd(this,t,e):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,t,e)},mi.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Ld.isExtended(n)||jd(this,t,e),n},mi.prototype.ensureBound=function(e,t){(function(n,i){return Object.prototype.hasOwnProperty.call(n,i.name||i)})(e,t)||this.bind(e,t)},mi.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},mi.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var fx=mi;$l.exports=fx,$l.exports.Collection=Wa;const _r=oo($l.exports);var Vd=new _r({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Fd=new _r({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),zd=new _r({name:"attachers",collection:!0},{name:"host"}),$d=new _r({name:"outgoing",collection:!0},{name:"source"}),Gd=new _r({name:"incoming",collection:!0},{name:"target"});function So(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),Vd.bind(this,"parent"),Fd.bind(this,"labels"),$d.bind(this,"outgoing"),Gd.bind(this,"incoming")}function wr(){So.call(this),Vd.bind(this,"children"),zd.bind(this,"host"),zd.bind(this,"attachers")}function Ud(){wr.call(this)}function Xa(){wr.call(this),Fd.bind(this,"labelTarget")}function Hd(){So.call(this),$d.bind(this,"source"),Gd.bind(this,"target")}ie(wr,So),ie(Ud,wr),ie(Xa,wr),ie(Hd,So);var vx={connection:Hd,shape:wr,label:Xa,root:Ud};function Gn(){this._uid=12}Gn.prototype.createRoot=function(e){return this.create("root",e)},Gn.prototype.createLabel=function(e){return this.create("label",e)},Gn.prototype.createShape=function(e){return this.create("shape",e)},Gn.prototype.createConnection=function(e){return this.create("connection",e)},Gn.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(n,i){var r=vx[n];if(!r)throw new Error("unknown type: <"+n+">");return z(new r,i)}(e,t)};var Ka="__fn",yx=Array.prototype.slice;function Ot(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Co(){}function Ya(e){return e.childNodes[0]}function Gl(e,t,n,i,r){var o=bo();o.setTranslate(t,n);var a=bo();a.setRotate(i||0,0,0);var c=bo();c.setScale(r||1,r||1),xo(e,[o,a,c])}function Lt(e,t,n){var i=bo();i.setTranslate(t,n),xo(e,i)}function qd(e,t){var n=bo();n.setRotate(t,0,0),xo(e,n)}function Ht(e,t){this._eventBus=e,this._elementRegistry=t}function Wd(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}Ot.prototype.on=function(e,t,n,i){if(e=ge(e)?e:[e],ft(t)&&(i=n,n=t,t=1e3),!pe(t))throw new Error("priority must be a number");var r=n;i&&((r=St(n,i))[Ka]=n[Ka]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:r,next:null})})},Ot.prototype.once=function(e,t,n,i){var r=this;if(ft(t)&&(i=n,n=t,t=1e3),!pe(t))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(i,arguments);return r.off(e,o),a}o[Ka]=n,this.on(e,t,o)},Ot.prototype.off=function(e,t){e=ge(e)?e:[e];var n=this;e.forEach(function(i){n._removeListener(i,t)})},Ot.prototype.createEvent=function(e){var t=new Co;return t.init(e),t},Ot.prototype.fire=function(e,t){var n,i,r,o;if(o=yx.call(arguments),typeof e=="object"&&(e=(t=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof Co?t:this.createEvent(t),o[0]=n;var a=n.type;e!==a&&(n.type=e);try{r=this._invokeListeners(n,o,i)}finally{e!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},Ot.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},Ot.prototype._destroy=function(){this._listeners={}},Ot.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},Ot.prototype._invokeListener=function(e,t,n){var i;if(n.callback.__isTomb)return i;try{i=function(r,o){return r.apply(null,o)}(n.callback,t),i!==void 0&&(e.returnValue=i,e.stopPropagation()),i===!1&&e.preventDefault()}catch(r){if(!this.handleError(r))throw console.error("unhandled error in event listener",r),r}return i},Ot.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority=0}e.forEach(function o(a){i(a)||((a.__depends__||[]).forEach(o),i(a)||(function(c){t.push(c)}(a),(a.__init__||[]).forEach(function(c){n.push(c)})))});var r=new Nl(t);return n.forEach(function(o){try{r[typeof o=="string"?"get":"invoke"](o)}catch(a){throw console.error("Failed to instantiate component"),console.error(a.stack),a}}),r}function Sr(e,t){this.injector=t=t||function(n){return bx([{config:["value",n=n||{}]},gx].concat(n.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function Ul(){}function Xd(e,t){this.model=e,this.properties=t}Sr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Sr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Ul.prototype.get=function(e){return this.$model.properties.get(this,e)},Ul.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Xd.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Ul.prototype);L(e.properties,function(a){a.isMany||a.default===void 0||(i[a.name]=a.default)}),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.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,St(function(c,l){this.set(l,c)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,t),n.defineDescriptor(o,e),o};var xx={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Kd={String:function(e){return e},Boolean:function(e){return e==="true"},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e)}};function Hl(e,t){var n=Kd[e];return n?n(t):t}function ql(e){return!!xx[e]}function Yd(e){return!!Kd[e]}function kt(e,t){var n,i,r=e.split(/:/);if(r.length===1)n=e,i=t;else{if(r.length!==2)throw new Error("expected or , got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}}function Jt(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function fi(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,L(e,St(this.registerPackage,this))}function Jd(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Cr(e){this.model=e}function Zd(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Zt(e){this.properties=new Cr(this),this.factory=new Xd(this,this.properties),this.registry=new fi(e,this.properties),this.typeCache={}}Jt.prototype.build=function(){return Yt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Jt.prototype.addProperty=function(e,t,n){typeof t=="boolean"&&(n=t,t=void 0),this.addNamedProperty(e,n!==!1);var i=this.properties;t!==void 0?i.splice(t,0,e):i.push(e)},Jt.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var c=r.indexOf(e);if(c===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(c,1),this.addProperty(t,n?void 0:c,a),o[i.name]=o[i.localName]=t},Jt.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=kt(r[0],i),a=kt(r[1],o.prefix).name,c=this.propertiesByName[a];if(!c)throw new Error("refined property <"+a+"> not found");this.replaceProperty(c,e,n),delete e.redefines},Jt.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},Jt.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Jt.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},Jt.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},Jt.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},Jt.prototype.hasProperty=function(e){return this.propertiesByName[e]},Jt.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(L(e.properties,St(function(o){o=z({},o,{name:o.ns.localName,inherited:t}),Object.defineProperty(o,"definedBy",{value:e});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(e),n[r]=e)},fi.prototype.getPackage=function(e){return this.packageMap[e]},fi.prototype.getPackages=function(){return this.packages},fi.prototype.registerPackage=function(e){e=z({},e);var t=this.packageMap;Jd(t,e,"prefix"),Jd(t,e,"uri"),L(e.types,St(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},fi.prototype.registerType=function(e,t){var n=kt((e=z({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:z(e.meta||{})})).name,t.prefix),i=n.name,r={};L(e.properties,St(function(o){var a=kt(o.name,n.prefix),c=a.name;ql(o.type)||(o.type=kt(o.type,a.prefix).name),z(o,{ns:a,name:c}),r[c]=o},this)),z(e,{ns:n,name:i,propertiesByName:r}),L(e.extends,St(function(o){var a=this.typeMap[o];a.traits=a.traits||[],a.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},fi.prototype.mapTypes=function(e,t,n){var i=ql(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(c){return a(c,!0)}function a(c,l){var u=kt(c,ql(c)?"":e.prefix);r.mapTypes(u,t,l)}if(!i)throw new Error("unknown type <"+e.name+">");L(i.superClass,n?o:a),t(i,!n),L(i.traits,o)},fi.prototype.getEffectiveDescriptor=function(e){var t=kt(e),n=new Jt(t);this.mapTypes(t,function(r,o){n.addTrait(r,o)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},fi.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Cr.prototype.set=function(e,t,n){if(!Dt(t)||!t.length)throw new TypeError("property name must be a non-empty string");var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;n===void 0?i?delete e[r]:delete e.$attrs[t]:i?r in e?e[r]=n:Zd(e,i,n):e.$attrs[t]=n},Cr.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var i=n.name;return!e[i]&&n.isMany&&Zd(e,n,[]),e[i]},Cr.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},Cr.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Cr.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Zt.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Zt.prototype.getType=function(e){var t=this.typeCache,n=Dt(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Zt.prototype.createAny=function(e,t,n){var i=kt(e),r={$type:e,$instanceOf:function(a){return a===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};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){et(a)&&a.value!==void 0?r[a.name]=a.value:r[c]=a}),r},Zt.prototype.getPackage=function(e){return this.registry.getPackage(e)},Zt.prototype.getPackages=function(){return this.registry.getPackages()},Zt.prototype.getElementDescriptor=function(e){return e.$descriptor},Zt.prototype.hasType=function(e,t){return t===void 0&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Zt.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Zt.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Ex=String.fromCharCode,_x=Object.prototype.hasOwnProperty,wx=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,To={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Sx(e,t,n,i){return i?_x.call(To,i)?To[i]:"&"+i+";":Ex(t||parseInt(n,16))}function Gi(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(wx,Sx):e}Object.keys(To).forEach(function(e){To[e.toUpperCase()]=To[e]});var Qd="xsi:type",em="non-whitespace outside of root node";function Tr(e){return new Error(e)}function tm(e){return"missing namespace for prefix <"+e+">"}function Ja(e){return{get:e,enumerable:!0}}function Cx(e){var t,n={};for(t in e)n[t]=e[t];return n}function Wl(e){return e+"$uri"}function nm(){return{line:0,column:0}}function Tx(e){throw e}function im(e){if(!this)return new im(e);var t,n,i,r,o,a,c,l,u,p=e&&e.proxy,d=Tx,y=nm,f=!1,v=!1,g=null,b=!1;function S(_){_ instanceof Error||(_=Tr(_)),g=_,d(_,y)}function w(_){o&&(_ instanceof Error||(_=Tr(_)),o(_,y))}this.on=function(_,C){if(typeof C!="function")throw Tr("required args ");switch(_){case"openTag":n=C;break;case"text":t=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 Tr("unsupported event: "+_)}return this},this.ns=function(_){if(_===void 0&&(_={}),typeof _!="object")throw Tr("required args ");var C,B={};for(C in _)B[C]=_[C];return B["http://www.w3.org/2001/XMLSchema-instance"]="xsi",v=!0,u=B,this},this.parse=function(_){if(typeof _!="string")throw Tr("required args ");return g=null,function(C){var B,s,h,m,E,T,M,N,$,P,x,I=v?[]:null,j=v?function(Ie){var We,_e,$e={};for(We in Ie)$e[_e=Ie[We]]=_e,$e[Wl(_e)]=We;return $e}(u):null,G=[],X=0,ee=!1,re=!1,se=0,H=0,q="",xe=0;function ze(){if(x!==null)return x;var Ie,We,_e,$e,Ke,Re,ht,Se,Ge,he,Oe,Di=v&&j.xmlns,hr=v&&f?[]:null,Qe=xe,_t=q,xn=_t.length,Bi={},Yc={};e:for(;Qe8)){for((he<65||he>122||he>90&&he<97)&&he!==95&&he!==58&&(w("illegal first char attribute name"),Ge=!0),Oe=Qe+1;Oe96&&he<123||he>64&&he<91||he>47&&he<59||he===46||he===45||he===95)){if(he===32||he<14&&he>8){w("missing attribute value"),Qe=Oe;continue e}if(he===61)break;w("illegal attribute name char"),Ge=!0}if((Se=_t.substring(Qe,Oe))==="xmlns:xmlns"&&(w("illegal declaration of xmlns"),Ge=!0),(he=_t.charCodeAt(Oe+1))===34)(Oe=_t.indexOf('"',Qe=Oe+2))===-1&&(Oe=_t.indexOf("'",Qe))!==-1&&(w("attribute value quote missmatch"),Ge=!0);else if(he===39)(Oe=_t.indexOf("'",Qe=Oe+2))===-1&&(Oe=_t.indexOf('"',Qe))!==-1&&(w("attribute value quote missmatch"),Ge=!0);else for(w("missing attribute value quotes"),Ge=!0,Oe+=1;Oe8);Oe++);for(Oe===-1&&(w("missing closing quotes"),Oe=xn,Ge=!0),Ge||(Re=_t.substring(Qe,Oe)),Qe=Oe;Oe+18);Oe++)Qe===Oe&&(w("illegal character after attribute end"),Ge=!0);if(Qe=Oe+1,!Ge)if(Se in Yc)w("attribute <"+Se+"> already defined");else if(Yc[Se]=!0,v)if(f){if((Ke=Se==="xmlns"?"xmlns":Se.charCodeAt(0)===120&&Se.substr(0,6)==="xmlns:"?Se.substr(6):null)!==null){if(Ie=Gi(Re),We=Wl(Ke),!(ht=u[Ie])){if(Ke==="xmlns"||We in j&&j[We]!==Ie)do ht="ns"+X++;while(j[ht]!==void 0);else ht=Ke;u[Ie]=ht}j[Ke]!==ht&&($e||(j=Cx(j),$e=!0),j[Ke]=ht,Ke==="xmlns"&&(j[Wl(ht)]=Ie,Di=ht),j[We]=Ie),Bi[Se]=Re;continue}hr.push(Se,Re)}else(he=Se.indexOf(":"))!==-1?(_e=j[Se.substring(0,he)])?((Se=Di===_e?Se.substr(he+1):_e+Se.substr(he))===Qd&&((he=Re.indexOf(":"))!==-1?(_e=Re.substring(0,he),Re=(_e=j[_e]||_e)+Re.substring(he)):Re=Di+":"+Re),Bi[Se]=Re):w(tm(Se.substring(0,he))):Bi[Se]=Re;else Bi[Se]=Re}if(f)for(Qe=0,xn=hr.length;Qe=Re&&(Ie=_e.exec(C))&&!((ht=Ie[0].length+Ie.index)>se);)$e+=1,Re=ht;return se==-1?(Ke=ht,We=C.substring(H)):H===0?We=C.substring(H,se):(Ke=se-Re,We=H==-1?C.substring(se):C.substring(se,H+1)),{data:We,line:$e,column:Ke}}for(y=ct,p&&(P=Object.create({},{name:Ja(function(){return N}),originalName:Ja(function(){return $}),attrs:Ja(ze),ns:Ja(function(){return j})}));H!==-1;){if((se=C.charCodeAt(H)===60?H:C.indexOf("<",H))===-1)return G.length?S("unexpected end of file"):H===0?S("missing start tag"):void(H",se))===-1)return S("unclosed cdata");if(r&&(r(C.substring(se+9,H),y),b))return;H+=3;continue}if(m===45&&C.charCodeAt(se+3)===45){if((H=C.indexOf("-->",se))===-1)return S("unclosed comment");if(a&&(a(C.substring(se+4,H),Gi,y),b))return;H+=3;continue}}if(E!==63){for(s=se+1;;s++){if(T=C.charCodeAt(s),isNaN(T))return H=-1,S("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(E!==33){if(x={},E===47){if(ee=!1,re=!0,!G.length)return S("missing open tag");if(s=N=G.pop(),m=se+2+s.length,C.substring(se+2,m)!==s)return S("closing tag mismatch");for(;m8&&E<14))return S("close tag")}else{if(C.charCodeAt(H-1)===47?(s=N=C.substring(se+1,H-1),ee=!0,re=!0):(s=N=C.substring(se+1,H),ee=!0,re=!1),!(E>96&&E<123||E>64&&E<91||E===95||E===58))return S("illegal first char nodeName");for(m=1,h=s.length;m96&&E<123||E>64&&E<91||E>47&&E<59||E===45||E===95||E==46)){if(E===32||E<14&&E>8){N=s.substring(0,m),x=null;break}return S("invalid nodeName")}re||G.push(N)}if(v){if(B=j,ee&&(re||I.push(B),x===null&&(f=s.indexOf("xmlns",m)!==-1)&&(xe=m,q=s,ze(),f=!1)),$=N,(E=N.indexOf(":"))!==-1){if(!(M=j[N.substring(0,E)]))return S("missing namespace on <"+$+">");N=N.substr(E+1)}else M=j.xmlns;M&&(N=M+":"+N)}if(ee&&(xe=m,q=s,n&&(p?n(P,Gi,re,y):n(N,ze,Gi,re,y),b)))return;if(re){if(i&&(i(p?P:N,Gi,ee,y),b))return;v&&(j=ee?B:I.pop())}H+=1}else{if(l&&(l(C.substring(se,H+1),Gi,y),b))return;H+=1}}else{if((H=C.indexOf("?>",se))===-1)return S("unclosed question");if(c&&(c(C.substring(se,H+2),y),b))return;H+=2}}}(_),y=nm,b=!1,g},this.stop=function(){b=!0}}function rm(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var Ax={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Za="xsi:type";function om(e){return e.xml&&e.xml.serialize}function am(e){return om(e)===Za}function sm(e,t){return rm(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function vi(e){return new Error(e)}function Un(e){return e.$descriptor}function kx(e){z(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw vi("expected element");var n,i=this.elementsById,r=Un(t).idProperty;if(r&&(n=t.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(n))throw new Error("illegal ID <"+n+">");if(i[n])throw vi("duplicate ID <"+n+">");i[n]=t}},this.addWarning=function(t){this.warnings.push(t)}}function Ao(){}function Xl(){}function Ar(){}function ko(e,t){this.property=e,this.context=t}function Kl(e,t){this.element=t,this.propertyDesc=e}function Qa(){}function Ct(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Yl(e,t,n){Ct.call(this,e,t,n)}function kr(e,t,n){this.model=e,this.context=n}function Jl(e){e instanceof Zt&&(e={model:e}),z(this,{lax:!1},e)}Ao.prototype.handleEnd=function(){},Ao.prototype.handleText=function(){},Ao.prototype.handleNode=function(){},Xl.prototype=Object.create(Ao.prototype),Xl.prototype.handleNode=function(){return this},Ar.prototype=Object.create(Ao.prototype),Ar.prototype.handleText=function(e){this.body=(this.body||"")+e},ko.prototype=Object.create(Ar.prototype),ko.prototype.handleNode=function(e){if(this.element)throw vi("expected no sub nodes");return this.element=this.createReference(e),this},ko.prototype.handleEnd=function(){this.element.id=this.body},ko.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Kl.prototype=Object.create(Ar.prototype),Kl.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Hl(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Qa.prototype=Object.create(Ar.prototype),Qa.prototype.handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},Ct.prototype=Object.create(Qa.prototype),Ct.prototype.addReference=function(e){this.context.addReference(e)},Ct.prototype.handleText=function(e){if(!Un(this.element).bodyProperty)throw vi("unexpected body text <"+e+">");Ar.prototype.handleText.call(this,e)},Ct.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Un(t).bodyProperty;n&&e!==void 0&&(e=Hl(n.type,e),t.set(n.name,e))},Ct.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Un(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=Hl(p.type,l):u!=="xmlns"&&(t=kt(u,r.ns.prefix),c.getPackage(t.prefix)&&o.addWarning({message:"unknown attribute <"+u+">",element:a,property:u,value:l})),a.set(u,l))}),a},Ct.prototype.getPropertyForNode=function(e){var t,n,i=kt(e.name),r=this.type,o=this.model,a=Un(r),c=i.name,l=a.propertiesByName[c];if(l&&!l.isAttr)return am(l)&&(t=e.attributes[Za])?(t=function(p,d){var y=kt(p);return function(f,v){var g=f.name,b=f.localName,S=v.xml&&v.xml.typePrefix;return S&&b.indexOf(S)===0?f.prefix+":"+b.slice(S.length):g}(y,d.getPackage(y.prefix))}(t,o),z({},l,{effectiveType:Un(n=o.getType(t)).name})):l;var u=o.getPackage(i.prefix);if(u){if(t=sm(i,u),n=o.getType(t),l=Pe(a.properties,function(p){return!p.isVirtual&&!p.isReference&&!p.isAttribute&&n.hasType(p.type)}))return z({},l,{effectiveType:Un(n).name})}else if(l=Pe(a.properties,function(p){return!p.isReference&&!p.isAttribute&&p.type==="Element"}))return l;throw vi("unrecognized element <"+i.name+">")},Ct.prototype.toString=function(){return"ElementDescriptor["+Un(this.type).name+"]"},Ct.prototype.valueHandler=function(e,t){return new Kl(e,t)},Ct.prototype.referenceHandler=function(e){return new ko(e,this.context)},Ct.prototype.handler=function(e){return e==="Element"?new kr(this.model,e,this.context):new Ct(this.model,e,this.context)},Ct.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Yd(n=t.effectiveType||t.type))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return o!==void 0&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},Yl.prototype=Object.create(Ct.prototype),Yl.prototype.createElement=function(e){var t=e.name,n=kt(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&sm(n,o)||t;if(!r.hasType(a))throw vi("unexpected element <"+e.originalName+">");return Ct.prototype.createElement.call(this,e)},kr.prototype=Object.create(Qa.prototype),kr.prototype.createElement=function(e){var t=e.name,n=kt(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},kr.prototype.handleChild=function(e){var t=new kr(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return i!==void 0&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},kr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Jl.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof Ct?(i=t,t={}):typeof t=="string"?(i=this.handler(t),t={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,a=new kx(z({},t,{rootHandler:i})),c=new im({proxy:!0}),l=function(){var b=[];return Object.defineProperty(b,"peek",{value:function(){return this[this.length-1]}}),b}();function u(b,S,w){var _=S(),C=_.line,B=_.column,s=_.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(w)return a.addWarning({message:h,error:b}),!0;throw vi(h)}function p(b,S){return u(b,S,!0)}i.context=a,l.push(i);var d=/^<\?xml /i,y=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function v(b,S){try{l.peek().handleText(b)}catch(w){p(w,S)}}var g=r.getPackages().reduce(function(b,S){return b[S.uri]=S.prefix,b},{"http://www.w3.org/XML/1998/namespace":"xml"});return c.ns(g).on("openTag",function(b,S,w,_){var C=b.attrs||{},B=Object.keys(C).reduce(function(s,h){var m=S(C[h]);return s[h]=m,s},{});(function(s,h){var m=l.peek();try{l.push(m.handleNode(s))}catch(E){u(E,h,o)&&l.push(new Xl)}})({name:b.name,originalName:b.originalName,attributes:B,ns:b.ns},_)}).on("question",function(b){if(d.test(b)){var S=y.exec(b),w=S&&S[1];w&&!f.test(w)&&a.addWarning({message:"unsupported document encoding <"+w+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",v).on("text",function(b,S,w){(function(_,C){_.trim()&&v(_,C)})(S(b),w)}).on("error",u).on("warn",p),new Promise(function(b,S){var w;try{c.parse(e),function(){var h,m,E=a.elementsById,T=a.references;for(h=0;m=T[h];h++){var M=m.element,N=E[m.id],$=Un(M).propertiesByName[m.property];if(N||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),N?P[x]=N:P.splice(x,1)}else M.set($.name,N)}}()}catch(h){w=h}var _=i.element;w||_||(w=vi("failed to parse document as <"+i.type.$descriptor.name+">"));var C=a.warnings,B=a.references,s=a.elementsById;return w?(w.warnings=C,S(w)):b({rootElement:_,elementsById:s,references:B,warnings:C})})},Jl.prototype.handler=function(e){return new Yl(this.model,e)};var Px=/<|>|'|"|&|\n\r|\n/g,cm=/<|>|&/g;function Mx(e){var t={},n={},i={},r=[],o=[];this.byUri=function(a){return n[a]||e&&e.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 t[a||"xmlns"]},this.mapPrefix=function(a,c){t[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),e&&e.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 Rx(e,t){return rm(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function lm(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function um(e){return Dt(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var Nx={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Ix={"<":"lt",">":"gt","&":"amp"};function pm(e,t,n){return(e=Dt(e)?e:""+e).replace(t,function(i){return"&"+n[i]+";"})}function Zl(e){this.tagName=e}function Ui(){}function Ql(e){this.tagName=e}function Ue(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function es(e,t){Ue.call(this,e,t)}function Dx(){this.value="",this.write=function(e){this.value+=e}}function Bx(e,t){var n=[""];this.append=function(i){return e.write(i),this},this.appendNewLine=function(){return t&&e.write(` `),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Ox(e){return e=z({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new Dx,r=new Bx(i,e.format);if(e.preamble&&r.append(` `),new Ue().build(t).serializeTo(r),!n)return i.value}}}function ts(e,t){Zt.call(this,e,t)}Zl.prototype.build=function(e){return this.element=e,this},Zl.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"").appendNewLine()},Ui.prototype.serializeValue=Ui.prototype.serializeTo=function(e){e.append(this.escape?pm(this.value,cm,Ix):this.value)},Ui.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(cm)!==-1&&(this.escape=!0),this},lm(Ql,Ui),Ql.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("").appendNewLine()},Ue.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return t=o?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(a){return de(a.$descriptor.properties,function(c){var l=c.name;if(c.isVirtual||!Tn(a,l))return!1;var u=a[l];return u!==c.default&&u!==null&&(!c.isMany||u.length)})}(e),this.parseAttributes(de(n,function(a){return a.isAttr})),this.parseContainments(function(a){return de(a,function(c){return!c.isAttr})}(n))),this.parseGenericAttributes(e,t),this},Ue.prototype.nsTagName=function(e){return function(t,n){return n.isGeneric?z({localName:n.ns.localName},t):z({localName:Rx(n.ns.localName,n.$pkg)},t)}(this.logNamespaceUsed(e.ns),e)},Ue.prototype.nsPropertyTagName=function(e){return function(t,n){return z({localName:n.ns.localName},t)}(this.logNamespaceUsed(e.ns),e)},Ue.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Ue.prototype.nsAttributeName=function(e){var t;if(t=Dt(e)?kt(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:z({localName:t.localName},n)},Ue.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return L(e,function(r,o){o==="$body"?n.push(new Ui().build({type:"String"},r)):o==="$children"?L(r,function(a){n.push(new Ue(t).build(a))}):o.indexOf("$")!==0&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})}),i},Ue.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=kt(t);if(o.prefix==="xmlns"&&(i={prefix:o.localName,uri:n}),o.prefix||o.localName!=="xmlns"||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},Ue.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return L(i,function(o,a){var c=n.parseNsAttribute(e,a,o);c&&r.push(c)}),r},Ue.prototype.parseGenericAttributes=function(e,t){var n=this;L(t,function(i){if(i.name!==Za)try{n.addAttribute(n.nsAttributeName(i.name),i.value)}catch(r){console.warn("missing namespace information for ",i.name,"=",i.value,"on",e,r)}})},Ue.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;L(e,function(r){var o=i.get(r.name),a=r.isReference;if(r.isMany||(o=[o]),r.isBody)n.push(new Ui().build(r,o[0]));else if(Yd(r.type))L(o,function(u){n.push(new Ql(t.addTagName(t.nsPropertyTagName(r))).build(r,u))});else if(a)L(o,function(u){n.push(new Zl(t.addTagName(t.nsPropertyTagName(r))).build(u))});else{var c=am(r),l=function(u){return om(u)==="property"}(r);L(o,function(u){var p;p=c?new es(t,r):l?new Ue(t,r):new Ue(t),n.push(p.build(u))})}})},Ue.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new Mx(t):n=t),n},Ue.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,o=e.prefix;return i.byUri(r)&&!n||i.add(e,t),i.mapPrefix(o,r),e},Ue.prototype.logNamespaceUsed=function(e,t){var n,i,r,o=this.element.$model,a=this.getNamespaces(t),c=e.prefix,l=e.uri;if(!c&&!l)return{localName:e.localName};if(r=Ax[c]||o&&(o.getPackage(c)||{}).uri,!(l=l||r||a.uriByPrefix(c)))throw new Error("no namespace uri given for prefix <"+c+">");if(!(e=a.byUri(l))){for(n=c,i=1;a.uriByPrefix(n);)n=c+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return c&&a.mapPrefix(c,l),e},Ue.prototype.parseAttributes=function(e){var t=this,n=this.element;L(e,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;t.addAttribute(t.nsAttributeName(i),r)})},Ue.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),um(e)},Ue.prototype.addAttribute=function(e,t){var n=this.attrs;Dt(t)&&(t=pm(t,Px,Nx));var i=hl(n,function(o){return o.name.localName===e.localName&&o.name.uri===e.uri&&o.name.prefix===e.prefix}),r={name:e,value:t};i!==-1?n.splice(i,1,r):n.push(r)},Ue.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=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(t)),L(t,function(i){e.append(" ").append(um(i.name)).append('="').append(i.value).append('"')})},Ue.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Ui;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),L(this.body,function(i){i.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()},lm(es,Ue),es.prototype.parseNsAttributes=function(e){var t=Ue.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Za),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},es.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},ts.prototype=Object.create(Zt.prototype),ts.prototype.fromXML=function(e,t,n){Dt(t)||(n=t,t="bpmn:Definitions");var i=new Jl(z({model:this,lax:!0},n)),r=i.handler(t);return i.fromXML(e,r)},ts.prototype.toXML=function(e,t){var n=new Ox(t);return new Promise(function(i,r){try{return i({xml:n.toXML(e)})}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 jx(e,t){return new ts(z({},Lx,e),t)}function gt(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':""}var Vx=new _r({name:"bpmnElement",enumerable:!0},{name:"di",configurable:!0});function jt(e,t){return e.$instanceOf(t)}function Fx(e,t){var n={},i=[];function r(M,N){return function($){M($,N)}}function o(M){n[M.id]=M}function a(M,N){try{var $=M.di&&function(P,x){if(P.gfx)throw new Error(t("already rendered {element}",{element:gt(P)}));return e.element(P,x)}(M,N);return o(M),$}catch(P){c(P.message,{element:M,error:P}),console.error(t("failed to import {element}",{element:gt(M)})),console.error(P)}}function c(M,N){e.error(M,N)}function l(M){var N=M.bpmnElement;N?N.di?c(t("multiple DI elements defined for {element}",{element:gt(N)}),{element:N}):(Vx.bind(N,"di"),N.di=M):c(t("no bpmnElement referenced in {element}",{element:gt(M)}),{element:M})}function u(M){var N;l(N=M.plane),L(N.planeElement,p)}function p(M){l(M)}function d(){for(;i.length;)i.shift()()}function y(M,N){E(M,N),_(M.ioSpecification,N),w(M.artifacts,N),o(M)}function f(M,N){a(M,N)}function v(M,N){a(M,N)}function g(M,N){a(M,N)}function b(M,N){a(M,N)}function S(M,N){a(M,N)}function w(M,N){L(M,function($){jt($,"bpmn:Association")?i.push(function(){S($,N)}):S($,N)})}function _(M,N){M&&(L(M.dataInputs,r(g,N)),L(M.dataOutputs,r(b,N)))}function C(M,N){E(M,N),w(M.artifacts,N)}function B(M,N){var $=a(M,N);jt(M,"bpmn:SubProcess")&&C(M,$||N),jt(M,"bpmn:Activity")&&_(M.ioSpecification,N),i.push(function(){L(M.dataInputAssociations,r(v,N)),L(M.dataOutputAssociations,r(v,N))})}function s(M,N){a(M,N)}function h(M,N){i.push(function(){var $=a(M,N);M.childLaneSet&&m(M.childLaneSet,$||N),function(P){L(P.flowNodeRef,function(x){var I=x.get("lanes");I&&I.push(P)})}(M)})}function m(M,N){L(M.lanes,r(h,N))}function E(M,N){(function($,P){L($,function(x){jt(x,"bpmn:SequenceFlow")?i.push(function(){(function(I,j){a(I,j)})(x,P)}):jt(x,"bpmn:BoundaryEvent")?i.unshift(function(){B(x,P)}):jt(x,"bpmn:FlowNode")?B(x,P):jt(x,"bpmn:DataObject")||(jt(x,"bpmn:DataStoreReference")||jt(x,"bpmn:DataObjectReference")?s(x,P):c(t("unrecognized flowElement {element} in context {context}",{element:gt(x),context:P?gt(P.businessObject):"null"}),{element:x,context:P}))})})(M.flowElements,N),M.laneSets&&function($,P){L($,r(m,P))}(M.laneSets,N)}function T(M,N){var $=a(M,N),P=M.processRef;P&&y(P,$||N)}return{handleDeferred:d,handleDefinitions:function(M,N){var $=M.diagrams;if(N&&$.indexOf(N)===-1)throw new Error(t("diagram not part of bpmn:Definitions"));if(!N&&$&&$.length&&(N=$[0]),!N)throw new Error(t("no diagram to display"));u(N);var P=N.plane;if(!P)throw new Error(t("no plane for {element}",{element:gt(N)}));var x=P.bpmnElement;if(!x){if(x=function(G){return Pe(G.rootElements,function(X){return jt(X,"bpmn:Process")||jt(X,"bpmn:Collaboration")})}(M),!x)throw new Error(t("no process or collaboration to display"));c(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:gt(P),rootElement:gt(x)})),P.bpmnElement=x,l(P)}var I,j=function(G,X){return e.root(G,X)}(x,P);if(jt(x,"bpmn:Process"))y(x,j);else{if(!jt(x,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:gt(P),rootElement:gt(x)}));L((I=x).participants,r(T)),w(I.artifacts),i.push(function(){var G;L(I.messageFlows,r(f,G))}),function(G,X){de(G,function(ee){return!n[ee.id]&&jt(ee,"bpmn:Process")&&ee.laneSets}).forEach(r(y,X))}(M.rootElements,j)}d()},handleSubProcess:C,registerDi:l}}function zx(e,t,n){var i,r,o,a=[];return new Promise(function(c,l){try{return i=e.get("bpmnImporter"),r=e.get("eventBus"),o=e.get("translate"),r.fire("import.render.start",{definitions:t}),function(u,p){new Fx({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)}(t,n),r.fire("import.render.complete",{error:void 0,warnings:a}),c({warnings:a})}catch(u){return u.warnings=a,l(u)}})}function Pr(e){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var t=arguments.length;if(!(t>=1&&ft(arguments[t-1])))return e.apply(this,arguments);var n=arguments[t-1];console.warn(new Error("Passing callbacks to "+e.name+" is deprecated and will be removed in a future major release. Please switch to promises: https://bpmn.io/l/moving-to-promises.html"));var i=Array.prototype.slice.call(arguments,0,-1);e.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 hm='';function ns(e){return e.join(";")}var Po,dm=ns(["color: #404040"]),$x='
'+hm+'Web-based tooling for BPMN, DMN and CMMN diagrams powered by bpmn.io.
';function He(e){var t,n;e=z({},Gx,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n=je(''+hm+""),t.appendChild(n),ce.bind(n,"click",function(i){Po||(Po=je($x),Gt.bind(Po,".backdrop","click",function(r){document.body.removeChild(Po)})),document.body.appendChild(Po),i.preventDefault()}),this._init(this._container,this._moddle,e)}function is(e,t){return e.warnings=t,e}ie(He,Sr),He.prototype.importXML=Pr(function(e,t){var n=this;return new Promise(function(i,r){e=n._emit("import.parse.start",{xml:e})||e,n._moddle.fromXML(e,"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 console.warn(new Error("import.parse.complete is deprecated and will be removed in future library versions")),{warnings:p.warnings,references:p.references,elementsById:p.elementsById}}}),d}({error:null,definitions:a,elementsById:u,references:c,warnings:l}))||a,n.importDefinitions(a,t).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(is(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)})})}),He.prototype.importDefinitions=Pr(function(e,t){var n=this;return new Promise(function(i,r){n._setDefinitions(e),n.open(t).then(function(o){var a=o.warnings;return i({warnings:a})}).catch(function(o){return r(o)})})}),He.prototype.open=Pr(function(e){var t=this._definitions,n=e,i=this;return new Promise(function(r,o){if(!t){var a=new Error("no XML imported");return o(is(a,[]))}if(typeof e=="string"&&(n=function(l,u){return u&&Pe(l.diagrams,function(p){return p.id===u})||null}(t,e),!n)){var c=new Error("BPMNDiagram <"+e+"> not found");return o(is(c,[]))}try{i.clear()}catch(l){return o(is(l,[]))}zx(i,t,n).then(function(l){var u=l.warnings;return r({warnings:u})}).catch(function(l){return o(l)})})}),He.prototype.saveXML=Pr(function(e){e=e||{};var t=this,n=this._definitions;return new Promise(function(i){if(!n)return i({error:new Error("no definitions loaded")});n=t._emit("saveXML.start",{definitions:n})||n,t._moddle.toXML(n,e).then(function(r){var o=r.xml;return o=t._emit("saveXML.serialized",{xml:o})||o,i({xml:o})})}).catch(function(i){return{error:i}}).then(function(i){t._emit("saveXML.done",i);var r=i.error;return r?Promise.reject(r):i})}),He.prototype.saveSVG=Pr(function(e){var t=this;return new Promise(function(n,i){var r,o;t._emit("saveSVG.start");try{var a=t.get("canvas"),c=a.getDefaultLayer(),l=Xe("defs",a._svg),u=hd(c),p=l?""+hd(l)+"":"",d=c.getBBox();r=` '+p+u+""}catch(y){o=y}return t._emit("saveSVG.done",{error:o,svg:r}),o?i(o):n({svg:r})})}),He.prototype._setDefinitions=function(e){this._definitions=e},He.prototype.getModules=function(){return this._modules},He.prototype.clear=function(){this.getDefinitions()&&(this.get("elementRegistry").forEach(function(e){var t=e.businessObject;t&&t.di&&delete t.di}),Sr.prototype.clear.call(this))},He.prototype.destroy=function(){Sr.prototype.destroy.call(this),An(this._container)},He.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},He.prototype.off=function(e,t){this.get("eventBus").off(e,t)},He.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),typeof e=="string"&&(e=Xe(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},He.prototype.getDefinitions=function(){return this._definitions},He.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},He.prototype._init=function(e,t,n){var i=n.modules||this.getModules(),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=z(Fn(n,["additionalModules"]),{canvas:z({},n.canvas,{container:e}),modules:o});Sr.call(this,a),n&&n.container&&this.attachTo(n.container)},He.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},He.prototype._createContainer=function(e){var t=je('
');return z(t.style,{width:mm(e.width),height:mm(e.height),position:e.position}),t},He.prototype._createModdle=function(e){return new jx(z({},this._moddleExtensions,e.moddleExtensions))},He.prototype._modules=[];var Gx={width:"100%",height:"100%",position:"relative"};function mm(e){return e+(pe(e)?"px":"")}function Mo(e){He.call(this,e),this.on("import.parse.complete",function(t){t.error||this._collectIds(t.definitions,t.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}A=function(e,t){var n=te(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)};function te(e){return e&&e.businessObject||e}Me=function(e){return!A(e,"bpmn:CallActivity")&&(A(e,"bpmn:SubProcess")?te(e).di&&!!te(e).di.isExpanded:!A(e,"bpmn:Participant")||!!te(e).processRef)},It=function(e){return e&&!!te(e).triggeredByEvent};function rs(e,t){var n=te(e),i=!1;return n.eventDefinitions&&L(n.eventDefinitions,function(r){A(r,t)&&(i=!0)}),i}function fm(e){return A(e,"bpmn:FlowElement")||A(e,"bpmn:Participant")||A(e,"bpmn:Lane")||A(e,"bpmn:SequenceFlow")||A(e,"bpmn:MessageFlow")||A(e,"bpmn:DataInput")||A(e,"bpmn:DataOutput")?"name":A(e,"bpmn:TextAnnotation")?"text":A(e,"bpmn:Group")?"categoryValueRef":void 0}function pn(e){var t=e.businessObject,n=fm(t);if(n)return n==="categoryValueRef"?function(i){var r=i.categoryValueRef;return r&&r.value||""}(t):t[n]||""}function Mn(e,t,n){return si(e.eventDefinitions,function(i){return i.$type===t&&function(r,o){return ji(o,function(a,c){return r[c]==a})}(e,n)})}function Mr(e){return e.businessObject.di}function Tt(e){return e.businessObject}function Ee(e,t){var n=Mr(e);return n.get("color:background-color")||n.get("bioc:fill")||t||"white"}function Z(e,t){var n=Mr(e);return n.get("color:border-color")||n.get("bioc:stroke")||t||"black"}function Ro(e,t,n){var i=Mr(e).get("label");return i&&i.get("color:color")||t||Z(e,n)}ie(Mo,He),Mo.prototype._createModdle=function(e){var t=He.prototype._createModdle.call(this,e);return t.ids=new Cn([32,36,1]),t},Mo.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var Ux=new Cn,Rr=.95;function Hi(e,t,n,i,r,o,a){zn.call(this,t,a);var c=e&&e.defaultFillColor,l=e&&e.defaultStrokeColor,u=e&&e.defaultLabelColor,p=Ux.next(),d={},y=n.computeStyle;function f(P,x){var I=z({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},x.attrs),j=x.ref||{x:0,y:0},G=x.scale||1;I.strokeDasharray==="none"&&(I.strokeDasharray=[1e4,1]);var X=oe("marker");K(x.element,I),le(X,x.element),K(X,{id:P,viewBox:"0 0 20 20",refX:j.x,refY:j.y,markerWidth:20*G,markerHeight:20*G,orient:"auto"});var ee=Xe("defs",r._svg);ee||(ee=oe("defs"),le(r._svg,ee)),le(ee,X),d[P]=X}function v(P){return P.replace(/[^0-9a-zA-z]+/g,"_")}function g(P,x,I){var j=P+"-"+v(x)+"-"+v(I)+"-"+p;return d[j]||function(G,X,ee,re){if(X==="sequenceflow-end"){var se=oe("path");K(se,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(G,{element:se,ref:{x:11,y:10},scale:.5,attrs:{fill:re,stroke:re}})}if(X==="messageflow-start"){var H=oe("circle");K(H,{cx:6,cy:6,r:3.5}),f(G,{element:H,attrs:{fill:ee,stroke:re},ref:{x:6,y:6}})}if(X==="messageflow-end"){var q=oe("path");K(q,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(G,{element:q,attrs:{fill:ee,stroke:re,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if(X==="association-start"){var xe=oe("path");K(xe,{d:"M 11 5 L 1 10 L 11 15"}),f(G,{element:xe,attrs:{fill:"none",stroke:re,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if(X==="association-end"){var ze=oe("path");K(ze,{d:"M 1 5 L 11 10 L 1 15"}),f(G,{element:ze,attrs:{fill:"none",stroke:re,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if(X==="conditional-flow-marker"){var ct=oe("path");K(ct,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(G,{element:ct,attrs:{fill:ee,stroke:re},ref:{x:-1,y:10},scale:.5})}if(X==="conditional-default-flow-marker"){var Ie=oe("path");K(Ie,{d:"M 6 4 L 10 16"}),f(G,{element:Ie,attrs:{stroke:re},ref:{x:0,y:10},scale:.5})}}(j,P,x,I),"url(#"+j+")"}function b(P,x,I,j,G){et(j)&&(G=j,j=0),j=j||0,(G=y(G,{stroke:"black",strokeWidth:2,fill:"white"})).fill==="none"&&delete G.fillOpacity;var X=x/2,ee=I/2,re=oe("circle");return K(re,{cx:X,cy:ee,r:Math.round((x+I)/4-j)}),K(re,G),le(P,re),re}function S(P,x,I,j,G,X){et(G)&&(X=G,G=0),G=G||0,X=y(X,{stroke:"black",strokeWidth:2,fill:"white"});var ee=oe("rect");return K(ee,{x:G,y:G,width:x-2*G,height:I-2*G,rx:j,ry:j}),K(ee,X),le(P,ee),ee}function w(P,x,I){var j=Il(x,I=y(I,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return le(P,j),j}function _(P,x,I){I=y(I,["no-fill"],{strokeWidth:2,stroke:"black"});var j=oe("path");return K(j,{d:x}),K(j,I),le(P,j),j}function C(P,x,I,j){return _(x,I,z({"data-marker":P},j))}function B(P){return function(x,I){return N[P](x,I)}}function s(P){return N[P]}function h(P,x){var I=Tt(P),j=function(G){return G.$type==="bpmn:IntermediateThrowEvent"||G.$type==="bpmn:EndEvent"}(I);return I.eventDefinitions&&I.eventDefinitions.length>1?I.parallelMultiple?s("bpmn:ParallelMultipleEventDefinition")(x,P,j):s("bpmn:MultipleEventDefinition")(x,P,j):Mn(I,"bpmn:MessageEventDefinition")?s("bpmn:MessageEventDefinition")(x,P,j):Mn(I,"bpmn:TimerEventDefinition")?s("bpmn:TimerEventDefinition")(x,P,j):Mn(I,"bpmn:ConditionalEventDefinition")?s("bpmn:ConditionalEventDefinition")(x,P):Mn(I,"bpmn:SignalEventDefinition")?s("bpmn:SignalEventDefinition")(x,P,j):Mn(I,"bpmn:EscalationEventDefinition")?s("bpmn:EscalationEventDefinition")(x,P,j):Mn(I,"bpmn:LinkEventDefinition")?s("bpmn:LinkEventDefinition")(x,P,j):Mn(I,"bpmn:ErrorEventDefinition")?s("bpmn:ErrorEventDefinition")(x,P,j):Mn(I,"bpmn:CancelEventDefinition")?s("bpmn:CancelEventDefinition")(x,P,j):Mn(I,"bpmn:CompensateEventDefinition")?s("bpmn:CompensateEventDefinition")(x,P,j):Mn(I,"bpmn:TerminateEventDefinition")?s("bpmn:TerminateEventDefinition")(x,P,j):null}function m(P,x,I){I=z({size:{width:100}},I);var j=o.createText(x||"",I);return be(j).add("djs-label"),le(P,j),j}function E(P,x,I){return m(P,Tt(x).name,{box:x,align:I,padding:5,style:{fill:Ro(x,u,l)}})}function T(P,x,I){Gl(m(P,x,{box:{height:30,width:I.height},align:"center-middle",style:{fill:Ro(I,u,l)}}),0,-(-1*I.height),270)}function M(P){for(var x=P.waypoints,I="m "+x[0].x+","+x[0].y,j=1;j1)for(;c=l.shift();){if(!(c.length+pb?S.width:b},0),v=o.top;r.vertical==="middle"&&(v+=(n.height-y)/2),v-=(c||u[0].height)/4;var g=oe("text");return K(g,i),L(u,function(b){var S;switch(v+=c||b.height,r.horizontal){case"left":S=o.left;break;case"right":S=(a?f:p)-o.right-b.width;break;default:S=Math.max(((a?f:p)-b.width)/2+o.left,0)}var w=oe("tspan");K(w,{x:S,y:v}),w.textContent=b.text,le(g,w)}),tt(d),{dimensions:{width:f,height:y},element:g}};function ym(e){var t=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=z({},t,{fontSize:n},e&&e.externalStyle||{}),r=new os({style:t});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:t,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 t},this.getExternalStyle=function(){return i}}ym.$inject=["config.textRenderer"];var Jx=/\{([^{}]+)\}/g,Zx=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const Qx={__init__:["bpmnRenderer"],bpmnRenderer:["type",Hi],textRenderer:["type",ym],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(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/r.height*t.yScaleFactor,c=t.containerWidth/r.width*t.xScaleFactor,l=0;l=o.x&&c<=o.x+o.width&&l>=o.y&&l<=o.y+o.height||(t=this._canvas.getRootElement())),this._canvas.addShape(n,t,r)}else{if(!A(u,"bpmndi:BPMNEdge"))throw new Error(p("unknown di {di} for element {semantic}",{di:gt(u),semantic:gt(e)}));var v=this._getSource(e),g=this._getTarget(e);i=t&&(t.hidden||t.collapsed),n=this._elementFactory.createConnection(ls(e,{hidden:i,source:v,target:g,waypoints:tE(e,v,g)})),A(e,"bpmn:DataAssociation")&&(t=null),A(e,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,t,r)}return Nr(e)&&pn(n)&&this.addLabel(e,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},Hn.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:gt(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw bm(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),o.indexOf(t)===-1&&o.push(t)},Hn.prototype.addLabel=function(e,t){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(No.width,u.width),height:u.height},c={x:u.x+u.width/2,y:u.y+u.height/2}):(c=cs(a),l=No),z({x:c.x-l.width/2,y:c.y-l.height/2},l)}(e,t),(i=pn(t))&&(n=this._textRenderer.getExternalLabelBounds(n,i)),r=this._elementFactory.createLabel(ls(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden||!pn(t),x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,t.parent)},Hn.prototype._getEnd=function(e,t){var n,i,r=e.$type,o=this._translate;if(i=e[t+"Ref"],t==="source"&&r==="bpmn:DataInputAssociation"&&(i=i&&i[0]),(t==="source"&&r==="bpmn:DataOutputAssociation"||t==="target"&&r==="bpmn:DataInputAssociation")&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?bm(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:gt(e),side:t}))},Hn.prototype._getSource=function(e){return this._getEnd(e,"source")},Hn.prototype._getTarget=function(e){return this._getEnd(e,"target")},Hn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};const nE={__depends__:[Qx,{__depends__:[as],bpmnImporter:["type",Hn]}]};function xm(e){e&&typeof e.stopPropagation=="function"&&e.stopPropagation()}function Ir(e){return e.originalEvent||e.srcEvent}function eu(e,t){xm(e),xm(Ir(e))}function yi(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Em(e,t){return(Ir(e)||e).button===t}function gi(e){return Em(e,0)}function Dr(e){var t=Ir(e)||e;return!!gi(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function _m(e){var t=Ir(e)||e;return gi(e)&&t.shiftKey}function iE(e){return!0}function us(e){return gi(e)||function(t){return Em(t,1)}(e)}function wm(e,t,n){var i=this;function r(w,_,C){var B,s;(function(h,m){var E=l[h]||gi;return!E(m)})(w,_)||(C?s=t.getGraphics(C):(B=_.delegateTarget||_.target)&&(s=B,C=t.get(s)),s&&C&&e.fire(w,{element:C,gfx:s,originalEvent:_})===!1&&(_.stopPropagation(),_.preventDefault()))}var o={};function a(w){return o[w]}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":iE,"element.mousedown":us,"element.mouseup":us,"element.click":us,"element.dblclick":us},u="svg, .djs-element";function p(w,_,C,B){var s=o[C]=function(h){r(C,h)};B&&(l[C]=B),s.$delegate=Gt.bind(w,u,_,s)}function d(w,_,C){var B=a(C);B&&Gt.unbind(w,_,B.$delegate)}e.on("canvas.destroy",function(w){(function(_){L(c,function(C,B){d(_,B,C)})})(w.svg)}),e.on("canvas.init",function(w){(function(_){L(c,function(C,B){p(_,B,C)})})(w.svg)}),e.on(["shape.added","connection.added"],function(w){var _=w.element,C=w.gfx;e.fire("interactionEvents.createHit",{element:_,gfx:C})}),e.on(["shape.changed","connection.changed"],500,function(w){var _=w.element,C=w.gfx;e.fire("interactionEvents.updateHit",{element:_,gfx:C})}),e.on("interactionEvents.createHit",500,function(w){var _=w.element,C=w.gfx;i.createDefaultHit(_,C)}),e.on("interactionEvents.updateHit",function(w){var _=w.element,C=w.gfx;i.updateDefaultHit(_,C)});var y=g("djs-hit djs-hit-stroke"),f=g("djs-hit djs-hit-click-stroke"),v={all:g("djs-hit djs-hit-all"),"click-stroke":f,stroke:y};function g(w,_){return _=z({stroke:"white",strokeWidth:15},_||{}),n.cls(w,["no-fill","no-border"],_)}function b(w,_){var C=v[_];if(!C)throw new Error("invalid hit type <"+_+">");return K(w,C),w}function S(w,_){le(w,_)}this.removeHits=function(w){L(El(".djs-hit",w),tt)},this.createDefaultHit=function(w,_){var C,B=w.waypoints,s=w.isFrame;return B?this.createWaypointsHit(_,B):(C=s?"stroke":"all",this.createBoxHit(_,C,{width:w.width,height:w.height}))},this.createWaypointsHit=function(w,_){var C=Il(_);return b(C,"stroke"),S(w,C),C},this.createBoxHit=function(w,_,C){C=z({x:0,y:0},C);var B=oe("rect");return b(B,_),K(B,C),S(w,B),B},this.updateDefaultHit=function(w,_){var C=Xe(".djs-hit",_);if(C)return w.waypoints?function(B,s){K(B,{points:dd(s)})}(C,w.waypoints):K(C,{width:w.width,height:w.height}),C},this.fire=r,this.triggerMouseEvent=function(w,_,C){var B=c[w];if(!B)throw new Error("unmapped DOM event name <"+w+">");return r(B,_,C)},this.mouseHandler=a,this.registerEvent=p,this.unregisterEvent=d}wm.$inject=["eventBus","elementRegistry","styles"];const Io={__init__:["interactionEvents"],interactionEvents:["type",wm]};function ps(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function o(a,c){var l=oe("rect");return K(l,z({x:10,y:10,width:100,height:100},i)),le(a,l),l}e.on(["shape.added","shape.changed"],500,function(a){var c=a.element,l=a.gfx,u=Xe(".djs-outline",l);u||(u=o(l)),r.updateShapeOutline(u,c)}),e.on(["connection.added","connection.changed"],function(a){var c=a.element,l=a.gfx,u=Xe(".djs-outline",l);u||(u=o(l)),r.updateConnectionOutline(u,c)})}ps.prototype.updateShapeOutline=function(e,t){K(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},ps.prototype.updateConnectionOutline=function(e,t){var n=vt(t);K(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},ps.$inject=["eventBus","styles","elementRegistry"];const Sm={__init__:["outline"],outline:["type",ps]};function Br(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=[];var n=this;e.on(["shape.remove","connection.remove"],function(i){var r=i.element;n.deselect(r)}),e.on(["diagram.clear","plane.set"],function(i){n.select(null)})}Br.$inject=["eventBus","canvas"],Br.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(n!==-1){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},Br.prototype.get=function(){return this._selectedElements},Br.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},Br.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();ge(e)||(e=e?[e]:[]);var r=this._canvas;e=e.filter(function(o){return r.findPlane(o)===r.getActivePlane()}),t?L(e,function(o){n.indexOf(o)===-1&&n.push(o)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Cm="hover",Tm="selected";function Am(e,t,n,i){function r(a,c){t.addMarker(a,c)}function o(a,c){t.removeMarker(a,c)}this._multiSelectionBox=null,e.on("element.hover",function(a){r(a.element,Cm)}),e.on("element.out",function(a){o(a.element,Cm)}),e.on("selection.changed",function(a){var c=a.oldSelection,l=a.newSelection;L(c,function(u){l.indexOf(u)===-1&&o(u,Tm)}),L(l,function(u){c.indexOf(u)===-1&&r(u,Tm)})})}function km(e,t,n,i){e.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;ge(l)?t.select(l):t.select(c.filter(rE))}}),e.on("connect.end",500,function(r){var o=r.context,a=o.canExecute,c=o.hover;a&&c&&t.select(c)}),e.on("shape.move.end",500,function(r){var o=r.previousSelection||[],a=i.get(r.context.shape.id);Pe(o,function(c){return a.id===c.id})||t.select(a)}),e.on("element.click",function(r){if(gi(r)){var o=r.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),c=t.get().length>1,l=Dr(r)||_m(r);if(a&&c)return l?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,l)}})}function rE(e){return!e.hidden}Am.$inject=["eventBus","canvas","selection","styles"],km.$inject=["eventBus","selection","canvas","elementRegistry"];const Rn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Io,Sm],selection:["type",Br],selectionVisuals:["type",Am],selectionBehavior:["type",km]};function tu(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}tu.prototype.next=function(){return this._prefix+ ++this._counter};var oE=new tu("ov");function ut(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=oE,this._overlayDefaults=z({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),o=je('
'),r.insertBefore(o,r.firstChild),o),this._init()}function Pm(e,t,n){z(e.style,{left:t+"px",top:n+"px"})}function Do(e,t){e.style.display=t===!1?"none":""}function Mm(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}ut.$inject=["config.overlays","eventBus","canvas","elementRegistry"],ut.prototype.get=function(e){if(Dt(e)&&(e={id:e}),Dt(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?de(t.overlays,Kt({type:e.type})):t.overlays.slice():[]}return e.type?de(this._overlays,Kt({type:e.type})):e.id?this._overlays[e.id]:null},ut.prototype.add=function(e,t,n){if(et(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=z({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},ut.prototype.remove=function(e){var t=this.get(e)||[];ge(t)||(t=[t]);var n=this;L(t,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(An(i.html),An(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)}})},ut.prototype.show=function(){Do(this._overlayRoot)},ut.prototype.hide=function(){Do(this._overlayRoot,!1)},ut.prototype.clear=function(){this._overlays={},this._overlayContainers=[],La(this._overlayRoot)},ut.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=vt(t);i=o.x,r=o.y}Pm(n,i,r),$t(e.html,"data-container-id",t.id)},ut.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,a=i.left,c=i.top;i.right!==void 0&&(t=o.waypoints?vt(o).width:o.width,a=-1*i.right+t),i.bottom!==void 0&&(n=o.waypoints?vt(o).height:o.height,c=-1*i.bottom+n),Pm(r,a||0,c||0)},ut.prototype._createOverlayContainer=function(e){var t=je('
');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},ut.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Mm(this._overlayRoot,n)},ut.prototype._getOverlayContainer=function(e,t){var n=Pe(this._overlayContainers,function(i){return i.element===e});return n||t?n:this._createOverlayContainer(e)},ut.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),Dt(o)&&(o=je(o)),n=this._getOverlayContainer(r),(t=je('
')).appendChild(o),e.type&&ot(t).add("djs-overlay-"+e.type);var a=this._canvas.findPlane(r),c=this._canvas.getActivePlane();e.plane=a,a!==c&&Do(t,!1),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},ut.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=e.plane,r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,c=!0;(i!==this._canvas.getActivePlane()||n&&(Wt(r)&&r>t.scale||Wt(o)&&oi&&(r=(1/t.scale||1)*i)),Wt(r)&&(c="scale("+r+","+r+")"),Mm(a,c)},ut.prototype._updateOverlaysVisibilty=function(e){var t=this;L(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},ut.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",function(n){t.hide()}),e.on("canvas.viewbox.changed",function(n){var i;i=n.viewbox,t._updateRoot(i),t._updateOverlaysVisibilty(i),t.show()}),e.on(["shape.remove","connection.remove"],function(n){var i=n.element;L(t.get({element:i}),function(a){t.remove(a.id)});var r=t._getOverlayContainer(i);if(r){An(r.html);var o=t._overlayContainers.indexOf(r);o!==-1&&t._overlayContainers.splice(o,1)}}),e.on("element.changed",500,function(n){var i=n.element,r=t._getOverlayContainer(i,!0);r&&(L(r.overlays,function(o){t._updateOverlay(o)}),t._updateOverlayContainer(r))}),e.on("element.marker.update",function(n){var i=t._getOverlayContainer(n.element,!0);i&&ot(i.html)[n.add?"add":"remove"](n.marker)}),e.on("plane.set",function(n){L(t._overlays,function(i){Do(i.htmlContainer,i.plane===n.plane)})}),e.on("diagram.clear",this.clear,this)};const nu={__init__:["overlays"],overlays:["type",ut]};function qn(e){He.call(this,e)}ie(qn,He),qn.prototype._modules=[nE,as,Rn,nu],qn.prototype._moddleExtensions={};var aE=["c","C",67],sE=["v","V",86],cE=["y","Y",89],Rm=["z","Z",90];function qt(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function hn(e,t){return(e=ge(e)?e:[e]).indexOf(t.key)!==-1||e.indexOf(t.keyCode)!==-1}function iu(e){return e.shiftKey}var hs="keyboard.keydown",Nm="input-handle-modified-keys";function pt(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),t.on("diagram.init",function(){n._fire("init")}),t.on("attach",function(){e&&e.bindTo&&n.bind(e.bindTo)}),t.on("detach",function(){n.unbind()})}pt.$inject=["config.keyboard","eventBus"],pt.prototype._keydownHandler=function(e){this._keyHandler(e,hs)},pt.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},pt.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||hs,n)&&e.preventDefault()}},pt.prototype._isEventIgnored=function(e){return(t=e.target)&&(ja(t,"input, textarea")||t.contentEditable==="true")&&this._isModifiedKeyIgnored(e);var t},pt.prototype._isModifiedKeyIgnored=function(e){return!qt(e)||!this._getAllowedModifiers(e.target).includes(e.key)},pt.prototype._getAllowedModifiers=function(e){var t=Fi(e,"["+Nm+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Nm).split(",")},pt.prototype.bind=function(e){this.unbind(),this._node=e,ce.bind(e,"keydown",this._keydownHandler,!0),ce.bind(e,"keyup",this._keyupHandler,!0),this._fire("bind")},pt.prototype.getBinding=function(){return this._node},pt.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),ce.unbind(e,"keydown",this._keydownHandler,!0),ce.unbind(e,"keyup",this._keyupHandler,!0)),this._node=null},pt.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},pt.prototype.addListener=function(e,t,n){ft(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||hs,e,t)},pt.prototype.removeListener=function(e,t){this._eventBus.off(t||hs,e)},pt.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},pt.prototype.isCmd=qt,pt.prototype.isShift=iu,pt.prototype.isKey=hn;var lE=500;function Or(e,t){var n=this;e.on("editorActions.init",lE,function(i){var r=i.editorActions;n.registerBindings(t,r)})}Or.$inject=["eventBus","keyboard"],Or.prototype.registerBindings=function(e,t){function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("undo",function(i){if(function(r){return qt(r)&&!iu(r)&&hn(Rm,r)}(i.keyEvent))return t.trigger("undo"),!0}),n("redo",function(i){if(function(r){return qt(r)&&(hn(cE,r)||hn(Rm,r)&&iu(r))}(i.keyEvent))return t.trigger("redo"),!0}),n("copy",function(i){if(function(r){return qt(r)&&hn(aE,r)}(i.keyEvent))return t.trigger("copy"),!0}),n("paste",function(i){if(function(r){return qt(r)&&hn(sE,r)}(i.keyEvent))return t.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(hn(["+","Add","="],r)&&qt(r))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(hn(["-","Subtract"],r)&&qt(r))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(hn("0",r)&&qt(r))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){if(hn(["Backspace","Delete","Del"],i.keyEvent))return t.trigger("removeSelection"),!0})};const ru={__init__:["keyboard","keyboardBindings"],keyboard:["type",pt],keyboardBindings:["type",Or]};var uE={moveSpeed:50,moveSpeedAccelerated:200};function Im(e,t,n){var i=this;this._config=z({},uE,e||{}),t.addListener(function(r){var o=r.keyEvent,a=i._config;if(t.isCmd(o)&&t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],o)){var c,l=t.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})}}Im.$inject=["config.keyboardMove","keyboard","canvas"];const Dm={__depends__:[ru],__init__:["keyboardMove"],keyboardMove:["type",Im]};var pE=/^djs-cursor-.*$/;function ds(e){var t=ot(document.body);t.removeMatching(pE),e&&t.add("djs-cursor-"+e)}function Bm(){ds(null)}var hE=5e3;function Om(e,t){function n(){return!1}return t=t||"element.click",e.once(t,hE,n),function(){e.off(t,n)}}function Bo(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Nn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Lm(e,t){var n;function i(o){var a,c=n.start,l=n.button,u=yi(o),p=Nn(u,c);!n.dragging&&(a=p,Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2))>15)&&(n.dragging=!0,l===0&&Om(e),ds("grab")),n.dragging&&(p=Nn(u,n.last||n.start),t.scroll({dx:p.x,dy:p.y}),n.last=u),o.preventDefault()}function r(o){ce.unbind(document,"mousemove",i),ce.unbind(document,"mouseup",r),n=null,Bm()}e.on("element.mousedown",500,function(o){return function(a){if(!Fi(a.target,".djs-draggable")){var c=a.button;if(!(c>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:c,start:yi(a)},ce.bind(document,"mousemove",i),ce.bind(document,"mouseup",r),!0}}(o.originalEvent)}),this.isActive=function(){return!!n}}Lm.$inject=["eventBus","canvas"];const jm={__init__:["moveCanvas"],moveCanvas:["type",Lm]};function ou(e){return Math.log(e)/Math.log(10)}function Vm(e,t){var n=ou(e.min),i=ou(e.max);return(Math.abs(n)+Math.abs(i))/t}var dE=Math.sign||function(e){return e>=0?1:-1},au={min:.2,max:4};function In(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=St(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.init",function(r){i._init(e.enabled!==!1)})}In.$inject=["config.zoomScroll","eventBus","canvas"],In.prototype.scroll=function(e){this._canvas.scroll(e)},In.prototype.reset=function(){this._canvas.zoom("fit-viewport")},In.prototype.zoom=function(e,t){var n=Vm(au,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},In.prototype._handleWheel=function(e){if(!Fi(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?e.deltaMode===0?.02:.32:e.deltaMode===0?1:16,i){var a=t.getBoundingClientRect(),c={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*dE(e.deltaY)*o,this.zoom(n,c)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},In.prototype.stepZoom=function(e,t){var n=Vm(au,10);this._zoom(e,t,n)},In.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=ou(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var c,l,u=Math.pow(10,a);i.zoom((c=au,l=u,Math.max(c.min,Math.min(c.max,l))),t)},In.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return e===void 0&&(e=!i),i!==e&&ce[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},In.prototype._init=function(e){this.toggle(e)};const Fm={__init__:["zoomScroll"],zoomScroll:["type",In]};function Oo(e){qn.call(this,e)}ie(Oo,qn),Oo.prototype._navigationModules=[Dm,jm,Fm],Oo.prototype._modules=[].concat(qn.prototype._modules,Oo.prototype._navigationModules);var zm={exports:{}};(function(e){(function(t,n,i,r){var o,a=["","webkit","Moz","MS","ms","o"],c=n.createElement("div"),l="function",u=Math.round,p=Math.abs,d=Date.now;function y(k,O,F){return setTimeout(_(k,F),O)}function f(k,O,F){return!!Array.isArray(k)&&(v(k,F[O],F),!0)}function v(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",Le=t.console&&(t.console.warn||t.console.log);return Le&&Le.call(t.console,U,ye),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 T(k){return k.trim().split(/\s+/g)}function M(k,O,F){if(k.indexOf&&!F)return k.indexOf(O);for(var U=0;UAe[O]}):U.sort()),U}function P(k,O){for(var F,U,Y=O[0].toUpperCase()+O.slice(1),ye=0;ye1&&!At.firstMultiple?At.firstMultiple=Oe(Ae):_0===1&&(At.firstMultiple=!1);var w0=At.firstInput,no=At.firstMultiple,S0=no?no.center:w0.center,C0=Ae.center=Di(rl);Ae.timeStamp=d(),Ae.deltaTime=Ae.timeStamp-w0.timeStamp,Ae.angle=xn(S0,C0),Ae.distance=_t(S0,C0),function(_n,dt){var Oi=dt.center,mr=_n.offsetDelta||{},fr=_n.prevDelta||{},vr=_n.prevInput||{};dt.eventType!==H&&vr.eventType!==q||(fr=_n.prevDelta={x:vr.deltaX||0,y:vr.deltaY||0},mr=_n.offsetDelta={x:Oi.x,y:Oi.y}),dt.deltaX=fr.x+(Oi.x-mr.x),dt.deltaY=fr.y+(Oi.y-mr.y)}(At,Ae),Ae.offsetDirection=Qe(Ae.deltaX,Ae.deltaY);var io=hr(Ae.deltaTime,Ae.deltaX,Ae.deltaY);Ae.overallVelocityX=io.x,Ae.overallVelocityY=io.y,Ae.overallVelocity=p(io.x)>p(io.y)?io.x:io.y,Ae.scale=no?(Vh=no.pointers,Fh=rl,_t(Fh[0],Fh[1],Se)/_t(Vh[0],Vh[1],Se)):1,Ae.rotation=no?function(_n,dt){return xn(dt[1],dt[0],Se)+xn(_n[1],_n[0],Se)}(no.pointers,rl):0,Ae.maxPointers=At.prevInput?Ae.pointers.length>At.prevInput.maxPointers?Ae.pointers.length:At.prevInput.maxPointers:Ae.pointers.length,function(_n,dt){var Oi,mr,fr,vr,Li=_n.lastInterval||dt,T0=dt.timeStamp-Li.timeStamp;if(dt.eventType!=xe&&(T0>se||Li.velocity===r)){var A0=dt.deltaX-Li.deltaX,k0=dt.deltaY-Li.deltaY,ro=hr(T0,A0,k0);mr=ro.x,fr=ro.y,Oi=p(ro.x)>p(ro.y)?ro.x:ro.y,vr=Qe(A0,k0),_n.lastInterval=dt}else Oi=Li.velocity,mr=Li.velocityX,fr=Li.velocityY,vr=Li.direction;dt.velocity=Oi,dt.velocityX=mr,dt.velocityY=fr,dt.direction=vr}(At,Ae);var Vh,Fh,zh=wt.element;m(Ae.srcEvent.target,zh)&&(zh=Ae.srcEvent.target),Ae.target=zh}(k,F),k.emit("hammer.input",F),k.recognize(F),k.session.prevInput=F}function Oe(k){for(var O=[],F=0;F=p(O)?k<0?ct:Ie:O<0?We:_e}function _t(k,O,F){F||(F=ht);var U=O[F[0]]-k[F[0]],Y=O[F[1]]-k[F[1]];return Math.sqrt(U*U+Y*Y)}function xn(k,O,F){F||(F=ht);var U=O[F[0]]-k[F[0]],Y=O[F[1]]-k[F[1]];return 180*Math.atan2(Y,U)/Math.PI}Ge.prototype={handler:function(){},init:function(){this.evEl&&s(this.element,this.evEl,this.domHandler),this.evTarget&&s(this.target,this.evTarget,this.domHandler),this.evWin&&s(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&h(this.element,this.evEl,this.domHandler),this.evTarget&&h(this.target,this.evTarget,this.domHandler),this.evWin&&h(I(this.element),this.evWin,this.domHandler)}};var Bi={mousedown:H,mousemove:2,mouseup:q},Yc="mousedown",vA="mousemove mouseup";function Jc(){this.evEl=Yc,this.evWin=vA,this.pressed=!1,Ge.apply(this,arguments)}w(Jc,Ge,{handler:function(k){var O=Bi[k.type];O&H&&k.button===0&&(this.pressed=!0),2&O&&k.which!==1&&(O=q),this.pressed&&(O&q&&(this.pressed=!1),this.callback(this.manager,O,{pointers:[k],changedPointers:[k],pointerType:re,srcEvent:k}))}});var yA={pointerdown:H,pointermove:2,pointerup:q,pointercancel:xe,pointerout:xe},gA={2:ee,3:"pen",4:re,5:"kinect"},p0="pointerdown",h0="pointermove pointerup pointercancel";function Mh(){this.evEl=p0,this.evWin=h0,Ge.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(p0="MSPointerDown",h0="MSPointerMove MSPointerUp MSPointerCancel"),w(Mh,Ge,{handler:function(k){var O=this.store,F=!1,U=k.type.toLowerCase().replace("ms",""),Y=yA[U],ye=gA[k.pointerType]||k.pointerType,Le=ye==ee,wt=M(O,k.pointerId,"pointerId");Y&H&&(k.button===0||Le)?wt<0&&(O.push(k),wt=O.length-1):Y&(q|xe)&&(F=!0),wt<0||(O[wt]=k,this.callback(this.manager,Y,{pointers:O,changedPointers:[k],pointerType:ye,srcEvent:k}),F&&O.splice(wt,1))}});var bA={touchstart:H,touchmove:2,touchend:q,touchcancel:xe};function d0(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Ge.apply(this,arguments)}function xA(k,O){var F=N(k.touches),U=N(k.changedTouches);return O&(q|xe)&&(F=$(F.concat(U),"identifier",!0)),[F,U]}w(d0,Ge,{handler:function(k){var O=bA[k.type];if(O===H&&(this.started=!0),this.started){var F=xA.call(this,k,O);O&(q|xe)&&F[0].length-F[1].length==0&&(this.started=!1),this.callback(this.manager,O,{pointers:F[0],changedPointers:F[1],pointerType:ee,srcEvent:k})}}});var EA={touchstart:H,touchmove:2,touchend:q,touchcancel:xe},_A="touchstart touchmove touchend touchcancel";function Zc(){this.evTarget=_A,this.targetIds={},Ge.apply(this,arguments)}function wA(k,O){var F=N(k.touches),U=this.targetIds;if(O&(2|H)&&F.length===1)return U[F[0].identifier]=!0,[F,F];var Y,ye,Le=N(k.changedTouches),wt=[],Ae=this.target;if(ye=F.filter(function(At){return m(At.target,Ae)}),O===H)for(Y=0;Y-1&&U.splice(Y,1)},SA)}}function TA(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+b0(F)),U(O.options.event),k.additionalEvent&&U(k.additionalEvent),F>=8&&U(O.options.event+b0(F))},tryEmit:function(k){if(this.canEmit())return this.emit(k);this.state=ni},canEmit:function(){for(var k=0;kO.threshold&&Y&O.direction},attrTest:function(k){return En.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=x0(k.direction);O&&(k.additionalEvent=this.options.event+O),this._super.emit.call(this,k)}}),w(Dh,En,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[dr]},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)}}),w(Bh,ii,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[g0]},process:function(k){var O=this.options,F=k.pointers.length===O.pointers,U=k.distanceO.time;if(this._input=k,!U||!F||k.eventType&(q|xe)&&!Y)this.reset();else if(k.eventType&H)this.reset(),this._timer=y(function(){this.state=8,this.tryEmit()},O.time,this);else if(k.eventType&q)return 8;return ni},reset:function(){clearTimeout(this._timer)},emit:function(k){this.state===8&&(k&&k.eventType&q?this.manager.emit(this.options.event+"up",k):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),w(Oh,En,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[dr]},attrTest:function(k){return this._super.attrTest.call(this,k)&&(Math.abs(k.rotation)>this.options.threshold||2&this.state)}}),w(Lh,En,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:$e|Ke,pointers:1},getTouchAction:function(){return nl.prototype.getTouchAction.call(this)},attrTest:function(k){var O,F=this.options.direction;return F&($e|Ke)?O=k.overallVelocity:F&$e?O=k.overallVelocityX:F&Ke&&(O=k.overallVelocityY),this._super.attrTest.call(this,k)&&F&k.offsetDirection&&k.distance>this.options.threshold&&k.maxPointers==this.options.pointers&&p(O)>this.options.velocity&&k.eventType&q},emit:function(k){var O=x0(k.offsetDirection);O&&this.manager.emit(this.options.event+O,k),this.manager.emit(this.options.event,k)}}),w(il,ii,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Nh]},process:function(k){var O=this.options,F=k.pointers.length===O.pointers,U=k.distance1&&(p=!0),d.elements.length}),p)return l[e]=uu(n).center,l;i=t[0],r=uu(t=Xt(t,function(d){return d[a]+d[c]})),l[e]=function(d,y){return Math.round((d[a]+y[a]+y[c])/2)}(i,r)}return l},Lr.prototype.trigger=function(e,t){var n=this._modeling,i=de(e,function(a){return!(a.waypoints||a.host||a.labelTarget)});if(!(i.length<2)){var r=Xt(i,fE[t]),o=this._alignmentPosition(t,r);n.alignElements(r,o)}};const vE={__init__:["alignElements"],alignElements:["type",Lr]};var yE=10,qm=50,gE=250;function pu(e,t,n,i){for(var r;r=bE(e,n,t);)n=i(t,n,r);return n}function hu(e){return function(t,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=e[o];if(a){var c=o==="x"?"width":"height",l=a.margin,u=a.minDistance;r[o]=l<0?Math.min(i[o]+l-t[c]/2,n[o]-u+l):Math.max(i[o]+i[c]+l+t[c]/2,n[o]+u+l)}}),r}}function bE(e,t,n){var i={x:t.x-n.width/2,y:t.y-n.height/2,width:n.width,height:n.height},r=function(o){var a=du(o);return o.host&&(a=a.concat(du(o.host))),o.attachers&&(a=a.concat(o.attachers.reduce(function(c,l){return c.concat(du(l))},[]))),a}(e);return Pe(r,function(o){return o!==n&&yt(o,i,yE)==="intersect"})}function du(e){return(t=e,t.outgoing.map(function(n){return n.target})).concat(function(n){return n.incoming.map(function(i){return i.source})}(e));var t}function xE(){return!0}function Wm(e,t,n){e.on("autoPlace",100,function(i){var r=i.shape;return function(o,a,c){c||(c={});var l=c.defaultDistance||qm,u=fe(o),p=ae(o);return{x:p.right+l+a.width/2,y:u.y}}(i.source,r)}),e.on("autoPlace.end",function(i){n.scrollToElement(i.shape)}),this.append=function(i,r,o){e.fire("autoPlace.start",{source:i,shape:r});var a=e.fire("autoPlace",{source:i,shape:r}),c=t.appendShape(i,r,a,i.parent,o);return e.fire("autoPlace.end",{source:i,shape:c}),c}}function Xm(e,t){e.on("autoPlace.end",500,function(n){t.select(n.shape)})}Wm.$inject=["eventBus","modeling","canvas"],Xm.$inject=["eventBus","selection"];const EE={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",Wm],autoPlaceSelectionBehavior:["type",Xm]};we=function(e,t){return si(t,function(n){return A(e,n)})};function fs(e,t){for(typeof t=="string"&&(t=[t]);e=e.parent;)if(we(e,t))return e;return null}function Km(e,t){return A(t,"bpmn:TextAnnotation")?function(n,i){var r=ae(n),o={x:r.right+i.width/2,y:r.top-50-i.height/2};return pu(n,i,o,hu({y:{margin:-30,minDistance:20}}))}(e,t):we(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(n,i){var r=ae(n),o={x:r.right-10+i.width/2,y:r.bottom+40+i.width/2};return pu(n,i,o,hu({x:{margin:30,minDistance:30}}))}(e,t):A(t,"bpmn:FlowNode")?function(n,i){var r=ae(n),o=fe(n),a=function(d,y){y||(y={});var f=y.defaultDistance||qm,v=y.direction||"e",g=y.filter,b=y.getWeight||function(h){return h.source===d?1:-1},S=y.maxDistance||gE,w=y.reference||"start";function _(h,m){return v==="n"?w==="start"?ae(h).top-ae(m).bottom:w==="center"?ae(h).top-fe(m).y:ae(h).top-ae(m).top:v==="w"?w==="start"?ae(h).left-ae(m).right:w==="center"?ae(h).left-fe(m).x:ae(h).left-ae(m).left:v==="s"?w==="start"?ae(m).top-ae(h).bottom:w==="center"?fe(m).y-ae(h).bottom:ae(m).bottom-ae(h).bottom:w==="start"?ae(m).left-ae(h).right:w==="center"?fe(m).x-ae(h).right:ae(m).right-ae(h).right}g||(g=xE);var C=d.incoming.filter(g).map(function(h){var m=b(h),E=m<0?_(h.source,d):_(d,h.source);return{id:h.source.id,distance:E,weight:m}}),B=d.outgoing.filter(g).map(function(h){var m=b(h),E=m>0?_(d,h.target):_(h.target,d);return{id:h.target.id,distance:E,weight:m}}),s=Bt(C.concat(B).reduce(function(h,m){return h[m.id+"__weight_"+m.weight]=m,h},{}),function(h,m){var E=m.distance,T=m.weight;return E<0||E>S||(h[String(E)]||(h[String(E)]=0),h[String(E)]+=1*T,(!h.distance||h[h.distance]a.top&&(c=c.concat("n")),o.righta.left&&(c=c.concat("e")),c}(Yt(t,["x","y","width","height"]),n);this.resize(t,n,{autoResize:i});var r=t.parent;r&&this._expand([t],r)}}},Wn.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},Wn.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},Wn.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},vs.$inject=["injector"],ie(vs,Wn),vs.prototype.resize=function(e,t,n){A(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},bi.$inject=["eventBus"],ie(bi,Q),bi.prototype.addRule=function(e,t,n){var i=this;typeof e=="string"&&(e=[e]),e.forEach(function(r){i.canExecute(r,t,function(o,a,c){return n(o)},!0)})},bi.prototype.init=function(){},Lo.$inject=["eventBus"],ie(Lo,bi),Lo.prototype.canResize=function(e,t){return!1},ie(ys,Lo),ys.$inject=["eventBus","modeling"],ys.prototype.canResize=function(e,t){if(!A(t,"bpmn:Participant")&&!A(t,"bpmn:Lane")&&!A(t,"bpmn:SubProcess"))return!1;var n=!0;return L(e,function(i){(A(i,"bpmn:Lane")||i.labelTarget)&&(n=!1)}),n};const SE={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",vs],bpmnAutoResizeProvider:["type",ys]};function Jm(e,t,n){var i,r,o=this,a=n.get("dragging",!1);a&&t.on("drag.start",function(c){t.once("drag.move",1500,function(l){(function(u){if(!u.hover){var p=u.originalEvent,d=o._findTargetGfx(p),y=d&&e.get(d);d&&y&&(u.stopPropagation(),a.hover({element:y,gfx:d}),a.move(p))}})(l)})}),t.on("element.hover",function(c){i=c.gfx,r=c.element}),t.on("element.hover",1500,function(c){r&&t.fire("element.out",{element:r,gfx:i})}),t.on("element.out",function(){i=null,r=null}),this._findTargetGfx=function(c){var l;if(c instanceof MouseEvent)return l=yi(c),function(u){return Fi(u,"svg, .djs-element",!0)}(document.elementFromPoint(l.x,l.y))}}Jm.$inject=["elementRegistry","eventBus","injector"];const CE={__init__:["hoverFix"],hoverFix:["type",Jm]};var jr=Math.round,Zm="djs-drag-active";function Wi(e){e.preventDefault()}function Qm(e,t,n,i){var r,o={threshold:5,trapClick:!0};function a(S){var w=t.viewbox(),_=t._container.getBoundingClientRect();return{x:w.x+(S.x-_.left)/w.scale,y:w.y+(S.y-_.top)/w.scale}}function c(S,w){w=w||r;var _=e.createEvent(z({},w.payload,w.data,{isTouch:w.isTouch}));return e.fire("drag."+S,_)!==!1&&e.fire(w.prefix+"."+S,_)}function l(S,w){var _,C=r.payload,B=r.displacement,s=r.globalStart,h=yi(S),m=Nn(h,s),E=r.localStart,T=a(h),M=Nn(T,E);if(!r.active&&(w||(_=m,Math.sqrt(Math.pow(_.x,2)+Math.pow(_.y,2))>r.threshold))){if(z(C,{x:jr(E.x+B.x),y:jr(E.y+B.y),dx:0,dy:0},{originalEvent:S}),c("start")===!1)return g();r.active=!0,r.keepSelection||(C.previousSelection=n.get(),n.select(null)),r.cursor&&ds(r.cursor),t.addMarker(t.getRootElement(),Zm)}eu(S),r.active&&(z(C,{x:jr(T.x+B.x),y:jr(T.y+B.y),dx:jr(M.x),dy:jr(M.y)},{originalEvent:S}),c("move"))}function u(S){var w=!0;r.active&&(S&&(r.payload.originalEvent=S,eu(S)),w=c("end")),w===!1&&c("rejected"),c("ended",b(w!==!0))}function p(S){S.which===27&&(Wi(S),g())}function d(S){var w;r.active&&(w=Om(e),setTimeout(w,400),Wi(S)),u(S)}function y(S){l(S)}function f(S){var w=r.payload;w.hoverGfx=S.gfx,w.hover=S.element,c("hover")}function v(S){c("out");var w=r.payload;w.hoverGfx=null,w.hover=null}function g(S){var w;if(r){var _=r.active;_&&c("cancel"),w=b(S),_&&c("canceled",w)}}function b(S){var w,_;c("cleanup"),Bm(),_=r.trapClick?d:u,ce.unbind(document,"mousemove",l),ce.unbind(document,"dragstart",Wi),ce.unbind(document,"selectstart",Wi),ce.unbind(document,"mousedown",_,!0),ce.unbind(document,"mouseup",_,!0),ce.unbind(document,"keyup",p),ce.unbind(document,"touchstart",y,!0),ce.unbind(document,"touchcancel",g,!0),ce.unbind(document,"touchmove",l,!0),ce.unbind(document,"touchend",u,!0),e.off("element.hover",f),e.off("element.out",v),t.removeMarker(t.getRootElement(),Zm);var C=r.payload.previousSelection;return S!==!1&&C&&!n.get().length&&function(B){var s=B.filter(function(h){return i.get(h.id)});s.length&&n.select(s)}(C),w=r,r=null,w}e.on("diagram.destroy",g),this.init=function(S,w,_,C){r&&g(!1),typeof w=="string"&&(C=_,_=w,w=null);var B,s,h,m,E,T=(C=z({},o,C||{})).data||{};m=C.trapClick?d:u,S?(B=Ir(S)||S,s=yi(S),eu(S),B.type==="dragstart"&&Wi(B)):(B=null,s={x:0,y:0}),h=a(s),w||(w=h),E=function(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}(B),r=z({prefix:_,data:T,payload:{},globalStart:s,displacement:Nn(w,h),localStart:h,isTouch:E},C),C.manual||(E?(ce.bind(document,"touchstart",y,!0),ce.bind(document,"touchcancel",g,!0),ce.bind(document,"touchmove",l,!0),ce.bind(document,"touchend",u,!0)):(ce.bind(document,"mousemove",l),ce.bind(document,"dragstart",Wi),ce.bind(document,"selectstart",Wi),ce.bind(document,"mousedown",m,!0),ce.bind(document,"mouseup",m,!0)),ce.bind(document,"keyup",p),e.on("element.hover",f),e.on("element.out",v)),c("init"),C.autoActivate&&l(S,!0)},this.move=l,this.hover=f,this.out=v,this.end=u,this.cancel=g,this.context=function(){return r},this.setOptions=function(S){z(o,S)}}Qm.$inject=["eventBus","canvas","selection","elementRegistry"];const Xn={__depends__:[CE,Rn],dragging:["type",Qm]};function Vr(e,t,n){this._canvas=n,this._opts=z({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var i=this;t.on("drag.move",function(r){var o=i._toBorderPoint(r);i.startScroll(o)}),t.on(["drag.cleanup"],function(){i.stopScroll()})}function TE(e,t,n){return t=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 e.CSS||(e.CSS={}),e.CSS.escape=t,t}(P0);const gu=oo(af.exports);var ME={"&":"&","<":"<",">":">",'"':""","'":"'"};function sf(e){return(e=""+e)&&e.replace(/[&<>"']/g,function(t){return ME[t]})}function cf(e,t,n,i,r){function o(v,g){var b,S=g.waypoints,w=vu(t,S,v);if(w)return b=function(_,C){var B,s,h=_.waypoints;return C.index<=0||C.bendpoint?null:(s=$n((B={start:h[C.index-1],end:h[C.index]}).start,B.end))?of(s==="h"?B.end.x-B.start.x:B.end.y-B.start.y)/2:null}(g,w),function(_,C,B){var s,h,m,E,T,M,N=_.index,$=_.point;return!(N<=0||_.bendpoint)&&(m=Ol(s=C[N-1],h=C[N]),E=$n(s,h),T=Math.abs($.x-m.x),M=Math.abs($.y-m.y),E&&T<=B&&M<=B)}(w,S,b)?r.start(v,g,w.index):i.start(v,g,w.index,!w.bendpoint),!0}function a(v,g,b){ce.bind(v,g,function(S){n.triggerMouseEvent(g,S,b),S.stopPropagation()})}function c(v,g){var b=t.getLayer("overlays"),S=Xe('.djs-bendpoints[data-element-id="'+gu(v.id)+'"]',b);return!S&&g&&(K(S=oe("g"),{"data-element-id":v.id}),be(S).add("djs-bendpoints"),le(b,S),a(S,"mousedown",v),a(S,"click",v),a(S,"dblclick",v)),S}function l(v,g){return Xe('.djs-segment-dragger[data-segment-idx="'+v+'"]',g)}function u(v,g){g.waypoints.forEach(function(b,S){var w=yu(v);le(v,w),Lt(w,b.x,b.y)}),yu(v,"floating")}function p(v,g){for(var b,S,w,_=g.waypoints,C=1;C<_.length;C++)$n(b=_[C-1],S=_[C])&&(K(w=rf(v,b,S),{"data-segment-idx":C}),a(w,"mousemove",g))}function d(v){var g=c(v);return g||(u(g=c(v,!0),v),p(g,v)),g}function y(v){var g=c(v);g&&(function(b){L(El("."+nf,b),function(S){tt(S)})}(g),function(b){L(El("."+tf,b),function(S){tt(S)})}(g),p(g,v),u(g,v))}function f(v,g,b){var S,w,_=l(g.index,v),C=b[g.index-1],B=b[g.index],s=g.point,h=Ol(C,B),m=$n(C,B);_&&(S=function(E){return Xe(".djs-visual",E)}(_),w={x:s.x-h.x,y:s.y-h.y},m==="v"&&(w={x:w.y,y:w.x}),Lt(S,w.x,w.y))}e.on("connection.changed",function(v){y(v.element)}),e.on("connection.remove",function(v){var g=c(v.element);g&&tt(g)}),e.on("element.marker.update",function(v){var g,b=v.element;b.waypoints&&(g=d(b),v.add?be(g).add(v.marker):be(g).remove(v.marker))}),e.on("element.mousemove",function(v){var g,b,S=v.element,w=S.waypoints;if(w){if(g=c(S,!0),!(b=vu(t,w,v.originalEvent)))return;(function(_,C){var B=Xe(".floating",_),s=C.point;B&&Lt(B,s.x,s.y)})(g,b),b.bendpoint||f(g,b,w)}}),e.on("element.mousedown",function(v){if(gi(v)){var g=v.originalEvent,b=v.element;if(b.waypoints)return o(g,b)}}),e.on("selection.changed",function(v){var g=v.newSelection[0];g&&g.waypoints&&d(g)}),e.on("element.hover",function(v){var g=v.element;g.waypoints&&(d(g),n.registerEvent(v.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(v){n.unregisterEvent(v.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(v){var g=v.element,b=v.newId;if(g.waypoints){var S=c(g);S&&K(S,{"data-element-id":b})}}),this.addHandles=d,this.updateHandles=y,this.getBendpointsContainer=c,this.getSegmentDragger=l}cf.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var lf=Math.round,Xi="reconnectStart",Ki="reconnectEnd",jo="updateWaypoints";function bu(e,t,n,i,r,o){this._injector=e,this.start=function(a,c,l,u){var p,d=n.getGraphics(c),y=c.source,f=c.target,v=c.waypoints,g=(p=u||l!==0?u||l!==v.length-1?jo:Ki:Xi)===jo?"connection.updateWaypoints":"connection.reconnect",b=r.allowed(g,{connection:c,source:y,target:f});b===!1&&(b=r.allowed(g,{connection:c,source:f,target:y})),b!==!1&&i.init(a,"bendpoint.move",{data:{connection:c,connectionGfx:d,context:{allowed:b,bendpointIndex:l,connection:c,source:y,target:f,insert:u,type:p}}})},t.on("bendpoint.move.hover",function(a){var c,l=a.context,u=l.connection,p=u.source,d=u.target,y=a.hover,f=l.type;if(l.hover=y,y){var v=f===jo?"connection.updateWaypoints":"connection.reconnect";if(c=l.allowed=r.allowed(v,{connection:u,source:f===Xi?y:p,target:f===Ki?y:d}))return l.source=f===Xi?y:p,void(l.target=f===Ki?y:d);c===!1&&(c=l.allowed=r.allowed(v,{connection:u,source:f===Ki?y:d,target:f===Xi?y:p})),c&&(l.source=f===Ki?y:d,l.target=f===Xi?y:p)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(a){var c=a.context,l=c.type;c.hover=null,c.source=null,c.target=null,l!==jo&&(c.allowed=!1)}),t.on("bendpoint.move.end",function(a){var c=a.context,l=c.allowed,u=c.bendpointIndex,p=c.connection,d=c.insert,y=p.waypoints.slice(),f=c.source,v=c.target,g=c.type,b=c.hints||{},S={x:lf(a.x),y:lf(a.y)};if(!l)return!1;g===jo?(d?y.splice(u,0,S):y[u]=S,b.bendpointMove={insert:d,bendpointIndex:u},y=this.cropWaypoints(p,y),o.updateWaypoints(p,function(w){w=w.slice();for(var _,C,B,s=0;w[s];)_=w[s],C=w[s-1],_o(_,B=w[s+1])===0||Bl(C,B,_)?w.splice(s,1):s++;return w}(y),b)):(g===Xi?(b.docking="source",bs(c)&&(b.docking="target",b.newWaypoints=y.reverse())):g===Ki&&(b.docking="target",bs(c)&&(b.docking="source",b.newWaypoints=y.reverse())),o.reconnect(p,f,v,S,b))},this)}function bs(e){var t=e.hover,n=e.source,i=e.target,r=e.type;return r===Xi?t&&i&&t===i&&n!==i:r===Ki?t&&n&&t===n&&n!==i:void 0}bu.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],bu.prototype.cropWaypoints=function(e,t){var n=this._injector.get("connectionDocking",!1);if(!n)return t;var i=e.waypoints;return e.waypoints=t,e.waypoints=n.getCroppedWaypoints(e),t=e.waypoints,e.waypoints=i,t};var uf="updateWaypoints",Vo="connect-ok",xs="connect-not-ok",pf="connect-hover",hf="djs-updating",df="djs-element-hidden";function mf(e,t,n,i){this._injector=t;var r=t.get("connectionPreview",!1);n.on("bendpoint.move.start",function(o){var a=o.context,c=a.bendpointIndex,l=a.connection,u=a.insert,p=l.waypoints,d=p.slice();a.waypoints=p,u&&d.splice(c,0,{x:o.x,y:o.y}),l.waypoints=d,be(a.draggerGfx=yu(i.getLayer("overlays"))).add("djs-dragging"),i.addMarker(l,df),i.addMarker(l,hf)}),n.on("bendpoint.move.hover",function(o){var a=o.context,c=a.allowed,l=a.hover,u=a.type;if(l){if(i.addMarker(l,pf),u===uf)return;c?(i.removeMarker(l,xs),i.addMarker(l,Vo)):c===!1&&(i.removeMarker(l,Vo),i.addMarker(l,xs))}}),n.on(["bendpoint.move.out","bendpoint.move.cleanup"],1100,function(o){var a=o.context,c=a.hover,l=a.target;c&&(i.removeMarker(c,pf),i.removeMarker(c,l?Vo:xs))}),n.on("bendpoint.move.move",function(o){var a=o.context,c=a.allowed,l=a.bendpointIndex,u=a.draggerGfx,p=a.hover,d=a.type,y=a.connection,f=y.source,v=y.target,g=y.waypoints.slice(),b={x:o.x,y:o.y},S=a.hints||{},w={};r&&(S.connectionStart&&(w.connectionStart=S.connectionStart),S.connectionEnd&&(w.connectionEnd=S.connectionEnd),d==="reconnectStart"?bs(a)?(w.connectionEnd=w.connectionEnd||b,w.source=v,w.target=p||f,g=g.reverse()):(w.connectionStart=w.connectionStart||b,w.source=p||f,w.target=v):d==="reconnectEnd"?bs(a)?(w.connectionStart=w.connectionStart||b,w.source=p||v,w.target=f,g=g.reverse()):(w.connectionEnd=w.connectionEnd||b,w.source=f,w.target=p||v):(w.noCropping=!0,w.noLayout=!0,g[l]=b),d===uf&&(g=e.cropWaypoints(y,g)),w.waypoints=g,r.drawPreview(a,c,w)),Lt(u,o.x,o.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],1100,function(o){var a=o.context,c=a.connection,l=a.draggerGfx,u=a.hover,p=a.target,d=a.waypoints;c.waypoints=d,tt(l),i.removeMarker(c,hf),i.removeMarker(c,df),u&&(i.removeMarker(u,Vo),i.removeMarker(u,p?Vo:xs)),r&&r.cleanUp(a)})}mf.$inject=["bendpointMove","injector","eventBus","canvas"];var ff="connect-hover",vf="djs-updating";function yf(e,t,n){return xu(e,t,e[t]+n)}function xu(e,t,n){return{x:t==="x"?n:e.x,y:t==="y"?n:e.y}}function gf(e){return e==="x"?"y":"x"}function bf(e,t,n){var i,r;return e.original?e.original:(i=fe(t),xu(e,r=gf(n),i[r]))}function xf(e,t,n,i,r,o){var a=e.get("connectionDocking",!1);function c(p,d){if(!a)return d;var y,f=p.waypoints;return p.waypoints=d,y=a.getCroppedWaypoints(p),p.waypoints=f,y}function l(p){r.update("connection",p.connection,p.connectionGfx)}function u(p,d,y){var f=p.newWaypoints,v=function(g,b,S,w){var _=Math.max(b[w],S[w]),C=Math.min(b[w],S[w]);return xu(b,w,Math.min(Math.max(C+20,g[w]),_-20))}(y,f[p.segmentStartIndex+d],f[p.segmentEndIndex+d],gf(p.axis));Lt(p.draggerGfx,v.x,v.y)}this.start=function(p,d,y){var f,v,g,b,S=n.getGraphics(d),w=y-1,_=y,C=d.waypoints,B=C[w],s=C[_],h=vu(n,C,p);(v=$n(B,s))&&(g=v==="v"?"x":"y",w===0&&(B=bf(B,d.source,g)),_===C.length-1&&(s=bf(s,d.target,g)),f={connection:d,segmentStartIndex:w,segmentEndIndex:_,segmentStart:B,segmentEnd:s,axis:g,dragPosition:b=h?h.point:{x:(B.x+s.x)/2,y:(B.y+s.y)/2}},i.init(p,b,"connectionSegment.move",{cursor:g==="x"?"resize-ew":"resize-ns",data:{connection:d,connectionGfx:S,context:f}}))},t.on("connectionSegment.move.start",function(p){var d=p.context,y=p.connection,f=n.getLayer("overlays");d.originalWaypoints=y.waypoints.slice(),d.draggerGfx=rf(f,d.segmentStart,d.segmentEnd),be(d.draggerGfx).add("djs-dragging"),n.addMarker(y,vf)}),t.on("connectionSegment.move.move",function(p){var d,y,f=p.context,v=f.connection,g=f.segmentStartIndex,b=f.segmentEndIndex,S=f.segmentStart,w=f.segmentEnd,_=f.axis,C=f.originalWaypoints.slice(),B=yf(S,_,p["d"+_]),s=yf(w,_,p["d"+_]),h=C.length,m=0;C[g]=B,C[b]=s,g<2&&(d=yt(v.source,B),g===1?d==="intersect"&&(C.shift(),C[0]=B,m--):d!=="intersect"&&(C.unshift(S),m++)),b>h-3&&(y=yt(v.target,s),b===h-2?y==="intersect"&&(C.pop(),C[C.length-1]=s):y!=="intersect"&&C.push(w)),f.newWaypoints=v.waypoints=c(v,C),u(f,m,p),f.newSegmentStartIndex=g+m,l(p)}),t.on("connectionSegment.move.hover",function(p){p.context.hover=p.hover,n.addMarker(p.hover,ff)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(p){var d=p.context.hover;d&&n.removeMarker(d,ff)}),t.on("connectionSegment.move.cleanup",function(p){var d=p.context,y=d.connection;d.draggerGfx&&tt(d.draggerGfx),n.removeMarker(y,vf)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(p){var d=p.context;d.connection.waypoints=d.originalWaypoints,l(p)}),t.on("connectionSegment.move.end",function(p){var d=p.context,y=d.connection,f=d.newWaypoints,v=d.newSegmentStartIndex,g=function(_,C){var B=0;return{waypoints:_.filter(function(s,h){return!Bl(_[h-1],_[h+1],s)||(B=h<=C?B-1:B,!1)}),segmentOffset:B}}(f=f.map(function(_){return{original:_.original,x:Math.round(_.x),y:Math.round(_.y)}}),v),b=c(y,g.waypoints),S=g.segmentOffset,w={segmentMove:{segmentStartIndex:d.segmentStartIndex,newSegmentStartIndex:v+S}};o.updateWaypoints(y,b,w)})}xf.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var RE=Math.abs,Ef=Math.round;function _f(e){return{x:e.x,y:e.y}}function wf(e){return{x:e.x+e.width,y:e.y+e.height}}function Qt(e,t){return!e||isNaN(e.x)||isNaN(e.y)?t:{x:Ef(e.x+e.width/2),y:Ef(e.y+e.height/2)}}function Fr(e,t){var n=e.snapped;return!!n&&(typeof t=="string"?n[t]:n.x&&n.y)}function st(e,t,n){if(typeof t!="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=e[t],o=e.snapped=e.snapped||{};return n===!1?o[t]=!1:(o[t]=!0,i=n-r,e[t]+=i,e["d"+t]+=i),r}function Sf(e){return e.children||[]}var NE=Math.abs,Cf=Math.round;function Tf(e){function t(i,r){if(ge(i)){for(var o=i.length;o--;)if(NE(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:Cf(i.width/2+i.x),y:Cf(i.height/2+i.y)}}e.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,S=d.segmentEnd,w=d.segmentEndIndex,_=d.axis;if(y)return y;var C=[v[b-1],g,S,v[w+1]];return b<2&&C.unshift(n(f.source)),w>v.length-3&&C.unshift(n(f.target)),d.snapPoints=y={horizontal:[],vertical:[]},L(C,function(B){B&&(B=B.original||B,_==="y"&&y.horizontal.push(B.y),_==="x"&&y.vertical.push(B.x))}),y}(i.context),c=i.x,l=i.y;if(a){var u=c-(r=t(a.vertical,c)),p=l-(o=t(a.horizontal,l));z(i,{dx:i.dx-u,dy:i.dy-p,x:r,y:o}),(u||a.vertical.indexOf(c)!==-1)&&st(i,"x",r),(p||a.horizontal.indexOf(l)!==-1)&&st(i,"y",o)}}),e.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,S=v.bendpointIndex;if(g)return g;var w=[b[S-1],b[S+1]];return v.snapPoints=g={horizontal:[],vertical:[]},L(w,function(_){_&&(_=_.original||_,g.horizontal.push(_.y),g.vertical.push(_.x))}),g}(a),l=a.hover,u=l&&n(l),p=i.x,d=i.y;if(c){var y=p-(r=t(u?c.vertical.concat([u.x]):c.vertical,p)),f=d-(o=t(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)&&st(i,"x",r),(f||c.horizontal.indexOf(d)!==-1)&&st(i,"y",o)}})}Tf.$inject=["eventBus"];const IE={__depends__:[Xn,Dn],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",cf],bendpointMove:["type",bu],bendpointMovePreview:["type",mf],connectionSegmentMove:["type",xf],bendpointSnapping:["type",Tf]};function Af(e,t,n,i){function r(o,a){return i.allowed("connection.create",{source:o,target:a})}e.on("connect.hover",function(o){var a,c=o.context,l=c.start,u=o.hover;if(c.hover=u,!yo(a=c.canExecute=r(l,u))){if(a!==!1)return c.source=l,void(c.target=u);yo(a=c.canExecute=r(u,l))||a!==!1&&(c.source=u,c.target=l)}}),e.on(["connect.out","connect.cleanup"],function(o){var a=o.context;a.hover=null,a.source=null,a.target=null,a.canExecute=!1}),e.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:Eu(a)?u:l,connectionEnd:Eu(a)?l:u};et(c)&&(y=c),n.connect(p,d,y,f)}),this.start=function(o,a,c,l){et(c)||(l=c,c=fe(a)),t.init(o,"connect",{autoActivate:l,data:{shape:a,context:{start:a,connectionStart:c}}})}}function Eu(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}Af.$inject=["eventBus","dragging","modeling","rules"];var kf="connect-ok",Pf="connect-not-ok";function Mf(e,t,n){var i=e.get("connectionPreview",!1);i&&t.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;Eu(o)&&(v=f,g=y),i.drawPreview(o,a,{source:l||u,target:d||c,connectionStart:v,connectionEnd:g})}),t.on("connect.hover",900,function(r){var o=r.context,a=r.hover,c=o.canExecute;c!==null&&n.addMarker(a,c?kf:Pf)}),t.on(["connect.out","connect.cleanup"],1100,function(r){var o=r.hover;o&&(n.removeMarker(o,kf),n.removeMarker(o,Pf))}),i&&t.on("connect.cleanup",function(r){i.cleanUp(r.context)})}Mf.$inject=["injector","eventBus","canvas"];const _u={__depends__:[Rn,Dn,Xn],__init__:["connectPreview"],connect:["type",Af],connectPreview:["type",Mf]};function Kn(e,t,n,i){this._canvas=t,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=e.get("connectionDocking",!1),this._layouter=e.get("layouter",!1)}Kn.$inject=["injector","canvas","graphicsFactory","elementFactory"],Kn.prototype.drawPreview=function(e,t,n){n=n||{};var i,r=e.connectionPreviewGfx,o=e.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=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),Cl(r),o||(o=e.getConnection=function(g){var b={};return function(S){var w=JSON.stringify(S),_=b[w];return _||(_=b[w]=g.apply(null,arguments)),_}}(function(g,b,S){return v.getConnection(g,b,S)})),t&&(i=o(t,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?fe(a):u,c?fe(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)},Kn.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||fe(n),o=t.connectionEnd||fe(i),a=this.cropWaypoints(r,o,n,i);le(e,this.createNoopConnection(a[0],a[1]))},Kn.prototype.cropWaypoints=function(e,t,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),c=r.getConnectionPath({waypoints:[e,t]});return[e=n&&Fl(o,c,!0)||e,t=i&&Fl(a,c,!1)||t]},Kn.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&tt(e.connectionPreviewGfx)},Kn.prototype.getConnection=function(e){var t=function(n){return et(n)?n:{}}(e);return this._elementFactory.createConnection(t)},Kn.prototype.createConnectionPreviewGfx=function(){var e=oe("g");return K(e,{pointerEvents:"none"}),be(e).add("djs-connection-preview"),le(this._canvas.getActiveLayer(),e),e},Kn.prototype.createNoopConnection=function(e,t){var n=oe("polyline");return K(n,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),K(n,{points:[e.x,e.y,t.x,t.y]}),n};const DE={__init__:["connectionPreview"],connectionPreview:["type",Kn]};var Rf=Math.min,Nf=Math.max;function wu(e){e.preventDefault()}function Fo(e){e.stopPropagation()}function dn(e){this.container=e.container,this.parent=je('
'),this.content=Xe("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=St(this.autoResize,this),this.handlePaste=St(this.handlePaste,this)}function en(e,t){this._eventBus=e,this._providers=[],this._textbox=new dn({container:t.getContainer(),keyHandler:St(this._handleKey,this),resizeHandler:St(this._handleResize,this)})}dn.prototype.create=function(e,t,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{};var c=Yt(t=this.style=t||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);z(r.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var l=Yt(t,["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,ce.bind(o,"keydown",this.keyHandler),ce.bind(o,"mousedown",Fo),ce.bind(o,"paste",this.handlePaste),i.autoResize&&ce.bind(o,"input",this.autoResize),i.resizable&&this.resizable(t),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},dn.prototype.handlePaste=function(e){var t,n=this.options,i=this.style;if(e.preventDefault(),t=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(t),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},dn.prototype.insertText=function(e){e=e.replace(/\r\n|\r|\n/g,` `),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},dn.prototype._insertTextIE=function(e){var t,n,i,r=this.getSelection(),o=r.startContainer,a=r.endContainer,c=r.startOffset,l=r.endOffset,u=r.commonAncestorContainer,p=(t=u.childNodes,[].slice.call(t));if(function(g){return g.nodeType===Node.TEXT_NODE}(u)){var d=o.textContent;o.textContent=d.substring(0,c)+e+d.substring(l),n=o,i=c+e.length}else if(o===this.content&&a===this.content){var y=document.createTextNode(e);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)+e+a.textContent.substring(l):b>f&&b<=v&&An(g)}),n=o,i=c+e.length}n&&i!==void 0&&setTimeout(function(){self.setSelection(n,i)})},dn.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight
');var d=function(f){wu(f),Fo(f);var v=Rf(Nf(u+f.clientX-c,i),o),g=Rf(Nf(p+f.clientY-l,r),a);t.style.width=v+"px",t.style.height=g+"px",e.resizeHandler({width:u,height:p,dx:f.clientX-c,dy:f.clientY-l})},y=function(f){wu(f),Fo(f),ce.unbind(document,"mousemove",d,!1),ce.unbind(document,"mouseup",y,!1)};ce.bind(n,"mousedown",function(f){wu(f),Fo(f),c=f.clientX,l=f.clientY;var v=t.getBoundingClientRect();u=v.width,p=v.height,ce.bind(document,"mousemove",d),ce.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"}),t.appendChild(n)},dn.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),ce.unbind(t,"keydown",this.keyHandler),ce.unbind(t,"mousedown",Fo),ce.unbind(t,"input",this.autoResize),ce.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),An(n)),An(e)},dn.prototype.getValue=function(){return this.content.innerText.trim()},dn.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},dn.prototype.setSelection=function(e,t){var n=document.createRange();e===null?n.selectNodeContents(this.content):(n.setStart(e,t),n.setEnd(e,t));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},en.$inject=["eventBus","canvas"],en.prototype.registerProvider=function(e){this._providers.push(e)},en.prototype.isActive=function(e){return!(!this._active||e&&this._active.element!==e)},en.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},en.prototype._fire=function(e,t){this._eventBus.fire("directEditing."+e,t||{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 e=this._active;if(e){var t,n=e.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue();r===e.context.text&&i.height===n.height&&i.width===n.width||(t=this._textbox.container.getBoundingClientRect(),e.provider.update(e.element,r,e.context.text,{x:i.left-t.left,y:i.top-t.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},en.prototype.getValue=function(){return this._textbox.getValue()},en.prototype._handleKey=function(e){e.stopPropagation();var t=e.keyCode||e.charCode;return t===27?(e.preventDefault(),this.cancel()):t!==13||e.shiftKey?void 0:(e.preventDefault(),this.complete())},en.prototype._handleResize=function(e){this._fire("resize",e)},en.prototype.activate=function(e){var t;this.isActive()&&this.cancel();var n=Pe(this._providers,function(i){return(t=i.activate(e))?i:null});return t&&(this.$textbox=this._textbox.create(t.bounds,t.style,t.text,t.options),this._active={element:e,context:t,provider:n},t.options&&t.options.resizable&&(this.resizable=!0),this._fire("activate")),!!t};const If={__depends__:[Io],__init__:["directEditing"],directEditing:["type",en]};var Df=".entry";function tn(e,t,n){this._eventBus=t,this._overlays=n;var i=Wt(e&&e.scale)?e.scale:{min:1,max:1.5};this._overlaysConfig={position:{right:-9,top:-6},scale:i},this._current=null,this._init()}tn.$inject=["config.contextPad","eventBus","overlays"],tn.prototype._init=function(){var e=this._eventBus,t=this;e.on("selection.changed",function(n){var i=n.newSelection;i.length===1?t.open(i[0]):t.close()}),e.on("elements.delete",function(n){L(n.elements,function(i){t.isOpen(i)&&t.close()})}),e.on("element.changed",function(n){var i=n.element,r=t._current;r&&r.element===i&&t.open(i,!0)})},tn.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,function(n){n.providers.push(t)})},tn.prototype.getEntries=function(e){var t=this._getProviders(),n={};return L(t,function(i){var r=i.getContextPadEntries(e);ft(r)?n=r(n):L(r,function(o,a){n[a]=o})}),n},tn.prototype.trigger=function(e,t,n){var i,r,o=this._current.element,a=this._current.entries,c=t.delegateTarget||t.target;if(!c)return t.preventDefault();if(i=a[$t(c,"data-action")].action,r=t.originalEvent||t,ft(i)){if(e==="click")return i(r,o,n)}else if(i[e])return i[e](r,o,n);t.preventDefault()},tn.prototype.open=function(e,t){!t&&this.isOpen(e)||(this.close(),this._updateAndOpen(e))},tn.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},tn.prototype._updateAndOpen=function(e){var t=this.getEntries(e),n=this.getPad(e),i=n.html;L(t,function(r,o){var a,c=r.group||"default",l=je(r.html||'
');$t(l,"data-action",o),(a=Xe("[data-group="+c+"]",i))||(a=je('
'),i.appendChild(a)),a.appendChild(l),r.className&&function(u,p){var d=ot(u);(ge(p)?p:p.split(/\s+/g)).forEach(function(y){d.add(y)})}(l,r.className),r.title&&$t(l,"title",r.title),r.imageUrl&&l.appendChild(je(''))}),ot(i).add("open"),this._current={element:e,pad:n,entries:t},this._eventBus.fire("contextPad.open",{current:this._current})},tn.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,i=je('
'),r=z({html:i},this._overlaysConfig);Gt.bind(i,Df,"click",function(a){t.trigger("click",a)}),Gt.bind(i,Df,"dragstart",function(a){t.trigger("dragstart",a)}),ce.bind(i,"mousedown",function(a){a.stopPropagation()}),this._overlayId=n.add(e,"context-pad",r);var o=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{element:e,pad:o}),o},tn.prototype.close=function(){this.isOpen()&&(this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},tn.prototype.isOpen=function(e){return!(!this._current||e&&this._current.element!==e)};const BE={__depends__:[Io,nu],contextPad:["type",tn]};var OE=["marker-start","marker-mid","marker-end"],LE=["circle","ellipse","line","path","polygon","polyline","rect"];function Yi(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;t.on("drag.cleanup",function(){L(r._clonedMarkers,function(o){tt(o)}),r._clonedMarkers={}})}Yi.$inject=["elementRegistry","eventBus","canvas","styles"],Yi.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},Yi.prototype.addDragger=function(e,t,n){var i=ad(n=n||this.getGfx(e)),r=n.getBoundingClientRect();return this._cloneMarkers(Ya(i)),K(i,this._styles.cls("djs-dragger",[],{x:r.top,y:r.left})),le(t,i),i},Yi.prototype.addFrame=function(e,t){var n=oe("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return le(t,n),n},Yi.prototype._cloneMarkers=function(e){var t=this;if(e.childNodes)for(var n=0;n0,a=r&&yr(r)>0;return!o&&!a},nt.prototype.open=function(e,t,n){var i=this._getProviders(t);if(!e)throw new Error("Element is missing");if(!i||!i.length)throw new Error("No registered providers for: "+t);if(!n)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");var r=this._current={className:t,element:e,position:n},o=this._getEntries(e,i),a=this._getHeaderEntries(e,i);r.entries=z({},o,a),r.container=this._createContainer(),yr(a)&&r.container.appendChild(this._createEntries(a,"djs-popup-header")),yr(o)&&r.container.appendChild(this._createEntries(o,"djs-popup-body"));var c=this._canvas.getContainer();this._attachContainer(r.container,c,n.cursor),this._bindAutoClose()},nt.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindAutoClose(),An(this._current.container),this._current.container=null)},nt.prototype.isOpen=function(){return!!this._current.container},nt.prototype.trigger=function(e){e.preventDefault();var t=$t(e.delegateTarget||e.target,Gf),n=this._getEntry(t);if(n.action)return n.action.call(null,e,n)},nt.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},nt.prototype._getEntries=function(e,t){var n={};return L(t,function(i){if(i.getPopupMenuEntries){var r=i.getPopupMenuEntries(e);ft(r)?n=r(n):L(r,function(o,a){n[a]=o})}else L(i.getEntries(e),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=Fn(o,["id"])})}),n},nt.prototype._getHeaderEntries=function(e,t){var n={};return L(t,function(i){if(i.getPopupMenuHeaderEntries){var r=i.getPopupMenuHeaderEntries(e);ft(r)?n=r(n):L(r,function(o,a){n[a]=o})}else{if(!i.getHeaderEntries)return;L(i.getHeaderEntries(e),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=Fn(o,["id"])})}}),n},nt.prototype._getEntry=function(e){var t=this._current.entries[e];if(!t)throw new Error("entry not found");return t},nt.prototype._emit=function(e){this._eventBus.fire("popupMenu."+e)},nt.prototype._createContainer=function(){var e=je('
'),t=this._current.position,n=this._current.className;return z(e.style,{position:"absolute",left:t.x+"px",top:t.y+"px",visibility:"hidden"}),ot(e).add(n),e},nt.prototype._attachContainer=function(e,t,n){var i=this;Gt.bind(e,".entry","click",function(r){i.trigger(r)}),this._updateScale(e),t.appendChild(e),n&&this._assureIsInbounds(e,n)},nt.prototype._updateScale=function(e){var t,n,i=this._canvas.zoom(),r=this._config.scale,o=i;r!==!0&&(r===!1?(t=1,n=1):(t=r.min,n=r.max),Wt(t)&&in&&(o=n)),function(a,c){a.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(l){a.style[l+"transform"]=c})}(e,"scale("+o+")")},nt.prototype._assureIsInbounds=function(e,t){var n,i,r=this._canvas._container.getBoundingClientRect(),o=e.offsetLeft,a=e.offsetTop,c=e.scrollWidth,l=e.scrollHeight,u={},p=t.x-r.left,d=t.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 ot(n).add(t),L(e,function(r,o){var a=i._createEntry(r,o);n.appendChild(a)}),n},nt.prototype._createEntry=function(e,t){var n=je("
"),i=ot(n);if(i.add("entry"),e.className&&e.className.split(" ").forEach(function(o){i.add(o)}),$t(n,Gf,t),e.label){var r=je("");r.textContent=e.label,n.appendChild(r)}return e.imageUrl&&n.appendChild(je('')),e.active===!0&&i.add("active"),e.disabled===!0&&i.add("disabled"),e.title&&(n.title=e.title),n},nt.prototype._bindAutoClose=function(){this._eventBus.once(Uf,this.close,this)},nt.prototype._unbindAutoClose=function(){this._eventBus.off(Uf,this.close,this)};const VE={__init__:["popupMenu"],popupMenu:["type",nt]};function Go(){}Go.prototype.get=function(){return this._data},Go.prototype.set=function(e){this._data=e},Go.prototype.clear=function(){var e=this._data;return delete this._data,e},Go.prototype.isEmpty=function(){return!this._data};const FE={clipboard:["type",Go]};function Su(e){var t=this;function n(i){t._lastMoveEvent=i}this._lastMoveEvent=null,e.on("canvas.init",function(i){(t._svg=i.svg).addEventListener("mousemove",n)}),e.on("canvas.destroy",function(){t._lastMouseEvent=null,t._svg.removeEventListener("mousemove",n)})}Su.$inject=["eventBus"],Su.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(e,t){var n=document.createEvent("MouseEvent"),i=e,r=t,o=e,a=t;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null),n}(0,0)};const Uo={__init__:["mouse"],mouse:["type",Su]};function mn(e,t,n,i,r,o,a,c){this._canvas=e,this._create=t,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,Pe(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),_s(p)&&(u.priority=3,u.source=p.source.id,u.target=p.target.id,u.waypoints=function(y){return lt(y.waypoints,function(f){return(f=Hf(f)).original&&(f.original=Hf(f.original)),f})}(p)),ws(p)&&(u.priority=4,u.labelTarget=p.labelTarget.id),L(["x","y","width","height"],function(y){pe(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 _s(e){return!!e.waypoints}function ws(e){return!!e.labelTarget}function Hf(e){return z({},e)}function qf(e,t){var n=t.indexOf(e);return n===-1?t:t.splice(n,1)}mn.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],mn.prototype.copy=function(e){var t,n;return ge(e)||(e=e?[e]:[]),n=(t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}))===!1?{}:this.createTree(ge(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},mn.prototype.paste=function(e){var t=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=e&&e.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(t);if(e&&e.element&&e.point)return this._paste(i,e.element,e.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},mn.prototype._paste=function(e,t,n,i){L(e,function(o){pe(o.x)||(o.x=0),pe(o.y)||(o.y=0)});var r=vt(e);return L(e,function(o){_s(o)&&(o.waypoints=lt(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(e,n,t,z({},i))},mn.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return L(e,function(o,a){L(o=Xt(o,"priority"),function(c){var l,u=z({},Fn(c,["priority"]));return i[c.parent]?u.parent=i[c.parent]:delete u.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:u}),_s(u)?(u.source=i[c.source],u.target=i[c.target],l=i[c.id]=t.createConnection(u),void r.push(l)):ws(u)?(u.labelTarget=i[u.labelTarget],l=i[c.id]=t.createLabel(u),void r.push(l)):(u.host&&(u.host=i[u.host]),l=i[c.id]=t.createShape(u),void r.push(l))})}),r},mn.prototype.createConnection=function(e){return this._elementFactory.createConnection(Fn(e,["id"]))},mn.prototype.createLabel=function(e){return this._elementFactory.createLabel(Fn(e,["id"]))},mn.prototype.createShape=function(e){return this._elementFactory.createShape(Fn(e,["id"]))},mn.prototype.hasRelations=function(e,t){var n,i;return!(_s(e)&&(n=Pe(t,Kt({id:e.source.id})),i=Pe(t,Kt({id:e.target.id})),!n||!i))&&!(ws(e)&&!Pe(t,Kt({id:e.labelTarget.id})))},mn.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[];function o(a,c){var l=Pe(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)}}}),e.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(w,_){n.addLane(_,"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"})}):rv(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||rv(y,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||It(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(e,"bpmn-replace")||z(d,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:p("Change type"),action:{click:function(w,_){var C=z(function(B){var s=c.getContainer(),h=t.getPad(B).html,m=s.getBoundingClientRect(),E=h.getBoundingClientRect(),T=E.top-m.top;return{x:E.left-m.left,y:T+E.height+5}}(_),{cursor:{x:w.x,y:w.y}});a.open(_,"bpmn-replace",C)}}}}),we(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}}}),we(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 S=l.allowed("elements.delete",{elements:[e]});return ge(S)&&(S=S[0]===e),S&&z(d,{delete:{group:"edit",className:"bpmn-icon-trash",title:p("Remove"),action:{click:function(w){n.removeElements([e])}}}}),d};const u_={__depends__:[If,BE,Rn,_u,Es,o_],__init__:["contextPadProvider"],contextPadProvider:["type",Au]};var p_={horizontal:["x","width"],vertical:["y","height"]};function Yn(e){this._modeling=e,this._filters=[],this.registerFilter(function(t,n,i){var r,o=0,a=0;return L(t,function(c){c.waypoints||c.labelTarget||(o+=c[i],a+=1)}),r=Math.round(o/a),de(t,function(c){return c[i]=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},Yn.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};const h_={__init__:["distributeElements"],distributeElements:["type",Yn]};function ov(e){e.registerFilter(function(t){return de(t,function(n){var i=we(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:Participant","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)})})}ov.$inject=["distributeElements"];const d_={__depends__:[h_],__init__:["bpmnDistributeElements"],bpmnDistributeElements:["type",ov]};var av="is not a registered action";function rn(e,t){this._actions={};var n=this;e.on("diagram.init",function(){n._registerDefaultActions(t),e.fire("editorActions.init",{editorActions:n})})}function ku(e,t){return new Error(e+" "+t)}rn.$inject=["eventBus","injector"],rn.prototype._registerDefaultActions=function(e){var t=e.get("commandStack",!1),n=e.get("modeling",!1),i=e.get("selection",!1),r=e.get("zoomScroll",!1),o=e.get("copyPaste",!1),a=e.get("canvas",!1),c=e.get("rules",!1),l=e.get("keyboardMove",!1),u=e.get("keyboardMoveSelection",!1);t&&(this.register("undo",function(){t.undo()}),this.register("redo",function(){t.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=ge(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)})},rn.prototype.trigger=function(e,t){if(!this._actions[e])throw ku(e,av);return this._actions[e](t)},rn.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);L(e,function(i,r){n._registerAction(r,i)})},rn.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw ku(e,"is already registered");this._actions[e]=t},rn.prototype.unregister=function(e){if(!this.isRegistered(e))throw ku(e,av);this._actions[e]=void 0},rn.prototype.getActions=function(){return Object.keys(this._actions)},rn.prototype.isRegistered=function(e){return!!this._actions[e]};const m_={__init__:["editorActions"],editorActions:["type",rn]};function Rs(e){e.invoke(rn,this)}ie(Rs,rn),Rs.$inject=["injector"],Rs.prototype._registerDefaultActions=function(e){rn.prototype._registerDefaultActions.call(this,e);var t=e.get("canvas",!1),n=e.get("elementRegistry",!1),i=e.get("selection",!1),r=e.get("spaceTool",!1),o=e.get("lassoTool",!1),a=e.get("handTool",!1),c=e.get("globalConnect",!1),l=e.get("distributeElements",!1),u=e.get("alignElements",!1),p=e.get("directEditing",!1),d=e.get("searchPad",!1),y=e.get("modeling",!1);t&&n&&i&&this._registerAction("selectElements",function(){var f=t.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=de(v,function(S){return!A(S,"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()}),t&&y&&this._registerAction("moveToOrigin",function(){var f,v,g=t.getRootElement();f=vt(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 f_={__depends__:[m_],editorActions:["type",Rs]};function sv(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context;we(t.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}sv.$inject=["eventBus"];function Pu(e,t,n){return n||(n="round"),Math[n](e/t)*t}function xi(e,t,n){var i=!n||n.active!==!1;this._eventBus=t;var r=this;t.on("diagram.init",800,function(){r.setActive(i)}),t.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&&qt(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,S=f.shape,w=b.gridSnappingContext,_=w.snapLocation,C=w.snapOffset;return C&&pe(C[v])||(C||(C=w.snapOffset={}),pe(C[v])||(C[v]=0),!S)||(g.get(S.id)||(Ns(v)?C[v]+=S[v]+S.width/2:C[v]+=S[v]+S.height/2),!_)||(v==="x"?/left/.test(_)?C[v]-=S.width/2:/right/.test(_)&&(C[v]+=S.width/2):/top/.test(_)?C[v]-=S.height/2:/bottom/.test(_)&&(C[v]+=S.height/2)),C[v]}(o,u,e);d&&(p.offset=d);var y=function(f,v){var g=f.context,b=g.createConstraints,S=g.resizeConstraints||{},w=g.gridSnappingContext,_=w.snapConstraints;if(_&&_[v])return _[v];_||(_=w.snapConstraints={}),_[v]||(_[v]={});var C=g.direction;b&&(Ns(v)?(_.x.min=b.left,_.x.max=b.right):(_.y.min=b.top,_.y.max=b.bottom));var B=S.min,s=S.max;return B&&(Ns(v)?lv(C)?_.x.max=B.left:_.x.min=B.right:cv(C)?_.y.max=B.top:_.y.min=B.bottom),s&&(Ns(v)?lv(C)?_.x.min=s.left:_.x.max=s.right:cv(C)?_.y.min=s.top:_.y.max=s.bottom),_[v]}(o,u);y&&z(p,y),Fr(o,u)||r.snapEvent(o,u,p)})}})}function Ns(e){return e==="x"}function cv(e){return e.indexOf("n")!==-1}function lv(e){return e.indexOf("w")!==-1}function Ji(e,t){Q.call(this,e),this._gridSnapping=t;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;Dt(o)?r.newBounds=n.snapComplex(c,o):r.newBounds=n.snapSimple(a,c)}})}xi.prototype.snapEvent=function(e,t,n){st(e,t,this.snapValue(e[t],n))},xi.prototype.getGridSpacing=function(){return 10},xi.prototype.snapValue=function(e,t){var n,i,r=0;return t&&t.offset&&(r=t.offset),e=Pu(e+=r,10),t&&t.min&&pe(n=t.min)&&(n=Pu(n+r,10,"ceil"),e=Math.max(e,n)),t&&t.max&&pe(i=t.max)&&(i=Pu(i+r,10,"floor"),e=Math.min(e,i)),e-=r},xi.prototype.isActive=function(){return this.active},xi.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},xi.prototype.toggleActive=function(){this.setActive(!this.active)},xi.$inject=["elementRegistry","eventBus","config.gridSnapping"],Ji.$inject=["eventBus","gridSnapping","modeling"],ie(Ji,Q),Ji.prototype.snapSimple=function(e,t){var n=this._gridSnapping;return t.width=n.snapValue(t.width,{min:t.width}),t.height=n.snapValue(t.height,{min:t.height}),t.x=e.x+e.width/2-t.width/2,t.y=e.y+e.height/2-t.height/2,t},Ji.prototype.snapComplex=function(e,t){return/w|e/.test(t)&&(e=this.snapHorizontally(e,t)),/n|s/.test(t)&&(e=this.snapVertically(e,t)),e},Ji.prototype.snapHorizontally=function(e,t){var n=this._gridSnapping,i=/w/.test(t),r=/e/.test(t),o={};return o.width=n.snapValue(e.width,{min:e.width}),r&&(i?(o.x=n.snapValue(e.x,{max:e.x}),o.width+=n.snapValue(e.x-o.x,{min:e.x-o.x})):e.x=e.x+e.width-o.width),z(e,o),e},Ji.prototype.snapVertically=function(e,t){var n=this._gridSnapping,i=/n/.test(t),r=/s/.test(t),o={};return o.height=n.snapValue(e.height,{min:e.height}),i&&(r?(o.y=n.snapValue(e.y,{max:e.y}),o.height+=n.snapValue(e.y-o.y,{min:e.y-o.y})):e.y=e.y+e.height-o.height),z(e,o),e};function uv(e,t){e.on(["spaceTool.move","spaceTool.end"],2e3,function(n){var i,r=n.context;r.initialized&&(r.axis==="x"?(i=t.snapValue(n.dx),n.x=n.x+i-n.dx,n.dx=i):(i=t.snapValue(n.dy),n.y=n.y+i-n.dy,n.dy=i))})}uv.$inject=["eventBus","gridSnapping"];const v_={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Ji],gridSnappingSpaceToolBehavior:["type",uv]}],__init__:["gridSnapping"],gridSnapping:["type",xi]};function pv(e,t){e.on("autoPlace",2e3,function(n){var i=n.source,r=fe(i),o=n.shape,a=Km(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]=t.snapValue(a[c],l))}),a})}pv.$inject=["eventBus","gridSnapping"];function hv(e,t,n){t.on(["create.start","shape.move.start"],1750,function(i){var r=i.context,o=r.shape,a=e.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}))})}hv.$inject=["canvas","eventBus","gridSnapping"];function Is(e,t,n){Q.call(this,e),this._gridSnapping=t;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 y_(e,t,n){var i=$n(t,n),r={};return function(o){return o==="h"}(i)&&(r.y=e.snapValue(t.y)),function(o){return o==="v"}(i)&&(r.x=e.snapValue(t.x)),("x"in r||"y"in r)&&(t=z({},t,r),n=z({},n,r)),[t,n]}Is.$inject=["eventBus","gridSnapping","modeling"],ie(Is,Q),Is.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.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?be(c).remove(Ev):be(c).add(Ev)}),e.on("resize.cleanup",function(i){var r,o;r=i.context,o=r.shape,r.frame&&tt(r.frame),t.removeMarker(o,xv)})}_v.$inject=["eventBus","canvas","previewSupport"];var wv=-6,Ko="djs-resizer",T_=["n","w","s","e","nw","ne","se","sw"];function Ei(e,t,n,i){this._resize=i,this._canvas=t;var r=this;e.on("selection.changed",function(o){var a=o.newSelection;r.removeResizers(),a.length===1&&L(a,St(r.addResizer,r))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}Ei.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(o){gi(o)&&i.activate(o,e,n)}ce.bind(t,"mousedown",r),ce.bind(t,"touchstart",r)},Ei.prototype._createResizer=function(e,t,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=wv),u.indexOf("s")!==-1?p.y=6:u.indexOf("n")!==-1&&(p.y=wv),p}(i),a=oe("g");be(a).add(Ko),be(a).add(Ko+"-"+e.id),be(a).add(Ko+"-"+i),le(r,a);var c=oe("rect");K(c,{x:-2+o.x,y:-2+o.y,width:4,height:4}),be(c).add(Ko+"-visual"),le(a,c);var l=oe("rect");return K(l,{x:-10+o.x,y:-10+o.y,width:20,height:20}),be(l).add(Ko+"-hit"),le(a,l),Gl(a,t,n),a},Ei.prototype.createResizer=function(e,t){var n=bv(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},Ei.prototype.addResizer=function(e){var t=this;this._resize.canResize({shape:e})&&L(T_,function(n){t.createResizer(e,n)})},Ei.prototype.removeResizers=function(){Cl(this._getResizersParent())},Ei.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},Ei.$inject=["eventBus","canvas","selection","resize"];const Sv={__depends__:[Dn,Xn,zo],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Xo],resizePreview:["type",_v],resizeHandles:["type",Ei]};function Mu(e,t){var n=t.create("bpmn:CategoryValue"),i=t.create("bpmn:Category",{categoryValue:[n]});return Je(e.get("rootElements"),i),te(i).$parent=e,te(n).$parent=i,n}function Yo(e,t,n,i,r,o,a){function c(l,u){(u||we(l,["bpmn:Task","bpmn:TextAnnotation"])||Ru(l))&&i.activate(l)}this._bpmnFactory=t,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),e.on("element.dblclick",function(l){c(l.element,!0)}),e.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open"],function(l){i.isActive()&&i.complete()}),e.on(["commandStack.changed"],function(l){i.isActive()&&i.cancel()}),e.on("directEditing.activate",function(l){o.removeResizers()}),e.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))}),e.on("autoPlace.end",500,function(l){c(l.shape)})}function Ru(e){return A(e,"bpmn:SubProcess")&&!Me(e)}Yo.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],Yo.prototype.activate=function(e){var t=pn(e);if(t!==void 0){var n={text:t};z(n,this.getEditingBBox(e));var i={};return(we(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||Ru(e))&&z(i,{centerVertically:!0}),Nr(e)&&z(i,{autoResize:!0}),A(e,"bpmn:TextAnnotation")&&z(i,{resizable:!0,autoResize:!0}),z(n,{options:i}),n}},Yo.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r=i.x+i.width/2,o=i.y+i.height/2,a={x:i.x,y:i.y},c=t.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(e,"bpmn:Lane")||function(B){return A(B,"bpmn:Participant")&&Me(B)}(e))&&(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)"})),(we(e,["bpmn:Task","bpmn:CallActivity"])||function(B){return A(B,"bpmn:Participant")&&!Me(B)}(e)||Ru(e))&&(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")&&Me(B)}(e)&&(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,S=4*c;if(n.labelTarget&&(z(a,{width:g,height:i.height+b+S,x:r-g/2,y:i.y-b}),z(v,{fontSize:p+"px",lineHeight:d,paddingTop:b+"px",paddingBottom:S+"px"})),Nr(n)&&!ss(n)&&!bt(n)){var w=cs(e),_=t.getAbsoluteBBox({x:w.x,y:w.y,width:0,height:0}),C=p+b+S;z(a,{width:g,height:C,x:_.x-g/2,y:_.y-C/2}),z(v,{fontSize:p+"px",lineHeight:d,paddingTop:b+"px",paddingBottom:S+"px"})}return A(e,"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}},Yo.prototype.update=function(e,t,n,i){var r,o,a;if(A(e,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(e),r={x:e.x,y:e.y,width:e.width/o.width*i.width,height:e.height/o.height*i.height}),A(e,"bpmn:Group")&&!te(e).categoryValueRef){var c=Mu(te(this._canvas.getRootElement()).$parent,this._bpmnFactory);te(e).categoryValueRef=c}(a=t)&&a.trim()||(t=null),this._modeling.updateLabel(e,t,r)};var Cv="djs-element-hidden",Tv="djs-label-hidden";function Av(e,t,n,i){var r,o,a,c=this,l=t.getDefaultLayer();e.on("directEditing.activate",function(u){var p=u.active;if(A(r=p.element.label||p.element,"bpmn:TextAnnotation")){o=t.getAbsoluteBBox(r),a=oe("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=oe("path");K(y,{d,strokeWidth:2,stroke:A_(r)}),le(a,y),le(l,a),Lt(a,r.x,r.y)}A(r,"bpmn:TextAnnotation")||r.labelTarget?t.addMarker(r,Cv):(A(r,"bpmn:Task")||A(r,"bpmn:CallActivity")||A(r,"bpmn:SubProcess")||A(r,"bpmn:Participant"))&&t.addMarker(r,Tv)}),e.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})}}),e.on(["directEditing.complete","directEditing.cancel"],function(u){var p=u.active;p&&(t.removeMarker(p.element.label||p.element,Cv),t.removeMarker(r,Tv)),r=void 0,o=void 0,a&&(tt(a),a=void 0)})}function A_(e,t){return te(e).di.get("stroke")||t||"black"}Av.$inject=["eventBus","canvas","elementRegistry","pathMap"];const k_={__depends__:[gv,Sv,If],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Yo],labelEditingPreview:["type",Av]};var Nu=["top","bottom","left","right"],Bs=10;function Iu(e,t){function n(i){if(ss(i)){var r=function(o){var a=fe(o.label),c=fe(o),l=kv(c,a);if(u=l,Nu.indexOf(u)!==-1){var u,p=function(f){var v=fe(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 kv(v,b)});return g}(o);if(o.host){var d=function(f){var v,g=f.host,b=fe(f),S=yt(b,g);v=S.indexOf("-")>=0?S.split("-"):[S];var w=Nu.filter(function(_){return v.indexOf(_)===-1});return w}(o);p=p.concat(d)}var y=Nu.filter(function(f){return p.indexOf(f)===-1});if(y.indexOf(l)===-1)return y[0]}}(i);r&&function(o,a){var c=fe(o),l=o.label,u=fe(l);if(l.parent){var p,d=ae(o);switch(a){case"top":p={x:c.x,y:d.top-Bs-l.height/2};break;case"left":p={x:d.left-Bs-l.width/2,y:c.y};break;case"bottom":p={x:c.x,y:d.bottom+Bs+l.height/2};break;case"right":p={x:d.right+Bs+l.width/2,y:c.y}}var y=Nn(p,u);t.moveShape(l,y)}}(i,r)}}Q.call(this,e),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 kv(e,t){return yt(t,e,5)}function Du(e,t,n){Q.call(this,e),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 Bu(e,t){e.invoke(Q,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape;L(de(r.incoming.concat(r.outgoing),function(o){return A(o,"bpmn:Association")}),function(o){t.moveConnection(o,{x:0,y:0},i)})},!0)}ie(Iu,Q),Iu.$inject=["eventBus","modeling"],ie(Du,Q),Du.$inject=["eventBus","elementFactory","bpmnRules"],ie(Bu,Q),Bu.$inject=["injector","modeling"];function Os(e,t){t.invoke(Q,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;(r=r.filter(function(o){return Pv(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];Pv(a,o)&&(i.shapes=[n.replaceShape(a,o)])}},!0)}function Pv(e,t){return!bt(e)&&we(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}Os.$inject=["bpmnReplace","injector"],ie(Os,Q),Os.prototype.replaceShape=function(e,t){var n,i=(n=te(e).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:t};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})};function Ou(e,t,n){function i(r){return de(r.attachers,function(o){return A(o,"bpmn:BoundaryEvent")})}Q.call(this,e),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)})}),e.on("moddleCopy.canCopyProperty",2e3,function(r){var o=r.parent,a=r.property,c=r.propertyName,l=t.getPropertyDescriptor(o,c);l&&l.isReference&&A(a,"bpmn:RootElement")&&o.set(c,a)})}Ou.$inject=["eventBus","moddle","modeling"],ie(Ou,Q);function Lu(e,t,n,i,r){function o(u){return we(u,["bpmn:ReceiveTask","bpmn:SendTask"])||function(p,d){return ge(d)||(d=[d]),si(d,function(y){return rs(p,y)})}(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){return!!Pe(e.getDefinitions().get("rootElements"),Kt({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(we(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(te(p));d&&!a(d)&&(Je(e.getDefinitions().get("rootElements"),d),u.addedRootElement=d)}},!0),this.reverted("shape.create",function(u){var p=u.addedRootElement;p&&Ye(e.getDefinitions().get("rootElements"),p)},!0),t.on("copyPaste.copyElement",function(u){var p=u.descriptor,d=u.element;if(o(d)){var y=l(te(d));y&&(p.referencedRootElement=y)}}),t.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(we(f,["bpmn:ReceiveTask","bpmn:SendTask"]))return f.set("messageRef",v);var g=f.get("eventDefinitions")[0];g.set(c(g),v)}(d,y))}})}function ju(e){e.invoke(Q,this),this.preExecute("shape.create",1500,function(t){var n=t.context,i=n.parent,r=n.shape;A(i,"bpmn:Lane")&&!A(r,"bpmn:Lane")&&(n.parent=fs(i,"bpmn:Participant"))})}Lu.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],ie(Lu,Q),ju.$inject=["injector"],ie(ju,Q);var Ls=1500;function Mv(e,t,n){t.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],Ls,function(i){var r=i.context.shape||i.shape,o=i.hover;A(o,"bpmn:Lane")&&!we(r,["bpmn:Lane","bpmn:Participant"])&&(i.hover=fn(o),i.hoverGfx=e.getGraphics(i.hover));var a=n.getRootElement();o!==a&&(r.labelTarget||A(r,"bpmn:Group"))&&(i.hover=a,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],Ls,function(i){var r=i.hover;A(r,"bpmn:Lane")&&(i.hover=fn(r)||r,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["bendpoint.move.hover"],Ls,function(i){var r=i.context,o=i.hover,a=r.type;A(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=fn(o)||o,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.start"],Ls,function(i){var r=i.context,o=r.start;A(o,"bpmn:Lane")&&(r.start=fn(o)||o)}),t.on("shape.move.start",2e3,function(i){var r=i.shape;A(r,"bpmn:Lane")&&(i.shape=fn(r)||r)})}function Vu(e,t,n){Q.call(this,e),this.preExecute("shape.create",function(i){var r=i.context.shape;if(A(r,"bpmn:DataObjectReference")&&r.type!=="label"){var o=t.create("bpmn:DataObject");r.businessObject.dataObjectRef=o}})}Mv.$inject=["elementRegistry","eventBus","canvas"],Vu.$inject=["eventBus","bpmnFactory","moddle"],ie(Vu,Q);var Fu=20,zu=20,Rv=30,js=2e3;function $u(e,t,n){function i(r){var o,a=r.parent,c=e.getRootElement();A(c,"bpmn:Collaboration")?o=c:(o=n.makeCollaboration(),r.process=a),r.parent=o}Q.call(this,t),t.on(["create.start","shape.move.start"],js,function(r){var o=r.context,a=o.shape,c=e.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")&&!bt(d)&&!function(y){return!!y.waypoints}(d)});if(l.length){var u=vt(l),p=function(d,y){y={width:y.width+2*Fu+Rv,height:y.height+2*zu};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=ae(y),{bottom:y.top+d.height/2-zu,left:y.right-d.width/2+Fu,top:y.bottom-d.height/2+zu,right:y.left+d.width/2-Fu-Rv}}(a,u)}}}),t.on("create.start",js,function(r){var o=r.context.shape,a=e.getRootElement(),c=e.getGraphics(a);function l(u){u.element=a,u.gfx=c}A(o,"bpmn:Participant")&&A(a,"bpmn:Process")&&(t.on("element.hover",js,l),t.once("create.cleanup",function(){t.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",js,function(r){var o,a=r.elements,c=r.parent;Vs(a)&&A(c,"bpmn:Process")&&(i(r),o=Vs(a),r.oldProcessRef=o.businessObject.processRef,o.businessObject.processRef=c.businessObject)},!0),this.revert("elements.create",function(r){var o=r.elements;r.process&&(Vs(o).businessObject.processRef=r.oldProcessRef)},!0),this.postExecute("elements.create",function(r){var o,a=r.elements,c=r.process;if(c){o=Vs(a);var l=c.children.slice();n.moveElements(l,{x:0,y:0},o)}},!0)}function Vs(e){return Pe(e,function(t){return A(t,"bpmn:Participant")})}$u.$inject=["canvas","eventBus","modeling"],ie($u,Q);var Nv="__targetRef_placeholder";function Gu(e,t){function n(o,a){var c=o.get("properties"),l=Pe(c,function(u){return u.name===Nv});return!l&&a&&Je(c,l=t.create("bpmn:Property",{name:Nv})),l}function i(o,a){var c=n(o);c&&(function(l,u,p){return Pe(l.get("dataInputAssociations"),function(d){return d!==p&&d.targetRef===u})}(o,c,a)||Ye(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,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Iv(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Iv(r))}function Iv(e){return function(t){if(A(t.context.connection,"bpmn:DataInputAssociation"))return e(t)}}function Fs(e){this._bpmnUpdater=e}function Uu(e,t,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")&&te(p).processRef})[0]){var u=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:l,newSemanticParent:u.processRef||u,newDiParent:u.di})}}Q.call(this,i),t.registerHandler("dataStore.updateContainment",Fs),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=e.getRootElement();we(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)})})}Gu.$inject=["eventBus","bpmnFactory"],ie(Gu,Q),Fs.$inject=["bpmnUpdater"],Fs.prototype.execute=function(e){var t=e.dataStoreBo,n=e.newSemanticParent,i=e.newDiParent;e.oldSemanticParent=t.$parent,e.oldDiParent=t.di.$parent,this._bpmnUpdater.updateSemanticParent(t,n),this._bpmnUpdater.updateDiParent(t.di,i)},Fs.prototype.revert=function(e){var t=e.dataStoreBo,n=e.oldSemanticParent,i=e.oldDiParent;this._bpmnUpdater.updateSemanticParent(t,n),this._bpmnUpdater.updateDiParent(t.di,i)},Uu.$inject=["canvas","commandStack","elementRegistry","eventBus"],ie(Uu,Q);function Hu(e,t,n){Q.call(this,e),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=ai(u),v=[],g=[];zi(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))})}Hu.$inject=["eventBus","modeling","spaceTool"],ie(Hu,Q);function zs(e,t){t.invoke(Q,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;r.filter(function(o){return Dv(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;Dv(a,(l=u,r.indexOf(l)!==-1?u:o))&&(r[c]=n.replaceShape(a))})},!0)}function Dv(e,t){return!bt(e)&&A(e,"bpmn:BoundaryEvent")&&!t}function qu(e,t,n){function i(r,o,a){var c,l,u,p,d,y,f,v,g=o.waypoints,b=r.outgoing.slice(),S=r.incoming.slice(),w=fu(g,v=pe(a.width)?fe(a):a);if(w){if(c=g.slice(0,w.index),l=g.slice(w.index+(w.bendpoint?1:0)),!c.length||!l.length)return;u=w.bendpoint?g[w.index]:v,c.length!==1&&Bv(r,c[c.length-1])||c.push(Ov(u)),l.length!==1&&Bv(r,l[0])||l.unshift(Ov(u))}p=o.source,d=o.target,t.canConnect(p,r,o)&&(n.reconnectEnd(o,r,c||v),y=o),t.canConnect(r,d,o)&&(y?f=n.connect(r,d,{type:o.type,waypoints:l}):(n.reconnectStart(o,r,l||v),f=o));var _=[].concat(y&&de(S,function(C){return C.source===y.source})||[],f&&de(b,function(C){return C.target===f.target})||[]);_.length&&n.removeElements(_)}Q.call(this,e),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=fe(l),p={x:u.x+c.x,y:u.y+c.y},d=Pe(o.children,function(y){return t.canInsert(a,y)&&fu(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;t.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 Bv(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function Ov(e){return z({},e)}function Wu(e,t){Q.call(this,e),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(Xu).forEach(function(c){t.removeConnection(c)})}),this.preExecuted("shape.replace",function(n){var i=n.context.newShape;A(i,"bpmn:EventBasedGateway")&&i.outgoing.filter(Xu).map(function(r){return r.target}).reduce(function(r,o){var a=o.incoming.filter(Xu);return r.concat(a)},[]).forEach(function(r){r.source!==i&&t.removeConnection(r)})})}function Xu(e){return A(e,"bpmn:SequenceFlow")}zs.$inject=["bpmnReplace","injector"],ie(zs,Q),zs.prototype.replaceShape=function(e){var t,n,i=(n=te(e).eventDefinitions)&&n[0];return t=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},ie(qu,Q),qu.$inject=["eventBus","bpmnRules","modeling"],Wu.$inject=["eventBus","modeling"],ie(Wu,Q);function Ku(e,t,n,i,r,o){function a(){return te(t.getRootElement()).$parent}function c(l){var u=te(l).categoryValueRef;if(u){var p=u.$parent;u&&(Ye(p.categoryValue,u),p&&!p.categoryValue.length&&function(d){Ye(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=te(p).categoryValueRef,y=n.filter(function(f){return A(f,"bpmn:Group")});u=d,y.some(function(f){var v=te(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=te(u).categoryValueRef,d=a(),y=p?p.$parent:null;Je(y.get("categoryValue"),p),Je(d.get("rootElements"),y)}}),this.execute("shape.create",function(l){var u=te(l.context.shape);if(A(u,"bpmn:Group")&&!u.categoryValueRef){var p=Mu(a(),e);u.categoryValueRef=p}}),this.revert("shape.create",function(l){var u=l.context.shape;A(u,"bpmn:Group")&&(c(u),delete te(u).categoryValueRef)}),i.on("moddleCopy.canCopyProperty",2e3,function(l){var u,p=l.property;if(A(p,"bpmn:CategoryValue"))return u=Mu(a(),e),o.copyElement(p,u)})}function Yu(e,t,n,i){var r,o,a,c;return(r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y))==0?null:(o=e.y-n.y,a=e.x-n.x,c=((i.x-n.x)*o-(i.y-n.y)*a)/r,{x:Math.round(e.x+c*(t.x-e.x)),y:Math.round(e.y+c*(t.y-e.y))})}function Lv(e){function t(n,i,r){var o,a={x:r.x,y:r.y-50},c={x:r.x-50,y:r.y},l=Yu(n,i,r,a),u=Yu(n,i,r,c);o=l&&u?jv(l,r)>jv(u,r)?u:l:l||u,n.original=o}e.on("bpmnElement.added",function(n){var i,r,o=n.element;o.waypoints&&(t((r=(i=o).waypoints)[0],r[1],fe(i.source)),t(r[r.length-1],r[r.length-2],fe(i.target)))})}function jv(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ju(e){Q.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=te(n.context.shape);we(i,t)&&!i.di.get("isHorizontal")&&i.di.set("isHorizontal",!0)})}function Vv(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Fv(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function zv(e,t){var n=t[0],i=t[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],[e.x,e.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function P_(e,t){var n=zv(e,t);return Vv({x:n.x-e.x,y:n.y-e.y})}function $s(e,t){return Vv({x:e.x-t.x,y:e.y-t.y})}Ku.$inject=["bpmnFactory","canvas","elementRegistry","eventBus","injector","moddleCopy"],ie(Ku,Q),Lv.$inject=["eventBus"],Ju.$inject=["eventBus"],ie(Ju,Q);var $v=Math.sqrt,Gv=Math.min,M_=Math.max,Uv=Math.abs;function Hv(e){return Math.pow(e,2)}function Jo(e,t){return $v(Hv(e.x-t.x)+Hv(e.y-t.y))}function R_(e,t,n,i){var r=t.x-e.x,o=t.y-e.y,a=n.x-e.x,c=n.y-e.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=$v(p),y=-u+d,f=-u-d,v={x:e.x-r*y,y:e.y-o*y};return p===0?[v]:[v,{x:e.x-r*f,y:e.y-o*f}].filter(function(g){return function(b,S,w){return qv(b.x,S.x,w.x)&&qv(b.y,S.y,w.y)}(g,e,t)})}function qv(e,t,n){return e>=Gv(t,n)-Gs&&e<=M_(t,n)+Gs}var Gs=.1;function Wv(e,t){return Uv(e.x-t.x)<=Gs&&Uv(e.y-t.y)<=Gs}function N_(e,t,n,i){var r=0,o=0,a=function(T){return{x:T.x+T.width/2,y:T.y+T.height/2}}(e),c=function(T,M){var N,$,P,x,I,j,G,X,ee,re,se,H,q=0;for(q=0;q line intersections");j.length===1&&(G={type:"bendpoint",position:j[0],segmentIndex:q,bendpointIndex:Wv(N,j[0])?q:q+1}),j.length===2&&(se=j[0],H=j[1],G={type:"segment",position:I={x:(se.x+H.x)/2,y:(se.y+H.y)/2},segmentIndex:q,relativeLocation:Jo(N,I)/Jo(N,$)}),X=Jo(G.position,T),(!re||ee>X)&&(re=G,ee=X)}return re}(a,n),l=c.segmentIndex,u=function(T,M,N,$){var P=N.segmentIndex,x=M.length-T.length;if($.segmentMove){var I=$.segmentMove.segmentStartIndex,j=$.segmentMove.newSegmentStartIndex;return P===I?j:P>=j?P+x=ee&&(G=X?P+1:P-1),Pt.length-2)return{x:r,y:o};var p,d,y=Kv(n,l),f=Kv(t,u),v=c.position,g=function(T,M){var N=$s(T[0],T[1]),$=$s(T[0],M);return N===0?0:$/N}(y,v),b=(p=f,d=Fv(y),Fv(p)-d);if(c.type==="bendpoint"){var S=t.length-n.length,w=c.bendpointIndex,_=n[w];if(t.indexOf(_)!==-1)return{x:r,y:o};if(S===0){var C=t[w];return{x:C.x-c.position.x,y:C.y-c.position.y}}S<0&&w!==0&&w"+o+"
"}))})}function np(e,t,n,i){Q.call(this,e);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&&t.removeConnection(a),c&&t.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=t.connect(d,y,{type:c.type,waypoints:p.waypoints.slice()}),t.removeConnection(p),u.connection=l,r&&function(f,v){var g,b=r.context(),S=b&&b.payload.previousSelection;!S||!S.length||(g=S.indexOf(f),g!==-1&&S.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=Pe(p.outgoing,Kt({id:p.businessObject.default.id})))&&t.updateProperties(c,{conditionExpression:void 0}),u.conditionExpression&&d.sourceRef.default===d&&t.updateProperties(p.source,{default:void 0})})}function ip(e,t){Q.call(this,e),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&&t.makeProcess()},!0)}function Ws(e,t,n,i,r,o){i.invoke(Q,this),this._bpmnReplace=e,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var c=a.context,l=c.parent,u=c.elements,p=t.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=It(y)?p.concat(y.children):p.concat(y)}),p.length===1&&u&&(l=u);var d=t.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=t.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})})}ty.$inject=["eventBus","tooltips","translate"],ie(np,Q),np.$inject=["eventBus","modeling","bpmnRules","injector"],ip.$inject=["eventBus","modeling"],ie(ip,Q),ie(Ws,Q),Ws.prototype.replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;L(t,function(o){var a={type:o.newElementType},c=n.get(o.oldElementId),l=e.indexOf(c);e[l]=i.replaceElement(c,a,{select:!1})}),t&&r.select(e)},Ws.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var Zi={width:300,height:60},Qo={width:300,height:150},ny={width:140,height:120},iy={width:50,height:30};function ry(e){e.on("resize.start",1500,function(t){var n=t.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=fn(a),p=!0,d=!0,y=Ms(u,[u]),f=ae(a),v={},g={};return/e/.test(c)?g.right=f.left+Zi.width:/w/.test(c)&&(g.left=f.right-Zi.width),y.forEach(function(b){var S=ae(b);/n/.test(c)&&(S.topf.bottom+10&&(d=!1),l&&Xs(f.bottom-S.top)<10&&Ks(v,"bottom",S.bottom-Zi.height),Xs(f.bottom-S.bottom)<5&&Ys(g,"bottom",S.top+Zi.height))}),u.children.filter(function(b){return!b.hidden&&!b.waypoints&&(A(b,"bpmn:FlowElement")||A(b,"bpmn:Artifact"))}).forEach(function(b){var S=ae(b);p&&/n/.test(c)&&Ks(g,"top",S.top-F_),/e/.test(c)&&Ys(g,"right",S.right+j_),d&&/s/.test(c)&&Ys(g,"bottom",S.bottom+z_),/w/.test(c)&&Ks(g,"left",S.left-V_)}),{min:g,max:v}}(i,r,o)),A(i,"bpmn:Participant")&&(n.minDimensions=Qo),A(i,"bpmn:SubProcess")&&Me(i)&&(n.minDimensions=ny),A(i,"bpmn:TextAnnotation")&&(n.minDimensions=iy)})}ry.$inject=["eventBus"];var Xs=Math.abs,O_=Math.min,L_=Math.max;function oy(e,t,n,i){var r=e[t];e[t]=r===void 0?n:i(n,r)}function Ks(e,t,n){return oy(e,t,n,O_)}function Ys(e,t,n){return oy(e,t,n,L_)}var j_=20,V_=50,F_=20,z_=20;function ay(e,t){e.on("resize.start",1501,function(n){var i=n.context,r=i.shape;(A(r,"bpmn:Lane")||A(r,"bpmn:Participant"))&&(i.balanced=!Dr(n))}),e.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=Id(a),t.resizeLane(r,a,i.balanced)),!1})}function rp(e,t,n){Q.call(this,e),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")&&t.canConnect(o.source,a.target,o)){var c=function(l,u){var p=Yu($r(l[l.length-2]),$r(l[l.length-1]),$r(u[1]),$r(u[0]));return p?[].concat(l.slice(0,l.length-1),[p],u.slice(1)):[$r(l[0]),$r(u[u.length-1])]}(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,c)}}})}function $r(e){return e.original||e}ay.$inject=["eventBus","modeling"],ie(rp,Q),rp.$inject=["eventBus","bpmnRules","modeling"];var $_=Math.max;function sy(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,i=t.axis,r=t.start,o={};return L(n,function(a){var c=a.id;A(a,"bpmn:Participant")&&(function(l){return l==="x"}(i)?o[c]=Qo:o[c]={width:Qo.width,height:G_(a,r)}),A(a,"bpmn:SubProcess")&&Me(a)&&(o[c]=ny),A(a,"bpmn:TextAnnotation")&&(o[c]=iy)}),o})}function G_(e,t){var n;return ai(e).length?(n=function(i,r){var o,a=ai(i);return o=cy(a,r),i.height-o.height+Zi.height}(e,t),$_(Qo.height,n)):Qo.height}function cy(e,t){var n,i,r;for(n=0;n=(i=e[n]).y&&t<=i.y+i.height)return(r=ai(i)).length?cy(r,t):i}function op(e,t){e.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")&&Me(r)){var o,a={x:(o=r).x+o.width/6,y:o.y+o.height/2};t.createShape({type:"bpmn:StartEvent"},a,r)}})}sy.$inject=["eventBus"],op.$inject=["injector","modeling"],ie(op,Q);function ap(e,t,n,i){Q.call(this,e),this.executed(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape;A(a,"bpmn:SubProcess")&&(a.collapsed?te(a).di.isExpanded=!1:((o=a.children).length&&o.forEach(function(c){c.type!=="label"||c.businessObject.name||(c.hidden=!0)}),te(a).di.isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],500,function(r){var o=r.context.shape;o.collapsed?te(o).di.isExpanded=!1:te(o).di.isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape,c=t._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=iv((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 sp(e,t,n,i){t.invoke(Q,this),this.preExecute("shape.delete",function(r){var o=r.context.shape,a=o.businessObject;bt(o)||(A(o,"bpmn:Participant")&&Me(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=e.getRootElement().businessObject;n.ids.unclaim(r.id)})}ie(ap,Q),ap.$inject=["eventBus","elementFactory","modeling"],ie(sp,Q),sp.$inject=["canvas","injector","moddle","modeling"];function cp(e,t,n){var i;function r(){if(!i)throw new Error(n("out of bounds release"));return i}Q.call(this,e);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&&(t.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(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function lp(e,t){Q.call(this,e),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=te(a),l=te(o);return c.get("default")===l})(i,r)&&t.updateProperties(r,{default:null})})}cp.$inject=["eventBus","modeling","translate"],ie(cp,Q),ie(lp,Q),lp.$inject=["eventBus","modeling"];const H_={__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",Iu],appendBehavior:["type",Du],associationBehavior:["type",Bu],attachEventBehavior:["type",Os],boundaryEventBehavior:["type",Ou],rootElementReferenceBehavior:["type",Lu],createBehavior:["type",ju],fixHoverBehavior:["type",Mv],createDataObjectBehavior:["type",Vu],createParticipantBehavior:["type",$u],dataInputAssociationBehavior:["type",Gu],dataStoreBehavior:["type",Uu],deleteLaneBehavior:["type",Hu],detachEventBehavior:["type",zs],dropOnFlowBehavior:["type",qu],eventBasedGatewayBehavior:["type",Wu],groupBehavior:["type",Ku],importDockingFix:["type",Lv],isHorizontalFix:["type",Ju],labelBehavior:["type",Zu],messageFlowBehavior:["type",tp],modelingFeedback:["type",ty],replaceConnectionBehavior:["type",np],removeParticipantBehavior:["type",ip],replaceElementBehaviour:["type",Ws],resizeBehavior:["type",ry],resizeLaneBehavior:["type",ay],removeElementBehavior:["type",rp],toggleElementCollapseBehaviour:["type",ap],spaceToolBehavior:["type",sy],subProcessStartEventBehavior:["type",op],unclaimIdBehavior:["type",sp],updateFlowNodeRefsBehavior:["type",cp],unsetDefaultFlowBehavior:["type",lp]};function ly(e,t){var n=yt(e,t,-15);return n!=="intersect"?n:null}function xt(e){bi.call(this,e)}function up(e){return!e||bt(e)}function uy(e){do{if(A(e,"bpmn:Process"))return te(e);if(A(e,"bpmn:Participant"))return te(e).processRef||te(e)}while(e=e.parent)}function pp(e){return A(e,"bpmn:TextAnnotation")}function hp(e){return A(e,"bpmn:Group")&&!e.labelTarget}function dp(e){return A(e,"bpmn:BoundaryEvent")&&Bn(e,"bpmn:CompensateEventDefinition")}function Gr(e){return te(e).isForCompensation}function py(e){for(var t=e;t=t.parent;){if(A(t,"bpmn:FlowElementsContainer"))return te(t);if(A(t,"bpmn:Participant"))return te(t).processRef}return null}function Bn(e,t){return!!Pe(te(e).eventDefinitions||[],function(n){return A(n,t)})}function hy(e,t){return(te(e).eventDefinitions||[]).every(function(n){return A(n,t)})}function dy(e){return A(e,"bpmn:ReceiveTask")||A(e,"bpmn:IntermediateCatchEvent")&&(Bn(e,"bpmn:MessageEventDefinition")||Bn(e,"bpmn:TimerEventDefinition")||Bn(e,"bpmn:ConditionalEventDefinition")||Bn(e,"bpmn:SignalEventDefinition"))}function Js(e){return e.waypoints}function mp(e,t){var n=function(i){for(var r=[];i;)(i=i.parent)&&r.push(i);return r}(t);return n.indexOf(e)!==-1}function Zs(e,t,n){if(up(e)||up(t))return null;if(!A(n,"bpmn:DataAssociation")){if(Ey(e,t))return{type:"bpmn:MessageFlow"};if(_y(e,t))return{type:"bpmn:SequenceFlow"}}var i=vp(e,t);return i||(dp(e)&&Gr(t)?{type:"bpmn:Association",associationDirection:"One"}:!!xy(e,t)&&{type:"bpmn:Association"})}function Ur(e,t,n){return!(!bt(e)&&!hp(e))||!(A(t,"bpmn:Participant")&&!Me(t))&&(A(e,"bpmn:Participant")?A(t,"bpmn:Process")||A(t,"bpmn:Collaboration"):we(e,["bpmn:DataInput","bpmn:DataOutput"])&&e.parent?t===e.parent:A(e,"bpmn:Lane")?A(t,"bpmn:Participant")||A(t,"bpmn:Lane"):!(A(e,"bpmn:BoundaryEvent")&&!function(i){return te(i).cancelActivity&&(my(i)||fy(i))}(e))&&(A(e,"bpmn:FlowElement")&&!A(e,"bpmn:DataStoreReference")?A(t,"bpmn:FlowElementsContainer")?Me(t):we(t,["bpmn:Participant","bpmn:Lane"]):A(e,"bpmn:DataStoreReference")&&A(t,"bpmn:Collaboration")?si(te(t).get("participants"),function(i){return!!i.get("processRef")}):we(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?we(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!A(e,"bpmn:MessageFlow")&&(A(t,"bpmn:Collaboration")||e.source.parent==t||e.target.parent==t)))}function q_(e){return A(e,"bpmn:Lane")}function W_(e){return!!function(t){return!bt(t)&&A(t,"bpmn:BoundaryEvent")}(e)||!(!A(e,"bpmn:IntermediateThrowEvent")||!my(e))||A(e,"bpmn:IntermediateCatchEvent")&&fy(e)}function my(e){var t=te(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function fy(e){return vy(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function vy(e,t){return t.some(function(n){return Bn(e,n)})}function ea(e,t,n,i){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var r=e[0];return!bt(r)&&!!W_(r)&&!It(t)&&!(!A(t,"bpmn:Activity")||Gr(t))&&!(i&&!ly(i,t))&&!function(o){return A(o,"bpmn:ReceiveTask")&&Pe(o.incoming,function(a){return A(a.source,"bpmn:EventBasedGateway")})}(t)&&"attach"}function yy(e,t,n){if(!t)return!1;var i={replacements:[]};return L(e,function(r){It(t)||A(r,"bpmn:StartEvent")&&r.type!=="label"&&Ur(r,t)&&(function(o){return o&&te(o).isInterrupting!==!1}(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(function(o){return rs(o,"bpmn:ErrorEventDefinition")}(r)||function(o){return rs(o,"bpmn:EscalationEventDefinition")}(r)||function(o){return rs(o,"bpmn:CompensateEventDefinition")}(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),vy(r,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&A(t,"bpmn:SubProcess")&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"})),A(t,"bpmn:Transaction")||Bn(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(A(r,"bpmn:EndEvent")&&Ur(r,t)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),A(r,"bpmn:BoundaryEvent")&&ea(r,t,0,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),!!i.replacements.length&&i}function gy(e,t){return!si(e,q_)&&(!t||e.every(function(n){return Ur(n,t)}))}function fp(e,t,n,i){return!!t&&(!(!bt(e)&&!hp(e))||n!==t&&(!n||!mp(n,t))&&(Ur(e,t)||Qs(e,t)))}function by(e,t){return A(e,"bpmn:SubProcess")?Me(e)&&(!t||t.width>=100&&t.height>=80):A(e,"bpmn:Lane")?!t||t.width>=130&&t.height>=60:A(e,"bpmn:Participant")?!t||t.width>=250&&t.height>=50:!!pp(e)||!!hp(e)}function xy(e,t){return!Js(e)&&!Js(t)&&(!(!dp(e)||!Gr(t))||!mp(t,e)&&!mp(e,t)&&(!!function(n,i){var r=pp(n),o=pp(i);return(r||o)&&r!==o}(e,t)||!!vp(e,t)))}function Ey(e,t){return!(Sy(e)&&!Sy(t))&&A(i=e,"bpmn:InteractionNode")&&!A(i,"bpmn:BoundaryEvent")&&(!A(i,"bpmn:Event")||A(i,"bpmn:ThrowEvent")&&hy(i,"bpmn:MessageEventDefinition"))&&function(r){return A(r,"bpmn:InteractionNode")&&!Gr(r)&&(!A(r,"bpmn:Event")||A(r,"bpmn:CatchEvent")&&hy(r,"bpmn:MessageEventDefinition"))&&!(A(r,"bpmn:BoundaryEvent")&&!Bn(r,"bpmn:MessageEventDefinition"))}(t)&&(n=t,uy(e)!==uy(n));var n,i}function _y(e,t){return!(dy(t)&&t.incoming.length>0&&(n=t.incoming,(n=n||[]).some(X_))&&!A(e,"bpmn:EventBasedGateway"))&&A(r=e,"bpmn:FlowNode")&&!A(r,"bpmn:EndEvent")&&!It(r)&&!(A(r,"bpmn:IntermediateThrowEvent")&&Bn(r,"bpmn:LinkEventDefinition"))&&!dp(r)&&!Gr(r)&&function(o){return A(o,"bpmn:FlowNode")&&!A(o,"bpmn:StartEvent")&&!A(o,"bpmn:BoundaryEvent")&&!It(o)&&!(A(o,"bpmn:IntermediateCatchEvent")&&Bn(o,"bpmn:LinkEventDefinition"))&&!Gr(o)}(t)&&(i=t,py(e)===py(i))&&!(A(e,"bpmn:EventBasedGateway")&&!dy(t));var n,i,r}function vp(e,t){return we(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&we(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!we(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!we(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function Qs(e,t,n){if(!t)return!1;if(Array.isArray(e)){if(e.length!==1)return!1;e=e[0]}return t.source!==e&&t.target!==e&&we(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!bt(t)&&A(e,"bpmn:FlowNode")&&!A(e,"bpmn:BoundaryEvent")&&Ur(e,t.parent)}function wy(e,t){return!!bt(t)||!(A(t,"bpmn:Lane")&&!function(n,i){return n&&i&&n.indexOf(i)!==-1}(e,t.parent))}function X_(e){if(e&&e.source)return A(e.source,"bpmn:EventBasedGateway")}function Sy(e){return fs(e,"bpmn:Process")||fs(e,"bpmn:Collaboration")}ie(xt,bi),xt.$inject=["eventBus"],xt.prototype.init=function(){this.addRule("connection.start",function(e){return function(t){return up(t)?null:we(t,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}(e.source)}),this.addRule("connection.create",function(e){var t=e.source,n=e.target,i=e.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return Zs(t,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection;return Zs(e.source,e.target,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){return by(e.shape,e.newBounds)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,i=e.target;return!(Js(i)&&!Qs(t,i))&&ji(t,function(r){return Js(r)?Zs(r.source,r.target,r):r.host?ea(r,r.host,null,n):fp(r,i,null)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,i=e.position;return ea(n,t,null,i)||yy(n,t,i)||gy(n,t)||Qs(n,t)}),this.addRule("shape.create",function(e){return fp(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return ea(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element;return wy(e.elements,t)})},xt.prototype.canConnectMessageFlow=Ey,xt.prototype.canConnectSequenceFlow=_y,xt.prototype.canConnectDataAssociation=vp,xt.prototype.canConnectAssociation=xy,xt.prototype.canMove=gy,xt.prototype.canAttach=ea,xt.prototype.canReplace=yy,xt.prototype.canDrop=Ur,xt.prototype.canInsert=Qs,xt.prototype.canCreate=fp,xt.prototype.canConnect=Zs,xt.prototype.canResize=by,xt.prototype.canCopy=wy;const K_={__depends__:[Dn],__init__:["bpmnRules"],bpmnRules:["type",xt]};function Cy(e,t){e.on("saveXML.start",2e3,function(){var n,i,r=t.getRootElement(),o=te(r).di;n=de(n=Fa([r],!1),function(a){return a!==r&&!a.labelTarget}),i=lt(n,Mr),o.set("planeElement",i)})}Cy.$inject=["eventBus","canvas"];const Y_={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Cy]};function ec(e){Q.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(n){var i=n.context,r=i.shape||i.connection,o=i.parent,a=t.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=t.getOrdering(r,o);a&&(a.parent!==void 0&&(i.newParent=a.parent),i.newParentIndex=a.index)})}function yp(e,t,n){ec.call(this,e);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=Pe(i,function(u){return we(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:t.getRootElement(),index:-1};var c=r(o);c.containers&&(a=function(p,d,y){for(var f=d;f&&!we(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=hl(a.children,function(p){return!(!o.labelTarget&&p.labelTarget)&&c.level");this._pushAction(e),t||(this._fire(i,"preExecute",e),o.preExecute&&o.preExecute(r),this._fire(i,"preExecuted",e)),this._atomicDo(function(){n._fire(i,"execute",e),o.execute&&n._markDirty(o.execute(r)),n._executedAction(e,t),n._fire(i,"executed",e)}),t||(this._fire(i,"postExecute",e),o.postExecute&&o.postExecute(r),this._fire(i,"postExecuted",e)),this._popAction(e)},qe.prototype._pushAction=function(e){var t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in or phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},qe.prototype._popAction=function(){var e=this._currentExecution,t=e.trigger,n=e.actions,i=e.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:dl("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},qe.prototype._markDirty=function(e){var t=this._currentExecution;e&&(e=ge(e)?e:[e],t.dirty=t.dirty.concat(e))},qe.prototype._executedAction=function(e,t){var n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},qe.prototype._revertedAction=function(e){this._stackIdx--},qe.prototype._getHandler=function(e){return this._handlerMap[e]},qe.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};const Z_={commandStack:["type",qe]};var Q_=new tu("tt");function gp(e,t){e.style.display=t===!1?"none":""}var Ty="djs-tooltip",bp="."+Ty;function Pt(e,t){var n,i;this._eventBus=e,this._canvas=t,this._ids=Q_,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(n=t.getContainer(),i=je('
'),n.insertBefore(i,n.firstChild),i);var r=this;Gt.bind(this._tooltipRoot,bp,"mousedown",function(o){o.stopPropagation()}),Gt.bind(this._tooltipRoot,bp,"mouseover",function(o){r.trigger("mouseover",o)}),Gt.bind(this._tooltipRoot,bp,"mouseout",function(o){r.trigger("mouseout",o)}),this._init()}Pt.$inject=["eventBus","canvas"],Pt.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=z({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},Pt.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get($t(n,"data-tooltip-id"));i&&(e==="mouseover"&&i.timeout&&this.clearTimeout(i),e==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},Pt.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]},Pt.prototype.clearTimeout=function(e){if(e=this.get(e)){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},Pt.prototype.setTimeout=function(e){if(e=this.get(e)){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},Pt.prototype.remove=function(e){var t=this.get(e);t&&(An(t.html),An(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},Pt.prototype.show=function(){gp(this._tooltipRoot)},Pt.prototype.hide=function(){gp(this._tooltipRoot,!1)},Pt.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},Pt.prototype._addTooltip=function(e){var t,n=e.id,i=e.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Dt(i)&&(i=je(i)),(t=je('
')).appendChild(i),e.type&&ot(t).add("djs-tooltip-"+e.type),e.className&&ot(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},Pt.prototype._updateTooltip=function(e){var t,n,i,r=e.position,o=e.htmlContainer;t=o,n=r.x,i=r.y,z(t.style,{left:n+"px",top:i+"px"})},Pt.prototype._updateTooltipVisibilty=function(e){L(this._tooltips,function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoomwp(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(wp(i)<5)return!1;i<0&&(i*=-1),Dr(e)&&(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=Fa(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,S,w={};return L(g,function(_){var C,B,s,h=ae(_),m=de(_.children,function(M){return!(Cp(M)||Iy(M)||Sp(v,M)||Sp(g,M))}),E=de(_.children,function(M){return!Cp(M)&&!Iy(M)&&Sp(v,M)});m.length&&(B=Ry(ae(vt(m))),C=y-h[nc[d]]+B[nc[d]],d==="n"?w.bottom=S=pe(S)?Math.min(S,C):C:d==="w"?w.right=S=pe(S)?Math.min(S,C):C:d==="s"?w.top=b=pe(b)?Math.max(b,C):C:d==="e"&&(w.left=b=pe(b)?Math.max(b,C):C)),E.length&&(s=Ry(ae(vt(E))),C=y-s[nc[My[d]]]+h[nc[My[d]]],d==="n"?w.bottom=S=pe(S)?Math.min(S,C):C:d==="w"?w.right=S=pe(S)?Math.min(S,C):C:d==="s"?w.top=b=pe(b)?Math.max(b,C):C:d==="e"&&(w.left=b=pe(b)?Math.max(b,C):C));var T=f&&f[_.id];T&&(d==="n"?(C=y+_[Jn[p]]-T[Jn[p]],w.bottom=S=pe(S)?Math.min(S,C):C):d==="w"?(C=y+_[Jn[p]]-T[Jn[p]],w.right=S=pe(S)?Math.min(S,C):C):d==="s"?(C=y-_[Jn[p]]+T[Jn[p]],w.top=b=pe(b)?Math.max(b,C):C):d==="e"&&(C=y-_[Jn[p]]+T[Jn[p]],w.left=b=pe(b)?Math.max(b,C):C))}),w}}(c,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}));return z(t,c,{axis:n,direction:o,spaceToolConstraints:l,start:r}),ds("resize-"+(n==="x"?"ew":"ns")),!0},Zn.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[];return L(e,function(c){if(c.parent&&!Cp(c)){var l=c[t],u=l+c[Jn[t]];return n>0&&l>i||n<0&&ui&&r.allowed("shape.resize",{shape:c})?a.push(c):void 0}}),{movingShapes:o,resizingShapes:a}},Zn.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},Zn.prototype.isActive=function(){var e=this._dragging.context();return e&&/^spaceTool/.test(e.prefix)};var Tp="djs-dragging",Dy="djs-resizing",rc=Math.max;function By(e,t,n,i,r){function o(a,c){L(a,function(l){r.addDragger(l,c),n.addMarker(l,Tp)})}e.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=oe("g");K(d,i.cls("djs-crosshair-group",["no-events"])),le(c,d);var y=oe("path");K(y,"d",u),be(y).add("djs-crosshair"),le(d,y);var f=oe("path");K(f,"d",p),be(f).add("djs-crosshair"),le(d,f),l.crosshairGroup=d}),e.on("spaceTool.selection.move",function(a){Lt(a.context.crosshairGroup,a.x,a.y)}),e.on("spaceTool.selection.cleanup",function(a){var c=a.context.crosshairGroup;c&&tt(c)}),e.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=oe("path"),"d","M0,0 L0,0"),be(l).add("djs-crosshair"),le(y,l),c.line=l;var f=oe("g");K(f,i.cls("djs-drag-group",["no-events"])),le(n.getActiveLayer(),f),o(p,f),o(c.movingConnections=t.filter(function(S){var w=!1;L(p,function(s){L(s.outgoing,function(h){S===h&&(w=!0)})});var _=!1;L(p,function(s){L(s.incoming,function(h){S===h&&(_=!0)})});var C=!1;L(d,function(s){L(s.outgoing,function(h){S===h&&(C=!0)})});var B=!1;return L(d,function(s){L(s.incoming,function(h){S===h&&(B=!0)})}),function(s){return s.waypoints}(S)&&(w||C)&&(_||B)}),f),c.dragGroup=f}if(!c.frameGroup){var v=oe("g");K(v,i.cls("djs-frame-group",["no-events"])),le(n.getActiveLayer(),v);var g=[];L(d,function(S){var w=r.addFrame(S,v),_=w.getBBox();g.push({element:w,initialBounds:_}),n.addMarker(S,Dy)}),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,Lt(c.dragGroup,b.x,b.y),L(c.frames,function(S){var w,_,C=S.element,B=S.initialBounds;c.direction==="e"?K(C,{width:rc(B.width+b.x,5)}):K(C,{width:w=rc(B.width-b.x,5),x:B.x+B.width-w}),c.direction==="s"?K(C,{height:rc(B.height+b.y,5)}):K(C,{height:_=rc(B.height-b.y,5),y:B.y+B.height-_})})}}),e.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,Tp)}),L(u,function(v){n.removeMarker(v,Tp)}),y&&(tt(d),tt(y)),L(p,function(v){n.removeMarker(v,Dy)}),f&&tt(f)})}By.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const Oy={__init__:["spaceToolPreview"],__depends__:[Xn,Dn,tc,zo,Uo],spaceTool:["type",Zn],spaceToolPreview:["type",By]};function on(e){this._model=e}function Vt(e,t,n,i){Q.call(this,e),this._bpmnFactory=t,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"],an(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"],an(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"],an(function(p){p.context.shape.type!=="label"&&a(p)})),this.reverted(["shape.move","shape.create","shape.resize"],an(function(p){p.context.shape.type!=="label"&&a(p)})),e.on("shape.changed",function(p){p.element.type==="label"&&a({context:{shape:p.element}})}),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],an(c)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],an(c)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],an(l)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],an(l)),this.executed("connection.reconnect",an(function(p){var d=p.context,y=d.connection,f=d.oldSource,v=d.newSource,g=te(y),b=te(f),S=te(v);g.conditionExpression&&!we(S,["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",an(function(p){var d=p.context,y=d.connection,f=d.oldSource,v=d.newSource,g=te(y),b=te(f),S=te(v);d.oldConditionExpression&&(g.conditionExpression=d.oldConditionExpression),d.oldDefault&&(b.default=d.oldDefault,delete S.default)})),this.executed(["element.updateAttachment"],an(u)),this.reverted(["element.updateAttachment"],an(u))}function an(e){return function(t){var n=t.context;A(n.shape||n.connection,"bpmn:BaseElement")&&e(t)}}function _i(e,t,n){Gn.call(this),this._bpmnFactory=e,this._moddle=t,this._translate=n}function Ly(e,t,n){e[n]=t[n],delete t[n]}function oc(e,t){this._modeling=e,this._canvas=t}function ac(e){this._modeling=e}function sc(e,t){this._canvas=e,this._layouter=t}on.$inject=["moddle"],on.prototype._needsId=function(e){return we(e,["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"])},on.prototype._ensureId=function(e){var t;t=A(e,"bpmn:Activity")?"Activity":A(e,"bpmn:Event")?"Event":A(e,"bpmn:Gateway")?"Gateway":we(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(e.$type||"").replace(/^[^:]*:/g,""),t+="_",!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))},on.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},on.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},on.prototype.createDiShape=function(e,t,n){return this.create("bpmndi:BPMNShape",z({bpmnElement:e,bounds:this.createDiBounds(t)},n))},on.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},on.prototype.createDiWaypoints=function(e){var t=this;return lt(e,function(n){return t.createDiWaypoint(n)})},on.prototype.createDiWaypoint=function(e){return this.create("dc:Point",Yt(e,["x","y"]))},on.prototype.createDiEdge=function(e,t,n){return this.create("bpmndi:BPMNEdge",z({bpmnElement:e,waypoint:this.createDiWaypoints(t)},n))},on.prototype.createDiPlane=function(e){return this.create("bpmndi:BPMNPlane",{bpmnElement:e})},ie(Vt,Q),Vt.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],Vt.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Vt.prototype.updateParent=function(e,t){if(!(e instanceof Xa||A(e,"bpmn:DataStoreReference")&&e.parent&&A(e.parent,"bpmn:Collaboration"))){var n=e.parent,i=e.businessObject,r=n&&n.businessObject,o=r&&r.di;A(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,r,t&&t.businessObject),A(e,"bpmn:DataOutputAssociation")&&(r=e.source?e.source.businessObject:null),A(e,"bpmn:DataInputAssociation")&&(r=e.target?e.target.businessObject:null),this.updateSemanticParent(i,r),A(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,r),this.updateDiParent(i.di,o)}},Vt.prototype.updateBounds=function(e){var t=e.businessObject.di,n=e instanceof Xa?this._getLabel(t):t,i=n.bounds;i||(i=this._bpmnFactory.createDiBounds(),n.set("bounds",i)),z(i,{x:e.x,y:e.y,width:e.width,height:e.height})},Vt.prototype.updateFlowNodeRefs=function(e,t,n){n!==t&&(A(n,"bpmn:Lane")&&Ye(n.get("flowNodeRef"),e),A(t,"bpmn:Lane")&&Je(t.get("flowNodeRef"),e))},Vt.prototype.updateDiConnection=function(e,t,n){e.sourceElement&&e.sourceElement.bpmnElement!==t&&(e.sourceElement=t&&t.di),e.targetElement&&e.targetElement.bpmnElement!==n&&(e.targetElement=n&&n.di)},Vt.prototype.updateDiParent=function(e,t){if(t&&!A(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(Ye(n,e),e.$parent=null)}},Vt.prototype.getLaneSet=function(e){var t,n;return A(e,"bpmn:Lane")?((t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(A(e,"bpmn:Participant")&&(e=e.processRef),(t=(n=e.get("laneSets"))[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t)),t)},Vt.prototype.updateSemanticParent=function(e,t,n){var i,r=this._translate;if(e.$parent!==t&&(!A(e,"bpmn:DataInput")&&!A(e,"bpmn:DataOutput")||(A(t,"bpmn:Participant")&&"processRef"in t&&(t=t.processRef),!("ioSpecification"in t)||t.ioSpecification!==e.$parent))){if(A(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(A(e,"bpmn:FlowElement")){if(t){if(A(t,"bpmn:Participant"))t=t.processRef;else if(A(t,"bpmn:Lane"))do t=t.$parent.$parent;while(A(t,"bpmn:Lane"))}i="flowElements"}else if(A(e,"bpmn:Artifact")){for(;t&&!A(t,"bpmn:Process")&&!A(t,"bpmn:SubProcess")&&!A(t,"bpmn:Collaboration");){if(A(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else if(A(e,"bpmn:MessageFlow"))i="messageFlows";else if(A(e,"bpmn:Participant")){i="participants";var o,a=e.processRef;a&&(o=function(u){for(;u&&!A(u,"bpmn:Definitions");)u=u.$parent;return u}(e.$parent||t),e.$parent&&(Ye(o.get("rootElements"),a),a.$parent=null),t&&(Je(o.get("rootElements"),a),a.$parent=o))}else A(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":A(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:e.id,parent:t.id}));var c;if(e.$parent&&Ye(c=e.$parent.get(i),e),t?((c=t.get(i)).push(e),e.$parent=t):e.$parent=null,n){var l=n.get(i);Ye(c,e),t&&(l||(l=[],t.set(i,l)),l.push(e))}}},Vt.prototype.updateConnectionWaypoints=function(e){e.businessObject.di.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Vt.prototype.updateConnection=function(e){var t,n=e.connection,i=te(n),r=te(n.source),o=te(n.target);if(A(i,"bpmn:DataAssociation"))A(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=r,t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,t)):A(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||r,this.updateSemanticParent(i,r,t),i.targetRef=o);else{var a=A(i,"bpmn:SequenceFlow");i.sourceRef!==r&&(a&&(Ye(i.sourceRef&&i.sourceRef.get("outgoing"),i),r&&r.get("outgoing")&&r.get("outgoing").push(i)),i.sourceRef=r),i.targetRef!==o&&(a&&(Ye(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)},Vt.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label},ie(_i,Gn),_i.$inject=["bpmnFactory","moddle","translate"],_i.prototype.baseCreate=Gn.prototype.create,_i.prototype.create=function(e,t){return e==="label"?this.baseCreate(e,z({type:"label"},No,t)):this.createBpmnElement(e,t)},_i.prototype.createBpmnElement=function(e,t){var n,i,r,o=this._translate,a=(t=t||{}).businessObject;if(!a){if(!t.type)throw new Error(o("no shape type specified"));a=this._bpmnFactory.create(t.type)}return a.di||(a.di=e==="root"?this._bpmnFactory.createDiPlane(a,[],{id:a.id+"_di"}):e==="connection"?this._bpmnFactory.createDiEdge(a,[],{id:a.id+"_di"}):this._bpmnFactory.createDiShape(a,{},{id:a.id+"_di"})),A(a,"bpmn:Group")&&(t=z({isFrame:!0},t)),t.di&&(z(a.di,t.di),delete t.di),function(c,l,u){L(u,function(p){l[p]!==void 0&&Ly(c,l,p)})}(a,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&Ly(a.di,t,"isExpanded"),A(a,"bpmn:ExclusiveGateway")&&(a.di.isMarkerVisible=!0),t.eventDefinitionType&&(i=a.get("eventDefinitions")||[],r=this._bpmnFactory.create(t.eventDefinitionType,t.eventDefinitionAttrs),t.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(r.condition=this._bpmnFactory.create("bpmn:FormalExpression")),i.push(r),r.$parent=a,a.eventDefinitions=i,delete t.eventDefinitionType),n=this._getDefaultSize(a),t=z({businessObject:a,id:a.id},n,t),this.baseCreate(e,t)},_i.prototype._getDefaultSize=function(e){return A(e,"bpmn:SubProcess")?Me(e)?{width:350,height:200}:{width:100,height:80}:A(e,"bpmn:Task")?{width:100,height:80}:A(e,"bpmn:Gateway")?{width:50,height:50}:A(e,"bpmn:Event")?{width:36,height:36}:A(e,"bpmn:Participant")?Me(e)?{width:600,height:250}:{width:400,height:60}:A(e,"bpmn:Lane")?{width:400,height:100}:A(e,"bpmn:DataObjectReference")?{width:36,height:50}:A(e,"bpmn:DataStoreReference")?{width:50,height:50}:A(e,"bpmn:TextAnnotation")?{width:100,height:30}:A(e,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},_i.prototype.createParticipantShape=function(e){return et(e)||(e={isExpanded:e}),(e=z({type:"bpmn:Participant"},e||{})).isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},oc.$inject=["modeling","canvas"],oc.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.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),t.moveElements([r],o,r.parent)})},oc.prototype.postExecute=function(e){},ac.$inject=["modeling"],ac.prototype.preExecute=function(e){var t=e.source;if(!t)throw new Error("source required");var n=e.target||t.parent,i=e.shape,r=e.hints||{};i=e.shape=this._modeling.createShape(i,e.position,n,{attach:r.attach}),e.shape=i},ac.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,si(t.outgoing,function(r){return r.target===n})||(i.connectionTarget===e.source?this._modeling.connect(e.shape,e.source,e.connection):this._modeling.connect(e.source,e.shape,e.connection))},sc.$inject=["canvas","layouter"],sc.prototype.execute=function(e){var t=e.connection,n=e.source,i=e.target,r=e.parent,o=e.parentIndex,a=e.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return t.source=n,t.target=i,t.waypoints||(t.waypoints=this._layouter.layoutConnection(t,a)),this._canvas.addConnection(t,r,o),t},sc.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var cc=Math.round;function Ap(e){this._modeling=e}function jy(e){return!!e.waypoints}Ap.$inject=["modeling"],Ap.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;L(t,function(p){pe(p.x)||(p.x=0),pe(p.y)||(p.y=0)});var c=vt(t);L(t,function(p){jy(p)&&(p.waypoints=lt(p.waypoints,function(d){return{x:cc(d.x-c.x-c.width/2+r.x),y:cc(d.y-c.y-c.height/2+r.y)}})),z(p,{x:cc(p.x-c.x-c.width/2+r.x),y:cc(p.y-c.y-c.height/2+r.y)})});var l=md(t),u={};L(t,function(p){if(jy(p))u[p.id]=pe(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]=pe(i)?a.createShape(p,Yt(p,["x","y","width","height"]),p.parent||n,i,d):a.createShape(p,Yt(p,["x","y","width","height"]),p.parent||n,d)}}),e.elements=Oa(u)};var Vy=Math.round;function wi(e){this._canvas=e}function na(e){wi.call(this,e)}wi.$inject=["canvas"],wi.prototype.execute=function(e){var t=e.shape,n=e.position,i=e.parent,r=e.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?z(t,n):z(t,{x:n.x-Vy(t.width/2),y:n.y-Vy(t.height/2)}),this._canvas.addShape(t,i,r),t},wi.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},ie(na,wi),na.$inject=["canvas"];var rw=wi.prototype.execute;na.prototype.execute=function(e){var t=e.shape;return function(n){["width","height"].forEach(function(i){n[i]===void 0&&(n[i]=0)})}(t),t.labelTarget=e.labelTarget,rw.call(this,e)};var ow=wi.prototype.revert;function lc(e,t){this._canvas=e,this._modeling=t}function kp(e,t){this._modeling=e,this._elementRegistry=t}function ia(e,t){this._canvas=e,this._modeling=t}function uc(e){this._modeling=e}na.prototype.revert=function(e){return e.shape.labelTarget=null,ow.call(this,e)},lc.$inject=["canvas","modeling"],lc.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=Dl(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},lc.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,Je(n.children,t,i),this._canvas.addConnection(t,n),t},kp.$inject=["modeling","elementRegistry"],kp.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;L(e.elements,function(i){n.get(i.id)&&(i.waypoints?t.removeConnection(i):t.removeShape(i))})},ia.$inject=["canvas","modeling"],ia.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;Hr(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),Hr(n.outgoing,function(i){t.removeConnection(i,{nested:!0})}),Hr(n.children,function(i){i.waypoints?t.removeConnection(i,{nested:!0}):t.removeShape(i,{nested:!0})})},ia.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=Dl(i.children,n),t.removeShape(n),n},ia.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return Je(i.children,n,r),t.addShape(n,i),n},uc.$inject=["modeling"];var Fy={x:"y",y:"x"};function pc(e,t){this._layouter=e,this._canvas=t}function Pp(){}function Mp(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function ra(e){this._modeling=e}function hc(e){this._helper=new ra(e)}function er(e){this._modeling=e,this._helper=new ra(e)}function oa(e){this._modeling=e}function zy(e){return e.original||e}function Qn(e,t){this._modeling=e,this._rules=t}function aa(e){this._modeling=e}function Si(e){this._modeling=e}function $y(e){return z({},e)}function Gy(e){switch(e){case"n":case"s":return"y";case"w":case"e":return"x"}}function Uy(e,t,n){var i=Gy(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i] required");var r=e.changed||this.getVisualReferences(n).concat(t),o=e.oldProperties||function(a,c){return Bt(c,function(l,u){return l[u]=a.get(u),l},{})}(n,go(i));return Yy(n,i),e.oldProperties=o,e.changed=r,r},sa.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return Yy(n,t),i},sa.prototype.getVisualReferences=function(e){var t=this._elementRegistry;return A(e,"bpmn:DataObject")?function(n,i){return i.filter(function(r){return A(r,"bpmn:DataObjectReference")&&te(r).dataObjectRef===n})}(e,t):[]};var ca="default",ei="id",Jy="di",aw={width:0,height:0};function la(e,t,n,i,r){this._elementRegistry=e,this._moddle=t,this._translate=n,this._modeling=i,this._textRenderer=r}function Zy(e,t){return ei in e&&e[ei]!==t[ei]}function Qy(e,t){L(t,function(n,i){i!==Jy?e.set(i,n):e.di&&function(r,o){L(o,function(a,c){r.set(c,a)})}(e.di,n)})}la.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],la.prototype.execute=function(e){var t=e.element,n=[t],i=this._translate;if(!t)throw new Error(i("element required"));var r=this._elementRegistry,o=this._moddle.ids,a=t.businessObject,c=function(u){var p=z({},u);return sw.forEach(function(d){d in u&&(p[d]=te(p[d]))}),p}(e.properties),l=e.oldProperties||function(u,p){var d=go(p);return Bt(d,function(y,f){return y[f]=f!==Jy?u.get(f):function(v,g){return Bt(g,function(b,S){return b[S]=v.get(S),b},{})}(u.di,go(p.di)),y},{})}(a,c);return Zy(c,a)&&(o.unclaim(a[ei]),r.updateId(t,c[ei]),o.claim(c[ei],a)),ca in c&&(c[ca]&&n.push(r.get(c[ca].id)),a[ca]&&n.push(r.get(a[ca].id))),Qy(a,c),e.oldProperties=l,e.changed=n,n},la.prototype.postExecute=function(e){var t=e.element.label,n=t&&te(t).name;if(n){var i=this._textRenderer.getExternalLabelBounds(t,n);this._modeling.resizeShape(t,i,aw)}},la.prototype.revert=function(e){var t=e.element,n=e.properties,i=e.oldProperties,r=t.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Qy(r,i),Zy(n,r)&&(a.unclaim(n[ei]),o.updateId(t,i[ei]),a.claim(i[ei],r)),e.changed};var sw=["default"];function fc(e,t){this._canvas=e,this._modeling=t}function Np(e,t){this._modeling=e,this._spaceTool=t}function Ip(e,t){this._modeling=e,this._translate=t}function ua(e,t){this._modeling=e,this._spaceTool=t}fc.$inject=["canvas","modeling"],fc.prototype.execute=function(e){var t=this._canvas,n=e.newRoot,i=n.businessObject,r=t.getRootElement(),o=r.businessObject,a=o.$parent,c=o.di;t.setRootElement(n,!0),Je(a.rootElements,i),i.$parent=a,Ye(a.rootElements,o),o.$parent=null,o.di=null,c.bpmnElement=i,i.di=c,e.oldRoot=r},fc.prototype.revert=function(e){var t=this._canvas,n=e.newRoot.businessObject,i=e.oldRoot,r=i.businessObject,o=n.$parent,a=n.di;t.setRootElement(i,!0),Ye(o.rootElements,n),n.$parent=null,Je(o.rootElements,r),r.$parent=o,n.di=null,a.bpmnElement=r,r.di=a},Np.$inject=["modeling","spaceTool"],Np.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=fn(i),a=o===i,c=a?i:i.parent;ai(c).length||n.createShape({type:"bpmn:Lane"},{x:i.x+zr,y:i.y,width:i.width-zr,height:i.height},c);var l=[];zi(o,function(v){return l.push(v),v.label&&l.push(v.label),v===i?[]:de(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=t.calculateAdjustments(l,"y",u,d);t.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:u},y,d),e.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?zr:0),y:p-(r==="top"?120:0),width:i.width-(a?zr:0),height:120},c)},Ip.$inject=["modeling","translate"],Ip.prototype.preExecute=function(e){var t=this._modeling,n=this._translate,i=e.shape,r=e.count,o=ai(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=e.x+(u.right?e.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 pa="flowNodeRef",Dp="lanes";function ha(e){this._elementRegistry=e}function vc(e){this._moddle=e}ha.$inject=["elementRegistry"],ha.prototype.computeUpdates=function(e,t){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=fn(p);return r[d.id]||(r[d.id]=Ms(d)),r[d.id]}(l);return u.filter(function(p){return d=l,y=ae(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(sg(n)){var i=function(a,c,l){return rg(a,c,l)}(e,t,n),r=function(a,c,l){var u=rg(c,a,og(l));return{waypoints:u.waypoints.slice().reverse(),directions:og(u.directions),turnNextDirections:u.turnNextDirections}}(e,t,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:Op(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=gc((c.x-a.x)/2+a.x),p=gc((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]")}(e,t,n)}function hw(e,t,n,i,r){var o=Yh(r&&r.preferredLayouts||[],"straight")[0]||"h:h",a=yt(e,t,pw[o]||0),c=function(p,d){if(sg(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||fe(e),i=i||fe(t);var l=c.split(":"),u=cg(n,e,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=Op(p,d,y);return f.unshift(p),f.push(d),lg(f)}(u,cg(i,t,l[1],a),c)}function dw(e,t,n,i,r,o){var a;return ge(n)&&(r=n,o=i,n=fe(e),i=fe(t)),r=r||[],a=(o=z({preferredLayouts:[]},o)).preferredLayouts.indexOf("straight")!==-1&&function(c,l,u,p,d){var y,f,v={};return f=yt(c,l),/^(top|bottom|left|right)$/.test(f)?(/top|bottom/.test(f)&&(y="x"),/left|right/.test(f)&&(y="y"),d.preserveDocking==="target"?ag(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:ag(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}(e,t,n,i,o),a||(a=o.connectionEnd&&function(c,l,u,p){var d=p.slice().reverse();return d=Lp(c,l,u,d),d?d.reverse():null}(t,e,i,r),a||(a=o.connectionStart&&Lp(e,t,n,r))||(!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:hw(e,t,n,i,o)))}function ag(e,t,n){return function(i,r,o){return i>=r&&i<=o}(t[e],n[e],n[e]+n[{x:"width",y:"height"}[e]])}function Lp(e,t,n,i){if(function(c){return c.length<3||!(c.length>4)&&!!Pe(c,function(l,u){var p=c[u-1];return p&&_o(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($n(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(xd(c[p],l,ig)||xd(c[p],u,ig))return c.slice(p);return c}(a,e,t),r!==a&&(a=Lp(e,t,n,r)),a&&$n(a)?null:a}function sg(e){return e&&/t|r|b|l/.test(e)}function cg(e,t,n,i){if(n==="h"&&(n=/left/.test(i)?"l":"r"),n==="v"&&(n=/top/.test(i)?"t":"b"),n==="t")return{original:e,x:e.x,y:t.y};if(n==="r")return{original:e,x:t.x+t.width,y:e.y};if(n==="b")return{original:e,x:e.x,y:t.y+t.height};if(n==="l")return{original:e,x:t.x,y:e.y};throw new Error("unexpected dockingDirection: <"+n+">")}function lg(e){return e.reduce(function(t,n,i){return Bl(t[t.length-1],e[i+1],n,0)||t.push(n),t},[])}var mw=-10,fw=40,jp={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},bc={top:"t",right:"r",bottom:"b",left:"l"};function Vp(){}function vw(e,t){return A(t,"bpmn:Participant")?"source":A(e,"bpmn:Participant")?"target":da(t)?"source":da(e)||A(t,"bpmn:Event")?"target":A(e,"bpmn:Event")?"source":null}function yw(e){return da(e)?"target":"source"}function ug(e,t){return e?e.original||e:fe(t)}function pg(e,t){return A(t,"bpmn:Activity")&&A(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function da(e){return A(e,"bpmn:SubProcess")&&Me(e)}function ma(e,t){return e===t}function fa(e){var t=/right|left/.exec(e);return t&&t[0]}function tr(e){var t=/top|bottom/.exec(e);return t&&t[0]}function Fp(e){return e==="right"||e==="left"}function gw(e,t){var n=t.waypoints,i=n&&n.length&&yt(n[0],e);return i==="top"?["t:r"]:i==="right"?["r:b"]:i==="left"?["l:t"]:["b:l"]}function bw(e,t,n){var i,r,o,a,c=fe(e),l=fe(t),u=(a=(o=e).host,yt(fe(o),a,mw)),p=ma(e.host,t),d=["top","right","bottom","left"].indexOf(u)!==-1,y=yt(l,c,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return p?function(f,v,g,b,S){var w,_=v?f:tr(f),C=bc[_];return w=v?Fp(f)?hg("y",g,b,S)?"h":"b":hg("x",g,b,S)?"v":"l":"v",[C+":"+w]}(u,d,e,t,n):(i=function(f,v,g){if(g)return bc[f];if(ma(tr(f),tr(v))||(b=fa(f),S=fa(v),jp[b]===S))return bc[tr(f)];var b,S;return bc[fa(f)]}(u,y,d),r=function(f,v,g){if(g)return Fp(f)?(b=v,S=fa(f),w=jp[S],b.indexOf(w)!==-1||ma(f,v)?"h":"v"):function(_,C){var B=tr(_),s=jp[B];return C.indexOf(s)!==-1}(f,v)||ma(f,v)?"v":"h";var b,S,w;return Fp(v)||ma(tr(f),tr(v))&&fa(v)?"h":"v"}(u,y,d),[i+":"+r])}function hg(e,t,n,i){var r=fw;return!(zp(e,i,n,r)||zp(e,i,{x:n.x+n.width,y:n.y+n.height},r)||zp(e,i,fe(t),r))}function zp(e,t,n,i){return Math.abs(t[e]-n[e])
'),e.appendChild(o));var a=n.html||(n.separator?'
':'
'),c=je(a);o.appendChild(c),n.separator||($t(c,"data-action",i),n.title&&$t(c,"title",n.title),n.className&&function(l,u){var p=ot(l);(ge(u)?u:u.split(/\s+/g)).forEach(function(d){p.add(d)})}(c,n.className),n.imageUrl&&c.appendChild(je('')))}),this.open()},it.prototype.trigger=function(e,t,n){var i,r,o,a=this._entries,c=t.delegateTarget||t.target;if(!c)return t.preventDefault();(i=a[$t(c,"data-action")])&&(r=i.action,o=t.originalEvent||t,ft(r)?e==="click"&&r(o,n):r[e]&&r[e](o,n),t.preventDefault())},it.prototype._layoutChanged=function(){this._toggleState({})},it.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},it.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},it.prototype.open=function(){this._toggleState({open:!0})},it.prototype.toggle=function(e){this.isOpen()?this.close():this.open()},it.prototype.isActiveTool=function(e){return e&&this._activeTool===e},it.prototype.updateToolHighlight=function(e){var t;this._toolsContainer||(t=Xe(".djs-palette-entries",this._container),this._toolsContainer=Xe("[data-group=tools]",t)),L(this._toolsContainer.children,function(n){var i=n.getAttribute("data-action");if(i){var r=ot(n);i=i.replace("-tool",""),r.contains("entry")&&i===e?r.add("highlighted-entry"):r.remove("highlighted-entry")}})},it.prototype.isOpen=function(){return ot(this._container).has(Up)},it.prototype._getParentContainer=function(){return this._canvas.getContainer()},it.HTML_MARKUP='
';const Sw={__init__:["palette"],palette:["type",it]};var wg="crosshair";function nr(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var c=this,l=function(d){var y,f=t.getActiveLayer();K(y=d.frame=oe("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),le(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&&tt(d.frame)};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(d){var y=d.originalEvent.target;(d.hover||y instanceof SVGElement)&&e.once("lasso.selection.ended",function(){c.activateLasso(d.originalEvent,!0)})}),e.on("lasso.end",function(d){var y=Hp(d),f=i.filter(function(v){return v});c.select(f,y)}),e.on("lasso.start",function(d){var y=d.context;y.bbox=Hp(d),l(y)}),e.on("lasso.move",function(d){var y=d.context;y.bbox=Hp(d),u(y)}),e.on("lasso.cleanup",function(d){var y=d.context;p(y)}),e.on("element.mousedown",1500,function(d){if(_m(d))return c.activateLasso(d.originalEvent),!0})}function Hp(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y};return t.x<=n.x&&t.y=n.x&&t.yn.x&&t.y<=n.y?{x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x=n.y?{x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?{x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}nr.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],nr.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:wg,data:{context:{}}})},nr.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:wg,data:{context:{}}})},nr.prototype.select=function(e,t){var n=function(i,r){var o={};return L(i,function(a){var c=a;c.waypoints&&(c=vt(c)),!pe(r.y)&&c.x>r.x&&(o[a.id]=a),!pe(r.x)&&c.y>r.y&&(o[a.id]=a),c.x>r.x&&c.y>r.y&&(pe(r.width)&&pe(r.height)&&c.width+c.xu[d]+y-p&&st(l,d,u[d]+y-p)})}(t,o,function(l){return A(l,"bpmn:Task")?Rw:Mw}(o)),o&&function(l,u){return si(u,function(p){return Ng(l,p)})}(i,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=Qt(r),we(o,["bpmn:Event","bpmn:Gateway"])&&Rg(t,Qt(o)),we(o,["bpmn:Task","bpmn:SubProcess"])&&function(l,u){var p=Qt(u);Pg.forEach(function(d){(function(y,f,v){return y[v]>f[v]+kg&&y[v]y[g]?y[g]+Xp:y[g]-Xp,st(l,g,b))})}}(t)):Ng(i,"bpmn:MessageFlow")?(A(r,"bpmn:Event")&&(n.connectionStart=Qt(r)),A(o,"bpmn:Event")&&Rg(t,Qt(o))):n.connectionStart=n.initialConnectionStart)})}function Rg(e,t){st(e,"x",t.x),st(e,"y",t.y)}function Ng(e,t){return e&&e.type===t}function Ig(e,t){return e==="x"?t.width:t.height}function Ai(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function Ec(e){this._snapValues={}}Mg.$inject=["eventBus"],Ai.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},Ai.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)},Ai.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},Ai.prototype.getSnapLocations=function(){return this._snapLocations},Ai.prototype.setSnapLocations=function(e){this._snapLocations=e},Ai.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new Ec).initDefaults(this._defaultSnaps),n},Ec.prototype.add=function(e,t){var n=this._snapValues[e];n||(n=this._snapValues[e]={x:[],y:[]}),n.x.indexOf(t.x)===-1&&n.x.push(t.x),n.y.indexOf(t.y)===-1&&n.y.push(t.y)},Ec.prototype.snap=function(e,t,n,i){var r=this._snapValues[t];return r&&function(o,a,c){var l,u;for(c=c===void 0?10:c,l=0;l=e.x||i&&i<=e.x)&&st(e,"x",e.x),(n&&n>=e.y||r&&r<=e.y)&&st(e,"y",e.y)}}function Dg(e,t){return e.indexOf(t)!==-1}function Bg(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}ie(Xr,On),Xr.$inject=["eventBus","injector"],Xr.prototype.initSnap=function(e){var t=On.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return L(n.outgoing,function(r){var o=r.waypoints[0];o=o.original||o,t.setSnapOrigin(r.id+"-docking",Bg(o,i,e))}),L(n.incoming,function(r){var o=r.waypoints[r.waypoints.length-1];o=o.original||o,t.setSnapOrigin(r.id+"-docking",Bg(o,i,e))}),A(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},Xr.prototype.addSnapTargetPoints=function(e,t,n){On.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);L(i,function(o){var a;(function(c){return A(c,"bpmn:SubProcess")&&Me(c)?!0:A(c,"bpmn:Participant")}(o)||(a="bpmn:TextAnnotation",[t,o].every(function(c){return A(c,a)})))&&(e.add("top-left",_f(o)),e.add("bottom-right",wf(o)))});var r=this._elementRegistry;return L(t.incoming,function(o){if(r.get(t.id)){Dg(i,o.source)||e.add("mid",fe(o.source));var a=o.waypoints[0];e.add(o.id+"-docking",a.original||a)}}),L(t.outgoing,function(o){if(r.get(t.id)){Dg(i,o.target)||e.add("mid",fe(o.target));var a=o.waypoints[o.waypoints.length-1];e.add(o.id+"-docking",a.original||a)}}),A(n,"bpmn:SequenceFlow")&&(e=this.addSnapTargetPoints(e,t,n.parent)),e},Xr.prototype.getSnapTargets=function(e,t){return On.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!A(n,"bpmn:Lane")})};function va(e,t){var n=this;e.on(["resize.start"],function(i){n.initSnap(i)}),e.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&&qt(i.originalEvent)||Fr(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)&&st(i,"x",i.x),function(p){return p==="e"||p==="w"}(c)&&st(i,"y",i.y),t.snap(i,u)}}),e.on(["resize.cleanup"],function(){t.hide()})}function Og(e,t){var n=fe(e),i=ae(e),r={x:n.x,y:n.y};return t.indexOf("n")!==-1?r.y=i.top:t.indexOf("s")!==-1&&(r.y=i.bottom),t.indexOf("e")!==-1?r.x=i.right:t.indexOf("w")!==-1&&(r.x=i.left),r}va.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new Ai);var o=Og(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},va.prototype.addSnapTargetPoints=function(e,t,n,i){return L(this.getSnapTargets(t,n),function(r){e.add("corner",wf(r)),e.add("corner",_f(r))}),e.add("corner",Og(t,i)),e},va.$inject=["eventBus","snapping"],va.prototype.getSnapTargets=function(e,t){return Sf(t).filter(function(n){return i=n,r=e,!(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 ki(e){this._canvas=e,this._asyncHide=vl(St(this.hide,this),1e3)}ki.$inject=["canvas"],ki.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),r={x:Fr(e,"x"),y:Fr(e,"y")};L(i,function(o){var a=n.getSnapOrigin(o),c={x:e.x+a.x,y:e.y+a.y};if(L(["x","y"],function(l){var u;r[l]||(u=t.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];et(a)&&st(e,o,a.originValue)})},ki.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=oe("path");return K(n,{d:"M0,0 L0,0"}),be(n).add("djs-snap-line"),le(t,n),{update:function(i){pe(i)?K(n,e==="horizontal"?{d:"M-100000,"+i+" L+100000,"+i,display:""}:{d:"M "+i+",-100000 L "+i+", +100000",display:""}):K(n,{display:"none"})}}},ki.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},ki.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},ki.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},ki.prototype.hide=function(){L(this._snapLines,function(e){e.update()})};const Bw={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",On],resizeSnapping:["type",va],snapping:["type",ki]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Mg],createMoveSnapping:["type",Xr]};function ue(e,t,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=e,this._eventBus=t,this._overlays=n,this._selection=i,this._container=je(ue.BOX_HTML),this._searchInput=Xe(ue.INPUT_SELECTOR,this._container),this._resultsContainer=Xe(ue.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy"],this.close,this)}function Lg(e,t,n){var i=function(o){var a="";return o.forEach(function(c){c.matched?a+=''+sf(c.matched)+"":a+=sf(c.normal)}),a!==""?a:null}(t),r=je(n);r.innerHTML=i,e.appendChild(r)}ue.$inject=["canvas","eventBus","overlays","selection"],ue.prototype._bindEvents=function(){var e=this;function t(n,i,r,o){e._eventMaps.push({el:n,type:r,listener:Gt.bind(n,i,r,o)})}t(document,"html","click",function(n){e.close()}),t(this._container,ue.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,ue.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,ue.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,ue.INPUT_SELECTOR,"keydown",function(n){n.keyCode===38&&n.preventDefault(),n.keyCode===40&&n.preventDefault()}),t(this._container,ue.INPUT_SELECTOR,"keyup",function(n){if(n.keyCode===27)return e.close();if(n.keyCode===13){var i=e._getCurrentResult();return i?e._select(i):e.close()}return n.keyCode===38?e._scrollToDirection(!0):n.keyCode===40?e._scrollToDirection():void(n.keyCode!==37&&n.keyCode!==39&&e._search(n.delegateTarget.value))})},ue.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){Gt.unbind(e.el,e.type,e.listener)})},ue.prototype._search=function(e){var t=this;if(this._clearResults(),e&&e!==""){var n=this._searchProvider.find(e);if(n.length){n.forEach(function(r){var o=r.element.id,a=t._createResultNode(r,o);t._results[o]={element:r.element,node:a}});var i=Xe(ue.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},ue.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},ue.prototype._scrollToNode=function(e){if(e&&e!==this._getCurrentResult()){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t0&&Lg(n,e.primaryTokens,ue.RESULT_PRIMARY_HTML),Lg(n,e.secondaryTokens,ue.RESULT_SECONDARY_HTML),$t(n,ue.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},ue.prototype.registerProvider=function(e){this._searchProvider=e},ue.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,ot(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},ue.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,ot(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},ue.prototype.toggle=function(){this.isOpen()?this.close():this.open()},ue.prototype.isOpen=function(){return this._open},ue.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&ot(t).remove(ue.RESULT_SELECTED_CLASS);var n=$t(e,ue.RESULT_ID_ATTRIBUTE),i=this._results[n].element;ot(e).add(ue.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},ue.prototype._select=function(e){var t=$t(e,ue.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this.close(),this._resetOverlay(),this._canvas.scrollToElement(n,{top:400}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},ue.prototype._resetOverlay=function(e){if(this._overlayId&&this._overlays.remove(this._overlayId),e){var t=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:'
'}}(vt(e));this._overlayId=this._overlays.add(e,t)}},ue.CONTAINER_SELECTOR=".djs-search-container",ue.INPUT_SELECTOR=".djs-search-input input",ue.RESULTS_CONTAINER_SELECTOR=".djs-search-results",ue.RESULT_SELECTOR=".djs-search-result",ue.RESULT_SELECTED_CLASS="djs-search-result-selected",ue.RESULT_SELECTED_SELECTOR="."+ue.RESULT_SELECTED_CLASS,ue.RESULT_ID_ATTRIBUTE="data-result-id",ue.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",ue.OVERLAY_CLASS="djs-search-overlay",ue.BOX_HTML='
',ue.RESULT_HTML='
',ue.RESULT_PRIMARY_HTML='
',ue.RESULT_SECONDARY_HTML='

';const Ow={__depends__:[nu,Rn],searchPad:["type",ue]};function Yp(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}function jg(e){return de(e,function(t){return!!t.matched}).length>0}function Vg(e,t){var n=[],i=e;if(!e)return n;e=e.toLowerCase(),t=t.toLowerCase();var r=e.indexOf(t);return r>-1?(r!==0&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,t.length)}),t.length+r')}),Ln.prototype._interactionModules=[Dm,jm,mE,Fm],Ln.prototype._modelingModules=[vE,wE,AE,SE,IE,_u,DE,u_,Kf,Es,d_,f_,g_,b_,x_,S_,k_,xw,Ew,kw,Pw,Sv,Bw,Lw],Ln.prototype._modules=[].concat(qn.prototype._modules,Ln.prototype._interactionModules,Ln.prototype._modelingModules);const Fg=(e,t,n)=>(n||(n="camunda"),` `),jw={"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 _c,Jp,Vw={exports:{}};_c=typeof window<"u"?window:P0,Jp=function(e,t){var n=(this!==void 0?this:e).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=!!t.createElementNS&&!!t.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=t.createElementNS(this.ns,s);return h.setAttribute("id",this.eid(s)),h},n.extend=function(){var s,h,m,E;for(h=(s=[].slice.call(arguments)).pop(),E=s.length-1;E>=0;E--)if(s[E])for(m in h)s[E].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 e.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=t.getElementsByTagName("body")[0],h=(s?new n.Doc(s):n.adopt(t.documentElement).nested()).size(2,0);n.parser={body:s||t.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")},t.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,E=s.length,T=[];for(m=0;m1?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;E--)this.value[E]=[this.value[E][0]+s,this.value[E][1]+h];return this},size:function(s,h){var m,E=this.bbox();for(m=this.value.length-1;m>=0;m--)E.width&&(this.value[m][0]=(this.value[m][0]-E.x)*s/E.width+E.x),E.height&&(this.value[m][1]=(this.value[m][1]-E.y)*h/E.height+E.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--)(E=this.value[T][0])=="M"||E=="L"||E=="T"?(this.value[T][1]+=s,this.value[T][2]+=h):E=="H"?this.value[T][1]+=s:E=="V"?this.value[T][1]+=h:E=="C"||E=="S"||E=="Q"?(this.value[T][1]+=s,this.value[T][2]+=h,this.value[T][3]+=s,this.value[T][4]+=h,E=="C"&&(this.value[T][5]+=s,this.value[T][6]+=h)):E=="A"&&(this.value[T][6]+=s,this.value[T][7]+=h);return this},size:function(s,h){var m,E,T=this.bbox();for(m=this.value.length-1;m>=0;m--)(E=this.value[m][0])=="M"||E=="L"||E=="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):E=="H"?this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x:E=="V"?this.value[m][1]=(this.value[m][1]-T.y)*h/T.height+T.y:E=="C"||E=="S"||E=="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,E=="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)):E=="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,E;for(s=new n.PathArray(s),E=this.value.length===s.value.length,h=0,m=this.value.length;E&&hN);return E},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=S(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,E=h.firstChild.childNodes.length;m":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 E=new n.Situation({duration:s||1e3,delay:m||0,ease:n.easing[h||"-"]||h});return this.queue(E),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=e.requestAnimationFrame((function(){this.step()}).bind(this))},stopAnimFrame:function(){e.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,E=this.situation;if(E.init)return this;for(s in E.animations)for(m=this.target()[s](),Array.isArray(m)||(m=[m]),Array.isArray(E.animations[s])||(E.animations[s]=[E.animations[s]]),h=m.length;h--;)E.animations[s][h]instanceof n.Number&&(m[h]=new n.Number(m[h])),E.animations[s][h]=m[h].morph(E.animations[s][h]);for(s in E.attrs)E.attrs[s]=new n.MorphObj(this.target().attr(s),E.attrs[s]);for(s in E.styles)E.styles[s]=new n.MorphObj(this.target().style(s),E.styles[s]);return E.initialTransformation=this.target().matrixify(),E.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(E){E.detail.situation==h&&(s.call(this,h),this.off("finished.fx",m))}),this._callStart()},during:function(s){var h=this.last(),m=function(E){E.detail.situation==h&&s.call(this,E.detail.pos,n.morph(E.detail.pos),E.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(E){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,E;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,E=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(E.pos),E.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(E.pos),E.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(E.pos),E.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,E){return arguments.length==1?h=s:arguments.length==3&&(E=m,m=h,h=s),this.around(m,E,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,E){return arguments.length==1?h=s:arguments.length==3&&(E=m,m=h,h=s),s=n.utils.radians(s),h=n.utils.radians(h),this.around(m,E,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("+_(this.a)+","+_(this.b)+","+_(this.c)+","+_(this.d)+","+_(this.e)+","+_(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,E,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?(E=T.bbox(),s.flip=E.cx,s.offset=E.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,E,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?(E=T.bbox(),s.flip=E.cx,s.offset=E.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(E){return parseFloat(E)})]}).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,E=this.arguments.length;m=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,E,T=this.children();for(m=0,E=T.length;mE/T?this.height/T:this.width/E,this.x=h,this.y=m,this.width=E,this.height=T)}else s=typeof s=="string"?s.match(I).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,E){return this.destination=new n.ViewBox(s,h,m,E),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,E){return arguments.length==0?new n.ViewBox(this):this.attr("viewBox",new n.ViewBox(s,h,m,E))}}}),["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,E,T){var M=m.bind(E||s),N=s instanceof n.Element?s.node:s;N.instance=N.instance||{_events:{}};var $=N.instance._events;m._svgjsListenerId||(m._svgjsListenerId=++n.listenerId),h.split(n.regex.delimiter).forEach(function(P){var x=P.split(".")[0],I=P.split(".")[1]||"*";$[x]=$[x]||{},$[x][I]=$[x][I]||{},$[x][I][m._svgjsListenerId]=M,N.addEventListener(x,M,T||!1)})},n.off=function(s,h,m,E){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(N){var $,P,x=N&&N.split(".")[0],I=N&&N.split(".")[1];if(m)M[x]&&M[x][I||"*"]&&(T.removeEventListener(x,M[x][I||"*"][m],E||!1),delete M[x][I||"*"][m]);else if(x&&I){if(M[x]&&M[x][I]){for(P in M[x][I])n.off(T,[x,I].join("."),P);delete M[x][I]}}else if(I)for(N in M)for($ in M[N])I===$&&n.off(T,[N,I].join("."));else if(x){if(M[x]){for($ in M[x])n.off(T,[x,$].join("."));delete M[x]}}else{for(N in M)n.off(T,N);T.instance._events={}}})}},n.extend(n.Element,{on:function(s,h,m,E){return n.on(this,s,h,m,E),this},off:function(s,h){return n.off(this.node,s,h),this},fire:function(s,h){return s instanceof e.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"?t.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=S(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(t.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,E){return s==null?this.array():(s=h!==void 0?{x1:s,y1:h,x2:m,y2:E}: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,E){return n.Line.prototype.plot.apply(this.put(new n.Line),s!=null?[s,h,m,E]:[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 e.Image;return n.on(m,"load",function(){n.off(m);var E=h.parent(n.Pattern);E!==null&&(h.width()==0&&h.height()==0&&h.size(m.width,m.height),E&&E.width()==0&&E.height()==0&&E.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(E){n.off(m),typeof h._error=="function"&&h._error.call(h,E)}),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,E=h.length;m=0;h--)s.childNodes[h]instanceof e.SVGElement&&S(s.childNodes[h]);return n.adopt(s).id(n.eid(s.nodeName))}function w(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 _(s){return Math.abs(s)>1e-37?s:0}["fill","stroke"].forEach(function(s){var h,m={};m[s]=function(E){if(E===void 0)return this;if(typeof E=="string"||n.Color.isRgb(E)||E&&typeof E.fill=="function")this.attr(s,E);else for(h=c[s].length-1;h>=0;h--)E[c[s][h]]!=null&&this.attr(c.prefix(s,c[s][h]),E[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,E){return arguments.length==1||arguments.length==3?this.transform({skew:s,cx:h,cy:m}):this.transform({skewX:s,skewY:h,cx:m,cy:E})},scale:function(s,h,m,E){return arguments.length==1||arguments.length==3?this.transform({scale:s,cx:h,cy:m}):this.transform({scaleX:s,scaleY:h,cx:m,cy:E})},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(E){n.Set.prototype[E]=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=t.getElementById(function(m){var E=(m||"").toString().match(n.regex.reference);if(E)return E[1]}(s)||s);return n.adopt(h)},n.select=function(s,h){return new n.Set(n.utils.map((h||t).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 e.CustomEvent!="function"){var B=function(s,h){h=h||{bubbles:!1,cancelable:!1,detail:void 0};var m=t.createEvent("CustomEvent");return m.initCustomEvent(s,h.bubbles,h.cancelable,h.detail),m};B.prototype=e.Event.prototype,n.CustomEvent=B}else n.CustomEvent=e.CustomEvent;return function(s){for(var h=0,m=["moz","webkit"],E=0;E0){var a=r.x-10,c=r.y-10,l=function(p){return p===1}(o)?"<":"-";(function(p){return p.length==2})(t)&&(l="<>");var u=20*Jw(t[o-1],r);i=i.animate(u,l,0).move(a,c)}}),i.after(function(){e.remove(),n()})},ga.prototype.play=function(){this.gfx.play()},ga.prototype.pause=function(){this.gfx.pause()},ga.prototype.stop=function(){this.fx.stop(),this.gfx.remove()};var Qp,e1=function(e,t){if(typeof e!="string")throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body")return(r=t.createElement("html")).innerHTML=e,r.removeChild(r.lastChild);var r,o=Object.prototype.hasOwnProperty.call(rt,i)?rt[i]:rt._default,a=o[0],c=o[1],l=o[2];for((r=t.createElement("div")).innerHTML=c+e+l;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=t.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},qg=!1;typeof document<"u"&&((Qp=document.createElement("div")).innerHTML='
a',qg=!Qp.getElementsByTagName("link").length,Qp=void 0);var rt={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:qg?[1,"X
","
"]:[0,"",""]};rt.td=rt.th=[3,"","
"],rt.option=rt.optgroup=[1,'"],rt.thead=rt.tbody=rt.colgroup=rt.caption=rt.tfoot=[1,"","
"],rt.polyline=rt.ellipse=rt.polygon=rt.circle=rt.text=rt.line=rt.path=rt.rect=rt.g=[1,'',""];var Mt=e1,eh={},Wg=window.addEventListener?"addEventListener":"attachEvent",t1=window.removeEventListener?"removeEventListener":"detachEvent",Xg=Wg!=="addEventListener"?"on":"";eh.bind=function(e,t,n,i){return e[Wg](Xg+t,n,i||!1),n},eh.unbind=function(e,t,n,i){return e[t1](Xg+t,n,i||!1),n};var vn=eh,n1=Mt,i1=vn,Kg=Fe.is,r1=J.GENERATE_TOKEN_EVENT,o1=J.UPDATE_ELEMENT_EVENT;function th(e,t,n){this._eventBus=e,this._processInstances=t,this._processInstanceSettings=n}th.prototype.createContextPads=function(e){if(e.attachers.length&&this._processInstances.getProcessInstances(e).length){var t=e.incoming.filter(function(r){return Kg(r,"bpmn:SequenceFlow")}),n=this,i=[];return e.attachers.forEach(function(r){var o=r.outgoing.filter(function(c){return Kg(c,"bpmn:SequenceFlow")});if(t.length&&o.length){var a=n1('
');i.push({element:r,html:a}),i1.bind(a,"click",function(){n._processInstances.getProcessInstances(e).forEach(function(c){var l=c.parentProcessInstanceId;r.businessObject.cancelActivity&&(e.children.forEach(function(u){u.tokenCount&&u.tokenCount[c.processInstanceId]&&u.tokenCount[c.processInstanceId]--}),n._processInstances.finish(c.processInstanceId),n._eventBus.fire(o1,{element:e})),n._eventBus.fire(r1,{element:r,processInstanceId:l})})})}}),i}},th.$inject=["eventBus","processInstances","processInstanceSettings"];var a1=th,s1=Fe.is,c1=Mt,l1=vn;function nh(e){this._exclusiveGatewaySettings=e}nh.prototype.createContextPads=function(e){var t=this;if(!(e.outgoing.filter(function(i){return s1(i,"bpmn:SequenceFlow")}).length<2)){var n=c1('
');return l1.bind(n,"click",function(){t._exclusiveGatewaySettings.setSequenceFlow(e)}),[{element:e,html:n}]}},nh.$inject=["exclusiveGatewaySettings"];var u1=nh,Yg=Mt,Jg=vn,ih=Fe.is,Zg=J.GENERATE_TOKEN_EVENT;function rh(e){this._eventBus=e}rh.prototype.createContextPads=function(e){var t=e.parent.shownProcessInstance,n=e.incoming.filter(function(c){return ih(c,"bpmn:SequenceFlow")}),i=[];n.forEach(function(c){var l=c.source;ih(l,"bpmn:EventBasedGateway")&&l.tokenCount&&l.tokenCount[t]&&i.push(l)});var r=e.outgoing.filter(function(c){return ih(c,"bpmn:SequenceFlow")});if(n.length&&r.length){var o,a=this;if(e.tokenCount&&e.tokenCount[t])o=Yg('
'),Jg.bind(o,"click",function(){e.tokenCount[t]--,a._eventBus.fire(Zg,{element:e,processInstanceId:t})});else{if(!i.length)return;o=Yg('
'),Jg.bind(o,"click",function(){i.forEach(function(c){c.tokenCount[t]--}),a._eventBus.fire(Zg,{element:e,processInstanceId:t})})}return[{element:e,html:o}]}},rh.$inject=["eventBus"];var p1=rh,h1=Mt,d1=vn;function oh(e,t){this._processInstances=e,this._processInstanceSettings=t}oh.prototype.createContextPads=function(e){var t=this;if(!(this._processInstances.getProcessInstances(e).filter(function(i){return!i.isFinished}).length<2)){var n=h1('
');return d1.bind(n,"click",function(){t._processInstanceSettings.showNext(e)}),[{element:e,html:n}]}},oh.$inject=["processInstances","processInstanceSettings"];var m1=oh,f1=Mt,v1=vn,y1=Fe.is,g1=J.GENERATE_TOKEN_EVENT;function ah(e,t,n){this._eventBus=e,this._elementRegistry=t,this._animation=n}ah.prototype.createContextPads=function(e){var t=!1;if(this._elementRegistry.forEach(function(r){r.tokenCount&&Object.values(r.tokenCount).forEach(function(o){o&&(t=!0)})}),!(y1(e.parent,"bpmn:SubProcess")||t||this._animation.animations.length)){var n=this,i=f1('
');return v1.bind(i,"click",function(){n._eventBus.fire(g1,{element:e})}),[{element:e,html:i}]}},ah.$inject=["eventBus","elementRegistry","animation"];var b1=ah,Qg=Fe.isAncestor,x1=J.TOGGLE_MODE_EVENT,E1=J.RESET_SIMULATION_EVENT,_1=J.TERMINATE_EVENT,w1=J.UPDATE_ELEMENTS_EVENT,S1=J.UPDATE_ELEMENT_EVENT,C1=J.PROCESS_INSTANCE_SHOWN_EVENT,T1=a1,A1=u1,k1=p1,P1=m1,M1=b1,ba=500;function rr(e,t,n,i,r,o){var a=this;this._elementRegistry=t,this._overlays=n,this._injector=i,this._canvas=r,this._processInstances=o,this.overlayIds={},this.handlers={},this.registerHandler("bpmn:ExclusiveGateway",A1),this.registerHandler("bpmn:IntermediateCatchEvent",k1),this.registerHandler("bpmn:SubProcess",P1),this.registerHandler("bpmn:SubProcess",T1),this.registerHandler("bpmn:StartEvent",M1),e.on(x1,ba,function(c){c.simulationModeActive?a.openContextPads():a.closeContextPads()}),e.on(E1,ba,function(){a.closeContextPads(),a.openContextPads()}),e.on(_1,ba,function(c){var l=c.element.parent;a.closeContextPads(l)}),e.on(w1,ba,function(c){c.elements.forEach(function(l){a.closeElementContextPads(l),a.openElementContextPads(l)})}),e.on(S1,ba,function(c){var l=c.element;a.closeElementContextPads(l),a.openElementContextPads(l)}),e.on(C1,function(c){var l=c.processInstanceId,u=o.getProcessInstance(l).parent;a.closeContextPads(u),a.openContextPads(u)})}rr.prototype.registerHandler=function(e,t){var n=this._injector.instantiate(t);this.handlers[e]||(this.handlers[e]=[]),this.handlers[e].push(n)},rr.prototype.openContextPads=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){t.handlers[n.type]&&Qg(e,n)&&t.openElementContextPads(n)})},rr.prototype.openElementContextPads=function(e){if(this.handlers[e.type]){var t=[];this.handlers[e.type].forEach(function(i){var r=i.createContextPads(e);r&&r.forEach(function(o){o&&t.push(o)})});var n=this;t.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})}},rr.prototype.closeContextPads=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){Qg(e,n)&&t.closeElementContextPads(n)})},rr.prototype.closeElementContextPads=function(e){var t=this;e.attachers&&e.attachers.length>0&&e.attachers.forEach(function(i){t.closeElementContextPads(i)}),e.children&&e.children.length>0&&e.children.forEach(function(i){t.closeElementContextPads(i)});var n=this.overlayIds[e.id];n&&(this._overlays.remove(n),delete this.overlayIds[e.id])},rr.$inject=["eventBus","elementRegistry","overlays","injector","canvas","processInstances"];var R1=rr,N1=J.TOGGLE_MODE_EVENT;function eb(e,t,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=e,this.modelingDisabled=!1,e.on(N1,10001,function(y){var f=y.simulationModeActive;l.modelingDisabled=f,l.modelingDisabled&&(i.cancel(),t.close(),n.cancel()),a._update()}),p(t,"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)})}eb.$inject=["eventBus","contextPad","dragging","directEditing","editorActions","modeling","palette","paletteProvider"];var I1=eb,D1=Mt,B1=J.TOGGLE_MODE_EVENT,O1=J.RESET_SIMULATION_EVENT,L1=J.GENERATE_TOKEN_EVENT;function Kr(e,t){var n=this;this._overlays=e,t.on(B1,function(i){i.simulationModeActive||n.removeElementNotifications()}),t.on([O1,L1],function(){n.removeElementNotifications()})}Kr.prototype.addElementNotifications=function(e,t){var n=this;e.forEach(function(i){n.addElementNotification(i,t)})},Kr.prototype.addElementNotification=function(e,t){var n={top:-15,right:15},i='
'+(t.icon?'':"")+(''+t.text+""||"")+"
",r=D1(i);this._overlays.add(e,"element-notification",{position:n,html:r,show:{minZoom:.5}})},Kr.prototype.removeElementNotifications=function(e){var t=this;e?e.forEach(function(n){t.removeElementNotification(n)}):this._overlays.remove({type:"element-notification"})},Kr.prototype.removeElementNotification=function(e){this._overlays.remove({element:e})},Kr.$inject=["overlays","eventBus"];var tb,nb,j1=Kr;function ib(){return nb?tb:(nb=1,tb=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n
'),MS.bind(this.paletteEntry,"click",function(){e.resetSimulation(),e._notifications.showNotification("Reset Simulation","info")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,2)},Ac.prototype.resetSimulation=function(){pb(this.paletteEntry).add("disabled"),this._elementRegistry.forEach(function(e){e.tokenCount!==void 0&&delete e.tokenCount}),this._eventBus.fire(DS)},Ac.$inject=["eventBus","tokenSimulationPalette","notifications","elementRegistry"];var BS=Ac,OS=Mt,kc=Mi,uh=vn,Pc=ya,LS=J.TOGGLE_MODE_EVENT;function Mc(e,t,n){var i=this;this._canvas=e,this._animation=t,this._eventBus=n,this._init(),n.on(LS,function(r){r.simulationModeActive?kc(i.container).remove("hidden"):kc(i.container).add("hidden")})}Mc.prototype._init=function(){var e=this;this.container=OS('');var t=Pc("#animation-speed-1",this.container),n=Pc("#animation-speed-2",this.container),i=Pc("#animation-speed-3",this.container);uh.bind(t,"click",function(){e.setActive(t),e._animation.setAnimationSpeed(.5)}),uh.bind(n,"click",function(){e.setActive(n),e._animation.setAnimationSpeed(1)}),uh.bind(i,"click",function(){e.setActive(i),e._animation.setAnimationSpeed(1.5)}),this._canvas.getContainer().appendChild(this.container)},Mc.prototype.setActive=function(e){Pc.all(".animation-speed-button",this.container).forEach(function(t){kc(t).remove("active")}),kc(e).add("active")},Mc.$inject=["canvas","animation","eventBus"];var jS=Mc,hb=Mt,Jr=Mi,ph=vn,hh=ya,VS=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e},FS=J.TOGGLE_MODE_EVENT,zS=J.PROCESS_INSTANCE_CREATED_EVENT,$S=J.PROCESS_INSTANCE_FINISHED_EVENT,GS=J.PROCESS_INSTANCE_SHOWN_EVENT,US=J.PROCESS_INSTANCE_HIDDEN_EVENT,HS=J.RESET_SIMULATION_EVENT,qS=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-silver-base-97"),WS=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44");function db(e){return e===null}function yn(e,t,n,i,r,o){var a=this;this._eventBus=e,this._canvas=t,this._processInstanceSettings=n,this._processInstances=i,this._graphicsFactory=r,this._elementRegistry=o,this.highlightedElement=null,this._init(),e.on(FS,function(c){c.simulationModeActive?Jr(a.container).remove("hidden"):(Jr(a.container).add("hidden"),VS(a.container),db(a.highlightedElement)||(a.removeHighlightFromProcess(a.highlightedElement.element),a.highlightedElement=null))}),e.on(zS,function(c){a.addInstance(c)}),e.on($S,function(c){a.removeInstance(c)}),e.on(GS,function(c){a.setInstanceShown(c.processInstanceId)}),e.on(US,function(c){a.setInstanceHidden(c.processInstanceId)}),e.on(HS,function(){a.removeAllInstances()})}yn.prototype._init=function(){this.container=hb(''),this._canvas.getContainer().appendChild(this.container)},yn.prototype.addInstance=function(e){var t=this,n=e.processInstanceId,i=e.parent,r=hb('
'+n+"
");ph.bind(r,"click",function(){t._processInstances.getProcessInstances(i).forEach(function(o){t._processInstanceSettings.hideProcessInstance(o.processInstanceId)}),t._processInstanceSettings.showProcessInstance(n,i)}),ph.bind(r,"mouseenter",function(){t.highlightedElement={element:i,stroke:i.businessObject.di.get("stroke"),fill:i.businessObject.di.get("fill")},t.addHighlightToProcess(i)}),ph.bind(r,"mouseleave",function(){t.removeHighlightFromProcess(i),t.highlightedElement=null}),this.container.appendChild(r)},yn.prototype.removeInstance=function(e){var t=e.processInstanceId,n=hh("#instance-"+t,this.container);n&&n.remove()},yn.prototype.removeAllInstances=function(){this.container.innerHTML=""},yn.prototype.setInstanceShown=function(e){var t=hh("#instance-"+e,this.container);t&&Jr(t).add("active")},yn.prototype.setInstanceHidden=function(e){var t=hh("#instance-"+e,this.container);t&&Jr(t).remove("active")},yn.prototype.addHighlightToProcess=function(e){this.setColor(e,WS,qS),e.parent||Jr(this._canvas.getContainer()).add("highlight")},yn.prototype.removeHighlightFromProcess=function(e){db(this.highlightedElement)||(this.setColor(e,this.highlightedElement.stroke,this.highlightedElement.fill),e.parent||Jr(this._canvas.getContainer()).remove("highlight"))},yn.prototype.setColor=function(e,t,n){var i=e.businessObject;i.di.set("stroke",t),i.di.set("fill",n);var r=this._elementRegistry.getGraphics(e);this._graphicsFactory.update("connection",e,r)},yn.$inject=["eventBus","canvas","processInstanceSettings","processInstances","graphicsFactory","elementRegistry"];var XS=yn,Rc=Fe,KS=Rc.getBusinessObject,Nc=Rc.is,YS=Rc.isAncestor,JS=Rc.isTypedEvent,ZS=J.CONSUME_TOKEN_EVENT;function Ic(e,t,n,i,r,o,a){this._animation=t,this._elementRegistry=n,this._log=i,this._elementNotifications=r,this._canvas=o,this._processInstances=a,e.on(ZS,250,function(){})}Ic.prototype.isDeadlock=function(){var e=this,t=[];this._elementRegistry.forEach(function(r){r.tokenCount&&t.push(r)});var n=[],i=[];t.forEach(function(r){r.outgoing.filter(function(a){return Nc(a,"bpmn:SequenceFlow")}).length||n.push(r),Nc(r,"bpmn:ParallelGateway")&&r.incoming.filter(function(a){return Nc(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),JS(KS(l.target),"bpmn:TerminateEventDefinition")&&i.push(c),a(l.target))})})(r)}),t.length&&!i.length&&n.length&&!this._animation.animations.length&&(e._log.log("Deadlock","warning","fa-exclamation-triangle"),n.forEach(function(r){e._elementNotifications.addElementNotification(r,{type:"warning",icon:"fa-exclamation-triangle",text:"Deadlock"})}))},Ic.prototype.isFinished=function(e,t){var n=this._processInstances.getProcessInstance(t).parent,i=!1;n||(n=this._canvas.getRootElement()),n.children.forEach(function(o){o.tokenCount&&o.tokenCount[t]&&o.tokenCount[t].length&&(i=!0)});var r=!1;if(this._animation.animations.forEach(function(o){YS(n,o.element)&&o.processInstanceId===t&&(r=!0)}),!i&&!r)return Nc(n,"bpmn:SubProcess")?this._log.log("Subprocess "+t+" finished","info","fa-check-circle"):(this._log.log("Process "+t+" finished","success","fa-check-circle"),this._elementNotifications.addElementNotification(e,{type:"success",icon:"fa-check-circle",text:"Finished"})),!0},Ic.$inject=["eventBus","animation","elementRegistry","log","elementNotifications","canvas","processInstances"];var QS=Ic,eC=Mt,Dc=Mi,tC=vn,nC=ya,mb=J.TOGGLE_MODE_EVENT;function Bc(e,t,n,i){var r=this;this._eventBus=e,this._canvas=t,this._selection=n,this._contextPad=i,this.simulationModeActive=!1,e.on("import.done",function(){r.canvasParent=r._canvas.getContainer().parentNode,r.palette=nC(".djs-palette",r._canvas.getContainer()),r._init()})}Bc.prototype._init=function(){this.container=eC(`
Token Simulation
`),tC.bind(this.container,"click",this.toggleMode.bind(this)),this._canvas.getContainer().appendChild(this.container)},Bc.prototype.toggleMode=function(){if(this.simulationModeActive){this.container.innerHTML='Token Simulation ',Dc(this.canvasParent).remove("simulation"),Dc(this.palette).remove("hidden"),this._eventBus.fire(mb,{simulationModeActive:!1});var e=this._selection.get();e.length===1&&this._contextPad.open(e[0])}else this.container.innerHTML='Token Simulation ',Dc(this.canvasParent).add("simulation"),Dc(this.palette).add("hidden"),this._eventBus.fire(mb,{simulationModeActive:!0});this.simulationModeActive=!this.simulationModeActive},Bc.$inject=["eventBus","canvas","selection","contextPad"];var iC=Bc,rC=Mt,fb=Fe.isAncestor,oC=J.TOGGLE_MODE_EVENT,aC=J.GENERATE_TOKEN_EVENT,sC=J.CONSUME_TOKEN_EVENT,cC=J.RESET_SIMULATION_EVENT,lC=J.TERMINATE_EVENT,uC=J.PROCESS_INSTANCE_SHOWN_EVENT;function cr(e,t,n,i,r){var o=this;this._overlays=t,this._elementRegistry=n,this._canvas=i,this._processInstances=r,this.overlayIds={},e.on(oC,function(a){a.simulationModeActive||o.removeTokenCounts()}),e.on(cC,function(){o.removeTokenCounts()}),e.on(lC,function(a){var c=a.element.parent;o.removeTokenCounts(c)}),e.on([aC,sC],500,function(a){var c=a.element.parent;o.removeTokenCounts(c),o.addTokenCounts(c)}),e.on(uC,function(a){var c=a.processInstanceId,l=r.getProcessInstance(c).parent;o.removeTokenCounts(l),o.addTokenCounts(l)})}cr.prototype.addTokenCounts=function(e){var t=this;e||(e=this._canvas.getRootElement());var n=e.shownProcessInstance;if(!n){var i=this._processInstances.getProcessInstances(e);if(!i.length)return;n=i[0].processInstanceId}this._elementRegistry.forEach(function(r){fb(e,r)&&t.addTokenCount(r,n)})},cr.prototype.addTokenCount=function(e,t){var n=e.tokenCount&&e.tokenCount[t];if(n){var i=this.createTokenCount(n),r={bottom:10,left:-15},o=this._overlays.add(e,"token-count",{position:r,html:i,show:{minZoom:.5}});this.overlayIds[e.id]=o}},cr.prototype.createTokenCount=function(e){return rC('
'+e+"
")},cr.prototype.removeTokenCounts=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){fb(e,n)&&t.removeTokenCount(n)})},cr.prototype.removeTokenCount=function(e){var t=this.overlayIds[e.id];t&&(this._overlays.remove(t),delete this.overlayIds[e.id])},cr.$inject=["eventBus","overlays","elementRegistry","canvas","processInstances"];var pC=cr,Aa=Fe,hC=Aa.getBusinessObject,dC=Aa.is,mC=Aa.isAncestor,fC=Aa.getDescendants,vC=Aa.isTypedEvent,yC=J.GENERATE_TOKEN_EVENT,gC=J.TERMINATE_EVENT,bC=J.UPDATE_ELEMENTS_EVENT;function Oc(e,t,n,i,r,o){this._animation=e,this._eventBus=t,this._log=n,this._simulationState=i,this._elementRegistry=r,this._processInstances=o}Oc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,i=vC(hC(t),"bpmn:TerminateEventDefinition"),r=dC(t.parent,"bpmn:SubProcess");i&&(this._eventBus.fire(gC,e),this._elementRegistry.forEach(function(c){mC(t.parent,c)&&c.tokenCount&&c.tokenCount[n]&&delete c.tokenCount[n]}),this._processInstances.finish(n));var o=this._simulationState.isFinished(t,n);if(o&&this._processInstances.finish(n),(o||i)&&r){var a=this._processInstances.getProcessInstance(n);this._eventBus.fire(yC,{element:t.parent,processInstanceId:a.parentProcessInstanceId})}this._eventBus.fire(bC,{elements:fC(this._elementRegistry.getAll(),t.parent)})},Oc.prototype.generate=function(e){},Oc.$inject=["animation","eventBus","log","simulationState","elementRegistry","processInstances"];var xC=Oc,EC=Fe.is,_C=J.UPDATE_ELEMENTS_EVENT;function Lc(e,t){this._eventBus=e,this._animation=t}Lc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++;var i=t.outgoing,r=[];i.forEach(function(o){var a=o.target;EC(a,"bpmn:IntermediateCatchEvent")&&r.push(a)}),this._eventBus.fire(_C,{elements:r})},Lc.prototype.generate=function(){},Lc.$inject=["eventBus","animation"];var wC=Lc,SC=J.CONSUME_TOKEN_EVENT,CC=J.GENERATE_TOKEN_EVENT;function jc(e,t,n){this._eventBus=e,this._animation=t,this._elementRegistry=n}jc.prototype.consume=function(e){var t=e.element;if(!t.sequenceFlow)throw new Error("no sequence flow configured for element "+t.id);this._eventBus.fire(CC,e)},jc.prototype.generate=function(e){var t=e.element,n=e.processInstanceId;if(!t.sequenceFlow)throw new Error("no sequence flow configured for element "+t.id);var i=this,r=this._elementRegistry.get(t.sequenceFlow.id);this._animation.createAnimation(r,n,function(){i._eventBus.fire(SC,{element:r.target,processInstanceId:n})})},jc.$inject=["eventBus","animation","elementRegistry"];var TC=jc,vb=Fe.is,AC=J.CONSUME_TOKEN_EVENT,kC=J.UPDATE_ELEMENT_EVENT,PC=J.UPDATE_ELEMENTS_EVENT;function Vc(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}Vc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,this._eventBus.fire(kC,{element:t})},Vc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(a){return vb(a,"bpmn:SequenceFlow")}).forEach(function(a){t._animation.createAnimation(a,i,function(){t._eventBus.fire(AC,{element:a.target,processInstanceId:i})})});var r=n.parent,o=this._elementRegistry.filter(function(a){return vb(a,"bpmn:IntermediateCatchEvent")&&a.parent===r});this._eventBus.fire(PC,{elements:o})},Vc.$inject=["animation","eventBus","elementRegistry"];var MC=Vc,RC=Fe.is,NC=J.CONSUME_TOKEN_EVENT,IC=J.GENERATE_TOKEN_EVENT;function Fc(e,t){this._animation=e,this._eventBus=t}Fc.prototype.consume=function(e){this._eventBus.fire(IC,{element:e})},Fc.prototype.generate=function(e){var t=this;e.outgoing.filter(function(n){return RC(n,"bpmn:SequenceFlow")}).forEach(function(n){t._animation.createAnimation(n,function(){t._eventBus.fire(NC,{element:n.target})})})},Fc.$inject=["animation","eventBus"];var DC=Fc,BC=Fe.is,OC=J.CONSUME_TOKEN_EVENT,LC=J.GENERATE_TOKEN_EVENT;function zc(e,t){this._animation=e,this._eventBus=t}zc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,t.incoming.length===t.tokenCount[n]&&(this._eventBus.fire(LC,e),t.tokenCount[n]=0)},zc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return BC(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(OC,{element:r.target,processInstanceId:i})})})},zc.$inject=["animation","eventBus"];var jC=zc,dh=Fe.is,VC=J.CONSUME_TOKEN_EVENT,FC=J.UPDATE_ELEMENTS_EVENT;function $c(e,t,n,i){this._animation=e,this._eventBus=t,this._elementRegistry=n,this._processInstances=i}$c.prototype.consume=function(){},$c.prototype.generate=function(e){var t=this,n=e.element,i=e.parentProcessInstanceId,r=n.outgoing.filter(function(l){return dh(l,"bpmn:SequenceFlow")}),o=n.parent,a=this._processInstances.create(o,i);if(r.forEach(function(l){t._animation.createAnimation(l,a,function(){t._eventBus.fire(VC,{element:l.target,processInstanceId:a})})}),!dh(n.parent,"bpmn:SubProcess")){var c=this._elementRegistry.filter(function(l){return dh(l,"bpmn:StartEvent")});this._eventBus.fire(FC,{elements:c})}},$c.$inject=["animation","eventBus","elementRegistry","processInstances"];var zC=$c,yb=Fe.is,$C=J.CONSUME_TOKEN_EVENT,gb=J.GENERATE_TOKEN_EVENT,bb=J.UPDATE_ELEMENT_EVENT;function Gc(e,t,n){this._animation=e,this._eventBus=t,this._log=n}Gc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,i=t.children.filter(function(r){return yb(r,"bpmn:StartEvent")})[0];i?(this._log.log("Starting Subprocess","info","fa-sign-in"),this._eventBus.fire(gb,{element:i,parentProcessInstanceId:n})):(this._log.log("Skipping Subprocess","info","fa-angle-double-right"),this._eventBus.fire(gb,e)),this._eventBus.fire(bb,{element:t})},Gc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return yb(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire($C,{element:r.target,processInstanceId:i})})}),this._eventBus.fire(bb,{element:n})},Gc.$inject=["animation","eventBus","log"];var GC=Gc,UC=Fe.is,HC=J.CONSUME_TOKEN_EVENT,qC=J.UPDATE_ELEMENT_EVENT;function Uc(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}Uc.prototype.consume=function(e){var t=e.element,n=e.processInstanceId;t.tokenCount||(t.tokenCount={}),t.tokenCount[n]||(t.tokenCount[n]=0),t.tokenCount[n]++,this._eventBus.fire(qC,{element:t})},Uc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return UC(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(HC,{element:r.target,processInstanceId:i})})})},Uc.$inject=["animation","eventBus","elementRegistry"];var WC=Uc,XC=Fe.is,KC=J.CONSUME_TOKEN_EVENT,YC=J.GENERATE_TOKEN_EVENT;function Hc(e,t){this._animation=e,this._eventBus=t}Hc.prototype.consume=function(e){this._eventBus.fire(YC,e)},Hc.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return XC(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(KC,{element:r.target,processInstanceId:i})})})},Hc.$inject=["animation","eventBus"];var JC=xC,ZC=wC,QC=TC,eT=MC,tT=DC,nT=jC,iT=zC,rT=GC,oT=WC,aT=Hc,sT=J.GENERATE_TOKEN_EVENT,cT=J.CONSUME_TOKEN_EVENT;function mh(e,t,n){var i=this;this._injector=n,this.handlers={},this.registerHandler("bpmn:EndEvent",JC),this.registerHandler("bpmn:EventBasedGateway",ZC),this.registerHandler("bpmn:ExclusiveGateway",QC),this.registerHandler("bpmn:IntermediateCatchEvent",eT),this.registerHandler("bpmn:IntermediateThrowEvent",tT),this.registerHandler("bpmn:ParallelGateway",nT),this.registerHandler("bpmn:StartEvent",iT),this.registerHandler("bpmn:SubProcess",rT),this.registerHandler("bpmn:BoundaryEvent",oT),this.registerHandler(["bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:Task","bpmn:UserTask"],aT),e.on(sT,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)}),e.on(cT,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)})}mh.prototype.registerHandler=function(e,t){var n=this,i=this._injector.instantiate(t);Array.isArray(e)||(e=[e]),e.forEach(function(r){n.handlers[r]=i})},mh.$inject=["eventBus","animation","injector"];var lT=mh;function xb(e,t,n,i,r,o){o.register({toggleTokenSimulation:function(){t.toggleMode()}}),o.register({togglePauseTokenSimulation:function(){n.toggle()}}),o.register({resetTokenSimulation:function(){r.resetSimulation()}}),o.register({toggleTokenSimulationLog:function(){i.toggle()}})}xb.$inject=["eventBus","toggleMode","pauseSimulation","log","resetSimulation","editorActions"];var uT=xb,pT=J.TOGGLE_MODE_EVENT;function Eb(e,t){var n=t.get("editorActions",!1),i=t.get("keyboard",!1);if(i&&n){var r=!1;e.on("keyboard.init",function(){i.addListener(1e4,function(o){(function(a){qc(["t","T"],a)?n.trigger("toggleTokenSimulation"):r&&(qc(["l","L"],a)?n.trigger("toggleTokenSimulationLog"):qc([" ","Spacebar"],a)?n.trigger("togglePauseTokenSimulation"):qc(["r","R"],a)&&n.trigger("resetTokenSimulation"))})(o.keyEvent)})}),e.on(pT,function(o){var a=o.simulationModeActive;r=!!a})}}function qc(e,t){return e.indexOf(t.key)>-1}Eb.$inject=["eventBus","injector"];var hT=Eb,dT=Mt,_b=Mi,mT=J.TOGGLE_MODE_EVENT;function Wc(e,t){var n=this;this._canvas=t,this.entries=[],this._init(),e.on(mT,function(i){i.simulationModeActive?_b(n.container).remove("hidden"):_b(n.container).add("hidden")})}Wc.prototype._init=function(){this.container=dT(''),this._canvas.getContainer().appendChild(this.container)},Wc.prototype.addEntry=function(e,t){var n=0;this.entries.forEach(function(i){t>=i.index&&n++}),this.container.insertBefore(e,this.container.childNodes[n]),this.entries.push({entry:e,index:t})},Wc.$inject=["eventBus","canvas"];const fT=oo({__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",Qw],contextPads:["type",R1],disableModeling:["type",I1],elementNotifications:["type",j1],elementSupport:["type",G1],exclusiveGatewaySettings:["type",W1],log:["type",tS],notifications:["type",iS],pauseSimulation:["type",hS],preserveElementColors:["type",mS],processInstanceIds:["type",yS],processInstanceSettings:["type",wS],processInstances:["type",kS],resetSimulation:["type",BS],setAnimationSpeed:["type",jS],showProcessInstance:["type",XS],simulationState:["type",QS],toggleMode:["type",iC],tokenCount:["type",pC],tokenSimulationBehavior:["type",lT],tokenSimulationEditorActions:["type",uT],tokenSimulationKeyboardBindings:["type",hT],tokenSimulationPalette:["type",Wc]}),vT={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:[]},yT={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:[]},gT={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:[]},fh=Object.prototype.toString,bT=Object.prototype.hasOwnProperty;qh=function(e){return fh.call(e)==="[object Array]"};function wb(e){const t=fh.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function xT(e,t){return bT.call(e,t)}function ET(e,t){const n=function(r){return wb(r)?r:o=>o===r}(t);let i;return Wh(e,function(r,o){if(n(r,o))return i=r,!1}),i}Wh=function(e,t){let n,i;if(e===void 0)return;const r=qh(e)?wT:_T;for(let o in e)if(xT(e,o)&&(n=e[o],i=t(n,r(o)),i===!1))return n};function Zr(e,t){return!!ET(e,t)}function _T(e){return e}function wT(e){return Number(e)}L0=function(e,...t){return Object.assign(e,...t)};const ST="*";function Qr(e){const t=this;e.on("moddleCopy.canCopyProperty",function(n){const i=n.property,r=n.parent;return t.canCopyProperty(i,r)})}function eo(e,t){return e&&wb(e.$instanceOf)&&e.$instanceOf(t)}function Sb(e,t){return Zr(t,function(n){return eo(e,n)})}function gn(e,t){return t?eo(e,t)?e:e.$parent?gn(e.$parent,t):void 0:e.$parent}Qr.$inject=["eventBus"],Qr.prototype.canCopyProperty=function(e,t){return n=e,!(fh.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(ST)!==-1}(a)?!0:Zr(a,function(c){return gn(r,c)})}(e,t))&&!(eo(e,"camunda:InputOutput")&&!this.canHostInputOutput(t))&&!(Sb(e,["camunda:Connector","camunda:Field"])&&!this.canHostConnector(t))&&!(eo(e,"camunda:In")&&!this.canHostIn(t))&&void 0;var n},Qr.prototype.canHostInputOutput=function(e){if(gn(e,"camunda:Connector"))return!0;const t=gn(e,"bpmn:FlowNode");return!!t&&!Sb(t,["bpmn:StartEvent","bpmn:Gateway","bpmn:BoundaryEvent"])&&!(eo(t,"bpmn:SubProcess")&&t.get("triggeredByEvent"))},Qr.prototype.canHostConnector=function(e){return!eo(gn(e,"camunda:ServiceTaskLike"),"bpmn:MessageEventDefinition")||gn(e,"bpmn:IntermediateThrowEvent")||gn(e,"bpmn:EndEvent")},Qr.prototype.canHostIn=function(e){return gn(e,"bpmn:CallActivity")?!0:!gn(e,"bpmn:SignalEventDefinition")||gn(e,"bpmn:IntermediateThrowEvent")||gn(e,"bpmn:EndEvent")};const CT={__init__:["camundaModdleExtension"],camundaModdleExtension:["type",Qr]},TT={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function vh(e,t){return e&&typeof e.$instanceOf=="function"&&e.$instanceOf(t)}function yh(e,t){return(n=e)&&n.length&&Zr(e,function(i){return vh(i,t)});var n}function gh(e,t,n){const i=t.name,r=TT[i.replace(/activiti:/,"")];return i===e&&function(o,a){return Zr(a,function(c){return vh(o,c)})}(n,r)}function bh(e){e.on("property.clone",function(t){const n=t.newElement,i=t.propertyDescriptor;this.canCloneProperty(n,i)},this)}bh.$inject=["eventBus"],bh.prototype.canCloneProperty=function(e,t){return gh("activiti:FailedJobRetryTimeCycle",t,e)?yh(e.eventDefinitions,"bpmn:TimerEventDefinition")||yh(e.eventDefinitions,"bpmn:SignalEventDefinition")||vh(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):gh("activiti:Connector",t,e)||gh("activiti:Field",t,e)?yh(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const AT={__init__:["ActivitiModdleExtension"],ActivitiModdleExtension:["type",bh]},kT={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function xh(e,t){return e&&typeof e.$instanceOf=="function"&&e.$instanceOf(t)}function Eh(e,t){return(n=e)&&n.length&&Zr(e,function(i){return xh(i,t)});var n}function _h(e,t,n){const i=t.name,r=kT[i.replace(/flowable:/,"")];return i===e&&function(o,a){return Zr(a,function(c){return xh(o,c)})}(n,r)}function wh(e){e.on("property.clone",function(t){const n=t.newElement,i=t.propertyDescriptor;this.canCloneProperty(n,i)},this)}wh.$inject=["eventBus"],wh.prototype.canCloneProperty=function(e,t){return _h("flowable:FailedJobRetryTimeCycle",t,e)?Eh(e.eventDefinitions,"bpmn:TimerEventDefinition")||Eh(e.eventDefinitions,"bpmn:SignalEventDefinition")||xh(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):_h("flowable:Connector",t,e)||_h("flowable:Field",t,e)?Eh(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const PT={__init__:["FlowableModdleExtension"],FlowableModdleExtension:["type",wh]};var Te,Ni,MT=Object.defineProperty,Xc=Object.getOwnPropertySymbols,Cb=Object.prototype.hasOwnProperty,Tb=Object.prototype.propertyIsEnumerable,Sh=(e,t,n)=>t in e?MT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ab=(e,t)=>{for(var n in t||(t={}))Cb.call(t,n)&&Sh(e,n,t[n]);if(Xc)for(var n of Xc(t))Tb.call(t,n)&&Sh(e,n,t[n]);return e},Ii=(e,t,n)=>(Sh(e,typeof t!="symbol"?t+"":t,n),n);function bn(e){return e==null}function Ch(e){return typeof e=="string"}(Ni=Te||(Te={})).Root="Root",Ni.Declaration="Declaration",Ni.Comment="Comment",Ni.DocumentType="DocumentType",Ni.Element="Element",Ni.Text="Text",Ni.Instruction="Instruction",Ni.CDATA="CDATA";var cn=class{constructor(e,t=null,n=null){Ii(this,"name"),Ii(this,"type"),Ii(this,"parent"),Ii(this,"children"),Ii(this,"attributes"),Ii(this,"value"),Ii(this,"selfClosing"),Ii(this,"prefix"),this.name="",this.type=e,this.parent=t,this.value=n,this.children=null,this.attributes={},this.selfClosing=!1,this.prefix=""}setName(e){return this.name=e,this}setType(e){return this.type=e,this}setParent(e){return this.parent=e,this}setChildren(e){return this.children=e&&Array.from(e),this}setAttributes(e){return this.attributes=Ab({},e),this}setValue(e){return this.value=e,this}setSelfClosing(e){return this.selfClosing=e,this}setPrefix(e){return this.prefix=e,this}addAttribute(e,t){return this.attributes[e]=t,this}removeAttribute(e){return delete this.attributes[e],this}addChild(e){return e===this||(this.children||(this.children=[]),this.children.push(e),e.parent!==this&&(e.parent=this)),this}removeChild(e){if(this.children&&this.children.length){const t=this.children.findIndex(n=>n===e);~t&&(this.children.splice(t,1),e.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:bn(this.value)?void 0:this.value,selfClosing:this.selfClosing||void 0,children:(this.type===Te.Element||this.type===Te.Root)&&this.children&&this.children.length?this.children.map(e=>e.toJSON()):void 0}}toXmlString(e=" ",t=` `,n=0){const i=e.repeat(n);let r="";switch(this.type){case Te.Root:r+=this.children&&this.children.length?this.children.map(o=>o.toXmlString(e,t,n)).join(t):"";break;case Te.Element:{if(!this.name)return"";const o=this.prefix?`${this.prefix}:${this.name}`:this.name;r+=`${i}<${o}`;const a=kb(this.attributes||{});a&&(r+=` ${a}`),this.children&&this.children.length?r+=`>${t}${this.children.map(c=>c.toXmlString(e,t,n+1)).join(t)}${t}${i}`:r+=this.selfClosing?" />":`>`;break}case Te.CDATA:r+=`${i}`;break;case Te.Text:r+=bn(this.value)?"":`${i}${this.value}`;break;case Te.DocumentType:r+=bn(this.value)?"":`${i}`;break;case Te.Comment:r+=`${i}`;break;case Te.Declaration:if(r+=`${i}{var l={};for(var u in a)Cb.call(a,u)&&c.indexOf(u)<0&&(l[u]=a[u]);if(a!=null&&Xc)for(var u of Xc(a))c.indexOf(u)<0&&Tb.call(a,u)&&(l[u]=a[u]);return l})(this.attributes,["version"]);o&&(r+=kb(o))}r+="?>";break;case Te.Instruction:r+=bn(this.value)?"":`${i}`}return r}toJSON(){return this.toJsObject()}toString(){return this.toXmlString("","")}};function kb(e){return Object.keys(e).map(t=>{const n=e[t];return bn(n)?null:function(i){return typeof i=="boolean"}(n)?n?t:null:`${t}="${n}"`}).filter(Boolean).join(" ")}var Pb=e=>e,Mb={ignoreAttributes:!1,parseNodeValue:!0,trimValues:!0,prefixInName:!1,valueProcessor:Pb,attributeProcessor:Pb},RT=Object.keys(Mb),lr="Tag is not closed.";function NT(e,t={}){const n=e.replace(/\r\n?/g,` `),i=function(l={}){const u=Ab({},l);return RT.forEach(p=>{bn(u[p])&&(u[p]=Mb[p])}),u}(t),r=n.length,o=new cn(Te.Root);let a=o,c="";for(let l=0;l",l,`Element End ${lr}`);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=Th(ur("",Te.Text,c,i));f&&a.addChild(new cn(Te.Text,a,f))}a=a.parent,c="",l=p}else if(n[l+1]==="?"){const p=to(n,"?>",l,`Processing Instruction ${lr}`),d=n.substring(l+2,p-1);if(a)if(d.startsWith("xml ")&&d.includes("version=")&&a.type===Te.Root){const y=new cn(Te.Declaration,a);y.attributes=Ah(d.substr(4),Te.Declaration,i),a.addChild(y)}else a.addChild(new cn(Te.Instruction,a,ur("",Te.Instruction,d,i)));l=p}else if(n.substr(l+1,3)==="!--"){const p=to(n,"-->",l,`Comment ${lr}`),d=n.substring(l+4,p-2);a&&a.addChild(new cn(Te.Comment,a,ur("",Te.Comment,d,i))),l=p}else if(n.substr(l+1,8)==="!DOCTYPE"){let p=to(n,">",l,`Document Type ${lr}`),d=n.substring(l+9,p);d.includes("[")&&(p=to(n,"]>",l,`Document Type ${lr}`),d=n.substring(l+9,p)),a&&a.addChild(new cn(Te.DocumentType,a,ur("",Te.DocumentType,d,i))),l=p}else if(n.substr(l+1,8)==="![CDATA["){const p=to(n,"]]>",l,`CDATA Section ${lr}`),d=n.substring(l+9,p-2);if(a&&c){const y=Th(ur("",Te.Text,c,i));y&&a.addChild(new cn(Te.Text,a,y))}a.addChild(new cn(Te.CDATA,a,ur("",Te.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 ${lr}`);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=Th(ur("",Te.Text,c,i));b&&a.addChild(new cn(Te.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 cn(Te.Element,a);b.name=v,b.selfClosing=!0,b.prefix=g,d&&!i.ignoreAttributes&&(b.attributes=Ah(d,Te.Element,i)),a.addChild(b)}else{const b=new cn(Te.Element,a);d&&!i.ignoreAttributes&&(b.attributes=Ah(d,Te.Element,i)),b.name=v,b.prefix=g,a.addChild(b),a=b}c="",l=y}}return o}function to(e,t,n,i){const r=e.indexOf(t,n);if(!~r)throw new Error(i);return r+t.length-1}function ur(e,t,n,i){return n?(i.trimValues&&(n=n.trim()),Rb(i.valueProcessor(n,t,e),i.parseNodeValue)):null}function Rb(e,t){return t&&Ch(e)?(e=e.trim())==="true"||e!=="false"&&function(n){const i=parseFloat(n);return Number.isNaN(i)?n:i}(e):bn(e)?null:e}function Th(e){return bn(e)?"":Ch(e)?e:String(e)}var IT=/[^\s=]+\s*(=\s*['"][\s\S]*?['"])?/g;function Ah(e,t,n){const i=(e=e.replace(/\r?\n/g," ")).match(IT)||[],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:e=>["default","medium","small","mini"].indexOf(e)!==-1},headerButtonType:{type:String,default:"primary",validator:e=>["default","primary","success","warning","danger","info"].indexOf(e)!==-1}},emits:["destroy","init-finished","save","commandStack-changed","input","change","canvas-viewbox-changed","element-click"],setup(e,{emit:t}){const n=W(),i=W(),r=t,o=e;ol("configGlobal",o);let a=null;const c=W(1),l=W(!1),u=W(!1),p=W(""),d=W("xml"),y=W(!1),f=W(!1),v=$h(()=>{console.log(o.additionalModel,"additionalModel");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",(N=o.translations||jw,function($,P){return P=P||{},($=N[$]||$).replace(/{([^}]+)}/g,function(x,I){let j=P[I];return N[P[I]]!==null&&N[P[I]]!==void 0&&(j=N[P[I]]),j||"{"+I+"}"})})]};var N;return T.push(M),o.simulation&&T.push(fT),console.log(o.prefix,"props.prefix "),o.prefix==="camunda"&&T.push(CT),o.prefix==="flowable"&&T.push(PT),o.prefix==="activiti"&&T.push(AT),T}),g=$h(()=>{console.log(o.onlyCustomizeModdle,"props.onlyCustomizeModdle"),console.log(o.moddleExtension,"props.moddleExtension"),console.log(o.prefix,"props.prefix");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=yT),o.prefix==="flowable"&&(T.flowable=gT),o.prefix==="camunda"&&(T.camunda=vT),T});console.log(v,"additionalModules()"),console.log(g,"moddleExtensions()");const b=()=>{const T=a.get("eventBus");console.log(T,"EventBus"),o.events.forEach(M=>{T.on(M,function(N){let $=M.replace(/\./g,"-"),P=N?N.element:null;console.log($,"eventName"),console.log(P,"element"),r("element-click",P,N)})}),T.on("commandStack.changed",async M=>{try{y.value=a.get("commandStack").canRedo(),f.value=a.get("commandStack").canUndo();let{xml:N}=await a.saveXML({format:!0});r("commandStack-changed",M),r("input",N),r("change",N)}catch(N){console.error(`[Process Designer Warn]: ${N.message||N}`)}}),a.on("canvas.viewbox.changed",({viewbox:M})=>{r("canvas-viewbox-changed",{viewbox:M});const{scale:N}=M;c.value=Math.floor(100*N)/100})},S=async T=>{console.log(T,"xml");let M=o.processId||`Process_${new Date().getTime()}`,N=o.processName||`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,$=T||Fg(M,N,o.prefix);try{let{warnings:P}=await a.importXML($);console.log(P,"warnings"),P&&P.length&&P.forEach(x=>console.warn(x))}catch(P){console.error(`[Process Designer Warn]: ${P.message||P}`)}},w=async T=>{try{if(T==="xml"||T==="bpmn"){const{err:N,xml:$}=await a.saveXML();N&&console.error(`[Process Designer Warn ]: ${N.message||N}`);let{href:P,filename:x}=_(T.toUpperCase(),$);M(P,x)}else{const{err:N,svg:$}=await a.saveSVG();if(N)return console.error(N);let{href:P,filename:x}=_("SVG",$);M(P,x)}}catch(N){console.error(`[Process Designer Warn ]: ${N.message||N}`)}function M(N,$){if(N&&$){let P=document.createElement("a");P.download=$,P.href=N,P.click(),URL.revokeObjectURL(P.href)}}},_=(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 N=this.result;S(N)}},B=()=>{u.value=!u.value,console.log(a.get("toggleMode","strict"),"bpmnModeler.get('toggleMode')"),o.simulation&&a.get("toggleMode","strict").toggleMode()},s=T=>{const M=a.get("alignElements"),N=a.get("selection").get();!N||N.length<=1?IA.warning("\u8BF7\u6309\u4F4F Shift \u952E\u9009\u62E9\u591A\u4E2A\u5143\u7D20\u5BF9\u9F50"):ao.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(N,T)})},h=()=>{console.log(a.saveXML,"bpmnModeler"),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 N;const M=new cn(Te.Root,NT(T));p.value=(N=M.parent)==null?void 0:N.toJSON(),d.value="json",l.value=!0})},E=async()=>{console.log(a,"bpmnModelerbpmnModelerbpmnModelerbpmnModeler");const{err:T,xml:M}=await a.saveXML();console.log(T,"errerrerrerrerr"),console.log(M,"xmlxmlxmlxmlxml"),T?alert("\u4FDD\u5B58\u6A21\u578B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01"):r("save",M)};return MA(()=>{console.log(o,"propspropspropsprops")}),Ma(()=>{(()=>{if(a)return;let T=document.getElementById("bpmnCanvas");console.log(T,"data"),console.log(o.keyboard,"props.keyboard"),console.log(v,"additionalModules()"),console.log(g,"moddleExtensions()"),a=new Ln({container:T,keyboard:o.keyboard?{bindTo:document}:null,additionalModules:v.value,moddleExtensions:g.value}),console.log(a,"bpmnModeler111111"),r("init-finished",a),b()})(),S(o.value)}),jn(()=>{a&&a.destroy(),r("destroy",a),a=null}),(T,M)=>{const N=ho,$=GA,P=DA,x=BA,I=so,j=AA,G=RA("highlight");return ne(),De("div",Nb,[Ve("div",Ib,[NA(T.$slots,"control-header"),T.$slots["control-header"]?ke("",!0):(ne(),De(ln,{key:0},[R(x,{key:"file-control"},{default:V(()=>[R(N,{preIcon:"ep:folder-opened",title:"\u6253\u5F00\u6587\u4EF6",onClick:M[0]||(M[0]=X=>D(i).click())}),R(P,{effect:"light",placement:"bottom"},{content:V(()=>[Ve("div",Db,[R($,{title:"\u4E0B\u8F7D\u4E3AXML\u6587\u4EF6",onClick:M[1]||(M[1]=X=>{w("xml")})}),Bb,R($,{title:"\u4E0B\u8F7D\u4E3ASVG\u6587\u4EF6",onClick:M[2]||(M[2]=X=>{w("svg")})}),Ob,R($,{title:"\u4E0B\u8F7D\u4E3ABPMN\u6587\u4EF6",onClick:M[3]||(M[3]=X=>{w("bpmn")})})])]),default:V(()=>[R(N,{title:"\u4E0B\u8F7D\u6587\u4EF6",preIcon:"ep:download"})]),_:1}),R(P,{effect:"light"},{content:V(()=>[R($,{title:"\u9884\u89C8XML",onClick:h}),Lb,R($,{title:"\u9884\u89C8JSON",onClick:m})]),default:V(()=>[R(N,{preIcon:"ep:view",title:"\u6D4F\u89C8"})]),_:1}),o.simulation?(ne(),Ce(P,{key:0,effect:"light",content:D(u)?"\u9000\u51FA\u6A21\u62DF":"\u5F00\u542F\u6A21\u62DF"},{default:V(()=>[R(N,{preIcon:"ep:cpu",title:"\u6A21\u62DF",onClick:B})]),_:1},8,["content"])):ke("",!0)]),_:1}),R(x,{key:"align-control"},{default:V(()=>[R(P,{effect:"light",content:"\u5411\u5DE6\u5BF9\u9F50"},{default:V(()=>[R(N,{preIcon:"fa:align-left",class:"align align-bottom",onClick:M[4]||(M[4]=X=>s("left"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u53F3\u5BF9\u9F50"},{default:V(()=>[R(N,{preIcon:"fa:align-left",class:"align align-top",onClick:M[5]||(M[5]=X=>s("right"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u4E0A\u5BF9\u9F50"},{default:V(()=>[R(N,{preIcon:"fa:align-left",class:"align align-left",onClick:M[6]||(M[6]=X=>s("top"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u4E0B\u5BF9\u9F50"},{default:V(()=>[R(N,{preIcon:"fa:align-left",class:"align align-right",onClick:M[7]||(M[7]=X=>s("bottom"))})]),_:1}),R(P,{effect:"light",content:"\u6C34\u5E73\u5C45\u4E2D"},{default:V(()=>[R(N,{preIcon:"fa:align-left",class:"align align-center",onClick:M[8]||(M[8]=X=>s("center"))})]),_:1}),R(P,{effect:"light",content:"\u5782\u76F4\u5C45\u4E2D"},{default:V(()=>[R(N,{preIcon:"fa:align-left",class:"align align-middle",onClick:M[9]||(M[9]=X=>s("middle"))})]),_:1})]),_:1}),R(x,{key:"scale-control"},{default:V(()=>[R(P,{effect:"light",content:"\u7F29\u5C0F\u89C6\u56FE"},{default:V(()=>[R(N,{preIcon:"ep:zoom-out",onClick:M[10]||(M[10]=X=>((ee=.1)=>{let re=Math.floor(100*c.value-100*ee)/100;if(re<.2)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");c.value=re,a.get("canvas").zoom(c.value)})()),disabled:D(c)<.2},null,8,["disabled"])]),_:1}),R(I,null,{default:V(()=>[me(M0(Math.floor(10*D(c)*10)+"%"),1)]),_:1}),R(P,{effect:"light",content:"\u653E\u5927\u89C6\u56FE"},{default:V(()=>[R(N,{preIcon:"ep:zoom-in",onClick:M[11]||(M[11]=X=>((ee=.1)=>{let re=Math.floor(100*c.value+100*ee)/100;if(re>4)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");c.value=re,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(N,{preIcon:"ep:scale-to-original",onClick:M[12]||(M[12]=X=>(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(N,{preIcon:"ep:refresh-left",onClick:M[13]||(M[13]=X=>{a.get("commandStack").undo()}),disabled:!D(f)},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u6062\u590D"},{default:V(()=>[R(N,{preIcon:"ep:refresh-right",onClick:M[14]||(M[14]=X=>{a.get("commandStack").redo()}),disabled:!D(y)},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u91CD\u65B0\u7ED8\u5236"},{default:V(()=>[R(N,{preIcon:"ep:refresh",onClick:M[15]||(M[15]=X=>(y.value=!1,f.value=!1,void S(null)))})]),_:1})]),_:1}),R(N,{preIcon:"ep:plus",title:"\u4FDD\u5B58\u6A21\u578B",onClick:E,type:o.headerButtonType,disabled:D(u)},null,8,["type","disabled"])],64)),Ve("input",{type:"file",id:"files",ref_key:"refFile",ref:i,style:{display:"none"},accept:".xml, .bpmn",onChange:C},null,544)]),Ve("div",jb,[Ve("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]=X=>un(l)?l.value=X:null),width:"80%",scroll:!0,"max-height":"600px"},{default:V(()=>[al((ne(),De("div",null,[Ve("code",Vb,M0(D(p)),1)])),[[G]])]),_:1},8,["modelValue"])])}}}),Na=Nt(Fb,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue"]]),Na.install=function(e){e.component(Na.name,Na)};const DT={class:"panel-tab__content"},BT={key:0},OT={key:1},LT=Rt({name:"ElementBaseInfo",__name:"ElementBaseInfo",props:{businessObject:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}}},setup(e){const t=e,n=W({}),i=W(),r=W({}),o=OA({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$]*/)?(console.log("key \u6EE1\u8DB3 XML NCName \u89C4\u5219\uFF0C\u6240\u4EE5\u8FDB\u884C\u8D4B\u503C"),r.value.id=p,setTimeout(()=>{u("id")},100)):console.log("key \u4E0D\u6EE1\u8DB3 XML NCName \u89C4\u5219\uFF0C\u6240\u4EE5\u4E0D\u8FDB\u884C\u8D4B\u503C"))},l=p=>{console.log(r,"elementBaseInfo"),p&&(r.value.name=p,setTimeout(()=>{u("name")},100))},u=p=>{console.log(p,"key");const d=Object.create(null);d[p]=r.value[p],console.log(r,"elementBaseInfo11111111111"),n.value={...r.value,...n.value},p==="id"?(console.log("jinru"),console.log(window,"window"),console.log(i.value,"bpmnElement"),console.log(Be(i.value),"bpmnElement"),a().modeling.updateProperties(Be(i.value),{id:r.value[p],di:{id:`${r.value[p]}_di`}})):(console.log(d,"attrObj"),a().modeling.updateProperties(Be(i.value),d))};return Ma(()=>{setTimeout(()=>{console.log(t.model,"props.model"),c(t.model.key),l(t.model.name),console.log(t,"propsssssssssssssssssssss")},1e3)}),mt(()=>t.businessObject,p=>{var d;console.log(p,"val11111111111111111111"),p&&(console.log(window,"window"),console.log(i.value,"bpmnElement"),i.value=(d=a())==null?void 0:d.bpmnElement,console.log(i.value,"resetBaseInfo11111111111"),r.value=i.value.businessObject,n.value.type=i.value.businessObject.$type,console.log(r.value,"elementBaseInfo22222222222"))}),jn(()=>{i.value=null}),(p,d)=>{const y=Hh,f=wn,v=Sn,g=oi;return ne(),De("div",DT,[R(g,{"label-width":"90px",model:D(n),rules:D(o)},{default:V(()=>[D(n).type=="bpmn:Process"?(ne(),De("div",BT,[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(()=>[me(" \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})])):(ne(),De("div",OT,[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"])])}}}),jT=Nt(LT,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/base/ElementBaseInfo.vue"]]),VT={class:"panel-tab__content"},FT={class:"element-property input-property"},zT=Ve("div",{class:"element-property__label"},"\u5143\u7D20\u6587\u6863\uFF1A",-1),$T={class:"element-property__value"},GT=Rt({name:"ElementOtherConfig",__name:"ElementOtherConfig",props:{id:String},setup(e){const t=e,n=W(""),i=W(),r=()=>window.bpmnInstances,o=()=>{i.value&&i.value.id===t.id||(i.value=r().elementRegistry.get(t.id));const a=r().bpmnFactory.create("bpmn:Documentation",{text:n.value});r().modeling.updateProperties(Be(i.value),{documentation:[a]})};return jn(()=>{i.value=null}),mt(()=>t.id,a=>{a&&a.length?zt(()=>{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=wn;return ne(),De("div",VT,[Ve("div",FT,[zT,Ve("div",$T,[R(l,{type:"textarea",modelValue:D(n),"onUpdate:modelValue":c[0]||(c[0]=u=>un(n)?n.value=u:null),resize:"vertical",autosize:{minRows:2,maxRows:4},onInput:o,onBlur:o},null,8,["modelValue"])])])])}}}),UT=Nt(GT,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/other/ElementOtherConfig.vue"]]),HT={style:{"margin-top":"16px"}},qT=Rt({name:"UserTask",__name:"UserTask",props:{id:String,type:String},setup(e){const t=e,n=W({assignee:"",candidateUsers:[],candidateGroups:[],dueDate:"",followUpDate:"",priority:""}),i=W({}),r=W(),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(Be(r.value),l)};return mt(()=>t.id,()=>{r.value=o().bpmnElement,zt(()=>{(()=>{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}),jn(()=>{r.value=null}),(c,l)=>{const u=wn,p=Sn,d=Hh,y=R0("router-link");return ne(),De("div",HT,[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}),me(" \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(()=>[me("\u6D41\u7A0B\u6A21\u578B")]),_:1})]),_:1}),me(" \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 ")])}}}),WT=Nt(qT,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/task/task-components/UserTask.vue"]]),XT={style:{"margin-top":"16px"}},KT=Rt({name:"ScriptTask",__name:"ScriptTask",props:{id:String,type:String},setup(e){const t=e,n=W({scriptFormat:"",script:"",resource:"",resultVariable:""}),i=W({}),r=W(),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(Be(r.value),c)};return jn(()=>{r.value=null}),mt(()=>t.id,()=>{r.value=o().bpmnElement,zt(()=>{(()=>{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=wn,p=Sn,d=co,y=lo;return ne(),De("div",XT,[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}),al(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),[[Gh,D(i).scriptType==="inline"]]),al(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),[[Gh,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})])}}}),YT=Nt(KT,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue"]]),JT={style:{"margin-top":"16px"}},ZT={style:{display:"flex","align-items":"center","justify-content":"space-between","flex-wrap":"nowrap"}},QT=Rt({name:"ReceiveTask",__name:"ReceiveTask",props:{id:String,type:String},setup(e){const t=e,n=I0(),i=W(""),r=W({}),o=W({}),a=W(!1),c=W(),l=W(),u=W(),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(Be(c.value),{messageRef:null}):p().modeling.updateProperties(Be(c.value),{messageRef:l.value[v]})};return Ma(()=>{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"}),jn(()=>{c.value=null}),mt(()=>t.id,()=>{zt(()=>{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=co,S=lo,w=ho,_=Sn,C=wn,B=oi,s=so,h=Ra;return ne(),De("div",JT,[R(_,{label:"\u6D88\u606F\u5B9E\u4F8B"},{default:V(()=>[Ve("div",ZT,[R(S,{modelValue:D(i),"onUpdate:modelValue":g[0]||(g[0]=m=>un(i)?i.value=m:null),onChange:f},{default:V(()=>[(ne(!0),De(ln,null,uo(Object.keys(D(o)),m=>(ne(),Ce(b,{value:m,label:D(o)[m],key:m},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),R(w,{type:"primary",preIcon:"ep:plus",style:{"margin-left":"8px"},onClick:d})])]),_:1}),R(h,{modelValue:D(a),"onUpdate:modelValue":g[3]||(g[3]=m=>un(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(()=>[me("\u786E \u8BA4")]),_:1})]),default:V(()=>[R(B,{model:D(r),size:"small","label-width":"90px"},{default:V(()=>[R(_,{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(_,{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"])])}}}),eA=Nt(QT,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue"]]),tA={class:"panel-tab__content"},nA=Rt({name:"ElementTaskConfig",__name:"ElementTask",props:{id:String,type:String},setup(e){const t=e,n=W({asyncAfter:!1,asyncBefore:!1,exclusive:!1}),i=W(),r=W({UserTask:"UserTask",ScriptTask:"ScriptTask",ReceiveTask:"ReceiveTask"}),o=W(),a=()=>window.bpmnInstances,c=()=>{n.value.asyncBefore||n.value.asyncAfter||(n.value.exclusive=!1),a().modeling.updateProperties(a().bpmnElement,{...n.value})};return mt(()=>t.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}),mt(()=>t.type,()=>{t.type==r.value.UserTask&&(i.value=WT),t.type==r.value.ScriptTask&&(i.value=YT),t.type==r.value.ReceiveTask&&(i.value=eA)},{immediate:!0}),(l,u)=>{const p=N0,d=Sn,y=oi;return ne(),De("div",tA,[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?(ne(),Ce(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"])):ke("",!0)]),_:1}),(ne(),Ce(VA(D(i)),LA(jA(l.$props)),null,16))]),_:1})])}}}),iA=Nt(nA,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/task/ElementTask.vue"]]),rA={class:"panel-tab__content"},oA=Rt({name:"ElementMultiInstance",__name:"ElementMultiInstance",props:{businessObject:Object,type:String},setup(e){const t=e,n=po("prefix"),i=W(""),r=W({completionCondition:"",loopCardinality:"",extensionElements:[],asyncAfter:!1,asyncBefore:!1,exclusive:!1}),o=W({}),a=W(null),c=W(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(Be(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(Be(a.value),{loopCharacteristics:Be(c.value)})}else l().modeling.updateProperties(Be(a.value),{loopCharacteristics:null})},p=g=>{let b=null;g&&g.length&&(b=l().moddle.create("bpmn:FormalExpression",{body:g})),l().modeling.updateModdleProperties(Be(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(Be(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(Be(a.value),c.value,{extensionElements:b})},f=()=>{l().modeling.updateModdleProperties(Be(a.value),c.value,{collection:o.value.collection||null,elementVariable:o.value.elementVariable||null})},v=g=>{const{asyncBefore:b,asyncAfter:S}=o.value;let w=Object.create(null);b||S?w[g]=o.value[g]:(o.value.exclusive=!1,w={asyncBefore:!1,asyncAfter:!1,exclusive:!1,extensionElements:null}),l().modeling.updateModdleProperties(Be(a.value),c.value,w)};return jn(()=>{c.value=null,a.value=null}),mt(()=>t.businessObject,g=>{var 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:((w=(S=b.loopCharacteristics)==null?void 0:S.completionCondition)==null?void 0:w.body)??"",loopCardinality:((C=(_=b.loopCharacteristics)==null?void 0:_.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 S=co,w=lo,_=Sn,C=wn,B=N0,s=oi;return ne(),De("div",rA,[R(s,{"label-width":"90px"},{default:V(()=>[R(_,{label:"\u56DE\u8DEF\u7279\u6027"},{default:V(()=>[R(w,{modelValue:D(i),"onUpdate:modelValue":b[0]||(b[0]=h=>un(i)?i.value=h:null),onChange:u},{default:V(()=>[R(S,{label:"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6",value:"ParallelMultiInstance"}),R(S,{label:"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",value:"SequentialMultiInstance"}),R(S,{label:"\u5FAA\u73AF\u4E8B\u4EF6",value:"StandardLoop"}),R(S,{label:"\u65E0",value:"Null"})]),_:1},8,["modelValue"])]),_:1}),D(i)==="ParallelMultiInstance"||D(i)==="SequentialMultiInstance"?(ne(),De(ln,{key:0},[R(_,{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}),al(R(_,{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),[[Gh,!1]]),R(_,{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(_,{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(_,{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?(ne(),Ce(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"])):ke("",!0)]),_:1}),D(o).asyncAfter||D(o).asyncBefore?(ne(),Ce(_,{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})):ke("",!0)],64)):ke("",!0)]),_:1})])}}}),aA=Nt(oA,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/multi-instance/ElementMultiInstance.vue"]]),sA={class:"panel-tab__content"},cA=Rt({name:"FlowCondition",__name:"FlowCondition",props:{businessObject:Object,type:String},setup(e){const t=e,n=W({}),i=W(),r=W(),o=W(),a=W(),c=()=>window==null?void 0:window.bpmnInstances,l=p=>p==="condition"?(a.value=c().moddle.create("bpmn:FormalExpression"),void c().modeling.updateProperties(Be(i.value),{conditionExpression:a.value})):p==="default"?(c().modeling.updateProperties(Be(i.value),{conditionExpression:null}),void c().modeling.updateProperties(Be(r.value),{default:i.value})):(o.value.default&&o.value.default.id===i.value.id&&c().modeling.updateProperties(Be(r.value),{default:null}),void c().modeling.updateProperties(Be(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(Be(i.value),{conditionExpression:p})};return jn(()=>{i.value=null,r.value=null,o.value=null}),mt(()=>t.businessObject,p=>{console.log(p,"val"),zt(()=>{(()=>{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=co,f=lo,v=Sn,g=wn,b=oi;return ne(),De("div",sA,[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]=S=>D(n).type=S),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"?(ne(),Ce(v,{label:"\u6761\u4EF6\u683C\u5F0F",key:"condition"},{default:V(()=>[R(f,{modelValue:D(n).conditionType,"onUpdate:modelValue":d[1]||(d[1]=S=>D(n).conditionType=S)},{default:V(()=>[R(y,{label:"\u8868\u8FBE\u5F0F",value:"expression"}),R(y,{label:"\u811A\u672C",value:"script"})]),_:1},8,["modelValue"])]),_:1})):ke("",!0),D(n).conditionType&&D(n).conditionType==="expression"?(ne(),Ce(v,{label:"\u8868\u8FBE\u5F0F",key:"express"},{default:V(()=>[R(g,{modelValue:D(n).body,"onUpdate:modelValue":d[2]||(d[2]=S=>D(n).body=S),style:{width:"192px"},clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):ke("",!0),D(n).conditionType&&D(n).conditionType==="script"?(ne(),De(ln,{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]=S=>D(n).language=S),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]=S=>D(n).scriptType=S)},{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"?(ne(),Ce(v,{label:"\u811A\u672C",key:"body"},{default:V(()=>[R(g,{modelValue:D(n).body,"onUpdate:modelValue":d[5]||(d[5]=S=>D(n).body=S),type:"textarea",clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):ke("",!0),D(n).scriptType==="externalScript"?(ne(),Ce(v,{label:"\u8D44\u6E90\u5730\u5740",key:"resource"},{default:V(()=>[R(g,{modelValue:D(n).resource,"onUpdate:modelValue":d[6]||(d[6]=S=>D(n).resource=S),clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):ke("",!0)],64)):ke("",!0)]),_:1},8,["model"])])}}}),lA=Nt(cA,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue"]]),uA={class:"panel-tab__content"},pA={class:"panel-tab__content--title"},hA={class:"panel-tab__content--title",style:{"padding-top":"8px","margin-top":"8px","border-top":"1px solid #eee"}},dA=Rt({name:"SignalAndMassage",__name:"SignalAndMessage",setup(e){const t=I0(),n=W([]),i=W([]),r=W(!1),o=W(""),a=W({}),c=W(),l=W(),u=W(),p=$h(()=>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=()=>{console.log(window,"window"),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]&&t.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]&&t.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 Ma(()=>{y()}),(g,b)=>{const S=ll,w=ho,_=sl,C=cl,B=wn,s=Sn,h=oi,m=so,E=Ra;return ne(),De("div",uA,[Ve("div",pA,[Ve("span",null,[R(S,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),me("\u6D88\u606F\u5217\u8868")]),R(w,{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(_,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),R(_,{label:"\u6D88\u606FID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),R(_,{label:"\u6D88\u606F\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),Ve("div",hA,[Ve("span",null,[R(S,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),me("\u4FE1\u53F7\u5217\u8868")]),R(w,{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(_,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),R(_,{label:"\u4FE1\u53F7ID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),R(_,{label:"\u4FE1\u53F7\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),R(E,{modelValue:D(r),"onUpdate:modelValue":b[5]||(b[5]=T=>un(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(()=>[me("\u53D6 \u6D88")]),_:1}),R(m,{type:"primary",onClick:v},{default:V(()=>[me("\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"])])}}}),mA=Nt(dA,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue"]]),pr=()=>window==null?void 0:window.bpmnInstances;function zb(e,t,n){const i=Object.create(null);switch(i.event=e.event,t&&(i.id=e.id),e.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 pr().moddle.create(`${o}:Script`,p)}(e,n);break;case"expressionListener":i.expression=e.expression;break;case"delegateExpressionListener":i.delegateExpression=e.delegateExpression;break;default:i.class=e.class}if(e.fields&&(i.fields=e.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 pr().moddle.create(`${a}:Field`,d)}(r,n))),t&&e.event==="timeout"&&e.eventDefinitionType){const r=pr().moddle.create("bpmn:FormalExpression",{body:e.eventTimeDefinitions}),o=pr().moddle.create("bpmn:TimerEventDefinition",{id:`TimerEventDefinition_${fA(8)}`,[`time${e.eventDefinitionType.replace(/^\S/,a=>a.toUpperCase())}`]:r});i.eventDefinitions=[o]}return pr().moddle.create(`${n}:${t?"TaskListener":"ExecutionListener"}`,i)}function Kc(e,t){const n=pr().moddle.create("bpmn:ExtensionElements",{values:t});pr().modeling.updateProperties(Be(e),{extensionElements:n})}function fA(e=8,t){let n="";const i=t||"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=e;r>0;--r)n+=i[Math.floor(Math.random()*i.length)];return n}function $b(e){let t={...e};if(e.script&&(t={...e,...e.script,scriptType:e.script.resource?"externalScript":"inlineScript"}),e.event==="timeout"&&e.eventDefinitions&&e.eventDefinitions.length){let n="";for(const i in e.eventDefinitions[0])console.log(e.eventDefinitions,i),i.indexOf("time")!==-1&&(n=i,t.eventDefinitionType=i.replace("time","").toLowerCase());console.log(n),t.eventTimeDefinitions=e.eventDefinitions[0][n].body}return t}function Gb(e){let t;return e.class&&(t="classListener"),e.expression&&(t="expressionListener"),e.delegateExpression&&(t="delegateExpressionListener"),e.script&&(t="scriptListener"),{...JSON.parse(JSON.stringify(e)),...e.script??{},listenerType:t}}let kh,Ub,Ph,Hb,qb,Wb,Xb,Kb,Yb,Jb,Zb,Qb,e0,t0,n0,i0,r0,o0,a0,s0;kh={classListener:"Java \u7C7B",expressionListener:"\u8868\u8FBE\u5F0F",delegateExpressionListener:"\u4EE3\u7406\u8868\u8FBE\u5F0F",scriptListener:"\u811A\u672C"},Ub={create:"\u521B\u5EFA",assignment:"\u6307\u6D3E",complete:"\u5B8C\u6210",delete:"\u5220\u9664",update:"\u66F4\u65B0",timeout:"\u8D85\u65F6"},Ph={string:"\u5B57\u7B26\u4E32",expression:"\u8868\u8FBE\u5F0F"},Hb={class:"panel-tab__content"},qb={class:"element-drawer__button"},Wb={class:"listener-filed__title"},Xb={class:"element-drawer__button"},Kb=Rt({name:"ElementListeners",__name:"ElementListeners",props:{id:String,type:String},setup(e){const t=e,n=po("prefix"),i=po("width"),r=W([]),o=W({}),a=W(!1),c=W([]),l=W({}),u=W(!1),p=W(-1),d=W(-1),y=W(kh),f=W(Ph),v=W(),g=W(),b=W(),S=W(),w=W(),_=()=>{var m,E,T;v.value=(window==null?void 0:window.bpmnInstances).bpmnElement,g.value=[],b.value=((T=(E=(m=v.value.businessObject)==null?void 0:m.extensionElements)==null?void 0:E.values)==null?void 0:T.filter(M=>M.$type===`${n}:ExecutionListener`))??[],r.value=b.value.map(M=>Gb(M))},C=(m,E)=>{m?(o.value=$b(m),p.value=E):(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,zt(()=>{S.value&&S.value.clearValidate()})},B=(m,E)=>{l.value=m?JSON.parse(JSON.stringify(m)):{},d.value=m?E:-1,u.value=!0,zt(()=>{w.value&&w.value.clearValidate()})},s=async()=>{await w.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,zt(()=>{l.value={}}))},h=async()=>{var E,T,M;if(!await S.value.validate())return;const m=zb(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=(E=v.value.businessObject)==null?void 0:E.extensionElements)==null?void 0:T.values)==null?void 0:M.filter(N=>N.$type!==`${n}:ExecutionListener`))??[],Kc(v.value,g.value.concat(b.value)),a.value=!1,o.value={}};return mt(()=>t.id,m=>{m&&m.length&&zt(()=>{_()})},{immediate:!0}),(m,E)=>{const T=sl,M=so,N=Uh,$=cl,P=ho,x=co,I=lo,j=Sn,G=wn,X=oi,ee=ll,re=D0,se=Ra;return ne(),De("div",Hb,[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(()=>[me("\u7F16\u8F91")]),_:2},1032,["onClick"]),R(N,{direction:"vertical"}),R(M,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:q=>(xe=>{ao.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{b.value.splice(xe,1),r.value.splice(xe,1),Kc(v.value,g.value.concat(b.value))}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(H.$index)},{default:V(()=>[me("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ve("div",qb,[R(P,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:E[0]||(E[0]=H=>C(null))})]),R(re,{modelValue:D(a),"onUpdate:modelValue":E[12]||(E[12]=H=>un(a)?a.value=H:null),title:"\u6267\u884C\u76D1\u542C\u5668",size:`${D(i)}px`,"append-to-body":"","destroy-on-close":""},{default:V(()=>[R(X,{model:D(o),"label-width":"96px",ref_key:"listenerFormRef",ref:S},{default:V(()=>[R(j,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(I,{modelValue:D(o).event,"onUpdate:modelValue":E[1]||(E[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(I,{modelValue:D(o).listenerType,"onUpdate:modelValue":E[2]||(E[2]=H=>D(o).listenerType=H)},{default:V(()=>[(ne(!0),De(ln,null,uo(Object.keys(D(y)),H=>(ne(),Ce(x,{key:H,label:D(y)[H],value:H},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(o).listenerType==="classListener"?(ne(),Ce(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":E[3]||(E[3]=H=>D(o).class=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(o).listenerType==="expressionListener"?(ne(),Ce(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":E[4]||(E[4]=H=>D(o).expression=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(o).listenerType==="delegateExpressionListener"?(ne(),Ce(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":E[5]||(E[5]=H=>D(o).delegateExpression=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(o).listenerType==="scriptListener"?(ne(),De(ln,{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":E[6]||(E[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(I,{modelValue:D(o).scriptType,"onUpdate:modelValue":E[7]||(E[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"?(ne(),Ce(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":E[8]||(E[8]=H=>D(o).value=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(o).scriptType==="externalScript"?(ne(),Ce(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":E[9]||(E[9]=H=>D(o).resource=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0)],64)):ke("",!0)]),_:1},8,["model"]),R(N),Ve("p",Wb,[Ve("span",null,[R(ee,{icon:"ep:menu"}),me("\u6CE8\u5165\u5B57\u6BB5\uFF1A")]),R(P,{type:"primary",onClick:E[10]||(E[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(()=>[me("\u7F16\u8F91")]),_:2},1032,["onClick"]),R(N,{direction:"vertical"}),R(M,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:q=>(xe=>{ao.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{c.value.splice(xe,1),o.value.fields.splice(xe,1)}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(H.$index)},{default:V(()=>[me("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ve("div",Xb,[R(M,{onClick:E[11]||(E[11]=H=>a.value=!1)},{default:V(()=>[me("\u53D6 \u6D88")]),_:1}),R(M,{type:"primary",onClick:h},{default:V(()=>[me("\u4FDD \u5B58")]),_:1})])]),_:1},8,["modelValue","size"]),R(se,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:D(u),"onUpdate:modelValue":E[18]||(E[18]=H=>un(u)?u.value=H:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(M,{size:"small",onClick:E[17]||(E[17]=H=>u.value=!1)},{default:V(()=>[me("\u53D6 \u6D88")]),_:1}),R(M,{size:"small",type:"primary",onClick:s},{default:V(()=>[me("\u786E \u5B9A")]),_:1})]),default:V(()=>[R(X,{model:D(l),"label-width":"96spx",ref_key:"listenerFieldFormRef",ref:w,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":E[13]||(E[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(I,{modelValue:D(l).fieldType,"onUpdate:modelValue":E[14]||(E[14]=H=>D(l).fieldType=H)},{default:V(()=>[(ne(!0),De(ln,null,uo(Object.keys(D(f)),H=>(ne(),Ce(x,{key:H,label:D(f)[H],value:H},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(l).fieldType==="string"?(ne(),Ce(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":E[15]||(E[15]=H=>D(l).string=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(l).fieldType==="expression"?(ne(),Ce(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":E[16]||(E[16]=H=>D(l).expression=H),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),Yb=Nt(Kb,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/listeners/ElementListeners.vue"]]),Jb={class:"panel-tab__content"},Zb={class:"element-drawer__button"},Qb=Rt({name:"ElementProperties",__name:"ElementProperties",props:{id:String,type:String},setup(e){const t=e,n=po("prefix"),i=W([]),r=W({}),o=W(-1),a=W(!1),c=W(),l=W(),u=W(),p=W(),d=W(),y=()=>window==null?void 0:window.bpmnInstances,f=()=>{var S,w;console.log(window,"windowwindowwindowwindowwindowwindowwindow"),c.value=y().bpmnElement,l.value=[],u.value=((w=(S=c.value.businessObject)==null?void 0:S.extensionElements)==null?void 0:w.values.filter(_=>(_.$type!==`${n}:Properties`&&l.value.push(_),_.$type===`${n}:Properties`)))??[],p.value=u.value.reduce((_,C)=>_.concat(C.values),[]),i.value=JSON.parse(JSON.stringify(p.value??[]))},v=(S,w)=>{o.value=w,r.value=w===-1?{}:JSON.parse(JSON.stringify(S)),a.value=!0,zt(()=>{d.value&&d.value.clearValidate()})},g=()=>{console.log(r.value,"propertyForm.value");const{name:S,value:w}=r.value;if(o.value!==-1)y().modeling.updateModdleProperties(Be(c.value),Be(p.value)[Be(o.value)],{name:S,value:w});else{const _=y().moddle.create(`${n}:Property`,{name:S,value:w}),C=y().moddle.create(`${n}:Properties`,{values:p.value.concat([_])});b(C)}a.value=!1,f()},b=S=>{const w=y().moddle.create("bpmn:ExtensionElements",{values:l.value.concat([S])});y().modeling.updateProperties(Be(c.value),{extensionElements:w})};return mt(()=>t.id,S=>{S&&S&&S.length&&f()},{immediate:!0}),(S,w)=>{const _=sl,C=so,B=Uh,s=cl,h=ho,m=wn,E=Sn,T=oi,M=Ra;return ne(),De("div",Jb,[R(s,{data:D(i),"max-height":"240",fit:"",border:""},{default:V(()=>[R(_,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(_,{label:"\u5C5E\u6027\u540D",prop:"name","min-width":"100px","show-overflow-tooltip":""}),R(_,{label:"\u5C5E\u6027\u503C",prop:"value","min-width":"100px","show-overflow-tooltip":""}),R(_,{label:"\u64CD\u4F5C",width:"110px"},{default:V(N=>[R(C,{link:"",onClick:$=>v(N.row,N.$index),size:"small"},{default:V(()=>[me(" \u7F16\u8F91 ")]),_:2},1032,["onClick"]),R(B,{direction:"vertical"}),R(C,{link:"",size:"small",style:{color:"#ff4d4f"},onClick:$=>((P,x)=>{console.log(P,"attr"),ao.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 I=y().moddle.create(`${n}:Properties`,{values:p.value});b(I),f()}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(N.row,N.$index)},{default:V(()=>[me(" \u79FB\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ve("div",Zb,[R(h,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u5C5E\u6027",onClick:w[0]||(w[0]=N=>v(null,-1))})]),R(M,{modelValue:D(a),"onUpdate:modelValue":w[4]||(w[4]=N=>un(a)?a.value=N:null),title:"\u5C5E\u6027\u914D\u7F6E",width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(C,{onClick:w[3]||(w[3]=N=>a.value=!1)},{default:V(()=>[me("\u53D6 \u6D88")]),_:1}),R(C,{type:"primary",onClick:g},{default:V(()=>[me("\u786E \u5B9A")]),_:1})]),default:V(()=>[R(T,{model:D(r),"label-width":"80px",ref_key:"attributeFormRef",ref:d},{default:V(()=>[R(E,{label:"\u5C5E\u6027\u540D\uFF1A",prop:"name"},{default:V(()=>[R(m,{modelValue:D(r).name,"onUpdate:modelValue":w[1]||(w[1]=N=>D(r).name=N),clearable:""},null,8,["modelValue"])]),_:1}),R(E,{label:"\u5C5E\u6027\u503C\uFF1A",prop:"value"},{default:V(()=>[R(m,{modelValue:D(r).value,"onUpdate:modelValue":w[2]||(w[2]=N=>D(r).value=N),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),e0=Nt(Qb,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue"]]),t0={class:"panel-tab__content"},n0={class:"element-drawer__button"},i0={class:"listener-filed__title"},r0={class:"element-drawer__button"},o0=Rt({name:"UserTaskListeners",__name:"UserTaskListeners",props:{id:String,type:String},setup(e){const t=e,n=po("prefix"),i=po("width"),r=W([]),o=W(Ub),a=W(kh),c=W(!1),l=W({}),u=W(Ph),p=W([]),d=W(!1),y=W(-1),f=W(-1),v=W({}),g=W(),b=W(),S=W(),w=W(),_=W(),C=()=>window==null?void 0:window.bpmnInstances,B=(E,T)=>{E?(l.value=$b(E),y.value=T):(l.value={},y.value=-1),E&&E.fields?p.value=E.fields.map(M=>({...M,fieldType:M.string?"string":"expression"})):(p.value=[],l.value.fields=[]),c.value=!0,zt(()=>{w.value&&w.value.clearValidate()})},s=async()=>{var T,M,N;if(!await w.value.validate())return;const E=zb(l.value,!0,n);y.value===-1?(b.value.push(E),r.value.push(l.value)):(b.value.splice(y.value,1,E),r.value.splice(y.value,1,l.value)),S.value=((N=(M=(T=g.value.businessObject)==null?void 0:T.extensionElements)==null?void 0:M.values)==null?void 0:N.filter($=>$.$type!==`${n}:TaskListener`))??[],Kc(g.value,S.value.concat(b.value)),c.value=!1,l.value={}},h=(E,T)=>{v.value=E?JSON.parse(JSON.stringify(E)):{},f.value=E?T:-1,d.value=!0,zt(()=>{_.value&&_.value.clearValidate()})},m=async()=>{await _.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,zt(()=>{v.value={}}))};return mt(()=>t.id,E=>{E&&E.length&&zt(()=>{var T,M;console.log(C().bpmnElement,"window.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElement"),g.value=C().bpmnElement,S.value=[],b.value=((M=(T=g.value.businessObject)==null?void 0:T.extensionElements)==null?void 0:M.values.filter(N=>N.$type===`${n}:TaskListener`))??[],r.value=b.value.map(N=>Gb(N))})},{immediate:!0}),(E,T)=>{const M=sl,N=so,$=Uh,P=cl,x=ho,I=co,j=lo,G=Sn,X=wn,ee=oi,re=ll,se=D0,H=Ra;return ne(),De("div",t0,[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(N,{size:"small",link:"",onClick:xe=>B(q.row,q.$index)},{default:V(()=>[me("\u7F16\u8F91")]),_:2},1032,["onClick"]),R($,{direction:"vertical"}),R(N,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:xe=>((ze,ct)=>{console.log(ze,"listener"),ao.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{b.value.splice(ct,1),r.value.splice(ct,1),Kc(g.value,S.value.concat(b.value))}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(q.row,q.$index)},{default:V(()=>[me("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ve("div",n0,[R(x,{size:"small",type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:T[0]||(T[0]=q=>B(null))})]),R(se,{modelValue:D(c),"onUpdate:modelValue":T[15]||(T[15]=q=>un(c)?c.value=q:null),title:"\u4EFB\u52A1\u76D1\u542C\u5668",size:`${D(i)}px`,"append-to-body":"","destroy-on-close":""},{default:V(()=>[R(ee,{size:"small",model:D(l),"label-width":"96px",ref_key:"listenerFormRef",ref:w},{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(()=>[(ne(!0),De(ln,null,uo(Object.keys(D(o)),q=>(ne(),Ce(I,{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(X,{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(()=>[(ne(!0),De(ln,null,uo(Object.keys(D(a)),q=>(ne(),Ce(I,{key:q,label:D(a)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(l).listenerType==="classListener"?(ne(),Ce(G,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(l).class,"onUpdate:modelValue":T[4]||(T[4]=q=>D(l).class=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(l).listenerType==="expressionListener"?(ne(),Ce(G,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(l).expression,"onUpdate:modelValue":T[5]||(T[5]=q=>D(l).expression=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(l).listenerType==="delegateExpressionListener"?(ne(),Ce(G,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(l).delegateExpression,"onUpdate:modelValue":T[6]||(T[6]=q=>D(l).delegateExpression=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(l).listenerType==="scriptListener"?(ne(),De(ln,{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(X,{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(I,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(I,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(l).scriptType==="inlineScript"?(ne(),Ce(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(X,{modelValue:D(l).value,"onUpdate:modelValue":T[9]||(T[9]=q=>D(l).value=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(l).scriptType==="externalScript"?(ne(),Ce(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(X,{modelValue:D(l).resource,"onUpdate:modelValue":T[10]||(T[10]=q=>D(l).resource=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0)],64)):ke("",!0),D(l).event==="timeout"?(ne(),De(ln,{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(I,{label:"\u65E5\u671F",value:"date"}),R(I,{label:"\u6301\u7EED\u65F6\u957F",value:"duration"}),R(I,{label:"\u5FAA\u73AF",value:"cycle"}),R(I,{label:"\u65E0",value:"null"})]),_:1},8,["modelValue"])]),_:1}),D(l).eventDefinitionType&&D(l).eventDefinitionType!=="null"?(ne(),Ce(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(X,{modelValue:D(l).eventTimeDefinitions,"onUpdate:modelValue":T[12]||(T[12]=q=>D(l).eventTimeDefinitions=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0)],64)):ke("",!0)]),_:1},8,["model"]),R($),Ve("p",i0,[Ve("span",null,[R(re,{icon:"ep:menu"}),me("\u6CE8\u5165\u5B57\u6BB5\uFF1A")]),R(N,{size:"small",type:"primary",onClick:T[13]||(T[13]=q=>h(null))},{default:V(()=>[me("\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(N,{size:"small",link:"",onClick:xe=>h(q.row,q.$index)},{default:V(()=>[me("\u7F16\u8F91")]),_:2},1032,["onClick"]),R($,{direction:"vertical"}),R(N,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:xe=>((ze,ct)=>{console.log(ze,"field"),ao.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{p.value.splice(ct,1),l.value.fields.splice(ct,1)}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(q.row,q.$index)},{default:V(()=>[me("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ve("div",r0,[R(N,{size:"small",onClick:T[14]||(T[14]=q=>c.value=!1)},{default:V(()=>[me("\u53D6 \u6D88")]),_:1}),R(N,{size:"small",type:"primary",onClick:s},{default:V(()=>[me("\u4FDD \u5B58")]),_:1})])]),_:1},8,["modelValue","size"]),R(H,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:D(d),"onUpdate:modelValue":T[21]||(T[21]=q=>un(d)?d.value=q:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(N,{size:"small",onClick:T[20]||(T[20]=q=>d.value=!1)},{default:V(()=>[me("\u53D6 \u6D88")]),_:1}),R(N,{size:"small",type:"primary",onClick:m},{default:V(()=>[me("\u786E \u5B9A")]),_:1})]),default:V(()=>[R(ee,{model:D(v),size:"small","label-width":"96px",ref_key:"listenerFieldFormRef",ref:_,style:{height:"136px"}},{default:V(()=>[R(G,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{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(()=>[(ne(!0),De(ln,null,uo(Object.keys(D(u)),q=>(ne(),Ce(I,{key:q,label:D(u)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(v).fieldType==="string"?(ne(),Ce(G,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(v).string,"onUpdate:modelValue":T[18]||(T[18]=q=>D(v).string=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0),D(v).fieldType==="expression"?(ne(),Ce(G,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(v).expression,"onUpdate:modelValue":T[19]||(T[19]=q=>D(v).expression=q),clearable:""},null,8,["modelValue"])]),_:1})):ke("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),a0=Nt(o0,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/listeners/UserTaskListeners.vue"]]),s0=Rt({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(e){const t=e,n=W("base"),i=W(""),r=W(""),o=W({}),a=W(!1),c=W(!1),l=W();ol("prefix",t.prefix),ol("width",t.width);const u=()=>window==null?void 0:window.bpmnInstances,p=mt(()=>t.bpmnModeler,()=>{if(!t.bpmnModeler)return void console.log("\u7F3A\u5C11props.bpmnModeler");console.log("props.bpmnModeler \u6709\u503C\u4E86\uFF01\uFF01\uFF01"),window.bpmnInstances={modeler:t.bpmnModeler,modeling:t.bpmnModeler.get("modeling"),moddle:t.bpmnModeler.get("moddle"),eventBus:t.bpmnModeler.get("eventBus"),bpmnFactory:t.bpmnModeler.get("bpmnFactory"),elementFactory:t.bpmnModeler.get("elementFactory"),elementRegistry:t.bpmnModeler.get("elementRegistry"),replace:t.bpmnModeler.get("replace"),selection:t.bpmnModeler.get("selection")},console.log(u(),"window.bpmnInstances"),d(),p()},{immediate:!0}),d=()=>{y(null),t.bpmnModeler.on("import.done",f=>{console.log(f,"eeeee"),y(null)}),t.bpmnModeler.on("selection.changed",({newSelection:f})=>{y(f[0]||null)}),t.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&&(console.log(` ---------- select element changed: id: ${v.id} type: ${v.businessObject.$type} ---------- `),console.log("businessObject: ",v.businessObject),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 jn(()=>{window.bpmnInstances=null,console.log(t,"props1"),console.log(t.bpmnModeler,"props.bpmnModeler1")}),mt(()=>i.value,()=>{n.value="base"}),(f,v)=>{const g=ll,b=qA,S=Hh,w=R0("router-link"),_=WA;return ne(),De("div",{class:"process-panel__container",style:FA({width:`${e.width}px`})},[R(_,{modelValue:D(n),"onUpdate:modelValue":v[0]||(v[0]=C=>un(n)?n.value=C:null)},{default:V(()=>[R(b,{name:"base"},{title:V(()=>[R(g,{icon:"ep:info-filled"}),me(" \u5E38\u89C4")]),default:V(()=>[R(jT,{"id-edit-disabled":e.idEditDisabled,"business-object":D(o),type:D(r),model:e.model},null,8,["id-edit-disabled","business-object","type","model"])]),_:1}),D(r)==="Process"?(ne(),Ce(b,{name:"condition",key:"message"},{title:V(()=>[R(g,{icon:"ep:comment"}),me("\u6D88\u606F\u4E0E\u4FE1\u53F7")]),default:V(()=>[R(mA)]),_:1})):ke("",!0),D(a)?(ne(),Ce(b,{name:"condition",key:"condition"},{title:V(()=>[R(g,{icon:"ep:promotion"}),me("\u6D41\u8F6C\u6761\u4EF6")]),default:V(()=>[R(lA,{"business-object":D(o),type:D(r)},null,8,["business-object","type"])]),_:1})):ke("",!0),D(c)?(ne(),Ce(b,{name:"condition",key:"form"},{title:V(()=>[R(g,{icon:"ep:list"}),me("\u8868\u5355")]),default:V(()=>[me(" \u53CB\u60C5\u63D0\u793A\uFF1A\u4F7F\u7528 "),R(w,{to:{path:"/bpm/manager/form"}},{default:V(()=>[R(S,{type:"danger"},{default:V(()=>[me("\u6D41\u7A0B\u8868\u5355")]),_:1})]),_:1}),me(" \u66FF\u4EE3\uFF0C\u63D0\u4F9B\u66F4\u597D\u7684\u8868\u5355\u8BBE\u8BA1\u529F\u80FD ")]),_:1})):ke("",!0),D(r).indexOf("Task")!==-1?(ne(),Ce(b,{name:"task",key:"task"},{title:V(()=>[R(g,{icon:"ep:checked"}),me("\u4EFB\u52A1")]),default:V(()=>[R(iA,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1})):ke("",!0),D(r).indexOf("Task")!==-1?(ne(),Ce(b,{name:"multiInstance",key:"multiInstance"},{title:V(()=>[R(g,{icon:"ep:help-filled"}),me("\u591A\u5B9E\u4F8B")]),default:V(()=>[R(aA,{"business-object":D(o),type:D(r)},null,8,["business-object","type"])]),_:1})):ke("",!0),R(b,{name:"listeners",key:"listeners"},{title:V(()=>[R(g,{icon:"ep:bell-filled"}),me("\u6267\u884C\u76D1\u542C\u5668")]),default:V(()=>[R(Yb,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1}),D(r)==="UserTask"?(ne(),Ce(b,{name:"taskListeners",key:"taskListeners"},{title:V(()=>[R(g,{icon:"ep:bell-filled"}),me("\u4EFB\u52A1\u76D1\u542C\u5668")]),default:V(()=>[R(a0,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1})):ke("",!0),R(b,{name:"extensions",key:"extensions"},{title:V(()=>[R(g,{icon:"ep:circle-plus-filled"}),me("\u6269\u5C55\u5C5E\u6027")]),default:V(()=>[R(e0,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1}),R(b,{name:"other",key:"other"},{title:V(()=>[R(g,{icon:"ep:promotion"}),me("\u5176\u4ED6")]),default:V(()=>[R(UT,{id:D(i)},null,8,["id"])]),_:1})]),_:1},8,["modelValue"])],4)}}}),Da=Nt(s0,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue"]]),Da.install=function(e){e.component(Da.name,Da)};let c0,l0,u0;c0={class:"my-process-designer"},l0={class:"my-process-designer__container"},u0=Rt({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(e,{emit:t}){const n=e;ol("configGlobal",n);const i=t;let r;const o=W(""),a=W([]),c=W(void 0),l=W([]),u=W(),p=W(null),d=W(null),y=async _=>{let C=`Process_${new Date().getTime()}`,B=`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,s=_||Fg(C,B,n.prefix);try{let{warnings:h}=await r.importXML(s);h&&h.length&&h.forEach(m=>console.warn(m)),await f(),r.get("canvas").zoom("fit-viewport","auto")}catch(h){console.error(h)}},f=async()=>{var E;const _=a.value;if(_.length===0)return;let C=r.get("canvas"),B=_.find(T=>!T.endTime),s=_[_.length-1],h=!1,m=[];(E=r.getDefinitions().rootElements[0].flowElements)==null||E.forEach(T=>{var N,$,P;let M=_.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 I=b(M);I==null||I.forEach(j=>{let G=_.find(X=>X.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,I;C.addMarker(T.id,v(M)),(N=T.outgoing)==null||N.forEach(j=>{let G=_.find(X=>X.key===j.targetRef.id);G&&(I&&I.type!=="endEvent"||(x=j,I=G))}),x&&I&&C.addMarker(x.id,v(I))}else if(T.$type==="bpmn:ParallelGateway")C.addMarker(T.id,v(M)),($=T.outgoing)==null||$.forEach(x=>{const I=_.find(j=>j.key===x.targetRef.id);I&&(C.addMarker(x.id,v(I)),C.addMarker(x.targetRef.id,v(I)))});else if(T.$type==="bpmn:StartEvent")(P=T.outgoing)==null||P.forEach(x=>{_.find(I=>I.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(I=>{C.addMarker(I.id,g(2))})}}}),zA(m)||(l.value=l.value.filter(T=>!m.includes(T.definitionKey)))},v=_=>_.endTime?"highlight":"highlight-todo",g=_=>_===1?"highlight-todo":_===2?"highlight":_===3?"highlight-reject":_===4?"highlight-cancel":_===5||_===6||_===7||_===8||_===9?"highlight-return":"",b=_=>{if(_.outgoing&&_.outgoing.length>0)return _.outgoing;const C=r.getDefinitions().rootElements[0].flowElements,B=[];return C.forEach(s=>{s.$type==="bpmn:SequenceFlow"&&s.sourceRef.id===_.key&&B.push(s)}),B},S=_=>{var B;_.value=_,!p.value&&(p.value={}),!d.value&&(d.value=r.get("overlays")),console.log(a.value,"activityLists.value"),console.log(_.value,"element.value");const C=a.value.find(s=>s.key===_.value.id);if(console.log(C,"activityactivityactivityactivity"),C&&!p.value[_.value.id]&&_.value.type!=="bpmn:Process"){let s=`

Elemet id: ${_.value.id}

Elemet type: ${_.value.type}

`;if(_.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${mo(c.value.createTime)}`;else if(_.value.type==="bpmn:UserTask"){let h=l.value.find(T=>T.id===C.taskId);if(!h)return;let m=B0(O0.BPM_PROCESS_INSTANCE_RESULT),E="";m.forEach(T=>{T.value==h.result&&(E=T.label)}),s=`

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

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

\u7ED3\u679C\uFF1A${E}

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

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

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

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

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

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

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

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

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

`),console.log(s);else if(_.value.type==="bpmn:EndEvent"&&c.value){let h=B0(O0.BPM_PROCESS_INSTANCE_RESULT),m="";h.forEach(E=>{E.value==c.value.result&&(m=E.label)}),s=`

\u7ED3\u679C\uFF1A${m}

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

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

`)}console.log(s,"html111111111111111"),p.value[_.value.id]=(B=Be(d.value))==null?void 0:B.add(_.value,{position:{left:0,bottom:0},html:`
${s}
`})}},w=_=>{Be(d.value).remove({element:_}),p.value[_.id]=null};return Ma(()=>{o.value=n.value,a.value=n.activityData,r||(r=new qn({container:u.value,bpmnRenderer:{}})),y(o.value),(()=>{const _=r.get("eventBus");_.on("element.hover",function(C){let B=C?C.element:null;S(B)}),_.on("element.out",function(C){let B=C?C.element:null;w(B)})})()}),jn(()=>{r&&r.destroy(),i("destroy",r),r=null}),mt(()=>n.value,_=>{o.value=_,y(o.value)}),mt(()=>n.activityData,_=>{a.value=_,y(o.value)}),mt(()=>n.processInstanceData,_=>{c.value=_,y(o.value)}),mt(()=>n.taskData,_=>{l.value=_,y(o.value)}),(_,C)=>(ne(),De("div",c0,[Ve("div",l0,[Ve("div",{class:"my-process-designer__canvas",style:{height:"760px"},ref_key:"bpmnCanvas",ref:u},null,512)])]))}}),Ba=Nt(u0,[["__file","D:/zhongxing/mall-newfeifan-zx-admin/src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue"]]),Ba.install=function(e){e.component(Ba.name,Ba)}});export{Na as M,Ia as P,ek as __tla,A as a,L0 as b,It as c,qh as d,Me as e,Wh as f,ai as g,Da as h,we as i,Ba as j};