UNPKG

170 kBJavaScriptView Raw
1/*! bpmn-js - bpmn-navigated-viewer v5.0.2 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
2!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).BpmnJS=t()}(this,function(){"use strict";var e=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),t=Object.prototype.toString,n=Object.prototype.hasOwnProperty;function i(e){return void 0!==e}function r(e){return"[object Array]"===t.call(e)}function a(e){return"[object Object]"===t.call(e)}function o(e){return"[object Number]"===t.call(e)}function s(e){var n=t.call(e);return"[object Function]"===n||"[object AsyncFunction]"===n||"[object GeneratorFunction]"===n||"[object AsyncGeneratorFunction]"===n||"[object Proxy]"===n}function l(e){return"[object String]"===t.call(e)}function p(e,t){return n.call(e,t)}function c(e,t){var n;return t=function(e){return s(e)?e:function(t){return t===e}}(t),h(e,function(e,i){if(t(e,i))return n=e,!1}),n}function u(e,t){var n=[];return h(e,function(e,i){t(e,i)&&n.push(e)}),n}function h(e,t){var n;if(void 0!==e){var i=r(e)?g:y;for(var a in e)if(p(e,a)&&!1===t(n=e[a],i(a)))return n}}function m(e,t,n){return h(e,function(e,i){n=t(n,e,i)}),n}function f(e,t){return!!m(e,function(e,n,i){return e&&t(n,i)},!0)}function d(e){return function(t){return f(e,function(e,n){return t[n]===e})}}function y(e){return e}function g(e){return Number(e)}function v(e,t){return e.bind(t)}function x(){return(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}).apply(this,arguments)}function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return x.apply(void 0,[e].concat(n))}var E=[].indexOf,w=function(e,t){if(E)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},_=/\s+/,A=Object.prototype.toString;function S(e){return new R(e)}function R(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function C(e){for(var t;e.childNodes.length;)t=e.childNodes[0],e.removeChild(t);return e}R.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~w(t,e)||t.push(e),this.el.className=t.join(" "),this},R.prototype.remove=function(e){if("[object RegExp]"==A.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=w(t,e);return~n&&t.splice(n,1),this.el.className=t.join(" "),this},R.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},R.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)},R.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(_);return""===e[0]&&e.shift(),e},R.prototype.has=R.prototype.contains=function(e){return this.list?this.list.contains(e):!!~w(this.array(),e)};var k=Element.prototype,M=k.matchesSelector||k.webkitMatchesSelector||k.mozMatchesSelector||k.msMatchesSelector||k.oMatchesSelector,P=function(e,t){if(M)return M.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 T,D=function(e,t,n){for(var i=n?e:e.parentNode;i&&i!==document;){if(P(i,t))return i;i=i.parentNode}},N=window.addEventListener?"addEventListener":"attachEvent",O=window.removeEventListener?"removeEventListener":"detachEvent",B="addEventListener"!==N?"on":"",L={bind:function(e,t,n,i){return e[N](B+t,n,i||!1),n},unbind:function(e,t,n,i){return e[O](B+t,n,i||!1),n}},I=["focus","blur"],F={bind:function(e,t,n,i,r){return-1!==I.indexOf(n)&&(r=!0),L.bind(e,n,function(n){var r=n.target||n.srcElement;n.delegateTarget=D(r,t,!0),n.delegateTarget&&i.call(e,n)},r)},unbind:function(e,t,n,i){-1!==I.indexOf(t)&&(i=!0),L.unbind(e,t,n,i)}},j=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=W[i]||W._default,o=a[0],s=a[1],l=a[2];(r=t.createElement("div")).innerHTML=s+e+l;for(;o--;)r=r.lastChild;if(r.firstChild==r.lastChild)return r.removeChild(r.firstChild);var p=t.createDocumentFragment();for(;r.firstChild;)p.appendChild(r.removeChild(r.firstChild));return p},V=!1;"undefined"!=typeof document&&((T=document.createElement("div")).innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>',V=!T.getElementsByTagName("link").length,T=void 0);var W={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,"",""]};W.td=W.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],W.option=W.optgroup=[1,'<select multiple="multiple">',"</select>"],W.thead=W.tbody=W.colgroup=W.caption=W.tfoot=[1,"<table>","</table>"],W.polyline=W.ellipse=W.polygon=W.circle=W.text=W.line=W.path=W.rect=W.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];var z="undefined"!=typeof Element?Element.prototype:{},G=z.matches||z.matchesSelector||z.webkitMatchesSelector||z.mozMatchesSelector||z.msMatchesSelector||z.oMatchesSelector,H=function(e,t){if(!e||1!==e.nodeType)return!1;if(G)return G.call(e,t);for(var n=e.parentNode.querySelectorAll(t),i=0;i<n.length;i++)if(n[i]==e)return!0;return!1};function $(e,t){return(t=t||document).querySelector(e)}function K(e){e.parentNode&&e.parentNode.removeChild(e)}function U(e,t){return t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}function q(e,t){return U(t,e),e}var Y=2,X={"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":Y,"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":Y,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function Z(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=X[i];r?(r===Y&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function J(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return X[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);Z(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)Z(e,i,t[i])}(e,t);return e}function Q(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 ee=/\s+/,te=Object.prototype.toString;function ne(e){return void 0!==e}function ie(e){return new re(e)}function re(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ae(e){var t=e.parentNode;return t&&t.removeChild(e),e}re.prototype.add=function(e){if(this.list)return this.list.add(e),this;var t=this.array();return~Q(t,e)||t.push(e),ne(this.el.className.baseVal)?this.el.className.baseVal=t.join(" "):this.el.className=t.join(" "),this},re.prototype.remove=function(e){if("[object RegExp]"===te.call(e))return this.removeMatching(e);if(this.list)return this.list.remove(e),this;var t=this.array(),n=Q(t,e);return~n&&t.splice(n,1),this.el.className.baseVal=t.join(" "),this},re.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},re.prototype.toggle=function(e,t){return this.list?(ne(t)?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this):(ne(t)?t?this.add(e):this.remove(e):this.has(e)?this.remove(e):this.add(e),this)},re.prototype.array=function(){var e=(this.el.getAttribute("class")||"").replace(/^\s+|\s+$/g,"").split(ee);return""===e[0]&&e.shift(),e},re.prototype.has=re.prototype.contains=function(e){return this.list?this.list.contains(e):!!~Q(this.array(),e)};var oe={svg:"http://www.w3.org/2000/svg"},se='<svg xmlns="'+oe.svg+'"';function le(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(oe.svg)&&(e=se+e.substring(4)):(e=se+">"+e+"</svg>",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function pe(e,t){var n;return"<"===e.charAt(0)?(n=le(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(oe.svg,e),t&&J(n,t),n}var ce=pe("svg");function ue(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function he(e){return e?ce.createSVGTransformFromMatrix(e):ce.createSVGTransform()}var me=/([&<>]{1})/g,fe=/([\n\r"]{1})/g,de={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function ye(e,t){return e.replace(t,function(e,t){return de[t]||t})}function ge(e,t){var n,i,r,a,o;switch(e.nodeType){case 3:t.push(ye(e.textContent,me));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,'="',ye(a.value,fe),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(o=e.childNodes).length;n<i;++n)ge(o.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",ye(e.nodeValue,me),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function ve(e,t){var n=le(t);if(function(e){for(var t;t=e.firstChild;)ae(t)}(e),t){(function(e){return"#document-fragment"===e.nodeName})(n)||(n=n.documentElement);for(var i,r=(i=n.childNodes,Array.prototype.slice.call(i)),a=0;a<r.length;a++)U(r[a],e)}}function xe(e,t){if(void 0!==t){try{ve(e,t)}catch(e){throw new Error("error parsing SVG: "+e.message)}return e}return function(e){for(var t=e.firstChild,n=[];t;)ge(t,n),t=t.nextSibling;return n.join("")}(e)}function be(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Ee(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(be(e,i))}(n,t)),n.consolidate()}var we=/^class /;function _e(e){return"[object Array]"===Object.prototype.toString.call(e)}function Ae(){var e=Array.prototype.slice.call(arguments);1===e.length&&_e(e[0])&&(e=e[0]);var t=e.pop();return t.$inject=e,t}var Se=/constructor\s*[^(]*\(\s*([^)]*)\)/m,Re=/^function\s*[^(]*\(\s*([^)]*)\)/m,Ce=/\/\*([^*]*)\*\//m;function ke(e){if("function"!=typeof e)throw new Error('Cannot annotate "'+e+'". Expected a function!');var t=e.toString().match(function(e){return we.test(e.toString())}(e)?Se:Re);return t&&t[1]&&t[1].split(",").map(function(e){return(t=e.match(Ce))?t[1].trim():e.trim()})||[]}var Me="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 Pe(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 Te(e,t){t=t||{get:function(e,t){if(n.push(e),!1===t)return null;throw o('No provider for "'+e+'"!')}};var n=[],i=this._providers=Object.create(t._providers||null),r=this._instances=Object.create(null),a=r.injector=this,o=function(e){var t=n.join(" -> ");return n.length=0,new Error(t?e+" (Resolving: "+t+")":e)},s=function e(a,s){if(!i[a]&&-1!==a.indexOf(".")){for(var l=a.split("."),p=e(l.shift());l.length;)p=p[l.shift()];return p}if(De(r,a))return r[a];if(De(i,a)){if(-1!==n.indexOf(a))throw n.push(a),o("Cannot resolve circular dependency!");return n.push(a),r[a]=i[a][0](i[a][1]),n.pop(),r[a]}return t.get(a,s)},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("function"!=typeof e){if(!_e(e))throw new Error('Cannot invoke "'+e+'". Expected a function!');e=Ae(e.slice())}var n=e.$inject||ke(e),i=n.map(function(e){return De(t,e)?t[e]:s(e)});return{fn:e,dependencies:i}},p=function(e){var t=l(e),n=t.dependencies,i=t.fn;return new(Function.prototype.bind.apply(i,[null].concat(Pe(n))))},c=function(e,t,n){var i=l(e,n),r=i.dependencies,a=i.fn;return a.call.apply(a,[t].concat(Pe(r)))},u=function(e){return Ae(function(t){return e.get(t)})},h={factory:c,type:p,value:function(e){return e}};e.forEach(function(e){function t(e,t){return"value"!==e&&_e(t)&&(t=Ae(t.slice())),t}if(e instanceof function(){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)}})e.forEach(function(e){var n=e[0],r=e[1],a=e[2];i[n]=[h[r],t(r,a),r]});else if("object"===(void 0===e?"undefined":Me(e)))if(e.__exports__){var n=Object.keys(e).reduce(function(t,n){return"__"!==n.substring(0,2)&&(t[n]=e[n]),t},Object.create(null)),r=new Te((e.__modules__||[]).concat([n]),a),o=Ae(function(e){return r.get(e)});e.__exports__.forEach(function(e){i[e]=[o,e,"private",r]})}else Object.keys(e).forEach(function(n){if("private"!==e[n][2]){var r=e[n][0],a=e[n][1];i[n]=[h[r],t(r,a),r]}else i[n]=e[n]})}),this.get=s,this.invoke=c,this.instantiate=p,this.createChild=function(e,t){if(t&&t.length){var n,r,o,s,l=Object.create(null),p=Object.create(null),c=[],h=[],m=[];for(var f in i)n=i[f],-1!==t.indexOf(f)&&("private"===n[2]?-1===(r=c.indexOf(n[3]))?(o=n[3].createChild([],t),s=u(o),c.push(n[3]),h.push(o),m.push(s),l[f]=[s,f,"private",o]):l[f]=[m[r],f,"private",h[r]]:l[f]=[n[2],n[1]],p[f]=!0),"factory"!==n[2]&&"type"!==n[2]||!n[1].$scope||t.forEach(function(e){-1!==n[1].$scope.indexOf(e)&&(l[f]=[n[2],n[1]],p[e]=!0)});t.forEach(function(e){if(!p[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(l)}return new Te(e,a)}}function De(e,t){return Object.hasOwnProperty.call(e,t)}var Ne=1e3;function Oe(e,t){var n=this;t=t||Ne,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)})}function Be(e){return e.join(",").replace(/,?([A-z]),?/g,"$1")}function Le(e){for(var t,n="",i=0;t=e[i];i++)n+=t.x+","+t.y+" ";return n}function Ie(e,t){var n=pe("polyline");return J(n,{points:Le(e)}),t&&J(n,t),n}function Fe(e,t){var n,i,a,o;return t=!!t,r(e)||(e=[e]),h(e,function(e){var r=e;e.waypoints&&!t&&(r=Fe(e.waypoints,!0));var s=r.x,l=r.y,p=r.height||0,c=r.width||0;(s<n||void 0===n)&&(n=s),(l<i||void 0===i)&&(i=l),(s+c>a||void 0===a)&&(a=s+c),(l+p>o||void 0===o)&&(o=l+p)}),{x:n,y:i,height:o-i,width:a-n}}function je(e){return!(!e||!e.isFrame)}Oe.prototype.canRender=function(){},Oe.prototype.drawShape=function(){},Oe.prototype.drawConnection=function(){},Oe.prototype.getShapePath=function(){},Oe.prototype.getConnectionPath=function(){};var Ve=1;function We(e,t){Oe.call(this,e,Ve),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}e(We,Oe),We.prototype.canRender=function(){return!0},We.prototype.drawShape=function(e,t){var n=pe("rect");return J(n,{x:0,y:0,width:t.width||0,height:t.height||0}),je(t)?J(n,this.FRAME_STYLE):J(n,this.SHAPE_STYLE),q(e,n),n},We.prototype.drawConnection=function(e,t){var n=Ie(t.waypoints,this.CONNECTION_STYLE);return q(e,n),n},We.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return Be([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},We.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 Be(r)},We.$inject=["eventBus","styles"];var ze={__init__:["defaultRenderer"],defaultRenderer:["type",We],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){return b(this.style(t,n),{class:e})},this.style=function(t,n){r(t)||n||(n=t,t=[]);var i=m(t,function(t,n){return b(t,e[n]||{})},{});return n?b(i,n):i},this.computeStyle=function(e,n,i){return r(n)||(i=n,n=[]),t.style(n||[],b({},i,e||{}))}}]};function Ge(e,t){return Math.round(e*t)/t}function He(e){return o(e)?e+"px":e}function $e(e,t,n){var i=pe("g");ie(i).add(t);var r=void 0!==n?n:e.childNodes.length-1;return e.insertBefore(i,e.childNodes[r]||null),i}var Ke={shape:["x","y","width","height"],connection:["waypoints"]};function Ue(e,t,n,i){this._eventBus=t,this._elementRegistry=i,this._graphicsFactory=n,this._init(e||{})}function qe(e,t){var n="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttribute("transform",n)}Ue.$inject=["config.canvas","eventBus","graphicsFactory","elementRegistry"],Ue.prototype._init=function(e){var t=this._eventBus,n=this._container=function(e){var t=(e=b({},{width:"100%",height:"100%"},e)).container||document.body,n=document.createElement("div");return n.setAttribute("class","djs-container"),b(n.style,{position:"relative",overflow:"hidden",width:He(e.width),height:He(e.height)}),t.appendChild(n),n}(e),i=this._svg=pe("svg");J(i,{width:"100%",height:"100%"}),q(n,i);var r=this._viewport=$e(i,"viewport");this._layers={},!1!==e.deferUpdate&&(this._viewboxChanged=function(e,t){var n,i,r,a;function o(){var o=Date.now(),l=a+t-o;if(l>0)return s(l);e.apply(r,i),n=a=i=r=void 0}function s(e){n=setTimeout(o,e)}return function(){a=Date.now();for(var e=arguments.length,o=new Array(e),l=0;l<e;l++)o[l]=arguments[l];i=o,r=this,n||s(t)}}(v(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)},Ue.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},Ue.prototype._clear=function(){var e=this;this._elementRegistry.getAll().forEach(function(t){var n=function(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}(t);"root"===n?e.setRootElement(null,!0):e._removeElement(t,n)}),delete this._cachedViewbox},Ue.prototype.getDefaultLayer=function(){return this.getLayer("base",0)},Ue.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},Ue.prototype._createLayer=function(e,t){t||(t=0);var n=m(this._layers,function(e,n){return t>=n.index&&e++,e},0);return{group:$e(this._viewport,"layer-"+e,n),index:t}},Ue.prototype.getContainer=function(){return this._container},Ue.prototype._updateMarker=function(e,t,n){var i;e.id||(e=this._elementRegistry.get(e)),(i=this._elementRegistry._elements[e.id])&&(h([i.gfx,i.secondaryGfx],function(e){e&&(n?ie(e).add(t):ie(e).remove(t))}),this._eventBus.fire("element.marker.update",{element:e,gfx:i.gfx,marker:t,add:!!n}))},Ue.prototype.addMarker=function(e,t){this._updateMarker(e,t,!0)},Ue.prototype.removeMarker=function(e,t){this._updateMarker(e,t,!1)},Ue.prototype.hasMarker=function(e,t){return e.id||(e=this._elementRegistry.get(e)),ie(this.getGraphics(e)).has(t)},Ue.prototype.toggleMarker=function(e,t){this.hasMarker(e,t)?this.removeMarker(e,t):this.addMarker(e,t)},Ue.prototype.getRootElement=function(){return this._rootElement||this.setRootElement({id:"__implicitroot",children:[]}),this._rootElement},Ue.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},Ue.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=Ke[e];if(!f(n,function(e){return void 0!==t[e]}))throw new Error("must supply { "+n.join(", ")+" } with "+e)},Ue.prototype._setParent=function(e,t,n){!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)}}(t.children,e,n),e.parent=t},Ue.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},Ue.prototype.addShape=function(e,t,n){return this._addElement("shape",e,t,n)},Ue.prototype.addConnection=function(e,t,n){return this._addElement("connection",e,t,n)},Ue.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),function(e,t){if(!e||!t)return-1;var n=e.indexOf(t);-1!==n&&e.splice(n,1)}(e.parent&&e.parent.children,e),e.parent=null,r.fire(t+".removed",{element:e}),n.remove(e),e},Ue.prototype.removeShape=function(e){return this._removeElement(e,"shape")},Ue.prototype.removeConnection=function(e){return this._removeElement(e,"connection")},Ue.prototype.getGraphics=function(e,t){return this._elementRegistry.getGraphics(e,t)},Ue.prototype._changeViewbox=function(e){this._eventBus.fire("canvas.viewbox.changing"),e.apply(this),this._cachedViewbox=null,this._viewboxChanged()},Ue.prototype._viewboxChanged=function(){this._eventBus.fire("canvas.viewbox.changed",{viewbox:this.viewbox()})},Ue.prototype.viewbox=function(e){if(void 0===e&&this._cachedViewbox)return this._cachedViewbox;var t,n,i,r,a,o,s=this._viewport,l=this.getSize();return e?(this._changeViewbox(function(){r=Math.min(l.width/e.width,l.height/e.height);var t=this._svg.createSVGMatrix().scale(r).translate(-e.x,-e.y);Ee(s,t)}),e):(t=this.getDefaultLayer().getBBox(),n=(i=Ee(s))?i.matrix:function(e,t,n,i,r,a){var o=ce.createSVGMatrix();switch(arguments.length){case 0:return o;case 1:return ue(o,e);case 6:return ue(o,{a:e,b:t,c:n,d:i,e:r,f:a})}}(),r=Ge(n.a,1e3),a=Ge(-n.e||0,1e3),o=Ge(-n.f||0,1e3),e=this._cachedViewbox={x:a?a/r:0,y:o?o/r:0,width:l.width/r,height:l.height/r,scale:r,inner:{width:t.width,height:t.height,x:t.x,y:t.y},outer:l})},Ue.prototype.scroll=function(e){var t=this._viewport,n=t.getCTM();return e&&this._changeViewbox(function(){e=b({dx:0,dy:0},e||{}),n=this._svg.createSVGMatrix().translate(e.dx,e.dy).multiply(n),qe(t,n)}),{x:n.e,y:n.f}},Ue.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)}),Ge(i.a,1e3)):this.viewbox(e).scale;var n,i},Ue.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},Ue.prototype._setZoom=function(e,t){var n,i,r,a,o=this._svg,s=this._viewport,l=o.createSVGMatrix(),p=o.createSVGPoint(),c=(i=s.getCTM()).a;return t?(n=b(p,t).matrixTransform(i.inverse()),r=l.translate(n.x,n.y).scale(1/c*e).translate(-n.x,-n.y),a=i.multiply(r)):a=l.scale(e),qe(this._viewport,a),a},Ue.prototype.getSize=function(){return{width:this._container.clientWidth,height:this._container.clientHeight}},Ue.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}},Ue.prototype.resized=function(){delete this._cachedViewbox,this._eventBus.fire("canvas.resized")};var Ye="data-element-id";function Xe(e){this._elements={},this._eventBus=e}Xe.$inject=["eventBus"],Xe.prototype.add=function(e,t,n){var i=e.id;this._validateId(i),J(t,Ye,i),n&&J(n,Ye,i),this._elements[i]={element:e,gfx:t,secondaryGfx:n}},Xe.prototype.remove=function(e){var t=this._elements,n=e.id||e,i=n&&t[n];i&&(J(i.gfx,Ye,""),i.secondaryGfx&&J(i.secondaryGfx,Ye,""),delete t[n])},Xe.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)},Xe.prototype.get=function(e){var t;t="string"==typeof e?e:e&&J(e,Ye);var n=this._elements[t];return n&&n.element},Xe.prototype.filter=function(e){var t=[];return this.forEach(function(n,i){e(n,i)&&t.push(n)}),t},Xe.prototype.getAll=function(){return this.filter(function(e){return e})},Xe.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)})},Xe.prototype.getGraphics=function(e,t){var n=e.id||e,i=this._elements[n];return i&&(t?i.secondaryGfx:i.gfx)},Xe.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 Ze={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,n){var a=this.indexOf(e);if(void 0===n){if(-1!==a)return;n=this.length}-1!==a&&this.splice(a,1),this.splice(n,0,e),-1===a&&t.set(e,r,i)}}),Object.defineProperty(e,"__refs_collection",{value:!0}),e},isExtended:function(e){return!0===e.__refs_collection}};function Je(e,t,n){var i=Ze.extend(n[t.name]||[],e,t,n);Object.defineProperty(n,t.name,{enumerable:t.enumerable,value:i}),i.length&&i.forEach(function(i){e.set(i,t.inverse,n)})}function Qe(e,t){if(!(this instanceof Qe))return new Qe(e,t);e.inverse=t,t.inverse=e,this.props={},this.props[e.name]=e,this.props[t.name]=t}Qe.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?Je(this,t,e):function(e,t,n){var i=t.inverse,r=n[t.name];Object.defineProperty(n,t.name,{configurable:t.configurable,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)},Qe.prototype.ensureRefsCollection=function(e,t){var n=e[t.name];return Ze.isExtended(n)||Je(this,t,e),n},Qe.prototype.ensureBound=function(e,t){(function(e,t){return Object.prototype.hasOwnProperty.call(e,t.name||t)})(e,t)||this.bind(e,t)},Qe.prototype.unset=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).remove(n):e[t.name]=void 0)},Qe.prototype.set=function(e,t,n){e&&(this.ensureBound(e,t),t.collection?this.ensureRefsCollection(e,t).add(n):e[t.name]=n)};var et=Qe,tt=Ze;et.Collection=tt;var nt=new et({name:"children",enumerable:!0,collection:!0},{name:"parent"}),it=new et({name:"labels",enumerable:!0,collection:!0},{name:"labelTarget"}),rt=new et({name:"attachers",collection:!0},{name:"host"}),at=new et({name:"outgoing",collection:!0},{name:"source"}),ot=new et({name:"incoming",collection:!0},{name:"target"});function st(){Object.defineProperty(this,"businessObject",{writable:!0}),Object.defineProperty(this,"label",{get:function(){return this.labels[0]},set:function(e){var t=this.label,n=this.labels;!e&&t?n.remove(t):n.add(e,0)}}),nt.bind(this,"parent"),it.bind(this,"labels"),at.bind(this,"outgoing"),ot.bind(this,"incoming")}function lt(){st.call(this),nt.bind(this,"children"),rt.bind(this,"host"),rt.bind(this,"attachers")}function pt(){lt.call(this)}function ct(){lt.call(this),it.bind(this,"labelTarget")}function ut(){st.call(this),at.bind(this,"source"),ot.bind(this,"target")}e(lt,st),e(pt,lt),e(ct,lt),e(ut,st);var ht={connection:ut,shape:lt,label:ct,root:pt};function mt(){this._uid=12}mt.prototype.createRoot=function(e){return this.create("root",e)},mt.prototype.createLabel=function(e){return this.create("label",e)},mt.prototype.createShape=function(e){return this.create("shape",e)},mt.prototype.createConnection=function(e){return this.create("connection",e)},mt.prototype.create=function(e,t){return(t=b({},t||{})).id||(t.id=e+"_"+this._uid++),function(e,t){var n=ht[e];if(!n)throw new Error("unknown type: <"+e+">");return b(new n,t)}(e,t)};var ft=Array.prototype.slice;function dt(){this._listeners={},this.on("diagram.destroy",1,this._destroy,this)}function yt(){}function gt(e,t,n){var i=he();i.setTranslate(t,n),Ee(e,i)}function vt(e,t){this._eventBus=e,this._elementRegistry=t}function xt(e,t,n){var i=n||t.firstChild;e!==i&&t.insertBefore(e,i)}dt.prototype.on=function(e,t,n,i){if(e=r(e)?e:[e],s(t)&&(i=n,n=t,t=1e3),!o(t))throw new Error("priority must be a number");var a=n;i&&((a=v(n,i)).__fn=n.__fn||n);var l=this;e.forEach(function(e){l._addListener(e,{priority:t,callback:a,next:null})})},dt.prototype.once=function(e,t,n,i){var r=this;if(s(t)&&(i=n,n=t,t=1e3),!o(t))throw new Error("priority must be a number");function a(){var t=n.apply(i,arguments);return r.off(e,a),t}a.__fn=n,this.on(e,t,a)},dt.prototype.off=function(e,t){e=r(e)?e:[e];var n=this;e.forEach(function(e){n._removeListener(e,t)})},dt.prototype.createEvent=function(e){var t=new yt;return t.init(e),t},dt.prototype.fire=function(e,t){var n,i,r,a;if(a=ft.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 yt?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}},dt.prototype.handleError=function(e){return!1===this.fire("error",{error:e})},dt.prototype._destroy=function(){this._listeners={}},dt.prototype._invokeListeners=function(e,t,n){for(var i;n&&!e.cancelBubble;)i=this._invokeListener(e,t,n),n=n.next;return i},dt.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},dt.prototype._addListener=function(e,t){var n,i=this._getListeners(e);if(i){for(;i;){if(i.priority<t.priority)return t.next=i,void(n?n.next=t:this._setListeners(e,t));n=i,i=i.next}n.next=t}else this._setListeners(e,t)},dt.prototype._getListeners=function(e){return this._listeners[e]},dt.prototype._setListeners=function(e,t){this._listeners[e]=t},dt.prototype._removeListener=function(e,t){var n,i,r,a=this._getListeners(e);if(t)for(;a;)n=a.next,(r=a.callback)!==t&&r.__fn!==t||(i?i.next=n:this._setListeners(e,n)),i=a,a=n;else this._setListeners(e,null)},yt.prototype.stopPropagation=function(){this.cancelBubble=!0},yt.prototype.preventDefault=function(){this.defaultPrevented=!0},yt.prototype.init=function(e){b(this,e||{})},vt.$inject=["eventBus","elementRegistry"],vt.prototype._getChildren=function(e){var t,n=this._elementRegistry.getGraphics(e);return e.parent?(t=function(e){return e.parentNode.childNodes[1]}(n))||(ie(t=pe("g")).add("djs-children"),q(n.parentNode,t)):t=n,t},vt.prototype._clear=function(e){var t=function(e){return e.childNodes[0]}(e);return C(t),t},vt.prototype._createContainer=function(e,t,n,i){var r=pe("g");ie(r).add("djs-group"),void 0!==n?xt(r,t,t.childNodes[n]):q(t,r);var a=pe("g");ie(a).add("djs-element"),ie(a).add("djs-"+e),i&&ie(a).add("djs-frame"),q(r,a);var o=pe("g");return ie(o).add("djs-visual"),q(a,o),a},vt.prototype.create=function(e,t,n){var i=this._getChildren(t.parent);return this._createContainer(e,i,n,je(t))},vt.prototype.updateContainments=function(e){var t=this,n=this._elementRegistry;h(m(e,function(e,t){return t.parent&&(e[t.parent.id]=t.parent),e},{}),function(e){var i=e.children;if(i){var r=t._getChildren(e);h(i.slice().reverse(),function(e){xt(n.getGraphics(e).parentNode,r)})}})},vt.prototype.drawShape=function(e,t){return this._eventBus.fire("render.shape",{gfx:e,element:t})},vt.prototype.getShapePath=function(e){return this._eventBus.fire("render.getShapePath",e)},vt.prototype.drawConnection=function(e,t){return this._eventBus.fire("render.connection",{gfx:e,element:t})},vt.prototype.getConnectionPath=function(e){return this._eventBus.fire("render.getConnectionPath",e)},vt.prototype.update=function(e,t,n){if(t.parent){var i=this._clear(n);if("shape"===e)this.drawShape(i,t),gt(n,t.x,t.y);else{if("connection"!==e)throw new Error("unknown type: "+e);this.drawConnection(i,t)}t.hidden?J(n,"display","none"):J(n,"display","block")}},vt.prototype.remove=function(e){ae(this._elementRegistry.getGraphics(e).parentNode)};var bt={__depends__:[ze],__init__:["canvas"],canvas:["type",Ue],elementRegistry:["type",Xe],elementFactory:["type",mt],eventBus:["type",dt],graphicsFactory:["type",vt]};function Et(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 Te(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 wt(e,t){this.injector=t=t||function(e){return Et([{config:["value",e=e||{}]},bt].concat(e.modules||[]))}(e),this.get=t.get,this.invoke=t.invoke,this.get("eventBus").fire("diagram.init")}function _t(){}function At(e,t){this.model=e,this.properties=t}wt.prototype.destroy=function(){this.get("eventBus").fire("diagram.destroy")},wt.prototype.clear=function(){this.get("eventBus").fire("diagram.clear")},_t.prototype.get=function(e){return this.$model.properties.get(this,e)},_t.prototype.set=function(e,t){this.$model.properties.set(this,e,t)},At.prototype.createType=function(e){var t=this.model,n=this.properties,i=Object.create(_t.prototype);h(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}),h(e,v(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 St={String:!0,Boolean:!0,Integer:!0,Real:!0,Element:!0},Rt={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)}};function Ct(e,t){var n=Rt[e];return n?n(t):t}function kt(e){return!!St[e]}function Mt(e){return!!Rt[e]}function Pt(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}}function Tt(e){this.ns=e,this.name=e.name,this.allTypes=[],this.allTypesByName={},this.properties=[],this.propertiesByName={}}function Dt(e,t){this.packageMap={},this.typeMap={},this.packages=[],this.properties=t,h(e,v(this.registerPackage,this))}function Nt(e,t,n){var i=t[n];if(i in e)throw new Error("package with "+n+" <"+i+"> already defined")}function Ot(e){this.model=e}function Bt(e,t,n){Object.defineProperty(e,t.name,{enumerable:!t.isReference,writable:!0,value:n,configurable:!0})}function Lt(e){this.properties=new Ot(this),this.factory=new At(this,this.properties),this.registry=new Dt(e,this.properties),this.typeCache={}}Tt.prototype.build=function(){return e=this,t=["ns","name","allTypes","allTypesByName","properties","propertiesByName","bodyProperty","idProperty"],n={},i=Object(e),h(t,function(t){t in i&&(n[t]=e[t])}),n;var e,t,n,i},Tt.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)},Tt.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},Tt.prototype.redefineProperty=function(e,t,n){var i=e.ns.prefix,r=t.split("#"),a=Pt(r[0],i),o=Pt(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},Tt.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},Tt.prototype.removeNamedProperty=function(e){var t=e.ns,n=this.propertiesByName;delete n[t.name],delete n[t.localName]},Tt.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},Tt.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},Tt.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")},Tt.prototype.hasProperty=function(e){return this.propertiesByName[e]},Tt.prototype.addTrait=function(e,t){var n=this.allTypesByName,i=this.allTypes,r=e.name;r in n||(h(e.properties,v(function(n){n=b({},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)},Dt.prototype.getPackage=function(e){return this.packageMap[e]},Dt.prototype.getPackages=function(){return this.packages},Dt.prototype.registerPackage=function(e){e=b({},e);var t=this.packageMap;Nt(t,e,"prefix"),Nt(t,e,"uri"),h(e.types,v(function(t){this.registerType(t,e)},this)),t[e.uri]=t[e.prefix]=e,this.packages.push(e)},Dt.prototype.registerType=function(e,t){var n=Pt((e=b({},e,{superClass:(e.superClass||[]).slice(),extends:(e.extends||[]).slice(),properties:(e.properties||[]).slice(),meta:b(e.meta||{})})).name,t.prefix),i=n.name,r={};h(e.properties,v(function(e){var t=Pt(e.name,n.prefix),i=t.name;kt(e.type)||(e.type=Pt(e.type,t.prefix).name),b(e,{ns:t,name:i}),r[i]=e},this)),b(e,{ns:n,name:i,propertiesByName:r}),h(e.extends,v(function(e){var t=this.typeMap[e];t.traits=t.traits||[],t.traits.push(i)},this)),this.definePackage(e,t),this.typeMap[i]=e},Dt.prototype.mapTypes=function(e,t,n){var i=kt(e.name)?{name:e.name}:this.typeMap[e.name],r=this;function a(e){return o(e,!0)}function o(n,i){var a=Pt(n,kt(n)?"":e.prefix);r.mapTypes(a,t,i)}if(!i)throw new Error("unknown type <"+e.name+">");h(i.superClass,n?a:o),t(i,!n),h(i.traits,a)},Dt.prototype.getEffectiveDescriptor=function(e){var t=Pt(e),n=new Tt(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},Dt.prototype.definePackage=function(e,t){this.properties.define(e,"$pkg",{value:t})},Ot.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:Bt(e,i,n):e.$attrs[t]=n},Ot.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&&Bt(e,n,[]),e[i]},Ot.prototype.define=function(e,t,n){Object.defineProperty(e,t,n)},Ot.prototype.defineDescriptor=function(e,t){this.define(e,"$descriptor",{value:t})},Ot.prototype.defineModel=function(e,t){this.define(e,"$model",{value:t})},Lt.prototype.create=function(e,t){var n=this.getType(e);if(!n)throw new Error("unknown type <"+e+">");return new n(t)},Lt.prototype.getType=function(e){var t=this.typeCache,n=l(e)?e:e.ns.name,i=t[n];return i||(e=this.registry.getEffectiveDescriptor(n),i=t[n]=this.factory.createType(e)),i},Lt.prototype.createAny=function(e,t,n){var i=Pt(e),r={$type:e,$instanceOf:function(e){return e===this.$type}},o={name:e,isGeneric:!0,ns:{prefix:i.prefix,localName:i.localName,uri:t}};return this.properties.defineDescriptor(r,o),this.properties.defineModel(r,this),this.properties.define(r,"$parent",{enumerable:!1,writable:!0}),h(n,function(e,t){a(e)&&void 0!==e.value?r[e.name]=e.value:r[t]=e}),r},Lt.prototype.getPackage=function(e){return this.registry.getPackage(e)},Lt.prototype.getPackages=function(){return this.registry.getPackages()},Lt.prototype.getElementDescriptor=function(e){return e.$descriptor},Lt.prototype.hasType=function(e,t){return void 0===t&&(t=e,e=this),t in e.$model.getElementDescriptor(e).allTypesByName},Lt.prototype.getPropertyDescriptor=function(e,t){return this.getElementDescriptor(e).propertiesByName[t]},Lt.prototype.getTypeDescriptor=function(e){return this.registry.typeMap[e]};var It=String.fromCharCode,Ft=Object.prototype.hasOwnProperty,jt=/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/gi,Vt={amp:"&",apos:"'",gt:">",lt:"<",quot:'"'};function Wt(e,t,n,i){return i?Ft.call(Vt,i)?Vt[i]:"&"+i+";":It(t||parseInt(n,16))}function zt(e){return e.length>3&&-1!==e.indexOf("&")?e.replace(jt,Wt):e}Object.keys(Vt).forEach(function(e){Vt[e.toUpperCase()]=Vt[e]});var Gt="http://www.w3.org/2001/XMLSchema-instance",Ht="xsi",$t="xsi:type",Kt="non-whitespace outside of root node";function Ut(e){return new Error(e)}function qt(e){return"missing namespace for prefix <"+e+">"}function Yt(e){return{get:e,enumerable:!0}}function Xt(e){var t,n={};for(t in e)n[t]=e[t];return n}function Zt(e){return e+"$uri"}function Jt(){return{line:0,column:0}}function Qt(e){throw e}function en(e){if(!this)return new en(e);var t,n,i,r,a,o,s,l,p,c=e&&e.proxy,u=Qt,h=Jt,m=!1,f=!1,d=null,y=!1;function g(e){e instanceof Error||(e=Ut(e)),d=e,u(e,h)}function v(e){a&&(e instanceof Error||(e=Ut(e)),a(e,h))}this.on=function(e,p){if("function"!=typeof p)throw Ut("required args <name, cb>");switch(e){case"openTag":n=p;break;case"text":t=p;break;case"closeTag":i=p;break;case"error":u=p;break;case"warn":a=p;break;case"cdata":r=p;break;case"attention":l=p;break;case"question":s=p;break;case"comment":o=p;break;default:throw Ut("unsupported event: "+e)}return this},this.ns=function(e){if(void 0===e&&(e={}),"object"!=typeof e)throw Ut("required args <nsMap={}>");var t,n={};for(t in e)n[t]=e[t];return n[Gt]=Ht,f=!0,p=n,this},this.parse=function(e){if("string"!=typeof e)throw Ut("required args <xml=string>");return d=null,function(e){var a,u,d,x,b,E,w,_,A,S,R=f?[]:null,C=f?function(e){var t,n,i={};for(t in e)i[n=e[t]]=n,i[Zt(n)]=t;return i}(p):null,k=[],M=0,P=!1,T=!1,D=0,N=0,O="",B=0;function L(){if(null!==S)return S;var e,t,n,i,r,a,o,s,l,c,u,h=f&&C.xmlns,d=f&&m?[]:null,y=B,g=O,x=g.length,b={},E={};e:for(;y<x;y++)if(l=!1,!(32===(c=g.charCodeAt(y))||c<14&&c>8)){for((c<65||c>122||c>90&&c<97)&&95!==c&&58!==c&&(v("illegal first char attribute name"),l=!0),u=y+1;u<x;u++)if(!((c=g.charCodeAt(u))>96&&c<123||c>64&&c<91||c>47&&c<59||46===c||45===c||95===c)){if(32===c||c<14&&c>8){v("missing attribute value"),y=u;continue e}if(61===c)break;v("illegal attribute name char"),l=!0}if("xmlns:xmlns"===(s=g.substring(y,u))&&(v("illegal declaration of xmlns"),l=!0),34===(c=g.charCodeAt(u+1)))-1===(u=g.indexOf('"',y=u+2))&&-1!==(u=g.indexOf("'",y))&&(v("attribute value quote missmatch"),l=!0);else if(39===c)-1===(u=g.indexOf("'",y=u+2))&&-1!==(u=g.indexOf('"',y))&&(v("attribute value quote missmatch"),l=!0);else for(v("missing attribute value quotes"),l=!0,u+=1;u<x&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++);for(-1===u&&(v("missing closing quotes"),u=x,l=!0),l||(a=g.substring(y,u)),y=u;u+1<x&&!(32===(c=g.charCodeAt(u+1))||c<14&&c>8);u++)y===u&&(v("illegal character after attribute end"),l=!0);if(y=u+1,!l)if(s in E)v("attribute <"+s+"> already defined");else if(E[s]=!0,f)if(m){if(null!==(r="xmlns"===s?"xmlns":120===s.charCodeAt(0)&&"xmlns:"===s.substr(0,6)?s.substr(6):null)){if(e=zt(a),t=Zt(r),!(o=p[e])){if("xmlns"===r||t in C&&C[t]!==e)do{o="ns"+M++}while(void 0!==C[o]);else o=r;p[e]=o}C[r]!==o&&(i||(C=Xt(C),i=!0),C[r]=o,"xmlns"===r&&(C[Zt(o)]=e,h=o),C[t]=e),b[s]=a;continue}d.push(s,a)}else-1!==(c=s.indexOf(":"))?(n=C[s.substring(0,c)])?((s=h===n?s.substr(c+1):n+s.substr(c))===$t&&(-1!==(c=a.indexOf(":"))?(n=a.substring(0,c),n=C[n]||n,a=n+a.substring(c)):a=h+":"+a),b[s]=a):v(qt(s.substring(0,c))):b[s]=a;else b[s]=a}if(m)for(y=0,x=d.length;y<x;y++){if(s=d[y++],a=d[y],-1!==(c=s.indexOf(":"))){if(!(n=C[s.substring(0,c)])){v(qt(s.substring(0,c)));continue}(s=h===n?s.substr(c+1):n+s.substr(c))===$t&&(-1!==(c=a.indexOf(":"))?(n=a.substring(0,c),n=C[n]||n,a=n+a.substring(c)):a=h+":"+a)}b[s]=a}return S=b}h=function(){for(var t,n,i=/(\r\n|\r|\n)/g,r=0,a=0,o=0,s=N;D>=o&&(t=i.exec(e))&&!((s=t[0].length+t.index)>D);)r+=1,o=s;return-1==D?(a=s,n=e.substring(N)):0===N?(console.log(D-o),n=e.substring(N,D)):(a=D-o,n=-1==N?e.substring(D):e.substring(D,N+1)),{data:n,line:r,column:a}},c&&(A=Object.create({},{name:Yt(function(){return w}),originalName:Yt(function(){return _}),attrs:Yt(L),ns:Yt(function(){return C})}));for(;-1!==N;){if(-1===(D=60===e.charCodeAt(N)?N:e.indexOf("<",N)))return k.length?g("unexpected end of file"):0===N?g("missing start tag"):void(N<e.length&&e.substring(N).trim()&&v(Kt));if(N!==D)if(k.length){if(t&&(t(e.substring(N,D),zt,h),y))return}else if(e.substring(N,D).trim()&&(v(Kt),y))return;if(33!==(b=e.charCodeAt(D+1)))if(63!==b){if(-1==(N=e.indexOf(">",D+1)))return g("unclosed tag");if(S={},47===b){if(P=!1,T=!0,!k.length)return g("missing open tag");if(u=w=k.pop(),x=D+2+u.length,e.substring(D+2,x)!==u)return g("closing tag mismatch");for(;x<N;x++)if(!(32===(b=e.charCodeAt(x))||b>8&&b<14))return g("close tag")}else{if(47===e.charCodeAt(N-1)?(u=w=e.substring(D+1,N-1),P=!0,T=!0):(u=w=e.substring(D+1,N),P=!0,T=!1),!(b>96&&b<123||b>64&&b<91||95===b||58===b))return g("illegal first char nodeName");for(x=1,d=u.length;x<d;x++)if(!((b=u.charCodeAt(x))>96&&b<123||b>64&&b<91||b>47&&b<59||45===b||95===b||46==b)){if(32===b||b<14&&b>8){w=u.substring(0,x),S=null;break}return g("invalid nodeName")}T||k.push(w)}if(f){if(a=C,P&&(T||R.push(a),null===S&&(m=-1!==u.indexOf("xmlns",x))&&(B=x,O=u,L(),m=!1)),_=w,-1!==(b=w.indexOf(":"))){if(!(E=C[w.substring(0,b)]))return g("missing namespace on <"+_+">");w=w.substr(b+1)}else E=C.xmlns;E&&(w=E+":"+w)}if(P&&(B=x,O=u,n&&(c?n(A,zt,T,h):n(w,L,zt,T,h),y)))return;if(T){if(i&&(i(c?A:w,zt,P,h),y))return;f&&(C=P?a:R.pop())}N+=1}else{if(-1===(N=e.indexOf("?>",D)))return g("unclosed question");if(s&&(s(e.substring(D,N+2),h),y))return;N+=2}else{if(91===(b=e.charCodeAt(D+2))&&"CDATA["===e.substr(D+3,6)){if(-1===(N=e.indexOf("]]>",D)))return g("unclosed cdata");if(r&&(r(e.substring(D+9,N),h),y))return;N+=3;continue}if(45===b&&45===e.charCodeAt(D+3)){if(-1===(N=e.indexOf("--\x3e",D)))return g("unclosed comment");if(o&&(o(e.substring(D+4,N),zt,h),y))return;N+=3;continue}if(-1===(N=e.indexOf(">",D+1)))return g("unclosed tag");if(l&&(l(e.substring(D,N+1),zt,h),y))return;N+=1}}}(e),h=Jt,y=!1,d},this.stop=function(){y=!0}}function tn(e){return e.xml&&"lowerCase"===e.xml.tagAlias}var nn={xsi:"http://www.w3.org/2001/XMLSchema-instance"},rn="xsi:type";function an(e){return e.xml&&e.xml.serialize}function on(e){return an(e)===rn}function sn(e,t){return tn(t)?e.prefix+":"+((n=e.localName).charAt(0).toUpperCase()+n.slice(1)):e.name;var n}function ln(e){return new Error(e)}function pn(e){return e.$descriptor}function cn(e){b(this,e),this.elementsById={},this.references=[],this.warnings=[],this.addReference=function(e){this.references.push(e)},this.addElement=function(e){if(!e)throw ln("expected element");var t,n=this.elementsById,i=pn(e).idProperty;if(i&&(t=e.get(i.name))){if(!/^([a-z][\w-.]*:)?[a-z_][\w-.]*$/i.test(t))throw new Error("illegal ID <"+t+">");if(n[t])throw ln("duplicate ID <"+t+">");n[t]=e}},this.addWarning=function(e){this.warnings.push(e)}}function un(){}function hn(){}function mn(){}function fn(e,t){this.property=e,this.context=t}function dn(e,t){this.element=t,this.propertyDesc=e}function yn(){}function gn(e,t,n){this.model=e,this.type=e.getType(t),this.context=n}function vn(e,t,n){gn.call(this,e,t,n)}function xn(e,t,n){this.model=e,this.context=n}function bn(e){e instanceof Lt&&(e={model:e}),b(this,{lax:!1},e)}un.prototype.handleEnd=function(){},un.prototype.handleText=function(){},un.prototype.handleNode=function(){},hn.prototype=Object.create(un.prototype),hn.prototype.handleNode=function(){return this},mn.prototype=Object.create(un.prototype),mn.prototype.handleText=function(e){this.body=(this.body||"")+e},fn.prototype=Object.create(mn.prototype),fn.prototype.handleNode=function(e){if(this.element)throw ln("expected no sub nodes");return this.element=this.createReference(e),this},fn.prototype.handleEnd=function(){this.element.id=this.body},fn.prototype.createReference=function(e){return{property:this.property.ns.name,id:""}},dn.prototype=Object.create(mn.prototype),dn.prototype.handleEnd=function(){var e=this.body||"",t=this.element,n=this.propertyDesc;e=Ct(n.type,e),n.isMany?t.get(n.name).push(e):t.set(n.name,e)},yn.prototype=Object.create(mn.prototype),yn.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},gn.prototype=Object.create(yn.prototype),gn.prototype.addReference=function(e){this.context.addReference(e)},gn.prototype.handleText=function(e){if(!pn(this.element).bodyProperty)throw ln("unexpected body text <"+e+">");mn.prototype.handleText.call(this,e)},gn.prototype.handleEnd=function(){var e=this.body,t=this.element,n=pn(t).bodyProperty;n&&void 0!==e&&(e=Ct(n.type,e),t.set(n.name,e))},gn.prototype.createElement=function(e){var t,n=e.attributes,i=this.type,r=pn(i),a=this.context,o=new i({}),s=this.model;return h(n,function(e,n){var i=r.propertiesByName[n];i&&i.isReference?i.isMany?h(e.split(" "),function(e){a.addReference({element:o,property:i.ns.name,id:e})}):a.addReference({element:o,property:i.ns.name,id:e}):(i?e=Ct(i.type,e):"xmlns"!==n&&(t=Pt(n,r.ns.prefix),s.getPackage(t.prefix)&&a.addWarning({message:"unknown attribute <"+n+">",element:o,property:n,value:e})),o.set(n,e))}),o},gn.prototype.getPropertyForNode=function(e){var t,n,i=Pt(e.name),r=this.type,a=this.model,o=pn(r),s=i.name,l=o.propertiesByName[s];if(l)return on(l)&&(t=e.attributes[rn])?(t=function(e,t){var n=Pt(e);return function(e,t){var n=e.name,i=e.localName,r=t.xml&&t.xml.typePrefix;return r&&0===i.indexOf(r)?e.prefix+":"+i.slice(r.length):n}(n,t.getPackage(n.prefix))}(t,a),b({},l,{effectiveType:pn(n=a.getType(t)).name})):l;var p=a.getPackage(i.prefix);if(p){if(t=sn(i,p),n=a.getType(t),l=c(o.properties,function(e){return!e.isVirtual&&!e.isReference&&!e.isAttribute&&n.hasType(e.type)}))return b({},l,{effectiveType:pn(n).name})}else if(l=c(o.properties,function(e){return!e.isReference&&!e.isAttribute&&"Element"===e.type}))return l;throw ln("unrecognized element <"+i.name+">")},gn.prototype.toString=function(){return"ElementDescriptor["+pn(this.type).name+"]"},gn.prototype.valueHandler=function(e,t){return new dn(e,t)},gn.prototype.referenceHandler=function(e){return new fn(e,this.context)},gn.prototype.handler=function(e){return"Element"===e?new xn(this.model,e,this.context):new gn(this.model,e,this.context)},gn.prototype.handleChild=function(e){var t,n,i,r;if(t=this.getPropertyForNode(e),i=this.element,Mt(n=t.effectiveType||t.type))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?(b(a,{element:i}),this.context.addReference(a)):a.$parent=i),r},vn.prototype=Object.create(gn.prototype),vn.prototype.createElement=function(e){var t=e.name,n=Pt(t),i=this.model,r=this.type,a=i.getPackage(n.prefix),o=a&&sn(n,a)||t;if(!r.hasType(o))throw ln("unexpected element <"+e.originalName+">");return gn.prototype.createElement.call(this,e)},xn.prototype=Object.create(yn.prototype),xn.prototype.createElement=function(e){var t=e.name,n=Pt(t).prefix,i=e.ns[n+"$uri"],r=e.attributes;return this.model.createAny(t,i,r)},xn.prototype.handleChild=function(e){var t=new xn(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},xn.prototype.handleEnd=function(){this.body&&(this.element.$body=this.body)},bn.prototype.fromXML=function(e,t,n){var i=t.rootHandler;t instanceof gn?(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 cn(b({},t,{rootHandler:i})),s=new en({proxy:!0}),l=function(){var e=[];return Object.defineProperty(e,"peek",{value:function(){return this[this.length-1]}}),e}();function p(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 l="unparsable content "+(s?s+" ":"")+"detected\n\tline: "+r+"\n\tcolumn: "+a+"\n\tnested error: "+e.message;if(n)return o.addWarning({message:l,error:e}),!0;throw ln(l)}function c(e,t){return p(e,t,!0)}i.context=o,l.push(i);var u=/^<\?xml /i,h=/ encoding="([^"]+)"/i,m=/^utf-8$/i;function f(e,t){try{l.peek().handleText(e)}catch(e){c(e,t)}}var d=r.getPackages().reduce(function(e,t){return e[t.uri]=t.prefix,e},{});s.ns(d).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=l.peek();try{l.push(n.handleNode(e))}catch(e){p(e,t,a)&&l.push(new hn)}}({name:e.name,originalName:e.originalName,attributes:o,ns:e.ns},i)}).on("question",function(e){if(u.test(e)){var t=h.exec(e),n=t&&t[1];n&&!m.test(n)&&o.addWarning({message:"unsupported document encoding <"+n+">, falling back to UTF-8"})}}).on("closeTag",function(){l.pop().handleEnd()}).on("cdata",f).on("text",function(e,t,n){!function(e,t){(e=e.trim())&&f(e,t)}(t(e),n)}).on("error",p).on("warn",c),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=pn(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 l=r.get(s.name),p=l.indexOf(t);-1===p&&(p=l.length),a?l[p]=a:l.splice(p,1)}else r.set(s.name,a)}}()}catch(e){t=e}var r=i.element;t||r||(t=ln("failed to parse document as <"+i.type.$descriptor.name+">")),n(t,t?void 0:r,o)},0)},bn.prototype.handler=function(e){return new vn(this.model,e)};var En='<?xml version="1.0" encoding="UTF-8"?>\n',wn=/<|>|'|"|&|\n\r|\n/g,_n=/<|>|&/g;function An(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]})}}function Sn(e,t){return tn(t)?(n=e).charAt(0).toLowerCase()+n.slice(1):e;var n}function Rn(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function Cn(e){return l(e)?e:(e.prefix?e.prefix+":":"")+e.localName}function kn(e){return function(e,t){var n=[];return h(e,function(e,i){n.push(t(e,i))}),n}(e.getUsed(),function(e){return{name:"xmlns"+(e.prefix?":"+e.prefix:""),value:e.uri}})}var Mn={"\n":"#10","\n\r":"#10",'"':"#34","'":"#39","<":"#60",">":"#62","&":"#38"},Pn={"<":"lt",">":"gt","&":"amp"};function Tn(e,t,n){return(e=l(e)?e:""+e).replace(t,function(e){return"&"+n[e]+";"})}function Dn(e){this.tagName=e}function Nn(){}function On(e){this.tagName=e}function Bn(e,t){this.body=[],this.attrs=[],this.parent=e,this.propertyDescriptor=t}function Ln(e,t){Bn.call(this,e,t)}function In(){this.value="",this.write=function(e){this.value+=e}}function Fn(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}}function jn(e){return e=b({format:!1,preamble:!0},e||{}),{toXML:function(t,n){var i=n||new In,r=new Fn(i,e.format);if(e.preamble&&r.append(En),(new Bn).build(t).serializeTo(r),!n)return i.value}}}function Vn(e,t){Lt.call(this,e,t)}Dn.prototype.build=function(e){return this.element=e,this},Dn.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"+this.element.id+"</"+this.tagName+">").appendNewLine()},Nn.prototype.serializeValue=Nn.prototype.serializeTo=function(e){e.append(this.escape?Tn(this.value,_n,Pn):this.value)},Nn.prototype.build=function(e,t){return this.value=t,"String"===e.type&&-1!==t.search(_n)&&(this.escape=!0),this},Rn(On,Nn),On.prototype.serializeTo=function(e){e.appendIndent().append("<"+this.tagName+">"),this.serializeValue(e),e.append("</"+this.tagName+">").appendNewLine()},Bn.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){return u(e.$descriptor.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(u(n,function(e){return e.isAttr})),this.parseContainments(function(e){return u(e,function(e){return!e.isAttr})}(n))),this.parseGenericAttributes(e,t),this},Bn.prototype.nsTagName=function(e){return function(e,t){return t.isGeneric?b({localName:t.ns.localName},e):b({localName:Sn(t.ns.localName,t.$pkg)},e)}(this.logNamespaceUsed(e.ns),e)},Bn.prototype.nsPropertyTagName=function(e){return function(e,t){return b({localName:t.ns.localName},e)}(this.logNamespaceUsed(e.ns),e)},Bn.prototype.isLocalNs=function(e){return e.uri===this.ns.uri},Bn.prototype.nsAttributeName=function(e){var t;if(t=l(e)?Pt(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}:b({localName:t.localName},n)},Bn.prototype.parseGeneric=function(e){var t=this,n=this.body,i=[];return h(e,function(r,a){"$body"===a?n.push((new Nn).build({type:"String"},r)):"$children"===a?h(r,function(e){n.push(new Bn(t).build(e))}):0!==a.indexOf("$")&&t.parseNsAttribute(e,a,r)&&i.push({name:a,value:r})}),i},Bn.prototype.parseNsAttribute=function(e,t,n){var i,r=e.$model,a=Pt(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)}},Bn.prototype.parseNsAttributes=function(e,t){var n=this,i=e.$attrs,r=[];return h(i,function(t,i){var a=n.parseNsAttribute(e,i,t);a&&r.push(a)}),r},Bn.prototype.parseGenericAttributes=function(e,t){var n=this;h(t,function(t){if(t.name!==rn)try{n.addAttribute(n.nsAttributeName(t.name),t.value)}catch(n){console.warn("missing namespace information for ",t.name,"=",t.value,"on",e,n)}})},Bn.prototype.parseContainments=function(e){var t=this,n=this.body,i=this.element;h(e,function(e){var r=i.get(e.name),a=e.isReference;if(e.isMany||(r=[r]),e.isBody)n.push((new Nn).build(e,r[0]));else if(Mt(e.type))h(r,function(i){n.push(new On(t.addTagName(t.nsPropertyTagName(e))).build(e,i))});else if(a)h(r,function(i){n.push(new Dn(t.addTagName(t.nsPropertyTagName(e))).build(i))});else{var o=on(e),s=function(e){return"property"===an(e)}(e);h(r,function(i){var r;r=o?new Ln(t,e):s?new Bn(t,e):new Bn(t),n.push(r.build(i))})}})},Bn.prototype.getNamespaces=function(e){var t,n=this.namespaces,i=this.parent;return n||(t=i&&i.getNamespaces(),e||!t?this.namespaces=n=new An(t):n=t),n},Bn.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},Bn.prototype.logNamespaceUsed=function(e,t){var n,i,r,a=this.element.$model,o=this.getNamespaces(t),s=e.prefix,l=e.uri;if(!s&&!l)return{localName:e.localName};if(r=nn[s]||a&&(a.getPackage(s)||{}).uri,!(l=l||r||o.uriByPrefix(s)))throw new Error("no namespace uri given for prefix <"+s+">");if(!(e=o.byUri(l))){for(n=s,i=1;o.uriByPrefix(n);)n=s+"_"+i++;e=this.logNamespace({prefix:n,uri:l},r===l)}return s&&o.mapPrefix(s,l),e},Bn.prototype.parseAttributes=function(e){var t=this,n=this.element;h(e,function(e){var i=n.get(e.name);if(e.isReference)if(e.isMany){var r=[];h(i,function(e){r.push(e.id)}),i=r.join(" ")}else i=i.id;t.addAttribute(t.nsAttributeName(e),i)})},Bn.prototype.addTagName=function(e){var t=this.logNamespaceUsed(e);return this.getNamespaces().logUsed(t),Cn(e)},Bn.prototype.addAttribute=function(e,t){var n=this.attrs;l(t)&&(t=Tn(t,wn,Mn)),n.push({name:e,value:t})},Bn.prototype.serializeAttributes=function(e){var t=this.attrs,n=this.namespaces;n&&(t=kn(n).concat(t)),h(t,function(t){e.append(" ").append(Cn(t.name)).append('="').append(t.value).append('"')})},Bn.prototype.serializeTo=function(e){var t=this.body[0],n=t&&t.constructor!==Nn;e.appendIndent().append("<"+this.tagName),this.serializeAttributes(e),e.append(t?">":" />"),t&&(n&&e.appendNewLine().indent(),h(this.body,function(t){t.serializeTo(e)}),n&&e.unindent().appendIndent(),e.append("</"+this.tagName+">")),e.appendNewLine()},Rn(Ln,Bn),Ln.prototype.parseNsAttributes=function(e){var t=Bn.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(rn),(i.prefix?i.prefix+":":"")+a+n.ns.localName),t},Ln.prototype.isLocalNs=function(e){return e.uri===(this.typeNs||this.ns).uri},Vn.prototype=Object.create(Lt.prototype),Vn.prototype.fromXML=function(e,t,n,i){l(t)||(i=n,n=t,t="bpmn:Definitions"),s(n)&&(i=n,n={});var r=new bn(b({model:this,lax:!0},n)),a=r.handler(t);r.fromXML(e,a,i)},Vn.prototype.toXML=function(e,t,n){s(t)&&(n=t,t={});var i,r,a=new jn(t);try{i=a.toXML(e)}catch(e){r=e}return n(r,i)};var Wn={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:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"messageFlowRefs",type:"MessageFlow",isMany:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0}]},{name:"GlobalConversation",superClass:["Collaboration"]},{name:"PartnerEntity",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"PartnerRole",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"participantRef",type:"Participant",isMany:!0,isReference:!0}]},{name:"CorrelationProperty",superClass:["RootElement"],properties:[{name:"correlationPropertyRetrievalExpression",type:"CorrelationPropertyRetrievalExpression",isMany:!0},{name:"name",isAttr:!0,type:"String"},{name:"type",type:"ItemDefinition",isAttr:!0,isReference:!0}]},{name:"Error",superClass:["RootElement"],properties:[{name:"structureRef",type:"ItemDefinition",isAttr:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"},{name:"errorCode",isAttr:!0,type:"String"}]},{name:"CorrelationKey",superClass:["BaseElement"],properties:[{name:"correlationPropertyRef",type:"CorrelationProperty",isMany:!0,isReference:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Expression",superClass:["BaseElement"],isAbstract:!1,properties:[{name:"body",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"}],superClass:["BaseElement"]},{name:"Collaboration",superClass:["RootElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"isClosed",isAttr:!0,type:"Boolean"},{name:"participants",type:"Participant",isMany:!0},{name:"messageFlows",type:"MessageFlow",isMany:!0},{name:"artifacts",type:"Artifact",isMany:!0},{name:"conversations",type:"ConversationNode",isMany:!0},{name:"conversationAssociations",type:"ConversationAssociation"},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0},{name:"messageFlowAssociations",type:"MessageFlowAssociation",isMany:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"choreographyRef",type:"Choreography",isMany:!0,isReference:!0},{name:"conversationLinks",type:"ConversationLink",isMany:!0}]},{name:"ChoreographyActivity",isAbstract:!0,superClass:["FlowNode"],properties:[{name:"participantRef",type:"Participant",isMany:!0,isReference:!0},{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0},{name:"correlationKeys",type:"CorrelationKey",isMany:!0},{name:"loopType",type:"ChoreographyLoopType",default:"None",isAttr:!0}]},{name:"CallChoreography",superClass:["ChoreographyActivity"],properties:[{name:"calledChoreographyRef",type:"Choreography",isAttr:!0,isReference:!0},{name:"participantAssociations",type:"ParticipantAssociation",isMany:!0}]},{name:"SubChoreography",superClass:["ChoreographyActivity","FlowElementsContainer"],properties:[{name:"artifacts",type:"Artifact",isMany:!0}]},{name:"ChoreographyTask",superClass:["ChoreographyActivity"],properties:[{name:"messageFlowRef",type:"MessageFlow",isMany:!0,isReference:!0}]},{name:"Choreography",superClass:["Collaboration","FlowElementsContainer"]},{name:"GlobalChoreographyTask",superClass:["Choreography"],properties:[{name:"initiatingParticipantRef",type:"Participant",isAttr:!0,isReference:!0}]},{name:"TextAnnotation",superClass:["Artifact"],properties:[{name:"text",type:"String"},{name:"textFormat",default:"text/plain",isAttr:!0,type:"String"}]},{name:"Group",superClass:["Artifact"],properties:[{name:"categoryValueRef",type:"CategoryValue",isAttr:!0,isReference:!0}]},{name:"Association",superClass:["Artifact"],properties:[{name:"associationDirection",type:"AssociationDirection",isAttr:!0},{name:"sourceRef",type:"BaseElement",isAttr:!0,isReference:!0},{name:"targetRef",type:"BaseElement",isAttr:!0,isReference:!0}]},{name:"Category",superClass:["RootElement"],properties:[{name:"categoryValue",type:"CategoryValue",isMany:!0},{name:"name",isAttr:!0,type:"String"}]},{name:"Artifact",isAbstract:!0,superClass:["BaseElement"]},{name:"CategoryValue",superClass:["BaseElement"],properties:[{name:"categorizedFlowElements",type:"FlowElement",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:"Integer",isAttr:!0}]},{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}],superClass:["BaseElement"]},{name:"ResourceAssignmentExpression",properties:[{name:"expression",type:"Expression",xml:{serialize:"xsi:type"}}],superClass:["BaseElement"]},{name:"Import",properties:[{name:"importType",isAttr:!0,type:"String"},{name:"location",isAttr:!0,type:"String"},{name:"namespace",isAttr:!0,type:"String"}]},{name:"Definitions",superClass:["BaseElement"],properties:[{name:"name",isAttr:!0,type:"String"},{name:"targetNamespace",isAttr:!0,type:"String"},{name:"expressionLanguage",default:"http://www.w3.org/1999/XPath",isAttr:!0,type:"String"},{name:"typeLanguage",default:"http://www.w3.org/2001/XMLSchema",isAttr:!0,type:"String"},{name:"imports",type:"Import",isMany:!0},{name:"extensions",type:"Extension",isMany:!0},{name:"rootElements",type:"RootElement",isMany:!0},{name:"diagrams",isMany:!0,type:"bpmndi:BPMNDiagram"},{name:"exporter",isAttr:!0,type:"String"},{name:"relationships",type:"Relationship",isMany:!0},{name:"exporterVersion",isAttr:!0,type:"String"}]}],enumerations:[{name:"ProcessType",literalValues:[{name:"None"},{name:"Public"},{name:"Private"}]},{name:"GatewayDirection",literalValues:[{name:"Unspecified"},{name:"Converging"},{name:"Diverging"},{name:"Mixed"}]},{name:"EventBasedGatewayType",literalValues:[{name:"Parallel"},{name:"Exclusive"}]},{name:"RelationshipDirection",literalValues:[{name:"None"},{name:"Forward"},{name:"Backward"},{name:"Both"}]},{name:"ItemKind",literalValues:[{name:"Physical"},{name:"Information"}]},{name:"ChoreographyLoopType",literalValues:[{name:"None"},{name:"Standard"},{name:"MultiInstanceSequential"},{name:"MultiInstanceParallel"}]},{name:"AssociationDirection",literalValues:[{name:"None"},{name:"One"},{name:"Both"}]},{name:"MultiInstanceBehavior",literalValues:[{name:"None"},{name:"One"},{name:"All"},{name:"Complex"}]},{name:"AdHocOrdering",literalValues:[{name:"Parallel"},{name:"Sequential"}]}],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:[]}};function zn(e,t){return new Vn(b({},Wn,e),t)}function Gn(e){return e?"<"+e.$type+(e.id?' id="'+e.id:"")+'" />':"<null>"}var Hn=new et({name:"bpmnElement",enumerable:!0},{name:"di",configurable:!0});function $n(e,t){return e.$instanceOf(t)}function Kn(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:Gn(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:Gn(n)})),console.error(e)}}function s(t,n){e.error(t,n)}function l(e){var n=e.bpmnElement;n?n.di?s(t("multiple DI elements defined for {element}",{element:Gn(n)}),{element:n}):(Hn.bind(n,"di"),n.di=e):s(t("no bpmnElement referenced in {element}",{element:Gn(e)}),{element:e})}function p(e){var t;l(t=e.plane),h(t.planeElement,m)}function m(e){l(e)}function f(){for(;i.length;)i.shift()()}function d(e,t){k(e,t),w(e.ioSpecification,t),E(e.artifacts,t),a(e)}function y(e,t){o(e,t)}function g(e,t){o(e,t)}function v(e,t){o(e,t)}function x(e,t){o(e,t)}function b(e,t){o(e,t)}function E(e,t){h(e,function(e){$n(e,"bpmn:Association")?i.push(function(){b(e,t)}):b(e,t)})}function w(e,t){e&&(h(e.dataInputs,r(v,t)),h(e.dataOutputs,r(x,t)))}function _(e,t){k(e,t),E(e.artifacts,t)}function A(e,t){var n=o(e,t);$n(e,"bpmn:SubProcess")&&_(e,n||t),$n(e,"bpmn:Activity")&&w(e.ioSpecification,t),i.push(function(){h(e.dataInputAssociations,r(g,t)),h(e.dataOutputAssociations,r(g,t))})}function S(e,t){o(e,t)}function R(e,t){i.push(function(){var n=o(e,t);e.childLaneSet&&C(e.childLaneSet,n||t),function(e){h(e.flowNodeRef,function(t){var n=t.get("lanes");n&&n.push(e)})}(e)})}function C(e,t){h(e.lanes,r(R,t))}function k(e,n){!function(e,n){h(e,function(e){$n(e,"bpmn:SequenceFlow")?i.push(function(){!function(e,t){o(e,t)}(e,n)}):$n(e,"bpmn:BoundaryEvent")?i.unshift(function(){A(e,n)}):$n(e,"bpmn:FlowNode")?A(e,n):$n(e,"bpmn:DataObject")||($n(e,"bpmn:DataStoreReference")?S(e,n):$n(e,"bpmn:DataObjectReference")?S(e,n):s(t("unrecognized flowElement {element} in context {context}",{element:Gn(e),context:n?Gn(n.businessObject):"null"}),{element:e,context:n}))})}(e.flowElements,n),e.laneSets&&function(e,t){h(e,r(C,t))}(e.laneSets,n)}function M(e,t){var n=o(e,t),i=e.processRef;i&&d(i,n||t)}return{handleDeferred:f,handleDefinitions:function(a,o){var m=a.diagrams;if(o&&-1===m.indexOf(o))throw new Error(t("diagram not part of bpmn:Definitions"));if(!o&&m&&m.length&&(o=m[0]),!o)throw new Error(t("no diagram to display"));p(o);var g=o.plane;if(!g)throw new Error(t("no plane for {element}",{element:Gn(o)}));var v=g.bpmnElement;if(!v){if(!(v=function(e){return c(e.rootElements,function(e){return $n(e,"bpmn:Process")||$n(e,"bpmn:Collaboration")})}(a)))throw new Error(t("no process or collaboration to display"));s(t("correcting missing bpmnElement on {plane} to {rootElement}",{plane:Gn(g),rootElement:Gn(v)})),g.bpmnElement=v,l(g)}var x,b=function(t,n){return e.root(t,n)}(v,g);if($n(v,"bpmn:Process"))d(v,b);else{if(!$n(v,"bpmn:Collaboration"))throw new Error(t("unsupported bpmnElement for {plane}: {rootElement}",{plane:Gn(g),rootElement:Gn(v)}));h((x=v).participants,r(M)),E(x.artifacts),i.push(function(){var e;h(x.messageFlows,r(y,e))}),function(e,t){u(e,function(e){return!n[e.id]&&$n(e,"bpmn:Process")&&e.laneSets}).forEach(r(d,t))}(a.rootElements,b)}f()},handleSubProcess:_,registerDi:l}}function Un(e,t){var n=qn(e);return n&&"function"==typeof n.$instanceOf&&n.$instanceOf(t)}function qn(e){return e&&e.businessObject||e}function Yn(e){return!Un(e,"bpmn:CallActivity")&&(Un(e,"bpmn:SubProcess")?!!qn(e).di.isExpanded:!Un(e,"bpmn:Participant")||!!qn(e).processRef)}function Xn(e){var t=e.businessObject,n=function(e){return Un(e,"bpmn:FlowElement")||Un(e,"bpmn:Participant")||Un(e,"bpmn:Lane")||Un(e,"bpmn:SequenceFlow")||Un(e,"bpmn:MessageFlow")||Un(e,"bpmn:DataInput")||Un(e,"bpmn:DataOutput")?"name":Un(e,"bpmn:TextAnnotation")?"text":Un(e,"bpmn:Group")?"categoryValueRef":void 0}(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function Zn(e,t,n){return function(e,t){return!!c(e,t)}(e.eventDefinitions,function(i){return i.$type===t&&function(e,t){return f(t,function(t,n){return e[n]==t})}(e,n)})}function Jn(e){return e.businessObject.di}function Qn(e){return e.businessObject}function ei(e,t){return Jn(e).get("bioc:fill")||t||"white"}function ti(e,t){return Jn(e).get("bioc:stroke")||t||"black"}var ni=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var i=Math.log(Math.pow(2,e))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var a=i-Math.floor(i),o="";for(r=0;r<Math.floor(i);r++){o=Math.floor(Math.random()*n).toString(n)+o}if(a){var s=Math.pow(n,a);o=Math.floor(Math.random()*s).toString(n)+o}var l=parseInt(o,n);return l!==1/0&&l>=Math.pow(2,e)?t(e,n):o};t.rack=function(e,n,i){var r=function(r){var o=0;do{if(o++>10){if(!i)throw new Error("too many ID collisions, use more bits");e+=i}var s=t(e,n)}while(Object.hasOwnProperty.call(a,s));return a[s]=r,s},a=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}});function ii(e){if(!(this instanceof ii))return new ii(e);e=e||[128,36,1],this._seed=e.length?ni.rack(e[0],e[1],e[2]):e}ii.prototype.next=function(e){return this._seed(e||!0)},ii.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},ii.prototype.claim=function(e,t){this._seed.set(e,t||!0)},ii.prototype.assigned=function(e){return this._seed.get(e)||!1},ii.prototype.unclaim=function(e){delete this._seed.hats[e]},ii.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var ri=new ii,ai=10,oi=3,si=.95,li=.35;function pi(e,t,n,i,r,o,s){Oe.call(this,t,s);var l=e&&e.defaultFillColor,p=e&&e.defaultStrokeColor,c=ri.next(),u={},m=n.computeStyle;function f(e,t){var n=b({fill:"black",strokeWidth:1,strokeLinecap:"round",strokeDasharray:"none"},t.attrs),i=t.ref||{x:0,y:0},a=t.scale||1;"none"===n.strokeDasharray&&(n.strokeDasharray=[1e4,1]);var o=pe("marker");J(t.element,n),q(o,t.element),J(o,{id:e,viewBox:"0 0 20 20",refX:i.x,refY:i.y,markerWidth:20*a,markerHeight:20*a,orient:"auto"});var s=$("defs",r._svg);s||(s=pe("defs"),q(r._svg,s)),q(s,o),u[e]=o}function d(e){return e.replace(/[()\s,#]+/g,"_")}function y(e,t,n){var i=e+"-"+d(t)+"-"+d(n)+"-"+c;return u[i]||function(e,t,n,i){if("sequenceflow-end"===t){var r=pe("path");J(r,{d:"M 1 5 L 11 10 L 1 15 Z"}),f(e,{element:r,ref:{x:11,y:10},scale:.5,attrs:{fill:i,stroke:i}})}if("messageflow-start"===t){var a=pe("circle");J(a,{cx:6,cy:6,r:3.5}),f(e,{element:a,attrs:{fill:n,stroke:i},ref:{x:6,y:6}})}if("messageflow-end"===t){var o=pe("path");J(o,{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z"}),f(e,{element:o,attrs:{fill:n,stroke:i,strokeLinecap:"butt"},ref:{x:8.5,y:5}})}if("association-start"===t){var s=pe("path");J(s,{d:"M 11 5 L 1 10 L 11 15"}),f(e,{element:s,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:1,y:10},scale:.5})}if("association-end"===t){var l=pe("path");J(l,{d:"M 1 5 L 11 10 L 1 15"}),f(e,{element:l,attrs:{fill:"none",stroke:i,strokeWidth:1.5},ref:{x:12,y:10},scale:.5})}if("conditional-flow-marker"===t){var p=pe("path");J(p,{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z"}),f(e,{element:p,attrs:{fill:n,stroke:i},ref:{x:-1,y:10},scale:.5})}if("conditional-default-flow-marker"===t){var c=pe("path");J(c,{d:"M 6 4 L 10 16"}),f(e,{element:c,attrs:{stroke:i},ref:{x:0,y:10},scale:.5})}}(i,e,t,n),"url(#"+i+")"}function g(e,t,n,i,r){a(i)&&(r=i,i=0),i=i||0,"none"===(r=m(r,{stroke:"black",strokeWidth:2,fill:"white"})).fill&&delete r.fillOpacity;var o=t/2,s=n/2,l=pe("circle");return J(l,{cx:o,cy:s,r:Math.round((t+n)/4-i)}),J(l,r),q(e,l),l}function v(e,t,n,i,r,o){a(r)&&(o=r,r=0),r=r||0,o=m(o,{stroke:"black",strokeWidth:2,fill:"white"});var s=pe("rect");return J(s,{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i}),J(s,o),q(e,s),s}function x(e,t,n){var i=Ie(t,n=m(n,["no-fill"],{stroke:"black",strokeWidth:2,fill:"none"}));return q(e,i),i}function E(e,t,n){n=m(n,["no-fill"],{strokeWidth:2,stroke:"black"});var i=pe("path");return J(i,{d:t}),J(i,n),q(e,i),i}function w(e,t,n,i){return E(t,n,b({"data-marker":e},i))}function _(e){return function(t,n){return P[e](t,n)}}function A(e){return P[e]}function S(e,t){var n=Qn(e),i=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(n);return n.eventDefinitions&&n.eventDefinitions.length>1?n.parallelMultiple?A("bpmn:ParallelMultipleEventDefinition")(t,e,i):A("bpmn:MultipleEventDefinition")(t,e,i):Zn(n,"bpmn:MessageEventDefinition")?A("bpmn:MessageEventDefinition")(t,e,i):Zn(n,"bpmn:TimerEventDefinition")?A("bpmn:TimerEventDefinition")(t,e,i):Zn(n,"bpmn:ConditionalEventDefinition")?A("bpmn:ConditionalEventDefinition")(t,e):Zn(n,"bpmn:SignalEventDefinition")?A("bpmn:SignalEventDefinition")(t,e,i):Zn(n,"bpmn:EscalationEventDefinition")?A("bpmn:EscalationEventDefinition")(t,e,i):Zn(n,"bpmn:LinkEventDefinition")?A("bpmn:LinkEventDefinition")(t,e,i):Zn(n,"bpmn:ErrorEventDefinition")?A("bpmn:ErrorEventDefinition")(t,e,i):Zn(n,"bpmn:CancelEventDefinition")?A("bpmn:CancelEventDefinition")(t,e,i):Zn(n,"bpmn:CompensateEventDefinition")?A("bpmn:CompensateEventDefinition")(t,e,i):Zn(n,"bpmn:TerminateEventDefinition")?A("bpmn:TerminateEventDefinition")(t,e,i):null}function R(e,t,n){n=b({size:{width:100}},n);var i=o.createText(t||"",n);return ie(i).add("djs-label"),q(e,i),i}function C(e,t,n){return R(e,Qn(t).name,{box:t,align:n,padding:5,style:{fill:ti(t,p)}})}function k(e,t,n){!function(e,t,n,i,r){var a=he();a.setTranslate(t,n);var o=he();o.setRotate(i,0,0);var s=he();s.setScale(r||1,r||1),Ee(e,[a,o,s])}(R(e,t,{box:{height:30,width:n.height},align:"center-middle",style:{fill:ti(n,p)}}),0,-(-1*n.height),270)}function M(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 P=this.handlers={"bpmn:Event":function(e,t,n){return"fillOpacity"in n||(n.fillOpacity=si),g(e,t.width,t.height,n)},"bpmn:StartEvent":function(e,t){var n={fill:ei(t,l),stroke:ti(t,p)};Qn(t).isInterrupting||(n={strokeDasharray:"6",strokeLinecap:"round",fill:ei(t,l),stroke:ti(t,p)});var i=A("bpmn:Event")(e,t,n);return S(t,e),i},"bpmn:MessageEventDefinition":function(e,t,n){return E(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.235,my:.315}}),{strokeWidth:1,fill:n?ti(t,p):ei(t,l),stroke:n?ei(t,l):ti(t,p)})},"bpmn:TimerEventDefinition":function(e,t){var n=g(e,t.width,t.height,.2*t.height,{strokeWidth:2,fill:ei(t,l),stroke:ti(t,p)});E(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:ti(t,p)});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;E(e,a,{strokeWidth:1,strokeLinecap:"square",transform:"rotate("+30*r+","+t.height/2+","+o+")",stroke:ti(t,p)})}return n},"bpmn:EscalationEventDefinition":function(e,t,n){return E(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?ti(t,p):"none",stroke:ti(t,p)})},"bpmn:ConditionalEventDefinition":function(e,t){return E(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.222}}),{strokeWidth:1,stroke:ti(t,p)})},"bpmn:LinkEventDefinition":function(e,t,n){return E(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{strokeWidth:1,fill:n?ti(t,p):"none",stroke:ti(t,p)})},"bpmn:ErrorEventDefinition":function(e,t,n){return E(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?ti(t,p):"none",stroke:ti(t,p)})},"bpmn:CancelEventDefinition":function(e,t,n){var r=E(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?ti(t,p):"none",stroke:ti(t,p)});return function(e,t){var n=he();n.setRotate(t,0,0),Ee(e,n)}(r,45),r},"bpmn:CompensateEventDefinition":function(e,t,n){return E(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.22,my:.5}}),{strokeWidth:1,fill:n?ti(t,p):"none",stroke:ti(t,p)})},"bpmn:SignalEventDefinition":function(e,t,n){return E(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:t.width,containerHeight:t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:n?ti(t,p):"none",stroke:ti(t,p)})},"bpmn:MultipleEventDefinition":function(e,t,n){return E(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?ti(t,p):"none"})},"bpmn:ParallelMultipleEventDefinition":function(e,t){return E(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:ti(t,p),stroke:ti(t,p)})},"bpmn:EndEvent":function(e,t){var n=A("bpmn:Event")(e,t,{strokeWidth:4,fill:ei(t,l),stroke:ti(t,p)});return S(t,e),n},"bpmn:TerminateEventDefinition":function(e,t){return g(e,t.width,t.height,8,{strokeWidth:4,fill:ti(t,p),stroke:ti(t,p)})},"bpmn:IntermediateEvent":function(e,t){var n=A("bpmn:Event")(e,t,{strokeWidth:1,fill:ei(t,l),stroke:ti(t,p)});return g(e,t.width,t.height,oi,{strokeWidth:1,fill:ei(t,"none"),stroke:ti(t,p)}),S(t,e),n},"bpmn:IntermediateCatchEvent":_("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":_("bpmn:IntermediateEvent"),"bpmn:Activity":function(e,t,n){return"fillOpacity"in(n=n||{})||(n.fillOpacity=si),v(e,t.width,t.height,ai,n)},"bpmn:Task":function(e,t){var n={fill:ei(t,l),stroke:ti(t,p)},i=A("bpmn:Activity")(e,t,n);return C(e,t,"center-middle"),T(e,t),i},"bpmn:ServiceTask":function(e,t){var n=A("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{strokeWidth:1,fill:ei(t,l),stroke:ti(t,p)}),E(e,i.getScaledPath("TASK_TYPE_SERVICE_FILL",{abspos:{x:17.2,y:18}}),{strokeWidth:0,fill:ei(t,l)}),E(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{strokeWidth:1,fill:ei(t,l),stroke:ti(t,p)}),n},"bpmn:UserTask":function(e,t){var n=A("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:ei(t,l),stroke:ti(t,p)}),E(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:ei(t,l),stroke:ti(t,p)}),E(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{strokeWidth:.5,fill:ti(t,p),stroke:ti(t,p)}),n},"bpmn:ManualTask":function(e,t){var n=A("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{strokeWidth:.5,fill:ei(t,l),stroke:ti(t,p)}),n},"bpmn:SendTask":function(e,t){var n=A("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{strokeWidth:1,fill:ti(t,p),stroke:ei(t,l)}),n},"bpmn:ReceiveTask":function(e,t){var n,r=Qn(t),a=A("bpmn:Task")(e,t);return r.instantiate?(g(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}}),E(e,n,{strokeWidth:1,fill:ei(t,l),stroke:ti(t,p)}),a},"bpmn:ScriptTask":function(e,t){var n=A("bpmn:Task")(e,t);return E(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{strokeWidth:1,stroke:ti(t,p)}),n},"bpmn:BusinessRuleTask":function(e,t){var n=A("bpmn:Task")(e,t);return J(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{strokeWidth:1,fill:ei(t,"#aaaaaa"),stroke:ti(t,p)}),J(E(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{strokeWidth:1,stroke:ti(t,p)}),n},"bpmn:SubProcess":function(e,t,n){n=b({fill:ei(t,l),stroke:ti(t,p)},n);var i=A("bpmn:Activity")(e,t,n),r=Yn(t);return function(e){return e&&!!qn(e).triggeredByEvent}(t)&&J(i,{strokeDasharray:"1,2"}),C(e,t,r?"center-top":"center-middle"),r?T(e,t):T(e,t,["SubProcessMarker"]),i},"bpmn:AdHocSubProcess":function(e,t){return A("bpmn:SubProcess")(e,t)},"bpmn:Transaction":function(e,t){var i=A("bpmn:SubProcess")(e,t),r=n.style(["no-fill","no-events"],{stroke:ti(t,p)});return v(e,t.width,t.height,ai-2,oi,r),i},"bpmn:CallActivity":function(e,t){return A("bpmn:SubProcess")(e,t,{strokeWidth:5})},"bpmn:Participant":function(e,t){var n={fillOpacity:si,fill:ei(t,l),stroke:ti(t,p)},i=A("bpmn:Lane")(e,t,n);Yn(t)?(x(e,[{x:30,y:0},{x:30,y:t.height}],{stroke:ti(t,p)}),k(e,Qn(t).name,t)):R(e,Qn(t).name,{box:t,align:"center-middle",style:{fill:ti(t,p)}});return!!Qn(t).participantMultiplicity&&A("ParticipantMultiplicityMarker")(e,t),i},"bpmn:Lane":function(e,t,n){var i=v(e,t.width,t.height,0,b({fill:ei(t,l),fillOpacity:li,stroke:ti(t,p)},n)),r=Qn(t);"bpmn:Lane"===r.$type&&k(e,r.name,t);return i},"bpmn:InclusiveGateway":function(e,t){var n=A("bpmn:Gateway")(e,t);return g(e,t.width,t.height,.24*t.height,{strokeWidth:2.5,fill:ei(t,l),stroke:ti(t,p)}),n},"bpmn:ExclusiveGateway":function(e,t){var n=A("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 Jn(t).isMarkerVisible&&E(e,r,{strokeWidth:1,fill:ti(t,p),stroke:ti(t,p)}),n},"bpmn:ComplexGateway":function(e,t){var n=A("bpmn:Gateway")(e,t);return E(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{strokeWidth:1,fill:ti(t,p),stroke:ti(t,p)}),n},"bpmn:ParallelGateway":function(e,t){var n=A("bpmn:Gateway")(e,t);return E(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{strokeWidth:1,fill:ti(t,p),stroke:ti(t,p)}),n},"bpmn:EventBasedGateway":function(e,t){var n=Qn(t),r=A("bpmn:Gateway")(e,t);g(e,t.width,t.height,.2*t.height,{strokeWidth:1,fill:"none",stroke:ti(t,p)});var a=n.eventGatewayType,o=!!n.instantiate;if("Parallel"===a){var s=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});J(E(e,s),{strokeWidth:1,fill:"none"})}else if("Exclusive"===a){if(!o)J(g(e,t.width,t.height,.26*t.height),{strokeWidth:1,fill:"none",stroke:ti(t,p)});!function(){var n=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}}),r={strokeWidth:2,fill:ei(t,"none"),stroke:ti(t,p)};E(e,n,r)}()}return r},"bpmn:Gateway":function(e,t){var n={fill:ei(t,l),fillOpacity:si,stroke:ti(t,p)};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=m(i,{stroke:"black",strokeWidth:2,fill:"white"});var s=pe("polygon");return J(s,{points:o}),J(s,i),q(e,s),s}(e,t.width,t.height,n)},"bpmn:SequenceFlow":function(e,t){var n,i=M(t),r=ei(t,l),a=ti(t,p),o=E(e,i,{strokeLinejoin:"round",markerEnd:y("sequenceflow-end",r,a),stroke:ti(t,p)}),s=Qn(t);return t.source&&(n=t.source.businessObject,s.conditionExpression&&n.$instanceOf("bpmn:Activity")&&J(o,{markerStart:y("conditional-flow-marker",r,a)}),n.default&&(n.$instanceOf("bpmn:Gateway")||n.$instanceOf("bpmn:Activity"))&&n.default===s&&J(o,{markerStart:y("conditional-default-flow-marker",r,a)})),o},"bpmn:Association":function(e,t,n){var i=Qn(t),r=ei(t,l),a=ti(t,p);return n=b({strokeDasharray:"0.5, 5",strokeLinecap:"round",strokeLinejoin:"round",stroke:ti(t,p)},n||{}),"One"!==i.associationDirection&&"Both"!==i.associationDirection||(n.markerEnd=y("association-end",r,a)),"Both"===i.associationDirection&&(n.markerStart=y("association-start",r,a)),x(e,t.waypoints,n)},"bpmn:DataInputAssociation":function(e,t){var n=ei(t,l),i=ti(t,p);return A("bpmn:Association")(e,t,{markerEnd:y("association-end",n,i)})},"bpmn:DataOutputAssociation":function(e,t){var n=ei(t,l),i=ti(t,p);return A("bpmn:Association")(e,t,{markerEnd:y("association-end",n,i)})},"bpmn:MessageFlow":function(e,t){var n=Qn(t),r=Jn(t),a=ei(t,l),o=ti(t,p),s=E(e,M(t),{markerEnd:y("messageflow-end",a,o),markerStart:y("messageflow-start",a,o),strokeDasharray:"10, 12",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5px",stroke:ti(t,p)});if(n.messageRef){var c=s.getPointAtLength(s.getTotalLength()/2),u=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:c.x,y:c.y}}),h={strokeWidth:1};"initiating"===r.messageVisibleKind?(h.fill="white",h.stroke="black"):(h.fill="#888",h.stroke="white"),E(e,u,h)}return s},"bpmn:DataObject":function(e,t){var n=E(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:ei(t,l),fillOpacity:si,stroke:ti(t,p)});return function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection}(Qn(t))&&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}});E(e,r,{strokeWidth:2})}(e,t),n},"bpmn:DataObjectReference":_("bpmn:DataObject"),"bpmn:DataInput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=A("bpmn:DataObject")(e,t);return E(e,n,{strokeWidth:1}),r},"bpmn:DataOutput":function(e,t){var n=i.getRawPath("DATA_ARROW"),r=A("bpmn:DataObject")(e,t);return E(e,n,{strokeWidth:1,fill:"black"}),r},"bpmn:DataStoreReference":function(e,t){return E(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{strokeWidth:2,fill:ei(t,l),fillOpacity:si,stroke:ti(t,p)})},"bpmn:BoundaryEvent":function(e,t){var n=Qn(t).cancelActivity,i={strokeWidth:1,fill:ei(t,l),stroke:ti(t,p)};n||(i.strokeDasharray="6",i.strokeLinecap="round");var r=b({},i,{fillOpacity:1}),a=b({},i,{fill:"none"}),o=A("bpmn:Event")(e,t,r);return g(e,t.width,t.height,oi,a),S(t,e),o},"bpmn:Group":function(e,t){return v(e,t.width,t.height,ai,{strokeWidth:1,strokeDasharray:"8,3,1,3",fill:"none",pointerEvents:"none"})},label:function(e,t){return function(e,t){var n={width:90,height:30,x:t.width/2+t.x,y:t.height/2+t.y};return R(e,Xn(t),{box:n,fitBox:!0,style:b({},o.getExternalStyle(),{fill:ti(t,p)})})}(e,t)},"bpmn:TextAnnotation":function(e,t){var n=v(e,t.width,t.height,0,0,{fill:"none",stroke:"none"});return E(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:0}}),{stroke:ti(t,p)}),R(e,Qn(t).text||"",{box:t,align:"left-top",padding:5,style:{fill:ti(t,p)}}),n},ParticipantMultiplicityMarker:function(e,t){w("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}}),{strokeWidth:1,fill:ei(t,l),stroke:ti(t,p)})},SubProcessMarker:function(e,t){gt(v(e,14,14,0,{strokeWidth:1,fill:ei(t,l),stroke:ti(t,p)}),t.width/2-7.5,t.height-20),w("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:ei(t,l),stroke:ti(t,p)})},ParallelMarker:function(e,t,n){w("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}}),{fill:ei(t,l),stroke:ti(t,p)})},SequentialMarker:function(e,t,n){w("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}}),{fill:ei(t,l),stroke:ti(t,p)})},CompensationMarker:function(e,t,n){w("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,fill:ei(t,l),stroke:ti(t,p)})},LoopMarker:function(e,t,n){w("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:ei(t,l),stroke:ti(t,p),strokeLinecap:"round",strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){w("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:ti(t,p),stroke:ti(t,p)})}};function T(e,t,n){var i,r=Qn(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},h(n,function(n){A(n)(e,t,i)}),r.isForCompensation&&A("CompensationMarker")(e,t,i),"bpmn:AdHocSubProcess"===r.$type&&A("AdhocMarker")(e,t,i);var o=r.loopCharacteristics,s=o&&o.isSequential;o&&(void 0===s&&A("LoopMarker")(e,t,i),!1===s&&A("ParallelMarker")(e,t,i),!0===s&&A("SequentialMarker")(e,t,i))}this._drawPath=E}e(pi,Oe),pi.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],pi.prototype.canRender=function(e){return Un(e,"bpmn:BaseElement")},pi.prototype.drawShape=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},pi.prototype.drawConnection=function(e,t){var n=t.type;return(0,this.handlers[n])(e,t)},pi.prototype.getShapePath=function(e){return Un(e,"bpmn:Event")?(n=(t=e).x+t.width/2,i=t.y+t.height/2,r=t.width/2,Be([["M",n,i],["m",0,-r],["a",r,r,0,1,1,0,2*r],["a",r,r,0,1,1,0,-2*r],["z"]])):Un(e,"bpmn:Activity")?function(e,t){var n=e.x,i=e.y,r=e.width,a=e.height;return Be([["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"]])}(e,ai):Un(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return Be([["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]])}(e):function(e){var t=e.x,n=e.y,i=e.width;return Be([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e);var t,n,i,r};var ci=0,ui={width:150,height:50};function hi(e,t){var n;t.textContent=e;try{var i,r=""===e;return t.textContent=r?"dummy":e,i={width:(n=t.getBBox()).width+2*n.x,height:n.height},r&&(i.width=0),i}catch(e){return{width:0,height:0}}}function mi(e,t,n){for(var i,r=e.shift(),a=r;;){if((i=hi(a,n)).width=a?i.width:0," "===a||""===a||i.width<Math.round(t)||a.length<2)return fi(e,a,r,i);a=di(a,i.width,t)}}function fi(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 di(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 yi(e){this._config=b({},{size:ui,padding:ci,style:{},align:"center-top"},e||{})}yi.prototype.createText=function(e,t){return this.layoutText(e,t).element},yi.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},yi.prototype.layoutText=function(e,t){var n=b({},this._config.size,t.box),i=b({},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),o=function(e){return a(e)?b({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),s=t.fitBox||!1,l=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),p=e.split(/\r?\n/g),c=[],u=n.width-o.left-o.right,f=pe("text");for(J(f,{x:0,y:0}),J(f,i),q(function(){var e=document.getElementById("helper-svg");return e||(J(e=pe("svg"),{id:"helper-svg",width:0,height:0,style:"visibility: hidden; position: fixed"}),document.body.appendChild(e)),e}(),f);p.length;)c.push(mi(p,u,f));"middle"===r.vertical&&(o.top=o.bottom=0);var d=m(c,function(e,t,n){return e+(l||t.height)},0)+o.top+o.bottom,y=m(c,function(e,t,n){return t.width>e?t.width:e},0),g=o.top;"middle"===r.vertical&&(g+=(n.height-d)/2),g-=(l||c[0].height)/4;var v=pe("text");return J(v,i),h(c,function(e){var t;switch(g+=l||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(s?y:u)-o.right-e.width;break;default:t=Math.max(((s?y:u)-e.width)/2+o.left,0)}var n=pe("tspan");J(n,{x:t,y:g}),n.textContent=e.text,q(v,n)}),ae(f),{dimensions:{width:y,height:d},element:v}};var gi=12,vi=1.2,xi=30;function bi(e){var t=b({fontFamily:"Arial, sans-serif",fontSize:gi,fontWeight:"normal",lineHeight:vi},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=b({},t,{fontSize:n},e&&e.externalStyle||{}),r=new yi({style:t});this.getExternalLabelBounds=function(e,t){var n=r.getDimensions(t,{box:{width:90,height:30,x:e.width/2+e.x,y:e.height/2+e.y},style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:Math.round(e.y),width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=r.getDimensions(n,{box:e,style:t,align:"left-top",padding:5});return{x:e.x,y:e.y,width:e.width,height:Math.max(xi,Math.round(i.height))}},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}bi.$inject=["config.textRenderer"];var Ei=/\{([^}]+)\}/g,wi=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var _i={__init__:["bpmnRenderer"],bpmnRenderer:["type",pi],textRenderer:["type",bi],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m {mx}, {my} m 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 l=t.containerHeight/r.height*t.yScaleFactor,p=t.containerWidth/r.width*t.xScaleFactor,c=0;c<r.heightElements.length;c++)s["y"+c]=r.heightElements[c]*l;for(var u=0;u<r.widthElements.length;u++)s["x"+u]=r.widthElements[u]*p}return a=r.d,o={mx:n,my:i,e:s},String(a).replace(Ei,function(e,t){return function(e,t,n){var i=n;return t.replace(wi,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)})}}]};var Ai={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||"{"+n+"}"})}]},Si={width:90,height:20},Ri=15;function Ci(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(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}}(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-=Ri:o+=Ri,{x:o,y:s}}function ki(e,t){var n,i,r,a=e.di.label;return a&&a.bounds?(r=a.bounds,i={width:Math.max(Si.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=function(e){return e.waypoints?Ci(e.waypoints):Un(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Si.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Si.height/2}}(t),i=Si),b({x:n.x-i.width/2,y:n.y-i.height/2},i)}
3/**
4 * This file contains portions that got extraced from Snap.svg (licensed Apache-2.0).
5 *
6 * @see https://github.com/adobe-webplatform/Snap.svg/blob/master/src/path.js
7 */Math.PI;function Mi(e){return t={x:e.x+(e.width||0)/2,y:e.y+(e.height||0)/2},{x:Math.round(t.x),y:Math.round(t.y)};var t}function Pi(e,t){return b({id:e.id,type:e.$type,businessObject:e},t)}function Ti(e,t,n){var i=e.di.waypoint;return!i||i.length<2?[Mi(t),Mi(n)]:i.map(function(e){return{x:e.x,y:e.y}})}function Di(e,t,n,i){return new Error(e("element {element} referenced by {referenced}#{property} not yet drawn",{element:Gn(n),referenced:Gn(t),property:i}))}function Ni(e,t,n,i,r,a){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._translate=r,this._textRenderer=a}Ni.$inject=["eventBus","canvas","elementFactory","elementRegistry","translate","textRenderer"],Ni.prototype.add=function(e,t){var n,i,r,a,o,s,l,p=e.di,c=this._translate;if(Un(p,"bpmndi:BPMNPlane"))n=this._elementFactory.createRoot(Pi(e)),this._canvas.setRootElement(n);else if(Un(p,"bpmndi:BPMNShape")){var u=!Yn(e);i=t&&(t.hidden||t.collapsed);var h=e.di.bounds;n=this._elementFactory.createShape(Pi(e,{collapsed:u,hidden:i,x:Math.round(h.x),y:Math.round(h.y),width:Math.round(h.width),height:Math.round(h.height)})),Un(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,n),Un(e,"bpmn:Lane")&&(r=0),Un(e,"bpmn:DataStoreReference")&&(a=t,o=Mi(h),s=o.x,l=o.y,s>=a.x&&s<=a.x+a.width&&l>=a.y&&l<=a.y+a.height||(t=this._canvas.getRootElement())),this._canvas.addShape(n,t,r)}else{if(!Un(p,"bpmndi:BPMNEdge"))throw new Error(c("unknown di {di} for element {semantic}",{di:Gn(p),semantic:Gn(e)}));var m=this._getSource(e),f=this._getTarget(e);i=t&&(t.hidden||t.collapsed),n=this._elementFactory.createConnection(Pi(e,{hidden:i,source:m,target:f,waypoints:Ti(e,m,f)})),Un(e,"bpmn:DataAssociation")&&(t=null),Un(e,"bpmn:SequenceFlow")&&(r=0),this._canvas.addConnection(n,t,r)}return function(e){return Un(e,"bpmn:Event")||Un(e,"bpmn:Gateway")||Un(e,"bpmn:DataStoreReference")||Un(e,"bpmn:DataObjectReference")||Un(e,"bpmn:DataInput")||Un(e,"bpmn:DataOutput")||Un(e,"bpmn:SequenceFlow")||Un(e,"bpmn:MessageFlow")||Un(e,"bpmn:Group")}(e)&&Xn(n)&&this.addLabel(e,n),this._eventBus.fire("bpmnElement.added",{element:n}),n},Ni.prototype._attachBoundary=function(e,t){var n=this._translate,i=e.attachedToRef;if(!i)throw new Error(n("missing {semantic}#attachedToRef",{semantic:Gn(e)}));var r=this._elementRegistry.get(i.id),a=r&&r.attachers;if(!r)throw Di(n,e,i,"attachedToRef");t.host=r,a||(r.attachers=a=[]),-1===a.indexOf(t)&&a.push(t)},Ni.prototype.addLabel=function(e,t){var n,i,r;return n=ki(e,t),(i=Xn(t))&&(n=this._textRenderer.getExternalLabelBounds(n,i)),r=this._elementFactory.createLabel(Pi(e,{id:e.id+"_label",labelTarget:t,type:"label",hidden:t.hidden||!Xn(t),x:Math.round(n.x),y:Math.round(n.y),width:Math.round(n.width),height:Math.round(n.height)})),this._canvas.addShape(r,t.parent)},Ni.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?Di(a,e,i,t+"Ref"):new Error(a("{semantic}#{side} Ref not specified",{semantic:Gn(e),side:t}))},Ni.prototype._getSource=function(e){return this._getEnd(e,"source")},Ni.prototype._getTarget=function(e){return this._getEnd(e,"target")},Ni.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var Oi={__depends__:[_i,{__depends__:[Ai],bpmnImporter:["type",Ni]}]};function Bi(e){return e.originalEvent||e.srcEvent}function Li(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function Ii(e){return!(Bi(e)||e).button}function Fi(e){var t=Bi(e)||e;return!!Ii(e)&&(/mac/i.test(navigator.platform)?t.metaKey:t.ctrlKey)}function ji(e){return!0}var Vi=500;function Wi(e,t,n){var i=this;function r(n,i,r){var a,o;(function(e,t){return!(l[e]||Ii)(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={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},l={"element.contextmenu":ji};var p="svg, .djs-element";function c(e,t,n,i){var o=a[n]=function(e){r(n,e)};i&&(l[n]=i),o.$delegate=F.bind(e,p,t,o)}function u(e,t,n){var i=o(n);i&&F.unbind(e,t,i.$delegate)}e.on("canvas.destroy",function(e){var t;t=e.svg,h(s,function(e,n){u(t,n,e)})}),e.on("canvas.init",function(e){var t;t=e.svg,h(s,function(e,n){c(t,n,e)})}),e.on(["shape.added","connection.added"],function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})}),e.on(["shape.changed","connection.changed"],Vi,function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})}),e.on("interactionEvents.createHit",Vi,function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)}),e.on("interactionEvents.updateHit",function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)});var m=y("djs-hit djs-hit-stroke"),f=y("djs-hit djs-hit-click-stroke"),d={all:y("djs-hit djs-hit-all"),"click-stroke":f,stroke:m};function y(e,t){return t=b({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function g(e,t){var n=d[t];if(!n)throw new Error("invalid hit type <"+t+">");return J(e,n),e}function v(e,t){q(e,t)}this.removeHits=function(e){var t;h((t=".djs-hit",(e||document).querySelectorAll(t)),ae)},this.createDefaultHit=function(e,t){var n,i=e.waypoints,r=e.isFrame;return i?this.createWaypointsHit(t,i):(n=r?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=Ie(t);return g(n,"stroke"),v(e,n),n},this.createBoxHit=function(e,t,n){n=b({x:0,y:0},n);var i=pe("rect");return g(i,t),J(i,n),v(e,i),i},this.updateDefaultHit=function(e,t){var n=$(".djs-hit",t);if(n)return e.waypoints?function(e,t){J(e,{points:Le(t)})}(n,e.waypoints):J(n,{width:e.width,height:e.height}),n},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}Wi.$inject=["eventBus","elementRegistry","styles"];var zi={__init__:["interactionEvents"],interactionEvents:["type",Wi]},Gi=500;function Hi(e,t,n){this.offset=6;var i=t.cls("djs-outline",["no-fill"]),r=this;function a(e,t){var n=pe("rect");return J(n,b({x:10,y:10,width:100,height:100},i)),q(e,n),n}e.on(["shape.added","shape.changed"],Gi,function(e){var t=e.element,n=e.gfx,i=$(".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=$(".djs-outline",n);i||(i=a(n)),r.updateConnectionOutline(i,t)})}Hi.prototype.updateShapeOutline=function(e,t){J(e,{x:-this.offset,y:-this.offset,width:t.width+2*this.offset,height:t.height+2*this.offset})},Hi.prototype.updateConnectionOutline=function(e,t){var n=Fe(t);J(e,{x:n.x-this.offset,y:n.y-this.offset,width:n.width+2*this.offset,height:n.height+2*this.offset})},Hi.$inject=["eventBus","styles","elementRegistry"];var $i={__init__:["outline"],outline:["type",Hi]};function Ki(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)})}Ki.$inject=["eventBus"],Ki.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})}},Ki.prototype.get=function(){return this._selectedElements},Ki.prototype.isSelected=function(e){return-1!==this._selectedElements.indexOf(e)},Ki.prototype.select=function(e,t){var n=this._selectedElements,i=n.slice();r(e)||(e=e?[e]:[]),t?h(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 Ui="hover",qi="selected";function Yi(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,Ui)}),e.on("element.out",function(e){a(e.element,Ui)}),e.on("selection.changed",function(e){var t=e.oldSelection,n=e.newSelection;h(t,function(e){-1===n.indexOf(e)&&a(e,qi)}),h(n,function(e){-1===t.indexOf(e)&&r(e,qi)})})}function Xi(e,t,n,i){e.on("create.end",500,function(e){var n=e.context,i=n.canExecute,a=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;r(o)?t.select(o):t.select(a)}}),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);c(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=Fi(e);if(r&&a)return o?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,o)})}Yi.$inject=["eventBus","canvas","selection","styles"],Xi.$inject=["eventBus","selection","canvas","elementRegistry"];var Zi={__init__:["selectionVisuals","selectionBehavior"],__depends__:[zi,$i],selection:["type",Ki],selectionVisuals:["type",Yi],selectionBehavior:["type",Xi]};function Ji(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}Ji.prototype.next=function(){return this._prefix+ ++this._counter};var Qi=new Ji("ov");function er(e,t,n,i){var r,a;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=Qi,this._overlayDefaults=b({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),a=j('<div class="djs-overlay-container" style="position: absolute; width: 0; height: 0;" />'),r.insertBefore(a,r.firstChild),a),this._init()}function tr(e,t,n){b(e.style,{left:t+"px",top:n+"px"})}function nr(e,t){e.style.display=!1===t?"none":""}function ir(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}er.$inject=["config.overlays","eventBus","canvas","elementRegistry"],er.prototype.get=function(e){if(l(e)&&(e={id:e}),l(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?u(t.overlays,d({type:e.type})):t.overlays.slice():[]}return e.type?u(this._overlays,d({type:e.type})):e.id?this._overlays[e.id]:null},er.prototype.add=function(e,t,n){if(a(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=b({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},er.prototype.remove=function(e){var t=this.get(e)||[];r(t)||(t=[t]);var n=this;h(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(K(e.html),K(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)}})},er.prototype.show=function(){nr(this._overlayRoot)},er.prototype.hide=function(){nr(this._overlayRoot,!1)},er.prototype.clear=function(){this._overlays={},this._overlayContainers=[],C(this._overlayRoot)},er.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var a=Fe(t);i=a.x,r=a.y}tr(n,i,r),function(e,t,n){2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):e.setAttribute(t,n)}(e.html,"data-container-id",t.id)},er.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?Fe(a).width:a.width,o=-1*i.right+t);void 0!==i.bottom&&(n=a.waypoints?Fe(a).height:a.height,s=-1*i.bottom+n);tr(r,o||0,s||0)},er.prototype._createOverlayContainer=function(e){var t=j('<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},er.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";ir(this._overlayRoot,n)},er.prototype._getOverlayContainer=function(e,t){var n=c(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},er.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)),l(a)&&(a=j(a)),n=this._getOverlayContainer(r),(t=j('<div class="djs-overlay" data-overlay-id="'+i+'" style="position: absolute">')).appendChild(a),e.type&&S(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())},er.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,r=n&&n.minZoom,a=n&&n.maxZoom,o=e.htmlContainer,s=!0;n&&((i(r)&&r>t.scale||i(a)&&a<t.scale)&&(s=!1),nr(o,s)),this._updateOverlayScale(e,t)},er.prototype._updateOverlayScale=function(e,t){var n,r,a,o=e.scale,s=e.htmlContainer,l="";!0!==o&&(!1===o?(n=1,r=1):(n=o.min,r=o.max),i(n)&&t.scale<n&&(a=(1/t.scale||1)*n),i(r)&&t.scale>r&&(a=(1/t.scale||1)*r)),i(a)&&(l="scale("+a+","+a+")"),ir(s,l)},er.prototype._updateOverlaysVisibilty=function(e){var t=this;h(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},er.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;h(t.get({element:n}),function(e){t.remove(e.id)});var i=t._getOverlayContainer(n);if(i){K(i.html);var r=t._overlayContainers.indexOf(i);-1!==r&&t._overlayContainers.splice(r,1)}}),e.on("element.changed",500,function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(h(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&&S(n.html)[e.add?"add":"remove"](e.marker)}),e.on("diagram.clear",this.clear,this)};var rr={__init__:["overlays"],overlays:["type",er]},ar='<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>'))+'" />';
8/**
9 * This file must not be changed or exchanged.
10 *
11 * @see http://bpmn.io/license for more information.
12 */function or(e){return e.join(";")}var sr,lr='<div class="bjs-powered-by-lightbox" style="'+or(["z-index: 1001","position: fixed","top: 0","left: 0","right: 0","bottom: 0"])+'"><div class="backdrop" style="'+or(["width: 100%","height: 100%","background: rgba(0,0,0,0.2)"])+'"></div><div class="notice" style="'+or(["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">'+ar+'</a>Web-based tooling for BPMN, DMN and CMMN diagrams powered by <a href="http://bpmn.io" target="_blank">bpmn.io</a>.</div></div>';var pr={width:"100%",height:"100%",position:"relative"};function cr(e){return e+(o(e)?"px":"")}function ur(e){
13/**
14 * Adds the project logo to the diagram container as
15 * required by the bpmn.io license.
16 *
17 * @see http://bpmn.io/license
18 *
19 * @param {Element} container
20 */
21var t,n;e=b({},pr,e),this._moddle=this._createModdle(e),this._container=this._createContainer(e),t=this._container,n=j('<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">'+ar+"</a>"),t.appendChild(n),L.bind(n,"click",function(e){sr||(sr=j(lr),F.bind(sr,".backdrop","click",function(e){document.body.removeChild(sr)})),document.body.appendChild(sr),e.preventDefault()}),this._init(this._container,this._moddle,e)}function hr(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function mr(e,t){return(e=r(e)?e:[e]).indexOf(t.key)>-1}function fr(e){return e.shiftKey}e(ur,wt),ur.prototype.importXML=function(e,t,n){s(t)&&(n=t,t=null),n=n||function(){};var i=this;e=this._emit("import.parse.start",{xml:e})||e,this._moddle.fromXML(e,"bpmn:Definitions",function(e,r,a){r=i._emit("import.parse.complete",{error:e,definitions:r,context:a})||r;var o=a.warnings;if(e)return e=
22/**
23 * The code in the <project-logo></project-logo> area
24 * must not be changed.
25 *
26 * @see http://bpmn.io/license for more information.
27 */
28function(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),i._emit("import.done",{error:e,warnings:o}),n(e,o);i.importDefinitions(r,t,function(e,t){var r=[].concat(o,t||[]);i._emit("import.done",{error:e,warnings:r}),n(e,r)})})},ur.prototype.importDefinitions=function(e,t,n){return s(t)&&(n=t,t=null),n=n||function(){},this._setDefinitions(e),this.open(t,n)},ur.prototype.open=function(e,t){s(e)&&(t=e,e=null);var n=this._definitions,i=e;if(t=t||function(){},!n)return t(new Error("no XML imported"));if("string"==typeof e&&!(i=function(e,t){return t&&c(e.diagrams,function(e){return e.id===t})||null}(n,e)))return t(new Error("BPMNDiagram <"+e+"> not found"));try{this.clear()}catch(e){return t(e)}return function(e,t,n,i){var r,a,o;s(n)&&(i=n,n=null);var l,p=[];try{r=e.get("bpmnImporter"),a=e.get("eventBus"),o=e.get("translate"),a.fire("import.render.start",{definitions:t}),function(e,t){new Kn({root:function(e){return r.add(e)},element:function(e,t){return r.add(e,t)},error:function(e,t){p.push({message:e,context:t})}},o).handleDefinitions(e,t)}(t,n),a.fire("import.render.complete",{error:l,warnings:p})}catch(e){l=e}i(l,p)}(this,n,i,t)},ur.prototype.saveXML=function(e,t){t||(t=e,e={});var n=this,i=this._definitions;if(!i)return t(new Error("no definitions loaded"));i=this._emit("saveXML.start",{definitions:i})||i,this._moddle.toXML(i,e,function(e,i){try{i=n._emit("saveXML.serialized",{error:e,xml:i})||i,n._emit("saveXML.done",{error:e,xml:i})}catch(e){console.error("error in saveXML life-cycle listener",e)}t(e,i)})},ur.prototype.saveSVG=function(e,t){var n,i;t||(t=e,e={}),this._emit("saveSVG.start");try{var r=this.get("canvas"),a=r.getDefaultLayer(),o=$("defs",r._svg),s=xe(a),l=o?"<defs>"+xe(o)+"</defs>":"",p=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="'+p.width+'" height="'+p.height+'" viewBox="'+p.x+" "+p.y+" "+p.width+" "+p.height+'" version="1.1">'+l+s+"</svg>"}catch(e){i=e}this._emit("saveSVG.done",{error:i,svg:n}),t(i,n)},ur.prototype._setDefinitions=function(e){this._definitions=e},ur.prototype.getModules=function(){return this._modules},ur.prototype.clear=function(){this.get("elementRegistry").forEach(function(e){var t=e.businessObject;t&&t.di&&delete t.di}),wt.prototype.clear.call(this)},ur.prototype.destroy=function(){wt.prototype.destroy.call(this),K(this._container)},ur.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},ur.prototype.off=function(e,t){this.get("eventBus").off(e,t)},ur.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=$(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},ur.prototype.getDefinitions=function(){return this._definitions},ur.prototype.detach=function(){var e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},ur.prototype._init=function(e,t,n){var i,r,a=n.modules||this.getModules(),o=n.additionalModules||[],s=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],a,o),l=b((i=["additionalModules"],r={},h(Object(n),function(e,t){-1===i.indexOf(t)&&(r[t]=e)}),r),{canvas:b({},n.canvas,{container:e}),modules:s});wt.call(this,l),n&&n.container&&this.attachTo(n.container)},ur.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},ur.prototype._createContainer=function(e){var t=j('<div class="bjs-container"></div>');return b(t.style,{width:cr(e.width),height:cr(e.height),position:e.position}),t},ur.prototype._createModdle=function(e){return new zn(b({},this._moddleExtensions,e.moddleExtensions))},ur.prototype._modules=[Oi,Ai,Zi,rr],ur.prototype._moddleExtensions={};function dr(e,t){var n=this;this._config=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),t.on("diagram.init",function(){n._fire("init")}),t.on("attach",function(){e&&e.bindTo&&n.bind(e.bindTo)}),t.on("detach",function(){n.unbind()})}dr.$inject=["config.keyboard","eventBus"],dr.prototype._keydownHandler=function(e){this._keyHandler(e,"keyboard.keydown")},dr.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},dr.prototype._keyHandler=function(e,t){if(!function(e){return e&&(H(e,"input, textarea")||"true"===e.contentEditable)}(e.target)){var n={keyEvent:e};this._eventBus.fire(t||"keyboard.keydown",n)&&e.preventDefault()}},dr.prototype.bind=function(e){this.unbind(),this._node=e,L.bind(e,"keydown",this._keydownHandler,!0),L.bind(e,"keyup",this._keyupHandler,!0),this._fire("bind")},dr.prototype.getBinding=function(){return this._node},dr.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),L.unbind(e,"keydown",this._keydownHandler,!0),L.unbind(e,"keyup",this._keyupHandler,!0)),this._node=null},dr.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},dr.prototype.addListener=function(e,t,n){s(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||"keyboard.keydown",e,t)},dr.prototype.removeListener=function(e,t){this._eventBus.off(t||"keyboard.keydown",e)},dr.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},dr.prototype.isCmd=hr,dr.prototype.isShift=fr,dr.prototype.isKey=mr;var yr=500;function gr(e,t){var n=this;e.on("editorActions.init",yr,function(e){var i=e.editorActions;n.registerBindings(t,i)})}gr.$inject=["eventBus","keyboard"],gr.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",function(e){var n=e.keyEvent;if(hr(n)&&!fr(n)&&mr(["z","Z"],n))return t.trigger("undo"),!0}),n("redo",function(e){var n=e.keyEvent;if(hr(n)&&(mr(["y","Y"],n)||mr(["z","Z"],n)&&fr(n)))return t.trigger("redo"),!0}),n("copy",function(e){var n=e.keyEvent;if(hr(n)&&mr(["c","C"],n))return t.trigger("copy"),!0}),n("paste",function(e){var n=e.keyEvent;if(hr(n)&&mr(["v","V"],n))return t.trigger("paste"),!0}),n("stepZoom",function(e){var n=e.keyEvent;if(mr(["+","Add"],n)&&hr(n))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(e){var n=e.keyEvent;if(mr(["-","Subtract"],n)&&hr(n))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(e){var n=e.keyEvent;if(mr("0",n)&&hr(n))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(e){if(mr(["Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0})};var vr={__init__:["keyboard","keyboardBindings"],keyboard:["type",dr],keyboardBindings:["type",gr]},xr={moveSpeed:50,moveSpeedAccelerated:200};function br(e,t,n){var i=this;this._config=b({},xr,e||{}),t.addListener(function(e){var n=e.keyEvent,r=i._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var a,o=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":a="left";break;case"ArrowUp":case"Up":a="up";break;case"ArrowRight":case"Right":a="right";break;case"ArrowDown":case"Down":a="down"}return i.moveCanvas({speed:o,direction:a}),!0}}),this.moveCanvas=function(e){var t=0,i=0,r=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":i=r;break;case"right":t=-r;break;case"down":i=-r}n.scroll({dx:t,dy:i})}}br.$inject=["config.keyboardMove","keyboard","canvas"];var Er={__depends__:[vr],__init__:["keyboardMove"],keyboardMove:["type",br]},wr=/^djs-cursor-.*$/;function _r(e){var t=S(document.body);t.removeMatching(wr),e&&t.add("djs-cursor-"+e)}var Ar=5e3;function Sr(e,t){return{x:e.x-t.x,y:e.y-t.y}}var Rr=15;function Cr(e,t){var n;function i(i){var r,a=n.start,o=Li(i),s=Sr(o,a);(!n.dragging&&(r=s,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>Rr)&&(n.dragging=!0,function(e,t){function n(){return!1}t=t||"element.click",e.once(t,Ar,n)}(e),_r("grab")),n.dragging)&&(s=Sr(o,n.last||n.start),t.scroll({dx:s.x,dy:s.y}),n.last=o);i.preventDefault()}function r(e){L.unbind(document,"mousemove",i),L.unbind(document,"mouseup",r),n=null,_r(null)}e.on("element.mousedown",500,function(e){return function(e){if(D(e.target,".djs-draggable"))return;if(e.button||e.ctrlKey||e.shiftKey||e.altKey)return;return n={start:Li(e)},L.bind(document,"mousemove",i),L.bind(document,"mouseup",r),!0}(e.originalEvent)})}Cr.$inject=["eventBus","canvas"];var kr={__init__:["moveCanvas"],moveCanvas:["type",Cr]};function Mr(e){return Math.log(e)/Math.log(10)}function Pr(e,t){var n=Mr(e.min),i=Mr(e.max);return(Math.abs(n)+Math.abs(i))/t}var Tr=Math.sign||function(e){return e>=0?1:-1},Dr={min:.2,max:4},Nr=.75;function Or(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=v(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||Nr;var i=this;t.on("canvas.init",function(t){i._init(!1!==e.enabled)})}Or.$inject=["config.zoomScroll","eventBus","canvas"],Or.prototype.scroll=function(e){this._canvas.scroll(e)},Or.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Or.prototype.zoom=function(e,t){var n=Pr(Dr,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Or.prototype._handleWheel=function(e){if(!D(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))*Tr(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)}},Or.prototype.stepZoom=function(e,t){var n=Pr(Dr,10);this._zoom(e,t,n)},Or.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,a=Mr(i.zoom()),o=Math.round(a/n)*n;o+=n*r;var s,l,p=Math.pow(10,o);i.zoom((s=Dr,l=p,Math.max(s.min,Math.min(s.max,l))),t)},Or.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&L[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Or.prototype._init=function(e){this.toggle(e)};var Br={__init__:["zoomScroll"],zoomScroll:["type",Or]};function Lr(e){ur.call(this,e)}return e(Lr,ur),Lr.prototype._navigationModules=[Er,kr,Br],Lr.prototype._modules=[].concat(Lr.prototype._modules,Lr.prototype._navigationModules),Lr});