123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import{_ as pA,__tla as hA}from"./Dialog-c2716df6.js";import{de as ro,dc as _0,dq as dA,d as Re,r as W,aU as rl,J as zh,dr as mA,k as Pa,aw as Ln,P as fA,o as nt,c as Dt,g as Vt,aC as vA,F as cn,f as R,w as V,a as D,q as Ct,O as kt,m as mt,t as w0,v as ol,N as ln,be as yA,bf as oo,b5 as gA,ds as bA,B as ao,e as xA,K as me,bx as Lt,U as _n,z as wn,C as ri,am as Fe,aj as S0,a3 as $h,x as so,y as co,n as lo,a$ as Ma,aH as EA,cv as _A,L as wA,ac as C0,aO as uo,_ as al,D as sl,G as cl,bz as Gh,at as SA,ao as CA,__tla as TA}from"./index-2eab2d23.js";import{_ as AA,__tla as kA}from"./XTextButton-caeba438.js";import{_ as po,__tla as PA}from"./XButton-f05c5131.js";import{E as MA,a as RA,__tla as NA}from"./el-collapse-item-5ecf4321.js";import{E as Uh,__tla as IA}from"./el-link-f0d278a2.js";import{u as T0,__tla as DA}from"./useMessage-171aa63e.js";import{E as A0,__tla as BA}from"./el-drawer-7ad3d607.js";import{a as k0,D as P0,__tla as OA}from"./dict-1ad71b6f.js";import{f as ho,__tla as LA}from"./formatTime-41155543.js";let Ra,Na,A,M0,Ne,Hh,Mt,qh,oi,Ia,wt,Da,jA=Promise.all([(()=>{try{return hA}catch{}})(),(()=>{try{return TA}catch{}})(),(()=>{try{return kA}catch{}})(),(()=>{try{return PA}catch{}})(),(()=>{try{return NA}catch{}})(),(()=>{try{return IA}catch{}})(),(()=>{try{return DA}catch{}})(),(()=>{try{return BA}catch{}})(),(()=>{try{return OA}catch{}})(),(()=>{try{return LA}catch{}})()]).then(async()=>{var ll={exports:{}};typeof Object.create=="function"?ll.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ll.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}};const it=ro(ll.exports);var Wh,ul,R0=(Wh=function(t){var e=t.exports=function(n,i){if(i||(i=16),n===void 0&&(n=128),n<=0)return"0";for(var r=Math.log(Math.pow(2,n))/Math.log(i),o=2;r===1/0;o*=2)r=Math.log(Math.pow(2,n/o))/Math.log(i)*o;var a=r-Math.floor(r),c="";for(o=0;o<Math.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)?e(n,i):c};e.rack=function(n,i,r){var o=function(c){var l=0;do{if(l++>10){if(!r)throw new Error("too many ID collisions, use more bits");n+=r}var u=e(n,i)}while(Object.hasOwnProperty.call(a,u));return a[u]=c,u},a=o.hats={};return o.get=function(c){return o.hats[c]},o.set=function(c,l){return o.hats[c]=l,o},o.bits=n||128,o.base=i||16,o}},Wh(ul={exports:{}},ul.exports),ul.exports);function Sn(t){if(!(this instanceof Sn))return new Sn(t);t=t||[128,36,1],this._seed=t.length?R0.rack(t[0],t[1],t[2]):t}function mo(t){return Array.prototype.concat.apply([],t)}Sn.prototype.next=function(t){return this._seed(t||!0)},Sn.prototype.nextPrefixed=function(t,e){var n;do n=t+this.next(!0);while(this.assigned(n));return this.claim(n,e),n},Sn.prototype.claim=function(t,e){this._seed.set(t,e||!0)},Sn.prototype.assigned=function(t){return this._seed.get(t)||!1},Sn.prototype.unclaim=function(t){delete this._seed.hats[t]},Sn.prototype.clear=function(){var t,e=this._seed.hats;for(t in e)this.unclaim(t)};var fo=Object.prototype.toString,N0=Object.prototype.hasOwnProperty;function jn(t){return t===void 0}function qe(t){return t!==void 0}function vo(t){return t==null}function gt(t){return fo.call(t)==="[object Array]"}function te(t){return fo.call(t)==="[object Object]"}function pt(t){return fo.call(t)==="[object Number]"}function fe(t){var e=fo.call(t);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"||e==="[object Proxy]"}function Ie(t){return fo.call(t)==="[object String]"}function Xh(t){if(!gt(t))throw new Error("must supply array")}function Cn(t,e){return N0.call(t,e)}function Pt(t,e){var n;return e=ml(e),L(t,function(i,r){if(e(i,r))return n=i,!1}),n}function pl(t,e){e=ml(e);var n=gt(t)?-1:void 0;return L(t,function(i,r){if(e(i,r))return n=r,!1}),n}function dt(t,e){var n=[];return L(t,function(i,r){e(i,r)&&n.push(i)}),n}function L(t,e){var n;if(!jn(t)){var i=gt(t)?D0:I0;for(var r in t)if(Cn(t,r)&&e(n=t[r],i(r))===!1)return n}}function Kh(t,e){return jn(t)?[]:(Xh(t),e=ml(e),t.filter(function(n,i){return!e(n,i)}))}function De(t,e,n){return L(t,function(i,r){n=e(n,i,r)}),n}function Li(t,e){return!!De(t,function(n,i,r){return n&&e(i,r)},!0)}function ai(t,e){return!!Pt(t,e)}function le(t,e){var n=[];return L(t,function(i,r){n.push(e(i,r))}),n}function yo(t){return t&&Object.keys(t)||[]}function vr(t){return yo(t).length}function Ba(t){return le(t,function(e){return e})}function ji(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e=dl(e),L(t,function(i){var r=e(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function hl(t){t=dl(t);for(var e={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return L(i,function(o){return ji(o,t,e)}),le(e,function(o,a){return o[0]})}var Yh=hl;function We(t,e){e=dl(e);var n=[];return L(t,function(i,r){for(var o=e(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)}),le(n,function(i){return i.v})}function Xe(t){return function(e){return Li(t,function(n,i){return e[i]===n})}}function dl(t){return fe(t)?t:function(e){return e[t]}}function ml(t){return fe(t)?t:function(e){return e===t}}function I0(t){return t}function D0(t){return Number(t)}function fl(t,e){var n,i,r,o;function a(p){var d=Date.now(),y=p?0:o+e-d;if(y>0)return c(y);t.apply(r,i),l()}function c(p){n=setTimeout(a,p)}function l(){n&&clearTimeout(n),n=o=i=r=void 0}function u(){o=Date.now();for(var p=arguments.length,d=new Array(p),y=0;y<p;y++)d[y]=arguments[y];i=d,r=this,n||c(e)}return u.flush=function(){n&&a(!0),l()},u.cancel=l,u}function we(t,e){return t.bind(e)}function vl(t){return vl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vl(t)}function yl(){return yl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},yl.apply(this,arguments)}function z(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return yl.apply(void 0,[t].concat(n))}function Ke(t,e){var n={},i=Object(t);return L(e,function(r){r in i&&(n[r]=t[r])}),n}function Vn(t,e){var n={};return L(Object(t),function(i,r){e.indexOf(r)===-1&&(n[r]=i)}),n}const B0=Object.freeze(Object.defineProperty({__proto__:null,assign:z,bind:we,debounce:fl,ensureArray:Xh,every:Li,filter:dt,find:Pt,findIndex:pl,flatten:mo,forEach:L,get:function(t,e,n){var i=t;return L(e,function(r){if(vo(i))return i=void 0,!1;i=i[r]}),jn(i)?n:i},groupBy:ji,has:Cn,isArray:gt,isDefined:qe,isFunction:fe,isNil:vo,isNumber:pt,isObject:te,isString:Ie,isUndefined:jn,keys:yo,map:le,matchPattern:Xe,merge:function t(e){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&&L(i,function(o){o&&te(o)&&L(o,function(a,c){if(c!=="__proto__"){var l=e[c];te(a)?(te(l)||(l={}),e[c]=t(l,a)):e[c]=a}})}),e},omit:Vn,pick:Ke,reduce:De,set:function(t,e,n){var i=t;return L(e,function(r,o){if(typeof r!="number"&&typeof r!="string")throw new Error("illegal key type: "+vl(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=e[o+1],c=i[r];qe(a)&&vo(c)&&(c=i[r]=isNaN(+a)?{}:[]),jn(a)?jn(n)?delete i[r]:i[r]=n:i=c}),t},size:vr,some:ai,sortBy:We,throttle:function(t,e){var n=!1;return function(){n||(t.apply(void 0,arguments),n=!0,setTimeout(function(){n=!1},e))}},unionBy:Yh,uniqueBy:hl,values:Ba,without:Kh},Symbol.toStringTag,{value:"Module"}));function ze(t,e,n){return arguments.length==2?t.getAttribute(e):n===null?t.removeAttribute(e):(t.setAttribute(e,n),t)}var O0=[].indexOf,gl=function(t,e){if(O0)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1},L0=/\s+/,j0=Object.prototype.toString;function oe(t){return new si(t)}function si(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}function Oa(t){for(var e;t.childNodes.length;)e=t.childNodes[0],t.removeChild(e);return t}si.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~gl(e,t)||e.push(t),this.el.className=e.join(" "),this},si.prototype.remove=function(t){if(j0.call(t)=="[object RegExp]")return this.removeMatching(t);if(this.list)return this.list.remove(t),this;var e=this.array(),n=gl(e,t);return~n&&e.splice(n,1),this.el.className=e.join(" "),this},si.prototype.removeMatching=function(t){for(var e=this.array(),n=0;n<e.length;n++)t.test(e[n])&&this.remove(e[n]);return this},si.prototype.toggle=function(t,e){return this.list?(e!==void 0?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(e!==void 0?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},si.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(L0);return t[0]===""&&t.shift(),t},si.prototype.has=si.prototype.contains=function(t){return this.list?this.list.contains(t):!!~gl(this.array(),t)};var yr=typeof Element<"u"?Element.prototype:{},Jh=yr.matches||yr.matchesSelector||yr.webkitMatchesSelector||yr.mozMatchesSelector||yr.msMatchesSelector||yr.oMatchesSelector,La=function(t,e){if(!t||t.nodeType!==1)return!1;if(Jh)return Jh.call(t,e);for(var n=t.parentNode.querySelectorAll(e),i=0;i<n.length;i++)if(n[i]==t)return!0;return!1};function Vi(t,e,n){for(var i=n?t:t.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(La(i,e))return i;i=i.parentNode}return La(i,e)?i:null}var Zh=window.addEventListener?"addEventListener":"attachEvent",V0=window.removeEventListener?"removeEventListener":"detachEvent",Qh=Zh!=="addEventListener"?"on":"",ct={bind:function(t,e,n,i){return t[Zh](Qh+e,n,i||!1),n},unbind:function(t,e,n,i){return t[V0](Qh+e,n,i||!1),n}},td=["focus","blur"],bl,$e={bind:function(t,e,n,i,r){return td.indexOf(n)!==-1&&(r=!0),ct.bind(t,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Vi(a,e,!0),o.delegateTarget&&i.call(t,o)},r)},unbind:function(t,e,n,i){return td.indexOf(e)!==-1&&(i=!0),ct.unbind(t,e,n,i)}},jt=function(t,e){if(typeof t!="string")throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body")return(r=e.createElement("html")).innerHTML=t,r.removeChild(r.lastChild);var r,o=ae[i]||ae._default,a=o[0],c=o[1],l=o[2];for((r=e.createElement("div")).innerHTML=c+t+l;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=e.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},ed=!1;typeof document<"u"&&((bl=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',ed=!bl.getElementsByTagName("link").length,bl=void 0);var ae={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:ed?[1,"X<div>","</div>"]:[0,"",""]};function Wt(t,e){return(e=e||document).querySelector(t)}function xl(t,e){return(e=e||document).querySelectorAll(t)}function Tn(t){t.parentNode&&t.parentNode.removeChild(t)}function nd(t,e){return e.appendChild(function(n,i){if(n.ownerDocument!==i.ownerDocument)try{return i.ownerDocument.importNode(n,!0)}catch{}return n}(t,e))}function lt(t,e){return nd(e,t),t}ae.td=ae.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],ae.option=ae.optgroup=[1,'<select multiple="multiple">',"</select>"],ae.thead=ae.tbody=ae.colgroup=ae.caption=ae.tfoot=[1,"<table>","</table>"],ae.polyline=ae.ellipse=ae.polygon=ae.circle=ae.text=ae.line=ae.path=ae.rect=ae.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var El=2,id={"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":El,"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":El,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function rd(t,e,n){var i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=id[i];r?(r===El&&typeof n=="number"&&(n=String(n)+"px"),t.style[i]=n):t.setAttributeNS(null,e,n)}function K(t,e,n){if(typeof e=="string"){if(n===void 0)return function(i,r){return id[r]?i.style[r]:i.getAttributeNS(null,r)}(t,e);rd(t,e,n)}else(function(i,r){var o,a,c=Object.keys(r);for(o=0;a=c[o];o++)rd(i,a,r[a])})(t,e);return t}function _l(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}var F0=/\s+/,z0=Object.prototype.toString;function wl(t){return t!==void 0}function bt(t){return new ci(t)}function ci(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}function ee(t){var e=t.parentNode;return e&&e.removeChild(t),t}function Sl(t){for(var e;e=t.firstChild;)ee(e);return t}function od(t){return t.cloneNode(!0)}ci.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~_l(e,t)||e.push(t),wl(this.el.className.baseVal)?this.el.className.baseVal=e.join(" "):this.el.className=e.join(" "),this},ci.prototype.remove=function(t){if(z0.call(t)==="[object RegExp]")return this.removeMatching(t);if(this.list)return this.list.remove(t),this;var e=this.array(),n=_l(e,t);return~n&&e.splice(n,1),this.el.className.baseVal=e.join(" "),this},ci.prototype.removeMatching=function(t){for(var e=this.array(),n=0;n<e.length;n++)t.test(e[n])&&this.remove(e[n]);return this},ci.prototype.toggle=function(t,e){return this.list?(wl(e)?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(wl(e)?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},ci.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(F0);return t[0]===""&&t.shift(),t},ci.prototype.has=ci.prototype.contains=function(t){return this.list?this.list.contains(t):!!~_l(this.array(),t)};var Cl={svg:"http://www.w3.org/2000/svg"},ad='<svg xmlns="'+Cl.svg+'"';function sd(t){var e=!1;t.substring(0,4)==="<svg"?t.indexOf(Cl.svg)===-1&&(t=ad+t.substring(4)):(t=ad+">"+t+"</svg>",e=!0);var n=function(o){var a;return(a=new DOMParser).async=!1,a.parseFromString(o,"text/xml")}(t);if(!e)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function ot(t,e){var n;return t.charAt(0)==="<"?(n=sd(t).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Cl.svg,t),e&&K(n,e),n}var Tl=null;function Al(){return Tl===null&&(Tl=ot("svg")),Tl}function cd(t,e){var n,i,r=Object.keys(e);for(n=0;i=r[n];n++)t[i]=e[i];return t}function go(t){return t?Al().createSVGTransformFromMatrix(t):Al().createSVGTransform()}var ld=/([&<>]{1})/g,$0=/([\n\r"]{1})/g,G0={"&":"&","<":"<",">":">",'"':"'"};function kl(t,e){return t.replace(e,function(n,i){return G0[i]||i})}function ud(t,e){var n,i,r,o,a;switch(t.nodeType){case 3:e.push(kl(t.textContent,ld));break;case 1:if(e.push("<",t.tagName),t.hasAttributes())for(n=0,i=(r=t.attributes).length;n<i;++n)o=r.item(n),e.push(" ",o.name,'="',kl(o.value,$0),'"');if(t.hasChildNodes()){for(e.push(">"),n=0,i=(a=t.childNodes).length;n<i;++n)ud(a.item(n),e);e.push("</",t.tagName,">")}else e.push("/>");break;case 8:e.push("<!--",kl(t.nodeValue,ld),"-->");break;case 4:e.push("<![CDATA[",t.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+t.nodeType)}return e}function U0(t,e){var n=sd(e);if(Sl(t),e){(function(a){return a.nodeName==="#document-fragment"})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o<r.length;o++)nd(r[o],t)}}function pd(t,e){if(e!==void 0){try{U0(t,e)}catch(n){throw new Error("error parsing SVG: "+n.message)}return t}return function(n){for(var i=n.firstChild,r=[];i;)ud(i,r),i=i.nextSibling;return r.join("")}(t)}function H0(t,e){return e instanceof SVGMatrix?t.createSVGTransformFromMatrix(e):e}function bo(t,e){var n=t.transform.baseVal;return e&&(Array.isArray(e)||(e=[e]),function(i,r){var o,a;for(i.clear(),o=0;a=r[o];o++)i.appendItem(H0(i,a))}(n,e)),n.consolidate()}var q0=/^class /;function Pl(t){return Object.prototype.toString.call(t)==="[object Array]"}function Ml(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ja(){var t=Array.prototype.slice.call(arguments);t.length===1&&Pl(t[0])&&(t=t[0]);var e=t.pop();return e.$inject=t,e}var W0=/constructor\s*[^(]*\(\s*([^)]*)\)/m,X0=/^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m,K0=/\/\*([^*]*)\*\//m;function Y0(t){if(typeof t!="function")throw new Error('Cannot annotate "'+t+'". Expected a function!');var e=t.toString().match(function(n){return q0.test(n.toString())}(t)?W0:X0);return e&&e[1]&&e[1].split(",").map(function(n){return(e=n.match(K0))?e[1].trim():n.trim()})||[]}function J0(){var t=[];this.factory=function(e,n){return t.push([e,"factory",n]),this},this.value=function(e,n){return t.push([e,"value",n]),this},this.type=function(e,n){return t.push([e,"type",n]),this},this.forEach=function(e){t.forEach(e)}}function Rl(t,e){e=e||{get:function(f,v){if(n.push(f),v===!1)return null;throw a('No provider for "'+f+'"!')}};var n=[],i=this._providers=Object.create(e._providers||null),r=this._instances=Object.create(null),o=r.injector=this,a=function(f){var v=n.join(" -> ");return n.length=0,new Error(v?f+" (Resolving: "+v+")":f)},c=function(f,v){if(!i[f]&&f.indexOf(".")!==-1){for(var g=f.split("."),b=c(g.shift());g.length;)b=b[g.shift()];return b}if(Ml(r,f))return r[f];if(Ml(i,f)){if(n.indexOf(f)!==-1)throw n.push(f),a("Cannot resolve circular dependency!");return n.push(f),r[f]=i[f][0](i[f][1]),n.pop(),r[f]}return e.get(f,v)},l=function(f,v){if(v===void 0&&(v={}),typeof f!="function"){if(!Pl(f))throw new Error('Cannot invoke "'+f+'". Expected a function!');f=ja(f.slice())}return{fn:f,dependencies:(f.$inject||Y0(f)).map(function(g){return Ml(v,g)?v[g]:c(g)})}},u=function(f){var v=l(f),g=v.fn,b=v.dependencies;return new(Function.prototype.bind.apply(g,[null].concat(b)))},p=function(f,v,g){var b=l(f,g),S=b.fn,w=b.dependencies;return S.apply(v,w)},d=function(f){return ja(function(v){return f.get(v)})},y={factory:p,type:u,value:function(f){return f}};t.forEach(function(f){function v(w,_){return w!=="value"&&Pl(_)&&(_=ja(_.slice())),_}if(f instanceof J0)f.forEach(function(w){var _=w[0],C=w[1],B=w[2];i[_]=[y[C],v(C,B),C]});else if(typeof f=="object")if(f.__exports__){var g=Object.keys(f).reduce(function(w,_){return _.substring(0,2)!=="__"&&(w[_]=f[_]),w},Object.create(null)),b=new Rl((f.__modules__||[]).concat([g]),o),S=ja(function(w){return b.get(w)});f.__exports__.forEach(function(w){i[w]=[S,w,"private",b]})}else Object.keys(f).forEach(function(w){if(f[w][2]!=="private"){var _=f[w][0],C=f[w][1];i[w]=[y[_],v(_,C),_]}else i[w]=f[w]})}),this.get=c,this.invoke=p,this.instantiate=u,this.createChild=function(f,v){if(v&&v.length){var g,b,S,w,_=Object.create(null),C=Object.create(null),B=[],s=[],h=[];for(var m in i)g=i[m],v.indexOf(m)!==-1&&(g[2]==="private"?(b=B.indexOf(g[3]))===-1?(S=g[3].createChild([],v),w=d(S),B.push(g[3]),s.push(S),h.push(w),_[m]=[w,m,"private",S]):_[m]=[h[b],m,"private",s[b]]:_[m]=[g[2],g[1]],C[m]=!0),g[2]!=="factory"&&g[2]!=="type"||!g[1].$scope||v.forEach(function(E){g[1].$scope.indexOf(E)!==-1&&(_[m]=[g[2],g[1]],C[E]=!0)});v.forEach(function(E){if(!C[E])throw new Error('No provider for "'+E+'". Cannot use provider from the parent!')}),f.unshift(_)}return new Rl(f,o)}}var Z0=1e3;function Fn(t,e){var n=this;e=e||Z0,t.on(["render.shape","render.connection"],e,function(i,r){var o=i.type,a=r.element,c=r.gfx,l=r.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(c,a,l):n.drawConnection(c,a,l)}),t.on(["render.getShapePath","render.getConnectionPath"],e,function(i,r){if(n.canRender(r))return i.type==="render.getShapePath"?n.getShapePath(r):n.getConnectionPath(r)})}function gr(t){return t.join(",").replace(/,?([A-z]),?/g,"$1")}function hd(t){for(var e,n="",i=0;e=t[i];i++)n+=e.x+","+e.y+" ";return n}function Nl(t,e){var n=ot("polyline");return K(n,{points:hd(t)}),e&&K(n,e),n}function dd(t){return dt(t,function(e){return!Pt(t,function(n){return n!==e&&md(e,n)})})}function md(t,e){if(e){if(t===e)return e;if(t.parent)return md(t.parent,e)}}function fd(t,e,n){var i=!n||t.indexOf(e)===-1;return i&&t.push(e),i}function Fi(t,e,n){n=n||0,gt(t)||(t=[t]),L(t,function(i,r){var o=e(i,r,n);gt(o)&&o.length&&Fi(o,e,n+1)})}function Va(t,e){return function(n,i,r){var o=[],a=[];return Fi(n,function(c,l,u){fd(o,c,i);var p=c.children;if((r===-1||u<r)&&p&&fd(a,p,i))return p}),o}(t,!e,-1)}function ve(t,e){var n,i,r,o;return e=!!e,gt(t)||(t=[t]),L(t,function(a){var c=a;a.waypoints&&!e&&(c=ve(a.waypoints,!0));var l=c.x,u=c.y,p=c.height||0,d=c.width||0;(l<n||n===void 0)&&(n=l),(u<i||i===void 0)&&(i=u),(l+d>r||r===void 0)&&(r=l+d),(u+p>o||o===void 0)&&(o=u+p)}),{x:n,y:i,height:o-i,width:r-n}}function vd(t){return"waypoints"in t?"connection":"x"in t?"shape":"root"}function yd(t){return!(!t||!t.isFrame)}function xo(t,e){return z({},t||{},e||{})}Fn.prototype.canRender=function(){},Fn.prototype.drawShape=function(){},Fn.prototype.drawConnection=function(){},Fn.prototype.getShapePath=function(){},Fn.prototype.getConnectionPath=function(){};function li(t,e){Fn.call(this,t,1),this.CONNECTION_STYLE=e.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=e.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=e.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}it(li,Fn),li.prototype.canRender=function(){return!0},li.prototype.drawShape=function(t,e,n){var i=ot("rect");return K(i,{x:0,y:0,width:e.width||0,height:e.height||0}),yd(e)?K(i,z({},this.FRAME_STYLE,n||{})):K(i,z({},this.SHAPE_STYLE,n||{})),lt(t,i),i},li.prototype.drawConnection=function(t,e,n){var i=Nl(e.waypoints,z({},this.CONNECTION_STYLE,n||{}));return lt(t,i),i},li.prototype.getShapePath=function(t){var e=t.x,n=t.y,i=t.width;return gr([["M",e,n],["l",i,0],["l",0,t.height],["l",-i,0],["z"]])},li.prototype.getConnectionPath=function(t){var e,n,i=t.waypoints,r=[];for(e=0;n=i[e];e++)n=n.original||n,r.push([e===0?"M":"L",n.x,n.y]);return gr(r)},li.$inject=["eventBus","styles"];const Q0={__init__:["defaultRenderer"],defaultRenderer:["type",li],styles:["type",function(){var t={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},e=this;this.cls=function(n,i,r){return z(this.style(i,r),{class:n})},this.style=function(n,i){gt(n)||i||(i=n,n=[]);var r=De(n,function(o,a){return z(o,t[a]||{})},{});return i?z(r,i):r},this.computeStyle=function(n,i,r){return gt(i)||(r=i,i=[]),e.style(i||[],z({},r,n||{}))}}]};function Yt(t,e){if(!t||!e)return-1;var n=t.indexOf(e);return n!==-1&&t.splice(n,1),n}function Jt(t,e,n){if(t&&e){typeof n!="number"&&(n=-1);var i=t.indexOf(e);if(i!==-1){if(i===n||n===-1)return;t.splice(i,1)}n!==-1?t.splice(n,0,e):t.push(e)}}function Il(t,e){return t&&e?t.indexOf(e):-1}function Eo(t,e){return t&&e?Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):-1}function Dl(t,e,n,i){if(i===void 0&&(i=5),!t||!e||!n)return!1;var r=(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x),o=Eo(t,e);return Math.abs(r/o)<=i}var gd=2;function zn(t,e){var n;return function(i,r){var o;o=gt(i)?i:[i,r];var a=o.slice().shift();return Li(o,function(c){return Math.abs(a.y-c.y)<=gd})}(n=gt(t)?t:[t,e])?"h":!!function(i,r){var o;o=gt(i)?i:[i,r];var a=o.slice().shift();return Li(o,function(c){return Math.abs(a.x-c.x)<=gd})}(n)&&"v"}function bd(t,e,n){return n=n||0,t.x>e.x-n&&t.y>e.y-n&&t.x<e.x+e.width+n&&t.y<e.y+e.height+n}function Bl(t,e){return{x:Math.round(t.x+(e.x-t.x)/2),y:Math.round(t.y+(e.y-t.y)/2)}}var tx=/,?([a-z]),?/gi,xd=parseFloat,Zt=Math,ui=Zt.PI,An=Zt.min,kn=Zt.max,Ed=Zt.pow,pi=Zt.abs,ex=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,nx=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,Fa=Array.isArray||function(t){return t instanceof Array};function Ol(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function _o(t){if(typeof t=="function"||Object(t)!==t)return t;var e=new t.constructor;for(var n in t)Ol(t,n)&&(e[n]=_o(t[n]));return e}function br(t){var e=br.ps=br.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var n in e)Ol(e,n)&&n!=t&&(e[n].sleep--,!e[n].sleep&&delete e[n])}),e[t]}function Ll(t,e,n,i){return arguments.length===1&&(e=t.y,n=t.width,i=t.height,t=t.x),{x:t,y:e,width:n,height:i,x2:t+n,y2:e+i}}function _d(){return this.join(",").replace(tx,"$1")}function za(t){var e=_o(t);return e.toString=_d,e}function wd(t,e,n,i,r,o,a,c,l){var u=1-l,p=Ed(u,3),d=Ed(u,2),y=l*l*l,f=p*e+3*d*l*i+3*u*l*l*o+y*c;return{x:$a(p*t+3*d*l*n+3*u*l*l*r+y*a),y:$a(f)}}function Sd(t){var e=ax.apply(null,t);return Ll(e.x0,e.y0,e.x1-e.x0,e.y1-e.y0)}function hi(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height}function Cd(t,e,n,i,r){return t*(t*(-3*e+9*n-9*i+3*r)+6*e-12*n+6*i)-3*e+3*n}function Td(t,e,n,i,r,o,a,c,l){l==null&&(l=1);for(var u=(l=l>1?1:l<0?0:l)/2,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],y=0,f=0;f<12;f++){var v=u*p[f]+u,g=Cd(v,t,n,r,a),b=Cd(v,e,i,o,c),S=g*g+b*b;y+=d[f]*Zt.sqrt(S)}return u*y}function ix(t,e,n,i,r,o,a,c){if(!(kn(t,n)<An(r,a)||An(t,n)>kn(r,a)||kn(e,i)<An(o,c)||An(e,i)>kn(o,c))){var l=(t*i-e*n)*(o-c)-(e-i)*(r*c-o*a),u=(t-n)*(o-c)-(e-i)*(r-a);if(u){var p=$a(((t*i-e*n)*(r-a)-(t-n)*(r*c-o*a))/u),d=$a(l/u),y=+p.toFixed(2),f=+d.toFixed(2);if(!(y<+An(t,n).toFixed(2)||y>+kn(t,n).toFixed(2)||y<+An(r,a).toFixed(2)||y>+kn(r,a).toFixed(2)||f<+An(e,i).toFixed(2)||f>+kn(e,i).toFixed(2)||f<+An(o,c).toFixed(2)||f>+kn(o,c).toFixed(2)))return{x:p,y:d}}}}function $a(t){return Math.round(1e11*t)/1e11}function rx(t,e,n){if(!function(m,E){return m=Ll(m),hi(E=Ll(E),m.x,m.y)||hi(E,m.x2,m.y)||hi(E,m.x,m.y2)||hi(E,m.x2,m.y2)||hi(m,E.x,E.y)||hi(m,E.x2,E.y)||hi(m,E.x,E.y2)||hi(m,E.x2,E.y2)||(m.x<E.x2&&m.x>E.x||E.x<m.x2&&E.x>m.x)&&(m.y<E.y2&&m.y>E.y||E.y<m.y2&&E.y>m.y)}(Sd(t),Sd(e)))return n?0:[];for(var i=Td.apply(0,t),r=Td.apply(0,e),o=Ad(t)?1:~~(i/5)||1,a=Ad(e)?1:~~(r/5)||1,c=[],l=[],u={},p=n?0:[],d=0;d<o+1;d++){var y=wd.apply(0,t.concat(d/o));c.push({x:y.x,y:y.y,t:d/o})}for(d=0;d<a+1;d++)y=wd.apply(0,e.concat(d/a)),l.push({x:y.x,y:y.y,t:d/a});for(d=0;d<o;d++)for(var f=0;f<a;f++){var v,g=c[d],b=c[d+1],S=l[f],w=l[f+1],_=pi(b.x-g.x)<.01?"y":"x",C=pi(w.x-S.x)<.01?"y":"x",B=ix(g.x,g.y,b.x,b.y,S.x,S.y,w.x,w.y);if(B){if(u[v=B.x.toFixed(9)+"#"+B.y.toFixed(9)])continue;u[v]=!0;var s=g.t+pi((B[_]-g[_])/(b[_]-g[_]))*(b.t-g.t),h=S.t+pi((B[C]-S[C])/(w[C]-S[C]))*(w.t-S.t);s>=0&&s<=1&&h>=0&&h<=1&&(n?p++:p.push({x:B.x,y:B.y,t1:s,t2:h}))}}return p}function ox(t){var e=br(t);if(e.abs)return za(e.abs);if(Fa(t)&&Fa(t&&t[0])||(t=function(S){if(!S)return null;var w=br(S);if(w.arr)return _o(w.arr);var _={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},C=[];return Fa(S)&&Fa(S[0])&&(C=_o(S)),C.length||String(S).replace(ex,function(B,s,h){var m=[],E=s.toLowerCase();for(h.replace(nx,function(T,M){M&&m.push(+M)}),E=="m"&&m.length>2&&(C.push([s].concat(m.splice(0,2))),E="l",s=s=="m"?"l":"L");m.length>=_[E]&&(C.push([s].concat(m.splice(0,_[E]))),_[E]););}),C.toString=br.toString,w.arr=_o(C),C}(t)),!t||!t.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,c=0,l=0;t[0][0]=="M"&&(a=r=+t[0][1],c=o=+t[0][2],l++,i[0]=["M",r,o]);for(var u,p,d=l,y=t.length;d<y;d++){if(i.push(u=[]),(n=(p=t[d])[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,v=p.length;f<v;f++)u[f]=+p[f]+(f%2?r:o)}else for(var g=0,b=p.length;g<b;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=_d,e.abs=za(i),i}function Ad(t){return t[0]===t[2]&&t[1]===t[3]&&t[4]===t[6]&&t[5]===t[7]}function Ga(t,e,n,i){return[t,e,n,i,n,i]}function kd(t,e,n,i,r,o){var a=.3333333333333333,c=2/3;return[a*t+c*n,a*e+c*i,a*r+c*n,a*o+c*i,r,o]}function Pd(t,e,n,i,r,o,a,c,l,u){var p,d,y=120*ui/180,f=ui/180*(+r||0),v=[],g=(d=function(It,qt,_t){return{x:It*Zt.cos(_t)-qt*Zt.sin(_t),y:It*Zt.sin(_t)+qt*Zt.cos(_t)}},function It(){var qt=Array.prototype.slice.call(arguments,0),_t=qt.join("\u2400"),zt=It.cache=It.cache||{},Kt=It.count=It.count||[];return Ol(zt,_t)?(function(Rt,he){for(var St=0,$t=Rt.length;St<$t;St++)if(Rt[St]===he)return Rt.push(Rt.splice(St,1)[0])}(Kt,_t),zt[_t]):(Kt.length>=1e3&&delete zt[Kt.shift()],Kt.push(_t),zt[_t]=d.apply(0,qt),zt[_t])});if(u)m=u[0],E=u[1],s=u[2],h=u[3];else{t=(p=g(t,e,-f)).x,e=p.y;var b=(t-(c=(p=g(c,l,-f)).x))/2,S=(e-(l=p.y))/2,w=b*b/(n*n)+S*S/(i*i);w>1&&(n*=w=Zt.sqrt(w),i*=w);var _=n*n,C=i*i,B=(o==a?-1:1)*Zt.sqrt(pi((_*C-_*S*S-C*b*b)/(_*S*S+C*b*b))),s=B*n*S/i+(t+c)/2,h=B*-i*b/n+(e+l)/2,m=Zt.asin(((e-h)/i).toFixed(9)),E=Zt.asin(((l-h)/i).toFixed(9));(m=t<s?ui-m:m)<0&&(m=2*ui+m),(E=c<s?ui-E:E)<0&&(E=2*ui+E),a&&m>E&&(m-=2*ui),!a&&E>m&&(E-=2*ui)}var T=E-m;if(pi(T)>y){var M=E,I=c,$=l;E=m+y*(a&&E>m?1:-1),v=Pd(c=s+n*Zt.cos(E),l=h+i*Zt.sin(E),n,i,r,0,a,I,$,[E,M,s,h])}T=E-m;var P=Zt.cos(m),x=Zt.sin(m),N=Zt.cos(E),j=Zt.sin(E),G=Zt.tan(T/4),X=4/3*n*G,tt=4/3*i*G,rt=[t,e],st=[t+X*x,e-tt*P],H=[c+X*j,l-tt*N],q=[c,l];if(st[0]=2*rt[0]-st[0],st[1]=2*rt[1]-st[1],u)return[st,H,q].concat(v);for(var xt=[],Xt=0,ce=(v=[st,H,q].concat(v).join().split(",")).length;Xt<ce;Xt++)xt[Xt]=Xt%2?g(v[Xt-1],v[Xt],f).y:g(v[Xt],v[Xt+1],f).x;return xt}function ax(t,e,n,i,r,o,a,c){for(var l,u,p,d,y,f,v,g,b=[],S=[[],[]],w=0;w<2;++w)if(w==0?(u=6*t-12*n+6*r,l=-3*t+9*n-9*r+3*a,p=3*n-3*t):(u=6*e-12*i+6*o,l=-3*e+9*i-9*o+3*c,p=3*i-3*e),pi(l)<1e-12){if(pi(u)<1e-12)continue;0<(d=-p/u)&&d<1&&b.push(d)}else v=u*u-4*p*l,g=Zt.sqrt(v),v<0||(0<(y=(-u+g)/(2*l))&&y<1&&b.push(y),0<(f=(-u-g)/(2*l))&&f<1&&b.push(f));for(var _,C=b.length,B=C;C--;)_=1-(d=b[C]),S[0][C]=_*_*_*t+3*_*_*d*n+3*_*d*d*r+d*d*d*a,S[1][C]=_*_*_*e+3*_*_*d*i+3*_*d*d*o+d*d*d*c;return S[0][B]=t,S[1][B]=e,S[0][B+1]=a,S[1][B+1]=c,S[0].length=S[1].length=B+2,{x0:An.apply(0,S[0]),y0:An.apply(0,S[1]),x1:kn.apply(0,S[0]),y1:kn.apply(0,S[1])}}function Md(t){var e=br(t);if(e.curve)return za(e.curve);for(var n=ox(t),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},r=function(f,v,g){var b,S;if(!f)return["C",v.x,v.y,v.x,v.y,v.x,v.y];switch(!(f[0]in{T:1,Q:1})&&(v.qx=v.qy=null),f[0]){case"M":v.X=f[1],v.Y=f[2];break;case"A":f=["C"].concat(Pd.apply(0,[v.x,v.y].concat(f.slice(1))));break;case"S":g=="C"||g=="S"?(b=2*v.x-v.bx,S=2*v.y-v.by):(b=v.x,S=v.y),f=["C",b,S].concat(f.slice(1));break;case"T":g=="Q"||g=="T"?(v.qx=2*v.x-v.qx,v.qy=2*v.y-v.qy):(v.qx=v.x,v.qy=v.y),f=["C"].concat(kd(v.x,v.y,v.qx,v.qy,f[1],f[2]));break;case"Q":v.qx=f[1],v.qy=f[2],f=["C"].concat(kd(v.x,v.y,f[1],f[2],f[3],f[4]));break;case"L":f=["C"].concat(Ga(v.x,v.y,f[1],f[2]));break;case"H":f=["C"].concat(Ga(v.x,v.y,f[1],v.y));break;case"V":f=["C"].concat(Ga(v.x,v.y,v.x,f[1]));break;case"Z":f=["C"].concat(Ga(v.x,v.y,v.X,v.Y))}return f},o=function(f,v){if(f[v].length>7){f[v].shift();for(var g=f[v];g.length;)a[v]="A",f.splice(v++,0,["C"].concat(g.splice(0,6)));f.splice(v,1),p=n.length}},a=[],c="",l="",u=0,p=n.length;u<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 d=n[u],y=d.length;i.x=d[y-2],i.y=d[y-1],i.bx=xd(d[y-4])||i.x,i.by=xd(d[y-3])||i.y}return e.curve=za(n),n}const Rd=ro(function(t,e,n){t=Md(t),e=Md(e);for(var i,r,o,a,c,l,u,p,d,y,f=n?0:[],v=0,g=t.length;v<g;v++){var b=t[v];if(b[0]=="M")i=c=b[1],r=l=b[2];else{b[0]=="C"?(d=[i,r].concat(b.slice(1)),i=d[6],r=d[7]):(d=[i,r,i,r,c,l,c,l],i=c,r=l);for(var S=0,w=e.length;S<w;S++){var _=e[S];if(_[0]=="M")o=u=_[1],a=p=_[2];else{_[0]=="C"?(y=[o,a].concat(_.slice(1)),o=y[6],a=y[7]):(y=[o,a,o,a,u,p,u,p],o=u,a=p);var C=rx(d,y,n);if(n)f+=C;else{for(var B=0,s=C.length;B<s;B++)C[B].segment1=v,C[B].segment2=S,C[B].bez1=d,C[B].bez2=y;f=f.concat(C)}}}}}return f});function Nd(t){return{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}}function zi(t){return{x:Math.round(t.x),y:Math.round(t.y)}}function at(t){return{top:t.y,right:t.x+(t.width||0),bottom:t.y+(t.height||0),left:t.x}}function jl(t){return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}function ft(t){return zi({x:t.x+(t.width||0)/2,y:t.y+(t.height||0)/2})}function ye(t,e,n){te(n=n||0)||(n={x:n,y:n});var i=at(t),r=at(e),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 Vl(t,e,n){var i=Rd(t,e);return i.length===1||i.length===2&&Eo(i[0],i[1])<1?zi(i[0]):i.length>1?(i=We(i,function(r){var o=Math.floor(100*r.t2)||1;return o=((o=100-o)<10?"0":"")+o,r.segment2+"#"+o}),zi(i[n?0:i.length-1])):null}function Ua(t,e){return Math.round(t*e)/e}function Id(t){return pt(t)?t+"px":t}function Dd(t,e,n){var i=ot("g");bt(i).add(e);var r=n!==void 0?n:t.childNodes.length-1;return t.insertBefore(i,t.childNodes[r]||null),i}var Ha="base",Fl="djs-element-hidden",sx={shape:["x","y","width","height"],connection:["waypoints"]};function vt(t,e,n,i){this._eventBus=e,this._elementRegistry=i,this._graphicsFactory=n,this._init(t||{})}function Bd(t,e){var n="matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")";t.setAttribute("transform",n)}vt.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],vt.prototype._init=function(t){var e=this._eventBus,n=this._container=function(o){var a=(o=z({},{width:"100%",height:"100%"},o)).container||document.body,c=document.createElement("div");return c.setAttribute("class","djs-container"),z(c.style,{position:"relative",overflow:"hidden",width:Id(o.width),height:Id(o.height)}),a.appendChild(c),c}(t),i=this._svg=ot("svg");K(i,{width:"100%",height:"100%"}),lt(n,i);var r=this._viewport=Dd(i,"viewport");this._layers={},this._planes={},t.deferUpdate!==!1&&(this._viewboxChanged=fl(we(this._viewboxChanged,this),300)),e.on("diagram.init",function(){e.fire("canvas.init",{svg:i,viewport:r})},this),e.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","plane.set"],function(){delete this._cachedViewbox},this),e.on("diagram.destroy",500,this._destroy,this),e.on("diagram.clear",500,this._clear,this)},vt.prototype._destroy=function(t){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._activePlane,delete this._viewport},vt.prototype._clear=function(){var t=this;this._elementRegistry.getAll().forEach(function(e){var n=vd(e);n==="root"?t.setRootElementForPlane(null,t.findPlane(e),!0):t._removeElement(e,n)}),this._activePlane=null,this._planes={},delete this._cachedViewbox},vt.prototype.getDefaultLayer=function(){return this.getLayer(Ha,0)},vt.prototype.getLayer=function(t,e){if(!t)throw new Error("must specify a name");var n=this._layers[t];if(n||(n=this._layers[t]=this._createLayer(t,e)),e!==void 0&&n.index!==e)throw new Error("layer <"+t+"> already created at index <"+e+">");return n.group},vt.prototype._createLayer=function(t,e){e===void 0&&(e=1);var n=De(this._layers,function(i,r){return e>=r.index&&i++,i},0);return{group:Dd(this._viewport,"layer-"+t,n),index:e}},vt.prototype.getPlane=function(t){if(!t)throw new Error("must specify a name");return this._planes[t]},vt.prototype.createPlane=function(t,e){if(!t)throw new Error("must specify a name");if(this._planes[t])throw new Error("plane "+t+" already exists");e||(e={id:"__implicitroot"+t,children:[],isImplicit:!0});var n=this.getLayer(t,0);bt(n).add(Fl);var i=this._planes[t]={layer:n,name:t,rootElement:null};return this.setRootElementForPlane(e,i),i},vt.prototype.setActivePlane=function(t){if(!t)throw new Error("must specify a plane");return typeof t=="string"&&(t=this.getPlane(t)),this._activePlane&&bt(this._activePlane.layer).add(Fl),this._activePlane=t,bt(t.layer).remove(Fl),t.rootElement&&this._elementRegistry.updateGraphics(t.rootElement,this._svg,!0),this._eventBus.fire("plane.set",{plane:t}),t},vt.prototype.getActiveLayer=function(){return this.getActivePlane().layer},vt.prototype.getActivePlane=function(){var t=this._activePlane;return t||(t=this.createPlane(Ha),this.setActivePlane(Ha)),t},vt.prototype.findPlane=function(t){typeof t=="string"&&(t=this._elementRegistry.get(t));var e=function(n){for(;n.parent;)n=n.parent;return n}(t);return Pt(this._planes,function(n){return n.rootElement===e})},vt.prototype.getContainer=function(){return this._container},vt.prototype._updateMarker=function(t,e,n){var i;t.id||(t=this._elementRegistry.get(t)),(i=this._elementRegistry._elements[t.id])&&(L([i.gfx,i.secondaryGfx],function(r){r&&(n?bt(r).add(e):bt(r).remove(e))}),this._eventBus.fire("element.marker.update",{element:t,gfx:i.gfx,marker:e,add:!!n}))},vt.prototype.addMarker=function(t,e){this._updateMarker(t,e,!0)},vt.prototype.removeMarker=function(t,e){this._updateMarker(t,e,!1)},vt.prototype.hasMarker=function(t,e){return t.id||(t=this._elementRegistry.get(t)),bt(this.getGraphics(t)).has(e)},vt.prototype.toggleMarker=function(t,e){this.hasMarker(t,e)?this.removeMarker(t,e):this.addMarker(t,e)},vt.prototype.getRootElement=function(){return this.getActivePlane().rootElement},vt.prototype.setRootElement=function(t,e){var n=this._activePlane;if(n)return this.setRootElementForPlane(t,n,e);var i=this.createPlane(Ha,t);return this.setActivePlane(i),i.rootElement},vt.prototype.setRootElementForPlane=function(t,e,n){typeof e=="string"&&(e=this.getPlane(e)),t&&this._ensureValid("root",t);var i=e.rootElement,r=this._elementRegistry,o=this._eventBus;if(i){if(!n)throw new Error("rootElement already set, need to specify override");o.fire("root.remove",{element:i}),o.fire("root.removed",{element:i}),r.remove(i)}if(t){var a=e.layer;o.fire("root.add",{element:t}),r.add(t,a),o.fire("root.added",{element:t,gfx:a}),e===this._activePlane&&this._elementRegistry.updateGraphics(t,this._svg,!0)}return e.rootElement=t,t},vt.prototype._ensureValid=function(t,e){if(!e.id)throw new Error("element must have an id");if(this._elementRegistry.get(e.id))throw new Error("element with id "+e.id+" already exists");var n=sx[t],i=Li(n,function(r){return e[r]!==void 0});if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+t)},vt.prototype._setParent=function(t,e,n){Jt(e.children,t,n),t.parent=e},vt.prototype._addElement=function(t,e,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(t,e),r.fire(t+".add",{element:e,parent:n}),this._setParent(e,n,i);var a=o.create(t,e,i);return this._elementRegistry.add(e,a),o.update(t,e,a),r.fire(t+".added",{element:e,gfx:a}),e},vt.prototype.addShape=function(t,e,n){return this._addElement("shape",t,e,n)},vt.prototype.addConnection=function(t,e,n){return this._addElement("connection",t,e,n)},vt.prototype._removeElement=function(t,e){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(t=n.get(t.id||t))return r.fire(e+".remove",{element:t}),i.remove(t),Yt(t.parent&&t.parent.children,t),t.parent=null,r.fire(e+".removed",{element:t}),n.remove(t),t},vt.prototype.removeShape=function(t){return this._removeElement(t,"shape")},vt.prototype.removeConnection=function(t){return this._removeElement(t,"connection")},vt.prototype.getGraphics=function(t,e){return this._elementRegistry.getGraphics(t,e)},vt.prototype._changeViewbox=function(t){this._eventBus.fire("canvas.viewbox.changing"),t.apply(this),this._cachedViewbox=null,this._viewboxChanged()},vt.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},vt.prototype.viewbox=function(t){if(t===void 0&&this._cachedViewbox)return this._cachedViewbox;var e,n,i,r,o,a,c=this._viewport,l=this.getSize();return t?(this._changeViewbox(function(){r=Math.min(l.width/t.width,l.height/t.height);var u=this._svg.createSVGMatrix().scale(r).translate(-t.x,-t.y);bo(c,u)}),t):(e=this._activePlane&&this._activePlane.layer.getBBox()||{},n=(i=bo(c))?i.matrix:function(u,p,d,y,f,v){var g=Al().createSVGMatrix();switch(arguments.length){case 0:return g;case 1:return cd(g,u);case 6:return cd(g,{a:u,b:p,c:d,d:y,e:f,f:v})}}(),r=Ua(n.a,1e3),o=Ua(-n.e||0,1e3),a=Ua(-n.f||0,1e3),t=this._cachedViewbox={x:o?o/r:0,y:a?a/r:0,width:l.width/r,height:l.height/r,scale:r,inner:{width:e.width||0,height:e.height||0,x:e.x||0,y:e.y||0},outer:l})},vt.prototype.scroll=function(t){var e=this._viewport,n=e.getCTM();return t&&this._changeViewbox(function(){t=z({dx:0,dy:0},t||{}),n=this._svg.createSVGMatrix().translate(t.dx,t.dy).multiply(n),Bd(e,n)}),{x:n.e,y:n.f}},vt.prototype.scrollToElement=function(t,e){var n=100;typeof t=="string"&&(t=this._elementRegistry.get(t));var i=this.findPlane(t);i!==this._activePlane&&this.setActivePlane(i),e||(e={}),typeof e=="number"&&(n=e),e={top:e.top||n,right:e.right||n,bottom:e.bottom||n,left:e.left||n};var r,o,a=ve(t),c=at(a),l=this.viewbox(),u=this.zoom();l.y+=e.top/u,l.x+=e.left/u,l.width-=(e.right+e.left)/u,l.height-=(e.bottom+e.top)/u;var p=at(l);if(a.width<l.width&&a.height<l.height){var d=Math.max(0,c.right-p.right),y=Math.min(0,c.left-p.left),f=Math.max(0,c.bottom-p.bottom),v=Math.min(0,c.top-p.top);r=d||y,o=f||v}else r=a.x-l.x,o=a.y-l.y;this.scroll({dx:-r*u,dy:-o*u})},vt.prototype.zoom=function(t,e){return t?t==="fit-viewport"?this._fitViewport(e):(this._changeViewbox(function(){typeof e!="object"&&(n=this.viewbox().outer,e={x:n.width/2,y:n.height/2}),i=this._setZoom(t,e)}),Ua(i.a,1e3)):this.viewbox(t).scale;var n,i},vt.prototype._fitViewport=function(t){var e,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&&!t?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(e=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(t?o.width/2-r.width/e/2:0),y:o.y+(t?o.height/2-r.height/e/2:0),width:r.width/e,height:r.height/e}),this.viewbox(n),this.viewbox(!1).scale},vt.prototype._setZoom=function(t,e){var n,i,r,o,a=this._svg,c=this._viewport,l=a.createSVGMatrix(),u=a.createSVGPoint(),p=(i=c.getCTM()).a;return e?(n=z(u,e).matrixTransform(i.inverse()),r=l.translate(n.x,n.y).scale(1/p*t).translate(-n.x,-n.y),o=i.multiply(r)):o=l.scale(t),Bd(this._viewport,o),o},vt.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},vt.prototype.getAbsoluteBBox=function(t){var e,n=this.viewbox();return t.waypoints?e=this.getGraphics(t).getBBox():e=t,{x:e.x*n.scale-n.x*n.scale,y:e.y*n.scale-n.y*n.scale,width:e.width*n.scale,height:e.height*n.scale}},vt.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var xr="data-element-id";function Ge(t){this._elements={},this._eventBus=t}Ge.$inject=["eventBus"],Ge.prototype.add=function(t,e,n){var i=t.id;this._validateId(i),K(e,xr,i),n&&K(n,xr,i),this._elements[i]={element:t,gfx:e,secondaryGfx:n}},Ge.prototype.remove=function(t){var e=this._elements,n=t.id||t,i=n&&e[n];i&&(K(i.gfx,xr,""),i.secondaryGfx&&K(i.secondaryGfx,xr,""),delete e[n])},Ge.prototype.updateId=function(t,e){this._validateId(e),typeof t=="string"&&(t=this.get(t)),this._eventBus.fire("element.updateId",{element:t,newId:e});var n=this.getGraphics(t),i=this.getGraphics(t,!0);this.remove(t),t.id=e,this.add(t,n,i)},Ge.prototype.updateGraphics=function(t,e,n){var i=t.id||t,r=this._elements[i];return n?r.secondaryGfx=e:r.gfx=e,K(e,xr,i),e},Ge.prototype.get=function(t){var e;e=typeof t=="string"?t:t&&K(t,xr);var n=this._elements[e];return n&&n.element},Ge.prototype.filter=function(t){var e=[];return this.forEach(function(n,i){t(n,i)&&e.push(n)}),e},Ge.prototype.find=function(t){for(var e=this._elements,n=Object.keys(e),i=0;i<n.length;i++){var r=e[n[i]],o=r.element;if(t(o,r.gfx))return o}},Ge.prototype.getAll=function(){return this.filter(function(t){return t})},Ge.prototype.forEach=function(t){var e=this._elements;Object.keys(e).forEach(function(n){var i=e[n],r=i.element,o=i.gfx;return t(r,o)})},Ge.prototype.getGraphics=function(t,e){var n=t.id||t,i=this._elements[n];return i&&(e?i.secondaryGfx:i.gfx)},Ge.prototype._validateId=function(t){if(!t)throw new Error("element must have an id");if(this._elements[t])throw new Error("element with id "+t+" already added")};var zl={exports:{}},qa={};qa.extend=function(t,e,n,i){var r=n.inverse;return Object.defineProperty(t,"remove",{value:function(o){var a=this.indexOf(o);return a!==-1&&(this.splice(a,1),e.unset(o,r,i)),o}}),Object.defineProperty(t,"contains",{value:function(o){return this.indexOf(o)!==-1}}),Object.defineProperty(t,"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&&e.set(o,r,i)}}),Object.defineProperty(t,"__refs_collection",{value:!0}),t},qa.isExtended=function(t){return t.__refs_collection===!0};var Od=qa;function Ld(t,e,n){var i=Od.extend(n[e.name]||[],t,e,n);Object.defineProperty(n,e.name,{enumerable:e.enumerable,value:i}),i.length&&i.forEach(function(r){t.set(r,e.inverse,n)})}function di(t,e){if(!(this instanceof di))return new di(t,e);t.inverse=e,e.inverse=t,this.props={},this.props[t.name]=t,this.props[e.name]=e}di.prototype.bind=function(t,e){if(typeof e=="string"){if(!this.props[e])throw new Error("no property <"+e+"> in ref");e=this.props[e]}e.collection?Ld(this,e,t):function(n,i,r){var o=i.inverse,a=r[i.name];Object.defineProperty(r,i.name,{configurable:i.configurable,enumerable:i.enumerable,get:function(){return a},set:function(c){if(c!==a){var l=a;a=null,l&&n.unset(l,o,r),a=c,n.set(a,o,r)}}})}(this,e,t)},di.prototype.ensureRefsCollection=function(t,e){var n=t[e.name];return Od.isExtended(n)||Ld(this,e,t),n},di.prototype.ensureBound=function(t,e){(function(n,i){return Object.prototype.hasOwnProperty.call(n,i.name||i)})(t,e)||this.bind(t,e)},di.prototype.unset=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?this.ensureRefsCollection(t,e).remove(n):t[e.name]=void 0)},di.prototype.set=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?this.ensureRefsCollection(t,e).add(n):t[e.name]=n)};var cx=di;zl.exports=cx,zl.exports.Collection=qa;const Er=ro(zl.exports);var jd=new Er({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Vd=new Er({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Fd=new Er({name:"attachers",collection:!0},{name:"host"}),zd=new Er({name:"outgoing",collection:!0},{name:"source"}),$d=new Er({name:"incoming",collection:!0},{name:"target"});function wo(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(t){var e=this.label,n=this.labels;!t&&e?n.remove(e):n.add(t,0)}}),jd.bind(this,"parent"),Vd.bind(this,"labels"),zd.bind(this,"outgoing"),$d.bind(this,"incoming")}function _r(){wo.call(this),jd.bind(this,"children"),Fd.bind(this,"host"),Fd.bind(this,"attachers")}function Gd(){_r.call(this)}function Wa(){_r.call(this),Vd.bind(this,"labelTarget")}function Ud(){wo.call(this),zd.bind(this,"source"),$d.bind(this,"target")}it(_r,wo),it(Gd,_r),it(Wa,_r),it(Ud,wo);var lx={connection:Ud,shape:_r,label:Wa,root:Gd};function $n(){this._uid=12}$n.prototype.createRoot=function(t){return this.create("root",t)},$n.prototype.createLabel=function(t){return this.create("label",t)},$n.prototype.createShape=function(t){return this.create("shape",t)},$n.prototype.createConnection=function(t){return this.create("connection",t)},$n.prototype.create=function(t,e){return(e=z({},e||{})).id||(e.id=t+"_"+this._uid++),function(n,i){var r=lx[n];if(!r)throw new Error("unknown type: <"+n+">");return z(new r,i)}(t,e)};var Xa="__fn",ux=Array.prototype.slice;function Be(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function So(){}function Ka(t){return t.childNodes[0]}function $l(t,e,n,i,r){var o=go();o.setTranslate(e,n);var a=go();a.setRotate(i||0,0,0);var c=go();c.setScale(r||1,r||1),bo(t,[o,a,c])}function Oe(t,e,n){var i=go();i.setTranslate(e,n),bo(t,i)}function Hd(t,e){var n=go();n.setRotate(e,0,0),bo(t,n)}function Ue(t,e){this._eventBus=t,this._elementRegistry=e}function qd(t,e,n){var i=n||e.firstChild;t!==i&&e.insertBefore(t,i)}Be.prototype.on=function(t,e,n,i){if(t=gt(t)?t:[t],fe(e)&&(i=n,n=e,e=1e3),!pt(e))throw new Error("priority must be a number");var r=n;i&&((r=we(n,i))[Xa]=n[Xa]||n);var o=this;t.forEach(function(a){o._addListener(a,{priority:e,callback:r,next:null})})},Be.prototype.once=function(t,e,n,i){var r=this;if(fe(e)&&(i=n,n=e,e=1e3),!pt(e))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(i,arguments);return r.off(t,o),a}o[Xa]=n,this.on(t,e,o)},Be.prototype.off=function(t,e){t=gt(t)?t:[t];var n=this;t.forEach(function(i){n._removeListener(i,e)})},Be.prototype.createEvent=function(t){var e=new So;return e.init(t),e},Be.prototype.fire=function(t,e){var n,i,r,o;if(o=ux.call(arguments),typeof t=="object"&&(t=(e=t).type),!t)throw new Error("no event type specified");if(i=this._listeners[t]){n=e instanceof So?e:this.createEvent(e),o[0]=n;var a=n.type;t!==a&&(n.type=t);try{r=this._invokeListeners(n,o,i)}finally{t!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},Be.prototype.handleError=function(t){return this.fire("error",{error:t})===!1},Be.prototype._destroy=function(){this._listeners={}},Be.prototype._invokeListeners=function(t,e,n){for(var i;n&&!t.cancelBubble;)i=this._invokeListener(t,e,n),n=n.next;return i},Be.prototype._invokeListener=function(t,e,n){var i;if(n.callback.__isTomb)return i;try{i=function(r,o){return r.apply(null,o)}(n.callback,e),i!==void 0&&(t.returnValue=i,t.stopPropagation()),i===!1&&t.preventDefault()}catch(r){if(!this.handleError(r))throw r}return i},Be.prototype._addListener=function(t,e){var n,i=this._getListeners(t);if(i){for(;i;){if(i.priority<e.priority)return e.next=i,void(n?n.next=e:this._setListeners(t,e));n=i,i=i.next}n.next=e}else this._setListeners(t,e)},Be.prototype._getListeners=function(t){return this._listeners[t]},Be.prototype._setListeners=function(t,e){this._listeners[t]=e},Be.prototype._removeListener=function(t,e){var n,i,r,o=this._getListeners(t);if(e)for(;o;)n=o.next,(r=o.callback)!==e&&r[Xa]!==e||(i?i.next=n:this._setListeners(t,n)),i=o,o=n;else this._setListeners(t,null)},So.prototype.stopPropagation=function(){this.cancelBubble=!0},So.prototype.preventDefault=function(){this.defaultPrevented=!0},So.prototype.init=function(t){z(this,t||{})},Ue.$inject=["eventBus","elementRegistry"],Ue.prototype._getChildrenContainer=function(t){var e,n=this._elementRegistry.getGraphics(t);return t.parent?(e=function(i){return i.parentNode.childNodes[1]}(n),e||(bt(e=ot("g")).add("djs-children"),lt(n.parentNode,e))):e=n,e},Ue.prototype._clear=function(t){var e=Ka(t);return Oa(e),e},Ue.prototype._createContainer=function(t,e,n,i){var r=ot("g");bt(r).add("djs-group"),n!==void 0?qd(r,e,e.childNodes[n]):lt(e,r);var o=ot("g");bt(o).add("djs-element"),bt(o).add("djs-"+t),i&&bt(o).add("djs-frame"),lt(r,o);var a=ot("g");return bt(a).add("djs-visual"),lt(o,a),o},Ue.prototype.create=function(t,e,n){var i=this._getChildrenContainer(e.parent);return this._createContainer(t,i,n,yd(e))},Ue.prototype.updateContainments=function(t){var e,n=this,i=this._elementRegistry;e=De(t,function(r,o){return o.parent&&(r[o.parent.id]=o.parent),r},{}),L(e,function(r){var o=r.children;if(o){var a=n._getChildrenContainer(r);L(o.slice().reverse(),function(c){qd(i.getGraphics(c).parentNode,a)})}})},Ue.prototype.drawShape=function(t,e){return this._eventBus.fire("render.shape",{gfx:t,element:e})},Ue.prototype.getShapePath=function(t){return this._eventBus.fire("render.getShapePath",t)},Ue.prototype.drawConnection=function(t,e){return this._eventBus.fire("render.connection",{gfx:t,element:e})},Ue.prototype.getConnectionPath=function(t){return this._eventBus.fire("render.getConnectionPath",t)},Ue.prototype.update=function(t,e,n){if(e.parent){var i=this._clear(n);if(t==="shape")this.drawShape(i,e),Oe(n,e.x,e.y);else{if(t!=="connection")throw new Error("unknown type: "+t);this.drawConnection(i,e)}e.hidden?K(n,"display","none"):K(n,"display","block")}},Ue.prototype.remove=function(t){ee(this._elementRegistry.getGraphics(t).parentNode)};const px={__depends__:[Q0],__init__:["canvas"],canvas:["type",vt],elementRegistry:["type",Ge],elementFactory:["type",$n],eventBus:["type",Be],graphicsFactory:["type",Ue]};function hx(t){var e=[],n=[];function i(o){return e.indexOf(o)>=0}t.forEach(function o(a){i(a)||((a.__depends__||[]).forEach(o),i(a)||(function(c){e.push(c)}(a),(a.__init__||[]).forEach(function(c){n.push(c)})))});var r=new Rl(e);return n.forEach(function(o){try{r[typeof o=="string"?"get":"invoke"](o)}catch(a){throw a}}),r}function wr(t,e){this.injector=e=e||function(n){return hx([{config:["value",n=n||{}]},px].concat(n.modules||[]))}(t),this.get=e.get,this.invoke=e.invoke,this.get("eventBus").fire("diagram.init")}function Gl(){}function Wd(t,e){this.model=t,this.properties=e}wr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},wr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Gl.prototype.get=function(t){return this.$model.properties.get(this,t)},Gl.prototype.set=function(t,e){this.$model.properties.set(this,t,e)},Wd.prototype.createType=function(t){var e=this.model,n=this.properties,i=Object.create(Gl.prototype);L(t.properties,function(a){a.isMany||a.default===void 0||(i[a.name]=a.default)}),n.defineModel(i,e),n.defineDescriptor(i,t);var r=t.ns.name;function o(a){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),L(a,we(function(c,l){this.set(l,c)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,e),n.defineDescriptor(o,t),o};var dx={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Xd={String:function(t){return t},Boolean:function(t){return t==="true"},Integer:function(t){return parseInt(t,10)},Real:function(t){return parseFloat(t)}};function Ul(t,e){var n=Xd[t];return n?n(e):e}function Hl(t){return!!dx[t]}function Kd(t){return!!Xd[t]}function ke(t,e){var n,i,r=t.split(/:/);if(r.length===1)n=t,i=e;else{if(r.length!==2)throw new Error("expected <prefix:localName> or <localName>, got "+t);n=r[1],i=r[0]}return{name:t=(i?i+":":"")+n,prefix:i,localName:n}}function Ye(t){this.ns=t,this.name=t.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function mi(t,e){this.packageMap={},this.typeMap={},this.packages=[],this.properties=e,L(t,we(this.registerPackage,this))}function Yd(t,e,n){var i=e[n];if(i in t)throw new Error("package with "+n+" <"+i+"> already defined")}function Sr(t){this.model=t}function Jd(t,e,n){Object.defineProperty(t,e.name,{enumerable:!e.isReference,writable:!0,value:n,configurable:!0})}function Je(t){this.properties=new Sr(this),this.factory=new Wd(this,this.properties),this.registry=new mi(t,this.properties),this.typeCache={}}Ye.prototype.build=function(){return Ke(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Ye.prototype.addProperty=function(t,e,n){typeof e=="boolean"&&(n=e,e=void 0),this.addNamedProperty(t,n!==!1);var i=this.properties;e!==void 0?i.splice(e,0,t):i.push(t)},Ye.prototype.replaceProperty=function(t,e,n){var i=t.ns,r=this.properties,o=this.propertiesByName,a=t.name!==e.name;if(t.isId){if(!e.isId)throw new Error("property <"+e.ns.name+"> must be id property to refine <"+t.ns.name+">");this.setIdProperty(e,!1)}if(t.isBody){if(!e.isBody)throw new Error("property <"+e.ns.name+"> must be body property to refine <"+t.ns.name+">");this.setBodyProperty(e,!1)}var c=r.indexOf(t);if(c===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(c,1),this.addProperty(e,n?void 0:c,a),o[i.name]=o[i.localName]=e},Ye.prototype.redefineProperty=function(t,e,n){var i=t.ns.prefix,r=e.split("#"),o=ke(r[0],i),a=ke(r[1],o.prefix).name,c=this.propertiesByName[a];if(!c)throw new Error("refined property <"+a+"> not found");this.replaceProperty(c,t,n),delete t.redefines},Ye.prototype.addNamedProperty=function(t,e){var n=t.ns,i=this.propertiesByName;e&&(this.assertNotDefined(t,n.name),this.assertNotDefined(t,n.localName)),i[n.name]=i[n.localName]=t},Ye.prototype.removeNamedProperty=function(t){var e=t.ns,n=this.propertiesByName;delete n[e.name],delete n[e.localName]},Ye.prototype.setBodyProperty=function(t,e){if(e&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+t.ns.name+">)");this.bodyProperty=t},Ye.prototype.setIdProperty=function(t,e){if(e&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+t.ns.name+">)");this.idProperty=t},Ye.prototype.assertNotDefined=function(t,e){var n=t.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+t.definedBy.ns.name+"#"+t.ns.name+"> not allowed without redefines")},Ye.prototype.hasProperty=function(t){return this.propertiesByName[t]},Ye.prototype.addTrait=function(t,e){var n=this.allTypesByName,i=this.allTypes,r=t.name;r in n||(L(t.properties,we(function(o){o=z({},o,{name:o.ns.localName,inherited:e}),Object.defineProperty(o,"definedBy",{value:t});var a=o.replaces,c=o.redefines;a||c?this.redefineProperty(o,a||c,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(t),n[r]=t)},mi.prototype.getPackage=function(t){return this.packageMap[t]},mi.prototype.getPackages=function(){return this.packages},mi.prototype.registerPackage=function(t){t=z({},t);var e=this.packageMap;Yd(e,t,"prefix"),Yd(e,t,"uri"),L(t.types,we(function(n){this.registerType(n,t)},this)),e[t.uri]=e[t.prefix]=t,this.packages.push(t)},mi.prototype.registerType=function(t,e){var n=ke((t=z({},t,{superClass:(t.superClass||[]).slice(),extends:(t.extends||[]).slice(),properties:(t.properties||[]).slice(),meta:z(t.meta||{})})).name,e.prefix),i=n.name,r={};L(t.properties,we(function(o){var a=ke(o.name,n.prefix),c=a.name;Hl(o.type)||(o.type=ke(o.type,a.prefix).name),z(o,{ns:a,name:c}),r[c]=o},this)),z(t,{ns:n,name:i,propertiesByName:r}),L(t.extends,we(function(o){var a=this.typeMap[o];a.traits=a.traits||[],a.traits.push(i)},this)),this.definePackage(t,e),this.typeMap[i]=t},mi.prototype.mapTypes=function(t,e,n){var i=Hl(t.name)?{name:t.name}:this.typeMap[t.name],r=this;function o(c){return a(c,!0)}function a(c,l){var u=ke(c,Hl(c)?"":t.prefix);r.mapTypes(u,e,l)}if(!i)throw new Error("unknown type <"+t.name+">");L(i.superClass,n?o:a),e(i,!n),L(i.traits,o)},mi.prototype.getEffectiveDescriptor=function(t){var e=ke(t),n=new Ye(e);this.mapTypes(e,function(r,o){n.addTrait(r,o)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},mi.prototype.definePackage=function(t,e){this.properties.define(t,"$pkg",{value:e})},Sr.prototype.set=function(t,e,n){if(!Ie(e)||!e.length)throw new TypeError("property name must be a non-empty string");var i=this.model.getPropertyDescriptor(t,e),r=i&&i.name;n===void 0?i?delete t[r]:delete t.$attrs[e]:i?r in t?t[r]=n:Jd(t,i,n):t.$attrs[e]=n},Sr.prototype.get=function(t,e){var n=this.model.getPropertyDescriptor(t,e);if(!n)return t.$attrs[e];var i=n.name;return!t[i]&&n.isMany&&Jd(t,n,[]),t[i]},Sr.prototype.define=function(t,e,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(t,e,n)},Sr.prototype.defineDescriptor=function(t,e){this.define(t,"$descriptor",{value:e})},Sr.prototype.defineModel=function(t,e){this.define(t,"$model",{value:e})},Je.prototype.create=function(t,e){var n=this.getType(t);if(!n)throw new Error("unknown type <"+t+">");return new n(e)},Je.prototype.getType=function(t){var e=this.typeCache,n=Ie(t)?t:t.ns.name,i=e[n];return i||(t=this.registry.getEffectiveDescriptor(n),i=e[n]=this.factory.createType(t)),i},Je.prototype.createAny=function(t,e,n){var i=ke(t),r={$type:t,$instanceOf:function(a){return a===this.$type}},o={name:t,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:e}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),L(n,function(a,c){te(a)&&a.value!==void 0?r[a.name]=a.value:r[c]=a}),r},Je.prototype.getPackage=function(t){return this.registry.getPackage(t)},Je.prototype.getPackages=function(){return this.registry.getPackages()},Je.prototype.getElementDescriptor=function(t){return t.$descriptor},Je.prototype.hasType=function(t,e){return e===void 0&&(e=t,t=this),e in t.$model.getElementDescriptor(t).allTypesByName},Je.prototype.getPropertyDescriptor=function(t,e){return this.getElementDescriptor(t).propertiesByName[e]},Je.prototype.getTypeDescriptor=function(t){return this.registry.typeMap[t]};var mx=String.fromCharCode,fx=Object.prototype.hasOwnProperty,vx=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Co={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function yx(t,e,n,i){return i?fx.call(Co,i)?Co[i]:"&"+i+";":mx(e||parseInt(n,16))}function $i(t){return t.length>3&&t.indexOf("&")!==-1?t.replace(vx,yx):t}Object.keys(Co).forEach(function(t){Co[t.toUpperCase()]=Co[t]});var Zd="xsi:type",Qd="non-whitespace outside of root node";function Cr(t){return new Error(t)}function tm(t){return"missing namespace for prefix <"+t+">"}function Ya(t){return{get:t,enumerable:!0}}function gx(t){var e,n={};for(e in t)n[e]=t[e];return n}function ql(t){return t+"$uri"}function em(){return{line:0,column:0}}function bx(t){throw t}function nm(t){if(!this)return new nm(t);var e,n,i,r,o,a,c,l,u,p=t&&t.proxy,d=bx,y=em,f=!1,v=!1,g=null,b=!1;function S(_){_ instanceof Error||(_=Cr(_)),g=_,d(_,y)}function w(_){o&&(_ instanceof Error||(_=Cr(_)),o(_,y))}this.on=function(_,C){if(typeof C!="function")throw Cr("required args <name, cb>");switch(_){case"openTag":n=C;break;case"text":e=C;break;case"closeTag":i=C;break;case"error":d=C;break;case"warn":o=C;break;case"cdata":r=C;break;case"attention":l=C;break;case"question":c=C;break;case"comment":a=C;break;default:throw Cr("unsupported event: "+_)}return this},this.ns=function(_){if(_===void 0&&(_={}),typeof _!="object")throw Cr("required args <nsMap={}>");var C,B={};for(C in _)B[C]=_[C];return B["http://www.w3.org/2001/XMLSchema-instance"]="xsi",v=!0,u=B,this},this.parse=function(_){if(typeof _!="string")throw Cr("required args <xml=string>");return g=null,function(C){var B,s,h,m,E,T,M,I,$,P,x,N=v?[]:null,j=v?function(It){var qt,_t,zt={};for(qt in It)zt[_t=It[qt]]=_t,zt[ql(_t)]=qt;return zt}(u):null,G=[],X=0,tt=!1,rt=!1,st=0,H=0,q="",xt=0;function Xt(){if(x!==null)return x;var It,qt,_t,zt,Kt,Rt,he,St,$t,ht,Bt,Ii=v&&j.xmlns,pr=v&&f?[]:null,Qt=xt,Ee=q,bn=Ee.length,Di={},Kc={};t:for(;Qt<bn;Qt++)if($t=!1,!((ht=Ee.charCodeAt(Qt))===32||ht<14&&ht>8)){for((ht<65||ht>122||ht>90&&ht<97)&&ht!==95&&ht!==58&&(w("illegal first char attribute name"),$t=!0),Bt=Qt+1;Bt<bn;Bt++)if(!((ht=Ee.charCodeAt(Bt))>96&&ht<123||ht>64&&ht<91||ht>47&&ht<59||ht===46||ht===45||ht===95)){if(ht===32||ht<14&&ht>8){w("missing attribute value"),Qt=Bt;continue t}if(ht===61)break;w("illegal attribute name char"),$t=!0}if((St=Ee.substring(Qt,Bt))==="xmlns:xmlns"&&(w("illegal declaration of xmlns"),$t=!0),(ht=Ee.charCodeAt(Bt+1))===34)(Bt=Ee.indexOf('"',Qt=Bt+2))===-1&&(Bt=Ee.indexOf("'",Qt))!==-1&&(w("attribute value quote missmatch"),$t=!0);else if(ht===39)(Bt=Ee.indexOf("'",Qt=Bt+2))===-1&&(Bt=Ee.indexOf('"',Qt))!==-1&&(w("attribute value quote missmatch"),$t=!0);else for(w("missing attribute value quotes"),$t=!0,Bt+=1;Bt<bn&&!((ht=Ee.charCodeAt(Bt+1))===32||ht<14&&ht>8);Bt++);for(Bt===-1&&(w("missing closing quotes"),Bt=bn,$t=!0),$t||(Rt=Ee.substring(Qt,Bt)),Qt=Bt;Bt+1<bn&&!((ht=Ee.charCodeAt(Bt+1))===32||ht<14&&ht>8);Bt++)Qt===Bt&&(w("illegal character after attribute end"),$t=!0);if(Qt=Bt+1,!$t)if(St in Kc)w("attribute <"+St+"> already defined");else if(Kc[St]=!0,v)if(f){if((Kt=St==="xmlns"?"xmlns":St.charCodeAt(0)===120&&St.substr(0,6)==="xmlns:"?St.substr(6):null)!==null){if(It=$i(Rt),qt=ql(Kt),!(he=u[It])){if(Kt==="xmlns"||qt in j&&j[qt]!==It)do he="ns"+X++;while(j[he]!==void 0);else he=Kt;u[It]=he}j[Kt]!==he&&(zt||(j=gx(j),zt=!0),j[Kt]=he,Kt==="xmlns"&&(j[ql(he)]=It,Ii=he),j[qt]=It),Di[St]=Rt;continue}pr.push(St,Rt)}else(ht=St.indexOf(":"))!==-1?(_t=j[St.substring(0,ht)])?((St=Ii===_t?St.substr(ht+1):_t+St.substr(ht))===Zd&&((ht=Rt.indexOf(":"))!==-1?(_t=Rt.substring(0,ht),Rt=(_t=j[_t]||_t)+Rt.substring(ht)):Rt=Ii+":"+Rt),Di[St]=Rt):w(tm(St.substring(0,ht))):Di[St]=Rt;else Di[St]=Rt}if(f)for(Qt=0,bn=pr.length;Qt<bn;Qt++){if(St=pr[Qt++],Rt=pr[Qt],(ht=St.indexOf(":"))!==-1){if(!(_t=j[St.substring(0,ht)])){w(tm(St.substring(0,ht)));continue}(St=Ii===_t?St.substr(ht+1):_t+St.substr(ht))===Zd&&((ht=Rt.indexOf(":"))!==-1?(_t=Rt.substring(0,ht),Rt=(_t=j[_t]||_t)+Rt.substring(ht)):Rt=Ii+":"+Rt)}Di[St]=Rt}return x=Di}function ce(){for(var It,qt,_t=/(\r\n|\r|\n)/g,zt=0,Kt=0,Rt=0,he=H;st>=Rt&&(It=_t.exec(C))&&!((he=It[0].length+It.index)>st);)zt+=1,Rt=he;return st==-1?(Kt=he,qt=C.substring(H)):H===0?qt=C.substring(H,st):(Kt=st-Rt,qt=H==-1?C.substring(st):C.substring(st,H+1)),{data:qt,line:zt,column:Kt}}for(y=ce,p&&(P=Object.create({},{name:Ya(function(){return I}),originalName:Ya(function(){return $}),attrs:Ya(Xt),ns:Ya(function(){return j})}));H!==-1;){if((st=C.charCodeAt(H)===60?H:C.indexOf("<",H))===-1)return G.length?S("unexpected end of file"):H===0?S("missing start tag"):void(H<C.length&&C.substring(H).trim()&&w(Qd));if(H!==st){if(G.length){if(e&&(e(C.substring(H,st),$i,y),b))return}else if(C.substring(H,st).trim()&&(w(Qd),b))return}if((E=C.charCodeAt(st+1))===33){if((m=C.charCodeAt(st+2))===91&&C.substr(st+3,6)==="CDATA["){if((H=C.indexOf("]]>",st))===-1)return S("unclosed cdata");if(r&&(r(C.substring(st+9,H),y),b))return;H+=3;continue}if(m===45&&C.charCodeAt(st+3)===45){if((H=C.indexOf("-->",st))===-1)return S("unclosed comment");if(a&&(a(C.substring(st+4,H),$i,y),b))return;H+=3;continue}}if(E!==63){for(s=st+1;;s++){if(T=C.charCodeAt(s),isNaN(T))return H=-1,S("unclosed tag");if(T===34)s=(m=C.indexOf('"',s+1))!==-1?m:s;else if(T===39)s=(m=C.indexOf("'",s+1))!==-1?m:s;else if(T===62){H=s;break}}if(E!==33){if(x={},E===47){if(tt=!1,rt=!0,!G.length)return S("missing open tag");if(s=I=G.pop(),m=st+2+s.length,C.substring(st+2,m)!==s)return S("closing tag mismatch");for(;m<H;m++)if(!((E=C.charCodeAt(m))===32||E>8&&E<14))return S("close tag")}else{if(C.charCodeAt(H-1)===47?(s=I=C.substring(st+1,H-1),tt=!0,rt=!0):(s=I=C.substring(st+1,H),tt=!0,rt=!1),!(E>96&&E<123||E>64&&E<91||E===95||E===58))return S("illegal first char nodeName");for(m=1,h=s.length;m<h;m++)if(!((E=s.charCodeAt(m))>96&&E<123||E>64&&E<91||E>47&&E<59||E===45||E===95||E==46)){if(E===32||E<14&&E>8){I=s.substring(0,m),x=null;break}return S("invalid nodeName")}rt||G.push(I)}if(v){if(B=j,tt&&(rt||N.push(B),x===null&&(f=s.indexOf("xmlns",m)!==-1)&&(xt=m,q=s,Xt(),f=!1)),$=I,(E=I.indexOf(":"))!==-1){if(!(M=j[I.substring(0,E)]))return S("missing namespace on <"+$+">");I=I.substr(E+1)}else M=j.xmlns;M&&(I=M+":"+I)}if(tt&&(xt=m,q=s,n&&(p?n(P,$i,rt,y):n(I,Xt,$i,rt,y),b)))return;if(rt){if(i&&(i(p?P:I,$i,tt,y),b))return;v&&(j=tt?B:N.pop())}H+=1}else{if(l&&(l(C.substring(st,H+1),$i,y),b))return;H+=1}}else{if((H=C.indexOf("?>",st))===-1)return S("unclosed question");if(c&&(c(C.substring(st,H+2),y),b))return;H+=2}}}(_),y=em,b=!1,g},this.stop=function(){b=!0}}function im(t){return t.xml&&t.xml.tagAlias==="lowerCase"}var xx={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},Ja="xsi:type";function rm(t){return t.xml&&t.xml.serialize}function om(t){return rm(t)===Ja}function am(t,e){return im(e)?t.prefix+":"+((n=t.localName).charAt(0).toUpperCase()+n.slice(1)):t.name;var n}function fi(t){return new Error(t)}function Gn(t){return t.$descriptor}function Ex(t){z(this,t),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw fi("expected element");var n,i=this.elementsById,r=Gn(e).idProperty;if(r&&(n=e.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(n))throw new Error("illegal ID <"+n+">");if(i[n])throw fi("duplicate ID <"+n+">");i[n]=e}},this.addWarning=function(e){this.warnings.push(e)}}function To(){}function Wl(){}function Tr(){}function Ao(t,e){this.property=t,this.context=e}function Xl(t,e){this.element=e,this.propertyDesc=t}function Za(){}function Se(t,e,n){this.model=t,this.type=t.getType(e),this.context=n}function Kl(t,e,n){Se.call(this,t,e,n)}function Ar(t,e,n){this.model=t,this.context=n}function Yl(t){t instanceof Je&&(t={model:t}),z(this,{lax:!1},t)}To.prototype.handleEnd=function(){},To.prototype.handleText=function(){},To.prototype.handleNode=function(){},Wl.prototype=Object.create(To.prototype),Wl.prototype.handleNode=function(){return this},Tr.prototype=Object.create(To.prototype),Tr.prototype.handleText=function(t){this.body=(this.body||"")+t},Ao.prototype=Object.create(Tr.prototype),Ao.prototype.handleNode=function(t){if(this.element)throw fi("expected no sub nodes");return this.element=this.createReference(t),this},Ao.prototype.handleEnd=function(){this.element.id=this.body},Ao.prototype.createReference=function(t){return{property:this.property.ns.name,id:""}},Xl.prototype=Object.create(Tr.prototype),Xl.prototype.handleEnd=function(){var t=this.body||"",e=this.element,n=this.propertyDesc;t=Ul(n.type,t),n.isMany?e.get(n.name).push(t):e.set(n.name,t)},Za.prototype=Object.create(Tr.prototype),Za.prototype.handleNode=function(t){var e=this,n=this.element;return n?e=this.handleChild(t):(n=this.element=this.createElement(t),this.context.addElement(n)),e},Se.prototype=Object.create(Za.prototype),Se.prototype.addReference=function(t){this.context.addReference(t)},Se.prototype.handleText=function(t){if(!Gn(this.element).bodyProperty)throw fi("unexpected body text <"+t+">");Tr.prototype.handleText.call(this,t)},Se.prototype.handleEnd=function(){var t=this.body,e=this.element,n=Gn(e).bodyProperty;n&&t!==void 0&&(t=Ul(n.type,t),e.set(n.name,t))},Se.prototype.createElement=function(t){var e,n=t.attributes,i=this.type,r=Gn(i),o=this.context,a=new i({}),c=this.model;return L(n,function(l,u){var p=r.propertiesByName[u];p&&p.isReference?p.isMany?L(l.split(" "),function(d){o.addReference({element:a,property:p.ns.name,id:d})}):o.addReference({element:a,property:p.ns.name,id:l}):(p?l=Ul(p.type,l):u!=="xmlns"&&(e=ke(u,r.ns.prefix),c.getPackage(e.prefix)&&o.addWarning({message:"unknown attribute <"+u+">",element:a,property:u,value:l})),a.set(u,l))}),a},Se.prototype.getPropertyForNode=function(t){var e,n,i=ke(t.name),r=this.type,o=this.model,a=Gn(r),c=i.name,l=a.propertiesByName[c];if(l&&!l.isAttr)return om(l)&&(e=t.attributes[Ja])?(e=function(p,d){var y=ke(p);return function(f,v){var g=f.name,b=f.localName,S=v.xml&&v.xml.typePrefix;return S&&b.indexOf(S)===0?f.prefix+":"+b.slice(S.length):g}(y,d.getPackage(y.prefix))}(e,o),z({},l,{effectiveType:Gn(n=o.getType(e)).name})):l;var u=o.getPackage(i.prefix);if(u){if(e=am(i,u),n=o.getType(e),l=Pt(a.properties,function(p){return!p.isVirtual&&!p.isReference&&!p.isAttribute&&n.hasType(p.type)}))return z({},l,{effectiveType:Gn(n).name})}else if(l=Pt(a.properties,function(p){return!p.isReference&&!p.isAttribute&&p.type==="Element"}))return l;throw fi("unrecognized element <"+i.name+">")},Se.prototype.toString=function(){return"ElementDescriptor["+Gn(this.type).name+"]"},Se.prototype.valueHandler=function(t,e){return new Xl(t,e)},Se.prototype.referenceHandler=function(t){return new Ao(t,this.context)},Se.prototype.handler=function(t){return t==="Element"?new Ar(this.model,t,this.context):new Se(this.model,t,this.context)},Se.prototype.handleChild=function(t){var e,n,i,r;if(e=this.getPropertyForNode(t),i=this.element,Kd(n=e.effectiveType||e.type))return this.valueHandler(e,i);var o=(r=e.isReference?this.referenceHandler(e).handleNode(t):this.handler(n).handleNode(t)).element;return o!==void 0&&(e.isMany?i.get(e.name).push(o):i.set(e.name,o),e.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},Kl.prototype=Object.create(Se.prototype),Kl.prototype.createElement=function(t){var e=t.name,n=ke(e),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&am(n,o)||e;if(!r.hasType(a))throw fi("unexpected element <"+t.originalName+">");return Se.prototype.createElement.call(this,t)},Ar.prototype=Object.create(Za.prototype),Ar.prototype.createElement=function(t){var e=t.name,n=ke(e).prefix,i=t.ns[n+"$uri"],r=t.attributes;return this.model.createAny(e,i,r)},Ar.prototype.handleChild=function(t){var e=new Ar(this.model,"Element",this.context).handleNode(t),n=this.element,i=e.element;return i!==void 0&&((n.$children=n.$children||[]).push(i),i.$parent=n),e},Ar.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Yl.prototype.fromXML=function(t,e,n){var i=e.rootHandler;e instanceof Se?(i=e,e={}):typeof e=="string"?(i=this.handler(e),e={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,a=new Ex(z({},e,{rootHandler:i})),c=new nm({proxy:!0}),l=function(){var b=[];return Object.defineProperty(b,"peek",{value:function(){return this[this.length-1]}}),b}();function u(b,S,w){var _=S(),C=_.line,B=_.column,s=_.data;s.charAt(0)==="<"&&s.indexOf(" ")!==-1&&(s=s.slice(0,s.indexOf(" "))+">");var h="unparsable content "+(s?s+" ":"")+`detected
- line: `+C+`
- column: `+B+`
- nested error: `+b.message;if(w)return a.addWarning({message:h,error:b}),!0;throw fi(h)}function p(b,S){return u(b,S,!0)}i.context=a,l.push(i);var d=/^<\?xml /i,y=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function v(b,S){try{l.peek().handleText(b)}catch(w){p(w,S)}}var g=r.getPackages().reduce(function(b,S){return b[S.uri]=S.prefix,b},{"http://www.w3.org/XML/1998/namespace":"xml"});return c.ns(g).on("openTag",function(b,S,w,_){var C=b.attrs||{},B=Object.keys(C).reduce(function(s,h){var m=S(C[h]);return s[h]=m,s},{});(function(s,h){var m=l.peek();try{l.push(m.handleNode(s))}catch(E){u(E,h,o)&&l.push(new Wl)}})({name:b.name,originalName:b.originalName,attributes:B,ns:b.ns},_)}).on("question",function(b){if(d.test(b)){var S=y.exec(b),w=S&&S[1];w&&!f.test(w)&&a.addWarning({message:"unsupported document encoding <"+w+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",v).on("text",function(b,S,w){(function(_,C){_.trim()&&v(_,C)})(S(b),w)}).on("error",u).on("warn",p),new Promise(function(b,S){var w;try{c.parse(t),function(){var h,m,E=a.elementsById,T=a.references;for(h=0;m=T[h];h++){var M=m.element,I=E[m.id],$=Gn(M).propertiesByName[m.property];if(I||a.addWarning({message:"unresolved reference <"+m.id+">",element:m.element,property:m.property,value:m.id}),$.isMany){var P=M.get($.name),x=P.indexOf(m);x===-1&&(x=P.length),I?P[x]=I:P.splice(x,1)}else M.set($.name,I)}}()}catch(h){w=h}var _=i.element;w||_||(w=fi("failed to parse document as <"+i.type.$descriptor.name+">"));var C=a.warnings,B=a.references,s=a.elementsById;return w?(w.warnings=C,S(w)):b({rootElement:_,elementsById:s,references:B,warnings:C})})},Yl.prototype.handler=function(t){return new Kl(this.model,t)};var _x=/<|>|'|"|&|\n\r|\n/g,sm=/<|>|&/g;function wx(t){var e={},n={},i={},r=[],o=[];this.byUri=function(a){return n[a]||t&&t.byUri(a)},this.add=function(a,c){n[a.uri]=a,c?r.push(a):o.push(a),this.mapPrefix(a.prefix,a.uri)},this.uriByPrefix=function(a){return e[a||"xmlns"]},this.mapPrefix=function(a,c){e[a||"xmlns"]=c},this.getNSKey=function(a){return a.prefix!==void 0?a.uri+"|"+a.prefix:a.uri},this.logUsed=function(a){var c=a.uri,l=this.getNSKey(a);i[l]=this.byUri(c),t&&t.logUsed(a)},this.getUsed=function(a){var c=this;return[].concat(r,o).filter(function(l){var u=c.getNSKey(l);return i[u]})}}function Sx(t,e){return im(e)?(n=t).charAt(0).toLowerCase()+n.slice(1):t;var n}function cm(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}function lm(t){return Ie(t)?t:(t.prefix?t.prefix+":":"")+t.localName}var Cx={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Tx={"<":"lt",">":"gt","&":"amp"};function um(t,e,n){return(t=Ie(t)?t:""+t).replace(e,function(i){return"&"+n[i]+";"})}function Jl(t){this.tagName=t}function Gi(){}function Zl(t){this.tagName=t}function Gt(t,e){this.body=[],this.attrs=[],this.parent=t,this.propertyDescriptor=e}function Qa(t,e){Gt.call(this,t,e)}function Ax(){this.value="",this.write=function(t){this.value+=t}}function kx(t,e){var n=[""];this.append=function(i){return t.write(i),this},this.appendNewLine=function(){return e&&t.write(`
- `),this},this.appendIndent=function(){return e&&t.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function Px(t){return t=z({format:!1,preamble:!0},t||{}),{toXML:function(e,n){var i=n||new Ax,r=new kx(i,t.format);if(t.preamble&&r.append(`<?xml version="1.0" encoding="UTF-8"?>
- `),new Gt().build(e).serializeTo(r),!n)return i.value}}}function ts(t,e){Je.call(this,t,e)}Jl.prototype.build=function(t){return this.element=t,this},Jl.prototype.serializeTo=function(t){t.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Gi.prototype.serializeValue=Gi.prototype.serializeTo=function(t){t.append(this.escape?um(this.value,sm,Tx):this.value)},Gi.prototype.build=function(t,e){return this.value=e,t.type==="String"&&e.search(sm)!==-1&&(this.escape=!0),this},cm(Zl,Gi),Zl.prototype.serializeTo=function(t){t.appendIndent().append("<"+this.tagName+">"),this.serializeValue(t),t.append("</"+this.tagName+">").appendNewLine()},Gt.prototype.build=function(t){this.element=t;var e,n,i=t.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return e=o?this.parseGeneric(t):this.parseNsAttributes(t),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(a){return dt(a.$descriptor.properties,function(c){var l=c.name;if(c.isVirtual||!Cn(a,l))return!1;var u=a[l];return u!==c.default&&u!==null&&(!c.isMany||u.length)})}(t),this.parseAttributes(dt(n,function(a){return a.isAttr})),this.parseContainments(function(a){return dt(a,function(c){return!c.isAttr})}(n))),this.parseGenericAttributes(t,e),this},Gt.prototype.nsTagName=function(t){return function(e,n){return n.isGeneric?z({localName:n.ns.localName},e):z({localName:Sx(n.ns.localName,n.$pkg)},e)}(this.logNamespaceUsed(t.ns),t)},Gt.prototype.nsPropertyTagName=function(t){return function(e,n){return z({localName:n.ns.localName},e)}(this.logNamespaceUsed(t.ns),t)},Gt.prototype.isLocalNs=function(t){return t.uri===this.ns.uri},Gt.prototype.nsAttributeName=function(t){var e;if(e=Ie(t)?ke(t):t.ns,t.inherited)return{localName:e.localName};var n=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:e.localName}:z({localName:e.localName},n)},Gt.prototype.parseGeneric=function(t){var e=this,n=this.body,i=[];return L(t,function(r,o){o==="$body"?n.push(new Gi().build({type:"String"},r)):o==="$children"?L(r,function(a){n.push(new Gt(e).build(a))}):o.indexOf("$")!==0&&e.parseNsAttribute(t,o,r)&&i.push({name:o,value:r})}),i},Gt.prototype.parseNsAttribute=function(t,e,n){var i,r=t.$model,o=ke(e);if(o.prefix==="xmlns"&&(i={prefix:o.localName,uri:n}),o.prefix||o.localName!=="xmlns"||(i={uri:n}),!i)return{name:e,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},Gt.prototype.parseNsAttributes=function(t,e){var n=this,i=t.$attrs,r=[];return L(i,function(o,a){var c=n.parseNsAttribute(t,a,o);c&&r.push(c)}),r},Gt.prototype.parseGenericAttributes=function(t,e){var n=this;L(e,function(i){if(i.name!==Ja)try{n.addAttribute(n.nsAttributeName(i.name),i.value)}catch{}})},Gt.prototype.parseContainments=function(t){var e=this,n=this.body,i=this.element;L(t,function(r){var o=i.get(r.name),a=r.isReference;if(r.isMany||(o=[o]),r.isBody)n.push(new Gi().build(r,o[0]));else if(Kd(r.type))L(o,function(u){n.push(new Zl(e.addTagName(e.nsPropertyTagName(r))).build(r,u))});else if(a)L(o,function(u){n.push(new Jl(e.addTagName(e.nsPropertyTagName(r))).build(u))});else{var c=om(r),l=function(u){return rm(u)==="property"}(r);L(o,function(u){var p;p=c?new Qa(e,r):l?new Gt(e,r):new Gt(e),n.push(p.build(u))})}})},Gt.prototype.getNamespaces=function(t){var e,n=this.namespaces,i=this.parent;return n||(e=i&&i.getNamespaces(),t||!e?this.namespaces=n=new wx(e):n=e),n},Gt.prototype.logNamespace=function(t,e,n){var i=this.getNamespaces(n),r=t.uri,o=t.prefix;return i.byUri(r)&&!n||i.add(t,e),i.mapPrefix(o,r),t},Gt.prototype.logNamespaceUsed=function(t,e){var n,i,r,o=this.element.$model,a=this.getNamespaces(e),c=t.prefix,l=t.uri;if(!c&&!l)return{localName:t.localName};if(r=xx[c]||o&&(o.getPackage(c)||{}).uri,!(l=l||r||a.uriByPrefix(c)))throw new Error("no namespace uri given for prefix <"+c+">");if(!(t=a.byUri(l))){for(n=c,i=1;a.uriByPrefix(n);)n=c+"_"+i++;t=this.logNamespace({prefix:n,uri:l},r===l)}return c&&a.mapPrefix(c,l),t},Gt.prototype.parseAttributes=function(t){var e=this,n=this.element;L(t,function(i){var r=n.get(i.name);if(i.isReference)if(i.isMany){var o=[];L(r,function(a){o.push(a.id)}),r=o.join(" ")}else r=r.id;e.addAttribute(e.nsAttributeName(i),r)})},Gt.prototype.addTagName=function(t){var e=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(e),lm(t)},Gt.prototype.addAttribute=function(t,e){var n=this.attrs;Ie(e)&&(e=um(e,_x,Cx));var i=pl(n,function(o){return o.name.localName===t.localName&&o.name.uri===t.uri&&o.name.prefix===t.prefix}),r={name:t,value:e};i!==-1?n.splice(i,1,r):n.push(r)},Gt.prototype.serializeAttributes=function(t){var e=this.attrs,n=this.namespaces;n&&(e=function(i){return i.getUsed().filter(function(r){return r.prefix!=="xml"}).map(function(r){return{name:"xmlns"+(r.prefix?":"+r.prefix:""),value:r.uri}})}(n).concat(e)),L(e,function(i){t.append(" ").append(lm(i.name)).append('="').append(i.value).append('"')})},Gt.prototype.serializeTo=function(t){var e=this.body[0],n=e&&e.constructor!==Gi;t.appendIndent().append("<"+this.tagName),this.serializeAttributes(t),t.append(e?">":" />"),e&&(n&&t.appendNewLine().indent(),L(this.body,function(i){i.serializeTo(t)}),n&&t.unindent().appendIndent(),t.append("</"+this.tagName+">")),t.appendNewLine()},cm(Qa,Gt),Qa.prototype.parseNsAttributes=function(t){var e=Gt.prototype.parseNsAttributes.call(this,t),n=t.$descriptor;if(n.name===this.propertyDescriptor.type)return e;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=t.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Ja),(i.prefix?i.prefix+":":"")+o+n.ns.localName),e},Qa.prototype.isLocalNs=function(t){return t.uri===(this.typeNs||this.ns).uri},ts.prototype=Object.create(Je.prototype),ts.prototype.fromXML=function(t,e,n){Ie(e)||(n=e,e="bpmn:Definitions");var i=new Yl(z({model:this,lax:!0},n)),r=i.handler(e);return i.fromXML(t,r)},ts.prototype.toXML=function(t,e){var n=new Px(e);return new Promise(function(i,r){try{return i({xml:n.toXML(t)})}catch(o){return r(o)}})};var Mx={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 Rx(t,e){return new ts(z({},Mx,t),e)}function Ce(t){return t?"<"+t.$type+(t.id?' id="'+t.id:"")+'" />':"<null>"}var Nx=new Er({name:"bpmnElement",enumerable:!0},{name:"di",configurable:!0});function Le(t,e){return t.$instanceOf(e)}function Ix(t,e){var n={},i=[];function r(M,I){return function($){M($,I)}}function o(M){n[M.id]=M}function a(M,I){try{var $=M.di&&function(P,x){if(P.gfx)throw new Error(e("already rendered {element}",{element:Ce(P)}));return t.element(P,x)}(M,I);return o(M),$}catch(P){c(P.message,{element:M,error:P})}}function c(M,I){t.error(M,I)}function l(M){var I=M.bpmnElement;I?I.di?c(e("multiple DI elements defined for {element}",{element:Ce(I)}),{element:I}):(Nx.bind(I,"di"),I.di=M):c(e("no bpmnElement referenced in {element}",{element:Ce(M)}),{element:M})}function u(M){var I;l(I=M.plane),L(I.planeElement,p)}function p(M){l(M)}function d(){for(;i.length;)i.shift()()}function y(M,I){E(M,I),_(M.ioSpecification,I),w(M.artifacts,I),o(M)}function f(M,I){a(M,I)}function v(M,I){a(M,I)}function g(M,I){a(M,I)}function b(M,I){a(M,I)}function S(M,I){a(M,I)}function w(M,I){L(M,function($){Le($,"bpmn:Association")?i.push(function(){S($,I)}):S($,I)})}function _(M,I){M&&(L(M.dataInputs,r(g,I)),L(M.dataOutputs,r(b,I)))}function C(M,I){E(M,I),w(M.artifacts,I)}function B(M,I){var $=a(M,I);Le(M,"bpmn:SubProcess")&&C(M,$||I),Le(M,"bpmn:Activity")&&_(M.ioSpecification,I),i.push(function(){L(M.dataInputAssociations,r(v,I)),L(M.dataOutputAssociations,r(v,I))})}function s(M,I){a(M,I)}function h(M,I){i.push(function(){var $=a(M,I);M.childLaneSet&&m(M.childLaneSet,$||I),function(P){L(P.flowNodeRef,function(x){var N=x.get("lanes");N&&N.push(P)})}(M)})}function m(M,I){L(M.lanes,r(h,I))}function E(M,I){(function($,P){L($,function(x){Le(x,"bpmn:SequenceFlow")?i.push(function(){(function(N,j){a(N,j)})(x,P)}):Le(x,"bpmn:BoundaryEvent")?i.unshift(function(){B(x,P)}):Le(x,"bpmn:FlowNode")?B(x,P):Le(x,"bpmn:DataObject")||(Le(x,"bpmn:DataStoreReference")||Le(x,"bpmn:DataObjectReference")?s(x,P):c(e("unrecognized flowElement {element} in context {context}",{element:Ce(x),context:P?Ce(P.businessObject):"null"}),{element:x,context:P}))})})(M.flowElements,I),M.laneSets&&function($,P){L($,r(m,P))}(M.laneSets,I)}function T(M,I){var $=a(M,I),P=M.processRef;P&&y(P,$||I)}return{handleDeferred:d,handleDefinitions:function(M,I){var $=M.diagrams;if(I&&$.indexOf(I)===-1)throw new Error(e("diagram not part of bpmn:Definitions"));if(!I&&$&&$.length&&(I=$[0]),!I)throw new Error(e("no diagram to display"));u(I);var P=I.plane;if(!P)throw new Error(e("no plane for {element}",{element:Ce(I)}));var x=P.bpmnElement;if(!x){if(x=function(G){return Pt(G.rootElements,function(X){return Le(X,"bpmn:Process")||Le(X,"bpmn:Collaboration")})}(M),!x)throw new Error(e("no process or collaboration to display"));c(e("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Ce(P),rootElement:Ce(x)})),P.bpmnElement=x,l(P)}var N,j=function(G,X){return t.root(G,X)}(x,P);if(Le(x,"bpmn:Process"))y(x,j);else{if(!Le(x,"bpmn:Collaboration"))throw new Error(e("unsupported bpmnElement for {plane}: {rootElement}",{plane:Ce(P),rootElement:Ce(x)}));L((N=x).participants,r(T)),w(N.artifacts),i.push(function(){var G;L(N.messageFlows,r(f,G))}),function(G,X){dt(G,function(tt){return!n[tt.id]&&Le(tt,"bpmn:Process")&&tt.laneSets}).forEach(r(y,X))}(M.rootElements,j)}d()},handleSubProcess:C,registerDi:l}}function Dx(t,e,n){var i,r,o,a=[];return new Promise(function(c,l){try{return i=t.get("bpmnImporter"),r=t.get("eventBus"),o=t.get("translate"),r.fire("import.render.start",{definitions:e}),function(u,p){new Ix({root:function(d){return i.add(d)},element:function(d,y){return i.add(d,y)},error:function(d,y){a.push({message:d,context:y})}},o).handleDefinitions(u,p)}(e,n),r.fire("import.render.complete",{error:void 0,warnings:a}),c({warnings:a})}catch(u){return u.warnings=a,l(u)}})}function kr(t){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var e=arguments.length;if(!(e>=1&&fe(arguments[e-1])))return t.apply(this,arguments);var n=arguments[e-1],i=Array.prototype.slice.call(arguments,0,-1);t.apply(this,i).then(function(r){var o=Object.keys(r)[0];return n(null,r[o])},function(r){return n(r,r.warnings)})}}var pm='<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 es(t){return t.join(";")}var ko,hm=es(["color: #404040"]),Bx='<div class="bjs-powered-by-lightbox" style="'+es(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+es(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+es(["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;'+hm+'">'+pm+'</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 Ut(t){var e,n;t=z({},Ox,t),this._moddle=this._createModdle(t),this._container=this._createContainer(t),e=this._container,n=jt('<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; '+hm+'">'+pm+"</a>"),e.appendChild(n),ct.bind(n,"click",function(i){ko||(ko=jt(Bx),$e.bind(ko,".backdrop","click",function(r){document.body.removeChild(ko)})),document.body.appendChild(ko),i.preventDefault()}),this._init(this._container,this._moddle,t)}function ns(t,e){return t.warnings=e,t}it(Ut,wr),Ut.prototype.importXML=kr(function(t,e){var n=this;return new Promise(function(i,r){t=n._emit("import.parse.start",{xml:t})||t,n._moddle.fromXML(t,"bpmn:Definitions").then(function(o){var a=o.rootElement,c=o.references,l=o.warnings,u=o.elementsById;a=n._emit("import.parse.complete",function(p){var d=n.get("eventBus").createEvent(p);return Object.defineProperty(d,"context",{enumerable:!0,get:function(){return{warnings:p.warnings,references:p.references,elementsById:p.elementsById}}}),d}({error:null,definitions:a,elementsById:u,references:c,warnings:l}))||a,n.importDefinitions(a,e).then(function(p){var d=[].concat(l,p.warnings||[]);return n._emit("import.done",{error:null,warnings:d}),i({warnings:d})}).catch(function(p){var d=[].concat(l,p.warnings||[]);return n._emit("import.done",{error:p,warnings:d}),r(ns(p,d))})}).catch(function(o){return n._emit("import.parse.complete",{error:o}),o=function(a){var c=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(a.message);return c&&(a.message="unparsable content <"+c[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+c[2]),a}(o),n._emit("import.done",{error:o,warnings:o.warnings}),r(o)})})}),Ut.prototype.importDefinitions=kr(function(t,e){var n=this;return new Promise(function(i,r){n._setDefinitions(t),n.open(e).then(function(o){var a=o.warnings;return i({warnings:a})}).catch(function(o){return r(o)})})}),Ut.prototype.open=kr(function(t){var e=this._definitions,n=t,i=this;return new Promise(function(r,o){if(!e){var a=new Error("no XML imported");return o(ns(a,[]))}if(typeof t=="string"&&(n=function(l,u){return u&&Pt(l.diagrams,function(p){return p.id===u})||null}(e,t),!n)){var c=new Error("BPMNDiagram <"+t+"> not found");return o(ns(c,[]))}try{i.clear()}catch(l){return o(ns(l,[]))}Dx(i,e,n).then(function(l){var u=l.warnings;return r({warnings:u})}).catch(function(l){return o(l)})})}),Ut.prototype.saveXML=kr(function(t){t=t||{};var e=this,n=this._definitions;return new Promise(function(i){if(!n)return i({error:new Error("no definitions loaded")});n=e._emit("saveXML.start",{definitions:n})||n,e._moddle.toXML(n,t).then(function(r){var o=r.xml;return o=e._emit("saveXML.serialized",{xml:o})||o,i({xml:o})})}).catch(function(i){return{error:i}}).then(function(i){e._emit("saveXML.done",i);var r=i.error;return r?Promise.reject(r):i})}),Ut.prototype.saveSVG=kr(function(t){var e=this;return new Promise(function(n,i){var r,o;e._emit("saveSVG.start");try{var a=e.get("canvas"),c=a.getDefaultLayer(),l=Wt("defs",a._svg),u=pd(c),p=l?"<defs>"+pd(l)+"</defs>":"",d=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="`+d.width+'" height="'+d.height+'" viewBox="'+d.x+" "+d.y+" "+d.width+" "+d.height+'" version="1.1">'+p+u+"</svg>"}catch(y){o=y}return e._emit("saveSVG.done",{error:o,svg:r}),o?i(o):n({svg:r})})}),Ut.prototype._setDefinitions=function(t){this._definitions=t},Ut.prototype.getModules=function(){return this._modules},Ut.prototype.clear=function(){this.getDefinitions()&&(this.get("elementRegistry").forEach(function(t){var e=t.businessObject;e&&e.di&&delete e.di}),wr.prototype.clear.call(this))},Ut.prototype.destroy=function(){wr.prototype.destroy.call(this),Tn(this._container)},Ut.prototype.on=function(t,e,n,i){return this.get("eventBus").on(t,e,n,i)},Ut.prototype.off=function(t,e){this.get("eventBus").off(t,e)},Ut.prototype.attachTo=function(t){if(!t)throw new Error("parentNode required");this.detach(),t.get&&t.constructor.prototype.jquery&&(t=t.get(0)),typeof t=="string"&&(t=Wt(t)),t.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Ut.prototype.getDefinitions=function(){return this._definitions},Ut.prototype.detach=function(){var t=this._container,e=t.parentNode;e&&(this._emit("detach",{}),e.removeChild(t))},Ut.prototype._init=function(t,e,n){var i=n.modules||this.getModules(),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",e]}],i,r),a=z(Vn(n,["additionalModules"]),{canvas:z({},n.canvas,{container:t}),modules:o});wr.call(this,a),n&&n.container&&this.attachTo(n.container)},Ut.prototype._emit=function(t,e){return this.get("eventBus").fire(t,e)},Ut.prototype._createContainer=function(t){var e=jt('<div class="bjs-container"></div>');return z(e.style,{width:dm(t.width),height:dm(t.height),position:t.position}),e},Ut.prototype._createModdle=function(t){return new Rx(z({},this._moddleExtensions,t.moddleExtensions))},Ut.prototype._modules=[];var Ox={width:"100%",height:"100%",position:"relative"};function dm(t){return t+(pt(t)?"px":"")}function Po(t){Ut.call(this,t),this.on("import.parse.complete",function(e){e.error||this._collectIds(e.definitions,e.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}A=function(t,e){var n=et(t);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(e)};function et(t){return t&&t.businessObject||t}Mt=function(t){return!A(t,"bpmn:CallActivity")&&(A(t,"bpmn:SubProcess")?et(t).di&&!!et(t).di.isExpanded:!A(t,"bpmn:Participant")||!!et(t).processRef)},Ne=function(t){return t&&!!et(t).triggeredByEvent};function is(t,e){var n=et(t),i=!1;return n.eventDefinitions&&L(n.eventDefinitions,function(r){A(r,e)&&(i=!0)}),i}function mm(t){return A(t,"bpmn:FlowElement")||A(t,"bpmn:Participant")||A(t,"bpmn:Lane")||A(t,"bpmn:SequenceFlow")||A(t,"bpmn:MessageFlow")||A(t,"bpmn:DataInput")||A(t,"bpmn:DataOutput")?"name":A(t,"bpmn:TextAnnotation")?"text":A(t,"bpmn:Group")?"categoryValueRef":void 0}function un(t){var e=t.businessObject,n=mm(e);if(n)return n==="categoryValueRef"?function(i){var r=i.categoryValueRef;return r&&r.value||""}(e):e[n]||""}function Pn(t,e,n){return ai(t.eventDefinitions,function(i){return i.$type===e&&function(r,o){return Li(o,function(a,c){return r[c]==a})}(t,n)})}function Pr(t){return t.businessObject.di}function Te(t){return t.businessObject}function Et(t,e){var n=Pr(t);return n.get("color:background-color")||n.get("bioc:fill")||e||"white"}function Z(t,e){var n=Pr(t);return n.get("color:border-color")||n.get("bioc:stroke")||e||"black"}function Mo(t,e,n){var i=Pr(t).get("label");return i&&i.get("color:color")||e||Z(t,n)}it(Po,Ut),Po.prototype._createModdle=function(t){var e=Ut.prototype._createModdle.call(this,t);return e.ids=new Sn([32,36,1]),e},Po.prototype._collectIds=function(t,e){var n,i=t.$model.ids;for(n in i.clear(),e)i.claim(n,e[n])};var Lx=new Sn,Mr=.95;function Ui(t,e,n,i,r,o,a){Fn.call(this,e,a);var c=t&&t.defaultFillColor,l=t&&t.defaultStrokeColor,u=t&&t.defaultLabelColor,p=Lx.next(),d={},y=n.computeStyle;function f(P,x){var N=z({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},x.attrs),j=x.ref||{x:0,y:0},G=x.scale||1;N.strokeDasharray==="none"&&(N.strokeDasharray=[1e4,1]);var X=ot("marker");K(x.element,N),lt(X,x.element),K(X,{id:P,viewBox:"0 0 20 20",refX:j.x,refY:j.y,markerWidth:20*G,markerHeight:20*G,orient:"auto"});var tt=Wt("defs",r._svg);tt||(tt=ot("defs"),lt(r._svg,tt)),lt(tt,X),d[P]=X}function v(P){return P.replace(/[^0-9a-zA-z]+/g,"_")}function g(P,x,N){var j=P+"-"+v(x)+"-"+v(N)+"-"+p;return d[j]||function(G,X,tt,rt){if(X==="sequenceflow-end"){var st=ot("path");K(st,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(G,{element:st,ref:{x:11,y:10},scale:.5,attrs:{fill:rt,stroke:rt}})}if(X==="messageflow-start"){var H=ot("circle");K(H,{cx:6,cy:6,r:3.5}),f(G,{element:H,attrs:{fill:tt,stroke:rt},ref:{x:6,y:6}})}if(X==="messageflow-end"){var q=ot("path");K(q,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(G,{element:q,attrs:{fill:tt,stroke:rt,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if(X==="association-start"){var xt=ot("path");K(xt,{d:"M 11 5 L 1 10 L 11 15"}),f(G,{element:xt,attrs:{fill:"none",stroke:rt,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if(X==="association-end"){var Xt=ot("path");K(Xt,{d:"M 1 5 L 11 10 L 1 15"}),f(G,{element:Xt,attrs:{fill:"none",stroke:rt,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if(X==="conditional-flow-marker"){var ce=ot("path");K(ce,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(G,{element:ce,attrs:{fill:tt,stroke:rt},ref:{x:-1,y:10},scale:.5})}if(X==="conditional-default-flow-marker"){var It=ot("path");K(It,{d:"M 6 4 L 10 16"}),f(G,{element:It,attrs:{stroke:rt},ref:{x:0,y:10},scale:.5})}}(j,P,x,N),"url(#"+j+")"}function b(P,x,N,j,G){te(j)&&(G=j,j=0),j=j||0,(G=y(G,{stroke:"black",strokeWidth:2,fill:"white"})).fill==="none"&&delete G.fillOpacity;var X=x/2,tt=N/2,rt=ot("circle");return K(rt,{cx:X,cy:tt,r:Math.round((x+N)/4-j)}),K(rt,G),lt(P,rt),rt}function S(P,x,N,j,G,X){te(G)&&(X=G,G=0),G=G||0,X=y(X,{stroke:"black",strokeWidth:2,fill:"white"});var tt=ot("rect");return K(tt,{x:G,y:G,width:x-2*G,height:N-2*G,rx:j,ry:j}),K(tt,X),lt(P,tt),tt}function w(P,x,N){var j=Nl(x,N=y(N,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return lt(P,j),j}function _(P,x,N){N=y(N,["no-fill"],{strokeWidth:2,stroke:"black"});var j=ot("path");return K(j,{d:x}),K(j,N),lt(P,j),j}function C(P,x,N,j){return _(x,N,z({"data-marker":P},j))}function B(P){return function(x,N){return I[P](x,N)}}function s(P){return I[P]}function h(P,x){var N=Te(P),j=function(G){return G.$type==="bpmn:IntermediateThrowEvent"||G.$type==="bpmn:EndEvent"}(N);return N.eventDefinitions&&N.eventDefinitions.length>1?N.parallelMultiple?s("bpmn:ParallelMultipleEventDefinition")(x,P,j):s("bpmn:MultipleEventDefinition")(x,P,j):Pn(N,"bpmn:MessageEventDefinition")?s("bpmn:MessageEventDefinition")(x,P,j):Pn(N,"bpmn:TimerEventDefinition")?s("bpmn:TimerEventDefinition")(x,P,j):Pn(N,"bpmn:ConditionalEventDefinition")?s("bpmn:ConditionalEventDefinition")(x,P):Pn(N,"bpmn:SignalEventDefinition")?s("bpmn:SignalEventDefinition")(x,P,j):Pn(N,"bpmn:EscalationEventDefinition")?s("bpmn:EscalationEventDefinition")(x,P,j):Pn(N,"bpmn:LinkEventDefinition")?s("bpmn:LinkEventDefinition")(x,P,j):Pn(N,"bpmn:ErrorEventDefinition")?s("bpmn:ErrorEventDefinition")(x,P,j):Pn(N,"bpmn:CancelEventDefinition")?s("bpmn:CancelEventDefinition")(x,P,j):Pn(N,"bpmn:CompensateEventDefinition")?s("bpmn:CompensateEventDefinition")(x,P,j):Pn(N,"bpmn:TerminateEventDefinition")?s("bpmn:TerminateEventDefinition")(x,P,j):null}function m(P,x,N){N=z({size:{width:100}},N);var j=o.createText(x||"",N);return bt(j).add("djs-label"),lt(P,j),j}function E(P,x,N){return m(P,Te(x).name,{box:x,align:N,padding:5,style:{fill:Mo(x,u,l)}})}function T(P,x,N){$l(m(P,x,{box:{height:30,width:N.height},align:"center-middle",style:{fill:Mo(N,u,l)}}),0,-(-1*N.height),270)}function M(P){for(var x=P.waypoints,N="m "+x[0].x+","+x[0].y,j=1;j<x.length;j++)N+="L"+x[j].x+","+x[j].y+" ";return N}var I=this.handlers={"bpmn:Event":function(P,x,N){return"fillOpacity"in N||(N.fillOpacity=Mr),b(P,x.width,x.height,N)},"bpmn:StartEvent":function(P,x){var N={fill:Et(x,c),stroke:Z(x,l)};Te(x).isInterrupting||(N={strokeDasharray:"6",strokeLinecap:"round",fill:Et(x,c),stroke:Z(x,l)});var j=s("bpmn:Event")(P,x,N);return h(x,P),j},"bpmn:MessageEventDefinition":function(P,x,N){return _(P,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:x.width,containerHeight:x.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:N?Z(x,l):Et(x,c),stroke:N?Et(x,c):Z(x,l)})},"bpmn:TimerEventDefinition":function(P,x){var N=b(P,x.width,x.height,.2*x.height,{strokeWidth:2,fill:Et(x,c),stroke:Z(x,l)});_(P,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:x.width,containerHeight:x.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:Z(x,l)});for(var j=0;j<12;j++){var G=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:x.width,containerHeight:x.height,position:{mx:.5,my:.5}}),X=x.width/2;_(P,G,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*j+","+x.height/2+","+X+")",stroke:Z(x,l)})}return N},"bpmn:EscalationEventDefinition":function(P,x,N){return _(P,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:N?Z(x,l):"none",stroke:Z(x,l)})},"bpmn:ConditionalEventDefinition":function(P,x){return _(P,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:Z(x,l)})},"bpmn:LinkEventDefinition":function(P,x,N){return _(P,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:N?Z(x,l):"none",stroke:Z(x,l)})},"bpmn:ErrorEventDefinition":function(P,x,N){return _(P,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:x.width,containerHeight:x.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:N?Z(x,l):"none",stroke:Z(x,l)})},"bpmn:CancelEventDefinition":function(P,x,N){var j=_(P,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:N?Z(x,l):"none",stroke:Z(x,l)});return Hd(j,45),j},"bpmn:CompensateEventDefinition":function(P,x,N){return _(P,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:N?Z(x,l):"none",stroke:Z(x,l)})},"bpmn:SignalEventDefinition":function(P,x,N){return _(P,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:x.width,containerHeight:x.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:N?Z(x,l):"none",stroke:Z(x,l)})},"bpmn:MultipleEventDefinition":function(P,x,N){return _(P,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:x.width,containerHeight:x.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:N?Z(x,l):"none"})},"bpmn:ParallelMultipleEventDefinition":function(P,x){return _(P,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:x.width,containerHeight:x.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:Z(x,l),stroke:Z(x,l)})},"bpmn:EndEvent":function(P,x){var N=s("bpmn:Event")(P,x,{strokeWidth:4,fill:Et(x,c),stroke:Z(x,l)});return h(x,P),N},"bpmn:TerminateEventDefinition":function(P,x){return b(P,x.width,x.height,8,{strokeWidth:4,fill:Z(x,l),stroke:Z(x,l)})},"bpmn:IntermediateEvent":function(P,x){var N=s("bpmn:Event")(P,x,{strokeWidth:1,fill:Et(x,c),stroke:Z(x,l)});return b(P,x.width,x.height,3,{strokeWidth:1,fill:Et(x,"none"),stroke:Z(x,l)}),h(x,P),N},"bpmn:IntermediateCatchEvent":B("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":B("bpmn:IntermediateEvent"),"bpmn:Activity":function(P,x,N){return"fillOpacity"in(N=N||{})||(N.fillOpacity=Mr),S(P,x.width,x.height,10,N)},"bpmn:Task":function(P,x){var N={fill:Et(x,c),stroke:Z(x,l)},j=s("bpmn:Activity")(P,x,N);return E(P,x,"center-middle"),$(P,x),j},"bpmn:ServiceTask":function(P,x){var N=s("bpmn:Task")(P,x);return _(P,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:Et(x,c),stroke:Z(x,l)}),_(P,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:Et(x,c)}),_(P,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:Et(x,c),stroke:Z(x,l)}),N},"bpmn:UserTask":function(P,x){var N=s("bpmn:Task")(P,x);return _(P,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Et(x,c),stroke:Z(x,l)}),_(P,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Et(x,c),stroke:Z(x,l)}),_(P,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:Z(x,l),stroke:Z(x,l)}),N},"bpmn:ManualTask":function(P,x){var N=s("bpmn:Task")(P,x);return _(P,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:Et(x,c),stroke:Z(x,l)}),N},"bpmn:SendTask":function(P,x){var N=s("bpmn:Task")(P,x);return _(P,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:Z(x,l),stroke:Et(x,c)}),N},"bpmn:ReceiveTask":function(P,x){var N,j=Te(x),G=s("bpmn:Task")(P,x);return j.instantiate?(b(P,28,28,4.4,{strokeWidth:1}),N=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):N=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),_(P,N,{strokeWidth:1,fill:Et(x,c),stroke:Z(x,l)}),G},"bpmn:ScriptTask":function(P,x){var N=s("bpmn:Task")(P,x);return _(P,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:Z(x,l)}),N},"bpmn:BusinessRuleTask":function(P,x){var N=s("bpmn:Task")(P,x);return K(_(P,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:Et(x,"#aaaaaa"),stroke:Z(x,l)}),K(_(P,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:Z(x,l)}),N},"bpmn:SubProcess":function(P,x,N){N=z({fill:Et(x,c),stroke:Z(x,l)},N);var j=s("bpmn:Activity")(P,x,N),G=Mt(x);return Ne(x)&&K(j,{strokeDasharray:"1,2"}),E(P,x,G?"center-top":"center-middle"),G?$(P,x):$(P,x,["SubProcessMarker"]),j},"bpmn:AdHocSubProcess":function(P,x){return s("bpmn:SubProcess")(P,x)},"bpmn:Transaction":function(P,x){var N=s("bpmn:SubProcess")(P,x),j=n.style(["no-fill","no-events"],{stroke:Z(x,l)});return S(P,x.width,x.height,8,3,j),N},"bpmn:CallActivity":function(P,x){return s("bpmn:SubProcess")(P,x,{strokeWidth:5})},"bpmn:Participant":function(P,x){var N={fillOpacity:Mr,fill:Et(x,c),stroke:Z(x,l)},j=s("bpmn:Lane")(P,x,N);return Mt(x)?(w(P,[{x:30,y:0},{x:30,y:x.height}],{stroke:Z(x,l)}),T(P,Te(x).name,x)):m(P,Te(x).name,{box:x,align:"center-middle",style:{fill:Mo(x,u,l)}}),Te(x).participantMultiplicity&&s("ParticipantMultiplicityMarker")(P,x),j},"bpmn:Lane":function(P,x,N){var j=S(P,x.width,x.height,0,z({fill:Et(x,c),fillOpacity:.35,stroke:Z(x,l)},N)),G=Te(x);return G.$type==="bpmn:Lane"&&T(P,G.name,x),j},"bpmn:InclusiveGateway":function(P,x){var N=s("bpmn:Gateway")(P,x);return b(P,x.width,x.height,.24*x.height,{strokeWidth:2.5,fill:Et(x,c),stroke:Z(x,l)}),N},"bpmn:ExclusiveGateway":function(P,x){var N=s("bpmn:Gateway")(P,x),j=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:x.width,containerHeight:x.height,position:{mx:.32,my:.3}});return Pr(x).isMarkerVisible&&_(P,j,{strokeWidth:1,fill:Z(x,l),stroke:Z(x,l)}),N},"bpmn:ComplexGateway":function(P,x){var N=s("bpmn:Gateway")(P,x);return _(P,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:x.width,containerHeight:x.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:Z(x,l),stroke:Z(x,l)}),N},"bpmn:ParallelGateway":function(P,x){var N=s("bpmn:Gateway")(P,x);return _(P,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:x.width,containerHeight:x.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:Z(x,l),stroke:Z(x,l)}),N},"bpmn:EventBasedGateway":function(P,x){var N=Te(x),j=s("bpmn:Gateway")(P,x);b(P,x.width,x.height,.2*x.height,{strokeWidth:1,fill:"none",stroke:Z(x,l)});var G=N.eventGatewayType,X=!!N.instantiate;if(G==="Parallel"){var tt=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:x.width,containerHeight:x.height,position:{mx:.474,my:.296}});K(_(P,tt),{strokeWidth:1,fill:"none"})}else G==="Exclusive"&&(X||K(b(P,x.width,x.height,.26*x.height),{strokeWidth:1,fill:"none",stroke:Z(x,l)}),function(){var rt=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:x.width,containerHeight:x.height,position:{mx:.36,my:.44}}),st={strokeWidth:2,fill:Et(x,"none"),stroke:Z(x,l)};_(P,rt,st)}());return j},"bpmn:Gateway":function(P,x){var N={fill:Et(x,c),fillOpacity:Mr,stroke:Z(x,l)};return function(j,G,X,tt){var rt=G/2,st=X/2,H=[{x:rt,y:0},{x:G,y:st},{x:rt,y:X},{x:0,y:st}].map(function(xt){return xt.x+","+xt.y}).join(" ");tt=y(tt,{stroke:"black",strokeWidth:2,fill:"white"});var q=ot("polygon");return K(q,{points:H}),K(q,tt),lt(j,q),q}(P,x.width,x.height,N)},"bpmn:SequenceFlow":function(P,x){var N,j=M(x),G=Et(x,c),X=Z(x,l),tt=_(P,j,{strokeLinejoin:"round",markerEnd:g("sequenceflow-end",G,X),stroke:Z(x,l)}),rt=Te(x);return x.source&&(N=x.source.businessObject,rt.conditionExpression&&N.$instanceOf("bpmn:Activity")&&K(tt,{markerStart:g("conditional-flow-marker",G,X)}),N.default&&(N.$instanceOf("bpmn:Gateway")||N.$instanceOf("bpmn:Activity"))&&N.default===rt&&K(tt,{markerStart:g("conditional-default-flow-marker",G,X)})),tt},"bpmn:Association":function(P,x,N){var j=Te(x),G=Et(x,c),X=Z(x,l);return N=z({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:Z(x,l)},N||{}),j.associationDirection!=="One"&&j.associationDirection!=="Both"||(N.markerEnd=g("association-end",G,X)),j.associationDirection==="Both"&&(N.markerStart=g("association-start",G,X)),w(P,x.waypoints,N)},"bpmn:DataInputAssociation":function(P,x){var N=Et(x,c),j=Z(x,l);return s("bpmn:Association")(P,x,{markerEnd:g("association-end",N,j)})},"bpmn:DataOutputAssociation":function(P,x){var N=Et(x,c),j=Z(x,l);return s("bpmn:Association")(P,x,{markerEnd:g("association-end",N,j)})},"bpmn:MessageFlow":function(P,x){var N=Te(x),j=Pr(x),G=Et(x,c),X=Z(x,l),tt=_(P,M(x),{markerEnd:g("messageflow-end",G,X),markerStart:g("messageflow-start",G,X),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:Z(x,l)});if(N.messageRef){var rt=tt.getPointAtLength(tt.getTotalLength()/2),st=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:rt.x,y:rt.y}}),H={strokeWidth:1};j.messageVisibleKind==="initiating"?(H.fill="white",H.stroke="black"):(H.fill="#888",H.stroke="white");var q=_(P,st,H),xt=m(P,N.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:Z(x,u)}}),Xt=q.getBBox(),ce=xt.getBBox();$l(xt,rt.x-ce.width/2,rt.y+Xt.height/2+10,0)}return tt},"bpmn:DataObject":function(P,x){var N=_(P,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.474,my:.296}}),{fill:Et(x,c),fillOpacity:Mr,stroke:Z(x,l)});return function(j){var G=j.dataObjectRef;return j.isCollection||G&&G.isCollection}(Te(x))&&function(j,G){var X=(G.height-18)/G.height,tt=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:G.width,containerHeight:G.height,position:{mx:.33,my:X}});_(j,tt,{strokeWidth:2})}(P,x),N},"bpmn:DataObjectReference":B("bpmn:DataObject"),"bpmn:DataInput":function(P,x){var N=i.getRawPath("DATA_ARROW"),j=s("bpmn:DataObject")(P,x);return _(P,N,{strokeWidth:1}),j},"bpmn:DataOutput":function(P,x){var N=i.getRawPath("DATA_ARROW"),j=s("bpmn:DataObject")(P,x);return _(P,N,{strokeWidth:1,fill:"black"}),j},"bpmn:DataStoreReference":function(P,x){return _(P,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:Et(x,c),fillOpacity:Mr,stroke:Z(x,l)})},"bpmn:BoundaryEvent":function(P,x){var N=Te(x).cancelActivity,j={strokeWidth:1,fill:Et(x,c),stroke:Z(x,l)};N||(j.strokeDasharray="6",j.strokeLinecap="round");var G=z({},j,{fillOpacity:1}),X=z({},j,{fill:"none"}),tt=s("bpmn:Event")(P,x,G);return b(P,x.width,x.height,3,X),h(x,P),tt},"bpmn:Group":function(P,x){return S(P,x.width,x.height,10,{stroke:Z(x,l),strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(P,x){return function(N,j){var G={width:90,height:30,x:j.width/2+j.x,y:j.height/2+j.y};return m(N,un(j),{box:G,fitBox:!0,style:z({},o.getExternalStyle(),{fill:Mo(j,u,l)})})}(P,x)},"bpmn:TextAnnotation":function(P,x){var N=S(P,x.width,x.height,0,0,{fill:"none",stroke:"none"});return _(P,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:0,my:0}}),{stroke:Z(x,l)}),m(P,Te(x).text||"",{box:x,align:"left-top",padding:5,style:{fill:Mo(x,u,l)}}),N},ParticipantMultiplicityMarker:function(P,x){C("participant-multiplicity",P,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:x.width/2/x.width,my:(x.height-15)/x.height}}),{strokeWidth:2,fill:Et(x,c),stroke:Z(x,l)})},SubProcessMarker:function(P,x){Oe(S(P,14,14,0,{strokeWidth:1,fill:Et(x,c),stroke:Z(x,l)}),x.width/2-7.5,x.height-20),C("sub-process",P,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2-7.5)/x.width,my:(x.height-20)/x.height}}),{fill:Et(x,c),stroke:Z(x,l)})},ParallelMarker:function(P,x,N){C("parallel",P,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2+N.parallel)/x.width,my:(x.height-20)/x.height}}),{fill:Et(x,c),stroke:Z(x,l)})},SequentialMarker:function(P,x,N){C("sequential",P,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2+N.seq)/x.width,my:(x.height-19)/x.height}}),{fill:Et(x,c),stroke:Z(x,l)})},CompensationMarker:function(P,x,N){C("compensation",P,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2+N.compensation)/x.width,my:(x.height-13)/x.height}}),{strokeWidth:1,fill:Et(x,c),stroke:Z(x,l)})},LoopMarker:function(P,x,N){C("loop",P,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2+N.loop)/x.width,my:(x.height-7)/x.height}}),{strokeWidth:1,fill:Et(x,c),stroke:Z(x,l),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(P,x,N){C("adhoc",P,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:(x.width/2+N.adhoc)/x.width,my:(x.height-15)/x.height}}),{strokeWidth:1,fill:Z(x,l),stroke:Z(x,l)})}};function $(P,x,N){var j,G=Te(x),X=N&&N.indexOf("SubProcessMarker")!==-1;j=X?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},L(N,function(st){s(st)(P,x,j)}),G.isForCompensation&&s("CompensationMarker")(P,x,j),G.$type==="bpmn:AdHocSubProcess"&&s("AdhocMarker")(P,x,j);var tt=G.loopCharacteristics,rt=tt&&tt.isSequential;tt&&(rt===void 0&&s("LoopMarker")(P,x,j),rt===!1&&s("ParallelMarker")(P,x,j),rt===!0&&s("SequentialMarker")(P,x,j))}this._drawPath=_}it(Ui,Fn),Ui.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Ui.prototype.canRender=function(t){return A(t,"bpmn:BaseElement")},Ui.prototype.drawShape=function(t,e){var n=e.type;return(0,this.handlers[n])(t,e)},Ui.prototype.drawConnection=function(t,e){var n=e.type;return(0,this.handlers[n])(t,e)},Ui.prototype.getShapePath=function(t){return A(t,"bpmn:Event")?(n=(e=t).x+e.width/2,i=e.y+e.height/2,r=e.width/2,gr([["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(t,"bpmn:Activity")?function(o,a){var c=o.x,l=o.y,u=o.width,p=o.height;return gr([["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"]])}(t,10):A(t,"bpmn:Gateway")?function(o){var a=o.width/2,c=o.height/2;return gr([["M",o.x+a,o.y],["l",a,c],["l",-a,c],["l",-a,-c],["z"]])}(t):function(o){var a=o.x,c=o.y,l=o.width;return gr([["M",a,c],["l",l,0],["l",0,o.height],["l",-l,0],["z"]])}(t);var e,n,i,r};var jx=0,Vx={width:150,height:50};function Fx(t,e){var n;e.textContent=t;try{var i,r=t==="";return e.textContent=r?"dummy":t,i={width:(n=e.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch{return{width:0,height:0}}}function zx(t,e,n){for(var i,r=t.shift(),o=r;;){if((i=Fx(o,n)).width=o?i.width:0,o===" "||o===""||i.width<Math.round(e)||o.length<2)return $x(t,o,r,i);o=Gx(o,i.width,e)}}function $x(t,e,n,i){if(e.length<n.length){var r=n.slice(e.length).trim();t.unshift(r)}return{width:i.width,height:i.height,text:e}}var fm="\xAD";function Gx(t,e,n){var i=Math.max(t.length*(n/e),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!==fm||u.pop();break}u.push(c),p+=c.length}var d=u[u.length-1];return d&&d===fm&&(u[u.length-1]="-"),u.join("")}(t,i);return r||(r=t.slice(0,Math.max(Math.round(i-1),1))),r}function rs(t){this._config=z({},{size:Vx,padding:jx,style:{},align:"center-top"},t||{})}rs.prototype.createText=function(t,e){return this.layoutText(t,e).element},rs.prototype.getDimensions=function(t,e){return this.layoutText(t,e).dimensions},rs.prototype.layoutText=function(t,e){var n=z({},this._config.size,e.box),i=z({},this._config.style,e.style),r=function(b){var S=b.split("-");return{horizontal:S[0]||"center",vertical:S[1]||"top"}}(e.align||this._config.align),o=function(b){return te(b)?z({top:0,left:0,right:0,bottom:0},b):{top:b,left:b,right:b,bottom:b}}(e.padding!==void 0?e.padding:this._config.padding),a=e.fitBox||!1,c=function(b){if("fontSize"in b&&"lineHeight"in b)return b.lineHeight*parseInt(b.fontSize,10)}(i),l=t.split(/\u00AD?\r?\n/),u=[],p=n.width-o.left-o.right,d=ot("text");for(K(d,{x:0,y:0}),K(d,i),lt(function(){var b=document.getElementById("helper-svg");return b||(K(b=ot("svg"),{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(b)),b}(),d);l.length;)u.push(zx(l,p,d));r.vertical==="middle"&&(o.top=o.bottom=0);var y=De(u,function(b,S,w){return b+(c||S.height)},0)+o.top+o.bottom,f=De(u,function(b,S,w){return S.width>b?S.width:b},0),v=o.top;r.vertical==="middle"&&(v+=(n.height-y)/2),v-=(c||u[0].height)/4;var g=ot("text");return K(g,i),L(u,function(b){var S;switch(v+=c||b.height,r.horizontal){case"left":S=o.left;break;case"right":S=(a?f:p)-o.right-b.width;break;default:S=Math.max(((a?f:p)-b.width)/2+o.left,0)}var w=ot("tspan");K(w,{x:S,y:v}),w.textContent=b.text,lt(g,w)}),ee(d),{dimensions:{width:f,height:y},element:g}};function vm(t){var e=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},t&&t.defaultStyle||{}),n=parseInt(e.fontSize,10)-1,i=z({},e,{fontSize:n},t&&t.externalStyle||{}),r=new rs({style:e});this.getExternalLabelBounds=function(o,a){var c=r.getDimensions(a,{box:{width:90,height:30,x:o.width/2+o.x,y:o.height/2+o.y},style:i});return{x:Math.round(o.x+o.width/2-c.width/2),y:Math.round(o.y),width:Math.ceil(c.width),height:Math.ceil(c.height)}},this.getTextAnnotationBounds=function(o,a){var c=r.getDimensions(a,{box:o,style:e,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(30,Math.round(c.height))}},this.createText=function(o,a){return r.createText(o,a||{})},this.getDefaultStyle=function(){return e},this.getExternalStyle=function(){return i}}vm.$inject=["config.textRenderer"];var Ux=/\{([^{}]+)\}/g,Hx=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const qx={__init__:["bpmnRenderer"],bpmnRenderer:["type",Ui],textRenderer:["type",vm],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,e){var n,i,r=this.pathMap[t];e.abspos?(n=e.abspos.x,i=e.abspos.y):(n=e.containerWidth*e.position.mx,i=e.containerHeight*e.position.my);var o={};if(e.position){for(var a=e.containerHeight/r.height*e.yScaleFactor,c=e.containerWidth/r.width*e.xScaleFactor,l=0;l<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,d,y=(p=r.d,d={mx:n,my:i,e:o},String(p).replace(Ux,function(f,v){return function(g,b,S){var w=S;return b.replace(Hx,function(_,C,B,s,h){C=C||s,w&&(C in w&&(w=w[C]),typeof w=="function"&&h&&(w=w()))}),w=(w==null||w==S?g:w)+""}(f,v,d)}));return y}}]},os={translate:["value",function(t,e){return e=e||{},t.replace(/{([^}]+)}/g,function(n,i){return e[i]||"{"+i+"}"})}]};var Ro={width:90,height:20},ym=15;function Rr(t){return A(t,"bpmn:Event")||A(t,"bpmn:Gateway")||A(t,"bpmn:DataStoreReference")||A(t,"bpmn:DataObjectReference")||A(t,"bpmn:DataInput")||A(t,"bpmn:DataOutput")||A(t,"bpmn:SequenceFlow")||A(t,"bpmn:MessageFlow")||A(t,"bpmn:Group")}function as(t){return ge(t.label)}function Wx(t){var e=t.length/2-1,n=t[Math.floor(e)],i=t[Math.ceil(e+.01)],r=function(l){var u=l.length/2-1,p=l[Math.floor(u)],d=l[Math.ceil(u+.01)];return{x:p.x+(d.x-p.x)/2,y:p.y+(d.y-p.y)/2}}(t),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-=ym:a+=ym,{x:a,y:c}}function ss(t){return t.waypoints?Wx(t.waypoints):A(t,"bpmn:Group")?{x:t.x+t.width/2,y:t.y+Ro.height/2}:{x:t.x+t.width/2,y:t.y+t.height+Ro.height/2}}function ge(t){return t&&!!t.labelTarget}function cs(t,e){return z({id:t.id,type:t.$type,businessObject:t},e)}function Xx(t,e,n){var i=t.di.waypoint;return!i||i.length<2?[ft(e),ft(n)]:i.map(function(r){return{x:r.x,y:r.y}})}function gm(t,e,n,i){return new Error(t("element {element} referenced by {referenced}#{property} not yet drawn",{element:Ce(n),referenced:Ce(e),property:i}))}function Un(t,e,n,i,r,o){this._eventBus=t,this._canvas=e,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}Un.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],Un.prototype.add=function(t,e){var n,i,r,o,a,c,l,u=t.di,p=this._translate;if(A(u,"bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(cs(t)),this._canvas.setRootElement(n);else if(A(u,"bpmndi:BPMNShape")){var d=!Mt(t),y=function(b){return A(b,"bpmn:Group")}(t);i=e&&(e.hidden||e.collapsed);var f=t.di.bounds;n=this._elementFactory.createShape(cs(t,{collapsed:d,hidden:i,x:Math.round(f.x),y:Math.round(f.y),width:Math.round(f.width),height:Math.round(f.height),isFrame:y})),A(t,"bpmn:BoundaryEvent")&&this._attachBoundary(t,n),A(t,"bpmn:Lane")&&(r=0),A(t,"bpmn:DataStoreReference")&&(o=e,a=ft(f),c=a.x,l=a.y,c>=o.x&&c<=o.x+o.width&&l>=o.y&&l<=o.y+o.height||(e=this._canvas.getRootElement())),this._canvas.addShape(n,e,r)}else{if(!A(u,"bpmndi:BPMNEdge"))throw new Error(p("unknown di {di} for element {semantic}",{di:Ce(u),semantic:Ce(t)}));var v=this._getSource(t),g=this._getTarget(t);i=e&&(e.hidden||e.collapsed),n=this._elementFactory.createConnection(cs(t,{hidden:i,source:v,target:g,waypoints:Xx(t,v,g)})),A(t,"bpmn:DataAssociation")&&(e=null),A(t,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,e,r)}return Rr(t)&&un(n)&&this.addLabel(t,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},Un.prototype._attachBoundary=function(t,e){var n=this._translate,i=t.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Ce(t)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw gm(n,t,i,"attachedToRef");e.host=r,o||(r.attachers=o=[]),o.indexOf(e)===-1&&o.push(e)},Un.prototype.addLabel=function(t,e){var n,i,r;return n=function(o,a){var c,l,u,p=o.di.label;return p&&p.bounds?(u=p.bounds,l={width:Math.max(Ro.width,u.width),height:u.height},c={x:u.x+u.width/2,y:u.y+u.height/2}):(c=ss(a),l=Ro),z({x:c.x-l.width/2,y:c.y-l.height/2},l)}(t,e),(i=un(e))&&(n=this._textRenderer.getExternalLabelBounds(n,i)),r=this._elementFactory.createLabel(cs(t,{id:t.id+"_label",labelTarget:e,type:"label",hidden:e.hidden||!un(e),x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,e.parent)},Un.prototype._getEnd=function(t,e){var n,i,r=t.$type,o=this._translate;if(i=t[e+"Ref"],e==="source"&&r==="bpmn:DataInputAssociation"&&(i=i&&i[0]),(e==="source"&&r==="bpmn:DataOutputAssociation"||e==="target"&&r==="bpmn:DataInputAssociation")&&(i=t.$parent),n=i&&this._getElement(i))return n;throw i?gm(o,t,i,e+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:Ce(t),side:e}))},Un.prototype._getSource=function(t){return this._getEnd(t,"source")},Un.prototype._getTarget=function(t){return this._getEnd(t,"target")},Un.prototype._getElement=function(t){return this._elementRegistry.get(t.id)};const Kx={__depends__:[qx,{__depends__:[os],bpmnImporter:["type",Un]}]};function bm(t){t&&typeof t.stopPropagation=="function"&&t.stopPropagation()}function Nr(t){return t.originalEvent||t.srcEvent}function Ql(t,e){bm(t),bm(Nr(t))}function vi(t){return t.pointers&&t.pointers.length&&(t=t.pointers[0]),t.touches&&t.touches.length&&(t=t.touches[0]),t?{x:t.clientX,y:t.clientY}:null}function xm(t,e){return(Nr(t)||t).button===e}function yi(t){return xm(t,0)}function Ir(t){var e=Nr(t)||t;return!!yi(t)&&(/mac/i.test(navigator.platform)?e.metaKey:e.ctrlKey)}function Em(t){var e=Nr(t)||t;return yi(t)&&e.shiftKey}function Yx(t){return!0}function ls(t){return yi(t)||function(e){return xm(e,1)}(t)}function _m(t,e,n){var i=this;function r(w,_,C){var B,s;(function(h,m){var E=l[h]||yi;return!E(m)})(w,_)||(C?s=e.getGraphics(C):(B=_.delegateTarget||_.target)&&(s=B,C=e.get(s)),s&&C&&t.fire(w,{element:C,gfx:s,originalEvent:_})===!1&&(_.stopPropagation(),_.preventDefault()))}var o={};function a(w){return o[w]}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":Yx,"element.mousedown":ls,"element.mouseup":ls,"element.click":ls,"element.dblclick":ls},u="svg, .djs-element";function p(w,_,C,B){var s=o[C]=function(h){r(C,h)};B&&(l[C]=B),s.$delegate=$e.bind(w,u,_,s)}function d(w,_,C){var B=a(C);B&&$e.unbind(w,_,B.$delegate)}t.on("canvas.destroy",function(w){(function(_){L(c,function(C,B){d(_,B,C)})})(w.svg)}),t.on("canvas.init",function(w){(function(_){L(c,function(C,B){p(_,B,C)})})(w.svg)}),t.on(["shape.added","connection.added"],function(w){var _=w.element,C=w.gfx;t.fire("interactionEvents.createHit",{element:_,gfx:C})}),t.on(["shape.changed","connection.changed"],500,function(w){var _=w.element,C=w.gfx;t.fire("interactionEvents.updateHit",{element:_,gfx:C})}),t.on("interactionEvents.createHit",500,function(w){var _=w.element,C=w.gfx;i.createDefaultHit(_,C)}),t.on("interactionEvents.updateHit",function(w){var _=w.element,C=w.gfx;i.updateDefaultHit(_,C)});var y=g("djs-hit djs-hit-stroke"),f=g("djs-hit djs-hit-click-stroke"),v={all:g("djs-hit djs-hit-all"),"click-stroke":f,stroke:y};function g(w,_){return _=z({stroke:"white",strokeWidth:15},_||{}),n.cls(w,["no-fill","no-border"],_)}function b(w,_){var C=v[_];if(!C)throw new Error("invalid hit type <"+_+">");return K(w,C),w}function S(w,_){lt(w,_)}this.removeHits=function(w){L(xl(".djs-hit",w),ee)},this.createDefaultHit=function(w,_){var C,B=w.waypoints,s=w.isFrame;return B?this.createWaypointsHit(_,B):(C=s?"stroke":"all",this.createBoxHit(_,C,{width:w.width,height:w.height}))},this.createWaypointsHit=function(w,_){var C=Nl(_);return b(C,"stroke"),S(w,C),C},this.createBoxHit=function(w,_,C){C=z({x:0,y:0},C);var B=ot("rect");return b(B,_),K(B,C),S(w,B),B},this.updateDefaultHit=function(w,_){var C=Wt(".djs-hit",_);if(C)return w.waypoints?function(B,s){K(B,{points:hd(s)})}(C,w.waypoints):K(C,{width:w.width,height:w.height}),C},this.fire=r,this.triggerMouseEvent=function(w,_,C){var B=c[w];if(!B)throw new Error("unmapped DOM event name <"+w+">");return r(B,_,C)},this.mouseHandler=a,this.registerEvent=p,this.unregisterEvent=d}_m.$inject=["eventBus","elementRegistry","styles"];const No={__init__:["interactionEvents"],interactionEvents:["type",_m]};function us(t,e,n){this.offset=6;var i=e.cls("djs-outline",["no-fill"]),r=this;function o(a,c){var l=ot("rect");return K(l,z({x:10,y:10,width:100,height:100},i)),lt(a,l),l}t.on(["shape.added","shape.changed"],500,function(a){var c=a.element,l=a.gfx,u=Wt(".djs-outline",l);u||(u=o(l)),r.updateShapeOutline(u,c)}),t.on(["connection.added","connection.changed"],function(a){var c=a.element,l=a.gfx,u=Wt(".djs-outline",l);u||(u=o(l)),r.updateConnectionOutline(u,c)})}us.prototype.updateShapeOutline=function(t,e){K(t,{x:-this.offset,y:-this.offset,width:e.width+2*this.offset,height:e.height+2*this.offset})},us.prototype.updateConnectionOutline=function(t,e){var n=ve(e);K(t,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},us.$inject=["eventBus","styles","elementRegistry"];const wm={__init__:["outline"],outline:["type",us]};function Dr(t,e){this._eventBus=t,this._canvas=e,this._selectedElements=[];var n=this;t.on(["shape.remove","connection.remove"],function(i){var r=i.element;n.deselect(r)}),t.on(["diagram.clear","plane.set"],function(i){n.select(null)})}Dr.$inject=["eventBus","canvas"],Dr.prototype.deselect=function(t){var e=this._selectedElements,n=e.indexOf(t);if(n!==-1){var i=e.slice();e.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:e})}},Dr.prototype.get=function(){return this._selectedElements},Dr.prototype.isSelected=function(t){return this._selectedElements.indexOf(t)!==-1},Dr.prototype.select=function(t,e){var n=this._selectedElements,i=n.slice();gt(t)||(t=t?[t]:[]);var r=this._canvas;t=t.filter(function(o){return r.findPlane(o)===r.getActivePlane()}),e?L(t,function(o){n.indexOf(o)===-1&&n.push(o)}):this._selectedElements=n=t.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Sm="hover",Cm="selected";function Tm(t,e,n,i){function r(a,c){e.addMarker(a,c)}function o(a,c){e.removeMarker(a,c)}this._multiSelectionBox=null,t.on("element.hover",function(a){r(a.element,Sm)}),t.on("element.out",function(a){o(a.element,Sm)}),t.on("selection.changed",function(a){var c=a.oldSelection,l=a.newSelection;L(c,function(u){l.indexOf(u)===-1&&o(u,Cm)}),L(l,function(u){c.indexOf(u)===-1&&r(u,Cm)})})}function Am(t,e,n,i){t.on("create.end",500,function(r){var o=r.context,a=o.canExecute,c=o.elements,l=(o.hints||{}).autoSelect;if(a){if(l===!1)return;gt(l)?e.select(l):e.select(c.filter(Jx))}}),t.on("connect.end",500,function(r){var o=r.context,a=o.canExecute,c=o.hover;a&&c&&e.select(c)}),t.on("shape.move.end",500,function(r){var o=r.previousSelection||[],a=i.get(r.context.shape.id);Pt(o,function(c){return a.id===c.id})||e.select(a)}),t.on("element.click",function(r){if(yi(r)){var o=r.element;o===n.getRootElement()&&(o=null);var a=e.isSelected(o),c=e.get().length>1,l=Ir(r)||Em(r);if(a&&c)return l?e.deselect(o):e.select(o);a?e.deselect(o):e.select(o,l)}})}function Jx(t){return!t.hidden}Tm.$inject=["eventBus","canvas","selection","styles"],Am.$inject=["eventBus","selection","canvas","elementRegistry"];const Mn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[No,wm],selection:["type",Dr],selectionVisuals:["type",Tm],selectionBehavior:["type",Am]};function tu(t){this._counter=0,this._prefix=(t?t+"-":"")+Math.floor(1e9*Math.random())+"-"}tu.prototype.next=function(){return this._prefix+ ++this._counter};var Zx=new tu("ov");function ue(t,e,n,i){var r,o;this._eventBus=e,this._canvas=n,this._elementRegistry=i,this._ids=Zx,this._overlayDefaults=z({show:null,scale:!0},t&&t.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),o=jt('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(o,r.firstChild),o),this._init()}function km(t,e,n){z(t.style,{left:e+"px",top:n+"px"})}function Io(t,e){t.style.display=e===!1?"none":""}function Pm(t,e){t.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){t.style[n+"transform"]=e})}ue.$inject=["config.overlays","eventBus","canvas","elementRegistry"],ue.prototype.get=function(t){if(Ie(t)&&(t={id:t}),Ie(t.element)&&(t.element=this._elementRegistry.get(t.element)),t.element){var e=this._getOverlayContainer(t.element,!0);return e?t.type?dt(e.overlays,Xe({type:t.type})):e.overlays.slice():[]}return t.type?dt(this._overlays,Xe({type:t.type})):t.id?this._overlays[t.id]:null},ue.prototype.add=function(t,e,n){if(te(e)&&(n=e,e=null),t.id||(t=this._elementRegistry.get(t)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!t)throw new Error("invalid element specified");var i=this._ids.next();return n=z({},this._overlayDefaults,n,{id:i,type:e,element:t,html:n.html}),this._addOverlay(n),i},ue.prototype.remove=function(t){var e=this.get(t)||[];gt(e)||(e=[e]);var n=this;L(e,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(Tn(i.html),Tn(i.htmlContainer),delete i.htmlContainer,delete i.element,delete n._overlays[i.id]),r){var o=r.overlays.indexOf(i);o!==-1&&r.overlays.splice(o,1)}})},ue.prototype.show=function(){Io(this._overlayRoot)},ue.prototype.hide=function(){Io(this._overlayRoot,!1)},ue.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Oa(this._overlayRoot)},ue.prototype._updateOverlayContainer=function(t){var e=t.element,n=t.html,i=e.x,r=e.y;if(e.waypoints){var o=ve(e);i=o.x,r=o.y}km(n,i,r),ze(t.html,"data-container-id",e.id)},ue.prototype._updateOverlay=function(t){var e,n,i=t.position,r=t.htmlContainer,o=t.element,a=i.left,c=i.top;i.right!==void 0&&(e=o.waypoints?ve(o).width:o.width,a=-1*i.right+e),i.bottom!==void 0&&(n=o.waypoints?ve(o).height:o.height,c=-1*i.bottom+n),km(r,a||0,c||0)},ue.prototype._createOverlayContainer=function(t){var e=jt('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(e);var n={html:e,element:t,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},ue.prototype._updateRoot=function(t){var e=t.scale||1,n="matrix("+[e,0,0,e,-1*t.x*e,-1*t.y*e].join(",")+")";Pm(this._overlayRoot,n)},ue.prototype._getOverlayContainer=function(t,e){var n=Pt(this._overlayContainers,function(i){return i.element===t});return n||e?n:this._createOverlayContainer(t)},ue.prototype._addOverlay=function(t){var e,n,i=t.id,r=t.element,o=t.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),Ie(o)&&(o=jt(o)),n=this._getOverlayContainer(r),(e=jt('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(o),t.type&&oe(e).add("djs-overlay-"+t.type);var a=this._canvas.findPlane(r),c=this._canvas.getActivePlane();t.plane=a,a!==c&&Io(e,!1),t.htmlContainer=e,n.overlays.push(t),n.html.appendChild(e),this._overlays[i]=t,this._updateOverlay(t),this._updateOverlayVisibilty(t,this._canvas.viewbox())},ue.prototype._updateOverlayVisibilty=function(t,e){var n=t.show,i=t.plane,r=n&&n.minZoom,o=n&&n.maxZoom,a=t.htmlContainer,c=!0;(i!==this._canvas.getActivePlane()||n&&(qe(r)&&r>e.scale||qe(o)&&o<e.scale))&&(c=!1),Io(a,c),this._updateOverlayScale(t,e)},ue.prototype._updateOverlayScale=function(t,e){var n,i,r,o=t.scale,a=t.htmlContainer,c="";o!==!0&&(o===!1?(n=1,i=1):(n=o.min,i=o.max),qe(n)&&e.scale<n&&(r=(1/e.scale||1)*n),qe(i)&&e.scale>i&&(r=(1/e.scale||1)*i)),qe(r)&&(c="scale("+r+","+r+")"),Pm(a,c)},ue.prototype._updateOverlaysVisibilty=function(t){var e=this;L(this._overlays,function(n){e._updateOverlayVisibilty(n,t)})},ue.prototype._init=function(){var t=this._eventBus,e=this;t.on("canvas.viewbox.changing",function(n){e.hide()}),t.on("canvas.viewbox.changed",function(n){var i;i=n.viewbox,e._updateRoot(i),e._updateOverlaysVisibilty(i),e.show()}),t.on(["shape.remove","connection.remove"],function(n){var i=n.element;L(e.get({element:i}),function(a){e.remove(a.id)});var r=e._getOverlayContainer(i);if(r){Tn(r.html);var o=e._overlayContainers.indexOf(r);o!==-1&&e._overlayContainers.splice(o,1)}}),t.on("element.changed",500,function(n){var i=n.element,r=e._getOverlayContainer(i,!0);r&&(L(r.overlays,function(o){e._updateOverlay(o)}),e._updateOverlayContainer(r))}),t.on("element.marker.update",function(n){var i=e._getOverlayContainer(n.element,!0);i&&oe(i.html)[n.add?"add":"remove"](n.marker)}),t.on("plane.set",function(n){L(e._overlays,function(i){Io(i.htmlContainer,i.plane===n.plane)})}),t.on("diagram.clear",this.clear,this)};const eu={__init__:["overlays"],overlays:["type",ue]};function Hn(t){Ut.call(this,t)}it(Hn,Ut),Hn.prototype._modules=[Kx,os,Mn,eu],Hn.prototype._moddleExtensions={};var Qx=["c","C",67],tE=["v","V",86],eE=["y","Y",89],Mm=["z","Z",90];function He(t){return!t.altKey&&(t.ctrlKey||t.metaKey)}function pn(t,e){return(t=gt(t)?t:[t]).indexOf(e.key)!==-1||t.indexOf(e.keyCode)!==-1}function nu(t){return t.shiftKey}var ps="keyboard.keydown",Rm="input-handle-modified-keys";function pe(t,e){var n=this;this._config=t||{},this._eventBus=e,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),e.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.on("diagram.init",function(){n._fire("init")}),e.on("attach",function(){t&&t.bindTo&&n.bind(t.bindTo)}),e.on("detach",function(){n.unbind()})}pe.$inject=["config.keyboard","eventBus"],pe.prototype._keydownHandler=function(t){this._keyHandler(t,ps)},pe.prototype._keyupHandler=function(t){this._keyHandler(t,"keyboard.keyup")},pe.prototype._keyHandler=function(t,e){if(!this._isEventIgnored(t)){var n={keyEvent:t};this._eventBus.fire(e||ps,n)&&t.preventDefault()}},pe.prototype._isEventIgnored=function(t){return(e=t.target)&&(La(e,"input, textarea")||e.contentEditable==="true")&&this._isModifiedKeyIgnored(t);var e},pe.prototype._isModifiedKeyIgnored=function(t){return!He(t)||!this._getAllowedModifiers(t.target).includes(t.key)},pe.prototype._getAllowedModifiers=function(t){var e=Vi(t,"["+Rm+"]",!0);return!e||this._node&&!this._node.contains(e)?[]:e.getAttribute(Rm).split(",")},pe.prototype.bind=function(t){this.unbind(),this._node=t,ct.bind(t,"keydown",this._keydownHandler,!0),ct.bind(t,"keyup",this._keyupHandler,!0),this._fire("bind")},pe.prototype.getBinding=function(){return this._node},pe.prototype.unbind=function(){var t=this._node;t&&(this._fire("unbind"),ct.unbind(t,"keydown",this._keydownHandler,!0),ct.unbind(t,"keyup",this._keyupHandler,!0)),this._node=null},pe.prototype._fire=function(t){this._eventBus.fire("keyboard."+t,{node:this._node})},pe.prototype.addListener=function(t,e,n){fe(t)&&(n=e,e=t,t=1e3),this._eventBus.on(n||ps,t,e)},pe.prototype.removeListener=function(t,e){this._eventBus.off(e||ps,t)},pe.prototype.hasModifier=function(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey},pe.prototype.isCmd=He,pe.prototype.isShift=nu,pe.prototype.isKey=pn;var nE=500;function Br(t,e){var n=this;t.on("editorActions.init",nE,function(i){var r=i.editorActions;n.registerBindings(e,r)})}Br.$inject=["eventBus","keyboard"],Br.prototype.registerBindings=function(t,e){function n(i,r){e.isRegistered(i)&&t.addListener(r)}n("undo",function(i){if(function(r){return He(r)&&!nu(r)&&pn(Mm,r)}(i.keyEvent))return e.trigger("undo"),!0}),n("redo",function(i){if(function(r){return He(r)&&(pn(eE,r)||pn(Mm,r)&&nu(r))}(i.keyEvent))return e.trigger("redo"),!0}),n("copy",function(i){if(function(r){return He(r)&&pn(Qx,r)}(i.keyEvent))return e.trigger("copy"),!0}),n("paste",function(i){if(function(r){return He(r)&&pn(tE,r)}(i.keyEvent))return e.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(pn(["+","Add","="],r)&&He(r))return e.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(pn(["-","Subtract"],r)&&He(r))return e.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(pn("0",r)&&He(r))return e.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){if(pn(["Backspace","Delete","Del"],i.keyEvent))return e.trigger("removeSelection"),!0})};const iu={__init__:["keyboard","keyboardBindings"],keyboard:["type",pe],keyboardBindings:["type",Br]};var iE={moveSpeed:50,moveSpeedAccelerated:200};function Nm(t,e,n){var i=this;this._config=z({},iE,t||{}),e.addListener(function(r){var o=r.keyEvent,a=i._config;if(e.isCmd(o)&&e.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],o)){var c,l=e.isShift(o)?a.moveSpeedAccelerated:a.moveSpeed;switch(o.key){case"ArrowLeft":case"Left":c="left";break;case"ArrowUp":case"Up":c="up";break;case"ArrowRight":case"Right":c="right";break;case"ArrowDown":case"Down":c="down"}return i.moveCanvas({speed:l,direction:c}),!0}}),this.moveCanvas=function(r){var o=0,a=0,c=r.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(r.direction){case"left":o=c;break;case"up":a=c;break;case"right":o=-c;break;case"down":a=-c}n.scroll({dx:o,dy:a})}}Nm.$inject=["config.keyboardMove","keyboard","canvas"];const Im={__depends__:[iu],__init__:["keyboardMove"],keyboardMove:["type",Nm]};var rE=/^djs-cursor-.*$/;function hs(t){var e=oe(document.body);e.removeMatching(rE),t&&e.add("djs-cursor-"+t)}function Dm(){hs(null)}var oE=5e3;function Bm(t,e){function n(){return!1}return e=e||"element.click",t.once(e,oE,n),function(){t.off(e,n)}}function Do(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Rn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Om(t,e){var n;function i(o){var a,c=n.start,l=n.button,u=vi(o),p=Rn(u,c);!n.dragging&&(a=p,Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2))>15)&&(n.dragging=!0,l===0&&Bm(t),hs("grab")),n.dragging&&(p=Rn(u,n.last||n.start),e.scroll({dx:p.x,dy:p.y}),n.last=u),o.preventDefault()}function r(o){ct.unbind(document,"mousemove",i),ct.unbind(document,"mouseup",r),n=null,Dm()}t.on("element.mousedown",500,function(o){return function(a){if(!Vi(a.target,".djs-draggable")){var c=a.button;if(!(c>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:c,start:vi(a)},ct.bind(document,"mousemove",i),ct.bind(document,"mouseup",r),!0}}(o.originalEvent)}),this.isActive=function(){return!!n}}Om.$inject=["eventBus","canvas"];const Lm={__init__:["moveCanvas"],moveCanvas:["type",Om]};function ru(t){return Math.log(t)/Math.log(10)}function jm(t,e){var n=ru(t.min),i=ru(t.max);return(Math.abs(n)+Math.abs(i))/e}var aE=Math.sign||function(t){return t>=0?1:-1},ou={min:.2,max:4};function Nn(t,e,n){t=t||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=we(this._handleWheel,this),this._totalDelta=0,this._scale=t.scale||.75;var i=this;e.on("canvas.init",function(r){i._init(t.enabled!==!1)})}Nn.$inject=["config.zoomScroll","eventBus","canvas"],Nn.prototype.scroll=function(t){this._canvas.scroll(t)},Nn.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Nn.prototype.zoom=function(t,e){var n=jm(ou,20);this._totalDelta+=t,Math.abs(this._totalDelta)>.1&&(this._zoom(t,e,n),this._totalDelta=0)},Nn.prototype._handleWheel=function(t){if(!Vi(t.target,".djs-scrollable",!0)){var e=this._container;t.preventDefault();var n,i=t.ctrlKey,r=t.shiftKey,o=-1*this._scale;if(o*=i?t.deltaMode===0?.02:.32:t.deltaMode===0?1:16,i){var a=e.getBoundingClientRect(),c={x:t.clientX-a.left,y:t.clientY-a.top};n=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*aE(t.deltaY)*o,this.zoom(n,c)}else n=r?{dx:o*t.deltaY,dy:0}:{dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(n)}},Nn.prototype.stepZoom=function(t,e){var n=jm(ou,10);this._zoom(t,e,n)},Nn.prototype._zoom=function(t,e,n){var i=this._canvas,r=t>0?1:-1,o=ru(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var c,l,u=Math.pow(10,a);i.zoom((c=ou,l=u,Math.max(c.min,Math.min(c.max,l))),e)},Nn.prototype.toggle=function(t){var e=this._container,n=this._handleWheel,i=this._enabled;return t===void 0&&(t=!i),i!==t&&ct[t?"bind":"unbind"](e,"wheel",n,!1),this._enabled=t,t},Nn.prototype._init=function(t){this.toggle(t)};const Vm={__init__:["zoomScroll"],zoomScroll:["type",Nn]};function Bo(t){Hn.call(this,t)}it(Bo,Hn),Bo.prototype._navigationModules=[Im,Lm,Vm],Bo.prototype._modules=[].concat(Hn.prototype._modules,Bo.prototype._navigationModules);var Fm={exports:{}};(function(t){(function(e,n,i,r){var o,a=["","webkit","Moz","MS","ms","o"],c=n.createElement("div"),l="function",u=Math.round,p=Math.abs,d=Date.now;function y(k,O,F){return setTimeout(_(k,F),O)}function f(k,O,F){return!!Array.isArray(k)&&(v(k,F[O],F),!0)}function v(k,O,F){var U;if(k)if(k.forEach)k.forEach(O,F);else if(k.length!==r)for(U=0;U<k.length;)O.call(F,k[U],U,k),U++;else for(U in k)k.hasOwnProperty(U)&&O.call(F,k[U],U,k)}function g(k,O,F){var U="DEPRECATED METHOD: "+O+`
- `+F+` AT
- `;return function(){var Y=new Error("get-stack-trace"),yt=Y&&Y.stack?Y.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Ot=e.console&&(e.console.warn||e.console.log);return Ot&&Ot.call(e.console,U,yt),k.apply(this,arguments)}}o=typeof Object.assign!="function"?function(k){if(k===r||k===null)throw new TypeError("Cannot convert undefined or null to object");for(var O=Object(k),F=1;F<arguments.length;F++){var U=arguments[F];if(U!==r&&U!==null)for(var Y in U)U.hasOwnProperty(Y)&&(O[Y]=U[Y])}return O}:Object.assign;var b=g(function(k,O,F){for(var U=Object.keys(O),Y=0;Y<U.length;)(!F||F&&k[U[Y]]===r)&&(k[U[Y]]=O[U[Y]]),Y++;return k},"extend","Use `assign`."),S=g(function(k,O){return b(k,O,!0)},"merge","Use `assign`.");function w(k,O,F){var U,Y=O.prototype;(U=k.prototype=Object.create(Y)).constructor=k,U._super=Y,F&&o(U,F)}function _(k,O){return function(){return k.apply(O,arguments)}}function C(k,O){return typeof k==l?k.apply(O&&O[0]||r,O):k}function B(k,O){return k===r?O:k}function s(k,O,F){v(T(O),function(U){k.addEventListener(U,F,!1)})}function h(k,O,F){v(T(O),function(U){k.removeEventListener(U,F,!1)})}function m(k,O){for(;k;){if(k==O)return!0;k=k.parentNode}return!1}function E(k,O){return k.indexOf(O)>-1}function T(k){return k.trim().split(/\s+/g)}function M(k,O,F){if(k.indexOf&&!F)return k.indexOf(O);for(var U=0;U<k.length;){if(F&&k[U][F]==O||!F&&k[U]===O)return U;U++}return-1}function I(k){return Array.prototype.slice.call(k,0)}function $(k,O,F){for(var U=[],Y=[],yt=0;yt<k.length;){var Ot=O?k[yt][O]:k[yt];M(Y,Ot)<0&&U.push(k[yt]),Y[yt]=Ot,yt++}return F&&(U=O?U.sort(function(_e,At){return _e[O]>At[O]}):U.sort()),U}function P(k,O){for(var F,U,Y=O[0].toUpperCase()+O.slice(1),yt=0;yt<a.length;){if((U=(F=a[yt])?F+Y:O)in k)return U;yt++}return r}var x=1;function N(k){var O=k.ownerDocument||k;return O.defaultView||O.parentWindow||e}var j="ontouchstart"in e,G=P(e,"PointerEvent")!==r,X=j&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),tt="touch",rt="mouse",st=25,H=1,q=4,xt=8,Xt=1,ce=2,It=4,qt=8,_t=16,zt=ce|It,Kt=qt|_t,Rt=zt|Kt,he=["x","y"],St=["clientX","clientY"];function $t(k,O){var F=this;this.manager=k,this.callback=O,this.element=k.element,this.target=k.options.inputTarget,this.domHandler=function(U){C(k.options.enable,[k])&&F.handler(U)},this.init()}function ht(k,O,F){var U=F.pointers.length,Y=F.changedPointers.length,yt=O&H&&U-Y==0,Ot=O&(q|xt)&&U-Y==0;F.isFirst=!!yt,F.isFinal=!!Ot,yt&&(k.session={}),F.eventType=O,function(_e,At){var Ae=_e.session,il=At.pointers,f0=il.length;Ae.firstInput||(Ae.firstInput=Bt(At)),f0>1&&!Ae.firstMultiple?Ae.firstMultiple=Bt(At):f0===1&&(Ae.firstMultiple=!1);var v0=Ae.firstInput,eo=Ae.firstMultiple,y0=eo?eo.center:v0.center,g0=At.center=Ii(il);At.timeStamp=d(),At.deltaTime=At.timeStamp-v0.timeStamp,At.angle=bn(y0,g0),At.distance=Ee(y0,g0),function(En,de){var Bi=de.center,dr=En.offsetDelta||{},mr=En.prevDelta||{},fr=En.prevInput||{};de.eventType!==H&&fr.eventType!==q||(mr=En.prevDelta={x:fr.deltaX||0,y:fr.deltaY||0},dr=En.offsetDelta={x:Bi.x,y:Bi.y}),de.deltaX=mr.x+(Bi.x-dr.x),de.deltaY=mr.y+(Bi.y-dr.y)}(Ae,At),At.offsetDirection=Qt(At.deltaX,At.deltaY);var no=pr(At.deltaTime,At.deltaX,At.deltaY);At.overallVelocityX=no.x,At.overallVelocityY=no.y,At.overallVelocity=p(no.x)>p(no.y)?no.x:no.y,At.scale=eo?(jh=eo.pointers,Vh=il,Ee(Vh[0],Vh[1],St)/Ee(jh[0],jh[1],St)):1,At.rotation=eo?function(En,de){return bn(de[1],de[0],St)+bn(En[1],En[0],St)}(eo.pointers,il):0,At.maxPointers=Ae.prevInput?At.pointers.length>Ae.prevInput.maxPointers?At.pointers.length:Ae.prevInput.maxPointers:At.pointers.length,function(En,de){var Bi,dr,mr,fr,Oi=En.lastInterval||de,b0=de.timeStamp-Oi.timeStamp;if(de.eventType!=xt&&(b0>st||Oi.velocity===r)){var x0=de.deltaX-Oi.deltaX,E0=de.deltaY-Oi.deltaY,io=pr(b0,x0,E0);dr=io.x,mr=io.y,Bi=p(io.x)>p(io.y)?io.x:io.y,fr=Qt(x0,E0),En.lastInterval=de}else Bi=Oi.velocity,dr=Oi.velocityX,mr=Oi.velocityY,fr=Oi.direction;de.velocity=Bi,de.velocityX=dr,de.velocityY=mr,de.direction=fr}(Ae,At);var jh,Vh,Fh=_e.element;m(At.srcEvent.target,Fh)&&(Fh=At.srcEvent.target),At.target=Fh}(k,F),k.emit("hammer.input",F),k.recognize(F),k.session.prevInput=F}function Bt(k){for(var O=[],F=0;F<k.pointers.length;)O[F]={clientX:u(k.pointers[F].clientX),clientY:u(k.pointers[F].clientY)},F++;return{timeStamp:d(),pointers:O,center:Ii(O),deltaX:k.deltaX,deltaY:k.deltaY}}function Ii(k){var O=k.length;if(O===1)return{x:u(k[0].clientX),y:u(k[0].clientY)};for(var F=0,U=0,Y=0;Y<O;)F+=k[Y].clientX,U+=k[Y].clientY,Y++;return{x:u(F/O),y:u(U/O)}}function pr(k,O,F){return{x:O/k||0,y:F/k||0}}function Qt(k,O){return k===O?Xt:p(k)>=p(O)?k<0?ce:It:O<0?qt:_t}function Ee(k,O,F){F||(F=he);var U=O[F[0]]-k[F[0]],Y=O[F[1]]-k[F[1]];return Math.sqrt(U*U+Y*Y)}function bn(k,O,F){F||(F=he);var U=O[F[0]]-k[F[0]],Y=O[F[1]]-k[F[1]];return 180*Math.atan2(Y,U)/Math.PI}$t.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(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&h(this.element,this.evEl,this.domHandler),this.evTarget&&h(this.target,this.evTarget,this.domHandler),this.evWin&&h(N(this.element),this.evWin,this.domHandler)}};var Di={mousedown:H,mousemove:2,mouseup:q},Kc="mousedown",tA="mousemove mouseup";function Yc(){this.evEl=Kc,this.evWin=tA,this.pressed=!1,$t.apply(this,arguments)}w(Yc,$t,{handler:function(k){var O=Di[k.type];O&H&&k.button===0&&(this.pressed=!0),2&O&&k.which!==1&&(O=q),this.pressed&&(O&q&&(this.pressed=!1),this.callback(this.manager,O,{pointers:[k],changedPointers:[k],pointerType:rt,srcEvent:k}))}});var eA={pointerdown:H,pointermove:2,pointerup:q,pointercancel:xt,pointerout:xt},nA={2:tt,3:"pen",4:rt,5:"kinect"},r0="pointerdown",o0="pointermove pointerup pointercancel";function Ph(){this.evEl=r0,this.evWin=o0,$t.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&(r0="MSPointerDown",o0="MSPointerMove MSPointerUp MSPointerCancel"),w(Ph,$t,{handler:function(k){var O=this.store,F=!1,U=k.type.toLowerCase().replace("ms",""),Y=eA[U],yt=nA[k.pointerType]||k.pointerType,Ot=yt==tt,_e=M(O,k.pointerId,"pointerId");Y&H&&(k.button===0||Ot)?_e<0&&(O.push(k),_e=O.length-1):Y&(q|xt)&&(F=!0),_e<0||(O[_e]=k,this.callback(this.manager,Y,{pointers:O,changedPointers:[k],pointerType:yt,srcEvent:k}),F&&O.splice(_e,1))}});var iA={touchstart:H,touchmove:2,touchend:q,touchcancel:xt};function a0(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,$t.apply(this,arguments)}function rA(k,O){var F=I(k.touches),U=I(k.changedTouches);return O&(q|xt)&&(F=$(F.concat(U),"identifier",!0)),[F,U]}w(a0,$t,{handler:function(k){var O=iA[k.type];if(O===H&&(this.started=!0),this.started){var F=rA.call(this,k,O);O&(q|xt)&&F[0].length-F[1].length==0&&(this.started=!1),this.callback(this.manager,O,{pointers:F[0],changedPointers:F[1],pointerType:tt,srcEvent:k})}}});var oA={touchstart:H,touchmove:2,touchend:q,touchcancel:xt},aA="touchstart touchmove touchend touchcancel";function Jc(){this.evTarget=aA,this.targetIds={},$t.apply(this,arguments)}function sA(k,O){var F=I(k.touches),U=this.targetIds;if(O&(2|H)&&F.length===1)return U[F[0].identifier]=!0,[F,F];var Y,yt,Ot=I(k.changedTouches),_e=[],At=this.target;if(yt=F.filter(function(Ae){return m(Ae.target,At)}),O===H)for(Y=0;Y<yt.length;)U[yt[Y].identifier]=!0,Y++;for(Y=0;Y<Ot.length;)U[Ot[Y].identifier]&&_e.push(Ot[Y]),O&(q|xt)&&delete U[Ot[Y].identifier],Y++;return _e.length?[$(yt.concat(_e),"identifier",!0),_e]:void 0}w(Jc,$t,{handler:function(k){var O=oA[k.type],F=sA.call(this,k,O);F&&this.callback(this.manager,O,{pointers:F[0],changedPointers:F[1],pointerType:tt,srcEvent:k})}});var cA=2500;function Mh(){$t.apply(this,arguments);var k=_(this.handler,this);this.touch=new Jc(this.manager,k),this.mouse=new Yc(this.manager,k),this.primaryTouch=null,this.lastTouches=[]}function lA(k,O){k&H?(this.primaryTouch=O.changedPointers[0].identifier,s0.call(this,O)):k&(q|xt)&&s0.call(this,O)}function s0(k){var O=k.changedPointers[0];if(O.identifier===this.primaryTouch){var F={x:O.clientX,y:O.clientY};this.lastTouches.push(F);var U=this.lastTouches;setTimeout(function(){var Y=U.indexOf(F);Y>-1&&U.splice(Y,1)},cA)}}function uA(k){for(var O=k.srcEvent.clientX,F=k.srcEvent.clientY,U=0;U<this.lastTouches.length;U++){var Y=this.lastTouches[U],yt=Math.abs(O-Y.x),Ot=Math.abs(F-Y.y);if(yt<=25&&Ot<=25)return!0}return!1}w(Mh,$t,{handler:function(k,O,F){var U=F.pointerType==tt,Y=F.pointerType==rt;if(!(Y&&F.sourceCapabilities&&F.sourceCapabilities.firesTouchEvents)){if(U)lA.call(this,O,F);else if(Y&&uA.call(this,F))return;this.callback(k,O,F)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var c0=P(c.style,"touchAction"),l0=c0!==r,u0="compute",p0="auto",Rh="manipulation",hr="none",Aa="pan-x",ka="pan-y",Zc=function(){if(!l0)return!1;var k={},O=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(F){k[F]=!O||e.CSS.supports("touch-action",F)}),k}();function Nh(k,O){this.manager=k,this.set(O)}Nh.prototype={set:function(k){k==u0&&(k=this.compute()),l0&&this.manager.element.style&&Zc[k]&&(this.manager.element.style[c0]=k),this.actions=k.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var k=[];return v(this.manager.recognizers,function(O){C(O.options.enable,[O])&&(k=k.concat(O.getTouchAction()))}),function(O){if(E(O,hr))return hr;var F=E(O,Aa),U=E(O,ka);return F&&U?hr:F||U?F?Aa:ka:E(O,Rh)?Rh:p0}(k.join(" "))},preventDefaults:function(k){var O=k.srcEvent,F=k.offsetDirection;if(this.manager.session.prevented)O.preventDefault();else{var U=this.actions,Y=E(U,hr)&&!Zc[hr],yt=E(U,ka)&&!Zc[ka],Ot=E(U,Aa)&&!Zc[Aa];if(Y){var _e=k.pointers.length===1,At=k.distance<2,Ae=k.deltaTime<250;if(_e&&At&&Ae)return}if(!Ot||!yt)return Y||yt&&F&zt||Ot&&F&Kt?this.preventSrc(O):void 0}},preventSrc:function(k){this.manager.session.prevented=!0,k.preventDefault()}};var Qc=1,ei=32;function ni(k){this.options=o({},this.defaults,k||{}),this.id=x++,this.manager=null,this.options.enable=B(this.options.enable,!0),this.state=Qc,this.simultaneous={},this.requireFail=[]}function h0(k){return 16&k?"cancel":8&k?"end":4&k?"move":2&k?"start":""}function d0(k){return k==_t?"down":k==qt?"up":k==ce?"left":k==It?"right":""}function tl(k,O){var F=O.manager;return F?F.get(k):k}function xn(){ni.apply(this,arguments)}function el(){xn.apply(this,arguments),this.pX=null,this.pY=null}function Ih(){xn.apply(this,arguments)}function Dh(){ni.apply(this,arguments),this._timer=null,this._input=null}function Bh(){xn.apply(this,arguments)}function Oh(){xn.apply(this,arguments)}function nl(){ni.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ii(k,O){return(O=O||{}).recognizers=B(O.recognizers,ii.defaults.preset),new Lh(k,O)}ni.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=tl(k,this)).id]||(O[k.id]=k,k.recognizeWith(this)),this},dropRecognizeWith:function(k){return f(k,"dropRecognizeWith",this)||(k=tl(k,this),delete this.simultaneous[k.id]),this},requireFailure:function(k){if(f(k,"requireFailure",this))return this;var O=this.requireFail;return M(O,k=tl(k,this))===-1&&(O.push(k),k.requireFailure(this)),this},dropRequireFailure:function(k){if(f(k,"dropRequireFailure",this))return this;k=tl(k,this);var O=M(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,F=this.state;function U(Y){O.manager.emit(Y,k)}F<8&&U(O.options.event+h0(F)),U(O.options.event),k.additionalEvent&&U(k.additionalEvent),F>=8&&U(O.options.event+h0(F))},tryEmit:function(k){if(this.canEmit())return this.emit(k);this.state=ei},canEmit:function(){for(var k=0;k<this.requireFail.length;){if(!(this.requireFail[k].state&(ei|Qc)))return!1;k++}return!0},recognize:function(k){var O=o({},k);if(!C(this.options.enable,[this,O]))return this.reset(),void(this.state=ei);56&this.state&&(this.state=Qc),this.state=this.process(O),30&this.state&&this.tryEmit(O)},process:function(k){},getTouchAction:function(){},reset:function(){}},w(xn,ni,{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,F=k.eventType,U=6&O,Y=this.attrTest(k);return U&&(F&xt||!Y)?16|O:U||Y?F&q?8|O:2&O?4|O:2:ei}}),w(el,xn,{defaults:{event:"pan",threshold:10,pointers:1,direction:Rt},getTouchAction:function(){var k=this.options.direction,O=[];return k&zt&&O.push(ka),k&Kt&&O.push(Aa),O},directionTest:function(k){var O=this.options,F=!0,U=k.distance,Y=k.direction,yt=k.deltaX,Ot=k.deltaY;return Y&O.direction||(O.direction&zt?(Y=yt===0?Xt:yt<0?ce:It,F=yt!=this.pX,U=Math.abs(k.deltaX)):(Y=Ot===0?Xt:Ot<0?qt:_t,F=Ot!=this.pY,U=Math.abs(k.deltaY))),k.direction=Y,F&&U>O.threshold&&Y&O.direction},attrTest:function(k){return xn.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=d0(k.direction);O&&(k.additionalEvent=this.options.event+O),this._super.emit.call(this,k)}}),w(Ih,xn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[hr]},attrTest:function(k){return this._super.attrTest.call(this,k)&&(Math.abs(k.scale-1)>this.options.threshold||2&this.state)},emit:function(k){if(k.scale!==1){var O=k.scale<1?"in":"out";k.additionalEvent=this.options.event+O}this._super.emit.call(this,k)}}),w(Dh,ni,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[p0]},process:function(k){var O=this.options,F=k.pointers.length===O.pointers,U=k.distance<O.threshold,Y=k.deltaTime>O.time;if(this._input=k,!U||!F||k.eventType&(q|xt)&&!Y)this.reset();else if(k.eventType&H)this.reset(),this._timer=y(function(){this.state=8,this.tryEmit()},O.time,this);else if(k.eventType&q)return 8;return ei},reset:function(){clearTimeout(this._timer)},emit:function(k){this.state===8&&(k&&k.eventType&q?this.manager.emit(this.options.event+"up",k):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),w(Bh,xn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[hr]},attrTest:function(k){return this._super.attrTest.call(this,k)&&(Math.abs(k.rotation)>this.options.threshold||2&this.state)}}),w(Oh,xn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:zt|Kt,pointers:1},getTouchAction:function(){return el.prototype.getTouchAction.call(this)},attrTest:function(k){var O,F=this.options.direction;return F&(zt|Kt)?O=k.overallVelocity:F&zt?O=k.overallVelocityX:F&Kt&&(O=k.overallVelocityY),this._super.attrTest.call(this,k)&&F&k.offsetDirection&&k.distance>this.options.threshold&&k.maxPointers==this.options.pointers&&p(O)>this.options.velocity&&k.eventType&q},emit:function(k){var O=d0(k.offsetDirection);O&&this.manager.emit(this.options.event+O,k),this.manager.emit(this.options.event,k)}}),w(nl,ni,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Rh]},process:function(k){var O=this.options,F=k.pointers.length===O.pointers,U=k.distance<O.threshold,Y=k.deltaTime<O.time;if(this.reset(),k.eventType&H&&this.count===0)return this.failTimeout();if(U&&Y&&F){if(k.eventType!=q)return this.failTimeout();var yt=!this.pTime||k.timeStamp-this.pTime<O.interval,Ot=!this.pCenter||Ee(this.pCenter,k.center)<O.posThreshold;if(this.pTime=k.timeStamp,this.pCenter=k.center,Ot&&yt?this.count+=1:this.count=1,this._input=k,this.count%O.taps===0)return this.hasRequireFailures()?(this._timer=y(function(){this.state=8,this.tryEmit()},O.interval,this),2):8}return ei},failTimeout:function(){return this._timer=y(function(){this.state=ei},this.options.interval,this),ei},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==8&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ii.VERSION="2.0.7",ii.defaults={domEvents:!1,touchAction:u0,enable:!0,inputTarget:null,inputClass:null,preset:[[Bh,{enable:!1}],[Ih,{enable:!1},["rotate"]],[Oh,{direction:zt}],[el,{direction:zt},["swipe"]],[nl],[nl,{event:"doubletap",taps:2},["tap"]],[Dh]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Lh(k,O){var F;this.options=o({},ii.defaults,O||{}),this.options.inputTarget=this.options.inputTarget||k,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=k,this.input=new((F=this).options.inputClass||(G?Ph:X?Jc:j?Mh:Yc))(F,ht),this.touchAction=new Nh(this,this.options.touchAction),m0(this,!0),v(this.options.recognizers,function(U){var Y=this.add(new U[0](U[1]));U[2]&&Y.recognizeWith(U[2]),U[3]&&Y.requireFailure(U[3])},this)}function m0(k,O){var F,U=k.element;U.style&&(v(k.options.cssProps,function(Y,yt){F=P(U.style,yt),O?(k.oldCssProps[F]=U.style[F],U.style[F]=Y):U.style[F]=k.oldCssProps[F]||""}),O||(k.oldCssProps={}))}Lh.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 F;this.touchAction.preventDefaults(k);var U=this.recognizers,Y=O.curRecognizer;(!Y||Y&&8&Y.state)&&(Y=O.curRecognizer=null);for(var yt=0;yt<U.length;)F=U[yt],O.stopped===2||Y&&F!=Y&&!F.canRecognizeWith(Y)?F.reset():F.recognize(k),!Y&&14&F.state&&(Y=O.curRecognizer=F),yt++}},get:function(k){if(k instanceof ni)return k;for(var O=this.recognizers,F=0;F<O.length;F++)if(O[F].options.event==k)return O[F];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,F=M(O,k);F!==-1&&(O.splice(F,1),this.touchAction.update())}return this},on:function(k,O){if(k!==r&&O!==r){var F=this.handlers;return v(T(k),function(U){F[U]=F[U]||[],F[U].push(O)}),this}},off:function(k,O){if(k!==r){var F=this.handlers;return v(T(k),function(U){O?F[U]&&F[U].splice(M(F[U],O),1):delete F[U]}),this}},emit:function(k,O){this.options.domEvents&&function(Y,yt){var Ot=n.createEvent("Event");Ot.initEvent(Y,!0,!0),Ot.gesture=yt,yt.target.dispatchEvent(Ot)}(k,O);var F=this.handlers[k]&&this.handlers[k].slice();if(F&&F.length){O.type=k,O.preventDefault=function(){O.srcEvent.preventDefault()};for(var U=0;U<F.length;)F[U](O),U++}},destroy:function(){this.element&&m0(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(ii,{INPUT_START:H,INPUT_MOVE:2,INPUT_END:q,INPUT_CANCEL:xt,STATE_POSSIBLE:Qc,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:ei,DIRECTION_NONE:Xt,DIRECTION_LEFT:ce,DIRECTION_RIGHT:It,DIRECTION_UP:qt,DIRECTION_DOWN:_t,DIRECTION_HORIZONTAL:zt,DIRECTION_VERTICAL:Kt,DIRECTION_ALL:Rt,Manager:Lh,Input:$t,TouchAction:Nh,TouchInput:Jc,MouseInput:Yc,PointerEventInput:Ph,TouchMouseInput:Mh,SingleTouchInput:a0,Recognizer:ni,AttrRecognizer:xn,Tap:nl,Pan:el,Swipe:Oh,Pinch:Ih,Rotate:Bh,Press:Dh,on:s,off:h,each:v,merge:S,extend:b,assign:o,inherit:w,bindFn:_,prefixed:P}),(e!==void 0?e:typeof self<"u"?self:{}).Hammer=ii,typeof r=="function"&&r.amd?r(function(){return ii}):t.exports?t.exports=ii:e.Hammer=ii})(window,document)})(Fm);const Hi=ro(Fm.exports);var zm=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function ds(t,e){return e.get(t,!1)}function au(t){t.preventDefault(),typeof t.stopPropagation=="function"?t.stopPropagation():t.srcEvent&&typeof t.srcEvent.stopPropagation=="function"&&t.srcEvent.stopPropagation(),typeof t.stopImmediatePropagation=="function"&&t.stopImmediatePropagation()}function su(t){function e(l){setTimeout(function(){L(zm,function(u){ct.unbind(t,u,au,!0)})},500)}ct.bind(t,"touchstart",function(l){L(zm,function(u){ct.bind(t,u,au,!0)})},!0),ct.bind(t,"touchend",e,!0),ct.bind(t,"touchcancel",e,!0);var n=new Hi.Manager(t,{inputClass:Hi.TouchInput,recognizers:[],domEvents:!0}),i=new Hi.Tap,r=new Hi.Pan({threshold:10}),o=new Hi.Press,a=new Hi.Pinch,c=new Hi.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 d,y;for(d=0;y=u[d];d++)y.reset(),y.state=8;p.curRecognizer=null},0))},n.on("hammer.input",function(l){l.srcEvent.defaultPrevented&&n.reset(!0)}),n}function $m(t,e,n,i,r){var o,a=ds("dragging",t),c=ds("move",t),l=ds("contextPad",t),u=ds("palette",t);function p(f,v){return function(g){var b=d(g.target),S=b&&i.get(b);return v&&(g.srcEvent.button=v),r.fire(f,g,S)}}function d(f){return Vi(f,"svg, .djs-element",!0)}function y(f){function v(g){var b=d(g.target),S=b&&i.get(b);if(c&&e.getRootElement()!==S)return c.start(g,S,!0);(function(w){var _=0,C=0;function B(h){var m=h.deltaX-_,E=h.deltaY-C;e.scroll({dx:m,dy:E}),_=h.deltaX,C=h.deltaY}function s(h){o.off("panmove",B),o.off("panend",s),o.off("pancancel",s)}o.on("panmove",B),o.on("panend",s),o.on("pancancel",s)})()}(o=su(f)).on("tap",p("element.click")),o.on("doubletap",p("element.dblclick",1)),o.on("panstart",v),o.on("press",v),o.on("pinchstart",function(g){var b=e.zoom(),S=g.center;function w(C){var B=1-(1-C.scale)/1.5,s=Math.max(.2,Math.min(4,B*b));e.zoom(s,S),au(C)}function _(C){o.off("pinchmove",w),o.off("pinchend",_),o.off("pinchcancel",_),o.reset(!0)}o.on("pinchmove",w),o.on("pinchend",_),o.on("pinchcancel",_)})}a&&n.on("drag.move",function(f){var v=f.originalEvent;if(v&&!(v instanceof MouseEvent)){var g=vi(v),b=d(document.elementFromPoint(g.x,g.y)),S=b&&i.get(b);S!==f.hover&&(f.hover&&a.out(f),S&&(a.hover({element:S,gfx:b}),f.hover=S,f.hoverGfx=b))}}),l&&n.on("contextPad.create",function(f){var v=su(f.pad.html);v.on("panstart",function(g){l.trigger("dragstart",g,!0)}),v.on("press",function(g){l.trigger("dragstart",g,!0)}),v.on("tap",function(g){l.trigger("click",g)})}),u&&n.on("palette.create",function(f){var v=su(f.container);v.on("panstart",function(g){u.trigger("dragstart",g,!0)}),v.on("press",function(g){u.trigger("dragstart",g,!0)}),v.on("tap",function(g){u.trigger("click",g)})}),n.on("canvas.init",function(f){y(f.svg)})}function cu(t,e){var n=this;e.on("canvas.init",function(i){n.addBBoxMarker(i.svg)})}$m.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],cu.$inject=["canvas","eventBus"],cu.prototype.addBBoxMarker=function(t){var e={fill:"none",class:"outer-bound-marker"},n=ot("rect");K(n,{x:-1e4,y:1e4,width:10,height:10}),K(n,e),lt(t,n);var i=ot("rect");K(i,{x:1e4,y:1e4,width:10,height:10}),K(i,e),lt(t,i)};const sE={__depends__:[{__depends__:[No],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",$m],touchFix:["type",cu]}]};function lu(t){return t&&t[t.length-1]}function Gm(t){return t.y}function Um(t){return t.x}var cE={left:Um,center:Um,right:function(t){return t.x+t.width},top:Gm,middle:Gm,bottom:function(t){return t.y+t.height}};function Or(t){this._modeling=t}Or.$inject=["modeling"],Or.prototype._getOrientationDetails=function(t){var e="x",n="width";return["top","bottom","middle"].indexOf(t)!==-1&&(e="y",n="height"),{axis:e,dimension:n}},Or.prototype._isType=function(t,e){return e.indexOf(t)!==-1},Or.prototype._alignmentPosition=function(t,e){var n,i,r,o=this._getOrientationDetails(t),a=o.axis,c=o.dimension,l={},u={},p=!1;if(this._isType(t,["left","top"]))l[t]=e[0][a];else if(this._isType(t,["right","bottom"]))r=lu(e),l[t]=r[a]+r[c];else if(this._isType(t,["center","middle"])){if(L(e,function(d){var y=d[a]+Math.round(d[c]/2);u[y]?u[y].elements.push(d):u[y]={elements:[d],center:y}}),n=We(u,function(d){return d.elements.length>1&&(p=!0),d.elements.length}),p)return l[t]=lu(n).center,l;i=e[0],r=lu(e=We(e,function(d){return d[a]+d[c]})),l[t]=function(d,y){return Math.round((d[a]+y[a]+y[c])/2)}(i,r)}return l},Or.prototype.trigger=function(t,e){var n=this._modeling,i=dt(t,function(a){return!(a.waypoints||a.host||a.labelTarget)});if(!(i.length<2)){var r=We(i,cE[e]),o=this._alignmentPosition(e,r);n.alignElements(r,o)}};const lE={__init__:["alignElements"],alignElements:["type",Or]};var uE=10,Hm=50,pE=250;function uu(t,e,n,i){for(var r;r=hE(t,n,e);)n=i(e,n,r);return n}function pu(t){return function(e,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=t[o];if(a){var c=o==="x"?"width":"height",l=a.margin,u=a.minDistance;r[o]=l<0?Math.min(i[o]+l-e[c]/2,n[o]-u+l):Math.max(i[o]+i[c]+l+e[c]/2,n[o]+u+l)}}),r}}function hE(t,e,n){var i={x:e.x-n.width/2,y:e.y-n.height/2,width:n.width,height:n.height},r=function(o){var a=hu(o);return o.host&&(a=a.concat(hu(o.host))),o.attachers&&(a=a.concat(o.attachers.reduce(function(c,l){return c.concat(hu(l))},[]))),a}(t);return Pt(r,function(o){return o!==n&&ye(o,i,uE)==="intersect"})}function hu(t){return(e=t,e.outgoing.map(function(n){return n.target})).concat(function(n){return n.incoming.map(function(i){return i.source})}(t));var e}function dE(){return!0}function qm(t,e,n){t.on("autoPlace",100,function(i){var r=i.shape;return function(o,a,c){c||(c={});var l=c.defaultDistance||Hm,u=ft(o),p=at(o);return{x:p.right+l+a.width/2,y:u.y}}(i.source,r)}),t.on("autoPlace.end",function(i){n.scrollToElement(i.shape)}),this.append=function(i,r,o){t.fire("autoPlace.start",{source:i,shape:r});var a=t.fire("autoPlace",{source:i,shape:r}),c=e.appendShape(i,r,a,i.parent,o);return t.fire("autoPlace.end",{source:i,shape:c}),c}}function Wm(t,e){t.on("autoPlace.end",500,function(n){e.select(n.shape)})}qm.$inject=["eventBus","modeling","canvas"],Wm.$inject=["eventBus","selection"];const mE={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",qm],autoPlaceSelectionBehavior:["type",Wm]};wt=function(t,e){return ai(e,function(n){return A(t,n)})};function ms(t,e){for(typeof e=="string"&&(e=[e]);t=t.parent;)if(wt(t,e))return t;return null}function Xm(t,e){return A(e,"bpmn:TextAnnotation")?function(n,i){var r=at(n),o={x:r.right+i.width/2,y:r.top-50-i.height/2};return uu(n,i,o,pu({y:{margin:-30,minDistance:20}}))}(t,e):wt(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(n,i){var r=at(n),o={x:r.right-10+i.width/2,y:r.bottom+40+i.width/2};return uu(n,i,o,pu({x:{margin:30,minDistance:30}}))}(t,e):A(e,"bpmn:FlowNode")?function(n,i){var r=at(n),o=ft(n),a=function(d,y){y||(y={});var f=y.defaultDistance||Hm,v=y.direction||"e",g=y.filter,b=y.getWeight||function(h){return h.source===d?1:-1},S=y.maxDistance||pE,w=y.reference||"start";function _(h,m){return v==="n"?w==="start"?at(h).top-at(m).bottom:w==="center"?at(h).top-ft(m).y:at(h).top-at(m).top:v==="w"?w==="start"?at(h).left-at(m).right:w==="center"?at(h).left-ft(m).x:at(h).left-at(m).left:v==="s"?w==="start"?at(m).top-at(h).bottom:w==="center"?ft(m).y-at(h).bottom:at(m).bottom-at(h).bottom:w==="start"?at(m).left-at(h).right:w==="center"?ft(m).x-at(h).right:at(m).right-at(h).right}g||(g=dE);var C=d.incoming.filter(g).map(function(h){var m=b(h),E=m<0?_(h.source,d):_(d,h.source);return{id:h.source.id,distance:E,weight:m}}),B=d.outgoing.filter(g).map(function(h){var m=b(h),E=m>0?_(d,h.target):_(h.target,d);return{id:h.target.id,distance:E,weight:m}}),s=De(C.concat(B).reduce(function(h,m){return h[m.id+"__weight_"+m.weight]=m,h},{}),function(h,m){var E=m.distance,T=m.weight;return E<0||E>S||(h[String(E)]||(h[String(E)]=0),h[String(E)]+=1*T,(!h.distance||h[h.distance]<h[String(E)])&&(h.distance=E)),h},{});return s.distance||f}(n,{filter:function(d){return A(d,"bpmn:SequenceFlow")}}),c=30,l=80,u="left";A(n,"bpmn:BoundaryEvent")&&(u=ye(n,n.host,-25)).indexOf("top")!==-1&&(c*=-1);var p={x:r.right+a+i.width/2,y:o.y+fE(u,l)};return uu(n,i,p,pu({y:{margin:c,minDistance:l}}))}(t,e):void 0}function fE(t,e){return t.indexOf("top")!=-1?-1*e:t.indexOf("bottom")!=-1?e:0}function Km(t){t.on("autoPlace",function(e){var n=e.shape;return Xm(e.source,n)})}Km.$inject=["eventBus"];const vE={__depends__:[mE],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",Km]};function Q(t){this._eventBus=t}Q.$inject=["eventBus"],Q.prototype.on=function(t,e,n,i,r,o){if((fe(e)||pt(e))&&(o=r,r=i,i=n,n=e,e=null),fe(n)&&(o=r,r=i,i=n,n=1e3),te(r)&&(o=r,r=!1),!fe(i))throw new Error("handlerFn must be a function");gt(t)||(t=[t]);var a=this._eventBus;L(t,function(c){var l=["commandStack",c,e].filter(function(u){return u}).join(".");a.on(l,n,r?function(u,p){return function(d){return u.call(p||null,d.context,d.command,d)}}(i,o):i,o)})};function qn(t,e,n,i){Q.call(this,t),this._elementRegistry=e,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=mo(Ba(a.closure.topLevel)),l=a.hints,u=!l||l.autoResize;u!==!1&&L(ji(c,function(p){return p.parent.id}),function(p,d){gt(u)&&(p=p.filter(function(y){return Pt(u,Xe({id:y.id}))})),r._expand(p,d)})}),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 fs(t){t.invoke(qn,this)}function gi(t){Q.call(this,t),this.init()}function Oo(t){gi.call(this,t);var e=this;this.addRule("element.autoResize",function(n){return e.canResize(n.elements,n.target)})}function vs(t,e){Oo.call(this,t),this._modeling=e}L(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],function(t){Q.prototype[t]=function(e,n,i,r,o){(fe(e)||pt(e))&&(o=r,r=i,i=n,n=e,e=null),this.on(e,t,n,i,r,o)}}),qn.$inject=["eventBus","elementRegistry","modeling","rules"],it(qn,Q),qn.prototype._getOptimalBounds=function(t,e){var n=this.getOffset(e),i=this.getPadding(e),r=at(ve(t)),o=at(e),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),jl(z({},o,a))},qn.prototype._expand=function(t,e){if(typeof e=="string"&&(e=this._elementRegistry.get(e)),this._rules.allowed("element.autoResize",{elements:t,target:e})){var n=this._getOptimalBounds(t,e);if(function(o,a){return o.x!==a.x||o.y!==a.y||o.width!==a.width||o.height!==a.height}(n,e)){var i=function(o,a){var c="";return o=at(o),a=at(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}(Ke(e,["x","y","width","height"]),n);this.resize(e,n,{autoResize:i});var r=e.parent;r&&this._expand([e],r)}}},qn.prototype.getOffset=function(t){return{top:60,bottom:60,left:100,right:100}},qn.prototype.getPadding=function(t){return{top:2,bottom:2,left:15,right:15}},qn.prototype.resize=function(t,e,n){this._modeling.resizeShape(t,e,null,n)},fs.$inject=["injector"],it(fs,qn),fs.prototype.resize=function(t,e,n){A(t,"bpmn:Participant")?this._modeling.resizeLane(t,e,null,n):this._modeling.resizeShape(t,e,null,n)},gi.$inject=["eventBus"],it(gi,Q),gi.prototype.addRule=function(t,e,n){var i=this;typeof t=="string"&&(t=[t]),t.forEach(function(r){i.canExecute(r,e,function(o,a,c){return n(o)},!0)})},gi.prototype.init=function(){},Oo.$inject=["eventBus"],it(Oo,gi),Oo.prototype.canResize=function(t,e){return!1},it(vs,Oo),vs.$inject=["eventBus","modeling"],vs.prototype.canResize=function(t,e){if(!A(e,"bpmn:Participant")&&!A(e,"bpmn:Lane")&&!A(e,"bpmn:SubProcess"))return!1;var n=!0;return L(t,function(i){(A(i,"bpmn:Lane")||i.labelTarget)&&(n=!1)}),n};const yE={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",fs],bpmnAutoResizeProvider:["type",vs]};function Ym(t,e,n){var i,r,o=this,a=n.get("dragging",!1);a&&e.on("drag.start",function(c){e.once("drag.move",1500,function(l){(function(u){if(!u.hover){var p=u.originalEvent,d=o._findTargetGfx(p),y=d&&t.get(d);d&&y&&(u.stopPropagation(),a.hover({element:y,gfx:d}),a.move(p))}})(l)})}),e.on("element.hover",function(c){i=c.gfx,r=c.element}),e.on("element.hover",1500,function(c){r&&e.fire("element.out",{element:r,gfx:i})}),e.on("element.out",function(){i=null,r=null}),this._findTargetGfx=function(c){var l;if(c instanceof MouseEvent)return l=vi(c),function(u){return Vi(u,"svg, .djs-element",!0)}(document.elementFromPoint(l.x,l.y))}}Ym.$inject=["elementRegistry","eventBus","injector"];const gE={__init__:["hoverFix"],hoverFix:["type",Ym]};var Lr=Math.round,Jm="djs-drag-active";function qi(t){t.preventDefault()}function Zm(t,e,n,i){var r,o={threshold:5,trapClick:!0};function a(S){var w=e.viewbox(),_=e._container.getBoundingClientRect();return{x:w.x+(S.x-_.left)/w.scale,y:w.y+(S.y-_.top)/w.scale}}function c(S,w){w=w||r;var _=t.createEvent(z({},w.payload,w.data,{isTouch:w.isTouch}));return t.fire("drag."+S,_)!==!1&&t.fire(w.prefix+"."+S,_)}function l(S,w){var _,C=r.payload,B=r.displacement,s=r.globalStart,h=vi(S),m=Rn(h,s),E=r.localStart,T=a(h),M=Rn(T,E);if(!r.active&&(w||(_=m,Math.sqrt(Math.pow(_.x,2)+Math.pow(_.y,2))>r.threshold))){if(z(C,{x:Lr(E.x+B.x),y:Lr(E.y+B.y),dx:0,dy:0},{originalEvent:S}),c("start")===!1)return g();r.active=!0,r.keepSelection||(C.previousSelection=n.get(),n.select(null)),r.cursor&&hs(r.cursor),e.addMarker(e.getRootElement(),Jm)}Ql(S),r.active&&(z(C,{x:Lr(T.x+B.x),y:Lr(T.y+B.y),dx:Lr(M.x),dy:Lr(M.y)},{originalEvent:S}),c("move"))}function u(S){var w=!0;r.active&&(S&&(r.payload.originalEvent=S,Ql(S)),w=c("end")),w===!1&&c("rejected"),c("ended",b(w!==!0))}function p(S){S.which===27&&(qi(S),g())}function d(S){var w;r.active&&(w=Bm(t),setTimeout(w,400),qi(S)),u(S)}function y(S){l(S)}function f(S){var w=r.payload;w.hoverGfx=S.gfx,w.hover=S.element,c("hover")}function v(S){c("out");var w=r.payload;w.hoverGfx=null,w.hover=null}function g(S){var w;if(r){var _=r.active;_&&c("cancel"),w=b(S),_&&c("canceled",w)}}function b(S){var w,_;c("cleanup"),Dm(),_=r.trapClick?d:u,ct.unbind(document,"mousemove",l),ct.unbind(document,"dragstart",qi),ct.unbind(document,"selectstart",qi),ct.unbind(document,"mousedown",_,!0),ct.unbind(document,"mouseup",_,!0),ct.unbind(document,"keyup",p),ct.unbind(document,"touchstart",y,!0),ct.unbind(document,"touchcancel",g,!0),ct.unbind(document,"touchmove",l,!0),ct.unbind(document,"touchend",u,!0),t.off("element.hover",f),t.off("element.out",v),e.removeMarker(e.getRootElement(),Jm);var C=r.payload.previousSelection;return S!==!1&&C&&!n.get().length&&function(B){var s=B.filter(function(h){return i.get(h.id)});s.length&&n.select(s)}(C),w=r,r=null,w}t.on("diagram.destroy",g),this.init=function(S,w,_,C){r&&g(!1),typeof w=="string"&&(C=_,_=w,w=null);var B,s,h,m,E,T=(C=z({},o,C||{})).data||{};m=C.trapClick?d:u,S?(B=Nr(S)||S,s=vi(S),Ql(S),B.type==="dragstart"&&qi(B)):(B=null,s={x:0,y:0}),h=a(s),w||(w=h),E=function(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}(B),r=z({prefix:_,data:T,payload:{},globalStart:s,displacement:Rn(w,h),localStart:h,isTouch:E},C),C.manual||(E?(ct.bind(document,"touchstart",y,!0),ct.bind(document,"touchcancel",g,!0),ct.bind(document,"touchmove",l,!0),ct.bind(document,"touchend",u,!0)):(ct.bind(document,"mousemove",l),ct.bind(document,"dragstart",qi),ct.bind(document,"selectstart",qi),ct.bind(document,"mousedown",m,!0),ct.bind(document,"mouseup",m,!0)),ct.bind(document,"keyup",p),t.on("element.hover",f),t.on("element.out",v)),c("init"),C.autoActivate&&l(S,!0)},this.move=l,this.hover=f,this.out=v,this.end=u,this.cancel=g,this.context=function(){return r},this.setOptions=function(S){z(o,S)}}Zm.$inject=["eventBus","canvas","selection","elementRegistry"];const Wn={__depends__:[gE,Mn],dragging:["type",Zm]};function jr(t,e,n){this._canvas=n,this._opts=z({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},t);var i=this;e.on("drag.move",function(r){var o=i._toBorderPoint(r);i.startScroll(o)}),e.on(["drag.cleanup"],function(){i.stopScroll()})}function bE(t,e,n){return e<t&&t<n}jr.$inject=["config.autoScroll","eventBus","canvas"],jr.prototype.startScroll=function(t){var e=this._canvas,n=this._opts,i=this,r=e.getContainer().getBoundingClientRect(),o=[t.x,t.y,r.width-t.x,r.height-t.y];this.stopScroll();for(var a=0,c=0,l=0;l<4;l++)bE(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||(e.scroll({dx:a,dy:c}),this._scrolling=setTimeout(function(){i.startScroll(t)},n.scrollRepeatTimeout))},jr.prototype.stopScroll=function(){clearTimeout(this._scrolling)},jr.prototype.setOptions=function(t){this._opts=z({},this._opts,t)},jr.prototype._toBorderPoint=function(t){var e=this._canvas._container.getBoundingClientRect(),n=vi(t.originalEvent);return{x:n.x-e.left,y:n.y-e.top}};const xE={__depends__:[Wn],__init__:["autoScroll"],autoScroll:["type",jr]};function du(t){this._commandStack=t.get("commandStack",!1)}du.$inject=["injector"],du.prototype.allowed=function(t,e){var n=!0,i=this._commandStack;return i&&(n=i.canExecute(t,e)),n===void 0||n};const In={__init__:["rules"],rules:["type",du]};var ys=Math.round,EE=Math.max,Qm=10;function mu(t,e){return function(n,i){var r,o;for(r=0;o=n[r];r++)if(Eo(o,i)<=Qm)return{point:n[r],bendpoint:!0,index:r};return null}(t,e)||function(n,i){var r,o,a=Rd(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,Qm),(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=EE(c.segment2,l.segment2)-1],bendpoint:!0,index:o}:{point:{x:ys(c.x+l.x)/2,y:ys(c.y+l.y)/2},index:c.segment2}:{point:{x:ys(c.x),y:ys(c.y)},index:c.segment2}:null}(t,e)}var tf="djs-bendpoint",ef="djs-segment-dragger";function fu(t,e,n){var i=function(r,o){var a,c=vi(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}}(t,n);return mu(e,i)}function vu(t,e){var n=ot("g");bt(n).add(tf),lt(t,n);var i=ot("circle");K(i,{cx:0,cy:0,r:4}),bt(i).add("djs-visual"),lt(n,i);var r=ot("circle");return K(r,{cx:0,cy:0,r:10}),bt(r).add("djs-hit"),lt(n,r),e&&bt(n).add(e),n}function _E(t,e,n,i){var r=ot("g");lt(t,r);var o=function(l,u,p){var d=u.x-l.x,y=u.y-l.y;return rf(p==="h"?d:y)}(e,n,i),a=ot("rect");K(a,{x:-7,y:-1.5,width:14,height:3}),bt(a).add("djs-visual"),lt(r,a);var c=ot("rect");return K(c,{x:-o/2,y:-7,width:o,height:14}),bt(c).add("djs-hit"),lt(r,c),Hd(r,i==="v"?90:0),r}function nf(t,e,n){var i=ot("g"),r=Bl(e,n),o=zn(e,n);return lt(t,i),_E(i,e,n,o),bt(i).add(ef),bt(i).add(o==="h"?"horizontal":"vertical"),Oe(i,r.x,r.y),i}function rf(t){return Math.abs(Math.round(2*t/3))}var of={exports:{}};of.exports=function(t){if(t.CSS&&t.CSS.escape)return t.CSS.escape;var e=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 t.CSS||(t.CSS={}),t.CSS.escape=e,e}(_0);const yu=ro(of.exports);var wE={"&":"&","<":"<",">":">",'"':""","'":"'"};function af(t){return(t=""+t)&&t.replace(/[&<>"']/g,function(e){return wE[e]})}function sf(t,e,n,i,r){function o(v,g){var b,S=g.waypoints,w=fu(e,S,v);if(w)return b=function(_,C){var B,s,h=_.waypoints;return C.index<=0||C.bendpoint?null:(s=zn((B={start:h[C.index-1],end:h[C.index]}).start,B.end))?rf(s==="h"?B.end.x-B.start.x:B.end.y-B.start.y)/2:null}(g,w),function(_,C,B){var s,h,m,E,T,M,I=_.index,$=_.point;return!(I<=0||_.bendpoint)&&(m=Bl(s=C[I-1],h=C[I]),E=zn(s,h),T=Math.abs($.x-m.x),M=Math.abs($.y-m.y),E&&T<=B&&M<=B)}(w,S,b)?r.start(v,g,w.index):i.start(v,g,w.index,!w.bendpoint),!0}function a(v,g,b){ct.bind(v,g,function(S){n.triggerMouseEvent(g,S,b),S.stopPropagation()})}function c(v,g){var b=e.getLayer("overlays"),S=Wt('.djs-bendpoints[data-element-id="'+yu(v.id)+'"]',b);return!S&&g&&(K(S=ot("g"),{"data-element-id":v.id}),bt(S).add("djs-bendpoints"),lt(b,S),a(S,"mousedown",v),a(S,"click",v),a(S,"dblclick",v)),S}function l(v,g){return Wt('.djs-segment-dragger[data-segment-idx="'+v+'"]',g)}function u(v,g){g.waypoints.forEach(function(b,S){var w=vu(v);lt(v,w),Oe(w,b.x,b.y)}),vu(v,"floating")}function p(v,g){for(var b,S,w,_=g.waypoints,C=1;C<_.length;C++)zn(b=_[C-1],S=_[C])&&(K(w=nf(v,b,S),{"data-segment-idx":C}),a(w,"mousemove",g))}function d(v){var g=c(v);return g||(u(g=c(v,!0),v),p(g,v)),g}function y(v){var g=c(v);g&&(function(b){L(xl("."+ef,b),function(S){ee(S)})}(g),function(b){L(xl("."+tf,b),function(S){ee(S)})}(g),p(g,v),u(g,v))}function f(v,g,b){var S,w,_=l(g.index,v),C=b[g.index-1],B=b[g.index],s=g.point,h=Bl(C,B),m=zn(C,B);_&&(S=function(E){return Wt(".djs-visual",E)}(_),w={x:s.x-h.x,y:s.y-h.y},m==="v"&&(w={x:w.y,y:w.x}),Oe(S,w.x,w.y))}t.on("connection.changed",function(v){y(v.element)}),t.on("connection.remove",function(v){var g=c(v.element);g&&ee(g)}),t.on("element.marker.update",function(v){var g,b=v.element;b.waypoints&&(g=d(b),v.add?bt(g).add(v.marker):bt(g).remove(v.marker))}),t.on("element.mousemove",function(v){var g,b,S=v.element,w=S.waypoints;if(w){if(g=c(S,!0),!(b=fu(e,w,v.originalEvent)))return;(function(_,C){var B=Wt(".floating",_),s=C.point;B&&Oe(B,s.x,s.y)})(g,b),b.bendpoint||f(g,b,w)}}),t.on("element.mousedown",function(v){if(yi(v)){var g=v.originalEvent,b=v.element;if(b.waypoints)return o(g,b)}}),t.on("selection.changed",function(v){var g=v.newSelection[0];g&&g.waypoints&&d(g)}),t.on("element.hover",function(v){var g=v.element;g.waypoints&&(d(g),n.registerEvent(v.gfx,"mousemove","element.mousemove"))}),t.on("element.out",function(v){n.unregisterEvent(v.gfx,"mousemove","element.mousemove")}),t.on("element.updateId",function(v){var g=v.element,b=v.newId;if(g.waypoints){var S=c(g);S&&K(S,{"data-element-id":b})}}),this.addHandles=d,this.updateHandles=y,this.getBendpointsContainer=c,this.getSegmentDragger=l}sf.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var cf=Math.round,Wi="reconnectStart",Xi="reconnectEnd",Lo="updateWaypoints";function gu(t,e,n,i,r,o){this._injector=t,this.start=function(a,c,l,u){var p,d=n.getGraphics(c),y=c.source,f=c.target,v=c.waypoints,g=(p=u||l!==0?u||l!==v.length-1?Lo:Xi:Wi)===Lo?"connection.updateWaypoints":"connection.reconnect",b=r.allowed(g,{connection:c,source:y,target:f});b===!1&&(b=r.allowed(g,{connection:c,source:f,target:y})),b!==!1&&i.init(a,"bendpoint.move",{data:{connection:c,connectionGfx:d,context:{allowed:b,bendpointIndex:l,connection:c,source:y,target:f,insert:u,type:p}}})},e.on("bendpoint.move.hover",function(a){var c,l=a.context,u=l.connection,p=u.source,d=u.target,y=a.hover,f=l.type;if(l.hover=y,y){var v=f===Lo?"connection.updateWaypoints":"connection.reconnect";if(c=l.allowed=r.allowed(v,{connection:u,source:f===Wi?y:p,target:f===Xi?y:d}))return l.source=f===Wi?y:p,void(l.target=f===Xi?y:d);c===!1&&(c=l.allowed=r.allowed(v,{connection:u,source:f===Xi?y:d,target:f===Wi?y:p})),c&&(l.source=f===Xi?y:d,l.target=f===Wi?y:p)}}),e.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!==Lo&&(c.allowed=!1)}),e.on("bendpoint.move.end",function(a){var c=a.context,l=c.allowed,u=c.bendpointIndex,p=c.connection,d=c.insert,y=p.waypoints.slice(),f=c.source,v=c.target,g=c.type,b=c.hints||{},S={x:cf(a.x),y:cf(a.y)};if(!l)return!1;g===Lo?(d?y.splice(u,0,S):y[u]=S,b.bendpointMove={insert:d,bendpointIndex:u},y=this.cropWaypoints(p,y),o.updateWaypoints(p,function(w){w=w.slice();for(var _,C,B,s=0;w[s];)_=w[s],C=w[s-1],Eo(_,B=w[s+1])===0||Dl(C,B,_)?w.splice(s,1):s++;return w}(y),b)):(g===Wi?(b.docking="source",gs(c)&&(b.docking="target",b.newWaypoints=y.reverse())):g===Xi&&(b.docking="target",gs(c)&&(b.docking="source",b.newWaypoints=y.reverse())),o.reconnect(p,f,v,S,b))},this)}function gs(t){var e=t.hover,n=t.source,i=t.target,r=t.type;return r===Wi?e&&i&&e===i&&n!==i:r===Xi?e&&n&&e===n&&n!==i:void 0}gu.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],gu.prototype.cropWaypoints=function(t,e){var n=this._injector.get("connectionDocking",!1);if(!n)return e;var i=t.waypoints;return t.waypoints=e,t.waypoints=n.getCroppedWaypoints(t),e=t.waypoints,t.waypoints=i,e};var lf="updateWaypoints",jo="connect-ok",bs="connect-not-ok",uf="connect-hover",pf="djs-updating",hf="djs-element-hidden";function df(t,e,n,i){this._injector=e;var r=e.get("connectionPreview",!1);n.on("bendpoint.move.start",function(o){var a=o.context,c=a.bendpointIndex,l=a.connection,u=a.insert,p=l.waypoints,d=p.slice();a.waypoints=p,u&&d.splice(c,0,{x:o.x,y:o.y}),l.waypoints=d,bt(a.draggerGfx=vu(i.getLayer("overlays"))).add("djs-dragging"),i.addMarker(l,hf),i.addMarker(l,pf)}),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,uf),u===lf)return;c?(i.removeMarker(l,bs),i.addMarker(l,jo)):c===!1&&(i.removeMarker(l,jo),i.addMarker(l,bs))}}),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,uf),i.removeMarker(c,l?jo:bs))}),n.on("bendpoint.move.move",function(o){var a=o.context,c=a.allowed,l=a.bendpointIndex,u=a.draggerGfx,p=a.hover,d=a.type,y=a.connection,f=y.source,v=y.target,g=y.waypoints.slice(),b={x:o.x,y:o.y},S=a.hints||{},w={};r&&(S.connectionStart&&(w.connectionStart=S.connectionStart),S.connectionEnd&&(w.connectionEnd=S.connectionEnd),d==="reconnectStart"?gs(a)?(w.connectionEnd=w.connectionEnd||b,w.source=v,w.target=p||f,g=g.reverse()):(w.connectionStart=w.connectionStart||b,w.source=p||f,w.target=v):d==="reconnectEnd"?gs(a)?(w.connectionStart=w.connectionStart||b,w.source=p||v,w.target=f,g=g.reverse()):(w.connectionEnd=w.connectionEnd||b,w.source=f,w.target=p||v):(w.noCropping=!0,w.noLayout=!0,g[l]=b),d===lf&&(g=t.cropWaypoints(y,g)),w.waypoints=g,r.drawPreview(a,c,w)),Oe(u,o.x,o.y)},this),n.on(["bendpoint.move.end","bendpoint.move.cancel"],1100,function(o){var a=o.context,c=a.connection,l=a.draggerGfx,u=a.hover,p=a.target,d=a.waypoints;c.waypoints=d,ee(l),i.removeMarker(c,pf),i.removeMarker(c,hf),u&&(i.removeMarker(u,jo),i.removeMarker(u,p?jo:bs)),r&&r.cleanUp(a)})}df.$inject=["bendpointMove","injector","eventBus","canvas"];var mf="connect-hover",ff="djs-updating";function vf(t,e,n){return bu(t,e,t[e]+n)}function bu(t,e,n){return{x:e==="x"?n:t.x,y:e==="y"?n:t.y}}function yf(t){return t==="x"?"y":"x"}function gf(t,e,n){var i,r;return t.original?t.original:(i=ft(e),bu(t,r=yf(n),i[r]))}function bf(t,e,n,i,r,o){var a=t.get("connectionDocking",!1);function c(p,d){if(!a)return d;var y,f=p.waypoints;return p.waypoints=d,y=a.getCroppedWaypoints(p),p.waypoints=f,y}function l(p){r.update("connection",p.connection,p.connectionGfx)}function u(p,d,y){var f=p.newWaypoints,v=function(g,b,S,w){var _=Math.max(b[w],S[w]),C=Math.min(b[w],S[w]);return bu(b,w,Math.min(Math.max(C+20,g[w]),_-20))}(y,f[p.segmentStartIndex+d],f[p.segmentEndIndex+d],yf(p.axis));Oe(p.draggerGfx,v.x,v.y)}this.start=function(p,d,y){var f,v,g,b,S=n.getGraphics(d),w=y-1,_=y,C=d.waypoints,B=C[w],s=C[_],h=fu(n,C,p);(v=zn(B,s))&&(g=v==="v"?"x":"y",w===0&&(B=gf(B,d.source,g)),_===C.length-1&&(s=gf(s,d.target,g)),f={connection:d,segmentStartIndex:w,segmentEndIndex:_,segmentStart:B,segmentEnd:s,axis:g,dragPosition:b=h?h.point:{x:(B.x+s.x)/2,y:(B.y+s.y)/2}},i.init(p,b,"connectionSegment.move",{cursor:g==="x"?"resize-ew":"resize-ns",data:{connection:d,connectionGfx:S,context:f}}))},e.on("connectionSegment.move.start",function(p){var d=p.context,y=p.connection,f=n.getLayer("overlays");d.originalWaypoints=y.waypoints.slice(),d.draggerGfx=nf(f,d.segmentStart,d.segmentEnd),bt(d.draggerGfx).add("djs-dragging"),n.addMarker(y,ff)}),e.on("connectionSegment.move.move",function(p){var d,y,f=p.context,v=f.connection,g=f.segmentStartIndex,b=f.segmentEndIndex,S=f.segmentStart,w=f.segmentEnd,_=f.axis,C=f.originalWaypoints.slice(),B=vf(S,_,p["d"+_]),s=vf(w,_,p["d"+_]),h=C.length,m=0;C[g]=B,C[b]=s,g<2&&(d=ye(v.source,B),g===1?d==="intersect"&&(C.shift(),C[0]=B,m--):d!=="intersect"&&(C.unshift(S),m++)),b>h-3&&(y=ye(v.target,s),b===h-2?y==="intersect"&&(C.pop(),C[C.length-1]=s):y!=="intersect"&&C.push(w)),f.newWaypoints=v.waypoints=c(v,C),u(f,m,p),f.newSegmentStartIndex=g+m,l(p)}),e.on("connectionSegment.move.hover",function(p){p.context.hover=p.hover,n.addMarker(p.hover,mf)}),e.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(p){var d=p.context.hover;d&&n.removeMarker(d,mf)}),e.on("connectionSegment.move.cleanup",function(p){var d=p.context,y=d.connection;d.draggerGfx&&ee(d.draggerGfx),n.removeMarker(y,ff)}),e.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(p){var d=p.context;d.connection.waypoints=d.originalWaypoints,l(p)}),e.on("connectionSegment.move.end",function(p){var d=p.context,y=d.connection,f=d.newWaypoints,v=d.newSegmentStartIndex,g=function(_,C){var B=0;return{waypoints:_.filter(function(s,h){return!Dl(_[h-1],_[h+1],s)||(B=h<=C?B-1:B,!1)}),segmentOffset:B}}(f=f.map(function(_){return{original:_.original,x:Math.round(_.x),y:Math.round(_.y)}}),v),b=c(y,g.waypoints),S=g.segmentOffset,w={segmentMove:{segmentStartIndex:d.segmentStartIndex,newSegmentStartIndex:v+S}};o.updateWaypoints(y,b,w)})}bf.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var SE=Math.abs,xf=Math.round;function Ef(t){return{x:t.x,y:t.y}}function _f(t){return{x:t.x+t.width,y:t.y+t.height}}function Ze(t,e){return!t||isNaN(t.x)||isNaN(t.y)?e:{x:xf(t.x+t.width/2),y:xf(t.y+t.height/2)}}function Vr(t,e){var n=t.snapped;return!!n&&(typeof e=="string"?n[e]:n.x&&n.y)}function se(t,e,n){if(typeof e!="string")throw new Error("axis must be in [x, y]");if(typeof n!="number"&&n!==!1)throw new Error("value must be Number or false");var i,r=t[e],o=t.snapped=t.snapped||{};return n===!1?o[e]=!1:(o[e]=!0,i=n-r,t[e]+=i,t["d"+e]+=i),r}function wf(t){return t.children||[]}var CE=Math.abs,Sf=Math.round;function Cf(t){function e(i,r){if(gt(i)){for(var o=i.length;o--;)if(CE(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:Sf(i.width/2+i.x),y:Sf(i.height/2+i.y)}}t.on("connectionSegment.move.move",1500,function(i){var r,o,a=function(d){var y=d.snapPoints,f=d.connection,v=f.waypoints,g=d.segmentStart,b=d.segmentStartIndex,S=d.segmentEnd,w=d.segmentEndIndex,_=d.axis;if(y)return y;var C=[v[b-1],g,S,v[w+1]];return b<2&&C.unshift(n(f.source)),w>v.length-3&&C.unshift(n(f.target)),d.snapPoints=y={horizontal:[],vertical:[]},L(C,function(B){B&&(B=B.original||B,_==="y"&&y.horizontal.push(B.y),_==="x"&&y.vertical.push(B.x))}),y}(i.context),c=i.x,l=i.y;if(a){var u=c-(r=e(a.vertical,c)),p=l-(o=e(a.horizontal,l));z(i,{dx:i.dx-u,dy:i.dy-p,x:r,y:o}),(u||a.vertical.indexOf(c)!==-1)&&se(i,"x",r),(p||a.horizontal.indexOf(l)!==-1)&&se(i,"y",o)}}),t.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(i){var r,o,a=i.context,c=function(v){var g=v.snapPoints,b=v.connection.waypoints,S=v.bendpointIndex;if(g)return g;var w=[b[S-1],b[S+1]];return v.snapPoints=g={horizontal:[],vertical:[]},L(w,function(_){_&&(_=_.original||_,g.horizontal.push(_.y),g.vertical.push(_.x))}),g}(a),l=a.hover,u=l&&n(l),p=i.x,d=i.y;if(c){var y=p-(r=e(u?c.vertical.concat([u.x]):c.vertical,p)),f=d-(o=e(u?c.horizontal.concat([u.y]):c.horizontal,d));z(i,{dx:i.dx-y,dy:i.dy-f,x:i.x-y,y:i.y-f}),(y||c.vertical.indexOf(p)!==-1)&&se(i,"x",r),(f||c.horizontal.indexOf(d)!==-1)&&se(i,"y",o)}})}Cf.$inject=["eventBus"];const TE={__depends__:[Wn,In],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",sf],bendpointMove:["type",gu],bendpointMovePreview:["type",df],connectionSegmentMove:["type",bf],bendpointSnapping:["type",Cf]};function Tf(t,e,n,i){function r(o,a){return i.allowed("connection.create",{source:o,target:a})}t.on("connect.hover",function(o){var a,c=o.context,l=c.start,u=o.hover;if(c.hover=u,!vo(a=c.canExecute=r(l,u))){if(a!==!1)return c.source=l,void(c.target=u);vo(a=c.canExecute=r(u,l))||a!==!1&&(c.source=u,c.target=l)}}),t.on(["connect.out","connect.cleanup"],function(o){var a=o.context;a.hover=null,a.source=null,a.target=null,a.canExecute=!1}),t.on("connect.end",function(o){var a=o.context,c=a.canExecute,l=a.connectionStart,u={x:o.x,y:o.y},p=a.source,d=a.target;if(!c)return!1;var y=null,f={connectionStart:xu(a)?u:l,connectionEnd:xu(a)?l:u};te(c)&&(y=c),n.connect(p,d,y,f)}),this.start=function(o,a,c,l){te(c)||(l=c,c=ft(a)),e.init(o,"connect",{autoActivate:l,data:{shape:a,context:{start:a,connectionStart:c}}})}}function xu(t){var e=t.hover,n=t.source,i=t.target;return e&&n&&e===n&&n!==i}Tf.$inject=["eventBus","dragging","modeling","rules"];var Af="connect-ok",kf="connect-not-ok";function Pf(t,e,n){var i=t.get("connectionPreview",!1);i&&e.on("connect.move",function(r){var o=r.context,a=o.canExecute,c=o.hover,l=o.source,u=o.start,p=o.startPosition,d=o.target,y=o.connectionStart||p,f=o.connectionEnd||{x:r.x,y:r.y},v=y,g=f;xu(o)&&(v=f,g=y),i.drawPreview(o,a,{source:l||u,target:d||c,connectionStart:v,connectionEnd:g})}),e.on("connect.hover",900,function(r){var o=r.context,a=r.hover,c=o.canExecute;c!==null&&n.addMarker(a,c?Af:kf)}),e.on(["connect.out","connect.cleanup"],1100,function(r){var o=r.hover;o&&(n.removeMarker(o,Af),n.removeMarker(o,kf))}),i&&e.on("connect.cleanup",function(r){i.cleanUp(r.context)})}Pf.$inject=["injector","eventBus","canvas"];const Eu={__depends__:[Mn,In,Wn],__init__:["connectPreview"],connect:["type",Tf],connectPreview:["type",Pf]};function Xn(t,e,n,i){this._canvas=e,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=t.get("connectionDocking",!1),this._layouter=t.get("layouter",!1)}Xn.$inject=["injector","canvas","graphicsFactory","elementFactory"],Xn.prototype.drawPreview=function(t,e,n){n=n||{};var i,r=t.connectionPreviewGfx,o=t.getConnection,a=n.source,c=n.target,l=n.waypoints,u=n.connectionStart,p=n.connectionEnd,d=n.noLayout,y=n.noCropping,f=n.noNoop,v=this;r||(r=t.connectionPreviewGfx=this.createConnectionPreviewGfx()),Sl(r),o||(o=t.getConnection=function(g){var b={};return function(S){var w=JSON.stringify(S),_=b[w];return _||(_=b[w]=g.apply(null,arguments)),_}}(function(g,b,S){return v.getConnection(g,b,S)})),e&&(i=o(e,a,c)),i?(i.waypoints=l||[],this._layouter&&!d&&(i.waypoints=this._layouter.layoutConnection(i,{source:a,target:c,connectionStart:u,connectionEnd:p,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[a?ft(a):u,c?ft(c):p]),this._connectionDocking&&(a||c)&&!y&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,a,c)),this._graphicsFactory.drawConnection(r,i)):!f&&this.drawNoopPreview(r,n)},Xn.prototype.drawNoopPreview=function(t,e){var n=e.source,i=e.target,r=e.connectionStart||ft(n),o=e.connectionEnd||ft(i),a=this.cropWaypoints(r,o,n,i);lt(t,this.createNoopConnection(a[0],a[1]))},Xn.prototype.cropWaypoints=function(t,e,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),c=r.getConnectionPath({waypoints:[t,e]});return[t=n&&Vl(o,c,!0)||t,e=i&&Vl(a,c,!1)||e]},Xn.prototype.cleanUp=function(t){t&&t.connectionPreviewGfx&&ee(t.connectionPreviewGfx)},Xn.prototype.getConnection=function(t){var e=function(n){return te(n)?n:{}}(t);return this._elementFactory.createConnection(e)},Xn.prototype.createConnectionPreviewGfx=function(){var t=ot("g");return K(t,{pointerEvents:"none"}),bt(t).add("djs-connection-preview"),lt(this._canvas.getActiveLayer(),t),t},Xn.prototype.createNoopConnection=function(t,e){var n=ot("polyline");return K(n,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),K(n,{points:[t.x,t.y,e.x,e.y]}),n};const AE={__init__:["connectionPreview"],connectionPreview:["type",Xn]};var Mf=Math.min,Rf=Math.max;function _u(t){t.preventDefault()}function Vo(t){t.stopPropagation()}function hn(t){this.container=t.container,this.parent=jt('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=Wt("[contenteditable]",this.parent),this.keyHandler=t.keyHandler||function(){},this.resizeHandler=t.resizeHandler||function(){},this.autoResize=we(this.autoResize,this),this.handlePaste=we(this.handlePaste,this)}function Qe(t,e){this._eventBus=t,this._providers=[],this._textbox=new hn({container:e.getContainer(),keyHandler:we(this._handleKey,this),resizeHandler:we(this._handleResize,this)})}hn.prototype.create=function(t,e,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{};var c=Ke(e=this.style=e||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);z(r.style,{width:t.width+"px",height:t.height+"px",maxWidth:t.maxWidth+"px",maxHeight:t.maxHeight+"px",minWidth:t.minWidth+"px",minHeight:t.minHeight+"px",left:t.x+"px",top:t.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var l=Ke(e,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return z(o.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),i.centerVertically&&z(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),o.innerText=n,ct.bind(o,"keydown",this.keyHandler),ct.bind(o,"mousedown",Vo),ct.bind(o,"paste",this.handlePaste),i.autoResize&&ct.bind(o,"input",this.autoResize),i.resizable&&this.resizable(e),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},hn.prototype.handlePaste=function(t){var e,n=this.options,i=this.style;if(t.preventDefault(),e=t.clipboardData?t.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(e),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},hn.prototype.insertText=function(t){t=t.replace(/\r\n|\r|\n/g,`
- `),document.execCommand("insertText",!1,t)||this._insertTextIE(t)},hn.prototype._insertTextIE=function(t){var e,n,i,r=this.getSelection(),o=r.startContainer,a=r.endContainer,c=r.startOffset,l=r.endOffset,u=r.commonAncestorContainer,p=(e=u.childNodes,[].slice.call(e));if(function(g){return g.nodeType===Node.TEXT_NODE}(u)){var d=o.textContent;o.textContent=d.substring(0,c)+t+d.substring(l),n=o,i=c+t.length}else if(o===this.content&&a===this.content){var y=document.createTextNode(t);this.content.insertBefore(y,p[c]),n=y,i=y.textContent.length}else{var f=p.indexOf(o),v=p.indexOf(a);p.forEach(function(g,b){b===f?g.textContent=o.textContent.substring(0,c)+t+a.textContent.substring(l):b>f&&b<=v&&Tn(g)}),n=o,i=c+t.length}n&&i!==void 0&&setTimeout(function(){self.setSelection(n,i)})},hn.prototype.autoResize=function(){var t=this.parent,e=this.content,n=parseInt(this.style.fontSize)||12;if(e.scrollHeight>t.offsetHeight||e.scrollHeight<t.offsetHeight-n){var i=t.getBoundingClientRect(),r=e.scrollHeight;t.style.height=r+"px",this.resizeHandler({width:i.width,height:i.height,dx:0,dy:r-i.height})}},hn.prototype.resizable=function(){var t=this,e=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=jt('<div class="djs-direct-editing-resize-handle"></div>');var d=function(f){_u(f),Vo(f);var v=Mf(Rf(u+f.clientX-c,i),o),g=Mf(Rf(p+f.clientY-l,r),a);e.style.width=v+"px",e.style.height=g+"px",t.resizeHandler({width:u,height:p,dx:f.clientX-c,dy:f.clientY-l})},y=function(f){_u(f),Vo(f),ct.unbind(document,"mousemove",d,!1),ct.unbind(document,"mouseup",y,!1)};ct.bind(n,"mousedown",function(f){_u(f),Vo(f),c=f.clientX,l=f.clientY;var v=e.getBoundingClientRect();u=v.width,p=v.height,ct.bind(document,"mousemove",d),ct.bind(document,"mouseup",y)})}z(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),e.appendChild(n)},hn.prototype.destroy=function(){var t=this.parent,e=this.content,n=this.resizeHandle;e.innerText="",t.removeAttribute("style"),e.removeAttribute("style"),ct.unbind(e,"keydown",this.keyHandler),ct.unbind(e,"mousedown",Vo),ct.unbind(e,"input",this.autoResize),ct.unbind(e,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Tn(n)),Tn(t)},hn.prototype.getValue=function(){return this.content.innerText.trim()},hn.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},hn.prototype.setSelection=function(t,e){var n=document.createRange();t===null?n.selectNodeContents(this.content):(n.setStart(t,e),n.setEnd(t,e));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},Qe.$inject=["eventBus","canvas"],Qe.prototype.registerProvider=function(t){this._providers.push(t)},Qe.prototype.isActive=function(t){return!(!this._active||t&&this._active.element!==t)},Qe.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},Qe.prototype._fire=function(t,e){this._eventBus.fire("directEditing."+t,e||{active:this._active})},Qe.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},Qe.prototype.complete=function(){var t=this._active;if(t){var e,n=t.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue();r===t.context.text&&i.height===n.height&&i.width===n.width||(e=this._textbox.container.getBoundingClientRect(),t.provider.update(t.element,r,t.context.text,{x:i.left-e.left,y:i.top-e.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},Qe.prototype.getValue=function(){return this._textbox.getValue()},Qe.prototype._handleKey=function(t){t.stopPropagation();var e=t.keyCode||t.charCode;return e===27?(t.preventDefault(),this.cancel()):e!==13||t.shiftKey?void 0:(t.preventDefault(),this.complete())},Qe.prototype._handleResize=function(t){this._fire("resize",t)},Qe.prototype.activate=function(t){var e;this.isActive()&&this.cancel();var n=Pt(this._providers,function(i){return(e=i.activate(t))?i:null});return e&&(this.$textbox=this._textbox.create(e.bounds,e.style,e.text,e.options),this._active={element:t,context:e,provider:n},e.options&&e.options.resizable&&(this.resizable=!0),this._fire("activate")),!!e};const Nf={__depends__:[No],__init__:["directEditing"],directEditing:["type",Qe]};var If=".entry";function tn(t,e,n){this._eventBus=e,this._overlays=n;var i=qe(t&&t.scale)?t.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 t=this._eventBus,e=this;t.on("selection.changed",function(n){var i=n.newSelection;i.length===1?e.open(i[0]):e.close()}),t.on("elements.delete",function(n){L(n.elements,function(i){e.isOpen(i)&&e.close()})}),t.on("element.changed",function(n){var i=n.element,r=e._current;r&&r.element===i&&e.open(i,!0)})},tn.prototype.registerProvider=function(t,e){e||(e=t,t=1e3),this._eventBus.on("contextPad.getProviders",t,function(n){n.providers.push(e)})},tn.prototype.getEntries=function(t){var e=this._getProviders(),n={};return L(e,function(i){var r=i.getContextPadEntries(t);fe(r)?n=r(n):L(r,function(o,a){n[a]=o})}),n},tn.prototype.trigger=function(t,e,n){var i,r,o=this._current.element,a=this._current.entries,c=e.delegateTarget||e.target;if(!c)return e.preventDefault();if(i=a[ze(c,"data-action")].action,r=e.originalEvent||e,fe(i)){if(t==="click")return i(r,o,n)}else if(i[t])return i[t](r,o,n);e.preventDefault()},tn.prototype.open=function(t,e){!e&&this.isOpen(t)||(this.close(),this._updateAndOpen(t))},tn.prototype._getProviders=function(){var t=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},tn.prototype._updateAndOpen=function(t){var e=this.getEntries(t),n=this.getPad(t),i=n.html;L(e,function(r,o){var a,c=r.group||"default",l=jt(r.html||'<div class="entry" draggable="true"></div>');ze(l,"data-action",o),(a=Wt("[data-group="+c+"]",i))||(a=jt('<div class="group" data-group="'+c+'"></div>'),i.appendChild(a)),a.appendChild(l),r.className&&function(u,p){var d=oe(u);(gt(p)?p:p.split(/\s+/g)).forEach(function(y){d.add(y)})}(l,r.className),r.title&&ze(l,"title",r.title),r.imageUrl&&l.appendChild(jt('<img src="'+r.imageUrl+'">'))}),oe(i).add("open"),this._current={element:t,pad:n,entries:e},this._eventBus.fire("contextPad.open",{current:this._current})},tn.prototype.getPad=function(t){if(this.isOpen())return this._current.pad;var e=this,n=this._overlays,i=jt('<div class="djs-context-pad"></div>'),r=z({html:i},this._overlaysConfig);$e.bind(i,If,"click",function(a){e.trigger("click",a)}),$e.bind(i,If,"dragstart",function(a){e.trigger("dragstart",a)}),ct.bind(i,"mousedown",function(a){a.stopPropagation()}),this._overlayId=n.add(t,"context-pad",r);var o=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{element:t,pad:o}),o},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(t){return!(!this._current||t&&this._current.element!==t)};const kE={__depends__:[No,eu],contextPad:["type",tn]};var PE=["marker-start","marker-mid","marker-end"],ME=["circle","ellipse","line","path","polygon","polyline","rect"];function Ki(t,e,n,i){this._elementRegistry=t,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;e.on("drag.cleanup",function(){L(r._clonedMarkers,function(o){ee(o)}),r._clonedMarkers={}})}Ki.$inject=["elementRegistry","eventBus","canvas","styles"],Ki.prototype.getGfx=function(t){return this._elementRegistry.getGraphics(t)},Ki.prototype.addDragger=function(t,e,n){var i=od(n=n||this.getGfx(t)),r=n.getBoundingClientRect();return this._cloneMarkers(Ka(i)),K(i,this._styles.cls("djs-dragger",[],{x:r.top,y:r.left})),lt(e,i),i},Ki.prototype.addFrame=function(t,e){var n=ot("rect",{class:"djs-resize-overlay",width:t.width,height:t.height,x:t.x,y:t.y});return lt(e,n),n},Ki.prototype._cloneMarkers=function(t){var e=this;if(t.childNodes)for(var n=0;n<t.childNodes.length;n++)e._cloneMarkers(t.childNodes[n]);(function(i){return ME.indexOf(i.nodeName)!==-1})(t)&&PE.forEach(function(i){if(K(t,i)){var r=function(o,a,c){var l=(u=K(o,a),u.match(/url\(['"]?#([^'"]*)['"]?\)/)[1]),u;return Wt("marker#"+l,c||document)}(t,i,e._canvas.getContainer());e._cloneMarker(t,r,i)}})},Ki.prototype._cloneMarker=function(t,e,n){var i=e.id,r=this._clonedMarkers[i];if(!r){var o=i+"-clone";(r=od(e)).id=o,bt(r).add("djs-dragger").add("djs-dragger-marker"),this._clonedMarkers[i]=r;var a=Wt("defs",this._canvas._svg);a||(a=ot("defs"),lt(this._canvas._svg,a)),lt(a,r)}K(t,n,"url(#"+this._clonedMarkers[i].id+")")};const Fo={__init__:["previewSupport"],previewSupport:["type",Ki]};var RE="drop-ok",Df="drop-not-ok",Bf="attach-ok",Of="new-parent",Lf="create";function jf(t,e,n,i,r){function o(c,l){[Bf,RE,Df,Of].forEach(function(u){u===l?t.addMarker(c,u):t.removeMarker(c,u)})}function a(){var c=e.context();c&&c.prefix===Lf&&e.cancel()}n.on(["create.move","create.hover"],function(c){var l=c.context,u=l.elements,p=c.hover,d=l.source,y=l.hints||{};if(!p)return l.canExecute=!1,void(l.target=null);Vf(c);var f={x:c.x,y:c.y},v=l.canExecute=p&&function(g,b,S,w,_){if(!b)return!1;var C=Pt(g=dt(g,function(E){var T=E.labelTarget;return!(E.parent||function(M){return!!M.labelTarget}(E)&&g.indexOf(T)!==-1)}),function(E){return!zo(E)}),B=!1,s=!1,h=!1;Ff(g)&&(B=r.allowed("shape.attach",{position:S,shape:C,target:b})),B||(h=Ff(g)?r.allowed("shape.create",{position:S,shape:C,source:w,target:b}):r.allowed("elements.create",{elements:g,position:S,target:b}));var m=_.connectionTarget;return h||B?(C&&w&&(s=r.allowed("connection.create",{source:m===w?C:w,target:m===w?w:C,hints:{targetParent:b,targetAttach:B}})),{attach:B,connect:s}):(h===null||B===null)&&null}(u,p,f,d,y);p&&v!==null&&(l.target=p,v&&v.attach?o(p,Bf):o(p,v?Of:Df))}),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,d=l.elements,y=l.target,f=l.canExecute,v=f&&f.attach,g=f&&f.connect,b=l.hints||{};if(f===!1||!y)return!1;Vf(c);var S={x:c.x,y:c.y};p=g?i.appendShape(u,p,S,y,{attach:v,connection:g===!0?{}:g,connectionTarget:b.connectionTarget}):Pt(d=i.createElements(d,S,y,z({},b,{attach:v})),function(w){return!zo(w)}),z(l,{elements:d,shape:p}),z(c,{elements:d,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){gt(l)||(l=[l]);var p=Pt(l,function(y){return!zo(y)});if(p){u=z({elements:l,hints:{},shape:p},u||{}),L(l,function(y){pt(y.x)||(y.x=0),pt(y.y)||(y.y=0)});var d=ve(l);L(l,function(y){zo(y)&&(y.waypoints=le(y.waypoints,function(f){return{x:f.x-d.x-d.width/2,y:f.y-d.y-d.height/2}})),z(y,{x:y.x-d.x-d.width/2,y:y.y-d.y-d.height/2})}),e.init(c,Lf,{cursor:"grabbing",autoActivate:!0,data:{shape:p,elements:l,context:u}})}}}function Vf(t){var e=t.context.createConstraints;e&&(e.left&&(t.x=Math.max(t.x,e.left)),e.right&&(t.x=Math.min(t.x,e.right)),e.top&&(t.y=Math.max(t.y,e.top)),e.bottom&&(t.y=Math.min(t.y,e.bottom)))}function zo(t){return!!t.waypoints}function Ff(t){return t&&t.length===1&&!zo(t[0])}jf.$inject=["canvas","dragging","eventBus","modeling","rules"];function zf(t,e,n,i,r){e.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 d=ot("g");K(d,r.cls("djs-drag-group",["no-events"]));var y=ot("g");return p.forEach(function(f){var v;f.hidden||(f.waypoints?(v=n._createContainer("connection",y),n.drawConnection(Ka(v),f)):(v=n._createContainer("shape",y),n.drawShape(Ka(v),f),Oe(v,f.x,f.y)),i.addDragger(f,d,v))}),d}(l)),a?(u.parentNode||lt(t.getActiveLayer(),u),Oe(u,o.x,o.y)):ee(u)}),e.on("create.cleanup",function(o){var a=o.context.dragGroup;a&&ee(a)})}zf.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const xs={__depends__:[Wn,Fo,In,Mn],__init__:["create","createPreview"],create:["type",jf],createPreview:["type",zf]};var $f="data-id",Gf=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function ne(t,e,n){var i=qe(t&&t.scale)?t.scale:{min:1,max:1.5};this._config={scale:i},this._eventBus=e,this._canvas=n,this._providers={},this._current={}}ne.$inject=["config.popupMenu","eventBus","canvas"],ne.prototype.registerProvider=function(t,e,n){n||(n=e,e=1e3),this._eventBus.on("popupMenu.getProviders."+t,e,function(i){i.providers.push(n)})},ne.prototype.isEmpty=function(t,e){if(!t)throw new Error("element parameter is missing");if(!e)throw new Error("providerId parameter is missing");var n=this._getProviders(e);if(!n)return!0;var i=this._getEntries(t,n),r=this._getHeaderEntries(t,n),o=vr(i)>0,a=r&&vr(r)>0;return!o&&!a},ne.prototype.open=function(t,e,n){var i=this._getProviders(e);if(!t)throw new Error("Element is missing");if(!i||!i.length)throw new Error("No registered providers for: "+e);if(!n)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");var r=this._current={className:e,element:t,position:n},o=this._getEntries(t,i),a=this._getHeaderEntries(t,i);r.entries=z({},o,a),r.container=this._createContainer(),vr(a)&&r.container.appendChild(this._createEntries(a,"djs-popup-header")),vr(o)&&r.container.appendChild(this._createEntries(o,"djs-popup-body"));var c=this._canvas.getContainer();this._attachContainer(r.container,c,n.cursor),this._bindAutoClose()},ne.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindAutoClose(),Tn(this._current.container),this._current.container=null)},ne.prototype.isOpen=function(){return!!this._current.container},ne.prototype.trigger=function(t){t.preventDefault();var e=ze(t.delegateTarget||t.target,$f),n=this._getEntry(e);if(n.action)return n.action.call(null,t,n)},ne.prototype._getProviders=function(t){var e=this._eventBus.createEvent({type:"popupMenu.getProviders."+t,providers:[]});return this._eventBus.fire(e),e.providers},ne.prototype._getEntries=function(t,e){var n={};return L(e,function(i){if(i.getPopupMenuEntries){var r=i.getPopupMenuEntries(t);fe(r)?n=r(n):L(r,function(o,a){n[a]=o})}else L(i.getEntries(t),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=Vn(o,["id"])})}),n},ne.prototype._getHeaderEntries=function(t,e){var n={};return L(e,function(i){if(i.getPopupMenuHeaderEntries){var r=i.getPopupMenuHeaderEntries(t);fe(r)?n=r(n):L(r,function(o,a){n[a]=o})}else{if(!i.getHeaderEntries)return;L(i.getHeaderEntries(t),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=Vn(o,["id"])})}}),n},ne.prototype._getEntry=function(t){var e=this._current.entries[t];if(!e)throw new Error("entry not found");return e},ne.prototype._emit=function(t){this._eventBus.fire("popupMenu."+t)},ne.prototype._createContainer=function(){var t=jt('<div class="djs-popup">'),e=this._current.position,n=this._current.className;return z(t.style,{position:"absolute",left:e.x+"px",top:e.y+"px",visibility:"hidden"}),oe(t).add(n),t},ne.prototype._attachContainer=function(t,e,n){var i=this;$e.bind(t,".entry","click",function(r){i.trigger(r)}),this._updateScale(t),e.appendChild(t),n&&this._assureIsInbounds(t,n)},ne.prototype._updateScale=function(t){var e,n,i=this._canvas.zoom(),r=this._config.scale,o=i;r!==!0&&(r===!1?(e=1,n=1):(e=r.min,n=r.max),qe(e)&&i<e&&(o=e),qe(n)&&i>n&&(o=n)),function(a,c){a.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(l){a.style[l+"transform"]=c})}(t,"scale("+o+")")},ne.prototype._assureIsInbounds=function(t,e){var n,i,r=this._canvas._container.getBoundingClientRect(),o=t.offsetLeft,a=t.offsetTop,c=t.scrollWidth,l=t.scrollHeight,u={},p=e.x-r.left,d=e.y-r.top;o+c>r.width&&(u.x=!0),a+l>r.height&&(u.y=!0),u.x&&u.y?(n=p-c+"px",i=d-l+"px"):u.x?(n=p-c+"px",i=d+"px"):u.y&&d<l?(n=p+"px",i="10px"):u.y&&(n=p+"px",i=d-l+"px"),z(t.style,{left:n,top:i},{visibility:"visible","z-index":1e3})},ne.prototype._createEntries=function(t,e){var n=jt("<div>"),i=this;return oe(n).add(e),L(t,function(r,o){var a=i._createEntry(r,o);n.appendChild(a)}),n},ne.prototype._createEntry=function(t,e){var n=jt("<div>"),i=oe(n);if(i.add("entry"),t.className&&t.className.split(" ").forEach(function(o){i.add(o)}),ze(n,$f,e),t.label){var r=jt("<span>");r.textContent=t.label,n.appendChild(r)}return t.imageUrl&&n.appendChild(jt('<img src="'+t.imageUrl+'" />')),t.active===!0&&i.add("active"),t.disabled===!0&&i.add("disabled"),t.title&&(n.title=t.title),n},ne.prototype._bindAutoClose=function(){this._eventBus.once(Gf,this.close,this)},ne.prototype._unbindAutoClose=function(){this._eventBus.off(Gf,this.close,this)};const NE={__init__:["popupMenu"],popupMenu:["type",ne]};function $o(){}$o.prototype.get=function(){return this._data},$o.prototype.set=function(t){this._data=t},$o.prototype.clear=function(){var t=this._data;return delete this._data,t},$o.prototype.isEmpty=function(){return!this._data};const IE={clipboard:["type",$o]};function wu(t){var e=this;function n(i){e._lastMoveEvent=i}this._lastMoveEvent=null,t.on("canvas.init",function(i){(e._svg=i.svg).addEventListener("mousemove",n)}),t.on("canvas.destroy",function(){e._lastMouseEvent=null,e._svg.removeEventListener("mousemove",n)})}wu.$inject=["eventBus"],wu.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(t,e){var n=document.createEvent("MouseEvent"),i=t,r=e,o=t,a=e;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null),n}(0,0)};const Go={__init__:["mouse"],mouse:["type",wu]};function dn(t,e,n,i,r,o,a,c){this._canvas=t,this._create=e,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=c,r.on("copyPaste.copyElement",function(l){var u=l.descriptor,p=l.element,d=l.elements;u.priority=1,u.id=p.id,Pt(d,function(y){return y===p.parent})&&(u.parent=p.parent.id),function(y){return!!y.host}(p)&&(u.priority=2,u.host=p.host.id),Es(p)&&(u.priority=3,u.source=p.source.id,u.target=p.target.id,u.waypoints=function(y){return le(y.waypoints,function(f){return(f=Uf(f)).original&&(f.original=Uf(f.original)),f})}(p)),_s(p)&&(u.priority=4,u.labelTarget=p.labelTarget.id),L(["x","y","width","height"],function(y){pt(p[y])&&(u[y]=p[y])}),u.hidden=p.hidden,u.collapsed=p.collapsed}),r.on("copyPaste.pasteElements",function(l){z(l.hints,{createElementsBehavior:!1})})}function Es(t){return!!t.waypoints}function _s(t){return!!t.labelTarget}function Uf(t){return z({},t)}function Hf(t,e){var n=e.indexOf(t);return n===-1?e:e.splice(n,1)}dn.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],dn.prototype.copy=function(t){var e,n;return gt(t)||(t=t?[t]:[]),n=(e=this._eventBus.fire("copyPaste.canCopyElements",{elements:t}))===!1?{}:this.createTree(gt(e)?e:t),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:t,tree:n}),n},dn.prototype.paste=function(t){var e=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=t&&t.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(e);if(t&&t.element&&t.point)return this._paste(i,t.element,t.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},dn.prototype._paste=function(t,e,n,i){L(t,function(o){pt(o.x)||(o.x=0),pt(o.y)||(o.y=0)});var r=ve(t);return L(t,function(o){Es(o)&&(o.waypoints=le(o.waypoints,function(a){return{x:a.x-r.x-r.width/2,y:a.y-r.y-r.height/2}})),z(o,{x:o.x-r.x-r.width/2,y:o.y-r.y-r.height/2})}),this._modeling.createElements(t,n,e,z({},i))},dn.prototype._createElements=function(t){var e=this,n=this._eventBus,i={},r=[];return L(t,function(o,a){L(o=We(o,"priority"),function(c){var l,u=z({},Vn(c,["priority"]));return i[c.parent]?u.parent=i[c.parent]:delete u.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:u}),Es(u)?(u.source=i[c.source],u.target=i[c.target],l=i[c.id]=e.createConnection(u),void r.push(l)):_s(u)?(u.labelTarget=i[u.labelTarget],l=i[c.id]=e.createLabel(u),void r.push(l)):(u.host&&(u.host=i[u.host]),l=i[c.id]=e.createShape(u),void r.push(l))})}),r},dn.prototype.createConnection=function(t){return this._elementFactory.createConnection(Vn(t,["id"]))},dn.prototype.createLabel=function(t){return this._elementFactory.createLabel(Vn(t,["id"]))},dn.prototype.createShape=function(t){return this._elementFactory.createShape(Vn(t,["id"]))},dn.prototype.hasRelations=function(t,e){var n,i;return!(Es(t)&&(n=Pt(e,Xe({id:t.source.id})),i=Pt(e,Xe({id:t.target.id})),!n||!i))&&!(_s(t)&&!Pt(e,Xe({id:t.labelTarget.id})))},dn.prototype.createTree=function(t){var e=this._rules,n=this,i={},r=[];function o(a,c){var l=Pt(r,function(u){return a===u.element});l?l.depth<c&&(r=function(u,p){var d=p.indexOf(u);return d!==-1&&p.splice(d,1),p}(l,r),r.push({element:l.element,depth:c})):r.push({element:a,depth:c})}return Fi(dd(t),function(a,c,l){if(!_s(a))return L(a.labels,function(u){o(u,l)}),L([a.attachers,a.incoming,a.outgoing],function(u){u&&u.length&&L(u,function(p){L(p.labels,function(d){o(d,l)}),o(p,l)})}),o(a,l),a.children}),t=le(r,function(a){return a.element}),r=le(r,function(a){return a.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:a.descriptor,element:a.element,elements:t}),a}),r=We(r,function(a){return a.descriptor.priority}),t=le(r,function(a){return a.element}),L(r,function(a){var c=a.depth;n.hasRelations(a.element,t)&&function(l,u){return e.allowed("element.copy",{element:l,elements:u})}(a.element,t)?(i[c]||(i[c]=[]),i[c].push(a.descriptor)):Hf(a.element,t)}),i};const DE={__depends__:[IE,xs,Go,In],__init__:["copyPaste"],copyPaste:["type",dn]};function ws(t,e,n){gt(n)||(n=[n]),L(n,function(i){jn(t[i])||(e[i]=t[i])})}function qf(t,e,n){var i;e.on("copyPaste.copyElement",750,function(r){var o=r.descriptor,a=r.element,c=o.oldBusinessObject=et(a);if(o.type=a.type,ws(c,o,"name"),o.di={},ws(c.di,o.di,["fill","stroke","background-color","border-color","color"]),ws(c.di,o,"isExpanded"),Wf(o))return o;c.default&&(o.default=c.default.id)}),e.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=t.create("bpmn:Process"),n.copyElement(c,o)}),e.on("copyPaste.pasteElements",function(){i={}}),e.on("copyPaste.pasteElement",function(r){var o,a,c,l=r.cache,u=r.descriptor,p=u.oldBusinessObject;Wf(u)?u.businessObject=et(l[u.labelTarget]):(o=t.create(p.$type),u.businessObject=n.copyElement(p,o),function(d,y){var f=et(d);d.default&&(i[d.default]={element:f,property:"default"}),d.host&&(et(d).attachedToRef=et(y[d.host])),i=Vn(i,De(i,function(v,g,b){var S=g.element,w=g.property;return b===d.id&&(S[w]=f,v.push(d.id)),v},[]))}(u,l),ws(u,o,["isExpanded","name"]),a=u,gt(c="oldBusinessObject")||(c=[c]),L(c,function(d){a[d]&&delete a[d]}))})}function Wf(t){return!!t.labelTarget}qf.$inject=["bpmnFactory","eventBus","moddleCopy"];var BE=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing"];function Uo(t,e,n){this._bpmnFactory=e,this._eventBus=t,this._moddle=n,t.on("moddleCopy.canCopyProperties",function(i){var r=i.propertyNames;if(r&&r.length)return We(r,function(o){return o==="extensionElements"})}),t.on("moddleCopy.canCopyProperty",function(i){var r=i.parent,o=te(r)&&r.$descriptor,a=i.propertyName;return(!a||BE.indexOf(a)===-1)&&!(a&&o&&!Pt(o.properties,Xe({name:a})))&&void 0}),t.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 Su(t,e){return De(t.properties,function(n,i){return e&&i.default?n:n.concat(i.name)},[])}Uo.$inject=["eventBus","bpmnFactory","moddle"],Uo.prototype.copyElement=function(t,e,n){var i=this;n&&!gt(n)&&(n=[n]),n=n||Su(t.$descriptor);var r=this._eventBus.fire("moddleCopy.canCopyProperties",{propertyNames:n,sourceElement:t,targetElement:e});return r===!1||(gt(r)&&(n=r),L(n,function(o){var a;Cn(t,o)&&(a=t.get(o));var c=i.copyProperty(a,e,o);i._eventBus.fire("moddleCopy.canSetCopiedProperty",{parent:e,property:c,propertyName:o})!==!1&&qe(c)&&e.set(o,c)})),e},Uo.prototype.copyProperty=function(t,e,n){var i=this,r=this._eventBus.fire("moddleCopy.canCopyProperty",{parent:e,property:t,propertyName:n});if(r!==!1){if(r)return te(r)&&r.$type&&!r.$parent&&(r.$parent=e),r;var o=this._moddle.getPropertyDescriptor(e,n);if(!o.isReference)return o.isId?this._copyId(t,e):gt(t)?De(t,function(a,c){return(r=i.copyProperty(c,e,n))?(r.$parent=e,a.concat(r)):a},[]):te(t)&&t.$type?this._moddle.getElementDescriptor(t).isGeneric?void 0:((r=i._bpmnFactory.create(t.$type)).$parent=e,r=i.copyElement(t,r)):t}},Uo.prototype._copyId=function(t,e){return this._moddle.ids.assigned(t)?void 0:(this._moddle.ids.claim(t,e),t)};const Xf={__depends__:[DE],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",qf],moddleCopy:["type",Uo]};var Kf=Math.round;function Cu(t){this._modeling=t}Cu.$inject=["modeling"],Cu.prototype.replaceElement=function(t,e,n){if(t.waypoints)return null;var i=this._modeling,r=e.width||t.width,o=e.height||t.height,a=e.x||t.x,c=e.y||t.y,l=Kf(a+r/2),u=Kf(c+o/2);return i.replaceShape(t,z({},e,{x:l,y:u,width:r,height:o}),n)};const OE={__init__:["replace"],replace:["type",Cu]};var LE=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function Yf(t,e,n,i,r,o,a){this.replaceElement=function(c,l,u){u=u||{};var p=l.type,d=c.businessObject;if(Ss(d)&&p==="bpmn:SubProcess"&&function(_,C){var B=_&&Cn(_,"collapsed")?_.collapsed:!Mt(_);return B!==(C&&(Cn(C,"collapsed")||Cn(C,"isExpanded"))?Cn(C,"collapsed")?C.collapsed:!C.isExpanded:B)&&(_.collapsed=B,!0)}(c,l))return i.toggleCollapse(c),c;var y,f=t.create(p),v={type:p,businessObject:f},g=Su(d.$descriptor),b=Su(f.$descriptor,!0),S=(y=b,g.filter(function(_){return y.indexOf(_)!==-1}));z(f,Ke(l,LE));var w=dt(S,function(_){return _==="eventDefinitions"?Jf(c,l.eventDefinitionType):_==="loopCharacteristics"?!Ne(f):!Cn(f,_)&&(_!=="processRef"||l.isExpanded!==!1)&&_!=="triggeredByEvent"});return f=n.copyElement(d,f,w),l.eventDefinitionType&&(Jf(f,l.eventDefinitionType)||(v.eventDefinitionType=l.eventDefinitionType,v.eventDefinitionAttrs=l.eventDefinitionAttrs)),A(d,"bpmn:Activity")&&(Ss(d)?v.isExpanded=Mt(d):l&&Cn(l,"isExpanded")&&(v.isExpanded=l.isExpanded),Mt(d)&&!A(d,"bpmn:Task")&&v.isExpanded&&(v.width=c.width,v.height=c.height)),Ss(d)&&!Ss(f)&&(u.moveChildren=!1),A(d,"bpmn:Participant")&&(l.isExpanded===!0?f.processRef=t.create("bpmn:Process"):u.moveChildren=!1,v.width=c.width,v.height=e._getDefaultSize(f).height),o.allowed("shape.resize",{shape:f})||(v.height=e._getDefaultSize(f).height,v.width=e._getDefaultSize(f).width),f.name=d.name,wt(d,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&wt(f,["bpmn:ExclusiveGateway","bpmn:InclusiveGateway","bpmn:Activity"])&&(f.default=d.default),l.host&&!A(d,"bpmn:BoundaryEvent")&&A(f,"bpmn:BoundaryEvent")&&(v.host=l.host),v.type!=="bpmn:DataStoreReference"&&v.type!=="bpmn:DataObjectReference"||(v.x=c.x+(c.width-v.width)/2),v.di={},function(_,C,B){gt(B)||(B=[B]),L(B,function(s){jn(_[s])||(C[s]=_[s])})}(d.di,v.di,["fill","stroke","background-color","border-color","color"]),v=r.replaceElement(c,v,u),u.select!==!1&&a.select(v),v}}function Ss(t){return A(t,"bpmn:SubProcess")}function Jf(t,e){var n=et(t);return e&&n.get("eventDefinitions").some(function(i){return A(i,e)})}Yf.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules","selection"];const Zf={__depends__:[Xf,OE,Mn],bpmnReplace:["type",Yf]};function Qf(t){return function(e){var n=e.target,i=et(t),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===Mt(i);return!(o&&a&&c&&l)}}var jE=[{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"}}],VE=[{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"}}],FE=[{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"}}],zE=[{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"}}],$E=[{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"}}],GE=[{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}}],UE=[{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}}],HE=[{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}}],tv=[{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}}],qE=[{label:"Data Store Reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],WE=[{label:"Data Object Reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],XE=[{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}}],KE=[{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}}],YE=[{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"}],JE=[{label:"Expanded Pool",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:function(t){var e="Empty Pool";return t.children&&t.children.length&&(e+=" (removes content)"),e},actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}];function en(t,e,n,i,r,o,a){this._bpmnFactory=t,this._popupMenu=e,this._modeling=n,this._moddle=i,this._bpmnReplace=r,this._rules=o,this._translate=a,this.register()}en.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate"],en.prototype.register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},en.prototype.getEntries=function(t){var e,n=t.businessObject;if(!this._rules.allowed("shape.replace",{element:t}))return[];var i=Qf(t);return A(n,"bpmn:DataObjectReference")?this._createEntries(t,qE):A(n,"bpmn:DataStoreReference")?this._createEntries(t,WE):A(n,"bpmn:StartEvent")&&!A(n.$parent,"bpmn:SubProcess")?(e=dt(jE,i),this._createEntries(t,e)):A(n,"bpmn:Participant")?(e=dt(JE,function(r){return Mt(n)!==r.target.isExpanded}),this._createEntries(t,e)):A(n,"bpmn:StartEvent")&&Ne(n.$parent)?(e=dt(KE,function(r){var o=r.target.isInterrupting!==!1,a=et(t).isInterrupting===o;return i(r)||!i(r)&&!a}),this._createEntries(t,e)):A(n,"bpmn:StartEvent")&&!Ne(n.$parent)&&A(n.$parent,"bpmn:SubProcess")?(e=dt(VE,i),this._createEntries(t,e)):A(n,"bpmn:EndEvent")?(e=dt(zE,function(r){return!(r.target.eventDefinitionType=="bpmn:CancelEventDefinition"&&!A(n.$parent,"bpmn:Transaction"))&&i(r)}),this._createEntries(t,e)):A(n,"bpmn:BoundaryEvent")?(e=dt(XE,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(t,e)):A(n,"bpmn:IntermediateCatchEvent")||A(n,"bpmn:IntermediateThrowEvent")?(e=dt(FE,i),this._createEntries(t,e)):A(n,"bpmn:Gateway")?(e=dt($E,i),this._createEntries(t,e)):A(n,"bpmn:Transaction")?(e=dt(UE,i),this._createEntries(t,e)):Ne(n)&&Mt(n)?(e=dt(HE,i),this._createEntries(t,e)):A(n,"bpmn:SubProcess")&&Mt(n)?(e=dt(GE,i),this._createEntries(t,e)):A(n,"bpmn:AdHocSubProcess")&&!Mt(n)?(e=dt(tv,function(r){var o=r.target,a=o.type==="bpmn:SubProcess",c=o.isExpanded===!0;return Qf(t)&&(!a||c)}),this._createEntries(t,e)):A(n,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(t,YE):A(n,"bpmn:FlowNode")?(e=dt(tv,i),A(n,"bpmn:SubProcess")&&!Mt(n)&&(e=dt(e,function(r){return r.label!=="Sub Process (collapsed)"})),this._createEntries(t,e)):[]},en.prototype.getHeaderEntries=function(t){var e=[];return A(t,"bpmn:Activity")&&!Ne(t)&&(e=e.concat(this._getLoopEntries(t))),A(t,"bpmn:DataObjectReference")&&(e=e.concat(this._getDataObjectIsCollection(t))),A(t,"bpmn:Participant")&&(e=e.concat(this._getParticipantMultiplicity(t))),!A(t,"bpmn:SubProcess")||A(t,"bpmn:Transaction")||Ne(t)||e.push(this._getAdHocEntry(t)),e},en.prototype._createEntries=function(t,e){var n=[],i=this;return L(e,function(r){var o=i._createMenuEntry(r,t);n.push(o)}),n},en.prototype._createSequenceFlowEntries=function(t,e){var n=et(t),i=[],r=this._modeling,o=this._moddle,a=this;return L(e,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,t,function(){r.updateProperties(t.source,{default:n})}));break;case"replace-with-conditional-flow":!n.conditionExpression&&A(n.sourceRef,"bpmn:Activity")&&i.push(a._createMenuEntry(c,t,function(){var l=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(t,{conditionExpression:l})}));break;default:if(A(n.sourceRef,"bpmn:Activity")&&n.conditionExpression)return i.push(a._createMenuEntry(c,t,function(){r.updateProperties(t,{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,t,function(){r.updateProperties(t.source,{default:void 0})}))}}),i},en.prototype._createMenuEntry=function(t,e,n){var i=this._translate,r=this._bpmnReplace.replaceElement,o=t.label;return o&&typeof o=="function"&&(o=o(e)),n=n||function(){return r(e,t.target)},{label:i(o),className:t.className,id:t.actionName,action:n}},en.prototype._getLoopEntries=function(t){var e=this,n=this._translate;function i(l,u){var p;u.active?p=void 0:(p=e._moddle.create(u.options.loopCharacteristics),u.options.isSequential&&(p.isSequential=u.options.isSequential)),e._modeling.updateProperties(t,{loopCharacteristics:p})}var r,o,a,c=et(t).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"}}]},en.prototype._getDataObjectIsCollection=function(t){var e=this,n=this._translate,i=t.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){e._modeling.updateModdleProperties(t,i,{isCollection:!a.active})}}]},en.prototype._getParticipantMultiplicity=function(t){var e=this,n=this._bpmnFactory,i=this._translate,r=t.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")),e._modeling.updateProperties(t,{participantMultiplicity:l})}}];return o},en.prototype._getAdHocEntry=function(t){var e=this._translate,n=A(et(t),"bpmn:AdHocSubProcess"),i=this._bpmnReplace.replaceElement;return{id:"toggle-adhoc",className:"bpmn-icon-ad-hoc-marker",title:e("Ad-hoc"),active:n,action:function(r,o){return i(t,n?{type:"bpmn:SubProcess"}:{type:"bpmn:AdHocSubProcess"},{autoResize:!1,layoutConnection:!1})}}};const ZE={__depends__:[NE,Zf],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",en]};var Cs=Math.max,Ts=Math.min,QE=20;function ev(t,e){return{top:t.top-e.top,right:t.right-e.right,bottom:t.bottom-e.bottom,left:t.left-e.left}}function As(t,e,n){var i=e[t],r=n.min&&n.min[t],o=n.max&&n.max[t];return pt(r)&&(i=(/top|left/.test(t)?Ts:Cs)(i,r)),pt(o)&&(i=(/top|left/.test(t)?Cs:Ts)(i,o)),i}function Ho(t,e){return t!==void 0?t:QE}function t_(t){return!t.waypoints&&t.type!=="label"}function nv(t,e){var n;if((n=t.length===void 0?dt(t.children,t_):t).length)return function(i,r){var o,a,c,l;return typeof r=="object"?(o=Ho(r.left),a=Ho(r.right),c=Ho(r.top),l=Ho(r.bottom)):o=a=c=l=Ho(r),{x:i.x-o,y:i.y-c,width:i.width+o+a,height:i.height+c+l}}(ve(n),e)}var ks=Math.abs,e_=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],Fr=30;function Ps(t,e){return e=e||[],t.children.filter(function(n){A(n,"bpmn:Lane")&&(Ps(n,e),e.push(n))}),e}oi=function(t){return t.children.filter(function(e){return A(e,"bpmn:Lane")})};function mn(t){return ms(t,e_)||t}function n_(t,e){var n=mn(t),i=Ps(n,A(n,"bpmn:Process")?[]:[n]),r=at(t),o=at(e),a=function(l,u){return ev(at(u),at(l))}(t,e),c=[];return i.forEach(function(l){if(l!==t){var u,p,d=0,y=a.right,f=0,v=a.left,g=at(l);a.top&&(ks(g.bottom-r.top)<10&&(f=o.top-g.bottom),ks(g.top-r.top)<5&&(d=o.top-g.top)),a.bottom&&(ks(g.top-r.bottom)<10&&(d=o.bottom-g.top),ks(g.bottom-r.bottom)<5&&(f=o.bottom-g.bottom)),(d||y||f||v)&&c.push({shape:l,newBounds:(u=l,p={top:d,right:y,bottom:f,left:v},{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 Tu(t,e,n,i,r,o,a,c,l,u,p,d){t=t||{},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=d,t.autoPlace!==!1&&(this._autoPlace=e.get("autoPlace",!1)),n.on("create.end",250,function(y){var f=y.context.shape;if(Ir(y)&&i.isOpen(f)){var v=i.getEntries(f);v.replace&&v.replace.action.click(y,f)}})}function iv(t,e,n){var i=t.$instanceOf(e),r=!1;return L(t.eventDefinitions||[],function(o){o.$type===n&&(r=!0)}),i&&r}Tu.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate"],Tu.prototype.getContextPadEntries=function(t){var e=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,d={};if(t.type==="label")return d;var y=t.businessObject;function f(w,_){r.start(w,_)}function v(w,_,C,B){function s(m,E){var T=i.createShape(z({type:w},B));o.start(m,T,{source:E})}typeof C!="string"&&(B=C,C=p("Append {type}",{type:w.replace(/^bpmn:/,"")}));var h=u?function(m,E){var T=i.createShape(z({type:w},B));u.append(E,T)}:s;return{group:"model",className:_,title:C,action:{dragstart:s,click:h}}}function g(w){return function(_,C){n.splitLane(C,w),e.open(C,!0)}}if(wt(y,["bpmn:Lane","bpmn:Participant"])&&Mt(y)){var b=oi(t);z(d,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:p("Add Lane above"),action:{click:function(w,_){n.addLane(_,"top")}}}}),b.length<2&&(t.height>=120&&z(d,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:p("Divide into two Lanes"),action:{click:g(2)}}}),t.height>=180&&z(d,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:p("Divide into three Lanes"),action:{click:g(3)}}})),z(d,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:p("Add Lane below"),action:{click:function(w,_){n.addLane(_,"bottom")}}}})}A(y,"bpmn:FlowNode")&&(A(y,"bpmn:EventBasedGateway")?z(d,{"append.receive-task":v("bpmn:ReceiveTask","bpmn-icon-receive-task",p("Append ReceiveTask")),"append.message-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",p("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",p("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",p("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",p("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):iv(y,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?z(d,{"append.compensation-activity":v("bpmn:Task","bpmn-icon-task",p("Append compensation activity"),{isForCompensation:!0})}):A(y,"bpmn:EndEvent")||y.isForCompensation||iv(y,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||Ne(y)||z(d,{"append.end-event":v("bpmn:EndEvent","bpmn-icon-end-event-none",p("Append EndEvent")),"append.gateway":v("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",p("Append Gateway")),"append.append-task":v("bpmn:Task","bpmn-icon-task",p("Append Task")),"append.intermediate-event":v("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",p("Append Intermediate/Boundary Event"))})),a.isEmpty(t,"bpmn-replace")||z(d,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:p("Change type"),action:{click:function(w,_){var C=z(function(B){var s=c.getContainer(),h=e.getPad(B).html,m=s.getBoundingClientRect(),E=h.getBoundingClientRect(),T=E.top-m.top;return{x:E.left-m.left,y:T+E.height+5}}(_),{cursor:{x:w.x,y:w.y}});a.open(_,"bpmn-replace",C)}}}}),wt(y,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(d,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using "+(y.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:f,dragstart:f}}}),A(y,"bpmn:TextAnnotation")&&z(d,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using Association"),action:{click:f,dragstart:f}}}),wt(y,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(d,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using DataInputAssociation"),action:{click:f,dragstart:f}}}),A(y,"bpmn:Group")&&z(d,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation")});var S=l.allowed("elements.delete",{elements:[t]});return gt(S)&&(S=S[0]===t),S&&z(d,{delete:{group:"edit",className:"bpmn-icon-trash",title:p("Remove"),action:{click:function(w){n.removeElements([t])}}}}),d};const i_={__depends__:[Nf,kE,Mn,Eu,xs,ZE],__init__:["contextPadProvider"],contextPadProvider:["type",Tu]};var r_={horizontal:["x","width"],vertical:["y","height"]};function Kn(t){this._modeling=t,this._filters=[],this.registerFilter(function(e,n,i){var r,o=0,a=0;return L(e,function(c){c.waypoints||c.labelTarget||(o+=c[i],a+=1)}),r=Math.round(o/a),dt(e,function(c){return c[i]<r+50})})}Kn.$inject=["modeling"],Kn.prototype.registerFilter=function(t){if(typeof t!="function")throw new Error("the filter has to be a function");this._filters.push(t)},Kn.prototype.trigger=function(t,e){var n,i,r=this._modeling;if(!(t.length<3||(this._setOrientation(e),i=this._filterElements(t),(n=this._createGroups(i)).length<=2)))return r.distributeElements(n,this._axis,this._dimension),n},Kn.prototype._filterElements=function(t){var e=this._filters,n=this._axis,i=this._dimension,r=[].concat(t);return e.length?(L(e,function(o){r=o(r,n,i)}),r):t},Kn.prototype._createGroups=function(t){var e=[],n=this,i=this._axis,r=this._dimension;if(!i)throw new Error('must have a defined "axis" and "dimension"');return L(We(t,i),function(o,a){var c,l=n._findRange(o,i,r),u=e[e.length-1];u&&n._hasIntersection(u.range,l)?e[e.length-1].elements.push(o):(c={range:l,elements:[o]},e.push(c))}),e},Kn.prototype._setOrientation=function(t){var e=r_[t];this._axis=e[0],this._dimension=e[1]},Kn.prototype._hasIntersection=function(t,e){return Math.max(t.min,t.max)>=Math.min(e.min,e.max)&&Math.min(t.min,t.max)<=Math.max(e.min,e.max)},Kn.prototype._findRange=function(t){var e=t[this._axis];return{min:e+5,max:e+t[this._dimension]-5}};const o_={__init__:["distributeElements"],distributeElements:["type",Kn]};function rv(t){t.registerFilter(function(e){return dt(e,function(n){var i=wt(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:Participant","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)})})}rv.$inject=["distributeElements"];const a_={__depends__:[o_],__init__:["bpmnDistributeElements"],bpmnDistributeElements:["type",rv]};var ov="is not a registered action";function nn(t,e){this._actions={};var n=this;t.on("diagram.init",function(){n._registerDefaultActions(e),t.fire("editorActions.init",{editorActions:n})})}function Au(t,e){return new Error(t+" "+e)}nn.$inject=["eventBus","injector"],nn.prototype._registerDefaultActions=function(t){var e=t.get("commandStack",!1),n=t.get("modeling",!1),i=t.get("selection",!1),r=t.get("zoomScroll",!1),o=t.get("copyPaste",!1),a=t.get("canvas",!1),c=t.get("rules",!1),l=t.get("keyboardMove",!1),u=t.get("keyboardMoveSelection",!1);e&&(this.register("undo",function(){e.undo()}),this.register("redo",function(){e.redo()})),o&&i&&this.register("copy",function(){var p=i.get();o.copy(p)}),o&&this.register("paste",function(){o.paste()}),r&&this.register("stepZoom",function(p){r.stepZoom(p.value)}),a&&this.register("zoom",function(p){a.zoom(p.value)}),n&&i&&c&&this.register("removeSelection",function(){var p=i.get();if(p.length){var d,y=c.allowed("elements.delete",{elements:p});y!==!1&&(d=gt(y)?y:p).length&&n.removeElements(d.slice())}}),l&&this.register("moveCanvas",function(p){l.moveCanvas(p)}),u&&this.register("moveSelection",function(p){u.moveSelection(p.direction,p.accelerated)})},nn.prototype.trigger=function(t,e){if(!this._actions[t])throw Au(t,ov);return this._actions[t](e)},nn.prototype.register=function(t,e){var n=this;if(typeof t=="string")return this._registerAction(t,e);L(t,function(i,r){n._registerAction(r,i)})},nn.prototype._registerAction=function(t,e){if(this.isRegistered(t))throw Au(t,"is already registered");this._actions[t]=e},nn.prototype.unregister=function(t){if(!this.isRegistered(t))throw Au(t,ov);this._actions[t]=void 0},nn.prototype.getActions=function(){return Object.keys(this._actions)},nn.prototype.isRegistered=function(t){return!!this._actions[t]};const s_={__init__:["editorActions"],editorActions:["type",nn]};function Ms(t){t.invoke(nn,this)}it(Ms,nn),Ms.$inject=["injector"],Ms.prototype._registerDefaultActions=function(t){nn.prototype._registerDefaultActions.call(this,t);var e=t.get("canvas",!1),n=t.get("elementRegistry",!1),i=t.get("selection",!1),r=t.get("spaceTool",!1),o=t.get("lassoTool",!1),a=t.get("handTool",!1),c=t.get("globalConnect",!1),l=t.get("distributeElements",!1),u=t.get("alignElements",!1),p=t.get("directEditing",!1),d=t.get("searchPad",!1),y=t.get("modeling",!1);e&&n&&i&&this._registerAction("selectElements",function(){var f=e.getRootElement(),v=n.filter(function(g){return g!==f});return i.select(v),v}),r&&this._registerAction("spaceTool",function(){r.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),c&&this._registerAction("globalConnectTool",function(){c.toggle()}),i&&l&&this._registerAction("distributeElements",function(f){var v=i.get(),g=f.type;v.length&&l.trigger(v,g)}),i&&u&&this._registerAction("alignElements",function(f){var v=i.get(),g=[],b=f.type;v.length&&(g=dt(v,function(S){return!A(S,"bpmn:Lane")}),u.trigger(g,b))}),i&&y&&this._registerAction("setColor",function(f){var v=i.get();v.length&&y.setColor(v,f)}),i&&p&&this._registerAction("directEditing",function(){var f=i.get();f.length&&p.activate(f[0])}),d&&this._registerAction("find",function(){d.toggle()}),e&&y&&this._registerAction("moveToOrigin",function(){var f,v,g=e.getRootElement();f=ve(v=A(g,"bpmn:Collaboration")?n.filter(function(b){return A(b.parent,"bpmn:Collaboration")}):n.filter(function(b){return b!==g&&!A(b.parent,"bpmn:SubProcess")})),y.moveElements(v,{x:-f.x,y:-f.y},g)})};const c_={__depends__:[s_],editorActions:["type",Ms]};function av(t){t.on(["create.init","shape.move.init"],function(e){var n=e.context;wt(e.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}av.$inject=["eventBus"];function ku(t,e,n){return n||(n="round"),Math[n](t/e)*e}function bi(t,e,n){var i=!n||n.active!==!1;this._eventBus=e;var r=this;e.on("diagram.init",800,function(){r.setActive(i)}),e.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],1200,function(o){var a=o.originalEvent;if(!(!r.active||a&&He(a))){var c=o.context,l=c.gridSnappingContext;l||(l=c.gridSnappingContext={}),["x","y"].forEach(function(u){var p={},d=function(f,v,g){var b=f.context,S=f.shape,w=b.gridSnappingContext,_=w.snapLocation,C=w.snapOffset;return C&&pt(C[v])||(C||(C=w.snapOffset={}),pt(C[v])||(C[v]=0),!S)||(g.get(S.id)||(Rs(v)?C[v]+=S[v]+S.width/2:C[v]+=S[v]+S.height/2),!_)||(v==="x"?/left/.test(_)?C[v]-=S.width/2:/right/.test(_)&&(C[v]+=S.width/2):/top/.test(_)?C[v]-=S.height/2:/bottom/.test(_)&&(C[v]+=S.height/2)),C[v]}(o,u,t);d&&(p.offset=d);var y=function(f,v){var g=f.context,b=g.createConstraints,S=g.resizeConstraints||{},w=g.gridSnappingContext,_=w.snapConstraints;if(_&&_[v])return _[v];_||(_=w.snapConstraints={}),_[v]||(_[v]={});var C=g.direction;b&&(Rs(v)?(_.x.min=b.left,_.x.max=b.right):(_.y.min=b.top,_.y.max=b.bottom));var B=S.min,s=S.max;return B&&(Rs(v)?cv(C)?_.x.max=B.left:_.x.min=B.right:sv(C)?_.y.max=B.top:_.y.min=B.bottom),s&&(Rs(v)?cv(C)?_.x.min=s.left:_.x.max=s.right:sv(C)?_.y.min=s.top:_.y.max=s.bottom),_[v]}(o,u);y&&z(p,y),Vr(o,u)||r.snapEvent(o,u,p)})}})}function Rs(t){return t==="x"}function sv(t){return t.indexOf("n")!==-1}function cv(t){return t.indexOf("w")!==-1}function Yi(t,e){Q.call(this,t),this._gridSnapping=e;var n=this;this.preExecute("shape.resize",function(i){var r=i.context,o=(r.hints||{}).autoResize;if(o){var a=r.shape,c=r.newBounds;Ie(o)?r.newBounds=n.snapComplex(c,o):r.newBounds=n.snapSimple(a,c)}})}bi.prototype.snapEvent=function(t,e,n){se(t,e,this.snapValue(t[e],n))},bi.prototype.getGridSpacing=function(){return 10},bi.prototype.snapValue=function(t,e){var n,i,r=0;return e&&e.offset&&(r=e.offset),t=ku(t+=r,10),e&&e.min&&pt(n=e.min)&&(n=ku(n+r,10,"ceil"),t=Math.max(t,n)),e&&e.max&&pt(i=e.max)&&(i=ku(i+r,10,"floor"),t=Math.min(t,i)),t-=r},bi.prototype.isActive=function(){return this.active},bi.prototype.setActive=function(t){this.active=t,this._eventBus.fire("gridSnapping.toggle",{active:t})},bi.prototype.toggleActive=function(){this.setActive(!this.active)},bi.$inject=["elementRegistry","eventBus","config.gridSnapping"],Yi.$inject=["eventBus","gridSnapping","modeling"],it(Yi,Q),Yi.prototype.snapSimple=function(t,e){var n=this._gridSnapping;return e.width=n.snapValue(e.width,{min:e.width}),e.height=n.snapValue(e.height,{min:e.height}),e.x=t.x+t.width/2-e.width/2,e.y=t.y+t.height/2-e.height/2,e},Yi.prototype.snapComplex=function(t,e){return/w|e/.test(e)&&(t=this.snapHorizontally(t,e)),/n|s/.test(e)&&(t=this.snapVertically(t,e)),t},Yi.prototype.snapHorizontally=function(t,e){var n=this._gridSnapping,i=/w/.test(e),r=/e/.test(e),o={};return o.width=n.snapValue(t.width,{min:t.width}),r&&(i?(o.x=n.snapValue(t.x,{max:t.x}),o.width+=n.snapValue(t.x-o.x,{min:t.x-o.x})):t.x=t.x+t.width-o.width),z(t,o),t},Yi.prototype.snapVertically=function(t,e){var n=this._gridSnapping,i=/n/.test(e),r=/s/.test(e),o={};return o.height=n.snapValue(t.height,{min:t.height}),i&&(r?(o.y=n.snapValue(t.y,{max:t.y}),o.height+=n.snapValue(t.y-o.y,{min:t.y-o.y})):t.y=t.y+t.height-o.height),z(t,o),t};function lv(t,e){t.on(["spaceTool.move","spaceTool.end"],2e3,function(n){var i,r=n.context;r.initialized&&(r.axis==="x"?(i=e.snapValue(n.dx),n.x=n.x+i-n.dx,n.dx=i):(i=e.snapValue(n.dy),n.y=n.y+i-n.dy,n.dy=i))})}lv.$inject=["eventBus","gridSnapping"];const l_={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",Yi],gridSnappingSpaceToolBehavior:["type",lv]}],__init__:["gridSnapping"],gridSnapping:["type",bi]};function uv(t,e){t.on("autoPlace",2e3,function(n){var i=n.source,r=ft(i),o=n.shape,a=Xm(i,o);return["x","y"].forEach(function(c){var l={};a[c]!==r[c]&&(a[c]>r[c]?l.min=a[c]:l.max=a[c],A(o,"bpmn:TextAnnotation")&&(function(u){return u==="x"}(c)?l.offset=-o.width/2:l.offset=-o.height/2),a[c]=e.snapValue(a[c],l))}),a})}uv.$inject=["eventBus","gridSnapping"];function pv(t,e,n){e.on(["create.start","shape.move.start"],1750,function(i){var r=i.context,o=r.shape,a=t.getRootElement();A(o,"bpmn:Participant")&&A(a,"bpmn:Process")&&a.children.length&&r.createConstraints&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))})}pv.$inject=["canvas","eventBus","gridSnapping"];function Ns(t,e,n){Q.call(this,t),this._gridSnapping=e;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,function(r){var o=r.context,a=o.connection,c=o.hints||{},l=a.waypoints;c.connectionStart||c.connectionEnd||c.createElementsBehavior===!1||function(u){return u.length>3}(l)&&n.updateWaypoints(a,i.snapMiddleSegments(l))})}function u_(t,e,n){var i=zn(e,n),r={};return function(o){return o==="h"}(i)&&(r.y=t.snapValue(e.y)),function(o){return o==="v"}(i)&&(r.x=t.snapValue(e.x)),("x"in r||"y"in r)&&(e=z({},e,r),n=z({},n,r)),[e,n]}Ns.$inject=["eventBus","gridSnapping","modeling"],it(Ns,Q),Ns.prototype.snapMiddleSegments=function(t){var e,n=this._gridSnapping;t=t.slice();for(var i=1;i<t.length-2;i++)e=u_(n,t[i],t[i+1]),t[i]=e[0],t[i+1]=e[1];return t};const p_={__depends__:[l_,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingCreateParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",uv],gridSnappingCreateParticipantBehavior:["type",pv],gridSnappingLayoutConnectionBehavior:["type",Ns]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",av]};function qo(t,e){this._interactionEvents=e;var n=this;t.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")?Mt(r)?n.createParticipantHit(r,o):n.createDefaultHit(r,o):A(r,"bpmn:SubProcess")?Mt(r)?n.createSubProcessHit(r,o):n.createDefaultHit(r,o):void 0})}qo.$inject=["eventBus","interactionEvents"],qo.prototype.createDefaultHit=function(t,e){return this._interactionEvents.removeHits(e),this._interactionEvents.createDefaultHit(t,e),!0},qo.prototype.createParticipantHit=function(t,e){return this._interactionEvents.removeHits(e),this._interactionEvents.createBoxHit(e,"click-stroke",{width:t.width,height:t.height}),this._interactionEvents.createBoxHit(e,"all",{width:30,height:t.height}),!0},qo.prototype.createSubProcessHit=function(t,e){return this._interactionEvents.removeHits(e),this._interactionEvents.createBoxHit(e,"click-stroke",{width:t.width,height:t.height}),this._interactionEvents.createBoxHit(e,"all",{width:t.width,height:30}),!0};const h_={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",qo]};function Is(t){t.invoke(Br,this)}it(Is,Br),Is.$inject=["injector"],Is.prototype.registerBindings=function(t,e){function n(i,r){e.isRegistered(i)&&t.addListener(r)}Br.prototype.registerBindings.call(this,t,e),n("selectElements",function(i){var r=i.keyEvent;if(t.isKey(["a","A"],r)&&t.isCmd(r))return e.trigger("selectElements"),!0}),n("find",function(i){var r=i.keyEvent;if(t.isKey(["f","F"],r)&&t.isCmd(r))return e.trigger("find"),!0}),n("spaceTool",function(i){var r=i.keyEvent;if(!t.hasModifier(r))return t.isKey(["s","S"],r)?(e.trigger("spaceTool"),!0):void 0}),n("lassoTool",function(i){var r=i.keyEvent;if(!t.hasModifier(r))return t.isKey(["l","L"],r)?(e.trigger("lassoTool"),!0):void 0}),n("handTool",function(i){var r=i.keyEvent;if(!t.hasModifier(r))return t.isKey(["h","H"],r)?(e.trigger("handTool"),!0):void 0}),n("globalConnectTool",function(i){var r=i.keyEvent;if(!t.hasModifier(r))return t.isKey(["c","C"],r)?(e.trigger("globalConnectTool"),!0):void 0}),n("directEditing",function(i){var r=i.keyEvent;if(!t.hasModifier(r))return t.isKey(["e","E"],r)?(e.trigger("directEditing"),!0):void 0})};const d_={__depends__:[iu],__init__:["keyboardBindings"],keyboardBindings:["type",Is]};var m_={moveSpeed:1,moveSpeedAccelerated:10},hv="left",dv="right",mv="down",f_={ArrowLeft:hv,Left:hv,ArrowUp:"up",Up:"up",ArrowRight:dv,Right:dv,ArrowDown:mv,Down:mv},v_={left:function(t){return{x:-t,y:0}},up:function(t){return{x:0,y:-t}},right:function(t){return{x:t,y:0}},down:function(t){return{x:0,y:t}}};function fv(t,e,n,i,r){var o=this;this._config=z({},m_,t||{}),e.addListener(1500,function(a){var c=a.keyEvent,l=f_[c.key];if(l&&!e.isCmd(c)){var u=e.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=v_[a](u);i.allowed("elements.move",{shapes:l})&&n.moveElements(l,p)}}}fv.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];const y_={__depends__:[iu,Mn],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",fv]};function vv(t,e,n,i){t.on("element.changed",function(r){var o=r.element;(o.parent||o===e.getRootElement())&&(r.gfx=n.getGraphics(o)),r.gfx&&t.fire(vd(o)+".changed",r)}),t.on("elements.changed",function(r){var o=r.elements;o.forEach(function(a){t.fire("element.changed",{element:a})}),i.updateContainments(o)}),t.on("shape.changed",function(r){i.update("shape",r.element,r.gfx)}),t.on("connection.changed",function(r){i.update("connection",r.element,r.gfx)})}vv.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const yv={__init__:["changeSupport"],changeSupport:["type",vv]};function Wo(t,e,n,i){this._dragging=i,this._rules=e;var r=this;function o(a,c){var l,u=a.shape,p=a.direction,d=a.resizeConstraints;a.delta=c,l=function(y,f,v){var g=v.x,b=v.y,S={x:y.x,y:y.y,width:y.width,height:y.height};return f.indexOf("n")!==-1?(S.y=y.y+b,S.height=y.height-b):f.indexOf("s")!==-1&&(S.height=y.height+b),f.indexOf("e")!==-1?S.width=y.width+g:f.indexOf("w")!==-1&&(S.x=y.x+g,S.width=y.width-g),S}(u,p,c),a.newBounds=function(y,f){if(!f)return y;var v=at(y);return jl({top:As("top",v,f),right:As("right",v,f),bottom:As("bottom",v,f),left:As("left",v,f)})}(l,d),a.canExecute=r.canResize(a)}t.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:at(u)})}),t.on("resize.move",function(a){var c={x:a.dx,y:a.dy};o(a.context,c)}),t.on("resize.end",function(a){(function(c){var l=c.shape,u=c.canExecute,p=c.newBounds;if(u){if(!function(d,y){return d.x!==y.x||d.y!==y.y||d.width!==y.width||d.height!==y.height}(l,p=Nd(p)))return;n.resizeShape(l,p)}})(a.context)})}function gv(t,e){var n=ft(t),i=at(t),r={x:n.x,y:n.y};return e.indexOf("n")!==-1?r.y=i.top:e.indexOf("s")!==-1&&(r.y=i.bottom),e.indexOf("e")!==-1?r.x=i.right:e.indexOf("w")!==-1&&(r.x=i.left),r}function g_(t){var e="resize-";return t==="n"||t==="s"?e+"ns":t==="e"||t==="w"?e+"ew":t==="nw"||t==="se"?e+"nwse":e+"nesw"}Wo.prototype.canResize=function(t){var e=this._rules,n=Ke(t,["newBounds","shape","delta","direction"]);return e.allowed("shape.resize",n)},Wo.prototype.activate=function(t,e,n){var i,r,o=this._dragging;if(typeof n=="string"&&(n={direction:n}),!(r=(i=z({shape:e},n)).direction))throw new Error("must provide a direction (n|w|s|e|nw|se|ne|sw)");o.init(t,gv(e,r),"resize",{autoActivate:!0,cursor:g_(r),data:{shape:e,context:i}})},Wo.prototype.computeMinResizeBox=function(t){var e=t.shape;return function(n,i,r,o){var a=at(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?at(o):c;return jl({top:Ts(c.top,l.top),left:Ts(c.left,l.left),bottom:Cs(c.bottom,l.bottom),right:Cs(c.right,l.right)})}(t.direction,e,t.minDimensions||{width:10,height:10},nv(e,t.childrenBoxPadding))},Wo.$inject=["eventBus","rules","modeling","dragging"];var bv="djs-resizing",xv="resize-not-ok";function Ev(t,e,n){t.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,e.getActiveLayer()),e.addMarker(o,bv)),a.width>5&&K(c,{x:a.x,width:a.width}),a.height>5&&K(c,{y:a.y,height:a.height}),r.canExecute?bt(c).remove(xv):bt(c).add(xv)}),t.on("resize.cleanup",function(i){var r,o;r=i.context,o=r.shape,r.frame&&ee(r.frame),e.removeMarker(o,bv)})}Ev.$inject=["eventBus","canvas","previewSupport"];var _v=-6,Xo="djs-resizer",b_=["n","w","s","e","nw","ne","se","sw"];function xi(t,e,n,i){this._resize=i,this._canvas=e;var r=this;t.on("selection.changed",function(o){var a=o.newSelection;r.removeResizers(),a.length===1&&L(a,we(r.addResizer,r))}),t.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}xi.prototype.makeDraggable=function(t,e,n){var i=this._resize;function r(o){yi(o)&&i.activate(o,t,n)}ct.bind(e,"mousedown",r),ct.bind(e,"touchstart",r)},xi.prototype._createResizer=function(t,e,n,i){var r=this._getResizersParent(),o=function(u){var p={x:0,y:0};return u.indexOf("e")!==-1?p.x=6:u.indexOf("w")!==-1&&(p.x=_v),u.indexOf("s")!==-1?p.y=6:u.indexOf("n")!==-1&&(p.y=_v),p}(i),a=ot("g");bt(a).add(Xo),bt(a).add(Xo+"-"+t.id),bt(a).add(Xo+"-"+i),lt(r,a);var c=ot("rect");K(c,{x:-2+o.x,y:-2+o.y,width:4,height:4}),bt(c).add(Xo+"-visual"),lt(a,c);var l=ot("rect");return K(l,{x:-10+o.x,y:-10+o.y,width:20,height:20}),bt(l).add(Xo+"-hit"),lt(a,l),$l(a,e,n),a},xi.prototype.createResizer=function(t,e){var n=gv(t,e),i=this._createResizer(t,n.x,n.y,e);this.makeDraggable(t,i,e)},xi.prototype.addResizer=function(t){var e=this;this._resize.canResize({shape:t})&&L(b_,function(n){e.createResizer(t,n)})},xi.prototype.removeResizers=function(){Sl(this._getResizersParent())},xi.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},xi.$inject=["eventBus","canvas","selection","resize"];const wv={__depends__:[In,Wn,Fo],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Wo],resizePreview:["type",Ev],resizeHandles:["type",xi]};function Pu(t,e){var n=e.create("bpmn:CategoryValue"),i=e.create("bpmn:Category",{categoryValue:[n]});return Jt(t.get("rootElements"),i),et(i).$parent=t,et(n).$parent=i,n}function Ko(t,e,n,i,r,o,a){function c(l,u){(u||wt(l,["bpmn:Task","bpmn:TextAnnotation"])||Mu(l))&&i.activate(l)}this._bpmnFactory=e,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),t.on("element.dblclick",function(l){c(l.element,!0)}),t.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open"],function(l){i.isActive()&&i.complete()}),t.on(["commandStack.changed"],function(l){i.isActive()&&i.cancel()}),t.on("directEditing.activate",function(l){o.removeResizers()}),t.on("create.end",500,function(l){var u=l.context,p=u.shape,d=l.context.canExecute;l.isTouch||d&&(u.hints&&u.hints.createElementsBehavior===!1||c(p))}),t.on("autoPlace.end",500,function(l){c(l.shape)})}function Mu(t){return A(t,"bpmn:SubProcess")&&!Mt(t)}Ko.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],Ko.prototype.activate=function(t){var e=un(t);if(e!==void 0){var n={text:e};z(n,this.getEditingBBox(t));var i={};return(wt(t,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||Mu(t))&&z(i,{centerVertically:!0}),Rr(t)&&z(i,{autoResize:!0}),A(t,"bpmn:TextAnnotation")&&z(i,{resizable:!0,autoResize:!0}),z(n,{options:i}),n}},Ko.prototype.getEditingBBox=function(t){var e=this._canvas,n=t.label||t,i=e.getAbsoluteBBox(n),r=i.x+i.width/2,o=i.y+i.height/2,a={x:i.x,y:i.y},c=e.zoom(),l=this._textRenderer.getDefaultStyle(),u=this._textRenderer.getExternalStyle(),p=u.fontSize*c,d=u.lineHeight,y=l.fontSize*c,f=l.lineHeight,v={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(A(t,"bpmn:Lane")||function(B){return A(B,"bpmn:Participant")&&Mt(B)}(t))&&(z(a,{width:i.height,height:30*c,x:i.x-i.height/2+15*c,y:o-30*c/2}),z(v,{fontSize:y+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px",transform:"rotate(-90deg)"})),(wt(t,["bpmn:Task","bpmn:CallActivity"])||function(B){return A(B,"bpmn:Participant")&&!Mt(B)}(t)||Mu(t))&&(z(a,{width:i.width,height:i.height}),z(v,{fontSize:y+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"})),function(B){return A(B,"bpmn:SubProcess")&&Mt(B)}(t)&&(z(a,{width:i.width,x:i.x}),z(v,{fontSize:y+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"}));var g=90*c,b=7*c,S=4*c;if(n.labelTarget&&(z(a,{width:g,height:i.height+b+S,x:r-g/2,y:i.y-b}),z(v,{fontSize:p+"px",lineHeight:d,paddingTop:b+"px",paddingBottom:S+"px"})),Rr(n)&&!as(n)&&!ge(n)){var w=ss(t),_=e.getAbsoluteBBox({x:w.x,y:w.y,width:0,height:0}),C=p+b+S;z(a,{width:g,height:C,x:_.x-g/2,y:_.y-C/2}),z(v,{fontSize:p+"px",lineHeight:d,paddingTop:b+"px",paddingBottom:S+"px"})}return A(t,"bpmn:TextAnnotation")&&(z(a,{width:i.width,height:i.height,minWidth:30*c,minHeight:10*c}),z(v,{textAlign:"left",paddingTop:5*c+"px",paddingBottom:7*c+"px",paddingLeft:7*c+"px",paddingRight:5*c+"px",fontSize:y+"px",lineHeight:f})),{bounds:a,style:v}},Ko.prototype.update=function(t,e,n,i){var r,o,a;if(A(t,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(t),r={x:t.x,y:t.y,width:t.width/o.width*i.width,height:t.height/o.height*i.height}),A(t,"bpmn:Group")&&!et(t).categoryValueRef){var c=Pu(et(this._canvas.getRootElement()).$parent,this._bpmnFactory);et(t).categoryValueRef=c}(a=e)&&a.trim()||(e=null),this._modeling.updateLabel(t,e,r)};var Sv="djs-element-hidden",Cv="djs-label-hidden";function Tv(t,e,n,i){var r,o,a,c=this,l=e.getDefaultLayer();t.on("directEditing.activate",function(u){var p=u.active;if(A(r=p.element.label||p.element,"bpmn:TextAnnotation")){o=e.getAbsoluteBBox(r),a=ot("g");var d=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:r.height,position:{mx:0,my:0}}),y=c.path=ot("path");K(y,{d,strokeWidth:2,stroke:x_(r)}),lt(a,y),lt(l,a),Oe(a,r.x,r.y)}A(r,"bpmn:TextAnnotation")||r.labelTarget?e.addMarker(r,Sv):(A(r,"bpmn:Task")||A(r,"bpmn:CallActivity")||A(r,"bpmn:SubProcess")||A(r,"bpmn:Participant"))&&e.addMarker(r,Cv)}),t.on("directEditing.resize",function(u){if(A(r,"bpmn:TextAnnotation")){var p=u.height,d=u.dy,y=Math.max(r.height/o.height*(p+d),0),f=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:y,position:{mx:0,my:0}});K(c.path,{d:f})}}),t.on(["directEditing.complete","directEditing.cancel"],function(u){var p=u.active;p&&(e.removeMarker(p.element.label||p.element,Sv),e.removeMarker(r,Cv)),r=void 0,o=void 0,a&&(ee(a),a=void 0)})}function x_(t,e){return et(t).di.get("stroke")||e||"black"}Tv.$inject=["eventBus","canvas","elementRegistry","pathMap"];const E_={__depends__:[yv,wv,Nf],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Ko],labelEditingPreview:["type",Tv]};var Ru=["top","bottom","left","right"],Ds=10;function Nu(t,e){function n(i){if(as(i)){var r=function(o){var a=ft(o.label),c=ft(o),l=Av(c,a);if(u=l,Ru.indexOf(u)!==-1){var u,p=function(f){var v=ft(f),g=[].concat(f.incoming.map(function(b){return b.waypoints[b.waypoints.length-2]}),f.outgoing.map(function(b){return b.waypoints[1]})).map(function(b){return Av(v,b)});return g}(o);if(o.host){var d=function(f){var v,g=f.host,b=ft(f),S=ye(b,g);v=S.indexOf("-")>=0?S.split("-"):[S];var w=Ru.filter(function(_){return v.indexOf(_)===-1});return w}(o);p=p.concat(d)}var y=Ru.filter(function(f){return p.indexOf(f)===-1});if(y.indexOf(l)===-1)return y[0]}}(i);r&&function(o,a){var c=ft(o),l=o.label,u=ft(l);if(l.parent){var p,d=at(o);switch(a){case"top":p={x:c.x,y:d.top-Ds-l.height/2};break;case"left":p={x:d.left-Ds-l.width/2,y:c.y};break;case"bottom":p={x:c.x,y:d.bottom+Ds+l.height/2};break;case"right":p={x:d.right+Ds+l.width/2,y:c.y}}var y=Rn(p,u);e.moveShape(l,y)}}(i,r)}}Q.call(this,t),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(i){var r=i.context,o=r.connection,a=o.source,c=o.target;(r.hints||{}).createElementsBehavior!==!1&&(n(a),n(c))}),this.postExecuted(["label.create"],function(i){var r=i.context,o=r.shape;(r.hints||{}).createElementsBehavior!==!1&&n(o.labelTarget)}),this.postExecuted(["elements.create"],function(i){var r=i.context,o=r.elements;(r.hints||{}).createElementsBehavior!==!1&&o.forEach(function(a){n(a)})})}function Av(t,e){return ye(e,t,5)}function Iu(t,e,n){Q.call(this,t),this.preExecute("shape.append",function(i){var r=i.source,o=i.shape;i.position||(A(o,"bpmn:TextAnnotation")?i.position={x:r.x+r.width/2+75,y:r.y-50-o.height/2}:i.position={x:r.x+r.width+80+o.width/2,y:r.y+r.height/2})},!0)}function Du(t,e){t.invoke(Q,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape;L(dt(r.incoming.concat(r.outgoing),function(o){return A(o,"bpmn:Association")}),function(o){e.moveConnection(o,{x:0,y:0},i)})},!0)}it(Nu,Q),Nu.$inject=["eventBus","modeling"],it(Iu,Q),Iu.$inject=["eventBus","elementFactory","bpmnRules"],it(Du,Q),Du.$inject=["injector","modeling"];function Bs(t,e){e.invoke(Q,this),this._bpmnReplace=t;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;(r=r.filter(function(o){return kv(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];kv(a,o)&&(i.shapes=[n.replaceShape(a,o)])}},!0)}function kv(t,e){return!ge(t)&&wt(t,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!e}Bs.$inject=["bpmnReplace","injector"],it(Bs,Q),Bs.prototype.replaceShape=function(t,e){var n,i=(n=et(t).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:e};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(t,r,{layoutConnection:!1})};function Bu(t,e,n){function i(r){return dt(r.attachers,function(o){return A(o,"bpmn:BoundaryEvent")})}Q.call(this,t),this.postExecute("connection.create",function(r){var o=r.context.source,a=r.context.target,c=i(a);A(o,"bpmn:EventBasedGateway")&&A(a,"bpmn:ReceiveTask")&&c.length>0&&n.removeElements(c)}),this.postExecute("connection.reconnect",function(r){var o=r.context.oldSource,a=r.context.newSource;A(o,"bpmn:Gateway")&&A(a,"bpmn:EventBasedGateway")&&L(a.outgoing,function(c){var l=c.target,u=i(l);A(l,"bpmn:ReceiveTask")&&u.length>0&&n.removeElements(u)})}),t.on("moddleCopy.canCopyProperty",2e3,function(r){var o=r.parent,a=r.property,c=r.propertyName,l=e.getPropertyDescriptor(o,c);l&&l.isReference&&A(a,"bpmn:RootElement")&&o.set(c,a)})}Bu.$inject=["eventBus","moddle","modeling"],it(Bu,Q);function Ou(t,e,n,i,r){function o(u){return wt(u,["bpmn:ReceiveTask","bpmn:SendTask"])||function(p,d){return gt(d)||(d=[d]),ai(d,function(y){return is(p,y)})}(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){return!!Pt(t.getDefinitions().get("rootElements"),Xe({id:u.id}))}function c(u){return A(u,"bpmn:ErrorEventDefinition")?"errorRef":A(u,"bpmn:EscalationEventDefinition")?"escalationRef":A(u,"bpmn:MessageEventDefinition")?"messageRef":A(u,"bpmn:SignalEventDefinition")?"signalRef":void 0}function l(u){if(wt(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.get("messageRef");var p=u.get("eventDefinitions")[0];return p.get(c(p))}n.invoke(Q,this),this.executed("shape.create",function(u){var p=u.shape;if(o(p)){var d=l(et(p));d&&!a(d)&&(Jt(t.getDefinitions().get("rootElements"),d),u.addedRootElement=d)}},!0),this.reverted("shape.create",function(u){var p=u.addedRootElement;p&&Yt(t.getDefinitions().get("rootElements"),p)},!0),e.on("copyPaste.copyElement",function(u){var p=u.descriptor,d=u.element;if(o(d)){var y=l(et(d));y&&(p.referencedRootElement=y)}}),e.on("copyPaste.pasteElement",500,function(u){var p=u.descriptor,d=p.businessObject;if(o(d)){var y=p.referencedRootElement;y&&(a(y)||(y=i.copyElement(y,r.create(y.$type))),function(f,v){if(wt(f,["bpmn:ReceiveTask","bpmn:SendTask"]))return f.set("messageRef",v);var g=f.get("eventDefinitions")[0];g.set(c(g),v)}(d,y))}})}function Lu(t){t.invoke(Q,this),this.preExecute("shape.create",1500,function(e){var n=e.context,i=n.parent,r=n.shape;A(i,"bpmn:Lane")&&!A(r,"bpmn:Lane")&&(n.parent=ms(i,"bpmn:Participant"))})}Ou.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],it(Ou,Q),Lu.$inject=["injector"],it(Lu,Q);var Os=1500;function Pv(t,e,n){e.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],Os,function(i){var r=i.context.shape||i.shape,o=i.hover;A(o,"bpmn:Lane")&&!wt(r,["bpmn:Lane","bpmn:Participant"])&&(i.hover=mn(o),i.hoverGfx=t.getGraphics(i.hover));var a=n.getRootElement();o!==a&&(r.labelTarget||A(r,"bpmn:Group"))&&(i.hover=a,i.hoverGfx=t.getGraphics(i.hover))}),e.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],Os,function(i){var r=i.hover;A(r,"bpmn:Lane")&&(i.hover=mn(r)||r,i.hoverGfx=t.getGraphics(i.hover))}),e.on(["bendpoint.move.hover"],Os,function(i){var r=i.context,o=i.hover,a=r.type;A(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=mn(o)||o,i.hoverGfx=t.getGraphics(i.hover))}),e.on(["connect.start"],Os,function(i){var r=i.context,o=r.start;A(o,"bpmn:Lane")&&(r.start=mn(o)||o)}),e.on("shape.move.start",2e3,function(i){var r=i.shape;A(r,"bpmn:Lane")&&(i.shape=mn(r)||r)})}function ju(t,e,n){Q.call(this,t),this.preExecute("shape.create",function(i){var r=i.context.shape;if(A(r,"bpmn:DataObjectReference")&&r.type!=="label"){var o=e.create("bpmn:DataObject");r.businessObject.dataObjectRef=o}})}Pv.$inject=["elementRegistry","eventBus","canvas"],ju.$inject=["eventBus","bpmnFactory","moddle"],it(ju,Q);var Vu=20,Fu=20,Mv=30,Ls=2e3;function zu(t,e,n){function i(r){var o,a=r.parent,c=t.getRootElement();A(c,"bpmn:Collaboration")?o=c:(o=n.makeCollaboration(),r.process=a),r.parent=o}Q.call(this,e),e.on(["create.start","shape.move.start"],Ls,function(r){var o=r.context,a=o.shape,c=t.getRootElement();if(A(a,"bpmn:Participant")&&A(c,"bpmn:Process")&&c.children.length){var l=c.children.filter(function(d){return!A(d,"bpmn:Group")&&!ge(d)&&!function(y){return!!y.waypoints}(d)});if(l.length){var u=ve(l),p=function(d,y){y={width:y.width+2*Vu+Mv,height:y.height+2*Fu};var f=Math.max(d.width,y.width),v=Math.max(d.height,y.height);return{x:-f/2,y:-v/2,width:f,height:v}}(a,u);z(a,p),o.createConstraints=function(d,y){return y=at(y),{bottom:y.top+d.height/2-Fu,left:y.right-d.width/2+Vu,top:y.bottom-d.height/2+Fu,right:y.left+d.width/2-Vu-Mv}}(a,u)}}}),e.on("create.start",Ls,function(r){var o=r.context.shape,a=t.getRootElement(),c=t.getGraphics(a);function l(u){u.element=a,u.gfx=c}A(o,"bpmn:Participant")&&A(a,"bpmn:Process")&&(e.on("element.hover",Ls,l),e.once("create.cleanup",function(){e.off("element.hover",l)}))}),this.preExecute("shape.create",function(r){var o=r.parent;A(r.shape,"bpmn:Participant")&&A(o,"bpmn:Process")&&i(r)},!0),this.execute("shape.create",function(r){var o=r.process,a=r.shape;o&&(r.oldProcessRef=a.businessObject.processRef,a.businessObject.processRef=o.businessObject)},!0),this.revert("shape.create",function(r){var o=r.process,a=r.shape;o&&(a.businessObject.processRef=r.oldProcessRef)},!0),this.postExecute("shape.create",function(r){var o=r.process,a=r.shape;if(o){var c=o.children.slice();n.moveElements(c,{x:0,y:0},a)}},!0),this.preExecute("elements.create",Ls,function(r){var o,a=r.elements,c=r.parent;js(a)&&A(c,"bpmn:Process")&&(i(r),o=js(a),r.oldProcessRef=o.businessObject.processRef,o.businessObject.processRef=c.businessObject)},!0),this.revert("elements.create",function(r){var o=r.elements;r.process&&(js(o).businessObject.processRef=r.oldProcessRef)},!0),this.postExecute("elements.create",function(r){var o,a=r.elements,c=r.process;if(c){o=js(a);var l=c.children.slice();n.moveElements(l,{x:0,y:0},o)}},!0)}function js(t){return Pt(t,function(e){return A(e,"bpmn:Participant")})}zu.$inject=["canvas","eventBus","modeling"],it(zu,Q);var Rv="__targetRef_placeholder";function $u(t,e){function n(o,a){var c=o.get("properties"),l=Pt(c,function(u){return u.name===Rv});return!l&&a&&Jt(c,l=e.create("bpmn:Property",{name:Rv})),l}function i(o,a){var c=n(o);c&&(function(l,u,p){return Pt(l.get("dataInputAssociations"),function(d){return d!==p&&d.targetRef===u})}(o,c,a)||Yt(o.get("properties"),c))}function r(o){var a,c=o.context,l=c.connection,u=l.businessObject,p=l.target,d=p&&p.businessObject,y=c.newTarget,f=y&&y.businessObject,v=c.oldTarget||c.target,g=v&&v.businessObject,b=l.businessObject;g&&g!==d&&i(g,u),f&&f!==d&&i(f,u),d?(a=n(d,!0),b.targetRef=a):b.targetRef=null}Q.call(this,t),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Nv(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Nv(r))}function Nv(t){return function(e){if(A(e.context.connection,"bpmn:DataInputAssociation"))return t(e)}}function Vs(t){this._bpmnUpdater=t}function Gu(t,e,n,i){function r(a){return a.children.filter(function(c){return A(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function o(a,c){var l=a.businessObject||a;if(c=c||n.filter(function(p){return A(p,"bpmn:Participant")&&et(p).processRef})[0]){var u=c.businessObject||c;e.execute("dataStore.updateContainment",{dataStoreBo:l,newSemanticParent:u.processRef||u,newDiParent:u.di})}}Q.call(this,i),e.registerHandler("dataStore.updateContainment",Vs),this.preExecute("shape.create",function(a){var c=a.context,l=c.shape;A(l,"bpmn:DataStoreReference")&&l.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(a){var c=a.context,l=c.shapes;l.filter(function(u){return A(u,"bpmn:DataStoreReference")}).length&&(c.hints||(c.hints={}),c.hints.autoResize=l.filter(function(u){return!A(u,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(a){var c=a.context.shape,l=c.parent;A(c,"bpmn:DataStoreReference")&&c.type!=="label"&&A(l,"bpmn:Collaboration")&&o(c)}),this.postExecute("shape.move",function(a){var c=a.context,l=c.shape,u=c.oldParent,p=l.parent;A(u,"bpmn:Collaboration")||A(l,"bpmn:DataStoreReference")&&l.type!=="label"&&A(p,"bpmn:Collaboration")&&o(l,A(u,"bpmn:Participant")?u:function(d,y){for(;d.parent;){if(A(d.parent,y))return d.parent;d=d.parent}}(u,"bpmn:Participant"))}),this.postExecute("shape.delete",function(a){var c=a.context.shape,l=t.getRootElement();wt(c,["bpmn:Participant","bpmn:SubProcess"])&&A(l,"bpmn:Collaboration")&&r(l).filter(function(u){return function(p,d){for(var y=p.businessObject||p,f=d.businessObject||d;y.$parent;){if(y.$parent===f.processRef||f)return!0;y=y.$parent}return!1}(u,c)}).forEach(function(u){o(u)})}),this.postExecute("canvas.updateRoot",function(a){var c=a.context,l=c.oldRoot,u=c.newRoot;r(l).forEach(function(p){A(u,"bpmn:Process")&&o(p,u)})})}$u.$inject=["eventBus","bpmnFactory"],it($u,Q),Vs.$inject=["bpmnUpdater"],Vs.prototype.execute=function(t){var e=t.dataStoreBo,n=t.newSemanticParent,i=t.newDiParent;t.oldSemanticParent=e.$parent,t.oldDiParent=e.di.$parent,this._bpmnUpdater.updateSemanticParent(e,n),this._bpmnUpdater.updateDiParent(e.di,i)},Vs.prototype.revert=function(t){var e=t.dataStoreBo,n=t.oldSemanticParent,i=t.oldDiParent;this._bpmnUpdater.updateSemanticParent(e,n),this._bpmnUpdater.updateDiParent(e.di,i)},Gu.$inject=["canvas","commandStack","elementRegistry","eventBus"],it(Gu,Q);function Uu(t,e,n){Q.call(this,t),this.postExecuted("shape.delete",500,function(i){var r=i.context,o=r.hints,a=r.shape,c=r.oldParent;A(a,"bpmn:Lane")&&(o&&o.nested||function(l,u){var p,d,y,f=oi(u),v=[],g=[];Fi(f,function(b){return b.y>l.y?g.push(b):v.push(b),b.children}),f.length&&(p=g.length&&v.length?l.height/2:l.height,v.length&&(d=n.calculateAdjustments(v,"y",p,l.y-10),n.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:p},"s")),g.length&&(y=n.calculateAdjustments(g,"y",-p,l.y+l.height+10),n.makeSpace(y.movingShapes,y.resizingShapes,{x:0,y:-p},"n")))}(a,c))})}Uu.$inject=["eventBus","modeling","spaceTool"],it(Uu,Q);function Fs(t,e){e.invoke(Q,this),this._bpmnReplace=t;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;r.filter(function(o){return Iv(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;Iv(a,(l=u,r.indexOf(l)!==-1?u:o))&&(r[c]=n.replaceShape(a))})},!0)}function Iv(t,e){return!ge(t)&&A(t,"bpmn:BoundaryEvent")&&!e}function Hu(t,e,n){function i(r,o,a){var c,l,u,p,d,y,f,v,g=o.waypoints,b=r.outgoing.slice(),S=r.incoming.slice(),w=mu(g,v=pt(a.width)?ft(a):a);if(w){if(c=g.slice(0,w.index),l=g.slice(w.index+(w.bendpoint?1:0)),!c.length||!l.length)return;u=w.bendpoint?g[w.index]:v,c.length!==1&&Dv(r,c[c.length-1])||c.push(Bv(u)),l.length!==1&&Dv(r,l[0])||l.unshift(Bv(u))}p=o.source,d=o.target,e.canConnect(p,r,o)&&(n.reconnectEnd(o,r,c||v),y=o),e.canConnect(r,d,o)&&(y?f=n.connect(r,d,{type:o.type,waypoints:l}):(n.reconnectStart(o,r,l||v),f=o));var _=[].concat(y&&dt(S,function(C){return C.source===y.source})||[],f&&dt(b,function(C){return C.target===f.target})||[]);_.length&&n.removeElements(_)}Q.call(this,t),this.preExecute("elements.move",function(r){var o=r.newParent,a=r.shapes,c=r.delta,l=a[0];if(l&&o){o&&o.waypoints&&(r.newParent=o=o.parent);var u=ft(l),p={x:u.x+c.x,y:u.y+c.y},d=Pt(o.children,function(y){return e.canInsert(a,y)&&mu(y.waypoints,p)});d&&(r.targetFlow=d,r.position=p)}},!0),this.postExecuted("elements.move",function(r){var o=r.shapes,a=r.targetFlow,c=r.position;a&&i(o[0],a,c)},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;e.canInsert(a,o)&&(r.targetFlow=o,r.parent=o.parent)},!0),this.postExecuted("shape.create",function(r){var o=r.shape,a=r.targetFlow,c=r.position;a&&i(o,a,c)},!0)}function Dv(t,e){var n=e.x,i=e.y;return n>=t.x&&n<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function Bv(t){return z({},t)}function qu(t,e){Q.call(this,t),this.preExecuted("connection.create",function(n){var i=n.context,r=i.source,o=i.target,a=o.incoming.slice();i.hints&&i.hints.createElementsBehavior===!1||A(r,"bpmn:EventBasedGateway")&&o.incoming.length&&a.filter(Wu).forEach(function(c){e.removeConnection(c)})}),this.preExecuted("shape.replace",function(n){var i=n.context.newShape;A(i,"bpmn:EventBasedGateway")&&i.outgoing.filter(Wu).map(function(r){return r.target}).reduce(function(r,o){var a=o.incoming.filter(Wu);return r.concat(a)},[]).forEach(function(r){r.source!==i&&e.removeConnection(r)})})}function Wu(t){return A(t,"bpmn:SequenceFlow")}Fs.$inject=["bpmnReplace","injector"],it(Fs,Q),Fs.prototype.replaceShape=function(t){var e,n,i=(n=et(t).eventDefinitions)&&n[0];return e=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(t,e,{layoutConnection:!1})},it(Hu,Q),Hu.$inject=["eventBus","bpmnRules","modeling"],qu.$inject=["eventBus","modeling"],it(qu,Q);function Xu(t,e,n,i,r,o){function a(){return et(e.getRootElement()).$parent}function c(l){var u=et(l).categoryValueRef;if(u){var p=u.$parent;u&&(Yt(p.categoryValue,u),p&&!p.categoryValue.length&&function(d){Yt(a().get("rootElements"),d)}(p))}}r.invoke(Q,this),this.executed("shape.delete",function(l){var u,p=l.context.shape;if(A(p,"bpmn:Group")){var d=et(p).categoryValueRef,y=n.filter(function(f){return A(f,"bpmn:Group")});u=d,y.some(function(f){var v=et(f);return v.categoryValueRef&&v.categoryValueRef===u})||c(p)}}),this.reverted("shape.delete",function(l){var u=l.context.shape;if(A(u,"bpmn:Group")){var p=et(u).categoryValueRef,d=a(),y=p?p.$parent:null;Jt(y.get("categoryValue"),p),Jt(d.get("rootElements"),y)}}),this.execute("shape.create",function(l){var u=et(l.context.shape);if(A(u,"bpmn:Group")&&!u.categoryValueRef){var p=Pu(a(),t);u.categoryValueRef=p}}),this.revert("shape.create",function(l){var u=l.context.shape;A(u,"bpmn:Group")&&(c(u),delete et(u).categoryValueRef)}),i.on("moddleCopy.canCopyProperty",2e3,function(l){var u,p=l.property;if(A(p,"bpmn:CategoryValue"))return u=Pu(a(),t),o.copyElement(p,u)})}function Ku(t,e,n,i){var r,o,a,c;return(r=(i.y-n.y)*(e.x-t.x)-(i.x-n.x)*(e.y-t.y))==0?null:(o=t.y-n.y,a=t.x-n.x,c=((i.x-n.x)*o-(i.y-n.y)*a)/r,{x:Math.round(t.x+c*(e.x-t.x)),y:Math.round(t.y+c*(e.y-t.y))})}function Ov(t){function e(n,i,r){var o,a={x:r.x,y:r.y-50},c={x:r.x-50,y:r.y},l=Ku(n,i,r,a),u=Ku(n,i,r,c);o=l&&u?Lv(l,r)>Lv(u,r)?u:l:l||u,n.original=o}t.on("bpmnElement.added",function(n){var i,r,o=n.element;o.waypoints&&(e((r=(i=o).waypoints)[0],r[1],ft(i.source)),e(r[r.length-1],r[r.length-2],ft(i.target)))})}function Lv(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Yu(t){Q.call(this,t);var e=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=et(n.context.shape);wt(i,e)&&!i.di.get("isHorizontal")&&i.di.set("isHorizontal",!0)})}function jv(t){return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}function Vv(t){return Math.atan((t[1].y-t[0].y)/(t[1].x-t[0].x))}function Fv(t,e){var n=e[0],i=e[1],r={x:i.x-n.x,y:i.y-n.y},o=function(a,c,l){var u=[{n:a[0]-l[0],lambda:c[0]},{n:a[1]-l[1],lambda:c[1]}];return-(u[0].n*c[0]+u[1].n*c[1])/(u[0].lambda*c[0]+u[1].lambda*c[1])}([n.x,n.y],[r.x,r.y],[t.x,t.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function __(t,e){var n=Fv(t,e);return jv({x:n.x-t.x,y:n.y-t.y})}function zs(t,e){return jv({x:t.x-e.x,y:t.y-e.y})}Xu.$inject=["bpmnFactory","canvas","elementRegistry","eventBus","injector","moddleCopy"],it(Xu,Q),Ov.$inject=["eventBus"],Yu.$inject=["eventBus"],it(Yu,Q);var zv=Math.sqrt,$v=Math.min,w_=Math.max,Gv=Math.abs;function Uv(t){return Math.pow(t,2)}function Yo(t,e){return zv(Uv(t.x-e.x)+Uv(t.y-e.y))}function S_(t,e,n,i){var r=e.x-t.x,o=e.y-t.y,a=n.x-t.x,c=n.y-t.y,l=r*r+o*o,u=(r*a+o*c)/l,p=u*u-(a*a+c*c-i*i)/l;if(p<0&&p>-1e-6&&(p=0),p<0)return[];var d=zv(p),y=-u+d,f=-u-d,v={x:t.x-r*y,y:t.y-o*y};return p===0?[v]:[v,{x:t.x-r*f,y:t.y-o*f}].filter(function(g){return function(b,S,w){return Hv(b.x,S.x,w.x)&&Hv(b.y,S.y,w.y)}(g,t,e)})}function Hv(t,e,n){return t>=$v(e,n)-$s&&t<=w_(e,n)+$s}var $s=.1;function qv(t,e){return Gv(t.x-e.x)<=$s&&Gv(t.y-e.y)<=$s}function C_(t,e,n,i){var r=0,o=0,a=function(T){return{x:T.x+T.width/2,y:T.y+T.height/2}}(t),c=function(T,M){var I,$,P,x,N,j,G,X,tt,rt,st,H,q=0;for(q=0;q<M.length-1;q++){if(qv(I=M[q],$=M[q+1])?j=[I]:(P=Yo(T,I),x=Yo(T,$),j=S_(I,$,T,$v(P,x))),j.length<1)throw new Error("expected between [1, 2] circle -> line intersections");j.length===1&&(G={type:"bendpoint",position:j[0],segmentIndex:q,bendpointIndex:qv(I,j[0])?q:q+1}),j.length===2&&(st=j[0],H=j[1],G={type:"segment",position:N={x:(st.x+H.x)/2,y:(st.y+H.y)/2},segmentIndex:q,relativeLocation:Yo(I,N)/Yo(I,$)}),X=Yo(G.position,T),(!rt||tt>X)&&(rt=G,tt=X)}return rt}(a,n),l=c.segmentIndex,u=function(T,M,I,$){var P=I.segmentIndex,x=M.length-T.length;if($.segmentMove){var N=$.segmentMove.segmentStartIndex,j=$.segmentMove.newSegmentStartIndex;return P===N?j:P>=j?P+x<j?j:P+x:P}if($.bendpointMove){var G,X=$.bendpointMove.insert,tt=$.bendpointMove.bendpointIndex;return x===0?P:(P>=tt&&(G=X?P+1:P-1),P<tt&&(G=P,X&&I.type!=="bendpoint"&&tt-1===P&&Wv(M,tt)<I.relativeLocation&&G++),G)}return x===0?P:$.connectionStart?P===0?0:null:$.connectionEnd&&P===T.length-2?M.length-2:null}(n,e,c,i);if(u===null)return{x:r,y:o};if(u<0||u>e.length-2)return{x:r,y:o};var p,d,y=Xv(n,l),f=Xv(e,u),v=c.position,g=function(T,M){var I=zs(T[0],T[1]),$=zs(T[0],M);return I===0?0:$/I}(y,v),b=(p=f,d=Vv(y),Vv(p)-d);if(c.type==="bendpoint"){var S=e.length-n.length,w=c.bendpointIndex,_=n[w];if(e.indexOf(_)!==-1)return{x:r,y:o};if(S===0){var C=e[w];return{x:C.x-c.position.x,y:C.y-c.position.y}}S<0&&w!==0&&w<n.length-1&&(g=Wv(n,w))}var B,s,h=(f[1].x-f[0].x)*g+f[0].x,m=(f[1].y-f[0].y)*g+f[0].y,E=(B={x:a.x-v.x,y:a.y-v.y},(s=b)?{x:Math.cos(s)*B.x-Math.sin(s)*B.y,y:Math.sin(s)*B.x+Math.cos(s)*B.y}:B);return zi({x:r=h+E.x-a.x,y:o=m+E.y-a.y})}function Wv(t,e){var n=zs(t[e-1],t[e]);return n/(n+zs(t[e],t[e+1]))}function Xv(t,e){return[t[e],t[e+1]]}function Jo(t,e,n){var i=Do(e),r=Do(n),o=Rn(t,i),a=o.x*(n.width/e.width),c=o.y*(n.height/e.height);return zi({x:r.x+a,y:r.y+c})}function Kv(t,e,n){var i=Do(t),r=Do(e),o=Do(n),a=Rn(t,i),c=Rn(i,r),l=function(f,v,g){var b=at(v),S=at(g);if(function(s,h){return function(m,E){return m.right!==E.right&&m.left!==E.left}(s,h)||function(m,E){return m.top!==E.top&&m.bottom!==E.bottom}(s,h)}(b,S))return null;var w,_,C,B=ye(v,f);if(B==="top")w={x:0,y:S.bottom-b.bottom};else if(B==="bottom")w={x:0,y:S.top-b.top};else if(B==="right")w={x:S.left-b.left,y:0};else{if(B!=="left")return null;w={x:S.right-b.right,y:0}}return _={x:f.x+w.x,y:f.y+w.y},C=ye(g,_),C!==B?null:w}(i,e,n);if(l)return l;var u=c.x*(n.width/e.width),p=c.y*(n.height/e.height),d=o.x+u,y=o.y+p;return zi({x:d+a.x-t.x,y:y+a.y-t.y})}var T_={width:90,height:20},Yv="name",Jv="text";function Ju(t,e,n,i){Q.call(this,t),this.postExecute("element.updateProperties",function(r){var o=r.context,a=o.element,c=o.properties;if(Yv in c&&e.updateLabel(a,c[Yv]),Jv in c&&A(a,"bpmn:TextAnnotation")){var l=i.getTextAnnotationBounds({x:a.x,y:a.y,width:a.width,height:a.height},c[Jv]||"");e.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(!ge(a)&&Rr(a)&&un(a)){var l=ss(a),u=i.getExternalLabelBounds(T_,un(a));e.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&&e.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,d=p.label,y=z({},u.hints),f=u.newWaypoints||p.waypoints,v=u.oldWaypoints;return y.startChanged===void 0&&(y.startChanged=!!y.connectionStart),y.endChanged===void 0&&(y.endChanged=!!y.connectionEnd),C_(d,f,v,y)}(r),e.moveShape(c,a))}}),this.postExecute(["shape.replace"],function(r){var o=r.context,a=o.newShape,c=o.oldShape,l=et(a);l&&Rr(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(as(c)){var p=c.label,d=A_(function(y,f){if(f.length){var v=function(g,b){var S=b.map(function(w){return{line:w,distance:__(g,w)}});return We(S,"distance")[0].line}(y,f);return Fv(y,v)}}(ft(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);e.moveShape(p,d)}})}function A_(t,e,n){return zi(Rn(Jo(t,e,n),t))}function Gs(t,e,n){var i=Hs(t),r=Qv(i,e),o=i[0];return r.length?r[r.length-1]:Jo(o.original||o,n,e)}function Us(t,e,n){var i=Hs(t),r=Qv(i,e),o=i[i.length-1];return r.length?r[0]:Jo(o.original||o,n,e)}function Zu(t,e,n){var i=Hs(t),r=Zv(e,n),o=i[0];return Jo(o.original||o,r,e)}function Qu(t,e,n){var i=Hs(t),r=Zv(e,n),o=i[i.length-1];return Jo(o.original||o,r,e)}function Zv(t,e){return{x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height}}function Hs(t){var e=t.waypoints;if(!e.length)throw new Error("connection#"+t.id+": no waypoints");return e}function Qv(t,e){return dt(le(t,k_),function(n){return function(i,r){return ye(r,i,1)==="intersect"}(n,e)})}function k_(t){return t.original||t}function tp(t,e){Q.call(this,t),this.postExecute("shape.replace",function(n){var i=n.oldShape,r=n.newShape;if(function(p,d){return A(p,"bpmn:Participant")&&Mt(p)&&A(d,"bpmn:Participant")&&!Mt(d)}(i,r)){var o,a,c,l,u=(a=Va([o=i],!1),c=[],l=[],a.forEach(function(p){p!==o&&(p.incoming.forEach(function(d){A(d,"bpmn:MessageFlow")&&c.push(d)}),p.outgoing.forEach(function(d){A(d,"bpmn:MessageFlow")&&l.push(d)}))},[]),{incoming:c,outgoing:l});u.incoming.forEach(function(p){var d=Us(p,r,i);e.reconnectEnd(p,r,d)}),u.outgoing.forEach(function(p){var d=Gs(p,r,i);e.reconnectStart(p,r,d)})}},!0)}it(Ju,Q),Ju.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],tp.$inject=["eventBus","modeling"],it(tp,Q);function ty(t,e,n){t.on(["shape.move.rejected","create.rejected"],function(i){var r,o,a,c=i.context,l=c.shape;A(c.target,"bpmn:Collaboration")&&A(l,"bpmn:FlowNode")&&(r=i,o=n("flow elements must be children of pools/participants"),e.add({position:{x:r.x+5,y:r.y+5},type:"error",timeout:a||2e3,html:"<div>"+o+"</div>"}))})}function ep(t,e,n,i){Q.call(this,t);var r=i.get("dragging",!1);function o(a){var c,l,u=a.source,p=a.target;a.parent&&(A(a,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(u,p)||(l=!0),n.canConnectMessageFlow(u,p)&&(c="bpmn:MessageFlow")),A(a,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(u,p)||(l=!0),n.canConnectSequenceFlow(u,p)&&(c="bpmn:SequenceFlow")),A(a,"bpmn:Association")&&!n.canConnectAssociation(u,p)&&(l=!0),l&&e.removeConnection(a),c&&e.connect(u,p,{type:c,waypoints:a.waypoints.slice()}))}this.postExecuted("elements.move",function(a){L(a.closure.allConnections,o)},!0),this.preExecute("connection.reconnect",function(a){var c,l,u=a.context,p=u.connection,d=u.newSource||p.source,y=u.newTarget||p.target;(c=n.canConnect(d,y))&&c.type!==p.type&&(l=e.connect(d,y,{type:c.type,waypoints:p.waypoints.slice()}),e.removeConnection(p),u.connection=l,r&&function(f,v){var g,b=r.context(),S=b&&b.payload.previousSelection;!S||!S.length||(g=S.indexOf(f),g!==-1&&S.splice(g,1,v))}(p,l))}),this.postExecuted("element.updateProperties",function(a){var c,l=a.context,u=l.properties,p=l.element,d=p.businessObject;u.default&&(c=Pt(p.outgoing,Xe({id:p.businessObject.default.id})))&&e.updateProperties(c,{conditionExpression:void 0}),u.conditionExpression&&d.sourceRef.default===d&&e.updateProperties(p.source,{default:void 0})})}function np(t,e){Q.call(this,t),this.preExecute("shape.delete",function(n){var i=n.shape,r=i.parent;A(i,"bpmn:Participant")&&(n.collaborationRoot=r)},!0),this.postExecute("shape.delete",function(n){var i=n.collaborationRoot;i&&!i.businessObject.participants.length&&e.makeProcess()},!0)}function qs(t,e,n,i,r,o){i.invoke(Q,this),this._bpmnReplace=t,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var c=a.context,l=c.parent,u=c.elements,p=e.canReplace(u,l);p&&this.replaceElements(u,p.replacements)},this),this.postExecuted(["elements.move"],500,function(a){var c=a.context,l=c.newParent,u=c.newHost,p=[];L(c.closure.topLevel,function(y){p=Ne(y)?p.concat(y.children):p.concat(y)}),p.length===1&&u&&(l=u);var d=e.canReplace(p,l);d&&this.replaceElements(p,d.replacements,u)},this),this.postExecute(["shape.replace"],1500,function(a){var c,l=a.context,u=l.oldShape,p=l.newShape,d=u.attachers;d&&d.length&&(c=e.canReplace(d,p),this.replaceElements(d,c.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var c=a.context,l=c.oldShape,u=c.newShape;r.unclaimId(l.businessObject.id,l.businessObject),r.updateProperties(u,{id:l.id})})}ty.$inject=["eventBus","tooltips","translate"],it(ep,Q),ep.$inject=["eventBus","modeling","bpmnRules","injector"],np.$inject=["eventBus","modeling"],it(np,Q),it(qs,Q),qs.prototype.replaceElements=function(t,e){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;L(e,function(o){var a={type:o.newElementType},c=n.get(o.oldElementId),l=t.indexOf(c);t[l]=i.replaceElement(c,a,{select:!1})}),e&&r.select(t)},qs.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var Ji={width:300,height:60},Zo={width:300,height:150},ey={width:140,height:120},ny={width:50,height:30};function iy(t){t.on("resize.start",1500,function(e){var n=e.context,i=n.shape,r=n.direction,o=n.balanced;(A(i,"bpmn:Lane")||A(i,"bpmn:Participant"))&&(n.resizeConstraints=function(a,c,l){var u=mn(a),p=!0,d=!0,y=Ps(u,[u]),f=at(a),v={},g={};return/e/.test(c)?g.right=f.left+Ji.width:/w/.test(c)&&(g.left=f.right-Ji.width),y.forEach(function(b){var S=at(b);/n/.test(c)&&(S.top<f.top-10&&(p=!1),l&&Ws(f.top-S.bottom)<10&&Ks(v,"top",S.top+Ji.height),Ws(f.top-S.top)<5&&Xs(g,"top",S.bottom-Ji.height)),/s/.test(c)&&(S.bottom>f.bottom+10&&(d=!1),l&&Ws(f.bottom-S.top)<10&&Xs(v,"bottom",S.bottom-Ji.height),Ws(f.bottom-S.bottom)<5&&Ks(g,"bottom",S.top+Ji.height))}),u.children.filter(function(b){return!b.hidden&&!b.waypoints&&(A(b,"bpmn:FlowElement")||A(b,"bpmn:Artifact"))}).forEach(function(b){var S=at(b);p&&/n/.test(c)&&Xs(g,"top",S.top-I_),/e/.test(c)&&Ks(g,"right",S.right+R_),d&&/s/.test(c)&&Ks(g,"bottom",S.bottom+D_),/w/.test(c)&&Xs(g,"left",S.left-N_)}),{min:g,max:v}}(i,r,o)),A(i,"bpmn:Participant")&&(n.minDimensions=Zo),A(i,"bpmn:SubProcess")&&Mt(i)&&(n.minDimensions=ey),A(i,"bpmn:TextAnnotation")&&(n.minDimensions=ny)})}iy.$inject=["eventBus"];var Ws=Math.abs,P_=Math.min,M_=Math.max;function ry(t,e,n,i){var r=t[e];t[e]=r===void 0?n:i(n,r)}function Xs(t,e,n){return ry(t,e,n,P_)}function Ks(t,e,n){return ry(t,e,n,M_)}var R_=20,N_=50,I_=20,D_=20;function oy(t,e){t.on("resize.start",1501,function(n){var i=n.context,r=i.shape;(A(r,"bpmn:Lane")||A(r,"bpmn:Participant"))&&(i.balanced=!Ir(n))}),t.on("resize.end",1001,function(n){var i=n.context,r=i.shape,o=i.canExecute,a=i.newBounds;if(A(r,"bpmn:Lane")||A(r,"bpmn:Participant"))return o&&(a=Nd(a),e.resizeLane(r,a,i.balanced)),!1})}function ip(t,e,n){Q.call(this,t),this.preExecute("shape.delete",function(i){var r=i.context.shape;if(r.incoming.length===1&&r.outgoing.length===1){var o=r.incoming[0],a=r.outgoing[0];if(A(o,"bpmn:SequenceFlow")&&A(a,"bpmn:SequenceFlow")&&e.canConnect(o.source,a.target,o)){var c=function(l,u){var p=Ku(zr(l[l.length-2]),zr(l[l.length-1]),zr(u[1]),zr(u[0]));return p?[].concat(l.slice(0,l.length-1),[p],u.slice(1)):[zr(l[0]),zr(u[u.length-1])]}(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,c)}}})}function zr(t){return t.original||t}oy.$inject=["eventBus","modeling"],it(ip,Q),ip.$inject=["eventBus","bpmnRules","modeling"];var B_=Math.max;function ay(t){t.on("spaceTool.getMinDimensions",function(e){var n=e.shapes,i=e.axis,r=e.start,o={};return L(n,function(a){var c=a.id;A(a,"bpmn:Participant")&&(function(l){return l==="x"}(i)?o[c]=Zo:o[c]={width:Zo.width,height:O_(a,r)}),A(a,"bpmn:SubProcess")&&Mt(a)&&(o[c]=ey),A(a,"bpmn:TextAnnotation")&&(o[c]=ny)}),o})}function O_(t,e){var n;return oi(t).length?(n=function(i,r){var o,a=oi(i);return o=sy(a,r),i.height-o.height+Ji.height}(t,e),B_(Zo.height,n)):Zo.height}function sy(t,e){var n,i,r;for(n=0;n<t.length;n++)if(e>=(i=t[n]).y&&e<=i.y+i.height)return(r=oi(i)).length?sy(r,e):i}function rp(t,e){t.invoke(Q,this),this.postExecuted("shape.replace",function(n){var i=n.context.oldShape,r=n.context.newShape;if(A(r,"bpmn:SubProcess")&&A(i,"bpmn:Task")&&Mt(r)){var o,a={x:(o=r).x+o.width/6,y:o.y+o.height/2};e.createShape({type:"bpmn:StartEvent"},a,r)}})}ay.$inject=["eventBus"],rp.$inject=["injector","modeling"],it(rp,Q);function op(t,e,n,i){Q.call(this,t),this.executed(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape;A(a,"bpmn:SubProcess")&&(a.collapsed?et(a).di.isExpanded=!1:((o=a.children).length&&o.forEach(function(c){c.type!=="label"||c.businessObject.name||(c.hidden=!0)}),et(a).di.isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],500,function(r){var o=r.context.shape;o.collapsed?et(o).di.isExpanded=!1:et(o).di.isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape,c=e._getDefaultSize(a);o=a.collapsed?function(l,u){return{x:l.x+(l.width-u.width)/2,y:l.y+(l.height-u.height)/2,width:u.width,height:u.height}}(a,c):function(l,u){var p,d,y=l.children,f=u;return(p=nv((d=y,d.filter(function(v){return!v.hidden})).concat([l])))?(f.width=Math.max(p.width,f.width),f.height=Math.max(p.height,f.height),f.x=p.x+(p.width-f.width)/2,f.y=p.y+(p.height-f.height)/2):(f.x=l.x+(l.width-f.width)/2,f.y=l.y+(l.height-f.height)/2),f}(a,c),n.resizeShape(a,o,null,{autoResize:!a.collapsed&&"nwse"})})}function ap(t,e,n,i){e.invoke(Q,this),this.preExecute("shape.delete",function(r){var o=r.context.shape,a=o.businessObject;ge(o)||(A(o,"bpmn:Participant")&&Mt(o)&&n.ids.unclaim(a.processRef.id),i.unclaimId(a.id,a))}),this.preExecute("connection.delete",function(r){var o=r.context.connection.businessObject;i.unclaimId(o.id,o)}),this.preExecute("canvas.updateRoot",function(){var r=t.getRootElement().businessObject;n.ids.unclaim(r.id)})}it(op,Q),op.$inject=["eventBus","elementFactory","modeling"],it(ap,Q),ap.$inject=["canvas","injector","moddle","modeling"];function sp(t,e,n){var i;function r(){if(!i)throw new Error(n("out of bounds release"));return i}Q.call(this,t);var o=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(o,5e3,function(a){(i=i||new L_).enter()}),this.postExecuted(o,500,function(a){(function(){if(!i)throw new Error(n("out of bounds release"));var c=i.leave();c&&(e.updateLaneRefs(i.flowNodes,i.lanes),i=null)})()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(a){var c=a.context.shape,l=r();c.labelTarget||(A(c,"bpmn:Lane")&&l.addLane(c),A(c,"bpmn:FlowNode")&&l.addFlowNode(c))})}function L_(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(t){this.lanes.push(t)},this.addFlowNode=function(t){this.flowNodes.push(t)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function cp(t,e){Q.call(this,t),this.preExecute("connection.delete",function(n){var i=n.context.connection,r=i.source;(function(o,a){if(!A(o,"bpmn:SequenceFlow"))return!1;var c=et(a),l=et(o);return c.get("default")===l})(i,r)&&e.updateProperties(r,{default:null})})}sp.$inject=["eventBus","modeling","translate"],it(sp,Q),it(cp,Q),cp.$inject=["eventBus","modeling"];const j_={__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",Nu],appendBehavior:["type",Iu],associationBehavior:["type",Du],attachEventBehavior:["type",Bs],boundaryEventBehavior:["type",Bu],rootElementReferenceBehavior:["type",Ou],createBehavior:["type",Lu],fixHoverBehavior:["type",Pv],createDataObjectBehavior:["type",ju],createParticipantBehavior:["type",zu],dataInputAssociationBehavior:["type",$u],dataStoreBehavior:["type",Gu],deleteLaneBehavior:["type",Uu],detachEventBehavior:["type",Fs],dropOnFlowBehavior:["type",Hu],eventBasedGatewayBehavior:["type",qu],groupBehavior:["type",Xu],importDockingFix:["type",Ov],isHorizontalFix:["type",Yu],labelBehavior:["type",Ju],messageFlowBehavior:["type",tp],modelingFeedback:["type",ty],replaceConnectionBehavior:["type",ep],removeParticipantBehavior:["type",np],replaceElementBehaviour:["type",qs],resizeBehavior:["type",iy],resizeLaneBehavior:["type",oy],removeElementBehavior:["type",ip],toggleElementCollapseBehaviour:["type",op],spaceToolBehavior:["type",ay],subProcessStartEventBehavior:["type",rp],unclaimIdBehavior:["type",ap],updateFlowNodeRefsBehavior:["type",sp],unsetDefaultFlowBehavior:["type",cp]};function cy(t,e){var n=ye(t,e,-15);return n!=="intersect"?n:null}function be(t){gi.call(this,t)}function lp(t){return!t||ge(t)}function ly(t){do{if(A(t,"bpmn:Process"))return et(t);if(A(t,"bpmn:Participant"))return et(t).processRef||et(t)}while(t=t.parent)}function up(t){return A(t,"bpmn:TextAnnotation")}function pp(t){return A(t,"bpmn:Group")&&!t.labelTarget}function hp(t){return A(t,"bpmn:BoundaryEvent")&&Dn(t,"bpmn:CompensateEventDefinition")}function $r(t){return et(t).isForCompensation}function uy(t){for(var e=t;e=e.parent;){if(A(e,"bpmn:FlowElementsContainer"))return et(e);if(A(e,"bpmn:Participant"))return et(e).processRef}return null}function Dn(t,e){return!!Pt(et(t).eventDefinitions||[],function(n){return A(n,e)})}function py(t,e){return(et(t).eventDefinitions||[]).every(function(n){return A(n,e)})}function hy(t){return A(t,"bpmn:ReceiveTask")||A(t,"bpmn:IntermediateCatchEvent")&&(Dn(t,"bpmn:MessageEventDefinition")||Dn(t,"bpmn:TimerEventDefinition")||Dn(t,"bpmn:ConditionalEventDefinition")||Dn(t,"bpmn:SignalEventDefinition"))}function Ys(t){return t.waypoints}function dp(t,e){var n=function(i){for(var r=[];i;)(i=i.parent)&&r.push(i);return r}(e);return n.indexOf(t)!==-1}function Js(t,e,n){if(lp(t)||lp(e))return null;if(!A(n,"bpmn:DataAssociation")){if(xy(t,e))return{type:"bpmn:MessageFlow"};if(Ey(t,e))return{type:"bpmn:SequenceFlow"}}var i=fp(t,e);return i||(hp(t)&&$r(e)?{type:"bpmn:Association",associationDirection:"One"}:!!by(t,e)&&{type:"bpmn:Association"})}function Gr(t,e,n){return!(!ge(t)&&!pp(t))||!(A(e,"bpmn:Participant")&&!Mt(e))&&(A(t,"bpmn:Participant")?A(e,"bpmn:Process")||A(e,"bpmn:Collaboration"):wt(t,["bpmn:DataInput","bpmn:DataOutput"])&&t.parent?e===t.parent:A(t,"bpmn:Lane")?A(e,"bpmn:Participant")||A(e,"bpmn:Lane"):!(A(t,"bpmn:BoundaryEvent")&&!function(i){return et(i).cancelActivity&&(dy(i)||my(i))}(t))&&(A(t,"bpmn:FlowElement")&&!A(t,"bpmn:DataStoreReference")?A(e,"bpmn:FlowElementsContainer")?Mt(e):wt(e,["bpmn:Participant","bpmn:Lane"]):A(t,"bpmn:DataStoreReference")&&A(e,"bpmn:Collaboration")?ai(et(e).get("participants"),function(i){return!!i.get("processRef")}):wt(t,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?wt(e,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!A(t,"bpmn:MessageFlow")&&(A(e,"bpmn:Collaboration")||t.source.parent==e||t.target.parent==e)))}function V_(t){return A(t,"bpmn:Lane")}function F_(t){return!!function(e){return!ge(e)&&A(e,"bpmn:BoundaryEvent")}(t)||!(!A(t,"bpmn:IntermediateThrowEvent")||!dy(t))||A(t,"bpmn:IntermediateCatchEvent")&&my(t)}function dy(t){var e=et(t);return e&&!(e.eventDefinitions&&e.eventDefinitions.length)}function my(t){return fy(t,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function fy(t,e){return e.some(function(n){return Dn(t,n)})}function Qo(t,e,n,i){if(Array.isArray(t)||(t=[t]),t.length!==1)return!1;var r=t[0];return!ge(r)&&!!F_(r)&&!Ne(e)&&!(!A(e,"bpmn:Activity")||$r(e))&&!(i&&!cy(i,e))&&!function(o){return A(o,"bpmn:ReceiveTask")&&Pt(o.incoming,function(a){return A(a.source,"bpmn:EventBasedGateway")})}(e)&&"attach"}function vy(t,e,n){if(!e)return!1;var i={replacements:[]};return L(t,function(r){Ne(e)||A(r,"bpmn:StartEvent")&&r.type!=="label"&&Gr(r,e)&&(function(o){return o&&et(o).isInterrupting!==!1}(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(function(o){return is(o,"bpmn:ErrorEventDefinition")}(r)||function(o){return is(o,"bpmn:EscalationEventDefinition")}(r)||function(o){return is(o,"bpmn:CompensateEventDefinition")}(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),fy(r,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&A(e,"bpmn:SubProcess")&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"})),A(e,"bpmn:Transaction")||Dn(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(A(r,"bpmn:EndEvent")&&Gr(r,e)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),A(r,"bpmn:BoundaryEvent")&&Qo(r,e,0,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),!!i.replacements.length&&i}function yy(t,e){return!ai(t,V_)&&(!e||t.every(function(n){return Gr(n,e)}))}function mp(t,e,n,i){return!!e&&(!(!ge(t)&&!pp(t))||n!==e&&(!n||!dp(n,e))&&(Gr(t,e)||Zs(t,e)))}function gy(t,e){return A(t,"bpmn:SubProcess")?Mt(t)&&(!e||e.width>=100&&e.height>=80):A(t,"bpmn:Lane")?!e||e.width>=130&&e.height>=60:A(t,"bpmn:Participant")?!e||e.width>=250&&e.height>=50:!!up(t)||!!pp(t)}function by(t,e){return!Ys(t)&&!Ys(e)&&(!(!hp(t)||!$r(e))||!dp(e,t)&&!dp(t,e)&&(!!function(n,i){var r=up(n),o=up(i);return(r||o)&&r!==o}(t,e)||!!fp(t,e)))}function xy(t,e){return!(wy(t)&&!wy(e))&&A(i=t,"bpmn:InteractionNode")&&!A(i,"bpmn:BoundaryEvent")&&(!A(i,"bpmn:Event")||A(i,"bpmn:ThrowEvent")&&py(i,"bpmn:MessageEventDefinition"))&&function(r){return A(r,"bpmn:InteractionNode")&&!$r(r)&&(!A(r,"bpmn:Event")||A(r,"bpmn:CatchEvent")&&py(r,"bpmn:MessageEventDefinition"))&&!(A(r,"bpmn:BoundaryEvent")&&!Dn(r,"bpmn:MessageEventDefinition"))}(e)&&(n=e,ly(t)!==ly(n));var n,i}function Ey(t,e){return!(hy(e)&&e.incoming.length>0&&(n=e.incoming,(n=n||[]).some(z_))&&!A(t,"bpmn:EventBasedGateway"))&&A(r=t,"bpmn:FlowNode")&&!A(r,"bpmn:EndEvent")&&!Ne(r)&&!(A(r,"bpmn:IntermediateThrowEvent")&&Dn(r,"bpmn:LinkEventDefinition"))&&!hp(r)&&!$r(r)&&function(o){return A(o,"bpmn:FlowNode")&&!A(o,"bpmn:StartEvent")&&!A(o,"bpmn:BoundaryEvent")&&!Ne(o)&&!(A(o,"bpmn:IntermediateCatchEvent")&&Dn(o,"bpmn:LinkEventDefinition"))&&!$r(o)}(e)&&(i=e,uy(t)===uy(i))&&!(A(t,"bpmn:EventBasedGateway")&&!hy(e));var n,i,r}function fp(t,e){return wt(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&wt(e,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!wt(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!wt(t,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function Zs(t,e,n){if(!e)return!1;if(Array.isArray(t)){if(t.length!==1)return!1;t=t[0]}return e.source!==t&&e.target!==t&&wt(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!ge(e)&&A(t,"bpmn:FlowNode")&&!A(t,"bpmn:BoundaryEvent")&&Gr(t,e.parent)}function _y(t,e){return!!ge(e)||!(A(e,"bpmn:Lane")&&!function(n,i){return n&&i&&n.indexOf(i)!==-1}(t,e.parent))}function z_(t){if(t&&t.source)return A(t.source,"bpmn:EventBasedGateway")}function wy(t){return ms(t,"bpmn:Process")||ms(t,"bpmn:Collaboration")}it(be,gi),be.$inject=["eventBus"],be.prototype.init=function(){this.addRule("connection.start",function(t){return function(e){return lp(e)?null:wt(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}(t.source)}),this.addRule("connection.create",function(t){var e=t.source,n=t.target,i=t.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return Js(e,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(t){var e=t.connection;return Js(t.source,t.target,e)}),this.addRule("connection.updateWaypoints",function(t){return{type:t.connection.type}}),this.addRule("shape.resize",function(t){return gy(t.shape,t.newBounds)}),this.addRule("elements.create",function(t){var e=t.elements,n=t.position,i=t.target;return!(Ys(i)&&!Zs(e,i))&&Li(e,function(r){return Ys(r)?Js(r.source,r.target,r):r.host?Qo(r,r.host,null,n):mp(r,i,null)})}),this.addRule("elements.move",function(t){var e=t.target,n=t.shapes,i=t.position;return Qo(n,e,null,i)||vy(n,e,i)||yy(n,e)||Zs(n,e)}),this.addRule("shape.create",function(t){return mp(t.shape,t.target,t.source,t.position)}),this.addRule("shape.attach",function(t){return Qo(t.shape,t.target,null,t.position)}),this.addRule("element.copy",function(t){var e=t.element;return _y(t.elements,e)})},be.prototype.canConnectMessageFlow=xy,be.prototype.canConnectSequenceFlow=Ey,be.prototype.canConnectDataAssociation=fp,be.prototype.canConnectAssociation=by,be.prototype.canMove=yy,be.prototype.canAttach=Qo,be.prototype.canReplace=vy,be.prototype.canDrop=Gr,be.prototype.canInsert=Zs,be.prototype.canCreate=mp,be.prototype.canConnect=Js,be.prototype.canResize=gy,be.prototype.canCopy=_y;const $_={__depends__:[In],__init__:["bpmnRules"],bpmnRules:["type",be]};function Sy(t,e){t.on("saveXML.start",2e3,function(){var n,i,r=e.getRootElement(),o=et(r).di;n=dt(n=Va([r],!1),function(a){return a!==r&&!a.labelTarget}),i=le(n,Pr),o.set("planeElement",i)})}Sy.$inject=["eventBus","canvas"];const G_={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Sy]};function Qs(t){Q.call(this,t);var e=this;this.preExecute(["shape.create","connection.create"],function(n){var i=n.context,r=i.shape||i.connection,o=i.parent,a=e.getOrdering(r,o);a&&(a.parent!==void 0&&(i.parent=a.parent),i.parentIndex=a.index)}),this.preExecute(["shape.move","connection.move"],function(n){var i=n.context,r=i.shape||i.connection,o=i.newParent||r.parent,a=e.getOrdering(r,o);a&&(a.parent!==void 0&&(i.newParent=a.parent),i.newParentIndex=a.index)})}function vp(t,e,n){Qs.call(this,t);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:3,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:Process"]}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:Process"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(o){var a=o.order;if(a||(o.order=a=function(c){if(c.labelTarget)return{level:10};var l=Pt(i,function(u){return wt(c,[u.type])});return l&&l.order||{level:1}}(o)),!a)throw new Error("no order for <"+o.id+">");return a}this.getOrdering=function(o,a){if(o.labelTarget)return{parent:e.getRootElement(),index:-1};var c=r(o);c.containers&&(a=function(p,d,y){for(var f=d;f&&!wt(f,y);)f=f.parent;if(!f)throw new Error("no parent for <"+p.id+"> in <"+(d&&d.id)+">");return f}(o,a,c.containers));var l=a.children.indexOf(o),u=pl(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}}}Qs.prototype.getOrdering=function(t,e){return null},it(Qs,Q),vp.$inject=["eventBus","canvas","translate"],it(vp,Qs);const U_={__depends__:[os],__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",vp]};function Ht(t,e){this._handlerMap={},this._stack=[],this._stackIdx=-1,this._currentExecution={actions:[],dirty:[],trigger:null},this._injector=e,this._eventBus=t,this._uid=1,t.on(["diagram.destroy","diagram.clear"],function(){this.clear(!1)},this)}Ht.$inject=["eventBus","injector"],Ht.prototype.execute=function(t,e){if(!t)throw new Error("command required");this._currentExecution.trigger="execute";var n={command:t,context:e};this._pushAction(n),this._internalExecute(n),this._popAction(n)},Ht.prototype.canExecute=function(t,e){var n={command:t,context:e},i=this._getHandler(t),r=this._fire(t,"canExecute",n);if(r===void 0){if(!i)return!1;i.canExecute&&(r=i.canExecute(e))}return r},Ht.prototype.clear=function(t){this._stack.length=0,this._stackIdx=-1,t!==!1&&this._fire("changed",{trigger:"clear"})},Ht.prototype.undo=function(){var t,e=this._getUndoAction();if(e){for(this._currentExecution.trigger="undo",this._pushAction(e);e&&(this._internalUndo(e),(t=this._getUndoAction())&&t.id===e.id);)e=t;this._popAction()}},Ht.prototype.redo=function(){var t,e=this._getRedoAction();if(e){for(this._currentExecution.trigger="redo",this._pushAction(e);e&&(this._internalExecute(e,!0),(t=this._getRedoAction())&&t.id===e.id);)e=t;this._popAction()}},Ht.prototype.register=function(t,e){this._setHandler(t,e)},Ht.prototype.registerHandler=function(t,e){if(!t||!e)throw new Error("command and handlerCls must be defined");var n=this._injector.instantiate(e);this.register(t,n)},Ht.prototype.canUndo=function(){return!!this._getUndoAction()},Ht.prototype.canRedo=function(){return!!this._getRedoAction()},Ht.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Ht.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Ht.prototype._internalUndo=function(t){var e=this,n=t.command,i=t.context,r=this._getHandler(n);this._atomicDo(function(){e._fire(n,"revert",t),r.revert&&e._markDirty(r.revert(i)),e._revertedAction(t),e._fire(n,"reverted",t)})},Ht.prototype._fire=function(t,e,n){arguments.length<3&&(n=e,e=null);var i,r,o,a=e?[t+"."+e,e]:[t];for(n=this._eventBus.createEvent(n),i=0;(r=a[i])&&(o=this._eventBus.fire("commandStack."+r,n),!n.cancelBubble);i++);return o},Ht.prototype._createId=function(){return this._uid++},Ht.prototype._atomicDo=function(t){var e=this._currentExecution;e.atomic=!0;try{t()}finally{e.atomic=!1}},Ht.prototype._internalExecute=function(t,e){var n=this,i=t.command,r=t.context,o=this._getHandler(i);if(!o)throw new Error("no command handler registered for <"+i+">");this._pushAction(t),e||(this._fire(i,"preExecute",t),o.preExecute&&o.preExecute(r),this._fire(i,"preExecuted",t)),this._atomicDo(function(){n._fire(i,"execute",t),o.execute&&n._markDirty(o.execute(r)),n._executedAction(t,e),n._fire(i,"executed",t)}),e||(this._fire(i,"postExecute",t),o.postExecute&&o.postExecute(r),this._fire(i,"postExecuted",t)),this._popAction(t)},Ht.prototype._pushAction=function(t){var e=this._currentExecution,n=e.actions,i=n[0];if(e.atomic)throw new Error("illegal invocation in <execute> or <revert> phase (action: "+t.command+")");t.id||(t.id=i&&i.id||this._createId()),n.push(t)},Ht.prototype._popAction=function(){var t=this._currentExecution,e=t.trigger,n=t.actions,i=t.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:hl("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:e}),t.trigger=null)},Ht.prototype._markDirty=function(t){var e=this._currentExecution;t&&(t=gt(t)?t:[t],e.dirty=e.dirty.concat(t))},Ht.prototype._executedAction=function(t,e){var n=++this._stackIdx;e||this._stack.splice(n,this._stack.length,t)},Ht.prototype._revertedAction=function(t){this._stackIdx--},Ht.prototype._getHandler=function(t){return this._handlerMap[t]},Ht.prototype._setHandler=function(t,e){if(!t||!e)throw new Error("command and handler required");if(this._handlerMap[t])throw new Error("overriding handler for command <"+t+">");this._handlerMap[t]=e};const H_={commandStack:["type",Ht]};var q_=new tu("tt");function yp(t,e){t.style.display=e===!1?"none":""}var Cy="djs-tooltip",gp="."+Cy;function Pe(t,e){var n,i;this._eventBus=t,this._canvas=e,this._ids=q_,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(n=e.getContainer(),i=jt('<div class="djs-tooltip-container" style="position: absolute; width: 0; height: 0;" />'),n.insertBefore(i,n.firstChild),i);var r=this;$e.bind(this._tooltipRoot,gp,"mousedown",function(o){o.stopPropagation()}),$e.bind(this._tooltipRoot,gp,"mouseover",function(o){r.trigger("mouseover",o)}),$e.bind(this._tooltipRoot,gp,"mouseout",function(o){r.trigger("mouseout",o)}),this._init()}Pe.$inject=["eventBus","canvas"],Pe.prototype.add=function(t){if(!t.position)throw new Error("must specifiy tooltip position");if(!t.html)throw new Error("must specifiy tooltip html");var e=this._ids.next();return t=z({},this._tooltipDefaults,t,{id:e}),this._addTooltip(t),t.timeout&&this.setTimeout(t),e},Pe.prototype.trigger=function(t,e){var n=e.delegateTarget||e.target,i=this.get(ze(n,"data-tooltip-id"));i&&(t==="mouseover"&&i.timeout&&this.clearTimeout(i),t==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},Pe.prototype.get=function(t){return typeof t!="string"&&(t=t.id),this._tooltips[t]},Pe.prototype.clearTimeout=function(t){if(t=this.get(t)){var e=t.removeTimer;e&&(clearTimeout(e),t.removeTimer=null)}},Pe.prototype.setTimeout=function(t){if(t=this.get(t)){this.clearTimeout(t);var e=this;t.removeTimer=setTimeout(function(){e.remove(t)},t.timeout)}},Pe.prototype.remove=function(t){var e=this.get(t);e&&(Tn(e.html),Tn(e.htmlContainer),delete e.htmlContainer,delete this._tooltips[e.id])},Pe.prototype.show=function(){yp(this._tooltipRoot)},Pe.prototype.hide=function(){yp(this._tooltipRoot,!1)},Pe.prototype._updateRoot=function(t){var e=t.scale||1,n=t.scale||1,i="matrix("+e+",0,0,"+n+","+-1*t.x*e+","+-1*t.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},Pe.prototype._addTooltip=function(t){var e,n=t.id,i=t.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Ie(i)&&(i=jt(i)),(e=jt('<div data-tooltip-id="'+n+'" class="'+Cy+'" style="position: absolute">')).appendChild(i),t.type&&oe(e).add("djs-tooltip-"+t.type),t.className&&oe(e).add(t.className),t.htmlContainer=e,r.appendChild(e),this._tooltips[n]=t,this._updateTooltip(t)},Pe.prototype._updateTooltip=function(t){var e,n,i,r=t.position,o=t.htmlContainer;e=o,n=r.x,i=r.y,z(e.style,{left:n+"px",top:i+"px"})},Pe.prototype._updateTooltipVisibilty=function(t){L(this._tooltips,function(e){var n=e.show,i=e.htmlContainer,r=!0;n&&((n.minZoom>t.scale||n.maxZoom<t.scale)&&(r=!1),yp(i,r))})},Pe.prototype._init=function(){var t=this;this._eventBus.on("canvas.viewbox.changing",function(e){t.hide()}),this._eventBus.on("canvas.viewbox.changed",function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateTooltipVisibilty(n),t.show()})};const W_={__init__:["tooltips"],tooltips:["type",Pe]};function Ur(t,e){if(typeof e!="function")throw new Error("removeFn iterator must be a function");if(t){for(var n;n=t[0];)e(n);return t}}function bp(t,e,n){Q.call(this,e);var i=t.get("movePreview",!1);e.on("shape.move.start",1400,function(r){var o=r.context,a=o.shapes,c=o.validatedShapes;o.shapes=Ty(a),o.validatedShapes=Ty(c)}),i&&e.on("shape.move.start",250,function(r){var o=r.context,a=o.shapes,c=[];L(a,function(l){L(l.labels,function(u){u.hidden||o.shapes.indexOf(u)!==-1||c.push(u),l.labelTarget&&c.push(l)})}),L(c,function(l){i.makeDraggable(o,l,!0)})}),this.preExecuted("elements.move",1400,function(r){var o=r.context.closure,a=o.enclosedElements,c=[];L(a,function(l){L(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;Ur((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=Il(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&&(Jt(c.labels,a,l),a.labelTarget=c)})}function Ty(t){return dt(t,function(e){return t.indexOf(e.labelTarget)===-1})}it(bp,Q),bp.$inject=["injector","eventBus","modeling"];const X_={__init__:["labelSupport"],labelSupport:["type",bp]};var Ay="attach-ok";function xp(t,e,n,i,r){Q.call(this,e);var o=t.get("movePreview",!1);e.on("shape.move.start",1401,function(a){var c,l,u=a.context,p=u.shapes,d=u.validatedShapes;u.shapes=(l=Ep(c=p),Yh("id",c,l)),u.validatedShapes=function(y){var f=ji(y,"id");return dt(y,function(v){for(;v;){if(v.host&&f[v.host.id])return!1;v=v.parent}return!0})}(d)}),o&&e.on("shape.move.start",251,function(a){var c=a.context;L(Ep(c.shapes),function(l){o.makeDraggable(c,l,!0),L(l.labels,function(u){o.makeDraggable(c,u,!0)})})}),o&&e.on("shape.move.start",function(a){var c=a.context.shapes;if(c.length===1){var l=c[0].host;l&&(n.addMarker(l,Ay),e.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(l,Ay)}))}}),this.preExecuted("elements.move",1401,function(a){var c=a.context,l=c.closure;L(Ep(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||L(u?l:dt(l,function(p){var d,y=p.host;return function(f){return!!f.host}(p)&&(d=y,l.indexOf(d)===-1)}),function(p){r.updateAttachment(p,u)})}),this.postExecuted("elements.move",function(a){L(a.context.shapes,function(c){L(c.attachers,function(l){L(l.outgoing.slice(),function(u){i.allowed("connection.reconnect",{connection:u,source:u.source,target:u.target})||r.removeConnection(u)}),L(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;Ur(l.attachers,function(p){i.allowed("elements.move",{target:u,shapes:[p]})==="attach"?r.updateAttachment(p,u):r.removeShape(p)}),u.attachers.length&&L(u.attachers,function(p){var d=Kv(p,l,u);r.moveShape(p,d,p.parent)})}),this.postExecute("shape.resize",function(a){var c=a.context,l=c.shape,u=c.oldBounds,p=c.newBounds,d=l.attachers;(c.hints||{}).attachSupport!==!1&&L(d,function(y){var f=Kv(y,u,p);r.moveShape(y,f,y.parent),L(y.labels,function(v){r.moveShape(v,f,v.parent)})})}),this.preExecute("shape.delete",function(a){var c=a.context.shape;Ur(c.attachers,function(l){r.removeShape(l)}),c.host&&r.updateAttachment(c,null)})}function Ep(t){return mo(le(t,function(e){return e.attachers||[]}))}it(xp,Q),xp.$inject=["injector","eventBus","canvas","rules","modeling"];const K_={__depends__:[In],__init__:["attachSupport"],attachSupport:["type",xp]};function Zi(t,e){this._eventBus=t,this._dragging=e,this._tools=[],this._active=null}Zi.$inject=["eventBus","dragging"],Zi.prototype.registerTool=function(t,e){var n=this._tools;if(!e)throw new Error(`A tool has to be registered with it's "events"`);n.push(t),this.bindEvents(t,e)},Zi.prototype.isActive=function(t){return t&&this._active===t},Zi.prototype.length=function(t){return this._tools.length},Zi.prototype.setActive=function(t){var e=this._eventBus;this._active!==t&&(this._active=t,e.fire("tool-manager.update",{tool:t}))},Zi.prototype.bindEvents=function(t,e){var n=this._eventBus,i=this._dragging,r=[];n.on(e.tool+".init",function(o){if(!o.context.reactivate&&this.isActive(t))return this.setActive(null),void i.cancel();this.setActive(t)},this),L(e,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&&Vi(c,'.group[data-group="tools"]')}(o)||this.setActive(null))},this)};const tc={__depends__:[Wn],__init__:["toolManager"],toolManager:["type",Zi]};function ta(t,e){return t.indexOf(e)!==-1}var _p=Math.abs,Y_=Math.round,Yn={x:"width",y:"height"},ky="crosshair",ec={n:"top",w:"left",s:"bottom",e:"right"},Py={n:"s",w:"e",s:"n",e:"w"},nc=20;function Jn(t,e,n,i,r,o,a){this._canvas=t,this._dragging=e,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&&Ry(l)}),n.on("spaceTool.end",function(l){var u=l.context,p=u.axis,d=u.direction,y=u.movingShapes,f=u.resizingShapes,v=u.start;if(u.initialized){Ry(l);var g={x:0,y:0};g[p]=Y_(l["d"+p]),c.makeSpace(y,f,g,d,v),n.once("spaceTool.ended",function(b){c.activateSelection(b.originalEvent,!0,!0)})}})}function My(t){return{top:t.top-nc,right:t.right+nc,bottom:t.bottom+nc,left:t.left-nc}}function Ry(t){var e,n,i=t.context.spaceToolConstraints;i&&(pt(i.left)&&(e=Math.max(t.x,i.left),t.dx=t.dx+e-t.x,t.x=e),pt(i.right)&&(e=Math.min(t.x,i.right),t.dx=t.dx+e-t.x,t.x=e),pt(i.top)&&(n=Math.max(t.y,i.top),t.dy=t.dy+n-t.y,t.y=n),pt(i.bottom)&&(n=Math.min(t.y,i.bottom),t.dy=t.dy+n-t.y,t.y=n))}function wp(t,e){return t.indexOf(e)!==-1}function Sp(t){return!!t.waypoints}function Ny(t){return!!t.labelTarget}Jn.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],Jn.prototype.activateSelection=function(t,e,n){this._dragging.init(t,"spaceTool.selection",{autoActivate:e,cursor:ky,data:{context:{reactivate:n}},trapClick:!1})},Jn.prototype.activateMakeSpace=function(t){this._dragging.init(t,"spaceTool",{autoActivate:!0,cursor:ky,data:{context:{}}})},Jn.prototype.makeSpace=function(t,e,n,i,r){return this._modeling.createSpace(t,e,n,i,r)},Jn.prototype.init=function(t,e){var n=_p(t.dx)>_p(t.dy)?"x":"y",i=t["d"+n],r=t[n]-i;if(_p(i)<5)return!1;i<0&&(i*=-1),Ir(t)&&(i*=-1);var o=function(u,p){if(u==="x"){if(p>0)return"e";if(p<0)return"w"}if(u==="y"){if(p>0)return"s";if(p<0)return"n"}return null}(n,i),a=Va(this._canvas.getRootElement(),!0),c=this.calculateAdjustments(a,n,i,r),l=function(u,p,d,y,f){var v=u.movingShapes,g=u.resizingShapes;if(g.length){var b,S,w={};return L(g,function(_){var C,B,s,h=at(_),m=dt(_.children,function(M){return!(Sp(M)||Ny(M)||wp(v,M)||wp(g,M))}),E=dt(_.children,function(M){return!Sp(M)&&!Ny(M)&&wp(v,M)});m.length&&(B=My(at(ve(m))),C=y-h[ec[d]]+B[ec[d]],d==="n"?w.bottom=S=pt(S)?Math.min(S,C):C:d==="w"?w.right=S=pt(S)?Math.min(S,C):C:d==="s"?w.top=b=pt(b)?Math.max(b,C):C:d==="e"&&(w.left=b=pt(b)?Math.max(b,C):C)),E.length&&(s=My(at(ve(E))),C=y-s[ec[Py[d]]]+h[ec[Py[d]]],d==="n"?w.bottom=S=pt(S)?Math.min(S,C):C:d==="w"?w.right=S=pt(S)?Math.min(S,C):C:d==="s"?w.top=b=pt(b)?Math.max(b,C):C:d==="e"&&(w.left=b=pt(b)?Math.max(b,C):C));var T=f&&f[_.id];T&&(d==="n"?(C=y+_[Yn[p]]-T[Yn[p]],w.bottom=S=pt(S)?Math.min(S,C):C):d==="w"?(C=y+_[Yn[p]]-T[Yn[p]],w.right=S=pt(S)?Math.min(S,C):C):d==="s"?(C=y-_[Yn[p]]+T[Yn[p]],w.top=b=pt(b)?Math.max(b,C):C):d==="e"&&(C=y-_[Yn[p]]+T[Yn[p]],w.left=b=pt(b)?Math.max(b,C):C))}),w}}(c,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}));return z(e,c,{axis:n,direction:o,spaceToolConstraints:l,start:r}),hs("resize-"+(n==="x"?"ew":"ns")),!0},Jn.prototype.calculateAdjustments=function(t,e,n,i){var r=this._rules,o=[],a=[];return L(t,function(c){if(c.parent&&!Sp(c)){var l=c[e],u=l+c[Yn[e]];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}},Jn.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();this.activateSelection(t,!!t)},Jn.prototype.isActive=function(){var t=this._dragging.context();return t&&/^spaceTool/.test(t.prefix)};var Cp="djs-dragging",Iy="djs-resizing",ic=Math.max;function Dy(t,e,n,i,r){function o(a,c){L(a,function(l){r.addDragger(l,c),n.addMarker(l,Cp)})}t.on("spaceTool.selection.start",function(a){var c=n.getLayer("space"),l=a.context,u="M 0,-10000 L 0,10000",p="M -10000,0 L 10000,0",d=ot("g");K(d,i.cls("djs-crosshair-group",["no-events"])),lt(c,d);var y=ot("path");K(y,"d",u),bt(y).add("djs-crosshair"),lt(d,y);var f=ot("path");K(f,"d",p),bt(f).add("djs-crosshair"),lt(d,f),l.crosshairGroup=d}),t.on("spaceTool.selection.move",function(a){Oe(a.context.crosshairGroup,a.x,a.y)}),t.on("spaceTool.selection.cleanup",function(a){var c=a.context.crosshairGroup;c&&ee(c)}),t.on("spaceTool.move",250,function(a){var c=a.context,l=c.line,u=c.axis,p=c.movingShapes,d=c.resizingShapes;if(c.initialized){if(!c.dragGroup){var y=n.getLayer("space");K(l=ot("path"),"d","M0,0 L0,0"),bt(l).add("djs-crosshair"),lt(y,l),c.line=l;var f=ot("g");K(f,i.cls("djs-drag-group",["no-events"])),lt(n.getActiveLayer(),f),o(p,f),o(c.movingConnections=e.filter(function(S){var w=!1;L(p,function(s){L(s.outgoing,function(h){S===h&&(w=!0)})});var _=!1;L(p,function(s){L(s.incoming,function(h){S===h&&(_=!0)})});var C=!1;L(d,function(s){L(s.outgoing,function(h){S===h&&(C=!0)})});var B=!1;return L(d,function(s){L(s.incoming,function(h){S===h&&(B=!0)})}),function(s){return s.waypoints}(S)&&(w||C)&&(_||B)}),f),c.dragGroup=f}if(!c.frameGroup){var v=ot("g");K(v,i.cls("djs-frame-group",["no-events"])),lt(n.getActiveLayer(),v);var g=[];L(d,function(S){var w=r.addFrame(S,v),_=w.getBBox();g.push({element:w,initialBounds:_}),n.addMarker(S,Iy)}),c.frameGroup=v,c.frames=g}K(l,{d:{x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y}[u]});var b={x:a.dx,y:a.dy};b[{x:"y",y:"x"}[c.axis]]=0,Oe(c.dragGroup,b.x,b.y),L(c.frames,function(S){var w,_,C=S.element,B=S.initialBounds;c.direction==="e"?K(C,{width:ic(B.width+b.x,5)}):K(C,{width:w=ic(B.width-b.x,5),x:B.x+B.width-w}),c.direction==="s"?K(C,{height:ic(B.height+b.y,5)}):K(C,{height:_=ic(B.height-b.y,5),y:B.y+B.height-_})})}}),t.on("spaceTool.cleanup",function(a){var c=a.context,l=c.movingShapes,u=c.movingConnections,p=c.resizingShapes,d=c.line,y=c.dragGroup,f=c.frameGroup;L(l,function(v){n.removeMarker(v,Cp)}),L(u,function(v){n.removeMarker(v,Cp)}),y&&(ee(d),ee(y)),L(p,function(v){n.removeMarker(v,Iy)}),f&&ee(f)})}Dy.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const By={__init__:["spaceToolPreview"],__depends__:[Wn,In,tc,Fo,Go],spaceTool:["type",Jn],spaceToolPreview:["type",Dy]};function rn(t){this._model=t}function je(t,e,n,i){Q.call(this,t),this._bpmnFactory=e,this._translate=i;var r=this;function o(p){L(p.context.oldRoot.children,function(d){A(d,"bpmn:BaseElement")&&r.updateParent(d)})}function a(p){var d=p.context.shape;A(d,"bpmn:BaseElement")&&r.updateBounds(d)}function c(p){r.updateConnection(p.context)}function l(p){r.updateConnectionWaypoints(p.context.connection)}function u(p){r.updateAttachment(p.context)}this.executed(["connection.layout","connection.create"],function(p){var d,y=p.context,f=y.hints||{};y.cropped||f.createElementsBehavior===!1||((d=y.connection).waypoints=n.getCroppedWaypoints(d),y.cropped=!0)}),this.reverted(["connection.layout"],function(p){delete p.context.cropped}),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],on(function(p){var d=p.context;r.updateParent(d.shape||d.connection,d.oldParent)})),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],on(function(p){var d=p.context,y=d.shape||d.connection,f=d.parent||d.newParent;r.updateParent(y,f)})),this.executed(["canvas.updateRoot"],o),this.reverted(["canvas.updateRoot"],o),this.executed(["shape.move","shape.create","shape.resize"],on(function(p){p.context.shape.type!=="label"&&a(p)})),this.reverted(["shape.move","shape.create","shape.resize"],on(function(p){p.context.shape.type!=="label"&&a(p)})),t.on("shape.changed",function(p){p.element.type==="label"&&a({context:{shape:p.element}})}),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],on(c)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],on(c)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],on(l)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],on(l)),this.executed("connection.reconnect",on(function(p){var d=p.context,y=d.connection,f=d.oldSource,v=d.newSource,g=et(y),b=et(f),S=et(v);g.conditionExpression&&!wt(S,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(d.oldConditionExpression=g.conditionExpression,delete g.conditionExpression),f!==v&&b.default===g&&(d.oldDefault=b.default,delete b.default)})),this.reverted("connection.reconnect",on(function(p){var d=p.context,y=d.connection,f=d.oldSource,v=d.newSource,g=et(y),b=et(f),S=et(v);d.oldConditionExpression&&(g.conditionExpression=d.oldConditionExpression),d.oldDefault&&(b.default=d.oldDefault,delete S.default)})),this.executed(["element.updateAttachment"],on(u)),this.reverted(["element.updateAttachment"],on(u))}function on(t){return function(e){var n=e.context;A(n.shape||n.connection,"bpmn:BaseElement")&&t(e)}}function Ei(t,e,n){$n.call(this),this._bpmnFactory=t,this._moddle=e,this._translate=n}function Oy(t,e,n){t[n]=e[n],delete e[n]}function rc(t,e){this._modeling=t,this._canvas=e}function oc(t){this._modeling=t}function ac(t,e){this._canvas=t,this._layouter=e}rn.$inject=["moddle"],rn.prototype._needsId=function(t){return wt(t,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},rn.prototype._ensureId=function(t){var e;e=A(t,"bpmn:Activity")?"Activity":A(t,"bpmn:Event")?"Event":A(t,"bpmn:Gateway")?"Gateway":wt(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(t.$type||"").replace(/^[^:]*:/g,""),e+="_",!t.id&&this._needsId(t)&&(t.id=this._model.ids.nextPrefixed(e,t))},rn.prototype.create=function(t,e){var n=this._model.create(t,e||{});return this._ensureId(n),n},rn.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},rn.prototype.createDiShape=function(t,e,n){return this.create("bpmndi:BPMNShape",z({bpmnElement:t,bounds:this.createDiBounds(e)},n))},rn.prototype.createDiBounds=function(t){return this.create("dc:Bounds",t)},rn.prototype.createDiWaypoints=function(t){var e=this;return le(t,function(n){return e.createDiWaypoint(n)})},rn.prototype.createDiWaypoint=function(t){return this.create("dc:Point",Ke(t,["x","y"]))},rn.prototype.createDiEdge=function(t,e,n){return this.create("bpmndi:BPMNEdge",z({bpmnElement:t,waypoint:this.createDiWaypoints(e)},n))},rn.prototype.createDiPlane=function(t){return this.create("bpmndi:BPMNPlane",{bpmnElement:t})},it(je,Q),je.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],je.prototype.updateAttachment=function(t){var e=t.shape,n=e.businessObject,i=e.host;n.attachedToRef=i&&i.businessObject},je.prototype.updateParent=function(t,e){if(!(t instanceof Wa||A(t,"bpmn:DataStoreReference")&&t.parent&&A(t.parent,"bpmn:Collaboration"))){var n=t.parent,i=t.businessObject,r=n&&n.businessObject,o=r&&r.di;A(t,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,r,e&&e.businessObject),A(t,"bpmn:DataOutputAssociation")&&(r=t.source?t.source.businessObject:null),A(t,"bpmn:DataInputAssociation")&&(r=t.target?t.target.businessObject:null),this.updateSemanticParent(i,r),A(t,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,r),this.updateDiParent(i.di,o)}},je.prototype.updateBounds=function(t){var e=t.businessObject.di,n=t instanceof Wa?this._getLabel(e):e,i=n.bounds;i||(i=this._bpmnFactory.createDiBounds(),n.set("bounds",i)),z(i,{x:t.x,y:t.y,width:t.width,height:t.height})},je.prototype.updateFlowNodeRefs=function(t,e,n){n!==e&&(A(n,"bpmn:Lane")&&Yt(n.get("flowNodeRef"),t),A(e,"bpmn:Lane")&&Jt(e.get("flowNodeRef"),t))},je.prototype.updateDiConnection=function(t,e,n){t.sourceElement&&t.sourceElement.bpmnElement!==e&&(t.sourceElement=e&&e.di),t.targetElement&&t.targetElement.bpmnElement!==n&&(t.targetElement=n&&n.di)},je.prototype.updateDiParent=function(t,e){if(e&&!A(e,"bpmndi:BPMNPlane")&&(e=e.$parent),t.$parent!==e){var n=(e||t.$parent).get("planeElement");e?(n.push(t),t.$parent=e):(Yt(n,t),t.$parent=null)}},je.prototype.getLaneSet=function(t){var e,n;return A(t,"bpmn:Lane")?((e=t.childLaneSet)||(e=this._bpmnFactory.create("bpmn:LaneSet"),t.childLaneSet=e,e.$parent=t),e):(A(t,"bpmn:Participant")&&(t=t.processRef),(e=(n=t.get("laneSets"))[0])||((e=this._bpmnFactory.create("bpmn:LaneSet")).$parent=t,n.push(e)),e)},je.prototype.updateSemanticParent=function(t,e,n){var i,r=this._translate;if(t.$parent!==e&&(!A(t,"bpmn:DataInput")&&!A(t,"bpmn:DataOutput")||(A(e,"bpmn:Participant")&&"processRef"in e&&(e=e.processRef),!("ioSpecification"in e)||e.ioSpecification!==t.$parent))){if(A(t,"bpmn:Lane"))e&&(e=this.getLaneSet(e)),i="lanes";else if(A(t,"bpmn:FlowElement")){if(e){if(A(e,"bpmn:Participant"))e=e.processRef;else if(A(e,"bpmn:Lane"))do e=e.$parent.$parent;while(A(e,"bpmn:Lane"))}i="flowElements"}else if(A(t,"bpmn:Artifact")){for(;e&&!A(e,"bpmn:Process")&&!A(e,"bpmn:SubProcess")&&!A(e,"bpmn:Collaboration");){if(A(e,"bpmn:Participant")){e=e.processRef;break}e=e.$parent}i="artifacts"}else if(A(t,"bpmn:MessageFlow"))i="messageFlows";else if(A(t,"bpmn:Participant")){i="participants";var o,a=t.processRef;a&&(o=function(u){for(;u&&!A(u,"bpmn:Definitions");)u=u.$parent;return u}(t.$parent||e),t.$parent&&(Yt(o.get("rootElements"),a),a.$parent=null),e&&(Jt(o.get("rootElements"),a),a.$parent=o))}else A(t,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":A(t,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:t.id,parent:e.id}));var c;if(t.$parent&&Yt(c=t.$parent.get(i),t),e?((c=e.get(i)).push(t),t.$parent=e):t.$parent=null,n){var l=n.get(i);Yt(c,t),e&&(l||(l=[],e.set(i,l)),l.push(t))}}},je.prototype.updateConnectionWaypoints=function(t){t.businessObject.di.set("waypoint",this._bpmnFactory.createDiWaypoints(t.waypoints))},je.prototype.updateConnection=function(t){var e,n=t.connection,i=et(n),r=et(n.source),o=et(n.target);if(A(i,"bpmn:DataAssociation"))A(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=r,e=t.parent||t.newParent||o,this.updateSemanticParent(i,o,e)):A(i,"bpmn:DataOutputAssociation")&&(e=t.parent||t.newParent||r,this.updateSemanticParent(i,r,e),i.targetRef=o);else{var a=A(i,"bpmn:SequenceFlow");i.sourceRef!==r&&(a&&(Yt(i.sourceRef&&i.sourceRef.get("outgoing"),i),r&&r.get("outgoing")&&r.get("outgoing").push(i)),i.sourceRef=r),i.targetRef!==o&&(a&&(Yt(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)},je.prototype._getLabel=function(t){return t.label||(t.label=this._bpmnFactory.createDiLabel()),t.label},it(Ei,$n),Ei.$inject=["bpmnFactory","moddle","translate"],Ei.prototype.baseCreate=$n.prototype.create,Ei.prototype.create=function(t,e){return t==="label"?this.baseCreate(t,z({type:"label"},Ro,e)):this.createBpmnElement(t,e)},Ei.prototype.createBpmnElement=function(t,e){var n,i,r,o=this._translate,a=(e=e||{}).businessObject;if(!a){if(!e.type)throw new Error(o("no shape type specified"));a=this._bpmnFactory.create(e.type)}return a.di||(a.di=t==="root"?this._bpmnFactory.createDiPlane(a,[],{id:a.id+"_di"}):t==="connection"?this._bpmnFactory.createDiEdge(a,[],{id:a.id+"_di"}):this._bpmnFactory.createDiShape(a,{},{id:a.id+"_di"})),A(a,"bpmn:Group")&&(e=z({isFrame:!0},e)),e.di&&(z(a.di,e.di),delete e.di),function(c,l,u){L(u,function(p){l[p]!==void 0&&Oy(c,l,p)})}(a,e,["processRef","isInterrupting","associationDirection","isForCompensation"]),e.isExpanded&&Oy(a.di,e,"isExpanded"),A(a,"bpmn:ExclusiveGateway")&&(a.di.isMarkerVisible=!0),e.eventDefinitionType&&(i=a.get("eventDefinitions")||[],r=this._bpmnFactory.create(e.eventDefinitionType,e.eventDefinitionAttrs),e.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(r.condition=this._bpmnFactory.create("bpmn:FormalExpression")),i.push(r),r.$parent=a,a.eventDefinitions=i,delete e.eventDefinitionType),n=this._getDefaultSize(a),e=z({businessObject:a,id:a.id},n,e),this.baseCreate(t,e)},Ei.prototype._getDefaultSize=function(t){return A(t,"bpmn:SubProcess")?Mt(t)?{width:350,height:200}:{width:100,height:80}:A(t,"bpmn:Task")?{width:100,height:80}:A(t,"bpmn:Gateway")?{width:50,height:50}:A(t,"bpmn:Event")?{width:36,height:36}:A(t,"bpmn:Participant")?Mt(t)?{width:600,height:250}:{width:400,height:60}:A(t,"bpmn:Lane")?{width:400,height:100}:A(t,"bpmn:DataObjectReference")?{width:36,height:50}:A(t,"bpmn:DataStoreReference")?{width:50,height:50}:A(t,"bpmn:TextAnnotation")?{width:100,height:30}:A(t,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},Ei.prototype.createParticipantShape=function(t){return te(t)||(t={isExpanded:t}),(t=z({type:"bpmn:Participant"},t||{})).isExpanded!==!1&&(t.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(t)},rc.$inject=["modeling","canvas"],rc.prototype.preExecute=function(t){var e=this._modeling,n=t.elements,i=t.alignment;L(n,function(r){var o={x:0,y:0};i.left?o.x=i.left-r.x:i.right?o.x=i.right-r.width-r.x:i.center?o.x=i.center-Math.round(r.width/2)-r.x:i.top?o.y=i.top-r.y:i.bottom?o.y=i.bottom-r.height-r.y:i.middle&&(o.y=i.middle-Math.round(r.height/2)-r.y),e.moveElements([r],o,r.parent)})},rc.prototype.postExecute=function(t){},oc.$inject=["modeling"],oc.prototype.preExecute=function(t){var e=t.source;if(!e)throw new Error("source required");var n=t.target||e.parent,i=t.shape,r=t.hints||{};i=t.shape=this._modeling.createShape(i,t.position,n,{attach:r.attach}),t.shape=i},oc.prototype.postExecute=function(t){var e,n,i=t.hints||{};e=t.source,n=t.shape,ai(e.outgoing,function(r){return r.target===n})||(i.connectionTarget===t.source?this._modeling.connect(t.shape,t.source,t.connection):this._modeling.connect(t.source,t.shape,t.connection))},ac.$inject=["canvas","layouter"],ac.prototype.execute=function(t){var e=t.connection,n=t.source,i=t.target,r=t.parent,o=t.parentIndex,a=t.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return e.source=n,e.target=i,e.waypoints||(e.waypoints=this._layouter.layoutConnection(e,a)),this._canvas.addConnection(e,r,o),e},ac.prototype.revert=function(t){var e=t.connection;return this._canvas.removeConnection(e),e.source=null,e.target=null,e};var sc=Math.round;function Tp(t){this._modeling=t}function Ly(t){return!!t.waypoints}Tp.$inject=["modeling"],Tp.prototype.preExecute=function(t){var e=t.elements,n=t.parent,i=t.parentIndex,r=t.position,o=t.hints,a=this._modeling;L(e,function(p){pt(p.x)||(p.x=0),pt(p.y)||(p.y=0)});var c=ve(e);L(e,function(p){Ly(p)&&(p.waypoints=le(p.waypoints,function(d){return{x:sc(d.x-c.x-c.width/2+r.x),y:sc(d.y-c.y-c.height/2+r.y)}})),z(p,{x:sc(p.x-c.x-c.width/2+r.x),y:sc(p.y-c.y-c.height/2+r.y)})});var l=dd(e),u={};L(e,function(p){if(Ly(p))u[p.id]=pt(i)?a.createConnection(u[p.source.id],u[p.target.id],i,p,p.parent||n,o):a.createConnection(u[p.source.id],u[p.target.id],p,p.parent||n,o);else{var d=z({},o);l.indexOf(p)===-1&&(d.autoResize=!1),u[p.id]=pt(i)?a.createShape(p,Ke(p,["x","y","width","height"]),p.parent||n,i,d):a.createShape(p,Ke(p,["x","y","width","height"]),p.parent||n,d)}}),t.elements=Ba(u)};var jy=Math.round;function _i(t){this._canvas=t}function ea(t){_i.call(this,t)}_i.$inject=["canvas"],_i.prototype.execute=function(t){var e=t.shape,n=t.position,i=t.parent,r=t.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?z(e,n):z(e,{x:n.x-jy(e.width/2),y:n.y-jy(e.height/2)}),this._canvas.addShape(e,i,r),e},_i.prototype.revert=function(t){var e=t.shape;return this._canvas.removeShape(e),e},it(ea,_i),ea.$inject=["canvas"];var J_=_i.prototype.execute;ea.prototype.execute=function(t){var e=t.shape;return function(n){["width","height"].forEach(function(i){n[i]===void 0&&(n[i]=0)})}(e),e.labelTarget=t.labelTarget,J_.call(this,t)};var Z_=_i.prototype.revert;function cc(t,e){this._canvas=t,this._modeling=e}function Ap(t,e){this._modeling=t,this._elementRegistry=e}function na(t,e){this._canvas=t,this._modeling=e}function lc(t){this._modeling=t}ea.prototype.revert=function(t){return t.shape.labelTarget=null,Z_.call(this,t)},cc.$inject=["canvas","modeling"],cc.prototype.execute=function(t){var e=t.connection,n=e.parent;return t.parent=n,t.parentIndex=Il(n.children,e),t.source=e.source,t.target=e.target,this._canvas.removeConnection(e),e.source=null,e.target=null,e},cc.prototype.revert=function(t){var e=t.connection,n=t.parent,i=t.parentIndex;return e.source=t.source,e.target=t.target,Jt(n.children,e,i),this._canvas.addConnection(e,n),e},Ap.$inject=["modeling","elementRegistry"],Ap.prototype.postExecute=function(t){var e=this._modeling,n=this._elementRegistry;L(t.elements,function(i){n.get(i.id)&&(i.waypoints?e.removeConnection(i):e.removeShape(i))})},na.$inject=["canvas","modeling"],na.prototype.preExecute=function(t){var e=this._modeling,n=t.shape;Ur(n.incoming,function(i){e.removeConnection(i,{nested:!0})}),Ur(n.outgoing,function(i){e.removeConnection(i,{nested:!0})}),Ur(n.children,function(i){i.waypoints?e.removeConnection(i,{nested:!0}):e.removeShape(i,{nested:!0})})},na.prototype.execute=function(t){var e=this._canvas,n=t.shape,i=n.parent;return t.oldParent=i,t.oldParentIndex=Il(i.children,n),e.removeShape(n),n},na.prototype.revert=function(t){var e=this._canvas,n=t.shape,i=t.oldParent,r=t.oldParentIndex;return Jt(i.children,n,r),e.addShape(n,i),n},lc.$inject=["modeling"];var Vy={x:"y",y:"x"};function uc(t,e){this._layouter=t,this._canvas=e}function kp(){}function Pp(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function ia(t){this._modeling=t}function pc(t){this._helper=new ia(t)}function Qi(t){this._modeling=t,this._helper=new ia(t)}function ra(t){this._modeling=t}function Fy(t){return t.original||t}function Zn(t,e){this._modeling=t,this._rules=e}function oa(t){this._modeling=t}function wi(t){this._modeling=t}function zy(t){return z({},t)}function $y(t){switch(t){case"n":case"s":return"y";case"w":case"e":return"x"}}function Gy(t,e,n){var i=$y(n);return/e|s/.test(n)?t[i]>e:/n|w/.test(n)?t[i]<e:void 0}function Si(t,e){return t.indexOf(e)!==-1}function hc(t){this._modeling=t}function Uy(t){var e={};return L(t,function(n){e[n.id]=n.hidden,n.children&&(e=z({},e,Uy(n.children)))}),e}function Hy(t,e){var n=[];return L(t,function(i){i.hidden=e,n=n.concat(i),i.children&&(n=n.concat(Hy(i.children,i.collapsed||e)))}),n}function qy(t,e){var n=[];return L(t,function(i){i.hidden=e[i.id],n=n.concat(i),i.children&&(n=n.concat(qy(i.children,e)))}),n}function dc(t){this._modeling=t}function Wy(t,e){return Yt(t&&t.attachers,e)}function Xy(t,e,n){if(t){var i=t.attachers;i||(t.attachers=i=[]),Jt(i,e,n)}}function Mp(){}function Nt(t,e,n){this._eventBus=t,this._elementFactory=e,this._commandStack=n;var i=this;t.on("diagram.init",function(){i.registerHandlers(n)})}function aa(t){this._elementRegistry=t}function Ky(t,e){L(e,function(n,i){t.set(i,n)})}lc.prototype.preExecute=function(t){var e=this._modeling,n=t.groups,i=t.axis,r=t.dimension;function o(g,b){g.range.min=Math.min(b[i],g.range.min),g.range.max=Math.max(b[i]+b[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,d=n[0],y=c(n),f=n[y],v=0;L(n,function(g,b){var S,w,_;g.elements.length<2?b&&b!==n.length-1&&(o(g,g.elements[0]),v+=l(g.range)):(w=(S=We(g.elements,i))[0],b===y&&(w=S[c(S)]),_=a(w),g.range=null,L(S,function(C){(function(B,s){var h={y:0};h[i]=B-a(s),h[i]&&(h[Vy[i]]=0,e.moveElements([s],h,s.parent))})(_,C),g.range!==null?o(g,C):g.range={min:C[i],max:C[i]+C[r]}}),b&&b!==n.length-1&&(v+=l(g.range)))}),p=Math.abs(f.range.min-d.range.max),(u=Math.round((p-v)/(n.length-1)))<n.length-1||L(n,function(g,b){var S,w={};g!==d&&g!==f&&(S=n[b-1],g.range.max=0,L(g.elements,function(_,C){w[Vy[i]]=0,w[i]=S.range.max-_[i]+u,g.range.min!==_[i]&&(w[i]+=_[i]-g.range.min),w[i]&&e.moveElements([_],w,_.parent),g.range.max=Math.max(_[i]+_[r],C?g.range.max:0)}))})},lc.prototype.postExecute=function(t){},uc.$inject=["layouter","canvas"],uc.prototype.execute=function(t){var e=t.connection;return z(t,{oldWaypoints:e.waypoints}),e.waypoints=this._layouter.layoutConnection(e,t.hints),e},uc.prototype.revert=function(t){var e=t.connection;return e.waypoints=t.oldWaypoints,e},kp.prototype.execute=function(t){var e=t.connection,n=t.delta,i=t.newParent||e.parent,r=t.newParentIndex,o=e.parent;return t.oldParent=o,t.oldParentIndex=Yt(o.children,e),Jt(i.children,e,r),e.parent=i,L(e.waypoints,function(a){a.x+=n.x,a.y+=n.y,a.original&&(a.original.x+=n.x,a.original.y+=n.y)}),e},kp.prototype.revert=function(t){var e=t.connection,n=e.parent,i=t.oldParent,r=t.oldParentIndex,o=t.delta;return Yt(n.children,e),Jt(i.children,e,r),e.parent=i,L(e.waypoints,function(a){a.x-=o.x,a.y-=o.y,a.original&&(a.original.x-=o.x,a.original.y-=o.y)}),e},Pp.prototype.add=function(t,e){return this.addAll([t],e)},Pp.prototype.addAll=function(t,e){var n=function(i,r,o){jn(r)&&(r=!0),te(r)&&(o=r,r=!0);var a=xo((o=o||{}).allShapes),c=xo(o.allConnections),l=xo(o.enclosedElements),u=xo(o.enclosedConnections),p=xo(o.topLevel,r&&ji(i,function(y){return y.id}));function d(y){p[y.source.id]&&p[y.target.id]&&(p[y.id]=[y]),a[y.source.id]&&a[y.target.id]&&(u[y.id]=l[y.id]=y),c[y.id]=y}return Fi(i,function(y){if(l[y.id]=y,!y.waypoints)return a[y.id]=y,L(y.incoming,d),L(y.outgoing,d),y.children;u[y.id]=c[y.id]=y}),{allShapes:a,allConnections:c,topLevel:p,enclosedConnections:u,enclosedElements:l}}(t,!!e,this);return z(this,n),this},ia.prototype.moveRecursive=function(t,e,n){return t?this.moveClosure(this.getClosure(t),e,n):[]},ia.prototype.moveClosure=function(t,e,n,i,r){var o=this._modeling,a=t.allShapes,c=t.allConnections,l=t.enclosedConnections,u=t.topLevel,p=!1;r&&r.parent===n&&(p=!0),L(a,function(d){o.moveShape(d,e,u[d.id]&&!p&&n,{recurse:!1,layout:!1})}),L(c,function(d){var y=!!a[d.source.id],f=!!a[d.target.id];l[d.id]&&y&&f?o.moveConnection(d,e,u[d.id]&&!p&&n):o.layoutConnection(d,{connectionStart:y&&Zu(d,d.source,e),connectionEnd:f&&Qu(d,d.target,e)})})},ia.prototype.getClosure=function(t){return new Pp().addAll(t,!0)},pc.$inject=["modeling"],pc.prototype.preExecute=function(t){t.closure=this._helper.getClosure(t.shapes)},pc.prototype.postExecute=function(t){var e,n=t.hints;n&&n.primaryShape&&(e=n.primaryShape,n.oldParent=e.parent),this._helper.moveClosure(t.closure,t.delta,t.newParent,t.newHost,e)},Qi.$inject=["modeling"],Qi.prototype.execute=function(t){var e=t.shape,n=t.delta,i=t.newParent||e.parent,r=t.newParentIndex,o=e.parent;return t.oldBounds=Ke(e,["x","y","width","height"]),t.oldParent=o,t.oldParentIndex=Yt(o.children,e),Jt(i.children,e,r),z(e,{parent:i,x:e.x+n.x,y:e.y+n.y}),e},Qi.prototype.postExecute=function(t){var e=t.shape,n=t.delta,i=t.hints,r=this._modeling;i.layout!==!1&&(L(e.incoming,function(o){r.layoutConnection(o,{connectionEnd:Qu(o,e,n)})}),L(e.outgoing,function(o){r.layoutConnection(o,{connectionStart:Zu(o,e,n)})})),i.recurse!==!1&&this.moveChildren(t)},Qi.prototype.revert=function(t){var e=t.shape,n=t.oldParent,i=t.oldParentIndex,r=t.delta;return Jt(n.children,e,i),z(e,{parent:n,x:e.x-r.x,y:e.y-r.y}),e},Qi.prototype.moveChildren=function(t){var e=t.delta,n=t.shape;this._helper.moveRecursive(n.children,e,null)},Qi.prototype.getNewParent=function(t){return t.newParent||t.shape.parent},ra.$inject=["modeling"],ra.prototype.execute=function(t){var e=t.newSource,n=t.newTarget,i=t.connection,r=t.dockingOrPoints;if(!e&&!n)throw new Error("newSource or newTarget required");return gt(r)&&(t.oldWaypoints=i.waypoints,i.waypoints=r),e&&(t.oldSource=i.source,i.source=e),n&&(t.oldTarget=i.target,i.target=n),i},ra.prototype.postExecute=function(t){var e=t.connection,n=t.newSource,i=t.newTarget,r=t.dockingOrPoints,o=t.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||Fy(gt(r)?r[0]:r)),!i||n&&o.docking!=="target"||(a.connectionEnd=a.connectionEnd||Fy(gt(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(e,a))},ra.prototype.revert=function(t){var e=t.oldSource,n=t.oldTarget,i=t.oldWaypoints,r=t.connection;return e&&(r.source=e),n&&(r.target=n),i&&(r.waypoints=i),r},Zn.$inject=["modeling","rules"],Zn.prototype.preExecute=function(t){var e,n=this,i=this._modeling,r=this._rules,o=t.oldShape,a=t.newData,c=t.hints||{};function l(v,g,b){return r.allowed("connection.reconnect",{connection:b,source:v,target:g})}var u,p={x:a.x,y:a.y},d={x:o.x,y:o.y,width:o.width,height:o.height};e=t.newShape=t.newShape||n.createShape(a,p,o.parent,c),o.host&&i.updateAttachment(e,o.host),c.moveChildren!==!1&&(u=o.children.slice(),i.moveElements(u,{x:0,y:0},e,c));var y=o.incoming.slice(),f=o.outgoing.slice();L(y,function(v){l(v.source,e,v)&&n.reconnectEnd(v,e,Us(v,e,d),c)}),L(f,function(v){var g=v.target;l(e,g,v)&&n.reconnectStart(v,e,Gs(v,e,d),c)})},Zn.prototype.postExecute=function(t){var e=t.oldShape;this._modeling.removeShape(e)},Zn.prototype.execute=function(t){},Zn.prototype.revert=function(t){},Zn.prototype.createShape=function(t,e,n,i){return this._modeling.createShape(t,e,n,i)},Zn.prototype.reconnectStart=function(t,e,n,i){this._modeling.reconnectStart(t,e,n,i)},Zn.prototype.reconnectEnd=function(t,e,n,i){this._modeling.reconnectEnd(t,e,n,i)},oa.$inject=["modeling"],oa.prototype.execute=function(t){var e=t.shape,n=t.newBounds,i=t.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 t.oldBounds={width:e.width,height:e.height,x:e.x,y:e.y},z(e,{width:n.width,height:n.height,x:n.x,y:n.y}),e},oa.prototype.postExecute=function(t){var e=this._modeling,n=t.shape,i=t.oldBounds;(t.hints||{}).layout!==!1&&(L(n.incoming,function(r){e.layoutConnection(r,{connectionEnd:Us(r,n,i)})}),L(n.outgoing,function(r){e.layoutConnection(r,{connectionStart:Gs(r,n,i)})}))},oa.prototype.revert=function(t){var e=t.shape,n=t.oldBounds;return z(e,{width:n.width,height:n.height,x:n.x,y:n.y}),e},wi.$inject=["modeling"],wi.prototype.preExecute=function(t){var e=t.delta,n=t.direction,i=t.movingShapes,r=t.resizingShapes,o=t.start,a={};this.moveShapes(i,e),L(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,e,n),this.updateConnectionWaypoints(function(c,l){var u=[];return L(c.concat(l),function(p){var d=p.incoming,y=p.outgoing;L(d.concat(y),function(f){var v=f.source,g=f.target;(ta(c,v)||ta(c,g)||ta(l,v)||ta(l,g))&&(ta(u,f)||u.push(f))})}),u}(i,r),e,n,o,i,r,a)},wi.prototype.execute=function(){},wi.prototype.revert=function(){},wi.prototype.moveShapes=function(t,e){var n=this;L(t,function(i){n._modeling.moveShape(i,e,null,{autoResize:!1,layout:!1,recurse:!1})})},wi.prototype.resizeShapes=function(t,e,n){var i=this;L(t,function(r){var o=function(a,c,l){var u=a.x,p=a.y,d=a.width,y=a.height,f=l.x,v=l.y;switch(c){case"n":return{x:u,y:p+v,width:d,height:y-v};case"s":return{x:u,y:p,width:d,height:y+v};case"w":return{x:u+f,y:p,width:d-f,height:y};case"e":return{x:u,y:p,width:d+f,height:y};default:throw new Error("unknown direction: "+c)}}(r,n,e);i._modeling.resizeShape(r,o,null,{attachSupport:!1,autoResize:!1,layout:!1})})},wi.prototype.updateConnectionWaypoints=function(t,e,n,i,r,o,a){var c=this,l=r.concat(o);L(t,function(u){var p=u.source,d=u.target,y=function(g){return le(g.waypoints,function(b){return(b=zy(b)).original&&(b.original=zy(b.original)),b})}(u),f=$y(n),v={labelBehavior:!1};Si(l,p)&&Si(l,d)?(y=le(y,function(g){return Gy(g,i,n)&&(g[f]=g[f]+e[f]),g.original&&Gy(g.original,i,n)&&(g.original[f]=g.original[f]+e[f]),g}),c._modeling.updateWaypoints(u,y,{labelBehavior:!1})):(Si(l,p)||Si(l,d))&&(Si(r,p)?v.connectionStart=Zu(u,p,e):Si(r,d)?v.connectionEnd=Qu(u,d,e):Si(o,p)?v.connectionStart=Gs(u,p,a[p.id]):Si(o,d)&&(v.connectionEnd=Us(u,d,a[d.id])),c._modeling.layoutConnection(u,v))})},hc.$inject=["modeling"],hc.prototype.execute=function(t){var e=t.shape,n=e.children;t.oldChildrenVisibility=Uy(n),e.collapsed=!e.collapsed;var i=Hy(n,e.collapsed);return[e].concat(i)},hc.prototype.revert=function(t){var e=t.shape,n=t.oldChildrenVisibility,i=qy(e.children,n);return e.collapsed=!e.collapsed,[e].concat(i)},dc.$inject=["modeling"],dc.prototype.execute=function(t){var e=t.shape,n=t.newHost,i=e.host;return t.oldHost=i,t.attacherIdx=Wy(i,e),Xy(n,e),e.host=n,e},dc.prototype.revert=function(t){var e=t.shape,n=t.newHost,i=t.oldHost,r=t.attacherIdx;return e.host=i,Wy(n,e),Xy(i,e,r),e},Mp.prototype.execute=function(t){var e=t.connection,n=t.newWaypoints;return t.oldWaypoints=e.waypoints,e.waypoints=n,e},Mp.prototype.revert=function(t){var e=t.connection,n=t.oldWaypoints;return e.waypoints=n,e},Nt.$inject=["eventBus","elementFactory","commandStack"],Nt.prototype.getHandlers=function(){return{"shape.append":oc,"shape.create":_i,"shape.delete":na,"shape.move":Qi,"shape.resize":oa,"shape.replace":Zn,"shape.toggleCollapse":hc,spaceTool:wi,"label.create":ea,"connection.create":ac,"connection.delete":cc,"connection.move":kp,"connection.layout":uc,"connection.updateWaypoints":Mp,"connection.reconnect":ra,"elements.create":Tp,"elements.move":pc,"elements.delete":Ap,"elements.distribute":lc,"elements.align":rc,"element.updateAttachment":dc}},Nt.prototype.registerHandlers=function(t){L(this.getHandlers(),function(e,n){t.registerHandler(n,e)})},Nt.prototype.moveShape=function(t,e,n,i,r){typeof i=="object"&&(r=i,i=null);var o={shape:t,delta:e,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},Nt.prototype.updateAttachment=function(t,e){var n={shape:t,newHost:e};this._commandStack.execute("element.updateAttachment",n)},Nt.prototype.moveElements=function(t,e,n,i){var r,o=(i=i||{}).attach,a=n;o===!0?(r=n,a=n.parent):o===!1&&(r=null);var c={shapes:t,delta:e,newParent:a,newHost:r,hints:i};this._commandStack.execute("elements.move",c)},Nt.prototype.moveConnection=function(t,e,n,i,r){typeof i=="object"&&(r=i,i=void 0);var o={connection:t,delta:e,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},Nt.prototype.layoutConnection=function(t,e){var n={connection:t,hints:e||{}};this._commandStack.execute("connection.layout",n)},Nt.prototype.createConnection=function(t,e,n,i,r,o){typeof n=="object"&&(o=r,r=i,i=n,n=void 0);var a={source:t,target:e,parent:r,parentIndex:n,connection:i=this._create("connection",i),hints:o};return this._commandStack.execute("connection.create",a),a.connection},Nt.prototype.createShape=function(t,e,n,i,r){typeof i!="number"&&(r=i,i=void 0);var o,a,c=(r=r||{}).attach;t=this._create("shape",t),c?(o=n.parent,a=n):o=n;var l={position:e,shape:t,parent:o,parentIndex:i,host:a,hints:r};return this._commandStack.execute("shape.create",l),l.shape},Nt.prototype.createElements=function(t,e,n,i,r){gt(t)||(t=[t]),typeof i!="number"&&(r=i,i=void 0);var o={position:e,elements:t,parent:n,parentIndex:i,hints:r=r||{}};return this._commandStack.execute("elements.create",o),o.elements},Nt.prototype.createLabel=function(t,e,n,i){n=this._create("label",n);var r={labelTarget:t,position:e,parent:i||t.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},Nt.prototype.appendShape=function(t,e,n,i,r){r=r||{};var o={source:t,position:n,target:i,shape:e=this._create("shape",e),connection:r.connection,connectionParent:r.connectionParent,hints:r};return this._commandStack.execute("shape.append",o),o.shape},Nt.prototype.removeElements=function(t){var e={elements:t};this._commandStack.execute("elements.delete",e)},Nt.prototype.distributeElements=function(t,e,n){var i={groups:t,axis:e,dimension:n};this._commandStack.execute("elements.distribute",i)},Nt.prototype.removeShape=function(t,e){var n={shape:t,hints:e||{}};this._commandStack.execute("shape.delete",n)},Nt.prototype.removeConnection=function(t,e){var n={connection:t,hints:e||{}};this._commandStack.execute("connection.delete",n)},Nt.prototype.replaceShape=function(t,e,n){var i={oldShape:t,newData:e,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},Nt.prototype.alignElements=function(t,e){var n={elements:t,alignment:e};this._commandStack.execute("elements.align",n)},Nt.prototype.resizeShape=function(t,e,n,i){var r={shape:t,newBounds:e,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},Nt.prototype.createSpace=function(t,e,n,i,r){var o={delta:n,direction:i,movingShapes:t,resizingShapes:e,start:r};this._commandStack.execute("spaceTool",o)},Nt.prototype.updateWaypoints=function(t,e,n){var i={connection:t,newWaypoints:e,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},Nt.prototype.reconnect=function(t,e,n,i,r){var o={connection:t,newSource:e,newTarget:n,dockingOrPoints:i,hints:r||{}};this._commandStack.execute("connection.reconnect",o)},Nt.prototype.reconnectStart=function(t,e,n,i){i||(i={}),this.reconnect(t,e,t.target,n,z(i,{docking:"source"}))},Nt.prototype.reconnectEnd=function(t,e,n,i){i||(i={}),this.reconnect(t,t.source,e,n,z(i,{docking:"target"}))},Nt.prototype.connect=function(t,e,n,i){return this.createConnection(t,e,n||{},t.parent,i)},Nt.prototype._create=function(t,e){return e instanceof wo?e:this._elementFactory.create(t,e)},Nt.prototype.toggleCollapse=function(t,e){var n={shape:t,hints:e||{}};this._commandStack.execute("shape.toggleCollapse",n)},aa.$inject=["elementRegistry"],aa.prototype.execute=function(t){var e=t.element,n=t.moddleElement,i=t.properties;if(!n)throw new Error("<moddleElement> required");var r=t.changed||this.getVisualReferences(n).concat(e),o=t.oldProperties||function(a,c){return De(c,function(l,u){return l[u]=a.get(u),l},{})}(n,yo(i));return Ky(n,i),t.oldProperties=o,t.changed=r,r},aa.prototype.revert=function(t){var e=t.oldProperties,n=t.moddleElement,i=t.changed;return Ky(n,e),i},aa.prototype.getVisualReferences=function(t){var e=this._elementRegistry;return A(t,"bpmn:DataObject")?function(n,i){return i.filter(function(r){return A(r,"bpmn:DataObjectReference")&&et(r).dataObjectRef===n})}(t,e):[]};var sa="default",Qn="id",Yy="di",Q_={width:0,height:0};function ca(t,e,n,i,r){this._elementRegistry=t,this._moddle=e,this._translate=n,this._modeling=i,this._textRenderer=r}function Jy(t,e){return Qn in t&&t[Qn]!==e[Qn]}function Zy(t,e){L(e,function(n,i){i!==Yy?t.set(i,n):t.di&&function(r,o){L(o,function(a,c){r.set(c,a)})}(t.di,n)})}ca.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],ca.prototype.execute=function(t){var e=t.element,n=[e],i=this._translate;if(!e)throw new Error(i("element required"));var r=this._elementRegistry,o=this._moddle.ids,a=e.businessObject,c=function(u){var p=z({},u);return tw.forEach(function(d){d in u&&(p[d]=et(p[d]))}),p}(t.properties),l=t.oldProperties||function(u,p){var d=yo(p);return De(d,function(y,f){return y[f]=f!==Yy?u.get(f):function(v,g){return De(g,function(b,S){return b[S]=v.get(S),b},{})}(u.di,yo(p.di)),y},{})}(a,c);return Jy(c,a)&&(o.unclaim(a[Qn]),r.updateId(e,c[Qn]),o.claim(c[Qn],a)),sa in c&&(c[sa]&&n.push(r.get(c[sa].id)),a[sa]&&n.push(r.get(a[sa].id))),Zy(a,c),t.oldProperties=l,t.changed=n,n},ca.prototype.postExecute=function(t){var e=t.element.label,n=e&&et(e).name;if(n){var i=this._textRenderer.getExternalLabelBounds(e,n);this._modeling.resizeShape(e,i,Q_)}},ca.prototype.revert=function(t){var e=t.element,n=t.properties,i=t.oldProperties,r=e.businessObject,o=this._elementRegistry,a=this._moddle.ids;return Zy(r,i),Jy(n,r)&&(a.unclaim(n[Qn]),o.updateId(e,i[Qn]),a.claim(i[Qn],r)),t.changed};var tw=["default"];function mc(t,e){this._canvas=t,this._modeling=e}function Rp(t,e){this._modeling=t,this._spaceTool=e}function Np(t,e){this._modeling=t,this._translate=e}function la(t,e){this._modeling=t,this._spaceTool=e}mc.$inject=["canvas","modeling"],mc.prototype.execute=function(t){var e=this._canvas,n=t.newRoot,i=n.businessObject,r=e.getRootElement(),o=r.businessObject,a=o.$parent,c=o.di;e.setRootElement(n,!0),Jt(a.rootElements,i),i.$parent=a,Yt(a.rootElements,o),o.$parent=null,o.di=null,c.bpmnElement=i,i.di=c,t.oldRoot=r},mc.prototype.revert=function(t){var e=this._canvas,n=t.newRoot.businessObject,i=t.oldRoot,r=i.businessObject,o=n.$parent,a=n.di;e.setRootElement(i,!0),Yt(o.rootElements,n),n.$parent=null,Jt(o.rootElements,r),r.$parent=o,n.di=null,a.bpmnElement=r,r.di=a},Rp.$inject=["modeling","spaceTool"],Rp.prototype.preExecute=function(t){var e=this._spaceTool,n=this._modeling,i=t.shape,r=t.location,o=mn(i),a=o===i,c=a?i:i.parent;oi(c).length||n.createShape({type:"bpmn:Lane"},{x:i.x+Fr,y:i.y,width:i.width-Fr,height:i.height},c);var l=[];Fi(o,function(v){return l.push(v),v.label&&l.push(v.label),v===i?[]:dt(v.children,function(g){return g!==i})});var u=r==="top"?-120:120,p=r==="top"?i.y:i.y+i.height,d=p+(r==="top"?10:-10),y=r==="top"?"n":"s",f=e.calculateAdjustments(l,"y",u,d);e.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:u},y,d),t.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?Fr:0),y:p-(r==="top"?120:0),width:i.width-(a?Fr:0),height:120},c)},Np.$inject=["modeling","translate"],Np.prototype.preExecute=function(t){var e=this._modeling,n=this._translate,i=t.shape,r=t.count,o=oi(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var c,l,u,p,d,y=Math.round(i.height/r);for(d=0;d<r;d++)c=i.y+d*y,l=d===r-1?i.height-y*d:y,u={x:i.x+Fr,y:c,width:i.width-Fr,height:l},d<a?e.resizeShape(o[d],u):(p={type:"bpmn:Lane"},e.createShape(p,u,i))},la.$inject=["modeling","spaceTool"],la.prototype.preExecute=function(t){var e=t.shape,n=t.newBounds;t.balanced!==!1?this.resizeBalanced(e,n):this.resizeSpace(e,n)},la.prototype.resizeBalanced=function(t,e){var n=this._modeling,i=n_(t,e);n.resizeShape(t,e),i.forEach(function(r){n.resizeShape(r.shape,r.newBounds)})},la.prototype.resizeSpace=function(t,e){var n,i,r,o,a,c=this._spaceTool,l=at(t),u=ev(at(e),l),p=mn(t),d=[],y=[];Fi(p,function(f){return d.push(f),(A(f,"bpmn:Lane")||A(f,"bpmn:Participant"))&&y.push(f),f.children}),(u.bottom||u.top)&&(n=u.bottom||u.top,i=t.y+(u.bottom?t.height:0)+(u.bottom?-10:10),r=u.bottom?"s":"n",o=u.top>0||u.bottom<0?-n:n,a=c.calculateAdjustments(d,"y",o,i),c.makeSpace(a.movingShapes,a.resizingShapes,{x:0,y:n},r)),(u.left||u.right)&&(n=u.right||u.left,i=t.x+(u.right?t.width:0)+(u.right?-10:100),r=u.right?"e":"w",o=u.left>0||u.right<0?-n:n,a=c.calculateAdjustments(y,"x",o,i),c.makeSpace(a.movingShapes,a.resizingShapes,{x:n,y:0},r))};var ua="flowNodeRef",Ip="lanes";function pa(t){this._elementRegistry=t}function fc(t){this._moddle=t}pa.$inject=["elementRegistry"],pa.prototype.computeUpdates=function(t,e){var n=[],i=[],r={},o=[];function a(l){n.indexOf(l)===-1&&(o.push(l),n.push(l))}function c(l){if(!l.parent)return[];var u=function(p){var d=mn(p);return r[d.id]||(r[d.id]=Ps(d)),r[d.id]}(l);return u.filter(function(p){return d=l,y=at(p),f=d.x+d.width/2,v=d.y+d.height/2,f>y.left&&f<y.right&&v>y.top&&v<y.bottom;var d,y,f,v}).map(function(p){return p.businessObject})}return e.forEach(function(l){var u=mn(l);u&&n.indexOf(u)===-1&&(u.children.filter(function(p){return A(p,"bpmn:FlowNode")}).forEach(a),n.push(u))}),t.forEach(a),o.forEach(function(l){var u=l.businessObject,p=u.get(Ip).slice(),d=c(l);i.push({flowNode:u,remove:p,add:d})}),e.forEach(function(l){var u=l.businessObject;l.parent||u.get(ua).forEach(function(p){i.push({flowNode:p,remove:[u],add:[]})})}),i},pa.prototype.execute=function(t){var e=t.updates;e||(e=t.updates=this.computeUpdates(t.flowNodeShapes,t.laneShapes)),e.forEach(function(n){var i=n.flowNode,r=i.get(Ip);n.remove.forEach(function(o){Yt(r,o),Yt(o.get(ua),i)}),n.add.forEach(function(o){Jt(r,o),Jt(o.get(ua),i)})})},pa.prototype.revert=function(t){t.updates.forEach(function(e){var n=e.flowNode,i=n.get(Ip);e.add.forEach(function(r){Yt(i,r),Yt(r.get(ua),n)}),e.remove.forEach(function(r){Jt(i,r),Jt(r.get(ua),n)})})},fc.$inject=["moddle"],fc.prototype.execute=function(t){var e=this._moddle.ids,n=t.id,i=t.element;t.claiming?e.claim(n,i):e.unclaim(n)},fc.prototype.revert=function(t){var e=this._moddle.ids,n=t.id,i=t.element;t.claiming?e.unclaim(n):e.claim(n,i)};var ew={fill:void 0,stroke:void 0};function Dp(t){this._commandStack=t,this._normalizeColor=function(e){if(e){if(Ie(e)){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}(e);if(n)return n}throw new Error("invalid color value: "+e)}}}Dp.$inject=["commandStack"],Dp.prototype.postExecute=function(t){var e=t.elements,n=t.colors||ew,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)}),L(e,function(o){var a=function(c){return!!c.waypoints}(o)?Ke(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 nw={width:0,height:0};function Qy(t,e){function n(i,r){var o=i.label||i,a=i.labelTarget||i;return function(c,l,u){var p=c.businessObject,d=mm(p);d&&(d==="categoryValueRef"?p.categoryValueRef.value=l:p[d]=l)}(o,r),[o,a]}this.preExecute=function(i){var r=i.element,o=r.businessObject,a=i.newLabel;if(!ge(r)&&Rr(r)&&!as(r)&&!tg(a)){var c=ss(r);c={x:c.x,y:c.y+7},t.createLabel(r,c,{id:o.id+"_label",businessObject:o})}},this.execute=function(i){return i.oldLabel=un(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(ge(o)||A(o,"bpmn:TextAnnotation"))if(ge(o)&&tg(a))l.removeShape!==!1&&t.removeShape(o,{unsetLabel:!1});else{var u=un(o);c===void 0&&(c=e.getExternalLabelBounds(o,u)),c&&t.resizeShape(o,c,nw)}}}function tg(t){return!t||!t.trim()}function xe(t,e,n,i){Nt.call(this,t,e,n),this._bpmnRules=i}function eg(){}Qy.$inject=["modeling","textRenderer"],it(xe,Nt),xe.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],xe.prototype.getHandlers=function(){var t=Nt.prototype.getHandlers.call(this);return t["element.updateModdleProperties"]=aa,t["element.updateProperties"]=ca,t["canvas.updateRoot"]=mc,t["lane.add"]=Rp,t["lane.resize"]=la,t["lane.split"]=Np,t["lane.updateRefs"]=pa,t["id.updateClaim"]=fc,t["element.setColor"]=Dp,t["element.updateLabel"]=Qy,t},xe.prototype.updateLabel=function(t,e,n,i){this._commandStack.execute("element.updateLabel",{element:t,newLabel:e,newBounds:n,hints:i||{}})},xe.prototype.connect=function(t,e,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(t,e)),n)return this.createConnection(t,e,n,t.parent,i)},xe.prototype.updateModdleProperties=function(t,e,n){this._commandStack.execute("element.updateModdleProperties",{element:t,moddleElement:e,properties:n})},xe.prototype.updateProperties=function(t,e){this._commandStack.execute("element.updateProperties",{element:t,properties:e})},xe.prototype.resizeLane=function(t,e,n){this._commandStack.execute("lane.resize",{shape:t,newBounds:e,balanced:n})},xe.prototype.addLane=function(t,e){var n={shape:t,location:e};return this._commandStack.execute("lane.add",n),n.newLane},xe.prototype.splitLane=function(t,e){this._commandStack.execute("lane.split",{shape:t,count:e})},xe.prototype.makeCollaboration=function(){var t=this._create("root",{type:"bpmn:Collaboration"}),e={newRoot:t};return this._commandStack.execute("canvas.updateRoot",e),t},xe.prototype.updateLaneRefs=function(t,e){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:t,laneShapes:e})},xe.prototype.makeProcess=function(){var t={newRoot:this._create("root",{type:"bpmn:Process"})};this._commandStack.execute("canvas.updateRoot",t)},xe.prototype.claimId=function(t,e){this._commandStack.execute("id.updateClaim",{id:t,element:e,claiming:!0})},xe.prototype.unclaimId=function(t,e){this._commandStack.execute("id.updateClaim",{id:t,element:e})},xe.prototype.setColor=function(t,e){t.length||(t=[t]),this._commandStack.execute("element.setColor",{elements:t,colors:e})},eg.prototype.layoutConnection=function(t,e){return[(e=e||{}).connectionStart||ft(e.source||t.source),e.connectionEnd||ft(e.target||t.target)]};var vc=20,iw=5,yc=Math.round,ng=20,rw={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function ig(t,e,n){var i,r,o,a=ye(e,t,iw),c=n.split(":")[0],l=yc((e.x-t.x)/2+t.x),u=yc((e.y-t.y)/2+t.y),p=(o=a,{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/left|right/,v:/top|bottom/}[c].test(o)),d=/h|r|l/.test(c),y=!1,f=!1;return p?(i=d?{x:l,y:t.y}:{x:t.x,y:u},r=d?"h:h":"v:v"):(y=function(v,g){return!{t:/top/,r:/right/,b:/bottom/,l:/left/,h:/./,v:/./}[g].test(v)}(a,c),r=d?"h:v":"v:h",y?d?(f=u===t.y,i={x:t.x+vc*(/l/.test(c)?-1:1),y:f?u+vc:u}):i={x:(f=l===t.x)?l+vc:l,y:t.y+vc*(/t/.test(c)?-1:1)}:i={x:l,y:u}),{waypoints:Bp(t,i,r).concat(i),directions:r,turnNextDirections:f}}function rg(t){return t.split(":").reverse().join(":")}function Bp(t,e,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(ag(n)){var i=function(a,c,l){return ig(a,c,l)}(t,e,n),r=function(a,c,l){var u=ig(c,a,rg(l));return{waypoints:u.waypoints.slice().reverse(),directions:rg(u.directions),turnNextDirections:u.turnNextDirections}}(t,e,n),o=function(a,c){var l=a.directions.split(":")[1],u=c.directions.split(":")[0];a.turnNextDirections&&(l=l=="h"?"v":"h"),c.turnNextDirections&&(u=u=="h"?"v":"h");var p=l+":"+u;return{waypoints:Bp(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=yc((c.x-a.x)/2+a.x),p=yc((c.y-a.y)/2+a.y);if(l==="h:v")return[{x:c.x,y:a.y}];if(l==="v:h")return[{x:a.x,y:c.y}];if(l==="h:h")return[{x:u,y:a.y},{x:u,y:c.y}];if(l==="v:v")return[{x:a.x,y:p},{x:c.x,y:p}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}(t,e,n)}function ow(t,e,n,i,r){var o=Kh(r&&r.preferredLayouts||[],"straight")[0]||"h:h",a=ye(t,e,rw[o]||0),c=function(p,d){if(ag(d))return d;switch(p){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return d}}(a,o);n=n||ft(t),i=i||ft(e);var l=c.split(":"),u=sg(n,t,l[0],function(p){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[p]}(a));return function(p,d,y){var f=Bp(p,d,y);return f.unshift(p),f.push(d),cg(f)}(u,sg(i,e,l[1],a),c)}function aw(t,e,n,i,r,o){var a;return gt(n)&&(r=n,o=i,n=ft(t),i=ft(e)),r=r||[],a=(o=z({preferredLayouts:[]},o)).preferredLayouts.indexOf("straight")!==-1&&function(c,l,u,p,d){var y,f,v={};return f=ye(c,l),/^(top|bottom|left|right)$/.test(f)?(/top|bottom/.test(f)&&(y="x"),/left|right/.test(f)&&(y="y"),d.preserveDocking==="target"?og(y,p,c)?(v[y]=p[y],[{x:v.x!==void 0?v.x:u.x,y:v.y!==void 0?v.y:u.y,original:{x:v.x!==void 0?v.x:u.x,y:v.y!==void 0?v.y:u.y}},{x:p.x,y:p.y}]):null:og(y,u,l)?(v[y]=u[y],[{x:u.x,y:u.y},{x:v.x!==void 0?v.x:p.x,y:v.y!==void 0?v.y:p.y,original:{x:v.x!==void 0?v.x:p.x,y:v.y!==void 0?v.y:p.y}}]):null):null}(t,e,n,i,o),a||(a=o.connectionEnd&&function(c,l,u,p){var d=p.slice().reverse();return d=Op(c,l,u,d),d?d.reverse():null}(e,t,i,r),a||(a=o.connectionStart&&Op(t,e,n,r))||(!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:ow(t,e,n,i,o)))}function og(t,e,n){return function(i,r,o){return i>=r&&i<=o}(e[t],n[t],n[t]+n[{x:"width",y:"height"}[t]])}function Op(t,e,n,i){if(function(c){return c.length<3||!(c.length>4)&&!!Pt(c,function(l,u){var p=c[u-1];return p&&Eo(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(zn(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(bd(c[p],l,ng)||bd(c[p],u,ng))return c.slice(p);return c}(a,t,e),r!==a&&(a=Op(t,e,n,r)),a&&zn(a)?null:a}function ag(t){return t&&/t|r|b|l/.test(t)}function sg(t,e,n,i){if(n==="h"&&(n=/left/.test(i)?"l":"r"),n==="v"&&(n=/top/.test(i)?"t":"b"),n==="t")return{original:t,x:t.x,y:e.y};if(n==="r")return{original:t,x:e.x+e.width,y:t.y};if(n==="b")return{original:t,x:t.x,y:e.y+e.height};if(n==="l")return{original:t,x:e.x,y:t.y};throw new Error("unexpected dockingDirection: <"+n+">")}function cg(t){return t.reduce(function(e,n,i){return Dl(e[e.length-1],t[i+1],n,0)||e.push(n),e},[])}var sw=-10,cw=40,Lp={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},gc={top:"t",right:"r",bottom:"b",left:"l"};function jp(){}function lw(t,e){return A(e,"bpmn:Participant")?"source":A(t,"bpmn:Participant")?"target":ha(e)?"source":ha(t)||A(e,"bpmn:Event")?"target":A(t,"bpmn:Event")?"source":null}function uw(t){return ha(t)?"target":"source"}function lg(t,e){return t?t.original||t:ft(e)}function ug(t,e){return A(e,"bpmn:Activity")&&A(t,"bpmn:BoundaryEvent")&&e.businessObject.isForCompensation}function ha(t){return A(t,"bpmn:SubProcess")&&Mt(t)}function da(t,e){return t===e}function ma(t){var e=/right|left/.exec(t);return e&&e[0]}function tr(t){var e=/top|bottom/.exec(t);return e&&e[0]}function Vp(t){return t==="right"||t==="left"}function pw(t,e){var n=e.waypoints,i=n&&n.length&&ye(n[0],t);return i==="top"?["t:r"]:i==="right"?["r:b"]:i==="left"?["l:t"]:["b:l"]}function hw(t,e,n){var i,r,o,a,c=ft(t),l=ft(e),u=(a=(o=t).host,ye(ft(o),a,sw)),p=da(t.host,e),d=["top","right","bottom","left"].indexOf(u)!==-1,y=ye(l,c,{x:t.width/2+e.width/2,y:t.height/2+e.height/2});return p?function(f,v,g,b,S){var w,_=v?f:tr(f),C=gc[_];return w=v?Vp(f)?pg("y",g,b,S)?"h":"b":pg("x",g,b,S)?"v":"l":"v",[C+":"+w]}(u,d,t,e,n):(i=function(f,v,g){if(g)return gc[f];if(da(tr(f),tr(v))||(b=ma(f),S=ma(v),Lp[b]===S))return gc[tr(f)];var b,S;return gc[ma(f)]}(u,y,d),r=function(f,v,g){if(g)return Vp(f)?(b=v,S=ma(f),w=Lp[S],b.indexOf(w)!==-1||da(f,v)?"h":"v"):function(_,C){var B=tr(_),s=Lp[B];return C.indexOf(s)!==-1}(f,v)||da(f,v)?"v":"h";var b,S,w;return Vp(v)||da(tr(f),tr(v))&&ma(v)?"h":"v"}(u,y,d),[i+":"+r])}function pg(t,e,n,i){var r=cw;return!(Fp(t,i,n,r)||Fp(t,i,{x:n.x+n.width,y:n.y+n.height},r)||Fp(t,i,ft(e),r))}function Fp(t,e,n,i){return Math.abs(e[t]-n[t])<i}function hg(t){return z({original:t.point.original||t.point},t.actual)}function Ci(t,e){this._elementRegistry=t,this._graphicsFactory=e}it(jp,eg),jp.prototype.layoutConnection=function(t,e){e||(e={});var n,i,r=e.source||t.source,o=e.target||t.target,a=e.waypoints||t.waypoints,c=e.connectionStart,l=e.connectionEnd;return c||(c=lg(a&&a[0],r)),l||(l=lg(a&&a[a.length-1],o)),(A(t,"bpmn:Association")||A(t,"bpmn:DataAssociation"))&&a&&!ug(r,o)?[].concat([c],a.slice(1,-1),[l]):(A(t,"bpmn:MessageFlow")?n=function(u,p){return{preferredLayouts:["straight","v:v"],preserveDocking:lw(u,p)}}(r,o):(A(t,"bpmn:SequenceFlow")||ug(r,o))&&(n=r===o?{preferredLayouts:pw(r,t)}:A(r,"bpmn:BoundaryEvent")?{preferredLayouts:hw(r,o,l)}:ha(r)||ha(o)?function(u){return{preferredLayouts:["straight","h:h"],preserveDocking:uw(u)}}(r):A(r,"bpmn:Gateway")?{preferredLayouts:["v:h"]}:A(o,"bpmn:Gateway")?{preferredLayouts:["h:v"]}:{preferredLayouts:["h:h"]}),n&&(i=cg(aw(r,o,c,l,a,n=z(n,e)))),i||[c,l])},Ci.$inject=["elementRegistry","graphicsFactory"],Ci.prototype.getCroppedWaypoints=function(t,e,n){e=e||t.source,n=n||t.target;var i=this.getDockingPoint(t,e,!0),r=this.getDockingPoint(t,n),o=t.waypoints.slice(i.idx+1,r.idx);return o.unshift(hg(i)),o.push(hg(r)),o},Ci.prototype.getDockingPoint=function(t,e,n){var i,r,o=t.waypoints;return{point:r=o[i=n?0:o.length-1],actual:this._getIntersection(e,t,n)||r,idx:i}},Ci.prototype._getIntersection=function(t,e,n){return Vl(this._getShapePath(t),this._getConnectionPath(e),n)},Ci.prototype._getConnectionPath=function(t){return this._graphicsFactory.getConnectionPath(t)},Ci.prototype._getShapePath=function(t){return this._graphicsFactory.getShapePath(t)},Ci.prototype._getGfx=function(t){return this._elementRegistry.getGraphics(t)};const dw={__init__:["modeling","bpmnUpdater"],__depends__:[j_,$_,G_,U_,Zf,H_,W_,X_,K_,Mn,yv,By],bpmnFactory:["type",rn],bpmnUpdater:["type",je],elementFactory:["type",Ei],modeling:["type",xe],layouter:["type",jp],connectionDocking:["type",Ci]};var bc=Math.round;function dg(t,e,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(te(u)&&(p=u,u=!1),!l.waypoints&&l.parent){var d=function(y){return{x:y.x+bc(y.width/2),y:y.y+bc(y.height/2)}}(l);return e.init(c,d,"shape.move",{cursor:"grabbing",autoActivate:u,data:{shape:l,context:p||{}}}),!0}}t.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(d){var y=ji(d,"id");return dt(d,function(f){for(;f=f.parent;)if(y[f.id])return!1;return!0})}(p),z(l,{shapes:p,validatedShapes:p,shape:u})}),t.on("shape.move.start",1250,function(c){var l=c.context,u=l.validatedShapes;if(!(l.canExecute=o(u)))return!1}),t.on("shape.move.move",500,function(c){var l,u=c.context,p=u.validatedShapes,d=c.hover,y={x:c.dx,y:c.dy};l=o(p,y,{x:c.x,y:c.y},d),u.delta=y,u.canExecute=l,u.target=l!==null?d:null}),t.on("shape.move.end",function(c){var l=c.context,u=l.delta,p=l.canExecute,d=p==="attach",y=l.shapes;if(p===!1)return!1;u.x=bc(u.x),u.y=bc(u.y),u.x===0&&u.y===0||n.moveElements(y,u,l.target,{primaryShape:l.shape,attach:d})}),t.on("element.mousedown",function(c){if(yi(c)){var l=Nr(c);if(!l)throw new Error("must supply DOM mousedown event");return a(l,c.element)}}),this.start=a}dg.$inject=["eventBus","dragging","modeling","selection","rules"];var zp="djs-dragging",mg="drop-ok",fg="drop-not-ok",vg="new-parent",yg="attach-ok";function gg(t,e,n,i){function r(c){var l=function(u){var p=dt(u,function(d){return!function(y){return y.waypoints}(d)||Pt(u,Xe({id:d.source.id}))&&Pt(u,Xe({id:d.target.id}))});return p}(o(c));return l}function o(c){var l=Va(c,!0),u=le(l,function(p){return(p.incoming||[]).concat(p.outgoing||[])});return mo(l.concat(u))}function a(c,l){[yg,mg,fg,vg].forEach(function(u){u===l?e.addMarker(c,u):e.removeMarker(c,u)})}t.on("shape.move.start",499,function(c){var l=c.context,u=l.shapes,p=l.allDraggedElements,d=r(u);if(!l.dragGroup){var y=ot("g");K(y,n.cls("djs-drag-group",["no-events"])),lt(e.getActiveLayer(),y),l.dragGroup=y}d.forEach(function(f){i.addDragger(f,l.dragGroup)}),L(p=p?mo([p,o(u)]):o(u),function(f){e.addMarker(f,zp)}),l.allDraggedElements=p,l.differentParents=vr(ji(u,function(f){return f.parent&&f.parent.id}))!==1}),t.on("shape.move.move",499,function(c){var l=c.context,u=l.dragGroup,p=l.target,d=l.shape.parent,y=l.canExecute;p&&(y==="attach"?a(p,yg):l.canExecute&&p&&p.id!==d.id?a(p,vg):a(p,l.canExecute?mg:fg)),Oe(u,c.dx,c.dy)}),t.on(["shape.move.out","shape.move.cleanup"],function(c){var l=c.context.target;l&&a(l,null)}),t.on("shape.move.cleanup",function(c){var l=c.context,u=l.allDraggedElements,p=l.dragGroup;L(u,function(d){e.removeMarker(d,zp)}),p&&ee(p)}),this.makeDraggable=function(c,l,u){i.addDragger(l,c.dragGroup),u&&e.addMarker(l,zp),c.allDraggedElements?c.allDraggedElements.push(l):c.allDraggedElements=[l]}}gg.$inject=["eventBus","canvas","styles","previewSupport"];const mw={__depends__:[No,Mn,wm,In,Wn,Fo],__init__:["move","movePreview"],move:["type",dg],movePreview:["type",gg]};var bg=".djs-palette-toggle",xg=".entry",fw=bg+", "+xg,$p="djs-palette-",Gp="open",Eg="two-column";function ie(t,e){this._eventBus=t,this._canvas=e;var n=this;t.on("tool-manager.update",function(i){var r=i.tool;n.updateToolHighlight(r)}),t.on("i18n.changed",function(){n._update()}),t.on("diagram.init",function(){n._diagramInitialized=!0,n._rebuild()})}function vw(t,e){var n=e.getPaletteEntries();return fe(n)?n(t):(L(n,function(i,r){t[r]=i}),t)}ie.$inject=["eventBus","canvas"],ie.prototype.registerProvider=function(t,e){e||(e=t,t=1e3),this._eventBus.on("palette.getProviders",t,function(n){n.providers.push(e)}),this._rebuild()},ie.prototype.getEntries=function(){return this._getProviders().reduce(vw,{})},ie.prototype._rebuild=function(){this._diagramInitialized&&this._getProviders().length&&(this._container||this._init(),this._update())},ie.prototype._init=function(){var t=this,e=this._eventBus,n=this._getParentContainer(),i=this._container=jt(ie.HTML_MARKUP);n.appendChild(i),oe(n).add($p+"shown"),$e.bind(i,fw,"click",function(r){var o=r.delegateTarget;if(La(o,bg))return t.toggle();t.trigger("click",r)}),ct.bind(i,"mousedown",function(r){r.stopPropagation()}),$e.bind(i,xg,"dragstart",function(r){t.trigger("dragstart",r)}),e.on("canvas.resized",this._layoutChanged,this),e.fire("palette.create",{container:i})},ie.prototype._getProviders=function(t){var e=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ie.prototype._toggleState=function(t){t=t||{};var e,n=this._getParentContainer(),i=this._container,r=this._eventBus,o=oe(i),a=oe(n);e="twoColumn"in t?t.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),o.toggle(Eg,e),a.toggle($p+Eg,e),"open"in t&&(o.toggle(Gp,t.open),a.toggle($p+Gp,t.open)),r.fire("palette.changed",{twoColumn:e,open:this.isOpen()})},ie.prototype._update=function(){var t=Wt(".djs-palette-entries",this._container),e=this._entries=this.getEntries();Oa(t),L(e,function(n,i){var r=n.group||"default",o=Wt("[data-group="+r+"]",t);o||(o=jt('<div class="group" data-group="'+r+'"></div>'),t.appendChild(o));var a=n.html||(n.separator?'<hr class="separator" />':'<div class="entry" draggable="true"></div>'),c=jt(a);o.appendChild(c),n.separator||(ze(c,"data-action",i),n.title&&ze(c,"title",n.title),n.className&&function(l,u){var p=oe(l);(gt(u)?u:u.split(/\s+/g)).forEach(function(d){p.add(d)})}(c,n.className),n.imageUrl&&c.appendChild(jt('<img src="'+n.imageUrl+'">')))}),this.open()},ie.prototype.trigger=function(t,e,n){var i,r,o,a=this._entries,c=e.delegateTarget||e.target;if(!c)return e.preventDefault();(i=a[ze(c,"data-action")])&&(r=i.action,o=e.originalEvent||e,fe(r)?t==="click"&&r(o,n):r[t]&&r[t](o,n),e.preventDefault())},ie.prototype._layoutChanged=function(){this._toggleState({})},ie.prototype._needsCollapse=function(t,e){return t<46*Object.keys(e).length+50},ie.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},ie.prototype.open=function(){this._toggleState({open:!0})},ie.prototype.toggle=function(t){this.isOpen()?this.close():this.open()},ie.prototype.isActiveTool=function(t){return t&&this._activeTool===t},ie.prototype.updateToolHighlight=function(t){var e;this._toolsContainer||(e=Wt(".djs-palette-entries",this._container),this._toolsContainer=Wt("[data-group=tools]",e)),L(this._toolsContainer.children,function(n){var i=n.getAttribute("data-action");if(i){var r=oe(n);i=i.replace("-tool",""),r.contains("entry")&&i===t?r.add("highlighted-entry"):r.remove("highlighted-entry")}})},ie.prototype.isOpen=function(){return oe(this._container).has(Gp)},ie.prototype._getParentContainer=function(){return this._canvas.getContainer()},ie.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';const yw={__init__:["palette"],palette:["type",ie]};var _g="crosshair";function er(t,e,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var c=this,l=function(d){var y,f=e.getActiveLayer();K(y=d.frame=ot("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),lt(f,y)},u=function(d){var y=d.frame,f=d.bbox;K(y,{x:f.x,y:f.y,width:f.width,height:f.height})},p=function(d){d.frame&&ee(d.frame)};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),t.on("lasso.selection.end",function(d){var y=d.originalEvent.target;(d.hover||y instanceof SVGElement)&&t.once("lasso.selection.ended",function(){c.activateLasso(d.originalEvent,!0)})}),t.on("lasso.end",function(d){var y=Up(d),f=i.filter(function(v){return v});c.select(f,y)}),t.on("lasso.start",function(d){var y=d.context;y.bbox=Up(d),l(y)}),t.on("lasso.move",function(d){var y=d.context;y.bbox=Up(d),u(y)}),t.on("lasso.cleanup",function(d){var y=d.context;p(y)}),t.on("element.mousedown",1500,function(d){if(Em(d))return c.activateLasso(d.originalEvent),!0})}function Up(t){var e={x:t.x-t.dx,y:t.y-t.dy},n={x:t.x,y:t.y};return e.x<=n.x&&e.y<n.y||e.x<n.x&&e.y<=n.y?{x:e.x,y:e.y,width:n.x-e.x,height:n.y-e.y}:e.x>=n.x&&e.y<n.y||e.x>n.x&&e.y<=n.y?{x:n.x,y:e.y,width:e.x-n.x,height:n.y-e.y}:e.x<=n.x&&e.y>n.y||e.x<n.x&&e.y>=n.y?{x:e.x,y:n.y,width:n.x-e.x,height:e.y-n.y}:e.x>=n.x&&e.y>n.y||e.x>n.x&&e.y>=n.y?{x:n.x,y:n.y,width:e.x-n.x,height:e.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}er.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],er.prototype.activateLasso=function(t,e){this._dragging.init(t,"lasso",{autoActivate:e,cursor:_g,data:{context:{}}})},er.prototype.activateSelection=function(t,e){this._dragging.init(t,"lasso.selection",{trapClick:!1,autoActivate:e,cursor:_g,data:{context:{}}})},er.prototype.select=function(t,e){var n=function(i,r){var o={};return L(i,function(a){var c=a;c.waypoints&&(c=ve(c)),!pt(r.y)&&c.x>r.x&&(o[a.id]=a),!pt(r.x)&&c.y>r.y&&(o[a.id]=a),c.x>r.x&&c.y>r.y&&(pt(r.width)&&pt(r.height)&&c.width+c.x<r.width+r.x&&c.height+c.y<r.height+r.y?o[a.id]=a:pt(r.width)&&pt(r.height)||(o[a.id]=a))}),o}(t,e);this._selection.select(Ba(n))},er.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();this.activateSelection(t,!!t)},er.prototype.isActive=function(){var t=this._dragging.context();return t&&/^lasso/.test(t.prefix)};const gw={__depends__:[tc,Go],__init__:["lassoTool"],lassoTool:["type",er]};var Hp=1500,wg="grab";function Hr(t,e,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"}),t.on("element.mousedown",Hp,function(l){if(Ir(l))return a.activateMove(l.originalEvent,!0),!1}),c&&c.addListener(Hp,function(l){if(Sg(l.keyEvent)&&!a.isActive()){var u=a._mouse.getLastMoveEvent();a.activateMove(u,!!u)}},"keyboard.keydown"),c&&c.addListener(Hp,function(l){Sg(l.keyEvent)&&a.isActive()&&a.toggle()},"keyboard.keyup"),t.on("hand.end",function(l){var u=l.originalEvent.target;if(!(l.hover||u instanceof SVGElement))return!1;t.once("hand.ended",function(){a.activateMove(l.originalEvent,{reactivate:!0})})}),t.on("hand.move.move",function(l){var u=e.viewbox().scale;e.scroll({dx:l.dx*u,dy:l.dy*u})}),t.on("hand.move.end",function(l){var u=l.context.reactivate;return!Ir(l)&&u&&t.once("hand.move.ended",function(p){a.activateHand(p.originalEvent,!0,!0)}),!1})}function Sg(t){return pn(" ",t)}Hr.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],Hr.prototype.activateMove=function(t,e,n){typeof e=="object"&&(n=e,e=!1),this._dragging.init(t,"hand.move",{autoActivate:e,cursor:wg,data:{context:n||{}}})},Hr.prototype.activateHand=function(t,e,n){this._dragging.init(t,"hand",{trapClick:!1,autoActivate:e,cursor:wg,data:{context:{reactivate:n}}})},Hr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();this.activateHand(t,!!t)},Hr.prototype.isActive=function(){var t=this._dragging.context();return!!t&&/^(hand|hand\.move)$/.test(t.prefix)};const bw={__depends__:[tc,Go],__init__:["handTool"],handTool:["type",Hr]};var Cg="connect-ok",Tg="connect-not-ok";function qr(t,e,n,i,r,o,a){var c=this;this._dragging=e,this._rules=o,this._mouse=a,r.registerTool("global-connect",{tool:"global-connect",dragging:"global-connect.drag"}),t.on("global-connect.hover",function(l){var u=l.context,p=l.hover,d=u.canStartConnect=c.canStartConnect(p);d!==null&&(u.startTarget=p,i.addMarker(p,d?Cg:Tg))}),t.on(["global-connect.out","global-connect.cleanup"],function(l){var u=l.context.startTarget,p=l.context.canStartConnect;u&&i.removeMarker(u,p?Cg:Tg)}),t.on(["global-connect.ended"],function(l){var u=l.context.startTarget,p={x:l.x,y:l.y};if(c.canStartConnect(u))return t.once("element.out",function(){t.once(["connect.ended","connect.canceled"],function(){t.fire("global-connect.drag.ended")}),n.start(null,u,p)}),!1})}qr.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],qr.prototype.start=function(t,e){this._dragging.init(t,"global-connect",{autoActivate:e,trapClick:!1,data:{context:{}}})},qr.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();return this.start(t,!!t)},qr.prototype.isActive=function(){var t=this._dragging.context();return t&&/^global-connect/.test(t.prefix)},qr.prototype.canStartConnect=function(t){return this._rules.allowed("connection.start",{source:t})};const xw={__depends__:[Eu,In,Wn,tc,Go],globalConnect:["type",qr]};Ra=function(t,e,n,i,r,o,a,c){this._palette=t,this._create=e,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=c,t.registerProvider(this)},Ra.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],Ra.prototype.getPaletteEntries=function(t){var e={},n=this._create,i=this._elementFactory,r=this._spaceTool,o=this._lassoTool,a=this._handTool,c=this._globalConnect,l=this._translate;function u(y,f,v,g,b){function S(_){var C=i.createShape(z({type:y},b));b&&(C.businessObject.di.isExpanded=b.isExpanded),n.start(_,C)}var w=y.replace(/^bpmn:/,"");return{group:f,className:v,title:g||l("Create {type}",{type:w}),action:{dragstart:S,click:S}}}function p(y){var f=i.createShape({type:"bpmn:SubProcess",x:0,y:0,isExpanded:!0}),v=i.createShape({type:"bpmn:StartEvent",x:40,y:82,parent:f});n.start(y,[f,v],{hints:{autoSelect:[f]}})}function d(y){n.start(y,i.createParticipantShape())}return z(e,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:l("Activate the hand tool"),action:{click:function(y){a.activateHand(y)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:l("Activate the lasso tool"),action:{click:function(y){o.activateSelection(y)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:l("Activate the create/remove space tool"),action:{click:function(y){r.activateSelection(y)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:l("Activate the global connect tool"),action:{click:function(y){c.start(y)}}},"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:d,click:d}},"create.group":u("bpmn:Group","artifact","bpmn-icon-group",l("Create Group"))}),e};const Ew={__depends__:[yw,xs,By,gw,bw,xw,os],__init__:["paletteProvider"],paletteProvider:["type",Ra]};function qp(t,e,n,i,r){Q.call(this,t),t.on("shape.move.move",250,function(o){var a=o.context,c=a.canExecute;a.visualReplacements||(a.visualReplacements={}),c&&c.replacements?function(l){L(l.canExecute.replacements,function(u){var p=u.oldElementId,d={type:u.newElementType};if(!l.visualReplacements[p]){var y=e.get(p);z(d,{x:y.x,y:y.y});var f=n.createShape(d);i.addShape(f,y.parent);var v=Wt('[data-element-id="'+yu(y.id)+'"]',l.dragGroup);v&&K(v,{display:"none"});var g=r.addDragger(f,l.dragGroup);l.visualReplacements[p]=g,i.removeShape(f)}})}(a):function(l){var u=l.visualReplacements;L(u,function(p,d){var y=Wt('[data-element-id="'+yu(d)+'"]',l.dragGroup);y&&K(y,{display:"inline"}),p.remove(),u[d]&&delete u[d]})}(a)})}qp.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],it(qp,Q);const _w={__depends__:[Fo],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",qp]};var Wp=40,ww=20,Sw=10,Ag=20,kg=["x","y"],Cw=Math.abs;function Pg(t){t.on(["connect.hover","connect.move","connect.end"],1250,function(e){var n=e.context,i=n.canExecute,r=n.start,o=n.hover,a=n.source,c=n.target;e.originalEvent&&He(e.originalEvent)||(n.initialConnectionStart||(n.initialConnectionStart=n.connectionStart),i&&o&&function(l,u,p){kg.forEach(function(d){var y=Ng(d,u);l[d]<u[d]+p?se(l,d,u[d]+p):l[d]>u[d]+y-p&&se(l,d,u[d]+y-p)})}(e,o,function(l){return A(l,"bpmn:Task")?Sw:ww}(o)),o&&function(l,u){return ai(u,function(p){return Rg(l,p)})}(i,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=Ze(r),wt(o,["bpmn:Event","bpmn:Gateway"])&&Mg(e,Ze(o)),wt(o,["bpmn:Task","bpmn:SubProcess"])&&function(l,u){var p=Ze(u);kg.forEach(function(d){(function(y,f,v){return y[v]>f[v]+Ag&&y[v]<f[v]+Ng(v,f)-Ag})(l,u,d)&&se(l,d,p[d])})}(e,o),A(a,"bpmn:BoundaryEvent")&&c===a.host&&function(l){var u=l.context,p=u.source,d=u.target;if(!function(g){var b=g.hover,S=g.source;return b&&S&&b===S}(u)){var y=Ze(p),f=ye(y,d,-10),v=[];/top|bottom/.test(f)&&v.push("x"),/left|right/.test(f)&&v.push("y"),v.forEach(function(g){var b,S=l[g];Cw(S-y[g])<Wp&&(b=S>y[g]?y[g]+Wp:y[g]-Wp,se(l,g,b))})}}(e)):Rg(i,"bpmn:MessageFlow")?(A(r,"bpmn:Event")&&(n.connectionStart=Ze(r)),A(o,"bpmn:Event")&&Mg(e,Ze(o))):n.connectionStart=n.initialConnectionStart)})}function Mg(t,e){se(t,"x",e.x),se(t,"y",e.y)}function Rg(t,e){return t&&t.type===e}function Ng(t,e){return t==="x"?e.width:e.height}function Ti(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function xc(t){this._snapValues={}}Pg.$inject=["eventBus"],Ti.prototype.getSnapOrigin=function(t){return this._snapOrigins[t]},Ti.prototype.setSnapOrigin=function(t,e){this._snapOrigins[t]=e,this._snapLocations.indexOf(t)===-1&&this._snapLocations.push(t)},Ti.prototype.addDefaultSnap=function(t,e){var n=this._defaultSnaps[t];n||(n=this._defaultSnaps[t]=[]),n.push(e)},Ti.prototype.getSnapLocations=function(){return this._snapLocations},Ti.prototype.setSnapLocations=function(t){this._snapLocations=t},Ti.prototype.pointsForTarget=function(t){var e=t.id||t,n=this._targets[e];return n||(n=this._targets[e]=new xc).initDefaults(this._defaultSnaps),n},xc.prototype.add=function(t,e){var n=this._snapValues[t];n||(n=this._snapValues[t]={x:[],y:[]}),n.x.indexOf(e.x)===-1&&n.x.push(e.x),n.y.indexOf(e.y)===-1&&n.y.push(e.y)},xc.prototype.snap=function(t,e,n,i){var r=this._snapValues[e];return r&&function(o,a,c){var l,u;for(c=c===void 0?10:c,l=0;l<a.length;l++)if(u=a[l],SE(u-o)<=c)return u}(t[n],r[n],i)},xc.prototype.initDefaults=function(t){var e=this;L(t||{},function(n,i){L(n,function(r){e.add(i,r)})})};var Tw=1250;function Bn(t,e,n){var i=this;this._elementRegistry=t,e.on(["create.start","shape.move.start"],function(r){i.initSnap(r)}),e.on(["create.move","create.end","shape.move.move","shape.move.end"],Tw,function(r){var o=r.context,a=o.shape,c=o.snapContext,l=o.target;if((!r.originalEvent||!He(r.originalEvent))&&!Vr(r)&&l){var u=c.pointsForTarget(l);u.initialized||((u=i.addSnapTargetPoints(u,a,l)).initialized=!0),n.snap(r,u)}}),e.on(["create.cleanup","shape.move.cleanup"],function(){n.hide()})}function Xp(t){return!!t.labelTarget}Bn.$inject=["elementRegistry","eventBus","snapping"],Bn.prototype.initSnap=function(t){var e,n=this._elementRegistry,i=t.context,r=i.shape,o=i.snapContext;o||(o=i.snapContext=new Ti);var a=(e=n.get(r.id)?Ze(r,t):{x:t.x+Ze(r).x,y:t.y+Ze(r).y}).x-r.width/2,c=e.y-r.height/2,l=e.x+r.width/2,u=e.y+r.height/2;return o.setSnapOrigin("mid",{x:e.x-t.x,y:e.y-t.y}),Xp(r)||(o.setSnapOrigin("top-left",{x:a-t.x,y:c-t.y}),o.setSnapOrigin("bottom-right",{x:l-t.x,y:u-t.y})),o},Bn.prototype.addSnapTargetPoints=function(t,e,n){return L(this.getSnapTargets(e,n),function(i){if(Xp(i))Xp(e)&&t.add("mid",Ze(i));else if(i.waypoints){if(i.waypoints.length<3)return;L(i.waypoints.slice(1,-1),function(r){t.add("mid",r)})}else t.add("mid",Ze(i))}),pt(e.x)&&pt(e.y)&&this._elementRegistry.get(e.id)&&t.add("mid",Ze(e)),t},Bn.prototype.getSnapTargets=function(t,e){return wf(e).filter(function(n){return!n.hidden})};function Wr(t,e){e.invoke(Bn,this),t.on(["create.move","create.end"],1500,Aw),t.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)&&!Vr(n)&&function(a,c){var l,u=at(c),p=cy(a,c),d=a.context,y=d.shape;l=y.parent?{x:0,y:0}:ft(y),/top/.test(p)?se(a,"y",u.top-l.y):/bottom/.test(p)&&se(a,"y",u.bottom-l.y),/left/.test(p)?se(a,"x",u.left-l.x):/right/.test(p)&&se(a,"x",u.right-l.x)}(n,o)})}function Aw(t){var e=t.context.createConstraints;if(e){var n=e.top,i=e.right,r=e.bottom,o=e.left;(o&&o>=t.x||i&&i<=t.x)&&se(t,"x",t.x),(n&&n>=t.y||r&&r<=t.y)&&se(t,"y",t.y)}}function Ig(t,e){return t.indexOf(e)!==-1}function Dg(t,e,n){return e?{x:t.x-n.x,y:t.y-n.y}:{x:t.x,y:t.y}}it(Wr,Bn),Wr.$inject=["eventBus","injector"],Wr.prototype.initSnap=function(t){var e=Bn.prototype.initSnap.call(this,t),n=t.shape,i=!!this._elementRegistry.get(n.id);return L(n.outgoing,function(r){var o=r.waypoints[0];o=o.original||o,e.setSnapOrigin(r.id+"-docking",Dg(o,i,t))}),L(n.incoming,function(r){var o=r.waypoints[r.waypoints.length-1];o=o.original||o,e.setSnapOrigin(r.id+"-docking",Dg(o,i,t))}),A(n,"bpmn:Participant")&&e.setSnapLocations(["top-left","bottom-right","mid"]),e},Wr.prototype.addSnapTargetPoints=function(t,e,n){Bn.prototype.addSnapTargetPoints.call(this,t,e,n);var i=this.getSnapTargets(e,n);L(i,function(o){var a;(function(c){return A(c,"bpmn:SubProcess")&&Mt(c)?!0:A(c,"bpmn:Participant")}(o)||(a="bpmn:TextAnnotation",[e,o].every(function(c){return A(c,a)})))&&(t.add("top-left",Ef(o)),t.add("bottom-right",_f(o)))});var r=this._elementRegistry;return L(e.incoming,function(o){if(r.get(e.id)){Ig(i,o.source)||t.add("mid",ft(o.source));var a=o.waypoints[0];t.add(o.id+"-docking",a.original||a)}}),L(e.outgoing,function(o){if(r.get(e.id)){Ig(i,o.target)||t.add("mid",ft(o.target));var a=o.waypoints[o.waypoints.length-1];t.add(o.id+"-docking",a.original||a)}}),A(n,"bpmn:SequenceFlow")&&(t=this.addSnapTargetPoints(t,e,n.parent)),t},Wr.prototype.getSnapTargets=function(t,e){return Bn.prototype.getSnapTargets.call(this,t,e).filter(function(n){return!A(n,"bpmn:Lane")})};function fa(t,e){var n=this;t.on(["resize.start"],function(i){n.initSnap(i)}),t.on(["resize.move","resize.end"],1250,function(i){var r=i.context,o=r.shape,a=o.parent,c=r.direction,l=r.snapContext;if(!(i.originalEvent&&He(i.originalEvent)||Vr(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)&&se(i,"x",i.x),function(p){return p==="e"||p==="w"}(c)&&se(i,"y",i.y),e.snap(i,u)}}),t.on(["resize.cleanup"],function(){e.hide()})}function Bg(t,e){var n=ft(t),i=at(t),r={x:n.x,y:n.y};return e.indexOf("n")!==-1?r.y=i.top:e.indexOf("s")!==-1&&(r.y=i.bottom),e.indexOf("e")!==-1?r.x=i.right:e.indexOf("w")!==-1&&(r.x=i.left),r}fa.prototype.initSnap=function(t){var e=t.context,n=e.shape,i=e.direction,r=e.snapContext;r||(r=e.snapContext=new Ti);var o=Bg(n,i);return r.setSnapOrigin("corner",{x:o.x-t.x,y:o.y-t.y}),r},fa.prototype.addSnapTargetPoints=function(t,e,n,i){return L(this.getSnapTargets(e,n),function(r){t.add("corner",_f(r)),t.add("corner",Ef(r))}),t.add("corner",Bg(e,i)),t},fa.$inject=["eventBus","snapping"],fa.prototype.getSnapTargets=function(t,e){return wf(e).filter(function(n){return i=n,r=t,!(i.host===r||function(o){return!!o.waypoints}(n)||function(o){return!!o.hidden}(n)||function(o){return!!o.labelTarget}(n));var i,r})};function Ai(t){this._canvas=t,this._asyncHide=fl(we(this.hide,this),1e3)}Ai.$inject=["canvas"],Ai.prototype.snap=function(t,e){var n=t.context.snapContext,i=n.getSnapLocations(),r={x:Vr(t,"x"),y:Vr(t,"y")};L(i,function(o){var a=n.getSnapOrigin(o),c={x:t.x+a.x,y:t.y+a.y};if(L(["x","y"],function(l){var u;r[l]||(u=e.snap(c,o,l,7))!==void 0&&(r[l]={value:u,originValue:u-a[l]})}),r.x&&r.y)return!1}),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),L(["x","y"],function(o){var a=r[o];te(a)&&se(t,o,a.originValue)})},Ai.prototype._createLine=function(t){var e=this._canvas.getLayer("snap"),n=ot("path");return K(n,{d:"M0,0 L0,0"}),bt(n).add("djs-snap-line"),lt(e,n),{update:function(i){pt(i)?K(n,t==="horizontal"?{d:"M-100000,"+i+" L+100000,"+i,display:""}:{d:"M "+i+",-100000 L "+i+", +100000",display:""}):K(n,{display:"none"})}}},Ai.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},Ai.prototype.showSnapLine=function(t,e){var n=this.getSnapLine(t);n&&n.update(e),this._asyncHide()},Ai.prototype.getSnapLine=function(t){return this._snapLines||this._createSnapLines(),this._snapLines[t]},Ai.prototype.hide=function(){L(this._snapLines,function(t){t.update()})};const kw={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Bn],resizeSnapping:["type",fa],snapping:["type",Ai]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Pg],createMoveSnapping:["type",Wr]};function ut(t,e,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=t,this._eventBus=e,this._overlays=n,this._selection=i,this._container=jt(ut.BOX_HTML),this._searchInput=Wt(ut.INPUT_SELECTOR,this._container),this._resultsContainer=Wt(ut.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),e.on(["canvas.destroy","diagram.destroy"],this.close,this)}function Og(t,e,n){var i=function(o){var a="";return o.forEach(function(c){c.matched?a+='<strong class="'+ut.RESULT_HIGHLIGHT_CLASS+'">'+af(c.matched)+"</strong>":a+=af(c.normal)}),a!==""?a:null}(e),r=jt(n);r.innerHTML=i,t.appendChild(r)}ut.$inject=["canvas","eventBus","overlays","selection"],ut.prototype._bindEvents=function(){var t=this;function e(n,i,r,o){t._eventMaps.push({el:n,type:r,listener:$e.bind(n,i,r,o)})}e(document,"html","click",function(n){t.close()}),e(this._container,ut.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),e(this._container,ut.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),t._scrollToNode(n.delegateTarget),t._preselect(n.delegateTarget)}),e(this._container,ut.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),t._select(n.delegateTarget)}),e(this._container,ut.INPUT_SELECTOR,"keydown",function(n){n.keyCode===38&&n.preventDefault(),n.keyCode===40&&n.preventDefault()}),e(this._container,ut.INPUT_SELECTOR,"keyup",function(n){if(n.keyCode===27)return t.close();if(n.keyCode===13){var i=t._getCurrentResult();return i?t._select(i):t.close()}return n.keyCode===38?t._scrollToDirection(!0):n.keyCode===40?t._scrollToDirection():void(n.keyCode!==37&&n.keyCode!==39&&t._search(n.delegateTarget.value))})},ut.prototype._unbindEvents=function(){this._eventMaps.forEach(function(t){$e.unbind(t.el,t.type,t.listener)})},ut.prototype._search=function(t){var e=this;if(this._clearResults(),t&&t!==""){var n=this._searchProvider.find(t);if(n.length){n.forEach(function(r){var o=r.element.id,a=e._createResultNode(r,o);e._results[o]={element:r.element,node:a}});var i=Wt(ut.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},ut.prototype._scrollToDirection=function(t){var e=this._getCurrentResult();if(e){var n=t?e.previousElementSibling:e.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},ut.prototype._scrollToNode=function(t){if(t&&t!==this._getCurrentResult()){var e=t.offsetTop,n=this._resultsContainer.scrollTop,i=e-this._resultsContainer.clientHeight+t.clientHeight;e<n?this._resultsContainer.scrollTop=e:n<i&&(this._resultsContainer.scrollTop=i)}},ut.prototype._clearResults=function(){Oa(this._resultsContainer),this._results=[],this._resetOverlay(),this._eventBus.fire("searchPad.cleared")},ut.prototype._getCurrentResult=function(){return Wt(ut.RESULT_SELECTED_SELECTOR,this._resultsContainer)},ut.prototype._createResultNode=function(t,e){var n=jt(ut.RESULT_HTML);return t.primaryTokens.length>0&&Og(n,t.primaryTokens,ut.RESULT_PRIMARY_HTML),Og(n,t.secondaryTokens,ut.RESULT_SECONDARY_HTML),ze(n,ut.RESULT_ID_ATTRIBUTE,e),this._resultsContainer.appendChild(n),n},ut.prototype.registerProvider=function(t){this._searchProvider=t},ut.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,oe(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},ut.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,oe(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},ut.prototype.toggle=function(){this.isOpen()?this.close():this.open()},ut.prototype.isOpen=function(){return this._open},ut.prototype._preselect=function(t){var e=this._getCurrentResult();if(t!==e){e&&oe(e).remove(ut.RESULT_SELECTED_CLASS);var n=ze(t,ut.RESULT_ID_ATTRIBUTE),i=this._results[n].element;oe(t).add(ut.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},ut.prototype._select=function(t){var e=ze(t,ut.RESULT_ID_ATTRIBUTE),n=this._results[e].element;this.close(),this._resetOverlay(),this._canvas.scrollToElement(n,{top:400}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},ut.prototype._resetOverlay=function(t){if(this._overlayId&&this._overlays.remove(this._overlayId),t){var e=function(n){var i=6,r=n.width+2*i,o=n.height+2*i,a=["width: "+r+"px","height: "+o+"px"].join("; ");return{position:{bottom:o-i,right:r-i},show:!0,html:'<div style="'+a+'" class="'+ut.OVERLAY_CLASS+'"></div>'}}(ve(t));this._overlayId=this._overlays.add(t,e)}},ut.CONTAINER_SELECTOR=".djs-search-container",ut.INPUT_SELECTOR=".djs-search-input input",ut.RESULTS_CONTAINER_SELECTOR=".djs-search-results",ut.RESULT_SELECTOR=".djs-search-result",ut.RESULT_SELECTED_CLASS="djs-search-result-selected",ut.RESULT_SELECTED_SELECTOR="."+ut.RESULT_SELECTED_CLASS,ut.RESULT_ID_ATTRIBUTE="data-result-id",ut.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",ut.OVERLAY_CLASS="djs-search-overlay",ut.BOX_HTML='<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>',ut.RESULT_HTML='<div class="djs-search-result"></div>',ut.RESULT_PRIMARY_HTML='<div class="djs-search-result-primary"></div>',ut.RESULT_SECONDARY_HTML='<p class="djs-search-result-secondary"></p>';const Pw={__depends__:[eu,Mn],searchPad:["type",ut]};function Kp(t,e,n){this._elementRegistry=t,this._canvas=n,e.registerProvider(this)}function Lg(t){return dt(t,function(e){return!!e.matched}).length>0}function jg(t,e){var n=[],i=t;if(!t)return n;t=t.toLowerCase(),e=e.toLowerCase();var r=t.indexOf(e);return r>-1?(r!==0&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,e.length)}),e.length+r<t.length&&n.push({normal:i.substr(e.length+r,t.length)})):n.push({normal:i}),n}Kp.$inject=["elementRegistry","searchPad","canvas"],Kp.prototype.find=function(t){var e=this._canvas.getRootElement(),n=this._elementRegistry.filter(function(i){return!i.labelTarget});return n=dt(n,function(i){return i!==e}),n=We(n=dt(n=le(n,function(i){return{primaryTokens:jg(un(i),t),secondaryTokens:jg(i.id,t),element:i}}),function(i){return Lg(i.primaryTokens)||Lg(i.secondaryTokens)}),function(i){return un(i.element)+i.element.id})};const Mw={__depends__:[Pw],__init__:["bpmnSearch"],bpmnSearch:["type",Kp]};function On(t){Po.call(this,t)}it(On,Po),On.Viewer=Hn,On.NavigatedViewer=Bo,On.prototype.createDiagram=kr(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>')}),On.prototype._interactionModules=[Im,Lm,sE,Vm],On.prototype._modelingModules=[lE,vE,xE,yE,TE,Eu,AE,i_,Xf,xs,a_,c_,p_,h_,d_,y_,E_,dw,mw,Ew,_w,wv,kw,Mw],On.prototype._modules=[].concat(Hn.prototype._modules,On.prototype._interactionModules,On.prototype._modelingModules);const Vg=(t,e,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_${t}"
- targetNamespace="${{activiti:"http://activiti.org/bpmn",camunda:"http://bpmn.io/schema/bpmn",flowable:"http://flowable.org/bpmn"}[n]}">
- <bpmn2:process id="${t}" name="${e}" isExecutable="true">
- </bpmn2:process>
- <bpmndi:BPMNDiagram id="BPMNDiagram_1">
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${t}">
- </bpmndi:BPMNPlane>
- </bpmndi:BPMNDiagram>
- </bpmn2:definitions>`),Rw={"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 Ec,Yp,Nw={exports:{}};Ec=typeof window<"u"?window:_0,Yp=function(t,e){var n=(this!==void 0?this:t).SVG=function(s){if(n.supported)return s=new n.Doc(s),n.parser.draw||n.prepare(),s};if(n.ns="http://www.w3.org/2000/svg",n.xmlns="http://www.w3.org/2000/xmlns/",n.xlink="http://www.w3.org/1999/xlink",n.svgjs="http://svgjs.com/svgjs",n.supported=!!e.createElementNS&&!!e.createElementNS(n.ns,"svg").createSVGRect,!n.supported)return!1;n.did=1e3,n.eid=function(s){return"Svgjs"+d(s)+n.did++},n.create=function(s){var h=e.createElementNS(this.ns,s);return h.setAttribute("id",this.eid(s)),h},n.extend=function(){var s,h,m,E;for(h=(s=[].slice.call(arguments)).pop(),E=s.length-1;E>=0;E--)if(s[E])for(m in h)s[E].prototype[m]=h[m];n.Set&&n.Set.inherit&&n.Set.inherit()},n.invent=function(s){var h=typeof s.create=="function"?s.create:function(){this.constructor.call(this,n.create(s.create))};return s.inherit&&(h.prototype=new s.inherit),s.extend&&n.extend(h,s.extend),s.construct&&n.extend(s.parent||n.Container,s.construct),h},n.adopt=function(s){return s?s.instance?s.instance:((h=s.nodeName=="svg"?s.parentNode instanceof t.SVGElement?new n.Nested:new n.Doc:s.nodeName=="linearGradient"?new n.Gradient("linear"):s.nodeName=="radialGradient"?new n.Gradient("radial"):n[d(s.nodeName)]?new n[d(s.nodeName)]:new n.Element(s)).type=s.nodeName,h.node=s,s.instance=h,h instanceof n.Doc&&h.namespace().defs(),h.setData(JSON.parse(s.getAttribute("svgjs:data"))||{}),h):null;var h},n.prepare=function(){var s=e.getElementsByTagName("body")[0],h=(s?new n.Doc(s):n.adopt(e.documentElement).nested()).size(2,0);n.parser={body:s||e.documentElement,draw:h.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:h.polyline().node,path:h.path().node,native:n.create("svg")}},n.parser={native:n.create("svg")},e.addEventListener("DOMContentLoaded",function(){n.parser.draw||n.prepare()},!1),n.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},n.utils={map:function(s,h){var m,E=s.length,T=[];for(m=0;m<E;m++)T.push(h(s[m]));return T},filter:function(s,h){var m,E=s.length,T=[];for(m=0;m<E;m++)h(s[m])&&T.push(s[m]);return T},radians:function(s){return s%360*Math.PI/180},degrees:function(s){return 180*s/Math.PI%360},filterSVGElements:function(s){return this.filter(s,function(h){return h instanceof t.SVGElement})}},n.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},n.Color=function(s){var h,m;this.r=0,this.g=0,this.b=0,s&&(typeof s=="string"?n.regex.isRgb.test(s)?(h=n.regex.rgb.exec(s.replace(n.regex.whitespace,"")),this.r=parseInt(h[1]),this.g=parseInt(h[2]),this.b=parseInt(h[3])):n.regex.isHex.test(s)&&(h=n.regex.hex.exec((m=s).length==4?["#",m.substring(1,2),m.substring(1,2),m.substring(2,3),m.substring(2,3),m.substring(3,4),m.substring(3,4)].join(""):m),this.r=parseInt(h[1],16),this.g=parseInt(h[2],16),this.b=parseInt(h[3],16)):typeof s=="object"&&(this.r=s.r,this.g=s.g,this.b=s.b))},n.extend(n.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+y(this.r)+y(this.g)+y(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(s){return this.destination=new n.Color(s),this},at:function(s){return this.destination?(s=s<0?0:s>1?1:s,new n.Color({r:~~(this.r+(this.destination.r-this.r)*s),g:~~(this.g+(this.destination.g-this.g)*s),b:~~(this.b+(this.destination.b-this.b)*s)})):this}}),n.Color.test=function(s){return s+="",n.regex.isHex.test(s)||n.regex.isRgb.test(s)},n.Color.isRgb=function(s){return s&&typeof s.r=="number"&&typeof s.g=="number"&&typeof s.b=="number"},n.Color.isColor=function(s){return n.Color.isRgb(s)||n.Color.test(s)},n.Array=function(s,h){(s=(s||[]).valueOf()).length==0&&h&&(s=h.valueOf()),this.value=this.parse(s)},n.extend(n.Array,{morph:function(s){if(this.destination=this.parse(s),this.value.length!=this.destination.length){for(var h=this.value[this.value.length-1],m=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(m);for(;this.value.length<this.destination.length;)this.value.push(h)}return this},settle:function(){for(var s=0,h=this.value.length,m=[];s<h;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 h=0,m=this.value.length,E=[];h<m;h++)E.push(this.value[h]+(this.destination[h]-this.value[h])*s);return new n.Array(E)},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,h){n.Array.call(this,s,h||[[0,0]])},n.PointArray.prototype=new n.Array,n.PointArray.prototype.constructor=n.PointArray,n.extend(n.PointArray,{toString:function(){for(var s=0,h=this.value.length,m=[];s<h;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 h=0,m=this.value.length,E=[];h<m;h++)E.push([this.value[h][0]+(this.destination[h][0]-this.value[h][0])*s,this.value[h][1]+(this.destination[h][1]-this.value[h][1])*s]);return new n.PointArray(E)},parse:function(s){var h=[];if(s=s.valueOf(),Array.isArray(s)){if(Array.isArray(s[0]))return s.map(function(T){return T.slice()});if(s[0].x!=null)return s.map(function(T){return[T.x,T.y]})}else s=s.trim().split(n.regex.delimiter).map(parseFloat);s.length%2!=0&&s.pop();for(var m=0,E=s.length;m<E;m+=2)h.push([s[m],s[m+1]]);return h},move:function(s,h){var m=this.bbox();if(s-=m.x,h-=m.y,!isNaN(s)&&!isNaN(h))for(var E=this.value.length-1;E>=0;E--)this.value[E]=[this.value[E][0]+s,this.value[E][1]+h];return this},size:function(s,h){var m,E=this.bbox();for(m=this.value.length-1;m>=0;m--)E.width&&(this.value[m][0]=(this.value[m][0]-E.x)*s/E.width+E.x),E.height&&(this.value[m][1]=(this.value[m][1]-E.y)*h/E.height+E.y);return this},bbox:function(){return n.parser.poly.setAttribute("points",this.toString()),n.parser.poly.getBBox()}});for(var i={M:function(s,h,m){return h.x=m.x=s[0],h.y=m.y=s[1],["M",h.x,h.y]},L:function(s,h){return h.x=s[0],h.y=s[1],["L",s[0],s[1]]},H:function(s,h){return h.x=s[0],["H",s[0]]},V:function(s,h){return h.y=s[0],["V",s[0]]},C:function(s,h){return h.x=s[4],h.y=s[5],["C",s[0],s[1],s[2],s[3],s[4],s[5]]},S:function(s,h){return h.x=s[2],h.y=s[3],["S",s[0],s[1],s[2],s[3]]},Q:function(s,h){return h.x=s[2],h.y=s[3],["Q",s[0],s[1],s[2],s[3]]},T:function(s,h){return h.x=s[0],h.y=s[1],["T",s[0],s[1]]},Z:function(s,h,m){return h.x=m.x,h.y=m.y,["Z"]},A:function(s,h){return h.x=s[5],h.y=s[6],["A",s[0],s[1],s[2],s[3],s[4],s[5],s[6]]}},r="mlhvqtcsaz".split(""),o=0,a=r.length;o<a;++o)i[r[o]]=function(s){return function(h,m,E){if(s=="H")h[0]=h[0]+m.x;else if(s=="V")h[0]=h[0]+m.y;else if(s=="A")h[5]=h[5]+m.x,h[6]=h[6]+m.y;else for(var T=0,M=h.length;T<M;++T)h[T]=h[T]+(T%2?m.y:m.x);return i[s](h,m,E)}}(r[o].toUpperCase());n.PathArray=function(s,h){n.Array.call(this,s,h||[["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 h=0,m=s.length,E="";h<m;h++)E+=s[h][0],s[h][1]!=null&&(E+=s[h][1],s[h][2]!=null&&(E+=" ",E+=s[h][2],s[h][3]!=null&&(E+=" ",E+=s[h][3],E+=" ",E+=s[h][4],s[h][5]!=null&&(E+=" ",E+=s[h][5],E+=" ",E+=s[h][6],s[h][7]!=null&&(E+=" ",E+=s[h][7])))));return E+" "}(this.value)},move:function(s,h){var m=this.bbox();if(s-=m.x,h-=m.y,!isNaN(s)&&!isNaN(h))for(var E,T=this.value.length-1;T>=0;T--)(E=this.value[T][0])=="M"||E=="L"||E=="T"?(this.value[T][1]+=s,this.value[T][2]+=h):E=="H"?this.value[T][1]+=s:E=="V"?this.value[T][1]+=h:E=="C"||E=="S"||E=="Q"?(this.value[T][1]+=s,this.value[T][2]+=h,this.value[T][3]+=s,this.value[T][4]+=h,E=="C"&&(this.value[T][5]+=s,this.value[T][6]+=h)):E=="A"&&(this.value[T][6]+=s,this.value[T][7]+=h);return this},size:function(s,h){var m,E,T=this.bbox();for(m=this.value.length-1;m>=0;m--)(E=this.value[m][0])=="M"||E=="L"||E=="T"?(this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x,this.value[m][2]=(this.value[m][2]-T.y)*h/T.height+T.y):E=="H"?this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x:E=="V"?this.value[m][1]=(this.value[m][1]-T.y)*h/T.height+T.y:E=="C"||E=="S"||E=="Q"?(this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x,this.value[m][2]=(this.value[m][2]-T.y)*h/T.height+T.y,this.value[m][3]=(this.value[m][3]-T.x)*s/T.width+T.x,this.value[m][4]=(this.value[m][4]-T.y)*h/T.height+T.y,E=="C"&&(this.value[m][5]=(this.value[m][5]-T.x)*s/T.width+T.x,this.value[m][6]=(this.value[m][6]-T.y)*h/T.height+T.y)):E=="A"&&(this.value[m][1]=this.value[m][1]*s/T.width,this.value[m][2]=this.value[m][2]*h/T.height,this.value[m][6]=(this.value[m][6]-T.x)*s/T.width+T.x,this.value[m][7]=(this.value[m][7]-T.y)*h/T.height+T.y);return this},equalCommands:function(s){var h,m,E;for(s=new n.PathArray(s),E=this.value.length===s.value.length,h=0,m=this.value.length;E&&h<m;h++)E=this.value[h][0]===s.value[h][0];return E},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 h,m,E,T,M=this.value,I=this.destination.value,$=[],P=new n.PathArray;for(h=0,m=M.length;h<m;h++){for($[h]=[M[h][0]],E=1,T=M[h].length;E<T;E++)$[h][E]=M[h][E]+(I[h][E]-M[h][E])*s;$[h][0]==="A"&&($[h][4]=+($[h][4]!=0),$[h][5]=+($[h][5]!=0))}return P.value=$,P},parse:function(s){if(s instanceof n.PathArray)return s.valueOf();var h,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(P,x){return[].concat.call(P,x)},[]);var E=[],T=new n.Point,M=new n.Point,I=0,$=s.length;do n.regex.isPathLetter.test(s[I])?(h=s[I],++I):h=="M"?h="L":h=="m"&&(h="l"),E.push(i[h].call(null,s.slice(I,I+=m[h.toUpperCase()]).map(parseFloat),T,M));while($>I);return E},bbox:function(){return n.parser.path.setAttribute("d",this.toString()),n.parser.path.getBBox()}}),n.Number=n.invent({create:function(s,h){this.value=0,this.unit=h||"",typeof s=="number"?this.value=isNaN(s)?0:isFinite(s)?s:s<0?-34e37:34e37:typeof s=="string"?(h=s.match(n.regex.numberAndUnit))&&(this.value=parseFloat(h[1]),h[5]=="%"?this.value/=100:h[5]=="s"&&(this.value*=1e3),this.unit=h[5]):s instanceof n.Number&&(this.value=s.valueOf(),this.unit=s.unit)},extend:{toString:function(){return(this.unit=="%"?~~(1e8*this.value)/1e6:this.unit=="s"?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(s){return s=new n.Number(s),new n.Number(this+s,this.unit||s.unit)},minus:function(s){return s=new n.Number(s),new n.Number(this-s,this.unit||s.unit)},times:function(s){return s=new n.Number(s),new n.Number(this*s,this.unit||s.unit)},divide:function(s){return s=new n.Number(s),new n.Number(this/s,this.unit||s.unit)},to:function(s){var h=new n.Number(this);return typeof s=="string"&&(h.unit=s),h},morph:function(s){return this.destination=new n.Number(s),s.relative&&(this.destination.value+=this.value),this},at:function(s){return this.destination?new n.Number(this.destination).minus(this).times(s).plus(this):this}}}),n.Element=n.invent({create:function(s){this._stroke=n.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=s)&&(this.type=s.nodeName,this.node.instance=this,this._events=s._events||{},this._stroke=s.getAttribute("stroke")||this._stroke)},extend:{x:function(s){return this.attr("x",s)},y:function(s){return this.attr("y",s)},cx:function(s){return s==null?this.x()+this.width()/2:this.x(s-this.width()/2)},cy:function(s){return s==null?this.y()+this.height()/2:this.y(s-this.height()/2)},move:function(s,h){return this.x(s).y(h)},center:function(s,h){return this.cx(s).cy(h)},width:function(s){return this.attr("width",s)},height:function(s){return this.attr("height",s)},size:function(s,h){var m=f(this,s,h);return this.width(new n.Number(m.width)).height(new n.Number(m.height))},clone:function(s){this.writeDataToDom();var h=S(this.node.cloneNode(!0));return s?s.add(h):this.after(h),h},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(s){return this.after(s).remove(),s},addTo:function(s){return s.put(this)},putIn:function(s){return s.add(this)},id:function(s){return this.attr("id",s)},inside:function(s,h){var m=this.bbox();return s>m.x&&h>m.y&&s<m.x+m.width&&h<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 h=this.classes();h.push(s),this.attr("class",h.join(" "))}return this},removeClass:function(s){return this.hasClass(s)&&this.attr("class",this.classes().filter(function(h){return h!=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 h=this;if(!h.node.parentNode)return null;if(h=n.adopt(h.node.parentNode),!s)return h;for(;h&&h.node instanceof t.SVGElement;){if(typeof s=="string"?h.matches(s):h instanceof s)return h;if(!h.node.parentNode||h.node.parentNode.nodeName=="#document"||h.node.parentNode.nodeName=="#document-fragment")return null;h=n.adopt(h.node.parentNode)}},doc:function(){return this instanceof n.Doc?this:this.parent(n.Doc)},parents:function(s){var h=[],m=this;do{if(!(m=m.parent(s))||!m.node)break;h.push(m)}while(m.parent);return h},matches:function(s){return function(h,m){return(h.matches||h.matchesSelector||h.msMatchesSelector||h.mozMatchesSelector||h.webkitMatchesSelector||h.oMatchesSelector).call(h,m)}(this.node,s)},native:function(){return this.node},svg:function(s){var h=e.createElement("svg");if(!(s&&this instanceof n.Parent))return h.appendChild(s=e.createElement("svg")),this.writeDataToDom(),s.appendChild(this.node.cloneNode(!0)),h.innerHTML.replace(/^<svg>/,"").replace(/<\/svg>$/,"");h.innerHTML="<svg>"+s.replace(/\n/,"").replace(/<([\w:-]+)([^<]+?)\/>/g,"<$1$2></$1>")+"</svg>";for(var m=0,E=h.firstChild.childNodes.length;m<E;m++)this.node.appendChild(h.firstChild.firstChild);return this},writeDataToDom:function(){return(this.each||this.lines)&&(this.each?this:this.lines()).each(function(){this.writeDataToDom()}),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(s){return this.dom=s,this},is:function(s){return function(h,m){return h instanceof m}(this,s)}}}),n.easing={"-":function(s){return s},"<>":function(s){return-Math.cos(s*Math.PI)/2+.5},">":function(s){return Math.sin(s*Math.PI/2)},"<":function(s){return 1-Math.cos(s*Math.PI/2)}},n.morph=function(s){return function(h,m){return new n.MorphObj(h,m).at(s)}},n.Situation=n.invent({create:function(s){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new n.Number(s.duration).valueOf(),this.delay=new n.Number(s.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=s.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),n.FX=n.invent({create:function(s){this._target=s,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(s,h,m){typeof s=="object"&&(h=s.ease,m=s.delay,s=s.duration);var E=new n.Situation({duration:s||1e3,delay:m||0,ease:n.easing[h||"-"]||h});return this.queue(E),this},delay:function(s){var h=new n.Situation({duration:s,delay:0,ease:n.easing["-"]});return this.queue(h)},target:function(s){return s&&s instanceof n.Element?(this._target=s,this):this._target},timeToAbsPos:function(s){return(s-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(s){return this.situation.duration/this._speed*s+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=t.requestAnimationFrame((function(){this.step()}).bind(this))},stopAnimFrame:function(){t.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(s){return(typeof s=="function"||s instanceof n.Situation)&&this.situations.push(s),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof n.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var s,h,m,E=this.situation;if(E.init)return this;for(s in E.animations)for(m=this.target()[s](),Array.isArray(m)||(m=[m]),Array.isArray(E.animations[s])||(E.animations[s]=[E.animations[s]]),h=m.length;h--;)E.animations[s][h]instanceof n.Number&&(m[h]=new n.Number(m[h])),E.animations[s][h]=m[h].morph(E.animations[s][h]);for(s in E.attrs)E.attrs[s]=new n.MorphObj(this.target().attr(s),E.attrs[s]);for(s in E.styles)E.styles[s]=new n.MorphObj(this.target().style(s),E.styles[s]);return E.initialTransformation=this.target().matrixify(),E.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(s,h){var m=this.active;return this.active=!1,h&&this.clearQueue(),s&&this.situation&&(!m&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var s=this.situation;this.stop(),this.situation=s,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return this.situation.loops===!0&&(this.situation.loops=this.situation.loop+1),typeof this.situation.loops=="number"?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(s,h){var m=this.situation.duration/this._speed;return this.absPos=s,h||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*m,this.situation.finish=this.situation.start+m,this.step(!0)},speed:function(s){return s===0?this.pause():s?(this._speed=s,this.at(this.absPos,!0)):this._speed},loop:function(s,h){var m=this.last();return m.loops=s==null||s,m.loop=0,h&&(m.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(s){var h=this.last();return h.reversed=s===void 0?!h.reversed:s,this},progress:function(s){return s?this.situation.ease(this.pos):this.pos},after:function(s){var h=this.last();return this.target().on("finished.fx",function m(E){E.detail.situation==h&&(s.call(this,h),this.off("finished.fx",m))}),this._callStart()},during:function(s){var h=this.last(),m=function(E){E.detail.situation==h&&s.call(this,E.detail.pos,n.morph(E.detail.pos),E.detail.eased,h)};return this.target().off("during.fx",m).on("during.fx",m),this.after(function(){this.off("during.fx",m)}),this._callStart()},afterAll:function(s){var h=function m(E){s.call(this),this.off("allfinished.fx",m)};return this.target().off("allfinished.fx",h).on("allfinished.fx",h),this._callStart()},duringAll:function(s){var h=function(m){s.call(this,m.detail.pos,n.morph(m.detail.pos),m.detail.eased,m.detail.situation)};return this.target().off("during.fx",h).on("during.fx",h),this.afterAll(function(){this.off("during.fx",h)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(s,h,m){return this.last()[m||"animations"][s]=h,this._callStart()},step:function(s){var h,m,E;s||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1?(h=Math.max(this.absPos,0),m=Math.floor(h),this.situation.loops===!0||m<this.situation.loops?(this.pos=h-m,E=this.situation.loop,this.situation.loop=m):(this.absPos=this.situation.loops,this.pos=1,E=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=!!((this.situation.loop-E)%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 T=this.situation.ease(this.pos);for(var M in this.situation.once)M>this.lastPos&&M<=T&&(this.situation.once[M].call(this.target(),this.pos,T),delete this.situation.once[M]);return this.active&&this.target().fire("during",{pos:this.pos,eased:T,fx:this,situation:this.situation}),this.situation?(this.eachAt(),this.pos==1&&!this.situation.reversed||this.situation.reversed&&this.pos==0?(this.stopAnimFrame(),this.target().fire("finished",{fx:this,situation:this.situation}),this.situations.length||(this.target().fire("allfinished"),this.situations.length||(this.target().off(".fx"),this.active=!1)),this.active?this.dequeue():this.clearCurrent()):!this.paused&&this.active&&this.startAnimFrame(),this.lastPos=T,this):this},eachAt:function(){var s,h,m,E=this,T=this.target(),M=this.situation;for(s in M.animations)m=[].concat(M.animations[s]).map(function($){return typeof $!="string"&&$.at?$.at(M.ease(E.pos),E.pos):$}),T[s].apply(T,m);for(s in M.attrs)m=[s].concat(M.attrs[s]).map(function($){return typeof $!="string"&&$.at?$.at(M.ease(E.pos),E.pos):$}),T.attr.apply(T,m);for(s in M.styles)m=[s].concat(M.styles[s]).map(function($){return typeof $!="string"&&$.at?$.at(M.ease(E.pos),E.pos):$}),T.style.apply(T,m);if(M.transforms.length){for(m=M.initialTransformation,s=0,h=M.transforms.length;s<h;s++){var I=M.transforms[s];I instanceof n.Matrix?m=I.relative?m.multiply(new n.Matrix().morph(I).at(M.ease(this.pos))):m.morph(I).at(M.ease(this.pos)):(I.relative||I.undo(m.extract()),m=m.multiply(I.at(M.ease(this.pos))))}T.matrix(m)}return this},once:function(s,h,m){var E=this.last();return m||(s=E.ease(s)),E.once[s]=h,this},_callStart:function(){return setTimeout((function(){this.start()}).bind(this),0),this}},parent:n.Element,construct:{animate:function(s,h,m){return(this.fx||(this.fx=new n.FX(this))).animate(s,h,m)},delay:function(s){return(this.fx||(this.fx=new n.FX(this))).delay(s)},stop:function(s,h){return this.fx&&this.fx.stop(s,h),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,h){return n.Color.isColor(h)?new n.Color(s).morph(h):n.regex.delimiter.test(s)?n.regex.pathLetters.test(s)?new n.PathArray(s).morph(h):new n.Array(s).morph(h):n.regex.numberAndUnit.test(h)?new n.Number(s).morph(h):(this.value=s,void(this.destination=h))},extend:{at:function(s,h){return h<1?this.value:this.destination},valueOf:function(){return this.value}}}),n.extend(n.FX,{attr:function(s,h,m){if(typeof s=="object")for(var E in s)this.attr(E,s[E]);else this.add(s,h,"attrs");return this},style:function(s,h){if(typeof s=="object")for(var m in s)this.style(m,s[m]);else this.add(s,h,"styles");return this},x:function(s,h){if(this.target()instanceof n.G)return this.transform({x:s},h),this;var m=new n.Number(s);return m.relative=h,this.add("x",m)},y:function(s,h){if(this.target()instanceof n.G)return this.transform({y:s},h),this;var m=new n.Number(s);return m.relative=h,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,h){return this.x(s).y(h)},center:function(s,h){return this.cx(s).cy(h)},size:function(s,h){var m;return this.target()instanceof n.Text?this.attr("font-size",s):(s&&h||(m=this.target().bbox()),s||(s=m.width/m.height*h),h||(h=m.height/m.width*s),this.add("width",new n.Number(s)).add("height",new n.Number(h))),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,h,m,E){return arguments.length==4?this.plot([s,h,m,E]):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,h,m,E){return this.target()instanceof n.Container&&this.add("viewbox",new n.ViewBox(s,h,m,E)),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,h,m,E){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=h,this.width=m,this.height=E),w(this)},extend:{merge:function(s){var h=new this.constructor;return h.x=Math.min(this.x,s.x),h.y=Math.min(this.y,s.y),h.width=Math.max(this.x+this.width,s.x+s.width)-h.x,h.height=Math.max(this.y+this.height,s.y+s.height)-h.y,w(h)},transform:function(s){var h,m=1/0,E=-1/0,T=1/0,M=-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(I){I=I.transform(s),m=Math.min(m,I.x),E=Math.max(E,I.x),T=Math.min(T,I.y),M=Math.max(M,I.y)}),(h=new this.constructor).x=m,h.width=E-m,h.y=T,h.height=M-T,w(h),h}}}),n.BBox=n.invent({create:function(s){if(n.Box.apply(this,[].slice.call(arguments)),s instanceof n.Element){var h;try{if(e.documentElement.contains){if(!e.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!=e)throw new Exception("Element not in the dom")}h=s.node.getBBox()}catch{if(s instanceof n.Shape){var E=s.clone(n.parser.draw.instance).show();h=E.node.getBBox(),E.remove()}else h={x:s.node.clientLeft,y:s.node.clientTop,width:s.node.clientWidth,height:s.node.clientHeight}}n.Box.call(this,h)}},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 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+=t.pageXOffset,this.y+=t.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 h,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,h=C.length-1;h>=0;--h)this[C[h]]=s[C[h]]!=null?s[C[h]]:m[C[h]]},extend:{extract:function(){var s=v(this,0,1),h=v(this,1,0),m=180/Math.PI*Math.atan2(s.y,s.x)-90;return{x:this.e,y:this.f,transformedX:(this.e*Math.cos(m*Math.PI/180)+this.f*Math.sin(m*Math.PI/180))/Math.sqrt(this.a*this.a+this.b*this.b),transformedY:(this.f*Math.cos(m*Math.PI/180)+this.e*Math.sin(-m*Math.PI/180))/Math.sqrt(this.c*this.c+this.d*this.d),skewX:-m,skewY:180/Math.PI*Math.atan2(h.y,h.x),scaleX:Math.sqrt(this.a*this.a+this.b*this.b),scaleY:Math.sqrt(this.c*this.c+this.d*this.d),rotation:m,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f,matrix:new n.Matrix(this)}},clone:function(){return new n.Matrix(this)},morph:function(s){return this.destination=new n.Matrix(s),this},at:function(s){return this.destination?new n.Matrix({a:this.a+(this.destination.a-this.a)*s,b:this.b+(this.destination.b-this.b)*s,c:this.c+(this.destination.c-this.c)*s,d:this.d+(this.destination.d-this.d)*s,e:this.e+(this.destination.e-this.e)*s,f:this.f+(this.destination.f-this.f)*s}):this},multiply:function(s){return new n.Matrix(this.native().multiply(function(h){return h instanceof n.Matrix||(h=new n.Matrix(h)),h}(s).native()))},inverse:function(){return new n.Matrix(this.native().inverse())},translate:function(s,h){return new n.Matrix(this.native().translate(s||0,h||0))},scale:function(s,h,m,E){return arguments.length==1?h=s:arguments.length==3&&(E=m,m=h,h=s),this.around(m,E,new n.Matrix(s,0,0,h,0,0))},rotate:function(s,h,m){return s=n.utils.radians(s),this.around(h,m,new n.Matrix(Math.cos(s),Math.sin(s),-Math.sin(s),Math.cos(s),0,0))},flip:function(s,h){return s=="x"?this.scale(-1,1,h,0):s=="y"?this.scale(1,-1,0,h):this.scale(-1,-1,s,h??s)},skew:function(s,h,m,E){return arguments.length==1?h=s:arguments.length==3&&(E=m,m=h,h=s),s=n.utils.radians(s),h=n.utils.radians(h),this.around(m,E,new n.Matrix(1,Math.tan(h),Math.tan(s),1,0,0))},skewX:function(s,h,m){return this.skew(s,0,h,m)},skewY:function(s,h,m){return this.skew(0,s,h,m)},around:function(s,h,m){return this.multiply(new n.Matrix(1,0,0,1,s||0,h||0)).multiply(m).multiply(new n.Matrix(1,0,0,1,-s||0,-h||0))},native:function(){for(var s=n.parser.native.createSVGMatrix(),h=C.length-1;h>=0;h--)s[C[h]]=this[C[h]];return s},toString:function(){return"matrix("+_(this.a)+","+_(this.b)+","+_(this.c)+","+_(this.d)+","+_(this.e)+","+_(this.f)+")"}},parent:n.Element,construct:{ctm:function(){return new n.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof n.Nested){var s=this.rect(1,1),h=s.node.getScreenCTM();return s.remove(),new n.Matrix(h)}return new n.Matrix(this.node.getScreenCTM())}}}),n.Point=n.invent({create:function(s,h){var m;m=Array.isArray(s)?{x:s[0],y:s[1]}:typeof s=="object"?{x:s.x,y:s.y}:s!=null?{x:s,y:h??s}:{x:0,y:0},this.x=m.x,this.y=m.y},extend:{clone:function(){return new n.Point(this)},morph:function(s,h){return this.destination=new n.Point(s,h),this},at:function(s){return this.destination?new n.Point({x:this.x+(this.destination.x-this.x)*s,y:this.y+(this.destination.y-this.y)*s}):this},native:function(){var s=n.parser.native.createSVGPoint();return s.x=this.x,s.y=this.y,s},transform:function(s){return new n.Point(this.native().matrixTransform(s.native()))}}}),n.extend(n.Element,{point:function(s,h){return new n.Point(s,h).transform(this.screenCTM().inverse())}}),n.extend(n.Element,{attr:function(s,h,m){if(s==null){for(s={},m=(h=this.node.attributes).length-1;m>=0;m--)s[h[m].nodeName]=n.regex.isNumber.test(h[m].nodeValue)?parseFloat(h[m].nodeValue):h[m].nodeValue;return s}if(typeof s=="object")for(h in s)this.attr(h,s[h]);else if(h===null)this.node.removeAttribute(s);else{if(h==null)return(h=this.node.getAttribute(s))==null?n.defaults.attrs[s]:n.regex.isNumber.test(h)?parseFloat(h):h;s=="stroke-width"?this.attr("stroke",parseFloat(h)>0?this._stroke:null):s=="stroke"&&(this._stroke=h),s!="fill"&&s!="stroke"||(n.regex.isImage.test(h)&&(h=this.doc().defs().image(h,0,0)),h instanceof n.Image&&(h=this.doc().defs().pattern(0,0,function(){this.add(h)}))),typeof h=="number"?h=new n.Number(h):n.Color.isColor(h)?h=new n.Color(h):Array.isArray(h)&&(h=new n.Array(h)),s=="leading"?this.leading&&this.leading(h):typeof m=="string"?this.node.setAttributeNS(m,s,h.toString()):this.node.setAttribute(s,h.toString()),!this.rebuild||s!="font-size"&&s!="x"||this.rebuild(s,h)}return this}}),n.extend(n.Element,{transform:function(s,h){var m,E,T=this;if(typeof s!="object")return m=new n.Matrix(T).extract(),typeof s=="string"?m[s]:m;if(m=new n.Matrix(T),h=!!h||!!s.relative,s.a!=null)m=h?m.multiply(new n.Matrix(s)):new n.Matrix(s);else if(s.rotation!=null)b(s,T),m=h?m.rotate(s.rotation,s.cx,s.cy):m.rotate(s.rotation-m.extract().rotation,s.cx,s.cy);else if(s.scale!=null||s.scaleX!=null||s.scaleY!=null){if(b(s,T),s.scaleX=s.scale!=null?s.scale:s.scaleX!=null?s.scaleX:1,s.scaleY=s.scale!=null?s.scale:s.scaleY!=null?s.scaleY:1,!h){var M=m.extract();s.scaleX=1*s.scaleX/M.scaleX,s.scaleY=1*s.scaleY/M.scaleY}m=m.scale(s.scaleX,s.scaleY,s.cx,s.cy)}else s.skew!=null||s.skewX!=null||s.skewY!=null?(b(s,T),s.skewX=s.skew!=null?s.skew:s.skewX!=null?s.skewX:0,s.skewY=s.skew!=null?s.skew:s.skewY!=null?s.skewY:0,h||(M=m.extract(),m=m.multiply(new n.Matrix().skew(M.skewX,M.skewY,s.cx,s.cy).inverse())),m=m.skew(s.skewX,s.skewY,s.cx,s.cy)):s.flip?(s.flip=="x"||s.flip=="y"?s.offset=s.offset==null?T.bbox()["c"+s.flip]:s.offset:s.offset==null?(E=T.bbox(),s.flip=E.cx,s.offset=E.cy):s.flip=s.offset,m=new n.Matrix().flip(s.flip,s.offset)):s.x==null&&s.y==null||(h?m=m.translate(s.x,s.y):(s.x!=null&&(m.e=s.x),s.y!=null&&(m.f=s.y)));return this.attr("transform",m)}}),n.extend(n.FX,{transform:function(s,h){var m,E,T=this.target();return typeof s!="object"?(m=new n.Matrix(T).extract(),typeof s=="string"?m[s]:m):(h=!!h||!!s.relative,s.a!=null?m=new n.Matrix(s):s.rotation!=null?(b(s,T),m=new n.Rotate(s.rotation,s.cx,s.cy)):s.scale!=null||s.scaleX!=null||s.scaleY!=null?(b(s,T),s.scaleX=s.scale!=null?s.scale:s.scaleX!=null?s.scaleX:1,s.scaleY=s.scale!=null?s.scale:s.scaleY!=null?s.scaleY:1,m=new n.Scale(s.scaleX,s.scaleY,s.cx,s.cy)):s.skewX!=null||s.skewY!=null?(b(s,T),s.skewX=s.skewX!=null?s.skewX:0,s.skewY=s.skewY!=null?s.skewY:0,m=new n.Skew(s.skewX,s.skewY,s.cx,s.cy)):s.flip?(s.flip=="x"||s.flip=="y"?s.offset=s.offset==null?T.bbox()["c"+s.flip]:s.offset:s.offset==null?(E=T.bbox(),s.flip=E.cx,s.offset=E.cy):s.flip=s.offset,m=new n.Matrix().flip(s.flip,s.offset)):s.x==null&&s.y==null||(m=new n.Translate(s.x,s.y)),m?(m.relative=h,this.last().transforms.push(m),this._callStart()):this)}}),n.extend(n.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){var s=(this.attr("transform")||"").split(n.regex.transforms).slice(0,-1).map(function(h){var m=h.trim().split("(");return[m[0],m[1].split(n.regex.delimiter).map(function(E){return parseFloat(E)})]}).reduce(function(h,m){return m[0]=="matrix"?h.multiply(g(m[1])):h[m[0]].apply(h,m[1])},new n.Matrix);return s},toParent:function(s){if(this==s)return this;var h=this.screenCTM(),m=s.screenCTM().inverse();return this.addTo(s).untransform().transform(m.multiply(h)),this},toDoc:function(){return this.toParent(this.doc())}}),n.Transformation=n.invent({create:function(s,h){if(arguments.length>1&&typeof h!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(s))for(var m=0,E=this.arguments.length;m<E;++m)this[this.arguments[m]]=s[m];else if(typeof s=="object")for(m=0,E=this.arguments.length;m<E;++m)this[this.arguments[m]]=s[this.arguments[m]];this.inversed=!1,h===!0&&(this.inversed=!0)},extend:{arguments:[],method:"",at:function(s){for(var h=[],m=0,E=this.arguments.length;m<E;++m)h.push(this[this.arguments[m]]);var T=this._undo||new n.Matrix;return T=new n.Matrix().morph(n.Matrix.prototype[this.method].apply(T,h)).at(s),this.inversed?T.inverse():T},undo:function(s){for(var h=0,m=this.arguments.length;h<m;++h)s[this.arguments[h]]=this[this.arguments[h]]===void 0?0:s[this.arguments[h]];return s.cx=this.cx,s.cy=this.cy,this._undo=new n[d(this.method)](s,!0).at(1),this}}}),n.Translate=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(s,h){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,h){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["rotation","cx","cy"],method:"rotate",at:function(s){var h=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?h.inverse():h},undo:function(s){return this._undo=s,this}}}),n.Scale=n.invent({parent:n.Matrix,inherit:n.Transformation,create:function(s,h){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,h){this.constructor.apply(this,[].slice.call(arguments))},extend:{arguments:["skewX","skewY","cx","cy"],method:"skew"}}),n.extend(n.Element,{style:function(s,h){if(arguments.length==0)return this.node.style.cssText||"";if(arguments.length<2)if(typeof s=="object")for(h in s)this.style(h,s[h]);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*/)});h=s.pop();)this.style(h[0],h[1])}else this.node.style[p(s)]=h===null||n.regex.isBlank.test(h)?"":h;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,h){return h==null?this.node.appendChild(s.node):s.node!=this.node.childNodes[h]&&this.node.insertBefore(s.node,this.node.childNodes[h]),this},put:function(s,h){return this.add(s,h),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,h){var m,E,T=this.children();for(m=0,E=T.length;m<E;m++)T[m]instanceof n.Element&&s.apply(T[m],[m,T]),h&&T[m]instanceof n.Container&&T[m].each(s,h);return this},removeElement:function(s){return this.node.removeChild(s.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),n.extend(n.Parent,{ungroup:function(s,h){return h===0||this instanceof n.Defs||this.node==n.parser.draw||(s=s||(this instanceof n.Doc?this:this.parent(n.Parent)),h=h||1/0,this.each(function(){return this instanceof n.Defs?this:this instanceof n.Parent?this.ungroup(s,h-1):this.toParent(s)}),this.node.firstChild||this.remove()),this},flatten:function(s,h){return this.ungroup(s,h)}}),n.Container=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Parent}),n.ViewBox=n.invent({create:function(s){var h,m,E,T,M,I,$,P=1,x=1,N=/[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/gi;if(s instanceof n.Element){for(I=s,$=s,M=(s.attr("viewBox")||"").match(N),s.bbox,E=new n.Number(s.width()),T=new n.Number(s.height());E.unit=="%";)P*=E.value,E=new n.Number(I instanceof n.Doc?I.parent().offsetWidth:I.parent().width()),I=I.parent();for(;T.unit=="%";)x*=T.value,T=new n.Number($ instanceof n.Doc?$.parent().offsetHeight:$.parent().height()),$=$.parent();this.x=0,this.y=0,this.width=E*P,this.height=T*x,this.zoom=1,M&&(h=parseFloat(M[0]),m=parseFloat(M[1]),E=parseFloat(M[2]),T=parseFloat(M[3]),this.zoom=this.width/this.height>E/T?this.height/T:this.width/E,this.x=h,this.y=m,this.width=E,this.height=T)}else s=typeof s=="string"?s.match(N).map(function(j){return parseFloat(j)}):Array.isArray(s)?s:typeof s=="object"?[s.x,s.y,s.width,s.height]:arguments.length==4?[].slice.call(arguments):[0,0,0,0],this.x=s[0],this.y=s[1],this.width=s[2],this.height=s[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(s,h,m,E){return this.destination=new n.ViewBox(s,h,m,E),this},at:function(s){return this.destination?new n.ViewBox([this.x+(this.destination.x-this.x)*s,this.y+(this.destination.y-this.y)*s,this.width+(this.destination.width-this.width)*s,this.height+(this.destination.height-this.height)*s]):this}},parent:n.Container,construct:{viewbox:function(s,h,m,E){return arguments.length==0?new n.ViewBox(this):this.attr("viewBox",new n.ViewBox(s,h,m,E))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(s){n.Element.prototype[s]=function(h){return h==null?n.off(this,s):n.on(this,s,h),this}}),n.listenerId=0,n.on=function(s,h,m,E,T){var M=m.bind(E||s),I=s instanceof n.Element?s.node:s;I.instance=I.instance||{_events:{}};var $=I.instance._events;m._svgjsListenerId||(m._svgjsListenerId=++n.listenerId),h.split(n.regex.delimiter).forEach(function(P){var x=P.split(".")[0],N=P.split(".")[1]||"*";$[x]=$[x]||{},$[x][N]=$[x][N]||{},$[x][N][m._svgjsListenerId]=M,I.addEventListener(x,M,T||!1)})},n.off=function(s,h,m,E){var T=s instanceof n.Element?s.node:s;if(T.instance&&(typeof m!="function"||(m=m._svgjsListenerId))){var M=T.instance._events;(h||"").split(n.regex.delimiter).forEach(function(I){var $,P,x=I&&I.split(".")[0],N=I&&I.split(".")[1];if(m)M[x]&&M[x][N||"*"]&&(T.removeEventListener(x,M[x][N||"*"][m],E||!1),delete M[x][N||"*"][m]);else if(x&&N){if(M[x]&&M[x][N]){for(P in M[x][N])n.off(T,[x,N].join("."),P);delete M[x][N]}}else if(N)for(I in M)for($ in M[I])N===$&&n.off(T,[I,N].join("."));else if(x){if(M[x]){for($ in M[x])n.off(T,[x,$].join("."));delete M[x]}}else{for(I in M)n.off(T,I);T.instance._events={}}})}},n.extend(n.Element,{on:function(s,h,m,E){return n.on(this,s,h,m,E),this},off:function(s,h){return n.off(this.node,s,h),this},fire:function(s,h){return s instanceof t.Event?this.node.dispatchEvent(s):this.node.dispatchEvent(s=new n.CustomEvent(s,{detail:h,cancelable:!0})),this._event=s,this},event:function(){return this._event}}),n.Defs=n.invent({create:"defs",inherit:n.Container}),n.G=n.invent({create:"g",inherit:n.Container,extend:{x:function(s){return s==null?this.transform("x"):this.transform({x:s-this.x()},!0)},y:function(s){return s==null?this.transform("y"):this.transform({y:s-this.y()},!0)},cx:function(s){return s==null?this.gbox().cx:this.x(s-this.gbox().width/2)},cy:function(s){return s==null?this.gbox().cy:this.y(s-this.gbox().height/2)},gbox:function(){var s=this.bbox(),h=this.transform();return s.x+=h.x,s.x2+=h.x,s.cx+=h.x,s.y+=h.y,s.y2+=h.y,s.cy+=h.y,s}},construct:{group:function(){return this.put(new n.G)}}}),n.Doc=n.invent({create:function(s){s&&((s=typeof s=="string"?e.getElementById(s):s).nodeName=="svg"?this.constructor.call(this,s):(this.constructor.call(this,n.create("svg")),s.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:n.Container,extend:{namespace:function(){return this.attr({xmlns:n.ns,version:"1.1"}).attr("xmlns:xlink",n.xlink,n.xmlns).attr("xmlns:svgjs",n.svgjs,n.xmlns)},defs:function(){var s;return this._defs||((s=this.node.getElementsByTagName("defs")[0])?this._defs=n.adopt(s):this._defs=new n.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&this.node.parentNode.nodeName!="#document"&&this.node.parentNode.nodeName!="#document-fragment"?this.node.parentNode:null},spof:function(){var s=this.node.getScreenCTM();return s&&this.style("left",-s.e%1+"px").style("top",-s.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,n.parser.draw.parentNode||this.node.appendChild(n.parser.draw),this},clone:function(s){this.writeDataToDom();var h=this.node,m=S(h.cloneNode(!0));return s?(s.node||s).appendChild(m.node):h.parentNode.insertBefore(m.node,h.nextSibling),m}}}),n.extend(n.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var s=this.position()+1,h=this.parent();return h.removeElement(this).add(this,s),h instanceof n.Doc&&h.node.appendChild(h.defs().node),this},backward:function(){var s=this.position();return s>0&&this.parent().removeElement(this).add(this,s-1),this},front:function(){var s=this.parent();return s.node.appendChild(this.node),s instanceof n.Doc&&s.node.appendChild(s.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(s){s.remove();var h=this.position();return this.parent().add(s,h),this},after:function(s){s.remove();var h=this.position();return this.parent().add(s,h+1),this}}),n.Mask=n.invent({create:function(){this.constructor.call(this,n.create("mask")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var s=this.targets.length-1;s>=0;s--)this.targets[s]&&this.targets[s].unmask();return this.targets=[],n.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new n.Mask)}}}),n.extend(n.Element,{maskWith:function(s){return this.masker=s instanceof n.Mask?s:this.parent().mask().add(s),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),n.ClipPath=n.invent({create:function(){this.constructor.call(this,n.create("clipPath")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var s=this.targets.length-1;s>=0;s--)this.targets[s]&&this.targets[s].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new n.ClipPath)}}}),n.extend(n.Element,{clipWith:function(s){return this.clipper=s instanceof n.ClipPath?s:this.parent().clip().add(s),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),n.Gradient=n.invent({create:function(s){this.constructor.call(this,n.create(s+"Gradient")),this.type=s},inherit:n.Container,extend:{at:function(s,h,m){return this.put(new n.Stop).update(s,h,m)},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(s,h,m){return s=="transform"&&(s="gradientTransform"),n.Container.prototype.attr.call(this,s,h,m)}},construct:{gradient:function(s,h){return this.defs().gradient(s,h)}}}),n.extend(n.Gradient,n.FX,{from:function(s,h){return(this._target||this).type=="radial"?this.attr({fx:new n.Number(s),fy:new n.Number(h)}):this.attr({x1:new n.Number(s),y1:new n.Number(h)})},to:function(s,h){return(this._target||this).type=="radial"?this.attr({cx:new n.Number(s),cy:new n.Number(h)}):this.attr({x2:new n.Number(s),y2:new n.Number(h)})}}),n.extend(n.Defs,{gradient:function(s,h){return this.put(new n.Gradient(s)).update(h)}}),n.Stop=n.invent({create:"stop",inherit:n.Element,extend:{update:function(s){return(typeof s=="number"||s instanceof n.Number)&&(s={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),s.opacity!=null&&this.attr("stop-opacity",s.opacity),s.color!=null&&this.attr("stop-color",s.color),s.offset!=null&&this.attr("offset",new n.Number(s.offset)),this}}}),n.Pattern=n.invent({create:"pattern",inherit:n.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},toString:function(){return this.fill()},attr:function(s,h,m){return s=="transform"&&(s="patternTransform"),n.Container.prototype.attr.call(this,s,h,m)}},construct:{pattern:function(s,h,m){return this.defs().pattern(s,h,m)}}}),n.extend(n.Defs,{pattern:function(s,h,m){return this.put(new n.Pattern).update(m).attr({x:0,y:0,width:s,height:h,patternUnits:"userSpaceOnUse"})}}),n.Shape=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Element}),n.Bare=n.invent({create:function(s,h){if(this.constructor.call(this,n.create(s)),h)for(var m in h.prototype)typeof h.prototype[m]=="function"&&(this[m]=h.prototype[m])},inherit:n.Element,extend:{words:function(s){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(e.createTextNode(s)),this}}}),n.extend(n.Parent,{element:function(s,h){return this.put(new n.Bare(s,h))}}),n.Symbol=n.invent({create:"symbol",inherit:n.Container,construct:{symbol:function(){return this.put(new n.Symbol)}}}),n.Use=n.invent({create:"use",inherit:n.Shape,extend:{element:function(s,h){return this.attr("href",(h||"")+"#"+s,n.xlink)}},construct:{use:function(s,h){return this.put(new n.Use).element(s,h)}}}),n.Rect=n.invent({create:"rect",inherit:n.Shape,construct:{rect:function(s,h){return this.put(new n.Rect).size(s,h)}}}),n.Circle=n.invent({create:"circle",inherit:n.Shape,construct:{circle:function(s){return this.put(new n.Circle).rx(new n.Number(s).divide(2)).move(0,0)}}}),n.extend(n.Circle,n.FX,{rx:function(s){return this.attr("r",s)},ry:function(s){return this.rx(s)}}),n.Ellipse=n.invent({create:"ellipse",inherit:n.Shape,construct:{ellipse:function(s,h){return this.put(new n.Ellipse).size(s,h).move(0,0)}}}),n.extend(n.Ellipse,n.Rect,n.FX,{rx:function(s){return this.attr("rx",s)},ry:function(s){return this.attr("ry",s)}}),n.extend(n.Circle,n.Ellipse,{x:function(s){return s==null?this.cx()-this.rx():this.cx(s+this.rx())},y:function(s){return s==null?this.cy()-this.ry():this.cy(s+this.ry())},cx:function(s){return s==null?this.attr("cx"):this.attr("cx",s)},cy:function(s){return s==null?this.attr("cy"):this.attr("cy",s)},width:function(s){return s==null?2*this.rx():this.rx(new n.Number(s).divide(2))},height:function(s){return s==null?2*this.ry():this.ry(new n.Number(s).divide(2))},size:function(s,h){var m=f(this,s,h);return this.rx(new n.Number(m.width).divide(2)).ry(new n.Number(m.height).divide(2))}}),n.Line=n.invent({create:"line",inherit:n.Shape,extend:{array:function(){return new n.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(s,h,m,E){return s==null?this.array():(s=h!==void 0?{x1:s,y1:h,x2:m,y2:E}:new n.PointArray(s).toLine(),this.attr(s))},move:function(s,h){return this.attr(this.array().move(s,h).toLine())},size:function(s,h){var m=f(this,s,h);return this.attr(this.array().size(m.width,m.height).toLine())}},construct:{line:function(s,h,m,E){return n.Line.prototype.plot.apply(this.put(new n.Line),s!=null?[s,h,m,E]:[0,0,0,0])}}}),n.Polyline=n.invent({create:"polyline",inherit:n.Shape,construct:{polyline:function(s){return this.put(new n.Polyline).plot(s||new n.PointArray)}}}),n.Polygon=n.invent({create:"polygon",inherit:n.Shape,construct:{polygon:function(s){return this.put(new n.Polygon).plot(s||new n.PointArray)}}}),n.extend(n.Polyline,n.Polygon,{array:function(){return this._array||(this._array=new n.PointArray(this.attr("points")))},plot:function(s){return s==null?this.array():this.clear().attr("points",typeof s=="string"?s:this._array=new n.PointArray(s))},clear:function(){return delete this._array,this},move:function(s,h){return this.attr("points",this.array().move(s,h))},size:function(s,h){var m=f(this,s,h);return this.attr("points",this.array().size(m.width,m.height))}}),n.extend(n.Line,n.Polyline,n.Polygon,{morphArray:n.PointArray,x:function(s){return s==null?this.bbox().x:this.move(s,this.bbox().y)},y:function(s){return s==null?this.bbox().y:this.move(this.bbox().x,s)},width:function(s){var h=this.bbox();return s==null?h.width:this.size(s,h.height)},height:function(s){var h=this.bbox();return s==null?h.height:this.size(h.width,s)}}),n.Path=n.invent({create:"path",inherit:n.Shape,extend:{morphArray:n.PathArray,array:function(){return this._array||(this._array=new n.PathArray(this.attr("d")))},plot:function(s){return s==null?this.array():this.clear().attr("d",typeof s=="string"?s:this._array=new n.PathArray(s))},clear:function(){return delete this._array,this},move:function(s,h){return this.attr("d",this.array().move(s,h))},x:function(s){return s==null?this.bbox().x:this.move(s,this.bbox().y)},y:function(s){return s==null?this.bbox().y:this.move(this.bbox().x,s)},size:function(s,h){var m=f(this,s,h);return this.attr("d",this.array().size(m.width,m.height))},width:function(s){return s==null?this.bbox().width:this.size(s,this.bbox().height)},height:function(s){return s==null?this.bbox().height:this.size(this.bbox().width,s)}},construct:{path:function(s){return this.put(new n.Path).plot(s||new n.PathArray)}}}),n.Image=n.invent({create:"image",inherit:n.Shape,extend:{load:function(s){if(!s)return this;var h=this,m=new t.Image;return n.on(m,"load",function(){n.off(m);var E=h.parent(n.Pattern);E!==null&&(h.width()==0&&h.height()==0&&h.size(m.width,m.height),E&&E.width()==0&&E.height()==0&&E.size(h.width(),h.height()),typeof h._loaded=="function"&&h._loaded.call(h,{width:m.width,height:m.height,ratio:m.width/m.height,url:s}))}),n.on(m,"error",function(E){n.off(m),typeof h._error=="function"&&h._error.call(h,E)}),this.attr("href",m.src=this.src=s,n.xlink)},loaded:function(s){return this._loaded=s,this},error:function(s){return this._error=s,this}},construct:{image:function(s,h,m){return this.put(new n.Image).load(s).size(h||0,m||h||0)}}}),n.Text=n.invent({create:function(){this.constructor.call(this,n.create("text")),this.dom.leading=new n.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",n.defaults.attrs["font-family"])},inherit:n.Shape,extend:{x:function(s){return s==null?this.attr("x"):this.attr("x",s)},y:function(s){var h=this.attr("y"),m=typeof h=="number"?h-this.bbox().y:0;return s==null?typeof h=="number"?h-m:h:this.attr("y",typeof s.valueOf()=="number"?s+m:s)},cx:function(s){return s==null?this.bbox().cx:this.x(s-this.bbox().width/2)},cy:function(s){return s==null?this.bbox().cy:this.y(s-this.bbox().height/2)},text:function(s){if(s===void 0){s="";for(var h=this.node.childNodes,m=0,E=h.length;m<E;++m)m!=0&&h[m].nodeType!=3&&n.adopt(h[m]).dom.newLined==1&&(s+=`
- `),s+=h[m].textContent;return s}if(this.clear().build(!0),typeof s=="function")s.call(this,this);else{m=0;for(var T=(s=s.split(`
- `)).length;m<T;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,h=n.utils.map(n.utils.filterSVGElements(s.childNodes),function(m){return n.adopt(m)});return new n.Set(h)},rebuild:function(s){if(typeof s=="boolean"&&(this._rebuild=s),this._rebuild){var h=this,m=0,E=this.dom.leading*new n.Number(this.attr("font-size"));this.lines().each(function(){this.dom.newLined&&(h.textPath()||this.attr("x",h.attr("x")),this.text()==`
- `?m+=E:(this.attr("dy",E+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(e.createTextNode(s)),this},tspan:function(s){var h=(this.textPath&&this.textPath()||this).node,m=new n.Tspan;return this._build===!1&&this.clear(),h.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 h=new n.TextPath,m=this.doc().defs().path(s);this.node.hasChildNodes();)h.node.appendChild(this.node.firstChild);return this.node.appendChild(h.node),h.attr("href","#"+m,n.xlink),this},array:function(){var s=this.track();return s?s.array():null},plot:function(s){var h=this.track(),m=null;return h&&(m=h.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 h=new n.A;return typeof s=="function"?s.call(h,h):h.to(s),this.parent().put(h).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,h){return this.attr("refX",s).attr("refY",h)},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},toString:function(){return"url(#"+this.id()+")"}},construct:{marker:function(s,h,m){return this.defs().marker(s,h,m)}}}),n.extend(n.Defs,{marker:function(s,h,m){return this.put(new n.Marker).size(s,h).ref(s/2,h/2).viewbox(0,0,s,h).attr("orient","auto").update(m)}}),n.extend(n.Line,n.Polyline,n.Polygon,n.Path,{marker:function(s,h,m,E){var T=["marker"];return s!="all"&&T.push(s),T=T.join("-"),s=arguments[1]instanceof n.Marker?arguments[1]:this.doc().marker(h,m,E),this.attr(T,s)}});var c={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(s,h){return h=="color"?s:s+"-"+h}};function l(s,h,m,E){return m+E.replace(n.regex.dots," .")}function u(s){for(var h=s.slice(0),m=h.length;m--;)Array.isArray(h[m])&&(h[m]=u(h[m]));return h}function p(s){return s.toLowerCase().replace(/-(.)/g,function(h,m){return m.toUpperCase()})}function d(s){return s.charAt(0).toUpperCase()+s.slice(1)}function y(s){var h=s.toString(16);return h.length==1?"0"+h:h}function f(s,h,m){if(h==null||m==null){var E=s.bbox();h==null?h=E.width/E.height*m:m==null&&(m=E.height/E.width*h)}return{width:h,height:m}}function v(s,h,m){return{x:h*s.a+m*s.c+0,y:h*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 b(s,h){s.cx=s.cx==null?h.bbox().cx:s.cx,s.cy=s.cy==null?h.bbox().cy:s.cy}function S(s){for(var h=s.childNodes.length-1;h>=0;h--)s.childNodes[h]instanceof t.SVGElement&&S(s.childNodes[h]);return n.adopt(s).id(n.eid(s.nodeName))}function w(s){return s.x==null&&(s.x=0,s.y=0,s.width=0,s.height=0),s.w=s.width,s.h=s.height,s.x2=s.x+s.width,s.y2=s.y+s.height,s.cx=s.x+s.width/2,s.cy=s.y+s.height/2,s}function _(s){return Math.abs(s)>1e-37?s:0}["fill","stroke"].forEach(function(s){var h,m={};m[s]=function(E){if(E===void 0)return this;if(typeof E=="string"||n.Color.isRgb(E)||E&&typeof E.fill=="function")this.attr(s,E);else for(h=c[s].length-1;h>=0;h--)E[c[s][h]]!=null&&this.attr(c.prefix(s,c[s][h]),E[c[s][h]]);return this},n.extend(n.Element,n.FX,m)}),n.extend(n.Element,n.FX,{rotate:function(s,h,m){return this.transform({rotation:s,cx:h,cy:m})},skew:function(s,h,m,E){return arguments.length==1||arguments.length==3?this.transform({skew:s,cx:h,cy:m}):this.transform({skewX:s,skewY:h,cx:m,cy:E})},scale:function(s,h,m,E){return arguments.length==1||arguments.length==3?this.transform({scale:s,cx:h,cy:m}):this.transform({scaleX:s,scaleY:h,cx:m,cy:E})},translate:function(s,h){return this.transform({x:s,y:h})},flip:function(s,h){return h=typeof s=="number"?s:h,this.transform({flip:s||"both",offset:h})},matrix:function(s){return this.attr("transform",new n.Matrix(arguments.length==6?[].slice.call(arguments):s))},opacity:function(s){return this.attr("opacity",s)},dx:function(s){return this.x(new n.Number(s).plus(this instanceof n.FX?0:this.x()),!0)},dy:function(s){return this.y(new n.Number(s).plus(this instanceof n.FX?0:this.y()),!0)},dmove:function(s,h){return this.dx(s).dy(h)}}),n.extend(n.Rect,n.Ellipse,n.Circle,n.Gradient,n.FX,{radius:function(s,h){var m=(this._target||this).type;return m=="radial"||m=="circle"?this.attr("r",new n.Number(s)):this.rx(s).ry(h??s)}}),n.extend(n.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(s){return this.node.getPointAtLength(s)}}),n.extend(n.Parent,n.Text,n.Tspan,n.FX,{font:function(s,h){if(typeof s=="object")for(h in s)this.font(h,s[h]);return s=="leading"?this.leading(h):s=="anchor"?this.attr("text-anchor",h):s=="size"||s=="family"||s=="weight"||s=="stretch"||s=="variant"||s=="style"?this.attr("font-"+s,h):this.attr(s,h)}}),n.Set=n.invent({create:function(s){s instanceof n.Set?this.members=s.members.slice():Array.isArray(s)?this.members=s:this.clear()},extend:{add:function(){var s,h,m=[].slice.call(arguments);for(s=0,h=m.length;s<h;s++)this.members.push(m[s]);return this},remove:function(s){var h=this.index(s);return h>-1&&this.members.splice(h,1),this},each:function(s){for(var h=0,m=this.members.length;h<m;h++)s.apply(this.members[h],[h,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 h in n.Shape.prototype)typeof n.Shape.prototype[h]=="function"&&typeof n.Set.prototype[h]!="function"&&s.push(h);for(var h in s.forEach(function(E){n.Set.prototype[E]=function(){for(var T=0,M=this.members.length;T<M;T++)this.members[T]&&typeof this.members[T][E]=="function"&&this.members[T][E].apply(this.members[T],arguments);return E=="animate"?this.fx||(this.fx=new n.FX.Set(this)):this}}),s=[],n.FX.prototype)typeof n.FX.prototype[h]=="function"&&typeof n.FX.Set.prototype[h]!="function"&&s.push(h);s.forEach(function(m){n.FX.Set.prototype[m]=function(){for(var E=0,T=this.set.members.length;E<T;E++)this.set.members[E].fx[m].apply(this.set.members[E].fx,arguments);return this}})},n.extend(n.Element,{data:function(s,h,m){if(typeof s=="object")for(h in s)this.data(h,s[h]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+s))}catch{return this.attr("data-"+s)}else this.attr("data-"+s,h===null?null:m===!0||typeof h=="string"||typeof h=="number"?h:JSON.stringify(h));return this}}),n.extend(n.Element,{remember:function(s,h){if(typeof arguments[0]=="object")for(var h in s)this.remember(h,s[h]);else{if(arguments.length==1)return this.memory()[s];this.memory()[s]=h}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 h=e.getElementById(function(m){var E=(m||"").toString().match(n.regex.reference);if(E)return E[1]}(s)||s);return n.adopt(h)},n.select=function(s,h){return new n.Set(n.utils.map((h||e).querySelectorAll(s),function(m){return n.adopt(m)}))},n.extend(n.Parent,{select:function(s){return n.select(s,this.node)}});var C="abcdef".split("");if(typeof t.CustomEvent!="function"){var B=function(s,h){h=h||{bubbles:!1,cancelable:!1,detail:void 0};var m=e.createEvent("CustomEvent");return m.initCustomEvent(s,h.bubbles,h.cancelable,h.detail),m};B.prototype=t.Event.prototype,n.CustomEvent=B}else n.CustomEvent=t.CustomEvent;return function(s){for(var h=0,m=["moz","webkit"],E=0;E<m.length&&!t.requestAnimationFrame;++E)s.requestAnimationFrame=s[m[E]+"RequestAnimationFrame"],s.cancelAnimationFrame=s[m[E]+"CancelAnimationFrame"]||s[m[E]+"CancelRequestAnimationFrame"];s.requestAnimationFrame=s.requestAnimationFrame||function(T){var M=new Date().getTime(),I=Math.max(0,16-(M-h)),$=s.setTimeout(function(){T(M+I)},I);return h=M+I,$},s.cancelAnimationFrame=s.cancelAnimationFrame||s.clearTimeout}(t),n};var Iw=Nw.exports=Ec.document?Yp(Ec,Ec.document):function(t){return Yp(t,t.document)},Jp={exports:{}};(function(t,e){function n(i,r){return r.querySelector(i)}(e=Jp.exports=function(i,r){return n(i,r=r||document)}).all=function(i,r){return(r=r||document).querySelectorAll(i)},e.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,e.all=i.all,e}})(0,Jp.exports);var va=Jp.exports,Ve="tokenSimulation",J={TOGGLE_MODE_EVENT:Ve+".toggleMode",GENERATE_TOKEN_EVENT:Ve+".generateToken",CONSUME_TOKEN_EVENT:Ve+".consumeToken",PLAY_SIMULATION_EVENT:Ve+".playSimulation",PAUSE_SIMULATION_EVENT:Ve+".pauseSimulation",RESET_SIMULATION_EVENT:Ve+".resetSimulation",TERMINATE_EVENT:Ve+".terminateEvent",UPDATE_ELEMENTS_EVENT:Ve+".updateElements",UPDATE_ELEMENT_EVENT:Ve+".updateElement",PROCESS_INSTANCE_CREATED_EVENT:Ve+".processInstanceCreated",PROCESS_INSTANCE_FINISHED_EVENT:Ve+".processInstanceFinished",PROCESS_INSTANCE_SHOWN_EVENT:Ve+".processInstanceShown",PROCESS_INSTANCE_HIDDEN_EVENT:Ve+".processInstanceHidden",ANIMATION_CREATED_EVENT:Ve+".animationCreated"},Ft={};const Fg=dA(B0);var Dw=Fg.every,Bw=Fg.some;function zg(t,e){for(var n=e.parent;n;){if(n===t)return!0;n=n.parent}return!1}Ft.is=function(t,e){if(t.type!=="label"){Array.isArray(e)||(e=[e]);var n=!1;return e.forEach(function(i){i===t.type&&(n=!0)}),n}},Ft.isTypedEvent=function(t,e,n){return Bw(t.eventDefinitions,function(i){return i.$type===e&&function(r,o){return Dw(o,function(a,c){return r[c]==a})}(t,n)})},Ft.getBusinessObject=function(t){return t&&t.businessObject||t},Ft.isAncestor=zg,Ft.getDescendants=function(t,e){return t.filter(function(n){return zg(e,n)})},Ft.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 Ow={getMid:function(t){var e=t.bbox();return{x:e.x+e.width/2,y:e.y+e.height/2}},distance:function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}},$g=Iw,Lw=va,jw=J.RESET_SIMULATION_EVENT,Vw=J.PLAY_SIMULATION_EVENT,Fw=J.PAUSE_SIMULATION_EVENT,zw=J.TERMINATE_EVENT,$w=J.PROCESS_INSTANCE_FINISHED_EVENT,Gw=J.ANIMATION_CREATED_EVENT,Gg=Ft.isAncestor,Uw=Ow.distance,Hw=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44"),Ug=20;function nr(t,e){var n=window.animation=this;this._eventBus=e,this.animations=[],this.hiddenAnimations=[],this.animationSpeed=1,e.on("import.done",function(){var i=$g(t._svg),r=Lw(".viewport",t._svg),o=$g.adopt(r);n.group=i.group().attr("id","token-simulation"),o.put(n.group)}),e.on(zw,function(i){var r=i.element.parent;n.animations.forEach(function(o){Gg(r,o.element)&&(o.animation.stop(),n.animations=n.animations.filter(function(a){return a!==o}))})}),e.on($w,function(i){var r=i.parent;n.animations.forEach(function(o){(i.processInstanceId===o.processInstanceId||Gg(r,o.element))&&(o.animation.stop(),n.animations=n.animations.filter(function(a){return a!==o}))})}),e.on(jw,function(){n.animations.forEach(function(i){i.animation.stop()}),n.animations=[],n.hiddenAnimations=[]}),e.on(Fw,function(){n.animations.forEach(function(i){i.animation.pause()})}),e.on(Vw,function(){n.animations.forEach(function(i){i.animation.play()})})}nr.prototype.createAnimation=function(t,e,n){var i=this;if(this.group){var r,o=this._createTokenGfx(e);return r=new ya(o,t.waypoints,function(){i.animations=i.animations.filter(function(a){return a.animation!==r}),n&&n()}),this.hiddenAnimations.includes(e)&&o.hide(),o.fx._speed=this.animationSpeed,this.animations.push({tokenGfx:o,animation:r,element:t,processInstanceId:e}),this._eventBus.fire(Gw,{tokenGfx:o,animation:r,element:t,processInstanceId:e}),r}},nr.prototype.setAnimationSpeed=function(t){this.animations.forEach(function(e){e.tokenGfx.fx._speed=t}),this.animationSpeed=t},nr.prototype._createTokenGfx=function(t){var e=this.group.group().attr("class","token").hide();return e.circle(Ug,Ug).attr("fill",Hw).attr("class","circle"),e.text(t.toString()).attr("transform","translate(10, -7)").attr("text-anchor","middle").attr("class","text"),e},nr.prototype.showProcessInstanceAnimations=function(t){this.animations.forEach(function(e){e.processInstanceId===t&&e.tokenGfx.show()}),this.hiddenAnimations=this.hiddenAnimations.filter(function(e){return e!==t})},nr.prototype.hideProcessInstanceAnimations=function(t){this.animations.forEach(function(e){e.processInstanceId===t&&e.tokenGfx.hide()}),this.hiddenAnimations.push(t)},nr.$inject=["canvas","eventBus"];var qw=nr;function ya(t,e,n){this.gfx=this.fx=t,this.waypoints=e,this.done=n,this.create()}ya.prototype.create=function(){var t=this.gfx,e=this.waypoints,n=this.done,i=this.fx;t.show().move(e[0].x-10,e[0].y-10),e.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})(e)&&(l="<>");var u=20*Uw(e[o-1],r);i=i.animate(u,l,0).move(a,c)}}),i.after(function(){t.remove(),n()})},ya.prototype.play=function(){this.gfx.play()},ya.prototype.pause=function(){this.gfx.pause()},ya.prototype.stop=function(){this.fx.stop(),this.gfx.remove()};var Zp,Ww=function(t,e){if(typeof t!="string")throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body")return(r=e.createElement("html")).innerHTML=t,r.removeChild(r.lastChild);var r,o=Object.prototype.hasOwnProperty.call(re,i)?re[i]:re._default,a=o[0],c=o[1],l=o[2];for((r=e.createElement("div")).innerHTML=c+t+l;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=e.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},Hg=!1;typeof document<"u"&&((Zp=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Hg=!Zp.getElementsByTagName("link").length,Zp=void 0);var re={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Hg?[1,"X<div>","</div>"]:[0,"",""]};re.td=re.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],re.option=re.optgroup=[1,'<select multiple="multiple">',"</select>"],re.thead=re.tbody=re.colgroup=re.caption=re.tfoot=[1,"<table>","</table>"],re.polyline=re.ellipse=re.polygon=re.circle=re.text=re.line=re.path=re.rect=re.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Me=Ww,Qp={},qg=window.addEventListener?"addEventListener":"attachEvent",Xw=window.removeEventListener?"removeEventListener":"detachEvent",Wg=qg!=="addEventListener"?"on":"";Qp.bind=function(t,e,n,i){return t[qg](Wg+e,n,i||!1),n},Qp.unbind=function(t,e,n,i){return t[Xw](Wg+e,n,i||!1),n};var fn=Qp,Kw=Me,Yw=fn,Xg=Ft.is,Jw=J.GENERATE_TOKEN_EVENT,Zw=J.UPDATE_ELEMENT_EVENT;function th(t,e,n){this._eventBus=t,this._processInstances=e,this._processInstanceSettings=n}th.prototype.createContextPads=function(t){if(t.attachers.length&&this._processInstances.getProcessInstances(t).length){var e=t.incoming.filter(function(r){return Xg(r,"bpmn:SequenceFlow")}),n=this,i=[];return t.attachers.forEach(function(r){var o=r.outgoing.filter(function(c){return Xg(c,"bpmn:SequenceFlow")});if(e.length&&o.length){var a=Kw('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>');i.push({element:r,html:a}),Yw.bind(a,"click",function(){n._processInstances.getProcessInstances(t).forEach(function(c){var l=c.parentProcessInstanceId;r.businessObject.cancelActivity&&(t.children.forEach(function(u){u.tokenCount&&u.tokenCount[c.processInstanceId]&&u.tokenCount[c.processInstanceId]--}),n._processInstances.finish(c.processInstanceId),n._eventBus.fire(Zw,{element:t})),n._eventBus.fire(Jw,{element:r,processInstanceId:l})})})}}),i}},th.$inject=["eventBus","processInstances","processInstanceSettings"];var Qw=th,t1=Ft.is,e1=Me,n1=fn;function eh(t){this._exclusiveGatewaySettings=t}eh.prototype.createContextPads=function(t){var e=this;if(!(t.outgoing.filter(function(i){return t1(i,"bpmn:SequenceFlow")}).length<2)){var n=e1('<div class="context-pad" title="Set Sequence Flow"><i class="fa fa-code-fork"></i></div>');return n1.bind(n,"click",function(){e._exclusiveGatewaySettings.setSequenceFlow(t)}),[{element:t,html:n}]}},eh.$inject=["exclusiveGatewaySettings"];var i1=eh,Kg=Me,Yg=fn,nh=Ft.is,Jg=J.GENERATE_TOKEN_EVENT;function ih(t){this._eventBus=t}ih.prototype.createContextPads=function(t){var e=t.parent.shownProcessInstance,n=t.incoming.filter(function(c){return nh(c,"bpmn:SequenceFlow")}),i=[];n.forEach(function(c){var l=c.source;nh(l,"bpmn:EventBasedGateway")&&l.tokenCount&&l.tokenCount[e]&&i.push(l)});var r=t.outgoing.filter(function(c){return nh(c,"bpmn:SequenceFlow")});if(n.length&&r.length){var o,a=this;if(t.tokenCount&&t.tokenCount[e])o=Kg('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),Yg.bind(o,"click",function(){t.tokenCount[e]--,a._eventBus.fire(Jg,{element:t,processInstanceId:e})});else{if(!i.length)return;o=Kg('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),Yg.bind(o,"click",function(){i.forEach(function(c){c.tokenCount[e]--}),a._eventBus.fire(Jg,{element:t,processInstanceId:e})})}return[{element:t,html:o}]}},ih.$inject=["eventBus"];var r1=ih,o1=Me,a1=fn;function rh(t,e){this._processInstances=t,this._processInstanceSettings=e}rh.prototype.createContextPads=function(t){var e=this;if(!(this._processInstances.getProcessInstances(t).filter(function(i){return!i.isFinished}).length<2)){var n=o1('<div class="context-pad" title="View Process Instances"><i class="fa fa-list-ol"></i></div>');return a1.bind(n,"click",function(){e._processInstanceSettings.showNext(t)}),[{element:t,html:n}]}},rh.$inject=["processInstances","processInstanceSettings"];var s1=rh,c1=Me,l1=fn,u1=Ft.is,p1=J.GENERATE_TOKEN_EVENT;function oh(t,e,n){this._eventBus=t,this._elementRegistry=e,this._animation=n}oh.prototype.createContextPads=function(t){var e=!1;if(this._elementRegistry.forEach(function(r){r.tokenCount&&Object.values(r.tokenCount).forEach(function(o){o&&(e=!0)})}),!(u1(t.parent,"bpmn:SubProcess")||e||this._animation.animations.length)){var n=this,i=c1('<div class="context-pad"><i class="fa fa-play"></i></div>');return l1.bind(i,"click",function(){n._eventBus.fire(p1,{element:t})}),[{element:t,html:i}]}},oh.$inject=["eventBus","elementRegistry","animation"];var h1=oh,Zg=Ft.isAncestor,d1=J.TOGGLE_MODE_EVENT,m1=J.RESET_SIMULATION_EVENT,f1=J.TERMINATE_EVENT,v1=J.UPDATE_ELEMENTS_EVENT,y1=J.UPDATE_ELEMENT_EVENT,g1=J.PROCESS_INSTANCE_SHOWN_EVENT,b1=Qw,x1=i1,E1=r1,_1=s1,w1=h1,ga=500;function ir(t,e,n,i,r,o){var a=this;this._elementRegistry=e,this._overlays=n,this._injector=i,this._canvas=r,this._processInstances=o,this.overlayIds={},this.handlers={},this.registerHandler("bpmn:ExclusiveGateway",x1),this.registerHandler("bpmn:IntermediateCatchEvent",E1),this.registerHandler("bpmn:SubProcess",_1),this.registerHandler("bpmn:SubProcess",b1),this.registerHandler("bpmn:StartEvent",w1),t.on(d1,ga,function(c){c.simulationModeActive?a.openContextPads():a.closeContextPads()}),t.on(m1,ga,function(){a.closeContextPads(),a.openContextPads()}),t.on(f1,ga,function(c){var l=c.element.parent;a.closeContextPads(l)}),t.on(v1,ga,function(c){c.elements.forEach(function(l){a.closeElementContextPads(l),a.openElementContextPads(l)})}),t.on(y1,ga,function(c){var l=c.element;a.closeElementContextPads(l),a.openElementContextPads(l)}),t.on(g1,function(c){var l=c.processInstanceId,u=o.getProcessInstance(l).parent;a.closeContextPads(u),a.openContextPads(u)})}ir.prototype.registerHandler=function(t,e){var n=this._injector.instantiate(e);this.handlers[t]||(this.handlers[t]=[]),this.handlers[t].push(n)},ir.prototype.openContextPads=function(t){var e=this;t||(t=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){e.handlers[n.type]&&Zg(t,n)&&e.openElementContextPads(n)})},ir.prototype.openElementContextPads=function(t){if(this.handlers[t.type]){var e=[];this.handlers[t.type].forEach(function(i){var r=i.createContextPads(t);r&&r.forEach(function(o){o&&e.push(o)})});var n=this;e.forEach(function(i){var r={top:-15,left:-15},o=n._overlays.add(i.element,"context-menu",{position:r,html:i.html,show:{minZoom:.5}});n.overlayIds[i.element.id]=o})}},ir.prototype.closeContextPads=function(t){var e=this;t||(t=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){Zg(t,n)&&e.closeElementContextPads(n)})},ir.prototype.closeElementContextPads=function(t){var e=this;t.attachers&&t.attachers.length>0&&t.attachers.forEach(function(i){e.closeElementContextPads(i)}),t.children&&t.children.length>0&&t.children.forEach(function(i){e.closeElementContextPads(i)});var n=this.overlayIds[t.id];n&&(this._overlays.remove(n),delete this.overlayIds[t.id])},ir.$inject=["eventBus","elementRegistry","overlays","injector","canvas","processInstances"];var S1=ir,C1=J.TOGGLE_MODE_EVENT;function Qg(t,e,n,i,r,o,a,c){var l=this;function u(y,f,v){var g=y[f];y[f]=function(){return v.call(this,g,arguments)}}function p(y,f){u(y,f,function(v,g){if(!l.modelingDisabled)return v.apply(this,g)})}function d(y,f){u(y,f,function(v,g){if(l.modelingDisabled)throw new Error("model is read-only");return v.apply(this,g)})}this._eventBus=t,this.modelingDisabled=!1,t.on(C1,10001,function(y){var f=y.simulationModeActive;l.modelingDisabled=f,l.modelingDisabled&&(i.cancel(),e.close(),n.cancel()),a._update()}),p(e,"open"),p(n,"init"),p(i,"activate"),p(n,"init"),p(i,"activate"),d(o,"moveShape"),d(o,"updateAttachment"),d(o,"moveElements"),d(o,"moveConnection"),d(o,"layoutConnection"),d(o,"createConnection"),d(o,"createShape"),d(o,"createLabel"),d(o,"appendShape"),d(o,"removeElements"),d(o,"distributeElements"),d(o,"removeShape"),d(o,"removeConnection"),d(o,"replaceShape"),d(o,"pasteElements"),d(o,"alignElements"),d(o,"resizeShape"),d(o,"createSpace"),d(o,"updateWaypoints"),d(o,"reconnectStart"),d(o,"reconnectEnd"),u(r,"trigger",function(y,f){var v=f[0];if(!l.modelingDisabled||!function(g,b){return g.indexOf(b)>-1}(["undo","redo","copy","paste","removeSelection","spaceTool","lassoTool","globalConnectTool","distributeElements","alignElements","directEditing"],v))return y.apply(this,f)})}Qg.$inject=["eventBus","contextPad","dragging","directEditing","editorActions","modeling","palette","paletteProvider"];var T1=Qg,A1=Me,k1=J.TOGGLE_MODE_EVENT,P1=J.RESET_SIMULATION_EVENT,M1=J.GENERATE_TOKEN_EVENT;function Xr(t,e){var n=this;this._overlays=t,e.on(k1,function(i){i.simulationModeActive||n.removeElementNotifications()}),e.on([P1,M1],function(){n.removeElementNotifications()})}Xr.prototype.addElementNotifications=function(t,e){var n=this;t.forEach(function(i){n.addElementNotification(i,e)})},Xr.prototype.addElementNotification=function(t,e){var n={top:-15,right:15},i='<div class="element-notification '+(e.type||"")+'">'+(e.icon?'<i class="fa '+e.icon+'"></i>':"")+('<span class="text">'+e.text+"</span>"||"")+"</div>",r=A1(i);this._overlays.add(t,"element-notification",{position:n,html:r,show:{minZoom:.5}})},Xr.prototype.removeElementNotifications=function(t){var e=this;t?t.forEach(function(n){e.removeElementNotification(n)}):this._overlays.remove({type:"element-notification"})},Xr.prototype.removeElementNotification=function(t){this._overlays.remove({element:t})},Xr.$inject=["overlays","eventBus"];var tb,eb,R1=Xr;function nb(){return eb?tb:(eb=1,tb=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1})}try{var _c=nb()}catch{_c=nb()}var N1=/\s+/,I1=Object.prototype.toString;function ki(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}ki.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~_c(e,t)||e.push(t),this.el.className=e.join(" "),this},ki.prototype.remove=function(t){if(I1.call(t)=="[object RegExp]")return this.removeMatching(t);if(this.list)return this.list.remove(t),this;var e=this.array(),n=_c(e,t);return~n&&e.splice(n,1),this.el.className=e.join(" "),this},ki.prototype.removeMatching=function(t){for(var e=this.array(),n=0;n<e.length;n++)t.test(e[n])&&this.remove(e[n]);return this},ki.prototype.toggle=function(t,e){return this.list?(e!==void 0?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(e!==void 0?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},ki.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(N1);return t[0]===""&&t.shift(),t},ki.prototype.has=ki.prototype.contains=function(t){return this.list?this.list.contains(t):!!~_c(this.array(),t)};var Pi=function(t){return new ki(t)},ib=Pi,rb=Ft,ba=rb.is,ob=rb.supportedElements,D1=J.TOGGLE_MODE_EVENT,B1=J.GENERATE_TOKEN_EVENT,ab=["bpmn:Process","bpmn:Collaboration","bpmn:Participant","bpmn:Lane","bpmn:TextAnnotation"];function sb(t){return t.labelTarget}function xa(t,e,n,i,r){var o=this;this._eventBus=t,this._elementRegistry=e,this._elementNotifications=r,this._notifications=i,this.canvasParent=n.getContainer().parentNode,t.on(B1,2e4,function(a){var c=a.element;if(ba(c,"bpmn:StartEvent"))return o.allElementsSupported()?void 0:(o.showWarnings(),ib(o.canvasParent).add("warning"),!0)}),t.on(D1,function(a){a.simulationModeActive||ib(o.canvasParent).remove("warning")})}xa.prototype.allElementsSupported=function(){var t=!0;return this._elementRegistry.forEach(function(e){ba(e,ab)||ba(e,ob)||sb(e)||(t=!1)}),t},xa.prototype.showWarnings=function(t){var e=this,n=[];this._elementRegistry.forEach(function(i){ba(i,ab)||ba(i,ob)||sb(i)||(e.showWarning(i),n.indexOf(i.type)&&(e._notifications.showNotification(i.type+" not supported","warning"),n.push(i.type)))})},xa.prototype.showWarning=function(t){this._elementNotifications.addElementNotification(t,{type:"warning",icon:"fa-exclamation-triangle",text:"Not supported"})},xa.$inject=["eventBus","elementRegistry","canvas","notifications","elementNotifications"];var O1=xa,ah=Ft.is,L1=J.TOGGLE_MODE_EVENT,j1=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-lighten-56"),V1=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-darken-30");function Ea(t){return ah(t,"bpmn:SequenceFlow")}function rr(t,e,n){var i=this;this._elementRegistry=e,this._graphicsFactory=n,t.on(L1,function(r){r.simulationModeActive?i.setSequenceFlowsDefault():i.resetSequenceFlows()})}rr.prototype.setSequenceFlowsDefault=function(){var t=this;this._elementRegistry.filter(function(e){return ah(e,"bpmn:ExclusiveGateway")}).forEach(function(e){e.outgoing.filter(Ea).length&&t.setSequenceFlow(e,e.outgoing.filter(Ea)[0])})},rr.prototype.resetSequenceFlows=function(){var t=this;this._elementRegistry.filter(function(e){return ah(e,"bpmn:ExclusiveGateway")}).forEach(function(e){e.outgoing.filter(Ea).length&&t.resetSequenceFlow(e)})},rr.prototype.resetSequenceFlow=function(t){t.sequenceFlow&&delete t.sequenceFlow},rr.prototype.setSequenceFlow=function(t){var e=this,n=t.outgoing.filter(Ea);if(n.length){var i=t.sequenceFlow;t.sequenceFlow=i?function(r){var o=r.outgoing.filter(Ea),a=o.indexOf(r.sequenceFlow);return o[a+1]?o[a+1]:o[0]}(t):n[0],t.outgoing.forEach(function(r){r===t.sequenceFlow?e.setColor(r,V1):e.setColor(r,j1)})}},rr.prototype.setColor=function(t,e){t.businessObject.di.set("stroke",e);var n=this._elementRegistry.getGraphics(t);this._graphicsFactory.update("connection",t,n)},rr.$inject=["eventBus","elementRegistry","graphicsFactory"];var F1=rr,wc=Me,ti=Pi,_a=fn,Sc=va,sh=Ft,z1=sh.getBusinessObject,an=sh.is,$1=sh.isTypedEvent,G1=J.GENERATE_TOKEN_EVENT,U1=J.CONSUME_TOKEN_EVENT,H1=J.TOGGLE_MODE_EVENT,q1=J.RESET_SIMULATION_EVENT,W1=J.PROCESS_INSTANCE_CREATED_EVENT;function ch(t){return t&&t.businessObject.name}function Kr(t,e,n,i){var r=this;this._notifications=e,this._tokenSimulationPalette=n,this._canvas=i,this._init(),t.on(G1,function(o){var a=o.element,c=ch(a);if(an(a,"bpmn:BusinessRuleTask"))r.log(c||"Business Rule Task","info","bpmn-icon-business-rule");else if(an(a,"bpmn:CallActivity"))r.log(c||"Call Activity","info","bpmn-icon-call-activity");else if(an(a,["bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent"]))r.log(c||"Intermediate Event","info","bpmn-icon-intermediate-event-none");else if(an(a,"bpmn:ManualTask"))r.log(c||"Manual Task","info","bpmn-icon-manual");else if(an(a,"bpmn:ScriptTask"))r.log(c||"Script Task","info","bpmn-icon-script");else if(an(a,"bpmn:ServiceTask"))r.log(c||"Service Task","info","bpmn-icon-service");else if(an(a,"bpmn:StartEvent"))r.log(c||"Start Event","info","bpmn-icon-start-event-none");else if(an(a,"bpmn:Task"))r.log(c||"Task","info","bpmn-icon-task");else if(an(a,"bpmn:UserTask"))r.log(c||"User Task","info","bpmn-icon-user");else if(an(a,"bpmn:ExclusiveGateway")){if(a.outgoing.length<2)return;var l=ch(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")}}),t.on(U1,function(o){var a=o.element,c=ch(a);an(a,"bpmn:EndEvent")&&($1(z1(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"))}),t.on(W1,function(o){var a=o.processInstanceId,c=o.parent;an(c,"bpmn:Process")?r.log("Process "+a+" started","success","fa-check"):r.log("Subprocess "+a+" started","info","fa-check")}),t.on(H1,function(o){o.simulationModeActive||(r.emptyLog(),ti(r.container).add("hidden"))}),t.on(q1,function(o){r.emptyLog(),ti(r.container).add("hidden")})}Kr.prototype._init=function(){var t=this;this.container=wc('<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=Sc(".placeholder",this.container),this.content=Sc(".content",this.container),_a.bind(this.content,"wheel",function(e){e.stopPropagation()}),_a.bind(this.content,"mousedown",function(e){e.stopPropagation()}),this.close=Sc(".close",this.container),_a.bind(this.close,"click",function(){ti(t.container).add("hidden")}),this.icon=Sc(".fa-align-left",this.container),_a.bind(this.icon,"click",function(){ti(t.container).add("hidden")}),this._canvas.getContainer().appendChild(this.container),this.paletteEntry=wc('<div class="entry" title="Show Simulation Log"><i class="fa fa-align-left"></i></div>'),_a.bind(this.paletteEntry,"click",function(){ti(t.container).remove("hidden")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,3)},Kr.prototype.toggle=function(){var t=this.container;ti(t).has("hidden")?ti(t).remove("hidden"):ti(t).add("hidden")},Kr.prototype.log=function(t,e,n){ti(this.placeholder).add("hidden");var i,r=new Date,o=r.toLocaleTimeString()+":"+r.getUTCMilliseconds();this._notifications.showNotification(t,e,n),n||(n="fa-info"),i=n.includes("bpmn")?'<span class="icon '+n+'">':'<i class="icon fa '+n+'"></i>';var a=wc('<p class="entry '+e+'"><span class="date">'+o+"</span>"+i+"</span>"+t+"</p>");this.content.appendChild(a),this.content.scrollTop=this.content.scrollHeight},Kr.prototype.emptyLog=function(){for(;this.content.firstChild;)this.content.removeChild(this.content.firstChild);this.placeholder=wc('<p class="entry placeholder">No Entries</p>'),this.content.appendChild(this.placeholder)},Kr.$inject=["eventBus","notifications","tokenSimulationPalette","canvas"];var X1=Kr,cb=Me,K1=J.TOGGLE_MODE_EVENT;function wa(t,e){var n=this;this._eventBus=t,this._canvas=e,this._init(),t.on(K1,function(i){i.simulationModeActive||n.removeAll()})}wa.prototype._init=function(){this.container=cb('<div class="notifications"></div>'),this._canvas.getContainer().appendChild(this.container)},wa.prototype.showNotification=function(t,e,n){var i;n||(n="fa-info"),i=n.includes("bpmn")?'<i class="'+n+'"></i>':'<i class="fa '+n+'"></i>';var r=cb('<div class="notification '+e+'"><span class="icon">'+i+"</span>"+t+"</div>");for(this.container.appendChild(r);this.container.children.length>5;)this.container.children[0].remove();setTimeout(function(){r.remove()},2e3)},wa.prototype.removeAll=function(){for(;this.container.children.length;)this.container.children[0].remove()},wa.$inject=["eventBus","canvas"];var Y1=wa,J1=Me,or=Pi,Z1=fn,Q1=J.TOGGLE_MODE_EVENT,tS=J.PLAY_SIMULATION_EVENT,eS=J.PAUSE_SIMULATION_EVENT,nS=J.RESET_SIMULATION_EVENT,iS=J.ANIMATION_CREATED_EVENT,rS=J.PROCESS_INSTANCE_CREATED_EVENT,lb='<i class="fa fa-play"></i>';function Mi(t,e,n,i){var r=this;this._eventBus=t,this._tokenSimulationPalette=e,this._notifications=n,this.canvasParent=i.getContainer().parentNode,this.isActive=!1,this.isPaused=!1,this._init(),t.on(rS,function(o){o.parent.parent||(r.activate(),r.unpause(),n.showNotification("Start Simulation","info"))}),t.on([nS,Q1],function(){r.deactivate(),r.unpause()}),t.on(iS,function(o){var a=o.animation;r.isPaused&&a.pause()})}Mi.prototype._init=function(){this.paletteEntry=J1('<div class="entry disabled" title="Play/Pause Simulation">'+lb+"</div>"),Z1.bind(this.paletteEntry,"click",this.toggle.bind(this)),this._tokenSimulationPalette.addEntry(this.paletteEntry,1)},Mi.prototype.toggle=function(){this.isActive&&(this.isPaused?this.unpause():this.pause())},Mi.prototype.pause=function(){this.isActive&&(or(this.paletteEntry).remove("active"),or(this.canvasParent).add("paused"),this.paletteEntry.innerHTML=lb,this._eventBus.fire(eS),this._notifications.showNotification("Pause Simulation","info"),this.isPaused=!0)},Mi.prototype.unpause=function(){this.isActive&&(or(this.paletteEntry).add("active"),or(this.canvasParent).remove("paused"),this.paletteEntry.innerHTML='<i class="fa fa-pause"></i>',this._eventBus.fire(tS),this._notifications.showNotification("Play Simulation","info"),this.isPaused=!1)},Mi.prototype.activate=function(){this.isActive=!0,or(this.paletteEntry).remove("disabled")},Mi.prototype.deactivate=function(){this.isActive=!1,or(this.paletteEntry).remove("active"),or(this.paletteEntry).add("disabled")},Mi.$inject=["eventBus","tokenSimulationPalette","notifications","canvas"];var oS=Mi,aS=J.TOGGLE_MODE_EVENT;function Sa(t,e,n){var i=this;this._elementRegistry=e,this._graphicsFactory=n,this.elementColors={},t.on(aS,5e4,function(r){r.simulationModeActive?i.preserveColors():i.resetColors()})}Sa.prototype.preserveColors=function(){var t=this;this._elementRegistry.forEach(function(e){t.elementColors[e.id]={stroke:e.businessObject.di.get("stroke"),fill:e.businessObject.di.get("fill")},t.setColor(e,"#000","#fff")})},Sa.prototype.resetColors=function(){var t=this;this._elementRegistry.forEach(function(e){t.elementColors[e.id]&&t.setColor(e,t.elementColors[e.id].stroke,t.elementColors[e.id].fill)}),this.elementColors={}},Sa.prototype.setColor=function(t,e,n){var i=t.businessObject;i.di.set("stroke",e),i.di.set("fill",n);var r=this._elementRegistry.getGraphics(t),o=t.waypoints?"connection":"shape";this._graphicsFactory.update(o,t,r)},Sa.$inject=["eventBus","elementRegistry","graphicsFactory"];var sS=Sa,cS=J.TOGGLE_MODE_EVENT,lS=J.RESET_SIMULATION_EVENT;function Cc(t){this.nextProcessInstanceId=1,t.on(cS,this.reset.bind(this)),t.on(lS,this.reset.bind(this))}Cc.prototype.getNext=function(){var t=this.nextProcessInstanceId;return this.nextProcessInstanceId++,t},Cc.prototype.reset=function(){this.nextProcessInstanceId=1},Cc.$inject=["eventBus"];var uS=Cc,pS=J.TOGGLE_MODE_EVENT,hS=J.PROCESS_INSTANCE_CREATED_EVENT,dS=J.PROCESS_INSTANCE_FINISHED_EVENT,mS=J.PROCESS_INSTANCE_SHOWN_EVENT,fS=J.PROCESS_INSTANCE_HIDDEN_EVENT;function Ca(t,e,n,i){var r=this;this._animation=t,this._eventBus=e,this._processInstances=n,this._elementRegistry=i,this._eventBus.on(hS,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(dS,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})}),e.on(pS,function(){i.forEach(function(o){delete o.shownProcessInstance})})}Ca.prototype.showProcessInstance=function(t,e){this._animation.showProcessInstanceAnimations(t),e.shownProcessInstance=t,this._eventBus.fire(mS,{processInstanceId:t})},Ca.prototype.hideProcessInstance=function(t){this._animation.hideProcessInstanceAnimations(t),this._eventBus.fire(fS,{processInstanceId:t})},Ca.prototype.showNext=function(t){var e=this,n=this._processInstances.getProcessInstances(t),i=t.shownProcessInstance,r=0;for(let o=0;o<n.length&&n[o].processInstanceId!==i;o++)r++;n.forEach(function(o){e.hideProcessInstance(o.processInstanceId)}),r===n.length-1?this.showProcessInstance(n[0].processInstanceId,t):this.showProcessInstance(n[r+1].processInstanceId,t)},Ca.$inject=["animation","eventBus","processInstances","elementRegistry"];var vS=Ca,yS=J.TOGGLE_MODE_EVENT,gS=J.RESET_SIMULATION_EVENT,bS=J.PROCESS_INSTANCE_CREATED_EVENT,xS=J.PROCESS_INSTANCE_FINISHED_EVENT;function ar(t,e){var n=this;this._eventBus=t,this._processInstanceIds=e,this.processInstances=[],t.on([yS,gS],function(){n.processInstances=[]})}ar.prototype.create=function(t,e){var n=this._processInstanceIds.getNext(),i={parent:t,processInstanceId:n,parentProcessInstanceId:e};return this.processInstances.push(i),this._eventBus.fire(bS,i),n},ar.prototype.remove=function(t){this.processInstances=this.processInstances.filter(function(e){return e.processInstanceId!==t})},ar.prototype.finish=function(t){var e=this.processInstances.find(function(n){return n.processInstanceId===t});this._eventBus.fire(xS,e),e.isFinished=!0},ar.prototype.getProcessInstances=function(t,e){if(!t)return this.processInstances;var n=this.processInstances.filter(function(i){return i.parent===t});return e&&e.includeFinished!==!0&&(n=n.filter(function(i){return!i.isFinished})),n},ar.prototype.getProcessInstance=function(t){return this.processInstances.find(function(e){return e.processInstanceId===t})},ar.$inject=["eventBus","processInstanceIds"];var ES=ar,_S=Me,ub=Pi,wS=fn,SS=Ft.is,CS=J.TOGGLE_MODE_EVENT,TS=J.GENERATE_TOKEN_EVENT,AS=J.RESET_SIMULATION_EVENT;function Tc(t,e,n,i){var r=this;this._eventBus=t,this._tokenSimulationPalette=e,this._notifications=n,this._elementRegistry=i,this._init(),t.on(TS,function(o){SS(o.element,"bpmn:StartEvent")&&ub(r.paletteEntry).remove("disabled")}),t.on(CS,function(o){o.simulationModeActive||r.resetSimulation()})}Tc.prototype._init=function(){var t=this;this.paletteEntry=_S('<div class="entry disabled" title="Reset Simulation"><i class="fa fa-refresh"></i></div>'),wS.bind(this.paletteEntry,"click",function(){t.resetSimulation(),t._notifications.showNotification("Reset Simulation","info")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,2)},Tc.prototype.resetSimulation=function(){ub(this.paletteEntry).add("disabled"),this._elementRegistry.forEach(function(t){t.tokenCount!==void 0&&delete t.tokenCount}),this._eventBus.fire(AS)},Tc.$inject=["eventBus","tokenSimulationPalette","notifications","elementRegistry"];var kS=Tc,PS=Me,Ac=Pi,lh=fn,kc=va,MS=J.TOGGLE_MODE_EVENT;function Pc(t,e,n){var i=this;this._canvas=t,this._animation=e,this._eventBus=n,this._init(),n.on(MS,function(r){r.simulationModeActive?Ac(i.container).remove("hidden"):Ac(i.container).add("hidden")})}Pc.prototype._init=function(){var t=this;this.container=PS('<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 e=kc("#animation-speed-1",this.container),n=kc("#animation-speed-2",this.container),i=kc("#animation-speed-3",this.container);lh.bind(e,"click",function(){t.setActive(e),t._animation.setAnimationSpeed(.5)}),lh.bind(n,"click",function(){t.setActive(n),t._animation.setAnimationSpeed(1)}),lh.bind(i,"click",function(){t.setActive(i),t._animation.setAnimationSpeed(1.5)}),this._canvas.getContainer().appendChild(this.container)},Pc.prototype.setActive=function(t){kc.all(".animation-speed-button",this.container).forEach(function(e){Ac(e).remove("active")}),Ac(t).add("active")},Pc.$inject=["canvas","animation","eventBus"];var RS=Pc,pb=Me,Yr=Pi,uh=fn,ph=va,NS=function(t){for(var e;t.childNodes.length;)e=t.childNodes[0],t.removeChild(e);return t},IS=J.TOGGLE_MODE_EVENT,DS=J.PROCESS_INSTANCE_CREATED_EVENT,BS=J.PROCESS_INSTANCE_FINISHED_EVENT,OS=J.PROCESS_INSTANCE_SHOWN_EVENT,LS=J.PROCESS_INSTANCE_HIDDEN_EVENT,jS=J.RESET_SIMULATION_EVENT,VS=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-silver-base-97"),FS=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44");function hb(t){return t===null}function vn(t,e,n,i,r,o){var a=this;this._eventBus=t,this._canvas=e,this._processInstanceSettings=n,this._processInstances=i,this._graphicsFactory=r,this._elementRegistry=o,this.highlightedElement=null,this._init(),t.on(IS,function(c){c.simulationModeActive?Yr(a.container).remove("hidden"):(Yr(a.container).add("hidden"),NS(a.container),hb(a.highlightedElement)||(a.removeHighlightFromProcess(a.highlightedElement.element),a.highlightedElement=null))}),t.on(DS,function(c){a.addInstance(c)}),t.on(BS,function(c){a.removeInstance(c)}),t.on(OS,function(c){a.setInstanceShown(c.processInstanceId)}),t.on(LS,function(c){a.setInstanceHidden(c.processInstanceId)}),t.on(jS,function(){a.removeAllInstances()})}vn.prototype._init=function(){this.container=pb('<div class="process-instances hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},vn.prototype.addInstance=function(t){var e=this,n=t.processInstanceId,i=t.parent,r=pb('<div id="instance-'+n+'" class="process-instance" title="View Process Instance '+n+'">'+n+"</div>");uh.bind(r,"click",function(){e._processInstances.getProcessInstances(i).forEach(function(o){e._processInstanceSettings.hideProcessInstance(o.processInstanceId)}),e._processInstanceSettings.showProcessInstance(n,i)}),uh.bind(r,"mouseenter",function(){e.highlightedElement={element:i,stroke:i.businessObject.di.get("stroke"),fill:i.businessObject.di.get("fill")},e.addHighlightToProcess(i)}),uh.bind(r,"mouseleave",function(){e.removeHighlightFromProcess(i),e.highlightedElement=null}),this.container.appendChild(r)},vn.prototype.removeInstance=function(t){var e=t.processInstanceId,n=ph("#instance-"+e,this.container);n&&n.remove()},vn.prototype.removeAllInstances=function(){this.container.innerHTML=""},vn.prototype.setInstanceShown=function(t){var e=ph("#instance-"+t,this.container);e&&Yr(e).add("active")},vn.prototype.setInstanceHidden=function(t){var e=ph("#instance-"+t,this.container);e&&Yr(e).remove("active")},vn.prototype.addHighlightToProcess=function(t){this.setColor(t,FS,VS),t.parent||Yr(this._canvas.getContainer()).add("highlight")},vn.prototype.removeHighlightFromProcess=function(t){hb(this.highlightedElement)||(this.setColor(t,this.highlightedElement.stroke,this.highlightedElement.fill),t.parent||Yr(this._canvas.getContainer()).remove("highlight"))},vn.prototype.setColor=function(t,e,n){var i=t.businessObject;i.di.set("stroke",e),i.di.set("fill",n);var r=this._elementRegistry.getGraphics(t);this._graphicsFactory.update("connection",t,r)},vn.$inject=["eventBus","canvas","processInstanceSettings","processInstances","graphicsFactory","elementRegistry"];var zS=vn,Mc=Ft,$S=Mc.getBusinessObject,Rc=Mc.is,GS=Mc.isAncestor,US=Mc.isTypedEvent,HS=J.CONSUME_TOKEN_EVENT;function Nc(t,e,n,i,r,o,a){this._animation=e,this._elementRegistry=n,this._log=i,this._elementNotifications=r,this._canvas=o,this._processInstances=a,t.on(HS,250,function(){})}Nc.prototype.isDeadlock=function(){var t=this,e=[];this._elementRegistry.forEach(function(r){r.tokenCount&&e.push(r)});var n=[],i=[];e.forEach(function(r){r.outgoing.filter(function(a){return Rc(a,"bpmn:SequenceFlow")}).length||n.push(r),Rc(r,"bpmn:ParallelGateway")&&r.incoming.filter(function(a){return Rc(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),US($S(l.target),"bpmn:TerminateEventDefinition")&&i.push(c),a(l.target))})})(r)}),e.length&&!i.length&&n.length&&!this._animation.animations.length&&(t._log.log("Deadlock","warning","fa-exclamation-triangle"),n.forEach(function(r){t._elementNotifications.addElementNotification(r,{type:"warning",icon:"fa-exclamation-triangle",text:"Deadlock"})}))},Nc.prototype.isFinished=function(t,e){var n=this._processInstances.getProcessInstance(e).parent,i=!1;n||(n=this._canvas.getRootElement()),n.children.forEach(function(o){o.tokenCount&&o.tokenCount[e]&&o.tokenCount[e].length&&(i=!0)});var r=!1;if(this._animation.animations.forEach(function(o){GS(n,o.element)&&o.processInstanceId===e&&(r=!0)}),!i&&!r)return Rc(n,"bpmn:SubProcess")?this._log.log("Subprocess "+e+" finished","info","fa-check-circle"):(this._log.log("Process "+e+" finished","success","fa-check-circle"),this._elementNotifications.addElementNotification(t,{type:"success",icon:"fa-check-circle",text:"Finished"})),!0},Nc.$inject=["eventBus","animation","elementRegistry","log","elementNotifications","canvas","processInstances"];var qS=Nc,WS=Me,Ic=Pi,XS=fn,KS=va,db=J.TOGGLE_MODE_EVENT;function Dc(t,e,n,i){var r=this;this._eventBus=t,this._canvas=e,this._selection=n,this._contextPad=i,this.simulationModeActive=!1,t.on("import.done",function(){r.canvasParent=r._canvas.getContainer().parentNode,r.palette=KS(".djs-palette",r._canvas.getContainer()),r._init()})}Dc.prototype._init=function(){this.container=WS(`
- <div class="toggle-mode">
- Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>
- </div>
- `),XS.bind(this.container,"click",this.toggleMode.bind(this)),this._canvas.getContainer().appendChild(this.container)},Dc.prototype.toggleMode=function(){if(this.simulationModeActive){this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>',Ic(this.canvasParent).remove("simulation"),Ic(this.palette).remove("hidden"),this._eventBus.fire(db,{simulationModeActive:!1});var t=this._selection.get();t.length===1&&this._contextPad.open(t[0])}else this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-on"></i></span>',Ic(this.canvasParent).add("simulation"),Ic(this.palette).add("hidden"),this._eventBus.fire(db,{simulationModeActive:!0});this.simulationModeActive=!this.simulationModeActive},Dc.$inject=["eventBus","canvas","selection","contextPad"];var YS=Dc,JS=Me,mb=Ft.isAncestor,ZS=J.TOGGLE_MODE_EVENT,QS=J.GENERATE_TOKEN_EVENT,tC=J.CONSUME_TOKEN_EVENT,eC=J.RESET_SIMULATION_EVENT,nC=J.TERMINATE_EVENT,iC=J.PROCESS_INSTANCE_SHOWN_EVENT;function sr(t,e,n,i,r){var o=this;this._overlays=e,this._elementRegistry=n,this._canvas=i,this._processInstances=r,this.overlayIds={},t.on(ZS,function(a){a.simulationModeActive||o.removeTokenCounts()}),t.on(eC,function(){o.removeTokenCounts()}),t.on(nC,function(a){var c=a.element.parent;o.removeTokenCounts(c)}),t.on([QS,tC],500,function(a){var c=a.element.parent;o.removeTokenCounts(c),o.addTokenCounts(c)}),t.on(iC,function(a){var c=a.processInstanceId,l=r.getProcessInstance(c).parent;o.removeTokenCounts(l),o.addTokenCounts(l)})}sr.prototype.addTokenCounts=function(t){var e=this;t||(t=this._canvas.getRootElement());var n=t.shownProcessInstance;if(!n){var i=this._processInstances.getProcessInstances(t);if(!i.length)return;n=i[0].processInstanceId}this._elementRegistry.forEach(function(r){mb(t,r)&&e.addTokenCount(r,n)})},sr.prototype.addTokenCount=function(t,e){var n=t.tokenCount&&t.tokenCount[e];if(n){var i=this.createTokenCount(n),r={bottom:10,left:-15},o=this._overlays.add(t,"token-count",{position:r,html:i,show:{minZoom:.5}});this.overlayIds[t.id]=o}},sr.prototype.createTokenCount=function(t){return JS('<div class="token-count waiting">'+t+"</div>")},sr.prototype.removeTokenCounts=function(t){var e=this;t||(t=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){mb(t,n)&&e.removeTokenCount(n)})},sr.prototype.removeTokenCount=function(t){var e=this.overlayIds[t.id];e&&(this._overlays.remove(e),delete this.overlayIds[t.id])},sr.$inject=["eventBus","overlays","elementRegistry","canvas","processInstances"];var rC=sr,Ta=Ft,oC=Ta.getBusinessObject,aC=Ta.is,sC=Ta.isAncestor,cC=Ta.getDescendants,lC=Ta.isTypedEvent,uC=J.GENERATE_TOKEN_EVENT,pC=J.TERMINATE_EVENT,hC=J.UPDATE_ELEMENTS_EVENT;function Bc(t,e,n,i,r,o){this._animation=t,this._eventBus=e,this._log=n,this._simulationState=i,this._elementRegistry=r,this._processInstances=o}Bc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId,i=lC(oC(e),"bpmn:TerminateEventDefinition"),r=aC(e.parent,"bpmn:SubProcess");i&&(this._eventBus.fire(pC,t),this._elementRegistry.forEach(function(c){sC(e.parent,c)&&c.tokenCount&&c.tokenCount[n]&&delete c.tokenCount[n]}),this._processInstances.finish(n));var o=this._simulationState.isFinished(e,n);if(o&&this._processInstances.finish(n),(o||i)&&r){var a=this._processInstances.getProcessInstance(n);this._eventBus.fire(uC,{element:e.parent,processInstanceId:a.parentProcessInstanceId})}this._eventBus.fire(hC,{elements:cC(this._elementRegistry.getAll(),e.parent)})},Bc.prototype.generate=function(t){},Bc.$inject=["animation","eventBus","log","simulationState","elementRegistry","processInstances"];var dC=Bc,mC=Ft.is,fC=J.UPDATE_ELEMENTS_EVENT;function Oc(t,e){this._eventBus=t,this._animation=e}Oc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId;e.tokenCount||(e.tokenCount={}),e.tokenCount[n]||(e.tokenCount[n]=0),e.tokenCount[n]++;var i=e.outgoing,r=[];i.forEach(function(o){var a=o.target;mC(a,"bpmn:IntermediateCatchEvent")&&r.push(a)}),this._eventBus.fire(fC,{elements:r})},Oc.prototype.generate=function(){},Oc.$inject=["eventBus","animation"];var vC=Oc,yC=J.CONSUME_TOKEN_EVENT,gC=J.GENERATE_TOKEN_EVENT;function Lc(t,e,n){this._eventBus=t,this._animation=e,this._elementRegistry=n}Lc.prototype.consume=function(t){var e=t.element;if(!e.sequenceFlow)throw new Error("no sequence flow configured for element "+e.id);this._eventBus.fire(gC,t)},Lc.prototype.generate=function(t){var e=t.element,n=t.processInstanceId;if(!e.sequenceFlow)throw new Error("no sequence flow configured for element "+e.id);var i=this,r=this._elementRegistry.get(e.sequenceFlow.id);this._animation.createAnimation(r,n,function(){i._eventBus.fire(yC,{element:r.target,processInstanceId:n})})},Lc.$inject=["eventBus","animation","elementRegistry"];var bC=Lc,fb=Ft.is,xC=J.CONSUME_TOKEN_EVENT,EC=J.UPDATE_ELEMENT_EVENT,_C=J.UPDATE_ELEMENTS_EVENT;function jc(t,e,n){this._animation=t,this._eventBus=e,this._elementRegistry=n}jc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId;e.tokenCount||(e.tokenCount={}),e.tokenCount[n]||(e.tokenCount[n]=0),e.tokenCount[n]++,this._eventBus.fire(EC,{element:e})},jc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(a){return fb(a,"bpmn:SequenceFlow")}).forEach(function(a){e._animation.createAnimation(a,i,function(){e._eventBus.fire(xC,{element:a.target,processInstanceId:i})})});var r=n.parent,o=this._elementRegistry.filter(function(a){return fb(a,"bpmn:IntermediateCatchEvent")&&a.parent===r});this._eventBus.fire(_C,{elements:o})},jc.$inject=["animation","eventBus","elementRegistry"];var wC=jc,SC=Ft.is,CC=J.CONSUME_TOKEN_EVENT,TC=J.GENERATE_TOKEN_EVENT;function Vc(t,e){this._animation=t,this._eventBus=e}Vc.prototype.consume=function(t){this._eventBus.fire(TC,{element:t})},Vc.prototype.generate=function(t){var e=this;t.outgoing.filter(function(n){return SC(n,"bpmn:SequenceFlow")}).forEach(function(n){e._animation.createAnimation(n,function(){e._eventBus.fire(CC,{element:n.target})})})},Vc.$inject=["animation","eventBus"];var AC=Vc,kC=Ft.is,PC=J.CONSUME_TOKEN_EVENT,MC=J.GENERATE_TOKEN_EVENT;function Fc(t,e){this._animation=t,this._eventBus=e}Fc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId;e.tokenCount||(e.tokenCount={}),e.tokenCount[n]||(e.tokenCount[n]=0),e.tokenCount[n]++,e.incoming.length===e.tokenCount[n]&&(this._eventBus.fire(MC,t),e.tokenCount[n]=0)},Fc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(r){return kC(r,"bpmn:SequenceFlow")}).forEach(function(r){e._animation.createAnimation(r,i,function(){e._eventBus.fire(PC,{element:r.target,processInstanceId:i})})})},Fc.$inject=["animation","eventBus"];var RC=Fc,hh=Ft.is,NC=J.CONSUME_TOKEN_EVENT,IC=J.UPDATE_ELEMENTS_EVENT;function zc(t,e,n,i){this._animation=t,this._eventBus=e,this._elementRegistry=n,this._processInstances=i}zc.prototype.consume=function(){},zc.prototype.generate=function(t){var e=this,n=t.element,i=t.parentProcessInstanceId,r=n.outgoing.filter(function(l){return hh(l,"bpmn:SequenceFlow")}),o=n.parent,a=this._processInstances.create(o,i);if(r.forEach(function(l){e._animation.createAnimation(l,a,function(){e._eventBus.fire(NC,{element:l.target,processInstanceId:a})})}),!hh(n.parent,"bpmn:SubProcess")){var c=this._elementRegistry.filter(function(l){return hh(l,"bpmn:StartEvent")});this._eventBus.fire(IC,{elements:c})}},zc.$inject=["animation","eventBus","elementRegistry","processInstances"];var DC=zc,vb=Ft.is,BC=J.CONSUME_TOKEN_EVENT,yb=J.GENERATE_TOKEN_EVENT,gb=J.UPDATE_ELEMENT_EVENT;function $c(t,e,n){this._animation=t,this._eventBus=e,this._log=n}$c.prototype.consume=function(t){var e=t.element,n=t.processInstanceId,i=e.children.filter(function(r){return vb(r,"bpmn:StartEvent")})[0];i?(this._log.log("Starting Subprocess","info","fa-sign-in"),this._eventBus.fire(yb,{element:i,parentProcessInstanceId:n})):(this._log.log("Skipping Subprocess","info","fa-angle-double-right"),this._eventBus.fire(yb,t)),this._eventBus.fire(gb,{element:e})},$c.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(r){return vb(r,"bpmn:SequenceFlow")}).forEach(function(r){e._animation.createAnimation(r,i,function(){e._eventBus.fire(BC,{element:r.target,processInstanceId:i})})}),this._eventBus.fire(gb,{element:n})},$c.$inject=["animation","eventBus","log"];var OC=$c,LC=Ft.is,jC=J.CONSUME_TOKEN_EVENT,VC=J.UPDATE_ELEMENT_EVENT;function Gc(t,e,n){this._animation=t,this._eventBus=e,this._elementRegistry=n}Gc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId;e.tokenCount||(e.tokenCount={}),e.tokenCount[n]||(e.tokenCount[n]=0),e.tokenCount[n]++,this._eventBus.fire(VC,{element:e})},Gc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(r){return LC(r,"bpmn:SequenceFlow")}).forEach(function(r){e._animation.createAnimation(r,i,function(){e._eventBus.fire(jC,{element:r.target,processInstanceId:i})})})},Gc.$inject=["animation","eventBus","elementRegistry"];var FC=Gc,zC=Ft.is,$C=J.CONSUME_TOKEN_EVENT,GC=J.GENERATE_TOKEN_EVENT;function Uc(t,e){this._animation=t,this._eventBus=e}Uc.prototype.consume=function(t){this._eventBus.fire(GC,t)},Uc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(r){return zC(r,"bpmn:SequenceFlow")}).forEach(function(r){e._animation.createAnimation(r,i,function(){e._eventBus.fire($C,{element:r.target,processInstanceId:i})})})},Uc.$inject=["animation","eventBus"];var UC=dC,HC=vC,qC=bC,WC=wC,XC=AC,KC=RC,YC=DC,JC=OC,ZC=FC,QC=Uc,tT=J.GENERATE_TOKEN_EVENT,eT=J.CONSUME_TOKEN_EVENT;function dh(t,e,n){var i=this;this._injector=n,this.handlers={},this.registerHandler("bpmn:EndEvent",UC),this.registerHandler("bpmn:EventBasedGateway",HC),this.registerHandler("bpmn:ExclusiveGateway",qC),this.registerHandler("bpmn:IntermediateCatchEvent",WC),this.registerHandler("bpmn:IntermediateThrowEvent",XC),this.registerHandler("bpmn:ParallelGateway",KC),this.registerHandler("bpmn:StartEvent",YC),this.registerHandler("bpmn:SubProcess",JC),this.registerHandler("bpmn:BoundaryEvent",ZC),this.registerHandler(["bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:Task","bpmn:UserTask"],QC),t.on(tT,function(r){var o=r.element;if(!i.handlers[o.type])throw new Error("no handler for type "+o.type);i.handlers[o.type].generate(r)}),t.on(eT,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)})}dh.prototype.registerHandler=function(t,e){var n=this,i=this._injector.instantiate(e);Array.isArray(t)||(t=[t]),t.forEach(function(r){n.handlers[r]=i})},dh.$inject=["eventBus","animation","injector"];var nT=dh;function bb(t,e,n,i,r,o){o.register({toggleTokenSimulation:function(){e.toggleMode()}}),o.register({togglePauseTokenSimulation:function(){n.toggle()}}),o.register({resetTokenSimulation:function(){r.resetSimulation()}}),o.register({toggleTokenSimulationLog:function(){i.toggle()}})}bb.$inject=["eventBus","toggleMode","pauseSimulation","log","resetSimulation","editorActions"];var iT=bb,rT=J.TOGGLE_MODE_EVENT;function xb(t,e){var n=e.get("editorActions",!1),i=e.get("keyboard",!1);if(i&&n){var r=!1;t.on("keyboard.init",function(){i.addListener(1e4,function(o){(function(a){Hc(["t","T"],a)?n.trigger("toggleTokenSimulation"):r&&(Hc(["l","L"],a)?n.trigger("toggleTokenSimulationLog"):Hc([" ","Spacebar"],a)?n.trigger("togglePauseTokenSimulation"):Hc(["r","R"],a)&&n.trigger("resetTokenSimulation"))})(o.keyEvent)})}),t.on(rT,function(o){var a=o.simulationModeActive;r=!!a})}}function Hc(t,e){return t.indexOf(e.key)>-1}xb.$inject=["eventBus","injector"];var oT=xb,aT=Me,Eb=Pi,sT=J.TOGGLE_MODE_EVENT;function qc(t,e){var n=this;this._canvas=e,this.entries=[],this._init(),t.on(sT,function(i){i.simulationModeActive?Eb(n.container).remove("hidden"):Eb(n.container).add("hidden")})}qc.prototype._init=function(){this.container=aT('<div class="token-simulation-palette hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},qc.prototype.addEntry=function(t,e){var n=0;this.entries.forEach(function(i){e>=i.index&&n++}),this.container.insertBefore(t,this.container.childNodes[n]),this.entries.push({entry:t,index:e})},qc.$inject=["eventBus","canvas"];const cT=ro({__init__:["animation","contextPads","disableModeling","elementNotifications","elementSupport","exclusiveGatewaySettings","log","notifications","pauseSimulation","preserveElementColors","processInstanceIds","processInstanceSettings","processInstances","resetSimulation","setAnimationSpeed","showProcessInstance","simulationState","toggleMode","tokenCount","tokenSimulationBehavior","tokenSimulationEditorActions","tokenSimulationKeyboardBindings","tokenSimulationPalette"],animation:["type",qw],contextPads:["type",S1],disableModeling:["type",T1],elementNotifications:["type",R1],elementSupport:["type",O1],exclusiveGatewaySettings:["type",F1],log:["type",X1],notifications:["type",Y1],pauseSimulation:["type",oS],preserveElementColors:["type",sS],processInstanceIds:["type",uS],processInstanceSettings:["type",vS],processInstances:["type",ES],resetSimulation:["type",kS],setAnimationSpeed:["type",RS],showProcessInstance:["type",zS],simulationState:["type",qS],toggleMode:["type",YS],tokenCount:["type",rC],tokenSimulationBehavior:["type",nT],tokenSimulationEditorActions:["type",iT],tokenSimulationKeyboardBindings:["type",oT],tokenSimulationPalette:["type",qc]}),lT={name:"Camunda",uri:"http://camunda.org/schema/1.0/bpmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity","bpmn:SignalEventDefinition"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","camunda:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"camunda:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["camunda:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","camunda:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","camunda:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike","camunda:ExecutionListener","camunda:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["camunda:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["camunda:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0},{name:"id",type:"String",isAttr:!0},{name:"eventDefinitions",type:"bpmn:TimerEventDefinition",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvents",isAttr:!0,type:"String"}]}],emumerations:[]},uT={name:"Activiti",uri:"http://activiti.org/bpmn",prefix:"activiti",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","activiti:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"activiti:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0},{name:"executionListener",isAbstract:!0,type:"Expression"}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"multiinstance_type",superClass:["Element"]},{name:"multiinstance_condition",superClass:["Element"]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"multiinstance_condition",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["activiti:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","activiti:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["activiti:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","activiti:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["activiti:ServiceTaskLike","activiti:ExecutionListener","activiti:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["activiti:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["activiti:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormProperty",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]}],emumerations:[]},pT={name:"Flowable",uri:"http://flowable.org/bpmn",prefix:"flowable",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","flowable:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"flowable:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"},{name:"formType",isAttr:!0,type:"String"},{name:"formReadOnly",isAttr:!0,type:"Boolean",default:!1},{name:"formInit",isAttr:!0,type:"Boolean",default:!0}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"}]},{name:"Assignee",supperClass:"Element",meta:{allowedIn:["*"]},properties:[{name:"label",type:"String",isAttr:!0},{name:"viewId",type:"Number",isAttr:!0}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["flowable:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","flowable:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Button",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"code",type:"String",isAttr:!0},{name:"isHide",type:"String",isAttr:!0},{name:"next",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"Assignee",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"condition",type:"String",isAttr:!0},{name:"operationType",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","flowable:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike","flowable:ExecutionListener","flowable:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"ChildField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["flowable:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["flowable:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0},{name:"children",type:"ChildField",isMany:!0},{name:"extensionElements",type:"bpmn:ExtensionElements",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]},{name:"Condition",superClass:["Element"],meta:{allowedIn:["bpmn:SequenceFlow"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"field",type:"String",isAttr:!0},{name:"compare",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"logic",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]}],emumerations:[]},mh=Object.prototype.toString,hT=Object.prototype.hasOwnProperty;Hh=function(t){return mh.call(t)==="[object Array]"};function _b(t){const e=mh.call(t);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"||e==="[object Proxy]"}function dT(t,e){return hT.call(t,e)}function mT(t,e){const n=function(r){return _b(r)?r:o=>o===r}(e);let i;return qh(t,function(r,o){if(n(r,o))return i=r,!1}),i}qh=function(t,e){let n,i;if(t===void 0)return;const r=Hh(t)?vT:fT;for(let o in t)if(dT(t,o)&&(n=t[o],i=e(n,r(o)),i===!1))return n};function Jr(t,e){return!!mT(t,e)}function fT(t){return t}function vT(t){return Number(t)}M0=function(t,...e){return Object.assign(t,...e)};const yT="*";function Zr(t){const e=this;t.on("moddleCopy.canCopyProperty",function(n){const i=n.property,r=n.parent;return e.canCopyProperty(i,r)})}function Qr(t,e){return t&&_b(t.$instanceOf)&&t.$instanceOf(e)}function wb(t,e){return Jr(e,function(n){return Qr(t,n)})}function yn(t,e){return e?Qr(t,e)?t:t.$parent?yn(t.$parent,e):void 0:t.$parent}Zr.$inject=["eventBus"],Zr.prototype.canCopyProperty=function(t,e){return n=t,!(mh.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(yT)!==-1}(a)?!0:Jr(a,function(c){return yn(r,c)})}(t,e))&&!(Qr(t,"camunda:InputOutput")&&!this.canHostInputOutput(e))&&!(wb(t,["camunda:Connector","camunda:Field"])&&!this.canHostConnector(e))&&!(Qr(t,"camunda:In")&&!this.canHostIn(e))&&void 0;var n},Zr.prototype.canHostInputOutput=function(t){if(yn(t,"camunda:Connector"))return!0;const e=yn(t,"bpmn:FlowNode");return!!e&&!wb(e,["bpmn:StartEvent","bpmn:Gateway","bpmn:BoundaryEvent"])&&!(Qr(e,"bpmn:SubProcess")&&e.get("triggeredByEvent"))},Zr.prototype.canHostConnector=function(t){return!Qr(yn(t,"camunda:ServiceTaskLike"),"bpmn:MessageEventDefinition")||yn(t,"bpmn:IntermediateThrowEvent")||yn(t,"bpmn:EndEvent")},Zr.prototype.canHostIn=function(t){return yn(t,"bpmn:CallActivity")?!0:!yn(t,"bpmn:SignalEventDefinition")||yn(t,"bpmn:IntermediateThrowEvent")||yn(t,"bpmn:EndEvent")};const gT={__init__:["camundaModdleExtension"],camundaModdleExtension:["type",Zr]},bT={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function fh(t,e){return t&&typeof t.$instanceOf=="function"&&t.$instanceOf(e)}function vh(t,e){return(n=t)&&n.length&&Jr(t,function(i){return fh(i,e)});var n}function yh(t,e,n){const i=e.name,r=bT[i.replace(/activiti:/,"")];return i===t&&function(o,a){return Jr(a,function(c){return fh(o,c)})}(n,r)}function gh(t){t.on("property.clone",function(e){const n=e.newElement,i=e.propertyDescriptor;this.canCloneProperty(n,i)},this)}gh.$inject=["eventBus"],gh.prototype.canCloneProperty=function(t,e){return yh("activiti:FailedJobRetryTimeCycle",e,t)?vh(t.eventDefinitions,"bpmn:TimerEventDefinition")||vh(t.eventDefinitions,"bpmn:SignalEventDefinition")||fh(t.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):yh("activiti:Connector",e,t)||yh("activiti:Field",e,t)?vh(t.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const xT={__init__:["ActivitiModdleExtension"],ActivitiModdleExtension:["type",gh]},ET={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function bh(t,e){return t&&typeof t.$instanceOf=="function"&&t.$instanceOf(e)}function xh(t,e){return(n=t)&&n.length&&Jr(t,function(i){return bh(i,e)});var n}function Eh(t,e,n){const i=e.name,r=ET[i.replace(/flowable:/,"")];return i===t&&function(o,a){return Jr(a,function(c){return bh(o,c)})}(n,r)}function _h(t){t.on("property.clone",function(e){const n=e.newElement,i=e.propertyDescriptor;this.canCloneProperty(n,i)},this)}_h.$inject=["eventBus"],_h.prototype.canCloneProperty=function(t,e){return Eh("flowable:FailedJobRetryTimeCycle",e,t)?xh(t.eventDefinitions,"bpmn:TimerEventDefinition")||xh(t.eventDefinitions,"bpmn:SignalEventDefinition")||bh(t.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):Eh("flowable:Connector",e,t)||Eh("flowable:Field",e,t)?xh(t.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const _T={__init__:["FlowableModdleExtension"],FlowableModdleExtension:["type",_h]};var Tt,Ri,wT=Object.defineProperty,Wc=Object.getOwnPropertySymbols,Sb=Object.prototype.hasOwnProperty,Cb=Object.prototype.propertyIsEnumerable,wh=(t,e,n)=>e in t?wT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Tb=(t,e)=>{for(var n in e||(e={}))Sb.call(e,n)&&wh(t,n,e[n]);if(Wc)for(var n of Wc(e))Cb.call(e,n)&&wh(t,n,e[n]);return t},Ni=(t,e,n)=>(wh(t,typeof e!="symbol"?e+"":e,n),n);function gn(t){return t==null}function Sh(t){return typeof t=="string"}(Ri=Tt||(Tt={})).Root="Root",Ri.Declaration="Declaration",Ri.Comment="Comment",Ri.DocumentType="DocumentType",Ri.Element="Element",Ri.Text="Text",Ri.Instruction="Instruction",Ri.CDATA="CDATA";var sn=class{constructor(t,e=null,n=null){Ni(this,"name"),Ni(this,"type"),Ni(this,"parent"),Ni(this,"children"),Ni(this,"attributes"),Ni(this,"value"),Ni(this,"selfClosing"),Ni(this,"prefix"),this.name="",this.type=t,this.parent=e,this.value=n,this.children=null,this.attributes={},this.selfClosing=!1,this.prefix=""}setName(t){return this.name=t,this}setType(t){return this.type=t,this}setParent(t){return this.parent=t,this}setChildren(t){return this.children=t&&Array.from(t),this}setAttributes(t){return this.attributes=Tb({},t),this}setValue(t){return this.value=t,this}setSelfClosing(t){return this.selfClosing=t,this}setPrefix(t){return this.prefix=t,this}addAttribute(t,e){return this.attributes[t]=e,this}removeAttribute(t){return delete this.attributes[t],this}addChild(t){return t===this||(this.children||(this.children=[]),this.children.push(t),t.parent!==this&&(t.parent=this)),this}removeChild(t){if(this.children&&this.children.length){const e=this.children.findIndex(n=>n===t);~e&&(this.children.splice(e,1),t.parent=null)}return this}toJsObject(){return{name:this.name||void 0,prefix:this.prefix||void 0,type:this.type,attributes:Object.keys(this.attributes).length?this.attributes:void 0,value:gn(this.value)?void 0:this.value,selfClosing:this.selfClosing||void 0,children:(this.type===Tt.Element||this.type===Tt.Root)&&this.children&&this.children.length?this.children.map(t=>t.toJSON()):void 0}}toXmlString(t=" ",e=`
- `,n=0){const i=t.repeat(n);let r="";switch(this.type){case Tt.Root:r+=this.children&&this.children.length?this.children.map(o=>o.toXmlString(t,e,n)).join(e):"";break;case Tt.Element:{if(!this.name)return"";const o=this.prefix?`${this.prefix}:${this.name}`:this.name;r+=`${i}<${o}`;const a=Ab(this.attributes||{});a&&(r+=` ${a}`),this.children&&this.children.length?r+=`>${e}${this.children.map(c=>c.toXmlString(t,e,n+1)).join(e)}${e}${i}</${o}>`:r+=this.selfClosing?" />":`></${o}>`;break}case Tt.CDATA:r+=`${i}<![CDATA[${gn(this.value)?"":this.value}]]>`;break;case Tt.Text:r+=gn(this.value)?"":`${i}${this.value}`;break;case Tt.DocumentType:r+=gn(this.value)?"":`${i}<!DOCTYPE ${this.value}>`;break;case Tt.Comment:r+=`${i}<!-- ${gn(this.value)?"":this.value+" "}-->`;break;case Tt.Declaration:if(r+=`${i}<?xml `,!this.attributes||gn(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)Sb.call(a,u)&&c.indexOf(u)<0&&(l[u]=a[u]);if(a!=null&&Wc)for(var u of Wc(a))c.indexOf(u)<0&&Cb.call(a,u)&&(l[u]=a[u]);return l})(this.attributes,["version"]);o&&(r+=Ab(o))}r+="?>";break;case Tt.Instruction:r+=gn(this.value)?"":`${i}<?${this.value}?>`}return r}toJSON(){return this.toJsObject()}toString(){return this.toXmlString("","")}};function Ab(t){return Object.keys(t).map(e=>{const n=t[e];return gn(n)?null:function(i){return typeof i=="boolean"}(n)?n?e:null:`${e}="${n}"`}).filter(Boolean).join(" ")}var kb=t=>t,Pb={ignoreAttributes:!1,parseNodeValue:!0,trimValues:!0,prefixInName:!1,valueProcessor:kb,attributeProcessor:kb},ST=Object.keys(Pb),cr="Tag is not closed.";function CT(t,e={}){const n=t.replace(/\r\n?/g,`
- `),i=function(l={}){const u=Tb({},l);return ST.forEach(p=>{gn(u[p])&&(u[p]=Pb[p])}),u}(e),r=n.length,o=new sn(Tt.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=to(n,">",l,`Element End ${cr}`);let d=n.substring(l+2,p),y="";if(!i.prefixInName){const f=d.indexOf(":");~f&&(y=d.substring(0,f),d=d.substring(f+1))}if(a.prefix!==y||a.name!==d)throw new Error("End Tag is incorrect.");if(c){const f=Ch(lr("",Tt.Text,c,i));f&&a.addChild(new sn(Tt.Text,a,f))}a=a.parent,c="",l=p}else if(n[l+1]==="?"){const p=to(n,"?>",l,`Processing Instruction ${cr}`),d=n.substring(l+2,p-1);if(a)if(d.startsWith("xml ")&&d.includes("version=")&&a.type===Tt.Root){const y=new sn(Tt.Declaration,a);y.attributes=Th(d.substr(4),Tt.Declaration,i),a.addChild(y)}else a.addChild(new sn(Tt.Instruction,a,lr("",Tt.Instruction,d,i)));l=p}else if(n.substr(l+1,3)==="!--"){const p=to(n,"-->",l,`Comment ${cr}`),d=n.substring(l+4,p-2);a&&a.addChild(new sn(Tt.Comment,a,lr("",Tt.Comment,d,i))),l=p}else if(n.substr(l+1,8)==="!DOCTYPE"){let p=to(n,">",l,`Document Type ${cr}`),d=n.substring(l+9,p);d.includes("[")&&(p=to(n,"]>",l,`Document Type ${cr}`),d=n.substring(l+9,p)),a&&a.addChild(new sn(Tt.DocumentType,a,lr("",Tt.DocumentType,d,i))),l=p}else if(n.substr(l+1,8)==="![CDATA["){const p=to(n,"]]>",l,`CDATA Section ${cr}`),d=n.substring(l+9,p-2);if(a&&c){const y=Ch(lr("",Tt.Text,c,i));y&&a.addChild(new sn(Tt.Text,a,y))}a.addChild(new sn(Tt.CDATA,a,lr("",Tt.CDATA,d,i))),c="",l=p}else{let p="",d="",y=l+1;for(;y<=r;){let b=n[y];if(p)b===p&&(p="");else if(b==='"'||b==="'")p=b;else if(b===" ")b=" ";else if(b===">")break;d+=b,y++}if(y>r)throw new Error(`Element ${cr}`);d=d.trim();const f=d.indexOf(" ");let v=d,g="";if(~f?(v=d.substr(0,f),d=d.substr(f+1)):d="",!i.prefixInName){const b=v.indexOf(":");~b&&(g=v.substring(0,b),v=v.substring(b+1))}if(a&&c){const b=Ch(lr("",Tt.Text,c,i));b&&a.addChild(new sn(Tt.Text,a,b))}if(d.length&&d.lastIndexOf("/")===d.length-1){v[v.length-1]==="/"?(v=v.substr(0,v.length-1),d=""):d=d.substr(0,d.length-1);const b=new sn(Tt.Element,a);b.name=v,b.selfClosing=!0,b.prefix=g,d&&!i.ignoreAttributes&&(b.attributes=Th(d,Tt.Element,i)),a.addChild(b)}else{const b=new sn(Tt.Element,a);d&&!i.ignoreAttributes&&(b.attributes=Th(d,Tt.Element,i)),b.name=v,b.prefix=g,a.addChild(b),a=b}c="",l=y}}return o}function to(t,e,n,i){const r=t.indexOf(e,n);if(!~r)throw new Error(i);return r+e.length-1}function lr(t,e,n,i){return n?(i.trimValues&&(n=n.trim()),Mb(i.valueProcessor(n,e,t),i.parseNodeValue)):null}function Mb(t,e){return e&&Sh(t)?(t=t.trim())==="true"||t!=="false"&&function(n){const i=parseFloat(n);return Number.isNaN(i)?n:i}(t):gn(t)?null:t}function Ch(t){return gn(t)?"":Sh(t)?t:String(t)}var TT=/[^\s=]+\s*(=\s*['"][\s\S]*?['"])?/g;function Th(t,e,n){const i=(t=t.replace(/\r?\n/g," ")).match(TT)||[],r={};for(let o=0;o<i.length;o++){const a=i[o];let[c,l]=a.split("=");c=c.trim(),Sh(l)?(l=l.substring(1,l.length-1),n.trimValues&&(l=l.trim()),r[c]=Mb(n.attributeProcessor(l,c,e),n.parseNodeValue)):r[c]=!0}return r}let Rb,Nb,Ib,Db,Bb,Ob,Lb,jb;Rb={class:"my-process-designer"},Nb={class:"my-process-designer__header",style:{"z-index":"999",display:"table-row-group"}},Ib={style:{color:"#409eff"}},Db=Vt("br",null,null,-1),Bb=Vt("br",null,null,-1),Ob=Vt("br",null,null,-1),Lb={class:"my-process-designer__container"},jb={class:"hljs"},Na=Re({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:t=>["default","medium","small","mini"].indexOf(t)!==-1},headerButtonType:{type:String,default:"primary",validator:t=>["default","primary","success","warning","danger","info"].indexOf(t)!==-1}},emits:["destroy","init-finished","save","commandStack-changed","input","change","canvas-viewbox-changed","element-click"],setup(t,{emit:e}){const n=W(),i=W(),r=e,o=t;rl("configGlobal",o);let a=null;const c=W(1),l=W(!1),u=W(!1),p=W(""),d=W("xml"),y=W(!1),f=W(!1),v=zh(()=>{const T=[];if(o.onlyCustomizeAddi)return Object.prototype.toString.call(o.additionalModel)=="[object Array]"?o.additionalModel||[]:[o.additionalModel];Object.prototype.toString.call(o.additionalModel)=="[object Array]"?T.push(...o.additionalModel):o.additionalModel&&T.push(o.additionalModel);const M={translate:["value",(I=o.translations||Rw,function($,P){return P=P||{},($=I[$]||$).replace(/{([^}]+)}/g,function(x,N){let j=P[N];return I[P[N]]!==null&&I[P[N]]!==void 0&&(j=I[P[N]]),j||"{"+N+"}"})})]};var I;return T.push(M),o.simulation&&T.push(cT),o.prefix==="camunda"&&T.push(gT),o.prefix==="flowable"&&T.push(_T),o.prefix==="activiti"&&T.push(xT),T}),g=zh(()=>{const T={};if(o.onlyCustomizeModdle)return o.moddleExtension||null;if(o.moddleExtension)for(let M in o.moddleExtension)T[M]=o.moddleExtension[M];return o.prefix==="activiti"&&(T.activiti=uT),o.prefix==="flowable"&&(T.flowable=pT),o.prefix==="camunda"&&(T.camunda=lT),T}),b=()=>{const T=a.get("eventBus");o.events.forEach(M=>{T.on(M,function(I){M.replace(/\./g,"-");let $=I?I.element:null;r("element-click",$,I)})}),T.on("commandStack.changed",async M=>{try{y.value=a.get("commandStack").canRedo(),f.value=a.get("commandStack").canUndo();let{xml:I}=await a.saveXML({format:!0});r("commandStack-changed",M),r("input",I),r("change",I)}catch{}}),a.on("canvas.viewbox.changed",({viewbox:M})=>{r("canvas-viewbox-changed",{viewbox:M});const{scale:I}=M;c.value=Math.floor(100*I)/100})},S=async T=>{let M=o.processId||`Process_${new Date().getTime()}`,I=o.processName||`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,$=T||Vg(M,I,o.prefix);try{let{warnings:P}=await a.importXML($);P&&P.length&&P.forEach(x=>{})}catch{}},w=async T=>{try{if(T==="xml"||T==="bpmn"){const{err:I,xml:$}=await a.saveXML();let{href:P,filename:x}=_(T.toUpperCase(),$);M(P,x)}else{const{err:I,svg:$}=await a.saveSVG();if(I)return;let{href:P,filename:x}=_("SVG",$);M(P,x)}}catch{}function M(I,$){if(I&&$){let P=document.createElement("a");P.download=$,P.href=I,P.click(),URL.revokeObjectURL(P.href)}}},_=(T,M)=>({filename:`diagram.${T}`,href:`data:application/${T==="svg"?"text/xml":"bpmn20-xml"};charset=UTF-8,${encodeURIComponent(M)}`,data:M}),C=()=>{const T=i.value.files[0],M=new FileReader;M.readAsText(T),M.onload=function(){let I=this.result;S(I)}},B=()=>{u.value=!u.value,o.simulation&&a.get("toggleMode","strict").toggleMode()},s=T=>{const M=a.get("alignElements"),I=a.get("selection").get();!I||I.length<=1?yA.warning("\u8BF7\u6309\u4F4F Shift \u952E\u9009\u62E9\u591A\u4E2A\u5143\u7D20\u5BF9\u9F50"):oo.confirm("\u81EA\u52A8\u5BF9\u9F50\u53EF\u80FD\u9020\u6210\u56FE\u5F62\u53D8\u5F62\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F","\u8B66\u544A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{M.trigger(I,T)})},h=()=>{a.saveXML({format:!0}).then(({xml:T})=>{p.value=T,d.value="xml",l.value=!0})},m=()=>{a.saveXML({format:!0}).then(({xml:T})=>{var I;const M=new sn(Tt.Root,CT(T));p.value=(I=M.parent)==null?void 0:I.toJSON(),d.value="json",l.value=!0})},E=async()=>{const{err:T,xml:M}=await a.saveXML();T?alert("\u4FDD\u5B58\u6A21\u578B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01"):r("save",M)};return mA(()=>{}),Pa(()=>{(()=>{if(a)return;let T=document.getElementById("bpmnCanvas");a=new On({container:T,keyboard:o.keyboard?{bindTo:document}:null,additionalModules:v.value,moddleExtensions:g.value}),r("init-finished",a),b()})(),S(o.value)}),Ln(()=>{a&&a.destroy(),r("destroy",a),a=null}),(T,M)=>{const I=po,$=AA,P=gA,x=bA,N=ao,j=pA,G=fA("highlight");return nt(),Dt("div",Rb,[Vt("div",Nb,[vA(T.$slots,"control-header"),T.$slots["control-header"]?kt("",!0):(nt(),Dt(cn,{key:0},[R(x,{key:"file-control"},{default:V(()=>[R(I,{preIcon:"ep:folder-opened",title:"\u6253\u5F00\u6587\u4EF6",onClick:M[0]||(M[0]=X=>D(i).click())}),R(P,{effect:"light",placement:"bottom"},{content:V(()=>[Vt("div",Ib,[R($,{title:"\u4E0B\u8F7D\u4E3AXML\u6587\u4EF6",onClick:M[1]||(M[1]=X=>{w("xml")})}),Db,R($,{title:"\u4E0B\u8F7D\u4E3ASVG\u6587\u4EF6",onClick:M[2]||(M[2]=X=>{w("svg")})}),Bb,R($,{title:"\u4E0B\u8F7D\u4E3ABPMN\u6587\u4EF6",onClick:M[3]||(M[3]=X=>{w("bpmn")})})])]),default:V(()=>[R(I,{title:"\u4E0B\u8F7D\u6587\u4EF6",preIcon:"ep:download"})]),_:1}),R(P,{effect:"light"},{content:V(()=>[R($,{title:"\u9884\u89C8XML",onClick:h}),Ob,R($,{title:"\u9884\u89C8JSON",onClick:m})]),default:V(()=>[R(I,{preIcon:"ep:view",title:"\u6D4F\u89C8"})]),_:1}),o.simulation?(nt(),Ct(P,{key:0,effect:"light",content:D(u)?"\u9000\u51FA\u6A21\u62DF":"\u5F00\u542F\u6A21\u62DF"},{default:V(()=>[R(I,{preIcon:"ep:cpu",title:"\u6A21\u62DF",onClick:B})]),_:1},8,["content"])):kt("",!0)]),_:1}),R(x,{key:"align-control"},{default:V(()=>[R(P,{effect:"light",content:"\u5411\u5DE6\u5BF9\u9F50"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-bottom",onClick:M[4]||(M[4]=X=>s("left"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u53F3\u5BF9\u9F50"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-top",onClick:M[5]||(M[5]=X=>s("right"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u4E0A\u5BF9\u9F50"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-left",onClick:M[6]||(M[6]=X=>s("top"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u4E0B\u5BF9\u9F50"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-right",onClick:M[7]||(M[7]=X=>s("bottom"))})]),_:1}),R(P,{effect:"light",content:"\u6C34\u5E73\u5C45\u4E2D"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-center",onClick:M[8]||(M[8]=X=>s("center"))})]),_:1}),R(P,{effect:"light",content:"\u5782\u76F4\u5C45\u4E2D"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-middle",onClick:M[9]||(M[9]=X=>s("middle"))})]),_:1})]),_:1}),R(x,{key:"scale-control"},{default:V(()=>[R(P,{effect:"light",content:"\u7F29\u5C0F\u89C6\u56FE"},{default:V(()=>[R(I,{preIcon:"ep:zoom-out",onClick:M[10]||(M[10]=X=>((tt=.1)=>{let rt=Math.floor(100*c.value-100*tt)/100;if(rt<.2)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");c.value=rt,a.get("canvas").zoom(c.value)})()),disabled:D(c)<.2},null,8,["disabled"])]),_:1}),R(N,null,{default:V(()=>[mt(w0(Math.floor(10*D(c)*10)+"%"),1)]),_:1}),R(P,{effect:"light",content:"\u653E\u5927\u89C6\u56FE"},{default:V(()=>[R(I,{preIcon:"ep:zoom-in",onClick:M[11]||(M[11]=X=>((tt=.1)=>{let rt=Math.floor(100*c.value+100*tt)/100;if(rt>4)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");c.value=rt,a.get("canvas").zoom(c.value)})()),disabled:D(c)>4},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u91CD\u7F6E\u89C6\u56FE\u5E76\u5C45\u4E2D"},{default:V(()=>[R(I,{preIcon:"ep:scale-to-original",onClick:M[12]||(M[12]=X=>(c.value=1,void a.get("canvas").zoom("fit-viewport","auto")))})]),_:1})]),_:1}),R(x,{key:"stack-control"},{default:V(()=>[R(P,{effect:"light",content:"\u64A4\u9500"},{default:V(()=>[R(I,{preIcon:"ep:refresh-left",onClick:M[13]||(M[13]=X=>{a.get("commandStack").undo()}),disabled:!D(f)},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u6062\u590D"},{default:V(()=>[R(I,{preIcon:"ep:refresh-right",onClick:M[14]||(M[14]=X=>{a.get("commandStack").redo()}),disabled:!D(y)},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u91CD\u65B0\u7ED8\u5236"},{default:V(()=>[R(I,{preIcon:"ep:refresh",onClick:M[15]||(M[15]=X=>(y.value=!1,f.value=!1,void S(null)))})]),_:1})]),_:1}),R(I,{preIcon:"ep:plus",title:"\u4FDD\u5B58\u6A21\u578B",onClick:E,type:o.headerButtonType,disabled:D(u)},null,8,["type","disabled"])],64)),Vt("input",{type:"file",id:"files",ref_key:"refFile",ref:i,style:{display:"none"},accept:".xml, .bpmn",onChange:C},null,544)]),Vt("div",Lb,[Vt("div",{class:"my-process-designer__canvas",ref_key:"bpmnCanvas",ref:n,id:"bpmnCanvas",style:{width:"1680px",height:"800px"}},null,512)]),R(j,{title:"\u9884\u89C8",modelValue:D(l),"onUpdate:modelValue":M[16]||(M[16]=X=>ln(l)?l.value=X:null),width:"80%",scroll:!0,"max-height":"600px"},{default:V(()=>[ol((nt(),Dt("div",null,[Vt("code",jb,w0(D(p)),1)])),[[G]])]),_:1},8,["modelValue"])])}}}),Na.install=function(t){t.component(Na.name,Na)};const AT={class:"panel-tab__content"},kT={key:0},PT={key:1},MT=Re({name:"ElementBaseInfo",__name:"ElementBaseInfo",props:{businessObject:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}}},setup(t){const e=t,n=W({}),i=W(),r=W({}),o=xA({id:[{required:!0,message:"\u6D41\u7A0B\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],name:[{required:!0,message:"\u6D41\u7A0B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),a=()=>window==null?void 0:window.bpmnInstances,c=p=>{p&&p.match(/[a-zA-Z_][\-_.0-9a-zA-Z$]*/)&&(r.value.id=p,setTimeout(()=>{u("id")},100))},l=p=>{p&&(r.value.name=p,setTimeout(()=>{u("name")},100))},u=p=>{const d=Object.create(null);d[p]=r.value[p],n.value={...r.value,...n.value},p==="id"?a().modeling.updateProperties(Lt(i.value),{id:r.value[p],di:{id:`${r.value[p]}_di`}}):a().modeling.updateProperties(Lt(i.value),d)};return Pa(()=>{setTimeout(()=>{c(e.model.key),l(e.model.name)},1e3)}),me(()=>e.businessObject,p=>{var d;p&&(i.value=(d=a())==null?void 0:d.bpmnElement,r.value=i.value.businessObject,n.value.type=i.value.businessObject.$type)}),Ln(()=>{i.value=null}),(p,d)=>{const y=Uh,f=_n,v=wn,g=ri;return nt(),Dt("div",AT,[R(g,{"label-width":"90px",model:D(n),rules:D(o)},{default:V(()=>[D(n).type=="bpmn:Process"?(nt(),Dt("div",kT,[R(y,{href:"https://doc.iocoder.cn/bpm/#_3-%E6%B5%81%E7%A8%8B%E5%9B%BE%E7%A4%BA%E4%BE%8B",type:"danger",target:"_blank"},{default:V(()=>[mt(" \u5982\u4F55\u5B9E\u73B0\u5B9E\u73B0\u4F1A\u7B7E\u3001\u6216\u7B7E\uFF1F ")]),_:1}),R(v,{label:"\u6D41\u7A0B\u6807\u8BC6",prop:"id"},{default:V(()=>[R(f,{modelValue:D(n).id,"onUpdate:modelValue":d[0]||(d[0]=b=>D(n).id=b),placeholder:"\u8BF7\u8F93\u5165\u6D41\u6807\u6807\u8BC6",disabled:D(n).id!==void 0&&D(n).id.length>0,onChange:c},null,8,["modelValue","disabled"])]),_:1}),R(v,{label:"\u6D41\u7A0B\u540D\u79F0",prop:"name"},{default:V(()=>[R(f,{modelValue:D(n).name,"onUpdate:modelValue":d[1]||(d[1]=b=>D(n).name=b),placeholder:"\u8BF7\u8F93\u5165\u6D41\u7A0B\u540D\u79F0",clearable:"",onChange:l},null,8,["modelValue"])]),_:1})])):(nt(),Dt("div",PT,[R(v,{label:"ID"},{default:V(()=>[R(f,{modelValue:D(r).id,"onUpdate:modelValue":d[2]||(d[2]=b=>D(r).id=b),clearable:"",onChange:d[3]||(d[3]=b=>u("id"))},null,8,["modelValue"])]),_:1}),R(v,{label:"\u540D\u79F0"},{default:V(()=>[R(f,{modelValue:D(r).name,"onUpdate:modelValue":d[4]||(d[4]=b=>D(r).name=b),clearable:"",onChange:d[5]||(d[5]=b=>u("name"))},null,8,["modelValue"])]),_:1})]))]),_:1},8,["model","rules"])])}}}),RT={class:"panel-tab__content"},NT={class:"element-property input-property"},IT=Vt("div",{class:"element-property__label"},"\u5143\u7D20\u6587\u6863\uFF1A",-1),DT={class:"element-property__value"},BT=Re({name:"ElementOtherConfig",__name:"ElementOtherConfig",props:{id:String},setup(t){const e=t,n=W(""),i=W(),r=()=>window.bpmnInstances,o=()=>{i.value&&i.value.id===e.id||(i.value=r().elementRegistry.get(e.id));const a=r().bpmnFactory.create("bpmn:Documentation",{text:n.value});r().modeling.updateProperties(Lt(i.value),{documentation:[a]})};return Ln(()=>{i.value=null}),me(()=>e.id,a=>{a&&a.length?Fe(()=>{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=_n;return nt(),Dt("div",RT,[Vt("div",NT,[IT,Vt("div",DT,[R(l,{type:"textarea",modelValue:D(n),"onUpdate:modelValue":c[0]||(c[0]=u=>ln(n)?n.value=u:null),resize:"vertical",autosize:{minRows:2,maxRows:4},onInput:o,onBlur:o},null,8,["modelValue"])])])])}}}),OT={style:{"margin-top":"16px"}},LT=Re({name:"UserTask",__name:"UserTask",props:{id:String,type:String},setup(t){const e=t,n=W({assignee:"",candidateUsers:[],candidateGroups:[],dueDate:"",followUpDate:"",priority:""}),i=W({}),r=W(),o=()=>window==null?void 0:window.bpmnInstances,a=c=>{const l=Object.create(null);l[c]=c==="candidateUsers"||c==="candidateGroups"?i.value[c]&&i.value[c].length?i.value[c].join():null:i.value[c]||null,o().modeling.updateProperties(Lt(r.value),l)};return me(()=>e.id,()=>{r.value=o().bpmnElement,Fe(()=>{(()=>{var c,l;for(let u in n.value){let p;p=u==="candidateUsers"||u==="candidateGroups"?(c=r.value)!=null&&c.businessObject[u]?r.value.businessObject[u].split(","):[]:((l=r.value)==null?void 0:l.businessObject[u])||n.value[u],i.value[u]=p}})()})},{immediate:!0}),Ln(()=>{r.value=null}),(c,l)=>{const u=_n,p=wn,d=Uh,y=S0("router-link");return nt(),Dt("div",OT,[R(p,{label:"\u5230\u671F\u65F6\u95F4"},{default:V(()=>[R(u,{modelValue:D(i).dueDate,"onUpdate:modelValue":l[0]||(l[0]=f=>D(i).dueDate=f),clearable:"",onChange:l[1]||(l[1]=f=>a("dueDate"))},null,8,["modelValue"])]),_:1}),R(p,{label:"\u8DDF\u8E2A\u65F6\u95F4"},{default:V(()=>[R(u,{modelValue:D(i).followUpDate,"onUpdate:modelValue":l[2]||(l[2]=f=>D(i).followUpDate=f),clearable:"",onChange:l[3]||(l[3]=f=>a("followUpDate"))},null,8,["modelValue"])]),_:1}),R(p,{label:"\u4F18\u5148\u7EA7"},{default:V(()=>[R(u,{modelValue:D(i).priority,"onUpdate:modelValue":l[4]||(l[4]=f=>D(i).priority=f),clearable:"",onChange:l[5]||(l[5]=f=>a("priority"))},null,8,["modelValue"])]),_:1}),mt(" \u53CB\u60C5\u63D0\u793A\uFF1A\u4EFB\u52A1\u7684\u5206\u914D\u89C4\u5219\uFF0C\u4F7F\u7528 "),R(y,{target:"_blank",to:{path:"/bpm/manager/model"}},{default:V(()=>[R(d,{type:"danger"},{default:V(()=>[mt("\u6D41\u7A0B\u6A21\u578B")]),_:1})]),_:1}),mt(" \u4E0B\u7684\u3010\u5206\u914D\u89C4\u5219\u3011\u66FF\u4EE3\uFF0C\u63D0\u4F9B\u6307\u5B9A\u89D2\u8272\u3001\u90E8\u95E8\u8D1F\u8D23\u4EBA\u3001\u90E8\u95E8\u6210\u5458\u3001\u5C97\u4F4D\u3001\u5DE5\u4F5C\u7EC4\u3001\u81EA\u5B9A\u4E49\u811A\u672C\u7B49 7 \u79CD\u7EF4\u62A4\u7684\u4EFB\u52A1\u5206\u914D\u7EF4\u5EA6\uFF0C\u66F4\u52A0\u7075\u6D3B\uFF01 ")])}}}),jT={style:{"margin-top":"16px"}},VT=Re({name:"ScriptTask",__name:"ScriptTask",props:{id:String,type:String},setup(t){const e=t,n=W({scriptFormat:"",script:"",resource:"",resultVariable:""}),i=W({}),r=W(),o=()=>window==null?void 0:window.bpmnInstances,a=()=>{let c=Object.create(null);c.scriptFormat=i.value.scriptFormat||null,c.resultVariable=i.value.resultVariable||null,i.value.scriptType==="inline"?(c.script=i.value.script||null,c.resource=null):(c.resource=i.value.resource||null,c.script=null),o().modeling.updateProperties(Lt(r.value),c)};return Ln(()=>{r.value=null}),me(()=>e.id,()=>{r.value=o().bpmnElement,Fe(()=>{(()=>{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=_n,p=wn,d=so,y=co;return nt(),Dt("div",jT,[R(p,{label:"\u811A\u672C\u683C\u5F0F"},{default:V(()=>[R(u,{modelValue:D(i).scriptFormat,"onUpdate:modelValue":l[0]||(l[0]=f=>D(i).scriptFormat=f),clearable:"",onInput:l[1]||(l[1]=f=>a()),onChange:l[2]||(l[2]=f=>a())},null,8,["modelValue"])]),_:1}),R(p,{label:"\u811A\u672C\u7C7B\u578B"},{default:V(()=>[R(y,{modelValue:D(i).scriptType,"onUpdate:modelValue":l[3]||(l[3]=f=>D(i).scriptType=f)},{default:V(()=>[R(d,{label:"\u5185\u8054\u811A\u672C",value:"inline"}),R(d,{label:"\u5916\u90E8\u8D44\u6E90",value:"external"})]),_:1},8,["modelValue"])]),_:1}),ol(R(p,{label:"\u811A\u672C"},{default:V(()=>[R(u,{modelValue:D(i).script,"onUpdate:modelValue":l[4]||(l[4]=f=>D(i).script=f),type:"textarea",resize:"vertical",autosize:{minRows:2,maxRows:4},clearable:"",onInput:l[5]||(l[5]=f=>a()),onChange:l[6]||(l[6]=f=>a())},null,8,["modelValue"])]),_:1},512),[[$h,D(i).scriptType==="inline"]]),ol(R(p,{label:"\u8D44\u6E90\u5730\u5740"},{default:V(()=>[R(u,{modelValue:D(i).resource,"onUpdate:modelValue":l[7]||(l[7]=f=>D(i).resource=f),clearable:"",onInput:l[8]||(l[8]=f=>a()),onChange:l[9]||(l[9]=f=>a())},null,8,["modelValue"])]),_:1},512),[[$h,D(i).scriptType==="external"]]),R(p,{label:"\u7ED3\u679C\u53D8\u91CF"},{default:V(()=>[R(u,{modelValue:D(i).resultVariable,"onUpdate:modelValue":l[10]||(l[10]=f=>D(i).resultVariable=f),clearable:"",onInput:l[11]||(l[11]=f=>a()),onChange:l[12]||(l[12]=f=>a())},null,8,["modelValue"])]),_:1})])}}}),FT={style:{"margin-top":"16px"}},zT={style:{display:"flex","align-items":"center","justify-content":"space-between","flex-wrap":"nowrap"}},$T=Re({name:"ReceiveTask",__name:"ReceiveTask",props:{id:String,type:String},setup(t){const e=t,n=T0(),i=W(""),r=W({}),o=W({}),a=W(!1),c=W(),l=W(),u=W(),p=()=>window.bpmnInstances,d=()=>{a.value=!0,r.value={}},y=()=>{if(o.value[r.value.id])return void n.error("\u8BE5\u6D88\u606F\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const v=p().moddle.create("bpmn:Message",r.value);u.value.push(v),o.value[r.value.id]=r.value.name,l.value[r.value.id]=v,a.value=!1},f=v=>{v==="-1"?p().modeling.updateProperties(Lt(c.value),{messageRef:null}):p().modeling.updateProperties(Lt(c.value),{messageRef:l.value[v]})};return Pa(()=>{l.value=Object.create(null),u.value=p().modeler.getDefinitions().rootElements,u.value.filter(v=>v.$type==="bpmn:Message").forEach(v=>{l.value[v.id]=v,o.value[v.id]=v.name}),o.value[-1]="\u65E0"}),Ln(()=>{c.value=null}),me(()=>e.id,()=>{Fe(()=>{var v,g;c.value=p().bpmnElement,i.value=((g=(v=c.value.businessObject)==null?void 0:v.messageRef)==null?void 0:g.id)||"-1"})},{immediate:!0}),(v,g)=>{const b=so,S=co,w=po,_=wn,C=_n,B=ri,s=ao,h=Ma;return nt(),Dt("div",FT,[R(_,{label:"\u6D88\u606F\u5B9E\u4F8B"},{default:V(()=>[Vt("div",zT,[R(S,{modelValue:D(i),"onUpdate:modelValue":g[0]||(g[0]=m=>ln(i)?i.value=m:null),onChange:f},{default:V(()=>[(nt(!0),Dt(cn,null,lo(Object.keys(D(o)),m=>(nt(),Ct(b,{value:m,label:D(o)[m],key:m},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),R(w,{type:"primary",preIcon:"ep:plus",style:{"margin-left":"8px"},onClick:d})])]),_:1}),R(h,{modelValue:D(a),"onUpdate:modelValue":g[3]||(g[3]=m=>ln(a)?a.value=m:null),"close-on-click-modal":!1,title:"\u521B\u5EFA\u65B0\u6D88\u606F",width:"400px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(s,{size:"small",type:"primary",onClick:y},{default:V(()=>[mt("\u786E \u8BA4")]),_:1})]),default:V(()=>[R(B,{model:D(r),size:"small","label-width":"90px"},{default:V(()=>[R(_,{label:"\u6D88\u606FID"},{default:V(()=>[R(C,{modelValue:D(r).id,"onUpdate:modelValue":g[1]||(g[1]=m=>D(r).id=m),clearable:""},null,8,["modelValue"])]),_:1}),R(_,{label:"\u6D88\u606F\u540D\u79F0"},{default:V(()=>[R(C,{modelValue:D(r).name,"onUpdate:modelValue":g[2]||(g[2]=m=>D(r).name=m),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),GT={class:"panel-tab__content"},UT=Re({name:"ElementTaskConfig",__name:"ElementTask",props:{id:String,type:String},setup(t){const e=t,n=W({asyncAfter:!1,asyncBefore:!1,exclusive:!1}),i=W(),r=W({UserTask:"UserTask",ScriptTask:"ScriptTask",ReceiveTask:"ReceiveTask"}),o=W(),a=()=>window.bpmnInstances,c=()=>{n.value.asyncBefore||n.value.asyncAfter||(n.value.exclusive=!1),a().modeling.updateProperties(a().bpmnElement,{...n.value})};return me(()=>e.id,()=>{var l,u,p,d,y,f;o.value=a().bpmnElement,n.value.asyncBefore=(u=(l=o.value)==null?void 0:l.businessObject)==null?void 0:u.asyncBefore,n.value.asyncAfter=(d=(p=o.value)==null?void 0:p.businessObject)==null?void 0:d.asyncAfter,n.value.exclusive=(f=(y=o.value)==null?void 0:y.businessObject)==null?void 0:f.exclusive},{immediate:!0}),me(()=>e.type,()=>{e.type==r.value.UserTask&&(i.value=LT),e.type==r.value.ScriptTask&&(i.value=VT),e.type==r.value.ReceiveTask&&(i.value=$T)},{immediate:!0}),(l,u)=>{const p=C0,d=wn,y=ri;return nt(),Dt("div",GT,[R(y,{size:"small","label-width":"90px"},{default:V(()=>[R(d,{label:"\u5F02\u6B65\u5EF6\u7EED"},{default:V(()=>[R(p,{modelValue:D(n).asyncBefore,"onUpdate:modelValue":u[0]||(u[0]=f=>D(n).asyncBefore=f),label:"\u5F02\u6B65\u524D",onChange:c},null,8,["modelValue"]),R(p,{modelValue:D(n).asyncAfter,"onUpdate:modelValue":u[1]||(u[1]=f=>D(n).asyncAfter=f),label:"\u5F02\u6B65\u540E",onChange:c},null,8,["modelValue"]),D(n).asyncAfter||D(n).asyncBefore?(nt(),Ct(p,{key:0,modelValue:D(n).exclusive,"onUpdate:modelValue":u[2]||(u[2]=f=>D(n).exclusive=f),label:"\u6392\u9664",onChange:c},null,8,["modelValue"])):kt("",!0)]),_:1}),(nt(),Ct(wA(D(i)),EA(_A(l.$props)),null,16))]),_:1})])}}}),HT={class:"panel-tab__content"},qT=Re({name:"ElementMultiInstance",__name:"ElementMultiInstance",props:{businessObject:Object,type:String},setup(t){const e=t,n=uo("prefix"),i=W(""),r=W({completionCondition:"",loopCardinality:"",extensionElements:[],asyncAfter:!1,asyncBefore:!1,exclusive:!1}),o=W({}),a=W(null),c=W(null),l=()=>window==null?void 0:window.bpmnInstances,u=g=>{if(g!=="Null"){if(g==="StandardLoop"){const b=l().moddle.create("bpmn:StandardLoopCharacteristics");return l().modeling.updateProperties(Lt(a.value),{loopCharacteristics:b}),void(c.value=null)}c.value=g==="SequentialMultiInstance"?l().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{isSequential:!0}):l().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{collection:"${coll_userList}"}),l().modeling.updateProperties(Lt(a.value),{loopCharacteristics:Lt(c.value)})}else l().modeling.updateProperties(Lt(a.value),{loopCharacteristics:null})},p=g=>{let b=null;g&&g.length&&(b=l().moddle.create("bpmn:FormalExpression",{body:g})),l().modeling.updateModdleProperties(Lt(a.value),c.value,{loopCardinality:b})},d=g=>{let b=null;g&&g.length&&(b=l().moddle.create("bpmn:FormalExpression",{body:g})),l().modeling.updateModdleProperties(Lt(a.value),c.value,{completionCondition:b})},y=g=>{const b=l().moddle.create("bpmn:ExtensionElements",{values:[l().moddle.create(`${n}:FailedJobRetryTimeCycle`,{body:g})]});l().modeling.updateModdleProperties(Lt(a.value),c.value,{extensionElements:b})},f=()=>{l().modeling.updateModdleProperties(Lt(a.value),c.value,{collection:o.value.collection||null,elementVariable:o.value.elementVariable||null})},v=g=>{const{asyncBefore:b,asyncAfter:S}=o.value;let w=Object.create(null);b||S?w[g]=o.value[g]:(o.value.exclusive=!1,w={asyncBefore:!1,asyncAfter:!1,exclusive:!1,extensionElements:null}),l().modeling.updateModdleProperties(Lt(a.value),c.value,w)};return Ln(()=>{c.value=null,a.value=null}),me(()=>e.businessObject,g=>{var S,w,_,C;var b;a.value=l().bpmnElement,(b=g).loopCharacteristics?b.loopCharacteristics.$type==="bpmn:StandardLoopCharacteristics"?(i.value="StandardLoop",o.value={}):(b.loopCharacteristics.isSequential?i.value="SequentialMultiInstance":i.value="ParallelMultiInstance",o.value={...r.value,...b.loopCharacteristics,completionCondition:((w=(S=b.loopCharacteristics)==null?void 0:S.completionCondition)==null?void 0:w.body)??"",loopCardinality:((C=(_=b.loopCharacteristics)==null?void 0:_.loopCardinality)==null?void 0:C.body)??""},c.value=l().bpmnElement.businessObject.loopCharacteristics,b.loopCharacteristics.extensionElements&&b.loopCharacteristics.extensionElements.values&&b.loopCharacteristics.extensionElements.values.length&&(o.value.timeCycle=b.loopCharacteristics.extensionElements.values[0].body)):(i.value="Null",o.value={})},{immediate:!0}),(g,b)=>{const S=so,w=co,_=wn,C=_n,B=C0,s=ri;return nt(),Dt("div",HT,[R(s,{"label-width":"90px"},{default:V(()=>[R(_,{label:"\u56DE\u8DEF\u7279\u6027"},{default:V(()=>[R(w,{modelValue:D(i),"onUpdate:modelValue":b[0]||(b[0]=h=>ln(i)?i.value=h:null),onChange:u},{default:V(()=>[R(S,{label:"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6",value:"ParallelMultiInstance"}),R(S,{label:"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",value:"SequentialMultiInstance"}),R(S,{label:"\u5FAA\u73AF\u4E8B\u4EF6",value:"StandardLoop"}),R(S,{label:"\u65E0",value:"Null"})]),_:1},8,["modelValue"])]),_:1}),D(i)==="ParallelMultiInstance"||D(i)==="SequentialMultiInstance"?(nt(),Dt(cn,{key:0},[R(_,{label:"\u5FAA\u73AF\u57FA\u6570",key:"loopCardinality"},{default:V(()=>[R(C,{modelValue:D(o).loopCardinality,"onUpdate:modelValue":b[1]||(b[1]=h=>D(o).loopCardinality=h),clearable:"",onChange:p},null,8,["modelValue"])]),_:1}),ol(R(_,{label:"\u96C6\u5408",key:"collection"},{default:V(()=>[R(C,{modelValue:D(o).collection,"onUpdate:modelValue":b[2]||(b[2]=h=>D(o).collection=h),clearable:"",onChange:f},null,8,["modelValue"])]),_:1},512),[[$h,!1]]),R(_,{label:"\u5143\u7D20\u53D8\u91CF",key:"elementVariable"},{default:V(()=>[R(C,{modelValue:D(o).elementVariable,"onUpdate:modelValue":b[3]||(b[3]=h=>D(o).elementVariable=h),clearable:"",onChange:f},null,8,["modelValue"])]),_:1}),R(_,{label:"\u5B8C\u6210\u6761\u4EF6",key:"completionCondition"},{default:V(()=>[R(C,{modelValue:D(o).completionCondition,"onUpdate:modelValue":b[4]||(b[4]=h=>D(o).completionCondition=h),clearable:"",onChange:d},null,8,["modelValue"])]),_:1}),R(_,{label:"\u5F02\u6B65\u72B6\u6001",key:"async"},{default:V(()=>[R(B,{modelValue:D(o).asyncBefore,"onUpdate:modelValue":b[5]||(b[5]=h=>D(o).asyncBefore=h),label:"\u5F02\u6B65\u524D",onChange:b[6]||(b[6]=h=>v("asyncBefore"))},null,8,["modelValue"]),R(B,{modelValue:D(o).asyncAfter,"onUpdate:modelValue":b[7]||(b[7]=h=>D(o).asyncAfter=h),label:"\u5F02\u6B65\u540E",onChange:b[8]||(b[8]=h=>v("asyncAfter"))},null,8,["modelValue"]),D(o).asyncAfter||D(o).asyncBefore?(nt(),Ct(B,{key:0,modelValue:D(o).exclusive,"onUpdate:modelValue":b[9]||(b[9]=h=>D(o).exclusive=h),label:"\u6392\u9664",onChange:b[10]||(b[10]=h=>v("exclusive"))},null,8,["modelValue"])):kt("",!0)]),_:1}),D(o).asyncAfter||D(o).asyncBefore?(nt(),Ct(_,{label:"\u91CD\u8BD5\u5468\u671F",prop:"timeCycle",key:"timeCycle"},{default:V(()=>[R(C,{modelValue:D(o).timeCycle,"onUpdate:modelValue":b[11]||(b[11]=h=>D(o).timeCycle=h),clearable:"",onChange:y},null,8,["modelValue"])]),_:1})):kt("",!0)],64)):kt("",!0)]),_:1})])}}}),WT={class:"panel-tab__content"},XT=Re({name:"FlowCondition",__name:"FlowCondition",props:{businessObject:Object,type:String},setup(t){const e=t,n=W({}),i=W(),r=W(),o=W(),a=W(),c=()=>window==null?void 0:window.bpmnInstances,l=p=>p==="condition"?(a.value=c().moddle.create("bpmn:FormalExpression"),void c().modeling.updateProperties(Lt(i.value),{conditionExpression:a.value})):p==="default"?(c().modeling.updateProperties(Lt(i.value),{conditionExpression:null}),void c().modeling.updateProperties(Lt(r.value),{default:i.value})):(o.value.default&&o.value.default.id===i.value.id&&c().modeling.updateProperties(Lt(r.value),{default:null}),void c().modeling.updateProperties(Lt(i.value),{conditionExpression:null})),u=()=>{let p,{conditionType:d,scriptType:y,body:f,resource:v,language:g}=n.value;d==="expression"?p=c().moddle.create("bpmn:FormalExpression",{body:f}):y==="inlineScript"?(p=c().moddle.create("bpmn:FormalExpression",{body:f,language:g}),n.value.resource=""):(n.value.body="",p=c().moddle.create("bpmn:FormalExpression",{resource:v,language:g})),c().modeling.updateProperties(Lt(i.value),{conditionExpression:p})};return Ln(()=>{i.value=null,r.value=null,o.value=null}),me(()=>e.businessObject,p=>{Fe(()=>{(()=>{if(i.value=c().bpmnElement,r.value=i.value.source,o.value=i.value.businessObject.sourceRef,o.value&&o.value.default&&o.value.default.id===i.value.id&&n.value.type=="default")n.value={type:"default"};else if(i.value.businessObject.conditionExpression){const d=i.value.businessObject.conditionExpression;if(n.value={...d,type:"condition"},n.value.resource)return n.value.conditionType="script",void(n.value.scriptType="externalScript");if(d.language)return n.value.conditionType="script",void(n.value.scriptType="inlineScript");n.value.conditionType="expression"}else n.value={type:"normal"}})()})},{immediate:!0}),(p,d)=>{const y=so,f=co,v=wn,g=_n,b=ri;return nt(),Dt("div",WT,[R(b,{model:D(n),"label-width":"90px",size:"small"},{default:V(()=>[R(v,{label:"\u6D41\u8F6C\u7C7B\u578B"},{default:V(()=>[R(f,{modelValue:D(n).type,"onUpdate:modelValue":d[0]||(d[0]=S=>D(n).type=S),onChange:l},{default:V(()=>[R(y,{label:"\u666E\u901A\u6D41\u8F6C\u8DEF\u5F84",value:"normal"}),R(y,{label:"\u9ED8\u8BA4\u6D41\u8F6C\u8DEF\u5F84",value:"default"}),R(y,{label:"\u6761\u4EF6\u6D41\u8F6C\u8DEF\u5F84",value:"condition"})]),_:1},8,["modelValue"])]),_:1}),D(n).type==="condition"?(nt(),Ct(v,{label:"\u6761\u4EF6\u683C\u5F0F",key:"condition"},{default:V(()=>[R(f,{modelValue:D(n).conditionType,"onUpdate:modelValue":d[1]||(d[1]=S=>D(n).conditionType=S)},{default:V(()=>[R(y,{label:"\u8868\u8FBE\u5F0F",value:"expression"}),R(y,{label:"\u811A\u672C",value:"script"})]),_:1},8,["modelValue"])]),_:1})):kt("",!0),D(n).conditionType&&D(n).conditionType==="expression"?(nt(),Ct(v,{label:"\u8868\u8FBE\u5F0F",key:"express"},{default:V(()=>[R(g,{modelValue:D(n).body,"onUpdate:modelValue":d[2]||(d[2]=S=>D(n).body=S),style:{width:"192px"},clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):kt("",!0),D(n).conditionType&&D(n).conditionType==="script"?(nt(),Dt(cn,{key:2},[R(v,{label:"\u811A\u672C\u8BED\u8A00",key:"language"},{default:V(()=>[R(g,{modelValue:D(n).language,"onUpdate:modelValue":d[3]||(d[3]=S=>D(n).language=S),clearable:"",onChange:u},null,8,["modelValue"])]),_:1}),R(v,{label:"\u811A\u672C\u7C7B\u578B",key:"scriptType"},{default:V(()=>[R(f,{modelValue:D(n).scriptType,"onUpdate:modelValue":d[4]||(d[4]=S=>D(n).scriptType=S)},{default:V(()=>[R(y,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(y,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(n).scriptType==="inlineScript"?(nt(),Ct(v,{label:"\u811A\u672C",key:"body"},{default:V(()=>[R(g,{modelValue:D(n).body,"onUpdate:modelValue":d[5]||(d[5]=S=>D(n).body=S),type:"textarea",clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):kt("",!0),D(n).scriptType==="externalScript"?(nt(),Ct(v,{label:"\u8D44\u6E90\u5730\u5740",key:"resource"},{default:V(()=>[R(g,{modelValue:D(n).resource,"onUpdate:modelValue":d[6]||(d[6]=S=>D(n).resource=S),clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):kt("",!0)],64)):kt("",!0)]),_:1},8,["model"])])}}}),KT={class:"panel-tab__content"},YT={class:"panel-tab__content--title"},JT={class:"panel-tab__content--title",style:{"padding-top":"8px","margin-top":"8px","border-top":"1px solid #eee"}},ZT=Re({name:"SignalAndMassage",__name:"SignalAndMessage",setup(t){const e=T0(),n=W([]),i=W([]),r=W(!1),o=W(""),a=W({}),c=W(),l=W(),u=W(),p=zh(()=>o.value==="message"?{title:"\u521B\u5EFA\u6D88\u606F",idLabel:"\u6D88\u606FID",nameLabel:"\u6D88\u606F\u540D\u79F0"}:{title:"\u521B\u5EFA\u4FE1\u53F7",idLabel:"\u4FE1\u53F7ID",nameLabel:"\u4FE1\u53F7\u540D\u79F0"}),d=()=>window==null?void 0:window.bpmnInstances,y=()=>{c.value=d().modeler.getDefinitions().rootElements,l.value={},u.value={},i.value=[],n.value=[],c.value.forEach(g=>{g.$type==="bpmn:Message"&&(l.value[g.id]=!0,i.value.push({...g})),g.$type==="bpmn:Signal"&&(u.value[g.id]=!0,n.value.push({...g}))})},f=g=>{o.value=g,a.value={},r.value=!0},v=()=>{if(o.value==="message"){l.value[a.value.id]&&e.error("\u8BE5\u6D88\u606F\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const g=d().moddle.create("bpmn:Message",a.value);c.value.push(g)}else{u.value[a.value.id]&&e.error("\u8BE5\u4FE1\u53F7\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const g=d().moddle.create("bpmn:Signal",a.value);c.value.push(g)}r.value=!1,y()};return Pa(()=>{y()}),(g,b)=>{const S=al,w=po,_=sl,C=cl,B=_n,s=wn,h=ri,m=ao,E=Ma;return nt(),Dt("div",KT,[Vt("div",YT,[Vt("span",null,[R(S,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),mt("\u6D88\u606F\u5217\u8868")]),R(w,{type:"primary",title:"\u521B\u5EFA\u65B0\u6D88\u606F",preIcon:"ep:plus",onClick:b[0]||(b[0]=T=>f("message"))})]),R(C,{data:D(i),border:""},{default:V(()=>[R(_,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),R(_,{label:"\u6D88\u606FID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),R(_,{label:"\u6D88\u606F\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),Vt("div",JT,[Vt("span",null,[R(S,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),mt("\u4FE1\u53F7\u5217\u8868")]),R(w,{type:"primary",title:"\u521B\u5EFA\u65B0\u4FE1\u53F7",preIcon:"ep:plus",onClick:b[1]||(b[1]=T=>f("signal"))})]),R(C,{data:D(n),border:""},{default:V(()=>[R(_,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),R(_,{label:"\u4FE1\u53F7ID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),R(_,{label:"\u4FE1\u53F7\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),R(E,{modelValue:D(r),"onUpdate:modelValue":b[5]||(b[5]=T=>ln(r)?r.value=T:null),title:D(p).title,"close-on-click-modal":!1,width:"400px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(m,{onClick:b[4]||(b[4]=T=>r.value=!1)},{default:V(()=>[mt("\u53D6 \u6D88")]),_:1}),R(m,{type:"primary",onClick:v},{default:V(()=>[mt("\u4FDD \u5B58")]),_:1})]),default:V(()=>[R(h,{model:D(a),"label-width":"90px"},{default:V(()=>[R(s,{label:D(p).idLabel},{default:V(()=>[R(B,{modelValue:D(a).id,"onUpdate:modelValue":b[2]||(b[2]=T=>D(a).id=T),clearable:""},null,8,["modelValue"])]),_:1},8,["label"]),R(s,{label:D(p).nameLabel},{default:V(()=>[R(B,{modelValue:D(a).name,"onUpdate:modelValue":b[3]||(b[3]=T=>D(a).name=T),clearable:""},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["modelValue","title"])])}}}),ur=()=>window==null?void 0:window.bpmnInstances;function Vb(t,e,n){const i=Object.create(null);switch(i.event=t.event,e&&(i.id=t.id),t.listenerType){case"scriptListener":i.script=function(r,o){const{scriptType:a,scriptFormat:c,value:l,resource:u}=r,p=a==="inlineScript"?{scriptFormat:c,value:l}:{scriptFormat:c,resource:u};return ur().moddle.create(`${o}:Script`,p)}(t,n);break;case"expressionListener":i.expression=t.expression;break;case"delegateExpressionListener":i.delegateExpression=t.delegateExpression;break;default:i.class=t.class}if(t.fields&&(i.fields=t.fields.map(r=>function(o,a){const{name:c,fieldType:l,string:u,expression:p}=o,d=l==="string"?{name:c,string:u}:{name:c,expression:p};return ur().moddle.create(`${a}:Field`,d)}(r,n))),e&&t.event==="timeout"&&t.eventDefinitionType){const r=ur().moddle.create("bpmn:FormalExpression",{body:t.eventTimeDefinitions}),o=ur().moddle.create("bpmn:TimerEventDefinition",{id:`TimerEventDefinition_${QT(8)}`,[`time${t.eventDefinitionType.replace(/^\S/,a=>a.toUpperCase())}`]:r});i.eventDefinitions=[o]}return ur().moddle.create(`${n}:${e?"TaskListener":"ExecutionListener"}`,i)}function Xc(t,e){const n=ur().moddle.create("bpmn:ExtensionElements",{values:e});ur().modeling.updateProperties(Lt(t),{extensionElements:n})}function QT(t=8,e){let n="";const i=e||"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=t;r>0;--r)n+=i[Math.floor(Math.random()*i.length)];return n}function Fb(t){let e={...t};if(t.script&&(e={...t,...t.script,scriptType:t.script.resource?"externalScript":"inlineScript"}),t.event==="timeout"&&t.eventDefinitions&&t.eventDefinitions.length){let n="";for(const i in t.eventDefinitions[0])i.indexOf("time")!==-1&&(n=i,e.eventDefinitionType=i.replace("time","").toLowerCase());e.eventTimeDefinitions=t.eventDefinitions[0][n].body}return e}function zb(t){let e;return t.class&&(e="classListener"),t.expression&&(e="expressionListener"),t.delegateExpression&&(e="delegateExpressionListener"),t.script&&(e="scriptListener"),{...JSON.parse(JSON.stringify(t)),...t.script??{},listenerType:e}}let Ah,$b,kh,Gb,Ub,Hb,qb,Wb,Xb,Kb,Yb,Jb,Zb,Qb,t0,e0;Ah={classListener:"Java \u7C7B",expressionListener:"\u8868\u8FBE\u5F0F",delegateExpressionListener:"\u4EE3\u7406\u8868\u8FBE\u5F0F",scriptListener:"\u811A\u672C"},$b={create:"\u521B\u5EFA",assignment:"\u6307\u6D3E",complete:"\u5B8C\u6210",delete:"\u5220\u9664",update:"\u66F4\u65B0",timeout:"\u8D85\u65F6"},kh={string:"\u5B57\u7B26\u4E32",expression:"\u8868\u8FBE\u5F0F"},Gb={class:"panel-tab__content"},Ub={class:"element-drawer__button"},Hb={class:"listener-filed__title"},qb={class:"element-drawer__button"},Wb=Re({name:"ElementListeners",__name:"ElementListeners",props:{id:String,type:String},setup(t){const e=t,n=uo("prefix"),i=uo("width"),r=W([]),o=W({}),a=W(!1),c=W([]),l=W({}),u=W(!1),p=W(-1),d=W(-1),y=W(Ah),f=W(kh),v=W(),g=W(),b=W(),S=W(),w=W(),_=()=>{var m,E,T;v.value=(window==null?void 0:window.bpmnInstances).bpmnElement,g.value=[],b.value=((T=(E=(m=v.value.businessObject)==null?void 0:m.extensionElements)==null?void 0:E.values)==null?void 0:T.filter(M=>M.$type===`${n}:ExecutionListener`))??[],r.value=b.value.map(M=>zb(M))},C=(m,E)=>{m?(o.value=Fb(m),p.value=E):(o.value={},p.value=-1),m&&m.fields?c.value=m.fields.map(T=>({...T,fieldType:T.string?"string":"expression"})):(c.value=[],o.value.fields=[]),a.value=!0,Fe(()=>{S.value&&S.value.clearValidate()})},B=(m,E)=>{l.value=m?JSON.parse(JSON.stringify(m)):{},d.value=m?E:-1,u.value=!0,Fe(()=>{w.value&&w.value.clearValidate()})},s=async()=>{await w.value.validate()&&(d.value===-1?(c.value.push(l.value),o.value.fields.push(l.value)):(c.value.splice(d.value,1,l.value),o.value.fields.splice(d.value,1,l.value)),u.value=!1,Fe(()=>{l.value={}}))},h=async()=>{var E,T,M;if(!await S.value.validate())return;const m=Vb(o.value,!1,n);p.value===-1?(b.value.push(m),r.value.push(o.value)):(b.value.splice(p.value,1,m),r.value.splice(p.value,1,o.value)),g.value=((M=(T=(E=v.value.businessObject)==null?void 0:E.extensionElements)==null?void 0:T.values)==null?void 0:M.filter(I=>I.$type!==`${n}:ExecutionListener`))??[],Xc(v.value,g.value.concat(b.value)),a.value=!1,o.value={}};return me(()=>e.id,m=>{m&&m.length&&Fe(()=>{_()})},{immediate:!0}),(m,E)=>{const T=sl,M=ao,I=Gh,$=cl,P=po,x=so,N=co,j=wn,G=_n,X=ri,tt=al,rt=A0,st=Ma;return nt(),Dt("div",Gb,[R($,{data:D(r),size:"small",border:""},{default:V(()=>[R(T,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(T,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"100px",prop:"event"}),R(T,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"100px","show-overflow-tooltip":"",formatter:H=>D(y)[H.listenerType]},null,8,["formatter"]),R(T,{label:"\u64CD\u4F5C",width:"100px"},{default:V(H=>[R(M,{size:"small",link:"",onClick:q=>C(H.row,H.$index)},{default:V(()=>[mt("\u7F16\u8F91")]),_:2},1032,["onClick"]),R(I,{direction:"vertical"}),R(M,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:q=>(xt=>{oo.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{b.value.splice(xt,1),r.value.splice(xt,1),Xc(v.value,g.value.concat(b.value))}).catch(()=>{})})(H.$index)},{default:V(()=>[mt("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Vt("div",Ub,[R(P,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:E[0]||(E[0]=H=>C(null))})]),R(rt,{modelValue:D(a),"onUpdate:modelValue":E[12]||(E[12]=H=>ln(a)?a.value=H:null),title:"\u6267\u884C\u76D1\u542C\u5668",size:`${D(i)}px`,"append-to-body":"","destroy-on-close":""},{default:V(()=>[R(X,{model:D(o),"label-width":"96px",ref_key:"listenerFormRef",ref:S},{default:V(()=>[R(j,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(N,{modelValue:D(o).event,"onUpdate:modelValue":E[1]||(E[1]=H=>D(o).event=H)},{default:V(()=>[R(x,{label:"start",value:"start"}),R(x,{label:"end",value:"end"})]),_:1},8,["modelValue"])]),_:1}),R(j,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(N,{modelValue:D(o).listenerType,"onUpdate:modelValue":E[2]||(E[2]=H=>D(o).listenerType=H)},{default:V(()=>[(nt(!0),Dt(cn,null,lo(Object.keys(D(y)),H=>(nt(),Ct(x,{key:H,label:D(y)[H],value:H},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(o).listenerType==="classListener"?(nt(),Ct(j,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(o).class,"onUpdate:modelValue":E[3]||(E[3]=H=>D(o).class=H),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0),D(o).listenerType==="expressionListener"?(nt(),Ct(j,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(o).expression,"onUpdate:modelValue":E[4]||(E[4]=H=>D(o).expression=H),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0),D(o).listenerType==="delegateExpressionListener"?(nt(),Ct(j,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(o).delegateExpression,"onUpdate:modelValue":E[5]||(E[5]=H=>D(o).delegateExpression=H),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0),D(o).listenerType==="scriptListener"?(nt(),Dt(cn,{key:3},[R(j,{label:"\u811A\u672C\u683C\u5F0F",prop:"scriptFormat",key:"listener-script-format",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u683C\u5F0F"}},{default:V(()=>[R(G,{modelValue:D(o).scriptFormat,"onUpdate:modelValue":E[6]||(E[6]=H=>D(o).scriptFormat=H),clearable:""},null,8,["modelValue"])]),_:1}),R(j,{label:"\u811A\u672C\u7C7B\u578B",prop:"scriptType",key:"listener-script-type",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u9009\u62E9\u811A\u672C\u7C7B\u578B"}},{default:V(()=>[R(N,{modelValue:D(o).scriptType,"onUpdate:modelValue":E[7]||(E[7]=H=>D(o).scriptType=H)},{default:V(()=>[R(x,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(x,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(o).scriptType==="inlineScript"?(nt(),Ct(j,{label:"\u811A\u672C\u5185\u5BB9",prop:"value",key:"listener-script",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u5185\u5BB9"}},{default:V(()=>[R(G,{modelValue:D(o).value,"onUpdate:modelValue":E[8]||(E[8]=H=>D(o).value=H),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0),D(o).scriptType==="externalScript"?(nt(),Ct(j,{label:"\u8D44\u6E90\u5730\u5740",prop:"resource",key:"listener-resource",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u8D44\u6E90\u5730\u5740"}},{default:V(()=>[R(G,{modelValue:D(o).resource,"onUpdate:modelValue":E[9]||(E[9]=H=>D(o).resource=H),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0)],64)):kt("",!0)]),_:1},8,["model"]),R(I),Vt("p",Hb,[Vt("span",null,[R(tt,{icon:"ep:menu"}),mt("\u6CE8\u5165\u5B57\u6BB5\uFF1A")]),R(P,{type:"primary",onClick:E[10]||(E[10]=H=>B(null)),title:"\u6DFB\u52A0\u5B57\u6BB5"})]),R($,{data:D(c),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:V(()=>[R(T,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(T,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),R(T,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:H=>D(f)[H.fieldType]},null,8,["formatter"]),R(T,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:H=>H.string||H.expression},null,8,["formatter"]),R(T,{label:"\u64CD\u4F5C",width:"130px"},{default:V(H=>[R(M,{size:"small",link:"",onClick:q=>B(H.row,H.$index)},{default:V(()=>[mt("\u7F16\u8F91")]),_:2},1032,["onClick"]),R(I,{direction:"vertical"}),R(M,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:q=>(xt=>{oo.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{c.value.splice(xt,1),o.value.fields.splice(xt,1)}).catch(()=>{})})(H.$index)},{default:V(()=>[mt("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Vt("div",qb,[R(M,{onClick:E[11]||(E[11]=H=>a.value=!1)},{default:V(()=>[mt("\u53D6 \u6D88")]),_:1}),R(M,{type:"primary",onClick:h},{default:V(()=>[mt("\u4FDD \u5B58")]),_:1})])]),_:1},8,["modelValue","size"]),R(st,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:D(u),"onUpdate:modelValue":E[18]||(E[18]=H=>ln(u)?u.value=H:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(M,{size:"small",onClick:E[17]||(E[17]=H=>u.value=!1)},{default:V(()=>[mt("\u53D6 \u6D88")]),_:1}),R(M,{size:"small",type:"primary",onClick:s},{default:V(()=>[mt("\u786E \u5B9A")]),_:1})]),default:V(()=>[R(X,{model:D(l),"label-width":"96spx",ref_key:"listenerFieldFormRef",ref:w,style:{height:"136px"}},{default:V(()=>[R(j,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(l).name,"onUpdate:modelValue":E[13]||(E[13]=H=>D(l).name=H),clearable:""},null,8,["modelValue"])]),_:1}),R(j,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(N,{modelValue:D(l).fieldType,"onUpdate:modelValue":E[14]||(E[14]=H=>D(l).fieldType=H)},{default:V(()=>[(nt(!0),Dt(cn,null,lo(Object.keys(D(f)),H=>(nt(),Ct(x,{key:H,label:D(f)[H],value:H},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(l).fieldType==="string"?(nt(),Ct(j,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(l).string,"onUpdate:modelValue":E[15]||(E[15]=H=>D(l).string=H),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0),D(l).fieldType==="expression"?(nt(),Ct(j,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(l).expression,"onUpdate:modelValue":E[16]||(E[16]=H=>D(l).expression=H),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),Xb={class:"panel-tab__content"},Kb={class:"element-drawer__button"},Yb=Re({name:"ElementProperties",__name:"ElementProperties",props:{id:String,type:String},setup(t){const e=t,n=uo("prefix"),i=W([]),r=W({}),o=W(-1),a=W(!1),c=W(),l=W(),u=W(),p=W(),d=W(),y=()=>window==null?void 0:window.bpmnInstances,f=()=>{var S,w;c.value=y().bpmnElement,l.value=[],u.value=((w=(S=c.value.businessObject)==null?void 0:S.extensionElements)==null?void 0:w.values.filter(_=>(_.$type!==`${n}:Properties`&&l.value.push(_),_.$type===`${n}:Properties`)))??[],p.value=u.value.reduce((_,C)=>_.concat(C.values),[]),i.value=JSON.parse(JSON.stringify(p.value??[]))},v=(S,w)=>{o.value=w,r.value=w===-1?{}:JSON.parse(JSON.stringify(S)),a.value=!0,Fe(()=>{d.value&&d.value.clearValidate()})},g=()=>{const{name:S,value:w}=r.value;if(o.value!==-1)y().modeling.updateModdleProperties(Lt(c.value),Lt(p.value)[Lt(o.value)],{name:S,value:w});else{const _=y().moddle.create(`${n}:Property`,{name:S,value:w}),C=y().moddle.create(`${n}:Properties`,{values:p.value.concat([_])});b(C)}a.value=!1,f()},b=S=>{const w=y().moddle.create("bpmn:ExtensionElements",{values:l.value.concat([S])});y().modeling.updateProperties(Lt(c.value),{extensionElements:w})};return me(()=>e.id,S=>{S&&S&&S.length&&f()},{immediate:!0}),(S,w)=>{const _=sl,C=ao,B=Gh,s=cl,h=po,m=_n,E=wn,T=ri,M=Ma;return nt(),Dt("div",Xb,[R(s,{data:D(i),"max-height":"240",fit:"",border:""},{default:V(()=>[R(_,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(_,{label:"\u5C5E\u6027\u540D",prop:"name","min-width":"100px","show-overflow-tooltip":""}),R(_,{label:"\u5C5E\u6027\u503C",prop:"value","min-width":"100px","show-overflow-tooltip":""}),R(_,{label:"\u64CD\u4F5C",width:"110px"},{default:V(I=>[R(C,{link:"",onClick:$=>v(I.row,I.$index),size:"small"},{default:V(()=>[mt(" \u7F16\u8F91 ")]),_:2},1032,["onClick"]),R(B,{direction:"vertical"}),R(C,{link:"",size:"small",style:{color:"#ff4d4f"},onClick:$=>((P,x)=>{oo.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5C5E\u6027\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{i.value.splice(x,1),p.value.splice(x,1);const N=y().moddle.create(`${n}:Properties`,{values:p.value});b(N),f()}).catch(()=>{})})(I.row,I.$index)},{default:V(()=>[mt(" \u79FB\u9664 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Vt("div",Kb,[R(h,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u5C5E\u6027",onClick:w[0]||(w[0]=I=>v(null,-1))})]),R(M,{modelValue:D(a),"onUpdate:modelValue":w[4]||(w[4]=I=>ln(a)?a.value=I:null),title:"\u5C5E\u6027\u914D\u7F6E",width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(C,{onClick:w[3]||(w[3]=I=>a.value=!1)},{default:V(()=>[mt("\u53D6 \u6D88")]),_:1}),R(C,{type:"primary",onClick:g},{default:V(()=>[mt("\u786E \u5B9A")]),_:1})]),default:V(()=>[R(T,{model:D(r),"label-width":"80px",ref_key:"attributeFormRef",ref:d},{default:V(()=>[R(E,{label:"\u5C5E\u6027\u540D\uFF1A",prop:"name"},{default:V(()=>[R(m,{modelValue:D(r).name,"onUpdate:modelValue":w[1]||(w[1]=I=>D(r).name=I),clearable:""},null,8,["modelValue"])]),_:1}),R(E,{label:"\u5C5E\u6027\u503C\uFF1A",prop:"value"},{default:V(()=>[R(m,{modelValue:D(r).value,"onUpdate:modelValue":w[2]||(w[2]=I=>D(r).value=I),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),Jb={class:"panel-tab__content"},Zb={class:"element-drawer__button"},Qb={class:"listener-filed__title"},t0={class:"element-drawer__button"},e0=Re({name:"UserTaskListeners",__name:"UserTaskListeners",props:{id:String,type:String},setup(t){const e=t,n=uo("prefix"),i=uo("width"),r=W([]),o=W($b),a=W(Ah),c=W(!1),l=W({}),u=W(kh),p=W([]),d=W(!1),y=W(-1),f=W(-1),v=W({}),g=W(),b=W(),S=W(),w=W(),_=W(),C=()=>{var E,T;g.value=(window==null?void 0:window.bpmnInstances).bpmnElement,S.value=[],b.value=((T=(E=g.value.businessObject)==null?void 0:E.extensionElements)==null?void 0:T.values.filter(M=>M.$type===`${n}:TaskListener`))??[],r.value=b.value.map(M=>zb(M))},B=(E,T)=>{E?(l.value=Fb(E),y.value=T):(l.value={},y.value=-1),E&&E.fields?p.value=E.fields.map(M=>({...M,fieldType:M.string?"string":"expression"})):(p.value=[],l.value.fields=[]),c.value=!0,Fe(()=>{w.value&&w.value.clearValidate()})},s=async()=>{var T,M,I;if(!await w.value.validate())return;const E=Vb(l.value,!0,n);y.value===-1?(b.value.push(E),r.value.push(l.value)):(b.value.splice(y.value,1,E),r.value.splice(y.value,1,l.value)),S.value=((I=(M=(T=g.value.businessObject)==null?void 0:T.extensionElements)==null?void 0:M.values)==null?void 0:I.filter($=>$.$type!==`${n}:TaskListener`))??[],Xc(g.value,S.value.concat(b.value)),c.value=!1,l.value={}},h=(E,T)=>{v.value=E?JSON.parse(JSON.stringify(E)):{},f.value=E?T:-1,d.value=!0,Fe(()=>{_.value&&_.value.clearValidate()})},m=async()=>{await _.value.validate()&&(f.value===-1?(p.value.push(v.value),l.value.fields.push(v.value)):(p.value.splice(f.value,1,v.value),l.value.fields.splice(f.value,1,v.value)),d.value=!1,Fe(()=>{v.value={}}))};return me(()=>e.id,E=>{E&&E.length&&Fe(()=>{C()})},{immediate:!0}),(E,T)=>{const M=sl,I=ao,$=Gh,P=cl,x=po,N=so,j=co,G=wn,X=_n,tt=ri,rt=al,st=A0,H=Ma;return nt(),Dt("div",Jb,[R(P,{data:D(r),size:"small",border:""},{default:V(()=>[R(M,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(M,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:q=>D(o)[q.event]},null,8,["formatter"]),R(M,{label:"\u4E8B\u4EF6id","min-width":"80px",prop:"id","show-overflow-tooltip":""}),R(M,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:q=>D(a)[q.listenerType]},null,8,["formatter"]),R(M,{label:"\u64CD\u4F5C",width:"90px"},{default:V(q=>[R(I,{size:"small",link:"",onClick:xt=>B(q.row,q.$index)},{default:V(()=>[mt("\u7F16\u8F91")]),_:2},1032,["onClick"]),R($,{direction:"vertical"}),R(I,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:xt=>((Xt,ce)=>{oo.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{b.value.splice(ce,1),r.value.splice(ce,1),Xc(g.value,S.value.concat(b.value))}).catch(()=>{})})(q.row,q.$index)},{default:V(()=>[mt("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Vt("div",Zb,[R(x,{size:"small",type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:T[0]||(T[0]=q=>B(null))})]),R(st,{modelValue:D(c),"onUpdate:modelValue":T[15]||(T[15]=q=>ln(c)?c.value=q:null),title:"\u4EFB\u52A1\u76D1\u542C\u5668",size:`${D(i)}px`,"append-to-body":"","destroy-on-close":""},{default:V(()=>[R(tt,{size:"small",model:D(l),"label-width":"96px",ref_key:"listenerFormRef",ref:w},{default:V(()=>[R(G,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(j,{modelValue:D(l).event,"onUpdate:modelValue":T[1]||(T[1]=q=>D(l).event=q)},{default:V(()=>[(nt(!0),Dt(cn,null,lo(Object.keys(D(o)),q=>(nt(),Ct(N,{key:q,label:D(o)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),R(G,{label:"\u76D1\u542C\u5668ID",prop:"id",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(l).id,"onUpdate:modelValue":T[2]||(T[2]=q=>D(l).id=q),clearable:""},null,8,["modelValue"])]),_:1}),R(G,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(j,{modelValue:D(l).listenerType,"onUpdate:modelValue":T[3]||(T[3]=q=>D(l).listenerType=q)},{default:V(()=>[(nt(!0),Dt(cn,null,lo(Object.keys(D(a)),q=>(nt(),Ct(N,{key:q,label:D(a)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(l).listenerType==="classListener"?(nt(),Ct(G,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(l).class,"onUpdate:modelValue":T[4]||(T[4]=q=>D(l).class=q),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0),D(l).listenerType==="expressionListener"?(nt(),Ct(G,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(l).expression,"onUpdate:modelValue":T[5]||(T[5]=q=>D(l).expression=q),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0),D(l).listenerType==="delegateExpressionListener"?(nt(),Ct(G,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(l).delegateExpression,"onUpdate:modelValue":T[6]||(T[6]=q=>D(l).delegateExpression=q),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0),D(l).listenerType==="scriptListener"?(nt(),Dt(cn,{key:3},[R(G,{label:"\u811A\u672C\u683C\u5F0F",prop:"scriptFormat",key:"listener-script-format",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u683C\u5F0F"}},{default:V(()=>[R(X,{modelValue:D(l).scriptFormat,"onUpdate:modelValue":T[7]||(T[7]=q=>D(l).scriptFormat=q),clearable:""},null,8,["modelValue"])]),_:1}),R(G,{label:"\u811A\u672C\u7C7B\u578B",prop:"scriptType",key:"listener-script-type",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u9009\u62E9\u811A\u672C\u7C7B\u578B"}},{default:V(()=>[R(j,{modelValue:D(l).scriptType,"onUpdate:modelValue":T[8]||(T[8]=q=>D(l).scriptType=q)},{default:V(()=>[R(N,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(N,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(l).scriptType==="inlineScript"?(nt(),Ct(G,{label:"\u811A\u672C\u5185\u5BB9",prop:"value",key:"listener-script",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u5185\u5BB9"}},{default:V(()=>[R(X,{modelValue:D(l).value,"onUpdate:modelValue":T[9]||(T[9]=q=>D(l).value=q),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0),D(l).scriptType==="externalScript"?(nt(),Ct(G,{label:"\u8D44\u6E90\u5730\u5740",prop:"resource",key:"listener-resource",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u8D44\u6E90\u5730\u5740"}},{default:V(()=>[R(X,{modelValue:D(l).resource,"onUpdate:modelValue":T[10]||(T[10]=q=>D(l).resource=q),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0)],64)):kt("",!0),D(l).event==="timeout"?(nt(),Dt(cn,{key:4},[R(G,{label:"\u5B9A\u65F6\u5668\u7C7B\u578B",prop:"eventDefinitionType",key:"eventDefinitionType"},{default:V(()=>[R(j,{modelValue:D(l).eventDefinitionType,"onUpdate:modelValue":T[11]||(T[11]=q=>D(l).eventDefinitionType=q)},{default:V(()=>[R(N,{label:"\u65E5\u671F",value:"date"}),R(N,{label:"\u6301\u7EED\u65F6\u957F",value:"duration"}),R(N,{label:"\u5FAA\u73AF",value:"cycle"}),R(N,{label:"\u65E0",value:"null"})]),_:1},8,["modelValue"])]),_:1}),D(l).eventDefinitionType&&D(l).eventDefinitionType!=="null"?(nt(),Ct(G,{label:"\u5B9A\u65F6\u5668",prop:"eventTimeDefinitions",key:"eventTimeDefinitions",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u5B9A\u65F6\u5668\u914D\u7F6E"}},{default:V(()=>[R(X,{modelValue:D(l).eventTimeDefinitions,"onUpdate:modelValue":T[12]||(T[12]=q=>D(l).eventTimeDefinitions=q),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0)],64)):kt("",!0)]),_:1},8,["model"]),R($),Vt("p",Qb,[Vt("span",null,[R(rt,{icon:"ep:menu"}),mt("\u6CE8\u5165\u5B57\u6BB5\uFF1A")]),R(I,{size:"small",type:"primary",onClick:T[13]||(T[13]=q=>h(null))},{default:V(()=>[mt("\u6DFB\u52A0\u5B57\u6BB5")]),_:1})]),R(P,{data:D(p),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:V(()=>[R(M,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(M,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),R(M,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:q=>D(u)[q.fieldType]},null,8,["formatter"]),R(M,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:q=>q.string||q.expression},null,8,["formatter"]),R(M,{label:"\u64CD\u4F5C",width:"100px"},{default:V(q=>[R(I,{size:"small",link:"",onClick:xt=>h(q.row,q.$index)},{default:V(()=>[mt("\u7F16\u8F91")]),_:2},1032,["onClick"]),R($,{direction:"vertical"}),R(I,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:xt=>((Xt,ce)=>{oo.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{p.value.splice(ce,1),l.value.fields.splice(ce,1)}).catch(()=>{})})(q.row,q.$index)},{default:V(()=>[mt("\u79FB\u9664")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Vt("div",t0,[R(I,{size:"small",onClick:T[14]||(T[14]=q=>c.value=!1)},{default:V(()=>[mt("\u53D6 \u6D88")]),_:1}),R(I,{size:"small",type:"primary",onClick:s},{default:V(()=>[mt("\u4FDD \u5B58")]),_:1})])]),_:1},8,["modelValue","size"]),R(H,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:D(d),"onUpdate:modelValue":T[21]||(T[21]=q=>ln(d)?d.value=q:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(I,{size:"small",onClick:T[20]||(T[20]=q=>d.value=!1)},{default:V(()=>[mt("\u53D6 \u6D88")]),_:1}),R(I,{size:"small",type:"primary",onClick:m},{default:V(()=>[mt("\u786E \u5B9A")]),_:1})]),default:V(()=>[R(tt,{model:D(v),size:"small","label-width":"96px",ref_key:"listenerFieldFormRef",ref:_,style:{height:"136px"}},{default:V(()=>[R(G,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(v).name,"onUpdate:modelValue":T[16]||(T[16]=q=>D(v).name=q),clearable:""},null,8,["modelValue"])]),_:1}),R(G,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(j,{modelValue:D(v).fieldType,"onUpdate:modelValue":T[17]||(T[17]=q=>D(v).fieldType=q)},{default:V(()=>[(nt(!0),Dt(cn,null,lo(Object.keys(D(u)),q=>(nt(),Ct(N,{key:q,label:D(u)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(v).fieldType==="string"?(nt(),Ct(G,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(v).string,"onUpdate:modelValue":T[18]||(T[18]=q=>D(v).string=q),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0),D(v).fieldType==="expression"?(nt(),Ct(G,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(X,{modelValue:D(v).expression,"onUpdate:modelValue":T[19]||(T[19]=q=>D(v).expression=q),clearable:""},null,8,["modelValue"])]),_:1})):kt("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),Ia=Re({name:"MyPropertiesPanel",__name:"PropertiesPanel",props:{bpmnModeler:{type:Object,default:()=>{}},prefix:{type:String,default:"camunda"},width:{type:Number,default:480},idEditDisabled:{type:Boolean,default:!1},model:Object},setup(t){const e=t,n=W("base"),i=W(""),r=W(""),o=W({}),a=W(!1),c=W(!1),l=W();rl("prefix",e.prefix),rl("width",e.width);const u=()=>window==null?void 0:window.bpmnInstances,p=me(()=>e.bpmnModeler,()=>{e.bpmnModeler&&(window.bpmnInstances={modeler:e.bpmnModeler,modeling:e.bpmnModeler.get("modeling"),moddle:e.bpmnModeler.get("moddle"),eventBus:e.bpmnModeler.get("eventBus"),bpmnFactory:e.bpmnModeler.get("bpmnFactory"),elementFactory:e.bpmnModeler.get("elementFactory"),elementRegistry:e.bpmnModeler.get("elementRegistry"),replace:e.bpmnModeler.get("replace"),selection:e.bpmnModeler.get("selection")},d(),p())},{immediate:!0}),d=()=>{y(null),e.bpmnModeler.on("import.done",f=>{y(null)}),e.bpmnModeler.on("selection.changed",({newSelection:f})=>{y(f[0]||null)}),e.bpmnModeler.on("element.changed",({element:f})=>{f&&f.id===i.value&&y(f)})},y=f=>{let v=f;v||(v=u().elementRegistry.find(g=>g.type==="bpmn:Process")??u().elementRegistry.find(g=>g.type==="bpmn:Collaboration")),v&&(u().bpmnElement=v,l.value=v,i.value=v.id,r.value=v.type.split(":")[1]||"",o.value=JSON.parse(JSON.stringify(v.businessObject)),a.value=!(r.value!=="SequenceFlow"||!v.source||v.source.type.indexOf("StartEvent")!==-1),c.value=r.value==="UserTask"||r.value==="StartEvent")};return Ln(()=>{window.bpmnInstances=null}),me(()=>i.value,()=>{n.value="base"}),(f,v)=>{const g=al,b=MA,S=Uh,w=S0("router-link"),_=RA;return nt(),Dt("div",{class:"process-panel__container",style:SA({width:`${t.width}px`})},[R(_,{modelValue:D(n),"onUpdate:modelValue":v[0]||(v[0]=C=>ln(n)?n.value=C:null)},{default:V(()=>[R(b,{name:"base"},{title:V(()=>[R(g,{icon:"ep:info-filled"}),mt(" \u5E38\u89C4")]),default:V(()=>[R(MT,{"id-edit-disabled":t.idEditDisabled,"business-object":D(o),type:D(r),model:t.model},null,8,["id-edit-disabled","business-object","type","model"])]),_:1}),D(r)==="Process"?(nt(),Ct(b,{name:"condition",key:"message"},{title:V(()=>[R(g,{icon:"ep:comment"}),mt("\u6D88\u606F\u4E0E\u4FE1\u53F7")]),default:V(()=>[R(ZT)]),_:1})):kt("",!0),D(a)?(nt(),Ct(b,{name:"condition",key:"condition"},{title:V(()=>[R(g,{icon:"ep:promotion"}),mt("\u6D41\u8F6C\u6761\u4EF6")]),default:V(()=>[R(XT,{"business-object":D(o),type:D(r)},null,8,["business-object","type"])]),_:1})):kt("",!0),D(c)?(nt(),Ct(b,{name:"condition",key:"form"},{title:V(()=>[R(g,{icon:"ep:list"}),mt("\u8868\u5355")]),default:V(()=>[mt(" \u53CB\u60C5\u63D0\u793A\uFF1A\u4F7F\u7528 "),R(w,{to:{path:"/bpm/manager/form"}},{default:V(()=>[R(S,{type:"danger"},{default:V(()=>[mt("\u6D41\u7A0B\u8868\u5355")]),_:1})]),_:1}),mt(" \u66FF\u4EE3\uFF0C\u63D0\u4F9B\u66F4\u597D\u7684\u8868\u5355\u8BBE\u8BA1\u529F\u80FD ")]),_:1})):kt("",!0),D(r).indexOf("Task")!==-1?(nt(),Ct(b,{name:"task",key:"task"},{title:V(()=>[R(g,{icon:"ep:checked"}),mt("\u4EFB\u52A1")]),default:V(()=>[R(UT,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1})):kt("",!0),D(r).indexOf("Task")!==-1?(nt(),Ct(b,{name:"multiInstance",key:"multiInstance"},{title:V(()=>[R(g,{icon:"ep:help-filled"}),mt("\u591A\u5B9E\u4F8B")]),default:V(()=>[R(qT,{"business-object":D(o),type:D(r)},null,8,["business-object","type"])]),_:1})):kt("",!0),R(b,{name:"listeners",key:"listeners"},{title:V(()=>[R(g,{icon:"ep:bell-filled"}),mt("\u6267\u884C\u76D1\u542C\u5668")]),default:V(()=>[R(Wb,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1}),D(r)==="UserTask"?(nt(),Ct(b,{name:"taskListeners",key:"taskListeners"},{title:V(()=>[R(g,{icon:"ep:bell-filled"}),mt("\u4EFB\u52A1\u76D1\u542C\u5668")]),default:V(()=>[R(e0,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1})):kt("",!0),R(b,{name:"extensions",key:"extensions"},{title:V(()=>[R(g,{icon:"ep:circle-plus-filled"}),mt("\u6269\u5C55\u5C5E\u6027")]),default:V(()=>[R(Yb,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1}),R(b,{name:"other",key:"other"},{title:V(()=>[R(g,{icon:"ep:promotion"}),mt("\u5176\u4ED6")]),default:V(()=>[R(BT,{id:D(i)},null,8,["id"])]),_:1})]),_:1},8,["modelValue"])],4)}}}),Ia.install=function(t){t.component(Ia.name,Ia)};let n0,i0;n0={class:"my-process-designer"},i0={class:"my-process-designer__container"},Da=Re({name:"MyProcessViewer",__name:"ProcessViewer",props:{value:{type:String,default:""},prefix:{type:String,default:"camunda"},activityData:{type:Array,default:()=>[]},processInstanceData:{type:Object,default:()=>{}},taskData:{type:Array,default:()=>[]}},emits:["destroy"],setup(t,{emit:e}){const n=t;rl("configGlobal",n);const i=e;let r;const o=W(""),a=W([]),c=W(void 0),l=W([]),u=W(),p=W(null),d=W(null),y=async _=>{let C=`Process_${new Date().getTime()}`,B=`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,s=_||Vg(C,B,n.prefix);try{let{warnings:h}=await r.importXML(s);h&&h.length&&h.forEach(m=>{}),await f(),r.get("canvas").zoom("fit-viewport","auto")}catch{}},f=async()=>{var E;const _=a.value;if(_.length===0)return;let C=r.get("canvas"),B=_.find(T=>!T.endTime),s=_[_.length-1],h=!1,m=[];(E=r.getDefinitions().rootElements[0].flowElements)==null||E.forEach(T=>{var I,$,P;let M=_.find(x=>x.key===T.id);if(M){if(T.$type==="bpmn:UserTask"){const x=l.value.find(j=>j.id===M.taskId);if(!x)return;if(h)return void m.push(T.id);if(C.addMarker(T.id,g(x.result)),x.result===1&&(h=!0),x.result!==2)return;const N=b(M);N==null||N.forEach(j=>{let G=_.find(X=>X.key===j.targetRef.id);G?C.addMarker(j.id,G.endTime?"highlight":"highlight-todo"):j.targetRef.$type==="bpmn:ExclusiveGateway"?(C.addMarker(j.id,M.endTime?"highlight":"highlight-todo"),C.addMarker(j.targetRef.id,M.endTime?"highlight":"highlight-todo")):j.targetRef.$type==="bpmn:EndEvent"&&(B||s.key!==T.id||(C.addMarker(j.id,"highlight"),C.addMarker(j.targetRef.id,"highlight")),M.endTime||(C.addMarker(j.id,"highlight-todo"),C.addMarker(j.targetRef.id,"highlight-todo")))})}else if(T.$type==="bpmn:ExclusiveGateway"){let x,N;C.addMarker(T.id,v(M)),(I=T.outgoing)==null||I.forEach(j=>{let G=_.find(X=>X.key===j.targetRef.id);G&&(N&&N.type!=="endEvent"||(x=j,N=G))}),x&&N&&C.addMarker(x.id,v(N))}else if(T.$type==="bpmn:ParallelGateway")C.addMarker(T.id,v(M)),($=T.outgoing)==null||$.forEach(x=>{const N=_.find(j=>j.key===x.targetRef.id);N&&(C.addMarker(x.id,v(N)),C.addMarker(x.targetRef.id,v(N)))});else if(T.$type==="bpmn:StartEvent")(P=T.outgoing)==null||P.forEach(x=>{_.find(N=>N.key===x.targetRef.id)&&(C.addMarker(x.id,"highlight"),C.addMarker(T.id,"highlight"))});else if(T.$type==="bpmn:EndEvent"){if(!c.value||c.value.result===1)return;C.addMarker(T.id,g(c.value.result))}else if(T.$type==="bpmn:ServiceTask"&&(M.startTime>0&&M.endTime===0&&C.addMarker(T.id,g(1)),M.endTime>0)){C.addMarker(T.id,g(2));const x=b(M);x==null||x.forEach(N=>{C.addMarker(N.id,g(2))})}}}),CA(m)||(l.value=l.value.filter(T=>!m.includes(T.definitionKey)))},v=_=>_.endTime?"highlight":"highlight-todo",g=_=>_===1?"highlight-todo":_===2?"highlight":_===3?"highlight-reject":_===4?"highlight-cancel":_===5||_===6||_===7||_===8||_===9?"highlight-return":"",b=_=>{if(_.outgoing&&_.outgoing.length>0)return _.outgoing;const C=r.getDefinitions().rootElements[0].flowElements,B=[];return C.forEach(s=>{s.$type==="bpmn:SequenceFlow"&&s.sourceRef.id===_.key&&B.push(s)}),B},S=_=>{var B;_.value=_,!p.value&&(p.value={}),!d.value&&(d.value=r.get("overlays"));const C=a.value.find(s=>s.key===_.value.id);if(C&&!p.value[_.value.id]&&_.value.type!=="bpmn:Process"){let s=`<div class="element-overlays">
- <p>Elemet id: ${_.value.id}</p>
- <p>Elemet type: ${_.value.type}</p>
- </div>`;if(_.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${ho(c.value.createTime)}`;else if(_.value.type==="bpmn:UserTask"){let h=l.value.find(T=>T.id===C.taskId);if(!h)return;let m=k0(P0.BPM_PROCESS_INSTANCE_RESULT),E="";m.forEach(T=>{T.value==h.result&&(E=T.label)}),s=`<p>\u5BA1\u6279\u4EBA\uFF1A${h.assigneeUser.nickname}</p>
- <p>\u90E8\u95E8\uFF1A${h.assigneeUser.deptName}</p>
- <p>\u7ED3\u679C\uFF1A${E}</p>
- <p>\u521B\u5EFA\u65F6\u95F4\uFF1A${ho(h.createTime)}</p>`,h.endTime&&(s+=`<p>\u7ED3\u675F\u65F6\u95F4\uFF1A${ho(h.endTime)}</p>`),h.reason&&(s+=`<p>\u5BA1\u6279\u5EFA\u8BAE\uFF1A${h.reason}</p>`)}else if(_.value.type==="bpmn:ServiceTask"&&c.value)C.startTime>0&&(s=`<p>\u521B\u5EFA\u65F6\u95F4\uFF1A${ho(C.startTime)}</p>`),C.endTime>0&&(s+=`<p>\u7ED3\u675F\u65F6\u95F4\uFF1A${ho(C.endTime)}</p>`);else if(_.value.type==="bpmn:EndEvent"&&c.value){let h=k0(P0.BPM_PROCESS_INSTANCE_RESULT),m="";h.forEach(E=>{E.value==c.value.result&&(m=E.label)}),s=`<p>\u7ED3\u679C\uFF1A${m}</p>`,c.value.endTime&&(s+=`<p>\u7ED3\u675F\u65F6\u95F4\uFF1A${ho(c.value.endTime)}</p>`)}p.value[_.value.id]=(B=Lt(d.value))==null?void 0:B.add(_.value,{position:{left:0,bottom:0},html:`<div class="element-overlays">${s}</div>`})}},w=_=>{Lt(d.value).remove({element:_}),p.value[_.id]=null};return Pa(()=>{o.value=n.value,a.value=n.activityData,r||(r=new Hn({container:u.value,bpmnRenderer:{}})),y(o.value),(()=>{const _=r.get("eventBus");_.on("element.hover",function(C){let B=C?C.element:null;S(B)}),_.on("element.out",function(C){let B=C?C.element:null;w(B)})})()}),Ln(()=>{r&&r.destroy(),i("destroy",r),r=null}),me(()=>n.value,_=>{o.value=_,y(o.value)}),me(()=>n.activityData,_=>{a.value=_,y(o.value)}),me(()=>n.processInstanceData,_=>{c.value=_,y(o.value)}),me(()=>n.taskData,_=>{l.value=_,y(o.value)}),(_,C)=>(nt(),Dt("div",n0,[Vt("div",i0,[Vt("div",{class:"my-process-designer__canvas",style:{height:"760px"},ref_key:"bpmnCanvas",ref:u},null,512)])]))}}),Da.install=function(t){t.component(Da.name,Da)}});export{Ra as P,Na as _,jA as __tla,A as a,M0 as b,Ne as c,Hh as d,Mt as e,qh as f,oi as g,Ia as h,wt as i,Da as j};
|