/*! bpmn-js - bpmn-modeler v0.25.0 | (c) 2014, 2017 camunda Services GmbH | bpmn.io/license */ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).BpmnJS=e()}}(function(){function e(e){return e&&e.businessObject||e}function t(e,t){var n=gs(e),i=!1;return n.eventDefinitions&&ms(n.eventDefinitions,function(e){vs(e,t)&&(i=!0)}),i}function n(e,t){var n=this;t=t||bs,e.on(["render.shape","render.connection"],t,function(e,t){var i=e.type,r=t.element,o=t.gfx;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r):n.drawConnection(o,r)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)})}function i(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=ws[i];r?(r===_s&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function r(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return ws[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);i(e,t,n)}else!function(e,t){var n,r,o=Object.keys(t);for(n=0,r;r=o[n];n++)i(e,r,t[r])}(e,t);return e}function o(e){return""+e+"",function(e){var t;return t=new DOMParser,t.async=!1,t.parseFromString(e,"text/xml")}(e)}function a(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function s(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function c(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function p(e,t){var n=e.transform.baseVal;if(1===arguments.length)return n.consolidate();t.length?function(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(c(e,i));e.consolidate()}(n,t):n.initialize(c(n,t))}function l(e,t,n,i,r,o){return e===t||(null==e||null==t||!ka(e)&&!Na(t)?e!=e&&t!=t:tc(e,t,l,n,i,r,o))}function u(e,t,n,i,r){if(!ka(e))return e;var o=Ka(t)&&(rs(t)||Ys(t)),a=o?void 0:ls(t);return Ma(a||t,function(s,c){if(a&&(s=t[c=s]),Na(s))i||(i=[]),r||(r=[]),$c(e,t,c,u,n,i,r);else{var p=e[c],l=n?n(p,s,c,e,t):void 0,h=void 0===l;h&&(l=s),void 0===l&&(!o||c in e)||!h&&(l==l?l===p:p!=p)||(e[c]=l)}}),e}function h(e,t,n,i){i||(i=[]);for(var r=-1,o=e.length;++r1)for(;n=i.shift();){if(!(n.length+o already defined")}function q(e){this.properties=new jl(this),this.factory=new Nl(this,this.properties),this.registry=new Hl(e,this.properties),this.typeCache={}}function Y(e,t,n,i){return i?Xl.call(Ql,i)?Ql[i]:"&"+i+";":Kl(t?t:parseInt(n,16))}function K(e){return new Error(e)}function X(e){return"missing namespace for prefix <"+e+">"}function Z(e){return{get:e,enumerable:!0}}function Q(e){var t,n={};for(t in e)n[t]=e[t];return n}function J(e){return e+"$uri"}function ee(){return{line:0,column:0}}function te(e){throw e}function ne(e){function t(e){e instanceof Error||(e=K(e)),g=e,f(e,m)}function n(e){c&&(e instanceof Error||(e=K(e)),c(e,m))}function i(e){function i(){if(null!==T)return T;for(var e,t,i,r,o,a,s,c,p,l,u=v&&R.xmlns,d=v&&y?[]:null,f=j,m=O,g=m.length,b={};f8)){if((p<65||p>122||p>90&&p<97)&&95!==p&&58!==p)return n("illegal first char attribute name"),T=!1;for(l=f+1;l96&&p<123||p>64&&p<91||p>47&&p<59||45===p||95===p)){if(61!==p)return n("missing attribute value"),T=!1;break}if("xmlns:xmlns"===(c=m.substring(f,l)))return n("illegal declaration of xmlns"),T=!1;if(34===(p=m.charCodeAt(l+1)))l=m.indexOf('"',f=l+2);else{if(39!==p)return n("missing attribute value quotes"),T=!1;l=m.indexOf("'",f=l+2)}if(-1===l)return n("attribute value quote missmatch"),T=!1;if(l+132||p<9||p<32&&p>13))return n("illegal character after attribute end"),T=!1;if(a=m.substring(f,l),f=l+1,v)if(y){if(null!==(o="xmlns"===c?"xmlns":120===c.charCodeAt(0)&&"xmlns:"===c.substr(0,6)?c.substr(6):null)){if(e=Yl(a),t=J(o),!(s=h[e])){if("xmlns"===o||t in R&&R[t]!==e)do{s="ns"+M++}while(void 0!==R[s]);else s=o;h[e]=s}R[o]!==s&&(r||(R=Q(R),r=!0),R[o]=s,"xmlns"===o&&(R[J(s)]=e,u=s),R[t]=e),b[c]=a;continue}d.push(c,a)}else-1!==(p=c.indexOf(":"))?(i=R[c.substring(0,p)])?((c=u===i?c.substr(p+1):i+c.substr(p))===nu&&(-1!==(p=a.indexOf(":"))?(i=a.substring(0,p),a=(i=R[i]||i)+a.substring(p)):a=u+":"+a),b[c]=a):n(X(c.substring(0,p))):b[c]=a;else b[c]=a}if(y)for(f=0,g=d.length;f=a&&(t=i.exec(e))&&!((s=t[0].length+t.index)>D);)r+=1,a=s;return-1==D?(o=s,n=""):(o=D-a,n=-1==N?e.substring(D):e.substring(D,N+1)),{data:n,line:r,column:o}},d&&(A=Object.create({},{name:Z(function(){return w}),originalName:Z(function(){return S}),attrs:Z(i),ns:Z(function(){return R})}));-1!==N;){if(-1===(D=60===e.charCodeAt(N)?N:e.indexOf("<",N))){if(P.length)return t("unexpected end of file");if(0===N)return t("missing start tag");return}if(N!==D&&r&&(r(e.substring(N,D),Yl),b))return;if(33!==(E=e.charCodeAt(D+1)))if(63!==E){if(-1==(N=e.indexOf(">",D+1)))return t("unclosed tag");if(T={},47===E){if(k=!1,B=!0,!P.length)return t("missing open tag");if(f=w=P.pop(),x=D+2+f.length,e.substring(D+2,x)!==f)return t("closing tag mismatch");for(;x8&&E<14))return t("close tag")}else{if(47===e.charCodeAt(N-1)?(f=w=e.substring(D+1,N-1),k=!0,B=!0):(f=w=e.substring(D+1,N),k=!0,B=!1),!(E>96&&E<123||E>64&&E<91||95===E||58===E))return t("illegal first char nodeName");for(x=1,g=f.length;x96&&E<123||E>64&&E<91||E>47&&E<59||45===E||95===E)){if(32===E||E<14&&E>8){w=f.substring(0,x),T=null;break}return t("invalid nodeName")}B||P.push(w)}if(v){if(c=R,k&&(B||C.push(c),null===T&&(y=-1!==f.indexOf("xmlns",x))&&(j=x,O=f,i(),y=!1)),S=w,-1!==(E=w.indexOf(":"))){if(!(_=R[w.substring(0,E)]))return t("missing namespace on <"+S+">");w=w.substr(E+1)}else _=R.xmlns;_&&(w=_+":"+w)}if(k&&(j=x,O=f,o&&(d?o(A,Yl,B,m):o(w,i,Yl,B,m),b)))return;if(B){if(a&&(a(d?A:w,Yl,k,m),b))return;v&&(R=k?c:C.pop())}N+=1}else{if(-1===(N=e.indexOf("?>",D)))return t("unclosed question");if(l&&(l(e.substring(D,N+2)),b))return;N+=2}else{if(91===(E=e.charCodeAt(D+2))&&"CDATA["===e.substr(D+3,6)){if(-1===(N=e.indexOf("]]>",D)))return t("unclosed cdata");if(s&&(s(e.substring(D+9,N)),b))return;N+=3;continue}if(45===E&&45===e.charCodeAt(D+3)){if(-1===(N=e.indexOf("--\x3e",D)))return t("unclosed comment");if(p&&(p(e.substring(D+4,N),Yl),b))return;N+=3;continue}if(-1===(N=e.indexOf(">",D+1)))return t("unclosed tag");if(u&&(u(e.substring(D,N+1),Yl),b))return;N+=1}}}if(!this)return new ne(e);var r,o,a,s,c,p,l,u,h,d=e&&e.proxy,f=te,m=ee,y=!1,v=!1,g=null,b=!1;this.on=function(e,t){if("function"!=typeof t)throw K("required args ");switch(e){case"openTag":o=t;break;case"text":r=t;break;case"closeTag":a=t;break;case"error":f=t;break;case"warn":c=t;break;case"cdata":s=t;break;case"attention":u=t;break;case"question":l=t;break;case"comment":p=t;break;default:throw K("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw K("required args ");var t,n={};for(t in e)n[t]=e[t];return n[eu]=tu,v=!0,h=n,this},this.parse=function(e){if("string"!=typeof e)throw K("required args ");return g=null,i(e),m=ee,b=!1,g},this.stop=function(){b=!0}}function ie(e,t){return lu(t)?e.prefix+":"+function(e){return e.charAt(0).toUpperCase()+e.slice(1)}(e.localName):e.name}function re(e){return new Error(e)}function oe(e){return e.$descriptor}function ae(){}function se(){}function ce(){}function pe(e,t){this.property=e,this.context=t}function le(e,t){this.element=t,this.propertyDesc=e}function ue(){}function he(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function de(e,t,n){he.call(this,e,t,n)}function fe(e,t,n){this.model=e,this.context=n}function me(e){e instanceof ql&&(e={model:e}),Bc(this,{lax:!1},e)}function ye(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function ve(e){return Cl(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function ge(e,t){return t.isGeneric?Bc({localName:t.ns.localName},e):Bc({localName:function(e,t){return hu(t)?function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(e):e}(t.ns.localName,t.$pkg)},e)}function be(e){return(e=Cl(e)?e:""+e).replace(yu,function(e){return"&#"+bu[e]+";"})}function xe(e,t){this.ns=t}function Ee(){}function _e(e){this.ns=e}function we(e,t){this.body=[],this.attrs=[],this.parent=e,this.ns=t}function Se(e,t){we.call(this,e,t)}function Ae(e,t){ql.call(this,e,t)}function Te(e,t,n){var i=!n||-1===e.indexOf(t);return i&&e.push(t),i}function Ce(e,t,n){n=n||0,rs(e)||(e=[e]),ms(e,function(e,i){var r=t(e,i,n);rs(r)&&r.length&&Ce(r,t,n+1)})}function Re(e,t,n){var i=[],r=[];return Ce(e,function(e,o,a){Te(i,e,t);var s=e.children;if((-1===n||ar||void 0===r)&&(r=s+l),(c+p>o||void 0===o)&&(o=c+p)}),{x:n,y:i,height:o-i,width:r-n}}function Me(e,t){return Math.round(e*t)/t}function ke(e){return Mu(e)?e+"px":e}function Be(e,t,n){var i=Cs("g");hp(i).add(t);var r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]),i}function De(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}function Ne(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}function Oe(){Object.defineProperty(this,"businessObject",{writable:!0}),zu.bind(this,"parent"),$u.bind(this,"label"),Gu.bind(this,"outgoing"),Hu.bind(this,"incoming")}function je(){Oe.call(this),zu.bind(this,"children"),Wu.bind(this,"host"),Wu.bind(this,"attachers")}function Le(){je.call(this)}function Ie(){je.call(this),$u.bind(this,"labelTarget")}function Fe(){Oe.call(this),Gu.bind(this,"source"),Hu.bind(this,"target")}function ze(){this._uid=12}function $e(e){this._elements={},this._eventBus=e}function We(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=oh,this.__views__=[]}function Ge(e,t,n){this.__wrapped__=e,this.__actions__=n||[],this.__chain__=!!t}function He(e){if(Na(e)&&!rs(e)&&!(e instanceof ah)){if(e instanceof sh)return e;if(ph.call(e,"__chain__")&&ph.call(e,"__wrapped__"))return ch(e)}return new sh(e)}function Ve(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function Ue(){}function qe(e,t){this._eventBus=e,this._elementRegistry=t}function Ye(e,t){xs.call(this,e,qh),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2})}function Ke(e){function t(e){return i.indexOf(e)>=0}function n(e){t(e)||((e.__depends__||[]).forEach(n),t(e)||(!function(e){i.push(e)}(e),(e.__init__||[]).forEach(function(e){r.push(e)})))}var i=[],r=[];e.forEach(n);var o=new rd.Injector(i);return r.forEach(function(e){try{o["string"==typeof e?"get":"invoke"](e)}catch(e){throw console.error("Failed to instantiate component"),console.error(e.stack),e}}),o}function Xe(e,t){this.injector=t=t||function(e){return Ke([{config:["value",e=e||{}]},Yh].concat(e.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function Ze(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}function Qe(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Je(e,t,n){Bc(e.style,{left:t+"px",top:n+"px"})}function et(e,t){e.style.display=!1===t?"none":""}function tt(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}function nt(e){return void 0!==e}function it(e,t,n,i){this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=md,this._overlayDefaults=Bc({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=function(e){var t=El('
');return e.insertBefore(t,e.firstChild),t}(n.getContainer()),this._init()}function rt(e){return e&&e.preventDefault()}function ot(e,t){e&&(e.stopPropagation&&e.stopPropagation(),t&&e.stopImmediatePropagation&&e.stopImmediatePropagation())}function at(e){return e.originalEvent||e.srcEvent}function st(e){rt(e),rt(at(e))}function ct(e,t){ot(e,t),ot(at(e),t)}function pt(e){return!(Ed(e)||e).button}function lt(e,t,n){function i(n,i,r){if(wd(i)){var o,a;r?a=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(a=o,r=t.get(a)),a&&r&&!1===e.fire(n,{element:r,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault())}}function r(e){var t=c[e];return t||(t=c[e]=function(t){i(e,t)}),t}function o(e,t,n){var i=r(n);i.$delegate=yl.bind(e,l,t,i)}function a(e,t,n){yl.unbind(e,t,r(n).$delegate)}var s=n.cls("djs-hit",["no-fill","no-border"],{stroke:"white",strokeWidth:15}),c={},p={mouseover:"element.hover",mouseout:"element.out",click:"element.click",dblclick:"element.dblclick",mousedown:"element.mousedown",mouseup:"element.mouseup"},l="svg, .djs-element";e.on("canvas.destroy",function(e){!function(e){ms(p,function(t,n){a(e,n,t)})}(e.svg)}),e.on("canvas.init",function(e){!function(e){ms(p,function(t,n){o(e,n,t)})}(e.svg)}),e.on(["shape.added","connection.added"],function(e){var t,n=e.element,i=e.gfx;n.waypoints?t=Sd(n.waypoints):(t=Cs("rect"),Es(t,{x:0,y:0,width:n.width,height:n.height})),Es(t,s),Xc(i,t)}),e.on("shape.changed",Td,function(e){var t=e.element,n=e.gfx,i=up(".djs-hit",n);Es(i,{width:t.width,height:t.height})}),e.on("connection.changed",function(e){var t=e.element,n=e.gfx,i=up(".djs-hit",n);Ad(i,t.waypoints)}),this.fire=i,this.triggerMouseEvent=function(e,t,n){var r=p[e];if(!r)throw new Error("unmapped DOM event name <"+e+">");return i(r,t,n)},this.mouseHandler=r,this.registerEvent=o,this.unregisterEvent=a}function ut(e,t,n){function i(e,t){var n=Cs("rect");return Es(n,Bc({x:10,y:10,width:100,height:100},r)),Xc(e,n),n}this.offset=6;var r=t.cls("djs-outline",["no-fill"]),o=this;e.on(["shape.added","shape.changed"],Pd,function(e){var t=e.element,n=e.gfx,r=up(".djs-outline",n);r||(r=i(n)),o.updateShapeOutline(r,t)}),e.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,r=up(".djs-outline",n);r||(r=i(n)),o.updateConnectionOutline(r,t)})}function ht(e){this._eventBus=e,this._selectedElements=[];var t=this;e.on(["shape.remove","connection.remove"],function(e){var n=e.element;t.deselect(n)}),e.on(["diagram.clear"],function(e){t.select(null)})}function dt(e,t,n,i){e.on("create.end",500,function(e){e.context.canExecute&&t.select(e.context.shape)}),e.on("connect.end",500,function(e){e.context.canExecute&&e.context.target&&t.select(e.context.target)}),e.on("shape.move.end",500,function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);Jp(n,function(e){return r.id===e.id})||t.select(r)}),e.on("element.click",function(e){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=Bd(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)})}function ft(e,t,n,i){function r(e,n){t.addMarker(e,n)}function o(e,n){t.removeMarker(e,n)}this._multiSelectionBox=null,e.on("element.hover",function(e){r(e.element,Nd)}),e.on("element.out",function(e){o(e.element,Nd)}),e.on("selection.changed",function(e){var t=e.oldSelection,n=e.newSelection;ms(t,function(e){-1===n.indexOf(e)&&function(e){o(e,Od)}(e)}),ms(n,function(e){-1===t.indexOf(e)&&function(e){r(e,Od)}(e)})})}function mt(e,t){return e.replace(t,function(e,t){return Zd[t]||t})}function yt(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(mt(e.textContent,Kd));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n"),n=0,i=(a=e.childNodes).length;n")}else t.push("/>");break;case 8:t.push("\x3c!--",mt(e.nodeValue,Kd),"--\x3e");break;case 4:t.push("");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function vt(e,t){if(void 0!==t){try{!function(e,t){var n,i=As(t).documentElement;if(qd(e),t)for(n=i.firstChild;n;)Kc(n,e),n=n.nextSibling}(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)Yd(t,n),t=t.nextSibling;return n.join("")}(e)}function gt(e){return e+(Mu(e)?"px":"")}function bt(e){e=Bc({},Jd,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),function(e){var t=_l.BPMNIO_LOGO,n=El('');e.appendChild(n),Ud.bind(n,"click",function(e){_l.open(),e.preventDefault()})}(this._container),this._init(this._container,this._moddle,e)}function xt(e){nf(e),Et(!1)}function Et(e){Ud[e?"bind":"unbind"](document.body,"click",xt,!0)}function _t(e,t){function n(e){var n=r.start,i=gd.toPoint(e),o=cf(i,n);if(!r.dragging&&function(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}(o)>pf&&(r.dragging=!0,tf.install(),rf.set("grab")),r.dragging){var a=r.last||r.start;o=cf(i,a),t.scroll({dx:o.x,dy:o.y}),r.last=i}e.preventDefault()}function i(e){Ud.unbind(document,"mousemove",n),Ud.unbind(document,"mouseup",i),r=null,rf.unset()}var r,o=t._container;Ud.bind(o,"mousedown",function(e){sf(e.target,".djs-draggable")||e.button||e.ctrlKey||e.shiftKey||e.altKey||(r={start:gd.toPoint(e)},Ud.bind(document,"mousemove",n),Ud.bind(document,"mouseup",i))})}function wt(e,t,n){this._enabled=!1,this._canvas=t,this._container=t._container,this._handleWheel=Ih(this._handleWheel,this);var i=!n||!1!==n.enabled;this.totalDelta=0;var r=this;e.on("canvas.init",function(e){r._init(i)})}function St(e){ef.call(this,e)}function At(e){this._eventBus=e}function Tt(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function Ct(e,t){return"finite"==(t=String.prototype.toLowerCase.call(t))?isFinite(e):!("array"!=t||!(e instanceof Array||Array.isArray&&Array.isArray(e)))||("null"==t&&null===e||t==typeof e&&null!==e||"object"==t&&e===Object(e)||Object.prototype.toString.call(e).slice(8,-1).toLowerCase()==t)}function Rt(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var n in e)e[Cf](n)&&(t[n]=Rt(e[n]));return t}function Pt(e,t,n){function i(){var r=Array.prototype.slice.call(arguments,0),o=r.join("␀"),a=i.cache=i.cache||{},s=i.count=i.count||[];return a[Cf](o)?(function(e,t){for(var n=0,i=e.length;n=1e3&&delete a[s.shift()],s.push(o),a[o]=e.apply(t,r),n?n(a[o]):a[o])}return i}function Mt(e){if(!e)return null;var t=kt(e);if(t.arr)return Rt(t.arr);var n={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},i=[];return Ct(e,"array")&&Ct(e[0],"array")&&(i=Rt(e)),i.length||String(e).replace(jf,function(e,t,r){var o=[],a=t.toLowerCase();if(r.replace(Lf,function(e,t){t&&o.push(+t)}),"m"==a&&o.length>2&&(i.push([t].concat(o.splice(0,2))),a="l",t="m"==t?"l":"L"),"o"==a&&1==o.length&&i.push([t,o[0]]),"r"==a)i.push([t].concat(o));else for(;o.length>=n[a]&&(i.push([t].concat(o.splice(0,n[a]))),n[a]););}),i.toString=kt.toString,t.arr=Rt(i),i}function kt(e){var t=kt.ps=kt.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var n in t)t[Cf](n)&&n!=e&&(t[n].sleep--,!t[n].sleep&&delete t[n])}),t[e]}function Bt(e,t,n,i){return null==e&&(e=t=n=i=0),null==t&&(t=e.y,n=e.width,i=e.height,e=e.x),{x:e,y:t,width:n,w:n,height:i,h:i,x2:e+n,y2:t+i,cx:e+n/2,cy:t+i/2,r1:Mf.min(n,i)/2,r2:Mf.max(n,i)/2,r0:Mf.sqrt(n*n+i*i)/2,path:function(e,t,n,i,r){if(r)return[["M",+e+ +r,t],["l",n-2*r,0],["a",r,r,0,0,1,r,r],["l",0,i-2*r],["a",r,r,0,0,1,-r,r],["l",2*r-n,0],["a",r,r,0,0,1,-r,-r],["l",0,2*r-i],["a",r,r,0,0,1,r,-r],["z"]];var o=[["M",e,t],["l",n,0],["l",0,i],["l",-n,0],["z"]];return o.toString=Dt,o}(e,t,n,i),vb:[e,t,n,i].join(" ")}}function Dt(){return this.join(",").replace(Rf,"$1")}function Nt(e){var t=Rt(e);return t.toString=Dt,t}function Ot(e,t,n,i,r,o,a,s,c){return null==c?Wt(e,t,n,i,r,o,a,s):Lt(e,t,n,i,r,o,a,s,function(e,t,n,i,r,o,a,s,c){if(c<0||Wt(e,t,n,i,r,o,a,s).01;)l/=2,p=Wt(e,t,n,i,r,o,a,s,u+=(pr){if(t&&!h.start){if(l=Ot(a,s,c[1],c[2],c[3],c[4],c[5],c[6],r-d),u+=["C"+n(l.start.x),n(l.start.y),n(l.m.x),n(l.m.y),n(l.x),n(l.y)],o)return u;h.start=u,u=["M"+n(l.x),n(l.y)+"C"+n(l.n.x),n(l.n.y),n(l.end.x),n(l.end.y),n(c[5]),n(c[6])].join(),d+=p,a=+c[5],s=+c[6];continue}if(!e&&!t)return l=Ot(a,s,c[1],c[2],c[3],c[4],c[5],c[6],r-d)}d+=p,a=+c[5],s=+c[6]}u+=c.shift()+c}return h.end=u,l=e?d:t?h:Lt(a,s,c[0],c[1],c[2],c[3],c[4],c[5],1)},null,Rt)}function Lt(e,t,n,i,r,o,a,s,c){var p=1-c,l=Nf(p,3),u=Nf(p,2),h=c*c,d=h*c,f=e+2*c*(n-e)+h*(r-2*n+e),m=t+2*c*(i-t)+h*(o-2*i+t),y=n+2*c*(r-n)+h*(a-2*r+n),v=i+2*c*(o-i)+h*(s-2*o+i);return{x:l*e+3*u*c*n+3*p*c*c*r+d*a,y:l*t+3*u*c*i+3*p*c*c*o+d*s,m:{x:f,y:m},n:{x:y,y:v},start:{x:p*e+c*n,y:p*t+c*i},end:{x:p*r+c*a,y:p*o+c*s},alpha:90-180*Mf.atan2(f-y,m-v)/kf}}function It(e,t,n,i,r,o,a,s){Ct(e,"array")||(e=[e,t,n,i,r,o,a,s]);var c=Jt.apply(null,e);return Bt(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)}function Ft(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function zt(e,t){return e=Bt(e),t=Bt(t),Ft(t,e.x,e.y)||Ft(t,e.x2,e.y)||Ft(t,e.x,e.y2)||Ft(t,e.x2,e.y2)||Ft(e,t.x,t.y)||Ft(e,t.x2,t.y)||Ft(e,t.x,t.y2)||Ft(e,t.x2,t.y2)||(e.xt.x||t.xe.x)&&(e.yt.y||t.ye.y)}function $t(e,t,n,i,r){return e*(e*(-3*t+9*n-9*i+3*r)+6*t-12*n+6*i)-3*t+3*n}function Wt(e,t,n,i,r,o,a,s,c){null==c&&(c=1);for(var p=(c=c>1?1:c<0?0:c)/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],u=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,d=0;d<12;d++){var f=p*l[d]+p,m=$t(f,e,n,r,a),y=$t(f,t,i,o,s),v=m*m+y*y;h+=u[d]*Mf.sqrt(v)}return p*h}function Gt(e,t,n,i,r,o,a,s){if(!(Df(e,n)Df(r,a)||Df(t,i)Df(o,s))){var c=(e-n)*(o-s)-(t-i)*(r-a);if(c){var p=((e*i-t*n)*(r-a)-(e-n)*(r*s-o*a))/c,l=((e*i-t*n)*(o-s)-(t-i)*(r*s-o*a))/c,u=+p.toFixed(2),h=+l.toFixed(2);if(!(u<+Bf(e,n).toFixed(2)||u>+Df(e,n).toFixed(2)||u<+Bf(r,a).toFixed(2)||u>+Df(r,a).toFixed(2)||h<+Bf(t,i).toFixed(2)||h>+Df(t,i).toFixed(2)||h<+Bf(o,s).toFixed(2)||h>+Df(o,s).toFixed(2)))return{x:p,y:l}}}}function Ht(e,t,n){if(!zt(It(e),It(t)))return n?0:[];for(var i=~~(Wt.apply(0,e)/8),r=~~(Wt.apply(0,t)/8),o=[],a=[],s={},c=n?0:[],p=0;p=0&&b<=1&&x>=0&&x<=1&&(n?c++:c.push({x:g.x,y:g.y,t1:b,t2:x}))}}return c}function Vt(e,t){return Ut(e,t)}function Ut(e,t,n){e=en(e),t=en(t);for(var i,r,o,a,s,c,p,l,u,h,d=n?0:[],f=0,m=e.length;f180),0,s,t+n*Math.sin(-r*o)]];else c=[["M",e,t],["m",0,-i],["a",n,i,0,1,1,0,2*i],["a",n,i,0,1,1,0,-2*i],["z"]];return c.toString=Dt,c}function Kt(e){var t=kt(e);if(t.abs)return Nt(t.abs);if(Ct(e,"array")&&Ct(e&&e[0],"array")||(e=Mt(e)),!e||!e.length)return[["M",0,0]];var n,i=[],r=0,o=0,a=0,s=0,c=0;"M"==e[0][0]&&(a=r=+e[0][1],s=o=+e[0][2],c++,i[0]=["M",r,o]);for(var p,l,u=3==e.length&&"M"==e[0][0]&&"R"==e[1][0].toUpperCase()&&"Z"==e[2][0].toUpperCase(),h=c,d=e.length;h1&&(n*=v=Mf.sqrt(v),i*=v);var g=n*n,b=i*i,x=(o==a?-1:1)*Mf.sqrt(Of((g*b-g*y*y-b*m*m)/(g*y*y+b*m*m))),E=x*n*y/i+(e+s)/2,_=x*-i*m/n+(t+c)/2,w=Mf.asin(((t-_)/i).toFixed(9)),S=Mf.asin(((c-_)/i).toFixed(9));w=eS&&(w-=2*kf),!a&&S>w&&(S-=2*kf)}var A=S-w;if(Of(A)>u){var T=S,C=s,R=c;S=w+u*(a&&S>w?1:-1),d=Qt(s=E+n*Mf.cos(S),c=_+i*Mf.sin(S),n,i,r,0,a,C,R,[S,T,E,_])}A=S-w;var P=Mf.cos(w),M=Mf.sin(w),k=Mf.cos(S),B=Mf.sin(S),D=Mf.tan(A/4),N=4/3*n*D,O=4/3*i*D,j=[e,t],L=[e+N*M,t-O*P],I=[s+N*B,c-O*k],F=[s,c];if(L[0]=2*j[0]-L[0],L[1]=2*j[1]-L[1],p)return[L,I,F].concat(d);for(var z=[],$=0,W=(d=[L,I,F].concat(d).join().split(",")).length;$7){e[t].shift();for(var n=e[t];n.length;)l[t]="A",r&&(u[t]="A"),e.splice(t++,0,["C"].concat(n.splice(0,6)));e.splice(t,1),m=Df(i.length,r&&r.length||0)}},p=function(e,t,n,o,a){e&&t&&"M"==e[a][0]&&"M"!=t[a][0]&&(t.splice(a,0,["M",o.x,o.y]),n.bx=0,n.by=0,n.x=e[a][1],n.y=e[a][2],m=Df(i.length,r&&r.length||0))},l=[],u=[],h="",d="",f=0,m=Df(i.length,r&&r.length||0);fi;i+=2){var o=[{x:+e[i-2],y:+e[i-1]},{x:+e[i],y:+e[i+1]},{x:+e[i+2],y:+e[i+3]},{x:+e[i+4],y:+e[i+5]}];t?i?r-4==i?o[3]={x:+e[0],y:+e[1]}:r-2==i&&(o[2]={x:+e[0],y:+e[1]},o[3]={x:+e[2],y:+e[3]}):o[0]={x:+e[r-2],y:+e[r-1]}:r-4==i?o[3]=o[2]:i||(o[0]={x:+e[i],y:+e[i+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n}function nn(e){return{x:Math.round(e.x),y:Math.round(e.y)}}function rn(e){return{top:e.y,right:e.x+(e.width||0),bottom:e.y+(e.height||0),left:e.x}}function on(e,t){return Uf(e,t)}function an(e,t,n,i){wf.call(this,e),this._elementRegistry=t,this._modeling=n,this._rules=i;var r=this;this.postExecuted(["shape.create"],function(e){var t=e.context,n=t.hints,i=t.shape,o=t.parent||t.newParent;n&&!1===n.root||r._expand([i],o)}),this.postExecuted(["elements.move"],function(e){var t=e.context,n=qf(Kf(t.closure.topLevel)),i=t.hints;if(!i||!1!==i.autoResize){var o=Cu(n,function(e){return e.parent.id});ms(o,function(e,t){r._expand(e,t)})}})}function sn(e,t,n,i){Jf.call(this,e,t,n,i)}function cn(e){wf.call(this,e),this.init()}function pn(e){nm.call(this,e);var t=this;this.addRule("element.autoResize",function(e){return t.canResize(e.elements,e.target)})}function ln(e,t){im.call(this,e),this._modeling=t}function un(e,t){return sm(t,function(t){return pm(e,t)})}function hn(e){return"number"==typeof e}function dn(e,t,n){var i=t[e],r=n.min&&n.min[e],o=n.max&&n.max[e];return hn(r)&&(i=(/top|left/.test(e)?hm:um)(i,r)),hn(o)&&(i=(/top|left/.test(e)?um:hm)(i,o)),i}function fn(e,t){return void 0!==e?e:dm}function mn(e,t){var n,i,r,o;return"object"==typeof t?(n=fn(t.left),i=fn(t.right),r=fn(t.top),o=fn(t.bottom)):n=i=r=o=fn(t),{x:e.x-n,y:e.y-r,width:e.width+n+i,height:e.height+r+o}}function yn(e){return!e.waypoints&&"label"!==e.type}function vn(e,t){return t=t||[],e.children.filter(function(e){gm(e,"bpmn:Lane")&&(vn(e,t),t.push(e))}),t}function gn(e){return bm(e,Sm)||e}function bn(e,t){var n=gn(e),i=vn(n,gm(n,"bpmn:Process")?[]:[n]),r=xm(e),o=xm(t),a=function(e,t){return Em(xm(t),xm(e))}(e,t),s=[];return i.forEach(function(t){if(t!==e){var n=0,i=a.right,c=0,p=a.left,l=xm(t);a.top&&(wm(l.bottom-r.top)<10&&(c=o.top-l.bottom),wm(l.top-r.top)<5&&(n=o.top-l.top)),a.bottom&&(wm(l.top-r.bottom)<10&&(n=o.bottom-l.top),wm(l.bottom-r.bottom)<5&&(c=o.bottom-l.bottom)),(n||i||c||p)&&s.push({shape:t,newBounds:_m(t,{top:n,right:i,bottom:c,left:p})})}}),s}function xn(e,t,n,i,r,o,a,s,c,p){t.registerProvider(this),this._contextPad=t,this._modeling=n,this._elementFactory=i,this._connect=r,this._create=o,this._popupMenu=a,this._canvas=s,this._rules=c,this._translate=p,e.on("create.end",250,function(e){var n=e.context.shape;if(Mm(e)){var i=t.getEntries(n);i.replace&&i.replace.action.click(e,n)}})}function En(e,t,n){var i=e.$instanceOf(t),r=!1,o=e.eventDefinitions||[];return ms(o,function(e){e.$type===n&&(r=!0)}),i&&r}function _n(e,t,n,i,r,o){this._popupMenu=e,this._modeling=t,this._moddle=n,this._bpmnReplace=i,this._rules=r,this._translate=o,this.register()}function wn(e){this._eventBus=e}function Sn(e,t,n,i,r){function o(r,o,s){s=s||{};var c=o.type,p=r.businessObject;if(Km(p,"bpmn:SubProcess")&&"bpmn:SubProcess"===c&&function(e,t){var n,i=Ym(e,"collapsed")?e.collapsed:!Xm(e);return n=Ym(t,"collapsed")||Ym(t,"isExpanded")?Ym(t,"collapsed")?t.collapsed:!t.isExpanded:i,i!==n&&(e.collapsed=i,!0)}(r,o))return i.toggleCollapse(r),r;var l=e.create(c),u={type:c,businessObject:l},h=Qm(p.$descriptor),d=Qm(l.$descriptor,!0),f=Um(h,d);return Bc(l,qc(o,ey)),f=Xp(f,function(e){var t=e.replace(/bpmn:/,"");return void 0===l[e]&&("loopCharacteristics"===t?!Zm(l):("processRef"!==t||!1!==o.isExpanded)&&"triggeredByEvent"!==t&&"eventDefinitions"!==t&&-1===Jm.indexOf(t))}),l=a.clone(p,l,f),o.eventDefinitionType&&(u.eventDefinitionType=o.eventDefinitionType),Km(p,"bpmn:Activity")&&(Km(p,"bpmn:SubProcess")?u.isExpanded=Xm(p):Ym(o,"isExpanded")&&(u.isExpanded=o.isExpanded),Xm(p)&&!Km(p,"bpmn:Task")&&u.isExpanded&&(u.width=r.width,u.height=r.height)),Km(p,"bpmn:Participant")&&(!0===o.isExpanded?l.processRef=e.create("bpmn:Process"):s.moveChildren=!1,u.width=r.width,u.height=r.height),l.name=p.name,(Km(p,"bpmn:ExclusiveGateway")||Km(p,"bpmn:InclusiveGateway")||Km(p,"bpmn:Activity"))&&(Km(l,"bpmn:ExclusiveGateway")||Km(l,"bpmn:InclusiveGateway")||Km(l,"bpmn:Activity"))&&(l.default=p.default),("fill"in p.di||"stroke"in p.di)&&Bc(u,{colors:qc(p.di,["fill","stroke"])}),u=t.replaceElement(r,u,s),!1!==s.select&&n.select(u),u}var a=new Vm(r);this.replaceElement=o}function An(e){this._modeling=e}function Tn(e,t){this._eventBus=e,this._canvas=t,this._providers={}}function Cn(e){e.preventDefault()}function Rn(e){e.stopPropagation()}function Pn(e){this.container=e.container,this.parent=document.createElement("div"),this.content=document.createElement("div"),this.parent.appendChild(this.content),cd(this.content,"contentEditable","true"),this.keyHandler=e.keyHandler||function(){},this.resizeHandler=e.resizeHandler||function(){},this.autoResize=Ih(this.autoResize,this),this.handlePaste=Ih(this.handlePaste,this)}function Mn(e,t){this._eventBus=e,this._providers=[],this._textbox=new sy({container:t.getContainer(),keyHandler:Ih(this._handleKey,this),resizeHandler:Ih(this._handleResize,this)})}function kn(e,t,n,i,r,o){function a(e,t){return i.allowed("connection.create",{source:e,target:t})}e.on("connect.move",function(e){var t,n=e.context,i=n.source,r=n.target,a=n.visual;t=function(e,t,n,i){var r=o.getShapePath(n),a=i&&o.getShapePath(i),s=o.getConnectionPath({waypoints:[e,t]});return e=Hf.getElementLineIntersection(r,s,!0)||e,t=i&&Hf.getElementLineIntersection(a,s,!1)||t,[e,t]}(n.sourcePosition,{x:e.x,y:e.y},i,r),Es(a,{points:[t[0].x,t[0].y,t[1].x,t[1].y]})}),e.on("connect.hover",function(e){var t,n=e.context,i=n.source,o=e.hover;null!==(t=n.canExecute=a(i,o))&&(n.target=o,r.addMarker(o,t?py:ly))}),e.on(["connect.out","connect.cleanup"],function(e){var t=e.context;t.target&&r.removeMarker(t.target,t.canExecute?py:ly),t.target=null}),e.on("connect.cleanup",function(e){var t=e.context;t.visual&&Zc(t.visual)}),e.on("connect.start",function(e){var t,n=e.context;t=Cs("polyline"),Es(t,{stroke:"#333",strokeDasharray:[1],strokeWidth:2,"pointer-events":"none"}),Xc(r.getDefaultLayer(),t),n.visual=t}),e.on("connect.end",function(e){var t=e.context,i=t.source,r=t.sourcePosition,o=t.target,s={x:e.x,y:e.y},c=t.canExecute||a(i,o);if(!c)return!1;var p=null,l={connectionStart:r,connectionEnd:s};"object"==typeof c&&(p=c),n.connect(i,o,p,l)}),this.start=function(e,n,i,r){"object"!=typeof i&&(r=i,i=Hf.getMid(n)),t.init(e,"connect",{autoActivate:r,data:{shape:n,context:{source:n,sourcePosition:i}}})}}function Bn(e){e instanceof MouseEvent?gd.stopEvent(e,!0):gd.preventDefault(e)}function Dn(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Nn(e,t,n){function i(e){var n=t.viewbox(),i=t._container.getBoundingClientRect();return{x:n.x+hy((e.x-i.left)/n.scale),y:n.y+hy((e.y-i.top)/n.scale)}}function r(t,n){n=n||f;var i=Bc(new dy,n.payload,n.data);return!1!==e.fire("drag."+t,i)&&e.fire(n.prefix+"."+t,i)}function o(e,o){var a=f.payload,s=f.displacement,c=f.globalStart,p=gd.toPoint(e),l=Dn(p,c),u=f.localStart,d=i(p),m=Dn(d,u);if(!f.active&&(o||function(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}(l)>f.threshold)){if(Bc(a,{x:u.x+s.x,y:u.y+s.y,dx:0,dy:0},{originalEvent:e}),!1===r("start"))return h();f.active=!0,f.keepSelection||(a.previousSelection=n.get(),n.select(null)),f.cursor&&rf.set(f.cursor),t.addMarker(t.getRootElement(),fy)}Bn(e),f.active&&(Bc(a,{x:d.x+s.x,y:d.y+s.y,dx:m.x,dy:m.y},{originalEvent:e}),r("move"))}function a(e){var t=!0;f.active&&(e&&(f.payload.originalEvent=e,Bn(e)),t=r("end")),!1===t&&r("rejected"),r("ended",d(!0!==t))}function s(e){27===e.which&&(e.preventDefault(),h())}function c(e){var t;f.active&&(t=tf.install(),setTimeout(t,400)),a(e)}function p(e){o(e)}function l(e){var t=f.payload;t.hoverGfx=e.gfx,t.hover=e.element,r("hover")}function u(e){r("out");var t=f.payload;t.hoverGfx=null,t.hover=null}function h(e){var t;if(f){var n=f.active;n&&r("cancel"),t=d(e),n&&r("canceled",t)}}function d(i){var d,m;r("cleanup"),rf.unset(),m=f.trapClick?c:a,Ud.unbind(document,"mousemove",o),Ud.unbind(document,"mousedown",m,!0),Ud.unbind(document,"mouseup",m,!0),Ud.unbind(document,"keyup",s),Ud.unbind(document,"touchstart",p,!0),Ud.unbind(document,"touchcancel",h,!0),Ud.unbind(document,"touchmove",o,!0),Ud.unbind(document,"touchend",a,!0),e.off("element.hover",l),e.off("element.out",u),t.removeMarker(t.getRootElement(),fy);var y=f.payload.previousSelection;return!1!==i&&y&&!n.get().length&&n.select(y),d=f,f=null,d}var f,m={threshold:5,trapClick:!0};e.on("diagram.destroy",h),this.init=function(t,n,d,y){f&&h(!1),"string"==typeof n&&(y=d,d=n,n=null);var v,g,b,x=(y=Bc({},m,y||{})).data||{};b=y.trapClick?c:a,t?(v=gd.getOriginal(t)||t,g=gd.toPoint(t),Bn(t)):(v=null,g={x:0,y:0});var E=i(g);n||(n=E),f=Bc({prefix:d,data:x,payload:{},globalStart:g,displacement:Dn(n,E),localStart:E},y),y.manual||("undefined"!=typeof TouchEvent&&v instanceof TouchEvent?(Ud.bind(document,"touchstart",p,!0),Ud.bind(document,"touchcancel",h,!0),Ud.bind(document,"touchmove",o,!0),Ud.bind(document,"touchend",a,!0)):(Ud.bind(document,"mousemove",o),Ud.bind(document,"mousedown",b,!0),Ud.bind(document,"mouseup",b,!0)),Ud.bind(document,"keyup",s),e.on("element.hover",l),e.on("element.out",u)),r("init"),y.autoActivate&&o(t,!0)},this.move=o,this.hover=l,this.out=u,this.end=a,this.cancel=h,this.context=function(){return f},this.setOptions=function(e){Bc(m,e)}}function On(e,t,n){var i=this;e.on("drag.start",function(t){e.once("drag.move",function(){e.once("drag.move",function(e){i.ensureHover(e)})})}),this.ensureHover=function(e){if(!e.hover){var i,r,o,a=e.originalEvent;a instanceof MouseEvent&&(i=gd.toPoint(a),(o=function(e){return sf(e,"svg, .djs-element",!0)}(document.elementFromPoint(i.x,i.y)))&&(r=n.get(o),t.hover({element:r,gfx:o})))}}}function jn(e){this._commandStack=e.get("commandStack",!1)}function Ln(e,t){this._providers=[],this._eventBus=e,this._overlays=t,this._current=null,this._init()}function In(e,t,n,i,r,o,a){function s(e,t){[Ay,wy,Sy,Ty].forEach(function(n){n===t?r.addMarker(e,n):r.removeMarker(e,n)})}e.on("create.move",function(e){var t,i=e.context,r=e.hover,o={x:e.x,y:e.y};t=i.canExecute=r&&function(e,t,i,r){return i?n.allowed("shape.append",{source:i,shape:e,target:t,position:r}):n.allowed("shape.create",{shape:e,target:t,position:r})}(i.shape,r,i.source,o),r&&null!==t&&(i.target=r,"attach"===t?s(r,Ay):s(r,i.canExecute?Ty:Sy))}),e.on("create.move",_y,function(e){var t=e.context,n=t.shape,i=t.visual;i||(i=t.visual=function(e){var t,n,i;t=Cs("g"),Es(t,o.cls("djs-drag-group",["no-events"])),Xc(r.getDefaultLayer(),t),n=Cs("g"),hp(n).add("djs-dragger"),Xc(t,n),Cy(n,e.width/-2,e.height/-2);var s=Cs("g");return hp(s).add("djs-visual"),Xc(n,s),i=s,a.drawShape(i,e),t}(n)),Cy(i,e.x,e.y)}),e.on(["create.end","create.out","create.cleanup"],function(e){var t=e.context.target;t&&s(t,null)}),e.on("create.end",function(e){var t,n=e.context,r=n.source,o=n.shape,a=n.target,s=n.canExecute,c={x:e.x,y:e.y};if(!s)return!1;r?o=i.appendShape(r,o,c,a):(t="attach"===s,o=i.createShape(o,c,a,t)),n.shape=o}),e.on("create.cleanup",function(e){var t=e.context;t.visual&&Zc(t.visual)}),this.start=function(e,n,i){t.init(e,"create",{cursor:"grabbing",autoActivate:!0,data:{shape:n,context:{shape:n,source:i}}})}}function Fn(e,t,n){ms(n,function(n){void 0!==t[n]&&(e[n]=t[n])})}function zn(e,t,n,i,r,o){var a=new Vm(t);n.registerDescriptor(function(e,t){var n=t.oldBusinessObject=My(e),i={};return t.type=e.type,Fn(t,n.di,["isExpanded"]),Fn(i,n.di,["fill","stroke"]),t.colors=i,"label"===e.type?t:(Fn(t,n,["type","processRef","triggeredByEvent"]),n.default&&(t.default=n.default.id),t)}),t.on("element.paste",function(t){var n,i,s,c,p=t.descriptor,l=t.createdElements,u=p.parent,h=r.getRootElement(),d=p.oldBusinessObject;n=e.create(d.$type);var f=By(d.$descriptor);f=Xp(f,function(e){return-1===Dy.indexOf(e.replace(/bpmn:/,""))}),p.businessObject=a.clone(d,n,f),"label"!==p.type&&(ky(u,"bpmn:Process")&&(p.parent=ky(h,"bpmn:Collaboration")?h:u),"bpmn:DataOutputAssociation"!==p.type&&"bpmn:DataInputAssociation"!==p.type&&"bpmn:MessageFlow"!==p.type||(p.parent=h),ky(u,"bpmn:Lane")&&(p.parent=u.parent),p.waypoints&&(i=l[p.source],s=l[p.target],i&&s&&(i=i.element,s=s.element),(c=o.canConnect(i,s))&&(p.type=c.type)),delete n.id,e._ensureId(n),"bpmn:Participant"===p.type&&p.processRef&&(p.processRef=n.processRef=e.create("bpmn:Process")),Fn(n,p,["isExpanded","triggeredByEvent"]),function(e,t){ms(t,function(t){e[t]&&delete e[t]})}(p,["triggeredByEvent"]))})}function $n(){}function Wn(e,t,n,i,r,o){this._eventBus=e,this._modeling=t,this._elementFactory=n,this._rules=i,this._canvas=o,this._clipboard=r,this._descriptors=[],this.registerDescriptor(function(e,t){return t.priority=1,t.id=e.id,e.parent&&(t.parent=e.parent.id),e.labelTarget&&(t.priority=4,t.labelTarget=e.labelTarget.id),e.host&&(t.priority=2,t.host=e.host.id),"number"==typeof e.x&&(t.x=e.x,t.y=e.y),e.width&&(t.width=e.width,t.height=e.height),e.waypoints&&(t.priority=3,t.waypoints=[],ms(e.waypoints,function(e){var n={x:e.x,y:e.y};e.original&&(n.original={x:e.original.x,y:e.original.y}),t.waypoints.push(n)})),e.source&&e.target&&(t.source=e.source.id,t.target=e.target.id),t})}function Gn(e,t){this._eventBus=e,this._canvas=t,this._init()}function Hn(e){e.registerFilter(function(e){return Xp(e,function(e){var t=Uy(e,["bpmn:Association","bpmn:BoundaryEvent","bpmn:DataInputAssociation","bpmn:DataOutputAssociation","bpmn:Lane","bpmn:MessageFlow","bpmn:Participant","bpmn:SequenceFlow","bpmn:TextAnnotation"]);return!(e.labelTarget||t)})})}function Vn(e){this._modeling=e,this._filters=[],this.registerFilter(function(e,t,n){var i,r=0,o=0;return ms(e,function(e){e.waypoints||e.labelTarget||(r+=e[n],o+=1)}),i=Math.round(r/o),Xp(e,function(e){return e[n]5&&Es(a,{x:o.x,width:o.width}),o.height>5&&Es(a,{y:o.y,height:o.height}),t.canExecute?hp(a).remove(Uv):hp(a).add(Uv)}),e.on("resize.cleanup",function(e){var t=e.context,i=t.shape;t.frame&&Zc(t.frame),n.removeMarker(i,Vv)})}function pi(e){this._model=e}function li(){}function ui(e,t,n){var i,r;if("h:v"===(n=n||"h:h"))return[{x:t.x,y:e.y}];if("v:h"===n)return[{x:e.x,y:t.y}];if("h:h"===n)return i=Math.round((t.x-e.x)/2+e.x),[{x:i,y:e.y},{x:i,y:t.y}];if("v:v"===n)return r=Math.round((t.y-e.y)/2+e.y),[{x:e.x,y:r},{x:t.x,y:r}];throw new Error("unknown directions: <"+n+">: directions must be specified as {a direction}:{b direction} (direction in h|v)")}function hi(e,t,n){var i=[];return ig(e,t)||(i=ui(e,t,n)),i.unshift(e),i.push(t),i}function di(e,t,n,i,r){var o=r&&r.preferredLayouts||[],a=Jv(o,"straight")[0]||"h:h",s=sg[a]||0,c=tg(e,t,s),p=function(e,t){switch(e){case"intersect":return null;case"top":case"bottom":return"v:v";case"left":case"right":return"h:h";default:return t}}(c,a);if(n=n||ng(e),i=i||ng(t),p){if("h:h"===p)switch(c){case"top-right":case"right":case"bottom-right":n={original:n,x:e.x,y:n.y},i={original:i,x:t.x+t.width,y:i.y};break;case"top-left":case"left":case"bottom-left":n={original:n,x:e.x+e.width,y:n.y},i={original:i,x:t.x,y:i.y}}if("v:v"===p)switch(c){case"top-left":case"top":case"top-right":n={original:n,x:n.x,y:e.y+e.height},i={original:i,x:i.x,y:t.y};break;case"bottom-left":case"bottom":case"bottom-right":n={original:n,x:n.x,y:e.y},i={original:i,x:i.x,y:t.y+t.height}}return hi(n,i,p)}}function fi(e,t,n){return function(e,t,n){return e>=t&&e<=n}(t[e],n[e],n[e]+n[{x:"width",y:"height"}[e]])}function mi(e,t,n,i,r){var o,a,s={};return a=tg(e,t),/^(top|bottom|left|right)$/.test(a)?(/top|bottom/.test(a)&&(o="x"),/left|right/.test(a)&&(o="y"),"target"===r.preserveDocking?fi(o,i,e)?(s[o]=i[o],[{x:void 0!==s.x?s.x:n.x,y:void 0!==s.y?s.y:n.y,original:{x:void 0!==s.x?s.x:n.x,y:void 0!==s.y?s.y:n.y}},{x:i.x,y:i.y}]):null:fi(o,n,t)?(s[o]=n[o],[{x:n.x,y:n.y},{x:void 0!==s.x?s.x:i.x,y:void 0!==s.y?s.y:i.y,original:{x:void 0!==s.x?s.x:i.x,y:void 0!==s.y?s.y:i.y}}]):null):null}function yi(e,t,n,i){if(function(e,t,n){return n.length<3||!(n.length>4)&&!!Jp(n,function(e,t){var i=n[t-1];return i&&og(e,i)<3})}(0,0,i))return null;var r,o=i[0],a=i.slice();return a[0]=n,a[1]=function(e,t,n){switch(ig(t,e)){case"v":return{x:e.x,y:n.y};case"h":return{x:n.x,y:e.y}}return{x:e.x,y:e.y}}(a[1],o,n),(r=function(e,t,n){var i;for(i=e.length-2;0!==i;i--)if(rg(e[i],t,ag)||rg(e[i],n,ag))return e.slice(i);return e}(a,e,t))!==a?yi(e,t,n,r):a}function vi(){}function gi(e,t){return e?e.original||e:pg(t)}function bi(e){var t=e.source,n=e.target;return ug(n,"bpmn:Activity")&&ug(t,"bpmn:BoundaryEvent")&&n.businessObject.isForCompensation}function xi(e){return ug(e,"bpmn:SubProcess")&&cg(e)}function Ei(e,t,n,i){function r(e){var t=e.context.oldRoot.children;ms(t,function(e){fg(e,"bpmn:BaseElement")&&p.updateParent(e)})}function o(e){var t=e.context.shape;fg(t,"bpmn:BaseElement")&&p.updateBounds(t)}function a(e){p.updateConnection(e.context)}function s(e){p.updateConnectionWaypoints(e.context.connection)}function c(e){p.updateAttachment(e.context)}wf.call(this,e),this._bpmnFactory=t,this._translate=i;var p=this;this.executed(["connection.layout","connection.create","connection.reconnectEnd","connection.reconnectStart"],function(e){var t,i=e.context;i.cropped||((t=i.connection).waypoints=n.getCroppedWaypoints(t),i.cropped=!0)}),this.reverted(["connection.layout"],function(e){delete e.context.cropped}),this.executed(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],_i(function(e){var t=e.context;p.updateParent(t.shape||t.connection,t.oldParent)})),this.reverted(["shape.move","shape.create","shape.delete","connection.create","connection.move","connection.delete"],_i(function(e){var t=e.context,n=t.shape||t.connection,i=t.parent||t.newParent;p.updateParent(n,i)})),this.executed(["canvas.updateRoot"],r),this.reverted(["canvas.updateRoot"],r),this.executed(["shape.move","shape.create","shape.resize"],_i(function(e){"label"!==e.context.shape.type&&o(e)})),this.reverted(["shape.move","shape.create","shape.resize"],_i(function(e){"label"!==e.context.shape.type&&o(e)})),e.on("shape.changed",function(e){"label"===e.element.type&&o({context:{shape:e.element}})}),this.executed(["connection.create","connection.move","connection.delete","connection.reconnectEnd","connection.reconnectStart"],_i(a)),this.reverted(["connection.create","connection.move","connection.delete","connection.reconnectEnd","connection.reconnectStart"],_i(a)),this.executed(["connection.layout","connection.move","connection.updateWaypoints","connection.reconnectEnd","connection.reconnectStart"],_i(s)),this.reverted(["connection.layout","connection.move","connection.updateWaypoints","connection.reconnectEnd","connection.reconnectStart"],_i(s)),this.executed(["connection.reconnectEnd","connection.reconnectStart"],_i(function(e){var t=e.context,n=t.connection,i=dg(n),r=dg(t.oldSource),o=dg(t.oldTarget),a=dg(n.source),s=dg(n.target);r!==a&&o!==s&&(r&&r.default===i&&(t.default=r.default,r.default=void 0),i.sourceRef&&i.sourceRef.default&&!(fg(s,"bpmn:Activity")||fg(s,"bpmn:EndEvent")||fg(s,"bpmn:Gateway")||fg(s,"bpmn:IntermediateThrowEvent"))&&(t.default=i.sourceRef.default,i.sourceRef.default=void 0),r&&i.conditionExpression&&!fg(a,"bpmn:Activity")&&!fg(a,"bpmn:Gateway")&&(t.conditionExpression=i.conditionExpression,i.conditionExpression=void 0),o&&i.conditionExpression&&!(fg(s,"bpmn:Activity")||fg(s,"bpmn:EndEvent")||fg(s,"bpmn:Gateway")||fg(s,"bpmn:IntermediateThrowEvent"))&&(t.conditionExpression=i.conditionExpression,i.conditionExpression=void 0))})),this.reverted(["connection.reconnectEnd","connection.reconnectStart"],_i(function(e){var t=e.context,n=t.connection,i=dg(n),r=dg(n.source);t.default&&(fg(r,"bpmn:ExclusiveGateway")||fg(r,"bpmn:InclusiveGateway")||fg(r,"bpmn:Activity"))&&(r.default=t.default),t.conditionExpression&&fg(r,"bpmn:Activity")&&(i.conditionExpression=t.conditionExpression)})),this.executed(["element.updateAttachment"],_i(c)),this.reverted(["element.updateAttachment"],_i(c))}function _i(e){return function(t){var n=t.context,i=n.shape||n.connection;fg(i,"bpmn:BaseElement")&&e(t)}}function wi(e,t,n){Uu.call(this),this._bpmnFactory=e,this._moddle=t,this._translate=n}function Si(e,t,n){e[n]=t[n],delete t[n]}function Ai(e,t){this._modeling=e,this._spaceTool=t}function Ti(e){this._moddle=e}function Ci(e,t){this._modeling=e,this._spaceTool=t}function Ri(e){this._commandStack=e}function Pi(e,t){this._modeling=e,this._translate=t}function Mi(e,t){this._canvas=e,this._modeling=t}function ki(e){this._elementRegistry=e}function Bi(e,t,n,i){this._elementRegistry=e,this._moddle=t,this._translate=n,this._modeling=i,this._textUtil=new ep}function Di(e,t){return Gg in e&&e[Gg]!==t[Gg]}function Ni(e,t){var n=ls(t);return $g(n,function(n,i){return n[i]=i!==Hg?e.get(i):function(e,t){return $g(t,function(t,n){return t[n]=e.get(n),t},{})}(e.di,ls(t.di)),n},{})}function Oi(e,t){ms(t,function(t,n){e.set(n,t)})}function ji(e,t){ms(t,function(t,n){e.set(n,t)})}function Li(e,t){this._modeling=e,this._canvas=t}function Ii(){}function Fi(e){this._modeling=e}function zi(e,t){this._canvas=e,this._layouter=t}function $i(e){this._canvas=e}function Wi(e){eb.call(this,e)}function Gi(e,t){this._canvas=e,this._modeling=t}function Hi(e,t){this._modeling=e,this._elementRegistry=t}function Vi(e,t){this._canvas=e,this._modeling=t}function Ui(e){this._modeling=e}function qi(e,t){this._layouter=e,this._canvas=t}function Yi(){}function Ki(e,t,n){var i=Qi(e)[0];return gb(i.original||i,n,t)}function Xi(e,t,n){var i=Qi(e),r=i[i.length-1];return gb(r.original||r,n,t)}function Zi(e,t){return{x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height}}function Qi(e){var t=e.waypoints;if(!t.length)throw new Error("connection#"+e.id+": no waypoints");return t}function Ji(e){this._modeling=e}function er(e){this._helper=new Eb(e)}function tr(e){this._modeling=e,this._helper=new Eb(e)}function nr(e,t,n,i,r,o,a){var s;if(n&&(s=r?n(e,i,r):n(e)),void 0!==s)return s;if(!ka(e))return e;var c=rs(e);if(c){if(s=Cb(e),!t)return Dc(e,s)}else{var p=Zb.call(e),l=p==Yb;if(p!=Kb&&p!=qb&&(!l||r))return Xb[p]?Vb(e,p,t):r?e:{};if(s=Ub(l?{}:e),!t)return Tc(s,e)}o||(o=[]),a||(a=[]);for(var u=o.length;u--;)if(o[u]==e)return a[u];return o.push(e),a.push(s),(c?Ma:us)(e,function(i,r){s[r]=nr(i,t,n,r,e,o,a)}),s}function ir(e,t){ms(t,function(t){e[t]&&delete e[t]})}function rr(e,t,n,i,r,o){this._eventBus=e,this._canvas=t,this._selection=n,this._elementFactory=i,this._modeling=r,this._rules=o}function or(){}function ar(e,t){this._modeling=e,this._rules=t}function sr(e){this._modeling=e}function cr(e){this._modeling=e}function pr(e){this._modeling=e}function lr(e){this._modeling=e}function ur(e,t){return Su.remove(e&&e.attachers,t)}function hr(e,t,n){if(e){var i=e.attachers;i||(e.attachers=i=[]),Su.add(i,t,n)}}function dr(){}function fr(e,t,n){this._eventBus=e,this._elementFactory=t,this._commandStack=n;var i=this;e.on("diagram.init",function(){i.registerHandlers(n)})}function mr(e,t,n,i){ux.call(this,e,t,n),this._bpmnRules=i}function yr(e,t,n){wf.call(this,e),this.preExecute("shape.append",function(e){var t=e.source,n=e.shape;e.position||(dx(n,"bpmn:TextAnnotation")?e.position={x:t.x+t.width/2+75,y:t.y-50-n.height/2}:e.position={x:t.x+t.width+80+n.width/2,y:t.y+t.height/2})},!0)}function vr(e,t,n){wf.call(this,e),this.preExecute("elements.paste",1500,function(e){var t=e.topParent;if(t.parent||(e.topParent=n.getRootElement()),mx(t,"bpmn:Lane"))do{t=e.topParent=t.parent}while(mx(t,"bpmn:Lane")||!mx(t,"bpmn:Participant"))},!0),this.postExecute("elements.paste",function(e){var n=e.tree.createdElements;ms(n,function(e){var i,r=e.element,o=r.businessObject,a=e.descriptor;(mx(o,"bpmn:ExclusiveGateway")||mx(o,"bpmn:InclusiveGateway")||mx(o,"bpmn:Activity"))&&a.default&&(i=(i=n[a.default])?i.element:void 0,delete r.default,t.updateProperties(r,{default:i}))})},!0)}function gr(e,t,n,i){wf.call(this,e),this.preExecute("shape.create",function(e){var t,r=e.shape,o=e.host,a={cancelActivity:!0};o&&vx(r,"bpmn:IntermediateThrowEvent")&&(a.attachedToRef=o.businessObject,t={type:"bpmn:BoundaryEvent",businessObject:i.create("bpmn:BoundaryEvent",a)},e.shape=n.createShape(t))},!0)}function br(e,t,n){wf.call(this,e),this.preExecute("shape.create",function(e){var n=e.context.shape;if(bx(n,"bpmn:DataObjectReference")&&"label"!==n.type){var i=t.create("bpmn:DataObject");n.businessObject.dataObjectRef=i}})}function xr(e,t,n,i,r){wf.call(this,e),this.preExecute("shape.create",function(e){var n=e.parent,i=e.shape,o=e.position,a=r.getRootElement();if(Ex(n,"bpmn:Process")&&Ex(i,"bpmn:Participant")&&!Ex(a,"bpmn:Collaboration")){var s=t.makeCollaboration();e.position=o,e.parent=s,e.processRoot=n}},!0),this.execute("shape.create",function(e){var t=e.processRoot,n=e.shape;t&&(e.oldProcessRef=n.businessObject.processRef,n.businessObject.processRef=t.businessObject)},!0),this.revert("shape.create",function(e){var t=e.processRoot,n=e.shape;t&&(n.businessObject.processRef=e.oldProcessRef)},!0),this.postExecute("shape.create",function(e){var n=e.processRoot,i=e.shape;if(n){var r=n.children.slice();t.moveElements(r,{x:0,y:0},i)}},!0)}function Er(e,t){function n(e,n){var i=e.get("properties"),r=Jp(i,function(e){return e.name===Sx});return!r&&n&&(r=t.create("bpmn:Property",{name:Sx}),Su.add(i,r)),r}function i(e,t){var i=n(e);i&&(function(e,t,n){var i=e.get("dataInputAssociations");return Jp(i,function(e){return e!==n&&e.targetRef===t})}(e,i,t)||Su.remove(e.get("properties"),i))}function r(e){var t,r=e.context,o=r.connection,a=o.businessObject,s=o.target,c=s&&s.businessObject,p=r.newTarget,l=p&&p.businessObject,u=r.oldTarget||r.target,h=u&&u.businessObject,d=o.businessObject;h&&h!==c&&i(h,a),l&&l!==c&&i(l,a),c?(t=n(c,!0),d.targetRef=t):d.targetRef=null}wf.call(this,e),this.executed(["connection.create","connection.delete","connection.move","connection.reconnectEnd"],_r(r)),this.reverted(["connection.create","connection.delete","connection.move","connection.reconnectEnd"],_r(r))}function _r(e){return function(t){var n=t.context.connection;if(wx(n,"bpmn:DataInputAssociation"))return e(t)}}function wr(e,t,n){wf.call(this,e),this.postExecuted("shape.delete",Px,function(e){var t=e.context,i=t.hints,r=t.shape,o=t.oldParent;Tx(r,"bpmn:Lane")&&(i&&i.nested||function(e,t){var i=Cx(t),r=[],o=[];if(Rx(i,function(t){return t.y>e.y?o.push(t):r.push(t),t.children}),i.length){var a;a=o.length&&r.length?e.height/2:e.height;var s,c;r.length&&(s=n.calculateAdjustments(r,"y",a,e.y-10),n.makeSpace(s.movingShapes,s.resizingShapes,{x:0,y:a},"s")),o.length&&(c=n.calculateAdjustments(o,"y",-a,e.y+e.height+10),n.makeSpace(c.movingShapes,c.resizingShapes,{x:0,y:-a},"n"))}}(r,o))})}function Sr(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}function Ar(e){return Bc({},e)}function Tr(e,t,n){function i(e,i,r){var o,a,s,c,p,l,u=i.waypoints,h=Lx(u,r);h&&(o=u.slice(0,h.index),a=u.slice(h.index+(h.bendpoint?1:0)),s=h.bendpoint?u[h.index]:r,Sr(e,o[o.length-1])||o.push(Ar(s)),Sr(e,a[0])||a.unshift(Ar(s))),c=i.source,p=i.target,t.canConnect(c,e,i)&&(n.reconnectEnd(i,e,o||r),l=!0),t.canConnect(e,p,i)&&(l?n.connect(e,p,{type:i.type,waypoints:a}):n.reconnectStart(i,e,a||r))}wf.call(this,e),this.preExecute("elements.move",function(e){var n=e.newParent,i=e.shapes,r=e.delta,o=i[0];if(o&&n){n&&n.waypoints&&(e.newParent=n=n.parent);var a=function(e){return{x:Math.round(e.x+e.width/2),y:Math.round(e.y+e.height/2)}}(o),s={x:a.x+r.x,y:a.y+r.y},c=Jp(n.children,function(e){return t.canInsert(i,e)&&Lx(e.waypoints,s)});c&&(e.targetFlow=c,e.position=s)}},!0),this.postExecuted("elements.move",function(e){var t=e.shapes,n=e.targetFlow,r=e.position;n&&i(t[0],n,r)},!0),this.preExecute("shape.create",function(e){var n=e.parent,i=e.shape;t.canInsert(i,n)&&(e.targetFlow=n,e.parent=n.parent)},!0),this.postExecute("shape.create",function(e){var t=e.shape,n=e.targetFlow,r=e.position;n&&i(t,n,r)},!0)}function Cr(e){function t(e,t,n){var i,r={x:n.x,y:n.y-50},o={x:n.x-50,y:n.y},a=Fx(e,t,n,r),s=Fx(e,t,n,o);i=a&&s?Rr(a,n)>Rr(s,n)?s:a:a||s,e.original=i}e.on("bpmnElement.added",function(e){var n=e.element;n.waypoints&&function(e){var n=e.waypoints;t(n[0],n[1],zx(e.source)),t(n[n.length-1],n[n.length-2],zx(e.target))}(n)})}function Rr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Pr(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function Mr(e){return Math.pow(e,2)}function kr(e,t){return Hx(Mr(e.x-t.x)+Mr(e.y-t.y))}function Br(e,t){var n,i,r,o,a,s,c,p,l,u,h=0;for(h=0;h-1e-6&&(l=0);if(l<0)return[];var u=Hx(l),h=-p+u,d=-p-u,f={x:e.x-r*h,y:e.y-o*h};if(0===l)return[f];var m={x:e.x-r*d,y:e.y-o*d};return[f,m].filter(function(n){return function(e,t,n){return Dr(e.x,t.x,n.x)&&Dr(e.y,t.y,n.y)}(n,e,t)})}(n,i,e,Vx(r,o))),s.length<1)throw new Error("expected between [1, 2] circle -> line intersections");1===s.length&&(c={type:"bendpoint",position:s[0],segmentIndex:h,bendpointIndex:Nr(n,s[0])?h:h+1}),2===s.length&&(c={type:"segment",position:a=function(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}(s[0],s[1]),segmentIndex:h,relativeLocation:kr(n,a)/kr(n,i)}),p=kr(c.position,e),(!u||l>p)&&(u=c,l=p)}return u}function Dr(e,t,n){return e>=Vx(t,n)-Yx&&e<=Ux(t,n)+Yx}function Nr(e,t){return qx(e.x-t.x)<=Yx&&qx(e.y-t.y)<=Yx}function Or(e,t,n,i){var r=n.segmentIndex,o=t.length-e.length;if(i.segmentMove){var a=i.segmentMove.segmentStartIndex,s=i.segmentMove.newSegmentStartIndex;return r===a?s:r>=s?r+o=l&&(c=p?r+1:r-1),rt.length-2)return{x:r,y:o};var l=Ir(n,c),u=Ir(t,p),h=s.position,d=function(e,t){var n=Xx(e[0],e[1]),i=Xx(e[0],t);return 0===n?0:i/n}(l,h),f=function(e,t){var n=Wx.getAngle(e);return Wx.getAngle(t)-n}(l,u);if("bendpoint"===s.type){var m=t.length-n.length,y=s.bendpointIndex,v=n[y];if(-1!==t.indexOf(v))return{x:r,y:o};if(0===m){var g=t[y];return{x:g.x-s.position.x,y:g.y-s.position.y}}m<0&&0!==y&&y"+n+"
"})}e.on(["shape.move.rejected","create.rejected"],function(e){var t=e.context,r=t.shape,o=t.target;aE(o,"bpmn:Collaboration")&&aE(r,"bpmn:FlowNode")&&i(e,n(sE))}),e.on(["elements.paste.rejected"],function(e){var t=e.context,r=t.position,o=t.target;aE(o,"bpmn:Collaboration")&&i(r,n(sE)),aE(o,"bpmn:Process")&&i(r,n(cE),3e3)})}function $r(e,t,n){wf.call(this,e),this.preExecute("shape.delete",function(e){var i=e.context.shape;if(1==i.incoming.length&&1==i.outgoing.length){var r=i.incoming[0],o=i.outgoing[0];if(t.canConnect(r.source,o.target,r)){var a=function(e,t){var n=Fx(Wr(e[e.length-2]),Wr(e[e.length-1]),Wr(t[1]),Wr(t[0]));return n?[].concat(e.slice(0,e.length-1),[n],t.slice(1)):[Wr(e[0]),Wr(t[t.length-1])]}(r.waypoints,o.waypoints);n.reconnectEnd(r,o.target,a)}}})}function Wr(e){return e.original||e}function Gr(e,t){wf.call(this,e),this.preExecute("shape.delete",function(e){var t=e.shape,n=t.parent;uE(t,"bpmn:Participant")&&(e.collaborationRoot=n)},!0),this.postExecute("shape.delete",function(e){var n=e.collaborationRoot;n&&!n.businessObject.participants.length&&t.makeProcess()},!0)}function Hr(e,t,n){function i(e){var i=e.source,r=e.target;if(e.parent){var o,a;dE(e,"bpmn:SequenceFlow")&&(n.canConnectSequenceFlow(i,r)||(a=!0),n.canConnectMessageFlow(i,r)&&(o="bpmn:MessageFlow")),dE(e,"bpmn:MessageFlow")&&(n.canConnectMessageFlow(i,r)||(a=!0),n.canConnectSequenceFlow(i,r)&&(o="bpmn:SequenceFlow")),dE(e,"bpmn:Association")&&!n.canConnectAssociation(i,r)&&(a=!0),a&&t.removeConnection(e),o&&t.connect(i,r,{type:o,waypoints:e.waypoints.slice()})}}wf.call(this,e),this.postExecuted("elements.move",function(e){var t=e.closure.allConnections;ms(t,i)},!0),this.postExecuted(["connection.reconnectStart","connection.reconnectEnd"],function(e){i(e.context.connection)}),this.postExecuted("element.updateProperties",function(e){var n,i=e.context,r=i.properties,o=i.element,a=o.businessObject;r.default&&(n=Jp(o.outgoing,{id:o.businessObject.default.id}))&&t.updateProperties(n,{conditionExpression:void 0}),r.conditionExpression&&a.sourceRef.default===a&&t.updateProperties(o.source,{default:void 0})})}function Vr(e,t,n,i,r,o){wf.call(this,e),this._bpmnReplace=t,this._elementRegistry=i,this._selection=r,this._modeling=o,this.postExecuted(["elements.move"],500,function(e){var t=e.context,i=t.newParent,r=t.newHost,o=[];ms(t.closure.topLevel,function(e){o=mE(e)?o.concat(e.children):o.concat(e)}),1===o.length&&r&&(i=r);var a=n.canReplace(o,i);a&&this.replaceElements(o,a.replacements,r)},this),this.postExecute(["shape.replace"],1500,function(e){var t,i=e.context,r=i.oldShape,o=i.newShape,a=r.attachers;a&&a.length&&(t=n.canReplace(a,o),this.replaceElements(a,t.replacements))},this),this.postExecuted(["shape.replace"],1500,function(e){var t=e.context,n=t.oldShape,i=t.newShape;o.unclaimId(n.businessObject.id,n.businessObject),o.updateProperties(i,{id:n.id})})}function Ur(e,t){e.on("resize.start",EE+500,function(e){var t=e.context,n=t.shape;(gE(n,"bpmn:Lane")||gE(n,"bpmn:Participant"))&&(t.balanced=!xE(e))}),e.on("resize.end",EE,function(e){var n=e.context,i=n.shape,r=n.canExecute,o=n.newBounds;if(gE(i,"bpmn:Lane")||gE(i,"bpmn:Participant"))return r&&(o=bE(o),t.resizeLane(i,o,n.balanced)),!1})}function qr(e,t,n,i){wf.call(this,e),this.executed(["shape.toggleCollapse"],TE,function(e){var t=e.context.shape;SE(t,"bpmn:SubProcess")&&(t.collapsed?wE(t).di.isExpanded=!1:(!function(e){e.length&&e.forEach(function(e){"label"!==e.type||e.businessObject.name||(e.hidden=!0)})}(t.children),wE(t).di.isExpanded=!0))}),this.reverted(["shape.toggleCollapse"],TE,function(e){var t=e.context.shape;t.collapsed?wE(t).di.isExpanded=!1:wE(t).di.isExpanded=!0}),this.postExecuted(["shape.toggleCollapse"],TE,function(e){var i,r=e.context.shape,o=t._getDefaultSize(r);i=r.collapsed?function(e,t){return{x:e.x+(e.width-t.width)/2,y:e.y+(e.height-t.height)/2,width:t.width,height:t.height}}(r,o):function(e,t){var n,i,r=t;return n=e.children.filter(function(e){return!e.hidden}).concat([e]),(i=AE(n))?(r.width=Math.max(i.width,r.width),r.height=Math.max(i.height,r.height),r.x=i.x+(i.width-r.width)/2,r.y=i.y+(i.height-r.height)/2):(r.x=e.x+(e.width-r.width)/2,r.y=e.y+(e.height-r.height)/2),r}(r,o),n.resizeShape(r,i)})}function Yr(e,t){wf.call(this,e),this.preExecute("elements.delete",function(e){var n=e.context.elements;ms(n,function(e){t.unclaimId(e.businessObject.id,e.businessObject)})})}function Kr(e,t){wf.call(this,e),this.preExecute("connection.delete",function(e){var n=e.context.connection,i=n.source;(function(e,t){if(!PE(e,"bpmn:SequenceFlow"))return!1;var n=ME(t),i=ME(e);return n.get("default")===i})(n,i)&&t.updateProperties(i,{default:null})})}function Xr(e,t,n){function i(){if(!r)throw new Error(n("out of bounds release"));return r}wf.call(this,e);var r,o=["spaceTool","lane.add","lane.resize","lane.split","elements.move","elements.delete","shape.create","shape.delete","shape.move","shape.resize"];this.preExecute(o,NE,function(e){(r=r||new function(){this.flowNodes=[],this.lanes=[],this.counter=0,this.addLane=function(e){this.lanes.push(e)},this.addFlowNode=function(e){this.flowNodes.push(e)},this.enter=function(){this.counter++},this.leave=function(){return this.counter--,!this.counter}}).enter()}),this.postExecuted(o,DE,function(e){!function(){if(!r)throw new Error(n("out of bounds release"));var e=r.leave();e&&(t.updateLaneRefs(r.flowNodes,r.lanes),r=null)}()}),this.preExecute(["shape.create","shape.move","shape.delete","shape.resize"],function(e){var t=e.context.shape,n=i();t.labelTarget||(BE(t,"bpmn:Lane")&&n.addLane(t),BE(t,"bpmn:FlowNode")&&n.addFlowNode(t))})}function Zr(e){wf.call(this,e);var t=this;this.preExecute(["shape.create","connection.create"],function(e){var n=e.context,i=n.shape||n.connection,r=n.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.parent=o.parent),n.parentIndex=o.index)}),this.preExecute(["shape.move","connection.move"],function(e){var n=e.context,i=n.shape||n.connection,r=n.newParent||i.parent,o=t.getOrdering(i,r);o&&(void 0!==o.parent&&(n.newParent=o.parent),n.newParentIndex=o.index)})}function Qr(e,t){function n(e){var t=e.order;return t||(e.order=t=function(e){if(e.labelTarget)return{level:10};var t=Jp(i,function(t){return LE(e,[t.type])});return t&&t.order||{level:1}}(e)),t}jE.call(this,e);var i=[{type:"bpmn:SubProcess",order:{level:6}},{type:"bpmn:SequenceFlow",order:{level:5,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:Participant",order:{level:-2}},{type:"bpmn:Lane",order:{level:-1}}];this.getOrdering=function(e,i){var r=n(e);r.containers&&(i=function(e,n,i){for(var r=n;r&&!LE(r,i);)r=r.parent;if(!r)throw new Error(t("no parent for {element} in {parent}",{element:e.id,parent:n.id}));return r}(e,i,r.containers));var o=i.children.indexOf(e),a=Fy(i.children,function(t){return!(!e.labelTarget&&t.labelTarget)&&r.level=100&&t.height>=80):e_(e,"bpmn:Lane")?!t||t.width>=130&&t.height>=60:e_(e,"bpmn:Participant")?!t||t.width>=250&&t.height>=50:!!ao(e)}function Ao(e,t){return!fo(e)&&!fo(t)&&(!(!so(e)||!co(t))||!mo(t,e)&&!mo(e,t)&&function(e,t){var n=ao(e),i=ao(t);return(n||i)&&n!==i}(e,t))}function To(e,t){return function(e){return e_(e,"bpmn:InteractionNode")&&!co(e)&&(!e_(e,"bpmn:Event")||e_(e,"bpmn:ThrowEvent")&&uo(e,"bpmn:MessageEventDefinition"))}(e)&&function(e){return e_(e,"bpmn:InteractionNode")&&!co(e)&&(!e_(e,"bpmn:Event")||e_(e,"bpmn:CatchEvent")&&uo(e,"bpmn:MessageEventDefinition"))}(t)&&!function(e,t){return oo(e)===oo(t)}(e,t)}function Co(e,t){return function(e){return e_(e,"bpmn:FlowNode")&&!e_(e,"bpmn:EndEvent")&&!r_(e)&&!(e_(e,"bpmn:IntermediateThrowEvent")&&lo(e,"bpmn:LinkEventDefinition"))&&!so(e)&&!co(e)}(e)&&function(e){return e_(e,"bpmn:FlowNode")&&!e_(e,"bpmn:StartEvent")&&!e_(e,"bpmn:BoundaryEvent")&&!r_(e)&&!(e_(e,"bpmn:IntermediateCatchEvent")&&lo(e,"bpmn:LinkEventDefinition"))&&!co(e)}(t)&&function(e,t){var n=po(e),i=po(t);return n&&n===i}(e,t)&&!(e_(e,"bpmn:EventBasedGateway")&&!function(e){return e_(e,"bpmn:ReceiveTask")||e_(e,"bpmn:IntermediateCatchEvent")&&(lo(e,"bpmn:MessageEventDefinition")||lo(e,"bpmn:TimerEventDefinition")||lo(e,"bpmn:ConditionalEventDefinition")||lo(e,"bpmn:SignalEventDefinition"))}(t))}function Ro(e,t){return t_(e,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&t_(t,["bpmn:Activity","bpmn:ThrowEvent"])?{type:"bpmn:DataInputAssociation"}:!(!t_(t,["bpmn:DataObjectReference","bpmn:DataStoreReference"])||!t_(e,["bpmn:Activity","bpmn:CatchEvent"]))&&{type:"bpmn:DataOutputAssociation"}}function Po(e,t,n){if(Array.isArray(e)){if(1!==e.length)return!1;e=e[0]}return t_(t,["bpmn:SequenceFlow","bpmn:MessageFlow"])&&!ho(t)&&e_(e,"bpmn:FlowNode")&&!e_(e,"bpmn:BoundaryEvent")&&vo(e,t.parent)}function Mo(e,t){return e&&t&&-1!==e.indexOf(t)}function ko(e,t){return!(e_(t,"bpmn:Lane")&&!Mo(e,t.parent))&&!(e_(t,"bpmn:BoundaryEvent")&&!Mo(e,t.host))}function Bo(e,t,n,i){wf.call(this,e),e.on("shape.move.start",m_,function(e){var t=e.context,n=t.shapes,i=t.validatedShapes;t.shapes=function(e){var t=Do(e);return h_(e,t)}(n),t.validatedShapes=function(e){var t=Cu(e,"id");return Xp(e,function(e){for(;e;){if(e.host&&t[e.host.id])return!1;e=e.parent}return!0})}(i)}),this.postExecuted(["elements.move"],function(e){var n=e.context,i=n.delta,r=n.newParent,o=n.closure.enclosedElements,a=Do(o);ms(a,function(e){o[e.id]||(t.moveShape(e,i,r),e.label&&t.moveShape(e.label,i,r))})}),this.postExecuted(["elements.move"],function(e){var n,i=e.context,r=i.shapes,o=i.newHost;r.length>1||(n=o?r:Xp(r,function(e){return!!e.host}),ms(n,function(e){t.updateAttachment(e,o)}))}),this.postExecuted(["elements.move"],function(e){var n=e.context.shapes;ms(n,function(e){ms(e.attachers,function(e){ms(e.outgoing.slice(),function(e){i.allowed("connection.reconnectStart",{connection:e,source:e.source,target:e.target})||t.removeConnection(e)}),ms(e.incoming.slice(),function(e){i.allowed("connection.reconnectEnd",{connection:e,source:e.source,target:e.target})||t.removeConnection(e)})})})}),this.postExecute(["shape.create"],function(e){var n=e.context,i=n.shape,r=n.host;r&&t.updateAttachment(i,r)}),this.postExecute(["shape.replace"],function(e){var n=e.context,r=n.oldShape,o=n.newShape;d_(r.attachers,function(e){"attach"===i.allowed("elements.move",{target:o,shapes:[e]})?t.updateAttachment(e,o):t.removeShape(e)}),o.attachers.length&&ms(o.attachers,function(e){var n=f_(e,r,o);t.moveShape(e,n,e.parent)})}),this.postExecute(["shape.resize"],function(e){var n=e.context,i=n.shape,r=n.oldBounds,o=n.newBounds,a=i.attachers;a.length&&ms(a,function(e){var n=f_(e,r,o);t.moveShape(e,n,e.parent),e.label&&t.moveShape(e.label,n,e.label.parent)})}),this.preExecute(["shape.delete"],function(e){var n=e.context.shape;d_(n.attachers,function(e){t.removeShape(e)}),n.host&&t.updateAttachment(n,null)}),e.on("spaceTool.move",function(e){var t=e.context.movingShapes,n=Xp(t,function(e){return e.host&&e.host.id});ms(n,function(e){Su.remove(t,e),e.label&&Su.remove(t,e.label)})})}function Do(e){return qf(Ip(e,function(e){return e.attachers||[]}))}function No(e,t,n){wf.call(this,e),e.on("shape.move.start",g_,function(e){var t=e.context,n=t.shapes,i=t.validatedShapes;t.shapes=Oo(n),t.validatedShapes=Oo(i)}),e.on("shape.move.start",v_,function(e){var t=e.context,i=t.shapes,r=[];ms(i,function(e){var n=e.label;n&&!n.hidden&&-1===t.shapes.indexOf(n)&&r.push(n),e.labelTarget&&r.push(e)}),ms(r,function(e){n.makeDraggable(t,e,!0)})}),this.postExecuted(["elements.move"],function(e){var n=e.context,i=n.closure.enclosedElements;ms(i,function(e){e.label&&!i[e.label.id]&&t.moveShape(e.label,n.delta,e.parent)})})}function Oo(e){return Xp(e,function(t){return-1===e.indexOf(t.labelTarget)})}function jo(e,t,n,i,r){function o(e,t,n,i){return r.allowed("elements.move",{shapes:e,delta:t,position:n,target:i})}function a(e,n,i){if(!n.waypoints&&n.parent){var r=function(e){return{x:e.x+S_(e.width/2),y:e.y+S_(e.height/2)}}(n);t.init(e,r,"shape.move",{cursor:"grabbing",autoActivate:i,data:{shape:n,context:{}}})}}e.on("shape.move.start",__,function(e){var t=e.context,n=e.shape,r=i.get().slice();-1===r.indexOf(n)&&(r=[n]),r=function(e){var t=Cu(e,"id");return Xp(e,function(e){for(;e=e.parent;)if(t[e.id])return!1;return!0})}(r),Bc(t,{shapes:r,validatedShapes:r,shape:n})}),e.on("shape.move.start",E_,function(e){var t=e.context,n=t.validatedShapes;if(!(t.canExecute=o(n)))return e.stopPropagation(),!1}),e.on("shape.move.move",x_,function(e){var t,n=e.context,i=n.validatedShapes,r=e.hover,a={x:e.dx,y:e.dy};t=o(i,a,{x:e.x,y:e.y},r),n.delta=a,n.canExecute=t,n.target=null!==t?r:null}),e.on("shape.move.end",function(e){var t=e.context,i=t.delta,r=t.canExecute,o="attach"===r,a=t.shapes;if(!r)return!1;i.x=S_(i.x),i.y=S_(i.y),n.moveElements(a,i,t.target,o,{primaryShape:t.shape})}),e.on("element.mousedown",function(e){var t=w_(e);if(!t)throw new Error("must supply DOM mousedown event");a(t,e.element)}),this.start=a}function Lo(e,t,n,i,r){function o(e){return function(e){return Xp(e,function(t){if(function(e){return e.waypoints}(t)){var n=Jp(e,t.source),i=Jp(e,t.target);return n&&i}return!0})}(a(e))}function a(e){var t=ku.selfAndAllChildren(e,!0),n=Ip(t,function(e){return(e.incoming||[]).concat(e.outgoing||[])});return qf(t.concat(n),!0)}function s(e,t){[D_,M_,k_,B_].forEach(function(i){i===t?n.addMarker(e,i):n.removeMarker(e,i)})}this.makeDraggable=function(e,t,i){r.addDragger(t,e.dragGroup),i&&n.addMarker(t,P_),e.allDraggedElements?e.allDraggedElements.push(t):e.allDraggedElements=[t]},e.on("shape.move.start",R_,function(e){var t=e.context,s=t.shapes,c=t.allDraggedElements,p=o(s);if(!t.dragGroup){var l=Cs("g");Es(l,i.cls("djs-drag-group",["no-events"]));var u=n.getDefaultLayer();Xc(u,l),t.dragGroup=l}p.forEach(function(e){r.addDragger(e,t.dragGroup)}),c=c?qf(c,a(s)):a(s),ms(c,function(e){n.addMarker(e,P_)}),t.allDraggedElements=c,t.differentParents=function(e){return 1!==T_(Cu(e,function(e){return e.parent&&e.parent.id}))}(s)}),e.on("shape.move.move",R_,function(e){var t=e.context,n=t.dragGroup,i=t.target,r=t.shape.parent,o=t.canExecute;i&&("attach"===o?s(i,D_):t.canExecute&&i&&i.id!==r.id?s(i,B_):s(i,t.canExecute?M_:k_)),C_(n,e.dx,e.dy)}),e.on(["shape.move.out","shape.move.cleanup"],function(e){var t=e.context.target;t&&s(t,null)}),e.on("shape.move.cleanup",function(e){var t=e.context,i=t.allDraggedElements,r=t.dragGroup;ms(i,function(e){n.removeMarker(e,P_)}),r&&qd(r)})}function Io(e,t,n,i,r,o){this._canvas=n,this._dragging=t,this._modeling=i,this._rules=r,this._toolManager=o;var a=this;o.registerTool("space",{tool:"spaceTool.selection",dragging:"spaceTool"}),e.on("spaceTool.selection.end",function(t){var n=t.originalEvent.target;(t.hover||n instanceof SVGElement)&&e.once("spaceTool.selection.ended",function(){a.activateMakeSpace(t.originalEvent)})}),e.on("spaceTool.move",z_,function(e){var t=e.context;t.initialized||(t.initialized=a.initializeMakeSpace(e,t))}),e.on("spaceTool.end",function(t){var n=t.context,i=n.axis,r=n.direction,o=n.movingShapes,s=n.resizingShapes;if(n.initialized){var c={x:F_(t.dx),y:F_(t.dy)};c[W_[i]]=0;var p=!0;ms(s,function(e){("w"===r&&t.x>e.x+e.width||"e"===r&&t.xe.y+e.height||"s"===r&&t.y5&&Es(e.element,{width:e.initialWidth+y.x}),e.initialHeight+y.y>5&&Es(e.element,{height:e.initialHeight+y.y})})}}),e.on("spaceTool.cleanup",function(e){var t=e.context,i=t.movingShapes,r=t.movingConnections,o=t.resizingShapes,a=t.line,s=t.dragGroup,c=t.frameGroup;ms(i,function(e){n.removeMarker(e,V_)}),ms(r,function(e){n.removeMarker(e,V_)}),s&&(Zc(a),Zc(s)),ms(o,function(e){n.removeMarker(e,U_)}),c&&Zc(c)})}function zo(e,t){e.style.display=!1===t?"none":""}function $o(e,t){this._eventBus=e,this._canvas=t,this._ids=X_,this._tooltipDefaults={show:{minZoom:.7,maxZoom:5}},this._tooltips={},this._tooltipRoot=function(e){var t=El('
');return e.insertBefore(t,e.firstChild),t}(t.getContainer());var n=this;yl.bind(this._tooltipRoot,Z_,"mousedown",function(e){e.stopPropagation()}),yl.bind(this._tooltipRoot,Z_,"mouseover",function(e){n.trigger("mouseover",e)}),yl.bind(this._tooltipRoot,Z_,"mouseout",function(e){n.trigger("mouseout",e)}),this._init()}function Wo(e){return Bc({original:e.point.original||e.point},e.actual)}function Go(e,t){this._elementRegistry=e,this._graphicsFactory=t}function Ho(e,t,n){this._elementRegistry=e,this._canvas=n,t.registerProvider(this)}function Vo(e){return Xp(e,function(e){return!!e.matched}).length>0}function Uo(e,t){var n=[],i=e;if(!e)return n;e=e.toLowerCase(),t=t.toLowerCase();var r=e.indexOf(t);return r>-1?(0!==r&&n.push({normal:i.substr(0,r)}),n.push({matched:i.substr(r,t.length)}),t.length+r'+e.matched+"":t+=e.normal}),""!==t?t:null}(t),r=El(n);r.innerHTML=i,e.appendChild(r)}function Ko(e){return e&&e[e.length-1]}function Xo(e){return e.y}function Zo(e){return e.x}function Qo(e){this._modeling=e}function Jo(e,t,n,i){this._dragging=n,i.registerTool("hand",{tool:"hand",dragging:"hand.move"}),e.on("element.mousedown",uw,function(e){if(lw(e))return this.activateMove(e.originalEvent),!1},this),e.on("hand.end",function(t){var n=t.originalEvent.target;if(!(t.hover||n instanceof SVGElement))return!1;e.once("hand.ended",function(){this.activateMove(t.originalEvent,{reactivate:!0})},this)},this),e.on("hand.move.move",function(e){var n=t.viewbox().scale;t.scroll({dx:e.dx*n,dy:e.dy*n})}),e.on("hand.move.end",function(t){var n=t.context.reactivate;return!lw(t)&&n&&e.once("hand.move.ended",function(e){this.activateHand(e.originalEvent,!0,!0)},this),!1},this)}function ea(e,t,n,i,r,o){this._selection=r,this._dragging=n;var a=this,s={create:function(e){var n,i=t.getDefaultLayer();n=e.frame=Cs("rect"),Es(n,{class:"djs-lasso-overlay",width:1,height:1,x:0,y:0}),Xc(i,n)},update:function(e){var t=e.frame,n=e.bbox;Es(t,{x:n.x,y:n.y,width:n.width,height:n.height})},remove:function(e){e.frame&&Zc(e.frame)}};o.registerTool("lasso",{tool:"lasso.selection",dragging:"lasso"}),e.on("lasso.selection.end",function(t){var n=t.originalEvent.target;(t.hover||n instanceof SVGElement)&&e.once("lasso.selection.ended",function(){a.activateLasso(t.originalEvent,!0)})}),e.on("lasso.end",function(e){var t=ta(e),n=i.filter(function(e){return e});a.select(n,t)}),e.on("lasso.start",function(e){var t=e.context;t.bbox=ta(e),s.create(t)}),e.on("lasso.move",function(e){var t=e.context;t.bbox=ta(e),s.update(t)}),e.on("lasso.cleanup",function(e){var t=e.context;s.remove(t)}),e.on("element.mousedown",1500,function(e){mw(e)&&(a.activateLasso(e.originalEvent),e.stopPropagation())})}function ta(e){var t={x:e.x-e.dx,y:e.y-e.dy},n={x:e.x,y:e.y};return t.x<=n.x&&t.y=n.x&&t.yn.x&&t.y<=n.y?{x:n.x,y:t.y,width:t.x-n.x,height:n.y-t.y}:t.x<=n.x&&t.y>n.y||t.x=n.y?{x:t.x,y:n.y,width:n.x-t.x,height:t.y-n.y}:t.x>=n.x&&t.y>n.y||t.x>n.x&&t.y>=n.y?{x:n.x,y:n.y,width:t.x-n.x,height:t.y-n.y}:{x:n.x,y:n.y,width:0,height:0}}function na(e,t){e.addListener(function(n,i){if(65===n&&e.isCmd(i))return t.trigger("selectElements"),!0;if(70===n&&e.isCmd(i))return t.trigger("find"),!0;if(!e.hasModifier(i))return 83===n?(t.trigger("spaceTool"),!0):76===n?(t.trigger("lassoTool"),!0):72===n?(t.trigger("handTool"),!0):67===n?(t.trigger("globalConnectTool"),!0):69===n?(t.trigger("directEditing"),!0):void 0})}function ia(e,t,n){var i=this;this._config=e||{},this._eventBus=t,this._editorActions=n,this._listeners=[],this._keyHandler=function(e){var t,n,r=e.target,o=i._listeners,a=e.keyCode||e.charCode||-1;if(!r||!xw(r,"input, textarea")&&"true"!==r.contentEditable)for(t=0;n=o[t];t++)n(a,e)&&(e.preventDefault(),e.stopPropagation())},t.on("diagram.destroy",function(){i._fire("destroy"),i.unbind(),i._listeners=null}),t.on("diagram.init",function(){i._fire("init"),e&&e.bindTo&&i.bind(e.bindTo)}),this._init()}function ra(e){return e.ctrlKey||e.metaKey}function oa(e){return e.shiftKey}function aa(e,t,n,i,r,o,a,s){this._palette=e,this._create=t,this._elementFactory=n,this._spaceTool=i,this._lassoTool=r,this._handTool=o,this._globalConnect=a,this._translate=s,e.registerProvider(this)}function sa(e,t,n){this._eventBus=e,this._canvas=t,this._dragging=n,this._providers=[];var i=this;e.on("tool-manager.update",function(e){var t=e.tool;i.updateToolHighlight(t)}),e.on("i18n.changed",function(){i._update()})}function ca(e,t,n,i,r){wf.call(this,e),e.on("shape.move.move",Tw,function(e){var o=e.context,a=o.canExecute;o.visualReplacements||(o.visualReplacements={}),a.replacements?function(e){var o=e.canExecute.replacements;ms(o,function(o){var a=o.oldElementId,s={type:o.newElementType};if(!e.visualReplacements[a]){var c=t.get(a);Bc(s,{x:c.x,y:c.y});var p=n.createShape(s);i.addShape(p,c.parent);var l=up("[data-element-id="+c.id+"]",e.dragGroup);l&&Es(l,{display:"none"});var u=r.addDragger(p,e.dragGroup);e.visualReplacements[a]=u,i.removeShape(p)}})}(o):function(e){var t=e.visualReplacements;ms(t,function(n,i){var r=up("[data-element-id="+i+"]",e.dragGroup);r&&Es(r,{display:"inline"}),n.remove(),t[i]&&delete t[i]})}(o)})}function pa(){this._targets={},this._snapOrigins={},this._snapLocations=[],this._defaultSnaps={}}function la(e){this._snapValues={}}function ua(e,t){this._canvas=t;var n=this;e.on(["shape.move.start","create.start"],function(e){n.initSnap(e)}),e.on(["shape.move.move","shape.move.end","create.move","create.end"],Nw,function(e){e.originalEvent&&e.originalEvent.ctrlKey||Ow(e)||n.snap(e)}),e.on(["shape.move.cleanup","create.cleanup"],function(e){n.hide()}),this._asyncHide=Ou(this.hide,1e3)}function ha(e,t,n,i){Lw.call(this,e,t),e.on("create.start",function(e){var n=e.context,i=n.shape,r=t.getRootElement();zw(i,"bpmn:Participant")&&zw(r,"bpmn:Process")&&da(n,i,r.children)}),e.on(["create.move","create.end"],Jw,function(e){var t=e.context,n=t.shape,i=t.participantSnapBox;!Yw(e)&&i&&function(e,t,n,i){i=i||0;var r=t.width/2-i,o=t.height/2,a={x:n.x-r-i,y:n.y-o},s={x:n.x+r+i,y:n.y+o},c=e,p=qw(e);a.x>=c.x?Kw(n,"x",c.x+i+r):s.x<=p.x&&Kw(n,"x",p.x-i-r);a.y>=c.y?Kw(n,"y",c.y+o):s.y<=p.y&&Kw(n,"y",p.y-o)}(i,n,e)}),e.on("shape.move.start",function(e){var n=e.context,i=n.shape,r=t.getRootElement();zw(i,"bpmn:Participant")&&zw(r,"bpmn:Process")&&da(n,i,r.children)}),e.on(["create.move","create.end","shape.move.move","shape.move.end"],Jw,function(e){var t=e.context,i=t.target,r=t.shape;i&&!Yw(e)&&function(e,t,i){return"attach"===n.canAttach([e],t,null,i)}(r,i,e)&&function(e,t,n){var i=Gw(n),r=Xw(e,n);/top/.test(r)?Kw(e,"y",i.top):/bottom/.test(r)&&Kw(e,"y",i.bottom);/left/.test(r)?Kw(e,"x",i.left):/right/.test(r)&&Kw(e,"x",i.right)}(e,0,i)}),e.on(["shape.move.hover","shape.move.move","shape.move.end","create.hover","create.move","create.end"],Jw,function(e){var t=e.context.shape,n=e.hover;zw(n,"bpmn:Lane")&&!$w(t,["bpmn:Lane","bpmn:Participant"])&&(e.hover=Qw(n),e.hoverGfx=i.getGraphics(e.hover))}),e.on(["connect.move","connect.hover","connect.end"],Jw,function(e){var t=e.context,i=t.source,r=t.target,o=function(e,t){return n.canConnect(e,t)}(i,r)||{};t.initialSourcePosition||(t.initialSourcePosition=t.sourcePosition),r&&"bpmn:SequenceFlow"===o.type?(t.sourcePosition=Vw(i),Bc(e,Vw(r))):t.sourcePosition=t.initialSourcePosition}),e.on(["create.move","shape.move.move"],function(e){var t=e.context,n=t.shape,i=t.target;if(zw(n,"bpmn:Lane")&&$w(i,["bpmn:Lane","bpmn:Participant"])){var r,o=Xp(i.children,function(e){return zw(e,"bpmn:Lane")}),a=e.y,s=o.reduce(function(e,t){var n=Gw(t);return Iw(n.top-a)<30?e=Bc(e||{},{before:{element:t,y:n.top}}):Iw(n.bottom-a)<30?e=Bc(e||{},{after:{element:t,y:n.bottom}}):n.topa&&(e=Iw(n.top-a)>Iw(n.bottom-a)?Bc(e||{},{after:{element:t,y:n.bottom}}):Bc(e||{},{before:{element:t,y:n.top}})),e},!1);s||(r=Gw(i),s=Iw(r.top-a)<30?{before:{element:i,y:r.top}}:Iw(r.bottom-a)<30?{after:{element:i,y:r.bottom}}:{into:{element:i,y:(r.top+r.bottom)/2}}),s.before&&s.after?(console.log("insert between",s.before.element.id,"and",s.after.element.id),Kw(e,"x",s.before.element.x+s.before.element.width/2),Kw(e,"y",s.before.y)):s.after?(console.log("insert after",s.after.element.id),Kw(e,"x",s.after.element.x+s.after.element.width/2),Kw(e,"y",s.after.y)):s.before?(console.log("insert before",s.before.element.id),Kw(e,"x",s.before.element.x+s.before.element.width/2),Kw(e,"y",s.before.y)):s.into&&(console.log("insert into",s.into.element.id),Kw(e,"x",s.into.element.x+s.into.element.width/2),Kw(e,"y",s.into.y))}}),e.on("resize.start",Jw,function(e){var t=e.context,n=t.shape;zw(n,"bpmn:SubProcess")&&Ww(n)&&(t.minDimensions={width:140,height:120}),zw(n,"bpmn:Participant")&&(t.minDimensions={width:300,height:150}),(zw(n,"bpmn:Lane")||zw(n,"bpmn:Participant"))&&(t.resizeConstraints=Zw(n,t.direction,t.balanced)),zw(n,"bpmn:TextAnnotation")&&(t.minDimensions={width:50,height:30})})}function da(e,t,n){if(n.length){var i=Fw(n.filter(function(e){return!e.labelTarget&&!e.waypoints}));i.x-=50,i.y-=20,i.width+=70,i.height+=40,t.width=Math.max(t.width,i.width),t.height=Math.max(t.height,i.height),e.participantSnapBox=i}}function fa(e,t,n,i){this._canvas=n,this._mouseTracking=i,this._opts=Bc({scrollThresholdIn:[20,20,20,20],scrollThresholdOut:[0,0,0,0],scrollRepeatTimeout:15,scrollStep:10},e);var r=this;t.on("drag.move",function(e){var t=r._toBorderPoint(e);r.startScroll(t)}),t.on(["drag.cleanup"],function(){r.stopScroll()})}function ma(e,t,n,i,r,o,a){function s(e){r.update("connection",e.connection,e.connectionGfx)}var c=e.get("connectionDocking",!1);this.start=function(e,t,r,o){var a,s=t.waypoints,c=n.getGraphics(t);a={connection:t,bendpointIndex:r,insert:o,type:o||0!==r?o||r!==s.length-1?dS:mS:fS},i.init(e,"bendpoint.move",{data:{connection:t,connectionGfx:c,context:a}})},t.on("bendpoint.move.start",function(e){var t=e.context,i=t.connection,r=i.waypoints,o=r.slice(),a=t.insert,s=t.bendpointIndex;t.originalWaypoints=r,a&&o.splice(s,0,null),i.waypoints=o,t.draggerGfx=rS.addBendpoint(n.getLayer("overlays")),hp(t.draggerGfx).add("djs-dragging"),n.addMarker(i,hS)}),t.on("bendpoint.move.hover",function(e){var t=e.context;if(t.hover=e.hover,e.hover){n.addMarker(e.hover,uS);var i=t.allowed=o.allowed(t.type,t);i?(n.removeMarker(t.hover,lS),n.addMarker(t.hover,pS),t.target=t.hover):!1===i&&(n.removeMarker(t.hover,pS),n.addMarker(t.hover,lS),t.target=null)}}),t.on(["bendpoint.move.out","bendpoint.move.cleanup"],function(e){var t=e.context.hover;t&&(n.removeMarker(t,uS),n.removeMarker(t,e.context.target?pS:lS))}),t.on("bendpoint.move.move",function(e){var t,n,i=e.context,r=i.type,o=e.connection;o.waypoints[i.bendpointIndex]={x:e.x,y:e.y},c&&(i.hover&&(r===fS&&(t=i.hover),r===mS&&(n=i.hover)),o.waypoints=c.getCroppedWaypoints(o,t,n)),vS(i.draggerGfx,e.x,e.y),s(e)}),t.on(["bendpoint.move.end","bendpoint.move.cancel"],function(e){var t=e.context,i=t.hover,r=t.connection;Zc(t.draggerGfx),t.newWaypoints=r.waypoints.slice(),r.waypoints=t.originalWaypoints,n.removeMarker(r,hS),i&&(n.removeMarker(i,pS),n.removeMarker(i,lS))}),t.on("bendpoint.move.end",function(e){var t,n=e.context,i=n.newWaypoints,r=n.bendpointIndex,o=i[r],c=n.allowed;if(o.x=yS(o.x),o.y=yS(o.y),c&&n.type===fS)a.reconnectStart(n.connection,n.target,o);else if(c&&n.type===mS)a.reconnectEnd(n.connection,n.target,o);else{if(!1===c||n.type!==dS)return s(e),!1;t={bendpointMove:{insert:e.context.insert,bendpointIndex:r}},a.updateWaypoints(n.connection,function(e){e=e.slice();for(var t,n,i,r=0;e[r];)t=e[r],n=e[r-1],i=e[r+1],0===Sf.pointDistance(t,i)||Sf.pointsOnLine(n,i,t)?e.splice(r,1):r++;return e}(i),t)}}),t.on("bendpoint.move.cancel",function(e){s(e)})}function ya(e){function t(e,t){if(rs(e)){for(var n=e.length;n--;)if(bS(e[n]-t)<=ES)return e[n]}else{var i=t%(e=+e);if(ie-ES)return t-i+e}return t}function n(e){if(e.width)return{x:xS(e.width/2+e.x),y:xS(e.height/2+e.y)}}e.on("connectionSegment.move.move",1500,function(e){var i,r,o=function(e){var t=e.snapPoints,i=e.connection,r=i.waypoints,o=e.segmentStart,a=e.segmentStartIndex,s=e.segmentEnd,c=e.segmentEndIndex,p=e.axis;if(t)return t;var l=[r[a-1],o,s,r[c+1]];return a<2&&l.unshift(n(i.source)),c>r.length-3&&l.unshift(n(i.target)),e.snapPoints=t={horizontal:[],vertical:[]},ms(l,function(e){e&&(e=e.original||e,"y"===p&&t.horizontal.push(e.y),"x"===p&&t.vertical.push(e.x))}),t}(e.context),a=e.x,s=e.y;if(o){var c=a-(i=t(o.vertical,a)),p=s-(r=t(o.horizontal,s));Bc(e,{dx:e.dx-c,dy:e.dy-p,x:i,y:r})}}),e.on("bendpoint.move.move",1500,function(e){var i,r,o=e.context,a=function(e){var t=e.snapPoints,n=e.connection.waypoints,i=e.bendpointIndex;if(t)return t;var r=[n[i-1],n[i+1]];return e.snapPoints=t={horizontal:[],vertical:[]},ms(r,function(e){e&&(e=e.original||e,t.horizontal.push(e.y),t.vertical.push(e.x))}),t}(o),s=o.target,c=s&&n(s),p=e.x,l=e.y;if(a){var u=p-(i=t(c?a.vertical.concat([c.x]):a.vertical,p)),h=l-(r=t(c?a.horizontal.concat([c.y]):a.horizontal,l));Bc(e,{dx:e.dx-u,dy:e.dy-h,x:e.x-u,y:e.y-h})}})}function va(e,t,n,i,r){function o(e,n){var i=rS.toCanvasCoordinates(t,n);return CS(e,i)}function a(e,t){var n=t.waypoints,a=o(n,e);a&&(!function(e,t,n){var i,r,o,a,s,c,p=e.index,l=e.point;return!(p<=0||e.bendpoint)&&(i=t[p-1],r=t[p],o=SS(i,r),a=wS(i,r),s=Math.abs(l.x-o.x),c=Math.abs(l.y-o.y),a&&s<=n&&c<=n)}(a,n,10)?i.start(e,t,a.index,!a.bendpoint):r.start(e,t,a.index))}function s(e,t,i){Ud.bind(e,t,function(e){n.triggerMouseEvent(t,e,i),e.stopPropagation()})}function c(e,n){var i=t.getLayer("overlays"),r=up(".djs-bendpoints[data-element-id="+e.id+"]",i);return!r&&n&&(r=Cs("g"),Es(r,{"data-element-id":e.id}),hp(r).add("djs-bendpoints"),Xc(i,r),s(r,"mousedown",e),s(r,"click",e),s(r,"dblclick",e)),r}function p(e,t){t.waypoints.forEach(function(t,n){var i=rS.addBendpoint(e);Xc(e,i),RS(i,t.x,t.y)}),rS.addBendpoint(e,"floating")}function l(e,t){for(var n,i,r=t.waypoints,o=1;of-3&&(v=Hf.getOrientation(n.target,d),r===f-2?"intersect"===v&&(u.pop(),u[u.length-1]=d):"intersect"!==v&&u.push(a)),t.newWaypoints=n.waypoints=s(n,u),p(t,m,e),t.newSegmentStartIndex=i+m,c(e)}),t.on("connectionSegment.move.hover",function(e){e.context.hover=e.hover,n.addMarker(e.hover,MS)}),t.on(["connectionSegment.move.out","connectionSegment.move.cleanup"],function(e){var t=e.context.hover;t&&n.removeMarker(t,MS)}),t.on("connectionSegment.move.cleanup",function(e){var t=e.context,i=t.connection;t.draggerGfx&&Zc(t.draggerGfx),n.removeMarker(i,kS)}),t.on(["connectionSegment.move.cancel","connectionSegment.move.end"],function(e){var t=e.context;t.connection.waypoints=t.originalWaypoints,c(e)}),t.on("connectionSegment.move.end",function(e){var t=e.context,n=t.connection,i=t.newWaypoints,r=t.newSegmentStartIndex,o=function(e,t){var n=0;return{waypoints:e.filter(function(i,r){return!Sf.pointsOnLine(e[r-1],e[r+1],i)||(n=r<=t?n-1:n,!1)}),segmentOffset:n}}(i=i.map(function(e){return{original:e.original,x:Math.round(e.x),y:Math.round(e.y)}}),r),c=s(n,o.waypoints),p=o.segmentOffset,l={segmentMove:{segmentStartIndex:t.segmentStartIndex,newSegmentStartIndex:r+p}};a.updateWaypoints(n,c,l)})}function wa(e,t){var n=this;t.on("canvas.init",function(e){n.addBBoxMarker(e.svg)})}function Sa(){}function Aa(e,t){return t.get(e,!1)}function Ta(e){function t(e){gd.stopEvent(e,!0)}function n(n){setTimeout(function(){ms(IS,function(n){Ud.unbind(e,n,t,!0)})},500)}Ud.bind(e,"touchstart",function(n){ms(IS,function(n){Ud.bind(e,n,t,!0)})},!0),Ud.bind(e,"touchend",n,!0),Ud.bind(e,"touchcancel",n,!0);var i=new OS.Manager(e,{inputClass:OS.TouchInput,recognizers:[]}),r=new OS.Tap,o=new OS.Pan({threshold:10}),a=new OS.Press,s=new OS.Pinch,c=new OS.Tap({event:"doubletap",taps:2});return s.requireFailure(o),s.requireFailure(a),i.add([o,a,s,c,r]),i.reset=function(e){var t=this.recognizers,n=this.session;n.stopped||(Sa(),i.stop(e),setTimeout(function(){var e,i;for(Sa(),e=0;i=t[e];e++)i.reset(),i.state=8;n.curRecognizer=null},0))},i.on("hammer.input",function(e){e.srcEvent.defaultPrevented&&i.reset(!0)}),i}function Ca(e,t,n,i,r){function o(e){return function(t){Sa(),r.fire(e,t)}}function a(e){return sf(e,"svg, .djs-element",!0)}function s(e){function n(e){var n=a(e.target),r=n&&i.get(n);if(l&&t.getRootElement()!==r)return Sa(),l.start(e,r,!0);!function(e){function n(e){var n=e.deltaX-r,i=e.deltaY-o;t.scroll({dx:n,dy:i}),r=e.deltaX,o=e.deltaY}function i(e){c.off("panmove",n),c.off("panend",i),c.off("pancancel",i),Sa()}Sa();var r=0,o=0;c.on("panmove",n),c.on("panend",i),c.on("pancancel",i)}()}(c=Ta(e)).on("doubletap",o("element.dblclick")),c.on("tap",o("element.click")),c.on("panstart",n),c.on("press",n),c.on("pinchstart",function(e){function n(e){var n=1-(1-e.scale)/1.5,i=Math.max(jS,Math.min(LS,n*r));t.zoom(i,o),gd.stopEvent(e,!0)}function i(e){c.off("pinchmove",n),c.off("pinchend",i),c.off("pinchcancel",i),c.reset(!0),Sa()}Sa();var r=t.zoom(),o=e.center;c.on("pinchmove",n),c.on("pinchend",i),c.on("pinchcancel",i)})}var c,p=Aa("dragging",e),l=Aa("move",e),u=Aa("contextPad",e),h=Aa("palette",e);p&&n.on("drag.move",function(e){var t=e.originalEvent;if(t&&!(t instanceof MouseEvent)){var n=gd.toPoint(t),r=a(document.elementFromPoint(n.x,n.y)),o=r&&i.get(r);o!==e.hover&&(e.hover&&p.out(e),o&&(p.hover({element:o,gfx:r}),e.hover=o,e.hoverGfx=r))}}),u&&n.on("contextPad.create",function(e){var t=Ta(e.pad.html);t.on("panstart",function(e){Sa(),u.trigger("dragstart",e,!0)}),t.on("press",function(e){Sa(),u.trigger("dragstart",e,!0)}),t.on("tap",function(e){Sa(),u.trigger("click",e)})}),h&&n.on("palette.create",function(e){var t=Ta(e.html);t.on("panstart",function(e){Sa(),h.trigger("dragstart",e,!0)}),t.on("press",function(e){Sa(),h.trigger("dragstart",e,!0)}),t.on("tap",function(e){Sa(),h.trigger("click",e)})}),n.on("canvas.init",function(e){s(e.svg)})}function Ra(e){ef.call(this,e),this.on("import.parse.complete",function(e){e.error||this._collectIds(e.definitions,e.context)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}var Pa={};Pa.is=function(t,n){var i=e(t);return i&&"function"==typeof i.$instanceOf&&i.$instanceOf(n)},Pa.getBusinessObject=e;var Ma=function(e,t){for(var n=-1,i=e.length;++n-1&&e%1==0&&e<=qa},Ka=function(e){return null!=e&&Ya(Ua(e))},Xa=/^\d+$/,Za=9007199254740991,Qa=function(e,t){return e="number"==typeof e||Xa.test(e)?+e:-1,t=null==t?Za:t,e>-1&&e%1==0&&e0;++ic))return!1;for(;++sr?0:r+t),(n=void 0===n||n>r?r:+n||0)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(r);++i2?n[r-2]:void 0,a=r>2?n[2]:void 0,s=r>1?n[r-1]:void 0;for("function"==typeof o?(o=fs(o,s,5),r-=2):r-=(o="function"==typeof s?s:void 0)?1:0,a&&Mc(n[0],n[1],a)&&(o=r<3?void 0:o,r=1);++ie?t.width:e},0);switch(r.vertical){case"middle":h=(n.height-m)/2-c[0].height/4;break;default:h=o.top}var v=Cs("text");Es(v,i),ms(c,function(e){switch(h+=e.height,r.horizontal){case"left":d=o.left;break;case"right":d=(a?y:p)-o.right-e.width;break;default:d=Math.max(((a?y:p)-e.width)/2+o.left,0)}var t=Cs("tspan");Es(t,{x:d,y:h}),t.textContent=e.text,Xc(v,t)}),Zc(l);return{dimensions:{width:y,height:m},element:v}};var ep=m,tp={},np=tp=function(e,t){if(t||(t=16),void 0===e&&(e=128),e<=0)return"0";for(var n=Math.log(Math.pow(2,e))/Math.log(t),i=2;n===1/0;i*=2)n=Math.log(Math.pow(2,e/i))/Math.log(t)*i;for(var r=n-Math.floor(n),o="",i=0;i=Math.pow(2,e)?np(e,t):o};np.rack=function(e,t,n){var i=function(i){var o=0;do{if(o++>10){if(!n)throw new Error("too many ID collisions, use more bits");e+=n}var a=np(e,t)}while(Object.hasOwnProperty.call(r,a));return r[a]=i,a},r=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=e||128,i.base=t||16,i};var ip=y;y.prototype.next=function(e){return this._seed(e||!0)},y.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},y.prototype.claim=function(e,t){this._seed.set(e,t||!0)},y.prototype.assigned=function(e){return this._seed.get(e)||!1},y.prototype.unclaim=function(e){delete this._seed.hats[e]},y.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var rp={};rp="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var op=function(e,t){for(var n=-1,i=e.length;++n':""};var Bp={},Dp=Pa.is,Np=Bp.DEFAULT_LABEL_SIZE={width:90,height:20},Op=15;Bp.hasExternalLabel=function(e){return Dp(e,"bpmn:Event")||Dp(e,"bpmn:Gateway")||Dp(e,"bpmn:DataStoreReference")||Dp(e,"bpmn:DataObjectReference")||Dp(e,"bpmn:SequenceFlow")||Dp(e,"bpmn:MessageFlow")},Bp.getExternalLabelMid=P,Bp.getExternalLabelBounds=function(e,t){var n,i,r,o=e.di.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Np.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=P(t),i=Np),Bc({x:n.x-i.width/2,y:n.y-i.height/2},i)};var jp=function(e,t){for(var n=-1,i=e.length,r=Array(i);++n-1?n[o]:void 0}return Zp(n,i,e)}}(hs),el={};el.extend=function(e,t,n,i){var r=n.inverse;return Object.defineProperty(e,"remove",{value:function(e){var n=this.indexOf(e);return-1!==n&&(this.splice(n,1),t.unset(e,r,i)),e}}),Object.defineProperty(e,"contains",{value:function(e){return-1!==this.indexOf(e)}}),Object.defineProperty(e,"add",{value:function(e){this.contains(e)||(this.push(e),t.set(e,r,i))}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},el.isExtended=function(e){return!0===e.__refs_collection},N.prototype.bind=function(e,t){if("string"==typeof t){if(!this.props[t])throw new Error("no property <"+t+"> in ref");t=this.props[t]}t.collection?D(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{enumerable:t.enumerable,get:function(){return r},set:function(t){if(t!==r){var o=r;r=null,o&&e.unset(o,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},N.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return el.isExtended(n)||D(this,t,e),n},N.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},N.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},N.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var tl={};(tl=N).Collection=el;var nl=kp.elementToString,il=new tl({name:"bpmnElement",enumerable:!0},{name:"di"}),rl=j,ol={};ol.importBpmnDiagram=L;var al=Element.prototype,sl=al.matches||al.webkitMatchesSelector||al.mozMatchesSelector||al.msMatchesSelector||al.oMatchesSelector,cl=function(e,t){if(!e||1!==e.nodeType)return!1;if(sl)return sl.call(e,t);for(var n=lp.all(t,e.parentNode),i=0;i
a',gl=!ml.getElementsByTagName("link").length,ml=void 0);var bl={legend:[1,"
","
"],tr:[2,"","
"],col:[2,"","
"],_default:gl?[1,"X
","
"]:[0,"",""]};bl.td=bl.th=[3,"","
"],bl.option=bl.optgroup=[1,'"],bl.thead=bl.tbody=bl.colgroup=bl.caption=bl.tfoot=[1,"","
"],bl.polyline=bl.ellipse=bl.polygon=bl.circle=bl.text=bl.line=bl.path=bl.rect=bl.g=[1,'',""];var xl,El=vl,_l={},wl=_l.BPMNIO_LOGO="iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC",Sl='
Web-based tooling for BPMN, DMN and CMMN diagrams powered by bpmn.io.
';_l.open=function(){xl||(xl=El(Sl),yl.bind(xl,".backdrop","click",function(e){document.body.removeChild(xl)})),document.body.appendChild(xl)};var Al="[object String]",Tl=Object.prototype.toString,Cl=function(e){return"string"==typeof e||Na(e)&&Tl.call(e)==Al},Rl="Expected a function",Pl=function(e,t,n){if("function"!=typeof e)throw new TypeError(Rl);return setTimeout(function(){e.apply(void 0,n)},t)},Ml=Pc(function(e,t){return Pl(e,1,t)}),kl={};kl.hasLowerCaseAlias=function(e){return e.xml&&"lowerCase"===e.xml.tagAlias},kl.DEFAULT_NS_MAP={xsi:"http://www.w3.org/2001/XMLSchema-instance"};var Bl=kl.XSI_TYPE="xsi:type";kl.serializeAsType=function(e){return F(e)===Bl},kl.serializeAsProperty=function(e){return"property"===F(e)},z.prototype.get=function(e){return this.$model.properties.get(this,e)},z.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};var Dl=z,Nl=$;$.prototype.createType=function(e){function t(e){i.define(this,"$type",{value:o,enumerable:!0}),i.define(this,"$attrs",{value:{}}),i.define(this,"$parent",{writable:!0}),ms(e,function(e,t){this.set(t,e)},this)}var n=this.model,i=this.properties,r=Object.create(Dl.prototype);ms(e.properties,function(e){e.isMany||void 0===e.default||(r[e.name]=e.default)}),i.defineModel(r,n),i.defineDescriptor(r,e);var o=e.ns.name;return t.prototype=r,t.hasType=r.$instanceOf=this.model.hasType,i.defineModel(t,n),i.defineDescriptor(t,e),t};var Ol={};Ol.parseName=function(e,t){var n,i,r=e.split(/:/);if(1===r.length)n=e,i=t;else{if(2!==r.length)throw new Error("expected or , got "+e);n=r[1],i=r[0]}return e=(i?i+":":"")+n,{name:e,prefix:i,localName:n}};var jl=W;W.prototype.set=function(e,t,n){var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;!function(e){return void 0===e}(n)?i?r in e?e[r]=n:G(e,i,n):e.$attrs[t]=n:i?delete e[r]:delete e.$attrs[t]},W.prototype.get=function(e,t){var n=this.model.getPropertyDescriptor(e,t);if(!n)return e.$attrs[t];var i=n.name;return!e[i]&&n.isMany&&G(e,n,[]),e[i]},W.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},W.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},W.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};var Ll=Ol.parseName,Il=H;H.prototype.build=function(){return qc(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},H.prototype.addProperty=function(e,t,n){"boolean"==typeof t&&(n=t,t=void 0),this.addNamedProperty(e,!1!==n);var i=this.properties;void 0!==t?i.splice(t,0,e):i.push(e)},H.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,o=this.propertiesByName,a=e.name!==t.name;if(e.isId){if(!t.isId)throw new Error("property <"+t.ns.name+"> must be id property to refine <"+e.ns.name+">");this.setIdProperty(t,!1)}if(e.isBody){if(!t.isBody)throw new Error("property <"+t.ns.name+"> must be body property to refine <"+e.ns.name+">");this.setBodyProperty(t,!1)}var s=r.indexOf(e);if(-1===s)throw new Error("property <"+i.name+"> not found in property list");r.splice(s,1),this.addProperty(t,n?void 0:s,a),o[i.name]=o[i.localName]=t},H.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),o=Ll(r[0],i),a=Ll(r[1],o.prefix).name,s=this.propertiesByName[a];if(!s)throw new Error("refined property <"+a+"> not found");this.replaceProperty(s,e,n),delete e.redefines},H.prototype.addNamedProperty=function(e,t){var n=e.ns,i=this.propertiesByName;t&&(this.assertNotDefined(e,n.name),this.assertNotDefined(e,n.localName)),i[n.name]=i[n.localName]=e},H.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},H.prototype.setBodyProperty=function(e,t){if(t&&this.bodyProperty)throw new Error("body property defined multiple times (<"+this.bodyProperty.ns.name+">, <"+e.ns.name+">)");this.bodyProperty=e},H.prototype.setIdProperty=function(e,t){if(t&&this.idProperty)throw new Error("id property defined multiple times (<"+this.idProperty.ns.name+">, <"+e.ns.name+">)");this.idProperty=e},H.prototype.assertNotDefined=function(e,t){var n=e.name,i=this.propertiesByName[n];if(i)throw new Error("property <"+n+"> already defined; override of <"+i.definedBy.ns.name+"#"+i.ns.name+"> by <"+e.definedBy.ns.name+"#"+e.ns.name+"> not allowed without redefines")},H.prototype.hasProperty=function(e){return this.propertiesByName[e]},H.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(ms(e.properties,function(n){n=Bc({},n,{name:n.ns.localName,inherited:t}),Object.defineProperty(n,"definedBy",{value:e});var i=n.replaces,r=n.redefines;i||r?this.redefineProperty(n,i||r,i):(n.isBody&&this.setBodyProperty(n),n.isId&&this.setIdProperty(n),this.addProperty(n))},this),i.push(e),n[r]=e)};var Fl={},zl={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},$l={String:function(e){return e},Boolean:function(e){return"true"===e},Integer:function(e){return parseInt(e,10)},Real:function(e){return parseFloat(e,10)}};Fl.coerceType=function(e,t){var n=$l[e];return n?n(t):t},Fl.isBuiltIn=function(e){return!!zl[e]},Fl.isSimple=function(e){return!!$l[e]};var Wl=Ol.parseName,Gl=Fl.isBuiltIn,Hl=V;V.prototype.getPackage=function(e){return this.packageMap[e]},V.prototype.getPackages=function(){return this.packages},V.prototype.registerPackage=function(e){e=Bc({},e);var t=this.packageMap;U(t,e,"prefix"),U(t,e,"uri"),ms(e.types,function(t){this.registerType(t,e)},this),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},V.prototype.registerType=function(e,t){e=Bc({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:Bc(e.meta||{})});var n=Wl(e.name,t.prefix),i=n.name,r={};ms(e.properties,function(e){var t=Wl(e.name,n.prefix),i=t.name;Gl(e.type)||(e.type=Wl(e.type,t.prefix).name),Bc(e,{ns:t,name:i}),r[i]=e}),Bc(e,{ns:n,name:i,propertiesByName:r}),ms(e.extends,function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)},this),this.definePackage(e,t),this.typeMap[i]=e},V.prototype.mapTypes=function(e,t,n){function i(e){return r(e,!0)}function r(n,i){var r=Wl(n,Gl(n)?"":e.prefix);a.mapTypes(r,t,i)}var o=Gl(e.name)?{name:e.name}:this.typeMap[e.name],a=this;if(!o)throw new Error("unknown type <"+e.name+">");ms(o.superClass,n?i:r),t(o,!n),ms(o.traits,i)},V.prototype.getEffectiveDescriptor=function(e){var t=Wl(e),n=new Il(t);this.mapTypes(t,function(e,t){n.addTrait(e,t)});var i=n.build();return this.definePackage(i,i.allTypes[i.allTypes.length-1].$pkg),i},V.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};var Vl=Ol.parseName,Ul=q;q.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},q.prototype.getType=function(e){var t=this.typeCache,n=Cl(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},q.prototype.createAny=function(e,t,n){var i=Vl(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),ms(n,function(e,t){ka(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e}),r},q.prototype.getPackage=function(e){return this.registry.getPackage(e)},q.prototype.getPackages=function(){return this.registry.getPackages()},q.prototype.getElementDescriptor=function(e){return e.$descriptor},q.prototype.hasType=function(e,t){void 0===t&&(t=e,e=this);return t in e.$model.getElementDescriptor(e).allTypesByName},q.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},q.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var ql=Ul,Yl=function(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(Zl,Y):e},Kl=String.fromCharCode,Xl=Object.prototype.hasOwnProperty,Zl=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Ql={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};Object.keys(Ql).forEach(function(e){Ql[e.toUpperCase()]=Ql[e]});var Jl=ne,eu="http://www.w3.org/2001/XMLSchema-instance",tu="xsi",nu="xsi:type",iu={};!function(e){"use strict";function t(){this.data=[null],this.top=0}function n(){return new t}t.prototype.clear=function(){return this.data=[null],this.top=0,this},t.prototype.length=function(){return this.top},t.prototype.peek=function(){return this.data[this.top]},t.prototype.pop=function(){return this.top>0?(this.top--,this.data.pop()):void 0},t.prototype.push=function(e){return this.data[++this.top]=e,this},void 0!==iu?iu=n:e.stack=n}(this);var ru={},ou=Ol.parseName,au=Fl.coerceType,su=Fl.isSimple,cu=kl.XSI_TYPE,pu=kl.serializeAsType,lu=kl.hasLowerCaseAlias;ae.prototype.handleEnd=function(){},ae.prototype.handleText=function(){},ae.prototype.handleNode=function(){},(se.prototype=Object.create(ae.prototype)).handleNode=function(){return this},(ce.prototype=Object.create(ae.prototype)).handleText=function(e){this.body=(this.body||"")+e},(pe.prototype=Object.create(ce.prototype)).handleNode=function(e){if(this.element)throw re("expected no sub nodes");return this.element=this.createReference(e),this},pe.prototype.handleEnd=function(){this.element.id=this.body},pe.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},(le.prototype=Object.create(ce.prototype)).handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=au(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},(ue.prototype=Object.create(ce.prototype)).handleNode=function(e){var t=this,n=this.element;return n?t=this.handleChild(e):(n=this.element=this.createElement(e),this.context.addElement(n)),t},(he.prototype=Object.create(ue.prototype)).addReference=function(e){this.context.addReference(e)},he.prototype.handleEnd=function(){var e=this.body,t=this.element,n=oe(t).bodyProperty;n&&void 0!==e&&(e=au(n.type,e),t.set(n.name,e))},he.prototype.createElement=function(e){var t=e.attributes,n=this.type,i=oe(n),r=this.context,o=new n({});return ms(t,function(e,t){var n,a=i.propertiesByName[t];a&&a.isReference?a.isMany?(n=e.split(" "),ms(n,function(e){r.addReference({element:o,property:a.ns.name,id:e})})):r.addReference({element:o,property:a.ns.name,id:e}):(a&&(e=au(a.type,e)),o.set(t,e))}),o},he.prototype.getPropertyForNode=function(e){var t,n,i=e.name,r=ou(i),o=this.type,a=this.model,s=oe(o),c=r.name,p=s.propertiesByName[c];if(p)return pu(p)&&(t=e.attributes[cu])?(t=function(e,t){var n=ou(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,a),n=a.getType(t),Bc({},p,{effectiveType:oe(n).name})):p;var l=a.getPackage(r.prefix);if(l){if(t=ie(r,l),n=a.getType(t),p=Jp(s.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return Bc({},p,{effectiveType:oe(n).name})}else if(p=Jp(s.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return p;throw re("unrecognized element <"+r.name+">")},he.prototype.toString=function(){return"ElementDescriptor["+oe(this.type).name+"]"},he.prototype.valueHandler=function(e,t){return new le(e,t)},he.prototype.referenceHandler=function(e){return new pe(e,this.context)},he.prototype.handler=function(e){return"Element"===e?new fe(this.model,e,this.context):new he(this.model,e,this.context)},he.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,n=t.effectiveType||t.type,su(n))return this.valueHandler(t,i);var o=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==o&&(t.isMany?i.get(t.name).push(o):i.set(t.name,o),t.isReference?(Bc(o,{element:i}),this.context.addReference(o)):o.$parent=i),r},(de.prototype=Object.create(he.prototype)).createElement=function(e){var t=e.name,n=ou(t),i=this.model,r=this.type,o=i.getPackage(n.prefix),a=o&&ie(n,o)||t;if(!r.hasType(a))throw re("unexpected element <"+e.originalName+">");return he.prototype.createElement.call(this,e)},(fe.prototype=Object.create(ue.prototype)).createElement=function(e){var t=e.name,n=ou(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},fe.prototype.handleChild=function(e){var t=new fe(this.model,"Element",this.context).handleNode(e),n=this.element,i=t.element;return void 0!==i&&((n.$children=n.$children||[]).push(i),i.$parent=n),t},fe.prototype.handleText=function(e){this.body=this.body||""+e},fe.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},me.prototype.fromXML=function(e,t,n){function i(e,t,n){var i=t(),r=i.line,o=i.column,a=i.data;"<"===a.charAt(0)&&-1!==a.indexOf(" ")&&(a=a.slice(0,a.indexOf(" "))+">");var c="unparsable content "+(a?a+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+o+"\n\tnested error: "+e.message;if(n)return s.addWarning({message:c,error:e}),console.warn("could not parse node"),console.warn(e),!0;throw console.error("could not parse document"),console.error(e),re(c)}var r=t.rootHandler;t instanceof he?(r=t,t={}):"string"==typeof t?(r=this.handler(t),t={}):"string"==typeof r&&(r=this.handler(r));var o=this.model,a=this.lax,s=new function(e){Bc(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw re("expected element");var t,n=this.elementsById,i=oe(e).idProperty;if(i&&(t=e.get(i.name))){if(n[t])throw re("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}(Bc({},t,{rootHandler:r})),c=new Jl({proxy:!0}),p=new iu;r.context=s,p.push(r);var l=o.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{});c.ns(l).on("openTag",function(e,t,n,r){var o=e.attrs||{},s=Object.keys(o).reduce(function(e,n){var i=t(o[n]);return e[n]=i,e},{});!function(e,t){var n=p.peek();try{p.push(n.handleNode(e))}catch(e){i(e,t,a)&&p.push(new se)}}({name:e.name,originalName:e.originalName,attributes:s,ns:e.ns},r)}).on("closeTag",function(){p.pop().handleEnd()}).on("cdata",function(e){p.peek().handleText(e)}).on("text",function(e){(e=e.trim())&&p.peek().handleText(e)}).on("error",i).on("warn",function(e,t){return i(e,t,!0)}),Ml(function(){var t;try{c.parse(e),function(){var e,t,n=s.elementsById,i=s.references;for(e=0;t=i[e];e++){var r=t.element,o=n[t.id],a=oe(r).propertiesByName[t.property];if(o||s.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),a.isMany){var c=r.get(a.name),p=c.indexOf(t);-1===p&&(p=c.length),o?c[p]=o:c.splice(p,1)}else r.set(a.name,o)}}()}catch(e){t=e}var i=r.element;t||i||(t=re("failed to parse document as <"+r.type.$descriptor.name+">")),n(t,t?void 0:i,s)})},me.prototype.handler=function(e){return new de(this.model,e)},(ru=me).ElementHandler=he;var uu=Ol.parseName,hu=kl.hasLowerCaseAlias,du=kl.serializeAsType,fu=kl.serializeAsProperty,mu='\n',yu=/(<|>|'|"|&|\n\r|\n)/g,vu=kl.DEFAULT_NS_MAP,gu=kl.XSI_TYPE,bu={"\n":"10","\n\r":"10",'"':"34","'":"39","<":"60",">":"62","&":"38"};xe.prototype.build=function(e){return this.element=e,this},xe.prototype.serializeTo=function(e){e.appendIndent().append("<"+ve(this.ns)+">"+this.element.id+"").appendNewLine()},Ee.prototype.serializeValue=Ee.prototype.serializeTo=function(e){var t=this.escape;t&&e.append("")},Ee.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(yu)&&(this.escape=!0),this},ye(_e,Ee),_e.prototype.serializeTo=function(e){e.appendIndent().append("<"+ve(this.ns)+">"),this.serializeValue(e),e.append("").appendNewLine()},we.prototype.build=function(e){this.element=e;var t=this.parseNsAttributes(e);if(this.ns||(this.ns=this.nsTagName(e.$descriptor)),e.$descriptor.isGeneric)this.parseGeneric(e);else{var n=function(e){var t=e.$descriptor;return Xp(t.properties,function(t){var n=t.name;if(t.isVirtual)return!1;if(!e.hasOwnProperty(n))return!1;var i=e[n];return i!==t.default&&null!==i&&(!t.isMany||i.length)})}(e);this.parseAttributes(function(e){return Xp(e,function(e){return e.isAttr})}(n)),this.parseContainments(function(e){return Xp(e,function(e){return!e.isAttr})}(n)),this.parseGenericAttributes(e,t)}return this},we.prototype.nsTagName=function(e){return ge(this.logNamespaceUsed(e.ns),e)},we.prototype.nsPropertyTagName=function(e){return function(e,t){return Bc({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},we.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},we.prototype.nsAttributeName=function(e){var t;if(t=Cl(e)?uu(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.isLocalNs(n)?{localName:t.localName}:Bc({localName:t.localName},n)},we.prototype.parseGeneric=function(e){var t=this,n=this.body,i=this.attrs;ms(e,function(e,r){"$body"===r?n.push((new Ee).build({type:"String"},e)):"$children"===r?ms(e,function(e){n.push(new we(t).build(e))}):0!==r.indexOf("$")&&i.push({name:r,value:be(e)})})},we.prototype.parseNsAttributes=function(e){var t=this,n=e.$attrs,i=e.$model,r=[];return ms(n,function(e,n){var o,a=uu(n);"xmlns"===a.prefix&&(o={prefix:a.localName,uri:e}),a.prefix||"xmlns"!==a.localName||(o={uri:e}),o?i.getPackage(e)?t.logNamespace(o,!0):t.logNamespaceUsed(o):r.push({name:n,value:e})}),r},we.prototype.parseGenericAttributes=function(e,t){var n=this;ms(t,function(t){if(t.name!==gu)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}})},we.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;ms(e,function(e){var r=i.get(e.name),o=e.isReference,a=e.isMany,s=t.nsPropertyTagName(e);if(a||(r=[r]),e.isBody)n.push((new Ee).build(e,r[0]));else if(Fl.isSimple(e.type))ms(r,function(t){n.push(new _e(s).build(e,t))});else if(o)ms(r,function(e){n.push(new xe(t,s).build(e))});else{var c=du(e),p=fu(e);ms(r,function(e){var i;i=c?new Se(t,s):p?new we(t,s):new we(t),n.push(i.build(e))})}})},we.prototype.getNamespaces=function(){var e=this.namespaces,t=this.parent;return e||(e=this.namespaces=t?t.getNamespaces():{prefixMap:{},uriMap:{},used:{},wellknown:[],custom:[]}),e},we.prototype.logNamespace=function(e,t){var n=this.getNamespaces(),i=e.uri;return n.uriMap[i]||(n.uriMap[i]=e,t?n.wellknown.push(e):n.custom.push(e)),n.prefixMap[e.prefix]=i,e},we.prototype.logNamespaceUsed=function(e){var t,n,i,r=this.element.$model,o=this.getNamespaces(),a=e.prefix,s=e.uri;if(!a&&!s)return{localName:e.localName};if(i=vu[a]||r&&(r.getPackage(a)||{}).uri,!(s=s||i||o.prefixMap[a]))throw new Error("no namespace uri given for prefix <"+a+">");if(!(e=o.uriMap[s])){for(t=a,n=1;o.prefixMap[t];)t=a+"_"+n++;e=this.logNamespace({prefix:t,uri:s},i===s)}return o.used[e.uri]||(o.used[e.uri]=e),e},we.prototype.parseAttributes=function(e){var t=this,n=this.element;ms(e,function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];ms(i,function(e){r.push(e.id)}),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)})},we.prototype.addAttribute=function(e,t){var n=this.attrs;Cl(t)&&(t=be(t)),n.push({name:e,value:t})},we.prototype.serializeAttributes=function(e){var t=this.attrs;!this.parent&&(t=function(e){var t=[].concat(e.wellknown,e.custom);return Ip(Xp(t,function(t){return e.used[t.uri]}),function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}})}(this.namespaces).concat(t)),ms(t,function(t){e.append(" ").append(ve(t.name)).append('="').append(t.value).append('"')})},we.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Ee;e.appendIndent().append("<"+ve(this.ns)),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),ms(this.body,function(t){t.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("")),e.appendNewLine()},ye(Se,we),Se.prototype.build=function(e){var t=e.$descriptor;this.element=e,this.typeNs=this.nsTagName(t);var n=this.typeNs,i=e.$model.getPackage(n.uri),r=i.xml&&i.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(gu),(n.prefix?n.prefix+":":"")+r+t.ns.localName),we.prototype.build.call(this,e)},Se.prototype.isLocalNs=function(e){return e.uri===this.typeNs.uri};var xu=function(e){return e=Bc({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new function(){this.value="",this.write=function(e){this.value+=e}},r=new function(e,t){var n=[""];this.append=function(t){return e.write(t),this},this.appendNewLine=function(){return t&&e.write("\n"),this},this.appendIndent=function(){return t&&e.write(n.join(" ")),this},this.indent=function(){return n.push(""),this},this.unindent=function(){return n.pop(),this}}(i,e.format);if(e.preamble&&r.append(mu),(new we).build(t).serializeTo(r),!n)return i.value}}},Eu=Ae;(Ae.prototype=Object.create(ql.prototype)).fromXML=function(e,t,n,i){Cl(t)||(i=n,n=t,t="bpmn:Definitions"),La(n)&&(i=n,n={});var r=new ru(Bc({model:this,lax:!0},n)),o=r.handler(t);r.fromXML(e,o,i)},Ae.prototype.toXML=function(e,t,n){La(t)&&(n=t,t={});var i=new xu(t);try{n(null,i.toXML(e))}catch(e){n(e)}};var _u={bpmn:{name:"BPMN20",uri:"http://www.omg.org/spec/BPMN/20100524/MODEL",associations:[],types:[{name:"Interface",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"operations",type:"Operation",isMany:!0},{name:"implementationRef",type:"String",isAttr:!0}]},{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",type:"String",isAttr:!0}]},{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",type:"LaneSet",isMany:!0,replaces:"FlowElementsContainer#laneSets"},{name:"flowElements",type:"FlowElement",isMany:!0,replaces:"FlowElementsContainer#flowElements"},{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"},{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:"assignment",type:"Assignment",isMany:!0},{name:"sourceRef",type:"ItemAwareElement",isMany:!0,isReference:!0},{name:"targetRef",type:"ItemAwareElement",isReference:!0},{name:"transformation",type:"FormalExpression",xml:{serialize:"property"}}]},{name:"DataInput",superClass:["ItemAwareElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isCollection",default:!1,isAttr:!0,type:"Boolean"},{name:"inputSetRef",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"inputSetWithOptional",type:"InputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"inputSetWithWhileExecuting",type:"InputSet",isVirtual:!0,isMany:!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",isVirtual:!0,isMany:!0,isReference:!0},{name:"outputSetWithOptional",type:"OutputSet",isVirtual:!0,isMany:!0,isReference:!0},{name:"outputSetWithWhileExecuting",type:"OutputSet",isVirtual:!0,isMany:!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:"participantRefs",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",type:"String",isBody:!0}]},{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",type:"String",isAttr:!0},{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",isVirtual:!0,isMany:!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",isVirtual:!0,isMany:!0,isReference:!0},{name:"outgoingConversationLinks",type:"ConversationLink",isVirtual:!0,isMany:!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"}]},{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:"participantRefs",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:["FlowElementsContainer","Collaboration"]},{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",isVirtual:!0,isMany:!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:"Expression",xml:{serialize:"xsi:type"}}]},{name:"CallActivity",superClass:["Activity"],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}]},{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"}]}],prefix:"bpmn",xml:{tagAlias:"lowerCase",typePrefix:"t"}},bpmndi:{name:"BPMNDI",uri:"http://www.omg.org/spec/BPMN/20100524/DI",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:[],prefix:"bpmndi"},dc:{name:"DC",uri:"http://www.omg.org/spec/DD/20100524/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}]}],prefix:"dc",associations:[]},di:{name:"DI",uri:"http://www.omg.org/spec/DD/20100524/DI",types:[{name:"DiagramElement",isAbstract:!0,properties:[{name:"id",type:"String",isAttr:!0,isId:!0},{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,isVirtual:!0,isMany:!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",type:"String",isAttr:!0,isId:!0},{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,isVirtual:!0,isMany:!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",isVirtual:!0,isMany:!0}]},{name:"LabeledShape",isAbstract:!0,superClass:["Shape"],properties:[{name:"ownedLabel",type:"Label",isReadOnly:!0,subsettedProperty:"DiagramElement-ownedElement",isVirtual:!0,isMany:!0}]},{name:"Label",isAbstract:!0,superClass:["Node"],properties:[{name:"bounds",type:"dc:Bounds"}]},{name:"Style",isAbstract:!0,properties:[{name:"id",type:"String",isAttr:!0,isId:!0}]},{name:"Extension",properties:[{name:"values",type:"Element",isMany:!0}]}],associations:[],prefix:"di",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:[]}},wu=function(e,t){return new Eu(Bc({},_u,e),t)},Su={};Su.remove=function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n},Su.add=function(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}},Su.indexOf=function(e,t){return e&&t?e.indexOf(t):-1};var Au=function(e,t){return function(n,i,r){var o=t?t():{};if(i=Ec(i,r,3),rs(n))for(var a=-1,s=n.length;++at.x&&(n[e.id]=e),!Mu(t.x)&&i.y>t.y&&(n[e.id]=e),i.x>t.x&&i.y>t.y&&(Mu(t.width)&&Mu(t.height)&&i.width+i.xt?i(d,c):h=setTimeout(r,e)}function o(){i(y,h)}function a(){if(s=arguments,l=Bu(),u=this,d=y&&(h||!v),!1===m)var n=v&&!h;else{c||v||(f=l);var i=m-(l-f),a=i<=0||i>m;a?(c&&(c=clearTimeout(c)),f=l,p=e.apply(u,s)):c||(c=setTimeout(o,i))}return a&&h?h=clearTimeout(h):h||t===m||(h=setTimeout(r,t)),n&&(a=!0,p=e.apply(u,s)),!a||h||c||(s=u=void 0),p}var s,c,p,l,u,h,d,f=0,m=!1,y=!0;if("function"!=typeof e)throw new TypeError(Du);if(t=t<0?0:+t||0,!0===n){var v=!0;y=!1}else ka(n)&&(v=!!n.leading,m="maxWait"in n&&Nu(+n.maxWait||0,t),y="trailing"in n?!!n.trailing:y);return a.cancel=function(){h&&clearTimeout(h),c&&clearTimeout(c),f=0,c=h=d=void 0},a},ju=Ps.createMatrix,Lu={shape:["x","y","width","height"],connection:["waypoints"]};De.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];var Iu=De;De.prototype._init=function(e){var t=this._eventBus,n=this._container=function(e){var t=(e=Bc({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),Bc(n.style,{position:"relative",overflow:"hidden",width:ke(e.width),height:ke(e.height)}),t.appendChild(n),n}(e),i=this._svg=Cs("svg");Es(i,{width:"100%",height:"100%"}),Xc(n,i);var r=this._viewport=Be(i,"viewport");this._layers={},!1!==e.deferUpdate&&(this._viewboxChanged=Ou(this._viewboxChanged,300)),t.on("diagram.init",function(){t.fire("canvas.init",{svg:i,viewport:r}),this.resized()},this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},De.prototype._destroy=function(e){this._eventBus.fire("canvas.destroy",{svg:this._svg,viewport:this._viewport});var t=this._container.parentNode;t&&t.removeChild(this._container),delete this._svg,delete this._container,delete this._layers,delete this._rootElement,delete this._viewport},De.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=ku.getType(t);"root"===n?e.setRootElement(null,!0):e._removeElement(t,n)}),delete this._cachedViewbox},De.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},De.prototype.getLayer=function(e,t){if(!e)throw new Error("must specify a name");var n=this._layers[e];if(n||(n=this._layers[e]=this._createLayer(e,t)),void 0!==t&&n.index!==t)throw new Error("layer <"+e+"> already created at index <"+t+">");return n.group},De.prototype._createLayer=function(e,t){t||(t=0);var n=wc(this._layers,function(e,n){return t>=n.index&&e++,e},0);return{group:Be(this._viewport,"layer-"+e,n),index:t}},De.prototype.getContainer=function(){return this._container},De.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(ms([i.gfx,i.secondaryGfx],function(e){e&&(n?hp(e).add(t):hp(e).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},De.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},De.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},De.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));var n=this.getGraphics(e);return hp(n).has(t)},De.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},De.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},De.prototype.setRootElement=function(e,t){e&&this._ensureValid("root",e);var n=this._rootElement,i=this._elementRegistry,r=this._eventBus;if(n){if(!t)throw new Error("rootElement already set, need to specify override");r.fire("root.remove",{element:n}),r.fire("root.removed",{element:n}),i.remove(n)}if(e){var o=this.getDefaultLayer();r.fire("root.add",{element:e}),i.add(e,o,this._svg),r.fire("root.added",{element:e,gfx:o})}return this._rootElement=e,e},De.prototype._ensureValid=function(e,t){if(!t.id)throw new Error("element must have an id");if(this._elementRegistry.get(t.id))throw new Error("element with id "+t.id+" already exists");var n=Lu[e];if(!sp(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},De.prototype._setParent=function(e,t,n){Su.add(t.children,e,n),e.parent=t},De.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var r=this._eventBus,o=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);var a=o.create(e,t);return this._elementRegistry.add(t,a),o.update(e,t,a),r.fire(e+".added",{element:t,gfx:a}),t},De.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},De.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},De.prototype._removeElement=function(e,t){var n=this._elementRegistry,i=this._graphicsFactory,r=this._eventBus;if(e=n.get(e.id||e))return r.fire(t+".remove",{element:e}),i.remove(e),Su.remove(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},De.prototype.removeShape=function(e){return this._removeElement(e,"shape")},De.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},De.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},De.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},De.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},De.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,o,a=this._viewport,s=this.getSize();if(!e){t=this.getDefaultLayer().getBBox();var c=ks(a);return n=c?c.matrix:ju(),i=Me(n.a,1e3),r=Me(-n.e||0,1e3),o=Me(-n.f||0,1e3),e=this._cachedViewbox={x:r?r/i:0,y:o?o/i:0,width:s.width/i,height:s.height/i,scale:i,inner:{width:t.width,height:t.height,x:t.x,y:t.y},outer:s}}return this._changeViewbox(function(){i=Math.min(s.width/e.width,s.height/e.height);var t=this._svg.createSVGMatrix().scale(i).translate(-e.x,-e.y);ks(a,t)}),e},De.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=Bc({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Ne(t,n)}),{x:n.e,y:n.f}},De.prototype.zoom=function(e,t){if(!e)return this.viewbox(e).scale;if("fit-viewport"===e)return this._fitViewport(t);var n,i;return this._changeViewbox(function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)}),Me(i.a,1e3)},De.prototype._fitViewport=function(e){var t,n,i=this.viewbox(),r=i.outer,o=i.inner;return o.x>=0&&o.y>=0&&o.x+o.width<=r.width&&o.y+o.height<=r.height&&!e?n={x:0,y:0,width:Math.max(o.width+o.x,r.width),height:Math.max(o.height+o.y,r.height)}:(t=Math.min(1,r.width/o.width,r.height/o.height),n={x:o.x+(e?o.width/2-r.width/t/2:0),y:o.y+(e?o.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},De.prototype._setZoom=function(e,t){var n,i,r,o,a=this._svg,s=this._viewport,c=a.createSVGMatrix(),p=a.createSVGPoint(),l=(i=s.getCTM()).a;return t?(n=Bc(p,t).matrixTransform(i.inverse()),r=c.translate(n.x,n.y).scale(1/l*e).translate(-n.x,-n.y),o=i.multiply(r)):o=c.scale(e),Ne(this._viewport,o),o},De.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},De.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();if(e.waypoints){t=this.getGraphics(e).getBBox()}else t=e;return{x:t.x*n.scale-n.x*n.scale,y:t.y*n.scale-n.y*n.scale,width:t.width*n.scale,height:t.height*n.scale}},De.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Fu={},zu=new tl({name:"children",enumerable:!0,collection:!0},{name:"parent"}),$u=new tl({name:"label",enumerable:!0},{name:"labelTarget"}),Wu=new tl({name:"attachers",collection:!0},{name:"host"}),Gu=new tl({name:"outgoing",collection:!0},{name:"source"}),Hu=new tl({name:"incoming",collection:!0},{name:"target"});rp(je,Oe),rp(Le,je),rp(Ie,je),rp(Fe,Oe);var Vu={connection:Fe,shape:je,label:Ie,root:Le};Fu.create=function(e,t){var n=Vu[e];if(!n)throw new Error("unknown type: <"+e+">");return Bc(new n,t)},Fu.Base=Oe,Fu.Label=Ie;var Uu=ze;ze.prototype.createRoot=function(e){return this.create("root",e)},ze.prototype.createLabel=function(e){return this.create("label",e)},ze.prototype.createShape=function(e){return this.create("shape",e)},ze.prototype.createConnection=function(e){return this.create("connection",e)},ze.prototype.create=function(e,t){return(t=Bc({},t||{})).id||(t.id=e+"_"+this._uid++),Fu.create(e,t)};var qu="data-element-id";$e.$inject=["eventBus"];var Yu=$e;$e.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),Es(t,qu,i),n&&Es(n,qu,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},$e.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(Es(i.gfx,qu,""),i.secondaryGfx&&Es(i.secondaryGfx,qu,""),delete t[n])},$e.prototype.updateId=function(e,t){this._validateId(t),"string"==typeof e&&(e=this.get(e)),this._eventBus.fire("element.updateId",{element:e,newId:t});var n=this.getGraphics(e),i=this.getGraphics(e,!0);this.remove(e),e.id=t,this.add(e,n,i)},$e.prototype.get=function(e){var t;t="string"==typeof e?e:e&&Es(e,qu);var n=this._elements[t];return n&&n.element},$e.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},$e.prototype.getAll=function(){return this.filter(function(e){return e})},$e.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n],r=i.element,o=i.gfx;return e(r,o)})},$e.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},$e.prototype._validateId=function(e){if(!e)throw new Error("element must have an id");if(this._elements[e])throw new Error("element with id "+e+" already added")};var Ku={};(function(e){var t=Ha(e,"WeakMap"),n=t&&new t;Ku=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Xu=Ku?function(e,t){return Ku.set(e,t),e}:ds,Zu=function(){function e(){}return function(t){if(ka(t)){e.prototype=t;var n=new e;e.prototype=void 0}return n||{}}}(),Qu=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Zu(e.prototype),i=e.apply(n,t);return ka(i)?i:n}},Ju={};(function(e){Ju=function(t,n){function i(){return(this&&this!==e&&this instanceof i?r:t).apply(n,arguments)}var r=Qu(t);return i}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var eh=Math.max,th=function(e,t,n){for(var i=n.length,r=-1,o=eh(e.length-i,0),a=-1,s=t.length,c=Array(s+o);++a0){if(++e>=150)return n}else e=0;return Xu(n,i)}}(),xh={};(function(e){function t(u,h,d,f,m,y,v,g,b,x){function E(){for(var r=arguments.length,o=r,a=Array(r);o--;)a[o]=arguments[o];if(f&&(a=th(a,f,m)),y&&(a=ih(a,y,v)),A||C){var p=E.placeholder,P=gh(a,p);if((r-=P.length) ");return n.length=0,new Error(t?e+" (Resolving: "+t+")":e)},s=function(e,o){if(!i[e]&&-1!==e.indexOf(".")){for(var c=e.split("."),p=s(c.shift());c.length;)p=p[c.shift()];return p}if(Object.hasOwnProperty.call(r,e))return r[e];if(Object.hasOwnProperty.call(i,e)){if(-1!==n.indexOf(e))throw n.push(e),a("Cannot resolve circular dependency!");return n.push(e),r[e]=i[e][0](i[e][1]),n.pop(),r[e]}return t.get(e,o)},c=function(e){var t=Object.create(e.prototype),n=p(e,t);return"object"==typeof n?n:t},p=function(e,t){if("function"!=typeof e){if(!nd(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=td(e.slice())}var n=(e.$inject&&e.$inject||ed(e)).map(function(e){return s(e)});return e.apply(t,n)},l=function(e){return td(function(t){return e.get(t)})},u={factory:p,type:c,value:function(e){return e}};e.forEach(function(e){function t(e,t){return"value"!==e&&nd(t)&&(t=td(t.slice())),t}if(e instanceof Jh)e.forEach(function(e){var n=e[0],r=e[1],o=e[2];i[n]=[u[r],t(r,o),r]});else if("object"==typeof e)if(e.__exports__){var n=Object.keys(e).reduce(function(t,n){return"__"!==n.substring(0,2)&&(t[n]=e[n]),t},Object.create(null)),r=new id((e.__modules__||[]).concat([n]),o),a=td(function(e){return r.get(e)});e.__exports__.forEach(function(e){i[e]=[a,e,"private",r]})}else Object.keys(e).forEach(function(n){if("private"!==e[n][2]){var r=e[n][0],o=e[n][1];i[n]=[u[r],t(r,o),r]}else i[n]=e[n]})}),this.get=s,this.invoke=p,this.instantiate=c,this.createChild=function(e,t){if(t&&t.length){var n,r,a,s,c=Object.create(null),p=Object.create(null),u=[],h=[],d=[];for(var f in i)n=i[f],-1!==t.indexOf(f)&&("private"===n[2]?-1===(r=u.indexOf(n[3]))?(a=n[3].createChild([],t),s=l(a),u.push(n[3]),h.push(a),d.push(s),c[f]=[s,f,"private",a]):c[f]=[d[r],f,"private",h[r]]:c[f]=[n[2],n[1]],p[f]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach(function(e){-1!==n[1].$scope.indexOf(e)&&(c[f]=[n[2],n[1]],p[e]=!0)});t.forEach(function(e){if(!p[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(c)}return new id(e,o)}},rd={Injector:id},od=Xe;Xe.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Xe.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var ad=od,sd=Ze;Ze.prototype.next=function(){return this._prefix+ ++this._counter};var cd=function(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)},pd=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},it.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";tt(this._overlayRoot,n)},it.prototype._getOverlayContainer=function(e,t){var n=Jp(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},it.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),Cl(o)&&(o=El(o)),n=this._getOverlayContainer(r),(t=El('
')).appendChild(o),e.type&&hd(t).add("djs-overlay-"+e.type),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},it.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=n&&n.minZoom,r=n&&n.maxZoom,o=e.htmlContainer,a=!0;n&&((nt(i)&&i>t.scale||nt(r)&&ri&&(r=(1/t.scale||1)*i)),nt(r)&&(s="scale("+r+","+r+")"),tt(a,s)},it.prototype._updateOverlaysVisibilty=function(e){var t=this;ms(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},it.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",function(e){t.hide()}),e.on("canvas.viewbox.changed",function(e){!function(e){t._updateRoot(e),t._updateOverlaysVisibilty(e),t.show()}(e.viewbox)}),e.on(["shape.remove","connection.remove"],function(e){var n=e.element,i=t.get({element:n});ms(i,function(e){t.remove(e.id)});var r=t._getOverlayContainer(n);if(r){dd(r.html);var o=t._overlayContainers.indexOf(r);-1!==o&&t._overlayContainers.splice(o,1)}}),e.on("element.changed",500,function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(ms(i.overlays,function(e){t._updateOverlay(e)}),t._updateOverlayContainer(i))}),e.on("element.marker.update",function(e){var n=t._getOverlayContainer(e.element,!0);n&&hd(n.html)[e.add?"add":"remove"](e.marker)}),e.on("diagram.clear",this.clear,this)};var vd={__init__:["overlays"],overlays:["type",yd]},gd={};gd.getOriginal=at,gd.stopEvent=function(e,t){ct(e,t),st(e)},gd.preventDefault=st,gd.toPoint=function(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null};var bd={};bd.isMac=function(){return/mac/i.test(navigator.platform)};var xd={},Ed=gd.getOriginal,_d=bd.isMac;xd.isPrimaryButton=pt,xd.hasPrimaryModifier=function(e){var t=Ed(e)||e;return!!pt(e)&&(_d()?t.metaKey:t.ctrlKey)},xd.hasSecondaryModifier=function(e){var t=Ed(e)||e;return pt(e)&&t.shiftKey};var wd=xd.isPrimaryButton,Sd=Rs.createLine,Ad=Rs.updateLine,Td=500;lt.$inject=["eventBus","elementRegistry","styles"];var Cd={__init__:["interactionEvents"],interactionEvents:["type",lt]},Rd=ku.getBBox,Pd=500;ut.prototype.updateShapeOutline=function(e,t){Es(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},ut.prototype.updateConnectionOutline=function(e,t){var n=Rd(t);Es(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},ut.$inject=["eventBus","styles","elementRegistry"];var Md={__init__:["outline"],outline:["type",ut]};ht.$inject=["eventBus"];var kd=ht;ht.prototype.deselect=function(e){var t=this._selectedElements,n=t.indexOf(e);if(-1!==n){var i=t.slice();t.splice(n,1),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:t})}},ht.prototype.get=function(){return this._selectedElements},ht.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},ht.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();rs(e)||(e=e?[e]:[]),t?ms(e,function(e){-1===n.indexOf(e)&&n.push(e)}):this._selectedElements=n=e.slice(),this._eventBus.fire("selection.changed",{oldSelection:i,newSelection:n})};var Bd=xd.hasPrimaryModifier;dt.$inject=["eventBus","selection","canvas","elementRegistry"];var Dd=dt,Nd="hover",Od="selected";ft.$inject=["eventBus","canvas","selection","styles"];var jd={__init__:["selectionVisuals","selectionBehavior"],__depends__:[Cd,Md],selection:["type",kd],selectionVisuals:["type",ft],selectionBehavior:["type",Dd]},Ld=function(e,t,n){for(var i=e.length,r=t+(n?0:-1);n?r--:++r=Gd?Wd(t):null,c=t.length;s&&(o=Fd,a=!1,t=s);e:for(;++r]{1})/g,Xd=/([\n\r"]{1})/g,Zd={"&":"&","<":"<",">":">",'"':"'"},Qd=vt,Jd={width:"100%",height:"100%",position:"relative"};rp(bt,ad);var ef=bt;bt.prototype.importXML=function(e,t){t=t||function(){};var n=this;e=this._emit("import.parse.start",{xml:e})||e,this._moddle.fromXML(e,"bpmn:Definitions",function(e,i,r){i=n._emit("import.parse.complete",{error:e,definitions:i,context:r})||i;var o=r.warnings;if(e)return e=function(e){var t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);return t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]),e}(e),n._emit("import.done",{error:e,warnings:o}),t(e,o);n.importDefinitions(i,function(e,i){var r=[].concat(o,i||[]);n._emit("import.done",{error:e,warnings:r}),t(e,r)})})},bt.prototype.saveXML=function(e,t){t||(t=e,e={});var n=this._definitions;if(!n)return t(new Error("no definitions loaded"));this._moddle.toXML(n,e,t)},bt.prototype.saveSVG=function(e,t){t||(t=e,e={});var n=this.get("canvas"),i=n.getDefaultLayer(),r=up("defs",n._svg),o=Qd(i),a=r?""+Qd(r)+"":"",s=i.getBBox();t(null,'\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n\n'+a+o+"")},bt.prototype.importDefinitions=function(e,t){try{this._definitions&&this.clear(),this._definitions=e,ol.importBpmnDiagram(this,e,t)}catch(e){t(e)}},bt.prototype.getModules=function(){return this._modules},bt.prototype.destroy=function(){ad.prototype.destroy.call(this),dd(this._container)},bt.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},bt.prototype.off=function(e,t){this.get("eventBus").off(e,t)},bt.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=up(e)),e.appendChild(this._container),this._emit("attach",{})},bt.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},bt.prototype._init=function(e,t,n){var i=n.modules||this.getModules(),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=Bc(Vd(n,"additionalModules"),{canvas:Bc({},n.canvas,{container:e}),modules:o});ad.call(this,a),n&&n.container&&this.attachTo(n.container)},bt.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},bt.prototype._createContainer=function(e){var t=El('
');return Bc(t.style,{width:gt(e.width),height:gt(e.height),position:e.position}),t},bt.prototype._createModdle=function(e){var t=Bc({},this._moddleExtensions,e.moddleExtensions);return new wu(t)},bt.prototype._modules=[qp,Up,jd,vd],bt.prototype._moddleExtensions={};var tf={},nf=gd.stopEvent;tf.install=function(){return Et(!0),function(){Et(!1)}};var rf={},of=/^djs-cursor-.*$/;rf.set=function(e){var t=hd(document.body);t.removeMatching(of),e&&t.add("djs-cursor-"+e)},rf.unset=function(){this.set(null)};var af={};af.log10=function(e){return Math.log(e)/Math.log(10)},af.substract=function(e,t){return{x:e.x-t.x,y:e.y-t.y}};var sf=pl,cf=af.substract,pf=15;_t.$inject=["eventBus","canvas"];var lf={__init__:["moveCanvas"],moveCanvas:["type",_t]},uf={},hf=af.log10;uf.getStepSize=function(e,t){var n=hf(e.min),i=hf(e.max);return(Math.abs(n)+Math.abs(i))/t},uf.cap=function(e,t){return Math.max(e.min,Math.min(e.max,t))};var df=xd.hasPrimaryModifier,ff=xd.hasSecondaryModifier,mf=bd.isMac,yf=uf.getStepSize,vf=uf.cap,gf=af.log10,bf={min:.2,max:4};wt.$inject=["eventBus","canvas","config.zoomScroll"];var xf=wt;wt.prototype.scroll=function(e){this._canvas.scroll(e)},wt.prototype.reset=function(){this._canvas.zoom("fit-viewport")},wt.prototype.zoom=function(e,t){var n=yf(bf,20);this.totalDelta+=e,Math.abs(this.totalDelta)>.1&&(this._zoom(e,t,n),this.totalDelta=0)},wt.prototype._handleWheel=function(e){if(!sf(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=df(e),r=ff(e);if(i||r){n=mf?0===e.deltaMode?1.25:50:0===e.deltaMode?.025:.5;var o={};r?o.dx=n*(e.deltaX||e.deltaY):o.dy=n*e.deltaY,this.scroll(o)}else{n=0===e.deltaMode?.025:.5;var a=t.getBoundingClientRect(),s={x:e.clientX-a.left,y:e.clientY-a.top};this.zoom(e.deltaY*n/-5,s)}}},wt.prototype.stepZoom=function(e,t){var n=yf(bf,10);this._zoom(e,t,n)},wt.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=gf(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s=Math.pow(10,a);i.zoom(vf(bf,s),t)},wt.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&Ud[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},wt.prototype._init=function(e){this.toggle(e)};var Ef={__init__:["zoomScroll"],zoomScroll:["type",xf]};rp(St,ef);var _f=St;St.prototype._navigationModules=[Ef,lf],St.prototype._modules=[].concat(St.prototype._modules,St.prototype._navigationModules);At.$inject=["eventBus"];var wf=At;At.prototype.on=function(e,t,n,i,r,o){if((La(t)||Mu(t))&&(o=r,r=i,i=n,n=t,t=null),La(n)&&(o=r,r=i,i=n,n=1e3),function(e){return"object"==typeof e}(r)&&(o=r,r=!1),!La(i))throw new Error("handlerFn must be a function");rs(e)||(e=[e]);var a=this._eventBus;ms(e,function(e){var s=["commandStack",e,t].filter(function(e){return e}).join(".");a.on(s,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)})};ms(["canExecute","preExecute","preExecuted","execute","executed","postExecute","postExecuted","revert","reverted"],function(e){At.prototype[e]=function(t,n,i,r,o){(La(t)||Mu(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}});var Sf={};Sf.pointDistance=Tt,Sf.pointsOnLine=function(e,t,n){if(!e||!t||!n)return!1;var i=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),r=Tt(e,t);return Math.abs(i/r)<5};var Af=2;Sf.pointsAligned=function(e,t){return Math.abs(e.x-t.x)<=Af?"h":Math.abs(e.y-t.y)<=Af&&"v"},Sf.pointInRect=function(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.xt&&!o||!r||n&&!a&&s||i&&s)return 1;if(e=r.right,s=i.top-n.y>=r.bottom,c=i.right+n.x<=r.left,p=o?"top":s?"bottom":null,l=c?"left":a?"right":null;return l&&p?p+"-"+l:l||p||"intersect"},Hf.getElementLineIntersection=function(e,t,n){var i=on(e,t);return 1===i.length?nn(i[0]):2===i.length&&Vf(i[0],i[1])<1?nn(i[0]):i.length>1?(i=Gf(i,function(e){var t=Math.floor(100*e.t2)||1;return t=100-t,t=(t<10?"0":"")+t,e.segment2+"#"+t}),nn(i[n?0:i.length-1])):null};var qf=function(e,t,n){var i=e?e.length:0;return n&&Mc(e,t,n)&&(t=!1),i?Hc(e,t):[]},Yf=function(e,t){for(var n=-1,i=t.length,r=Array(i);++n=120&&Bc(f,{"lane-divide-two":{group:"lane-divide",className:"bpmn-icon-lane-divide-two",title:d("Divide into two Lanes"),action:{click:r(2)}}}),e.height>=180&&Bc(f,{"lane-divide-three":{group:"lane-divide",className:"bpmn-icon-lane-divide-three",title:d("Divide into three Lanes"),action:{click:r(3)}}})),Bc(f,{"lane-insert-below":{group:"lane-insert-below",className:"bpmn-icon-lane-insert-below",title:d("Add Lane below"),action:{click:function(e,t){a.addLane(t,"bottom")}}}})}Am(m,"bpmn:FlowNode")&&(Am(m,"bpmn:EventBasedGateway")?Bc(f,{"append.receive-task":i("bpmn:ReceiveTask","bpmn-icon-receive-task"),"append.message-intermediate-event":i("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-message",{eventDefinitionType:"bpmn:MessageEventDefinition"}),"append.timer-intermediate-event":i("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-timer",{eventDefinitionType:"bpmn:TimerEventDefinition"}),"append.condtion-intermediate-event":i("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-condition",{eventDefinitionType:"bpmn:ConditionalEventDefinition"}),"append.signal-intermediate-event":i("bpmn:IntermediateCatchEvent","bpmn-icon-intermediate-event-catch-signal",{eventDefinitionType:"bpmn:SignalEventDefinition"})}):En(m,"bpmn:BoundaryEvent","bpmn:CompensateEventDefinition")?Bc(f,{"append.compensation-activity":i("bpmn:Task","bpmn-icon-task",d("Append compensation activity"),{isForCompensation:!0})}):Am(m,"bpmn:EndEvent")||m.isForCompensation||En(m,"bpmn:IntermediateThrowEvent","bpmn:LinkEventDefinition")||Pm(m)||Bc(f,{"append.end-event":i("bpmn:EndEvent","bpmn-icon-end-event-none"),"append.gateway":i("bpmn:ExclusiveGateway","bpmn-icon-gateway-xor"),"append.append-task":i("bpmn:Task","bpmn-icon-task"),"append.intermediate-event":i("bpmn:IntermediateThrowEvent","bpmn-icon-intermediate-event-none")}));var v;l._providers["bpmn-replace"]&&(v=l.create("bpmn-replace",e)),v&&!v.isEmpty()&&Bc(f,{replace:{group:"edit",className:"bpmn-icon-screw-wrench",title:d("Change type"),action:{click:function(e,t){v.open(Bc(function(e){var t=u.getContainer(),n=o.getPad(e).html,i=t.getBoundingClientRect(),r=n.getBoundingClientRect(),a=r.top-i.top;return{x:r.left-i.left,y:a+r.height+5}}(t),{cursor:{x:e.x,y:e.y}}),t)}}}}),Cm(m,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Bc(f,{"append.text-annotation":i("bpmn:TextAnnotation","bpmn-icon-text-annotation"),connect:{group:"connect",className:"bpmn-icon-connection-multi",title:d("Connect using "+(m.isForCompensation?"":"Sequence/MessageFlow or ")+"Association"),action:{click:t,dragstart:t}}}),Cm(m,["bpmn:DataObjectReference","bpmn:DataStoreReference"])&&Bc(f,{connect:{group:"connect",className:"bpmn-icon-connection-multi",title:d("Connect using DataInputAssociation"),action:{click:t,dragstart:t}}});var g=h.allowed("elements.delete",{elements:[e]});return rs(g)&&(g=g[0]===e),g&&Bc(f,{delete:{group:"edit",className:"bpmn-icon-trash",title:d("Remove"),action:{click:n,dragstart:n}}}),f};var Bm={},Dm=Pa.getBusinessObject,Nm=ys.isExpanded;Bm.isDifferentType=function(e){return function(t){var n=t.target,i=Dm(e),r=i.eventDefinitions&&i.eventDefinitions[0],o=i.$type===n.type,a=(r&&r.$type)===n.eventDefinitionType,s=i.triggeredByEvent===n.triggeredByEvent,c=void 0===n.isExpanded||n.isExpanded===Nm(i);return!(o&&a&&s&&c)}};var Om={};Om.START_EVENT=[{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"}}],Om.INTERMEDIATE_EVENT=[{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"}},{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"}},{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"}}],Om.END_EVENT=[{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"}}],Om.GATEWAY=[{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"}}],Om.SUBPROCESS_EXPANDED=[{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}}],Om.TRANSACTION=[{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}}],Om.EVENT_SUB_PROCESS=[{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}}],Om.TASK=[{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}}],Om.BOUNDARY_EVENT=[{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}}],Om.EVENT_SUB_PROCESS_START_EVENT=[{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}}],Om.SEQUENCE_FLOW=[{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"}],Om.PARTICIPANT=[{label:"Expanded Pool",actionName:"replace-with-expanded-pool",className:"bpmn-icon-participant",target:{type:"bpmn:Participant",isExpanded:!0}},{label:"Collapsed Pool",actionName:"replace-with-collapsed-pool",className:"bpmn-icon-lane",target:{type:"bpmn:Participant",isExpanded:!1}}];var jm=function(e,t,n){var i=rs(e)?Yp:Kp;return t=Ec(t,n,3),i(e,function(e,n,i){return!t(e,n,i)})},Lm=Pa.is,Im=ys.isEventSubProcess,Fm=Pa.getBusinessObject,zm=ys.isExpanded,$m=Bm.isDifferentType;_n.$inject=["popupMenu","modeling","moddle","bpmnReplace","rules","translate"],_n.prototype.register=function(){this._popupMenu.registerProvider("bpmn-replace",this)},_n.prototype.getEntries=function(e){var t,n=e.businessObject;if(!this._rules.allowed("shape.replace",{element:e}))return[];var i=$m(e);return Lm(n,"bpmn:StartEvent")&&!Im(n.$parent)?(t=Xp(Om.START_EVENT,i),this._createEntries(e,t)):Lm(n,"bpmn:Participant")?(t=Xp(Om.PARTICIPANT,function(e){return zm(n)!==e.target.isExpanded}),this._createEntries(e,t)):Lm(n,"bpmn:StartEvent")&&Im(n.$parent)?(t=Xp(Om.EVENT_SUB_PROCESS_START_EVENT,function(t){var n=!1!==t.target.isInterrupting,r=Fm(e).isInterrupting===n;return i(t)||!i(t)&&!r}),this._createEntries(e,t)):Lm(n,"bpmn:EndEvent")?(t=Xp(Om.END_EVENT,function(e){return!("bpmn:CancelEventDefinition"==e.target.eventDefinitionType&&!Lm(n.$parent,"bpmn:Transaction"))&&i(e)}),this._createEntries(e,t)):Lm(n,"bpmn:BoundaryEvent")?(t=Xp(Om.BOUNDARY_EVENT,function(e){var t=e.target;if("bpmn:CancelEventDefinition"==t.eventDefinition&&!Lm(n.attachedToRef,"bpmn:Transaction"))return!1;var r=!1!==t.cancelActivity,o=n.cancelActivity==r;return i(e)||!i(e)&&!o}),this._createEntries(e,t)):Lm(n,"bpmn:IntermediateCatchEvent")||Lm(n,"bpmn:IntermediateThrowEvent")?(t=Xp(Om.INTERMEDIATE_EVENT,i),this._createEntries(e,t)):Lm(n,"bpmn:Gateway")?(t=Xp(Om.GATEWAY,i),this._createEntries(e,t)):Lm(n,"bpmn:Transaction")?(t=Xp(Om.TRANSACTION,i),this._createEntries(e,t)):Im(n)&&zm(n)?(t=Xp(Om.EVENT_SUB_PROCESS,i),this._createEntries(e,t)):Lm(n,"bpmn:SubProcess")&&zm(n)?(t=Xp(Om.SUBPROCESS_EXPANDED,i),this._createEntries(e,t)):Lm(n,"bpmn:AdHocSubProcess")&&!zm(n)?(t=Xp(Om.TASK,function(t){var n=t.target,i="bpmn:SubProcess"===n.type,r=!0===n.isExpanded;return $m(e,n)&&(!i||r)}),this._createEntries(e,t)):Lm(n,"bpmn:SequenceFlow")?this._createSequenceFlowEntries(e,Om.SEQUENCE_FLOW):Lm(n,"bpmn:FlowNode")?(t=Xp(Om.TASK,i),Lm(n,"bpmn:SubProcess")&&!zm(n)&&(t=jm(t,function(e){return"Sub Process (collapsed)"===e.label})),this._createEntries(e,t)):[]},_n.prototype.getHeaderEntries=function(e){var t=[];return Lm(e,"bpmn:Activity")&&!Im(e)&&(t=t.concat(this._getLoopEntries(e))),!Lm(e,"bpmn:SubProcess")||Lm(e,"bpmn:Transaction")||Im(e)||t.push(this._getAdHocEntry(e)),t},_n.prototype._createEntries=function(e,t){var n=[],i=this;return ms(t,function(t){var r=i._createMenuEntry(t,e);n.push(r)}),n},_n.prototype._createSequenceFlowEntries=function(e,t){var n=Fm(e),i=[],r=this._modeling,o=this._moddle,a=this;return ms(t,function(t){switch(t.actionName){case"replace-with-default-flow":n.sourceRef.default!==n&&(Lm(n.sourceRef,"bpmn:ExclusiveGateway")||Lm(n.sourceRef,"bpmn:InclusiveGateway")||Lm(n.sourceRef,"bpmn:ComplexGateway")||Lm(n.sourceRef,"bpmn:Activity"))&&i.push(a._createMenuEntry(t,e,function(){r.updateProperties(e.source,{default:n})}));break;case"replace-with-conditional-flow":!n.conditionExpression&&Lm(n.sourceRef,"bpmn:Activity")&&i.push(a._createMenuEntry(t,e,function(){var t=o.create("bpmn:FormalExpression",{body:""});r.updateProperties(e,{conditionExpression:t})}));break;default:if(Lm(n.sourceRef,"bpmn:Activity")&&n.conditionExpression)return i.push(a._createMenuEntry(t,e,function(){r.updateProperties(e,{conditionExpression:void 0})}));if((Lm(n.sourceRef,"bpmn:ExclusiveGateway")||Lm(n.sourceRef,"bpmn:InclusiveGateway")||Lm(n.sourceRef,"bpmn:ComplexGateway")||Lm(n.sourceRef,"bpmn:Activity"))&&n.sourceRef.default===n)return i.push(a._createMenuEntry(t,e,function(){r.updateProperties(e.source,{default:void 0})}))}}),i},_n.prototype._createMenuEntry=function(e,t,n){var i=this._translate,r=this._bpmnReplace.replaceElement;n=n||function(){return r(t,e.target)};return{label:i(e.label),className:e.className,id:e.actionName,action:n}},_n.prototype._getLoopEntries=function(e){function t(t,n){var i;n.active?i=void 0:(i=o._moddle.create(n.options.loopCharacteristics),n.options.isSequential&&(i.isSequential=n.options.isSequential)),o._modeling.updateProperties(e,{loopCharacteristics:i})}var n,i,r,o=this,a=this._translate,s=Fm(e).loopCharacteristics;s&&(n=s.isSequential,i=void 0===s.isSequential,r=void 0!==s.isSequential&&!s.isSequential);return[{id:"toggle-parallel-mi",className:"bpmn-icon-parallel-mi-marker",title:a("Parallel Multi Instance"),active:r,action:t,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!1}},{id:"toggle-sequential-mi",className:"bpmn-icon-sequential-mi-marker",title:a("Sequential Multi Instance"),active:n,action:t,options:{loopCharacteristics:"bpmn:MultiInstanceLoopCharacteristics",isSequential:!0}},{id:"toggle-loop",className:"bpmn-icon-loop-marker",title:a("Loop"),active:i,action:t,options:{loopCharacteristics:"bpmn:StandardLoopCharacteristics"}}]},_n.prototype._getAdHocEntry=function(e){var t=this._translate,n=Fm(e),i=Lm(n,"bpmn:AdHocSubProcess"),r=this._bpmnReplace.replaceElement;return{id:"toggle-adhoc",className:"bpmn-icon-ad-hoc-marker",title:t("Ad-hoc"),active:i,action:function(t,n){return i?r(e,{type:"bpmn:SubProcess"}):r(e,{type:"bpmn:AdHocSubProcess"})}}};var Wm=_n,Gm={};Gm.IGNORED_PROPERTIES=["lanes","incoming","outgoing","artifacts","default","flowElements"],Gm.getProperties=function(e,t){var n=[];return ms(e.properties,function(e){t&&e.default||n.push(e.ns.name)}),n};var Hm=Gm.IGNORED_PROPERTIES,Vm=wn;wn.prototype.clone=function(e,t,n){var i={newElement:t,hasNestedProperty:!1};return n=Gf(n,function(e){return"bpmn:extensionElements"===e}),ms(n,function(n){var r,o,a=e.get(n),s=t.get(n),c=t.$model.getPropertyDescriptor(t,n);s===a||c&&(c.isId||c.isReference)||(!function(e,t){return sm(t,function(t){return typeof e===t})}(a,["boolean","string","number"])&&null!==a?rs(a)?ms(a,function(e){var n;i.refTopLevelProperty=e,n=this._deepClone(e,i),i.hasNestedProperty&&(n.$parent=t,s.push(n)),i.hasNestedProperty=!1},this):(o=n.replace(/bpmn:/,""),i.refTopLevelProperty=a,r=this._deepClone(a,i),i.hasNestedProperty&&(t[o]=r),i.hasNestedProperty=!1):t.set(n,a))},this),t},wn.prototype._deepClone=function(e,t){var n=this._eventBus,i=e.$model.create(e.$type),r=Xp(Object.keys(e),function(e){var t=i.$model.getPropertyDescriptor(i,e);return(!t||!t.isId&&!t.isReference)&&(-1===Hm.indexOf(e)&&"$type"!==e)});return r.length||(t.hasNestedProperty=!0),ms(r,function(r){void 0!==e[r]&&(e[r].$type||rs(e[r]))?rs(e[r])?(i[r]=[],ms(e[r],function(o){var a,s=e.$model.getTypeDescriptor(o.$type);if(s){if(!n.fire("property.clone",{newElement:t.newElement,refTopLevelProperty:t.refTopLevelProperty,propertyDescriptor:s})&&"bpmn:ExtensionElements"===e.$type&&s.meta&&s.meta.allowedIn&&!function(e,t){var n=e.meta.allowedIn;return 1===n.length&&"*"===n[0]||-1!==n.indexOf(t)}(s,t.newElement.$type))return!1;(a=this._deepClone(o,t)).$parent=i,i[r]||(i[r]=[]),t.hasNestedProperty=!0,i[r].push(a)}},this)):e[r].$type&&(i[r]=this._deepClone(e[r],t),i[r]&&(t.hasNestedProperty=!0,i[r].$parent=i)):(t.hasNestedProperty=!0,i[r]=e[r])},this),i};var Um=Pc(function(e){for(var t=e.length,n=t,i=Array(p),r=Id,o=[];n--;){var a=e[n]=Ka(a=e[n])?a:[];i[n]=a.length>=120?Wd(n&&a):null}var s=e[0],c=-1,p=s?s.length:0,l=i[0];e:for(;++c'),t=this._current.position,n=this._current.className;return Bc(e.style,{position:"absolute",left:t.x+"px",top:t.y+"px",visibility:"hidden"}),hd(e).add(n),e},Tn.prototype._attachContainer=function(e,t,n){var i=this;yl.bind(e,".entry","click",function(e){i.trigger(e)});var r=this._canvas.zoom();e.style.transformOrigin="top left",e.style.transform="scale("+r+")",t.appendChild(e),n&&this._assureIsInbounds(e,n),this._bindHandlers()},Tn.prototype._assureIsInbounds=function(e,t){var n,i,r=this._canvas._container.getBoundingClientRect(),o=e.offsetLeft,a=e.offsetTop,s=e.scrollWidth,c=e.scrollHeight,p={},l={x:t.x-r.left,y:t.y-r.top};o+s>r.width&&(p.x=!0),a+c>r.height&&(p.y=!0),p.x&&p.y?(n=l.x-s+"px",i=l.y-c+"px"):p.x?(n=l.x-s+"px",i=l.y+"px"):p.y&&l.y"),i=this;return hd(n).add(t),ms(e,function(e){var t=i._createEntry(e,n);n.appendChild(t)}),n},Tn.prototype._createEntry=function(e){if(!e.id)throw new Error("every entry must have the id property set");var t=El("
"),n=hd(t);if(n.add("entry"),e.className&&n.add(e.className),cd(t,"data-id",e.id),e.label){var i=El("");i.textContent=e.label,t.appendChild(i)}return e.imageUrl&&t.appendChild(El('')),!0===e.active&&n.add("active"),!0===e.disabled&&n.add("disabled"),e.title&&(t.title=e.title),t},Tn.prototype._bindHandlers=function(){function e(){n.close()}var t=this._eventBus,n=this;t.once("contextPad.close",e),t.once("canvas.viewbox.changing",e),t.once("commandStack.changed",e)},Tn.prototype._unbindHandlers=function(){function e(){n.close()}var t=this._eventBus,n=this;t.off("contextPad.close",e),t.off("canvas.viewbox.changed",e),t.off("commandStack.changed",e)};var ry={__depends__:[{__init__:["popupMenu"],popupMenu:["type",Tn]},iy],__init__:["replaceMenuProvider"],replaceMenuProvider:["type",Wm]},oy=Math.min,ay=Math.max,sy=Pn;Pn.prototype.create=function(e,t,n,i){var r=this.parent,o=this.content,a=this.container;i=this.options=i||{},t=this.style=t||{};var s=qc(t,["width","height","maxWidth","maxHeight","minWidth","minHeight","left","top","backgroundColor","position","overflow","border","wordWrap","textAlign","outline","transform"]);Bc(r.style,{width:e.width+"px",height:e.height+"px",maxWidth:e.maxWidth+"px",maxHeight:e.maxHeight+"px",minWidth:e.minWidth+"px",minHeight:e.minHeight+"px",left:e.x+"px",top:e.y+"px",backgroundColor:"#ffffff",position:"absolute",overflow:"visible",border:"1px solid #ccc",wordWrap:"normal",textAlign:"center",outline:"none"},s);var c=qc(t,["fontSize","lineHeight","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"]);return Bc(o.style,{boxSizing:"border-box",width:"100%",outline:"none"},c),i.centerVertically&&Bc(o.style,{position:"absolute",top:"50%",transform:"translate(0, -50%)"},c),o.innerText=n,Ud.bind(o,"keydown",this.keyHandler),Ud.bind(o,"mousedown",Rn),Ud.bind(o,"paste",this.handlePaste),i.autoResize&&Ud.bind(o,"input",this.autoResize),i.resizable&&this.resizable(t),a.appendChild(r),this.setSelection(o.lastChild,o.lastChild&&o.lastChild.length),r},Pn.prototype.handlePaste=function(e){var t=this,n=this.options,i=this.style;e.preventDefault();var r;r=e.clipboardData?e.clipboardData.getData("text/plain"):window.clipboardData.getData("Text");if(!document.execCommand("insertHTML",!1,r)){var o,a,s=this.getSelection(),c=s.startContainer,p=s.endContainer,l=s.startOffset,u=s.endOffset,h=s.commonAncestorContainer,d=function(e){return[].slice.call(e)}(h.childNodes);if(function(e){return e.nodeType===Node.TEXT_NODE}(h)){var f=c.textContent;c.textContent=f.substring(0,l)+r+f.substring(u),o=c,a=l+r.length}else if(c===this.content&&p===this.content){var m=document.createTextNode(r);this.content.insertBefore(m,d[l]),o=m,a=m.textContent.length}else{var y=d.indexOf(c),v=d.indexOf(p);d.forEach(function(e,t){t===y?e.textContent=c.textContent.substring(0,l)+r+p.textContent.substring(u):t>y&&t<=v&&dd(e)}),o=c,a=l+r.length}o&&void 0!==a&&setTimeout(function(){t.setSelection(o,a)})}if(n.autoResize){var g=this.autoResize(i);g&&this.resizeHandler(g)}},Pn.prototype.autoResize=function(){var e=this.parent,t=this.content,n=parseInt(this.style.fontSize)||12;if(t.scrollHeight>e.offsetHeight||t.scrollHeight
');cd(o,"data-action",t),(n=up("[data-group="+r+"]",i))||(n=El('
'),i.appendChild(n)),n.appendChild(o),e.className&&function(e,t){var n=hd(e);(rs(t)?t:t.split(/\s+/g)).forEach(function(e){n.add(e)})}(o,e.className),e.title&&cd(o,"title",e.title),e.imageUrl&&o.appendChild(El(''))}),hd(i).add("open"),this._current={element:e,pad:n,entries:t},this._eventBus.fire("contextPad.open",{current:this._current})},Ln.prototype.getPad=function(e){if(this.isOpen())return this._current.pad;var t=this,n=this._overlays,i=El('
');yl.bind(i,".entry","click",function(e){t.trigger("click",e)}),yl.bind(i,".entry","dragstart",function(e){t.trigger("dragstart",e)}),Ud.bind(i,"mousedown",function(e){e.stopPropagation()}),this._overlayId=n.add(e,"context-pad",{position:{right:-9,top:-6},html:i});var r=n.get(this._overlayId);return this._eventBus.fire("contextPad.create",{element:e,pad:r}),r},Ln.prototype.close=function(){this.isOpen()&&(this._overlays.remove(this._overlayId),this._overlayId=null,this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},Ln.prototype.isOpen=function(e){return!(!this._current||e&&this._current.element!==e)};var Ey={__depends__:[Cd,vd],contextPad:["type",xy]},_y=750,wy="drop-ok",Sy="drop-not-ok",Ay="attach-ok",Ty="new-parent",Cy=Bs.translate;In.$inject=["eventBus","dragging","rules","modeling","canvas","styles","graphicsFactory"];var Ry={__depends__:[yy,jd,gy],create:["type",In]},Py={__depends__:[cy,Ey,jd,by,Ry,ry],__init__:["contextPadProvider"],contextPadProvider:["type",km]},My=Pa.getBusinessObject,ky=Pa.is,By=Gm.getProperties,Dy=Gm.IGNORED_PROPERTIES;zn.$inject=["bpmnFactory","eventBus","copyPaste","clipboard","canvas","bpmnRules"];var Ny=zn,Oy=$n;$n.prototype.get=function(){return this._data},$n.prototype.set=function(e){this._data=e},$n.prototype.clear=function(){var e=this._data;return delete this._data,e},$n.prototype.isEmpty=function(){return!this._data};var jy={clipboard:["type",Oy]},Ly={};Ly.getTopLevel=function(e){var t={},n=[],i=[],r=[];return ms(e,function(e){var i=e.parent;t[i.id]||(t[i.id]=[]),-1===n.indexOf(i.id)&&n.push(i.id),t[i.id].push(e)}),ms(n,function(e){ms(t[e],function(e){t[e.id]&&r.push(e.id)})}),ms(n,function(e){-1===r.indexOf(e)&&(i=i.concat(t[e]))}),i};var Iy={};Iy.center=function(e){return{x:e.x+e.width/2,y:e.y+e.height/2}},Iy.delta=function(e,t){return{x:e.x-t.x,y:e.y-t.y}};var Fy=function(e){return function(t,n,i){return t&&t.length?(n=Ec(n,i,3),Qp(t,n,e)):-1}}(),zy=ku.getBBox;Wn.$inject=["eventBus","modeling","elementFactory","rules","clipboard","canvas"];var $y=Wn;Wn.prototype.copy=function(e){var t,n,i=this._clipboard;if(rs(e)||(e=e?[e]:[]),e.length)return t=this.createTree(e),n=this._bbox=Iy.center(zy(t.allShapes)),delete t.allShapes,ms(t,function(e){ms(e,function(t){var i,r;t.labelTarget?(r=Jp(e,{id:t.labelTarget}),i=r.waypoints?Iy.delta(t,r.waypoints[0]):Iy.delta(t,r)):3===t.priority?(i=[],ms(t.waypoints,function(e){var t=Iy.delta(e,n);i.push(t)},this)):i=Iy.delta(t,n),t.delta=i})}),this._eventBus.fire("elements.copy",{context:{tree:t}}),0===Object.keys(t).length?i.clear():i.set(t),this._eventBus.fire("elements.copied",{context:{tree:t}}),t},Wn.prototype.paste=function(e){var t,n=this._clipboard,i=this._modeling,r=this._eventBus,o=this._rules,a=n.get(),s=e.element,c=e.point;n.isEmpty()||(t=wc(a,function(e,t,n){var i=parseInt(n,10);return isNaN(i)?e:(e[i]=t,e)},{},this),o.allowed("elements.paste",{tree:t,target:s})?i.pasteElements(t,s,c):r.fire("elements.paste.rejected",{context:{tree:t,position:c,target:s}}))},Wn.prototype._computeDelta=function(e,t){var n=this._bbox,i={};return t.labelTarget?Iy.delta(t,t.labelTarget):(3===t.priority?(i=[],ms(t.waypoints,function(e){var t=Iy.delta(e,n);i.push(t)},this)):i=Iy.delta(t,n),i)},Wn.prototype.hasRelations=function(e,t){var n,i;return!(t.waypoints&&(n=Jp(e,{id:t.source.id}),i=Jp(e,{id:t.target.id}),!n||!i))&&!(t.labelTarget&&!Jp(e,{id:t.labelTarget.id}))},Wn.prototype.registerDescriptor=function(e){if("function"!=typeof e)throw new Error("the descriptor must be a function");if(-1!==this._descriptors.indexOf(e))throw new Error("this descriptor is already registered");this._descriptors.push(e)},Wn.prototype._executeDescriptors=function(e){return e.descriptor||(e.descriptor={}),ms(this._descriptors,function(t){e.descriptor=t(e.element,e.descriptor)}),e},Wn.prototype.createTree=function(e){function t(e){var t=Fy(o,{element:e.element});if(-1===t)return o.push(e);o[t].depth=Math.min(t.min,t.max)&&Math.min(e.min,e.max)<=Math.max(t.min,t.max)},Vn.prototype._findRange=function(e){var t=e[this._axis];return{min:t+5,max:t+e[this._dimension]-5}};var Xy={__depends__:[{__init__:["distributeElements"],distributeElements:["type",Ky]}],__init__:["bpmnDistributeElements"],bpmnDistributeElements:["type",qy]};Un.$inject=["eventBus","commandStack","modeling","selection","zoomScroll","copyPaste","canvas","rules","mouseTracking"];var Zy=Un;Un.prototype.trigger=function(e,t){if(!this._actions[e])throw qn(e,"is not a registered action");return this._actions[e](t)},Un.prototype.register=function(e,t){if("string"==typeof e)return this._registerAction(e,t);ms(e,function(e,t){this._registerAction(t,e)},this)},Un.prototype._registerAction=function(e,t){if(this.isRegistered(e))throw qn(e,"is already registered");this._actions[e]=t},Un.prototype.unregister=function(e){if(!this.isRegistered(e))throw qn(e,"is not a registered action");this._actions[e]=void 0},Un.prototype.length=function(){return Object.keys(this._actions).length},Un.prototype.isRegistered=function(e){return!!this._actions[e]};var Qy=Pa.is,Jy=ku.getBBox;rp(Yn,Zy),Yn.$inject=["injector","canvas","elementRegistry","selection","spaceTool","lassoTool","handTool","globalConnect","distributeElements","alignElements","directEditing","searchPad","modeling"];var ev=Yn,tv=cm.isAny;Kn.$inject=["globalConnect"];var nv=Kn;Kn.prototype.canStartConnect=function(e){if(function(e){return!e||function(e){return e.labelTarget}(e)}(e))return null;var t=e.businessObject;return tv(t,["bpmn:FlowNode","bpmn:InteractionNode","bpmn:DataObjectReference","bpmn:DataStoreReference"])};var iv="connect-ok",rv="connect-not-ok";Xn.$inject=["eventBus","dragging","connect","canvas","toolManager"];var ov=Xn;Xn.prototype.start=function(e){this._dragging.init(e,"global-connect",{trapClick:!1,data:{context:{}}})},Xn.prototype.toggle=function(){this.isActive()?this._dragging.cancel():this.start()},Xn.prototype.isActive=function(){var e=this._dragging.context();return e&&/^global-connect/.test(e.prefix)},Xn.prototype.registerProvider=function(e){this._provider=e},Xn.prototype.canStartConnect=function(e){return this._provider.canStartConnect(e)};Zn.$inject=["eventBus","dragging"];var av=Zn;Zn.prototype.registerTool=function(e,t){var n=this._tools;if(!t)throw new Error('A tool has to be registered with it\'s "events"');n.push(e),this.bindEvents(e,t)},Zn.prototype.isActive=function(e){return e&&this._active===e},Zn.prototype.length=function(e){return this._tools.length},Zn.prototype.setActive=function(e){var t=this._eventBus;this._active!==e&&(this._active=e,t.fire("tool-manager.update",{tool:e}))},Zn.prototype.bindEvents=function(e,t){var n=this._eventBus,i=this._dragging,r=[];n.on(t.tool+".init",function(t){if(!t.context.reactivate&&this.isActive(e))return this.setActive(null),void i.cancel();this.setActive(e)},this),ms(t,function(e){r.push(e+".ended"),r.push(e+".canceled")}),n.on(r,250,function(e){var t=e.originalEvent;!this._active||t&&"tools"===t.target.parentNode.getAttribute("data-group")||this.setActive(null)},this)};var sv={__depends__:[yy],__init__:["toolManager"],toolManager:["type",av]},cv={__depends__:[{__depends__:[by,gy,yy,sv],globalConnect:["type",ov]}],__init__:["bpmnGlobalConnect"],bpmnGlobalConnect:["type",nv]},pv=Pa.getBusinessObject,lv=Pa.is,uv=Bs.translate,hv="djs-element-hidden",dv="djs-label-hidden";Qn.$inject=["eventBus","canvas","elementRegistry","pathMap"];var fv=Qn,mv={},yv=Pa.is;mv.getLabel=function(e){var t=e.businessObject,n=Jn(t);if(n)return t[n]||""},mv.setLabel=function(e,t,n){var i=e.businessObject,r=Jn(i);return r&&(i[r]=t),n&&(e.hidden=!t),e};var vv=Bp.hasExternalLabel,gv=Pa.getBusinessObject,bv=Pa.is,xv={width:0,height:0};ei.$inject=["modeling"];var Ev=ei,_v={fontFamily:"Arial, sans-serif",fontSize:"11px"},wv=Pa.is,Sv=ys.isExpanded;ti.$inject=["eventBus","canvas","directEditing","commandStack","resizeHandles"];var Av=ti;ti.prototype.activate=function(e){var t=mv.getLabel(e);if(void 0!==t){var n={text:t},i=this.getEditingBBox(e);Bc(n,i);var r=e.label||e,o={};return(wv(e,"bpmn:Task")||wv(e,"bpmn:Participant")||wv(e,"bpmn:Lane")||wv(e,"bpmn:CallActivity")&&!Sv(e)||wv(e,"bpmn:SubProcess")&&!Sv(e))&&Bc(o,{centerVertically:!0}),r.labelTarget&&Bc(o,{autoResize:!0}),wv(e,"bpmn:TextAnnotation")&&Bc(o,{resizable:!0,autoResize:!0}),Bc(n,{options:o}),n}},ti.prototype.getEditingBBox=function(e){var t=this._canvas,n=e.label||e,i=t.getAbsoluteBBox(n),r={x:i.x+i.width/2,y:i.y+i.height/2},o={x:i.x,y:i.y},a=t.zoom(),s=11*a,c=13*a,p=12*a,l=14*a,u={};if((wv(e,"bpmn:Participant")&&Sv(e)||wv(e,"bpmn:Lane"))&&(Bc(o,{width:i.height,height:30*a,x:i.x-i.height/2+15*a,y:r.y-30*a/2}),Bc(u,{fontSize:p+"px",lineHeight:l+"px",paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",transform:"rotate(-90deg)"})),(wv(e,"bpmn:Task")||wv(e,"bpmn:CallActivity")&&!Sv(e)||wv(e,"bpmn:SubProcess")&&!Sv(e)||wv(e,"bpmn:Participant")&&!Sv(e))&&(Bc(o,{width:i.width,height:i.height}),Bc(u,{fontSize:p+"px",lineHeight:l+"px",paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),wv(e,"bpmn:SubProcess")&&Sv(e)&&(Bc(o,{width:i.width,x:i.x}),Bc(u,{fontSize:p+"px",lineHeight:l+"px",paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px"})),n.labelTarget){var h=90*a,d=7*a,f=4*a;Bc(o,{width:h,height:i.height+d+f,x:r.x-h/2,y:i.y-d}),Bc(u,{fontSize:s+"px",lineHeight:c+"px",paddingTop:d+"px",paddingBottom:f+"px"})}return wv(e,"bpmn:TextAnnotation")&&(Bc(o,{width:i.width,height:i.height,minWidth:30*a,minHeight:10*a}),Bc(u,{textAlign:"left",paddingTop:7*a+"px",paddingBottom:7*a+"px",paddingLeft:5*a+"px",paddingRight:5*a+"px",fontSize:p+"px",lineHeight:l+"px"})),{bounds:o,style:u}},ti.prototype.update=function(e,t,n,i){var r=this._canvas.getAbsoluteBBox(e);this._commandStack.execute("element.updateLabel",{element:e,newLabel:t,bounds:{x:e.x,y:e.y,width:e.width/r.width*i.width,height:e.height/r.height*i.height}})};var Tv=200,Cv=function(e,t){var n=-1,i=Id,r=e.length,o=!0,a=o&&r>=Tv,s=a?Wd():null,c=[];s?(i=Fd,o=!1):(a=!1,s=t?[]:c);e:for(;++n");this._pushAction(e),t||(this._fire(i,"preExecute",e),o.preExecute&&o.preExecute(r),this._fire(i,"preExecuted",e)),this._atomicDo(function(){n._fire(i,"execute",e),o.execute&&n._markDirty(o.execute(r)),n._executedAction(e,t),n._fire(i,"executed",e)}),t||(this._fire(i,"postExecute",e),o.postExecute&&o.postExecute(r),this._fire(i,"postExecuted",e)),this._popAction(e)},ni.prototype._pushAction=function(e){var t=this._currentExecution,n=t.actions,i=n[0];if(t.atomic)throw new Error("illegal invocation in or phase (action: "+e.command+")");e.id||(e.id=i&&i.id||this._createId()),n.push(e)},ni.prototype._popAction=function(){var e=this._currentExecution,t=e.actions,n=e.dirty;t.pop(),t.length||(this._eventBus.fire("elements.changed",{elements:Pv(n)}),n.length=0,this._fire("changed"))},ni.prototype._markDirty=function(e){var t=this._currentExecution;e&&(e=rs(e)?e:[e],t.dirty=t.dirty.concat(e))},ni.prototype._executedAction=function(e,t){var n=++this._stackIdx;t||this._stack.splice(n,this._stack.length,e)},ni.prototype._revertedAction=function(e){this._stackIdx--},ni.prototype._getHandler=function(e){return this._handlerMap[e]},ni.prototype._setHandler=function(e,t){if(!e||!t)throw new Error("command and handler required");if(this._handlerMap[e])throw new Error("overriding handler for command <"+e+">");this._handlerMap[e]=t};var Bv={commandStack:["type",kv]},Dv=ku.getType;ii.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Nv={__init__:["changeSupport"],changeSupport:["type",ii]},Ov=function(e){return e.cloneNode(!0)},jv=ri;ri.$inject=["elementRegistry","canvas","styles"],ri.prototype.getGfx=function(e){return this._elementRegistry.getGraphics(e)},ri.prototype.addDragger=function(e,t){var n=this.getGfx(e),i=Ov(n),r=n.getBoundingClientRect();return function(e){return e.waypoints}(e)&&oi(i),Es(i,this._styles.cls("djs-dragger",[],{x:r.top,y:r.left})),Xc(t,i),i},ri.prototype.addFrame=function(e,t){var n=Cs("rect",{class:"djs-resize-overlay",width:e.width,height:e.height,x:e.x,y:e.y});return Xc(t,n),n};var Lv={__init__:["previewSupport"],previewSupport:["type",jv]},Iv=Hf.asTRBL,Fv=Hf.roundBounds;ai.prototype.canResize=function(e){var t=this._rules,n=qc(e,["newBounds","shape","delta","direction"]);return t.allowed("shape.resize",n)},ai.prototype.activate=function(e,t,n){var i,r,o=this._dragging;if("string"==typeof n&&(n={direction:n}),i=Bc({shape:t},n),!(r=i.direction))throw new Error("must provide a direction (nw|se|ne|sw)");o.init(e,"resize",{autoActivate:!0,cursor:"resize-"+(/nw|se/.test(r)?"nwse":"nesw"),data:{shape:t,context:i}})},ai.prototype.computeMinResizeBox=function(e){var t,n,i=e.shape,r=e.direction;return t=e.minDimensions||{width:10,height:10},n=lm.computeChildrenBBox(i,e.childrenBoxPadding),lm.getMinResizeBounds(r,i,t,n)},ai.$inject=["eventBus","rules","modeling","dragging"];var zv=ai,$v=xd.isPrimaryButton,Wv=Hf.asTRBL,Gv=Bs.transform;si.prototype.makeDraggable=function(e,t,n){function i(t){$v(t)&&r.activate(t,e,n)}var r=this._resize;Ud.bind(t,"mousedown",i),Ud.bind(t,"touchstart",i)},si.prototype._createResizer=function(e,t,n,i,r){var o=this._getResizersParent(),a=Cs("g");hp(a).add("djs-resizer"),hp(a).add("djs-resizer-"+e.id),hp(a).add("djs-resizer-"+r),Xc(o,a);var s=Cs("rect");Es(s,{x:-7,y:-7,width:5,height:5}),hp(s).add("djs-resizer-visual"),Xc(a,s);var c=Cs("rect");return Es(c,{x:-7,y:-7,width:20,height:20}),hp(c).add("djs-resizer-hit"),Xc(a,c),Gv(a,t,n,i),a},si.prototype.createResizer=function(e,t){var n,i=Wv(e);n="nw"===t?this._createResizer(e,i.left,i.top,0,t):"ne"===t?this._createResizer(e,i.right,i.top,90,t):"se"===t?this._createResizer(e,i.right,i.bottom,180,t):this._createResizer(e,i.left,i.bottom,270,t),this.makeDraggable(e,n,t)},si.prototype.addResizer=function(e){this._resize.canResize({shape:e})&&(this.createResizer(e,"nw"),this.createResizer(e,"ne"),this.createResizer(e,"se"),this.createResizer(e,"sw"))},si.prototype.removeResizers=function(){var e=this._getResizersParent();qd(e)},si.prototype._getResizersParent=function(){return this._canvas.getLayer("resizers")},si.$inject=["eventBus","canvas","selection","resize"];var Hv=si,Vv="djs-resizing",Uv="resize-not-ok",qv=500;ci.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var Yv={__depends__:[gy,yy,Lv],__init__:["resize","resizePreview","resizeHandles"],resize:["type",zv],resizePreview:["type",ci],resizeHandles:["type",Hv]},Kv={__depends__:[Bv,Nv,Yv,cy],__init__:["labelEditingProvider","labelEditingPreview"],labelEditingProvider:["type",Av],labelEditingPreview:["type",fv]};pi.$inject=["moddle"],pi.prototype._needsId=function(e){return e.$instanceOf("bpmn:RootElement")||e.$instanceOf("bpmn:FlowElement")||e.$instanceOf("bpmn:MessageFlow")||e.$instanceOf("bpmn:DataAssociation")||e.$instanceOf("bpmn:Artifact")||e.$instanceOf("bpmn:Participant")||e.$instanceOf("bpmn:Lane")||e.$instanceOf("bpmn:Process")||e.$instanceOf("bpmn:Collaboration")||e.$instanceOf("bpmndi:BPMNShape")||e.$instanceOf("bpmndi:BPMNEdge")||e.$instanceOf("bpmndi:BPMNDiagram")||e.$instanceOf("bpmndi:BPMNPlane")||e.$instanceOf("bpmn:Property")},pi.prototype._ensureId=function(e){var t=(e.$type||"").replace(/^[^:]*:/g,"")+"_";!e.id&&this._needsId(e)&&(e.id=this._model.ids.nextPrefixed(t,e))},pi.prototype.create=function(e,t){var n=this._model.create(e,t||{});return this._ensureId(n),n},pi.prototype.createDiLabel=function(){return this.create("bpmndi:BPMNLabel",{bounds:this.createDiBounds()})},pi.prototype.createDiShape=function(e,t,n){return this.create("bpmndi:BPMNShape",Bc({bpmnElement:e,bounds:this.createDiBounds(t)},n))},pi.prototype.createDiBounds=function(e){return this.create("dc:Bounds",e)},pi.prototype.createDiWaypoints=function(e){return Ip(e,function(e){return this.createDiWaypoint(e)},this)},pi.prototype.createDiWaypoint=function(e){return this.create("dc:Point",qc(e,["x","y"]))},pi.prototype.createDiEdge=function(e,t,n){return this.create("bpmndi:BPMNEdge",Bc({bpmnElement:e},n))},pi.prototype.createDiPlane=function(e){return this.create("bpmndi:BPMNPlane",{bpmnElement:e})};var Xv=pi,Zv=Hf.getMid,Qv=li;li.prototype.layoutConnection=function(e,t){return t=t||{},[t.connectionStart||Zv(e.source),t.connectionEnd||Zv(e.target)]};var Jv=Pc(function(e,t){return Ka(e)?Hd(e,t):[]}),eg={},tg=Hf.getOrientation,ng=Hf.getMid,ig=Sf.pointsAligned,rg=Sf.pointInRect,og=Sf.pointDistance,ag=20,sg={"h:h":20,"v:v":20,"h:v":-10,"v:h":-10};eg.repairConnection=function(e,t,n,i,r,o){rs(n)&&(r=n,o=i,n=ng(e),i=ng(t)),o=Bc({preferredLayouts:[]},o),r=r||[];var a;return-1!==o.preferredLayouts.indexOf("straight")&&(a=mi(e,t,n,i,o)),a||(o.connectionEnd?a=(a=yi(t,e,i,r.slice().reverse()))&&a.reverse():o.connectionStart?a=yi(e,t,n,r):r&&r.length&&(a=r)),a||(a=di(e,t,n,i,o)),a};var cg=ys.isExpanded,pg=Hf.getMid,lg=Hf.getOrientation,ug=Pa.is;rp(vi,Qv);var hg=vi;vi.prototype.layoutConnection=function(e,t){t=t||{};var n,i,r=e.source,o=e.target,a=e.waypoints,s=t.connectionStart,c=t.connectionEnd;if(s||(s=gi(a&&a[0],r)),c||(c=gi(a&&a[a.length-1],o)),(ug(e,"bpmn:Association")||ug(e,"bpmn:DataAssociation"))&&a&&!bi(e))return[].concat([s],a.slice(1,-1),[c]);if(ug(e,"bpmn:MessageFlow"))n={preferredLayouts:["v:v"]},ug(o,"bpmn:Participant")&&(n={preferredLayouts:["straight","v:v"]}),xi(o)&&(n={preferredLayouts:["straight","v:v"]}),xi(r)&&ug(o,"bpmn:FlowNode")&&(n={preferredLayouts:["straight","v:v"],preserveDocking:xi(o)?"source":"target"}),ug(r,"bpmn:Participant")&&ug(o,"bpmn:FlowNode")&&(n={preferredLayouts:["straight","v:v"],preserveDocking:"target"}),ug(o,"bpmn:Event")&&(n={preferredLayouts:["v:v"]});else if(ug(e,"bpmn:SequenceFlow")||bi(e))if(ug(r,"bpmn:BoundaryEvent")){var p=function(e){var t=e.host;return lg(pg(e),t,-10)}(r);/left|right/.test(p)?n={preferredLayouts:["h:v"]}:/top|bottom/.test(p)&&(n={preferredLayouts:["v:h"]})}else n=ug(r,"bpmn:Gateway")?{preferredLayouts:["v:h"]}:ug(o,"bpmn:Gateway")?{preferredLayouts:["h:v"]}:{preferredLayouts:["h:h"]};return n&&(n=Bc(n,t),i=eg.repairConnection(r,o,s,c,a,n)),i||[s,c]};var dg=Pa.getBusinessObject,fg=Pa.is;rp(Ei,wf);var mg=Ei;Ei.$inject=["eventBus","bpmnFactory","connectionDocking","translate"],Ei.prototype.updateAttachment=function(e){var t=e.shape,n=t.businessObject,i=t.host;n.attachedToRef=i&&i.businessObject},Ei.prototype.updateParent=function(e,t){if(!(e instanceof Fu.Label)){var n=e.parent,i=e.businessObject,r=n&&n.businessObject,o=r&&r.di;fg(e,"bpmn:FlowNode")&&this.updateFlowNodeRefs(i,r,t&&t.businessObject),fg(e,"bpmn:DataOutputAssociation")&&(r=e.source?e.source.businessObject:null),fg(e,"bpmn:DataInputAssociation")&&(r=e.target?e.target.businessObject:null),this.updateSemanticParent(i,r),fg(e,"bpmn:DataObjectReference")&&i.dataObjectRef&&this.updateSemanticParent(i.dataObjectRef,r),this.updateDiParent(i.di,o)}},Ei.prototype.updateBounds=function(e){var t=e.businessObject.di,n=e instanceof Fu.Label?this._getLabel(t).bounds:t.bounds;Bc(n,{x:e.x,y:e.y,width:e.width,height:e.height})},Ei.prototype.updateFlowNodeRefs=function(e,t,n){if(n!==t){var i,r;fg(n,"bpmn:Lane")&&(i=n.get("flowNodeRef"),Su.remove(i,e)),fg(t,"bpmn:Lane")&&(r=t.get("flowNodeRef"),Su.add(r,e))}},Ei.prototype.updateDiConnection=function(e,t,n){e.sourceElement&&e.sourceElement.bpmnElement!==t&&(e.sourceElement=t&&t.di),e.targetElement&&e.targetElement.bpmnElement!==n&&(e.targetElement=n&&n.di)},Ei.prototype.updateDiParent=function(e,t){if(t&&!fg(t,"bpmndi:BPMNPlane")&&(t=t.$parent),e.$parent!==t){var n=(t||e.$parent).get("planeElement");t?(n.push(e),e.$parent=t):(Su.remove(n,e),e.$parent=null)}},Ei.prototype.getLaneSet=function(e){var t,n;return fg(e,"bpmn:Lane")?((t=e.childLaneSet)||(t=this._bpmnFactory.create("bpmn:LaneSet"),e.childLaneSet=t,t.$parent=e),t):(fg(e,"bpmn:Participant")&&(e=e.processRef),n=e.get("laneSets"),(t=n[0])||((t=this._bpmnFactory.create("bpmn:LaneSet")).$parent=e,n.push(t)),t)},Ei.prototype.updateSemanticParent=function(e,t,n){var i,r=this._translate;if(e.$parent!==t){if(fg(e,"bpmn:Lane"))t&&(t=this.getLaneSet(t)),i="lanes";else if(fg(e,"bpmn:FlowElement")){if(t)if(fg(t,"bpmn:Participant"))t=t.processRef;else if(fg(t,"bpmn:Lane"))do{t=t.$parent.$parent}while(fg(t,"bpmn:Lane"));i="flowElements"}else if(fg(e,"bpmn:Artifact")){for(;t&&!fg(t,"bpmn:Process")&&!fg(t,"bpmn:SubProcess")&&!fg(t,"bpmn:Collaboration");){if(fg(t,"bpmn:Participant")){t=t.processRef;break}t=t.$parent}i="artifacts"}else if(fg(e,"bpmn:MessageFlow"))i="messageFlows";else if(fg(e,"bpmn:Participant")){i="participants";var o,a=e.processRef;a&&(o=function(e){for(;e&&!fg(e,"bpmn:Definitions");)e=e.$parent;return e}(e.$parent||t),e.$parent&&(Su.remove(o.get("rootElements"),a),a.$parent=null),t&&(Su.add(o.get("rootElements"),a),a.$parent=o))}else fg(e,"bpmn:DataOutputAssociation")?i="dataOutputAssociations":fg(e,"bpmn:DataInputAssociation")&&(i="dataInputAssociations");if(!i)throw new Error(r("no parent for {element} in {parent}",{element:e.id,parent:t.id}));var s;if(e.$parent&&(s=e.$parent.get(i),Su.remove(s,e)),t?((s=t.get(i)).push(e),e.$parent=t):e.$parent=null,n){var c=n.get(i);Su.remove(s,e),t&&(c||(c=[],t.set(i,c)),c.push(e))}}},Ei.prototype.updateConnectionWaypoints=function(e){e.businessObject.di.set("waypoint",this._bpmnFactory.createDiWaypoints(e.waypoints))},Ei.prototype.updateConnection=function(e){var t,n=e.connection,i=dg(n),r=dg(n.source),o=dg(n.target);if(fg(i,"bpmn:DataAssociation"))fg(i,"bpmn:DataInputAssociation")?(i.get("sourceRef")[0]=r,t=e.parent||e.newParent||o,this.updateSemanticParent(i,o,parent.businessObject)):fg(i,"bpmn:DataOutputAssociation")&&(t=e.parent||e.newParent||r,this.updateSemanticParent(i,r,t),i.targetRef=o);else{var a=fg(i,"bpmn:SequenceFlow");i.sourceRef!==r&&(a&&(Su.remove(i.sourceRef&&i.sourceRef.get("outgoing"),i),r&&r.get("outgoing")&&r.get("outgoing").push(i)),i.sourceRef=r),i.targetRef!==o&&(a&&(Su.remove(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)},Ei.prototype._getLabel=function(e){return e.label||(e.label=this._bpmnFactory.createDiLabel()),e.label};var yg=Pa.is,vg=ys.isExpanded;rp(wi,Uu),wi.$inject=["bpmnFactory","moddle","translate"];var gg=wi;wi.prototype.baseCreate=Uu.prototype.create,wi.prototype.create=function(e,t){return"label"===e?this.baseCreate(e,Bc({type:"label"},Bp.DEFAULT_LABEL_SIZE,t)):this.createBpmnElement(e,t)},wi.prototype.createBpmnElement=function(e,t){var n,i=this._translate,r=(t=t||{}).businessObject;if(!r){if(!t.type)throw new Error(i("no shape type specified"));r=this._bpmnFactory.create(t.type)}r.di||(r.di="root"===e?this._bpmnFactory.createDiPlane(r,[],{id:r.id+"_di"}):"connection"===e?this._bpmnFactory.createDiEdge(r,[],{id:r.id+"_di"}):this._bpmnFactory.createDiShape(r,{},{id:r.id+"_di"})),t.colors&&(Bc(r.di,t.colors),delete t.colors),function(e,t,n){ms(n,function(n){void 0!==t[n]&&Si(e,t,n)})}(r,t,["processRef","isInterrupting","associationDirection","isForCompensation"]),t.isExpanded&&Si(r.di,t,"isExpanded"),yg(r,"bpmn:ExclusiveGateway")&&(r.di.isMarkerVisible=!0);var o,a;return t.eventDefinitionType&&(o=r.get("eventDefinitions")||[],a=this._moddle.create(t.eventDefinitionType),o.push(a),a.$parent=r,r.eventDefinitions=o,delete t.eventDefinitionType),n=this._getDefaultSize(r),t=Bc({businessObject:r,id:r.id},n,t),this.baseCreate(e,t)},wi.prototype._getDefaultSize=function(e){return yg(e,"bpmn:SubProcess")?vg(e)?{width:350,height:200}:{width:100,height:80}:yg(e,"bpmn:Task")?{width:100,height:80}:yg(e,"bpmn:Gateway")?{width:50,height:50}:yg(e,"bpmn:Event")?{width:36,height:36}:yg(e,"bpmn:Participant")?vg(e)?{width:600,height:250}:{width:400,height:100}:yg(e,"bpmn:Lane")?{width:400,height:100}:yg(e,"bpmn:DataObjectReference")?{width:36,height:50}:yg(e,"bpmn:DataStoreReference")?{width:50,height:50}:yg(e,"bpmn:TextAnnotation")?{width:100,height:30}:{width:100,height:80}},wi.prototype.createParticipantShape=function(e){var t={type:"bpmn:Participant"};return e||(t.processRef=this._bpmnFactory.create("bpmn:Process")),this.createShape(t)};var bg=vm.getLanesRoot,xg=vm.getChildLanes,Eg=vm.LANE_INDENTATION;Ai.$inject=["modeling","spaceTool"];var _g=Ai;Ai.prototype.preExecute=function(e){var t=this._spaceTool,n=this._modeling,i=e.shape,r=e.location,o=bg(i),a=o===i,s=a?i:i.parent;xg(s).length||n.createShape({type:"bpmn:Lane"},{x:i.x+Eg,y:i.y,width:i.width-Eg,height:i.height},s);var c=[];ku.eachElement(o,function(e){return c.push(e),e===i?[]:Xp(e.children,function(e){return e!==i})});var p="top"===r?-120:120,l="top"===r?i.y:i.y+i.height,u=l+("top"===r?10:-10),h="top"===r?"n":"s",d=t.calculateAdjustments(c,"y",p,u);t.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:p},h),e.newLane=n.createShape({type:"bpmn:Lane"},{x:i.x+(a?Eg:0),y:l-("top"===r?120:0),width:i.width-(a?Eg:0),height:120},s)},Ti.$inject=["moddle"];var wg=Ti;Ti.prototype.execute=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.claim(n,i):t.unclaim(n)},Ti.prototype.revert=function(e){var t=this._moddle.ids,n=e.id,i=e.element;e.claiming?t.unclaim(n):t.claim(n,i)};var Sg=Pa.is,Ag=vm.getLanesRoot,Tg=vm.computeLanesResize,Cg=ku.eachElement,Rg=Hf.asTRBL,Pg=lm.substractTRBL;Ci.$inject=["modeling","spaceTool"];var Mg=Ci;Ci.prototype.preExecute=function(e){var t=e.shape,n=e.newBounds;!1!==e.balanced?this.resizeBalanced(t,n):this.resizeSpace(t,n)},Ci.prototype.resizeBalanced=function(e,t){var n=this._modeling,i=Tg(e,t);n.resizeShape(e,t),i.forEach(function(e){n.resizeShape(e.shape,e.newBounds)})},Ci.prototype.resizeSpace=function(e,t){var n=this._spaceTool,i=Rg(e),r=Rg(t),o=Pg(r,i),a=Ag(e),s=[],c=[];Cg(a,function(e){return s.push(e),(Sg(e,"bpmn:Lane")||Sg(e,"bpmn:Participant"))&&c.push(e),e.children});var p,l,u,h,d;(o.bottom||o.top)&&(p=o.bottom||o.top,l=e.y+(o.bottom?e.height:0)+(o.bottom?-10:10),u=o.bottom?"s":"n",h=o.top>0||o.bottom<0?-p:p,d=n.calculateAdjustments(s,"y",h,l),n.makeSpace(d.movingShapes,d.resizingShapes,{x:0,y:p},u)),(o.left||o.right)&&(p=o.right||o.left,l=e.x+(o.right?e.width:0)+(o.right?-10:100),u=o.right?"e":"w",h=o.left>0||o.right<0?-p:p,d=n.calculateAdjustments(c,"x",h,l),n.makeSpace(d.movingShapes,d.resizingShapes,{x:p,y:0},u))};Ri.$inject=["commandStack"];var kg=Ri;Ri.prototype.postExecute=function(e){var t=e.elements,n=e.colors||{fill:void 0,stroke:void 0},i=this,r={};"fill"in n&&Bc(r,{fill:n.fill}),"stroke"in n&&Bc(r,{stroke:n.stroke}),ms(t,function(e){i._commandStack.execute("element.updateProperties",{element:e,properties:{di:r}})})},Ri.prototype.execute=function(e){},Ri.prototype.revert=function(e){};var Bg=vm.getChildLanes,Dg=vm.LANE_INDENTATION;Pi.$inject=["modeling","translate"];var Ng=Pi;Pi.prototype.preExecute=function(e){var t=this._modeling,n=this._translate,i=e.shape,r=e.count,o=Bg(i),a=o.length;if(a>r)throw new Error(n("more than {count} child lanes",{count:r}));var s,c,p,l,u,h=Math.round(i.height/r);for(u=0;un.left&&i.xn.top&&i.y0)return"e";if(t<0)return"w"}if("y"===e){if(t>0)return"s";if(t<0)return"n"}return null},ax.resizeBounds=function(e,t,n){var i=n.x,r=n.y;switch(t){case"n":return{x:e.x,y:e.y+r,width:e.width,height:e.height-r};case"s":return{x:e.x,y:e.y,width:e.width,height:e.height+r};case"w":return{x:e.x+i,y:e.y,width:e.width-i,height:e.height};case"e":return{x:e.x,y:e.y,width:e.width+i,height:e.height};default:throw new Error("unrecognized direction: "+t)}},cr.$inject=["modeling"];var sx=cr;cr.prototype.preExecute=function(e){var t=this._modeling,n=e.resizingShapes,i=e.delta,r=e.direction;ms(n,function(e){var n=ax.resizeBounds(e,r,i);t.resizeShape(e,n)})},cr.prototype.postExecute=function(e){var t=this._modeling,n=e.movingShapes,i=e.delta;t.moveElements(n,i,void 0,!1,{autoResize:!1})},cr.prototype.execute=function(e){},cr.prototype.revert=function(e){},pr.$inject=["modeling"];var cx=pr;pr.prototype.execute=function(e){var t=e.shape,n=t.children;return e.oldChildrenVisibility=function(e){var t={};return e.forEach(function(e){t[e.id]=e.hidden}),t}(n),t.collapsed=!t.collapsed,function(e,t){e.forEach(function(e){e.hidden=t})}(n,t.collapsed),[t].concat(n)},pr.prototype.revert=function(e){var t=e.shape,n=e.oldChildrenVisibility,i=t.children;return function(e,t){e.forEach(function(e){e.hidden=t[e.id]})}(i,n),t.collapsed=!t.collapsed,[t].concat(i)};var px=lr;lr.$inject=["modeling"],lr.prototype.execute=function(e){var t=e.shape,n=e.newHost,i=t.host;return e.oldHost=i,e.attacherIdx=ur(i,t),hr(n,t),t.host=n,t},lr.prototype.revert=function(e){var t=e.shape,n=e.newHost,i=e.oldHost,r=e.attacherIdx;return t.host=i,ur(n,t),hr(i,t,r),t};var lx=dr;dr.prototype.execute=function(e){var t=e.connection,n=e.newWaypoints;return e.oldWaypoints=t.waypoints,t.waypoints=n,t},dr.prototype.revert=function(e){var t=e.connection,n=e.oldWaypoints;return t.waypoints=n,t},fr.$inject=["eventBus","elementFactory","commandStack"];var ux=fr;fr.prototype.getHandlers=function(){return{"shape.append":Zg,"shape.create":eb,"shape.delete":cb,"shape.move":Ab,"shape.resize":ox,"shape.replace":nx,"shape.toggleCollapse":cx,spaceTool:sx,"label.create":tb,"connection.create":Qg,"connection.delete":rb,"connection.move":hb,"connection.layout":ub,"connection.updateWaypoints":lx,"connection.reconnectStart":tx,"connection.reconnectEnd":tx,"elements.move":_b,"elements.delete":ob,"elements.distribute":pb,"elements.align":Kg,"element.updateAttachment":px,"elements.paste":ex}},fr.prototype.registerHandlers=function(e){ms(this.getHandlers(),function(t,n){e.registerHandler(n,t)})},fr.prototype.moveShape=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=null);var o={shape:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("shape.move",o)},fr.prototype.updateAttachment=function(e,t){var n={shape:e,newHost:t};this._commandStack.execute("element.updateAttachment",n)},fr.prototype.moveElements=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=void 0);var o,a=n;!0===i&&(o=n,a=n.parent),!1===i&&(o=null);var s={shapes:e,delta:t,newParent:a,newHost:o,hints:r||{}};this._commandStack.execute("elements.move",s)},fr.prototype.moveConnection=function(e,t,n,i,r){"object"==typeof i&&(r=i,i=void 0);var o={connection:e,delta:t,newParent:n,newParentIndex:i,hints:r||{}};this._commandStack.execute("connection.move",o)},fr.prototype.layoutConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.layout",n)},fr.prototype.createConnection=function(e,t,n,i,r,o){"object"==typeof n&&(o=r,r=i,i=n,n=void 0);var a={source:e,target:t,parent:r,parentIndex:n,connection:i=this._create("connection",i),hints:o};return this._commandStack.execute("connection.create",a),a.connection},fr.prototype.createShape=function(e,t,n,i,r,o){"number"!=typeof i&&(o=r,r=i),"boolean"!=typeof r&&(o=r,r=!1);var a={position:t,shape:e=this._create("shape",e),parent:n,parentIndex:i,host:e.host,hints:o||{}};return r&&(a.parent=n.parent,a.host=n),this._commandStack.execute("shape.create",a),a.shape},fr.prototype.createLabel=function(e,t,n,i){n=this._create("label",n);var r={labelTarget:e,position:t,parent:i||e.parent,shape:n};return this._commandStack.execute("label.create",r),r.shape},fr.prototype.appendShape=function(e,t,n,i,r,o){var a={source:e,position:n,parent:i,shape:t=this._create("shape",t),connection:r,connectionParent:o};return this._commandStack.execute("shape.append",a),a.shape},fr.prototype.removeElements=function(e){var t={elements:e};this._commandStack.execute("elements.delete",t)},fr.prototype.distributeElements=function(e,t,n){var i={groups:e,axis:t,dimension:n};this._commandStack.execute("elements.distribute",i)},fr.prototype.removeShape=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.delete",n)},fr.prototype.removeConnection=function(e,t){var n={connection:e,hints:t||{}};this._commandStack.execute("connection.delete",n)},fr.prototype.replaceShape=function(e,t,n){var i={oldShape:e,newData:t,hints:n||{}};return this._commandStack.execute("shape.replace",i),i.newShape},fr.prototype.pasteElements=function(e,t,n){var i={tree:e,topParent:t,position:n};this._commandStack.execute("elements.paste",i)},fr.prototype.alignElements=function(e,t){var n={elements:e,alignment:t};this._commandStack.execute("elements.align",n)},fr.prototype.resizeShape=function(e,t,n){var i={shape:e,newBounds:t,minBounds:n};this._commandStack.execute("shape.resize",i)},fr.prototype.createSpace=function(e,t,n,i){var r={movingShapes:e,resizingShapes:t,delta:n,direction:i};this._commandStack.execute("spaceTool",r)},fr.prototype.updateWaypoints=function(e,t,n){var i={connection:e,newWaypoints:t,hints:n||{}};this._commandStack.execute("connection.updateWaypoints",i)},fr.prototype.reconnectStart=function(e,t,n){var i={connection:e,newSource:t,dockingOrPoints:n};this._commandStack.execute("connection.reconnectStart",i)},fr.prototype.reconnectEnd=function(e,t,n){var i={connection:e,newTarget:t,dockingOrPoints:n};this._commandStack.execute("connection.reconnectEnd",i)},fr.prototype.connect=function(e,t,n,i){return this.createConnection(e,t,n||{},e.parent,i)},fr.prototype._create=function(e,t){return t instanceof Fu.Base?t:this._elementFactory.create(e,t)},fr.prototype.toggleCollapse=function(e,t){var n={shape:e,hints:t||{}};this._commandStack.execute("shape.toggleCollapse",n)};rp(mr,ux),mr.$inject=["eventBus","elementFactory","commandStack","bpmnRules"];var hx=mr;mr.prototype.getHandlers=function(){var e=ux.prototype.getHandlers.call(this);return e["element.updateProperties"]=Ug,e["canvas.updateRoot"]=Og,e["lane.add"]=_g,e["lane.resize"]=Mg,e["lane.split"]=Ng,e["lane.updateRefs"]=zg,e["id.updateClaim"]=wg,e["element.setColor"]=kg,e},mr.prototype.updateLabel=function(e,t){this._commandStack.execute("element.updateLabel",{element:e,newLabel:t})},mr.prototype.connect=function(e,t,n,i){var r=this._bpmnRules;if(n||(n=r.canConnect(e,t)),n)return this.createConnection(e,t,n,e.parent,i)},mr.prototype.updateProperties=function(e,t){this._commandStack.execute("element.updateProperties",{element:e,properties:t})},mr.prototype.resizeLane=function(e,t,n){this._commandStack.execute("lane.resize",{shape:e,newBounds:t,balanced:n})},mr.prototype.addLane=function(e,t){var n={shape:e,location:t};return this._commandStack.execute("lane.add",n),n.newLane},mr.prototype.splitLane=function(e,t){this._commandStack.execute("lane.split",{shape:e,count:t})},mr.prototype.makeCollaboration=function(){var e=this._create("root",{type:"bpmn:Collaboration"}),t={newRoot:e};return this._commandStack.execute("canvas.updateRoot",t),e},mr.prototype.updateLaneRefs=function(e,t){this._commandStack.execute("lane.updateRefs",{flowNodeShapes:e,laneShapes:t})},mr.prototype.makeProcess=function(){var e={newRoot:this._create("root",{type:"bpmn:Process"})};this._commandStack.execute("canvas.updateRoot",e)},mr.prototype.claimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t,claiming:!0})},mr.prototype.unclaimId=function(e,t){this._commandStack.execute("id.updateClaim",{id:e,element:t})},mr.prototype.setColor=function(e,t){e.length||(e=[e]),this._commandStack.execute("element.setColor",{elements:e,colors:t})};var dx=Pa.is;yr.$inject=["eventBus","elementFactory","bpmnRules"],rp(yr,wf);var fx=yr,mx=Pa.is;vr.$inject=["eventBus","modeling","canvas"],rp(vr,wf);var yx=vr,vx=Pa.is;gr.$inject=["eventBus","modeling","elementFactory","bpmnFactory"],rp(gr,wf);var gx=gr,bx=Pa.is;br.$inject=["eventBus","bpmnFactory","moddle"],rp(br,wf);var xx=br,Ex=Pa.is;xr.$inject=["eventBus","modeling","elementFactory","bpmnFactory","canvas"],rp(xr,wf);var _x=xr,wx=Pa.is,Sx="__targetRef_placeholder";Er.$inject=["eventBus","bpmnFactory"],rp(Er,wf);var Ax=Er,Tx=Pa.is,Cx=vm.getChildLanes,Rx=ku.eachElement,Px=500;wr.$inject=["eventBus","modeling","spaceTool"],rp(wr,wf);var Mx=wr,kx={},Bx=Sf.pointDistance,Dx=Tf.intersection,Nx=Math.round,Ox=Math.max,jx=10;kx.getApproxIntersection=function(e,t){return function(e,t){var n,i;for(n=0;i=e[n];n++)if(Bx(i,t)<=jx)return{point:e[n],bendpoint:!0,index:n};return null}(e,t)||function(e,t){var n,i=Dx(function(e,t){return[["M",e.x,e.y],["m",0,-t],["a",t,t,0,1,1,0,2*t],["a",t,t,0,1,1,0,-2*t],["z"]]}(t,jx),function(t){var n=[];return e.forEach(function(e,t){n.push([0===t?"M":"L",e.x,e.y])}),n}()),r=i[0],o=i[i.length-1];return r?r!==o?r.segment2!==o.segment2?(n=Ox(r.segment2,o.segment2)-1,{point:e[n],bendpoint:!0,index:n}):{point:{x:Nx(r.x+o.x)/2,y:Nx(r.y+o.y)/2},index:r.segment2}:{point:{x:Nx(r.x),y:Nx(r.y)},index:r.segment2}:null}(e,t)};var Lx=kx.getApproxIntersection;rp(Tr,wf),Tr.$inject=["eventBus","bpmnRules","modeling"];var Ix=Tr,Fx=function(e,t,n,i){var r,o,a,s,c;return 0==(r=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y))?null:(o=e.y-n.y,a=e.x-n.x,c=(i.x-n.x)*o-(i.y-n.y)*a,s=c/r,{x:Math.round(e.x+s*(t.x-e.x)),y:Math.round(e.y+s*(t.y-e.y))})},zx=Hf.getMid;Cr.$inject=["eventBus"];var $x=Cr,Wx={};Wx.getAngle=function(e){return Math.atan((e[1].y-e[0].y)/(e[1].x-e[0].x))},Wx.rotateVector=function(e,t){return t?{x:Math.cos(t)*e.x-Math.sin(t)*e.y,y:Math.sin(t)*e.x+Math.cos(t)*e.y}:e},Wx.getDistancePointPoint=function(e,t){return Pr({x:e.x-t.x,y:e.y-t.y})};var Gx={},Hx=Math.sqrt,Vx=Math.min,Ux=Math.max,qx=Math.abs;Gx.getAttachment=Br;var Yx=.1,Kx={},Xx=Wx.getDistancePointPoint,Zx=Gx.getAttachment;Kx.getLabelAdjustment=jr;var Qx=Pa.is,Jx=Pa.getBusinessObject,eE=Bp.hasExternalLabel,tE=Bp.getExternalLabelMid,nE=Kx.getLabelAdjustment,iE={width:90,height:20};rp(Fr,wf),Fr.$inject=["eventBus","modeling","bpmnFactory"];var rE=Fr,oE={fontFamily:"Arial, sans-serif",fontSize:"11px"},aE=Pa.is,sE="flow elements must be children of pools/participants",cE="participants cannot be pasted onto a non-empty process diagram";zr.$inject=["eventBus","tooltips","translate"];var pE=zr;rp($r,wf),$r.$inject=["eventBus","bpmnRules","modeling"];var lE=$r,uE=Pa.is;Gr.$inject=["eventBus","modeling"],rp(Gr,wf);var hE=Gr,dE=Pa.is;rp(Hr,wf),Hr.$inject=["eventBus","modeling","bpmnRules"];var fE=Hr,mE=ys.isEventSubProcess,yE=Pa.is;rp(Vr,wf),Vr.prototype.replaceElements=function(e,t,n){var i=this._elementRegistry,r=this._bpmnReplace,o=this._selection,a=this._modeling;ms(t,function(t){var o={type:t.newElementType},s=i.get(t.oldElementId);n&&yE(s,"bpmn:BoundaryEvent")&&a.updateAttachment(s,null);var c=e.indexOf(s);e[c]=r.replaceElement(s,o,{select:!1}),n&&yE(e[c],"bpmn:BoundaryEvent")&&a.updateAttachment(e[c],n)}),t&&o.select(e)},Vr.$inject=["eventBus","bpmnReplace","bpmnRules","elementRegistry","selection","modeling"];var vE=Vr,gE=Pa.is,bE=Hf.roundBounds,xE=xd.hasPrimaryModifier,EE=1001;Ur.$inject=["eventBus","modeling"];var _E=Ur,wE=Pa.getBusinessObject,SE=Pa.is,AE=lm.computeChildrenBBox,TE=500;rp(qr,wf),qr.$inject=["eventBus","elementFactory","modeling"];var CE=qr;rp(Yr,wf),Yr.$inject=["eventBus","modeling"];var RE=Yr,PE=Pa.is,ME=Pa.getBusinessObject;rp(Kr,wf),Kr.$inject=["eventBus","modeling"];var kE=Kr,BE=Pa.is,DE=500,NE=5e3;Xr.$inject=["eventBus","modeling","translate"],rp(Xr,wf);var OE={__init__:["appendBehavior","copyPasteBehavior","createBoundaryEventBehavior","createDataObjectBehavior","dropOnFlowBehavior","createParticipantBehavior","dataInputAssociationBehavior","deleteLaneBehavior","importDockingFix","labelBehavior","modelingFeedback","removeParticipantBehavior","replaceConnectionBehavior","replaceElementBehaviour","resizeLaneBehavior","unsetDefaultFlowBehavior","updateFlowNodeRefsBehavior","removeElementBehavior","unclaimIdBehavior","toggleElementCollapseBehaviour"],appendBehavior:["type",fx],copyPasteBehavior:["type",yx],createBoundaryEventBehavior:["type",gx],createDataObjectBehavior:["type",xx],dropOnFlowBehavior:["type",Ix],createParticipantBehavior:["type",_x],dataInputAssociationBehavior:["type",Ax],deleteLaneBehavior:["type",Mx],importDockingFix:["type",$x],labelBehavior:["type",rE],modelingFeedback:["type",pE],removeParticipantBehavior:["type",hE],replaceConnectionBehavior:["type",fE],replaceElementBehaviour:["type",vE],resizeLaneBehavior:["type",_E],unsetDefaultFlowBehavior:["type",kE],updateFlowNodeRefsBehavior:["type",Xr],removeElementBehavior:["type",lE],unclaimIdBehavior:["type",RE],toggleElementCollapseBehaviour:["type",CE]};Zr.prototype.getOrdering=function(e,t){return null},rp(Zr,wf);var jE=Zr,LE=cm.isAny;Qr.$inject=["eventBus","translate"],rp(Qr,jE);var IE={__init__:["bpmnOrderingProvider"],__depends__:[Up],bpmnOrderingProvider:["type",Qr]},FE={},zE=Hf.getOrientation;FE.getBoundaryAttachment=function(e,t){var n=zE(e,t,-15);return"intersect"!==n?n:null};var $E=Pa.is,WE=Hf.asTRBL,GE=vm.collectLanes,HE=vm.getLanesRoot,VE=Math.abs,UE=Math.min,qE=Math.max,YE=60,KE=300,XE=20,ZE=50,QE=20,JE=20;FE.getParticipantSizeConstraints=function(e,t,n){var i=HE(e),r=!0,o=!0,a=GE(i,[i]),s=WE(e),c={},p={};return/e/.test(t)?p.right=s.left+KE:/w/.test(t)&&(p.left=s.right-KE),a.forEach(function(e){var i=WE(e);/n/.test(t)&&(i.tops.bottom+10&&(o=!1),n&&VE(s.bottom-i.top)<10&&eo(c,"bottom",i.bottom-YE),VE(s.bottom-i.bottom)<5&&to(p,"bottom",i.top+YE))}),i.children.filter(function(e){return!e.hidden&&!e.waypoints&&($E(e,"bpmn:FlowElement")||$E(e,"bpmn:Artifact"))}).forEach(function(e){var n=WE(e);r&&/n/.test(t)&&eo(p,"top",n.top-QE),/e/.test(t)&&to(p,"right",n.right+XE),o&&/s/.test(t)&&to(p,"bottom",n.bottom+JE),/w/.test(t)&&eo(p,"left",n.left-ZE)}),{min:p,max:c}};var e_=Pa.is,t_=cm.isAny,n_=Pa.getBusinessObject,i_=ys.isExpanded,r_=ys.isEventSubProcess,o_=ys.isInterrupting,a_=ys.hasErrorEventDefinition,s_=ys.hasEscalationEventDefinition,c_=ys.hasCompensateEventDefinition,p_=FE.getBoundaryAttachment;rp(no,nm),no.$inject=["eventBus"];var l_=no;no.prototype.init=function(){this.addRule("connection.create",function(e){return yo(e.source,e.target)}),this.addRule("connection.reconnectStart",function(e){var t=e.connection;return yo(e.hover||e.source,t.target,t)}),this.addRule("connection.reconnectEnd",function(e){var t=e.connection;return yo(t.source,e.hover||e.target,t)}),this.addRule("connection.updateWaypoints",function(e){return null}),this.addRule("shape.resize",function(e){return So(e.shape,e.newBounds)}),this.addRule("elements.move",function(e){var t=e.target,n=e.shapes,i=e.position;return xo(n,t,null,i)||Eo(n,t,i)||_o(n,t)||Po(n,t)}),this.addRule(["shape.create","shape.append"],function(e){var t=e.target,n=e.shape,i=e.source,r=e.position;return xo([n],t,i,r)||wo(n,t,i,r)}),this.addRule("element.copy",function(e){return ko(e.collection,e.element)}),this.addRule("element.paste",function(e){var t=e.parent,n=e.element,i=e.position,r=e.source,o=e.target;return r||o?yo(r,o):xo([n],t,null,i)||wo(n,t,null,i)}),this.addRule("elements.paste",function(e){return function(e,t){var n=e[0];return e_(t,"bpmn:Collaboration")?sp(n,function(e){return"bpmn:Participant"===e.type}):e_(t,"bpmn:Process")?!(sm(n,function(e){return"bpmn:Participant"===e.type})&&t.children.length>0):!(e_(t,"bpmn:Participant")&&!i_(t))&&(e_(t,"bpmn:FlowElementsContainer")?i_(t):t_(t,["bpmn:Collaboration","bpmn:Lane","bpmn:Participant","bpmn:Process","bpmn:SubProcess"]))}(e.tree,e.target)}),this.addRule(["elements.delete"],function(e){return Xp(e.elements,function(e){return!ho(e)})})},no.prototype.canConnectMessageFlow=To,no.prototype.canConnectSequenceFlow=Co,no.prototype.canConnectDataAssociation=Ro,no.prototype.canConnectAssociation=Ao,no.prototype.canMove=_o,no.prototype.canAttach=xo,no.prototype.canReplace=Eo,no.prototype.canDrop=vo,no.prototype.canInsert=Po,no.prototype.canCreate=wo,no.prototype.canConnect=yo,no.prototype.canResize=So,no.prototype.canCopy=ko;var u_={__depends__:[gy],__init__:["bpmnRules"],bpmnRules:["type",l_]},h_=Pc(function(e){return Cv(Hc(e,!1,!0))}),d_=ab.saveClear,f_=db.getNewAttachShapeDelta,m_=1500;rp(Bo,wf),Bo.$inject=["eventBus","modeling","movePreview","rules"];var y_=Bo,v_=250,g_=1400;rp(No,wf),No.$inject=["eventBus","modeling","movePreview"];var b_=No,x_=500,E_=1250,__=1500,w_=gd.getOriginal,S_=Math.round;jo.$inject=["eventBus","dragging","modeling","selection","rules"];var A_=jo,T_=function(e){var t=e?Ua(e):0;return Ya(t)?t:ls(e).length},C_=Bs.translate,R_=500,P_="djs-dragging",M_="drop-ok",k_="drop-not-ok",B_="new-parent",D_="attach-ok";Lo.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var N_={__depends__:[Cd,jd,Md,gy,yy,Lv],__init__:["move","movePreview"],move:["type",A_],movePreview:["type",Lo]},O_={__depends__:[N_],__init__:["labelSupport"],labelSupport:["type",b_]},j_={__depends__:[N_,O_],__init__:["attachSupport"],attachSupport:["type",y_]},L_=xd.hasPrimaryModifier,I_=Math.abs,F_=Math.round,z_=1500,$_={x:"width",y:"height"},W_={x:"y",y:"x"},G_=ku.selfAndAllChildren;Io.$inject=["eventBus","dragging","canvas","modeling","rules","toolManager"];var H_=Io;Io.prototype.activateSelection=function(e,t,n){this._dragging.init(e,"spaceTool.selection",{trapClick:!1,cursor:"crosshair",autoActivate:t,data:{context:{reactivate:n}}})},Io.prototype.activateMakeSpace=function(e){this._dragging.init(e,"spaceTool",{autoActivate:!0,cursor:"crosshair",data:{context:{}}})},Io.prototype.makeSpace=function(e,t,n,i){return this._modeling.createSpace(e,t,n,i)},Io.prototype.initializeMakeSpace=function(e,t){var n=I_(e.dx)>I_(e.dy)?"x":"y",i=e["d"+n],r=e[n]-i;if(I_(i)<5)return!1;i<0&&(i*=-1),L_(e)&&(i*=-1);var o=this._canvas.getRootElement(),a=G_(o,!0),s=this.calculateAdjustments(a,n,i,r);return Bc(t,s,{axis:n,direction:ax.getDirection(n,i)}),rf.set("resize-"+("x"===n?"ew":"ns")),!0},Io.prototype.calculateAdjustments=function(e,t,n,i){var r=[],o=[],a=this._rules;return e.forEach(function(e){var s=e[t],c=s+e[$_[t]];if(e.parent&&!e.waypoints)return n>0&&s>i?r.push(e):n<0&&ci&&a.allowed("shape.resize",{shape:e})?o.push(e):void 0}),{movingShapes:r,resizingShapes:o}},Io.prototype.toggle=function(){this.isActive()?this._dragging.cancel():this.activateSelection()},Io.prototype.isActive=function(){var e=this._dragging.context();return e&&/^spaceTool/.test(e.prefix)};var V_="djs-dragging",U_="djs-resizing",q_=250,Y_=Bs.translate;Fo.$inject=["eventBus","elementRegistry","canvas","styles","previewSupport"];var K_={__init__:["spaceToolPreview"],__depends__:[yy,gy,sv,Lv],spaceTool:["type",H_],spaceToolPreview:["type",Fo]},X_=new sd("tt"),Z_=".djs-tooltip";$o.$inject=["eventBus","canvas"];var Q_=$o;$o.prototype.add=function(e){if(!e.position)throw new Error("must specifiy tooltip position");if(!e.html)throw new Error("must specifiy tooltip html");var t=this._ids.next();return e=Bc({},this._tooltipDefaults,e,{id:t}),this._addTooltip(e),e.timeout&&this.setTimeout(e),t},$o.prototype.trigger=function(e,t){var n=t.delegateTarget||t.target,i=this.get(cd(n,"data-tooltip-id"));i&&("mouseover"===e&&i.timeout&&this.clearTimeout(i),"mouseout"===e&&i.timeout&&(i.timeout=1e3,this.setTimeout(i)))},$o.prototype.get=function(e){return"string"!=typeof e&&(e=e.id),this._tooltips[e]},$o.prototype.clearTimeout=function(e){if(e=this.get(e)){var t=e.removeTimer;t&&(clearTimeout(t),e.removeTimer=null)}},$o.prototype.setTimeout=function(e){if(e=this.get(e)){this.clearTimeout(e);var t=this;e.removeTimer=setTimeout(function(){t.remove(e)},e.timeout)}},$o.prototype.remove=function(e){var t=this.get(e);t&&(dd(t.html),dd(t.htmlContainer),delete t.htmlContainer,delete this._tooltips[t.id])},$o.prototype.show=function(){zo(this._tooltipRoot)},$o.prototype.hide=function(){zo(this._tooltipRoot,!1)},$o.prototype._updateRoot=function(e){var t=e.scale||1,n=e.scale||1,i="matrix("+t+",0,0,"+n+","+-1*e.x*t+","+-1*e.y*n+")";this._tooltipRoot.style.transform=i,this._tooltipRoot.style["-ms-transform"]=i},$o.prototype._addTooltip=function(e){var t,n=e.id,i=e.html,r=this._tooltipRoot;i.get&&i.constructor.prototype.jquery&&(i=i.get(0)),Cl(i)&&(i=El(i)),(t=El('
')).appendChild(i),e.type&&hd(t).add("djs-tooltip-"+e.type),e.className&&hd(t).add(e.className),e.htmlContainer=t,r.appendChild(t),this._tooltips[n]=e,this._updateTooltip(e)},$o.prototype._updateTooltip=function(e){var t=e.position;!function(e,t,n){Bc(e.style,{left:t+"px",top:n+"px"})}(e.htmlContainer,t.x,t.y)},$o.prototype._updateTooltipVisibilty=function(e){ms(this._tooltips,function(t){var n=t.show,i=t.htmlContainer,r=!0;n&&((n.minZoom>e.scale||n.maxZoom0&&Yo(n,e.primaryTokens,qo.RESULT_PRIMARY_HTML),Yo(n,e.secondaryTokens,qo.RESULT_SECONDARY_HTML),cd(n,qo.RESULT_ID_ATTRIBUTE,t),this._resultsContainer.appendChild(n),n},qo.prototype.registerProvider=function(e){this._searchProvider=e},qo.prototype.open=function(){if(!this._searchProvider)throw new Error("no search provider registered");this.isOpen()||(this._bindEvents(),this._open=!0,hd(this._container).add("open"),this._searchInput.focus(),this._eventBus.fire("searchPad.opened"))},qo.prototype.close=function(){this.isOpen()&&(this._unbindEvents(),this._open=!1,hd(this._container).remove("open"),this._clearResults(),this._searchInput.value="",this._searchInput.blur(),this._resetOverlay(),this._eventBus.fire("searchPad.closed"))},qo.prototype.toggle=function(){this.isOpen()?this.close():this.open()},qo.prototype.isOpen=function(){return this._open},qo.prototype._preselect=function(e){var t=this._getCurrentResult();if(e!==t){t&&hd(t).remove(qo.RESULT_SELECTED_CLASS);var n=cd(e,qo.RESULT_ID_ATTRIBUTE),i=this._results[n].element;hd(e).add(qo.RESULT_SELECTED_CLASS),this._resetOverlay(i),this._centerViewbox(i),this._selection.select(i),this._eventBus.fire("searchPad.preselected",i)}},qo.prototype._select=function(e){var t=cd(e,qo.RESULT_ID_ATTRIBUTE),n=this._results[t].element;this.close(),this._resetOverlay(),this._centerViewbox(n),this._selection.select(n),this._eventBus.fire("searchPad.selected",n)},qo.prototype._centerViewbox=function(e){var t=this._canvas.viewbox(),n=iw(e),i={x:n.x+n.width/2-t.outer.width/2,y:n.y+n.height/2-t.outer.height/2,width:t.outer.width,height:t.outer.height};this._canvas.viewbox(i),this._canvas.zoom(t.scale)},qo.prototype._resetOverlay=function(e){if(this._overlayId&&this._overlays.remove(this._overlayId),e){var t=function(e){var t=e.width+12,n=e.height+12;return{position:{bottom:n-6,right:t-6},show:!0,html:'
'}}(iw(e));this._overlayId=this._overlays.add(e,t)}};var rw=qo;qo.CONTAINER_SELECTOR=".djs-search-container",qo.INPUT_SELECTOR=".djs-search-input input",qo.RESULTS_CONTAINER_SELECTOR=".djs-search-results",qo.RESULT_SELECTOR=".djs-search-result",qo.RESULT_SELECTED_SELECTOR="."+(qo.RESULT_SELECTED_CLASS="djs-search-result-selected"),qo.RESULT_ID_ATTRIBUTE="data-result-id",qo.RESULT_HIGHLIGHT_CLASS="djs-search-highlight",qo.OVERLAY_CLASS="djs-search-overlay",qo.BOX_HTML='
',qo.RESULT_HTML='
',qo.RESULT_PRIMARY_HTML='
',qo.RESULT_SECONDARY_HTML='

';var ow={__depends__:[{__depends__:[vd,jd],searchPad:["type",rw]}],__init__:["bpmnSearch"],bpmnSearch:["type",nw]},aw={left:Zo,center:Zo,right:function(e){return e.x+e.width},top:Xo,middle:Xo,bottom:function(e){return e.y+e.height}},sw=Qo;Qo.$inject=["modeling"],Qo.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},Qo.prototype._isType=function(e,t){return-1!==t.indexOf(e)},Qo.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),a=o.axis,s=o.dimension,c={},p={},l=!1;if(this._isType(e,["left","top"]))c[e]=t[0][a];else if(this._isType(e,["right","bottom"]))r=Ko(t),c[e]=r[a]+r[s];else if(this._isType(e,["center","middle"])){if(ms(t,function(e){var t=e[a]+Math.round(e[s]/2);p[t]?p[t].elements.push(e):p[t]={elements:[e],center:t}}),n=Gf(p,function(e){return e.elements.length>1&&(l=!0),e.elements.length}),l)return c[e]=Ko(n).center,c;i=t[0],r=Ko(t=Gf(t,function(e){return e[a]+e[s]})),c[e]=function(e,t){return Math.round((e[a]+t[a]+t[s])/2)}(i,r)}return c},Qo.prototype.trigger=function(e,t){var n=this._modeling,i=Xp(e,function(e){return!(e.waypoints||e.host||e.labelTarget)}),r=Gf(i,aw[t]),o=this._alignmentPosition(t,r);n.alignElements(r,o)};var cw={__init__:["alignElements"],alignElements:["type",sw]},pw={__depends__:[jd,Hy,Ef],__init__:["editorActions"],editorActions:["type",Zy]},lw=xd.hasPrimaryModifier,uw=1500;Jo.$inject=["eventBus","canvas","dragging","toolManager"];var hw=Jo;Jo.prototype.activateMove=function(e,t,n){"object"==typeof t&&(n=t,t=!1),this._dragging.init(e,"hand.move",{autoActivate:t,cursor:"grab",data:{context:n||{}}})},Jo.prototype.activateHand=function(e,t,n){this._dragging.init(e,"hand",{trapClick:!1,autoActivate:t,cursor:"grab",data:{context:{reactivate:n}}})},Jo.prototype.toggle=function(){this.isActive()?this._dragging.cancel():this.activateHand()},Jo.prototype.isActive=function(){var e=this._dragging.context();return e&&/^hand/.test(e.prefix)};var dw={__depends__:[sv],__init__:["handTool"],handTool:["type",hw]},fw=ku.getEnclosedElements,mw=xd.hasSecondaryModifier;ea.$inject=["eventBus","canvas","dragging","elementRegistry","selection","toolManager"];var yw=ea;ea.prototype.activateLasso=function(e,t){this._dragging.init(e,"lasso",{autoActivate:t,cursor:"crosshair",data:{context:{}}})},ea.prototype.activateSelection=function(e){this._dragging.init(e,"lasso.selection",{trapClick:!1,cursor:"crosshair",data:{context:{}}})},ea.prototype.select=function(e,t){var n=fw(e,t);this._selection.select(Kf(n))},ea.prototype.toggle=function(){this.isActive()?this._dragging.cancel():this.activateSelection()},ea.prototype.isActive=function(){var e=this._dragging.context();return e&&/^lasso/.test(e.prefix)};var vw={__depends__:[sv],__init__:["lassoTool"],lassoTool:["type",yw]},gw={__depends__:[cw,pw,dw,vw,K_,cv,Vy,Xy,ow,tw],editorActions:["type",ev]};na.$inject=["keyboard","editorActions"];var bw=na,xw=cl;ia.$inject=["config.keyboard","eventBus","editorActions"];var Ew=ia;ia.prototype.bind=function(e){this.unbind(),this._node=e,Ud.bind(e,"keydown",this._keyHandler,!0),this._fire("bind")},ia.prototype.getBinding=function(){return this._node},ia.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),Ud.unbind(e,"keydown",this._keyHandler,!0)),this._node=null},ia.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node,listeners:this._listeners})},ia.prototype._init=function(){var e=this._listeners,t=this._editorActions,n=this._config;e.push(function(e,n){if(ra(n)&&!oa(n)&&90===e)return t.trigger("undo"),!0}),e.push(function(e,n){if(ra(n)&&(89===e||90===e&&oa(n)))return t.trigger("redo"),!0}),e.push(function(e,n){if(ra(n)&&67===e)return t.trigger("copy"),!0}),e.push(function(e,n){if(ra(n)&&86===e)return t.trigger("paste"),!0}),e.push(function(e,n){if(46===e)return t.trigger("removeSelection"),!0}),e.push(function(e,n){if((107===e||187===e||171===e||61===e)&&ra(n))return t.trigger("stepZoom",{value:1}),!0}),e.push(function(e,n){if((109===e||189===e||173===e)&&ra(n))return t.trigger("stepZoom",{value:-1}),!0}),e.push(function(e,n){if((96===e||48===e)&&ra(n))return t.trigger("zoom",{value:1}),!0}),e.push(function(e,i){if([37,38,39,40].indexOf(e)>=0){var r={invertY:n.invertY,speed:n.speed||50};switch(e){case 37:r.direction="left";break;case 38:r.direction="up";break;case 39:r.direction="right";break;case 40:r.direction="down"}return t.trigger("moveCanvas",r),!0}})},ia.prototype.addListener=function(e){this._listeners.push(e)},ia.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},ia.prototype.isCmd=ra,ia.prototype.isShift=oa;var _w={__depends__:[{__init__:["keyboard"],keyboard:["type",Ew]}],__init__:["bpmnKeyBindings"],bpmnKeyBindings:["type",bw]},ww=aa;aa.$inject=["palette","create","elementFactory","spaceTool","lassoTool","handTool","globalConnect","translate"],aa.prototype.getPaletteEntries=function(e){function t(e,t,n,i,a){function s(t){var n=o.createShape(Bc({type:e},a));a&&(n.businessObject.di.isExpanded=a.isExpanded),r.start(t,n)}var c=e.replace(/^bpmn\:/,"");return{group:t,className:n,title:i||l("Create {type}",{type:c}),action:{dragstart:s,click:s}}}function n(e,t){r.start(e,o.createParticipantShape(t))}var i={},r=this._create,o=this._elementFactory,a=this._spaceTool,s=this._lassoTool,c=this._handTool,p=this._globalConnect,l=this._translate;return Bc(i,{"hand-tool":{group:"tools",className:"bpmn-icon-hand-tool",title:l("Activate the hand tool"),action:{click:function(e){c.activateHand(e)}}},"lasso-tool":{group:"tools",className:"bpmn-icon-lasso-tool",title:l("Activate the lasso tool"),action:{click:function(e){s.activateSelection(e)}}},"space-tool":{group:"tools",className:"bpmn-icon-space-tool",title:l("Activate the create/remove space tool"),action:{click:function(e){a.activateSelection(e)}}},"global-connect-tool":{group:"tools",className:"bpmn-icon-connection-multi",title:l("Activate the global connect tool"),action:{click:function(e){p.toggle(e)}}},"tool-separator":{group:"tools",separator:!0},"create.start-event":t("bpmn:StartEvent","event","bpmn-icon-start-event-none"),"create.intermediate-event":t("bpmn:IntermediateThrowEvent","event","bpmn-icon-intermediate-event-none",l("Create IntermediateThrowEvent/BoundaryEvent")),"create.end-event":t("bpmn:EndEvent","event","bpmn-icon-end-event-none"),"create.exclusive-gateway":t("bpmn:ExclusiveGateway","gateway","bpmn-icon-gateway-xor"),"create.task":t("bpmn:Task","activity","bpmn-icon-task"),"create.data-object":t("bpmn:DataObjectReference","data-object","bpmn-icon-data-object"),"create.data-store":t("bpmn:DataStoreReference","data-store","bpmn-icon-data-store"),"create.subprocess-expanded":t("bpmn:SubProcess","activity","bpmn-icon-subprocess-expanded",l("Create expanded SubProcess"),{isExpanded:!0}),"create.participant-expanded":{group:"collaboration",className:"bpmn-icon-participant",title:l("Create Pool/Participant"),action:{dragstart:n,click:n}}}),i};sa.$inject=["eventBus","canvas","dragging"];var Sw=sa;sa.prototype.registerProvider=function(e){this._providers.push(e),this._container||this._init(),this._update()},sa.prototype.getEntries=function(){var e={};return ms(this._providers,function(t){var n=t.getPaletteEntries();ms(n,function(t,n){e[n]=t})}),e},sa.prototype._init=function(){var e=this._canvas,t=this._eventBus,n=e.getContainer(),i=this._container=El(sa.HTML_MARKUP),r=this;n.appendChild(i),yl.bind(i,".djs-palette-toggle, .entry","click",function(e){var t=e.delegateTarget;if(xw(t,".djs-palette-toggle"))return r.toggle();r.trigger("click",e)}),Ud.bind(i,"mousedown",function(e){e.stopPropagation()}),yl.bind(i,".entry","dragstart",function(e){r.trigger("dragstart",e)}),t.fire("palette.create",{html:i}),t.on("canvas.resized",this.triggerTwoColumn,this)},sa.prototype._update=function(){var e=up(".djs-palette-entries",this._container),t=this._entries=this.getEntries();Wh(e),ms(t,function(t,n){var i=t.group||"default",r=up("[data-group="+i+"]",e);r||(r=El('
'),e.appendChild(r));var o=t.html||(t.separator?'
':'
'),a=El(o);r.appendChild(a),t.separator||(cd(a,"data-action",n),t.title&&cd(a,"title",t.title),t.className&&function(e,t){var n=hd(e);(rs(t)?t:t.split(/\s+/g)).forEach(function(e){n.add(e)})}(a,t.className),t.imageUrl&&a.appendChild(El('')))}),this.open(!0)},sa.prototype.trigger=function(e,t,n){var i,r,o,a=this._entries,s=t.delegateTarget||t.target;if(!s)return t.preventDefault();(i=a[cd(s,"data-action")])&&(r=i.action,o=t.originalEvent||t,La(r)?"click"===e&&r(o,n):r[e]&&r[e](o,n),t.preventDefault())},sa.prototype.triggerTwoColumn=function(){var e=this._canvas.getContainer();e.clientHeight<650?hd(e).add("two-column"):hd(e).remove("two-column")},sa.prototype.close=function(){var e=this._canvas.getContainer();hd(this._container).remove("open"),hd(e).remove("two-column")},sa.prototype.open=function(){hd(this._container).add("open"),this.triggerTwoColumn()},sa.prototype.toggle=function(e){this.isOpen()?this.close():this.open()},sa.prototype.isActiveTool=function(e){return e&&this._activeTool===e},sa.prototype.updateToolHighlight=function(e){var t,n;this._toolsContainer||(t=up(".djs-palette-entries",this._container),this._toolsContainer=up("[data-group=tools]",t)),n=this._toolsContainer,ms(n.children,function(t){var n=t.getAttribute("data-action");n&&(n=n.replace("-tool",""),t.classList.contains("entry")&&n===e?hd(t).add("highlighted-entry"):hd(t).remove("highlighted-entry"))})},sa.prototype.isOpen=function(){return this._container&&hd(this._container).has("open")},sa.HTML_MARKUP='
';var Aw={__depends__:[{__depends__:[sv],__init__:["palette"],palette:["type",Sw]},Ry,K_,vw,dw,Up,cv],__init__:["paletteProvider"],paletteProvider:["type",ww]},Tw=250;ca.$inject=["eventBus","elementRegistry","elementFactory","canvas","previewSupport"],rp(ca,wf);var Cw={__depends__:[Lv],__init__:["bpmnReplacePreview"],bpmnReplacePreview:["type",ca]},Rw={},Pw=Math.abs,Mw=Math.round;Rw.snapTo=function(e,t,n){n=void 0===n?10:n;var i,r;for(i=0;i\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=e.console&&(e.console.warn||e.console.log);return o&&o.call(e.console,r,i),t.apply(this,arguments)}}function c(e,t,n){var i,r=t.prototype;(i=e.prototype=Object.create(r)).constructor=e,i._super=r,n&&Z(i,n)}function p(e,t){return function(){return e.apply(t,arguments)}}function l(e,t){return typeof e==ee?e.apply(t?t[0]||i:i,t):e}function u(e,t){return e===i?t:e}function h(e,t,n){a(y(t),function(t){e.addEventListener(t,n,!1)})}function d(e,t,n){a(y(t),function(t){e.removeEventListener(t,n,!1)})}function f(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function m(e,t){return e.indexOf(t)>-1}function y(e){return e.trim().split(/\s+/g)}function v(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;in[t]}):i.sort()),i}function x(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),a=0;a1&&!n.firstMultiple?n.firstMultiple=S(t):1===o&&(n.firstMultiple=!1);var a=n.firstInput,s=n.firstMultiple,c=s?s.center:a.center,p=t.center=A(r);t.timeStamp=ie(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=P(c,p),t.distance=R(c,p),function(e,t){var n=t.center,i=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};t.eventType!==ue&&o.eventType!==de||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=e.offsetDelta={x:n.x,y:n.y});t.deltaX=r.x+(n.x-i.x),t.deltaY=r.y+(n.y-i.y)}(n,t),t.offsetDirection=C(t.deltaX,t.deltaY);var l=T(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=ne(l.x)>ne(l.y)?l.x:l.y,t.scale=s?function(e,t){return R(t[0],t[1],Se)/R(e[0],e[1],Se)}(s.pointers,r):1,t.rotation=s?function(e,t){return P(t[1],t[0],Se)+P(e[1],e[0],Se)}(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,a,s=e.lastInterval||t,c=t.timeStamp-s.timeStamp;if(t.eventType!=fe&&(c>le||s.velocity===i)){var p=t.deltaX-s.deltaX,l=t.deltaY-s.deltaY,u=T(c,p,l);r=u.x,o=u.y,n=ne(u.x)>ne(u.y)?u.x:u.y,a=C(p,l),e.lastInterval=t}else n=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=a}(n,t);var u=e.element;f(t.srcEvent.target,u)&&(u=t.srcEvent.target);t.target=u}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function S(e){for(var t=[],n=0;n=ne(t)?e<0?ye:ve:t<0?ge:be}function R(e,t,n){n||(n=we);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return Math.sqrt(i*i+r*r)}function P(e,t,n){n||(n=we);var i=t[n[0]]-e[n[0]],r=t[n[1]]-e[n[1]];return 180*Math.atan2(r,i)/Math.PI}function M(){this.evEl=Te,this.evWin=Ce,this.pressed=!1,_.apply(this,arguments)}function k(){this.evEl=Me,this.evWin=ke,_.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function B(){this.evTarget=De,this.evWin=Ne,this.started=!1,_.apply(this,arguments)}function D(){this.evTarget=je,this.targetIds={},_.apply(this,arguments)}function N(){_.apply(this,arguments);var e=p(this.handler,this);this.touch=new D(this.manager,e),this.mouse=new M(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function O(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var i=this.lastTouches,r=function(){var e=i.indexOf(n);e>-1&&i.splice(e,1)};setTimeout(r,Le)}}function j(e,t){this.manager=e,this.set(t)}function L(e){this.options=Z({},this.defaults,e||{}),this.id=ae++,this.manager=null,this.options.enable=u(this.options.enable,!0),this.state=qe,this.simultaneous={},this.requireFail=[]}function I(e){return e&Qe?"cancel":e&Xe?"end":e&Ke?"move":e&Ye?"start":""}function F(e){return e==be?"down":e==ge?"up":e==ye?"left":e==ve?"right":""}function z(e,t){var n=t.manager;return n?n.get(e):e}function $(){L.apply(this,arguments)}function W(){$.apply(this,arguments),this.pX=null,this.pY=null}function G(){$.apply(this,arguments)}function H(){L.apply(this,arguments),this._timer=null,this._input=null}function V(){$.apply(this,arguments)}function U(){$.apply(this,arguments)}function q(){L.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Y(e,t){return t=t||{},t.recognizers=u(t.recognizers,Y.defaults.preset),new K(e,t)}function K(e,t){this.options=Z({},Y.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=function(e){var t=e.options.inputClass;return new(t||(ce?k:pe?D:se?N:M))(e,w)}(this),this.touchAction=new j(this,this.options.touchAction),X(this,!0),a(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function X(e,t){var n=e.element;if(n.style){var i;a(e.options.cssProps,function(r,o){i=x(n.style,o),t?(e.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=e.oldCssProps[i]||""}),t||(e.oldCssProps={})}}var Z,Q=["","webkit","Moz","MS","ms","o"],J=t.createElement("div"),ee="function",te=Math.round,ne=Math.abs,ie=Date.now;Z="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){function t(t){n.manager.emit(t,e)}var n=this,i=this.state;i=Xe&&t(n.options.event+I(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=32},canEmit:function(){for(var e=0;et.threshold&&r&t.direction},attrTest:function(e){return $.prototype.attrTest.call(this,e)&&(this.state&Ye||!(this.state&Ye)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=F(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),c(G,$,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ge]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&Ye)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),c(H,L,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[$e]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!n||e.eventType&(de|fe)&&!o)this.reset();else if(e.eventType&ue)this.reset(),this._timer=r(function(){this.state=Ze,this.tryEmit()},t.time,this);else if(e.eventType&de)return Ze;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===Ze&&(e&&e.eventType&de?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=ie(),this.manager.emit(this.options.event,this._input)))}}),c(V,$,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ge]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&Ye)}}),c(U,$,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:xe|Ee,pointers:1},getTouchAction:function(){return W.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(xe|Ee)?t=e.overallVelocity:n&xe?t=e.overallVelocityX:n&Ee&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&ne(t)>this.options.velocity&&e.eventType&de},emit:function(e){var t=F(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),c(q,L,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[We]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,i=e.distance',e)},Ra.prototype._createModdle=function(e){var t=ef.prototype._createModdle.call(this,e);return t.ids=new ip([32,36,1]),t},Ra.prototype._collectIds=function(e,t){var n,i=e.$model.ids;i.clear();for(n in t.elementsById)i.claim(n,t.elementsById[n])},Ra.prototype._interactionModules=[lf,FS,Ef],Ra.prototype._modelingModules=[iS,DS,N_,Yv,am,gw,Py,_w,Kv,tw,Aw,Cw,tS],Ra.prototype._modules=[].concat(Ra.prototype._modules,Ra.prototype._interactionModules,Ra.prototype._modelingModules),zS});