bpmn-js 0.28.3 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- /*! bpmn-js - bpmn-navigated-viewer v0.28.3 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
2
- !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(){var e=function(e,t,r){if("string"==typeof t){if(void 0===r)return function(e,t){return n[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);i(e,t,r)}else!function(e,t){var n,r,a=Object.keys(t);for(n=0;r=a[n];n++)i(e,r,t[r])}(e,t);return e},t=2,n={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":t,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":t,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function i(e,i,r){var a=i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=n[a];o?(o===t&&"number"==typeof r&&(r=String(r)+"px"),e.style[a]=r):e.setAttributeNS(null,i,r)}var r={svg:"http://www.w3.org/2000/svg"},a=function(e){"<svg"===e.substring(0,4)?-1===e.indexOf(r.svg)&&(e=o+e.substring(4)):e=o+">"+e+"</svg>";return function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e)},o='<svg xmlns="'+r.svg+'"';var s=function(t,n){var i;"<"===t.charAt(0)?(i=a(t).firstChild,i=document.importNode(i,!0)):i=document.createElementNS(r.svg,t);n&&e(i,n);return i};var p={};function l(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}p.componentsToPath=function(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")},p.createLine=function(t,n){var i=s("polyline");return e(i,{points:l(t)}),n&&e(i,n),i},p.updateLine=function(t,n){return e(t,{points:l(n)}),t};var c={};Object.defineProperty(c,"__esModule",{value:!0});var u=Object.prototype.toString,h=Object.prototype.hasOwnProperty;function m(e){return null==e}function f(e){return"[object Array]"===u.call(e)}function d(e){return"[object Object]"===u.call(e)}function y(e){return"[object Function]"===u.call(e)}function g(e,t){return h.call(e,t)}function v(e,t){var n;return t=S(t),x(e,function(e,i){if(t(e,i))return n=e,!1}),n}function x(e,t){if(!m(e)){var n=f(e)?R:C;for(var i in e){if(g(e,i))if(!1===t(e[i],n(i)))return}}}function b(e,t,n){return x(e,function(e,i){n=t(n,e,i)}),n}function E(e,t){return b(e,function(e,n,i){return e&&t(n,i)},!0)}function w(e,t){var n=[];return x(e,function(e,i){n.push(t(e,i))}),n}function _(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=A(t),x(e,function(e){var i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)}),n}function A(e){return y(e)?e:function(t){return t[e]}}function S(e){return y(e)?e:function(t){return t===e}}function C(e){return e}function R(e){return Number(e)}var M=Array.prototype.slice;var k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};c.find=v,c.filter=function(e,t){var n=[];return x(e,function(e,i){t(e,i)&&n.push(e)}),n},c.forEach=x,c.reduce=b,c.every=E,c.some=function(e,t){return!!v(e,t)},c.map=w,c.groupBy=_,c.matchPattern=function(e){return function(t){return E(e,function(e,n){return t[n]===e})}},c.debounce=function(e,t){var n;return function(){var i=M.call(arguments);n&&clearTimeout(n),n=setTimeout(function(){e.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(i))},t)}},c.bind=function(e,t){return e.bind(t)},c.isArray=f,c.isObject=d,c.isNumber=function(e){return"[object Number]"===u.call(e)},c.isFunction=y,c.isString=function(e){return"[object String]"===u.call(e)},c.assign=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return k.apply(void 0,[e].concat(n))},c.pick=function(e,t){var n={},i=Object(e);return x(t,function(t){t in i&&(n[t]=e[t])}),n},c.omit=function(e,t){var n={};return x(Object(e),function(e,i){-1===t.indexOf(i)&&(n[i]=e)}),n};var P={},T=c.every,N=c.some,D=p.componentsToPath;function O(e){return e.businessObject.di}P.isTypedEvent=function(e,t,n){return N(e.eventDefinitions,function(i){return i.$type===t&&function(e,t){return T(t,function(t,n){return e[n]==t})}(e,n)})},P.isThrowEvent=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type},P.isCollection=function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection},P.getDi=O,P.getSemantic=function(e){return e.businessObject},P.getFillColor=function(e,t){return O(e).get("bioc:fill")||t||"white"},P.getStrokeColor=function(e,t){return O(e).get("bioc:stroke")||t||"black"},P.getCirclePath=function(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2;return D([["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]])},P.getRoundRectPath=function(e,t){var n=e.x,i=e.y,r=e.width,a=e.height;return D([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,a-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-a],["a",t,t,0,0,1,t,-t],["z"]])},P.getDiamondPath=function(e){var t=e.width,n=e.height,i=e.x,r=e.y,a=t/2,o=n/2;return D([["M",i+a,r],["l",a,o],["l",-a,o],["l",-a,-o],["z"]])},P.getRectPath=function(e){var t=e.x,n=e.y,i=e.width,r=e.height;return D([["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]])};var B={};function L(e){return e&&e.businessObject||e}B.is=function(e,t){var n=L(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)},B.getBusinessObject=L;var I={},F=B.is,j=B.getBusinessObject;c.forEach;I.isExpanded=function(e){return!F(e,"bpmn:CallActivity")&&(F(e,"bpmn:SubProcess")?!!j(e).di.isExpanded:!F(e,"bpmn:Participant")||!!j(e).processRef)},I.isEventSubProcess=function(e){return e&&!!j(e).triggeredByEvent};var V=1e3;function W(e,t){var n=this;t=t||V,e.on(["render.shape","render.connection"],t,function(e,t){var i=e.type,r=t.element,a=t.gfx;if(n.canRender(r))return"render.shape"===i?n.drawShape(a,r):n.drawConnection(a,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)})}W.prototype.canRender=function(){},W.prototype.drawShape=function(){},W.prototype.drawConnection=function(){},W.prototype.getShapePath=function(){},W.prototype.getConnectionPath=function(){};var z=W,G={},$=s("svg");function H(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}G.createTransform=function(e){return e?$.createSVGTransformFromMatrix(e):$.createSVGTransform()},G.createMatrix=function(e,t,n,i,r,a){var o=$.createSVGMatrix();switch(arguments.length){case 0:return o;case 6:e={a:e,b:t,c:n,d:i,e:r,f:a}}return H(o,e)};var K=function(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(U(e,i));e.consolidate()}(n,t):n.initialize(U(n,t))};function U(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}var q={},Y=G.createTransform;q.transform=function(e,t,n,i,r){var a=Y();a.setTranslate(t,n);var o=Y();o.setRotate(i,0,0);var s=Y();s.setScale(r||1,r||1),K(e,[a,o,s])},q.translate=function(e,t,n){var i=Y();i.setTranslate(t,n),K(e,i)},q.rotate=function(e,t){var n=Y();n.setRotate(t,0,0),K(e,n)};var X=function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e};var Z=function(e,t){return t.appendChild(X(e,t)),e};var J=function(e,t){return Z(t,e),e};var Q=function(e){var t=e.parentNode;t&&t.removeChild(e);return e};var ee=c.isObject,te=c.assign,ne=c.pick,ie=c.forEach,re=c.reduce,ae=0,oe={width:150,height:50};function se(e,t){t.textContent=e;try{var n,i=""===e;return t.textContent=i?"dummy":e,n=ne(t.getBBox(),["width","height"]),i&&(n.width=0),n}catch(e){return{width:0,height:0}}}function pe(e,t,n){for(var i,r=e.shift(),a=r;;){if((i=se(a,n)).width=a?i.width:0," "===a||""===a||i.width<Math.round(t)||a.length<2)return le(e,a,r,i);a=ce(a,i.width,t)}}function le(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}function ce(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-)/g),r=[],a=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+a<t)){"-"===n&&r.pop();break}r.push(n),a+=n.length}return r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function ue(e){this._config=te({},{size:oe,padding:ae,style:{},align:"center-top"},e||{})}ue.prototype.createText=function(e,t){return this.layoutText(e,t).element},ue.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},ue.prototype.layoutText=function(t,n){var i=te({},this._config.size,n.box),r=te({},this._config.style,n.style),a=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(n.align||this._config.align),o=function(e){return ee(e)?te({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==n.padding?n.padding:this._config.padding),p=n.fitBox||!1,l=t.split(/\r?\n/g),c=[],u=i.width-o.left-o.right,h=s("text");e(h,{x:0,y:0}),e(h,r);var m=function(){var t=document.getElementById("helper-svg");return t||(t=s("svg"),e(t,{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(t)),t}();for(J(m,h);l.length;)c.push(pe(l,u,h));var f,d,y=re(c,function(e,t,n){return e+t.height},0),g=re(c,function(e,t,n){return t.width>e?t.width:e},0);switch(a.vertical){case"middle":f=(i.height-y)/2-c[0].height/4;break;default:f=o.top}var v=s("text");return e(v,r),ie(c,function(t){switch(f+=t.height,a.horizontal){case"left":d=o.left;break;case"right":d=(p?g:u)-o.right-t.width;break;default:d=Math.max(((p?g:u)-t.width)/2+o.left,0)}var n=s("tspan");e(n,{x:d,y:f}),n.textContent=t.text,J(v,n)}),Q(h),{dimensions:{width:g,height:y},element:v}};var he=ue,me={},fe=me=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;var r=n-Math.floor(n),a="";for(i=0;i<Math.floor(n);i++){a=Math.floor(Math.random()*t).toString(t)+a}if(r){var o=Math.pow(t,r);a=Math.floor(Math.random()*o).toString(t)+a}var s=parseInt(a,t);return s!==1/0&&s>=Math.pow(2,e)?fe(e,t):a};function de(e){if(!(this instanceof de))return new de(e);e=e||[128,36,1],this._seed=e.length?me.rack(e[0],e[1],e[2]):e}fe.rack=function(e,t,n){var i=function(i){var a=0;do{if(a++>10){if(!n)throw new Error("too many ID collisions, use more bits");e+=n}var o=fe(e,t)}while(Object.hasOwnProperty.call(r,o));return r[o]=i,o},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 ye=de;de.prototype.next=function(e){return this._seed(e||!0)},de.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},de.prototype.claim=function(e,t){this._seed.set(e,t||!0)},de.prototype.assigned=function(e){return this._seed.get(e)||!1},de.prototype.unclaim=function(e){delete this._seed.hats[e]},de.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var ge={};ge="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 ve={};Object.defineProperty(ve,"__esModule",{value:!0});var xe=[].indexOf,be=function(e,t){if(xe)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},Ee=/\s+/,we=Object.prototype.toString;function _e(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}_e.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~be(t,e)||t.push(e),this.el.className=t.join(" "),this},_e.prototype.remove=function(e){if("[object RegExp]"==we.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=be(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},_e.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},_e.prototype.toggle=function(e,t){return this.list?(void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},_e.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(Ee);return""===e[0]&&e.shift(),e},_e.prototype.has=_e.prototype.contains=function(e){return this.list?this.list.contains(e):!!~be(this.array(),e)};var Ae=Element.prototype,Se=Ae.matchesSelector||Ae.webkitMatchesSelector||Ae.mozMatchesSelector||Ae.msMatchesSelector||Ae.oMatchesSelector,Ce=function(e,t){if(Se)return Se.call(e,t);for(var n=e.parentNode.querySelectorAll(t),i=0;i<n.length;++i)if(n[i]==e)return!0;return!1};var Re,Me=function(e,t,n){for(var i=n?e:e.parentNode;i&&i!==document;){if(Ce(i,t))return i;i=i.parentNode}},ke=window.addEventListener?"addEventListener":"attachEvent",Pe=window.removeEventListener?"removeEventListener":"detachEvent",Te="addEventListener"!==ke?"on":"",Ne={bind:function(e,t,n,i){return e[ke](Te+t,n,i||!1),n},unbind:function(e,t,n,i){return e[Pe](Te+t,n,i||!1),n}},De=["focus","blur"],Oe={bind:function(e,t,n,i,r){return-1!==De.indexOf(n)&&(r=!0),Ne.bind(e,n,function(n){var r=n.target||n.srcElement;n.delegateTarget=Me(r,t,!0),n.delegateTarget&&i.call(e,n)},r)},unbind:function(e,t,n,i){-1!==De.indexOf(t)&&(i=!0),Ne.unbind(e,t,n,i)}},Be=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){var r=t.createElement("html");return r.innerHTML=e,r.removeChild(r.lastChild)}var a=Ie[i]||Ie._default,o=a[0],s=a[1],p=a[2];(r=t.createElement("div")).innerHTML=s+e+p;for(;o--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var l=t.createDocumentFragment();for(;r.firstChild;)l.appendChild(r.removeChild(r.firstChild));return l},Le=!1;"undefined"!=typeof document&&((Re=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',Le=!Re.getElementsByTagName("link").length,Re=void 0);var Ie={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:Le?[1,"X<div>","</div>"]:[0,"",""]};Ie.td=Ie.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],Ie.option=Ie.optgroup=[1,'<select multiple="multiple">',"</select>"],Ie.thead=Ie.tbody=Ie.colgroup=Ie.caption=Ie.tfoot=[1,"<table>","</table>"],Ie.polyline=Ie.ellipse=Ie.polygon=Ie.circle=Ie.text=Ie.line=Ie.path=Ie.rect=Ie.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var Fe="undefined"!=typeof Element?Element.prototype:{};Fe.matches||Fe.matchesSelector||Fe.webkitMatchesSelector||Fe.mozMatchesSelector||Fe.msMatchesSelector||Fe.oMatchesSelector;ve.attr=function(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)},ve.classes=function(e){return new _e(e)},ve.clear=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e},ve.closest=Me,ve.delegate=Oe,ve.domify=Be,ve.event=Ne,ve.query=function(e,t){return(t=t||document).querySelector(e)},ve.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var je=function(e){return new $e(e)},Ve=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},We=/\s+/,ze=Object.prototype.toString;function Ge(e){return void 0!==e}function $e(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}$e.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~Ve(t,e)||t.push(e),Ge(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},$e.prototype.remove=function(e){if("[object RegExp]"===ze.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=Ve(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},$e.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},$e.prototype.toggle=function(e,t){return this.list?(Ge(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(Ge(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},$e.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(We);return""===e[0]&&e.shift(),e},$e.prototype.has=$e.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Ve(this.array(),e)};var He=c.isObject,Ke=c.assign,Ue=c.forEach,qe=B.is,Ye=p.createLine,Xe=P.isTypedEvent,Ze=P.isThrowEvent,Je=P.isCollection,Qe=P.getDi,et=P.getSemantic,tt=P.getCirclePath,nt=P.getRoundRectPath,it=P.getDiamondPath,rt=P.getRectPath,at=P.getFillColor,ot=P.getStrokeColor,st=ve.query,pt=q.rotate,lt=q.transform,ct=q.translate,ut=new ye,ht=10,mt=3,ft={fontFamily:"Arial, sans-serif",fontSize:12},dt=.95,yt=.35;function gt(t,n,i,r,a){z.call(this,t,a);var o=ut.next(),p=new he({style:ft,size:{width:100}}),l={},c=n.computeStyle;function u(t,n){var i=Ke({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},n.attrs),a=n.ref||{x:0,y:0},o=n.scale||1;"none"===i.strokeDasharray&&(i.strokeDasharray=[1e4,1]);var p=s("marker");e(n.element,i),J(p,n.element),e(p,{id:t,viewBox:"0 0 20 20",refX:a.x,refY:a.y,markerWidth:20*o,markerHeight:20*o,orient:"auto"});var c=st("defs",r._svg);c||(c=s("defs"),J(r._svg,c)),J(c,p),l[t]=p}function h(t,n,i){var r=t+"-"+n+"-"+i+"-"+o;return l[r]||function(t,n,i){var r=t+"-"+n+"-"+i+"-"+o;if("sequenceflow-end"===t){var a=s("path");e(a,{d:"M 1 5 L 11 10 L 1 15 Z"}),u(r,{element:a,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===t){var p=s("circle");e(p,{cx:6,cy:6,r:3.5}),u(r,{element:p,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===t){var l=s("path");e(l,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),u(r,{element:l,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===t){var c=s("path");e(c,{d:"M 11 5 L 1 10 L 11 15"}),u(r,{element:c,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===t){var h=s("path");e(h,{d:"M 1 5 L 11 10 L 1 15"}),u(r,{element:h,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===t){var m=s("path");e(m,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),u(r,{element:m,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){var f=s("path");e(f,{d:"M 6 4 L 10 16"}),u(r,{element:f,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}(t,n,i),"url(#"+r+")"}function m(t,n,i,r,a){He(r)&&(a=r,r=0),r=r||0,a=c(a,{stroke:"black",strokeWidth:2,fill:"white"});var o=n/2,p=i/2,l=s("circle");return e(l,{cx:o,cy:p,r:Math.round((n+i)/4-r)}),e(l,a),J(t,l),l}function f(t,n,i,r,a,o){He(a)&&(o=a,a=0),a=a||0,o=c(o,{stroke:"black",strokeWidth:2,fill:"white"});var p=s("rect");return e(p,{x:a,y:a,width:n-2*a,height:i-2*a,rx:r,ry:r}),e(p,o),J(t,p),p}function d(e,t,n){n=c(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"});var i=Ye(t,n);return J(e,i),i}function y(t,n,i){i=c(i,["no-fill"],{strokeWidth:2,stroke:"black"});var r=s("path");return e(r,{d:n}),e(r,i),J(t,r),r}function g(e,t,n,i){return y(t,n,Ke({"data-marker":e},i))}function v(e){return function(t,n){return S[e](t,n)}}function x(e){return S[e]}function b(e,t){var n=et(e),i=Ze(n);return Xe(n,"bpmn:MessageEventDefinition")?x("bpmn:MessageEventDefinition")(t,e,i):Xe(n,"bpmn:TimerEventDefinition")?x("bpmn:TimerEventDefinition")(t,e,i):Xe(n,"bpmn:ConditionalEventDefinition")?x("bpmn:ConditionalEventDefinition")(t,e):Xe(n,"bpmn:SignalEventDefinition")?x("bpmn:SignalEventDefinition")(t,e,i):Xe(n,"bpmn:CancelEventDefinition")&&Xe(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!1})?x("bpmn:MultipleEventDefinition")(t,e,i):Xe(n,"bpmn:CancelEventDefinition")&&Xe(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!0})?x("bpmn:ParallelMultipleEventDefinition")(t,e,i):Xe(n,"bpmn:EscalationEventDefinition")?x("bpmn:EscalationEventDefinition")(t,e,i):Xe(n,"bpmn:LinkEventDefinition")?x("bpmn:LinkEventDefinition")(t,e,i):Xe(n,"bpmn:ErrorEventDefinition")?x("bpmn:ErrorEventDefinition")(t,e,i):Xe(n,"bpmn:CancelEventDefinition")?x("bpmn:CancelEventDefinition")(t,e,i):Xe(n,"bpmn:CompensateEventDefinition")?x("bpmn:CompensateEventDefinition")(t,e,i):Xe(n,"bpmn:TerminateEventDefinition")?x("bpmn:TerminateEventDefinition")(t,e,i):null}function E(e,t,n){var i=p.createText(t||"",n);return je(i).add("djs-label"),J(e,i),i}function w(e,t,n){return E(e,et(t).name,{box:t,align:n,padding:5,style:{fill:ot(t)}})}function _(e,t,n){var i=E(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:ot(n)}}),r=-1*n.height;lt(i,0,-r,270)}function A(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,i=1;i<t.length;i++)n+="L"+t[i].x+","+t[i].y+" ";return n}var S=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=dt),m(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:at(t),stroke:ot(t)};et(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round"});var i=x("bpmn:Event")(e,t,n);return b(t,e),i},"bpmn:MessageEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?ot(t):at(t),stroke:n?at(t):ot(t)})},"bpmn:TimerEventDefinition":function(e,t){var n=m(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:at(t),stroke:ot(t)});y(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:ot(t)});for(var r=0;r<12;r++){var a=i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),o=t.width/2;y(e,a,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*r+","+t.height/2+","+o+")",stroke:ot(t)})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?ot(t):"none",stroke:ot(t)})},"bpmn:ConditionalEventDefinition":function(e,t){return y(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:ot(t)})},"bpmn:LinkEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?ot(t):"none",stroke:ot(t)})},"bpmn:ErrorEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:n?ot(t):"none",stroke:ot(t)})},"bpmn:CancelEventDefinition":function(e,t,n){var r=y(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:n?"black":"none"});return pt(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?ot(t):"none",stroke:ot(t)})},"bpmn:SignalEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?ot(t):"none",stroke:ot(t)})},"bpmn:MultipleEventDefinition":function(e,t,n){return y(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:n?"black":"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return y(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:ot(t),stroke:ot(t)})},"bpmn:EndEvent":function(e,t){var n=x("bpmn:Event")(e,t,{strokeWidth:4,fill:at(t),stroke:ot(t)});return b(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return m(e,t.width,t.height,8,{strokeWidth:4,fill:ot(t),stroke:ot(t)})},"bpmn:IntermediateEvent":function(e,t){var n=x("bpmn:Event")(e,t,{strokeWidth:1,fill:at(t),stroke:ot(t)});return m(e,t.width,t.height,mt,{strokeWidth:1,fill:at(t,"none"),stroke:ot(t)}),b(t,e),n},"bpmn:IntermediateCatchEvent":v("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":v("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=dt),f(e,t.width,t.height,ht,n)},"bpmn:Task":function(e,t){var n={fill:at(t),stroke:ot(t)},i=x("bpmn:Activity")(e,t,n);return w(e,t,"center-middle"),C(e,t),i},"bpmn:ServiceTask":function(e,t){var n=x("bpmn:Task")(e,t);return y(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:at(t),stroke:ot(t)}),y(e,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:at(t)}),y(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:at(t),stroke:ot(t)}),n},"bpmn:UserTask":function(e,t){var n=x("bpmn:Task")(e,t);return y(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:at(t),stroke:ot(t)}),y(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:at(t),stroke:ot(t)}),y(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:ot(t),stroke:ot(t)}),n},"bpmn:ManualTask":function(e,t){var n=x("bpmn:Task")(e,t);return y(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:at(t),stroke:ot(t)}),n},"bpmn:SendTask":function(e,t){var n=x("bpmn:Task")(e,t);return y(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:ot(t),stroke:at(t)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=et(t),a=x("bpmn:Task")(e,t);return r.instantiate?(m(e,28,28,4.4,{strokeWidth:1}),n=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):n=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),y(e,n,{strokeWidth:1,fill:at(t),stroke:ot(t)}),a},"bpmn:ScriptTask":function(e,t){var n=x("bpmn:Task")(e,t);return y(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:ot(t)}),n},"bpmn:BusinessRuleTask":function(t,n){var r=x("bpmn:Task")(t,n),a=y(t,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}));e(a,{strokeWidth:1,fill:at(n,"#aaaaaa"),stroke:ot(n)});var o=y(t,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}));return e(o,{strokeWidth:1,stroke:ot(n)}),r},"bpmn:SubProcess":function(t,n,i){i=Ke({fill:at(n),stroke:ot(n)},i);var r=x("bpmn:Activity")(t,n,i),a=I.isExpanded(n);return I.isEventSubProcess(n)&&e(r,{strokeDasharray:"1,2"}),w(t,n,a?"center-top":"center-middle"),a?C(t,n):C(t,n,["SubProcessMarker"]),r},"bpmn:AdHocSubProcess":function(e,t){return x("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=x("bpmn:SubProcess")(e,t),r=n.style(["no-fill","no-events"],{stroke:ot(t)});return f(e,t.width,t.height,ht-2,mt,r),i},"bpmn:CallActivity":function(e,t){return x("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:dt,fill:at(t),stroke:ot(t)},i=x("bpmn:Lane")(e,t,n);I.isExpanded(t)?(d(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:ot(t)}),_(e,et(t).name,t)):E(e,et(t).name,{box:t,align:"center-middle",style:{fill:ot(t)}});return!!et(t).participantMultiplicity&&x("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=f(e,t.width,t.height,0,Ke({fill:at(t),fillOpacity:yt,stroke:ot(t)},n)),r=et(t);"bpmn:Lane"===r.$type&&_(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=x("bpmn:Gateway")(e,t);return m(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:at(t),stroke:ot(t)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=x("bpmn:Gateway")(e,t),r=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return Qe(t).isMarkerVisible&&y(e,r,{strokeWidth:1,fill:ot(t),stroke:ot(t)}),n},"bpmn:ComplexGateway":function(e,t){var n=x("bpmn:Gateway")(e,t);return y(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:ot(t),stroke:ot(t)}),n},"bpmn:ParallelGateway":function(e,t){var n=x("bpmn:Gateway")(e,t);return y(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:ot(t),stroke:ot(t)}),n},"bpmn:EventBasedGateway":function(t,n){var r=et(n),a=x("bpmn:Gateway")(t,n);m(t,n.width,n.height,.2*n.height,{strokeWidth:1,fill:"none",stroke:ot(n)});var o=r.eventGatewayType,s=!!r.instantiate;if("Parallel"===o){var p=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:n.width,containerHeight:n.height,position:{mx:.474,my:.296}}),l=y(t,p);e(l,{strokeWidth:1,fill:"none"})}else if("Exclusive"===o){if(!s){var c=m(t,n.width,n.height,.26*n.height);e(c,{strokeWidth:1,fill:"none",stroke:ot(n)})}!function(){var e=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:n.width,containerHeight:n.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:at(n,"none"),stroke:ot(n)};y(t,e,r)}()}return a},"bpmn:Gateway":function(t,n){var i={fill:at(n),fillOpacity:dt,stroke:ot(n)};return function(t,n,i,r){var a=n/2,o=i/2,p=[{x:a,y:0},{x:n,y:o},{x:a,y:i},{x:0,y:o}].map(function(e){return e.x+","+e.y}).join(" ");r=c(r,{stroke:"black",strokeWidth:2,fill:"white"});var l=s("polygon");return e(l,{points:p}),e(l,r),J(t,l),l}(t,n.width,n.height,i)},"bpmn:SequenceFlow":function(t,n){var i,r=A(n),a=at(n),o=ot(n),s=y(t,r,{strokeLinejoin:"round",markerEnd:h("sequenceflow-end",a,o),stroke:ot(n)}),p=et(n);return n.source&&(i=n.source.businessObject,p.conditionExpression&&i.$instanceOf("bpmn:Activity")&&e(s,{markerStart:h("conditional-flow-marker",a,o)}),i.default&&(i.$instanceOf("bpmn:Gateway")||i.$instanceOf("bpmn:Activity"))&&i.default===p&&e(s,{markerStart:h("conditional-default-flow-marker",a,o)})),s},"bpmn:Association":function(e,t,n){var i=et(t),r=at(t),a=ot(t);return n=Ke({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:ot(t)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=h("association-end",r,a)),"Both"===i.associationDirection&&(n.markerStart=h("association-start",r,a)),d(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=at(t),i=ot(t);return x("bpmn:Association")(e,t,{markerEnd:h("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=at(t),i=ot(t);return x("bpmn:Association")(e,t,{markerEnd:h("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=et(t),r=Qe(t),a=at(t),o=ot(t),s=y(e,A(t),{markerEnd:h("messageflow-end",a,o),markerStart:h("messageflow-start",a,o),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:ot(t)});if(n.messageRef){var p=s.getPointAtLength(s.getTotalLength()/2),l=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:p.x,y:p.y}}),c={strokeWidth:1};"initiating"===r.messageVisibleKind?(c.fill="white",c.stroke="black"):(c.fill="#888",c.stroke="white"),y(e,l,c)}return s},"bpmn:DataObject":function(e,t){var n=y(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:at(t),fillOpacity:dt,stroke:ot(t)}),r=et(t);return Je(r)&&function(e,t){var n=(t.height-16)/t.height,r=i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.451,my:n}});y(e,r,{strokeWidth:2})}(e,t),n},"bpmn:DataObjectReference":v("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=x("bpmn:DataObject")(e,t);return y(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=x("bpmn:DataObject")(e,t);return y(e,n,{strokeWidth:1,fill:"black"}),r},"bpmn:DataStoreReference":function(e,t){return y(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:at(t),fillOpacity:dt,stroke:ot(t)})},"bpmn:BoundaryEvent":function(e,t){var n=et(t).cancelActivity,i={strokeWidth:1,fill:at(t),stroke:ot(t),fillOpacity:1};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=x("bpmn:Event")(e,t,i);return m(e,t.width,t.height,mt,Ke(i,{fill:"none"})),b(t,e),r},"bpmn:Group":function(e,t){return f(e,t.width,t.height,ht,{strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(e,t){return function(e,t){var n=et(t),i={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return E(e,n.name,{box:i,fitBox:!0,style:{fontSize:"11px"}})}(e,t)},"bpmn:TextAnnotation":function(e,t){var n=f(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return y(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:ot(t)}),E(e,et(t).text||"",{box:t,align:"left-top",padding:5}),n},ParticipantMultiplicityMarker:function(e,t){g("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}}))},SubProcessMarker:function(e,t){var n=f(e,14,14,0,{strokeWidth:1,fill:at(t),stroke:ot(t)});ct(n,t.width/2-7.5,t.height-20),g("sub-process",e,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:at(t),stroke:ot(t)})},ParallelMarker:function(e,t,n){g("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.parallel)/t.width,my:(t.height-20)/t.height}}))},SequentialMarker:function(e,t,n){g("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}))},CompensationMarker:function(e,t,n){g("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1})},LoopMarker:function(e,t,n){g("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.loop)/t.width,my:(t.height-7)/t.height}}),{strokeWidth:1,fill:"none",strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){g("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.adhoc)/t.width,my:(t.height-15)/t.height}}),{strokeWidth:1,fill:"black"})}};function C(e,t,n){var i,r=et(t),a=n&&-1!==n.indexOf("SubProcessMarker");i=a?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},Ue(n,function(n){x(n)(e,t,i)}),r.isForCompensation&&x("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&x("AdhocMarker")(e,t,i);var o=r.loopCharacteristics,s=o&&o.isSequential;o&&(void 0===s&&x("LoopMarker")(e,t,i),!1===s&&x("ParallelMarker")(e,t,i),!0===s&&x("SequentialMarker")(e,t,i))}this._drawPath=y}ge(gt,z),gt.$inject=["eventBus","styles","pathMap","canvas"];var vt=gt;gt.prototype.canRender=function(e){return qe(e,"bpmn:BaseElement")},gt.prototype.drawShape=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},gt.prototype.drawConnection=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},gt.prototype.getShapePath=function(e){return qe(e,"bpmn:Event")?tt(e):qe(e,"bpmn:Activity")?nt(e,ht):qe(e,"bpmn:Gateway")?it(e):rt(e)};var xt=function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m {mx}, {my} m 0 15 l 0 -15 m 4 15 l 0 -15 m 4 15 l 0 -15 ",height:61,width:51,heightElements:[12],widthElements:[1,6,12,15]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var a,o,s={};if(t.position){for(var p=t.containerHeight/r.height*t.yScaleFactor,l=t.containerWidth/r.width*t.xScaleFactor,c=0;c<r.heightElements.length;c++)s["y"+c]=r.heightElements[c]*p;for(var u=0;u<r.widthElements.length;u++)s["x"+u]=r.widthElements[u]*l}return a=r.d,o={mx:n,my:i,e:s},String(a).replace(bt,function(e,t){return function(e,t,n){var i=n;return t.replace(Et,function(e,t,n,r,a){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&a&&(i=i()))}),i=(null==i||i==n?e:i)+""}(e,t,o)})}},bt=/\{([^}]+)\}/g,Et=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var wt={__init__:["bpmnRenderer"],bpmnRenderer:["type",vt],pathMap:["type",xt]},_t={elementToString:function(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}},At={},St=c.assign,Ct=B.is,Rt={width:90,height:20},Mt=15;function kt(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=Pt(e),a=Math.atan((i.y-n.y)/(i.x-n.x)),o=r.x,s=r.y;return Math.abs(a)<Math.PI/2?s-=Mt:o+=Mt,{x:o,y:s}}function Pt(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}function Tt(e){return e.waypoints?kt(e.waypoints):{x:e.x+e.width/2,y:e.y+e.height+Rt.height/2}}At.hasExternalLabel=function(e){return Ct(e,"bpmn:Event")||Ct(e,"bpmn:Gateway")||Ct(e,"bpmn:DataStoreReference")||Ct(e,"bpmn:DataObjectReference")||Ct(e,"bpmn:SequenceFlow")||Ct(e,"bpmn:MessageFlow")},At.getExternalLabelBounds=function(e,t){var n,i,r,a=e.di.label;return a&&a.bounds?(r=a.bounds,i={width:Math.max(Rt.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=Tt(t),i=Rt),St({x:n.x-i.width/2,y:n.y-i.height/2},i)};var Nt=c.assign,Dt=c.map,Ot=B.is,Bt=At.hasExternalLabel,Lt=At.getExternalLabelBounds,It=I.isExpanded,Ft=_t.elementToString;function jt(e,t){return Nt({id:e.id,type:e.$type,businessObject:e},t)}function Vt(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:Ft(n),referenced:Ft(t),property:i}))}function Wt(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textUtil=new he}Wt.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate"];var zt=Wt;Wt.prototype.add=function(e,t){var n,i,r,a,o=e.di,s=this._translate;if(Ot(o,"bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(jt(e)),this._canvas.setRootElement(n);else if(Ot(o,"bpmndi:BPMNShape")){var p=!It(e);i=t&&(t.hidden||t.collapsed);var l=e.di.bounds;n=this._elementFactory.createShape(jt(e,{collapsed:p,hidden:i,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height)})),Ot(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,n),Ot(e,"bpmn:Lane")&&(r=0),this._canvas.addShape(n,t,r)}else{if(!Ot(o,"bpmndi:BPMNEdge"))throw new Error(s("unknown di {di} for element {semantic}",{di:Ft(o),semantic:Ft(e)}));var c=this._getSource(e),u=this._getTarget(e);i=t&&(t.hidden||t.collapsed),n=this._elementFactory.createConnection(jt(e,{hidden:i,source:c,target:u,waypoints:(a=e.di.waypoint,Dt(a,function(e){return{x:e.x,y:e.y}}))})),Ot(e,"bpmn:DataAssociation")&&(t=null),Ot(e,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,t,r)}return Bt(e)&&this.addLabel(e,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},Wt.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Ft(e)}));var r=this._elementRegistry.get(i.id),a=r&&r.attachers;if(!r)throw Vt(n,e,i,"attachedToRef");t.host=r,a||(r.attachers=a=[]),-1===a.indexOf(t)&&a.push(t)},Wt.prototype.addLabel=function(e,t){var n,i,r;return n=Lt(e,t),(i=e.name)&&(n=function(e,t,n){var i=n.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:Gt});return{x:Math.round(e.x+e.width/2-i.width/2),y:Math.round(e.y),width:Math.ceil(i.width),height:Math.ceil(i.height)}}(n,i,this._textUtil)),r=this._elementFactory.createLabel(jt(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden||!e.name,x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,t.parent)},Wt.prototype._getEnd=function(e,t){var n,i,r=e.$type,a=this._translate;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?Vt(a,e,i,t+"Ref"):new Error(a("{semantic}#{side} Ref not specified",{semantic:Ft(e),side:t}))},Wt.prototype._getSource=function(e){return this._getEnd(e,"source")},Wt.prototype._getTarget=function(e){return this._getEnd(e,"target")},Wt.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Gt={fontFamily:"Arial, sans-serif",fontSize:"11px"};var $t={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||"{"+n+"}"})}]},Ht={__depends__:[wt,{__depends__:[$t],bpmnImporter:["type",zt]}]},Kt={};function Ut(e,t,n){Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:Kt.extend(n[t.name]||[],e,t,n)})}function qt(e,t){if(!(this instanceof qt))return new qt(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Kt.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},Kt.isExtended=function(e){return!0===e.__refs_collection},qt.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?Ut(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 a=r;r=null,a&&e.unset(a,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},qt.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Kt.isExtended(n)||Ut(this,t,e),n},qt.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},qt.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},qt.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var Yt={};(Yt=qt).Collection=Kt;var Xt=c.filter,Zt=c.find,Jt=c.forEach,Qt=_t.elementToString,en=new Yt({name:"bpmnElement",enumerable:!0},{name:"di"});function tn(e,t){return e.$instanceOf(t)}var nn=function(e,t){var n={},i=[];function r(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function o(n,i){try{var r=n.di&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:Qt(n)}));return e.element(n,i)}(n,i);return a(n),r}catch(e){s(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:Qt(n)})),console.error(e)}}function s(t,n){e.error(t,n)}function p(e){var n=e.bpmnElement;n?n.di?s(t("multiple DI elements defined for {element}",{element:Qt(n)}),{element:n}):(en.bind(n,"di"),n.di=e):s(t("no bpmnElement referenced in {element}",{element:Qt(e)}),{element:e})}function l(e){var t;p(t=e.plane),Jt(t.planeElement,c)}function c(e){p(e)}function u(e,t){_(e,t),v(e.ioSpecification,t),g(e.artifacts,t),a(e)}function h(e,t){o(e,t)}function m(e,t){o(e,t)}function f(e,t){o(e,t)}function d(e,t){o(e,t)}function y(e,t){o(e,t)}function g(e,t){Jt(e,function(e){tn(e,"bpmn:Association")?i.push(function(){y(e,t)}):y(e,t)})}function v(e,t){e&&(Jt(e.dataInputs,r(f,t)),Jt(e.dataOutputs,r(d,t)))}function x(e,t){var n=o(e,t);tn(e,"bpmn:SubProcess")&&function(e,t){_(e,t),g(e.artifacts,t)}(e,n||t),tn(e,"bpmn:Activity")&&v(e.ioSpecification,t),i.push(function(){Jt(e.dataInputAssociations,r(m,t)),Jt(e.dataOutputAssociations,r(m,t))})}function b(e,t){o(e,t)}function E(e,t){i.push(function(){var n=o(e,t);e.childLaneSet&&w(e.childLaneSet,n||t),function(e){Jt(e.flowNodeRef,function(t){var n=t.get("lanes");n&&n.push(e)})}(e)})}function w(e,t){Jt(e.lanes,r(E,t))}function _(e,n){!function(e,n){Jt(e,function(e){tn(e,"bpmn:SequenceFlow")?i.push(function(){!function(e,t){o(e,t)}(e,n)}):tn(e,"bpmn:BoundaryEvent")?i.unshift(function(){!function(e,t){o(e,t)}(e,n)}):tn(e,"bpmn:FlowNode")?x(e,n):tn(e,"bpmn:DataObject")||(tn(e,"bpmn:DataStoreReference")?b(e,n):tn(e,"bpmn:DataObjectReference")?b(e,n):s(t("unrecognized flowElement {element} in context {context}",{element:Qt(e),context:n?Qt(n.businessObject):"null"}),{element:e,context:n}))})}(e.flowElements,n),e.laneSets&&function(e,t){Jt(e,r(w,t))}(e.laneSets,n)}function A(e,t){var n=o(e,t),i=e.processRef;i&&u(i,n||t)}return{handleDefinitions:function(a,o){var c=a.diagrams;if(o&&-1===c.indexOf(o))throw new Error(t("diagram not part of bpmn:Definitions"));if(!o&&c&&c.length&&(o=c[0]),!o)throw new Error(t("no diagram to display"));l(o);var m=o.plane;if(!m)throw new Error(t("no plane for {element}",{element:Qt(o)}));var f=m.bpmnElement;if(!f){if(!(f=function(e){return Zt(e.rootElements,function(e){return tn(e,"bpmn:Process")||tn(e,"bpmn:Collaboration")})}(a)))throw new Error(t("no process or collaboration to display"));s(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Qt(m),rootElement:Qt(f)})),m.bpmnElement=f,p(m)}var d,y,v=function(t,n){return e.root(t,n)}(f,m);if(tn(f,"bpmn:Process"))u(f,v);else{if(!tn(f,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:Qt(m),rootElement:Qt(f)}));Jt((y=f).participants,r(A)),g(y.artifacts),i.push(function(){var e,t;e=y.messageFlows,Jt(e,r(h,t))}),d=a.rootElements,Xt(d,function(e){return!n[e.id]&&tn(e,"bpmn:Process")&&e.laneSets}).forEach(r(u))}!function(e){for(;e.length;)e.shift()()}(i)}}},rn={};rn.importBpmnDiagram=function(e,t,n){var i,r,a,o,s=[];try{i=e.get("bpmnImporter"),r=e.get("eventBus"),a=e.get("translate"),r.fire("import.render.start",{definitions:t}),function(e){new nn({root:function(e){return i.add(e)},element:function(e,t){return i.add(e,t)},error:function(e,t){s.push({message:e,context:t})}},a).handleDefinitions(e)}(t),r.fire("import.render.complete",{error:o,warnings:s})}catch(e){o=e}n(o,s)};var an={},on=ve.domify,sn=ve.delegate,pn='<img width="52" height="52" src="'+("data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 960"><path fill="#fff" d="M960 60v839c0 33-27 61-60 61H60c-33 0-60-27-60-60V60C0 27 27 0 60 0h839c34 0 61 27 61 60z"/><path fill="#52b415" d="M217 548a205 205 0 0 0-144 58 202 202 0 0 0-4 286 202 202 0 0 0 285 3 200 200 0 0 0 48-219 203 203 0 0 0-185-128zM752 6a206 206 0 0 0-192 285 206 206 0 0 0 269 111 207 207 0 0 0 111-260A204 204 0 0 0 752 6zM62 0A62 62 0 0 0 0 62v398l60 46a259 259 0 0 1 89-36c5-28 10-57 14-85l99 2 12 85a246 246 0 0 1 88 38l70-52 69 71-52 68c17 30 29 58 35 90l86 14-2 100-86 12a240 240 0 0 1-38 89l43 58h413c37 0 60-27 60-61V407a220 220 0 0 1-44 40l21 85-93 39-45-76a258 258 0 0 1-98 1l-45 76-94-39 22-85a298 298 0 0 1-70-69l-86 22-38-94 76-45a258 258 0 0 1-1-98l-76-45 40-94 85 22a271 271 0 0 1 41-47z"/></svg>'))+'" />';function ln(e){return e.join(";")}var cn,un='<div class="bjs-powered-by-lightbox" style="'+ln(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+ln(["width: 100%","height: 100%","background: rgba(0,0,0,0.2)"])+'"></div><div class="notice" style="'+ln(["position: absolute","left: 50%","top: 40%","margin: 0 -130px","width: 260px","padding: 10px","background: white","border: solid 1px #AAA","border-radius: 3px","font-family: Helvetica, Arial, sans-serif","font-size: 14px","line-height: 1.2em"])+'"><a href="http://bpmn.io" target="_blank" style="float: left; margin-right: 10px">'+pn+'</a>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="http://bpmn.io" target="_blank">bpmn.io</a>.</div></div>';an.open=function(){cn||(cn=on(un),sn.bind(cn,".backdrop","click",function(e){document.body.removeChild(cn)})),document.body.appendChild(cn)},an.BPMNIO_IMG=pn;var hn={};hn.hasLowerCaseAlias=function(e){return e.xml&&"lowerCase"===e.xml.tagAlias},hn.DEFAULT_NS_MAP={xsi:"http://www.w3.org/2001/XMLSchema-instance"};var mn=hn.XSI_TYPE="xsi:type";function fn(e){return e.xml&&e.xml.serialize}function dn(){}hn.serializeAsType=function(e){return fn(e)===mn},hn.serializeAsProperty=function(e){return"property"===fn(e)},dn.prototype.get=function(e){return this.$model.properties.get(this,e)},dn.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};var yn=dn,gn=c.forEach,vn=c.bind;function xn(e,t){this.model=e,this.properties=t}var bn=xn;xn.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(yn.prototype);gn(e.properties,function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)}),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function a(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),gn(e,vn(function(e,t){this.set(t,e)},this))}return a.prototype=i,a.hasType=i.$instanceOf=this.model.hasType,n.defineModel(a,t),n.defineDescriptor(a,e),a};var En={};function wn(e){this.model=e}En.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 <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}};var _n=wn;function An(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}wn.prototype.set=function(e,t,n){var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[t]:i?r in e?e[r]=n:An(e,i,n):e.$attrs[t]=n},wn.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&&An(e,n,[]),e[i]},wn.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},wn.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},wn.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};var Sn=c.pick,Cn=c.assign,Rn=c.forEach,Mn=c.bind,kn=En.parseName;function Pn(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}var Tn=Pn;Pn.prototype.build=function(){return Sn(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Pn.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)},Pn.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,a=this.propertiesByName,o=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,o),a[i.name]=a[i.localName]=t},Pn.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),a=kn(r[0],i),o=kn(r[1],a.prefix).name,s=this.propertiesByName[o];if(!s)throw new Error("refined property <"+o+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Pn.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},Pn.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Pn.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},Pn.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},Pn.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")},Pn.prototype.hasProperty=function(e){return this.propertiesByName[e]},Pn.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(Rn(e.properties,Mn(function(n){n=Cn({},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 Nn={},Dn={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},On={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)}};Nn.coerceType=function(e,t){var n=On[e];return n?n(t):t},Nn.isBuiltIn=function(e){return!!Dn[e]},Nn.isSimple=function(e){return!!On[e]};var Bn=c.assign,Ln=c.forEach,In=c.bind,Fn=En.parseName,jn=Nn.isBuiltIn;function Vn(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,Ln(e,In(this.registerPackage,this))}var Wn=Vn;function zn(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}Vn.prototype.getPackage=function(e){return this.packageMap[e]},Vn.prototype.getPackages=function(){return this.packages},Vn.prototype.registerPackage=function(e){e=Bn({},e);var t=this.packageMap;zn(t,e,"prefix"),zn(t,e,"uri"),Ln(e.types,In(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Vn.prototype.registerType=function(e,t){e=Bn({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:Bn(e.meta||{})});var n=Fn(e.name,t.prefix),i=n.name,r={};Ln(e.properties,In(function(e){var t=Fn(e.name,n.prefix),i=t.name;jn(e.type)||(e.type=Fn(e.type,t.prefix).name),Bn(e,{ns:t,name:i}),r[i]=e},this)),Bn(e,{ns:n,name:i,propertiesByName:r}),Ln(e.extends,In(function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},Vn.prototype.mapTypes=function(e,t,n){var i=jn(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function a(e){return o(e,!0)}function o(n,i){var a=Fn(n,jn(n)?"":e.prefix);r.mapTypes(a,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");Ln(i.superClass,n?a:o),t(i,!n),Ln(i.traits,a)},Vn.prototype.getEffectiveDescriptor=function(e){var t=Fn(e),n=new Tn(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},Vn.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};var Gn=c.isString,$n=c.isObject,Hn=c.forEach,Kn=En.parseName;function Un(e){this.properties=new _n(this),this.factory=new bn(this,this.properties),this.registry=new Wn(e,this.properties),this.typeCache={}}var qn=Un;Un.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Un.prototype.getType=function(e){var t=this.typeCache,n=Gn(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Un.prototype.createAny=function(e,t,n){var i=Kn(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},a={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,a),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),Hn(n,function(e,t){$n(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e}),r},Un.prototype.getPackage=function(e){return this.registry.getPackage(e)},Un.prototype.getPackages=function(){return this.registry.getPackages()},Un.prototype.getElementDescriptor=function(e){return e.$descriptor},Un.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Un.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Un.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var Yn,Xn,Zn=qn,Jn={exports:{}};Yn=this,Xn=function(e){"use strict";var t=String.fromCharCode,n=Object.prototype.hasOwnProperty,i=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,r={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function a(e,i,a,o){return o?n.call(r,o)?r[o]:"&"+o+";":t(i||parseInt(a,16))}function o(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(i,a):e}Object.keys(r).forEach(function(e){r[e.toUpperCase()]=r[e]});var s="http://www.w3.org/2001/XMLSchema-instance",p="xsi",l="xsi:type";function c(e){return new Error(e)}function u(e){return"missing namespace for prefix <"+e+">"}function h(e){return{get:e,enumerable:!0}}function m(e){var t,n={};for(t in e)n[t]=e[t];return n}function f(e){return e+"$uri"}function d(){return{line:0,column:0}}function y(e){throw e}e.Parser=function e(t){if(!this)return new e(t);var n,i,r,a,g,v,x,b,E,w=t&&t.proxy,_=y,A=d,S=!1,C=!1,R=null,M=!1;function k(e){e instanceof Error||(e=c(e)),R=e,_(e,A)}function P(e){g&&(e instanceof Error||(e=c(e)),g(e,A))}this.on=function(e,t){if("function"!=typeof t)throw c("required args <name, cb>");switch(e){case"openTag":i=t;break;case"text":n=t;break;case"closeTag":r=t;break;case"error":_=t;break;case"warn":g=t;break;case"cdata":a=t;break;case"attention":b=t;break;case"question":x=t;break;case"comment":v=t;break;default:throw c("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw c("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n[s]=p,C=!0,E=n,this},this.parse=function(e){if("string"!=typeof e)throw c("required args <xml=string>");return R=null,function(e){var t,s,p,c,d,y,g,_,R,T,N=C?[]:null,D=C?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[f(n)]=t;return i}(E):null,O=[],B=0,L=!1,I=!1,F=0,j=0,V="",W=0;function z(){if(null!==T)return T;var e,t,n,i,r,a,s,p,c,h,d,y=C&&D.xmlns,g=C&&S?[]:null,v=W,x=V,b=x.length,w={},_={};e:for(;v<b;v++)if(c=!1,!(32===(h=x.charCodeAt(v))||h<14&&h>8)){for((h<65||h>122||h>90&&h<97)&&95!==h&&58!==h&&(P("illegal first char attribute name"),c=!0),d=v+1;d<b;d++)if(!((h=x.charCodeAt(d))>96&&h<123||h>64&&h<91||h>47&&h<59||45===h||95===h)){if(32===h||h<14&&h>8){P("missing attribute value"),v=d;continue e}if(61===h)break;P("illegal attribute name char"),c=!0}if("xmlns:xmlns"===(p=x.substring(v,d))&&(P("illegal declaration of xmlns"),c=!0),34===(h=x.charCodeAt(d+1)))-1===(d=x.indexOf('"',v=d+2))&&-1!==(d=x.indexOf("'",v))&&(P("attribute value quote missmatch"),c=!0);else if(39===h)-1===(d=x.indexOf("'",v=d+2))&&-1!==(d=x.indexOf('"',v))&&(P("attribute value quote missmatch"),c=!0);else for(P("missing attribute value quotes"),c=!0,d+=1;d<b&&!(32===(h=x.charCodeAt(d+1))||h<14&&h>8);d++);for(-1===d&&(P("missing closing quotes"),d=b,c=!0),c||(a=x.substring(v,d)),v=d;d+1<b&&!(32===(h=x.charCodeAt(d+1))||h<14&&h>8);d++)v===d&&(P("illegal character after attribute end"),c=!0);if(v=d+1,!c)if(p in _)P("attribute <"+p+"> already defined");else if(_[p]=!0,C)if(S){if(null!==(r="xmlns"===p?"xmlns":120===p.charCodeAt(0)&&"xmlns:"===p.substr(0,6)?p.substr(6):null)){if(e=o(a),t=f(r),!(s=E[e])){if("xmlns"===r||t in D&&D[t]!==e)do{s="ns"+B++}while(void 0!==D[s]);else s=r;E[e]=s}D[r]!==s&&(i||(D=m(D),i=!0),D[r]=s,"xmlns"===r&&(D[f(s)]=e,y=s),D[t]=e),w[p]=a;continue}g.push(p,a)}else-1!==(h=p.indexOf(":"))?(n=D[p.substring(0,h)])?((p=y===n?p.substr(h+1):n+p.substr(h))===l&&(-1!==(h=a.indexOf(":"))?(n=a.substring(0,h),n=D[n]||n,a=n+a.substring(h)):a=y+":"+a),w[p]=a):P(u(p.substring(0,h))):w[p]=a;else w[p]=a}if(S)for(v=0,b=g.length;v<b;v++){if(p=g[v++],a=g[v],-1!==(h=p.indexOf(":"))){if(!(n=D[p.substring(0,h)])){P(u(p.substring(0,h)));continue}(p=y===n?p.substr(h+1):n+p.substr(h))===l&&(-1!==(h=a.indexOf(":"))?(n=a.substring(0,h),n=D[n]||n,a=n+a.substring(h)):a=y+":"+a)}w[p]=a}return T=w}for(A=function(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,a=0,o=0,s=j;F>=o&&(t=i.exec(e))&&!((s=t[0].length+t.index)>F);)r+=1,o=s;return-1==F?(a=s,n=""):(a=F-o,n=-1==j?e.substring(F):e.substring(F,j+1)),{data:n,line:r,column:a}},w&&(R=Object.create({},{name:h(function(){return g}),originalName:h(function(){return _}),attrs:h(z),ns:h(function(){return D})}));-1!==j;){if(-1===(F=60===e.charCodeAt(j)?j:e.indexOf("<",j)))return O.length?k("unexpected end of file"):0===j?k("missing start tag"):void 0;if(j!==F&&n&&(n(e.substring(j,F),o,A),M))return;if(33!==(d=e.charCodeAt(F+1)))if(63!==d){if(-1==(j=e.indexOf(">",F+1)))return k("unclosed tag");if(T={},47===d){if(L=!1,I=!0,!O.length)return k("missing open tag");if(s=g=O.pop(),c=F+2+s.length,e.substring(F+2,c)!==s)return k("closing tag mismatch");for(;c<j;c++)if(!(32===(d=e.charCodeAt(c))||d>8&&d<14))return k("close tag")}else{if(47===e.charCodeAt(j-1)?(s=g=e.substring(F+1,j-1),L=!0,I=!0):(s=g=e.substring(F+1,j),L=!0,I=!1),!(d>96&&d<123||d>64&&d<91||95===d||58===d))return k("illegal first char nodeName");for(c=1,p=s.length;c<p;c++)if(!((d=s.charCodeAt(c))>96&&d<123||d>64&&d<91||d>47&&d<59||45===d||95===d)){if(32===d||d<14&&d>8){g=s.substring(0,c),T=null;break}return k("invalid nodeName")}I||O.push(g)}if(C){if(t=D,L&&(I||N.push(t),null===T&&(S=-1!==s.indexOf("xmlns",c))&&(W=c,V=s,z(),S=!1)),_=g,-1!==(d=g.indexOf(":"))){if(!(y=D[g.substring(0,d)]))return k("missing namespace on <"+_+">");g=g.substr(d+1)}else y=D.xmlns;y&&(g=y+":"+g)}if(L&&(W=c,V=s,i&&(w?i(R,o,I,A):i(g,z,o,I,A),M)))return;if(I){if(r&&(r(w?R:g,o,L,A),M))return;C&&(D=L?t:N.pop())}j+=1}else{if(-1===(j=e.indexOf("?>",F)))return k("unclosed question");if(x&&(x(e.substring(F,j+2),A),M))return;j+=2}else{if(91===(d=e.charCodeAt(F+2))&&"CDATA["===e.substr(F+3,6)){if(-1===(j=e.indexOf("]]>",F)))return k("unclosed cdata");if(a&&(a(e.substring(F+9,j),A),M))return;j+=3;continue}if(45===d&&45===e.charCodeAt(F+3)){if(-1===(j=e.indexOf("--\x3e",F)))return k("unclosed comment");if(v&&(v(e.substring(F+4,j),o,A),M))return;j+=3;continue}if(-1===(j=e.indexOf(">",F+1)))return k("unclosed tag");if(b&&(b(e.substring(F,j+1),o,A),M))return;j+=1}}}(e),A=d,M=!1,R},this.stop=function(){M=!0}},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof Jn.exports?Xn(Jn.exports):Xn(Yn.Saxen={}),Jn=Jn.exports;var Qn={};!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!==Qn?Qn=n:e.stack=n}(this);var ei={},ti=c.forEach,ni=c.find,ii=c.assign,ri=Jn.Parser,ai=En.parseName,oi=Nn.coerceType,si=Nn.isSimple,pi=hn.XSI_TYPE,li=hn.serializeAsType,ci=hn.hasLowerCaseAlias;function ui(e,t){return ci(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function hi(e){return new Error(e)}function mi(e){return e.$descriptor}function fi(){}function di(){}function yi(){}function gi(e,t){this.property=e,this.context=t}function vi(e,t){this.element=t,this.propertyDesc=e}function xi(){}function bi(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Ei(e,t,n){bi.call(this,e,t,n)}function wi(e,t,n){this.model=e,this.context=n}function _i(e){e instanceof Zn&&(e={model:e}),ii(this,{lax:!1},e)}fi.prototype.handleEnd=function(){},fi.prototype.handleText=function(){},fi.prototype.handleNode=function(){},di.prototype=Object.create(fi.prototype),di.prototype.handleNode=function(){return this},yi.prototype=Object.create(fi.prototype),yi.prototype.handleText=function(e){this.body=(this.body||"")+e},gi.prototype=Object.create(yi.prototype),gi.prototype.handleNode=function(e){if(this.element)throw hi("expected no sub nodes");return this.element=this.createReference(e),this},gi.prototype.handleEnd=function(){this.element.id=this.body},gi.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},vi.prototype=Object.create(yi.prototype),vi.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=oi(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},xi.prototype=Object.create(yi.prototype),xi.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},bi.prototype=Object.create(xi.prototype),bi.prototype.addReference=function(e){this.context.addReference(e)},bi.prototype.handleEnd=function(){var e=this.body,t=this.element,n=mi(t).bodyProperty;n&&void 0!==e&&(e=oi(n.type,e),t.set(n.name,e))},bi.prototype.createElement=function(e){var t=e.attributes,n=this.type,i=mi(n),r=this.context,a=new n({});return ti(t,function(e,t){var n,o=i.propertiesByName[t];o&&o.isReference?o.isMany?(n=e.split(" "),ti(n,function(e){r.addReference({element:a,property:o.ns.name,id:e})})):r.addReference({element:a,property:o.ns.name,id:e}):(o&&(e=oi(o.type,e)),a.set(t,e))}),a},bi.prototype.getPropertyForNode=function(e){var t,n,i=e.name,r=ai(i),a=this.type,o=this.model,s=mi(a),p=r.name,l=s.propertiesByName[p];if(l)return li(l)&&(t=e.attributes[pi])?(t=function(e,t){var n=ai(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,o),n=o.getType(t),ii({},l,{effectiveType:mi(n).name})):l;var c=o.getPackage(r.prefix);if(c){if(t=ui(r,c),n=o.getType(t),l=ni(s.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return ii({},l,{effectiveType:mi(n).name})}else if(l=ni(s.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return l;throw hi("unrecognized element <"+r.name+">")},bi.prototype.toString=function(){return"ElementDescriptor["+mi(this.type).name+"]"},bi.prototype.valueHandler=function(e,t){return new vi(e,t)},bi.prototype.referenceHandler=function(e){return new gi(e,this.context)},bi.prototype.handler=function(e){return"Element"===e?new wi(this.model,e,this.context):new bi(this.model,e,this.context)},bi.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,n=t.effectiveType||t.type,si(n))return this.valueHandler(t,i);var a=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==a&&(t.isMany?i.get(t.name).push(a):i.set(t.name,a),t.isReference?(ii(a,{element:i}),this.context.addReference(a)):a.$parent=i),r},Ei.prototype=Object.create(bi.prototype),Ei.prototype.createElement=function(e){var t=e.name,n=ai(t),i=this.model,r=this.type,a=i.getPackage(n.prefix),o=a&&ui(n,a)||t;if(!r.hasType(o))throw hi("unexpected element <"+e.originalName+">");return bi.prototype.createElement.call(this,e)},wi.prototype=Object.create(xi.prototype),wi.prototype.createElement=function(e){var t=e.name,n=ai(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},wi.prototype.handleChild=function(e){var t=new wi(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},wi.prototype.handleText=function(e){this.body=this.body||""+e},wi.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},_i.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof bi?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,a=this.lax,o=new function(e){ii(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw hi("expected element");var t,n=this.elementsById,i=mi(e).idProperty;if(i&&(t=e.get(i.name))){if(n[t])throw hi("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}(ii({},t,{rootHandler:i})),s=new ri({proxy:!0}),p=new Qn;function l(e,t,n){var i=t(),r=i.line,a=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var p="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+a+"\n\tnested error: "+e.message;if(n)return o.addWarning({message:p,error:e}),console.warn("could not parse node"),console.warn(e),!0;throw console.error("could not parse document"),console.error(e),hi(p)}i.context=o,p.push(i);var c=/^<\?xml /i,u=/ encoding="([^"]+)"/i,h=/^utf-8$/i;var m=r.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{});s.ns(m).on("openTag",function(e,t,n,i){var r=e.attrs||{},o=Object.keys(r).reduce(function(e,n){var i=t(r[n]);return e[n]=i,e},{});!function(e,t){var n=p.peek();try{p.push(n.handleNode(e))}catch(e){l(e,t,a)&&p.push(new di)}}({name:e.name,originalName:e.originalName,attributes:o,ns:e.ns},i)}).on("question",function(e){if(c.test(e)){var t=u.exec(e),n=t&&t[1];n&&!h.test(n)&&o.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){p.pop().handleEnd()}).on("cdata",function(e){p.peek().handleText(e)}).on("text",function(e,t){!function(e){(e=e.trim())&&p.peek().handleText(e)}(t(e))}).on("error",l).on("warn",function(e,t){return l(e,t,!0)}),setTimeout(function(){var t;try{s.parse(e),function(){var e,t,n=o.elementsById,i=o.references;for(e=0;t=i[e];e++){var r=t.element,a=n[t.id],s=mi(r).propertiesByName[t.property];if(a||o.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var p=r.get(s.name),l=p.indexOf(t);-1===l&&(l=p.length),a?p[l]=a:p.splice(l,1)}else r.set(s.name,a)}}()}catch(e){t=e}var r=i.element;t||r||(t=hi("failed to parse document as <"+i.type.$descriptor.name+">")),n(t,t?void 0:r,o)},0)},_i.prototype.handler=function(e){return new Ei(this.model,e)},(ei=_i).ElementHandler=bi;var Ai=c.map,Si=c.forEach,Ci=c.isString,Ri=c.filter,Mi=c.assign,ki=En.parseName,Pi=hn.hasLowerCaseAlias,Ti=hn.serializeAsType,Ni=hn.serializeAsProperty,Di='<?xml version="1.0" encoding="UTF-8"?>\n',Oi=/(<|>|'|"|&|\n\r|\n)/g,Bi=hn.DEFAULT_NS_MAP,Li=hn.XSI_TYPE;function Ii(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Fi(e){return Ci(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function ji(e,t){return t.isGeneric?Mi({localName:t.ns.localName},e):Mi({localName:(n=t.ns.localName,i=t.$pkg,Pi(i)?(r=n).charAt(0).toLowerCase()+r.slice(1):n)},e);var n,i,r}var Vi={"\n":"10","\n\r":"10",'"':"34","'":"39","<":"60",">":"62","&":"38"};function Wi(e){this.tagName=e}function zi(){}function Gi(e){this.tagName=e}function $i(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Hi(e,t){$i.call(this,e,t)}Wi.prototype.build=function(e){return this.element=e,this},Wi.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},zi.prototype.serializeValue=zi.prototype.serializeTo=function(e){var t=this.escape;t&&e.append("<![CDATA["),e.append(this.value),t&&e.append("]]>")},zi.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Oi)&&(this.escape=!0),this},Ii(Gi,zi),Gi.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},$i.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,a=i.isGeneric;return t=a?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),a||(n=function(e){var t=e.$descriptor;return Ri(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(Ri(n,function(e){return e.isAttr})),this.parseContainments(function(e){return Ri(e,function(e){return!e.isAttr})}(n))),this.parseGenericAttributes(e,t),this},$i.prototype.nsTagName=function(e){return ji(this.logNamespaceUsed(e.ns),e)},$i.prototype.nsPropertyTagName=function(e){return function(e,t){return Mi({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},$i.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},$i.prototype.nsAttributeName=function(e){var t;if(t=Ci(e)?ki(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:Mi({localName:t.localName},n)},$i.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return Si(e,function(r,a){"$body"===a?n.push((new zi).build({type:"String"},r)):"$children"===a?Si(r,function(e){n.push(new $i(t).build(e))}):0!==a.indexOf("$")&&t.parseNsAttribute(e,a,r)&&i.push({name:a,value:r})}),i},$i.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,a=ki(t);if("xmlns"===a.prefix&&(i={prefix:a.localName,uri:n}),a.prefix||"xmlns"!==a.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var o=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(o)}},$i.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return Si(i,function(t,i){var a=n.parseNsAttribute(e,i,t);a&&r.push(a)}),r},$i.prototype.parseGenericAttributes=function(e,t){var n=this;Si(t,function(t){if(t.name!==Li)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}})},$i.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;Si(e,function(e){var r=i.get(e.name),a=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new zi).build(e,r[0]));else if(Nn.isSimple(e.type))Si(r,function(i){n.push(new Gi(t.addTagName(t.nsPropertyTagName(e))).build(e,i))});else if(a)Si(r,function(i){n.push(new Wi(t.addTagName(t.nsPropertyTagName(e))).build(i))});else{var o=Ti(e),s=Ni(e);Si(r,function(i){var r;r=o?new Hi(t,e):s?new $i(t,e):new $i(t),n.push(r.build(i))})}})},$i.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new function(e){var t={},n={},i={},r=[],a=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):a.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.logUsed=function(e){var t=e.uri;i[t]=this.byUri(t)},this.getUsed=function(e){return[].concat(r,a).filter(function(e){return i[e.uri]})}}(t):n=t),n},$i.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,a=e.prefix;return i.byUri(r)||i.add(e,t),i.mapPrefix(a,r),e},$i.prototype.logNamespaceUsed=function(e,t){var n,i,r,a=this.element.$model,o=this.getNamespaces(t),s=e.prefix,p=e.uri;if(!s&&!p)return{localName:e.localName};if(r=Bi[s]||a&&(a.getPackage(s)||{}).uri,!(p=p||r||o.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=o.byUri(p))){for(n=s,i=1;o.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:p},r===p)}return s&&o.mapPrefix(s,p),e},$i.prototype.parseAttributes=function(e){var t=this,n=this.element;Si(e,function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];Si(i,function(e){r.push(e.id)}),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)})},$i.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Fi(e)},$i.prototype.addAttribute=function(e,t){var n,i=this.attrs;Ci(t)&&(t=(n=Ci(n=t)?n:""+n).replace(Oi,function(e){return"&#"+Vi[e]+";"})),i.push({name:e,value:t})},$i.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return Ai(e.getUsed(),function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}})}(n).concat(t)),Si(t,function(t){e.append(" ").append(Fi(t.name)).append('="').append(t.value).append('"')})},$i.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==zi;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),Si(this.body,function(t){t.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Ii(Hi,$i),Hi.prototype.parseNsAttributes=function(e){var t=$i.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),a=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Li),(i.prefix?i.prefix+":":"")+a+n.ns.localName),t},Hi.prototype.isLocalNs=function(e){return e.uri===this.typeNs.uri};var Ki=function(e){return e=Mi({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(Di),(new $i).build(t).serializeTo(r),!n)return i.value}}},Ui=c.isString,qi=c.isFunction,Yi=c.assign;function Xi(e,t){Zn.call(this,e,t)}Xi.prototype=Object.create(Zn.prototype);var Zi=Xi;Xi.prototype.fromXML=function(e,t,n,i){Ui(t)||(i=n,n=t,t="bpmn:Definitions"),qi(n)&&(i=n,n={});var r=new ei(Yi({model:this,lax:!0},n)),a=r.handler(t);r.fromXML(e,a,i)},Xi.prototype.toXML=function(e,t,n){qi(t)&&(n=t,t={});var i,r,a=new Ki(t);try{i=a.toXML(e)}catch(e){r=e}return n(r,i)};var Ji=c.assign,Qi={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",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"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:[]}},er=function(e,t){return new Zi(Ji({},Qi,e),t)},tr={remove:function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n},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)}}},nr={},ir=c.isArray,rr=(c.isNumber,c.groupBy,c.forEach);function ar(e,t){var n,i,r,a;return t=!!t,ir(e)||(e=[e]),rr(e,function(e){var o=e;e.waypoints&&!t&&(o=ar(e.waypoints,!0));var s=o.x,p=o.y,l=o.height||0,c=o.width||0;(s<n||void 0===n)&&(n=s),(p<i||void 0===i)&&(i=p),(s+c>r||void 0===r)&&(r=s+c),(p+l>a||void 0===a)&&(a=p+l)}),{x:n,y:i,height:a-i,width:r-n}}nr.getBBox=ar,nr.getType=function(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"};var or=c.isNumber,sr=c.assign,pr=c.forEach,lr=c.every,cr=c.debounce,ur=c.bind,hr=c.reduce,mr=G.createMatrix;function fr(e,t){return Math.round(e*t)/t}function dr(e){return or(e)?e+"px":e}function yr(e,t,n){var i=s("g");je(i).add(t);var r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]),i}var gr={shape:["x","y","width","height"],connection:["waypoints"]};function vr(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}vr.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];var xr=vr;function br(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}vr.prototype._init=function(t){var n=this._eventBus,i=this._container=function(e){var t=(e=sr({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),sr(n.style,{position:"relative",overflow:"hidden",width:dr(e.width),height:dr(e.height)}),t.appendChild(n),n}(t),r=this._svg=s("svg");e(r,{width:"100%",height:"100%"}),J(i,r);var a=this._viewport=yr(r,"viewport");this._layers={},!1!==t.deferUpdate&&(this._viewboxChanged=cr(ur(this._viewboxChanged,this),300)),n.on("diagram.init",function(){n.fire("canvas.init",{svg:r,viewport:a})},this),n.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed"],function(){delete this._cachedViewbox},this),n.on("diagram.destroy",500,this._destroy,this),n.on("diagram.clear",500,this._clear,this)},vr.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},vr.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=nr.getType(t);"root"===n?e.setRootElement(null,!0):e._removeElement(t,n)}),delete this._cachedViewbox},vr.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},vr.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},vr.prototype._createLayer=function(e,t){t||(t=0);var n=hr(this._layers,function(e,n){return t>=n.index&&e++,e},0);return{group:yr(this._viewport,"layer-"+e,n),index:t}},vr.prototype.getContainer=function(){return this._container},vr.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(pr([i.gfx,i.secondaryGfx],function(e){e&&(n?je(e).add(t):je(e).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},vr.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},vr.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},vr.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));var n=this.getGraphics(e);return je(n).has(t)},vr.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},vr.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},vr.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 a=this.getDefaultLayer();r.fire("root.add",{element:e}),i.add(e,a,this._svg),r.fire("root.added",{element:e,gfx:a})}return this._rootElement=e,e},vr.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=gr[e];if(!lr(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},vr.prototype._setParent=function(e,t,n){tr.add(t.children,e,n),e.parent=t},vr.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var r=this._eventBus,a=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);var o=a.create(e,t,i);return this._elementRegistry.add(t,o),a.update(e,t,o),r.fire(e+".added",{element:t,gfx:o}),t},vr.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},vr.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},vr.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),tr.remove(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},vr.prototype.removeShape=function(e){return this._removeElement(e,"shape")},vr.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},vr.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},vr.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},vr.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},vr.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,a,o,s=this._viewport,p=this.getSize();return e?(this._changeViewbox(function(){r=Math.min(p.width/e.width,p.height/e.height);var t=this._svg.createSVGMatrix().scale(r).translate(-e.x,-e.y);K(s,t)}),e):(t=this.getDefaultLayer().getBBox(),n=(i=K(s))?i.matrix:mr(),r=fr(n.a,1e3),a=fr(-n.e||0,1e3),o=fr(-n.f||0,1e3),e=this._cachedViewbox={x:a?a/r:0,y:o?o/r:0,width:p.width/r,height:p.height/r,scale:r,inner:{width:t.width,height:t.height,x:t.x,y:t.y},outer:p})},vr.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=sr({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),br(t,n)}),{x:n.e,y:n.f}},vr.prototype.zoom=function(e,t){return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox(function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)}),fr(i.a,1e3)):this.viewbox(e).scale;var n,i},vr.prototype._fitViewport=function(e){var t,n,i=this.viewbox(),r=i.outer,a=i.inner;return a.x>=0&&a.y>=0&&a.x+a.width<=r.width&&a.y+a.height<=r.height&&!e?n={x:0,y:0,width:Math.max(a.width+a.x,r.width),height:Math.max(a.height+a.y,r.height)}:(t=Math.min(1,r.width/a.width,r.height/a.height),n={x:a.x+(e?a.width/2-r.width/t/2:0),y:a.y+(e?a.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},vr.prototype._setZoom=function(e,t){var n,i,r,a,o=this._svg,s=this._viewport,p=o.createSVGMatrix(),l=o.createSVGPoint(),c=(i=s.getCTM()).a;return t?(n=sr(l,t).matrixTransform(i.inverse()),r=p.translate(n.x,n.y).scale(1/c*e).translate(-n.x,-n.y),a=i.multiply(r)):a=p.scale(e),br(this._viewport,a),a},vr.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},vr.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();e.waypoints?t=this.getGraphics(e).getBBox():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}},vr.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Er={},wr=c.assign,_r=new Yt({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Ar=new Yt({name:"label",enumerable:!0},{name:"labelTarget"}),Sr=new Yt({name:"attachers",collection:!0},{name:"host"}),Cr=new Yt({name:"outgoing",collection:!0},{name:"source"}),Rr=new Yt({name:"incoming",collection:!0},{name:"target"});function Mr(){Object.defineProperty(this,"businessObject",{writable:!0}),_r.bind(this,"parent"),Ar.bind(this,"label"),Cr.bind(this,"outgoing"),Rr.bind(this,"incoming")}function kr(){Mr.call(this),_r.bind(this,"children"),Sr.bind(this,"host"),Sr.bind(this,"attachers")}function Pr(){kr.call(this)}function Tr(){kr.call(this),Ar.bind(this,"labelTarget")}function Nr(){Mr.call(this),Cr.bind(this,"source"),Rr.bind(this,"target")}ge(kr,Mr),ge(Pr,kr),ge(Tr,kr),ge(Nr,Mr);var Dr={connection:Nr,shape:kr,label:Tr,root:Pr};Er.create=function(e,t){var n=Dr[e];if(!n)throw new Error("unknown type: <"+e+">");return wr(new n,t)};var Or=c.assign;function Br(){this._uid=12}var Lr=Br;Br.prototype.createRoot=function(e){return this.create("root",e)},Br.prototype.createLabel=function(e){return this.create("label",e)},Br.prototype.createShape=function(e){return this.create("shape",e)},Br.prototype.createConnection=function(e){return this.create("connection",e)},Br.prototype.create=function(e,t){return(t=Or({},t||{})).id||(t.id=e+"_"+this._uid++),Er.create(e,t)};var Ir="data-element-id";function Fr(e){this._elements={},this._eventBus=e}Fr.$inject=["eventBus"];var jr=Fr;Fr.prototype.add=function(t,n,i){var r=t.id;this._validateId(r),e(n,Ir,r),i&&e(i,Ir,r),this._elements[r]={element:t,gfx:n,secondaryGfx:i}},Fr.prototype.remove=function(t){var n=this._elements,i=t.id||t,r=i&&n[i];r&&(e(r.gfx,Ir,""),r.secondaryGfx&&e(r.secondaryGfx,Ir,""),delete n[i])},Fr.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)},Fr.prototype.get=function(t){var n;n="string"==typeof t?t:t&&e(t,Ir);var i=this._elements[n];return i&&i.element},Fr.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},Fr.prototype.getAll=function(){return this.filter(function(e){return e})},Fr.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n],r=i.element,a=i.gfx;return e(r,a)})},Fr.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Fr.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 Vr={},Wr=c.isFunction,zr=c.isArray,Gr=c.isNumber,$r=c.bind,Hr=c.assign,Kr=Array.prototype.slice;function Ur(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function qr(){}Vr=Ur,Ur.prototype.on=function(e,t,n,i){if(e=zr(e)?e:[e],Wr(t)&&(i=n,n=t,t=1e3),!Gr(t))throw new Error("priority must be a number");var r=n;i&&((r=$r(n,i)).__fn=n.__fn||n);var a=this,o={priority:t,callback:r};e.forEach(function(e){a._addListener(e,o)})},Ur.prototype.once=function(e,t,n,i){var r=this;if(Wr(t)&&(i=n,n=t,t=1e3),!Gr(t))throw new Error("priority must be a number");function a(){return r.off(e,a),n.apply(i,arguments)}a.__fn=n,this.on(e,t,a)},Ur.prototype.off=function(e,t){var n,i,r,a=this._getListeners(e);if(t)for(r=a.length-1;n=a[r];r--)(i=n.callback)!==t&&i.__fn!==t||a.splice(r,1);else a.length=0},Ur.prototype.fire=function(e,t){var n,i,r,a;if(a=Kr.call(arguments),"object"==typeof e&&(e=(n=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){t instanceof qr?n=t:(n=new qr).init(t),a[0]=n;var o=n.type;e!==o&&(n.type=e);try{r=this._invokeListeners(n,a,i)}finally{e!==o&&(n.type=o)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},Ur.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},Ur.prototype._destroy=function(){this._listeners={}},Ur.prototype._invokeListeners=function(e,t,n){var i,r,a;for(i=0;(r=n[i])&&!e.cancelBubble;i++)a=this._invokeListener(e,t,r);return a},Ur.prototype._invokeListener=function(e,t,n){var i;try{void 0!==(i=function(e,t){return e.apply(null,t)}(n.callback,t))&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener"),console.error(e.stack),e}return i},Ur.prototype._addListener=function(e,t){var n,i,r=this._getListeners(e);for(i=0;n=r[i];i++)if(n.priority<t.priority)return void r.splice(i,0,t);r.push(t)},Ur.prototype._getListeners=function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t},Vr.Event=qr,qr.prototype.stopPropagation=function(){this.cancelBubble=!0},qr.prototype.preventDefault=function(){this.defaultPrevented=!0},qr.prototype.init=function(e){Hr(this,e||{})};var Yr={},Xr=ve.query;Yr.getVisual=function(e){return Xr(".djs-visual",e)},Yr.getChildren=function(e){return e.parentNode.childNodes[1]};var Zr=c.forEach,Jr=c.reduce,Qr=q.translate,ea=ve.clear;function ta(e,t){this._eventBus=e,this._elementRegistry=t}ta.$inject=["eventBus","elementRegistry"];var na=ta;function ia(e,t,n){t.insertBefore(e,n||t.firstChild)}ta.prototype._getChildren=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=Yr.getChildren(n))||(t=s("g"),je(t).add("djs-children"),J(n.parentNode,t)):t=n,t},ta.prototype._clear=function(e){var t=Yr.getVisual(e);return ea(t),t},ta.prototype._createContainer=function(e,t,n){var i=s("g");je(i).add("djs-group"),void 0!==n?ia(i,t,t.childNodes[n]):J(t,i);var r=s("g");je(r).add("djs-element"),je(r).add("djs-"+e),J(i,r);var a=s("g");return je(a).add("djs-visual"),J(r,a),r},ta.prototype.create=function(e,t,n){var i=this._getChildren(t.parent);return this._createContainer(e,i,n)},ta.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=Jr(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),Zr(t,function(e){var t=e.children;if(t){var r=n._getChildren(e);Zr(t.slice().reverse(),function(e){ia(i.getGraphics(e).parentNode,r)})}})},ta.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},ta.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},ta.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},ta.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},ta.prototype.update=function(t,n,i){if(n.parent){var r=this._clear(i);if("shape"===t)this.drawShape(r,n),Qr(i,n.x,n.y);else{if("connection"!==t)throw new Error("unknown type: "+t);this.drawConnection(r,n)}n.hidden?e(i,"display","none"):e(i,"display","block")}},ta.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);Q(t.parentNode)};var ra=p.componentsToPath,aa=p.createLine,oa=1;function sa(e,t){z.call(this,e,oa),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2})}ge(sa,z),sa.prototype.canRender=function(){return!0},sa.prototype.drawShape=function(t,n){var i=s("rect");return e(i,{x:0,y:0,width:n.width||0,height:n.height||0}),e(i,this.SHAPE_STYLE),J(t,i),i},sa.prototype.drawConnection=function(e,t){var n=aa(t.waypoints,this.CONNECTION_STYLE);return J(e,n),n},sa.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width,r=e.height;return ra([["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]])},sa.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([0===t?"M":"L",n.x,n.y]);return ra(r)},sa.$inject=["eventBus","styles"];var pa=sa,la=c.isArray,ca=c.assign,ua=c.reduce;var ha={__depends__:[{__init__:["defaultRenderer"],defaultRenderer:["type",pa],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){var i=this.style(t,n);return ca(i,{class:e})},this.style=function(t,n){la(t)||n||(n=t,t=[]);var i=ua(t,function(t,n){return ca(t,e[n]||{})},{});return n?ca(i,n):i},this.computeStyle=function(e,n,i){return la(n)||(i=n,n=[]),t.style(n||[],ca({},i,e||{}))}}]}],__init__:["canvas"],canvas:["type",xr],elementRegistry:["type",jr],elementFactory:["type",Lr],eventBus:["type",Vr],graphicsFactory:["type",na]},ma={};Object.defineProperty(ma,"__esModule",{value:!0});var fa=/^class /;function da(e){return"[object Array]"===Object.prototype.toString.call(e)}function ya(){var e=Array.prototype.slice.call(arguments);1===e.length&&da(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var ga=/constructor\s*[^(]*\(\s*([^)]*)\)/m,va=/^function\s*[^(]*\(\s*([^)]*)\)/m,xa=/\/\*([^*]*)\*\//m;function ba(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(function(e){return fa.test(e.toString())}(e)?ga:va);return t&&t[1]&&t[1].split(",").map(function(e){return(t=e.match(xa))?t[1].trim():e.trim()})||[]}function Ea(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}}var wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _a(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function Aa(e,t){return Object.hasOwnProperty.call(e,t)}ma.Injector=function e(t,n){n=n||{get:function(e,t){if(i.push(e),!1===t)return null;throw s('No provider for "'+e+'"!')}};var i=[],r=this._providers=Object.create(n._providers||null),a=this._instances=Object.create(null),o=a.injector=this,s=function(e){var t=i.join(" -> ");return i.length=0,new Error(t?e+" (Resolving: "+t+")":e)},p=function e(t,o){if(!r[t]&&-1!==t.indexOf(".")){for(var p=t.split("."),l=e(p.shift());p.length;)l=l[p.shift()];return l}if(Aa(a,t))return a[t];if(Aa(r,t)){if(-1!==i.indexOf(t))throw i.push(t),s("Cannot resolve circular dependency!");return i.push(t),a[t]=r[t][0](r[t][1]),i.pop(),a[t]}return n.get(t,o)},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e){if(!da(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=ya(e.slice())}return{fn:e,dependencies:(e.$inject||ba(e)).map(function(e){return Aa(t,e)?t[e]:p(e)})}},c=function(e){var t=l(e),n=t.dependencies,i=t.fn;return new(Function.prototype.bind.apply(i,[null].concat(_a(n))))},u=function(e,t,n){var i=l(e,n),r=i.dependencies,a=i.fn;return a.call.apply(a,[t].concat(_a(r)))},h=function(e){return ya(function(t){return e.get(t)})},m={factory:u,type:c,value:function(e){return e}};t.forEach(function(t){function n(e,t){return"value"!==e&&da(t)&&(t=ya(t.slice())),t}if(t instanceof Ea)t.forEach(function(e){var t=e[0],i=e[1],a=e[2];r[t]=[m[i],n(i,a),i]});else if("object"===(void 0===t?"undefined":wa(t)))if(t.__exports__){var i=Object.keys(t).reduce(function(e,n){return"__"!==n.substring(0,2)&&(e[n]=t[n]),e},Object.create(null)),a=new e((t.__modules__||[]).concat([i]),o),s=ya(function(e){return a.get(e)});t.__exports__.forEach(function(e){r[e]=[s,e,"private",a]})}else Object.keys(t).forEach(function(e){if("private"!==t[e][2]){var i=t[e][0],a=t[e][1];r[e]=[m[i],n(i,a),i]}else r[e]=t[e]})}),this.get=p,this.invoke=u,this.instantiate=c,this.createChild=function(t,n){if(n&&n.length){var i,a,s,p,l=Object.create(null),c=Object.create(null),u=[],m=[],f=[];for(var d in r)i=r[d],-1!==n.indexOf(d)&&("private"===i[2]?-1===(a=u.indexOf(i[3]))?(s=i[3].createChild([],n),p=h(s),u.push(i[3]),m.push(s),f.push(p),l[d]=[p,d,"private",s]):l[d]=[f[a],d,"private",m[a]]:l[d]=[i[2],i[1]],c[d]=!0),"factory"!==i[2]&&"type"!==i[2]||!i[1].$scope||n.forEach(function(e){-1!==i[1].$scope.indexOf(e)&&(l[d]=[i[2],i[1]],c[e]=!0)});n.forEach(function(e){if(!c[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),t.unshift(l)}return new e(t,o)}};var Sa=ma.Injector;function Ca(e){var t=[],n=[];function i(e){return t.indexOf(e)>=0}e.forEach(function e(r){i(r)||((r.__depends__||[]).forEach(e),i(r)||(function(e){t.push(e)}(r),(r.__init__||[]).forEach(function(e){n.push(e)})))});var r=new Sa(t);return n.forEach(function(e){try{r["string"==typeof e?"get":"invoke"](e)}catch(e){throw console.error("Failed to instantiate component"),console.error(e.stack),e}}),r}function Ra(e,t){this.injector=t=t||function(e){return Ca([{config:["value",e=e||{}]},ha].concat(e.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}var Ma=Ra;Ra.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Ra.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var ka=Ma;function Pa(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}var Ta=Pa;Pa.prototype.next=function(){return this._prefix+ ++this._counter};var Na=c.isArray,Da=c.isString,Oa=c.isObject,Ba=c.assign,La=c.forEach,Ia=c.find,Fa=c.filter,ja=c.matchPattern,Va=ve.domify,Wa=ve.classes,za=ve.attr,Ga=ve.remove,$a=ve.clear,Ha=nr.getBBox,Ka=new Ta("ov");function Ua(e,t,n){Ba(e.style,{left:t+"px",top:n+"px"})}function qa(e,t){e.style.display=!1===t?"none":""}function Ya(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}function Xa(e){return void 0!==e}function Za(e,t,n,i){var r,a;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=Ka,this._overlayDefaults=Ba({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),a=Va('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(a,r.firstChild),a),this._init()}Za.$inject=["config.overlays","eventBus","canvas","elementRegistry"];var Ja=Za;Za.prototype.get=function(e){if(Da(e)&&(e={id:e}),Da(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?Fa(t.overlays,ja({type:e.type})):t.overlays.slice():[]}return e.type?Fa(this._overlays,ja({type:e.type})):e.id?this._overlays[e.id]:null},Za.prototype.add=function(e,t,n){if(Oa(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=Ba({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},Za.prototype.remove=function(e){var t=this.get(e)||[];Na(t)||(t=[t]);var n=this;La(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Ga(e.html),Ga(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var i=t.overlays.indexOf(e);-1!==i&&t.overlays.splice(i,1)}})},Za.prototype.show=function(){qa(this._overlayRoot)},Za.prototype.hide=function(){qa(this._overlayRoot,!1)},Za.prototype.clear=function(){this._overlays={},this._overlayContainers=[],$a(this._overlayRoot)},Za.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var a=Ha(t);i=a.x,r=a.y}Ua(n,i,r),za(e.html,"data-container-id",t.id)},Za.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,a=e.element,o=i.left,s=i.top;void 0!==i.right&&(t=a.waypoints?Ha(a).width:a.width,o=-1*i.right+t);void 0!==i.bottom&&(n=a.waypoints?Ha(a).height:a.height,s=-1*i.bottom+n);Ua(r,o||0,s||0)},Za.prototype._createOverlayContainer=function(e){var t=Va('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},Za.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";Ya(this._overlayRoot,n)},Za.prototype._getOverlayContainer=function(e,t){var n=Ia(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},Za.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,a=e.html;a.get&&a.constructor.prototype.jquery&&(a=a.get(0)),Da(a)&&(a=Va(a)),n=this._getOverlayContainer(r),(t=Va('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(a),e.type&&Wa(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())},Za.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=n&&n.minZoom,r=n&&n.maxZoom,a=e.htmlContainer,o=!0;n&&((Xa(i)&&i>t.scale||Xa(r)&&r<t.scale)&&(o=!1),qa(a,o)),this._updateOverlayScale(e,t)},Za.prototype._updateOverlayScale=function(e,t){var n,i,r,a=e.scale,o=e.htmlContainer,s="";!0!==a&&(!1===a?(n=1,i=1):(n=a.min,i=a.max),Xa(n)&&t.scale<n&&(r=(1/t.scale||1)*n),Xa(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),Xa(r)&&(s="scale("+r+","+r+")"),Ya(o,s)},Za.prototype._updateOverlaysVisibilty=function(e){var t=this;La(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},Za.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){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()}),e.on(["shape.remove","connection.remove"],function(e){var n=e.element,i=t.get({element:n});La(i,function(e){t.remove(e.id)});var r=t._getOverlayContainer(n);if(r){Ga(r.html);var a=t._overlayContainers.indexOf(r);-1!==a&&t._overlayContainers.splice(a,1)}}),e.on("element.changed",500,function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(La(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&&Wa(n.html)[e.add?"add":"remove"](e.marker)}),e.on("diagram.clear",this.clear,this)};var Qa={__init__:["overlays"],overlays:["type",Ja]},eo={};function to(e){return e.originalEvent||e.srcEvent}eo.getOriginal=to,eo.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 no={isMac:function(){return/mac/i.test(navigator.platform)}},io={},ro=eo.getOriginal,ao=no.isMac;function oo(e){return!(ro(e)||e).button}io.isPrimaryButton=oo,io.hasPrimaryModifier=function(e){var t=ro(e)||e;return!!oo(e)&&(ao()?t.metaKey:t.ctrlKey)};var so=c.forEach,po=ve.delegate,lo=io.isPrimaryButton,co=ve.query,uo=p.createLine,ho=p.updateLine;function mo(e){return!0}var fo=500;function yo(t,n,i){var r=i.cls("djs-hit",["no-fill","no-border"],{stroke:"white",strokeWidth:15});function a(e,i,r){var a,o;(function(e,t){return!(c[e]||lo)(t)})(e,i)||(r?o=n.getGraphics(r):(a=i.delegateTarget||i.target)&&(o=a,r=n.get(o)),o&&r&&!1===t.fire(e,{element:r,gfx:o,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function p(e){return o[e]}var l={mouseover:"element.hover",mouseout:"element.out",click:"element.click",dblclick:"element.dblclick",mousedown:"element.mousedown",mouseup:"element.mouseup",contextmenu:"element.contextmenu"},c={"element.contextmenu":mo};var u="svg, .djs-element";function h(e,t,n,i){var r=o[n]=function(e){a(n,e)};i&&(c[n]=i),r.$delegate=po.bind(e,u,t,r)}function m(e,t,n){var i=p(n);i&&po.unbind(e,t,i.$delegate)}t.on("canvas.destroy",function(e){var t;t=e.svg,so(l,function(e,n){m(t,n,e)})}),t.on("canvas.init",function(e){var t;t=e.svg,so(l,function(e,n){h(t,n,e)})}),t.on(["shape.added","connection.added"],function(t){var n,i=t.element,a=t.gfx;i.waypoints?n=uo(i.waypoints):(n=s("rect"),e(n,{x:0,y:0,width:i.width,height:i.height})),e(n,r),J(a,n)}),t.on("shape.changed",fo,function(t){var n=t.element,i=t.gfx,r=co(".djs-hit",i);e(r,{width:n.width,height:n.height})}),t.on("connection.changed",function(e){var t=e.element,n=e.gfx,i=co(".djs-hit",n);ho(i,t.waypoints)}),this.fire=a,this.triggerMouseEvent=function(e,t,n){var i=l[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return a(i,t,n)},this.mouseHandler=p,this.registerEvent=h,this.unregisterEvent=m}yo.$inject=["eventBus","elementRegistry","styles"];var go={__init__:["interactionEvents"],interactionEvents:["type",yo]},vo=nr.getBBox,xo=500,bo=ve.query,Eo=c.assign;function wo(t,n,i){this.offset=6;var r=n.cls("djs-outline",["no-fill"]),a=this;function o(t,n){var i=s("rect");return e(i,Eo({x:10,y:10,width:100,height:100},r)),J(t,i),i}t.on(["shape.added","shape.changed"],xo,function(e){var t=e.element,n=e.gfx,i=bo(".djs-outline",n);i||(i=o(n)),a.updateShapeOutline(i,t)}),t.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,i=bo(".djs-outline",n);i||(i=o(n)),a.updateConnectionOutline(i,t)})}wo.prototype.updateShapeOutline=function(t,n){e(t,{x:-this.offset,y:-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},wo.prototype.updateConnectionOutline=function(t,n){var i=vo(n);e(t,{x:i.x-this.offset,y:i.y-this.offset,width:i.width+2*this.offset,height:i.height+2*this.offset})},wo.$inject=["eventBus","styles","elementRegistry"];var _o={__init__:["outline"],outline:["type",wo]},Ao=c.isArray,So=c.forEach;function Co(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)})}Co.$inject=["eventBus"];var Ro=Co;Co.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})}},Co.prototype.get=function(){return this._selectedElements},Co.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Co.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();Ao(e)||(e=e?[e]:[]),t?So(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 Mo=io.hasPrimaryModifier,ko=c.find;function Po(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);ko(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),a=t.get().length>1,o=Mo(e);if(r&&a)return o?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,o)})}Po.$inject=["eventBus","selection","canvas","elementRegistry"];var To=Po,No=c.forEach,Do="hover",Oo="selected";function Bo(e,t,n,i){function r(e,n){t.addMarker(e,n)}function a(e,n){t.removeMarker(e,n)}this._multiSelectionBox=null,e.on("element.hover",function(e){r(e.element,Do)}),e.on("element.out",function(e){a(e.element,Do)}),e.on("selection.changed",function(e){var t=e.oldSelection,n=e.newSelection;No(t,function(e){-1===n.indexOf(e)&&a(e,Oo)}),No(n,function(e){-1===t.indexOf(e)&&r(e,Oo)})})}Bo.$inject=["eventBus","canvas","selection","styles"];var Lo={__init__:["selectionVisuals","selectionBehavior"],__depends__:[go,_o],selection:["type",Ro],selectionVisuals:["type",Bo],selectionBehavior:["type",To]},Io=function(e){var t;for(;t=e.firstChild;)Q(t);return e};var Fo=function e(t,n){var i,r,a,o,s;switch(t.nodeType){case 3:n.push(zo(t.textContent,jo));break;case 1:if(n.push("<",t.tagName),t.hasAttributes())for(a=t.attributes,i=0,r=a.length;i<r;++i)o=a.item(i),n.push(" ",o.name,'="',zo(o.value,Vo),'"');if(t.hasChildNodes()){for(n.push(">"),s=t.childNodes,i=0,r=s.length;i<r;++i)e(s.item(i),n);n.push("</",t.tagName,">")}else n.push("/>");break;case 8:n.push("\x3c!--",zo(t.nodeValue,jo),"--\x3e");break;case 4:n.push("<![CDATA[",t.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+t.nodeType)}return n},jo=/([&<>]{1})/g,Vo=/([\n\r"]{1})/g,Wo={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function zo(e,t){return e.replace(t,function(e,t){return Wo[t]||t})}var Go=function(e,t){if(void 0!==t){try{!function(e,t){var n,i=a(t).documentElement;if(Io(e),!t)return;n=i.firstChild;for(;n;)Z(n,e),n=n.nextSibling}(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){var t=e.firstChild,n=[];for(;t;)Fo(t,n),t=t.nextSibling;return n.join("")}(e)};var $o=c.assign,Ho=c.isNumber,Ko=c.omit,Uo=ve.domify,qo=ve.query,Yo=ve.remove,Xo=rn.importBpmnDiagram;var Zo={width:"100%",height:"100%",position:"relative"};function Jo(e){return e+(Ho(e)?"px":"")}function Qo(e){var t,n,i;e=$o({},Zo,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n=an.BPMNIO_IMG,i=Uo('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100">'+n+"</a>"),t.appendChild(i),ts.bind(i,"click",function(e){an.open(),e.preventDefault()}),this._init(this._container,this._moddle,e)}ge(Qo,ka);var es=Qo;Qo.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 a=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:a}),t(e,a);n.importDefinitions(i,function(e,i){var r=[].concat(a,i||[]);n._emit("import.done",{error:e,warnings:r}),t(e,r)})})},Qo.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)},Qo.prototype.saveSVG=function(e,t){var n,i;t||(t=e,e={});try{var r=this.get("canvas"),a=r.getDefaultLayer(),o=qo("defs",r._svg),s=Go(a),p=o?"<defs>"+Go(o)+"</defs>":"",l=a.getBBox();n='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+l.width+'" height="'+l.height+'" viewBox="'+l.x+" "+l.y+" "+l.width+" "+l.height+'" version="1.1">'+p+s+"</svg>"}catch(e){i=e}t(i,n)},Qo.prototype.importDefinitions=function(e,t){try{this._definitions&&this.clear(),this._definitions=e}catch(e){return t(e)}return Xo(this,e,t)},Qo.prototype.getModules=function(){return this._modules},Qo.prototype.destroy=function(){ka.prototype.destroy.call(this),Yo(this._container)},Qo.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},Qo.prototype.off=function(e,t){this.get("eventBus").off(e,t)},Qo.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=qo(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},Qo.prototype.getDefinitions=function(){return this._definitions},Qo.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},Qo.prototype._init=function(e,t,n){var i=n.modules||this.getModules(),r=n.additionalModules||[],a=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),o=$o(Ko(n,["additionalModules"]),{canvas:$o({},n.canvas,{container:e}),modules:a});ka.call(this,o),n&&n.container&&this.attachTo(n.container)},Qo.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},Qo.prototype._createContainer=function(e){var t=Uo('<div class="bjs-container"></div>');return $o(t.style,{width:Jo(e.width),height:Jo(e.height),position:e.position}),t},Qo.prototype._createModdle=function(e){var t=$o({},this._moddleExtensions,e.moddleExtensions);return new er(t)},Qo.prototype._modules=[Ht,$t,Lo,Qa],Qo.prototype._moddleExtensions={};var ts=ve.event;var ns={},is=5e3;ns.install=function(e,t){function n(){return!1}return t=t||"element.click",e.once(t,is,n),function(){e.off(t,n)}};var rs={},as=ve.classes,os=/^djs-cursor-.*$/;rs.set=function(e){var t=as(document.body);t.removeMatching(os),e&&t.add("djs-cursor-"+e)},rs.unset=function(){this.set(null)};var ss={};ss.log10=function(e){return Math.log(e)/Math.log(10)},ss.substract=function(e,t){return{x:e.x-t.x,y:e.y-t.y}};var ps=ss.substract,ls=ve.event,cs=ve.closest;var us=15;function hs(e,t){var n;function i(i){var r,a=n.start,o=eo.toPoint(i),s=ps(o,a);if(!n.dragging&&(r=s,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>us)&&(n.dragging=!0,ns.install(e),rs.set("grab")),n.dragging){var p=n.last||n.start;s=ps(o,p),t.scroll({dx:s.x,dy:s.y}),n.last=o}i.preventDefault()}function r(e){ls.unbind(document,"mousemove",i),ls.unbind(document,"mouseup",r),n=null,rs.unset()}e.on("element.mousedown",500,function(e){return function(e){if(!cs(e.target,".djs-draggable")&&!(e.button||e.ctrlKey||e.shiftKey||e.altKey))return n={start:eo.toPoint(e)},ls.bind(document,"mousemove",i),ls.bind(document,"mouseup",r),!0}(e.originalEvent)})}hs.$inject=["eventBus","canvas"];var ms={__init__:["moveCanvas"],moveCanvas:["type",hs]},fs={},ds=ss.log10;fs.getStepSize=function(e,t){var n=ds(e.min),i=ds(e.max);return(Math.abs(n)+Math.abs(i))/t},fs.cap=function(e,t){return Math.max(e.min,Math.min(e.max,t))};var ys=ve.event,gs=ve.closest,vs=fs.getStepSize,xs=fs.cap,bs=ss.log10,Es=c.bind,ws=Math.sign||function(e){return e>=0?1:-1},_s={min:.2,max:4},As=.75;function Ss(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=Es(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||As;var i=this;t.on("canvas.init",function(t){i._init(!1!==e.enabled)})}Ss.$inject=["config.zoomScroll","eventBus","canvas"];var Cs=Ss;Ss.prototype.scroll=function(e){this._canvas.scroll(e)},Ss.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Ss.prototype.zoom=function(e,t){var n=vs(_s,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Ss.prototype._handleWheel=function(e){if(!gs(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey,r=e.shiftKey,a=-1*this._scale;if(a*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var o=t.getBoundingClientRect(),s={x:e.clientX-o.left,y:e.clientY-o.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*ws(e.deltaY)*a,this.zoom(n,s)}else n=r?{dx:a*e.deltaY,dy:0}:{dx:a*e.deltaX,dy:a*e.deltaY},this.scroll(n)}},Ss.prototype.stepZoom=function(e,t){var n=vs(_s,10);this._zoom(e,t,n)},Ss.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,a=bs(i.zoom()),o=Math.round(a/n)*n;o+=n*r;var s=Math.pow(10,o);i.zoom(xs(_s,s),t)},Ss.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&ys[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Ss.prototype._init=function(e){this.toggle(e)};var Rs={__init__:["zoomScroll"],zoomScroll:["type",Cs]};function Ms(e){es.call(this,e)}ge(Ms,es);var ks=Ms;return Ms.prototype._navigationModules=[Rs,ms],Ms.prototype._modules=[].concat(Ms.prototype._modules,Ms.prototype._navigationModules),ks});
1
+ /*! bpmn-js - bpmn-navigated-viewer v0.31.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
2
+ !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(){var e,t,n={exports:{}};e=this,t=function(e){"use strict";function t(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}function n(e,n){return n.appendChild(t(e,n)),e}var i=2,r={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":i,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":i,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function a(e,t,n){var a=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=r[a];o?(o===i&&"number"==typeof n&&(n=String(n)+"px"),e.style[a]=n):e.setAttributeNS(null,t,n)}function o(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return r[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);a(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)a(e,i,t[i])}(e,t);return e}function s(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1}var p=/\s+/,l=Object.prototype.toString;function c(e){return void 0!==e}function u(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function h(e){var t=e.parentNode;return t&&t.removeChild(e),e}function m(e){for(var t;t=e.firstChild;)h(t);return e}u.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~s(t,e)||t.push(e),c(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},u.prototype.remove=function(e){if("[object RegExp]"===l.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=s(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},u.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},u.prototype.toggle=function(e,t){return this.list?(c(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(c(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},u.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(p);return""===e[0]&&e.shift(),e},u.prototype.has=u.prototype.contains=function(e){return this.list?this.list.contains(e):!!~s(this.array(),e)};var f={svg:"http://www.w3.org/2000/svg"},d='<svg xmlns="'+f.svg+'"';function y(e){return"<svg"===e.substring(0,4)?-1===e.indexOf(f.svg)&&(e=d+e.substring(4)):e=d+">"+e+"</svg>",function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e)}function g(e,t){var n;return"<"===e.charAt(0)?(n=y(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(f.svg,e),t&&o(n,t),n}var v=g("svg");function x(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}var b=/([&<>]{1})/g,E=/([\n\r"]{1})/g,w={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function _(e,t){return e.replace(t,function(e,t){return w[t]||t})}function A(e,t){var n,i,r,a,o;switch(e.nodeType){case 3:t.push(_(e.textContent,b));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)a=r.item(n),t.push(" ",a.name,'="',_(a.value,E),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(o=e.childNodes).length;n<i;++n)A(o.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",_(e.nodeValue,b),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function S(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}e.append=function(e,t){return n(t,e),e},e.attr=o,e.classes=function(e){return new u(e)},e.create=g,e.innerSVG=function(e,t){if(void 0!==t){try{!function(e,t){var i,r=y(t).documentElement;if(m(e),t)for(i=r.firstChild;i;)n(i,e),i=i.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;)A(t,n),t=t.nextSibling;return n.join("")}(e)},e.remove=h,e.transform=function(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(S(e,i));e.consolidate()}(n,t):n.initialize(S(n,t))},e.createMatrix=function(e,t,n,i,r,a){var o=v.createSVGMatrix();switch(arguments.length){case 0:return o;case 6:e={a:e,b:t,c:n,d:i,e:r,f:a}}return x(o,e)},e.createTransform=function(e){return e?v.createSVGTransformFromMatrix(e):v.createSVGTransform()},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof n.exports?t(n.exports):t(e.TinySVG={});var i={},r=(n=n.exports).attr,a=n.create;function o(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}i.componentsToPath=function(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")},i.createLine=function(e,t){var n=a("polyline");return r(n,{points:o(e)}),t&&r(n,t),n},i.updateLine=function(e,t){return r(e,{points:o(t)}),e};var s={exports:{}};!function(e,t){"object"==typeof s.exports?t(s.exports):t(e.MinDash={})}(this,function(e){"use strict";var t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function i(e){return null==e}function r(e){return"[object Array]"===t.call(e)}function a(e){return"[object Object]"===t.call(e)}function o(e){return"[object Function]"===t.call(e)}function s(e,t){return n.call(e,t)}function p(e,t){var n;return t=d(t),l(e,function(e,i){if(t(e,i))return n=e,!1}),n}function l(e,t){if(!i(e)){var n=r(e)?g:y;for(var a in e){if(s(e,a))if(!1===t(e[a],n(a)))return}}}function c(e,t,n){return l(e,function(e,i){n=t(n,e,i)}),n}function u(e,t){return c(e,function(e,n,i){return e&&t(n,i)},!0)}function h(e,t){var n=[];return l(e,function(e,i){n.push(t(e,i))}),n}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=f(t),l(e,function(e){var i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)}),n}function f(e){return o(e)?e:function(t){return t[e]}}function d(e){return o(e)?e:function(t){return t===e}}function y(e){return e}function g(e){return Number(e)}var v=Array.prototype.slice;var x=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e};e.find=p,e.filter=function(e,t){var n=[];return l(e,function(e,i){t(e,i)&&n.push(e)}),n},e.forEach=l,e.reduce=c,e.every=u,e.some=function(e,t){return!!p(e,t)},e.map=h,e.groupBy=m,e.matchPattern=function(e){return function(t){return u(e,function(e,n){return t[n]===e})}},e.debounce=function(e,t){var n;return function(){var i=v.call(arguments);n&&clearTimeout(n),n=setTimeout(function(){e.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(i))},t)}},e.bind=function(e,t){return e.bind(t)},e.isArray=r,e.isObject=a,e.isNumber=function(e){return"[object Number]"===t.call(e)},e.isFunction=o,e.isString=function(e){return"[object String]"===t.call(e)},e.assign=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return x.apply(void 0,[e].concat(n))},e.pick=function(e,t){var n={},i=Object(e);return l(t,function(t){t in i&&(n[t]=e[t])}),n},e.omit=function(e,t){var n={};return l(Object(e),function(e,i){-1===t.indexOf(i)&&(n[i]=e)}),n},Object.defineProperty(e,"__esModule",{value:!0})});var p={},l=(s=s.exports).every,c=s.some,u=i.componentsToPath;function h(e){return e.businessObject.di}p.isTypedEvent=function(e,t,n){return c(e.eventDefinitions,function(i){return i.$type===t&&function(e,t){return l(t,function(t,n){return e[n]==t})}(e,n)})},p.isThrowEvent=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type},p.isCollection=function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection},p.getDi=h,p.getSemantic=function(e){return e.businessObject},p.getFillColor=function(e,t){return h(e).get("bioc:fill")||t||"white"},p.getStrokeColor=function(e,t){return h(e).get("bioc:stroke")||t||"black"},p.getCirclePath=function(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2;return u([["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]])},p.getRoundRectPath=function(e,t){var n=e.x,i=e.y,r=e.width,a=e.height;return u([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,a-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-a],["a",t,t,0,0,1,t,-t],["z"]])},p.getDiamondPath=function(e){var t=e.width,n=e.height,i=e.x,r=e.y,a=t/2,o=n/2;return u([["M",i+a,r],["l",a,o],["l",-a,o],["l",-a,-o],["z"]])},p.getRectPath=function(e){var t=e.x,n=e.y,i=e.width,r=e.height;return u([["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]])};var m={};function f(e){return e&&e.businessObject||e}m.is=function(e,t){var n=f(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)},m.getBusinessObject=f;var d={},y=m.is,g=m.getBusinessObject;s.forEach;d.isExpanded=function(e){return!y(e,"bpmn:CallActivity")&&(y(e,"bpmn:SubProcess")?!!g(e).di.isExpanded:!y(e,"bpmn:Participant")||!!g(e).processRef)},d.isEventSubProcess=function(e){return e&&!!g(e).triggeredByEvent};var v=1e3;function x(e,t){var n=this;t=t||v,e.on(["render.shape","render.connection"],t,function(e,t){var i=e.type,r=t.element,a=t.gfx;if(n.canRender(r))return"render.shape"===i?n.drawShape(a,r):n.drawConnection(a,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)})}x.prototype.canRender=function(){},x.prototype.drawShape=function(){},x.prototype.drawConnection=function(){},x.prototype.getShapePath=function(){},x.prototype.getConnectionPath=function(){};var b=x,E={},w=n.transform,_=n.createTransform;E.transform=function(e,t,n,i,r){var a=_();a.setTranslate(t,n);var o=_();o.setRotate(i,0,0);var s=_();s.setScale(r||1,r||1),w(e,[a,o,s])},E.translate=function(e,t,n){var i=_();i.setTranslate(t,n),w(e,i)},E.rotate=function(e,t){var n=_();n.setRotate(t,0,0),w(e,n)};var A=s.isObject,S=s.assign,C=s.pick,R=s.forEach,M=s.reduce,k=n.append,P=n.attr,T=n.create,N=n.remove,D=0,O={width:150,height:50};function B(e,t){t.textContent=e;try{var n,i=""===e;return t.textContent=i?"dummy":e,n=C(t.getBBox(),["width","height"]),i&&(n.width=0),n}catch(e){return{width:0,height:0}}}function L(e,t,n){for(var i,r=e.shift(),a=r;;){if((i=B(a,n)).width=a?i.width:0," "===a||""===a||i.width<Math.round(t)||a.length<2)return I(e,a,r,i);a=j(a,i.width,t)}}function I(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}function j(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-)/g),r=[],a=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+a<t)){"-"===n&&r.pop();break}r.push(n),a+=n.length}return r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function F(e){this._config=S({},{size:O,padding:D,style:{},align:"center-top"},e||{})}F.prototype.createText=function(e,t){return this.layoutText(e,t).element},F.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},F.prototype.layoutText=function(e,t){var n=S({},this._config.size,t.box),i=S({},this._config.style,t.style),r=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),a=function(e){return A(e)?S({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),o=t.fitBox||!1,s=e.split(/\r?\n/g),p=[],l=n.width-a.left-a.right,c=T("text");P(c,{x:0,y:0}),P(c,i);var u=function(){var e=document.getElementById("helper-svg");return e||(e=T("svg"),P(e,{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(e)),e}();for(k(u,c);s.length;)p.push(L(s,l,c));var h,m,f=M(p,function(e,t,n){return e+t.height},0),d=M(p,function(e,t,n){return t.width>e?t.width:e},0);switch(r.vertical){case"middle":h=(n.height-f)/2-p[0].height/4;break;default:h=a.top}var y=T("text");return P(y,i),R(p,function(e){switch(h+=e.height,r.horizontal){case"left":m=a.left;break;case"right":m=(o?d:l)-a.right-e.width;break;default:m=Math.max(((o?d:l)-e.width)/2+a.left,0)}var t=T("tspan");P(t,{x:m,y:h}),t.textContent=e.text,k(y,t)}),N(c),{dimensions:{width:d,height:f},element:y}};var V=F,W={},z=W=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;var r=n-Math.floor(n),a="";for(i=0;i<Math.floor(n);i++){a=Math.floor(Math.random()*t).toString(t)+a}if(r){var o=Math.pow(t,r);a=Math.floor(Math.random()*o).toString(t)+a}var s=parseInt(a,t);return s!==1/0&&s>=Math.pow(2,e)?z(e,t):a};function G(e){if(!(this instanceof G))return new G(e);e=e||[128,36,1],this._seed=e.length?W.rack(e[0],e[1],e[2]):e}z.rack=function(e,t,n){var i=function(i){var a=0;do{if(a++>10){if(!n)throw new Error("too many ID collisions, use more bits");e+=n}var o=z(e,t)}while(Object.hasOwnProperty.call(r,o));return r[o]=i,o},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 $=G;G.prototype.next=function(e){return this._seed(e||!0)},G.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},G.prototype.claim=function(e,t){this._seed.set(e,t||!0)},G.prototype.assigned=function(e){return this._seed.get(e)||!1},G.prototype.unclaim=function(e){delete this._seed.hats[e]},G.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var H={};H="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 K={exports:{}};!function(e,t){"object"==typeof K.exports?t(K.exports):t(e.MinDom={})}(this,function(e){"use strict";var t=[].indexOf,n=function(e,n){if(t)return e.indexOf(n);for(var i=0;i<e.length;++i)if(e[i]===n)return i;return-1},i=/\s+/,r=Object.prototype.toString;function a(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}a.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~n(t,e)||t.push(e),this.el.className=t.join(" "),this},a.prototype.remove=function(e){if("[object RegExp]"==r.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),i=n(t,e);return~i&&t.splice(i,1),this.el.className=t.join(" "),this},a.prototype.removeMatching=function(e){for(var t=this.array(),n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},a.prototype.toggle=function(e,t){return this.list?(void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(void 0!==t?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},a.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(i);return""===e[0]&&e.shift(),e},a.prototype.has=a.prototype.contains=function(e){return this.list?this.list.contains(e):!!~n(this.array(),e)};var o=Element.prototype,s=o.matchesSelector||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector,p=function(e,t){if(s)return s.call(e,t);for(var n=e.parentNode.querySelectorAll(t),i=0;i<n.length;++i)if(n[i]==e)return!0;return!1};var l,c=function(e,t,n){for(var i=n?e:e.parentNode;i&&i!==document;){if(p(i,t))return i;i=i.parentNode}},u=window.addEventListener?"addEventListener":"attachEvent",h=window.removeEventListener?"removeEventListener":"detachEvent",m="addEventListener"!==u?"on":"",f={bind:function(e,t,n,i){return e[u](m+t,n,i||!1),n},unbind:function(e,t,n,i){return e[h](m+t,n,i||!1),n}},d=["focus","blur"],y={bind:function(e,t,n,i,r){return-1!==d.indexOf(n)&&(r=!0),f.bind(e,n,function(n){var r=n.target||n.srcElement;n.delegateTarget=c(r,t,!0),n.delegateTarget&&i.call(e,n)},r)},unbind:function(e,t,n,i){-1!==d.indexOf(t)&&(i=!0),f.unbind(e,t,n,i)}},g=function(e,t){if("string"!=typeof e)throw new TypeError("String expected");t||(t=document);var n=/<([\w:]+)/.exec(e);if(!n)return t.createTextNode(e);e=e.replace(/^\s+|\s+$/g,"");var i=n[1];if("body"==i){var r=t.createElement("html");return r.innerHTML=e,r.removeChild(r.lastChild)}var a=x[i]||x._default,o=a[0],s=a[1],p=a[2];(r=t.createElement("div")).innerHTML=s+e+p;for(;o--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var l=t.createDocumentFragment();for(;r.firstChild;)l.appendChild(r.removeChild(r.firstChild));return l},v=!1;"undefined"!=typeof document&&((l=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',v=!l.getElementsByTagName("link").length,l=void 0);var x={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:v?[1,"X<div>","</div>"]:[0,"",""]};x.td=x.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],x.option=x.optgroup=[1,'<select multiple="multiple">',"</select>"],x.thead=x.tbody=x.colgroup=x.caption=x.tfoot=[1,"<table>","</table>"],x.polyline=x.ellipse=x.polygon=x.circle=x.text=x.line=x.path=x.rect=x.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var b="undefined"!=typeof Element?Element.prototype:{};b.matches||b.matchesSelector||b.webkitMatchesSelector||b.mozMatchesSelector||b.msMatchesSelector||b.oMatchesSelector;e.attr=function(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)},e.classes=function(e){return new a(e)},e.clear=function(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e},e.closest=c,e.delegate=y,e.domify=g,e.event=f,e.query=function(e,t){return(t=t||document).querySelector(e)},e.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)},Object.defineProperty(e,"__esModule",{value:!0})}),K=K.exports;var U=s.isObject,q=s.assign,Y=s.forEach,X=m.is,Z=i.createLine,J=p.isTypedEvent,Q=p.isThrowEvent,ee=p.isCollection,te=p.getDi,ne=p.getSemantic,ie=p.getCirclePath,re=p.getRoundRectPath,ae=p.getDiamondPath,oe=p.getRectPath,se=p.getFillColor,pe=p.getStrokeColor,le=K.query,ce=n.append,ue=n.attr,he=n.create,me=n.classes,fe=E.rotate,de=E.transform,ye=E.translate,ge=new $,ve=10,xe=3,be={fontFamily:"Arial, sans-serif",fontSize:12},Ee=.95,we=.35;function _e(e,t,n,i,r){b.call(this,e,r);var a=ge.next(),o=new V({style:be,size:{width:100}}),s={},p=t.computeStyle;function l(e,t){var n=q({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),r=t.ref||{x:0,y:0},a=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var o=he("marker");ue(t.element,n),ce(o,t.element),ue(o,{id:e,viewBox:"0 0 20 20",refX:r.x,refY:r.y,markerWidth:20*a,markerHeight:20*a,orient:"auto"});var p=le("defs",i._svg);p||(p=he("defs"),ce(i._svg,p)),ce(p,o),s[e]=o}function c(e,t,n){var i=e+"-"+t+"-"+n+"-"+a;return s[i]||function(e,t,n){var i=e+"-"+t+"-"+n+"-"+a;if("sequenceflow-end"===e){var r=he("path");ue(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),l(i,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:n,stroke:n}})}if("messageflow-start"===e){var o=he("circle");ue(o,{cx:6,cy:6,r:3.5}),l(i,{element:o,attrs:{fill:t,stroke:n},ref:{x:6,y:6}})}if("messageflow-end"===e){var s=he("path");ue(s,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),l(i,{element:s,attrs:{fill:t,stroke:n,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===e){var p=he("path");ue(p,{d:"M 11 5 L 1 10 L 11 15"}),l(i,{element:p,attrs:{fill:"none",stroke:n,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===e){var c=he("path");ue(c,{d:"M 1 5 L 11 10 L 1 15"}),l(i,{element:c,attrs:{fill:"none",stroke:n,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===e){var u=he("path");ue(u,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),l(i,{element:u,attrs:{fill:t,stroke:n},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===e){var h=he("path");ue(h,{d:"M 6 4 L 10 16"}),l(i,{element:h,attrs:{stroke:n},ref:{x:0,y:10},scale:.5})}}(e,t,n),"url(#"+i+")"}function u(e,t,n,i,r){U(i)&&(r=i,i=0),i=i||0,r=p(r,{stroke:"black",strokeWidth:2,fill:"white"});var a=t/2,o=n/2,s=he("circle");return ue(s,{cx:a,cy:o,r:Math.round((t+n)/4-i)}),ue(s,r),ce(e,s),s}function h(e,t,n,i,r,a){U(r)&&(a=r,r=0),r=r||0,a=p(a,{stroke:"black",strokeWidth:2,fill:"white"});var o=he("rect");return ue(o,{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i}),ue(o,a),ce(e,o),o}function m(e,t,n){n=p(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"});var i=Z(t,n);return ce(e,i),i}function f(e,t,n){n=p(n,["no-fill"],{strokeWidth:2,stroke:"black"});var i=he("path");return ue(i,{d:t}),ue(i,n),ce(e,i),i}function y(e,t,n,i){return f(t,n,q({"data-marker":e},i))}function g(e){return function(t,n){return S[e](t,n)}}function v(e){return S[e]}function x(e,t){var n=ne(e),i=Q(n);return J(n,"bpmn:MessageEventDefinition")?v("bpmn:MessageEventDefinition")(t,e,i):J(n,"bpmn:TimerEventDefinition")?v("bpmn:TimerEventDefinition")(t,e,i):J(n,"bpmn:ConditionalEventDefinition")?v("bpmn:ConditionalEventDefinition")(t,e):J(n,"bpmn:SignalEventDefinition")?v("bpmn:SignalEventDefinition")(t,e,i):J(n,"bpmn:CancelEventDefinition")&&J(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!1})?v("bpmn:MultipleEventDefinition")(t,e,i):J(n,"bpmn:CancelEventDefinition")&&J(n,"bpmn:TerminateEventDefinition",{parallelMultiple:!0})?v("bpmn:ParallelMultipleEventDefinition")(t,e,i):J(n,"bpmn:EscalationEventDefinition")?v("bpmn:EscalationEventDefinition")(t,e,i):J(n,"bpmn:LinkEventDefinition")?v("bpmn:LinkEventDefinition")(t,e,i):J(n,"bpmn:ErrorEventDefinition")?v("bpmn:ErrorEventDefinition")(t,e,i):J(n,"bpmn:CancelEventDefinition")?v("bpmn:CancelEventDefinition")(t,e,i):J(n,"bpmn:CompensateEventDefinition")?v("bpmn:CompensateEventDefinition")(t,e,i):J(n,"bpmn:TerminateEventDefinition")?v("bpmn:TerminateEventDefinition")(t,e,i):null}function E(e,t,n){var i=o.createText(t||"",n);return me(i).add("djs-label"),ce(e,i),i}function w(e,t,n){return E(e,ne(t).name,{box:t,align:n,padding:5,style:{fill:pe(t)}})}function _(e,t,n){var i=E(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:pe(n)}}),r=-1*n.height;de(i,0,-r,270)}function A(e){for(var t=e.waypoints,n="m "+t[0].x+","+t[0].y,i=1;i<t.length;i++)n+="L"+t[i].x+","+t[i].y+" ";return n}var S=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=Ee),u(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:se(t),stroke:pe(t)};ne(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round"});var i=v("bpmn:Event")(e,t,n);return x(t,e),i},"bpmn:MessageEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:i?pe(t):se(t),stroke:i?se(t):pe(t)})},"bpmn:TimerEventDefinition":function(e,t){var i=u(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:se(t),stroke:pe(t)});f(e,n.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),{strokeWidth:2,strokeLinecap:"square",stroke:pe(t)});for(var r=0;r<12;r++){var a=n.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.5}}),o=t.width/2;f(e,a,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*r+","+t.height/2+","+o+")",stroke:pe(t)})}return i},"bpmn:EscalationEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:ConditionalEventDefinition":function(e,t){return f(e,n.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:pe(t)})},"bpmn:LinkEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:ErrorEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.2,my:.722}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:CancelEventDefinition":function(e,t,i){var r=f(e,n.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{strokeWidth:1,fill:i?"black":"none"});return fe(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:SignalEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:i?pe(t):"none",stroke:pe(t)})},"bpmn:MultipleEventDefinition":function(e,t,i){return f(e,n.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:t.width,containerHeight:t.height,position:{mx:.222,my:.36}}),{strokeWidth:1,fill:i?"black":"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return f(e,n.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:t.width,containerHeight:t.height,position:{mx:.458,my:.194}}),{strokeWidth:1,fill:pe(t),stroke:pe(t)})},"bpmn:EndEvent":function(e,t){var n=v("bpmn:Event")(e,t,{strokeWidth:4,fill:se(t),stroke:pe(t)});return x(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return u(e,t.width,t.height,8,{strokeWidth:4,fill:pe(t),stroke:pe(t)})},"bpmn:IntermediateEvent":function(e,t){var n=v("bpmn:Event")(e,t,{strokeWidth:1,fill:se(t),stroke:pe(t)});return u(e,t.width,t.height,xe,{strokeWidth:1,fill:se(t,"none"),stroke:pe(t)}),x(t,e),n},"bpmn:IntermediateCatchEvent":g("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":g("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=Ee),h(e,t.width,t.height,ve,n)},"bpmn:Task":function(e,t){var n={fill:se(t),stroke:pe(t)},i=v("bpmn:Activity")(e,t,n);return w(e,t,"center-middle"),C(e,t),i},"bpmn:ServiceTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:se(t),stroke:pe(t)}),f(e,n.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:se(t)}),f(e,n.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:se(t),stroke:pe(t)}),i},"bpmn:UserTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:se(t),stroke:pe(t)}),f(e,n.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:se(t),stroke:pe(t)}),f(e,n.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:pe(t),stroke:pe(t)}),i},"bpmn:ManualTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:se(t),stroke:pe(t)}),i},"bpmn:SendTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:pe(t),stroke:se(t)}),i},"bpmn:ReceiveTask":function(e,t){var i,r=ne(t),a=v("bpmn:Task")(e,t);return r.instantiate?(u(e,28,28,4.4,{strokeWidth:1}),i=n.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):i=n.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),f(e,i,{strokeWidth:1,fill:se(t),stroke:pe(t)}),a},"bpmn:ScriptTask":function(e,t){var i=v("bpmn:Task")(e,t);return f(e,n.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:pe(t)}),i},"bpmn:BusinessRuleTask":function(e,t){var i=v("bpmn:Task")(e,t),r=f(e,n.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}}));ue(r,{strokeWidth:1,fill:se(t,"#aaaaaa"),stroke:pe(t)});var a=f(e,n.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}}));return ue(a,{strokeWidth:1,stroke:pe(t)}),i},"bpmn:SubProcess":function(e,t,n){n=q({fill:se(t),stroke:pe(t)},n);var i=v("bpmn:Activity")(e,t,n),r=d.isExpanded(t);return d.isEventSubProcess(t)&&ue(i,{strokeDasharray:"1,2"}),w(e,t,r?"center-top":"center-middle"),r?C(e,t):C(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return v("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,n){var i=v("bpmn:SubProcess")(e,n),r=t.style(["no-fill","no-events"],{stroke:pe(n)});return h(e,n.width,n.height,ve-2,xe,r),i},"bpmn:CallActivity":function(e,t){return v("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:Ee,fill:se(t),stroke:pe(t)},i=v("bpmn:Lane")(e,t,n);d.isExpanded(t)?(m(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:pe(t)}),_(e,ne(t).name,t)):E(e,ne(t).name,{box:t,align:"center-middle",style:{fill:pe(t)}});return!!ne(t).participantMultiplicity&&v("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=h(e,t.width,t.height,0,q({fill:se(t),fillOpacity:we,stroke:pe(t)},n)),r=ne(t);"bpmn:Lane"===r.$type&&_(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=v("bpmn:Gateway")(e,t);return u(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:se(t),stroke:pe(t)}),n},"bpmn:ExclusiveGateway":function(e,t){var i=v("bpmn:Gateway")(e,t),r=n.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return te(t).isMarkerVisible&&f(e,r,{strokeWidth:1,fill:pe(t),stroke:pe(t)}),i},"bpmn:ComplexGateway":function(e,t){var i=v("bpmn:Gateway")(e,t);return f(e,n.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:pe(t),stroke:pe(t)}),i},"bpmn:ParallelGateway":function(e,t){var i=v("bpmn:Gateway")(e,t);return f(e,n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:pe(t),stroke:pe(t)}),i},"bpmn:EventBasedGateway":function(e,t){var i=ne(t),r=v("bpmn:Gateway")(e,t);u(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:pe(t)});var a=i.eventGatewayType,o=!!i.instantiate;if("Parallel"===a){var s=n.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),p=f(e,s);ue(p,{strokeWidth:1,fill:"none"})}else if("Exclusive"===a){if(!o){var l=u(e,t.width,t.height,.26*t.height);ue(l,{strokeWidth:1,fill:"none",stroke:pe(t)})}!function(){var i=n.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:se(t,"none"),stroke:pe(t)};f(e,i,r)}()}return r},"bpmn:Gateway":function(e,t){var n={fill:se(t),fillOpacity:Ee,stroke:pe(t)};return function(e,t,n,i){var r=t/2,a=n/2,o=[{x:r,y:0},{x:t,y:a},{x:r,y:n},{x:0,y:a}].map(function(e){return e.x+","+e.y}).join(" ");i=p(i,{stroke:"black",strokeWidth:2,fill:"white"});var s=he("polygon");return ue(s,{points:o}),ue(s,i),ce(e,s),s}(e,t.width,t.height,n)},"bpmn:SequenceFlow":function(e,t){var n,i=A(t),r=se(t),a=pe(t),o=f(e,i,{strokeLinejoin:"round",markerEnd:c("sequenceflow-end",r,a),stroke:pe(t)}),s=ne(t);return t.source&&(n=t.source.businessObject,s.conditionExpression&&n.$instanceOf("bpmn:Activity")&&ue(o,{markerStart:c("conditional-flow-marker",r,a)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===s&&ue(o,{markerStart:c("conditional-default-flow-marker",r,a)})),o},"bpmn:Association":function(e,t,n){var i=ne(t),r=se(t),a=pe(t);return n=q({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:pe(t)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=c("association-end",r,a)),"Both"===i.associationDirection&&(n.markerStart=c("association-start",r,a)),m(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=se(t),i=pe(t);return v("bpmn:Association")(e,t,{markerEnd:c("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=se(t),i=pe(t);return v("bpmn:Association")(e,t,{markerEnd:c("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var i=ne(t),r=te(t),a=se(t),o=pe(t),s=f(e,A(t),{markerEnd:c("messageflow-end",a,o),markerStart:c("messageflow-start",a,o),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:pe(t)});if(i.messageRef){var p=s.getPointAtLength(s.getTotalLength()/2),l=n.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:p.x,y:p.y}}),u={strokeWidth:1};"initiating"===r.messageVisibleKind?(u.fill="white",u.stroke="black"):(u.fill="#888",u.stroke="white"),f(e,l,u)}return s},"bpmn:DataObject":function(e,t){var i=f(e,n.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:se(t),fillOpacity:Ee,stroke:pe(t)}),r=ne(t);return ee(r)&&function(e,t){var i=(t.height-16)/t.height,r=n.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.451,my:i}});f(e,r,{strokeWidth:2})}(e,t),i},"bpmn:DataObjectReference":g("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var i=n.getRawPath("DATA_ARROW"),r=v("bpmn:DataObject")(e,t);return f(e,i,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var i=n.getRawPath("DATA_ARROW"),r=v("bpmn:DataObject")(e,t);return f(e,i,{strokeWidth:1,fill:"black"}),r},"bpmn:DataStoreReference":function(e,t){return f(e,n.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:se(t),fillOpacity:Ee,stroke:pe(t)})},"bpmn:BoundaryEvent":function(e,t){var n=ne(t).cancelActivity,i={strokeWidth:1,fill:se(t),stroke:pe(t),fillOpacity:1};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=v("bpmn:Event")(e,t,i);return u(e,t.width,t.height,xe,q(i,{fill:"none"})),x(t,e),r},"bpmn:Group":function(e,t){return h(e,t.width,t.height,ve,{strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(e,t){return function(e,t){var n=ne(t),i={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return E(e,n.name,{box:i,fitBox:!0,style:{fontSize:"11px"}})}(e,t)},"bpmn:TextAnnotation":function(e,t){var i=h(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return f(e,n.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:pe(t)}),E(e,ne(t).text||"",{box:t,align:"left-top",padding:5}),i},ParticipantMultiplicityMarker:function(e,t){y("participant-multiplicity",e,n.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:t.width/2/t.width,my:(t.height-15)/t.height}}))},SubProcessMarker:function(e,t){var i=h(e,14,14,0,{strokeWidth:1,fill:se(t),stroke:pe(t)});ye(i,t.width/2-7.5,t.height-20),y("sub-process",e,n.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:se(t),stroke:pe(t)})},ParallelMarker:function(e,t,i){y("parallel",e,n.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.parallel)/t.width,my:(t.height-20)/t.height}}))},SequentialMarker:function(e,t,i){y("sequential",e,n.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.seq)/t.width,my:(t.height-19)/t.height}}))},CompensationMarker:function(e,t,i){y("compensation",e,n.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1})},LoopMarker:function(e,t,i){y("loop",e,n.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.loop)/t.width,my:(t.height-7)/t.height}}),{strokeWidth:1,fill:"none",strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,i){y("adhoc",e,n.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+i.adhoc)/t.width,my:(t.height-15)/t.height}}),{strokeWidth:1,fill:"black"})}};function C(e,t,n){var i,r=ne(t),a=n&&-1!==n.indexOf("SubProcessMarker");i=a?{seq:-21,parallel:-22,compensation:-42,loop:-18,adhoc:10}:{seq:-3,parallel:-6,compensation:-27,loop:0,adhoc:10},Y(n,function(n){v(n)(e,t,i)}),r.isForCompensation&&v("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&v("AdhocMarker")(e,t,i);var o=r.loopCharacteristics,s=o&&o.isSequential;o&&(void 0===s&&v("LoopMarker")(e,t,i),!1===s&&v("ParallelMarker")(e,t,i),!0===s&&v("SequentialMarker")(e,t,i))}this._drawPath=f}H(_e,b),_e.$inject=["eventBus","styles","pathMap","canvas"];var Ae=_e;_e.prototype.canRender=function(e){return X(e,"bpmn:BaseElement")},_e.prototype.drawShape=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},_e.prototype.drawConnection=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},_e.prototype.getShapePath=function(e){return X(e,"bpmn:Event")?ie(e):X(e,"bpmn:Activity")?re(e,ve):X(e,"bpmn:Gateway")?ae(e):oe(e)};var Se=function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m {mx}, {my} m 0 15 l 0 -15 m 4 15 l 0 -15 m 4 15 l 0 -15 ",height:61,width:51,heightElements:[12],widthElements:[1,6,12,15]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var a,o,s={};if(t.position){for(var p=t.containerHeight/r.height*t.yScaleFactor,l=t.containerWidth/r.width*t.xScaleFactor,c=0;c<r.heightElements.length;c++)s["y"+c]=r.heightElements[c]*p;for(var u=0;u<r.widthElements.length;u++)s["x"+u]=r.widthElements[u]*l}return a=r.d,o={mx:n,my:i,e:s},String(a).replace(Ce,function(e,t){return function(e,t,n){var i=n;return t.replace(Re,function(e,t,n,r,a){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&a&&(i=i()))}),i=(null==i||i==n?e:i)+""}(e,t,o)})}},Ce=/\{([^}]+)\}/g,Re=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var Me={__init__:["bpmnRenderer"],bpmnRenderer:["type",Ae],pathMap:["type",Se]},ke={elementToString:function(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}},Pe={},Te=s.assign,Ne=m.is,De={width:90,height:20},Oe=15;function Be(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=Le(e),a=Math.atan((i.y-n.y)/(i.x-n.x)),o=r.x,s=r.y;return Math.abs(a)<Math.PI/2?s-=Oe:o+=Oe,{x:o,y:s}}function Le(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}function Ie(e){return e.waypoints?Be(e.waypoints):{x:e.x+e.width/2,y:e.y+e.height+De.height/2}}Pe.hasExternalLabel=function(e){return Ne(e,"bpmn:Event")||Ne(e,"bpmn:Gateway")||Ne(e,"bpmn:DataStoreReference")||Ne(e,"bpmn:DataObjectReference")||Ne(e,"bpmn:SequenceFlow")||Ne(e,"bpmn:MessageFlow")},Pe.getExternalLabelBounds=function(e,t){var n,i,r,a=e.di.label;return a&&a.bounds?(r=a.bounds,i={width:Math.max(De.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=Ie(t),i=De),Te({x:n.x-i.width/2,y:n.y-i.height/2},i)};var je=s.assign,Fe=s.map,Ve=m.is,We=Pe.hasExternalLabel,ze=Pe.getExternalLabelBounds,Ge=d.isExpanded,$e=ke.elementToString;function He(e,t){return je({id:e.id,type:e.$type,businessObject:e},t)}function Ke(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:$e(n),referenced:$e(t),property:i}))}function Ue(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textUtil=new V}Ue.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate"];var qe=Ue;Ue.prototype.add=function(e,t){var n,i,r,a,o=e.di,s=this._translate;if(Ve(o,"bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(He(e)),this._canvas.setRootElement(n);else if(Ve(o,"bpmndi:BPMNShape")){var p=!Ge(e);i=t&&(t.hidden||t.collapsed);var l=e.di.bounds;n=this._elementFactory.createShape(He(e,{collapsed:p,hidden:i,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height)})),Ve(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,n),Ve(e,"bpmn:Lane")&&(r=0),this._canvas.addShape(n,t,r)}else{if(!Ve(o,"bpmndi:BPMNEdge"))throw new Error(s("unknown di {di} for element {semantic}",{di:$e(o),semantic:$e(e)}));var c=this._getSource(e),u=this._getTarget(e);i=t&&(t.hidden||t.collapsed),n=this._elementFactory.createConnection(He(e,{hidden:i,source:c,target:u,waypoints:(a=e.di.waypoint,Fe(a,function(e){return{x:e.x,y:e.y}}))})),Ve(e,"bpmn:DataAssociation")&&(t=null),Ve(e,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,t,r)}return We(e)&&this.addLabel(e,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},Ue.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:$e(e)}));var r=this._elementRegistry.get(i.id),a=r&&r.attachers;if(!r)throw Ke(n,e,i,"attachedToRef");t.host=r,a||(r.attachers=a=[]),-1===a.indexOf(t)&&a.push(t)},Ue.prototype.addLabel=function(e,t){var n,i,r;return n=ze(e,t),(i=e.name)&&(n=function(e,t,n){var i=n.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:Ye});return{x:Math.round(e.x+e.width/2-i.width/2),y:Math.round(e.y),width:Math.ceil(i.width),height:Math.ceil(i.height)}}(n,i,this._textUtil)),r=this._elementFactory.createLabel(He(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden||!e.name,x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,t.parent)},Ue.prototype._getEnd=function(e,t){var n,i,r=e.$type,a=this._translate;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?Ke(a,e,i,t+"Ref"):new Error(a("{semantic}#{side} Ref not specified",{semantic:$e(e),side:t}))},Ue.prototype._getSource=function(e){return this._getEnd(e,"source")},Ue.prototype._getTarget=function(e){return this._getEnd(e,"target")},Ue.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Ye={fontFamily:"Arial, sans-serif",fontSize:"11px"};var Xe={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||"{"+n+"}"})}]},Ze={__depends__:[Me,{__depends__:[Xe],bpmnImporter:["type",qe]}]},Je={};function Qe(e,t,n){Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:Je.extend(n[t.name]||[],e,t,n)})}function et(e,t){if(!(this instanceof et))return new et(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Je.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},Je.isExtended=function(e){return!0===e.__refs_collection},et.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?Qe(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 a=r;r=null,a&&e.unset(a,i,n),r=t,e.set(r,i,n)}}})}(this,t,e)},et.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Je.isExtended(n)||Qe(this,t,e),n},et.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},et.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},et.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var tt={};(tt=et).Collection=Je;var nt=s.filter,it=s.find,rt=s.forEach,at=ke.elementToString,ot=new tt({name:"bpmnElement",enumerable:!0},{name:"di"});function st(e,t){return e.$instanceOf(t)}var pt=function(e,t){var n={},i=[];function r(e,t){return function(n){e(n,t)}}function a(e){n[e.id]=e}function o(n,i){try{var r=n.di&&function(n,i){if(n.gfx)throw new Error(t("already rendered {element}",{element:at(n)}));return e.element(n,i)}(n,i);return a(n),r}catch(e){s(e.message,{element:n,error:e}),console.error(t("failed to import {element}",{element:at(n)})),console.error(e)}}function s(t,n){e.error(t,n)}function p(e){var n=e.bpmnElement;n?n.di?s(t("multiple DI elements defined for {element}",{element:at(n)}),{element:n}):(ot.bind(n,"di"),n.di=e):s(t("no bpmnElement referenced in {element}",{element:at(e)}),{element:e})}function l(e){var t;p(t=e.plane),rt(t.planeElement,c)}function c(e){p(e)}function u(e,t){_(e,t),v(e.ioSpecification,t),g(e.artifacts,t),a(e)}function h(e,t){o(e,t)}function m(e,t){o(e,t)}function f(e,t){o(e,t)}function d(e,t){o(e,t)}function y(e,t){o(e,t)}function g(e,t){rt(e,function(e){st(e,"bpmn:Association")?i.push(function(){y(e,t)}):y(e,t)})}function v(e,t){e&&(rt(e.dataInputs,r(f,t)),rt(e.dataOutputs,r(d,t)))}function x(e,t){var n=o(e,t);st(e,"bpmn:SubProcess")&&function(e,t){_(e,t),g(e.artifacts,t)}(e,n||t),st(e,"bpmn:Activity")&&v(e.ioSpecification,t),i.push(function(){rt(e.dataInputAssociations,r(m,t)),rt(e.dataOutputAssociations,r(m,t))})}function b(e,t){o(e,t)}function E(e,t){i.push(function(){var n=o(e,t);e.childLaneSet&&w(e.childLaneSet,n||t),function(e){rt(e.flowNodeRef,function(t){var n=t.get("lanes");n&&n.push(e)})}(e)})}function w(e,t){rt(e.lanes,r(E,t))}function _(e,n){!function(e,n){rt(e,function(e){st(e,"bpmn:SequenceFlow")?i.push(function(){!function(e,t){o(e,t)}(e,n)}):st(e,"bpmn:BoundaryEvent")?i.unshift(function(){!function(e,t){o(e,t)}(e,n)}):st(e,"bpmn:FlowNode")?x(e,n):st(e,"bpmn:DataObject")||(st(e,"bpmn:DataStoreReference")?b(e,n):st(e,"bpmn:DataObjectReference")?b(e,n):s(t("unrecognized flowElement {element} in context {context}",{element:at(e),context:n?at(n.businessObject):"null"}),{element:e,context:n}))})}(e.flowElements,n),e.laneSets&&function(e,t){rt(e,r(w,t))}(e.laneSets,n)}function A(e,t){var n=o(e,t),i=e.processRef;i&&u(i,n||t)}return{handleDefinitions:function(a,o){var c=a.diagrams;if(o&&-1===c.indexOf(o))throw new Error(t("diagram not part of bpmn:Definitions"));if(!o&&c&&c.length&&(o=c[0]),!o)throw new Error(t("no diagram to display"));l(o);var m=o.plane;if(!m)throw new Error(t("no plane for {element}",{element:at(o)}));var f=m.bpmnElement;if(!f){if(!(f=function(e){return it(e.rootElements,function(e){return st(e,"bpmn:Process")||st(e,"bpmn:Collaboration")})}(a)))throw new Error(t("no process or collaboration to display"));s(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:at(m),rootElement:at(f)})),m.bpmnElement=f,p(m)}var d,y,v=function(t,n){return e.root(t,n)}(f,m);if(st(f,"bpmn:Process"))u(f,v);else{if(!st(f,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:at(m),rootElement:at(f)}));rt((y=f).participants,r(A)),g(y.artifacts),i.push(function(){var e,t;e=y.messageFlows,rt(e,r(h,t))}),d=a.rootElements,nt(d,function(e){return!n[e.id]&&st(e,"bpmn:Process")&&e.laneSets}).forEach(r(u))}!function(e){for(;e.length;)e.shift()()}(i)}}},lt={};lt.importBpmnDiagram=function(e,t,n){var i,r,a,o,s=[];try{i=e.get("bpmnImporter"),r=e.get("eventBus"),a=e.get("translate"),r.fire("import.render.start",{definitions:t}),function(e){new pt({root:function(e){return i.add(e)},element:function(e,t){return i.add(e,t)},error:function(e,t){s.push({message:e,context:t})}},a).handleDefinitions(e)}(t),r.fire("import.render.complete",{error:o,warnings:s})}catch(e){o=e}n(o,s)};var ct={},ut=K.domify,ht=K.delegate,mt='<img width="52" height="52" src="'+("data:image/svg+xml,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 960"><path fill="#fff" d="M960 60v839c0 33-27 61-60 61H60c-33 0-60-27-60-60V60C0 27 27 0 60 0h839c34 0 61 27 61 60z"/><path fill="#52b415" d="M217 548a205 205 0 0 0-144 58 202 202 0 0 0-4 286 202 202 0 0 0 285 3 200 200 0 0 0 48-219 203 203 0 0 0-185-128zM752 6a206 206 0 0 0-192 285 206 206 0 0 0 269 111 207 207 0 0 0 111-260A204 204 0 0 0 752 6zM62 0A62 62 0 0 0 0 62v398l60 46a259 259 0 0 1 89-36c5-28 10-57 14-85l99 2 12 85a246 246 0 0 1 88 38l70-52 69 71-52 68c17 30 29 58 35 90l86 14-2 100-86 12a240 240 0 0 1-38 89l43 58h413c37 0 60-27 60-61V407a220 220 0 0 1-44 40l21 85-93 39-45-76a258 258 0 0 1-98 1l-45 76-94-39 22-85a298 298 0 0 1-70-69l-86 22-38-94 76-45a258 258 0 0 1-1-98l-76-45 40-94 85 22a271 271 0 0 1 41-47z"/></svg>'))+'" />';function ft(e){return e.join(";")}var dt,yt='<div class="bjs-powered-by-lightbox" style="'+ft(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+ft(["width: 100%","height: 100%","background: rgba(0,0,0,0.2)"])+'"></div><div class="notice" style="'+ft(["position: absolute","left: 50%","top: 40%","margin: 0 -130px","width: 260px","padding: 10px","background: white","border: solid 1px #AAA","border-radius: 3px","font-family: Helvetica, Arial, sans-serif","font-size: 14px","line-height: 1.2em"])+'"><a href="http://bpmn.io" target="_blank" style="float: left; margin-right: 10px">'+mt+'</a>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="http://bpmn.io" target="_blank">bpmn.io</a>.</div></div>';ct.open=function(){dt||(dt=ut(yt),ht.bind(dt,".backdrop","click",function(e){document.body.removeChild(dt)})),document.body.appendChild(dt)},ct.BPMNIO_IMG=mt;var gt={};gt.hasLowerCaseAlias=function(e){return e.xml&&"lowerCase"===e.xml.tagAlias},gt.DEFAULT_NS_MAP={xsi:"http://www.w3.org/2001/XMLSchema-instance"};var vt=gt.XSI_TYPE="xsi:type";function xt(e){return e.xml&&e.xml.serialize}function bt(){}gt.serializeAsType=function(e){return xt(e)===vt},gt.serializeAsProperty=function(e){return"property"===xt(e)},bt.prototype.get=function(e){return this.$model.properties.get(this,e)},bt.prototype.set=function(e,t){this.$model.properties.set(this,e,t)};var Et=bt,wt=s.forEach,_t=s.bind;function At(e,t){this.model=e,this.properties=t}var St=At;At.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(Et.prototype);wt(e.properties,function(e){e.isMany||void 0===e.default||(i[e.name]=e.default)}),n.defineModel(i,t),n.defineDescriptor(i,e);var r=e.ns.name;function a(e){n.define(this,"$type",{value:r,enumerable:!0}),n.define(this,"$attrs",{value:{}}),n.define(this,"$parent",{writable:!0}),wt(e,_t(function(e,t){this.set(t,e)},this))}return a.prototype=i,a.hasType=i.$instanceOf=this.model.hasType,n.defineModel(a,t),n.defineDescriptor(a,e),a};var Ct={};function Rt(e){this.model=e}Ct.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 <prefix:localName> or <localName>, got "+e);n=r[1],i=r[0]}return{name:e=(i?i+":":"")+n,prefix:i,localName:n}};var Mt=Rt;function kt(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}Rt.prototype.set=function(e,t,n){var i=this.model.getPropertyDescriptor(e,t),r=i&&i.name;void 0===n?i?delete e[r]:delete e.$attrs[t]:i?r in e?e[r]=n:kt(e,i,n):e.$attrs[t]=n},Rt.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&&kt(e,n,[]),e[i]},Rt.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},Rt.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Rt.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})};var Pt=s.pick,Tt=s.assign,Nt=s.forEach,Dt=s.bind,Ot=Ct.parseName;function Bt(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}var Lt=Bt;Bt.prototype.build=function(){return Pt(this,["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"])},Bt.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)},Bt.prototype.replaceProperty=function(e,t,n){var i=e.ns,r=this.properties,a=this.propertiesByName,o=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,o),a[i.name]=a[i.localName]=t},Bt.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),a=Ot(r[0],i),o=Ot(r[1],a.prefix).name,s=this.propertiesByName[o];if(!s)throw new Error("refined property <"+o+"> not found");this.replaceProperty(s,e,n),delete e.redefines},Bt.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},Bt.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Bt.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},Bt.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},Bt.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")},Bt.prototype.hasProperty=function(e){return this.propertiesByName[e]},Bt.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(Nt(e.properties,Dt(function(n){n=Tt({},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 It={},jt={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Ft={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)}};It.coerceType=function(e,t){var n=Ft[e];return n?n(t):t},It.isBuiltIn=function(e){return!!jt[e]},It.isSimple=function(e){return!!Ft[e]};var Vt=s.assign,Wt=s.forEach,zt=s.bind,Gt=Ct.parseName,$t=It.isBuiltIn;function Ht(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,Wt(e,zt(this.registerPackage,this))}var Kt=Ht;function Ut(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}Ht.prototype.getPackage=function(e){return this.packageMap[e]},Ht.prototype.getPackages=function(){return this.packages},Ht.prototype.registerPackage=function(e){e=Vt({},e);var t=this.packageMap;Ut(t,e,"prefix"),Ut(t,e,"uri"),Wt(e.types,zt(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Ht.prototype.registerType=function(e,t){e=Vt({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:Vt(e.meta||{})});var n=Gt(e.name,t.prefix),i=n.name,r={};Wt(e.properties,zt(function(e){var t=Gt(e.name,n.prefix),i=t.name;$t(e.type)||(e.type=Gt(e.type,t.prefix).name),Vt(e,{ns:t,name:i}),r[i]=e},this)),Vt(e,{ns:n,name:i,propertiesByName:r}),Wt(e.extends,zt(function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},Ht.prototype.mapTypes=function(e,t,n){var i=$t(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function a(e){return o(e,!0)}function o(n,i){var a=Gt(n,$t(n)?"":e.prefix);r.mapTypes(a,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");Wt(i.superClass,n?a:o),t(i,!n),Wt(i.traits,a)},Ht.prototype.getEffectiveDescriptor=function(e){var t=Gt(e),n=new Lt(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},Ht.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})};var qt=s.isString,Yt=s.isObject,Xt=s.forEach,Zt=Ct.parseName;function Jt(e){this.properties=new Mt(this),this.factory=new St(this,this.properties),this.registry=new Kt(e,this.properties),this.typeCache={}}var Qt=Jt;Jt.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Jt.prototype.getType=function(e){var t=this.typeCache,n=qt(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Jt.prototype.createAny=function(e,t,n){var i=Zt(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},a={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,a),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),Xt(n,function(e,t){Yt(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e}),r},Jt.prototype.getPackage=function(e){return this.registry.getPackage(e)},Jt.prototype.getPackages=function(){return this.registry.getPackages()},Jt.prototype.getElementDescriptor=function(e){return e.$descriptor},Jt.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Jt.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Jt.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var en=Qt,tn={exports:{}};!function(e,t){"object"==typeof tn.exports?t(tn.exports):t(e.Saxen={})}(this,function(e){"use strict";var t=String.fromCharCode,n=Object.prototype.hasOwnProperty,i=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,r={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function a(e,i,a,o){return o?n.call(r,o)?r[o]:"&"+o+";":t(i||parseInt(a,16))}function o(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(i,a):e}Object.keys(r).forEach(function(e){r[e.toUpperCase()]=r[e]});var s="http://www.w3.org/2001/XMLSchema-instance",p="xsi",l="xsi:type";function c(e){return new Error(e)}function u(e){return"missing namespace for prefix <"+e+">"}function h(e){return{get:e,enumerable:!0}}function m(e){var t,n={};for(t in e)n[t]=e[t];return n}function f(e){return e+"$uri"}function d(){return{line:0,column:0}}function y(e){throw e}e.Parser=function e(t){if(!this)return new e(t);var n,i,r,a,g,v,x,b,E,w=t&&t.proxy,_=y,A=d,S=!1,C=!1,R=null,M=!1;function k(e){e instanceof Error||(e=c(e)),R=e,_(e,A)}function P(e){g&&(e instanceof Error||(e=c(e)),g(e,A))}this.on=function(e,t){if("function"!=typeof t)throw c("required args <name, cb>");switch(e){case"openTag":i=t;break;case"text":n=t;break;case"closeTag":r=t;break;case"error":_=t;break;case"warn":g=t;break;case"cdata":a=t;break;case"attention":b=t;break;case"question":x=t;break;case"comment":v=t;break;default:throw c("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw c("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n[s]=p,C=!0,E=n,this},this.parse=function(e){if("string"!=typeof e)throw c("required args <xml=string>");return R=null,function(e){var t,s,p,c,d,y,g,_,R,T,N=C?[]:null,D=C?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[f(n)]=t;return i}(E):null,O=[],B=0,L=!1,I=!1,j=0,F=0,V="",W=0;function z(){if(null!==T)return T;var e,t,n,i,r,a,s,p,c,h,d,y=C&&D.xmlns,g=C&&S?[]:null,v=W,x=V,b=x.length,w={},_={};e:for(;v<b;v++)if(c=!1,!(32===(h=x.charCodeAt(v))||h<14&&h>8)){for((h<65||h>122||h>90&&h<97)&&95!==h&&58!==h&&(P("illegal first char attribute name"),c=!0),d=v+1;d<b;d++)if(!((h=x.charCodeAt(d))>96&&h<123||h>64&&h<91||h>47&&h<59||46===h||45===h||95===h)){if(32===h||h<14&&h>8){P("missing attribute value"),v=d;continue e}if(61===h)break;P("illegal attribute name char"),c=!0}if("xmlns:xmlns"===(p=x.substring(v,d))&&(P("illegal declaration of xmlns"),c=!0),34===(h=x.charCodeAt(d+1)))-1===(d=x.indexOf('"',v=d+2))&&-1!==(d=x.indexOf("'",v))&&(P("attribute value quote missmatch"),c=!0);else if(39===h)-1===(d=x.indexOf("'",v=d+2))&&-1!==(d=x.indexOf('"',v))&&(P("attribute value quote missmatch"),c=!0);else for(P("missing attribute value quotes"),c=!0,d+=1;d<b&&!(32===(h=x.charCodeAt(d+1))||h<14&&h>8);d++);for(-1===d&&(P("missing closing quotes"),d=b,c=!0),c||(a=x.substring(v,d)),v=d;d+1<b&&!(32===(h=x.charCodeAt(d+1))||h<14&&h>8);d++)v===d&&(P("illegal character after attribute end"),c=!0);if(v=d+1,!c)if(p in _)P("attribute <"+p+"> already defined");else if(_[p]=!0,C)if(S){if(null!==(r="xmlns"===p?"xmlns":120===p.charCodeAt(0)&&"xmlns:"===p.substr(0,6)?p.substr(6):null)){if(e=o(a),t=f(r),!(s=E[e])){if("xmlns"===r||t in D&&D[t]!==e)do{s="ns"+B++}while(void 0!==D[s]);else s=r;E[e]=s}D[r]!==s&&(i||(D=m(D),i=!0),D[r]=s,"xmlns"===r&&(D[f(s)]=e,y=s),D[t]=e),w[p]=a;continue}g.push(p,a)}else-1!==(h=p.indexOf(":"))?(n=D[p.substring(0,h)])?((p=y===n?p.substr(h+1):n+p.substr(h))===l&&(-1!==(h=a.indexOf(":"))?(n=a.substring(0,h),n=D[n]||n,a=n+a.substring(h)):a=y+":"+a),w[p]=a):P(u(p.substring(0,h))):w[p]=a;else w[p]=a}if(S)for(v=0,b=g.length;v<b;v++){if(p=g[v++],a=g[v],-1!==(h=p.indexOf(":"))){if(!(n=D[p.substring(0,h)])){P(u(p.substring(0,h)));continue}(p=y===n?p.substr(h+1):n+p.substr(h))===l&&(-1!==(h=a.indexOf(":"))?(n=a.substring(0,h),n=D[n]||n,a=n+a.substring(h)):a=y+":"+a)}w[p]=a}return T=w}for(A=function(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,a=0,o=0,s=F;j>=o&&(t=i.exec(e))&&!((s=t[0].length+t.index)>j);)r+=1,o=s;return-1==j?(a=s,n=""):(a=j-o,n=-1==F?e.substring(j):e.substring(j,F+1)),{data:n,line:r,column:a}},w&&(R=Object.create({},{name:h(function(){return g}),originalName:h(function(){return _}),attrs:h(z),ns:h(function(){return D})}));-1!==F;){if(-1===(j=60===e.charCodeAt(F)?F:e.indexOf("<",F)))return O.length?k("unexpected end of file"):0===F?k("missing start tag"):void 0;if(F!==j&&n&&(n(e.substring(F,j),o,A),M))return;if(33!==(d=e.charCodeAt(j+1)))if(63!==d){if(-1==(F=e.indexOf(">",j+1)))return k("unclosed tag");if(T={},47===d){if(L=!1,I=!0,!O.length)return k("missing open tag");if(s=g=O.pop(),c=j+2+s.length,e.substring(j+2,c)!==s)return k("closing tag mismatch");for(;c<F;c++)if(!(32===(d=e.charCodeAt(c))||d>8&&d<14))return k("close tag")}else{if(47===e.charCodeAt(F-1)?(s=g=e.substring(j+1,F-1),L=!0,I=!0):(s=g=e.substring(j+1,F),L=!0,I=!1),!(d>96&&d<123||d>64&&d<91||95===d||58===d))return k("illegal first char nodeName");for(c=1,p=s.length;c<p;c++)if(!((d=s.charCodeAt(c))>96&&d<123||d>64&&d<91||d>47&&d<59||45===d||95===d)){if(32===d||d<14&&d>8){g=s.substring(0,c),T=null;break}return k("invalid nodeName")}I||O.push(g)}if(C){if(t=D,L&&(I||N.push(t),null===T&&(S=-1!==s.indexOf("xmlns",c))&&(W=c,V=s,z(),S=!1)),_=g,-1!==(d=g.indexOf(":"))){if(!(y=D[g.substring(0,d)]))return k("missing namespace on <"+_+">");g=g.substr(d+1)}else y=D.xmlns;y&&(g=y+":"+g)}if(L&&(W=c,V=s,i&&(w?i(R,o,I,A):i(g,z,o,I,A),M)))return;if(I){if(r&&(r(w?R:g,o,L,A),M))return;C&&(D=L?t:N.pop())}F+=1}else{if(-1===(F=e.indexOf("?>",j)))return k("unclosed question");if(x&&(x(e.substring(j,F+2),A),M))return;F+=2}else{if(91===(d=e.charCodeAt(j+2))&&"CDATA["===e.substr(j+3,6)){if(-1===(F=e.indexOf("]]>",j)))return k("unclosed cdata");if(a&&(a(e.substring(j+9,F),A),M))return;F+=3;continue}if(45===d&&45===e.charCodeAt(j+3)){if(-1===(F=e.indexOf("--\x3e",j)))return k("unclosed comment");if(v&&(v(e.substring(j+4,F),o,A),M))return;F+=3;continue}if(-1===(F=e.indexOf(">",j+1)))return k("unclosed tag");if(b&&(b(e.substring(j,F+1),o,A),M))return;F+=1}}}(e),A=d,M=!1,R},this.stop=function(){M=!0}},Object.defineProperty(e,"__esModule",{value:!0})}),tn=tn.exports;var nn={};!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!==nn?nn=n:e.stack=n}(this);var rn={},an=s.forEach,on=s.find,sn=s.assign,pn=tn.Parser,ln=Ct.parseName,cn=It.coerceType,un=It.isSimple,hn=gt.XSI_TYPE,mn=gt.serializeAsType,fn=gt.hasLowerCaseAlias;function dn(e,t){return fn(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function yn(e){return new Error(e)}function gn(e){return e.$descriptor}function vn(){}function xn(){}function bn(){}function En(e,t){this.property=e,this.context=t}function wn(e,t){this.element=t,this.propertyDesc=e}function _n(){}function An(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function Sn(e,t,n){An.call(this,e,t,n)}function Cn(e,t,n){this.model=e,this.context=n}function Rn(e){e instanceof en&&(e={model:e}),sn(this,{lax:!1},e)}vn.prototype.handleEnd=function(){},vn.prototype.handleText=function(){},vn.prototype.handleNode=function(){},xn.prototype=Object.create(vn.prototype),xn.prototype.handleNode=function(){return this},bn.prototype=Object.create(vn.prototype),bn.prototype.handleText=function(e){this.body=(this.body||"")+e},En.prototype=Object.create(bn.prototype),En.prototype.handleNode=function(e){if(this.element)throw yn("expected no sub nodes");return this.element=this.createReference(e),this},En.prototype.handleEnd=function(){this.element.id=this.body},En.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},wn.prototype=Object.create(bn.prototype),wn.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=cn(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},_n.prototype=Object.create(bn.prototype),_n.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},An.prototype=Object.create(_n.prototype),An.prototype.addReference=function(e){this.context.addReference(e)},An.prototype.handleEnd=function(){var e=this.body,t=this.element,n=gn(t).bodyProperty;n&&void 0!==e&&(e=cn(n.type,e),t.set(n.name,e))},An.prototype.createElement=function(e){var t=e.attributes,n=this.type,i=gn(n),r=this.context,a=new n({});return an(t,function(e,t){var n,o=i.propertiesByName[t];o&&o.isReference?o.isMany?(n=e.split(" "),an(n,function(e){r.addReference({element:a,property:o.ns.name,id:e})})):r.addReference({element:a,property:o.ns.name,id:e}):(o&&(e=cn(o.type,e)),a.set(t,e))}),a},An.prototype.getPropertyForNode=function(e){var t,n,i=e.name,r=ln(i),a=this.type,o=this.model,s=gn(a),p=r.name,l=s.propertiesByName[p];if(l)return mn(l)&&(t=e.attributes[hn])?(t=function(e,t){var n=ln(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,o),n=o.getType(t),sn({},l,{effectiveType:gn(n).name})):l;var c=o.getPackage(r.prefix);if(c){if(t=dn(r,c),n=o.getType(t),l=on(s.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return sn({},l,{effectiveType:gn(n).name})}else if(l=on(s.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return l;throw yn("unrecognized element <"+r.name+">")},An.prototype.toString=function(){return"ElementDescriptor["+gn(this.type).name+"]"},An.prototype.valueHandler=function(e,t){return new wn(e,t)},An.prototype.referenceHandler=function(e){return new En(e,this.context)},An.prototype.handler=function(e){return"Element"===e?new Cn(this.model,e,this.context):new An(this.model,e,this.context)},An.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,n=t.effectiveType||t.type,un(n))return this.valueHandler(t,i);var a=(r=t.isReference?this.referenceHandler(t).handleNode(e):this.handler(n).handleNode(e)).element;return void 0!==a&&(t.isMany?i.get(t.name).push(a):i.set(t.name,a),t.isReference?(sn(a,{element:i}),this.context.addReference(a)):a.$parent=i),r},Sn.prototype=Object.create(An.prototype),Sn.prototype.createElement=function(e){var t=e.name,n=ln(t),i=this.model,r=this.type,a=i.getPackage(n.prefix),o=a&&dn(n,a)||t;if(!r.hasType(o))throw yn("unexpected element <"+e.originalName+">");return An.prototype.createElement.call(this,e)},Cn.prototype=Object.create(_n.prototype),Cn.prototype.createElement=function(e){var t=e.name,n=ln(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},Cn.prototype.handleChild=function(e){var t=new Cn(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},Cn.prototype.handleText=function(e){this.body=this.body||""+e},Cn.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},Rn.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof An?(i=t,t={}):"string"==typeof t?(i=this.handler(t),t={}):"string"==typeof i&&(i=this.handler(i));var r=this.model,a=this.lax,o=new function(e){sn(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw yn("expected element");var t,n=this.elementsById,i=gn(e).idProperty;if(i&&(t=e.get(i.name))){if(n[t])throw yn("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}(sn({},t,{rootHandler:i})),s=new pn({proxy:!0}),p=new nn;function l(e,t,n){var i=t(),r=i.line,a=i.column,s=i.data;"<"===s.charAt(0)&&-1!==s.indexOf(" ")&&(s=s.slice(0,s.indexOf(" "))+">");var p="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+a+"\n\tnested error: "+e.message;if(n)return o.addWarning({message:p,error:e}),console.warn("could not parse node"),console.warn(e),!0;throw console.error("could not parse document"),console.error(e),yn(p)}i.context=o,p.push(i);var c=/^<\?xml /i,u=/ encoding="([^"]+)"/i,h=/^utf-8$/i;var m=r.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{});s.ns(m).on("openTag",function(e,t,n,i){var r=e.attrs||{},o=Object.keys(r).reduce(function(e,n){var i=t(r[n]);return e[n]=i,e},{});!function(e,t){var n=p.peek();try{p.push(n.handleNode(e))}catch(e){l(e,t,a)&&p.push(new xn)}}({name:e.name,originalName:e.originalName,attributes:o,ns:e.ns},i)}).on("question",function(e){if(c.test(e)){var t=u.exec(e),n=t&&t[1];n&&!h.test(n)&&o.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){p.pop().handleEnd()}).on("cdata",function(e){p.peek().handleText(e)}).on("text",function(e,t){!function(e){(e=e.trim())&&p.peek().handleText(e)}(t(e))}).on("error",l).on("warn",function(e,t){return l(e,t,!0)}),setTimeout(function(){var t;try{s.parse(e),function(){var e,t,n=o.elementsById,i=o.references;for(e=0;t=i[e];e++){var r=t.element,a=n[t.id],s=gn(r).propertiesByName[t.property];if(a||o.addWarning({message:"unresolved reference <"+t.id+">",element:t.element,property:t.property,value:t.id}),s.isMany){var p=r.get(s.name),l=p.indexOf(t);-1===l&&(l=p.length),a?p[l]=a:p.splice(l,1)}else r.set(s.name,a)}}()}catch(e){t=e}var r=i.element;t||r||(t=yn("failed to parse document as <"+i.type.$descriptor.name+">")),n(t,t?void 0:r,o)},0)},Rn.prototype.handler=function(e){return new Sn(this.model,e)},(rn=Rn).ElementHandler=An;var Mn=s.map,kn=s.forEach,Pn=s.isString,Tn=s.filter,Nn=s.assign,Dn=Ct.parseName,On=gt.hasLowerCaseAlias,Bn=gt.serializeAsType,Ln=gt.serializeAsProperty,In='<?xml version="1.0" encoding="UTF-8"?>\n',jn=/<|>|'|"|&|\n\r|\n/g,Fn=/<|>|&/g,Vn=gt.DEFAULT_NS_MAP,Wn=gt.XSI_TYPE;function zn(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Gn(e){return Pn(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function $n(e,t){return t.isGeneric?Nn({localName:t.ns.localName},e):Nn({localName:(n=t.ns.localName,i=t.$pkg,On(i)?(r=n).charAt(0).toLowerCase()+r.slice(1):n)},e);var n,i,r}var Hn={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Kn={"<":"lt",">":"gt","&":"amp"};function Un(e,t,n){return(e=Pn(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function qn(e){this.tagName=e}function Yn(){}function Xn(e){this.tagName=e}function Zn(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Jn(e,t){Zn.call(this,e,t)}qn.prototype.build=function(e){return this.element=e,this},qn.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Yn.prototype.serializeValue=Yn.prototype.serializeTo=function(e){e.append(this.escape?Un(this.value,Fn,Kn):this.value)},Yn.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(Fn)&&(this.escape=!0),this},zn(Xn,Yn),Xn.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Zn.prototype.build=function(e){this.element=e;var t,n,i=e.$descriptor,r=this.propertyDescriptor,a=i.isGeneric;return t=a?this.parseGeneric(e):this.parseNsAttributes(e),this.ns=r?this.nsPropertyTagName(r):this.nsTagName(i),this.tagName=this.addTagName(this.ns),a||(n=function(e){var t=e.$descriptor;return Tn(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(Tn(n,function(e){return e.isAttr})),this.parseContainments(function(e){return Tn(e,function(e){return!e.isAttr})}(n))),this.parseGenericAttributes(e,t),this},Zn.prototype.nsTagName=function(e){return $n(this.logNamespaceUsed(e.ns),e)},Zn.prototype.nsPropertyTagName=function(e){return function(e,t){return Nn({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Zn.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Zn.prototype.nsAttributeName=function(e){var t;if(t=Pn(e)?Dn(e):e.ns,e.inherited)return{localName:t.localName};var n=this.logNamespaceUsed(t);return this.getNamespaces().logUsed(n),this.isLocalNs(n)?{localName:t.localName}:Nn({localName:t.localName},n)},Zn.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return kn(e,function(r,a){"$body"===a?n.push((new Yn).build({type:"String"},r)):"$children"===a?kn(r,function(e){n.push(new Zn(t).build(e))}):0!==a.indexOf("$")&&t.parseNsAttribute(e,a,r)&&i.push({name:a,value:r})}),i},Zn.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,a=Dn(t);if("xmlns"===a.prefix&&(i={prefix:a.localName,uri:n}),a.prefix||"xmlns"!==a.localName||(i={uri:n}),!i)return{name:t,value:n};if(r&&r.getPackage(n))this.logNamespace(i,!0,!0);else{var o=this.logNamespaceUsed(i,!0);this.getNamespaces().logUsed(o)}},Zn.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return kn(i,function(t,i){var a=n.parseNsAttribute(e,i,t);a&&r.push(a)}),r},Zn.prototype.parseGenericAttributes=function(e,t){var n=this;kn(t,function(t){if(t.name!==Wn)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}})},Zn.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;kn(e,function(e){var r=i.get(e.name),a=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new Yn).build(e,r[0]));else if(It.isSimple(e.type))kn(r,function(i){n.push(new Xn(t.addTagName(t.nsPropertyTagName(e))).build(e,i))});else if(a)kn(r,function(i){n.push(new qn(t.addTagName(t.nsPropertyTagName(e))).build(i))});else{var o=Bn(e),s=Ln(e);kn(r,function(i){var r;r=o?new Jn(t,e):s?new Zn(t,e):new Zn(t),n.push(r.build(i))})}})},Zn.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new function(e){var t={},n={},i={},r=[],a=[];this.byUri=function(t){return n[t]||e&&e.byUri(t)},this.add=function(e,t){n[e.uri]=e,t?r.push(e):a.push(e),this.mapPrefix(e.prefix,e.uri)},this.uriByPrefix=function(e){return t[e||"xmlns"]},this.mapPrefix=function(e,n){t[e||"xmlns"]=n},this.logUsed=function(e){var t=e.uri;i[t]=this.byUri(t)},this.getUsed=function(e){return[].concat(r,a).filter(function(e){return i[e.uri]})}}(t):n=t),n},Zn.prototype.logNamespace=function(e,t,n){var i=this.getNamespaces(n),r=e.uri,a=e.prefix;return i.byUri(r)||i.add(e,t),i.mapPrefix(a,r),e},Zn.prototype.logNamespaceUsed=function(e,t){var n,i,r,a=this.element.$model,o=this.getNamespaces(t),s=e.prefix,p=e.uri;if(!s&&!p)return{localName:e.localName};if(r=Vn[s]||a&&(a.getPackage(s)||{}).uri,!(p=p||r||o.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=o.byUri(p))){for(n=s,i=1;o.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:p},r===p)}return s&&o.mapPrefix(s,p),e},Zn.prototype.parseAttributes=function(e){var t=this,n=this.element;kn(e,function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];kn(i,function(e){r.push(e.id)}),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)})},Zn.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Gn(e)},Zn.prototype.addAttribute=function(e,t){var n=this.attrs;Pn(t)&&(t=Un(t,jn,Hn)),n.push({name:e,value:t})},Zn.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=function(e){return Mn(e.getUsed(),function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}})}(n).concat(t)),kn(t,function(t){e.append(" ").append(Gn(t.name)).append('="').append(t.value).append('"')})},Zn.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Yn;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),kn(this.body,function(t){t.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},zn(Jn,Zn),Jn.prototype.parseNsAttributes=function(e){var t=Zn.prototype.parseNsAttributes.call(this,e),n=e.$descriptor;if(n.name===this.propertyDescriptor.type)return t;var i=this.typeNs=this.nsTagName(n);this.getNamespaces().logUsed(this.typeNs);var r=e.$model.getPackage(i.uri),a=r.xml&&r.xml.typePrefix||"";return this.addAttribute(this.nsAttributeName(Wn),(i.prefix?i.prefix+":":"")+a+n.ns.localName),t},Jn.prototype.isLocalNs=function(e){return e.uri===this.typeNs.uri};var Qn=function(e){return e=Nn({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(In),(new Zn).build(t).serializeTo(r),!n)return i.value}}},ei=s.isString,ti=s.isFunction,ni=s.assign;function ii(e,t){en.call(this,e,t)}ii.prototype=Object.create(en.prototype);var ri=ii;ii.prototype.fromXML=function(e,t,n,i){ei(t)||(i=n,n=t,t="bpmn:Definitions"),ti(n)&&(i=n,n={});var r=new rn(ni({model:this,lax:!0},n)),a=r.handler(t);r.fromXML(e,a,i)},ii.prototype.toXML=function(e,t,n){ti(t)&&(n=t,t={});var i,r,a=new Qn(t);try{i=a.toXML(e)}catch(e){r=e}return n(r,i)};var ai=s.assign,oi={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",default:!0},{name:"activityRef",type:"Activity",isAttr:!0,isReference:!0}]},{name:"TimerEventDefinition",superClass:["EventDefinition"],properties:[{name:"timeDate",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeCycle",type:"Expression",xml:{serialize:"xsi:type"}},{name:"timeDuration",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"LinkEventDefinition",superClass:["EventDefinition"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"target",type:"LinkEventDefinition",isAttr:!0,isReference:!0},{name:"source",type:"LinkEventDefinition",isMany:!0,isReference:!0}]},{name:"MessageEventDefinition",superClass:["EventDefinition"],properties:[{name:"messageRef",type:"Message",isAttr:!0,isReference:!0},{name:"operationRef",type:"Operation",isAttr:!0,isReference:!0}]},{name:"ConditionalEventDefinition",superClass:["EventDefinition"],properties:[{name:"condition",type:"Expression",xml:{serialize:"xsi:type"}}]},{name:"SignalEventDefinition",superClass:["EventDefinition"],properties:[{name:"signalRef",type:"Signal",isAttr:!0,isReference:!0}]},{name:"Signal",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"ImplicitThrowEvent",superClass:["ThrowEvent"]},{name:"DataState",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"}]},{name:"ItemAwareElement",superClass:["BaseElement"],properties:[{name:"itemSubjectRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"dataState",type:"DataState"}]},{name:"DataAssociation",superClass:["BaseElement"],properties:[{name:"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:[]}},si=function(e,t){return new ri(ai({},oi,e),t)},pi={remove:function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n},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)}}},li={},ci=s.isArray,ui=(s.isNumber,s.groupBy,s.forEach);function hi(e,t){var n,i,r,a;return t=!!t,ci(e)||(e=[e]),ui(e,function(e){var o=e;e.waypoints&&!t&&(o=hi(e.waypoints,!0));var s=o.x,p=o.y,l=o.height||0,c=o.width||0;(s<n||void 0===n)&&(n=s),(p<i||void 0===i)&&(i=p),(s+c>r||void 0===r)&&(r=s+c),(p+l>a||void 0===a)&&(a=p+l)}),{x:n,y:i,height:a-i,width:r-n}}li.getBBox=hi,li.getType=function(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"};var mi=s.isNumber,fi=s.assign,di=s.forEach,yi=s.every,gi=s.debounce,vi=s.bind,xi=s.reduce,bi=n.append,Ei=n.attr,wi=n.classes,_i=n.create,Ai=n.transform,Si=n.createMatrix;function Ci(e,t){return Math.round(e*t)/t}function Ri(e){return mi(e)?e+"px":e}function Mi(e,t,n){var i=_i("g");wi(i).add(t);var r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]),i}var ki={shape:["x","y","width","height"],connection:["waypoints"]};function Pi(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}Pi.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"];var Ti=Pi;function Ni(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Pi.prototype._init=function(e){var t=this._eventBus,n=this._container=function(e){var t=(e=fi({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),fi(n.style,{position:"relative",overflow:"hidden",width:Ri(e.width),height:Ri(e.height)}),t.appendChild(n),n}(e),i=this._svg=_i("svg");Ei(i,{width:"100%",height:"100%"}),bi(n,i);var r=this._viewport=Mi(i,"viewport");this._layers={},!1!==e.deferUpdate&&(this._viewboxChanged=gi(vi(this._viewboxChanged,this),300)),t.on("diagram.init",function(){t.fire("canvas.init",{svg:i,viewport:r})},this),t.on(["shape.added","connection.added","shape.removed","connection.removed","elements.changed"],function(){delete this._cachedViewbox},this),t.on("diagram.destroy",500,this._destroy,this),t.on("diagram.clear",500,this._clear,this)},Pi.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},Pi.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=li.getType(t);"root"===n?e.setRootElement(null,!0):e._removeElement(t,n)}),delete this._cachedViewbox},Pi.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Pi.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},Pi.prototype._createLayer=function(e,t){t||(t=0);var n=xi(this._layers,function(e,n){return t>=n.index&&e++,e},0);return{group:Mi(this._viewport,"layer-"+e,n),index:t}},Pi.prototype.getContainer=function(){return this._container},Pi.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(di([i.gfx,i.secondaryGfx],function(e){e&&(n?wi(e).add(t):wi(e).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Pi.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Pi.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Pi.prototype.hasMarker=function(e,t){e.id||(e=this._elementRegistry.get(e));var n=this.getGraphics(e);return wi(n).has(t)},Pi.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Pi.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},Pi.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 a=this.getDefaultLayer();r.fire("root.add",{element:e}),i.add(e,a,this._svg),r.fire("root.added",{element:e,gfx:a})}return this._rootElement=e,e},Pi.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=ki[e];if(!yi(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},Pi.prototype._setParent=function(e,t,n){pi.add(t.children,e,n),e.parent=t},Pi.prototype._addElement=function(e,t,n,i){n=n||this.getRootElement();var r=this._eventBus,a=this._graphicsFactory;this._ensureValid(e,t),r.fire(e+".add",{element:t,parent:n}),this._setParent(t,n,i);var o=a.create(e,t,i);return this._elementRegistry.add(t,o),a.update(e,t,o),r.fire(e+".added",{element:t,gfx:o}),t},Pi.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Pi.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Pi.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),pi.remove(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},Pi.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Pi.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Pi.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Pi.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Pi.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Pi.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,a,o,s=this._viewport,p=this.getSize();return e?(this._changeViewbox(function(){r=Math.min(p.width/e.width,p.height/e.height);var t=this._svg.createSVGMatrix().scale(r).translate(-e.x,-e.y);Ai(s,t)}),e):(t=this.getDefaultLayer().getBBox(),n=(i=Ai(s))?i.matrix:Si(),r=Ci(n.a,1e3),a=Ci(-n.e||0,1e3),o=Ci(-n.f||0,1e3),e=this._cachedViewbox={x:a?a/r:0,y:o?o/r:0,width:p.width/r,height:p.height/r,scale:r,inner:{width:t.width,height:t.height,x:t.x,y:t.y},outer:p})},Pi.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=fi({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),Ni(t,n)}),{x:n.e,y:n.f}},Pi.prototype.zoom=function(e,t){return e?"fit-viewport"===e?this._fitViewport(t):(this._changeViewbox(function(){"object"!=typeof t&&(n=this.viewbox().outer,t={x:n.width/2,y:n.height/2}),i=this._setZoom(e,t)}),Ci(i.a,1e3)):this.viewbox(e).scale;var n,i},Pi.prototype._fitViewport=function(e){var t,n,i=this.viewbox(),r=i.outer,a=i.inner;return a.x>=0&&a.y>=0&&a.x+a.width<=r.width&&a.y+a.height<=r.height&&!e?n={x:0,y:0,width:Math.max(a.width+a.x,r.width),height:Math.max(a.height+a.y,r.height)}:(t=Math.min(1,r.width/a.width,r.height/a.height),n={x:a.x+(e?a.width/2-r.width/t/2:0),y:a.y+(e?a.height/2-r.height/t/2:0),width:r.width/t,height:r.height/t}),this.viewbox(n),this.viewbox(!1).scale},Pi.prototype._setZoom=function(e,t){var n,i,r,a,o=this._svg,s=this._viewport,p=o.createSVGMatrix(),l=o.createSVGPoint(),c=(i=s.getCTM()).a;return t?(n=fi(l,t).matrixTransform(i.inverse()),r=p.translate(n.x,n.y).scale(1/c*e).translate(-n.x,-n.y),a=i.multiply(r)):a=p.scale(e),Ni(this._viewport,a),a},Pi.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Pi.prototype.getAbsoluteBBox=function(e){var t,n=this.viewbox();e.waypoints?t=this.getGraphics(e).getBBox():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}},Pi.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Di={},Oi=s.assign,Bi=new tt({name:"children",enumerable:!0,collection:!0},{name:"parent"}),Li=new tt({name:"label",enumerable:!0},{name:"labelTarget"}),Ii=new tt({name:"attachers",collection:!0},{name:"host"}),ji=new tt({name:"outgoing",collection:!0},{name:"source"}),Fi=new tt({name:"incoming",collection:!0},{name:"target"});function Vi(){Object.defineProperty(this,"businessObject",{writable:!0}),Bi.bind(this,"parent"),Li.bind(this,"label"),ji.bind(this,"outgoing"),Fi.bind(this,"incoming")}function Wi(){Vi.call(this),Bi.bind(this,"children"),Ii.bind(this,"host"),Ii.bind(this,"attachers")}function zi(){Wi.call(this)}function Gi(){Wi.call(this),Li.bind(this,"labelTarget")}function $i(){Vi.call(this),ji.bind(this,"source"),Fi.bind(this,"target")}H(Wi,Vi),H(zi,Wi),H(Gi,Wi),H($i,Vi);var Hi={connection:$i,shape:Wi,label:Gi,root:zi};Di.create=function(e,t){var n=Hi[e];if(!n)throw new Error("unknown type: <"+e+">");return Oi(new n,t)};var Ki=s.assign;function Ui(){this._uid=12}var qi=Ui;Ui.prototype.createRoot=function(e){return this.create("root",e)},Ui.prototype.createLabel=function(e){return this.create("label",e)},Ui.prototype.createShape=function(e){return this.create("shape",e)},Ui.prototype.createConnection=function(e){return this.create("connection",e)},Ui.prototype.create=function(e,t){return(t=Ki({},t||{})).id||(t.id=e+"_"+this._uid++),Di.create(e,t)};var Yi="data-element-id",Xi=n.attr;function Zi(e){this._elements={},this._eventBus=e}Zi.$inject=["eventBus"];var Ji=Zi;Zi.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),Xi(t,Yi,i),n&&Xi(n,Yi,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Zi.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(Xi(i.gfx,Yi,""),i.secondaryGfx&&Xi(i.secondaryGfx,Yi,""),delete t[n])},Zi.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)},Zi.prototype.get=function(e){var t;t="string"==typeof e?e:e&&Xi(e,Yi);var n=this._elements[t];return n&&n.element},Zi.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},Zi.prototype.getAll=function(){return this.filter(function(e){return e})},Zi.prototype.forEach=function(e){var t=this._elements;Object.keys(t).forEach(function(n){var i=t[n],r=i.element,a=i.gfx;return e(r,a)})},Zi.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Zi.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 Qi=s.isFunction,er=s.isArray,tr=s.isNumber,nr=s.bind,ir=s.assign,rr=Array.prototype.slice;function ar(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}var or=ar;function sr(){}ar.prototype.on=function(e,t,n,i){if(e=er(e)?e:[e],Qi(t)&&(i=n,n=t,t=1e3),!tr(t))throw new Error("priority must be a number");var r=n;i&&((r=nr(n,i)).__fn=n.__fn||n);var a=this,o={priority:t,callback:r};e.forEach(function(e){a._addListener(e,o)})},ar.prototype.once=function(e,t,n,i){var r=this;if(Qi(t)&&(i=n,n=t,t=1e3),!tr(t))throw new Error("priority must be a number");function a(){return r.off(e,a),n.apply(i,arguments)}a.__fn=n,this.on(e,t,a)},ar.prototype.off=function(e,t){var n,i,r,a=this._getListeners(e);if(t)for(r=a.length-1;n=a[r];r--)(i=n.callback)!==t&&i.__fn!==t||a.splice(r,1);else a.length=0},ar.prototype.createEvent=function(e){var t=new sr;return t.init(e),t},ar.prototype.fire=function(e,t){var n,i,r,a;if(a=rr.call(arguments),"object"==typeof e&&(e=(n=e).type),!e)throw new Error("no event type specified");if(i=this._listeners[e]){n=t instanceof sr?t:this.createEvent(t),a[0]=n;var o=n.type;e!==o&&(n.type=e);try{r=this._invokeListeners(n,a,i)}finally{e!==o&&(n.type=o)}return void 0===r&&n.defaultPrevented&&(r=!1),r}},ar.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},ar.prototype._destroy=function(){this._listeners={}},ar.prototype._invokeListeners=function(e,t,n){var i,r,a;for(i=0;(r=n[i])&&!e.cancelBubble;i++)a=this._invokeListener(e,t,r);return a},ar.prototype._invokeListener=function(e,t,n){var i;try{void 0!==(i=function(e,t){return e.apply(null,t)}(n.callback,t))&&(e.returnValue=i,e.stopPropagation()),!1===i&&e.preventDefault()}catch(e){if(!this.handleError(e))throw console.error("unhandled error in event listener"),console.error(e.stack),e}return i},ar.prototype._addListener=function(e,t){var n,i,r=this._getListeners(e);for(i=0;n=r[i];i++)if(n.priority<t.priority)return void r.splice(i,0,t);r.push(t)},ar.prototype._getListeners=function(e){var t=this._listeners[e];return t||(this._listeners[e]=t=[]),t},sr.prototype.stopPropagation=function(){this.cancelBubble=!0},sr.prototype.preventDefault=function(){this.defaultPrevented=!0},sr.prototype.init=function(e){ir(this,e||{})};var pr={},lr=K.query;pr.getVisual=function(e){return lr(".djs-visual",e)},pr.getChildren=function(e){return e.parentNode.childNodes[1]};var cr=s.forEach,ur=s.reduce,hr=E.translate,mr=K.clear,fr=n.append,dr=n.attr,yr=n.classes,gr=n.create,vr=n.remove;function xr(e,t){this._eventBus=e,this._elementRegistry=t}xr.$inject=["eventBus","elementRegistry"];var br=xr;function Er(e,t,n){t.insertBefore(e,n||t.firstChild)}xr.prototype._getChildren=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=pr.getChildren(n))||(t=gr("g"),yr(t).add("djs-children"),fr(n.parentNode,t)):t=n,t},xr.prototype._clear=function(e){var t=pr.getVisual(e);return mr(t),t},xr.prototype._createContainer=function(e,t,n){var i=gr("g");yr(i).add("djs-group"),void 0!==n?Er(i,t,t.childNodes[n]):fr(t,i);var r=gr("g");yr(r).add("djs-element"),yr(r).add("djs-"+e),fr(i,r);var a=gr("g");return yr(a).add("djs-visual"),fr(r,a),r},xr.prototype.create=function(e,t,n){var i=this._getChildren(t.parent);return this._createContainer(e,i,n)},xr.prototype.updateContainments=function(e){var t,n=this,i=this._elementRegistry;t=ur(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),cr(t,function(e){var t=e.children;if(t){var r=n._getChildren(e);cr(t.slice().reverse(),function(e){Er(i.getGraphics(e).parentNode,r)})}})},xr.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},xr.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},xr.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},xr.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},xr.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),hr(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?dr(n,"display","none"):dr(n,"display","block")}},xr.prototype.remove=function(e){var t=this._elementRegistry.getGraphics(e);vr(t.parentNode)};var wr=i.componentsToPath,_r=i.createLine,Ar=n.append,Sr=n.attr,Cr=n.create,Rr=1;function Mr(e,t){b.call(this,e,Rr),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2})}H(Mr,b),Mr.prototype.canRender=function(){return!0},Mr.prototype.drawShape=function(e,t){var n=Cr("rect");return Sr(n,{x:0,y:0,width:t.width||0,height:t.height||0}),Sr(n,this.SHAPE_STYLE),Ar(e,n),n},Mr.prototype.drawConnection=function(e,t){var n=_r(t.waypoints,this.CONNECTION_STYLE);return Ar(e,n),n},Mr.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width,r=e.height;return wr([["M",t,n],["l",i,0],["l",0,r],["l",-i,0],["z"]])},Mr.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([0===t?"M":"L",n.x,n.y]);return wr(r)},Mr.$inject=["eventBus","styles"];var kr=Mr,Pr=s.isArray,Tr=s.assign,Nr=s.reduce;var Dr={__depends__:[{__init__:["defaultRenderer"],defaultRenderer:["type",kr],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){var i=this.style(t,n);return Tr(i,{class:e})},this.style=function(t,n){Pr(t)||n||(n=t,t=[]);var i=Nr(t,function(t,n){return Tr(t,e[n]||{})},{});return n?Tr(i,n):i},this.computeStyle=function(e,n,i){return Pr(n)||(i=n,n=[]),t.style(n||[],Tr({},i,e||{}))}}]}],__init__:["canvas"],canvas:["type",Ti],elementRegistry:["type",Ji],elementFactory:["type",qi],eventBus:["type",or],graphicsFactory:["type",br]},Or={exports:{}};!function(e,t){"object"==typeof Or.exports?t(Or.exports):t(e.didi={})}(this,function(e){"use strict";var t=/^class /;function n(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(){var e=Array.prototype.slice.call(arguments);1===e.length&&n(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var r=/constructor\s*[^(]*\(\s*([^)]*)\)/m,a=/^function\s*[^(]*\(\s*([^)]*)\)/m,o=/\/\*([^*]*)\*\//m;function s(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var n=e.toString().match(function(e){return t.test(e.toString())}(e)?r:a);return n&&n[1]&&n[1].split(",").map(function(e){return(n=e.match(o))?n[1].trim():e.trim()})||[]}function p(){var e=[];this.factory=function(t,n){return e.push([t,"factory",n]),this},this.value=function(t,n){return e.push([t,"value",n]),this},this.type=function(t,n){return e.push([t,"type",n]),this},this.forEach=function(t){e.forEach(t)}}var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function c(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function u(e,t){return Object.hasOwnProperty.call(e,t)}e.Injector=function e(t,r){r=r||{get:function(e,t){if(a.push(e),!1===t)return null;throw f('No provider for "'+e+'"!')}};var a=[],o=this._providers=Object.create(r._providers||null),h=this._instances=Object.create(null),m=h.injector=this,f=function(e){var t=a.join(" -> ");return a.length=0,new Error(t?e+" (Resolving: "+t+")":e)},d=function e(t,n){if(!o[t]&&-1!==t.indexOf(".")){for(var i=t.split("."),s=e(i.shift());i.length;)s=s[i.shift()];return s}if(u(h,t))return h[t];if(u(o,t)){if(-1!==a.indexOf(t))throw a.push(t),f("Cannot resolve circular dependency!");return a.push(t),h[t]=o[t][0](o[t][1]),a.pop(),h[t]}return r.get(t,n)},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e){if(!n(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=i(e.slice())}return{fn:e,dependencies:(e.$inject||s(e)).map(function(e){return u(t,e)?t[e]:d(e)})}},g=function(e){var t=y(e),n=t.dependencies,i=t.fn;return new(Function.prototype.bind.apply(i,[null].concat(c(n))))},v=function(e,t,n){var i=y(e,n),r=i.dependencies,a=i.fn;return a.call.apply(a,[t].concat(c(r)))},x=function(e){return i(function(t){return e.get(t)})},b={factory:v,type:g,value:function(e){return e}};t.forEach(function(t){function r(e,t){return"value"!==e&&n(t)&&(t=i(t.slice())),t}if(t instanceof p)t.forEach(function(e){var t=e[0],n=e[1],i=e[2];o[t]=[b[n],r(n,i),n]});else if("object"===(void 0===t?"undefined":l(t)))if(t.__exports__){var a=Object.keys(t).reduce(function(e,n){return"__"!==n.substring(0,2)&&(e[n]=t[n]),e},Object.create(null)),s=new e((t.__modules__||[]).concat([a]),m),c=i(function(e){return s.get(e)});t.__exports__.forEach(function(e){o[e]=[c,e,"private",s]})}else Object.keys(t).forEach(function(e){if("private"!==t[e][2]){var n=t[e][0],i=t[e][1];o[e]=[b[n],r(n,i),n]}else o[e]=t[e]})}),this.get=d,this.invoke=v,this.instantiate=g,this.createChild=function(t,n){if(n&&n.length){var i,r,a,s,p=Object.create(null),l=Object.create(null),c=[],u=[],h=[];for(var f in o)i=o[f],-1!==n.indexOf(f)&&("private"===i[2]?-1===(r=c.indexOf(i[3]))?(a=i[3].createChild([],n),s=x(a),c.push(i[3]),u.push(a),h.push(s),p[f]=[s,f,"private",a]):p[f]=[h[r],f,"private",u[r]]:p[f]=[i[2],i[1]],l[f]=!0),"factory"!==i[2]&&"type"!==i[2]||!i[1].$scope||n.forEach(function(e){-1!==i[1].$scope.indexOf(e)&&(p[f]=[i[2],i[1]],l[e]=!0)});n.forEach(function(e){if(!l[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),t.unshift(p)}return new e(t,m)}},Object.defineProperty(e,"__esModule",{value:!0})});var Br=(Or=Or.exports).Injector;function Lr(e){var t=[],n=[];function i(e){return t.indexOf(e)>=0}e.forEach(function e(r){i(r)||((r.__depends__||[]).forEach(e),i(r)||(function(e){t.push(e)}(r),(r.__init__||[]).forEach(function(e){n.push(e)})))});var r=new Br(t);return n.forEach(function(e){try{r["string"==typeof e?"get":"invoke"](e)}catch(e){throw console.error("Failed to instantiate component"),console.error(e.stack),e}}),r}function Ir(e,t){this.injector=t=t||function(e){return Lr([{config:["value",e=e||{}]},Dr].concat(e.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}var jr=Ir;Ir.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},Ir.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")};var Fr=jr;function Vr(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}var Wr=Vr;Vr.prototype.next=function(){return this._prefix+ ++this._counter};var zr=s.isArray,Gr=s.isString,$r=s.isObject,Hr=s.assign,Kr=s.forEach,Ur=s.find,qr=s.filter,Yr=s.matchPattern,Xr=K.domify,Zr=K.classes,Jr=K.attr,Qr=K.remove,ea=K.clear,ta=li.getBBox,na=new Wr("ov");function ia(e,t,n){Hr(e.style,{left:t+"px",top:n+"px"})}function ra(e,t){e.style.display=!1===t?"none":""}function aa(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}function oa(e){return void 0!==e}function sa(e,t,n,i){var r,a;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=na,this._overlayDefaults=Hr({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),a=Xr('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(a,r.firstChild),a),this._init()}sa.$inject=["config.overlays","eventBus","canvas","elementRegistry"];var pa=sa;sa.prototype.get=function(e){if(Gr(e)&&(e={id:e}),Gr(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?qr(t.overlays,Yr({type:e.type})):t.overlays.slice():[]}return e.type?qr(this._overlays,Yr({type:e.type})):e.id?this._overlays[e.id]:null},sa.prototype.add=function(e,t,n){if($r(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=Hr({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},sa.prototype.remove=function(e){var t=this.get(e)||[];zr(t)||(t=[t]);var n=this;Kr(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(Qr(e.html),Qr(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var i=t.overlays.indexOf(e);-1!==i&&t.overlays.splice(i,1)}})},sa.prototype.show=function(){ra(this._overlayRoot)},sa.prototype.hide=function(){ra(this._overlayRoot,!1)},sa.prototype.clear=function(){this._overlays={},this._overlayContainers=[],ea(this._overlayRoot)},sa.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var a=ta(t);i=a.x,r=a.y}ia(n,i,r),Jr(e.html,"data-container-id",t.id)},sa.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,a=e.element,o=i.left,s=i.top;void 0!==i.right&&(t=a.waypoints?ta(a).width:a.width,o=-1*i.right+t);void 0!==i.bottom&&(n=a.waypoints?ta(a).height:a.height,s=-1*i.bottom+n);ia(r,o||0,s||0)},sa.prototype._createOverlayContainer=function(e){var t=Xr('<div class="djs-overlays" style="position: absolute" />');this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},sa.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";aa(this._overlayRoot,n)},sa.prototype._getOverlayContainer=function(e,t){var n=Ur(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},sa.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,a=e.html;a.get&&a.constructor.prototype.jquery&&(a=a.get(0)),Gr(a)&&(a=Xr(a)),n=this._getOverlayContainer(r),(t=Xr('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(a),e.type&&Zr(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())},sa.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=n&&n.minZoom,r=n&&n.maxZoom,a=e.htmlContainer,o=!0;n&&((oa(i)&&i>t.scale||oa(r)&&r<t.scale)&&(o=!1),ra(a,o)),this._updateOverlayScale(e,t)},sa.prototype._updateOverlayScale=function(e,t){var n,i,r,a=e.scale,o=e.htmlContainer,s="";!0!==a&&(!1===a?(n=1,i=1):(n=a.min,i=a.max),oa(n)&&t.scale<n&&(r=(1/t.scale||1)*n),oa(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),oa(r)&&(s="scale("+r+","+r+")"),aa(o,s)},sa.prototype._updateOverlaysVisibilty=function(e){var t=this;Kr(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},sa.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){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()}),e.on(["shape.remove","connection.remove"],function(e){var n=e.element,i=t.get({element:n});Kr(i,function(e){t.remove(e.id)});var r=t._getOverlayContainer(n);if(r){Qr(r.html);var a=t._overlayContainers.indexOf(r);-1!==a&&t._overlayContainers.splice(a,1)}}),e.on("element.changed",500,function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(Kr(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&&Zr(n.html)[e.add?"add":"remove"](e.marker)}),e.on("diagram.clear",this.clear,this)};var la={__init__:["overlays"],overlays:["type",pa]},ca={};function ua(e){return e.originalEvent||e.srcEvent}ca.getOriginal=ua,ca.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 ha={isMac:function(){return/mac/i.test(navigator.platform)}},ma={},fa=ca.getOriginal,da=ha.isMac;function ya(e){return!(fa(e)||e).button}ma.isPrimaryButton=ya,ma.hasPrimaryModifier=function(e){var t=fa(e)||e;return!!ya(e)&&(da()?t.metaKey:t.ctrlKey)};var ga=s.forEach,va=K.delegate,xa=ma.isPrimaryButton,ba=n.append,Ea=n.attr,wa=n.create,_a=K.query,Aa=i.createLine,Sa=i.updateLine;function Ca(e){return!0}var Ra=500;function Ma(e,t,n){var i=n.cls("djs-hit",["no-fill","no-border"],{stroke:"white",strokeWidth:15});function r(n,i,r){var a,o;(function(e,t){return!(p[e]||xa)(t)})(n,i)||(r?o=t.getGraphics(r):(a=i.delegateTarget||i.target)&&(o=a,r=t.get(o)),o&&r&&!1===e.fire(n,{element:r,gfx:o,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var a={};function o(e){return a[e]}var s={mouseover:"element.hover",mouseout:"element.out",click:"element.click",dblclick:"element.dblclick",mousedown:"element.mousedown",mouseup:"element.mouseup",contextmenu:"element.contextmenu"},p={"element.contextmenu":Ca};var l="svg, .djs-element";function c(e,t,n,i){var o=a[n]=function(e){r(n,e)};i&&(p[n]=i),o.$delegate=va.bind(e,l,t,o)}function u(e,t,n){var i=o(n);i&&va.unbind(e,t,i.$delegate)}e.on("canvas.destroy",function(e){var t;t=e.svg,ga(s,function(e,n){u(t,n,e)})}),e.on("canvas.init",function(e){var t;t=e.svg,ga(s,function(e,n){c(t,n,e)})}),e.on(["shape.added","connection.added"],function(e){var t,n=e.element,r=e.gfx;n.waypoints?t=Aa(n.waypoints):(t=wa("rect"),Ea(t,{x:0,y:0,width:n.width,height:n.height})),Ea(t,i),ba(r,t)}),e.on("shape.changed",Ra,function(e){var t=e.element,n=e.gfx,i=_a(".djs-hit",n);Ea(i,{width:t.width,height:t.height})}),e.on("connection.changed",function(e){var t=e.element,n=e.gfx,i=_a(".djs-hit",n);Sa(i,t.waypoints)}),this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=s[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=o,this.registerEvent=c,this.unregisterEvent=u}Ma.$inject=["eventBus","elementRegistry","styles"];var ka={__init__:["interactionEvents"],interactionEvents:["type",Ma]},Pa=li.getBBox,Ta=500,Na=n.append,Da=n.attr,Oa=n.create,Ba=K.query,La=s.assign;function Ia(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function a(e,t){var n=Oa("rect");return Da(n,La({x:10,y:10,width:100,height:100},i)),Na(e,n),n}e.on(["shape.added","shape.changed"],Ta,function(e){var t=e.element,n=e.gfx,i=Ba(".djs-outline",n);i||(i=a(n)),r.updateShapeOutline(i,t)}),e.on(["connection.added","connection.changed"],function(e){var t=e.element,n=e.gfx,i=Ba(".djs-outline",n);i||(i=a(n)),r.updateConnectionOutline(i,t)})}Ia.prototype.updateShapeOutline=function(e,t){Da(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Ia.prototype.updateConnectionOutline=function(e,t){var n=Pa(t);Da(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Ia.$inject=["eventBus","styles","elementRegistry"];var ja={__init__:["outline"],outline:["type",Ia]},Fa=s.isArray,Va=s.forEach;function Wa(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)})}Wa.$inject=["eventBus"];var za=Wa;Wa.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})}},Wa.prototype.get=function(){return this._selectedElements},Wa.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Wa.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();Fa(e)||(e=e?[e]:[]),t?Va(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 Ga=ma.hasPrimaryModifier,$a=s.find;function Ha(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);$a(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),a=t.get().length>1,o=Ga(e);if(r&&a)return o?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,o)})}Ha.$inject=["eventBus","selection","canvas","elementRegistry"];var Ka=Ha,Ua=s.forEach,qa="hover",Ya="selected";function Xa(e,t,n,i){function r(e,n){t.addMarker(e,n)}function a(e,n){t.removeMarker(e,n)}this._multiSelectionBox=null,e.on("element.hover",function(e){r(e.element,qa)}),e.on("element.out",function(e){a(e.element,qa)}),e.on("selection.changed",function(e){var t=e.oldSelection,n=e.newSelection;Ua(t,function(e){-1===n.indexOf(e)&&a(e,Ya)}),Ua(n,function(e){-1===t.indexOf(e)&&r(e,Ya)})})}Xa.$inject=["eventBus","canvas","selection","styles"];var Za={__init__:["selectionVisuals","selectionBehavior"],__depends__:[ka,ja],selection:["type",za],selectionVisuals:["type",Xa],selectionBehavior:["type",Ka]},Ja=s.assign,Qa=s.isNumber,eo=s.omit,to=K.domify,no=K.query,io=K.remove,ro=n.innerSVG,ao=lt.importBpmnDiagram;var oo={width:"100%",height:"100%",position:"relative"};function so(e){return e+(Qa(e)?"px":"")}function po(e){var t,n,i;e=Ja({},oo,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n=ct.BPMNIO_IMG,i=to('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" style="position: absolute; bottom: 15px; right: 15px; z-index: 100">'+n+"</a>"),t.appendChild(i),co.bind(i,"click",function(e){ct.open(),e.preventDefault()}),this._init(this._container,this._moddle,e)}H(po,Fr);var lo=po;po.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 a=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:a}),t(e,a);n.importDefinitions(i,function(e,i){var r=[].concat(a,i||[]);n._emit("import.done",{error:e,warnings:r}),t(e,r)})})},po.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)},po.prototype.saveSVG=function(e,t){var n,i;t||(t=e,e={});try{var r=this.get("canvas"),a=r.getDefaultLayer(),o=no("defs",r._svg),s=ro(a),p=o?"<defs>"+ro(o)+"</defs>":"",l=a.getBBox();n='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+l.width+'" height="'+l.height+'" viewBox="'+l.x+" "+l.y+" "+l.width+" "+l.height+'" version="1.1">'+p+s+"</svg>"}catch(e){i=e}t(i,n)},po.prototype.importDefinitions=function(e,t){try{this._definitions&&this.clear(),this._definitions=e}catch(e){return t(e)}return ao(this,e,t)},po.prototype.getModules=function(){return this._modules},po.prototype.destroy=function(){Fr.prototype.destroy.call(this),io(this._container)},po.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},po.prototype.off=function(e,t){this.get("eventBus").off(e,t)},po.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=no(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},po.prototype.getDefinitions=function(){return this._definitions},po.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},po.prototype._init=function(e,t,n){var i=n.modules||this.getModules(),r=n.additionalModules||[],a=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),o=Ja(eo(n,["additionalModules"]),{canvas:Ja({},n.canvas,{container:e}),modules:a});Fr.call(this,o),n&&n.container&&this.attachTo(n.container)},po.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},po.prototype._createContainer=function(e){var t=to('<div class="bjs-container"></div>');return Ja(t.style,{width:so(e.width),height:so(e.height),position:e.position}),t},po.prototype._createModdle=function(e){var t=Ja({},this._moddleExtensions,e.moddleExtensions);return new si(t)},po.prototype._modules=[Ze,Xe,Za,la],po.prototype._moddleExtensions={};var co=K.event;var uo={},ho=5e3;uo.install=function(e,t){function n(){return!1}return t=t||"element.click",e.once(t,ho,n),function(){e.off(t,n)}};var mo={},fo=K.classes,yo=/^djs-cursor-.*$/;mo.set=function(e){var t=fo(document.body);t.removeMatching(yo),e&&t.add("djs-cursor-"+e)},mo.unset=function(){this.set(null)};var go={};go.log10=function(e){return Math.log(e)/Math.log(10)},go.substract=function(e,t){return{x:e.x-t.x,y:e.y-t.y}};var vo=go.substract,xo=K.event,bo=K.closest;var Eo=15;function wo(e,t){var n;function i(i){var r,a=n.start,o=ca.toPoint(i),s=vo(o,a);if(!n.dragging&&(r=s,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>Eo)&&(n.dragging=!0,uo.install(e),mo.set("grab")),n.dragging){var p=n.last||n.start;s=vo(o,p),t.scroll({dx:s.x,dy:s.y}),n.last=o}i.preventDefault()}function r(e){xo.unbind(document,"mousemove",i),xo.unbind(document,"mouseup",r),n=null,mo.unset()}e.on("element.mousedown",500,function(e){return function(e){if(!bo(e.target,".djs-draggable")&&!(e.button||e.ctrlKey||e.shiftKey||e.altKey))return n={start:ca.toPoint(e)},xo.bind(document,"mousemove",i),xo.bind(document,"mouseup",r),!0}(e.originalEvent)})}wo.$inject=["eventBus","canvas"];var _o={__init__:["moveCanvas"],moveCanvas:["type",wo]},Ao={},So=go.log10;Ao.getStepSize=function(e,t){var n=So(e.min),i=So(e.max);return(Math.abs(n)+Math.abs(i))/t},Ao.cap=function(e,t){return Math.max(e.min,Math.min(e.max,t))};var Co=K.event,Ro=K.closest,Mo=Ao.getStepSize,ko=Ao.cap,Po=go.log10,To=s.bind,No=Math.sign||function(e){return e>=0?1:-1},Do={min:.2,max:4},Oo=.75;function Bo(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=To(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||Oo;var i=this;t.on("canvas.init",function(t){i._init(!1!==e.enabled)})}Bo.$inject=["config.zoomScroll","eventBus","canvas"];var Lo=Bo;Bo.prototype.scroll=function(e){this._canvas.scroll(e)},Bo.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Bo.prototype.zoom=function(e,t){var n=Mo(Do,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Bo.prototype._handleWheel=function(e){if(!Ro(e.target,".djs-scrollable",!0)){var t=this._container;e.preventDefault();var n,i=e.ctrlKey,r=e.shiftKey,a=-1*this._scale;if(a*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var o=t.getBoundingClientRect(),s={x:e.clientX-o.left,y:e.clientY-o.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*No(e.deltaY)*a,this.zoom(n,s)}else n=r?{dx:a*e.deltaY,dy:0}:{dx:a*e.deltaX,dy:a*e.deltaY},this.scroll(n)}},Bo.prototype.stepZoom=function(e,t){var n=Mo(Do,10);this._zoom(e,t,n)},Bo.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,a=Po(i.zoom()),o=Math.round(a/n)*n;o+=n*r;var s=Math.pow(10,o);i.zoom(ko(Do,s),t)},Bo.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&Co[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Bo.prototype._init=function(e){this.toggle(e)};var Io={__init__:["zoomScroll"],zoomScroll:["type",Lo]};function jo(e){lo.call(this,e)}H(jo,lo);var Fo=jo;return jo.prototype._navigationModules=[Io,_o],jo.prototype._modules=[].concat(jo.prototype._modules,jo.prototype._navigationModules),Fo});