12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import{_ as Xb}from"./Dialog-f2c6d513.js";import{cS as gr,cQ as Yh,dr as Kb,d as ke,r as X,q as ja,e as vl,ds as Yb,b as fo,h as wn,a1 as Jb,o as nt,c as Nt,C as Ot,aL as Zb,F as qe,f as R,B as V,a as D,A as St,E as Tt,G as dt,D as Jh,l as Va,a0 as We,bg as Qb,bh as br,bc as t0,dt as e0,L as xr,x as n0,w as le,cu as Bt,a6 as hn,S as dn,U as Vn,n as Ne,as as Zh,v as yl,Q as Er,R as _r,P as wr,aZ as vo,aQ as i0,bS as r0,Z as o0,am as Qh,i as Sr,_ as Fa,V as za,W as $a,cg as gl,aE as a0,aw as s0}from"./index-b9299550.js";import{_ as c0}from"./XTextButton-02e014ca.js";import{_ as Cr}from"./XButton-eeb68bf5.js";import{E as l0,a as u0}from"./el-collapse-item-a9544d23.js";import{E as bl}from"./el-link-db0f9114.js";import{u as td}from"./useMessage-903d430d.js";import{E as ed}from"./el-drawer-1f465c5d.js";import{a as nd,D as id}from"./dict-fc5218c3.js";import{f as Tr}from"./formatTime-988372b6.js";var xl={exports:{}};typeof Object.create=="function"?xl.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:xl.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}};const rt=gr(xl.exports);var rd,El,p0=(rd=function(t){var e=t.exports=function(n,i){if(i||(i=16),n===void 0&&(n=128),n<=0)return"0";for(var r=Math.log(Math.pow(2,n))/Math.log(i),o=2;r===1/0;o*=2)r=Math.log(Math.pow(2,n/o))/Math.log(i)*o;var a=r-Math.floor(r),c="";for(o=0;o<Math.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}},rd(El={exports:{}},El.exports),El.exports);function Sn(t){if(!(this instanceof Sn))return new Sn(t);t=t||[128,36,1],this._seed=t.length?p0.rack(t[0],t[1],t[2]):t}function yo(t){return Array.prototype.concat.apply([],t)}Sn.prototype.next=function(t){return this._seed(t||!0)},Sn.prototype.nextPrefixed=function(t,e){var n;do n=t+this.next(!0);while(this.assigned(n));return this.claim(n,e),n},Sn.prototype.claim=function(t,e){this._seed.set(t,e||!0)},Sn.prototype.assigned=function(t){return this._seed.get(t)||!1},Sn.prototype.unclaim=function(t){delete this._seed.hats[t]},Sn.prototype.clear=function(){var t,e=this._seed.hats;for(t in e)this.unclaim(t)};var go=Object.prototype.toString,h0=Object.prototype.hasOwnProperty;function Fn(t){return t===void 0}function Xe(t){return t!==void 0}function bo(t){return t==null}function gt(t){return go.call(t)==="[object Array]"}function Jt(t){return go.call(t)==="[object Object]"}function ht(t){return go.call(t)==="[object Number]"}function fe(t){var e=go.call(t);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"||e==="[object Proxy]"}function Ie(t){return go.call(t)==="[object String]"}function od(t){if(!gt(t))throw new Error("must supply array")}function Cn(t,e){return h0.call(t,e)}function kt(t,e){var n;return e=Cl(e),L(t,function(i,r){if(e(i,r))return n=i,!1}),n}function _l(t,e){e=Cl(e);var n=gt(t)?-1:void 0;return L(t,function(i,r){if(e(i,r))return n=r,!1}),n}function mt(t,e){var n=[];return L(t,function(i,r){e(i,r)&&n.push(i)}),n}function L(t,e){var n;if(!Fn(t)){var i=gt(t)?m0:d0;for(var r in t)if(Cn(t,r)&&e(n=t[r],i(r))===!1)return n}}function ad(t,e){return Fn(t)?[]:(od(t),e=Cl(e),t.filter(function(n,i){return!e(n,i)}))}function De(t,e,n){return L(t,function(i,r){n=e(n,i,r)}),n}function $i(t,e){return!!De(t,function(n,i,r){return n&&e(i,r)},!0)}function ui(t,e){return!!kt(t,e)}function ae(t,e){var n=[];return L(t,function(i,r){n.push(e(i,r))}),n}function xo(t){return t&&Object.keys(t)||[]}function Ar(t){return xo(t).length}function Ga(t){return ae(t,function(e){return e})}function Gi(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e=Sl(e),L(t,function(i){var r=e(i)||"_",o=n[r];o||(o=n[r]=[]),o.push(i)}),n}function wl(t){t=Sl(t);for(var e={},n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return L(i,function(o){return Gi(o,t,e)}),ae(e,function(o,a){return o[0]})}var sd=wl;function Ke(t,e){e=Sl(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)}),ae(n,function(i){return i.v})}function Ye(t){return function(e){return $i(t,function(n,i){return e[i]===n})}}function Sl(t){return fe(t)?t:function(e){return e[t]}}function Cl(t){return fe(t)?t:function(e){return e===t}}function d0(t){return t}function m0(t){return Number(t)}function Tl(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 _e(t,e){return t.bind(e)}function Al(t){return Al=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},Al(t)}function kl(){return kl=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},kl.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 kl.apply(void 0,[t].concat(n))}function Je(t,e){var n={},i=Object(t);return L(e,function(r){r in i&&(n[r]=t[r])}),n}function zn(t,e){var n={};return L(Object(t),function(i,r){e.indexOf(r)===-1&&(n[r]=i)}),n}const f0=Object.freeze(Object.defineProperty({__proto__:null,assign:z,bind:_e,debounce:Tl,ensureArray:od,every:$i,filter:mt,find:kt,findIndex:_l,flatten:yo,forEach:L,get:function(t,e,n){var i=t;return L(e,function(r){if(bo(i))return i=void 0,!1;i=i[r]}),Fn(i)?n:i},groupBy:Gi,has:Cn,isArray:gt,isDefined:Xe,isFunction:fe,isNil:bo,isNumber:ht,isObject:Jt,isString:Ie,isUndefined:Fn,keys:xo,map:ae,matchPattern:Ye,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&&Jt(o)&&L(o,function(a,c){if(c!=="__proto__"){var l=e[c];Jt(a)?(Jt(l)||(l={}),e[c]=t(l,a)):e[c]=a}})}),e},omit:zn,pick:Je,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: "+Al(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];Xe(a)&&bo(c)&&(c=i[r]=isNaN(+a)?{}:[]),Fn(a)?Fn(n)?delete i[r]:i[r]=n:i=c}),t},size:Ar,some:ui,sortBy:Ke,throttle:function(t,e){var n=!1;return function(){n||(t.apply(void 0,arguments),n=!0,setTimeout(function(){n=!1},e))}},unionBy:sd,uniqueBy:wl,values:Ga,without:ad},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 v0=[].indexOf,Pl=function(t,e){if(v0)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1},y0=/\s+/,g0=Object.prototype.toString;function ne(t){return new pi(t)}function pi(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}function Ua(t){for(var e;t.childNodes.length;)e=t.childNodes[0],t.removeChild(e);return t}pi.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~Pl(e,t)||e.push(t),this.el.className=e.join(" "),this},pi.prototype.remove=function(t){if(g0.call(t)=="[object RegExp]")return this.removeMatching(t);if(this.list)return this.list.remove(t),this;var e=this.array(),n=Pl(e,t);return~n&&e.splice(n,1),this.el.className=e.join(" "),this},pi.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},pi.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)},pi.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(y0);return t[0]===""&&t.shift(),t},pi.prototype.has=pi.prototype.contains=function(t){return this.list?this.list.contains(t):!!~Pl(this.array(),t)};var kr=typeof Element<"u"?Element.prototype:{},cd=kr.matches||kr.matchesSelector||kr.webkitMatchesSelector||kr.mozMatchesSelector||kr.msMatchesSelector||kr.oMatchesSelector,Ha=function(t,e){if(!t||t.nodeType!==1)return!1;if(cd)return cd.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 Ui(t,e,n){for(var i=n?t:t.parentNode;i&&i.nodeType!==document.DOCUMENT_NODE&&i.nodeType!==document.DOCUMENT_FRAGMENT_NODE;){if(Ha(i,e))return i;i=i.parentNode}return Ha(i,e)?i:null}var ld=window.addEventListener?"addEventListener":"attachEvent",b0=window.removeEventListener?"removeEventListener":"detachEvent",ud=ld!=="addEventListener"?"on":"",ct={bind:function(t,e,n,i){return t[ld](ud+e,n,i||!1),n},unbind:function(t,e,n,i){return t[b0](ud+e,n,i||!1),n}},pd=["focus","blur"],Ml,$e={bind:function(t,e,n,i,r){return pd.indexOf(n)!==-1&&(r=!0),ct.bind(t,n,function(o){var a=o.target||o.srcElement;o.delegateTarget=Ui(a,e,!0),o.delegateTarget&&i.call(t,o)},r)},unbind:function(t,e,n,i){return pd.indexOf(e)!==-1&&(i=!0),ct.unbind(t,e,n,i)}},Lt=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=ie[i]||ie._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},hd=!1;typeof document<"u"&&((Ml=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',hd=!Ml.getElementsByTagName("link").length,Ml=void 0);var ie={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:hd?[1,"X<div>","</div>"]:[0,"",""]};function Ut(t,e){return(e=e||document).querySelector(t)}function Rl(t,e){return(e=e||document).querySelectorAll(t)}function Tn(t){t.parentNode&&t.parentNode.removeChild(t)}function dd(t,e){return e.appendChild(function(n,i){if(n.ownerDocument!==i.ownerDocument)try{return i.ownerDocument.importNode(n,!0)}catch{}return n}(t,e))}function lt(t,e){return dd(e,t),t}ie.td=ie.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],ie.option=ie.optgroup=[1,'<select multiple="multiple">',"</select>"],ie.thead=ie.tbody=ie.colgroup=ie.caption=ie.tfoot=[1,"<table>","</table>"],ie.polyline=ie.ellipse=ie.polygon=ie.circle=ie.text=ie.line=ie.path=ie.rect=ie.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var md={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function fd(t,e,n){var i=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=md[i];r?(r===2&&typeof n=="number"&&(n=String(n)+"px"),t.style[i]=n):t.setAttributeNS(null,e,n)}function K(t,e,n){if(typeof e=="string"){if(n===void 0)return function(i,r){return md[r]?i.style[r]:i.getAttributeNS(null,r)}(t,e);fd(t,e,n)}else(function(i,r){var o,a,c=Object.keys(r);for(o=0;a=c[o];o++)fd(i,a,r[a])})(t,e);return t}function Nl(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}var x0=/\s+/,E0=Object.prototype.toString;function Il(t){return t!==void 0}function bt(t){return new hi(t)}function hi(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}function Zt(t){var e=t.parentNode;return e&&e.removeChild(t),t}function Dl(t){for(var e;e=t.firstChild;)Zt(e);return t}function vd(t){return t.cloneNode(!0)}hi.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~Nl(e,t)||e.push(t),Il(this.el.className.baseVal)?this.el.className.baseVal=e.join(" "):this.el.className=e.join(" "),this},hi.prototype.remove=function(t){if(E0.call(t)==="[object RegExp]")return this.removeMatching(t);if(this.list)return this.list.remove(t),this;var e=this.array(),n=Nl(e,t);return~n&&e.splice(n,1),this.el.className.baseVal=e.join(" "),this},hi.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},hi.prototype.toggle=function(t,e){return this.list?(Il(e)?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(Il(e)?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},hi.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(x0);return t[0]===""&&t.shift(),t},hi.prototype.has=hi.prototype.contains=function(t){return this.list?this.list.contains(t):!!~Nl(this.array(),t)};var Bl="http://www.w3.org/2000/svg",yd='<svg xmlns="'+Bl+'"';function gd(t){var e=!1;t.substring(0,4)==="<svg"?t.indexOf(Bl)===-1&&(t=yd+t.substring(4)):(t=yd+">"+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=gd(t).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(Bl,t),e&&K(n,e),n}var Ol=null;function Ll(){return Ol===null&&(Ol=ot("svg")),Ol}function bd(t,e){var n,i,r=Object.keys(e);for(n=0;i=r[n];n++)t[i]=e[i];return t}function Eo(t){return t?Ll().createSVGTransformFromMatrix(t):Ll().createSVGTransform()}var xd=/([&<>]{1})/g,_0=/([\n\r"]{1})/g,w0={"&":"&","<":"<",">":">",'"':"'"};function jl(t,e){return t.replace(e,function(n,i){return w0[i]||i})}function Ed(t,e){var n,i,r,o,a;switch(t.nodeType){case 3:e.push(jl(t.textContent,xd));break;case 1:if(e.push("<",t.tagName),t.hasAttributes())for(n=0,i=(r=t.attributes).length;n<i;++n)o=r.item(n),e.push(" ",o.name,'="',jl(o.value,_0),'"');if(t.hasChildNodes()){for(e.push(">"),n=0,i=(a=t.childNodes).length;n<i;++n)Ed(a.item(n),e);e.push("</",t.tagName,">")}else e.push("/>");break;case 8:e.push("<!--",jl(t.nodeValue,xd),"-->");break;case 4:e.push("<![CDATA[",t.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+t.nodeType)}return e}function S0(t,e){var n=gd(e);if(Dl(t),e){(function(a){return a.nodeName==="#document-fragment"})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),o=0;o<r.length;o++)dd(r[o],t)}}function _d(t,e){if(e!==void 0){try{S0(t,e)}catch(n){throw new Error("error parsing SVG: "+n.message)}return t}return function(n){for(var i=n.firstChild,r=[];i;)Ed(i,r),i=i.nextSibling;return r.join("")}(t)}function C0(t,e){return e instanceof SVGMatrix?t.createSVGTransformFromMatrix(e):e}function _o(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(C0(i,a))}(n,e)),n.consolidate()}var T0=/^class /;function Vl(t){return Object.prototype.toString.call(t)==="[object Array]"}function Fl(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function qa(){var t=Array.prototype.slice.call(arguments);t.length===1&&Vl(t[0])&&(t=t[0]);var e=t.pop();return e.$inject=t,e}var A0=/constructor\s*[^(]*\(\s*([^)]*)\)/m,k0=/^(?:async )?(?:function\s*)?[^(]*\(\s*([^)]*)\)/m,P0=/\/\*([^*]*)\*\//m;function M0(t){if(typeof t!="function")throw new Error('Cannot annotate "'+t+'". Expected a function!');var e=t.toString().match(function(n){return T0.test(n.toString())}(t)?A0:k0);return e&&e[1]&&e[1].split(",").map(function(n){return(e=n.match(P0))?e[1].trim():n.trim()})||[]}function R0(){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 zl(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(Fl(r,f))return r[f];if(Fl(i,f)){if(n.indexOf(f)!==-1)throw n.push(f),a("Cannot resolve circular dependency!");return n.push(f),r[f]=i[f][0](i[f][1]),n.pop(),r[f]}return e.get(f,v)},l=function(f,v){if(v===void 0&&(v={}),typeof f!="function"){if(!Vl(f))throw new Error('Cannot invoke "'+f+'". Expected a function!');f=qa(f.slice())}return{fn:f,dependencies:(f.$inject||M0(f)).map(function(g){return Fl(v,g)?v[g]:c(g)})}},u=function(f){var v=l(f),g=v.fn,b=v.dependencies;return new(Function.prototype.bind.apply(g,[null].concat(b)))},p=function(f,v,g){var b=l(f,g),E=b.fn,S=b.dependencies;return E.apply(v,S)},d=function(f){return qa(function(v){return f.get(v)})},y={factory:p,type:u,value:function(f){return f}};t.forEach(function(f){function v(S,w){return S!=="value"&&Vl(w)&&(w=qa(w.slice())),w}if(f instanceof R0)f.forEach(function(S){var w=S[0],C=S[1],B=S[2];i[w]=[y[C],v(C,B),C]});else if(typeof f=="object")if(f.__exports__){var g=Object.keys(f).reduce(function(S,w){return w.substring(0,2)!=="__"&&(S[w]=f[w]),S},Object.create(null)),b=new zl((f.__modules__||[]).concat([g]),o),E=qa(function(S){return b.get(S)});f.__exports__.forEach(function(S){i[S]=[E,S,"private",b]})}else Object.keys(f).forEach(function(S){if(f[S][2]!=="private"){var w=f[S][0],C=f[S][1];i[S]=[y[w],v(w,C),w]}else i[S]=f[S]})}),this.get=c,this.invoke=p,this.instantiate=u,this.createChild=function(f,v){if(v&&v.length){var g,b,E,S,w=Object.create(null),C=Object.create(null),B=[],s=[],h=[];for(var m in i)g=i[m],v.indexOf(m)!==-1&&(g[2]==="private"?(b=B.indexOf(g[3]))===-1?(E=g[3].createChild([],v),S=d(E),B.push(g[3]),s.push(E),h.push(S),w[m]=[S,m,"private",E]):w[m]=[h[b],m,"private",s[b]]:w[m]=[g[2],g[1]],C[m]=!0),g[2]!=="factory"&&g[2]!=="type"||!g[1].$scope||v.forEach(function(_){g[1].$scope.indexOf(_)!==-1&&(w[m]=[g[2],g[1]],C[_]=!0)});v.forEach(function(_){if(!C[_])throw new Error('No provider for "'+_+'". Cannot use provider from the parent!')}),f.unshift(w)}return new zl(f,o)}}function $n(t,e){var n=this;e=e||1e3,t.on(["render.shape","render.connection"],e,function(i,r){var o=i.type,a=r.element,c=r.gfx,l=r.attrs;if(n.canRender(a))return o==="render.shape"?n.drawShape(c,a,l):n.drawConnection(c,a,l)}),t.on(["render.getShapePath","render.getConnectionPath"],e,function(i,r){if(n.canRender(r))return i.type==="render.getShapePath"?n.getShapePath(r):n.getConnectionPath(r)})}function Pr(t){return t.join(",").replace(/,?([A-z]),?/g,"$1")}function wd(t){for(var e,n="",i=0;e=t[i];i++)n+=e.x+","+e.y+" ";return n}function $l(t,e){var n=ot("polyline");return K(n,{points:wd(t)}),e&&K(n,e),n}function Sd(t){return mt(t,function(e){return!kt(t,function(n){return n!==e&&Cd(e,n)})})}function Cd(t,e){if(e){if(t===e)return e;if(t.parent)return Cd(t.parent,e)}}function Td(t,e,n){var i=!n||t.indexOf(e)===-1;return i&&t.push(e),i}function Hi(t,e,n){n=n||0,gt(t)||(t=[t]),L(t,function(i,r){var o=e(i,r,n);gt(o)&&o.length&&Hi(o,e,n+1)})}function Wa(t,e){return function(n,i,r){var o=[],a=[];return Hi(n,function(c,l,u){Td(o,c,i);var p=c.children;if((r===-1||u<r)&&p&&Td(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 Ad(t){return"waypoints"in t?"connection":"x"in t?"shape":"root"}function kd(t){return!(!t||!t.isFrame)}function wo(t,e){return z({},t||{},e||{})}$n.prototype.canRender=function(){},$n.prototype.drawShape=function(){},$n.prototype.drawConnection=function(){},$n.prototype.getShapePath=function(){},$n.prototype.getConnectionPath=function(){};function di(t,e){$n.call(this,t,1),this.CONNECTION_STYLE=e.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=e.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=e.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}rt(di,$n),di.prototype.canRender=function(){return!0},di.prototype.drawShape=function(t,e,n){var i=ot("rect");return K(i,{x:0,y:0,width:e.width||0,height:e.height||0}),kd(e)?K(i,z({},this.FRAME_STYLE,n||{})):K(i,z({},this.SHAPE_STYLE,n||{})),lt(t,i),i},di.prototype.drawConnection=function(t,e,n){var i=$l(e.waypoints,z({},this.CONNECTION_STYLE,n||{}));return lt(t,i),i},di.prototype.getShapePath=function(t){var e=t.x,n=t.y,i=t.width;return Pr([["M",e,n],["l",i,0],["l",0,t.height],["l",-i,0],["z"]])},di.prototype.getConnectionPath=function(t){var e,n,i=t.waypoints,r=[];for(e=0;n=i[e];e++)n=n.original||n,r.push([e===0?"M":"L",n.x,n.y]);return Pr(r)},di.$inject=["eventBus","styles"];const N0={__init__:["defaultRenderer"],defaultRenderer:["type",di],styles:["type",function(){var t={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},e=this;this.cls=function(n,i,r){return z(this.style(i,r),{class:n})},this.style=function(n,i){gt(n)||i||(i=n,n=[]);var r=De(n,function(o,a){return z(o,t[a]||{})},{});return i?z(r,i):r},this.computeStyle=function(n,i,r){return gt(i)||(r=i,i=[]),e.style(i||[],z({},r,n||{}))}}]};function Wt(t,e){if(!t||!e)return-1;var n=t.indexOf(e);return n!==-1&&t.splice(n,1),n}function Xt(t,e,n){if(t&&e){typeof n!="number"&&(n=-1);var i=t.indexOf(e);if(i!==-1){if(i===n||n===-1)return;t.splice(i,1)}n!==-1?t.splice(n,0,e):t.push(e)}}function Gl(t,e){return t&&e?t.indexOf(e):-1}function So(t,e){return t&&e?Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):-1}function Ul(t,e,n,i){if(i===void 0&&(i=5),!t||!e||!n)return!1;var r=(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x),o=So(t,e);return Math.abs(r/o)<=i}function Gn(t,e){var n;return function(i,r){var o;o=gt(i)?i:[i,r];var a=o.slice().shift();return $i(o,function(c){return Math.abs(a.y-c.y)<=2})}(n=gt(t)?t:[t,e])?"h":!!function(i,r){var o;o=gt(i)?i:[i,r];var a=o.slice().shift();return $i(o,function(c){return Math.abs(a.x-c.x)<=2})}(n)&&"v"}function Pd(t,e,n){return n=n||0,t.x>e.x-n&&t.y>e.y-n&&t.x<e.x+e.width+n&&t.y<e.y+e.height+n}function Hl(t,e){return{x:Math.round(t.x+(e.x-t.x)/2),y:Math.round(t.y+(e.y-t.y)/2)}}var I0=/,?([a-z]),?/gi,Md=parseFloat,Kt=Math,mi=Kt.PI,An=Kt.min,kn=Kt.max,Rd=Kt.pow,fi=Kt.abs,D0=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?[\s]*,?[\s]*)+)/gi,B0=/(-?\d*\.?\d*(?:e[-+]?\d+)?)[\s]*,?[\s]*/gi,Xa=Array.isArray||function(t){return t instanceof Array};function ql(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Co(t){if(typeof t=="function"||Object(t)!==t)return t;var e=new t.constructor;for(var n in t)ql(t,n)&&(e[n]=Co(t[n]));return e}function Mr(t){var e=Mr.ps=Mr.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var n in e)ql(e,n)&&n!=t&&(e[n].sleep--,!e[n].sleep&&delete e[n])}),e[t]}function Wl(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 Nd(){return this.join(",").replace(I0,"$1")}function Ka(t){var e=Co(t);return e.toString=Nd,e}function Id(t,e,n,i,r,o,a,c,l){var u=1-l,p=Rd(u,3),d=Rd(u,2),y=l*l*l,f=p*e+3*d*l*i+3*u*l*l*o+y*c;return{x:Ya(p*t+3*d*l*n+3*u*l*l*r+y*a),y:Ya(f)}}function Dd(t){var e=V0.apply(null,t);return Wl(e.x0,e.y0,e.x1-e.x0,e.y1-e.y0)}function vi(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height}function Bd(t,e,n,i,r){return t*(t*(-3*e+9*n-9*i+3*r)+6*e-12*n+6*i)-3*e+3*n}function Od(t,e,n,i,r,o,a,c,l){l==null&&(l=1);for(var u=(l=l>1?1:l<0?0:l)/2,p=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],y=0,f=0;f<12;f++){var v=u*p[f]+u,g=Bd(v,t,n,r,a),b=Bd(v,e,i,o,c),E=g*g+b*b;y+=d[f]*Kt.sqrt(E)}return u*y}function O0(t,e,n,i,r,o,a,c){if(!(kn(t,n)<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=Ya(((t*i-e*n)*(r-a)-(t-n)*(r*c-o*a))/u),d=Ya(l/u),y=+p.toFixed(2),f=+d.toFixed(2);if(!(y<+An(t,n).toFixed(2)||y>+kn(t,n).toFixed(2)||y<+An(r,a).toFixed(2)||y>+kn(r,a).toFixed(2)||f<+An(e,i).toFixed(2)||f>+kn(e,i).toFixed(2)||f<+An(o,c).toFixed(2)||f>+kn(o,c).toFixed(2)))return{x:p,y:d}}}}function Ya(t){return Math.round(1e11*t)/1e11}function L0(t,e,n){if(!function(m,_){return m=Wl(m),vi(_=Wl(_),m.x,m.y)||vi(_,m.x2,m.y)||vi(_,m.x,m.y2)||vi(_,m.x2,m.y2)||vi(m,_.x,_.y)||vi(m,_.x2,_.y)||vi(m,_.x,_.y2)||vi(m,_.x2,_.y2)||(m.x<_.x2&&m.x>_.x||_.x<m.x2&&_.x>m.x)&&(m.y<_.y2&&m.y>_.y||_.y<m.y2&&_.y>m.y)}(Dd(t),Dd(e)))return n?0:[];for(var i=Od.apply(0,t),r=Od.apply(0,e),o=Ld(t)?1:~~(i/5)||1,a=Ld(e)?1:~~(r/5)||1,c=[],l=[],u={},p=n?0:[],d=0;d<o+1;d++){var y=Id.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=Id.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],E=l[f],S=l[f+1],w=fi(b.x-g.x)<.01?"y":"x",C=fi(S.x-E.x)<.01?"y":"x",B=O0(g.x,g.y,b.x,b.y,E.x,E.y,S.x,S.y);if(B){if(u[v=B.x.toFixed(9)+"#"+B.y.toFixed(9)])continue;u[v]=!0;var s=g.t+fi((B[w]-g[w])/(b[w]-g[w]))*(b.t-g.t),h=E.t+fi((B[C]-E[C])/(S[C]-E[C]))*(S.t-E.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 j0(t){var e=Mr(t);if(e.abs)return Ka(e.abs);if(Xa(t)&&Xa(t&&t[0])||(t=function(E){if(!E)return null;var S=Mr(E);if(S.arr)return Co(S.arr);var w={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},C=[];return Xa(E)&&Xa(E[0])&&(C=Co(E)),C.length||String(E).replace(D0,function(B,s,h){var m=[],_=s.toLowerCase();for(h.replace(B0,function(T,M){M&&m.push(+M)}),_=="m"&&m.length>2&&(C.push([s].concat(m.splice(0,2))),_="l",s=s=="m"?"l":"L");m.length>=w[_]&&(C.push([s].concat(m.splice(0,w[_]))),w[_]););}),C.toString=Mr.toString,S.arr=Co(C),C}(t)),!t||!t.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,c=0,l=0;t[0][0]=="M"&&(a=r=+t[0][1],c=o=+t[0][2],l++,i[0]=["M",r,o]);for(var u,p,d=l,y=t.length;d<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=Nd,e.abs=Ka(i),i}function Ld(t){return t[0]===t[2]&&t[1]===t[3]&&t[4]===t[6]&&t[5]===t[7]}function Ja(t,e,n,i){return[t,e,n,i,n,i]}function jd(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 Vd(t,e,n,i,r,o,a,c,l,u){var p,d,y=120*mi/180,f=mi/180*(+r||0),v=[],g=(d=function(Vt,qt,Et){return{x:Vt*Kt.cos(Et)-qt*Kt.sin(Et),y:Vt*Kt.sin(Et)+qt*Kt.cos(Et)}},function Vt(){var qt=Array.prototype.slice.call(arguments,0),Et=qt.join("\u2400"),oe=Vt.cache=Vt.cache||{},se=Vt.count=Vt.count||[];return ql(oe,Et)?(function(Mt,de){for(var _t=0,Te=Mt.length;_t<Te;_t++)if(Mt[_t]===de)return Mt.push(Mt.splice(_t,1)[0])}(se,Et),oe[Et]):(se.length>=1e3&&delete oe[se.shift()],se.push(Et),oe[Et]=d.apply(0,qt),oe[Et])});if(u)m=u[0],_=u[1],s=u[2],h=u[3];else{t=(p=g(t,e,-f)).x,e=p.y;var b=(t-(c=(p=g(c,l,-f)).x))/2,E=(e-(l=p.y))/2,S=b*b/(n*n)+E*E/(i*i);S>1&&(n*=S=Kt.sqrt(S),i*=S);var w=n*n,C=i*i,B=(o==a?-1:1)*Kt.sqrt(fi((w*C-w*E*E-C*b*b)/(w*E*E+C*b*b))),s=B*n*E/i+(t+c)/2,h=B*-i*b/n+(e+l)/2,m=Kt.asin(((e-h)/i).toFixed(9)),_=Kt.asin(((l-h)/i).toFixed(9));(m=t<s?mi-m:m)<0&&(m=2*mi+m),(_=c<s?mi-_:_)<0&&(_=2*mi+_),a&&m>_&&(m-=2*mi),!a&&_>m&&(_-=2*mi)}var T=_-m;if(fi(T)>y){var M=_,I=c,$=l;_=m+y*(a&&_>m?1:-1),v=Vd(c=s+n*Kt.cos(_),l=h+i*Kt.sin(_),n,i,r,0,a,I,$,[_,M,s,h])}T=_-m;var P=Kt.cos(m),x=Kt.sin(m),N=Kt.cos(_),j=Kt.sin(_),G=Kt.tan(T/4),W=4/3*n*G,tt=4/3*i*G,it=[t,e],at=[t+W*x,e-tt*P],H=[c+W*j,l-tt*N],q=[c,l];if(at[0]=2*it[0]-at[0],at[1]=2*it[1]-at[1],u)return[at,H,q].concat(v);for(var jt=[],Ht=0,he=(v=[at,H,q].concat(v).join().split(",")).length;Ht<he;Ht++)jt[Ht]=Ht%2?g(v[Ht-1],v[Ht],f).y:g(v[Ht],v[Ht+1],f).x;return jt}function V0(t,e,n,i,r,o,a,c){for(var l,u,p,d,y,f,v,g,b=[],E=[[],[]],S=0;S<2;++S)if(S==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),fi(l)<1e-12){if(fi(u)<1e-12)continue;0<(d=-p/u)&&d<1&&b.push(d)}else v=u*u-4*p*l,g=Kt.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 w,C=b.length,B=C;C--;)w=1-(d=b[C]),E[0][C]=w*w*w*t+3*w*w*d*n+3*w*d*d*r+d*d*d*a,E[1][C]=w*w*w*e+3*w*w*d*i+3*w*d*d*o+d*d*d*c;return E[0][B]=t,E[1][B]=e,E[0][B+1]=a,E[1][B+1]=c,E[0].length=E[1].length=B+2,{x0:An.apply(0,E[0]),y0:An.apply(0,E[1]),x1:kn.apply(0,E[0]),y1:kn.apply(0,E[1])}}function Fd(t){var e=Mr(t);if(e.curve)return Ka(e.curve);for(var n=j0(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,E;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(Vd.apply(0,[v.x,v.y].concat(f.slice(1))));break;case"S":g=="C"||g=="S"?(b=2*v.x-v.bx,E=2*v.y-v.by):(b=v.x,E=v.y),f=["C",b,E].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(jd(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(jd(v.x,v.y,f[1],f[2],f[3],f[4]));break;case"L":f=["C"].concat(Ja(v.x,v.y,f[1],f[2]));break;case"H":f=["C"].concat(Ja(v.x,v.y,f[1],v.y));break;case"V":f=["C"].concat(Ja(v.x,v.y,v.x,f[1]));break;case"Z":f=["C"].concat(Ja(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=Md(d[y-4])||i.x,i.by=Md(d[y-3])||i.y}return e.curve=Ka(n),n}const zd=gr(function(t,e,n){t=Fd(t),e=Fd(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 E=0,S=e.length;E<S;E++){var w=e[E];if(w[0]=="M")o=u=w[1],a=p=w[2];else{w[0]=="C"?(y=[o,a].concat(w.slice(1)),o=y[6],a=y[7]):(y=[o,a,o,a,u,p,u,p],o=u,a=p);var C=L0(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=E,C[B].bez1=d,C[B].bez2=y;f=f.concat(C)}}}}}return f});function $d(t){return{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}}function qi(t){return{x:Math.round(t.x),y:Math.round(t.y)}}function st(t){return{top:t.y,right:t.x+(t.width||0),bottom:t.y+(t.height||0),left:t.x}}function Xl(t){return{x:t.left,y:t.top,width:t.right-t.left,height:t.bottom-t.top}}function vt(t){return qi({x:t.x+(t.width||0)/2,y:t.y+(t.height||0)/2})}function ye(t,e,n){Jt(n=n||0)||(n={x:n,y:n});var i=st(t),r=st(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 Kl(t,e,n){var i=zd(t,e);return i.length===1||i.length===2&&So(i[0],i[1])<1?qi(i[0]):i.length>1?(i=Ke(i,function(r){var o=Math.floor(100*r.t2)||1;return o=((o=100-o)<10?"0":"")+o,r.segment2+"#"+o}),qi(i[n?0:i.length-1])):null}function Za(t,e){return Math.round(t*e)/e}function Gd(t){return ht(t)?t+"px":t}function Ud(t,e,n){var i=ot("g");bt(i).add(e);var r=n!==void 0?n:t.childNodes.length-1;return t.insertBefore(i,t.childNodes[r]||null),i}var Qa="base",Yl="djs-element-hidden",F0={shape:["x","y","width","height"],connection:["waypoints"]};function yt(t,e,n,i){this._eventBus=e,this._elementRegistry=i,this._graphicsFactory=n,this._init(t||{})}function Hd(t,e){var n="matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.e+","+e.f+")";t.setAttribute("transform",n)}yt.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],yt.prototype._init=function(t){var e=this._eventBus,n=this._container=function(o){var a=(o=z({},{width:"100%",height:"100%"},o)).container||document.body,c=document.createElement("div");return c.setAttribute("class","djs-container"),z(c.style,{position:"relative",overflow:"hidden",width:Gd(o.width),height:Gd(o.height)}),a.appendChild(c),c}(t),i=this._svg=ot("svg");K(i,{width:"100%",height:"100%"}),lt(n,i);var r=this._viewport=Ud(i,"viewport");this._layers={},this._planes={},t.deferUpdate!==!1&&(this._viewboxChanged=Tl(_e(this._viewboxChanged,this),300)),e.on("diagram.init",function(){e.fire("canvas.init",{svg:i,viewport:r})},this),e.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed","plane.set"],function(){delete this._cachedViewbox},this),e.on("diagram.destroy",500,this._destroy,this),e.on("diagram.clear",500,this._clear,this)},yt.prototype._destroy=function(t){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var e=this._container.parentNode;e&&e.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._planes,delete this._activePlane,delete this._viewport},yt.prototype._clear=function(){var t=this;this._elementRegistry.getAll().forEach(function(e){var n=Ad(e);n==="root"?t.setRootElementForPlane(null,t.findPlane(e),!0):t._removeElement(e,n)}),this._activePlane=null,this._planes={},delete this._cachedViewbox},yt.prototype.getDefaultLayer=function(){return this.getLayer(Qa,0)},yt.prototype.getLayer=function(t,e){if(!t)throw new Error("must specify a name");var n=this._layers[t];if(n||(n=this._layers[t]=this._createLayer(t,e)),e!==void 0&&n.index!==e)throw new Error("layer <"+t+"> already created at index <"+e+">");return n.group},yt.prototype._createLayer=function(t,e){e===void 0&&(e=1);var n=De(this._layers,function(i,r){return e>=r.index&&i++,i},0);return{group:Ud(this._viewport,"layer-"+t,n),index:e}},yt.prototype.getPlane=function(t){if(!t)throw new Error("must specify a name");return this._planes[t]},yt.prototype.createPlane=function(t,e){if(!t)throw new Error("must specify a name");if(this._planes[t])throw new Error("plane "+t+" already exists");e||(e={id:"__implicitroot"+t,children:[],isImplicit:!0});var n=this.getLayer(t,0);bt(n).add(Yl);var i=this._planes[t]={layer:n,name:t,rootElement:null};return this.setRootElementForPlane(e,i),i},yt.prototype.setActivePlane=function(t){if(!t)throw new Error("must specify a plane");return typeof t=="string"&&(t=this.getPlane(t)),this._activePlane&&bt(this._activePlane.layer).add(Yl),this._activePlane=t,bt(t.layer).remove(Yl),t.rootElement&&this._elementRegistry.updateGraphics(t.rootElement,this._svg,!0),this._eventBus.fire("plane.set",{plane:t}),t},yt.prototype.getActiveLayer=function(){return this.getActivePlane().layer},yt.prototype.getActivePlane=function(){var t=this._activePlane;return t||(t=this.createPlane(Qa),this.setActivePlane(Qa)),t},yt.prototype.findPlane=function(t){typeof t=="string"&&(t=this._elementRegistry.get(t));var e=function(n){for(;n.parent;)n=n.parent;return n}(t);return kt(this._planes,function(n){return n.rootElement===e})},yt.prototype.getContainer=function(){return this._container},yt.prototype._updateMarker=function(t,e,n){var i;t.id||(t=this._elementRegistry.get(t)),(i=this._elementRegistry._elements[t.id])&&(L([i.gfx,i.secondaryGfx],function(r){r&&(n?bt(r).add(e):bt(r).remove(e))}),this._eventBus.fire("element.marker.update",{element:t,gfx:i.gfx,marker:e,add:!!n}))},yt.prototype.addMarker=function(t,e){this._updateMarker(t,e,!0)},yt.prototype.removeMarker=function(t,e){this._updateMarker(t,e,!1)},yt.prototype.hasMarker=function(t,e){return t.id||(t=this._elementRegistry.get(t)),bt(this.getGraphics(t)).has(e)},yt.prototype.toggleMarker=function(t,e){this.hasMarker(t,e)?this.removeMarker(t,e):this.addMarker(t,e)},yt.prototype.getRootElement=function(){return this.getActivePlane().rootElement},yt.prototype.setRootElement=function(t,e){var n=this._activePlane;if(n)return this.setRootElementForPlane(t,n,e);var i=this.createPlane(Qa,t);return this.setActivePlane(i),i.rootElement},yt.prototype.setRootElementForPlane=function(t,e,n){typeof e=="string"&&(e=this.getPlane(e)),t&&this._ensureValid("root",t);var i=e.rootElement,r=this._elementRegistry,o=this._eventBus;if(i){if(!n)throw new Error("rootElement already set, need to specify override");o.fire("root.remove",{element:i}),o.fire("root.removed",{element:i}),r.remove(i)}if(t){var a=e.layer;o.fire("root.add",{element:t}),r.add(t,a),o.fire("root.added",{element:t,gfx:a}),e===this._activePlane&&this._elementRegistry.updateGraphics(t,this._svg,!0)}return e.rootElement=t,t},yt.prototype._ensureValid=function(t,e){if(!e.id)throw new Error("element must have an id");if(this._elementRegistry.get(e.id))throw new Error("element with id "+e.id+" already exists");var n=F0[t],i=$i(n,function(r){return e[r]!==void 0});if(!i)throw new Error("must supply { "+n.join(", ")+" } with "+t)},yt.prototype._setParent=function(t,e,n){Xt(e.children,t,n),t.parent=e},yt.prototype._addElement=function(t,e,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(t,e),r.fire(t+".add",{element:e,parent:n}),this._setParent(e,n,i);var a=o.create(t,e,i);return this._elementRegistry.add(e,a),o.update(t,e,a),r.fire(t+".added",{element:e,gfx:a}),e},yt.prototype.addShape=function(t,e,n){return this._addElement("shape",t,e,n)},yt.prototype.addConnection=function(t,e,n){return this._addElement("connection",t,e,n)},yt.prototype._removeElement=function(t,e){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(t=n.get(t.id||t))return r.fire(e+".remove",{element:t}),i.remove(t),Wt(t.parent&&t.parent.children,t),t.parent=null,r.fire(e+".removed",{element:t}),n.remove(t),t},yt.prototype.removeShape=function(t){return this._removeElement(t,"shape")},yt.prototype.removeConnection=function(t){return this._removeElement(t,"connection")},yt.prototype.getGraphics=function(t,e){return this._elementRegistry.getGraphics(t,e)},yt.prototype._changeViewbox=function(t){this._eventBus.fire("canvas.viewbox.changing"),t.apply(this),this._cachedViewbox=null,this._viewboxChanged()},yt.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},yt.prototype.viewbox=function(t){if(t===void 0&&this._cachedViewbox)return this._cachedViewbox;var e,n,i,r,o,a,c=this._viewport,l=this.getSize();return t?(this._changeViewbox(function(){r=Math.min(l.width/t.width,l.height/t.height);var u=this._svg.createSVGMatrix().scale(r).translate(-t.x,-t.y);_o(c,u)}),t):(e=this._activePlane&&this._activePlane.layer.getBBox()||{},n=(i=_o(c))?i.matrix:function(u,p,d,y,f,v){var g=Ll().createSVGMatrix();switch(arguments.length){case 0:return g;case 1:return bd(g,u);case 6:return bd(g,{a:u,b:p,c:d,d:y,e:f,f:v})}}(),r=Za(n.a,1e3),o=Za(-n.e||0,1e3),a=Za(-n.f||0,1e3),t=this._cachedViewbox={x:o?o/r:0,y:a?a/r:0,width:l.width/r,height:l.height/r,scale:r,inner:{width:e.width||0,height:e.height||0,x:e.x||0,y:e.y||0},outer:l})},yt.prototype.scroll=function(t){var e=this._viewport,n=e.getCTM();return t&&this._changeViewbox(function(){t=z({dx:0,dy:0},t||{}),n=this._svg.createSVGMatrix().translate(t.dx,t.dy).multiply(n),Hd(e,n)}),{x:n.e,y:n.f}},yt.prototype.scrollToElement=function(t,e){var n=100;typeof t=="string"&&(t=this._elementRegistry.get(t));var i=this.findPlane(t);i!==this._activePlane&&this.setActivePlane(i),e||(e={}),typeof e=="number"&&(n=e),e={top:e.top||n,right:e.right||n,bottom:e.bottom||n,left:e.left||n};var r,o,a=ve(t),c=st(a),l=this.viewbox(),u=this.zoom();l.y+=e.top/u,l.x+=e.left/u,l.width-=(e.right+e.left)/u,l.height-=(e.bottom+e.top)/u;var p=st(l);if(a.width<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})},yt.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)}),Za(i.a,1e3)):this.viewbox(t).scale;var n,i},yt.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},yt.prototype._setZoom=function(t,e){var n,i,r,o,a=this._svg,c=this._viewport,l=a.createSVGMatrix(),u=a.createSVGPoint(),p=(i=c.getCTM()).a;return e?(n=z(u,e).matrixTransform(i.inverse()),r=l.translate(n.x,n.y).scale(1/p*t).translate(-n.x,-n.y),o=i.multiply(r)):o=l.scale(t),Hd(this._viewport,o),o},yt.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},yt.prototype.getAbsoluteBBox=function(t){var e,n=this.viewbox();return t.waypoints?e=this.getGraphics(t).getBBox():e=t,{x:e.x*n.scale-n.x*n.scale,y:e.y*n.scale-n.y*n.scale,width:e.width*n.scale,height:e.height*n.scale}},yt.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Rr="data-element-id";function Ge(t){this._elements={},this._eventBus=t}Ge.$inject=["eventBus"],Ge.prototype.add=function(t,e,n){var i=t.id;this._validateId(i),K(e,Rr,i),n&&K(n,Rr,i),this._elements[i]={element:t,gfx:e,secondaryGfx:n}},Ge.prototype.remove=function(t){var e=this._elements,n=t.id||t,i=n&&e[n];i&&(K(i.gfx,Rr,""),i.secondaryGfx&&K(i.secondaryGfx,Rr,""),delete e[n])},Ge.prototype.updateId=function(t,e){this._validateId(e),typeof t=="string"&&(t=this.get(t)),this._eventBus.fire("element.updateId",{element:t,newId:e});var n=this.getGraphics(t),i=this.getGraphics(t,!0);this.remove(t),t.id=e,this.add(t,n,i)},Ge.prototype.updateGraphics=function(t,e,n){var i=t.id||t,r=this._elements[i];return n?r.secondaryGfx=e:r.gfx=e,K(e,Rr,i),e},Ge.prototype.get=function(t){var e;e=typeof t=="string"?t:t&&K(t,Rr);var n=this._elements[e];return n&&n.element},Ge.prototype.filter=function(t){var e=[];return this.forEach(function(n,i){t(n,i)&&e.push(n)}),e},Ge.prototype.find=function(t){for(var e=this._elements,n=Object.keys(e),i=0;i<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 Jl={exports:{}},ts={};ts.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},ts.isExtended=function(t){return t.__refs_collection===!0};var qd=ts;function Wd(t,e,n){var i=qd.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 yi(t,e){if(!(this instanceof yi))return new yi(t,e);t.inverse=e,e.inverse=t,this.props={},this.props[t.name]=t,this.props[e.name]=e}yi.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?Wd(this,e,t):function(n,i,r){var o=i.inverse,a=r[i.name];Object.defineProperty(r,i.name,{configurable:i.configurable,enumerable:i.enumerable,get:function(){return a},set:function(c){if(c!==a){var l=a;a=null,l&&n.unset(l,o,r),a=c,n.set(a,o,r)}}})}(this,e,t)},yi.prototype.ensureRefsCollection=function(t,e){var n=t[e.name];return qd.isExtended(n)||Wd(this,e,t),n},yi.prototype.ensureBound=function(t,e){(function(n,i){return Object.prototype.hasOwnProperty.call(n,i.name||i)})(t,e)||this.bind(t,e)},yi.prototype.unset=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?this.ensureRefsCollection(t,e).remove(n):t[e.name]=void 0)},yi.prototype.set=function(t,e,n){t&&(this.ensureBound(t,e),e.collection?this.ensureRefsCollection(t,e).add(n):t[e.name]=n)};var z0=yi;Jl.exports=z0,Jl.exports.Collection=ts;const Nr=gr(Jl.exports);var Xd=new Nr({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Kd=new Nr({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),Yd=new Nr({name:"attachers",collection:!0},{name:"host"}),Jd=new Nr({name:"outgoing",collection:!0},{name:"source"}),Zd=new Nr({name:"incoming",collection:!0},{name:"target"});function To(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(t){var e=this.label,n=this.labels;!t&&e?n.remove(e):n.add(t,0)}}),Xd.bind(this,"parent"),Kd.bind(this,"labels"),Jd.bind(this,"outgoing"),Zd.bind(this,"incoming")}function Ir(){To.call(this),Xd.bind(this,"children"),Yd.bind(this,"host"),Yd.bind(this,"attachers")}function Qd(){Ir.call(this)}function es(){Ir.call(this),Kd.bind(this,"labelTarget")}function tm(){To.call(this),Jd.bind(this,"source"),Zd.bind(this,"target")}rt(Ir,To),rt(Qd,Ir),rt(es,Ir),rt(tm,To);var $0={connection:tm,shape:Ir,label:es,root:Qd};function Un(){this._uid=12}Un.prototype.createRoot=function(t){return this.create("root",t)},Un.prototype.createLabel=function(t){return this.create("label",t)},Un.prototype.createShape=function(t){return this.create("shape",t)},Un.prototype.createConnection=function(t){return this.create("connection",t)},Un.prototype.create=function(t,e){return(e=z({},e||{})).id||(e.id=t+"_"+this._uid++),function(n,i){var r=$0[n];if(!r)throw new Error("unknown type: <"+n+">");return z(new r,i)}(t,e)};var ns="__fn",G0=Array.prototype.slice;function Be(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Ao(){}function is(t){return t.childNodes[0]}function Zl(t,e,n,i,r){var o=Eo();o.setTranslate(e,n);var a=Eo();a.setRotate(i||0,0,0);var c=Eo();c.setScale(r||1,r||1),_o(t,[o,a,c])}function Oe(t,e,n){var i=Eo();i.setTranslate(e,n),_o(t,i)}function em(t,e){var n=Eo();n.setRotate(e,0,0),_o(t,n)}function Ue(t,e){this._eventBus=t,this._elementRegistry=e}function nm(t,e,n){var i=n||e.firstChild;t!==i&&e.insertBefore(t,i)}Be.prototype.on=function(t,e,n,i){if(t=gt(t)?t:[t],fe(e)&&(i=n,n=e,e=1e3),!ht(e))throw new Error("priority must be a number");var r=n;i&&((r=_e(n,i))[ns]=n[ns]||n);var o=this;t.forEach(function(a){o._addListener(a,{priority:e,callback:r,next:null})})},Be.prototype.once=function(t,e,n,i){var r=this;if(fe(e)&&(i=n,n=e,e=1e3),!ht(e))throw new Error("priority must be a number");function o(){o.__isTomb=!0;var a=n.apply(i,arguments);return r.off(t,o),a}o[ns]=n,this.on(t,e,o)},Be.prototype.off=function(t,e){t=gt(t)?t:[t];var n=this;t.forEach(function(i){n._removeListener(i,e)})},Be.prototype.createEvent=function(t){var e=new Ao;return e.init(t),e},Be.prototype.fire=function(t,e){var n,i,r,o;if(o=G0.call(arguments),typeof t=="object"&&(t=(e=t).type),!t)throw new Error("no event type specified");if(i=this._listeners[t]){n=e instanceof Ao?e:this.createEvent(e),o[0]=n;var a=n.type;t!==a&&(n.type=t);try{r=this._invokeListeners(n,o,i)}finally{t!==a&&(n.type=a)}return r===void 0&&n.defaultPrevented&&(r=!1),r}},Be.prototype.handleError=function(t){return this.fire("error",{error:t})===!1},Be.prototype._destroy=function(){this._listeners={}},Be.prototype._invokeListeners=function(t,e,n){for(var i;n&&!t.cancelBubble;)i=this._invokeListener(t,e,n),n=n.next;return i},Be.prototype._invokeListener=function(t,e,n){var i;if(n.callback.__isTomb)return i;try{i=function(r,o){return r.apply(null,o)}(n.callback,e),i!==void 0&&(t.returnValue=i,t.stopPropagation()),i===!1&&t.preventDefault()}catch(r){if(!this.handleError(r))throw r}return i},Be.prototype._addListener=function(t,e){var n,i=this._getListeners(t);if(i){for(;i;){if(i.priority<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[ns]!==e||(i?i.next=n:this._setListeners(t,n)),i=o,o=n;else this._setListeners(t,null)},Ao.prototype.stopPropagation=function(){this.cancelBubble=!0},Ao.prototype.preventDefault=function(){this.defaultPrevented=!0},Ao.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=is(t);return Ua(e),e},Ue.prototype._createContainer=function(t,e,n,i){var r=ot("g");bt(r).add("djs-group"),n!==void 0?nm(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,kd(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){nm(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){Zt(this._elementRegistry.getGraphics(t).parentNode)};const U0={__depends__:[N0],__init__:["canvas"],canvas:["type",yt],elementRegistry:["type",Ge],elementFactory:["type",Un],eventBus:["type",Be],graphicsFactory:["type",Ue]};function H0(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 zl(e);return n.forEach(function(o){try{r[typeof o=="string"?"get":"invoke"](o)}catch(a){throw a}}),r}function Dr(t,e){this.injector=e=e||function(n){return H0([{config:["value",n=n||{}]},U0].concat(n.modules||[]))}(t),this.get=e.get,this.invoke=e.invoke,this.get("eventBus").fire("diagram.init")}function Ql(){}function im(t,e){this.model=t,this.properties=e}Dr.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Dr.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},Ql.prototype.get=function(t){return this.$model.properties.get(this,t)},Ql.prototype.set=function(t,e){this.$model.properties.set(this,t,e)},im.prototype.createType=function(t){var e=this.model,n=this.properties,i=Object.create(Ql.prototype);L(t.properties,function(a){a.isMany||a.default===void 0||(i[a.name]=a.default)}),n.defineModel(i,e),n.defineDescriptor(i,t);var r=t.ns.name;function o(a){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),L(a,_e(function(c,l){this.set(l,c)},this))}return o.prototype=i,o.hasType=i.$instanceOf=this.model.hasType,n.defineModel(o,e),n.defineDescriptor(o,t),o};var q0={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},rm={String:function(t){return t},Boolean:function(t){return t==="true"},Integer:function(t){return parseInt(t,10)},Real:function(t){return parseFloat(t)}};function tu(t,e){var n=rm[t];return n?n(e):e}function eu(t){return!!q0[t]}function om(t){return!!rm[t]}function Pe(t,e){var n,i,r=t.split(/:/);if(r.length===1)n=t,i=e;else{if(r.length!==2)throw new Error("expected <prefix:localName> or <localName>, got "+t);n=r[1],i=r[0]}return{name:t=(i?i+":":"")+n,prefix:i,localName:n}}function Ze(t){this.ns=t,this.name=t.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function gi(t,e){this.packageMap={},this.typeMap={},this.packages=[],this.properties=e,L(t,_e(this.registerPackage,this))}function am(t,e,n){var i=e[n];if(i in t)throw new Error("package with "+n+" <"+i+"> already defined")}function Br(t){this.model=t}function sm(t,e,n){Object.defineProperty(t,e.name,{enumerable:!e.isReference,writable:!0,value:n,configurable:!0})}function Qe(t){this.properties=new Br(this),this.factory=new im(this,this.properties),this.registry=new gi(t,this.properties),this.typeCache={}}Ze.prototype.build=function(){return Je(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Ze.prototype.addProperty=function(t,e,n){typeof e=="boolean"&&(n=e,e=void 0),this.addNamedProperty(t,n!==!1);var i=this.properties;e!==void 0?i.splice(e,0,t):i.push(t)},Ze.prototype.replaceProperty=function(t,e,n){var i=t.ns,r=this.properties,o=this.propertiesByName,a=t.name!==e.name;if(t.isId){if(!e.isId)throw new Error("property <"+e.ns.name+"> must be id property to refine <"+t.ns.name+">");this.setIdProperty(e,!1)}if(t.isBody){if(!e.isBody)throw new Error("property <"+e.ns.name+"> must be body property to refine <"+t.ns.name+">");this.setBodyProperty(e,!1)}var c=r.indexOf(t);if(c===-1)throw new Error("property <"+i.name+"> not found in property list");r.splice(c,1),this.addProperty(e,n?void 0:c,a),o[i.name]=o[i.localName]=e},Ze.prototype.redefineProperty=function(t,e,n){var i=t.ns.prefix,r=e.split("#"),o=Pe(r[0],i),a=Pe(r[1],o.prefix).name,c=this.propertiesByName[a];if(!c)throw new Error("refined property <"+a+"> not found");this.replaceProperty(c,t,n),delete t.redefines},Ze.prototype.addNamedProperty=function(t,e){var n=t.ns,i=this.propertiesByName;e&&(this.assertNotDefined(t,n.name),this.assertNotDefined(t,n.localName)),i[n.name]=i[n.localName]=t},Ze.prototype.removeNamedProperty=function(t){var e=t.ns,n=this.propertiesByName;delete n[e.name],delete n[e.localName]},Ze.prototype.setBodyProperty=function(t,e){if(e&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+t.ns.name+">)");this.bodyProperty=t},Ze.prototype.setIdProperty=function(t,e){if(e&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+t.ns.name+">)");this.idProperty=t},Ze.prototype.assertNotDefined=function(t,e){var n=t.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+t.definedBy.ns.name+"#"+t.ns.name+"> not allowed without redefines")},Ze.prototype.hasProperty=function(t){return this.propertiesByName[t]},Ze.prototype.addTrait=function(t,e){var n=this.allTypesByName,i=this.allTypes,r=t.name;r in n||(L(t.properties,_e(function(o){o=z({},o,{name:o.ns.localName,inherited:e}),Object.defineProperty(o,"definedBy",{value:t});var a=o.replaces,c=o.redefines;a||c?this.redefineProperty(o,a||c,a):(o.isBody&&this.setBodyProperty(o),o.isId&&this.setIdProperty(o),this.addProperty(o))},this)),i.push(t),n[r]=t)},gi.prototype.getPackage=function(t){return this.packageMap[t]},gi.prototype.getPackages=function(){return this.packages},gi.prototype.registerPackage=function(t){t=z({},t);var e=this.packageMap;am(e,t,"prefix"),am(e,t,"uri"),L(t.types,_e(function(n){this.registerType(n,t)},this)),e[t.uri]=e[t.prefix]=t,this.packages.push(t)},gi.prototype.registerType=function(t,e){var n=Pe((t=z({},t,{superClass:(t.superClass||[]).slice(),extends:(t.extends||[]).slice(),properties:(t.properties||[]).slice(),meta:z(t.meta||{})})).name,e.prefix),i=n.name,r={};L(t.properties,_e(function(o){var a=Pe(o.name,n.prefix),c=a.name;eu(o.type)||(o.type=Pe(o.type,a.prefix).name),z(o,{ns:a,name:c}),r[c]=o},this)),z(t,{ns:n,name:i,propertiesByName:r}),L(t.extends,_e(function(o){var a=this.typeMap[o];a.traits=a.traits||[],a.traits.push(i)},this)),this.definePackage(t,e),this.typeMap[i]=t},gi.prototype.mapTypes=function(t,e,n){var i=eu(t.name)?{name:t.name}:this.typeMap[t.name],r=this;function o(c){return a(c,!0)}function a(c,l){var u=Pe(c,eu(c)?"":t.prefix);r.mapTypes(u,e,l)}if(!i)throw new Error("unknown type <"+t.name+">");L(i.superClass,n?o:a),e(i,!n),L(i.traits,o)},gi.prototype.getEffectiveDescriptor=function(t){var e=Pe(t),n=new Ze(e);this.mapTypes(e,function(r,o){n.addTrait(r,o)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},gi.prototype.definePackage=function(t,e){this.properties.define(t,"$pkg",{value:e})},Br.prototype.set=function(t,e,n){if(!Ie(e)||!e.length)throw new TypeError("property name must be a non-empty string");var i=this.model.getPropertyDescriptor(t,e),r=i&&i.name;n===void 0?i?delete t[r]:delete t.$attrs[e]:i?r in t?t[r]=n:sm(t,i,n):t.$attrs[e]=n},Br.prototype.get=function(t,e){var n=this.model.getPropertyDescriptor(t,e);if(!n)return t.$attrs[e];var i=n.name;return!t[i]&&n.isMany&&sm(t,n,[]),t[i]},Br.prototype.define=function(t,e,n){if(!n.writable){var i=n.value;delete(n=z({},n,{get:function(){return i}})).value}Object.defineProperty(t,e,n)},Br.prototype.defineDescriptor=function(t,e){this.define(t,"$descriptor",{value:e})},Br.prototype.defineModel=function(t,e){this.define(t,"$model",{value:e})},Qe.prototype.create=function(t,e){var n=this.getType(t);if(!n)throw new Error("unknown type <"+t+">");return new n(e)},Qe.prototype.getType=function(t){var e=this.typeCache,n=Ie(t)?t:t.ns.name,i=e[n];return i||(t=this.registry.getEffectiveDescriptor(n),i=e[n]=this.factory.createType(t)),i},Qe.prototype.createAny=function(t,e,n){var i=Pe(t),r={$type:t,$instanceOf:function(a){return a===this.$type}},o={name:t,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:e}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),this.properties.define(r,"$instanceOf",{enumerable:!1,writable:!0}),L(n,function(a,c){Jt(a)&&a.value!==void 0?r[a.name]=a.value:r[c]=a}),r},Qe.prototype.getPackage=function(t){return this.registry.getPackage(t)},Qe.prototype.getPackages=function(){return this.registry.getPackages()},Qe.prototype.getElementDescriptor=function(t){return t.$descriptor},Qe.prototype.hasType=function(t,e){return e===void 0&&(e=t,t=this),e in t.$model.getElementDescriptor(t).allTypesByName},Qe.prototype.getPropertyDescriptor=function(t,e){return this.getElementDescriptor(t).propertiesByName[e]},Qe.prototype.getTypeDescriptor=function(t){return this.registry.typeMap[t]};var W0=String.fromCharCode,X0=Object.prototype.hasOwnProperty,K0=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,ko={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Y0(t,e,n,i){return i?X0.call(ko,i)?ko[i]:"&"+i+";":W0(e||parseInt(n,16))}function Wi(t){return t.length>3&&t.indexOf("&")!==-1?t.replace(K0,Y0):t}Object.keys(ko).forEach(function(t){ko[t.toUpperCase()]=ko[t]});var cm="xsi:type",lm="non-whitespace outside of root node";function Or(t){return new Error(t)}function um(t){return"missing namespace for prefix <"+t+">"}function rs(t){return{get:t,enumerable:!0}}function J0(t){var e,n={};for(e in t)n[e]=t[e];return n}function nu(t){return t+"$uri"}function pm(){return{line:0,column:0}}function Z0(t){throw t}function hm(t){if(!this)return new hm(t);var e,n,i,r,o,a,c,l,u,p=t&&t.proxy,d=Z0,y=pm,f=!1,v=!1,g=null,b=!1;function E(w){w instanceof Error||(w=Or(w)),g=w,d(w,y)}function S(w){o&&(w instanceof Error||(w=Or(w)),o(w,y))}this.on=function(w,C){if(typeof C!="function")throw Or("required args <name, cb>");switch(w){case"openTag":n=C;break;case"text":e=C;break;case"closeTag":i=C;break;case"error":d=C;break;case"warn":o=C;break;case"cdata":r=C;break;case"attention":l=C;break;case"question":c=C;break;case"comment":a=C;break;default:throw Or("unsupported event: "+w)}return this},this.ns=function(w){if(w===void 0&&(w={}),typeof w!="object")throw Or("required args <nsMap={}>");var C,B={};for(C in w)B[C]=w[C];return B["http://www.w3.org/2001/XMLSchema-instance"]="xsi",v=!0,u=B,this},this.parse=function(w){if(typeof w!="string")throw Or("required args <xml=string>");return g=null,function(C){var B,s,h,m,_,T,M,I,$,P,x,N=v?[]:null,j=v?function(Vt){var qt,Et,oe={};for(qt in Vt)oe[Et=Vt[qt]]=Et,oe[nu(Et)]=qt;return oe}(u):null,G=[],W=0,tt=!1,it=!1,at=0,H=0,q="",jt=0;function Ht(){if(x!==null)return x;var Vt,qt,Et,oe,se,Mt,de,_t,Te,pt,It,ii=v&&j.xmlns,ri=v&&f?[]:null,Yt=jt,Ae=q,Ln=Ae.length,oi={},Ra={};t:for(;Yt<Ln;Yt++)if(Te=!1,!((pt=Ae.charCodeAt(Yt))===32||pt<14&&pt>8)){for((pt<65||pt>122||pt>90&&pt<97)&&pt!==95&&pt!==58&&(S("illegal first char attribute name"),Te=!0),It=Yt+1;It<Ln;It++)if(!((pt=Ae.charCodeAt(It))>96&&pt<123||pt>64&&pt<91||pt>47&&pt<59||pt===46||pt===45||pt===95)){if(pt===32||pt<14&&pt>8){S("missing attribute value"),Yt=It;continue t}if(pt===61)break;S("illegal attribute name char"),Te=!0}if((_t=Ae.substring(Yt,It))==="xmlns:xmlns"&&(S("illegal declaration of xmlns"),Te=!0),(pt=Ae.charCodeAt(It+1))===34)(It=Ae.indexOf('"',Yt=It+2))===-1&&(It=Ae.indexOf("'",Yt))!==-1&&(S("attribute value quote missmatch"),Te=!0);else if(pt===39)(It=Ae.indexOf("'",Yt=It+2))===-1&&(It=Ae.indexOf('"',Yt))!==-1&&(S("attribute value quote missmatch"),Te=!0);else for(S("missing attribute value quotes"),Te=!0,It+=1;It<Ln&&!((pt=Ae.charCodeAt(It+1))===32||pt<14&&pt>8);It++);for(It===-1&&(S("missing closing quotes"),It=Ln,Te=!0),Te||(Mt=Ae.substring(Yt,It)),Yt=It;It+1<Ln&&!((pt=Ae.charCodeAt(It+1))===32||pt<14&&pt>8);It++)Yt===It&&(S("illegal character after attribute end"),Te=!0);if(Yt=It+1,!Te)if(_t in Ra)S("attribute <"+_t+"> already defined");else if(Ra[_t]=!0,v)if(f){if((se=_t==="xmlns"?"xmlns":_t.charCodeAt(0)===120&&_t.substr(0,6)==="xmlns:"?_t.substr(6):null)!==null){if(Vt=Wi(Mt),qt=nu(se),!(de=u[Vt])){if(se==="xmlns"||qt in j&&j[qt]!==Vt)do de="ns"+W++;while(j[de]!==void 0);else de=se;u[Vt]=de}j[se]!==de&&(oe||(j=J0(j),oe=!0),j[se]=de,se==="xmlns"&&(j[nu(de)]=Vt,ii=de),j[qt]=Vt),oi[_t]=Mt;continue}ri.push(_t,Mt)}else(pt=_t.indexOf(":"))!==-1?(Et=j[_t.substring(0,pt)])?((_t=ii===Et?_t.substr(pt+1):Et+_t.substr(pt))===cm&&((pt=Mt.indexOf(":"))!==-1?(Et=Mt.substring(0,pt),Mt=(Et=j[Et]||Et)+Mt.substring(pt)):Mt=ii+":"+Mt),oi[_t]=Mt):S(um(_t.substring(0,pt))):oi[_t]=Mt;else oi[_t]=Mt}if(f)for(Yt=0,Ln=ri.length;Yt<Ln;Yt++){if(_t=ri[Yt++],Mt=ri[Yt],(pt=_t.indexOf(":"))!==-1){if(!(Et=j[_t.substring(0,pt)])){S(um(_t.substring(0,pt)));continue}(_t=ii===Et?_t.substr(pt+1):Et+_t.substr(pt))===cm&&((pt=Mt.indexOf(":"))!==-1?(Et=Mt.substring(0,pt),Mt=(Et=j[Et]||Et)+Mt.substring(pt)):Mt=ii+":"+Mt)}oi[_t]=Mt}return x=oi}function he(){for(var Vt,qt,Et=/(\r\n|\r|\n)/g,oe=0,se=0,Mt=0,de=H;at>=Mt&&(Vt=Et.exec(C))&&!((de=Vt[0].length+Vt.index)>at);)oe+=1,Mt=de;return at==-1?(se=de,qt=C.substring(H)):H===0?qt=C.substring(H,at):(se=at-Mt,qt=H==-1?C.substring(at):C.substring(at,H+1)),{data:qt,line:oe,column:se}}for(y=he,p&&(P=Object.create({},{name:rs(function(){return I}),originalName:rs(function(){return $}),attrs:rs(Ht),ns:rs(function(){return j})}));H!==-1;){if((at=C.charCodeAt(H)===60?H:C.indexOf("<",H))===-1)return G.length?E("unexpected end of file"):H===0?E("missing start tag"):void(H<C.length&&C.substring(H).trim()&&S(lm));if(H!==at){if(G.length){if(e&&(e(C.substring(H,at),Wi,y),b))return}else if(C.substring(H,at).trim()&&(S(lm),b))return}if((_=C.charCodeAt(at+1))===33){if((m=C.charCodeAt(at+2))===91&&C.substr(at+3,6)==="CDATA["){if((H=C.indexOf("]]>",at))===-1)return E("unclosed cdata");if(r&&(r(C.substring(at+9,H),y),b))return;H+=3;continue}if(m===45&&C.charCodeAt(at+3)===45){if((H=C.indexOf("-->",at))===-1)return E("unclosed comment");if(a&&(a(C.substring(at+4,H),Wi,y),b))return;H+=3;continue}}if(_!==63){for(s=at+1;;s++){if(T=C.charCodeAt(s),isNaN(T))return H=-1,E("unclosed tag");if(T===34)s=(m=C.indexOf('"',s+1))!==-1?m:s;else if(T===39)s=(m=C.indexOf("'",s+1))!==-1?m:s;else if(T===62){H=s;break}}if(_!==33){if(x={},_===47){if(tt=!1,it=!0,!G.length)return E("missing open tag");if(s=I=G.pop(),m=at+2+s.length,C.substring(at+2,m)!==s)return E("closing tag mismatch");for(;m<H;m++)if(!((_=C.charCodeAt(m))===32||_>8&&_<14))return E("close tag")}else{if(C.charCodeAt(H-1)===47?(s=I=C.substring(at+1,H-1),tt=!0,it=!0):(s=I=C.substring(at+1,H),tt=!0,it=!1),!(_>96&&_<123||_>64&&_<91||_===95||_===58))return E("illegal first char nodeName");for(m=1,h=s.length;m<h;m++)if(!((_=s.charCodeAt(m))>96&&_<123||_>64&&_<91||_>47&&_<59||_===45||_===95||_==46)){if(_===32||_<14&&_>8){I=s.substring(0,m),x=null;break}return E("invalid nodeName")}it||G.push(I)}if(v){if(B=j,tt&&(it||N.push(B),x===null&&(f=s.indexOf("xmlns",m)!==-1)&&(jt=m,q=s,Ht(),f=!1)),$=I,(_=I.indexOf(":"))!==-1){if(!(M=j[I.substring(0,_)]))return E("missing namespace on <"+$+">");I=I.substr(_+1)}else M=j.xmlns;M&&(I=M+":"+I)}if(tt&&(jt=m,q=s,n&&(p?n(P,Wi,it,y):n(I,Ht,Wi,it,y),b)))return;if(it){if(i&&(i(p?P:I,Wi,tt,y),b))return;v&&(j=tt?B:N.pop())}H+=1}else{if(l&&(l(C.substring(at,H+1),Wi,y),b))return;H+=1}}else{if((H=C.indexOf("?>",at))===-1)return E("unclosed question");if(c&&(c(C.substring(at,H+2),y),b))return;H+=2}}}(w),y=pm,b=!1,g},this.stop=function(){b=!0}}function dm(t){return t.xml&&t.xml.tagAlias==="lowerCase"}var Q0={xsi:"http://www.w3.org/2001/XMLSchema-instance",xml:"http://www.w3.org/XML/1998/namespace"},os="xsi:type";function mm(t){return t.xml&&t.xml.serialize}function fm(t){return mm(t)===os}function vm(t,e){return dm(e)?t.prefix+":"+((n=t.localName).charAt(0).toUpperCase()+n.slice(1)):t.name;var n}function bi(t){return new Error(t)}function Hn(t){return t.$descriptor}function tx(t){z(this,t),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw bi("expected element");var n,i=this.elementsById,r=Hn(e).idProperty;if(r&&(n=e.get(r.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(n))throw new Error("illegal ID <"+n+">");if(i[n])throw bi("duplicate ID <"+n+">");i[n]=e}},this.addWarning=function(e){this.warnings.push(e)}}function Po(){}function iu(){}function Lr(){}function Mo(t,e){this.property=t,this.context=e}function ru(t,e){this.element=e,this.propertyDesc=t}function as(){}function we(t,e,n){this.model=t,this.type=t.getType(e),this.context=n}function ou(t,e,n){we.call(this,t,e,n)}function jr(t,e,n){this.model=t,this.context=n}function au(t){t instanceof Qe&&(t={model:t}),z(this,{lax:!1},t)}Po.prototype.handleEnd=function(){},Po.prototype.handleText=function(){},Po.prototype.handleNode=function(){},iu.prototype=Object.create(Po.prototype),iu.prototype.handleNode=function(){return this},Lr.prototype=Object.create(Po.prototype),Lr.prototype.handleText=function(t){this.body=(this.body||"")+t},Mo.prototype=Object.create(Lr.prototype),Mo.prototype.handleNode=function(t){if(this.element)throw bi("expected no sub nodes");return this.element=this.createReference(t),this},Mo.prototype.handleEnd=function(){this.element.id=this.body},Mo.prototype.createReference=function(t){return{property:this.property.ns.name,id:""}},ru.prototype=Object.create(Lr.prototype),ru.prototype.handleEnd=function(){var t=this.body||"",e=this.element,n=this.propertyDesc;t=tu(n.type,t),n.isMany?e.get(n.name).push(t):e.set(n.name,t)},as.prototype=Object.create(Lr.prototype),as.prototype.handleNode=function(t){var e=this,n=this.element;return n?e=this.handleChild(t):(n=this.element=this.createElement(t),this.context.addElement(n)),e},we.prototype=Object.create(as.prototype),we.prototype.addReference=function(t){this.context.addReference(t)},we.prototype.handleText=function(t){if(!Hn(this.element).bodyProperty)throw bi("unexpected body text <"+t+">");Lr.prototype.handleText.call(this,t)},we.prototype.handleEnd=function(){var t=this.body,e=this.element,n=Hn(e).bodyProperty;n&&t!==void 0&&(t=tu(n.type,t),e.set(n.name,t))},we.prototype.createElement=function(t){var e,n=t.attributes,i=this.type,r=Hn(i),o=this.context,a=new i({}),c=this.model;return L(n,function(l,u){var p=r.propertiesByName[u];p&&p.isReference?p.isMany?L(l.split(" "),function(d){o.addReference({element:a,property:p.ns.name,id:d})}):o.addReference({element:a,property:p.ns.name,id:l}):(p?l=tu(p.type,l):u!=="xmlns"&&(e=Pe(u,r.ns.prefix),c.getPackage(e.prefix)&&o.addWarning({message:"unknown attribute <"+u+">",element:a,property:u,value:l})),a.set(u,l))}),a},we.prototype.getPropertyForNode=function(t){var e,n,i=Pe(t.name),r=this.type,o=this.model,a=Hn(r),c=i.name,l=a.propertiesByName[c];if(l&&!l.isAttr)return fm(l)&&(e=t.attributes[os])?(e=function(p,d){var y=Pe(p);return function(f,v){var g=f.name,b=f.localName,E=v.xml&&v.xml.typePrefix;return E&&b.indexOf(E)===0?f.prefix+":"+b.slice(E.length):g}(y,d.getPackage(y.prefix))}(e,o),z({},l,{effectiveType:Hn(n=o.getType(e)).name})):l;var u=o.getPackage(i.prefix);if(u){if(e=vm(i,u),n=o.getType(e),l=kt(a.properties,function(p){return!p.isVirtual&&!p.isReference&&!p.isAttribute&&n.hasType(p.type)}))return z({},l,{effectiveType:Hn(n).name})}else if(l=kt(a.properties,function(p){return!p.isReference&&!p.isAttribute&&p.type==="Element"}))return l;throw bi("unrecognized element <"+i.name+">")},we.prototype.toString=function(){return"ElementDescriptor["+Hn(this.type).name+"]"},we.prototype.valueHandler=function(t,e){return new ru(t,e)},we.prototype.referenceHandler=function(t){return new Mo(t,this.context)},we.prototype.handler=function(t){return t==="Element"?new jr(this.model,t,this.context):new we(this.model,t,this.context)},we.prototype.handleChild=function(t){var e,n,i,r;if(e=this.getPropertyForNode(t),i=this.element,om(n=e.effectiveType||e.type))return this.valueHandler(e,i);var o=(r=e.isReference?this.referenceHandler(e).handleNode(t):this.handler(n).handleNode(t)).element;return o!==void 0&&(e.isMany?i.get(e.name).push(o):i.set(e.name,o),e.isReference?(z(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},ou.prototype=Object.create(we.prototype),ou.prototype.createElement=function(t){var e=t.name,n=Pe(e),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&vm(n,o)||e;if(!r.hasType(a))throw bi("unexpected element <"+t.originalName+">");return we.prototype.createElement.call(this,t)},jr.prototype=Object.create(as.prototype),jr.prototype.createElement=function(t){var e=t.name,n=Pe(e).prefix,i=t.ns[n+"$uri"],r=t.attributes;return this.model.createAny(e,i,r)},jr.prototype.handleChild=function(t){var e=new jr(this.model,"Element",this.context).handleNode(t),n=this.element,i=e.element;return i!==void 0&&((n.$children=n.$children||[]).push(i),i.$parent=n),e},jr.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},au.prototype.fromXML=function(t,e,n){var i=e.rootHandler;e instanceof we?(i=e,e={}):typeof e=="string"?(i=this.handler(e),e={}):typeof i=="string"&&(i=this.handler(i));var r=this.model,o=this.lax,a=new tx(z({},e,{rootHandler:i})),c=new hm({proxy:!0}),l=function(){var b=[];return Object.defineProperty(b,"peek",{value:function(){return this[this.length-1]}}),b}();function u(b,E,S){var w=E(),C=w.line,B=w.column,s=w.data;s.charAt(0)==="<"&&s.indexOf(" ")!==-1&&(s=s.slice(0,s.indexOf(" "))+">");var h="unparsable content "+(s?s+" ":"")+`detected
- line: `+C+`
- column: `+B+`
- nested error: `+b.message;if(S)return a.addWarning({message:h,error:b}),!0;throw bi(h)}function p(b,E){return u(b,E,!0)}i.context=a,l.push(i);var d=/^<\?xml /i,y=/ encoding="([^"]+)"/i,f=/^utf-8$/i;function v(b,E){try{l.peek().handleText(b)}catch(S){p(S,E)}}var g=r.getPackages().reduce(function(b,E){return b[E.uri]=E.prefix,b},{"http://www.w3.org/XML/1998/namespace":"xml"});return c.ns(g).on("openTag",function(b,E,S,w){var C=b.attrs||{},B=Object.keys(C).reduce(function(s,h){var m=E(C[h]);return s[h]=m,s},{});(function(s,h){var m=l.peek();try{l.push(m.handleNode(s))}catch(_){u(_,h,o)&&l.push(new iu)}})({name:b.name,originalName:b.originalName,attributes:B,ns:b.ns},w)}).on("question",function(b){if(d.test(b)){var E=y.exec(b),S=E&&E[1];S&&!f.test(S)&&a.addWarning({message:"unsupported document encoding <"+S+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",v).on("text",function(b,E,S){(function(w,C){w.trim()&&v(w,C)})(E(b),S)}).on("error",u).on("warn",p),new Promise(function(b,E){var S;try{c.parse(t),function(){var h,m,_=a.elementsById,T=a.references;for(h=0;m=T[h];h++){var M=m.element,I=_[m.id],$=Hn(M).propertiesByName[m.property];if(I||a.addWarning({message:"unresolved reference <"+m.id+">",element:m.element,property:m.property,value:m.id}),$.isMany){var P=M.get($.name),x=P.indexOf(m);x===-1&&(x=P.length),I?P[x]=I:P.splice(x,1)}else M.set($.name,I)}}()}catch(h){S=h}var w=i.element;S||w||(S=bi("failed to parse document as <"+i.type.$descriptor.name+">"));var C=a.warnings,B=a.references,s=a.elementsById;return S?(S.warnings=C,E(S)):b({rootElement:w,elementsById:s,references:B,warnings:C})})},au.prototype.handler=function(t){return new ou(this.model,t)};var ex=/<|>|'|"|&|\n\r|\n/g,ym=/<|>|&/g;function nx(t){var e={},n={},i={},r=[],o=[];this.byUri=function(a){return n[a]||t&&t.byUri(a)},this.add=function(a,c){n[a.uri]=a,c?r.push(a):o.push(a),this.mapPrefix(a.prefix,a.uri)},this.uriByPrefix=function(a){return e[a||"xmlns"]},this.mapPrefix=function(a,c){e[a||"xmlns"]=c},this.getNSKey=function(a){return a.prefix!==void 0?a.uri+"|"+a.prefix:a.uri},this.logUsed=function(a){var c=a.uri,l=this.getNSKey(a);i[l]=this.byUri(c),t&&t.logUsed(a)},this.getUsed=function(a){var c=this;return[].concat(r,o).filter(function(l){var u=c.getNSKey(l);return i[u]})}}function ix(t,e){return dm(e)?(n=t).charAt(0).toLowerCase()+n.slice(1):t;var n}function gm(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}function bm(t){return Ie(t)?t:(t.prefix?t.prefix+":":"")+t.localName}var rx={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},ox={"<":"lt",">":"gt","&":"amp"};function xm(t,e,n){return(t=Ie(t)?t:""+t).replace(e,function(i){return"&"+n[i]+";"})}function su(t){this.tagName=t}function Xi(){}function cu(t){this.tagName=t}function zt(t,e){this.body=[],this.attrs=[],this.parent=t,this.propertyDescriptor=e}function ss(t,e){zt.call(this,t,e)}function ax(){this.value="",this.write=function(t){this.value+=t}}function sx(t,e){var n=[""];this.append=function(i){return t.write(i),this},this.appendNewLine=function(){return e&&t.write(`
- `),this},this.appendIndent=function(){return e&&t.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}function cx(t){return t=z({format:!1,preamble:!0},t||{}),{toXML:function(e,n){var i=n||new ax,r=new sx(i,t.format);if(t.preamble&&r.append(`<?xml version="1.0" encoding="UTF-8"?>
- `),new zt().build(e).serializeTo(r),!n)return i.value}}}function cs(t,e){Qe.call(this,t,e)}su.prototype.build=function(t){return this.element=t,this},su.prototype.serializeTo=function(t){t.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Xi.prototype.serializeValue=Xi.prototype.serializeTo=function(t){t.append(this.escape?xm(this.value,ym,ox):this.value)},Xi.prototype.build=function(t,e){return this.value=e,t.type==="String"&&e.search(ym)!==-1&&(this.escape=!0),this},gm(cu,Xi),cu.prototype.serializeTo=function(t){t.appendIndent().append("<"+this.tagName+">"),this.serializeValue(t),t.append("</"+this.tagName+">").appendNewLine()},zt.prototype.build=function(t){this.element=t;var e,n,i=t.$descriptor,r=this.propertyDescriptor,o=i.isGeneric;return e=o?this.parseGeneric(t):this.parseNsAttributes(t),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),o||(n=function(a){return mt(a.$descriptor.properties,function(c){var l=c.name;if(c.isVirtual||!Cn(a,l))return!1;var u=a[l];return u!==c.default&&u!==null&&(!c.isMany||u.length)})}(t),this.parseAttributes(mt(n,function(a){return a.isAttr})),this.parseContainments(function(a){return mt(a,function(c){return!c.isAttr})}(n))),this.parseGenericAttributes(t,e),this},zt.prototype.nsTagName=function(t){return function(e,n){return n.isGeneric?z({localName:n.ns.localName},e):z({localName:ix(n.ns.localName,n.$pkg)},e)}(this.logNamespaceUsed(t.ns),t)},zt.prototype.nsPropertyTagName=function(t){return function(e,n){return z({localName:n.ns.localName},e)}(this.logNamespaceUsed(t.ns),t)},zt.prototype.isLocalNs=function(t){return t.uri===this.ns.uri},zt.prototype.nsAttributeName=function(t){var e;if(e=Ie(t)?Pe(t):t.ns,t.inherited)return{localName:e.localName};var n=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:e.localName}:z({localName:e.localName},n)},zt.prototype.parseGeneric=function(t){var e=this,n=this.body,i=[];return L(t,function(r,o){o==="$body"?n.push(new Xi().build({type:"String"},r)):o==="$children"?L(r,function(a){n.push(new zt(e).build(a))}):o.indexOf("$")!==0&&e.parseNsAttribute(t,o,r)&&i.push({name:o,value:r})}),i},zt.prototype.parseNsAttribute=function(t,e,n){var i,r=t.$model,o=Pe(e);if(o.prefix==="xmlns"&&(i={prefix:o.localName,uri:n}),o.prefix||o.localName!=="xmlns"||(i={uri:n}),!i)return{name:e,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var a=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(a)}},zt.prototype.parseNsAttributes=function(t,e){var n=this,i=t.$attrs,r=[];return L(i,function(o,a){var c=n.parseNsAttribute(t,a,o);c&&r.push(c)}),r},zt.prototype.parseGenericAttributes=function(t,e){var n=this;L(e,function(i){if(i.name!==os)try{n.addAttribute(n.nsAttributeName(i.name),i.value)}catch{}})},zt.prototype.parseContainments=function(t){var e=this,n=this.body,i=this.element;L(t,function(r){var o=i.get(r.name),a=r.isReference;if(r.isMany||(o=[o]),r.isBody)n.push(new Xi().build(r,o[0]));else if(om(r.type))L(o,function(u){n.push(new cu(e.addTagName(e.nsPropertyTagName(r))).build(r,u))});else if(a)L(o,function(u){n.push(new su(e.addTagName(e.nsPropertyTagName(r))).build(u))});else{var c=fm(r),l=function(u){return mm(u)==="property"}(r);L(o,function(u){var p;p=c?new ss(e,r):l?new zt(e,r):new zt(e),n.push(p.build(u))})}})},zt.prototype.getNamespaces=function(t){var e,n=this.namespaces,i=this.parent;return n||(e=i&&i.getNamespaces(),t||!e?this.namespaces=n=new nx(e):n=e),n},zt.prototype.logNamespace=function(t,e,n){var i=this.getNamespaces(n),r=t.uri,o=t.prefix;return i.byUri(r)&&!n||i.add(t,e),i.mapPrefix(o,r),t},zt.prototype.logNamespaceUsed=function(t,e){var n,i,r,o=this.element.$model,a=this.getNamespaces(e),c=t.prefix,l=t.uri;if(!c&&!l)return{localName:t.localName};if(r=Q0[c]||o&&(o.getPackage(c)||{}).uri,!(l=l||r||a.uriByPrefix(c)))throw new Error("no namespace uri given for prefix <"+c+">");if(!(t=a.byUri(l))){for(n=c,i=1;a.uriByPrefix(n);)n=c+"_"+i++;t=this.logNamespace({prefix:n,uri:l},r===l)}return c&&a.mapPrefix(c,l),t},zt.prototype.parseAttributes=function(t){var e=this,n=this.element;L(t,function(i){var r=n.get(i.name);if(i.isReference)if(i.isMany){var o=[];L(r,function(a){o.push(a.id)}),r=o.join(" ")}else r=r.id;e.addAttribute(e.nsAttributeName(i),r)})},zt.prototype.addTagName=function(t){var e=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(e),bm(t)},zt.prototype.addAttribute=function(t,e){var n=this.attrs;Ie(e)&&(e=xm(e,ex,rx));var i=_l(n,function(o){return o.name.localName===t.localName&&o.name.uri===t.uri&&o.name.prefix===t.prefix}),r={name:t,value:e};i!==-1?n.splice(i,1,r):n.push(r)},zt.prototype.serializeAttributes=function(t){var e=this.attrs,n=this.namespaces;n&&(e=function(i){return i.getUsed().filter(function(r){return r.prefix!=="xml"}).map(function(r){return{name:"xmlns"+(r.prefix?":"+r.prefix:""),value:r.uri}})}(n).concat(e)),L(e,function(i){t.append(" ").append(bm(i.name)).append('="').append(i.value).append('"')})},zt.prototype.serializeTo=function(t){var e=this.body[0],n=e&&e.constructor!==Xi;t.appendIndent().append("<"+this.tagName),this.serializeAttributes(t),t.append(e?">":" />"),e&&(n&&t.appendNewLine().indent(),L(this.body,function(i){i.serializeTo(t)}),n&&t.unindent().appendIndent(),t.append("</"+this.tagName+">")),t.appendNewLine()},gm(ss,zt),ss.prototype.parseNsAttributes=function(t){var e=zt.prototype.parseNsAttributes.call(this,t),n=t.$descriptor;if(n.name===this.propertyDescriptor.type)return e;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=t.$model.getPackage(i.uri),o=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(os),(i.prefix?i.prefix+":":"")+o+n.ns.localName),e},ss.prototype.isLocalNs=function(t){return t.uri===(this.typeNs||this.ns).uri},cs.prototype=Object.create(Qe.prototype),cs.prototype.fromXML=function(t,e,n){Ie(e)||(n=e,e="bpmn:Definitions");var i=new au(z({model:this,lax:!0},n)),r=i.handler(e);return i.fromXML(t,r)},cs.prototype.toXML=function(t,e){var n=new cx(e);return new Promise(function(i,r){try{return i({xml:n.toXML(t)})}catch(o){return r(o)}})};var lx={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",prefix:"bpmn",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"Operation",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"inMessageRef",type:"Message",isReference:!0},{name:"outMessageRef",type:"Message",isReference:!0},{name:"errorRef",type:"Error",isMany:!0,isReference:!0},{name:"implementationRef",isAttr:!0,type:"String"}]},{name:"EndPoint",superClass:["RootElement"]},{name:"Auditing",superClass:["BaseElement"]},{name:"GlobalTask",superClass:["CallableElement"],properties:[{name:"resources",type:"ResourceRole",isMany:!0}]},{name:"Monitoring",superClass:["BaseElement"]},{name:"Performer",superClass:["ResourceRole"]},{name:"Process",superClass:["FlowElementsContainer","CallableElement"],properties:[{name:"processType",type:"ProcessType",isAttr:!0},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"properties",type:"Property",isMany:!0},{name:"laneSets",isMany:!0,replaces:"FlowElementsContainer#laneSets",type:"LaneSet"},{name:"flowElements",isMany:!0,replaces:"FlowElementsContainer#flowElements",type:"FlowElement"},{name:"artifacts",type:"Artifact",isMany:!0},{name:"resources",type:"ResourceRole",isMany:!0},{name:"correlationSubscriptions",type:"CorrelationSubscription",isMany:!0},{name:"supports",type:"Process",isMany:!0,isReference:!0},{name:"definitionalCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"isExecutable",isAttr:!0,type:"Boolean"}]},{name:"LaneSet",superClass:["BaseElement"],properties:[{name:"lanes",type:"Lane",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Lane",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"partitionElementRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"partitionElement",type:"BaseElement"},{name:"flowNodeRef",type:"FlowNode",isMany:!0,isReference:!0},{name:"childLaneSet",type:"LaneSet",xml:{serialize:"xsi:type"}}]},{name:"GlobalManualTask",superClass:["GlobalTask"]},{name:"ManualTask",superClass:["Task"]},{name:"UserTask",superClass:["Task"],properties:[{name:"renderings",type:"Rendering",isMany:!0},{name:"implementation",isAttr:!0,type:"String"}]},{name:"Rendering",superClass:["BaseElement"]},{name:"HumanPerformer",superClass:["Performer"]},{name:"PotentialOwner",superClass:["HumanPerformer"]},{name:"GlobalUserTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"renderings",type:"Rendering",isMany:!0}]},{name:"Gateway",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"gatewayDirection",type:"GatewayDirection",default:"Unspecified",isAttr:!0}]},{name:"EventBasedGateway",superClass:["Gateway"],properties:[{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"eventGatewayType",type:"EventBasedGatewayType",isAttr:!0,default:"Exclusive"}]},{name:"ComplexGateway",superClass:["Gateway"],properties:[{name:"activationCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ExclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"InclusiveGateway",superClass:["Gateway"],properties:[{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0}]},{name:"ParallelGateway",superClass:["Gateway"]},{name:"RootElement",isAbstract:!0,superClass:["BaseElement"]},{name:"Relationship",superClass:["BaseElement"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"direction",type:"RelationshipDirection",isAttr:!0},{name:"source",isMany:!0,isReference:!0,type:"Element"},{name:"target",isMany:!0,isReference:!0,type:"Element"}]},{name:"BaseElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,type:"String",isId:!0},{name:"documentation",type:"Documentation",isMany:!0},{name:"extensionDefinitions",type:"ExtensionDefinition",isMany:!0,isReference:!0},{name:"extensionElements",type:"ExtensionElements"}]},{name:"Extension",properties:[{name:"mustUnderstand",default:!1,isAttr:!0,type:"Boolean"},{name:"definition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"extensionAttributeDefinitions",type:"ExtensionAttributeDefinition",isMany:!0}]},{name:"ExtensionAttributeDefinition",properties:[{name:"name",isAttr:!0,type:"String"},{name:"type",isAttr:!0,type:"String"},{name:"isReference",default:!1,isAttr:!0,type:"Boolean"},{name:"extensionDefinition",type:"ExtensionDefinition",isAttr:!0,isReference:!0}]},{name:"ExtensionElements",properties:[{name:"valueRef",isAttr:!0,isReference:!0,type:"Element"},{name:"values",type:"Element",isMany:!0},{name:"extensionAttributeDefinition",type:"ExtensionAttributeDefinition",isAttr:!0,isReference:!0}]},{name:"Documentation",superClass:["BaseElement"],properties:[{name:"text",type:"String",isBody:!0},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Event",isAbstract:!0,superClass:["FlowNode","InteractionNode"],properties:[{name:"properties",type:"Property",isMany:!0}]},{name:"IntermediateCatchEvent",superClass:["CatchEvent"]},{name:"IntermediateThrowEvent",superClass:["ThrowEvent"]},{name:"EndEvent",superClass:["ThrowEvent"]},{name:"StartEvent",superClass:["CatchEvent"],properties:[{name:"isInterrupting",default:!0,isAttr:!0,type:"Boolean"}]},{name:"ThrowEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"inputSet",type:"InputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"CatchEvent",isAbstract:!0,superClass:["Event"],properties:[{name:"parallelMultiple",isAttr:!0,type:"Boolean",default:!1},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"outputSet",type:"OutputSet"},{name:"eventDefinitions",type:"EventDefinition",isMany:!0},{name:"eventDefinitionRef",type:"EventDefinition",isMany:!0,isReference:!0}]},{name:"BoundaryEvent",superClass:["CatchEvent"],properties:[{name:"cancelActivity",default:!0,isAttr:!0,type:"Boolean"},{name:"attachedToRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"EventDefinition",isAbstract:!0,superClass:["RootElement"]},{name:"CancelEventDefinition",superClass:["EventDefinition"]},{name:"ErrorEventDefinition",superClass:["EventDefinition"],properties:[{name:"errorRef",type:"Error",isAttr:!0,isReference:!0}]},{name:"TerminateEventDefinition",superClass:["EventDefinition"]},{name:"EscalationEventDefinition",superClass:["EventDefinition"],properties:[{name:"escalationRef",type:"Escalation",isAttr:!0,isReference:!0}]},{name:"Escalation",properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"escalationCode",isAttr:!0,type:"String"}],superClass:["RootElement"]},{name:"CompensateEventDefinition",superClass:["EventDefinition"],properties:[{name:"waitForCompletion",isAttr:!0,type:"Boolean",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}},{name:"assignment",type:"Assignment",isMany:!0}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"DataOutput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"outputSetRef",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"InputSet",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"dataInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"optionalInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"whileExecutingInputRefs",type:"DataInput",isMany:!0,isReference:!0},{name:"outputSetRefs",type:"OutputSet",isMany:!0,isReference:!0}]},{name:"OutputSet",superClass:["BaseElement"],properties:[{name:"dataOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"inputSetRefs",type:"InputSet",isMany:!0,isReference:!0},{name:"optionalOutputRefs",type:"DataOutput",isMany:!0,isReference:!0},{name:"whileExecutingOutputRefs",type:"DataOutput",isMany:!0,isReference:!0}]},{name:"Property",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"DataInputAssociation",superClass:["DataAssociation"]},{name:"DataOutputAssociation",superClass:["DataAssociation"]},{name:"InputOutputSpecification",superClass:["BaseElement"],properties:[{name:"dataInputs",type:"DataInput",isMany:!0},{name:"dataOutputs",type:"DataOutput",isMany:!0},{name:"inputSets",type:"InputSet",isMany:!0},{name:"outputSets",type:"OutputSet",isMany:!0}]},{name:"DataObject",superClass:["FlowElement","ItemAwareElement"],properties:[{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"}]},{name:"InputOutputBinding",properties:[{name:"inputDataRef",type:"InputSet",isAttr:!0,isReference:!0},{name:"outputDataRef",type:"OutputSet",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"Assignment",superClass:["BaseElement"],properties:[{name:"from",type:"Expression",xml:{serialize:"xsi:type"}},{name:"to",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"DataStore",superClass:["RootElement","ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"capacity",isAttr:!0,type:"Integer"},{name:"isUnlimited",default:!0,isAttr:!0,type:"Boolean"}]},{name:"DataStoreReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataStoreRef",type:"DataStore",isAttr:!0,isReference:!0}]},{name:"DataObjectReference",superClass:["ItemAwareElement","FlowElement"],properties:[{name:"dataObjectRef",type:"DataObject",isAttr:!0,isReference:!0}]},{name:"ConversationLink",superClass:["BaseElement"],properties:[{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ConversationAssociation",superClass:["BaseElement"],properties:[{name:"innerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0},{name:"outerConversationNodeRef",type:"ConversationNode",isAttr:!0,isReference:!0}]},{name:"CallConversation",superClass:["ConversationNode"],properties:[{name:"calledCollaborationRef",type:"Collaboration",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"Conversation",superClass:["ConversationNode"]},{name:"SubConversation",superClass:["ConversationNode"],properties:[{name:"conversationNodes",type:"ConversationNode",isMany:!0}]},{name:"ConversationNode",isAbstract:!0,superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",isBody:!0,type:"String"}]},{name:"FormalExpression",superClass:["Expression"],properties:[{name:"language",isAttr:!0,type:"String"},{name:"evaluatesToTypeRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Message",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"itemRef",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"ItemDefinition",superClass:["RootElement"],properties:[{name:"itemKind",type:"ItemKind",isAttr:!0},{name:"structureRef",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"import",type:"Import",isAttr:!0,isReference:!0}]},{name:"FlowElement",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"auditing",type:"Auditing"},{name:"monitoring",type:"Monitoring"},{name:"categoryValueRef",type:"CategoryValue",isMany:!0,isReference:!0}]},{name:"SequenceFlow",superClass:["FlowElement"],properties:[{name:"isImmediate",isAttr:!0,type:"Boolean"},{name:"conditionExpression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"sourceRef",type:"FlowNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"FlowNode",isAttr:!0,isReference:!0}]},{name:"FlowElementsContainer",isAbstract:!0,superClass:["BaseElement"],properties:[{name:"laneSets",type:"LaneSet",isMany:!0},{name:"flowElements",type:"FlowElement",isMany:!0}]},{name:"CallableElement",isAbstract:!0,superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"supportedInterfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"ioBinding",type:"InputOutputBinding",isMany:!0,xml:{serialize:"property"}}]},{name:"FlowNode",isAbstract:!0,superClass:["FlowElement"],properties:[{name:"incoming",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"outgoing",type:"SequenceFlow",isMany:!0,isReference:!0},{name:"lanes",type:"Lane",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"CorrelationPropertyRetrievalExpression",superClass:["BaseElement"],properties:[{name:"messagePath",type:"FormalExpression"},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"CorrelationPropertyBinding",superClass:["BaseElement"],properties:[{name:"dataPath",type:"FormalExpression"},{name:"correlationPropertyRef",type:"CorrelationProperty",isAttr:!0,isReference:!0}]},{name:"Resource",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"resourceParameters",type:"ResourceParameter",isMany:!0}]},{name:"ResourceParameter",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isRequired",isAttr:!0,type:"Boolean"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"CorrelationSubscription",superClass:["BaseElement"],properties:[{name:"correlationKeyRef",type:"CorrelationKey",isAttr:!0,isReference:!0},{name:"correlationPropertyBinding",type:"CorrelationPropertyBinding",isMany:!0}]},{name:"MessageFlow",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"sourceRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"targetRef",type:"InteractionNode",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"MessageFlowAssociation",superClass:["BaseElement"],properties:[{name:"innerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0},{name:"outerMessageFlowRef",type:"MessageFlow",isAttr:!0,isReference:!0}]},{name:"InteractionNode",isAbstract:!0,properties:[{name:"incomingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isMany:!0,isVirtual:!0,isReference:!0}]},{name:"Participant",superClass:["InteractionNode","BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"interfaceRef",type:"Interface",isMany:!0,isReference:!0},{name:"participantMultiplicity",type:"ParticipantMultiplicity"},{name:"endPointRefs",type:"EndPoint",isMany:!0,isReference:!0},{name:"processRef",type:"Process",isAttr:!0,isReference:!0}]},{name:"ParticipantAssociation",superClass:["BaseElement"],properties:[{name:"innerParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"outerParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"ParticipantMultiplicity",properties:[{name:"minimum",default:0,isAttr:!0,type:"Integer"},{name:"maximum",default:1,isAttr:!0,type:"Integer"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",isMany:!0,isVirtual:!0,isReference:!0},{name:"value",isAttr:!0,type:"String"}]},{name:"Activity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"isForCompensation",default:!1,isAttr:!0,type:"Boolean"},{name:"default",type:"SequenceFlow",isAttr:!0,isReference:!0},{name:"ioSpecification",type:"InputOutputSpecification",xml:{serialize:"property"}},{name:"boundaryEventRefs",type:"BoundaryEvent",isMany:!0,isReference:!0},{name:"properties",type:"Property",isMany:!0},{name:"dataInputAssociations",type:"DataInputAssociation",isMany:!0},{name:"dataOutputAssociations",type:"DataOutputAssociation",isMany:!0},{name:"startQuantity",default:1,isAttr:!0,type:"Integer"},{name:"resources",type:"ResourceRole",isMany:!0},{name:"completionQuantity",default:1,isAttr:!0,type:"Integer"},{name:"loopCharacteristics",type:"LoopCharacteristics"}]},{name:"ServiceTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"SubProcess",superClass:["Activity","FlowElementsContainer","InteractionNode"],properties:[{name:"triggeredByEvent",default:!1,isAttr:!0,type:"Boolean"},{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"LoopCharacteristics",isAbstract:!0,superClass:["BaseElement"]},{name:"MultiInstanceLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"isSequential",default:!1,isAttr:!0,type:"Boolean"},{name:"behavior",type:"MultiInstanceBehavior",default:"All",isAttr:!0},{name:"loopCardinality",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopDataInputRef",type:"ItemAwareElement",isReference:!0},{name:"loopDataOutputRef",type:"ItemAwareElement",isReference:!0},{name:"inputDataItem",type:"DataInput",xml:{serialize:"property"}},{name:"outputDataItem",type:"DataOutput",xml:{serialize:"property"}},{name:"complexBehaviorDefinition",type:"ComplexBehaviorDefinition",isMany:!0},{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"oneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0},{name:"noneBehaviorEventRef",type:"EventDefinition",isAttr:!0,isReference:!0}]},{name:"StandardLoopCharacteristics",superClass:["LoopCharacteristics"],properties:[{name:"testBefore",default:!1,isAttr:!0,type:"Boolean"},{name:"loopCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"loopMaximum",type:"Integer",isAttr:!0}]},{name:"CallActivity",superClass:["Activity","InteractionNode"],properties:[{name:"calledElement",type:"String",isAttr:!0}]},{name:"Task",superClass:["Activity","InteractionNode"]},{name:"SendTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ReceiveTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"},{name:"instantiate",default:!1,isAttr:!0,type:"Boolean"},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0},{name:"messageRef",type:"Message",isAttr:!0,isReference:!0}]},{name:"ScriptTask",superClass:["Task"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"script",type:"String"}]},{name:"BusinessRuleTask",superClass:["Task"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"AdHocSubProcess",superClass:["SubProcess"],properties:[{name:"completionCondition",type:"Expression",xml:{serialize:"xsi:type"}},{name:"ordering",type:"AdHocOrdering",isAttr:!0},{name:"cancelRemainingInstances",default:!0,isAttr:!0,type:"Boolean"}]},{name:"Transaction",superClass:["SubProcess"],properties:[{name:"protocol",isAttr:!0,type:"String"},{name:"method",isAttr:!0,type:"String"}]},{name:"GlobalScriptTask",superClass:["GlobalTask"],properties:[{name:"scriptLanguage",isAttr:!0,type:"String"},{name:"script",isAttr:!0,type:"String"}]},{name:"GlobalBusinessRuleTask",superClass:["GlobalTask"],properties:[{name:"implementation",isAttr:!0,type:"String"}]},{name:"ComplexBehaviorDefinition",superClass:["BaseElement"],properties:[{name:"condition",type:"FormalExpression"},{name:"event",type:"ImplicitThrowEvent"}]},{name:"ResourceRole",superClass:["BaseElement"],properties:[{name:"resourceRef",type:"Resource",isReference:!0},{name:"resourceParameterBindings",type:"ResourceParameterBinding",isMany:!0},{name:"resourceAssignmentExpression",type:"ResourceAssignmentExpression"},{name:"name",isAttr:!0,type:"String"}]},{name:"ResourceParameterBinding",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}},{name:"parameterRef",type:"ResourceParameter",isAttr:!0,isReference:!0}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",prefix:"bpmndi",types:[{name:"BPMNDiagram",properties:[{name:"plane",type:"BPMNPlane",redefines:"di:Diagram#rootElement"},{name:"labelStyle",type:"BPMNLabelStyle",isMany:!0}],superClass:["di:Diagram"]},{name:"BPMNPlane",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"}],superClass:["di:Plane"]},{name:"BPMNShape",properties:[{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"isHorizontal",isAttr:!0,type:"Boolean"},{name:"isExpanded",isAttr:!0,type:"Boolean"},{name:"isMarkerVisible",isAttr:!0,type:"Boolean"},{name:"label",type:"BPMNLabel"},{name:"isMessageVisible",isAttr:!0,type:"Boolean"},{name:"participantBandKind",type:"ParticipantBandKind",isAttr:!0},{name:"choreographyActivityShape",type:"BPMNShape",isAttr:!0,isReference:!0}],superClass:["di:LabeledShape"]},{name:"BPMNEdge",properties:[{name:"label",type:"BPMNLabel"},{name:"bpmnElement",isAttr:!0,isReference:!0,type:"bpmn:BaseElement",redefines:"di:DiagramElement#modelElement"},{name:"sourceElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#source"},{name:"targetElement",isAttr:!0,isReference:!0,type:"di:DiagramElement",redefines:"di:Edge#target"},{name:"messageVisibleKind",type:"MessageVisibleKind",isAttr:!0,default:"initiating"}],superClass:["di:LabeledEdge"]},{name:"BPMNLabel",properties:[{name:"labelStyle",type:"BPMNLabelStyle",isAttr:!0,isReference:!0,redefines:"di:DiagramElement#style"}],superClass:["di:Label"]},{name:"BPMNLabelStyle",properties:[{name:"font",type:"dc:Font"}],superClass:["di:Style"]}],enumerations:[{name:"ParticipantBandKind",literalValues:[{name:"top_initiating"},{name:"middle_initiating"},{name:"bottom_initiating"},{name:"top_non_initiating"},{name:"middle_non_initiating"},{name:"bottom_non_initiating"}]},{name:"MessageVisibleKind",literalValues:[{name:"initiating"},{name:"non_initiating"}]}],associations:[]},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/DC",prefix:"dc",types:[{name:"Boolean"},{name:"Integer"},{name:"Real"},{name:"String"},{name:"Font",properties:[{name:"name",type:"String",isAttr:!0},{name:"size",type:"Real",isAttr:!0},{name:"isBold",type:"Boolean",isAttr:!0},{name:"isItalic",type:"Boolean",isAttr:!0},{name:"isUnderline",type:"Boolean",isAttr:!0},{name:"isStrikeThrough",type:"Boolean",isAttr:!0}]},{name:"Point",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0}]},{name:"Bounds",properties:[{name:"x",type:"Real",default:"0",isAttr:!0},{name:"y",type:"Real",default:"0",isAttr:!0},{name:"width",type:"Real",isAttr:!0},{name:"height",type:"Real",isAttr:!0}]}],associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",prefix:"di",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"extension",type:"Extension"},{name:"owningDiagram",type:"Diagram",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"owningElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"modelElement",isReadOnly:!0,isVirtual:!0,isReference:!0,type:"Element"},{name:"style",type:"Style",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"ownedElement",type:"DiagramElement",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Node",isAbstract:!0,superClass:["DiagramElement"]},{name:"Edge",isAbstract:!0,superClass:["DiagramElement"],properties:[{name:"source",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"target",type:"DiagramElement",isReadOnly:!0,isVirtual:!0,isReference:!0},{name:"waypoint",isUnique:!1,isMany:!0,type:"dc:Point",xml:{serialize:"xsi:type"}}]},{name:"Diagram",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"},{name:"rootElement",type:"DiagramElement",isReadOnly:!0,isVirtual:!0},{name:"name",isAttr:!0,type:"String"},{name:"documentation",isAttr:!0,type:"String"},{name:"resolution",isAttr:!0,type:"Real"},{name:"ownedStyle",type:"Style",isReadOnly:!0,isMany:!0,isVirtual:!0}]},{name:"Shape",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Plane",isAbstract:!0,superClass:["Node"],properties:[{name:"planeElement",type:"DiagramElement",subsettedProperty:"DiagramElement-ownedElement",isMany:!0}]},{name:"LabeledEdge",isAbstract:!0,superClass:["Edge"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isMany:!0,isVirtual:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",isAttr:!0,isId:!0,type:"String"}]},{name:"Extension",properties:[{name:"values",isMany:!0,type:"Element"}]}],associations:[],xml:{tagAlias:"lowerCase"}},bioc:{name:"bpmn.io colors for BPMN",uri:"http://bpmn.io/schema/bpmn/biocolor/1.0",prefix:"bioc",types:[{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"stroke",isAttr:!0,type:"String"},{name:"fill",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]},color:{name:"BPMN in Color",uri:"http://www.omg.org/spec/BPMN/non-normative/color/1.0",prefix:"color",types:[{name:"ColoredLabel",extends:["bpmndi:BPMNLabel"],properties:[{name:"color",isAttr:!0,type:"String"}]},{name:"ColoredShape",extends:["bpmndi:BPMNShape"],properties:[{name:"background-color",isAttr:!0,type:"String"},{name:"border-color",isAttr:!0,type:"String"}]},{name:"ColoredEdge",extends:["bpmndi:BPMNEdge"],properties:[{name:"border-color",isAttr:!0,type:"String"}]}],enumerations:[],associations:[]}};function ux(t,e){return new cs(z({},lx,t),e)}function Se(t){return t?"<"+t.$type+(t.id?' id="'+t.id:"")+'" />':"<null>"}var px=new Nr({name:"bpmnElement",enumerable:!0},{name:"di",configurable:!0});function Le(t,e){return t.$instanceOf(e)}function hx(t,e){var n={},i=[];function r(M,I){return function($){M($,I)}}function o(M){n[M.id]=M}function a(M,I){try{var $=M.di&&function(P,x){if(P.gfx)throw new Error(e("already rendered {element}",{element:Se(P)}));return t.element(P,x)}(M,I);return o(M),$}catch(P){c(P.message,{element:M,error:P})}}function c(M,I){t.error(M,I)}function l(M){var I=M.bpmnElement;I?I.di?c(e("multiple DI elements defined for {element}",{element:Se(I)}),{element:I}):(px.bind(I,"di"),I.di=M):c(e("no bpmnElement referenced in {element}",{element:Se(M)}),{element:M})}function u(M){var I;l(I=M.plane),L(I.planeElement,p)}function p(M){l(M)}function d(){for(;i.length;)i.shift()()}function y(M,I){_(M,I),w(M.ioSpecification,I),S(M.artifacts,I),o(M)}function f(M,I){a(M,I)}function v(M,I){a(M,I)}function g(M,I){a(M,I)}function b(M,I){a(M,I)}function E(M,I){a(M,I)}function S(M,I){L(M,function($){Le($,"bpmn:Association")?i.push(function(){E($,I)}):E($,I)})}function w(M,I){M&&(L(M.dataInputs,r(g,I)),L(M.dataOutputs,r(b,I)))}function C(M,I){_(M,I),S(M.artifacts,I)}function B(M,I){var $=a(M,I);Le(M,"bpmn:SubProcess")&&C(M,$||I),Le(M,"bpmn:Activity")&&w(M.ioSpecification,I),i.push(function(){L(M.dataInputAssociations,r(v,I)),L(M.dataOutputAssociations,r(v,I))})}function s(M,I){a(M,I)}function h(M,I){i.push(function(){var $=a(M,I);M.childLaneSet&&m(M.childLaneSet,$||I),function(P){L(P.flowNodeRef,function(x){var N=x.get("lanes");N&&N.push(P)})}(M)})}function m(M,I){L(M.lanes,r(h,I))}function _(M,I){(function($,P){L($,function(x){Le(x,"bpmn:SequenceFlow")?i.push(function(){(function(N,j){a(N,j)})(x,P)}):Le(x,"bpmn:BoundaryEvent")?i.unshift(function(){B(x,P)}):Le(x,"bpmn:FlowNode")?B(x,P):Le(x,"bpmn:DataObject")||(Le(x,"bpmn:DataStoreReference")||Le(x,"bpmn:DataObjectReference")?s(x,P):c(e("unrecognized flowElement {element} in context {context}",{element:Se(x),context:P?Se(P.businessObject):"null"}),{element:x,context:P}))})})(M.flowElements,I),M.laneSets&&function($,P){L($,r(m,P))}(M.laneSets,I)}function T(M,I){var $=a(M,I),P=M.processRef;P&&y(P,$||I)}return{handleDeferred:d,handleDefinitions:function(M,I){var $=M.diagrams;if(I&&$.indexOf(I)===-1)throw new Error(e("diagram not part of bpmn:Definitions"));if(!I&&$&&$.length&&(I=$[0]),!I)throw new Error(e("no diagram to display"));u(I);var P=I.plane;if(!P)throw new Error(e("no plane for {element}",{element:Se(I)}));var x=P.bpmnElement;if(!x){if(x=function(G){return kt(G.rootElements,function(W){return Le(W,"bpmn:Process")||Le(W,"bpmn:Collaboration")})}(M),!x)throw new Error(e("no process or collaboration to display"));c(e("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Se(P),rootElement:Se(x)})),P.bpmnElement=x,l(P)}var N,j=function(G,W){return t.root(G,W)}(x,P);if(Le(x,"bpmn:Process"))y(x,j);else{if(!Le(x,"bpmn:Collaboration"))throw new Error(e("unsupported bpmnElement for {plane}: {rootElement}",{plane:Se(P),rootElement:Se(x)}));L((N=x).participants,r(T)),S(N.artifacts),i.push(function(){var G;L(N.messageFlows,r(f,G))}),function(G,W){mt(G,function(tt){return!n[tt.id]&&Le(tt,"bpmn:Process")&&tt.laneSets}).forEach(r(y,W))}(M.rootElements,j)}d()},handleSubProcess:C,registerDi:l}}function dx(t,e,n){var i,r,o,a=[];return new Promise(function(c,l){try{return i=t.get("bpmnImporter"),r=t.get("eventBus"),o=t.get("translate"),r.fire("import.render.start",{definitions:e}),function(u,p){new hx({root:function(d){return i.add(d)},element:function(d,y){return i.add(d,y)},error:function(d,y){a.push({message:d,context:y})}},o).handleDefinitions(u,p)}(e,n),r.fire("import.render.complete",{error:void 0,warnings:a}),c({warnings:a})}catch(u){return u.warnings=a,l(u)}})}function Vr(t){return function(){if(!window.Promise)throw new Error("Promises is not supported in this environment. Please polyfill Promise.");var e=arguments.length;if(!(e>=1&&fe(arguments[e-1])))return t.apply(this,arguments);var n=arguments[e-1],i=Array.prototype.slice.call(arguments,0,-1);t.apply(this,i).then(function(r){var o=Object.keys(r)[0];return n(null,r[o])},function(r){return n(r,r.warnings)})}}var Em='<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 ls(t){return t.join(";")}var Ro,_m=ls(["color: #404040"]),mx='<div class="bjs-powered-by-lightbox" style="'+ls(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+ls(["width: 100%","height: 100%","background: rgba(40,40,40,0.2)"])+'"></div><div class="notice" style="'+ls(["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;'+_m+'">'+Em+'</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 $t(t){var e,n;t=z({},fx,t),this._moddle=this._createModdle(t),this._container=this._createContainer(t),e=this._container,n=Lt('<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; '+_m+'">'+Em+"</a>"),e.appendChild(n),ct.bind(n,"click",function(i){Ro||(Ro=Lt(mx),$e.bind(Ro,".backdrop","click",function(r){document.body.removeChild(Ro)})),document.body.appendChild(Ro),i.preventDefault()}),this._init(this._container,this._moddle,t)}function us(t,e){return t.warnings=e,t}rt($t,Dr),$t.prototype.importXML=Vr(function(t,e){var n=this;return new Promise(function(i,r){t=n._emit("import.parse.start",{xml:t})||t,n._moddle.fromXML(t,"bpmn:Definitions").then(function(o){var a=o.rootElement,c=o.references,l=o.warnings,u=o.elementsById;a=n._emit("import.parse.complete",function(p){var d=n.get("eventBus").createEvent(p);return Object.defineProperty(d,"context",{enumerable:!0,get:function(){return{warnings:p.warnings,references:p.references,elementsById:p.elementsById}}}),d}({error:null,definitions:a,elementsById:u,references:c,warnings:l}))||a,n.importDefinitions(a,e).then(function(p){var d=[].concat(l,p.warnings||[]);return n._emit("import.done",{error:null,warnings:d}),i({warnings:d})}).catch(function(p){var d=[].concat(l,p.warnings||[]);return n._emit("import.done",{error:p,warnings:d}),r(us(p,d))})}).catch(function(o){return n._emit("import.parse.complete",{error:o}),o=function(a){var c=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(a.message);return c&&(a.message="unparsable content <"+c[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+c[2]),a}(o),n._emit("import.done",{error:o,warnings:o.warnings}),r(o)})})}),$t.prototype.importDefinitions=Vr(function(t,e){var n=this;return new Promise(function(i,r){n._setDefinitions(t),n.open(e).then(function(o){var a=o.warnings;return i({warnings:a})}).catch(function(o){return r(o)})})}),$t.prototype.open=Vr(function(t){var e=this._definitions,n=t,i=this;return new Promise(function(r,o){if(!e){var a=new Error("no XML imported");return o(us(a,[]))}if(typeof t=="string"&&(n=function(l,u){return u&&kt(l.diagrams,function(p){return p.id===u})||null}(e,t),!n)){var c=new Error("BPMNDiagram <"+t+"> not found");return o(us(c,[]))}try{i.clear()}catch(l){return o(us(l,[]))}dx(i,e,n).then(function(l){var u=l.warnings;return r({warnings:u})}).catch(function(l){return o(l)})})}),$t.prototype.saveXML=Vr(function(t){t=t||{};var e=this,n=this._definitions;return new Promise(function(i){if(!n)return i({error:new Error("no definitions loaded")});n=e._emit("saveXML.start",{definitions:n})||n,e._moddle.toXML(n,t).then(function(r){var o=r.xml;return o=e._emit("saveXML.serialized",{xml:o})||o,i({xml:o})})}).catch(function(i){return{error:i}}).then(function(i){e._emit("saveXML.done",i);var r=i.error;return r?Promise.reject(r):i})}),$t.prototype.saveSVG=Vr(function(t){var e=this;return new Promise(function(n,i){var r,o;e._emit("saveSVG.start");try{var a=e.get("canvas"),c=a.getDefaultLayer(),l=Ut("defs",a._svg),u=_d(c),p=l?"<defs>"+_d(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})})}),$t.prototype._setDefinitions=function(t){this._definitions=t},$t.prototype.getModules=function(){return this._modules},$t.prototype.clear=function(){this.getDefinitions()&&(this.get("elementRegistry").forEach(function(t){var e=t.businessObject;e&&e.di&&delete e.di}),Dr.prototype.clear.call(this))},$t.prototype.destroy=function(){Dr.prototype.destroy.call(this),Tn(this._container)},$t.prototype.on=function(t,e,n,i){return this.get("eventBus").on(t,e,n,i)},$t.prototype.off=function(t,e){this.get("eventBus").off(t,e)},$t.prototype.attachTo=function(t){if(!t)throw new Error("parentNode required");this.detach(),t.get&&t.constructor.prototype.jquery&&(t=t.get(0)),typeof t=="string"&&(t=Ut(t)),t.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},$t.prototype.getDefinitions=function(){return this._definitions},$t.prototype.detach=function(){var t=this._container,e=t.parentNode;e&&(this._emit("detach",{}),e.removeChild(t))},$t.prototype._init=function(t,e,n){var i=n.modules||this.getModules(),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",e]}],i,r),a=z(zn(n,["additionalModules"]),{canvas:z({},n.canvas,{container:t}),modules:o});Dr.call(this,a),n&&n.container&&this.attachTo(n.container)},$t.prototype._emit=function(t,e){return this.get("eventBus").fire(t,e)},$t.prototype._createContainer=function(t){var e=Lt('<div class="bjs-container"></div>');return z(e.style,{width:wm(t.width),height:wm(t.height),position:t.position}),e},$t.prototype._createModdle=function(t){return new ux(z({},this._moddleExtensions,t.moddleExtensions))},$t.prototype._modules=[];var fx={width:"100%",height:"100%",position:"relative"};function wm(t){return t+(ht(t)?"px":"")}function No(t){$t.call(this,t),this.on("import.parse.complete",function(e){e.error||this._collectIds(e.definitions,e.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}function A(t,e){var n=et(t);return n&&typeof n.$instanceOf=="function"&&n.$instanceOf(e)}function et(t){return t&&t.businessObject||t}function Pt(t){return!A(t,"bpmn:CallActivity")&&(A(t,"bpmn:SubProcess")?et(t).di&&!!et(t).di.isExpanded:!A(t,"bpmn:Participant")||!!et(t).processRef)}function je(t){return t&&!!et(t).triggeredByEvent}function ps(t,e){var n=et(t),i=!1;return n.eventDefinitions&&L(n.eventDefinitions,function(r){A(r,e)&&(i=!0)}),i}function Sm(t){return A(t,"bpmn:FlowElement")||A(t,"bpmn:Participant")||A(t,"bpmn:Lane")||A(t,"bpmn:SequenceFlow")||A(t,"bpmn:MessageFlow")||A(t,"bpmn:DataInput")||A(t,"bpmn:DataOutput")?"name":A(t,"bpmn:TextAnnotation")?"text":A(t,"bpmn:Group")?"categoryValueRef":void 0}function mn(t){var e=t.businessObject,n=Sm(e);if(n)return n==="categoryValueRef"?function(i){var r=i.categoryValueRef;return r&&r.value||""}(e):e[n]||""}function Pn(t,e,n){return ui(t.eventDefinitions,function(i){return i.$type===e&&function(r,o){return $i(o,function(a,c){return r[c]==a})}(t,n)})}function Fr(t){return t.businessObject.di}function Ce(t){return t.businessObject}function xt(t,e){var n=Fr(t);return n.get("color:background-color")||n.get("bioc:fill")||e||"white"}function Z(t,e){var n=Fr(t);return n.get("color:border-color")||n.get("bioc:stroke")||e||"black"}function Io(t,e,n){var i=Fr(t).get("label");return i&&i.get("color:color")||e||Z(t,n)}rt(No,$t),No.prototype._createModdle=function(t){var e=$t.prototype._createModdle.call(this,t);return e.ids=new Sn([32,36,1]),e},No.prototype._collectIds=function(t,e){var n,i=t.$model.ids;for(n in i.clear(),e)i.claim(n,e[n])};var vx=new Sn,zr=.95;function Ki(t,e,n,i,r,o,a){$n.call(this,e,a);var c=t&&t.defaultFillColor,l=t&&t.defaultStrokeColor,u=t&&t.defaultLabelColor,p=vx.next(),d={},y=n.computeStyle;function f(P,x){var N=z({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},x.attrs),j=x.ref||{x:0,y:0},G=x.scale||1;N.strokeDasharray==="none"&&(N.strokeDasharray=[1e4,1]);var W=ot("marker");K(x.element,N),lt(W,x.element),K(W,{id:P,viewBox:"0 0 20 20",refX:j.x,refY:j.y,markerWidth:20*G,markerHeight:20*G,orient:"auto"});var tt=Ut("defs",r._svg);tt||(tt=ot("defs"),lt(r._svg,tt)),lt(tt,W),d[P]=W}function v(P){return P.replace(/[^0-9a-zA-z]+/g,"_")}function g(P,x,N){var j=P+"-"+v(x)+"-"+v(N)+"-"+p;return d[j]||function(G,W,tt,it){if(W==="sequenceflow-end"){var at=ot("path");K(at,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(G,{element:at,ref:{x:11,y:10},scale:.5,attrs:{fill:it,stroke:it}})}if(W==="messageflow-start"){var H=ot("circle");K(H,{cx:6,cy:6,r:3.5}),f(G,{element:H,attrs:{fill:tt,stroke:it},ref:{x:6,y:6}})}if(W==="messageflow-end"){var q=ot("path");K(q,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(G,{element:q,attrs:{fill:tt,stroke:it,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if(W==="association-start"){var jt=ot("path");K(jt,{d:"M 11 5 L 1 10 L 11 15"}),f(G,{element:jt,attrs:{fill:"none",stroke:it,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if(W==="association-end"){var Ht=ot("path");K(Ht,{d:"M 1 5 L 11 10 L 1 15"}),f(G,{element:Ht,attrs:{fill:"none",stroke:it,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if(W==="conditional-flow-marker"){var he=ot("path");K(he,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(G,{element:he,attrs:{fill:tt,stroke:it},ref:{x:-1,y:10},scale:.5})}if(W==="conditional-default-flow-marker"){var Vt=ot("path");K(Vt,{d:"M 6 4 L 10 16"}),f(G,{element:Vt,attrs:{stroke:it},ref:{x:0,y:10},scale:.5})}}(j,P,x,N),"url(#"+j+")"}function b(P,x,N,j,G){Jt(j)&&(G=j,j=0),j=j||0,(G=y(G,{stroke:"black",strokeWidth:2,fill:"white"})).fill==="none"&&delete G.fillOpacity;var W=x/2,tt=N/2,it=ot("circle");return K(it,{cx:W,cy:tt,r:Math.round((x+N)/4-j)}),K(it,G),lt(P,it),it}function E(P,x,N,j,G,W){Jt(G)&&(W=G,G=0),G=G||0,W=y(W,{stroke:"black",strokeWidth:2,fill:"white"});var tt=ot("rect");return K(tt,{x:G,y:G,width:x-2*G,height:N-2*G,rx:j,ry:j}),K(tt,W),lt(P,tt),tt}function S(P,x,N){var j=$l(x,N=y(N,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return lt(P,j),j}function w(P,x,N){N=y(N,["no-fill"],{strokeWidth:2,stroke:"black"});var j=ot("path");return K(j,{d:x}),K(j,N),lt(P,j),j}function C(P,x,N,j){return w(x,N,z({"data-marker":P},j))}function B(P){return function(x,N){return I[P](x,N)}}function s(P){return I[P]}function h(P,x){var N=Ce(P),j=function(G){return G.$type==="bpmn:IntermediateThrowEvent"||G.$type==="bpmn:EndEvent"}(N);return N.eventDefinitions&&N.eventDefinitions.length>1?N.parallelMultiple?s("bpmn:ParallelMultipleEventDefinition")(x,P,j):s("bpmn:MultipleEventDefinition")(x,P,j):Pn(N,"bpmn:MessageEventDefinition")?s("bpmn:MessageEventDefinition")(x,P,j):Pn(N,"bpmn:TimerEventDefinition")?s("bpmn:TimerEventDefinition")(x,P,j):Pn(N,"bpmn:ConditionalEventDefinition")?s("bpmn:ConditionalEventDefinition")(x,P):Pn(N,"bpmn:SignalEventDefinition")?s("bpmn:SignalEventDefinition")(x,P,j):Pn(N,"bpmn:EscalationEventDefinition")?s("bpmn:EscalationEventDefinition")(x,P,j):Pn(N,"bpmn:LinkEventDefinition")?s("bpmn:LinkEventDefinition")(x,P,j):Pn(N,"bpmn:ErrorEventDefinition")?s("bpmn:ErrorEventDefinition")(x,P,j):Pn(N,"bpmn:CancelEventDefinition")?s("bpmn:CancelEventDefinition")(x,P,j):Pn(N,"bpmn:CompensateEventDefinition")?s("bpmn:CompensateEventDefinition")(x,P,j):Pn(N,"bpmn:TerminateEventDefinition")?s("bpmn:TerminateEventDefinition")(x,P,j):null}function m(P,x,N){N=z({size:{width:100}},N);var j=o.createText(x||"",N);return bt(j).add("djs-label"),lt(P,j),j}function _(P,x,N){return m(P,Ce(x).name,{box:x,align:N,padding:5,style:{fill:Io(x,u,l)}})}function T(P,x,N){Zl(m(P,x,{box:{height:30,width:N.height},align:"center-middle",style:{fill:Io(N,u,l)}}),0,-(-1*N.height),270)}function M(P){for(var x=P.waypoints,N="m "+x[0].x+","+x[0].y,j=1;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=zr),b(P,x.width,x.height,N)},"bpmn:StartEvent":function(P,x){var N={fill:xt(x,c),stroke:Z(x,l)};Ce(x).isInterrupting||(N={strokeDasharray:"6",strokeLinecap:"round",fill:xt(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 w(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):xt(x,c),stroke:N?xt(x,c):Z(x,l)})},"bpmn:TimerEventDefinition":function(P,x){var N=b(P,x.width,x.height,.2*x.height,{strokeWidth:2,fill:xt(x,c),stroke:Z(x,l)});w(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}}),W=x.width/2;w(P,G,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*j+","+x.height/2+","+W+")",stroke:Z(x,l)})}return N},"bpmn:EscalationEventDefinition":function(P,x,N){return w(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 w(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 w(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 w(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=w(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 em(j,45),j},"bpmn:CompensateEventDefinition":function(P,x,N){return w(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 w(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 w(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 w(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:xt(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:xt(x,c),stroke:Z(x,l)});return b(P,x.width,x.height,3,{strokeWidth:1,fill:xt(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=zr),E(P,x.width,x.height,10,N)},"bpmn:Task":function(P,x){var N={fill:xt(x,c),stroke:Z(x,l)},j=s("bpmn:Activity")(P,x,N);return _(P,x,"center-middle"),$(P,x),j},"bpmn:ServiceTask":function(P,x){var N=s("bpmn:Task")(P,x);return w(P,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:xt(x,c),stroke:Z(x,l)}),w(P,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:xt(x,c)}),w(P,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:xt(x,c),stroke:Z(x,l)}),N},"bpmn:UserTask":function(P,x){var N=s("bpmn:Task")(P,x);return w(P,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:xt(x,c),stroke:Z(x,l)}),w(P,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:xt(x,c),stroke:Z(x,l)}),w(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 w(P,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:xt(x,c),stroke:Z(x,l)}),N},"bpmn:SendTask":function(P,x){var N=s("bpmn:Task")(P,x);return w(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:xt(x,c)}),N},"bpmn:ReceiveTask":function(P,x){var N,j=Ce(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}}),w(P,N,{strokeWidth:1,fill:xt(x,c),stroke:Z(x,l)}),G},"bpmn:ScriptTask":function(P,x){var N=s("bpmn:Task")(P,x);return w(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(w(P,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:xt(x,"#aaaaaa"),stroke:Z(x,l)}),K(w(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:xt(x,c),stroke:Z(x,l)},N);var j=s("bpmn:Activity")(P,x,N),G=Pt(x);return je(x)&&K(j,{strokeDasharray:"1,2"}),_(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 E(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:zr,fill:xt(x,c),stroke:Z(x,l)},j=s("bpmn:Lane")(P,x,N);return Pt(x)?(S(P,[{x:30,y:0},{x:30,y:x.height}],{stroke:Z(x,l)}),T(P,Ce(x).name,x)):m(P,Ce(x).name,{box:x,align:"center-middle",style:{fill:Io(x,u,l)}}),Ce(x).participantMultiplicity&&s("ParticipantMultiplicityMarker")(P,x),j},"bpmn:Lane":function(P,x,N){var j=E(P,x.width,x.height,0,z({fill:xt(x,c),fillOpacity:.35,stroke:Z(x,l)},N)),G=Ce(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:xt(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 Fr(x).isMarkerVisible&&w(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 w(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 w(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=Ce(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,W=!!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(w(P,tt),{strokeWidth:1,fill:"none"})}else G==="Exclusive"&&(W||K(b(P,x.width,x.height,.26*x.height),{strokeWidth:1,fill:"none",stroke:Z(x,l)}),function(){var it=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:x.width,containerHeight:x.height,position:{mx:.36,my:.44}}),at={strokeWidth:2,fill:xt(x,"none"),stroke:Z(x,l)};w(P,it,at)}());return j},"bpmn:Gateway":function(P,x){var N={fill:xt(x,c),fillOpacity:zr,stroke:Z(x,l)};return function(j,G,W,tt){var it=G/2,at=W/2,H=[{x:it,y:0},{x:G,y:at},{x:it,y:W},{x:0,y:at}].map(function(jt){return jt.x+","+jt.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=xt(x,c),W=Z(x,l),tt=w(P,j,{strokeLinejoin:"round",markerEnd:g("sequenceflow-end",G,W),stroke:Z(x,l)}),it=Ce(x);return x.source&&(N=x.source.businessObject,it.conditionExpression&&N.$instanceOf("bpmn:Activity")&&K(tt,{markerStart:g("conditional-flow-marker",G,W)}),N.default&&(N.$instanceOf("bpmn:Gateway")||N.$instanceOf("bpmn:Activity"))&&N.default===it&&K(tt,{markerStart:g("conditional-default-flow-marker",G,W)})),tt},"bpmn:Association":function(P,x,N){var j=Ce(x),G=xt(x,c),W=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,W)),j.associationDirection==="Both"&&(N.markerStart=g("association-start",G,W)),S(P,x.waypoints,N)},"bpmn:DataInputAssociation":function(P,x){var N=xt(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=xt(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=Ce(x),j=Fr(x),G=xt(x,c),W=Z(x,l),tt=w(P,M(x),{markerEnd:g("messageflow-end",G,W),markerStart:g("messageflow-start",G,W),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:Z(x,l)});if(N.messageRef){var it=tt.getPointAtLength(tt.getTotalLength()/2),at=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:it.x,y:it.y}}),H={strokeWidth:1};j.messageVisibleKind==="initiating"?(H.fill="white",H.stroke="black"):(H.fill="#888",H.stroke="white");var q=w(P,at,H),jt=m(P,N.messageRef.name,{align:"center-top",fitBox:!0,style:{fill:Z(x,u)}}),Ht=q.getBBox(),he=jt.getBBox();Zl(jt,it.x-he.width/2,it.y+Ht.height/2+10,0)}return tt},"bpmn:DataObject":function(P,x){var N=w(P,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:.474,my:.296}}),{fill:xt(x,c),fillOpacity:zr,stroke:Z(x,l)});return function(j){var G=j.dataObjectRef;return j.isCollection||G&&G.isCollection}(Ce(x))&&function(j,G){var W=(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:W}});w(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 w(P,N,{strokeWidth:1}),j},"bpmn:DataOutput":function(P,x){var N=i.getRawPath("DATA_ARROW"),j=s("bpmn:DataObject")(P,x);return w(P,N,{strokeWidth:1,fill:"black"}),j},"bpmn:DataStoreReference":function(P,x){return w(P,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:x.width,containerHeight:x.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:xt(x,c),fillOpacity:zr,stroke:Z(x,l)})},"bpmn:BoundaryEvent":function(P,x){var N=Ce(x).cancelActivity,j={strokeWidth:1,fill:xt(x,c),stroke:Z(x,l)};N||(j.strokeDasharray="6",j.strokeLinecap="round");var G=z({},j,{fillOpacity:1}),W=z({},j,{fill:"none"}),tt=s("bpmn:Event")(P,x,G);return b(P,x.width,x.height,3,W),h(x,P),tt},"bpmn:Group":function(P,x){return E(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,mn(j),{box:G,fitBox:!0,style:z({},o.getExternalStyle(),{fill:Io(j,u,l)})})}(P,x)},"bpmn:TextAnnotation":function(P,x){var N=E(P,x.width,x.height,0,0,{fill:"none",stroke:"none"});return w(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,Ce(x).text||"",{box:x,align:"left-top",padding:5,style:{fill:Io(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:xt(x,c),stroke:Z(x,l)})},SubProcessMarker:function(P,x){Oe(E(P,14,14,0,{strokeWidth:1,fill:xt(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:xt(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:xt(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:xt(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:xt(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:xt(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=Ce(x),W=N&&N.indexOf("SubProcessMarker")!==-1;j=W?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},L(N,function(at){s(at)(P,x,j)}),G.isForCompensation&&s("CompensationMarker")(P,x,j),G.$type==="bpmn:AdHocSubProcess"&&s("AdhocMarker")(P,x,j);var tt=G.loopCharacteristics,it=tt&&tt.isSequential;tt&&(it===void 0&&s("LoopMarker")(P,x,j),it===!1&&s("ParallelMarker")(P,x,j),it===!0&&s("SequentialMarker")(P,x,j))}this._drawPath=w}rt(Ki,$n),Ki.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Ki.prototype.canRender=function(t){return A(t,"bpmn:BaseElement")},Ki.prototype.drawShape=function(t,e){var n=e.type;return(0,this.handlers[n])(t,e)},Ki.prototype.drawConnection=function(t,e){var n=e.type;return(0,this.handlers[n])(t,e)},Ki.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,Pr([["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 Pr([["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 Pr([["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 Pr([["M",a,c],["l",l,0],["l",0,o.height],["l",-l,0],["z"]])}(t);var e,n,i,r};var yx={width:150,height:50};function gx(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 bx(t,e,n){for(var i,r=t.shift(),o=r;;){if((i=gx(o,n)).width=o?i.width:0,o===" "||o===""||i.width<Math.round(e)||o.length<2)return xx(t,o,r,i);o=Ex(o,i.width,e)}}function xx(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 Cm="\xAD";function Ex(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!==Cm||u.pop();break}u.push(c),p+=c.length}var d=u[u.length-1];return d&&d===Cm&&(u[u.length-1]="-"),u.join("")}(t,i);return r||(r=t.slice(0,Math.max(Math.round(i-1),1))),r}function hs(t){this._config=z({},{size:yx,padding:0,style:{},align:"center-top"},t||{})}hs.prototype.createText=function(t,e){return this.layoutText(t,e).element},hs.prototype.getDimensions=function(t,e){return this.layoutText(t,e).dimensions},hs.prototype.layoutText=function(t,e){var n=z({},this._config.size,e.box),i=z({},this._config.style,e.style),r=function(b){var E=b.split("-");return{horizontal:E[0]||"center",vertical:E[1]||"top"}}(e.align||this._config.align),o=function(b){return Jt(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(bx(l,p,d));r.vertical==="middle"&&(o.top=o.bottom=0);var y=De(u,function(b,E,S){return b+(c||E.height)},0)+o.top+o.bottom,f=De(u,function(b,E,S){return E.width>b?E.width:b},0),v=o.top;r.vertical==="middle"&&(v+=(n.height-y)/2),v-=(c||u[0].height)/4;var g=ot("text");return K(g,i),L(u,function(b){var E;switch(v+=c||b.height,r.horizontal){case"left":E=o.left;break;case"right":E=(a?f:p)-o.right-b.width;break;default:E=Math.max(((a?f:p)-b.width)/2+o.left,0)}var S=ot("tspan");K(S,{x:E,y:v}),S.textContent=b.text,lt(g,S)}),Zt(d),{dimensions:{width:f,height:y},element:g}};function Tm(t){var e=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},t&&t.defaultStyle||{}),n=parseInt(e.fontSize,10)-1,i=z({},e,{fontSize:n},t&&t.externalStyle||{}),r=new hs({style:e});this.getExternalLabelBounds=function(o,a){var c=r.getDimensions(a,{box:{width:90,height:30,x:o.width/2+o.x,y:o.height/2+o.y},style:i});return{x:Math.round(o.x+o.width/2-c.width/2),y:Math.round(o.y),width:Math.ceil(c.width),height:Math.ceil(c.height)}},this.getTextAnnotationBounds=function(o,a){var c=r.getDimensions(a,{box:o,style:e,align:"left-top",padding:5});return{x:o.x,y:o.y,width:o.width,height:Math.max(30,Math.round(c.height))}},this.createText=function(o,a){return r.createText(o,a||{})},this.getDefaultStyle=function(){return e},this.getExternalStyle=function(){return i}}Tm.$inject=["config.textRenderer"];var _x=/\{([^{}]+)\}/g,wx=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;const Sx={__init__:["bpmnRenderer"],bpmnRenderer:["type",Ki],textRenderer:["type",Tm],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(t){return this.pathMap[t].d},this.getScaledPath=function(t,e){var n,i,r=this.pathMap[t];e.abspos?(n=e.abspos.x,i=e.abspos.y):(n=e.containerWidth*e.position.mx,i=e.containerHeight*e.position.my);var o={};if(e.position){for(var a=e.containerHeight/r.height*e.yScaleFactor,c=e.containerWidth/r.width*e.xScaleFactor,l=0;l<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(_x,function(f,v){return function(g,b,E){var S=E;return b.replace(wx,function(w,C,B,s,h){C=C||s,S&&(C in S&&(S=S[C]),typeof S=="function"&&h&&(S=S()))}),S=(S==null||S==E?g:S)+""}(f,v,d)}));return y}}]},ds={translate:["value",function(t,e){return e=e||{},t.replace(/{([^}]+)}/g,function(n,i){return e[i]||"{"+i+"}"})}]};var Do={width:90,height:20};function $r(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 ms(t){return ge(t.label)}function Cx(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-=15:a+=15,{x:a,y:c}}function fs(t){return t.waypoints?Cx(t.waypoints):A(t,"bpmn:Group")?{x:t.x+t.width/2,y:t.y+Do.height/2}:{x:t.x+t.width/2,y:t.y+t.height+Do.height/2}}function ge(t){return t&&!!t.labelTarget}function vs(t,e){return z({id:t.id,type:t.$type,businessObject:t},e)}function Tx(t,e,n){var i=t.di.waypoint;return!i||i.length<2?[vt(e),vt(n)]:i.map(function(r){return{x:r.x,y:r.y}})}function Am(t,e,n,i){return new Error(t("element {element} referenced by {referenced}#{property} not yet drawn",{element:Se(n),referenced:Se(e),property:i}))}function qn(t,e,n,i,r,o){this._eventBus=t,this._canvas=e,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=o}qn.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],qn.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(vs(t)),this._canvas.setRootElement(n);else if(A(u,"bpmndi:BPMNShape")){var d=!Pt(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(vs(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=vt(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:Se(u),semantic:Se(t)}));var v=this._getSource(t),g=this._getTarget(t);i=e&&(e.hidden||e.collapsed),n=this._elementFactory.createConnection(vs(t,{hidden:i,source:v,target:g,waypoints:Tx(t,v,g)})),A(t,"bpmn:DataAssociation")&&(e=null),A(t,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,e,r)}return $r(t)&&mn(n)&&this.addLabel(t,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},qn.prototype._attachBoundary=function(t,e){var n=this._translate,i=t.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Se(t)}));var r=this._elementRegistry.get(i.id),o=r&&r.attachers;if(!r)throw Am(n,t,i,"attachedToRef");e.host=r,o||(r.attachers=o=[]),o.indexOf(e)===-1&&o.push(e)},qn.prototype.addLabel=function(t,e){var n,i,r;return n=function(o,a){var c,l,u,p=o.di.label;return p&&p.bounds?(u=p.bounds,l={width:Math.max(Do.width,u.width),height:u.height},c={x:u.x+u.width/2,y:u.y+u.height/2}):(c=fs(a),l=Do),z({x:c.x-l.width/2,y:c.y-l.height/2},l)}(t,e),(i=mn(e))&&(n=this._textRenderer.getExternalLabelBounds(n,i)),r=this._elementFactory.createLabel(vs(t,{id:t.id+"_label",labelTarget:e,type:"label",hidden:e.hidden||!mn(e),x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,e.parent)},qn.prototype._getEnd=function(t,e){var n,i,r=t.$type,o=this._translate;if(i=t[e+"Ref"],e==="source"&&r==="bpmn:DataInputAssociation"&&(i=i&&i[0]),(e==="source"&&r==="bpmn:DataOutputAssociation"||e==="target"&&r==="bpmn:DataInputAssociation")&&(i=t.$parent),n=i&&this._getElement(i))return n;throw i?Am(o,t,i,e+"Ref"):new Error(o("{semantic}#{side} Ref not specified",{semantic:Se(t),side:e}))},qn.prototype._getSource=function(t){return this._getEnd(t,"source")},qn.prototype._getTarget=function(t){return this._getEnd(t,"target")},qn.prototype._getElement=function(t){return this._elementRegistry.get(t.id)};const Ax={__depends__:[Sx,{__depends__:[ds],bpmnImporter:["type",qn]}]};function km(t){t&&typeof t.stopPropagation=="function"&&t.stopPropagation()}function Gr(t){return t.originalEvent||t.srcEvent}function lu(t,e){km(t),km(Gr(t))}function xi(t){return t.pointers&&t.pointers.length&&(t=t.pointers[0]),t.touches&&t.touches.length&&(t=t.touches[0]),t?{x:t.clientX,y:t.clientY}:null}function Pm(t,e){return(Gr(t)||t).button===e}function Ei(t){return Pm(t,0)}function Ur(t){var e=Gr(t)||t;return!!Ei(t)&&(/mac/i.test(navigator.platform)?e.metaKey:e.ctrlKey)}function Mm(t){var e=Gr(t)||t;return Ei(t)&&e.shiftKey}function kx(t){return!0}function ys(t){return Ei(t)||function(e){return Pm(e,1)}(t)}function Rm(t,e,n){var i=this;function r(E,S,w){var C,B;(function(s,h){var m=l[s]||Ei;return!m(h)})(E,S)||(w?B=e.getGraphics(w):(C=S.delegateTarget||S.target)&&(B=C,w=e.get(B)),B&&w&&t.fire(E,{element:w,gfx:B,originalEvent:S})===!1&&(S.stopPropagation(),S.preventDefault()))}var o={};function a(E){return o[E]}var c={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":kx,"element.mousedown":ys,"element.mouseup":ys,"element.click":ys,"element.dblclick":ys};function u(E,S,w,C){var B=o[w]=function(s){r(w,s)};C&&(l[w]=C),B.$delegate=$e.bind(E,"svg, .djs-element",S,B)}function p(E,S,w){var C=a(w);C&&$e.unbind(E,S,C.$delegate)}t.on("canvas.destroy",function(E){(function(S){L(c,function(w,C){p(S,C,w)})})(E.svg)}),t.on("canvas.init",function(E){(function(S){L(c,function(w,C){u(S,C,w)})})(E.svg)}),t.on(["shape.added","connection.added"],function(E){var S=E.element,w=E.gfx;t.fire("interactionEvents.createHit",{element:S,gfx:w})}),t.on(["shape.changed","connection.changed"],500,function(E){var S=E.element,w=E.gfx;t.fire("interactionEvents.updateHit",{element:S,gfx:w})}),t.on("interactionEvents.createHit",500,function(E){var S=E.element,w=E.gfx;i.createDefaultHit(S,w)}),t.on("interactionEvents.updateHit",function(E){var S=E.element,w=E.gfx;i.updateDefaultHit(S,w)});var d=v("djs-hit djs-hit-stroke"),y=v("djs-hit djs-hit-click-stroke"),f={all:v("djs-hit djs-hit-all"),"click-stroke":y,stroke:d};function v(E,S){return S=z({stroke:"white",strokeWidth:15},S||{}),n.cls(E,["no-fill","no-border"],S)}function g(E,S){var w=f[S];if(!w)throw new Error("invalid hit type <"+S+">");return K(E,w),E}function b(E,S){lt(E,S)}this.removeHits=function(E){L(Rl(".djs-hit",E),Zt)},this.createDefaultHit=function(E,S){var w,C=E.waypoints,B=E.isFrame;return C?this.createWaypointsHit(S,C):(w=B?"stroke":"all",this.createBoxHit(S,w,{width:E.width,height:E.height}))},this.createWaypointsHit=function(E,S){var w=$l(S);return g(w,"stroke"),b(E,w),w},this.createBoxHit=function(E,S,w){w=z({x:0,y:0},w);var C=ot("rect");return g(C,S),K(C,w),b(E,C),C},this.updateDefaultHit=function(E,S){var w=Ut(".djs-hit",S);if(w)return E.waypoints?function(C,B){K(C,{points:wd(B)})}(w,E.waypoints):K(w,{width:E.width,height:E.height}),w},this.fire=r,this.triggerMouseEvent=function(E,S,w){var C=c[E];if(!C)throw new Error("unmapped DOM event name <"+E+">");return r(C,S,w)},this.mouseHandler=a,this.registerEvent=u,this.unregisterEvent=p}Rm.$inject=["eventBus","elementRegistry","styles"];const Bo={__init__:["interactionEvents"],interactionEvents:["type",Rm]};function gs(t,e,n){this.offset=6;var i=e.cls("djs-outline",["no-fill"]),r=this;function o(a,c){var l=ot("rect");return K(l,z({x:10,y:10,width:100,height:100},i)),lt(a,l),l}t.on(["shape.added","shape.changed"],500,function(a){var c=a.element,l=a.gfx,u=Ut(".djs-outline",l);u||(u=o(l)),r.updateShapeOutline(u,c)}),t.on(["connection.added","connection.changed"],function(a){var c=a.element,l=a.gfx,u=Ut(".djs-outline",l);u||(u=o(l)),r.updateConnectionOutline(u,c)})}gs.prototype.updateShapeOutline=function(t,e){K(t,{x:-this.offset,y:-this.offset,width:e.width+2*this.offset,height:e.height+2*this.offset})},gs.prototype.updateConnectionOutline=function(t,e){var n=ve(e);K(t,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},gs.$inject=["eventBus","styles","elementRegistry"];const Nm={__init__:["outline"],outline:["type",gs]};function Hr(t,e){this._eventBus=t,this._canvas=e,this._selectedElements=[];var n=this;t.on(["shape.remove","connection.remove"],function(i){var r=i.element;n.deselect(r)}),t.on(["diagram.clear","plane.set"],function(i){n.select(null)})}Hr.$inject=["eventBus","canvas"],Hr.prototype.deselect=function(t){var e=this._selectedElements,n=e.indexOf(t);if(n!==-1){var i=e.slice();e.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:e})}},Hr.prototype.get=function(){return this._selectedElements},Hr.prototype.isSelected=function(t){return this._selectedElements.indexOf(t)!==-1},Hr.prototype.select=function(t,e){var n=this._selectedElements,i=n.slice();gt(t)||(t=t?[t]:[]);var r=this._canvas;t=t.filter(function(o){return r.findPlane(o)===r.getActivePlane()}),e?L(t,function(o){n.indexOf(o)===-1&&n.push(o)}):this._selectedElements=n=t.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Im="hover",Dm="selected";function Bm(t,e,n,i){function r(a,c){e.addMarker(a,c)}function o(a,c){e.removeMarker(a,c)}this._multiSelectionBox=null,t.on("element.hover",function(a){r(a.element,Im)}),t.on("element.out",function(a){o(a.element,Im)}),t.on("selection.changed",function(a){var c=a.oldSelection,l=a.newSelection;L(c,function(u){l.indexOf(u)===-1&&o(u,Dm)}),L(l,function(u){c.indexOf(u)===-1&&r(u,Dm)})})}function Om(t,e,n,i){t.on("create.end",500,function(r){var o=r.context,a=o.canExecute,c=o.elements,l=(o.hints||{}).autoSelect;if(a){if(l===!1)return;gt(l)?e.select(l):e.select(c.filter(Px))}}),t.on("connect.end",500,function(r){var o=r.context,a=o.canExecute,c=o.hover;a&&c&&e.select(c)}),t.on("shape.move.end",500,function(r){var o=r.previousSelection||[],a=i.get(r.context.shape.id);kt(o,function(c){return a.id===c.id})||e.select(a)}),t.on("element.click",function(r){if(Ei(r)){var o=r.element;o===n.getRootElement()&&(o=null);var a=e.isSelected(o),c=e.get().length>1,l=Ur(r)||Mm(r);if(a&&c)return l?e.deselect(o):e.select(o);a?e.deselect(o):e.select(o,l)}})}function Px(t){return!t.hidden}Bm.$inject=["eventBus","canvas","selection","styles"],Om.$inject=["eventBus","selection","canvas","elementRegistry"];const Mn={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Bo,Nm],selection:["type",Hr],selectionVisuals:["type",Bm],selectionBehavior:["type",Om]};function uu(t){this._counter=0,this._prefix=(t?t+"-":"")+Math.floor(1e9*Math.random())+"-"}uu.prototype.next=function(){return this._prefix+ ++this._counter};var Mx=new uu("ov");function ue(t,e,n,i){var r,o;this._eventBus=e,this._canvas=n,this._elementRegistry=i,this._ids=Mx,this._overlayDefaults=z({show:null,scale:!0},t&&t.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),o=Lt('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(o,r.firstChild),o),this._init()}function Lm(t,e,n){z(t.style,{left:e+"px",top:n+"px"})}function Oo(t,e){t.style.display=e===!1?"none":""}function jm(t,e){t.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){t.style[n+"transform"]=e})}ue.$inject=["config.overlays","eventBus","canvas","elementRegistry"],ue.prototype.get=function(t){if(Ie(t)&&(t={id:t}),Ie(t.element)&&(t.element=this._elementRegistry.get(t.element)),t.element){var e=this._getOverlayContainer(t.element,!0);return e?t.type?mt(e.overlays,Ye({type:t.type})):e.overlays.slice():[]}return t.type?mt(this._overlays,Ye({type:t.type})):t.id?this._overlays[t.id]:null},ue.prototype.add=function(t,e,n){if(Jt(e)&&(n=e,e=null),t.id||(t=this._elementRegistry.get(t)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!t)throw new Error("invalid element specified");var i=this._ids.next();return n=z({},this._overlayDefaults,n,{id:i,type:e,element:t,html:n.html}),this._addOverlay(n),i},ue.prototype.remove=function(t){var e=this.get(t)||[];gt(e)||(e=[e]);var n=this;L(e,function(i){var r=n._getOverlayContainer(i.element,!0);if(i&&(Tn(i.html),Tn(i.htmlContainer),delete i.htmlContainer,delete i.element,delete n._overlays[i.id]),r){var o=r.overlays.indexOf(i);o!==-1&&r.overlays.splice(o,1)}})},ue.prototype.show=function(){Oo(this._overlayRoot)},ue.prototype.hide=function(){Oo(this._overlayRoot,!1)},ue.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Ua(this._overlayRoot)},ue.prototype._updateOverlayContainer=function(t){var e=t.element,n=t.html,i=e.x,r=e.y;if(e.waypoints){var o=ve(e);i=o.x,r=o.y}Lm(n,i,r),ze(t.html,"data-container-id",e.id)},ue.prototype._updateOverlay=function(t){var e,n,i=t.position,r=t.htmlContainer,o=t.element,a=i.left,c=i.top;i.right!==void 0&&(e=o.waypoints?ve(o).width:o.width,a=-1*i.right+e),i.bottom!==void 0&&(n=o.waypoints?ve(o).height:o.height,c=-1*i.bottom+n),Lm(r,a||0,c||0)},ue.prototype._createOverlayContainer=function(t){var e=Lt('<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(",")+")";jm(this._overlayRoot,n)},ue.prototype._getOverlayContainer=function(t,e){var n=kt(this._overlayContainers,function(i){return i.element===t});return n||e?n:this._createOverlayContainer(t)},ue.prototype._addOverlay=function(t){var e,n,i=t.id,r=t.element,o=t.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),Ie(o)&&(o=Lt(o)),n=this._getOverlayContainer(r),(e=Lt('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(o),t.type&&ne(e).add("djs-overlay-"+t.type);var a=this._canvas.findPlane(r),c=this._canvas.getActivePlane();t.plane=a,a!==c&&Oo(e,!1),t.htmlContainer=e,n.overlays.push(t),n.html.appendChild(e),this._overlays[i]=t,this._updateOverlay(t),this._updateOverlayVisibilty(t,this._canvas.viewbox())},ue.prototype._updateOverlayVisibilty=function(t,e){var n=t.show,i=t.plane,r=n&&n.minZoom,o=n&&n.maxZoom,a=t.htmlContainer,c=!0;(i!==this._canvas.getActivePlane()||n&&(Xe(r)&&r>e.scale||Xe(o)&&o<e.scale))&&(c=!1),Oo(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),Xe(n)&&e.scale<n&&(r=(1/e.scale||1)*n),Xe(i)&&e.scale>i&&(r=(1/e.scale||1)*i)),Xe(r)&&(c="scale("+r+","+r+")"),jm(a,c)},ue.prototype._updateOverlaysVisibilty=function(t){var e=this;L(this._overlays,function(n){e._updateOverlayVisibilty(n,t)})},ue.prototype._init=function(){var t=this._eventBus,e=this;t.on("canvas.viewbox.changing",function(n){e.hide()}),t.on("canvas.viewbox.changed",function(n){var i;i=n.viewbox,e._updateRoot(i),e._updateOverlaysVisibilty(i),e.show()}),t.on(["shape.remove","connection.remove"],function(n){var i=n.element;L(e.get({element:i}),function(a){e.remove(a.id)});var r=e._getOverlayContainer(i);if(r){Tn(r.html);var o=e._overlayContainers.indexOf(r);o!==-1&&e._overlayContainers.splice(o,1)}}),t.on("element.changed",500,function(n){var i=n.element,r=e._getOverlayContainer(i,!0);r&&(L(r.overlays,function(o){e._updateOverlay(o)}),e._updateOverlayContainer(r))}),t.on("element.marker.update",function(n){var i=e._getOverlayContainer(n.element,!0);i&&ne(i.html)[n.add?"add":"remove"](n.marker)}),t.on("plane.set",function(n){L(e._overlays,function(i){Oo(i.htmlContainer,i.plane===n.plane)})}),t.on("diagram.clear",this.clear,this)};const pu={__init__:["overlays"],overlays:["type",ue]};function Wn(t){$t.call(this,t)}rt(Wn,$t),Wn.prototype._modules=[Ax,ds,Mn,pu],Wn.prototype._moddleExtensions={};var Rx=["c","C",67],Nx=["v","V",86],Ix=["y","Y",89],Vm=["z","Z",90];function He(t){return!t.altKey&&(t.ctrlKey||t.metaKey)}function fn(t,e){return(t=gt(t)?t:[t]).indexOf(e.key)!==-1||t.indexOf(e.keyCode)!==-1}function hu(t){return t.shiftKey}var bs="keyboard.keydown",Fm="input-handle-modified-keys";function pe(t,e){var n=this;this._config=t||{},this._eventBus=e,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),e.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.on("diagram.init",function(){n._fire("init")}),e.on("attach",function(){t&&t.bindTo&&n.bind(t.bindTo)}),e.on("detach",function(){n.unbind()})}pe.$inject=["config.keyboard","eventBus"],pe.prototype._keydownHandler=function(t){this._keyHandler(t,bs)},pe.prototype._keyupHandler=function(t){this._keyHandler(t,"keyboard.keyup")},pe.prototype._keyHandler=function(t,e){if(!this._isEventIgnored(t)){var n={keyEvent:t};this._eventBus.fire(e||bs,n)&&t.preventDefault()}},pe.prototype._isEventIgnored=function(t){return(e=t.target)&&(Ha(e,"input, textarea")||e.contentEditable==="true")&&this._isModifiedKeyIgnored(t);var e},pe.prototype._isModifiedKeyIgnored=function(t){return!He(t)||!this._getAllowedModifiers(t.target).includes(t.key)},pe.prototype._getAllowedModifiers=function(t){var e=Ui(t,"["+Fm+"]",!0);return!e||this._node&&!this._node.contains(e)?[]:e.getAttribute(Fm).split(",")},pe.prototype.bind=function(t){this.unbind(),this._node=t,ct.bind(t,"keydown",this._keydownHandler,!0),ct.bind(t,"keyup",this._keyupHandler,!0),this._fire("bind")},pe.prototype.getBinding=function(){return this._node},pe.prototype.unbind=function(){var t=this._node;t&&(this._fire("unbind"),ct.unbind(t,"keydown",this._keydownHandler,!0),ct.unbind(t,"keyup",this._keyupHandler,!0)),this._node=null},pe.prototype._fire=function(t){this._eventBus.fire("keyboard."+t,{node:this._node})},pe.prototype.addListener=function(t,e,n){fe(t)&&(n=e,e=t,t=1e3),this._eventBus.on(n||bs,t,e)},pe.prototype.removeListener=function(t,e){this._eventBus.off(e||bs,t)},pe.prototype.hasModifier=function(t){return t.ctrlKey||t.metaKey||t.shiftKey||t.altKey},pe.prototype.isCmd=He,pe.prototype.isShift=hu,pe.prototype.isKey=fn;function qr(t,e){var n=this;t.on("editorActions.init",500,function(i){var r=i.editorActions;n.registerBindings(e,r)})}qr.$inject=["eventBus","keyboard"],qr.prototype.registerBindings=function(t,e){function n(i,r){e.isRegistered(i)&&t.addListener(r)}n("undo",function(i){if(function(r){return He(r)&&!hu(r)&&fn(Vm,r)}(i.keyEvent))return e.trigger("undo"),!0}),n("redo",function(i){if(function(r){return He(r)&&(fn(Ix,r)||fn(Vm,r)&&hu(r))}(i.keyEvent))return e.trigger("redo"),!0}),n("copy",function(i){if(function(r){return He(r)&&fn(Rx,r)}(i.keyEvent))return e.trigger("copy"),!0}),n("paste",function(i){if(function(r){return He(r)&&fn(Nx,r)}(i.keyEvent))return e.trigger("paste"),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(fn(["+","Add","="],r)&&He(r))return e.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(i){var r=i.keyEvent;if(fn(["-","Subtract"],r)&&He(r))return e.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(i){var r=i.keyEvent;if(fn("0",r)&&He(r))return e.trigger("zoom",{value:1}),!0}),n("removeSelection",function(i){if(fn(["Backspace","Delete","Del"],i.keyEvent))return e.trigger("removeSelection"),!0})};const du={__init__:["keyboard","keyboardBindings"],keyboard:["type",pe],keyboardBindings:["type",qr]};var Dx={moveSpeed:50,moveSpeedAccelerated:200};function zm(t,e,n){var i=this;this._config=z({},Dx,t||{}),e.addListener(function(r){var o=r.keyEvent,a=i._config;if(e.isCmd(o)&&e.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],o)){var c,l=e.isShift(o)?a.moveSpeedAccelerated:a.moveSpeed;switch(o.key){case"ArrowLeft":case"Left":c="left";break;case"ArrowUp":case"Up":c="up";break;case"ArrowRight":case"Right":c="right";break;case"ArrowDown":case"Down":c="down"}return i.moveCanvas({speed:l,direction:c}),!0}}),this.moveCanvas=function(r){var o=0,a=0,c=r.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(r.direction){case"left":o=c;break;case"up":a=c;break;case"right":o=-c;break;case"down":a=-c}n.scroll({dx:o,dy:a})}}zm.$inject=["config.keyboardMove","keyboard","canvas"];const $m={__depends__:[du],__init__:["keyboardMove"],keyboardMove:["type",zm]};var Bx=/^djs-cursor-.*$/;function xs(t){var e=ne(document.body);e.removeMatching(Bx),t&&e.add("djs-cursor-"+t)}function Gm(){xs(null)}function Um(t,e){function n(){return!1}return e=e||"element.click",t.once(e,5e3,n),function(){t.off(e,n)}}function Lo(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Rn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Hm(t,e){var n;function i(o){var a,c=n.start,l=n.button,u=xi(o),p=Rn(u,c);!n.dragging&&(a=p,Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2))>15)&&(n.dragging=!0,l===0&&Um(t),xs("grab")),n.dragging&&(p=Rn(u,n.last||n.start),e.scroll({dx:p.x,dy:p.y}),n.last=u),o.preventDefault()}function r(o){ct.unbind(document,"mousemove",i),ct.unbind(document,"mouseup",r),n=null,Gm()}t.on("element.mousedown",500,function(o){return function(a){if(!Ui(a.target,".djs-draggable")){var c=a.button;if(!(c>=2||a.ctrlKey||a.shiftKey||a.altKey))return n={button:c,start:xi(a)},ct.bind(document,"mousemove",i),ct.bind(document,"mouseup",r),!0}}(o.originalEvent)}),this.isActive=function(){return!!n}}Hm.$inject=["eventBus","canvas"];const qm={__init__:["moveCanvas"],moveCanvas:["type",Hm]};function mu(t){return Math.log(t)/Math.log(10)}function Wm(t,e){var n=mu(t.min),i=mu(t.max);return(Math.abs(n)+Math.abs(i))/e}var Ox=Math.sign||function(t){return t>=0?1:-1},fu={min:.2,max:4};function Nn(t,e,n){t=t||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=_e(this._handleWheel,this),this._totalDelta=0,this._scale=t.scale||.75;var i=this;e.on("canvas.init",function(r){i._init(t.enabled!==!1)})}Nn.$inject=["config.zoomScroll","eventBus","canvas"],Nn.prototype.scroll=function(t){this._canvas.scroll(t)},Nn.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Nn.prototype.zoom=function(t,e){var n=Wm(fu,20);this._totalDelta+=t,Math.abs(this._totalDelta)>.1&&(this._zoom(t,e,n),this._totalDelta=0)},Nn.prototype._handleWheel=function(t){if(!Ui(t.target,".djs-scrollable",!0)){var e=this._container;t.preventDefault();var n,i=t.ctrlKey,r=t.shiftKey,o=-1*this._scale;if(o*=i?t.deltaMode===0?.02:.32:t.deltaMode===0?1:16,i){var a=e.getBoundingClientRect(),c={x:t.clientX-a.left,y:t.clientY-a.top};n=Math.sqrt(Math.pow(t.deltaY,2)+Math.pow(t.deltaX,2))*Ox(t.deltaY)*o,this.zoom(n,c)}else n=r?{dx:o*t.deltaY,dy:0}:{dx:o*t.deltaX,dy:o*t.deltaY},this.scroll(n)}},Nn.prototype.stepZoom=function(t,e){var n=Wm(fu,10);this._zoom(t,e,n)},Nn.prototype._zoom=function(t,e,n){var i=this._canvas,r=t>0?1:-1,o=mu(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var c,l,u=Math.pow(10,a);i.zoom((c=fu,l=u,Math.max(c.min,Math.min(c.max,l))),e)},Nn.prototype.toggle=function(t){var e=this._container,n=this._handleWheel,i=this._enabled;return t===void 0&&(t=!i),i!==t&&ct[t?"bind":"unbind"](e,"wheel",n,!1),this._enabled=t,t},Nn.prototype._init=function(t){this.toggle(t)};const Xm={__init__:["zoomScroll"],zoomScroll:["type",Nn]};function jo(t){Wn.call(this,t)}rt(jo,Wn),jo.prototype._navigationModules=[$m,qm,Xm],jo.prototype._modules=[].concat(Wn.prototype._modules,jo.prototype._navigationModules);var Km={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
- * http://hammerjs.github.io/
- *
- * Copyright (c) 2016 Jorik Tangelder;
- * Licensed under the MIT license */(function(t){(function(e,n,i,r){var o,a=["","webkit","Moz","MS","ms","o"],c=n.createElement("div"),l=Math.round,u=Math.abs,p=Date.now;function d(k,O,F){return setTimeout(S(k,F),O)}function y(k,O,F){return!!Array.isArray(k)&&(f(k,F[O],F),!0)}function f(k,O,F){var U;if(k)if(k.forEach)k.forEach(O,F);else if(k.length!==r)for(U=0;U<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 v(k,O,F){var U="DEPRECATED METHOD: "+O+`
- `+F+` AT
- `;return function(){var Y=new Error("get-stack-trace"),ft=Y&&Y.stack?Y.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",Dt=e.console&&(e.console.warn||e.console.log);return Dt&&Dt.call(e.console,U,ft),k.apply(this,arguments)}}o=typeof Object.assign!="function"?function(k){if(k===r||k===null)throw new TypeError("Cannot convert undefined or null to object");for(var O=Object(k),F=1;F<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 g=v(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`."),b=v(function(k,O){return g(k,O,!0)},"merge","Use `assign`.");function E(k,O,F){var U,Y=O.prototype;(U=k.prototype=Object.create(Y)).constructor=k,U._super=Y,F&&o(U,F)}function S(k,O){return function(){return k.apply(O,arguments)}}function w(k,O){return typeof k=="function"?k.apply(O&&O[0]||r,O):k}function C(k,O){return k===r?O:k}function B(k,O,F){f(_(O),function(U){k.addEventListener(U,F,!1)})}function s(k,O,F){f(_(O),function(U){k.removeEventListener(U,F,!1)})}function h(k,O){for(;k;){if(k==O)return!0;k=k.parentNode}return!1}function m(k,O){return k.indexOf(O)>-1}function _(k){return k.trim().split(/\s+/g)}function T(k,O,F){if(k.indexOf&&!F)return k.indexOf(O);for(var U=0;U<k.length;){if(F&&k[U][F]==O||!F&&k[U]===O)return U;U++}return-1}function M(k){return Array.prototype.slice.call(k,0)}function I(k,O,F){for(var U=[],Y=[],ft=0;ft<k.length;){var Dt=O?k[ft][O]:k[ft];T(Y,Dt)<0&&U.push(k[ft]),Y[ft]=Dt,ft++}return F&&(U=O?U.sort(function(me,Ct){return me[O]>Ct[O]}):U.sort()),U}function $(k,O){for(var F,U,Y=O[0].toUpperCase()+O.slice(1),ft=0;ft<a.length;){if((U=(F=a[ft])?F+Y:O)in k)return U;ft++}return r}var P=1;function x(k){var O=k.ownerDocument||k;return O.defaultView||O.parentWindow||e}var N="ontouchstart"in e,j=$(e,"PointerEvent")!==r,G=N&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),W="touch",tt="mouse",it=24,at=["x","y"],H=["clientX","clientY"];function q(k,O){var F=this;this.manager=k,this.callback=O,this.element=k.element,this.target=k.options.inputTarget,this.domHandler=function(U){w(k.options.enable,[k])&&F.handler(U)},this.init()}function jt(k,O,F){var U=F.pointers.length,Y=F.changedPointers.length,ft=1&O&&U-Y==0,Dt=12&O&&U-Y==0;F.isFirst=!!ft,F.isFinal=!!Dt,ft&&(k.session={}),F.eventType=O,function(me,Ct){var Ee=me.session,La=Ct.pointers,Gh=La.length;Ee.firstInput||(Ee.firstInput=Ht(Ct)),Gh>1&&!Ee.firstMultiple?Ee.firstMultiple=Ht(Ct):Gh===1&&(Ee.firstMultiple=!1);var Uh=Ee.firstInput,fr=Ee.firstMultiple,Hh=fr?fr.center:Uh.center,qh=Ct.center=he(La);Ct.timeStamp=p(),Ct.deltaTime=Ct.timeStamp-Uh.timeStamp,Ct.angle=oe(Hh,qh),Ct.distance=Et(Hh,qh),function(pn,ce){var ci=ce.center,Vi=pn.offsetDelta||{},Fi=pn.prevDelta||{},zi=pn.prevInput||{};ce.eventType!==1&&zi.eventType!==4||(Fi=pn.prevDelta={x:zi.deltaX||0,y:zi.deltaY||0},Vi=pn.offsetDelta={x:ci.x,y:ci.y}),ce.deltaX=Fi.x+(ci.x-Vi.x),ce.deltaY=Fi.y+(ci.y-Vi.y)}(Ee,Ct),Ct.offsetDirection=qt(Ct.deltaX,Ct.deltaY);var vr=Vt(Ct.deltaTime,Ct.deltaX,Ct.deltaY);Ct.overallVelocityX=vr.x,Ct.overallVelocityY=vr.y,Ct.overallVelocity=u(vr.x)>u(vr.y)?vr.x:vr.y,Ct.scale=fr?(dl=fr.pointers,ml=La,Et(ml[0],ml[1],H)/Et(dl[0],dl[1],H)):1,Ct.rotation=fr?function(pn,ce){return oe(ce[1],ce[0],H)+oe(pn[1],pn[0],H)}(fr.pointers,La):0,Ct.maxPointers=Ee.prevInput?Ct.pointers.length>Ee.prevInput.maxPointers?Ct.pointers.length:Ee.prevInput.maxPointers:Ct.pointers.length,function(pn,ce){var ci,Vi,Fi,zi,li=pn.lastInterval||ce,Wh=ce.timeStamp-li.timeStamp;if(ce.eventType!=8&&(Wh>25||li.velocity===r)){var Xh=ce.deltaX-li.deltaX,Kh=ce.deltaY-li.deltaY,yr=Vt(Wh,Xh,Kh);Vi=yr.x,Fi=yr.y,ci=u(yr.x)>u(yr.y)?yr.x:yr.y,zi=qt(Xh,Kh),pn.lastInterval=ce}else ci=li.velocity,Vi=li.velocityX,Fi=li.velocityY,zi=li.direction;ce.velocity=ci,ce.velocityX=Vi,ce.velocityY=Fi,ce.direction=zi}(Ee,Ct);var dl,ml,fl=me.element;h(Ct.srcEvent.target,fl)&&(fl=Ct.srcEvent.target),Ct.target=fl}(k,F),k.emit("hammer.input",F),k.recognize(F),k.session.prevInput=F}function Ht(k){for(var O=[],F=0;F<k.pointers.length;)O[F]={clientX:l(k.pointers[F].clientX),clientY:l(k.pointers[F].clientY)},F++;return{timeStamp:p(),pointers:O,center:he(O),deltaX:k.deltaX,deltaY:k.deltaY}}function he(k){var O=k.length;if(O===1)return{x:l(k[0].clientX),y:l(k[0].clientY)};for(var F=0,U=0,Y=0;Y<O;)F+=k[Y].clientX,U+=k[Y].clientY,Y++;return{x:l(F/O),y:l(U/O)}}function Vt(k,O,F){return{x:O/k||0,y:F/k||0}}function qt(k,O){return k===O?1:u(k)>=u(O)?k<0?2:4:O<0?8:16}function Et(k,O,F){F||(F=at);var U=O[F[0]]-k[F[0]],Y=O[F[1]]-k[F[1]];return Math.sqrt(U*U+Y*Y)}function oe(k,O,F){F||(F=at);var U=O[F[0]]-k[F[0]],Y=O[F[1]]-k[F[1]];return 180*Math.atan2(Y,U)/Math.PI}q.prototype={handler:function(){},init:function(){this.evEl&&B(this.element,this.evEl,this.domHandler),this.evTarget&&B(this.target,this.evTarget,this.domHandler),this.evWin&&B(x(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&s(this.element,this.evEl,this.domHandler),this.evTarget&&s(this.target,this.evTarget,this.domHandler),this.evWin&&s(x(this.element),this.evWin,this.domHandler)}};var se={mousedown:1,mousemove:2,mouseup:4},Mt="mousedown",de="mousemove mouseup";function _t(){this.evEl=Mt,this.evWin=de,this.pressed=!1,q.apply(this,arguments)}E(_t,q,{handler:function(k){var O=se[k.type];1&O&&k.button===0&&(this.pressed=!0),2&O&&k.which!==1&&(O=4),this.pressed&&(4&O&&(this.pressed=!1),this.callback(this.manager,O,{pointers:[k],changedPointers:[k],pointerType:tt,srcEvent:k}))}});var Te={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},pt={2:W,3:"pen",4:tt,5:"kinect"},It="pointerdown",ii="pointermove pointerup pointercancel";function ri(){this.evEl=It,this.evWin=ii,q.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&(It="MSPointerDown",ii="MSPointerMove MSPointerUp MSPointerCancel"),E(ri,q,{handler:function(k){var O=this.store,F=!1,U=k.type.toLowerCase().replace("ms",""),Y=Te[U],ft=pt[k.pointerType]||k.pointerType,Dt=ft==W,me=T(O,k.pointerId,"pointerId");1&Y&&(k.button===0||Dt)?me<0&&(O.push(k),me=O.length-1):12&Y&&(F=!0),me<0||(O[me]=k,this.callback(this.manager,Y,{pointers:O,changedPointers:[k],pointerType:ft,srcEvent:k}),F&&O.splice(me,1))}});var Yt={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function Ae(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,q.apply(this,arguments)}function Ln(k,O){var F=M(k.touches),U=M(k.changedTouches);return 12&O&&(F=I(F.concat(U),"identifier",!0)),[F,U]}E(Ae,q,{handler:function(k){var O=Yt[k.type];if(O===1&&(this.started=!0),this.started){var F=Ln.call(this,k,O);12&O&&F[0].length-F[1].length==0&&(this.started=!1),this.callback(this.manager,O,{pointers:F[0],changedPointers:F[1],pointerType:W,srcEvent:k})}}});var oi={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Ra="touchstart touchmove touchend touchcancel";function Na(){this.evTarget=Ra,this.targetIds={},q.apply(this,arguments)}function Hb(k,O){var F=M(k.touches),U=this.targetIds;if(3&O&&F.length===1)return U[F[0].identifier]=!0,[F,F];var Y,ft,Dt=M(k.changedTouches),me=[],Ct=this.target;if(ft=F.filter(function(Ee){return h(Ee.target,Ct)}),O===1)for(Y=0;Y<ft.length;)U[ft[Y].identifier]=!0,Y++;for(Y=0;Y<Dt.length;)U[Dt[Y].identifier]&&me.push(Dt[Y]),12&O&&delete U[Dt[Y].identifier],Y++;return me.length?[I(ft.concat(me),"identifier",!0),me]:void 0}E(Na,q,{handler:function(k){var O=oi[k.type],F=Hb.call(this,k,O);F&&this.callback(this.manager,O,{pointers:F[0],changedPointers:F[1],pointerType:W,srcEvent:k})}});function ol(){q.apply(this,arguments);var k=S(this.handler,this);this.touch=new Na(this.manager,k),this.mouse=new _t(this.manager,k),this.primaryTouch=null,this.lastTouches=[]}function qb(k,O){1&k?(this.primaryTouch=O.changedPointers[0].identifier,Bh.call(this,O)):12&k&&Bh.call(this,O)}function Bh(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)},2500)}}function Wb(k){for(var O=k.srcEvent.clientX,F=k.srcEvent.clientY,U=0;U<this.lastTouches.length;U++){var Y=this.lastTouches[U],ft=Math.abs(O-Y.x),Dt=Math.abs(F-Y.y);if(ft<=25&&Dt<=25)return!0}return!1}E(ol,q,{handler:function(k,O,F){var U=F.pointerType==W,Y=F.pointerType==tt;if(!(Y&&F.sourceCapabilities&&F.sourceCapabilities.firesTouchEvents)){if(U)qb.call(this,O,F);else if(Y&&Wb.call(this,F))return;this.callback(k,O,F)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Oh=$(c.style,"touchAction"),Lh=Oh!==r,jh="compute",Vh="auto",al="manipulation",ji="none",ho="pan-x",mo="pan-y",Ia=function(){if(!Lh)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 sl(k,O){this.manager=k,this.set(O)}sl.prototype={set:function(k){k==jh&&(k=this.compute()),Lh&&this.manager.element.style&&Ia[k]&&(this.manager.element.style[Oh]=k),this.actions=k.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var k=[];return f(this.manager.recognizers,function(O){w(O.options.enable,[O])&&(k=k.concat(O.getTouchAction()))}),function(O){if(m(O,ji))return ji;var F=m(O,ho),U=m(O,mo);return F&&U?ji:F||U?F?ho:mo:m(O,al)?al:Vh}(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=m(U,ji)&&!Ia[ji],ft=m(U,mo)&&!Ia[mo],Dt=m(U,ho)&&!Ia[ho];if(Y){var me=k.pointers.length===1,Ct=k.distance<2,Ee=k.deltaTime<250;if(me&&Ct&&Ee)return}if(!Dt||!ft)return Y||ft&&6&F||Dt&&F&it?this.preventSrc(O):void 0}},preventSrc:function(k){this.manager.session.prevented=!0,k.preventDefault()}};var ai=32;function jn(k){this.options=o({},this.defaults,k||{}),this.id=P++,this.manager=null,this.options.enable=C(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Fh(k){return 16&k?"cancel":8&k?"end":4&k?"move":2&k?"start":""}function zh(k){return k==16?"down":k==8?"up":k==2?"left":k==4?"right":""}function Da(k,O){var F=O.manager;return F?F.get(k):k}function un(){jn.apply(this,arguments)}function Ba(){un.apply(this,arguments),this.pX=null,this.pY=null}function cl(){un.apply(this,arguments)}function ll(){jn.apply(this,arguments),this._timer=null,this._input=null}function ul(){un.apply(this,arguments)}function pl(){un.apply(this,arguments)}function Oa(){jn.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function si(k,O){return(O=O||{}).recognizers=C(O.recognizers,si.defaults.preset),new hl(k,O)}jn.prototype={defaults:{},set:function(k){return o(this.options,k),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(k){if(y(k,"recognizeWith",this))return this;var O=this.simultaneous;return O[(k=Da(k,this)).id]||(O[k.id]=k,k.recognizeWith(this)),this},dropRecognizeWith:function(k){return y(k,"dropRecognizeWith",this)||(k=Da(k,this),delete this.simultaneous[k.id]),this},requireFailure:function(k){if(y(k,"requireFailure",this))return this;var O=this.requireFail;return T(O,k=Da(k,this))===-1&&(O.push(k),k.requireFailure(this)),this},dropRequireFailure:function(k){if(y(k,"dropRequireFailure",this))return this;k=Da(k,this);var O=T(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+Fh(F)),U(O.options.event),k.additionalEvent&&U(k.additionalEvent),F>=8&&U(O.options.event+Fh(F))},tryEmit:function(k){if(this.canEmit())return this.emit(k);this.state=ai},canEmit:function(){for(var k=0;k<this.requireFail.length;){if(!(33&this.requireFail[k].state))return!1;k++}return!0},recognize:function(k){var O=o({},k);if(!w(this.options.enable,[this,O]))return this.reset(),void(this.state=ai);56&this.state&&(this.state=1),this.state=this.process(O),30&this.state&&this.tryEmit(O)},process:function(k){},getTouchAction:function(){},reset:function(){}},E(un,jn,{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&&(8&F||!Y)?16|O:U||Y?4&F?8|O:2&O?4|O:2:ai}}),E(Ba,un,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var k=this.options.direction,O=[];return 6&k&&O.push(mo),k&it&&O.push(ho),O},directionTest:function(k){var O=this.options,F=!0,U=k.distance,Y=k.direction,ft=k.deltaX,Dt=k.deltaY;return Y&O.direction||(6&O.direction?(Y=ft===0?1:ft<0?2:4,F=ft!=this.pX,U=Math.abs(k.deltaX)):(Y=Dt===0?1:Dt<0?8:16,F=Dt!=this.pY,U=Math.abs(k.deltaY))),k.direction=Y,F&&U>O.threshold&&Y&O.direction},attrTest:function(k){return un.prototype.attrTest.call(this,k)&&(2&this.state||!(2&this.state)&&this.directionTest(k))},emit:function(k){this.pX=k.deltaX,this.pY=k.deltaY;var O=zh(k.direction);O&&(k.additionalEvent=this.options.event+O),this._super.emit.call(this,k)}}),E(cl,un,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ji]},attrTest:function(k){return this._super.attrTest.call(this,k)&&(Math.abs(k.scale-1)>this.options.threshold||2&this.state)},emit:function(k){if(k.scale!==1){var O=k.scale<1?"in":"out";k.additionalEvent=this.options.event+O}this._super.emit.call(this,k)}}),E(ll,jn,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Vh]},process:function(k){var O=this.options,F=k.pointers.length===O.pointers,U=k.distance<O.threshold,Y=k.deltaTime>O.time;if(this._input=k,!U||!F||12&k.eventType&&!Y)this.reset();else if(1&k.eventType)this.reset(),this._timer=d(function(){this.state=8,this.tryEmit()},O.time,this);else if(4&k.eventType)return 8;return ai},reset:function(){clearTimeout(this._timer)},emit:function(k){this.state===8&&(k&&4&k.eventType?this.manager.emit(this.options.event+"up",k):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),E(ul,un,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ji]},attrTest:function(k){return this._super.attrTest.call(this,k)&&(Math.abs(k.rotation)>this.options.threshold||2&this.state)}}),E(pl,un,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ba.prototype.getTouchAction.call(this)},attrTest:function(k){var O,F=this.options.direction;return 30&F?O=k.overallVelocity:6&F?O=k.overallVelocityX:F&it&&(O=k.overallVelocityY),this._super.attrTest.call(this,k)&&F&k.offsetDirection&&k.distance>this.options.threshold&&k.maxPointers==this.options.pointers&&u(O)>this.options.velocity&&4&k.eventType},emit:function(k){var O=zh(k.offsetDirection);O&&this.manager.emit(this.options.event+O,k),this.manager.emit(this.options.event,k)}}),E(Oa,jn,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[al]},process:function(k){var O=this.options,F=k.pointers.length===O.pointers,U=k.distance<O.threshold,Y=k.deltaTime<O.time;if(this.reset(),1&k.eventType&&this.count===0)return this.failTimeout();if(U&&Y&&F){if(k.eventType!=4)return this.failTimeout();var ft=!this.pTime||k.timeStamp-this.pTime<O.interval,Dt=!this.pCenter||Et(this.pCenter,k.center)<O.posThreshold;if(this.pTime=k.timeStamp,this.pCenter=k.center,Dt&&ft?this.count+=1:this.count=1,this._input=k,this.count%O.taps===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=8,this.tryEmit()},O.interval,this),2):8}return ai},failTimeout:function(){return this._timer=d(function(){this.state=ai},this.options.interval,this),ai},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==8&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),si.VERSION="2.0.7",si.defaults={domEvents:!1,touchAction:jh,enable:!0,inputTarget:null,inputClass:null,preset:[[ul,{enable:!1}],[cl,{enable:!1},["rotate"]],[pl,{direction:6}],[Ba,{direction:6},["swipe"]],[Oa],[Oa,{event:"doubletap",taps:2},["tap"]],[ll]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function hl(k,O){var F;this.options=o({},si.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||(j?ri:G?Na:N?ol:_t))(F,jt),this.touchAction=new sl(this,this.options.touchAction),$h(this,!0),f(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 $h(k,O){var F,U=k.element;U.style&&(f(k.options.cssProps,function(Y,ft){F=$(U.style,ft),O?(k.oldCssProps[F]=U.style[F],U.style[F]=Y):U.style[F]=k.oldCssProps[F]||""}),O||(k.oldCssProps={}))}hl.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 ft=0;ft<U.length;)F=U[ft],O.stopped===2||Y&&F!=Y&&!F.canRecognizeWith(Y)?F.reset():F.recognize(k),!Y&&14&F.state&&(Y=O.curRecognizer=F),ft++}},get:function(k){if(k instanceof jn)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(y(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(y(k,"remove",this))return this;if(k=this.get(k)){var O=this.recognizers,F=T(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 f(_(k),function(U){F[U]=F[U]||[],F[U].push(O)}),this}},off:function(k,O){if(k!==r){var F=this.handlers;return f(_(k),function(U){O?F[U]&&F[U].splice(T(F[U],O),1):delete F[U]}),this}},emit:function(k,O){this.options.domEvents&&function(Y,ft){var Dt=n.createEvent("Event");Dt.initEvent(Y,!0,!0),Dt.gesture=ft,ft.target.dispatchEvent(Dt)}(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&&$h(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(si,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:ai,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:it,DIRECTION_ALL:30,Manager:hl,Input:q,TouchAction:sl,TouchInput:Na,MouseInput:_t,PointerEventInput:ri,TouchMouseInput:ol,SingleTouchInput:Ae,Recognizer:jn,AttrRecognizer:un,Tap:Oa,Pan:Ba,Swipe:pl,Pinch:cl,Rotate:ul,Press:ll,on:B,off:s,each:f,merge:b,extend:g,assign:o,inherit:E,bindFn:S,prefixed:$}),(e!==void 0?e:typeof self<"u"?self:{}).Hammer=si,t.exports?t.exports=si:e.Hammer=si})(window,document)})(Km);const Yi=gr(Km.exports);var Ym=["mousedown","mouseup","mouseover","mouseout","click","dblclick"];function Es(t,e){return e.get(t,!1)}function vu(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 yu(t){function e(l){setTimeout(function(){L(Ym,function(u){ct.unbind(t,u,vu,!0)})},500)}ct.bind(t,"touchstart",function(l){L(Ym,function(u){ct.bind(t,u,vu,!0)})},!0),ct.bind(t,"touchend",e,!0),ct.bind(t,"touchcancel",e,!0);var n=new Yi.Manager(t,{inputClass:Yi.TouchInput,recognizers:[],domEvents:!0}),i=new Yi.Tap,r=new Yi.Pan({threshold:10}),o=new Yi.Press,a=new Yi.Pinch,c=new Yi.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 Jm(t,e,n,i,r){var o,a=Es("dragging",t),c=Es("move",t),l=Es("contextPad",t),u=Es("palette",t);function p(f,v){return function(g){var b=d(g.target),E=b&&i.get(b);return v&&(g.srcEvent.button=v),r.fire(f,g,E)}}function d(f){return Ui(f,"svg, .djs-element",!0)}function y(f){function v(g){var b=d(g.target),E=b&&i.get(b);if(c&&e.getRootElement()!==E)return c.start(g,E,!0);(function(){var S=0,w=0;function C(s){var h=s.deltaX-S,m=s.deltaY-w;e.scroll({dx:h,dy:m}),S=s.deltaX,w=s.deltaY}function B(s){o.off("panmove",C),o.off("panend",B),o.off("pancancel",B)}o.on("panmove",C),o.on("panend",B),o.on("pancancel",B)})()}(o=yu(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(),E=g.center;function S(C){var B=1-(1-C.scale)/1.5,s=Math.max(.2,Math.min(4,B*b));e.zoom(s,E),vu(C)}function w(C){o.off("pinchmove",S),o.off("pinchend",w),o.off("pinchcancel",w),o.reset(!0)}o.on("pinchmove",S),o.on("pinchend",w),o.on("pinchcancel",w)})}a&&n.on("drag.move",function(f){var v=f.originalEvent;if(v&&!(v instanceof MouseEvent)){var g=xi(v),b=d(document.elementFromPoint(g.x,g.y)),E=b&&i.get(b);E!==f.hover&&(f.hover&&a.out(f),E&&(a.hover({element:E,gfx:b}),f.hover=E,f.hoverGfx=b))}}),l&&n.on("contextPad.create",function(f){var v=yu(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=yu(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 gu(t,e){var n=this;e.on("canvas.init",function(i){n.addBBoxMarker(i.svg)})}Jm.$inject=["injector","canvas","eventBus","elementRegistry","interactionEvents","touchFix"],gu.$inject=["canvas","eventBus"],gu.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 Lx={__depends__:[{__depends__:[Bo],__init__:["touchInteractionEvents"],touchInteractionEvents:["type",Jm],touchFix:["type",gu]}]};function bu(t){return t&&t[t.length-1]}function Zm(t){return t.y}function Qm(t){return t.x}var jx={left:Qm,center:Qm,right:function(t){return t.x+t.width},top:Zm,middle:Zm,bottom:function(t){return t.y+t.height}};function Wr(t){this._modeling=t}Wr.$inject=["modeling"],Wr.prototype._getOrientationDetails=function(t){var e="x",n="width";return["top","bottom","middle"].indexOf(t)!==-1&&(e="y",n="height"),{axis:e,dimension:n}},Wr.prototype._isType=function(t,e){return e.indexOf(t)!==-1},Wr.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=bu(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=Ke(u,function(d){return d.elements.length>1&&(p=!0),d.elements.length}),p)return l[t]=bu(n).center,l;i=e[0],r=bu(e=Ke(e,function(d){return d[a]+d[c]})),l[t]=function(d,y){return Math.round((d[a]+y[a]+y[c])/2)}(i,r)}return l},Wr.prototype.trigger=function(t,e){var n=this._modeling,i=mt(t,function(a){return!(a.waypoints||a.host||a.labelTarget)});if(!(i.length<2)){var r=Ke(i,jx[e]),o=this._alignmentPosition(e,r);n.alignElements(r,o)}};const Vx={__init__:["alignElements"],alignElements:["type",Wr]};function xu(t,e,n,i){for(var r;r=Fx(t,n,e);)n=i(e,n,r);return n}function Eu(t){return function(e,n,i){var r={x:n.x,y:n.y};return["x","y"].forEach(function(o){var a=t[o];if(a){var c=o==="x"?"width":"height",l=a.margin,u=a.minDistance;r[o]=l<0?Math.min(i[o]+l-e[c]/2,n[o]-u+l):Math.max(i[o]+i[c]+l+e[c]/2,n[o]+u+l)}}),r}}function Fx(t,e,n){var i={x:e.x-n.width/2,y:e.y-n.height/2,width:n.width,height:n.height},r=function(o){var a=_u(o);return o.host&&(a=a.concat(_u(o.host))),o.attachers&&(a=a.concat(o.attachers.reduce(function(c,l){return c.concat(_u(l))},[]))),a}(t);return kt(r,function(o){return o!==n&&ye(o,i,10)==="intersect"})}function _u(t){return(e=t,e.outgoing.map(function(n){return n.target})).concat(function(n){return n.incoming.map(function(i){return i.source})}(t));var e}function zx(){return!0}function tf(t,e,n){t.on("autoPlace",100,function(i){var r=i.shape;return function(o,a,c){c||(c={});var l=c.defaultDistance||50,u=vt(o),p=st(o);return{x:p.right+l+a.width/2,y:u.y}}(i.source,r)}),t.on("autoPlace.end",function(i){n.scrollToElement(i.shape)}),this.append=function(i,r,o){t.fire("autoPlace.start",{source:i,shape:r});var a=t.fire("autoPlace",{source:i,shape:r}),c=e.appendShape(i,r,a,i.parent,o);return t.fire("autoPlace.end",{source:i,shape:c}),c}}function ef(t,e){t.on("autoPlace.end",500,function(n){e.select(n.shape)})}tf.$inject=["eventBus","modeling","canvas"],ef.$inject=["eventBus","selection"];const $x={__init__:["autoPlaceSelectionBehavior"],autoPlace:["type",tf],autoPlaceSelectionBehavior:["type",ef]};function wt(t,e){return ui(e,function(n){return A(t,n)})}function _s(t,e){for(typeof e=="string"&&(e=[e]);t=t.parent;)if(wt(t,e))return t;return null}function nf(t,e){return A(e,"bpmn:TextAnnotation")?function(n,i){var r=st(n),o={x:r.right+i.width/2,y:r.top-50-i.height/2};return xu(n,i,o,Eu({y:{margin:-30,minDistance:20}}))}(t,e):wt(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])?function(n,i){var r=st(n),o={x:r.right-10+i.width/2,y:r.bottom+40+i.width/2};return xu(n,i,o,Eu({x:{margin:30,minDistance:30}}))}(t,e):A(e,"bpmn:FlowNode")?function(n,i){var r=st(n),o=vt(n),a=function(d,y){y||(y={});var f=y.defaultDistance||50,v=y.direction||"e",g=y.filter,b=y.getWeight||function(h){return h.source===d?1:-1},E=y.maxDistance||250,S=y.reference||"start";function w(h,m){return v==="n"?S==="start"?st(h).top-st(m).bottom:S==="center"?st(h).top-vt(m).y:st(h).top-st(m).top:v==="w"?S==="start"?st(h).left-st(m).right:S==="center"?st(h).left-vt(m).x:st(h).left-st(m).left:v==="s"?S==="start"?st(m).top-st(h).bottom:S==="center"?vt(m).y-st(h).bottom:st(m).bottom-st(h).bottom:S==="start"?st(m).left-st(h).right:S==="center"?vt(m).x-st(h).right:st(m).right-st(h).right}g||(g=zx);var C=d.incoming.filter(g).map(function(h){var m=b(h),_=m<0?w(h.source,d):w(d,h.source);return{id:h.source.id,distance:_,weight:m}}),B=d.outgoing.filter(g).map(function(h){var m=b(h),_=m>0?w(d,h.target):w(h.target,d);return{id:h.target.id,distance:_,weight:m}}),s=De(C.concat(B).reduce(function(h,m){return h[m.id+"__weight_"+m.weight]=m,h},{}),function(h,m){var _=m.distance,T=m.weight;return _<0||_>E||(h[String(_)]||(h[String(_)]=0),h[String(_)]+=1*T,(!h.distance||h[h.distance]<h[String(_)])&&(h.distance=_)),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+Gx(u,l)};return xu(n,i,p,Eu({y:{margin:c,minDistance:l}}))}(t,e):void 0}function Gx(t,e){return t.indexOf("top")!=-1?-1*e:t.indexOf("bottom")!=-1?e:0}function rf(t){t.on("autoPlace",function(e){var n=e.shape;return nf(e.source,n)})}rf.$inject=["eventBus"];const Ux={__depends__:[$x],__init__:["bpmnAutoPlace"],bpmnAutoPlace:["type",rf]};function Q(t){this._eventBus=t}Q.$inject=["eventBus"],Q.prototype.on=function(t,e,n,i,r,o){if((fe(e)||ht(e))&&(o=r,r=i,i=n,n=e,e=null),fe(n)&&(o=r,r=i,i=n,n=1e3),Jt(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 Xn(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=yo(Ga(a.closure.topLevel)),l=a.hints,u=!l||l.autoResize;u!==!1&&L(Gi(c,function(p){return p.parent.id}),function(p,d){gt(u)&&(p=p.filter(function(y){return kt(u,Ye({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 ws(t){t.invoke(Xn,this)}function _i(t){Q.call(this,t),this.init()}function Vo(t){_i.call(this,t);var e=this;this.addRule("element.autoResize",function(n){return e.canResize(n.elements,n.target)})}function Ss(t,e){Vo.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)||ht(e))&&(o=r,r=i,i=n,n=e,e=null),this.on(e,t,n,i,r,o)}}),Xn.$inject=["eventBus","elementRegistry","modeling","rules"],rt(Xn,Q),Xn.prototype._getOptimalBounds=function(t,e){var n=this.getOffset(e),i=this.getPadding(e),r=st(ve(t)),o=st(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),Xl(z({},o,a))},Xn.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=st(o),a=st(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}(Je(e,["x","y","width","height"]),n);this.resize(e,n,{autoResize:i});var r=e.parent;r&&this._expand([e],r)}}},Xn.prototype.getOffset=function(t){return{top:60,bottom:60,left:100,right:100}},Xn.prototype.getPadding=function(t){return{top:2,bottom:2,left:15,right:15}},Xn.prototype.resize=function(t,e,n){this._modeling.resizeShape(t,e,null,n)},ws.$inject=["injector"],rt(ws,Xn),ws.prototype.resize=function(t,e,n){A(t,"bpmn:Participant")?this._modeling.resizeLane(t,e,null,n):this._modeling.resizeShape(t,e,null,n)},_i.$inject=["eventBus"],rt(_i,Q),_i.prototype.addRule=function(t,e,n){var i=this;typeof t=="string"&&(t=[t]),t.forEach(function(r){i.canExecute(r,e,function(o,a,c){return n(o)},!0)})},_i.prototype.init=function(){},Vo.$inject=["eventBus"],rt(Vo,_i),Vo.prototype.canResize=function(t,e){return!1},rt(Ss,Vo),Ss.$inject=["eventBus","modeling"],Ss.prototype.canResize=function(t,e){if(!A(e,"bpmn:Participant")&&!A(e,"bpmn:Lane")&&!A(e,"bpmn:SubProcess"))return!1;var n=!0;return L(t,function(i){(A(i,"bpmn:Lane")||i.labelTarget)&&(n=!1)}),n};const Hx={__init__:["bpmnAutoResize","bpmnAutoResizeProvider"],bpmnAutoResize:["type",ws],bpmnAutoResizeProvider:["type",Ss]};function of(t,e,n){var i,r,o=this,a=n.get("dragging",!1);a&&e.on("drag.start",function(c){e.once("drag.move",1500,function(l){(function(u){if(!u.hover){var p=u.originalEvent,d=o._findTargetGfx(p),y=d&&t.get(d);d&&y&&(u.stopPropagation(),a.hover({element:y,gfx:d}),a.move(p))}})(l)})}),e.on("element.hover",function(c){i=c.gfx,r=c.element}),e.on("element.hover",1500,function(c){r&&e.fire("element.out",{element:r,gfx:i})}),e.on("element.out",function(){i=null,r=null}),this._findTargetGfx=function(c){var l;if(c instanceof MouseEvent)return l=xi(c),function(u){return Ui(u,"svg, .djs-element",!0)}(document.elementFromPoint(l.x,l.y))}}of.$inject=["elementRegistry","eventBus","injector"];const qx={__init__:["hoverFix"],hoverFix:["type",of]};var Xr=Math.round,af="djs-drag-active";function Ji(t){t.preventDefault()}function sf(t,e,n,i){var r,o={threshold:5,trapClick:!0};function a(E){var S=e.viewbox(),w=e._container.getBoundingClientRect();return{x:S.x+(E.x-w.left)/S.scale,y:S.y+(E.y-w.top)/S.scale}}function c(E,S){S=S||r;var w=t.createEvent(z({},S.payload,S.data,{isTouch:S.isTouch}));return t.fire("drag."+E,w)!==!1&&t.fire(S.prefix+"."+E,w)}function l(E,S){var w,C=r.payload,B=r.displacement,s=r.globalStart,h=xi(E),m=Rn(h,s),_=r.localStart,T=a(h),M=Rn(T,_);if(!r.active&&(S||(w=m,Math.sqrt(Math.pow(w.x,2)+Math.pow(w.y,2))>r.threshold))){if(z(C,{x:Xr(_.x+B.x),y:Xr(_.y+B.y),dx:0,dy:0},{originalEvent:E}),c("start")===!1)return g();r.active=!0,r.keepSelection||(C.previousSelection=n.get(),n.select(null)),r.cursor&&xs(r.cursor),e.addMarker(e.getRootElement(),af)}lu(E),r.active&&(z(C,{x:Xr(T.x+B.x),y:Xr(T.y+B.y),dx:Xr(M.x),dy:Xr(M.y)},{originalEvent:E}),c("move"))}function u(E){var S=!0;r.active&&(E&&(r.payload.originalEvent=E,lu(E)),S=c("end")),S===!1&&c("rejected"),c("ended",b(S!==!0))}function p(E){E.which===27&&(Ji(E),g())}function d(E){var S;r.active&&(S=Um(t),setTimeout(S,400),Ji(E)),u(E)}function y(E){l(E)}function f(E){var S=r.payload;S.hoverGfx=E.gfx,S.hover=E.element,c("hover")}function v(E){c("out");var S=r.payload;S.hoverGfx=null,S.hover=null}function g(E){var S;if(r){var w=r.active;w&&c("cancel"),S=b(E),w&&c("canceled",S)}}function b(E){var S,w;c("cleanup"),Gm(),w=r.trapClick?d:u,ct.unbind(document,"mousemove",l),ct.unbind(document,"dragstart",Ji),ct.unbind(document,"selectstart",Ji),ct.unbind(document,"mousedown",w,!0),ct.unbind(document,"mouseup",w,!0),ct.unbind(document,"keyup",p),ct.unbind(document,"touchstart",y,!0),ct.unbind(document,"touchcancel",g,!0),ct.unbind(document,"touchmove",l,!0),ct.unbind(document,"touchend",u,!0),t.off("element.hover",f),t.off("element.out",v),e.removeMarker(e.getRootElement(),af);var C=r.payload.previousSelection;return E!==!1&&C&&!n.get().length&&function(B){var s=B.filter(function(h){return i.get(h.id)});s.length&&n.select(s)}(C),S=r,r=null,S}t.on("diagram.destroy",g),this.init=function(E,S,w,C){r&&g(!1),typeof S=="string"&&(C=w,w=S,S=null);var B,s,h,m,_,T=(C=z({},o,C||{})).data||{};m=C.trapClick?d:u,E?(B=Gr(E)||E,s=xi(E),lu(E),B.type==="dragstart"&&Ji(B)):(B=null,s={x:0,y:0}),h=a(s),S||(S=h),_=function(M){return typeof TouchEvent<"u"&&M instanceof TouchEvent}(B),r=z({prefix:w,data:T,payload:{},globalStart:s,displacement:Rn(S,h),localStart:h,isTouch:_},C),C.manual||(_?(ct.bind(document,"touchstart",y,!0),ct.bind(document,"touchcancel",g,!0),ct.bind(document,"touchmove",l,!0),ct.bind(document,"touchend",u,!0)):(ct.bind(document,"mousemove",l),ct.bind(document,"dragstart",Ji),ct.bind(document,"selectstart",Ji),ct.bind(document,"mousedown",m,!0),ct.bind(document,"mouseup",m,!0)),ct.bind(document,"keyup",p),t.on("element.hover",f),t.on("element.out",v)),c("init"),C.autoActivate&&l(E,!0)},this.move=l,this.hover=f,this.out=v,this.end=u,this.cancel=g,this.context=function(){return r},this.setOptions=function(E){z(o,E)}}sf.$inject=["eventBus","canvas","selection","elementRegistry"];const Kn={__depends__:[qx,Mn],dragging:["type",sf]};function Kr(t,e,n){this._canvas=n,this._opts=z({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},t);var i=this;e.on("drag.move",function(r){var o=i._toBorderPoint(r);i.startScroll(o)}),e.on(["drag.cleanup"],function(){i.stopScroll()})}function Wx(t,e,n){return e<t&&t<n}Kr.$inject=["config.autoScroll","eventBus","canvas"],Kr.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++)Wx(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))},Kr.prototype.stopScroll=function(){clearTimeout(this._scrolling)},Kr.prototype.setOptions=function(t){this._opts=z({},this._opts,t)},Kr.prototype._toBorderPoint=function(t){var e=this._canvas._container.getBoundingClientRect(),n=xi(t.originalEvent);return{x:n.x-e.left,y:n.y-e.top}};const Xx={__depends__:[Kn],__init__:["autoScroll"],autoScroll:["type",Kr]};function wu(t){this._commandStack=t.get("commandStack",!1)}wu.$inject=["injector"],wu.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",wu]};var Cs=Math.round,Kx=Math.max;function Su(t,e){return function(n,i){var r,o;for(r=0;o=n[r];r++)if(So(o,i)<=10)return{point:n[r],bendpoint:!0,index:r};return null}(t,e)||function(n,i){var r,o,a=zd(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,10),(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=Kx(c.segment2,l.segment2)-1],bendpoint:!0,index:o}:{point:{x:Cs(c.x+l.x)/2,y:Cs(c.y+l.y)/2},index:c.segment2}:{point:{x:Cs(c.x),y:Cs(c.y)},index:c.segment2}:null}(t,e)}var cf="djs-bendpoint",lf="djs-segment-dragger";function Cu(t,e,n){var i=function(r,o){var a,c=xi(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 Su(e,i)}function Tu(t,e){var n=ot("g");bt(n).add(cf),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 Yx(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 pf(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),em(r,i==="v"?90:0),r}function uf(t,e,n){var i=ot("g"),r=Hl(e,n),o=Gn(e,n);return lt(t,i),Yx(i,e,n,o),bt(i).add(lf),bt(i).add(o==="h"?"horizontal":"vertical"),Oe(i,r.x,r.y),i}function pf(t){return Math.abs(Math.round(2*t/3))}var hf={exports:{}};/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */hf.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}(Yh);const Au=gr(hf.exports);var Jx={"&":"&","<":"<",">":">",'"':""","'":"'"};function df(t){return(t=""+t)&&t.replace(/[&<>"']/g,function(e){return Jx[e]})}function mf(t,e,n,i,r){function o(v,g){var b,E=g.waypoints,S=Cu(e,E,v);if(S)return b=function(w,C){var B,s,h=w.waypoints;return C.index<=0||C.bendpoint?null:(s=Gn((B={start:h[C.index-1],end:h[C.index]}).start,B.end))?pf(s==="h"?B.end.x-B.start.x:B.end.y-B.start.y)/2:null}(g,S),function(w,C,B){var s,h,m,_,T,M,I=w.index,$=w.point;return!(I<=0||w.bendpoint)&&(m=Hl(s=C[I-1],h=C[I]),_=Gn(s,h),T=Math.abs($.x-m.x),M=Math.abs($.y-m.y),_&&T<=B&&M<=B)}(S,E,b)?r.start(v,g,S.index):i.start(v,g,S.index,!S.bendpoint),!0}function a(v,g,b){ct.bind(v,g,function(E){n.triggerMouseEvent(g,E,b),E.stopPropagation()})}function c(v,g){var b=e.getLayer("overlays"),E=Ut('.djs-bendpoints[data-element-id="'+Au(v.id)+'"]',b);return!E&&g&&(K(E=ot("g"),{"data-element-id":v.id}),bt(E).add("djs-bendpoints"),lt(b,E),a(E,"mousedown",v),a(E,"click",v),a(E,"dblclick",v)),E}function l(v,g){return Ut('.djs-segment-dragger[data-segment-idx="'+v+'"]',g)}function u(v,g){g.waypoints.forEach(function(b,E){var S=Tu(v);lt(v,S),Oe(S,b.x,b.y)}),Tu(v,"floating")}function p(v,g){for(var b,E,S,w=g.waypoints,C=1;C<w.length;C++)Gn(b=w[C-1],E=w[C])&&(K(S=uf(v,b,E),{"data-segment-idx":C}),a(S,"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(Rl("."+lf,b),function(E){Zt(E)})}(g),function(b){L(Rl("."+cf,b),function(E){Zt(E)})}(g),p(g,v),u(g,v))}function f(v,g,b){var E,S,w=l(g.index,v),C=b[g.index-1],B=b[g.index],s=g.point,h=Hl(C,B),m=Gn(C,B);w&&(E=function(_){return Ut(".djs-visual",_)}(w),S={x:s.x-h.x,y:s.y-h.y},m==="v"&&(S={x:S.y,y:S.x}),Oe(E,S.x,S.y))}t.on("connection.changed",function(v){y(v.element)}),t.on("connection.remove",function(v){var g=c(v.element);g&&Zt(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,E=v.element,S=E.waypoints;if(S){if(g=c(E,!0),!(b=Cu(e,S,v.originalEvent)))return;(function(w,C){var B=Ut(".floating",w),s=C.point;B&&Oe(B,s.x,s.y)})(g,b),b.bendpoint||f(g,b,S)}}),t.on("element.mousedown",function(v){if(Ei(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 E=c(g);E&&K(E,{"data-element-id":b})}}),this.addHandles=d,this.updateHandles=y,this.getBendpointsContainer=c,this.getSegmentDragger=l}mf.$inject=["eventBus","canvas","interactionEvents","bendpointMove","connectionSegmentMove"];var ff=Math.round,Zi="reconnectStart",Qi="reconnectEnd",Fo="updateWaypoints";function ku(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?Fo:Qi:Zi)===Fo?"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===Fo?"connection.updateWaypoints":"connection.reconnect";if(c=l.allowed=r.allowed(v,{connection:u,source:f===Zi?y:p,target:f===Qi?y:d}))return l.source=f===Zi?y:p,void(l.target=f===Qi?y:d);c===!1&&(c=l.allowed=r.allowed(v,{connection:u,source:f===Qi?y:d,target:f===Zi?y:p})),c&&(l.source=f===Qi?y:d,l.target=f===Zi?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!==Fo&&(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||{},E={x:ff(a.x),y:ff(a.y)};if(!l)return!1;g===Fo?(d?y.splice(u,0,E):y[u]=E,b.bendpointMove={insert:d,bendpointIndex:u},y=this.cropWaypoints(p,y),o.updateWaypoints(p,function(S){S=S.slice();for(var w,C,B,s=0;S[s];)w=S[s],C=S[s-1],So(w,B=S[s+1])===0||Ul(C,B,w)?S.splice(s,1):s++;return S}(y),b)):(g===Zi?(b.docking="source",Ts(c)&&(b.docking="target",b.newWaypoints=y.reverse())):g===Qi&&(b.docking="target",Ts(c)&&(b.docking="source",b.newWaypoints=y.reverse())),o.reconnect(p,f,v,E,b))},this)}function Ts(t){var e=t.hover,n=t.source,i=t.target,r=t.type;return r===Zi?e&&i&&e===i&&n!==i:r===Qi?e&&n&&e===n&&n!==i:void 0}ku.$inject=["injector","eventBus","canvas","dragging","rules","modeling"],ku.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 vf="updateWaypoints",zo="connect-ok",As="connect-not-ok",yf="connect-hover",gf="djs-updating",bf="djs-element-hidden";function xf(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=Tu(i.getLayer("overlays"))).add("djs-dragging"),i.addMarker(l,bf),i.addMarker(l,gf)}),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,yf),u===vf)return;c?(i.removeMarker(l,As),i.addMarker(l,zo)):c===!1&&(i.removeMarker(l,zo),i.addMarker(l,As))}}),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,yf),i.removeMarker(c,l?zo:As))}),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},E=a.hints||{},S={};r&&(E.connectionStart&&(S.connectionStart=E.connectionStart),E.connectionEnd&&(S.connectionEnd=E.connectionEnd),d==="reconnectStart"?Ts(a)?(S.connectionEnd=S.connectionEnd||b,S.source=v,S.target=p||f,g=g.reverse()):(S.connectionStart=S.connectionStart||b,S.source=p||f,S.target=v):d==="reconnectEnd"?Ts(a)?(S.connectionStart=S.connectionStart||b,S.source=p||v,S.target=f,g=g.reverse()):(S.connectionEnd=S.connectionEnd||b,S.source=f,S.target=p||v):(S.noCropping=!0,S.noLayout=!0,g[l]=b),d===vf&&(g=t.cropWaypoints(y,g)),S.waypoints=g,r.drawPreview(a,c,S)),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,Zt(l),i.removeMarker(c,gf),i.removeMarker(c,bf),u&&(i.removeMarker(u,zo),i.removeMarker(u,p?zo:As)),r&&r.cleanUp(a)})}xf.$inject=["bendpointMove","injector","eventBus","canvas"];var Ef="connect-hover",_f="djs-updating";function wf(t,e,n){return Pu(t,e,t[e]+n)}function Pu(t,e,n){return{x:e==="x"?n:t.x,y:e==="y"?n:t.y}}function Sf(t){return t==="x"?"y":"x"}function Cf(t,e,n){var i,r;return t.original?t.original:(i=vt(e),Pu(t,r=Sf(n),i[r]))}function Tf(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,E,S){var w=Math.max(b[S],E[S]),C=Math.min(b[S],E[S]);return Pu(b,S,Math.min(Math.max(C+20,g[S]),w-20))}(y,f[p.segmentStartIndex+d],f[p.segmentEndIndex+d],Sf(p.axis));Oe(p.draggerGfx,v.x,v.y)}this.start=function(p,d,y){var f,v,g,b,E=n.getGraphics(d),S=y-1,w=y,C=d.waypoints,B=C[S],s=C[w],h=Cu(n,C,p);(v=Gn(B,s))&&(g=v==="v"?"x":"y",S===0&&(B=Cf(B,d.source,g)),w===C.length-1&&(s=Cf(s,d.target,g)),f={connection:d,segmentStartIndex:S,segmentEndIndex:w,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:E,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=uf(f,d.segmentStart,d.segmentEnd),bt(d.draggerGfx).add("djs-dragging"),n.addMarker(y,_f)}),e.on("connectionSegment.move.move",function(p){var d,y,f=p.context,v=f.connection,g=f.segmentStartIndex,b=f.segmentEndIndex,E=f.segmentStart,S=f.segmentEnd,w=f.axis,C=f.originalWaypoints.slice(),B=wf(E,w,p["d"+w]),s=wf(S,w,p["d"+w]),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(E),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(S)),f.newWaypoints=v.waypoints=c(v,C),u(f,m,p),f.newSegmentStartIndex=g+m,l(p)}),e.on("connectionSegment.move.hover",function(p){p.context.hover=p.hover,n.addMarker(p.hover,Ef)}),e.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(p){var d=p.context.hover;d&&n.removeMarker(d,Ef)}),e.on("connectionSegment.move.cleanup",function(p){var d=p.context,y=d.connection;d.draggerGfx&&Zt(d.draggerGfx),n.removeMarker(y,_f)}),e.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(p){var d=p.context;d.connection.waypoints=d.originalWaypoints,l(p)}),e.on("connectionSegment.move.end",function(p){var d=p.context,y=d.connection,f=d.newWaypoints,v=d.newSegmentStartIndex,g=function(w,C){var B=0;return{waypoints:w.filter(function(s,h){return!Ul(w[h-1],w[h+1],s)||(B=h<=C?B-1:B,!1)}),segmentOffset:B}}(f=f.map(function(w){return{original:w.original,x:Math.round(w.x),y:Math.round(w.y)}}),v),b=c(y,g.waypoints),E=g.segmentOffset,S={segmentMove:{segmentStartIndex:d.segmentStartIndex,newSegmentStartIndex:v+E}};o.updateWaypoints(y,b,S)})}Tf.$inject=["injector","eventBus","canvas","dragging","graphicsFactory","modeling"];var Zx=Math.abs,Af=Math.round;function kf(t){return{x:t.x,y:t.y}}function Pf(t){return{x:t.x+t.width,y:t.y+t.height}}function tn(t,e){return!t||isNaN(t.x)||isNaN(t.y)?e:{x:Af(t.x+t.width/2),y:Af(t.y+t.height/2)}}function Yr(t,e){var n=t.snapped;return!!n&&(typeof e=="string"?n[e]:n.x&&n.y)}function re(t,e,n){if(typeof e!="string")throw new Error("axis must be in [x, y]");if(typeof n!="number"&&n!==!1)throw new Error("value must be Number or false");var i,r=t[e],o=t.snapped=t.snapped||{};return n===!1?o[e]=!1:(o[e]=!0,i=n-r,t[e]+=i,t["d"+e]+=i),r}function Mf(t){return t.children||[]}var Qx=Math.abs,Rf=Math.round;function Nf(t){function e(i,r){if(gt(i)){for(var o=i.length;o--;)if(Qx(i[o]-r)<=10)return i[o]}else{var a=r%(i=+i);if(a<10)return r-a;if(a>i-10)return r-a+i}return r}function n(i){if(i.width)return{x:Rf(i.width/2+i.x),y:Rf(i.height/2+i.y)}}t.on("connectionSegment.move.move",1500,function(i){var r,o,a=function(d){var y=d.snapPoints,f=d.connection,v=f.waypoints,g=d.segmentStart,b=d.segmentStartIndex,E=d.segmentEnd,S=d.segmentEndIndex,w=d.axis;if(y)return y;var C=[v[b-1],g,E,v[S+1]];return b<2&&C.unshift(n(f.source)),S>v.length-3&&C.unshift(n(f.target)),d.snapPoints=y={horizontal:[],vertical:[]},L(C,function(B){B&&(B=B.original||B,w==="y"&&y.horizontal.push(B.y),w==="x"&&y.vertical.push(B.x))}),y}(i.context),c=i.x,l=i.y;if(a){var u=c-(r=e(a.vertical,c)),p=l-(o=e(a.horizontal,l));z(i,{dx:i.dx-u,dy:i.dy-p,x:r,y:o}),(u||a.vertical.indexOf(c)!==-1)&&re(i,"x",r),(p||a.horizontal.indexOf(l)!==-1)&&re(i,"y",o)}}),t.on(["bendpoint.move.move","bendpoint.move.end"],1500,function(i){var r,o,a=i.context,c=function(v){var g=v.snapPoints,b=v.connection.waypoints,E=v.bendpointIndex;if(g)return g;var S=[b[E-1],b[E+1]];return v.snapPoints=g={horizontal:[],vertical:[]},L(S,function(w){w&&(w=w.original||w,g.horizontal.push(w.y),g.vertical.push(w.x))}),g}(a),l=a.hover,u=l&&n(l),p=i.x,d=i.y;if(c){var y=p-(r=e(u?c.vertical.concat([u.x]):c.vertical,p)),f=d-(o=e(u?c.horizontal.concat([u.y]):c.horizontal,d));z(i,{dx:i.dx-y,dy:i.dy-f,x:i.x-y,y:i.y-f}),(y||c.vertical.indexOf(p)!==-1)&&re(i,"x",r),(f||c.horizontal.indexOf(d)!==-1)&&re(i,"y",o)}})}Nf.$inject=["eventBus"];const tE={__depends__:[Kn,In],__init__:["bendpoints","bendpointSnapping","bendpointMovePreview"],bendpoints:["type",mf],bendpointMove:["type",ku],bendpointMovePreview:["type",xf],connectionSegmentMove:["type",Tf],bendpointSnapping:["type",Nf]};function If(t,e,n,i){function r(o,a){return i.allowed("connection.create",{source:o,target:a})}t.on("connect.hover",function(o){var a,c=o.context,l=c.start,u=o.hover;if(c.hover=u,!bo(a=c.canExecute=r(l,u))){if(a!==!1)return c.source=l,void(c.target=u);bo(a=c.canExecute=r(u,l))||a!==!1&&(c.source=u,c.target=l)}}),t.on(["connect.out","connect.cleanup"],function(o){var a=o.context;a.hover=null,a.source=null,a.target=null,a.canExecute=!1}),t.on("connect.end",function(o){var a=o.context,c=a.canExecute,l=a.connectionStart,u={x:o.x,y:o.y},p=a.source,d=a.target;if(!c)return!1;var y=null,f={connectionStart:Mu(a)?u:l,connectionEnd:Mu(a)?l:u};Jt(c)&&(y=c),n.connect(p,d,y,f)}),this.start=function(o,a,c,l){Jt(c)||(l=c,c=vt(a)),e.init(o,"connect",{autoActivate:l,data:{shape:a,context:{start:a,connectionStart:c}}})}}function Mu(t){var e=t.hover,n=t.source,i=t.target;return e&&n&&e===n&&n!==i}If.$inject=["eventBus","dragging","modeling","rules"];var Df="connect-ok",Bf="connect-not-ok";function Of(t,e,n){var i=t.get("connectionPreview",!1);i&&e.on("connect.move",function(r){var o=r.context,a=o.canExecute,c=o.hover,l=o.source,u=o.start,p=o.startPosition,d=o.target,y=o.connectionStart||p,f=o.connectionEnd||{x:r.x,y:r.y},v=y,g=f;Mu(o)&&(v=f,g=y),i.drawPreview(o,a,{source:l||u,target:d||c,connectionStart:v,connectionEnd:g})}),e.on("connect.hover",900,function(r){var o=r.context,a=r.hover,c=o.canExecute;c!==null&&n.addMarker(a,c?Df:Bf)}),e.on(["connect.out","connect.cleanup"],1100,function(r){var o=r.hover;o&&(n.removeMarker(o,Df),n.removeMarker(o,Bf))}),i&&e.on("connect.cleanup",function(r){i.cleanUp(r.context)})}Of.$inject=["injector","eventBus","canvas"];const Ru={__depends__:[Mn,In,Kn],__init__:["connectPreview"],connect:["type",If],connectPreview:["type",Of]};function Yn(t,e,n,i){this._canvas=e,this._graphicsFactory=n,this._elementFactory=i,this._connectionDocking=t.get("connectionDocking",!1),this._layouter=t.get("layouter",!1)}Yn.$inject=["injector","canvas","graphicsFactory","elementFactory"],Yn.prototype.drawPreview=function(t,e,n){n=n||{};var i,r=t.connectionPreviewGfx,o=t.getConnection,a=n.source,c=n.target,l=n.waypoints,u=n.connectionStart,p=n.connectionEnd,d=n.noLayout,y=n.noCropping,f=n.noNoop,v=this;r||(r=t.connectionPreviewGfx=this.createConnectionPreviewGfx()),Dl(r),o||(o=t.getConnection=function(g){var b={};return function(E){var S=JSON.stringify(E),w=b[S];return w||(w=b[S]=g.apply(null,arguments)),w}}(function(g,b,E){return v.getConnection(g,b,E)})),e&&(i=o(e,a,c)),i?(i.waypoints=l||[],this._layouter&&!d&&(i.waypoints=this._layouter.layoutConnection(i,{source:a,target:c,connectionStart:u,connectionEnd:p,waypoints:n.waypoints||i.waypoints})),i.waypoints&&i.waypoints.length||(i.waypoints=[a?vt(a):u,c?vt(c):p]),this._connectionDocking&&(a||c)&&!y&&(i.waypoints=this._connectionDocking.getCroppedWaypoints(i,a,c)),this._graphicsFactory.drawConnection(r,i)):!f&&this.drawNoopPreview(r,n)},Yn.prototype.drawNoopPreview=function(t,e){var n=e.source,i=e.target,r=e.connectionStart||vt(n),o=e.connectionEnd||vt(i),a=this.cropWaypoints(r,o,n,i);lt(t,this.createNoopConnection(a[0],a[1]))},Yn.prototype.cropWaypoints=function(t,e,n,i){var r=this._graphicsFactory,o=n&&r.getShapePath(n),a=i&&r.getShapePath(i),c=r.getConnectionPath({waypoints:[t,e]});return[t=n&&Kl(o,c,!0)||t,e=i&&Kl(a,c,!1)||e]},Yn.prototype.cleanUp=function(t){t&&t.connectionPreviewGfx&&Zt(t.connectionPreviewGfx)},Yn.prototype.getConnection=function(t){var e=function(n){return Jt(n)?n:{}}(t);return this._elementFactory.createConnection(e)},Yn.prototype.createConnectionPreviewGfx=function(){var t=ot("g");return K(t,{pointerEvents:"none"}),bt(t).add("djs-connection-preview"),lt(this._canvas.getActiveLayer(),t),t},Yn.prototype.createNoopConnection=function(t,e){var n=ot("polyline");return K(n,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),K(n,{points:[t.x,t.y,e.x,e.y]}),n};const eE={__init__:["connectionPreview"],connectionPreview:["type",Yn]};var Lf=Math.min,jf=Math.max;function Nu(t){t.preventDefault()}function $o(t){t.stopPropagation()}function vn(t){this.container=t.container,this.parent=Lt('<div class="djs-direct-editing-parent"><div class="djs-direct-editing-content" contenteditable="true"></div></div>'),this.content=Ut("[contenteditable]",this.parent),this.keyHandler=t.keyHandler||function(){},this.resizeHandler=t.resizeHandler||function(){},this.autoResize=_e(this.autoResize,this),this.handlePaste=_e(this.handlePaste,this)}function en(t,e){this._eventBus=t,this._providers=[],this._textbox=new vn({container:e.getContainer(),keyHandler:_e(this._handleKey,this),resizeHandler:_e(this._handleResize,this)})}vn.prototype.create=function(t,e,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{};var c=Je(e=this.style=e||{},["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);z(r.style,{width:t.width+"px",height:t.height+"px",maxWidth:t.maxWidth+"px",maxHeight:t.maxHeight+"px",minWidth:t.minWidth+"px",minHeight:t.minHeight+"px",left:t.x+"px",top:t.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",boxSizing:"border-box",wordWrap:"normal",textAlign:"center",outline:"none"},c);var l=Je(e,["fontFamily","fontSize","fontWeight","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return z(o.style,{boxSizing:"border-box",width:"100%",outline:"none",wordWrap:"break-word"},l),i.centerVertically&&z(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},l),o.innerText=n,ct.bind(o,"keydown",this.keyHandler),ct.bind(o,"mousedown",$o),ct.bind(o,"paste",this.handlePaste),i.autoResize&&ct.bind(o,"input",this.autoResize),i.resizable&&this.resizable(e),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},vn.prototype.handlePaste=function(t){var e,n=this.options,i=this.style;if(t.preventDefault(),e=t.clipboardData?t.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),this.insertText(e),n.autoResize){var r=this.autoResize(i);r&&this.resizeHandler(r)}},vn.prototype.insertText=function(t){t=t.replace(/\r\n|\r|\n/g,`
- `),document.execCommand("insertText",!1,t)||this._insertTextIE(t)},vn.prototype._insertTextIE=function(t){var e,n,i,r=this.getSelection(),o=r.startContainer,a=r.endContainer,c=r.startOffset,l=r.endOffset,u=r.commonAncestorContainer,p=(e=u.childNodes,[].slice.call(e));if(function(g){return g.nodeType===Node.TEXT_NODE}(u)){var d=o.textContent;o.textContent=d.substring(0,c)+t+d.substring(l),n=o,i=c+t.length}else if(o===this.content&&a===this.content){var y=document.createTextNode(t);this.content.insertBefore(y,p[c]),n=y,i=y.textContent.length}else{var f=p.indexOf(o),v=p.indexOf(a);p.forEach(function(g,b){b===f?g.textContent=o.textContent.substring(0,c)+t+a.textContent.substring(l):b>f&&b<=v&&Tn(g)}),n=o,i=c+t.length}n&&i!==void 0&&setTimeout(function(){self.setSelection(n,i)})},vn.prototype.autoResize=function(){var t=this.parent,e=this.content,n=parseInt(this.style.fontSize)||12;if(e.scrollHeight>t.offsetHeight||e.scrollHeight<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})}},vn.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=Lt('<div class="djs-direct-editing-resize-handle"></div>');var d=function(f){Nu(f),$o(f);var v=Lf(jf(u+f.clientX-c,i),o),g=Lf(jf(p+f.clientY-l,r),a);e.style.width=v+"px",e.style.height=g+"px",t.resizeHandler({width:u,height:p,dx:f.clientX-c,dy:f.clientY-l})},y=function(f){Nu(f),$o(f),ct.unbind(document,"mousemove",d,!1),ct.unbind(document,"mouseup",y,!1)};ct.bind(n,"mousedown",function(f){Nu(f),$o(f),c=f.clientX,l=f.clientY;var v=e.getBoundingClientRect();u=v.width,p=v.height,ct.bind(document,"mousemove",d),ct.bind(document,"mouseup",y)})}z(n.style,{position:"absolute",bottom:"0px",right:"0px",cursor:"nwse-resize",width:"0",height:"0",borderTop:(parseInt(this.style.fontSize)/4||3)+"px solid transparent",borderRight:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderBottom:(parseInt(this.style.fontSize)/4||3)+"px solid #ccc",borderLeft:(parseInt(this.style.fontSize)/4||3)+"px solid transparent"}),e.appendChild(n)},vn.prototype.destroy=function(){var t=this.parent,e=this.content,n=this.resizeHandle;e.innerText="",t.removeAttribute("style"),e.removeAttribute("style"),ct.unbind(e,"keydown",this.keyHandler),ct.unbind(e,"mousedown",$o),ct.unbind(e,"input",this.autoResize),ct.unbind(e,"paste",this.handlePaste),n&&(n.removeAttribute("style"),Tn(n)),Tn(t)},vn.prototype.getValue=function(){return this.content.innerText.trim()},vn.prototype.getSelection=function(){return window.getSelection().getRangeAt(0)},vn.prototype.setSelection=function(t,e){var n=document.createRange();t===null?n.selectNodeContents(this.content):(n.setStart(t,e),n.setEnd(t,e));var i=window.getSelection();i.removeAllRanges(),i.addRange(n)},en.$inject=["eventBus","canvas"],en.prototype.registerProvider=function(t){this._providers.push(t)},en.prototype.isActive=function(t){return!(!this._active||t&&this._active.element!==t)},en.prototype.cancel=function(){this._active&&(this._fire("cancel"),this.close())},en.prototype._fire=function(t,e){this._eventBus.fire("directEditing."+t,e||{active:this._active})},en.prototype.close=function(){this._textbox.destroy(),this._fire("deactivate"),this._active=null,this.resizable=void 0},en.prototype.complete=function(){var t=this._active;if(t){var e,n=t.context.bounds,i=this.$textbox.getBoundingClientRect(),r=this.getValue();r===t.context.text&&i.height===n.height&&i.width===n.width||(e=this._textbox.container.getBoundingClientRect(),t.provider.update(t.element,r,t.context.text,{x:i.left-e.left,y:i.top-e.top,width:i.width,height:i.height})),this._fire("complete"),this.close()}},en.prototype.getValue=function(){return this._textbox.getValue()},en.prototype._handleKey=function(t){t.stopPropagation();var e=t.keyCode||t.charCode;return e===27?(t.preventDefault(),this.cancel()):e!==13||t.shiftKey?void 0:(t.preventDefault(),this.complete())},en.prototype._handleResize=function(t){this._fire("resize",t)},en.prototype.activate=function(t){var e;this.isActive()&&this.cancel();var n=kt(this._providers,function(i){return(e=i.activate(t))?i:null});return e&&(this.$textbox=this._textbox.create(e.bounds,e.style,e.text,e.options),this._active={element:t,context:e,provider:n},e.options&&e.options.resizable&&(this.resizable=!0),this._fire("activate")),!!e};const Vf={__depends__:[Bo],__init__:["directEditing"],directEditing:["type",en]};var Ff=".entry";function nn(t,e,n){this._eventBus=e,this._overlays=n;var i=Xe(t&&t.scale)?t.scale:{min:1,max:1.5};this._overlaysConfig={position:{right:-9,top:-6},scale:i},this._current=null,this._init()}nn.$inject=["config.contextPad","eventBus","overlays"],nn.prototype._init=function(){var t=this._eventBus,e=this;t.on("selection.changed",function(n){var i=n.newSelection;i.length===1?e.open(i[0]):e.close()}),t.on("elements.delete",function(n){L(n.elements,function(i){e.isOpen(i)&&e.close()})}),t.on("element.changed",function(n){var i=n.element,r=e._current;r&&r.element===i&&e.open(i,!0)})},nn.prototype.registerProvider=function(t,e){e||(e=t,t=1e3),this._eventBus.on("contextPad.getProviders",t,function(n){n.providers.push(e)})},nn.prototype.getEntries=function(t){var e=this._getProviders(),n={};return L(e,function(i){var r=i.getContextPadEntries(t);fe(r)?n=r(n):L(r,function(o,a){n[a]=o})}),n},nn.prototype.trigger=function(t,e,n){var i,r,o=this._current.element,a=this._current.entries,c=e.delegateTarget||e.target;if(!c)return e.preventDefault();if(i=a[ze(c,"data-action")].action,r=e.originalEvent||e,fe(i)){if(t==="click")return i(r,o,n)}else if(i[t])return i[t](r,o,n);e.preventDefault()},nn.prototype.open=function(t,e){!e&&this.isOpen(t)||(this.close(),this._updateAndOpen(t))},nn.prototype._getProviders=function(){var t=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(t),t.providers},nn.prototype._updateAndOpen=function(t){var e=this.getEntries(t),n=this.getPad(t),i=n.html;L(e,function(r,o){var a,c=r.group||"default",l=Lt(r.html||'<div class="entry" draggable="true"></div>');ze(l,"data-action",o),(a=Ut("[data-group="+c+"]",i))||(a=Lt('<div class="group" data-group="'+c+'"></div>'),i.appendChild(a)),a.appendChild(l),r.className&&function(u,p){var d=ne(u);(gt(p)?p:p.split(/\s+/g)).forEach(function(y){d.add(y)})}(l,r.className),r.title&&ze(l,"title",r.title),r.imageUrl&&l.appendChild(Lt('<img src="'+r.imageUrl+'">'))}),ne(i).add("open"),this._current={element:t,pad:n,entries:e},this._eventBus.fire("contextPad.open",{current:this._current})},nn.prototype.getPad=function(t){if(this.isOpen())return this._current.pad;var e=this,n=this._overlays,i=Lt('<div class="djs-context-pad"></div>'),r=z({html:i},this._overlaysConfig);$e.bind(i,Ff,"click",function(a){e.trigger("click",a)}),$e.bind(i,Ff,"dragstart",function(a){e.trigger("dragstart",a)}),ct.bind(i,"mousedown",function(a){a.stopPropagation()}),this._overlayId=n.add(t,"context-pad",r);var o=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{element:t,pad:o}),o},nn.prototype.close=function(){this.isOpen()&&(this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},nn.prototype.isOpen=function(t){return!(!this._current||t&&this._current.element!==t)};const nE={__depends__:[Bo,pu],contextPad:["type",nn]};var iE=["marker-start","marker-mid","marker-end"],rE=["circle","ellipse","line","path","polygon","polyline","rect"];function tr(t,e,n,i){this._elementRegistry=t,this._canvas=n,this._styles=i,this._clonedMarkers={};var r=this;e.on("drag.cleanup",function(){L(r._clonedMarkers,function(o){Zt(o)}),r._clonedMarkers={}})}tr.$inject=["elementRegistry","eventBus","canvas","styles"],tr.prototype.getGfx=function(t){return this._elementRegistry.getGraphics(t)},tr.prototype.addDragger=function(t,e,n){var i=vd(n=n||this.getGfx(t)),r=n.getBoundingClientRect();return this._cloneMarkers(is(i)),K(i,this._styles.cls("djs-dragger",[],{x:r.top,y:r.left})),lt(e,i),i},tr.prototype.addFrame=function(t,e){var n=ot("rect",{class:"djs-resize-overlay",width:t.width,height:t.height,x:t.x,y:t.y});return lt(e,n),n},tr.prototype._cloneMarkers=function(t){var e=this;if(t.childNodes)for(var n=0;n<t.childNodes.length;n++)e._cloneMarkers(t.childNodes[n]);(function(i){return rE.indexOf(i.nodeName)!==-1})(t)&&iE.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 Ut("marker#"+l,c||document)}(t,i,e._canvas.getContainer());e._cloneMarker(t,r,i)}})},tr.prototype._cloneMarker=function(t,e,n){var i=e.id,r=this._clonedMarkers[i];if(!r){var o=i+"-clone";(r=vd(e)).id=o,bt(r).add("djs-dragger").add("djs-dragger-marker"),this._clonedMarkers[i]=r;var a=Ut("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 Go={__init__:["previewSupport"],previewSupport:["type",tr]};var oE="drop-ok",zf="drop-not-ok",$f="attach-ok",Gf="new-parent",Uf="create";function Hf(t,e,n,i,r){function o(c,l){[$f,oE,zf,Gf].forEach(function(u){u===l?t.addMarker(c,u):t.removeMarker(c,u)})}function a(){var c=e.context();c&&c.prefix===Uf&&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);qf(c);var f={x:c.x,y:c.y},v=l.canExecute=p&&function(g,b,E,S,w){if(!b)return!1;var C=kt(g=mt(g,function(_){var T=_.labelTarget;return!(_.parent||function(M){return!!M.labelTarget}(_)&&g.indexOf(T)!==-1)}),function(_){return!Uo(_)}),B=!1,s=!1,h=!1;Wf(g)&&(B=r.allowed("shape.attach",{position:E,shape:C,target:b})),B||(h=Wf(g)?r.allowed("shape.create",{position:E,shape:C,source:S,target:b}):r.allowed("elements.create",{elements:g,position:E,target:b}));var m=w.connectionTarget;return h||B?(C&&S&&(s=r.allowed("connection.create",{source:m===S?C:S,target:m===S?S: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,$f):o(p,v?Gf:zf))}),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;qf(c);var E={x:c.x,y:c.y};p=g?i.appendShape(u,p,E,y,{attach:v,connection:g===!0?{}:g,connectionTarget:b.connectionTarget}):kt(d=i.createElements(d,E,y,z({},b,{attach:v})),function(S){return!Uo(S)}),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=kt(l,function(y){return!Uo(y)});if(p){u=z({elements:l,hints:{},shape:p},u||{}),L(l,function(y){ht(y.x)||(y.x=0),ht(y.y)||(y.y=0)});var d=ve(l);L(l,function(y){Uo(y)&&(y.waypoints=ae(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,Uf,{cursor:"grabbing",autoActivate:!0,data:{shape:p,elements:l,context:u}})}}}function qf(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 Uo(t){return!!t.waypoints}function Wf(t){return t&&t.length===1&&!Uo(t[0])}Hf.$inject=["canvas","dragging","eventBus","modeling","rules"];function Xf(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(is(v),f)):(v=n._createContainer("shape",y),n.drawShape(is(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)):Zt(u)}),e.on("create.cleanup",function(o){var a=o.context.dragGroup;a&&Zt(a)})}Xf.$inject=["canvas","eventBus","graphicsFactory","previewSupport","styles"];const ks={__depends__:[Kn,Go,In,Mn],__init__:["create","createPreview"],create:["type",Hf],createPreview:["type",Xf]};var Kf="data-id",Yf=["contextPad.close","canvas.viewbox.changing","commandStack.changed"];function Qt(t,e,n){var i=Xe(t&&t.scale)?t.scale:{min:1,max:1.5};this._config={scale:i},this._eventBus=e,this._canvas=n,this._providers={},this._current={}}Qt.$inject=["config.popupMenu","eventBus","canvas"],Qt.prototype.registerProvider=function(t,e,n){n||(n=e,e=1e3),this._eventBus.on("popupMenu.getProviders."+t,e,function(i){i.providers.push(n)})},Qt.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=Ar(i)>0,a=r&&Ar(r)>0;return!o&&!a},Qt.prototype.open=function(t,e,n){var i=this._getProviders(e);if(!t)throw new Error("Element is missing");if(!i||!i.length)throw new Error("No registered providers for: "+e);if(!n)throw new Error("the position argument is missing");this.isOpen()&&this.close(),this._emit("open");var r=this._current={className:e,element:t,position:n},o=this._getEntries(t,i),a=this._getHeaderEntries(t,i);r.entries=z({},o,a),r.container=this._createContainer(),Ar(a)&&r.container.appendChild(this._createEntries(a,"djs-popup-header")),Ar(o)&&r.container.appendChild(this._createEntries(o,"djs-popup-body"));var c=this._canvas.getContainer();this._attachContainer(r.container,c,n.cursor),this._bindAutoClose()},Qt.prototype.close=function(){this.isOpen()&&(this._emit("close"),this._unbindAutoClose(),Tn(this._current.container),this._current.container=null)},Qt.prototype.isOpen=function(){return!!this._current.container},Qt.prototype.trigger=function(t){t.preventDefault();var e=ze(t.delegateTarget||t.target,Kf),n=this._getEntry(e);if(n.action)return n.action.call(null,t,n)},Qt.prototype._getProviders=function(t){var e=this._eventBus.createEvent({type:"popupMenu.getProviders."+t,providers:[]});return this._eventBus.fire(e),e.providers},Qt.prototype._getEntries=function(t,e){var n={};return L(e,function(i){if(i.getPopupMenuEntries){var r=i.getPopupMenuEntries(t);fe(r)?n=r(n):L(r,function(o,a){n[a]=o})}else L(i.getEntries(t),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=zn(o,["id"])})}),n},Qt.prototype._getHeaderEntries=function(t,e){var n={};return L(e,function(i){if(i.getPopupMenuHeaderEntries){var r=i.getPopupMenuHeaderEntries(t);fe(r)?n=r(n):L(r,function(o,a){n[a]=o})}else{if(!i.getHeaderEntries)return;L(i.getHeaderEntries(t),function(o){var a=o.id;if(!a)throw new Error("every entry must have the id property set");n[a]=zn(o,["id"])})}}),n},Qt.prototype._getEntry=function(t){var e=this._current.entries[t];if(!e)throw new Error("entry not found");return e},Qt.prototype._emit=function(t){this._eventBus.fire("popupMenu."+t)},Qt.prototype._createContainer=function(){var t=Lt('<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"}),ne(t).add(n),t},Qt.prototype._attachContainer=function(t,e,n){var i=this;$e.bind(t,".entry","click",function(r){i.trigger(r)}),this._updateScale(t),e.appendChild(t),n&&this._assureIsInbounds(t,n)},Qt.prototype._updateScale=function(t){var e,n,i=this._canvas.zoom(),r=this._config.scale,o=i;r!==!0&&(r===!1?(e=1,n=1):(e=r.min,n=r.max),Xe(e)&&i<e&&(o=e),Xe(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+")")},Qt.prototype._assureIsInbounds=function(t,e){var n,i,r=this._canvas._container.getBoundingClientRect(),o=t.offsetLeft,a=t.offsetTop,c=t.scrollWidth,l=t.scrollHeight,u={},p=e.x-r.left,d=e.y-r.top;o+c>r.width&&(u.x=!0),a+l>r.height&&(u.y=!0),u.x&&u.y?(n=p-c+"px",i=d-l+"px"):u.x?(n=p-c+"px",i=d+"px"):u.y&&d<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})},Qt.prototype._createEntries=function(t,e){var n=Lt("<div>"),i=this;return ne(n).add(e),L(t,function(r,o){var a=i._createEntry(r,o);n.appendChild(a)}),n},Qt.prototype._createEntry=function(t,e){var n=Lt("<div>"),i=ne(n);if(i.add("entry"),t.className&&t.className.split(" ").forEach(function(o){i.add(o)}),ze(n,Kf,e),t.label){var r=Lt("<span>");r.textContent=t.label,n.appendChild(r)}return t.imageUrl&&n.appendChild(Lt('<img src="'+t.imageUrl+'" />')),t.active===!0&&i.add("active"),t.disabled===!0&&i.add("disabled"),t.title&&(n.title=t.title),n},Qt.prototype._bindAutoClose=function(){this._eventBus.once(Yf,this.close,this)},Qt.prototype._unbindAutoClose=function(){this._eventBus.off(Yf,this.close,this)};const aE={__init__:["popupMenu"],popupMenu:["type",Qt]};function Ho(){}Ho.prototype.get=function(){return this._data},Ho.prototype.set=function(t){this._data=t},Ho.prototype.clear=function(){var t=this._data;return delete this._data,t},Ho.prototype.isEmpty=function(){return!this._data};const sE={clipboard:["type",Ho]};function Iu(t){var e=this;function n(i){e._lastMoveEvent=i}this._lastMoveEvent=null,t.on("canvas.init",function(i){(e._svg=i.svg).addEventListener("mousemove",n)}),t.on("canvas.destroy",function(){e._lastMouseEvent=null,e._svg.removeEventListener("mousemove",n)})}Iu.$inject=["eventBus"],Iu.prototype.getLastMoveEvent=function(){return this._lastMoveEvent||function(t,e){var n=document.createEvent("MouseEvent"),i=t,r=e,o=t,a=e;return n.initMouseEvent&&n.initMouseEvent("mousemove",!0,!0,window,0,i,r,o,a,!1,!1,!1,!1,0,null),n}(0,0)};const qo={__init__:["mouse"],mouse:["type",Iu]};function yn(t,e,n,i,r,o,a,c){this._canvas=t,this._create=e,this._clipboard=n,this._elementFactory=i,this._eventBus=r,this._modeling=o,this._mouse=a,this._rules=c,r.on("copyPaste.copyElement",function(l){var u=l.descriptor,p=l.element,d=l.elements;u.priority=1,u.id=p.id,kt(d,function(y){return y===p.parent})&&(u.parent=p.parent.id),function(y){return!!y.host}(p)&&(u.priority=2,u.host=p.host.id),Ps(p)&&(u.priority=3,u.source=p.source.id,u.target=p.target.id,u.waypoints=function(y){return ae(y.waypoints,function(f){return(f=Jf(f)).original&&(f.original=Jf(f.original)),f})}(p)),Ms(p)&&(u.priority=4,u.labelTarget=p.labelTarget.id),L(["x","y","width","height"],function(y){ht(p[y])&&(u[y]=p[y])}),u.hidden=p.hidden,u.collapsed=p.collapsed}),r.on("copyPaste.pasteElements",function(l){z(l.hints,{createElementsBehavior:!1})})}function Ps(t){return!!t.waypoints}function Ms(t){return!!t.labelTarget}function Jf(t){return z({},t)}function Zf(t,e){var n=e.indexOf(t);return n===-1?e:e.splice(n,1)}yn.$inject=["canvas","create","clipboard","elementFactory","eventBus","modeling","mouse","rules"],yn.prototype.copy=function(t){var e,n;return gt(t)||(t=t?[t]:[]),n=(e=this._eventBus.fire("copyPaste.canCopyElements",{elements:t}))===!1?{}:this.createTree(gt(e)?e:t),this._clipboard.set(n),this._eventBus.fire("copyPaste.elementsCopied",{elements:t,tree:n}),n},yn.prototype.paste=function(t){var e=this._clipboard.get();if(!this._clipboard.isEmpty()){var n=t&&t.hints||{};this._eventBus.fire("copyPaste.pasteElements",{hints:n});var i=this._createElements(e);if(t&&t.element&&t.point)return this._paste(i,t.element,t.point,n);this._create.start(this._mouse.getLastMoveEvent(),i,{hints:n||{}})}},yn.prototype._paste=function(t,e,n,i){L(t,function(o){ht(o.x)||(o.x=0),ht(o.y)||(o.y=0)});var r=ve(t);return L(t,function(o){Ps(o)&&(o.waypoints=ae(o.waypoints,function(a){return{x:a.x-r.x-r.width/2,y:a.y-r.y-r.height/2}})),z(o,{x:o.x-r.x-r.width/2,y:o.y-r.y-r.height/2})}),this._modeling.createElements(t,n,e,z({},i))},yn.prototype._createElements=function(t){var e=this,n=this._eventBus,i={},r=[];return L(t,function(o,a){L(o=Ke(o,"priority"),function(c){var l,u=z({},zn(c,["priority"]));return i[c.parent]?u.parent=i[c.parent]:delete u.parent,n.fire("copyPaste.pasteElement",{cache:i,descriptor:u}),Ps(u)?(u.source=i[c.source],u.target=i[c.target],l=i[c.id]=e.createConnection(u),void r.push(l)):Ms(u)?(u.labelTarget=i[u.labelTarget],l=i[c.id]=e.createLabel(u),void r.push(l)):(u.host&&(u.host=i[u.host]),l=i[c.id]=e.createShape(u),void r.push(l))})}),r},yn.prototype.createConnection=function(t){return this._elementFactory.createConnection(zn(t,["id"]))},yn.prototype.createLabel=function(t){return this._elementFactory.createLabel(zn(t,["id"]))},yn.prototype.createShape=function(t){return this._elementFactory.createShape(zn(t,["id"]))},yn.prototype.hasRelations=function(t,e){var n,i;return!(Ps(t)&&(n=kt(e,Ye({id:t.source.id})),i=kt(e,Ye({id:t.target.id})),!n||!i))&&!(Ms(t)&&!kt(e,Ye({id:t.labelTarget.id})))},yn.prototype.createTree=function(t){var e=this._rules,n=this,i={},r=[];function o(a,c){var l=kt(r,function(u){return a===u.element});l?l.depth<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 Hi(Sd(t),function(a,c,l){if(!Ms(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=ae(r,function(a){return a.element}),r=ae(r,function(a){return a.descriptor={},n._eventBus.fire("copyPaste.copyElement",{descriptor:a.descriptor,element:a.element,elements:t}),a}),r=Ke(r,function(a){return a.descriptor.priority}),t=ae(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)):Zf(a.element,t)}),i};const cE={__depends__:[sE,ks,qo,In],__init__:["copyPaste"],copyPaste:["type",yn]};function Rs(t,e,n){gt(n)||(n=[n]),L(n,function(i){Fn(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,Rs(c,o,"name"),o.di={},Rs(c.di,o.di,["fill","stroke","background-color","border-color","color"]),Rs(c.di,o,"isExpanded"),tv(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;tv(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=zn(i,De(i,function(v,g,b){var E=g.element,S=g.property;return b===d.id&&(E[S]=f,v.push(d.id)),v},[]))}(u,l),Rs(u,o,["isExpanded","name"]),a=u,gt(c="oldBusinessObject")||(c=[c]),L(c,function(d){a[d]&&delete a[d]}))})}function tv(t){return!!t.labelTarget}Qf.$inject=["bpmnFactory","eventBus","moddleCopy"];var lE=["artifacts","dataInputAssociations","dataOutputAssociations","default","flowElements","lanes","incoming","outgoing"];function Wo(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 Ke(r,function(o){return o==="extensionElements"})}),t.on("moddleCopy.canCopyProperty",function(i){var r=i.parent,o=Jt(r)&&r.$descriptor,a=i.propertyName;return(!a||lE.indexOf(a)===-1)&&!(a&&o&&!kt(o.properties,Ye({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 Du(t,e){return De(t.properties,function(n,i){return e&&i.default?n:n.concat(i.name)},[])}Wo.$inject=["eventBus","bpmnFactory","moddle"],Wo.prototype.copyElement=function(t,e,n){var i=this;n&&!gt(n)&&(n=[n]),n=n||Du(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&&Xe(c)&&e.set(o,c)})),e},Wo.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 Jt(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},[]):Jt(t)&&t.$type?this._moddle.getElementDescriptor(t).isGeneric?void 0:((r=i._bpmnFactory.create(t.$type)).$parent=e,r=i.copyElement(t,r)):t}},Wo.prototype._copyId=function(t,e){return this._moddle.ids.assigned(t)?void 0:(this._moddle.ids.claim(t,e),t)};const ev={__depends__:[cE],__init__:["bpmnCopyPaste","moddleCopy"],bpmnCopyPaste:["type",Qf],moddleCopy:["type",Wo]};var nv=Math.round;function Bu(t){this._modeling=t}Bu.$inject=["modeling"],Bu.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=nv(a+r/2),u=nv(c+o/2);return i.replaceShape(t,z({},e,{x:l,y:u,width:r,height:o}),n)};const uE={__init__:["replace"],replace:["type",Bu]};var pE=["cancelActivity","instantiate","eventGatewayType","triggeredByEvent","isInterrupting"];function iv(t,e,n,i,r,o,a){this.replaceElement=function(c,l,u){u=u||{};var p=l.type,d=c.businessObject;if(Ns(d)&&p==="bpmn:SubProcess"&&function(w,C){var B=w&&Cn(w,"collapsed")?w.collapsed:!Pt(w);return B!==(C&&(Cn(C,"collapsed")||Cn(C,"isExpanded"))?Cn(C,"collapsed")?C.collapsed:!C.isExpanded:B)&&(w.collapsed=B,!0)}(c,l))return i.toggleCollapse(c),c;var y,f=t.create(p),v={type:p,businessObject:f},g=Du(d.$descriptor),b=Du(f.$descriptor,!0),E=(y=b,g.filter(function(w){return y.indexOf(w)!==-1}));z(f,Je(l,pE));var S=mt(E,function(w){return w==="eventDefinitions"?rv(c,l.eventDefinitionType):w==="loopCharacteristics"?!je(f):!Cn(f,w)&&(w!=="processRef"||l.isExpanded!==!1)&&w!=="triggeredByEvent"});return f=n.copyElement(d,f,S),l.eventDefinitionType&&(rv(f,l.eventDefinitionType)||(v.eventDefinitionType=l.eventDefinitionType,v.eventDefinitionAttrs=l.eventDefinitionAttrs)),A(d,"bpmn:Activity")&&(Ns(d)?v.isExpanded=Pt(d):l&&Cn(l,"isExpanded")&&(v.isExpanded=l.isExpanded),Pt(d)&&!A(d,"bpmn:Task")&&v.isExpanded&&(v.width=c.width,v.height=c.height)),Ns(d)&&!Ns(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(w,C,B){gt(B)||(B=[B]),L(B,function(s){Fn(w[s])||(C[s]=w[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 Ns(t){return A(t,"bpmn:SubProcess")}function rv(t,e){var n=et(t);return e&&n.get("eventDefinitions").some(function(i){return A(i,e)})}iv.$inject=["bpmnFactory","elementFactory","moddleCopy","modeling","replace","rules","selection"];const ov={__depends__:[ev,uE,Mn],bpmnReplace:["type",iv]};function av(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===Pt(i);return!(o&&a&&c&&l)}}var hE=[{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"}}],dE=[{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"}}],mE=[{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"}}],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 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"}}],vE=[{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"}}],yE=[{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}}],gE=[{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}}],bE=[{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}}],sv=[{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}}],xE=[{label:"Data Store Reference",actionName:"replace-with-data-store-reference",className:"bpmn-icon-data-store",target:{type:"bpmn:DataStoreReference"}}],EE=[{label:"Data Object Reference",actionName:"replace-with-data-object-reference",className:"bpmn-icon-data-object",target:{type:"bpmn:DataObjectReference"}}],_E=[{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}}],wE=[{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}}],SE=[{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"}],CE=[{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 rn(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()}rn.$inject=["bpmnFactory","popupMenu","modeling","moddle","bpmnReplace","rules","translate"],rn.prototype.register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},rn.prototype.getEntries=function(t){var e,n=t.businessObject;if(!this._rules.allowed("shape.replace",{element:t}))return[];var i=av(t);return A(n,"bpmn:DataObjectReference")?this._createEntries(t,xE):A(n,"bpmn:DataStoreReference")?this._createEntries(t,EE):A(n,"bpmn:StartEvent")&&!A(n.$parent,"bpmn:SubProcess")?(e=mt(hE,i),this._createEntries(t,e)):A(n,"bpmn:Participant")?(e=mt(CE,function(r){return Pt(n)!==r.target.isExpanded}),this._createEntries(t,e)):A(n,"bpmn:StartEvent")&&je(n.$parent)?(e=mt(wE,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")&&!je(n.$parent)&&A(n.$parent,"bpmn:SubProcess")?(e=mt(dE,i),this._createEntries(t,e)):A(n,"bpmn:EndEvent")?(e=mt(fE,function(r){return!(r.target.eventDefinitionType=="bpmn:CancelEventDefinition"&&!A(n.$parent,"bpmn:Transaction"))&&i(r)}),this._createEntries(t,e)):A(n,"bpmn:BoundaryEvent")?(e=mt(_E,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=mt(mE,i),this._createEntries(t,e)):A(n,"bpmn:Gateway")?(e=mt(vE,i),this._createEntries(t,e)):A(n,"bpmn:Transaction")?(e=mt(gE,i),this._createEntries(t,e)):je(n)&&Pt(n)?(e=mt(bE,i),this._createEntries(t,e)):A(n,"bpmn:SubProcess")&&Pt(n)?(e=mt(yE,i),this._createEntries(t,e)):A(n,"bpmn:AdHocSubProcess")&&!Pt(n)?(e=mt(sv,function(r){var o=r.target,a=o.type==="bpmn:SubProcess",c=o.isExpanded===!0;return av(t)&&(!a||c)}),this._createEntries(t,e)):A(n,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(t,SE):A(n,"bpmn:FlowNode")?(e=mt(sv,i),A(n,"bpmn:SubProcess")&&!Pt(n)&&(e=mt(e,function(r){return r.label!=="Sub Process (collapsed)"})),this._createEntries(t,e)):[]},rn.prototype.getHeaderEntries=function(t){var e=[];return A(t,"bpmn:Activity")&&!je(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")||je(t)||e.push(this._getAdHocEntry(t)),e},rn.prototype._createEntries=function(t,e){var n=[],i=this;return L(e,function(r){var o=i._createMenuEntry(r,t);n.push(o)}),n},rn.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},rn.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}},rn.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"}}]},rn.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})}}]},rn.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},rn.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 TE={__depends__:[aE,ov],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",rn]};var Is=Math.max,Ds=Math.min;function cv(t,e){return{top:t.top-e.top,right:t.right-e.right,bottom:t.bottom-e.bottom,left:t.left-e.left}}function Bs(t,e,n){var i=e[t],r=n.min&&n.min[t],o=n.max&&n.max[t];return ht(r)&&(i=(/top|left/.test(t)?Ds:Is)(i,r)),ht(o)&&(i=(/top|left/.test(t)?Is:Ds)(i,o)),i}function Xo(t,e){return t!==void 0?t:20}function AE(t){return!t.waypoints&&t.type!=="label"}function lv(t,e){var n;if((n=t.length===void 0?mt(t.children,AE):t).length)return function(i,r){var o,a,c,l;return typeof r=="object"?(o=Xo(r.left),a=Xo(r.right),c=Xo(r.top),l=Xo(r.bottom)):o=a=c=l=Xo(r),{x:i.x-o,y:i.y-c,width:i.width+o+a,height:i.height+c+l}}(ve(n),e)}var Os=Math.abs,kE=["bpmn:Participant","bpmn:Process","bpmn:SubProcess"],Jr=30;function Ls(t,e){return e=e||[],t.children.filter(function(n){A(n,"bpmn:Lane")&&(Ls(n,e),e.push(n))}),e}function wi(t){return t.children.filter(function(e){return A(e,"bpmn:Lane")})}function gn(t){return _s(t,kE)||t}function PE(t,e){var n=gn(t),i=Ls(n,A(n,"bpmn:Process")?[]:[n]),r=st(t),o=st(e),a=function(l,u){return cv(st(u),st(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=st(l);a.top&&(Os(g.bottom-r.top)<10&&(f=o.top-g.bottom),Os(g.top-r.top)<5&&(d=o.top-g.top)),a.bottom&&(Os(g.top-r.bottom)<10&&(d=o.bottom-g.top),Os(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 Ou(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(Ur(y)&&i.isOpen(f)){var v=i.getEntries(f);v.replace&&v.replace.action.click(y,f)}})}function uv(t,e,n){var i=t.$instanceOf(e),r=!1;return L(t.eventDefinitions||[],function(o){o.$type===n&&(r=!0)}),i&&r}Ou.$inject=["config.contextPad","injector","eventBus","contextPad","modeling","elementFactory","connect","create","popupMenu","canvas","rules","translate"],Ou.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(S,w){r.start(S,w)}function v(S,w,C,B){function s(m,_){var T=i.createShape(z({type:S},B));o.start(m,T,{source:_})}typeof C!="string"&&(B=C,C=p("Append {type}",{type:S.replace(/^bpmn:/,"")}));var h=u?function(m,_){var T=i.createShape(z({type:S},B));u.append(_,T)}:s;return{group:"model",className:w,title:C,action:{dragstart:s,click:h}}}function g(S){return function(w,C){n.splitLane(C,S),e.open(C,!0)}}if(wt(y,["bpmn:Lane","bpmn:Participant"])&&Pt(y)){var b=wi(t);z(d,{"lane-insert-above":{group:"lane-insert-above",className:"bpmn-icon-lane-insert-above",title:p("Add Lane above"),action:{click:function(S,w){n.addLane(w,"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(S,w){n.addLane(w,"bottom")}}}})}A(y,"bpmn:FlowNode")&&(A(y,"bpmn:EventBasedGateway")?z(d,{"append.receive-task":v("bpmn:ReceiveTask","bpmn-icon-receive-task",p("Append ReceiveTask")),"append.message-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",p("Append MessageIntermediateCatchEvent"),{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",p("Append TimerIntermediateCatchEvent"),{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condition-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",p("Append ConditionIntermediateCatchEvent"),{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":v("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",p("Append SignalIntermediateCatchEvent"),{eventDefinitionType:"bpmn:SignalEventDefinition"})}):uv(y,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?z(d,{"append.compensation-activity":v("bpmn:Task","bpmn-icon-task",p("Append compensation activity"),{isForCompensation:!0})}):A(y,"bpmn:EndEvent")||y.isForCompensation||uv(y,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||je(y)||z(d,{"append.end-event":v("bpmn:EndEvent","bpmn-icon-end-event-none",p("Append EndEvent")),"append.gateway":v("bpmn:ExclusiveGateway","bpmn-icon-gateway-none",p("Append Gateway")),"append.append-task":v("bpmn:Task","bpmn-icon-task",p("Append Task")),"append.intermediate-event":v("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none",p("Append Intermediate/Boundary Event"))})),a.isEmpty(t,"bpmn-replace")||z(d,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:p("Change type"),action:{click:function(S,w){var C=z(function(B){var s=c.getContainer(),h=e.getPad(B).html,m=s.getBoundingClientRect(),_=h.getBoundingClientRect(),T=_.top-m.top;return{x:_.left-m.left,y:T+_.height+5}}(w),{cursor:{x:S.x,y:S.y}});a.open(w,"bpmn-replace",C)}}}}),wt(y,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(d,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using "+(y.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:f,dragstart:f}}}),A(y,"bpmn:TextAnnotation")&&z(d,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using Association"),action:{click:f,dragstart:f}}}),wt(y,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&z(d,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:p("Connect using DataInputAssociation"),action:{click:f,dragstart:f}}}),A(y,"bpmn:Group")&&z(d,{"append.text-annotation":v("bpmn:TextAnnotation","bpmn-icon-text-annotation")});var E=l.allowed("elements.delete",{elements:[t]});return gt(E)&&(E=E[0]===t),E&&z(d,{delete:{group:"edit",className:"bpmn-icon-trash",title:p("Remove"),action:{click:function(S){n.removeElements([t])}}}}),d};const ME={__depends__:[Vf,nE,Mn,Ru,ks,TE],__init__:["contextPadProvider"],contextPadProvider:["type",Ou]};var RE={horizontal:["x","width"],vertical:["y","height"]};function Jn(t){this._modeling=t,this._filters=[],this.registerFilter(function(e,n,i){var r,o=0,a=0;return L(e,function(c){c.waypoints||c.labelTarget||(o+=c[i],a+=1)}),r=Math.round(o/a),mt(e,function(c){return c[i]<r+50})})}Jn.$inject=["modeling"],Jn.prototype.registerFilter=function(t){if(typeof t!="function")throw new Error("the filter has to be a function");this._filters.push(t)},Jn.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},Jn.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},Jn.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(Ke(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},Jn.prototype._setOrientation=function(t){var e=RE[t];this._axis=e[0],this._dimension=e[1]},Jn.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)},Jn.prototype._findRange=function(t){var e=t[this._axis];return{min:e+5,max:e+t[this._dimension]-5}};const NE={__init__:["distributeElements"],distributeElements:["type",Jn]};function pv(t){t.registerFilter(function(e){return mt(e,function(n){var i=wt(n,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:Participant","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(n.labelTarget||i)})})}pv.$inject=["distributeElements"];const IE={__depends__:[NE],__init__:["bpmnDistributeElements"],bpmnDistributeElements:["type",pv]};var hv="is not a registered action";function on(t,e){this._actions={};var n=this;t.on("diagram.init",function(){n._registerDefaultActions(e),t.fire("editorActions.init",{editorActions:n})})}function Lu(t,e){return new Error(t+" "+e)}on.$inject=["eventBus","injector"],on.prototype._registerDefaultActions=function(t){var e=t.get("commandStack",!1),n=t.get("modeling",!1),i=t.get("selection",!1),r=t.get("zoomScroll",!1),o=t.get("copyPaste",!1),a=t.get("canvas",!1),c=t.get("rules",!1),l=t.get("keyboardMove",!1),u=t.get("keyboardMoveSelection",!1);e&&(this.register("undo",function(){e.undo()}),this.register("redo",function(){e.redo()})),o&&i&&this.register("copy",function(){var p=i.get();o.copy(p)}),o&&this.register("paste",function(){o.paste()}),r&&this.register("stepZoom",function(p){r.stepZoom(p.value)}),a&&this.register("zoom",function(p){a.zoom(p.value)}),n&&i&&c&&this.register("removeSelection",function(){var p=i.get();if(p.length){var d,y=c.allowed("elements.delete",{elements:p});y!==!1&&(d=gt(y)?y:p).length&&n.removeElements(d.slice())}}),l&&this.register("moveCanvas",function(p){l.moveCanvas(p)}),u&&this.register("moveSelection",function(p){u.moveSelection(p.direction,p.accelerated)})},on.prototype.trigger=function(t,e){if(!this._actions[t])throw Lu(t,hv);return this._actions[t](e)},on.prototype.register=function(t,e){var n=this;if(typeof t=="string")return this._registerAction(t,e);L(t,function(i,r){n._registerAction(r,i)})},on.prototype._registerAction=function(t,e){if(this.isRegistered(t))throw Lu(t,"is already registered");this._actions[t]=e},on.prototype.unregister=function(t){if(!this.isRegistered(t))throw Lu(t,hv);this._actions[t]=void 0},on.prototype.getActions=function(){return Object.keys(this._actions)},on.prototype.isRegistered=function(t){return!!this._actions[t]};const DE={__init__:["editorActions"],editorActions:["type",on]};function js(t){t.invoke(on,this)}rt(js,on),js.$inject=["injector"],js.prototype._registerDefaultActions=function(t){on.prototype._registerDefaultActions.call(this,t);var e=t.get("canvas",!1),n=t.get("elementRegistry",!1),i=t.get("selection",!1),r=t.get("spaceTool",!1),o=t.get("lassoTool",!1),a=t.get("handTool",!1),c=t.get("globalConnect",!1),l=t.get("distributeElements",!1),u=t.get("alignElements",!1),p=t.get("directEditing",!1),d=t.get("searchPad",!1),y=t.get("modeling",!1);e&&n&&i&&this._registerAction("selectElements",function(){var f=e.getRootElement(),v=n.filter(function(g){return g!==f});return i.select(v),v}),r&&this._registerAction("spaceTool",function(){r.toggle()}),o&&this._registerAction("lassoTool",function(){o.toggle()}),a&&this._registerAction("handTool",function(){a.toggle()}),c&&this._registerAction("globalConnectTool",function(){c.toggle()}),i&&l&&this._registerAction("distributeElements",function(f){var v=i.get(),g=f.type;v.length&&l.trigger(v,g)}),i&&u&&this._registerAction("alignElements",function(f){var v=i.get(),g=[],b=f.type;v.length&&(g=mt(v,function(E){return!A(E,"bpmn:Lane")}),u.trigger(g,b))}),i&&y&&this._registerAction("setColor",function(f){var v=i.get();v.length&&y.setColor(v,f)}),i&&p&&this._registerAction("directEditing",function(){var f=i.get();f.length&&p.activate(f[0])}),d&&this._registerAction("find",function(){d.toggle()}),e&&y&&this._registerAction("moveToOrigin",function(){var f,v,g=e.getRootElement();f=ve(v=A(g,"bpmn:Collaboration")?n.filter(function(b){return A(b.parent,"bpmn:Collaboration")}):n.filter(function(b){return b!==g&&!A(b.parent,"bpmn:SubProcess")})),y.moveElements(v,{x:-f.x,y:-f.y},g)})};const BE={__depends__:[DE],editorActions:["type",js]};function dv(t){t.on(["create.init","shape.move.init"],function(e){var n=e.context;wt(e.shape,["bpmn:Participant","bpmn:SubProcess","bpmn:TextAnnotation"])&&(n.gridSnappingContext||(n.gridSnappingContext={}),n.gridSnappingContext.snapLocation="top-left")})}dv.$inject=["eventBus"];function ju(t,e,n){return n||(n="round"),Math[n](t/e)*e}function Si(t,e,n){var i=!n||n.active!==!1;this._eventBus=e;var r=this;e.on("diagram.init",800,function(){r.setActive(i)}),e.on(["create.move","create.end","bendpoint.move.move","bendpoint.move.end","connect.move","connect.end","connectionSegment.move.move","connectionSegment.move.end","resize.move","resize.end","shape.move.move","shape.move.end"],1200,function(o){var a=o.originalEvent;if(!(!r.active||a&&He(a))){var c=o.context,l=c.gridSnappingContext;l||(l=c.gridSnappingContext={}),["x","y"].forEach(function(u){var p={},d=function(f,v,g){var b=f.context,E=f.shape,S=b.gridSnappingContext,w=S.snapLocation,C=S.snapOffset;return C&&ht(C[v])||(C||(C=S.snapOffset={}),ht(C[v])||(C[v]=0),!E)||(g.get(E.id)||(Vs(v)?C[v]+=E[v]+E.width/2:C[v]+=E[v]+E.height/2),!w)||(v==="x"?/left/.test(w)?C[v]-=E.width/2:/right/.test(w)&&(C[v]+=E.width/2):/top/.test(w)?C[v]-=E.height/2:/bottom/.test(w)&&(C[v]+=E.height/2)),C[v]}(o,u,t);d&&(p.offset=d);var y=function(f,v){var g=f.context,b=g.createConstraints,E=g.resizeConstraints||{},S=g.gridSnappingContext,w=S.snapConstraints;if(w&&w[v])return w[v];w||(w=S.snapConstraints={}),w[v]||(w[v]={});var C=g.direction;b&&(Vs(v)?(w.x.min=b.left,w.x.max=b.right):(w.y.min=b.top,w.y.max=b.bottom));var B=E.min,s=E.max;return B&&(Vs(v)?fv(C)?w.x.max=B.left:w.x.min=B.right:mv(C)?w.y.max=B.top:w.y.min=B.bottom),s&&(Vs(v)?fv(C)?w.x.min=s.left:w.x.max=s.right:mv(C)?w.y.min=s.top:w.y.max=s.bottom),w[v]}(o,u);y&&z(p,y),Yr(o,u)||r.snapEvent(o,u,p)})}})}function Vs(t){return t==="x"}function mv(t){return t.indexOf("n")!==-1}function fv(t){return t.indexOf("w")!==-1}function er(t,e){Q.call(this,t),this._gridSnapping=e;var n=this;this.preExecute("shape.resize",function(i){var r=i.context,o=(r.hints||{}).autoResize;if(o){var a=r.shape,c=r.newBounds;Ie(o)?r.newBounds=n.snapComplex(c,o):r.newBounds=n.snapSimple(a,c)}})}Si.prototype.snapEvent=function(t,e,n){re(t,e,this.snapValue(t[e],n))},Si.prototype.getGridSpacing=function(){return 10},Si.prototype.snapValue=function(t,e){var n,i,r=0;return e&&e.offset&&(r=e.offset),t=ju(t+=r,10),e&&e.min&&ht(n=e.min)&&(n=ju(n+r,10,"ceil"),t=Math.max(t,n)),e&&e.max&&ht(i=e.max)&&(i=ju(i+r,10,"floor"),t=Math.min(t,i)),t-=r},Si.prototype.isActive=function(){return this.active},Si.prototype.setActive=function(t){this.active=t,this._eventBus.fire("gridSnapping.toggle",{active:t})},Si.prototype.toggleActive=function(){this.setActive(!this.active)},Si.$inject=["elementRegistry","eventBus","config.gridSnapping"],er.$inject=["eventBus","gridSnapping","modeling"],rt(er,Q),er.prototype.snapSimple=function(t,e){var n=this._gridSnapping;return e.width=n.snapValue(e.width,{min:e.width}),e.height=n.snapValue(e.height,{min:e.height}),e.x=t.x+t.width/2-e.width/2,e.y=t.y+t.height/2-e.height/2,e},er.prototype.snapComplex=function(t,e){return/w|e/.test(e)&&(t=this.snapHorizontally(t,e)),/n|s/.test(e)&&(t=this.snapVertically(t,e)),t},er.prototype.snapHorizontally=function(t,e){var n=this._gridSnapping,i=/w/.test(e),r=/e/.test(e),o={};return o.width=n.snapValue(t.width,{min:t.width}),r&&(i?(o.x=n.snapValue(t.x,{max:t.x}),o.width+=n.snapValue(t.x-o.x,{min:t.x-o.x})):t.x=t.x+t.width-o.width),z(t,o),t},er.prototype.snapVertically=function(t,e){var n=this._gridSnapping,i=/n/.test(e),r=/s/.test(e),o={};return o.height=n.snapValue(t.height,{min:t.height}),i&&(r?(o.y=n.snapValue(t.y,{max:t.y}),o.height+=n.snapValue(t.y-o.y,{min:t.y-o.y})):t.y=t.y+t.height-o.height),z(t,o),t};function vv(t,e){t.on(["spaceTool.move","spaceTool.end"],2e3,function(n){var i,r=n.context;r.initialized&&(r.axis==="x"?(i=e.snapValue(n.dx),n.x=n.x+i-n.dx,n.dx=i):(i=e.snapValue(n.dy),n.y=n.y+i-n.dy,n.dy=i))})}vv.$inject=["eventBus","gridSnapping"];const OE={__depends__:[{__init__:["gridSnappingResizeBehavior","gridSnappingSpaceToolBehavior"],gridSnappingResizeBehavior:["type",er],gridSnappingSpaceToolBehavior:["type",vv]}],__init__:["gridSnapping"],gridSnapping:["type",Si]};function yv(t,e){t.on("autoPlace",2e3,function(n){var i=n.source,r=vt(i),o=n.shape,a=nf(i,o);return["x","y"].forEach(function(c){var l={};a[c]!==r[c]&&(a[c]>r[c]?l.min=a[c]:l.max=a[c],A(o,"bpmn:TextAnnotation")&&(function(u){return u==="x"}(c)?l.offset=-o.width/2:l.offset=-o.height/2),a[c]=e.snapValue(a[c],l))}),a})}yv.$inject=["eventBus","gridSnapping"];function gv(t,e,n){e.on(["create.start","shape.move.start"],1750,function(i){var r=i.context,o=r.shape,a=t.getRootElement();A(o,"bpmn:Participant")&&A(a,"bpmn:Process")&&a.children.length&&r.createConstraints&&(o.width=n.snapValue(o.width,{min:o.width}),o.height=n.snapValue(o.height,{min:o.height}))})}gv.$inject=["canvas","eventBus","gridSnapping"];function Fs(t,e,n){Q.call(this,t),this._gridSnapping=e;var i=this;this.postExecuted(["connection.create","connection.layout"],3e3,function(r){var o=r.context,a=o.connection,c=o.hints||{},l=a.waypoints;c.connectionStart||c.connectionEnd||c.createElementsBehavior===!1||function(u){return u.length>3}(l)&&n.updateWaypoints(a,i.snapMiddleSegments(l))})}function LE(t,e,n){var i=Gn(e,n),r={};return function(o){return o==="h"}(i)&&(r.y=t.snapValue(e.y)),function(o){return o==="v"}(i)&&(r.x=t.snapValue(e.x)),("x"in r||"y"in r)&&(e=z({},e,r),n=z({},n,r)),[e,n]}Fs.$inject=["eventBus","gridSnapping","modeling"],rt(Fs,Q),Fs.prototype.snapMiddleSegments=function(t){var e,n=this._gridSnapping;t=t.slice();for(var i=1;i<t.length-2;i++)e=LE(n,t[i],t[i+1]),t[i]=e[0],t[i+1]=e[1];return t};const jE={__depends__:[OE,{__init__:["gridSnappingAutoPlaceBehavior","gridSnappingCreateParticipantBehavior","gridSnappingLayoutConnectionBehavior"],gridSnappingAutoPlaceBehavior:["type",yv],gridSnappingCreateParticipantBehavior:["type",gv],gridSnappingLayoutConnectionBehavior:["type",Fs]}],__init__:["bpmnGridSnapping"],bpmnGridSnapping:["type",dv]};function Ko(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")?Pt(r)?n.createParticipantHit(r,o):n.createDefaultHit(r,o):A(r,"bpmn:SubProcess")?Pt(r)?n.createSubProcessHit(r,o):n.createDefaultHit(r,o):void 0})}Ko.$inject=["eventBus","interactionEvents"],Ko.prototype.createDefaultHit=function(t,e){return this._interactionEvents.removeHits(e),this._interactionEvents.createDefaultHit(t,e),!0},Ko.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},Ko.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 VE={__init__:["bpmnInteractionEvents"],bpmnInteractionEvents:["type",Ko]};function zs(t){t.invoke(qr,this)}rt(zs,qr),zs.$inject=["injector"],zs.prototype.registerBindings=function(t,e){function n(i,r){e.isRegistered(i)&&t.addListener(r)}qr.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 FE={__depends__:[du],__init__:["keyboardBindings"],keyboardBindings:["type",zs]};var zE={moveSpeed:1,moveSpeedAccelerated:10},bv="left",xv="right",Ev="down",$E={ArrowLeft:bv,Left:bv,ArrowUp:"up",Up:"up",ArrowRight:xv,Right:xv,ArrowDown:Ev,Down:Ev},GE={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 _v(t,e,n,i,r){var o=this;this._config=z({},zE,t||{}),e.addListener(1500,function(a){var c=a.keyEvent,l=$E[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=GE[a](u);i.allowed("elements.move",{shapes:l})&&n.moveElements(l,p)}}}_v.$inject=["config.keyboardMoveSelection","keyboard","modeling","rules","selection"];const UE={__depends__:[du,Mn],__init__:["keyboardMoveSelection"],keyboardMoveSelection:["type",_v]};function wv(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(Ad(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)})}wv.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];const Sv={__init__:["changeSupport"],changeSupport:["type",wv]};function Yo(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,E={x:y.x,y:y.y,width:y.width,height:y.height};return f.indexOf("n")!==-1?(E.y=y.y+b,E.height=y.height-b):f.indexOf("s")!==-1&&(E.height=y.height+b),f.indexOf("e")!==-1?E.width=y.width+g:f.indexOf("w")!==-1&&(E.x=y.x+g,E.width=y.width-g),E}(u,p,c),a.newBounds=function(y,f){if(!f)return y;var v=st(y);return Xl({top:Bs("top",v,f),right:Bs("right",v,f),bottom:Bs("bottom",v,f),left:Bs("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:st(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=$d(p)))return;n.resizeShape(l,p)}})(a.context)})}function Cv(t,e){var n=vt(t),i=st(t),r={x:n.x,y:n.y};return e.indexOf("n")!==-1?r.y=i.top:e.indexOf("s")!==-1&&(r.y=i.bottom),e.indexOf("e")!==-1?r.x=i.right:e.indexOf("w")!==-1&&(r.x=i.left),r}function HE(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"}Yo.prototype.canResize=function(t){var e=this._rules,n=Je(t,["newBounds","shape","delta","direction"]);return e.allowed("shape.resize",n)},Yo.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,Cv(e,r),"resize",{autoActivate:!0,cursor:HE(r),data:{shape:e,context:i}})},Yo.prototype.computeMinResizeBox=function(t){var e=t.shape;return function(n,i,r,o){var a=st(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?st(o):c;return Xl({top:Ds(c.top,l.top),left:Ds(c.left,l.left),bottom:Is(c.bottom,l.bottom),right:Is(c.right,l.right)})}(t.direction,e,t.minDimensions||{width:10,height:10},lv(e,t.childrenBoxPadding))},Yo.$inject=["eventBus","rules","modeling","dragging"];var Tv="djs-resizing",Av="resize-not-ok";function kv(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,Tv)),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(Av):bt(c).add(Av)}),t.on("resize.cleanup",function(i){var r,o;r=i.context,o=r.shape,r.frame&&Zt(r.frame),e.removeMarker(o,Tv)})}kv.$inject=["eventBus","canvas","previewSupport"];var Pv=-6,Jo="djs-resizer",qE=["n","w","s","e","nw","ne","se","sw"];function Ci(t,e,n,i){this._resize=i,this._canvas=e;var r=this;t.on("selection.changed",function(o){var a=o.newSelection;r.removeResizers(),a.length===1&&L(a,_e(r.addResizer,r))}),t.on("shape.changed",function(o){var a=o.element;n.isSelected(a)&&(r.removeResizers(),r.addResizer(a))})}Ci.prototype.makeDraggable=function(t,e,n){var i=this._resize;function r(o){Ei(o)&&i.activate(o,t,n)}ct.bind(e,"mousedown",r),ct.bind(e,"touchstart",r)},Ci.prototype._createResizer=function(t,e,n,i){var r=this._getResizersParent(),o=function(u){var p={x:0,y:0};return u.indexOf("e")!==-1?p.x=6:u.indexOf("w")!==-1&&(p.x=Pv),u.indexOf("s")!==-1?p.y=6:u.indexOf("n")!==-1&&(p.y=Pv),p}(i),a=ot("g");bt(a).add(Jo),bt(a).add(Jo+"-"+t.id),bt(a).add(Jo+"-"+i),lt(r,a);var c=ot("rect");K(c,{x:-2+o.x,y:-2+o.y,width:4,height:4}),bt(c).add(Jo+"-visual"),lt(a,c);var l=ot("rect");return K(l,{x:-10+o.x,y:-10+o.y,width:20,height:20}),bt(l).add(Jo+"-hit"),lt(a,l),Zl(a,e,n),a},Ci.prototype.createResizer=function(t,e){var n=Cv(t,e),i=this._createResizer(t,n.x,n.y,e);this.makeDraggable(t,i,e)},Ci.prototype.addResizer=function(t){var e=this;this._resize.canResize({shape:t})&&L(qE,function(n){e.createResizer(t,n)})},Ci.prototype.removeResizers=function(){Dl(this._getResizersParent())},Ci.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},Ci.$inject=["eventBus","canvas","selection","resize"];const Mv={__depends__:[In,Kn,Go],__init__:["resize","resizePreview","resizeHandles"],resize:["type",Yo],resizePreview:["type",kv],resizeHandles:["type",Ci]};function Vu(t,e){var n=e.create("bpmn:CategoryValue"),i=e.create("bpmn:Category",{categoryValue:[n]});return Xt(t.get("rootElements"),i),et(i).$parent=t,et(n).$parent=i,n}function Zo(t,e,n,i,r,o,a){function c(l,u){(u||wt(l,["bpmn:Task","bpmn:TextAnnotation"])||Fu(l))&&i.activate(l)}this._bpmnFactory=e,this._canvas=n,this._modeling=r,this._textRenderer=a,i.registerProvider(this),t.on("element.dblclick",function(l){c(l.element,!0)}),t.on(["autoPlace.start","canvas.viewbox.changing","drag.init","element.mousedown","popupMenu.open"],function(l){i.isActive()&&i.complete()}),t.on(["commandStack.changed"],function(l){i.isActive()&&i.cancel()}),t.on("directEditing.activate",function(l){o.removeResizers()}),t.on("create.end",500,function(l){var u=l.context,p=u.shape,d=l.context.canExecute;l.isTouch||d&&(u.hints&&u.hints.createElementsBehavior===!1||c(p))}),t.on("autoPlace.end",500,function(l){c(l.shape)})}function Fu(t){return A(t,"bpmn:SubProcess")&&!Pt(t)}Zo.$inject=["eventBus","bpmnFactory","canvas","directEditing","modeling","resizeHandles","textRenderer"],Zo.prototype.activate=function(t){var e=mn(t);if(e!==void 0){var n={text:e};z(n,this.getEditingBBox(t));var i={};return(wt(t,["bpmn:Task","bpmn:Participant","bpmn:Lane","bpmn:CallActivity"])||Fu(t))&&z(i,{centerVertically:!0}),$r(t)&&z(i,{autoResize:!0}),A(t,"bpmn:TextAnnotation")&&z(i,{resizable:!0,autoResize:!0}),z(n,{options:i}),n}},Zo.prototype.getEditingBBox=function(t){var e=this._canvas,n=t.label||t,i=e.getAbsoluteBBox(n),r=i.x+i.width/2,o=i.y+i.height/2,a={x:i.x,y:i.y},c=e.zoom(),l=this._textRenderer.getDefaultStyle(),u=this._textRenderer.getExternalStyle(),p=u.fontSize*c,d=u.lineHeight,y=l.fontSize*c,f=l.lineHeight,v={fontFamily:this._textRenderer.getDefaultStyle().fontFamily,fontWeight:this._textRenderer.getDefaultStyle().fontWeight};(A(t,"bpmn:Lane")||function(B){return A(B,"bpmn:Participant")&&Pt(B)}(t))&&(z(a,{width:i.height,height:30*c,x:i.x-i.height/2+15*c,y:o-30*c/2}),z(v,{fontSize:y+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px",transform:"rotate(-90deg)"})),(wt(t,["bpmn:Task","bpmn:CallActivity"])||function(B){return A(B,"bpmn:Participant")&&!Pt(B)}(t)||Fu(t))&&(z(a,{width:i.width,height:i.height}),z(v,{fontSize:y+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"})),function(B){return A(B,"bpmn:SubProcess")&&Pt(B)}(t)&&(z(a,{width:i.width,x:i.x}),z(v,{fontSize:y+"px",lineHeight:f,paddingTop:7*c+"px",paddingBottom:7*c+"px",paddingLeft:5*c+"px",paddingRight:5*c+"px"}));var g=90*c,b=7*c,E=4*c;if(n.labelTarget&&(z(a,{width:g,height:i.height+b+E,x:r-g/2,y:i.y-b}),z(v,{fontSize:p+"px",lineHeight:d,paddingTop:b+"px",paddingBottom:E+"px"})),$r(n)&&!ms(n)&&!ge(n)){var S=fs(t),w=e.getAbsoluteBBox({x:S.x,y:S.y,width:0,height:0}),C=p+b+E;z(a,{width:g,height:C,x:w.x-g/2,y:w.y-C/2}),z(v,{fontSize:p+"px",lineHeight:d,paddingTop:b+"px",paddingBottom:E+"px"})}return A(t,"bpmn:TextAnnotation")&&(z(a,{width:i.width,height:i.height,minWidth:30*c,minHeight:10*c}),z(v,{textAlign:"left",paddingTop:5*c+"px",paddingBottom:7*c+"px",paddingLeft:7*c+"px",paddingRight:5*c+"px",fontSize:y+"px",lineHeight:f})),{bounds:a,style:v}},Zo.prototype.update=function(t,e,n,i){var r,o,a;if(A(t,"bpmn:TextAnnotation")&&(o=this._canvas.getAbsoluteBBox(t),r={x:t.x,y:t.y,width:t.width/o.width*i.width,height:t.height/o.height*i.height}),A(t,"bpmn:Group")&&!et(t).categoryValueRef){var c=Vu(et(this._canvas.getRootElement()).$parent,this._bpmnFactory);et(t).categoryValueRef=c}(a=e)&&a.trim()||(e=null),this._modeling.updateLabel(t,e,r)};var Rv="djs-element-hidden",Nv="djs-label-hidden";function Iv(t,e,n,i){var r,o,a,c=this,l=e.getDefaultLayer();t.on("directEditing.activate",function(u){var p=u.active;if(A(r=p.element.label||p.element,"bpmn:TextAnnotation")){o=e.getAbsoluteBBox(r),a=ot("g");var d=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:r.height,position:{mx:0,my:0}}),y=c.path=ot("path");K(y,{d,strokeWidth:2,stroke:WE(r)}),lt(a,y),lt(l,a),Oe(a,r.x,r.y)}A(r,"bpmn:TextAnnotation")||r.labelTarget?e.addMarker(r,Rv):(A(r,"bpmn:Task")||A(r,"bpmn:CallActivity")||A(r,"bpmn:SubProcess")||A(r,"bpmn:Participant"))&&e.addMarker(r,Nv)}),t.on("directEditing.resize",function(u){if(A(r,"bpmn:TextAnnotation")){var p=u.height,d=u.dy,y=Math.max(r.height/o.height*(p+d),0),f=i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r.width,containerHeight:y,position:{mx:0,my:0}});K(c.path,{d:f})}}),t.on(["directEditing.complete","directEditing.cancel"],function(u){var p=u.active;p&&(e.removeMarker(p.element.label||p.element,Rv),e.removeMarker(r,Nv)),r=void 0,o=void 0,a&&(Zt(a),a=void 0)})}function WE(t,e){return et(t).di.get("stroke")||e||"black"}Iv.$inject=["eventBus","canvas","elementRegistry","pathMap"];const XE={__depends__:[Sv,Mv,Vf],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Zo],labelEditingPreview:["type",Iv]};var zu=["top","bottom","left","right"],$s=10;function $u(t,e){function n(i){if(ms(i)){var r=function(o){var a=vt(o.label),c=vt(o),l=Dv(c,a);if(u=l,zu.indexOf(u)!==-1){var u,p=function(f){var v=vt(f),g=[].concat(f.incoming.map(function(b){return b.waypoints[b.waypoints.length-2]}),f.outgoing.map(function(b){return b.waypoints[1]})).map(function(b){return Dv(v,b)});return g}(o);if(o.host){var d=function(f){var v,g=f.host,b=vt(f),E=ye(b,g);v=E.indexOf("-")>=0?E.split("-"):[E];var S=zu.filter(function(w){return v.indexOf(w)===-1});return S}(o);p=p.concat(d)}var y=zu.filter(function(f){return p.indexOf(f)===-1});if(y.indexOf(l)===-1)return y[0]}}(i);r&&function(o,a){var c=vt(o),l=o.label,u=vt(l);if(l.parent){var p,d=st(o);switch(a){case"top":p={x:c.x,y:d.top-$s-l.height/2};break;case"left":p={x:d.left-$s-l.width/2,y:c.y};break;case"bottom":p={x:c.x,y:d.bottom+$s+l.height/2};break;case"right":p={x:d.right+$s+l.width/2,y:c.y}}var y=Rn(p,u);e.moveShape(l,y)}}(i,r)}}Q.call(this,t),this.postExecuted(["connection.create","connection.layout","connection.updateWaypoints"],function(i){var r=i.context,o=r.connection,a=o.source,c=o.target;(r.hints||{}).createElementsBehavior!==!1&&(n(a),n(c))}),this.postExecuted(["label.create"],function(i){var r=i.context,o=r.shape;(r.hints||{}).createElementsBehavior!==!1&&n(o.labelTarget)}),this.postExecuted(["elements.create"],function(i){var r=i.context,o=r.elements;(r.hints||{}).createElementsBehavior!==!1&&o.forEach(function(a){n(a)})})}function Dv(t,e){return ye(e,t,5)}function Gu(t,e,n){Q.call(this,t),this.preExecute("shape.append",function(i){var r=i.source,o=i.shape;i.position||(A(o,"bpmn:TextAnnotation")?i.position={x:r.x+r.width/2+75,y:r.y-50-o.height/2}:i.position={x:r.x+r.width+80+o.width/2,y:r.y+r.height/2})},!0)}function Uu(t,e){t.invoke(Q,this),this.postExecute("shape.move",function(n){var i=n.newParent,r=n.shape;L(mt(r.incoming.concat(r.outgoing),function(o){return A(o,"bpmn:Association")}),function(o){e.moveConnection(o,{x:0,y:0},i)})},!0)}rt($u,Q),$u.$inject=["eventBus","modeling"],rt(Gu,Q),Gu.$inject=["eventBus","elementFactory","bpmnRules"],rt(Uu,Q),Uu.$inject=["injector","modeling"];function Gs(t,e){e.invoke(Q,this),this._bpmnReplace=t;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;(r=r.filter(function(o){return Bv(o,o.host)})).length===1&&r.map(function(o){return r.indexOf(o)}).forEach(function(o){var a=r[o];i.elements[o]=n.replaceShape(r[o],a)})},!0),this.preExecute("elements.move",500,function(i){var r=i.shapes,o=i.newHost;if(r.length===1){var a=r[0];Bv(a,o)&&(i.shapes=[n.replaceShape(a,o)])}},!0)}function Bv(t,e){return!ge(t)&&wt(t,["bpmn:IntermediateThrowEvent","bpmn:IntermediateCatchEvent"])&&!!e}Gs.$inject=["bpmnReplace","injector"],rt(Gs,Q),Gs.prototype.replaceShape=function(t,e){var n,i=(n=et(t).eventDefinitions)&&n[0],r={type:"bpmn:BoundaryEvent",host:e};return i&&(r.eventDefinitionType=i.$type),this._bpmnReplace.replaceElement(t,r,{layoutConnection:!1})};function Hu(t,e,n){function i(r){return mt(r.attachers,function(o){return A(o,"bpmn:BoundaryEvent")})}Q.call(this,t),this.postExecute("connection.create",function(r){var o=r.context.source,a=r.context.target,c=i(a);A(o,"bpmn:EventBasedGateway")&&A(a,"bpmn:ReceiveTask")&&c.length>0&&n.removeElements(c)}),this.postExecute("connection.reconnect",function(r){var o=r.context.oldSource,a=r.context.newSource;A(o,"bpmn:Gateway")&&A(a,"bpmn:EventBasedGateway")&&L(a.outgoing,function(c){var l=c.target,u=i(l);A(l,"bpmn:ReceiveTask")&&u.length>0&&n.removeElements(u)})}),t.on("moddleCopy.canCopyProperty",2e3,function(r){var o=r.parent,a=r.property,c=r.propertyName,l=e.getPropertyDescriptor(o,c);l&&l.isReference&&A(a,"bpmn:RootElement")&&o.set(c,a)})}Hu.$inject=["eventBus","moddle","modeling"],rt(Hu,Q);function qu(t,e,n,i,r){function o(u){return wt(u,["bpmn:ReceiveTask","bpmn:SendTask"])||function(p,d){return gt(d)||(d=[d]),ui(d,function(y){return ps(p,y)})}(u,["bpmn:ErrorEventDefinition","bpmn:EscalationEventDefinition","bpmn:MessageEventDefinition","bpmn:SignalEventDefinition"])}function a(u){return!!kt(t.getDefinitions().get("rootElements"),Ye({id:u.id}))}function c(u){return A(u,"bpmn:ErrorEventDefinition")?"errorRef":A(u,"bpmn:EscalationEventDefinition")?"escalationRef":A(u,"bpmn:MessageEventDefinition")?"messageRef":A(u,"bpmn:SignalEventDefinition")?"signalRef":void 0}function l(u){if(wt(u,["bpmn:ReceiveTask","bpmn:SendTask"]))return u.get("messageRef");var p=u.get("eventDefinitions")[0];return p.get(c(p))}n.invoke(Q,this),this.executed("shape.create",function(u){var p=u.shape;if(o(p)){var d=l(et(p));d&&!a(d)&&(Xt(t.getDefinitions().get("rootElements"),d),u.addedRootElement=d)}},!0),this.reverted("shape.create",function(u){var p=u.addedRootElement;p&&Wt(t.getDefinitions().get("rootElements"),p)},!0),e.on("copyPaste.copyElement",function(u){var p=u.descriptor,d=u.element;if(o(d)){var y=l(et(d));y&&(p.referencedRootElement=y)}}),e.on("copyPaste.pasteElement",500,function(u){var p=u.descriptor,d=p.businessObject;if(o(d)){var y=p.referencedRootElement;y&&(a(y)||(y=i.copyElement(y,r.create(y.$type))),function(f,v){if(wt(f,["bpmn:ReceiveTask","bpmn:SendTask"]))return f.set("messageRef",v);var g=f.get("eventDefinitions")[0];g.set(c(g),v)}(d,y))}})}function Wu(t){t.invoke(Q,this),this.preExecute("shape.create",1500,function(e){var n=e.context,i=n.parent,r=n.shape;A(i,"bpmn:Lane")&&!A(r,"bpmn:Lane")&&(n.parent=_s(i,"bpmn:Participant"))})}qu.$inject=["bpmnjs","eventBus","injector","moddleCopy","bpmnFactory"],rt(qu,Q),Wu.$inject=["injector"],rt(Wu,Q);var Us=1500;function Ov(t,e,n){e.on(["create.hover","create.move","create.out","create.end","shape.move.hover","shape.move.move","shape.move.out","shape.move.end"],Us,function(i){var r=i.context.shape||i.shape,o=i.hover;A(o,"bpmn:Lane")&&!wt(r,["bpmn:Lane","bpmn:Participant"])&&(i.hover=gn(o),i.hoverGfx=t.getGraphics(i.hover));var a=n.getRootElement();o!==a&&(r.labelTarget||A(r,"bpmn:Group"))&&(i.hover=a,i.hoverGfx=t.getGraphics(i.hover))}),e.on(["connect.hover","connect.out","connect.end","connect.cleanup","global-connect.hover","global-connect.out","global-connect.end","global-connect.cleanup"],Us,function(i){var r=i.hover;A(r,"bpmn:Lane")&&(i.hover=gn(r)||r,i.hoverGfx=t.getGraphics(i.hover))}),e.on(["bendpoint.move.hover"],Us,function(i){var r=i.context,o=i.hover,a=r.type;A(o,"bpmn:Lane")&&/reconnect/.test(a)&&(i.hover=gn(o)||o,i.hoverGfx=t.getGraphics(i.hover))}),e.on(["connect.start"],Us,function(i){var r=i.context,o=r.start;A(o,"bpmn:Lane")&&(r.start=gn(o)||o)}),e.on("shape.move.start",2e3,function(i){var r=i.shape;A(r,"bpmn:Lane")&&(i.shape=gn(r)||r)})}function Xu(t,e,n){Q.call(this,t),this.preExecute("shape.create",function(i){var r=i.context.shape;if(A(r,"bpmn:DataObjectReference")&&r.type!=="label"){var o=e.create("bpmn:DataObject");r.businessObject.dataObjectRef=o}})}Ov.$inject=["elementRegistry","eventBus","canvas"],Xu.$inject=["eventBus","bpmnFactory","moddle"],rt(Xu,Q);var Lv=20,jv=20,Hs=2e3;function Ku(t,e,n){function i(r){var o,a=r.parent,c=t.getRootElement();A(c,"bpmn:Collaboration")?o=c:(o=n.makeCollaboration(),r.process=a),r.parent=o}Q.call(this,e),e.on(["create.start","shape.move.start"],Hs,function(r){var o=r.context,a=o.shape,c=t.getRootElement();if(A(a,"bpmn:Participant")&&A(c,"bpmn:Process")&&c.children.length){var l=c.children.filter(function(d){return!A(d,"bpmn:Group")&&!ge(d)&&!function(y){return!!y.waypoints}(d)});if(l.length){var u=ve(l),p=function(d,y){y={width:y.width+40+30,height:y.height+40};var f=Math.max(d.width,y.width),v=Math.max(d.height,y.height);return{x:-f/2,y:-v/2,width:f,height:v}}(a,u);z(a,p),o.createConstraints=function(d,y){return y=st(y),{bottom:y.top+d.height/2-jv,left:y.right-d.width/2+Lv,top:y.bottom-d.height/2+jv,right:y.left+d.width/2-Lv-30}}(a,u)}}}),e.on("create.start",Hs,function(r){var o=r.context.shape,a=t.getRootElement(),c=t.getGraphics(a);function l(u){u.element=a,u.gfx=c}A(o,"bpmn:Participant")&&A(a,"bpmn:Process")&&(e.on("element.hover",Hs,l),e.once("create.cleanup",function(){e.off("element.hover",l)}))}),this.preExecute("shape.create",function(r){var o=r.parent;A(r.shape,"bpmn:Participant")&&A(o,"bpmn:Process")&&i(r)},!0),this.execute("shape.create",function(r){var o=r.process,a=r.shape;o&&(r.oldProcessRef=a.businessObject.processRef,a.businessObject.processRef=o.businessObject)},!0),this.revert("shape.create",function(r){var o=r.process,a=r.shape;o&&(a.businessObject.processRef=r.oldProcessRef)},!0),this.postExecute("shape.create",function(r){var o=r.process,a=r.shape;if(o){var c=o.children.slice();n.moveElements(c,{x:0,y:0},a)}},!0),this.preExecute("elements.create",Hs,function(r){var o,a=r.elements,c=r.parent;qs(a)&&A(c,"bpmn:Process")&&(i(r),o=qs(a),r.oldProcessRef=o.businessObject.processRef,o.businessObject.processRef=c.businessObject)},!0),this.revert("elements.create",function(r){var o=r.elements;r.process&&(qs(o).businessObject.processRef=r.oldProcessRef)},!0),this.postExecute("elements.create",function(r){var o,a=r.elements,c=r.process;if(c){o=qs(a);var l=c.children.slice();n.moveElements(l,{x:0,y:0},o)}},!0)}function qs(t){return kt(t,function(e){return A(e,"bpmn:Participant")})}Ku.$inject=["canvas","eventBus","modeling"],rt(Ku,Q);var Vv="__targetRef_placeholder";function Yu(t,e){function n(o,a){var c=o.get("properties"),l=kt(c,function(u){return u.name===Vv});return!l&&a&&Xt(c,l=e.create("bpmn:Property",{name:Vv})),l}function i(o,a){var c=n(o);c&&(function(l,u,p){return kt(l.get("dataInputAssociations"),function(d){return d!==p&&d.targetRef===u})}(o,c,a)||Wt(o.get("properties"),c))}function r(o){var a,c=o.context,l=c.connection,u=l.businessObject,p=l.target,d=p&&p.businessObject,y=c.newTarget,f=y&&y.businessObject,v=c.oldTarget||c.target,g=v&&v.businessObject,b=l.businessObject;g&&g!==d&&i(g,u),f&&f!==d&&i(f,u),d?(a=n(d,!0),b.targetRef=a):b.targetRef=null}Q.call(this,t),this.executed(["connection.create","connection.delete","connection.move","connection.reconnect"],Fv(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnect"],Fv(r))}function Fv(t){return function(e){if(A(e.context.connection,"bpmn:DataInputAssociation"))return t(e)}}function Ws(t){this._bpmnUpdater=t}function Ju(t,e,n,i){function r(a){return a.children.filter(function(c){return A(c,"bpmn:DataStoreReference")&&!c.labelTarget})}function o(a,c){var l=a.businessObject||a;if(c=c||n.filter(function(p){return A(p,"bpmn:Participant")&&et(p).processRef})[0]){var u=c.businessObject||c;e.execute("dataStore.updateContainment",{dataStoreBo:l,newSemanticParent:u.processRef||u,newDiParent:u.di})}}Q.call(this,i),e.registerHandler("dataStore.updateContainment",Ws),this.preExecute("shape.create",function(a){var c=a.context,l=c.shape;A(l,"bpmn:DataStoreReference")&&l.type!=="label"&&(c.hints||(c.hints={}),c.hints.autoResize=!1)}),this.preExecute("elements.move",function(a){var c=a.context,l=c.shapes;l.filter(function(u){return A(u,"bpmn:DataStoreReference")}).length&&(c.hints||(c.hints={}),c.hints.autoResize=l.filter(function(u){return!A(u,"bpmn:DataStoreReference")}))}),this.postExecute("shape.create",function(a){var c=a.context.shape,l=c.parent;A(c,"bpmn:DataStoreReference")&&c.type!=="label"&&A(l,"bpmn:Collaboration")&&o(c)}),this.postExecute("shape.move",function(a){var c=a.context,l=c.shape,u=c.oldParent,p=l.parent;A(u,"bpmn:Collaboration")||A(l,"bpmn:DataStoreReference")&&l.type!=="label"&&A(p,"bpmn:Collaboration")&&o(l,A(u,"bpmn:Participant")?u:function(d,y){for(;d.parent;){if(A(d.parent,y))return d.parent;d=d.parent}}(u,"bpmn:Participant"))}),this.postExecute("shape.delete",function(a){var c=a.context.shape,l=t.getRootElement();wt(c,["bpmn:Participant","bpmn:SubProcess"])&&A(l,"bpmn:Collaboration")&&r(l).filter(function(u){return function(p,d){for(var y=p.businessObject||p,f=d.businessObject||d;y.$parent;){if(y.$parent===f.processRef||f)return!0;y=y.$parent}return!1}(u,c)}).forEach(function(u){o(u)})}),this.postExecute("canvas.updateRoot",function(a){var c=a.context,l=c.oldRoot,u=c.newRoot;r(l).forEach(function(p){A(u,"bpmn:Process")&&o(p,u)})})}Yu.$inject=["eventBus","bpmnFactory"],rt(Yu,Q),Ws.$inject=["bpmnUpdater"],Ws.prototype.execute=function(t){var e=t.dataStoreBo,n=t.newSemanticParent,i=t.newDiParent;t.oldSemanticParent=e.$parent,t.oldDiParent=e.di.$parent,this._bpmnUpdater.updateSemanticParent(e,n),this._bpmnUpdater.updateDiParent(e.di,i)},Ws.prototype.revert=function(t){var e=t.dataStoreBo,n=t.oldSemanticParent,i=t.oldDiParent;this._bpmnUpdater.updateSemanticParent(e,n),this._bpmnUpdater.updateDiParent(e.di,i)},Ju.$inject=["canvas","commandStack","elementRegistry","eventBus"],rt(Ju,Q);function Zu(t,e,n){Q.call(this,t),this.postExecuted("shape.delete",500,function(i){var r=i.context,o=r.hints,a=r.shape,c=r.oldParent;A(a,"bpmn:Lane")&&(o&&o.nested||function(l,u){var p,d,y,f=wi(u),v=[],g=[];Hi(f,function(b){return b.y>l.y?g.push(b):v.push(b),b.children}),f.length&&(p=g.length&&v.length?l.height/2:l.height,v.length&&(d=n.calculateAdjustments(v,"y",p,l.y-10),n.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:p},"s")),g.length&&(y=n.calculateAdjustments(g,"y",-p,l.y+l.height+10),n.makeSpace(y.movingShapes,y.resizingShapes,{x:0,y:-p},"n")))}(a,c))})}Zu.$inject=["eventBus","modeling","spaceTool"],rt(Zu,Q);function Xs(t,e){e.invoke(Q,this),this._bpmnReplace=t;var n=this;this.postExecuted("elements.create",500,function(i){var r=i.elements;r.filter(function(o){return zv(o,o.host)}).map(function(o){return r.indexOf(o)}).forEach(function(o){i.elements[o]=n.replaceShape(r[o])})},!0),this.preExecute("elements.move",500,function(i){var r=i.shapes,o=i.newHost;r.forEach(function(a,c){var l,u=a.host;zv(a,(l=u,r.indexOf(l)!==-1?u:o))&&(r[c]=n.replaceShape(a))})},!0)}function zv(t,e){return!ge(t)&&A(t,"bpmn:BoundaryEvent")&&!e}function Qu(t,e,n){function i(r,o,a){var c,l,u,p,d,y,f,v,g=o.waypoints,b=r.outgoing.slice(),E=r.incoming.slice(),S=Su(g,v=ht(a.width)?vt(a):a);if(S){if(c=g.slice(0,S.index),l=g.slice(S.index+(S.bendpoint?1:0)),!c.length||!l.length)return;u=S.bendpoint?g[S.index]:v,c.length!==1&&$v(r,c[c.length-1])||c.push(Gv(u)),l.length!==1&&$v(r,l[0])||l.unshift(Gv(u))}p=o.source,d=o.target,e.canConnect(p,r,o)&&(n.reconnectEnd(o,r,c||v),y=o),e.canConnect(r,d,o)&&(y?f=n.connect(r,d,{type:o.type,waypoints:l}):(n.reconnectStart(o,r,l||v),f=o));var w=[].concat(y&&mt(E,function(C){return C.source===y.source})||[],f&&mt(b,function(C){return C.target===f.target})||[]);w.length&&n.removeElements(w)}Q.call(this,t),this.preExecute("elements.move",function(r){var o=r.newParent,a=r.shapes,c=r.delta,l=a[0];if(l&&o){o&&o.waypoints&&(r.newParent=o=o.parent);var u=vt(l),p={x:u.x+c.x,y:u.y+c.y},d=kt(o.children,function(y){return e.canInsert(a,y)&&Su(y.waypoints,p)});d&&(r.targetFlow=d,r.position=p)}},!0),this.postExecuted("elements.move",function(r){var o=r.shapes,a=r.targetFlow,c=r.position;a&&i(o[0],a,c)},!0),this.preExecute("shape.create",function(r){var o=r.parent,a=r.shape;e.canInsert(a,o)&&(r.targetFlow=o,r.parent=o.parent)},!0),this.postExecuted("shape.create",function(r){var o=r.shape,a=r.targetFlow,c=r.position;a&&i(o,a,c)},!0)}function $v(t,e){var n=e.x,i=e.y;return n>=t.x&&n<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function Gv(t){return z({},t)}function tp(t,e){Q.call(this,t),this.preExecuted("connection.create",function(n){var i=n.context,r=i.source,o=i.target,a=o.incoming.slice();i.hints&&i.hints.createElementsBehavior===!1||A(r,"bpmn:EventBasedGateway")&&o.incoming.length&&a.filter(ep).forEach(function(c){e.removeConnection(c)})}),this.preExecuted("shape.replace",function(n){var i=n.context.newShape;A(i,"bpmn:EventBasedGateway")&&i.outgoing.filter(ep).map(function(r){return r.target}).reduce(function(r,o){var a=o.incoming.filter(ep);return r.concat(a)},[]).forEach(function(r){r.source!==i&&e.removeConnection(r)})})}function ep(t){return A(t,"bpmn:SequenceFlow")}Xs.$inject=["bpmnReplace","injector"],rt(Xs,Q),Xs.prototype.replaceShape=function(t){var e,n,i=(n=et(t).eventDefinitions)&&n[0];return e=i?{type:"bpmn:IntermediateCatchEvent",eventDefinitionType:i.$type}:{type:"bpmn:IntermediateThrowEvent"},this._bpmnReplace.replaceElement(t,e,{layoutConnection:!1})},rt(Qu,Q),Qu.$inject=["eventBus","bpmnRules","modeling"],tp.$inject=["eventBus","modeling"],rt(tp,Q);function np(t,e,n,i,r,o){function a(){return et(e.getRootElement()).$parent}function c(l){var u=et(l).categoryValueRef;if(u){var p=u.$parent;u&&(Wt(p.categoryValue,u),p&&!p.categoryValue.length&&function(d){Wt(a().get("rootElements"),d)}(p))}}r.invoke(Q,this),this.executed("shape.delete",function(l){var u,p=l.context.shape;if(A(p,"bpmn:Group")){var d=et(p).categoryValueRef,y=n.filter(function(f){return A(f,"bpmn:Group")});u=d,y.some(function(f){var v=et(f);return v.categoryValueRef&&v.categoryValueRef===u})||c(p)}}),this.reverted("shape.delete",function(l){var u=l.context.shape;if(A(u,"bpmn:Group")){var p=et(u).categoryValueRef,d=a(),y=p?p.$parent:null;Xt(y.get("categoryValue"),p),Xt(d.get("rootElements"),y)}}),this.execute("shape.create",function(l){var u=et(l.context.shape);if(A(u,"bpmn:Group")&&!u.categoryValueRef){var p=Vu(a(),t);u.categoryValueRef=p}}),this.revert("shape.create",function(l){var u=l.context.shape;A(u,"bpmn:Group")&&(c(u),delete et(u).categoryValueRef)}),i.on("moddleCopy.canCopyProperty",2e3,function(l){var u,p=l.property;if(A(p,"bpmn:CategoryValue"))return u=Vu(a(),t),o.copyElement(p,u)})}function ip(t,e,n,i){var r,o,a,c;return(r=(i.y-n.y)*(e.x-t.x)-(i.x-n.x)*(e.y-t.y))==0?null:(o=t.y-n.y,a=t.x-n.x,c=((i.x-n.x)*o-(i.y-n.y)*a)/r,{x:Math.round(t.x+c*(e.x-t.x)),y:Math.round(t.y+c*(e.y-t.y))})}function Uv(t){function e(n,i,r){var o,a={x:r.x,y:r.y-50},c={x:r.x-50,y:r.y},l=ip(n,i,r,a),u=ip(n,i,r,c);o=l&&u?Hv(l,r)>Hv(u,r)?u:l:l||u,n.original=o}t.on("bpmnElement.added",function(n){var i,r,o=n.element;o.waypoints&&(e((r=(i=o).waypoints)[0],r[1],vt(i.source)),e(r[r.length-1],r[r.length-2],vt(i.target)))})}function Hv(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function rp(t){Q.call(this,t);var e=["bpmn:Participant","bpmn:Lane"];this.executed(["shape.move","shape.create","shape.resize"],function(n){var i=et(n.context.shape);wt(i,e)&&!i.di.get("isHorizontal")&&i.di.set("isHorizontal",!0)})}function qv(t){return Math.sqrt(Math.pow(t.x,2)+Math.pow(t.y,2))}function Wv(t){return Math.atan((t[1].y-t[0].y)/(t[1].x-t[0].x))}function Xv(t,e){var n=e[0],i=e[1],r={x:i.x-n.x,y:i.y-n.y},o=function(a,c,l){var u=[{n:a[0]-l[0],lambda:c[0]},{n:a[1]-l[1],lambda:c[1]}];return-(u[0].n*c[0]+u[1].n*c[1])/(u[0].lambda*c[0]+u[1].lambda*c[1])}([n.x,n.y],[r.x,r.y],[t.x,t.y]);return{x:n.x+o*r.x,y:n.y+o*r.y}}function KE(t,e){var n=Xv(t,e);return qv({x:n.x-t.x,y:n.y-t.y})}function Ks(t,e){return qv({x:t.x-e.x,y:t.y-e.y})}np.$inject=["bpmnFactory","canvas","elementRegistry","eventBus","injector","moddleCopy"],rt(np,Q),Uv.$inject=["eventBus"],rp.$inject=["eventBus"],rt(rp,Q);var Kv=Math.sqrt,Yv=Math.min,YE=Math.max,Jv=Math.abs;function Zv(t){return Math.pow(t,2)}function Qo(t,e){return Kv(Zv(t.x-e.x)+Zv(t.y-e.y))}function JE(t,e,n,i){var r=e.x-t.x,o=e.y-t.y,a=n.x-t.x,c=n.y-t.y,l=r*r+o*o,u=(r*a+o*c)/l,p=u*u-(a*a+c*c-i*i)/l;if(p<0&&p>-1e-6&&(p=0),p<0)return[];var d=Kv(p),y=-u+d,f=-u-d,v={x:t.x-r*y,y:t.y-o*y};return p===0?[v]:[v,{x:t.x-r*f,y:t.y-o*f}].filter(function(g){return function(b,E,S){return Qv(b.x,E.x,S.x)&&Qv(b.y,E.y,S.y)}(g,t,e)})}function Qv(t,e,n){return t>=Yv(e,n)-Ys&&t<=YE(e,n)+Ys}var Ys=.1;function ty(t,e){return Jv(t.x-e.x)<=Ys&&Jv(t.y-e.y)<=Ys}function ZE(t,e,n,i){var r=0,o=0,a=function(T){return{x:T.x+T.width/2,y:T.y+T.height/2}}(t),c=function(T,M){var I,$,P,x,N,j,G,W,tt,it,at,H,q=0;for(q=0;q<M.length-1;q++){if(ty(I=M[q],$=M[q+1])?j=[I]:(P=Qo(T,I),x=Qo(T,$),j=JE(I,$,T,Yv(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:ty(I,j[0])?q:q+1}),j.length===2&&(at=j[0],H=j[1],G={type:"segment",position:N={x:(at.x+H.x)/2,y:(at.y+H.y)/2},segmentIndex:q,relativeLocation:Qo(I,N)/Qo(I,$)}),W=Qo(G.position,T),(!it||tt>W)&&(it=G,tt=W)}return it}(a,n),l=c.segmentIndex,u=function(T,M,I,$){var P=I.segmentIndex,x=M.length-T.length;if($.segmentMove){var N=$.segmentMove.segmentStartIndex,j=$.segmentMove.newSegmentStartIndex;return P===N?j:P>=j?P+x<j?j:P+x:P}if($.bendpointMove){var G,W=$.bendpointMove.insert,tt=$.bendpointMove.bendpointIndex;return x===0?P:(P>=tt&&(G=W?P+1:P-1),P<tt&&(G=P,W&&I.type!=="bendpoint"&&tt-1===P&&ey(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=ny(n,l),f=ny(e,u),v=c.position,g=function(T,M){var I=Ks(T[0],T[1]),$=Ks(T[0],M);return I===0?0:$/I}(y,v),b=(p=f,d=Wv(y),Wv(p)-d);if(c.type==="bendpoint"){var E=e.length-n.length,S=c.bendpointIndex,w=n[S];if(e.indexOf(w)!==-1)return{x:r,y:o};if(E===0){var C=e[S];return{x:C.x-c.position.x,y:C.y-c.position.y}}E<0&&S!==0&&S<n.length-1&&(g=ey(n,S))}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,_=(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 qi({x:r=h+_.x-a.x,y:o=m+_.y-a.y})}function ey(t,e){var n=Ks(t[e-1],t[e]);return n/(n+Ks(t[e],t[e+1]))}function ny(t,e){return[t[e],t[e+1]]}function ta(t,e,n){var i=Lo(e),r=Lo(n),o=Rn(t,i),a=o.x*(n.width/e.width),c=o.y*(n.height/e.height);return qi({x:r.x+a,y:r.y+c})}function iy(t,e,n){var i=Lo(t),r=Lo(e),o=Lo(n),a=Rn(t,i),c=Rn(i,r),l=function(f,v,g){var b=st(v),E=st(g);if(function(s,h){return function(m,_){return m.right!==_.right&&m.left!==_.left}(s,h)||function(m,_){return m.top!==_.top&&m.bottom!==_.bottom}(s,h)}(b,E))return null;var S,w,C,B=ye(v,f);if(B==="top")S={x:0,y:E.bottom-b.bottom};else if(B==="bottom")S={x:0,y:E.top-b.top};else if(B==="right")S={x:E.left-b.left,y:0};else{if(B!=="left")return null;S={x:E.right-b.right,y:0}}return w={x:f.x+S.x,y:f.y+S.y},C=ye(g,w),C!==B?null:S}(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 qi({x:d+a.x-t.x,y:y+a.y-t.y})}var QE={width:90,height:20},ry="name",oy="text";function op(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(ry in c&&e.updateLabel(a,c[ry]),oy in c&&A(a,"bpmn:TextAnnotation")){var l=i.getTextAnnotationBounds({x:a.x,y:a.y,width:a.width,height:a.height},c[oy]||"");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)&&$r(a)&&mn(a)){var l=fs(a),u=i.getExternalLabelBounds(QE,mn(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),ZE(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&&$r(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(ms(c)){var p=c.label,d=t_(function(y,f){if(f.length){var v=function(g,b){var E=b.map(function(S){return{line:S,distance:KE(g,S)}});return Ke(E,"distance")[0].line}(y,f);return Xv(y,v)}}(vt(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 t_(t,e,n){return qi(Rn(ta(t,e,n),t))}function Js(t,e,n){var i=Qs(t),r=sy(i,e),o=i[0];return r.length?r[r.length-1]:ta(o.original||o,n,e)}function Zs(t,e,n){var i=Qs(t),r=sy(i,e),o=i[i.length-1];return r.length?r[0]:ta(o.original||o,n,e)}function ap(t,e,n){var i=Qs(t),r=ay(e,n),o=i[0];return ta(o.original||o,r,e)}function sp(t,e,n){var i=Qs(t),r=ay(e,n),o=i[i.length-1];return ta(o.original||o,r,e)}function ay(t,e){return{x:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height}}function Qs(t){var e=t.waypoints;if(!e.length)throw new Error("connection#"+t.id+": no waypoints");return e}function sy(t,e){return mt(ae(t,e_),function(n){return function(i,r){return ye(r,i,1)==="intersect"}(n,e)})}function e_(t){return t.original||t}function cp(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")&&Pt(p)&&A(d,"bpmn:Participant")&&!Pt(d)}(i,r)){var o,a,c,l,u=(a=Wa([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=Zs(p,r,i);e.reconnectEnd(p,r,d)}),u.outgoing.forEach(function(p){var d=Js(p,r,i);e.reconnectStart(p,r,d)})}},!0)}rt(op,Q),op.$inject=["eventBus","modeling","bpmnFactory","textRenderer"],cp.$inject=["eventBus","modeling"],rt(cp,Q);function cy(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 lp(t,e,n,i){Q.call(this,t);var r=i.get("dragging",!1);function o(a){var c,l,u=a.source,p=a.target;a.parent&&(A(a,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(u,p)||(l=!0),n.canConnectMessageFlow(u,p)&&(c="bpmn:MessageFlow")),A(a,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(u,p)||(l=!0),n.canConnectSequenceFlow(u,p)&&(c="bpmn:SequenceFlow")),A(a,"bpmn:Association")&&!n.canConnectAssociation(u,p)&&(l=!0),l&&e.removeConnection(a),c&&e.connect(u,p,{type:c,waypoints:a.waypoints.slice()}))}this.postExecuted("elements.move",function(a){L(a.closure.allConnections,o)},!0),this.preExecute("connection.reconnect",function(a){var c,l,u=a.context,p=u.connection,d=u.newSource||p.source,y=u.newTarget||p.target;(c=n.canConnect(d,y))&&c.type!==p.type&&(l=e.connect(d,y,{type:c.type,waypoints:p.waypoints.slice()}),e.removeConnection(p),u.connection=l,r&&function(f,v){var g,b=r.context(),E=b&&b.payload.previousSelection;!E||!E.length||(g=E.indexOf(f),g!==-1&&E.splice(g,1,v))}(p,l))}),this.postExecuted("element.updateProperties",function(a){var c,l=a.context,u=l.properties,p=l.element,d=p.businessObject;u.default&&(c=kt(p.outgoing,Ye({id:p.businessObject.default.id})))&&e.updateProperties(c,{conditionExpression:void 0}),u.conditionExpression&&d.sourceRef.default===d&&e.updateProperties(p.source,{default:void 0})})}function up(t,e){Q.call(this,t),this.preExecute("shape.delete",function(n){var i=n.shape,r=i.parent;A(i,"bpmn:Participant")&&(n.collaborationRoot=r)},!0),this.postExecute("shape.delete",function(n){var i=n.collaborationRoot;i&&!i.businessObject.participants.length&&e.makeProcess()},!0)}function tc(t,e,n,i,r,o){i.invoke(Q,this),this._bpmnReplace=t,this._elementRegistry=n,this._selection=o,this.postExecuted(["elements.create"],500,function(a){var c=a.context,l=c.parent,u=c.elements,p=e.canReplace(u,l);p&&this.replaceElements(u,p.replacements)},this),this.postExecuted(["elements.move"],500,function(a){var c=a.context,l=c.newParent,u=c.newHost,p=[];L(c.closure.topLevel,function(y){p=je(y)?p.concat(y.children):p.concat(y)}),p.length===1&&u&&(l=u);var d=e.canReplace(p,l);d&&this.replaceElements(p,d.replacements,u)},this),this.postExecute(["shape.replace"],1500,function(a){var c,l=a.context,u=l.oldShape,p=l.newShape,d=u.attachers;d&&d.length&&(c=e.canReplace(d,p),this.replaceElements(d,c.replacements))},this),this.postExecuted(["shape.replace"],1500,function(a){var c=a.context,l=c.oldShape,u=c.newShape;r.unclaimId(l.businessObject.id,l.businessObject),r.updateProperties(u,{id:l.id})})}cy.$inject=["eventBus","tooltips","translate"],rt(lp,Q),lp.$inject=["eventBus","modeling","bpmnRules","injector"],up.$inject=["eventBus","modeling"],rt(up,Q),rt(tc,Q),tc.prototype.replaceElements=function(t,e){var n=this._elementRegistry,i=this._bpmnReplace,r=this._selection;L(e,function(o){var a={type:o.newElementType},c=n.get(o.oldElementId),l=t.indexOf(c);t[l]=i.replaceElement(c,a,{select:!1})}),e&&r.select(t)},tc.$inject=["bpmnReplace","bpmnRules","elementRegistry","injector","modeling","selection"];var ly=300,ea=60,na={width:300,height:150},uy={width:140,height:120},py={width:50,height:30};function hy(t){t.on("resize.start",1500,function(e){var n=e.context,i=n.shape,r=n.direction,o=n.balanced;(A(i,"bpmn:Lane")||A(i,"bpmn:Participant"))&&(n.resizeConstraints=function(a,c,l){var u=gn(a),p=!0,d=!0,y=Ls(u,[u]),f=st(a),v={},g={};return/e/.test(c)?g.right=f.left+ly:/w/.test(c)&&(g.left=f.right-ly),y.forEach(function(b){var E=st(b);/n/.test(c)&&(E.top<f.top-10&&(p=!1),l&&ec(f.top-E.bottom)<10&&ic(v,"top",E.top+ea),ec(f.top-E.top)<5&&nc(g,"top",E.bottom-ea)),/s/.test(c)&&(E.bottom>f.bottom+10&&(d=!1),l&&ec(f.bottom-E.top)<10&&nc(v,"bottom",E.bottom-ea),ec(f.bottom-E.bottom)<5&&ic(g,"bottom",E.top+ea))}),u.children.filter(function(b){return!b.hidden&&!b.waypoints&&(A(b,"bpmn:FlowElement")||A(b,"bpmn:Artifact"))}).forEach(function(b){var E=st(b);p&&/n/.test(c)&&nc(g,"top",E.top-a_),/e/.test(c)&&ic(g,"right",E.right+r_),d&&/s/.test(c)&&ic(g,"bottom",E.bottom+s_),/w/.test(c)&&nc(g,"left",E.left-o_)}),{min:g,max:v}}(i,r,o)),A(i,"bpmn:Participant")&&(n.minDimensions=na),A(i,"bpmn:SubProcess")&&Pt(i)&&(n.minDimensions=uy),A(i,"bpmn:TextAnnotation")&&(n.minDimensions=py)})}hy.$inject=["eventBus"];var ec=Math.abs,n_=Math.min,i_=Math.max;function dy(t,e,n,i){var r=t[e];t[e]=r===void 0?n:i(n,r)}function nc(t,e,n){return dy(t,e,n,n_)}function ic(t,e,n){return dy(t,e,n,i_)}var r_=20,o_=50,a_=20,s_=20;function my(t,e){t.on("resize.start",1501,function(n){var i=n.context,r=i.shape;(A(r,"bpmn:Lane")||A(r,"bpmn:Participant"))&&(i.balanced=!Ur(n))}),t.on("resize.end",1001,function(n){var i=n.context,r=i.shape,o=i.canExecute,a=i.newBounds;if(A(r,"bpmn:Lane")||A(r,"bpmn:Participant"))return o&&(a=$d(a),e.resizeLane(r,a,i.balanced)),!1})}function pp(t,e,n){Q.call(this,t),this.preExecute("shape.delete",function(i){var r=i.context.shape;if(r.incoming.length===1&&r.outgoing.length===1){var o=r.incoming[0],a=r.outgoing[0];if(A(o,"bpmn:SequenceFlow")&&A(a,"bpmn:SequenceFlow")&&e.canConnect(o.source,a.target,o)){var c=function(l,u){var p=ip(Zr(l[l.length-2]),Zr(l[l.length-1]),Zr(u[1]),Zr(u[0]));return p?[].concat(l.slice(0,l.length-1),[p],u.slice(1)):[Zr(l[0]),Zr(u[u.length-1])]}(o.waypoints,a.waypoints);n.reconnectEnd(o,a.target,c)}}})}function Zr(t){return t.original||t}my.$inject=["eventBus","modeling"],rt(pp,Q),pp.$inject=["eventBus","bpmnRules","modeling"];var c_=Math.max;function fy(t){t.on("spaceTool.getMinDimensions",function(e){var n=e.shapes,i=e.axis,r=e.start,o={};return L(n,function(a){var c=a.id;A(a,"bpmn:Participant")&&(function(l){return l==="x"}(i)?o[c]=na:o[c]={width:na.width,height:l_(a,r)}),A(a,"bpmn:SubProcess")&&Pt(a)&&(o[c]=uy),A(a,"bpmn:TextAnnotation")&&(o[c]=py)}),o})}function l_(t,e){var n;return wi(t).length?(n=function(i,r){var o,a=wi(i);return o=vy(a,r),i.height-o.height+ea}(t,e),c_(na.height,n)):na.height}function vy(t,e){var n,i,r;for(n=0;n<t.length;n++)if(e>=(i=t[n]).y&&e<=i.y+i.height)return(r=wi(i)).length?vy(r,e):i}function hp(t,e){t.invoke(Q,this),this.postExecuted("shape.replace",function(n){var i=n.context.oldShape,r=n.context.newShape;if(A(r,"bpmn:SubProcess")&&A(i,"bpmn:Task")&&Pt(r)){var o,a={x:(o=r).x+o.width/6,y:o.y+o.height/2};e.createShape({type:"bpmn:StartEvent"},a,r)}})}fy.$inject=["eventBus"],hp.$inject=["injector","modeling"],rt(hp,Q);function dp(t,e,n,i){Q.call(this,t),this.executed(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape;A(a,"bpmn:SubProcess")&&(a.collapsed?et(a).di.isExpanded=!1:((o=a.children).length&&o.forEach(function(c){c.type!=="label"||c.businessObject.name||(c.hidden=!0)}),et(a).di.isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],500,function(r){var o=r.context.shape;o.collapsed?et(o).di.isExpanded=!1:et(o).di.isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],500,function(r){var o,a=r.context.shape,c=e._getDefaultSize(a);o=a.collapsed?function(l,u){return{x:l.x+(l.width-u.width)/2,y:l.y+(l.height-u.height)/2,width:u.width,height:u.height}}(a,c):function(l,u){var p,d,y=l.children,f=u;return(p=lv((d=y,d.filter(function(v){return!v.hidden})).concat([l])))?(f.width=Math.max(p.width,f.width),f.height=Math.max(p.height,f.height),f.x=p.x+(p.width-f.width)/2,f.y=p.y+(p.height-f.height)/2):(f.x=l.x+(l.width-f.width)/2,f.y=l.y+(l.height-f.height)/2),f}(a,c),n.resizeShape(a,o,null,{autoResize:!a.collapsed&&"nwse"})})}function mp(t,e,n,i){e.invoke(Q,this),this.preExecute("shape.delete",function(r){var o=r.context.shape,a=o.businessObject;ge(o)||(A(o,"bpmn:Participant")&&Pt(o)&&n.ids.unclaim(a.processRef.id),i.unclaimId(a.id,a))}),this.preExecute("connection.delete",function(r){var o=r.context.connection.businessObject;i.unclaimId(o.id,o)}),this.preExecute("canvas.updateRoot",function(){var r=t.getRootElement().businessObject;n.ids.unclaim(r.id)})}rt(dp,Q),dp.$inject=["eventBus","elementFactory","modeling"],rt(mp,Q),mp.$inject=["canvas","injector","moddle","modeling"];function fp(t,e,n){var i;function r(){if(!i)throw new Error(n("out of bounds release"));return i}Q.call(this,t);var o=["spaceTool","lane.add","lane.resize","lane.split","elements.create","elements.delete","elements.move","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(o,5e3,function(a){(i=i||new u_).enter()}),this.postExecuted(o,500,function(a){(function(){if(!i)throw new Error(n("out of bounds release"));var c=i.leave();c&&(e.updateLaneRefs(i.flowNodes,i.lanes),i=null)})()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(a){var c=a.context.shape,l=r();c.labelTarget||(A(c,"bpmn:Lane")&&l.addLane(c),A(c,"bpmn:FlowNode")&&l.addFlowNode(c))})}function u_(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(t){this.lanes.push(t)},this.addFlowNode=function(t){this.flowNodes.push(t)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}function vp(t,e){Q.call(this,t),this.preExecute("connection.delete",function(n){var i=n.context.connection,r=i.source;(function(o,a){if(!A(o,"bpmn:SequenceFlow"))return!1;var c=et(a),l=et(o);return c.get("default")===l})(i,r)&&e.updateProperties(r,{default:null})})}fp.$inject=["eventBus","modeling","translate"],rt(fp,Q),rt(vp,Q),vp.$inject=["eventBus","modeling"];const p_={__init__:["adaptiveLabelPositioningBehavior","appendBehavior","associationBehavior","attachEventBehavior","boundaryEventBehavior","rootElementReferenceBehavior","createBehavior","fixHoverBehavior","createDataObjectBehavior","createParticipantBehavior","dataStoreBehavior","dataInputAssociationBehavior","deleteLaneBehavior","detachEventBehavior","dropOnFlowBehavior","eventBasedGatewayBehavior","groupBehavior","importDockingFix","isHorizontalFix","labelBehavior","messageFlowBehavior","modelingFeedback","removeElementBehavior","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeBehavior","resizeLaneBehavior","toggleElementCollapseBehaviour","spaceToolBehavior","subProcessStartEventBehavior","unclaimIdBehavior","unsetDefaultFlowBehavior","updateFlowNodeRefsBehavior"],adaptiveLabelPositioningBehavior:["type",$u],appendBehavior:["type",Gu],associationBehavior:["type",Uu],attachEventBehavior:["type",Gs],boundaryEventBehavior:["type",Hu],rootElementReferenceBehavior:["type",qu],createBehavior:["type",Wu],fixHoverBehavior:["type",Ov],createDataObjectBehavior:["type",Xu],createParticipantBehavior:["type",Ku],dataInputAssociationBehavior:["type",Yu],dataStoreBehavior:["type",Ju],deleteLaneBehavior:["type",Zu],detachEventBehavior:["type",Xs],dropOnFlowBehavior:["type",Qu],eventBasedGatewayBehavior:["type",tp],groupBehavior:["type",np],importDockingFix:["type",Uv],isHorizontalFix:["type",rp],labelBehavior:["type",op],messageFlowBehavior:["type",cp],modelingFeedback:["type",cy],replaceConnectionBehavior:["type",lp],removeParticipantBehavior:["type",up],replaceElementBehaviour:["type",tc],resizeBehavior:["type",hy],resizeLaneBehavior:["type",my],removeElementBehavior:["type",pp],toggleElementCollapseBehaviour:["type",dp],spaceToolBehavior:["type",fy],subProcessStartEventBehavior:["type",hp],unclaimIdBehavior:["type",mp],updateFlowNodeRefsBehavior:["type",fp],unsetDefaultFlowBehavior:["type",vp]};function yy(t,e){var n=ye(t,e,-15);return n!=="intersect"?n:null}function be(t){_i.call(this,t)}function yp(t){return!t||ge(t)}function gy(t){do{if(A(t,"bpmn:Process"))return et(t);if(A(t,"bpmn:Participant"))return et(t).processRef||et(t)}while(t=t.parent)}function gp(t){return A(t,"bpmn:TextAnnotation")}function bp(t){return A(t,"bpmn:Group")&&!t.labelTarget}function xp(t){return A(t,"bpmn:BoundaryEvent")&&Dn(t,"bpmn:CompensateEventDefinition")}function Qr(t){return et(t).isForCompensation}function by(t){for(var e=t;e=e.parent;){if(A(e,"bpmn:FlowElementsContainer"))return et(e);if(A(e,"bpmn:Participant"))return et(e).processRef}return null}function Dn(t,e){return!!kt(et(t).eventDefinitions||[],function(n){return A(n,e)})}function xy(t,e){return(et(t).eventDefinitions||[]).every(function(n){return A(n,e)})}function Ey(t){return A(t,"bpmn:ReceiveTask")||A(t,"bpmn:IntermediateCatchEvent")&&(Dn(t,"bpmn:MessageEventDefinition")||Dn(t,"bpmn:TimerEventDefinition")||Dn(t,"bpmn:ConditionalEventDefinition")||Dn(t,"bpmn:SignalEventDefinition"))}function rc(t){return t.waypoints}function Ep(t,e){var n=function(i){for(var r=[];i;)(i=i.parent)&&r.push(i);return r}(e);return n.indexOf(t)!==-1}function oc(t,e,n){if(yp(t)||yp(e))return null;if(!A(n,"bpmn:DataAssociation")){if(Py(t,e))return{type:"bpmn:MessageFlow"};if(My(t,e))return{type:"bpmn:SequenceFlow"}}var i=wp(t,e);return i||(xp(t)&&Qr(e)?{type:"bpmn:Association",associationDirection:"One"}:!!ky(t,e)&&{type:"bpmn:Association"})}function to(t,e,n){return!(!ge(t)&&!bp(t))||!(A(e,"bpmn:Participant")&&!Pt(e))&&(A(t,"bpmn:Participant")?A(e,"bpmn:Process")||A(e,"bpmn:Collaboration"):wt(t,["bpmn:DataInput","bpmn:DataOutput"])&&t.parent?e===t.parent:A(t,"bpmn:Lane")?A(e,"bpmn:Participant")||A(e,"bpmn:Lane"):!(A(t,"bpmn:BoundaryEvent")&&!function(i){return et(i).cancelActivity&&(_y(i)||wy(i))}(t))&&(A(t,"bpmn:FlowElement")&&!A(t,"bpmn:DataStoreReference")?A(e,"bpmn:FlowElementsContainer")?Pt(e):wt(e,["bpmn:Participant","bpmn:Lane"]):A(t,"bpmn:DataStoreReference")&&A(e,"bpmn:Collaboration")?ui(et(e).get("participants"),function(i){return!!i.get("processRef")}):wt(t,["bpmn:Artifact","bpmn:DataAssociation","bpmn:DataStoreReference"])?wt(e,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]):!!A(t,"bpmn:MessageFlow")&&(A(e,"bpmn:Collaboration")||t.source.parent==e||t.target.parent==e)))}function h_(t){return A(t,"bpmn:Lane")}function d_(t){return!!function(e){return!ge(e)&&A(e,"bpmn:BoundaryEvent")}(t)||!(!A(t,"bpmn:IntermediateThrowEvent")||!_y(t))||A(t,"bpmn:IntermediateCatchEvent")&&wy(t)}function _y(t){var e=et(t);return e&&!(e.eventDefinitions&&e.eventDefinitions.length)}function wy(t){return Sy(t,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])}function Sy(t,e){return e.some(function(n){return Dn(t,n)})}function ia(t,e,n,i){if(Array.isArray(t)||(t=[t]),t.length!==1)return!1;var r=t[0];return!ge(r)&&!!d_(r)&&!je(e)&&!(!A(e,"bpmn:Activity")||Qr(e))&&!(i&&!yy(i,e))&&!function(o){return A(o,"bpmn:ReceiveTask")&&kt(o.incoming,function(a){return A(a.source,"bpmn:EventBasedGateway")})}(e)&&"attach"}function Cy(t,e,n){if(!e)return!1;var i={replacements:[]};return L(t,function(r){je(e)||A(r,"bpmn:StartEvent")&&r.type!=="label"&&to(r,e)&&(function(o){return o&&et(o).isInterrupting!==!1}(r)||i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),(function(o){return ps(o,"bpmn:ErrorEventDefinition")}(r)||function(o){return ps(o,"bpmn:EscalationEventDefinition")}(r)||function(o){return ps(o,"bpmn:CompensateEventDefinition")}(r))&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"}),Sy(r,["bpmn:MessageEventDefinition","bpmn:TimerEventDefinition","bpmn:SignalEventDefinition","bpmn:ConditionalEventDefinition"])&&A(e,"bpmn:SubProcess")&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:StartEvent"})),A(e,"bpmn:Transaction")||Dn(r,"bpmn:CancelEventDefinition")&&r.type!=="label"&&(A(r,"bpmn:EndEvent")&&to(r,e)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:EndEvent"}),A(r,"bpmn:BoundaryEvent")&&ia(r,e,0,n)&&i.replacements.push({oldElementId:r.id,newElementType:"bpmn:BoundaryEvent"}))}),!!i.replacements.length&&i}function Ty(t,e){return!ui(t,h_)&&(!e||t.every(function(n){return to(n,e)}))}function _p(t,e,n,i){return!!e&&(!(!ge(t)&&!bp(t))||n!==e&&(!n||!Ep(n,e))&&(to(t,e)||ac(t,e)))}function Ay(t,e){return A(t,"bpmn:SubProcess")?Pt(t)&&(!e||e.width>=100&&e.height>=80):A(t,"bpmn:Lane")?!e||e.width>=130&&e.height>=60:A(t,"bpmn:Participant")?!e||e.width>=250&&e.height>=50:!!gp(t)||!!bp(t)}function ky(t,e){return!rc(t)&&!rc(e)&&(!(!xp(t)||!Qr(e))||!Ep(e,t)&&!Ep(t,e)&&(!!function(n,i){var r=gp(n),o=gp(i);return(r||o)&&r!==o}(t,e)||!!wp(t,e)))}function Py(t,e){return!(Ny(t)&&!Ny(e))&&A(i=t,"bpmn:InteractionNode")&&!A(i,"bpmn:BoundaryEvent")&&(!A(i,"bpmn:Event")||A(i,"bpmn:ThrowEvent")&&xy(i,"bpmn:MessageEventDefinition"))&&function(r){return A(r,"bpmn:InteractionNode")&&!Qr(r)&&(!A(r,"bpmn:Event")||A(r,"bpmn:CatchEvent")&&xy(r,"bpmn:MessageEventDefinition"))&&!(A(r,"bpmn:BoundaryEvent")&&!Dn(r,"bpmn:MessageEventDefinition"))}(e)&&(n=e,gy(t)!==gy(n));var n,i}function My(t,e){return!(Ey(e)&&e.incoming.length>0&&(n=e.incoming,(n=n||[]).some(m_))&&!A(t,"bpmn:EventBasedGateway"))&&A(r=t,"bpmn:FlowNode")&&!A(r,"bpmn:EndEvent")&&!je(r)&&!(A(r,"bpmn:IntermediateThrowEvent")&&Dn(r,"bpmn:LinkEventDefinition"))&&!xp(r)&&!Qr(r)&&function(o){return A(o,"bpmn:FlowNode")&&!A(o,"bpmn:StartEvent")&&!A(o,"bpmn:BoundaryEvent")&&!je(o)&&!(A(o,"bpmn:IntermediateCatchEvent")&&Dn(o,"bpmn:LinkEventDefinition"))&&!Qr(o)}(e)&&(i=e,by(t)===by(i))&&!(A(t,"bpmn:EventBasedGateway")&&!Ey(e));var n,i,r}function wp(t,e){return wt(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&wt(e,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!wt(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!wt(t,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function ac(t,e,n){if(!e)return!1;if(Array.isArray(t)){if(t.length!==1)return!1;t=t[0]}return e.source!==t&&e.target!==t&&wt(e,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!ge(e)&&A(t,"bpmn:FlowNode")&&!A(t,"bpmn:BoundaryEvent")&&to(t,e.parent)}function Ry(t,e){return!!ge(e)||!(A(e,"bpmn:Lane")&&!function(n,i){return n&&i&&n.indexOf(i)!==-1}(t,e.parent))}function m_(t){if(t&&t.source)return A(t.source,"bpmn:EventBasedGateway")}function Ny(t){return _s(t,"bpmn:Process")||_s(t,"bpmn:Collaboration")}rt(be,_i),be.$inject=["eventBus"],be.prototype.init=function(){this.addRule("connection.start",function(t){return function(e){return yp(e)?null:wt(e,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference","bpmn:Group","bpmn:TextAnnotation"])}(t.source)}),this.addRule("connection.create",function(t){var e=t.source,n=t.target,i=t.hints||{},r=i.targetParent;if(i.targetAttach)return!1;r&&(n.parent=r);try{return oc(e,n)}finally{r&&(n.parent=null)}}),this.addRule("connection.reconnect",function(t){var e=t.connection;return oc(t.source,t.target,e)}),this.addRule("connection.updateWaypoints",function(t){return{type:t.connection.type}}),this.addRule("shape.resize",function(t){return Ay(t.shape,t.newBounds)}),this.addRule("elements.create",function(t){var e=t.elements,n=t.position,i=t.target;return!(rc(i)&&!ac(e,i))&&$i(e,function(r){return rc(r)?oc(r.source,r.target,r):r.host?ia(r,r.host,null,n):_p(r,i,null)})}),this.addRule("elements.move",function(t){var e=t.target,n=t.shapes,i=t.position;return ia(n,e,null,i)||Cy(n,e,i)||Ty(n,e)||ac(n,e)}),this.addRule("shape.create",function(t){return _p(t.shape,t.target,t.source,t.position)}),this.addRule("shape.attach",function(t){return ia(t.shape,t.target,null,t.position)}),this.addRule("element.copy",function(t){var e=t.element;return Ry(t.elements,e)})},be.prototype.canConnectMessageFlow=Py,be.prototype.canConnectSequenceFlow=My,be.prototype.canConnectDataAssociation=wp,be.prototype.canConnectAssociation=ky,be.prototype.canMove=Ty,be.prototype.canAttach=ia,be.prototype.canReplace=Cy,be.prototype.canDrop=to,be.prototype.canInsert=ac,be.prototype.canCreate=_p,be.prototype.canConnect=oc,be.prototype.canResize=Ay,be.prototype.canCopy=Ry;const f_={__depends__:[In],__init__:["bpmnRules"],bpmnRules:["type",be]};function Iy(t,e){t.on("saveXML.start",2e3,function(){var n,i,r=e.getRootElement(),o=et(r).di;n=mt(n=Wa([r],!1),function(a){return a!==r&&!a.labelTarget}),i=ae(n,Fr),o.set("planeElement",i)})}Iy.$inject=["eventBus","canvas"];const v_={__init__:["bpmnDiOrdering"],bpmnDiOrdering:["type",Iy]};function sc(t){Q.call(this,t);var e=this;this.preExecute(["shape.create","connection.create"],function(n){var i=n.context,r=i.shape||i.connection,o=i.parent,a=e.getOrdering(r,o);a&&(a.parent!==void 0&&(i.parent=a.parent),i.parentIndex=a.index)}),this.preExecute(["shape.move","connection.move"],function(n){var i=n.context,r=i.shape||i.connection,o=i.newParent||r.parent,a=e.getOrdering(r,o);a&&(a.parent!==void 0&&(i.newParent=a.parent),i.newParentIndex=a.index)})}function Sp(t,e,n){sc.call(this,t);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:3,containers:["bpmn:Participant","bpmn:FlowElementsContainer"]}},{type:"bpmn:DataAssociation",order:{level:9,containers:["bpmn:Collaboration","bpmn:Process"]}},{type:"bpmn:MessageFlow",order:{level:9,containers:["bpmn:Collaboration"]}},{type:"bpmn:Association",order:{level:6,containers:["bpmn:Participant","bpmn:FlowElementsContainer","bpmn:Collaboration"]}},{type:"bpmn:BoundaryEvent",order:{level:8}},{type:"bpmn:Group",order:{level:10,containers:["bpmn:Collaboration","bpmn:Process"]}},{type:"bpmn:FlowElement",order:{level:5}},{type:"bpmn:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];function r(o){var a=o.order;if(a||(o.order=a=function(c){if(c.labelTarget)return{level:10};var l=kt(i,function(u){return wt(c,[u.type])});return l&&l.order||{level:1}}(o)),!a)throw new Error("no order for <"+o.id+">");return a}this.getOrdering=function(o,a){if(o.labelTarget)return{parent:e.getRootElement(),index:-1};var c=r(o);c.containers&&(a=function(p,d,y){for(var f=d;f&&!wt(f,y);)f=f.parent;if(!f)throw new Error("no parent for <"+p.id+"> in <"+(d&&d.id)+">");return f}(o,a,c.containers));var l=a.children.indexOf(o),u=_l(a.children,function(p){return!(!o.labelTarget&&p.labelTarget)&&c.level<r(p).level});return u!==-1&&l!==-1&&l<u&&(u-=1),{index:u,parent:a}}}sc.prototype.getOrdering=function(t,e){return null},rt(sc,Q),Sp.$inject=["eventBus","canvas","translate"],rt(Sp,sc);const y_={__depends__:[ds],__init__:["bpmnOrderingProvider"],bpmnOrderingProvider:["type",Sp]};function Gt(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)}Gt.$inject=["eventBus","injector"],Gt.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)},Gt.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},Gt.prototype.clear=function(t){this._stack.length=0,this._stackIdx=-1,t!==!1&&this._fire("changed",{trigger:"clear"})},Gt.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()}},Gt.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()}},Gt.prototype.register=function(t,e){this._setHandler(t,e)},Gt.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)},Gt.prototype.canUndo=function(){return!!this._getUndoAction()},Gt.prototype.canRedo=function(){return!!this._getRedoAction()},Gt.prototype._getRedoAction=function(){return this._stack[this._stackIdx+1]},Gt.prototype._getUndoAction=function(){return this._stack[this._stackIdx]},Gt.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)})},Gt.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},Gt.prototype._createId=function(){return this._uid++},Gt.prototype._atomicDo=function(t){var e=this._currentExecution;e.atomic=!0;try{t()}finally{e.atomic=!1}},Gt.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)},Gt.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)},Gt.prototype._popAction=function(){var t=this._currentExecution,e=t.trigger,n=t.actions,i=t.dirty;n.pop(),n.length||(this._eventBus.fire("elements.changed",{elements:wl("id",i.reverse())}),i.length=0,this._fire("changed",{trigger:e}),t.trigger=null)},Gt.prototype._markDirty=function(t){var e=this._currentExecution;t&&(t=gt(t)?t:[t],e.dirty=e.dirty.concat(t))},Gt.prototype._executedAction=function(t,e){var n=++this._stackIdx;e||this._stack.splice(n,this._stack.length,t)},Gt.prototype._revertedAction=function(t){this._stackIdx--},Gt.prototype._getHandler=function(t){return this._handlerMap[t]},Gt.prototype._setHandler=function(t,e){if(!t||!e)throw new Error("command and handler required");if(this._handlerMap[t])throw new Error("overriding handler for command <"+t+">");this._handlerMap[t]=e};const g_={commandStack:["type",Gt]};var b_=new uu("tt");function Cp(t,e){t.style.display=e===!1?"none":""}var Dy="djs-tooltip",Tp="."+Dy;function Me(t,e){var n,i;this._eventBus=t,this._canvas=e,this._ids=b_,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=(n=e.getContainer(),i=Lt('<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,Tp,"mousedown",function(o){o.stopPropagation()}),$e.bind(this._tooltipRoot,Tp,"mouseover",function(o){r.trigger("mouseover",o)}),$e.bind(this._tooltipRoot,Tp,"mouseout",function(o){r.trigger("mouseout",o)}),this._init()}Me.$inject=["eventBus","canvas"],Me.prototype.add=function(t){if(!t.position)throw new Error("must specifiy tooltip position");if(!t.html)throw new Error("must specifiy tooltip html");var e=this._ids.next();return t=z({},this._tooltipDefaults,t,{id:e}),this._addTooltip(t),t.timeout&&this.setTimeout(t),e},Me.prototype.trigger=function(t,e){var n=e.delegateTarget||e.target,i=this.get(ze(n,"data-tooltip-id"));i&&(t==="mouseover"&&i.timeout&&this.clearTimeout(i),t==="mouseout"&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},Me.prototype.get=function(t){return typeof t!="string"&&(t=t.id),this._tooltips[t]},Me.prototype.clearTimeout=function(t){if(t=this.get(t)){var e=t.removeTimer;e&&(clearTimeout(e),t.removeTimer=null)}},Me.prototype.setTimeout=function(t){if(t=this.get(t)){this.clearTimeout(t);var e=this;t.removeTimer=setTimeout(function(){e.remove(t)},t.timeout)}},Me.prototype.remove=function(t){var e=this.get(t);e&&(Tn(e.html),Tn(e.htmlContainer),delete e.htmlContainer,delete this._tooltips[e.id])},Me.prototype.show=function(){Cp(this._tooltipRoot)},Me.prototype.hide=function(){Cp(this._tooltipRoot,!1)},Me.prototype._updateRoot=function(t){var e=t.scale||1,n=t.scale||1,i="matrix("+e+",0,0,"+n+","+-1*t.x*e+","+-1*t.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},Me.prototype._addTooltip=function(t){var e,n=t.id,i=t.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Ie(i)&&(i=Lt(i)),(e=Lt('<div data-tooltip-id="'+n+'" class="'+Dy+'" style="position: absolute">')).appendChild(i),t.type&&ne(e).add("djs-tooltip-"+t.type),t.className&&ne(e).add(t.className),t.htmlContainer=e,r.appendChild(e),this._tooltips[n]=t,this._updateTooltip(t)},Me.prototype._updateTooltip=function(t){var e,n,i,r=t.position,o=t.htmlContainer;e=o,n=r.x,i=r.y,z(e.style,{left:n+"px",top:i+"px"})},Me.prototype._updateTooltipVisibilty=function(t){L(this._tooltips,function(e){var n=e.show,i=e.htmlContainer,r=!0;n&&((n.minZoom>t.scale||n.maxZoom<t.scale)&&(r=!1),Cp(i,r))})},Me.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 x_={__init__:["tooltips"],tooltips:["type",Me]};function eo(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 Ap(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=By(a),o.validatedShapes=By(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;eo((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=Gl(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&&(Xt(c.labels,a,l),a.labelTarget=c)})}function By(t){return mt(t,function(e){return t.indexOf(e.labelTarget)===-1})}rt(Ap,Q),Ap.$inject=["injector","eventBus","modeling"];const E_={__init__:["labelSupport"],labelSupport:["type",Ap]};var Oy="attach-ok";function kp(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=Pp(c=p),sd("id",c,l)),u.validatedShapes=function(y){var f=Gi(y,"id");return mt(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(Pp(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,Oy),e.once(["shape.move.out","shape.move.cleanup"],function(){n.removeMarker(l,Oy)}))}}),this.preExecuted("elements.move",1401,function(a){var c=a.context,l=c.closure;L(Pp(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:mt(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;eo(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=iy(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=iy(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;eo(c.attachers,function(l){r.removeShape(l)}),c.host&&r.updateAttachment(c,null)})}function Pp(t){return yo(ae(t,function(e){return e.attachers||[]}))}rt(kp,Q),kp.$inject=["injector","eventBus","canvas","rules","modeling"];const __={__depends__:[In],__init__:["attachSupport"],attachSupport:["type",kp]};function nr(t,e){this._eventBus=t,this._dragging=e,this._tools=[],this._active=null}nr.$inject=["eventBus","dragging"],nr.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)},nr.prototype.isActive=function(t){return t&&this._active===t},nr.prototype.length=function(t){return this._tools.length},nr.prototype.setActive=function(t){var e=this._eventBus;this._active!==t&&(this._active=t,e.fire("tool-manager.update",{tool:t}))},nr.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&&Ui(c,'.group[data-group="tools"]')}(o)||this.setActive(null))},this)};const cc={__depends__:[Kn],__init__:["toolManager"],toolManager:["type",nr]};function ra(t,e){return t.indexOf(e)!==-1}var Mp=Math.abs,w_=Math.round,Zn={x:"width",y:"height"},Ly="crosshair",lc={n:"top",w:"left",s:"bottom",e:"right"},jy={n:"s",w:"e",s:"n",e:"w"};function Qn(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&&Fy(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){Fy(l);var g={x:0,y:0};g[p]=w_(l["d"+p]),c.makeSpace(y,f,g,d,v),n.once("spaceTool.ended",function(b){c.activateSelection(b.originalEvent,!0,!0)})}})}function Vy(t){return{top:t.top-20,right:t.right+20,bottom:t.bottom+20,left:t.left-20}}function Fy(t){var e,n,i=t.context.spaceToolConstraints;i&&(ht(i.left)&&(e=Math.max(t.x,i.left),t.dx=t.dx+e-t.x,t.x=e),ht(i.right)&&(e=Math.min(t.x,i.right),t.dx=t.dx+e-t.x,t.x=e),ht(i.top)&&(n=Math.max(t.y,i.top),t.dy=t.dy+n-t.y,t.y=n),ht(i.bottom)&&(n=Math.min(t.y,i.bottom),t.dy=t.dy+n-t.y,t.y=n))}function Rp(t,e){return t.indexOf(e)!==-1}function Np(t){return!!t.waypoints}function zy(t){return!!t.labelTarget}Qn.$inject=["canvas","dragging","eventBus","modeling","rules","toolManager","mouse"],Qn.prototype.activateSelection=function(t,e,n){this._dragging.init(t,"spaceTool.selection",{autoActivate:e,cursor:Ly,data:{context:{reactivate:n}},trapClick:!1})},Qn.prototype.activateMakeSpace=function(t){this._dragging.init(t,"spaceTool",{autoActivate:!0,cursor:Ly,data:{context:{}}})},Qn.prototype.makeSpace=function(t,e,n,i,r){return this._modeling.createSpace(t,e,n,i,r)},Qn.prototype.init=function(t,e){var n=Mp(t.dx)>Mp(t.dy)?"x":"y",i=t["d"+n],r=t[n]-i;if(Mp(i)<5)return!1;i<0&&(i*=-1),Ur(t)&&(i*=-1);var o=function(u,p){if(u==="x"){if(p>0)return"e";if(p<0)return"w"}if(u==="y"){if(p>0)return"s";if(p<0)return"n"}return null}(n,i),a=Wa(this._canvas.getRootElement(),!0),c=this.calculateAdjustments(a,n,i,r),l=function(u,p,d,y,f){var v=u.movingShapes,g=u.resizingShapes;if(g.length){var b,E,S={};return L(g,function(w){var C,B,s,h=st(w),m=mt(w.children,function(M){return!(Np(M)||zy(M)||Rp(v,M)||Rp(g,M))}),_=mt(w.children,function(M){return!Np(M)&&!zy(M)&&Rp(v,M)});m.length&&(B=Vy(st(ve(m))),C=y-h[lc[d]]+B[lc[d]],d==="n"?S.bottom=E=ht(E)?Math.min(E,C):C:d==="w"?S.right=E=ht(E)?Math.min(E,C):C:d==="s"?S.top=b=ht(b)?Math.max(b,C):C:d==="e"&&(S.left=b=ht(b)?Math.max(b,C):C)),_.length&&(s=Vy(st(ve(_))),C=y-s[lc[jy[d]]]+h[lc[jy[d]]],d==="n"?S.bottom=E=ht(E)?Math.min(E,C):C:d==="w"?S.right=E=ht(E)?Math.min(E,C):C:d==="s"?S.top=b=ht(b)?Math.max(b,C):C:d==="e"&&(S.left=b=ht(b)?Math.max(b,C):C));var T=f&&f[w.id];T&&(d==="n"?(C=y+w[Zn[p]]-T[Zn[p]],S.bottom=E=ht(E)?Math.min(E,C):C):d==="w"?(C=y+w[Zn[p]]-T[Zn[p]],S.right=E=ht(E)?Math.min(E,C):C):d==="s"?(C=y-w[Zn[p]]+T[Zn[p]],S.top=b=ht(b)?Math.max(b,C):C):d==="e"&&(C=y-w[Zn[p]]+T[Zn[p]],S.left=b=ht(b)?Math.max(b,C):C))}),S}}(c,n,o,r,this._eventBus.fire("spaceTool.getMinDimensions",{axis:n,direction:o,shapes:c.resizingShapes,start:r}));return z(e,c,{axis:n,direction:o,spaceToolConstraints:l,start:r}),xs("resize-"+(n==="x"?"ew":"ns")),!0},Qn.prototype.calculateAdjustments=function(t,e,n,i){var r=this._rules,o=[],a=[];return L(t,function(c){if(c.parent&&!Np(c)){var l=c[e],u=l+c[Zn[e]];return n>0&&l>i||n<0&&u<i?o.push(c):l<i&&u>i&&r.allowed("shape.resize",{shape:c})?a.push(c):void 0}}),{movingShapes:o,resizingShapes:a}},Qn.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();this.activateSelection(t,!!t)},Qn.prototype.isActive=function(){var t=this._dragging.context();return t&&/^spaceTool/.test(t.prefix)};var Ip="djs-dragging",$y="djs-resizing",uc=Math.max;function Gy(t,e,n,i,r){function o(a,c){L(a,function(l){r.addDragger(l,c),n.addMarker(l,Ip)})}t.on("spaceTool.selection.start",function(a){var c=n.getLayer("space"),l=a.context,u="M 0,-10000 L 0,10000",p="M -10000,0 L 10000,0",d=ot("g");K(d,i.cls("djs-crosshair-group",["no-events"])),lt(c,d);var y=ot("path");K(y,"d",u),bt(y).add("djs-crosshair"),lt(d,y);var f=ot("path");K(f,"d",p),bt(f).add("djs-crosshair"),lt(d,f),l.crosshairGroup=d}),t.on("spaceTool.selection.move",function(a){Oe(a.context.crosshairGroup,a.x,a.y)}),t.on("spaceTool.selection.cleanup",function(a){var c=a.context.crosshairGroup;c&&Zt(c)}),t.on("spaceTool.move",250,function(a){var c=a.context,l=c.line,u=c.axis,p=c.movingShapes,d=c.resizingShapes;if(c.initialized){if(!c.dragGroup){var y=n.getLayer("space");K(l=ot("path"),"d","M0,0 L0,0"),bt(l).add("djs-crosshair"),lt(y,l),c.line=l;var f=ot("g");K(f,i.cls("djs-drag-group",["no-events"])),lt(n.getActiveLayer(),f),o(p,f),o(c.movingConnections=e.filter(function(E){var S=!1;L(p,function(s){L(s.outgoing,function(h){E===h&&(S=!0)})});var w=!1;L(p,function(s){L(s.incoming,function(h){E===h&&(w=!0)})});var C=!1;L(d,function(s){L(s.outgoing,function(h){E===h&&(C=!0)})});var B=!1;return L(d,function(s){L(s.incoming,function(h){E===h&&(B=!0)})}),function(s){return s.waypoints}(E)&&(S||C)&&(w||B)}),f),c.dragGroup=f}if(!c.frameGroup){var v=ot("g");K(v,i.cls("djs-frame-group",["no-events"])),lt(n.getActiveLayer(),v);var g=[];L(d,function(E){var S=r.addFrame(E,v),w=S.getBBox();g.push({element:S,initialBounds:w}),n.addMarker(E,$y)}),c.frameGroup=v,c.frames=g}K(l,{d:{x:"M"+a.x+", -10000 L"+a.x+", 10000",y:"M -10000, "+a.y+" L 10000, "+a.y}[u]});var b={x:a.dx,y:a.dy};b[{x:"y",y:"x"}[c.axis]]=0,Oe(c.dragGroup,b.x,b.y),L(c.frames,function(E){var S,w,C=E.element,B=E.initialBounds;c.direction==="e"?K(C,{width:uc(B.width+b.x,5)}):K(C,{width:S=uc(B.width-b.x,5),x:B.x+B.width-S}),c.direction==="s"?K(C,{height:uc(B.height+b.y,5)}):K(C,{height:w=uc(B.height-b.y,5),y:B.y+B.height-w})})}}),t.on("spaceTool.cleanup",function(a){var c=a.context,l=c.movingShapes,u=c.movingConnections,p=c.resizingShapes,d=c.line,y=c.dragGroup,f=c.frameGroup;L(l,function(v){n.removeMarker(v,Ip)}),L(u,function(v){n.removeMarker(v,Ip)}),y&&(Zt(d),Zt(y)),L(p,function(v){n.removeMarker(v,$y)}),f&&Zt(f)})}Gy.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];const Uy={__init__:["spaceToolPreview"],__depends__:[Kn,In,cc,Go,qo],spaceTool:["type",Qn],spaceToolPreview:["type",Gy]};function an(t){this._model=t}function Ve(t,e,n,i){Q.call(this,t),this._bpmnFactory=e,this._translate=i;var r=this;function o(p){L(p.context.oldRoot.children,function(d){A(d,"bpmn:BaseElement")&&r.updateParent(d)})}function a(p){var d=p.context.shape;A(d,"bpmn:BaseElement")&&r.updateBounds(d)}function c(p){r.updateConnection(p.context)}function l(p){r.updateConnectionWaypoints(p.context.connection)}function u(p){r.updateAttachment(p.context)}this.executed(["connection.layout","connection.create"],function(p){var d,y=p.context,f=y.hints||{};y.cropped||f.createElementsBehavior===!1||((d=y.connection).waypoints=n.getCroppedWaypoints(d),y.cropped=!0)}),this.reverted(["connection.layout"],function(p){delete p.context.cropped}),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],sn(function(p){var d=p.context;r.updateParent(d.shape||d.connection,d.oldParent)})),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],sn(function(p){var d=p.context,y=d.shape||d.connection,f=d.parent||d.newParent;r.updateParent(y,f)})),this.executed(["canvas.updateRoot"],o),this.reverted(["canvas.updateRoot"],o),this.executed(["shape.move","shape.create","shape.resize"],sn(function(p){p.context.shape.type!=="label"&&a(p)})),this.reverted(["shape.move","shape.create","shape.resize"],sn(function(p){p.context.shape.type!=="label"&&a(p)})),t.on("shape.changed",function(p){p.element.type==="label"&&a({context:{shape:p.element}})}),this.executed(["connection.create","connection.move","connection.delete","connection.reconnect"],sn(c)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnect"],sn(c)),this.executed(["connection.layout","connection.move","connection.updateWaypoints"],sn(l)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints"],sn(l)),this.executed("connection.reconnect",sn(function(p){var d=p.context,y=d.connection,f=d.oldSource,v=d.newSource,g=et(y),b=et(f),E=et(v);g.conditionExpression&&!wt(E,["bpmn:Activity","bpmn:ExclusiveGateway","bpmn:InclusiveGateway"])&&(d.oldConditionExpression=g.conditionExpression,delete g.conditionExpression),f!==v&&b.default===g&&(d.oldDefault=b.default,delete b.default)})),this.reverted("connection.reconnect",sn(function(p){var d=p.context,y=d.connection,f=d.oldSource,v=d.newSource,g=et(y),b=et(f),E=et(v);d.oldConditionExpression&&(g.conditionExpression=d.oldConditionExpression),d.oldDefault&&(b.default=d.oldDefault,delete E.default)})),this.executed(["element.updateAttachment"],sn(u)),this.reverted(["element.updateAttachment"],sn(u))}function sn(t){return function(e){var n=e.context;A(n.shape||n.connection,"bpmn:BaseElement")&&t(e)}}function Ti(t,e,n){Un.call(this),this._bpmnFactory=t,this._moddle=e,this._translate=n}function Hy(t,e,n){t[n]=e[n],delete e[n]}function pc(t,e){this._modeling=t,this._canvas=e}function hc(t){this._modeling=t}function dc(t,e){this._canvas=t,this._layouter=e}an.$inject=["moddle"],an.prototype._needsId=function(t){return wt(t,["bpmn:RootElement","bpmn:FlowElement","bpmn:MessageFlow","bpmn:DataAssociation","bpmn:Artifact","bpmn:Participant","bpmn:Lane","bpmn:LaneSet","bpmn:Process","bpmn:Collaboration","bpmndi:BPMNShape","bpmndi:BPMNEdge","bpmndi:BPMNDiagram","bpmndi:BPMNPlane","bpmn:Property","bpmn:CategoryValue"])},an.prototype._ensureId=function(t){var e;e=A(t,"bpmn:Activity")?"Activity":A(t,"bpmn:Event")?"Event":A(t,"bpmn:Gateway")?"Gateway":wt(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])?"Flow":(t.$type||"").replace(/^[^:]*:/g,""),e+="_",!t.id&&this._needsId(t)&&(t.id=this._model.ids.nextPrefixed(e,t))},an.prototype.create=function(t,e){var n=this._model.create(t,e||{});return this._ensureId(n),n},an.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},an.prototype.createDiShape=function(t,e,n){return this.create("bpmndi:BPMNShape",z({bpmnElement:t,bounds:this.createDiBounds(e)},n))},an.prototype.createDiBounds=function(t){return this.create("dc:Bounds",t)},an.prototype.createDiWaypoints=function(t){var e=this;return ae(t,function(n){return e.createDiWaypoint(n)})},an.prototype.createDiWaypoint=function(t){return this.create("dc:Point",Je(t,["x","y"]))},an.prototype.createDiEdge=function(t,e,n){return this.create("bpmndi:BPMNEdge",z({bpmnElement:t,waypoint:this.createDiWaypoints(e)},n))},an.prototype.createDiPlane=function(t){return this.create("bpmndi:BPMNPlane",{bpmnElement:t})},rt(Ve,Q),Ve.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],Ve.prototype.updateAttachment=function(t){var e=t.shape,n=e.businessObject,i=e.host;n.attachedToRef=i&&i.businessObject},Ve.prototype.updateParent=function(t,e){if(!(t instanceof es||A(t,"bpmn:DataStoreReference")&&t.parent&&A(t.parent,"bpmn:Collaboration"))){var n=t.parent,i=t.businessObject,r=n&&n.businessObject,o=r&&r.di;A(t,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,r,e&&e.businessObject),A(t,"bpmn:DataOutputAssociation")&&(r=t.source?t.source.businessObject:null),A(t,"bpmn:DataInputAssociation")&&(r=t.target?t.target.businessObject:null),this.updateSemanticParent(i,r),A(t,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,r),this.updateDiParent(i.di,o)}},Ve.prototype.updateBounds=function(t){var e=t.businessObject.di,n=t instanceof es?this._getLabel(e):e,i=n.bounds;i||(i=this._bpmnFactory.createDiBounds(),n.set("bounds",i)),z(i,{x:t.x,y:t.y,width:t.width,height:t.height})},Ve.prototype.updateFlowNodeRefs=function(t,e,n){n!==e&&(A(n,"bpmn:Lane")&&Wt(n.get("flowNodeRef"),t),A(e,"bpmn:Lane")&&Xt(e.get("flowNodeRef"),t))},Ve.prototype.updateDiConnection=function(t,e,n){t.sourceElement&&t.sourceElement.bpmnElement!==e&&(t.sourceElement=e&&e.di),t.targetElement&&t.targetElement.bpmnElement!==n&&(t.targetElement=n&&n.di)},Ve.prototype.updateDiParent=function(t,e){if(e&&!A(e,"bpmndi:BPMNPlane")&&(e=e.$parent),t.$parent!==e){var n=(e||t.$parent).get("planeElement");e?(n.push(t),t.$parent=e):(Wt(n,t),t.$parent=null)}},Ve.prototype.getLaneSet=function(t){var e,n;return A(t,"bpmn:Lane")?((e=t.childLaneSet)||(e=this._bpmnFactory.create("bpmn:LaneSet"),t.childLaneSet=e,e.$parent=t),e):(A(t,"bpmn:Participant")&&(t=t.processRef),(e=(n=t.get("laneSets"))[0])||((e=this._bpmnFactory.create("bpmn:LaneSet")).$parent=t,n.push(e)),e)},Ve.prototype.updateSemanticParent=function(t,e,n){var i,r=this._translate;if(t.$parent!==e&&(!A(t,"bpmn:DataInput")&&!A(t,"bpmn:DataOutput")||(A(e,"bpmn:Participant")&&"processRef"in e&&(e=e.processRef),!("ioSpecification"in e)||e.ioSpecification!==t.$parent))){if(A(t,"bpmn:Lane"))e&&(e=this.getLaneSet(e)),i="lanes";else if(A(t,"bpmn:FlowElement")){if(e){if(A(e,"bpmn:Participant"))e=e.processRef;else if(A(e,"bpmn:Lane"))do e=e.$parent.$parent;while(A(e,"bpmn:Lane"))}i="flowElements"}else if(A(t,"bpmn:Artifact")){for(;e&&!A(e,"bpmn:Process")&&!A(e,"bpmn:SubProcess")&&!A(e,"bpmn:Collaboration");){if(A(e,"bpmn:Participant")){e=e.processRef;break}e=e.$parent}i="artifacts"}else if(A(t,"bpmn:MessageFlow"))i="messageFlows";else if(A(t,"bpmn:Participant")){i="participants";var o,a=t.processRef;a&&(o=function(u){for(;u&&!A(u,"bpmn:Definitions");)u=u.$parent;return u}(t.$parent||e),t.$parent&&(Wt(o.get("rootElements"),a),a.$parent=null),e&&(Xt(o.get("rootElements"),a),a.$parent=o))}else A(t,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":A(t,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:t.id,parent:e.id}));var c;if(t.$parent&&Wt(c=t.$parent.get(i),t),e?((c=e.get(i)).push(t),t.$parent=e):t.$parent=null,n){var l=n.get(i);Wt(c,t),e&&(l||(l=[],e.set(i,l)),l.push(t))}}},Ve.prototype.updateConnectionWaypoints=function(t){t.businessObject.di.set("waypoint",this._bpmnFactory.createDiWaypoints(t.waypoints))},Ve.prototype.updateConnection=function(t){var e,n=t.connection,i=et(n),r=et(n.source),o=et(n.target);if(A(i,"bpmn:DataAssociation"))A(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=r,e=t.parent||t.newParent||o,this.updateSemanticParent(i,o,e)):A(i,"bpmn:DataOutputAssociation")&&(e=t.parent||t.newParent||r,this.updateSemanticParent(i,r,e),i.targetRef=o);else{var a=A(i,"bpmn:SequenceFlow");i.sourceRef!==r&&(a&&(Wt(i.sourceRef&&i.sourceRef.get("outgoing"),i),r&&r.get("outgoing")&&r.get("outgoing").push(i)),i.sourceRef=r),i.targetRef!==o&&(a&&(Wt(i.targetRef&&i.targetRef.get("incoming"),i),o&&o.get("incoming")&&o.get("incoming").push(i)),i.targetRef=o)}this.updateConnectionWaypoints(n),this.updateDiConnection(i.di,r,o)},Ve.prototype._getLabel=function(t){return t.label||(t.label=this._bpmnFactory.createDiLabel()),t.label},rt(Ti,Un),Ti.$inject=["bpmnFactory","moddle","translate"],Ti.prototype.baseCreate=Un.prototype.create,Ti.prototype.create=function(t,e){return t==="label"?this.baseCreate(t,z({type:"label"},Do,e)):this.createBpmnElement(t,e)},Ti.prototype.createBpmnElement=function(t,e){var n,i,r,o=this._translate,a=(e=e||{}).businessObject;if(!a){if(!e.type)throw new Error(o("no shape type specified"));a=this._bpmnFactory.create(e.type)}return a.di||(a.di=t==="root"?this._bpmnFactory.createDiPlane(a,[],{id:a.id+"_di"}):t==="connection"?this._bpmnFactory.createDiEdge(a,[],{id:a.id+"_di"}):this._bpmnFactory.createDiShape(a,{},{id:a.id+"_di"})),A(a,"bpmn:Group")&&(e=z({isFrame:!0},e)),e.di&&(z(a.di,e.di),delete e.di),function(c,l,u){L(u,function(p){l[p]!==void 0&&Hy(c,l,p)})}(a,e,["processRef","isInterrupting","associationDirection","isForCompensation"]),e.isExpanded&&Hy(a.di,e,"isExpanded"),A(a,"bpmn:ExclusiveGateway")&&(a.di.isMarkerVisible=!0),e.eventDefinitionType&&(i=a.get("eventDefinitions")||[],r=this._bpmnFactory.create(e.eventDefinitionType,e.eventDefinitionAttrs),e.eventDefinitionType==="bpmn:ConditionalEventDefinition"&&(r.condition=this._bpmnFactory.create("bpmn:FormalExpression")),i.push(r),r.$parent=a,a.eventDefinitions=i,delete e.eventDefinitionType),n=this._getDefaultSize(a),e=z({businessObject:a,id:a.id},n,e),this.baseCreate(t,e)},Ti.prototype._getDefaultSize=function(t){return A(t,"bpmn:SubProcess")?Pt(t)?{width:350,height:200}:{width:100,height:80}:A(t,"bpmn:Task")?{width:100,height:80}:A(t,"bpmn:Gateway")?{width:50,height:50}:A(t,"bpmn:Event")?{width:36,height:36}:A(t,"bpmn:Participant")?Pt(t)?{width:600,height:250}:{width:400,height:60}:A(t,"bpmn:Lane")?{width:400,height:100}:A(t,"bpmn:DataObjectReference")?{width:36,height:50}:A(t,"bpmn:DataStoreReference")?{width:50,height:50}:A(t,"bpmn:TextAnnotation")?{width:100,height:30}:A(t,"bpmn:Group")?{width:300,height:300}:{width:100,height:80}},Ti.prototype.createParticipantShape=function(t){return Jt(t)||(t={isExpanded:t}),(t=z({type:"bpmn:Participant"},t||{})).isExpanded!==!1&&(t.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(t)},pc.$inject=["modeling","canvas"],pc.prototype.preExecute=function(t){var e=this._modeling,n=t.elements,i=t.alignment;L(n,function(r){var o={x:0,y:0};i.left?o.x=i.left-r.x:i.right?o.x=i.right-r.width-r.x:i.center?o.x=i.center-Math.round(r.width/2)-r.x:i.top?o.y=i.top-r.y:i.bottom?o.y=i.bottom-r.height-r.y:i.middle&&(o.y=i.middle-Math.round(r.height/2)-r.y),e.moveElements([r],o,r.parent)})},pc.prototype.postExecute=function(t){},hc.$inject=["modeling"],hc.prototype.preExecute=function(t){var e=t.source;if(!e)throw new Error("source required");var n=t.target||e.parent,i=t.shape,r=t.hints||{};i=t.shape=this._modeling.createShape(i,t.position,n,{attach:r.attach}),t.shape=i},hc.prototype.postExecute=function(t){var e,n,i=t.hints||{};e=t.source,n=t.shape,ui(e.outgoing,function(r){return r.target===n})||(i.connectionTarget===t.source?this._modeling.connect(t.shape,t.source,t.connection):this._modeling.connect(t.source,t.shape,t.connection))},dc.$inject=["canvas","layouter"],dc.prototype.execute=function(t){var e=t.connection,n=t.source,i=t.target,r=t.parent,o=t.parentIndex,a=t.hints;if(!n||!i)throw new Error("source and target required");if(!r)throw new Error("parent required");return e.source=n,e.target=i,e.waypoints||(e.waypoints=this._layouter.layoutConnection(e,a)),this._canvas.addConnection(e,r,o),e},dc.prototype.revert=function(t){var e=t.connection;return this._canvas.removeConnection(e),e.source=null,e.target=null,e};var mc=Math.round;function Dp(t){this._modeling=t}function qy(t){return!!t.waypoints}Dp.$inject=["modeling"],Dp.prototype.preExecute=function(t){var e=t.elements,n=t.parent,i=t.parentIndex,r=t.position,o=t.hints,a=this._modeling;L(e,function(p){ht(p.x)||(p.x=0),ht(p.y)||(p.y=0)});var c=ve(e);L(e,function(p){qy(p)&&(p.waypoints=ae(p.waypoints,function(d){return{x:mc(d.x-c.x-c.width/2+r.x),y:mc(d.y-c.y-c.height/2+r.y)}})),z(p,{x:mc(p.x-c.x-c.width/2+r.x),y:mc(p.y-c.y-c.height/2+r.y)})});var l=Sd(e),u={};L(e,function(p){if(qy(p))u[p.id]=ht(i)?a.createConnection(u[p.source.id],u[p.target.id],i,p,p.parent||n,o):a.createConnection(u[p.source.id],u[p.target.id],p,p.parent||n,o);else{var d=z({},o);l.indexOf(p)===-1&&(d.autoResize=!1),u[p.id]=ht(i)?a.createShape(p,Je(p,["x","y","width","height"]),p.parent||n,i,d):a.createShape(p,Je(p,["x","y","width","height"]),p.parent||n,d)}}),t.elements=Ga(u)};var Wy=Math.round;function Ai(t){this._canvas=t}function oa(t){Ai.call(this,t)}Ai.$inject=["canvas"],Ai.prototype.execute=function(t){var e=t.shape,n=t.position,i=t.parent,r=t.parentIndex;if(!i)throw new Error("parent required");if(!n)throw new Error("position required");return n.width!==void 0?z(e,n):z(e,{x:n.x-Wy(e.width/2),y:n.y-Wy(e.height/2)}),this._canvas.addShape(e,i,r),e},Ai.prototype.revert=function(t){var e=t.shape;return this._canvas.removeShape(e),e},rt(oa,Ai),oa.$inject=["canvas"];var S_=Ai.prototype.execute;oa.prototype.execute=function(t){var e=t.shape;return function(n){["width","height"].forEach(function(i){n[i]===void 0&&(n[i]=0)})}(e),e.labelTarget=t.labelTarget,S_.call(this,t)};var C_=Ai.prototype.revert;function fc(t,e){this._canvas=t,this._modeling=e}function Bp(t,e){this._modeling=t,this._elementRegistry=e}function aa(t,e){this._canvas=t,this._modeling=e}function vc(t){this._modeling=t}oa.prototype.revert=function(t){return t.shape.labelTarget=null,C_.call(this,t)},fc.$inject=["canvas","modeling"],fc.prototype.execute=function(t){var e=t.connection,n=e.parent;return t.parent=n,t.parentIndex=Gl(n.children,e),t.source=e.source,t.target=e.target,this._canvas.removeConnection(e),e.source=null,e.target=null,e},fc.prototype.revert=function(t){var e=t.connection,n=t.parent,i=t.parentIndex;return e.source=t.source,e.target=t.target,Xt(n.children,e,i),this._canvas.addConnection(e,n),e},Bp.$inject=["modeling","elementRegistry"],Bp.prototype.postExecute=function(t){var e=this._modeling,n=this._elementRegistry;L(t.elements,function(i){n.get(i.id)&&(i.waypoints?e.removeConnection(i):e.removeShape(i))})},aa.$inject=["canvas","modeling"],aa.prototype.preExecute=function(t){var e=this._modeling,n=t.shape;eo(n.incoming,function(i){e.removeConnection(i,{nested:!0})}),eo(n.outgoing,function(i){e.removeConnection(i,{nested:!0})}),eo(n.children,function(i){i.waypoints?e.removeConnection(i,{nested:!0}):e.removeShape(i,{nested:!0})})},aa.prototype.execute=function(t){var e=this._canvas,n=t.shape,i=n.parent;return t.oldParent=i,t.oldParentIndex=Gl(i.children,n),e.removeShape(n),n},aa.prototype.revert=function(t){var e=this._canvas,n=t.shape,i=t.oldParent,r=t.oldParentIndex;return Xt(i.children,n,r),e.addShape(n,i),n},vc.$inject=["modeling"];var Xy={x:"y",y:"x"};function yc(t,e){this._layouter=t,this._canvas=e}function Op(){}function Lp(){this.allShapes={},this.allConnections={},this.enclosedElements={},this.enclosedConnections={},this.topLevel={}}function sa(t){this._modeling=t}function gc(t){this._helper=new sa(t)}function ir(t){this._modeling=t,this._helper=new sa(t)}function ca(t){this._modeling=t}function Ky(t){return t.original||t}function ti(t,e){this._modeling=t,this._rules=e}function la(t){this._modeling=t}function ki(t){this._modeling=t}function Yy(t){return z({},t)}function Jy(t){switch(t){case"n":case"s":return"y";case"w":case"e":return"x"}}function Zy(t,e,n){var i=Jy(n);return/e|s/.test(n)?t[i]>e:/n|w/.test(n)?t[i]<e:void 0}function Pi(t,e){return t.indexOf(e)!==-1}function bc(t){this._modeling=t}function Qy(t){var e={};return L(t,function(n){e[n.id]=n.hidden,n.children&&(e=z({},e,Qy(n.children)))}),e}function tg(t,e){var n=[];return L(t,function(i){i.hidden=e,n=n.concat(i),i.children&&(n=n.concat(tg(i.children,i.collapsed||e)))}),n}function eg(t,e){var n=[];return L(t,function(i){i.hidden=e[i.id],n=n.concat(i),i.children&&(n=n.concat(eg(i.children,e)))}),n}function xc(t){this._modeling=t}function ng(t,e){return Wt(t&&t.attachers,e)}function ig(t,e,n){if(t){var i=t.attachers;i||(t.attachers=i=[]),Xt(i,e,n)}}function jp(){}function Rt(t,e,n){this._eventBus=t,this._elementFactory=e,this._commandStack=n;var i=this;t.on("diagram.init",function(){i.registerHandlers(n)})}function ua(t){this._elementRegistry=t}function rg(t,e){L(e,function(n,i){t.set(i,n)})}vc.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 E,S,w;g.elements.length<2?b&&b!==n.length-1&&(o(g,g.elements[0]),v+=l(g.range)):(S=(E=Ke(g.elements,i))[0],b===y&&(S=E[c(E)]),w=a(S),g.range=null,L(E,function(C){(function(B,s){var h={y:0};h[i]=B-a(s),h[i]&&(h[Xy[i]]=0,e.moveElements([s],h,s.parent))})(w,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 E,S={};g!==d&&g!==f&&(E=n[b-1],g.range.max=0,L(g.elements,function(w,C){S[Xy[i]]=0,S[i]=E.range.max-w[i]+u,g.range.min!==w[i]&&(S[i]+=w[i]-g.range.min),S[i]&&e.moveElements([w],S,w.parent),g.range.max=Math.max(w[i]+w[r],C?g.range.max:0)}))})},vc.prototype.postExecute=function(t){},yc.$inject=["layouter","canvas"],yc.prototype.execute=function(t){var e=t.connection;return z(t,{oldWaypoints:e.waypoints}),e.waypoints=this._layouter.layoutConnection(e,t.hints),e},yc.prototype.revert=function(t){var e=t.connection;return e.waypoints=t.oldWaypoints,e},Op.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=Wt(o.children,e),Xt(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},Op.prototype.revert=function(t){var e=t.connection,n=e.parent,i=t.oldParent,r=t.oldParentIndex,o=t.delta;return Wt(n.children,e),Xt(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},Lp.prototype.add=function(t,e){return this.addAll([t],e)},Lp.prototype.addAll=function(t,e){var n=function(i,r,o){Fn(r)&&(r=!0),Jt(r)&&(o=r,r=!0);var a=wo((o=o||{}).allShapes),c=wo(o.allConnections),l=wo(o.enclosedElements),u=wo(o.enclosedConnections),p=wo(o.topLevel,r&&Gi(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 Hi(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},sa.prototype.moveRecursive=function(t,e,n){return t?this.moveClosure(this.getClosure(t),e,n):[]},sa.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&&ap(d,d.source,e),connectionEnd:f&&sp(d,d.target,e)})})},sa.prototype.getClosure=function(t){return new Lp().addAll(t,!0)},gc.$inject=["modeling"],gc.prototype.preExecute=function(t){t.closure=this._helper.getClosure(t.shapes)},gc.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)},ir.$inject=["modeling"],ir.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=Je(e,["x","y","width","height"]),t.oldParent=o,t.oldParentIndex=Wt(o.children,e),Xt(i.children,e,r),z(e,{parent:i,x:e.x+n.x,y:e.y+n.y}),e},ir.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:sp(o,e,n)})}),L(e.outgoing,function(o){r.layoutConnection(o,{connectionStart:ap(o,e,n)})})),i.recurse!==!1&&this.moveChildren(t)},ir.prototype.revert=function(t){var e=t.shape,n=t.oldParent,i=t.oldParentIndex,r=t.delta;return Xt(n.children,e,i),z(e,{parent:n,x:e.x-r.x,y:e.y-r.y}),e},ir.prototype.moveChildren=function(t){var e=t.delta,n=t.shape;this._helper.moveRecursive(n.children,e,null)},ir.prototype.getNewParent=function(t){return t.newParent||t.shape.parent},ca.$inject=["modeling"],ca.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},ca.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||Ky(gt(r)?r[0]:r)),!i||n&&o.docking!=="target"||(a.connectionEnd=a.connectionEnd||Ky(gt(r)?r[r.length-1]:r)),o.newWaypoints&&(a.waypoints=o.newWaypoints),this._modeling.layoutConnection(e,a))},ca.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},ti.$inject=["modeling","rules"],ti.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,Zs(v,e,d),c)}),L(f,function(v){var g=v.target;l(e,g,v)&&n.reconnectStart(v,e,Js(v,e,d),c)})},ti.prototype.postExecute=function(t){var e=t.oldShape;this._modeling.removeShape(e)},ti.prototype.execute=function(t){},ti.prototype.revert=function(t){},ti.prototype.createShape=function(t,e,n,i){return this._modeling.createShape(t,e,n,i)},ti.prototype.reconnectStart=function(t,e,n,i){this._modeling.reconnectStart(t,e,n,i)},ti.prototype.reconnectEnd=function(t,e,n,i){this._modeling.reconnectEnd(t,e,n,i)},la.$inject=["modeling"],la.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},la.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:Zs(r,n,i)})}),L(n.outgoing,function(r){e.layoutConnection(r,{connectionStart:Js(r,n,i)})}))},la.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},ki.$inject=["modeling"],ki.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;(ra(c,v)||ra(c,g)||ra(l,v)||ra(l,g))&&(ra(u,f)||u.push(f))})}),u}(i,r),e,n,o,i,r,a)},ki.prototype.execute=function(){},ki.prototype.revert=function(){},ki.prototype.moveShapes=function(t,e){var n=this;L(t,function(i){n._modeling.moveShape(i,e,null,{autoResize:!1,layout:!1,recurse:!1})})},ki.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})})},ki.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 ae(g.waypoints,function(b){return(b=Yy(b)).original&&(b.original=Yy(b.original)),b})}(u),f=Jy(n),v={labelBehavior:!1};Pi(l,p)&&Pi(l,d)?(y=ae(y,function(g){return Zy(g,i,n)&&(g[f]=g[f]+e[f]),g.original&&Zy(g.original,i,n)&&(g.original[f]=g.original[f]+e[f]),g}),c._modeling.updateWaypoints(u,y,{labelBehavior:!1})):(Pi(l,p)||Pi(l,d))&&(Pi(r,p)?v.connectionStart=ap(u,p,e):Pi(r,d)?v.connectionEnd=sp(u,d,e):Pi(o,p)?v.connectionStart=Js(u,p,a[p.id]):Pi(o,d)&&(v.connectionEnd=Zs(u,d,a[d.id])),c._modeling.layoutConnection(u,v))})},bc.$inject=["modeling"],bc.prototype.execute=function(t){var e=t.shape,n=e.children;t.oldChildrenVisibility=Qy(n),e.collapsed=!e.collapsed;var i=tg(n,e.collapsed);return[e].concat(i)},bc.prototype.revert=function(t){var e=t.shape,n=t.oldChildrenVisibility,i=eg(e.children,n);return e.collapsed=!e.collapsed,[e].concat(i)},xc.$inject=["modeling"],xc.prototype.execute=function(t){var e=t.shape,n=t.newHost,i=e.host;return t.oldHost=i,t.attacherIdx=ng(i,e),ig(n,e),e.host=n,e},xc.prototype.revert=function(t){var e=t.shape,n=t.newHost,i=t.oldHost,r=t.attacherIdx;return e.host=i,ng(n,e),ig(i,e,r),e},jp.prototype.execute=function(t){var e=t.connection,n=t.newWaypoints;return t.oldWaypoints=e.waypoints,e.waypoints=n,e},jp.prototype.revert=function(t){var e=t.connection,n=t.oldWaypoints;return e.waypoints=n,e},Rt.$inject=["eventBus","elementFactory","commandStack"],Rt.prototype.getHandlers=function(){return{"shape.append":hc,"shape.create":Ai,"shape.delete":aa,"shape.move":ir,"shape.resize":la,"shape.replace":ti,"shape.toggleCollapse":bc,spaceTool:ki,"label.create":oa,"connection.create":dc,"connection.delete":fc,"connection.move":Op,"connection.layout":yc,"connection.updateWaypoints":jp,"connection.reconnect":ca,"elements.create":Dp,"elements.move":gc,"elements.delete":Bp,"elements.distribute":vc,"elements.align":pc,"element.updateAttachment":xc}},Rt.prototype.registerHandlers=function(t){L(this.getHandlers(),function(e,n){t.registerHandler(n,e)})},Rt.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)},Rt.prototype.updateAttachment=function(t,e){var n={shape:t,newHost:e};this._commandStack.execute("element.updateAttachment",n)},Rt.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)},Rt.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)},Rt.prototype.layoutConnection=function(t,e){var n={connection:t,hints:e||{}};this._commandStack.execute("connection.layout",n)},Rt.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},Rt.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},Rt.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},Rt.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},Rt.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},Rt.prototype.removeElements=function(t){var e={elements:t};this._commandStack.execute("elements.delete",e)},Rt.prototype.distributeElements=function(t,e,n){var i={groups:t,axis:e,dimension:n};this._commandStack.execute("elements.distribute",i)},Rt.prototype.removeShape=function(t,e){var n={shape:t,hints:e||{}};this._commandStack.execute("shape.delete",n)},Rt.prototype.removeConnection=function(t,e){var n={connection:t,hints:e||{}};this._commandStack.execute("connection.delete",n)},Rt.prototype.replaceShape=function(t,e,n){var i={oldShape:t,newData:e,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},Rt.prototype.alignElements=function(t,e){var n={elements:t,alignment:e};this._commandStack.execute("elements.align",n)},Rt.prototype.resizeShape=function(t,e,n,i){var r={shape:t,newBounds:e,minBounds:n,hints:i};this._commandStack.execute("shape.resize",r)},Rt.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)},Rt.prototype.updateWaypoints=function(t,e,n){var i={connection:t,newWaypoints:e,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},Rt.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)},Rt.prototype.reconnectStart=function(t,e,n,i){i||(i={}),this.reconnect(t,e,t.target,n,z(i,{docking:"source"}))},Rt.prototype.reconnectEnd=function(t,e,n,i){i||(i={}),this.reconnect(t,t.source,e,n,z(i,{docking:"target"}))},Rt.prototype.connect=function(t,e,n,i){return this.createConnection(t,e,n||{},t.parent,i)},Rt.prototype._create=function(t,e){return e instanceof To?e:this._elementFactory.create(t,e)},Rt.prototype.toggleCollapse=function(t,e){var n={shape:t,hints:e||{}};this._commandStack.execute("shape.toggleCollapse",n)},ua.$inject=["elementRegistry"],ua.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,xo(i));return rg(n,i),t.oldProperties=o,t.changed=r,r},ua.prototype.revert=function(t){var e=t.oldProperties,n=t.moddleElement,i=t.changed;return rg(n,e),i},ua.prototype.getVisualReferences=function(t){var e=this._elementRegistry;return A(t,"bpmn:DataObject")?function(n,i){return i.filter(function(r){return A(r,"bpmn:DataObjectReference")&&et(r).dataObjectRef===n})}(t,e):[]};var pa="default",ei="id",og="di",T_={width:0,height:0};function ha(t,e,n,i,r){this._elementRegistry=t,this._moddle=e,this._translate=n,this._modeling=i,this._textRenderer=r}function ag(t,e){return ei in t&&t[ei]!==e[ei]}function sg(t,e){L(e,function(n,i){i!==og?t.set(i,n):t.di&&function(r,o){L(o,function(a,c){r.set(c,a)})}(t.di,n)})}ha.$inject=["elementRegistry","moddle","translate","modeling","textRenderer"],ha.prototype.execute=function(t){var e=t.element,n=[e],i=this._translate;if(!e)throw new Error(i("element required"));var r=this._elementRegistry,o=this._moddle.ids,a=e.businessObject,c=function(u){var p=z({},u);return A_.forEach(function(d){d in u&&(p[d]=et(p[d]))}),p}(t.properties),l=t.oldProperties||function(u,p){var d=xo(p);return De(d,function(y,f){return y[f]=f!==og?u.get(f):function(v,g){return De(g,function(b,E){return b[E]=v.get(E),b},{})}(u.di,xo(p.di)),y},{})}(a,c);return ag(c,a)&&(o.unclaim(a[ei]),r.updateId(e,c[ei]),o.claim(c[ei],a)),pa in c&&(c[pa]&&n.push(r.get(c[pa].id)),a[pa]&&n.push(r.get(a[pa].id))),sg(a,c),t.oldProperties=l,t.changed=n,n},ha.prototype.postExecute=function(t){var e=t.element.label,n=e&&et(e).name;if(n){var i=this._textRenderer.getExternalLabelBounds(e,n);this._modeling.resizeShape(e,i,T_)}},ha.prototype.revert=function(t){var e=t.element,n=t.properties,i=t.oldProperties,r=e.businessObject,o=this._elementRegistry,a=this._moddle.ids;return sg(r,i),ag(n,r)&&(a.unclaim(n[ei]),o.updateId(e,i[ei]),a.claim(i[ei],r)),t.changed};var A_=["default"];function Ec(t,e){this._canvas=t,this._modeling=e}function Vp(t,e){this._modeling=t,this._spaceTool=e}function Fp(t,e){this._modeling=t,this._translate=e}function da(t,e){this._modeling=t,this._spaceTool=e}Ec.$inject=["canvas","modeling"],Ec.prototype.execute=function(t){var e=this._canvas,n=t.newRoot,i=n.businessObject,r=e.getRootElement(),o=r.businessObject,a=o.$parent,c=o.di;e.setRootElement(n,!0),Xt(a.rootElements,i),i.$parent=a,Wt(a.rootElements,o),o.$parent=null,o.di=null,c.bpmnElement=i,i.di=c,t.oldRoot=r},Ec.prototype.revert=function(t){var e=this._canvas,n=t.newRoot.businessObject,i=t.oldRoot,r=i.businessObject,o=n.$parent,a=n.di;e.setRootElement(i,!0),Wt(o.rootElements,n),n.$parent=null,Xt(o.rootElements,r),r.$parent=o,n.di=null,a.bpmnElement=r,r.di=a},Vp.$inject=["modeling","spaceTool"],Vp.prototype.preExecute=function(t){var e=this._spaceTool,n=this._modeling,i=t.shape,r=t.location,o=gn(i),a=o===i,c=a?i:i.parent;wi(c).length||n.createShape({type:"bpmn:Lane"},{x:i.x+Jr,y:i.y,width:i.width-Jr,height:i.height},c);var l=[];Hi(o,function(v){return l.push(v),v.label&&l.push(v.label),v===i?[]:mt(v.children,function(g){return g!==i})});var u=r==="top"?-120:120,p=r==="top"?i.y:i.y+i.height,d=p+(r==="top"?10:-10),y=r==="top"?"n":"s",f=e.calculateAdjustments(l,"y",u,d);e.makeSpace(f.movingShapes,f.resizingShapes,{x:0,y:u},y,d),t.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?Jr:0),y:p-(r==="top"?120:0),width:i.width-(a?Jr:0),height:120},c)},Fp.$inject=["modeling","translate"],Fp.prototype.preExecute=function(t){var e=this._modeling,n=this._translate,i=t.shape,r=t.count,o=wi(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var c,l,u,p,d,y=Math.round(i.height/r);for(d=0;d<r;d++)c=i.y+d*y,l=d===r-1?i.height-y*d:y,u={x:i.x+Jr,y:c,width:i.width-Jr,height:l},d<a?e.resizeShape(o[d],u):(p={type:"bpmn:Lane"},e.createShape(p,u,i))},da.$inject=["modeling","spaceTool"],da.prototype.preExecute=function(t){var e=t.shape,n=t.newBounds;t.balanced!==!1?this.resizeBalanced(e,n):this.resizeSpace(e,n)},da.prototype.resizeBalanced=function(t,e){var n=this._modeling,i=PE(t,e);n.resizeShape(t,e),i.forEach(function(r){n.resizeShape(r.shape,r.newBounds)})},da.prototype.resizeSpace=function(t,e){var n,i,r,o,a,c=this._spaceTool,l=st(t),u=cv(st(e),l),p=gn(t),d=[],y=[];Hi(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 ma="flowNodeRef",zp="lanes";function fa(t){this._elementRegistry=t}function _c(t){this._moddle=t}fa.$inject=["elementRegistry"],fa.prototype.computeUpdates=function(t,e){var n=[],i=[],r={},o=[];function a(l){n.indexOf(l)===-1&&(o.push(l),n.push(l))}function c(l){if(!l.parent)return[];var u=function(p){var d=gn(p);return r[d.id]||(r[d.id]=Ls(d)),r[d.id]}(l);return u.filter(function(p){return d=l,y=st(p),f=d.x+d.width/2,v=d.y+d.height/2,f>y.left&&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=gn(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(zp).slice(),d=c(l);i.push({flowNode:u,remove:p,add:d})}),e.forEach(function(l){var u=l.businessObject;l.parent||u.get(ma).forEach(function(p){i.push({flowNode:p,remove:[u],add:[]})})}),i},fa.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(zp);n.remove.forEach(function(o){Wt(r,o),Wt(o.get(ma),i)}),n.add.forEach(function(o){Xt(r,o),Xt(o.get(ma),i)})})},fa.prototype.revert=function(t){t.updates.forEach(function(e){var n=e.flowNode,i=n.get(zp);e.add.forEach(function(r){Wt(i,r),Wt(r.get(ma),n)}),e.remove.forEach(function(r){Xt(i,r),Xt(r.get(ma),n)})})},_c.$inject=["moddle"],_c.prototype.execute=function(t){var e=this._moddle.ids,n=t.id,i=t.element;t.claiming?e.claim(n,i):e.unclaim(n)},_c.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 k_={fill:void 0,stroke:void 0};function $p(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)}}}$p.$inject=["commandStack"],$p.prototype.postExecute=function(t){var e=t.elements,n=t.colors||k_,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)?Je(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 P_={width:0,height:0};function cg(t,e){function n(i,r){var o=i.label||i,a=i.labelTarget||i;return function(c,l){var u=c.businessObject,p=Sm(u);p&&(p==="categoryValueRef"?u.categoryValueRef.value=l:u[p]=l)}(o,r),[o,a]}this.preExecute=function(i){var r=i.element,o=r.businessObject,a=i.newLabel;if(!ge(r)&&$r(r)&&!ms(r)&&!lg(a)){var c=fs(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=mn(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)&&lg(a))l.removeShape!==!1&&t.removeShape(o,{unsetLabel:!1});else{var u=mn(o);c===void 0&&(c=e.getExternalLabelBounds(o,u)),c&&t.resizeShape(o,c,P_)}}}function lg(t){return!t||!t.trim()}function xe(t,e,n,i){Rt.call(this,t,e,n),this._bpmnRules=i}function ug(){}cg.$inject=["modeling","textRenderer"],rt(xe,Rt),xe.$inject=["eventBus","elementFactory","commandStack","bpmnRules"],xe.prototype.getHandlers=function(){var t=Rt.prototype.getHandlers.call(this);return t["element.updateModdleProperties"]=ua,t["element.updateProperties"]=ha,t["canvas.updateRoot"]=Ec,t["lane.add"]=Vp,t["lane.resize"]=da,t["lane.split"]=Fp,t["lane.updateRefs"]=fa,t["id.updateClaim"]=_c,t["element.setColor"]=$p,t["element.updateLabel"]=cg,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})},ug.prototype.layoutConnection=function(t,e){return[(e=e||{}).connectionStart||vt(e.source||t.source),e.connectionEnd||vt(e.target||t.target)]};var wc=Math.round,M_={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};function pg(t,e,n){var i,r,o,a=ye(e,t,5),c=n.split(":")[0],l=wc((e.x-t.x)/2+t.x),u=wc((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+20*(/l/.test(c)?-1:1),y:f?u+20:u}):i={x:(f=l===t.x)?l+20:l,y:t.y+20*(/t/.test(c)?-1:1)}:i={x:l,y:u}),{waypoints:Gp(t,i,r).concat(i),directions:r,turnNextDirections:f}}function hg(t){return t.split(":").reverse().join(":")}function Gp(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(mg(n)){var i=function(a,c,l){return pg(a,c,l)}(t,e,n),r=function(a,c,l){var u=pg(c,a,hg(l));return{waypoints:u.waypoints.slice().reverse(),directions:hg(u.directions),turnNextDirections:u.turnNextDirections}}(t,e,n),o=function(a,c){var l=a.directions.split(":")[1],u=c.directions.split(":")[0];a.turnNextDirections&&(l=l=="h"?"v":"h"),c.turnNextDirections&&(u=u=="h"?"v":"h");var p=l+":"+u;return{waypoints:Gp(a.waypoints[a.waypoints.length-1],c.waypoints[0],p),directions:p}}(i,r);return[].concat(i.waypoints,o.waypoints,r.waypoints)}return function(a,c,l){var u=wc((c.x-a.x)/2+a.x),p=wc((c.y-a.y)/2+a.y);if(l==="h:v")return[{x:c.x,y:a.y}];if(l==="v:h")return[{x:a.x,y:c.y}];if(l==="h:h")return[{x:u,y:a.y},{x:u,y:c.y}];if(l==="v:v")return[{x:a.x,y:p},{x:c.x,y:p}];throw new Error("invalid directions: can only handle varians of [hv]:[hv]")}(t,e,n)}function R_(t,e,n,i,r){var o=ad(r&&r.preferredLayouts||[],"straight")[0]||"h:h",a=ye(t,e,M_[o]||0),c=function(p,d){if(mg(d))return d;switch(p){case"intersect":return"t:t";case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return d}}(a,o);n=n||vt(t),i=i||vt(e);var l=c.split(":"),u=fg(n,t,l[0],function(p){return{top:"bottom",bottom:"top",left:"right",right:"left","top-left":"bottom-right","bottom-right":"top-left","top-right":"bottom-left","bottom-left":"top-right"}[p]}(a));return function(p,d,y){var f=Gp(p,d,y);return f.unshift(p),f.push(d),vg(f)}(u,fg(i,e,l[1],a),c)}function N_(t,e,n,i,r,o){var a;return gt(n)&&(r=n,o=i,n=vt(t),i=vt(e)),r=r||[],a=(o=z({preferredLayouts:[]},o)).preferredLayouts.indexOf("straight")!==-1&&function(c,l,u,p,d){var y,f,v={};return f=ye(c,l),/^(top|bottom|left|right)$/.test(f)?(/top|bottom/.test(f)&&(y="x"),/left|right/.test(f)&&(y="y"),d.preserveDocking==="target"?dg(y,p,c)?(v[y]=p[y],[{x:v.x!==void 0?v.x:u.x,y:v.y!==void 0?v.y:u.y,original:{x:v.x!==void 0?v.x:u.x,y:v.y!==void 0?v.y:u.y}},{x:p.x,y:p.y}]):null:dg(y,u,l)?(v[y]=u[y],[{x:u.x,y:u.y},{x:v.x!==void 0?v.x:p.x,y:v.y!==void 0?v.y:p.y,original:{x:v.x!==void 0?v.x:p.x,y:v.y!==void 0?v.y:p.y}}]):null):null}(t,e,n,i,o),a||(a=o.connectionEnd&&function(c,l,u,p){var d=p.slice().reverse();return d=Up(c,l,u,d),d?d.reverse():null}(e,t,i,r),a||(a=o.connectionStart&&Up(t,e,n,r))||(!o.connectionStart&&!o.connectionEnd&&r&&r.length?r:R_(t,e,n,i,o)))}function dg(t,e,n){return function(i,r,o){return i>=r&&i<=o}(e[t],n[t],n[t]+n[{x:"width",y:"height"}[t]])}function Up(t,e,n,i){if(function(c){return c.length<3||!(c.length>4)&&!!kt(c,function(l,u){var p=c[u-1];return p&&So(l,p)<3})}(i))return null;var r,o=i[0],a=i.slice();return a[0]=n,a[1]=function(c,l,u){switch(Gn(l,c)){case"v":return{x:u.x,y:c.y};case"h":return{x:c.x,y:u.y}}return{x:c.x,y:c.y}}(a[1],o,n),r=function(c,l,u){var p;for(p=c.length-2;p!==0;p--)if(Pd(c[p],l,20)||Pd(c[p],u,20))return c.slice(p);return c}(a,t,e),r!==a&&(a=Up(t,e,n,r)),a&&Gn(a)?null:a}function mg(t){return t&&/t|r|b|l/.test(t)}function fg(t,e,n,i){if(n==="h"&&(n=/left/.test(i)?"l":"r"),n==="v"&&(n=/top/.test(i)?"t":"b"),n==="t")return{original:t,x:t.x,y:e.y};if(n==="r")return{original:t,x:e.x+e.width,y:t.y};if(n==="b")return{original:t,x:t.x,y:e.y+e.height};if(n==="l")return{original:t,x:e.x,y:t.y};throw new Error("unexpected dockingDirection: <"+n+">")}function vg(t){return t.reduce(function(e,n,i){return Ul(e[e.length-1],t[i+1],n,0)||e.push(n),e},[])}var Hp={top:"bottom","top-right":"bottom-left","top-left":"bottom-right",right:"left",bottom:"top","bottom-right":"top-left","bottom-left":"top-right",left:"right"},Sc={top:"t",right:"r",bottom:"b",left:"l"};function qp(){}function I_(t,e){return A(e,"bpmn:Participant")?"source":A(t,"bpmn:Participant")?"target":va(e)?"source":va(t)||A(e,"bpmn:Event")?"target":A(t,"bpmn:Event")?"source":null}function D_(t){return va(t)?"target":"source"}function yg(t,e){return t?t.original||t:vt(e)}function gg(t,e){return A(e,"bpmn:Activity")&&A(t,"bpmn:BoundaryEvent")&&e.businessObject.isForCompensation}function va(t){return A(t,"bpmn:SubProcess")&&Pt(t)}function ya(t,e){return t===e}function ga(t){var e=/right|left/.exec(t);return e&&e[0]}function rr(t){var e=/top|bottom/.exec(t);return e&&e[0]}function Wp(t){return t==="right"||t==="left"}function B_(t,e){var n=e.waypoints,i=n&&n.length&&ye(n[0],t);return i==="top"?["t:r"]:i==="right"?["r:b"]:i==="left"?["l:t"]:["b:l"]}function O_(t,e,n){var i,r,o,a,c=vt(t),l=vt(e),u=(a=(o=t).host,ye(vt(o),a,-10)),p=ya(t.host,e),d=["top","right","bottom","left"].indexOf(u)!==-1,y=ye(l,c,{x:t.width/2+e.width/2,y:t.height/2+e.height/2});return p?function(f,v,g,b,E){var S,w=v?f:rr(f),C=Sc[w];return S=v?Wp(f)?bg("y",g,b,E)?"h":"b":bg("x",g,b,E)?"v":"l":"v",[C+":"+S]}(u,d,t,e,n):(i=function(f,v,g){if(g)return Sc[f];if(ya(rr(f),rr(v))||(b=ga(f),E=ga(v),Hp[b]===E))return Sc[rr(f)];var b,E;return Sc[ga(f)]}(u,y,d),r=function(f,v,g){if(g)return Wp(f)?(b=v,E=ga(f),S=Hp[E],b.indexOf(S)!==-1||ya(f,v)?"h":"v"):function(w,C){var B=rr(w),s=Hp[B];return C.indexOf(s)!==-1}(f,v)||ya(f,v)?"v":"h";var b,E,S;return Wp(v)||ya(rr(f),rr(v))&&ga(v)?"h":"v"}(u,y,d),[i+":"+r])}function bg(t,e,n,i){return!(Xp(t,i,n,40)||Xp(t,i,{x:n.x+n.width,y:n.y+n.height},40)||Xp(t,i,vt(e),40))}function Xp(t,e,n,i){return Math.abs(e[t]-n[t])<i}function xg(t){return z({original:t.point.original||t.point},t.actual)}function Mi(t,e){this._elementRegistry=t,this._graphicsFactory=e}rt(qp,ug),qp.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=yg(a&&a[0],r)),l||(l=yg(a&&a[a.length-1],o)),(A(t,"bpmn:Association")||A(t,"bpmn:DataAssociation"))&&a&&!gg(r,o)?[].concat([c],a.slice(1,-1),[l]):(A(t,"bpmn:MessageFlow")?n=function(u,p){return{preferredLayouts:["straight","v:v"],preserveDocking:I_(u,p)}}(r,o):(A(t,"bpmn:SequenceFlow")||gg(r,o))&&(n=r===o?{preferredLayouts:B_(r,t)}:A(r,"bpmn:BoundaryEvent")?{preferredLayouts:O_(r,o,l)}:va(r)||va(o)?function(u){return{preferredLayouts:["straight","h:h"],preserveDocking:D_(u)}}(r):A(r,"bpmn:Gateway")?{preferredLayouts:["v:h"]}:A(o,"bpmn:Gateway")?{preferredLayouts:["h:v"]}:{preferredLayouts:["h:h"]}),n&&(i=vg(N_(r,o,c,l,a,n=z(n,e)))),i||[c,l])},Mi.$inject=["elementRegistry","graphicsFactory"],Mi.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(xg(i)),o.push(xg(r)),o},Mi.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}},Mi.prototype._getIntersection=function(t,e,n){return Kl(this._getShapePath(t),this._getConnectionPath(e),n)},Mi.prototype._getConnectionPath=function(t){return this._graphicsFactory.getConnectionPath(t)},Mi.prototype._getShapePath=function(t){return this._graphicsFactory.getShapePath(t)},Mi.prototype._getGfx=function(t){return this._elementRegistry.getGraphics(t)};const L_={__init__:["modeling","bpmnUpdater"],__depends__:[p_,f_,v_,y_,ov,g_,x_,E_,__,Mn,Sv,Uy],bpmnFactory:["type",an],bpmnUpdater:["type",Ve],elementFactory:["type",Ti],modeling:["type",xe],layouter:["type",qp],connectionDocking:["type",Mi]};var Cc=Math.round;function Eg(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(Jt(u)&&(p=u,u=!1),!l.waypoints&&l.parent){var d=function(y){return{x:y.x+Cc(y.width/2),y:y.y+Cc(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=Gi(d,"id");return mt(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=Cc(u.x),u.y=Cc(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(Ei(c)){var l=Gr(c);if(!l)throw new Error("must supply DOM mousedown event");return a(l,c.element)}}),this.start=a}Eg.$inject=["eventBus","dragging","modeling","selection","rules"];var Kp="djs-dragging",_g="drop-ok",wg="drop-not-ok",Sg="new-parent",Cg="attach-ok";function Tg(t,e,n,i){function r(c){var l=function(u){var p=mt(u,function(d){return!function(y){return y.waypoints}(d)||kt(u,Ye({id:d.source.id}))&&kt(u,Ye({id:d.target.id}))});return p}(o(c));return l}function o(c){var l=Wa(c,!0),u=ae(l,function(p){return(p.incoming||[]).concat(p.outgoing||[])});return yo(l.concat(u))}function a(c,l){[Cg,_g,wg,Sg].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?yo([p,o(u)]):o(u),function(f){e.addMarker(f,Kp)}),l.allDraggedElements=p,l.differentParents=Ar(Gi(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,Cg):l.canExecute&&p&&p.id!==d.id?a(p,Sg):a(p,l.canExecute?_g:wg)),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,Kp)}),p&&Zt(p)}),this.makeDraggable=function(c,l,u){i.addDragger(l,c.dragGroup),u&&e.addMarker(l,Kp),c.allDraggedElements?c.allDraggedElements.push(l):c.allDraggedElements=[l]}}Tg.$inject=["eventBus","canvas","styles","previewSupport"];const j_={__depends__:[Bo,Mn,Nm,In,Kn,Go],__init__:["move","movePreview"],move:["type",Eg],movePreview:["type",Tg]};var Ag=".djs-palette-toggle",kg=".entry",V_=Ag+", "+kg,Yp="djs-palette-",Jp="open",Pg="two-column";function te(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 F_(t,e){var n=e.getPaletteEntries();return fe(n)?n(t):(L(n,function(i,r){t[r]=i}),t)}te.$inject=["eventBus","canvas"],te.prototype.registerProvider=function(t,e){e||(e=t,t=1e3),this._eventBus.on("palette.getProviders",t,function(n){n.providers.push(e)}),this._rebuild()},te.prototype.getEntries=function(){return this._getProviders().reduce(F_,{})},te.prototype._rebuild=function(){this._diagramInitialized&&this._getProviders().length&&(this._container||this._init(),this._update())},te.prototype._init=function(){var t=this,e=this._eventBus,n=this._getParentContainer(),i=this._container=Lt(te.HTML_MARKUP);n.appendChild(i),ne(n).add(Yp+"shown"),$e.bind(i,V_,"click",function(r){var o=r.delegateTarget;if(Ha(o,Ag))return t.toggle();t.trigger("click",r)}),ct.bind(i,"mousedown",function(r){r.stopPropagation()}),$e.bind(i,kg,"dragstart",function(r){t.trigger("dragstart",r)}),e.on("canvas.resized",this._layoutChanged,this),e.fire("palette.create",{container:i})},te.prototype._getProviders=function(t){var e=this._eventBus.createEvent({type:"palette.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},te.prototype._toggleState=function(t){t=t||{};var e,n=this._getParentContainer(),i=this._container,r=this._eventBus,o=ne(i),a=ne(n);e="twoColumn"in t?t.twoColumn:this._needsCollapse(n.clientHeight,this._entries||{}),o.toggle(Pg,e),a.toggle(Yp+Pg,e),"open"in t&&(o.toggle(Jp,t.open),a.toggle(Yp+Jp,t.open)),r.fire("palette.changed",{twoColumn:e,open:this.isOpen()})},te.prototype._update=function(){var t=Ut(".djs-palette-entries",this._container),e=this._entries=this.getEntries();Ua(t),L(e,function(n,i){var r=n.group||"default",o=Ut("[data-group="+r+"]",t);o||(o=Lt('<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=Lt(a);o.appendChild(c),n.separator||(ze(c,"data-action",i),n.title&&ze(c,"title",n.title),n.className&&function(l,u){var p=ne(l);(gt(u)?u:u.split(/\s+/g)).forEach(function(d){p.add(d)})}(c,n.className),n.imageUrl&&c.appendChild(Lt('<img src="'+n.imageUrl+'">')))}),this.open()},te.prototype.trigger=function(t,e,n){var i,r,o,a=this._entries,c=e.delegateTarget||e.target;if(!c)return e.preventDefault();(i=a[ze(c,"data-action")])&&(r=i.action,o=e.originalEvent||e,fe(r)?t==="click"&&r(o,n):r[t]&&r[t](o,n),e.preventDefault())},te.prototype._layoutChanged=function(){this._toggleState({})},te.prototype._needsCollapse=function(t,e){return t<46*Object.keys(e).length+50},te.prototype.close=function(){this._toggleState({open:!1,twoColumn:!1})},te.prototype.open=function(){this._toggleState({open:!0})},te.prototype.toggle=function(t){this.isOpen()?this.close():this.open()},te.prototype.isActiveTool=function(t){return t&&this._activeTool===t},te.prototype.updateToolHighlight=function(t){var e;this._toolsContainer||(e=Ut(".djs-palette-entries",this._container),this._toolsContainer=Ut("[data-group=tools]",e)),L(this._toolsContainer.children,function(n){var i=n.getAttribute("data-action");if(i){var r=ne(n);i=i.replace("-tool",""),r.contains("entry")&&i===t?r.add("highlighted-entry"):r.remove("highlighted-entry")}})},te.prototype.isOpen=function(){return ne(this._container).has(Jp)},te.prototype._getParentContainer=function(){return this._canvas.getContainer()},te.HTML_MARKUP='<div class="djs-palette"><div class="djs-palette-entries"></div><div class="djs-palette-toggle"></div></div>';const z_={__init__:["palette"],palette:["type",te]};var Mg="crosshair";function or(t,e,n,i,r,o,a){this._selection=r,this._dragging=n,this._mouse=a;var c=this,l=function(d){var y,f=e.getActiveLayer();K(y=d.frame=ot("rect"),{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),lt(f,y)},u=function(d){var y=d.frame,f=d.bbox;K(y,{x:f.x,y:f.y,width:f.width,height:f.height})},p=function(d){d.frame&&Zt(d.frame)};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),t.on("lasso.selection.end",function(d){var y=d.originalEvent.target;(d.hover||y instanceof SVGElement)&&t.once("lasso.selection.ended",function(){c.activateLasso(d.originalEvent,!0)})}),t.on("lasso.end",function(d){var y=Zp(d),f=i.filter(function(v){return v});c.select(f,y)}),t.on("lasso.start",function(d){var y=d.context;y.bbox=Zp(d),l(y)}),t.on("lasso.move",function(d){var y=d.context;y.bbox=Zp(d),u(y)}),t.on("lasso.cleanup",function(d){var y=d.context;p(y)}),t.on("element.mousedown",1500,function(d){if(Mm(d))return c.activateLasso(d.originalEvent),!0})}function Zp(t){var e={x:t.x-t.dx,y:t.y-t.dy},n={x:t.x,y:t.y};return e.x<=n.x&&e.y<n.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}}or.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager","mouse"],or.prototype.activateLasso=function(t,e){this._dragging.init(t,"lasso",{autoActivate:e,cursor:Mg,data:{context:{}}})},or.prototype.activateSelection=function(t,e){this._dragging.init(t,"lasso.selection",{trapClick:!1,autoActivate:e,cursor:Mg,data:{context:{}}})},or.prototype.select=function(t,e){var n=function(i,r){var o={};return L(i,function(a){var c=a;c.waypoints&&(c=ve(c)),!ht(r.y)&&c.x>r.x&&(o[a.id]=a),!ht(r.x)&&c.y>r.y&&(o[a.id]=a),c.x>r.x&&c.y>r.y&&(ht(r.width)&&ht(r.height)&&c.width+c.x<r.width+r.x&&c.height+c.y<r.height+r.y?o[a.id]=a:ht(r.width)&&ht(r.height)||(o[a.id]=a))}),o}(t,e);this._selection.select(Ga(n))},or.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();this.activateSelection(t,!!t)},or.prototype.isActive=function(){var t=this._dragging.context();return t&&/^lasso/.test(t.prefix)};const $_={__depends__:[cc,qo],__init__:["lassoTool"],lassoTool:["type",or]};var Qp=1500,Rg="grab";function no(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",Qp,function(l){if(Ur(l))return a.activateMove(l.originalEvent,!0),!1}),c&&c.addListener(Qp,function(l){if(Ng(l.keyEvent)&&!a.isActive()){var u=a._mouse.getLastMoveEvent();a.activateMove(u,!!u)}},"keyboard.keydown"),c&&c.addListener(Qp,function(l){Ng(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!Ur(l)&&u&&t.once("hand.move.ended",function(p){a.activateHand(p.originalEvent,!0,!0)}),!1})}function Ng(t){return fn(" ",t)}no.$inject=["eventBus","canvas","dragging","injector","toolManager","mouse"],no.prototype.activateMove=function(t,e,n){typeof e=="object"&&(n=e,e=!1),this._dragging.init(t,"hand.move",{autoActivate:e,cursor:Rg,data:{context:n||{}}})},no.prototype.activateHand=function(t,e,n){this._dragging.init(t,"hand",{trapClick:!1,autoActivate:e,cursor:Rg,data:{context:{reactivate:n}}})},no.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();this.activateHand(t,!!t)},no.prototype.isActive=function(){var t=this._dragging.context();return!!t&&/^(hand|hand\.move)$/.test(t.prefix)};const G_={__depends__:[cc,qo],__init__:["handTool"],handTool:["type",no]};var Ig="connect-ok",Dg="connect-not-ok";function io(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?Ig:Dg))}),t.on(["global-connect.out","global-connect.cleanup"],function(l){var u=l.context.startTarget,p=l.context.canStartConnect;u&&i.removeMarker(u,p?Ig:Dg)}),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})}io.$inject=["eventBus","dragging","connect","canvas","toolManager","rules","mouse"],io.prototype.start=function(t,e){this._dragging.init(t,"global-connect",{autoActivate:e,trapClick:!1,data:{context:{}}})},io.prototype.toggle=function(){if(this.isActive())return this._dragging.cancel();var t=this._mouse.getLastMoveEvent();return this.start(t,!!t)},io.prototype.isActive=function(){var t=this._dragging.context();return t&&/^global-connect/.test(t.prefix)},io.prototype.canStartConnect=function(t){return this._rules.allowed("connection.start",{source:t})};const U_={__depends__:[Ru,In,Kn,cc,qo],globalConnect:["type",io]};function Tc(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)}Tc.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],Tc.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 E(w){var C=i.createShape(z({type:y},b));b&&(C.businessObject.di.isExpanded=b.isExpanded),n.start(w,C)}var S=y.replace(/^bpmn:/,"");return{group:f,className:v,title:g||l("Create {type}",{type:S}),action:{dragstart:E,click:E}}}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 H_={__depends__:[z_,ks,Uy,$_,G_,U_,ds],__init__:["paletteProvider"],paletteProvider:["type",Tc]};function th(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=Ut('[data-element-id="'+Au(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=Ut('[data-element-id="'+Au(d)+'"]',l.dragGroup);y&&K(y,{display:"inline"}),p.remove(),u[d]&&delete u[d]})}(a)})}th.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],rt(th,Q);const q_={__depends__:[Go],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",th]};var eh=40,Bg=["x","y"],W_=Math.abs;function Og(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){Bg.forEach(function(d){var y=Vg(d,u);l[d]<u[d]+p?re(l,d,u[d]+p):l[d]>u[d]+y-p&&re(l,d,u[d]+y-p)})}(e,o,function(l){return A(l,"bpmn:Task")?10:20}(o)),o&&function(l,u){return ui(u,function(p){return jg(l,p)})}(i,["bpmn:Association","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:SequenceFlow"])?(n.connectionStart=tn(r),wt(o,["bpmn:Event","bpmn:Gateway"])&&Lg(e,tn(o)),wt(o,["bpmn:Task","bpmn:SubProcess"])&&function(l,u){var p=tn(u);Bg.forEach(function(d){(function(y,f,v){return y[v]>f[v]+20&&y[v]<f[v]+Vg(v,f)-20})(l,u,d)&&re(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,E=g.source;return b&&E&&b===E}(u)){var y=tn(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,E=l[g];W_(E-y[g])<eh&&(b=E>y[g]?y[g]+eh:y[g]-eh,re(l,g,b))})}}(e)):jg(i,"bpmn:MessageFlow")?(A(r,"bpmn:Event")&&(n.connectionStart=tn(r)),A(o,"bpmn:Event")&&Lg(e,tn(o))):n.connectionStart=n.initialConnectionStart)})}function Lg(t,e){re(t,"x",e.x),re(t,"y",e.y)}function jg(t,e){return t&&t.type===e}function Vg(t,e){return t==="x"?e.width:e.height}function Ri(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function Ac(t){this._snapValues={}}Og.$inject=["eventBus"],Ri.prototype.getSnapOrigin=function(t){return this._snapOrigins[t]},Ri.prototype.setSnapOrigin=function(t,e){this._snapOrigins[t]=e,this._snapLocations.indexOf(t)===-1&&this._snapLocations.push(t)},Ri.prototype.addDefaultSnap=function(t,e){var n=this._defaultSnaps[t];n||(n=this._defaultSnaps[t]=[]),n.push(e)},Ri.prototype.getSnapLocations=function(){return this._snapLocations},Ri.prototype.setSnapLocations=function(t){this._snapLocations=t},Ri.prototype.pointsForTarget=function(t){var e=t.id||t,n=this._targets[e];return n||(n=this._targets[e]=new Ac).initDefaults(this._defaultSnaps),n},Ac.prototype.add=function(t,e){var n=this._snapValues[t];n||(n=this._snapValues[t]={x:[],y:[]}),n.x.indexOf(e.x)===-1&&n.x.push(e.x),n.y.indexOf(e.y)===-1&&n.y.push(e.y)},Ac.prototype.snap=function(t,e,n,i){var r=this._snapValues[e];return r&&function(o,a,c){var l,u;for(c=c===void 0?10:c,l=0;l<a.length;l++)if(u=a[l],Zx(u-o)<=c)return u}(t[n],r[n],i)},Ac.prototype.initDefaults=function(t){var e=this;L(t||{},function(n,i){L(n,function(r){e.add(i,r)})})};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"],1250,function(r){var o=r.context,a=o.shape,c=o.snapContext,l=o.target;if((!r.originalEvent||!He(r.originalEvent))&&!Yr(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 nh(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 Ri);var a=(e=n.get(r.id)?tn(r,t):{x:t.x+tn(r).x,y:t.y+tn(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}),nh(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(nh(i))nh(e)&&t.add("mid",tn(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",tn(i))}),ht(e.x)&&ht(e.y)&&this._elementRegistry.get(e.id)&&t.add("mid",tn(e)),t},Bn.prototype.getSnapTargets=function(t,e){return Mf(e).filter(function(n){return!n.hidden})};function ro(t,e){e.invoke(Bn,this),t.on(["create.move","create.end"],1500,X_),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)&&!Yr(n)&&function(a,c){var l,u=st(c),p=yy(a,c),d=a.context,y=d.shape;l=y.parent?{x:0,y:0}:vt(y),/top/.test(p)?re(a,"y",u.top-l.y):/bottom/.test(p)&&re(a,"y",u.bottom-l.y),/left/.test(p)?re(a,"x",u.left-l.x):/right/.test(p)&&re(a,"x",u.right-l.x)}(n,o)})}function X_(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)&&re(t,"x",t.x),(n&&n>=t.y||r&&r<=t.y)&&re(t,"y",t.y)}}function Fg(t,e){return t.indexOf(e)!==-1}function zg(t,e,n){return e?{x:t.x-n.x,y:t.y-n.y}:{x:t.x,y:t.y}}rt(ro,Bn),ro.$inject=["eventBus","injector"],ro.prototype.initSnap=function(t){var e=Bn.prototype.initSnap.call(this,t),n=t.shape,i=!!this._elementRegistry.get(n.id);return L(n.outgoing,function(r){var o=r.waypoints[0];o=o.original||o,e.setSnapOrigin(r.id+"-docking",zg(o,i,t))}),L(n.incoming,function(r){var o=r.waypoints[r.waypoints.length-1];o=o.original||o,e.setSnapOrigin(r.id+"-docking",zg(o,i,t))}),A(n,"bpmn:Participant")&&e.setSnapLocations(["top-left","bottom-right","mid"]),e},ro.prototype.addSnapTargetPoints=function(t,e,n){Bn.prototype.addSnapTargetPoints.call(this,t,e,n);var i=this.getSnapTargets(e,n);L(i,function(o){var a;(function(c){return A(c,"bpmn:SubProcess")&&Pt(c)?!0:A(c,"bpmn:Participant")}(o)||(a="bpmn:TextAnnotation",[e,o].every(function(c){return A(c,a)})))&&(t.add("top-left",kf(o)),t.add("bottom-right",Pf(o)))});var r=this._elementRegistry;return L(e.incoming,function(o){if(r.get(e.id)){Fg(i,o.source)||t.add("mid",vt(o.source));var a=o.waypoints[0];t.add(o.id+"-docking",a.original||a)}}),L(e.outgoing,function(o){if(r.get(e.id)){Fg(i,o.target)||t.add("mid",vt(o.target));var a=o.waypoints[o.waypoints.length-1];t.add(o.id+"-docking",a.original||a)}}),A(n,"bpmn:SequenceFlow")&&(t=this.addSnapTargetPoints(t,e,n.parent)),t},ro.prototype.getSnapTargets=function(t,e){return Bn.prototype.getSnapTargets.call(this,t,e).filter(function(n){return!A(n,"bpmn:Lane")})};function ba(t,e){var n=this;t.on(["resize.start"],function(i){n.initSnap(i)}),t.on(["resize.move","resize.end"],1250,function(i){var r=i.context,o=r.shape,a=o.parent,c=r.direction,l=r.snapContext;if(!(i.originalEvent&&He(i.originalEvent)||Yr(i))){var u=l.pointsForTarget(a);u.initialized||((u=n.addSnapTargetPoints(u,o,a,c)).initialized=!0),function(p){return p==="n"||p==="s"}(c)&&re(i,"x",i.x),function(p){return p==="e"||p==="w"}(c)&&re(i,"y",i.y),e.snap(i,u)}}),t.on(["resize.cleanup"],function(){e.hide()})}function $g(t,e){var n=vt(t),i=st(t),r={x:n.x,y:n.y};return e.indexOf("n")!==-1?r.y=i.top:e.indexOf("s")!==-1&&(r.y=i.bottom),e.indexOf("e")!==-1?r.x=i.right:e.indexOf("w")!==-1&&(r.x=i.left),r}ba.prototype.initSnap=function(t){var e=t.context,n=e.shape,i=e.direction,r=e.snapContext;r||(r=e.snapContext=new Ri);var o=$g(n,i);return r.setSnapOrigin("corner",{x:o.x-t.x,y:o.y-t.y}),r},ba.prototype.addSnapTargetPoints=function(t,e,n,i){return L(this.getSnapTargets(e,n),function(r){t.add("corner",Pf(r)),t.add("corner",kf(r))}),t.add("corner",$g(e,i)),t},ba.$inject=["eventBus","snapping"],ba.prototype.getSnapTargets=function(t,e){return Mf(e).filter(function(n){return i=n,r=t,!(i.host===r||function(o){return!!o.waypoints}(n)||function(o){return!!o.hidden}(n)||function(o){return!!o.labelTarget}(n));var i,r})};function Ni(t){this._canvas=t,this._asyncHide=Tl(_e(this.hide,this),1e3)}Ni.$inject=["canvas"],Ni.prototype.snap=function(t,e){var n=t.context.snapContext,i=n.getSnapLocations(),r={x:Yr(t,"x"),y:Yr(t,"y")};L(i,function(o){var a=n.getSnapOrigin(o),c={x:t.x+a.x,y:t.y+a.y};if(L(["x","y"],function(l){var u;r[l]||(u=e.snap(c,o,l,7))!==void 0&&(r[l]={value:u,originValue:u-a[l]})}),r.x&&r.y)return!1}),this.showSnapLine("vertical",r.x&&r.x.value),this.showSnapLine("horizontal",r.y&&r.y.value),L(["x","y"],function(o){var a=r[o];Jt(a)&&re(t,o,a.originValue)})},Ni.prototype._createLine=function(t){var e=this._canvas.getLayer("snap"),n=ot("path");return K(n,{d:"M0,0 L0,0"}),bt(n).add("djs-snap-line"),lt(e,n),{update:function(i){ht(i)?K(n,t==="horizontal"?{d:"M-100000,"+i+" L+100000,"+i,display:""}:{d:"M "+i+",-100000 L "+i+", +100000",display:""}):K(n,{display:"none"})}}},Ni.prototype._createSnapLines=function(){this._snapLines={horizontal:this._createLine("horizontal"),vertical:this._createLine("vertical")}},Ni.prototype.showSnapLine=function(t,e){var n=this.getSnapLine(t);n&&n.update(e),this._asyncHide()},Ni.prototype.getSnapLine=function(t){return this._snapLines||this._createSnapLines(),this._snapLines[t]},Ni.prototype.hide=function(){L(this._snapLines,function(t){t.update()})};const K_={__depends__:[{__init__:["createMoveSnapping","resizeSnapping","snapping"],createMoveSnapping:["type",Bn],resizeSnapping:["type",ba],snapping:["type",Ni]}],__init__:["connectSnapping","createMoveSnapping"],connectSnapping:["type",Og],createMoveSnapping:["type",ro]};function ut(t,e,n,i){this._open=!1,this._results=[],this._eventMaps=[],this._canvas=t,this._eventBus=e,this._overlays=n,this._selection=i,this._container=Lt(ut.BOX_HTML),this._searchInput=Ut(ut.INPUT_SELECTOR,this._container),this._resultsContainer=Ut(ut.RESULTS_CONTAINER_SELECTOR,this._container),this._canvas.getContainer().appendChild(this._container),e.on(["canvas.destroy","diagram.destroy"],this.close,this)}function Gg(t,e,n){var i=function(o){var a="";return o.forEach(function(c){c.matched?a+='<strong class="'+ut.RESULT_HIGHLIGHT_CLASS+'">'+df(c.matched)+"</strong>":a+=df(c.normal)}),a!==""?a:null}(e),r=Lt(n);r.innerHTML=i,t.appendChild(r)}ut.$inject=["canvas","eventBus","overlays","selection"],ut.prototype._bindEvents=function(){var t=this;function e(n,i,r,o){t._eventMaps.push({el:n,type:r,listener:$e.bind(n,i,r,o)})}e(document,"html","click",function(n){t.close()}),e(this._container,ut.INPUT_SELECTOR,"click",function(n){n.stopPropagation(),n.delegateTarget.focus()}),e(this._container,ut.RESULT_SELECTOR,"mouseover",function(n){n.stopPropagation(),t._scrollToNode(n.delegateTarget),t._preselect(n.delegateTarget)}),e(this._container,ut.RESULT_SELECTOR,"click",function(n){n.stopPropagation(),t._select(n.delegateTarget)}),e(this._container,ut.INPUT_SELECTOR,"keydown",function(n){n.keyCode===38&&n.preventDefault(),n.keyCode===40&&n.preventDefault()}),e(this._container,ut.INPUT_SELECTOR,"keyup",function(n){if(n.keyCode===27)return t.close();if(n.keyCode===13){var i=t._getCurrentResult();return i?t._select(i):t.close()}return n.keyCode===38?t._scrollToDirection(!0):n.keyCode===40?t._scrollToDirection():void(n.keyCode!==37&&n.keyCode!==39&&t._search(n.delegateTarget.value))})},ut.prototype._unbindEvents=function(){this._eventMaps.forEach(function(t){$e.unbind(t.el,t.type,t.listener)})},ut.prototype._search=function(t){var e=this;if(this._clearResults(),t&&t!==""){var n=this._searchProvider.find(t);if(n.length){n.forEach(function(r){var o=r.element.id,a=e._createResultNode(r,o);e._results[o]={element:r.element,node:a}});var i=Ut(ut.RESULT_SELECTOR,this._resultsContainer);this._scrollToNode(i),this._preselect(i)}}},ut.prototype._scrollToDirection=function(t){var e=this._getCurrentResult();if(e){var n=t?e.previousElementSibling:e.nextElementSibling;n&&(this._scrollToNode(n),this._preselect(n))}},ut.prototype._scrollToNode=function(t){if(t&&t!==this._getCurrentResult()){var e=t.offsetTop,n=this._resultsContainer.scrollTop,i=e-this._resultsContainer.clientHeight+t.clientHeight;e<n?this._resultsContainer.scrollTop=e:n<i&&(this._resultsContainer.scrollTop=i)}},ut.prototype._clearResults=function(){Ua(this._resultsContainer),this._results=[],this._resetOverlay(),this._eventBus.fire("searchPad.cleared")},ut.prototype._getCurrentResult=function(){return Ut(ut.RESULT_SELECTED_SELECTOR,this._resultsContainer)},ut.prototype._createResultNode=function(t,e){var n=Lt(ut.RESULT_HTML);return t.primaryTokens.length>0&&Gg(n,t.primaryTokens,ut.RESULT_PRIMARY_HTML),Gg(n,t.secondaryTokens,ut.RESULT_SECONDARY_HTML),ze(n,ut.RESULT_ID_ATTRIBUTE,e),this._resultsContainer.appendChild(n),n},ut.prototype.registerProvider=function(t){this._searchProvider=t},ut.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,ne(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},ut.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,ne(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},ut.prototype.toggle=function(){this.isOpen()?this.close():this.open()},ut.prototype.isOpen=function(){return this._open},ut.prototype._preselect=function(t){var e=this._getCurrentResult();if(t!==e){e&&ne(e).remove(ut.RESULT_SELECTED_CLASS);var n=ze(t,ut.RESULT_ID_ATTRIBUTE),i=this._results[n].element;ne(t).add(ut.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._canvas.scrollToElement(i,{top:400}),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},ut.prototype._select=function(t){var e=ze(t,ut.RESULT_ID_ATTRIBUTE),n=this._results[e].element;this.close(),this._resetOverlay(),this._canvas.scrollToElement(n,{top:400}),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},ut.prototype._resetOverlay=function(t){if(this._overlayId&&this._overlays.remove(this._overlayId),t){var e=function(n){var i=6,r=n.width+2*i,o=n.height+2*i,a=["width: "+r+"px","height: "+o+"px"].join("; ");return{position:{bottom:o-i,right:r-i},show:!0,html:'<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 Y_={__depends__:[pu,Mn],searchPad:["type",ut]};function ih(t,e,n){this._elementRegistry=t,this._canvas=n,e.registerProvider(this)}function Ug(t){return mt(t,function(e){return!!e.matched}).length>0}function Hg(t,e){var n=[],i=t;if(!t)return n;t=t.toLowerCase(),e=e.toLowerCase();var r=t.indexOf(e);return r>-1?(r!==0&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,e.length)}),e.length+r<t.length&&n.push({normal:i.substr(e.length+r,t.length)})):n.push({normal:i}),n}ih.$inject=["elementRegistry","searchPad","canvas"],ih.prototype.find=function(t){var e=this._canvas.getRootElement(),n=this._elementRegistry.filter(function(i){return!i.labelTarget});return n=mt(n,function(i){return i!==e}),n=Ke(n=mt(n=ae(n,function(i){return{primaryTokens:Hg(mn(i),t),secondaryTokens:Hg(i.id,t),element:i}}),function(i){return Ug(i.primaryTokens)||Ug(i.secondaryTokens)}),function(i){return mn(i.element)+i.element.id})};const J_={__depends__:[Y_],__init__:["bpmnSearch"],bpmnSearch:["type",ih]};function On(t){No.call(this,t)}rt(On,No),On.Viewer=Wn,On.NavigatedViewer=jo,On.prototype.createDiagram=Vr(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=[$m,qm,Lx,Xm],On.prototype._modelingModules=[Vx,Ux,Xx,Hx,tE,Ru,eE,ME,ev,ks,IE,BE,jE,VE,FE,UE,XE,L_,j_,H_,q_,Mv,K_,J_],On.prototype._modules=[].concat(Wn.prototype._modules,On.prototype._interactionModules,On.prototype._modelingModules);const qg=(t,e,n)=>(n||(n="camunda"),`<?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>`),Z_={"Append EndEvent":"\u8FFD\u52A0\u7ED3\u675F\u4E8B\u4EF6","Append Gateway":"\u8FFD\u52A0\u7F51\u5173","Append Task":"\u8FFD\u52A0\u4EFB\u52A1","Append Intermediate/Boundary Event":"\u8FFD\u52A0\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6/\u8FB9\u754C\u4E8B\u4EF6","Activate the global connect tool":"\u6FC0\u6D3B\u5168\u5C40\u8FDE\u63A5\u5DE5\u5177","Append {type}":"\u6DFB\u52A0 {type}","Add Lane above":"\u5728\u4E0A\u9762\u6DFB\u52A0\u9053","Divide into two Lanes":"\u5206\u5272\u6210\u4E24\u4E2A\u9053","Divide into three Lanes":"\u5206\u5272\u6210\u4E09\u4E2A\u9053","Add Lane below":"\u5728\u4E0B\u9762\u6DFB\u52A0\u9053","Append compensation activity":"\u8FFD\u52A0\u8865\u507F\u6D3B\u52A8","Change type":"\u4FEE\u6539\u7C7B\u578B","Connect using Association":"\u4F7F\u7528\u5173\u8054\u8FDE\u63A5","Connect using Sequence/MessageFlow or Association":"\u4F7F\u7528\u987A\u5E8F/\u6D88\u606F\u6D41\u6216\u8005\u5173\u8054\u8FDE\u63A5","Connect using DataInputAssociation":"\u4F7F\u7528\u6570\u636E\u8F93\u5165\u5173\u8054\u8FDE\u63A5",Remove:"\u79FB\u9664","Activate the hand tool":"\u6FC0\u6D3B\u6293\u624B\u5DE5\u5177","Activate the lasso tool":"\u6FC0\u6D3B\u5957\u7D22\u5DE5\u5177","Activate the create/remove space tool":"\u6FC0\u6D3B\u521B\u5EFA/\u5220\u9664\u7A7A\u95F4\u5DE5\u5177","Create expanded SubProcess":"\u521B\u5EFA\u6269\u5C55\u5B50\u8FC7\u7A0B","Create IntermediateThrowEvent/BoundaryEvent":"\u521B\u5EFA\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6/\u8FB9\u754C\u4E8B\u4EF6","Create Pool/Participant":"\u521B\u5EFA\u6C60/\u53C2\u4E0E\u8005","Parallel Multi Instance":"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6","Sequential Multi Instance":"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",DataObjectReference:"\u6570\u636E\u5BF9\u8C61\u53C2\u8003",DataStoreReference:"\u6570\u636E\u5B58\u50A8\u53C2\u8003",Loop:"\u5FAA\u73AF","Ad-hoc":"\u5373\u5E2D","Create {type}":"\u521B\u5EFA {type}",Task:"\u4EFB\u52A1","Send Task":"\u53D1\u9001\u4EFB\u52A1","Receive Task":"\u63A5\u6536\u4EFB\u52A1","User Task":"\u7528\u6237\u4EFB\u52A1","Manual Task":"\u624B\u5DE5\u4EFB\u52A1","Business Rule Task":"\u4E1A\u52A1\u89C4\u5219\u4EFB\u52A1","Service Task":"\u670D\u52A1\u4EFB\u52A1","Script Task":"\u811A\u672C\u4EFB\u52A1","Call Activity":"\u8C03\u7528\u6D3B\u52A8","Sub Process (collapsed)":"\u5B50\u6D41\u7A0B\uFF08\u6298\u53E0\u7684\uFF09","Sub Process (expanded)":"\u5B50\u6D41\u7A0B\uFF08\u5C55\u5F00\u7684\uFF09","Start Event":"\u5F00\u59CB\u4E8B\u4EF6",StartEvent:"\u5F00\u59CB\u4E8B\u4EF6","Intermediate Throw Event":"\u4E2D\u95F4\u4E8B\u4EF6","End Event":"\u7ED3\u675F\u4E8B\u4EF6",EndEvent:"\u7ED3\u675F\u4E8B\u4EF6","Create StartEvent":"\u521B\u5EFA\u5F00\u59CB\u4E8B\u4EF6","Create EndEvent":"\u521B\u5EFA\u7ED3\u675F\u4E8B\u4EF6","Create Task":"\u521B\u5EFA\u4EFB\u52A1","Create User Task":"\u521B\u5EFA\u7528\u6237\u4EFB\u52A1","Create Gateway":"\u521B\u5EFA\u7F51\u5173","Create DataObjectReference":"\u521B\u5EFA\u6570\u636E\u5BF9\u8C61","Create DataStoreReference":"\u521B\u5EFA\u6570\u636E\u5B58\u50A8","Create Group":"\u521B\u5EFA\u5206\u7EC4","Create Intermediate/Boundary Event":"\u521B\u5EFA\u4E2D\u95F4/\u8FB9\u754C\u4E8B\u4EF6","Message Start Event":"\u6D88\u606F\u5F00\u59CB\u4E8B\u4EF6","Timer Start Event":"\u5B9A\u65F6\u5F00\u59CB\u4E8B\u4EF6","Conditional Start Event":"\u6761\u4EF6\u5F00\u59CB\u4E8B\u4EF6","Signal Start Event":"\u4FE1\u53F7\u5F00\u59CB\u4E8B\u4EF6","Error Start Event":"\u9519\u8BEF\u5F00\u59CB\u4E8B\u4EF6","Escalation Start Event":"\u5347\u7EA7\u5F00\u59CB\u4E8B\u4EF6","Compensation Start Event":"\u8865\u507F\u5F00\u59CB\u4E8B\u4EF6","Message Start Event (non-interrupting)":"\u6D88\u606F\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Timer Start Event (non-interrupting)":"\u5B9A\u65F6\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Conditional Start Event (non-interrupting)":"\u6761\u4EF6\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Signal Start Event (non-interrupting)":"\u4FE1\u53F7\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Escalation Start Event (non-interrupting)":"\u5347\u7EA7\u5F00\u59CB\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Message Intermediate Catch Event":"\u6D88\u606F\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Message Intermediate Throw Event":"\u6D88\u606F\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Timer Intermediate Catch Event":"\u5B9A\u65F6\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Escalation Intermediate Throw Event":"\u5347\u7EA7\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Conditional Intermediate Catch Event":"\u6761\u4EF6\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Link Intermediate Catch Event":"\u94FE\u63A5\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Link Intermediate Throw Event":"\u94FE\u63A5\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Compensation Intermediate Throw Event":"\u8865\u507F\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Signal Intermediate Catch Event":"\u4FE1\u53F7\u4E2D\u95F4\u6355\u83B7\u4E8B\u4EF6","Signal Intermediate Throw Event":"\u4FE1\u53F7\u4E2D\u95F4\u629B\u51FA\u4E8B\u4EF6","Message End Event":"\u6D88\u606F\u7ED3\u675F\u4E8B\u4EF6","Escalation End Event":"\u5B9A\u65F6\u7ED3\u675F\u4E8B\u4EF6","Error End Event":"\u9519\u8BEF\u7ED3\u675F\u4E8B\u4EF6","Cancel End Event":"\u53D6\u6D88\u7ED3\u675F\u4E8B\u4EF6","Compensation End Event":"\u8865\u507F\u7ED3\u675F\u4E8B\u4EF6","Signal End Event":"\u4FE1\u53F7\u7ED3\u675F\u4E8B\u4EF6","Terminate End Event":"\u7EC8\u6B62\u7ED3\u675F\u4E8B\u4EF6","Message Boundary Event":"\u6D88\u606F\u8FB9\u754C\u4E8B\u4EF6","Message Boundary Event (non-interrupting)":"\u6D88\u606F\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Timer Boundary Event":"\u5B9A\u65F6\u8FB9\u754C\u4E8B\u4EF6","Timer Boundary Event (non-interrupting)":"\u5B9A\u65F6\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Escalation Boundary Event":"\u5347\u7EA7\u8FB9\u754C\u4E8B\u4EF6","Escalation Boundary Event (non-interrupting)":"\u5347\u7EA7\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Conditional Boundary Event":"\u6761\u4EF6\u8FB9\u754C\u4E8B\u4EF6","Conditional Boundary Event (non-interrupting)":"\u6761\u4EF6\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Error Boundary Event":"\u9519\u8BEF\u8FB9\u754C\u4E8B\u4EF6","Cancel Boundary Event":"\u53D6\u6D88\u8FB9\u754C\u4E8B\u4EF6","Signal Boundary Event":"\u4FE1\u53F7\u8FB9\u754C\u4E8B\u4EF6","Signal Boundary Event (non-interrupting)":"\u4FE1\u53F7\u8FB9\u754C\u4E8B\u4EF6\uFF08\u975E\u4E2D\u65AD\uFF09","Compensation Boundary Event":"\u8865\u507F\u8FB9\u754C\u4E8B\u4EF6","Exclusive Gateway":"\u4E92\u65A5\u7F51\u5173","Parallel Gateway":"\u5E76\u884C\u7F51\u5173","Inclusive Gateway":"\u76F8\u5BB9\u7F51\u5173","Complex Gateway":"\u590D\u6742\u7F51\u5173","Event based Gateway":"\u4E8B\u4EF6\u7F51\u5173",Transaction:"\u8F6C\u8FD0","Sub Process":"\u5B50\u6D41\u7A0B","Event Sub Process":"\u4E8B\u4EF6\u5B50\u6D41\u7A0B","Collapsed Pool":"\u6298\u53E0\u6C60","Expanded Pool":"\u5C55\u5F00\u6C60","no parent for {element} in {parent}":"\u5728{parent}\u91CC\uFF0C{element}\u6CA1\u6709\u7236\u7C7B","no shape type specified":"\u6CA1\u6709\u6307\u5B9A\u7684\u5F62\u72B6\u7C7B\u578B","flow elements must be children of pools/participants":"\u6D41\u5143\u7D20\u5FC5\u987B\u662F\u6C60/\u53C2\u4E0E\u8005\u7684\u5B50\u7C7B","out of bounds release":"out of bounds release","more than {count} child lanes":"\u5B50\u9053\u5927\u4E8E{count} ","element required":"\u5143\u7D20\u4E0D\u80FD\u4E3A\u7A7A","diagram not part of bpmn:Definitions":"\u6D41\u7A0B\u56FE\u4E0D\u7B26\u5408bpmn\u89C4\u8303","no diagram to display":"\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u6D41\u7A0B\u56FE","no process or collaboration to display":"\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u6D41\u7A0B/\u534F\u4F5C","element {element} referenced by {referenced}#{property} not yet drawn":"\u7531{referenced}#{property}\u5F15\u7528\u7684{element}\u5143\u7D20\u4ECD\u672A\u7ED8\u5236","already rendered {element}":"{element} \u5DF2\u88AB\u6E32\u67D3","failed to import {element}":"\u5BFC\u5165{element}\u5931\u8D25",Id:"\u7F16\u53F7",Name:"\u540D\u79F0",General:"\u5E38\u89C4",Details:"\u8BE6\u60C5","Message Name":"\u6D88\u606F\u540D\u79F0",Message:"\u6D88\u606F",Initiator:"\u521B\u5EFA\u8005","Asynchronous Continuations":"\u6301\u7EED\u5F02\u6B65","Asynchronous Before":"\u5F02\u6B65\u524D","Asynchronous After":"\u5F02\u6B65\u540E","Job Configuration":"\u5DE5\u4F5C\u914D\u7F6E",Exclusive:"\u6392\u9664","Job Priority":"\u5DE5\u4F5C\u4F18\u5148\u7EA7","Retry Time Cycle":"\u91CD\u8BD5\u65F6\u95F4\u5468\u671F",Documentation:"\u6587\u6863","Element Documentation":"\u5143\u7D20\u6587\u6863","History Configuration":"\u5386\u53F2\u914D\u7F6E","History Time To Live":"\u5386\u53F2\u7684\u751F\u5B58\u65F6\u95F4",Forms:"\u8868\u5355","Form Key":"\u8868\u5355key","Form Fields":"\u8868\u5355\u5B57\u6BB5","Business Key":"\u4E1A\u52A1key","Form Field":"\u8868\u5355\u5B57\u6BB5",ID:"\u7F16\u53F7",Type:"\u7C7B\u578B",Label:"\u540D\u79F0","Default Value":"\u9ED8\u8BA4\u503C","Default Flow":"\u9ED8\u8BA4\u6D41\u8F6C\u8DEF\u5F84","Conditional Flow":"\u6761\u4EF6\u6D41\u8F6C\u8DEF\u5F84","Sequence Flow":"\u666E\u901A\u6D41\u8F6C\u8DEF\u5F84",Validation:"\u6821\u9A8C","Add Constraint":"\u6DFB\u52A0\u7EA6\u675F",Config:"\u914D\u7F6E",Properties:"\u5C5E\u6027","Add Property":"\u6DFB\u52A0\u5C5E\u6027",Value:"\u503C",Listeners:"\u76D1\u542C\u5668","Execution Listener":"\u6267\u884C\u76D1\u542C","Event Type":"\u4E8B\u4EF6\u7C7B\u578B","Listener Type":"\u76D1\u542C\u5668\u7C7B\u578B","Java Class":"Java\u7C7B",Expression:"\u8868\u8FBE\u5F0F","Must provide a value":"\u5FC5\u987B\u63D0\u4F9B\u4E00\u4E2A\u503C","Delegate Expression":"\u4EE3\u7406\u8868\u8FBE\u5F0F",Script:"\u811A\u672C","Script Format":"\u811A\u672C\u683C\u5F0F","Script Type":"\u811A\u672C\u7C7B\u578B","Inline Script":"\u5185\u8054\u811A\u672C","External Script":"\u5916\u90E8\u811A\u672C",Resource:"\u8D44\u6E90","Field Injection":"\u5B57\u6BB5\u6CE8\u5165",Extensions:"\u6269\u5C55","Input/Output":"\u8F93\u5165/\u8F93\u51FA","Input Parameters":"\u8F93\u5165\u53C2\u6570","Output Parameters":"\u8F93\u51FA\u53C2\u6570",Parameters:"\u53C2\u6570","Output Parameter":"\u8F93\u51FA\u53C2\u6570","Timer Definition Type":"\u5B9A\u65F6\u5668\u5B9A\u4E49\u7C7B\u578B","Timer Definition":"\u5B9A\u65F6\u5668\u5B9A\u4E49",Date:"\u65E5\u671F",Duration:"\u6301\u7EED",Cycle:"\u5FAA\u73AF",Signal:"\u4FE1\u53F7","Signal Name":"\u4FE1\u53F7\u540D\u79F0",Escalation:"\u5347\u7EA7",Error:"\u9519\u8BEF","Link Name":"\u94FE\u63A5\u540D\u79F0",Condition:"\u6761\u4EF6\u540D\u79F0","Variable Name":"\u53D8\u91CF\u540D\u79F0","Variable Event":"\u53D8\u91CF\u4E8B\u4EF6","Specify more than one variable change event as a comma separated list.":"\u591A\u4E2A\u53D8\u91CF\u4E8B\u4EF6\u4EE5\u9017\u53F7\u9694\u5F00","Wait for Completion":"\u7B49\u5F85\u5B8C\u6210","Activity Ref":"\u6D3B\u52A8\u53C2\u8003","Version Tag":"\u7248\u672C\u6807\u7B7E",Executable:"\u53EF\u6267\u884C\u6587\u4EF6","External Task Configuration":"\u6269\u5C55\u4EFB\u52A1\u914D\u7F6E","Task Priority":"\u4EFB\u52A1\u4F18\u5148\u7EA7",External:"\u5916\u90E8",Connector:"\u8FDE\u63A5\u5668","Must configure Connector":"\u5FC5\u987B\u914D\u7F6E\u8FDE\u63A5\u5668","Connector Id":"\u8FDE\u63A5\u5668\u7F16\u53F7",Implementation:"\u5B9E\u73B0\u65B9\u5F0F","Field Injections":"\u5B57\u6BB5\u6CE8\u5165",Fields:"\u5B57\u6BB5","Result Variable":"\u7ED3\u679C\u53D8\u91CF",Topic:"\u4E3B\u9898","Configure Connector":"\u914D\u7F6E\u8FDE\u63A5\u5668","Input Parameter":"\u8F93\u5165\u53C2\u6570",Assignee:"\u4EE3\u7406\u4EBA","Candidate Users":"\u5019\u9009\u7528\u6237","Candidate Groups":"\u5019\u9009\u7EC4","Due Date":"\u5230\u671F\u65F6\u95F4","Follow Up Date":"\u8DDF\u8E2A\u65E5\u671F",Priority:"\u4F18\u5148\u7EA7","The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"\u8DDF\u8E2A\u65E5\u671F\u5FC5\u987B\u7B26\u5408EL\u8868\u8FBE\u5F0F\uFF0C\u5982\uFF1A ${someDate} ,\u6216\u8005\u4E00\u4E2AISO\u6807\u51C6\u65E5\u671F\uFF0C\u5982\uFF1A2015-06-26T09:54:00","The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"\u8DDF\u8E2A\u65E5\u671F\u5FC5\u987B\u7B26\u5408EL\u8868\u8FBE\u5F0F\uFF0C\u5982\uFF1A ${someDate} ,\u6216\u8005\u4E00\u4E2AISO\u6807\u51C6\u65E5\u671F\uFF0C\u5982\uFF1A2015-06-26T09:54:00",Variables:"\u53D8\u91CF","Candidate Starter Configuration":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u914D\u7F6E","Candidate Starter Groups":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u7EC4","This maps to the process definition key.":"\u8FD9\u6620\u5C04\u5230\u6D41\u7A0B\u5B9A\u4E49\u952E\u3002","Candidate Starter Users":"\u5019\u9009\u4EBA\u8D77\u52A8\u5668\u7684\u7528\u6237","Specify more than one user as a comma separated list.":"\u6307\u5B9A\u591A\u4E2A\u7528\u6237\u4F5C\u4E3A\u9017\u53F7\u5206\u9694\u7684\u5217\u8868\u3002","Tasklist Configuration":"Tasklist\u914D\u7F6E",Startable:"\u542F\u52A8","Specify more than one group as a comma separated list.":"\u6307\u5B9A\u591A\u4E2A\u7EC4\u4F5C\u4E3A\u9017\u53F7\u5206\u9694\u7684\u5217\u8868\u3002"};var kc,rh,Q_={exports:{}};/*!
- * svg.js - A lightweight library for manipulating and animating SVG.
- * @version 2.7.1
- * https://svgdotjs.github.io/
- *
- * @copyright Wout Fierens <wout@mick-wout.com>
- * @license MIT
- *
- * BUILT: Fri Nov 30 2018 10:01:55 GMT+0100 (GMT+01:00)
- */kc=typeof window<"u"?window:Yh,rh=function(t,e){var n=(this!==void 0?this:t).SVG=function(s){if(n.supported)return s=new n.Doc(s),n.parser.draw||n.prepare(),s};if(n.ns="http://www.w3.org/2000/svg",n.xmlns="http://www.w3.org/2000/xmlns/",n.xlink="http://www.w3.org/1999/xlink",n.svgjs="http://svgjs.com/svgjs",n.supported=!!e.createElementNS&&!!e.createElementNS(n.ns,"svg").createSVGRect,!n.supported)return!1;n.did=1e3,n.eid=function(s){return"Svgjs"+d(s)+n.did++},n.create=function(s){var h=e.createElementNS(this.ns,s);return h.setAttribute("id",this.eid(s)),h},n.extend=function(){var s,h,m,_;for(h=(s=[].slice.call(arguments)).pop(),_=s.length-1;_>=0;_--)if(s[_])for(m in h)s[_].prototype[m]=h[m];n.Set&&n.Set.inherit&&n.Set.inherit()},n.invent=function(s){var h=typeof s.create=="function"?s.create:function(){this.constructor.call(this,n.create(s.create))};return s.inherit&&(h.prototype=new s.inherit),s.extend&&n.extend(h,s.extend),s.construct&&n.extend(s.parent||n.Container,s.construct),h},n.adopt=function(s){return s?s.instance?s.instance:((h=s.nodeName=="svg"?s.parentNode instanceof t.SVGElement?new n.Nested:new n.Doc:s.nodeName=="linearGradient"?new n.Gradient("linear"):s.nodeName=="radialGradient"?new n.Gradient("radial"):n[d(s.nodeName)]?new n[d(s.nodeName)]:new n.Element(s)).type=s.nodeName,h.node=s,s.instance=h,h instanceof n.Doc&&h.namespace().defs(),h.setData(JSON.parse(s.getAttribute("svgjs:data"))||{}),h):null;var h},n.prepare=function(){var s=e.getElementsByTagName("body")[0],h=(s?new n.Doc(s):n.adopt(e.documentElement).nested()).size(2,0);n.parser={body:s||e.documentElement,draw:h.style("opacity:0;position:absolute;left:-100%;top:-100%;overflow:hidden").attr("focusable","false").node,poly:h.polyline().node,path:h.path().node,native:n.create("svg")}},n.parser={native:n.create("svg")},e.addEventListener("DOMContentLoaded",function(){n.parser.draw||n.prepare()},!1),n.regex={numberAndUnit:/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,hex:/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,rgb:/rgb\((\d+),(\d+),(\d+)\)/,reference:/#([a-z0-9\-_]+)/i,transforms:/\)\s*,?\s*/,whitespace:/\s/g,isHex:/^#[a-f0-9]{3,6}$/i,isRgb:/^rgb\(/,isCss:/[^:]+:[^;]+;?/,isBlank:/^(\s+)?$/,isNumber:/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,isPercent:/^-?[\d\.]+%$/,isImage:/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,delimiter:/[\s,]+/,hyphen:/([^e])\-/gi,pathLetters:/[MLHVCSQTAZ]/gi,isPathLetter:/[MLHVCSQTAZ]/i,numbersWithDots:/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,dots:/\./g},n.utils={map:function(s,h){var m,_=s.length,T=[];for(m=0;m<_;m++)T.push(h(s[m]));return T},filter:function(s,h){var m,_=s.length,T=[];for(m=0;m<_;m++)h(s[m])&&T.push(s[m]);return T},radians:function(s){return s%360*Math.PI/180},degrees:function(s){return 180*s/Math.PI%360},filterSVGElements:function(s){return this.filter(s,function(h){return h instanceof t.SVGElement})}},n.defaults={attrs:{"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","font-size":16,"font-family":"Helvetica, Arial, sans-serif","text-anchor":"start"}},n.Color=function(s){var h,m;this.r=0,this.g=0,this.b=0,s&&(typeof s=="string"?n.regex.isRgb.test(s)?(h=n.regex.rgb.exec(s.replace(n.regex.whitespace,"")),this.r=parseInt(h[1]),this.g=parseInt(h[2]),this.b=parseInt(h[3])):n.regex.isHex.test(s)&&(h=n.regex.hex.exec((m=s).length==4?["#",m.substring(1,2),m.substring(1,2),m.substring(2,3),m.substring(2,3),m.substring(3,4),m.substring(3,4)].join(""):m),this.r=parseInt(h[1],16),this.g=parseInt(h[2],16),this.b=parseInt(h[3],16)):typeof s=="object"&&(this.r=s.r,this.g=s.g,this.b=s.b))},n.extend(n.Color,{toString:function(){return this.toHex()},toHex:function(){return"#"+y(this.r)+y(this.g)+y(this.b)},toRgb:function(){return"rgb("+[this.r,this.g,this.b].join()+")"},brightness:function(){return this.r/255*.3+this.g/255*.59+this.b/255*.11},morph:function(s){return this.destination=new n.Color(s),this},at:function(s){return this.destination?(s=s<0?0:s>1?1:s,new n.Color({r:~~(this.r+(this.destination.r-this.r)*s),g:~~(this.g+(this.destination.g-this.g)*s),b:~~(this.b+(this.destination.b-this.b)*s)})):this}}),n.Color.test=function(s){return s+="",n.regex.isHex.test(s)||n.regex.isRgb.test(s)},n.Color.isRgb=function(s){return s&&typeof s.r=="number"&&typeof s.g=="number"&&typeof s.b=="number"},n.Color.isColor=function(s){return n.Color.isRgb(s)||n.Color.test(s)},n.Array=function(s,h){(s=(s||[]).valueOf()).length==0&&h&&(s=h.valueOf()),this.value=this.parse(s)},n.extend(n.Array,{morph:function(s){if(this.destination=this.parse(s),this.value.length!=this.destination.length){for(var h=this.value[this.value.length-1],m=this.destination[this.destination.length-1];this.value.length>this.destination.length;)this.destination.push(m);for(;this.value.length<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,_=[];h<m;h++)_.push(this.value[h]+(this.destination[h]-this.value[h])*s);return new n.Array(_)},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,_=[];h<m;h++)_.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(_)},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,_=s.length;m<_;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 _=this.value.length-1;_>=0;_--)this.value[_]=[this.value[_][0]+s,this.value[_][1]+h];return this},size:function(s,h){var m,_=this.bbox();for(m=this.value.length-1;m>=0;m--)_.width&&(this.value[m][0]=(this.value[m][0]-_.x)*s/_.width+_.x),_.height&&(this.value[m][1]=(this.value[m][1]-_.y)*h/_.height+_.y);return this},bbox:function(){return n.parser.poly.setAttribute("points",this.toString()),n.parser.poly.getBBox()}});for(var i={M:function(s,h,m){return h.x=m.x=s[0],h.y=m.y=s[1],["M",h.x,h.y]},L:function(s,h){return h.x=s[0],h.y=s[1],["L",s[0],s[1]]},H:function(s,h){return h.x=s[0],["H",s[0]]},V:function(s,h){return h.y=s[0],["V",s[0]]},C:function(s,h){return h.x=s[4],h.y=s[5],["C",s[0],s[1],s[2],s[3],s[4],s[5]]},S:function(s,h){return h.x=s[2],h.y=s[3],["S",s[0],s[1],s[2],s[3]]},Q:function(s,h){return h.x=s[2],h.y=s[3],["Q",s[0],s[1],s[2],s[3]]},T:function(s,h){return h.x=s[0],h.y=s[1],["T",s[0],s[1]]},Z:function(s,h,m){return h.x=m.x,h.y=m.y,["Z"]},A:function(s,h){return h.x=s[5],h.y=s[6],["A",s[0],s[1],s[2],s[3],s[4],s[5],s[6]]}},r="mlhvqtcsaz".split(""),o=0,a=r.length;o<a;++o)i[r[o]]=function(s){return function(h,m,_){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,_)}}(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,_="";h<m;h++)_+=s[h][0],s[h][1]!=null&&(_+=s[h][1],s[h][2]!=null&&(_+=" ",_+=s[h][2],s[h][3]!=null&&(_+=" ",_+=s[h][3],_+=" ",_+=s[h][4],s[h][5]!=null&&(_+=" ",_+=s[h][5],_+=" ",_+=s[h][6],s[h][7]!=null&&(_+=" ",_+=s[h][7])))));return _+" "}(this.value)},move:function(s,h){var m=this.bbox();if(s-=m.x,h-=m.y,!isNaN(s)&&!isNaN(h))for(var _,T=this.value.length-1;T>=0;T--)(_=this.value[T][0])=="M"||_=="L"||_=="T"?(this.value[T][1]+=s,this.value[T][2]+=h):_=="H"?this.value[T][1]+=s:_=="V"?this.value[T][1]+=h:_=="C"||_=="S"||_=="Q"?(this.value[T][1]+=s,this.value[T][2]+=h,this.value[T][3]+=s,this.value[T][4]+=h,_=="C"&&(this.value[T][5]+=s,this.value[T][6]+=h)):_=="A"&&(this.value[T][6]+=s,this.value[T][7]+=h);return this},size:function(s,h){var m,_,T=this.bbox();for(m=this.value.length-1;m>=0;m--)(_=this.value[m][0])=="M"||_=="L"||_=="T"?(this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x,this.value[m][2]=(this.value[m][2]-T.y)*h/T.height+T.y):_=="H"?this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x:_=="V"?this.value[m][1]=(this.value[m][1]-T.y)*h/T.height+T.y:_=="C"||_=="S"||_=="Q"?(this.value[m][1]=(this.value[m][1]-T.x)*s/T.width+T.x,this.value[m][2]=(this.value[m][2]-T.y)*h/T.height+T.y,this.value[m][3]=(this.value[m][3]-T.x)*s/T.width+T.x,this.value[m][4]=(this.value[m][4]-T.y)*h/T.height+T.y,_=="C"&&(this.value[m][5]=(this.value[m][5]-T.x)*s/T.width+T.x,this.value[m][6]=(this.value[m][6]-T.y)*h/T.height+T.y)):_=="A"&&(this.value[m][1]=this.value[m][1]*s/T.width,this.value[m][2]=this.value[m][2]*h/T.height,this.value[m][6]=(this.value[m][6]-T.x)*s/T.width+T.x,this.value[m][7]=(this.value[m][7]-T.y)*h/T.height+T.y);return this},equalCommands:function(s){var h,m,_;for(s=new n.PathArray(s),_=this.value.length===s.value.length,h=0,m=this.value.length;_&&h<m;h++)_=this.value[h][0]===s.value[h][0];return _},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,_,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]],_=1,T=M[h].length;_<T;_++)$[h][_]=M[h][_]+(I[h][_]-M[h][_])*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 _=[],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"),_.push(i[h].call(null,s.slice(I,I+=m[h.toUpperCase()]).map(parseFloat),T,M));while($>I);return _},bbox:function(){return n.parser.path.setAttribute("d",this.toString()),n.parser.path.getBBox()}}),n.Number=n.invent({create:function(s,h){this.value=0,this.unit=h||"",typeof s=="number"?this.value=isNaN(s)?0:isFinite(s)?s:s<0?-34e37:34e37:typeof s=="string"?(h=s.match(n.regex.numberAndUnit))&&(this.value=parseFloat(h[1]),h[5]=="%"?this.value/=100:h[5]=="s"&&(this.value*=1e3),this.unit=h[5]):s instanceof n.Number&&(this.value=s.valueOf(),this.unit=s.unit)},extend:{toString:function(){return(this.unit=="%"?~~(1e8*this.value)/1e6:this.unit=="s"?this.value/1e3:this.value)+this.unit},toJSON:function(){return this.toString()},valueOf:function(){return this.value},plus:function(s){return s=new n.Number(s),new n.Number(this+s,this.unit||s.unit)},minus:function(s){return s=new n.Number(s),new n.Number(this-s,this.unit||s.unit)},times:function(s){return s=new n.Number(s),new n.Number(this*s,this.unit||s.unit)},divide:function(s){return s=new n.Number(s),new n.Number(this/s,this.unit||s.unit)},to:function(s){var h=new n.Number(this);return typeof s=="string"&&(h.unit=s),h},morph:function(s){return this.destination=new n.Number(s),s.relative&&(this.destination.value+=this.value),this},at:function(s){return this.destination?new n.Number(this.destination).minus(this).times(s).plus(this):this}}}),n.Element=n.invent({create:function(s){this._stroke=n.defaults.attrs.stroke,this._event=null,this._events={},this.dom={},(this.node=s)&&(this.type=s.nodeName,this.node.instance=this,this._events=s._events||{},this._stroke=s.getAttribute("stroke")||this._stroke)},extend:{x:function(s){return this.attr("x",s)},y:function(s){return this.attr("y",s)},cx:function(s){return s==null?this.x()+this.width()/2:this.x(s-this.width()/2)},cy:function(s){return s==null?this.y()+this.height()/2:this.y(s-this.height()/2)},move:function(s,h){return this.x(s).y(h)},center:function(s,h){return this.cx(s).cy(h)},width:function(s){return this.attr("width",s)},height:function(s){return this.attr("height",s)},size:function(s,h){var m=f(this,s,h);return this.width(new n.Number(m.width)).height(new n.Number(m.height))},clone:function(s){this.writeDataToDom();var h=E(this.node.cloneNode(!0));return s?s.add(h):this.after(h),h},remove:function(){return this.parent()&&this.parent().removeElement(this),this},replace:function(s){return this.after(s).remove(),s},addTo:function(s){return s.put(this)},putIn:function(s){return s.add(this)},id:function(s){return this.attr("id",s)},inside:function(s,h){var m=this.bbox();return s>m.x&&h>m.y&&s<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,_=h.firstChild.childNodes.length;m<_;m++)this.node.appendChild(h.firstChild.firstChild);return this},writeDataToDom:function(){return(this.each||this.lines)&&(this.each?this:this.lines()).each(function(){this.writeDataToDom()}),this.node.removeAttribute("svgjs:data"),Object.keys(this.dom).length&&this.node.setAttribute("svgjs:data",JSON.stringify(this.dom)),this},setData:function(s){return this.dom=s,this},is:function(s){return function(h,m){return h instanceof m}(this,s)}}}),n.easing={"-":function(s){return s},"<>":function(s){return-Math.cos(s*Math.PI)/2+.5},">":function(s){return Math.sin(s*Math.PI/2)},"<":function(s){return 1-Math.cos(s*Math.PI/2)}},n.morph=function(s){return function(h,m){return new n.MorphObj(h,m).at(s)}},n.Situation=n.invent({create:function(s){this.init=!1,this.reversed=!1,this.reversing=!1,this.duration=new n.Number(s.duration).valueOf(),this.delay=new n.Number(s.delay).valueOf(),this.start=+new Date+this.delay,this.finish=this.start+this.duration,this.ease=s.ease,this.loop=0,this.loops=!1,this.animations={},this.attrs={},this.styles={},this.transforms=[],this.once={}}}),n.FX=n.invent({create:function(s){this._target=s,this.situations=[],this.active=!1,this.situation=null,this.paused=!1,this.lastPos=0,this.pos=0,this.absPos=0,this._speed=1},extend:{animate:function(s,h,m){typeof s=="object"&&(h=s.ease,m=s.delay,s=s.duration);var _=new n.Situation({duration:s||1e3,delay:m||0,ease:n.easing[h||"-"]||h});return this.queue(_),this},delay:function(s){var h=new n.Situation({duration:s,delay:0,ease:n.easing["-"]});return this.queue(h)},target:function(s){return s&&s instanceof n.Element?(this._target=s,this):this._target},timeToAbsPos:function(s){return(s-this.situation.start)/(this.situation.duration/this._speed)},absPosToTime:function(s){return this.situation.duration/this._speed*s+this.situation.start},startAnimFrame:function(){this.stopAnimFrame(),this.animationFrame=t.requestAnimationFrame((function(){this.step()}).bind(this))},stopAnimFrame:function(){t.cancelAnimationFrame(this.animationFrame)},start:function(){return!this.active&&this.situation&&(this.active=!0,this.startCurrent()),this},startCurrent:function(){return this.situation.start=+new Date+this.situation.delay/this._speed,this.situation.finish=this.situation.start+this.situation.duration/this._speed,this.initAnimations().step()},queue:function(s){return(typeof s=="function"||s instanceof n.Situation)&&this.situations.push(s),this.situation||(this.situation=this.situations.shift()),this},dequeue:function(){return this.stop(),this.situation=this.situations.shift(),this.situation&&(this.situation instanceof n.Situation?this.start():this.situation.call(this)),this},initAnimations:function(){var s,h,m,_=this.situation;if(_.init)return this;for(s in _.animations)for(m=this.target()[s](),Array.isArray(m)||(m=[m]),Array.isArray(_.animations[s])||(_.animations[s]=[_.animations[s]]),h=m.length;h--;)_.animations[s][h]instanceof n.Number&&(m[h]=new n.Number(m[h])),_.animations[s][h]=m[h].morph(_.animations[s][h]);for(s in _.attrs)_.attrs[s]=new n.MorphObj(this.target().attr(s),_.attrs[s]);for(s in _.styles)_.styles[s]=new n.MorphObj(this.target().style(s),_.styles[s]);return _.initialTransformation=this.target().matrixify(),_.init=!0,this},clearQueue:function(){return this.situations=[],this},clearCurrent:function(){return this.situation=null,this},stop:function(s,h){var m=this.active;return this.active=!1,h&&this.clearQueue(),s&&this.situation&&(!m&&this.startCurrent(),this.atEnd()),this.stopAnimFrame(),this.clearCurrent()},reset:function(){if(this.situation){var s=this.situation;this.stop(),this.situation=s,this.atStart()}return this},finish:function(){for(this.stop(!0,!1);this.dequeue().situation&&this.stop(!0,!1););return this.clearQueue().clearCurrent(),this},atStart:function(){return this.at(0,!0)},atEnd:function(){return this.situation.loops===!0&&(this.situation.loops=this.situation.loop+1),typeof this.situation.loops=="number"?this.at(this.situation.loops,!0):this.at(1,!0)},at:function(s,h){var m=this.situation.duration/this._speed;return this.absPos=s,h||(this.situation.reversed&&(this.absPos=1-this.absPos),this.absPos+=this.situation.loop),this.situation.start=+new Date-this.absPos*m,this.situation.finish=this.situation.start+m,this.step(!0)},speed:function(s){return s===0?this.pause():s?(this._speed=s,this.at(this.absPos,!0)):this._speed},loop:function(s,h){var m=this.last();return m.loops=s==null||s,m.loop=0,h&&(m.reversing=!0),this},pause:function(){return this.paused=!0,this.stopAnimFrame(),this},play:function(){return this.paused?(this.paused=!1,this.at(this.absPos,!0)):this},reverse:function(s){var h=this.last();return h.reversed=s===void 0?!h.reversed:s,this},progress:function(s){return s?this.situation.ease(this.pos):this.pos},after:function(s){var h=this.last();return this.target().on("finished.fx",function m(_){_.detail.situation==h&&(s.call(this,h),this.off("finished.fx",m))}),this._callStart()},during:function(s){var h=this.last(),m=function(_){_.detail.situation==h&&s.call(this,_.detail.pos,n.morph(_.detail.pos),_.detail.eased,h)};return this.target().off("during.fx",m).on("during.fx",m),this.after(function(){this.off("during.fx",m)}),this._callStart()},afterAll:function(s){var h=function m(_){s.call(this),this.off("allfinished.fx",m)};return this.target().off("allfinished.fx",h).on("allfinished.fx",h),this._callStart()},duringAll:function(s){var h=function(m){s.call(this,m.detail.pos,n.morph(m.detail.pos),m.detail.eased,m.detail.situation)};return this.target().off("during.fx",h).on("during.fx",h),this.afterAll(function(){this.off("during.fx",h)}),this._callStart()},last:function(){return this.situations.length?this.situations[this.situations.length-1]:this.situation},add:function(s,h,m){return this.last()[m||"animations"][s]=h,this._callStart()},step:function(s){var h,m,_;s||(this.absPos=this.timeToAbsPos(+new Date)),this.situation.loops!==!1?(h=Math.max(this.absPos,0),m=Math.floor(h),this.situation.loops===!0||m<this.situation.loops?(this.pos=h-m,_=this.situation.loop,this.situation.loop=m):(this.absPos=this.situation.loops,this.pos=1,_=this.situation.loop-1,this.situation.loop=this.situation.loops),this.situation.reversing&&(this.situation.reversed=this.situation.reversed!=!!((this.situation.loop-_)%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,_=this,T=this.target(),M=this.situation;for(s in M.animations)m=[].concat(M.animations[s]).map(function($){return typeof $!="string"&&$.at?$.at(M.ease(_.pos),_.pos):$}),T[s].apply(T,m);for(s in M.attrs)m=[s].concat(M.attrs[s]).map(function($){return typeof $!="string"&&$.at?$.at(M.ease(_.pos),_.pos):$}),T.attr.apply(T,m);for(s in M.styles)m=[s].concat(M.styles[s]).map(function($){return typeof $!="string"&&$.at?$.at(M.ease(_.pos),_.pos):$}),T.style.apply(T,m);if(M.transforms.length){for(m=M.initialTransformation,s=0,h=M.transforms.length;s<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 _=this.last();return m||(s=_.ease(s)),_.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 _ in s)this.attr(_,s[_]);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,_){return arguments.length==4?this.plot([s,h,m,_]):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,_){return this.target()instanceof n.Container&&this.add("viewbox",new n.ViewBox(s,h,m,_)),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,_){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=_),S(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,S(h)},transform:function(s){var h,m=1/0,_=-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),_=Math.max(_,I.x),T=Math.min(T,I.y),M=Math.max(M,I.y)}),(h=new this.constructor).x=m,h.width=_-m,h.y=T,h.height=M-T,S(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 _=s.clone(n.parser.draw.instance).show();h=_.node.getBBox(),_.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,_){return arguments.length==1?h=s:arguments.length==3&&(_=m,m=h,h=s),this.around(m,_,new n.Matrix(s,0,0,h,0,0))},rotate:function(s,h,m){return s=n.utils.radians(s),this.around(h,m,new n.Matrix(Math.cos(s),Math.sin(s),-Math.sin(s),Math.cos(s),0,0))},flip:function(s,h){return s=="x"?this.scale(-1,1,h,0):s=="y"?this.scale(1,-1,0,h):this.scale(-1,-1,s,h??s)},skew:function(s,h,m,_){return arguments.length==1?h=s:arguments.length==3&&(_=m,m=h,h=s),s=n.utils.radians(s),h=n.utils.radians(h),this.around(m,_,new n.Matrix(1,Math.tan(h),Math.tan(s),1,0,0))},skewX:function(s,h,m){return this.skew(s,0,h,m)},skewY:function(s,h,m){return this.skew(0,s,h,m)},around:function(s,h,m){return this.multiply(new n.Matrix(1,0,0,1,s||0,h||0)).multiply(m).multiply(new n.Matrix(1,0,0,1,-s||0,-h||0))},native:function(){for(var s=n.parser.native.createSVGMatrix(),h=C.length-1;h>=0;h--)s[C[h]]=this[C[h]];return s},toString:function(){return"matrix("+w(this.a)+","+w(this.b)+","+w(this.c)+","+w(this.d)+","+w(this.e)+","+w(this.f)+")"}},parent:n.Element,construct:{ctm:function(){return new n.Matrix(this.node.getCTM())},screenCTM:function(){if(this instanceof n.Nested){var s=this.rect(1,1),h=s.node.getScreenCTM();return s.remove(),new n.Matrix(h)}return new n.Matrix(this.node.getScreenCTM())}}}),n.Point=n.invent({create:function(s,h){var m;m=Array.isArray(s)?{x:s[0],y:s[1]}:typeof s=="object"?{x:s.x,y:s.y}:s!=null?{x:s,y:h??s}:{x:0,y:0},this.x=m.x,this.y=m.y},extend:{clone:function(){return new n.Point(this)},morph:function(s,h){return this.destination=new n.Point(s,h),this},at:function(s){return this.destination?new n.Point({x:this.x+(this.destination.x-this.x)*s,y:this.y+(this.destination.y-this.y)*s}):this},native:function(){var s=n.parser.native.createSVGPoint();return s.x=this.x,s.y=this.y,s},transform:function(s){return new n.Point(this.native().matrixTransform(s.native()))}}}),n.extend(n.Element,{point:function(s,h){return new n.Point(s,h).transform(this.screenCTM().inverse())}}),n.extend(n.Element,{attr:function(s,h,m){if(s==null){for(s={},m=(h=this.node.attributes).length-1;m>=0;m--)s[h[m].nodeName]=n.regex.isNumber.test(h[m].nodeValue)?parseFloat(h[m].nodeValue):h[m].nodeValue;return s}if(typeof s=="object")for(h in s)this.attr(h,s[h]);else if(h===null)this.node.removeAttribute(s);else{if(h==null)return(h=this.node.getAttribute(s))==null?n.defaults.attrs[s]:n.regex.isNumber.test(h)?parseFloat(h):h;s=="stroke-width"?this.attr("stroke",parseFloat(h)>0?this._stroke:null):s=="stroke"&&(this._stroke=h),s!="fill"&&s!="stroke"||(n.regex.isImage.test(h)&&(h=this.doc().defs().image(h,0,0)),h instanceof n.Image&&(h=this.doc().defs().pattern(0,0,function(){this.add(h)}))),typeof h=="number"?h=new n.Number(h):n.Color.isColor(h)?h=new n.Color(h):Array.isArray(h)&&(h=new n.Array(h)),s=="leading"?this.leading&&this.leading(h):typeof m=="string"?this.node.setAttributeNS(m,s,h.toString()):this.node.setAttribute(s,h.toString()),!this.rebuild||s!="font-size"&&s!="x"||this.rebuild(s,h)}return this}}),n.extend(n.Element,{transform:function(s,h){var m,_,T=this;if(typeof s!="object")return m=new n.Matrix(T).extract(),typeof s=="string"?m[s]:m;if(m=new n.Matrix(T),h=!!h||!!s.relative,s.a!=null)m=h?m.multiply(new n.Matrix(s)):new n.Matrix(s);else if(s.rotation!=null)b(s,T),m=h?m.rotate(s.rotation,s.cx,s.cy):m.rotate(s.rotation-m.extract().rotation,s.cx,s.cy);else if(s.scale!=null||s.scaleX!=null||s.scaleY!=null){if(b(s,T),s.scaleX=s.scale!=null?s.scale:s.scaleX!=null?s.scaleX:1,s.scaleY=s.scale!=null?s.scale:s.scaleY!=null?s.scaleY:1,!h){var M=m.extract();s.scaleX=1*s.scaleX/M.scaleX,s.scaleY=1*s.scaleY/M.scaleY}m=m.scale(s.scaleX,s.scaleY,s.cx,s.cy)}else s.skew!=null||s.skewX!=null||s.skewY!=null?(b(s,T),s.skewX=s.skew!=null?s.skew:s.skewX!=null?s.skewX:0,s.skewY=s.skew!=null?s.skew:s.skewY!=null?s.skewY:0,h||(M=m.extract(),m=m.multiply(new n.Matrix().skew(M.skewX,M.skewY,s.cx,s.cy).inverse())),m=m.skew(s.skewX,s.skewY,s.cx,s.cy)):s.flip?(s.flip=="x"||s.flip=="y"?s.offset=s.offset==null?T.bbox()["c"+s.flip]:s.offset:s.offset==null?(_=T.bbox(),s.flip=_.cx,s.offset=_.cy):s.flip=s.offset,m=new n.Matrix().flip(s.flip,s.offset)):s.x==null&&s.y==null||(h?m=m.translate(s.x,s.y):(s.x!=null&&(m.e=s.x),s.y!=null&&(m.f=s.y)));return this.attr("transform",m)}}),n.extend(n.FX,{transform:function(s,h){var m,_,T=this.target();return typeof s!="object"?(m=new n.Matrix(T).extract(),typeof s=="string"?m[s]:m):(h=!!h||!!s.relative,s.a!=null?m=new n.Matrix(s):s.rotation!=null?(b(s,T),m=new n.Rotate(s.rotation,s.cx,s.cy)):s.scale!=null||s.scaleX!=null||s.scaleY!=null?(b(s,T),s.scaleX=s.scale!=null?s.scale:s.scaleX!=null?s.scaleX:1,s.scaleY=s.scale!=null?s.scale:s.scaleY!=null?s.scaleY:1,m=new n.Scale(s.scaleX,s.scaleY,s.cx,s.cy)):s.skewX!=null||s.skewY!=null?(b(s,T),s.skewX=s.skewX!=null?s.skewX:0,s.skewY=s.skewY!=null?s.skewY:0,m=new n.Skew(s.skewX,s.skewY,s.cx,s.cy)):s.flip?(s.flip=="x"||s.flip=="y"?s.offset=s.offset==null?T.bbox()["c"+s.flip]:s.offset:s.offset==null?(_=T.bbox(),s.flip=_.cx,s.offset=_.cy):s.flip=s.offset,m=new n.Matrix().flip(s.flip,s.offset)):s.x==null&&s.y==null||(m=new n.Translate(s.x,s.y)),m?(m.relative=h,this.last().transforms.push(m),this._callStart()):this)}}),n.extend(n.Element,{untransform:function(){return this.attr("transform",null)},matrixify:function(){var s=(this.attr("transform")||"").split(n.regex.transforms).slice(0,-1).map(function(h){var m=h.trim().split("(");return[m[0],m[1].split(n.regex.delimiter).map(function(_){return parseFloat(_)})]}).reduce(function(h,m){return m[0]=="matrix"?h.multiply(g(m[1])):h[m[0]].apply(h,m[1])},new n.Matrix);return s},toParent:function(s){if(this==s)return this;var h=this.screenCTM(),m=s.screenCTM().inverse();return this.addTo(s).untransform().transform(m.multiply(h)),this},toDoc:function(){return this.toParent(this.doc())}}),n.Transformation=n.invent({create:function(s,h){if(arguments.length>1&&typeof h!="boolean")return this.constructor.call(this,[].slice.call(arguments));if(Array.isArray(s))for(var m=0,_=this.arguments.length;m<_;++m)this[this.arguments[m]]=s[m];else if(typeof s=="object")for(m=0,_=this.arguments.length;m<_;++m)this[this.arguments[m]]=s[this.arguments[m]];this.inversed=!1,h===!0&&(this.inversed=!0)},extend:{arguments:[],method:"",at:function(s){for(var h=[],m=0,_=this.arguments.length;m<_;++m)h.push(this[this.arguments[m]]);var T=this._undo||new n.Matrix;return T=new n.Matrix().morph(n.Matrix.prototype[this.method].apply(T,h)).at(s),this.inversed?T.inverse():T},undo:function(s){for(var h=0,m=this.arguments.length;h<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,_,T=this.children();for(m=0,_=T.length;m<_;m++)T[m]instanceof n.Element&&s.apply(T[m],[m,T]),h&&T[m]instanceof n.Container&&T[m].each(s,h);return this},removeElement:function(s){return this.node.removeChild(s.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,this},defs:function(){return this.doc().defs()}}}),n.extend(n.Parent,{ungroup:function(s,h){return h===0||this instanceof n.Defs||this.node==n.parser.draw||(s=s||(this instanceof n.Doc?this:this.parent(n.Parent)),h=h||1/0,this.each(function(){return this instanceof n.Defs?this:this instanceof n.Parent?this.ungroup(s,h-1):this.toParent(s)}),this.node.firstChild||this.remove()),this},flatten:function(s,h){return this.ungroup(s,h)}}),n.Container=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Parent}),n.ViewBox=n.invent({create:function(s){var h,m,_,T,M,I,$,P=1,x=1,N=/[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/gi;if(s instanceof n.Element){for(I=s,$=s,M=(s.attr("viewBox")||"").match(N),s.bbox,_=new n.Number(s.width()),T=new n.Number(s.height());_.unit=="%";)P*=_.value,_=new n.Number(I instanceof n.Doc?I.parent().offsetWidth:I.parent().width()),I=I.parent();for(;T.unit=="%";)x*=T.value,T=new n.Number($ instanceof n.Doc?$.parent().offsetHeight:$.parent().height()),$=$.parent();this.x=0,this.y=0,this.width=_*P,this.height=T*x,this.zoom=1,M&&(h=parseFloat(M[0]),m=parseFloat(M[1]),_=parseFloat(M[2]),T=parseFloat(M[3]),this.zoom=this.width/this.height>_/T?this.height/T:this.width/_,this.x=h,this.y=m,this.width=_,this.height=T)}else s=typeof s=="string"?s.match(N).map(function(j){return parseFloat(j)}):Array.isArray(s)?s:typeof s=="object"?[s.x,s.y,s.width,s.height]:arguments.length==4?[].slice.call(arguments):[0,0,0,0],this.x=s[0],this.y=s[1],this.width=s[2],this.height=s[3]},extend:{toString:function(){return this.x+" "+this.y+" "+this.width+" "+this.height},morph:function(s,h,m,_){return this.destination=new n.ViewBox(s,h,m,_),this},at:function(s){return this.destination?new n.ViewBox([this.x+(this.destination.x-this.x)*s,this.y+(this.destination.y-this.y)*s,this.width+(this.destination.width-this.width)*s,this.height+(this.destination.height-this.height)*s]):this}},parent:n.Container,construct:{viewbox:function(s,h,m,_){return arguments.length==0?new n.ViewBox(this):this.attr("viewBox",new n.ViewBox(s,h,m,_))}}}),["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].forEach(function(s){n.Element.prototype[s]=function(h){return h==null?n.off(this,s):n.on(this,s,h),this}}),n.listenerId=0,n.on=function(s,h,m,_,T){var M=m.bind(_||s),I=s instanceof n.Element?s.node:s;I.instance=I.instance||{_events:{}};var $=I.instance._events;m._svgjsListenerId||(m._svgjsListenerId=++n.listenerId),h.split(n.regex.delimiter).forEach(function(P){var x=P.split(".")[0],N=P.split(".")[1]||"*";$[x]=$[x]||{},$[x][N]=$[x][N]||{},$[x][N][m._svgjsListenerId]=M,I.addEventListener(x,M,T||!1)})},n.off=function(s,h,m,_){var T=s instanceof n.Element?s.node:s;if(T.instance&&(typeof m!="function"||(m=m._svgjsListenerId))){var M=T.instance._events;(h||"").split(n.regex.delimiter).forEach(function(I){var $,P,x=I&&I.split(".")[0],N=I&&I.split(".")[1];if(m)M[x]&&M[x][N||"*"]&&(T.removeEventListener(x,M[x][N||"*"][m],_||!1),delete M[x][N||"*"][m]);else if(x&&N){if(M[x]&&M[x][N]){for(P in M[x][N])n.off(T,[x,N].join("."),P);delete M[x][N]}}else if(N)for(I in M)for($ in M[I])N===$&&n.off(T,[I,N].join("."));else if(x){if(M[x]){for($ in M[x])n.off(T,[x,$].join("."));delete M[x]}}else{for(I in M)n.off(T,I);T.instance._events={}}})}},n.extend(n.Element,{on:function(s,h,m,_){return n.on(this,s,h,m,_),this},off:function(s,h){return n.off(this.node,s,h),this},fire:function(s,h){return s instanceof t.Event?this.node.dispatchEvent(s):this.node.dispatchEvent(s=new n.CustomEvent(s,{detail:h,cancelable:!0})),this._event=s,this},event:function(){return this._event}}),n.Defs=n.invent({create:"defs",inherit:n.Container}),n.G=n.invent({create:"g",inherit:n.Container,extend:{x:function(s){return s==null?this.transform("x"):this.transform({x:s-this.x()},!0)},y:function(s){return s==null?this.transform("y"):this.transform({y:s-this.y()},!0)},cx:function(s){return s==null?this.gbox().cx:this.x(s-this.gbox().width/2)},cy:function(s){return s==null?this.gbox().cy:this.y(s-this.gbox().height/2)},gbox:function(){var s=this.bbox(),h=this.transform();return s.x+=h.x,s.x2+=h.x,s.cx+=h.x,s.y+=h.y,s.y2+=h.y,s.cy+=h.y,s}},construct:{group:function(){return this.put(new n.G)}}}),n.Doc=n.invent({create:function(s){s&&((s=typeof s=="string"?e.getElementById(s):s).nodeName=="svg"?this.constructor.call(this,s):(this.constructor.call(this,n.create("svg")),s.appendChild(this.node),this.size("100%","100%")),this.namespace().defs())},inherit:n.Container,extend:{namespace:function(){return this.attr({xmlns:n.ns,version:"1.1"}).attr("xmlns:xlink",n.xlink,n.xmlns).attr("xmlns:svgjs",n.svgjs,n.xmlns)},defs:function(){var s;return this._defs||((s=this.node.getElementsByTagName("defs")[0])?this._defs=n.adopt(s):this._defs=new n.Defs,this.node.appendChild(this._defs.node)),this._defs},parent:function(){return this.node.parentNode&&this.node.parentNode.nodeName!="#document"&&this.node.parentNode.nodeName!="#document-fragment"?this.node.parentNode:null},spof:function(){var s=this.node.getScreenCTM();return s&&this.style("left",-s.e%1+"px").style("top",-s.f%1+"px"),this},remove:function(){return this.parent()&&this.parent().removeChild(this.node),this},clear:function(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return delete this._defs,n.parser.draw.parentNode||this.node.appendChild(n.parser.draw),this},clone:function(s){this.writeDataToDom();var h=this.node,m=E(h.cloneNode(!0));return s?(s.node||s).appendChild(m.node):h.parentNode.insertBefore(m.node,h.nextSibling),m}}}),n.extend(n.Element,{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},previous:function(){return this.siblings()[this.position()-1]},forward:function(){var s=this.position()+1,h=this.parent();return h.removeElement(this).add(this,s),h instanceof n.Doc&&h.node.appendChild(h.defs().node),this},backward:function(){var s=this.position();return s>0&&this.parent().removeElement(this).add(this,s-1),this},front:function(){var s=this.parent();return s.node.appendChild(this.node),s instanceof n.Doc&&s.node.appendChild(s.defs().node),this},back:function(){return this.position()>0&&this.parent().removeElement(this).add(this,0),this},before:function(s){s.remove();var h=this.position();return this.parent().add(s,h),this},after:function(s){s.remove();var h=this.position();return this.parent().add(s,h+1),this}}),n.Mask=n.invent({create:function(){this.constructor.call(this,n.create("mask")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var s=this.targets.length-1;s>=0;s--)this.targets[s]&&this.targets[s].unmask();return this.targets=[],n.Element.prototype.remove.call(this),this}},construct:{mask:function(){return this.defs().put(new n.Mask)}}}),n.extend(n.Element,{maskWith:function(s){return this.masker=s instanceof n.Mask?s:this.parent().mask().add(s),this.masker.targets.push(this),this.attr("mask",'url("#'+this.masker.attr("id")+'")')},unmask:function(){return delete this.masker,this.attr("mask",null)}}),n.ClipPath=n.invent({create:function(){this.constructor.call(this,n.create("clipPath")),this.targets=[]},inherit:n.Container,extend:{remove:function(){for(var s=this.targets.length-1;s>=0;s--)this.targets[s]&&this.targets[s].unclip();return this.targets=[],this.parent().removeElement(this),this}},construct:{clip:function(){return this.defs().put(new n.ClipPath)}}}),n.extend(n.Element,{clipWith:function(s){return this.clipper=s instanceof n.ClipPath?s:this.parent().clip().add(s),this.clipper.targets.push(this),this.attr("clip-path",'url("#'+this.clipper.attr("id")+'")')},unclip:function(){return delete this.clipper,this.attr("clip-path",null)}}),n.Gradient=n.invent({create:function(s){this.constructor.call(this,n.create(s+"Gradient")),this.type=s},inherit:n.Container,extend:{at:function(s,h,m){return this.put(new n.Stop).update(s,h,m)},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},fill:function(){return"url(#"+this.id()+")"},toString:function(){return this.fill()},attr:function(s,h,m){return s=="transform"&&(s="gradientTransform"),n.Container.prototype.attr.call(this,s,h,m)}},construct:{gradient:function(s,h){return this.defs().gradient(s,h)}}}),n.extend(n.Gradient,n.FX,{from:function(s,h){return(this._target||this).type=="radial"?this.attr({fx:new n.Number(s),fy:new n.Number(h)}):this.attr({x1:new n.Number(s),y1:new n.Number(h)})},to:function(s,h){return(this._target||this).type=="radial"?this.attr({cx:new n.Number(s),cy:new n.Number(h)}):this.attr({x2:new n.Number(s),y2:new n.Number(h)})}}),n.extend(n.Defs,{gradient:function(s,h){return this.put(new n.Gradient(s)).update(h)}}),n.Stop=n.invent({create:"stop",inherit:n.Element,extend:{update:function(s){return(typeof s=="number"||s instanceof n.Number)&&(s={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),s.opacity!=null&&this.attr("stop-opacity",s.opacity),s.color!=null&&this.attr("stop-color",s.color),s.offset!=null&&this.attr("offset",new n.Number(s.offset)),this}}}),n.Pattern=n.invent({create:"pattern",inherit:n.Container,extend:{fill:function(){return"url(#"+this.id()+")"},update:function(s){return this.clear(),typeof s=="function"&&s.call(this,this),this},toString:function(){return this.fill()},attr:function(s,h,m){return s=="transform"&&(s="patternTransform"),n.Container.prototype.attr.call(this,s,h,m)}},construct:{pattern:function(s,h,m){return this.defs().pattern(s,h,m)}}}),n.extend(n.Defs,{pattern:function(s,h,m){return this.put(new n.Pattern).update(m).attr({x:0,y:0,width:s,height:h,patternUnits:"userSpaceOnUse"})}}),n.Shape=n.invent({create:function(s){this.constructor.call(this,s)},inherit:n.Element}),n.Bare=n.invent({create:function(s,h){if(this.constructor.call(this,n.create(s)),h)for(var m in h.prototype)typeof h.prototype[m]=="function"&&(this[m]=h.prototype[m])},inherit:n.Element,extend:{words:function(s){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this.node.appendChild(e.createTextNode(s)),this}}}),n.extend(n.Parent,{element:function(s,h){return this.put(new n.Bare(s,h))}}),n.Symbol=n.invent({create:"symbol",inherit:n.Container,construct:{symbol:function(){return this.put(new n.Symbol)}}}),n.Use=n.invent({create:"use",inherit:n.Shape,extend:{element:function(s,h){return this.attr("href",(h||"")+"#"+s,n.xlink)}},construct:{use:function(s,h){return this.put(new n.Use).element(s,h)}}}),n.Rect=n.invent({create:"rect",inherit:n.Shape,construct:{rect:function(s,h){return this.put(new n.Rect).size(s,h)}}}),n.Circle=n.invent({create:"circle",inherit:n.Shape,construct:{circle:function(s){return this.put(new n.Circle).rx(new n.Number(s).divide(2)).move(0,0)}}}),n.extend(n.Circle,n.FX,{rx:function(s){return this.attr("r",s)},ry:function(s){return this.rx(s)}}),n.Ellipse=n.invent({create:"ellipse",inherit:n.Shape,construct:{ellipse:function(s,h){return this.put(new n.Ellipse).size(s,h).move(0,0)}}}),n.extend(n.Ellipse,n.Rect,n.FX,{rx:function(s){return this.attr("rx",s)},ry:function(s){return this.attr("ry",s)}}),n.extend(n.Circle,n.Ellipse,{x:function(s){return s==null?this.cx()-this.rx():this.cx(s+this.rx())},y:function(s){return s==null?this.cy()-this.ry():this.cy(s+this.ry())},cx:function(s){return s==null?this.attr("cx"):this.attr("cx",s)},cy:function(s){return s==null?this.attr("cy"):this.attr("cy",s)},width:function(s){return s==null?2*this.rx():this.rx(new n.Number(s).divide(2))},height:function(s){return s==null?2*this.ry():this.ry(new n.Number(s).divide(2))},size:function(s,h){var m=f(this,s,h);return this.rx(new n.Number(m.width).divide(2)).ry(new n.Number(m.height).divide(2))}}),n.Line=n.invent({create:"line",inherit:n.Shape,extend:{array:function(){return new n.PointArray([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])},plot:function(s,h,m,_){return s==null?this.array():(s=h!==void 0?{x1:s,y1:h,x2:m,y2:_}:new n.PointArray(s).toLine(),this.attr(s))},move:function(s,h){return this.attr(this.array().move(s,h).toLine())},size:function(s,h){var m=f(this,s,h);return this.attr(this.array().size(m.width,m.height).toLine())}},construct:{line:function(s,h,m,_){return n.Line.prototype.plot.apply(this.put(new n.Line),s!=null?[s,h,m,_]:[0,0,0,0])}}}),n.Polyline=n.invent({create:"polyline",inherit:n.Shape,construct:{polyline:function(s){return this.put(new n.Polyline).plot(s||new n.PointArray)}}}),n.Polygon=n.invent({create:"polygon",inherit:n.Shape,construct:{polygon:function(s){return this.put(new n.Polygon).plot(s||new n.PointArray)}}}),n.extend(n.Polyline,n.Polygon,{array:function(){return this._array||(this._array=new n.PointArray(this.attr("points")))},plot:function(s){return s==null?this.array():this.clear().attr("points",typeof s=="string"?s:this._array=new n.PointArray(s))},clear:function(){return delete this._array,this},move:function(s,h){return this.attr("points",this.array().move(s,h))},size:function(s,h){var m=f(this,s,h);return this.attr("points",this.array().size(m.width,m.height))}}),n.extend(n.Line,n.Polyline,n.Polygon,{morphArray:n.PointArray,x:function(s){return s==null?this.bbox().x:this.move(s,this.bbox().y)},y:function(s){return s==null?this.bbox().y:this.move(this.bbox().x,s)},width:function(s){var h=this.bbox();return s==null?h.width:this.size(s,h.height)},height:function(s){var h=this.bbox();return s==null?h.height:this.size(h.width,s)}}),n.Path=n.invent({create:"path",inherit:n.Shape,extend:{morphArray:n.PathArray,array:function(){return this._array||(this._array=new n.PathArray(this.attr("d")))},plot:function(s){return s==null?this.array():this.clear().attr("d",typeof s=="string"?s:this._array=new n.PathArray(s))},clear:function(){return delete this._array,this},move:function(s,h){return this.attr("d",this.array().move(s,h))},x:function(s){return s==null?this.bbox().x:this.move(s,this.bbox().y)},y:function(s){return s==null?this.bbox().y:this.move(this.bbox().x,s)},size:function(s,h){var m=f(this,s,h);return this.attr("d",this.array().size(m.width,m.height))},width:function(s){return s==null?this.bbox().width:this.size(s,this.bbox().height)},height:function(s){return s==null?this.bbox().height:this.size(this.bbox().width,s)}},construct:{path:function(s){return this.put(new n.Path).plot(s||new n.PathArray)}}}),n.Image=n.invent({create:"image",inherit:n.Shape,extend:{load:function(s){if(!s)return this;var h=this,m=new t.Image;return n.on(m,"load",function(){n.off(m);var _=h.parent(n.Pattern);_!==null&&(h.width()==0&&h.height()==0&&h.size(m.width,m.height),_&&_.width()==0&&_.height()==0&&_.size(h.width(),h.height()),typeof h._loaded=="function"&&h._loaded.call(h,{width:m.width,height:m.height,ratio:m.width/m.height,url:s}))}),n.on(m,"error",function(_){n.off(m),typeof h._error=="function"&&h._error.call(h,_)}),this.attr("href",m.src=this.src=s,n.xlink)},loaded:function(s){return this._loaded=s,this},error:function(s){return this._error=s,this}},construct:{image:function(s,h,m){return this.put(new n.Image).load(s).size(h||0,m||h||0)}}}),n.Text=n.invent({create:function(){this.constructor.call(this,n.create("text")),this.dom.leading=new n.Number(1.3),this._rebuild=!0,this._build=!1,this.attr("font-family",n.defaults.attrs["font-family"])},inherit:n.Shape,extend:{x:function(s){return s==null?this.attr("x"):this.attr("x",s)},y:function(s){var h=this.attr("y"),m=typeof h=="number"?h-this.bbox().y:0;return s==null?typeof h=="number"?h-m:h:this.attr("y",typeof s.valueOf()=="number"?s+m:s)},cx:function(s){return s==null?this.bbox().cx:this.x(s-this.bbox().width/2)},cy:function(s){return s==null?this.bbox().cy:this.y(s-this.bbox().height/2)},text:function(s){if(s===void 0){s="";for(var h=this.node.childNodes,m=0,_=h.length;m<_;++m)m!=0&&h[m].nodeType!=3&&n.adopt(h[m]).dom.newLined==1&&(s+=`
- `),s+=h[m].textContent;return s}if(this.clear().build(!0),typeof s=="function")s.call(this,this);else{m=0;for(var T=(s=s.split(`
- `)).length;m<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,_=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+=_:(this.attr("dy",_+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,_){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,_),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,_){return m+_.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 _=s.bbox();h==null?h=_.width/_.height*m:m==null&&(m=_.height/_.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 E(s){for(var h=s.childNodes.length-1;h>=0;h--)s.childNodes[h]instanceof t.SVGElement&&E(s.childNodes[h]);return n.adopt(s).id(n.eid(s.nodeName))}function S(s){return s.x==null&&(s.x=0,s.y=0,s.width=0,s.height=0),s.w=s.width,s.h=s.height,s.x2=s.x+s.width,s.y2=s.y+s.height,s.cx=s.x+s.width/2,s.cy=s.y+s.height/2,s}function w(s){return Math.abs(s)>1e-37?s:0}["fill","stroke"].forEach(function(s){var h,m={};m[s]=function(_){if(_===void 0)return this;if(typeof _=="string"||n.Color.isRgb(_)||_&&typeof _.fill=="function")this.attr(s,_);else for(h=c[s].length-1;h>=0;h--)_[c[s][h]]!=null&&this.attr(c.prefix(s,c[s][h]),_[c[s][h]]);return this},n.extend(n.Element,n.FX,m)}),n.extend(n.Element,n.FX,{rotate:function(s,h,m){return this.transform({rotation:s,cx:h,cy:m})},skew:function(s,h,m,_){return arguments.length==1||arguments.length==3?this.transform({skew:s,cx:h,cy:m}):this.transform({skewX:s,skewY:h,cx:m,cy:_})},scale:function(s,h,m,_){return arguments.length==1||arguments.length==3?this.transform({scale:s,cx:h,cy:m}):this.transform({scaleX:s,scaleY:h,cx:m,cy:_})},translate:function(s,h){return this.transform({x:s,y:h})},flip:function(s,h){return h=typeof s=="number"?s:h,this.transform({flip:s||"both",offset:h})},matrix:function(s){return this.attr("transform",new n.Matrix(arguments.length==6?[].slice.call(arguments):s))},opacity:function(s){return this.attr("opacity",s)},dx:function(s){return this.x(new n.Number(s).plus(this instanceof n.FX?0:this.x()),!0)},dy:function(s){return this.y(new n.Number(s).plus(this instanceof n.FX?0:this.y()),!0)},dmove:function(s,h){return this.dx(s).dy(h)}}),n.extend(n.Rect,n.Ellipse,n.Circle,n.Gradient,n.FX,{radius:function(s,h){var m=(this._target||this).type;return m=="radial"||m=="circle"?this.attr("r",new n.Number(s)):this.rx(s).ry(h??s)}}),n.extend(n.Path,{length:function(){return this.node.getTotalLength()},pointAt:function(s){return this.node.getPointAtLength(s)}}),n.extend(n.Parent,n.Text,n.Tspan,n.FX,{font:function(s,h){if(typeof s=="object")for(h in s)this.font(h,s[h]);return s=="leading"?this.leading(h):s=="anchor"?this.attr("text-anchor",h):s=="size"||s=="family"||s=="weight"||s=="stretch"||s=="variant"||s=="style"?this.attr("font-"+s,h):this.attr(s,h)}}),n.Set=n.invent({create:function(s){s instanceof n.Set?this.members=s.members.slice():Array.isArray(s)?this.members=s:this.clear()},extend:{add:function(){var s,h,m=[].slice.call(arguments);for(s=0,h=m.length;s<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(_){n.Set.prototype[_]=function(){for(var T=0,M=this.members.length;T<M;T++)this.members[T]&&typeof this.members[T][_]=="function"&&this.members[T][_].apply(this.members[T],arguments);return _=="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 _=0,T=this.set.members.length;_<T;_++)this.set.members[_].fx[m].apply(this.set.members[_].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 _=(m||"").toString().match(n.regex.reference);if(_)return _[1]}(s)||s);return n.adopt(h)},n.select=function(s,h){return new n.Set(n.utils.map((h||e).querySelectorAll(s),function(m){return n.adopt(m)}))},n.extend(n.Parent,{select:function(s){return n.select(s,this.node)}});var C="abcdef".split("");if(typeof t.CustomEvent!="function"){var B=function(s,h){h=h||{bubbles:!1,cancelable:!1,detail:void 0};var m=e.createEvent("CustomEvent");return m.initCustomEvent(s,h.bubbles,h.cancelable,h.detail),m};B.prototype=t.Event.prototype,n.CustomEvent=B}else n.CustomEvent=t.CustomEvent;return function(s){for(var h=0,m=["moz","webkit"],_=0;_<m.length&&!t.requestAnimationFrame;++_)s.requestAnimationFrame=s[m[_]+"RequestAnimationFrame"],s.cancelAnimationFrame=s[m[_]+"CancelAnimationFrame"]||s[m[_]+"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 tw=Q_.exports=kc.document?rh(kc,kc.document):function(t){return rh(t,t.document)},oh={exports:{}};(function(t,e){function n(i,r){return r.querySelector(i)}(e=oh.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,oh.exports);var xa=oh.exports,Fe="tokenSimulation",J={TOGGLE_MODE_EVENT:Fe+".toggleMode",GENERATE_TOKEN_EVENT:Fe+".generateToken",CONSUME_TOKEN_EVENT:Fe+".consumeToken",PLAY_SIMULATION_EVENT:Fe+".playSimulation",PAUSE_SIMULATION_EVENT:Fe+".pauseSimulation",RESET_SIMULATION_EVENT:Fe+".resetSimulation",TERMINATE_EVENT:Fe+".terminateEvent",UPDATE_ELEMENTS_EVENT:Fe+".updateElements",UPDATE_ELEMENT_EVENT:Fe+".updateElement",PROCESS_INSTANCE_CREATED_EVENT:Fe+".processInstanceCreated",PROCESS_INSTANCE_FINISHED_EVENT:Fe+".processInstanceFinished",PROCESS_INSTANCE_SHOWN_EVENT:Fe+".processInstanceShown",PROCESS_INSTANCE_HIDDEN_EVENT:Fe+".processInstanceHidden",ANIMATION_CREATED_EVENT:Fe+".animationCreated"},Ft={};const Wg=Kb(f0);var ew=Wg.every,nw=Wg.some;function Xg(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 nw(t.eventDefinitions,function(i){return i.$type===e&&function(r,o){return ew(o,function(a,c){return r[c]==a})}(t,n)})},Ft.getBusinessObject=function(t){return t&&t.businessObject||t},Ft.isAncestor=Xg,Ft.getDescendants=function(t,e){return t.filter(function(n){return Xg(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 iw={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))}},Kg=tw,rw=xa,ow=J.RESET_SIMULATION_EVENT,aw=J.PLAY_SIMULATION_EVENT,sw=J.PAUSE_SIMULATION_EVENT,cw=J.TERMINATE_EVENT,lw=J.PROCESS_INSTANCE_FINISHED_EVENT,uw=J.ANIMATION_CREATED_EVENT,Yg=Ft.isAncestor,pw=iw.distance,hw=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44"),Jg=20;function ar(t,e){var n=window.animation=this;this._eventBus=e,this.animations=[],this.hiddenAnimations=[],this.animationSpeed=1,e.on("import.done",function(){var i=Kg(t._svg),r=rw(".viewport",t._svg),o=Kg.adopt(r);n.group=i.group().attr("id","token-simulation"),o.put(n.group)}),e.on(cw,function(i){var r=i.element.parent;n.animations.forEach(function(o){Yg(r,o.element)&&(o.animation.stop(),n.animations=n.animations.filter(function(a){return a!==o}))})}),e.on(lw,function(i){var r=i.parent;n.animations.forEach(function(o){(i.processInstanceId===o.processInstanceId||Yg(r,o.element))&&(o.animation.stop(),n.animations=n.animations.filter(function(a){return a!==o}))})}),e.on(ow,function(){n.animations.forEach(function(i){i.animation.stop()}),n.animations=[],n.hiddenAnimations=[]}),e.on(sw,function(){n.animations.forEach(function(i){i.animation.pause()})}),e.on(aw,function(){n.animations.forEach(function(i){i.animation.play()})})}ar.prototype.createAnimation=function(t,e,n){var i=this;if(this.group){var r,o=this._createTokenGfx(e);return r=new Ea(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(uw,{tokenGfx:o,animation:r,element:t,processInstanceId:e}),r}},ar.prototype.setAnimationSpeed=function(t){this.animations.forEach(function(e){e.tokenGfx.fx._speed=t}),this.animationSpeed=t},ar.prototype._createTokenGfx=function(t){var e=this.group.group().attr("class","token").hide();return e.circle(Jg,Jg).attr("fill",hw).attr("class","circle"),e.text(t.toString()).attr("transform","translate(10, -7)").attr("text-anchor","middle").attr("class","text"),e},ar.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})},ar.prototype.hideProcessInstanceAnimations=function(t){this.animations.forEach(function(e){e.processInstanceId===t&&e.tokenGfx.hide()}),this.hiddenAnimations.push(t)},ar.$inject=["canvas","eventBus"];var dw=ar;function Ea(t,e,n){this.gfx=this.fx=t,this.waypoints=e,this.done=n,this.create()}Ea.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*pw(e[o-1],r);i=i.animate(u,l,0).move(a,c)}}),i.after(function(){t.remove(),n()})},Ea.prototype.play=function(){this.gfx.play()},Ea.prototype.pause=function(){this.gfx.pause()},Ea.prototype.stop=function(){this.fx.stop(),this.gfx.remove()};var ah,mw=function(t,e){if(typeof t!="string")throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var i=n[1];if(i=="body")return(r=e.createElement("html")).innerHTML=t,r.removeChild(r.lastChild);var r,o=Object.prototype.hasOwnProperty.call(ee,i)?ee[i]:ee._default,a=o[0],c=o[1],l=o[2];for((r=e.createElement("div")).innerHTML=c+t+l;a--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);for(var u=e.createDocumentFragment();r.firstChild;)u.appendChild(r.removeChild(r.firstChild));return u},Zg=!1;typeof document<"u"&&((ah=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Zg=!ah.getElementsByTagName("link").length,ah=void 0);var ee={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Zg?[1,"X<div>","</div>"]:[0,"",""]};ee.td=ee.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],ee.option=ee.optgroup=[1,'<select multiple="multiple">',"</select>"],ee.thead=ee.tbody=ee.colgroup=ee.caption=ee.tfoot=[1,"<table>","</table>"],ee.polyline=ee.ellipse=ee.polygon=ee.circle=ee.text=ee.line=ee.path=ee.rect=ee.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Re=mw,sh={},Qg=window.addEventListener?"addEventListener":"attachEvent",fw=window.removeEventListener?"removeEventListener":"detachEvent",tb=Qg!=="addEventListener"?"on":"";sh.bind=function(t,e,n,i){return t[Qg](tb+e,n,i||!1),n},sh.unbind=function(t,e,n,i){return t[fw](tb+e,n,i||!1),n};var bn=sh,vw=Re,yw=bn,eb=Ft.is,gw=J.GENERATE_TOKEN_EVENT,bw=J.UPDATE_ELEMENT_EVENT;function ch(t,e,n){this._eventBus=t,this._processInstances=e,this._processInstanceSettings=n}ch.prototype.createContextPads=function(t){if(t.attachers.length&&this._processInstances.getProcessInstances(t).length){var e=t.incoming.filter(function(r){return eb(r,"bpmn:SequenceFlow")}),n=this,i=[];return t.attachers.forEach(function(r){var o=r.outgoing.filter(function(c){return eb(c,"bpmn:SequenceFlow")});if(e.length&&o.length){var a=vw('<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(bw,{element:t})),n._eventBus.fire(gw,{element:r,processInstanceId:l})})})}}),i}},ch.$inject=["eventBus","processInstances","processInstanceSettings"];var xw=ch,Ew=Ft.is,_w=Re,ww=bn;function lh(t){this._exclusiveGatewaySettings=t}lh.prototype.createContextPads=function(t){var e=this;if(!(t.outgoing.filter(function(i){return Ew(i,"bpmn:SequenceFlow")}).length<2)){var n=_w('<div class="context-pad" title="Set Sequence Flow"><i class="fa fa-code-fork"></i></div>');return ww.bind(n,"click",function(){e._exclusiveGatewaySettings.setSequenceFlow(t)}),[{element:t,html:n}]}},lh.$inject=["exclusiveGatewaySettings"];var Sw=lh,nb=Re,ib=bn,uh=Ft.is,rb=J.GENERATE_TOKEN_EVENT;function ph(t){this._eventBus=t}ph.prototype.createContextPads=function(t){var e=t.parent.shownProcessInstance,n=t.incoming.filter(function(c){return uh(c,"bpmn:SequenceFlow")}),i=[];n.forEach(function(c){var l=c.source;uh(l,"bpmn:EventBasedGateway")&&l.tokenCount&&l.tokenCount[e]&&i.push(l)});var r=t.outgoing.filter(function(c){return uh(c,"bpmn:SequenceFlow")});if(n.length&&r.length){var o,a=this;if(t.tokenCount&&t.tokenCount[e])o=nb('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),ib.bind(o,"click",function(){t.tokenCount[e]--,a._eventBus.fire(rb,{element:t,processInstanceId:e})});else{if(!i.length)return;o=nb('<div class="context-pad" title="Trigger Event"><i class="fa fa-play"></i></div>'),ib.bind(o,"click",function(){i.forEach(function(c){c.tokenCount[e]--}),a._eventBus.fire(rb,{element:t,processInstanceId:e})})}return[{element:t,html:o}]}},ph.$inject=["eventBus"];var Cw=ph,Tw=Re,Aw=bn;function hh(t,e){this._processInstances=t,this._processInstanceSettings=e}hh.prototype.createContextPads=function(t){var e=this;if(!(this._processInstances.getProcessInstances(t).filter(function(i){return!i.isFinished}).length<2)){var n=Tw('<div class="context-pad" title="View Process Instances"><i class="fa fa-list-ol"></i></div>');return Aw.bind(n,"click",function(){e._processInstanceSettings.showNext(t)}),[{element:t,html:n}]}},hh.$inject=["processInstances","processInstanceSettings"];var kw=hh,Pw=Re,Mw=bn,Rw=Ft.is,Nw=J.GENERATE_TOKEN_EVENT;function dh(t,e,n){this._eventBus=t,this._elementRegistry=e,this._animation=n}dh.prototype.createContextPads=function(t){var e=!1;if(this._elementRegistry.forEach(function(r){r.tokenCount&&Object.values(r.tokenCount).forEach(function(o){o&&(e=!0)})}),!(Rw(t.parent,"bpmn:SubProcess")||e||this._animation.animations.length)){var n=this,i=Pw('<div class="context-pad"><i class="fa fa-play"></i></div>');return Mw.bind(i,"click",function(){n._eventBus.fire(Nw,{element:t})}),[{element:t,html:i}]}},dh.$inject=["eventBus","elementRegistry","animation"];var Iw=dh,ob=Ft.isAncestor,Dw=J.TOGGLE_MODE_EVENT,Bw=J.RESET_SIMULATION_EVENT,Ow=J.TERMINATE_EVENT,Lw=J.UPDATE_ELEMENTS_EVENT,jw=J.UPDATE_ELEMENT_EVENT,Vw=J.PROCESS_INSTANCE_SHOWN_EVENT,Fw=xw,zw=Sw,$w=Cw,Gw=kw,Uw=Iw,_a=500;function sr(t,e,n,i,r,o){var a=this;this._elementRegistry=e,this._overlays=n,this._injector=i,this._canvas=r,this._processInstances=o,this.overlayIds={},this.handlers={},this.registerHandler("bpmn:ExclusiveGateway",zw),this.registerHandler("bpmn:IntermediateCatchEvent",$w),this.registerHandler("bpmn:SubProcess",Gw),this.registerHandler("bpmn:SubProcess",Fw),this.registerHandler("bpmn:StartEvent",Uw),t.on(Dw,_a,function(c){c.simulationModeActive?a.openContextPads():a.closeContextPads()}),t.on(Bw,_a,function(){a.closeContextPads(),a.openContextPads()}),t.on(Ow,_a,function(c){var l=c.element.parent;a.closeContextPads(l)}),t.on(Lw,_a,function(c){c.elements.forEach(function(l){a.closeElementContextPads(l),a.openElementContextPads(l)})}),t.on(jw,_a,function(c){var l=c.element;a.closeElementContextPads(l),a.openElementContextPads(l)}),t.on(Vw,function(c){var l=c.processInstanceId,u=o.getProcessInstance(l).parent;a.closeContextPads(u),a.openContextPads(u)})}sr.prototype.registerHandler=function(t,e){var n=this._injector.instantiate(e);this.handlers[t]||(this.handlers[t]=[]),this.handlers[t].push(n)},sr.prototype.openContextPads=function(t){var e=this;t||(t=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){e.handlers[n.type]&&ob(t,n)&&e.openElementContextPads(n)})},sr.prototype.openElementContextPads=function(t){if(this.handlers[t.type]){var e=[];this.handlers[t.type].forEach(function(i){var r=i.createContextPads(t);r&&r.forEach(function(o){o&&e.push(o)})});var n=this;e.forEach(function(i){var r={top:-15,left:-15},o=n._overlays.add(i.element,"context-menu",{position:r,html:i.html,show:{minZoom:.5}});n.overlayIds[i.element.id]=o})}},sr.prototype.closeContextPads=function(t){var e=this;t||(t=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){ob(t,n)&&e.closeElementContextPads(n)})},sr.prototype.closeElementContextPads=function(t){var e=this;t.attachers&&t.attachers.length>0&&t.attachers.forEach(function(i){e.closeElementContextPads(i)}),t.children&&t.children.length>0&&t.children.forEach(function(i){e.closeElementContextPads(i)});var n=this.overlayIds[t.id];n&&(this._overlays.remove(n),delete this.overlayIds[t.id])},sr.$inject=["eventBus","elementRegistry","overlays","injector","canvas","processInstances"];var Hw=sr,qw=J.TOGGLE_MODE_EVENT;function ab(t,e,n,i,r,o,a,c){var l=this;function u(y,f,v){var g=y[f];y[f]=function(){return v.call(this,g,arguments)}}function p(y,f){u(y,f,function(v,g){if(!l.modelingDisabled)return v.apply(this,g)})}function d(y,f){u(y,f,function(v,g){if(l.modelingDisabled)throw new Error("model is read-only");return v.apply(this,g)})}this._eventBus=t,this.modelingDisabled=!1,t.on(qw,10001,function(y){var f=y.simulationModeActive;l.modelingDisabled=f,l.modelingDisabled&&(i.cancel(),e.close(),n.cancel()),a._update()}),p(e,"open"),p(n,"init"),p(i,"activate"),p(n,"init"),p(i,"activate"),d(o,"moveShape"),d(o,"updateAttachment"),d(o,"moveElements"),d(o,"moveConnection"),d(o,"layoutConnection"),d(o,"createConnection"),d(o,"createShape"),d(o,"createLabel"),d(o,"appendShape"),d(o,"removeElements"),d(o,"distributeElements"),d(o,"removeShape"),d(o,"removeConnection"),d(o,"replaceShape"),d(o,"pasteElements"),d(o,"alignElements"),d(o,"resizeShape"),d(o,"createSpace"),d(o,"updateWaypoints"),d(o,"reconnectStart"),d(o,"reconnectEnd"),u(r,"trigger",function(y,f){var v=f[0];if(!l.modelingDisabled||!function(g,b){return g.indexOf(b)>-1}(["undo","redo","copy","paste","removeSelection","spaceTool","lassoTool","globalConnectTool","distributeElements","alignElements","directEditing"],v))return y.apply(this,f)})}ab.$inject=["eventBus","contextPad","dragging","directEditing","editorActions","modeling","palette","paletteProvider"];var Ww=ab,Xw=Re,Kw=J.TOGGLE_MODE_EVENT,Yw=J.RESET_SIMULATION_EVENT,Jw=J.GENERATE_TOKEN_EVENT;function oo(t,e){var n=this;this._overlays=t,e.on(Kw,function(i){i.simulationModeActive||n.removeElementNotifications()}),e.on([Yw,Jw],function(){n.removeElementNotifications()})}oo.prototype.addElementNotifications=function(t,e){var n=this;t.forEach(function(i){n.addElementNotification(i,e)})},oo.prototype.addElementNotification=function(t,e){var n={top:-15,right:15},i='<div class="element-notification '+(e.type||"")+'">'+(e.icon?'<i class="fa '+e.icon+'"></i>':"")+('<span class="text">'+e.text+"</span>"||"")+"</div>",r=Xw(i);this._overlays.add(t,"element-notification",{position:n,html:r,show:{minZoom:.5}})},oo.prototype.removeElementNotifications=function(t){var e=this;t?t.forEach(function(n){e.removeElementNotification(n)}):this._overlays.remove({type:"element-notification"})},oo.prototype.removeElementNotification=function(t){this._overlays.remove({element:t})},oo.$inject=["overlays","eventBus"];var sb,cb,Zw=oo;function lb(){return cb?sb:(cb=1,sb=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1})}try{var Pc=lb()}catch{Pc=lb()}var Qw=/\s+/,t1=Object.prototype.toString;function Ii(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}Ii.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~Pc(e,t)||e.push(t),this.el.className=e.join(" "),this},Ii.prototype.remove=function(t){if(t1.call(t)=="[object RegExp]")return this.removeMatching(t);if(this.list)return this.list.remove(t),this;var e=this.array(),n=Pc(e,t);return~n&&e.splice(n,1),this.el.className=e.join(" "),this},Ii.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},Ii.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)},Ii.prototype.array=function(){var t=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(Qw);return t[0]===""&&t.shift(),t},Ii.prototype.has=Ii.prototype.contains=function(t){return this.list?this.list.contains(t):!!~Pc(this.array(),t)};var Di=function(t){return new Ii(t)},ub=Di,pb=Ft,wa=pb.is,hb=pb.supportedElements,e1=J.TOGGLE_MODE_EVENT,n1=J.GENERATE_TOKEN_EVENT,db=["bpmn:Process","bpmn:Collaboration","bpmn:Participant","bpmn:Lane","bpmn:TextAnnotation"];function mb(t){return t.labelTarget}function Sa(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(n1,2e4,function(a){var c=a.element;if(wa(c,"bpmn:StartEvent"))return o.allElementsSupported()?void 0:(o.showWarnings(),ub(o.canvasParent).add("warning"),!0)}),t.on(e1,function(a){a.simulationModeActive||ub(o.canvasParent).remove("warning")})}Sa.prototype.allElementsSupported=function(){var t=!0;return this._elementRegistry.forEach(function(e){wa(e,db)||wa(e,hb)||mb(e)||(t=!1)}),t},Sa.prototype.showWarnings=function(t){var e=this,n=[];this._elementRegistry.forEach(function(i){wa(i,db)||wa(i,hb)||mb(i)||(e.showWarning(i),n.indexOf(i.type)&&(e._notifications.showNotification(i.type+" not supported","warning"),n.push(i.type)))})},Sa.prototype.showWarning=function(t){this._elementNotifications.addElementNotification(t,{type:"warning",icon:"fa-exclamation-triangle",text:"Not supported"})},Sa.$inject=["eventBus","elementRegistry","canvas","notifications","elementNotifications"];var i1=Sa,mh=Ft.is,r1=J.TOGGLE_MODE_EVENT,o1=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-lighten-56"),a1=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-grey-darken-30");function Ca(t){return mh(t,"bpmn:SequenceFlow")}function cr(t,e,n){var i=this;this._elementRegistry=e,this._graphicsFactory=n,t.on(r1,function(r){r.simulationModeActive?i.setSequenceFlowsDefault():i.resetSequenceFlows()})}cr.prototype.setSequenceFlowsDefault=function(){var t=this;this._elementRegistry.filter(function(e){return mh(e,"bpmn:ExclusiveGateway")}).forEach(function(e){e.outgoing.filter(Ca).length&&t.setSequenceFlow(e,e.outgoing.filter(Ca)[0])})},cr.prototype.resetSequenceFlows=function(){var t=this;this._elementRegistry.filter(function(e){return mh(e,"bpmn:ExclusiveGateway")}).forEach(function(e){e.outgoing.filter(Ca).length&&t.resetSequenceFlow(e)})},cr.prototype.resetSequenceFlow=function(t){t.sequenceFlow&&delete t.sequenceFlow},cr.prototype.setSequenceFlow=function(t){var e=this,n=t.outgoing.filter(Ca);if(n.length){var i=t.sequenceFlow;t.sequenceFlow=i?function(r){var o=r.outgoing.filter(Ca),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,a1):e.setColor(r,o1)})}},cr.prototype.setColor=function(t,e){t.businessObject.di.set("stroke",e);var n=this._elementRegistry.getGraphics(t);this._graphicsFactory.update("connection",t,n)},cr.$inject=["eventBus","elementRegistry","graphicsFactory"];var s1=cr,Mc=Re,ni=Di,Ta=bn,Rc=xa,fh=Ft,c1=fh.getBusinessObject,cn=fh.is,l1=fh.isTypedEvent,u1=J.GENERATE_TOKEN_EVENT,p1=J.CONSUME_TOKEN_EVENT,h1=J.TOGGLE_MODE_EVENT,d1=J.RESET_SIMULATION_EVENT,m1=J.PROCESS_INSTANCE_CREATED_EVENT;function vh(t){return t&&t.businessObject.name}function ao(t,e,n,i){var r=this;this._notifications=e,this._tokenSimulationPalette=n,this._canvas=i,this._init(),t.on(u1,function(o){var a=o.element,c=vh(a);if(cn(a,"bpmn:BusinessRuleTask"))r.log(c||"Business Rule Task","info","bpmn-icon-business-rule");else if(cn(a,"bpmn:CallActivity"))r.log(c||"Call Activity","info","bpmn-icon-call-activity");else if(cn(a,["bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent"]))r.log(c||"Intermediate Event","info","bpmn-icon-intermediate-event-none");else if(cn(a,"bpmn:ManualTask"))r.log(c||"Manual Task","info","bpmn-icon-manual");else if(cn(a,"bpmn:ScriptTask"))r.log(c||"Script Task","info","bpmn-icon-script");else if(cn(a,"bpmn:ServiceTask"))r.log(c||"Service Task","info","bpmn-icon-service");else if(cn(a,"bpmn:StartEvent"))r.log(c||"Start Event","info","bpmn-icon-start-event-none");else if(cn(a,"bpmn:Task"))r.log(c||"Task","info","bpmn-icon-task");else if(cn(a,"bpmn:UserTask"))r.log(c||"User Task","info","bpmn-icon-user");else if(cn(a,"bpmn:ExclusiveGateway")){if(a.outgoing.length<2)return;var l=vh(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(p1,function(o){var a=o.element,c=vh(a);cn(a,"bpmn:EndEvent")&&(l1(c1(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(m1,function(o){var a=o.processInstanceId,c=o.parent;cn(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(),ni(r.container).add("hidden"))}),t.on(d1,function(o){r.emptyLog(),ni(r.container).add("hidden")})}ao.prototype._init=function(){var t=this;this.container=Mc('<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=Rc(".placeholder",this.container),this.content=Rc(".content",this.container),Ta.bind(this.content,"wheel",function(e){e.stopPropagation()}),Ta.bind(this.content,"mousedown",function(e){e.stopPropagation()}),this.close=Rc(".close",this.container),Ta.bind(this.close,"click",function(){ni(t.container).add("hidden")}),this.icon=Rc(".fa-align-left",this.container),Ta.bind(this.icon,"click",function(){ni(t.container).add("hidden")}),this._canvas.getContainer().appendChild(this.container),this.paletteEntry=Mc('<div class="entry" title="Show Simulation Log"><i class="fa fa-align-left"></i></div>'),Ta.bind(this.paletteEntry,"click",function(){ni(t.container).remove("hidden")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,3)},ao.prototype.toggle=function(){var t=this.container;ni(t).has("hidden")?ni(t).remove("hidden"):ni(t).add("hidden")},ao.prototype.log=function(t,e,n){ni(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=Mc('<p class="entry '+e+'"><span class="date">'+o+"</span>"+i+"</span>"+t+"</p>");this.content.appendChild(a),this.content.scrollTop=this.content.scrollHeight},ao.prototype.emptyLog=function(){for(;this.content.firstChild;)this.content.removeChild(this.content.firstChild);this.placeholder=Mc('<p class="entry placeholder">No Entries</p>'),this.content.appendChild(this.placeholder)},ao.$inject=["eventBus","notifications","tokenSimulationPalette","canvas"];var f1=ao,fb=Re,v1=J.TOGGLE_MODE_EVENT;function Aa(t,e){var n=this;this._eventBus=t,this._canvas=e,this._init(),t.on(v1,function(i){i.simulationModeActive||n.removeAll()})}Aa.prototype._init=function(){this.container=fb('<div class="notifications"></div>'),this._canvas.getContainer().appendChild(this.container)},Aa.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=fb('<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)},Aa.prototype.removeAll=function(){for(;this.container.children.length;)this.container.children[0].remove()},Aa.$inject=["eventBus","canvas"];var y1=Aa,g1=Re,lr=Di,b1=bn,x1=J.TOGGLE_MODE_EVENT,E1=J.PLAY_SIMULATION_EVENT,_1=J.PAUSE_SIMULATION_EVENT,w1=J.RESET_SIMULATION_EVENT,S1=J.ANIMATION_CREATED_EVENT,C1=J.PROCESS_INSTANCE_CREATED_EVENT,vb='<i class="fa fa-play"></i>';function Bi(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(C1,function(o){o.parent.parent||(r.activate(),r.unpause(),n.showNotification("Start Simulation","info"))}),t.on([w1,x1],function(){r.deactivate(),r.unpause()}),t.on(S1,function(o){var a=o.animation;r.isPaused&&a.pause()})}Bi.prototype._init=function(){this.paletteEntry=g1('<div class="entry disabled" title="Play/Pause Simulation">'+vb+"</div>"),b1.bind(this.paletteEntry,"click",this.toggle.bind(this)),this._tokenSimulationPalette.addEntry(this.paletteEntry,1)},Bi.prototype.toggle=function(){this.isActive&&(this.isPaused?this.unpause():this.pause())},Bi.prototype.pause=function(){this.isActive&&(lr(this.paletteEntry).remove("active"),lr(this.canvasParent).add("paused"),this.paletteEntry.innerHTML=vb,this._eventBus.fire(_1),this._notifications.showNotification("Pause Simulation","info"),this.isPaused=!0)},Bi.prototype.unpause=function(){this.isActive&&(lr(this.paletteEntry).add("active"),lr(this.canvasParent).remove("paused"),this.paletteEntry.innerHTML='<i class="fa fa-pause"></i>',this._eventBus.fire(E1),this._notifications.showNotification("Play Simulation","info"),this.isPaused=!1)},Bi.prototype.activate=function(){this.isActive=!0,lr(this.paletteEntry).remove("disabled")},Bi.prototype.deactivate=function(){this.isActive=!1,lr(this.paletteEntry).remove("active"),lr(this.paletteEntry).add("disabled")},Bi.$inject=["eventBus","tokenSimulationPalette","notifications","canvas"];var T1=Bi,A1=J.TOGGLE_MODE_EVENT;function ka(t,e,n){var i=this;this._elementRegistry=e,this._graphicsFactory=n,this.elementColors={},t.on(A1,5e4,function(r){r.simulationModeActive?i.preserveColors():i.resetColors()})}ka.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")})},ka.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={}},ka.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)},ka.$inject=["eventBus","elementRegistry","graphicsFactory"];var k1=ka,P1=J.TOGGLE_MODE_EVENT,M1=J.RESET_SIMULATION_EVENT;function Nc(t){this.nextProcessInstanceId=1,t.on(P1,this.reset.bind(this)),t.on(M1,this.reset.bind(this))}Nc.prototype.getNext=function(){var t=this.nextProcessInstanceId;return this.nextProcessInstanceId++,t},Nc.prototype.reset=function(){this.nextProcessInstanceId=1},Nc.$inject=["eventBus"];var R1=Nc,N1=J.TOGGLE_MODE_EVENT,I1=J.PROCESS_INSTANCE_CREATED_EVENT,D1=J.PROCESS_INSTANCE_FINISHED_EVENT,B1=J.PROCESS_INSTANCE_SHOWN_EVENT,O1=J.PROCESS_INSTANCE_HIDDEN_EVENT;function Pa(t,e,n,i){var r=this;this._animation=t,this._eventBus=e,this._processInstances=n,this._elementRegistry=i,this._eventBus.on(I1,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(D1,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(N1,function(){i.forEach(function(o){delete o.shownProcessInstance})})}Pa.prototype.showProcessInstance=function(t,e){this._animation.showProcessInstanceAnimations(t),e.shownProcessInstance=t,this._eventBus.fire(B1,{processInstanceId:t})},Pa.prototype.hideProcessInstance=function(t){this._animation.hideProcessInstanceAnimations(t),this._eventBus.fire(O1,{processInstanceId:t})},Pa.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)},Pa.$inject=["animation","eventBus","processInstances","elementRegistry"];var L1=Pa,j1=J.TOGGLE_MODE_EVENT,V1=J.RESET_SIMULATION_EVENT,F1=J.PROCESS_INSTANCE_CREATED_EVENT,z1=J.PROCESS_INSTANCE_FINISHED_EVENT;function ur(t,e){var n=this;this._eventBus=t,this._processInstanceIds=e,this.processInstances=[],t.on([j1,V1],function(){n.processInstances=[]})}ur.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(F1,i),n},ur.prototype.remove=function(t){this.processInstances=this.processInstances.filter(function(e){return e.processInstanceId!==t})},ur.prototype.finish=function(t){var e=this.processInstances.find(function(n){return n.processInstanceId===t});this._eventBus.fire(z1,e),e.isFinished=!0},ur.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},ur.prototype.getProcessInstance=function(t){return this.processInstances.find(function(e){return e.processInstanceId===t})},ur.$inject=["eventBus","processInstanceIds"];var $1=ur,G1=Re,yb=Di,U1=bn,H1=Ft.is,q1=J.TOGGLE_MODE_EVENT,W1=J.GENERATE_TOKEN_EVENT,X1=J.RESET_SIMULATION_EVENT;function Ic(t,e,n,i){var r=this;this._eventBus=t,this._tokenSimulationPalette=e,this._notifications=n,this._elementRegistry=i,this._init(),t.on(W1,function(o){H1(o.element,"bpmn:StartEvent")&&yb(r.paletteEntry).remove("disabled")}),t.on(q1,function(o){o.simulationModeActive||r.resetSimulation()})}Ic.prototype._init=function(){var t=this;this.paletteEntry=G1('<div class="entry disabled" title="Reset Simulation"><i class="fa fa-refresh"></i></div>'),U1.bind(this.paletteEntry,"click",function(){t.resetSimulation(),t._notifications.showNotification("Reset Simulation","info")}),this._tokenSimulationPalette.addEntry(this.paletteEntry,2)},Ic.prototype.resetSimulation=function(){yb(this.paletteEntry).add("disabled"),this._elementRegistry.forEach(function(t){t.tokenCount!==void 0&&delete t.tokenCount}),this._eventBus.fire(X1)},Ic.$inject=["eventBus","tokenSimulationPalette","notifications","elementRegistry"];var K1=Ic,Y1=Re,Dc=Di,yh=bn,Bc=xa,J1=J.TOGGLE_MODE_EVENT;function Oc(t,e,n){var i=this;this._canvas=t,this._animation=e,this._eventBus=n,this._init(),n.on(J1,function(r){r.simulationModeActive?Dc(i.container).remove("hidden"):Dc(i.container).add("hidden")})}Oc.prototype._init=function(){var t=this;this.container=Y1('<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=Bc("#animation-speed-1",this.container),n=Bc("#animation-speed-2",this.container),i=Bc("#animation-speed-3",this.container);yh.bind(e,"click",function(){t.setActive(e),t._animation.setAnimationSpeed(.5)}),yh.bind(n,"click",function(){t.setActive(n),t._animation.setAnimationSpeed(1)}),yh.bind(i,"click",function(){t.setActive(i),t._animation.setAnimationSpeed(1.5)}),this._canvas.getContainer().appendChild(this.container)},Oc.prototype.setActive=function(t){Bc.all(".animation-speed-button",this.container).forEach(function(e){Dc(e).remove("active")}),Dc(t).add("active")},Oc.$inject=["canvas","animation","eventBus"];var Z1=Oc,gb=Re,so=Di,gh=bn,bh=xa,Q1=function(t){for(var e;t.childNodes.length;)e=t.childNodes[0],t.removeChild(e);return t},tS=J.TOGGLE_MODE_EVENT,eS=J.PROCESS_INSTANCE_CREATED_EVENT,nS=J.PROCESS_INSTANCE_FINISHED_EVENT,iS=J.PROCESS_INSTANCE_SHOWN_EVENT,rS=J.PROCESS_INSTANCE_HIDDEN_EVENT,oS=J.RESET_SIMULATION_EVENT,aS=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-silver-base-97"),sS=getComputedStyle(document.documentElement).getPropertyValue("--token-simulation-green-base-44");function bb(t){return t===null}function xn(t,e,n,i,r,o){var a=this;this._eventBus=t,this._canvas=e,this._processInstanceSettings=n,this._processInstances=i,this._graphicsFactory=r,this._elementRegistry=o,this.highlightedElement=null,this._init(),t.on(tS,function(c){c.simulationModeActive?so(a.container).remove("hidden"):(so(a.container).add("hidden"),Q1(a.container),bb(a.highlightedElement)||(a.removeHighlightFromProcess(a.highlightedElement.element),a.highlightedElement=null))}),t.on(eS,function(c){a.addInstance(c)}),t.on(nS,function(c){a.removeInstance(c)}),t.on(iS,function(c){a.setInstanceShown(c.processInstanceId)}),t.on(rS,function(c){a.setInstanceHidden(c.processInstanceId)}),t.on(oS,function(){a.removeAllInstances()})}xn.prototype._init=function(){this.container=gb('<div class="process-instances hidden"></div>'),this._canvas.getContainer().appendChild(this.container)},xn.prototype.addInstance=function(t){var e=this,n=t.processInstanceId,i=t.parent,r=gb('<div id="instance-'+n+'" class="process-instance" title="View Process Instance '+n+'">'+n+"</div>");gh.bind(r,"click",function(){e._processInstances.getProcessInstances(i).forEach(function(o){e._processInstanceSettings.hideProcessInstance(o.processInstanceId)}),e._processInstanceSettings.showProcessInstance(n,i)}),gh.bind(r,"mouseenter",function(){e.highlightedElement={element:i,stroke:i.businessObject.di.get("stroke"),fill:i.businessObject.di.get("fill")},e.addHighlightToProcess(i)}),gh.bind(r,"mouseleave",function(){e.removeHighlightFromProcess(i),e.highlightedElement=null}),this.container.appendChild(r)},xn.prototype.removeInstance=function(t){var e=t.processInstanceId,n=bh("#instance-"+e,this.container);n&&n.remove()},xn.prototype.removeAllInstances=function(){this.container.innerHTML=""},xn.prototype.setInstanceShown=function(t){var e=bh("#instance-"+t,this.container);e&&so(e).add("active")},xn.prototype.setInstanceHidden=function(t){var e=bh("#instance-"+t,this.container);e&&so(e).remove("active")},xn.prototype.addHighlightToProcess=function(t){this.setColor(t,sS,aS),t.parent||so(this._canvas.getContainer()).add("highlight")},xn.prototype.removeHighlightFromProcess=function(t){bb(this.highlightedElement)||(this.setColor(t,this.highlightedElement.stroke,this.highlightedElement.fill),t.parent||so(this._canvas.getContainer()).remove("highlight"))},xn.prototype.setColor=function(t,e,n){var i=t.businessObject;i.di.set("stroke",e),i.di.set("fill",n);var r=this._elementRegistry.getGraphics(t);this._graphicsFactory.update("connection",t,r)},xn.$inject=["eventBus","canvas","processInstanceSettings","processInstances","graphicsFactory","elementRegistry"];var cS=xn,Lc=Ft,lS=Lc.getBusinessObject,jc=Lc.is,uS=Lc.isAncestor,pS=Lc.isTypedEvent,hS=J.CONSUME_TOKEN_EVENT;function Vc(t,e,n,i,r,o,a){this._animation=e,this._elementRegistry=n,this._log=i,this._elementNotifications=r,this._canvas=o,this._processInstances=a,t.on(hS,250,function(){})}Vc.prototype.isDeadlock=function(){var t=this,e=[];this._elementRegistry.forEach(function(r){r.tokenCount&&e.push(r)});var n=[],i=[];e.forEach(function(r){r.outgoing.filter(function(a){return jc(a,"bpmn:SequenceFlow")}).length||n.push(r),jc(r,"bpmn:ParallelGateway")&&r.incoming.filter(function(a){return jc(a,"bpmn:SequenceFlow")}).length>r.tokenCount&&n.push(r);var o=[];(function a(c){c.outgoing.forEach(function(l){o.indexOf(l.target)===-1&&(o.push(l.target),pS(lS(l.target),"bpmn:TerminateEventDefinition")&&i.push(c),a(l.target))})})(r)}),e.length&&!i.length&&n.length&&!this._animation.animations.length&&(t._log.log("Deadlock","warning","fa-exclamation-triangle"),n.forEach(function(r){t._elementNotifications.addElementNotification(r,{type:"warning",icon:"fa-exclamation-triangle",text:"Deadlock"})}))},Vc.prototype.isFinished=function(t,e){var n=this._processInstances.getProcessInstance(e).parent,i=!1;n||(n=this._canvas.getRootElement()),n.children.forEach(function(o){o.tokenCount&&o.tokenCount[e]&&o.tokenCount[e].length&&(i=!0)});var r=!1;if(this._animation.animations.forEach(function(o){uS(n,o.element)&&o.processInstanceId===e&&(r=!0)}),!i&&!r)return jc(n,"bpmn:SubProcess")?this._log.log("Subprocess "+e+" finished","info","fa-check-circle"):(this._log.log("Process "+e+" finished","success","fa-check-circle"),this._elementNotifications.addElementNotification(t,{type:"success",icon:"fa-check-circle",text:"Finished"})),!0},Vc.$inject=["eventBus","animation","elementRegistry","log","elementNotifications","canvas","processInstances"];var dS=Vc,mS=Re,Fc=Di,fS=bn,vS=xa,xb=J.TOGGLE_MODE_EVENT;function zc(t,e,n,i){var r=this;this._eventBus=t,this._canvas=e,this._selection=n,this._contextPad=i,this.simulationModeActive=!1,t.on("import.done",function(){r.canvasParent=r._canvas.getContainer().parentNode,r.palette=vS(".djs-palette",r._canvas.getContainer()),r._init()})}zc.prototype._init=function(){this.container=mS(`
- <div class="toggle-mode">
- Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>
- </div>
- `),fS.bind(this.container,"click",this.toggleMode.bind(this)),this._canvas.getContainer().appendChild(this.container)},zc.prototype.toggleMode=function(){if(this.simulationModeActive){this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-off"></i></span>',Fc(this.canvasParent).remove("simulation"),Fc(this.palette).remove("hidden"),this._eventBus.fire(xb,{simulationModeActive:!1});var t=this._selection.get();t.length===1&&this._contextPad.open(t[0])}else this.container.innerHTML='Token Simulation <span class="toggle"><i class="fa fa-toggle-on"></i></span>',Fc(this.canvasParent).add("simulation"),Fc(this.palette).add("hidden"),this._eventBus.fire(xb,{simulationModeActive:!0});this.simulationModeActive=!this.simulationModeActive},zc.$inject=["eventBus","canvas","selection","contextPad"];var yS=zc,gS=Re,Eb=Ft.isAncestor,bS=J.TOGGLE_MODE_EVENT,xS=J.GENERATE_TOKEN_EVENT,ES=J.CONSUME_TOKEN_EVENT,_S=J.RESET_SIMULATION_EVENT,wS=J.TERMINATE_EVENT,SS=J.PROCESS_INSTANCE_SHOWN_EVENT;function pr(t,e,n,i,r){var o=this;this._overlays=e,this._elementRegistry=n,this._canvas=i,this._processInstances=r,this.overlayIds={},t.on(bS,function(a){a.simulationModeActive||o.removeTokenCounts()}),t.on(_S,function(){o.removeTokenCounts()}),t.on(wS,function(a){var c=a.element.parent;o.removeTokenCounts(c)}),t.on([xS,ES],500,function(a){var c=a.element.parent;o.removeTokenCounts(c),o.addTokenCounts(c)}),t.on(SS,function(a){var c=a.processInstanceId,l=r.getProcessInstance(c).parent;o.removeTokenCounts(l),o.addTokenCounts(l)})}pr.prototype.addTokenCounts=function(t){var e=this;t||(t=this._canvas.getRootElement());var n=t.shownProcessInstance;if(!n){var i=this._processInstances.getProcessInstances(t);if(!i.length)return;n=i[0].processInstanceId}this._elementRegistry.forEach(function(r){Eb(t,r)&&e.addTokenCount(r,n)})},pr.prototype.addTokenCount=function(t,e){var n=t.tokenCount&&t.tokenCount[e];if(n){var i=this.createTokenCount(n),r={bottom:10,left:-15},o=this._overlays.add(t,"token-count",{position:r,html:i,show:{minZoom:.5}});this.overlayIds[t.id]=o}},pr.prototype.createTokenCount=function(t){return gS('<div class="token-count waiting">'+t+"</div>")},pr.prototype.removeTokenCounts=function(t){var e=this;t||(t=this._canvas.getRootElement()),this._elementRegistry.forEach(function(n){Eb(t,n)&&e.removeTokenCount(n)})},pr.prototype.removeTokenCount=function(t){var e=this.overlayIds[t.id];e&&(this._overlays.remove(e),delete this.overlayIds[t.id])},pr.$inject=["eventBus","overlays","elementRegistry","canvas","processInstances"];var CS=pr,Ma=Ft,TS=Ma.getBusinessObject,AS=Ma.is,kS=Ma.isAncestor,PS=Ma.getDescendants,MS=Ma.isTypedEvent,RS=J.GENERATE_TOKEN_EVENT,NS=J.TERMINATE_EVENT,IS=J.UPDATE_ELEMENTS_EVENT;function $c(t,e,n,i,r,o){this._animation=t,this._eventBus=e,this._log=n,this._simulationState=i,this._elementRegistry=r,this._processInstances=o}$c.prototype.consume=function(t){var e=t.element,n=t.processInstanceId,i=MS(TS(e),"bpmn:TerminateEventDefinition"),r=AS(e.parent,"bpmn:SubProcess");i&&(this._eventBus.fire(NS,t),this._elementRegistry.forEach(function(c){kS(e.parent,c)&&c.tokenCount&&c.tokenCount[n]&&delete c.tokenCount[n]}),this._processInstances.finish(n));var o=this._simulationState.isFinished(e,n);if(o&&this._processInstances.finish(n),(o||i)&&r){var a=this._processInstances.getProcessInstance(n);this._eventBus.fire(RS,{element:e.parent,processInstanceId:a.parentProcessInstanceId})}this._eventBus.fire(IS,{elements:PS(this._elementRegistry.getAll(),e.parent)})},$c.prototype.generate=function(t){},$c.$inject=["animation","eventBus","log","simulationState","elementRegistry","processInstances"];var DS=$c,BS=Ft.is,OS=J.UPDATE_ELEMENTS_EVENT;function Gc(t,e){this._eventBus=t,this._animation=e}Gc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId;e.tokenCount||(e.tokenCount={}),e.tokenCount[n]||(e.tokenCount[n]=0),e.tokenCount[n]++;var i=e.outgoing,r=[];i.forEach(function(o){var a=o.target;BS(a,"bpmn:IntermediateCatchEvent")&&r.push(a)}),this._eventBus.fire(OS,{elements:r})},Gc.prototype.generate=function(){},Gc.$inject=["eventBus","animation"];var LS=Gc,jS=J.CONSUME_TOKEN_EVENT,VS=J.GENERATE_TOKEN_EVENT;function Uc(t,e,n){this._eventBus=t,this._animation=e,this._elementRegistry=n}Uc.prototype.consume=function(t){var e=t.element;if(!e.sequenceFlow)throw new Error("no sequence flow configured for element "+e.id);this._eventBus.fire(VS,t)},Uc.prototype.generate=function(t){var e=t.element,n=t.processInstanceId;if(!e.sequenceFlow)throw new Error("no sequence flow configured for element "+e.id);var i=this,r=this._elementRegistry.get(e.sequenceFlow.id);this._animation.createAnimation(r,n,function(){i._eventBus.fire(jS,{element:r.target,processInstanceId:n})})},Uc.$inject=["eventBus","animation","elementRegistry"];var FS=Uc,_b=Ft.is,zS=J.CONSUME_TOKEN_EVENT,$S=J.UPDATE_ELEMENT_EVENT,GS=J.UPDATE_ELEMENTS_EVENT;function Hc(t,e,n){this._animation=t,this._eventBus=e,this._elementRegistry=n}Hc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId;e.tokenCount||(e.tokenCount={}),e.tokenCount[n]||(e.tokenCount[n]=0),e.tokenCount[n]++,this._eventBus.fire($S,{element:e})},Hc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(a){return _b(a,"bpmn:SequenceFlow")}).forEach(function(a){e._animation.createAnimation(a,i,function(){e._eventBus.fire(zS,{element:a.target,processInstanceId:i})})});var r=n.parent,o=this._elementRegistry.filter(function(a){return _b(a,"bpmn:IntermediateCatchEvent")&&a.parent===r});this._eventBus.fire(GS,{elements:o})},Hc.$inject=["animation","eventBus","elementRegistry"];var US=Hc,HS=Ft.is,qS=J.CONSUME_TOKEN_EVENT,WS=J.GENERATE_TOKEN_EVENT;function qc(t,e){this._animation=t,this._eventBus=e}qc.prototype.consume=function(t){this._eventBus.fire(WS,{element:t})},qc.prototype.generate=function(t){var e=this;t.outgoing.filter(function(n){return HS(n,"bpmn:SequenceFlow")}).forEach(function(n){e._animation.createAnimation(n,function(){e._eventBus.fire(qS,{element:n.target})})})},qc.$inject=["animation","eventBus"];var XS=qc,KS=Ft.is,YS=J.CONSUME_TOKEN_EVENT,JS=J.GENERATE_TOKEN_EVENT;function Wc(t,e){this._animation=t,this._eventBus=e}Wc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId;e.tokenCount||(e.tokenCount={}),e.tokenCount[n]||(e.tokenCount[n]=0),e.tokenCount[n]++,e.incoming.length===e.tokenCount[n]&&(this._eventBus.fire(JS,t),e.tokenCount[n]=0)},Wc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(r){return KS(r,"bpmn:SequenceFlow")}).forEach(function(r){e._animation.createAnimation(r,i,function(){e._eventBus.fire(YS,{element:r.target,processInstanceId:i})})})},Wc.$inject=["animation","eventBus"];var ZS=Wc,xh=Ft.is,QS=J.CONSUME_TOKEN_EVENT,tC=J.UPDATE_ELEMENTS_EVENT;function Xc(t,e,n,i){this._animation=t,this._eventBus=e,this._elementRegistry=n,this._processInstances=i}Xc.prototype.consume=function(){},Xc.prototype.generate=function(t){var e=this,n=t.element,i=t.parentProcessInstanceId,r=n.outgoing.filter(function(l){return xh(l,"bpmn:SequenceFlow")}),o=n.parent,a=this._processInstances.create(o,i);if(r.forEach(function(l){e._animation.createAnimation(l,a,function(){e._eventBus.fire(QS,{element:l.target,processInstanceId:a})})}),!xh(n.parent,"bpmn:SubProcess")){var c=this._elementRegistry.filter(function(l){return xh(l,"bpmn:StartEvent")});this._eventBus.fire(tC,{elements:c})}},Xc.$inject=["animation","eventBus","elementRegistry","processInstances"];var eC=Xc,wb=Ft.is,nC=J.CONSUME_TOKEN_EVENT,Sb=J.GENERATE_TOKEN_EVENT,Cb=J.UPDATE_ELEMENT_EVENT;function Kc(t,e,n){this._animation=t,this._eventBus=e,this._log=n}Kc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId,i=e.children.filter(function(r){return wb(r,"bpmn:StartEvent")})[0];i?(this._log.log("Starting Subprocess","info","fa-sign-in"),this._eventBus.fire(Sb,{element:i,parentProcessInstanceId:n})):(this._log.log("Skipping Subprocess","info","fa-angle-double-right"),this._eventBus.fire(Sb,t)),this._eventBus.fire(Cb,{element:e})},Kc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(r){return wb(r,"bpmn:SequenceFlow")}).forEach(function(r){e._animation.createAnimation(r,i,function(){e._eventBus.fire(nC,{element:r.target,processInstanceId:i})})}),this._eventBus.fire(Cb,{element:n})},Kc.$inject=["animation","eventBus","log"];var iC=Kc,rC=Ft.is,oC=J.CONSUME_TOKEN_EVENT,aC=J.UPDATE_ELEMENT_EVENT;function Yc(t,e,n){this._animation=t,this._eventBus=e,this._elementRegistry=n}Yc.prototype.consume=function(t){var e=t.element,n=t.processInstanceId;e.tokenCount||(e.tokenCount={}),e.tokenCount[n]||(e.tokenCount[n]=0),e.tokenCount[n]++,this._eventBus.fire(aC,{element:e})},Yc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(r){return rC(r,"bpmn:SequenceFlow")}).forEach(function(r){e._animation.createAnimation(r,i,function(){e._eventBus.fire(oC,{element:r.target,processInstanceId:i})})})},Yc.$inject=["animation","eventBus","elementRegistry"];var sC=Yc,cC=Ft.is,lC=J.CONSUME_TOKEN_EVENT,uC=J.GENERATE_TOKEN_EVENT;function Jc(t,e){this._animation=t,this._eventBus=e}Jc.prototype.consume=function(t){this._eventBus.fire(uC,t)},Jc.prototype.generate=function(t){var e=this,n=t.element,i=t.processInstanceId;n.outgoing.filter(function(r){return cC(r,"bpmn:SequenceFlow")}).forEach(function(r){e._animation.createAnimation(r,i,function(){e._eventBus.fire(lC,{element:r.target,processInstanceId:i})})})},Jc.$inject=["animation","eventBus"];var pC=DS,hC=LS,dC=FS,mC=US,fC=XS,vC=ZS,yC=eC,gC=iC,bC=sC,xC=Jc,EC=J.GENERATE_TOKEN_EVENT,_C=J.CONSUME_TOKEN_EVENT;function Eh(t,e,n){var i=this;this._injector=n,this.handlers={},this.registerHandler("bpmn:EndEvent",pC),this.registerHandler("bpmn:EventBasedGateway",hC),this.registerHandler("bpmn:ExclusiveGateway",dC),this.registerHandler("bpmn:IntermediateCatchEvent",mC),this.registerHandler("bpmn:IntermediateThrowEvent",fC),this.registerHandler("bpmn:ParallelGateway",vC),this.registerHandler("bpmn:StartEvent",yC),this.registerHandler("bpmn:SubProcess",gC),this.registerHandler("bpmn:BoundaryEvent",bC),this.registerHandler(["bpmn:BusinessRuleTask","bpmn:CallActivity","bpmn:ManualTask","bpmn:ScriptTask","bpmn:ServiceTask","bpmn:Task","bpmn:UserTask"],xC),t.on(EC,function(r){var o=r.element;if(!i.handlers[o.type])throw new Error("no handler for type "+o.type);i.handlers[o.type].generate(r)}),t.on(_C,function(r){var o=r.element;if(!i.handlers[o.type])throw new Error("no handler for type "+o.type);i.handlers[o.type].consume(r)})}Eh.prototype.registerHandler=function(t,e){var n=this,i=this._injector.instantiate(e);Array.isArray(t)||(t=[t]),t.forEach(function(r){n.handlers[r]=i})},Eh.$inject=["eventBus","animation","injector"];var wC=Eh;function Tb(t,e,n,i,r,o){o.register({toggleTokenSimulation:function(){e.toggleMode()}}),o.register({togglePauseTokenSimulation:function(){n.toggle()}}),o.register({resetTokenSimulation:function(){r.resetSimulation()}}),o.register({toggleTokenSimulationLog:function(){i.toggle()}})}Tb.$inject=["eventBus","toggleMode","pauseSimulation","log","resetSimulation","editorActions"];var SC=Tb,CC=J.TOGGLE_MODE_EVENT;function Ab(t,e){var n=e.get("editorActions",!1),i=e.get("keyboard",!1);if(i&&n){var r=!1;t.on("keyboard.init",function(){i.addListener(1e4,function(o){(function(a){Zc(["t","T"],a)?n.trigger("toggleTokenSimulation"):r&&(Zc(["l","L"],a)?n.trigger("toggleTokenSimulationLog"):Zc([" ","Spacebar"],a)?n.trigger("togglePauseTokenSimulation"):Zc(["r","R"],a)&&n.trigger("resetTokenSimulation"))})(o.keyEvent)})}),t.on(CC,function(o){var a=o.simulationModeActive;r=!!a})}}function Zc(t,e){return t.indexOf(e.key)>-1}Ab.$inject=["eventBus","injector"];var TC=Ab,AC=Re,kb=Di,kC=J.TOGGLE_MODE_EVENT;function Qc(t,e){var n=this;this._canvas=e,this.entries=[],this._init(),t.on(kC,function(i){i.simulationModeActive?kb(n.container).remove("hidden"):kb(n.container).add("hidden")})}Qc.prototype._init=function(){this.container=AC('<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 PC=gr({__init__:["animation","contextPads","disableModeling","elementNotifications","elementSupport","exclusiveGatewaySettings","log","notifications","pauseSimulation","preserveElementColors","processInstanceIds","processInstanceSettings","processInstances","resetSimulation","setAnimationSpeed","showProcessInstance","simulationState","toggleMode","tokenCount","tokenSimulationBehavior","tokenSimulationEditorActions","tokenSimulationKeyboardBindings","tokenSimulationPalette"],animation:["type",dw],contextPads:["type",Hw],disableModeling:["type",Ww],elementNotifications:["type",Zw],elementSupport:["type",i1],exclusiveGatewaySettings:["type",s1],log:["type",f1],notifications:["type",y1],pauseSimulation:["type",T1],preserveElementColors:["type",k1],processInstanceIds:["type",R1],processInstanceSettings:["type",L1],processInstances:["type",$1],resetSimulation:["type",K1],setAnimationSpeed:["type",Z1],showProcessInstance:["type",cS],simulationState:["type",dS],toggleMode:["type",yS],tokenCount:["type",CS],tokenSimulationBehavior:["type",wC],tokenSimulationEditorActions:["type",SC],tokenSimulationKeyboardBindings:["type",TC],tokenSimulationPalette:["type",Qc]}),MC={name:"Camunda",uri:"http://camunda.org/schema/1.0/bpmn",prefix:"camunda",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity","bpmn:SignalEventDefinition"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","camunda:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"camunda:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"},{name:"modelerTemplateVersion",isAttr:!0,type:"Integer"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["camunda:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","camunda:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","camunda:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["camunda:ServiceTaskLike","camunda:ExecutionListener","camunda:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["camunda:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["camunda:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0},{name:"id",type:"String",isAttr:!0},{name:"eventDefinitions",type:"bpmn:TimerEventDefinition",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvents",isAttr:!0,type:"String"}]}],emumerations:[]},RC={name:"Activiti",uri:"http://activiti.org/bpmn",prefix:"activiti",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"Definitions",isAbstract:!0,extends:["bpmn:Definitions"],properties:[{name:"diagramRelationId",isAttr:!0,type:"String"}]},{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","activiti:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"activiti:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0},{name:"executionListener",isAbstract:!0,type:"Expression"}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"multiinstance_type",superClass:["Element"]},{name:"multiinstance_condition",superClass:["Element"]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"},{name:"multiinstance_condition",isAttr:!0,type:"String"}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["activiti:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","activiti:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["activiti:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","activiti:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["activiti:ServiceTaskLike","activiti:ExecutionListener","activiti:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["activiti:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["activiti:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"FormProperty",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]}],emumerations:[]},NC={name:"Flowable",uri:"http://flowable.org/bpmn",prefix:"flowable",xml:{tagAlias:"lowerCase"},associations:[],types:[{name:"InOutBinding",superClass:["Element"],isAbstract:!0,properties:[{name:"source",isAttr:!0,type:"String"},{name:"sourceExpression",isAttr:!0,type:"String"},{name:"target",isAttr:!0,type:"String"},{name:"businessKey",isAttr:!0,type:"String"},{name:"local",isAttr:!0,type:"Boolean",default:!1},{name:"variables",isAttr:!0,type:"String"}]},{name:"In",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"Out",superClass:["InOutBinding"],meta:{allowedIn:["bpmn:CallActivity"]}},{name:"AsyncCapable",isAbstract:!0,extends:["bpmn:Activity","bpmn:Gateway","bpmn:Event"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1},{name:"asyncBefore",isAttr:!0,type:"Boolean",default:!1},{name:"asyncAfter",isAttr:!0,type:"Boolean",default:!1},{name:"exclusive",isAttr:!0,type:"Boolean",default:!0}]},{name:"JobPriorized",isAbstract:!0,extends:["bpmn:Process","flowable:AsyncCapable"],properties:[{name:"jobPriority",isAttr:!0,type:"String"}]},{name:"SignalEventDefinition",isAbstract:!0,extends:["bpmn:SignalEventDefinition"],properties:[{name:"async",isAttr:!0,type:"Boolean",default:!1}]},{name:"ErrorEventDefinition",isAbstract:!0,extends:["bpmn:ErrorEventDefinition"],properties:[{name:"errorCodeVariable",isAttr:!0,type:"String"},{name:"errorMessageVariable",isAttr:!0,type:"String"}]},{name:"Error",isAbstract:!0,extends:["bpmn:Error"],properties:[{name:"flowable:errorMessage",isAttr:!0,type:"String"}]},{name:"PotentialStarter",superClass:["Element"],properties:[{name:"resourceAssignmentExpression",type:"bpmn:ResourceAssignmentExpression"}]},{name:"FormSupported",isAbstract:!0,extends:["bpmn:StartEvent","bpmn:UserTask"],properties:[{name:"formHandlerClass",isAttr:!0,type:"String"},{name:"formKey",isAttr:!0,type:"String"},{name:"formType",isAttr:!0,type:"String"},{name:"formReadOnly",isAttr:!0,type:"Boolean",default:!1},{name:"formInit",isAttr:!0,type:"Boolean",default:!0}]},{name:"TemplateSupported",isAbstract:!0,extends:["bpmn:Process","bpmn:FlowElement"],properties:[{name:"modelerTemplate",isAttr:!0,type:"String"}]},{name:"Initiator",isAbstract:!0,extends:["bpmn:StartEvent"],properties:[{name:"initiator",isAttr:!0,type:"String"}]},{name:"ScriptTask",isAbstract:!0,extends:["bpmn:ScriptTask"],properties:[{name:"resultVariable",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"}]},{name:"Process",isAbstract:!0,extends:["bpmn:Process"],properties:[{name:"candidateStarterGroups",isAttr:!0,type:"String"},{name:"candidateStarterUsers",isAttr:!0,type:"String"},{name:"versionTag",isAttr:!0,type:"String"},{name:"historyTimeToLive",isAttr:!0,type:"String"},{name:"isStartableInTasklist",isAttr:!0,type:"Boolean",default:!0}]},{name:"EscalationEventDefinition",isAbstract:!0,extends:["bpmn:EscalationEventDefinition"],properties:[{name:"escalationCodeVariable",isAttr:!0,type:"String"}]},{name:"FormalExpression",isAbstract:!0,extends:["bpmn:FormalExpression"],properties:[{name:"resource",isAttr:!0,type:"String"}]},{name:"Assignable",extends:["bpmn:UserTask"],properties:[{name:"assignee",isAttr:!0,type:"String"},{name:"candidateUsers",isAttr:!0,type:"String"},{name:"candidateGroups",isAttr:!0,type:"String"},{name:"dueDate",isAttr:!0,type:"String"},{name:"followUpDate",isAttr:!0,type:"String"},{name:"priority",isAttr:!0,type:"String"}]},{name:"Assignee",supperClass:"Element",meta:{allowedIn:["*"]},properties:[{name:"label",type:"String",isAttr:!0},{name:"viewId",type:"Number",isAttr:!0}]},{name:"CallActivity",extends:["bpmn:CallActivity"],properties:[{name:"calledElementBinding",isAttr:!0,type:"String",default:"latest"},{name:"calledElementVersion",isAttr:!0,type:"String"},{name:"calledElementVersionTag",isAttr:!0,type:"String"},{name:"calledElementTenantId",isAttr:!0,type:"String"},{name:"caseRef",isAttr:!0,type:"String"},{name:"caseBinding",isAttr:!0,type:"String",default:"latest"},{name:"caseVersion",isAttr:!0,type:"String"},{name:"caseTenantId",isAttr:!0,type:"String"},{name:"variableMappingClass",isAttr:!0,type:"String"},{name:"variableMappingDelegateExpression",isAttr:!0,type:"String"}]},{name:"ServiceTaskLike",extends:["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"resultVariable",isAttr:!0,type:"String"}]},{name:"DmnCapable",extends:["bpmn:BusinessRuleTask"],properties:[{name:"decisionRef",isAttr:!0,type:"String"},{name:"decisionRefBinding",isAttr:!0,type:"String",default:"latest"},{name:"decisionRefVersion",isAttr:!0,type:"String"},{name:"mapDecisionResult",isAttr:!0,type:"String",default:"resultList"},{name:"decisionRefTenantId",isAttr:!0,type:"String"}]},{name:"ExternalCapable",extends:["flowable:ServiceTaskLike"],properties:[{name:"type",isAttr:!0,type:"String"},{name:"topic",isAttr:!0,type:"String"}]},{name:"TaskPriorized",extends:["bpmn:Process","flowable:ExternalCapable"],properties:[{name:"taskPriority",isAttr:!0,type:"String"}]},{name:"Properties",superClass:["Element"],meta:{allowedIn:["*"]},properties:[{name:"values",type:"Property",isMany:!0}]},{name:"Property",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0}]},{name:"Button",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"code",type:"String",isAttr:!0},{name:"isHide",type:"String",isAttr:!0},{name:"next",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"Assignee",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"condition",type:"String",isAttr:!0},{name:"operationType",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]},{name:"Connector",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"}]},{name:"InputOutput",superClass:["Element"],meta:{allowedIn:["bpmn:FlowNode","flowable:Connector"]},properties:[{name:"inputOutput",type:"InputOutput"},{name:"connectorId",type:"String"},{name:"inputParameters",isMany:!0,type:"InputParameter"},{name:"outputParameters",isMany:!0,type:"OutputParameter"}]},{name:"InputOutputParameter",properties:[{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"InputOutputParameterDefinition",isAbstract:!0},{name:"List",superClass:["InputOutputParameterDefinition"],properties:[{name:"items",isMany:!0,type:"InputOutputParameterDefinition"}]},{name:"Map",superClass:["InputOutputParameterDefinition"],properties:[{name:"entries",isMany:!0,type:"Entry"}]},{name:"Entry",properties:[{name:"key",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"},{name:"definition",type:"InputOutputParameterDefinition"}]},{name:"Value",superClass:["InputOutputParameterDefinition"],properties:[{name:"id",isAttr:!0,type:"String"},{name:"name",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Script",superClass:["InputOutputParameterDefinition"],properties:[{name:"scriptFormat",isAttr:!0,type:"String"},{name:"resource",isAttr:!0,type:"String"},{name:"value",isBody:!0,type:"String"}]},{name:"Field",superClass:["Element"],meta:{allowedIn:["flowable:ServiceTaskLike","flowable:ExecutionListener","flowable:TaskListener"]},properties:[{name:"name",isAttr:!0,type:"String"},{name:"expression",type:"String"},{name:"stringValue",isAttr:!0,type:"String"},{name:"string",type:"String"}]},{name:"ChildField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0}]},{name:"InputParameter",superClass:["InputOutputParameter"]},{name:"OutputParameter",superClass:["InputOutputParameter"]},{name:"Collectable",isAbstract:!0,extends:["bpmn:MultiInstanceLoopCharacteristics"],superClass:["flowable:AsyncCapable"],properties:[{name:"collection",isAttr:!0,type:"String"},{name:"elementVariable",isAttr:!0,type:"String"}]},{name:"FailedJobRetryTimeCycle",superClass:["Element"],meta:{allowedIn:["flowable:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},properties:[{name:"body",isBody:!0,type:"String"}]},{name:"ExecutionListener",superClass:["Element"],meta:{allowedIn:["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"TaskListener",superClass:["Element"],meta:{allowedIn:["bpmn:UserTask"]},properties:[{name:"expression",isAttr:!0,type:"String"},{name:"class",isAttr:!0,type:"String"},{name:"delegateExpression",isAttr:!0,type:"String"},{name:"event",isAttr:!0,type:"String"},{name:"script",type:"Script"},{name:"fields",type:"Field",isMany:!0}]},{name:"FormProperty",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"name",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"required",type:"String",isAttr:!0},{name:"readable",type:"String",isAttr:!0},{name:"writable",type:"String",isAttr:!0},{name:"variable",type:"String",isAttr:!0},{name:"expression",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"default",type:"String",isAttr:!0},{name:"values",type:"Value",isMany:!0},{name:"children",type:"ChildField",isMany:!0},{name:"extensionElements",type:"bpmn:ExtensionElements",isMany:!0}]},{name:"FormData",superClass:["Element"],meta:{allowedIn:["bpmn:StartEvent","bpmn:UserTask"]},properties:[{name:"fields",type:"FormField",isMany:!0},{name:"businessKey",type:"String",isAttr:!0}]},{name:"FormField",superClass:["Element"],properties:[{name:"id",type:"String",isAttr:!0},{name:"label",type:"String",isAttr:!0},{name:"type",type:"String",isAttr:!0},{name:"datePattern",type:"String",isAttr:!0},{name:"defaultValue",type:"String",isAttr:!0},{name:"properties",type:"Properties"},{name:"validation",type:"Validation"},{name:"values",type:"Value",isMany:!0}]},{name:"Validation",superClass:["Element"],properties:[{name:"constraints",type:"Constraint",isMany:!0}]},{name:"Constraint",superClass:["Element"],properties:[{name:"name",type:"String",isAttr:!0},{name:"config",type:"String",isAttr:!0}]},{name:"ConditionalEventDefinition",isAbstract:!0,extends:["bpmn:ConditionalEventDefinition"],properties:[{name:"variableName",isAttr:!0,type:"String"},{name:"variableEvent",isAttr:!0,type:"String"}]},{name:"Condition",superClass:["Element"],meta:{allowedIn:["bpmn:SequenceFlow"]},properties:[{name:"id",type:"String",isAttr:!0},{name:"field",type:"String",isAttr:!0},{name:"compare",type:"String",isAttr:!0},{name:"value",type:"String",isAttr:!0},{name:"logic",type:"String",isAttr:!0},{name:"sort",type:"Integer",isAttr:!0}]}],emumerations:[]},_h=Object.prototype.toString,IC=Object.prototype.hasOwnProperty;function Pb(t){return _h.call(t)==="[object Array]"}function Mb(t){const e=_h.call(t);return e==="[object Function]"||e==="[object AsyncFunction]"||e==="[object GeneratorFunction]"||e==="[object AsyncGeneratorFunction]"||e==="[object Proxy]"}function DC(t,e){return t!=null&&IC.call(t,e)}function BC(t,e){const n=function(r){return Mb(r)?r:o=>o===r}(e);let i;return Rb(t,function(r,o){if(n(r,o))return i=r,!1}),i}function Rb(t,e){let n,i;if(t===void 0)return;const r=Pb(t)?LC:OC;for(let o in t)if(DC(t,o)&&(n=t[o],i=e(n,r(o)),i===!1))return n}function co(t,e){return!!BC(t,e)}function OC(t){return t}function LC(t){return Number(t)}function jC(t,...e){return Object.assign(t,...e)}function lo(t){const e=this;t.on("moddleCopy.canCopyProperty",function(n){const i=n.property,r=n.parent;return e.canCopyProperty(i,r)})}function uo(t,e){return t&&Mb(t.$instanceOf)&&t.$instanceOf(e)}function Nb(t,e){return co(e,function(n){return uo(t,n)})}function En(t,e){return e?uo(t,e)?t:t.$parent?En(t.$parent,e):void 0:t.$parent}lo.$inject=["eventBus"],lo.prototype.canCopyProperty=function(t,e){return n=t,!(_h.call(n)==="[object Object]"&&!function(i,r){const o=i.$type&&i.$model.getTypeDescriptor(i.$type),a=o&&o.meta&&o.meta.allowedIn;return!a||function(c){return c.indexOf("*")!==-1}(a)?!0:co(a,function(c){return En(r,c)})}(t,e))&&!(uo(t,"camunda:InputOutput")&&!this.canHostInputOutput(e))&&!(Nb(t,["camunda:Connector","camunda:Field"])&&!this.canHostConnector(e))&&!(uo(t,"camunda:In")&&!this.canHostIn(e))&&void 0;var n},lo.prototype.canHostInputOutput=function(t){if(En(t,"camunda:Connector"))return!0;const e=En(t,"bpmn:FlowNode");return!!e&&!Nb(e,["bpmn:StartEvent","bpmn:Gateway","bpmn:BoundaryEvent"])&&!(uo(e,"bpmn:SubProcess")&&e.get("triggeredByEvent"))},lo.prototype.canHostConnector=function(t){return!uo(En(t,"camunda:ServiceTaskLike"),"bpmn:MessageEventDefinition")||En(t,"bpmn:IntermediateThrowEvent")||En(t,"bpmn:EndEvent")},lo.prototype.canHostIn=function(t){return En(t,"bpmn:CallActivity")?!0:!En(t,"bpmn:SignalEventDefinition")||En(t,"bpmn:IntermediateThrowEvent")||En(t,"bpmn:EndEvent")};const VC={__init__:["camundaModdleExtension"],camundaModdleExtension:["type",lo]},FC={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function wh(t,e){return t&&typeof t.$instanceOf=="function"&&t.$instanceOf(e)}function Sh(t,e){return(n=t)&&n.length&&co(t,function(i){return wh(i,e)});var n}function Ch(t,e,n){const i=e.name,r=FC[i.replace(/activiti:/,"")];return i===t&&function(o,a){return co(a,function(c){return wh(o,c)})}(n,r)}function Th(t){t.on("property.clone",function(e){const n=e.newElement,i=e.propertyDescriptor;this.canCloneProperty(n,i)},this)}Th.$inject=["eventBus"],Th.prototype.canCloneProperty=function(t,e){return Ch("activiti:FailedJobRetryTimeCycle",e,t)?Sh(t.eventDefinitions,"bpmn:TimerEventDefinition")||Sh(t.eventDefinitions,"bpmn:SignalEventDefinition")||wh(t.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):Ch("activiti:Connector",e,t)||Ch("activiti:Field",e,t)?Sh(t.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const zC={__init__:["ActivitiModdleExtension"],ActivitiModdleExtension:["type",Th]},$C={FailedJobRetryTimeCycle:["bpmn:StartEvent","bpmn:BoundaryEvent","bpmn:IntermediateCatchEvent","bpmn:Activity"],Connector:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"],Field:["bpmn:EndEvent","bpmn:IntermediateThrowEvent"]};function Ah(t,e){return t&&typeof t.$instanceOf=="function"&&t.$instanceOf(e)}function kh(t,e){return(n=t)&&n.length&&co(t,function(i){return Ah(i,e)});var n}function Ph(t,e,n){const i=e.name,r=$C[i.replace(/flowable:/,"")];return i===t&&function(o,a){return co(a,function(c){return Ah(o,c)})}(n,r)}function Mh(t){t.on("property.clone",function(e){const n=e.newElement,i=e.propertyDescriptor;this.canCloneProperty(n,i)},this)}Mh.$inject=["eventBus"],Mh.prototype.canCloneProperty=function(t,e){return Ph("flowable:FailedJobRetryTimeCycle",e,t)?kh(t.eventDefinitions,"bpmn:TimerEventDefinition")||kh(t.eventDefinitions,"bpmn:SignalEventDefinition")||Ah(t.loopCharacteristics,"bpmn:MultiInstanceLoopCharacteristics"):Ph("flowable:Connector",e,t)||Ph("flowable:Field",e,t)?kh(t.eventDefinitions,"bpmn:MessageEventDefinition"):void 0};const GC={__init__:["FlowableModdleExtension"],FlowableModdleExtension:["type",Mh]};var At,Oi,UC=Object.defineProperty,tl=Object.getOwnPropertySymbols,Ib=Object.prototype.hasOwnProperty,Db=Object.prototype.propertyIsEnumerable,Rh=(t,e,n)=>e in t?UC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Bb=(t,e)=>{for(var n in e||(e={}))Ib.call(e,n)&&Rh(t,n,e[n]);if(tl)for(var n of tl(e))Db.call(e,n)&&Rh(t,n,e[n]);return t},Li=(t,e,n)=>(Rh(t,typeof e!="symbol"?e+"":e,n),n);function _n(t){return t==null}function Nh(t){return typeof t=="string"}(Oi=At||(At={})).Root="Root",Oi.Declaration="Declaration",Oi.Comment="Comment",Oi.DocumentType="DocumentType",Oi.Element="Element",Oi.Text="Text",Oi.Instruction="Instruction",Oi.CDATA="CDATA";var ln=class{constructor(t,e=null,n=null){Li(this,"name"),Li(this,"type"),Li(this,"parent"),Li(this,"children"),Li(this,"attributes"),Li(this,"value"),Li(this,"selfClosing"),Li(this,"prefix"),this.name="",this.type=t,this.parent=e,this.value=n,this.children=null,this.attributes={},this.selfClosing=!1,this.prefix=""}setName(t){return this.name=t,this}setType(t){return this.type=t,this}setParent(t){return this.parent=t,this}setChildren(t){return this.children=t&&Array.from(t),this}setAttributes(t){return this.attributes=Bb({},t),this}setValue(t){return this.value=t,this}setSelfClosing(t){return this.selfClosing=t,this}setPrefix(t){return this.prefix=t,this}addAttribute(t,e){return this.attributes[t]=e,this}removeAttribute(t){return delete this.attributes[t],this}addChild(t){return t===this||(this.children||(this.children=[]),this.children.push(t),t.parent!==this&&(t.parent=this)),this}removeChild(t){if(this.children&&this.children.length){const e=this.children.findIndex(n=>n===t);~e&&(this.children.splice(e,1),t.parent=null)}return this}toJsObject(){return{name:this.name||void 0,prefix:this.prefix||void 0,type:this.type,attributes:Object.keys(this.attributes).length?this.attributes:void 0,value:_n(this.value)?void 0:this.value,selfClosing:this.selfClosing||void 0,children:(this.type===At.Element||this.type===At.Root)&&this.children&&this.children.length?this.children.map(t=>t.toJSON()):void 0}}toXmlString(t=" ",e=`
- `,n=0){const i=t.repeat(n);let r="";switch(this.type){case At.Root:r+=this.children&&this.children.length?this.children.map(o=>o.toXmlString(t,e,n)).join(e):"";break;case At.Element:{if(!this.name)return"";const o=this.prefix?`${this.prefix}:${this.name}`:this.name;r+=`${i}<${o}`;const a=Ob(this.attributes||{});a&&(r+=` ${a}`),this.children&&this.children.length?r+=`>${e}${this.children.map(c=>c.toXmlString(t,e,n+1)).join(e)}${e}${i}</${o}>`:r+=this.selfClosing?" />":`></${o}>`;break}case At.CDATA:r+=`${i}<![CDATA[${_n(this.value)?"":this.value}]]>`;break;case At.Text:r+=_n(this.value)?"":`${i}${this.value}`;break;case At.DocumentType:r+=_n(this.value)?"":`${i}<!DOCTYPE ${this.value}>`;break;case At.Comment:r+=`${i}<!-- ${_n(this.value)?"":this.value+" "}-->`;break;case At.Declaration:if(r+=`${i}<?xml `,!this.attributes||_n(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)Ib.call(a,u)&&c.indexOf(u)<0&&(l[u]=a[u]);if(a!=null&&tl)for(var u of tl(a))c.indexOf(u)<0&&Db.call(a,u)&&(l[u]=a[u]);return l})(this.attributes,["version"]);o&&(r+=Ob(o))}r+="?>";break;case At.Instruction:r+=_n(this.value)?"":`${i}<?${this.value}?>`}return r}toJSON(){return this.toJsObject()}toString(){return this.toXmlString("","")}};function Ob(t){return Object.keys(t).map(e=>{const n=t[e];return _n(n)?null:function(i){return typeof i=="boolean"}(n)?n?e:null:`${e}="${n}"`}).filter(Boolean).join(" ")}var Lb=t=>t,jb={ignoreAttributes:!1,parseNodeValue:!0,trimValues:!0,prefixInName:!1,valueProcessor:Lb,attributeProcessor:Lb},HC=Object.keys(jb),hr="Tag is not closed.";function qC(t,e={}){const n=t.replace(/\r\n?/g,`
- `),i=function(l={}){const u=Bb({},l);return HC.forEach(p=>{_n(u[p])&&(u[p]=jb[p])}),u}(e),r=n.length,o=new ln(At.Root);let a=o,c="";for(let l=0;l<r;l++){const u=n[l];if(u!=="<")c+=u;else if(n[l+1]==="/"){const p=po(n,">",l,`Element End ${hr}`);let d=n.substring(l+2,p),y="";if(!i.prefixInName){const f=d.indexOf(":");~f&&(y=d.substring(0,f),d=d.substring(f+1))}if(a.prefix!==y||a.name!==d)throw new Error("End Tag is incorrect.");if(c){const f=Ih(dr("",At.Text,c,i));f&&a.addChild(new ln(At.Text,a,f))}a=a.parent,c="",l=p}else if(n[l+1]==="?"){const p=po(n,"?>",l,`Processing Instruction ${hr}`),d=n.substring(l+2,p-1);if(a)if(d.startsWith("xml ")&&d.includes("version=")&&a.type===At.Root){const y=new ln(At.Declaration,a);y.attributes=Dh(d.substr(4),At.Declaration,i),a.addChild(y)}else a.addChild(new ln(At.Instruction,a,dr("",At.Instruction,d,i)));l=p}else if(n.substr(l+1,3)==="!--"){const p=po(n,"-->",l,`Comment ${hr}`),d=n.substring(l+4,p-2);a&&a.addChild(new ln(At.Comment,a,dr("",At.Comment,d,i))),l=p}else if(n.substr(l+1,8)==="!DOCTYPE"){let p=po(n,">",l,`Document Type ${hr}`),d=n.substring(l+9,p);d.includes("[")&&(p=po(n,"]>",l,`Document Type ${hr}`),d=n.substring(l+9,p)),a&&a.addChild(new ln(At.DocumentType,a,dr("",At.DocumentType,d,i))),l=p}else if(n.substr(l+1,8)==="![CDATA["){const p=po(n,"]]>",l,`CDATA Section ${hr}`),d=n.substring(l+9,p-2);if(a&&c){const y=Ih(dr("",At.Text,c,i));y&&a.addChild(new ln(At.Text,a,y))}a.addChild(new ln(At.CDATA,a,dr("",At.CDATA,d,i))),c="",l=p}else{let p="",d="",y=l+1;for(;y<=r;){let b=n[y];if(p)b===p&&(p="");else if(b==='"'||b==="'")p=b;else if(b===" ")b=" ";else if(b===">")break;d+=b,y++}if(y>r)throw new Error(`Element ${hr}`);d=d.trim();const f=d.indexOf(" ");let v=d,g="";if(~f?(v=d.substr(0,f),d=d.substr(f+1)):d="",!i.prefixInName){const b=v.indexOf(":");~b&&(g=v.substring(0,b),v=v.substring(b+1))}if(a&&c){const b=Ih(dr("",At.Text,c,i));b&&a.addChild(new ln(At.Text,a,b))}if(d.length&&d.lastIndexOf("/")===d.length-1){v[v.length-1]==="/"?(v=v.substr(0,v.length-1),d=""):d=d.substr(0,d.length-1);const b=new ln(At.Element,a);b.name=v,b.selfClosing=!0,b.prefix=g,d&&!i.ignoreAttributes&&(b.attributes=Dh(d,At.Element,i)),a.addChild(b)}else{const b=new ln(At.Element,a);d&&!i.ignoreAttributes&&(b.attributes=Dh(d,At.Element,i)),b.name=v,b.prefix=g,a.addChild(b),a=b}c="",l=y}}return o}function po(t,e,n,i){const r=t.indexOf(e,n);if(!~r)throw new Error(i);return r+e.length-1}function dr(t,e,n,i){return n?(i.trimValues&&(n=n.trim()),Vb(i.valueProcessor(n,e,t),i.parseNodeValue)):null}function Vb(t,e){return e&&Nh(t)?(t=t.trim())==="true"||t!=="false"&&function(n){const i=parseFloat(n);return Number.isNaN(i)?n:i}(t):_n(t)?null:t}function Ih(t){return _n(t)?"":Nh(t)?t:String(t)}var WC=/[^\s=]+\s*(=\s*['"][\s\S]*?['"])?/g;function Dh(t,e,n){const i=(t=t.replace(/\r?\n/g," ")).match(WC)||[],r={};for(let o=0;o<i.length;o++){const a=i[o];let[c,l]=a.split("=");c=c.trim(),Nh(l)?(l=l.substring(1,l.length-1),n.trimValues&&(l=l.trim()),r[c]=Vb(n.attributeProcessor(l,c,e),n.parseNodeValue)):r[c]=!0}return r}const XC={class:"my-process-designer"},KC={class:"my-process-designer__header",style:{"z-index":"999",display:"table-row-group"}},YC={style:{color:"#409eff"}},JC={class:"my-process-designer__container"},ZC={class:"hljs"},el=ke({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=X(),i=X(),r=e,o=t;ja("configGlobal",o);let a=null;const c=X(1),l=X(!1),u=X(!1),p=X(""),d=X("xml"),y=X(!1),f=X(!1),v=vl(()=>{const T=[];if(o.onlyCustomizeAddi)return Object.prototype.toString.call(o.additionalModel)=="[object Array]"?o.additionalModel||[]:[o.additionalModel];Object.prototype.toString.call(o.additionalModel)=="[object Array]"?T.push(...o.additionalModel):o.additionalModel&&T.push(o.additionalModel);const M={translate:["value",(I=o.translations||Z_,function($,P){return P=P||{},($=I[$]||$).replace(/{([^}]+)}/g,function(x,N){let j=P[N];return I[P[N]]!==null&&I[P[N]]!==void 0&&(j=I[P[N]]),j||"{"+N+"}"})})]};var I;return T.push(M),o.simulation&&T.push(PC),o.prefix==="camunda"&&T.push(VC),o.prefix==="flowable"&&T.push(GC),o.prefix==="activiti"&&T.push(zC),T}),g=vl(()=>{const T={};if(o.onlyCustomizeModdle)return o.moddleExtension||null;if(o.moddleExtension)for(let M in o.moddleExtension)T[M]=o.moddleExtension[M];return o.prefix==="activiti"&&(T.activiti=RC),o.prefix==="flowable"&&(T.flowable=NC),o.prefix==="camunda"&&(T.camunda=MC),T}),b=()=>{const T=a.get("eventBus");o.events.forEach(M=>{T.on(M,function(I){M.replace(/\./g,"-");let $=I?I.element:null;r("element-click",$,I)})}),T.on("commandStack.changed",async M=>{try{y.value=a.get("commandStack").canRedo(),f.value=a.get("commandStack").canUndo();let{xml:I}=await a.saveXML({format:!0});r("commandStack-changed",M),r("input",I),r("change",I)}catch{}}),a.on("canvas.viewbox.changed",({viewbox:M})=>{r("canvas-viewbox-changed",{viewbox:M});const{scale:I}=M;c.value=Math.floor(100*I)/100})},E=async T=>{let M=o.processId||`Process_${new Date().getTime()}`,I=o.processName||`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,$=T||qg(M,I,o.prefix);try{let{warnings:P}=await a.importXML($);P&&P.length&&P.forEach(x=>{})}catch{}},S=async T=>{try{if(T==="xml"||T==="bpmn"){const{err:I,xml:$}=await a.saveXML();let{href:P,filename:x}=w(T.toUpperCase(),$);M(P,x)}else{const{err:I,svg:$}=await a.saveSVG();if(I)return;let{href:P,filename:x}=w("SVG",$);M(P,x)}}catch{}function M(I,$){if(I&&$){let P=document.createElement("a");P.download=$,P.href=I,P.click(),URL.revokeObjectURL(P.href)}}},w=(T,M)=>({filename:`diagram.${T}`,href:`data:application/${T==="svg"?"text/xml":"bpmn20-xml"};charset=UTF-8,${encodeURIComponent(M)}`,data:M}),C=()=>{const T=i.value.files[0],M=new FileReader;M.readAsText(T),M.onload=function(){let I=this.result;E(I)}},B=()=>{u.value=!u.value,o.simulation&&a.get("toggleMode","strict").toggleMode()},s=T=>{const M=a.get("alignElements"),I=a.get("selection").get();!I||I.length<=1?Qb.warning("\u8BF7\u6309\u4F4F Shift \u952E\u9009\u62E9\u591A\u4E2A\u5143\u7D20\u5BF9\u9F50"):br.confirm("\u81EA\u52A8\u5BF9\u9F50\u53EF\u80FD\u9020\u6210\u56FE\u5F62\u53D8\u5F62\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F","\u8B66\u544A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{M.trigger(I,T)})},h=()=>{a.saveXML({format:!0}).then(({xml:T})=>{p.value=T,d.value="xml",l.value=!0})},m=()=>{a.saveXML({format:!0}).then(({xml:T})=>{var I;const M=new ln(At.Root,qC(T));p.value=(I=M.parent)==null?void 0:I.toJSON(),d.value="json",l.value=!0})},_=async()=>{const{err:T,xml:M}=await a.saveXML();T?alert("\u4FDD\u5B58\u6A21\u578B\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\uFF01"):r("save",M)};return Yb(()=>{}),fo(()=>{(()=>{if(a)return;let T=document.getElementById("bpmnCanvas");a=new On({container:T,keyboard:o.keyboard?{bindTo:document}:null,additionalModules:v.value,moddleExtensions:g.value}),r("init-finished",a),b()})(),E(o.value)}),wn(()=>{a&&a.destroy(),r("destroy",a),a=null}),(T,M)=>{const I=Cr,$=c0,P=t0,x=e0,N=xr,j=Xb,G=Jb("highlight");return nt(),Nt("div",XC,[Ot("div",KC,[Zb(T.$slots,"control-header"),T.$slots["control-header"]?Tt("",!0):(nt(),Nt(qe,{key:0},[R(x,{key:"file-control"},{default:V(()=>[R(I,{preIcon:"ep:folder-opened",title:"\u6253\u5F00\u6587\u4EF6",onClick:M[0]||(M[0]=W=>D(i).click())}),R(P,{effect:"light",placement:"bottom"},{content:V(()=>[Ot("div",YC,[R($,{title:"\u4E0B\u8F7D\u4E3AXML\u6587\u4EF6",onClick:M[1]||(M[1]=W=>{S("xml")})}),M[17]||(M[17]=Ot("br",null,null,-1)),R($,{title:"\u4E0B\u8F7D\u4E3ASVG\u6587\u4EF6",onClick:M[2]||(M[2]=W=>{S("svg")})}),M[18]||(M[18]=Ot("br",null,null,-1)),R($,{title:"\u4E0B\u8F7D\u4E3ABPMN\u6587\u4EF6",onClick:M[3]||(M[3]=W=>{S("bpmn")})})])]),default:V(()=>[R(I,{title:"\u4E0B\u8F7D\u6587\u4EF6",preIcon:"ep:download"})]),_:1}),R(P,{effect:"light"},{content:V(()=>[R($,{title:"\u9884\u89C8XML",onClick:h}),M[19]||(M[19]=Ot("br",null,null,-1)),R($,{title:"\u9884\u89C8JSON",onClick:m})]),default:V(()=>[R(I,{preIcon:"ep:view",title:"\u6D4F\u89C8"})]),_:1}),o.simulation?(nt(),St(P,{key:0,effect:"light",content:D(u)?"\u9000\u51FA\u6A21\u62DF":"\u5F00\u542F\u6A21\u62DF"},{default:V(()=>[R(I,{preIcon:"ep:cpu",title:"\u6A21\u62DF",onClick:B})]),_:1},8,["content"])):Tt("",!0)]),_:1}),R(x,{key:"align-control"},{default:V(()=>[R(P,{effect:"light",content:"\u5411\u5DE6\u5BF9\u9F50"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-bottom",onClick:M[4]||(M[4]=W=>s("left"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u53F3\u5BF9\u9F50"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-top",onClick:M[5]||(M[5]=W=>s("right"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u4E0A\u5BF9\u9F50"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-left",onClick:M[6]||(M[6]=W=>s("top"))})]),_:1}),R(P,{effect:"light",content:"\u5411\u4E0B\u5BF9\u9F50"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-right",onClick:M[7]||(M[7]=W=>s("bottom"))})]),_:1}),R(P,{effect:"light",content:"\u6C34\u5E73\u5C45\u4E2D"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-center",onClick:M[8]||(M[8]=W=>s("center"))})]),_:1}),R(P,{effect:"light",content:"\u5782\u76F4\u5C45\u4E2D"},{default:V(()=>[R(I,{preIcon:"fa:align-left",class:"align align-middle",onClick:M[9]||(M[9]=W=>s("middle"))})]),_:1})]),_:1}),R(x,{key:"scale-control"},{default:V(()=>[R(P,{effect:"light",content:"\u7F29\u5C0F\u89C6\u56FE"},{default:V(()=>[R(I,{preIcon:"ep:zoom-out",onClick:M[10]||(M[10]=W=>((tt=.1)=>{let it=Math.floor(100*c.value-100*tt)/100;if(it<.2)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be less than 0.2");c.value=it,a.get("canvas").zoom(c.value)})()),disabled:D(c)<.2},null,8,["disabled"])]),_:1}),R(N,null,{default:V(()=>[dt(Jh(Math.floor(10*D(c)*10)+"%"),1)]),_:1}),R(P,{effect:"light",content:"\u653E\u5927\u89C6\u56FE"},{default:V(()=>[R(I,{preIcon:"ep:zoom-in",onClick:M[11]||(M[11]=W=>((tt=.1)=>{let it=Math.floor(100*c.value+100*tt)/100;if(it>4)throw new Error("[Process Designer Warn ]: The zoom ratio cannot be greater than 4");c.value=it,a.get("canvas").zoom(c.value)})()),disabled:D(c)>4},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u91CD\u7F6E\u89C6\u56FE\u5E76\u5C45\u4E2D"},{default:V(()=>[R(I,{preIcon:"ep:scale-to-original",onClick:M[12]||(M[12]=W=>(c.value=1,void a.get("canvas").zoom("fit-viewport","auto")))})]),_:1})]),_:1}),R(x,{key:"stack-control"},{default:V(()=>[R(P,{effect:"light",content:"\u64A4\u9500"},{default:V(()=>[R(I,{preIcon:"ep:refresh-left",onClick:M[13]||(M[13]=W=>{a.get("commandStack").undo()}),disabled:!D(f)},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u6062\u590D"},{default:V(()=>[R(I,{preIcon:"ep:refresh-right",onClick:M[14]||(M[14]=W=>{a.get("commandStack").redo()}),disabled:!D(y)},null,8,["disabled"])]),_:1}),R(P,{effect:"light",content:"\u91CD\u65B0\u7ED8\u5236"},{default:V(()=>[R(I,{preIcon:"ep:refresh",onClick:M[15]||(M[15]=W=>(y.value=!1,f.value=!1,void E(null)))})]),_:1})]),_:1}),R(I,{preIcon:"ep:plus",title:"\u4FDD\u5B58\u6A21\u578B",onClick:_,type:o.headerButtonType,disabled:D(u)},null,8,["type","disabled"])],64)),Ot("input",{type:"file",id:"files",ref_key:"refFile",ref:i,style:{display:"none"},accept:".xml, .bpmn",onChange:C},null,544)]),Ot("div",JC,[Ot("div",{class:"my-process-designer__canvas",ref_key:"bpmnCanvas",ref:n,id:"bpmnCanvas",style:{width:"1680px",height:"800px"}},null,512)]),R(j,{title:"\u9884\u89C8",modelValue:D(l),"onUpdate:modelValue":M[16]||(M[16]=W=>We(l)?l.value=W:null),width:"80%",scroll:!0,"max-height":"600px"},{default:V(()=>[Va((nt(),Nt("div",null,[Ot("code",ZC,Jh(D(p)),1)])),[[G]])]),_:1},8,["modelValue"])])}}});el.install=function(t){t.component(el.name,el)};const QC={class:"panel-tab__content"},tT={key:0},eT={key:1},nT=ke({name:"ElementBaseInfo",__name:"ElementBaseInfo",props:{businessObject:{type:Object,default:()=>{}},model:{type:Object,default:()=>{}}},setup(t){const e=t,n=X({}),i=X(),r=X({}),o=n0({id:[{required:!0,message:"\u6D41\u7A0B\u6807\u8BC6\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],name:[{required:!0,message:"\u6D41\u7A0B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),a=()=>window==null?void 0:window.bpmnInstances,c=p=>{p&&p.match(/[a-zA-Z_][\-_.0-9a-zA-Z$]*/)&&(r.value.id=p,setTimeout(()=>{u("id")},100))},l=p=>{p&&(r.value.name=p,setTimeout(()=>{u("name")},100))},u=p=>{const d=Object.create(null);d[p]=r.value[p],n.value={...r.value,...n.value},p==="id"?a().modeling.updateProperties(Bt(i.value),{id:r.value[p],di:{id:`${r.value[p]}_di`}}):a().modeling.updateProperties(Bt(i.value),d)};return fo(()=>{setTimeout(()=>{c(e.model.key),l(e.model.name)},1e3)}),le(()=>e.businessObject,p=>{var d;p&&(i.value=(d=a())==null?void 0:d.bpmnElement,r.value=i.value.businessObject,n.value.type=i.value.businessObject.$type)}),wn(()=>{i.value=null}),(p,d)=>{const y=bl,f=hn,v=dn,g=Vn;return nt(),Nt("div",QC,[R(g,{"label-width":"90px",model:D(n),rules:D(o)},{default:V(()=>[D(n).type=="bpmn:Process"?(nt(),Nt("div",tT,[R(y,{href:"https://doc.iocoder.cn/bpm/#_3-%E6%B5%81%E7%A8%8B%E5%9B%BE%E7%A4%BA%E4%BE%8B",type:"danger",target:"_blank"},{default:V(()=>d[6]||(d[6]=[dt(" \u5982\u4F55\u5B9E\u73B0\u5B9E\u73B0\u4F1A\u7B7E\u3001\u6216\u7B7E\uFF1F ")])),_:1}),R(v,{label:"\u6D41\u7A0B\u6807\u8BC6",prop:"id"},{default:V(()=>[R(f,{modelValue:D(n).id,"onUpdate:modelValue":d[0]||(d[0]=b=>D(n).id=b),placeholder:"\u8BF7\u8F93\u5165\u6D41\u6807\u6807\u8BC6",disabled:D(n).id!==void 0&&D(n).id.length>0,onChange:c},null,8,["modelValue","disabled"])]),_:1}),R(v,{label:"\u6D41\u7A0B\u540D\u79F0",prop:"name"},{default:V(()=>[R(f,{modelValue:D(n).name,"onUpdate:modelValue":d[1]||(d[1]=b=>D(n).name=b),placeholder:"\u8BF7\u8F93\u5165\u6D41\u7A0B\u540D\u79F0",clearable:"",onChange:l},null,8,["modelValue"])]),_:1})])):(nt(),Nt("div",eT,[R(v,{label:"ID"},{default:V(()=>[R(f,{modelValue:D(r).id,"onUpdate:modelValue":d[2]||(d[2]=b=>D(r).id=b),clearable:"",onChange:d[3]||(d[3]=b=>u("id"))},null,8,["modelValue"])]),_:1}),R(v,{label:"\u540D\u79F0"},{default:V(()=>[R(f,{modelValue:D(r).name,"onUpdate:modelValue":d[4]||(d[4]=b=>D(r).name=b),clearable:"",onChange:d[5]||(d[5]=b=>u("name"))},null,8,["modelValue"])]),_:1})]))]),_:1},8,["model","rules"])])}}}),iT={class:"panel-tab__content"},rT={class:"element-property input-property"},oT={class:"element-property__value"},aT=ke({name:"ElementOtherConfig",__name:"ElementOtherConfig",props:{id:String},setup(t){const e=t,n=X(""),i=X(),r=()=>window.bpmnInstances,o=()=>{i.value&&i.value.id===e.id||(i.value=r().elementRegistry.get(e.id));const a=r().bpmnFactory.create("bpmn:Documentation",{text:n.value});r().modeling.updateProperties(Bt(i.value),{documentation:[a]})};return wn(()=>{i.value=null}),le(()=>e.id,a=>{a&&a.length?Ne(()=>{var l;const c=(l=r().bpmnElement.businessObject)==null?void 0:l.documentation;n.value=c&&c.length?c[0].text:""}):n.value=""},{immediate:!0}),(a,c)=>{const l=hn;return nt(),Nt("div",iT,[Ot("div",rT,[c[1]||(c[1]=Ot("div",{class:"element-property__label"},"\u5143\u7D20\u6587\u6863\uFF1A",-1)),Ot("div",oT,[R(l,{type:"textarea",modelValue:D(n),"onUpdate:modelValue":c[0]||(c[0]=u=>We(n)?n.value=u:null),resize:"vertical",autosize:{minRows:2,maxRows:4},onInput:o,onBlur:o},null,8,["modelValue"])])])])}}}),sT={style:{"margin-top":"16px"}},cT=ke({name:"UserTask",__name:"UserTask",props:{id:String,type:String},setup(t){const e=t,n=X({assignee:"",candidateUsers:[],candidateGroups:[],dueDate:"",followUpDate:"",priority:""}),i=X({}),r=X(),o=()=>window==null?void 0:window.bpmnInstances,a=c=>{const l=Object.create(null);l[c]=c==="candidateUsers"||c==="candidateGroups"?i.value[c]&&i.value[c].length?i.value[c].join():null:i.value[c]||null,o().modeling.updateProperties(Bt(r.value),l)};return le(()=>e.id,()=>{r.value=o().bpmnElement,Ne(()=>{(()=>{var c,l;for(let u in n.value){let p;p=u==="candidateUsers"||u==="candidateGroups"?(c=r.value)!=null&&c.businessObject[u]?r.value.businessObject[u].split(","):[]:((l=r.value)==null?void 0:l.businessObject[u])||n.value[u],i.value[u]=p}})()})},{immediate:!0}),wn(()=>{r.value=null}),(c,l)=>{const u=hn,p=dn,d=bl,y=Zh("router-link");return nt(),Nt("div",sT,[R(p,{label:"\u5230\u671F\u65F6\u95F4"},{default:V(()=>[R(u,{modelValue:D(i).dueDate,"onUpdate:modelValue":l[0]||(l[0]=f=>D(i).dueDate=f),clearable:"",onChange:l[1]||(l[1]=f=>a("dueDate"))},null,8,["modelValue"])]),_:1}),R(p,{label:"\u8DDF\u8E2A\u65F6\u95F4"},{default:V(()=>[R(u,{modelValue:D(i).followUpDate,"onUpdate:modelValue":l[2]||(l[2]=f=>D(i).followUpDate=f),clearable:"",onChange:l[3]||(l[3]=f=>a("followUpDate"))},null,8,["modelValue"])]),_:1}),R(p,{label:"\u4F18\u5148\u7EA7"},{default:V(()=>[R(u,{modelValue:D(i).priority,"onUpdate:modelValue":l[4]||(l[4]=f=>D(i).priority=f),clearable:"",onChange:l[5]||(l[5]=f=>a("priority"))},null,8,["modelValue"])]),_:1}),l[7]||(l[7]=dt(" \u53CB\u60C5\u63D0\u793A\uFF1A\u4EFB\u52A1\u7684\u5206\u914D\u89C4\u5219\uFF0C\u4F7F\u7528 ")),R(y,{target:"_blank",to:{path:"/bpm/manager/model"}},{default:V(()=>[R(d,{type:"danger"},{default:V(()=>l[6]||(l[6]=[dt("\u6D41\u7A0B\u6A21\u578B")])),_:1})]),_:1}),l[8]||(l[8]=dt(" \u4E0B\u7684\u3010\u5206\u914D\u89C4\u5219\u3011\u66FF\u4EE3\uFF0C\u63D0\u4F9B\u6307\u5B9A\u89D2\u8272\u3001\u90E8\u95E8\u8D1F\u8D23\u4EBA\u3001\u90E8\u95E8\u6210\u5458\u3001\u5C97\u4F4D\u3001\u5DE5\u4F5C\u7EC4\u3001\u81EA\u5B9A\u4E49\u811A\u672C\u7B49 7 \u79CD\u7EF4\u62A4\u7684\u4EFB\u52A1\u5206\u914D\u7EF4\u5EA6\uFF0C\u66F4\u52A0\u7075\u6D3B\uFF01 "))])}}}),lT={style:{"margin-top":"16px"}},uT=ke({name:"ScriptTask",__name:"ScriptTask",props:{id:String,type:String},setup(t){const e=t,n=X({scriptFormat:"",script:"",resource:"",resultVariable:""}),i=X({}),r=X(),o=()=>window==null?void 0:window.bpmnInstances,a=()=>{let c=Object.create(null);c.scriptFormat=i.value.scriptFormat||null,c.resultVariable=i.value.resultVariable||null,i.value.scriptType==="inline"?(c.script=i.value.script||null,c.resource=null):(c.resource=i.value.resource||null,c.script=null),o().modeling.updateProperties(Bt(r.value),c)};return wn(()=>{r.value=null}),le(()=>e.id,()=>{r.value=o().bpmnElement,Ne(()=>{(()=>{var c;for(let l in n.value){let u=((c=r.value)==null?void 0:c.businessObject[l])||n.value[l];i.value[l]=u}i.value.scriptType=i.value.script?"inline":"external"})()})},{immediate:!0}),(c,l)=>{const u=hn,p=dn,d=Er,y=_r;return nt(),Nt("div",lT,[R(p,{label:"\u811A\u672C\u683C\u5F0F"},{default:V(()=>[R(u,{modelValue:D(i).scriptFormat,"onUpdate:modelValue":l[0]||(l[0]=f=>D(i).scriptFormat=f),clearable:"",onInput:l[1]||(l[1]=f=>a()),onChange:l[2]||(l[2]=f=>a())},null,8,["modelValue"])]),_:1}),R(p,{label:"\u811A\u672C\u7C7B\u578B"},{default:V(()=>[R(y,{modelValue:D(i).scriptType,"onUpdate:modelValue":l[3]||(l[3]=f=>D(i).scriptType=f)},{default:V(()=>[R(d,{label:"\u5185\u8054\u811A\u672C",value:"inline"}),R(d,{label:"\u5916\u90E8\u8D44\u6E90",value:"external"})]),_:1},8,["modelValue"])]),_:1}),Va(R(p,{label:"\u811A\u672C"},{default:V(()=>[R(u,{modelValue:D(i).script,"onUpdate:modelValue":l[4]||(l[4]=f=>D(i).script=f),type:"textarea",resize:"vertical",autosize:{minRows:2,maxRows:4},clearable:"",onInput:l[5]||(l[5]=f=>a()),onChange:l[6]||(l[6]=f=>a())},null,8,["modelValue"])]),_:1},512),[[yl,D(i).scriptType==="inline"]]),Va(R(p,{label:"\u8D44\u6E90\u5730\u5740"},{default:V(()=>[R(u,{modelValue:D(i).resource,"onUpdate:modelValue":l[7]||(l[7]=f=>D(i).resource=f),clearable:"",onInput:l[8]||(l[8]=f=>a()),onChange:l[9]||(l[9]=f=>a())},null,8,["modelValue"])]),_:1},512),[[yl,D(i).scriptType==="external"]]),R(p,{label:"\u7ED3\u679C\u53D8\u91CF"},{default:V(()=>[R(u,{modelValue:D(i).resultVariable,"onUpdate:modelValue":l[10]||(l[10]=f=>D(i).resultVariable=f),clearable:"",onInput:l[11]||(l[11]=f=>a()),onChange:l[12]||(l[12]=f=>a())},null,8,["modelValue"])]),_:1})])}}}),pT={style:{"margin-top":"16px"}},hT={style:{display:"flex","align-items":"center","justify-content":"space-between","flex-wrap":"nowrap"}},dT=ke({name:"ReceiveTask",__name:"ReceiveTask",props:{id:String,type:String},setup(t){const e=t,n=td(),i=X(""),r=X({}),o=X({}),a=X(!1),c=X(),l=X(),u=X(),p=()=>window.bpmnInstances,d=()=>{a.value=!0,r.value={}},y=()=>{if(o.value[r.value.id])return void n.error("\u8BE5\u6D88\u606F\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const v=p().moddle.create("bpmn:Message",r.value);u.value.push(v),o.value[r.value.id]=r.value.name,l.value[r.value.id]=v,a.value=!1},f=v=>{v==="-1"?p().modeling.updateProperties(Bt(c.value),{messageRef:null}):p().modeling.updateProperties(Bt(c.value),{messageRef:l.value[v]})};return fo(()=>{l.value=Object.create(null),u.value=p().modeler.getDefinitions().rootElements,u.value.filter(v=>v.$type==="bpmn:Message").forEach(v=>{l.value[v.id]=v,o.value[v.id]=v.name}),o.value[-1]="\u65E0"}),wn(()=>{c.value=null}),le(()=>e.id,()=>{Ne(()=>{var v,g;c.value=p().bpmnElement,i.value=((g=(v=c.value.businessObject)==null?void 0:v.messageRef)==null?void 0:g.id)||"-1"})},{immediate:!0}),(v,g)=>{const b=Er,E=_r,S=Cr,w=dn,C=hn,B=Vn,s=xr,h=vo;return nt(),Nt("div",pT,[R(w,{label:"\u6D88\u606F\u5B9E\u4F8B"},{default:V(()=>[Ot("div",hT,[R(E,{modelValue:D(i),"onUpdate:modelValue":g[0]||(g[0]=m=>We(i)?i.value=m:null),onChange:f},{default:V(()=>[(nt(!0),Nt(qe,null,wr(Object.keys(D(o)),m=>(nt(),St(b,{value:m,label:D(o)[m],key:m},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),R(S,{type:"primary",preIcon:"ep:plus",style:{"margin-left":"8px"},onClick:d})])]),_:1}),R(h,{modelValue:D(a),"onUpdate:modelValue":g[3]||(g[3]=m=>We(a)?a.value=m:null),"close-on-click-modal":!1,title:"\u521B\u5EFA\u65B0\u6D88\u606F",width:"400px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(s,{size:"small",type:"primary",onClick:y},{default:V(()=>g[4]||(g[4]=[dt("\u786E \u8BA4")])),_:1})]),default:V(()=>[R(B,{model:D(r),size:"small","label-width":"90px"},{default:V(()=>[R(w,{label:"\u6D88\u606FID"},{default:V(()=>[R(C,{modelValue:D(r).id,"onUpdate:modelValue":g[1]||(g[1]=m=>D(r).id=m),clearable:""},null,8,["modelValue"])]),_:1}),R(w,{label:"\u6D88\u606F\u540D\u79F0"},{default:V(()=>[R(C,{modelValue:D(r).name,"onUpdate:modelValue":g[2]||(g[2]=m=>D(r).name=m),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),mT={class:"panel-tab__content"},fT=ke({name:"ElementTaskConfig",__name:"ElementTask",props:{id:String,type:String},setup(t){const e=t,n=X({asyncAfter:!1,asyncBefore:!1,exclusive:!1}),i=X(),r=X({UserTask:"UserTask",ScriptTask:"ScriptTask",ReceiveTask:"ReceiveTask"}),o=X(),a=()=>window.bpmnInstances,c=()=>{n.value.asyncBefore||n.value.asyncAfter||(n.value.exclusive=!1),a().modeling.updateProperties(a().bpmnElement,{...n.value})};return le(()=>e.id,()=>{var l,u,p,d,y,f;o.value=a().bpmnElement,n.value.asyncBefore=(u=(l=o.value)==null?void 0:l.businessObject)==null?void 0:u.asyncBefore,n.value.asyncAfter=(d=(p=o.value)==null?void 0:p.businessObject)==null?void 0:d.asyncAfter,n.value.exclusive=(f=(y=o.value)==null?void 0:y.businessObject)==null?void 0:f.exclusive},{immediate:!0}),le(()=>e.type,()=>{e.type==r.value.UserTask&&(i.value=cT),e.type==r.value.ScriptTask&&(i.value=uT),e.type==r.value.ReceiveTask&&(i.value=dT)},{immediate:!0}),(l,u)=>{const p=Qh,d=dn,y=Vn;return nt(),Nt("div",mT,[R(y,{size:"small","label-width":"90px"},{default:V(()=>[R(d,{label:"\u5F02\u6B65\u5EF6\u7EED"},{default:V(()=>[R(p,{modelValue:D(n).asyncBefore,"onUpdate:modelValue":u[0]||(u[0]=f=>D(n).asyncBefore=f),label:"\u5F02\u6B65\u524D",onChange:c},null,8,["modelValue"]),R(p,{modelValue:D(n).asyncAfter,"onUpdate:modelValue":u[1]||(u[1]=f=>D(n).asyncAfter=f),label:"\u5F02\u6B65\u540E",onChange:c},null,8,["modelValue"]),D(n).asyncAfter||D(n).asyncBefore?(nt(),St(p,{key:0,modelValue:D(n).exclusive,"onUpdate:modelValue":u[2]||(u[2]=f=>D(n).exclusive=f),label:"\u6392\u9664",onChange:c},null,8,["modelValue"])):Tt("",!0)]),_:1}),(nt(),St(o0(D(i)),i0(r0(l.$props)),null,16))]),_:1})])}}}),vT={class:"panel-tab__content"},yT=ke({name:"ElementMultiInstance",__name:"ElementMultiInstance",props:{businessObject:Object,type:String},setup(t){const e=t,n=Sr("prefix"),i=X(""),r=X({completionCondition:"",loopCardinality:"",extensionElements:[],asyncAfter:!1,asyncBefore:!1,exclusive:!1}),o=X({}),a=X(null),c=X(null),l=()=>window==null?void 0:window.bpmnInstances,u=g=>{if(g!=="Null"){if(g==="StandardLoop"){const b=l().moddle.create("bpmn:StandardLoopCharacteristics");return l().modeling.updateProperties(Bt(a.value),{loopCharacteristics:b}),void(c.value=null)}c.value=g==="SequentialMultiInstance"?l().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{isSequential:!0}):l().moddle.create("bpmn:MultiInstanceLoopCharacteristics",{collection:"${coll_userList}"}),l().modeling.updateProperties(Bt(a.value),{loopCharacteristics:Bt(c.value)})}else l().modeling.updateProperties(Bt(a.value),{loopCharacteristics:null})},p=g=>{let b=null;g&&g.length&&(b=l().moddle.create("bpmn:FormalExpression",{body:g})),l().modeling.updateModdleProperties(Bt(a.value),c.value,{loopCardinality:b})},d=g=>{let b=null;g&&g.length&&(b=l().moddle.create("bpmn:FormalExpression",{body:g})),l().modeling.updateModdleProperties(Bt(a.value),c.value,{completionCondition:b})},y=g=>{const b=l().moddle.create("bpmn:ExtensionElements",{values:[l().moddle.create(`${n}:FailedJobRetryTimeCycle`,{body:g})]});l().modeling.updateModdleProperties(Bt(a.value),c.value,{extensionElements:b})},f=()=>{l().modeling.updateModdleProperties(Bt(a.value),c.value,{collection:o.value.collection||null,elementVariable:o.value.elementVariable||null})},v=g=>{const{asyncBefore:b,asyncAfter:E}=o.value;let S=Object.create(null);b||E?S[g]=o.value[g]:(o.value.exclusive=!1,S={asyncBefore:!1,asyncAfter:!1,exclusive:!1,extensionElements:null}),l().modeling.updateModdleProperties(Bt(a.value),c.value,S)};return wn(()=>{c.value=null,a.value=null}),le(()=>e.businessObject,g=>{var E,S,w,C;var b;a.value=l().bpmnElement,(b=g).loopCharacteristics?b.loopCharacteristics.$type==="bpmn:StandardLoopCharacteristics"?(i.value="StandardLoop",o.value={}):(b.loopCharacteristics.isSequential?i.value="SequentialMultiInstance":i.value="ParallelMultiInstance",o.value={...r.value,...b.loopCharacteristics,completionCondition:((S=(E=b.loopCharacteristics)==null?void 0:E.completionCondition)==null?void 0:S.body)??"",loopCardinality:((C=(w=b.loopCharacteristics)==null?void 0:w.loopCardinality)==null?void 0:C.body)??""},c.value=l().bpmnElement.businessObject.loopCharacteristics,b.loopCharacteristics.extensionElements&&b.loopCharacteristics.extensionElements.values&&b.loopCharacteristics.extensionElements.values.length&&(o.value.timeCycle=b.loopCharacteristics.extensionElements.values[0].body)):(i.value="Null",o.value={})},{immediate:!0}),(g,b)=>{const E=Er,S=_r,w=dn,C=hn,B=Qh,s=Vn;return nt(),Nt("div",vT,[R(s,{"label-width":"90px"},{default:V(()=>[R(w,{label:"\u56DE\u8DEF\u7279\u6027"},{default:V(()=>[R(S,{modelValue:D(i),"onUpdate:modelValue":b[0]||(b[0]=h=>We(i)?i.value=h:null),onChange:u},{default:V(()=>[R(E,{label:"\u5E76\u884C\u591A\u91CD\u4E8B\u4EF6",value:"ParallelMultiInstance"}),R(E,{label:"\u65F6\u5E8F\u591A\u91CD\u4E8B\u4EF6",value:"SequentialMultiInstance"}),R(E,{label:"\u5FAA\u73AF\u4E8B\u4EF6",value:"StandardLoop"}),R(E,{label:"\u65E0",value:"Null"})]),_:1},8,["modelValue"])]),_:1}),D(i)==="ParallelMultiInstance"||D(i)==="SequentialMultiInstance"?(nt(),Nt(qe,{key:0},[R(w,{label:"\u5FAA\u73AF\u57FA\u6570",key:"loopCardinality"},{default:V(()=>[R(C,{modelValue:D(o).loopCardinality,"onUpdate:modelValue":b[1]||(b[1]=h=>D(o).loopCardinality=h),clearable:"",onChange:p},null,8,["modelValue"])]),_:1}),Va(R(w,{label:"\u96C6\u5408",key:"collection"},{default:V(()=>[R(C,{modelValue:D(o).collection,"onUpdate:modelValue":b[2]||(b[2]=h=>D(o).collection=h),clearable:"",onChange:f},null,8,["modelValue"])]),_:1},512),[[yl,!1]]),R(w,{label:"\u5143\u7D20\u53D8\u91CF",key:"elementVariable"},{default:V(()=>[R(C,{modelValue:D(o).elementVariable,"onUpdate:modelValue":b[3]||(b[3]=h=>D(o).elementVariable=h),clearable:"",onChange:f},null,8,["modelValue"])]),_:1}),R(w,{label:"\u5B8C\u6210\u6761\u4EF6",key:"completionCondition"},{default:V(()=>[R(C,{modelValue:D(o).completionCondition,"onUpdate:modelValue":b[4]||(b[4]=h=>D(o).completionCondition=h),clearable:"",onChange:d},null,8,["modelValue"])]),_:1}),R(w,{label:"\u5F02\u6B65\u72B6\u6001",key:"async"},{default:V(()=>[R(B,{modelValue:D(o).asyncBefore,"onUpdate:modelValue":b[5]||(b[5]=h=>D(o).asyncBefore=h),label:"\u5F02\u6B65\u524D",onChange:b[6]||(b[6]=h=>v("asyncBefore"))},null,8,["modelValue"]),R(B,{modelValue:D(o).asyncAfter,"onUpdate:modelValue":b[7]||(b[7]=h=>D(o).asyncAfter=h),label:"\u5F02\u6B65\u540E",onChange:b[8]||(b[8]=h=>v("asyncAfter"))},null,8,["modelValue"]),D(o).asyncAfter||D(o).asyncBefore?(nt(),St(B,{key:0,modelValue:D(o).exclusive,"onUpdate:modelValue":b[9]||(b[9]=h=>D(o).exclusive=h),label:"\u6392\u9664",onChange:b[10]||(b[10]=h=>v("exclusive"))},null,8,["modelValue"])):Tt("",!0)]),_:1}),D(o).asyncAfter||D(o).asyncBefore?(nt(),St(w,{label:"\u91CD\u8BD5\u5468\u671F",prop:"timeCycle",key:"timeCycle"},{default:V(()=>[R(C,{modelValue:D(o).timeCycle,"onUpdate:modelValue":b[11]||(b[11]=h=>D(o).timeCycle=h),clearable:"",onChange:y},null,8,["modelValue"])]),_:1})):Tt("",!0)],64)):Tt("",!0)]),_:1})])}}}),gT={class:"panel-tab__content"},bT=ke({name:"FlowCondition",__name:"FlowCondition",props:{businessObject:Object,type:String},setup(t){const e=t,n=X({}),i=X(),r=X(),o=X(),a=X(),c=()=>window==null?void 0:window.bpmnInstances,l=p=>p==="condition"?(a.value=c().moddle.create("bpmn:FormalExpression"),void c().modeling.updateProperties(Bt(i.value),{conditionExpression:a.value})):p==="default"?(c().modeling.updateProperties(Bt(i.value),{conditionExpression:null}),void c().modeling.updateProperties(Bt(r.value),{default:i.value})):(o.value.default&&o.value.default.id===i.value.id&&c().modeling.updateProperties(Bt(r.value),{default:null}),void c().modeling.updateProperties(Bt(i.value),{conditionExpression:null})),u=()=>{let p,{conditionType:d,scriptType:y,body:f,resource:v,language:g}=n.value;d==="expression"?p=c().moddle.create("bpmn:FormalExpression",{body:f}):y==="inlineScript"?(p=c().moddle.create("bpmn:FormalExpression",{body:f,language:g}),n.value.resource=""):(n.value.body="",p=c().moddle.create("bpmn:FormalExpression",{resource:v,language:g})),c().modeling.updateProperties(Bt(i.value),{conditionExpression:p})};return wn(()=>{i.value=null,r.value=null,o.value=null}),le(()=>e.businessObject,p=>{Ne(()=>{(()=>{if(i.value=c().bpmnElement,r.value=i.value.source,o.value=i.value.businessObject.sourceRef,o.value&&o.value.default&&o.value.default.id===i.value.id&&n.value.type=="default")n.value={type:"default"};else if(i.value.businessObject.conditionExpression){const d=i.value.businessObject.conditionExpression;if(n.value={...d,type:"condition"},n.value.resource)return n.value.conditionType="script",void(n.value.scriptType="externalScript");if(d.language)return n.value.conditionType="script",void(n.value.scriptType="inlineScript");n.value.conditionType="expression"}else n.value={type:"normal"}})()})},{immediate:!0}),(p,d)=>{const y=Er,f=_r,v=dn,g=hn,b=Vn;return nt(),Nt("div",gT,[R(b,{model:D(n),"label-width":"90px",size:"small"},{default:V(()=>[R(v,{label:"\u6D41\u8F6C\u7C7B\u578B"},{default:V(()=>[R(f,{modelValue:D(n).type,"onUpdate:modelValue":d[0]||(d[0]=E=>D(n).type=E),onChange:l},{default:V(()=>[R(y,{label:"\u666E\u901A\u6D41\u8F6C\u8DEF\u5F84",value:"normal"}),R(y,{label:"\u9ED8\u8BA4\u6D41\u8F6C\u8DEF\u5F84",value:"default"}),R(y,{label:"\u6761\u4EF6\u6D41\u8F6C\u8DEF\u5F84",value:"condition"})]),_:1},8,["modelValue"])]),_:1}),D(n).type==="condition"?(nt(),St(v,{label:"\u6761\u4EF6\u683C\u5F0F",key:"condition"},{default:V(()=>[R(f,{modelValue:D(n).conditionType,"onUpdate:modelValue":d[1]||(d[1]=E=>D(n).conditionType=E)},{default:V(()=>[R(y,{label:"\u8868\u8FBE\u5F0F",value:"expression"}),R(y,{label:"\u811A\u672C",value:"script"})]),_:1},8,["modelValue"])]),_:1})):Tt("",!0),D(n).conditionType&&D(n).conditionType==="expression"?(nt(),St(v,{label:"\u8868\u8FBE\u5F0F",key:"express"},{default:V(()=>[R(g,{modelValue:D(n).body,"onUpdate:modelValue":d[2]||(d[2]=E=>D(n).body=E),style:{width:"192px"},clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):Tt("",!0),D(n).conditionType&&D(n).conditionType==="script"?(nt(),Nt(qe,{key:2},[R(v,{label:"\u811A\u672C\u8BED\u8A00",key:"language"},{default:V(()=>[R(g,{modelValue:D(n).language,"onUpdate:modelValue":d[3]||(d[3]=E=>D(n).language=E),clearable:"",onChange:u},null,8,["modelValue"])]),_:1}),R(v,{label:"\u811A\u672C\u7C7B\u578B",key:"scriptType"},{default:V(()=>[R(f,{modelValue:D(n).scriptType,"onUpdate:modelValue":d[4]||(d[4]=E=>D(n).scriptType=E)},{default:V(()=>[R(y,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(y,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(n).scriptType==="inlineScript"?(nt(),St(v,{label:"\u811A\u672C",key:"body"},{default:V(()=>[R(g,{modelValue:D(n).body,"onUpdate:modelValue":d[5]||(d[5]=E=>D(n).body=E),type:"textarea",clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):Tt("",!0),D(n).scriptType==="externalScript"?(nt(),St(v,{label:"\u8D44\u6E90\u5730\u5740",key:"resource"},{default:V(()=>[R(g,{modelValue:D(n).resource,"onUpdate:modelValue":d[6]||(d[6]=E=>D(n).resource=E),clearable:"",onChange:u},null,8,["modelValue"])]),_:1})):Tt("",!0)],64)):Tt("",!0)]),_:1},8,["model"])])}}}),xT={class:"panel-tab__content"},ET={class:"panel-tab__content--title"},_T={class:"panel-tab__content--title",style:{"padding-top":"8px","margin-top":"8px","border-top":"1px solid #eee"}},wT=ke({name:"SignalAndMassage",__name:"SignalAndMessage",setup(t){const e=td(),n=X([]),i=X([]),r=X(!1),o=X(""),a=X({}),c=X(),l=X(),u=X(),p=vl(()=>o.value==="message"?{title:"\u521B\u5EFA\u6D88\u606F",idLabel:"\u6D88\u606FID",nameLabel:"\u6D88\u606F\u540D\u79F0"}:{title:"\u521B\u5EFA\u4FE1\u53F7",idLabel:"\u4FE1\u53F7ID",nameLabel:"\u4FE1\u53F7\u540D\u79F0"}),d=()=>window==null?void 0:window.bpmnInstances,y=()=>{c.value=d().modeler.getDefinitions().rootElements,l.value={},u.value={},i.value=[],n.value=[],c.value.forEach(g=>{g.$type==="bpmn:Message"&&(l.value[g.id]=!0,i.value.push({...g})),g.$type==="bpmn:Signal"&&(u.value[g.id]=!0,n.value.push({...g}))})},f=g=>{o.value=g,a.value={},r.value=!0},v=()=>{if(o.value==="message"){l.value[a.value.id]&&e.error("\u8BE5\u6D88\u606F\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const g=d().moddle.create("bpmn:Message",a.value);c.value.push(g)}else{u.value[a.value.id]&&e.error("\u8BE5\u4FE1\u53F7\u5DF2\u5B58\u5728\uFF0C\u8BF7\u4FEE\u6539id\u540E\u91CD\u65B0\u4FDD\u5B58");const g=d().moddle.create("bpmn:Signal",a.value);c.value.push(g)}r.value=!1,y()};return fo(()=>{y()}),(g,b)=>{const E=Fa,S=Cr,w=za,C=$a,B=hn,s=dn,h=Vn,m=xr,_=vo;return nt(),Nt("div",xT,[Ot("div",ET,[Ot("span",null,[R(E,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),b[6]||(b[6]=dt("\u6D88\u606F\u5217\u8868"))]),R(S,{type:"primary",title:"\u521B\u5EFA\u65B0\u6D88\u606F",preIcon:"ep:plus",onClick:b[0]||(b[0]=T=>f("message"))})]),R(C,{data:D(i),border:""},{default:V(()=>[R(w,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),R(w,{label:"\u6D88\u606FID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),R(w,{label:"\u6D88\u606F\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),Ot("div",_T,[Ot("span",null,[R(E,{icon:"ep:menu",style:{"margin-right":"8px",color:"#555"}}),b[7]||(b[7]=dt("\u4FE1\u53F7\u5217\u8868"))]),R(S,{type:"primary",title:"\u521B\u5EFA\u65B0\u4FE1\u53F7",preIcon:"ep:plus",onClick:b[1]||(b[1]=T=>f("signal"))})]),R(C,{data:D(n),border:""},{default:V(()=>[R(w,{type:"index",label:"\u5E8F\u53F7",width:"60px"}),R(w,{label:"\u4FE1\u53F7ID",prop:"id","max-width":"300px","show-overflow-tooltip":""}),R(w,{label:"\u4FE1\u53F7\u540D\u79F0",prop:"name","max-width":"300px","show-overflow-tooltip":""})]),_:1},8,["data"]),R(_,{modelValue:D(r),"onUpdate:modelValue":b[5]||(b[5]=T=>We(r)?r.value=T:null),title:D(p).title,"close-on-click-modal":!1,width:"400px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(m,{onClick:b[4]||(b[4]=T=>r.value=!1)},{default:V(()=>b[8]||(b[8]=[dt("\u53D6 \u6D88")])),_:1}),R(m,{type:"primary",onClick:v},{default:V(()=>b[9]||(b[9]=[dt("\u4FDD \u5B58")])),_:1})]),default:V(()=>[R(h,{model:D(a),"label-width":"90px"},{default:V(()=>[R(s,{label:D(p).idLabel},{default:V(()=>[R(B,{modelValue:D(a).id,"onUpdate:modelValue":b[2]||(b[2]=T=>D(a).id=T),clearable:""},null,8,["modelValue"])]),_:1},8,["label"]),R(s,{label:D(p).nameLabel},{default:V(()=>[R(B,{modelValue:D(a).name,"onUpdate:modelValue":b[3]||(b[3]=T=>D(a).name=T),clearable:""},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["modelValue","title"])])}}}),mr=()=>window==null?void 0:window.bpmnInstances;function Fb(t,e,n){const i=Object.create(null);switch(i.event=t.event,e&&(i.id=t.id),t.listenerType){case"scriptListener":i.script=function(r,o){const{scriptType:a,scriptFormat:c,value:l,resource:u}=r,p=a==="inlineScript"?{scriptFormat:c,value:l}:{scriptFormat:c,resource:u};return mr().moddle.create(`${o}:Script`,p)}(t,n);break;case"expressionListener":i.expression=t.expression;break;case"delegateExpressionListener":i.delegateExpression=t.delegateExpression;break;default:i.class=t.class}if(t.fields&&(i.fields=t.fields.map(r=>function(o,a){const{name:c,fieldType:l,string:u,expression:p}=o,d=l==="string"?{name:c,string:u}:{name:c,expression:p};return mr().moddle.create(`${a}:Field`,d)}(r,n))),e&&t.event==="timeout"&&t.eventDefinitionType){const r=mr().moddle.create("bpmn:FormalExpression",{body:t.eventTimeDefinitions}),o=mr().moddle.create("bpmn:TimerEventDefinition",{id:`TimerEventDefinition_${ST(8)}`,[`time${t.eventDefinitionType.replace(/^\S/,a=>a.toUpperCase())}`]:r});i.eventDefinitions=[o]}return mr().moddle.create(`${n}:${e?"TaskListener":"ExecutionListener"}`,i)}function nl(t,e){const n=mr().moddle.create("bpmn:ExtensionElements",{values:e});mr().modeling.updateProperties(Bt(t),{extensionElements:n})}function ST(t=8,e){let n="";const i=e||"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=t;r>0;--r)n+=i[Math.floor(Math.random()*i.length)];return n}function zb(t){let e={...t};if(t.script&&(e={...t,...t.script,scriptType:t.script.resource?"externalScript":"inlineScript"}),t.event==="timeout"&&t.eventDefinitions&&t.eventDefinitions.length){let n="";for(const i in t.eventDefinitions[0])i.indexOf("time")!==-1&&(n=i,e.eventDefinitionType=i.replace("time","").toLowerCase());e.eventTimeDefinitions=t.eventDefinitions[0][n].body}return e}function $b(t){let e;return t.class&&(e="classListener"),t.expression&&(e="expressionListener"),t.delegateExpression&&(e="delegateExpressionListener"),t.script&&(e="scriptListener"),{...JSON.parse(JSON.stringify(t)),...t.script??{},listenerType:e}}const Gb={classListener:"Java \u7C7B",expressionListener:"\u8868\u8FBE\u5F0F",delegateExpressionListener:"\u4EE3\u7406\u8868\u8FBE\u5F0F",scriptListener:"\u811A\u672C"},CT={create:"\u521B\u5EFA",assignment:"\u6307\u6D3E",complete:"\u5B8C\u6210",delete:"\u5220\u9664",update:"\u66F4\u65B0",timeout:"\u8D85\u65F6"},Ub={string:"\u5B57\u7B26\u4E32",expression:"\u8868\u8FBE\u5F0F"},TT={class:"panel-tab__content"},AT={class:"element-drawer__button"},kT={class:"listener-filed__title"},PT={class:"element-drawer__button"},MT=ke({name:"ElementListeners",__name:"ElementListeners",props:{id:String,type:String},setup(t){const e=t,n=Sr("prefix"),i=Sr("width"),r=X([]),o=X({}),a=X(!1),c=X([]),l=X({}),u=X(!1),p=X(-1),d=X(-1),y=X(Gb),f=X(Ub),v=X(),g=X(),b=X(),E=X(),S=X(),w=()=>{var m,_,T;v.value=(window==null?void 0:window.bpmnInstances).bpmnElement,g.value=[],b.value=((T=(_=(m=v.value.businessObject)==null?void 0:m.extensionElements)==null?void 0:_.values)==null?void 0:T.filter(M=>M.$type===`${n}:ExecutionListener`))??[],r.value=b.value.map(M=>$b(M))},C=(m,_)=>{m?(o.value=zb(m),p.value=_):(o.value={},p.value=-1),m&&m.fields?c.value=m.fields.map(T=>({...T,fieldType:T.string?"string":"expression"})):(c.value=[],o.value.fields=[]),a.value=!0,Ne(()=>{E.value&&E.value.clearValidate()})},B=(m,_)=>{l.value=m?JSON.parse(JSON.stringify(m)):{},d.value=m?_:-1,u.value=!0,Ne(()=>{S.value&&S.value.clearValidate()})},s=async()=>{await S.value.validate()&&(d.value===-1?(c.value.push(l.value),o.value.fields.push(l.value)):(c.value.splice(d.value,1,l.value),o.value.fields.splice(d.value,1,l.value)),u.value=!1,Ne(()=>{l.value={}}))},h=async()=>{var _,T,M;if(!await E.value.validate())return;const m=Fb(o.value,!1,n);p.value===-1?(b.value.push(m),r.value.push(o.value)):(b.value.splice(p.value,1,m),r.value.splice(p.value,1,o.value)),g.value=((M=(T=(_=v.value.businessObject)==null?void 0:_.extensionElements)==null?void 0:T.values)==null?void 0:M.filter(I=>I.$type!==`${n}:ExecutionListener`))??[],nl(v.value,g.value.concat(b.value)),a.value=!1,o.value={}};return le(()=>e.id,m=>{m&&m.length&&Ne(()=>{w()})},{immediate:!0}),(m,_)=>{const T=za,M=xr,I=gl,$=$a,P=Cr,x=Er,N=_r,j=dn,G=hn,W=Vn,tt=Fa,it=ed,at=vo;return nt(),Nt("div",TT,[R($,{data:D(r),size:"small",border:""},{default:V(()=>[R(T,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(T,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"100px",prop:"event"}),R(T,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"100px","show-overflow-tooltip":"",formatter:H=>D(y)[H.listenerType]},null,8,["formatter"]),R(T,{label:"\u64CD\u4F5C",width:"100px"},{default:V(H=>[R(M,{size:"small",link:"",onClick:q=>C(H.row,H.$index)},{default:V(()=>_[19]||(_[19]=[dt("\u7F16\u8F91")])),_:2},1032,["onClick"]),R(I,{direction:"vertical"}),R(M,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:q=>(jt=>{br.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{b.value.splice(jt,1),r.value.splice(jt,1),nl(v.value,g.value.concat(b.value))}).catch(()=>{})})(H.$index)},{default:V(()=>_[20]||(_[20]=[dt("\u79FB\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ot("div",AT,[R(P,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:_[0]||(_[0]=H=>C(null))})]),R(it,{modelValue:D(a),"onUpdate:modelValue":_[12]||(_[12]=H=>We(a)?a.value=H:null),title:"\u6267\u884C\u76D1\u542C\u5668",size:`${D(i)}px`,"append-to-body":"","destroy-on-close":""},{default:V(()=>[R(W,{model:D(o),"label-width":"96px",ref_key:"listenerFormRef",ref:E},{default:V(()=>[R(j,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(N,{modelValue:D(o).event,"onUpdate:modelValue":_[1]||(_[1]=H=>D(o).event=H)},{default:V(()=>[R(x,{label:"start",value:"start"}),R(x,{label:"end",value:"end"})]),_:1},8,["modelValue"])]),_:1}),R(j,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(N,{modelValue:D(o).listenerType,"onUpdate:modelValue":_[2]||(_[2]=H=>D(o).listenerType=H)},{default:V(()=>[(nt(!0),Nt(qe,null,wr(Object.keys(D(y)),H=>(nt(),St(x,{key:H,label:D(y)[H],value:H},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(o).listenerType==="classListener"?(nt(),St(j,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(o).class,"onUpdate:modelValue":_[3]||(_[3]=H=>D(o).class=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(o).listenerType==="expressionListener"?(nt(),St(j,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(o).expression,"onUpdate:modelValue":_[4]||(_[4]=H=>D(o).expression=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(o).listenerType==="delegateExpressionListener"?(nt(),St(j,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(o).delegateExpression,"onUpdate:modelValue":_[5]||(_[5]=H=>D(o).delegateExpression=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(o).listenerType==="scriptListener"?(nt(),Nt(qe,{key:3},[R(j,{label:"\u811A\u672C\u683C\u5F0F",prop:"scriptFormat",key:"listener-script-format",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u683C\u5F0F"}},{default:V(()=>[R(G,{modelValue:D(o).scriptFormat,"onUpdate:modelValue":_[6]||(_[6]=H=>D(o).scriptFormat=H),clearable:""},null,8,["modelValue"])]),_:1}),R(j,{label:"\u811A\u672C\u7C7B\u578B",prop:"scriptType",key:"listener-script-type",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u9009\u62E9\u811A\u672C\u7C7B\u578B"}},{default:V(()=>[R(N,{modelValue:D(o).scriptType,"onUpdate:modelValue":_[7]||(_[7]=H=>D(o).scriptType=H)},{default:V(()=>[R(x,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(x,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(o).scriptType==="inlineScript"?(nt(),St(j,{label:"\u811A\u672C\u5185\u5BB9",prop:"value",key:"listener-script",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u5185\u5BB9"}},{default:V(()=>[R(G,{modelValue:D(o).value,"onUpdate:modelValue":_[8]||(_[8]=H=>D(o).value=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(o).scriptType==="externalScript"?(nt(),St(j,{label:"\u8D44\u6E90\u5730\u5740",prop:"resource",key:"listener-resource",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u8D44\u6E90\u5730\u5740"}},{default:V(()=>[R(G,{modelValue:D(o).resource,"onUpdate:modelValue":_[9]||(_[9]=H=>D(o).resource=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0)],64)):Tt("",!0)]),_:1},8,["model"]),R(I),Ot("p",kT,[Ot("span",null,[R(tt,{icon:"ep:menu"}),_[21]||(_[21]=dt("\u6CE8\u5165\u5B57\u6BB5\uFF1A"))]),R(P,{type:"primary",onClick:_[10]||(_[10]=H=>B(null)),title:"\u6DFB\u52A0\u5B57\u6BB5"})]),R($,{data:D(c),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:V(()=>[R(T,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(T,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),R(T,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:H=>D(f)[H.fieldType]},null,8,["formatter"]),R(T,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:H=>H.string||H.expression},null,8,["formatter"]),R(T,{label:"\u64CD\u4F5C",width:"130px"},{default:V(H=>[R(M,{size:"small",link:"",onClick:q=>B(H.row,H.$index)},{default:V(()=>_[22]||(_[22]=[dt("\u7F16\u8F91")])),_:2},1032,["onClick"]),R(I,{direction:"vertical"}),R(M,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:q=>(jt=>{br.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{c.value.splice(jt,1),o.value.fields.splice(jt,1)}).catch(()=>{})})(H.$index)},{default:V(()=>_[23]||(_[23]=[dt("\u79FB\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ot("div",PT,[R(M,{onClick:_[11]||(_[11]=H=>a.value=!1)},{default:V(()=>_[24]||(_[24]=[dt("\u53D6 \u6D88")])),_:1}),R(M,{type:"primary",onClick:h},{default:V(()=>_[25]||(_[25]=[dt("\u4FDD \u5B58")])),_:1})])]),_:1},8,["modelValue","size"]),R(at,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:D(u),"onUpdate:modelValue":_[18]||(_[18]=H=>We(u)?u.value=H:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(M,{size:"small",onClick:_[17]||(_[17]=H=>u.value=!1)},{default:V(()=>_[26]||(_[26]=[dt("\u53D6 \u6D88")])),_:1}),R(M,{size:"small",type:"primary",onClick:s},{default:V(()=>_[27]||(_[27]=[dt("\u786E \u5B9A")])),_:1})]),default:V(()=>[R(W,{model:D(l),"label-width":"96spx",ref_key:"listenerFieldFormRef",ref:S,style:{height:"136px"}},{default:V(()=>[R(j,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(l).name,"onUpdate:modelValue":_[13]||(_[13]=H=>D(l).name=H),clearable:""},null,8,["modelValue"])]),_:1}),R(j,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(N,{modelValue:D(l).fieldType,"onUpdate:modelValue":_[14]||(_[14]=H=>D(l).fieldType=H)},{default:V(()=>[(nt(!0),Nt(qe,null,wr(Object.keys(D(f)),H=>(nt(),St(x,{key:H,label:D(f)[H],value:H},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(l).fieldType==="string"?(nt(),St(j,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(l).string,"onUpdate:modelValue":_[15]||(_[15]=H=>D(l).string=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(l).fieldType==="expression"?(nt(),St(j,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(G,{modelValue:D(l).expression,"onUpdate:modelValue":_[16]||(_[16]=H=>D(l).expression=H),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),RT={class:"panel-tab__content"},NT={class:"element-drawer__button"},IT=ke({name:"ElementProperties",__name:"ElementProperties",props:{id:String,type:String},setup(t){const e=t,n=Sr("prefix"),i=X([]),r=X({}),o=X(-1),a=X(!1),c=X(),l=X(),u=X(),p=X(),d=X(),y=()=>window==null?void 0:window.bpmnInstances,f=()=>{var E,S;c.value=y().bpmnElement,l.value=[],u.value=((S=(E=c.value.businessObject)==null?void 0:E.extensionElements)==null?void 0:S.values.filter(w=>(w.$type!==`${n}:Properties`&&l.value.push(w),w.$type===`${n}:Properties`)))??[],p.value=u.value.reduce((w,C)=>w.concat(C.values),[]),i.value=JSON.parse(JSON.stringify(p.value??[]))},v=(E,S)=>{o.value=S,r.value=S===-1?{}:JSON.parse(JSON.stringify(E)),a.value=!0,Ne(()=>{d.value&&d.value.clearValidate()})},g=()=>{const{name:E,value:S}=r.value;if(o.value!==-1)y().modeling.updateModdleProperties(Bt(c.value),Bt(p.value)[Bt(o.value)],{name:E,value:S});else{const w=y().moddle.create(`${n}:Property`,{name:E,value:S}),C=y().moddle.create(`${n}:Properties`,{values:p.value.concat([w])});b(C)}a.value=!1,f()},b=E=>{const S=y().moddle.create("bpmn:ExtensionElements",{values:l.value.concat([E])});y().modeling.updateProperties(Bt(c.value),{extensionElements:S})};return le(()=>e.id,E=>{E&&E&&E.length&&f()},{immediate:!0}),(E,S)=>{const w=za,C=xr,B=gl,s=$a,h=Cr,m=hn,_=dn,T=Vn,M=vo;return nt(),Nt("div",RT,[R(s,{data:D(i),"max-height":"240",fit:"",border:""},{default:V(()=>[R(w,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(w,{label:"\u5C5E\u6027\u540D",prop:"name","min-width":"100px","show-overflow-tooltip":""}),R(w,{label:"\u5C5E\u6027\u503C",prop:"value","min-width":"100px","show-overflow-tooltip":""}),R(w,{label:"\u64CD\u4F5C",width:"110px"},{default:V(I=>[R(C,{link:"",onClick:$=>v(I.row,I.$index),size:"small"},{default:V(()=>S[5]||(S[5]=[dt(" \u7F16\u8F91 ")])),_:2},1032,["onClick"]),R(B,{direction:"vertical"}),R(C,{link:"",size:"small",style:{color:"#ff4d4f"},onClick:$=>((P,x)=>{br.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5C5E\u6027\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{i.value.splice(x,1),p.value.splice(x,1);const N=y().moddle.create(`${n}:Properties`,{values:p.value});b(N),f()}).catch(()=>{})})(I.row,I.$index)},{default:V(()=>S[6]||(S[6]=[dt(" \u79FB\u9664 ")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ot("div",NT,[R(h,{type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u5C5E\u6027",onClick:S[0]||(S[0]=I=>v(null,-1))})]),R(M,{modelValue:D(a),"onUpdate:modelValue":S[4]||(S[4]=I=>We(a)?a.value=I:null),title:"\u5C5E\u6027\u914D\u7F6E",width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(C,{onClick:S[3]||(S[3]=I=>a.value=!1)},{default:V(()=>S[7]||(S[7]=[dt("\u53D6 \u6D88")])),_:1}),R(C,{type:"primary",onClick:g},{default:V(()=>S[8]||(S[8]=[dt("\u786E \u5B9A")])),_:1})]),default:V(()=>[R(T,{model:D(r),"label-width":"80px",ref_key:"attributeFormRef",ref:d},{default:V(()=>[R(_,{label:"\u5C5E\u6027\u540D\uFF1A",prop:"name"},{default:V(()=>[R(m,{modelValue:D(r).name,"onUpdate:modelValue":S[1]||(S[1]=I=>D(r).name=I),clearable:""},null,8,["modelValue"])]),_:1}),R(_,{label:"\u5C5E\u6027\u503C\uFF1A",prop:"value"},{default:V(()=>[R(m,{modelValue:D(r).value,"onUpdate:modelValue":S[2]||(S[2]=I=>D(r).value=I),clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),DT={class:"panel-tab__content"},BT={class:"element-drawer__button"},OT={class:"listener-filed__title"},LT={class:"element-drawer__button"},jT=ke({name:"UserTaskListeners",__name:"UserTaskListeners",props:{id:String,type:String},setup(t){const e=t,n=Sr("prefix"),i=Sr("width"),r=X([]),o=X(CT),a=X(Gb),c=X(!1),l=X({}),u=X(Ub),p=X([]),d=X(!1),y=X(-1),f=X(-1),v=X({}),g=X(),b=X(),E=X(),S=X(),w=X(),C=()=>{var _,T;g.value=(window==null?void 0:window.bpmnInstances).bpmnElement,E.value=[],b.value=((T=(_=g.value.businessObject)==null?void 0:_.extensionElements)==null?void 0:T.values.filter(M=>M.$type===`${n}:TaskListener`))??[],r.value=b.value.map(M=>$b(M))},B=(_,T)=>{_?(l.value=zb(_),y.value=T):(l.value={},y.value=-1),_&&_.fields?p.value=_.fields.map(M=>({...M,fieldType:M.string?"string":"expression"})):(p.value=[],l.value.fields=[]),c.value=!0,Ne(()=>{S.value&&S.value.clearValidate()})},s=async()=>{var T,M,I;if(!await S.value.validate())return;const _=Fb(l.value,!0,n);y.value===-1?(b.value.push(_),r.value.push(l.value)):(b.value.splice(y.value,1,_),r.value.splice(y.value,1,l.value)),E.value=((I=(M=(T=g.value.businessObject)==null?void 0:T.extensionElements)==null?void 0:M.values)==null?void 0:I.filter($=>$.$type!==`${n}:TaskListener`))??[],nl(g.value,E.value.concat(b.value)),c.value=!1,l.value={}},h=(_,T)=>{v.value=_?JSON.parse(JSON.stringify(_)):{},f.value=_?T:-1,d.value=!0,Ne(()=>{w.value&&w.value.clearValidate()})},m=async()=>{await w.value.validate()&&(f.value===-1?(p.value.push(v.value),l.value.fields.push(v.value)):(p.value.splice(f.value,1,v.value),l.value.fields.splice(f.value,1,v.value)),d.value=!1,Ne(()=>{v.value={}}))};return le(()=>e.id,_=>{_&&_.length&&Ne(()=>{C()})},{immediate:!0}),(_,T)=>{const M=za,I=xr,$=gl,P=$a,x=Cr,N=Er,j=_r,G=dn,W=hn,tt=Vn,it=Fa,at=ed,H=vo;return nt(),Nt("div",DT,[R(P,{data:D(r),size:"small",border:""},{default:V(()=>[R(M,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(M,{label:"\u4E8B\u4EF6\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:q=>D(o)[q.event]},null,8,["formatter"]),R(M,{label:"\u4E8B\u4EF6id","min-width":"80px",prop:"id","show-overflow-tooltip":""}),R(M,{label:"\u76D1\u542C\u5668\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:q=>D(a)[q.listenerType]},null,8,["formatter"]),R(M,{label:"\u64CD\u4F5C",width:"90px"},{default:V(q=>[R(I,{size:"small",link:"",onClick:jt=>B(q.row,q.$index)},{default:V(()=>T[22]||(T[22]=[dt("\u7F16\u8F91")])),_:2},1032,["onClick"]),R($,{direction:"vertical"}),R(I,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:jt=>((Ht,he)=>{br.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u76D1\u542C\u5668\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{b.value.splice(he,1),r.value.splice(he,1),nl(g.value,E.value.concat(b.value))}).catch(()=>{})})(q.row,q.$index)},{default:V(()=>T[23]||(T[23]=[dt("\u79FB\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ot("div",BT,[R(x,{size:"small",type:"primary",preIcon:"ep:plus",title:"\u6DFB\u52A0\u76D1\u542C\u5668",onClick:T[0]||(T[0]=q=>B(null))})]),R(at,{modelValue:D(c),"onUpdate:modelValue":T[15]||(T[15]=q=>We(c)?c.value=q:null),title:"\u4EFB\u52A1\u76D1\u542C\u5668",size:`${D(i)}px`,"append-to-body":"","destroy-on-close":""},{default:V(()=>[R(tt,{size:"small",model:D(l),"label-width":"96px",ref_key:"listenerFormRef",ref:S},{default:V(()=>[R(G,{label:"\u4E8B\u4EF6\u7C7B\u578B",prop:"event",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(j,{modelValue:D(l).event,"onUpdate:modelValue":T[1]||(T[1]=q=>D(l).event=q)},{default:V(()=>[(nt(!0),Nt(qe,null,wr(Object.keys(D(o)),q=>(nt(),St(N,{key:q,label:D(o)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),R(G,{label:"\u76D1\u542C\u5668ID",prop:"id",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(l).id,"onUpdate:modelValue":T[2]||(T[2]=q=>D(l).id=q),clearable:""},null,8,["modelValue"])]),_:1}),R(G,{label:"\u76D1\u542C\u5668\u7C7B\u578B",prop:"listenerType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(j,{modelValue:D(l).listenerType,"onUpdate:modelValue":T[3]||(T[3]=q=>D(l).listenerType=q)},{default:V(()=>[(nt(!0),Nt(qe,null,wr(Object.keys(D(a)),q=>(nt(),St(N,{key:q,label:D(a)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(l).listenerType==="classListener"?(nt(),St(G,{label:"Java\u7C7B",prop:"class",key:"listener-class",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(l).class,"onUpdate:modelValue":T[4]||(T[4]=q=>D(l).class=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(l).listenerType==="expressionListener"?(nt(),St(G,{label:"\u8868\u8FBE\u5F0F",prop:"expression",key:"listener-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(l).expression,"onUpdate:modelValue":T[5]||(T[5]=q=>D(l).expression=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(l).listenerType==="delegateExpressionListener"?(nt(),St(G,{label:"\u4EE3\u7406\u8868\u8FBE\u5F0F",prop:"delegateExpression",key:"listener-delegate",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(l).delegateExpression,"onUpdate:modelValue":T[6]||(T[6]=q=>D(l).delegateExpression=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(l).listenerType==="scriptListener"?(nt(),Nt(qe,{key:3},[R(G,{label:"\u811A\u672C\u683C\u5F0F",prop:"scriptFormat",key:"listener-script-format",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u683C\u5F0F"}},{default:V(()=>[R(W,{modelValue:D(l).scriptFormat,"onUpdate:modelValue":T[7]||(T[7]=q=>D(l).scriptFormat=q),clearable:""},null,8,["modelValue"])]),_:1}),R(G,{label:"\u811A\u672C\u7C7B\u578B",prop:"scriptType",key:"listener-script-type",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u9009\u62E9\u811A\u672C\u7C7B\u578B"}},{default:V(()=>[R(j,{modelValue:D(l).scriptType,"onUpdate:modelValue":T[8]||(T[8]=q=>D(l).scriptType=q)},{default:V(()=>[R(N,{label:"\u5185\u8054\u811A\u672C",value:"inlineScript"}),R(N,{label:"\u5916\u90E8\u811A\u672C",value:"externalScript"})]),_:1},8,["modelValue"])]),_:1}),D(l).scriptType==="inlineScript"?(nt(),St(G,{label:"\u811A\u672C\u5185\u5BB9",prop:"value",key:"listener-script",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u811A\u672C\u5185\u5BB9"}},{default:V(()=>[R(W,{modelValue:D(l).value,"onUpdate:modelValue":T[9]||(T[9]=q=>D(l).value=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(l).scriptType==="externalScript"?(nt(),St(G,{label:"\u8D44\u6E90\u5730\u5740",prop:"resource",key:"listener-resource",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u8D44\u6E90\u5730\u5740"}},{default:V(()=>[R(W,{modelValue:D(l).resource,"onUpdate:modelValue":T[10]||(T[10]=q=>D(l).resource=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0)],64)):Tt("",!0),D(l).event==="timeout"?(nt(),Nt(qe,{key:4},[R(G,{label:"\u5B9A\u65F6\u5668\u7C7B\u578B",prop:"eventDefinitionType",key:"eventDefinitionType"},{default:V(()=>[R(j,{modelValue:D(l).eventDefinitionType,"onUpdate:modelValue":T[11]||(T[11]=q=>D(l).eventDefinitionType=q)},{default:V(()=>[R(N,{label:"\u65E5\u671F",value:"date"}),R(N,{label:"\u6301\u7EED\u65F6\u957F",value:"duration"}),R(N,{label:"\u5FAA\u73AF",value:"cycle"}),R(N,{label:"\u65E0",value:"null"})]),_:1},8,["modelValue"])]),_:1}),D(l).eventDefinitionType&&D(l).eventDefinitionType!=="null"?(nt(),St(G,{label:"\u5B9A\u65F6\u5668",prop:"eventTimeDefinitions",key:"eventTimeDefinitions",rules:{required:!0,trigger:["blur","change"],message:"\u8BF7\u586B\u5199\u5B9A\u65F6\u5668\u914D\u7F6E"}},{default:V(()=>[R(W,{modelValue:D(l).eventTimeDefinitions,"onUpdate:modelValue":T[12]||(T[12]=q=>D(l).eventTimeDefinitions=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0)],64)):Tt("",!0)]),_:1},8,["model"]),R($),Ot("p",OT,[Ot("span",null,[R(it,{icon:"ep:menu"}),T[24]||(T[24]=dt("\u6CE8\u5165\u5B57\u6BB5\uFF1A"))]),R(I,{size:"small",type:"primary",onClick:T[13]||(T[13]=q=>h(null))},{default:V(()=>T[25]||(T[25]=[dt("\u6DFB\u52A0\u5B57\u6BB5")])),_:1})]),R(P,{data:D(p),size:"small","max-height":"240",fit:"",border:"",style:{flex:"none"}},{default:V(()=>[R(M,{label:"\u5E8F\u53F7",width:"50px",type:"index"}),R(M,{label:"\u5B57\u6BB5\u540D\u79F0","min-width":"100px",prop:"name"}),R(M,{label:"\u5B57\u6BB5\u7C7B\u578B","min-width":"80px","show-overflow-tooltip":"",formatter:q=>D(u)[q.fieldType]},null,8,["formatter"]),R(M,{label:"\u5B57\u6BB5\u503C/\u8868\u8FBE\u5F0F","min-width":"100px","show-overflow-tooltip":"",formatter:q=>q.string||q.expression},null,8,["formatter"]),R(M,{label:"\u64CD\u4F5C",width:"100px"},{default:V(q=>[R(I,{size:"small",link:"",onClick:jt=>h(q.row,q.$index)},{default:V(()=>T[26]||(T[26]=[dt("\u7F16\u8F91")])),_:2},1032,["onClick"]),R($,{direction:"vertical"}),R(I,{size:"small",link:"",style:{color:"#ff4d4f"},onClick:jt=>((Ht,he)=>{br.confirm("\u786E\u8BA4\u79FB\u9664\u8BE5\u5B57\u6BB5\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E \u8BA4",cancelButtonText:"\u53D6 \u6D88"}).then(()=>{p.value.splice(he,1),l.value.fields.splice(he,1)}).catch(()=>{})})(q.row,q.$index)},{default:V(()=>T[27]||(T[27]=[dt("\u79FB\u9664")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),Ot("div",LT,[R(I,{size:"small",onClick:T[14]||(T[14]=q=>c.value=!1)},{default:V(()=>T[28]||(T[28]=[dt("\u53D6 \u6D88")])),_:1}),R(I,{size:"small",type:"primary",onClick:s},{default:V(()=>T[29]||(T[29]=[dt("\u4FDD \u5B58")])),_:1})])]),_:1},8,["modelValue","size"]),R(H,{title:"\u5B57\u6BB5\u914D\u7F6E",modelValue:D(d),"onUpdate:modelValue":T[21]||(T[21]=q=>We(d)?d.value=q:null),width:"600px","append-to-body":"","destroy-on-close":""},{footer:V(()=>[R(I,{size:"small",onClick:T[20]||(T[20]=q=>d.value=!1)},{default:V(()=>T[30]||(T[30]=[dt("\u53D6 \u6D88")])),_:1}),R(I,{size:"small",type:"primary",onClick:m},{default:V(()=>T[31]||(T[31]=[dt("\u786E \u5B9A")])),_:1})]),default:V(()=>[R(tt,{model:D(v),size:"small","label-width":"96px",ref_key:"listenerFieldFormRef",ref:w,style:{height:"136px"}},{default:V(()=>[R(G,{label:"\u5B57\u6BB5\u540D\u79F0\uFF1A",prop:"name",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(v).name,"onUpdate:modelValue":T[16]||(T[16]=q=>D(v).name=q),clearable:""},null,8,["modelValue"])]),_:1}),R(G,{label:"\u5B57\u6BB5\u7C7B\u578B\uFF1A",prop:"fieldType",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(j,{modelValue:D(v).fieldType,"onUpdate:modelValue":T[17]||(T[17]=q=>D(v).fieldType=q)},{default:V(()=>[(nt(!0),Nt(qe,null,wr(Object.keys(D(u)),q=>(nt(),St(N,{key:q,label:D(u)[q],value:q},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),D(v).fieldType==="string"?(nt(),St(G,{label:"\u5B57\u6BB5\u503C\uFF1A",prop:"string",key:"field-string",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(v).string,"onUpdate:modelValue":T[18]||(T[18]=q=>D(v).string=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0),D(v).fieldType==="expression"?(nt(),St(G,{label:"\u8868\u8FBE\u5F0F\uFF1A",prop:"expression",key:"field-expression",rules:{required:!0,trigger:["blur","change"]}},{default:V(()=>[R(W,{modelValue:D(v).expression,"onUpdate:modelValue":T[19]||(T[19]=q=>D(v).expression=q),clearable:""},null,8,["modelValue"])]),_:1})):Tt("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}}),il=ke({name:"MyPropertiesPanel",__name:"PropertiesPanel",props:{bpmnModeler:{type:Object,default:()=>{}},prefix:{type:String,default:"camunda"},width:{type:Number,default:480},idEditDisabled:{type:Boolean,default:!1},model:Object},setup(t){const e=t,n=X("base"),i=X(""),r=X(""),o=X({}),a=X(!1),c=X(!1),l=X();ja("prefix",e.prefix),ja("width",e.width);const u=()=>window==null?void 0:window.bpmnInstances,p=le(()=>e.bpmnModeler,()=>{e.bpmnModeler&&(window.bpmnInstances={modeler:e.bpmnModeler,modeling:e.bpmnModeler.get("modeling"),moddle:e.bpmnModeler.get("moddle"),eventBus:e.bpmnModeler.get("eventBus"),bpmnFactory:e.bpmnModeler.get("bpmnFactory"),elementFactory:e.bpmnModeler.get("elementFactory"),elementRegistry:e.bpmnModeler.get("elementRegistry"),replace:e.bpmnModeler.get("replace"),selection:e.bpmnModeler.get("selection")},d(),p())},{immediate:!0}),d=()=>{y(null),e.bpmnModeler.on("import.done",f=>{y(null)}),e.bpmnModeler.on("selection.changed",({newSelection:f})=>{y(f[0]||null)}),e.bpmnModeler.on("element.changed",({element:f})=>{f&&f.id===i.value&&y(f)})},y=f=>{let v=f;v||(v=u().elementRegistry.find(g=>g.type==="bpmn:Process")??u().elementRegistry.find(g=>g.type==="bpmn:Collaboration")),v&&(u().bpmnElement=v,l.value=v,i.value=v.id,r.value=v.type.split(":")[1]||"",o.value=JSON.parse(JSON.stringify(v.businessObject)),a.value=!(r.value!=="SequenceFlow"||!v.source||v.source.type.indexOf("StartEvent")!==-1),c.value=r.value==="UserTask"||r.value==="StartEvent")};return wn(()=>{window.bpmnInstances=null}),le(()=>i.value,()=>{n.value="base"}),(f,v)=>{const g=Fa,b=l0,E=bl,S=Zh("router-link"),w=u0;return nt(),Nt("div",{class:"process-panel__container",style:a0({width:`${t.width}px`})},[R(w,{modelValue:D(n),"onUpdate:modelValue":v[0]||(v[0]=C=>We(n)?n.value=C:null)},{default:V(()=>[R(b,{name:"base"},{title:V(()=>[R(g,{icon:"ep:info-filled"}),v[1]||(v[1]=dt(" \u5E38\u89C4"))]),default:V(()=>[R(nT,{"id-edit-disabled":t.idEditDisabled,"business-object":D(o),type:D(r),model:t.model},null,8,["id-edit-disabled","business-object","type","model"])]),_:1}),D(r)==="Process"?(nt(),St(b,{name:"condition",key:"message"},{title:V(()=>[R(g,{icon:"ep:comment"}),v[2]||(v[2]=dt("\u6D88\u606F\u4E0E\u4FE1\u53F7"))]),default:V(()=>[R(wT)]),_:1})):Tt("",!0),D(a)?(nt(),St(b,{name:"condition",key:"condition"},{title:V(()=>[R(g,{icon:"ep:promotion"}),v[3]||(v[3]=dt("\u6D41\u8F6C\u6761\u4EF6"))]),default:V(()=>[R(bT,{"business-object":D(o),type:D(r)},null,8,["business-object","type"])]),_:1})):Tt("",!0),D(c)?(nt(),St(b,{name:"condition",key:"form"},{title:V(()=>[R(g,{icon:"ep:list"}),v[4]||(v[4]=dt("\u8868\u5355"))]),default:V(()=>[v[6]||(v[6]=dt(" \u53CB\u60C5\u63D0\u793A\uFF1A\u4F7F\u7528 ")),R(S,{to:{path:"/bpm/manager/form"}},{default:V(()=>[R(E,{type:"danger"},{default:V(()=>v[5]||(v[5]=[dt("\u6D41\u7A0B\u8868\u5355")])),_:1})]),_:1}),v[7]||(v[7]=dt(" \u66FF\u4EE3\uFF0C\u63D0\u4F9B\u66F4\u597D\u7684\u8868\u5355\u8BBE\u8BA1\u529F\u80FD "))]),_:1})):Tt("",!0),D(r).indexOf("Task")!==-1?(nt(),St(b,{name:"task",key:"task"},{title:V(()=>[R(g,{icon:"ep:checked"}),v[8]||(v[8]=dt("\u4EFB\u52A1"))]),default:V(()=>[R(fT,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1})):Tt("",!0),D(r).indexOf("Task")!==-1?(nt(),St(b,{name:"multiInstance",key:"multiInstance"},{title:V(()=>[R(g,{icon:"ep:help-filled"}),v[9]||(v[9]=dt("\u591A\u5B9E\u4F8B"))]),default:V(()=>[R(yT,{"business-object":D(o),type:D(r)},null,8,["business-object","type"])]),_:1})):Tt("",!0),R(b,{name:"listeners",key:"listeners"},{title:V(()=>[R(g,{icon:"ep:bell-filled"}),v[10]||(v[10]=dt("\u6267\u884C\u76D1\u542C\u5668"))]),default:V(()=>[R(MT,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1}),D(r)==="UserTask"?(nt(),St(b,{name:"taskListeners",key:"taskListeners"},{title:V(()=>[R(g,{icon:"ep:bell-filled"}),v[11]||(v[11]=dt("\u4EFB\u52A1\u76D1\u542C\u5668"))]),default:V(()=>[R(jT,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1})):Tt("",!0),R(b,{name:"extensions",key:"extensions"},{title:V(()=>[R(g,{icon:"ep:circle-plus-filled"}),v[12]||(v[12]=dt("\u6269\u5C55\u5C5E\u6027"))]),default:V(()=>[R(IT,{id:D(i),type:D(r)},null,8,["id","type"])]),_:1}),R(b,{name:"other",key:"other"},{title:V(()=>[R(g,{icon:"ep:promotion"}),v[13]||(v[13]=dt("\u5176\u4ED6"))]),default:V(()=>[R(aT,{id:D(i)},null,8,["id"])]),_:1})]),_:1},8,["modelValue"])],4)}}});il.install=function(t){t.component(il.name,il)};const VT={class:"my-process-designer"},FT={class:"my-process-designer__container"},rl=ke({name:"MyProcessViewer",__name:"ProcessViewer",props:{value:{type:String,default:""},prefix:{type:String,default:"camunda"},activityData:{type:Array,default:()=>[]},processInstanceData:{type:Object,default:()=>{}},taskData:{type:Array,default:()=>[]}},emits:["destroy"],setup(t,{emit:e}){const n=t;ja("configGlobal",n);const i=e;let r;const o=X(""),a=X([]),c=X(void 0),l=X([]),u=X(),p=X(null),d=X(null),y=async w=>{let C=`Process_${new Date().getTime()}`,B=`\u4E1A\u52A1\u6D41\u7A0B_${new Date().getTime()}`,s=w||qg(C,B,n.prefix);try{let{warnings:h}=await r.importXML(s);h&&h.length&&h.forEach(m=>{}),await f(),r.get("canvas").zoom("fit-viewport","auto")}catch{}},f=async()=>{var _;const w=a.value;if(w.length===0)return;let C=r.get("canvas"),B=w.find(T=>!T.endTime),s=w[w.length-1],h=!1,m=[];(_=r.getDefinitions().rootElements[0].flowElements)==null||_.forEach(T=>{var I,$,P;let M=w.find(x=>x.key===T.id);if(M){if(T.$type==="bpmn:UserTask"){const x=l.value.find(j=>j.id===M.taskId);if(!x)return;if(h)return void m.push(T.id);if(C.addMarker(T.id,g(x.result)),x.result===1&&(h=!0),x.result!==2)return;const N=b(M);N==null||N.forEach(j=>{let G=w.find(W=>W.key===j.targetRef.id);G?C.addMarker(j.id,G.endTime?"highlight":"highlight-todo"):j.targetRef.$type==="bpmn:ExclusiveGateway"?(C.addMarker(j.id,M.endTime?"highlight":"highlight-todo"),C.addMarker(j.targetRef.id,M.endTime?"highlight":"highlight-todo")):j.targetRef.$type==="bpmn:EndEvent"&&(B||s.key!==T.id||(C.addMarker(j.id,"highlight"),C.addMarker(j.targetRef.id,"highlight")),M.endTime||(C.addMarker(j.id,"highlight-todo"),C.addMarker(j.targetRef.id,"highlight-todo")))})}else if(T.$type==="bpmn:ExclusiveGateway"){let x,N;C.addMarker(T.id,v(M)),(I=T.outgoing)==null||I.forEach(j=>{let G=w.find(W=>W.key===j.targetRef.id);G&&(N&&N.type!=="endEvent"||(x=j,N=G))}),x&&N&&C.addMarker(x.id,v(N))}else if(T.$type==="bpmn:ParallelGateway")C.addMarker(T.id,v(M)),($=T.outgoing)==null||$.forEach(x=>{const N=w.find(j=>j.key===x.targetRef.id);N&&(C.addMarker(x.id,v(N)),C.addMarker(x.targetRef.id,v(N)))});else if(T.$type==="bpmn:StartEvent")(P=T.outgoing)==null||P.forEach(x=>{w.find(N=>N.key===x.targetRef.id)&&(C.addMarker(x.id,"highlight"),C.addMarker(T.id,"highlight"))});else if(T.$type==="bpmn:EndEvent"){if(!c.value||c.value.result===1)return;C.addMarker(T.id,g(c.value.result))}else if(T.$type==="bpmn:ServiceTask"&&(M.startTime>0&&M.endTime===0&&C.addMarker(T.id,g(1)),M.endTime>0)){C.addMarker(T.id,g(2));const x=b(M);x==null||x.forEach(N=>{C.addMarker(N.id,g(2))})}}}),s0(m)||(l.value=l.value.filter(T=>!m.includes(T.definitionKey)))},v=w=>w.endTime?"highlight":"highlight-todo",g=w=>w===1?"highlight-todo":w===2?"highlight":w===3?"highlight-reject":w===4?"highlight-cancel":w===5||w===6||w===7||w===8||w===9?"highlight-return":"",b=w=>{if(w.outgoing&&w.outgoing.length>0)return w.outgoing;const C=r.getDefinitions().rootElements[0].flowElements,B=[];return C.forEach(s=>{s.$type==="bpmn:SequenceFlow"&&s.sourceRef.id===w.key&&B.push(s)}),B},E=w=>{var B;w.value=w,!p.value&&(p.value={}),!d.value&&(d.value=r.get("overlays"));const C=a.value.find(s=>s.key===w.value.id);if(C&&!p.value[w.value.id]&&w.value.type!=="bpmn:Process"){let s=`<div class="element-overlays">
- <p>Elemet id: ${w.value.id}</p>
- <p>Elemet type: ${w.value.type}</p>
- </div>`;if(w.value.type==="bpmn:StartEvent"&&c.value)s=`<p>\u53D1\u8D77\u4EBA\uFF1A${c.value.startUser.nickname}</p>
- <p>\u90E8\u95E8\uFF1A${c.value.startUser.deptName}</p>
- <p>\u521B\u5EFA\u65F6\u95F4\uFF1A${Tr(c.value.createTime)}`;else if(w.value.type==="bpmn:UserTask"){let h=l.value.find(T=>T.id===C.taskId);if(!h)return;let m=nd(id.BPM_PROCESS_INSTANCE_RESULT),_="";m.forEach(T=>{T.value==h.result&&(_=T.label)}),s=`<p>\u5BA1\u6279\u4EBA\uFF1A${h.assigneeUser.nickname}</p>
- <p>\u90E8\u95E8\uFF1A${h.assigneeUser.deptName}</p>
- <p>\u7ED3\u679C\uFF1A${_}</p>
- <p>\u521B\u5EFA\u65F6\u95F4\uFF1A${Tr(h.createTime)}</p>`,h.endTime&&(s+=`<p>\u7ED3\u675F\u65F6\u95F4\uFF1A${Tr(h.endTime)}</p>`),h.reason&&(s+=`<p>\u5BA1\u6279\u5EFA\u8BAE\uFF1A${h.reason}</p>`)}else if(w.value.type==="bpmn:ServiceTask"&&c.value)C.startTime>0&&(s=`<p>\u521B\u5EFA\u65F6\u95F4\uFF1A${Tr(C.startTime)}</p>`),C.endTime>0&&(s+=`<p>\u7ED3\u675F\u65F6\u95F4\uFF1A${Tr(C.endTime)}</p>`);else if(w.value.type==="bpmn:EndEvent"&&c.value){let h=nd(id.BPM_PROCESS_INSTANCE_RESULT),m="";h.forEach(_=>{_.value==c.value.result&&(m=_.label)}),s=`<p>\u7ED3\u679C\uFF1A${m}</p>`,c.value.endTime&&(s+=`<p>\u7ED3\u675F\u65F6\u95F4\uFF1A${Tr(c.value.endTime)}</p>`)}p.value[w.value.id]=(B=Bt(d.value))==null?void 0:B.add(w.value,{position:{left:0,bottom:0},html:`<div class="element-overlays">${s}</div>`})}},S=w=>{Bt(d.value).remove({element:w}),p.value[w.id]=null};return fo(()=>{o.value=n.value,a.value=n.activityData,r||(r=new Wn({container:u.value,bpmnRenderer:{}})),y(o.value),(()=>{const w=r.get("eventBus");w.on("element.hover",function(C){let B=C?C.element:null;E(B)}),w.on("element.out",function(C){let B=C?C.element:null;S(B)})})()}),wn(()=>{r&&r.destroy(),i("destroy",r),r=null}),le(()=>n.value,w=>{o.value=w,y(o.value)}),le(()=>n.activityData,w=>{a.value=w,y(o.value)}),le(()=>n.processInstanceData,w=>{c.value=w,y(o.value)}),le(()=>n.taskData,w=>{l.value=w,y(o.value)}),(w,C)=>(nt(),Nt("div",VT,[Ot("div",FT,[Ot("div",{class:"my-process-designer__canvas",style:{height:"760px"},ref_key:"bpmnCanvas",ref:u},null,512)])]))}});rl.install=function(t){t.component(rl.name,rl)};export{Tc as P,el as _,A as a,jC as b,je as c,Pb as d,Pt as e,Rb as f,wi as g,il as h,wt as i,rl as j};
|