工业互联网平台脚手架前端代码
houzhongjian
2024-09-18 23db5e5c6bfcbd7030a4003cd4ea18fbb920024f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import{_ as jl}from"./Dialog.vue_vue_type_style_index_0_lang-DFckl8Er.js";import{e as Nh,a$ as Ih,cW as hx,cu as Dh,cx as Bh,bO as mx,bP as fx,bX as vx,r as G,bx as Oh,w as nt,a_ as ko,f as Ll,ad as Ot,d as Ze,o as X,c as Ae,j as Qa,n as Ar,a as P,_ as jh,b0 as Hn,dc as yx,C as De,O as ve,D as Vl,k as M,B as j,d4 as gx,b1 as bx,a2 as xx,aW as Ex,P as Xi,ae as es,dd as wx,q as _x,s as Sx,de as kr,df as Lh,dg as Cx,dh as Tx,b as Pr,by as An,a1 as Ax,F as st,g as ue,h as we,I as Mt,di as kx,b9 as Mr,bs as Px,dj as Mx,V as kn,aF as Rt,i as Xt,ci as Be,$ as hi,R as mi,S as Yt,W as dn,A as Fl,a7 as hn,X as Rr,Y as Nr,Z as Vh,a3 as $l,N as Po,Q as Fh,bV as Mo,l as Rx,bo as Nx,aP as Ix,an as $h,U as ts,aU as zl,aB as Dx,aH as Bx}from"./index-BP6bNRoi.js";import{_ as Ox}from"./XTextButton-B6L8upsJ.js";import{_ as Ir}from"./XButton-BfzTlH8o.js";import{a as jx}from"./index-CeFKtjBg.js";import{E as Lx}from"./el-tree-select-pYALMRc9.js";import{h as Vx,d as Fx}from"./tree-BBZY150N.js";import{g as $x}from"./index-NsInNyZ_.js";import{g as zx}from"./index-BdNokKwC.js";import{g as Gx}from"./index-DkNlrmPs.js";import{g as Ux}from"./index-vFgEqmZu.js";import{g as Hx}from"./index-Y1ylnZaQ.js";import{_ as zh}from"./ContentWrap.vue_vue_type_script_setup_true_lang-CR_2gECF.js";import{_ as Gh}from"./index.vue_vue_type_script_setup_true_lang-sJUY8qtC.js";import{C as Uh}from"./constants-CuOBQ73z.js";import{P as qx}from"./index-ox_WxZBR.js";import{E as Hh}from"./el-drawer-CuGR_O5R.js";import{_ as Wx}from"./DictTag.vue_vue_type_script_lang-DwXPHgid.js";import{P as Kx}from"./index-BRcqC2Y4.js";import{f as Dr}from"./formatTime-DwR9f7DP.js";const qh=e=>mx(e)||fx(e)||vx(e),Xx=Nh({accordion:Boolean,modelValue:{type:Ih([Array,String,Number]),default:()=>hx([])}}),Yx={[Dh]:qh,[Bh]:qh},Wh=Symbol("collapseContextKey"),Jx=Ze({name:"ElCollapse"}),Zx=Ze({...Jx,props:Xx,emits:Yx,setup(e,{expose:t,emit:n}){const i=e,{activeNames:r,setActiveNames:o}=((c,l)=>{const u=G(Oh(c.modelValue)),p=h=>{u.value=h;const v=c.accordion?u.value[0]:u.value;l(Dh,v),l(Bh,v)};return nt(()=>c.modelValue,()=>u.value=Oh(c.modelValue),{deep:!0}),ko(Wh,{activeNames:u,handleItemClick:h=>{if(c.accordion)p([u.value[0]===h?"":h]);else{const v=[...u.value],f=v.indexOf(h);f>-1?v.splice(f,1):v.push(h),p(v)}}}),{activeNames:u,setActiveNames:p}})(i,n),{rootKls:a}=(()=>{const c=Ll("collapse");return{rootKls:Ot(()=>c.b())}})();return t({activeNames:r,setActiveNames:o}),(c,l)=>(X(),Ae("div",{class:Ar(P(a))},[Qa(c.$slots,"default")],2))}});var Qx=jh(Zx,[["__file","collapse.vue"]]);const eE=Nh({title:{type:String,default:""},name:{type:Ih([String,Number]),default:void 0},disabled:Boolean}),tE=["id","aria-expanded","aria-controls","aria-describedby","tabindex"],nE=["id","aria-hidden","aria-labelledby"],iE=Ze({name:"ElCollapseItem"}),rE=Ze({...iE,props:eE,setup(e,{expose:t}){const n=e,{focusing:i,id:r,isActive:o,handleFocus:a,handleHeaderClick:c,handleEnterClick:l}=(x=>{const E=Hn(Wh),{namespace:_}=Ll("collapse"),w=G(!1),S=G(!1),D=yx(),s=Ot(()=>D.current++),d=Ot(()=>{var C;return(C=x.name)!=null?C:`${_.value}-id-${D.prefix}-${P(s)}`}),m=Ot(()=>E==null?void 0:E.activeNames.value.includes(P(d)));return{focusing:w,id:s,isActive:m,handleFocus:()=>{setTimeout(()=>{S.value?S.value=!1:w.value=!0},50)},handleHeaderClick:()=>{x.disabled||(E==null||E.handleItemClick(P(d)),w.value=!1,S.value=!0)},handleEnterClick:()=>{E==null||E.handleItemClick(P(d))}}})(n),{arrowKls:u,headKls:p,rootKls:h,itemWrapperKls:v,itemContentKls:f,scopedContentId:y,scopedHeadId:g}=((x,{focusing:E,isActive:_,id:w})=>{const S=Ll("collapse"),D=Ot(()=>[S.b("item"),S.is("active",P(_)),S.is("disabled",x.disabled)]),s=Ot(()=>[S.be("item","header"),S.is("active",P(_)),{focusing:P(E)&&!x.disabled}]);return{arrowKls:Ot(()=>[S.be("item","arrow"),S.is("active",P(_))]),headKls:s,rootKls:D,itemWrapperKls:Ot(()=>S.be("item","wrap")),itemContentKls:Ot(()=>S.be("item","content")),scopedContentId:Ot(()=>S.b(`content-${P(w)}`)),scopedHeadId:Ot(()=>S.b(`head-${P(w)}`))}})(n,{focusing:i,isActive:o,id:r});return t({isActive:o}),(x,E)=>(X(),Ae("div",{class:Ar(P(h))},[De("button",{id:P(g),class:Ar(P(p)),"aria-expanded":P(o),"aria-controls":P(y),"aria-describedby":P(y),tabindex:x.disabled?-1:0,type:"button",onClick:E[0]||(E[0]=(..._)=>P(c)&&P(c)(..._)),onKeydown:E[1]||(E[1]=xx(Ex((..._)=>P(l)&&P(l)(..._),["stop","prevent"]),["space","enter"])),onFocus:E[2]||(E[2]=(..._)=>P(a)&&P(a)(..._)),onBlur:E[3]||(E[3]=_=>i.value=!1)},[Qa(x.$slots,"title",{},()=>[ve(Vl(x.title),1)]),M(P(bx),{class:Ar(P(u))},{default:j(()=>[M(P(gx))]),_:1},8,["class"])],42,tE),M(P(wx),null,{default:j(()=>[Xi(De("div",{id:P(y),role:"region",class:Ar(P(v)),"aria-hidden":!P(o),"aria-labelledby":P(g)},[De("div",{class:Ar(P(f))},[Qa(x.$slots,"default")],2)],10,nE),[[es,P(o)]])]),_:3})],2))}});var Kh=jh(rE,[["__file","collapse-item.vue"]]);const oE=_x(Qx,{CollapseItem:Kh}),aE=Sx(Kh);var Gl={exports:{}};typeof Object.create=="function"?Gl.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Gl.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 ae=kr(Gl.exports);var Xh,Ul,sE=(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.floor(r);o++)c=Math.floor(Math.random()*i).toString(i)+c;if(a){var l=Math.pow(i,a);c=Math.floor(Math.random()*l).toString(i)+c}var u=parseInt(c,i);return u!==1/0&&u>=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(Ul={exports:{}},Ul.exports),Ul.exports);function Pn(e){if(!(this instanceof Pn))return new Pn(e);e=e||[128,36,1],this._seed=e.length?sE.rack(e[0],e[1],e[2]):e}function ns(e){return Array.prototype.concat.apply([],e)}Pn.prototype.next=function(e){return this._seed(e||!0)},Pn.prototype.nextPrefixed=function(e,t){var n;do n=e+this.next(!0);while(this.assigned(n));return this.claim(n,t),n},Pn.prototype.claim=function(e,t){this._seed.set(e,t||!0)},Pn.prototype.assigned=function(e){return this._seed.get(e)||!1},Pn.prototype.unclaim=function(e){delete this._seed.hats[e]},Pn.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var Ro=Object.prototype.toString,cE=Object.prototype.hasOwnProperty;function No(e){return e===void 0}function Mn(e){return e!==void 0}function Yh(e){return e==null}function Se(e){return Ro.call(e)==="[object Array]"}function Tt(e){return Ro.call(e)==="[object Object]"}function fe(e){return Ro.call(e)==="[object Number]"}function At(e){var t=Ro.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Br(e){return Ro.call(e)==="[object String]"}function fi(e,t){return cE.call(e,t)}function je(e,t){var n;return t=Wl(t),F(e,function(i,r){if(t(i,r))return n=i,!1}),n}function Ee(e,t){var n=[];return F(e,function(i,r){t(i,r)&&n.push(i)}),n}function F(e,t){var n;if(!No(e)){var i=Se(e)?dE:pE;for(var r in e)if(fi(e,r)&&t(n=e[r],i(r))===!1)return n}}function lE(e,t){return No(e)?[]:(function(n){if(!Se(n))throw new Error("must supply array")}(e),t=Wl(t),e.filter(function(n,i){return!t(n,i)}))}function Gt(e,t,n){return F(e,function(i,r){n=t(n,i,r)}),n}function Or(e,t){return!!Gt(e,function(n,i,r){return n&&t(i,r)},!0)}function Yi(e,t){return!!je(e,t)}function ht(e,t){var n=[];return F(e,function(i,r){n.push(t(i,r))}),n}function is(e){return e&&Object.keys(e)||[]}function Io(e){return is(e).length}function Hl(e){return ht(e,function(t){return t})}function jr(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=ql(t),F(e,function(i){var r=t(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function Jh(e){e=ql(e);for(var t={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return F(i,function(o){return jr(o,e,t)}),ht(t,function(o,a){return o[0]})}var uE=Jh;function mn(e,t){t=ql(t);var n=[];return F(e,function(i,r){for(var o=t(i,r),a={d:o,v:i},c=0;c<n.length;c++)if(o<n[c].d)return void n.splice(c,0,a);n.push(a)}),ht(n,function(i){return i.v})}function fn(e){return function(t){return Or(e,function(n,i){return t[i]===n})}}function ql(e){return At(e)?e:function(t){return t[e]}}function Wl(e){return At(e)?e:function(t){return t===e}}function pE(e){return e}function dE(e){return Number(e)}function Zh(e,t){var n,i,r,o;function a(p){var h=Date.now(),v=p?0:o+t-h;if(v>0)return c(v);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,h=new Array(p),v=0;v<p;v++)h[v]=arguments[v];i=h,r=this,n||c(t)}return u.flush=function(){n&&a(!0),l()},u.cancel=l,u}function qn(e,t){return e.bind(t)}function Kl(){return Kl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Kl.apply(this,arguments)}function z(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Kl.apply(void 0,[e].concat(n))}function Rn(e,t){var n={},i=Object(e);return F(t,function(r){r in i&&(n[r]=e[r])}),n}function vi(e,t){var n={};return F(Object(e),function(i,r){t.indexOf(r)===-1&&(n[r]=i)}),n}function Ut(e,t,n){return arguments.length==2?e.getAttribute(t):n===null?e.removeAttribute(t):(e.setAttribute(t,n),e)}var hE=[].indexOf,Xl=function(e,t){if(hE)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},mE=/\s+/,fE=Object.prototype.toString;function ct(e){return new yi(e)}function yi(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function rs(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}yi.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~Xl(t,e)||t.push(e),this.el.className=t.join(" "),this},yi.prototype.remove=function(e){if(fE.call(e)=="[object RegExp]")return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=Xl(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},yi.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},yi.prototype.toggle=function(e,t){return this.list?(t!==void 0?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(t!==void 0?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},yi.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(mE);return e[0]===""&&e.shift(),e},yi.prototype.has=yi.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Xl(this.array(),e)};var Lr=typeof Element<"u"?Element.prototype:{},Qh=Lr.matches||Lr.matchesSelector||Lr.webkitMatchesSelector||Lr.mozMatchesSelector||Lr.msMatchesSelector||Lr.oMatchesSelector,os=function(e,t){if(!e||e.nodeType!==1)return!1;if(Qh)return Qh.call(e,t);for(var n=e.parentNode.querySelectorAll(t),i=0;i<n.length;i++)if(n[i]==e)return!0;return!1};function Ji(e,t,n){for(var i=n?e:e.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(os(i,t))return i;i=i.parentNode}return os(i,t)?i:null}var em=window.addEventListener?"addEventListener":"attachEvent",vE=window.removeEventListener?"removeEventListener":"detachEvent",tm=em!=="addEventListener"?"on":"",le={bind:function(e,t,n,i){return e[em](tm+t,n,i||!1),n},unbind:function(e,t,n,i){return e[vE](tm+t,n,i||!1),n}},nm=["focus","blur"],Yl,Ht={bind:function(e,t,n,i,r){return nm.indexOf(n)!==-1&&(r=!0),le.bind(e,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Ji(a,t,!0),o.delegateTarget&&i.call(e,o)},r)},unbind:function(e,t,n,i){return nm.indexOf(t)!==-1&&(i=!0),le.unbind(e,t,n,i)}},ze=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=lt[i]||lt._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},im=!1;typeof document<"u"&&((Yl=document.createElement("div")).innerHTML='  <link/><table></table><a href="/a">a</a><input type="checkbox"/>',im=!Yl.getElementsByTagName("link").length,Yl=void 0);var lt={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:im?[1,"X<div>","</div>"]:[0,"",""]};function Ye(e,t){return(t=t||document).querySelector(e)}function Jl(e,t){return(t=t||document).querySelectorAll(e)}function Nn(e){e.parentNode&&e.parentNode.removeChild(e)}function pe(e,t){return function(n,i){i.appendChild(function(r,o){if(r.ownerDocument!==o.ownerDocument)try{return o.ownerDocument.importNode(r,!0)}catch{}return r}(n,i))}(t,e),e}lt.td=lt.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],lt.option=lt.optgroup=[1,'<select multiple="multiple">',"</select>"],lt.thead=lt.tbody=lt.colgroup=lt.caption=lt.tfoot=[1,"<table>","</table>"],lt.polyline=lt.ellipse=lt.polygon=lt.circle=lt.text=lt.line=lt.path=lt.rect=lt.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Zl=2,rm={"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":Zl,"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":Zl,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function om(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=rm[i];r?(r===Zl&&typeof n=="number"&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function W(e,t,n){if(typeof t=="string"){if(n===void 0)return function(i,r){return rm[r]?i.style[r]:i.getAttributeNS(null,r)}(e,t);om(e,t,n)}else(function(i,r){var o,a,c=Object.keys(r);for(o=0;a=c[o];o++)om(i,a,r[a])})(e,t);return e}function Ql(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var yE=/\s+/,gE=Object.prototype.toString;function eu(e){return e!==void 0}function Ce(e){return new gi(e)}function gi(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function it(e){var t=e.parentNode;return t&&t.removeChild(e),e}function am(e){for(var t;t=e.firstChild;)it(t);return e}function sm(e){return e.cloneNode(!0)}gi.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~Ql(t,e)||t.push(e),eu(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},gi.prototype.remove=function(e){if(gE.call(e)==="[object RegExp]")return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=Ql(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},gi.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},gi.prototype.toggle=function(e,t){return this.list?(eu(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(eu(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},gi.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(yE);return e[0]===""&&e.shift(),e},gi.prototype.has=gi.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Ql(this.array(),e)};var tu={svg:"http://www.w3.org/2000/svg"},cm='<svg xmlns="'+tu.svg+'"';function bE(e){var t=!1;e.substring(0,4)==="<svg"?e.indexOf(tu.svg)===-1&&(e=cm+e.substring(4)):(e=cm+">"+e+"</svg>",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 se(e,t){var n;return e.charAt(0)==="<"?(n=bE(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(tu.svg,e),t&&W(n,t),n}var nu=null;function lm(){return nu===null&&(nu=se("svg")),nu}function um(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Do(e){return lm().createSVGTransform()}var pm=/([&<>]{1})/g,xE=/([\n\r"]{1})/g,EE={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function iu(e,t){return e.replace(t,function(n,i){return EE[i]||i})}function dm(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(iu(e.textContent,pm));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',iu(o.value,xE),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)dm(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("<!--",iu(e.nodeValue,pm),"-->");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function hm(e,t){return function(n){for(var i=n.firstChild,r=[];i;)dm(i,r),i=i.nextSibling;return r.join("")}(e)}function wE(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Bo(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(i,r){var o,a;for(i.clear(),o=0;a=r[o];o++)i.appendItem(wE(i,a))}(n,t)),n.consolidate()}var _E=/^class /;function ru(e){return Object.prototype.toString.call(e)==="[object Array]"}function ou(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function as(){var e=Array.prototype.slice.call(arguments);e.length===1&&ru(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var SE=/constructor\s*[^(]*\(\s*([^)]*)\)/m,CE=/^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m,TE=/\/\*([^*]*)\*\//m;function AE(e){if(typeof e!="function")throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(function(n){return _E.test(n.toString())}(e)?SE:CE);return t&&t[1]&&t[1].split(",").map(function(n){return(t=n.match(TE))?t[1].trim():n.trim()})||[]}function kE(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}}function au(e,t){t=t||{get:function(f,y){if(n.push(f),y===!1)return null;throw a('No provider for "'+f+'"!')}};var n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(f){var y=n.join(" -> ");return n.length=0,new Error(y?f+" (Resolving: "+y+")":f)},c=function(f,y){if(!i[f]&&f.indexOf(".")!==-1){for(var g=f.split("."),x=c(g.shift());g.length;)x=x[g.shift()];return x}if(ou(r,f))return r[f];if(ou(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,y)},l=function(f,y){if(y===void 0&&(y={}),typeof f!="function"){if(!ru(f))throw new Error('Cannot invoke "'+f+'". Expected a function!');f=as(f.slice())}return{fn:f,dependencies:(f.$inject||AE(f)).map(function(g){return ou(y,g)?y[g]:c(g)})}},u=function(f){var y=l(f),g=y.fn,x=y.dependencies;return new(Function.prototype.bind.apply(g,[null].concat(x)))},p=function(f,y,g){var x=l(f,g),E=x.fn,_=x.dependencies;return E.apply(y,_)},h=function(f){return as(function(y){return f.get(y)})},v={factory:p,type:u,value:function(f){return f}};e.forEach(function(f){function y(_,w){return _!=="value"&&ru(w)&&(w=as(w.slice())),w}if(f instanceof kE)f.forEach(function(_){var w=_[0],S=_[1],D=_[2];i[w]=[v[S],y(S,D),S]});else if(typeof f=="object")if(f.__exports__){var g=Object.keys(f).reduce(function(_,w){return w.substring(0,2)!=="__"&&(_[w]=f[w]),_},Object.create(null)),x=new au((f.__modules__||[]).concat([g]),o),E=as(function(_){return x.get(_)});f.__exports__.forEach(function(_){i[_]=[E,_,"private",x]})}else Object.keys(f).forEach(function(_){if(f[_][2]!=="private"){var w=f[_][0],S=f[_][1];i[_]=[v[w],y(w,S),w]}else i[_]=f[_]})}),this.get=c,this.invoke=p,this.instantiate=u,this.createChild=function(f,y){if(y&&y.length){var g,x,E,_,w=Object.create(null),S=Object.create(null),D=[],s=[],d=[];for(var m in i)g=i[m],y.indexOf(m)!==-1&&(g[2]==="private"?(x=D.indexOf(g[3]))===-1?(E=g[3].createChild([],y),_=h(E),D.push(g[3]),s.push(E),d.push(_),w[m]=[_,m,"private",E]):w[m]=[d[x],m,"private",s[x]]:w[m]=[g[2],g[1]],S[m]=!0),g[2]!=="factory"&&g[2]!=="type"||!g[1].$scope||y.forEach(function(C){g[1].$scope.indexOf(C)!==-1&&(w[m]=[g[2],g[1]],S[C]=!0)});y.forEach(function(C){if(!S[C])throw new Error('No provider for "'+C+'". Cannot use provider from the parent!')}),f.unshift(w)}return new au(f,o)}}var PE=1e3;function Wn(e,t){var n=this;t=t||PE,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 Vr(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function mm(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function su(e,t){var n=se("polyline");return W(n,{points:mm(e)}),t&&W(n,t),n}function fm(e){return Ee(e,function(t){return!je(e,function(n){return n!==t&&vm(t,n)})})}function vm(e,t){if(t){if(e===t)return t;if(e.parent)return vm(e.parent,t)}}function ym(e,t,n){var i=!n||e.indexOf(t)===-1;return i&&e.push(t),i}function Zi(e,t,n){n=n||0,Se(e)||(e=[e]),F(e,function(i,r){var o=t(i,r,n);Se(o)&&o.length&&Zi(o,t,n+1)})}function ss(e,t){return function(n,i){var r=[],o=[];return Zi(n,function(a,c,l){ym(r,a,i);var u=a.children;if(u&&ym(o,u,i))return u}),r}(e,!t)}function gt(e,t){var n,i,r,o;return t=!!t,Se(e)||(e=[e]),F(e,function(a){var c=a;a.waypoints&&!t&&(c=gt(a.waypoints,!0));var l=c.x,u=c.y,p=c.height||0,h=c.width||0;(l<n||n===void 0)&&(n=l),(u<i||i===void 0)&&(i=u),(l+h>r||r===void 0)&&(r=l+h),(u+p>o||o===void 0)&&(o=u+p)}),{x:n,y:i,height:o-i,width:r-n}}function gm(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function bm(e){return!(!e||!e.isFrame)}function Oo(e,t){return z({},e||{},t||{})}Wn.prototype.canRender=function(){},Wn.prototype.drawShape=function(){},Wn.prototype.drawConnection=function(){},Wn.prototype.getShapePath=function(){},Wn.prototype.getConnectionPath=function(){};function bi(e,t){Wn.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})}ae(bi,Wn),bi.prototype.canRender=function(){return!0},bi.prototype.drawShape=function(e,t,n){var i=se("rect");return W(i,{x:0,y:0,width:t.width||0,height:t.height||0}),bm(t)?W(i,z({},this.FRAME_STYLE,n||{})):W(i,z({},this.SHAPE_STYLE,n||{})),pe(e,i),i},bi.prototype.drawConnection=function(e,t,n){var i=su(t.waypoints,z({},this.CONNECTION_STYLE,n||{}));return pe(e,i),i},bi.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return Vr([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},bi.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 Vr(r)},bi.$inject=["eventBus","styles"];const ME={__init__:["defaultRenderer"],defaultRenderer:["type",bi],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){Se(n)||i||(i=n,n=[]);var r=Gt(n,function(o,a){return z(o,e[a]||{})},{});return i?z(r,i):r},this.computeStyle=function(n,i,r){return Se(i)||(r=i,i=[]),t.style(i||[],z({},r,n||{}))}}]};function Qe(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return n!==-1&&e.splice(n,1),n}function et(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 cu(e,t){return e&&t?e.indexOf(t):-1}function jo(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function lu(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=jo(e,t);return Math.abs(r/o)<=i}var xm=2;function Kn(e,t){var n;return function(i,r){var o;o=Se(i)?i:[i,r];var a=o.slice().shift();return Or(o,function(c){return Math.abs(a.y-c.y)<=xm})}(n=Se(e)?e:[e,t])?"h":!!function(i,r){var o;o=Se(i)?i:[i,r];var a=o.slice().shift();return Or(o,function(c){return Math.abs(a.x-c.x)<=xm})}(n)&&"v"}function Em(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function uu(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}var RE=/,?([a-z]),?/gi,wm=parseFloat,tt=Math,xi=tt.PI,In=tt.min,Dn=tt.max,_m=tt.pow,Ei=tt.abs,NE=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,IE=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,cs=Array.isArray||function(e){return e instanceof Array};function pu(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Lo(e){if(typeof e=="function"||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)pu(e,n)&&(t[n]=Lo(e[n]));return t}function Fr(e){var t=Fr.ps=Fr.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)pu(t,n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function du(e,t,n,i){return arguments.length===1&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,height:i,x2:e+n,y2:t+i}}function Sm(){return this.join(",").replace(RE,"$1")}function ls(e){var t=Lo(e);return t.toString=Sm,t}function Cm(e,t,n,i,r,o,a,c,l){var u=1-l,p=_m(u,3),h=_m(u,2),v=l*l*l,f=p*t+3*h*l*i+3*u*l*l*o+v*c;return{x:us(p*e+3*h*l*n+3*u*l*l*r+v*a),y:us(f)}}function Tm(e){var t=jE.apply(null,e);return du(t.x0,t.y0,t.x1-t.x0,t.y1-t.y0)}function wi(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function Am(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 km(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],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],v=0,f=0;f<12;f++){var y=u*p[f]+u,g=Am(y,e,n,r,a),x=Am(y,t,i,o,c),E=g*g+x*x;v+=h[f]*tt.sqrt(E)}return u*v}function DE(e,t,n,i,r,o,a,c){if(!(Dn(e,n)<In(r,a)||In(e,n)>Dn(r,a)||Dn(t,i)<In(o,c)||In(t,i)>Dn(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=us(((e*i-t*n)*(r-a)-(e-n)*(r*c-o*a))/u),h=us(l/u),v=+p.toFixed(2),f=+h.toFixed(2);if(!(v<+In(e,n).toFixed(2)||v>+Dn(e,n).toFixed(2)||v<+In(r,a).toFixed(2)||v>+Dn(r,a).toFixed(2)||f<+In(t,i).toFixed(2)||f>+Dn(t,i).toFixed(2)||f<+In(o,c).toFixed(2)||f>+Dn(o,c).toFixed(2)))return{x:p,y:h}}}}function us(e){return Math.round(1e11*e)/1e11}function BE(e,t,n){if(!function(m,C){return m=du(m),wi(C=du(C),m.x,m.y)||wi(C,m.x2,m.y)||wi(C,m.x,m.y2)||wi(C,m.x2,m.y2)||wi(m,C.x,C.y)||wi(m,C.x2,C.y)||wi(m,C.x,C.y2)||wi(m,C.x2,C.y2)||(m.x<C.x2&&m.x>C.x||C.x<m.x2&&C.x>m.x)&&(m.y<C.y2&&m.y>C.y||C.y<m.y2&&C.y>m.y)}(Tm(e),Tm(t)))return n?0:[];for(var i=km.apply(0,e),r=km.apply(0,t),o=Pm(e)?1:~~(i/5)||1,a=Pm(t)?1:~~(r/5)||1,c=[],l=[],u={},p=n?0:[],h=0;h<o+1;h++){var v=Cm.apply(0,e.concat(h/o));c.push({x:v.x,y:v.y,t:h/o})}for(h=0;h<a+1;h++)v=Cm.apply(0,t.concat(h/a)),l.push({x:v.x,y:v.y,t:h/a});for(h=0;h<o;h++)for(var f=0;f<a;f++){var y,g=c[h],x=c[h+1],E=l[f],_=l[f+1],w=Ei(x.x-g.x)<.01?"y":"x",S=Ei(_.x-E.x)<.01?"y":"x",D=DE(g.x,g.y,x.x,x.y,E.x,E.y,_.x,_.y);if(D){if(u[y=D.x.toFixed(9)+"#"+D.y.toFixed(9)])continue;u[y]=!0;var s=g.t+Ei((D[w]-g[w])/(x[w]-g[w]))*(x.t-g.t),d=E.t+Ei((D[S]-E[S])/(_[S]-E[S]))*(_.t-E.t);s>=0&&s<=1&&d>=0&&d<=1&&(n?p++:p.push({x:D.x,y:D.y,t1:s,t2:d}))}}return p}function OE(e){var t=Fr(e);if(t.abs)return ls(t.abs);if(cs(e)&&cs(e&&e[0])||(e=function(E){if(!E)return null;var _=Fr(E);if(_.arr)return Lo(_.arr);var w={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},S=[];return cs(E)&&cs(E[0])&&(S=Lo(E)),S.length||String(E).replace(NE,function(D,s,d){var m=[],C=s.toLowerCase();for(d.replace(IE,function(R,I){I&&m.push(+I)}),C=="m"&&m.length>2&&(S.push([s].concat(m.splice(0,2))),C="l",s=s=="m"?"l":"L");m.length>=w[C]&&(S.push([s].concat(m.splice(0,w[C]))),w[C]););}),S.toString=Fr.toString,_.arr=Lo(S),S}(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,h=l,v=e.length;h<v;h++){if(i.push(u=[]),(n=(p=e[h])[0])!=n.toUpperCase())switch(u[0]=n.toUpperCase(),u[0]){case"A":u[1]=p[1],u[2]=p[2],u[3]=p[3],u[4]=p[4],u[5]=p[5],u[6]=+p[6]+r,u[7]=+p[7]+o;break;case"V":u[1]=+p[1]+o;break;case"H":u[1]=+p[1]+r;break;case"M":a=+p[1]+r,c=+p[2]+o;default:for(var f=1,y=p.length;f<y;f++)u[f]=+p[f]+(f%2?r:o)}else for(var g=0,x=p.length;g<x;g++)u[g]=p[g];switch(n=n.toUpperCase(),u[0]){case"Z":r=+a,o=+c;break;case"H":r=u[1];break;case"V":o=u[1];break;case"M":a=u[u.length-2],c=u[u.length-1];default:r=u[u.length-2],o=u[u.length-1]}}return i.toString=Sm,t.abs=ls(i),i}function Pm(e){return e[0]===e[2]&&e[1]===e[3]&&e[4]===e[6]&&e[5]===e[7]}function ps(e,t,n,i){return[e,t,n,i,n,i]}function Mm(e,t,n,i,r,o){var a=.3333333333333333,c=2/3;return[a*e+c*n,a*t+c*i,a*r+c*n,a*o+c*i,r,o]}function Rm(e,t,n,i,r,o,a,c,l,u){var p,h,v=120*xi/180,f=xi/180*(+r||0),y=[],g=(h=function(_e,Ve,ye){return{x:_e*tt.cos(ye)-Ve*tt.sin(ye),y:_e*tt.sin(ye)+Ve*tt.cos(ye)}},function _e(){var Ve=Array.prototype.slice.call(arguments,0),ye=Ve.join("\u2400"),Ue=_e.cache=_e.cache||{},Xe=_e.count=_e.count||[];return pu(Ue,ye)?(function(Ie,pt){for(var ke=0,He=Ie.length;ke<He;ke++)if(Ie[ke]===pt)return Ie.push(Ie.splice(ke,1)[0])}(Xe,ye),Ue[ye]):(Xe.length>=1e3&&delete Ue[Xe.shift()],Xe.push(ye),Ue[ye]=h.apply(0,Ve),Ue[ye])});if(u)m=u[0],C=u[1],s=u[2],d=u[3];else{e=(p=g(e,t,-f)).x,t=p.y;var x=(e-(c=(p=g(c,l,-f)).x))/2,E=(t-(l=p.y))/2,_=x*x/(n*n)+E*E/(i*i);_>1&&(n*=_=tt.sqrt(_),i*=_);var w=n*n,S=i*i,D=(o==a?-1:1)*tt.sqrt(Ei((w*S-w*E*E-S*x*x)/(w*E*E+S*x*x))),s=D*n*E/i+(e+c)/2,d=D*-i*x/n+(t+l)/2,m=tt.asin(((t-d)/i).toFixed(9)),C=tt.asin(((l-d)/i).toFixed(9));(m=e<s?xi-m:m)<0&&(m=2*xi+m),(C=c<s?xi-C:C)<0&&(C=2*xi+C),a&&m>C&&(m-=2*xi),!a&&C>m&&(C-=2*xi)}var R=C-m;if(Ei(R)>v){var I=C,N=c,L=l;C=m+v*(a&&C>m?1:-1),y=Rm(c=s+n*tt.cos(C),l=d+i*tt.sin(C),n,i,r,0,a,N,L,[C,I,s,d])}R=C-m;var T=tt.cos(m),b=tt.sin(m),B=tt.cos(C),V=tt.sin(C),H=tt.tan(R/4),q=4/3*n*H,J=4/3*i*H,Q=[e,t],oe=[e+q*b,t-J*T],ie=[c+q*V,l-J*B],he=[c,l];if(oe[0]=2*Q[0]-oe[0],oe[1]=2*Q[1]-oe[1],u)return[oe,ie,he].concat(y);for(var Ne=[],ee=0,Z=(y=[oe,ie,he].concat(y).join().split(",")).length;ee<Z;ee++)Ne[ee]=ee%2?g(y[ee-1],y[ee],f).y:g(y[ee],y[ee+1],f).x;return Ne}function jE(e,t,n,i,r,o,a,c){for(var l,u,p,h,v,f,y,g,x=[],E=[[],[]],_=0;_<2;++_)if(_==0?(u=6*e-12*n+6*r,l=-3*e+9*n-9*r+3*a,p=3*n-3*e):(u=6*t-12*i+6*o,l=-3*t+9*i-9*o+3*c,p=3*i-3*t),Ei(l)<1e-12){if(Ei(u)<1e-12)continue;0<(h=-p/u)&&h<1&&x.push(h)}else y=u*u-4*p*l,g=tt.sqrt(y),y<0||(0<(v=(-u+g)/(2*l))&&v<1&&x.push(v),0<(f=(-u-g)/(2*l))&&f<1&&x.push(f));for(var w,S=x.length,D=S;S--;)w=1-(h=x[S]),E[0][S]=w*w*w*e+3*w*w*h*n+3*w*h*h*r+h*h*h*a,E[1][S]=w*w*w*t+3*w*w*h*i+3*w*h*h*o+h*h*h*c;return E[0][D]=e,E[1][D]=t,E[0][D+1]=a,E[1][D+1]=c,E[0].length=E[1].length=D+2,{x0:In.apply(0,E[0]),y0:In.apply(0,E[1]),x1:Dn.apply(0,E[0]),y1:Dn.apply(0,E[1])}}function Nm(e){var t=Fr(e);if(t.curve)return ls(t.curve);for(var n=OE(e),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(f,y,g){var x,E;if(!f)return["C",y.x,y.y,y.x,y.y,y.x,y.y];switch(!(f[0]in{T:1,Q:1})&&(y.qx=y.qy=null),f[0]){case"M":y.X=f[1],y.Y=f[2];break;case"A":f=["C"].concat(Rm.apply(0,[y.x,y.y].concat(f.slice(1))));break;case"S":g=="C"||g=="S"?(x=2*y.x-y.bx,E=2*y.y-y.by):(x=y.x,E=y.y),f=["C",x,E].concat(f.slice(1));break;case"T":g=="Q"||g=="T"?(y.qx=2*y.x-y.qx,y.qy=2*y.y-y.qy):(y.qx=y.x,y.qy=y.y),f=["C"].concat(Mm(y.x,y.y,y.qx,y.qy,f[1],f[2]));break;case"Q":y.qx=f[1],y.qy=f[2],f=["C"].concat(Mm(y.x,y.y,f[1],f[2],f[3],f[4]));break;case"L":f=["C"].concat(ps(y.x,y.y,f[1],f[2]));break;case"H":f=["C"].concat(ps(y.x,y.y,f[1],y.y));break;case"V":f=["C"].concat(ps(y.x,y.y,y.x,f[1]));break;case"Z":f=["C"].concat(ps(y.x,y.y,y.X,y.Y))}return f},o=function(f,y){if(f[y].length>7){f[y].shift();for(var g=f[y];g.length;)a[y]="A",f.splice(y++,0,["C"].concat(g.splice(0,6)));f.splice(y,1),p=n.length}},a=[],c="",l="",u=0,p=n.length;u<p;u++){n[u]&&(c=n[u][0]),c!="C"&&(a[u]=c,u&&(l=a[u-1])),n[u]=r(n[u],i,l),a[u]!="A"&&c=="C"&&(a[u]="C"),o(n,u);var h=n[u],v=h.length;i.x=h[v-2],i.y=h[v-1],i.bx=wm(h[v-4])||i.x,i.by=wm(h[v-3])||i.y}return t.curve=ls(n),n}const Im=kr(function(e,t,n){e=Nm(e),t=Nm(t);for(var i,r,o,a,c,l,u,p,h,v,f=n?0:[],y=0,g=e.length;y<g;y++){var x=e[y];if(x[0]=="M")i=c=x[1],r=l=x[2];else{x[0]=="C"?(h=[i,r].concat(x.slice(1)),i=h[6],r=h[7]):(h=[i,r,i,r,c,l,c,l],i=c,r=l);for(var E=0,_=t.length;E<_;E++){var w=t[E];if(w[0]=="M")o=u=w[1],a=p=w[2];else{w[0]=="C"?(v=[o,a].concat(w.slice(1)),o=v[6],a=v[7]):(v=[o,a,o,a,u,p,u,p],o=u,a=p);var S=BE(h,v,n);if(n)f+=S;else{for(var D=0,s=S.length;D<s;D++)S[D].segment1=y,S[D].segment2=E,S[D].bez1=h,S[D].bez2=v;f=f.concat(S)}}}}}return f});function Dm(e){return{x:Math.round(e.x),y:Math.round(e.y),width:Math.round(e.width),height:Math.round(e.height)}}function Qi(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function ce(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function hu(e){return{x:e.left,y:e.top,width:e.right-e.left,height:e.bottom-e.top}}function ge(e){return Qi({x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2})}function bt(e,t,n){Tt(n=n||0)||(n={x:n,y:n});var i=ce(e),r=ce(t),o=i.bottom+n.y<=r.top,a=i.left-n.x>=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 mu(e,t,n){var i=Im(e,t);return i.length===1||i.length===2&&jo(i[0],i[1])<1?Qi(i[0]):i.length>1?(i=mn(i,function(r){var o=Math.floor(100*r.t2)||1;return o=((o=100-o)<10?"0":"")+o,r.segment2+"#"+o}),Qi(i[n?0:i.length-1])):null}function ds(e,t){return Math.round(e*t)/t}function Bm(e){return fe(e)?e+"px":e}function Om(e,t,n){var i=se("g");Ce(i).add(t);var r=n!==void 0?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}var hs="base",fu="djs-element-hidden",LE={shape:["x","y","width","height"],connection:["waypoints"]};function be(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}function jm(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}be.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],be.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:Bm(o.width),height:Bm(o.height)}),a.appendChild(c),c}(e),i=this._svg=se("svg");W(i,{width:"100%",height:"100%"}),pe(n,i);var r=this._viewport=Om(i,"viewport");this._layers={},this._planes={},e.deferUpdate!==!1&&(this._viewboxChanged=Zh(qn(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)},be.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},be.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=gm(t);n==="root"?e.setRootElementForPlane(null,e.findPlane(t),!0):e._removeElement(t,n)}),this._activePlane=null,this._planes={},delete this._cachedViewbox},be.prototype.getDefaultLayer=function(){return this.getLayer(hs,0)},be.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},be.prototype._createLayer=function(e,t){t===void 0&&(t=1);var n=Gt(this._layers,function(i,r){return t>=r.index&&i++,i},0);return{group:Om(this._viewport,"layer-"+e,n),index:t}},be.prototype.getPlane=function(e){if(!e)throw new Error("must specify a name");return this._planes[e]},be.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);Ce(n).add(fu);var i=this._planes[e]={layer:n,name:e,rootElement:null};return this.setRootElementForPlane(t,i),i},be.prototype.setActivePlane=function(e){if(!e)throw new Error("must specify a plane");return typeof e=="string"&&(e=this.getPlane(e)),this._activePlane&&Ce(this._activePlane.layer).add(fu),this._activePlane=e,Ce(e.layer).remove(fu),e.rootElement&&this._elementRegistry.updateGraphics(e.rootElement,this._svg,!0),this._eventBus.fire("plane.set",{plane:e}),e},be.prototype.getActiveLayer=function(){return this.getActivePlane().layer},be.prototype.getActivePlane=function(){var e=this._activePlane;return e||(e=this.createPlane(hs),this.setActivePlane(hs)),e},be.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 je(this._planes,function(n){return n.rootElement===t})},be.prototype.getContainer=function(){return this._container},be.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(F([i.gfx,i.secondaryGfx],function(r){r&&(n?Ce(r).add(t):Ce(r).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},be.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},be.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},be.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),Ce(this.getGraphics(e)).has(t)},be.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},be.prototype.getRootElement=function(){return this.getActivePlane().rootElement},be.prototype.setRootElement=function(e,t){var n=this._activePlane;if(n)return this.setRootElementForPlane(e,n,t);var i=this.createPlane(hs,e);return this.setActivePlane(i),i.rootElement},be.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},be.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=LE[e],i=Or(n,function(r){return t[r]!==void 0});if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+e)},be.prototype._setParent=function(e,t,n){et(t.children,e,n),e.parent=t},be.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},be.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},be.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},be.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),Qe(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},be.prototype.removeShape=function(e){return this._removeElement(e,"shape")},be.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},be.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},be.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},be.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},be.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);Bo(c,u)}),e):(t=this._activePlane&&this._activePlane.layer.getBBox()||{},n=(i=Bo(c))?i.matrix:function(u,p,h,v,f,y){var g=lm().createSVGMatrix();switch(arguments.length){case 0:return g;case 1:return um(g,u);case 6:return um(g,{a:u,b:p,c:h,d:v,e:f,f:y})}}(),r=ds(n.a,1e3),o=ds(-n.e||0,1e3),a=ds(-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})},be.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),jm(t,n)}),{x:n.e,y:n.f}},be.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=gt(e),c=ce(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=ce(l);if(a.width<l.width&&a.height<l.height){var h=Math.max(0,c.right-p.right),v=Math.min(0,c.left-p.left),f=Math.max(0,c.bottom-p.bottom),y=Math.min(0,c.top-p.top);r=h||v,o=f||y}else r=a.x-l.x,o=a.y-l.y;this.scroll({dx:-r*u,dy:-o*u})},be.prototype.zoom=function(e,t){return e?e==="fit-viewport"?this._fitViewport(t):(this._changeViewbox(function(){typeof t!="object"&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)}),ds(i.a,1e3)):this.viewbox(e).scale;var n,i},be.prototype._fitViewport=function(e){var t,n,i=this.viewbox(),r=i.outer,o=i.inner;return o.x>=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},be.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),jm(this._viewport,o),o},be.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},be.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}},be.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var $r="data-element-id";function qt(e){this._elements={},this._eventBus=e}qt.$inject=["eventBus"],qt.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),W(t,$r,i),n&&W(n,$r,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},qt.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(W(i.gfx,$r,""),i.secondaryGfx&&W(i.secondaryGfx,$r,""),delete t[n])},qt.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)},qt.prototype.updateGraphics=function(e,t,n){var i=e.id||e,r=this._elements[i];return n?r.secondaryGfx=t:r.gfx=t,W(t,$r,i),t},qt.prototype.get=function(e){var t;t=typeof e=="string"?e:e&&W(e,$r);var n=this._elements[t];return n&&n.element},qt.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},qt.prototype.find=function(e){for(var t=this._elements,n=Object.keys(t),i=0;i<n.length;i++){var r=t[n[i]],o=r.element;if(e(o,r.gfx))return o}},qt.prototype.getAll=function(){return this.filter(function(e){return e})},qt.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)})},qt.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},qt.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var vu={exports:{}},ms={};ms.extend=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),t.unset(o,r,i)),o}}),Object.defineProperty(e,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(e,"add",{value:function(o,a){var c=this.indexOf(o);if(a===void 0){if(c!==-1)return;a=this.length}c!==-1&&this.splice(c,1),this.splice(a,0,o),c===-1&&t.set(o,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},ms.isExtended=function(e){return e.__refs_collection===!0};var Lm=ms;function Vm(e,t,n){var i=Lm.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach(function(r){e.set(r,t.inverse,n)})}function _i(e,t){if(!(this instanceof _i))return new _i(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}_i.prototype.bind=function(e,t){if(typeof t=="string"){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?Vm(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)},_i.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Lm.isExtended(n)||Vm(this,t,e),n},_i.prototype.ensureBound=function(e,t){(function(n,i){return Object.prototype.hasOwnProperty.call(n,i.name||i)})(e,t)||this.bind(e,t)},_i.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},_i.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var VE=_i;vu.exports=VE,vu.exports.Collection=ms;const zr=kr(vu.exports);var Fm=new zr({name:"children",enumerable:!0,collection:!0},{name:"parent"}),$m=new zr({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),zm=new zr({name:"attachers",collection:!0},{name:"host"}),Gm=new zr({name:"outgoing",collection:!0},{name:"source"}),Um=new zr({name:"incoming",collection:!0},{name:"target"});function Vo(){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)}}),Fm.bind(this,"parent"),$m.bind(this,"labels"),Gm.bind(this,"outgoing"),Um.bind(this,"incoming")}function Gr(){Vo.call(this),Fm.bind(this,"children"),zm.bind(this,"host"),zm.bind(this,"attachers")}function Hm(){Gr.call(this)}function fs(){Gr.call(this),$m.bind(this,"labelTarget")}function qm(){Vo.call(this),Gm.bind(this,"source"),Um.bind(this,"target")}ae(Gr,Vo),ae(Hm,Gr),ae(fs,Gr),ae(qm,Vo);var FE={connection:qm,shape:Gr,label:fs,root:Hm};function Xn(){this._uid=12}Xn.prototype.createRoot=function(e){return this.create("root",e)},Xn.prototype.createLabel=function(e){return this.create("label",e)},Xn.prototype.createShape=function(e){return this.create("shape",e)},Xn.prototype.createConnection=function(e){return this.create("connection",e)},Xn.prototype.create=function(e,t){return(t=z({},t||{})).id||(t.id=e+"_"+this._uid++),function(n,i){var r=FE[n];if(!r)throw new Error("unknown type: <"+n+">");return z(new r,i)}(e,t)};var vs="__fn",$E=Array.prototype.slice;function jt(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Fo(){}function ys(e){return e.childNodes[0]}function yu(e,t,n,i,r){var o=Do();o.setTranslate(t,n);var a=Do();a.setRotate(i||0,0,0);var c=Do();c.setScale(1,1),Bo(e,[o,a,c])}function Lt(e,t,n){var i=Do();i.setTranslate(t,n),Bo(e,i)}function Wm(e,t){var n=Do();n.setRotate(t,0,0),Bo(e,n)}function Wt(e,t){this._eventBus=e,this._elementRegistry=t}function Km(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}jt.prototype.on=function(e,t,n,i){if(e=Se(e)?e:[e],At(t)&&(i=n,n=t,t=1e3),!fe(t))throw new Error("priority must be a number");var r=n;i&&((r=qn(n,i))[vs]=n[vs]||n);var o=this;e.forEach(function(a){o._addListener(a,{priority:t,callback:r,next:null})})},jt.prototype.once=function(e,t,n,i){var r=this;if(At(t)&&(i=n,n=t,t=1e3),!fe(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[vs]=n,this.on(e,t,o)},jt.prototype.off=function(e,t){e=Se(e)?e:[e];var n=this;e.forEach(function(i){n._removeListener(i,t)})},jt.prototype.createEvent=function(e){var t=new Fo;return t.init(e),t},jt.prototype.fire=function(e,t){var n,i,r,o;if(o=$E.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 Fo?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}},jt.prototype.handleError=function(e){return this.fire("error",{error:e})===!1},jt.prototype._destroy=function(){this._listeners={}},jt.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},jt.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},jt.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},jt.prototype._getListeners=function(e){return this._listeners[e]},jt.prototype._setListeners=function(e,t){this._listeners[e]=t},jt.prototype._removeListener=function(e,t){var n,i,r,o=this._getListeners(e);if(t)for(;o;)n=o.next,(r=o.callback)!==t&&r[vs]!==t||(i?i.next=n:this._setListeners(e,n)),i=o,o=n;else this._setListeners(e,null)},Fo.prototype.stopPropagation=function(){this.cancelBubble=!0},Fo.prototype.preventDefault=function(){this.defaultPrevented=!0},Fo.prototype.init=function(e){z(this,e||{})},Wt.$inject=["eventBus","elementRegistry"],Wt.prototype._getChildrenContainer=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(i){return i.parentNode.childNodes[1]}(n),t||(Ce(t=se("g")).add("djs-children"),pe(n.parentNode,t))):t=n,t},Wt.prototype._clear=function(e){var t=ys(e);return rs(t),t},Wt.prototype._createContainer=function(e,t,n,i){var r=se("g");Ce(r).add("djs-group"),n!==void 0?Km(r,t,t.childNodes[n]):pe(t,r);var o=se("g");Ce(o).add("djs-element"),Ce(o).add("djs-"+e),i&&Ce(o).add("djs-frame"),pe(r,o);var a=se("g");return Ce(a).add("djs-visual"),pe(o,a),o},Wt.prototype.create=function(e,t,n){var i=this._getChildrenContainer(t.parent);return this._createContainer(e,i,n,bm(t))},Wt.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=Gt(e,function(r,o){return o.parent&&(r[o.parent.id]=o.parent),r},{}),F(t,function(r){var o=r.children;if(o){var a=n._getChildrenContainer(r);F(o.slice().reverse(),function(c){Km(i.getGraphics(c).parentNode,a)})}})},Wt.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},Wt.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},Wt.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},Wt.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},Wt.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if(e==="shape")this.drawShape(i,t),Lt(n,t.x,t.y);else{if(e!=="connection")throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?W(n,"display","none"):W(n,"display","block")}},Wt.prototype.remove=function(e){it(this._elementRegistry.getGraphics(e).parentNode)};const zE={__depends__:[ME],__init__:["canvas"],canvas:["type",be],elementRegistry:["type",qt],elementFactory:["type",Xn],eventBus:["type",jt],graphicsFactory:["type",Wt]};function GE(e){var t=[],n=[];function i(o){return t.indexOf(o)>=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 au(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 Ur(e,t){this.injector=t=t||function(n){return GE([{config:["value",n=n||{}]},zE].concat(n.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}Ur.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Ur.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var UE=Object.prototype.toString;function gu(){return gu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},gu.apply(this,arguments)}function Xm(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return gu.apply(void 0,[e].concat(n))}var bu=Object.prototype.toString,HE=Object.prototype.hasOwnProperty;function Ym(e){return bu.call(e)==="[object String]"}function qE(e,t){return HE.call(e,t)}function vn(e,t){var n;if(e!==void 0){var i=function(o){return bu.call(o)==="[object Array]"}(e)?KE:WE;for(var r in e)if(qE(e,r)&&t(n=e[r],i(r))===!1)return n}}function WE(e){return e}function KE(e){return Number(e)}function Hr(e,t){return e.bind(t)}function xu(){return xu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},xu.apply(this,arguments)}function er(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return xu.apply(void 0,[e].concat(n))}function Eu(){}function Jm(e,t){this.model=e,this.properties=t}Eu.prototype.get=function(e){return this.$model.properties.get(this,e)},Eu.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},Jm.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Eu.prototype);vn(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}),vn(a,Hr(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 XE={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Zm={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 wu(e,t){var n=Zm[e];return n?n(t):t}function _u(e){return!!XE[e]}function Qm(e){return!!Zm[e]}function Nt(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 <prefix:localName> or <localName>, 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 Si(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,vn(e,Hr(this.registerPackage,this))}function ef(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function qr(e){this.model=e}function tf(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Zt(e){this.properties=new qr(this),this.factory=new Jm(this,this.properties),this.registry=new Si(e,this.properties),this.typeCache={}}Jt.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},i=Object(e),vn(t,function(r){r in i&&(n[r]=e[r])}),n;var e,t,n,i},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=Nt(r[0],i),a=Nt(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||(vn(e.properties,Hr(function(o){o=er({},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)},Si.prototype.getPackage=function(e){return this.packageMap[e]},Si.prototype.getPackages=function(){return this.packages},Si.prototype.registerPackage=function(e){e=er({},e);var t=this.packageMap;ef(t,e,"prefix"),ef(t,e,"uri"),vn(e.types,Hr(function(n){this.registerType(n,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Si.prototype.registerType=function(e,t){var n=Nt((e=er({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:er(e.meta||{})})).name,t.prefix),i=n.name,r={};vn(e.properties,Hr(function(o){var a=Nt(o.name,n.prefix),c=a.name;_u(o.type)||(o.type=Nt(o.type,a.prefix).name),er(o,{ns:a,name:c}),r[c]=o},this)),er(e,{ns:n,name:i,propertiesByName:r}),vn(e.extends,Hr(function(o){var a=this.typeMap[o];a.traits=a.traits||[],a.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},Si.prototype.mapTypes=function(e,t,n){var i=_u(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function o(c){return a(c,!0)}function a(c,l){var u=Nt(c,_u(c)?"":e.prefix);r.mapTypes(u,t,l)}if(!i)throw new Error("unknown type <"+e.name+">");vn(i.superClass,n?o:a),t(i,!n),vn(i.traits,o)},Si.prototype.getEffectiveDescriptor=function(e){var t=Nt(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},Si.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},qr.prototype.set=function(e,t,n){if(!Ym(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:tf(e,i,n):e.$attrs[t]=n},qr.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&&tf(e,n,[]),e[i]},qr.prototype.define=function(e,t,n){if(!n.writable){var i=n.value;delete(n=er({},n,{get:function(){return i}})).value}Object.defineProperty(e,t,n)},qr.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},qr.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=Ym(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=Nt(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}),vn(n,function(a,c){var l;l=a,bu.call(l)==="[object Object]"&&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 Su=Object.prototype.toString,YE=Object.prototype.hasOwnProperty;function nf(e){return Su.call(e)==="[object Array]"}function gs(e){return Su.call(e)==="[object String]"}function rf(e,t){return YE.call(e,t)}function of(e,t){var n;return t=af(t),xt(e,function(i,r){if(t(i,r))return n=i,!1}),n}function Cu(e,t){var n=[];return xt(e,function(i,r){t(i,r)&&n.push(i)}),n}function xt(e,t){var n;if(e!==void 0){var i=nf(e)?ZE:JE;for(var r in e)if(rf(e,r)&&t(n=e[r],i(r))===!1)return n}}function af(e){return t=e,(n=Su.call(t))==="[object Function]"||n==="[object AsyncFunction]"||n==="[object GeneratorFunction]"||n==="[object AsyncGeneratorFunction]"||n==="[object Proxy]"?e:function(i){return i===e};var t,n}function JE(e){return e}function ZE(e){return Number(e)}function Tu(){return Tu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Tu.apply(this,arguments)}function yn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Tu.apply(void 0,[e].concat(n))}var QE=String.fromCharCode,ew=Object.prototype.hasOwnProperty,tw=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,$o={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function nw(e,t,n,i){return i?ew.call($o,i)?$o[i]:"&"+i+";":QE(t||parseInt(n,16))}function tr(e){return e.length>3&&e.indexOf("&")!==-1?e.replace(tw,nw):e}Object.keys($o).forEach(function(e){$o[e.toUpperCase()]=$o[e]});var sf="xsi:type",cf="non-whitespace outside of root node";function Wr(e){return new Error(e)}function lf(e){return"missing namespace for prefix <"+e+">"}function bs(e){return{get:e,enumerable:!0}}function iw(e){var t,n={};for(t in e)n[t]=e[t];return n}function Au(e){return e+"$uri"}function uf(){return{line:0,column:0}}function rw(e){throw e}function pf(e){if(!this)return new pf(e);var t,n,i,r,o,a,c,l,u,p=e&&e.proxy,h=rw,v=uf,f=!1,y=!1,g=null,x=!1;function E(w){w instanceof Error||(w=Wr(w)),g=w,h(w,v)}function _(w){o&&(w instanceof Error||(w=Wr(w)),o(w,v))}this.on=function(w,S){if(typeof S!="function")throw Wr("required args <name, cb>");switch(w){case"openTag":n=S;break;case"text":t=S;break;case"closeTag":i=S;break;case"error":h=S;break;case"warn":o=S;break;case"cdata":r=S;break;case"attention":l=S;break;case"question":c=S;break;case"comment":a=S;break;default:throw Wr("unsupported event: "+w)}return this},this.ns=function(w){if(w===void 0&&(w={}),typeof w!="object")throw Wr("required args <nsMap={}>");var S,D={};for(S in w)D[S]=w[S];return D["http://www.w3.org/2001/XMLSchema-instance"]="xsi",y=!0,u=D,this},this.parse=function(w){if(typeof w!="string")throw Wr("required args <xml=string>");return g=null,function(S){var D,s,d,m,C,R,I,N,L,T,b,B=y?[]:null,V=y?function(_e){var Ve,ye,Ue={};for(Ve in _e)Ue[ye=_e[Ve]]=ye,Ue[Au(ye)]=Ve;return Ue}(u):null,H=[],q=0,J=!1,Q=!1,oe=0,ie=0,he="",Ne=0;function ee(){if(b!==null)return b;var _e,Ve,ye,Ue,Xe,Ie,pt,ke,He,me,Fe,ci=y&&V.xmlns,Ui=y&&f?[]:null,Je=Ne,vt=he,ln=vt.length,li={},Ua={};e:for(;Je<ln;Je++)if(He=!1,!((me=vt.charCodeAt(Je))===32||me<14&&me>8)){for((me<65||me>122||me>90&&me<97)&&me!==95&&me!==58&&(_("illegal first char attribute name"),He=!0),Fe=Je+1;Fe<ln;Fe++)if(!((me=vt.charCodeAt(Fe))>96&&me<123||me>64&&me<91||me>47&&me<59||me===46||me===45||me===95)){if(me===32||me<14&&me>8){_("missing attribute value"),Je=Fe;continue e}if(me===61)break;_("illegal attribute name char"),He=!0}if((ke=vt.substring(Je,Fe))==="xmlns:xmlns"&&(_("illegal declaration of xmlns"),He=!0),(me=vt.charCodeAt(Fe+1))===34)(Fe=vt.indexOf('"',Je=Fe+2))===-1&&(Fe=vt.indexOf("'",Je))!==-1&&(_("attribute value quote missmatch"),He=!0);else if(me===39)(Fe=vt.indexOf("'",Je=Fe+2))===-1&&(Fe=vt.indexOf('"',Je))!==-1&&(_("attribute value quote missmatch"),He=!0);else for(_("missing attribute value quotes"),He=!0,Fe+=1;Fe<ln&&!((me=vt.charCodeAt(Fe+1))===32||me<14&&me>8);Fe++);for(Fe===-1&&(_("missing closing quotes"),Fe=ln,He=!0),He||(Ie=vt.substring(Je,Fe)),Je=Fe;Fe+1<ln&&!((me=vt.charCodeAt(Fe+1))===32||me<14&&me>8);Fe++)Je===Fe&&(_("illegal character after attribute end"),He=!0);if(Je=Fe+1,!He)if(ke in Ua)_("attribute <"+ke+"> already defined");else if(Ua[ke]=!0,y)if(f){if((Xe=ke==="xmlns"?"xmlns":ke.charCodeAt(0)===120&&ke.substr(0,6)==="xmlns:"?ke.substr(6):null)!==null){if(_e=tr(Ie),Ve=Au(Xe),!(pt=u[_e])){if(Xe==="xmlns"||Ve in V&&V[Ve]!==_e)do pt="ns"+q++;while(V[pt]!==void 0);else pt=Xe;u[_e]=pt}V[Xe]!==pt&&(Ue||(V=iw(V),Ue=!0),V[Xe]=pt,Xe==="xmlns"&&(V[Au(pt)]=_e,ci=pt),V[Ve]=_e),li[ke]=Ie;continue}Ui.push(ke,Ie)}else(me=ke.indexOf(":"))!==-1?(ye=V[ke.substring(0,me)])?((ke=ci===ye?ke.substr(me+1):ye+ke.substr(me))===sf&&((me=Ie.indexOf(":"))!==-1?(ye=Ie.substring(0,me),Ie=(ye=V[ye]||ye)+Ie.substring(me)):Ie=ci+":"+Ie),li[ke]=Ie):_(lf(ke.substring(0,me))):li[ke]=Ie;else li[ke]=Ie}if(f)for(Je=0,ln=Ui.length;Je<ln;Je++){if(ke=Ui[Je++],Ie=Ui[Je],(me=ke.indexOf(":"))!==-1){if(!(ye=V[ke.substring(0,me)])){_(lf(ke.substring(0,me)));continue}(ke=ci===ye?ke.substr(me+1):ye+ke.substr(me))===sf&&((me=Ie.indexOf(":"))!==-1?(ye=Ie.substring(0,me),Ie=(ye=V[ye]||ye)+Ie.substring(me)):Ie=ci+":"+Ie)}li[ke]=Ie}return b=li}function Z(){for(var _e,Ve,ye=/(\r\n|\r|\n)/g,Ue=0,Xe=0,Ie=0,pt=ie;oe>=Ie&&(_e=ye.exec(S))&&!((pt=_e[0].length+_e.index)>oe);)Ue+=1,Ie=pt;return oe==-1?(Xe=pt,Ve=S.substring(ie)):ie===0?Ve=S.substring(ie,oe):(Xe=oe-Ie,Ve=ie==-1?S.substring(oe):S.substring(oe,ie+1)),{data:Ve,line:Ue,column:Xe}}for(v=Z,p&&(T=Object.create({},{name:bs(function(){return N}),originalName:bs(function(){return L}),attrs:bs(ee),ns:bs(function(){return V})}));ie!==-1;){if((oe=S.charCodeAt(ie)===60?ie:S.indexOf("<",ie))===-1)return H.length?E("unexpected end of file"):ie===0?E("missing start tag"):void(ie<S.length&&S.substring(ie).trim()&&_(cf));if(ie!==oe){if(H.length){if(t&&(t(S.substring(ie,oe),tr,v),x))return}else if(S.substring(ie,oe).trim()&&(_(cf),x))return}if((C=S.charCodeAt(oe+1))===33){if((m=S.charCodeAt(oe+2))===91&&S.substr(oe+3,6)==="CDATA["){if((ie=S.indexOf("]]>",oe))===-1)return E("unclosed cdata");if(r&&(r(S.substring(oe+9,ie),v),x))return;ie+=3;continue}if(m===45&&S.charCodeAt(oe+3)===45){if((ie=S.indexOf("-->",oe))===-1)return E("unclosed comment");if(a&&(a(S.substring(oe+4,ie),tr,v),x))return;ie+=3;continue}}if(C!==63){for(s=oe+1;;s++){if(R=S.charCodeAt(s),isNaN(R))return ie=-1,E("unclosed tag");if(R===34)s=(m=S.indexOf('"',s+1))!==-1?m:s;else if(R===39)s=(m=S.indexOf("'",s+1))!==-1?m:s;else if(R===62){ie=s;break}}if(C!==33){if(b={},C===47){if(J=!1,Q=!0,!H.length)return E("missing open tag");if(s=N=H.pop(),m=oe+2+s.length,S.substring(oe+2,m)!==s)return E("closing tag mismatch");for(;m<ie;m++)if(!((C=S.charCodeAt(m))===32||C>8&&C<14))return E("close tag")}else{if(S.charCodeAt(ie-1)===47?(s=N=S.substring(oe+1,ie-1),J=!0,Q=!0):(s=N=S.substring(oe+1,ie),J=!0,Q=!1),!(C>96&&C<123||C>64&&C<91||C===95||C===58))return E("illegal first char nodeName");for(m=1,d=s.length;m<d;m++)if(!((C=s.charCodeAt(m))>96&&C<123||C>64&&C<91||C>47&&C<59||C===45||C===95||C==46)){if(C===32||C<14&&C>8){N=s.substring(0,m),b=null;break}return E("invalid nodeName")}Q||H.push(N)}if(y){if(D=V,J&&(Q||B.push(D),b===null&&(f=s.indexOf("xmlns",m)!==-1)&&(Ne=m,he=s,ee(),f=!1)),L=N,(C=N.indexOf(":"))!==-1){if(!(I=V[N.substring(0,C)]))return E("missing namespace on <"+L+">");N=N.substr(C+1)}else I=V.xmlns;I&&(N=I+":"+N)}if(J&&(Ne=m,he=s,n&&(p?n(T,tr,Q,v):n(N,ee,tr,Q,v),x)))return;if(Q){if(i&&(i(p?T:N,tr,J,v),x))return;y&&(V=J?D:B.pop())}ie+=1}else{if(l&&(l(S.substring(oe,ie+1),tr,v),x))return;ie+=1}}else{if((ie=S.indexOf("?>",oe))===-1)return E("unclosed question");if(c&&(c(S.substring(oe,ie+2),v),x))return;ie+=2}}}(w),v=uf,x=!1,g},this.stop=function(){x=!0}}function df(e){return e.xml&&e.xml.tagAlias==="lowerCase"}var ow={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},xs="xsi:type";function hf(e){return e.xml&&e.xml.serialize}function mf(e){return hf(e)===xs}function ff(e,t){return df(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function Ci(e){return new Error(e)}function Yn(e){return e.$descriptor}function aw(e){yn(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(t){this.references.push(t)},this.addElement=function(t){if(!t)throw Ci("expected element");var n,i=this.elementsById,r=Yn(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 Ci("duplicate ID <"+n+">");i[n]=t}},this.addWarning=function(t){this.warnings.push(t)}}function zo(){}function ku(){}function Kr(){}function Go(e,t){this.property=e,this.context=t}function Pu(e,t){this.element=t,this.propertyDesc=e}function Es(){}function kt(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Mu(e,t,n){kt.call(this,e,t,n)}function Xr(e,t,n){this.model=e,this.context=n}function Ru(e){e instanceof Zt&&(e={model:e}),yn(this,{lax:!1},e)}zo.prototype.handleEnd=function(){},zo.prototype.handleText=function(){},zo.prototype.handleNode=function(){},ku.prototype=Object.create(zo.prototype),ku.prototype.handleNode=function(){return this},Kr.prototype=Object.create(zo.prototype),Kr.prototype.handleText=function(e){this.body=(this.body||"")+e},Go.prototype=Object.create(Kr.prototype),Go.prototype.handleNode=function(e){if(this.element)throw Ci("expected no sub nodes");return this.element=this.createReference(e),this},Go.prototype.handleEnd=function(){this.element.id=this.body},Go.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},Pu.prototype=Object.create(Kr.prototype),Pu.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=wu(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},Es.prototype=Object.create(Kr.prototype),Es.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},kt.prototype=Object.create(Es.prototype),kt.prototype.addReference=function(e){this.context.addReference(e)},kt.prototype.handleText=function(e){if(!Yn(this.element).bodyProperty)throw Ci("unexpected body text <"+e+">");Kr.prototype.handleText.call(this,e)},kt.prototype.handleEnd=function(){var e=this.body,t=this.element,n=Yn(t).bodyProperty;n&&e!==void 0&&(e=wu(n.type,e),t.set(n.name,e))},kt.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=Yn(i),o=this.context,a=new i({}),c=this.model;return xt(n,function(l,u){var p=r.propertiesByName[u];p&&p.isReference?p.isMany?xt(l.split(" "),function(h){o.addReference({element:a,property:p.ns.name,id:h})}):o.addReference({element:a,property:p.ns.name,id:l}):(p?l=wu(p.type,l):u!=="xmlns"&&(t=Nt(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},kt.prototype.getPropertyForNode=function(e){var t,n,i=Nt(e.name),r=this.type,o=this.model,a=Yn(r),c=i.name,l=a.propertiesByName[c];if(l&&!l.isAttr)return mf(l)&&(t=e.attributes[xs])?(t=function(p,h){var v=Nt(p);return function(f,y){var g=f.name,x=f.localName,E=y.xml&&y.xml.typePrefix;return E&&x.indexOf(E)===0?f.prefix+":"+x.slice(E.length):g}(v,h.getPackage(v.prefix))}(t,o),yn({},l,{effectiveType:Yn(n=o.getType(t)).name})):l;var u=o.getPackage(i.prefix);if(u){if(t=ff(i,u),n=o.getType(t),l=of(a.properties,function(p){return!p.isVirtual&&!p.isReference&&!p.isAttribute&&n.hasType(p.type)}))return yn({},l,{effectiveType:Yn(n).name})}else if(l=of(a.properties,function(p){return!p.isReference&&!p.isAttribute&&p.type==="Element"}))return l;throw Ci("unrecognized element <"+i.name+">")},kt.prototype.toString=function(){return"ElementDescriptor["+Yn(this.type).name+"]"},kt.prototype.valueHandler=function(e,t){return new Pu(e,t)},kt.prototype.referenceHandler=function(e){return new Go(e,this.context)},kt.prototype.handler=function(e){return e==="Element"?new Xr(this.model,e,this.context):new kt(this.model,e,this.context)},kt.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Qm(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?(yn(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},Mu.prototype=Object.create(kt.prototype),Mu.prototype.createElement=function(e){var t=e.name,n=Nt(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&ff(n,o)||t;if(!r.hasType(a))throw Ci("unexpected element <"+e.originalName+">");return kt.prototype.createElement.call(this,e)},Xr.prototype=Object.create(Es.prototype),Xr.prototype.createElement=function(e){var t=e.name,n=Nt(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Xr.prototype.handleChild=function(e){var t=new Xr(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},Xr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Ru.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof kt?(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 aw(yn({},t,{rootHandler:i})),c=new pf({proxy:!0}),l=function(){var x=[];return Object.defineProperty(x,"peek",{value:function(){return this[this.length-1]}}),x}();function u(x,E,_){var w=E(),S=w.line,D=w.column,s=w.data;s.charAt(0)==="<"&&s.indexOf(" ")!==-1&&(s=s.slice(0,s.indexOf(" "))+">");var d="unparsable content "+(s?s+" ":"")+`detected
    line: `+S+`
    column: `+D+`
    nested error: `+x.message;if(_)return a.addWarning({message:d,error:x}),!0;throw Ci(d)}function p(x,E){return u(x,E,!0)}i.context=a,l.push(i);var h=/^<\?xml /i,v=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function y(x,E){try{l.peek().handleText(x)}catch(_){p(_,E)}}var g=r.getPackages().reduce(function(x,E){return x[E.uri]=E.prefix,x},{"http://www.w3.org/XML/1998/namespace":"xml"});return c.ns(g).on("openTag",function(x,E,_,w){var S=x.attrs||{},D=Object.keys(S).reduce(function(s,d){var m=E(S[d]);return s[d]=m,s},{});(function(s,d){var m=l.peek();try{l.push(m.handleNode(s))}catch(C){u(C,d,o)&&l.push(new ku)}})({name:x.name,originalName:x.originalName,attributes:D,ns:x.ns},w)}).on("question",function(x){if(h.test(x)){var E=v.exec(x),_=E&&E[1];_&&!f.test(_)&&a.addWarning({message:"unsupported document encoding <"+_+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",y).on("text",function(x,E,_){(function(w,S){w.trim()&&y(w,S)})(E(x),_)}).on("error",u).on("warn",p),new Promise(function(x,E){var _;try{c.parse(e),function(){var d,m,C=a.elementsById,R=a.references;for(d=0;m=R[d];d++){var I=m.element,N=C[m.id],L=Yn(I).propertiesByName[m.property];if(N||a.addWarning({message:"unresolved reference <"+m.id+">",element:m.element,property:m.property,value:m.id}),L.isMany){var T=I.get(L.name),b=T.indexOf(m);b===-1&&(b=T.length),N?T[b]=N:T.splice(b,1)}else I.set(L.name,N)}}()}catch(d){_=d}var w=i.element;_||w||(_=Ci("failed to parse document as <"+i.type.$descriptor.name+">"));var S=a.warnings,D=a.references,s=a.elementsById;return _?(_.warnings=S,E(_)):x({rootElement:w,elementsById:s,references:D,warnings:S})})},Ru.prototype.handler=function(e){return new Mu(this.model,e)};var sw=/<|>|'|"|&|\n\r|\n/g,vf=/<|>|&/g;function cw(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 lw(e,t){return df(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function yf(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function gf(e){return gs(e)?e:(e.prefix?e.prefix+":":"")+e.localName}var uw={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},pw={"<":"lt",">":"gt","&":"amp"};function bf(e,t,n){return(e=gs(e)?e:""+e).replace(t,function(i){return"&"+n[i]+";"})}function Nu(e){this.tagName=e}function nr(){}function Iu(e){this.tagName=e}function qe(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function ws(e,t){qe.call(this,e,t)}function dw(){this.value="",this.write=function(e){this.value+=e}}function hw(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 mw(e){return e=yn({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new dw,r=new hw(i,e.format);if(e.preamble&&r.append(`<?xml version="1.0" encoding="UTF-8"?>
`),new qe().build(t).serializeTo(r),!n)return i.value}}}function _s(e,t){Zt.call(this,e,t)}Nu.prototype.build=function(e){return this.element=e,this},Nu.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},nr.prototype.serializeValue=nr.prototype.serializeTo=function(e){e.append(this.escape?bf(this.value,vf,pw):this.value)},nr.prototype.build=function(e,t){return this.value=t,e.type==="String"&&t.search(vf)!==-1&&(this.escape=!0),this},yf(Iu,nr),Iu.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},qe.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 Cu(a.$descriptor.properties,function(c){var l=c.name;if(c.isVirtual||!rf(a,l))return!1;var u=a[l];return u!==c.default&&u!==null&&(!c.isMany||u.length)})}(e),this.parseAttributes(Cu(n,function(a){return a.isAttr})),this.parseContainments(function(a){return Cu(a,function(c){return!c.isAttr})}(n))),this.parseGenericAttributes(e,t),this},qe.prototype.nsTagName=function(e){return function(t,n){return n.isGeneric?yn({localName:n.ns.localName},t):yn({localName:lw(n.ns.localName,n.$pkg)},t)}(this.logNamespaceUsed(e.ns),e)},qe.prototype.nsPropertyTagName=function(e){return function(t,n){return yn({localName:n.ns.localName},t)}(this.logNamespaceUsed(e.ns),e)},qe.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},qe.prototype.nsAttributeName=function(e){var t;if(t=gs(e)?Nt(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}:yn({localName:t.localName},n)},qe.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return xt(e,function(r,o){o==="$body"?n.push(new nr().build({type:"String"},r)):o==="$children"?xt(r,function(a){n.push(new qe(t).build(a))}):o.indexOf("$")!==0&&t.parseNsAttribute(e,o,r)&&i.push({name:o,value:r})}),i},qe.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,o=Nt(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)}},qe.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return xt(i,function(o,a){var c=n.parseNsAttribute(e,a,o);c&&r.push(c)}),r},qe.prototype.parseGenericAttributes=function(e,t){var n=this;xt(t,function(i){if(i.name!==xs)try{n.addAttribute(n.nsAttributeName(i.name),i.value)}catch(r){console.warn("missing namespace information for ",i.name,"=",i.value,"on",e,r)}})},qe.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;xt(e,function(r){var o=i.get(r.name),a=r.isReference;if(r.isMany||(o=[o]),r.isBody)n.push(new nr().build(r,o[0]));else if(Qm(r.type))xt(o,function(u){n.push(new Iu(t.addTagName(t.nsPropertyTagName(r))).build(r,u))});else if(a)xt(o,function(u){n.push(new Nu(t.addTagName(t.nsPropertyTagName(r))).build(u))});else{var c=mf(r),l=function(u){return hf(u)==="property"}(r);xt(o,function(u){var p;p=c?new ws(t,r):l?new qe(t,r):new qe(t),n.push(p.build(u))})}})},qe.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new cw(t):n=t),n},qe.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},qe.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=ow[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},qe.prototype.parseAttributes=function(e){var t=this,n=this.element;xt(e,function(i){var r=n.get(i.name);if(i.isReference)if(i.isMany){var o=[];xt(r,function(a){o.push(a.id)}),r=o.join(" ")}else r=r.id;t.addAttribute(t.nsAttributeName(i),r)})},qe.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),gf(e)},qe.prototype.addAttribute=function(e,t){var n=this.attrs;gs(t)&&(t=bf(t,sw,uw));var i=function(o,a){a=af(a);var c=nf(o)?-1:void 0;return xt(o,function(l,u){if(a(l,u))return c=u,!1}),c}(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)},qe.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)),xt(t,function(i){e.append(" ").append(gf(i.name)).append('="').append(i.value).append('"')})},qe.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==nr;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),xt(this.body,function(i){i.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},yf(ws,qe),ws.prototype.parseNsAttributes=function(e){var t=qe.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(xs),(i.prefix?i.prefix+":":"")+o+n.ns.localName),t},ws.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},_s.prototype=Object.create(Zt.prototype),_s.prototype.fromXML=function(e,t,n){var i;i=t,UE.call(i)!=="[object String]"&&(n=t,t="bpmn:Definitions");var r=new Ru(Xm({model:this,lax:!0},n)),o=r.handler(t);return r.fromXML(e,o)},_s.prototype.toXML=function(e,t){var n=new mw(t);return new Promise(function(i,r){try{return i({xml:n.toXML(e)})}catch(o){return r(o)}})};var fw={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 vw(e,t){return new _s(Xm({},fw,e),t)}function Et(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var yw=new zr({name:"bpmnElement",enumerable:!0},{name:"di",configurable:!0});function Vt(e,t){return e.$instanceOf(t)}function gw(e,t){var n={},i=[];function r(I,N){return function(L){I(L,N)}}function o(I){n[I.id]=I}function a(I,N){try{var L=I.di&&function(T,b){if(T.gfx)throw new Error(t("already rendered {element}",{element:Et(T)}));return e.element(T,b)}(I,N);return o(I),L}catch(T){c(T.message,{element:I,error:T}),console.error(t("failed to import {element}",{element:Et(I)})),console.error(T)}}function c(I,N){e.error(I,N)}function l(I){var N=I.bpmnElement;N?N.di?c(t("multiple DI elements defined for {element}",{element:Et(N)}),{element:N}):(yw.bind(N,"di"),N.di=I):c(t("no bpmnElement referenced in {element}",{element:Et(I)}),{element:I})}function u(I){var N;l(N=I.plane),F(N.planeElement,p)}function p(I){l(I)}function h(){for(;i.length;)i.shift()()}function v(I,N){C(I,N),w(I.ioSpecification,N),_(I.artifacts,N),o(I)}function f(I,N){a(I,N)}function y(I,N){a(I,N)}function g(I,N){a(I,N)}function x(I,N){a(I,N)}function E(I,N){a(I,N)}function _(I,N){F(I,function(L){Vt(L,"bpmn:Association")?i.push(function(){E(L,N)}):E(L,N)})}function w(I,N){I&&(F(I.dataInputs,r(g,N)),F(I.dataOutputs,r(x,N)))}function S(I,N){C(I,N),_(I.artifacts,N)}function D(I,N){var L=a(I,N);Vt(I,"bpmn:SubProcess")&&S(I,L||N),Vt(I,"bpmn:Activity")&&w(I.ioSpecification,N),i.push(function(){F(I.dataInputAssociations,r(y,N)),F(I.dataOutputAssociations,r(y,N))})}function s(I,N){a(I,N)}function d(I,N){i.push(function(){var L=a(I,N);I.childLaneSet&&m(I.childLaneSet,L||N),function(T){F(T.flowNodeRef,function(b){var B=b.get("lanes");B&&B.push(T)})}(I)})}function m(I,N){F(I.lanes,r(d,N))}function C(I,N){(function(L,T){F(L,function(b){Vt(b,"bpmn:SequenceFlow")?i.push(function(){(function(B,V){a(B,V)})(b,T)}):Vt(b,"bpmn:BoundaryEvent")?i.unshift(function(){D(b,T)}):Vt(b,"bpmn:FlowNode")?D(b,T):Vt(b,"bpmn:DataObject")||(Vt(b,"bpmn:DataStoreReference")||Vt(b,"bpmn:DataObjectReference")?s(b,T):c(t("unrecognized flowElement {element} in context {context}",{element:Et(b),context:T?Et(T.businessObject):"null"}),{element:b,context:T}))})})(I.flowElements,N),I.laneSets&&function(L,T){F(L,r(m,T))}(I.laneSets,N)}function R(I,N){var L=a(I,N),T=I.processRef;T&&v(T,L||N)}return{handleDeferred:h,handleDefinitions:function(I,N){var L=I.diagrams;if(N&&L.indexOf(N)===-1)throw new Error(t("diagram not part of bpmn:Definitions"));if(!N&&L&&L.length&&(N=L[0]),!N)throw new Error(t("no diagram to display"));u(N);var T=N.plane;if(!T)throw new Error(t("no plane for {element}",{element:Et(N)}));var b=T.bpmnElement;if(!b){if(b=function(H){return je(H.rootElements,function(q){return Vt(q,"bpmn:Process")||Vt(q,"bpmn:Collaboration")})}(I),!b)throw new Error(t("no process or collaboration to display"));c(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Et(T),rootElement:Et(b)})),T.bpmnElement=b,l(T)}var B,V=function(H,q){return e.root(H,q)}(b,T);if(Vt(b,"bpmn:Process"))v(b,V);else{if(!Vt(b,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:Et(T),rootElement:Et(b)}));F((B=b).participants,r(R)),_(B.artifacts),i.push(function(){var H;F(B.messageFlows,r(f,H))}),function(H,q){Ee(H,function(J){return!n[J.id]&&Vt(J,"bpmn:Process")&&J.laneSets}).forEach(r(v,q))}(I.rootElements,V)}h()},handleSubProcess:S,registerDi:l}}function bw(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 gw({root:function(h){return i.add(h)},element:function(h,v){return i.add(h,v)},error:function(h,v){a.push({message:h,context:v})}},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 Yr(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&&At(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 xf='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.02 5.57" width="53" height="21" style="vertical-align:middle"><path fill="currentColor" d="M1.88.92v.14c0 .41-.13.68-.4.8.33.14.46.44.46.86v.33c0 .61-.33.95-.95.95H0V0h.95c.65 0 .93.3.93.92zM.63.57v1.06h.24c.24 0 .38-.1.38-.43V.98c0-.28-.1-.4-.32-.4zm0 1.63v1.22h.36c.2 0 .32-.1.32-.39v-.35c0-.37-.12-.48-.4-.48H.63zM4.18.99v.52c0 .64-.31.98-.94.98h-.3V4h-.62V0h.92c.63 0 .94.35.94.99zM2.94.57v1.35h.3c.2 0 .3-.09.3-.37v-.6c0-.29-.1-.38-.3-.38h-.3zm2.89 2.27L6.25 0h.88v4h-.6V1.12L6.1 3.99h-.6l-.46-2.82v2.82h-.55V0h.87zM8.14 1.1V4h-.56V0h.79L9 2.4V0h.56v4h-.64zm2.49 2.29v.6h-.6v-.6zM12.12 1c0-.63.33-1 .95-1 .61 0 .95.37.95 1v2.04c0 .64-.34 1-.95 1-.62 0-.95-.37-.95-1zm.62 2.08c0 .28.13.39.33.39s.32-.1.32-.4V.98c0-.29-.12-.4-.32-.4s-.33.11-.33.4z"/><path fill="currentColor" d="M0 4.53h14.02v1.04H0zM11.08 0h.63v.62h-.63zm.63 4V1h-.63v2.98z"/></svg>';function Ss(e){return e.join(";")}var Uo,Ef=Ss(["color: #404040"]),xw='<div class="bjs-powered-by-lightbox" style="'+Ss(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+Ss(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+Ss(["position: absolute","left: 50%","top: 40%","transform: translate(-50%)","width: 260px","padding: 10px","background: white","box-shadow: 0 1px 4px rgba(0,0,0,0.3)","font-family: Helvetica, Arial, sans-serif","font-size: 14px","display: flex","line-height: 1.3"])+'"><a href="https://bpmn.io" target="_blank" rel="noopener" style="margin: 15px 20px 15px 10px; align-self: center;'+Ef+'">'+xf+'</a><span>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="https://bpmn.io" target="_blank" rel="noopener">bpmn.io</a>.</span></div></div>';function We(e){var t,n;e=z({},Ew,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n=ze('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100; '+Ef+'">'+xf+"</a>"),t.appendChild(n),le.bind(n,"click",function(i){Uo||(Uo=ze(xw),Ht.bind(Uo,".backdrop","click",function(r){document.body.removeChild(Uo)})),document.body.appendChild(Uo),i.preventDefault()}),this._init(this._container,this._moddle,e)}function Cs(e,t){return e.warnings=t,e}ae(We,Ur),We.prototype.importXML=Yr(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 h=n.get("eventBus").createEvent(p);return Object.defineProperty(h,"context",{enumerable:!0,get:function(){return console.warn(new Error("import.parse.complete <context> is deprecated and will be removed in future library versions")),{warnings:p.warnings,references:p.references,elementsById:p.elementsById}}}),h}({error:null,definitions:a,elementsById:u,references:c,warnings:l}))||a,n.importDefinitions(a,t).then(function(p){var h=[].concat(l,p.warnings||[]);return n._emit("import.done",{error:null,warnings:h}),i({warnings:h})}).catch(function(p){var h=[].concat(l,p.warnings||[]);return n._emit("import.done",{error:p,warnings:h}),r(Cs(p,h))})}).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)})})}),We.prototype.importDefinitions=Yr(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)})})}),We.prototype.open=Yr(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(Cs(a,[]))}if(typeof e=="string"&&(n=function(l,u){return u&&je(l.diagrams,function(p){return p.id===u})||null}(t,e),!n)){var c=new Error("BPMNDiagram <"+e+"> not found");return o(Cs(c,[]))}try{i.clear()}catch(l){return o(Cs(l,[]))}bw(i,t,n).then(function(l){var u=l.warnings;return r({warnings:u})}).catch(function(l){return o(l)})})}),We.prototype.saveXML=Yr(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})}),We.prototype.saveSVG=Yr(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=Ye("defs",a._svg),u=hm(c),p=l?"<defs>"+hm(l)+"</defs>":"",h=c.getBBox();r=`<?xml version="1.0" encoding="utf-8"?>
<!-- created with bpmn-js / http://bpmn.io -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="`+h.width+'" height="'+h.height+'" viewBox="'+h.x+" "+h.y+" "+h.width+" "+h.height+'" version="1.1">'+p+u+"</svg>"}catch(v){o=v}return t._emit("saveSVG.done",{error:o,svg:r}),o?i(o):n({svg:r})})}),We.prototype._setDefinitions=function(e){this._definitions=e},We.prototype.getModules=function(){return this._modules},We.prototype.clear=function(){this.getDefinitions()&&(this.get("elementRegistry").forEach(function(e){var t=e.businessObject;t&&t.di&&delete t.di}),Ur.prototype.clear.call(this))},We.prototype.destroy=function(){Ur.prototype.destroy.call(this),Nn(this._container)},We.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},We.prototype.off=function(e,t){this.get("eventBus").off(e,t)},We.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=Ye(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},We.prototype.getDefinitions=function(){return this._definitions},We.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},We.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(vi(n,["additionalModules"]),{canvas:z({},n.canvas,{container:e}),modules:o});Ur.call(this,a),n&&n.container&&this.attachTo(n.container)},We.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},We.prototype._createContainer=function(e){var t=ze('<div class="bjs-container"></div>');return z(t.style,{width:wf(e.width),height:wf(e.height),position:e.position}),t},We.prototype._createModdle=function(e){return new vw(z({},this._moddleExtensions,e.moddleExtensions))},We.prototype._modules=[];var Ew={width:"100%",height:"100%",position:"relative"};function wf(e){return e+(fe(e)?"px":"")}function Ho(e){We.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)}function A(e,t){var n=re(e);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(t)}function re(e){return e&&e.businessObject||e}function Oe(e){return!A(e,"bpmn:CallActivity")&&(A(e,"bpmn:SubProcess")?re(e).di&&!!re(e).di.isExpanded:!A(e,"bpmn:Participant")||!!re(e).processRef)}function Ft(e){return e&&!!re(e).triggeredByEvent}function Ts(e,t){var n=re(e),i=!1;return n.eventDefinitions&&F(n.eventDefinitions,function(r){A(r,t)&&(i=!0)}),i}function _f(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 gn(e){var t=e.businessObject,n=_f(t);if(n)return n==="categoryValueRef"?function(i){var r=i.categoryValueRef;return r&&r.value||""}(t):t[n]||""}function Bn(e,t,n){return Yi(e.eventDefinitions,function(i){return i.$type===t&&function(r,o){return Or(o,function(a,c){return r[c]==a})}(e,n)})}function Jr(e){return e.businessObject.di}function Pt(e){return e.businessObject}function Te(e,t){var n=Jr(e);return n.get("color:background-color")||n.get("bioc:fill")||t||"white"}function te(e,t){var n=Jr(e);return n.get("color:border-color")||n.get("bioc:stroke")||t||"black"}function qo(e,t,n){var i=Jr(e).get("label");return i&&i.get("color:color")||t||te(e,n)}ae(Ho,We),Ho.prototype._createModdle=function(e){var t=We.prototype._createModdle.call(this,e);return t.ids=new Pn([32,36,1]),t},Ho.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var ww=new Pn,Zr=.95;function ir(e,t,n,i,r,o,a){Wn.call(this,t,a);var c=e&&e.defaultFillColor,l=e&&e.defaultStrokeColor,u=e&&e.defaultLabelColor,p=ww.next(),h={},v=n.computeStyle;function f(T,b){var B=z({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},b.attrs),V=b.ref||{x:0,y:0},H=b.scale||1;B.strokeDasharray==="none"&&(B.strokeDasharray=[1e4,1]);var q=se("marker");W(b.element,B),pe(q,b.element),W(q,{id:T,viewBox:"0 0 20 20",refX:V.x,refY:V.y,markerWidth:20*H,markerHeight:20*H,orient:"auto"});var J=Ye("defs",r._svg);J||(J=se("defs"),pe(r._svg,J)),pe(J,q),h[T]=q}function y(T){return T.replace(/[^0-9a-zA-z]+/g,"_")}function g(T,b,B){var V=T+"-"+y(b)+"-"+y(B)+"-"+p;return h[V]||function(H,q,J,Q){if(q==="sequenceflow-end"){var oe=se("path");W(oe,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(H,{element:oe,ref:{x:11,y:10},scale:.5,attrs:{fill:Q,stroke:Q}})}if(q==="messageflow-start"){var ie=se("circle");W(ie,{cx:6,cy:6,r:3.5}),f(H,{element:ie,attrs:{fill:J,stroke:Q},ref:{x:6,y:6}})}if(q==="messageflow-end"){var he=se("path");W(he,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(H,{element:he,attrs:{fill:J,stroke:Q,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if(q==="association-start"){var Ne=se("path");W(Ne,{d:"M 11 5 L 1 10 L 11 15"}),f(H,{element:Ne,attrs:{fill:"none",stroke:Q,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if(q==="association-end"){var ee=se("path");W(ee,{d:"M 1 5 L 11 10 L 1 15"}),f(H,{element:ee,attrs:{fill:"none",stroke:Q,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if(q==="conditional-flow-marker"){var Z=se("path");W(Z,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(H,{element:Z,attrs:{fill:J,stroke:Q},ref:{x:-1,y:10},scale:.5})}if(q==="conditional-default-flow-marker"){var _e=se("path");W(_e,{d:"M 6 4 L 10 16"}),f(H,{element:_e,attrs:{stroke:Q},ref:{x:0,y:10},scale:.5})}}(V,T,b,B),"url(#"+V+")"}function x(T,b,B,V,H){Tt(V)&&(H=V,V=0),V=V||0,(H=v(H,{stroke:"black",strokeWidth:2,fill:"white"})).fill==="none"&&delete H.fillOpacity;var q=b/2,J=B/2,Q=se("circle");return W(Q,{cx:q,cy:J,r:Math.round((b+B)/4-V)}),W(Q,H),pe(T,Q),Q}function E(T,b,B,V,H,q){Tt(H)&&(q=H,H=0),H=H||0,q=v(q,{stroke:"black",strokeWidth:2,fill:"white"});var J=se("rect");return W(J,{x:H,y:H,width:b-2*H,height:B-2*H,rx:V,ry:V}),W(J,q),pe(T,J),J}function _(T,b,B){var V=su(b,B=v(B,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return pe(T,V),V}function w(T,b,B){B=v(B,["no-fill"],{strokeWidth:2,stroke:"black"});var V=se("path");return W(V,{d:b}),W(V,B),pe(T,V),V}function S(T,b,B,V){return w(b,B,z({"data-marker":T},V))}function D(T){return function(b,B){return N[T](b,B)}}function s(T){return N[T]}function d(T,b){var B=Pt(T),V=function(H){return H.$type==="bpmn:IntermediateThrowEvent"||H.$type==="bpmn:EndEvent"}(B);return B.eventDefinitions&&B.eventDefinitions.length>1?B.parallelMultiple?s("bpmn:ParallelMultipleEventDefinition")(b,T,V):s("bpmn:MultipleEventDefinition")(b,T,V):Bn(B,"bpmn:MessageEventDefinition")?s("bpmn:MessageEventDefinition")(b,T,V):Bn(B,"bpmn:TimerEventDefinition")?s("bpmn:TimerEventDefinition")(b,T,V):Bn(B,"bpmn:ConditionalEventDefinition")?s("bpmn:ConditionalEventDefinition")(b,T):Bn(B,"bpmn:SignalEventDefinition")?s("bpmn:SignalEventDefinition")(b,T,V):Bn(B,"bpmn:EscalationEventDefinition")?s("bpmn:EscalationEventDefinition")(b,T,V):Bn(B,"bpmn:LinkEventDefinition")?s("bpmn:LinkEventDefinition")(b,T,V):Bn(B,"bpmn:ErrorEventDefinition")?s("bpmn:ErrorEventDefinition")(b,T,V):Bn(B,"bpmn:CancelEventDefinition")?s("bpmn:CancelEventDefinition")(b,T,V):Bn(B,"bpmn:CompensateEventDefinition")?s("bpmn:CompensateEventDefinition")(b,T,V):Bn(B,"bpmn:TerminateEventDefinition")?s("bpmn:TerminateEventDefinition")(b,T,V):null}function m(T,b,B){B=z({size:{width:100}},B);var V=o.createText(b||"",B);return Ce(V).add("djs-label"),pe(T,V),V}function C(T,b,B){return m(T,Pt(b).name,{box:b,align:B,padding:5,style:{fill:qo(b,u,l)}})}function R(T,b,B){yu(m(T,b,{box:{height:30,width:B.height},align:"center-middle",style:{fill:qo(B,u,l)}}),0,-(-1*B.height),270)}function I(T){for(var b=T.waypoints,B="m  "+b[0].x+","+b[0].y,V=1;V<b.length;V++)B+="L"+b[V].x+","+b[V].y+" ";return B}var N=this.handlers={"bpmn:Event":function(T,b,B){return"fillOpacity"in B||(B.fillOpacity=Zr),x(T,b.width,b.height,B)},"bpmn:StartEvent":function(T,b){var B={fill:Te(b,c),stroke:te(b,l)};Pt(b).isInterrupting||(B={strokeDasharray:"6",strokeLinecap:"round",fill:Te(b,c),stroke:te(b,l)});var V=s("bpmn:Event")(T,b,B);return d(b,T),V},"bpmn:MessageEventDefinition":function(T,b,B){return w(T,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:b.width,containerHeight:b.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:B?te(b,l):Te(b,c),stroke:B?Te(b,c):te(b,l)})},"bpmn:TimerEventDefinition":function(T,b){var B=x(T,b.width,b.height,.2*b.height,{strokeWidth:2,fill:Te(b,c),stroke:te(b,l)});w(T,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:b.width,containerHeight:b.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:te(b,l)});for(var V=0;V<12;V++){var H=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:b.width,containerHeight:b.height,position:{mx:.5,my:.5}}),q=b.width/2;w(T,H,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*V+","+b.height/2+","+q+")",stroke:te(b,l)})}return B},"bpmn:EscalationEventDefinition":function(T,b,B){return w(T,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:B?te(b,l):"none",stroke:te(b,l)})},"bpmn:ConditionalEventDefinition":function(T,b){return w(T,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:te(b,l)})},"bpmn:LinkEventDefinition":function(T,b,B){return w(T,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:B?te(b,l):"none",stroke:te(b,l)})},"bpmn:ErrorEventDefinition":function(T,b,B){return w(T,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:b.width,containerHeight:b.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:B?te(b,l):"none",stroke:te(b,l)})},"bpmn:CancelEventDefinition":function(T,b,B){var V=w(T,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:B?te(b,l):"none",stroke:te(b,l)});return Wm(V,45),V},"bpmn:CompensateEventDefinition":function(T,b,B){return w(T,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:B?te(b,l):"none",stroke:te(b,l)})},"bpmn:SignalEventDefinition":function(T,b,B){return w(T,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:b.width,containerHeight:b.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:B?te(b,l):"none",stroke:te(b,l)})},"bpmn:MultipleEventDefinition":function(T,b,B){return w(T,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:b.width,containerHeight:b.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:B?te(b,l):"none"})},"bpmn:ParallelMultipleEventDefinition":function(T,b){return w(T,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:b.width,containerHeight:b.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:te(b,l),stroke:te(b,l)})},"bpmn:EndEvent":function(T,b){var B=s("bpmn:Event")(T,b,{strokeWidth:4,fill:Te(b,c),stroke:te(b,l)});return d(b,T),B},"bpmn:TerminateEventDefinition":function(T,b){return x(T,b.width,b.height,8,{strokeWidth:4,fill:te(b,l),stroke:te(b,l)})},"bpmn:IntermediateEvent":function(T,b){var B=s("bpmn:Event")(T,b,{strokeWidth:1,fill:Te(b,c),stroke:te(b,l)});return x(T,b.width,b.height,3,{strokeWidth:1,fill:Te(b,"none"),stroke:te(b,l)}),d(b,T),B},"bpmn:IntermediateCatchEvent":D("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":D("bpmn:IntermediateEvent"),"bpmn:Activity":function(T,b,B){return"fillOpacity"in(B=B||{})||(B.fillOpacity=Zr),E(T,b.width,b.height,10,B)},"bpmn:Task":function(T,b){var B={fill:Te(b,c),stroke:te(b,l)},V=s("bpmn:Activity")(T,b,B);return C(T,b,"center-middle"),L(T,b),V},"bpmn:ServiceTask":function(T,b){var B=s("bpmn:Task")(T,b);return w(T,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:Te(b,c),stroke:te(b,l)}),w(T,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:Te(b,c)}),w(T,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:Te(b,c),stroke:te(b,l)}),B},"bpmn:UserTask":function(T,b){var B=s("bpmn:Task")(T,b);return w(T,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Te(b,c),stroke:te(b,l)}),w(T,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Te(b,c),stroke:te(b,l)}),w(T,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:te(b,l),stroke:te(b,l)}),B},"bpmn:ManualTask":function(T,b){var B=s("bpmn:Task")(T,b);return w(T,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:Te(b,c),stroke:te(b,l)}),B},"bpmn:SendTask":function(T,b){var B=s("bpmn:Task")(T,b);return w(T,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:te(b,l),stroke:Te(b,c)}),B},"bpmn:ReceiveTask":function(T,b){var B,V=Pt(b),H=s("bpmn:Task")(T,b);return V.instantiate?(x(T,28,28,4.4,{strokeWidth:1}),B=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):B=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),w(T,B,{strokeWidth:1,fill:Te(b,c),stroke:te(b,l)}),H},"bpmn:ScriptTask":function(T,b){var B=s("bpmn:Task")(T,b);return w(T,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:te(b,l)}),B},"bpmn:BusinessRuleTask":function(T,b){var B=s("bpmn:Task")(T,b);return W(w(T,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:Te(b,"#aaaaaa"),stroke:te(b,l)}),W(w(T,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:te(b,l)}),B},"bpmn:SubProcess":function(T,b,B){B=z({fill:Te(b,c),stroke:te(b,l)},B);var V=s("bpmn:Activity")(T,b,B),H=Oe(b);return Ft(b)&&W(V,{strokeDasharray:"1,2"}),C(T,b,H?"center-top":"center-middle"),H?L(T,b):L(T,b,["SubProcessMarker"]),V},"bpmn:AdHocSubProcess":function(T,b){return s("bpmn:SubProcess")(T,b)},"bpmn:Transaction":function(T,b){var B=s("bpmn:SubProcess")(T,b),V=n.style(["no-fill","no-events"],{stroke:te(b,l)});return E(T,b.width,b.height,8,3,V),B},"bpmn:CallActivity":function(T,b){return s("bpmn:SubProcess")(T,b,{strokeWidth:5})},"bpmn:Participant":function(T,b){var B={fillOpacity:Zr,fill:Te(b,c),stroke:te(b,l)},V=s("bpmn:Lane")(T,b,B);return Oe(b)?(_(T,[{x:30,y:0},{x:30,y:b.height}],{stroke:te(b,l)}),R(T,Pt(b).name,b)):m(T,Pt(b).name,{box:b,align:"center-middle",style:{fill:qo(b,u,l)}}),Pt(b).participantMultiplicity&&s("ParticipantMultiplicityMarker")(T,b),V},"bpmn:Lane":function(T,b,B){var V=E(T,b.width,b.height,0,z({fill:Te(b,c),fillOpacity:.35,stroke:te(b,l)},B)),H=Pt(b);return H.$type==="bpmn:Lane"&&R(T,H.name,b),V},"bpmn:InclusiveGateway":function(T,b){var B=s("bpmn:Gateway")(T,b);return x(T,b.width,b.height,.24*b.height,{strokeWidth:2.5,fill:Te(b,c),stroke:te(b,l)}),B},"bpmn:ExclusiveGateway":function(T,b){var B=s("bpmn:Gateway")(T,b),V=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:b.width,containerHeight:b.height,position:{mx:.32,my:.3}});return Jr(b).isMarkerVisible&&w(T,V,{strokeWidth:1,fill:te(b,l),stroke:te(b,l)}),B},"bpmn:ComplexGateway":function(T,b){var B=s("bpmn:Gateway")(T,b);return w(T,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:b.width,containerHeight:b.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:te(b,l),stroke:te(b,l)}),B},"bpmn:ParallelGateway":function(T,b){var B=s("bpmn:Gateway")(T,b);return w(T,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:b.width,containerHeight:b.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:te(b,l),stroke:te(b,l)}),B},"bpmn:EventBasedGateway":function(T,b){var B=Pt(b),V=s("bpmn:Gateway")(T,b);x(T,b.width,b.height,.2*b.height,{strokeWidth:1,fill:"none",stroke:te(b,l)});var H=B.eventGatewayType,q=!!B.instantiate;if(H==="Parallel"){var J=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:b.width,containerHeight:b.height,position:{mx:.474,my:.296}});W(w(T,J),{strokeWidth:1,fill:"none"})}else H==="Exclusive"&&(q||W(x(T,b.width,b.height,.26*b.height),{strokeWidth:1,fill:"none",stroke:te(b,l)}),function(){var Q=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:b.width,containerHeight:b.height,position:{mx:.36,my:.44}}),oe={strokeWidth:2,fill:Te(b,"none"),stroke:te(b,l)};w(T,Q,oe)}());return V},"bpmn:Gateway":function(T,b){var B={fill:Te(b,c),fillOpacity:Zr,stroke:te(b,l)};return function(V,H,q,J){var Q=H/2,oe=q/2,ie=[{x:Q,y:0},{x:H,y:oe},{x:Q,y:q},{x:0,y:oe}].map(function(Ne){return Ne.x+","+Ne.y}).join(" ");J=v(J,{stroke:"black",strokeWidth:2,fill:"white"});var he=se("polygon");return W(he,{points:ie}),W(he,J),pe(V,he),he}(T,b.width,b.height,B)},"bpmn:SequenceFlow":function(T,b){var B,V=I(b),H=Te(b,c),q=te(b,l),J=w(T,V,{strokeLinejoin:"round",markerEnd:g("sequenceflow-end",H,q),stroke:te(b,l)}),Q=Pt(b);return b.source&&(B=b.source.businessObject,Q.conditionExpression&&B.$instanceOf("bpmn:Activity")&&W(J,{markerStart:g("conditional-flow-marker",H,q)}),B.default&&(B.$instanceOf("bpmn:Gateway")||B.$instanceOf("bpmn:Activity"))&&B.default===Q&&W(J,{markerStart:g("conditional-default-flow-marker",H,q)})),J},"bpmn:Association":function(T,b,B){var V=Pt(b),H=Te(b,c),q=te(b,l);return B=z({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:te(b,l)},B||{}),V.associationDirection!=="One"&&V.associationDirection!=="Both"||(B.markerEnd=g("association-end",H,q)),V.associationDirection==="Both"&&(B.markerStart=g("association-start",H,q)),_(T,b.waypoints,B)},"bpmn:DataInputAssociation":function(T,b){var B=Te(b,c),V=te(b,l);return s("bpmn:Association")(T,b,{markerEnd:g("association-end",B,V)})},"bpmn:DataOutputAssociation":function(T,b){var B=Te(b,c),V=te(b,l);return s("bpmn:Association")(T,b,{markerEnd:g("association-end",B,V)})},"bpmn:MessageFlow":function(T,b){var B=Pt(b),V=Jr(b),H=Te(b,c),q=te(b,l),J=w(T,I(b),{markerEnd:g("messageflow-end",H,q),markerStart:g("messageflow-start",H,q),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:te(b,l)});if(B.messageRef){var Q=J.getPointAtLength(J.getTotalLength()/2),oe=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:Q.x,y:Q.y}}),ie={strokeWidth:1};V.messageVisibleKind==="initiating"?(ie.fill="white",ie.stroke="black"):(ie.fill="#888",ie.stroke="white");var he=w(T,oe,ie),Ne=m(T,B.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:te(b,u)}}),ee=he.getBBox(),Z=Ne.getBBox();yu(Ne,Q.x-Z.width/2,Q.y+ee.height/2+10,0)}return J},"bpmn:DataObject":function(T,b){var B=w(T,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:.474,my:.296}}),{fill:Te(b,c),fillOpacity:Zr,stroke:te(b,l)});return function(V){var H=V.dataObjectRef;return V.isCollection||H&&H.isCollection}(Pt(b))&&function(V,H){var q=(H.height-18)/H.height,J=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:H.width,containerHeight:H.height,position:{mx:.33,my:q}});w(V,J,{strokeWidth:2})}(T,b),B},"bpmn:DataObjectReference":D("bpmn:DataObject"),"bpmn:DataInput":function(T,b){var B=i.getRawPath("DATA_ARROW"),V=s("bpmn:DataObject")(T,b);return w(T,B,{strokeWidth:1}),V},"bpmn:DataOutput":function(T,b){var B=i.getRawPath("DATA_ARROW"),V=s("bpmn:DataObject")(T,b);return w(T,B,{strokeWidth:1,fill:"black"}),V},"bpmn:DataStoreReference":function(T,b){return w(T,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:Te(b,c),fillOpacity:Zr,stroke:te(b,l)})},"bpmn:BoundaryEvent":function(T,b){var B=Pt(b).cancelActivity,V={strokeWidth:1,fill:Te(b,c),stroke:te(b,l)};B||(V.strokeDasharray="6",V.strokeLinecap="round");var H=z({},V,{fillOpacity:1}),q=z({},V,{fill:"none"}),J=s("bpmn:Event")(T,b,H);return x(T,b.width,b.height,3,q),d(b,T),J},"bpmn:Group":function(T,b){return E(T,b.width,b.height,10,{stroke:te(b,l),strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(T,b){return function(B,V){var H={width:90,height:30,x:V.width/2+V.x,y:V.height/2+V.y};return m(B,gn(V),{box:H,fitBox:!0,style:z({},o.getExternalStyle(),{fill:qo(V,u,l)})})}(T,b)},"bpmn:TextAnnotation":function(T,b){var B=E(T,b.width,b.height,0,0,{fill:"none",stroke:"none"});return w(T,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:0,my:0}}),{stroke:te(b,l)}),m(T,Pt(b).text||"",{box:b,align:"left-top",padding:5,style:{fill:qo(b,u,l)}}),B},ParticipantMultiplicityMarker:function(T,b){S("participant-multiplicity",T,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:b.width/2/b.width,my:(b.height-15)/b.height}}),{strokeWidth:2,fill:Te(b,c),stroke:te(b,l)})},SubProcessMarker:function(T,b){Lt(E(T,14,14,0,{strokeWidth:1,fill:Te(b,c),stroke:te(b,l)}),b.width/2-7.5,b.height-20),S("sub-process",T,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:b.width,containerHeight:b.height,position:{mx:(b.width/2-7.5)/b.width,my:(b.height-20)/b.height}}),{fill:Te(b,c),stroke:te(b,l)})},ParallelMarker:function(T,b,B){S("parallel",T,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:(b.width/2+B.parallel)/b.width,my:(b.height-20)/b.height}}),{fill:Te(b,c),stroke:te(b,l)})},SequentialMarker:function(T,b,B){S("sequential",T,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:(b.width/2+B.seq)/b.width,my:(b.height-19)/b.height}}),{fill:Te(b,c),stroke:te(b,l)})},CompensationMarker:function(T,b,B){S("compensation",T,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:(b.width/2+B.compensation)/b.width,my:(b.height-13)/b.height}}),{strokeWidth:1,fill:Te(b,c),stroke:te(b,l)})},LoopMarker:function(T,b,B){S("loop",T,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:(b.width/2+B.loop)/b.width,my:(b.height-7)/b.height}}),{strokeWidth:1,fill:Te(b,c),stroke:te(b,l),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(T,b,B){S("adhoc",T,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:b.width,containerHeight:b.height,position:{mx:(b.width/2+B.adhoc)/b.width,my:(b.height-15)/b.height}}),{strokeWidth:1,fill:te(b,l),stroke:te(b,l)})}};function L(T,b,B){var V,H=Pt(b),q=B&&B.indexOf("SubProcessMarker")!==-1;V=q?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},F(B,function(oe){s(oe)(T,b,V)}),H.isForCompensation&&s("CompensationMarker")(T,b,V),H.$type==="bpmn:AdHocSubProcess"&&s("AdhocMarker")(T,b,V);var J=H.loopCharacteristics,Q=J&&J.isSequential;J&&(Q===void 0&&s("LoopMarker")(T,b,V),Q===!1&&s("ParallelMarker")(T,b,V),Q===!0&&s("SequentialMarker")(T,b,V))}this._drawPath=w}ae(ir,Wn),ir.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],ir.prototype.canRender=function(e){return A(e,"bpmn:BaseElement")},ir.prototype.drawShape=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},ir.prototype.drawConnection=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},ir.prototype.getShapePath=function(e){return A(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,Vr([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):A(e,"bpmn:Activity")?function(o,a){var c=o.x,l=o.y,u=o.width,p=o.height;return Vr([["M",c+a,l],["l",u-2*a,0],["a",a,a,0,0,1,a,a],["l",0,p-2*a],["a",a,a,0,0,1,-a,a],["l",2*a-u,0],["a",a,a,0,0,1,-a,-a],["l",0,2*a-p],["a",a,a,0,0,1,a,-a],["z"]])}(e,10):A(e,"bpmn:Gateway")?function(o){var a=o.width/2,c=o.height/2;return Vr([["M",o.x+a,o.y],["l",a,c],["l",-a,c],["l",-a,-c],["z"]])}(e):function(o){var a=o.x,c=o.y,l=o.width;return Vr([["M",a,c],["l",l,0],["l",0,o.height],["l",-l,0],["z"]])}(e);var t,n,i,r};var _w=0,Sw={width:150,height:50};function Cw(e,t){var n;t.textContent=e;try{var i,r=e==="";return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch{return{width:0,height:0}}}function Tw(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=Cw(o,n)).width=o?i.width:0,o===" "||o===""||i.width<Math.round(t)||o.length<2)return Aw(e,o,r,i);o=kw(o,i.width,t)}}function Aw(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}var Sf="\xAD";function kw(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(o,a){var c,l=o.split(/(\s|-|\u00AD)/g),u=[],p=0;if(l.length>1)for(;c=l.shift();){if(!(c.length+p<a)){c!=="-"&&c!==Sf||u.pop();break}u.push(c),p+=c.length}var h=u[u.length-1];return h&&h===Sf&&(u[u.length-1]="-"),u.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function As(e){this._config=z({},{size:Sw,padding:_w,style:{},align:"center-top"},e||{})}As.prototype.createText=function(e,t){return this.layoutText(e,t).element},As.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},As.prototype.layoutText=function(e,t){var n=z({},this._config.size,t.box),i=z({},this._config.style,t.style),r=function(x){var E=x.split("-");return{horizontal:E[0]||"center",vertical:E[1]||"top"}}(t.align||this._config.align),o=function(x){return Tt(x)?z({top:0,left:0,right:0,bottom:0},x):{top:x,left:x,right:x,bottom:x}}(t.padding!==void 0?t.padding:this._config.padding),a=t.fitBox||!1,c=function(x){if("fontSize"in x&&"lineHeight"in x)return x.lineHeight*parseInt(x.fontSize,10)}(i),l=e.split(/\u00AD?\r?\n/),u=[],p=n.width-o.left-o.right,h=se("text");for(W(h,{x:0,y:0}),W(h,i),pe(function(){var x=document.getElementById("helper-svg");return x||(W(x=se("svg"),{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(x)),x}(),h);l.length;)u.push(Tw(l,p,h));r.vertical==="middle"&&(o.top=o.bottom=0);var v=Gt(u,function(x,E,_){return x+(c||E.height)},0)+o.top+o.bottom,f=Gt(u,function(x,E,_){return E.width>x?E.width:x},0),y=o.top;r.vertical==="middle"&&(y+=(n.height-v)/2),y-=(c||u[0].height)/4;var g=se("text");return W(g,i),F(u,function(x){var E;switch(y+=c||x.height,r.horizontal){case"left":E=o.left;break;case"right":E=(a?f:p)-o.right-x.width;break;default:E=Math.max(((a?f:p)-x.width)/2+o.left,0)}var _=se("tspan");W(_,{x:E,y}),_.textContent=x.text,pe(g,_)}),it(h),{dimensions:{width:f,height:v},element:g}};function Cf(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 As({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}}Cf.$inject=["config.textRenderer"];var Pw=/\{([^{}]+)\}/g,Mw=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const Rw={__init__:["bpmnRenderer"],bpmnRenderer:["type",ir],textRenderer:["type",Cf],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<r.heightElements.length;l++)o["y"+l]=r.heightElements[l]*a;for(var u=0;u<r.widthElements.length;u++)o["x"+u]=r.widthElements[u]*c}var p,h,v=(p=r.d,h={mx:n,my:i,e:o},String(p).replace(Pw,function(f,y){return function(g,x,E){var _=E;return x.replace(Mw,function(w,S,D,s,d){S=S||s,_&&(S in _&&(_=_[S]),typeof _=="function"&&d&&(_=_()))}),_=(_==null||_==E?g:_)+""}(f,y,h)}));return v}}]},ks={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(n,i){return t[i]||"{"+i+"}"})}]};var Wo={width:90,height:20},Tf=15;function Qr(e){return A(e,"bpmn:Event")||A(e,"bpmn:Gateway")||A(e,"bpmn:DataStoreReference")||A(e,"bpmn:DataObjectReference")||A(e,"bpmn:DataInput")||A(e,"bpmn:DataOutput")||A(e,"bpmn:SequenceFlow")||A(e,"bpmn:MessageFlow")||A(e,"bpmn:Group")}function Ps(e){return wt(e.label)}function Nw(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(l){var u=l.length/2-1,p=l[Math.floor(u)],h=l[Math.ceil(u+.01)];return{x:p.x+(h.x-p.x)/2,y:p.y+(h.y-p.y)/2}}(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,c=r.y;return Math.abs(o)<Math.PI/2?c-=Tf:a+=Tf,{x:a,y:c}}function Ms(e){return e.waypoints?Nw(e.waypoints):A(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Wo.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Wo.height/2}}function wt(e){return e&&!!e.labelTarget}function Rs(e,t){return z({id:e.id,type:e.$type,businessObject:e},t)}function Iw(e,t,n){var i=e.di.waypoint;return!i||i.length<2?[ge(t),ge(n)]:i.map(function(r){return{x:r.x,y:r.y}})}function Af(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:Et(n),referenced:Et(t),property:i}))}function Jn(e,t,n,i,r,o){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}Jn.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],Jn.prototype.add=function(e,t){var n,i,r,o,a,c,l,u=e.di,p=this._translate;if(A(u,"bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(Rs(e)),this._canvas.setRootElement(n);else if(A(u,"bpmndi:BPMNShape")){var h=!Oe(e),v=function(x){return A(x,"bpmn:Group")}(e);i=t&&(t.hidden||t.collapsed);var f=e.di.bounds;n=this._elementFactory.createShape(Rs(e,{collapsed:h,hidden:i,x:Math.round(f.x),y:Math.round(f.y),width:Math.round(f.width),height:Math.round(f.height),isFrame:v})),A(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,n),A(e,"bpmn:Lane")&&(r=0),A(e,"bpmn:DataStoreReference")&&(o=t,a=ge(f),c=a.x,l=a.y,c>=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:Et(u),semantic:Et(e)}));var y=this._getSource(e),g=this._getTarget(e);i=t&&(t.hidden||t.collapsed),n=this._elementFactory.createConnection(Rs(e,{hidden:i,source:y,target:g,waypoints:Iw(e,y,g)})),A(e,"bpmn:DataAssociation")&&(t=null),A(e,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,t,r)}return Qr(e)&&gn(n)&&this.addLabel(e,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},Jn.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Et(e)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw Af(n,e,i,"attachedToRef");t.host=r,o||(r.attachers=o=[]),o.indexOf(t)===-1&&o.push(t)},Jn.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(Wo.width,u.width),height:u.height},c={x:u.x+u.width/2,y:u.y+u.height/2}):(c=Ms(a),l=Wo),z({x:c.x-l.width/2,y:c.y-l.height/2},l)}(e,t),(i=gn(t))&&(n=this._textRenderer.getExternalLabelBounds(n,i)),r=this._elementFactory.createLabel(Rs(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden||!gn(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)},Jn.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?Af(o,e,i,t+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:Et(e),side:t}))},Jn.prototype._getSource=function(e){return this._getEnd(e,"source")},Jn.prototype._getTarget=function(e){return this._getEnd(e,"target")},Jn.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};const Dw={__depends__:[Rw,{__depends__:[ks],bpmnImporter:["type",Jn]}]};function kf(e){e&&typeof e.stopPropagation=="function"&&e.stopPropagation()}function eo(e){return e.originalEvent||e.srcEvent}function Du(e,t){kf(e),kf(eo(e))}function Ti(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 Pf(e,t){return(eo(e)||e).button===t}function Ai(e){return Pf(e,0)}function to(e){var t=eo(e)||e;return!!Ai(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function Mf(e){var t=eo(e)||e;return Ai(e)&&t.shiftKey}function Bw(e){return!0}function Ns(e){return Ai(e)||function(t){return Pf(t,1)}(e)}function Rf(e,t,n){var i=this;function r(_,w,S){var D,s;(function(d,m){var C=l[d]||Ai;return!C(m)})(_,w)||(S?s=t.getGraphics(S):(D=w.delegateTarget||w.target)&&(s=D,S=t.get(s)),s&&S&&e.fire(_,{element:S,gfx:s,originalEvent:w})===!1&&(w.stopPropagation(),w.preventDefault()))}var o={};function a(_){return o[_]}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":Bw,"element.mousedown":Ns,"element.mouseup":Ns,"element.click":Ns,"element.dblclick":Ns},u="svg, .djs-element";function p(_,w,S,D){var s=o[S]=function(d){r(S,d)};D&&(l[S]=D),s.$delegate=Ht.bind(_,u,w,s)}function h(_,w,S){var D=a(S);D&&Ht.unbind(_,w,D.$delegate)}e.on("canvas.destroy",function(_){(function(w){F(c,function(S,D){h(w,D,S)})})(_.svg)}),e.on("canvas.init",function(_){(function(w){F(c,function(S,D){p(w,D,S)})})(_.svg)}),e.on(["shape.added","connection.added"],function(_){var w=_.element,S=_.gfx;e.fire("interactionEvents.createHit",{element:w,gfx:S})}),e.on(["shape.changed","connection.changed"],500,function(_){var w=_.element,S=_.gfx;e.fire("interactionEvents.updateHit",{element:w,gfx:S})}),e.on("interactionEvents.createHit",500,function(_){var w=_.element,S=_.gfx;i.createDefaultHit(w,S)}),e.on("interactionEvents.updateHit",function(_){var w=_.element,S=_.gfx;i.updateDefaultHit(w,S)});var v=g("djs-hit djs-hit-stroke"),f=g("djs-hit djs-hit-click-stroke"),y={all:g("djs-hit djs-hit-all"),"click-stroke":f,stroke:v};function g(_,w){return w=z({stroke:"white",strokeWidth:15},w||{}),n.cls(_,["no-fill","no-border"],w)}function x(_,w){var S=y[w];if(!S)throw new Error("invalid hit type <"+w+">");return W(_,S),_}function E(_,w){pe(_,w)}this.removeHits=function(_){F(Jl(".djs-hit",_),it)},this.createDefaultHit=function(_,w){var S,D=_.waypoints,s=_.isFrame;return D?this.createWaypointsHit(w,D):(S=s?"stroke":"all",this.createBoxHit(w,S,{width:_.width,height:_.height}))},this.createWaypointsHit=function(_,w){var S=su(w);return x(S,"stroke"),E(_,S),S},this.createBoxHit=function(_,w,S){S=z({x:0,y:0},S);var D=se("rect");return x(D,w),W(D,S),E(_,D),D},this.updateDefaultHit=function(_,w){var S=Ye(".djs-hit",w);if(S)return _.waypoints?function(D,s){W(D,{points:mm(s)})}(S,_.waypoints):W(S,{width:_.width,height:_.height}),S},this.fire=r,this.triggerMouseEvent=function(_,w,S){var D=c[_];if(!D)throw new Error("unmapped DOM event name <"+_+">");return r(D,w,S)},this.mouseHandler=a,this.registerEvent=p,this.unregisterEvent=h}Rf.$inject=["eventBus","elementRegistry","styles"];const Ko={__init__:["interactionEvents"],interactionEvents:["type",Rf]};function Is(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function o(a,c){var l=se("rect");return W(l,z({x:10,y:10,width:100,height:100},i)),pe(a,l),l}e.on(["shape.added","shape.changed"],500,function(a){var c=a.element,l=a.gfx,u=Ye(".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=Ye(".djs-outline",l);u||(u=o(l)),r.updateConnectionOutline(u,c)})}Is.prototype.updateShapeOutline=function(e,t){W(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Is.prototype.updateConnectionOutline=function(e,t){var n=gt(t);W(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Is.$inject=["eventBus","styles","elementRegistry"];const Nf={__init__:["outline"],outline:["type",Is]};function no(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)})}no.$inject=["eventBus","canvas"],no.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})}},no.prototype.get=function(){return this._selectedElements},no.prototype.isSelected=function(e){return this._selectedElements.indexOf(e)!==-1},no.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();Se(e)||(e=e?[e]:[]);var r=this._canvas;e=e.filter(function(o){return r.findPlane(o)===r.getActivePlane()}),t?F(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 If="hover",Df="selected";function Bf(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,If)}),e.on("element.out",function(a){o(a.element,If)}),e.on("selection.changed",function(a){var c=a.oldSelection,l=a.newSelection;F(c,function(u){l.indexOf(u)===-1&&o(u,Df)}),F(l,function(u){c.indexOf(u)===-1&&r(u,Df)})})}function Of(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;Se(l)?t.select(l):t.select(c.filter(Ow))}}),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);je(o,function(c){return a.id===c.id})||t.select(a)}),e.on("element.click",function(r){if(Ai(r)){var o=r.element;o===n.getRootElement()&&(o=null);var a=t.isSelected(o),c=t.get().length>1,l=to(r)||Mf(r);if(a&&c)return l?t.deselect(o):t.select(o);a?t.deselect(o):t.select(o,l)}})}function Ow(e){return!e.hidden}Bf.$inject=["eventBus","canvas","selection","styles"],Of.$inject=["eventBus","selection","canvas","elementRegistry"];const On={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Ko,Nf],selection:["type",no],selectionVisuals:["type",Bf],selectionBehavior:["type",Of]};function Bu(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Bu.prototype.next=function(){return this._prefix+ ++this._counter};var jw=new Bu("ov");function mt(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=jw,this._overlayDefaults=z({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),o=ze('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(o,r.firstChild),o),this._init()}function jf(e,t,n){z(e.style,{left:t+"px",top:n+"px"})}function Xo(e,t){e.style.display=t===!1?"none":""}function Lf(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}mt.$inject=["config.overlays","eventBus","canvas","elementRegistry"],mt.prototype.get=function(e){if(Br(e)&&(e={id:e}),Br(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?Ee(t.overlays,fn({type:e.type})):t.overlays.slice():[]}return e.type?Ee(this._overlays,fn({type:e.type})):e.id?this._overlays[e.id]:null},mt.prototype.add=function(e,t,n){if(Tt(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},mt.prototype.remove=function(e){var t=this.get(e)||[];Se(t)||(t=[t]);var n=this;F(t,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(Nn(i.html),Nn(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)}})},mt.prototype.show=function(){Xo(this._overlayRoot)},mt.prototype.hide=function(){Xo(this._overlayRoot,!1)},mt.prototype.clear=function(){this._overlays={},this._overlayContainers=[],rs(this._overlayRoot)},mt.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=gt(t);i=o.x,r=o.y}jf(n,i,r),Ut(e.html,"data-container-id",t.id)},mt.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?gt(o).width:o.width,a=-1*i.right+t),i.bottom!==void 0&&(n=o.waypoints?gt(o).height:o.height,c=-1*i.bottom+n),jf(r,a||0,c||0)},mt.prototype._createOverlayContainer=function(e){var t=ze('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},mt.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Lf(this._overlayRoot,n)},mt.prototype._getOverlayContainer=function(e,t){var n=je(this._overlayContainers,function(i){return i.element===e});return n||t?n:this._createOverlayContainer(e)},mt.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)),Br(o)&&(o=ze(o)),n=this._getOverlayContainer(r),(t=ze('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(o),e.type&&ct(t).add("djs-overlay-"+e.type);var a=this._canvas.findPlane(r),c=this._canvas.getActivePlane();e.plane=a,a!==c&&Xo(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())},mt.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&&(Mn(r)&&r>t.scale||Mn(o)&&o<t.scale))&&(c=!1),Xo(a,c),this._updateOverlayScale(e,t)},mt.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,a=e.htmlContainer,c="";o!==!0&&(o===!1?(n=1,i=1):(n=o.min,i=o.max),Mn(n)&&t.scale<n&&(r=(1/t.scale||1)*n),Mn(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),Mn(r)&&(c="scale("+r+","+r+")"),Lf(a,c)},mt.prototype._updateOverlaysVisibilty=function(e){var t=this;F(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},mt.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;F(t.get({element:i}),function(a){t.remove(a.id)});var r=t._getOverlayContainer(i);if(r){Nn(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&&(F(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&&ct(i.html)[n.add?"add":"remove"](n.marker)}),e.on("plane.set",function(n){F(t._overlays,function(i){Xo(i.htmlContainer,i.plane===n.plane)})}),e.on("diagram.clear",this.clear,this)};const Ou={__init__:["overlays"],overlays:["type",mt]};function Zn(e){We.call(this,e)}ae(Zn,We),Zn.prototype._modules=[Dw,ks,On,Ou],Zn.prototype._moddleExtensions={};var Lw=["c","C",67],Vw=["v","V",86],Fw=["y","Y",89],Vf=["z","Z",90];function Kt(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function bn(e,t){return(e=Se(e)?e:[e]).indexOf(t.key)!==-1||e.indexOf(t.keyCode)!==-1}function ju(e){return e.shiftKey}var Ds="keyboard.keydown",Ff="input-handle-modified-keys";function ft(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()})}ft.$inject=["config.keyboard","eventBus"],ft.prototype._keydownHandler=function(e){this._keyHandler(e,Ds)},ft.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},ft.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Ds,n)&&e.preventDefault()}},ft.prototype._isEventIgnored=function(e){return(t=e.target)&&(os(t,"input, textarea")||t.contentEditable==="true")&&this._isModifiedKeyIgnored(e);var t},ft.prototype._isModifiedKeyIgnored=function(e){return!Kt(e)||!this._getAllowedModifiers(e.target).includes(e.key)},ft.prototype._getAllowedModifiers=function(e){var t=Ji(e,"["+Ff+"]",!0);return!t||this._node&&!this._node.contains(t)?[]:t.getAttribute(Ff).split(",")},ft.prototype.bind=function(e){this.unbind(),this._node=e,le.bind(e,"keydown",this._keydownHandler,!0),le.bind(e,"keyup",this._keyupHandler,!0),this._fire("bind")},ft.prototype.getBinding=function(){return this._node},ft.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),le.unbind(e,"keydown",this._keydownHandler,!0),le.unbind(e,"keyup",this._keyupHandler,!0)),this._node=null},ft.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},ft.prototype.addListener=function(e,t,n){At(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Ds,e,t)},ft.prototype.removeListener=function(e,t){this._eventBus.off(t||Ds,e)},ft.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},ft.prototype.isCmd=Kt,ft.prototype.isShift=ju,ft.prototype.isKey=bn;var $w=500;function io(e,t){var n=this;e.on("editorActions.init",$w,function(i){var r=i.editorActions;n.registerBindings(t,r)})}io.$inject=["eventBus","keyboard"],io.prototype.registerBindings=function(e,t){function n(i,r){t.isRegistered(i)&&e.addListener(r)}n("undo",function(i){if(function(r){return Kt(r)&&!ju(r)&&bn(Vf,r)}(i.keyEvent))return t.trigger("undo"),!0}),n("redo",function(i){if(function(r){return Kt(r)&&(bn(Fw,r)||bn(Vf,r)&&ju(r))}(i.keyEvent))return t.trigger("redo"),!0}),n("copy",function(i){if(function(r){return Kt(r)&&bn(Lw,r)}(i.keyEvent))return t.trigger("copy"),!0}),n("paste",function(i){if(function(r){return Kt(r)&&bn(Vw,r)}(i.keyEvent))return t.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(bn(["+","Add","="],r)&&Kt(r))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(bn(["-","Subtract"],r)&&Kt(r))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(bn("0",r)&&Kt(r))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){if(bn(["Backspace","Delete","Del"],i.keyEvent))return t.trigger("removeSelection"),!0})};const Lu={__init__:["keyboard","keyboardBindings"],keyboard:["type",ft],keyboardBindings:["type",io]};var zw={moveSpeed:50,moveSpeedAccelerated:200};function $f(e,t,n){var i=this;this._config=z({},zw,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})}}$f.$inject=["config.keyboardMove","keyboard","canvas"];const zf={__depends__:[Lu],__init__:["keyboardMove"],keyboardMove:["type",$f]};var Gw=/^djs-cursor-.*$/;function Bs(e){var t=ct(document.body);t.removeMatching(Gw),e&&t.add("djs-cursor-"+e)}function Gf(){Bs(null)}var Uw=5e3;function Uf(e,t){function n(){return!1}return t=t||"element.click",e.once(t,Uw,n),function(){e.off(t,n)}}function Yo(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function jn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Hf(e,t){var n;function i(o){var a,c=n.start,l=n.button,u=Ti(o),p=jn(u,c);!n.dragging&&(a=p,Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2))>15)&&(n.dragging=!0,l===0&&Uf(e),Bs("grab")),n.dragging&&(p=jn(u,n.last||n.start),t.scroll({dx:p.x,dy:p.y}),n.last=u),o.preventDefault()}function r(o){le.unbind(document,"mousemove",i),le.unbind(document,"mouseup",r),n=null,Gf()}e.on("element.mousedown",500,function(o){return function(a){if(!Ji(a.target,".djs-draggable")){var c=a.button;if(!(c>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:c,start:Ti(a)},le.bind(document,"mousemove",i),le.bind(document,"mouseup",r),!0}}(o.originalEvent)}),this.isActive=function(){return!!n}}Hf.$inject=["eventBus","canvas"];const qf={__init__:["moveCanvas"],moveCanvas:["type",Hf]};function Vu(e){return Math.log(e)/Math.log(10)}function Wf(e,t){var n=Vu(e.min),i=Vu(e.max);return(Math.abs(n)+Math.abs(i))/t}var Hw=Math.sign||function(e){return e>=0?1:-1},Fu={min:.2,max:4};function Ln(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=qn(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)})}Ln.$inject=["config.zoomScroll","eventBus","canvas"],Ln.prototype.scroll=function(e){this._canvas.scroll(e)},Ln.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Ln.prototype.zoom=function(e,t){var n=Wf(Fu,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Ln.prototype._handleWheel=function(e){if(!Ji(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))*Hw(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)}},Ln.prototype.stepZoom=function(e,t){var n=Wf(Fu,10);this._zoom(e,t,n)},Ln.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=Vu(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var c,l,u=Math.pow(10,a);i.zoom((c=Fu,l=u,Math.max(c.min,Math.min(c.max,l))),t)},Ln.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return e===void 0&&(e=!i),i!==e&&le[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Ln.prototype._init=function(e){this.toggle(e)};const Kf={__init__:["zoomScroll"],zoomScroll:["type",Ln]};function Jo(e){Zn.call(this,e)}ae(Jo,Zn),Jo.prototype._navigationModules=[zf,qf,Kf],Jo.prototype._modules=[].concat(Zn.prototype._modules,Jo.prototype._navigationModules);var Xf={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2016 Jorik Tangelder;
 * Licensed under the MIT license */(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,h=Date.now;function v(k,O,$){return setTimeout(w(k,$),O)}function f(k,O,$){return!!Array.isArray(k)&&(y(k,$[O],$),!0)}function y(k,O,$){var U;if(k)if(k.forEach)k.forEach(O,$);else if(k.length!==r)for(U=0;U<k.length;)O.call($,k[U],U,k),U++;else for(U in k)k.hasOwnProperty(U)&&O.call($,k[U],U,k)}function g(k,O,$){var U="DEPRECATED METHOD: "+O+`
`+$+` AT 
`;return function(){var K=new Error("get-stack-trace"),xe=K&&K.stack?K.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",$e=t.console&&(t.console.warn||t.console.log);return $e&&$e.call(t.console,U,xe),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),$=1;$<arguments.length;$++){var U=arguments[$];if(U!==r&&U!==null)for(var K in U)U.hasOwnProperty(K)&&(O[K]=U[K])}return O}:Object.assign;var x=g(function(k,O,$){for(var U=Object.keys(O),K=0;K<U.length;)(!$||$&&k[U[K]]===r)&&(k[U[K]]=O[U[K]]),K++;return k},"extend","Use `assign`."),E=g(function(k,O){return x(k,O,!0)},"merge","Use `assign`.");function _(k,O,$){var U,K=O.prototype;(U=k.prototype=Object.create(K)).constructor=k,U._super=K,$&&o(U,$)}function w(k,O){return function(){return k.apply(O,arguments)}}function S(k,O){return typeof k==l?k.apply(O&&O[0]||r,O):k}function D(k,O){return k===r?O:k}function s(k,O,$){y(R(O),function(U){k.addEventListener(U,$,!1)})}function d(k,O,$){y(R(O),function(U){k.removeEventListener(U,$,!1)})}function m(k,O){for(;k;){if(k==O)return!0;k=k.parentNode}return!1}function C(k,O){return k.indexOf(O)>-1}function R(k){return k.trim().split(/\s+/g)}function I(k,O,$){if(k.indexOf&&!$)return k.indexOf(O);for(var U=0;U<k.length;){if($&&k[U][$]==O||!$&&k[U]===O)return U;U++}return-1}function N(k){return Array.prototype.slice.call(k,0)}function L(k,O,$){for(var U=[],K=[],xe=0;xe<k.length;){var $e=k[xe][O];I(K,$e)<0&&U.push(k[xe]),K[xe]=$e,xe++}return U=U.sort(function(yt,Me){return yt[O]>Me[O]})}function T(k,O){for(var $,U,K=O[0].toUpperCase()+O.slice(1),xe=0;xe<a.length;){if((U=($=a[xe])?$+K:O)in k)return U;xe++}return r}var b=1;function B(k){var O=k.ownerDocument||k;return O.defaultView||O.parentWindow||t}var V="ontouchstart"in t,H=T(t,"PointerEvent")!==r,q=V&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),J="touch",Q="mouse",oe=25,ie=1,he=4,Ne=8,ee=1,Z=2,_e=4,Ve=8,ye=16,Ue=Z|_e,Xe=Ve|ye,Ie=Ue|Xe,pt=["x","y"],ke=["clientX","clientY"];function He(k,O){var $=this;this.manager=k,this.callback=O,this.element=k.element,this.target=k.options.inputTarget,this.domHandler=function(U){S(k.options.enable,[k])&&$.handler(U)},this.init()}function me(k,O,$){var U=$.pointers.length,K=$.changedPointers.length,xe=O&ie&&U-K==0,$e=O&(he|Ne)&&U-K==0;$.isFirst=!!xe,$.isFinal=!!$e,xe&&(k.session={}),$.eventType=O,function(yt,Me){var Ct=yt.session,Za=Me.pointers,Ch=Za.length;Ct.firstInput||(Ct.firstInput=Fe(Me)),Ch>1&&!Ct.firstMultiple?Ct.firstMultiple=Fe(Me):Ch===1&&(Ct.firstMultiple=!1);var Th=Ct.firstInput,Sr=Ct.firstMultiple,Ah=Sr?Sr.center:Th.center,kh=Me.center=ci(Za);Me.timeStamp=h(),Me.deltaTime=Me.timeStamp-Th.timeStamp,Me.angle=ln(Ah,kh),Me.distance=vt(Ah,kh),function(pn,dt){var pi=dt.center,qi=pn.offsetDelta||{},Wi=pn.prevDelta||{},Ki=pn.prevInput||{};dt.eventType!==ie&&Ki.eventType!==he||(Wi=pn.prevDelta={x:Ki.deltaX||0,y:Ki.deltaY||0},qi=pn.offsetDelta={x:pi.x,y:pi.y}),dt.deltaX=Wi.x+(pi.x-qi.x),dt.deltaY=Wi.y+(pi.y-qi.y)}(Ct,Me),Me.offsetDirection=Je(Me.deltaX,Me.deltaY);var Cr=Ui(Me.deltaTime,Me.deltaX,Me.deltaY);Me.overallVelocityX=Cr.x,Me.overallVelocityY=Cr.y,Me.overallVelocity=p(Cr.x)>p(Cr.y)?Cr.x:Cr.y,Me.scale=Sr?(Dl=Sr.pointers,Bl=Za,vt(Bl[0],Bl[1],ke)/vt(Dl[0],Dl[1],ke)):1,Me.rotation=Sr?function(pn,dt){return ln(dt[1],dt[0],ke)+ln(pn[1],pn[0],ke)}(Sr.pointers,Za):0,Me.maxPointers=Ct.prevInput?Me.pointers.length>Ct.prevInput.maxPointers?Me.pointers.length:Ct.prevInput.maxPointers:Me.pointers.length,function(pn,dt){var pi,qi,Wi,Ki,di=pn.lastInterval||dt,Ph=dt.timeStamp-di.timeStamp;if(dt.eventType!=Ne&&(Ph>oe||di.velocity===r)){var Mh=dt.deltaX-di.deltaX,Rh=dt.deltaY-di.deltaY,Tr=Ui(Ph,Mh,Rh);qi=Tr.x,Wi=Tr.y,pi=p(Tr.x)>p(Tr.y)?Tr.x:Tr.y,Ki=Je(Mh,Rh),pn.lastInterval=dt}else pi=di.velocity,qi=di.velocityX,Wi=di.velocityY,Ki=di.direction;dt.velocity=pi,dt.velocityX=qi,dt.velocityY=Wi,dt.direction=Ki}(Ct,Me);var Dl,Bl,Ol=yt.element;m(Me.srcEvent.target,Ol)&&(Ol=Me.srcEvent.target),Me.target=Ol}(k,$),k.emit("hammer.input",$),k.recognize($),k.session.prevInput=$}function Fe(k){for(var O=[],$=0;$<k.pointers.length;)O[$]={clientX:u(k.pointers[$].clientX),clientY:u(k.pointers[$].clientY)},$++;return{timeStamp:h(),pointers:O,center:ci(O),deltaX:k.deltaX,deltaY:k.deltaY}}function ci(k){var O=k.length;if(O===1)return{x:u(k[0].clientX),y:u(k[0].clientY)};for(var $=0,U=0,K=0;K<O;)$+=k[K].clientX,U+=k[K].clientY,K++;return{x:u($/O),y:u(U/O)}}function Ui(k,O,$){return{x:O/k||0,y:$/k||0}}function Je(k,O){return k===O?ee:p(k)>=p(O)?k<0?Z:_e:O<0?Ve:ye}function vt(k,O,$){$||($=pt);var U=O[$[0]]-k[$[0]],K=O[$[1]]-k[$[1]];return Math.sqrt(U*U+K*K)}function ln(k,O,$){$||($=pt);var U=O[$[0]]-k[$[0]],K=O[$[1]]-k[$[1]];return 180*Math.atan2(K,U)/Math.PI}He.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(B(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&d(this.element,this.evEl,this.domHandler),this.evTarget&&d(this.target,this.evTarget,this.domHandler),this.evWin&&d(B(this.element),this.evWin,this.domHandler)}};var li={mousedown:ie,mousemove:2,mouseup:he},Ua="mousedown",nx="mousemove mouseup";function Ha(){this.evEl=Ua,this.evWin=nx,this.pressed=!1,He.apply(this,arguments)}_(Ha,He,{handler:function(k){var O=li[k.type];O&ie&&k.button===0&&(this.pressed=!0),2&O&&k.which!==1&&(O=he),this.pressed&&(O&he&&(this.pressed=!1),this.callback(this.manager,O,{pointers:[k],changedPointers:[k],pointerType:Q,srcEvent:k}))}});var ix={pointerdown:ie,pointermove:2,pointerup:he,pointercancel:Ne,pointerout:Ne},rx={2:J,3:"pen",4:Q,5:"kinect"},mh="pointerdown",fh="pointermove pointerup pointercancel";function Cl(){this.evEl=mh,this.evWin=fh,He.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(mh="MSPointerDown",fh="MSPointerMove MSPointerUp MSPointerCancel"),_(Cl,He,{handler:function(k){var O=this.store,$=!1,U=k.type.toLowerCase().replace("ms",""),K=ix[U],xe=rx[k.pointerType]||k.pointerType,$e=xe==J,yt=I(O,k.pointerId,"pointerId");K&ie&&(k.button===0||$e)?yt<0&&(O.push(k),yt=O.length-1):K&(he|Ne)&&($=!0),yt<0||(O[yt]=k,this.callback(this.manager,K,{pointers:O,changedPointers:[k],pointerType:xe,srcEvent:k}),$&&O.splice(yt,1))}});var ox={touchstart:ie,touchmove:2,touchend:he,touchcancel:Ne};function vh(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,He.apply(this,arguments)}function ax(k,O){var $=N(k.touches),U=N(k.changedTouches);return O&(he|Ne)&&($=L($.concat(U),"identifier")),[$,U]}_(vh,He,{handler:function(k){var O=ox[k.type];if(O===ie&&(this.started=!0),this.started){var $=ax.call(this,k,O);O&(he|Ne)&&$[0].length-$[1].length==0&&(this.started=!1),this.callback(this.manager,O,{pointers:$[0],changedPointers:$[1],pointerType:J,srcEvent:k})}}});var sx={touchstart:ie,touchmove:2,touchend:he,touchcancel:Ne},cx="touchstart touchmove touchend touchcancel";function qa(){this.evTarget=cx,this.targetIds={},He.apply(this,arguments)}function lx(k,O){var $=N(k.touches),U=this.targetIds;if(O&(2|ie)&&$.length===1)return U[$[0].identifier]=!0,[$,$];var K,xe,$e=N(k.changedTouches),yt=[],Me=this.target;if(xe=$.filter(function(Ct){return m(Ct.target,Me)}),O===ie)for(K=0;K<xe.length;)U[xe[K].identifier]=!0,K++;for(K=0;K<$e.length;)U[$e[K].identifier]&&yt.push($e[K]),O&(he|Ne)&&delete U[$e[K].identifier],K++;return yt.length?[L(xe.concat(yt),"identifier"),yt]:void 0}_(qa,He,{handler:function(k){var O=sx[k.type],$=lx.call(this,k,O);$&&this.callback(this.manager,O,{pointers:$[0],changedPointers:$[1],pointerType:J,srcEvent:k})}});var ux=2500;function Tl(){He.apply(this,arguments);var k=w(this.handler,this);this.touch=new qa(this.manager,k),this.mouse=new Ha(this.manager,k),this.primaryTouch=null,this.lastTouches=[]}function px(k,O){k&ie?(this.primaryTouch=O.changedPointers[0].identifier,yh.call(this,O)):k&(he|Ne)&&yh.call(this,O)}function yh(k){var O=k.changedPointers[0];if(O.identifier===this.primaryTouch){var $={x:O.clientX,y:O.clientY};this.lastTouches.push($);var U=this.lastTouches;setTimeout(function(){var K=U.indexOf($);K>-1&&U.splice(K,1)},ux)}}function dx(k){for(var O=k.srcEvent.clientX,$=k.srcEvent.clientY,U=0;U<this.lastTouches.length;U++){var K=this.lastTouches[U],xe=Math.abs(O-K.x),$e=Math.abs($-K.y);if(xe<=25&&$e<=25)return!0}return!1}_(Tl,He,{handler:function(k,O,$){var U=$.pointerType==J,K=$.pointerType==Q;if(!(K&&$.sourceCapabilities&&$.sourceCapabilities.firesTouchEvents)){if(U)px.call(this,O,$);else if(K&&dx.call(this,$))return;this.callback(k,O,$)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var gh=T(c.style,"touchAction"),bh=gh!==r,xh="compute",Eh="auto",Al="manipulation",Hi="none",To="pan-x",Ao="pan-y",Wa=function(){if(!bh)return!1;var k={},O=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function($){k[$]=!O||t.CSS.supports("touch-action",$)}),k}();function kl(k,O){this.manager=k,this.set(O)}kl.prototype={set:function(k){k==xh&&(k=this.compute()),bh&&this.manager.element.style&&Wa[k]&&(this.manager.element.style[gh]=k),this.actions=k.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var k=[];return y(this.manager.recognizers,function(O){S(O.options.enable,[O])&&(k=k.concat(O.getTouchAction()))}),function(O){if(C(O,Hi))return Hi;var $=C(O,To),U=C(O,Ao);return $&&U?Hi:$||U?$?To:Ao:C(O,Al)?Al:Eh}(k.join(" "))},preventDefaults:function(k){var O=k.srcEvent,$=k.offsetDirection;if(this.manager.session.prevented)O.preventDefault();else{var U=this.actions,K=C(U,Hi)&&!Wa[Hi],xe=C(U,Ao)&&!Wa[Ao],$e=C(U,To)&&!Wa[To];if(K){var yt=k.pointers.length===1,Me=k.distance<2,Ct=k.deltaTime<250;if(yt&&Me&&Ct)return}if(!$e||!xe)return K||xe&&$&Ue||$e&&$&Xe?this.preventSrc(O):void 0}},preventSrc:function(k){this.manager.session.prevented=!0,k.preventDefault()}};var Ka=1,Gn=32;function Un(k){this.options=o({},this.defaults,k||{}),this.id=b++,this.manager=null,this.options.enable=D(this.options.enable,!0),this.state=Ka,this.simultaneous={},this.requireFail=[]}function wh(k){return 16&k?"cancel":8&k?"end":4&k?"move":2&k?"start":""}function _h(k){return k==ye?"down":k==Ve?"up":k==Z?"left":k==_e?"right":""}function Xa(k,O){var $=O.manager;return $?$.get(k):k}function un(){Un.apply(this,arguments)}function Ya(){un.apply(this,arguments),this.pX=null,this.pY=null}function Pl(){un.apply(this,arguments)}function Ml(){Un.apply(this,arguments),this._timer=null,this._input=null}function Rl(){un.apply(this,arguments)}function Nl(){un.apply(this,arguments)}function Ja(){Un.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ui(k,O){return(O=O||{}).recognizers=D(O.recognizers,ui.defaults.preset),new Il(k,O)}Un.prototype={defaults:{},set:function(k){return o(this.options,k),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(k){if(f(k,"recognizeWith",this))return this;var O=this.simultaneous;return O[(k=Xa(k,this)).id]||(O[k.id]=k,k.recognizeWith(this)),this},dropRecognizeWith:function(k){return f(k,"dropRecognizeWith",this)||(k=Xa(k,this),delete this.simultaneous[k.id]),this},requireFailure:function(k){if(f(k,"requireFailure",this))return this;var O=this.requireFail;return I(O,k=Xa(k,this))===-1&&(O.push(k),k.requireFailure(this)),this},dropRequireFailure:function(k){if(f(k,"dropRequireFailure",this))return this;k=Xa(k,this);var O=I(this.requireFail,k);return O>-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,$=this.state;function U(K){O.manager.emit(K,k)}$<8&&U(O.options.event+wh($)),U(O.options.event),k.additionalEvent&&U(k.additionalEvent),$>=8&&U(O.options.event+wh($))},tryEmit:function(k){if(this.canEmit())return this.emit(k);this.state=Gn},canEmit:function(){for(var k=0;k<this.requireFail.length;){if(!(this.requireFail[k].state&(Gn|Ka)))return!1;k++}return!0},recognize:function(k){var O=o({},k);if(!S(this.options.enable,[this,O]))return this.reset(),void(this.state=Gn);56&this.state&&(this.state=Ka),this.state=this.process(O),30&this.state&&this.tryEmit(O)},process:function(k){},getTouchAction:function(){},reset:function(){}},_(un,Un,{defaults:{pointers:1},attrTest:function(k){var O=this.options.pointers;return O===0||k.pointers.length===O},process:function(k){var O=this.state,$=k.eventType,U=6&O,K=this.attrTest(k);return U&&($&Ne||!K)?16|O:U||K?$&he?8|O:2&O?4|O:2:Gn}}),_(Ya,un,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ie},getTouchAction:function(){var k=this.options.direction,O=[];return k&Ue&&O.push(Ao),k&Xe&&O.push(To),O},directionTest:function(k){var O=this.options,$=!0,U=k.distance,K=k.direction,xe=k.deltaX,$e=k.deltaY;return K&O.direction||(O.direction&Ue?(K=xe===0?ee:xe<0?Z:_e,$=xe!=this.pX,U=Math.abs(k.deltaX)):(K=$e===0?ee:$e<0?Ve:ye,$=$e!=this.pY,U=Math.abs(k.deltaY))),k.direction=K,$&&U>O.threshold&&K&O.direction},attrTest:function(k){return un.prototype.attrTest.call(this,k)&&(2&this.state||!(2&this.state)&&this.directionTest(k))},emit:function(k){this.pX=k.deltaX,this.pY=k.deltaY;var O=_h(k.direction);O&&(k.additionalEvent=this.options.event+O),this._super.emit.call(this,k)}}),_(Pl,un,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Hi]},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)}}),_(Ml,Un,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Eh]},process:function(k){var O=this.options,$=k.pointers.length===O.pointers,U=k.distance<O.threshold,K=k.deltaTime>O.time;if(this._input=k,!U||!$||k.eventType&(he|Ne)&&!K)this.reset();else if(k.eventType&ie)this.reset(),this._timer=v(function(){this.state=8,this.tryEmit()},O.time,this);else if(k.eventType&he)return 8;return Gn},reset:function(){clearTimeout(this._timer)},emit:function(k){this.state===8&&(k&&k.eventType&he?this.manager.emit(this.options.event+"up",k):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}}),_(Rl,un,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Hi]},attrTest:function(k){return this._super.attrTest.call(this,k)&&(Math.abs(k.rotation)>this.options.threshold||2&this.state)}}),_(Nl,un,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ue|Xe,pointers:1},getTouchAction:function(){return Ya.prototype.getTouchAction.call(this)},attrTest:function(k){var O,$=this.options.direction;return $&(Ue|Xe)?O=k.overallVelocity:$&Ue?O=k.overallVelocityX:$&Xe&&(O=k.overallVelocityY),this._super.attrTest.call(this,k)&&$&k.offsetDirection&&k.distance>this.options.threshold&&k.maxPointers==this.options.pointers&&p(O)>this.options.velocity&&k.eventType&he},emit:function(k){var O=_h(k.offsetDirection);O&&this.manager.emit(this.options.event+O,k),this.manager.emit(this.options.event,k)}}),_(Ja,Un,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Al]},process:function(k){var O=this.options,$=k.pointers.length===O.pointers,U=k.distance<O.threshold,K=k.deltaTime<O.time;if(this.reset(),k.eventType&ie&&this.count===0)return this.failTimeout();if(U&&K&&$){if(k.eventType!=he)return this.failTimeout();var xe=!this.pTime||k.timeStamp-this.pTime<O.interval,$e=!this.pCenter||vt(this.pCenter,k.center)<O.posThreshold;if(this.pTime=k.timeStamp,this.pCenter=k.center,$e&&xe?this.count+=1:this.count=1,this._input=k,this.count%O.taps===0)return this.hasRequireFailures()?(this._timer=v(function(){this.state=8,this.tryEmit()},O.interval,this),2):8}return Gn},failTimeout:function(){return this._timer=v(function(){this.state=Gn},this.options.interval,this),Gn},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==8&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ui.VERSION="2.0.7",ui.defaults={domEvents:!1,touchAction:xh,enable:!0,inputTarget:null,inputClass:null,preset:[[Rl,{enable:!1}],[Pl,{enable:!1},["rotate"]],[Nl,{direction:Ue}],[Ya,{direction:Ue},["swipe"]],[Ja],[Ja,{event:"doubletap",taps:2},["tap"]],[Ml]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Il(k,O){var $;this.options=o({},ui.defaults,O||{}),this.options.inputTarget=this.options.inputTarget||k,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=k,this.input=new(($=this).options.inputClass||(H?Cl:q?qa:V?Tl:Ha))($,me),this.touchAction=new kl(this,this.options.touchAction),Sh(this,!0),y(this.options.recognizers,function(U){var K=this.add(new U[0](U[1]));U[2]&&K.recognizeWith(U[2]),U[3]&&K.requireFailure(U[3])},this)}function Sh(k,O){var $,U=k.element;U.style&&(y(k.options.cssProps,function(K,xe){$=T(U.style,xe),O?(k.oldCssProps[$]=U.style[$],U.style[$]=K):U.style[$]=k.oldCssProps[$]||""}),O||(k.oldCssProps={}))}Il.prototype={set:function(k){return o(this.options,k),k.touchAction&&this.touchAction.update(),k.inputTarget&&(this.input.destroy(),this.input.target=k.inputTarget,this.input.init()),this},stop:function(k){this.session.stopped=k?2:1},recognize:function(k){var O=this.session;if(!O.stopped){var $;this.touchAction.preventDefaults(k);var U=this.recognizers,K=O.curRecognizer;(!K||K&&8&K.state)&&(K=O.curRecognizer=null);for(var xe=0;xe<U.length;)$=U[xe],O.stopped===2||K&&$!=K&&!$.canRecognizeWith(K)?$.reset():$.recognize(k),!K&&14&$.state&&(K=O.curRecognizer=$),xe++}},get:function(k){if(k instanceof Un)return k;for(var O=this.recognizers,$=0;$<O.length;$++)if(O[$].options.event==k)return O[$];return null},add:function(k){if(f(k,"add",this))return this;var O=this.get(k.options.event);return O&&this.remove(O),this.recognizers.push(k),k.manager=this,this.touchAction.update(),k},remove:function(k){if(f(k,"remove",this))return this;if(k=this.get(k)){var O=this.recognizers,$=I(O,k);$!==-1&&(O.splice($,1),this.touchAction.update())}return this},on:function(k,O){if(k!==r&&O!==r){var $=this.handlers;return y(R(k),function(U){$[U]=$[U]||[],$[U].push(O)}),this}},off:function(k,O){if(k!==r){var $=this.handlers;return y(R(k),function(U){O?$[U]&&$[U].splice(I($[U],O),1):delete $[U]}),this}},emit:function(k,O){this.options.domEvents&&function(K,xe){var $e=n.createEvent("Event");$e.initEvent(K,!0,!0),$e.gesture=xe,xe.target.dispatchEvent($e)}(k,O);var $=this.handlers[k]&&this.handlers[k].slice();if($&&$.length){O.type=k,O.preventDefault=function(){O.srcEvent.preventDefault()};for(var U=0;U<$.length;)$[U](O),U++}},destroy:function(){this.element&&Sh(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(ui,{INPUT_START:ie,INPUT_MOVE:2,INPUT_END:he,INPUT_CANCEL:Ne,STATE_POSSIBLE:Ka,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Gn,DIRECTION_NONE:ee,DIRECTION_LEFT:Z,DIRECTION_RIGHT:_e,DIRECTION_UP:Ve,DIRECTION_DOWN:ye,DIRECTION_HORIZONTAL:Ue,DIRECTION_VERTICAL:Xe,DIRECTION_ALL:Ie,Manager:Il,Input:He,TouchAction:kl,TouchInput:qa,MouseInput:Ha,PointerEventInput:Cl,TouchMouseInput:Tl,SingleTouchInput:vh,Recognizer:Un,AttrRecognizer:un,Tap:Ja,Pan:Ya,Swipe:Nl,Pinch:Pl,Rotate:Rl,Press:Ml,on:s,off:d,each:y,merge:E,extend:x,assign:o,inherit:_,bindFn:w,prefixed:T}),(t!==void 0?t:typeof self<"u"?self:{}).Hammer=ui,e.exports?e.exports=ui:t.Hammer=ui})(window,document)})(Xf);const rr=kr(Xf.exports);var Yf=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function Os(e,t){return t.get(e,!1)}function $u(e){e.preventDefault(),typeof e.stopPropagation=="function"?e.stopPropagation():e.srcEvent&&typeof e.srcEvent.stopPropagation=="function"&&e.srcEvent.stopPropagation(),typeof e.stopImmediatePropagation=="function"&&e.stopImmediatePropagation()}function zu(e){function t(l){setTimeout(function(){F(Yf,function(u){le.unbind(e,u,$u,!0)})},500)}le.bind(e,"touchstart",function(l){F(Yf,function(u){le.bind(e,u,$u,!0)})},!0),le.bind(e,"touchend",t,!0),le.bind(e,"touchcancel",t,!0);var n=new rr.Manager(e,{inputClass:rr.TouchInput,recognizers:[],domEvents:!0}),i=new rr.Tap,r=new rr.Pan({threshold:10}),o=new rr.Press,a=new rr.Pinch,c=new rr.Tap({event:"doubletap",taps:2});return a.requireFailure(r),a.requireFailure(o),n.add([r,o,a,c,i]),n.reset=function(l){var u=this.recognizers,p=this.session;p.stopped||(n.stop(l),setTimeout(function(){var h,v;for(h=0;v=u[h];h++)v.reset(),v.state=8;p.curRecognizer=null},0))},n.on("hammer.input",function(l){l.srcEvent.defaultPrevented&&n.reset(!0)}),n}function Jf(e,t,n,i,r){var o,a=Os("dragging",e),c=Os("move",e),l=Os("contextPad",e),u=Os("palette",e);function p(f,y){return function(g){var x=h(g.target),E=x&&i.get(x);return y&&(g.srcEvent.button=y),r.fire(f,g,E)}}function h(f){return Ji(f,"svg, .djs-element",!0)}function v(f){function y(g){var x=h(g.target),E=x&&i.get(x);if(c&&t.getRootElement()!==E)return c.start(g,E,!0);(function(){var _=0,w=0;function S(s){var d=s.deltaX-_,m=s.deltaY-w;t.scroll({dx:d,dy:m}),_=s.deltaX,w=s.deltaY}function D(s){o.off("panmove",S),o.off("panend",D),o.off("pancancel",D)}o.on("panmove",S),o.on("panend",D),o.on("pancancel",D)})()}(o=zu(f)).on("tap",p("element.click")),o.on("doubletap",p("element.dblclick",1)),o.on("panstart",y),o.on("press",y),o.on("pinchstart",function(g){var x=t.zoom(),E=g.center;function _(S){var D=1-(1-S.scale)/1.5,s=Math.max(.2,Math.min(4,D*x));t.zoom(s,E),$u(S)}function w(S){o.off("pinchmove",_),o.off("pinchend",w),o.off("pinchcancel",w),o.reset(!0)}o.on("pinchmove",_),o.on("pinchend",w),o.on("pinchcancel",w)})}a&&n.on("drag.move",function(f){var y=f.originalEvent;if(y&&!(y instanceof MouseEvent)){var g=Ti(y),x=h(document.elementFromPoint(g.x,g.y)),E=x&&i.get(x);E!==f.hover&&(f.hover&&a.out(f),E&&(a.hover({element:E,gfx:x}),f.hover=E,f.hoverGfx=x))}}),l&&n.on("contextPad.create",function(f){var y=zu(f.pad.html);y.on("panstart",function(g){l.trigger("dragstart",g,!0)}),y.on("press",function(g){l.trigger("dragstart",g,!0)}),y.on("tap",function(g){l.trigger("click",g)})}),u&&n.on("palette.create",function(f){var y=zu(f.container);y.on("panstart",function(g){u.trigger("dragstart",g,!0)}),y.on("press",function(g){u.trigger("dragstart",g,!0)}),y.on("tap",function(g){u.trigger("click",g)})}),n.on("canvas.init",function(f){v(f.svg)})}function Gu(e,t){var n=this;t.on("canvas.init",function(i){n.addBBoxMarker(i.svg)})}Jf.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],Gu.$inject=["canvas","eventBus"],Gu.prototype.addBBoxMarker=function(e){var t={fill:"none",class:"outer-bound-marker"},n=se("rect");W(n,{x:-1e4,y:1e4,width:10,height:10}),W(n,t),pe(e,n);var i=se("rect");W(i,{x:1e4,y:1e4,width:10,height:10}),W(i,t),pe(e,i)};const qw={__depends__:[{__depends__:[Ko],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",Jf],touchFix:["type",Gu]}]};function Uu(e){return e&&e[e.length-1]}function Zf(e){return e.y}function Qf(e){return e.x}var Ww={left:Qf,center:Qf,right:function(e){return e.x+e.width},top:Zf,middle:Zf,bottom:function(e){return e.y+e.height}};function ro(e){this._modeling=e}ro.$inject=["modeling"],ro.prototype._getOrientationDetails=function(e){var t="x",n="width";return["top","bottom","middle"].indexOf(e)!==-1&&(t="y",n="height"),{axis:t,dimension:n}},ro.prototype._isType=function(e,t){return t.indexOf(e)!==-1},ro.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),a=o.axis,c=o.dimension,l={},u={},p=!1;if(this._isType(e,["left","top"]))l[e]=t[0][a];else if(this._isType(e,["right","bottom"]))r=Uu(t),l[e]=r[a]+r[c];else if(this._isType(e,["center","middle"])){if(F(t,function(h){var v=h[a]+Math.round(h[c]/2);u[v]?u[v].elements.push(h):u[v]={elements:[h],center:v}}),n=mn(u,function(h){return h.elements.length>1&&(p=!0),h.elements.length}),p)return l[e]=Uu(n).center,l;i=t[0],r=Uu(t=mn(t,function(h){return h[a]+h[c]})),l[e]=function(h,v){return Math.round((h[a]+v[a]+v[c])/2)}(i,r)}return l},ro.prototype.trigger=function(e,t){var n=this._modeling,i=Ee(e,function(a){return!(a.waypoints||a.host||a.labelTarget)});if(!(i.length<2)){var r=mn(i,Ww[t]),o=this._alignmentPosition(t,r);n.alignElements(r,o)}};const Kw={__init__:["alignElements"],alignElements:["type",ro]};var Xw=10,ev=50,Yw=250;function Hu(e,t,n,i){for(var r;r=Jw(e,n,t);)n=i(t,n,r);return n}function qu(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 Jw(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=Wu(o);return o.host&&(a=a.concat(Wu(o.host))),o.attachers&&(a=a.concat(o.attachers.reduce(function(c,l){return c.concat(Wu(l))},[]))),a}(e);return je(r,function(o){return o!==n&&bt(o,i,Xw)==="intersect"})}function Wu(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 Zw(){return!0}function tv(e,t,n){e.on("autoPlace",100,function(i){var r=i.shape;return function(o,a,c){c||(c={});var l=c.defaultDistance||ev,u=ge(o),p=ce(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 nv(e,t){e.on("autoPlace.end",500,function(n){t.select(n.shape)})}tv.$inject=["eventBus","modeling","canvas"],nv.$inject=["eventBus","selection"];const Qw={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",tv],autoPlaceSelectionBehavior:["type",nv]};function Pe(e,t){return Yi(t,function(n){return A(e,n)})}function js(e,t){for(typeof t=="string"&&(t=[t]);e=e.parent;)if(Pe(e,t))return e;return null}function iv(e,t){return A(t,"bpmn:TextAnnotation")?function(n,i){var r=ce(n),o={x:r.right+i.width/2,y:r.top-50-i.height/2};return Hu(n,i,o,qu({y:{margin:-30,minDistance:20}}))}(e,t):Pe(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(n,i){var r=ce(n),o={x:r.right-10+i.width/2,y:r.bottom+40+i.width/2};return Hu(n,i,o,qu({x:{margin:30,minDistance:30}}))}(e,t):A(t,"bpmn:FlowNode")?function(n,i){var r=ce(n),o=ge(n),a=function(h,v){v||(v={});var f=v.defaultDistance||ev,y=v.direction||"e",g=v.filter,x=v.getWeight||function(d){return d.source===h?1:-1},E=v.maxDistance||Yw,_=v.reference||"start";function w(d,m){return y==="n"?_==="start"?ce(d).top-ce(m).bottom:_==="center"?ce(d).top-ge(m).y:ce(d).top-ce(m).top:y==="w"?_==="start"?ce(d).left-ce(m).right:_==="center"?ce(d).left-ge(m).x:ce(d).left-ce(m).left:y==="s"?_==="start"?ce(m).top-ce(d).bottom:_==="center"?ge(m).y-ce(d).bottom:ce(m).bottom-ce(d).bottom:_==="start"?ce(m).left-ce(d).right:_==="center"?ge(m).x-ce(d).right:ce(m).right-ce(d).right}g||(g=Zw);var S=h.incoming.filter(g).map(function(d){var m=x(d),C=m<0?w(d.source,h):w(h,d.source);return{id:d.source.id,distance:C,weight:m}}),D=h.outgoing.filter(g).map(function(d){var m=x(d),C=m>0?w(h,d.target):w(d.target,h);return{id:d.target.id,distance:C,weight:m}}),s=Gt(S.concat(D).reduce(function(d,m){return d[m.id+"__weight_"+m.weight]=m,d},{}),function(d,m){var C=m.distance,R=m.weight;return C<0||C>E||(d[String(C)]||(d[String(C)]=0),d[String(C)]+=1*R,(!d.distance||d[d.distance]<d[String(C)])&&(d.distance=C)),d},{});return s.distance||f}(n,{filter:function(h){return A(h,"bpmn:SequenceFlow")}}),c=30,l=80,u="left";A(n,"bpmn:BoundaryEvent")&&(u=bt(n,n.host,-25)).indexOf("top")!==-1&&(c*=-1);var p={x:r.right+a+i.width/2,y:o.y+e_(u,l)};return Hu(n,i,p,qu({y:{margin:c,minDistance:l}}))}(e,t):void 0}function e_(e,t){return e.indexOf("top")!=-1?-1*t:e.indexOf("bottom")!=-1?t:0}function rv(e){e.on("autoPlace",function(t){var n=t.shape;return iv(t.source,n)})}rv.$inject=["eventBus"];const t_={__depends__:[Qw],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",rv]};function ne(e){this._eventBus=e}ne.$inject=["eventBus"],ne.prototype.on=function(e,t,n,i,r,o){if((At(t)||fe(t))&&(o=r,r=i,i=n,n=t,t=null),At(n)&&(o=r,r=i,i=n,n=1e3),Tt(r)&&(o=r,r=!1),!At(i))throw new Error("handlerFn must be a function");Se(e)||(e=[e]);var a=this._eventBus;F(e,function(c){var l=["commandStack",c,t].filter(function(u){return u}).join(".");a.on(l,n,r?function(u,p){return function(h){return u.call(p||null,h.context,h.command,h)}}(i,o):i,o)})};function Qn(e,t,n,i){ne.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=i;var r=this;this.postExecuted(["shape.create"],function(o){var a=o.context,c=a.hints||{},l=a.shape,u=a.parent||a.newParent;c.autoResize!==!1&&r._expand([l],u)}),this.postExecuted(["elements.move"],function(o){var a=o.context,c=ns(Hl(a.closure.topLevel)),l=a.hints,u=!l||l.autoResize;u!==!1&&F(jr(c,function(p){return p.parent.id}),function(p,h){Se(u)&&(p=p.filter(function(v){return je(u,fn({id:v.id}))})),r._expand(p,h)})}),this.postExecuted(["shape.toggleCollapse"],function(o){var a=o.context,c=a.hints,l=a.shape;c&&c.autoResize===!1||l.collapsed||r._expand(l.children||[],l)}),this.postExecuted(["shape.resize"],function(o){var a=o.context,c=a.hints,l=a.shape,u=l.parent;c&&c.autoResize===!1||u&&r._expand([l],u)})}function Ls(e){e.invoke(Qn,this)}function ki(e){ne.call(this,e),this.init()}function Zo(e){ki.call(this,e);var t=this;this.addRule("element.autoResize",function(n){return t.canResize(n.elements,n.target)})}function Vs(e,t){Zo.call(this,e),this._modeling=t}F(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],function(e){ne.prototype[e]=function(t,n,i,r,o){(At(t)||fe(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}),Qn.$inject=["eventBus","elementRegistry","modeling","rules"],ae(Qn,ne),Qn.prototype._getOptimalBounds=function(e,t){var n=this.getOffset(t),i=this.getPadding(t),r=ce(gt(e)),o=ce(t),a={};return r.top-o.top<i.top&&(a.top=r.top-n.top),r.left-o.left<i.left&&(a.left=r.left-n.left),o.right-r.right<i.right&&(a.right=r.right+n.right),o.bottom-r.bottom<i.bottom&&(a.bottom=r.bottom+n.bottom),hu(z({},o,a))},Qn.prototype._expand=function(e,t){if(typeof t=="string"&&(t=this._elementRegistry.get(t)),this._rules.allowed("element.autoResize",{elements:e,target:t})){var n=this._getOptimalBounds(e,t);if(function(o,a){return o.x!==a.x||o.y!==a.y||o.width!==a.width||o.height!==a.height}(n,t)){var i=function(o,a){var c="";return o=ce(o),a=ce(a),o.top>a.top&&(c=c.concat("n")),o.right<a.right&&(c=c.concat("w")),o.bottom<a.bottom&&(c=c.concat("s")),o.left>a.left&&(c=c.concat("e")),c}(Rn(t,["x","y","width","height"]),n);this.resize(t,n,{autoResize:i});var r=t.parent;r&&this._expand([t],r)}}},Qn.prototype.getOffset=function(e){return{top:60,bottom:60,left:100,right:100}},Qn.prototype.getPadding=function(e){return{top:2,bottom:2,left:15,right:15}},Qn.prototype.resize=function(e,t,n){this._modeling.resizeShape(e,t,null,n)},Ls.$inject=["injector"],ae(Ls,Qn),Ls.prototype.resize=function(e,t,n){A(e,"bpmn:Participant")?this._modeling.resizeLane(e,t,null,n):this._modeling.resizeShape(e,t,null,n)},ki.$inject=["eventBus"],ae(ki,ne),ki.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)})},ki.prototype.init=function(){},Zo.$inject=["eventBus"],ae(Zo,ki),Zo.prototype.canResize=function(e,t){return!1},ae(Vs,Zo),Vs.$inject=["eventBus","modeling"],Vs.prototype.canResize=function(e,t){if(!A(t,"bpmn:Participant")&&!A(t,"bpmn:Lane")&&!A(t,"bpmn:SubProcess"))return!1;var n=!0;return F(e,function(i){(A(i,"bpmn:Lane")||i.labelTarget)&&(n=!1)}),n};const n_={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",Ls],bpmnAutoResizeProvider:["type",Vs]};function ov(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,h=o._findTargetGfx(p),v=h&&e.get(h);h&&v&&(u.stopPropagation(),a.hover({element:v,gfx:h}),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=Ti(c),function(u){return Ji(u,"svg, .djs-element",!0)}(document.elementFromPoint(l.x,l.y))}}ov.$inject=["elementRegistry","eventBus","injector"];const i_={__init__:["hoverFix"],hoverFix:["type",ov]};var oo=Math.round,av="djs-drag-active";function or(e){e.preventDefault()}function sv(e,t,n,i){var r,o={threshold:5,trapClick:!0};function a(E){var _=t.viewbox(),w=t._container.getBoundingClientRect();return{x:_.x+(E.x-w.left)/_.scale,y:_.y+(E.y-w.top)/_.scale}}function c(E,_){_=_||r;var w=e.createEvent(z({},_.payload,_.data,{isTouch:_.isTouch}));return e.fire("drag."+E,w)!==!1&&e.fire(_.prefix+"."+E,w)}function l(E,_){var w,S=r.payload,D=r.displacement,s=r.globalStart,d=Ti(E),m=jn(d,s),C=r.localStart,R=a(d),I=jn(R,C);if(!r.active&&(_||(w=m,Math.sqrt(Math.pow(w.x,2)+Math.pow(w.y,2))>r.threshold))){if(z(S,{x:oo(C.x+D.x),y:oo(C.y+D.y),dx:0,dy:0},{originalEvent:E}),c("start")===!1)return g();r.active=!0,r.keepSelection||(S.previousSelection=n.get(),n.select(null)),r.cursor&&Bs(r.cursor),t.addMarker(t.getRootElement(),av)}Du(E),r.active&&(z(S,{x:oo(R.x+D.x),y:oo(R.y+D.y),dx:oo(I.x),dy:oo(I.y)},{originalEvent:E}),c("move"))}function u(E){var _=!0;r.active&&(E&&(r.payload.originalEvent=E,Du(E)),_=c("end")),_===!1&&c("rejected"),c("ended",x(_!==!0))}function p(E){E.which===27&&(or(E),g())}function h(E){var _;r.active&&(_=Uf(e),setTimeout(_,400),or(E)),u(E)}function v(E){l(E)}function f(E){var _=r.payload;_.hoverGfx=E.gfx,_.hover=E.element,c("hover")}function y(E){c("out");var _=r.payload;_.hoverGfx=null,_.hover=null}function g(E){var _;if(r){var w=r.active;w&&c("cancel"),_=x(E),w&&c("canceled",_)}}function x(E){var _,w;c("cleanup"),Gf(),w=r.trapClick?h:u,le.unbind(document,"mousemove",l),le.unbind(document,"dragstart",or),le.unbind(document,"selectstart",or),le.unbind(document,"mousedown",w,!0),le.unbind(document,"mouseup",w,!0),le.unbind(document,"keyup",p),le.unbind(document,"touchstart",v,!0),le.unbind(document,"touchcancel",g,!0),le.unbind(document,"touchmove",l,!0),le.unbind(document,"touchend",u,!0),e.off("element.hover",f),e.off("element.out",y),t.removeMarker(t.getRootElement(),av);var S=r.payload.previousSelection;return E!==!1&&S&&!n.get().length&&function(D){var s=D.filter(function(d){return i.get(d.id)});s.length&&n.select(s)}(S),_=r,r=null,_}e.on("diagram.destroy",g),this.init=function(E,_,w,S){r&&g(!1),typeof _=="string"&&(S=w,w=_,_=null);var D,s,d,m,C,R=(S=z({},o,S||{})).data||{};m=S.trapClick?h:u,E?(D=eo(E)||E,s=Ti(E),Du(E),D.type==="dragstart"&&or(D)):(D=null,s={x:0,y:0}),d=a(s),_||(_=d),C=function(I){return typeof TouchEvent<"u"&&I instanceof TouchEvent}(D),r=z({prefix:w,data:R,payload:{},globalStart:s,displacement:jn(_,d),localStart:d,isTouch:C},S),S.manual||(C?(le.bind(document,"touchstart",v,!0),le.bind(document,"touchcancel",g,!0),le.bind(document,"touchmove",l,!0),le.bind(document,"touchend",u,!0)):(le.bind(document,"mousemove",l),le.bind(document,"dragstart",or),le.bind(document,"selectstart",or),le.bind(document,"mousedown",m,!0),le.bind(document,"mouseup",m,!0)),le.bind(document,"keyup",p),e.on("element.hover",f),e.on("element.out",y)),c("init"),S.autoActivate&&l(E,!0)},this.move=l,this.hover=f,this.out=y,this.end=u,this.cancel=g,this.context=function(){return r},this.setOptions=function(E){z(o,E)}}sv.$inject=["eventBus","canvas","selection","elementRegistry"];const ei={__depends__:[i_,On],dragging:["type",sv]};function ao(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 r_(e,t,n){return t<e&&e<n}ao.$inject=["config.autoScroll","eventBus","canvas"],ao.prototype.startScroll=function(e){var t=this._canvas,n=this._opts,i=this,r=t.getContainer().getBoundingClientRect(),o=[e.x,e.y,r.width-e.x,r.height-e.y];this.stopScroll();for(var a=0,c=0,l=0;l<4;l++)r_(o[l],n.scrollThresholdOut[l],n.scrollThresholdIn[l])&&(l===0?a=n.scrollStep:l==1?c=n.scrollStep:l==2?a=-n.scrollStep:l==3&&(c=-n.scrollStep));a===0&&c===0||(t.scroll({dx:a,dy:c}),this._scrolling=setTimeout(function(){i.startScroll(e)},n.scrollRepeatTimeout))},ao.prototype.stopScroll=function(){clearTimeout(this._scrolling)},ao.prototype.setOptions=function(e){this._opts=z({},this._opts,e)},ao.prototype._toBorderPoint=function(e){var t=this._canvas._container.getBoundingClientRect(),n=Ti(e.originalEvent);return{x:n.x-t.left,y:n.y-t.top}};const o_={__depends__:[ei],__init__:["autoScroll"],autoScroll:["type",ao]};function Ku(e){this._commandStack=e.get("commandStack",!1)}Ku.$inject=["injector"],Ku.prototype.allowed=function(e,t){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(e,t)),n===void 0||n};const Vn={__init__:["rules"],rules:["type",Ku]};var Fs=Math.round,a_=Math.max,cv=10;function Xu(e,t){return function(n,i){var r,o;for(r=0;o=n[r];r++)if(jo(o,i)<=cv)return{point:n[r],bendpoint:!0,index:r};return null}(e,t)||function(n,i){var r,o,a=Im(function(u,p){return[["M",u.x,u.y],["m",0,-p],["a",p,p,0,1,1,0,2*p],["a",p,p,0,1,1,0,-2*p],["z"]]}(i,cv),(r=[],n.forEach(function(u,p){r.push([p===0?"M":"L",u.x,u.y])}),r)),c=a[0],l=a[a.length-1];return c?c!==l?c.segment2!==l.segment2?{point:n[o=a_(c.segment2,l.segment2)-1],bendpoint:!0,index:o}:{point:{x:Fs(c.x+l.x)/2,y:Fs(c.y+l.y)/2},index:c.segment2}:{point:{x:Fs(c.x),y:Fs(c.y)},index:c.segment2}:null}(e,t)}var lv="djs-bendpoint",uv="djs-segment-dragger";function Yu(e,t,n){var i=function(r,o){var a,c=Ti(o),l=r._container.getBoundingClientRect();a={x:l.left,y:l.top};var u=r.viewbox();return{x:u.x+(c.x-a.x)/u.scale,y:u.y+(c.y-a.y)/u.scale}}(e,n);return Xu(t,i)}function Ju(e,t){var n=se("g");Ce(n).add(lv),pe(e,n);var i=se("circle");W(i,{cx:0,cy:0,r:4}),Ce(i).add("djs-visual"),pe(n,i);var r=se("circle");return W(r,{cx:0,cy:0,r:10}),Ce(r).add("djs-hit"),pe(n,r),t&&Ce(n).add(t),n}function s_(e,t,n,i){var r=se("g");pe(e,r);var o=function(l,u,p){var h=u.x-l.x,v=u.y-l.y;return dv(p==="h"?h:v)}(t,n,i),a=se("rect");W(a,{x:-7,y:-1.5,width:14,height:3}),Ce(a).add("djs-visual"),pe(r,a);var c=se("rect");return W(c,{x:-o/2,y:-7,width:o,height:14}),Ce(c).add("djs-hit"),pe(r,c),Wm(r,i==="v"?90:0),r}function pv(e,t,n){var i=se("g"),r=uu(t,n),o=Kn(t,n);return pe(e,i),s_(i,t,n,o),Ce(i).add(uv),Ce(i).add(o==="h"?"horizontal":"vertical"),Lt(i,r.x,r.y),i}function dv(e){return Math.abs(Math.round(2*e/3))}var hv={exports:{}};/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */hv.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var t=function(n){if(arguments.length==0)throw new TypeError("`CSS.escape` requires an argument.");for(var i,r=String(n),o=r.length,a=-1,c="",l=r.charCodeAt(0);++a<o;)(i=r.charCodeAt(a))!=0?c+=i>=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}(Lh);const Zu=kr(hv.exports);var c_={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function mv(e){return(e=""+e)&&e.replace(/[&<>"']/g,function(t){return c_[t]})}function fv(e,t,n,i,r){function o(y,g){var x,E=g.waypoints,_=Yu(t,E,y);if(_)return x=function(w,S){var D,s,d=w.waypoints;return S.index<=0||S.bendpoint?null:(s=Kn((D={start:d[S.index-1],end:d[S.index]}).start,D.end))?dv(s==="h"?D.end.x-D.start.x:D.end.y-D.start.y)/2:null}(g,_),function(w,S,D){var s,d,m,C,R,I,N=w.index,L=w.point;return!(N<=0||w.bendpoint)&&(m=uu(s=S[N-1],d=S[N]),C=Kn(s,d),R=Math.abs(L.x-m.x),I=Math.abs(L.y-m.y),C&&R<=D&&I<=D)}(_,E,x)?r.start(y,g,_.index):i.start(y,g,_.index,!_.bendpoint),!0}function a(y,g,x){le.bind(y,g,function(E){n.triggerMouseEvent(g,E,x),E.stopPropagation()})}function c(y,g){var x=t.getLayer("overlays"),E=Ye('.djs-bendpoints[data-element-id="'+Zu(y.id)+'"]',x);return!E&&g&&(W(E=se("g"),{"data-element-id":y.id}),Ce(E).add("djs-bendpoints"),pe(x,E),a(E,"mousedown",y),a(E,"click",y),a(E,"dblclick",y)),E}function l(y,g){return Ye('.djs-segment-dragger[data-segment-idx="'+y+'"]',g)}function u(y,g){g.waypoints.forEach(function(x,E){var _=Ju(y);pe(y,_),Lt(_,x.x,x.y)}),Ju(y,"floating")}function p(y,g){for(var x,E,_,w=g.waypoints,S=1;S<w.length;S++)Kn(x=w[S-1],E=w[S])&&(W(_=pv(y,x,E),{"data-segment-idx":S}),a(_,"mousemove",g))}function h(y){var g=c(y);return g||(u(g=c(y,!0),y),p(g,y)),g}function v(y){var g=c(y);g&&(function(x){F(Jl("."+uv,x),function(E){it(E)})}(g),function(x){F(Jl("."+lv,x),function(E){it(E)})}(g),p(g,y),u(g,y))}function f(y,g,x){var E,_,w=l(g.index,y),S=x[g.index-1],D=x[g.index],s=g.point,d=uu(S,D),m=Kn(S,D);w&&(E=function(C){return Ye(".djs-visual",C)}(w),_={x:s.x-d.x,y:s.y-d.y},m==="v"&&(_={x:_.y,y:_.x}),Lt(E,_.x,_.y))}e.on("connection.changed",function(y){v(y.element)}),e.on("connection.remove",function(y){var g=c(y.element);g&&it(g)}),e.on("element.marker.update",function(y){var g,x=y.element;x.waypoints&&(g=h(x),y.add?Ce(g).add(y.marker):Ce(g).remove(y.marker))}),e.on("element.mousemove",function(y){var g,x,E=y.element,_=E.waypoints;if(_){if(g=c(E,!0),!(x=Yu(t,_,y.originalEvent)))return;(function(w,S){var D=Ye(".floating",w),s=S.point;D&&Lt(D,s.x,s.y)})(g,x),x.bendpoint||f(g,x,_)}}),e.on("element.mousedown",function(y){if(Ai(y)){var g=y.originalEvent,x=y.element;if(x.waypoints)return o(g,x)}}),e.on("selection.changed",function(y){var g=y.newSelection[0];g&&g.waypoints&&h(g)}),e.on("element.hover",function(y){var g=y.element;g.waypoints&&(h(g),n.registerEvent(y.gfx,"mousemove","element.mousemove"))}),e.on("element.out",function(y){n.unregisterEvent(y.gfx,"mousemove","element.mousemove")}),e.on("element.updateId",function(y){var g=y.element,x=y.newId;if(g.waypoints){var E=c(g);E&&W(E,{"data-element-id":x})}}),this.addHandles=h,this.updateHandles=v,this.getBendpointsContainer=c,this.getSegmentDragger=l}fv.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var vv=Math.round,ar="reconnectStart",sr="reconnectEnd",Qo="updateWaypoints";function Qu(e,t,n,i,r,o){this._injector=e,this.start=function(a,c,l,u){var p,h=n.getGraphics(c),v=c.source,f=c.target,y=c.waypoints,g=(p=u||l!==0?u||l!==y.length-1?Qo:sr:ar)===Qo?"connection.updateWaypoints":"connection.reconnect",x=r.allowed(g,{connection:c,source:v,target:f});x===!1&&(x=r.allowed(g,{connection:c,source:f,target:v})),x!==!1&&i.init(a,"bendpoint.move",{data:{connection:c,connectionGfx:h,context:{allowed:x,bendpointIndex:l,connection:c,source:v,target:f,insert:u,type:p}}})},t.on("bendpoint.move.hover",function(a){var c,l=a.context,u=l.connection,p=u.source,h=u.target,v=a.hover,f=l.type;if(l.hover=v,v){var y=f===Qo?"connection.updateWaypoints":"connection.reconnect";if(c=l.allowed=r.allowed(y,{connection:u,source:f===ar?v:p,target:f===sr?v:h}))return l.source=f===ar?v:p,void(l.target=f===sr?v:h);c===!1&&(c=l.allowed=r.allowed(y,{connection:u,source:f===sr?v:h,target:f===ar?v:p})),c&&(l.source=f===sr?v:h,l.target=f===ar?v: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!==Qo&&(c.allowed=!1)}),t.on("bendpoint.move.end",function(a){var c=a.context,l=c.allowed,u=c.bendpointIndex,p=c.connection,h=c.insert,v=p.waypoints.slice(),f=c.source,y=c.target,g=c.type,x=c.hints||{},E={x:vv(a.x),y:vv(a.y)};if(!l)return!1;g===Qo?(h?v.splice(u,0,E):v[u]=E,x.bendpointMove={insert:h,bendpointIndex:u},v=this.cropWaypoints(p,v),o.updateWaypoints(p,function(_){_=_.slice();for(var w,S,D,s=0;_[s];)w=_[s],S=_[s-1],jo(w,D=_[s+1])===0||lu(S,D,w)?_.splice(s,1):s++;return _}(v),x)):(g===ar?(x.docking="source",$s(c)&&(x.docking="target",x.newWaypoints=v.reverse())):g===sr&&(x.docking="target",$s(c)&&(x.docking="source",x.newWaypoints=v.reverse())),o.reconnect(p,f,y,E,x))},this)}function $s(e){var t=e.hover,n=e.source,i=e.target,r=e.type;return r===ar?t&&i&&t===i&&n!==i:r===sr?t&&n&&t===n&&n!==i:void 0}Qu.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],Qu.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 yv="updateWaypoints",ea="connect-ok",zs="connect-not-ok",gv="connect-hover",bv="djs-updating",xv="djs-element-hidden";function Ev(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,h=p.slice();a.waypoints=p,u&&h.splice(c,0,{x:o.x,y:o.y}),l.waypoints=h,Ce(a.draggerGfx=Ju(i.getLayer("overlays"))).add("djs-dragging"),i.addMarker(l,xv),i.addMarker(l,bv)}),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,gv),u===yv)return;c?(i.removeMarker(l,zs),i.addMarker(l,ea)):c===!1&&(i.removeMarker(l,ea),i.addMarker(l,zs))}}),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,gv),i.removeMarker(c,l?ea:zs))}),n.on("bendpoint.move.move",function(o){var a=o.context,c=a.allowed,l=a.bendpointIndex,u=a.draggerGfx,p=a.hover,h=a.type,v=a.connection,f=v.source,y=v.target,g=v.waypoints.slice(),x={x:o.x,y:o.y},E=a.hints||{},_={};r&&(E.connectionStart&&(_.connectionStart=E.connectionStart),E.connectionEnd&&(_.connectionEnd=E.connectionEnd),h==="reconnectStart"?$s(a)?(_.connectionEnd=_.connectionEnd||x,_.source=y,_.target=p||f,g=g.reverse()):(_.connectionStart=_.connectionStart||x,_.source=p||f,_.target=y):h==="reconnectEnd"?$s(a)?(_.connectionStart=_.connectionStart||x,_.source=p||y,_.target=f,g=g.reverse()):(_.connectionEnd=_.connectionEnd||x,_.source=f,_.target=p||y):(_.noCropping=!0,_.noLayout=!0,g[l]=x),h===yv&&(g=e.cropWaypoints(v,g)),_.waypoints=g,r.drawPreview(a,c,_)),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,h=a.waypoints;c.waypoints=h,it(l),i.removeMarker(c,bv),i.removeMarker(c,xv),u&&(i.removeMarker(u,ea),i.removeMarker(u,p?ea:zs)),r&&r.cleanUp(a)})}Ev.$inject=["bendpointMove","injector","eventBus","canvas"];var wv="connect-hover",_v="djs-updating";function Sv(e,t,n){return ep(e,t,e[t]+n)}function ep(e,t,n){return{x:t==="x"?n:e.x,y:t==="y"?n:e.y}}function Cv(e){return e==="x"?"y":"x"}function Tv(e,t,n){var i,r;return e.original?e.original:(i=ge(t),ep(e,r=Cv(n),i[r]))}function Av(e,t,n,i,r,o){var a=e.get("connectionDocking",!1);function c(p,h){if(!a)return h;var v,f=p.waypoints;return p.waypoints=h,v=a.getCroppedWaypoints(p),p.waypoints=f,v}function l(p){r.update("connection",p.connection,p.connectionGfx)}function u(p,h,v){var f=p.newWaypoints,y=function(g,x,E,_){var w=Math.max(x[_],E[_]),S=Math.min(x[_],E[_]);return ep(x,_,Math.min(Math.max(S+20,g[_]),w-20))}(v,f[p.segmentStartIndex+h],f[p.segmentEndIndex+h],Cv(p.axis));Lt(p.draggerGfx,y.x,y.y)}this.start=function(p,h,v){var f,y,g,x,E=n.getGraphics(h),_=v-1,w=v,S=h.waypoints,D=S[_],s=S[w],d=Yu(n,S,p);(y=Kn(D,s))&&(g=y==="v"?"x":"y",_===0&&(D=Tv(D,h.source,g)),w===S.length-1&&(s=Tv(s,h.target,g)),f={connection:h,segmentStartIndex:_,segmentEndIndex:w,segmentStart:D,segmentEnd:s,axis:g,dragPosition:x=d?d.point:{x:(D.x+s.x)/2,y:(D.y+s.y)/2}},i.init(p,x,"connectionSegment.move",{cursor:g==="x"?"resize-ew":"resize-ns",data:{connection:h,connectionGfx:E,context:f}}))},t.on("connectionSegment.move.start",function(p){var h=p.context,v=p.connection,f=n.getLayer("overlays");h.originalWaypoints=v.waypoints.slice(),h.draggerGfx=pv(f,h.segmentStart,h.segmentEnd),Ce(h.draggerGfx).add("djs-dragging"),n.addMarker(v,_v)}),t.on("connectionSegment.move.move",function(p){var h,v,f=p.context,y=f.connection,g=f.segmentStartIndex,x=f.segmentEndIndex,E=f.segmentStart,_=f.segmentEnd,w=f.axis,S=f.originalWaypoints.slice(),D=Sv(E,w,p["d"+w]),s=Sv(_,w,p["d"+w]),d=S.length,m=0;S[g]=D,S[x]=s,g<2&&(h=bt(y.source,D),g===1?h==="intersect"&&(S.shift(),S[0]=D,m--):h!=="intersect"&&(S.unshift(E),m++)),x>d-3&&(v=bt(y.target,s),x===d-2?v==="intersect"&&(S.pop(),S[S.length-1]=s):v!=="intersect"&&S.push(_)),f.newWaypoints=y.waypoints=c(y,S),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,wv)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(p){var h=p.context.hover;h&&n.removeMarker(h,wv)}),t.on("connectionSegment.move.cleanup",function(p){var h=p.context,v=h.connection;h.draggerGfx&&it(h.draggerGfx),n.removeMarker(v,_v)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(p){var h=p.context;h.connection.waypoints=h.originalWaypoints,l(p)}),t.on("connectionSegment.move.end",function(p){var h=p.context,v=h.connection,f=h.newWaypoints,y=h.newSegmentStartIndex,g=function(w,S){var D=0;return{waypoints:w.filter(function(s,d){return!lu(w[d-1],w[d+1],s)||(D=d<=S?D-1:D,!1)}),segmentOffset:D}}(f=f.map(function(w){return{original:w.original,x:Math.round(w.x),y:Math.round(w.y)}}),y),x=c(v,g.waypoints),E=g.segmentOffset,_={segmentMove:{segmentStartIndex:h.segmentStartIndex,newSegmentStartIndex:y+E}};o.updateWaypoints(v,x,_)})}Av.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var l_=Math.abs,kv=Math.round;function Pv(e){return{x:e.x,y:e.y}}function Mv(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:kv(e.x+e.width/2),y:kv(e.y+e.height/2)}}function so(e,t){var n=e.snapped;return!!n&&(typeof t=="string"?n[t]:n.x&&n.y)}function ut(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 Rv(e){return e.children||[]}var u_=Math.abs,Nv=Math.round;function Iv(e){function t(i,r){if(Se(i)){for(var o=i.length;o--;)if(u_(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:Nv(i.width/2+i.x),y:Nv(i.height/2+i.y)}}e.on("connectionSegment.move.move",1500,function(i){var r,o,a=function(h){var v=h.snapPoints,f=h.connection,y=f.waypoints,g=h.segmentStart,x=h.segmentStartIndex,E=h.segmentEnd,_=h.segmentEndIndex,w=h.axis;if(v)return v;var S=[y[x-1],g,E,y[_+1]];return x<2&&S.unshift(n(f.source)),_>y.length-3&&S.unshift(n(f.target)),h.snapPoints=v={horizontal:[],vertical:[]},F(S,function(D){D&&(D=D.original||D,w==="y"&&v.horizontal.push(D.y),w==="x"&&v.vertical.push(D.x))}),v}(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)&&ut(i,"x",r),(p||a.horizontal.indexOf(l)!==-1)&&ut(i,"y",o)}}),e.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(i){var r,o,a=i.context,c=function(y){var g=y.snapPoints,x=y.connection.waypoints,E=y.bendpointIndex;if(g)return g;var _=[x[E-1],x[E+1]];return y.snapPoints=g={horizontal:[],vertical:[]},F(_,function(w){w&&(w=w.original||w,g.horizontal.push(w.y),g.vertical.push(w.x))}),g}(a),l=a.hover,u=l&&n(l),p=i.x,h=i.y;if(c){var v=p-(r=t(u?c.vertical.concat([u.x]):c.vertical,p)),f=h-(o=t(u?c.horizontal.concat([u.y]):c.horizontal,h));z(i,{dx:i.dx-v,dy:i.dy-f,x:i.x-v,y:i.y-f}),(v||c.vertical.indexOf(p)!==-1)&&ut(i,"x",r),(f||c.horizontal.indexOf(h)!==-1)&&ut(i,"y",o)}})}Iv.$inject=["eventBus"];const p_={__depends__:[ei,Vn],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",fv],bendpointMove:["type",Qu],bendpointMovePreview:["type",Ev],connectionSegmentMove:["type",Av],bendpointSnapping:["type",Iv]};function Dv(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,!Yh(a=c.canExecute=r(l,u))){if(a!==!1)return c.source=l,void(c.target=u);Yh(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,h=a.target;if(!c)return!1;var v=null,f={connectionStart:tp(a)?u:l,connectionEnd:tp(a)?l:u};Tt(c)&&(v=c),n.connect(p,h,v,f)}),this.start=function(o,a,c,l){Tt(c)||(l=c,c=ge(a)),t.init(o,"connect",{autoActivate:l,data:{shape:a,context:{start:a,connectionStart:c}}})}}function tp(e){var t=e.hover,n=e.source,i=e.target;return t&&n&&t===n&&n!==i}Dv.$inject=["eventBus","dragging","modeling","rules"];var Bv="connect-ok",Ov="connect-not-ok";function jv(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,h=o.target,v=o.connectionStart||p,f=o.connectionEnd||{x:r.x,y:r.y},y=v,g=f;tp(o)&&(y=f,g=v),i.drawPreview(o,a,{source:l||u,target:h||c,connectionStart:y,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?Bv:Ov)}),t.on(["connect.out","connect.cleanup"],1100,function(r){var o=r.hover;o&&(n.removeMarker(o,Bv),n.removeMarker(o,Ov))}),i&&t.on("connect.cleanup",function(r){i.cleanUp(r.context)})}jv.$inject=["injector","eventBus","canvas"];const np={__depends__:[On,Vn,ei],__init__:["connectPreview"],connect:["type",Dv],connectPreview:["type",jv]};function ti(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)}ti.$inject=["injector","canvas","graphicsFactory","elementFactory"],ti.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,h=n.noLayout,v=n.noCropping,f=n.noNoop,y=this;r||(r=e.connectionPreviewGfx=this.createConnectionPreviewGfx()),am(r),o||(o=e.getConnection=function(g){var x={};return function(E){var _=JSON.stringify(E),w=x[_];return w||(w=x[_]=g.apply(null,arguments)),w}}(function(g,x,E){return y.getConnection(g,x,E)})),t&&(i=o(t,a,c)),i?(i.waypoints=l||[],this._layouter&&!h&&(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?ge(a):u,c?ge(c):p]),this._connectionDocking&&(a||c)&&!v&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,a,c)),this._graphicsFactory.drawConnection(r,i)):!f&&this.drawNoopPreview(r,n)},ti.prototype.drawNoopPreview=function(e,t){var n=t.source,i=t.target,r=t.connectionStart||ge(n),o=t.connectionEnd||ge(i),a=this.cropWaypoints(r,o,n,i);pe(e,this.createNoopConnection(a[0],a[1]))},ti.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&&mu(o,c,!0)||e,t=i&&mu(a,c,!1)||t]},ti.prototype.cleanUp=function(e){e&&e.connectionPreviewGfx&&it(e.connectionPreviewGfx)},ti.prototype.getConnection=function(e){var t=function(n){return Tt(n)?n:{}}(e);return this._elementFactory.createConnection(t)},ti.prototype.createConnectionPreviewGfx=function(){var e=se("g");return W(e,{pointerEvents:"none"}),Ce(e).add("djs-connection-preview"),pe(this._canvas.getActiveLayer(),e),e},ti.prototype.createNoopConnection=function(e,t){var n=se("polyline");return W(n,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),W(n,{points:[e.x,e.y,t.x,t.y]}),n};const d_={__init__:["connectionPreview"],connectionPreview:["type",ti]};var Lv=Math.min,Vv=Math.max;function ip(e){e.preventDefault()}function ta(e){e.stopPropagation()}function xn(e){this.container=e.container,this.parent=ze('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=Ye("[contenteditable]",this.parent),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=qn(this.autoResize,this),this.handlePaste=qn(this.handlePaste,this)}function en(e,t){this._eventBus=e,this._providers=[],this._textbox=new xn({container:t.getContainer(),keyHandler:qn(this._handleKey,this),resizeHandler:qn(this._handleResize,this)})}xn.prototype.create=function(e,t,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{};var c=Rn(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=Rn(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,le.bind(o,"keydown",this.keyHandler),le.bind(o,"mousedown",ta),le.bind(o,"paste",this.handlePaste),i.autoResize&&le.bind(o,"input",this.autoResize),i.resizable&&this.resizable(t),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},xn.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)}},xn.prototype.insertText=function(e){e=e.replace(/\r\n|\r|\n/g,`
`),document.execCommand("insertText",!1,e)||this._insertTextIE(e)},xn.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 h=o.textContent;o.textContent=h.substring(0,c)+e+h.substring(l),n=o,i=c+e.length}else if(o===this.content&&a===this.content){var v=document.createTextNode(e);this.content.insertBefore(v,p[c]),n=v,i=v.textContent.length}else{var f=p.indexOf(o),y=p.indexOf(a);p.forEach(function(g,x){x===f?g.textContent=o.textContent.substring(0,c)+e+a.textContent.substring(l):x>f&&x<=y&&Nn(g)}),n=o,i=c+e.length}n&&i!==void 0&&setTimeout(function(){self.setSelection(n,i)})},xn.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight<e.offsetHeight-n){var i=e.getBoundingClientRect(),r=t.scrollHeight;e.style.height=r+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:r-i.height})}},xn.prototype.resizable=function(){var e=this,t=this.parent,n=this.resizeHandle,i=parseInt(this.style.minWidth)||0,r=parseInt(this.style.minHeight)||0,o=parseInt(this.style.maxWidth)||1/0,a=parseInt(this.style.maxHeight)||1/0;if(!n){var c,l,u,p;n=this.resizeHandle=ze('<div class="djs-direct-editing-resize-handle"></div>');var h=function(f){ip(f),ta(f);var y=Lv(Vv(u+f.clientX-c,i),o),g=Lv(Vv(p+f.clientY-l,r),a);t.style.width=y+"px",t.style.height=g+"px",e.resizeHandler({width:u,height:p,dx:f.clientX-c,dy:f.clientY-l})},v=function(f){ip(f),ta(f),le.unbind(document,"mousemove",h,!1),le.unbind(document,"mouseup",v,!1)};le.bind(n,"mousedown",function(f){ip(f),ta(f),c=f.clientX,l=f.clientY;var y=t.getBoundingClientRect();u=y.width,p=y.height,le.bind(document,"mousemove",h),le.bind(document,"mouseup",v)})}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)},xn.prototype.destroy=function(){var e=this.parent,t=this.content,n=this.resizeHandle;t.innerText="",e.removeAttribute("style"),t.removeAttribute("style"),le.unbind(t,"keydown",this.keyHandler),le.unbind(t,"mousedown",ta),le.unbind(t,"input",this.autoResize),le.unbind(t,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Nn(n)),Nn(e)},xn.prototype.getValue=function(){return this.content.innerText.trim()},xn.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},xn.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=je(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 Fv={__depends__:[Ko],__init__:["directEditing"],directEditing:["type",en]};var $v=".entry";function tn(e,t,n){this._eventBus=t,this._overlays=n;var i=Mn(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){F(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 F(t,function(i){var r=i.getContextPadEntries(e);At(r)?n=r(n):F(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[Ut(c,"data-action")].action,r=t.originalEvent||t,At(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;F(t,function(r,o){var a,c=r.group||"default",l=ze(r.html||'<div class="entry" draggable="true"></div>');Ut(l,"data-action",o),(a=Ye("[data-group="+c+"]",i))||(a=ze('<div class="group" data-group="'+c+'"></div>'),i.appendChild(a)),a.appendChild(l),r.className&&function(u,p){var h=ct(u);(Se(p)?p:p.split(/\s+/g)).forEach(function(v){h.add(v)})}(l,r.className),r.title&&Ut(l,"title",r.title),r.imageUrl&&l.appendChild(ze('<img src="'+r.imageUrl+'">'))}),ct(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=ze('<div class="djs-context-pad"></div>'),r=z({html:i},this._overlaysConfig);Ht.bind(i,$v,"click",function(a){t.trigger("click",a)}),Ht.bind(i,$v,"dragstart",function(a){t.trigger("dragstart",a)}),le.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 h_={__depends__:[Ko,Ou],contextPad:["type",tn]};var m_=["marker-start","marker-mid","marker-end"],f_=["circle","ellipse","line","path","polygon","polyline","rect"];function cr(e,t,n,i){this._elementRegistry=e,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;t.on("drag.cleanup",function(){F(r._clonedMarkers,function(o){it(o)}),r._clonedMarkers={}})}cr.$inject=["elementRegistry","eventBus","canvas","styles"],cr.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},cr.prototype.addDragger=function(e,t,n){var i=sm(n=n||this.getGfx(e)),r=n.getBoundingClientRect();return this._cloneMarkers(ys(i)),W(i,this._styles.cls("djs-dragger",[],{x:r.top,y:r.left})),pe(t,i),i},cr.prototype.addFrame=function(e,t){var n=se("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return pe(t,n),n},cr.prototype._cloneMarkers=function(e){var t=this;if(e.childNodes)for(var n=0;n<e.childNodes.length;n++)t._cloneMarkers(e.childNodes[n]);(function(i){return f_.indexOf(i.nodeName)!==-1})(e)&&m_.forEach(function(i){if(W(e,i)){var r=function(o,a,c){var l=(u=W(o,a),u.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]),u;return Ye("marker#"+l,c||document)}(e,i,t._canvas.getContainer());t._cloneMarker(e,r,i)}})},cr.prototype._cloneMarker=function(e,t,n){var i=t.id,r=this._clonedMarkers[i];if(!r){var o=i+"-clone";(r=sm(t)).id=o,Ce(r).add("djs-dragger").add("djs-dragger-marker"),this._clonedMarkers[i]=r;var a=Ye("defs",this._canvas._svg);a||(a=se("defs"),pe(this._canvas._svg,a)),pe(a,r)}W(e,n,"url(#"+this._clonedMarkers[i].id+")")};const na={__init__:["previewSupport"],previewSupport:["type",cr]};var v_="drop-ok",zv="drop-not-ok",Gv="attach-ok",Uv="new-parent",Hv="create";function qv(e,t,n,i,r){function o(c,l){[Gv,v_,zv,Uv].forEach(function(u){u===l?e.addMarker(c,u):e.removeMarker(c,u)})}function a(){var c=t.context();c&&c.prefix===Hv&&t.cancel()}n.on(["create.move","create.hover"],function(c){var l=c.context,u=l.elements,p=c.hover,h=l.source,v=l.hints||{};if(!p)return l.canExecute=!1,void(l.target=null);Wv(c);var f={x:c.x,y:c.y},y=l.canExecute=p&&function(g,x,E,_,w){if(!x)return!1;var S=je(g=Ee(g,function(C){var R=C.labelTarget;return!(C.parent||function(I){return!!I.labelTarget}(C)&&g.indexOf(R)!==-1)}),function(C){return!ia(C)}),D=!1,s=!1,d=!1;Kv(g)&&(D=r.allowed("shape.attach",{position:E,shape:S,target:x})),D||(d=Kv(g)?r.allowed("shape.create",{position:E,shape:S,source:_,target:x}):r.allowed("elements.create",{elements:g,position:E,target:x}));var m=w.connectionTarget;return d||D?(S&&_&&(s=r.allowed("connection.create",{source:m===_?S:_,target:m===_?_:S,hints:{targetParent:x,targetAttach:D}})),{attach:D,connect:s}):(d===null||D===null)&&null}(u,p,f,h,v);p&&y!==null&&(l.target=p,y&&y.attach?o(p,Gv):o(p,y?Uv:zv))}),n.on(["create.end","create.out","create.cleanup"],function(c){var l=c.hover;l&&o(l,null)}),n.on("create.end",function(c){var l=c.context,u=l.source,p=l.shape,h=l.elements,v=l.target,f=l.canExecute,y=f&&f.attach,g=f&&f.connect,x=l.hints||{};if(f===!1||!v)return!1;Wv(c);var E={x:c.x,y:c.y};p=g?i.appendShape(u,p,E,v,{attach:y,connection:g===!0?{}:g,connectionTarget:x.connectionTarget}):je(h=i.createElements(h,E,v,z({},x,{attach:y})),function(_){return!ia(_)}),z(l,{elements:h,shape:p}),z(c,{elements:h,shape:p})}),n.on("create.init",function(){n.on("elements.changed",a),n.once(["create.cancel","create.end"],2e3,function(){n.off("elements.changed",a)})}),this.start=function(c,l,u){Se(l)||(l=[l]);var p=je(l,function(v){return!ia(v)});if(p){u=z({elements:l,hints:{},shape:p},u||{}),F(l,function(v){fe(v.x)||(v.x=0),fe(v.y)||(v.y=0)});var h=gt(l);F(l,function(v){ia(v)&&(v.waypoints=ht(v.waypoints,function(f){return{x:f.x-h.x-h.width/2,y:f.y-h.y-h.height/2}})),z(v,{x:v.x-h.x-h.width/2,y:v.y-h.y-h.height/2})}),t.init(c,Hv,{cursor:"grabbing",autoActivate:!0,data:{shape:p,elements:l,context:u}})}}}function Wv(e){var t=e.context.createConstraints;t&&(t.left&&(e.x=Math.max(e.x,t.left)),t.right&&(e.x=Math.min(e.x,t.right)),t.top&&(e.y=Math.max(e.y,t.top)),t.bottom&&(e.y=Math.min(e.y,t.bottom)))}function ia(e){return!!e.waypoints}function Kv(e){return e&&e.length===1&&!ia(e[0])}qv.$inject=["canvas","dragging","eventBus","modeling","rules"];function Xv(e,t,n,i,r){t.on("create.move",750,function(o){var a=o.hover,c=o.context,l=c.elements,u=c.dragGroup;u||(u=c.dragGroup=function(p){var h=se("g");W(h,r.cls("djs-drag-group",["no-events"]));var v=se("g");return p.forEach(function(f){var y;f.hidden||(f.waypoints?(y=n._createContainer("connection",v),n.drawConnection(ys(y),f)):(y=n._createContainer("shape",v),n.drawShape(ys(y),f),Lt(y,f.x,f.y)),i.addDragger(f,h,y))}),h}(l)),a?(u.parentNode||pe(e.getActiveLayer(),u),Lt(u,o.x,o.y)):it(u)}),t.on("create.cleanup",function(o){var a=o.context.dragGroup;a&&it(a)})}Xv.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const Gs={__depends__:[ei,na,Vn,On],__init__:["create","createPreview"],create:["type",qv],createPreview:["type",Xv]};var Yv="data-id",Jv=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function rt(e,t,n){var i=Mn(e&&e.scale)?e.scale:{min:1,max:1.5};this._config={scale:i},this._eventBus=t,this._canvas=n,this._providers={},this._current={}}rt.$inject=["config.popupMenu","eventBus","canvas"],rt.prototype.registerProvider=function(e,t,n){n||(n=t,t=1e3),this._eventBus.on("popupMenu.getProviders."+e,t,function(i){i.providers.push(n)})},rt.prototype.isEmpty=function(e,t){if(!e)throw new Error("element parameter is missing");if(!t)throw new Error("providerId parameter is missing");var n=this._getProviders(t);if(!n)return!0;var i=this._getEntries(e,n),r=this._getHeaderEntries(e,n),o=Io(i)>0,a=r&&Io(r)>0;return!o&&!a},rt.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(),Io(a)&&r.container.appendChild(this._createEntries(a,"djs-popup-header")),Io(o)&&r.container.appendChild(this._createEntries(o,"djs-popup-body"));var c=this._canvas.getContainer();this._attachContainer(r.container,c,n.cursor),this._bindAutoClose()},rt.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindAutoClose(),Nn(this._current.container),this._current.container=null)},rt.prototype.isOpen=function(){return!!this._current.container},rt.prototype.trigger=function(e){e.preventDefault();var t=Ut(e.delegateTarget||e.target,Yv),n=this._getEntry(t);if(n.action)return n.action.call(null,e,n)},rt.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"popupMenu.getProviders."+e,providers:[]});return this._eventBus.fire(t),t.providers},rt.prototype._getEntries=function(e,t){var n={};return F(t,function(i){if(i.getPopupMenuEntries){var r=i.getPopupMenuEntries(e);At(r)?n=r(n):F(r,function(o,a){n[a]=o})}else F(i.getEntries(e),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=vi(o,["id"])})}),n},rt.prototype._getHeaderEntries=function(e,t){var n={};return F(t,function(i){if(i.getPopupMenuHeaderEntries){var r=i.getPopupMenuHeaderEntries(e);At(r)?n=r(n):F(r,function(o,a){n[a]=o})}else{if(!i.getHeaderEntries)return;F(i.getHeaderEntries(e),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=vi(o,["id"])})}}),n},rt.prototype._getEntry=function(e){var t=this._current.entries[e];if(!t)throw new Error("entry not found");return t},rt.prototype._emit=function(e){this._eventBus.fire("popupMenu."+e)},rt.prototype._createContainer=function(){var e=ze('<div class="djs-popup">'),t=this._current.position,n=this._current.className;return z(e.style,{position:"absolute",left:t.x+"px",top:t.y+"px",visibility:"hidden"}),ct(e).add(n),e},rt.prototype._attachContainer=function(e,t,n){var i=this;Ht.bind(e,".entry","click",function(r){i.trigger(r)}),this._updateScale(e),t.appendChild(e),n&&this._assureIsInbounds(e,n)},rt.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),Mn(t)&&i<t&&(o=t),Mn(n)&&i>n&&(o=n)),function(a,c){a.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(l){a.style[l+"transform"]=c})}(e,"scale("+o+")")},rt.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,h=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=h-l+"px"):u.x?(n=p-c+"px",i=h+"px"):u.y&&h<l?(n=p+"px",i="10px"):u.y&&(n=p+"px",i=h-l+"px"),z(e.style,{left:n,top:i},{visibility:"visible","z-index":1e3})},rt.prototype._createEntries=function(e,t){var n=ze("<div>"),i=this;return ct(n).add(t),F(e,function(r,o){var a=i._createEntry(r,o);n.appendChild(a)}),n},rt.prototype._createEntry=function(e,t){var n=ze("<div>"),i=ct(n);if(i.add("entry"),e.className&&e.className.split(" ").forEach(function(o){i.add(o)}),Ut(n,Yv,t),e.label){var r=ze("<span>");r.textContent=e.label,n.appendChild(r)}return e.imageUrl&&n.appendChild(ze('<img src="'+e.imageUrl+'" />')),e.active===!0&&i.add("active"),e.disabled===!0&&i.add("disabled"),e.title&&(n.title=e.title),n},rt.prototype._bindAutoClose=function(){this._eventBus.once(Jv,this.close,this)},rt.prototype._unbindAutoClose=function(){this._eventBus.off(Jv,this.close,this)};const y_={__init__:["popupMenu"],popupMenu:["type",rt]};function ra(){}ra.prototype.get=function(){return this._data},ra.prototype.set=function(e){this._data=e},ra.prototype.clear=function(){var e=this._data;return delete this._data,e},ra.prototype.isEmpty=function(){return!this._data};const g_={clipboard:["type",ra]};function rp(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)})}rp.$inject=["eventBus"],rp.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 oa={__init__:["mouse"],mouse:["type",rp]};function En(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,h=l.elements;u.priority=1,u.id=p.id,je(h,function(v){return v===p.parent})&&(u.parent=p.parent.id),function(v){return!!v.host}(p)&&(u.priority=2,u.host=p.host.id),Us(p)&&(u.priority=3,u.source=p.source.id,u.target=p.target.id,u.waypoints=function(v){return ht(v.waypoints,function(f){return(f=Zv(f)).original&&(f.original=Zv(f.original)),f})}(p)),Hs(p)&&(u.priority=4,u.labelTarget=p.labelTarget.id),F(["x","y","width","height"],function(v){fe(p[v])&&(u[v]=p[v])}),u.hidden=p.hidden,u.collapsed=p.collapsed}),r.on("copyPaste.pasteElements",function(l){z(l.hints,{createElementsBehavior:!1})})}function Us(e){return!!e.waypoints}function Hs(e){return!!e.labelTarget}function Zv(e){return z({},e)}function Qv(e,t){var n=t.indexOf(e);return n===-1?t:t.splice(n,1)}En.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],En.prototype.copy=function(e){var t,n;return Se(e)||(e=e?[e]:[]),n=(t=this._eventBus.fire("copyPaste.canCopyElements",{elements:e}))===!1?{}:this.createTree(Se(t)?t:e),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:e,tree:n}),n},En.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||{}})}},En.prototype._paste=function(e,t,n,i){F(e,function(o){fe(o.x)||(o.x=0),fe(o.y)||(o.y=0)});var r=gt(e);return F(e,function(o){Us(o)&&(o.waypoints=ht(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))},En.prototype._createElements=function(e){var t=this,n=this._eventBus,i={},r=[];return F(e,function(o,a){F(o=mn(o,"priority"),function(c){var l,u=z({},vi(c,["priority"]));return i[c.parent]?u.parent=i[c.parent]:delete u.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:u}),Us(u)?(u.source=i[c.source],u.target=i[c.target],l=i[c.id]=t.createConnection(u),void r.push(l)):Hs(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},En.prototype.createConnection=function(e){return this._elementFactory.createConnection(vi(e,["id"]))},En.prototype.createLabel=function(e){return this._elementFactory.createLabel(vi(e,["id"]))},En.prototype.createShape=function(e){return this._elementFactory.createShape(vi(e,["id"]))},En.prototype.hasRelations=function(e,t){var n,i;return!(Us(e)&&(n=je(t,fn({id:e.source.id})),i=je(t,fn({id:e.target.id})),!n||!i))&&!(Hs(e)&&!je(t,fn({id:e.labelTarget.id})))},En.prototype.createTree=function(e){var t=this._rules,n=this,i={},r=[];function o(a,c){var l=je(r,function(u){return a===u.element});l?l.depth<c&&(r=function(u,p){var h=p.indexOf(u);return h!==-1&&p.splice(h,1),p}(l,r),r.push({element:l.element,depth:c})):r.push({element:a,depth:c})}return Zi(fm(e),function(a,c,l){if(!Hs(a))return F(a.labels,function(u){o(u,l)}),F([a.attachers,a.incoming,a.outgoing],function(u){u&&u.length&&F(u,function(p){F(p.labels,function(h){o(h,l)}),o(p,l)})}),o(a,l),a.children}),e=ht(r,function(a){return a.element}),r=ht(r,function(a){return a.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:a.descriptor,element:a.element,elements:e}),a}),r=mn(r,function(a){return a.descriptor.priority}),e=ht(r,function(a){return a.element}),F(r,function(a){var c=a.depth;n.hasRelations(a.element,e)&&function(l,u){return t.allowed("element.copy",{element:l,elements:u})}(a.element,e)?(i[c]||(i[c]=[]),i[c].push(a.descriptor)):Qv(a.element,e)}),i};const b_={__depends__:[g_,Gs,oa,Vn],__init__:["copyPaste"],copyPaste:["type",En]};function qs(e,t,n){Se(n)||(n=[n]),F(n,function(i){No(e[i])||(t[i]=e[i])})}function ey(e,t,n){var i;t.on("copyPaste.copyElement",750,function(r){var o=r.descriptor,a=r.element,c=o.oldBusinessObject=re(a);if(o.type=a.type,qs(c,o,"name"),o.di={},qs(c.di,o.di,["fill","stroke","background-color","border-color","color"]),qs(c.di,o,"isExpanded"),ty(o))return o;c.default&&(o.default=c.default.id)}),t.on("moddleCopy.canCopyProperty",function(r){var o,a=r.parent,c=r.property;if(r.propertyName==="processRef"&&A(a,"bpmn:Participant")&&A(c,"bpmn:Process"))return o=e.create("bpmn:Process"),n.copyElement(c,o)}),t.on("copyPaste.pasteElements",function(){i={}}),t.on("copyPaste.pasteElement",function(r){var o,a,c,l=r.cache,u=r.descriptor,p=u.oldBusinessObject;ty(u)?u.businessObject=re(l[u.labelTarget]):(o=e.create(p.$type),u.businessObject=n.copyElement(p,o),function(h,v){var f=re(h);h.default&&(i[h.default]={element:f,property:"default"}),h.host&&(re(h).attachedToRef=re(v[h.host])),i=vi(i,Gt(i,function(y,g,x){var E=g.element,_=g.property;return x===h.id&&(E[_]=f,y.push(h.id)),y},[]))}(u,l),qs(u,o,["isExpanded","name"]),a=u,Se(c="oldBusinessObject")||(c=[c]),F(c,function(h){a[h]&&delete a[h]}))})}function ty(e){return!!e.labelTarget}ey.$inject=["bpmnFactory","eventBus","moddleCopy"];var x_=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing"];function aa(e,t,n){this._bpmnFactory=t,this._eventBus=e,this._moddle=n,e.on("moddleCopy.canCopyProperties",function(i){var r=i.propertyNames;if(r&&r.length)return mn(r,function(o){return o==="extensionElements"})}),e.on("moddleCopy.canCopyProperty",function(i){var r=i.parent,o=Tt(r)&&r.$descriptor,a=i.propertyName;return(!a||x_.indexOf(a)===-1)&&!(a&&o&&!je(o.properties,fn({name:a})))&&void 0}),e.on("moddleCopy.canSetCopiedProperty",function(i){var r,o,a=i.property;if(o="bpmn:ExtensionElements",(r=a)&&typeof r.$instanceOf=="function"&&r.$instanceOf(o)&&(!a.values||!a.values.length))return!1})}function op(e,t){return Gt(e.properties,function(n,i){return t&&i.default?n:n.concat(i.name)},[])}aa.$inject=["eventBus","bpmnFactory","moddle"],aa.prototype.copyElement=function(e,t,n){var i=this;n&&!Se(n)&&(n=[n]),n=n||op(e.$descriptor);var r=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:e,targetElement:t});return r===!1||(Se(r)&&(n=r),F(n,function(o){var a;fi(e,o)&&(a=e.get(o));var c=i.copyProperty(a,t,o);i._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:t,property:c,propertyName:o})!==!1&&Mn(c)&&t.set(o,c)})),t},aa.prototype.copyProperty=function(e,t,n){var i=this,r=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:t,property:e,propertyName:n});if(r!==!1){if(r)return Tt(r)&&r.$type&&!r.$parent&&(r.$parent=t),r;var o=this._moddle.getPropertyDescriptor(t,n);if(!o.isReference)return o.isId?this._copyId(e,t):Se(e)?Gt(e,function(a,c){return(r=i.copyProperty(c,t,n))?(r.$parent=t,a.concat(r)):a},[]):Tt(e)&&e.$type?this._moddle.getElementDescriptor(e).isGeneric?void 0:((r=i._bpmnFactory.create(e.$type)).$parent=t,r=i.copyElement(e,r)):e}},aa.prototype._copyId=function(e,t){return this._moddle.ids.assigned(e)?void 0:(this._moddle.ids.claim(e,t),e)};const ny={__depends__:[b_],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",ey],moddleCopy:["type",aa]};var iy=Math.round;function ap(e){this._modeling=e}ap.$inject=["modeling"],ap.prototype.replaceElement=function(e,t,n){if(e.waypoints)return null;var i=this._modeling,r=t.width||e.width,o=t.height||e.height,a=t.x||e.x,c=t.y||e.y,l=iy(a+r/2),u=iy(c+o/2);return i.replaceShape(e,z({},t,{x:l,y:u,width:r,height:o}),n)};const E_={__init__:["replace"],replace:["type",ap]};var w_=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function ry(e,t,n,i,r,o,a){this.replaceElement=function(c,l,u){u=u||{};var p=l.type,h=c.businessObject;if(Ws(h)&&p==="bpmn:SubProcess"&&function(w,S){var D=w&&fi(w,"collapsed")?w.collapsed:!Oe(w);return D!==(S&&(fi(S,"collapsed")||fi(S,"isExpanded"))?fi(S,"collapsed")?S.collapsed:!S.isExpanded:D)&&(w.collapsed=D,!0)}(c,l))return i.toggleCollapse(c),c;var v,f=e.create(p),y={type:p,businessObject:f},g=op(h.$descriptor),x=op(f.$descriptor,!0),E=(v=x,g.filter(function(w){return v.indexOf(w)!==-1}));z(f,Rn(l,w_));var _=Ee(E,function(w){return w==="eventDefinitions"?oy(c,l.eventDefinitionType):w==="loopCharacteristics"?!Ft(f):!fi(f,w)&&(w!=="processRef"||l.isExpanded!==!1)&&w!=="triggeredByEvent"});return f=n.copyElement(h,f,_),l.eventDefinitionType&&(oy(f,l.eventDefinitionType)||(y.eventDefinitionType=l.eventDefinitionType,y.eventDefinitionAttrs=l.eventDefinitionAttrs)),A(h,"bpmn:Activity")&&(Ws(h)?y.isExpanded=Oe(h):l&&fi(l,"isExpanded")&&(y.isExpanded=l.isExpanded),Oe(h)&&!A(h,"bpmn:Task")&&y.isExpanded&&(y.width=c.width,y.height=c.height)),Ws(h)&&!Ws(f)&&(u.moveChildren=!1),A(h,"bpmn:Participant")&&(l.isExpanded===!0?f.processRef=e.create("bpmn:Process"):u.moveChildren=!1,y.width=c.width,y.height=t._getDefaultSize(f).height),o.allowed("shape.resize",{shape:f})||(y.height=t._getDefaultSize(f).height,y.width=t._getDefaultSize(f).width),f.name=h.name,Pe(h,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&Pe(f,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(f.default=h.default),l.host&&!A(h,"bpmn:BoundaryEvent")&&A(f,"bpmn:BoundaryEvent")&&(y.host=l.host),y.type!=="bpmn:DataStoreReference"&&y.type!=="bpmn:DataObjectReference"||(y.x=c.x+(c.width-y.width)/2),y.di={},function(w,S,D){Se(D)||(D=[D]),F(D,function(s){No(w[s])||(S[s]=w[s])})}(h.di,y.di,["fill","stroke","background-color","border-color","color"]),y=r.replaceElement(c,y,u),u.select!==!1&&a.select(y),y}}function Ws(e){return A(e,"bpmn:SubProcess")}function oy(e,t){var n=re(e);return t&&n.get("eventDefinitions").some(function(i){return A(i,t)})}ry.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules","selection"];const ay={__depends__:[ny,E_,On],bpmnReplace:["type",ry]};function sy(e){return function(t){var n=t.target,i=re(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,c=i.triggeredByEvent===n.triggeredByEvent,l=n.isExpanded===void 0||n.isExpanded===Oe(i);return!(o&&a&&c&&l)}}var __=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message Start Event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Start Event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional Start Event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal Start Event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],S_=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throwing",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}}],C_=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message Intermediate Catch Event",actionName:"replace-with-message-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Message Intermediate Throw Event",actionName:"replace-with-message-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-message",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Intermediate Catch Event",actionName:"replace-with-timer-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation Intermediate Throw Event",actionName:"replace-with-escalation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-escalation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional Intermediate Catch Event",actionName:"replace-with-conditional-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Link Intermediate Catch Event",actionName:"replace-with-link-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-link",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Link Intermediate Throw Event",actionName:"replace-with-link-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-link",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:LinkEventDefinition",eventDefinitionAttrs:{name:""}}},{label:"Compensation Intermediate Throw Event",actionName:"replace-with-compensation-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-compensation",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal Intermediate Catch Event",actionName:"replace-with-signal-intermediate-catch",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Signal Intermediate Throw Event",actionName:"replace-with-signal-intermediate-throw",className:"bpmn-icon-intermediate-event-throw-signal",target:{type:"bpmn:IntermediateThrowEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}}],T_=[{label:"Start Event",actionName:"replace-with-none-start",className:"bpmn-icon-start-event-none",target:{type:"bpmn:StartEvent"}},{label:"Intermediate Throw Event",actionName:"replace-with-none-intermediate-throw",className:"bpmn-icon-intermediate-event-none",target:{type:"bpmn:IntermediateThrowEvent"}},{label:"End Event",actionName:"replace-with-none-end",className:"bpmn-icon-end-event-none",target:{type:"bpmn:EndEvent"}},{label:"Message End Event",actionName:"replace-with-message-end",className:"bpmn-icon-end-event-message",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Escalation End Event",actionName:"replace-with-escalation-end",className:"bpmn-icon-end-event-escalation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Error End Event",actionName:"replace-with-error-end",className:"bpmn-icon-end-event-error",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel End Event",actionName:"replace-with-cancel-end",className:"bpmn-icon-end-event-cancel",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Compensation End Event",actionName:"replace-with-compensation-end",className:"bpmn-icon-end-event-compensation",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Signal End Event",actionName:"replace-with-signal-end",className:"bpmn-icon-end-event-signal",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Terminate End Event",actionName:"replace-with-terminate-end",className:"bpmn-icon-end-event-terminate",target:{type:"bpmn:EndEvent",eventDefinitionType:"bpmn:TerminateEventDefinition"}}],A_=[{label:"Exclusive Gateway",actionName:"replace-with-exclusive-gateway",className:"bpmn-icon-gateway-xor",target:{type:"bpmn:ExclusiveGateway"}},{label:"Parallel Gateway",actionName:"replace-with-parallel-gateway",className:"bpmn-icon-gateway-parallel",target:{type:"bpmn:ParallelGateway"}},{label:"Inclusive Gateway",actionName:"replace-with-inclusive-gateway",className:"bpmn-icon-gateway-or",target:{type:"bpmn:InclusiveGateway"}},{label:"Complex Gateway",actionName:"replace-with-complex-gateway",className:"bpmn-icon-gateway-complex",target:{type:"bpmn:ComplexGateway"}},{label:"Event based Gateway",actionName:"replace-with-event-based-gateway",className:"bpmn-icon-gateway-eventbased",target:{type:"bpmn:EventBasedGateway",instantiate:!1,eventGatewayType:"Exclusive"}}],k_=[{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}},{label:"Event Sub Process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}},{label:"Sub Process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}}],P_=[{label:"Sub Process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Event Sub Process",actionName:"replace-with-event-subprocess",className:"bpmn-icon-event-subprocess-expanded",target:{type:"bpmn:SubProcess",triggeredByEvent:!0,isExpanded:!0}}],M_=[{label:"Sub Process",actionName:"replace-with-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}},{label:"Transaction",actionName:"replace-with-transaction",className:"bpmn-icon-transaction",target:{type:"bpmn:Transaction",isExpanded:!0}}],cy=[{label:"Task",actionName:"replace-with-task",className:"bpmn-icon-task",target:{type:"bpmn:Task"}},{label:"Send Task",actionName:"replace-with-send-task",className:"bpmn-icon-send",target:{type:"bpmn:SendTask"}},{label:"Receive Task",actionName:"replace-with-receive-task",className:"bpmn-icon-receive",target:{type:"bpmn:ReceiveTask"}},{label:"User Task",actionName:"replace-with-user-task",className:"bpmn-icon-user",target:{type:"bpmn:UserTask"}},{label:"Manual Task",actionName:"replace-with-manual-task",className:"bpmn-icon-manual",target:{type:"bpmn:ManualTask"}},{label:"Business Rule Task",actionName:"replace-with-rule-task",className:"bpmn-icon-business-rule",target:{type:"bpmn:BusinessRuleTask"}},{label:"Service Task",actionName:"replace-with-service-task",className:"bpmn-icon-service",target:{type:"bpmn:ServiceTask"}},{label:"Script Task",actionName:"replace-with-script-task",className:"bpmn-icon-script",target:{type:"bpmn:ScriptTask"}},{label:"Call Activity",actionName:"replace-with-call-activity",className:"bpmn-icon-call-activity",target:{type:"bpmn:CallActivity"}},{label:"Sub Process (collapsed)",actionName:"replace-with-collapsed-subprocess",className:"bpmn-icon-subprocess-collapsed",target:{type:"bpmn:SubProcess",isExpanded:!1}},{label:"Sub Process (expanded)",actionName:"replace-with-expanded-subprocess",className:"bpmn-icon-subprocess-expanded",target:{type:"bpmn:SubProcess",isExpanded:!0}}],R_=[{label:"Data Store Reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],N_=[{label:"Data Object Reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],I_=[{label:"Message Boundary Event",actionName:"replace-with-message-boundary",className:"bpmn-icon-intermediate-event-catch-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Boundary Event",actionName:"replace-with-timer-boundary",className:"bpmn-icon-intermediate-event-catch-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Escalation Boundary Event",actionName:"replace-with-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Conditional Boundary Event",actionName:"replace-with-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Error Boundary Event",actionName:"replace-with-error-boundary",className:"bpmn-icon-intermediate-event-catch-error",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Cancel Boundary Event",actionName:"replace-with-cancel-boundary",className:"bpmn-icon-intermediate-event-catch-cancel",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CancelEventDefinition"}},{label:"Signal Boundary Event",actionName:"replace-with-signal-boundary",className:"bpmn-icon-intermediate-event-catch-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Compensation Boundary Event",actionName:"replace-with-compensation-boundary",className:"bpmn-icon-intermediate-event-catch-compensation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Message Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-message-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-message",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:MessageEventDefinition",cancelActivity:!1}},{label:"Timer Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-timer",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:TimerEventDefinition",cancelActivity:!1}},{label:"Escalation Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-escalation",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",cancelActivity:!1}},{label:"Conditional Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-condition",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",cancelActivity:!1}},{label:"Signal Boundary Event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-boundary",className:"bpmn-icon-intermediate-event-catch-non-interrupting-signal",target:{type:"bpmn:BoundaryEvent",eventDefinitionType:"bpmn:SignalEventDefinition",cancelActivity:!1}}],D_=[{label:"Message Start Event",actionName:"replace-with-message-start",className:"bpmn-icon-start-event-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition"}},{label:"Timer Start Event",actionName:"replace-with-timer-start",className:"bpmn-icon-start-event-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition"}},{label:"Conditional Start Event",actionName:"replace-with-conditional-start",className:"bpmn-icon-start-event-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition"}},{label:"Signal Start Event",actionName:"replace-with-signal-start",className:"bpmn-icon-start-event-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition"}},{label:"Error Start Event",actionName:"replace-with-error-start",className:"bpmn-icon-start-event-error",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ErrorEventDefinition"}},{label:"Escalation Start Event",actionName:"replace-with-escalation-start",className:"bpmn-icon-start-event-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition"}},{label:"Compensation Start Event",actionName:"replace-with-compensation-start",className:"bpmn-icon-start-event-compensation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:CompensateEventDefinition"}},{label:"Message Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-message-start",className:"bpmn-icon-start-event-non-interrupting-message",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:MessageEventDefinition",isInterrupting:!1}},{label:"Timer Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-timer-start",className:"bpmn-icon-start-event-non-interrupting-timer",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:TimerEventDefinition",isInterrupting:!1}},{label:"Conditional Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-conditional-start",className:"bpmn-icon-start-event-non-interrupting-condition",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:ConditionalEventDefinition",isInterrupting:!1}},{label:"Signal Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-signal-start",className:"bpmn-icon-start-event-non-interrupting-signal",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:SignalEventDefinition",isInterrupting:!1}},{label:"Escalation Start Event (non-interrupting)",actionName:"replace-with-non-interrupting-escalation-start",className:"bpmn-icon-start-event-non-interrupting-escalation",target:{type:"bpmn:StartEvent",eventDefinitionType:"bpmn:EscalationEventDefinition",isInterrupting:!1}}],B_=[{label:"Sequence Flow",actionName:"replace-with-sequence-flow",className:"bpmn-icon-connection"},{label:"Default Flow",actionName:"replace-with-default-flow",className:"bpmn-icon-default-flow"},{label:"Conditional Flow",actionName:"replace-with-conditional-flow",className:"bpmn-icon-conditional-flow"}],O_=[{label:"Expanded Pool",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(e){var t="Empty Pool";return e.children&&e.children.length&&(t+=" (removes content)"),t},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}];function nn(e,t,n,i,r,o,a){this._bpmnFactory=e,this._popupMenu=t,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this.register()}nn.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate"],nn.prototype.register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},nn.prototype.getEntries=function(e){var t,n=e.businessObject;if(!this._rules.allowed("shape.replace",{element:e}))return[];var i=sy(e);return A(n,"bpmn:DataObjectReference")?this._createEntries(e,R_):A(n,"bpmn:DataStoreReference")?this._createEntries(e,N_):A(n,"bpmn:StartEvent")&&!A(n.$parent,"bpmn:SubProcess")?(t=Ee(__,i),this._createEntries(e,t)):A(n,"bpmn:Participant")?(t=Ee(O_,function(r){return Oe(n)!==r.target.isExpanded}),this._createEntries(e,t)):A(n,"bpmn:StartEvent")&&Ft(n.$parent)?(t=Ee(D_,function(r){var o=r.target.isInterrupting!==!1,a=re(e).isInterrupting===o;return i(r)||!i(r)&&!a}),this._createEntries(e,t)):A(n,"bpmn:StartEvent")&&!Ft(n.$parent)&&A(n.$parent,"bpmn:SubProcess")?(t=Ee(S_,i),this._createEntries(e,t)):A(n,"bpmn:EndEvent")?(t=Ee(T_,function(r){return!(r.target.eventDefinitionType=="bpmn:CancelEventDefinition"&&!A(n.$parent,"bpmn:Transaction"))&&i(r)}),this._createEntries(e,t)):A(n,"bpmn:BoundaryEvent")?(t=Ee(I_,function(r){var o=r.target;if(o.eventDefinitionType=="bpmn:CancelEventDefinition"&&!A(n.attachedToRef,"bpmn:Transaction"))return!1;var a=o.cancelActivity!==!1,c=n.cancelActivity==a;return i(r)||!i(r)&&!c}),this._createEntries(e,t)):A(n,"bpmn:IntermediateCatchEvent")||A(n,"bpmn:IntermediateThrowEvent")?(t=Ee(C_,i),this._createEntries(e,t)):A(n,"bpmn:Gateway")?(t=Ee(A_,i),this._createEntries(e,t)):A(n,"bpmn:Transaction")?(t=Ee(P_,i),this._createEntries(e,t)):Ft(n)&&Oe(n)?(t=Ee(M_,i),this._createEntries(e,t)):A(n,"bpmn:SubProcess")&&Oe(n)?(t=Ee(k_,i),this._createEntries(e,t)):A(n,"bpmn:AdHocSubProcess")&&!Oe(n)?(t=Ee(cy,function(r){var o=r.target,a=o.type==="bpmn:SubProcess",c=o.isExpanded===!0;return sy(e)&&(!a||c)}),this._createEntries(e,t)):A(n,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,B_):A(n,"bpmn:FlowNode")?(t=Ee(cy,i),A(n,"bpmn:SubProcess")&&!Oe(n)&&(t=Ee(t,function(r){return r.label!=="Sub Process (collapsed)"})),this._createEntries(e,t)):[]},nn.prototype.getHeaderEntries=function(e){var t=[];return A(e,"bpmn:Activity")&&!Ft(e)&&(t=t.concat(this._getLoopEntries(e))),A(e,"bpmn:DataObjectReference")&&(t=t.concat(this._getDataObjectIsCollection(e))),A(e,"bpmn:Participant")&&(t=t.concat(this._getParticipantMultiplicity(e))),!A(e,"bpmn:SubProcess")||A(e,"bpmn:Transaction")||Ft(e)||t.push(this._getAdHocEntry(e)),t},nn.prototype._createEntries=function(e,t){var n=[],i=this;return F(t,function(r){var o=i._createMenuEntry(r,e);n.push(o)}),n},nn.prototype._createSequenceFlowEntries=function(e,t){var n=re(e),i=[],r=this._modeling,o=this._moddle,a=this;return F(t,function(c){switch(c.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(A(n.sourceRef,"bpmn:ExclusiveGateway")||A(n.sourceRef,"bpmn:InclusiveGateway")||A(n.sourceRef,"bpmn:ComplexGateway")||A(n.sourceRef,"bpmn:Activity"))&&i.push(a._createMenuEntry(c,e,function(){r.updateProperties(e.source,{default:n})}));break;case"replace-with-conditional-flow":!n.conditionExpression&&A(n.sourceRef,"bpmn:Activity")&&i.push(a._createMenuEntry(c,e,function(){var l=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:l})}));break;default:if(A(n.sourceRef,"bpmn:Activity")&&n.conditionExpression)return i.push(a._createMenuEntry(c,e,function(){r.updateProperties(e,{conditionExpression:void 0})}));if((A(n.sourceRef,"bpmn:ExclusiveGateway")||A(n.sourceRef,"bpmn:InclusiveGateway")||A(n.sourceRef,"bpmn:ComplexGateway")||A(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n)return i.push(a._createMenuEntry(c,e,function(){r.updateProperties(e.source,{default:void 0})}))}}),i},nn.prototype._createMenuEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=e.label;return o&&typeof o=="function"&&(o=o(t)),n=n||function(){return r(t,e.target)},{label:i(o),className:e.className,id:e.actionName,action:n}},nn.prototype._getLoopEntries=function(e){var t=this,n=this._translate;function i(l,u){var p;u.active?p=void 0:(p=t._moddle.create(u.options.loopCharacteristics),u.options.isSequential&&(p.isSequential=u.options.isSequential)),t._modeling.updateProperties(e,{loopCharacteristics:p})}var r,o,a,c=re(e).loopCharacteristics;return c&&(r=c.isSequential,o=c.isSequential===void 0,a=c.isSequential!==void 0&&!c.isSequential),[{id:"toggle-parallel-mi",className:"bpmn-icon-parallel-mi-marker",title:n("Parallel Multi Instance"),active:a,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},{id:"toggle-sequential-mi",className:"bpmn-icon-sequential-mi-marker",title:n("Sequential Multi Instance"),active:r,action:i,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},{id:"toggle-loop",className:"bpmn-icon-loop-marker",title:n("Loop"),active:o,action:i,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}]},nn.prototype._getDataObjectIsCollection=function(e){var t=this,n=this._translate,i=e.businessObject.dataObjectRef,r=i.isCollection;return[{id:"toggle-is-collection",className:"bpmn-icon-parallel-mi-marker",title:n("Collection"),active:r,action:function(o,a){t._modeling.updateModdleProperties(e,i,{isCollection:!a.active})}}]},nn.prototype._getParticipantMultiplicity=function(e){var t=this,n=this._bpmnFactory,i=this._translate,r=e.businessObject.participantMultiplicity,o=[{id:"toggle-participant-multiplicity",className:"bpmn-icon-parallel-mi-marker",title:i("Participant Multiplicity"),active:!!r,action:function(a,c){var l;c.active||(l=n.create("bpmn:ParticipantMultiplicity")),t._modeling.updateProperties(e,{participantMultiplicity:l})}}];return o},nn.prototype._getAdHocEntry=function(e){var t=this._translate,n=A(re(e),"bpmn:AdHocSubProcess"),i=this._bpmnReplace.replaceElement;return{id:"toggle-adhoc",className:"bpmn-icon-ad-hoc-marker",title:t("Ad-hoc"),active:n,action:function(r,o){return i(e,n?{type:"bpmn:SubProcess"}:{type:"bpmn:AdHocSubProcess"},{autoResize:!1,layoutConnection:!1})}}};const j_={__depends__:[y_,ay],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",nn]};var Ks=Math.max,Xs=Math.min,L_=20;function ly(e,t){return{top:e.top-t.top,right:e.right-t.right,bottom:e.bottom-t.bottom,left:e.left-t.left}}function Ys(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return fe(r)&&(i=(/top|left/.test(e)?Xs:Ks)(i,r)),fe(o)&&(i=(/top|left/.test(e)?Ks:Xs)(i,o)),i}function sa(e,t){return e!==void 0?e:L_}function V_(e){return!e.waypoints&&e.type!=="label"}function uy(e,t){var n;if((n=e.length===void 0?Ee(e.children,V_):e).length)return function(i,r){var o,a,c,l;return typeof r=="object"?(o=sa(r.left),a=sa(r.right),c=sa(r.top),l=sa(r.bottom)):o=a=c=l=sa(r),{x:i.x-o,y:i.y-c,width:i.width+o+a,height:i.height+c+l}}(gt(n),t)}var Js=Math.abs,F_=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],co=30;function Zs(e,t){return t=t||[],e.children.filter(function(n){A(n,"bpmn:Lane")&&(Zs(n,t),t.push(n))}),t}function Pi(e){return e.children.filter(function(t){return A(t,"bpmn:Lane")})}function wn(e){return js(e,F_)||e}function $_(e,t){var n=wn(e),i=Zs(n,A(n,"bpmn:Process")?[]:[n]),r=ce(e),o=ce(t),a=function(l,u){return ly(ce(u),ce(l))}(e,t),c=[];return i.forEach(function(l){if(l!==e){var u,p,h=0,v=a.right,f=0,y=a.left,g=ce(l);a.top&&(Js(g.bottom-r.top)<10&&(f=o.top-g.bottom),Js(g.top-r.top)<5&&(h=o.top-g.top)),a.bottom&&(Js(g.top-r.bottom)<10&&(h=o.bottom-g.top),Js(g.bottom-r.bottom)<5&&(f=o.bottom-g.bottom)),(h||v||f||y)&&c.push({shape:l,newBounds:(u=l,p={top:h,right:v,bottom:f,left:y},{x:u.x+(p.left||0),y:u.y+(p.top||0),width:u.width-(p.left||0)+(p.right||0),height:u.height-(p.top||0)+(p.bottom||0)})})}}),c}function sp(e,t,n,i,r,o,a,c,l,u,p,h){e=e||{},i.registerProvider(this),this._contextPad=i,this._modeling=r,this._elementFactory=o,this._connect=a,this._create=c,this._popupMenu=l,this._canvas=u,this._rules=p,this._translate=h,e.autoPlace!==!1&&(this._autoPlace=t.get("autoPlace",!1)),n.on("create.end",250,function(v){var f=v.context.shape;if(to(v)&&i.isOpen(f)){var y=i.getEntries(f);y.replace&&y.replace.action.click(v,f)}})}function py(e,t,n){var i=e.$instanceOf(t),r=!1;return F(e.eventDefinitions||[],function(o){o.$type===n&&(r=!0)}),i&&r}sp.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate"],sp.prototype.getContextPadEntries=function(e){var t=this._contextPad,n=this._modeling,i=this._elementFactory,r=this._connect,o=this._create,a=this._popupMenu,c=this._canvas,l=this._rules,u=this._autoPlace,p=this._translate,h={};if(e.type==="label")return h;var v=e.businessObject;function f(_,w){r.start(_,w)}function y(_,w,S,D){function s(m,C){var R=i.createShape(z({type:_},D));o.start(m,R,{source:C})}typeof S!="string"&&(D=S,S=p("Append {type}",{type:_.replace(/^bpmn:/,"")}));var d=u?function(m,C){var R=i.createShape(z({type:_},D));u.append(C,R)}:s;return{group:"model",className:w,title:S,action:{dragstart:s,click:d}}}function g(_){return function(w,S){n.splitLane(S,_),t.open(S,!0)}}if(Pe(v,["bpmn:Lane","bpmn:Participant"])&&Oe(v)){var x=Pi(e);z(h,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:p("Add Lane above"),action:{click:function(_,w){n.addLane(w,"top")}}}}),x.length<2&&(e.height>=120&&z(h,{"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(h,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:p("Divide into three Lanes"),action:{click:g(3)}}})),z(h,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:p("Add Lane below"),action:{click:function(_,w){n.addLane(w,"bottom")}}}})}A(v,"bpmn:FlowNode")&&(A(v,"bpmn:EventBasedGateway")?z(h,{"append.receive-task":y("bpmn:ReceiveTask","bpmn-icon-receive-task",p("Append ReceiveTask")),"append.message-intermediate-event":y("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",p("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":y("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",p("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":y("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",p("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":y("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",p("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):py(v,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?z(h,{"append.compensation-activity":y("bpmn:Task","bpmn-icon-task",p("Append compensation activity"),{isForCompensation:!0})}):A(v,"bpmn:EndEvent")||v.isForCompensation||py(v,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||Ft(v)||z(h,{"append.end-event":y("bpmn:EndEvent","bpmn-icon-end-event-none",p("Append EndEvent")),"append.gateway":y("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",p("Append Gateway")),"append.append-task":y("bpmn:Task","bpmn-icon-task",p("Append Task")),"append.intermediate-event":y("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",p("Append Intermediate/Boundary Event"))})),a.isEmpty(e,"bpmn-replace")||z(h,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:p("Change type"),action:{click:function(_,w){var S=z(function(D){var s=c.getContainer(),d=t.getPad(D).html,m=s.getBoundingClientRect(),C=d.getBoundingClientRect(),R=C.top-m.top;return{x:C.left-m.left,y:R+C.height+5}}(w),{cursor:{x:_.x,y:_.y}});a.open(w,"bpmn-replace",S)}}}}),Pe(v,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(h,{"append.text-annotation":y("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using "+(v.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:f,dragstart:f}}}),A(v,"bpmn:TextAnnotation")&&z(h,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using Association"),action:{click:f,dragstart:f}}}),Pe(v,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(h,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using DataInputAssociation"),action:{click:f,dragstart:f}}}),A(v,"bpmn:Group")&&z(h,{"append.text-annotation":y("bpmn:TextAnnotation","bpmn-icon-text-annotation")});var E=l.allowed("elements.delete",{elements:[e]});return Se(E)&&(E=E[0]===e),E&&z(h,{delete:{group:"edit",className:"bpmn-icon-trash",title:p("Remove"),action:{click:function(_){n.removeElements([e])}}}}),h};const z_={__depends__:[Fv,h_,On,np,Gs,j_],__init__:["contextPadProvider"],contextPadProvider:["type",sp]};var G_={horizontal:["x","width"],vertical:["y","height"]};function ni(e){this._modeling=e,this._filters=[],this.registerFilter(function(t,n,i){var r,o=0,a=0;return F(t,function(c){c.waypoints||c.labelTarget||(o+=c[i],a+=1)}),r=Math.round(o/a),Ee(t,function(c){return c[i]<r+50})})}ni.$inject=["modeling"],ni.prototype.registerFilter=function(e){if(typeof e!="function")throw new Error("the filter has to be a function");this._filters.push(e)},ni.prototype.trigger=function(e,t){var n,i,r=this._modeling;if(!(e.length<3||(this._setOrientation(t),i=this._filterElements(e),(n=this._createGroups(i)).length<=2)))return r.distributeElements(n,this._axis,this._dimension),n},ni.prototype._filterElements=function(e){var t=this._filters,n=this._axis,i=this._dimension,r=[].concat(e);return t.length?(F(t,function(o){r=o(r,n,i)}),r):e},ni.prototype._createGroups=function(e){var t=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');return F(mn(e,i),function(o,a){var c,l=n._findRange(o,i,r),u=t[t.length-1];u&&n._hasIntersection(u.range,l)?t[t.length-1].elements.push(o):(c={range:l,elements:[o]},t.push(c))}),t},ni.prototype._setOrientation=function(e){var t=G_[e];this._axis=t[0],this._dimension=t[1]},ni.prototype._hasIntersection=function(e,t){return Math.max(e.min,e.max)>=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},ni.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};const U_={__init__:["distributeElements"],distributeElements:["type",ni]};function dy(e){e.registerFilter(function(t){return Ee(t,function(n){var i=Pe(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:Participant","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)})})}dy.$inject=["distributeElements"];const H_={__depends__:[U_],__init__:["bpmnDistributeElements"],bpmnDistributeElements:["type",dy]};var hy="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 cp(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 h,v=c.allowed("elements.delete",{elements:p});v!==!1&&(h=Se(v)?v:p).length&&n.removeElements(h.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 cp(e,hy);return this._actions[e](t)},rn.prototype.register=function(e,t){var n=this;if(typeof e=="string")return this._registerAction(e,t);F(e,function(i,r){n._registerAction(r,i)})},rn.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw cp(e,"is already registered");this._actions[e]=t},rn.prototype.unregister=function(e){if(!this.isRegistered(e))throw cp(e,hy);this._actions[e]=void 0},rn.prototype.getActions=function(){return Object.keys(this._actions)},rn.prototype.isRegistered=function(e){return!!this._actions[e]};const q_={__init__:["editorActions"],editorActions:["type",rn]};function Qs(e){e.invoke(rn,this)}ae(Qs,rn),Qs.$inject=["injector"],Qs.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),h=e.get("searchPad",!1),v=e.get("modeling",!1);t&&n&&i&&this._registerAction("selectElements",function(){var f=t.getRootElement(),y=n.filter(function(g){return g!==f});return i.select(y),y}),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 y=i.get(),g=f.type;y.length&&l.trigger(y,g)}),i&&u&&this._registerAction("alignElements",function(f){var y=i.get(),g=[],x=f.type;y.length&&(g=Ee(y,function(E){return!A(E,"bpmn:Lane")}),u.trigger(g,x))}),i&&v&&this._registerAction("setColor",function(f){var y=i.get();y.length&&v.setColor(y,f)}),i&&p&&this._registerAction("directEditing",function(){var f=i.get();f.length&&p.activate(f[0])}),h&&this._registerAction("find",function(){h.toggle()}),t&&v&&this._registerAction("moveToOrigin",function(){var f,y,g=t.getRootElement();f=gt(y=A(g,"bpmn:Collaboration")?n.filter(function(x){return A(x.parent,"bpmn:Collaboration")}):n.filter(function(x){return x!==g&&!A(x.parent,"bpmn:SubProcess")})),v.moveElements(y,{x:-f.x,y:-f.y},g)})};const W_={__depends__:[q_],editorActions:["type",Qs]};function my(e){e.on(["create.init","shape.move.init"],function(t){var n=t.context;Pe(t.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}my.$inject=["eventBus"];function lp(e,t,n){return n||(n="round"),Math[n](e/t)*t}function Mi(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&&Kt(a))){var c=o.context,l=c.gridSnappingContext;l||(l=c.gridSnappingContext={}),["x","y"].forEach(function(u){var p={},h=function(f,y,g){var x=f.context,E=f.shape,_=x.gridSnappingContext,w=_.snapLocation,S=_.snapOffset;return S&&fe(S[y])||(S||(S=_.snapOffset={}),fe(S[y])||(S[y]=0),!E)||(g.get(E.id)||(ec(y)?S[y]+=E[y]+E.width/2:S[y]+=E[y]+E.height/2),!w)||(y==="x"?/left/.test(w)?S[y]-=E.width/2:/right/.test(w)&&(S[y]+=E.width/2):/top/.test(w)?S[y]-=E.height/2:/bottom/.test(w)&&(S[y]+=E.height/2)),S[y]}(o,u,e);h&&(p.offset=h);var v=function(f,y){var g=f.context,x=g.createConstraints,E=g.resizeConstraints||{},_=g.gridSnappingContext,w=_.snapConstraints;if(w&&w[y])return w[y];w||(w=_.snapConstraints={}),w[y]||(w[y]={});var S=g.direction;x&&(ec(y)?(w.x.min=x.left,w.x.max=x.right):(w.y.min=x.top,w.y.max=x.bottom));var D=E.min,s=E.max;return D&&(ec(y)?vy(S)?w.x.max=D.left:w.x.min=D.right:fy(S)?w.y.max=D.top:w.y.min=D.bottom),s&&(ec(y)?vy(S)?w.x.min=s.left:w.x.max=s.right:fy(S)?w.y.min=s.top:w.y.max=s.bottom),w[y]}(o,u);v&&z(p,v),so(o,u)||r.snapEvent(o,u,p)})}})}function ec(e){return e==="x"}function fy(e){return e.indexOf("n")!==-1}function vy(e){return e.indexOf("w")!==-1}function lr(e,t){ne.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;Br(o)?r.newBounds=n.snapComplex(c,o):r.newBounds=n.snapSimple(a,c)}})}Mi.prototype.snapEvent=function(e,t,n){ut(e,t,this.snapValue(e[t],n))},Mi.prototype.getGridSpacing=function(){return 10},Mi.prototype.snapValue=function(e,t){var n,i,r=0;return t&&t.offset&&(r=t.offset),e=lp(e+=r,10),t&&t.min&&fe(n=t.min)&&(n=lp(n+r,10,"ceil"),e=Math.max(e,n)),t&&t.max&&fe(i=t.max)&&(i=lp(i+r,10,"floor"),e=Math.min(e,i)),e-=r},Mi.prototype.isActive=function(){return this.active},Mi.prototype.setActive=function(e){this.active=e,this._eventBus.fire("gridSnapping.toggle",{active:e})},Mi.prototype.toggleActive=function(){this.setActive(!this.active)},Mi.$inject=["elementRegistry","eventBus","config.gridSnapping"],lr.$inject=["eventBus","gridSnapping","modeling"],ae(lr,ne),lr.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},lr.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},lr.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},lr.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 yy(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))})}yy.$inject=["eventBus","gridSnapping"];const K_={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",lr],gridSnappingSpaceToolBehavior:["type",yy]}],__init__:["gridSnapping"],gridSnapping:["type",Mi]};function gy(e,t){e.on("autoPlace",2e3,function(n){var i=n.source,r=ge(i),o=n.shape,a=iv(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})}gy.$inject=["eventBus","gridSnapping"];function by(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}))})}by.$inject=["canvas","eventBus","gridSnapping"];function tc(e,t,n){ne.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 X_(e,t,n){var i=Kn(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]}tc.$inject=["eventBus","gridSnapping","modeling"],ae(tc,ne),tc.prototype.snapMiddleSegments=function(e){var t,n=this._gridSnapping;e=e.slice();for(var i=1;i<e.length-2;i++)t=X_(n,e[i],e[i+1]),e[i]=t[0],e[i+1]=t[1];return e};const Y_={__depends__:[K_,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingCreateParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",gy],gridSnappingCreateParticipantBehavior:["type",by],gridSnappingLayoutConnectionBehavior:["type",tc]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",my]};function ca(e,t){this._interactionEvents=t;var n=this;e.on(["interactionEvents.createHit","interactionEvents.updateHit"],function(i){var r=i.element,o=i.gfx;return A(r,"bpmn:Lane")?n.createParticipantHit(r,o):A(r,"bpmn:Participant")?Oe(r)?n.createParticipantHit(r,o):n.createDefaultHit(r,o):A(r,"bpmn:SubProcess")?Oe(r)?n.createSubProcessHit(r,o):n.createDefaultHit(r,o):void 0})}ca.$inject=["eventBus","interactionEvents"],ca.prototype.createDefaultHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createDefaultHit(e,t),!0},ca.prototype.createParticipantHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:30,height:e.height}),!0},ca.prototype.createSubProcessHit=function(e,t){return this._interactionEvents.removeHits(t),this._interactionEvents.createBoxHit(t,"click-stroke",{width:e.width,height:e.height}),this._interactionEvents.createBoxHit(t,"all",{width:e.width,height:30}),!0};const J_={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",ca]};function nc(e){e.invoke(io,this)}ae(nc,io),nc.$inject=["injector"],nc.prototype.registerBindings=function(e,t){function n(i,r){t.isRegistered(i)&&e.addListener(r)}io.prototype.registerBindings.call(this,e,t),n("selectElements",function(i){var r=i.keyEvent;if(e.isKey(["a","A"],r)&&e.isCmd(r))return t.trigger("selectElements"),!0}),n("find",function(i){var r=i.keyEvent;if(e.isKey(["f","F"],r)&&e.isCmd(r))return t.trigger("find"),!0}),n("spaceTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["s","S"],r)?(t.trigger("spaceTool"),!0):void 0}),n("lassoTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["l","L"],r)?(t.trigger("lassoTool"),!0):void 0}),n("handTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["h","H"],r)?(t.trigger("handTool"),!0):void 0}),n("globalConnectTool",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["c","C"],r)?(t.trigger("globalConnectTool"),!0):void 0}),n("directEditing",function(i){var r=i.keyEvent;if(!e.hasModifier(r))return e.isKey(["e","E"],r)?(t.trigger("directEditing"),!0):void 0})};const Z_={__depends__:[Lu],__init__:["keyboardBindings"],keyboardBindings:["type",nc]};var Q_={moveSpeed:1,moveSpeedAccelerated:10},xy="left",Ey="right",wy="down",e1={ArrowLeft:xy,Left:xy,ArrowUp:"up",Up:"up",ArrowRight:Ey,Right:Ey,ArrowDown:wy,Down:wy},t1={left:function(e){return{x:-e,y:0}},up:function(e){return{x:0,y:-e}},right:function(e){return{x:e,y:0}},down:function(e){return{x:0,y:e}}};function _y(e,t,n,i,r){var o=this;this._config=z({},Q_,e||{}),t.addListener(1500,function(a){var c=a.keyEvent,l=e1[c.key];if(l&&!t.isCmd(c)){var u=t.isShift(c);return o.moveSelection(l,u),!0}}),this.moveSelection=function(a,c){var l=r.get();if(l.length){var u=this._config[c?"moveSpeedAccelerated":"moveSpeed"],p=t1[a](u);i.allowed("elements.move",{shapes:l})&&n.moveElements(l,p)}}}_y.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];const n1={__depends__:[Lu,On],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",_y]};function Sy(e,t,n,i){e.on("element.changed",function(r){var o=r.element;(o.parent||o===t.getRootElement())&&(r.gfx=n.getGraphics(o)),r.gfx&&e.fire(gm(o)+".changed",r)}),e.on("elements.changed",function(r){var o=r.elements;o.forEach(function(a){e.fire("element.changed",{element:a})}),i.updateContainments(o)}),e.on("shape.changed",function(r){i.update("shape",r.element,r.gfx)}),e.on("connection.changed",function(r){i.update("connection",r.element,r.gfx)})}Sy.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const Cy={__init__:["changeSupport"],changeSupport:["type",Sy]};function la(e,t,n,i){this._dragging=i,this._rules=t;var r=this;function o(a,c){var l,u=a.shape,p=a.direction,h=a.resizeConstraints;a.delta=c,l=function(v,f,y){var g=y.x,x=y.y,E={x:v.x,y:v.y,width:v.width,height:v.height};return f.indexOf("n")!==-1?(E.y=v.y+x,E.height=v.height-x):f.indexOf("s")!==-1&&(E.height=v.height+x),f.indexOf("e")!==-1?E.width=v.width+g:f.indexOf("w")!==-1&&(E.x=v.x+g,E.width=v.width-g),E}(u,p,c),a.newBounds=function(v,f){if(!f)return v;var y=ce(v);return hu({top:Ys("top",y,f),right:Ys("right",y,f),bottom:Ys("bottom",y,f),left:Ys("left",y,f)})}(l,h),a.canExecute=r.canResize(a)}e.on("resize.start",function(a){var c,l,u;c=a.context,l=c.resizeConstraints,u=c.minBounds,l===void 0&&(u===void 0&&(u=r.computeMinResizeBox(c)),c.resizeConstraints={min:ce(u)})}),e.on("resize.move",function(a){var c={x:a.dx,y:a.dy};o(a.context,c)}),e.on("resize.end",function(a){(function(c){var l=c.shape,u=c.canExecute,p=c.newBounds;if(u){if(!function(h,v){return h.x!==v.x||h.y!==v.y||h.width!==v.width||h.height!==v.height}(l,p=Dm(p)))return;n.resizeShape(l,p)}})(a.context)})}function Ty(e,t){var n=ge(e),i=ce(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}function i1(e){var t="resize-";return e==="n"||e==="s"?t+"ns":e==="e"||e==="w"?t+"ew":e==="nw"||e==="se"?t+"nwse":t+"nesw"}la.prototype.canResize=function(e){var t=this._rules,n=Rn(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},la.prototype.activate=function(e,t,n){var i,r,o=this._dragging;if(typeof n=="string"&&(n={direction:n}),!(r=(i=z({shape:t},n)).direction))throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");o.init(e,Ty(t,r),"resize",{autoActivate:!0,cursor:i1(r),data:{shape:t,context:i}})},la.prototype.computeMinResizeBox=function(e){var t=e.shape;return function(n,i,r,o){var a=ce(i),c={top:/n/.test(n)?a.bottom-r.height:a.top,left:/w/.test(n)?a.right-r.width:a.left,bottom:/s/.test(n)?a.top+r.height:a.bottom,right:/e/.test(n)?a.left+r.width:a.right},l=o?ce(o):c;return hu({top:Xs(c.top,l.top),left:Xs(c.left,l.left),bottom:Ks(c.bottom,l.bottom),right:Ks(c.right,l.right)})}(e.direction,t,e.minDimensions||{width:10,height:10},uy(t,e.childrenBoxPadding))},la.$inject=["eventBus","rules","modeling","dragging"];var Ay="djs-resizing",ky="resize-not-ok";function Py(e,t,n){e.on("resize.move",500,function(i){var r,o,a,c;r=i.context,o=r.shape,a=r.newBounds,(c=r.frame)||(c=r.frame=n.addFrame(o,t.getActiveLayer()),t.addMarker(o,Ay)),a.width>5&&W(c,{x:a.x,width:a.width}),a.height>5&&W(c,{y:a.y,height:a.height}),r.canExecute?Ce(c).remove(ky):Ce(c).add(ky)}),e.on("resize.cleanup",function(i){var r,o;r=i.context,o=r.shape,r.frame&&it(r.frame),t.removeMarker(o,Ay)})}Py.$inject=["eventBus","canvas","previewSupport"];var My=-6,ua="djs-resizer",r1=["n","w","s","e","nw","ne","se","sw"];function Ri(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&&F(a,qn(r.addResizer,r))}),e.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}Ri.prototype.makeDraggable=function(e,t,n){var i=this._resize;function r(o){Ai(o)&&i.activate(o,e,n)}le.bind(t,"mousedown",r),le.bind(t,"touchstart",r)},Ri.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=My),u.indexOf("s")!==-1?p.y=6:u.indexOf("n")!==-1&&(p.y=My),p}(i),a=se("g");Ce(a).add(ua),Ce(a).add(ua+"-"+e.id),Ce(a).add(ua+"-"+i),pe(r,a);var c=se("rect");W(c,{x:-2+o.x,y:-2+o.y,width:4,height:4}),Ce(c).add(ua+"-visual"),pe(a,c);var l=se("rect");return W(l,{x:-10+o.x,y:-10+o.y,width:20,height:20}),Ce(l).add(ua+"-hit"),pe(a,l),yu(a,t,n),a},Ri.prototype.createResizer=function(e,t){var n=Ty(e,t),i=this._createResizer(e,n.x,n.y,t);this.makeDraggable(e,i,t)},Ri.prototype.addResizer=function(e){var t=this;this._resize.canResize({shape:e})&&F(r1,function(n){t.createResizer(e,n)})},Ri.prototype.removeResizers=function(){am(this._getResizersParent())},Ri.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},Ri.$inject=["eventBus","canvas","selection","resize"];const Ry={__depends__:[Vn,ei,na],__init__:["resize","resizePreview","resizeHandles"],resize:["type",la],resizePreview:["type",Py],resizeHandles:["type",Ri]};function up(e,t){var n=t.create("bpmn:CategoryValue"),i=t.create("bpmn:Category",{categoryValue:[n]});return et(e.get("rootElements"),i),re(i).$parent=e,re(n).$parent=i,n}function pa(e,t,n,i,r,o,a){function c(l,u){(u||Pe(l,["bpmn:Task","bpmn:TextAnnotation"])||pp(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,h=l.context.canExecute;l.isTouch||h&&(u.hints&&u.hints.createElementsBehavior===!1||c(p))}),e.on("autoPlace.end",500,function(l){c(l.shape)})}function pp(e){return A(e,"bpmn:SubProcess")&&!Oe(e)}pa.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],pa.prototype.activate=function(e){var t=gn(e);if(t!==void 0){var n={text:t};z(n,this.getEditingBBox(e));var i={};return(Pe(e,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||pp(e))&&z(i,{centerVertically:!0}),Qr(e)&&z(i,{autoResize:!0}),A(e,"bpmn:TextAnnotation")&&z(i,{resizable:!0,autoResize:!0}),z(n,{options:i}),n}},pa.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,h=u.lineHeight,v=l.fontSize*c,f=l.lineHeight,y={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(A(e,"bpmn:Lane")||function(D){return A(D,"bpmn:Participant")&&Oe(D)}(e))&&(z(a,{width:i.height,height:30*c,x:i.x-i.height/2+15*c,y:o-30*c/2}),z(y,{fontSize:v+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px",transform:"rotate(-90deg)"})),(Pe(e,["bpmn:Task","bpmn:CallActivity"])||function(D){return A(D,"bpmn:Participant")&&!Oe(D)}(e)||pp(e))&&(z(a,{width:i.width,height:i.height}),z(y,{fontSize:v+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"})),function(D){return A(D,"bpmn:SubProcess")&&Oe(D)}(e)&&(z(a,{width:i.width,x:i.x}),z(y,{fontSize:v+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"}));var g=90*c,x=7*c,E=4*c;if(n.labelTarget&&(z(a,{width:g,height:i.height+x+E,x:r-g/2,y:i.y-x}),z(y,{fontSize:p+"px",lineHeight:h,paddingTop:x+"px",paddingBottom:E+"px"})),Qr(n)&&!Ps(n)&&!wt(n)){var _=Ms(e),w=t.getAbsoluteBBox({x:_.x,y:_.y,width:0,height:0}),S=p+x+E;z(a,{width:g,height:S,x:w.x-g/2,y:w.y-S/2}),z(y,{fontSize:p+"px",lineHeight:h,paddingTop:x+"px",paddingBottom:E+"px"})}return A(e,"bpmn:TextAnnotation")&&(z(a,{width:i.width,height:i.height,minWidth:30*c,minHeight:10*c}),z(y,{textAlign:"left",paddingTop:5*c+"px",paddingBottom:7*c+"px",paddingLeft:7*c+"px",paddingRight:5*c+"px",fontSize:v+"px",lineHeight:f})),{bounds:a,style:y}},pa.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")&&!re(e).categoryValueRef){var c=up(re(this._canvas.getRootElement()).$parent,this._bpmnFactory);re(e).categoryValueRef=c}(a=t)&&a.trim()||(t=null),this._modeling.updateLabel(e,t,r)};var Ny="djs-element-hidden",Iy="djs-label-hidden";function Dy(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=se("g");var h=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:r.height,position:{mx:0,my:0}}),v=c.path=se("path");W(v,{d:h,strokeWidth:2,stroke:o1(r)}),pe(a,v),pe(l,a),Lt(a,r.x,r.y)}A(r,"bpmn:TextAnnotation")||r.labelTarget?t.addMarker(r,Ny):(A(r,"bpmn:Task")||A(r,"bpmn:CallActivity")||A(r,"bpmn:SubProcess")||A(r,"bpmn:Participant"))&&t.addMarker(r,Iy)}),e.on("directEditing.resize",function(u){if(A(r,"bpmn:TextAnnotation")){var p=u.height,h=u.dy,v=Math.max(r.height/o.height*(p+h),0),f=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:v,position:{mx:0,my:0}});W(c.path,{d:f})}}),e.on(["directEditing.complete","directEditing.cancel"],function(u){var p=u.active;p&&(t.removeMarker(p.element.label||p.element,Ny),t.removeMarker(r,Iy)),r=void 0,o=void 0,a&&(it(a),a=void 0)})}function o1(e,t){return re(e).di.get("stroke")||t||"black"}Dy.$inject=["eventBus","canvas","elementRegistry","pathMap"];const a1={__depends__:[Cy,Ry,Fv],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",pa],labelEditingPreview:["type",Dy]};var dp=["top","bottom","left","right"],ic=10;function hp(e,t){function n(i){if(Ps(i)){var r=function(o){var a=ge(o.label),c=ge(o),l=By(c,a);if(u=l,dp.indexOf(u)!==-1){var u,p=function(f){var y=ge(f),g=[].concat(f.incoming.map(function(x){return x.waypoints[x.waypoints.length-2]}),f.outgoing.map(function(x){return x.waypoints[1]})).map(function(x){return By(y,x)});return g}(o);if(o.host){var h=function(f){var y,g=f.host,x=ge(f),E=bt(x,g);y=E.indexOf("-")>=0?E.split("-"):[E];var _=dp.filter(function(w){return y.indexOf(w)===-1});return _}(o);p=p.concat(h)}var v=dp.filter(function(f){return p.indexOf(f)===-1});if(v.indexOf(l)===-1)return v[0]}}(i);r&&function(o,a){var c=ge(o),l=o.label,u=ge(l);if(l.parent){var p,h=ce(o);switch(a){case"top":p={x:c.x,y:h.top-ic-l.height/2};break;case"left":p={x:h.left-ic-l.width/2,y:c.y};break;case"bottom":p={x:c.x,y:h.bottom+ic+l.height/2};break;case"right":p={x:h.right+ic+l.width/2,y:c.y}}var v=jn(p,u);t.moveShape(l,v)}}(i,r)}}ne.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 By(e,t){return bt(t,e,5)}function mp(e,t,n){ne.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 fp(e,t){e.invoke(ne,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape;F(Ee(r.incoming.concat(r.outgoing),function(o){return A(o,"bpmn:Association")}),function(o){t.moveConnection(o,{x:0,y:0},i)})},!0)}ae(hp,ne),hp.$inject=["eventBus","modeling"],ae(mp,ne),mp.$inject=["eventBus","elementFactory","bpmnRules"],ae(fp,ne),fp.$inject=["injector","modeling"];function rc(e,t){t.invoke(ne,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;(r=r.filter(function(o){return Oy(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];Oy(a,o)&&(i.shapes=[n.replaceShape(a,o)])}},!0)}function Oy(e,t){return!wt(e)&&Pe(e,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!t}rc.$inject=["bpmnReplace","injector"],ae(rc,ne),rc.prototype.replaceShape=function(e,t){var n,i=(n=re(e).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:t};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(e,r,{layoutConnection:!1})};function vp(e,t,n){function i(r){return Ee(r.attachers,function(o){return A(o,"bpmn:BoundaryEvent")})}ne.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")&&F(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)})}vp.$inject=["eventBus","moddle","modeling"],ae(vp,ne);function yp(e,t,n,i,r){function o(u){return Pe(u,["bpmn:ReceiveTask","bpmn:SendTask"])||function(p,h){return Se(h)||(h=[h]),Yi(h,function(v){return Ts(p,v)})}(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){return!!je(e.getDefinitions().get("rootElements"),fn({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(Pe(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.get("messageRef");var p=u.get("eventDefinitions")[0];return p.get(c(p))}n.invoke(ne,this),this.executed("shape.create",function(u){var p=u.shape;if(o(p)){var h=l(re(p));h&&!a(h)&&(et(e.getDefinitions().get("rootElements"),h),u.addedRootElement=h)}},!0),this.reverted("shape.create",function(u){var p=u.addedRootElement;p&&Qe(e.getDefinitions().get("rootElements"),p)},!0),t.on("copyPaste.copyElement",function(u){var p=u.descriptor,h=u.element;if(o(h)){var v=l(re(h));v&&(p.referencedRootElement=v)}}),t.on("copyPaste.pasteElement",500,function(u){var p=u.descriptor,h=p.businessObject;if(o(h)){var v=p.referencedRootElement;v&&(a(v)||(v=i.copyElement(v,r.create(v.$type))),function(f,y){if(Pe(f,["bpmn:ReceiveTask","bpmn:SendTask"]))return f.set("messageRef",y);var g=f.get("eventDefinitions")[0];g.set(c(g),y)}(h,v))}})}function gp(e){e.invoke(ne,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=js(i,"bpmn:Participant"))})}yp.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],ae(yp,ne),gp.$inject=["injector"],ae(gp,ne);var oc=1500;function jy(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"],oc,function(i){var r=i.context.shape||i.shape,o=i.hover;A(o,"bpmn:Lane")&&!Pe(r,["bpmn:Lane","bpmn:Participant"])&&(i.hover=wn(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"],oc,function(i){var r=i.hover;A(r,"bpmn:Lane")&&(i.hover=wn(r)||r,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["bendpoint.move.hover"],oc,function(i){var r=i.context,o=i.hover,a=r.type;A(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=wn(o)||o,i.hoverGfx=e.getGraphics(i.hover))}),t.on(["connect.start"],oc,function(i){var r=i.context,o=r.start;A(o,"bpmn:Lane")&&(r.start=wn(o)||o)}),t.on("shape.move.start",2e3,function(i){var r=i.shape;A(r,"bpmn:Lane")&&(i.shape=wn(r)||r)})}function bp(e,t,n){ne.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}})}jy.$inject=["elementRegistry","eventBus","canvas"],bp.$inject=["eventBus","bpmnFactory","moddle"],ae(bp,ne);var xp=20,Ep=20,Ly=30,ac=2e3;function wp(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}ne.call(this,t),t.on(["create.start","shape.move.start"],ac,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(h){return!A(h,"bpmn:Group")&&!wt(h)&&!function(v){return!!v.waypoints}(h)});if(l.length){var u=gt(l),p=function(h,v){v={width:v.width+2*xp+Ly,height:v.height+2*Ep};var f=Math.max(h.width,v.width),y=Math.max(h.height,v.height);return{x:-f/2,y:-y/2,width:f,height:y}}(a,u);z(a,p),o.createConstraints=function(h,v){return v=ce(v),{bottom:v.top+h.height/2-Ep,left:v.right-h.width/2+xp,top:v.bottom-h.height/2+Ep,right:v.left+h.width/2-xp-Ly}}(a,u)}}}),t.on("create.start",ac,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",ac,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",ac,function(r){var o,a=r.elements,c=r.parent;sc(a)&&A(c,"bpmn:Process")&&(i(r),o=sc(a),r.oldProcessRef=o.businessObject.processRef,o.businessObject.processRef=c.businessObject)},!0),this.revert("elements.create",function(r){var o=r.elements;r.process&&(sc(o).businessObject.processRef=r.oldProcessRef)},!0),this.postExecute("elements.create",function(r){var o,a=r.elements,c=r.process;if(c){o=sc(a);var l=c.children.slice();n.moveElements(l,{x:0,y:0},o)}},!0)}function sc(e){return je(e,function(t){return A(t,"bpmn:Participant")})}wp.$inject=["canvas","eventBus","modeling"],ae(wp,ne);var Vy="__targetRef_placeholder";function _p(e,t){function n(o,a){var c=o.get("properties"),l=je(c,function(u){return u.name===Vy});return!l&&a&&et(c,l=t.create("bpmn:Property",{name:Vy})),l}function i(o,a){var c=n(o);c&&(function(l,u,p){return je(l.get("dataInputAssociations"),function(h){return h!==p&&h.targetRef===u})}(o,c,a)||Qe(o.get("properties"),c))}function r(o){var a,c=o.context,l=c.connection,u=l.businessObject,p=l.target,h=p&&p.businessObject,v=c.newTarget,f=v&&v.businessObject,y=c.oldTarget||c.target,g=y&&y.businessObject,x=l.businessObject;g&&g!==h&&i(g,u),f&&f!==h&&i(f,u),h?(a=n(h,!0),x.targetRef=a):x.targetRef=null}ne.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Fy(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Fy(r))}function Fy(e){return function(t){if(A(t.context.connection,"bpmn:DataInputAssociation"))return e(t)}}function cc(e){this._bpmnUpdater=e}function Sp(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")&&re(p).processRef})[0]){var u=c.businessObject||c;t.execute("dataStore.updateContainment",{dataStoreBo:l,newSemanticParent:u.processRef||u,newDiParent:u.di})}}ne.call(this,i),t.registerHandler("dataStore.updateContainment",cc),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(h,v){for(;h.parent;){if(A(h.parent,v))return h.parent;h=h.parent}}(u,"bpmn:Participant"))}),this.postExecute("shape.delete",function(a){var c=a.context.shape,l=e.getRootElement();Pe(c,["bpmn:Participant","bpmn:SubProcess"])&&A(l,"bpmn:Collaboration")&&r(l).filter(function(u){return function(p,h){for(var v=p.businessObject||p,f=h.businessObject||h;v.$parent;){if(v.$parent===f.processRef||f)return!0;v=v.$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)})})}_p.$inject=["eventBus","bpmnFactory"],ae(_p,ne),cc.$inject=["bpmnUpdater"],cc.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)},cc.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)},Sp.$inject=["canvas","commandStack","elementRegistry","eventBus"],ae(Sp,ne);function Cp(e,t,n){ne.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,h,v,f=Pi(u),y=[],g=[];Zi(f,function(x){return x.y>l.y?g.push(x):y.push(x),x.children}),f.length&&(p=g.length&&y.length?l.height/2:l.height,y.length&&(h=n.calculateAdjustments(y,"y",p,l.y-10),n.makeSpace(h.movingShapes,h.resizingShapes,{x:0,y:p},"s")),g.length&&(v=n.calculateAdjustments(g,"y",-p,l.y+l.height+10),n.makeSpace(v.movingShapes,v.resizingShapes,{x:0,y:-p},"n")))}(a,c))})}Cp.$inject=["eventBus","modeling","spaceTool"],ae(Cp,ne);function lc(e,t){t.invoke(ne,this),this._bpmnReplace=e;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;r.filter(function(o){return $y(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;$y(a,(l=u,r.indexOf(l)!==-1?u:o))&&(r[c]=n.replaceShape(a))})},!0)}function $y(e,t){return!wt(e)&&A(e,"bpmn:BoundaryEvent")&&!t}function Tp(e,t,n){function i(r,o,a){var c,l,u,p,h,v,f,y,g=o.waypoints,x=r.outgoing.slice(),E=r.incoming.slice(),_=Xu(g,y=fe(a.width)?ge(a):a);if(_){if(c=g.slice(0,_.index),l=g.slice(_.index+(_.bendpoint?1:0)),!c.length||!l.length)return;u=_.bendpoint?g[_.index]:y,c.length!==1&&zy(r,c[c.length-1])||c.push(Gy(u)),l.length!==1&&zy(r,l[0])||l.unshift(Gy(u))}p=o.source,h=o.target,t.canConnect(p,r,o)&&(n.reconnectEnd(o,r,c||y),v=o),t.canConnect(r,h,o)&&(v?f=n.connect(r,h,{type:o.type,waypoints:l}):(n.reconnectStart(o,r,l||y),f=o));var w=[].concat(v&&Ee(E,function(S){return S.source===v.source})||[],f&&Ee(x,function(S){return S.target===f.target})||[]);w.length&&n.removeElements(w)}ne.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=ge(l),p={x:u.x+c.x,y:u.y+c.y},h=je(o.children,function(v){return t.canInsert(a,v)&&Xu(v.waypoints,p)});h&&(r.targetFlow=h,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 zy(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 Gy(e){return z({},e)}function Ap(e,t){ne.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(kp).forEach(function(c){t.removeConnection(c)})}),this.preExecuted("shape.replace",function(n){var i=n.context.newShape;A(i,"bpmn:EventBasedGateway")&&i.outgoing.filter(kp).map(function(r){return r.target}).reduce(function(r,o){var a=o.incoming.filter(kp);return r.concat(a)},[]).forEach(function(r){r.source!==i&&t.removeConnection(r)})})}function kp(e){return A(e,"bpmn:SequenceFlow")}lc.$inject=["bpmnReplace","injector"],ae(lc,ne),lc.prototype.replaceShape=function(e){var t,n,i=(n=re(e).eventDefinitions)&&n[0];return t=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(e,t,{layoutConnection:!1})},ae(Tp,ne),Tp.$inject=["eventBus","bpmnRules","modeling"],Ap.$inject=["eventBus","modeling"],ae(Ap,ne);function Pp(e,t,n,i,r,o){function a(){return re(t.getRootElement()).$parent}function c(l){var u=re(l).categoryValueRef;if(u){var p=u.$parent;u&&(Qe(p.categoryValue,u),p&&!p.categoryValue.length&&function(h){Qe(a().get("rootElements"),h)}(p))}}r.invoke(ne,this),this.executed("shape.delete",function(l){var u,p=l.context.shape;if(A(p,"bpmn:Group")){var h=re(p).categoryValueRef,v=n.filter(function(f){return A(f,"bpmn:Group")});u=h,v.some(function(f){var y=re(f);return y.categoryValueRef&&y.categoryValueRef===u})||c(p)}}),this.reverted("shape.delete",function(l){var u=l.context.shape;if(A(u,"bpmn:Group")){var p=re(u).categoryValueRef,h=a(),v=p?p.$parent:null;et(v.get("categoryValue"),p),et(h.get("rootElements"),v)}}),this.execute("shape.create",function(l){var u=re(l.context.shape);if(A(u,"bpmn:Group")&&!u.categoryValueRef){var p=up(a(),e);u.categoryValueRef=p}}),this.revert("shape.create",function(l){var u=l.context.shape;A(u,"bpmn:Group")&&(c(u),delete re(u).categoryValueRef)}),i.on("moddleCopy.canCopyProperty",2e3,function(l){var u,p=l.property;if(A(p,"bpmn:CategoryValue"))return u=up(a(),e),o.copyElement(p,u)})}function Mp(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 Uy(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=Mp(n,i,r,a),u=Mp(n,i,r,c);o=l&&u?Hy(l,r)>Hy(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],ge(i.source)),t(r[r.length-1],r[r.length-2],ge(i.target)))})}function Hy(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Rp(e){ne.call(this,e);var t=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=re(n.context.shape);Pe(i,t)&&!i.di.get("isHorizontal")&&i.di.set("isHorizontal",!0)})}function qy(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Wy(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))}function Ky(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 s1(e,t){var n=Ky(e,t);return qy({x:n.x-e.x,y:n.y-e.y})}function uc(e,t){return qy({x:e.x-t.x,y:e.y-t.y})}Pp.$inject=["bpmnFactory","canvas","elementRegistry","eventBus","injector","moddleCopy"],ae(Pp,ne),Uy.$inject=["eventBus"],Rp.$inject=["eventBus"],ae(Rp,ne);var Xy=Math.sqrt,Yy=Math.min,c1=Math.max,Jy=Math.abs;function Zy(e){return Math.pow(e,2)}function da(e,t){return Xy(Zy(e.x-t.x)+Zy(e.y-t.y))}function l1(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 h=Xy(p),v=-u+h,f=-u-h,y={x:e.x-r*v,y:e.y-o*v};return p===0?[y]:[y,{x:e.x-r*f,y:e.y-o*f}].filter(function(g){return function(x,E,_){return Qy(x.x,E.x,_.x)&&Qy(x.y,E.y,_.y)}(g,e,t)})}function Qy(e,t,n){return e>=Yy(t,n)-pc&&e<=c1(t,n)+pc}var pc=.1;function eg(e,t){return Jy(e.x-t.x)<=pc&&Jy(e.y-t.y)<=pc}function u1(e,t,n,i){var r=0,o=0,a=function(R){return{x:R.x+R.width/2,y:R.y+R.height/2}}(e),c=function(R,I){var N,L,T,b,B,V,H,q,J,Q,oe,ie,he=0;for(he=0;he<I.length-1;he++){if(eg(N=I[he],L=I[he+1])?V=[N]:(T=da(R,N),b=da(R,L),V=l1(N,L,R,Yy(T,b))),V.length<1)throw new Error("expected between [1, 2] circle -> line intersections");V.length===1&&(H={type:"bendpoint",position:V[0],segmentIndex:he,bendpointIndex:eg(N,V[0])?he:he+1}),V.length===2&&(oe=V[0],ie=V[1],H={type:"segment",position:B={x:(oe.x+ie.x)/2,y:(oe.y+ie.y)/2},segmentIndex:he,relativeLocation:da(N,B)/da(N,L)}),q=da(H.position,R),(!Q||J>q)&&(Q=H,J=q)}return Q}(a,n),l=c.segmentIndex,u=function(R,I,N,L){var T=N.segmentIndex,b=I.length-R.length;if(L.segmentMove){var B=L.segmentMove.segmentStartIndex,V=L.segmentMove.newSegmentStartIndex;return T===B?V:T>=V?T+b<V?V:T+b:T}if(L.bendpointMove){var H,q=L.bendpointMove.insert,J=L.bendpointMove.bendpointIndex;return b===0?T:(T>=J&&(H=q?T+1:T-1),T<J&&(H=T,q&&N.type!=="bendpoint"&&J-1===T&&tg(I,J)<N.relativeLocation&&H++),H)}return b===0?T:L.connectionStart?T===0?0:null:L.connectionEnd&&T===R.length-2?I.length-2:null}(n,t,c,i);if(u===null)return{x:r,y:o};if(u<0||u>t.length-2)return{x:r,y:o};var p,h,v=ng(n,l),f=ng(t,u),y=c.position,g=function(R,I){var N=uc(R[0],R[1]),L=uc(R[0],I);return N===0?0:L/N}(v,y),x=(p=f,h=Wy(v),Wy(p)-h);if(c.type==="bendpoint"){var E=t.length-n.length,_=c.bendpointIndex,w=n[_];if(t.indexOf(w)!==-1)return{x:r,y:o};if(E===0){var S=t[_];return{x:S.x-c.position.x,y:S.y-c.position.y}}E<0&&_!==0&&_<n.length-1&&(g=tg(n,_))}var D,s,d=(f[1].x-f[0].x)*g+f[0].x,m=(f[1].y-f[0].y)*g+f[0].y,C=(D={x:a.x-y.x,y:a.y-y.y},(s=x)?{x:Math.cos(s)*D.x-Math.sin(s)*D.y,y:Math.sin(s)*D.x+Math.cos(s)*D.y}:D);return Qi({x:r=d+C.x-a.x,y:o=m+C.y-a.y})}function tg(e,t){var n=uc(e[t-1],e[t]);return n/(n+uc(e[t],e[t+1]))}function ng(e,t){return[e[t],e[t+1]]}function ha(e,t,n){var i=Yo(t),r=Yo(n),o=jn(e,i),a=o.x*(n.width/t.width),c=o.y*(n.height/t.height);return Qi({x:r.x+a,y:r.y+c})}function ig(e,t,n){var i=Yo(e),r=Yo(t),o=Yo(n),a=jn(e,i),c=jn(i,r),l=function(f,y,g){var x=ce(y),E=ce(g);if(function(s,d){return function(m,C){return m.right!==C.right&&m.left!==C.left}(s,d)||function(m,C){return m.top!==C.top&&m.bottom!==C.bottom}(s,d)}(x,E))return null;var _,w,S,D=bt(y,f);if(D==="top")_={x:0,y:E.bottom-x.bottom};else if(D==="bottom")_={x:0,y:E.top-x.top};else if(D==="right")_={x:E.left-x.left,y:0};else{if(D!=="left")return null;_={x:E.right-x.right,y:0}}return w={x:f.x+_.x,y:f.y+_.y},S=bt(g,w),S!==D?null:_}(i,t,n);if(l)return l;var u=c.x*(n.width/t.width),p=c.y*(n.height/t.height),h=o.x+u,v=o.y+p;return Qi({x:h+a.x-e.x,y:v+a.y-e.y})}var p1={width:90,height:20},rg="name",og="text";function Np(e,t,n,i){ne.call(this,e),this.postExecute("element.updateProperties",function(r){var o=r.context,a=o.element,c=o.properties;if(rg in c&&t.updateLabel(a,c[rg]),og in c&&A(a,"bpmn:TextAnnotation")){var l=i.getTextAnnotationBounds({x:a.x,y:a.y,width:a.width,height:a.height},c[og]||"");t.updateLabel(a,c.text,l)}}),this.postExecute(["shape.create","connection.create"],function(r){var o=r.context;if((o.hints||{}).createElementsBehavior!==!1){var a=o.shape||o.connection,c=a.businessObject;if(!wt(a)&&Qr(a)&&gn(a)){var l=Ms(a),u=i.getExternalLabelBounds(p1,gn(a));t.createLabel(a,l,{id:c.id+"_label",businessObject:c,width:u.width,height:u.height})}}}),this.postExecute("shape.delete",function(r){var o=r.context,a=o.labelTarget,c=o.hints||{};a&&c.unsetLabel!==!1&&t.updateLabel(a,null,null,{removeShape:!1})}),this.postExecute(["label.create"],function(r){var o,a=r.context.shape;a.labelTarget&&A(a.labelTarget||a,"bpmn:BaseElement")&&((o=a.businessObject.di).label||(o.label=n.create("bpmndi:BPMNLabel",{bounds:n.create("dc:Bounds")})),z(o.label.bounds,{x:a.x,y:a.y,width:a.width,height:a.height}))}),this.postExecute(["connection.layout","connection.updateWaypoints"],function(r){var o=r.context;if((o.hints||{}).labelBehavior!==!1){var a,c=o.connection.label;c&&c.parent&&(a=function(l){var u=l.context,p=u.connection,h=p.label,v=z({},u.hints),f=u.newWaypoints||p.waypoints,y=u.oldWaypoints;return v.startChanged===void 0&&(v.startChanged=!!v.connectionStart),v.endChanged===void 0&&(v.endChanged=!!v.connectionEnd),u1(h,f,y,v)}(r),t.moveShape(c,a))}}),this.postExecute(["shape.replace"],function(r){var o=r.context,a=o.newShape,c=o.oldShape,l=re(a);l&&Qr(l)&&c.label&&a.label&&(a.label.x=c.label.x,a.label.y=c.label.y)}),this.postExecute("shape.resize",function(r){var o,a=r.context,c=a.shape,l=a.newBounds,u=a.oldBounds;if(Ps(c)){var p=c.label,h=d1(function(v,f){if(f.length){var y=function(g,x){var E=x.map(function(_){return{line:_,distance:s1(g,_)}});return mn(E,"distance")[0].line}(v,f);return Ky(v,y)}}(ge(p),[[{x:(o=u).x,y:o.y},{x:o.x+(o.width||0),y:o.y}],[{x:o.x+(o.width||0),y:o.y},{x:o.x+(o.width||0),y:o.y+(o.height||0)}],[{x:o.x,y:o.y+(o.height||0)},{x:o.x+(o.width||0),y:o.y+(o.height||0)}],[{x:o.x,y:o.y},{x:o.x,y:o.y+(o.height||0)}]]),u,l);t.moveShape(p,h)}})}function d1(e,t,n){return Qi(jn(ha(e,t,n),e))}function dc(e,t,n){var i=mc(e),r=sg(i,t),o=i[0];return r.length?r[r.length-1]:ha(o.original||o,n,t)}function hc(e,t,n){var i=mc(e),r=sg(i,t),o=i[i.length-1];return r.length?r[0]:ha(o.original||o,n,t)}function Ip(e,t,n){var i=mc(e),r=ag(t,n),o=i[0];return ha(o.original||o,r,t)}function Dp(e,t,n){var i=mc(e),r=ag(t,n),o=i[i.length-1];return ha(o.original||o,r,t)}function ag(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function mc(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function sg(e,t){return Ee(ht(e,h1),function(n){return function(i,r){return bt(r,i,1)==="intersect"}(n,t)})}function h1(e){return e.original||e}function Bp(e,t){ne.call(this,e),this.postExecute("shape.replace",function(n){var i=n.oldShape,r=n.newShape;if(function(p,h){return A(p,"bpmn:Participant")&&Oe(p)&&A(h,"bpmn:Participant")&&!Oe(h)}(i,r)){var o,a,c,l,u=(a=ss([o=i],!1),c=[],l=[],a.forEach(function(p){p!==o&&(p.incoming.forEach(function(h){A(h,"bpmn:MessageFlow")&&c.push(h)}),p.outgoing.forEach(function(h){A(h,"bpmn:MessageFlow")&&l.push(h)}))},[]),{incoming:c,outgoing:l});u.incoming.forEach(function(p){var h=hc(p,r,i);t.reconnectEnd(p,r,h)}),u.outgoing.forEach(function(p){var h=dc(p,r,i);t.reconnectStart(p,r,h)})}},!0)}ae(Np,ne),Np.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],Bp.$inject=["eventBus","modeling"],ae(Bp,ne);function cg(e,t,n){e.on(["shape.move.rejected","create.rejected"],function(i){var r,o,a=i.context,c=a.shape;A(a.target,"bpmn:Collaboration")&&A(c,"bpmn:FlowNode")&&(r=i,o=n("flow elements must be children of pools/participants"),t.add({position:{x:r.x+5,y:r.y+5},type:"error",timeout:2e3,html:"<div>"+o+"</div>"}))})}function Op(e,t,n,i){ne.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){F(a.closure.allConnections,o)},!0),this.preExecute("connection.reconnect",function(a){var c,l,u=a.context,p=u.connection,h=u.newSource||p.source,v=u.newTarget||p.target;(c=n.canConnect(h,v))&&c.type!==p.type&&(l=t.connect(h,v,{type:c.type,waypoints:p.waypoints.slice()}),t.removeConnection(p),u.connection=l,r&&function(f,y){var g,x=r.context(),E=x&&x.payload.previousSelection;!E||!E.length||(g=E.indexOf(f),g!==-1&&E.splice(g,1,y))}(p,l))}),this.postExecuted("element.updateProperties",function(a){var c,l=a.context,u=l.properties,p=l.element,h=p.businessObject;u.default&&(c=je(p.outgoing,fn({id:p.businessObject.default.id})))&&t.updateProperties(c,{conditionExpression:void 0}),u.conditionExpression&&h.sourceRef.default===h&&t.updateProperties(p.source,{default:void 0})})}function jp(e,t){ne.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 fc(e,t,n,i,r,o){i.invoke(ne,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=[];F(c.closure.topLevel,function(v){p=Ft(v)?p.concat(v.children):p.concat(v)}),p.length===1&&u&&(l=u);var h=t.canReplace(p,l);h&&this.replaceElements(p,h.replacements,u)},this),this.postExecute(["shape.replace"],1500,function(a){var c,l=a.context,u=l.oldShape,p=l.newShape,h=u.attachers;h&&h.length&&(c=t.canReplace(h,p),this.replaceElements(h,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})})}cg.$inject=["eventBus","tooltips","translate"],ae(Op,ne),Op.$inject=["eventBus","modeling","bpmnRules","injector"],jp.$inject=["eventBus","modeling"],ae(jp,ne),ae(fc,ne),fc.prototype.replaceElements=function(e,t){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;F(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)},fc.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var ur={width:300,height:60},ma={width:300,height:150},lg={width:140,height:120},ug={width:50,height:30};function pg(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=wn(a),p=!0,h=!0,v=Zs(u,[u]),f=ce(a),y={},g={};return/e/.test(c)?g.right=f.left+ur.width:/w/.test(c)&&(g.left=f.right-ur.width),v.forEach(function(x){var E=ce(x);/n/.test(c)&&(E.top<f.top-10&&(p=!1),l&&vc(f.top-E.bottom)<10&&gc(y,"top",E.top+ur.height),vc(f.top-E.top)<5&&yc(g,"top",E.bottom-ur.height)),/s/.test(c)&&(E.bottom>f.bottom+10&&(h=!1),l&&vc(f.bottom-E.top)<10&&yc(y,"bottom",E.bottom-ur.height),vc(f.bottom-E.bottom)<5&&gc(g,"bottom",E.top+ur.height))}),u.children.filter(function(x){return!x.hidden&&!x.waypoints&&(A(x,"bpmn:FlowElement")||A(x,"bpmn:Artifact"))}).forEach(function(x){var E=ce(x);p&&/n/.test(c)&&yc(g,"top",E.top-g1),/e/.test(c)&&gc(g,"right",E.right+v1),h&&/s/.test(c)&&gc(g,"bottom",E.bottom+b1),/w/.test(c)&&yc(g,"left",E.left-y1)}),{min:g,max:y}}(i,r,o)),A(i,"bpmn:Participant")&&(n.minDimensions=ma),A(i,"bpmn:SubProcess")&&Oe(i)&&(n.minDimensions=lg),A(i,"bpmn:TextAnnotation")&&(n.minDimensions=ug)})}pg.$inject=["eventBus"];var vc=Math.abs,m1=Math.min,f1=Math.max;function dg(e,t,n,i){var r=e[t];e[t]=r===void 0?n:i(n,r)}function yc(e,t,n){return dg(e,t,n,m1)}function gc(e,t,n){return dg(e,t,n,f1)}var v1=20,y1=50,g1=20,b1=20;function hg(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=!to(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=Dm(a),t.resizeLane(r,a,i.balanced)),!1})}function Lp(e,t,n){ne.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=Mp(lo(l[l.length-2]),lo(l[l.length-1]),lo(u[1]),lo(u[0]));return p?[].concat(l.slice(0,l.length-1),[p],u.slice(1)):[lo(l[0]),lo(u[u.length-1])]}(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,c)}}})}function lo(e){return e.original||e}hg.$inject=["eventBus","modeling"],ae(Lp,ne),Lp.$inject=["eventBus","bpmnRules","modeling"];var x1=Math.max;function mg(e){e.on("spaceTool.getMinDimensions",function(t){var n=t.shapes,i=t.axis,r=t.start,o={};return F(n,function(a){var c=a.id;A(a,"bpmn:Participant")&&(function(l){return l==="x"}(i)?o[c]=ma:o[c]={width:ma.width,height:E1(a,r)}),A(a,"bpmn:SubProcess")&&Oe(a)&&(o[c]=lg),A(a,"bpmn:TextAnnotation")&&(o[c]=ug)}),o})}function E1(e,t){var n;return Pi(e).length?(n=function(i,r){var o,a=Pi(i);return o=fg(a,r),i.height-o.height+ur.height}(e,t),x1(ma.height,n)):ma.height}function fg(e,t){var n,i,r;for(n=0;n<e.length;n++)if(t>=(i=e[n]).y&&t<=i.y+i.height)return(r=Pi(i)).length?fg(r,t):i}function Vp(e,t){e.invoke(ne,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")&&Oe(r)){var o,a={x:(o=r).x+o.width/6,y:o.y+o.height/2};t.createShape({type:"bpmn:StartEvent"},a,r)}})}mg.$inject=["eventBus"],Vp.$inject=["injector","modeling"],ae(Vp,ne);function Fp(e,t,n,i){ne.call(this,e),this.executed(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape;A(a,"bpmn:SubProcess")&&(a.collapsed?re(a).di.isExpanded=!1:((o=a.children).length&&o.forEach(function(c){c.type!=="label"||c.businessObject.name||(c.hidden=!0)}),re(a).di.isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],500,function(r){var o=r.context.shape;o.collapsed?re(o).di.isExpanded=!1:re(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,h,v=l.children,f=u;return(p=uy((h=v,h.filter(function(y){return!y.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 $p(e,t,n,i){t.invoke(ne,this),this.preExecute("shape.delete",function(r){var o=r.context.shape,a=o.businessObject;wt(o)||(A(o,"bpmn:Participant")&&Oe(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)})}ae(Fp,ne),Fp.$inject=["eventBus","elementFactory","modeling"],ae($p,ne),$p.$inject=["canvas","injector","moddle","modeling"];function zp(e,t,n){var i;function r(){if(!i)throw new Error(n("out of bounds release"));return i}ne.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 w1).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 w1(){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 Gp(e,t){ne.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=re(a),l=re(o);return c.get("default")===l})(i,r)&&t.updateProperties(r,{default:null})})}zp.$inject=["eventBus","modeling","translate"],ae(zp,ne),ae(Gp,ne),Gp.$inject=["eventBus","modeling"];const _1={__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",hp],appendBehavior:["type",mp],associationBehavior:["type",fp],attachEventBehavior:["type",rc],boundaryEventBehavior:["type",vp],rootElementReferenceBehavior:["type",yp],createBehavior:["type",gp],fixHoverBehavior:["type",jy],createDataObjectBehavior:["type",bp],createParticipantBehavior:["type",wp],dataInputAssociationBehavior:["type",_p],dataStoreBehavior:["type",Sp],deleteLaneBehavior:["type",Cp],detachEventBehavior:["type",lc],dropOnFlowBehavior:["type",Tp],eventBasedGatewayBehavior:["type",Ap],groupBehavior:["type",Pp],importDockingFix:["type",Uy],isHorizontalFix:["type",Rp],labelBehavior:["type",Np],messageFlowBehavior:["type",Bp],modelingFeedback:["type",cg],replaceConnectionBehavior:["type",Op],removeParticipantBehavior:["type",jp],replaceElementBehaviour:["type",fc],resizeBehavior:["type",pg],resizeLaneBehavior:["type",hg],removeElementBehavior:["type",Lp],toggleElementCollapseBehaviour:["type",Fp],spaceToolBehavior:["type",mg],subProcessStartEventBehavior:["type",Vp],unclaimIdBehavior:["type",$p],updateFlowNodeRefsBehavior:["type",zp],unsetDefaultFlowBehavior:["type",Gp]};function vg(e,t){var n=bt(e,t,-15);return n!=="intersect"?n:null}function _t(e){ki.call(this,e)}function Up(e){return!e||wt(e)}function yg(e){do{if(A(e,"bpmn:Process"))return re(e);if(A(e,"bpmn:Participant"))return re(e).processRef||re(e)}while(e=e.parent)}function Hp(e){return A(e,"bpmn:TextAnnotation")}function qp(e){return A(e,"bpmn:Group")&&!e.labelTarget}function Wp(e){return A(e,"bpmn:BoundaryEvent")&&Fn(e,"bpmn:CompensateEventDefinition")}function uo(e){return re(e).isForCompensation}function gg(e){for(var t=e;t=t.parent;){if(A(t,"bpmn:FlowElementsContainer"))return re(t);if(A(t,"bpmn:Participant"))return re(t).processRef}return null}function Fn(e,t){return!!je(re(e).eventDefinitions||[],function(n){return A(n,t)})}function bg(e,t){return(re(e).eventDefinitions||[]).every(function(n){return A(n,t)})}function xg(e){return A(e,"bpmn:ReceiveTask")||A(e,"bpmn:IntermediateCatchEvent")&&(Fn(e,"bpmn:MessageEventDefinition")||Fn(e,"bpmn:TimerEventDefinition")||Fn(e,"bpmn:ConditionalEventDefinition")||Fn(e,"bpmn:SignalEventDefinition"))}function bc(e){return e.waypoints}function Kp(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 xc(e,t,n){if(Up(e)||Up(t))return null;if(!A(n,"bpmn:DataAssociation")){if(kg(e,t))return{type:"bpmn:MessageFlow"};if(Pg(e,t))return{type:"bpmn:SequenceFlow"}}var i=Yp(e,t);return i||(Wp(e)&&uo(t)?{type:"bpmn:Association",associationDirection:"One"}:!!Ag(e,t)&&{type:"bpmn:Association"})}function po(e,t,n){return!(!wt(e)&&!qp(e))||!(A(t,"bpmn:Participant")&&!Oe(t))&&(A(e,"bpmn:Participant")?A(t,"bpmn:Process")||A(t,"bpmn:Collaboration"):Pe(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 re(i).cancelActivity&&(Eg(i)||wg(i))}(e))&&(A(e,"bpmn:FlowElement")&&!A(e,"bpmn:DataStoreReference")?A(t,"bpmn:FlowElementsContainer")?Oe(t):Pe(t,["bpmn:Participant","bpmn:Lane"]):A(e,"bpmn:DataStoreReference")&&A(t,"bpmn:Collaboration")?Yi(re(t).get("participants"),function(i){return!!i.get("processRef")}):Pe(e,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?Pe(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 S1(e){return A(e,"bpmn:Lane")}function C1(e){return!!function(t){return!wt(t)&&A(t,"bpmn:BoundaryEvent")}(e)||!(!A(e,"bpmn:IntermediateThrowEvent")||!Eg(e))||A(e,"bpmn:IntermediateCatchEvent")&&wg(e)}function Eg(e){var t=re(e);return t&&!(t.eventDefinitions&&t.eventDefinitions.length)}function wg(e){return _g(e,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function _g(e,t){return t.some(function(n){return Fn(e,n)})}function fa(e,t,n,i){if(Array.isArray(e)||(e=[e]),e.length!==1)return!1;var r=e[0];return!wt(r)&&!!C1(r)&&!Ft(t)&&!(!A(t,"bpmn:Activity")||uo(t))&&!(i&&!vg(i,t))&&!function(o){return A(o,"bpmn:ReceiveTask")&&je(o.incoming,function(a){return A(a.source,"bpmn:EventBasedGateway")})}(t)&&"attach"}function Sg(e,t,n){if(!t)return!1;var i={replacements:[]};return F(e,function(r){Ft(t)||A(r,"bpmn:StartEvent")&&r.type!=="label"&&po(r,t)&&(function(o){return o&&re(o).isInterrupting!==!1}(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(function(o){return Ts(o,"bpmn:ErrorEventDefinition")}(r)||function(o){return Ts(o,"bpmn:EscalationEventDefinition")}(r)||function(o){return Ts(o,"bpmn:CompensateEventDefinition")}(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),_g(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")||Fn(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(A(r,"bpmn:EndEvent")&&po(r,t)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),A(r,"bpmn:BoundaryEvent")&&fa(r,t,0,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),!!i.replacements.length&&i}function Cg(e,t){return!Yi(e,S1)&&(!t||e.every(function(n){return po(n,t)}))}function Xp(e,t,n,i){return!!t&&(!(!wt(e)&&!qp(e))||n!==t&&(!n||!Kp(n,t))&&(po(e,t)||Ec(e,t)))}function Tg(e,t){return A(e,"bpmn:SubProcess")?Oe(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:!!Hp(e)||!!qp(e)}function Ag(e,t){return!bc(e)&&!bc(t)&&(!(!Wp(e)||!uo(t))||!Kp(t,e)&&!Kp(e,t)&&(!!function(n,i){var r=Hp(n),o=Hp(i);return(r||o)&&r!==o}(e,t)||!!Yp(e,t)))}function kg(e,t){return!(Rg(e)&&!Rg(t))&&A(i=e,"bpmn:InteractionNode")&&!A(i,"bpmn:BoundaryEvent")&&(!A(i,"bpmn:Event")||A(i,"bpmn:ThrowEvent")&&bg(i,"bpmn:MessageEventDefinition"))&&function(r){return A(r,"bpmn:InteractionNode")&&!uo(r)&&(!A(r,"bpmn:Event")||A(r,"bpmn:CatchEvent")&&bg(r,"bpmn:MessageEventDefinition"))&&!(A(r,"bpmn:BoundaryEvent")&&!Fn(r,"bpmn:MessageEventDefinition"))}(t)&&(n=t,yg(e)!==yg(n));var n,i}function Pg(e,t){return!(xg(t)&&t.incoming.length>0&&(n=t.incoming,(n=n||[]).some(T1))&&!A(e,"bpmn:EventBasedGateway"))&&A(r=e,"bpmn:FlowNode")&&!A(r,"bpmn:EndEvent")&&!Ft(r)&&!(A(r,"bpmn:IntermediateThrowEvent")&&Fn(r,"bpmn:LinkEventDefinition"))&&!Wp(r)&&!uo(r)&&function(o){return A(o,"bpmn:FlowNode")&&!A(o,"bpmn:StartEvent")&&!A(o,"bpmn:BoundaryEvent")&&!Ft(o)&&!(A(o,"bpmn:IntermediateCatchEvent")&&Fn(o,"bpmn:LinkEventDefinition"))&&!uo(o)}(t)&&(i=t,gg(e)===gg(i))&&!(A(e,"bpmn:EventBasedGateway")&&!xg(t));var n,i,r}function Yp(e,t){return Pe(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Pe(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!Pe(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!Pe(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function Ec(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&&Pe(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!wt(t)&&A(e,"bpmn:FlowNode")&&!A(e,"bpmn:BoundaryEvent")&&po(e,t.parent)}function Mg(e,t){return!!wt(t)||!(A(t,"bpmn:Lane")&&!function(n,i){return n&&i&&n.indexOf(i)!==-1}(e,t.parent))}function T1(e){if(e&&e.source)return A(e.source,"bpmn:EventBasedGateway")}function Rg(e){return js(e,"bpmn:Process")||js(e,"bpmn:Collaboration")}ae(_t,ki),_t.$inject=["eventBus"],_t.prototype.init=function(){this.addRule("connection.start",function(e){return function(t){return Up(t)?null:Pe(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 xc(t,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(e){var t=e.connection;return xc(e.source,e.target,t)}),this.addRule("connection.updateWaypoints",function(e){return{type:e.connection.type}}),this.addRule("shape.resize",function(e){return Tg(e.shape,e.newBounds)}),this.addRule("elements.create",function(e){var t=e.elements,n=e.position,i=e.target;return!(bc(i)&&!Ec(t,i))&&Or(t,function(r){return bc(r)?xc(r.source,r.target,r):r.host?fa(r,r.host,null,n):Xp(r,i,null)})}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,i=e.position;return fa(n,t,null,i)||Sg(n,t,i)||Cg(n,t)||Ec(n,t)}),this.addRule("shape.create",function(e){return Xp(e.shape,e.target,e.source,e.position)}),this.addRule("shape.attach",function(e){return fa(e.shape,e.target,null,e.position)}),this.addRule("element.copy",function(e){var t=e.element;return Mg(e.elements,t)})},_t.prototype.canConnectMessageFlow=kg,_t.prototype.canConnectSequenceFlow=Pg,_t.prototype.canConnectDataAssociation=Yp,_t.prototype.canConnectAssociation=Ag,_t.prototype.canMove=Cg,_t.prototype.canAttach=fa,_t.prototype.canReplace=Sg,_t.prototype.canDrop=po,_t.prototype.canInsert=Ec,_t.prototype.canCreate=Xp,_t.prototype.canConnect=xc,_t.prototype.canResize=Tg,_t.prototype.canCopy=Mg;const A1={__depends__:[Vn],__init__:["bpmnRules"],bpmnRules:["type",_t]};function Ng(e,t){e.on("saveXML.start",2e3,function(){var n,i,r=t.getRootElement(),o=re(r).di;n=Ee(n=ss([r],!1),function(a){return a!==r&&!a.labelTarget}),i=ht(n,Jr),o.set("planeElement",i)})}Ng.$inject=["eventBus","canvas"];const k1={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Ng]};function wc(e){ne.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 Jp(e,t,n){wc.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=je(i,function(u){return Pe(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,h,v){for(var f=h;f&&!Pe(f,v);)f=f.parent;if(!f)throw new Error("no parent for <"+p.id+"> in <"+(h&&h.id)+">");return f}(o,a,c.containers));var l=a.children.indexOf(o),u=function(p,h){h=Wl(h);var v=Se(p)?-1:void 0;return F(p,function(f,y){if(h(f,y))return v=y,!1}),v}(a.children,function(p){return!(!o.labelTarget&&p.labelTarget)&&c.level<r(p).level});return u!==-1&&l!==-1&&l<u&&(u-=1),{index:u,parent:a}}}wc.prototype.getOrdering=function(e,t){return null},ae(wc,ne),Jp.$inject=["eventBus","canvas","translate"],ae(Jp,wc);const P1={__depends__:[ks],__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",Jp]};function Ke(e,t){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=t,this._eventBus=e,this._uid=1,e.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Ke.$inject=["eventBus","injector"],Ke.prototype.execute=function(e,t){if(!e)throw new Error("command required");this._currentExecution.trigger="execute";var n={command:e,context:t};this._pushAction(n),this._internalExecute(n),this._popAction(n)},Ke.prototype.canExecute=function(e,t){var n={command:e,context:t},i=this._getHandler(e),r=this._fire(e,"canExecute",n);if(r===void 0){if(!i)return!1;i.canExecute&&(r=i.canExecute(t))}return r},Ke.prototype.clear=function(e){this._stack.length=0,this._stackIdx=-1,e!==!1&&this._fire("changed",{trigger:"clear"})},Ke.prototype.undo=function(){var e,t=this._getUndoAction();if(t){for(this._currentExecution.trigger="undo",this._pushAction(t);t&&(this._internalUndo(t),(e=this._getUndoAction())&&e.id===t.id);)t=e;this._popAction()}},Ke.prototype.redo=function(){var e,t=this._getRedoAction();if(t){for(this._currentExecution.trigger="redo",this._pushAction(t);t&&(this._internalExecute(t,!0),(e=this._getRedoAction())&&e.id===t.id);)t=e;this._popAction()}},Ke.prototype.register=function(e,t){this._setHandler(e,t)},Ke.prototype.registerHandler=function(e,t){if(!e||!t)throw new Error("command and handlerCls must be defined");var n=this._injector.instantiate(t);this.register(e,n)},Ke.prototype.canUndo=function(){return!!this._getUndoAction()},Ke.prototype.canRedo=function(){return!!this._getRedoAction()},Ke.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Ke.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Ke.prototype._internalUndo=function(e){var t=this,n=e.command,i=e.context,r=this._getHandler(n);this._atomicDo(function(){t._fire(n,"revert",e),r.revert&&t._markDirty(r.revert(i)),t._revertedAction(e),t._fire(n,"reverted",e)})},Ke.prototype._fire=function(e,t,n){arguments.length<3&&(n=t,t=null);var i,r,o,a=t?[e+"."+t,t]:[e];for(n=this._eventBus.createEvent(n),i=0;(r=a[i])&&(o=this._eventBus.fire("commandStack."+r,n),!n.cancelBubble);i++);return o},Ke.prototype._createId=function(){return this._uid++},Ke.prototype._atomicDo=function(e){var t=this._currentExecution;t.atomic=!0;try{e()}finally{t.atomic=!1}},Ke.prototype._internalExecute=function(e,t){var n=this,i=e.command,r=e.context,o=this._getHandler(i);if(!o)throw new Error("no command handler registered for <"+i+">");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)},Ke.prototype._pushAction=function(e){var t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},Ke.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:Jh("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:t}),e.trigger=null)},Ke.prototype._markDirty=function(e){var t=this._currentExecution;e&&(e=Se(e)?e:[e],t.dirty=t.dirty.concat(e))},Ke.prototype._executedAction=function(e,t){var n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},Ke.prototype._revertedAction=function(e){this._stackIdx--},Ke.prototype._getHandler=function(e){return this._handlerMap[e]},Ke.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 M1={commandStack:["type",Ke]};var R1=new Bu("tt");function Zp(e,t){e.style.display=t===!1?"none":""}var Ig="djs-tooltip",Qp="."+Ig;function It(e,t){var n,i;this._eventBus=e,this._canvas=t,this._ids=R1,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(n=t.getContainer(),i=ze('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />'),n.insertBefore(i,n.firstChild),i);var r=this;Ht.bind(this._tooltipRoot,Qp,"mousedown",function(o){o.stopPropagation()}),Ht.bind(this._tooltipRoot,Qp,"mouseover",function(o){r.trigger("mouseover",o)}),Ht.bind(this._tooltipRoot,Qp,"mouseout",function(o){r.trigger("mouseout",o)}),this._init()}It.$inject=["eventBus","canvas"],It.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},It.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(Ut(n,"data-tooltip-id"));i&&(e==="mouseover"&&i.timeout&&this.clearTimeout(i),e==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},It.prototype.get=function(e){return typeof e!="string"&&(e=e.id),this._tooltips[e]},It.prototype.clearTimeout=function(e){if(e=this.get(e)){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},It.prototype.setTimeout=function(e){if(e=this.get(e)){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},It.prototype.remove=function(e){var t=this.get(e);t&&(Nn(t.html),Nn(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},It.prototype.show=function(){Zp(this._tooltipRoot)},It.prototype.hide=function(){Zp(this._tooltipRoot,!1)},It.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},It.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)),Br(i)&&(i=ze(i)),(t=ze('<div data-tooltip-id="'+n+'" class="'+Ig+'" style="position: absolute">')).appendChild(i),e.type&&ct(t).add("djs-tooltip-"+e.type),e.className&&ct(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},It.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"})},It.prototype._updateTooltipVisibilty=function(e){F(this._tooltips,function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom<e.scale)&&(r=!1),Zp(i,r))})},It.prototype._init=function(){var e=this;this._eventBus.on("canvas.viewbox.changing",function(t){e.hide()}),this._eventBus.on("canvas.viewbox.changed",function(t){var n;n=t.viewbox,e._updateRoot(n),e._updateTooltipVisibilty(n),e.show()})};const N1={__init__:["tooltips"],tooltips:["type",It]};function ho(e,t){if(typeof t!="function")throw new Error("removeFn iterator must be a function");if(e){for(var n;n=e[0];)t(n);return e}}function ed(e,t,n){ne.call(this,t);var i=e.get("movePreview",!1);t.on("shape.move.start",1400,function(r){var o=r.context,a=o.shapes,c=o.validatedShapes;o.shapes=Dg(a),o.validatedShapes=Dg(c)}),i&&t.on("shape.move.start",250,function(r){var o=r.context,a=o.shapes,c=[];F(a,function(l){F(l.labels,function(u){u.hidden||o.shapes.indexOf(u)!==-1||c.push(u),l.labelTarget&&c.push(l)})}),F(c,function(l){i.makeDraggable(o,l,!0)})}),this.preExecuted("elements.move",1400,function(r){var o=r.context.closure,a=o.enclosedElements,c=[];F(a,function(l){F(l.labels,function(u){a[u.id]||c.push(u)})}),o.addAll(c)}),this.preExecute(["connection.delete","shape.delete"],function(r){var o=r.context;ho((o.connection||o.shape).labels,function(a){n.removeShape(a,{nested:!0})})}),this.execute("shape.delete",function(r){var o=r.context,a=o.shape,c=a.labelTarget;c&&(o.labelTargetIndex=cu(c.labels,a),o.labelTarget=c,a.labelTarget=null)}),this.revert("shape.delete",function(r){var o=r.context,a=o.shape,c=o.labelTarget,l=o.labelTargetIndex;c&&(et(c.labels,a,l),a.labelTarget=c)})}function Dg(e){return Ee(e,function(t){return e.indexOf(t.labelTarget)===-1})}ae(ed,ne),ed.$inject=["injector","eventBus","modeling"];const I1={__init__:["labelSupport"],labelSupport:["type",ed]};var Bg="attach-ok";function td(e,t,n,i,r){ne.call(this,t);var o=e.get("movePreview",!1);t.on("shape.move.start",1401,function(a){var c,l,u=a.context,p=u.shapes,h=u.validatedShapes;u.shapes=(l=nd(c=p),uE("id",c,l)),u.validatedShapes=function(v){var f=jr(v,"id");return Ee(v,function(y){for(;y;){if(y.host&&f[y.host.id])return!1;y=y.parent}return!0})}(h)}),o&&t.on("shape.move.start",251,function(a){var c=a.context;F(nd(c.shapes),function(l){o.makeDraggable(c,l,!0),F(l.labels,function(u){o.makeDraggable(c,u,!0)})})}),o&&t.on("shape.move.start",function(a){var c=a.context.shapes;if(c.length===1){var l=c[0].host;l&&(n.addMarker(l,Bg),t.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(l,Bg)}))}}),this.preExecuted("elements.move",1401,function(a){var c=a.context,l=c.closure;F(nd(c.shapes),function(u){l.add(u,l.topLevel[u.host.id])})}),this.postExecuted("elements.move",function(a){var c=a.context,l=c.shapes,u=c.newHost;u&&l.length!==1||F(u?l:Ee(l,function(p){var h,v=p.host;return function(f){return!!f.host}(p)&&(h=v,l.indexOf(h)===-1)}),function(p){r.updateAttachment(p,u)})}),this.postExecuted("elements.move",function(a){F(a.context.shapes,function(c){F(c.attachers,function(l){F(l.outgoing.slice(),function(u){i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target})||r.removeConnection(u)}),F(l.incoming.slice(),function(u){i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target})||r.removeConnection(u)})})})}),this.postExecute("shape.create",function(a){var c=a.context,l=c.shape,u=c.host;u&&r.updateAttachment(l,u)}),this.postExecute("shape.replace",function(a){var c=a.context,l=c.oldShape,u=c.newShape;ho(l.attachers,function(p){i.allowed("elements.move",{target:u,shapes:[p]})==="attach"?r.updateAttachment(p,u):r.removeShape(p)}),u.attachers.length&&F(u.attachers,function(p){var h=ig(p,l,u);r.moveShape(p,h,p.parent)})}),this.postExecute("shape.resize",function(a){var c=a.context,l=c.shape,u=c.oldBounds,p=c.newBounds,h=l.attachers;(c.hints||{}).attachSupport!==!1&&F(h,function(v){var f=ig(v,u,p);r.moveShape(v,f,v.parent),F(v.labels,function(y){r.moveShape(y,f,y.parent)})})}),this.preExecute("shape.delete",function(a){var c=a.context.shape;ho(c.attachers,function(l){r.removeShape(l)}),c.host&&r.updateAttachment(c,null)})}function nd(e){return ns(ht(e,function(t){return t.attachers||[]}))}ae(td,ne),td.$inject=["injector","eventBus","canvas","rules","modeling"];const D1={__depends__:[Vn],__init__:["attachSupport"],attachSupport:["type",td]};function pr(e,t){this._eventBus=e,this._dragging=t,this._tools=[],this._active=null}pr.$inject=["eventBus","dragging"],pr.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error(`A tool has to be registered with it's "events"`);n.push(e),this.bindEvents(e,t)},pr.prototype.isActive=function(e){return e&&this._active===e},pr.prototype.length=function(e){return this._tools.length},pr.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},pr.prototype.bindEvents=function(e,t){var n=this._eventBus,i=this._dragging,r=[];n.on(t.tool+".init",function(o){if(!o.context.reactivate&&this.isActive(e))return this.setActive(null),void i.cancel();this.setActive(e)},this),F(t,function(o){r.push(o+".ended"),r.push(o+".canceled")}),n.on(r,250,function(o){this._active&&(function(a){var c=a.originalEvent&&a.originalEvent.target;return c&&Ji(c,'.group[data-group="tools"]')}(o)||this.setActive(null))},this)};const _c={__depends__:[ei],__init__:["toolManager"],toolManager:["type",pr]};function va(e,t){return e.indexOf(t)!==-1}var id=Math.abs,B1=Math.round,ii={x:"width",y:"height"},Og="crosshair",Sc={n:"top",w:"left",s:"bottom",e:"right"},jg={n:"s",w:"e",s:"n",e:"w"},Cc=20;function ri(e,t,n,i,r,o,a){this._canvas=e,this._dragging=t,this._eventBus=n,this._modeling=i,this._rules=r,this._toolManager=o,this._mouse=a;var c=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),n.on("spaceTool.selection.end",function(l){n.once("spaceTool.selection.ended",function(){c.activateMakeSpace(l.originalEvent)})}),n.on("spaceTool.move",1500,function(l){var u=l.context,p=u.initialized;p||(p=u.initialized=c.init(l,u)),p&&Vg(l)}),n.on("spaceTool.end",function(l){var u=l.context,p=u.axis,h=u.direction,v=u.movingShapes,f=u.resizingShapes,y=u.start;if(u.initialized){Vg(l);var g={x:0,y:0};g[p]=B1(l["d"+p]),c.makeSpace(v,f,g,h,y),n.once("spaceTool.ended",function(x){c.activateSelection(x.originalEvent,!0,!0)})}})}function Lg(e){return{top:e.top-Cc,right:e.right+Cc,bottom:e.bottom+Cc,left:e.left-Cc}}function Vg(e){var t,n,i=e.context.spaceToolConstraints;i&&(fe(i.left)&&(t=Math.max(e.x,i.left),e.dx=e.dx+t-e.x,e.x=t),fe(i.right)&&(t=Math.min(e.x,i.right),e.dx=e.dx+t-e.x,e.x=t),fe(i.top)&&(n=Math.max(e.y,i.top),e.dy=e.dy+n-e.y,e.y=n),fe(i.bottom)&&(n=Math.min(e.y,i.bottom),e.dy=e.dy+n-e.y,e.y=n))}function rd(e,t){return e.indexOf(t)!==-1}function od(e){return!!e.waypoints}function Fg(e){return!!e.labelTarget}ri.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],ri.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{autoActivate:t,cursor:Og,data:{context:{reactivate:n}},trapClick:!1})},ri.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:Og,data:{context:{}}})},ri.prototype.makeSpace=function(e,t,n,i,r){return this._modeling.createSpace(e,t,n,i,r)},ri.prototype.init=function(e,t){var n=id(e.dx)>id(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(id(i)<5)return!1;i<0&&(i*=-1),to(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=ss(this._canvas.getRootElement(),!0),c=this.calculateAdjustments(a,n,i,r),l=function(u,p,h,v,f){var y=u.movingShapes,g=u.resizingShapes;if(g.length){var x,E,_={};return F(g,function(w){var S,D,s,d=ce(w),m=Ee(w.children,function(I){return!(od(I)||Fg(I)||rd(y,I)||rd(g,I))}),C=Ee(w.children,function(I){return!od(I)&&!Fg(I)&&rd(y,I)});m.length&&(D=Lg(ce(gt(m))),S=v-d[Sc[h]]+D[Sc[h]],h==="n"?_.bottom=E=fe(E)?Math.min(E,S):S:h==="w"?_.right=E=fe(E)?Math.min(E,S):S:h==="s"?_.top=x=fe(x)?Math.max(x,S):S:h==="e"&&(_.left=x=fe(x)?Math.max(x,S):S)),C.length&&(s=Lg(ce(gt(C))),S=v-s[Sc[jg[h]]]+d[Sc[jg[h]]],h==="n"?_.bottom=E=fe(E)?Math.min(E,S):S:h==="w"?_.right=E=fe(E)?Math.min(E,S):S:h==="s"?_.top=x=fe(x)?Math.max(x,S):S:h==="e"&&(_.left=x=fe(x)?Math.max(x,S):S));var R=f&&f[w.id];R&&(h==="n"?(S=v+w[ii[p]]-R[ii[p]],_.bottom=E=fe(E)?Math.min(E,S):S):h==="w"?(S=v+w[ii[p]]-R[ii[p]],_.right=E=fe(E)?Math.min(E,S):S):h==="s"?(S=v-w[ii[p]]+R[ii[p]],_.top=x=fe(x)?Math.max(x,S):S):h==="e"&&(S=v-w[ii[p]]+R[ii[p]],_.left=x=fe(x)?Math.max(x,S):S))}),_}}(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}),Bs("resize-"+(n==="x"?"ew":"ns")),!0},ri.prototype.calculateAdjustments=function(e,t,n,i){var r=this._rules,o=[],a=[];return F(e,function(c){if(c.parent&&!od(c)){var l=c[t],u=l+c[ii[t]];return n>0&&l>i||n<0&&u<i?o.push(c):l<i&&u>i&&r.allowed("shape.resize",{shape:c})?a.push(c):void 0}}),{movingShapes:o,resizingShapes:a}},ri.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},ri.prototype.isActive=function(){var e=this._dragging.context();return e&&/^spaceTool/.test(e.prefix)};var ad="djs-dragging",$g="djs-resizing",Tc=Math.max;function zg(e,t,n,i,r){function o(a,c){F(a,function(l){r.addDragger(l,c),n.addMarker(l,ad)})}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",h=se("g");W(h,i.cls("djs-crosshair-group",["no-events"])),pe(c,h);var v=se("path");W(v,"d",u),Ce(v).add("djs-crosshair"),pe(h,v);var f=se("path");W(f,"d",p),Ce(f).add("djs-crosshair"),pe(h,f),l.crosshairGroup=h}),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&&it(c)}),e.on("spaceTool.move",250,function(a){var c=a.context,l=c.line,u=c.axis,p=c.movingShapes,h=c.resizingShapes;if(c.initialized){if(!c.dragGroup){var v=n.getLayer("space");W(l=se("path"),"d","M0,0 L0,0"),Ce(l).add("djs-crosshair"),pe(v,l),c.line=l;var f=se("g");W(f,i.cls("djs-drag-group",["no-events"])),pe(n.getActiveLayer(),f),o(p,f),o(c.movingConnections=t.filter(function(E){var _=!1;F(p,function(s){F(s.outgoing,function(d){E===d&&(_=!0)})});var w=!1;F(p,function(s){F(s.incoming,function(d){E===d&&(w=!0)})});var S=!1;F(h,function(s){F(s.outgoing,function(d){E===d&&(S=!0)})});var D=!1;return F(h,function(s){F(s.incoming,function(d){E===d&&(D=!0)})}),function(s){return s.waypoints}(E)&&(_||S)&&(w||D)}),f),c.dragGroup=f}if(!c.frameGroup){var y=se("g");W(y,i.cls("djs-frame-group",["no-events"])),pe(n.getActiveLayer(),y);var g=[];F(h,function(E){var _=r.addFrame(E,y),w=_.getBBox();g.push({element:_,initialBounds:w}),n.addMarker(E,$g)}),c.frameGroup=y,c.frames=g}W(l,{d:{x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y}[u]});var x={x:a.dx,y:a.dy};x[{x:"y",y:"x"}[c.axis]]=0,Lt(c.dragGroup,x.x,x.y),F(c.frames,function(E){var _,w,S=E.element,D=E.initialBounds;c.direction==="e"?W(S,{width:Tc(D.width+x.x,5)}):W(S,{width:_=Tc(D.width-x.x,5),x:D.x+D.width-_}),c.direction==="s"?W(S,{height:Tc(D.height+x.y,5)}):W(S,{height:w=Tc(D.height-x.y,5),y:D.y+D.height-w})})}}),e.on("spaceTool.cleanup",function(a){var c=a.context,l=c.movingShapes,u=c.movingConnections,p=c.resizingShapes,h=c.line,v=c.dragGroup,f=c.frameGroup;F(l,function(y){n.removeMarker(y,ad)}),F(u,function(y){n.removeMarker(y,ad)}),v&&(it(h),it(v)),F(p,function(y){n.removeMarker(y,$g)}),f&&it(f)})}zg.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const Gg={__init__:["spaceToolPreview"],__depends__:[ei,Vn,_c,na,oa],spaceTool:["type",ri],spaceToolPreview:["type",zg]};function on(e){this._model=e}function $t(e,t,n,i){ne.call(this,e),this._bpmnFactory=t,this._translate=i;var r=this;function o(p){F(p.context.oldRoot.children,function(h){A(h,"bpmn:BaseElement")&&r.updateParent(h)})}function a(p){var h=p.context.shape;A(h,"bpmn:BaseElement")&&r.updateBounds(h)}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 h,v=p.context,f=v.hints||{};v.cropped||f.createElementsBehavior===!1||((h=v.connection).waypoints=n.getCroppedWaypoints(h),v.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 h=p.context;r.updateParent(h.shape||h.connection,h.oldParent)})),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],an(function(p){var h=p.context,v=h.shape||h.connection,f=h.parent||h.newParent;r.updateParent(v,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 h=p.context,v=h.connection,f=h.oldSource,y=h.newSource,g=re(v),x=re(f),E=re(y);g.conditionExpression&&!Pe(E,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(h.oldConditionExpression=g.conditionExpression,delete g.conditionExpression),f!==y&&x.default===g&&(h.oldDefault=x.default,delete x.default)})),this.reverted("connection.reconnect",an(function(p){var h=p.context,v=h.connection,f=h.oldSource,y=h.newSource,g=re(v),x=re(f),E=re(y);h.oldConditionExpression&&(g.conditionExpression=h.oldConditionExpression),h.oldDefault&&(x.default=h.oldDefault,delete E.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 Ni(e,t,n){Xn.call(this),this._bpmnFactory=e,this._moddle=t,this._translate=n}function Ug(e,t,n){e[n]=t[n],delete t[n]}function Ac(e,t){this._modeling=e,this._canvas=t}function kc(e){this._modeling=e}function Pc(e,t){this._canvas=e,this._layouter=t}on.$inject=["moddle"],on.prototype._needsId=function(e){return Pe(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":Pe(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 ht(e,function(n){return t.createDiWaypoint(n)})},on.prototype.createDiWaypoint=function(e){return this.create("dc:Point",Rn(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})},ae($t,ne),$t.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],$t.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},$t.prototype.updateParent=function(e,t){if(!(e instanceof fs||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)}},$t.prototype.updateBounds=function(e){var t=e.businessObject.di,n=e instanceof fs?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})},$t.prototype.updateFlowNodeRefs=function(e,t,n){n!==t&&(A(n,"bpmn:Lane")&&Qe(n.get("flowNodeRef"),e),A(t,"bpmn:Lane")&&et(t.get("flowNodeRef"),e))},$t.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)},$t.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):(Qe(n,e),e.$parent=null)}},$t.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)},$t.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&&(Qe(o.get("rootElements"),a),a.$parent=null),t&&(et(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&&Qe(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);Qe(c,e),t&&(l||(l=[],t.set(i,l)),l.push(e))}}},$t.prototype.updateConnectionWaypoints=function(e){e.businessObject.di.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},$t.prototype.updateConnection=function(e){var t,n=e.connection,i=re(n),r=re(n.source),o=re(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&&(Qe(i.sourceRef&&i.sourceRef.get("outgoing"),i),r&&r.get("outgoing")&&r.get("outgoing").push(i)),i.sourceRef=r),i.targetRef!==o&&(a&&(Qe(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)},$t.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label},ae(Ni,Xn),Ni.$inject=["bpmnFactory","moddle","translate"],Ni.prototype.baseCreate=Xn.prototype.create,Ni.prototype.create=function(e,t){return e==="label"?this.baseCreate(e,z({type:"label"},Wo,t)):this.createBpmnElement(e,t)},Ni.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){F(u,function(p){l[p]!==void 0&&Ug(c,l,p)})}(a,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&Ug(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)},Ni.prototype._getDefaultSize=function(e){return A(e,"bpmn:SubProcess")?Oe(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")?Oe(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}},Ni.prototype.createParticipantShape=function(e){return Tt(e)||(e={isExpanded:e}),(e=z({type:"bpmn:Participant"},e||{})).isExpanded!==!1&&(e.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(e)},Ac.$inject=["modeling","canvas"],Ac.prototype.preExecute=function(e){var t=this._modeling,n=e.elements,i=e.alignment;F(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)})},Ac.prototype.postExecute=function(e){},kc.$inject=["modeling"],kc.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},kc.prototype.postExecute=function(e){var t,n,i=e.hints||{};t=e.source,n=e.shape,Yi(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))},Pc.$inject=["canvas","layouter"],Pc.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},Pc.prototype.revert=function(e){var t=e.connection;return this._canvas.removeConnection(t),t.source=null,t.target=null,t};var Mc=Math.round;function sd(e){this._modeling=e}function Hg(e){return!!e.waypoints}sd.$inject=["modeling"],sd.prototype.preExecute=function(e){var t=e.elements,n=e.parent,i=e.parentIndex,r=e.position,o=e.hints,a=this._modeling;F(t,function(p){fe(p.x)||(p.x=0),fe(p.y)||(p.y=0)});var c=gt(t);F(t,function(p){Hg(p)&&(p.waypoints=ht(p.waypoints,function(h){return{x:Mc(h.x-c.x-c.width/2+r.x),y:Mc(h.y-c.y-c.height/2+r.y)}})),z(p,{x:Mc(p.x-c.x-c.width/2+r.x),y:Mc(p.y-c.y-c.height/2+r.y)})});var l=fm(t),u={};F(t,function(p){if(Hg(p))u[p.id]=fe(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 h=z({},o);l.indexOf(p)===-1&&(h.autoResize=!1),u[p.id]=fe(i)?a.createShape(p,Rn(p,["x","y","width","height"]),p.parent||n,i,h):a.createShape(p,Rn(p,["x","y","width","height"]),p.parent||n,h)}}),e.elements=Hl(u)};var qg=Math.round;function Ii(e){this._canvas=e}function ya(e){Ii.call(this,e)}Ii.$inject=["canvas"],Ii.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-qg(t.width/2),y:n.y-qg(t.height/2)}),this._canvas.addShape(t,i,r),t},Ii.prototype.revert=function(e){var t=e.shape;return this._canvas.removeShape(t),t},ae(ya,Ii),ya.$inject=["canvas"];var O1=Ii.prototype.execute;ya.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,O1.call(this,e)};var j1=Ii.prototype.revert;function Rc(e,t){this._canvas=e,this._modeling=t}function cd(e,t){this._modeling=e,this._elementRegistry=t}function ga(e,t){this._canvas=e,this._modeling=t}function Nc(e){this._modeling=e}ya.prototype.revert=function(e){return e.shape.labelTarget=null,j1.call(this,e)},Rc.$inject=["canvas","modeling"],Rc.prototype.execute=function(e){var t=e.connection,n=t.parent;return e.parent=n,e.parentIndex=cu(n.children,t),e.source=t.source,e.target=t.target,this._canvas.removeConnection(t),t.source=null,t.target=null,t},Rc.prototype.revert=function(e){var t=e.connection,n=e.parent,i=e.parentIndex;return t.source=e.source,t.target=e.target,et(n.children,t,i),this._canvas.addConnection(t,n),t},cd.$inject=["modeling","elementRegistry"],cd.prototype.postExecute=function(e){var t=this._modeling,n=this._elementRegistry;F(e.elements,function(i){n.get(i.id)&&(i.waypoints?t.removeConnection(i):t.removeShape(i))})},ga.$inject=["canvas","modeling"],ga.prototype.preExecute=function(e){var t=this._modeling,n=e.shape;ho(n.incoming,function(i){t.removeConnection(i,{nested:!0})}),ho(n.outgoing,function(i){t.removeConnection(i,{nested:!0})}),ho(n.children,function(i){i.waypoints?t.removeConnection(i,{nested:!0}):t.removeShape(i,{nested:!0})})},ga.prototype.execute=function(e){var t=this._canvas,n=e.shape,i=n.parent;return e.oldParent=i,e.oldParentIndex=cu(i.children,n),t.removeShape(n),n},ga.prototype.revert=function(e){var t=this._canvas,n=e.shape,i=e.oldParent,r=e.oldParentIndex;return et(i.children,n,r),t.addShape(n,i),n},Nc.$inject=["modeling"];var Wg={x:"y",y:"x"};function Ic(e,t){this._layouter=e,this._canvas=t}function ld(){}function ud(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function ba(e){this._modeling=e}function Dc(e){this._helper=new ba(e)}function dr(e){this._modeling=e,this._helper=new ba(e)}function xa(e){this._modeling=e}function Kg(e){return e.original||e}function oi(e,t){this._modeling=e,this._rules=t}function Ea(e){this._modeling=e}function Di(e){this._modeling=e}function Xg(e){return z({},e)}function Yg(e){switch(e){case"n":case"s":return"y";case"w":case"e":return"x"}}function Jg(e,t,n){var i=Yg(n);return/e|s/.test(n)?e[i]>t:/n|w/.test(n)?e[i]<t:void 0}function Bi(e,t){return e.indexOf(t)!==-1}function Bc(e){this._modeling=e}function Zg(e){var t={};return F(e,function(n){t[n.id]=n.hidden,n.children&&(t=z({},t,Zg(n.children)))}),t}function Qg(e,t){var n=[];return F(e,function(i){i.hidden=t,n=n.concat(i),i.children&&(n=n.concat(Qg(i.children,i.collapsed||t)))}),n}function eb(e,t){var n=[];return F(e,function(i){i.hidden=t[i.id],n=n.concat(i),i.children&&(n=n.concat(eb(i.children,t)))}),n}function Oc(e){this._modeling=e}function tb(e,t){return Qe(e&&e.attachers,t)}function nb(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),et(i,t,n)}}function pd(){}function Le(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",function(){i.registerHandlers(n)})}function wa(e){this._elementRegistry=e}function ib(e,t){F(t,function(n,i){e.set(i,n)})}Nc.prototype.preExecute=function(e){var t=this._modeling,n=e.groups,i=e.axis,r=e.dimension;function o(g,x){g.range.min=Math.min(x[i],g.range.min),g.range.max=Math.max(x[i]+x[r],g.range.max)}function a(g){return g[i]+g[r]/2}function c(g){return g.length-1}function l(g){return g.max-g.min}var u,p,h=n[0],v=c(n),f=n[v],y=0;F(n,function(g,x){var E,_,w;g.elements.length<2?x&&x!==n.length-1&&(o(g,g.elements[0]),y+=l(g.range)):(_=(E=mn(g.elements,i))[0],x===v&&(_=E[c(E)]),w=a(_),g.range=null,F(E,function(S){(function(D,s){var d={y:0};d[i]=D-a(s),d[i]&&(d[Wg[i]]=0,t.moveElements([s],d,s.parent))})(w,S),g.range!==null?o(g,S):g.range={min:S[i],max:S[i]+S[r]}}),x&&x!==n.length-1&&(y+=l(g.range)))}),p=Math.abs(f.range.min-h.range.max),(u=Math.round((p-y)/(n.length-1)))<n.length-1||F(n,function(g,x){var E,_={};g!==h&&g!==f&&(E=n[x-1],g.range.max=0,F(g.elements,function(w,S){_[Wg[i]]=0,_[i]=E.range.max-w[i]+u,g.range.min!==w[i]&&(_[i]+=w[i]-g.range.min),_[i]&&t.moveElements([w],_,w.parent),g.range.max=Math.max(w[i]+w[r],S?g.range.max:0)}))})},Nc.prototype.postExecute=function(e){},Ic.$inject=["layouter","canvas"],Ic.prototype.execute=function(e){var t=e.connection;return z(e,{oldWaypoints:t.waypoints}),t.waypoints=this._layouter.layoutConnection(t,e.hints),t},Ic.prototype.revert=function(e){var t=e.connection;return t.waypoints=e.oldWaypoints,t},ld.prototype.execute=function(e){var t=e.connection,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldParent=o,e.oldParentIndex=Qe(o.children,t),et(i.children,t,r),t.parent=i,F(t.waypoints,function(a){a.x+=n.x,a.y+=n.y,a.original&&(a.original.x+=n.x,a.original.y+=n.y)}),t},ld.prototype.revert=function(e){var t=e.connection,n=t.parent,i=e.oldParent,r=e.oldParentIndex,o=e.delta;return Qe(n.children,t),et(i.children,t,r),t.parent=i,F(t.waypoints,function(a){a.x-=o.x,a.y-=o.y,a.original&&(a.original.x-=o.x,a.original.y-=o.y)}),t},ud.prototype.add=function(e,t){return this.addAll([e],t)},ud.prototype.addAll=function(e,t){var n=function(i,r,o){No(r)&&(r=!0),Tt(r)&&(o=r,r=!0);var a=Oo((o=o||{}).allShapes),c=Oo(o.allConnections),l=Oo(o.enclosedElements),u=Oo(o.enclosedConnections),p=Oo(o.topLevel,r&&jr(i,function(v){return v.id}));function h(v){p[v.source.id]&&p[v.target.id]&&(p[v.id]=[v]),a[v.source.id]&&a[v.target.id]&&(u[v.id]=l[v.id]=v),c[v.id]=v}return Zi(i,function(v){if(l[v.id]=v,!v.waypoints)return a[v.id]=v,F(v.incoming,h),F(v.outgoing,h),v.children;u[v.id]=c[v.id]=v}),{allShapes:a,allConnections:c,topLevel:p,enclosedConnections:u,enclosedElements:l}}(e,!!t,this);return z(this,n),this},ba.prototype.moveRecursive=function(e,t,n){return e?this.moveClosure(this.getClosure(e),t,n):[]},ba.prototype.moveClosure=function(e,t,n,i,r){var o=this._modeling,a=e.allShapes,c=e.allConnections,l=e.enclosedConnections,u=e.topLevel,p=!1;r&&r.parent===n&&(p=!0),F(a,function(h){o.moveShape(h,t,u[h.id]&&!p&&n,{recurse:!1,layout:!1})}),F(c,function(h){var v=!!a[h.source.id],f=!!a[h.target.id];l[h.id]&&v&&f?o.moveConnection(h,t,u[h.id]&&!p&&n):o.layoutConnection(h,{connectionStart:v&&Ip(h,h.source,t),connectionEnd:f&&Dp(h,h.target,t)})})},ba.prototype.getClosure=function(e){return new ud().addAll(e,!0)},Dc.$inject=["modeling"],Dc.prototype.preExecute=function(e){e.closure=this._helper.getClosure(e.shapes)},Dc.prototype.postExecute=function(e){var t,n=e.hints;n&&n.primaryShape&&(t=n.primaryShape,n.oldParent=t.parent),this._helper.moveClosure(e.closure,e.delta,e.newParent,e.newHost,t)},dr.$inject=["modeling"],dr.prototype.execute=function(e){var t=e.shape,n=e.delta,i=e.newParent||t.parent,r=e.newParentIndex,o=t.parent;return e.oldBounds=Rn(t,["x","y","width","height"]),e.oldParent=o,e.oldParentIndex=Qe(o.children,t),et(i.children,t,r),z(t,{parent:i,x:t.x+n.x,y:t.y+n.y}),t},dr.prototype.postExecute=function(e){var t=e.shape,n=e.delta,i=e.hints,r=this._modeling;i.layout!==!1&&(F(t.incoming,function(o){r.layoutConnection(o,{connectionEnd:Dp(o,t,n)})}),F(t.outgoing,function(o){r.layoutConnection(o,{connectionStart:Ip(o,t,n)})})),i.recurse!==!1&&this.moveChildren(e)},dr.prototype.revert=function(e){var t=e.shape,n=e.oldParent,i=e.oldParentIndex,r=e.delta;return et(n.children,t,i),z(t,{parent:n,x:t.x-r.x,y:t.y-r.y}),t},dr.prototype.moveChildren=function(e){var t=e.delta,n=e.shape;this._helper.moveRecursive(n.children,t,null)},dr.prototype.getNewParent=function(e){return e.newParent||e.shape.parent},xa.$inject=["modeling"],xa.prototype.execute=function(e){var t=e.newSource,n=e.newTarget,i=e.connection,r=e.dockingOrPoints;if(!t&&!n)throw new Error("newSource or newTarget required");return Se(r)&&(e.oldWaypoints=i.waypoints,i.waypoints=r),t&&(e.oldSource=i.source,i.source=t),n&&(e.oldTarget=i.target,i.target=n),i},xa.prototype.postExecute=function(e){var t=e.connection,n=e.newSource,i=e.newTarget,r=e.dockingOrPoints,o=e.hints||{},a={};o.connectionStart&&(a.connectionStart=o.connectionStart),o.connectionEnd&&(a.connectionEnd=o.connectionEnd),o.layoutConnection!==!1&&(!n||i&&o.docking!=="source"||(a.connectionStart=a.connectionStart||Kg(Se(r)?r[0]:r)),!i||n&&o.docking!=="target"||(a.connectionEnd=a.connectionEnd||Kg(Se(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(t,a))},xa.prototype.revert=function(e){var t=e.oldSource,n=e.oldTarget,i=e.oldWaypoints,r=e.connection;return t&&(r.source=t),n&&(r.target=n),i&&(r.waypoints=i),r},oi.$inject=["modeling","rules"],oi.prototype.preExecute=function(e){var t,n=this,i=this._modeling,r=this._rules,o=e.oldShape,a=e.newData,c=e.hints||{};function l(y,g,x){return r.allowed("connection.reconnect",{connection:x,source:y,target:g})}var u,p={x:a.x,y:a.y},h={x:o.x,y:o.y,width:o.width,height:o.height};t=e.newShape=e.newShape||n.createShape(a,p,o.parent,c),o.host&&i.updateAttachment(t,o.host),c.moveChildren!==!1&&(u=o.children.slice(),i.moveElements(u,{x:0,y:0},t,c));var v=o.incoming.slice(),f=o.outgoing.slice();F(v,function(y){l(y.source,t,y)&&n.reconnectEnd(y,t,hc(y,t,h),c)}),F(f,function(y){var g=y.target;l(t,g,y)&&n.reconnectStart(y,t,dc(y,t,h),c)})},oi.prototype.postExecute=function(e){var t=e.oldShape;this._modeling.removeShape(t)},oi.prototype.execute=function(e){},oi.prototype.revert=function(e){},oi.prototype.createShape=function(e,t,n,i){return this._modeling.createShape(e,t,n,i)},oi.prototype.reconnectStart=function(e,t,n,i){this._modeling.reconnectStart(e,t,n,i)},oi.prototype.reconnectEnd=function(e,t,n,i){this._modeling.reconnectEnd(e,t,n,i)},Ea.$inject=["modeling"],Ea.prototype.execute=function(e){var t=e.shape,n=e.newBounds,i=e.minBounds;if(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)throw new Error("newBounds must have {x, y, width, height} properties");if(i&&(n.width<i.width||n.height<i.height))throw new Error("width and height cannot be less than minimum height and width");if(!i&&n.width<10||n.height<10)throw new Error("width and height cannot be less than 10px");return e.oldBounds={width:t.width,height:t.height,x:t.x,y:t.y},z(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Ea.prototype.postExecute=function(e){var t=this._modeling,n=e.shape,i=e.oldBounds;(e.hints||{}).layout!==!1&&(F(n.incoming,function(r){t.layoutConnection(r,{connectionEnd:hc(r,n,i)})}),F(n.outgoing,function(r){t.layoutConnection(r,{connectionStart:dc(r,n,i)})}))},Ea.prototype.revert=function(e){var t=e.shape,n=e.oldBounds;return z(t,{width:n.width,height:n.height,x:n.x,y:n.y}),t},Di.$inject=["modeling"],Di.prototype.preExecute=function(e){var t=e.delta,n=e.direction,i=e.movingShapes,r=e.resizingShapes,o=e.start,a={};this.moveShapes(i,t),F(r,function(c){a[c.id]=function(l){return{x:l.x,y:l.y,height:l.height,width:l.width}}(c)}),this.resizeShapes(r,t,n),this.updateConnectionWaypoints(function(c,l){var u=[];return F(c.concat(l),function(p){var h=p.incoming,v=p.outgoing;F(h.concat(v),function(f){var y=f.source,g=f.target;(va(c,y)||va(c,g)||va(l,y)||va(l,g))&&(va(u,f)||u.push(f))})}),u}(i,r),t,n,o,i,r,a)},Di.prototype.execute=function(){},Di.prototype.revert=function(){},Di.prototype.moveShapes=function(e,t){var n=this;F(e,function(i){n._modeling.moveShape(i,t,null,{autoResize:!1,layout:!1,recurse:!1})})},Di.prototype.resizeShapes=function(e,t,n){var i=this;F(e,function(r){var o=function(a,c,l){var u=a.x,p=a.y,h=a.width,v=a.height,f=l.x,y=l.y;switch(c){case"n":return{x:u,y:p+y,width:h,height:v-y};case"s":return{x:u,y:p,width:h,height:v+y};case"w":return{x:u+f,y:p,width:h-f,height:v};case"e":return{x:u,y:p,width:h+f,height:v};default:throw new Error("unknown direction: "+c)}}(r,n,t);i._modeling.resizeShape(r,o,null,{attachSupport:!1,autoResize:!1,layout:!1})})},Di.prototype.updateConnectionWaypoints=function(e,t,n,i,r,o,a){var c=this,l=r.concat(o);F(e,function(u){var p=u.source,h=u.target,v=function(g){return ht(g.waypoints,function(x){return(x=Xg(x)).original&&(x.original=Xg(x.original)),x})}(u),f=Yg(n),y={labelBehavior:!1};Bi(l,p)&&Bi(l,h)?(v=ht(v,function(g){return Jg(g,i,n)&&(g[f]=g[f]+t[f]),g.original&&Jg(g.original,i,n)&&(g.original[f]=g.original[f]+t[f]),g}),c._modeling.updateWaypoints(u,v,{labelBehavior:!1})):(Bi(l,p)||Bi(l,h))&&(Bi(r,p)?y.connectionStart=Ip(u,p,t):Bi(r,h)?y.connectionEnd=Dp(u,h,t):Bi(o,p)?y.connectionStart=dc(u,p,a[p.id]):Bi(o,h)&&(y.connectionEnd=hc(u,h,a[h.id])),c._modeling.layoutConnection(u,y))})},Bc.$inject=["modeling"],Bc.prototype.execute=function(e){var t=e.shape,n=t.children;e.oldChildrenVisibility=Zg(n),t.collapsed=!t.collapsed;var i=Qg(n,t.collapsed);return[t].concat(i)},Bc.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=eb(t.children,n);return t.collapsed=!t.collapsed,[t].concat(i)},Oc.$inject=["modeling"],Oc.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=tb(i,t),nb(n,t),t.host=n,t},Oc.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,tb(n,t),nb(i,t,r),t},pd.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},pd.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t},Le.$inject=["eventBus","elementFactory","commandStack"],Le.prototype.getHandlers=function(){return{"shape.append":kc,"shape.create":Ii,"shape.delete":ga,"shape.move":dr,"shape.resize":Ea,"shape.replace":oi,"shape.toggleCollapse":Bc,spaceTool:Di,"label.create":ya,"connection.create":Pc,"connection.delete":Rc,"connection.move":ld,"connection.layout":Ic,"connection.updateWaypoints":pd,"connection.reconnect":xa,"elements.create":sd,"elements.move":Dc,"elements.delete":cd,"elements.distribute":Nc,"elements.align":Ac,"element.updateAttachment":Oc}},Le.prototype.registerHandlers=function(e){F(this.getHandlers(),function(t,n){e.registerHandler(n,t)})},Le.prototype.moveShape=function(e,t,n,i,r){typeof i=="object"&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},Le.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},Le.prototype.moveElements=function(e,t,n,i){var r,o=(i=i||{}).attach,a=n;o===!0?(r=n,a=n.parent):o===!1&&(r=null);var c={shapes:e,delta:t,newParent:a,newHost:r,hints:i};this._commandStack.execute("elements.move",c)},Le.prototype.moveConnection=function(e,t,n,i,r){typeof i=="object"&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},Le.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},Le.prototype.createConnection=function(e,t,n,i,r,o){typeof n=="object"&&(o=r,r=i,i=n,n=void 0);var a={source:e,target:t,parent:r,parentIndex:n,connection:i=this._create("connection",i),hints:o};return this._commandStack.execute("connection.create",a),a.connection},Le.prototype.createShape=function(e,t,n,i,r){typeof i!="number"&&(r=i,i=void 0);var o,a,c=(r=r||{}).attach;e=this._create("shape",e),c?(o=n.parent,a=n):o=n;var l={position:t,shape:e,parent:o,parentIndex:i,host:a,hints:r};return this._commandStack.execute("shape.create",l),l.shape},Le.prototype.createElements=function(e,t,n,i,r){Se(e)||(e=[e]),typeof i!="number"&&(r=i,i=void 0);var o={position:t,elements:e,parent:n,parentIndex:i,hints:r=r||{}};return this._commandStack.execute("elements.create",o),o.elements},Le.prototype.createLabel=function(e,t,n,i){n=this._create("label",n);var r={labelTarget:e,position:t,parent:i||e.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},Le.prototype.appendShape=function(e,t,n,i,r){r=r||{};var o={source:e,position:n,target:i,shape:t=this._create("shape",t),connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},Le.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},Le.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},Le.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},Le.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},Le.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},Le.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},Le.prototype.resizeShape=function(e,t,n,i){var r={shape:e,newBounds:t,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},Le.prototype.createSpace=function(e,t,n,i,r){var o={delta:n,direction:i,movingShapes:e,resizingShapes:t,start:r};this._commandStack.execute("spaceTool",o)},Le.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},Le.prototype.reconnect=function(e,t,n,i,r){var o={connection:e,newSource:t,newTarget:n,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)},Le.prototype.reconnectStart=function(e,t,n,i){i||(i={}),this.reconnect(e,t,e.target,n,z(i,{docking:"source"}))},Le.prototype.reconnectEnd=function(e,t,n,i){i||(i={}),this.reconnect(e,e.source,t,n,z(i,{docking:"target"}))},Le.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},Le.prototype._create=function(e,t){return t instanceof Vo?t:this._elementFactory.create(e,t)},Le.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)},wa.$inject=["elementRegistry"],wa.prototype.execute=function(e){var t=e.element,n=e.moddleElement,i=e.properties;if(!n)throw new Error("<moddleElement> required");var r=e.changed||this.getVisualReferences(n).concat(t),o=e.oldProperties||function(a,c){return Gt(c,function(l,u){return l[u]=a.get(u),l},{})}(n,is(i));return ib(n,i),e.oldProperties=o,e.changed=r,r},wa.prototype.revert=function(e){var t=e.oldProperties,n=e.moddleElement,i=e.changed;return ib(n,t),i},wa.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")&&re(r).dataObjectRef===n})}(e,t):[]};var _a="default",ai="id",rb="di",L1={width:0,height:0};function Sa(e,t,n,i,r){this._elementRegistry=e,this._moddle=t,this._translate=n,this._modeling=i,this._textRenderer=r}function ob(e,t){return ai in e&&e[ai]!==t[ai]}function ab(e,t){F(t,function(n,i){i!==rb?e.set(i,n):e.di&&function(r,o){F(o,function(a,c){r.set(c,a)})}(e.di,n)})}Sa.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],Sa.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 V1.forEach(function(h){h in u&&(p[h]=re(p[h]))}),p}(e.properties),l=e.oldProperties||function(u,p){var h=is(p);return Gt(h,function(v,f){return v[f]=f!==rb?u.get(f):function(y,g){return Gt(g,function(x,E){return x[E]=y.get(E),x},{})}(u.di,is(p.di)),v},{})}(a,c);return ob(c,a)&&(o.unclaim(a[ai]),r.updateId(t,c[ai]),o.claim(c[ai],a)),_a in c&&(c[_a]&&n.push(r.get(c[_a].id)),a[_a]&&n.push(r.get(a[_a].id))),ab(a,c),e.oldProperties=l,e.changed=n,n},Sa.prototype.postExecute=function(e){var t=e.element.label,n=t&&re(t).name;if(n){var i=this._textRenderer.getExternalLabelBounds(t,n);this._modeling.resizeShape(t,i,L1)}},Sa.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 ab(r,i),ob(n,r)&&(a.unclaim(n[ai]),o.updateId(t,i[ai]),a.claim(i[ai],r)),e.changed};var V1=["default"];function jc(e,t){this._canvas=e,this._modeling=t}function dd(e,t){this._modeling=e,this._spaceTool=t}function hd(e,t){this._modeling=e,this._translate=t}function Ca(e,t){this._modeling=e,this._spaceTool=t}jc.$inject=["canvas","modeling"],jc.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),et(a.rootElements,i),i.$parent=a,Qe(a.rootElements,o),o.$parent=null,o.di=null,c.bpmnElement=i,i.di=c,e.oldRoot=r},jc.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),Qe(o.rootElements,n),n.$parent=null,et(o.rootElements,r),r.$parent=o,n.di=null,a.bpmnElement=r,r.di=a},dd.$inject=["modeling","spaceTool"],dd.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=wn(i),a=o===i,c=a?i:i.parent;Pi(c).length||n.createShape({type:"bpmn:Lane"},{x:i.x+co,y:i.y,width:i.width-co,height:i.height},c);var l=[];Zi(o,function(y){return l.push(y),y.label&&l.push(y.label),y===i?[]:Ee(y.children,function(g){return g!==i})});var u=r==="top"?-120:120,p=r==="top"?i.y:i.y+i.height,h=p+(r==="top"?10:-10),v=r==="top"?"n":"s",f=t.calculateAdjustments(l,"y",u,h);t.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:u},v,h),e.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?co:0),y:p-(r==="top"?120:0),width:i.width-(a?co:0),height:120},c)},hd.$inject=["modeling","translate"],hd.prototype.preExecute=function(e){var t=this._modeling,n=this._translate,i=e.shape,r=e.count,o=Pi(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var c,l,u,p,h,v=Math.round(i.height/r);for(h=0;h<r;h++)c=i.y+h*v,l=h===r-1?i.height-v*h:v,u={x:i.x+co,y:c,width:i.width-co,height:l},h<a?t.resizeShape(o[h],u):(p={type:"bpmn:Lane"},t.createShape(p,u,i))},Ca.$inject=["modeling","spaceTool"],Ca.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds;e.balanced!==!1?this.resizeBalanced(t,n):this.resizeSpace(t,n)},Ca.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=$_(e,t);n.resizeShape(e,t),i.forEach(function(r){n.resizeShape(r.shape,r.newBounds)})},Ca.prototype.resizeSpace=function(e,t){var n,i,r,o,a,c=this._spaceTool,l=ce(e),u=ly(ce(t),l),p=wn(e),h=[],v=[];Zi(p,function(f){return h.push(f),(A(f,"bpmn:Lane")||A(f,"bpmn:Participant"))&&v.push(f),f.children}),(u.bottom||u.top)&&(n=u.bottom||u.top,i=e.y+(u.bottom?e.height:0)+(u.bottom?-10:10),r=u.bottom?"s":"n",o=u.top>0||u.bottom<0?-n:n,a=c.calculateAdjustments(h,"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(v,"x",o,i),c.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var Ta="flowNodeRef",md="lanes";function Aa(e){this._elementRegistry=e}function Lc(e){this._moddle=e}Aa.$inject=["elementRegistry"],Aa.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 h=wn(p);return r[h.id]||(r[h.id]=Zs(h)),r[h.id]}(l);return u.filter(function(p){return h=l,v=ce(p),f=h.x+h.width/2,y=h.y+h.height/2,f>v.left&&f<v.right&&y>v.top&&y<v.bottom;var h,v,f,y}).map(function(p){return p.businessObject})}return t.forEach(function(l){var u=wn(l);u&&n.indexOf(u)===-1&&(u.children.filter(function(p){return A(p,"bpmn:FlowNode")}).forEach(a),n.push(u))}),e.forEach(a),o.forEach(function(l){var u=l.businessObject,p=u.get(md).slice(),h=c(l);i.push({flowNode:u,remove:p,add:h})}),t.forEach(function(l){var u=l.businessObject;l.parent||u.get(Ta).forEach(function(p){i.push({flowNode:p,remove:[u],add:[]})})}),i},Aa.prototype.execute=function(e){var t=e.updates;t||(t=e.updates=this.computeUpdates(e.flowNodeShapes,e.laneShapes)),t.forEach(function(n){var i=n.flowNode,r=i.get(md);n.remove.forEach(function(o){Qe(r,o),Qe(o.get(Ta),i)}),n.add.forEach(function(o){et(r,o),et(o.get(Ta),i)})})},Aa.prototype.revert=function(e){e.updates.forEach(function(t){var n=t.flowNode,i=n.get(md);t.add.forEach(function(r){Qe(i,r),Qe(r.get(Ta),n)}),t.remove.forEach(function(r){et(i,r),et(r.get(Ta),n)})})},Lc.$inject=["moddle"],Lc.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.claim(n,i):t.unclaim(n)},Lc.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.unclaim(n):t.claim(n,i)};var F1={fill:void 0,stroke:void 0};function fd(e){this._commandStack=e,this._normalizeColor=function(t){if(t){if(Br(t)){var n=function(i){var r=document.createElement("canvas").getContext("2d");return r.fillStyle="transparent",r.fillStyle=i,/^#[0-9a-fA-F]{6}$/.test(r.fillStyle)?r.fillStyle:null}(t);if(n)return n}throw new Error("invalid color value: "+t)}}}fd.$inject=["commandStack"],fd.prototype.postExecute=function(e){var t=e.elements,n=e.colors||F1,i=this,r={};"fill"in n&&z(r,{"background-color":this._normalizeColor(n.fill)}),"stroke"in n&&z(r,{"border-color":this._normalizeColor(n.stroke)}),F(t,function(o){var a=function(c){return!!c.waypoints}(o)?Rn(r,["border-color"]):r;(function(c){"border-color"in c&&(c.stroke=c["border-color"]),"background-color"in c&&(c.fill=c["background-color"])})(a),o.labelTarget?i._commandStack.execute("element.updateModdleProperties",{element:o,moddleElement:o.businessObject.di.label,properties:{color:r["background-color"]}}):i._commandStack.execute("element.updateProperties",{element:o,properties:{di:a}})})};var $1={width:0,height:0};function sb(e,t){function n(i,r){var o=i.label||i,a=i.labelTarget||i;return function(c,l){var u=c.businessObject,p=_f(u);p&&(p==="categoryValueRef"?u.categoryValueRef.value=l:u[p]=l)}(o,r),[o,a]}this.preExecute=function(i){var r=i.element,o=r.businessObject,a=i.newLabel;if(!wt(r)&&Qr(r)&&!Ps(r)&&!cb(a)){var c=Ms(r);c={x:c.x,y:c.y+7},e.createLabel(r,c,{id:o.id+"_label",businessObject:o})}},this.execute=function(i){return i.oldLabel=gn(i.element),n(i.element,i.newLabel)},this.revert=function(i){return n(i.element,i.oldLabel)},this.postExecute=function(i){var r=i.element,o=r.label||r,a=i.newLabel,c=i.newBounds,l=i.hints||{};if(wt(o)||A(o,"bpmn:TextAnnotation"))if(wt(o)&&cb(a))l.removeShape!==!1&&e.removeShape(o,{unsetLabel:!1});else{var u=gn(o);c===void 0&&(c=t.getExternalLabelBounds(o,u)),c&&e.resizeShape(o,c,$1)}}}function cb(e){return!e||!e.trim()}function St(e,t,n,i){Le.call(this,e,t,n),this._bpmnRules=i}function lb(){}sb.$inject=["modeling","textRenderer"],ae(St,Le),St.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],St.prototype.getHandlers=function(){var e=Le.prototype.getHandlers.call(this);return e["element.updateModdleProperties"]=wa,e["element.updateProperties"]=Sa,e["canvas.updateRoot"]=jc,e["lane.add"]=dd,e["lane.resize"]=Ca,e["lane.split"]=hd,e["lane.updateRefs"]=Aa,e["id.updateClaim"]=Lc,e["element.setColor"]=fd,e["element.updateLabel"]=sb,e},St.prototype.updateLabel=function(e,t,n,i){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,newBounds:n,hints:i||{}})},St.prototype.connect=function(e,t,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(e,t)),n)return this.createConnection(e,t,n,e.parent,i)},St.prototype.updateModdleProperties=function(e,t,n){this._commandStack.execute("element.updateModdleProperties",{element:e,moddleElement:t,properties:n})},St.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},St.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},St.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},St.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},St.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},St.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},St.prototype.makeProcess=function(){var e={newRoot:this._create("root",{type:"bpmn:Process"})};this._commandStack.execute("canvas.updateRoot",e)},St.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},St.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},St.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})},lb.prototype.layoutConnection=function(e,t){return[(t=t||{}).connectionStart||ge(t.source||e.source),t.connectionEnd||ge(t.target||e.target)]};var Vc=20,z1=5,Fc=Math.round,ub=20,G1={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function pb(e,t,n){var i,r,o,a=bt(t,e,z1),c=n.split(":")[0],l=Fc((t.x-e.x)/2+e.x),u=Fc((t.y-e.y)/2+e.y),p=(o=a,{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[c].test(o)),h=/h|r|l/.test(c),v=!1,f=!1;return p?(i=h?{x:l,y:e.y}:{x:e.x,y:u},r=h?"h:h":"v:v"):(v=function(y,g){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[g].test(y)}(a,c),r=h?"h:v":"v:h",v?h?(f=u===e.y,i={x:e.x+Vc*(/l/.test(c)?-1:1),y:f?u+Vc:u}):i={x:(f=l===e.x)?l+Vc:l,y:e.y+Vc*(/t/.test(c)?-1:1)}:i={x:l,y:u}),{waypoints:vd(e,i,r).concat(i),directions:r,turnNextDirections:f}}function db(e){return e.split(":").reverse().join(":")}function vd(e,t,n){if(!function(a){return a&&/^h|v|t|r|b|l:h|v|t|r|b|l$/.test(a)}(n=n||"h:h"))throw new Error("unknown directions: <"+n+">: must be specified as <start>:<end> with start/end in { h,v,t,r,b,l }");if(mb(n)){var i=function(a,c,l){return pb(a,c,l)}(e,t,n),r=function(a,c,l){var u=pb(c,a,db(l));return{waypoints:u.waypoints.slice().reverse(),directions:db(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:vd(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=Fc((c.x-a.x)/2+a.x),p=Fc((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 U1(e,t,n,i,r){var o=lE(r&&r.preferredLayouts||[],"straight")[0]||"h:h",a=bt(e,t,G1[o]||0),c=function(p,h){if(mb(h))return h;switch(p){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return h}}(a,o);n=n||ge(e),i=i||ge(t);var l=c.split(":"),u=fb(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,h,v){var f=vd(p,h,v);return f.unshift(p),f.push(h),vb(f)}(u,fb(i,t,l[1],a),c)}function H1(e,t,n,i,r,o){var a;return Se(n)&&(r=n,o=i,n=ge(e),i=ge(t)),r=r||[],a=(o=z({preferredLayouts:[]},o)).preferredLayouts.indexOf("straight")!==-1&&function(c,l,u,p,h){var v,f,y={};return f=bt(c,l),/^(top|bottom|left|right)$/.test(f)?(/top|bottom/.test(f)&&(v="x"),/left|right/.test(f)&&(v="y"),h.preserveDocking==="target"?hb(v,p,c)?(y[v]=p[v],[{x:y.x!==void 0?y.x:u.x,y:y.y!==void 0?y.y:u.y,original:{x:y.x!==void 0?y.x:u.x,y:y.y!==void 0?y.y:u.y}},{x:p.x,y:p.y}]):null:hb(v,u,l)?(y[v]=u[v],[{x:u.x,y:u.y},{x:y.x!==void 0?y.x:p.x,y:y.y!==void 0?y.y:p.y,original:{x:y.x!==void 0?y.x:p.x,y:y.y!==void 0?y.y:p.y}}]):null):null}(e,t,n,i,o),a||(a=o.connectionEnd&&function(c,l,u,p){var h=p.slice().reverse();return h=yd(c,l,u,h),h?h.reverse():null}(t,e,i,r),a||(a=o.connectionStart&&yd(e,t,n,r))||(!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:U1(e,t,n,i,o)))}function hb(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 yd(e,t,n,i){if(function(c){return c.length<3||!(c.length>4)&&!!je(c,function(l,u){var p=c[u-1];return p&&jo(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(Kn(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(Em(c[p],l,ub)||Em(c[p],u,ub))return c.slice(p);return c}(a,e,t),r!==a&&(a=yd(e,t,n,r)),a&&Kn(a)?null:a}function mb(e){return e&&/t|r|b|l/.test(e)}function fb(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 vb(e){return e.reduce(function(t,n,i){return lu(t[t.length-1],e[i+1],n,0)||t.push(n),t},[])}var q1=-10,W1=40,gd={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},$c={top:"t",right:"r",bottom:"b",left:"l"};function bd(){}function K1(e,t){return A(t,"bpmn:Participant")?"source":A(e,"bpmn:Participant")?"target":ka(t)?"source":ka(e)||A(t,"bpmn:Event")?"target":A(e,"bpmn:Event")?"source":null}function X1(e){return ka(e)?"target":"source"}function yb(e,t){return e?e.original||e:ge(t)}function gb(e,t){return A(t,"bpmn:Activity")&&A(e,"bpmn:BoundaryEvent")&&t.businessObject.isForCompensation}function ka(e){return A(e,"bpmn:SubProcess")&&Oe(e)}function Pa(e,t){return e===t}function Ma(e){var t=/right|left/.exec(e);return t&&t[0]}function hr(e){var t=/top|bottom/.exec(e);return t&&t[0]}function xd(e){return e==="right"||e==="left"}function Y1(e,t){var n=t.waypoints,i=n&&n.length&&bt(n[0],e);return i==="top"?["t:r"]:i==="right"?["r:b"]:i==="left"?["l:t"]:["b:l"]}function J1(e,t,n){var i,r,o,a,c=ge(e),l=ge(t),u=(a=(o=e).host,bt(ge(o),a,q1)),p=Pa(e.host,t),h=["top","right","bottom","left"].indexOf(u)!==-1,v=bt(l,c,{x:e.width/2+t.width/2,y:e.height/2+t.height/2});return p?function(f,y,g,x,E){var _,w=y?f:hr(f),S=$c[w];return _=y?xd(f)?bb("y",g,x,E)?"h":"b":bb("x",g,x,E)?"v":"l":"v",[S+":"+_]}(u,h,e,t,n):(i=function(f,y,g){if(g)return $c[f];if(Pa(hr(f),hr(y))||(x=Ma(f),E=Ma(y),gd[x]===E))return $c[hr(f)];var x,E;return $c[Ma(f)]}(u,v,h),r=function(f,y,g){if(g)return xd(f)?(x=y,E=Ma(f),_=gd[E],x.indexOf(_)!==-1||Pa(f,y)?"h":"v"):function(w,S){var D=hr(w),s=gd[D];return S.indexOf(s)!==-1}(f,y)||Pa(f,y)?"v":"h";var x,E,_;return xd(y)||Pa(hr(f),hr(y))&&Ma(y)?"h":"v"}(u,v,h),[i+":"+r])}function bb(e,t,n,i){var r=W1;return!(Ed(e,i,n,r)||Ed(e,i,{x:n.x+n.width,y:n.y+n.height},r)||Ed(e,i,ge(t),r))}function Ed(e,t,n,i){return Math.abs(t[e]-n[e])<i}function xb(e){return z({original:e.point.original||e.point},e.actual)}function Oi(e,t){this._elementRegistry=e,this._graphicsFactory=t}ae(bd,lb),bd.prototype.layoutConnection=function(e,t){t||(t={});var n,i,r=t.source||e.source,o=t.target||e.target,a=t.waypoints||e.waypoints,c=t.connectionStart,l=t.connectionEnd;return c||(c=yb(a&&a[0],r)),l||(l=yb(a&&a[a.length-1],o)),(A(e,"bpmn:Association")||A(e,"bpmn:DataAssociation"))&&a&&!gb(r,o)?[].concat([c],a.slice(1,-1),[l]):(A(e,"bpmn:MessageFlow")?n=function(u,p){return{preferredLayouts:["straight","v:v"],preserveDocking:K1(u,p)}}(r,o):(A(e,"bpmn:SequenceFlow")||gb(r,o))&&(n=r===o?{preferredLayouts:Y1(r,e)}:A(r,"bpmn:BoundaryEvent")?{preferredLayouts:J1(r,o,l)}:ka(r)||ka(o)?function(u){return{preferredLayouts:["straight","h:h"],preserveDocking:X1(u)}}(r):A(r,"bpmn:Gateway")?{preferredLayouts:["v:h"]}:A(o,"bpmn:Gateway")?{preferredLayouts:["h:v"]}:{preferredLayouts:["h:h"]}),n&&(i=vb(H1(r,o,c,l,a,n=z(n,t)))),i||[c,l])},Oi.$inject=["elementRegistry","graphicsFactory"],Oi.prototype.getCroppedWaypoints=function(e,t,n){t=t||e.source,n=n||e.target;var i=this.getDockingPoint(e,t,!0),r=this.getDockingPoint(e,n),o=e.waypoints.slice(i.idx+1,r.idx);return o.unshift(xb(i)),o.push(xb(r)),o},Oi.prototype.getDockingPoint=function(e,t,n){var i,r,o=e.waypoints;return{point:r=o[i=n?0:o.length-1],actual:this._getIntersection(t,e,n)||r,idx:i}},Oi.prototype._getIntersection=function(e,t,n){return mu(this._getShapePath(e),this._getConnectionPath(t),n)},Oi.prototype._getConnectionPath=function(e){return this._graphicsFactory.getConnectionPath(e)},Oi.prototype._getShapePath=function(e){return this._graphicsFactory.getShapePath(e)},Oi.prototype._getGfx=function(e){return this._elementRegistry.getGraphics(e)};const Z1={__init__:["modeling","bpmnUpdater"],__depends__:[_1,A1,k1,P1,ay,M1,N1,I1,D1,On,Cy,Gg],bpmnFactory:["type",on],bpmnUpdater:["type",$t],elementFactory:["type",Ni],modeling:["type",St],layouter:["type",bd],connectionDocking:["type",Oi]};var zc=Math.round;function Eb(e,t,n,i,r){function o(c,l,u,p){return r.allowed("elements.move",{shapes:c,delta:l,position:u,target:p})}function a(c,l,u,p){if(Tt(u)&&(p=u,u=!1),!l.waypoints&&l.parent){var h=function(v){return{x:v.x+zc(v.width/2),y:v.y+zc(v.height/2)}}(l);return t.init(c,h,"shape.move",{cursor:"grabbing",autoActivate:u,data:{shape:l,context:p||{}}}),!0}}e.on("shape.move.start",1500,function(c){var l=c.context,u=c.shape,p=i.get().slice();p.indexOf(u)===-1&&(p=[u]),p=function(h){var v=jr(h,"id");return Ee(h,function(f){for(;f=f.parent;)if(v[f.id])return!1;return!0})}(p),z(l,{shapes:p,validatedShapes:p,shape:u})}),e.on("shape.move.start",1250,function(c){var l=c.context,u=l.validatedShapes;if(!(l.canExecute=o(u)))return!1}),e.on("shape.move.move",500,function(c){var l,u=c.context,p=u.validatedShapes,h=c.hover,v={x:c.dx,y:c.dy};l=o(p,v,{x:c.x,y:c.y},h),u.delta=v,u.canExecute=l,u.target=l!==null?h:null}),e.on("shape.move.end",function(c){var l=c.context,u=l.delta,p=l.canExecute,h=p==="attach",v=l.shapes;if(p===!1)return!1;u.x=zc(u.x),u.y=zc(u.y),u.x===0&&u.y===0||n.moveElements(v,u,l.target,{primaryShape:l.shape,attach:h})}),e.on("element.mousedown",function(c){if(Ai(c)){var l=eo(c);if(!l)throw new Error("must supply DOM mousedown event");return a(l,c.element)}}),this.start=a}Eb.$inject=["eventBus","dragging","modeling","selection","rules"];var wd="djs-dragging",wb="drop-ok",_b="drop-not-ok",Sb="new-parent",Cb="attach-ok";function Tb(e,t,n,i){function r(c){var l=function(u){var p=Ee(u,function(h){return!function(v){return v.waypoints}(h)||je(u,fn({id:h.source.id}))&&je(u,fn({id:h.target.id}))});return p}(o(c));return l}function o(c){var l=ss(c,!0),u=ht(l,function(p){return(p.incoming||[]).concat(p.outgoing||[])});return ns(l.concat(u))}function a(c,l){[Cb,wb,_b,Sb].forEach(function(u){u===l?t.addMarker(c,u):t.removeMarker(c,u)})}e.on("shape.move.start",499,function(c){var l=c.context,u=l.shapes,p=l.allDraggedElements,h=r(u);if(!l.dragGroup){var v=se("g");W(v,n.cls("djs-drag-group",["no-events"])),pe(t.getActiveLayer(),v),l.dragGroup=v}h.forEach(function(f){i.addDragger(f,l.dragGroup)}),F(p=p?ns([p,o(u)]):o(u),function(f){t.addMarker(f,wd)}),l.allDraggedElements=p,l.differentParents=Io(jr(u,function(f){return f.parent&&f.parent.id}))!==1}),e.on("shape.move.move",499,function(c){var l=c.context,u=l.dragGroup,p=l.target,h=l.shape.parent,v=l.canExecute;p&&(v==="attach"?a(p,Cb):l.canExecute&&p&&p.id!==h.id?a(p,Sb):a(p,l.canExecute?wb:_b)),Lt(u,c.dx,c.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(c){var l=c.context.target;l&&a(l,null)}),e.on("shape.move.cleanup",function(c){var l=c.context,u=l.allDraggedElements,p=l.dragGroup;F(u,function(h){t.removeMarker(h,wd)}),p&&it(p)}),this.makeDraggable=function(c,l,u){i.addDragger(l,c.dragGroup),u&&t.addMarker(l,wd),c.allDraggedElements?c.allDraggedElements.push(l):c.allDraggedElements=[l]}}Tb.$inject=["eventBus","canvas","styles","previewSupport"];const Q1={__depends__:[Ko,On,Nf,Vn,ei,na],__init__:["move","movePreview"],move:["type",Eb],movePreview:["type",Tb]};var Ab=".djs-palette-toggle",kb=".entry",eS=Ab+", "+kb,_d="djs-palette-",Sd="open",Pb="two-column";function ot(e,t){this._eventBus=e,this._canvas=t;var n=this;e.on("tool-manager.update",function(i){var r=i.tool;n.updateToolHighlight(r)}),e.on("i18n.changed",function(){n._update()}),e.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}function tS(e,t){var n=t.getPaletteEntries();return At(n)?n(e):(F(n,function(i,r){e[r]=i}),e)}ot.$inject=["eventBus","canvas"],ot.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("palette.getProviders",e,function(n){n.providers.push(t)}),this._rebuild()},ot.prototype.getEntries=function(){return this._getProviders().reduce(tS,{})},ot.prototype._rebuild=function(){this._diagramInitialized&&this._getProviders().length&&(this._container||this._init(),this._update())},ot.prototype._init=function(){var e=this,t=this._eventBus,n=this._getParentContainer(),i=this._container=ze(ot.HTML_MARKUP);n.appendChild(i),ct(n).add(_d+"shown"),Ht.bind(i,eS,"click",function(r){var o=r.delegateTarget;if(os(o,Ab))return e.toggle();e.trigger("click",r)}),le.bind(i,"mousedown",function(r){r.stopPropagation()}),Ht.bind(i,kb,"dragstart",function(r){e.trigger("dragstart",r)}),t.on("canvas.resized",this._layoutChanged,this),t.fire("palette.create",{container:i})},ot.prototype._getProviders=function(e){var t=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},ot.prototype._toggleState=function(e){e=e||{};var t,n=this._getParentContainer(),i=this._container,r=this._eventBus,o=ct(i),a=ct(n);t="twoColumn"in e?e.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),o.toggle(Pb,t),a.toggle(_d+Pb,t),"open"in e&&(o.toggle(Sd,e.open),a.toggle(_d+Sd,e.open)),r.fire("palette.changed",{twoColumn:t,open:this.isOpen()})},ot.prototype._update=function(){var e=Ye(".djs-palette-entries",this._container),t=this._entries=this.getEntries();rs(e),F(t,function(n,i){var r=n.group||"default",o=Ye("[data-group="+r+"]",e);o||(o=ze('<div class="group" data-group="'+r+'"></div>'),e.appendChild(o));var a=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),c=ze(a);o.appendChild(c),n.separator||(Ut(c,"data-action",i),n.title&&Ut(c,"title",n.title),n.className&&function(l,u){var p=ct(l);(Se(u)?u:u.split(/\s+/g)).forEach(function(h){p.add(h)})}(c,n.className),n.imageUrl&&c.appendChild(ze('<img src="'+n.imageUrl+'">')))}),this.open()},ot.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[Ut(c,"data-action")])&&(r=i.action,o=t.originalEvent||t,At(r)?e==="click"&&r(o,n):r[e]&&r[e](o,n),t.preventDefault())},ot.prototype._layoutChanged=function(){this._toggleState({})},ot.prototype._needsCollapse=function(e,t){return e<46*Object.keys(t).length+50},ot.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},ot.prototype.open=function(){this._toggleState({open:!0})},ot.prototype.toggle=function(e){this.isOpen()?this.close():this.open()},ot.prototype.isActiveTool=function(e){return e&&this._activeTool===e},ot.prototype.updateToolHighlight=function(e){var t;this._toolsContainer||(t=Ye(".djs-palette-entries",this._container),this._toolsContainer=Ye("[data-group=tools]",t)),F(this._toolsContainer.children,function(n){var i=n.getAttribute("data-action");if(i){var r=ct(n);i=i.replace("-tool",""),r.contains("entry")&&i===e?r.add("highlighted-entry"):r.remove("highlighted-entry")}})},ot.prototype.isOpen=function(){return ct(this._container).has(Sd)},ot.prototype._getParentContainer=function(){return this._canvas.getContainer()},ot.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';const nS={__init__:["palette"],palette:["type",ot]};var Mb="crosshair";function mr(e,t,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var c=this,l=function(h){var v,f=t.getActiveLayer();W(v=h.frame=se("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),pe(f,v)},u=function(h){var v=h.frame,f=h.bbox;W(v,{x:f.x,y:f.y,width:f.width,height:f.height})},p=function(h){h.frame&&it(h.frame)};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(h){var v=h.originalEvent.target;(h.hover||v instanceof SVGElement)&&e.once("lasso.selection.ended",function(){c.activateLasso(h.originalEvent,!0)})}),e.on("lasso.end",function(h){var v=Cd(h),f=i.filter(function(y){return y});c.select(f,v)}),e.on("lasso.start",function(h){var v=h.context;v.bbox=Cd(h),l(v)}),e.on("lasso.move",function(h){var v=h.context;v.bbox=Cd(h),u(v)}),e.on("lasso.cleanup",function(h){var v=h.context;p(v)}),e.on("element.mousedown",1500,function(h){if(Mf(h))return c.activateLasso(h.originalEvent),!0})}function Cd(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.y||t.x<n.x&&t.y<=n.y?{x:t.x,y:t.y,width:n.x-t.x,height:n.y-t.y}:t.x>=n.x&&t.y<n.y||t.x>n.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.x&&t.y>=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}}mr.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],mr.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:Mb,data:{context:{}}})},mr.prototype.activateSelection=function(e,t){this._dragging.init(e,"lasso.selection",{trapClick:!1,autoActivate:t,cursor:Mb,data:{context:{}}})},mr.prototype.select=function(e,t){var n=function(i,r){var o={};return F(i,function(a){var c=a;c.waypoints&&(c=gt(c)),!fe(r.y)&&c.x>r.x&&(o[a.id]=a),!fe(r.x)&&c.y>r.y&&(o[a.id]=a),c.x>r.x&&c.y>r.y&&(fe(r.width)&&fe(r.height)&&c.width+c.x<r.width+r.x&&c.height+c.y<r.height+r.y?o[a.id]=a:fe(r.width)&&fe(r.height)||(o[a.id]=a))}),o}(e,t);this._selection.select(Hl(n))},mr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateSelection(e,!!e)},mr.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};const iS={__depends__:[_c,oa],__init__:["lassoTool"],lassoTool:["type",mr]};var Td=1500,Rb="grab";function mo(e,t,n,i,r,o){this._dragging=n,this._mouse=o;var a=this,c=i.get("keyboard",!1);r.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",Td,function(l){if(to(l))return a.activateMove(l.originalEvent,!0),!1}),c&&c.addListener(Td,function(l){if(Nb(l.keyEvent)&&!a.isActive()){var u=a._mouse.getLastMoveEvent();a.activateMove(u,!!u)}},"keyboard.keydown"),c&&c.addListener(Td,function(l){Nb(l.keyEvent)&&a.isActive()&&a.toggle()},"keyboard.keyup"),e.on("hand.end",function(l){var u=l.originalEvent.target;if(!(l.hover||u instanceof SVGElement))return!1;e.once("hand.ended",function(){a.activateMove(l.originalEvent,{reactivate:!0})})}),e.on("hand.move.move",function(l){var u=t.viewbox().scale;t.scroll({dx:l.dx*u,dy:l.dy*u})}),e.on("hand.move.end",function(l){var u=l.context.reactivate;return!to(l)&&u&&e.once("hand.move.ended",function(p){a.activateHand(p.originalEvent,!0,!0)}),!1})}function Nb(e){return bn(" ",e)}mo.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],mo.prototype.activateMove=function(e,t,n){typeof t=="object"&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:Rb,data:{context:n||{}}})},mo.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:Rb,data:{context:{reactivate:n}}})},mo.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();this.activateHand(e,!!e)},mo.prototype.isActive=function(){var e=this._dragging.context();return!!e&&/^(hand|hand\.move)$/.test(e.prefix)};const rS={__depends__:[_c,oa],__init__:["handTool"],handTool:["type",mo]};var Ib="connect-ok",Db="connect-not-ok";function fo(e,t,n,i,r,o,a){var c=this;this._dragging=t,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),e.on("global-connect.hover",function(l){var u=l.context,p=l.hover,h=u.canStartConnect=c.canStartConnect(p);h!==null&&(u.startTarget=p,i.addMarker(p,h?Ib:Db))}),e.on(["global-connect.out","global-connect.cleanup"],function(l){var u=l.context.startTarget,p=l.context.canStartConnect;u&&i.removeMarker(u,p?Ib:Db)}),e.on(["global-connect.ended"],function(l){var u=l.context.startTarget,p={x:l.x,y:l.y};if(c.canStartConnect(u))return e.once("element.out",function(){e.once(["connect.ended","connect.canceled"],function(){e.fire("global-connect.drag.ended")}),n.start(null,u,p)}),!1})}fo.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],fo.prototype.start=function(e,t){this._dragging.init(e,"global-connect",{autoActivate:t,trapClick:!1,data:{context:{}}})},fo.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var e=this._mouse.getLastMoveEvent();return this.start(e,!!e)},fo.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},fo.prototype.canStartConnect=function(e){return this._rules.allowed("connection.start",{source:e})};const oS={__depends__:[np,Vn,ei,_c,oa],globalConnect:["type",fo]};function Gc(e,t,n,i,r,o,a,c){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=c,e.registerProvider(this)}Gc.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],Gc.prototype.getPaletteEntries=function(e){var t={},n=this._create,i=this._elementFactory,r=this._spaceTool,o=this._lassoTool,a=this._handTool,c=this._globalConnect,l=this._translate;function u(v,f,y,g,x){function E(w){var S=i.createShape(z({type:v},x));n.start(w,S)}var _=v.replace(/^bpmn:/,"");return{group:f,className:y,title:g||l("Create {type}",{type:_}),action:{dragstart:E,click:E}}}function p(v){var f=i.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),y=i.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:f});n.start(v,[f,y],{hints:{autoSelect:[f]}})}function h(v){n.start(v,i.createParticipantShape())}return z(t,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:l("Activate the hand tool"),action:{click:function(v){a.activateHand(v)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:l("Activate the lasso tool"),action:{click:function(v){o.activateSelection(v)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:l("Activate the create/remove space tool"),action:{click:function(v){r.activateSelection(v)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:l("Activate the global connect tool"),action:{click:function(v){c.start(v)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":u("bpmn:StartEvent","event","bpmn-icon-start-event-none",l("Create StartEvent")),"create.intermediate-event":u("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",l("Create Intermediate/Boundary Event")),"create.end-event":u("bpmn:EndEvent","event","bpmn-icon-end-event-none",l("Create EndEvent")),"create.exclusive-gateway":u("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-none",l("Create Gateway")),"create.task":u("bpmn:Task","activity","bpmn-icon-task",l("Create Task")),"create.data-object":u("bpmn:DataObjectReference","data-object","bpmn-icon-data-object",l("Create DataObjectReference")),"create.data-store":u("bpmn:DataStoreReference","data-store","bpmn-icon-data-store",l("Create DataStoreReference")),"create.subprocess-expanded":{group:"activity",className:"bpmn-icon-subprocess-expanded",title:l("Create expanded SubProcess"),action:{dragstart:p,click:p}},"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:l("Create Pool/Participant"),action:{dragstart:h,click:h}},"create.group":u("bpmn:Group","artifact","bpmn-icon-group",l("Create Group"))}),t};const aS={__depends__:[nS,Gs,Gg,iS,rS,oS,ks],__init__:["paletteProvider"],paletteProvider:["type",Gc]};function Ad(e,t,n,i,r){ne.call(this,e),e.on("shape.move.move",250,function(o){var a=o.context,c=a.canExecute;a.visualReplacements||(a.visualReplacements={}),c&&c.replacements?function(l){F(l.canExecute.replacements,function(u){var p=u.oldElementId,h={type:u.newElementType};if(!l.visualReplacements[p]){var v=t.get(p);z(h,{x:v.x,y:v.y});var f=n.createShape(h);i.addShape(f,v.parent);var y=Ye('[data-element-id="'+Zu(v.id)+'"]',l.dragGroup);y&&W(y,{display:"none"});var g=r.addDragger(f,l.dragGroup);l.visualReplacements[p]=g,i.removeShape(f)}})}(a):function(l){var u=l.visualReplacements;F(u,function(p,h){var v=Ye('[data-element-id="'+Zu(h)+'"]',l.dragGroup);v&&W(v,{display:"inline"}),p.remove(),u[h]&&delete u[h]})}(a)})}Ad.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],ae(Ad,ne);const sS={__depends__:[na],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",Ad]};var kd=40,cS=20,lS=10,Bb=20,Ob=["x","y"],uS=Math.abs;function jb(e){e.on(["connect.hover","connect.move","connect.end"],1250,function(t){var n=t.context,i=n.canExecute,r=n.start,o=n.hover,a=n.source,c=n.target;t.originalEvent&&Kt(t.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),i&&o&&function(l,u,p){Ob.forEach(function(h){var v=Fb(h,u);l[h]<u[h]+p?ut(l,h,u[h]+p):l[h]>u[h]+v-p&&ut(l,h,u[h]+v-p)})}(t,o,function(l){return A(l,"bpmn:Task")?lS:cS}(o)),o&&function(l,u){return Yi(u,function(p){return Vb(l,p)})}(i,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=Qt(r),Pe(o,["bpmn:Event","bpmn:Gateway"])&&Lb(t,Qt(o)),Pe(o,["bpmn:Task","bpmn:SubProcess"])&&function(l,u){var p=Qt(u);Ob.forEach(function(h){(function(v,f,y){return v[y]>f[y]+Bb&&v[y]<f[y]+Fb(y,f)-Bb})(l,u,h)&&ut(l,h,p[h])})}(t,o),A(a,"bpmn:BoundaryEvent")&&c===a.host&&function(l){var u=l.context,p=u.source,h=u.target;if(!function(g){var x=g.hover,E=g.source;return x&&E&&x===E}(u)){var v=Qt(p),f=bt(v,h,-10),y=[];/top|bottom/.test(f)&&y.push("x"),/left|right/.test(f)&&y.push("y"),y.forEach(function(g){var x,E=l[g];uS(E-v[g])<kd&&(x=E>v[g]?v[g]+kd:v[g]-kd,ut(l,g,x))})}}(t)):Vb(i,"bpmn:MessageFlow")?(A(r,"bpmn:Event")&&(n.connectionStart=Qt(r)),A(o,"bpmn:Event")&&Lb(t,Qt(o))):n.connectionStart=n.initialConnectionStart)})}function Lb(e,t){ut(e,"x",t.x),ut(e,"y",t.y)}function Vb(e,t){return e&&e.type===t}function Fb(e,t){return e==="x"?t.width:t.height}function ji(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function Uc(e){this._snapValues={}}jb.$inject=["eventBus"],ji.prototype.getSnapOrigin=function(e){return this._snapOrigins[e]},ji.prototype.setSnapOrigin=function(e,t){this._snapOrigins[e]=t,this._snapLocations.indexOf(e)===-1&&this._snapLocations.push(e)},ji.prototype.addDefaultSnap=function(e,t){var n=this._defaultSnaps[e];n||(n=this._defaultSnaps[e]=[]),n.push(t)},ji.prototype.getSnapLocations=function(){return this._snapLocations},ji.prototype.setSnapLocations=function(e){this._snapLocations=e},ji.prototype.pointsForTarget=function(e){var t=e.id||e,n=this._targets[t];return n||(n=this._targets[t]=new Uc).initDefaults(this._defaultSnaps),n},Uc.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)},Uc.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<a.length;l++)if(u=a[l],l_(u-o)<=c)return u}(e[n],r[n],i)},Uc.prototype.initDefaults=function(e){var t=this;F(e||{},function(n,i){F(n,function(r){t.add(i,r)})})};var pS=1250;function $n(e,t,n){var i=this;this._elementRegistry=e,t.on(["create.start","shape.move.start"],function(r){i.initSnap(r)}),t.on(["create.move","create.end","shape.move.move","shape.move.end"],pS,function(r){var o=r.context,a=o.shape,c=o.snapContext,l=o.target;if((!r.originalEvent||!Kt(r.originalEvent))&&!so(r)&&l){var u=c.pointsForTarget(l);u.initialized||((u=i.addSnapTargetPoints(u,a,l)).initialized=!0),n.snap(r,u)}}),t.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}function Pd(e){return!!e.labelTarget}$n.$inject=["elementRegistry","eventBus","snapping"],$n.prototype.initSnap=function(e){var t,n=this._elementRegistry,i=e.context,r=i.shape,o=i.snapContext;o||(o=i.snapContext=new ji);var a=(t=n.get(r.id)?Qt(r,e):{x:e.x+Qt(r).x,y:e.y+Qt(r).y}).x-r.width/2,c=t.y-r.height/2,l=t.x+r.width/2,u=t.y+r.height/2;return o.setSnapOrigin("mid",{x:t.x-e.x,y:t.y-e.y}),Pd(r)||(o.setSnapOrigin("top-left",{x:a-e.x,y:c-e.y}),o.setSnapOrigin("bottom-right",{x:l-e.x,y:u-e.y})),o},$n.prototype.addSnapTargetPoints=function(e,t,n){return F(this.getSnapTargets(t,n),function(i){if(Pd(i))Pd(t)&&e.add("mid",Qt(i));else if(i.waypoints){if(i.waypoints.length<3)return;F(i.waypoints.slice(1,-1),function(r){e.add("mid",r)})}else e.add("mid",Qt(i))}),fe(t.x)&&fe(t.y)&&this._elementRegistry.get(t.id)&&e.add("mid",Qt(t)),e},$n.prototype.getSnapTargets=function(e,t){return Rv(t).filter(function(n){return!n.hidden})};function vo(e,t){t.invoke($n,this),e.on(["create.move","create.end"],1500,dS),e.on(["create.move","create.end","shape.move.move","shape.move.end"],1500,function(n){var i=n.context,r=i.canExecute,o=i.target;r&&(r==="attach"||r.attach)&&!so(n)&&function(a,c){var l,u=ce(c),p=vg(a,c),h=a.context,v=h.shape;l=v.parent?{x:0,y:0}:ge(v),/top/.test(p)?ut(a,"y",u.top-l.y):/bottom/.test(p)&&ut(a,"y",u.bottom-l.y),/left/.test(p)?ut(a,"x",u.left-l.x):/right/.test(p)&&ut(a,"x",u.right-l.x)}(n,o)})}function dS(e){var t=e.context.createConstraints;if(t){var n=t.top,i=t.right,r=t.bottom,o=t.left;(o&&o>=e.x||i&&i<=e.x)&&ut(e,"x",e.x),(n&&n>=e.y||r&&r<=e.y)&&ut(e,"y",e.y)}}function $b(e,t){return e.indexOf(t)!==-1}function zb(e,t,n){return t?{x:e.x-n.x,y:e.y-n.y}:{x:e.x,y:e.y}}ae(vo,$n),vo.$inject=["eventBus","injector"],vo.prototype.initSnap=function(e){var t=$n.prototype.initSnap.call(this,e),n=e.shape,i=!!this._elementRegistry.get(n.id);return F(n.outgoing,function(r){var o=r.waypoints[0];o=o.original||o,t.setSnapOrigin(r.id+"-docking",zb(o,i,e))}),F(n.incoming,function(r){var o=r.waypoints[r.waypoints.length-1];o=o.original||o,t.setSnapOrigin(r.id+"-docking",zb(o,i,e))}),A(n,"bpmn:Participant")&&t.setSnapLocations(["top-left","bottom-right","mid"]),t},vo.prototype.addSnapTargetPoints=function(e,t,n){$n.prototype.addSnapTargetPoints.call(this,e,t,n);var i=this.getSnapTargets(t,n);F(i,function(o){var a;(function(c){return A(c,"bpmn:SubProcess")&&Oe(c)?!0:A(c,"bpmn:Participant")}(o)||(a="bpmn:TextAnnotation",[t,o].every(function(c){return A(c,a)})))&&(e.add("top-left",Pv(o)),e.add("bottom-right",Mv(o)))});var r=this._elementRegistry;return F(t.incoming,function(o){if(r.get(t.id)){$b(i,o.source)||e.add("mid",ge(o.source));var a=o.waypoints[0];e.add(o.id+"-docking",a.original||a)}}),F(t.outgoing,function(o){if(r.get(t.id)){$b(i,o.target)||e.add("mid",ge(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},vo.prototype.getSnapTargets=function(e,t){return $n.prototype.getSnapTargets.call(this,e,t).filter(function(n){return!A(n,"bpmn:Lane")})};function Ra(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&&Kt(i.originalEvent)||so(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)&&ut(i,"x",i.x),function(p){return p==="e"||p==="w"}(c)&&ut(i,"y",i.y),t.snap(i,u)}}),e.on(["resize.cleanup"],function(){t.hide()})}function Gb(e,t){var n=ge(e),i=ce(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}Ra.prototype.initSnap=function(e){var t=e.context,n=t.shape,i=t.direction,r=t.snapContext;r||(r=t.snapContext=new ji);var o=Gb(n,i);return r.setSnapOrigin("corner",{x:o.x-e.x,y:o.y-e.y}),r},Ra.prototype.addSnapTargetPoints=function(e,t,n,i){return F(this.getSnapTargets(t,n),function(r){e.add("corner",Mv(r)),e.add("corner",Pv(r))}),e.add("corner",Gb(t,i)),e},Ra.$inject=["eventBus","snapping"],Ra.prototype.getSnapTargets=function(e,t){return Rv(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 Li(e){this._canvas=e,this._asyncHide=Zh(qn(this.hide,this),1e3)}Li.$inject=["canvas"],Li.prototype.snap=function(e,t){var n=e.context.snapContext,i=n.getSnapLocations(),r={x:so(e,"x"),y:so(e,"y")};F(i,function(o){var a=n.getSnapOrigin(o),c={x:e.x+a.x,y:e.y+a.y};if(F(["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),F(["x","y"],function(o){var a=r[o];Tt(a)&&ut(e,o,a.originValue)})},Li.prototype._createLine=function(e){var t=this._canvas.getLayer("snap"),n=se("path");return W(n,{d:"M0,0 L0,0"}),Ce(n).add("djs-snap-line"),pe(t,n),{update:function(i){fe(i)?W(n,e==="horizontal"?{d:"M-100000,"+i+" L+100000,"+i,display:""}:{d:"M "+i+",-100000 L "+i+", +100000",display:""}):W(n,{display:"none"})}}},Li.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},Li.prototype.showSnapLine=function(e,t){var n=this.getSnapLine(e);n&&n.update(t),this._asyncHide()},Li.prototype.getSnapLine=function(e){return this._snapLines||this._createSnapLines(),this._snapLines[e]},Li.prototype.hide=function(){F(this._snapLines,function(e){e.update()})};const hS={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",$n],resizeSnapping:["type",Ra],snapping:["type",Li]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",jb],createMoveSnapping:["type",vo]};function de(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=ze(de.BOX_HTML),this._searchInput=Ye(de.INPUT_SELECTOR,this._container),this._resultsContainer=Ye(de.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),t.on(["canvas.destroy","diagram.destroy"],this.close,this)}function Ub(e,t,n){var i=function(o){var a="";return o.forEach(function(c){c.matched?a+='<strong class="'+de.RESULT_HIGHLIGHT_CLASS+'">'+mv(c.matched)+"</strong>":a+=mv(c.normal)}),a!==""?a:null}(t),r=ze(n);r.innerHTML=i,e.appendChild(r)}de.$inject=["canvas","eventBus","overlays","selection"],de.prototype._bindEvents=function(){var e=this;function t(n,i,r,o){e._eventMaps.push({el:n,type:r,listener:Ht.bind(n,i,r,o)})}t(document,"html","click",function(n){e.close()}),t(this._container,de.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),t(this._container,de.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),e._scrollToNode(n.delegateTarget),e._preselect(n.delegateTarget)}),t(this._container,de.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),e._select(n.delegateTarget)}),t(this._container,de.INPUT_SELECTOR,"keydown",function(n){n.keyCode===38&&n.preventDefault(),n.keyCode===40&&n.preventDefault()}),t(this._container,de.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))})},de.prototype._unbindEvents=function(){this._eventMaps.forEach(function(e){Ht.unbind(e.el,e.type,e.listener)})},de.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=Ye(de.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},de.prototype._scrollToDirection=function(e){var t=this._getCurrentResult();if(t){var n=e?t.previousElementSibling:t.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},de.prototype._scrollToNode=function(e){if(e&&e!==this._getCurrentResult()){var t=e.offsetTop,n=this._resultsContainer.scrollTop,i=t-this._resultsContainer.clientHeight+e.clientHeight;t<n?this._resultsContainer.scrollTop=t:n<i&&(this._resultsContainer.scrollTop=i)}},de.prototype._clearResults=function(){rs(this._resultsContainer),this._results=[],this._resetOverlay(),this._eventBus.fire("searchPad.cleared")},de.prototype._getCurrentResult=function(){return Ye(de.RESULT_SELECTED_SELECTOR,this._resultsContainer)},de.prototype._createResultNode=function(e,t){var n=ze(de.RESULT_HTML);return e.primaryTokens.length>0&&Ub(n,e.primaryTokens,de.RESULT_PRIMARY_HTML),Ub(n,e.secondaryTokens,de.RESULT_SECONDARY_HTML),Ut(n,de.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},de.prototype.registerProvider=function(e){this._searchProvider=e},de.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,ct(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},de.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,ct(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},de.prototype.toggle=function(){this.isOpen()?this.close():this.open()},de.prototype.isOpen=function(){return this._open},de.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&ct(t).remove(de.RESULT_SELECTED_CLASS);var n=Ut(e,de.RESULT_ID_ATTRIBUTE),i=this._results[n].element;ct(e).add(de.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},de.prototype._select=function(e){var t=Ut(e,de.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)},de.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:'<div style="'+a+'" class="'+de.OVERLAY_CLASS+'"></div>'}}(gt(e));this._overlayId=this._overlays.add(e,t)}},de.CONTAINER_SELECTOR=".djs-search-container",de.INPUT_SELECTOR=".djs-search-input input",de.RESULTS_CONTAINER_SELECTOR=".djs-search-results",de.RESULT_SELECTOR=".djs-search-result",de.RESULT_SELECTED_CLASS="djs-search-result-selected",de.RESULT_SELECTED_SELECTOR="."+de.RESULT_SELECTED_CLASS,de.RESULT_ID_ATTRIBUTE="data-result-id",de.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",de.OVERLAY_CLASS="djs-search-overlay",de.BOX_HTML='<div class="djs-search-container djs-draggable djs-scrollable"><div class="djs-search-input"><input type="text"/></div><div class="djs-search-results"></div></div>',de.RESULT_HTML='<div class="djs-search-result"></div>',de.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',de.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';const mS={__depends__:[Ou,On],searchPad:["type",de]};function Md(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}function Hb(e){return Ee(e,function(t){return!!t.matched}).length>0}function qb(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<e.length&&n.push({normal:i.substr(t.length+r,e.length)})):n.push({normal:i}),n}Md.$inject=["elementRegistry","searchPad","canvas"],Md.prototype.find=function(e){var t=this._canvas.getRootElement(),n=this._elementRegistry.filter(function(i){return!i.labelTarget});return n=Ee(n,function(i){return i!==t}),n=mn(n=Ee(n=ht(n,function(i){return{primaryTokens:qb(gn(i),e),secondaryTokens:qb(i.id,e),element:i}}),function(i){return Hb(i.primaryTokens)||Hb(i.secondaryTokens)}),function(i){return gn(i.element)+i.element.id})};const fS={__depends__:[mS],__init__:["bpmnSearch"],bpmnSearch:["type",Md]};function zn(e){Ho.call(this,e)}ae(zn,Ho),zn.Viewer=Zn,zn.NavigatedViewer=Jo,zn.prototype.createDiagram=Yr(function(){return this.importXML('<?xml version="1.0" encoding="UTF-8"?><bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://bpmn.io/schema/bpmn" id="Definitions_1"><bpmn:process id="Process_1" isExecutable="false"><bpmn:startEvent id="StartEvent_1"/></bpmn:process><bpmndi:BPMNDiagram id="BPMNDiagram_1"><bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1"><bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"><dc:Bounds height="36.0" width="36.0" x="173.0" y="102.0"/></bpmndi:BPMNShape></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn:definitions>')}),zn.prototype._interactionModules=[zf,qf,qw,Kf],zn.prototype._modelingModules=[Kw,t_,o_,n_,p_,np,d_,z_,ny,Gs,H_,W_,Y_,J_,Z_,n1,a1,Z1,Q1,aS,sS,Ry,hS,fS],zn.prototype._modules=[].concat(Zn.prototype._modules,zn.prototype._interactionModules,zn.prototype._modelingModules);const Wb=(e,t,n)=>(n||(n="camunda"),`<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
  xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
  xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
  id="diagram_${e}"
  targetNamespace="${{activiti:"http://activiti.org/bpmn",camunda:"http://bpmn.io/schema/bpmn",flowable:"http://flowable.org/bpmn"}[n]}">
  <bpmn2:process id="${e}" name="${t}" isExecutable="true">
  </bpmn2:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${e}">
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn2:definitions>`),vS={"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 Hc,Rd,yS={exports:{}};/*!
* svg.js - A lightweight library for manipulating and animating SVG.
* @version 2.7.1
* https://svgdotjs.github.io/
*
* @copyright Wout Fierens <wout@mick-wout.com>
* @license MIT
*
* BUILT: Fri Nov 30 2018 10:01:55 GMT+0100 (GMT+01:00)
*/Hc=typeof window<"u"?window:Lh,Rd=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"+h(s)+n.did++},n.create=function(s){var d=t.createElementNS(this.ns,s);return d.setAttribute("id",this.eid(s)),d},n.extend=function(){var s,d,m,C;for(d=(s=[].slice.call(arguments)).pop(),C=s.length-1;C>=0;C--)if(s[C])for(m in d)s[C].prototype[m]=d[m];n.Set&&n.Set.inherit&&n.Set.inherit()},n.invent=function(s){var d=typeof s.create=="function"?s.create:function(){this.constructor.call(this,n.create(s.create))};return s.inherit&&(d.prototype=new s.inherit),s.extend&&n.extend(d,s.extend),s.construct&&n.extend(s.parent||n.Container,s.construct),d},n.adopt=function(s){return s?s.instance?s.instance:((d=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[h(s.nodeName)]?new n[h(s.nodeName)]:new n.Element(s)).type=s.nodeName,d.node=s,s.instance=d,d instanceof n.Doc&&d.namespace().defs(),d.setData(JSON.parse(s.getAttribute("svgjs:data"))||{}),d):null;var d},n.prepare=function(){var s=t.getElementsByTagName("body")[0],d=(s?new n.Doc(s):n.adopt(t.documentElement).nested()).size(2,0);n.parser={body:s||t.documentElement,draw:d.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:d.polyline().node,path:d.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,d){var m,C=s.length,R=[];for(m=0;m<C;m++)R.push(d(s[m]));return R},filter:function(s,d){var m,C=s.length,R=[];for(m=0;m<C;m++)d(s[m])&&R.push(s[m]);return R},radians:function(s){return s%360*Math.PI/180},degrees:function(s){return 180*s/Math.PI%360},filterSVGElements:function(s){return this.filter(s,function(d){return d instanceof e.SVGElement})}},n.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},n.Color=function(s){var d,m;this.r=0,this.g=0,this.b=0,s&&(typeof s=="string"?n.regex.isRgb.test(s)?(d=n.regex.rgb.exec(s.replace(n.regex.whitespace,"")),this.r=parseInt(d[1]),this.g=parseInt(d[2]),this.b=parseInt(d[3])):n.regex.isHex.test(s)&&(d=n.regex.hex.exec((m=s).length==4?["#",m.substring(1,2),m.substring(1,2),m.substring(2,3),m.substring(2,3),m.substring(3,4),m.substring(3,4)].join(""):m),this.r=parseInt(d[1],16),this.g=parseInt(d[2],16),this.b=parseInt(d[3],16)):typeof s=="object"&&(this.r=s.r,this.g=s.g,this.b=s.b))},n.extend(n.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+v(this.r)+v(this.g)+v(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(s){return this.destination=new n.Color(s),this},at:function(s){return this.destination?(s=s<0?0:s>1?1:s,new n.Color({r:~~(this.r+(this.destination.r-this.r)*s),g:~~(this.g+(this.destination.g-this.g)*s),b:~~(this.b+(this.destination.b-this.b)*s)})):this}}),n.Color.test=function(s){return s+="",n.regex.isHex.test(s)||n.regex.isRgb.test(s)},n.Color.isRgb=function(s){return s&&typeof s.r=="number"&&typeof s.g=="number"&&typeof s.b=="number"},n.Color.isColor=function(s){return n.Color.isRgb(s)||n.Color.test(s)},n.Array=function(s,d){(s=(s||[]).valueOf()).length==0&&d&&(s=d.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 d=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<this.destination.length;)this.value.push(d)}return this},settle:function(){for(var s=0,d=this.value.length,m=[];s<d;s++)m.indexOf(this.value[s])==-1&&m.push(this.value[s]);return this.value=m},at:function(s){if(!this.destination)return this;for(var d=0,m=this.value.length,C=[];d<m;d++)C.push(this.value[d]+(this.destination[d]-this.value[d])*s);return new n.Array(C)},toString:function(){return this.value.join(" ")},valueOf:function(){return this.value},parse:function(s){return s=s.valueOf(),Array.isArray(s)?s:this.split(s)},split:function(s){return s.trim().split(n.regex.delimiter).map(parseFloat)},reverse:function(){return this.value.reverse(),this},clone:function(){var s=new this.constructor;return s.value=u(this.value),s}}),n.PointArray=function(s,d){n.Array.call(this,s,d||[[0,0]])},n.PointArray.prototype=new n.Array,n.PointArray.prototype.constructor=n.PointArray,n.extend(n.PointArray,{toString:function(){for(var s=0,d=this.value.length,m=[];s<d;s++)m.push(this.value[s].join(","));return m.join(" ")},toLine:function(){return{x1:this.value[0][0],y1:this.value[0][1],x2:this.value[1][0],y2:this.value[1][1]}},at:function(s){if(!this.destination)return this;for(var d=0,m=this.value.length,C=[];d<m;d++)C.push([this.value[d][0]+(this.destination[d][0]-this.value[d][0])*s,this.value[d][1]+(this.destination[d][1]-this.value[d][1])*s]);return new n.PointArray(C)},parse:function(s){var d=[];if(s=s.valueOf(),Array.isArray(s)){if(Array.isArray(s[0]))return s.map(function(R){return R.slice()});if(s[0].x!=null)return s.map(function(R){return[R.x,R.y]})}else s=s.trim().split(n.regex.delimiter).map(parseFloat);s.length%2!=0&&s.pop();for(var m=0,C=s.length;m<C;m+=2)d.push([s[m],s[m+1]]);return d},move:function(s,d){var m=this.bbox();if(s-=m.x,d-=m.y,!isNaN(s)&&!isNaN(d))for(var C=this.value.length-1;C>=0;C--)this.value[C]=[this.value[C][0]+s,this.value[C][1]+d];return this},size:function(s,d){var m,C=this.bbox();for(m=this.value.length-1;m>=0;m--)C.width&&(this.value[m][0]=(this.value[m][0]-C.x)*s/C.width+C.x),C.height&&(this.value[m][1]=(this.value[m][1]-C.y)*d/C.height+C.y);return this},bbox:function(){return n.parser.poly.setAttribute("points",this.toString()),n.parser.poly.getBBox()}});for(var i={M:function(s,d,m){return d.x=m.x=s[0],d.y=m.y=s[1],["M",d.x,d.y]},L:function(s,d){return d.x=s[0],d.y=s[1],["L",s[0],s[1]]},H:function(s,d){return d.x=s[0],["H",s[0]]},V:function(s,d){return d.y=s[0],["V",s[0]]},C:function(s,d){return d.x=s[4],d.y=s[5],["C",s[0],s[1],s[2],s[3],s[4],s[5]]},S:function(s,d){return d.x=s[2],d.y=s[3],["S",s[0],s[1],s[2],s[3]]},Q:function(s,d){return d.x=s[2],d.y=s[3],["Q",s[0],s[1],s[2],s[3]]},T:function(s,d){return d.x=s[0],d.y=s[1],["T",s[0],s[1]]},Z:function(s,d,m){return d.x=m.x,d.y=m.y,["Z"]},A:function(s,d){return d.x=s[5],d.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<a;++o)i[r[o]]=function(s){return function(d,m,C){if(s=="H")d[0]=d[0]+m.x;else if(s=="V")d[0]=d[0]+m.y;else if(s=="A")d[5]=d[5]+m.x,d[6]=d[6]+m.y;else for(var R=0,I=d.length;R<I;++R)d[R]=d[R]+(R%2?m.y:m.x);return i[s](d,m,C)}}(r[o].toUpperCase());n.PathArray=function(s,d){n.Array.call(this,s,d||[["M",0,0]])},n.PathArray.prototype=new n.Array,n.PathArray.prototype.constructor=n.PathArray,n.extend(n.PathArray,{toString:function(){return function(s){for(var d=0,m=s.length,C="";d<m;d++)C+=s[d][0],s[d][1]!=null&&(C+=s[d][1],s[d][2]!=null&&(C+=" ",C+=s[d][2],s[d][3]!=null&&(C+=" ",C+=s[d][3],C+=" ",C+=s[d][4],s[d][5]!=null&&(C+=" ",C+=s[d][5],C+=" ",C+=s[d][6],s[d][7]!=null&&(C+=" ",C+=s[d][7])))));return C+" "}(this.value)},move:function(s,d){var m=this.bbox();if(s-=m.x,d-=m.y,!isNaN(s)&&!isNaN(d))for(var C,R=this.value.length-1;R>=0;R--)(C=this.value[R][0])=="M"||C=="L"||C=="T"?(this.value[R][1]+=s,this.value[R][2]+=d):C=="H"?this.value[R][1]+=s:C=="V"?this.value[R][1]+=d:C=="C"||C=="S"||C=="Q"?(this.value[R][1]+=s,this.value[R][2]+=d,this.value[R][3]+=s,this.value[R][4]+=d,C=="C"&&(this.value[R][5]+=s,this.value[R][6]+=d)):C=="A"&&(this.value[R][6]+=s,this.value[R][7]+=d);return this},size:function(s,d){var m,C,R=this.bbox();for(m=this.value.length-1;m>=0;m--)(C=this.value[m][0])=="M"||C=="L"||C=="T"?(this.value[m][1]=(this.value[m][1]-R.x)*s/R.width+R.x,this.value[m][2]=(this.value[m][2]-R.y)*d/R.height+R.y):C=="H"?this.value[m][1]=(this.value[m][1]-R.x)*s/R.width+R.x:C=="V"?this.value[m][1]=(this.value[m][1]-R.y)*d/R.height+R.y:C=="C"||C=="S"||C=="Q"?(this.value[m][1]=(this.value[m][1]-R.x)*s/R.width+R.x,this.value[m][2]=(this.value[m][2]-R.y)*d/R.height+R.y,this.value[m][3]=(this.value[m][3]-R.x)*s/R.width+R.x,this.value[m][4]=(this.value[m][4]-R.y)*d/R.height+R.y,C=="C"&&(this.value[m][5]=(this.value[m][5]-R.x)*s/R.width+R.x,this.value[m][6]=(this.value[m][6]-R.y)*d/R.height+R.y)):C=="A"&&(this.value[m][1]=this.value[m][1]*s/R.width,this.value[m][2]=this.value[m][2]*d/R.height,this.value[m][6]=(this.value[m][6]-R.x)*s/R.width+R.x,this.value[m][7]=(this.value[m][7]-R.y)*d/R.height+R.y);return this},equalCommands:function(s){var d,m,C;for(s=new n.PathArray(s),C=this.value.length===s.value.length,d=0,m=this.value.length;C&&d<m;d++)C=this.value[d][0]===s.value[d][0];return C},morph:function(s){return s=new n.PathArray(s),this.equalCommands(s)?this.destination=s:this.destination=null,this},at:function(s){if(!this.destination)return this;var d,m,C,R,I=this.value,N=this.destination.value,L=[],T=new n.PathArray;for(d=0,m=I.length;d<m;d++){for(L[d]=[I[d][0]],C=1,R=I[d].length;C<R;C++)L[d][C]=I[d][C]+(N[d][C]-I[d][C])*s;L[d][0]==="A"&&(L[d][4]=+(L[d][4]!=0),L[d][5]=+(L[d][5]!=0))}return T.value=L,T},parse:function(s){if(s instanceof n.PathArray)return s.valueOf();var d,m={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};s=typeof s=="string"?s.replace(n.regex.numbersWithDots,l).replace(n.regex.pathLetters," $& ").replace(n.regex.hyphen,"$1 -").trim().split(n.regex.delimiter):s.reduce(function(T,b){return[].concat.call(T,b)},[]);var C=[],R=new n.Point,I=new n.Point,N=0,L=s.length;do n.regex.isPathLetter.test(s[N])?(d=s[N],++N):d=="M"?d="L":d=="m"&&(d="l"),C.push(i[d].call(null,s.slice(N,N+=m[d.toUpperCase()]).map(parseFloat),R,I));while(L>N);return C},bbox:function(){return n.parser.path.setAttribute("d",this.toString()),n.parser.path.getBBox()}}),n.Number=n.invent({create:function(s,d){this.value=0,this.unit=d||"",typeof s=="number"?this.value=isNaN(s)?0:isFinite(s)?s:s<0?-34e37:34e37:typeof s=="string"?(d=s.match(n.regex.numberAndUnit))&&(this.value=parseFloat(d[1]),d[5]=="%"?this.value/=100:d[5]=="s"&&(this.value*=1e3),this.unit=d[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 d=new n.Number(this);return typeof s=="string"&&(d.unit=s),d},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,d){return this.x(s).y(d)},center:function(s,d){return this.cx(s).cy(d)},width:function(s){return this.attr("width",s)},height:function(s){return this.attr("height",s)},size:function(s,d){var m=f(this,s,d);return this.width(new n.Number(m.width)).height(new n.Number(m.height))},clone:function(s){this.writeDataToDom();var d=E(this.node.cloneNode(!0));return s?s.add(d):this.after(d),d},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,d){var m=this.bbox();return s>m.x&&d>m.y&&s<m.x+m.width&&d<m.y+m.height},show:function(){return this.style("display","")},hide:function(){return this.style("display","none")},visible:function(){return this.style("display")!="none"},toString:function(){return this.attr("id")},classes:function(){var s=this.attr("class");return s==null?[]:s.trim().split(n.regex.delimiter)},hasClass:function(s){return this.classes().indexOf(s)!=-1},addClass:function(s){if(!this.hasClass(s)){var d=this.classes();d.push(s),this.attr("class",d.join(" "))}return this},removeClass:function(s){return this.hasClass(s)&&this.attr("class",this.classes().filter(function(d){return d!=s}).join(" ")),this},toggleClass:function(s){return this.hasClass(s)?this.removeClass(s):this.addClass(s)},reference:function(s){return n.get(this.attr(s))},parent:function(s){var d=this;if(!d.node.parentNode)return null;if(d=n.adopt(d.node.parentNode),!s)return d;for(;d&&d.node instanceof e.SVGElement;){if(typeof s=="string"?d.matches(s):d instanceof s)return d;if(!d.node.parentNode||d.node.parentNode.nodeName=="#document"||d.node.parentNode.nodeName=="#document-fragment")return null;d=n.adopt(d.node.parentNode)}},doc:function(){return this instanceof n.Doc?this:this.parent(n.Doc)},parents:function(s){var d=[],m=this;do{if(!(m=m.parent(s))||!m.node)break;d.push(m)}while(m.parent);return d},matches:function(s){return function(d,m){return(d.matches||d.matchesSelector||d.msMatchesSelector||d.mozMatchesSelector||d.webkitMatchesSelector||d.oMatchesSelector).call(d,m)}(this.node,s)},native:function(){return this.node},svg:function(s){var d=t.createElement("svg");if(!(s&&this instanceof n.Parent))return d.appendChild(s=t.createElement("svg")),this.writeDataToDom(),s.appendChild(this.node.cloneNode(!0)),d.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");d.innerHTML="<svg>"+s.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var m=0,C=d.firstChild.childNodes.length;m<C;m++)this.node.appendChild(d.firstChild.firstChild);return this},writeDataToDom:function(){return(this.each||this.lines)&&(this.each?this:this.lines()).each(function(){this.writeDataToDom()}),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(s){return this.dom=s,this},is:function(s){return function(d,m){return d instanceof m}(this,s)}}}),n.easing={"-":function(s){return s},"<>":function(s){return-Math.cos(s*Math.PI)/2+.5},">":function(s){return Math.sin(s*Math.PI/2)},"<":function(s){return 1-Math.cos(s*Math.PI/2)}},n.morph=function(s){return function(d,m){return new n.MorphObj(d,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,d,m){typeof s=="object"&&(d=s.ease,m=s.delay,s=s.duration);var C=new n.Situation({duration:s||1e3,delay:m||0,ease:n.easing[d||"-"]||d});return this.queue(C),this},delay:function(s){var d=new n.Situation({duration:s,delay:0,ease:n.easing["-"]});return this.queue(d)},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,d,m,C=this.situation;if(C.init)return this;for(s in C.animations)for(m=this.target()[s](),Array.isArray(m)||(m=[m]),Array.isArray(C.animations[s])||(C.animations[s]=[C.animations[s]]),d=m.length;d--;)C.animations[s][d]instanceof n.Number&&(m[d]=new n.Number(m[d])),C.animations[s][d]=m[d].morph(C.animations[s][d]);for(s in C.attrs)C.attrs[s]=new n.MorphObj(this.target().attr(s),C.attrs[s]);for(s in C.styles)C.styles[s]=new n.MorphObj(this.target().style(s),C.styles[s]);return C.initialTransformation=this.target().matrixify(),C.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(s,d){var m=this.active;return this.active=!1,d&&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,d){var m=this.situation.duration/this._speed;return this.absPos=s,d||(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,d){var m=this.last();return m.loops=s==null||s,m.loop=0,d&&(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 d=this.last();return d.reversed=s===void 0?!d.reversed:s,this},progress:function(s){return s?this.situation.ease(this.pos):this.pos},after:function(s){var d=this.last();return this.target().on("finished.fx",function m(C){C.detail.situation==d&&(s.call(this,d),this.off("finished.fx",m))}),this._callStart()},during:function(s){var d=this.last(),m=function(C){C.detail.situation==d&&s.call(this,C.detail.pos,n.morph(C.detail.pos),C.detail.eased,d)};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 d=function m(C){s.call(this),this.off("allfinished.fx",m)};return this.target().off("allfinished.fx",d).on("allfinished.fx",d),this._callStart()},duringAll:function(s){var d=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",d).on("during.fx",d),this.afterAll(function(){this.off("during.fx",d)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(s,d,m){return this.last()[m||"animations"][s]=d,this._callStart()},step:function(s){var d,m,C;s||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1?(d=Math.max(this.absPos,0),m=Math.floor(d),this.situation.loops===!0||m<this.situation.loops?(this.pos=d-m,C=this.situation.loop,this.situation.loop=m):(this.absPos=this.situation.loops,this.pos=1,C=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=!!((this.situation.loop-C)%2))):(this.absPos=Math.min(this.absPos,1),this.pos=this.absPos),this.pos<0&&(this.pos=0),this.situation.reversed&&(this.pos=1-this.pos);var R=this.situation.ease(this.pos);for(var I in this.situation.once)I>this.lastPos&&I<=R&&(this.situation.once[I].call(this.target(),this.pos,R),delete this.situation.once[I]);return this.active&&this.target().fire("during",{pos:this.pos,eased:R,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=R,this):this},eachAt:function(){var s,d,m,C=this,R=this.target(),I=this.situation;for(s in I.animations)m=[].concat(I.animations[s]).map(function(L){return typeof L!="string"&&L.at?L.at(I.ease(C.pos),C.pos):L}),R[s].apply(R,m);for(s in I.attrs)m=[s].concat(I.attrs[s]).map(function(L){return typeof L!="string"&&L.at?L.at(I.ease(C.pos),C.pos):L}),R.attr.apply(R,m);for(s in I.styles)m=[s].concat(I.styles[s]).map(function(L){return typeof L!="string"&&L.at?L.at(I.ease(C.pos),C.pos):L}),R.style.apply(R,m);if(I.transforms.length){for(m=I.initialTransformation,s=0,d=I.transforms.length;s<d;s++){var N=I.transforms[s];N instanceof n.Matrix?m=N.relative?m.multiply(new n.Matrix().morph(N).at(I.ease(this.pos))):m.morph(N).at(I.ease(this.pos)):(N.relative||N.undo(m.extract()),m=m.multiply(N.at(I.ease(this.pos))))}R.matrix(m)}return this},once:function(s,d,m){var C=this.last();return m||(s=C.ease(s)),C.once[s]=d,this},_callStart:function(){return setTimeout((function(){this.start()}).bind(this),0),this}},parent:n.Element,construct:{animate:function(s,d,m){return(this.fx||(this.fx=new n.FX(this))).animate(s,d,m)},delay:function(s){return(this.fx||(this.fx=new n.FX(this))).delay(s)},stop:function(s,d){return this.fx&&this.fx.stop(s,d),this},finish:function(){return this.fx&&this.fx.finish(),this},pause:function(){return this.fx&&this.fx.pause(),this},play:function(){return this.fx&&this.fx.play(),this},speed:function(s){if(this.fx){if(s==null)return this.fx.speed();this.fx.speed(s)}return this}}}),n.MorphObj=n.invent({create:function(s,d){return n.Color.isColor(d)?new n.Color(s).morph(d):n.regex.delimiter.test(s)?n.regex.pathLetters.test(s)?new n.PathArray(s).morph(d):new n.Array(s).morph(d):n.regex.numberAndUnit.test(d)?new n.Number(s).morph(d):(this.value=s,void(this.destination=d))},extend:{at:function(s,d){return d<1?this.value:this.destination},valueOf:function(){return this.value}}}),n.extend(n.FX,{attr:function(s,d,m){if(typeof s=="object")for(var C in s)this.attr(C,s[C]);else this.add(s,d,"attrs");return this},style:function(s,d){if(typeof s=="object")for(var m in s)this.style(m,s[m]);else this.add(s,d,"styles");return this},x:function(s,d){if(this.target()instanceof n.G)return this.transform({x:s},d),this;var m=new n.Number(s);return m.relative=d,this.add("x",m)},y:function(s,d){if(this.target()instanceof n.G)return this.transform({y:s},d),this;var m=new n.Number(s);return m.relative=d,this.add("y",m)},cx:function(s){return this.add("cx",new n.Number(s))},cy:function(s){return this.add("cy",new n.Number(s))},move:function(s,d){return this.x(s).y(d)},center:function(s,d){return this.cx(s).cy(d)},size:function(s,d){var m;return this.target()instanceof n.Text?this.attr("font-size",s):(s&&d||(m=this.target().bbox()),s||(s=m.width/m.height*d),d||(d=m.height/m.width*s),this.add("width",new n.Number(s)).add("height",new n.Number(d))),this},width:function(s){return this.add("width",new n.Number(s))},height:function(s){return this.add("height",new n.Number(s))},plot:function(s,d,m,C){return arguments.length==4?this.plot([s,d,m,C]):this.add("plot",new(this.target()).morphArray(s))},leading:function(s){return this.target().leading?this.add("leading",new n.Number(s)):this},viewbox:function(s,d,m,C){return this.target()instanceof n.Container&&this.add("viewbox",new n.ViewBox(s,d,m,C)),this},update:function(s){if(this.target()instanceof n.Stop){if(typeof s=="number"||s instanceof n.Number)return this.update({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",s.offset)}return this}}),n.Box=n.invent({create:function(s,d,m,C){if(!(typeof s!="object"||s instanceof n.Element))return n.Box.call(this,s.left!=null?s.left:s.x,s.top!=null?s.top:s.y,s.width,s.height);arguments.length==4&&(this.x=s,this.y=d,this.width=m,this.height=C),_(this)},extend:{merge:function(s){var d=new this.constructor;return d.x=Math.min(this.x,s.x),d.y=Math.min(this.y,s.y),d.width=Math.max(this.x+this.width,s.x+s.width)-d.x,d.height=Math.max(this.y+this.height,s.y+s.height)-d.y,_(d)},transform:function(s){var d,m=1/0,C=-1/0,R=1/0,I=-1/0;return[new n.Point(this.x,this.y),new n.Point(this.x2,this.y),new n.Point(this.x,this.y2),new n.Point(this.x2,this.y2)].forEach(function(N){N=N.transform(s),m=Math.min(m,N.x),C=Math.max(C,N.x),R=Math.min(R,N.y),I=Math.max(I,N.y)}),(d=new this.constructor).x=m,d.width=C-m,d.y=R,d.height=I-R,_(d),d}}}),n.BBox=n.invent({create:function(s){if(n.Box.apply(this,[].slice.call(arguments)),s instanceof n.Element){var d;try{if(t.documentElement.contains){if(!t.documentElement.contains(s.node))throw new Exception("Element not in the dom")}else{for(var m=s.node;m.parentNode;)m=m.parentNode;if(m!=t)throw new Exception("Element not in the dom")}d=s.node.getBBox()}catch{if(s instanceof n.Shape){var C=s.clone(n.parser.draw.instance).show();d=C.node.getBBox(),C.remove()}else d={x:s.node.clientLeft,y:s.node.clientTop,width:s.node.clientWidth,height:s.node.clientHeight}}n.Box.call(this,d)}},inherit:n.Box,parent:n.Element,construct:{bbox:function(){return new n.BBox(this)}}}),n.BBox.prototype.constructor=n.BBox,n.extend(n.Element,{tbox:function(){return console.warn("Use of TBox is deprecated and mapped to RBox. Use .rbox() instead."),this.rbox(this.doc())}}),n.RBox=n.invent({create:function(s){n.Box.apply(this,[].slice.call(arguments)),s instanceof n.Element&&n.Box.call(this,s.node.getBoundingClientRect())},inherit:n.Box,parent:n.Element,extend:{addOffset:function(){return this.x+=e.pageXOffset,this.y+=e.pageYOffset,this}},construct:{rbox:function(s){return s?new n.RBox(this).transform(s.screenCTM().inverse()):new n.RBox(this).addOffset()}}}),n.RBox.prototype.constructor=n.RBox,n.Matrix=n.invent({create:function(s){var d,m=g([1,0,0,1,0,0]);for(s=s instanceof n.Element?s.matrixify():typeof s=="string"?g(s.split(n.regex.delimiter).map(parseFloat)):arguments.length==6?g([].slice.call(arguments)):Array.isArray(s)?g(s):typeof s=="object"?s:m,d=S.length-1;d>=0;--d)this[S[d]]=s[S[d]]!=null?s[S[d]]:m[S[d]]},extend:{extract:function(){var s=y(this,0,1),d=y(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(d.y,d.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(d){return d instanceof n.Matrix||(d=new n.Matrix(d)),d}(s).native()))},inverse:function(){return new n.Matrix(this.native().inverse())},translate:function(s,d){return new n.Matrix(this.native().translate(s||0,d||0))},scale:function(s,d,m,C){return arguments.length==1?d=s:arguments.length==3&&(C=m,m=d,d=s),this.around(m,C,new n.Matrix(s,0,0,d,0,0))},rotate:function(s,d,m){return s=n.utils.radians(s),this.around(d,m,new n.Matrix(Math.cos(s),Math.sin(s),-Math.sin(s),Math.cos(s),0,0))},flip:function(s,d){return s=="x"?this.scale(-1,1,d,0):s=="y"?this.scale(1,-1,0,d):this.scale(-1,-1,s,d??s)},skew:function(s,d,m,C){return arguments.length==1?d=s:arguments.length==3&&(C=m,m=d,d=s),s=n.utils.radians(s),d=n.utils.radians(d),this.around(m,C,new n.Matrix(1,Math.tan(d),Math.tan(s),1,0,0))},skewX:function(s,d,m){return this.skew(s,0,d,m)},skewY:function(s,d,m){return this.skew(0,s,d,m)},around:function(s,d,m){return this.multiply(new n.Matrix(1,0,0,1,s||0,d||0)).multiply(m).multiply(new n.Matrix(1,0,0,1,-s||0,-d||0))},native:function(){for(var s=n.parser.native.createSVGMatrix(),d=S.length-1;d>=0;d--)s[S[d]]=this[S[d]];return s},toString:function(){return"matrix("+w(this.a)+","+w(this.b)+","+w(this.c)+","+w(this.d)+","+w(this.e)+","+w(this.f)+")"}},parent:n.Element,construct:{ctm:function(){return new n.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof n.Nested){var s=this.rect(1,1),d=s.node.getScreenCTM();return s.remove(),new n.Matrix(d)}return new n.Matrix(this.node.getScreenCTM())}}}),n.Point=n.invent({create:function(s,d){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:d??s}:{x:0,y:0},this.x=m.x,this.y=m.y},extend:{clone:function(){return new n.Point(this)},morph:function(s,d){return this.destination=new n.Point(s,d),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,d){return new n.Point(s,d).transform(this.screenCTM().inverse())}}),n.extend(n.Element,{attr:function(s,d,m){if(s==null){for(s={},m=(d=this.node.attributes).length-1;m>=0;m--)s[d[m].nodeName]=n.regex.isNumber.test(d[m].nodeValue)?parseFloat(d[m].nodeValue):d[m].nodeValue;return s}if(typeof s=="object")for(d in s)this.attr(d,s[d]);else if(d===null)this.node.removeAttribute(s);else{if(d==null)return(d=this.node.getAttribute(s))==null?n.defaults.attrs[s]:n.regex.isNumber.test(d)?parseFloat(d):d;s=="stroke-width"?this.attr("stroke",parseFloat(d)>0?this._stroke:null):s=="stroke"&&(this._stroke=d),s!="fill"&&s!="stroke"||(n.regex.isImage.test(d)&&(d=this.doc().defs().image(d,0,0)),d instanceof n.Image&&(d=this.doc().defs().pattern(0,0,function(){this.add(d)}))),typeof d=="number"?d=new n.Number(d):n.Color.isColor(d)?d=new n.Color(d):Array.isArray(d)&&(d=new n.Array(d)),s=="leading"?this.leading&&this.leading(d):typeof m=="string"?this.node.setAttributeNS(m,s,d.toString()):this.node.setAttribute(s,d.toString()),!this.rebuild||s!="font-size"&&s!="x"||this.rebuild(s,d)}return this}}),n.extend(n.Element,{transform:function(s,d){var m,C,R=this;if(typeof s!="object")return m=new n.Matrix(R).extract(),typeof s=="string"?m[s]:m;if(m=new n.Matrix(R),d=!!d||!!s.relative,s.a!=null)m=d?m.multiply(new n.Matrix(s)):new n.Matrix(s);else if(s.rotation!=null)x(s,R),m=d?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(x(s,R),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,!d){var I=m.extract();s.scaleX=1*s.scaleX/I.scaleX,s.scaleY=1*s.scaleY/I.scaleY}m=m.scale(s.scaleX,s.scaleY,s.cx,s.cy)}else s.skew!=null||s.skewX!=null||s.skewY!=null?(x(s,R),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,d||(I=m.extract(),m=m.multiply(new n.Matrix().skew(I.skewX,I.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?R.bbox()["c"+s.flip]:s.offset:s.offset==null?(C=R.bbox(),s.flip=C.cx,s.offset=C.cy):s.flip=s.offset,m=new n.Matrix().flip(s.flip,s.offset)):s.x==null&&s.y==null||(d?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,d){var m,C,R=this.target();return typeof s!="object"?(m=new n.Matrix(R).extract(),typeof s=="string"?m[s]:m):(d=!!d||!!s.relative,s.a!=null?m=new n.Matrix(s):s.rotation!=null?(x(s,R),m=new n.Rotate(s.rotation,s.cx,s.cy)):s.scale!=null||s.scaleX!=null||s.scaleY!=null?(x(s,R),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?(x(s,R),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?R.bbox()["c"+s.flip]:s.offset:s.offset==null?(C=R.bbox(),s.flip=C.cx,s.offset=C.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=d,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(d){var m=d.trim().split("(");return[m[0],m[1].split(n.regex.delimiter).map(function(C){return parseFloat(C)})]}).reduce(function(d,m){return m[0]=="matrix"?d.multiply(g(m[1])):d[m[0]].apply(d,m[1])},new n.Matrix);return s},toParent:function(s){if(this==s)return this;var d=this.screenCTM(),m=s.screenCTM().inverse();return this.addTo(s).untransform().transform(m.multiply(d)),this},toDoc:function(){return this.toParent(this.doc())}}),n.Transformation=n.invent({create:function(s,d){if(arguments.length>1&&typeof d!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(s))for(var m=0,C=this.arguments.length;m<C;++m)this[this.arguments[m]]=s[m];else if(typeof s=="object")for(m=0,C=this.arguments.length;m<C;++m)this[this.arguments[m]]=s[this.arguments[m]];this.inversed=!1,d===!0&&(this.inversed=!0)},extend:{arguments:[],method:"",at:function(s){for(var d=[],m=0,C=this.arguments.length;m<C;++m)d.push(this[this.arguments[m]]);var R=this._undo||new n.Matrix;return R=new n.Matrix().morph(n.Matrix.prototype[this.method].apply(R,d)).at(s),this.inversed?R.inverse():R},undo:function(s){for(var d=0,m=this.arguments.length;d<m;++d)s[this.arguments[d]]=this[this.arguments[d]]===void 0?0:s[this.arguments[d]];return s.cx=this.cx,s.cy=this.cy,this._undo=new n[h(this.method)](s,!0).at(1),this}}}),n.Translate=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(s,d){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["transformedX","transformedY"],method:"translate"}}),n.Rotate=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(s,d){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["rotation","cx","cy"],method:"rotate",at:function(s){var d=new n.Matrix().rotate(new n.Number().morph(this.rotation-(this._undo?this._undo.rotation:0)).at(s),this.cx,this.cy);return this.inversed?d.inverse():d},undo:function(s){return this._undo=s,this}}}),n.Scale=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(s,d){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["scaleX","scaleY","cx","cy"],method:"scale"}}),n.Skew=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(s,d){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["skewX","skewY","cx","cy"],method:"skew"}}),n.extend(n.Element,{style:function(s,d){if(arguments.length==0)return this.node.style.cssText||"";if(arguments.length<2)if(typeof s=="object")for(d in s)this.style(d,s[d]);else{if(!n.regex.isCss.test(s))return this.node.style[p(s)];for(s=s.split(/\s*;\s*/).filter(function(m){return!!m}).map(function(m){return m.split(/\s*:\s*/)});d=s.pop();)this.style(d[0],d[1])}else this.node.style[p(s)]=d===null||n.regex.isBlank.test(d)?"":d;return this}}),n.Parent=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Element,extend:{children:function(){return n.utils.map(n.utils.filterSVGElements(this.node.childNodes),function(s){return n.adopt(s)})},add:function(s,d){return d==null?this.node.appendChild(s.node):s.node!=this.node.childNodes[d]&&this.node.insertBefore(s.node,this.node.childNodes[d]),this},put:function(s,d){return this.add(s,d),s},has:function(s){return this.index(s)>=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,d){var m,C,R=this.children();for(m=0,C=R.length;m<C;m++)R[m]instanceof n.Element&&s.apply(R[m],[m,R]),d&&R[m]instanceof n.Container&&R[m].each(s,d);return this},removeElement:function(s){return this.node.removeChild(s.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),n.extend(n.Parent,{ungroup:function(s,d){return d===0||this instanceof n.Defs||this.node==n.parser.draw||(s=s||(this instanceof n.Doc?this:this.parent(n.Parent)),d=d||1/0,this.each(function(){return this instanceof n.Defs?this:this instanceof n.Parent?this.ungroup(s,d-1):this.toParent(s)}),this.node.firstChild||this.remove()),this},flatten:function(s,d){return this.ungroup(s,d)}}),n.Container=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Parent}),n.ViewBox=n.invent({create:function(s){var d,m,C,R,I,N,L,T=1,b=1,B=/[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/gi;if(s instanceof n.Element){for(N=s,L=s,I=(s.attr("viewBox")||"").match(B),s.bbox,C=new n.Number(s.width()),R=new n.Number(s.height());C.unit=="%";)T*=C.value,C=new n.Number(N instanceof n.Doc?N.parent().offsetWidth:N.parent().width()),N=N.parent();for(;R.unit=="%";)b*=R.value,R=new n.Number(L instanceof n.Doc?L.parent().offsetHeight:L.parent().height()),L=L.parent();this.x=0,this.y=0,this.width=C*T,this.height=R*b,this.zoom=1,I&&(d=parseFloat(I[0]),m=parseFloat(I[1]),C=parseFloat(I[2]),R=parseFloat(I[3]),this.zoom=this.width/this.height>C/R?this.height/R:this.width/C,this.x=d,this.y=m,this.width=C,this.height=R)}else s=typeof s=="string"?s.match(B).map(function(V){return parseFloat(V)}):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,d,m,C){return this.destination=new n.ViewBox(s,d,m,C),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,d,m,C){return arguments.length==0?new n.ViewBox(this):this.attr("viewBox",new n.ViewBox(s,d,m,C))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(s){n.Element.prototype[s]=function(d){return d==null?n.off(this,s):n.on(this,s,d),this}}),n.listenerId=0,n.on=function(s,d,m,C,R){var I=m.bind(C||s),N=s instanceof n.Element?s.node:s;N.instance=N.instance||{_events:{}};var L=N.instance._events;m._svgjsListenerId||(m._svgjsListenerId=++n.listenerId),d.split(n.regex.delimiter).forEach(function(T){var b=T.split(".")[0],B=T.split(".")[1]||"*";L[b]=L[b]||{},L[b][B]=L[b][B]||{},L[b][B][m._svgjsListenerId]=I,N.addEventListener(b,I,R||!1)})},n.off=function(s,d,m,C){var R=s instanceof n.Element?s.node:s;if(R.instance&&(typeof m!="function"||(m=m._svgjsListenerId))){var I=R.instance._events;(d||"").split(n.regex.delimiter).forEach(function(N){var L,T,b=N&&N.split(".")[0],B=N&&N.split(".")[1];if(m)I[b]&&I[b][B||"*"]&&(R.removeEventListener(b,I[b][B||"*"][m],C||!1),delete I[b][B||"*"][m]);else if(b&&B){if(I[b]&&I[b][B]){for(T in I[b][B])n.off(R,[b,B].join("."),T);delete I[b][B]}}else if(B)for(N in I)for(L in I[N])B===L&&n.off(R,[N,B].join("."));else if(b){if(I[b]){for(L in I[b])n.off(R,[b,L].join("."));delete I[b]}}else{for(N in I)n.off(R,N);R.instance._events={}}})}},n.extend(n.Element,{on:function(s,d,m,C){return n.on(this,s,d,m,C),this},off:function(s,d){return n.off(this.node,s,d),this},fire:function(s,d){return s instanceof e.Event?this.node.dispatchEvent(s):this.node.dispatchEvent(s=new n.CustomEvent(s,{detail:d,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(),d=this.transform();return s.x+=d.x,s.x2+=d.x,s.cx+=d.x,s.y+=d.y,s.y2+=d.y,s.cy+=d.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 d=this.node,m=E(d.cloneNode(!0));return s?(s.node||s).appendChild(m.node):d.parentNode.insertBefore(m.node,d.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,d=this.parent();return d.removeElement(this).add(this,s),d instanceof n.Doc&&d.node.appendChild(d.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 d=this.position();return this.parent().add(s,d),this},after:function(s){s.remove();var d=this.position();return this.parent().add(s,d+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,d,m){return this.put(new n.Stop).update(s,d,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,d,m){return s=="transform"&&(s="gradientTransform"),n.Container.prototype.attr.call(this,s,d,m)}},construct:{gradient:function(s,d){return this.defs().gradient(s,d)}}}),n.extend(n.Gradient,n.FX,{from:function(s,d){return(this._target||this).type=="radial"?this.attr({fx:new n.Number(s),fy:new n.Number(d)}):this.attr({x1:new n.Number(s),y1:new n.Number(d)})},to:function(s,d){return(this._target||this).type=="radial"?this.attr({cx:new n.Number(s),cy:new n.Number(d)}):this.attr({x2:new n.Number(s),y2:new n.Number(d)})}}),n.extend(n.Defs,{gradient:function(s,d){return this.put(new n.Gradient(s)).update(d)}}),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,d,m){return s=="transform"&&(s="patternTransform"),n.Container.prototype.attr.call(this,s,d,m)}},construct:{pattern:function(s,d,m){return this.defs().pattern(s,d,m)}}}),n.extend(n.Defs,{pattern:function(s,d,m){return this.put(new n.Pattern).update(m).attr({x:0,y:0,width:s,height:d,patternUnits:"userSpaceOnUse"})}}),n.Shape=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Element}),n.Bare=n.invent({create:function(s,d){if(this.constructor.call(this,n.create(s)),d)for(var m in d.prototype)typeof d.prototype[m]=="function"&&(this[m]=d.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,d){return this.put(new n.Bare(s,d))}}),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,d){return this.attr("href",(d||"")+"#"+s,n.xlink)}},construct:{use:function(s,d){return this.put(new n.Use).element(s,d)}}}),n.Rect=n.invent({create:"rect",inherit:n.Shape,construct:{rect:function(s,d){return this.put(new n.Rect).size(s,d)}}}),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,d){return this.put(new n.Ellipse).size(s,d).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,d){var m=f(this,s,d);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,d,m,C){return s==null?this.array():(s=d!==void 0?{x1:s,y1:d,x2:m,y2:C}:new n.PointArray(s).toLine(),this.attr(s))},move:function(s,d){return this.attr(this.array().move(s,d).toLine())},size:function(s,d){var m=f(this,s,d);return this.attr(this.array().size(m.width,m.height).toLine())}},construct:{line:function(s,d,m,C){return n.Line.prototype.plot.apply(this.put(new n.Line),s!=null?[s,d,m,C]:[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,d){return this.attr("points",this.array().move(s,d))},size:function(s,d){var m=f(this,s,d);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 d=this.bbox();return s==null?d.width:this.size(s,d.height)},height:function(s){var d=this.bbox();return s==null?d.height:this.size(d.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,d){return this.attr("d",this.array().move(s,d))},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,d){var m=f(this,s,d);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 d=this,m=new e.Image;return n.on(m,"load",function(){n.off(m);var C=d.parent(n.Pattern);C!==null&&(d.width()==0&&d.height()==0&&d.size(m.width,m.height),C&&C.width()==0&&C.height()==0&&C.size(d.width(),d.height()),typeof d._loaded=="function"&&d._loaded.call(d,{width:m.width,height:m.height,ratio:m.width/m.height,url:s}))}),n.on(m,"error",function(C){n.off(m),typeof d._error=="function"&&d._error.call(d,C)}),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,d,m){return this.put(new n.Image).load(s).size(d||0,m||d||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 d=this.attr("y"),m=typeof d=="number"?d-this.bbox().y:0;return s==null?typeof d=="number"?d-m:d: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 d=this.node.childNodes,m=0,C=d.length;m<C;++m)m!=0&&d[m].nodeType!=3&&n.adopt(d[m]).dom.newLined==1&&(s+=`
`),s+=d[m].textContent;return s}if(this.clear().build(!0),typeof s=="function")s.call(this,this);else{m=0;for(var R=(s=s.split(`
`)).length;m<R;m++)this.tspan(s[m]).newLine()}return this.build(!1).rebuild()},size:function(s){return this.attr("font-size",s).rebuild()},leading:function(s){return s==null?this.dom.leading:(this.dom.leading=new n.Number(s),this.rebuild())},lines:function(){var s=(this.textPath&&this.textPath()||this).node,d=n.utils.map(n.utils.filterSVGElements(s.childNodes),function(m){return n.adopt(m)});return new n.Set(d)},rebuild:function(s){if(typeof s=="boolean"&&(this._rebuild=s),this._rebuild){var d=this,m=0,C=this.dom.leading*new n.Number(this.attr("font-size"));this.lines().each(function(){this.dom.newLined&&(d.textPath()||this.attr("x",d.attr("x")),this.text()==`
`?m+=C:(this.attr("dy",C+m),m=0))}),this.fire("rebuild")}return this},build:function(s){return this._build=!!s,this},setData:function(s){return this.dom=s,this.dom.leading=new n.Number(s.leading||1.3),this}},construct:{text:function(s){return this.put(new n.Text).text(s)},plain:function(s){return this.put(new n.Text).plain(s)}}}),n.Tspan=n.invent({create:"tspan",inherit:n.Shape,extend:{text:function(s){return s==null?this.node.textContent+(this.dom.newLined?`
`:""):(typeof s=="function"?s.call(this,this):this.plain(s),this)},dx:function(s){return this.attr("dx",s)},dy:function(s){return this.attr("dy",s)},newLine:function(){var s=this.parent(n.Text);return this.dom.newLined=!0,this.dy(s.dom.leading*s.attr("font-size")).attr("x",s.x())}}}),n.extend(n.Text,n.Tspan,{plain:function(s){return this._build===!1&&this.clear(),this.node.appendChild(t.createTextNode(s)),this},tspan:function(s){var d=(this.textPath&&this.textPath()||this).node,m=new n.Tspan;return this._build===!1&&this.clear(),d.appendChild(m.node),m.text(s)},clear:function(){for(var s=(this.textPath&&this.textPath()||this).node;s.hasChildNodes();)s.removeChild(s.lastChild);return this},length:function(){return this.node.getComputedTextLength()}}),n.TextPath=n.invent({create:"textPath",inherit:n.Parent,parent:n.Text,construct:{morphArray:n.PathArray,path:function(s){for(var d=new n.TextPath,m=this.doc().defs().path(s);this.node.hasChildNodes();)d.node.appendChild(this.node.firstChild);return this.node.appendChild(d.node),d.attr("href","#"+m,n.xlink),this},array:function(){var s=this.track();return s?s.array():null},plot:function(s){var d=this.track(),m=null;return d&&(m=d.plot(s)),s==null?m:this},track:function(){var s=this.textPath();if(s)return s.reference("href")},textPath:function(){if(this.node.firstChild&&this.node.firstChild.nodeName=="textPath")return n.adopt(this.node.firstChild)}}}),n.Nested=n.invent({create:function(){this.constructor.call(this,n.create("svg")),this.style("overflow","visible")},inherit:n.Container,construct:{nested:function(){return this.put(new n.Nested)}}}),n.A=n.invent({create:"a",inherit:n.Container,extend:{to:function(s){return this.attr("href",s,n.xlink)},show:function(s){return this.attr("show",s,n.xlink)},target:function(s){return this.attr("target",s)}},construct:{link:function(s){return this.put(new n.A).to(s)}}}),n.extend(n.Element,{linkTo:function(s){var d=new n.A;return typeof s=="function"?s.call(d,d):d.to(s),this.parent().put(d).put(this)}}),n.Marker=n.invent({create:"marker",inherit:n.Container,extend:{width:function(s){return this.attr("markerWidth",s)},height:function(s){return this.attr("markerHeight",s)},ref:function(s,d){return this.attr("refX",s).attr("refY",d)},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},toString:function(){return"url(#"+this.id()+")"}},construct:{marker:function(s,d,m){return this.defs().marker(s,d,m)}}}),n.extend(n.Defs,{marker:function(s,d,m){return this.put(new n.Marker).size(s,d).ref(s/2,d/2).viewbox(0,0,s,d).attr("orient","auto").update(m)}}),n.extend(n.Line,n.Polyline,n.Polygon,n.Path,{marker:function(s,d,m,C){var R=["marker"];return s!="all"&&R.push(s),R=R.join("-"),s=arguments[1]instanceof n.Marker?arguments[1]:this.doc().marker(d,m,C),this.attr(R,s)}});var c={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(s,d){return d=="color"?s:s+"-"+d}};function l(s,d,m,C){return m+C.replace(n.regex.dots," .")}function u(s){for(var d=s.slice(0),m=d.length;m--;)Array.isArray(d[m])&&(d[m]=u(d[m]));return d}function p(s){return s.toLowerCase().replace(/-(.)/g,function(d,m){return m.toUpperCase()})}function h(s){return s.charAt(0).toUpperCase()+s.slice(1)}function v(s){var d=s.toString(16);return d.length==1?"0"+d:d}function f(s,d,m){if(d==null||m==null){var C=s.bbox();d==null?d=C.width/C.height*m:m==null&&(m=C.height/C.width*d)}return{width:d,height:m}}function y(s,d,m){return{x:d*s.a+m*s.c+0,y:d*s.b+m*s.d+0}}function g(s){return{a:s[0],b:s[1],c:s[2],d:s[3],e:s[4],f:s[5]}}function x(s,d){s.cx=s.cx==null?d.bbox().cx:s.cx,s.cy=s.cy==null?d.bbox().cy:s.cy}function E(s){for(var d=s.childNodes.length-1;d>=0;d--)s.childNodes[d]instanceof e.SVGElement&&E(s.childNodes[d]);return n.adopt(s).id(n.eid(s.nodeName))}function _(s){return s.x==null&&(s.x=0,s.y=0,s.width=0,s.height=0),s.w=s.width,s.h=s.height,s.x2=s.x+s.width,s.y2=s.y+s.height,s.cx=s.x+s.width/2,s.cy=s.y+s.height/2,s}function w(s){return Math.abs(s)>1e-37?s:0}["fill","stroke"].forEach(function(s){var d,m={};m[s]=function(C){if(C===void 0)return this;if(typeof C=="string"||n.Color.isRgb(C)||C&&typeof C.fill=="function")this.attr(s,C);else for(d=c[s].length-1;d>=0;d--)C[c[s][d]]!=null&&this.attr(c.prefix(s,c[s][d]),C[c[s][d]]);return this},n.extend(n.Element,n.FX,m)}),n.extend(n.Element,n.FX,{rotate:function(s,d,m){return this.transform({rotation:s,cx:d,cy:m})},skew:function(s,d,m,C){return arguments.length==1||arguments.length==3?this.transform({skew:s,cx:d,cy:m}):this.transform({skewX:s,skewY:d,cx:m,cy:C})},scale:function(s,d,m,C){return arguments.length==1||arguments.length==3?this.transform({scale:s,cx:d,cy:m}):this.transform({scaleX:s,scaleY:d,cx:m,cy:C})},translate:function(s,d){return this.transform({x:s,y:d})},flip:function(s,d){return d=typeof s=="number"?s:d,this.transform({flip:s||"both",offset:d})},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,d){return this.dx(s).dy(d)}}),n.extend(n.Rect,n.Ellipse,n.Circle,n.Gradient,n.FX,{radius:function(s,d){var m=(this._target||this).type;return m=="radial"||m=="circle"?this.attr("r",new n.Number(s)):this.rx(s).ry(d??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,d){if(typeof s=="object")for(d in s)this.font(d,s[d]);return s=="leading"?this.leading(d):s=="anchor"?this.attr("text-anchor",d):s=="size"||s=="family"||s=="weight"||s=="stretch"||s=="variant"||s=="style"?this.attr("font-"+s,d):this.attr(s,d)}}),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,d,m=[].slice.call(arguments);for(s=0,d=m.length;s<d;s++)this.members.push(m[s]);return this},remove:function(s){var d=this.index(s);return d>-1&&this.members.splice(d,1),this},each:function(s){for(var d=0,m=this.members.length;d<m;d++)s.apply(this.members[d],[d,this.members]);return this},clear:function(){return this.members=[],this},length:function(){return this.members.length},has:function(s){return this.index(s)>=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 d in n.Shape.prototype)typeof n.Shape.prototype[d]=="function"&&typeof n.Set.prototype[d]!="function"&&s.push(d);for(var d in s.forEach(function(C){n.Set.prototype[C]=function(){for(var R=0,I=this.members.length;R<I;R++)this.members[R]&&typeof this.members[R][C]=="function"&&this.members[R][C].apply(this.members[R],arguments);return C=="animate"?this.fx||(this.fx=new n.FX.Set(this)):this}}),s=[],n.FX.prototype)typeof n.FX.prototype[d]=="function"&&typeof n.FX.Set.prototype[d]!="function"&&s.push(d);s.forEach(function(m){n.FX.Set.prototype[m]=function(){for(var C=0,R=this.set.members.length;C<R;C++)this.set.members[C].fx[m].apply(this.set.members[C].fx,arguments);return this}})},n.extend(n.Element,{data:function(s,d,m){if(typeof s=="object")for(d in s)this.data(d,s[d]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+s))}catch{return this.attr("data-"+s)}else this.attr("data-"+s,d===null?null:m===!0||typeof d=="string"||typeof d=="number"?d:JSON.stringify(d));return this}}),n.extend(n.Element,{remember:function(s,d){if(typeof arguments[0]=="object")for(var d in s)this.remember(d,s[d]);else{if(arguments.length==1)return this.memory()[s];this.memory()[s]=d}return this},forget:function(){if(arguments.length==0)this._memory={};else for(var s=arguments.length-1;s>=0;s--)delete this.memory()[arguments[s]];return this},memory:function(){return this._memory||(this._memory={})}}),n.get=function(s){var d=t.getElementById(function(m){var C=(m||"").toString().match(n.regex.reference);if(C)return C[1]}(s)||s);return n.adopt(d)},n.select=function(s,d){return new n.Set(n.utils.map((d||t).querySelectorAll(s),function(m){return n.adopt(m)}))},n.extend(n.Parent,{select:function(s){return n.select(s,this.node)}});var S="abcdef".split("");if(typeof e.CustomEvent!="function"){var D=function(s,d){d=d||{bubbles:!1,cancelable:!1,detail:void 0};var m=t.createEvent("CustomEvent");return m.initCustomEvent(s,d.bubbles,d.cancelable,d.detail),m};D.prototype=e.Event.prototype,n.CustomEvent=D}else n.CustomEvent=e.CustomEvent;return function(s){for(var d=0,m=["moz","webkit"],C=0;C<m.length&&!e.requestAnimationFrame;++C)s.requestAnimationFrame=s[m[C]+"RequestAnimationFrame"],s.cancelAnimationFrame=s[m[C]+"CancelAnimationFrame"]||s[m[C]+"CancelRequestAnimationFrame"];s.requestAnimationFrame=s.requestAnimationFrame||function(R){var I=new Date().getTime(),N=Math.max(0,16-(I-d)),L=s.setTimeout(function(){R(I+N)},N);return d=I+N,L},s.cancelAnimationFrame=s.cancelAnimationFrame||s.clearTimeout}(e),n};var gS=yS.exports=Hc.document?Rd(Hc,Hc.document):function(e){return Rd(e,e.document)},Nd={exports:{}};(function(e,t){function n(i,r){return r.querySelector(i)}(t=Nd.exports=function(i,r){return n(i,r=r||document)}).all=function(i,r){return(r=r||document).querySelectorAll(i)},t.engine=function(i){if(!i.one)throw new Error(".one callback required");if(!i.all)throw new Error(".all callback required");return n=i.one,t.all=i.all,t}})(0,Nd.exports);var Na=Nd.exports,zt="tokenSimulation",Y={TOGGLE_MODE_EVENT:zt+".toggleMode",GENERATE_TOKEN_EVENT:zt+".generateToken",CONSUME_TOKEN_EVENT:zt+".consumeToken",PLAY_SIMULATION_EVENT:zt+".playSimulation",PAUSE_SIMULATION_EVENT:zt+".pauseSimulation",RESET_SIMULATION_EVENT:zt+".resetSimulation",TERMINATE_EVENT:zt+".terminateEvent",UPDATE_ELEMENTS_EVENT:zt+".updateElements",UPDATE_ELEMENT_EVENT:zt+".updateElement",PROCESS_INSTANCE_CREATED_EVENT:zt+".processInstanceCreated",PROCESS_INSTANCE_FINISHED_EVENT:zt+".processInstanceFinished",PROCESS_INSTANCE_SHOWN_EVENT:zt+".processInstanceShown",PROCESS_INSTANCE_HIDDEN_EVENT:zt+".processInstanceHidden",ANIMATION_CREATED_EVENT:zt+".animationCreated"},Ge={},Ia=Object.prototype.toString,bS=Object.prototype.hasOwnProperty;function yo(e){return e===void 0}function Kb(e){return e!==void 0}function Id(e){return e==null}function qc(e){return Ia.call(e)==="[object Array]"}function Wc(e){return Ia.call(e)==="[object Object]"}function Dd(e){var t=Ia.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function Xb(e){if(!qc(e))throw new Error("must supply array")}function Yb(e,t){return bS.call(e,t)}function Jb(e,t){var n;return t=Od(t),Dt(e,function(i,r){if(t(i,r))return n=i,!1}),n}function Dt(e,t){var n;if(!yo(e)){var i=qc(e)?wS:ES;for(var r in e)if(Yb(e,r)&&t(n=e[r],i(r))===!1)return n}}function Zb(e,t,n){return Dt(e,function(i,r){n=t(n,i,r)}),n}function Qb(e,t){return!!Zb(e,function(n,i,r){return n&&t(i,r)},!0)}function Kc(e,t){var n=[];return Dt(e,function(i,r){n.push(t(i,r))}),n}function e0(e){return e&&Object.keys(e)||[]}function t0(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=Bd(t),Dt(e,function(i){var r=t(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function n0(e){e=Bd(e);for(var t={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Dt(i,function(o){return t0(o,e,t)}),Kc(t,function(o,a){return o[0]})}var xS=n0;function Bd(e){return Dd(e)?e:function(t){return t[e]}}function Od(e){return Dd(e)?e:function(t){return t===e}}function ES(e){return e}function wS(e){return Number(e)}function jd(e){return jd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jd(e)}function Ld(){return Ld=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ld.apply(this,arguments)}const _S=Object.freeze(Object.defineProperty({__proto__:null,assign:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return Ld.apply(void 0,[e].concat(n))},bind:function(e,t){return e.bind(t)},debounce:function(e,t){var n,i,r,o;function a(p){var h=Date.now(),v=p?0:o+t-h;if(v>0)return c(v);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,h=new Array(p),v=0;v<p;v++)h[v]=arguments[v];i=h,r=this,n||c(t)}return u.flush=function(){n&&a(!0),l()},u.cancel=l,u},ensureArray:Xb,every:Qb,filter:function(e,t){var n=[];return Dt(e,function(i,r){t(i,r)&&n.push(i)}),n},find:Jb,findIndex:function(e,t){t=Od(t);var n=qc(e)?-1:void 0;return Dt(e,function(i,r){if(t(i,r))return n=r,!1}),n},flatten:function(e){return Array.prototype.concat.apply([],e)},forEach:Dt,get:function(e,t,n){var i=e;return Dt(t,function(r){if(Id(i))return i=void 0,!1;i=i[r]}),yo(i)?n:i},groupBy:t0,has:Yb,isArray:qc,isDefined:Kb,isFunction:Dd,isNil:Id,isNumber:function(e){return Ia.call(e)==="[object Number]"},isObject:Wc,isString:function(e){return Ia.call(e)==="[object String]"},isUndefined:yo,keys:e0,map:Kc,matchPattern:function(e){return function(t){return Qb(e,function(n,i){return t[i]===n})}},merge:function e(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return i.length&&Dt(i,function(o){o&&Wc(o)&&Dt(o,function(a,c){if(c!=="__proto__"){var l=t[c];Wc(a)?(Wc(l)||(l={}),t[c]=e(l,a)):t[c]=a}})}),t},omit:function(e,t){var n={};return Dt(Object(e),function(i,r){t.indexOf(r)===-1&&(n[r]=i)}),n},pick:function(e,t){var n={},i=Object(e);return Dt(t,function(r){r in i&&(n[r]=e[r])}),n},reduce:Zb,set:function(e,t,n){var i=e;return Dt(t,function(r,o){if(typeof r!="number"&&typeof r!="string")throw new Error("illegal key type: "+jd(r)+". Key should be of type number or string.");if(r==="constructor")throw new Error("illegal key: constructor");if(r==="__proto__")throw new Error("illegal key: __proto__");var a=t[o+1],c=i[r];Kb(a)&&Id(c)&&(c=i[r]=isNaN(+a)?{}:[]),yo(a)?yo(n)?delete i[r]:i[r]=n:i=c}),e},size:function(e){return e0(e).length},some:function(e,t){return!!Jb(e,t)},sortBy:function(e,t){t=Bd(t);var n=[];return Dt(e,function(i,r){for(var o=t(i,r),a={d:o,v:i},c=0;c<n.length;c++)if(o<n[c].d)return void n.splice(c,0,a);n.push(a)}),Kc(n,function(i){return i.v})},throttle:function(e,t){var n=!1;return function(){n||(e.apply(void 0,arguments),n=!0,setTimeout(function(){n=!1},t))}},unionBy:xS,uniqueBy:n0,values:function(e){return Kc(e,function(t){return t})},without:function(e,t){return yo(e)?[]:(Xb(e),t=Od(t),e.filter(function(n,i){return!t(n,i)}))}},Symbol.toStringTag,{value:"Module"})),i0=Cx(_S);var SS=i0.every,CS=i0.some;function r0(e,t){for(var n=t.parent;n;){if(n===e)return!0;n=n.parent}return!1}Ge.is=function(e,t){if(e.type!=="label"){Array.isArray(t)||(t=[t]);var n=!1;return t.forEach(function(i){i===e.type&&(n=!0)}),n}},Ge.isTypedEvent=function(e,t,n){return CS(e.eventDefinitions,function(i){return i.$type===t&&function(r,o){return SS(o,function(a,c){return r[c]==a})}(e,n)})},Ge.getBusinessObject=function(e){return e&&e.businessObject||e},Ge.isAncestor=r0,Ge.getDescendants=function(e,t){return e.filter(function(n){return r0(t,n)})},Ge.supportedElements=["bpmn:Association","bpmn:BoundaryEvent","bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:DataInputAssociation","bpmn:DataObjectReference","bpmn:DataOutputAssociation","bpmn:DataStoreReference","bpmn:EndEvent","bpmn:EventBasedGateway","bpmn:ExclusiveGateway","bpmn:IntermediateCatchEvent","bpmn:ManualTask","bpmn:ParallelGateway","bpmn:Process","bpmn:ScriptTask","bpmn:SequenceFlow","bpmn:ServiceTask","bpmn:StartEvent","bpmn:SubProcess","bpmn:Task","bpmn:TextAnnotation","bpmn:UserTask"];var TS={getMid:function(e){var t=e.bbox();return{x:t.x+t.width/2,y:t.y+t.height/2}},distance:function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}},o0=gS,AS=Na,kS=Y.RESET_SIMULATION_EVENT,PS=Y.PLAY_SIMULATION_EVENT,MS=Y.PAUSE_SIMULATION_EVENT,RS=Y.TERMINATE_EVENT,NS=Y.PROCESS_INSTANCE_FINISHED_EVENT,IS=Y.ANIMATION_CREATED_EVENT,a0=Ge.isAncestor,DS=TS.distance,BS=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44"),s0=20;function fr(e,t){var n=window.animation=this;this._eventBus=t,this.animations=[],this.hiddenAnimations=[],this.animationSpeed=1,t.on("import.done",function(){var i=o0(e._svg),r=AS(".viewport",e._svg),o=o0.adopt(r);n.group=i.group().attr("id","token-simulation"),o.put(n.group)}),t.on(RS,function(i){var r=i.element.parent;n.animations.forEach(function(o){a0(r,o.element)&&(o.animation.stop(),n.animations=n.animations.filter(function(a){return a!==o}))})}),t.on(NS,function(i){var r=i.parent;n.animations.forEach(function(o){(i.processInstanceId===o.processInstanceId||a0(r,o.element))&&(o.animation.stop(),n.animations=n.animations.filter(function(a){return a!==o}))})}),t.on(kS,function(){n.animations.forEach(function(i){i.animation.stop()}),n.animations=[],n.hiddenAnimations=[]}),t.on(MS,function(){n.animations.forEach(function(i){i.animation.pause()})}),t.on(PS,function(){n.animations.forEach(function(i){i.animation.play()})})}fr.prototype.createAnimation=function(e,t,n){var i=this;if(this.group){var r,o=this._createTokenGfx(t);return r=new Da(o,e.waypoints,function(){i.animations=i.animations.filter(function(a){return a.animation!==r}),n&&n()}),this.hiddenAnimations.includes(t)&&o.hide(),o.fx._speed=this.animationSpeed,this.animations.push({tokenGfx:o,animation:r,element:e,processInstanceId:t}),this._eventBus.fire(IS,{tokenGfx:o,animation:r,element:e,processInstanceId:t}),r}},fr.prototype.setAnimationSpeed=function(e){this.animations.forEach(function(t){t.tokenGfx.fx._speed=e}),this.animationSpeed=e},fr.prototype._createTokenGfx=function(e){var t=this.group.group().attr("class","token").hide();return t.circle(s0,s0).attr("fill",BS).attr("class","circle"),t.text(e.toString()).attr("transform","translate(10, -7)").attr("text-anchor","middle").attr("class","text"),t},fr.prototype.showProcessInstanceAnimations=function(e){this.animations.forEach(function(t){t.processInstanceId===e&&t.tokenGfx.show()}),this.hiddenAnimations=this.hiddenAnimations.filter(function(t){return t!==e})},fr.prototype.hideProcessInstanceAnimations=function(e){this.animations.forEach(function(t){t.processInstanceId===e&&t.tokenGfx.hide()}),this.hiddenAnimations.push(e)},fr.$inject=["canvas","eventBus"];var OS=fr;function Da(e,t,n){this.gfx=this.fx=e,this.waypoints=t,this.done=n,this.create()}Da.prototype.create=function(){var e=this.gfx,t=this.waypoints,n=this.done,i=this.fx;e.show().move(t[0].x-10,t[0].y-10),t.forEach(function(r,o){if(o>0){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*DS(t[o-1],r);i=i.animate(u,l,0).move(a,c)}}),i.after(function(){e.remove(),n()})},Da.prototype.play=function(){this.gfx.play()},Da.prototype.pause=function(){this.gfx.pause()},Da.prototype.stop=function(){this.fx.stop(),this.gfx.remove()};var Vd,jS=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(at,i)?at[i]:at._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},c0=!1;typeof document<"u"&&((Vd=document.createElement("div")).innerHTML='  <link/><table></table><a href="/a">a</a><input type="checkbox"/>',c0=!Vd.getElementsByTagName("link").length,Vd=void 0);var at={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:c0?[1,"X<div>","</div>"]:[0,"",""]};at.td=at.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],at.option=at.optgroup=[1,'<select multiple="multiple">',"</select>"],at.thead=at.tbody=at.colgroup=at.caption=at.tfoot=[1,"<table>","</table>"],at.polyline=at.ellipse=at.polygon=at.circle=at.text=at.line=at.path=at.rect=at.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Bt=jS,Fd={},l0=window.addEventListener?"addEventListener":"attachEvent",LS=window.removeEventListener?"removeEventListener":"detachEvent",u0=l0!=="addEventListener"?"on":"";Fd.bind=function(e,t,n,i){return e[l0](u0+t,n,i||!1),n},Fd.unbind=function(e,t,n,i){return e[LS](u0+t,n,i||!1),n};var _n=Fd,VS=Bt,FS=_n,p0=Ge.is,$S=Y.GENERATE_TOKEN_EVENT,zS=Y.UPDATE_ELEMENT_EVENT;function $d(e,t,n){this._eventBus=e,this._processInstances=t,this._processInstanceSettings=n}$d.prototype.createContextPads=function(e){if(e.attachers.length&&this._processInstances.getProcessInstances(e).length){var t=e.incoming.filter(function(r){return p0(r,"bpmn:SequenceFlow")}),n=this,i=[];return e.attachers.forEach(function(r){var o=r.outgoing.filter(function(c){return p0(c,"bpmn:SequenceFlow")});if(t.length&&o.length){var a=VS('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>');i.push({element:r,html:a}),FS.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(zS,{element:e})),n._eventBus.fire($S,{element:r,processInstanceId:l})})})}}),i}},$d.$inject=["eventBus","processInstances","processInstanceSettings"];var GS=$d,US=Ge.is,HS=Bt,qS=_n;function zd(e){this._exclusiveGatewaySettings=e}zd.prototype.createContextPads=function(e){var t=this;if(!(e.outgoing.filter(function(i){return US(i,"bpmn:SequenceFlow")}).length<2)){var n=HS('<div class="context-pad" title="Set Sequence Flow"><i class="fa fa-code-fork"></i></div>');return qS.bind(n,"click",function(){t._exclusiveGatewaySettings.setSequenceFlow(e)}),[{element:e,html:n}]}},zd.$inject=["exclusiveGatewaySettings"];var WS=zd,d0=Bt,h0=_n,Gd=Ge.is,m0=Y.GENERATE_TOKEN_EVENT;function Ud(e){this._eventBus=e}Ud.prototype.createContextPads=function(e){var t=e.parent.shownProcessInstance,n=e.incoming.filter(function(c){return Gd(c,"bpmn:SequenceFlow")}),i=[];n.forEach(function(c){var l=c.source;Gd(l,"bpmn:EventBasedGateway")&&l.tokenCount&&l.tokenCount[t]&&i.push(l)});var r=e.outgoing.filter(function(c){return Gd(c,"bpmn:SequenceFlow")});if(n.length&&r.length){var o,a=this;if(e.tokenCount&&e.tokenCount[t])o=d0('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),h0.bind(o,"click",function(){e.tokenCount[t]--,a._eventBus.fire(m0,{element:e,processInstanceId:t})});else{if(!i.length)return;o=d0('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),h0.bind(o,"click",function(){i.forEach(function(c){c.tokenCount[t]--}),a._eventBus.fire(m0,{element:e,processInstanceId:t})})}return[{element:e,html:o}]}},Ud.$inject=["eventBus"];var KS=Ud,XS=Bt,YS=_n;function Hd(e,t){this._processInstances=e,this._processInstanceSettings=t}Hd.prototype.createContextPads=function(e){var t=this;if(!(this._processInstances.getProcessInstances(e).filter(function(i){return!i.isFinished}).length<2)){var n=XS('<div class="context-pad" title="View Process Instances"><i class="fa fa-list-ol"></i></div>');return YS.bind(n,"click",function(){t._processInstanceSettings.showNext(e)}),[{element:e,html:n}]}},Hd.$inject=["processInstances","processInstanceSettings"];var JS=Hd,ZS=Bt,QS=_n,eC=Ge.is,tC=Y.GENERATE_TOKEN_EVENT;function qd(e,t,n){this._eventBus=e,this._elementRegistry=t,this._animation=n}qd.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)})}),!(eC(e.parent,"bpmn:SubProcess")||t||this._animation.animations.length)){var n=this,i=ZS('<div class="context-pad"><i class="fa fa-play"></i></div>');return QS.bind(i,"click",function(){n._eventBus.fire(tC,{element:e})}),[{element:e,html:i}]}},qd.$inject=["eventBus","elementRegistry","animation"];var nC=qd,f0=Ge.isAncestor,iC=Y.TOGGLE_MODE_EVENT,rC=Y.RESET_SIMULATION_EVENT,oC=Y.TERMINATE_EVENT,aC=Y.UPDATE_ELEMENTS_EVENT,sC=Y.UPDATE_ELEMENT_EVENT,cC=Y.PROCESS_INSTANCE_SHOWN_EVENT,lC=GS,uC=WS,pC=KS,dC=JS,hC=nC,Ba=500;function vr(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",uC),this.registerHandler("bpmn:IntermediateCatchEvent",pC),this.registerHandler("bpmn:SubProcess",dC),this.registerHandler("bpmn:SubProcess",lC),this.registerHandler("bpmn:StartEvent",hC),e.on(iC,Ba,function(c){c.simulationModeActive?a.openContextPads():a.closeContextPads()}),e.on(rC,Ba,function(){a.closeContextPads(),a.openContextPads()}),e.on(oC,Ba,function(c){var l=c.element.parent;a.closeContextPads(l)}),e.on(aC,Ba,function(c){c.elements.forEach(function(l){a.closeElementContextPads(l),a.openElementContextPads(l)})}),e.on(sC,Ba,function(c){var l=c.element;a.closeElementContextPads(l),a.openElementContextPads(l)}),e.on(cC,function(c){var l=c.processInstanceId,u=o.getProcessInstance(l).parent;a.closeContextPads(u),a.openContextPads(u)})}vr.prototype.registerHandler=function(e,t){var n=this._injector.instantiate(t);this.handlers[e]||(this.handlers[e]=[]),this.handlers[e].push(n)},vr.prototype.openContextPads=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){t.handlers[n.type]&&f0(e,n)&&t.openElementContextPads(n)})},vr.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})}},vr.prototype.closeContextPads=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){f0(e,n)&&t.closeElementContextPads(n)})},vr.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])},vr.$inject=["eventBus","elementRegistry","overlays","injector","canvas","processInstances"];var mC=vr,fC=Y.TOGGLE_MODE_EVENT;function v0(e,t,n,i,r,o,a,c){var l=this;function u(v,f,y){var g=v[f];v[f]=function(){return y.call(this,g,arguments)}}function p(v,f){u(v,f,function(y,g){if(!l.modelingDisabled)return y.apply(this,g)})}function h(v,f){u(v,f,function(y,g){if(l.modelingDisabled)throw new Error("model is read-only");return y.apply(this,g)})}this._eventBus=e,this.modelingDisabled=!1,e.on(fC,10001,function(v){var f=v.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"),h(o,"moveShape"),h(o,"updateAttachment"),h(o,"moveElements"),h(o,"moveConnection"),h(o,"layoutConnection"),h(o,"createConnection"),h(o,"createShape"),h(o,"createLabel"),h(o,"appendShape"),h(o,"removeElements"),h(o,"distributeElements"),h(o,"removeShape"),h(o,"removeConnection"),h(o,"replaceShape"),h(o,"pasteElements"),h(o,"alignElements"),h(o,"resizeShape"),h(o,"createSpace"),h(o,"updateWaypoints"),h(o,"reconnectStart"),h(o,"reconnectEnd"),u(r,"trigger",function(v,f){var y=f[0];if(!l.modelingDisabled||!function(g,x){return g.indexOf(x)>-1}(["undo","redo","copy","paste","removeSelection","spaceTool","lassoTool","globalConnectTool","distributeElements","alignElements","directEditing"],y))return v.apply(this,f)})}v0.$inject=["eventBus","contextPad","dragging","directEditing","editorActions","modeling","palette","paletteProvider"];var vC=v0,yC=Bt,gC=Y.TOGGLE_MODE_EVENT,bC=Y.RESET_SIMULATION_EVENT,xC=Y.GENERATE_TOKEN_EVENT;function go(e,t){var n=this;this._overlays=e,t.on(gC,function(i){i.simulationModeActive||n.removeElementNotifications()}),t.on([bC,xC],function(){n.removeElementNotifications()})}go.prototype.addElementNotifications=function(e,t){var n=this;e.forEach(function(i){n.addElementNotification(i,t)})},go.prototype.addElementNotification=function(e,t){var n={top:-15,right:15},i='<div class="element-notification '+(t.type||"")+'">'+(t.icon?'<i class="fa '+t.icon+'"></i>':"")+('<span class="text">'+t.text+"</span>"||"")+"</div>",r=yC(i);this._overlays.add(e,"element-notification",{position:n,html:r,show:{minZoom:.5}})},go.prototype.removeElementNotifications=function(e){var t=this;e?e.forEach(function(n){t.removeElementNotification(n)}):this._overlays.remove({type:"element-notification"})},go.prototype.removeElementNotification=function(e){this._overlays.remove({element:e})},go.$inject=["overlays","eventBus"];var y0,g0,EC=go;function b0(){return g0?y0:(g0=1,y0=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1})}try{var Xc=b0()}catch{Xc=b0()}var wC=/\s+/,_C=Object.prototype.toString;function Vi(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}Vi.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~Xc(t,e)||t.push(e),this.el.className=t.join(" "),this},Vi.prototype.remove=function(e){if(_C.call(e)=="[object RegExp]")return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=Xc(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},Vi.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Vi.prototype.toggle=function(e,t){return this.list?(t!==void 0?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(t!==void 0?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},Vi.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(wC);return e[0]===""&&e.shift(),e},Vi.prototype.has=Vi.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Xc(this.array(),e)};var Fi=function(e){return new Vi(e)},x0=Fi,E0=Ge,Oa=E0.is,w0=E0.supportedElements,SC=Y.TOGGLE_MODE_EVENT,CC=Y.GENERATE_TOKEN_EVENT,_0=["bpmn:Process","bpmn:Collaboration","bpmn:Participant","bpmn:Lane","bpmn:TextAnnotation"];function S0(e){return e.labelTarget}function ja(e,t,n,i,r){var o=this;this._eventBus=e,this._elementRegistry=t,this._elementNotifications=r,this._notifications=i,this.canvasParent=n.getContainer().parentNode,e.on(CC,2e4,function(a){var c=a.element;if(Oa(c,"bpmn:StartEvent"))return o.allElementsSupported()?void 0:(o.showWarnings(),x0(o.canvasParent).add("warning"),!0)}),e.on(SC,function(a){a.simulationModeActive||x0(o.canvasParent).remove("warning")})}ja.prototype.allElementsSupported=function(){var e=!0;return this._elementRegistry.forEach(function(t){Oa(t,_0)||Oa(t,w0)||S0(t)||(e=!1)}),e},ja.prototype.showWarnings=function(e){var t=this,n=[];this._elementRegistry.forEach(function(i){Oa(i,_0)||Oa(i,w0)||S0(i)||(t.showWarning(i),n.indexOf(i.type)&&(t._notifications.showNotification(i.type+" not supported","warning"),n.push(i.type)))})},ja.prototype.showWarning=function(e){this._elementNotifications.addElementNotification(e,{type:"warning",icon:"fa-exclamation-triangle",text:"Not supported"})},ja.$inject=["eventBus","elementRegistry","canvas","notifications","elementNotifications"];var TC=ja,Wd=Ge.is,AC=Y.TOGGLE_MODE_EVENT,kC=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-lighten-56"),PC=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-darken-30");function La(e){return Wd(e,"bpmn:SequenceFlow")}function yr(e,t,n){var i=this;this._elementRegistry=t,this._graphicsFactory=n,e.on(AC,function(r){r.simulationModeActive?i.setSequenceFlowsDefault():i.resetSequenceFlows()})}yr.prototype.setSequenceFlowsDefault=function(){var e=this;this._elementRegistry.filter(function(t){return Wd(t,"bpmn:ExclusiveGateway")}).forEach(function(t){t.outgoing.filter(La).length&&e.setSequenceFlow(t,t.outgoing.filter(La)[0])})},yr.prototype.resetSequenceFlows=function(){var e=this;this._elementRegistry.filter(function(t){return Wd(t,"bpmn:ExclusiveGateway")}).forEach(function(t){t.outgoing.filter(La).length&&e.resetSequenceFlow(t)})},yr.prototype.resetSequenceFlow=function(e){e.sequenceFlow&&delete e.sequenceFlow},yr.prototype.setSequenceFlow=function(e){var t=this,n=e.outgoing.filter(La);if(n.length){var i=e.sequenceFlow;e.sequenceFlow=i?function(r){var o=r.outgoing.filter(La),a=o.indexOf(r.sequenceFlow);return o[a+1]?o[a+1]:o[0]}(e):n[0],e.outgoing.forEach(function(r){r===e.sequenceFlow?t.setColor(r,PC):t.setColor(r,kC)})}},yr.prototype.setColor=function(e,t){e.businessObject.di.set("stroke",t);var n=this._elementRegistry.getGraphics(e);this._graphicsFactory.update("connection",e,n)},yr.$inject=["eventBus","elementRegistry","graphicsFactory"];var MC=yr,Yc=Bt,si=Fi,Va=_n,Jc=Na,Kd=Ge,RC=Kd.getBusinessObject,sn=Kd.is,NC=Kd.isTypedEvent,IC=Y.GENERATE_TOKEN_EVENT,DC=Y.CONSUME_TOKEN_EVENT,BC=Y.TOGGLE_MODE_EVENT,OC=Y.RESET_SIMULATION_EVENT,jC=Y.PROCESS_INSTANCE_CREATED_EVENT;function Xd(e){return e&&e.businessObject.name}function bo(e,t,n,i){var r=this;this._notifications=t,this._tokenSimulationPalette=n,this._canvas=i,this._init(),e.on(IC,function(o){var a=o.element,c=Xd(a);if(sn(a,"bpmn:BusinessRuleTask"))r.log(c||"Business Rule Task","info","bpmn-icon-business-rule");else if(sn(a,"bpmn:CallActivity"))r.log(c||"Call Activity","info","bpmn-icon-call-activity");else if(sn(a,["bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent"]))r.log(c||"Intermediate Event","info","bpmn-icon-intermediate-event-none");else if(sn(a,"bpmn:ManualTask"))r.log(c||"Manual Task","info","bpmn-icon-manual");else if(sn(a,"bpmn:ScriptTask"))r.log(c||"Script Task","info","bpmn-icon-script");else if(sn(a,"bpmn:ServiceTask"))r.log(c||"Service Task","info","bpmn-icon-service");else if(sn(a,"bpmn:StartEvent"))r.log(c||"Start Event","info","bpmn-icon-start-event-none");else if(sn(a,"bpmn:Task"))r.log(c||"Task","info","bpmn-icon-task");else if(sn(a,"bpmn:UserTask"))r.log(c||"User Task","info","bpmn-icon-user");else if(sn(a,"bpmn:ExclusiveGateway")){if(a.outgoing.length<2)return;var l=Xd(a.sequenceFlow),u=c||"Gateway";l&&(u=u.concat(' <i class="fa fa-angle-right" aria-hidden="true"></i> '+l)),r.log(u,"info","bpmn-icon-gateway-xor")}}),e.on(DC,function(o){var a=o.element,c=Xd(a);sn(a,"bpmn:EndEvent")&&(NC(RC(a),"bpmn:TerminateEventDefinition")?r.log(c||"Terminate End Event","info","bpmn-icon-end-event-terminate"):r.log(c||"End Event","info","bpmn-icon-end-event-none"))}),e.on(jC,function(o){var a=o.processInstanceId,c=o.parent;sn(c,"bpmn:Process")?r.log("Process "+a+" started","success","fa-check"):r.log("Subprocess "+a+" started","info","fa-check")}),e.on(BC,function(o){o.simulationModeActive||(r.emptyLog(),si(r.container).add("hidden"))}),e.on(OC,function(o){r.emptyLog(),si(r.container).add("hidden")})}bo.prototype._init=function(){var e=this;this.container=Yc('<div class="token-simulation-log hidden"><div class="header"><i class="fa fa-align-left"></i><button class="close"><i class="fa fa-times" aria-hidden="true"></i></button></div><div class="content"><p class="entry placeholder">No Entries</p></div></div>'),this.placeholder=Jc(".placeholder",this.container),this.content=Jc(".content",this.container),Va.bind(this.content,"wheel",function(t){t.stopPropagation()}),Va.bind(this.content,"mousedown",function(t){t.stopPropagation()}),this.close=Jc(".close",this.container),Va.bind(this.close,"click",function(){si(e.container).add("hidden")}),this.icon=Jc(".fa-align-left",this.container),Va.bind(this.icon,"click",function(){si(e.container).add("hidden")}),this._canvas.getContainer().appendChild(this.container),this.paletteEntry=Yc('<div class="entry" title="Show Simulation Log"><i class="fa fa-align-left"></i></div>'),Va.bind(this.paletteEntry,"click",function(){si(e.container).remove("hidden")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,3)},bo.prototype.toggle=function(){var e=this.container;si(e).has("hidden")?si(e).remove("hidden"):si(e).add("hidden")},bo.prototype.log=function(e,t,n){si(this.placeholder).add("hidden");var i,r=new Date,o=r.toLocaleTimeString()+":"+r.getUTCMilliseconds();this._notifications.showNotification(e,t,n),n||(n="fa-info"),i=n.includes("bpmn")?'<span class="icon '+n+'">':'<i class="icon fa '+n+'"></i>';var a=Yc('<p class="entry '+t+'"><span class="date">'+o+"</span>"+i+"</span>"+e+"</p>");this.content.appendChild(a),this.content.scrollTop=this.content.scrollHeight},bo.prototype.emptyLog=function(){for(;this.content.firstChild;)this.content.removeChild(this.content.firstChild);this.placeholder=Yc('<p class="entry placeholder">No Entries</p>'),this.content.appendChild(this.placeholder)},bo.$inject=["eventBus","notifications","tokenSimulationPalette","canvas"];var LC=bo,C0=Bt,VC=Y.TOGGLE_MODE_EVENT;function Fa(e,t){var n=this;this._eventBus=e,this._canvas=t,this._init(),e.on(VC,function(i){i.simulationModeActive||n.removeAll()})}Fa.prototype._init=function(){this.container=C0('<div class="notifications"></div>'),this._canvas.getContainer().appendChild(this.container)},Fa.prototype.showNotification=function(e,t,n){var i;n||(n="fa-info"),i=n.includes("bpmn")?'<i class="'+n+'"></i>':'<i class="fa '+n+'"></i>';var r=C0('<div class="notification '+t+'"><span class="icon">'+i+"</span>"+e+"</div>");for(this.container.appendChild(r);this.container.children.length>5;)this.container.children[0].remove();setTimeout(function(){r.remove()},2e3)},Fa.prototype.removeAll=function(){for(;this.container.children.length;)this.container.children[0].remove()},Fa.$inject=["eventBus","canvas"];var FC=Fa,$C=Bt,gr=Fi,zC=_n,GC=Y.TOGGLE_MODE_EVENT,UC=Y.PLAY_SIMULATION_EVENT,HC=Y.PAUSE_SIMULATION_EVENT,qC=Y.RESET_SIMULATION_EVENT,WC=Y.ANIMATION_CREATED_EVENT,KC=Y.PROCESS_INSTANCE_CREATED_EVENT,T0='<i class="fa fa-play"></i>';function $i(e,t,n,i){var r=this;this._eventBus=e,this._tokenSimulationPalette=t,this._notifications=n,this.canvasParent=i.getContainer().parentNode,this.isActive=!1,this.isPaused=!1,this._init(),e.on(KC,function(o){o.parent.parent||(r.activate(),r.unpause(),n.showNotification("Start Simulation","info"))}),e.on([qC,GC],function(){r.deactivate(),r.unpause()}),e.on(WC,function(o){var a=o.animation;r.isPaused&&a.pause()})}$i.prototype._init=function(){this.paletteEntry=$C('<div class="entry disabled" title="Play/Pause Simulation">'+T0+"</div>"),zC.bind(this.paletteEntry,"click",this.toggle.bind(this)),this._tokenSimulationPalette.addEntry(this.paletteEntry,1)},$i.prototype.toggle=function(){this.isActive&&(this.isPaused?this.unpause():this.pause())},$i.prototype.pause=function(){this.isActive&&(gr(this.paletteEntry).remove("active"),gr(this.canvasParent).add("paused"),this.paletteEntry.innerHTML=T0,this._eventBus.fire(HC),this._notifications.showNotification("Pause Simulation","info"),this.isPaused=!0)},$i.prototype.unpause=function(){this.isActive&&(gr(this.paletteEntry).add("active"),gr(this.canvasParent).remove("paused"),this.paletteEntry.innerHTML='<i class="fa fa-pause"></i>',this._eventBus.fire(UC),this._notifications.showNotification("Play Simulation","info"),this.isPaused=!1)},$i.prototype.activate=function(){this.isActive=!0,gr(this.paletteEntry).remove("disabled")},$i.prototype.deactivate=function(){this.isActive=!1,gr(this.paletteEntry).remove("active"),gr(this.paletteEntry).add("disabled")},$i.$inject=["eventBus","tokenSimulationPalette","notifications","canvas"];var XC=$i,YC=Y.TOGGLE_MODE_EVENT;function $a(e,t,n){var i=this;this._elementRegistry=t,this._graphicsFactory=n,this.elementColors={},e.on(YC,5e4,function(r){r.simulationModeActive?i.preserveColors():i.resetColors()})}$a.prototype.preserveColors=function(){var e=this;this._elementRegistry.forEach(function(t){e.elementColors[t.id]={stroke:t.businessObject.di.get("stroke"),fill:t.businessObject.di.get("fill")},e.setColor(t,"#000","#fff")})},$a.prototype.resetColors=function(){var e=this;this._elementRegistry.forEach(function(t){e.elementColors[t.id]&&e.setColor(t,e.elementColors[t.id].stroke,e.elementColors[t.id].fill)}),this.elementColors={}},$a.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),o=e.waypoints?"connection":"shape";this._graphicsFactory.update(o,e,r)},$a.$inject=["eventBus","elementRegistry","graphicsFactory"];var JC=$a,ZC=Y.TOGGLE_MODE_EVENT,QC=Y.RESET_SIMULATION_EVENT;function Zc(e){this.nextProcessInstanceId=1,e.on(ZC,this.reset.bind(this)),e.on(QC,this.reset.bind(this))}Zc.prototype.getNext=function(){var e=this.nextProcessInstanceId;return this.nextProcessInstanceId++,e},Zc.prototype.reset=function(){this.nextProcessInstanceId=1},Zc.$inject=["eventBus"];var eT=Zc,tT=Y.TOGGLE_MODE_EVENT,nT=Y.PROCESS_INSTANCE_CREATED_EVENT,iT=Y.PROCESS_INSTANCE_FINISHED_EVENT,rT=Y.PROCESS_INSTANCE_SHOWN_EVENT,oT=Y.PROCESS_INSTANCE_HIDDEN_EVENT;function za(e,t,n,i){var r=this;this._animation=e,this._eventBus=t,this._processInstances=n,this._elementRegistry=i,this._eventBus.on(nT,500,function(o){var a=o.parent,c=o.processInstanceId,l=n.getProcessInstances(a).filter(function(u){return!u.isFinished});l.length===1?r.showProcessInstance(c,a):l.length>1&&r.hideProcessInstance(c)}),this._eventBus.on(iT,500,function(o){var a=o.parent,c=o.processInstanceId,l=n.getProcessInstances(a).filter(function(u){return c!==u.processInstanceId&&!u.isFinished});l.length&&c===a.shownProcessInstance?r.showProcessInstance(l[0].processInstanceId,a):delete a.shownProcessInstance,a.parent||i.forEach(function(u){delete u.shownProcessInstance})}),t.on(tT,function(){i.forEach(function(o){delete o.shownProcessInstance})})}za.prototype.showProcessInstance=function(e,t){this._animation.showProcessInstanceAnimations(e),t.shownProcessInstance=e,this._eventBus.fire(rT,{processInstanceId:e})},za.prototype.hideProcessInstance=function(e){this._animation.hideProcessInstanceAnimations(e),this._eventBus.fire(oT,{processInstanceId:e})},za.prototype.showNext=function(e){var t=this,n=this._processInstances.getProcessInstances(e),i=e.shownProcessInstance,r=0;for(let o=0;o<n.length&&n[o].processInstanceId!==i;o++)r++;n.forEach(function(o){t.hideProcessInstance(o.processInstanceId)}),r===n.length-1?this.showProcessInstance(n[0].processInstanceId,e):this.showProcessInstance(n[r+1].processInstanceId,e)},za.$inject=["animation","eventBus","processInstances","elementRegistry"];var aT=za,sT=Y.TOGGLE_MODE_EVENT,cT=Y.RESET_SIMULATION_EVENT,lT=Y.PROCESS_INSTANCE_CREATED_EVENT,uT=Y.PROCESS_INSTANCE_FINISHED_EVENT;function br(e,t){var n=this;this._eventBus=e,this._processInstanceIds=t,this.processInstances=[],e.on([sT,cT],function(){n.processInstances=[]})}br.prototype.create=function(e,t){var n=this._processInstanceIds.getNext(),i={parent:e,processInstanceId:n,parentProcessInstanceId:t};return this.processInstances.push(i),this._eventBus.fire(lT,i),n},br.prototype.remove=function(e){this.processInstances=this.processInstances.filter(function(t){return t.processInstanceId!==e})},br.prototype.finish=function(e){var t=this.processInstances.find(function(n){return n.processInstanceId===e});this._eventBus.fire(uT,t),t.isFinished=!0},br.prototype.getProcessInstances=function(e,t){if(!e)return this.processInstances;var n=this.processInstances.filter(function(i){return i.parent===e});return t&&t.includeFinished!==!0&&(n=n.filter(function(i){return!i.isFinished})),n},br.prototype.getProcessInstance=function(e){return this.processInstances.find(function(t){return t.processInstanceId===e})},br.$inject=["eventBus","processInstanceIds"];var pT=br,dT=Bt,A0=Fi,hT=_n,mT=Ge.is,fT=Y.TOGGLE_MODE_EVENT,vT=Y.GENERATE_TOKEN_EVENT,yT=Y.RESET_SIMULATION_EVENT;function Qc(e,t,n,i){var r=this;this._eventBus=e,this._tokenSimulationPalette=t,this._notifications=n,this._elementRegistry=i,this._init(),e.on(vT,function(o){mT(o.element,"bpmn:StartEvent")&&A0(r.paletteEntry).remove("disabled")}),e.on(fT,function(o){o.simulationModeActive||r.resetSimulation()})}Qc.prototype._init=function(){var e=this;this.paletteEntry=dT('<div class="entry disabled" title="Reset Simulation"><i class="fa fa-refresh"></i></div>'),hT.bind(this.paletteEntry,"click",function(){e.resetSimulation(),e._notifications.showNotification("Reset Simulation","info")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,2)},Qc.prototype.resetSimulation=function(){A0(this.paletteEntry).add("disabled"),this._elementRegistry.forEach(function(e){e.tokenCount!==void 0&&delete e.tokenCount}),this._eventBus.fire(yT)},Qc.$inject=["eventBus","tokenSimulationPalette","notifications","elementRegistry"];var gT=Qc,bT=Bt,el=Fi,Yd=_n,tl=Na,xT=Y.TOGGLE_MODE_EVENT;function nl(e,t,n){var i=this;this._canvas=e,this._animation=t,this._eventBus=n,this._init(),n.on(xT,function(r){r.simulationModeActive?el(i.container).remove("hidden"):el(i.container).add("hidden")})}nl.prototype._init=function(){var e=this;this.container=bT('<div class="set-animation-speed hidden"><i title="Set Animation Speed" class="fa fa-tachometer" aria-hidden="true"></i><div class="animation-speed-buttons"><div title="Slow" id="animation-speed-1" class="animation-speed-button"><i class="fa fa-angle-right" aria-hidden="true"></i></div><div title="Normal" id="animation-speed-2" class="animation-speed-button active"><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i></div><div title="Fast" id="animation-speed-3" class="animation-speed-button"><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i><i class="fa fa-angle-right" aria-hidden="true"></i></div></div></div>');var t=tl("#animation-speed-1",this.container),n=tl("#animation-speed-2",this.container),i=tl("#animation-speed-3",this.container);Yd.bind(t,"click",function(){e.setActive(t),e._animation.setAnimationSpeed(.5)}),Yd.bind(n,"click",function(){e.setActive(n),e._animation.setAnimationSpeed(1)}),Yd.bind(i,"click",function(){e.setActive(i),e._animation.setAnimationSpeed(1.5)}),this._canvas.getContainer().appendChild(this.container)},nl.prototype.setActive=function(e){tl.all(".animation-speed-button",this.container).forEach(function(t){el(t).remove("active")}),el(e).add("active")},nl.$inject=["canvas","animation","eventBus"];var ET=nl,k0=Bt,xo=Fi,Jd=_n,Zd=Na,wT=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e},_T=Y.TOGGLE_MODE_EVENT,ST=Y.PROCESS_INSTANCE_CREATED_EVENT,CT=Y.PROCESS_INSTANCE_FINISHED_EVENT,TT=Y.PROCESS_INSTANCE_SHOWN_EVENT,AT=Y.PROCESS_INSTANCE_HIDDEN_EVENT,kT=Y.RESET_SIMULATION_EVENT,PT=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-silver-base-97"),MT=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44");function P0(e){return e===null}function Sn(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(_T,function(c){c.simulationModeActive?xo(a.container).remove("hidden"):(xo(a.container).add("hidden"),wT(a.container),P0(a.highlightedElement)||(a.removeHighlightFromProcess(a.highlightedElement.element),a.highlightedElement=null))}),e.on(ST,function(c){a.addInstance(c)}),e.on(CT,function(c){a.removeInstance(c)}),e.on(TT,function(c){a.setInstanceShown(c.processInstanceId)}),e.on(AT,function(c){a.setInstanceHidden(c.processInstanceId)}),e.on(kT,function(){a.removeAllInstances()})}Sn.prototype._init=function(){this.container=k0('<div class="process-instances hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},Sn.prototype.addInstance=function(e){var t=this,n=e.processInstanceId,i=e.parent,r=k0('<div id="instance-'+n+'" class="process-instance" title="View Process Instance '+n+'">'+n+"</div>");Jd.bind(r,"click",function(){t._processInstances.getProcessInstances(i).forEach(function(o){t._processInstanceSettings.hideProcessInstance(o.processInstanceId)}),t._processInstanceSettings.showProcessInstance(n,i)}),Jd.bind(r,"mouseenter",function(){t.highlightedElement={element:i,stroke:i.businessObject.di.get("stroke"),fill:i.businessObject.di.get("fill")},t.addHighlightToProcess(i)}),Jd.bind(r,"mouseleave",function(){t.removeHighlightFromProcess(i),t.highlightedElement=null}),this.container.appendChild(r)},Sn.prototype.removeInstance=function(e){var t=e.processInstanceId,n=Zd("#instance-"+t,this.container);n&&n.remove()},Sn.prototype.removeAllInstances=function(){this.container.innerHTML=""},Sn.prototype.setInstanceShown=function(e){var t=Zd("#instance-"+e,this.container);t&&xo(t).add("active")},Sn.prototype.setInstanceHidden=function(e){var t=Zd("#instance-"+e,this.container);t&&xo(t).remove("active")},Sn.prototype.addHighlightToProcess=function(e){this.setColor(e,MT,PT),e.parent||xo(this._canvas.getContainer()).add("highlight")},Sn.prototype.removeHighlightFromProcess=function(e){P0(this.highlightedElement)||(this.setColor(e,this.highlightedElement.stroke,this.highlightedElement.fill),e.parent||xo(this._canvas.getContainer()).remove("highlight"))},Sn.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)},Sn.$inject=["eventBus","canvas","processInstanceSettings","processInstances","graphicsFactory","elementRegistry"];var RT=Sn,il=Ge,NT=il.getBusinessObject,rl=il.is,IT=il.isAncestor,DT=il.isTypedEvent,BT=Y.CONSUME_TOKEN_EVENT;function ol(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(BT,250,function(){})}ol.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 rl(a,"bpmn:SequenceFlow")}).length||n.push(r),rl(r,"bpmn:ParallelGateway")&&r.incoming.filter(function(a){return rl(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),DT(NT(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"})}))},ol.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){IT(n,o.element)&&o.processInstanceId===t&&(r=!0)}),!i&&!r)return rl(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},ol.$inject=["eventBus","animation","elementRegistry","log","elementNotifications","canvas","processInstances"];var OT=ol,jT=Bt,al=Fi,LT=_n,VT=Na,M0=Y.TOGGLE_MODE_EVENT;function sl(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=VT(".djs-palette",r._canvas.getContainer()),r._init()})}sl.prototype._init=function(){this.container=jT(`
    <div class="toggle-mode">
      Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>
    </div>
  `),LT.bind(this.container,"click",this.toggleMode.bind(this)),this._canvas.getContainer().appendChild(this.container)},sl.prototype.toggleMode=function(){if(this.simulationModeActive){this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>',al(this.canvasParent).remove("simulation"),al(this.palette).remove("hidden"),this._eventBus.fire(M0,{simulationModeActive:!1});var e=this._selection.get();e.length===1&&this._contextPad.open(e[0])}else this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-on"></i></span>',al(this.canvasParent).add("simulation"),al(this.palette).add("hidden"),this._eventBus.fire(M0,{simulationModeActive:!0});this.simulationModeActive=!this.simulationModeActive},sl.$inject=["eventBus","canvas","selection","contextPad"];var FT=sl,$T=Bt,R0=Ge.isAncestor,zT=Y.TOGGLE_MODE_EVENT,GT=Y.GENERATE_TOKEN_EVENT,UT=Y.CONSUME_TOKEN_EVENT,HT=Y.RESET_SIMULATION_EVENT,qT=Y.TERMINATE_EVENT,WT=Y.PROCESS_INSTANCE_SHOWN_EVENT;function xr(e,t,n,i,r){var o=this;this._overlays=t,this._elementRegistry=n,this._canvas=i,this._processInstances=r,this.overlayIds={},e.on(zT,function(a){a.simulationModeActive||o.removeTokenCounts()}),e.on(HT,function(){o.removeTokenCounts()}),e.on(qT,function(a){var c=a.element.parent;o.removeTokenCounts(c)}),e.on([GT,UT],500,function(a){var c=a.element.parent;o.removeTokenCounts(c),o.addTokenCounts(c)}),e.on(WT,function(a){var c=a.processInstanceId,l=r.getProcessInstance(c).parent;o.removeTokenCounts(l),o.addTokenCounts(l)})}xr.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){R0(e,r)&&t.addTokenCount(r,n)})},xr.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}},xr.prototype.createTokenCount=function(e){return $T('<div class="token-count waiting">'+e+"</div>")},xr.prototype.removeTokenCounts=function(e){var t=this;e||(e=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){R0(e,n)&&t.removeTokenCount(n)})},xr.prototype.removeTokenCount=function(e){var t=this.overlayIds[e.id];t&&(this._overlays.remove(t),delete this.overlayIds[e.id])},xr.$inject=["eventBus","overlays","elementRegistry","canvas","processInstances"];var KT=xr,Ga=Ge,XT=Ga.getBusinessObject,YT=Ga.is,JT=Ga.isAncestor,ZT=Ga.getDescendants,QT=Ga.isTypedEvent,eA=Y.GENERATE_TOKEN_EVENT,tA=Y.TERMINATE_EVENT,nA=Y.UPDATE_ELEMENTS_EVENT;function cl(e,t,n,i,r,o){this._animation=e,this._eventBus=t,this._log=n,this._simulationState=i,this._elementRegistry=r,this._processInstances=o}cl.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,i=QT(XT(t),"bpmn:TerminateEventDefinition"),r=YT(t.parent,"bpmn:SubProcess");i&&(this._eventBus.fire(tA,e),this._elementRegistry.forEach(function(c){JT(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(eA,{element:t.parent,processInstanceId:a.parentProcessInstanceId})}this._eventBus.fire(nA,{elements:ZT(this._elementRegistry.getAll(),t.parent)})},cl.prototype.generate=function(e){},cl.$inject=["animation","eventBus","log","simulationState","elementRegistry","processInstances"];var iA=cl,rA=Ge.is,oA=Y.UPDATE_ELEMENTS_EVENT;function ll(e,t){this._eventBus=e,this._animation=t}ll.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;rA(a,"bpmn:IntermediateCatchEvent")&&r.push(a)}),this._eventBus.fire(oA,{elements:r})},ll.prototype.generate=function(){},ll.$inject=["eventBus","animation"];var aA=ll,sA=Y.CONSUME_TOKEN_EVENT,cA=Y.GENERATE_TOKEN_EVENT;function ul(e,t,n){this._eventBus=e,this._animation=t,this._elementRegistry=n}ul.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(cA,e)},ul.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(sA,{element:r.target,processInstanceId:n})})},ul.$inject=["eventBus","animation","elementRegistry"];var lA=ul,N0=Ge.is,uA=Y.CONSUME_TOKEN_EVENT,pA=Y.UPDATE_ELEMENT_EVENT,dA=Y.UPDATE_ELEMENTS_EVENT;function pl(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}pl.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(pA,{element:t})},pl.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(a){return N0(a,"bpmn:SequenceFlow")}).forEach(function(a){t._animation.createAnimation(a,i,function(){t._eventBus.fire(uA,{element:a.target,processInstanceId:i})})});var r=n.parent,o=this._elementRegistry.filter(function(a){return N0(a,"bpmn:IntermediateCatchEvent")&&a.parent===r});this._eventBus.fire(dA,{elements:o})},pl.$inject=["animation","eventBus","elementRegistry"];var hA=pl,mA=Ge.is,fA=Y.CONSUME_TOKEN_EVENT,vA=Y.GENERATE_TOKEN_EVENT;function dl(e,t){this._animation=e,this._eventBus=t}dl.prototype.consume=function(e){this._eventBus.fire(vA,{element:e})},dl.prototype.generate=function(e){var t=this;e.outgoing.filter(function(n){return mA(n,"bpmn:SequenceFlow")}).forEach(function(n){t._animation.createAnimation(n,function(){t._eventBus.fire(fA,{element:n.target})})})},dl.$inject=["animation","eventBus"];var yA=dl,gA=Ge.is,bA=Y.CONSUME_TOKEN_EVENT,xA=Y.GENERATE_TOKEN_EVENT;function hl(e,t){this._animation=e,this._eventBus=t}hl.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(xA,e),t.tokenCount[n]=0)},hl.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return gA(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(bA,{element:r.target,processInstanceId:i})})})},hl.$inject=["animation","eventBus"];var EA=hl,Qd=Ge.is,wA=Y.CONSUME_TOKEN_EVENT,_A=Y.UPDATE_ELEMENTS_EVENT;function ml(e,t,n,i){this._animation=e,this._eventBus=t,this._elementRegistry=n,this._processInstances=i}ml.prototype.consume=function(){},ml.prototype.generate=function(e){var t=this,n=e.element,i=e.parentProcessInstanceId,r=n.outgoing.filter(function(l){return Qd(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(wA,{element:l.target,processInstanceId:a})})}),!Qd(n.parent,"bpmn:SubProcess")){var c=this._elementRegistry.filter(function(l){return Qd(l,"bpmn:StartEvent")});this._eventBus.fire(_A,{elements:c})}},ml.$inject=["animation","eventBus","elementRegistry","processInstances"];var SA=ml,I0=Ge.is,CA=Y.CONSUME_TOKEN_EVENT,D0=Y.GENERATE_TOKEN_EVENT,B0=Y.UPDATE_ELEMENT_EVENT;function fl(e,t,n){this._animation=e,this._eventBus=t,this._log=n}fl.prototype.consume=function(e){var t=e.element,n=e.processInstanceId,i=t.children.filter(function(r){return I0(r,"bpmn:StartEvent")})[0];i?(this._log.log("Starting Subprocess","info","fa-sign-in"),this._eventBus.fire(D0,{element:i,parentProcessInstanceId:n})):(this._log.log("Skipping Subprocess","info","fa-angle-double-right"),this._eventBus.fire(D0,e)),this._eventBus.fire(B0,{element:t})},fl.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return I0(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(CA,{element:r.target,processInstanceId:i})})}),this._eventBus.fire(B0,{element:n})},fl.$inject=["animation","eventBus","log"];var TA=fl,AA=Ge.is,kA=Y.CONSUME_TOKEN_EVENT,PA=Y.UPDATE_ELEMENT_EVENT;function vl(e,t,n){this._animation=e,this._eventBus=t,this._elementRegistry=n}vl.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(PA,{element:t})},vl.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return AA(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(kA,{element:r.target,processInstanceId:i})})})},vl.$inject=["animation","eventBus","elementRegistry"];var MA=vl,RA=Ge.is,NA=Y.CONSUME_TOKEN_EVENT,IA=Y.GENERATE_TOKEN_EVENT;function yl(e,t){this._animation=e,this._eventBus=t}yl.prototype.consume=function(e){this._eventBus.fire(IA,e)},yl.prototype.generate=function(e){var t=this,n=e.element,i=e.processInstanceId;n.outgoing.filter(function(r){return RA(r,"bpmn:SequenceFlow")}).forEach(function(r){t._animation.createAnimation(r,i,function(){t._eventBus.fire(NA,{element:r.target,processInstanceId:i})})})},yl.$inject=["animation","eventBus"];var DA=iA,BA=aA,OA=lA,jA=hA,LA=yA,VA=EA,FA=SA,$A=TA,zA=MA,GA=yl,UA=Y.GENERATE_TOKEN_EVENT,HA=Y.CONSUME_TOKEN_EVENT;function eh(e,t,n){var i=this;this._injector=n,this.handlers={},this.registerHandler("bpmn:EndEvent",DA),this.registerHandler("bpmn:EventBasedGateway",BA),this.registerHandler("bpmn:ExclusiveGateway",OA),this.registerHandler("bpmn:IntermediateCatchEvent",jA),this.registerHandler("bpmn:IntermediateThrowEvent",LA),this.registerHandler("bpmn:ParallelGateway",VA),this.registerHandler("bpmn:StartEvent",FA),this.registerHandler("bpmn:SubProcess",$A),this.registerHandler("bpmn:BoundaryEvent",zA),this.registerHandler(["bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:Task","bpmn:UserTask"],GA),e.on(UA,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(HA,function(r){var o=r.element;if(!i.handlers[o.type])throw new Error("no handler for type "+o.type);i.handlers[o.type].consume(r)})}eh.prototype.registerHandler=function(e,t){var n=this,i=this._injector.instantiate(t);Array.isArray(e)||(e=[e]),e.forEach(function(r){n.handlers[r]=i})},eh.$inject=["eventBus","animation","injector"];var qA=eh;function O0(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()}})}O0.$inject=["eventBus","toggleMode","pauseSimulation","log","resetSimulation","editorActions"];var WA=O0,KA=Y.TOGGLE_MODE_EVENT;function j0(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){gl(["t","T"],a)?n.trigger("toggleTokenSimulation"):r&&(gl(["l","L"],a)?n.trigger("toggleTokenSimulationLog"):gl([" ","Spacebar"],a)?n.trigger("togglePauseTokenSimulation"):gl(["r","R"],a)&&n.trigger("resetTokenSimulation"))})(o.keyEvent)})}),e.on(KA,function(o){var a=o.simulationModeActive;r=!!a})}}function gl(e,t){return e.indexOf(t.key)>-1}j0.$inject=["eventBus","injector"];var XA=j0,YA=Bt,L0=Fi,JA=Y.TOGGLE_MODE_EVENT;function bl(e,t){var n=this;this._canvas=t,this.entries=[],this._init(),e.on(JA,function(i){i.simulationModeActive?L0(n.container).remove("hidden"):L0(n.container).add("hidden")})}bl.prototype._init=function(){this.container=YA('<div class="token-simulation-palette hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},bl.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})},bl.$inject=["eventBus","canvas"];const ZA=kr({__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",OS],contextPads:["type",mC],disableModeling:["type",vC],elementNotifications:["type",EC],elementSupport:["type",TC],exclusiveGatewaySettings:["type",MC],log:["type",LC],notifications:["type",FC],pauseSimulation:["type",XC],preserveElementColors:["type",JC],processInstanceIds:["type",eT],processInstanceSettings:["type",aT],processInstances:["type",pT],resetSimulation:["type",gT],setAnimationSpeed:["type",ET],showProcessInstance:["type",RT],simulationState:["type",OT],toggleMode:["type",FT],tokenCount:["type",KT],tokenSimulationBehavior:["type",qA],tokenSimulationEditorActions:["type",WA],tokenSimulationKeyboardBindings:["type",XA],tokenSimulationPalette:["type",bl]}),QA={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:"candidateStrategy",isAttr:!0,type:"String"},{name:"candidateParam",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:[]},ek={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:"candidateStrategy",isAttr:!0,type:"String"},{name:"candidateParam",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:[]},tk={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:"candidateStrategy",isAttr:!0,type:"String"},{name:"candidateParam",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:[]},th=Object.prototype.toString,nk=Object.prototype.hasOwnProperty;function V0(e){return th.call(e)==="[object Array]"}function F0(e){const t=th.call(e);return t==="[object Function]"||t==="[object AsyncFunction]"||t==="[object GeneratorFunction]"||t==="[object AsyncGeneratorFunction]"||t==="[object Proxy]"}function ik(e,t){return nk.call(e,t)}function rk(e,t){const n=function(r){return F0(r)?r:o=>o===r}(t);let i;return $0(e,function(r,o){if(n(r,o))return i=r,!1}),i}function $0(e,t){let n,i;if(e===void 0)return;const r=V0(e)?ak:ok;for(let o in e)if(ik(e,o)&&(n=e[o],i=t(n,r(o)),i===!1))return n}function Eo(e,t){return!!rk(e,t)}function ok(e){return e}function ak(e){return Number(e)}function sk(e,...t){return Object.assign(e,...t)}const ck="*";function wo(e){const t=this;e.on("moddleCopy.canCopyProperty",function(n){const i=n.property,r=n.parent;return t.canCopyProperty(i,r)})}function _o(e,t){return e&&F0(e.$instanceOf)&&e.$instanceOf(t)}function z0(e,t){return Eo(t,function(n){return _o(e,n)})}function Cn(e,t){return t?_o(e,t)?e:e.$parent?Cn(e.$parent,t):void 0:e.$parent}wo.$inject=["eventBus"],wo.prototype.canCopyProperty=function(e,t){return n=e,!(th.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(ck)!==-1}(a)?!0:Eo(a,function(c){return Cn(r,c)})}(e,t))&&!(_o(e,"camunda:InputOutput")&&!this.canHostInputOutput(t))&&!(z0(e,["camunda:Connector","camunda:Field"])&&!this.canHostConnector(t))&&!(_o(e,"camunda:In")&&!this.canHostIn(t))&&void 0;var n},wo.prototype.canHostInputOutput=function(e){if(Cn(e,"camunda:Connector"))return!0;const t=Cn(e,"bpmn:FlowNode");return!!t&&!z0(t,["bpmn:StartEvent","bpmn:Gateway","bpmn:BoundaryEvent"])&&!(_o(t,"bpmn:SubProcess")&&t.get("triggeredByEvent"))},wo.prototype.canHostConnector=function(e){return!_o(Cn(e,"camunda:ServiceTaskLike"),"bpmn:MessageEventDefinition")||Cn(e,"bpmn:IntermediateThrowEvent")||Cn(e,"bpmn:EndEvent")},wo.prototype.canHostIn=function(e){return Cn(e,"bpmn:CallActivity")?!0:!Cn(e,"bpmn:SignalEventDefinition")||Cn(e,"bpmn:IntermediateThrowEvent")||Cn(e,"bpmn:EndEvent")};const lk={__init__:["camundaModdleExtension"],camundaModdleExtension:["type",wo]},uk={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function nh(e,t){return e&&typeof e.$instanceOf=="function"&&e.$instanceOf(t)}function ih(e,t){return(n=e)&&n.length&&Eo(e,function(i){return nh(i,t)});var n}function rh(e,t,n){const i=t.name,r=uk[i.replace(/activiti:/,"")];return i===e&&function(o,a){return Eo(a,function(c){return nh(o,c)})}(n,r)}function oh(e){e.on("property.clone",function(t){const n=t.newElement,i=t.propertyDescriptor;this.canCloneProperty(n,i)},this)}oh.$inject=["eventBus"],oh.prototype.canCloneProperty=function(e,t){return rh("activiti:FailedJobRetryTimeCycle",t,e)?ih(e.eventDefinitions,"bpmn:TimerEventDefinition")||ih(e.eventDefinitions,"bpmn:SignalEventDefinition")||nh(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):rh("activiti:Connector",t,e)||rh("activiti:Field",t,e)?ih(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const pk={__init__:["ActivitiModdleExtension"],ActivitiModdleExtension:["type",oh]},dk={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function ah(e,t){return e&&typeof e.$instanceOf=="function"&&e.$instanceOf(t)}function sh(e,t){return(n=e)&&n.length&&Eo(e,function(i){return ah(i,t)});var n}function ch(e,t,n){const i=t.name,r=dk[i.replace(/flowable:/,"")];return i===e&&function(o,a){return Eo(a,function(c){return ah(o,c)})}(n,r)}function lh(e){e.on("property.clone",function(t){const n=t.newElement,i=t.propertyDescriptor;this.canCloneProperty(n,i)},this)}lh.$inject=["eventBus"],lh.prototype.canCloneProperty=function(e,t){return ch("flowable:FailedJobRetryTimeCycle",t,e)?sh(e.eventDefinitions,"bpmn:TimerEventDefinition")||sh(e.eventDefinitions,"bpmn:SignalEventDefinition")||ah(e.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):ch("flowable:Connector",t,e)||ch("flowable:Field",t,e)?sh(e.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const hk={__init__:["FlowableModdleExtension"],FlowableModdleExtension:["type",lh]};var Re,zi,mk=Object.defineProperty,xl=Object.getOwnPropertySymbols,G0=Object.prototype.hasOwnProperty,U0=Object.prototype.propertyIsEnumerable,uh=(e,t,n)=>t in e?mk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H0=(e,t)=>{for(var n in t||(t={}))G0.call(t,n)&&uh(e,n,t[n]);if(xl)for(var n of xl(t))U0.call(t,n)&&uh(e,n,t[n]);return e},Gi=(e,t,n)=>(uh(e,typeof t!="symbol"?t+"":t,n),n);function Tn(e){return e==null}function ph(e){return typeof e=="string"}(zi=Re||(Re={})).Root="Root",zi.Declaration="Declaration",zi.Comment="Comment",zi.DocumentType="DocumentType",zi.Element="Element",zi.Text="Text",zi.Instruction="Instruction",zi.CDATA="CDATA";var cn=class{constructor(e,t=null,n=null){Gi(this,"name"),Gi(this,"type"),Gi(this,"parent"),Gi(this,"children"),Gi(this,"attributes"),Gi(this,"value"),Gi(this,"selfClosing"),Gi(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=H0({},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:Tn(this.value)?void 0:this.value,selfClosing:this.selfClosing||void 0,children:(this.type===Re.Element||this.type===Re.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 Re.Root:r+=this.children&&this.children.length?this.children.map(o=>o.toXmlString(e,t,n)).join(t):"";break;case Re.Element:{if(!this.name)return"";const o=this.prefix?`${this.prefix}:${this.name}`:this.name;r+=`${i}<${o}`;const a=q0(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}</${o}>`:r+=this.selfClosing?" />":`></${o}>`;break}case Re.CDATA:r+=`${i}<![CDATA[${Tn(this.value)?"":this.value}]]>`;break;case Re.Text:r+=Tn(this.value)?"":`${i}${this.value}`;break;case Re.DocumentType:r+=Tn(this.value)?"":`${i}<!DOCTYPE ${this.value}>`;break;case Re.Comment:r+=`${i}<!-- ${Tn(this.value)?"":this.value+" "}-->`;break;case Re.Declaration:if(r+=`${i}<?xml `,!this.attributes||Tn(this.attributes.version))r+='version="1.0" ';else{const o=parseFloat(this.attributes.version);r+=`version="${Number.isNaN(o)?"1.0":o.toFixed(1)}" `}if(this.attributes){const o=((a,c)=>{var l={};for(var u in a)G0.call(a,u)&&c.indexOf(u)<0&&(l[u]=a[u]);if(a!=null&&xl)for(var u of xl(a))c.indexOf(u)<0&&U0.call(a,u)&&(l[u]=a[u]);return l})(this.attributes,["version"]);o&&(r+=q0(o))}r+="?>";break;case Re.Instruction:r+=Tn(this.value)?"":`${i}<?${this.value}?>`}return r}toJSON(){return this.toJsObject()}toString(){return this.toXmlString("","")}};function q0(e){return Object.keys(e).map(t=>{const n=e[t];return Tn(n)?null:function(i){return typeof i=="boolean"}(n)?n?t:null:`${t}="${n}"`}).filter(Boolean).join(" ")}var W0=e=>e,K0={ignoreAttributes:!1,parseNodeValue:!0,trimValues:!0,prefixInName:!1,valueProcessor:W0,attributeProcessor:W0},fk=Object.keys(K0),Er="Tag is not closed.";function vk(e,t={}){const n=e.replace(/\r\n?/g,`
`),i=function(l={}){const u=H0({},l);return fk.forEach(p=>{Tn(u[p])&&(u[p]=K0[p])}),u}(t),r=n.length,o=new cn(Re.Root);let a=o,c="";for(let l=0;l<r;l++){const u=n[l];if(u!=="<")c+=u;else if(n[l+1]==="/"){const p=So(n,">",l,`Element End ${Er}`);let h=n.substring(l+2,p),v="";if(!i.prefixInName){const f=h.indexOf(":");~f&&(v=h.substring(0,f),h=h.substring(f+1))}if(a.prefix!==v||a.name!==h)throw new Error("End Tag is incorrect.");if(c){const f=dh(wr("",Re.Text,c,i));f&&a.addChild(new cn(Re.Text,a,f))}a=a.parent,c="",l=p}else if(n[l+1]==="?"){const p=So(n,"?>",l,`Processing Instruction ${Er}`),h=n.substring(l+2,p-1);if(a)if(h.startsWith("xml ")&&h.includes("version=")&&a.type===Re.Root){const v=new cn(Re.Declaration,a);v.attributes=hh(h.substr(4),Re.Declaration,i),a.addChild(v)}else a.addChild(new cn(Re.Instruction,a,wr("",Re.Instruction,h,i)));l=p}else if(n.substr(l+1,3)==="!--"){const p=So(n,"-->",l,`Comment ${Er}`),h=n.substring(l+4,p-2);a&&a.addChild(new cn(Re.Comment,a,wr("",Re.Comment,h,i))),l=p}else if(n.substr(l+1,8)==="!DOCTYPE"){let p=So(n,">",l,`Document Type ${Er}`),h=n.substring(l+9,p);h.includes("[")&&(p=So(n,"]>",l,`Document Type ${Er}`),h=n.substring(l+9,p)),a&&a.addChild(new cn(Re.DocumentType,a,wr("",Re.DocumentType,h,i))),l=p}else if(n.substr(l+1,8)==="![CDATA["){const p=So(n,"]]>",l,`CDATA Section ${Er}`),h=n.substring(l+9,p-2);if(a&&c){const v=dh(wr("",Re.Text,c,i));v&&a.addChild(new cn(Re.Text,a,v))}a.addChild(new cn(Re.CDATA,a,wr("",Re.CDATA,h,i))),c="",l=p}else{let p="",h="",v=l+1;for(;v<=r;){let x=n[v];if(p)x===p&&(p="");else if(x==='"'||x==="'")p=x;else if(x==="    ")x=" ";else if(x===">")break;h+=x,v++}if(v>r)throw new Error(`Element ${Er}`);h=h.trim();const f=h.indexOf(" ");let y=h,g="";if(~f?(y=h.substr(0,f),h=h.substr(f+1)):h="",!i.prefixInName){const x=y.indexOf(":");~x&&(g=y.substring(0,x),y=y.substring(x+1))}if(a&&c){const x=dh(wr("",Re.Text,c,i));x&&a.addChild(new cn(Re.Text,a,x))}if(h.length&&h.lastIndexOf("/")===h.length-1){y[y.length-1]==="/"?(y=y.substr(0,y.length-1),h=""):h=h.substr(0,h.length-1);const x=new cn(Re.Element,a);x.name=y,x.selfClosing=!0,x.prefix=g,h&&!i.ignoreAttributes&&(x.attributes=hh(h,Re.Element,i)),a.addChild(x)}else{const x=new cn(Re.Element,a);h&&!i.ignoreAttributes&&(x.attributes=hh(h,Re.Element,i)),x.name=y,x.prefix=g,a.addChild(x),a=x}c="",l=v}}return o}function So(e,t,n,i){const r=e.indexOf(t,n);if(!~r)throw new Error(i);return r+t.length-1}function wr(e,t,n,i){return n?(i.trimValues&&(n=n.trim()),X0(i.valueProcessor(n,t,e),i.parseNodeValue)):null}function X0(e,t){return t&&ph(e)?(e=e.trim())==="true"||e!=="false"&&function(n){const i=parseFloat(n);return Number.isNaN(i)?n:i}(e):Tn(e)?null:e}function dh(e){return Tn(e)?"":ph(e)?e:String(e)}var yk=/[^\s=]+\s*(=\s*['"][\s\S]*?['"])?/g;function hh(e,t,n){const i=(e=e.replace(/\r?\n/g," ")).match(yk)||[],r={};for(let o=0;o<i.length;o++){const a=i[o];let[c,l]=a.split("=");c=c.trim(),ph(l)?(l=l.substring(1,l.length-1),n.trimValues&&(l=l.trim()),r[c]=X0(n.attributeProcessor(l,c,t),n.parseNodeValue)):r[c]=!0}return r}const gk={class:"my-process-designer"},bk={class:"my-process-designer__header",style:{"z-index":"999",display:"table-row-group"}},xk={style:{color:"#409eff"}},Ek=De("br",null,null,-1),wk=De("br",null,null,-1),_k=De("br",null,null,-1),Sk={class:"my-process-designer__container"},Ck={class:"hljs"},El=Ze({name:"MyProcessDesigner",__name:"ProcessDesigner",props:{value:String,processId:String,processName:String,formId:Number,translations:{type:Object,default:()=>{}},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=G(),i=G(),r=t,o=e;ko("configGlobal",o);let a=null;const c=G(1),l=G(!1),u=G(!1),p=G(""),h=G("xml"),v=G(!1),f=G(!1),y=Ot(()=>{console.log(o.additionalModel,"additionalModel");const R=[];if(o.onlyCustomizeAddi)return Object.prototype.toString.call(o.additionalModel)=="[object Array]"?o.additionalModel||[]:[o.additionalModel];Object.prototype.toString.call(o.additionalModel)=="[object Array]"?R.push(...o.additionalModel):o.additionalModel&&R.push(o.additionalModel);const I={translate:["value",(N=o.translations||vS,function(L,T){return T=T||{},(L=N[L]||L).replace(/{([^}]+)}/g,function(b,B){let V=T[B];return N[T[B]]!==null&&N[T[B]]!==void 0&&(V=N[T[B]]),V||"{"+B+"}"})})]};var N;return R.push(I),o.simulation&&R.push(ZA),console.log(o.prefix,"props.prefix "),o.prefix==="camunda"&&R.push(lk),o.prefix==="flowable"&&R.push(hk),o.prefix==="activiti"&&R.push(pk),R}),g=Ot(()=>{console.log(o.onlyCustomizeModdle,"props.onlyCustomizeModdle"),console.log(o.moddleExtension,"props.moddleExtension"),console.log(o.prefix,"props.prefix");const R={};if(o.onlyCustomizeModdle)return o.moddleExtension||null;if(o.moddleExtension)for(let I in o.moddleExtension)R[I]=o.moddleExtension[I];return o.prefix==="activiti"&&(R.activiti=ek),o.prefix==="flowable"&&(R.flowable=tk),o.prefix==="camunda"&&(R.camunda=QA),R});console.log(y,"additionalModules()"),console.log(g,"moddleExtensions()");const x=()=>{const R=a.get("eventBus");console.log(R,"EventBus"),o.events.forEach(I=>{R.on(I,function(N){let L=I.replace(/\./g,"-"),T=N?N.element:null;console.log(L,"eventName"),console.log(T,"element"),r("element-click",T,N)})}),R.on("commandStack.changed",async I=>{try{v.value=a.get("commandStack").canRedo(),f.value=a.get("commandStack").canUndo();let{xml:N}=await a.saveXML({format:!0});r("commandStack-changed",I),r("input",N),r("change",N)}catch(N){console.error(`[Process Designer Warn]: ${N.message||N}`)}}),a.on("canvas.viewbox.changed",({viewbox:I})=>{r("canvas-viewbox-changed",{viewbox:I});const{scale:N}=I;c.value=Math.floor(100*N)/100})},E=async R=>{console.log(R,"xml");let I=o.processId||`Process_${new Date().getTime()}`,N=o.processName||`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,L=R||Wb(I,N,o.prefix);try{let{warnings:T}=await a.importXML(L);console.log(T,"warnings"),T&&T.length&&T.forEach(b=>console.warn(b))}catch(T){console.error(`[Process Designer Warn]: ${T.message||T}`)}},_=async R=>{try{if(R==="xml"||R==="bpmn"){const{err:N,xml:L}=await a.saveXML();N&&console.error(`[Process Designer Warn ]: ${N.message||N}`);let{href:T,filename:b}=w(R.toUpperCase(),L);I(T,b)}else{const{err:N,svg:L}=await a.saveSVG();if(N)return console.error(N);let{href:T,filename:b}=w("SVG",L);I(T,b)}}catch(N){console.error(`[Process Designer Warn ]: ${N.message||N}`)}function I(N,L){if(N&&L){let T=document.createElement("a");T.download=L,T.href=N,T.click(),URL.revokeObjectURL(T.href)}}},w=(R,I)=>({filename:`diagram.${R}`,href:`data:application/${R==="svg"?"text/xml":"bpmn20-xml"};charset=UTF-8,${encodeURIComponent(I)}`,data:I}),S=()=>{const R=i.value.files[0],I=new FileReader;I.readAsText(R),I.onload=function(){let N=this.result;E(N)}},D=()=>{u.value=!u.value,console.log(a.get("toggleMode","strict"),"bpmnModeler.get('toggleMode')"),o.simulation&&a.get("toggleMode","strict").toggleMode()},s=R=>{const I=a.get("alignElements"),N=a.get("selection").get();!N||N.length<=1?kx.warning("\u8BF7\u6309\u4F4F Shift \u952E\u9009\u62E9\u591A\u4E2A\u5143\u7D20\u5BF9\u9F50"):Mr.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(()=>{I.trigger(N,R)})},d=()=>{console.log(a.saveXML,"bpmnModeler"),a.saveXML({format:!0}).then(({xml:R})=>{p.value=R,h.value="xml",l.value=!0})},m=()=>{a.saveXML({format:!0}).then(({xml:R})=>{var N;const I=new cn(Re.Root,vk(R));p.value=(N=I.parent)==null?void 0:N.toJSON(),h.value="json",l.value=!0})},C=async()=>{const{err:R,xml:I}=await a.saveXML();R?alert("\u4FDD\u5B58\u6A21\u578B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01"):r("save",I)};return Tx(()=>{console.log(o,"propspropspropsprops")}),Pr(()=>{(()=>{if(a)return;let R=document.getElementById("bpmnCanvas");console.log(R,"data"),console.log(o.keyboard,"props.keyboard"),console.log(y,"additionalModules()"),console.log(g,"moddleExtensions()"),a=new zn({container:R,keyboard:o.keyboard?{bindTo:document}:null,additionalModules:y.value,moddleExtensions:g.value}),r("init-finished",a),x()})(),E(o.value)}),An(()=>{a&&a.destroy(),r("destroy",a),a=null}),(R,I)=>{const N=Ir,L=Ox,T=Px,b=Mx,B=kn,V=jl,H=Ax("highlight");return X(),Ae("div",gk,[De("div",bk,[Qa(R.$slots,"control-header"),R.$slots["control-header"]?we("",!0):(X(),Ae(st,{key:0},[M(b,{key:"file-control"},{default:j(()=>[M(N,{preIcon:"ep:folder-opened",title:"\u6253\u5F00\u6587\u4EF6",onClick:I[0]||(I[0]=q=>P(i).click())}),M(T,{effect:"light",placement:"bottom"},{content:j(()=>[De("div",xk,[M(L,{title:"\u4E0B\u8F7D\u4E3AXML\u6587\u4EF6",onClick:I[1]||(I[1]=q=>{_("xml")})}),Ek,M(L,{title:"\u4E0B\u8F7D\u4E3ASVG\u6587\u4EF6",onClick:I[2]||(I[2]=q=>{_("svg")})}),wk,M(L,{title:"\u4E0B\u8F7D\u4E3ABPMN\u6587\u4EF6",onClick:I[3]||(I[3]=q=>{_("bpmn")})})])]),default:j(()=>[M(N,{title:"\u4E0B\u8F7D\u6587\u4EF6",preIcon:"ep:download"})]),_:1}),M(T,{effect:"light"},{content:j(()=>[M(L,{title:"\u9884\u89C8XML",onClick:d}),_k,M(L,{title:"\u9884\u89C8JSON",onClick:m})]),default:j(()=>[M(N,{preIcon:"ep:view",title:"\u6D4F\u89C8"})]),_:1}),o.simulation?(X(),ue(T,{key:0,effect:"light",content:P(u)?"\u9000\u51FA\u6A21\u62DF":"\u5F00\u542F\u6A21\u62DF"},{default:j(()=>[M(N,{preIcon:"ep:cpu",title:"\u6A21\u62DF",onClick:D})]),_:1},8,["content"])):we("",!0)]),_:1}),M(b,{key:"align-control"},{default:j(()=>[M(T,{effect:"light",content:"\u5411\u5DE6\u5BF9\u9F50"},{default:j(()=>[M(N,{preIcon:"fa:align-left",class:"align align-bottom",onClick:I[4]||(I[4]=q=>s("left"))})]),_:1}),M(T,{effect:"light",content:"\u5411\u53F3\u5BF9\u9F50"},{default:j(()=>[M(N,{preIcon:"fa:align-left",class:"align align-top",onClick:I[5]||(I[5]=q=>s("right"))})]),_:1}),M(T,{effect:"light",content:"\u5411\u4E0A\u5BF9\u9F50"},{default:j(()=>[M(N,{preIcon:"fa:align-left",class:"align align-left",onClick:I[6]||(I[6]=q=>s("top"))})]),_:1}),M(T,{effect:"light",content:"\u5411\u4E0B\u5BF9\u9F50"},{default:j(()=>[M(N,{preIcon:"fa:align-left",class:"align align-right",onClick:I[7]||(I[7]=q=>s("bottom"))})]),_:1}),M(T,{effect:"light",content:"\u6C34\u5E73\u5C45\u4E2D"},{default:j(()=>[M(N,{preIcon:"fa:align-left",class:"align align-center",onClick:I[8]||(I[8]=q=>s("center"))})]),_:1}),M(T,{effect:"light",content:"\u5782\u76F4\u5C45\u4E2D"},{default:j(()=>[M(N,{preIcon:"fa:align-left",class:"align align-middle",onClick:I[9]||(I[9]=q=>s("middle"))})]),_:1})]),_:1}),M(b,{key:"scale-control"},{default:j(()=>[M(T,{effect:"light",content:"\u7F29\u5C0F\u89C6\u56FE"},{default:j(()=>[M(N,{preIcon:"ep:zoom-out",onClick:I[10]||(I[10]=q=>((J=.1)=>{let Q=Math.floor(100*c.value-100*J)/100;if(Q<.2)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");c.value=Q,a.get("canvas").zoom(c.value)})()),disabled:P(c)<.2},null,8,["disabled"])]),_:1}),M(B,null,{default:j(()=>[ve(Vl(Math.floor(10*P(c)*10)+"%"),1)]),_:1}),M(T,{effect:"light",content:"\u653E\u5927\u89C6\u56FE"},{default:j(()=>[M(N,{preIcon:"ep:zoom-in",onClick:I[11]||(I[11]=q=>((J=.1)=>{let Q=Math.floor(100*c.value+100*J)/100;if(Q>4)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");c.value=Q,a.get("canvas").zoom(c.value)})()),disabled:P(c)>4},null,8,["disabled"])]),_:1}),M(T,{effect:"light",content:"\u91CD\u7F6E\u89C6\u56FE\u5E76\u5C45\u4E2D"},{default:j(()=>[M(N,{preIcon:"ep:scale-to-original",onClick:I[12]||(I[12]=q=>(c.value=1,void a.get("canvas").zoom("fit-viewport","auto")))})]),_:1})]),_:1}),M(b,{key:"stack-control"},{default:j(()=>[M(T,{effect:"light",content:"\u64A4\u9500"},{default:j(()=>[M(N,{preIcon:"ep:refresh-left",onClick:I[13]||(I[13]=q=>{a.get("commandStack").undo()}),disabled:!P(f)},null,8,["disabled"])]),_:1}),M(T,{effect:"light",content:"\u6062\u590D"},{default:j(()=>[M(N,{preIcon:"ep:refresh-right",onClick:I[14]||(I[14]=q=>{a.get("commandStack").redo()}),disabled:!P(v)},null,8,["disabled"])]),_:1}),M(T,{effect:"light",content:"\u91CD\u65B0\u7ED8\u5236"},{default:j(()=>[M(N,{preIcon:"ep:refresh",onClick:I[15]||(I[15]=q=>(v.value=!1,f.value=!1,void E(null)))})]),_:1})]),_:1}),M(N,{preIcon:"ep:plus",title:"\u4FDD\u5B58\u6A21\u578B",onClick:C,type:o.headerButtonType,disabled:P(u)},null,8,["type","disabled"])],64)),De("input",{type:"file",id:"files",ref_key:"refFile",ref:i,style:{display:"none"},accept:".xml, .bpmn",onChange:S},null,544)]),De("div",Sk,[De("div",{class:"my-process-designer__canvas",ref_key:"bpmnCanvas",ref:n,id:"bpmnCanvas",style:{width:"1680px",height:"800px"}},null,512)]),M(V,{title:"\u9884\u89C8",modelValue:P(l),"onUpdate:modelValue":I[16]||(I[16]=q=>Mt(l)?l.value=q:null),width:"80%",scroll:!0,"max-height":"600px"},{default:j(()=>[Xi((X(),Ae("div",null,[De("code",Ck,Vl(P(p)),1)])),[[H]])]),_:1},8,["modelValue"])])}}});El.install=function(e){e.component(El.name,El)};const Tk={class:"panel-tab__content"},Ak=Ze({name:"ElementForm",__name:"ElementForm",props:{id:String,type:String},setup(e){const t=e,n=Hn("prefix");Hn("width");const i=G(""),r=G("");G("");const o=G([]);G({}),G({long:"\u957F\u6574\u578B",string:"\u5B57\u7B26\u4E32",boolean:"\u5E03\u5C14\u7C7B",date:"\u65E5\u671F\u7C7B",enum:"\u679A\u4E3E\u7C7B",custom:"\u81EA\u5B9A\u4E49\u7C7B\u578B"}),G(-1),G(-1),G(!1),G(!1),G({}),G(""),G([]),G([]),G([]);const a=G(),c=G(),l=G(),u=G(),p=()=>window==null?void 0:window.bpmnInstances,h=()=>{p().modeling.updateProperties(Be(a.value),{formKey:i.value})},v=()=>{const y=p().moddle.create("bpmn:ExtensionElements",{values:u.value.concat(l.value)});p().modeling.updateProperties(Be(a.value),{extensionElements:y})},f=G([]);return Pr(async()=>{f.value=await jx()}),nt(()=>t.id,y=>{y&&y.length&&Rt(()=>{var g,x;a.value=p().bpmnElement,i.value=a.value.businessObject.formKey,((g=i.value)==null?void 0:g.length)>0&&(i.value=parseInt(i.value)),c.value=a.value.businessObject.get("extensionElements")||p().moddle.create("bpmn:ExtensionElements",{values:[]}),l.value=((x=c.value.values.filter(E=>E.$type===`${n}:FormData`))==null?void 0:x[0])||p().moddle.create(`${n}:FormData`,{fields:[]}),r.value=l.value.businessKey,u.value=c.value.values.filter(E=>E.$type!==`${n}:FormData`),o.value=JSON.parse(JSON.stringify(l.value.fields||[])),v()})},{immediate:!0}),(y,g)=>{const x=hi,E=mi,_=Yt,w=dn;return X(),Ae("div",Tk,[M(w,{"label-width":"80px"},{default:j(()=>[M(_,{label:"\u6D41\u7A0B\u8868\u5355"},{default:j(()=>[M(E,{modelValue:P(i),"onUpdate:modelValue":g[0]||(g[0]=S=>Mt(i)?i.value=S:null),clearable:"",onChange:h},{default:j(()=>[(X(!0),Ae(st,null,Xt(P(f),S=>(X(),ue(x,{key:S.id,label:S.name,value:S.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})])}}}),kk={class:"panel-tab__content"},Pk={key:0},Mk={key:1},Rk=Ze({name:"ElementBaseInfo",__name:"ElementBaseInfo",props:{businessObject:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}}},setup(e){const t=e,n=G({}),i=G(),r=G({}),o=Fl({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 h=Object.create(null);h[p]=r.value[p],n.value={...r.value,...n.value},p==="id"?(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(h,"attrObj"),a().modeling.updateProperties(Be(i.value),h))};return nt(()=>t.businessObject,p=>{var h;p&&(console.log(window,"window"),console.log(i.value,"bpmnElement"),i.value=(h=a())==null?void 0:h.bpmnElement,r.value=i.value.businessObject,n.value.type=i.value.businessObject.$type)}),nt(()=>{var p;return(p=t.model)==null?void 0:p.key},p=>{p&&(c(t.model.key),l(t.model.name))}),An(()=>{i.value=null}),(p,h)=>{const v=hn,f=Yt,y=dn;return X(),Ae("div",kk,[M(y,{"label-width":"90px",model:P(n),rules:P(o)},{default:j(()=>[P(n).type=="bpmn:Process"?(X(),Ae("div",Pk,[M(f,{label:"\u6D41\u7A0B\u6807\u8BC6",prop:"id"},{default:j(()=>[M(v,{modelValue:P(n).id,"onUpdate:modelValue":h[0]||(h[0]=g=>P(n).id=g),placeholder:"\u8BF7\u8F93\u5165\u6D41\u6807\u6807\u8BC6",disabled:P(n).id!==void 0&&P(n).id.length>0,onChange:c},null,8,["modelValue","disabled"])]),_:1}),M(f,{label:"\u6D41\u7A0B\u540D\u79F0",prop:"name"},{default:j(()=>[M(v,{modelValue:P(n).name,"onUpdate:modelValue":h[1]||(h[1]=g=>P(n).name=g),placeholder:"\u8BF7\u8F93\u5165\u6D41\u7A0B\u540D\u79F0",clearable:"",onChange:l},null,8,["modelValue"])]),_:1})])):(X(),Ae("div",Mk,[M(f,{label:"ID"},{default:j(()=>[M(v,{modelValue:P(r).id,"onUpdate:modelValue":h[2]||(h[2]=g=>P(r).id=g),clearable:"",onChange:h[3]||(h[3]=g=>u("id"))},null,8,["modelValue"])]),_:1}),M(f,{label:"\u540D\u79F0"},{default:j(()=>[M(v,{modelValue:P(r).name,"onUpdate:modelValue":h[4]||(h[4]=g=>P(r).name=g),clearable:"",onChange:h[5]||(h[5]=g=>u("name"))},null,8,["modelValue"])]),_:1})]))]),_:1},8,["model","rules"])])}}}),Nk={class:"panel-tab__content"},Ik={class:"element-property input-property"},Dk=De("div",{class:"element-property__label"},"\u5143\u7D20\u6587\u6863\uFF1A",-1),Bk={class:"element-property__value"},Ok=Ze({name:"ElementOtherConfig",__name:"ElementOtherConfig",props:{id:String},setup(e){const t=e,n=G(""),i=G(),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 An(()=>{i.value=null}),nt(()=>t.id,a=>{a&&a.length?Rt(()=>{var l;const c=(l=r().bpmnElement.businessObject)==null?void 0:l.documentation;n.value=c&&c.length?c[0].text:""}):n.value=""},{immediate:!0}),(a,c)=>{const l=hn;return X(),Ae("div",Nk,[De("div",Ik,[Dk,De("div",Bk,[M(l,{type:"textarea",modelValue:P(n),"onUpdate:modelValue":c[0]||(c[0]=u=>Mt(n)?n.value=u:null),resize:"vertical",autosize:{minRows:2,maxRows:4},onInput:o,onBlur:o},null,8,["modelValue"])])])])}}}),jk=Ze({name:"ProcessExpressionDialog",__name:"ProcessExpressionDialog",emits:["success"],setup(e,{expose:t,emit:n}){const i=G(!1),r=G(!0),o=G([]),a=G(0),c=Fl({pageNo:1,pageSize:10,type:"",status:Uh.ENABLE});t({open:p=>{c.pageNo=1,c.type=p,l(),i.value=!0}});const l=async()=>{r.value=!0;try{const p=await qx.getProcessExpressionPage(c);o.value=p.list,a.value=p.total}finally{r.value=!1}},u=n;return(p,h)=>{const v=Rr,f=kn,y=Nr,g=Gh,x=zh,E=jl,_=Vh;return X(),ue(E,{title:"\u8BF7\u9009\u62E9\u8868\u8FBE\u5F0F",modelValue:P(i),"onUpdate:modelValue":h[2]||(h[2]=w=>Mt(i)?i.value=w:null),width:"1024px"},{default:j(()=>[M(x,null,{default:j(()=>[Xi((X(),ue(y,{data:P(o),stripe:!0,"show-overflow-tooltip":!0},{default:j(()=>[M(v,{label:"\u540D\u5B57",align:"center",prop:"name"}),M(v,{label:"\u8868\u8FBE\u5F0F",align:"center",prop:"expression"}),M(v,{label:"\u64CD\u4F5C",align:"center"},{default:j(w=>[M(f,{link:"",type:"primary",onClick:S=>(async D=>{i.value=!1,u("select",D)})(w.row)},{default:j(()=>[ve(" \u9009\u62E9 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[_,P(r)]]),M(g,{total:P(a),page:P(c).pageNo,"onUpdate:page":h[0]||(h[0]=w=>P(c).pageNo=w),limit:P(c).pageSize,"onUpdate:limit":h[1]||(h[1]=w=>P(c).pageSize=w),onPagination:l},null,8,["total","page","limit"])]),_:1})]),_:1},8,["modelValue"])}}}),Lk=Ze({name:"UserTask",__name:"UserTask",props:{id:String,type:String},setup(e){const t=e,n=G({candidateStrategy:void 0,candidateParam:[]}),i=G(),r=()=>window==null?void 0:window.bpmnInstances,o=G([]),a=G(),c=G([]),l=G([]),u=G([]),p=()=>{n.value.candidateParam=[],h()},h=()=>{r().modeling.updateProperties(Be(i.value),{candidateStrategy:n.value.candidateStrategy,candidateParam:n.value.candidateParam.join(",")})},v=G(),f=async()=>{v.value.open()},y=g=>{n.value.candidateParam=[g.expression],h()};return nt(()=>t.id,()=>{i.value=r().bpmnElement,Rt(()=>{(()=>{const g=i.value.businessObject;g&&(g.candidateStrategy!=null?n.value.candidateStrategy=parseInt(g.candidateStrategy):n.value.candidateStrategy=void 0,g.candidateParam&&g.candidateParam.length>0?n.value.candidateStrategy===60?n.value.candidateParam=[g.candidateParam]:n.value.candidateParam=g.candidateParam.split(",").map(x=>+x):n.value.candidateParam=[])})()})},{immediate:!0}),Pr(async()=>{o.value=await $x();const g=await zx();a.value=Vx(g,"id"),c.value=await Gx(),l.value=await Ux(),u.value=await Hx()}),An(()=>{i.value=null}),(g,x)=>{const E=hi,_=mi,w=Yt,S=Lx,D=hn,s=kn,d=dn;return X(),ue(d,{"label-width":"100px"},{default:j(()=>[M(w,{label:"\u89C4\u5219\u7C7B\u578B",prop:"candidateStrategy"},{default:j(()=>[M(_,{modelValue:P(n).candidateStrategy,"onUpdate:modelValue":x[0]||(x[0]=m=>P(n).candidateStrategy=m),clearable:"",style:{width:"100%"},onChange:p},{default:j(()=>[(X(!0),Ae(st,null,Xt(P($l)(P(Po).BPM_TASK_CANDIDATE_STRATEGY),m=>(X(),ue(E,{key:m.value,label:m.label,value:m.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),P(n).candidateStrategy==10?(X(),ue(w,{key:0,label:"\u6307\u5B9A\u89D2\u8272",prop:"candidateParam"},{default:j(()=>[M(_,{modelValue:P(n).candidateParam,"onUpdate:modelValue":x[1]||(x[1]=m=>P(n).candidateParam=m),clearable:"",multiple:"",style:{width:"100%"},onChange:h},{default:j(()=>[(X(!0),Ae(st,null,Xt(P(o),m=>(X(),ue(E,{key:m.id,label:m.name,value:m.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):we("",!0),P(n).candidateStrategy==20||P(n).candidateStrategy==21?(X(),ue(w,{key:1,label:"\u6307\u5B9A\u90E8\u95E8",prop:"candidateParam",span:"24"},{default:j(()=>[M(S,{ref:"treeRef",modelValue:P(n).candidateParam,"onUpdate:modelValue":x[2]||(x[2]=m=>P(n).candidateParam=m),data:P(a),props:P(Fx),"empty-text":"\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u7A0D\u540E",multiple:"","node-key":"id","show-checkbox":"",onChange:h},null,8,["modelValue","data","props"])]),_:1})):we("",!0),P(n).candidateStrategy==22?(X(),ue(w,{key:2,label:"\u6307\u5B9A\u5C97\u4F4D",prop:"candidateParam",span:"24"},{default:j(()=>[M(_,{modelValue:P(n).candidateParam,"onUpdate:modelValue":x[3]||(x[3]=m=>P(n).candidateParam=m),clearable:"",multiple:"",style:{width:"100%"},onChange:h},{default:j(()=>[(X(!0),Ae(st,null,Xt(P(c),m=>(X(),ue(E,{key:m.id,label:m.name,value:m.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):we("",!0),P(n).candidateStrategy==30?(X(),ue(w,{key:3,label:"\u6307\u5B9A\u7528\u6237",prop:"candidateParam",span:"24"},{default:j(()=>[M(_,{modelValue:P(n).candidateParam,"onUpdate:modelValue":x[4]||(x[4]=m=>P(n).candidateParam=m),clearable:"",multiple:"",style:{width:"100%"},onChange:h},{default:j(()=>[(X(!0),Ae(st,null,Xt(P(l),m=>(X(),ue(E,{key:m.id,label:m.nickname,value:m.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):we("",!0),P(n).candidateStrategy===40?(X(),ue(w,{key:4,label:"\u6307\u5B9A\u7528\u6237\u7EC4",prop:"candidateParam"},{default:j(()=>[M(_,{modelValue:P(n).candidateParam,"onUpdate:modelValue":x[5]||(x[5]=m=>P(n).candidateParam=m),clearable:"",multiple:"",style:{width:"100%"},onChange:h},{default:j(()=>[(X(!0),Ae(st,null,Xt(P(u),m=>(X(),ue(E,{key:m.id,label:m.name,value:m.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):we("",!0),P(n).candidateStrategy===60?(X(),ue(w,{key:5,label:"\u6D41\u7A0B\u8868\u8FBE\u5F0F",prop:"candidateParam"},{default:j(()=>[M(D,{type:"textarea",modelValue:P(n).candidateParam[0],"onUpdate:modelValue":x[6]||(x[6]=m=>P(n).candidateParam[0]=m),clearable:"",style:{width:"72%"},onChange:h},null,8,["modelValue"]),M(s,{class:"ml-5px",size:"small",type:"success",onClick:f},{default:j(()=>[ve("\u9009\u62E9\u8868\u8FBE\u5F0F")]),_:1}),M(jk,{ref_key:"processExpressionDialogRef",ref:v,onSelect:y},null,512)]),_:1})):we("",!0)]),_:1})}}}),Vk={style:{"margin-top":"16px"}},Fk=Ze({name:"ScriptTask",__name:"ScriptTask",props:{id:String,type:String},setup(e){const t=e,n=G({scriptFormat:"",script:"",resource:"",resultVariable:""}),i=G({}),r=G(),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 An(()=>{r.value=null}),nt(()=>t.id,()=>{r.value=o().bpmnElement,Rt(()=>{(()=>{var c;for(let l in n.value){let u=((c=r.value)==null?void 0:c.businessObject[l])||n.value[l];i.value[l]=u}i.value.scriptType=i.value.script?"inline":"external"})()})},{immediate:!0}),(c,l)=>{const u=hn,p=Yt,h=hi,v=mi;return X(),Ae("div",Vk,[M(p,{label:"\u811A\u672C\u683C\u5F0F"},{default:j(()=>[M(u,{modelValue:P(i).scriptFormat,"onUpdate:modelValue":l[0]||(l[0]=f=>P(i).scriptFormat=f),clearable:"",onInput:l[1]||(l[1]=f=>a()),onChange:l[2]||(l[2]=f=>a())},null,8,["modelValue"])]),_:1}),M(p,{label:"\u811A\u672C\u7C7B\u578B"},{default:j(()=>[M(v,{modelValue:P(i).scriptType,"onUpdate:modelValue":l[3]||(l[3]=f=>P(i).scriptType=f)},{default:j(()=>[M(h,{label:"\u5185\u8054\u811A\u672C",value:"inline"}),M(h,{label:"\u5916\u90E8\u8D44\u6E90",value:"external"})]),_:1},8,["modelValue"])]),_:1}),Xi(M(p,{label:"\u811A\u672C"},{default:j(()=>[M(u,{modelValue:P(i).script,"onUpdate:modelValue":l[4]||(l[4]=f=>P(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),[[es,P(i).scriptType==="inline"]]),Xi(M(p,{label:"\u8D44\u6E90\u5730\u5740"},{default:j(()=>[M(u,{modelValue:P(i).resource,"onUpdate:modelValue":l[7]||(l[7]=f=>P(i).resource=f),clearable:"",onInput:l[8]||(l[8]=f=>a()),onChange:l[9]||(l[9]=f=>a())},null,8,["modelValue"])]),_:1},512),[[es,P(i).scriptType==="external"]]),M(p,{label:"\u7ED3\u679C\u53D8\u91CF"},{default:j(()=>[M(u,{modelValue:P(i).resultVariable,"onUpdate:modelValue":l[10]||(l[10]=f=>P(i).resultVariable=f),clearable:"",onInput:l[11]||(l[11]=f=>a()),onChange:l[12]||(l[12]=f=>a())},null,8,["modelValue"])]),_:1})])}}}),$k={style:{"margin-top":"16px"}},zk={style:{display:"flex","align-items":"center","justify-content":"space-between","flex-wrap":"nowrap"}},Gk=Ze({name:"ReceiveTask",__name:"ReceiveTask",props:{id:String,type:String},setup(e){const t=e,n=Fh(),i=G(""),r=G({}),o=G({}),a=G(!1),c=G(),l=G(),u=G(),p=()=>window.bpmnInstances,h=()=>{a.value=!0,r.value={}},v=()=>{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 y=p().moddle.create("bpmn:Message",r.value);u.value.push(y),o.value[r.value.id]=r.value.name,l.value[r.value.id]=y,a.value=!1},f=y=>{y==="-1"?p().modeling.updateProperties(Be(c.value),{messageRef:null}):p().modeling.updateProperties(Be(c.value),{messageRef:l.value[y]})};return Pr(()=>{l.value=Object.create(null),u.value=p().modeler.getDefinitions().rootElements,u.value.filter(y=>y.$type==="bpmn:Message").forEach(y=>{l.value[y.id]=y,o.value[y.id]=y.name}),o.value[-1]="\u65E0"}),An(()=>{c.value=null}),nt(()=>t.id,()=>{Rt(()=>{var y,g;c.value=p().bpmnElement,i.value=((g=(y=c.value.businessObject)==null?void 0:y.messageRef)==null?void 0:g.id)||"-1"})},{immediate:!0}),(y,g)=>{const x=hi,E=mi,_=Ir,w=Yt,S=hn,D=dn,s=kn,d=Mo;return X(),Ae("div",$k,[M(w,{label:"\u6D88\u606F\u5B9E\u4F8B"},{default:j(()=>[De("div",zk,[M(E,{modelValue:P(i),"onUpdate:modelValue":g[0]||(g[0]=m=>Mt(i)?i.value=m:null),onChange:f},{default:j(()=>[(X(!0),Ae(st,null,Xt(Object.keys(P(o)),m=>(X(),ue(x,{value:m,label:P(o)[m],key:m},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),M(_,{type:"primary",preIcon:"ep:plus",style:{"margin-left":"8px"},onClick:h})])]),_:1}),M(d,{modelValue:P(a),"onUpdate:modelValue":g[3]||(g[3]=m=>Mt(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:j(()=>[M(s,{size:"small",type:"primary",onClick:v},{default:j(()=>[ve("\u786E \u8BA4")]),_:1})]),default:j(()=>[M(D,{model:P(r),size:"small","label-width":"90px"},{default:j(()=>[M(w,{label:"\u6D88\u606FID"},{default:j(()=>[M(S,{modelValue:P(r).id,"onUpdate:modelValue":g[1]||(g[1]=m=>P(r).id=m),clearable:""},null,8,["modelValue"])]),_:1}),M(w,{label:"\u6D88\u606F\u540D\u79F0"},{default:j(()=>[M(S,{modelValue:P(r).name,"onUpdate:modelValue":g[2]||(g[2]=m=>P(r).name=m),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),Uk={class:"panel-tab__content"},Hk=Ze({name:"ElementTaskConfig",__name:"ElementTask",props:{id:String,type:String},setup(e){const t=e,n=G({asyncAfter:!1,asyncBefore:!1,exclusive:!1}),i=G(),r=G({UserTask:"UserTask",ScriptTask:"ScriptTask",ReceiveTask:"ReceiveTask"}),o=G(),a=()=>window.bpmnInstances,c=()=>{n.value.asyncBefore||n.value.asyncAfter||(n.value.exclusive=!1),a().modeling.updateProperties(a().bpmnElement,{...n.value})};return nt(()=>t.id,()=>{var l,u,p,h,v,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=(h=(p=o.value)==null?void 0:p.businessObject)==null?void 0:h.asyncAfter,n.value.exclusive=(f=(v=o.value)==null?void 0:v.businessObject)==null?void 0:f.exclusive},{immediate:!0}),nt(()=>t.type,()=>{t.type==r.value.UserTask&&(i.value=Lk),t.type==r.value.ScriptTask&&(i.value=Fk),t.type==r.value.ReceiveTask&&(i.value=Gk)},{immediate:!0}),(l,u)=>{const p=$h,h=Yt,v=dn;return X(),Ae("div",Uk,[M(v,{size:"small","label-width":"90px"},{default:j(()=>[M(h,{label:"\u5F02\u6B65\u5EF6\u7EED",style:{display:"none"}},{default:j(()=>[M(p,{modelValue:P(n).asyncBefore,"onUpdate:modelValue":u[0]||(u[0]=f=>P(n).asyncBefore=f),label:"\u5F02\u6B65\u524D",onChange:c},null,8,["modelValue"]),M(p,{modelValue:P(n).asyncAfter,"onUpdate:modelValue":u[1]||(u[1]=f=>P(n).asyncAfter=f),label:"\u5F02\u6B65\u540E",onChange:c},null,8,["modelValue"]),P(n).asyncAfter||P(n).asyncBefore?(X(),ue(p,{key:0,modelValue:P(n).exclusive,"onUpdate:modelValue":u[2]||(u[2]=f=>P(n).exclusive=f),label:"\u6392\u9664",onChange:c},null,8,["modelValue"])):we("",!0)]),_:1}),(X(),ue(Ix(P(i)),Rx(Nx(l.$props)),null,16))]),_:1})])}}}),qk={class:"panel-tab__content"},Wk=Ze({name:"ElementMultiInstance",__name:"ElementMultiInstance",props:{businessObject:Object,type:String},setup(e){const t=e,n=Hn("prefix"),i=G(""),r=G({completionCondition:"",loopCardinality:"",extensionElements:[],asyncAfter:!1,asyncBefore:!1,exclusive:!1}),o=G({}),a=G(null),c=G(null),l=()=>window==null?void 0:window.bpmnInstances,u=x=>{if(x!=="Null"){if(x==="StandardLoop"){const E=l().moddle.create("bpmn:StandardLoopCharacteristics");return l().modeling.updateProperties(Be(a.value),{loopCharacteristics:E}),void(c.value=null)}c.value=x==="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=x=>{let E=null;x&&x.length&&(E=l().moddle.create("bpmn:FormalExpression",{body:x})),l().modeling.updateModdleProperties(Be(a.value),c.value,{loopCardinality:E})},h=x=>{let E=null;x&&x.length&&(E=l().moddle.create("bpmn:FormalExpression",{body:x})),l().modeling.updateModdleProperties(Be(a.value),c.value,{completionCondition:E})},v=x=>{const E=l().moddle.create("bpmn:ExtensionElements",{values:[l().moddle.create(`${n}:FailedJobRetryTimeCycle`,{body:x})]});l().modeling.updateModdleProperties(Be(a.value),c.value,{extensionElements:E})},f=()=>{l().modeling.updateModdleProperties(Be(a.value),c.value,{collection:o.value.collection||null,elementVariable:o.value.elementVariable||null})},y=x=>{const{asyncBefore:E,asyncAfter:_}=o.value;let w=Object.create(null);E||_?w[x]=o.value[x]:(o.value.exclusive=!1,w={asyncBefore:!1,asyncAfter:!1,exclusive:!1,extensionElements:null}),l().modeling.updateModdleProperties(Be(a.value),c.value,w)},g=x=>{x==="\u4F9D\u6B21\u5BA1\u6279"?(u("SequentialMultiInstance"),p("1"),h("${ nrOfCompletedInstances >= nrOfInstances }")):x==="\u4F1A\u7B7E"?(u("ParallelMultiInstance"),h("${ nrOfCompletedInstances >= nrOfInstances }")):x==="\u6216\u7B7E"&&(u("ParallelMultiInstance"),h("${ nrOfCompletedInstances > 0 }"))};return An(()=>{c.value=null,a.value=null}),nt(()=>t.businessObject,x=>{var _,w,S,D;var E;a.value=l().bpmnElement,(E=x).loopCharacteristics?E.loopCharacteristics.$type==="bpmn:StandardLoopCharacteristics"?(i.value="StandardLoop",o.value={}):(E.loopCharacteristics.isSequential?i.value="SequentialMultiInstance":i.value="ParallelMultiInstance",o.value={...r.value,...E.loopCharacteristics,completionCondition:((w=(_=E.loopCharacteristics)==null?void 0:_.completionCondition)==null?void 0:w.body)??"",loopCardinality:((D=(S=E.loopCharacteristics)==null?void 0:S.loopCardinality)==null?void 0:D.body)??""},c.value=l().bpmnElement.businessObject.loopCharacteristics,E.loopCharacteristics.extensionElements&&E.loopCharacteristics.extensionElements.values&&E.loopCharacteristics.extensionElements.values.length&&(o.value.timeCycle=E.loopCharacteristics.extensionElements.values[0].body)):(i.value="Null",o.value={})},{immediate:!0}),(x,E)=>{const _=kn,w=Yt,S=hi,D=mi,s=hn,d=$h,m=dn;return X(),Ae("div",qk,[M(m,{"label-width":"90px"},{default:j(()=>[M(w,{label:"\u5FEB\u6377\u914D\u7F6E"},{default:j(()=>[M(_,{size:"small",onClick:E[0]||(E[0]=C=>g("\u4F9D\u6B21\u5BA1\u6279"))},{default:j(()=>[ve("\u4F9D\u6B21\u5BA1\u6279")]),_:1}),M(_,{size:"small",onClick:E[1]||(E[1]=C=>g("\u4F1A\u7B7E"))},{default:j(()=>[ve("\u4F1A\u7B7E")]),_:1}),M(_,{size:"small",onClick:E[2]||(E[2]=C=>g("\u6216\u7B7E"))},{default:j(()=>[ve("\u6216\u7B7E")]),_:1})]),_:1}),M(w,{label:"\u4F1A\u7B7E\u7C7B\u578B"},{default:j(()=>[M(D,{modelValue:P(i),"onUpdate:modelValue":E[3]||(E[3]=C=>Mt(i)?i.value=C:null),onChange:u},{default:j(()=>[M(S,{label:"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6",value:"ParallelMultiInstance"}),M(S,{label:"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",value:"SequentialMultiInstance"}),M(S,{label:"\u65E0",value:"Null"})]),_:1},8,["modelValue"])]),_:1}),P(i)==="ParallelMultiInstance"||P(i)==="SequentialMultiInstance"?(X(),Ae(st,{key:0},[M(w,{label:"\u5FAA\u73AF\u6570\u91CF",key:"loopCardinality"},{default:j(()=>[M(s,{modelValue:P(o).loopCardinality,"onUpdate:modelValue":E[4]||(E[4]=C=>P(o).loopCardinality=C),clearable:"",onChange:p},null,8,["modelValue"])]),_:1}),Xi(M(w,{label:"\u96C6\u5408",key:"collection"},{default:j(()=>[M(s,{modelValue:P(o).collection,"onUpdate:modelValue":E[5]||(E[5]=C=>P(o).collection=C),clearable:"",onChange:f},null,8,["modelValue"])]),_:1},512),[[es,!1]]),M(w,{label:"\u5143\u7D20\u53D8\u91CF",key:"elementVariable",style:{display:"none"}},{default:j(()=>[M(s,{modelValue:P(o).elementVariable,"onUpdate:modelValue":E[6]||(E[6]=C=>P(o).elementVariable=C),clearable:"",onChange:f},null,8,["modelValue"])]),_:1}),M(w,{label:"\u5B8C\u6210\u6761\u4EF6",key:"completionCondition"},{default:j(()=>[M(s,{modelValue:P(o).completionCondition,"onUpdate:modelValue":E[7]||(E[7]=C=>P(o).completionCondition=C),clearable:"",onChange:h},null,8,["modelValue"])]),_:1}),M(w,{label:"\u5F02\u6B65\u72B6\u6001",key:"async",style:{display:"none"}},{default:j(()=>[M(d,{modelValue:P(o).asyncBefore,"onUpdate:modelValue":E[8]||(E[8]=C=>P(o).asyncBefore=C),label:"\u5F02\u6B65\u524D",onChange:E[9]||(E[9]=C=>y("asyncBefore"))},null,8,["modelValue"]),M(d,{modelValue:P(o).asyncAfter,"onUpdate:modelValue":E[10]||(E[10]=C=>P(o).asyncAfter=C),label:"\u5F02\u6B65\u540E",onChange:E[11]||(E[11]=C=>y("asyncAfter"))},null,8,["modelValue"]),P(o).asyncAfter||P(o).asyncBefore?(X(),ue(d,{key:0,modelValue:P(o).exclusive,"onUpdate:modelValue":E[12]||(E[12]=C=>P(o).exclusive=C),label:"\u6392\u9664",onChange:E[13]||(E[13]=C=>y("exclusive"))},null,8,["modelValue"])):we("",!0)]),_:1}),P(o).asyncAfter||P(o).asyncBefore?(X(),ue(w,{label:"\u91CD\u8BD5\u5468\u671F",prop:"timeCycle",key:"timeCycle"},{default:j(()=>[M(s,{modelValue:P(o).timeCycle,"onUpdate:modelValue":E[14]||(E[14]=C=>P(o).timeCycle=C),clearable:"",onChange:v},null,8,["modelValue"])]),_:1})):we("",!0)],64)):we("",!0)]),_:1})])}}}),Kk={class:"panel-tab__content"},Xk=Ze({name:"FlowCondition",__name:"FlowCondition",props:{businessObject:Object,type:String},setup(e){const t=e,n=G({}),i=G(),r=G(),o=G(),a=G(),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:Be(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:h,scriptType:v,body:f,resource:y,language:g}=n.value;h==="expression"?p=c().moddle.create("bpmn:FormalExpression",{body:f}):v==="inlineScript"?(p=c().moddle.create("bpmn:FormalExpression",{body:f,language:g}),n.value.resource=""):(n.value.body="",p=c().moddle.create("bpmn:FormalExpression",{resource:y,language:g})),c().modeling.updateProperties(Be(i.value),{conditionExpression:p})};return An(()=>{i.value=null,r.value=null,o.value=null}),nt(()=>t.businessObject,p=>{console.log(p,"val"),Rt(()=>{(()=>{if(i.value=c().bpmnElement,r.value=i.value.source,o.value=i.value.businessObject.sourceRef,n.value={type:"default"},o.value&&o.value.default&&o.value.default.id===i.value.id)n.value={type:"default"};else if(i.value.businessObject.conditionExpression){const h=i.value.businessObject.conditionExpression;if(n.value={...h,type:"condition"},n.value.resource)return n.value.conditionType="script",void(n.value.scriptType="externalScript");if(h.language)return n.value.conditionType="script",void(n.value.scriptType="inlineScript");n.value.conditionType="expression"}else n.value={type:"normal"}})()})},{immediate:!0}),(p,h)=>{const v=hi,f=mi,y=Yt,g=hn,x=dn;return X(),Ae("div",Kk,[M(x,{model:P(n),"label-width":"90px",size:"small"},{default:j(()=>[M(y,{label:"\u6D41\u8F6C\u7C7B\u578B"},{default:j(()=>[M(f,{modelValue:P(n).type,"onUpdate:modelValue":h[0]||(h[0]=E=>P(n).type=E),onChange:l},{default:j(()=>[M(v,{label:"\u666E\u901A\u6D41\u8F6C\u8DEF\u5F84",value:"normal"}),M(v,{label:"\u9ED8\u8BA4\u6D41\u8F6C\u8DEF\u5F84",value:"default"}),M(v,{label:"\u6761\u4EF6\u6D41\u8F6C\u8DEF\u5F84",value:"condition"})]),_:1},8,["modelValue"])]),_:1}),P(n).type==="condition"?(X(),ue(y,{label:"\u6761\u4EF6\u683C\u5F0F",key:"condition"},{default:j(()=>[M(f,{modelValue:P(n).conditionType,"onUpdate:modelValue":h[1]||(h[1]=E=>P(n).conditionType=E)},{default:j(()=>[M(v,{label:"\u8868\u8FBE\u5F0F",value:"expression"}),M(v,{label:"\u811A\u672C",value:"script"})]),_:1},8,["modelValue"])]),_:1})):we("",!0),P(n).conditionType&&P(n).conditionType==="expression"?(X(),ue(y,{label:"\u8868\u8FBE\u5F0F",key:"express"},{default:j(()=>[M(g,{modelValue:P(n).body,"onUpdate:modelValue":h[2]||(h[2]=E=>P(n).body=E),style:{width:"192px"},clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):we("",!0),P(n).conditionType&&P(n).conditionType==="script"?(X(),Ae(st,{key:2},[M(y,{label:"\u811A\u672C\u8BED\u8A00",key:"language"},{default:j(()=>[M(g,{modelValue:P(n).language,"onUpdate:modelValue":h[3]||(h[3]=E=>P(n).language=E),clearable:"",onChange:u},null,8,["modelValue"])]),_:1}),M(y,{label:"\u811A\u672C\u7C7B\u578B",key:"scriptType"},{default:j(()=>[M(f,{modelValue:P(n).scriptType,"onUpdate:modelValue":h[4]||(h[4]=E=>P(n).scriptType=E)},{default:j(()=>[M(v,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),M(v,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),P(n).scriptType==="inlineScript"?(X(),ue(y,{label:"\u811A\u672C",key:"body"},{default:j(()=>[M(g,{modelValue:P(n).body,"onUpdate:modelValue":h[5]||(h[5]=E=>P(n).body=E),type:"textarea",clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):we("",!0),P(n).scriptType==="externalScript"?(X(),ue(y,{label:"\u8D44\u6E90\u5730\u5740",key:"resource"},{default:j(()=>[M(g,{modelValue:P(n).resource,"onUpdate:modelValue":h[6]||(h[6]=E=>P(n).resource=E),clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):we("",!0)],64)):we("",!0)]),_:1},8,["model"])])}}}),Yk={class:"panel-tab__content"},Jk={class:"panel-tab__content--title"},Zk={class:"panel-tab__content--title",style:{"padding-top":"8px","margin-top":"8px","border-top":"1px solid #eee"}},Qk=Ze({name:"SignalAndMassage",__name:"SignalAndMessage",setup(e){const t=Fh(),n=G([]),i=G([]),r=G(!1),o=G(""),a=G({}),c=G(),l=G(),u=G(),p=Ot(()=>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"}),h=()=>window==null?void 0:window.bpmnInstances,v=()=>{console.log(window,"window"),c.value=h().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},y=()=>{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=h().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=h().moddle.create("bpmn:Signal",a.value);c.value.push(g)}r.value=!1,v()};return Pr(()=>{v()}),(g,x)=>{const E=ts,_=Ir,w=Rr,S=Nr,D=hn,s=Yt,d=dn,m=kn,C=Mo;return X(),Ae("div",Yk,[De("div",Jk,[De("span",null,[M(E,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),ve("\u6D88\u606F\u5217\u8868")]),M(_,{type:"primary",title:"\u521B\u5EFA\u65B0\u6D88\u606F",preIcon:"ep:plus",onClick:x[0]||(x[0]=R=>f("message"))})]),M(S,{data:P(i),border:""},{default:j(()=>[M(w,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),M(w,{label:"\u6D88\u606FID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),M(w,{label:"\u6D88\u606F\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),De("div",Zk,[De("span",null,[M(E,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),ve("\u4FE1\u53F7\u5217\u8868")]),M(_,{type:"primary",title:"\u521B\u5EFA\u65B0\u4FE1\u53F7",preIcon:"ep:plus",onClick:x[1]||(x[1]=R=>f("signal"))})]),M(S,{data:P(n),border:""},{default:j(()=>[M(w,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),M(w,{label:"\u4FE1\u53F7ID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),M(w,{label:"\u4FE1\u53F7\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),M(C,{modelValue:P(r),"onUpdate:modelValue":x[5]||(x[5]=R=>Mt(r)?r.value=R:null),title:P(p).title,"close-on-click-modal":!1,width:"400px","append-to-body":"","destroy-on-close":""},{footer:j(()=>[M(m,{onClick:x[4]||(x[4]=R=>r.value=!1)},{default:j(()=>[ve("\u53D6 \u6D88")]),_:1}),M(m,{type:"primary",onClick:y},{default:j(()=>[ve("\u4FDD \u5B58")]),_:1})]),default:j(()=>[M(d,{model:P(a),"label-width":"90px"},{default:j(()=>[M(s,{label:P(p).idLabel},{default:j(()=>[M(D,{modelValue:P(a).id,"onUpdate:modelValue":x[2]||(x[2]=R=>P(a).id=R),clearable:""},null,8,["modelValue"])]),_:1},8,["label"]),M(s,{label:P(p).nameLabel},{default:j(()=>[M(D,{modelValue:P(a).name,"onUpdate:modelValue":x[3]||(x[3]=R=>P(a).name=R),clearable:""},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["modelValue","title"])])}}}),_r=()=>window==null?void 0:window.bpmnInstances;function wl(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 _r().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,h=l==="string"?{name:c,string:u}:{name:c,expression:p};return _r().moddle.create(`${a}:Field`,h)}(r,n))),t&&e.event==="timeout"&&e.eventDefinitionType){const r=_r().moddle.create("bpmn:FormalExpression",{body:e.eventTimeDefinitions}),o=_r().moddle.create("bpmn:TimerEventDefinition",{id:`TimerEventDefinition_${eP(8)}`,[`time${e.eventDefinitionType.replace(/^\S/,a=>a.toUpperCase())}`]:r});i.eventDefinitions=[o]}return _r().moddle.create(`${n}:${t?"TaskListener":"ExecutionListener"}`,i)}function Co(e,t){const n=_r().moddle.create("bpmn:ExtensionElements",{values:t});_r().modeling.updateProperties(Be(e),{extensionElements:n})}function eP(e=8,t){let n="";const i="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=e;r>0;--r)n+=i[Math.floor(62*Math.random())];return n}function Y0(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 J0(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}}function Z0(e){if(e.valueType==="class")return{listenerType:"classListener",class:e.value,event:e.event,fields:[]};if(e.valueType==="expression")return{listenerType:"expressionListener",expression:e.value,event:e.event,fields:[]};if(e.valueType==="delegateExpression")return{listenerType:"delegateExpressionListener",delegateExpression:e.value,event:e.event,fields:[]};throw new Error("\u672A\u77E5\u7684\u76D1\u542C\u5668\u7C7B\u578B")}const Q0={classListener:"Java \u7C7B",expressionListener:"\u8868\u8FBE\u5F0F",delegateExpressionListener:"\u4EE3\u7406\u8868\u8FBE\u5F0F",scriptListener:"\u811A\u672C"},tP={create:"\u521B\u5EFA",assignment:"\u6307\u6D3E",complete:"\u5B8C\u6210",delete:"\u5220\u9664",update:"\u66F4\u65B0",timeout:"\u8D85\u65F6"},ex={string:"\u5B57\u7B26\u4E32",expression:"\u8868\u8FBE\u5F0F"},tx=Ze({name:"ProcessListenerDialog",__name:"ProcessListenerDialog",emits:["success"],setup(e,{expose:t,emit:n}){const i=G(!1),r=G(!0),o=G([]),a=G(0),c=Fl({pageNo:1,pageSize:10,type:"",status:Uh.ENABLE});t({open:async p=>{c.pageNo=1,c.type=p,l(),i.value=!0}});const l=async()=>{r.value=!0;try{const p=await Kx.getProcessListenerPage(c);o.value=p.list,a.value=p.total}finally{r.value=!1}},u=n;return(p,h)=>{const v=Rr,f=Wx,y=kn,g=Nr,x=Gh,E=zh,_=jl,w=Vh;return X(),ue(_,{title:"\u8BF7\u9009\u62E9\u76D1\u542C\u5668",modelValue:P(i),"onUpdate:modelValue":h[2]||(h[2]=S=>Mt(i)?i.value=S:null),width:"1024px"},{default:j(()=>[M(E,null,{default:j(()=>[Xi((X(),ue(g,{data:P(o),stripe:!0,"show-overflow-tooltip":!0},{default:j(()=>[M(v,{label:"\u540D\u5B57",align:"center",prop:"name"}),M(v,{label:"\u7C7B\u578B",align:"center",prop:"type"},{default:j(S=>[M(f,{type:P(Po).BPM_PROCESS_LISTENER_TYPE,value:S.row.type},null,8,["type","value"])]),_:1}),M(v,{label:"\u4E8B\u4EF6",align:"center",prop:"event"}),M(v,{label:"\u503C\u7C7B\u578B",align:"center",prop:"valueType"},{default:j(S=>[M(f,{type:P(Po).BPM_PROCESS_LISTENER_VALUE_TYPE,value:S.row.valueType},null,8,["type","value"])]),_:1}),M(v,{label:"\u503C",align:"center",prop:"value"}),M(v,{label:"\u64CD\u4F5C",align:"center"},{default:j(S=>[M(y,{link:"",type:"primary",onClick:D=>(async s=>{i.value=!1,u("select",s)})(S.row)},{default:j(()=>[ve(" \u9009\u62E9 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[w,P(r)]]),M(x,{total:P(a),page:P(c).pageNo,"onUpdate:page":h[0]||(h[0]=S=>P(c).pageNo=S),limit:P(c).pageSize,"onUpdate:limit":h[1]||(h[1]=S=>P(c).pageSize=S),onPagination:l},null,8,["total","page","limit"])]),_:1})]),_:1},8,["modelValue"])}}}),nP={class:"panel-tab__content"},iP={class:"element-drawer__button"},rP={class:"listener-filed__title"},oP={class:"element-drawer__button"},aP=Ze({name:"ElementListeners",__name:"ElementListeners",props:{id:String,type:String},setup(e){const t=e,n=Hn("prefix"),i=Hn("width"),r=G([]),o=G({}),a=G(!1),c=G([]),l=G({}),u=G(!1),p=G(-1),h=G(-1),v=G(Q0),f=G(ex),y=G(),g=G(),x=G(),E=G(),_=G(),w=()=>{var I,N,L;y.value=(window==null?void 0:window.bpmnInstances).bpmnElement,g.value=[],x.value=((L=(N=(I=y.value.businessObject)==null?void 0:I.extensionElements)==null?void 0:N.values)==null?void 0:L.filter(T=>T.$type===`${n}:ExecutionListener`))??[],r.value=x.value.map(T=>J0(T))},S=(I,N)=>{I?(o.value=Y0(I),p.value=N):(o.value={},p.value=-1),I&&I.fields?c.value=I.fields.map(L=>({...L,fieldType:L.string?"string":"expression"})):(c.value=[],o.value.fields=[]),a.value=!0,Rt(()=>{E.value&&E.value.clearValidate()})},D=(I,N)=>{l.value=I?JSON.parse(JSON.stringify(I)):{},h.value=I?N:-1,u.value=!0,Rt(()=>{_.value&&_.value.clearValidate()})},s=async()=>{await _.value.validate()&&(h.value===-1?(c.value.push(l.value),o.value.fields.push(l.value)):(c.value.splice(h.value,1,l.value),o.value.fields.splice(h.value,1,l.value)),u.value=!1,Rt(()=>{l.value={}}))},d=async()=>{var N,L,T;if(!await E.value.validate())return;const I=wl(o.value,!1,n);p.value===-1?(x.value.push(I),r.value.push(o.value)):(x.value.splice(p.value,1,I),r.value.splice(p.value,1,o.value)),g.value=((T=(L=(N=y.value.businessObject)==null?void 0:N.extensionElements)==null?void 0:L.values)==null?void 0:T.filter(b=>b.$type!==`${n}:ExecutionListener`))??[],Co(y.value,g.value.concat(x.value)),a.value=!1,o.value={}},m=G(),C=async()=>{m.value.open("execution")},R=I=>{var T,b,B;const N=Z0(I),L=wl(N,!1,n);x.value.push(L),r.value.push(N),g.value=((B=(b=(T=y.value.businessObject)==null?void 0:T.extensionElements)==null?void 0:b.values)==null?void 0:B.filter(V=>V.$type!==`${n}:ExecutionListener`))??[],Co(y.value,g.value.concat(x.value))};return nt(()=>t.id,I=>{I&&I.length&&Rt(()=>{w()})},{immediate:!0}),(I,N)=>{const L=Rr,T=kn,b=zl,B=Nr,V=Ir,H=hi,q=mi,J=Yt,Q=hn,oe=dn,ie=ts,he=Hh,Ne=Mo;return X(),Ae(st,null,[De("div",nP,[M(B,{data:P(r),size:"small",border:""},{default:j(()=>[M(L,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),M(L,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"100px",prop:"event"}),M(L,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"100px","show-overflow-tooltip":"",formatter:ee=>P(v)[ee.listenerType]},null,8,["formatter"]),M(L,{label:"\u64CD\u4F5C",width:"100px"},{default:j(ee=>[M(T,{size:"small",link:"",onClick:Z=>S(ee.row,ee.$index)},{default:j(()=>[ve("\u7F16\u8F91")]),_:2},1032,["onClick"]),M(b,{direction:"vertical"}),M(T,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:Z=>(_e=>{Mr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{x.value.splice(_e,1),r.value.splice(_e,1),Co(y.value,g.value.concat(x.value))}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(ee.$index)},{default:j(()=>[ve("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),De("div",iP,[M(V,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",size:"small",onClick:N[0]||(N[0]=ee=>S(null))}),M(V,{type:"success",preIcon:"ep:select",title:"\u9009\u62E9\u76D1\u542C\u5668",size:"small",onClick:C})]),M(he,{modelValue:P(a),"onUpdate:modelValue":N[12]||(N[12]=ee=>Mt(a)?a.value=ee:null),title:"\u6267\u884C\u76D1\u542C\u5668",size:`${P(i)}px`,"append-to-body":"","destroy-on-close":""},{default:j(()=>[M(oe,{model:P(o),"label-width":"96px",ref_key:"listenerFormRef",ref:E},{default:j(()=>[M(J,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(q,{modelValue:P(o).event,"onUpdate:modelValue":N[1]||(N[1]=ee=>P(o).event=ee)},{default:j(()=>[M(H,{label:"start",value:"start"}),M(H,{label:"end",value:"end"})]),_:1},8,["modelValue"])]),_:1}),M(J,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(q,{modelValue:P(o).listenerType,"onUpdate:modelValue":N[2]||(N[2]=ee=>P(o).listenerType=ee)},{default:j(()=>[(X(!0),Ae(st,null,Xt(Object.keys(P(v)),ee=>(X(),ue(H,{key:ee,label:P(v)[ee],value:ee},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),P(o).listenerType==="classListener"?(X(),ue(J,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(Q,{modelValue:P(o).class,"onUpdate:modelValue":N[3]||(N[3]=ee=>P(o).class=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(o).listenerType==="expressionListener"?(X(),ue(J,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(Q,{modelValue:P(o).expression,"onUpdate:modelValue":N[4]||(N[4]=ee=>P(o).expression=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(o).listenerType==="delegateExpressionListener"?(X(),ue(J,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(Q,{modelValue:P(o).delegateExpression,"onUpdate:modelValue":N[5]||(N[5]=ee=>P(o).delegateExpression=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(o).listenerType==="scriptListener"?(X(),Ae(st,{key:3},[M(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:j(()=>[M(Q,{modelValue:P(o).scriptFormat,"onUpdate:modelValue":N[6]||(N[6]=ee=>P(o).scriptFormat=ee),clearable:""},null,8,["modelValue"])]),_:1}),M(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:j(()=>[M(q,{modelValue:P(o).scriptType,"onUpdate:modelValue":N[7]||(N[7]=ee=>P(o).scriptType=ee)},{default:j(()=>[M(H,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),M(H,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),P(o).scriptType==="inlineScript"?(X(),ue(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:j(()=>[M(Q,{modelValue:P(o).value,"onUpdate:modelValue":N[8]||(N[8]=ee=>P(o).value=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(o).scriptType==="externalScript"?(X(),ue(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:j(()=>[M(Q,{modelValue:P(o).resource,"onUpdate:modelValue":N[9]||(N[9]=ee=>P(o).resource=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0)],64)):we("",!0)]),_:1},8,["model"]),M(b),De("p",rP,[De("span",null,[M(ie,{icon:"ep:menu"}),ve("\u6CE8\u5165\u5B57\u6BB5\uFF1A")]),M(V,{type:"primary",onClick:N[10]||(N[10]=ee=>D(null)),title:"\u6DFB\u52A0\u5B57\u6BB5"})]),M(B,{data:P(c),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:j(()=>[M(L,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),M(L,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),M(L,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:ee=>P(f)[ee.fieldType]},null,8,["formatter"]),M(L,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:ee=>ee.string||ee.expression},null,8,["formatter"]),M(L,{label:"\u64CD\u4F5C",width:"130px"},{default:j(ee=>[M(T,{size:"small",link:"",onClick:Z=>D(ee.row,ee.$index)},{default:j(()=>[ve("\u7F16\u8F91")]),_:2},1032,["onClick"]),M(b,{direction:"vertical"}),M(T,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:Z=>(_e=>{Mr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{c.value.splice(_e,1),o.value.fields.splice(_e,1)}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(ee.$index)},{default:j(()=>[ve("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),De("div",oP,[M(T,{onClick:N[11]||(N[11]=ee=>a.value=!1)},{default:j(()=>[ve("\u53D6 \u6D88")]),_:1}),M(T,{type:"primary",onClick:d},{default:j(()=>[ve("\u4FDD \u5B58")]),_:1})])]),_:1},8,["modelValue","size"]),M(Ne,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:P(u),"onUpdate:modelValue":N[18]||(N[18]=ee=>Mt(u)?u.value=ee:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:j(()=>[M(T,{size:"small",onClick:N[17]||(N[17]=ee=>u.value=!1)},{default:j(()=>[ve("\u53D6 \u6D88")]),_:1}),M(T,{size:"small",type:"primary",onClick:s},{default:j(()=>[ve("\u786E \u5B9A")]),_:1})]),default:j(()=>[M(oe,{model:P(l),"label-width":"96spx",ref_key:"listenerFieldFormRef",ref:_,style:{height:"136px"}},{default:j(()=>[M(J,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(Q,{modelValue:P(l).name,"onUpdate:modelValue":N[13]||(N[13]=ee=>P(l).name=ee),clearable:""},null,8,["modelValue"])]),_:1}),M(J,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(q,{modelValue:P(l).fieldType,"onUpdate:modelValue":N[14]||(N[14]=ee=>P(l).fieldType=ee)},{default:j(()=>[(X(!0),Ae(st,null,Xt(Object.keys(P(f)),ee=>(X(),ue(H,{key:ee,label:P(f)[ee],value:ee},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),P(l).fieldType==="string"?(X(),ue(J,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(Q,{modelValue:P(l).string,"onUpdate:modelValue":N[15]||(N[15]=ee=>P(l).string=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(l).fieldType==="expression"?(X(),ue(J,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(Q,{modelValue:P(l).expression,"onUpdate:modelValue":N[16]||(N[16]=ee=>P(l).expression=ee),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])]),M(tx,{ref_key:"processListenerDialogRef",ref:m,onSelect:R},null,512)],64)}}}),sP={class:"panel-tab__content"},cP={class:"element-drawer__button"},lP=Ze({name:"ElementProperties",__name:"ElementProperties",props:{id:String,type:String},setup(e){const t=e,n=Hn("prefix"),i=G([]),r=G({}),o=G(-1),a=G(!1),c=G(),l=G(),u=G(),p=G(),h=G(),v=()=>window==null?void 0:window.bpmnInstances,f=()=>{var E,_;console.log(window,"windowwindowwindowwindowwindowwindowwindow"),c.value=v().bpmnElement,l.value=[],u.value=((_=(E=c.value.businessObject)==null?void 0:E.extensionElements)==null?void 0:_.values.filter(w=>(w.$type!==`${n}:Properties`&&l.value.push(w),w.$type===`${n}:Properties`)))??[],p.value=u.value.reduce((w,S)=>w.concat(S.values),[]),i.value=JSON.parse(JSON.stringify(p.value??[]))},y=(E,_)=>{o.value=_,r.value=_===-1?{}:JSON.parse(JSON.stringify(E)),a.value=!0,Rt(()=>{h.value&&h.value.clearValidate()})},g=()=>{console.log(r.value,"propertyForm.value");const{name:E,value:_}=r.value;if(o.value!==-1)v().modeling.updateModdleProperties(Be(c.value),Be(p.value)[Be(o.value)],{name:E,value:_});else{const w=v().moddle.create(`${n}:Property`,{name:E,value:_}),S=v().moddle.create(`${n}:Properties`,{values:p.value.concat([w])});x(S)}a.value=!1,f()},x=E=>{const _=v().moddle.create("bpmn:ExtensionElements",{values:l.value.concat([E])});v().modeling.updateProperties(Be(c.value),{extensionElements:_})};return nt(()=>t.id,E=>{E&&E&&E.length&&f()},{immediate:!0}),(E,_)=>{const w=Rr,S=kn,D=zl,s=Nr,d=Ir,m=hn,C=Yt,R=dn,I=Mo;return X(),Ae("div",sP,[M(s,{data:P(i),"max-height":"240",fit:"",border:""},{default:j(()=>[M(w,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),M(w,{label:"\u5C5E\u6027\u540D",prop:"name","min-width":"100px","show-overflow-tooltip":""}),M(w,{label:"\u5C5E\u6027\u503C",prop:"value","min-width":"100px","show-overflow-tooltip":""}),M(w,{label:"\u64CD\u4F5C",width:"110px"},{default:j(N=>[M(S,{link:"",onClick:L=>y(N.row,N.$index),size:"small"},{default:j(()=>[ve(" \u7F16\u8F91 ")]),_:2},1032,["onClick"]),M(D,{direction:"vertical"}),M(S,{link:"",size:"small",style:{color:"#ff4d4f"},onClick:L=>((T,b)=>{console.log(T,"attr"),Mr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5C5E\u6027\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{i.value.splice(b,1),p.value.splice(b,1);const B=v().moddle.create(`${n}:Properties`,{values:p.value});x(B),f()}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(N.row,N.$index)},{default:j(()=>[ve(" \u79FB\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),De("div",cP,[M(d,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u5C5E\u6027",onClick:_[0]||(_[0]=N=>y(null,-1))})]),M(I,{modelValue:P(a),"onUpdate:modelValue":_[4]||(_[4]=N=>Mt(a)?a.value=N:null),title:"\u5C5E\u6027\u914D\u7F6E",width:"600px","append-to-body":"","destroy-on-close":""},{footer:j(()=>[M(S,{onClick:_[3]||(_[3]=N=>a.value=!1)},{default:j(()=>[ve("\u53D6 \u6D88")]),_:1}),M(S,{type:"primary",onClick:g},{default:j(()=>[ve("\u786E \u5B9A")]),_:1})]),default:j(()=>[M(R,{model:P(r),"label-width":"80px",ref_key:"attributeFormRef",ref:h},{default:j(()=>[M(C,{label:"\u5C5E\u6027\u540D\uFF1A",prop:"name"},{default:j(()=>[M(m,{modelValue:P(r).name,"onUpdate:modelValue":_[1]||(_[1]=N=>P(r).name=N),clearable:""},null,8,["modelValue"])]),_:1}),M(C,{label:"\u5C5E\u6027\u503C\uFF1A",prop:"value"},{default:j(()=>[M(m,{modelValue:P(r).value,"onUpdate:modelValue":_[2]||(_[2]=N=>P(r).value=N),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),uP={class:"panel-tab__content"},pP={class:"element-drawer__button"},dP={class:"listener-filed__title"},hP={class:"element-drawer__button"},mP=Ze({name:"UserTaskListeners",__name:"UserTaskListeners",props:{id:String,type:String},setup(e){const t=e,n=Hn("prefix"),i=Hn("width"),r=G([]),o=G(tP),a=G(Q0),c=G(!1),l=G({}),u=G(ex),p=G([]),h=G(!1),v=G(-1),f=G(-1),y=G({}),g=G(),x=G(),E=G(),_=G(),w=G(),S=()=>window==null?void 0:window.bpmnInstances,D=(N,L)=>{N?(l.value=Y0(N),v.value=L):(l.value={},v.value=-1),N&&N.fields?p.value=N.fields.map(T=>({...T,fieldType:T.string?"string":"expression"})):(p.value=[],l.value.fields=[]),c.value=!0,Rt(()=>{_.value&&_.value.clearValidate()})},s=async()=>{var L,T,b;if(!await _.value.validate())return;const N=wl(l.value,!0,n);v.value===-1?(x.value.push(N),r.value.push(l.value)):(x.value.splice(v.value,1,N),r.value.splice(v.value,1,l.value)),E.value=((b=(T=(L=g.value.businessObject)==null?void 0:L.extensionElements)==null?void 0:T.values)==null?void 0:b.filter(B=>B.$type!==`${n}:TaskListener`))??[],Co(g.value,E.value.concat(x.value)),c.value=!1,l.value={}},d=(N,L)=>{y.value=N?JSON.parse(JSON.stringify(N)):{},f.value=N?L:-1,h.value=!0,Rt(()=>{w.value&&w.value.clearValidate()})},m=async()=>{await w.value.validate()&&(f.value===-1?(p.value.push(y.value),l.value.fields.push(y.value)):(p.value.splice(f.value,1,y.value),l.value.fields.splice(f.value,1,y.value)),h.value=!1,Rt(()=>{y.value={}}))},C=G(),R=async()=>{C.value.open("task")},I=N=>{var b,B,V;const L=Z0(N),T=wl(L,!0,n);x.value.push(T),r.value.push(L),E.value=((V=(B=(b=g.value.businessObject)==null?void 0:b.extensionElements)==null?void 0:B.values)==null?void 0:V.filter(H=>H.$type!==`${n}:TaskListener`))??[],Co(g.value,E.value.concat(x.value))};return nt(()=>t.id,N=>{N&&N.length&&Rt(()=>{var L,T;console.log(S().bpmnElement,"window.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElementwindow.bpmnInstances.bpmnElement"),g.value=S().bpmnElement,E.value=[],x.value=((T=(L=g.value.businessObject)==null?void 0:L.extensionElements)==null?void 0:T.values.filter(b=>b.$type===`${n}:TaskListener`))??[],r.value=x.value.map(b=>J0(b))})},{immediate:!0}),(N,L)=>{const T=Rr,b=kn,B=zl,V=Nr,H=Ir,q=hi,J=mi,Q=Yt,oe=hn,ie=dn,he=ts,Ne=Hh,ee=Mo;return X(),Ae(st,null,[De("div",uP,[M(V,{data:P(r),size:"small",border:""},{default:j(()=>[M(T,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),M(T,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:Z=>P(o)[Z.event]},null,8,["formatter"]),M(T,{label:"\u4E8B\u4EF6id","min-width":"80px",prop:"id","show-overflow-tooltip":""}),M(T,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:Z=>P(a)[Z.listenerType]},null,8,["formatter"]),M(T,{label:"\u64CD\u4F5C",width:"90px"},{default:j(Z=>[M(b,{size:"small",link:"",onClick:_e=>D(Z.row,Z.$index)},{default:j(()=>[ve("\u7F16\u8F91")]),_:2},1032,["onClick"]),M(B,{direction:"vertical"}),M(b,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:_e=>((Ve,ye)=>{console.log(Ve,"listener"),Mr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{x.value.splice(ye,1),r.value.splice(ye,1),Co(g.value,E.value.concat(x.value))}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(Z.row,Z.$index)},{default:j(()=>[ve("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),De("div",pP,[M(H,{size:"small",type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:L[0]||(L[0]=Z=>D(null))}),M(H,{type:"success",preIcon:"ep:select",title:"\u9009\u62E9\u76D1\u542C\u5668",size:"small",onClick:R})]),M(Ne,{modelValue:P(c),"onUpdate:modelValue":L[15]||(L[15]=Z=>Mt(c)?c.value=Z:null),title:"\u4EFB\u52A1\u76D1\u542C\u5668",size:`${P(i)}px`,"append-to-body":"","destroy-on-close":""},{default:j(()=>[M(ie,{size:"small",model:P(l),"label-width":"96px",ref_key:"listenerFormRef",ref:_},{default:j(()=>[M(Q,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(J,{modelValue:P(l).event,"onUpdate:modelValue":L[1]||(L[1]=Z=>P(l).event=Z)},{default:j(()=>[(X(!0),Ae(st,null,Xt(Object.keys(P(o)),Z=>(X(),ue(q,{key:Z,label:P(o)[Z],value:Z},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),M(Q,{label:"\u76D1\u542C\u5668ID",prop:"id",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(l).id,"onUpdate:modelValue":L[2]||(L[2]=Z=>P(l).id=Z),clearable:""},null,8,["modelValue"])]),_:1}),M(Q,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(J,{modelValue:P(l).listenerType,"onUpdate:modelValue":L[3]||(L[3]=Z=>P(l).listenerType=Z)},{default:j(()=>[(X(!0),Ae(st,null,Xt(Object.keys(P(a)),Z=>(X(),ue(q,{key:Z,label:P(a)[Z],value:Z},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),P(l).listenerType==="classListener"?(X(),ue(Q,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(l).class,"onUpdate:modelValue":L[4]||(L[4]=Z=>P(l).class=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(l).listenerType==="expressionListener"?(X(),ue(Q,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(l).expression,"onUpdate:modelValue":L[5]||(L[5]=Z=>P(l).expression=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(l).listenerType==="delegateExpressionListener"?(X(),ue(Q,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(l).delegateExpression,"onUpdate:modelValue":L[6]||(L[6]=Z=>P(l).delegateExpression=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(l).listenerType==="scriptListener"?(X(),Ae(st,{key:3},[M(Q,{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:j(()=>[M(oe,{modelValue:P(l).scriptFormat,"onUpdate:modelValue":L[7]||(L[7]=Z=>P(l).scriptFormat=Z),clearable:""},null,8,["modelValue"])]),_:1}),M(Q,{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:j(()=>[M(J,{modelValue:P(l).scriptType,"onUpdate:modelValue":L[8]||(L[8]=Z=>P(l).scriptType=Z)},{default:j(()=>[M(q,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),M(q,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),P(l).scriptType==="inlineScript"?(X(),ue(Q,{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:j(()=>[M(oe,{modelValue:P(l).value,"onUpdate:modelValue":L[9]||(L[9]=Z=>P(l).value=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(l).scriptType==="externalScript"?(X(),ue(Q,{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:j(()=>[M(oe,{modelValue:P(l).resource,"onUpdate:modelValue":L[10]||(L[10]=Z=>P(l).resource=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0)],64)):we("",!0),P(l).event==="timeout"?(X(),Ae(st,{key:4},[M(Q,{label:"\u5B9A\u65F6\u5668\u7C7B\u578B",prop:"eventDefinitionType",key:"eventDefinitionType"},{default:j(()=>[M(J,{modelValue:P(l).eventDefinitionType,"onUpdate:modelValue":L[11]||(L[11]=Z=>P(l).eventDefinitionType=Z)},{default:j(()=>[M(q,{label:"\u65E5\u671F",value:"date"}),M(q,{label:"\u6301\u7EED\u65F6\u957F",value:"duration"}),M(q,{label:"\u5FAA\u73AF",value:"cycle"}),M(q,{label:"\u65E0",value:"null"})]),_:1},8,["modelValue"])]),_:1}),P(l).eventDefinitionType&&P(l).eventDefinitionType!=="null"?(X(),ue(Q,{label:"\u5B9A\u65F6\u5668",prop:"eventTimeDefinitions",key:"eventTimeDefinitions",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u5B9A\u65F6\u5668\u914D\u7F6E"}},{default:j(()=>[M(oe,{modelValue:P(l).eventTimeDefinitions,"onUpdate:modelValue":L[12]||(L[12]=Z=>P(l).eventTimeDefinitions=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0)],64)):we("",!0)]),_:1},8,["model"]),M(B),De("p",dP,[De("span",null,[M(he,{icon:"ep:menu"}),ve("\u6CE8\u5165\u5B57\u6BB5\uFF1A")]),M(b,{size:"small",type:"primary",onClick:L[13]||(L[13]=Z=>d(null))},{default:j(()=>[ve("\u6DFB\u52A0\u5B57\u6BB5")]),_:1})]),M(V,{data:P(p),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:j(()=>[M(T,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),M(T,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),M(T,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:Z=>P(u)[Z.fieldType]},null,8,["formatter"]),M(T,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:Z=>Z.string||Z.expression},null,8,["formatter"]),M(T,{label:"\u64CD\u4F5C",width:"100px"},{default:j(Z=>[M(b,{size:"small",link:"",onClick:_e=>d(Z.row,Z.$index)},{default:j(()=>[ve("\u7F16\u8F91")]),_:2},1032,["onClick"]),M(B,{direction:"vertical"}),M(b,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:_e=>((Ve,ye)=>{console.log(Ve,"field"),Mr.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{p.value.splice(ye,1),l.value.fields.splice(ye,1)}).catch(()=>console.info("\u64CD\u4F5C\u53D6\u6D88"))})(Z.row,Z.$index)},{default:j(()=>[ve("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),De("div",hP,[M(b,{size:"small",onClick:L[14]||(L[14]=Z=>c.value=!1)},{default:j(()=>[ve("\u53D6 \u6D88")]),_:1}),M(b,{size:"small",type:"primary",onClick:s},{default:j(()=>[ve("\u4FDD \u5B58")]),_:1})])]),_:1},8,["modelValue","size"]),M(ee,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:P(h),"onUpdate:modelValue":L[21]||(L[21]=Z=>Mt(h)?h.value=Z:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:j(()=>[M(b,{size:"small",onClick:L[20]||(L[20]=Z=>h.value=!1)},{default:j(()=>[ve("\u53D6 \u6D88")]),_:1}),M(b,{size:"small",type:"primary",onClick:m},{default:j(()=>[ve("\u786E \u5B9A")]),_:1})]),default:j(()=>[M(ie,{model:P(y),size:"small","label-width":"96px",ref_key:"listenerFieldFormRef",ref:w,style:{height:"136px"}},{default:j(()=>[M(Q,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(y).name,"onUpdate:modelValue":L[16]||(L[16]=Z=>P(y).name=Z),clearable:""},null,8,["modelValue"])]),_:1}),M(Q,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(J,{modelValue:P(y).fieldType,"onUpdate:modelValue":L[17]||(L[17]=Z=>P(y).fieldType=Z)},{default:j(()=>[(X(!0),Ae(st,null,Xt(Object.keys(P(u)),Z=>(X(),ue(q,{key:Z,label:P(u)[Z],value:Z},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),P(y).fieldType==="string"?(X(),ue(Q,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(y).string,"onUpdate:modelValue":L[18]||(L[18]=Z=>P(y).string=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0),P(y).fieldType==="expression"?(X(),ue(Q,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:j(()=>[M(oe,{modelValue:P(y).expression,"onUpdate:modelValue":L[19]||(L[19]=Z=>P(y).expression=Z),clearable:""},null,8,["modelValue"])]),_:1})):we("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])]),M(tx,{ref_key:"processListenerDialogRef",ref:C,onSelect:I},null,512)],64)}}}),_l=Ze({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=G("base"),i=G(""),r=G(""),o=G({}),a=G(!1),c=G(!1),l=G();ko("prefix",t.prefix),ko("width",t.width);const u=()=>window==null?void 0:window.bpmnInstances,p=nt(()=>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"),h(),p()},{immediate:!0}),h=()=>{v(null),t.bpmnModeler.on("import.done",f=>{console.log(f,"eeeee"),v(null)}),t.bpmnModeler.on("selection.changed",({newSelection:f})=>{v(f[0]||null)}),t.bpmnModeler.on("element.changed",({element:f})=>{f&&f.id===i.value&&v(f)})},v=f=>{let y=f;y||(y=u().elementRegistry.find(g=>g.type==="bpmn:Process")??u().elementRegistry.find(g=>g.type==="bpmn:Collaboration")),y&&(console.log(`
              ----------
      select element changed:
                id:  ${y.id}
              type:  ${y.businessObject.$type}
              ----------
              `),console.log("businessObject: ",y.businessObject),u().bpmnElement=y,l.value=y,i.value=y.id,r.value=y.type.split(":")[1]||"",o.value=JSON.parse(JSON.stringify(y.businessObject)),a.value=!(r.value!=="SequenceFlow"||!y.source||y.source.type.indexOf("StartEvent")!==-1),c.value=r.value==="UserTask"||r.value==="StartEvent")};return An(()=>{window.bpmnInstances=null,console.log(t,"props1"),console.log(t.bpmnModeler,"props.bpmnModeler1")}),nt(()=>i.value,()=>{n.value="base"}),(f,y)=>{const g=ts,x=aE,E=Ak,_=oE;return X(),Ae("div",{class:"process-panel__container",style:Dx({width:`${e.width}px`})},[M(_,{modelValue:P(n),"onUpdate:modelValue":y[0]||(y[0]=w=>Mt(n)?n.value=w:null)},{default:j(()=>[M(x,{name:"base"},{title:j(()=>[M(g,{icon:"ep:info-filled"}),ve(" \u5E38\u89C4")]),default:j(()=>[M(Rk,{"id-edit-disabled":e.idEditDisabled,"business-object":P(o),type:P(r),model:e.model},null,8,["id-edit-disabled","business-object","type","model"])]),_:1}),P(r)==="Process"?(X(),ue(x,{name:"condition",key:"message"},{title:j(()=>[M(g,{icon:"ep:comment"}),ve("\u6D88\u606F\u4E0E\u4FE1\u53F7")]),default:j(()=>[M(Qk)]),_:1})):we("",!0),P(a)?(X(),ue(x,{name:"condition",key:"condition"},{title:j(()=>[M(g,{icon:"ep:promotion"}),ve("\u6D41\u8F6C\u6761\u4EF6")]),default:j(()=>[M(Xk,{"business-object":P(o),type:P(r)},null,8,["business-object","type"])]),_:1})):we("",!0),P(c)?(X(),ue(x,{name:"condition",key:"form"},{title:j(()=>[M(g,{icon:"ep:list"}),ve("\u8868\u5355")]),default:j(()=>[M(E,{id:P(i),type:P(r)},null,8,["id","type"])]),_:1})):we("",!0),P(r).indexOf("Task")!==-1?(X(),ue(x,{name:"task",key:"task"},{title:j(()=>[M(g,{icon:"ep:checked"}),ve("\u4EFB\u52A1\uFF08\u5BA1\u6279\u4EBA\uFF09")]),default:j(()=>[M(Hk,{id:P(i),type:P(r)},null,8,["id","type"])]),_:1})):we("",!0),P(r).indexOf("Task")!==-1?(X(),ue(x,{name:"multiInstance",key:"multiInstance"},{title:j(()=>[M(g,{icon:"ep:help-filled"}),ve("\u591A\u5B9E\u4F8B\uFF08\u4F1A\u7B7E\u914D\u7F6E\uFF09")]),default:j(()=>[M(Wk,{"business-object":P(o),type:P(r)},null,8,["business-object","type"])]),_:1})):we("",!0),M(x,{name:"listeners",key:"listeners"},{title:j(()=>[M(g,{icon:"ep:bell-filled"}),ve("\u6267\u884C\u76D1\u542C\u5668")]),default:j(()=>[M(aP,{id:P(i),type:P(r)},null,8,["id","type"])]),_:1}),P(r)==="UserTask"?(X(),ue(x,{name:"taskListeners",key:"taskListeners"},{title:j(()=>[M(g,{icon:"ep:bell-filled"}),ve("\u4EFB\u52A1\u76D1\u542C\u5668")]),default:j(()=>[M(mP,{id:P(i),type:P(r)},null,8,["id","type"])]),_:1})):we("",!0),M(x,{name:"extensions",key:"extensions"},{title:j(()=>[M(g,{icon:"ep:circle-plus-filled"}),ve("\u6269\u5C55\u5C5E\u6027")]),default:j(()=>[M(lP,{id:P(i),type:P(r)},null,8,["id","type"])]),_:1}),M(x,{name:"other",key:"other"},{title:j(()=>[M(g,{icon:"ep:promotion"}),ve("\u5176\u4ED6")]),default:j(()=>[M(Ok,{id:P(i)},null,8,["id"])]),_:1})]),_:1},8,["modelValue"])],4)}}});_l.install=function(e){e.component(_l.name,_l)};const fP={class:"my-process-designer"},vP={class:"my-process-designer__container"},Sl=Ze({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;ko("configGlobal",n);const i=t;let r;const o=G(""),a=G([]),c=G(void 0),l=G([]),u=G(),p=G(null),h=G(null),v=async w=>{let S=`Process_${new Date().getTime()}`,D=`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,s=w||Wb(S,D,n.prefix);try{let{warnings:d}=await r.importXML(s);d&&d.length&&d.forEach(m=>console.warn(m)),await f(),r.get("canvas").zoom("fit-viewport","auto")}catch(d){console.error(d)}},f=async()=>{var C;const w=a.value;if(w.length===0)return;let S=r.get("canvas"),D=w.find(R=>!R.endTime),s=w[w.length-1],d=!1,m=[];(C=r.getDefinitions().rootElements[0].flowElements)==null||C.forEach(R=>{var N,L,T;let I=w.find(b=>b.key===R.id);if(I){if(R.$type==="bpmn:UserTask"){const b=l.value.find(V=>V.id===I.taskId);if(!b)return;if(d)return void m.push(R.id);if(S.addMarker(R.id,g(b.status)),b.status===1&&(d=!0),b.status!==2)return;const B=x(I);B==null||B.forEach(V=>{let H=w.find(q=>q.key===V.targetRef.id);H?S.addMarker(V.id,H.endTime?"highlight":"highlight-todo"):V.targetRef.$type==="bpmn:ExclusiveGateway"?(S.addMarker(V.id,I.endTime?"highlight":"highlight-todo"),S.addMarker(V.targetRef.id,I.endTime?"highlight":"highlight-todo")):V.targetRef.$type==="bpmn:EndEvent"&&(D||s.key!==R.id||(S.addMarker(V.id,"highlight"),S.addMarker(V.targetRef.id,"highlight")),I.endTime||(S.addMarker(V.id,"highlight-todo"),S.addMarker(V.targetRef.id,"highlight-todo")))})}else if(R.$type==="bpmn:ExclusiveGateway"){let b,B;S.addMarker(R.id,y(I)),(N=R.outgoing)==null||N.forEach(V=>{let H=w.find(q=>q.key===V.targetRef.id);H&&(B&&B.type!=="endEvent"||(b=V,B=H))}),b&&B&&S.addMarker(b.id,y(B))}else if(R.$type==="bpmn:ParallelGateway")S.addMarker(R.id,y(I)),(L=R.outgoing)==null||L.forEach(b=>{const B=w.find(V=>V.key===b.targetRef.id);B&&(S.addMarker(b.id,y(B)),S.addMarker(b.targetRef.id,y(B)))});else if(R.$type==="bpmn:StartEvent")S.addMarker(R.id,"highlight"),(T=R.outgoing)==null||T.forEach(b=>{w.find(B=>B.key===b.targetRef.id)&&(S.addMarker(b.id,"highlight"),S.addMarker(R.id,"highlight"))});else if(R.$type==="bpmn:EndEvent"){if(!c.value||c.value.status===1)return;S.addMarker(R.id,g(c.value.status))}else if(R.$type==="bpmn:ServiceTask"){if(I.startTime>0&&I.endTime===0&&S.addMarker(R.id,g(1)),I.endTime>0){S.addMarker(R.id,g(2));const b=x(I);b==null||b.forEach(B=>{S.addMarker(B.id,g(2))})}}else if(R.$type==="bpmn:SequenceFlow"){let b=w.find(B=>B.key===R.targetRef.id);b&&S.addMarker(R.id,y(b))}}}),Bx(m)||(l.value=l.value.filter(R=>!m.includes(R.taskDefinitionKey)))},y=w=>w.endTime?"highlight":"highlight-todo",g=w=>w===1?"highlight-todo":w===2?"highlight":w===3?"highlight-reject":w===4?"highlight-cancel":w===5?"highlight-return":w===6||w===7||w===0?"highlight-todo":"",x=w=>{if(w.outgoing&&w.outgoing.length>0)return w.outgoing;const S=r.getDefinitions().rootElements[0].flowElements,D=[];return S.forEach(s=>{s.$type==="bpmn:SequenceFlow"&&s.sourceRef.id===w.key&&D.push(s)}),D},E=w=>{var D;w.value=w,!p.value&&(p.value={}),!h.value&&(h.value=r.get("overlays"));const S=a.value.find(s=>s.key===w.value.id);if(S&&!p.value[w.value.id]&&w.value.type!=="bpmn:Process"){let s=`<div class="element-overlays">
            <p>Elemet id: ${w.value.id}</p>
            <p>Elemet type: ${w.value.type}</p>
          </div>`;if(w.value.type==="bpmn:StartEvent"&&c.value)s=`<p>\u53D1\u8D77\u4EBA\uFF1A${c.value.startUser.nickname}</p>
                  <p>\u90E8\u95E8\uFF1A${c.value.startUser.deptName}</p>
                  <p>\u521B\u5EFA\u65F6\u95F4\uFF1A${Dr(c.value.createTime)}`;else if(w.value.type==="bpmn:UserTask"){let d=l.value.find(R=>R.id===S.taskId);if(!d)return;let m=$l(Po.BPM_TASK_STATUS),C="";m.forEach(R=>{R.value==d.status&&(C=R.label)}),s=`<p>\u5BA1\u6279\u4EBA\uFF1A${d.assigneeUser.nickname}</p>
                  <p>\u90E8\u95E8\uFF1A${d.assigneeUser.deptName}</p>
                  <p>\u7ED3\u679C\uFF1A${C}</p>
                  <p>\u521B\u5EFA\u65F6\u95F4\uFF1A${Dr(d.createTime)}</p>`,d.endTime&&(s+=`<p>\u7ED3\u675F\u65F6\u95F4\uFF1A${Dr(d.endTime)}</p>`),d.reason&&(s+=`<p>\u5BA1\u6279\u5EFA\u8BAE\uFF1A${d.reason}</p>`)}else if(w.value.type==="bpmn:ServiceTask"&&c.value)S.startTime>0&&(s=`<p>\u521B\u5EFA\u65F6\u95F4\uFF1A${Dr(S.startTime)}</p>`),S.endTime>0&&(s+=`<p>\u7ED3\u675F\u65F6\u95F4\uFF1A${Dr(S.endTime)}</p>`),console.log(s);else if(w.value.type==="bpmn:EndEvent"&&c.value){let d=$l(Po.BPM_TASK_STATUS),m="";d.forEach(C=>{C.value==c.value.status&&(m=C.label)}),s=`<p>\u7ED3\u679C\uFF1A${m}</p>`,c.value.endTime&&(s+=`<p>\u7ED3\u675F\u65F6\u95F4\uFF1A${Dr(c.value.endTime)}</p>`)}p.value[w.value.id]=(D=Be(h.value))==null?void 0:D.add(w.value,{position:{left:0,bottom:0},html:`<div class="element-overlays">${s}</div>`})}},_=w=>{Be(h.value).remove({element:w}),p.value[w.id]=null};return Pr(()=>{o.value=n.value,a.value=n.activityData,r||(r=new Zn({container:u.value,bpmnRenderer:{}})),v(o.value),(()=>{const w=r.get("eventBus");w.on("element.hover",function(S){let D=S?S.element:null;E(D)}),w.on("element.out",function(S){let D=S?S.element:null;_(D)})})()}),An(()=>{r&&r.destroy(),i("destroy",r),r=null}),nt(()=>n.value,w=>{o.value=w,v(o.value)}),nt(()=>n.activityData,w=>{a.value=w,v(o.value)}),nt(()=>n.processInstanceData,w=>{c.value=w,v(o.value)}),nt(()=>n.taskData,w=>{l.value=w,v(o.value)}),(w,S)=>(X(),Ae("div",fP,[De("div",vP,[De("div",{class:"my-process-designer__canvas",style:{height:"760px"},ref_key:"bpmnCanvas",ref:u},null,512)])]))}});Sl.install=function(e){e.component(Sl.name,Sl)};export{Gc as P,El as _,Oe as a,sk as b,A as c,Ft as d,V0 as e,$0 as f,Pi as g,_l as h,Pe as i,Sl as j};